@intent-hq/web 2.327.2 → 2.327.4

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 (242) hide show
  1. package/bin/intent-web.mjs +2 -0
  2. package/package.json +1 -1
  3. package/web/app/immutable/assets/{14.HorMMNG4.css → 14.CU62PBbE.css} +1 -1
  4. package/web/app/immutable/assets/16.DdJIHg9f.css +1 -0
  5. package/web/app/immutable/assets/ChatPanel.B73KM22O.css +1 -0
  6. package/web/app/immutable/assets/{16.CQiMfhJh.css → DockRecordingEditor.Cpd07eyT.css} +1 -1
  7. package/web/app/immutable/assets/conversation-turns.BHHyRLdd.css +1 -0
  8. package/web/app/immutable/chunks/{7k5ozo9c.js → -DqWFMjY.js} +1 -1
  9. package/web/app/immutable/chunks/{DvnDAxdo.js → 0rLfviYO.js} +1 -1
  10. package/web/app/immutable/chunks/{BV4AHhCq.js → 13JKYtK_.js} +1 -1
  11. package/web/app/immutable/chunks/{CAL5qbag.js → 4IYHA49l.js} +1 -1
  12. package/web/app/immutable/chunks/{C1TwLTiC.js → 4Zskc9_e.js} +1 -1
  13. package/web/app/immutable/chunks/{DQfuBwT8.js → 4mn3OQkh.js} +1 -1
  14. package/web/app/immutable/chunks/{BK3YE2GB.js → 5fWnBOdu.js} +1 -1
  15. package/web/app/immutable/chunks/{Ca3Yads8.js → 5lVDKMGV.js} +4 -4
  16. package/web/app/immutable/chunks/{Aw3-65IC.js → 95-CBX6k.js} +1 -1
  17. package/web/app/immutable/chunks/{fSndiqme.js → 9jHc2HrQ.js} +1 -1
  18. package/web/app/immutable/chunks/{CKjldRop.js → 9o72bVmU.js} +1 -1
  19. package/web/app/immutable/chunks/{Ou2B083h.js → 9xAB6iEw.js} +3 -3
  20. package/web/app/immutable/chunks/{BbEZgkca.js → A7QYlP8X.js} +2 -2
  21. package/web/app/immutable/chunks/{7rjdCDDK.js → B0J8YEPJ.js} +1 -1
  22. package/web/app/immutable/chunks/{DF5OSHTI.js → B3GFeWXU.js} +1 -1
  23. package/web/app/immutable/chunks/{DTOenBGo.js → B5JLqeOx.js} +1 -1
  24. package/web/app/immutable/chunks/{C-am1GTe.js → B6X5Wi93.js} +1 -1
  25. package/web/app/immutable/chunks/{B-LxAE4l.js → B6hQw8HR.js} +1 -1
  26. package/web/app/immutable/chunks/B7dOkBeu.js +1 -0
  27. package/web/app/immutable/chunks/{D4fSLYwV.js → B8AHyIcJ.js} +1 -1
  28. package/web/app/immutable/chunks/{Bhff3giG.js → B9k9ipWN.js} +1 -1
  29. package/web/app/immutable/chunks/{HpcR9-ZP.js → B9xeURWe.js} +1 -1
  30. package/web/app/immutable/chunks/{DeQzn7pT.js → BA1UhUwc.js} +7 -7
  31. package/web/app/immutable/chunks/{BXo80d0I.js → BAgeXgSf.js} +1 -1
  32. package/web/app/immutable/chunks/{Gh0Bk6WC.js → BBy57-xG.js} +1 -1
  33. package/web/app/immutable/chunks/{C9-oKvmU.js → BCc6fRgu.js} +1 -1
  34. package/web/app/immutable/chunks/{CypQ6Hrf.js → BEOwcfbQ.js} +1 -1
  35. package/web/app/immutable/chunks/{CLDLGPLG.js → BGT3aL1b.js} +1 -1
  36. package/web/app/immutable/chunks/BH7mKpum.js +1 -0
  37. package/web/app/immutable/chunks/{2Yr7qZy-.js → BJptJeKO.js} +1 -1
  38. package/web/app/immutable/chunks/{ChyK3c5O.js → BJqJJOp_.js} +1 -1
  39. package/web/app/immutable/chunks/{BxRFeUGV.js → BJyBc51V.js} +1 -1
  40. package/web/app/immutable/chunks/{D7NWkz7l.js → BL9TmjaL.js} +1 -1
  41. package/web/app/immutable/chunks/{D4wVqBkS.js → BLyZPAr5.js} +1 -1
  42. package/web/app/immutable/chunks/{C1vc2ZF2.js → BMtNlV8v.js} +1 -1
  43. package/web/app/immutable/chunks/{CqnfptVg.js → BOR1_TRO.js} +1 -1
  44. package/web/app/immutable/chunks/{CpOX1cm0.js → BRdBfY-O.js} +4 -4
  45. package/web/app/immutable/chunks/{XKfxOi0c.js → BRpgL-_J.js} +1 -1
  46. package/web/app/immutable/chunks/{C0AexULD.js → BS6nPK7B.js} +1 -1
  47. package/web/app/immutable/chunks/{DkPB5Gyi.js → BSVsWuXl.js} +1 -1
  48. package/web/app/immutable/chunks/{DAXKoZjm.js → BT5Z8Ufg.js} +1 -1
  49. package/web/app/immutable/chunks/{DCo2M5nt.js → BU_i_vpd.js} +1 -1
  50. package/web/app/immutable/chunks/{BvULLTwA.js → BUsZHo0X.js} +2 -2
  51. package/web/app/immutable/chunks/BX9t7Lu-.js +190 -0
  52. package/web/app/immutable/chunks/{DZzTUgIA.js → BY8Jls8O.js} +1 -1
  53. package/web/app/immutable/chunks/{jgNaB-mi.js → BZ9svoQk.js} +1 -1
  54. package/web/app/immutable/chunks/{CdlZ8r5v.js → BZKFinnt.js} +1 -1
  55. package/web/app/immutable/chunks/{Dmq2MLxr.js → BbOZc-at.js} +1 -1
  56. package/web/app/immutable/chunks/{D_TIL4Xc.js → Bc2kn6EH.js} +1 -1
  57. package/web/app/immutable/chunks/{M0UFWl_S.js → BdQCA_Nv.js} +1 -1
  58. package/web/app/immutable/chunks/BdWqymET.js +1 -0
  59. package/web/app/immutable/chunks/{_tv07_-D.js → Bdhho7CC.js} +1 -1
  60. package/web/app/immutable/chunks/{Bq9BF2kT.js → BfIdeT8L.js} +1 -1
  61. package/web/app/immutable/chunks/{Dd-c6aT7.js → BfWiwhpc.js} +1 -1
  62. package/web/app/immutable/chunks/{BerYBtY0.js → BgxXTSJ6.js} +1 -1
  63. package/web/app/immutable/chunks/{Q-FVgluz.js → Bjrk7UMZ.js} +1 -1
  64. package/web/app/immutable/chunks/{RgXiUiyX.js → BmIgxNuB.js} +1 -1
  65. package/web/app/immutable/chunks/{BJpbRkma.js → BoIGV7s7.js} +1 -1
  66. package/web/app/immutable/chunks/{D-YrUZis.js → Br_KUH7F.js} +1 -1
  67. package/web/app/immutable/chunks/{CuimWTUN.js → Bs5pujY-.js} +1 -1
  68. package/web/app/immutable/chunks/{BclymnXe.js → BtrIIAMB.js} +1 -1
  69. package/web/app/immutable/chunks/{C6LN2Lq-.js → Bv_0taxh.js} +1 -1
  70. package/web/app/immutable/chunks/{CDFRtA1F.js → Bw4y3_Ol.js} +1 -1
  71. package/web/app/immutable/chunks/{BOod2-vo.js → Bxub7VY-.js} +1 -1
  72. package/web/app/immutable/chunks/{B6ZEHAgn.js → BxxGMnsj.js} +1 -1
  73. package/web/app/immutable/chunks/BzV5CowC.js +1 -0
  74. package/web/app/immutable/chunks/{C5bHHEee.js → C3Gi_9p3.js} +1 -1
  75. package/web/app/immutable/chunks/{dinOFH6z.js → C4Tw7-py.js} +1 -1
  76. package/web/app/immutable/chunks/{Dr-K85Pz.js → C4xkBjNQ.js} +1 -1
  77. package/web/app/immutable/chunks/{CPzusSaQ.js → C58HgKcj.js} +1 -1
  78. package/web/app/immutable/chunks/{ewlOsRgS.js → C5MuNtit.js} +1 -1
  79. package/web/app/immutable/chunks/{D19QPbvx.js → C5PRf5_x.js} +3 -3
  80. package/web/app/immutable/chunks/{BbiJIN_E.js → C6DXM5lO.js} +1 -1
  81. package/web/app/immutable/chunks/{ColHxoku.js → C6bEmXfu.js} +4 -4
  82. package/web/app/immutable/chunks/{CNZwPZBB.js → C8PcVt0F.js} +1 -1
  83. package/web/app/immutable/chunks/{DhJNH_hq.js → C9ruBEtx.js} +1 -1
  84. package/web/app/immutable/chunks/{B4Rscrf6.js → CB_tD4hW.js} +1 -1
  85. package/web/app/immutable/chunks/{B1nmZwVF.js → CBgs1jD4.js} +1 -1
  86. package/web/app/immutable/chunks/{D1ynivqZ.js → CIJcws70.js} +1 -1
  87. package/web/app/immutable/chunks/{BaUvfuFA.js → CKGr2YTz.js} +1 -1
  88. package/web/app/immutable/chunks/{marbulK7.js → CMR4YeKo.js} +1 -1
  89. package/web/app/immutable/chunks/{C7eFRIGF.js → CMmbfhfC.js} +1 -1
  90. package/web/app/immutable/chunks/{C_4hXDel.js → CP2Kg1B4.js} +1 -1
  91. package/web/app/immutable/chunks/{Dp0wSsDS.js → CPFrNISL.js} +2 -2
  92. package/web/app/immutable/chunks/{DeB-Py0k.js → CQNA0ds6.js} +1 -1
  93. package/web/app/immutable/chunks/{BwVx_Xm9.js → CR1VVB-y.js} +1 -1
  94. package/web/app/immutable/chunks/{D4wUHJ-V.js → CR7xGCmU.js} +1 -1
  95. package/web/app/immutable/chunks/{CW9PUdij.js → CRCP-bLi.js} +1 -1
  96. package/web/app/immutable/chunks/{Cwdoe-yo.js → CRinz0qf.js} +1 -1
  97. package/web/app/immutable/chunks/{CTMsT2IU.js → CRkupLLY.js} +3 -3
  98. package/web/app/immutable/chunks/{D8dE5NKO.js → CSiaiLHL.js} +1 -1
  99. package/web/app/immutable/chunks/{B4Qf0RS5.js → CUF2wY0B.js} +1 -1
  100. package/web/app/immutable/chunks/{D_kdhP8o.js → CUNya7Ty.js} +1 -1
  101. package/web/app/immutable/chunks/{DgtgAyRj.js → CVCmU8cH.js} +1 -1
  102. package/web/app/immutable/chunks/{CpPVAOg5.js → CVWsHMge.js} +1 -1
  103. package/web/app/immutable/chunks/{Cw26kBCe.js → CZnfw8n4.js} +1 -1
  104. package/web/app/immutable/chunks/{BGUHg5o_.js → Cb0R6qJM.js} +1 -1
  105. package/web/app/immutable/chunks/{CoZ28bOB.js → CcNhqKh5.js} +1 -1
  106. package/web/app/immutable/chunks/CdVR7Ll7.js +1 -0
  107. package/web/app/immutable/chunks/{BJFbczXI.js → CdbmwjaM.js} +1 -1
  108. package/web/app/immutable/chunks/{COyObFie.js → Cds8-CeJ.js} +1 -1
  109. package/web/app/immutable/chunks/{jxb5pgpW.js → CgpltzkY.js} +1 -1
  110. package/web/app/immutable/chunks/{DoKuqfYA.js → Cjxd8cwf.js} +1 -1
  111. package/web/app/immutable/chunks/{BFQmpH-Y.js → ClIEAc52.js} +1 -1
  112. package/web/app/immutable/chunks/{BedviAdk.js → CmPULPQO.js} +1 -1
  113. package/web/app/immutable/chunks/{Cy1SRgRj.js → CqajeRKF.js} +1 -1
  114. package/web/app/immutable/chunks/{C7VjZ5I1.js → Cr2ds2GX.js} +1 -1
  115. package/web/app/immutable/chunks/{uxNvmxnz.js → Crtm1Tdw.js} +1 -1
  116. package/web/app/immutable/chunks/{DacYbmEF.js → CsQZrNPD.js} +1 -1
  117. package/web/app/immutable/chunks/{DoV4Ngwf.js → CseMAxRT.js} +1 -1
  118. package/web/app/immutable/chunks/{BDUVRWqe.js → CtDsnagM.js} +3 -3
  119. package/web/app/immutable/chunks/{l7AMrk83.js → Cue9ti62.js} +1 -1
  120. package/web/app/immutable/chunks/{b8_D7H9k.js → CwBXGgp6.js} +1 -1
  121. package/web/app/immutable/chunks/{CTc1mqQ1.js → CwW6ndDl.js} +1 -1
  122. package/web/app/immutable/chunks/{DbYMKWAI.js → D17qSIEz.js} +2 -2
  123. package/web/app/immutable/chunks/{Do9PiZ5P.js → D1EubvTh.js} +2 -2
  124. package/web/app/immutable/chunks/D1Wd8yWC.js +12 -0
  125. package/web/app/immutable/chunks/{DwkxcWNI.js → D3glRUn0.js} +2 -2
  126. package/web/app/immutable/chunks/{qB-JaQGy.js → D3pCGnn6.js} +1 -1
  127. package/web/app/immutable/chunks/{Byv1V5rF.js → D5Vbuf5Q.js} +1 -1
  128. package/web/app/immutable/chunks/{DguixOqZ.js → D86pbdSK.js} +1 -1
  129. package/web/app/immutable/chunks/{DGuIJztL.js → D8POxNfK.js} +1 -1
  130. package/web/app/immutable/chunks/{ffjPpoAP.js → D9fDSLwb.js} +1 -1
  131. package/web/app/immutable/chunks/{C5mH9Vrl.js → DG3MtJwi.js} +1 -1
  132. package/web/app/immutable/chunks/DKDYIgLv.js +11 -0
  133. package/web/app/immutable/chunks/{LknVBIaq.js → DMsh1yGi.js} +1 -1
  134. package/web/app/immutable/chunks/{BOY33UBS.js → DMv-E05P.js} +4 -4
  135. package/web/app/immutable/chunks/{D7jA8MQK.js → DPXmbcdl.js} +1 -1
  136. package/web/app/immutable/chunks/{D9E32u14.js → DRBvR0Tt.js} +1 -1
  137. package/web/app/immutable/chunks/{DhAAH4rU.js → DRLE5FVS.js} +1 -1
  138. package/web/app/immutable/chunks/{Bw8BPAST.js → DSjgIWnH.js} +1 -1
  139. package/web/app/immutable/chunks/{gnxdhh79.js → DUGrMwWd.js} +1 -1
  140. package/web/app/immutable/chunks/{CaaDYQm4.js → DV6D0Bkp.js} +5 -5
  141. package/web/app/immutable/chunks/{DVnJa0eT.js → DVAV2MG2.js} +1 -1
  142. package/web/app/immutable/chunks/{Fb6bTqJy.js → DVEpt846.js} +1 -1
  143. package/web/app/immutable/chunks/{Ciht8P3-.js → DXmYCfpj.js} +1 -1
  144. package/web/app/immutable/chunks/{BmnlV2jU.js → DYU4YpuR.js} +1 -1
  145. package/web/app/immutable/chunks/{DFxg8FPE.js → Dc2Hdtlu.js} +1 -1
  146. package/web/app/immutable/chunks/{BsesepNZ.js → De3HYtL6.js} +1 -1
  147. package/web/app/immutable/chunks/{7nLxl2IJ.js → DfxmKh09.js} +1 -1
  148. package/web/app/immutable/chunks/{CB-J-0bJ.js → DgyZhpgg.js} +1 -1
  149. package/web/app/immutable/chunks/{YcWsBw0J.js → DhFS-yhc.js} +1 -1
  150. package/web/app/immutable/chunks/{CvG8wNT6.js → Dk4Ddrsx.js} +1 -1
  151. package/web/app/immutable/chunks/{MgRcWC-F.js → Dk8ELDo2.js} +1 -1
  152. package/web/app/immutable/chunks/{CLbcqiJX.js → DkHQqDIr.js} +1 -1
  153. package/web/app/immutable/chunks/{DT-w4ZA3.js → DlTQCTDP.js} +1 -1
  154. package/web/app/immutable/chunks/DmQ8h8xi.js +1 -0
  155. package/web/app/immutable/chunks/{X6OEIYik.js → Dn7dutqt.js} +1 -1
  156. package/web/app/immutable/chunks/{9taqgPH1.js → DnkVLfZ3.js} +1 -1
  157. package/web/app/immutable/chunks/{BgiA9PsC.js → DrS3YtfK.js} +2 -2
  158. package/web/app/immutable/chunks/{ClHpwdNk.js → Dv5hWj70.js} +1 -1
  159. package/web/app/immutable/chunks/{Bil-5-Mv.js → DvSMiV5j.js} +1 -1
  160. package/web/app/immutable/chunks/{Es_LZ_6E.js → DvzRlb0E.js} +1 -1
  161. package/web/app/immutable/chunks/{n9Db8fQb.js → DxGU3xpZ.js} +1 -1
  162. package/web/app/immutable/chunks/{ClBnJ15C.js → ECTD8W-L.js} +1 -1
  163. package/web/app/immutable/chunks/{CcSZNfbk.js → EotFP58O.js} +1 -1
  164. package/web/app/immutable/chunks/{BwY7DKzU.js → FQUUYt8f.js} +1 -1
  165. package/web/app/immutable/chunks/{BBYPPwon.js → FyCAxxbB.js} +1 -1
  166. package/web/app/immutable/chunks/{wOsjtdPJ.js → KVLkeJBt.js} +1 -1
  167. package/web/app/immutable/chunks/{DFghII67.js → Ld9N5V0Z.js} +1 -1
  168. package/web/app/immutable/chunks/{CdhZKdub.js → NjepB5TE.js} +1 -1
  169. package/web/app/immutable/chunks/{Ph7T0qF8.js → OY7xFhVZ.js} +1 -1
  170. package/web/app/immutable/chunks/{DkcUxSHK.js → PlbZiyMr.js} +1 -1
  171. package/web/app/immutable/chunks/{2bCqOBlF.js → PnXyzret.js} +2 -2
  172. package/web/app/immutable/chunks/PpSNoAPM.js +1 -0
  173. package/web/app/immutable/chunks/Pw8-HxaI.js +408 -0
  174. package/web/app/immutable/chunks/{COPJQClu.js → Q9zhiNlv.js} +1 -1
  175. package/web/app/immutable/chunks/{CIno4eJd.js → R736-vzp.js} +1 -1
  176. package/web/app/immutable/chunks/{B_oexMWu.js → SP1g61ea.js} +1 -1
  177. package/web/app/immutable/chunks/{95PmebfY.js → U2OaO8zU.js} +1 -1
  178. package/web/app/immutable/chunks/{HdOtmFfs.js → UvxFr-I2.js} +1 -1
  179. package/web/app/immutable/chunks/VCguIe99.js +1 -0
  180. package/web/app/immutable/chunks/{IsBHRTqp.js → VxpSEzE0.js} +1 -1
  181. package/web/app/immutable/chunks/{BTxVcBTE.js → WKwDz9jQ.js} +1 -1
  182. package/web/app/immutable/chunks/{C4ih-xND.js → WPm8oU1g.js} +2 -2
  183. package/web/app/immutable/chunks/{B-B22ZmQ.js → X9_JIY5I.js} +1 -1
  184. package/web/app/immutable/chunks/{CpW6JN4X.js → YqTahsxp.js} +1 -1
  185. package/web/app/immutable/chunks/{CYgFtonv.js → Z311vB9V.js} +1 -1
  186. package/web/app/immutable/chunks/{BYCQnKWG.js → bqazsiqQ.js} +1 -1
  187. package/web/app/immutable/chunks/e_7d0HhT.js +271 -0
  188. package/web/app/immutable/chunks/{1JDc8gDP.js → evMM8bqV.js} +1 -1
  189. package/web/app/immutable/chunks/{BUU84hQY.js → felZLd_I.js} +1 -1
  190. package/web/app/immutable/chunks/{CBEZBV7x.js → gDHuvKO5.js} +1 -1
  191. package/web/app/immutable/chunks/gP4ZqKh0.js +5 -0
  192. package/web/app/immutable/chunks/{-ntpqjUQ.js → hua24XJh.js} +1 -1
  193. package/web/app/immutable/chunks/{B-mVY4KG.js → hwMB9Jx_.js} +1 -1
  194. package/web/app/immutable/chunks/{D6NxvjAo.js → kw6HOG6J.js} +2 -2
  195. package/web/app/immutable/chunks/{CXCbFJ1d.js → mo2YzLEW.js} +1 -1
  196. package/web/app/immutable/chunks/{C2vxCrLD.js → qH6ij_zT.js} +1 -1
  197. package/web/app/immutable/chunks/{C5SMJxa0.js → rDgjtPAw.js} +2 -2
  198. package/web/app/immutable/chunks/{DpJ6ItFS.js → rz5fXBI2.js} +1 -1
  199. package/web/app/immutable/chunks/{CzSCQAr8.js → sAd9qIlC.js} +1 -1
  200. package/web/app/immutable/chunks/{DqLpc8uk.js → sm9FgN6B.js} +1 -1
  201. package/web/app/immutable/entry/app.nL8LhceC.js +4 -0
  202. package/web/app/immutable/entry/start.DMMboC2Z.js +1 -0
  203. package/web/app/immutable/nodes/{0.D4UmpUyl.js → 0.DnTOWH22.js} +1 -1
  204. package/web/app/immutable/nodes/{1.DTuLvyGe.js → 1.DdFwPgy2.js} +1 -1
  205. package/web/app/immutable/nodes/{10.yW5YYZcV.js → 10.BodWJQlD.js} +1 -1
  206. package/web/app/immutable/nodes/{12.B-WFagfi.js → 12.CZF6J8V0.js} +1 -1
  207. package/web/app/immutable/nodes/{13.knDmuG_H.js → 13.CmgBwUCN.js} +1 -1
  208. package/web/app/immutable/nodes/14.Cch3Hlry.js +3 -0
  209. package/web/app/immutable/nodes/{15.5d-87wXx.js → 15.D8X9TwUZ.js} +1 -1
  210. package/web/app/immutable/nodes/16.DDUlFhjD.js +2 -0
  211. package/web/app/immutable/nodes/{17.S_DWC10F.js → 17.CR8Vf-gp.js} +2 -2
  212. package/web/app/immutable/nodes/{2.D-iQ8fmd.js → 2.DJ8VmJpJ.js} +12 -12
  213. package/web/app/immutable/nodes/{3.CQKvVdrW.js → 3.B0GEDD6l.js} +1 -1
  214. package/web/app/immutable/nodes/{4.Dq9WSzj3.js → 4.C1EmG9sP.js} +1 -1
  215. package/web/app/immutable/nodes/{5.C2b8MeJP.js → 5.weYY_j2P.js} +1 -1
  216. package/web/app/immutable/nodes/{6.DZyVWynY.js → 6.BDlVx9Dk.js} +1 -1
  217. package/web/app/immutable/nodes/{7.BNPj2Hjb.js → 7.C0Ip3FSb.js} +1 -1
  218. package/web/app/immutable/nodes/{8.CYaF3iZ7.js → 8.CpQw4Gbe.js} +4 -4
  219. package/web/app/immutable/nodes/{9.D9yeuWg6.js → 9.DT0bh2W_.js} +5 -5
  220. package/web/app/version.json +1 -1
  221. package/web/index.html +14 -14
  222. package/web/app/immutable/assets/ChatPanel.CbI83JII.css +0 -1
  223. package/web/app/immutable/assets/conversation-turns.uwdl8ht7.css +0 -1
  224. package/web/app/immutable/chunks/BJzHxIyr.js +0 -1
  225. package/web/app/immutable/chunks/BQKilZql.js +0 -190
  226. package/web/app/immutable/chunks/Bdee7uP3.js +0 -1
  227. package/web/app/immutable/chunks/C3g8Ux-E.js +0 -408
  228. package/web/app/immutable/chunks/CJvik4ry.js +0 -1
  229. package/web/app/immutable/chunks/D0OfnhNR.js +0 -11
  230. package/web/app/immutable/chunks/D3NOBSUZ.js +0 -271
  231. package/web/app/immutable/chunks/DLrZLCmS.js +0 -1
  232. package/web/app/immutable/chunks/DSwaqM2D.js +0 -1
  233. package/web/app/immutable/chunks/Debl1LJu.js +0 -1
  234. package/web/app/immutable/chunks/DqIdPWw6.js +0 -1
  235. package/web/app/immutable/chunks/DsvlGcLM.js +0 -9
  236. package/web/app/immutable/chunks/DuXpPbhO.js +0 -5
  237. package/web/app/immutable/chunks/tVWh__3e.js +0 -1
  238. package/web/app/immutable/chunks/xNaKu_mj.js +0 -1
  239. package/web/app/immutable/entry/app.CUk63TN3.js +0 -4
  240. package/web/app/immutable/entry/start.ByRHyT3-.js +0 -1
  241. package/web/app/immutable/nodes/14.CtAbrlVb.js +0 -3
  242. package/web/app/immutable/nodes/16.BcAEiIYy.js +0 -2
@@ -1,2 +1,2 @@
1
- import{O as G,g as Q,ao as V,al as j,aw as z,p as X,a as J}from"./BsesepNZ.js";import{Ig as l,ny as h,nz as R,Ip as N,bf as T,Y,nl as _,r7 as H,rt as $,k5 as Z,rr as B,IH as O,qP as ee,fF as q,r8 as P,_ as te,bd as ne,g as se}from"./BJpbRkma.js";import{y as F,aA as oe,v as ie}from"./IsBHRTqp.js";import{g as K}from"./DypB-Dwi.js";const re=["[WORKSPACE EVENTS]","[TASK WAKE]","[AGENT MESSAGE]"];function ae(e){const t=e.metadata;if(t&&typeof t=="object"){if(t.type==="question_answers")return!1;if(!G(t))return!0}const n=Q(e);return re.some(s=>n.startsWith(s))}const x=1440*60*1e3;function ce(e){let t=null;for(const n of e){if(ae({id:n.id,timestamp:n.createdAt,metadata:n.metadata,contentBlocks:[{type:"text",text:n.preview.trimStart()}]}))continue;const s=Date.parse(n.createdAt);Number.isFinite(s)&&(t===null||s>t)&&(t=s)}return t}const de=50,le=20;function W(e,t){return e===null||t!==null&&t>e?t:e}async function Be(e,t){let n,s=null;for(let o=0;o<le;o++){const i=await e({limit:de,nextToken:n});if(!i.ok)return null;const a=i.items;s===null&&a.length>0&&(s=a[a.length-1].id);const d=t?.newestId!=null?a.findIndex(c=>c.id===t.newestId):-1,r=ce(d>=0?a.slice(d+1):a);if(d>=0)return{latest:W(r,t?.latest??null),newestId:s};if(r!==null)return{latest:W(r,t?.latest??null),newestId:s};if(typeof i.nextToken!="string")return{latest:null,newestId:s};n=i.nextToken}return{latest:t?.latest??null,newestId:s}}function ue(e,t){return e!=null&&e<=t&&e>t-x}function ge(e,t){return e!=null&&Number.isFinite(e)&&e>0&&e<=t-x}function fe(e,t){const{workspaceId:n,agentId:s,authority:o,nativePairId:i,evidence:a}=e;if(!n||!s||!o||o!==t)return null;const d=JSON.stringify([n,s]);if(i!==d||a?.id!==d)return null;const r=a.clips.find(c=>c.status==="recording");return!r||!Number.isFinite(r.startedAt)||!Number.isFinite(r.pausedMs??0)||r.pausedAt!=null&&!Number.isFinite(r.pausedAt)?null:{workspaceId:n,agentId:s,clipId:r.id,startedAt:r.startedAt,pausedAt:r.pausedAt??null,pausedMs:r.pausedMs??0}}function We(e,t){return t!==void 0&&e!==t?"ignore":e?"stop":"start"}const De=l.createSelector(e=>{const t=e.dockConversation,n=t.workspaceId&&t.agentId?JSON.stringify([t.workspaceId,t.agentId]):null;return fe({workspaceId:t.workspaceId,agentId:t.agentId,authority:t.authority,nativePairId:t.nativeSpeech.pairId,evidence:n?h(t.evidence,n):null},K(e))});l.createSelector(e=>e.hud.active);l.createSelector(e=>e.hud.feed);l.createSelector(e=>e.hud.usage);l.createSelector(e=>e.hud.usageError);const Ee=l.createSelector(e=>e.hud.rateHistory),Ne=l.createSelector(e=>R(e.workspace.workspaces)),He=l.createSelector(e=>{const t=e.hud.usage?.totals;return t?N(t):0}),qe=l.createSelector(e=>e.hud.burnRatePerMin),Pe=l.createSelector(e=>e.hud.burnTrend),Fe=l.createSelector(e=>{const{health:t,stats:n,lastUpdated:s,hostLocality:o}=e.daemonHealth,i=n?.hostname;return{online:t!=="down",uptimeSeconds:typeof n?.uptimeSeconds=="number"?n.uptimeSeconds:null,version:n?.version??null,fetchedAtMs:s?Date.parse(s):null,remoteHostname:o==="remote"&&i?i.split(".",1)[0]??i:null}}),Ke=l.createSelector(e=>e.hud.gridFilter);l.createSelector(e=>e.hud.attentionByWorkspaceId);const xe=l.createSelector((e,t)=>{const n=e.hud?.questionsByAgentId?.[t];if(!n)return!1;const s=e.agentSessions?.byAgentId[t]?.metadata??{};return!F(s,n.messageId)}),Le=l.createSelector(e=>e.hud.takeoverRequestWorkspaceId);function pe(e,t){return t[String(e.id)]??e.displayStatus}const A=l.createSelector(e=>{const t=e.hud.displayStatusByWorkspaceId;return R(e.workspace.workspaces).filter(n=>n.status!==T.Archived&&n.status!==T.Retired&&n.status!==T.Deleted).map(n=>{const s=pe(n,t);return s&&s!==n.displayStatus?{...n,displayStatus:s}:n})});function I(e){const t=e.agentSummary;return!t||!Array.isArray(t.agents)?[]:t.agents.filter(n=>!!n&&typeof n=="object"&&typeof n.id=="string"&&n.status!=="deleted"&&!ie(n.id))}const Ue=l.createSelector(e=>{const t=Object.fromEntries(Y.map(n=>[n,0]));for(const n of A.select(e))for(const s of I(n))t[y(e,s).bucket]+=1;return t}),Ge=l.createSelector(e=>{const t={idle:0,unread:0,progress:0,attention:0,waiting:0,prOpen:0,prMerged:0,failed:0,completed:0,total:0};for(const n of C.select(e))switch(t.total+=1,n.isUnread&&(t.unread+=1),n.isWaiting&&(t.waiting+=1),n.stateKey){case"wait":case"blocked":t.attention+=1;break;case"failed":t.failed+=1;break;case"in_progress":t.progress+=1;break;case"complete":t.completed+=1;break;case"pr_open":case"pr_ready":case"pr_queued":t.prOpen+=1;break;case"pr_merged":t.prMerged+=1;break;default:t.idle+=1}return t}),ke=l.createSelector(e=>{const t={};for(const n of A.select(e))for(const s of I(n))typeof s.name=="string"&&s.name.length>0&&(t[s.id]=s.name);return t});function D(e){if(!e.sinceTs)return 0;const t=Date.parse(e.sinceTs);return Number.isFinite(t)?t:0}const Qe=l.createSelector(e=>{const t=e.hud.attentionByWorkspaceId,n=e.hud.questionsByAgentId,s=[];for(const o of A.select(e)){const i=String(o.id);let a=!1;for(const r of b(o,e)){const{bucket:c,attentionKind:u,hasQuestion:g}=r;if(c!=="needs-attention"&&c!=="failed"||!r.topLevel||r.isBackground||S(e,r.id))continue;const k=g?n[r.id]:void 0,f=u?_(e.agentSessions?.byAgentId[r.id])?.reason:void 0,p=k?"question":u??void 0;s.push({workspaceId:i,workspaceTitle:o.title,kind:c==="needs-attention"?"agent_waiting":"agent_failed",...c==="needs-attention"&&p?{signal:p}:{},agentName:r.name,message:k?.question??f??null,sinceTs:r.lastActivityTs}),a=!0}const d=t[i];d&&H(d.attention)&&(s.push({workspaceId:i,workspaceTitle:o.title,kind:"workspace_attention",attention:d.attention,message:null,sinceTs:d.raisedAtTs}),a=!0),L.has(w(o))&&!a&&s.push({workspaceId:i,workspaceTitle:o.title,kind:"workspace_attention",message:null,sinceTs:null})}return s.sort((o,i)=>D(i)-D(o))}),Ve=l.createSelector(e=>{const t=ke.select(e);return e.hud.feed.map(n=>({...n,workspaceTitle:h(e.workspace.workspaces,n.source)?.title??null,resolvedAgentName:n.agentName??(n.agentId?t[n.agentId]??null:null)}))}),Ae={total:0,completed:0,inProgress:0};function w(e){const t=$(e.displayStatus)?e.displayStatus:"not_started";return Z(t)??"not_started"}const L=new Set(["wait","blocked","failed"]);function Se(e,t,n){if(t==="failed"){const o=n.find(a=>a.bucket==="failed"&&!S(e,a.id)),i=o?e.agentSessions?.byAgentId[o.id]?.stopReason:null;return{kind:"failed",text:typeof i=="string"&&i.length>0?i:""}}if(t!=="wait"&&t!=="blocked")return null;const s=n.filter(o=>o.topLevel&&!o.isBackground&&!S(e,o.id));for(const o of s){if(!o.hasQuestion)continue;const i=e.hud.questionsByAgentId[o.id];if(i?.question)return{kind:"question",text:i.question}}for(const o of["blocker","discussion"])for(const i of s){if(i.attentionKind!==o)continue;const a=e.agentSessions?.byAgentId[i.id],d=_(a)?.reason;if(d)return{kind:o,text:d}}return{kind:"pending",text:""}}const m=new Set(["running","needs-attention","failed"]);function E(e){const t=typeof e.lastActivity=="string"?Date.parse(e.lastActivity):NaN;return Number.isFinite(t)?t:-1/0}function he(e){const t=n=>{const s=e.get(n.id)?.bucket;return s!==void 0&&m.has(s)?0:1};return(n,s)=>{const o=n.specialist==="spec-writer",i=s.specialist==="spec-writer";if(o!==i)return o?-1:1;const a=t(n)-t(s);if(a!==0)return a;const d=E(n),r=E(s);return d!==r?r-d:n.id<s.id?-1:n.id>s.id?1:0}}function me(e,t){const n=new Set(e.map(r=>r.id)),s=new Map,o=[];for(const r of e){const c=typeof r.parentAgentId=="string"&&r.parentAgentId!==r.id&&n.has(r.parentAgentId)?r.parentAgentId:null;if(c){const u=s.get(c)??[];u.push(r),s.set(c,u)}else o.push(r)}o.sort(t);for(const r of s.values())r.sort(t);const i=[],a=new Set,d=(r,c,u)=>{if(!a.has(r.id)){a.add(r.id),i.push({info:r,depth:c,parentAgentId:u});for(const g of s.get(r.id)??[])d(g,c+1,r.id)}};for(const r of o)d(r,0,null);for(const r of e)d(r,0,null);return i}function y(e,t){const n=e.agentSessions?.byAgentId[t.id],s=n?.metadata??{},o=n?_(n)?.kind??null:null,i=n?V.select(e,t.id)||typeof n.status=="string"&&B(n.status):B(t.status),a=n?O(typeof n.status=="string"?n.status:t.status):null,d=!!n&&a!=="failed"&&a!=="done"&&(n.isWaitingForOtherAgents===!0||Array.isArray(n.waitingForAgentIds)&&n.waitingForAgentIds.length>0||Array.isArray(n.waitingOnHooks)&&n.waitingOnHooks.length>0||Array.isArray(n.waitingOnPrMonitors)&&n.waitingOnPrMonitors.length>0||Array.isArray(n.waitingOnScriptMonitors)&&n.waitingOnScriptMonitors.length>0),r=!!n&&(n.turnInFlight===!0||n.liveTurnOpen===!0);let c;n?d&&!r&&n.isStreaming!==!0&&n.isProcessing!==!0?c="idle":j.select(e,t.id)?c="running":i?c="idle":c=O(typeof n.status=="string"?n.status:t.status):c=t.isResponding===!0||t.isStreaming===!0?"running":O(t.status);const u=e.hud.questionsByAgentId[t.id],g=c!=="failed"&&!!u&&!F(s,u.messageId);return{bucket:c==="failed"?"failed":o!==null||g?"needs-attention":c,attentionKind:o,hasQuestion:g,isRunning:c==="running"}}function U(e,t){const n=o=>typeof o=="string"&&o!==e.id?o:null,s=o=>({isBackground:o?.isBackground,createdByAgentId:n(o?.createdByAgentId)});return{parentAgentId:n(e.parentAgentId)??n(t?.parentAgentId),isBackground:e.isBackground??t?.isBackground,metadata:s(t?.metadata),agentMetadata:s(t?.agentMetadata)}}function S(e,t){return e.agentSessions?.byAgentId[t]?.notificationsMuted===!0}function ye(e){if(!e)return null;switch(e.kind){case"attention":return e.attention.reason??null;case"live-tool":case"last-tool":{const t=J(e.toolUse.name,e.toolUse.input||{});return t.hidden?null:[t.verb,t.subject,t.path].filter(Boolean).join(" ").trim()||null}default:{const t=e.text||"";return t?t.includes(`
1
+ import{O as G,g as Q,ao as V,al as j,aw as z,p as X,a as J}from"./De3HYtL6.js";import{Ig as l,ny as h,nz as R,Ip as N,bf as T,Y,nl as _,r7 as H,rt as $,k5 as Z,rr as B,IH as O,qP as ee,fF as q,r8 as P,_ as te,bd as ne,g as se}from"./BoIGV7s7.js";import{y as F,aA as oe,v as ie}from"./VxpSEzE0.js";import{g as K}from"./DypB-Dwi.js";const re=["[WORKSPACE EVENTS]","[TASK WAKE]","[AGENT MESSAGE]"];function ae(e){const t=e.metadata;if(t&&typeof t=="object"){if(t.type==="question_answers")return!1;if(!G(t))return!0}const n=Q(e);return re.some(s=>n.startsWith(s))}const x=1440*60*1e3;function ce(e){let t=null;for(const n of e){if(ae({id:n.id,timestamp:n.createdAt,metadata:n.metadata,contentBlocks:[{type:"text",text:n.preview.trimStart()}]}))continue;const s=Date.parse(n.createdAt);Number.isFinite(s)&&(t===null||s>t)&&(t=s)}return t}const de=50,le=20;function W(e,t){return e===null||t!==null&&t>e?t:e}async function Be(e,t){let n,s=null;for(let o=0;o<le;o++){const i=await e({limit:de,nextToken:n});if(!i.ok)return null;const a=i.items;s===null&&a.length>0&&(s=a[a.length-1].id);const d=t?.newestId!=null?a.findIndex(c=>c.id===t.newestId):-1,r=ce(d>=0?a.slice(d+1):a);if(d>=0)return{latest:W(r,t?.latest??null),newestId:s};if(r!==null)return{latest:W(r,t?.latest??null),newestId:s};if(typeof i.nextToken!="string")return{latest:null,newestId:s};n=i.nextToken}return{latest:t?.latest??null,newestId:s}}function ue(e,t){return e!=null&&e<=t&&e>t-x}function ge(e,t){return e!=null&&Number.isFinite(e)&&e>0&&e<=t-x}function fe(e,t){const{workspaceId:n,agentId:s,authority:o,nativePairId:i,evidence:a}=e;if(!n||!s||!o||o!==t)return null;const d=JSON.stringify([n,s]);if(i!==d||a?.id!==d)return null;const r=a.clips.find(c=>c.status==="recording");return!r||r.discarding||!Number.isFinite(r.startedAt)||!Number.isFinite(r.pausedMs??0)||r.pausedAt!=null&&!Number.isFinite(r.pausedAt)?null:{workspaceId:n,agentId:s,clipId:r.id,startedAt:r.startedAt,pausedAt:r.pausedAt??null,pausedMs:r.pausedMs??0}}function We(e,t){return t!==void 0&&e!==t?"ignore":e?"stop":"start"}const De=l.createSelector(e=>{const t=e.dockConversation,n=t.workspaceId&&t.agentId?JSON.stringify([t.workspaceId,t.agentId]):null;return fe({workspaceId:t.workspaceId,agentId:t.agentId,authority:t.authority,nativePairId:t.nativeSpeech.pairId,evidence:n?h(t.evidence,n):null},K(e))});l.createSelector(e=>e.hud.active);l.createSelector(e=>e.hud.feed);l.createSelector(e=>e.hud.usage);l.createSelector(e=>e.hud.usageError);const Ee=l.createSelector(e=>e.hud.rateHistory),Ne=l.createSelector(e=>R(e.workspace.workspaces)),He=l.createSelector(e=>{const t=e.hud.usage?.totals;return t?N(t):0}),qe=l.createSelector(e=>e.hud.burnRatePerMin),Pe=l.createSelector(e=>e.hud.burnTrend),Fe=l.createSelector(e=>{const{health:t,stats:n,lastUpdated:s,hostLocality:o}=e.daemonHealth,i=n?.hostname;return{online:t!=="down",uptimeSeconds:typeof n?.uptimeSeconds=="number"?n.uptimeSeconds:null,version:n?.version??null,fetchedAtMs:s?Date.parse(s):null,remoteHostname:o==="remote"&&i?i.split(".",1)[0]??i:null}}),Ke=l.createSelector(e=>e.hud.gridFilter);l.createSelector(e=>e.hud.attentionByWorkspaceId);const xe=l.createSelector((e,t)=>{const n=e.hud?.questionsByAgentId?.[t];if(!n)return!1;const s=e.agentSessions?.byAgentId[t]?.metadata??{};return!F(s,n.messageId)}),Le=l.createSelector(e=>e.hud.takeoverRequestWorkspaceId);function pe(e,t){return t[String(e.id)]??e.displayStatus}const A=l.createSelector(e=>{const t=e.hud.displayStatusByWorkspaceId;return R(e.workspace.workspaces).filter(n=>n.status!==T.Archived&&n.status!==T.Retired&&n.status!==T.Deleted).map(n=>{const s=pe(n,t);return s&&s!==n.displayStatus?{...n,displayStatus:s}:n})});function I(e){const t=e.agentSummary;return!t||!Array.isArray(t.agents)?[]:t.agents.filter(n=>!!n&&typeof n=="object"&&typeof n.id=="string"&&n.status!=="deleted"&&!ie(n.id))}const Ue=l.createSelector(e=>{const t=Object.fromEntries(Y.map(n=>[n,0]));for(const n of A.select(e))for(const s of I(n))t[y(e,s).bucket]+=1;return t}),Ge=l.createSelector(e=>{const t={idle:0,unread:0,progress:0,attention:0,waiting:0,prOpen:0,prMerged:0,failed:0,completed:0,total:0};for(const n of C.select(e))switch(t.total+=1,n.isUnread&&(t.unread+=1),n.isWaiting&&(t.waiting+=1),n.stateKey){case"wait":case"blocked":t.attention+=1;break;case"failed":t.failed+=1;break;case"in_progress":t.progress+=1;break;case"complete":t.completed+=1;break;case"pr_open":case"pr_ready":case"pr_queued":t.prOpen+=1;break;case"pr_merged":t.prMerged+=1;break;default:t.idle+=1}return t}),ke=l.createSelector(e=>{const t={};for(const n of A.select(e))for(const s of I(n))typeof s.name=="string"&&s.name.length>0&&(t[s.id]=s.name);return t});function D(e){if(!e.sinceTs)return 0;const t=Date.parse(e.sinceTs);return Number.isFinite(t)?t:0}const Qe=l.createSelector(e=>{const t=e.hud.attentionByWorkspaceId,n=e.hud.questionsByAgentId,s=[];for(const o of A.select(e)){const i=String(o.id);let a=!1;for(const r of b(o,e)){const{bucket:c,attentionKind:u,hasQuestion:g}=r;if(c!=="needs-attention"&&c!=="failed"||!r.topLevel||r.isBackground||S(e,r.id))continue;const k=g?n[r.id]:void 0,f=u?_(e.agentSessions?.byAgentId[r.id])?.reason:void 0,p=k?"question":u??void 0;s.push({workspaceId:i,workspaceTitle:o.title,kind:c==="needs-attention"?"agent_waiting":"agent_failed",...c==="needs-attention"&&p?{signal:p}:{},agentName:r.name,message:k?.question??f??null,sinceTs:r.lastActivityTs}),a=!0}const d=t[i];d&&H(d.attention)&&(s.push({workspaceId:i,workspaceTitle:o.title,kind:"workspace_attention",attention:d.attention,message:null,sinceTs:d.raisedAtTs}),a=!0),L.has(w(o))&&!a&&s.push({workspaceId:i,workspaceTitle:o.title,kind:"workspace_attention",message:null,sinceTs:null})}return s.sort((o,i)=>D(i)-D(o))}),Ve=l.createSelector(e=>{const t=ke.select(e);return e.hud.feed.map(n=>({...n,workspaceTitle:h(e.workspace.workspaces,n.source)?.title??null,resolvedAgentName:n.agentName??(n.agentId?t[n.agentId]??null:null)}))}),Ae={total:0,completed:0,inProgress:0};function w(e){const t=$(e.displayStatus)?e.displayStatus:"not_started";return Z(t)??"not_started"}const L=new Set(["wait","blocked","failed"]);function Se(e,t,n){if(t==="failed"){const o=n.find(a=>a.bucket==="failed"&&!S(e,a.id)),i=o?e.agentSessions?.byAgentId[o.id]?.stopReason:null;return{kind:"failed",text:typeof i=="string"&&i.length>0?i:""}}if(t!=="wait"&&t!=="blocked")return null;const s=n.filter(o=>o.topLevel&&!o.isBackground&&!S(e,o.id));for(const o of s){if(!o.hasQuestion)continue;const i=e.hud.questionsByAgentId[o.id];if(i?.question)return{kind:"question",text:i.question}}for(const o of["blocker","discussion"])for(const i of s){if(i.attentionKind!==o)continue;const a=e.agentSessions?.byAgentId[i.id],d=_(a)?.reason;if(d)return{kind:o,text:d}}return{kind:"pending",text:""}}const m=new Set(["running","needs-attention","failed"]);function E(e){const t=typeof e.lastActivity=="string"?Date.parse(e.lastActivity):NaN;return Number.isFinite(t)?t:-1/0}function he(e){const t=n=>{const s=e.get(n.id)?.bucket;return s!==void 0&&m.has(s)?0:1};return(n,s)=>{const o=n.specialist==="spec-writer",i=s.specialist==="spec-writer";if(o!==i)return o?-1:1;const a=t(n)-t(s);if(a!==0)return a;const d=E(n),r=E(s);return d!==r?r-d:n.id<s.id?-1:n.id>s.id?1:0}}function me(e,t){const n=new Set(e.map(r=>r.id)),s=new Map,o=[];for(const r of e){const c=typeof r.parentAgentId=="string"&&r.parentAgentId!==r.id&&n.has(r.parentAgentId)?r.parentAgentId:null;if(c){const u=s.get(c)??[];u.push(r),s.set(c,u)}else o.push(r)}o.sort(t);for(const r of s.values())r.sort(t);const i=[],a=new Set,d=(r,c,u)=>{if(!a.has(r.id)){a.add(r.id),i.push({info:r,depth:c,parentAgentId:u});for(const g of s.get(r.id)??[])d(g,c+1,r.id)}};for(const r of o)d(r,0,null);for(const r of e)d(r,0,null);return i}function y(e,t){const n=e.agentSessions?.byAgentId[t.id],s=n?.metadata??{},o=n?_(n)?.kind??null:null,i=n?V.select(e,t.id)||typeof n.status=="string"&&B(n.status):B(t.status),a=n?O(typeof n.status=="string"?n.status:t.status):null,d=!!n&&a!=="failed"&&a!=="done"&&(n.isWaitingForOtherAgents===!0||Array.isArray(n.waitingForAgentIds)&&n.waitingForAgentIds.length>0||Array.isArray(n.waitingOnHooks)&&n.waitingOnHooks.length>0||Array.isArray(n.waitingOnPrMonitors)&&n.waitingOnPrMonitors.length>0||Array.isArray(n.waitingOnScriptMonitors)&&n.waitingOnScriptMonitors.length>0),r=!!n&&(n.turnInFlight===!0||n.liveTurnOpen===!0);let c;n?d&&!r&&n.isStreaming!==!0&&n.isProcessing!==!0?c="idle":j.select(e,t.id)?c="running":i?c="idle":c=O(typeof n.status=="string"?n.status:t.status):c=t.isResponding===!0||t.isStreaming===!0?"running":O(t.status);const u=e.hud.questionsByAgentId[t.id],g=c!=="failed"&&!!u&&!F(s,u.messageId);return{bucket:c==="failed"?"failed":o!==null||g?"needs-attention":c,attentionKind:o,hasQuestion:g,isRunning:c==="running"}}function U(e,t){const n=o=>typeof o=="string"&&o!==e.id?o:null,s=o=>({isBackground:o?.isBackground,createdByAgentId:n(o?.createdByAgentId)});return{parentAgentId:n(e.parentAgentId)??n(t?.parentAgentId),isBackground:e.isBackground??t?.isBackground,metadata:s(t?.metadata),agentMetadata:s(t?.agentMetadata)}}function S(e,t){return e.agentSessions?.byAgentId[t]?.notificationsMuted===!0}function ye(e){if(!e)return null;switch(e.kind){case"attention":return e.attention.reason??null;case"live-tool":case"last-tool":{const t=J(e.toolUse.name,e.toolUse.input||{});return t.hidden?null:[t.verb,t.subject,t.path].filter(Boolean).join(" ").trim()||null}default:{const t=e.text||"";return t?t.includes(`
2
2
  `)?X(t)||null:t:null}}}function b(e,t){const n=I(e),s=new Map(n.map(i=>[i.id,y(t,i)]));return me(n,he(s)).map(({info:i,depth:a,parentAgentId:d})=>{const r=t.agentSessions?.byAgentId[i.id],c=U(i,r),{bucket:u,attentionKind:g,hasQuestion:k}=s.get(i.id)??y(t,i),f=Array.isArray(r?.waitingForAgentIds)?r.waitingForAgentIds.filter(p=>typeof p=="string"):[];return{id:i.id,name:i.name,bucket:u,lastActivityTs:i.lastActivity??null,line:ye(z.select(t,i.id)),parentAgentId:d,depth:a,treePrefix:"",topLevel:q(c)==="topLevel",isBackground:ee(c),attentionKind:g,hasQuestion:k,isWaitingForAgents:r?.isWaitingForOtherAgents===!0||f.length>0||Array.isArray(r?.waitingOnHooks)&&r.waitingOnHooks.length>0||Array.isArray(r?.waitingOnPrMonitors)&&r.waitingOnPrMonitors.length>0||Array.isArray(r?.waitingOnScriptMonitors)&&r.waitingOnScriptMonitors.length>0,waitingForAgentIds:f}})}function Ie(e){const t=new Set;for(const o of e)for(const i of o.waitingForAgentIds)t.add(i);const n=o=>m.has(o.bucket)||o.isWaitingForAgents||t.has(o.id);return e.filter((o,i)=>{if(n(o))return!0;for(let a=i+1;a<e.length&&!(e[a].depth<=o.depth);a++)if(n(e[a]))return!0;return!1}).map((o,i,a)=>{if(o.depth===0)return{...o,treePrefix:""};let d=!0;for(let r=i+1;r<a.length&&!(a[r].depth<o.depth);r++)if(a[r].depth===o.depth){d=!1;break}return{...o,treePrefix:(o.depth>=2?"│ ":"")+(d?"└─":"├─")}})}const C=l.createSelector(e=>{const t=e.hud.attentionByWorkspaceId,n=oe.select(e);return A.select(e).map(s=>{const o=String(s.id),i=n.indexOf(o),a=t[o]?.attention??(typeof s.attention=="string"&&P(s.attention)?s.attention:null),d=b(s,e),r=w(s),c=e.tokenUsage?.byWorkspaceId[o]?.totals,u=e.workspaceTasks?.byWorkspaceId[o]?.stats,g=typeof s.statusMessage=="string"&&s.statusMessage.trim().length>0?s.statusMessage:null;return{workspaceId:o,title:s.title,repoRef:s.repositoryName?`${s.repositoryOwner?`${s.repositoryOwner}/`:""}${s.repositoryName}`:s.branch,stateKey:r,attention:a,isUnread:a===te,isWaiting:s.waiting===!0,statusMessage:g,attentionSnippet:Se(e,r,d),prNumber:typeof s.prNumber=="number"?s.prNumber:null,keySlot:i===-1?null:i,tasks:u?{total:u.total,completed:u.completed,inProgress:u.inProgress}:Ae,tokens:c?N(c):0,agents:Ie(d)}})}),M=4;function we(e,t,n){const s=e.agentSessions?.byAgentId[n.id];return!s||String(s.workspaceId)!==t||s.pendingDeleteAt||q(U(n,s))!=="topLevel"?!1:!S(e,n.id)}const be=l.createSelector(e=>{const t={},n=e.hud.attentionByWorkspaceId;for(const s of A.select(e)){const o=String(s.id),i=new Map,a=(f,p)=>{const v=i.get(f)??[];v.includes(p)||v.push(p),i.set(f,v)},r=I(s).filter(f=>we(e,o,f));for(const f of r){const p=y(e,f);p.bucket==="failed"?a("failed",f.name):p.hasQuestion?a("question",f.name):p.attentionKind==="blocker"?a("blocker",f.name):p.attentionKind==="discussion"&&a("discussion",f.name),p.isRunning&&a("running",f.name)}const c=w(s);c==="failed"&&!i.has("failed")&&i.set("failed",[]),c==="blocked"&&!i.has("blocker")&&i.set("blocker",[]),c==="wait"&&!i.has("question")&&!i.has("blocker")&&!i.has("discussion")&&i.set("needs_input",[]);const u=n[o]?.attention??(typeof s.attention=="string"&&P(s.attention)?s.attention:null);u==="review_required"&&i.set("review",[]),u==="unread"&&i.set("unread",[]),s.activity==="agent_running"&&!i.has("running")&&i.set("running",[]);const g=ne.flatMap(f=>{const p=i.get(f);return p?[{category:f,count:Math.max(1,p.length),agentNames:p}]:[]});if(g.length===0)continue;const k=g.length>M;t[o]={agentCount:r.length,categories:g,visibleCategories:k?g.slice(0,M-1):g,hiddenCategoryCount:k?g.length-(M-1):0}}return t});l.createSelector(e=>{const t=e.hud.attentionByWorkspaceId;let n=0;for(const s of A.select(e)){let o=!1;for(const d of b(s,e))d.topLevel&&!d.isBackground&&!S(e,d.id)&&(d.bucket==="failed"||d.attentionKind!==null||d.hasQuestion)&&(n+=1,o=!0);const i=t[String(s.id)],a=i!==void 0&&H(i.attention);a&&(n+=1),L.has(w(s))&&!o&&!a&&(n+=1)}return n});function ve(e,t,n,s){const o=s.slice().sort((r,c)=>c.createdAt-r.createdAt);for(const r of o){const u=e.agentSessions?.byAgentId[r.agentId]?.metadata?.completionReport;if(typeof u=="string"&&u.trim().length>0)return u}const i=e.workspaceNotes?.byWorkspaceId[t]?.notes,a=i?h(i,n):void 0,d=a?.content||a?.contentPreview;return typeof d=="string"&&d.trim().length>0?d:null}const je=l.createSelector((e,t)=>{const n=C.select(e).find(c=>c.workspaceId===t);if(!n)return null;const s=h(e.workspace.workspaces,t),o=s?b(s,e):[],i=new Map(o.map(c=>[c.id,c])),a=e.taskAgentAssociations?.byWorkspaceId[t]?.byNoteId??{},d=e.workspaceTasks?.byWorkspaceId[t],r=d?R(d.tasks).filter(c=>c.status!=="cancelled").map(c=>{const u=Object.values(a[c.id]??{});return{id:c.id,title:c.title,status:c.status,agents:u.map(g=>i.get(g.agentId)).filter(g=>!!g),report:c.status==="complete"?ve(e,t,c.id,u):null,...c.specLinked!==void 0?{specLinked:c.specLinked}:{},...c.dependsOn?{dependsOn:c.dependsOn}:{},...c.conflictsWith?{conflictsWith:c.conflictsWith}:{},...c.unmetDependsOn?{unmetDependsOn:c.unmetDependsOn}:{}}}):[];return{workspaceId:t,title:n.title,repoRef:n.repoRef,statusMessage:n.statusMessage,keySlot:n.keySlot,stats:n.tasks,tasks:r,activeAgents:o.filter(c=>m.has(c.bucket)),idleAgents:o.filter(c=>!m.has(c.bucket))}}),Te=new Set(["failed","blocker","question","discussion","needs_input","review"]);function Oe(e){for(const t of e?.categories??[])switch(t.category){case"failed":return"failure";case"blocker":return"blocker";case"question":return"question";case"review":return"review"}return"none"}const ze=l.createSelector((e,t="recent")=>{const n=C.select(e),s=be.select(e),o=new Map(A.select(e).map(a=>[String(a.id),a])),i={action:[],unread:[],active:[]};for(const a of n){const d=o.get(a.workspaceId);if(!d||d.id===se||!(t==="older"?ge:ue)(e.hud.dockConversationAtByWorkspaceId[a.workspaceId],e.hud.dockRecencyNow))continue;const r=s[a.workspaceId],c=r?.categories??[],u=c.some(p=>Te.has(p.category)),g=a.isUnread,k=c.some(p=>p.category==="running"),f=u?"action":g?"unread":"active";i[f].push({workspace:d,badgeKind:Oe(r),priorityGroup:f,isUnread:g,isRunning:k,isWaiting:a.isWaiting})}return[...i.action,...i.unread,...i.active].sort((a,d)=>e.hud.dockConversationAtByWorkspaceId[String(d.workspace.id)]-e.hud.dockConversationAtByWorkspaceId[String(a.workspace.id)]||String(a.workspace.id).localeCompare(String(d.workspace.id)))}),Xe=l.createSelector(e=>e.hud.dockPlacement),Je=l.createSelector(e=>e.hud.dockPlacementError),Ye=l.createSelector(e=>e.hud.dockFocusRequest),$e=l.createSelector(e=>e.hud.dockCloseRequest),Ze=l.createSelector(e=>e.hud.dockDragStartResult),et=l.createSelector(e=>e.hud.dockResizeStartResult),tt=l.createSelector(e=>({pending:e.hud.dockMachineSwitching,error:e.hud.dockMachineSwitchError})),nt=l.createSelector(e=>{const t=e.hud.dockEditorCompactRequest,n=e.dockConversation,s=n.workspaceId&&n.agentId?h(n.evidence,JSON.stringify([n.workspaceId,n.agentId])):null,o=!!n.nativeSpeech.activeId||!!s?.annotation||s?.clips.some(i=>i.status==="recording")||e.hardwareConsole.pttRecording||e.hardwareConsole.voiceTranscribing;return t&&!o&&e.hud.active&&t.conversationGeneration===n.generation&&t.authority===K(e)&&t.backendId===e.connections.windowBackendId&&t.workspaceId===e.dockConversation.workspaceId&&t.agentId===e.dockConversation.agentId?t:null});export{Ne as A,Ge as B,be as C,$e as a,Ze as b,nt as c,Ye as d,tt as e,Xe as f,Je as g,De as h,ae as i,et as j,ze as k,xe as l,Ue as m,Qe as n,qe as o,Pe as p,Ve as q,We as r,Be as s,Ke as t,Ee as u,Fe as v,Le as w,je as x,He as y,C as z};
@@ -1 +1 @@
1
- import{t as l,bq as i,by as m,b as u}from"./CNdlzZOD.js";import{bs as f,bI as _,c5 as b,a7 as g,ay as h,W as v,bn as y,aA as o}from"./DYhIMPy1.js";import{s as z}from"./DIh4SQwA.js";import{ac as C}from"./DwkxcWNI.js";function S(s,t){if(new.target)return l({component:S,...s});f(t,!0);let a=i(t,"size",7,"default"),r=i(t,"children",7);_(C,b(()=>a()));var c={get size(){return a()},set size(e="default"){a(e),o()},get children(){return r()},set children(e){r(e),o()},$set:m,$on:(e,d)=>u(t,e,d)},n=g(),p=h(n);return z(p,r),v(s,n),y(c)}export{S};
1
+ import{t as l,bq as i,by as m,b as u}from"./CNdlzZOD.js";import{bs as f,bI as _,c5 as b,a7 as g,ay as h,W as v,bn as y,aA as o}from"./DYhIMPy1.js";import{s as z}from"./DIh4SQwA.js";import{ac as C}from"./D3glRUn0.js";function S(s,t){if(new.target)return l({component:S,...s});f(t,!0);let a=i(t,"size",7,"default"),r=i(t,"children",7);_(C,b(()=>a()));var c={get size(){return a()},set size(e="default"){a(e),o()},get children(){return r()},set children(e){r(e),o()},$set:m,$on:(e,d)=>u(t,e,d)},n=g(),p=h(n);return z(p,r),v(s,n),y(c)}export{S};
@@ -1 +1 @@
1
- import{t as Ot,bq as D,bo as u,a_ as W,by as Ft,b as Dt}from"./CNdlzZOD.js";import{bs as Rt,bV as K,br as rt,bk as er,bj as tr,bH as r,a5 as c,aD as e,bS as n,bl as S,bA as l,b_ as g,bO as m,W as o,bn as Gt,aA as R,c9 as z,be as Ve,b$ as Be,aB as b,c5 as mt,ca as ft,a7 as Ue,ay as U,ai as rr,aj as ar,bf as sr}from"./DYhIMPy1.js";import{I as or,v as Oe,j as gt,n as Xe,u as nr}from"./9iFKJfkz.js";import{c as Ee}from"./b0njYmMP.js";import{I as Fe,D as Ze,h as $t}from"./HVSUZ4Kq.js";import{b as xt}from"./BaIAhI85.js";import{F as Te,cK as ir,aq as lr,cD as bt,cU as Pt,c7 as cr}from"./BIfN-lxi.js";import{f as we}from"./DwkxcWNI.js";import"./BxRFeUGV.js";import{s as nt}from"./Ca3Yads8.js";import{M as dr}from"./CPzusSaQ.js";import{e as pr,W as _e}from"./D6NxvjAo.js";import{h as Ct,i as Et,g as Tt,P as At}from"./YcWsBw0J.js";import{C as ht}from"./Cy1SRgRj.js";import{c as ur}from"./ChTqQfQN.js";import"./DIh4SQwA.js";import{d as vr}from"./D-YrUZis.js";import{Ig as _r}from"./BJpbRkma.js";import{dA as mr}from"./BsesepNZ.js";import{S as et,k as fr,a as jt}from"./ColHxoku.js";import{R as qe,c as it,m as gr,bI as tt}from"./CTMsT2IU.js";import"./D7NWkz7l.js";var xr=b('<div class="w-2 h-2 bg-green-500 rounded-full animate-pulse"></div>'),br=b('<div class="text-sm text-danger bg-danger-background/10 rounded-md p-3"> </div>'),hr=b('<div class="flex items-center gap-2 text-subtle"><!> <span class="text-sm"> </span></div>'),Sr=b('<div class="p-4 max-h-60 overflow-y-auto overscroll-contain"><!></div>'),yr=b('<div class="p-3 bg-muted/30"><div class="flex items-center justify-between mb-2"><div class="flex items-center gap-2"><!> <span class="text-sm font-medium"> </span></div> <!></div> <p class="text-xs text-subtle mb-2"> </p> <div class="h-32 rounded border border-border overflow-hidden"><!></div></div>'),wr=b('<div class="flex flex-col bg-background border border-border rounded-lg overflow-hidden"><div class="flex items-center justify-between px-3 py-2 border-b border-border bg-muted/30"><div class="flex items-center gap-2"><!> <span class="text-sm font-medium"> </span> <!></div> <div class="flex items-center gap-1"><!></div></div> <!> <!></div>');function St(He,P){if(new.target)return Ot({component:St,...He});Rt(P,!0);const at=ur("SetupScriptAgent");let Ae=D(P,"repoPath",7),De=D(P,"onScriptGenerated",7),Re=D(P,"onClose",7),Ge=K(rt(crypto.randomUUID())),O=K(!1),ae=K(null),me=!1,ie=K(null);er(()=>{me=!0,C()}),tr(()=>{me=!1});async function le(){try{const v=mr.select(_r.state).find(E=>E.repositoryPath===Ae()||E.path===Ae()||E.worktreePath===Ae());return v?String(v.id):null}catch{return null}}async function C(){r(O,!0),r(ae,null),r(ie,null);try{const s=await le();if(!me)return;if(!s){r(ae,u.workspace_setupScriptAgent_noWorkspace_error(),!0),r(O,!1);return}const v=await vr.setupScripts.generate(s);if(!me)return;if(!v||!v.script){r(ae,u.workspace_setupScriptAgent_generateFailed_error(),!0),r(O,!1);return}r(ie,{name:v.projectType?u.workspace_setupScriptAgent_projectTypeSetup_label({projectType:v.projectType}):u.workspace_setupScriptAgent_generatedSetup_label(),description:v.projectType?u.workspace_setupScriptAgent_generatedForProject_description({projectType:v.projectType}):u.workspace_setupScriptAgent_generatedFromAnalysis_description(),content:v.script},!0),r(O,!1)}catch(s){if(at.error("Failed to generate setup script",s),!me)return;r(ae,s instanceof Error?s.message:u.workspace_setupScriptAgent_generateFailed_error(),!0),r(O,!1)}}function fe(s){De()?.(s)}var ge={get repoPath(){return Ae()},set repoPath(s){Ae(s),R()},get onScriptGenerated(){return De()},set onScriptGenerated(s){De(s),R()},get onClose(){return Re()},set onClose(s){Re(s),R()},$set:Ft,$on:(s,v)=>Dt(P,s,v)},ce=wr(),xe=c(ce),be=c(xe),Le=c(be);pr(Le,{variant:"standard",get agentId(){return e(Ge)}});var Me=n(Le,2),je=S(Me,!0),he=n(Me,2);{var de=s=>{var v=xr();o(s,v)};W(he,s=>{e(O)&&s(de)})}l(be);var J=n(be,2),ke=c(J);{let s=z(()=>u.workspace_setupScriptAgent_close_ariaLabel());we(ke,{variant:"ghost-light",size:"icon-sm",iconOnly:!0,get"aria-label"(){return e(s)},get onclick(){return Re()},children:(v,E)=>{Te(v,{get icon(){return ir}})},$$slots:{default:!0}})}l(J),l(xe);var $e=n(xe,2);{var Ie=s=>{var v=Sr(),E=c(v);{var q=B=>{var G=br(),Q=S(G,!0);g(()=>m(Q,e(ae))),o(B,G)},se=B=>{var G=hr(),Q=c(G);or(Q,{size:16,class:"text-primary"});var Se=n(Q,2),ze=S(Se,!0);l(G),g(ye=>m(ze,ye),[()=>u.workspace_setupScriptAgent_analyzing_label()]),o(B,G)};W(E,B=>{e(ae)?B(q):B(se,-1)})}l(v),o(s,v)};W($e,s=>{(e(ae)||e(O))&&s(Ie)})}var Ye=n($e,2);{var pe=s=>{var v=yr(),E=c(v),q=c(E),se=c(q);Te(se,{get icon(){return lr},class:"text-green-500"});var B=n(se,2),G=S(B,!0);l(q);var Q=n(q,2);we(Q,{variant:"primary",size:"sm",onclick:()=>fe(e(ie)),class:"h-7",children:(Pe,st)=>{Ve();var Je=Be();g(ct=>m(Je,ct),[()=>u.workspace_setupScriptAgent_createScript_label()]),o(Pe,Je)},$$slots:{default:!0}}),l(E);var Se=n(E,2),ze=S(Se,!0),ye=n(Se,2),lt=c(ye);ht(lt,{get value(){return e(ie).content},language:"shell",readOnly:!0,lineNumbers:!1}),l(ye),l(v),g(()=>{m(G,e(ie).name),m(ze,e(ie).description)}),o(s,v)};W(Ye,s=>{e(ie)&&!e(O)&&s(pe)})}return l(ce),g(s=>m(je,s),[()=>u.workspace_setupScriptAgent_title()]),o(He,ce),Gt(ge)}var kr=b('<span class="block truncate"> </span>'),$r=b("<div></div>"),Pr=b('<div role="group"></div> <div class="mt-2 border-t border-border pt-2"><!></div> <!> <div class="mt-2 border-t border-border pt-2"><!> <!></div>',1),Cr=b('<code class="type-caption text-muted-foreground"> </code>'),Er=b('<p> </p> <code class="type-caption"> </code>',1),It=b("<!> <!>",1),Tr=b('<div class="mt-2 flex flex-wrap gap-2 px-2"></div>'),Ar=b('<div class="h-44 min-w-0 overflow-hidden rounded-(--radius-medium) border border-border bg-background py-2"><!></div> <div class="mt-2 px-1"><!> <!></div>',1),jr=b('<div class="mb-2 flex items-center justify-between gap-3 px-2"><div class="min-w-0"><h3> </h3> <p class="type-caption truncate text-muted-foreground"> </p></div> <!></div> <!>',1),Ke=b("<div><!></div>"),Ir=b("<!> ",1),Nt=b('<div class="min-w-0 w-full"><span class="text-sm"> </span> <p class="text-xs text-subtle mt-0.5"> </p></div>'),Ut=b('<div class="mb-4"><h4 class="type-caption font-medium text-muted-foreground mb-1.5 px-2"> </h4> <!></div>'),Nr=b('<span class="type-caption px-1.5 py-0.5 rounded-full bg-primary/10 text-primary font-medium shrink-0"> </span>'),Ur=b('<div class="min-w-0 w-full"><div class="flex flex-wrap items-center gap-x-2 gap-y-1"><span class="text-sm"> </span> <!></div> <p class="text-xs text-subtle mt-0.5"> </p></div>'),Or=b('<div class="mb-4"><h4 class="type-caption font-medium text-muted-foreground mb-1.5 px-2"> </h4> <p class="text-xs text-subtle px-2 mb-2"> </p> <!></div> <!> <!> <div class="mb-4"><h4 class="type-caption font-medium text-muted-foreground mb-1.5 px-2"> </h4> <!></div>',1),Fr=b('<code class="type-caption px-1.5 py-0.5 rounded bg-background/80 text-muted-foreground font-mono cursor-pointer hover:bg-background hover:text-foreground transition-colors"> </code>'),Dr=b('<p class="text-xs"> </p> <p class="mt-1 text-xs text-muted-foreground"> <code class="type-caption"> </code></p>',1),Rr=b('<div class="flex flex-wrap items-center gap-x-3 gap-y-1.5 px-3 py-1.5 bg-muted/30 shrink-0"><span class="type-caption font-medium text-muted-foreground shrink-0"> </span> <div class="flex flex-wrap gap-1.5"></div></div> <div class="flex-1 min-h-0 min-w-0 overflow-hidden py-3 bg-background"><!></div>',1),Gr=b('<div class="flex min-h-0 min-w-0 flex-col overflow-y-auto"><!></div> <div class="flex min-h-0 min-w-0 flex-col"><!></div>',1),Lr=b('<div class="flex flex-col min-h-0 min-w-0 overflow-y-auto p-2 md:pr-4"><!></div> <div class="flex flex-col min-w-0 min-h-0"><!></div>',1),Mr=b('<!> <span class="text-sm font-normal text-subtle"> </span> <span class="text-subtle font-normal"> </span>',1),zr=b('<div class="mt-1 pl-7 space-y-3"><!></div>'),Wr=b('<div class="space-y-3"><!></div>'),qr=b("<div><!> <!></div> <!>",1);function Kr(He,P){if(new.target)return Ot({component:Kr,...He});Rt(P,!0);const at=(t,a=sr)=>{{const w=_=>{Te(_,{get icon(){return bt},get class(){return _e.icon}})},j=_=>{var i=kr(),f=S(i,!0);g(()=>m(f,a().name)),o(_,i)},T=_=>{{let i=z(()=>e(st)===a().id?"checked":"empty");dr(_,{get state(){return e(i)}})}};let h=z(()=>e(st)===a().id),$=z(()=>e(st)===a().id);nt(t,{get selected(){return e(h)},get"aria-pressed"(){return e($)},get"data-setup-source"(){return a().id},get class(){return _e.row},onclick:()=>a().id==="custom"?Lt():ye(a().id),leading:w,title:j,trailing:T,$$slots:{leading:!0,title:!0,trailing:!0}})}},Ae=t=>{var a=Ke(),w=c(a);{var j=h=>{var $=Pr(),_=U($);Xe(_,21,()=>e(Je),I=>I.id,(I,F)=>{at(I,()=>e(F))}),l(_);var i=n(_,2),f=c(i);nt(f,{get"aria-expanded"(){return e($e)},get class(){return _e.row},onclick:()=>r($e,!e($e)),leading:y=>{Te(y,{get icon(){return cr},get class(){return _e.icon}})},title:y=>{Ve();var d=Be();g(p=>m(d,p),[()=>u.workspace_setupScriptEditor_templates_label()]),o(y,d)},$$slots:{leading:!0,title:!0}}),l(i);var x=n(i,2);{var k=I=>{var F=$r();Xe(F,21,()=>e(ct),y=>y.id,(y,d)=>{at(y,()=>({id:`template-${e(d).id}`,name:e(d).name}))}),l(F),Fe(3,F,()=>Ze,()=>({tier:"moderate"})),o(I,F)};W(x,I=>{e($e)&&I(k)})}var L=n(x,2),ue=c(L);nt(ue,{get class(){return _e.row},onclick:()=>r(ke,!0),leading:y=>{Te(y,{get icon(){return bt},get class(){return _e.icon}})},title:y=>{Ve();var d=Be();g(p=>m(d,p),[()=>u.workspace_setupScriptPicker_edit_label()]),o(y,d)},$$slots:{leading:!0,title:!0}});var ve=n(ue,2);{const I=d=>{Te(d,{get icon(){return Pt},get class(){return _e.icon}})},F=d=>{Ve();var p=Be();g(N=>m(p,N),[()=>u.workspace_setupScriptEditor_autoGenerate_label()]),o(d,p)};let y=z(()=>!O());nt(ve,{get class(){return _e.row},get disabled(){return e(y)},onclick:()=>{r(ke,!0),r(J,!0)},leading:I,title:F,$$slots:{leading:!0,title:!0}})}l(L),g(I=>nr(_,"aria-label",I),[()=>u.workspace_setupScriptEditor_setupScript_label()]),o(h,$)},T=h=>{var $=jr(),_=U($),i=c(_),f=c(i),x=S(f,!0),k=n(f,2),L=S(k,!0);l(i);var ue=n(i,2);we(ue,{variant:"ghost",size:"sm",onclick:()=>{r(ke,!1),r(J,!1)},children:(y,d)=>{Ve();var p=Be();g(N=>m(p,N),[()=>u.workspace_setupScriptPicker_choose_label()]),o(y,p)},$$slots:{default:!0}}),l(_);var ve=n(_,2);{var I=y=>{St(y,{get repoPath(){return O()},onScriptGenerated:Mt,onClose:()=>r(J,!1)})},F=y=>{var d=Ar(),p=U(d),N=c(p);xt(ht(N,{language:"shell",lineNumbers:!1,get lineWrapping(){return e(Se)},get value(){return C()},set value(A){C(A)}}),A=>r(pe,A,!0),()=>e(pe)),l(p);var X=n(p,2),H=c(X);we(H,{variant:"ghost",size:"sm",get active(){return e(Ie)},get"aria-expanded"(){return e(Ie)},onclick:()=>r(Ie,!e(Ie)),children:(A,oe)=>{Ve();var M=Be();g(ee=>m(M,ee),[()=>u.workspace_setupScriptEditor_variables_label()]),o(A,M)},$$slots:{default:!0}});var V=n(H,2);{var Z=A=>{var oe=Ue(),M=U(oe);Ee(M,()=>At,(ee,te)=>{te(ee,{delayDuration:100,children:(ne,Ce)=>{var Y=Tr();Xe(Y,21,()=>jt,re=>re.name,(re,Ne)=>{var We=Ue(),pt=U(We);Ee(pt,()=>Ct,(Vt,Bt)=>{Bt(Vt,{children:(Ht,Vr)=>{var wt=It(),kt=U(wt);Ee(kt,()=>Et,(ut,vt)=>{vt(ut,{children:(_t,Jt)=>{var Qe=Cr(),ot=S(Qe);g(()=>m(ot,`$${e(Ne).name??""}`)),o(_t,Qe)},$$slots:{default:!0}})});var Yt=n(kt,2);Ee(Yt,()=>Tt,(ut,vt)=>{vt(ut,{side:"top",class:"max-w-xs",children:(_t,Jt)=>{var Qe=Er(),ot=U(Qe),Qt=S(ot,!0),Xt=n(ot,2),Zt=S(Xt,!0);g(()=>{m(Qt,e(Ne).description),m(Zt,e(Ne).example)}),o(_t,Qe)},$$slots:{default:!0}})}),o(Ht,wt)},$$slots:{default:!0}})}),o(re,We)}),l(Y),o(ne,Y)},$$slots:{default:!0}})}),o(A,oe)};W(V,A=>{e(Ie)&&A(Z)})}l(X),o(y,d)};W(ve,y=>{e(J)&&O()?y(I):y(F,-1)})}g(y=>{Oe(f,1,gt(_e.title),"svelte-1yy464i"),m(x,y),m(L,e(ze))},[()=>u.workspace_setupScriptPicker_commands_label()]),o(h,$)};W(w,h=>{e(ke)?h(T,-1):h(j)})}l(a),xt(a,h=>r(Ye,h),()=>e(Ye)),g(()=>Oe(a,1,`${_e.rows} min-w-0`,"svelte-1yy464i")),o(t,a)},De=t=>{var a=Or(),w=U(a),j=c(w),T=S(j,!0),h=n(j,2),$=S(h,!0),_=n(h,2);{var i=d=>{var p=Ke(),N=c(p);St(N,{get repoPath(){return O()},onScriptGenerated:X=>{r(se,!0),r(s,""),C(X.content),r(E,X.name,!0),r(v,!0),de()?.(C()),r(J,!1),requestAnimationFrame(()=>e(pe)?.focus())},onClose:()=>r(J,!1)}),l(p),Fe(3,p,()=>Ze,()=>({tier:"moderate"})),o(d,p)},f=d=>{{let p=z(()=>!O());we(d,{variant:"ghost",size:"sm",class:"w-full justify-start text-subtle",onclick:()=>r(J,!0),get disabled(){return e(p)},children:(N,X)=>{var H=Ir(),V=U(H);Te(V,{get icon(){return Pt},class:"mr-1.5"});var Z=n(V);g(A=>m(Z,` ${A??""}`),[()=>u.workspace_setupScriptEditor_autoGenerate_label()]),o(N,H)},$$slots:{default:!0}})}};W(_,d=>{e(J)&&O()?d(i):d(f,-1)})}l(w);var x=n(w,2);{var k=d=>{var p=Ut(),N=c(p),X=S(N,!0),H=n(N,2);{let V=z(()=>e(s)===qe),Z=z(()=>e(s)===qe);we(H,{variant:"ghost",truncateLabel:!1,get active(){return e(V)},get"aria-pressed"(){return e(Z)},class:"w-full h-auto justify-start whitespace-normal text-left px-2 py-1.5",onclick:()=>ye(qe),children:(A,oe)=>{var M=Nt(),ee=c(M),te=S(ee,!0),ne=n(ee,2),Ce=S(ne,!0);l(M),g((Y,re)=>{m(te,Y),m(Ce,re)},[()=>tt(it,"repo-config"),()=>u.workspace_setupScriptEditor_repoConfig_description()]),o(A,M)},$$slots:{default:!0}})}l(p),g(V=>m(X,V),[()=>u.workspace_setupScriptEditor_repoConfig_label()]),o(d,p)};W(x,d=>{le()&&d(k)})}var L=n(x,2);{var ue=d=>{var p=Ut(),N=c(p),X=S(N,!0),H=n(N,2);{let V=z(()=>e(s)===B),Z=z(()=>e(s)===B);we(H,{variant:"ghost",truncateLabel:!1,get active(){return e(V)},get"aria-pressed"(){return e(Z)},class:"w-full h-auto justify-start whitespace-normal text-left px-2 py-1.5",onclick:()=>ye(B),children:(A,oe)=>{var M=Nt(),ee=c(M),te=S(ee,!0),ne=n(ee,2),Ce=S(ne,!0);l(M),g((Y,re)=>{m(te,Y),m(Ce,re)},[()=>tt(e(G).name,e(G).nameSource),()=>u.workspace_setupScriptEditor_lastUsed_description()]),o(A,M)},$$slots:{default:!0}})}l(p),g(V=>m(X,V),[()=>u.workspace_setupScriptEditor_lastUsed_label()]),o(d,p)};W(L,d=>{e(G)&&d(ue)})}var ve=n(L,2),I=c(ve),F=S(I,!0),y=n(I,2);Xe(y,17,()=>et,d=>d.id,(d,p)=>{{let N=z(()=>e(s)===`template-${e(p).id}`),X=z(()=>e(s)===`template-${e(p).id}`);we(d,{variant:"ghost",truncateLabel:!1,get active(){return e(N)},get"aria-pressed"(){return e(X)},class:"w-full h-auto justify-start whitespace-normal text-left px-2 py-1.5",onclick:()=>ye(`template-${e(p).id}`),children:(H,V)=>{var Z=Ur(),A=c(Z),oe=c(A),M=S(oe,!0),ee=n(oe,2);{var te=Y=>{var re=Nr(),Ne=S(re,!0);g(We=>m(Ne,We),[()=>u.workspace_setupScriptEditor_recommended_label()]),o(Y,re)};W(ee,Y=>{e(p).projectType===ie()&&Y(te)})}l(A);var ne=n(A,2),Ce=S(ne,!0);l(Z),g(()=>{m(M,e(p).name),m(Ce,e(p).description)}),o(H,Z)},$$slots:{default:!0}})}}),l(ve),g((d,p,N)=>{m(T,d),m($,p),m(F,N)},[()=>u.workspace_setupScriptEditor_generate_label(),()=>u.workspace_setupScriptEditor_generate_description(),()=>u.workspace_setupScriptEditor_templates_label()]),o(t,a)},Re=t=>{var a=Rr(),w=U(a),j=c(w),T=S(j,!0),h=n(j,2);Xe(h,21,()=>jt,i=>i.name,(i,f)=>{var x=Ue(),k=U(x);Ee(k,()=>At,(L,ue)=>{ue(L,{delayDuration:100,children:(ve,I)=>{var F=Ue(),y=U(F);Ee(y,()=>Ct,(d,p)=>{p(d,{delayDuration:100,children:(N,X)=>{var H=It(),V=U(H);Ee(V,()=>Et,(A,oe)=>{oe(A,{children:(M,ee)=>{var te=Fr(),ne=S(te);g(()=>m(ne,`$${e(f).name??""}`)),o(M,te)},$$slots:{default:!0}})});var Z=n(V,2);Ee(Z,()=>Tt,(A,oe)=>{oe(A,{side:"bottom",class:"max-w-xs z-[200]",children:(M,ee)=>{var te=Dr(),ne=U(te),Ce=S(ne,!0),Y=n(ne,2),re=c(Y),Ne=n(re),We=S(Ne,!0);l(Y),g(pt=>{m(Ce,e(f).description),m(re,`${pt??""} `),m(We,e(f).example)},[()=>u.workspace_setupScriptEditor_example_before()]),o(M,te)},$$slots:{default:!0}})}),o(N,H)},$$slots:{default:!0}})}),o(ve,F)},$$slots:{default:!0}})}),o(i,x)}),l(h),l(w);var $=n(w,2),_=c($);xt(ht(_,{language:"shell",lineNumbers:!0,get lineWrapping(){return e(Se)},get value(){return C()},set value(i){C(i)}}),i=>r(pe,i,!0),()=>e(pe)),l($),g(i=>m(T,i),[()=>u.workspace_setupScriptEditor_variables_label()]),ar("keydown",$,i=>{i.altKey&&i.key==="z"&&(i.preventDefault(),r(Se,!e(Se)))}),o(t,a)},Ge=t=>{var a=Ke(),w=c(a);{var j=h=>{var $=Gr(),_=U($),i=c(_);De(i),l(_);var f=n(_,2),x=c(f);Re(x),l(f),Fe(1,_,()=>$t,()=>({tier:"moderate",axis:"x",distance:-8})),Fe(1,f,()=>$t,()=>({tier:"moderate",axis:"x"})),o(h,$)},T=h=>{var $=Lr(),_=U($),i=c(_);De(i),l(_);var f=n(_,2),x=c(f);Re(x),l(f),o(h,$)};W(w,h=>{he()==="workspace"?h(j):h(T,-1)})}l(a),g(()=>Oe(a,1,gt(he()==="workspace"?"setup-workspace-layout":"grid flex-1 min-h-0 min-w-0 grid-cols-1 grid-rows-[minmax(0,1fr)_minmax(0,2fr)] md:grid-cols-[minmax(0,2fr)_minmax(0,3fr)] md:grid-rows-1"),"svelte-1yy464i")),o(t,a)};let O=D(P,"repoPath",7,""),ae=D(P,"repositoryKey",7),me=D(P,"githubUrl",7,null),ie=D(P,"projectType",7,void 0),le=D(P,"repoConfigScript",7,null),C=D(P,"value",15,""),fe=D(P,"expanded",15,!1),ge=D(P,"scriptName",31,()=>rt(u.workspace_setupScriptEditor_custom_name())),ce=D(P,"scriptNameSource",15,"named"),xe=D(P,"isCustomScript",15,!1),be=D(P,"compact",7,!1),Le=D(P,"triggerClass",7,""),Me=D(P,"contentOnly",7,!1),je=D(P,"contentClass",7,""),he=D(P,"presentation",7,"editor"),de=D(P,"onchange",7),J=K(!1),ke=K(rt(mt(()=>xe()))),$e=K(!1),Ie=K(!1),Ye=K(void 0),pe=K(void 0),s=K(""),v=K(!1),E=K(rt(ge())),q=K(rt(ce())),se=K(!1);const B="last-used",G=z(()=>{const t=ae()??O(),a=t?gr(t,me()):void 0;return a?.nameSource==="repo-config"?{...a,name:"Custom",nameSource:"custom"}:a}),Q=z(()=>{const t=new Map;return le()&&t.set(qe,{content:le(),label:it,source:"repo-config"}),e(G)&&t.set(B,{content:e(G).content,label:e(G).name,source:e(G).nameSource}),et.forEach(a=>{t.set(`template-${a.id}`,{content:fr(a),label:a.name,source:"named"})}),t});let Se=K(!0);const ze=z(()=>{if(e(v))return tt(e(E),e(q));if(!e(s))return u.workspace_setupScriptEditor_custom_name();const t=e(Q).get(e(s));return t?tt(t.label,t.source):u.workspace_setupScriptEditor_custom_name()});function ye(t){r(s,t,!0),r(v,!1),r(se,!0);const a=e(Q).get(t);a&&(C(a.content),r(E,a.label,!0),r(q,a.source,!0),de()?.(C())),he()==="picker"?(r(ke,!1),r($e,!1),requestAnimationFrame(()=>e(Ye)?.querySelector("[data-setup-source][aria-pressed=true]")?.focus())):requestAnimationFrame(()=>e(pe)?.focus())}function lt(t){if(e(s)&&e(s)!=="none"){const a=e(Q).get(e(s));a&&r(v,t!==a.content)}else t&&r(v,!0)}const Pe=(()=>{const t=et.find(a=>a.id==="generic");return t?`template-${t.id}`:""})(),st=z(()=>e(v)||!e(s)?"custom":e(s)),Je=z(()=>{const t=[];le()&&t.push({id:qe,name:tt(it,"repo-config")}),e(G)&&t.push({id:B,name:u.workspace_setupScriptEditor_lastUsed_label()});for(const a of et){const w=`template-${a.id}`;(w===Pe||w===e(s))&&t.push({id:w,name:a.name})}return t.push({id:"custom",name:u.workspace_setupScriptPicker_custom_label()}),t}),ct=z(()=>et.filter(t=>!e(Je).some(a=>a.id===`template-${t.id}`)));function Lt(){r(s,""),r(v,!0),r(E,"Custom"),r(q,"custom"),r(J,!1),r(ke,!0),requestAnimationFrame(()=>e(pe)?.focus())}function Mt(t){r(se,!0),r(s,""),C(t.content),r(E,t.name,!0),r(q,"named"),r(v,!0),de()?.(C()),r(J,!1),requestAnimationFrame(()=>e(pe)?.focus())}let dt=K(null);ft(()=>{const t=ae()??O();if(t===e(dt))return;const a=e(dt)===null&&(xe()||C().trim().length>0);if(r(dt,t,!0),a){mt(()=>{let T=!1;const h=C().trim();for(const[$,_]of e(Q).entries())if(h===_.content.trim()&&_.source===ce()&&_.label===ge()){r(s,$,!0),r(E,_.label,!0),r(q,_.source,!0),r(v,!1),T=!0;break}T||(r(v,!0),e(E)||(r(E,ge()||u.workspace_setupScriptEditor_custom_name(),!0),r(q,ge()?ce():"named",!0))),r(se,!0)});return}const w=!!le(),j=e(G);if(mt(()=>{if(r(v,!1),r(se,!0),w)r(s,qe,!0),r(E,it,!0),r(q,"repo-config");else if(j)r(s,B),r(E,j.name,!0),r(q,j.nameSource,!0);else if(Pe){r(s,Pe,!0);const T=e(Q).get(Pe);r(E,T?.label||u.workspace_setupScriptEditor_custom_name(),!0),r(q,"named")}else r(E,u.workspace_setupScriptEditor_custom_name(),!0),r(q,"named")}),w&&le())C(le()),de()?.(C());else if(j)C(j.content),de()?.(C());else if(Pe){const T=e(Q).get(Pe);T&&(C(T.content),de()?.(C()))}}),ft(()=>{if(e(se)){r(se,!1);return}C()!==void 0&&lt(C())}),ft(()=>{ge(e(E)),ce(e(q)),xe(e(v))});var zt={get repoPath(){return O()},set repoPath(t=""){O(t),R()},get repositoryKey(){return ae()},set repositoryKey(t){ae(t),R()},get githubUrl(){return me()},set githubUrl(t=null){me(t),R()},get projectType(){return ie()},set projectType(t=void 0){ie(t),R()},get repoConfigScript(){return le()},set repoConfigScript(t=null){le(t),R()},get value(){return C()},set value(t=""){C(t),R()},get expanded(){return fe()},set expanded(t=!1){fe(t),R()},get scriptName(){return ge()},set scriptName(t=u.workspace_setupScriptEditor_custom_name()){ge(t),R()},get scriptNameSource(){return ce()},set scriptNameSource(t="named"){ce(t),R()},get isCustomScript(){return xe()},set isCustomScript(t=!1){xe(t),R()},get compact(){return be()},set compact(t=!1){be(t),R()},get triggerClass(){return Le()},set triggerClass(t=""){Le(t),R()},get contentOnly(){return Me()},set contentOnly(t=!1){Me(t),R()},get contentClass(){return je()},set contentClass(t=""){je(t),R()},get presentation(){return he()},set presentation(t="editor"){he(t),R()},get onchange(){return de()},set onchange(t){de(t),R()},$set:Ft,$on:(t,a)=>Dt(P,t,a)},yt=Ue(),Wt=U(yt);{var qt=t=>{var a=Ue(),w=U(a);{var j=T=>{var h=Ue(),$=U(h);{var _=x=>{var k=Ke(),L=c(k);Ae(L),l(k),g(()=>Oe(k,1,`${je()??""} min-w-0`,"svelte-1yy464i")),o(x,k)},i=x=>{var k=Ke(),L=c(k);Ge(L),l(k),g(()=>Oe(k,1,`${je()??""} flex min-h-0 min-w-0 flex-1 flex-col`,"svelte-1yy464i")),o(x,k)},f=x=>{var k=Ke(),L=c(k);Ge(L),l(k),g(()=>Oe(k,1,`${je()??""} flex flex-col gap-3 flex-1 min-h-0 min-w-0`,"svelte-1yy464i")),Fe(3,k,()=>Ze,()=>({tier:"moderate"})),o(x,k)};W($,x=>{he()==="picker"?x(_):he()==="workspace"?x(i,1):x(f,-1)})}o(T,h)};W(w,T=>{fe()&&T(j)})}o(t,a)},Kt=t=>{var a=qr(),w=U(a),j=c(w);we(j,{variant:"ghost",size:"sm",get class(){return`whitespace-nowrap hover:text-inherit! ${Le()??""}`},onclick:()=>fe(!fe()),children:(i,f)=>{var x=Mr(),k=U(x);Te(k,{get icon(){return bt},size:"xs"});var L=n(k,2),ue=S(L,!0),ve=n(L,2),I=S(ve,!0);g(F=>{m(ue,F),m(I,e(ze))},[()=>u.workspace_setupScriptEditor_setupScript_label()]),o(i,x)},$$slots:{default:!0}});var T=n(j,2);{var h=i=>{var f=zr(),x=c(f);Ge(x),l(f),Fe(3,f,()=>Ze,()=>({tier:"moderate"})),o(i,f)};W(T,i=>{fe()&&!be()&&i(h)})}l(w);var $=n(w,2);{var _=i=>{var f=Wr(),x=c(f);Ge(x),l(f),Fe(3,f,()=>Ze,()=>({tier:"moderate"})),o(i,f)};W($,i=>{fe()&&be()&&i(_)})}g(()=>Oe(w,1,gt(be()?"":"w-full"))),o(t,a)};W(Wt,t=>{Me()?t(qt):t(Kt,-1)})}return o(He,yt),Gt(zt)}rr(["keydown"]);export{Kr as default};
1
+ import{t as Ot,bq as D,bo as u,a_ as W,by as Ft,b as Dt}from"./CNdlzZOD.js";import{bs as Rt,bV as K,br as rt,bk as er,bj as tr,bH as r,a5 as c,aD as e,bS as n,bl as S,bA as l,b_ as g,bO as m,W as o,bn as Gt,aA as R,c9 as z,be as Ve,b$ as Be,aB as b,c5 as mt,ca as ft,a7 as Ue,ay as U,ai as rr,aj as ar,bf as sr}from"./DYhIMPy1.js";import{I as or,v as Oe,j as gt,n as Xe,u as nr}from"./9iFKJfkz.js";import{c as Ee}from"./b0njYmMP.js";import{I as Fe,D as Ze,h as $t}from"./HVSUZ4Kq.js";import{b as xt}from"./BaIAhI85.js";import{F as Te,cK as ir,aq as lr,cD as bt,cU as Pt,c7 as cr}from"./BIfN-lxi.js";import{f as we}from"./D3glRUn0.js";import"./BJyBc51V.js";import{s as nt}from"./5lVDKMGV.js";import{M as dr}from"./C58HgKcj.js";import{e as pr,W as _e}from"./kw6HOG6J.js";import{h as Ct,i as Et,g as Tt,P as At}from"./DhFS-yhc.js";import{C as ht}from"./CqajeRKF.js";import{c as ur}from"./ChTqQfQN.js";import"./DIh4SQwA.js";import{d as vr}from"./Br_KUH7F.js";import{Ig as _r}from"./BoIGV7s7.js";import{dA as mr}from"./De3HYtL6.js";import{S as et,k as fr,a as jt}from"./C6bEmXfu.js";import{R as qe,c as it,m as gr,bI as tt}from"./CRkupLLY.js";import"./BL9TmjaL.js";var xr=b('<div class="w-2 h-2 bg-green-500 rounded-full animate-pulse"></div>'),br=b('<div class="text-sm text-danger bg-danger-background/10 rounded-md p-3"> </div>'),hr=b('<div class="flex items-center gap-2 text-subtle"><!> <span class="text-sm"> </span></div>'),Sr=b('<div class="p-4 max-h-60 overflow-y-auto overscroll-contain"><!></div>'),yr=b('<div class="p-3 bg-muted/30"><div class="flex items-center justify-between mb-2"><div class="flex items-center gap-2"><!> <span class="text-sm font-medium"> </span></div> <!></div> <p class="text-xs text-subtle mb-2"> </p> <div class="h-32 rounded border border-border overflow-hidden"><!></div></div>'),wr=b('<div class="flex flex-col bg-background border border-border rounded-lg overflow-hidden"><div class="flex items-center justify-between px-3 py-2 border-b border-border bg-muted/30"><div class="flex items-center gap-2"><!> <span class="text-sm font-medium"> </span> <!></div> <div class="flex items-center gap-1"><!></div></div> <!> <!></div>');function St(He,P){if(new.target)return Ot({component:St,...He});Rt(P,!0);const at=ur("SetupScriptAgent");let Ae=D(P,"repoPath",7),De=D(P,"onScriptGenerated",7),Re=D(P,"onClose",7),Ge=K(rt(crypto.randomUUID())),O=K(!1),ae=K(null),me=!1,ie=K(null);er(()=>{me=!0,C()}),tr(()=>{me=!1});async function le(){try{const v=mr.select(_r.state).find(E=>E.repositoryPath===Ae()||E.path===Ae()||E.worktreePath===Ae());return v?String(v.id):null}catch{return null}}async function C(){r(O,!0),r(ae,null),r(ie,null);try{const s=await le();if(!me)return;if(!s){r(ae,u.workspace_setupScriptAgent_noWorkspace_error(),!0),r(O,!1);return}const v=await vr.setupScripts.generate(s);if(!me)return;if(!v||!v.script){r(ae,u.workspace_setupScriptAgent_generateFailed_error(),!0),r(O,!1);return}r(ie,{name:v.projectType?u.workspace_setupScriptAgent_projectTypeSetup_label({projectType:v.projectType}):u.workspace_setupScriptAgent_generatedSetup_label(),description:v.projectType?u.workspace_setupScriptAgent_generatedForProject_description({projectType:v.projectType}):u.workspace_setupScriptAgent_generatedFromAnalysis_description(),content:v.script},!0),r(O,!1)}catch(s){if(at.error("Failed to generate setup script",s),!me)return;r(ae,s instanceof Error?s.message:u.workspace_setupScriptAgent_generateFailed_error(),!0),r(O,!1)}}function fe(s){De()?.(s)}var ge={get repoPath(){return Ae()},set repoPath(s){Ae(s),R()},get onScriptGenerated(){return De()},set onScriptGenerated(s){De(s),R()},get onClose(){return Re()},set onClose(s){Re(s),R()},$set:Ft,$on:(s,v)=>Dt(P,s,v)},ce=wr(),xe=c(ce),be=c(xe),Le=c(be);pr(Le,{variant:"standard",get agentId(){return e(Ge)}});var Me=n(Le,2),je=S(Me,!0),he=n(Me,2);{var de=s=>{var v=xr();o(s,v)};W(he,s=>{e(O)&&s(de)})}l(be);var J=n(be,2),ke=c(J);{let s=z(()=>u.workspace_setupScriptAgent_close_ariaLabel());we(ke,{variant:"ghost-light",size:"icon-sm",iconOnly:!0,get"aria-label"(){return e(s)},get onclick(){return Re()},children:(v,E)=>{Te(v,{get icon(){return ir}})},$$slots:{default:!0}})}l(J),l(xe);var $e=n(xe,2);{var Ie=s=>{var v=Sr(),E=c(v);{var q=B=>{var G=br(),Q=S(G,!0);g(()=>m(Q,e(ae))),o(B,G)},se=B=>{var G=hr(),Q=c(G);or(Q,{size:16,class:"text-primary"});var Se=n(Q,2),ze=S(Se,!0);l(G),g(ye=>m(ze,ye),[()=>u.workspace_setupScriptAgent_analyzing_label()]),o(B,G)};W(E,B=>{e(ae)?B(q):B(se,-1)})}l(v),o(s,v)};W($e,s=>{(e(ae)||e(O))&&s(Ie)})}var Ye=n($e,2);{var pe=s=>{var v=yr(),E=c(v),q=c(E),se=c(q);Te(se,{get icon(){return lr},class:"text-green-500"});var B=n(se,2),G=S(B,!0);l(q);var Q=n(q,2);we(Q,{variant:"primary",size:"sm",onclick:()=>fe(e(ie)),class:"h-7",children:(Pe,st)=>{Ve();var Je=Be();g(ct=>m(Je,ct),[()=>u.workspace_setupScriptAgent_createScript_label()]),o(Pe,Je)},$$slots:{default:!0}}),l(E);var Se=n(E,2),ze=S(Se,!0),ye=n(Se,2),lt=c(ye);ht(lt,{get value(){return e(ie).content},language:"shell",readOnly:!0,lineNumbers:!1}),l(ye),l(v),g(()=>{m(G,e(ie).name),m(ze,e(ie).description)}),o(s,v)};W(Ye,s=>{e(ie)&&!e(O)&&s(pe)})}return l(ce),g(s=>m(je,s),[()=>u.workspace_setupScriptAgent_title()]),o(He,ce),Gt(ge)}var kr=b('<span class="block truncate"> </span>'),$r=b("<div></div>"),Pr=b('<div role="group"></div> <div class="mt-2 border-t border-border pt-2"><!></div> <!> <div class="mt-2 border-t border-border pt-2"><!> <!></div>',1),Cr=b('<code class="type-caption text-muted-foreground"> </code>'),Er=b('<p> </p> <code class="type-caption"> </code>',1),It=b("<!> <!>",1),Tr=b('<div class="mt-2 flex flex-wrap gap-2 px-2"></div>'),Ar=b('<div class="h-44 min-w-0 overflow-hidden rounded-(--radius-medium) border border-border bg-background py-2"><!></div> <div class="mt-2 px-1"><!> <!></div>',1),jr=b('<div class="mb-2 flex items-center justify-between gap-3 px-2"><div class="min-w-0"><h3> </h3> <p class="type-caption truncate text-muted-foreground"> </p></div> <!></div> <!>',1),Ke=b("<div><!></div>"),Ir=b("<!> ",1),Nt=b('<div class="min-w-0 w-full"><span class="text-sm"> </span> <p class="text-xs text-subtle mt-0.5"> </p></div>'),Ut=b('<div class="mb-4"><h4 class="type-caption font-medium text-muted-foreground mb-1.5 px-2"> </h4> <!></div>'),Nr=b('<span class="type-caption px-1.5 py-0.5 rounded-full bg-primary/10 text-primary font-medium shrink-0"> </span>'),Ur=b('<div class="min-w-0 w-full"><div class="flex flex-wrap items-center gap-x-2 gap-y-1"><span class="text-sm"> </span> <!></div> <p class="text-xs text-subtle mt-0.5"> </p></div>'),Or=b('<div class="mb-4"><h4 class="type-caption font-medium text-muted-foreground mb-1.5 px-2"> </h4> <p class="text-xs text-subtle px-2 mb-2"> </p> <!></div> <!> <!> <div class="mb-4"><h4 class="type-caption font-medium text-muted-foreground mb-1.5 px-2"> </h4> <!></div>',1),Fr=b('<code class="type-caption px-1.5 py-0.5 rounded bg-background/80 text-muted-foreground font-mono cursor-pointer hover:bg-background hover:text-foreground transition-colors"> </code>'),Dr=b('<p class="text-xs"> </p> <p class="mt-1 text-xs text-muted-foreground"> <code class="type-caption"> </code></p>',1),Rr=b('<div class="flex flex-wrap items-center gap-x-3 gap-y-1.5 px-3 py-1.5 bg-muted/30 shrink-0"><span class="type-caption font-medium text-muted-foreground shrink-0"> </span> <div class="flex flex-wrap gap-1.5"></div></div> <div class="flex-1 min-h-0 min-w-0 overflow-hidden py-3 bg-background"><!></div>',1),Gr=b('<div class="flex min-h-0 min-w-0 flex-col overflow-y-auto"><!></div> <div class="flex min-h-0 min-w-0 flex-col"><!></div>',1),Lr=b('<div class="flex flex-col min-h-0 min-w-0 overflow-y-auto p-2 md:pr-4"><!></div> <div class="flex flex-col min-w-0 min-h-0"><!></div>',1),Mr=b('<!> <span class="text-sm font-normal text-subtle"> </span> <span class="text-subtle font-normal"> </span>',1),zr=b('<div class="mt-1 pl-7 space-y-3"><!></div>'),Wr=b('<div class="space-y-3"><!></div>'),qr=b("<div><!> <!></div> <!>",1);function Kr(He,P){if(new.target)return Ot({component:Kr,...He});Rt(P,!0);const at=(t,a=sr)=>{{const w=_=>{Te(_,{get icon(){return bt},get class(){return _e.icon}})},j=_=>{var i=kr(),f=S(i,!0);g(()=>m(f,a().name)),o(_,i)},T=_=>{{let i=z(()=>e(st)===a().id?"checked":"empty");dr(_,{get state(){return e(i)}})}};let h=z(()=>e(st)===a().id),$=z(()=>e(st)===a().id);nt(t,{get selected(){return e(h)},get"aria-pressed"(){return e($)},get"data-setup-source"(){return a().id},get class(){return _e.row},onclick:()=>a().id==="custom"?Lt():ye(a().id),leading:w,title:j,trailing:T,$$slots:{leading:!0,title:!0,trailing:!0}})}},Ae=t=>{var a=Ke(),w=c(a);{var j=h=>{var $=Pr(),_=U($);Xe(_,21,()=>e(Je),I=>I.id,(I,F)=>{at(I,()=>e(F))}),l(_);var i=n(_,2),f=c(i);nt(f,{get"aria-expanded"(){return e($e)},get class(){return _e.row},onclick:()=>r($e,!e($e)),leading:y=>{Te(y,{get icon(){return cr},get class(){return _e.icon}})},title:y=>{Ve();var d=Be();g(p=>m(d,p),[()=>u.workspace_setupScriptEditor_templates_label()]),o(y,d)},$$slots:{leading:!0,title:!0}}),l(i);var x=n(i,2);{var k=I=>{var F=$r();Xe(F,21,()=>e(ct),y=>y.id,(y,d)=>{at(y,()=>({id:`template-${e(d).id}`,name:e(d).name}))}),l(F),Fe(3,F,()=>Ze,()=>({tier:"moderate"})),o(I,F)};W(x,I=>{e($e)&&I(k)})}var L=n(x,2),ue=c(L);nt(ue,{get class(){return _e.row},onclick:()=>r(ke,!0),leading:y=>{Te(y,{get icon(){return bt},get class(){return _e.icon}})},title:y=>{Ve();var d=Be();g(p=>m(d,p),[()=>u.workspace_setupScriptPicker_edit_label()]),o(y,d)},$$slots:{leading:!0,title:!0}});var ve=n(ue,2);{const I=d=>{Te(d,{get icon(){return Pt},get class(){return _e.icon}})},F=d=>{Ve();var p=Be();g(N=>m(p,N),[()=>u.workspace_setupScriptEditor_autoGenerate_label()]),o(d,p)};let y=z(()=>!O());nt(ve,{get class(){return _e.row},get disabled(){return e(y)},onclick:()=>{r(ke,!0),r(J,!0)},leading:I,title:F,$$slots:{leading:!0,title:!0}})}l(L),g(I=>nr(_,"aria-label",I),[()=>u.workspace_setupScriptEditor_setupScript_label()]),o(h,$)},T=h=>{var $=jr(),_=U($),i=c(_),f=c(i),x=S(f,!0),k=n(f,2),L=S(k,!0);l(i);var ue=n(i,2);we(ue,{variant:"ghost",size:"sm",onclick:()=>{r(ke,!1),r(J,!1)},children:(y,d)=>{Ve();var p=Be();g(N=>m(p,N),[()=>u.workspace_setupScriptPicker_choose_label()]),o(y,p)},$$slots:{default:!0}}),l(_);var ve=n(_,2);{var I=y=>{St(y,{get repoPath(){return O()},onScriptGenerated:Mt,onClose:()=>r(J,!1)})},F=y=>{var d=Ar(),p=U(d),N=c(p);xt(ht(N,{language:"shell",lineNumbers:!1,get lineWrapping(){return e(Se)},get value(){return C()},set value(A){C(A)}}),A=>r(pe,A,!0),()=>e(pe)),l(p);var X=n(p,2),H=c(X);we(H,{variant:"ghost",size:"sm",get active(){return e(Ie)},get"aria-expanded"(){return e(Ie)},onclick:()=>r(Ie,!e(Ie)),children:(A,oe)=>{Ve();var M=Be();g(ee=>m(M,ee),[()=>u.workspace_setupScriptEditor_variables_label()]),o(A,M)},$$slots:{default:!0}});var V=n(H,2);{var Z=A=>{var oe=Ue(),M=U(oe);Ee(M,()=>At,(ee,te)=>{te(ee,{delayDuration:100,children:(ne,Ce)=>{var Y=Tr();Xe(Y,21,()=>jt,re=>re.name,(re,Ne)=>{var We=Ue(),pt=U(We);Ee(pt,()=>Ct,(Vt,Bt)=>{Bt(Vt,{children:(Ht,Vr)=>{var wt=It(),kt=U(wt);Ee(kt,()=>Et,(ut,vt)=>{vt(ut,{children:(_t,Jt)=>{var Qe=Cr(),ot=S(Qe);g(()=>m(ot,`$${e(Ne).name??""}`)),o(_t,Qe)},$$slots:{default:!0}})});var Yt=n(kt,2);Ee(Yt,()=>Tt,(ut,vt)=>{vt(ut,{side:"top",class:"max-w-xs",children:(_t,Jt)=>{var Qe=Er(),ot=U(Qe),Qt=S(ot,!0),Xt=n(ot,2),Zt=S(Xt,!0);g(()=>{m(Qt,e(Ne).description),m(Zt,e(Ne).example)}),o(_t,Qe)},$$slots:{default:!0}})}),o(Ht,wt)},$$slots:{default:!0}})}),o(re,We)}),l(Y),o(ne,Y)},$$slots:{default:!0}})}),o(A,oe)};W(V,A=>{e(Ie)&&A(Z)})}l(X),o(y,d)};W(ve,y=>{e(J)&&O()?y(I):y(F,-1)})}g(y=>{Oe(f,1,gt(_e.title),"svelte-1yy464i"),m(x,y),m(L,e(ze))},[()=>u.workspace_setupScriptPicker_commands_label()]),o(h,$)};W(w,h=>{e(ke)?h(T,-1):h(j)})}l(a),xt(a,h=>r(Ye,h),()=>e(Ye)),g(()=>Oe(a,1,`${_e.rows} min-w-0`,"svelte-1yy464i")),o(t,a)},De=t=>{var a=Or(),w=U(a),j=c(w),T=S(j,!0),h=n(j,2),$=S(h,!0),_=n(h,2);{var i=d=>{var p=Ke(),N=c(p);St(N,{get repoPath(){return O()},onScriptGenerated:X=>{r(se,!0),r(s,""),C(X.content),r(E,X.name,!0),r(v,!0),de()?.(C()),r(J,!1),requestAnimationFrame(()=>e(pe)?.focus())},onClose:()=>r(J,!1)}),l(p),Fe(3,p,()=>Ze,()=>({tier:"moderate"})),o(d,p)},f=d=>{{let p=z(()=>!O());we(d,{variant:"ghost",size:"sm",class:"w-full justify-start text-subtle",onclick:()=>r(J,!0),get disabled(){return e(p)},children:(N,X)=>{var H=Ir(),V=U(H);Te(V,{get icon(){return Pt},class:"mr-1.5"});var Z=n(V);g(A=>m(Z,` ${A??""}`),[()=>u.workspace_setupScriptEditor_autoGenerate_label()]),o(N,H)},$$slots:{default:!0}})}};W(_,d=>{e(J)&&O()?d(i):d(f,-1)})}l(w);var x=n(w,2);{var k=d=>{var p=Ut(),N=c(p),X=S(N,!0),H=n(N,2);{let V=z(()=>e(s)===qe),Z=z(()=>e(s)===qe);we(H,{variant:"ghost",truncateLabel:!1,get active(){return e(V)},get"aria-pressed"(){return e(Z)},class:"w-full h-auto justify-start whitespace-normal text-left px-2 py-1.5",onclick:()=>ye(qe),children:(A,oe)=>{var M=Nt(),ee=c(M),te=S(ee,!0),ne=n(ee,2),Ce=S(ne,!0);l(M),g((Y,re)=>{m(te,Y),m(Ce,re)},[()=>tt(it,"repo-config"),()=>u.workspace_setupScriptEditor_repoConfig_description()]),o(A,M)},$$slots:{default:!0}})}l(p),g(V=>m(X,V),[()=>u.workspace_setupScriptEditor_repoConfig_label()]),o(d,p)};W(x,d=>{le()&&d(k)})}var L=n(x,2);{var ue=d=>{var p=Ut(),N=c(p),X=S(N,!0),H=n(N,2);{let V=z(()=>e(s)===B),Z=z(()=>e(s)===B);we(H,{variant:"ghost",truncateLabel:!1,get active(){return e(V)},get"aria-pressed"(){return e(Z)},class:"w-full h-auto justify-start whitespace-normal text-left px-2 py-1.5",onclick:()=>ye(B),children:(A,oe)=>{var M=Nt(),ee=c(M),te=S(ee,!0),ne=n(ee,2),Ce=S(ne,!0);l(M),g((Y,re)=>{m(te,Y),m(Ce,re)},[()=>tt(e(G).name,e(G).nameSource),()=>u.workspace_setupScriptEditor_lastUsed_description()]),o(A,M)},$$slots:{default:!0}})}l(p),g(V=>m(X,V),[()=>u.workspace_setupScriptEditor_lastUsed_label()]),o(d,p)};W(L,d=>{e(G)&&d(ue)})}var ve=n(L,2),I=c(ve),F=S(I,!0),y=n(I,2);Xe(y,17,()=>et,d=>d.id,(d,p)=>{{let N=z(()=>e(s)===`template-${e(p).id}`),X=z(()=>e(s)===`template-${e(p).id}`);we(d,{variant:"ghost",truncateLabel:!1,get active(){return e(N)},get"aria-pressed"(){return e(X)},class:"w-full h-auto justify-start whitespace-normal text-left px-2 py-1.5",onclick:()=>ye(`template-${e(p).id}`),children:(H,V)=>{var Z=Ur(),A=c(Z),oe=c(A),M=S(oe,!0),ee=n(oe,2);{var te=Y=>{var re=Nr(),Ne=S(re,!0);g(We=>m(Ne,We),[()=>u.workspace_setupScriptEditor_recommended_label()]),o(Y,re)};W(ee,Y=>{e(p).projectType===ie()&&Y(te)})}l(A);var ne=n(A,2),Ce=S(ne,!0);l(Z),g(()=>{m(M,e(p).name),m(Ce,e(p).description)}),o(H,Z)},$$slots:{default:!0}})}}),l(ve),g((d,p,N)=>{m(T,d),m($,p),m(F,N)},[()=>u.workspace_setupScriptEditor_generate_label(),()=>u.workspace_setupScriptEditor_generate_description(),()=>u.workspace_setupScriptEditor_templates_label()]),o(t,a)},Re=t=>{var a=Rr(),w=U(a),j=c(w),T=S(j,!0),h=n(j,2);Xe(h,21,()=>jt,i=>i.name,(i,f)=>{var x=Ue(),k=U(x);Ee(k,()=>At,(L,ue)=>{ue(L,{delayDuration:100,children:(ve,I)=>{var F=Ue(),y=U(F);Ee(y,()=>Ct,(d,p)=>{p(d,{delayDuration:100,children:(N,X)=>{var H=It(),V=U(H);Ee(V,()=>Et,(A,oe)=>{oe(A,{children:(M,ee)=>{var te=Fr(),ne=S(te);g(()=>m(ne,`$${e(f).name??""}`)),o(M,te)},$$slots:{default:!0}})});var Z=n(V,2);Ee(Z,()=>Tt,(A,oe)=>{oe(A,{side:"bottom",class:"max-w-xs z-[200]",children:(M,ee)=>{var te=Dr(),ne=U(te),Ce=S(ne,!0),Y=n(ne,2),re=c(Y),Ne=n(re),We=S(Ne,!0);l(Y),g(pt=>{m(Ce,e(f).description),m(re,`${pt??""} `),m(We,e(f).example)},[()=>u.workspace_setupScriptEditor_example_before()]),o(M,te)},$$slots:{default:!0}})}),o(N,H)},$$slots:{default:!0}})}),o(ve,F)},$$slots:{default:!0}})}),o(i,x)}),l(h),l(w);var $=n(w,2),_=c($);xt(ht(_,{language:"shell",lineNumbers:!0,get lineWrapping(){return e(Se)},get value(){return C()},set value(i){C(i)}}),i=>r(pe,i,!0),()=>e(pe)),l($),g(i=>m(T,i),[()=>u.workspace_setupScriptEditor_variables_label()]),ar("keydown",$,i=>{i.altKey&&i.key==="z"&&(i.preventDefault(),r(Se,!e(Se)))}),o(t,a)},Ge=t=>{var a=Ke(),w=c(a);{var j=h=>{var $=Gr(),_=U($),i=c(_);De(i),l(_);var f=n(_,2),x=c(f);Re(x),l(f),Fe(1,_,()=>$t,()=>({tier:"moderate",axis:"x",distance:-8})),Fe(1,f,()=>$t,()=>({tier:"moderate",axis:"x"})),o(h,$)},T=h=>{var $=Lr(),_=U($),i=c(_);De(i),l(_);var f=n(_,2),x=c(f);Re(x),l(f),o(h,$)};W(w,h=>{he()==="workspace"?h(j):h(T,-1)})}l(a),g(()=>Oe(a,1,gt(he()==="workspace"?"setup-workspace-layout":"grid flex-1 min-h-0 min-w-0 grid-cols-1 grid-rows-[minmax(0,1fr)_minmax(0,2fr)] md:grid-cols-[minmax(0,2fr)_minmax(0,3fr)] md:grid-rows-1"),"svelte-1yy464i")),o(t,a)};let O=D(P,"repoPath",7,""),ae=D(P,"repositoryKey",7),me=D(P,"githubUrl",7,null),ie=D(P,"projectType",7,void 0),le=D(P,"repoConfigScript",7,null),C=D(P,"value",15,""),fe=D(P,"expanded",15,!1),ge=D(P,"scriptName",31,()=>rt(u.workspace_setupScriptEditor_custom_name())),ce=D(P,"scriptNameSource",15,"named"),xe=D(P,"isCustomScript",15,!1),be=D(P,"compact",7,!1),Le=D(P,"triggerClass",7,""),Me=D(P,"contentOnly",7,!1),je=D(P,"contentClass",7,""),he=D(P,"presentation",7,"editor"),de=D(P,"onchange",7),J=K(!1),ke=K(rt(mt(()=>xe()))),$e=K(!1),Ie=K(!1),Ye=K(void 0),pe=K(void 0),s=K(""),v=K(!1),E=K(rt(ge())),q=K(rt(ce())),se=K(!1);const B="last-used",G=z(()=>{const t=ae()??O(),a=t?gr(t,me()):void 0;return a?.nameSource==="repo-config"?{...a,name:"Custom",nameSource:"custom"}:a}),Q=z(()=>{const t=new Map;return le()&&t.set(qe,{content:le(),label:it,source:"repo-config"}),e(G)&&t.set(B,{content:e(G).content,label:e(G).name,source:e(G).nameSource}),et.forEach(a=>{t.set(`template-${a.id}`,{content:fr(a),label:a.name,source:"named"})}),t});let Se=K(!0);const ze=z(()=>{if(e(v))return tt(e(E),e(q));if(!e(s))return u.workspace_setupScriptEditor_custom_name();const t=e(Q).get(e(s));return t?tt(t.label,t.source):u.workspace_setupScriptEditor_custom_name()});function ye(t){r(s,t,!0),r(v,!1),r(se,!0);const a=e(Q).get(t);a&&(C(a.content),r(E,a.label,!0),r(q,a.source,!0),de()?.(C())),he()==="picker"?(r(ke,!1),r($e,!1),requestAnimationFrame(()=>e(Ye)?.querySelector("[data-setup-source][aria-pressed=true]")?.focus())):requestAnimationFrame(()=>e(pe)?.focus())}function lt(t){if(e(s)&&e(s)!=="none"){const a=e(Q).get(e(s));a&&r(v,t!==a.content)}else t&&r(v,!0)}const Pe=(()=>{const t=et.find(a=>a.id==="generic");return t?`template-${t.id}`:""})(),st=z(()=>e(v)||!e(s)?"custom":e(s)),Je=z(()=>{const t=[];le()&&t.push({id:qe,name:tt(it,"repo-config")}),e(G)&&t.push({id:B,name:u.workspace_setupScriptEditor_lastUsed_label()});for(const a of et){const w=`template-${a.id}`;(w===Pe||w===e(s))&&t.push({id:w,name:a.name})}return t.push({id:"custom",name:u.workspace_setupScriptPicker_custom_label()}),t}),ct=z(()=>et.filter(t=>!e(Je).some(a=>a.id===`template-${t.id}`)));function Lt(){r(s,""),r(v,!0),r(E,"Custom"),r(q,"custom"),r(J,!1),r(ke,!0),requestAnimationFrame(()=>e(pe)?.focus())}function Mt(t){r(se,!0),r(s,""),C(t.content),r(E,t.name,!0),r(q,"named"),r(v,!0),de()?.(C()),r(J,!1),requestAnimationFrame(()=>e(pe)?.focus())}let dt=K(null);ft(()=>{const t=ae()??O();if(t===e(dt))return;const a=e(dt)===null&&(xe()||C().trim().length>0);if(r(dt,t,!0),a){mt(()=>{let T=!1;const h=C().trim();for(const[$,_]of e(Q).entries())if(h===_.content.trim()&&_.source===ce()&&_.label===ge()){r(s,$,!0),r(E,_.label,!0),r(q,_.source,!0),r(v,!1),T=!0;break}T||(r(v,!0),e(E)||(r(E,ge()||u.workspace_setupScriptEditor_custom_name(),!0),r(q,ge()?ce():"named",!0))),r(se,!0)});return}const w=!!le(),j=e(G);if(mt(()=>{if(r(v,!1),r(se,!0),w)r(s,qe,!0),r(E,it,!0),r(q,"repo-config");else if(j)r(s,B),r(E,j.name,!0),r(q,j.nameSource,!0);else if(Pe){r(s,Pe,!0);const T=e(Q).get(Pe);r(E,T?.label||u.workspace_setupScriptEditor_custom_name(),!0),r(q,"named")}else r(E,u.workspace_setupScriptEditor_custom_name(),!0),r(q,"named")}),w&&le())C(le()),de()?.(C());else if(j)C(j.content),de()?.(C());else if(Pe){const T=e(Q).get(Pe);T&&(C(T.content),de()?.(C()))}}),ft(()=>{if(e(se)){r(se,!1);return}C()!==void 0&&lt(C())}),ft(()=>{ge(e(E)),ce(e(q)),xe(e(v))});var zt={get repoPath(){return O()},set repoPath(t=""){O(t),R()},get repositoryKey(){return ae()},set repositoryKey(t){ae(t),R()},get githubUrl(){return me()},set githubUrl(t=null){me(t),R()},get projectType(){return ie()},set projectType(t=void 0){ie(t),R()},get repoConfigScript(){return le()},set repoConfigScript(t=null){le(t),R()},get value(){return C()},set value(t=""){C(t),R()},get expanded(){return fe()},set expanded(t=!1){fe(t),R()},get scriptName(){return ge()},set scriptName(t=u.workspace_setupScriptEditor_custom_name()){ge(t),R()},get scriptNameSource(){return ce()},set scriptNameSource(t="named"){ce(t),R()},get isCustomScript(){return xe()},set isCustomScript(t=!1){xe(t),R()},get compact(){return be()},set compact(t=!1){be(t),R()},get triggerClass(){return Le()},set triggerClass(t=""){Le(t),R()},get contentOnly(){return Me()},set contentOnly(t=!1){Me(t),R()},get contentClass(){return je()},set contentClass(t=""){je(t),R()},get presentation(){return he()},set presentation(t="editor"){he(t),R()},get onchange(){return de()},set onchange(t){de(t),R()},$set:Ft,$on:(t,a)=>Dt(P,t,a)},yt=Ue(),Wt=U(yt);{var qt=t=>{var a=Ue(),w=U(a);{var j=T=>{var h=Ue(),$=U(h);{var _=x=>{var k=Ke(),L=c(k);Ae(L),l(k),g(()=>Oe(k,1,`${je()??""} min-w-0`,"svelte-1yy464i")),o(x,k)},i=x=>{var k=Ke(),L=c(k);Ge(L),l(k),g(()=>Oe(k,1,`${je()??""} flex min-h-0 min-w-0 flex-1 flex-col`,"svelte-1yy464i")),o(x,k)},f=x=>{var k=Ke(),L=c(k);Ge(L),l(k),g(()=>Oe(k,1,`${je()??""} flex flex-col gap-3 flex-1 min-h-0 min-w-0`,"svelte-1yy464i")),Fe(3,k,()=>Ze,()=>({tier:"moderate"})),o(x,k)};W($,x=>{he()==="picker"?x(_):he()==="workspace"?x(i,1):x(f,-1)})}o(T,h)};W(w,T=>{fe()&&T(j)})}o(t,a)},Kt=t=>{var a=qr(),w=U(a),j=c(w);we(j,{variant:"ghost",size:"sm",get class(){return`whitespace-nowrap hover:text-inherit! ${Le()??""}`},onclick:()=>fe(!fe()),children:(i,f)=>{var x=Mr(),k=U(x);Te(k,{get icon(){return bt},size:"xs"});var L=n(k,2),ue=S(L,!0),ve=n(L,2),I=S(ve,!0);g(F=>{m(ue,F),m(I,e(ze))},[()=>u.workspace_setupScriptEditor_setupScript_label()]),o(i,x)},$$slots:{default:!0}});var T=n(j,2);{var h=i=>{var f=zr(),x=c(f);Ge(x),l(f),Fe(3,f,()=>Ze,()=>({tier:"moderate"})),o(i,f)};W(T,i=>{fe()&&!be()&&i(h)})}l(w);var $=n(w,2);{var _=i=>{var f=Wr(),x=c(f);Ge(x),l(f),Fe(3,f,()=>Ze,()=>({tier:"moderate"})),o(i,f)};W($,i=>{fe()&&be()&&i(_)})}g(()=>Oe(w,1,gt(be()?"":"w-full"))),o(t,a)};W(Wt,t=>{Me()?t(qt):t(Kt,-1)})}return o(He,yt),Gt(zt)}rr(["keydown"]);export{Kr as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/Fb6bTqJy.js","/app/immutable/chunks/BJpbRkma.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/DsvlGcLM.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/DIh4SQwA.js","/app/immutable/chunks/CNdlzZOD.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/DrH3w3jB.js","/app/immutable/chunks/1JDc8gDP.js","/app/immutable/chunks/C6LN2Lq-.js"])))=>i.map(i=>d[i]);
2
- import{t as Xt,bq as Q,a_ as T,by as Jt,bu as D,bs as Nt,b as Yt,bo as i,_ as Gt}from"./CNdlzZOD.js";import{bs as Qt,ca as A,bH as z,c5 as ft,aD as Z,bj as Zt,a5 as F,bS as p,bA as C,b_ as y,W as h,bn as te,cd as tt,bV as _t,c9 as ee,aA as et,bl as q,bO as k,ay as vt,aB as w}from"./DYhIMPy1.js";import{v as xt,w as re}from"./9iFKJfkz.js";import{b as se}from"./BaIAhI85.js";import{b as ae}from"./4xlJdO9z.js";import{Ig as u,BT as ne,BJ as ie,BI as oe,Ia as le,Bu as ce,ik as ue,iK as de}from"./BJpbRkma.js";import{a as pe,T as me,D as fe,L as _e,o as ve}from"./Ou2B083h.js";import{F as rt,cY as xe,c5 as ge,cU as he}from"./BIfN-lxi.js";import{f as gt}from"./DwkxcWNI.js";import{k as J}from"./YcWsBw0J.js";import"./DIh4SQwA.js";import"./ChTqQfQN.js";import"./CqnfptVg.js";import{r as be}from"./9taqgPH1.js";import{selectScriptById as st,selectScriptRuntime as ye,selectScriptOutput as ht,selectScriptRetainedOutput as ke,selectCanDeleteScript as bt}from"./ffjPpoAP.js";import{g as we}from"./DhJNH_hq.js";import{bR as Se,dJ as $e,dj as yt}from"./BsesepNZ.js";import"./OhUwMaQy.js";import"./Co3V5w5D.js";import"./D8iLOeUT.js";import{c as Ae}from"./7rjdCDDK.js";import{H as kt}from"./D7NWkz7l.js";var wt=w("<!> ",1),Fe=w('<div class="bg-danger-background/20 border-y border-danger/20 px-3 py-1.5 flex items-center justify-between"><div class="flex items-center gap-2 text-sm text-danger font-medium"><div class="w-4 h-4 rounded-full bg-danger-background flex items-center justify-center"><!></div> <span> </span></div> <!></div>'),Ce=w('<pre class="retained-text px-3 pb-3 text-xs svelte-115p4sl"> </pre>'),Oe=w('<p class="px-3 pb-3 text-xs text-muted-foreground" role="status"> </p>'),Ie=w('<details class="retained-output border-b border-border svelte-115p4sl"><summary class="cursor-pointer px-3 py-2 text-xs text-muted-foreground"> </summary> <p class="px-3 pb-2 text-xs text-muted-foreground"> </p> <!></details>'),Re=w('<div class="px-3 py-1 text-xs text-muted-foreground"> </div>'),Le=w('<code class="text-muted-foreground font-mono text-xs"> </code>'),Be=w('<div class="flex-1 flex items-center justify-center px-4 py-8"><div class="flex items-center gap-3 text-sm"><span class="text-subtle font-mono">$</span> <!> <!></div></div>'),Te=w('<div><!> <!> <!> <!> <div><div class="xterm-output svelte-115p4sl"></div></div></div>');function De(_,m){if(new.target)return Xt({component:De,..._});Qt(m,!0);const H=()=>D(Lt,"$outputAuthority",O),o=()=>D(Ft,"$runtime$",O),v=()=>D(Ct,"$output$",O),E=()=>D(Rt,"$codeFontFamilyCSS",O),f=()=>D(Ot,"$retainedOutput$",O),St=()=>D(It,"$hidesAgentLifecycleActions$",O),at=()=>D(At,"$script$",O),[O,$t]=Nt();let S=Q(m,"scriptId",7),x=Q(m,"workspaceId",7),N=Q(m,"class",7,"");const I=tt(""),M=tt(""),nt=tt("");let Y=_t(!1);A(()=>I.set(x())),A(()=>M.set(S()));let R,n=null,P=null,K=null,U=null,L=null,W=null;const At=st(I,M),Ft=ye(I,M),Ct=ht(I,M),Ot=ke(I,M,nt),It=Se(I),Rt=we(),Lt=$e(I),it=crypto.randomUUID();A(()=>{const t=x();return S(),()=>{t&&u.dispatch(ne(t,it))}}),A(()=>{const t=x(),e=S(),s=H(),r=o();if(!s||!t||!e)return;r.status,r.startedAt;const l=crypto.randomUUID();return nt.set(l),z(Y,ft(()=>v().chunks.length===0),!0),u.dispatch(ie(t,e,l)),()=>u.dispatch(oe(t,e,l))});let V=_t(0);const Bt=ee(()=>o().status==="exited"&&o().exitCode!=null&&o().exitCode!==0&&o().exitCode<128);function Tt(){if(!R||n)return;U=new me(R);const t=U.getCurrentTheme();n=new fe({allowProposedApi:!0,fontFamily:E(),fontSize:13,lineHeight:1.2,letterSpacing:0,cursorBlink:!1,cursorStyle:"underline",cursorWidth:1,scrollback:1e4,allowTransparency:!0,convertEol:!0,disableStdin:!0,drawBoldTextInBrightColors:!0,theme:t}),n.attachCustomKeyEventHandler(s=>{const r=s.metaKey||s.ctrlKey;return!(r&&s.key==="`"||r&&s.key==="j"||r&&s.key==="k")}),P=new ve,n.loadAddon(P);const e=new _e((s,r)=>{try{const l=new URL(r);l.hostname==="localhost"||l.hostname==="127.0.0.1"?be(r).then(b=>{Gt(async()=>{const{getPanelLayoutManager:c}=await import("./Fb6bTqJy.js").then(g=>g.p);return{getPanelLayoutManager:c}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url).then(({getPanelLayoutManager:c})=>{c(x()).openBrowserPanel(b.url,void 0,void 0,b.requestedUrl)}).catch(()=>{window.open(b.url,"_blank")})}):window.open(r,"_blank")}catch{window.open(r,"_blank")}});n.loadAddon(e),n.open(R),U.applyTheme(n),W=requestAnimationFrame(()=>{W=null,P?.fit()}),K=new ResizeObserver(()=>{P?.fit()}),K.observe(R),Dt()}function Dt(){if(!n)return;const t=ht.select(u.state,x(),S());t.chunks.length>0&&n.write(t.chunks.map(e=>e.text).join("")),z(V,t.dropped+t.chunks.length)}function ot(){L!==null&&(cancelAnimationFrame(L),L=null),W!==null&&(cancelAnimationFrame(W),W=null),K?.disconnect(),K=null,U?.dispose(),U=null;const t=n;n=null,P=null,z(V,0),t&&pe(t)}A(()=>{const t=v(),e=ft(()=>Z(V)),s=t.dropped+t.chunks.length;if(!n||s<=e)return;const r=Math.max(e-t.dropped,0);n.write(t.chunks.slice(r).map(l=>l.text).join("")),z(V,s)}),A(()=>{const t=E();n&&n.options.fontFamily!==t&&(n.options.fontFamily=t)});function qt(){u.dispatch(le(x(),S()))}function Et(){if(!x()){J.error(i.terminal_scriptOutput_noWorkspace_error());return}u.dispatch(ue(x(),S(),f()?.text,it))}A(()=>{o().status==="idle"&&v().chunks.length===0&&ot()}),A(()=>{!(o().status==="idle"&&v().chunks.length===0)&&R&&!n&&(L!==null&&cancelAnimationFrame(L),L=requestAnimationFrame(()=>{L=null,Tt()}))}),Zt(()=>{ot()});var jt={get scriptId(){return S()},set scriptId(t){S(t),et()},get workspaceId(){return x()},set workspaceId(t){x(t),et()},get class(){return N()},set class(t=""){N(t),et()},$set:Jt,$on:(t,e)=>Yt(m,t,e)},X=Te(),lt=F(X);{var Mt=t=>{var e=Fe(),s=F(e),r=F(s),l=F(r);rt(l,{get icon(){return xe},size:"xs"}),C(r);var b=p(r,2),c=q(b,!0);C(s);var g=p(s,2);{var $=a=>{gt(a,{variant:"outline",size:"sm",class:"h-7 text-xs bg-background border border-border text-danger",onclick:Et,children:(d,B)=>{var j=wt(),mt=vt(j);rt(mt,{get icon(){return he},size:"sm",class:"mr-1.5"});var Kt=p(mt);y(Vt=>k(Kt,` ${Vt??""}`),[()=>i.terminal_scriptOutput_askAiToFix_label()]),h(d,j)},$$slots:{default:!0}})};T(g,a=>{St()||a($)})}C(e),y(a=>k(c,a),[()=>i.terminal_scriptOutput_buildFailed_label({exitCode:o().exitCode??0})]),h(t,e)};T(lt,t=>{Z(Bt)&&t(Mt)})}var ct=p(lt,2);{var Pt=t=>{var e=Ie(),s=F(e),r=q(s,!0),l=p(s,2),b=q(l,!0),c=p(l,2);{var g=a=>{var d=Ce();let B;var j=q(d,!0);y(()=>{B=re(d,"",B,{"font-family":E()}),k(j,f().text)}),h(a,d)},$=a=>{var d=Oe(),B=q(d,!0);y(j=>k(B,j),[()=>f().status==="loading"?i.terminal_scriptOutput_retainedLoading_label():i.terminal_scriptOutput_retainedUnavailable_label()]),h(a,d)};T(c,a=>{f().status==="available"?a(g):a($,-1)})}C(e),y((a,d)=>{k(r,a),k(b,d)},[()=>i.terminal_scriptOutput_retained_label(),()=>i.terminal_scriptOutput_retained_description()]),ae("open","toggle",e,a=>z(Y,a),()=>Z(Y)),h(t,e)};T(ct,t=>{f()&&t(Pt)})}var ut=p(ct,2);{var Ut=t=>{var e=Re(),s=q(e,!0);y(r=>k(s,r),[()=>i.terminal_scriptOutput_live_label()]),h(t,e)};T(ut,t=>{v().chunks.length>0&&f()&&t(Ut)})}var dt=p(ut,2);{var Wt=t=>{var e=Be(),s=F(e),r=p(F(s),2);{var l=c=>{var g=Le(),$=q(g,!0);y(a=>k($,a),[()=>ce(at())]),h(c,g)};T(r,c=>{at()&&c(l)})}var b=p(r,2);gt(b,{variant:"ghost",size:"xs",onclick:qt,class:"text-muted-foreground hover:text-foreground",children:(c,g)=>{var $=wt(),a=vt($);rt(a,{get icon(){return ge},class:"h-3 w-3 mr-1"});var d=p(a);y(B=>k(d,` ${B??""}`),[()=>i.terminal_scriptOutput_run_label()]),h(c,$)},$$slots:{default:!0}}),C(s),C(e),h(t,e)};T(dt,t=>{o().status==="idle"&&v().chunks.length===0&&t(Wt)})}var G=p(dt,2);let pt;var zt=F(G);se(zt,t=>R=t,()=>R),C(G),C(X),y(()=>{xt(X,1,`script-output-viewer ${N()??""}`,"svelte-115p4sl"),pt=xt(G,1,"flex-1 relative overflow-hidden",null,pt,{hidden:o().status==="idle"&&v().chunks.length===0})}),h(_,X);var Ht=te(jt);return $t(),Ht}async function ar(_,m,H){const o=st.select(u.state,_,m);if(!o||!H()||!bt.select(u.state,_,m))return;const v=kt(o.runtime?.status),E=yt.select(u.state,_);if(!E){J.error(i.workspace_client_accessChanged_error());return}if(!await Ae({title:i.scripts_delete_title({name:o.name}),description:v?i.scripts_delete_running_description():i.scripts_delete_description(),confirmLabel:i.scripts_delete_label(),destructive:!0}))return;if(E!==yt.select(u.state,_)){J.error(i.workspace_client_accessChanged_error());return}const f=st.select(u.state,_,m);if(!H()||!f||f.createdAt!==o.createdAt||f.name!==o.name||!v&&kt(f.runtime?.status)||!bt.select(u.state,_,m)){J.error(i.scripts_delete_changed_error());return}u.dispatch(de(_,m,i.terminal_quakeOverlay_deleteScriptFailed_error()))}export{De as S,ar as c};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/DVEpt846.js","/app/immutable/chunks/BoIGV7s7.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/D1Wd8yWC.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/DIh4SQwA.js","/app/immutable/chunks/CNdlzZOD.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/DrH3w3jB.js","/app/immutable/chunks/evMM8bqV.js","/app/immutable/chunks/Bv_0taxh.js"])))=>i.map(i=>d[i]);
2
+ import{t as Xt,bq as Q,a_ as T,by as Jt,bu as D,bs as Nt,b as Yt,bo as i,_ as Gt}from"./CNdlzZOD.js";import{bs as Qt,ca as A,bH as z,c5 as ft,aD as Z,bj as Zt,a5 as F,bS as p,bA as C,b_ as y,W as h,bn as te,cd as tt,bV as _t,c9 as ee,aA as et,bl as q,bO as k,ay as vt,aB as w}from"./DYhIMPy1.js";import{v as xt,w as re}from"./9iFKJfkz.js";import{b as se}from"./BaIAhI85.js";import{b as ae}from"./4xlJdO9z.js";import{Ig as u,BT as ne,BJ as ie,BI as oe,Ia as le,Bu as ce,ik as ue,iK as de}from"./BoIGV7s7.js";import{a as pe,T as me,D as fe,L as _e,o as ve}from"./9xAB6iEw.js";import{F as rt,cY as xe,c5 as ge,cU as he}from"./BIfN-lxi.js";import{f as gt}from"./D3glRUn0.js";import{k as J}from"./DhFS-yhc.js";import"./DIh4SQwA.js";import"./ChTqQfQN.js";import"./BOR1_TRO.js";import{r as be}from"./DnkVLfZ3.js";import{selectScriptById as st,selectScriptRuntime as ye,selectScriptOutput as ht,selectScriptRetainedOutput as ke,selectCanDeleteScript as bt}from"./D9fDSLwb.js";import{g as we}from"./C9ruBEtx.js";import{bR as Se,dJ as $e,dj as yt}from"./De3HYtL6.js";import"./OhUwMaQy.js";import"./Co3V5w5D.js";import"./D8iLOeUT.js";import{c as Ae}from"./B0J8YEPJ.js";import{H as kt}from"./BL9TmjaL.js";var wt=w("<!> ",1),Fe=w('<div class="bg-danger-background/20 border-y border-danger/20 px-3 py-1.5 flex items-center justify-between"><div class="flex items-center gap-2 text-sm text-danger font-medium"><div class="w-4 h-4 rounded-full bg-danger-background flex items-center justify-center"><!></div> <span> </span></div> <!></div>'),Ce=w('<pre class="retained-text px-3 pb-3 text-xs svelte-115p4sl"> </pre>'),Oe=w('<p class="px-3 pb-3 text-xs text-muted-foreground" role="status"> </p>'),Ie=w('<details class="retained-output border-b border-border svelte-115p4sl"><summary class="cursor-pointer px-3 py-2 text-xs text-muted-foreground"> </summary> <p class="px-3 pb-2 text-xs text-muted-foreground"> </p> <!></details>'),Re=w('<div class="px-3 py-1 text-xs text-muted-foreground"> </div>'),Le=w('<code class="text-muted-foreground font-mono text-xs"> </code>'),Be=w('<div class="flex-1 flex items-center justify-center px-4 py-8"><div class="flex items-center gap-3 text-sm"><span class="text-subtle font-mono">$</span> <!> <!></div></div>'),Te=w('<div><!> <!> <!> <!> <div><div class="xterm-output svelte-115p4sl"></div></div></div>');function De(_,m){if(new.target)return Xt({component:De,..._});Qt(m,!0);const H=()=>D(Lt,"$outputAuthority",O),o=()=>D(Ft,"$runtime$",O),v=()=>D(Ct,"$output$",O),E=()=>D(Rt,"$codeFontFamilyCSS",O),f=()=>D(Ot,"$retainedOutput$",O),St=()=>D(It,"$hidesAgentLifecycleActions$",O),at=()=>D(At,"$script$",O),[O,$t]=Nt();let S=Q(m,"scriptId",7),x=Q(m,"workspaceId",7),N=Q(m,"class",7,"");const I=tt(""),M=tt(""),nt=tt("");let Y=_t(!1);A(()=>I.set(x())),A(()=>M.set(S()));let R,n=null,P=null,K=null,U=null,L=null,W=null;const At=st(I,M),Ft=ye(I,M),Ct=ht(I,M),Ot=ke(I,M,nt),It=Se(I),Rt=we(),Lt=$e(I),it=crypto.randomUUID();A(()=>{const t=x();return S(),()=>{t&&u.dispatch(ne(t,it))}}),A(()=>{const t=x(),e=S(),s=H(),r=o();if(!s||!t||!e)return;r.status,r.startedAt;const l=crypto.randomUUID();return nt.set(l),z(Y,ft(()=>v().chunks.length===0),!0),u.dispatch(ie(t,e,l)),()=>u.dispatch(oe(t,e,l))});let V=_t(0);const Bt=ee(()=>o().status==="exited"&&o().exitCode!=null&&o().exitCode!==0&&o().exitCode<128);function Tt(){if(!R||n)return;U=new me(R);const t=U.getCurrentTheme();n=new fe({allowProposedApi:!0,fontFamily:E(),fontSize:13,lineHeight:1.2,letterSpacing:0,cursorBlink:!1,cursorStyle:"underline",cursorWidth:1,scrollback:1e4,allowTransparency:!0,convertEol:!0,disableStdin:!0,drawBoldTextInBrightColors:!0,theme:t}),n.attachCustomKeyEventHandler(s=>{const r=s.metaKey||s.ctrlKey;return!(r&&s.key==="`"||r&&s.key==="j"||r&&s.key==="k")}),P=new ve,n.loadAddon(P);const e=new _e((s,r)=>{try{const l=new URL(r);l.hostname==="localhost"||l.hostname==="127.0.0.1"?be(r).then(b=>{Gt(async()=>{const{getPanelLayoutManager:c}=await import("./DVEpt846.js").then(g=>g.p);return{getPanelLayoutManager:c}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url).then(({getPanelLayoutManager:c})=>{c(x()).openBrowserPanel(b.url,void 0,void 0,b.requestedUrl)}).catch(()=>{window.open(b.url,"_blank")})}):window.open(r,"_blank")}catch{window.open(r,"_blank")}});n.loadAddon(e),n.open(R),U.applyTheme(n),W=requestAnimationFrame(()=>{W=null,P?.fit()}),K=new ResizeObserver(()=>{P?.fit()}),K.observe(R),Dt()}function Dt(){if(!n)return;const t=ht.select(u.state,x(),S());t.chunks.length>0&&n.write(t.chunks.map(e=>e.text).join("")),z(V,t.dropped+t.chunks.length)}function ot(){L!==null&&(cancelAnimationFrame(L),L=null),W!==null&&(cancelAnimationFrame(W),W=null),K?.disconnect(),K=null,U?.dispose(),U=null;const t=n;n=null,P=null,z(V,0),t&&pe(t)}A(()=>{const t=v(),e=ft(()=>Z(V)),s=t.dropped+t.chunks.length;if(!n||s<=e)return;const r=Math.max(e-t.dropped,0);n.write(t.chunks.slice(r).map(l=>l.text).join("")),z(V,s)}),A(()=>{const t=E();n&&n.options.fontFamily!==t&&(n.options.fontFamily=t)});function qt(){u.dispatch(le(x(),S()))}function Et(){if(!x()){J.error(i.terminal_scriptOutput_noWorkspace_error());return}u.dispatch(ue(x(),S(),f()?.text,it))}A(()=>{o().status==="idle"&&v().chunks.length===0&&ot()}),A(()=>{!(o().status==="idle"&&v().chunks.length===0)&&R&&!n&&(L!==null&&cancelAnimationFrame(L),L=requestAnimationFrame(()=>{L=null,Tt()}))}),Zt(()=>{ot()});var jt={get scriptId(){return S()},set scriptId(t){S(t),et()},get workspaceId(){return x()},set workspaceId(t){x(t),et()},get class(){return N()},set class(t=""){N(t),et()},$set:Jt,$on:(t,e)=>Yt(m,t,e)},X=Te(),lt=F(X);{var Mt=t=>{var e=Fe(),s=F(e),r=F(s),l=F(r);rt(l,{get icon(){return xe},size:"xs"}),C(r);var b=p(r,2),c=q(b,!0);C(s);var g=p(s,2);{var $=a=>{gt(a,{variant:"outline",size:"sm",class:"h-7 text-xs bg-background border border-border text-danger",onclick:Et,children:(d,B)=>{var j=wt(),mt=vt(j);rt(mt,{get icon(){return he},size:"sm",class:"mr-1.5"});var Kt=p(mt);y(Vt=>k(Kt,` ${Vt??""}`),[()=>i.terminal_scriptOutput_askAiToFix_label()]),h(d,j)},$$slots:{default:!0}})};T(g,a=>{St()||a($)})}C(e),y(a=>k(c,a),[()=>i.terminal_scriptOutput_buildFailed_label({exitCode:o().exitCode??0})]),h(t,e)};T(lt,t=>{Z(Bt)&&t(Mt)})}var ct=p(lt,2);{var Pt=t=>{var e=Ie(),s=F(e),r=q(s,!0),l=p(s,2),b=q(l,!0),c=p(l,2);{var g=a=>{var d=Ce();let B;var j=q(d,!0);y(()=>{B=re(d,"",B,{"font-family":E()}),k(j,f().text)}),h(a,d)},$=a=>{var d=Oe(),B=q(d,!0);y(j=>k(B,j),[()=>f().status==="loading"?i.terminal_scriptOutput_retainedLoading_label():i.terminal_scriptOutput_retainedUnavailable_label()]),h(a,d)};T(c,a=>{f().status==="available"?a(g):a($,-1)})}C(e),y((a,d)=>{k(r,a),k(b,d)},[()=>i.terminal_scriptOutput_retained_label(),()=>i.terminal_scriptOutput_retained_description()]),ae("open","toggle",e,a=>z(Y,a),()=>Z(Y)),h(t,e)};T(ct,t=>{f()&&t(Pt)})}var ut=p(ct,2);{var Ut=t=>{var e=Re(),s=q(e,!0);y(r=>k(s,r),[()=>i.terminal_scriptOutput_live_label()]),h(t,e)};T(ut,t=>{v().chunks.length>0&&f()&&t(Ut)})}var dt=p(ut,2);{var Wt=t=>{var e=Be(),s=F(e),r=p(F(s),2);{var l=c=>{var g=Le(),$=q(g,!0);y(a=>k($,a),[()=>ce(at())]),h(c,g)};T(r,c=>{at()&&c(l)})}var b=p(r,2);gt(b,{variant:"ghost",size:"xs",onclick:qt,class:"text-muted-foreground hover:text-foreground",children:(c,g)=>{var $=wt(),a=vt($);rt(a,{get icon(){return ge},class:"h-3 w-3 mr-1"});var d=p(a);y(B=>k(d,` ${B??""}`),[()=>i.terminal_scriptOutput_run_label()]),h(c,$)},$$slots:{default:!0}}),C(s),C(e),h(t,e)};T(dt,t=>{o().status==="idle"&&v().chunks.length===0&&t(Wt)})}var G=p(dt,2);let pt;var zt=F(G);se(zt,t=>R=t,()=>R),C(G),C(X),y(()=>{xt(X,1,`script-output-viewer ${N()??""}`,"svelte-115p4sl"),pt=xt(G,1,"flex-1 relative overflow-hidden",null,pt,{hidden:o().status==="idle"&&v().chunks.length===0})}),h(_,X);var Ht=te(jt);return $t(),Ht}async function ar(_,m,H){const o=st.select(u.state,_,m);if(!o||!H()||!bt.select(u.state,_,m))return;const v=kt(o.runtime?.status),E=yt.select(u.state,_);if(!E){J.error(i.workspace_client_accessChanged_error());return}if(!await Ae({title:i.scripts_delete_title({name:o.name}),description:v?i.scripts_delete_running_description():i.scripts_delete_description(),confirmLabel:i.scripts_delete_label(),destructive:!0}))return;if(E!==yt.select(u.state,_)){J.error(i.workspace_client_accessChanged_error());return}const f=st.select(u.state,_,m);if(!H()||!f||f.createdAt!==o.createdAt||f.name!==o.name||!v&&kt(f.runtime?.status)||!bt.select(u.state,_,m)){J.error(i.scripts_delete_changed_error());return}u.dispatch(de(_,m,i.terminal_quakeOverlay_deleteScriptFailed_error()))}export{De as S,ar as c};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/DF5OSHTI.js","/app/immutable/chunks/BvFAWM27.js","/app/immutable/chunks/BJzHxIyr.js","/app/immutable/chunks/D-YrUZis.js","/app/immutable/chunks/CNdlzZOD.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/BJpbRkma.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/DsvlGcLM.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/DIh4SQwA.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/DrH3w3jB.js","/app/immutable/chunks/DwkxcWNI.js","/app/immutable/chunks/9iFKJfkz.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/BaIAhI85.js","/app/immutable/chunks/b0njYmMP.js","/app/immutable/chunks/CrN8CpnY.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/Gh0Bk6WC.js","/app/immutable/chunks/DVe2mCXY.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/C6LN2Lq-.js","/app/immutable/chunks/BsesepNZ.js","/app/immutable/chunks/BIfN-lxi.js","/app/immutable/chunks/DhJNH_hq.js","/app/immutable/chunks/HVSUZ4Kq.js","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/C4ih-xND.js","/app/immutable/chunks/B1nmZwVF.js"])))=>i.map(i=>d[i]);
2
- import{bo as c,_ as p}from"./CNdlzZOD.js";import{k as I}from"./YcWsBw0J.js";import"./DYhIMPy1.js";import"./9iFKJfkz.js";import"./DIh4SQwA.js";import{bx as A}from"./DwkxcWNI.js";import"./ChTqQfQN.js";import"./CqnfptVg.js";import{g as R,Ig as d,uR as g,uT as y}from"./BJpbRkma.js";import{a0 as L}from"./BsesepNZ.js";import{l as v}from"./1JDc8gDP.js";const F="intent://local/note/{note-id}",S="intent://local/{workspace-id}/note/{note-id}";function f(){return c.ui_linkHandler_invalidFormat_error({shortFormat:F,longFormat:S})}class u extends Error{constructor(r){super(r),this.name="NotFoundError"}}function W(e){try{const r=new URL(e.replace("intent://","http://")),t=r.hostname,n=r.pathname.replace(/^\/+/,"").split("/").filter(l=>l.length>0),a=e.replace("intent://","").split(/[?#]/)[0].split("/").slice(1);if(!t||n.length<2)return{type:"unknown",orgId:t||"",resourceId:"",valid:!1,error:f()};let o,s,i,_,w;if(a[0]==="workspace"&&(a.length===2||a.length===3&&a[2]==="")){const l=T(a[1]);if(!l)return{type:"unknown",orgId:t,resourceId:"",valid:!1,error:f()};o=l,s="workspace",i=l}else if(a[0]==="file")s="file",i=h(a.slice(1));else if(a.length>=3&&k(a[0])&&a[1]==="file")o=a[0],s="file",i=h(a.slice(2));else if(a.length===5&&a[1]==="agent"&&a[3]==="message"&&k(a[0])&&k(a[2])&&k(a[4])&&n.length===5&&n[1]==="agent"&&n[3]==="message")o=n[0],s="message",_=n[2],i=n[4];else if(n[0]==="note"||n[0]==="task")s=n[0],i=n[1];else if(n.length>=3&&(n[1]==="note"||n[1]==="task"))o=n[0],s=n[1],i=n[2];else return{type:"unknown",orgId:t,resourceId:"",valid:!1,error:f()};if(!i||i.trim().length===0)return{type:"unknown",orgId:t,resourceId:"",valid:!1,error:c.ui_linkHandler_emptyResourceId_error()};if(s==="note"||s==="task")return{type:s,orgId:t,workspaceId:o,resourceId:i,valid:!0};if(s==="file"){const l=/^#L\d+(?:-\d+|C\d+)?$/.test(r.hash)?r.hash:"",E=a.slice(o?2:1).join("/"),m=A(E+l);return i=h(m.path.split("/")),w=m.line,H(i)?{type:"file",orgId:t,workspaceId:o,resourceId:i,...w!==void 0?{line:w}:{},valid:!0}:{type:"unknown",orgId:t,workspaceId:o,resourceId:"",valid:!1,error:c.ui_linkHandler_invalidFilePath_error()}}return s==="workspace"&&o?{type:"workspace",orgId:t,workspaceId:o,resourceId:i,valid:!0}:s==="message"&&o&&_?{type:"message",orgId:t,workspaceId:o,resourceId:i,agentId:_,valid:!0}:{type:"unknown",orgId:t,workspaceId:o,resourceId:i,valid:!1,error:c.ui_linkHandler_unknownResourceType_error({type:s})}}catch(r){return{type:"unknown",orgId:"",resourceId:"",valid:!1,error:r instanceof Error?r.message:c.ui_linkHandler_parseFailed_error()}}}function h(e){return e.map(r=>decodeURIComponent(r)).join("/")}function H(e){return/^[A-Za-z]:/.test(e)?!1:e.split(/[\\/]/).every(t=>t.length>0&&t!=="."&&t!=="..")}const j=new Set([R,"new"]);function T(e){if(e===void 0||!k(e))return null;const r=decodeURIComponent(e);return j.has(r)?null:r}function k(e){let r;try{r=decodeURIComponent(e)}catch{return!1}return r.length>0&&r!=="."&&r!==".."&&!/[\\/]/.test(r)}async function O(e,r={}){if(!e.startsWith("intent://"))return!1;const t=W(e);if(!t.valid)return I.error(c.ui_linkHandler_invalidLink_title(),{description:t.error||c.ui_linkHandler_invalidLink_description()}),!0;try{switch(t.type){case"note":case"task":await N(t,r);break;case"file":await b(t,r);break;case"workspace":await C(t.resourceId);break;case"message":{const{openMessage:n}=await p(async()=>{const{openMessage:a}=await import("./DF5OSHTI.js");return{openMessage:a}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32]),import.meta.url);await n({workspaceId:t.workspaceId,agentId:t.agentId,messageId:t.resourceId});break}default:I.error(c.ui_linkHandler_unsupportedLink_title(),{description:c.ui_linkHandler_unsupportedLink_description({type:t.type})})}}catch(n){n instanceof u?I.error(c.ui_linkHandler_notFound_title(),{description:n.message}):I.error(c.ui_linkHandler_navigationFailed_title(),{description:n instanceof Error?n.message:c.ui_linkHandler_unknownError_label()})}return!0}function $(e,r){return L(e,r)}function B(){return async(e,r,t)=>{const a=t.target.closest("a");return a?.href?.startsWith("intent://")?(t.preventDefault(),await O(a.href)):!1}}async function C(e){const{appClient:r}=await p(async()=>{const{appClient:a}=await import("./D-YrUZis.js").then(o=>o.p);return{appClient:a}},__vite__mapDeps([3,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,2,22,23,24,25]),import.meta.url);if(!await r.workspaces.get(e).catch(()=>null))throw new u(c.workspace_loader_notFound_title());const{openAndShowWorkspace:n}=await p(async()=>{const{openAndShowWorkspace:a}=await import("./B1nmZwVF.js").then(o=>o.s);return{openAndShowWorkspace:a}},__vite__mapDeps([32,7,5,6,8,9,10,11,4,12,13,14,31]),import.meta.url);await n(e)}async function N(e,r){const t=r.workspaceId??v.select(d.state)??void 0;if(e.workspaceId){const a=!t||e.workspaceId!==t;if(!await P(e.workspaceId,e.resourceId))throw new u(c.ui_linkHandler_noteNotFound_error({noteId:e.resourceId,workspaceId:e.workspaceId}));if(a){const{openAndShowWorkspace:s}=await p(async()=>{const{openAndShowWorkspace:i}=await import("./B1nmZwVF.js").then(_=>_.s);return{openAndShowWorkspace:i}},__vite__mapDeps([32,7,5,6,8,9,10,11,4,12,13,14,31]),import.meta.url);await s(e.workspaceId,{query:{note:e.resourceId}})}else d.dispatch(y(e.workspaceId,e.resourceId,{openInAdjacentPanel:r.openInAdjacentPanel??!1,openInNewAdjacentPanel:r.openInNewAdjacentPanel??!1,sourcePanelId:r.sourcePanelId}));return}if(!t)throw new u(c.ui_linkHandler_noSpaceOpen_error());if(!await P(t,e.resourceId))throw new u(c.ui_linkHandler_noteNotFoundCurrent_error({noteId:e.resourceId}));d.dispatch(y(t,e.resourceId,{openInAdjacentPanel:r.openInAdjacentPanel??!1,openInNewAdjacentPanel:r.openInNewAdjacentPanel??!1,sourcePanelId:r.sourcePanelId}))}async function b(e,r){const t=r.workspaceId??v.select(d.state)??void 0;if(e.workspaceId){const n=!t||e.workspaceId!==t;if(n){const{openAndShowWorkspace:a}=await p(async()=>{const{openAndShowWorkspace:o}=await import("./B1nmZwVF.js").then(s=>s.s);return{openAndShowWorkspace:o}},__vite__mapDeps([32,7,5,6,8,9,10,11,4,12,13,14,31]),import.meta.url);if(!await a(e.workspaceId))return}d.dispatch(g(e.workspaceId,e.resourceId,{filePathIsLiteral:!0,...e.line!==void 0?{line:e.line}:{},openInAdjacentPanel:n?!1:r.openInAdjacentPanel??!1,sourcePanelId:n?void 0:r.sourcePanelId}));return}if(!t)throw new u(c.ui_linkHandler_noSpaceOpen_error());d.dispatch(g(t,e.resourceId,{filePathIsLiteral:!0,...e.line!==void 0?{line:e.line}:{},openInAdjacentPanel:r.openInAdjacentPanel??!1,sourcePanelId:r.sourcePanelId}))}async function P(e,r){try{const{backendRequest:t}=await p(async()=>{const{backendRequest:o}=await import("./DwkxcWNI.js").then(s=>s.az);return{backendRequest:o}},__vite__mapDeps([15,4,5,11,16,10,17,18,19,14,20,13,21]),import.meta.url),n=await t("note.get",{workspaceId:e,noteId:r}),a=n&&typeof n=="object"&&"note"in n?n.note:n;return a!=null&&typeof a=="object"}catch{return!1}}export{u as NotFoundError,B as createIntentLinkClickHandler,$ as generateNoteLink,O as handleIntentLink,W as parseIntentLink};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/B3GFeWXU.js","/app/immutable/chunks/BvFAWM27.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/Br_KUH7F.js","/app/immutable/chunks/CNdlzZOD.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/BoIGV7s7.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/D1Wd8yWC.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/DIh4SQwA.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/DrH3w3jB.js","/app/immutable/chunks/D3glRUn0.js","/app/immutable/chunks/9iFKJfkz.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/BaIAhI85.js","/app/immutable/chunks/b0njYmMP.js","/app/immutable/chunks/CrN8CpnY.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BBy57-xG.js","/app/immutable/chunks/DVe2mCXY.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/Bv_0taxh.js","/app/immutable/chunks/De3HYtL6.js","/app/immutable/chunks/BIfN-lxi.js","/app/immutable/chunks/C9ruBEtx.js","/app/immutable/chunks/HVSUZ4Kq.js","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/WPm8oU1g.js","/app/immutable/chunks/CBgs1jD4.js"])))=>i.map(i=>d[i]);
2
+ import{bo as c,_ as p}from"./CNdlzZOD.js";import{k as I}from"./DhFS-yhc.js";import"./DYhIMPy1.js";import"./9iFKJfkz.js";import"./DIh4SQwA.js";import{bx as A}from"./D3glRUn0.js";import"./ChTqQfQN.js";import"./BOR1_TRO.js";import{g as R,Ig as d,uR as g,uT as y}from"./BoIGV7s7.js";import{a0 as L}from"./De3HYtL6.js";import{l as v}from"./evMM8bqV.js";const F="intent://local/note/{note-id}",S="intent://local/{workspace-id}/note/{note-id}";function f(){return c.ui_linkHandler_invalidFormat_error({shortFormat:F,longFormat:S})}class u extends Error{constructor(r){super(r),this.name="NotFoundError"}}function W(e){try{const r=new URL(e.replace("intent://","http://")),t=r.hostname,n=r.pathname.replace(/^\/+/,"").split("/").filter(l=>l.length>0),a=e.replace("intent://","").split(/[?#]/)[0].split("/").slice(1);if(!t||n.length<2)return{type:"unknown",orgId:t||"",resourceId:"",valid:!1,error:f()};let o,s,i,_,w;if(a[0]==="workspace"&&(a.length===2||a.length===3&&a[2]==="")){const l=T(a[1]);if(!l)return{type:"unknown",orgId:t,resourceId:"",valid:!1,error:f()};o=l,s="workspace",i=l}else if(a[0]==="file")s="file",i=h(a.slice(1));else if(a.length>=3&&k(a[0])&&a[1]==="file")o=a[0],s="file",i=h(a.slice(2));else if(a.length===5&&a[1]==="agent"&&a[3]==="message"&&k(a[0])&&k(a[2])&&k(a[4])&&n.length===5&&n[1]==="agent"&&n[3]==="message")o=n[0],s="message",_=n[2],i=n[4];else if(n[0]==="note"||n[0]==="task")s=n[0],i=n[1];else if(n.length>=3&&(n[1]==="note"||n[1]==="task"))o=n[0],s=n[1],i=n[2];else return{type:"unknown",orgId:t,resourceId:"",valid:!1,error:f()};if(!i||i.trim().length===0)return{type:"unknown",orgId:t,resourceId:"",valid:!1,error:c.ui_linkHandler_emptyResourceId_error()};if(s==="note"||s==="task")return{type:s,orgId:t,workspaceId:o,resourceId:i,valid:!0};if(s==="file"){const l=/^#L\d+(?:-\d+|C\d+)?$/.test(r.hash)?r.hash:"",E=a.slice(o?2:1).join("/"),m=A(E+l);return i=h(m.path.split("/")),w=m.line,H(i)?{type:"file",orgId:t,workspaceId:o,resourceId:i,...w!==void 0?{line:w}:{},valid:!0}:{type:"unknown",orgId:t,workspaceId:o,resourceId:"",valid:!1,error:c.ui_linkHandler_invalidFilePath_error()}}return s==="workspace"&&o?{type:"workspace",orgId:t,workspaceId:o,resourceId:i,valid:!0}:s==="message"&&o&&_?{type:"message",orgId:t,workspaceId:o,resourceId:i,agentId:_,valid:!0}:{type:"unknown",orgId:t,workspaceId:o,resourceId:i,valid:!1,error:c.ui_linkHandler_unknownResourceType_error({type:s})}}catch(r){return{type:"unknown",orgId:"",resourceId:"",valid:!1,error:r instanceof Error?r.message:c.ui_linkHandler_parseFailed_error()}}}function h(e){return e.map(r=>decodeURIComponent(r)).join("/")}function H(e){return/^[A-Za-z]:/.test(e)?!1:e.split(/[\\/]/).every(t=>t.length>0&&t!=="."&&t!=="..")}const j=new Set([R,"new"]);function T(e){if(e===void 0||!k(e))return null;const r=decodeURIComponent(e);return j.has(r)?null:r}function k(e){let r;try{r=decodeURIComponent(e)}catch{return!1}return r.length>0&&r!=="."&&r!==".."&&!/[\\/]/.test(r)}async function O(e,r={}){if(!e.startsWith("intent://"))return!1;const t=W(e);if(!t.valid)return I.error(c.ui_linkHandler_invalidLink_title(),{description:t.error||c.ui_linkHandler_invalidLink_description()}),!0;try{switch(t.type){case"note":case"task":await N(t,r);break;case"file":await b(t,r);break;case"workspace":await C(t.resourceId);break;case"message":{const{openMessage:n}=await p(async()=>{const{openMessage:a}=await import("./B3GFeWXU.js");return{openMessage:a}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32]),import.meta.url);await n({workspaceId:t.workspaceId,agentId:t.agentId,messageId:t.resourceId});break}default:I.error(c.ui_linkHandler_unsupportedLink_title(),{description:c.ui_linkHandler_unsupportedLink_description({type:t.type})})}}catch(n){n instanceof u?I.error(c.ui_linkHandler_notFound_title(),{description:n.message}):I.error(c.ui_linkHandler_navigationFailed_title(),{description:n instanceof Error?n.message:c.ui_linkHandler_unknownError_label()})}return!0}function $(e,r){return L(e,r)}function B(){return async(e,r,t)=>{const a=t.target.closest("a");return a?.href?.startsWith("intent://")?(t.preventDefault(),await O(a.href)):!1}}async function C(e){const{appClient:r}=await p(async()=>{const{appClient:a}=await import("./Br_KUH7F.js").then(o=>o.p);return{appClient:a}},__vite__mapDeps([3,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,2,22,23,24,25]),import.meta.url);if(!await r.workspaces.get(e).catch(()=>null))throw new u(c.workspace_loader_notFound_title());const{openAndShowWorkspace:n}=await p(async()=>{const{openAndShowWorkspace:a}=await import("./CBgs1jD4.js").then(o=>o.s);return{openAndShowWorkspace:a}},__vite__mapDeps([32,7,5,6,8,9,10,11,4,12,13,14,31]),import.meta.url);await n(e)}async function N(e,r){const t=r.workspaceId??v.select(d.state)??void 0;if(e.workspaceId){const a=!t||e.workspaceId!==t;if(!await P(e.workspaceId,e.resourceId))throw new u(c.ui_linkHandler_noteNotFound_error({noteId:e.resourceId,workspaceId:e.workspaceId}));if(a){const{openAndShowWorkspace:s}=await p(async()=>{const{openAndShowWorkspace:i}=await import("./CBgs1jD4.js").then(_=>_.s);return{openAndShowWorkspace:i}},__vite__mapDeps([32,7,5,6,8,9,10,11,4,12,13,14,31]),import.meta.url);await s(e.workspaceId,{query:{note:e.resourceId}})}else d.dispatch(y(e.workspaceId,e.resourceId,{openInAdjacentPanel:r.openInAdjacentPanel??!1,openInNewAdjacentPanel:r.openInNewAdjacentPanel??!1,sourcePanelId:r.sourcePanelId}));return}if(!t)throw new u(c.ui_linkHandler_noSpaceOpen_error());if(!await P(t,e.resourceId))throw new u(c.ui_linkHandler_noteNotFoundCurrent_error({noteId:e.resourceId}));d.dispatch(y(t,e.resourceId,{openInAdjacentPanel:r.openInAdjacentPanel??!1,openInNewAdjacentPanel:r.openInNewAdjacentPanel??!1,sourcePanelId:r.sourcePanelId}))}async function b(e,r){const t=r.workspaceId??v.select(d.state)??void 0;if(e.workspaceId){const n=!t||e.workspaceId!==t;if(n){const{openAndShowWorkspace:a}=await p(async()=>{const{openAndShowWorkspace:o}=await import("./CBgs1jD4.js").then(s=>s.s);return{openAndShowWorkspace:o}},__vite__mapDeps([32,7,5,6,8,9,10,11,4,12,13,14,31]),import.meta.url);if(!await a(e.workspaceId))return}d.dispatch(g(e.workspaceId,e.resourceId,{filePathIsLiteral:!0,...e.line!==void 0?{line:e.line}:{},openInAdjacentPanel:n?!1:r.openInAdjacentPanel??!1,sourcePanelId:n?void 0:r.sourcePanelId}));return}if(!t)throw new u(c.ui_linkHandler_noSpaceOpen_error());d.dispatch(g(t,e.resourceId,{filePathIsLiteral:!0,...e.line!==void 0?{line:e.line}:{},openInAdjacentPanel:r.openInAdjacentPanel??!1,sourcePanelId:r.sourcePanelId}))}async function P(e,r){try{const{backendRequest:t}=await p(async()=>{const{backendRequest:o}=await import("./D3glRUn0.js").then(s=>s.az);return{backendRequest:o}},__vite__mapDeps([15,4,5,11,16,10,17,18,19,14,20,13,21]),import.meta.url),n=await t("note.get",{workspaceId:e,noteId:r}),a=n&&typeof n=="object"&&"note"in n?n.note:n;return a!=null&&typeof a=="object"}catch{return!1}}export{u as NotFoundError,B as createIntentLinkClickHandler,$ as generateNoteLink,O as handleIntentLink,W as parseIntentLink};
@@ -0,0 +1,12 @@
1
+ import{n as E,o as l,b,s as x,d as dt,l as S,c as ct,_ as M,r as ut}from"./CIyUrgF0.js";import{Z as _}from"./DIh4SQwA.js";import{c as lt,a as mt}from"./DxwfiAWm.js";const L=E().finite().nonnegative(),Q=l({completedAtMs:L,samples:b(l({atMs:L,pointCount:E().int().min(0).max(2048),end:l({x:E().finite(),y:E().finite()}).strict()}).strict()).min(1).max(64)}).strict().refine(t=>t.samples.every((s,n)=>s.atMs<=t.completedAtMs&&(!n||s.atMs>=t.samples[n-1].atMs)),"Invalid gesture clock");function Vt(t,s,n){if(!s||n>=s.completedAtMs)return t;const i=[...s.samples].reverse().find(e=>e.atMs<=n);if(!i)return null;if(t.kind==="path")return i.pointCount?{kind:"path",points:t.points.slice(0,i.pointCount)}:null;if(t.kind==="arrow")return{kind:"arrow",from:t.from,to:i.end};if(t.kind==="rect"){const e=s.samples[0].end,a=Math.abs(i.end.x-e.x),r=Math.abs(i.end.y-e.y);return a>0&&r>0?{kind:"rect",x:Math.min(e.x,i.end.x),y:Math.min(e.y,i.end.y),w:a,h:r}:null}return t}const f=E().finite(),A=f.nonnegative(),R=E().int().nonnegative(),h=x().min(1).max(512),V=l({startMs:A,endMs:A}).strict().refine(t=>t.endMs>=t.startMs,"Reversed range"),z=l({x:f,y:f}).strict(),$=l({x:f,y:f,w:f.positive(),h:f.positive()}).strict(),ft=$.extend({id:h}),Wt=16,W=2,q=l({id:h,radius:f.positive().max(4096),points:b(z).min(1).max(4096)}).strict();function Zt(t){const s=t.points.map(a=>a.x),n=t.points.map(a=>a.y),i=Math.min(...s)-t.radius,e=Math.min(...n)-t.radius;return{x:i,y:e,w:Math.max(...s)+t.radius-i,h:Math.max(...n)+t.radius-e}}function Qt(t,s){return q.parse({...t,radius:t.radius*Math.max(Math.abs(s.scaleX),Math.abs(s.scaleY)),points:t.points.map(n=>({x:n.x*s.scaleX+s.offsetX,y:n.y*s.scaleY+s.offsetY}))})}const tt=dt("kind",[$.extend({kind:S("rect")}),l({kind:S("point"),x:f,y:f}).strict(),l({kind:S("path"),points:b(z).min(1).max(4096)}).strict(),l({kind:S("arrow"),from:z,to:z}).strict(),l({kind:S("text"),x:f,y:f,text:x().max(1e4),fontSize:f.positive(),style:S("sticky").optional(),width:f.positive().max(4096).optional(),padding:f.nonnegative().max(1024).optional()}).strict()]);function st(t){const s=t.fontSize*1.4,n=t.style==="sticky"?t.padding??8:0;if(t.style!=="sticky"){const r=t.text.split(`
2
+ `);return{lines:r,width:Math.max(1,...r.map(d=>d.length))*t.fontSize*.65,height:r.length*s,padding:n,lineHeight:s}}const i=Math.max(n*2+1,t.width??240),e=Math.max(1,Math.floor((i-n*2)/(t.fontSize*.65))),a=[];for(const r of t.text.split(`
3
+ `)){let d=r;for(;d.length>e;){const c=d.lastIndexOf(" ",e),u=c>0?c:e;a.push(d.slice(0,u).trimEnd()),d=d.slice(u).trimStart()}a.push(d)}return{lines:a,width:i,height:a.length*s+n*2,padding:n,lineHeight:s}}function qt(t,s){const n=st(t),i=tt.parse({...t,x:t.x*s.scaleX+s.offsetX,y:t.y*s.scaleY+s.offsetY,fontSize:t.fontSize*Math.abs(s.scaleY),...t.style==="sticky"?{width:n.width*Math.abs(s.scaleX),padding:n.padding*Math.min(Math.abs(s.scaleX),Math.abs(s.scaleY))}:{}});if(i.kind!=="text")throw new Error("invalid-text-transform");return i}const U=l({gestureProgress:Q.optional(),id:h,atMs:A,batchId:h,source:M(["recording","editor"]),kind:M(["click","box","draw","arrow","element","text"]),included:ct(),geometry:tt,label:x().max(2048),note:x().max(2e4),context:l({selector:x().max(8192).nullable(),text:x().max(2e4).nullable(),url:x().max(8192).nullable()}).strict()}).strict(),pt=l({id:h,atMs:A,clearAtMs:A.nullable()}).strict().refine(t=>t.clearAtMs===null||t.clearAtMs>=t.atMs,"Reversed batch"),ht=l({mode:M(["fullscreen","window","region"]),frame:l({displayId:E().int(),rect:$,coordinateSpace:S("screen-points-top-left")}).strict().nullable()}).strict(),j=l({id:h,revision:R,kind:M(["recording","screenshot"]),capture:ht.optional(),attachmentId:h,path:x().refine(t=>t.startsWith(".intent/attachments/")&&!/[\\\x00]/.test(t)&&!t.split("/").some(s=>!s||s==="."||s===".."),"Invalid attachment path"),durationMs:A,width:f.positive(),height:f.positive(),audio:M(["available","none","unknown"]),batches:b(pt).max(1e4),visuals:M(["clean","baked-marks"]),capturedMarks:b(U).max(1e4).optional(),bakedMarks:b(U).max(1e4).optional()}).strict().superRefine((t,s)=>{for(const n of t.capturedMarks??[]){const i=n.gestureProgress;i&&(t.kind!=="recording"||i.completedAtMs>t.durationMs||i.samples.some(e=>e.atMs<n.atMs||n.geometry.kind==="path"&&e.pointCount>n.geometry.points.length))&&s.addIssue({code:_.custom,path:["capturedMarks"],message:"Gesture timing does not match the recording"})}t.kind==="recording"&&t.durationMs<=0&&s.addIssue({code:_.custom,path:["durationMs"],message:"Recording duration is missing"})}),Mt=l({status:M(["pending","ready","no-speech","unavailable","failed"]),revision:R,words:b(l({id:h,text:x().max(2e4),startMs:A.nullable(),endMs:A.nullable(),alignment:M(["word","segment","untimed"])}).strict().superRefine((t,s)=>{(t.startMs===null!=(t.endMs===null)||t.startMs!==null&&t.endMs!==null&&t.endMs<t.startMs)&&s.addIssue({code:_.custom,message:"Incomplete or reversed recognition timing"}),t.alignment!=="untimed"&&(t.startMs===null||t.endMs===null)&&s.addIssue({code:_.custom,message:"Timed recognition units require genuine timestamps"}),t.alignment==="untimed"&&t.startMs!==null&&s.addIssue({code:_.custom,message:"Untimed text cannot claim timestamps"})})).max(2e5),error:x().max(2048).optional()}).strict();l({video:M(["full","highlights"]),voice:M(["audio","transcript","off"])}).strict();const G=l({version:S(1),kind:M(["recording","screenshot"]),sourceId:h,sourceRevision:R,revision:R,trim:V,cuts:b(V).max(1e4),marks:b(U).max(1e4),blurRegions:b(ft).max(1e3),blurStrokes:b(q).max(1e3).optional(),crop:$.nullable(),video:M(["full","highlights"]),voice:M(["audio","transcript","off"]),wordEdits:ut(x(),x().max(2e4))}).strict().superRefine((t,s)=>{const n=new Set;for(const i of t.marks)n.has(i.id)&&s.addIssue({code:_.custom,path:["marks"],message:"Duplicate mark identity"}),n.add(i.id)}),kt=l({openId:h,outputVersion:S(W).optional(),sourceId:h,sourceRevision:R,pair:l({workspaceId:h,agentId:h}).strict(),expectedEditRevision:R,edit:G,replacement:l({candidateToken:h,source:j}).strict().optional()}).strict().refine(t=>!(t.edit.blurStrokes?.length||t.edit.marks.some(s=>s.geometry.kind==="text"&&s.geometry.style==="sticky"))||t.outputVersion===W,"This edit requires an admitted output version");function X(t){const s=t.filter(i=>Number.isFinite(i.startMs)&&Number.isFinite(i.endMs)&&i.endMs>i.startMs).map(i=>({...i})).sort((i,e)=>i.startMs-e.startMs),n=[];for(const i of s){const e=n.at(-1);e&&i.startMs<=e.endMs?e.endMs=Math.max(e.endMs,i.endMs):n.push(i)}return n}function K(t,s){let n=X(t);for(const i of X(s))n=n.flatMap(e=>i.endMs<=e.startMs||i.startMs>=e.endMs?[e]:[...i.startMs>e.startMs?[{startMs:e.startMs,endMs:i.startMs}]:[],...i.endMs<e.endMs?[{startMs:i.endMs,endMs:e.endMs}]:[]]);return n}function Y(t,s,n){const i=t===n?Math.max(0,t-.001):t;return s.some(e=>i>=e.startMs&&i<e.endMs)}const N=6;function xt(t){if(t.kind==="point")return{x:t.x-N,y:t.y-N,w:N*2,h:N*2};if(t.kind==="rect")return{x:t.x,y:t.y,w:t.w,h:t.h};if(t.kind==="text"){const e=st(t);return{x:t.x,y:t.y,w:e.width,h:e.height}}const s=t.kind==="path"?t.points:[t.from,t.to],n=Math.min(...s.map(e=>e.x)),i=Math.min(...s.map(e=>e.y));return{x:n,y:i,w:Math.max(1,Math.max(...s.map(e=>e.x))-n),h:Math.max(1,Math.max(...s.map(e=>e.y))-i)}}function gt(t,s){if(!s)return!1;const n=xt(t.geometry);return n.x+n.w<s.x||n.x>s.x+s.w||n.y+n.h<s.y||n.y>s.y+s.h}function It(t){const s=K([t.trim],t.cuts);return t.marks.some(n=>n.included&&Y(n.atMs,s,t.trim.endMs))}function ts(t){return t.visuals==="clean"}function ss(t,s){const n=t.kind==="recording",i=s?.status==="ready";return{audio:{enabled:n&&t.audio==="available",reason:t.audio==="available"?null:"audio-unavailable"},transcript:{enabled:n&&i,reason:i?null:s?.status==="pending"?"transcript-pending":"transcript-unavailable"},off:{enabled:!0,reason:null}}}function ns(t,s,n,i=null){const e={version:1,kind:t.kind,sourceId:t.id,sourceRevision:t.revision,revision:0,trim:{startMs:0,endMs:t.durationMs},cuts:[],marks:structuredClone([...s]),blurRegions:[],blurStrokes:[],crop:null,video:i?.video??"highlights",voice:i?.voice??"transcript",wordEdits:{}};return t.kind==="screenshot"?(e.video="full",e.voice="off",e):(It(e)||(e.video="full"),(t.audio==="none"||n?.status==="no-speech"||e.voice==="audio"&&t.audio!=="available")&&(e.voice="off"),e)}function yt(t,s,n,i,e){const a=[],r=t.cuts.length>0||t.trim.startMs>0||t.trim.endMs<s.durationMs;if(!r&&n.words.some(o=>{const m=t.wordEdits[o.id]??o.text;return/^[\s\p{P}]*$/u.test(m)&&/^[\s\p{P}]*$/u.test(o.text)?!1:o.startMs===null||o.endMs===null||o.startMs<s.durationMs&&o.endMs>s.durationMs})){const o=[];let m=!1;for(const y of n.words){const D=t.wordEdits[y.id]??y.text;if(!D.trim()){y.text.trim()&&(m=!1);continue}/^[\s\p{P}]*$/u.test(D)?m&&(o[o.length-1]+=D.trim()):(o.push(D.trim()),m=!0)}const v=[...i].sort((y,D)=>y.mark.atMs-D.mark.atMs||y.n-D.n).map(({n:y,mark:D})=>`[mark ${y}: ${D.label||D.kind}]`).join(`
4
+ `);return{text:[o.join(" ").replace(/[^\S\n]+/g," ").trim(),v].filter(Boolean).join(`
5
+
6
+ `),timingMissing:!1}}let c=!1,u=null;for(const o of n.words){if(o.startMs===null||o.endMs===null){const k=t.wordEdits[o.id]??o.text;if(/^[\s\p{P}]*$/u.test(k)){u&&k.trim()&&(u.text+=k.trim());continue}(r||i.length>0)&&o.text.trim()?c=!0:a.push({at:Number.MAX_SAFE_INTEGER-1,order:1,text:t.wordEdits[o.id]??o.text});continue}const m=e.some(k=>o.startMs<k.endMs&&o.endMs>k.startMs),v=e.some(k=>o.startMs>=k.startMs&&o.endMs<=k.endMs);m&&!v&&(c=!0),u=v?{at:o.startMs,order:1,text:t.wordEdits[o.id]??o.text}:null,u&&a.push(u)}for(const{n:o,mark:m}of i)a.push({at:m.atMs,order:2,text:`[mark ${o}: ${m.label||m.kind}]`});for(const o of s.batches)Y(o.atMs,e,s.durationMs)&&a.push({at:o.atMs,order:0,text:`
7
+
8
+ `});return{text:a.sort((o,m)=>o.at-m.at||o.order-m.order).map(o=>o.text).join(" ").replace(/[^\S\n]+/g," ").replace(/ *\n */g,`
9
+ `).trim(),timingMissing:c}}function is(t,s){return[...t.batches].sort((n,i)=>i.atMs-n.atMs).find(n=>s>=n.atMs&&(n.clearAtMs===null||s<n.clearAtMs))??null}function bt(t,s){const n=t.capturedMarks?.find(i=>i.id===s.id);return n&&JSON.stringify(n.geometry)===JSON.stringify(s.geometry)?n.gestureProgress:void 0}function Dt(t,s){const n=K([t.trim],t.cuts);return t.marks.filter(i=>i.included&&!gt(i,t.crop)&&(s.kind==="screenshot"||Y(i.atMs,n,s.durationMs))).map((i,e)=>({n:e+1,mark:i,frameAtMs:Math.min(i.atMs,Math.max(0,s.durationMs-1)),visibleUntilMs:s.batches.find(a=>a.id===i.batchId)?.clearAtMs??s.durationMs}))}function wt(t,s,n){const i=[],e={kept:[],clips:[],muted:!0,marks:[],transcript:null,errors:i};if(!G.safeParse(t).success||!j.safeParse(s).success)return i.push("invalid-edit"),e;if(t.kind!==s.kind||t.sourceId!==s.id||t.sourceRevision!==s.revision)return i.push("stale-source"),e;if(t.trim.endMs>s.durationMs||t.trim.startMs>s.durationMs||t.crop&&(t.crop.x<0||t.crop.y<0||t.crop.x+t.crop.w>s.width||t.crop.y+t.crop.h>s.height))return i.push("invalid-edit"),e;if(s.visuals==="baked-marks"&&(t.blurRegions.length>0||(t.blurStrokes?.length??0)>0||JSON.stringify(t.marks)!==JSON.stringify(s.bakedMarks)||s.bakedMarks?.length&&(t.cuts.length>0||t.crop||t.trim.startMs>0||t.trim.endMs<s.durationMs)))return i.push("legacy-baked-marks"),e;const a=t.blurStrokes??[];if(new Set(a.map(o=>o.id)).size!==a.length||a.reduce((o,m)=>o+m.points.length,0)>2e5||a.some(o=>o.points.some(m=>m.x<0||m.y<0||m.x>s.width||m.y>s.height)))return i.push("invalid-edit"),e;const r=K([t.trim],t.cuts),d=Dt(t,s),c=d.map(o=>o.mark),u=s.kind==="screenshot"?[]:t.video==="full"?r:K(X(c.map(o=>({startMs:Math.max(t.trim.startMs,o.atMs-3e3),endMs:Math.min(t.trim.endMs,s.durationMs,(bt(s,o)?.completedAtMs??o.atMs)+3e3)}))),t.cuts);t.voice==="audio"&&s.audio!=="available"&&i.push("audio-unavailable");let w=null;if(s.kind==="recording"&&t.voice==="transcript")if(!n||n.status!=="ready")i.push(n?.status==="pending"?"transcript-pending":"transcript-unavailable");else{const o=yt(t,s,n,d,r);w=o.text,o.timingMissing&&i.push("timing-unavailable")}return{kept:r,clips:u,muted:t.voice!=="audio",marks:d,transcript:w,errors:i}}const nt=l({source:j,originalSource:j.optional(),saved:G.nullable(),transcript:Mt.nullable()}).strict().superRefine((t,s)=>{t.saved&&(t.saved.sourceId!==t.source.id||t.saved.sourceRevision!==t.source.revision||t.saved.kind!==t.source.kind)&&s.addIssue({code:_.custom,message:"Saved edit belongs to a different source"})});function es(t,s){if(!kt.safeParse(s).success||!nt.safeParse(t).success)return{status:"invalid-edit"};if(s.sourceId!==t.source.id||s.sourceRevision!==t.source.revision)return{status:"stale-source"};if(s.expectedEditRevision!==(t.saved?.revision??0)||s.edit.revision!==s.expectedEditRevision)return{status:"revision-conflict"};const n=s.replacement?.source??t.source;return n.kind!==t.source.kind||s.replacement&&(n.kind!=="screenshot"||n.id===t.source.id)||s.edit.sourceId!==n.id||s.edit.sourceRevision!==n.revision||s.edit.kind!==n.kind?{status:"stale-source"}:wt(s.edit,n,t.transcript).errors.some(e=>e==="invalid-edit"||e==="legacy-baked-marks"||e==="stale-source")?{status:"invalid-edit"}:{status:"saved",media:{...t,source:n,...s.replacement?{originalSource:t.originalSource??t.source,transcript:null}:{},saved:{...structuredClone(s.edit),revision:s.expectedEditRevision+1}}}}function as(t,s){const n=t.capture?.frame,i=s.capture?.frame;if(!n||!i||n.displayId!==i.displayId||t.kind!=="screenshot"||s.kind!=="screenshot")return null;const e=s.width/i.rect.w,a=s.height/i.rect.h;return{scaleX:n.rect.w/t.width*e,scaleY:n.rect.h/t.height*a,offsetX:(n.rect.x-i.rect.x)*e,offsetY:(n.rect.y-i.rect.y)*a}}const St=["pick","box","pen","arrow"],I={images:4,clips:5,files:10,marks:99,clipMs:12e4,penPoints:256,elementText:512,insertionText:2e4,insertions:16,retiredMarks:64,removedMarks:32};function rs(t,s){return JSON.stringify([s,t.images.find(n=>n.id===s)?.media,et(t).filter(({mark:n})=>n.imageId===s).map(({n,mark:i})=>[n,i.id,i.geometry])])}function C(t,s){return`${s?"clip-end":"clip-start"}:${t}`}function F(t){return(t?.clips??[]).filter(s=>s.status!=="failed").map((s,n)=>({n:n+1,clip:s}))}function it(t){return new Set([...t.marks.map(s=>s.id),...F(t).flatMap(({clip:s})=>[C(s.id,!1),C(s.id,!0)])])}function os(t,s){return JSON.stringify([t,s])}function At(t){return{id:t,images:[],marks:[],clips:[],insertions:[],annotation:null,dictation:null,placements:{},capture:{pending:!1,error:null,accepted:0},revision:0}}function ds(t){return t?.clips.find(s=>s.status==="recording")??null}function cs(t){return(t?.clips??[]).flatMap(s=>s.contextItemId?[s.contextItemId]:[])}function us(t){return!!t&&(t.images.length>0||t.clips.some(s=>s.status==="ready"))}function ls(t){return JSON.stringify([t?.images.map(s=>[s.id,s.media?.source,s.media?.saved?.revision,s.mediaError])??[],t?.marks.map(s=>[s.id,s.imageId,s.tool,s.geometry,s.element,s.clipId,s.clipMs,s.gestureProgress])??[],t?.clips.map(s=>[s.id,s.status,s.media?.source,s.media?.saved?.revision,s.mediaError])??[]])}function ms(t){return new Set(t?.images.map(s=>s.contextItemId)??[])}function et(t){return t.marks.map((s,n)=>({n:n+1,mark:s}))}function fs(t,s,n){return[...(t?.marks??[]).map((i,e)=>({id:i.id,number:e+1,label:i.element?.name||s[i.tool]})),...F(t).flatMap(({n:i,clip:e})=>[!1,!0].map(a=>({id:C(e.id,a),number:i,label:n?.(i,a)??"",kind:a?"clip-end":"clip-start"})))]}function ps(t,s){const n=t.images.at(-1);return!n||t.marks.some(i=>i.imageId===n.id)||n.width!==s.width||n.height!==s.height?null:lt(n.hash,s.hash)<=mt.hashThreshold?n:null}function hs(t){return!t||t.images.length<I.images?!1:t.images.every(s=>t.marks.some(n=>n.imageId===s.id))}const g=t=>typeof t=="number"&&Number.isFinite(t);function H(t,s=I.elementText){return typeof t=="string"?t.slice(0,s):""}function O(t,s){return!t||!g(t.x)||!g(t.y)?null:{x:Math.min(s.width,Math.max(0,t.x)),y:Math.min(s.height,Math.max(0,t.y))}}function Et(t){const s=t.map(a=>a.x),n=t.map(a=>a.y),i=Math.min(...s),e=Math.min(...n);return{x:i,y:e,w:Math.max(...s)-i,h:Math.max(...n)-e}}function _t(t,s){if(!t||typeof t!="object")return null;if(t.kind==="rect"){if(![t.x,t.y,t.w,t.h].every(g))return null;const n=O({x:Math.min(t.x,t.x+t.w),y:Math.min(t.y,t.y+t.h)},s),i=O({x:Math.max(t.x,t.x+t.w),y:Math.max(t.y,t.y+t.h)},s);return!n||!i?null:{kind:"rect",x:n.x,y:n.y,w:i.x-n.x,h:i.y-n.y}}if(t.kind==="arrow"){const n=O(t.from,s),i=O(t.to,s);return n&&i?{kind:"arrow",from:n,to:i}:null}if(t.kind==="path"&&Array.isArray(t.points)){const n=t.points.map(a=>O(a,s)).filter(a=>!!a);if(!n.length)return null;const i=Math.ceil(n.length/I.penPoints),e=n.filter((a,r)=>r%i===0);return e.at(-1)!==n.at(-1)&&e.push(n.at(-1)),{kind:"path",points:e.slice(-256)}}return null}function vt(t){return t.kind==="rect"?{x:t.x,y:t.y,w:t.w,h:t.h}:Et(t.kind==="path"?t.points:[t.from,t.to])}function Rt(t){if(!t||typeof t!="object")return null;const s=H(t.name),n=H(t.role);return!s&&!n?null:{role:n,name:s,path:t.path?H(t.path):null,source:t.source?H(t.source):null}}function Ot(t,s){if(!t||typeof t.id!="string"||!t.id||t.imageId!==s.id||!St.includes(t.tool))return null;const n=_t(t.geometry,s);if(!n)return null;const i=Q.safeParse(t.gestureProgress);let e=i.success?i.data:void 0;if(e&&t.geometry.kind==="path"&&n.kind==="path"){const a=t.geometry.points.length,r=Math.ceil(a/I.penPoints),d=Array.from({length:a},(u,w)=>w).filter(u=>u%r===0);d.at(-1)!==a-1&&d.push(a-1);const c=d.slice(-256);e={...e,samples:e.samples.map(u=>({...u,pointCount:c.filter(w=>w<u.pointCount).length}))}}return{id:t.id,imageId:s.id,tool:t.tool,geometry:n,...e?{gestureProgress:e}:{},bounds:vt(n),element:Rt(t.element),createdAt:g(t.createdAt)?t.createdAt:0,...g(t.clipMs)&&t.clipMs>=0?{clipMs:Math.round(t.clipMs)}:{},...typeof t.clipId=="string"&&t.clipId&&t.clipId.length<=128?{clipId:t.clipId}:{},...g(t.dictationOffsetMs)&&t.dictationOffsetMs>=0?{dictationOffsetMs:Math.round(t.dictationOffsetMs)}:{}}}function Ct(t){return!!t&&typeof t.id=="string"&&!!t.id&&typeof t.contextItemId=="string"&&!!t.contextItemId&&g(t.width)&&g(t.height)&&t.width>0&&t.height>0&&g(t.displayScale)&&t.displayScale>0&&typeof t.capturedAt=="string"&&["capture","annotate","dictation"].includes(t.source)}function p(t,s){return{...t,...s,revision:t.revision+1}}function Tt(t,s){return t.map(n=>({...n,parts:n.parts.filter(i=>i.kind==="text"||!s.has(i.markId))})).filter(n=>n.parts.length>0)}function T(t,s){const n=new Set(s);return{retiredMarkIds:[...(t.retiredMarkIds??[]).filter(i=>!n.has(i)),...n].slice(-64),insertions:Tt(t.insertions,n)}}function Ms(t,s){return typeof s!="string"||!s||t.marks.some(n=>n.id===s)||t.retiredMarkIds?.includes(s)?t:p(t,T(t,[s]))}function ks(t){const s=it(t),n=[];for(const i of t.insertions){if(i.parts.some(e=>e.kind==="mark"&&!s.has(e.markId)))break;n.push(i)}return n}function at(t,s){if(!Ct(s)||t.images.some(i=>i.id===s.id))return{outcome:"invalid",evidence:t};if(t.images.length<I.images)return{outcome:"added",evidence:p(t,{images:[...t.images,s]})};const n=t.images.find(i=>!t.marks.some(e=>e.imageId===i.id));return n?{outcome:"replaced",replaced:n,evidence:p(t,{images:[...t.images.filter(i=>i.id!==n.id),s],annotation:t.annotation?.imageId===n.id?{...t.annotation,imageId:null}:t.annotation})}:{outcome:"limit",evidence:t}}function P(t,s,n,i=!1){const e=new Set(s);return t.clips.map(a=>a.captureHistory?.some(r=>e.has(r.mark.id))?{...a,captureHistory:a.captureHistory.map(r=>e.has(r.mark.id)?{...r,included:i||r.cleared&&!n?r.included:n,cleared:i||r.cleared}:r)}:a)}function xs(t,s){return p(t,{clips:P(t,t.marks.filter(n=>n.imageId===s).map(n=>n.id),!0,!0)})}function Pt(t,s){if(!t.images.some(a=>a.id===s))return t;const n=t.marks.filter(a=>a.imageId!==s),i=t.marks.filter(a=>a.imageId===s).map(a=>a.id),e={...t.placements};return delete e[s],p(t,{images:t.images.filter(a=>a.id!==s),clips:P(t,i,!1),marks:n,placements:e,removedMarks:t.removedMarks?.filter(({mark:a})=>a.imageId!==s),...T(t,i),annotation:t.annotation?.imageId===s?{...t.annotation,imageId:null}:t.annotation})}function Nt(t,s){const n=t.images.find(r=>r.id===s?.imageId);if(!n||t.marks.length>=I.marks||t.marks.some(r=>r.id===s.id))return{accepted:!1,evidence:t};const i=Ot(s,n);if(!i)return{accepted:!1,evidence:t};const e=i.clipId&&t.clips.find(r=>r.id===i.clipId);if(e&&(e.captureHistory?.length??0)>=1e4&&!e.captureHistory?.some(r=>r.mark.id===i.id))return{accepted:!1,evidence:t};const a=e?t.clips.map(r=>r.id!==e.id?r:{...r,captureHistory:r.captureHistory?.some(d=>d.mark.id===i.id)?r.captureHistory.map(d=>d.mark.id===i.id?{...d,included:!0}:d):[...r.captureHistory??[],{mark:structuredClone(i),image:{id:n.id,width:n.width,height:n.height},included:!0,cleared:!1}]}):t.clips;return{accepted:!0,evidence:p(t,{marks:[...t.marks,i],clips:a})}}function J(t,s){const n=t.marks.findIndex(e=>e.id===s);if(n<0)return t;const i=t.marks.filter(e=>e.id!==s);return p(t,{marks:i,clips:P(t,[s],!1),...T(t,[s]),removedMarks:[...(t.removedMarks??[]).filter(({mark:e})=>e.id!==s),{index:n,mark:t.marks[n]}].slice(-32)})}function Ht(t,s){const n=t.removedMarks?.find(({mark:e})=>e.id===s);if(!n||t.marks.some(e=>e.id===s)||!t.images.some(e=>e.id===n.mark.imageId)||t.marks.length>=I.marks)return t;const i=[...t.marks];return i.splice(Math.min(n.index,i.length),0,n.mark),p(t,{marks:i,clips:P(t,[s],!0),retiredMarkIds:t.retiredMarkIds?.filter(e=>e!==s),removedMarks:t.removedMarks?.filter(({mark:e})=>e.id!==s)})}function gs(t,s){let n=t;for(const e of s.removed)n=J(n,e);const i=e=>n.removedMarks?.findIndex(({mark:a})=>a.id===e)??-1;for(const e of[...s.restored].sort((a,r)=>i(r)-i(a)))n=Ht(n,e);return n}function zt(t){const s=t?.annotation;return!t||!s?.imageId||s.mode==="dictation"?null:[...t.marks].reverse().find(n=>n.imageId===s.imageId)??null}function jt(t){const s=t?.annotationHistory;return!!s?.redo.length&&s.sessionId===t?.annotation?.id}function Is(t,s){const n=t.annotation,i=zt(t);if(!n||!i)return t;const e=t.marks.findIndex(u=>u.id===i.id),r=n.mode==="live"&&!t.marks.some(u=>u.imageId===i.imageId&&u!==i)&&s?.image.id===i.imageId?s:void 0;let d=J(t,i.id);r&&(d=Pt(d,r.image.id));const c=t.annotationHistory?.sessionId===n.id?t.annotationHistory.redo:[];return p(d,{annotationHistory:{sessionId:n.id,redo:[...c,{index:e,mark:i,...r?{image:r}:{}}]}})}function ys(t){if(!jt(t))return t;const s=t.annotationHistory,n=s.redo.at(-1);let i=t;if(n.image){const a=at(i,n.image.image);if(a.outcome!=="added")return t;i={...a.evidence,annotation:{...i.annotation,imageId:n.image.image.id}}}if(!i.images.some(a=>a.id===n.mark.imageId)||i.marks.some(a=>a.id===n.mark.id))return t;const e=[...i.marks];return e.splice(Math.min(n.index,e.length),0,n.mark),p(i,{marks:e,clips:P(i,[n.mark.id],!0),retiredMarkIds:i.retiredMarkIds?.filter(a=>a!==n.mark.id),removedMarks:i.removedMarks?.filter(({mark:a})=>a.id!==n.mark.id),annotationHistory:{...s,redo:s.redo.slice(0,-1)}})}function bs(t){const s=t?.annotationHistory;return!s||s.sessionId!==t?.annotation?.id||t.annotation.imageId?null:[...s.redo].reverse().find(n=>n.image)?.image??null}function Ds(t){const s=t.marks.at(-1);return s?J(t,s.id):t}function ws(t,s){if(!s||typeof s.id!="string"||!s.id||t.insertions.some(a=>a.id===s.id)||t.insertions.length>=I.insertions||!Array.isArray(s.parts))return t;const n=new Set(t.retiredMarkIds??[]);let i=I.insertionText;const e=[];for(const a of s.parts)if(a?.kind==="mark"&&typeof a.markId=="string"&&a.markId&&a.markId.length<=128&&!n.has(a.markId))e.push({kind:"mark",markId:a.markId});else if(a?.kind==="text"&&typeof a.text=="string"&&a.text&&i>0){const r=a.text.slice(0,i);i-=r.length,e.push({kind:"text",text:r})}return e.length?p(t,{insertions:[...t.insertions,{id:s.id,parts:e}]}):t}function Ss(t,s){const n=it(t);let i=I.insertionText;const e=[];for(const a of s)if(a?.kind==="mark"&&n.has(a.markId))e.push({kind:"mark",markId:a.markId});else if(a?.kind==="text"&&typeof a.text=="string"&&a.text&&i>0){const r=a.text.slice(0,i);i-=r.length,e.push({kind:"text",text:r})}return e}function As(t,s){return t.insertions.some(n=>n.id===s)?p(t,{insertions:t.insertions.filter(n=>n.id!==s)}):t}function Kt(t,s,n){const i=t.clips.findIndex(a=>a.id===s),e=[C(s,!1),C(s,!0)];return n?n.id!==s?t:i>=0?p(t,{clips:t.clips.map((a,r)=>r===i?n:a),...n.status==="failed"?T(t,e):{}}):t.clips.length>=I.clips?t:p(t,{clips:[...t.clips,n]}):i<0?t:p(t,{clips:t.clips.filter(a=>a.id!==s),...T(t,e)})}function Es(t,s){return p(t,s)}const $t=/\[\[mark:(\d+)\]\]/g,Bt=/\[\[clip:(\d+)(?::end)?\]\]/g;function _s(t,s){const n=(i,e)=>[...t.matchAll(i)].every(a=>{const r=Number(a[1]);return Number.isSafeInteger(r)&&r>=1&&r<=e});return n($t,s?.marks.length??0)&&n(Bt,F(s).length)}const rt={metadata:64,context:16},ot=t=>({x:Math.round(t.x),y:Math.round(t.y),w:Math.round(t.w),h:Math.round(t.h)}),B=t=>[Math.round(t.x),Math.round(t.y)];function Ut(t,s){if(t.kind==="rect")return{kind:"rect",...ot(t)};if(t.kind==="arrow")return{kind:"arrow",tail:B(t.from),head:B(t.to)};const n=t.points,i=Math.max(1,Math.ceil(n.length/Math.max(2,s))),e=n.filter((a,r)=>r%i===0);return e.at(-1)!==n.at(-1)&&e.push(n.at(-1)),{kind:"path",points:e.slice(-Math.max(2,s)).map(B)}}function Xt(t,s,n=rt.metadata){const i=et(t).map(({n:a,mark:r})=>({n:s.markNumbers?.get(r.id)??a,mark:r})),e=t.clips.filter(a=>a.status==="ready");return{type:"dock_screen_evidence",version:1,images:t.images.map((a,r)=>({index:r,id:a.id,attachment_id:s.imageAttachments?.[a.id]?.attachmentId??null,raw:s.imageAttachments?.[a.id]?.raw?{attachment_id:s.imageAttachments[a.id].raw.attachmentId,expires_at:s.imageAttachments[a.id].raw.expiresAt}:null,width:a.width,height:a.height,display_scale:a.displayScale,captured_at:a.capturedAt,marks:i.filter(({mark:d})=>d.imageId===a.id).map(({n:d,mark:c})=>({n:d,id:c.id,tool:c.tool,rect:ot(c.bounds),geometry:Ut(c.geometry,n),element:c.element}))})),...e.length?{clips:e.map(a=>({id:a.id,attachment_id:s.clipAttachmentIds?.[a.id]??null,duration_ms:Math.round(a.durationMs),has_mic_audio:a.hasMicAudio,mark_timestamps_ms:Object.fromEntries(i.filter(({mark:r})=>r.clipMs!==void 0&&r.clipId===a.id).map(({n:r,mark:d})=>[String(r),d.clipMs]))}))}:{},context:{workspace:s.workspaceId,agent:s.agentId,app_url:s.appUrl}}}const Gt="[Screen evidence: screenshots lead the attached images in this order; [[mark:n]] in the message refers to mark n; [[clip:n]] and [[clip:n:end]] mark where recording n started and stopped while the user was speaking]";function vs(t,s){const{images:n,clips:i}=Xt(t,s,rt.context),e={type:"dock_screen_evidence",version:1,images:n.map(({index:a,attachment_id:r,raw:d,width:c,height:u,display_scale:w,marks:o})=>({image:a+1,attachment_id:r,...d?{raw:d}:{},size:[c,u],scale:w,marks:o.map(({n:m,tool:v,geometry:k,element:y})=>({n:m,tool:v,geometry:k,...y?{element:y}:{}}))})),...i?.length?{clips:i.map((a,r)=>({clip:r+1,attachment_id:a.attachment_id,duration_ms:a.duration_ms,has_mic_audio:a.has_mic_audio,mark_timestamps_ms:a.mark_timestamps_ms}))}:{}};return`${Gt}
10
+ \`\`\`json
11
+ ${JSON.stringify(e)}
12
+ \`\`\``}function Yt(t){return typeof t!="string"||!t||t.length>1024||t.startsWith("/")||t.includes("\\")||/^[A-Za-z]:/.test(t)?!1:t.split("/").every(s=>!!s&&s!=="."&&s!=="..")}function Rs(t){if(!t)return{};const s={};for(const{contextItemId:n,...i}of t.images)s[n]={kind:"image",image:i,marks:t.marks.map((e,a)=>({index:a,mark:e})).filter(({mark:e})=>e.imageId===i.id)};for(const n of t.clips)n.status!=="ready"||!n.contextItemId||(s[n.contextItemId]={kind:"clip",clip:{id:n.id,startedAt:n.startedAt,durationMs:n.durationMs,hasMicAudio:n.hasMicAudio,...n.path?{path:n.path}:{},...n.media?{media:n.media}:{},...n.mediaError?{mediaError:n.mediaError}:{}}});return s}function Z(t,s,n){if(t.mediaError)return{media:void 0,mediaError:"invalid-saved-edit"};if(t.media===void 0)return{};const i=nt.safeParse(t.media);return i.success&&n?.attachmentId&&n.path&&i.data.source.kind===s&&i.data.source.attachmentId===n.attachmentId&&i.data.source.path===n.path&&i.success?{media:i.data}:{media:void 0,mediaError:"invalid-saved-edit"}}function Os(t,s){const n=t?.images.find(i=>i.id===s)??t?.clips.find(i=>i.id===s);return n?.mediaError?null:n?.media?.source??null}function Cs(t,s,n=[]){let i=At(t);const e=[];for(const[a,r]of s){const d=r;if(!(!d||typeof d!="object")){if(d.kind==="image"&&d.image){const c=at(i,{...d.image,...Z(d.image,"screenshot",n.find(u=>u.contextItemId===a)),contextItemId:a});if(c.outcome!=="added")continue;if(i=c.evidence,Array.isArray(d.marks))for(const u of d.marks)u&&g(u.index)&&e.push(u)}else if(d.kind==="clip"&&d.clip){const c=d.clip;if(typeof c.id!="string"||!c.id||!g(c.durationMs))continue;i=Kt(i,c.id,{id:c.id,status:"ready",...Z(c,"recording",n.find(u=>u.contextItemId===a)),startedAt:g(c.startedAt)?c.startedAt:0,durationMs:Math.min(I.clipMs,Math.max(0,c.durationMs)),hasMicAudio:c.hasMicAudio===!0,contextItemId:a,...Yt(c.path)?{path:c.path}:{}})}}}for(const{mark:a}of e.sort((r,d)=>r.index-d.index))i=Nt(i,a).evidence;return{...i,revision:0}}const Ts=["fullscreen","window","region"];function Ps(t){const s=t;return s&&typeof s.sessionId=="string"&&s.sessionId.length>0&&s.sessionId.length<=128&&(s.kind==="pick"||s.kind==="target"||s.kind==="capture")&&(s.error==="permission"||s.error==="unavailable")?{sessionId:s.sessionId,kind:s.kind,error:s.error}:null}export{ks as $,cs as A,C as B,rs as C,Ts as D,ls as E,os as F,ms as G,vt as H,is as I,Zt as J,xt as K,as as L,Os as M,At as N,ws as O,Cs as P,Vt as Q,us as R,Yt as S,st as T,ts as U,X as V,et as W,Dt as X,bs as Y,Es as Z,wt as _,Gt as a,bt as a0,ds as a1,ys as a2,jt as a3,Ms as a4,Pt as a5,J as a6,ps as a7,Ps as a8,fs as a9,Kt as aa,K as ab,Rs as ac,Qt as ad,qt as ae,Is as af,Ds as ag,zt as ah,_s as ai,ss as aj,I as b,St as c,Wt as d,W as e,N as f,U as g,G as h,V as i,$ as j,kt as k,j as l,Mt as m,nt as n,As as o,Nt as p,at as q,es as r,gs as s,Ss as t,vs as u,Xt as v,It as w,xs as x,ns as y,hs as z};