openpond 0.2.55 → 0.2.57

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 (399) hide show
  1. package/dist/app-server.d.ts +10545 -10254
  2. package/dist/app-server.js +1 -1
  3. package/dist/chunks/actions-command-QU4H53OG.js +2 -0
  4. package/dist/chunks/{app-layer-Y2UERCPY.js → app-layer-NSTE5HIT.js} +1 -1
  5. package/dist/chunks/app-server-connected-apps-JHGWLBXT.js +2 -0
  6. package/dist/chunks/app-server-evaluations-GJPFWIDA.js +2 -0
  7. package/dist/chunks/app-server-harness-services-IH4G6POY.js +2 -0
  8. package/dist/chunks/app-server-runtime-VCRNCNX2.js +2 -0
  9. package/dist/chunks/apps-BKTOR4F7.js +2 -0
  10. package/dist/chunks/chunk-25MBPJVY.js +2 -0
  11. package/dist/chunks/chunk-2D4Y3HNW.js +2 -0
  12. package/dist/chunks/chunk-2IHO4GDJ.js +2 -0
  13. package/dist/chunks/chunk-2QUCCP6Z.js +2 -0
  14. package/dist/chunks/chunk-3K4VVB7S.js +6 -0
  15. package/dist/chunks/chunk-3QIB5FXI.js +10 -0
  16. package/dist/chunks/chunk-3RCRSMWZ.js +17 -0
  17. package/dist/chunks/chunk-3VUATFZD.js +2 -0
  18. package/dist/chunks/chunk-3Z47M3YY.js +2 -0
  19. package/dist/chunks/{chunk-UA5DA5I2.js → chunk-4D7HWVWD.js} +1 -1
  20. package/dist/chunks/chunk-4EPSHPZL.js +2 -0
  21. package/dist/chunks/chunk-4NESNOK5.js +2 -0
  22. package/dist/chunks/chunk-523TE4BI.js +2 -0
  23. package/dist/chunks/{chunk-B7QDZPNX.js → chunk-5MCNZCVQ.js} +1 -1
  24. package/dist/chunks/chunk-6FDWRG55.js +2 -0
  25. package/dist/chunks/{chunk-DLVPSCTB.js → chunk-6QSSIT62.js} +1 -1
  26. package/dist/chunks/chunk-6ZFPQYHG.js +2 -0
  27. package/dist/chunks/chunk-74IIXVAE.js +2 -0
  28. package/dist/chunks/chunk-74ZXXBGN.js +6 -0
  29. package/dist/chunks/chunk-773TH7FN.js +2 -0
  30. package/dist/chunks/chunk-7E6T7GP5.js +2 -0
  31. package/dist/chunks/chunk-7ED24PP6.js +2 -0
  32. package/dist/chunks/chunk-7HPDGZOR.js +86 -0
  33. package/dist/chunks/chunk-7KWD2I6W.js +2 -0
  34. package/dist/chunks/chunk-7PXZ4X4P.js +2 -0
  35. package/dist/chunks/chunk-A6USMRWK.js +2 -0
  36. package/dist/chunks/chunk-ABD5M2D2.js +2 -0
  37. package/dist/chunks/chunk-ACYFMLWG.js +10 -0
  38. package/dist/chunks/chunk-AN525SPP.js +6 -0
  39. package/dist/chunks/chunk-APB2STJK.js +2 -0
  40. package/dist/chunks/chunk-AY64VY4E.js +2 -0
  41. package/dist/chunks/{chunk-G6JMQGX7.js → chunk-B7RFL4N2.js} +1 -1
  42. package/dist/chunks/chunk-BLXEAZCQ.js +12 -0
  43. package/dist/chunks/chunk-D74JEERO.js +5 -0
  44. package/dist/chunks/{chunk-U2YMBCX7.js → chunk-DARVPBZ4.js} +1 -1
  45. package/dist/chunks/chunk-DBK66CJP.js +8 -0
  46. package/dist/chunks/chunk-DDMZSZFL.js +1 -0
  47. package/dist/chunks/chunk-DIO5CB6U.js +2 -0
  48. package/dist/chunks/chunk-DMFUEUAZ.js +5 -0
  49. package/dist/chunks/chunk-DMVD2RFZ.js +2 -0
  50. package/dist/chunks/chunk-DUURYZOI.js +2 -0
  51. package/dist/chunks/chunk-DZUAT3TP.js +1 -0
  52. package/dist/chunks/chunk-EIEZHFIW.js +6 -0
  53. package/dist/chunks/chunk-EIRYMSEG.js +19 -0
  54. package/dist/chunks/{chunk-R27YGT77.js → chunk-EKM2D7JU.js} +1 -1
  55. package/dist/chunks/chunk-EQFGBL3O.js +2 -0
  56. package/dist/chunks/chunk-EYPCBBMS.js +2 -0
  57. package/dist/chunks/chunk-F4KOGISR.js +10 -0
  58. package/dist/chunks/chunk-F74GBN6K.js +2 -0
  59. package/dist/chunks/chunk-FEAKTSRS.js +2 -0
  60. package/dist/chunks/chunk-FFRFSDBM.js +2 -0
  61. package/dist/chunks/chunk-FTEOCCPB.js +23 -0
  62. package/dist/chunks/chunk-FUOEIDMA.js +8 -0
  63. package/dist/chunks/{chunk-BQAF5P7K.js → chunk-FV2R5RUN.js} +2 -2
  64. package/dist/chunks/chunk-FWIPHEVA.js +12 -0
  65. package/dist/chunks/chunk-FY5KHLMW.js +2 -0
  66. package/dist/chunks/chunk-G3RXYI2L.js +6 -0
  67. package/dist/chunks/chunk-GJ2ZJFDD.js +2 -0
  68. package/dist/chunks/chunk-GLDYJM7O.js +1 -0
  69. package/dist/chunks/chunk-GPVCOEUH.js +2 -0
  70. package/dist/chunks/chunk-GW766ZSO.js +5 -0
  71. package/dist/chunks/chunk-GWCHDF2C.js +4 -0
  72. package/dist/chunks/chunk-GZ7M5XBP.js +2 -0
  73. package/dist/chunks/chunk-H6IW2R22.js +140 -0
  74. package/dist/chunks/chunk-HCYX6RHP.js +2 -0
  75. package/dist/chunks/chunk-HDL5YSAA.js +2 -0
  76. package/dist/chunks/chunk-HIOKCIL7.js +2 -0
  77. package/dist/chunks/{chunk-IODUCRBA.js → chunk-HY3GOBFJ.js} +1 -1
  78. package/dist/chunks/chunk-HZEIRHEB.js +2 -0
  79. package/dist/chunks/chunk-I2NXNMRZ.js +2 -0
  80. package/dist/chunks/chunk-I7AQMAQI.js +33 -0
  81. package/dist/chunks/chunk-IZ6DLEVY.js +2 -0
  82. package/dist/chunks/chunk-J2TWKFML.js +1871 -0
  83. package/dist/chunks/chunk-JDEEWOD7.js +2 -0
  84. package/dist/chunks/chunk-JFXWI3EN.js +6 -0
  85. package/dist/chunks/chunk-JYKRR7E5.js +5 -0
  86. package/dist/chunks/chunk-KCJVFLBB.js +2 -0
  87. package/dist/chunks/{chunk-5CMKGD43.js → chunk-KG325WTN.js} +1 -1
  88. package/dist/chunks/chunk-KUERKVEU.js +3 -0
  89. package/dist/chunks/chunk-KVTBX2UP.js +2 -0
  90. package/dist/chunks/chunk-L3KS6MOV.js +2 -0
  91. package/dist/chunks/chunk-L6K7ERG5.js +2 -0
  92. package/dist/chunks/{chunk-MH3LHSGX.js → chunk-LQQNBVEB.js} +1 -1
  93. package/dist/chunks/{chunk-BTI4N7YO.js → chunk-M4JWQSV7.js} +1 -1
  94. package/dist/chunks/chunk-MQULU465.js +2 -0
  95. package/dist/chunks/chunk-MULXCKG7.js +10 -0
  96. package/dist/chunks/chunk-N4FFQPLR.js +2 -0
  97. package/dist/chunks/chunk-N73MU2C3.js +2 -0
  98. package/dist/chunks/chunk-NHQ36THU.js +3 -0
  99. package/dist/chunks/chunk-O6ULLQJ6.js +2 -0
  100. package/dist/chunks/chunk-O72BSKSO.js +2 -0
  101. package/dist/chunks/chunk-OGDADQGH.js +143 -0
  102. package/dist/chunks/chunk-OIUTWU6K.js +2 -0
  103. package/dist/chunks/chunk-OLLLZVHF.js +2 -0
  104. package/dist/chunks/chunk-OPNRWESL.js +3 -0
  105. package/dist/chunks/chunk-OQKJGTTO.js +4 -0
  106. package/dist/chunks/chunk-OQPJ7FJF.js +9 -0
  107. package/dist/chunks/{chunk-TERVLCRG.js → chunk-OS3LO5J3.js} +1 -1
  108. package/dist/chunks/chunk-OUVIWDL2.js +2 -0
  109. package/dist/chunks/chunk-PCSIOUHF.js +7 -0
  110. package/dist/chunks/chunk-PF5R6CMP.js +21 -0
  111. package/dist/chunks/chunk-PPAPVGJP.js +3 -0
  112. package/dist/chunks/chunk-PRGBLQVH.js +2 -0
  113. package/dist/chunks/chunk-PSGGOZFM.js +2 -0
  114. package/dist/chunks/chunk-PUZQU66L.js +2 -0
  115. package/dist/chunks/{chunk-NOTXPD2T.js → chunk-Q2QL6UWN.js} +1 -1
  116. package/dist/chunks/chunk-Q4TBTRIG.js +2 -0
  117. package/dist/chunks/chunk-Q5LEXXJG.js +16 -0
  118. package/dist/chunks/chunk-QDC4OW3S.js +2 -0
  119. package/dist/chunks/chunk-QEFHOJFE.js +7 -0
  120. package/dist/chunks/chunk-QHWGQ3A4.js +5 -0
  121. package/dist/chunks/chunk-QIKWJ2AA.js +11 -0
  122. package/dist/chunks/chunk-QNG27G3T.js +6 -0
  123. package/dist/chunks/chunk-QOGJAQDO.js +3 -0
  124. package/dist/chunks/chunk-QOTVNQDI.js +4 -0
  125. package/dist/chunks/{chunk-NNIRIUSY.js → chunk-RAXOSUSW.js} +1 -1
  126. package/dist/chunks/chunk-RNIAFXMB.js +50 -0
  127. package/dist/chunks/{chunk-SHQOIROR.js → chunk-S5ESN275.js} +3 -3
  128. package/dist/chunks/chunk-SDAUS5PY.js +2 -0
  129. package/dist/chunks/chunk-SDXFLO7J.js +5 -0
  130. package/dist/chunks/chunk-SH5CBAFC.js +2 -0
  131. package/dist/chunks/chunk-SWUEFLOH.js +2 -0
  132. package/dist/chunks/chunk-SYUKES6H.js +3 -0
  133. package/dist/chunks/chunk-T5AACNJI.js +2 -0
  134. package/dist/chunks/chunk-TRQQNFMO.js +4 -0
  135. package/dist/chunks/chunk-TVQAPBLZ.js +2 -0
  136. package/dist/chunks/chunk-UCPGRPWY.js +2 -0
  137. package/dist/chunks/chunk-UGL7WF3W.js +2 -0
  138. package/dist/chunks/{chunk-C6D4WAYN.js → chunk-UKMA4R6X.js} +2 -2
  139. package/dist/chunks/{chunk-4WEUCGJ3.js → chunk-VRIEKBBH.js} +1 -1
  140. package/dist/chunks/chunk-VYLGI3IH.js +13 -0
  141. package/dist/chunks/chunk-W45RKGM6.js +1 -0
  142. package/dist/chunks/chunk-WJ43MJ3F.js +2 -0
  143. package/dist/chunks/chunk-WMKYHXVM.js +3 -0
  144. package/dist/chunks/chunk-WN3V6KDN.js +3 -0
  145. package/dist/chunks/chunk-X4OSOOSU.js +3 -0
  146. package/dist/chunks/chunk-XDQMGUWL.js +2 -0
  147. package/dist/chunks/chunk-XTFPDQMH.js +3 -0
  148. package/dist/chunks/chunk-XVDFJ3ZF.js +2 -0
  149. package/dist/chunks/chunk-XW6HGSIT.js +8 -0
  150. package/dist/chunks/chunk-XXYGGNVM.js +2 -0
  151. package/dist/chunks/chunk-Y4OWBBDD.js +184 -0
  152. package/dist/chunks/chunk-YBT2NB32.js +2 -0
  153. package/dist/chunks/{chunk-QRAKXZOC.js → chunk-YOBN7KTF.js} +6 -6
  154. package/dist/chunks/chunk-YOQRYNLP.js +2 -0
  155. package/dist/chunks/chunk-YY7LEQGP.js +2 -0
  156. package/dist/chunks/chunk-Z4Z5UOZM.js +22 -0
  157. package/dist/chunks/chunk-Z54O534A.js +3 -0
  158. package/dist/chunks/chunk-ZCHXGRRU.js +2 -0
  159. package/dist/chunks/chunk-ZFSHBFG5.js +40 -0
  160. package/dist/chunks/chunk-ZGTOK7ZK.js +12 -0
  161. package/dist/chunks/{chunk-Q7AXHFZV.js → chunk-ZRDGQDZL.js} +1 -1
  162. package/dist/chunks/chunk-ZUJ3XUCP.js +2 -0
  163. package/dist/chunks/chunk-ZZWAQBA2.js +2 -0
  164. package/dist/chunks/cli-X25RSO2X.js +2 -0
  165. package/dist/chunks/configuration-command-6C5UO7GE.js +2 -0
  166. package/dist/chunks/connected-app-executor-IVLGQP65.js +2 -0
  167. package/dist/chunks/connected-evidence-GH2ATNEX.js +2 -0
  168. package/dist/chunks/connection-HTF6CC7M.js +2 -0
  169. package/dist/chunks/{continual-TTGJ6YTR.js → continual-6CQAMTTR.js} +3 -3
  170. package/dist/chunks/core-commands-A2DGGIPS.js +2 -0
  171. package/dist/chunks/datasets-7BNMVJOY.js +2 -0
  172. package/dist/chunks/desktop-test-3CUHVLXV.js +3 -0
  173. package/dist/chunks/dist-OMGUJYPD.js +2 -0
  174. package/dist/chunks/dist-VYC5VMQB.js +2 -0
  175. package/dist/chunks/{dist-FAJX2UBW.js → dist-ZVJPJLXR.js} +1 -1
  176. package/dist/chunks/enclave-QS4BUNDU.js +2 -0
  177. package/dist/chunks/evaluation-coordination-XEF5L7KZ.js +2 -0
  178. package/dist/chunks/experiment-improvements-KRX2DP27.js +2 -0
  179. package/dist/chunks/experiments-DFGQYA4O.js +2 -0
  180. package/dist/chunks/experiments-VFQGE4HC.js +2 -0
  181. package/dist/chunks/{extension-DWMY6D2R.js → extension-XKXXOP5N.js} +1 -1
  182. package/dist/chunks/{help-A72QDRNG.js → help-S7THC6IE.js} +1 -1
  183. package/dist/chunks/host-profile-evaluation-tools-NRLXL2S5.js +2 -0
  184. package/dist/chunks/host-profile-external-dataset-K3ICDHIP.js +2 -0
  185. package/dist/chunks/hosted-app-server-composition-HPL3CRXN.js +2 -0
  186. package/dist/chunks/hosted-experiment-improvement-NFSVS5TU.js +3 -0
  187. package/dist/chunks/hosted-harness-runtime-723S5ZSH.js +2 -0
  188. package/dist/chunks/hosted-profile-candidate-2S5LFUWD.js +3 -0
  189. package/dist/chunks/hosted-profile-compiler-2DQIFSXW.js +2 -0
  190. package/dist/chunks/hosted-profile-evaluation-control-76BTRTYD.js +2 -0
  191. package/dist/chunks/hosted-profile-evaluation-inspection-V6Z3A5XJ.js +3 -0
  192. package/dist/chunks/hosted-profile-evaluation-preparation-IDJYREW3.js +3 -0
  193. package/dist/chunks/hosted-tasksets-ANAE2PIW.js +2 -0
  194. package/dist/chunks/human-review-WR777ODH.js +2 -0
  195. package/dist/chunks/import-MLZUHITH.js +4 -0
  196. package/dist/chunks/learning-ACEVFL5M.js +2 -0
  197. package/dist/chunks/local-harness-improvement-runtime-JIQ6ZVDW.js +2 -0
  198. package/dist/chunks/local-harness-taskset-review-XVYTGAGK.js +2 -0
  199. package/dist/chunks/local-scope-HVF2GZ5W.js +2 -0
  200. package/dist/chunks/model-projects-QPO22JPA.js +2 -0
  201. package/dist/chunks/opchat-T4QTNEIY.js +3 -0
  202. package/dist/chunks/organizations-75L5DZDV.js +2 -0
  203. package/dist/chunks/{profile-NOZ6TVXL.js → profile-TFZMUEDR.js} +1 -1
  204. package/dist/chunks/profile-training-source-6GOT7AHM.js +2 -0
  205. package/dist/chunks/project-action-payload-7VGL7OER.js +2 -0
  206. package/dist/chunks/project-agent-6RRO233B.js +2 -0
  207. package/dist/chunks/published-experiment-source-DZFENAQA.js +2 -0
  208. package/dist/chunks/refiner-profile-service-UUIWFJVT.js +2 -0
  209. package/dist/chunks/runtime-A7OZXM43.js +6 -0
  210. package/dist/chunks/sandbox-command-IU5XFTJP.js +2 -0
  211. package/dist/chunks/{sandbox-template-LKGBDVJ4.js → sandbox-template-C4V6T36U.js} +1 -1
  212. package/dist/chunks/saved-work-6BMBFP43.js +2 -0
  213. package/dist/chunks/send-turn-XTAIS2JN.js +2 -0
  214. package/dist/chunks/src-INHPJ63Z.js +326 -0
  215. package/dist/chunks/{src-ZWJ5IO7A.js → src-LMC3K6LH.js} +1 -1
  216. package/dist/chunks/standalone-experiment-turn-owner-JCY5LL5R.js +2 -0
  217. package/dist/chunks/store-chat-workflows-S72HZXQR.js +18 -0
  218. package/dist/chunks/store-continual-support-reviews-HHA6NX7K.js +7 -0
  219. package/dist/chunks/store-conversation-serving-KPC62UEY.js +2 -0
  220. package/dist/chunks/store-create-improve-QV54XIZW.js +40 -0
  221. package/dist/chunks/store-datasets-RXJ33SUN.js +86 -0
  222. package/dist/chunks/store-evaluation-results-3F3P527G.js +7 -0
  223. package/dist/chunks/store-harness-evaluation-review-settings-I2R3HPO3.js +29 -0
  224. package/dist/chunks/store-harness-memory-VINCZ4GK.js +17 -0
  225. package/dist/chunks/store-harness-refinement-candidates-EA5KFQPH.js +21 -0
  226. package/dist/chunks/store-harness-workspaces-XUM4Z66X.js +2 -0
  227. package/dist/chunks/store-human-review-RAH7WMIP.js +7 -0
  228. package/dist/chunks/store-learned-preference-migration-validation-4CI2IRUF.js +2 -0
  229. package/dist/chunks/store-learning-WLG6KFIO.js +2 -0
  230. package/dist/chunks/store-learning-credentials-WZQJ4HPJ.js +2 -0
  231. package/dist/chunks/store-local-experiments-5LUJR7GI.js +97 -0
  232. package/dist/chunks/store-model-batch-review-YEGX327M.js +2 -0
  233. package/dist/chunks/store-model-configuration-5ZURQATB.js +3 -0
  234. package/dist/chunks/store-preference-comparison-LV32MHVL.js +6 -0
  235. package/dist/chunks/store-schedules-VGTEQVKH.js +53 -0
  236. package/dist/chunks/store-sidebar-file-bookmarks-VB5GTLFY.js +18 -0
  237. package/dist/chunks/store-sidebar-preferences-GWIOG2NH.js +16 -0
  238. package/dist/chunks/store-subagents-T7R2Z6TB.js +67 -0
  239. package/dist/chunks/store-task-inbox-JJTBW76C.js +33 -0
  240. package/dist/chunks/store-task-inventory-OB3F2APC.js +10 -0
  241. package/dist/chunks/store-taskset-drafts-EKQWWFYQ.js +9 -0
  242. package/dist/chunks/store-training-G6YLFSIR.js +70 -0
  243. package/dist/chunks/store-training-jobs-RC46YBF6.js +19 -0
  244. package/dist/chunks/store-training-models-6BA43IPP.js +49 -0
  245. package/dist/chunks/store-usage-IE2U2FD3.js +63 -0
  246. package/dist/chunks/store-work-evidence-QQDKM5AQ.js +8 -0
  247. package/dist/chunks/taskset-EQRFQBYM.js +2 -0
  248. package/dist/chunks/taskset-packages-XC6HEE3K.js +2 -0
  249. package/dist/chunks/{teams-bot-H7XT23XB.js → teams-bot-EAPGPTHZ.js} +1 -1
  250. package/dist/chunks/training-UF6RPI4T.js +2 -0
  251. package/dist/chunks/web-search-CZ3NCLPY.js +2 -0
  252. package/dist/chunks/workspaces-EKKE5NAC.js +2 -0
  253. package/dist/cli.js +1 -1
  254. package/dist/index.js +1 -1
  255. package/dist/web/assets/{App-CTlAPuCY.css → App-CaRMZoxo.css} +1 -1
  256. package/dist/web/assets/App-s-CJswyt.js +154 -0
  257. package/dist/web/assets/{AppDialog-CPHTPqrx.js → AppDialog-t2Fx5tK3.js} +1 -1
  258. package/dist/web/assets/{AppTerminalPanel-BVj5Tj93.js → AppTerminalPanel-Dj1Y32oI.js} +2 -2
  259. package/dist/web/assets/{AppsView-O69zEBY3.js → AppsView-BYE5EBDJ.js} +1 -1
  260. package/dist/web/assets/{BrowserSidebar-Pr_Kpe8p.js → BrowserSidebar-jhWi4rVm.js} +1 -1
  261. package/dist/web/assets/{CartesianChart-JPqo6YOf.js → CartesianChart-C1DIx0Ia.js} +1 -1
  262. package/dist/web/assets/{CollaborationTabs-CAJcQFn2.js → CollaborationTabs-Bdr-HmOL.js} +1 -1
  263. package/dist/web/assets/{CommandMenu-B-w53n9A.js → CommandMenu-Ux2yOHAc.js} +1 -1
  264. package/dist/web/assets/{CommunityView-DbZKK8_P.js → CommunityView-DPEeVKFn.js} +1 -1
  265. package/dist/web/assets/{ComposerCreateImproveStrip-3_083PF4.js → ComposerCreateImproveStrip-CEgh4OtN.js} +1 -1
  266. package/dist/web/assets/{GetStartedView-D7JGm_6c.js → GetStartedView-CFHP0AaI.js} +1 -1
  267. package/dist/web/assets/{HostedModelLearningReview-DwgMfZ7_.js → HostedModelLearningReview-D8BGTPVN.js} +1 -1
  268. package/dist/web/assets/{HostedModelLearningSettings-JRfQadRl.js → HostedModelLearningSettings-JS1S7vNO.js} +1 -1
  269. package/dist/web/assets/{LabModelVersionDetailPage-BUYflJY_.js → LabModelVersionDetailPage-Dx5Q3xV2.js} +1 -1
  270. package/dist/web/assets/{LabSkillSidebar-BBiqk7Rf.js → LabSkillSidebar-BxffN-pN.js} +1 -1
  271. package/dist/web/assets/{LabsRoute-Ci6vUnSd.js → LabsRoute-CyYF8-dw.js} +4 -4
  272. package/dist/web/assets/{MainChatThread-BQK3oI2N.js → MainChatThread-DZpcFRFl.js} +2 -2
  273. package/dist/web/assets/MainPane-5DTtwVCk.js +65 -0
  274. package/dist/web/assets/MainPane-BIM_UJ3q.css +1 -0
  275. package/dist/web/assets/{MarkdownText-DOdOVFXL.js → MarkdownText-BR4V6lNO.js} +21 -21
  276. package/dist/web/assets/{NativeSkillSidebar-CRI_ri8z.js → NativeSkillSidebar-DU9IEgIO.js} +1 -1
  277. package/dist/web/assets/{NewExperienceSwitcher-DhYtfE68.js → NewExperienceSwitcher-mIy6FzCj.js} +1 -1
  278. package/dist/web/assets/{NewProjectDialog-D8sy1gOz.js → NewProjectDialog-RfTZTHxl.js} +1 -1
  279. package/dist/web/assets/{OutputsPage-CbWgrhXA.js → OutputsPage-Cr1Spf7S.js} +1 -1
  280. package/dist/web/assets/{ProjectsPage-DLB67lyA.js → ProjectsPage-CE6QUB-b.js} +1 -1
  281. package/dist/web/assets/{RightChatPanelStack-ozSKnDyX.js → RightChatPanelStack-T6VRWuHo.js} +1 -1
  282. package/dist/web/assets/RightSidebarHomePanel-CK0rP3WT.js +1 -0
  283. package/dist/web/assets/{ScheduledWorkPage-Cafv_QnR.js → ScheduledWorkPage-vOrYv8pp.js} +1 -1
  284. package/dist/web/assets/SettingsView-DCKVrfjj.js +5 -0
  285. package/dist/web/assets/SettingsView-Dulr_xlq.css +1 -0
  286. package/dist/web/assets/{TeamChatView-vIrmXOY_.js → TeamChatView-Bwrjr-vk.js} +2 -2
  287. package/dist/web/assets/{TerminalOverlay-CAmF__Dq.js → TerminalOverlay-DhPoKZAq.js} +1 -1
  288. package/dist/web/assets/TrainingCreationPanel-BXHfohNm.js +1 -0
  289. package/dist/web/assets/{TrainingDraftPanel-D7XZePAk.js → TrainingDraftPanel-C9cRX5qf.js} +1 -1
  290. package/dist/web/assets/{UsageSettingsSection-CYTmp7PG.js → UsageSettingsSection-CrdcSGeW.js} +1 -1
  291. package/dist/web/assets/WorkSidebarPanel-DSSikNFQ.js +1 -0
  292. package/dist/web/assets/{WorkspaceDiffPanel-DQGoIjH9.js → WorkspaceDiffPanel-BAFo0CPN.js} +6 -6
  293. package/dist/web/assets/{WorkspaceEnvironmentMenu-c1pHDskn.js → WorkspaceEnvironmentMenu-BVHAhwnJ.js} +1 -1
  294. package/dist/web/assets/WorkspaceGitDialogs-CwVoiDQ2.js +1 -0
  295. package/dist/web/assets/{WorkspaceMonacoEditor-BCKzvSj2.js → WorkspaceMonacoEditor-TxLyhzNp.js} +3 -3
  296. package/dist/web/assets/{arrow-up-right-CP4hZdrJ.js → arrow-up-right-C9aE8Mfz.js} +1 -1
  297. package/dist/web/assets/{chunk-NOJECMB7-Bhcms-w5.js → chunk-P3BRSSRD-DUGfuKA8.js} +1 -1
  298. package/dist/web/assets/{clipboard-BgrXorn-.js → clipboard-Dk158Qp4.js} +1 -1
  299. package/dist/web/assets/{cloud-upload-B_zYztb6.js → cloud-upload-k9eqBsHr.js} +1 -1
  300. package/dist/web/assets/{cssMode-DanjGgA8.js → cssMode-CO35ARZp.js} +1 -1
  301. package/dist/web/assets/{folder-open-CdVKbtGq.js → folder-open-sYgceW_f.js} +1 -1
  302. package/dist/web/assets/{folder-plus-Cc5KElB6.js → folder-plus-CS0R49m9.js} +1 -1
  303. package/dist/web/assets/{git-commit-horizontal-CjGIIgRi.js → git-commit-horizontal-DrGxH2h4.js} +1 -1
  304. package/dist/web/assets/{htmlMode-DRGDF_UL.js → htmlMode-REMmzdfq.js} +1 -1
  305. package/dist/web/assets/index-3iPNbbER.css +1 -0
  306. package/dist/web/assets/{index-BE-wXZ5R.js → index-C8aCGagb.js} +2 -2
  307. package/dist/web/assets/{info-BLj0RvhA.js → info-DLdbiUrh.js} +1 -1
  308. package/dist/web/assets/{jsonMode-CCu0j2GD.js → jsonMode-KEdMfkIf.js} +1 -1
  309. package/dist/web/assets/{lspLanguageFeatures-s_Lhm7P6.js → lspLanguageFeatures-5KZwEoxW.js} +1 -1
  310. package/dist/web/assets/{minimize-2-Cyg_zD9z.js → minimize-2-CqcI4zcM.js} +1 -1
  311. package/dist/web/assets/{monaco.contribution-CY7mRgOB.js → monaco.contribution-BJGj65F9.js} +2 -2
  312. package/dist/web/assets/{monaco.contribution-CAzXvYkn.js → monaco.contribution-Cly9Wt7L.js} +2 -2
  313. package/dist/web/assets/{monaco.contribution-mUPNK9ra.js → monaco.contribution-DO10L0zW.js} +2 -2
  314. package/dist/web/assets/{monaco.contribution-aUeLcBEg.js → monaco.contribution-omszXBEj.js} +2 -2
  315. package/dist/web/assets/{monitor-DZvOs_wC.js → monitor-BFVCcbxp.js} +1 -1
  316. package/dist/web/assets/{play-BJPzemuY.js → play-C469pVZq.js} +1 -1
  317. package/dist/web/assets/{python-B_qnnVaG.js → python-Dw0YcVy9.js} +1 -1
  318. package/dist/web/assets/{save-BDy9tA3E.js → save-CtSjPydi.js} +1 -1
  319. package/dist/web/assets/{square-Cb2c5td4.js → square-BuImvLhT.js} +1 -1
  320. package/dist/web/assets/{toggleHighContrast-MhO1JLyR.js → toggleHighContrast-DjCO9lIP.js} +1 -1
  321. package/dist/web/assets/{tsMode-DfBXJb9V.js → tsMode-BAOnxKd6.js} +1 -1
  322. package/dist/web/assets/{upload-D56kThRh.js → upload-2JkFZo3h.js} +1 -1
  323. package/dist/web/assets/{useLocalAgentSchedules-DMnGfswi.js → useLocalAgentSchedules-BNqAisfS.js} +1 -1
  324. package/dist/web/assets/useProviderSettings-C4L4wDoh.js +5 -0
  325. package/dist/web/assets/{useProviderSettings-Bw-csWbH.css → useProviderSettings-CmL_BaxP.css} +1 -1
  326. package/dist/web/assets/{useSessionTurnCache-ClAY8gze.js → useSessionTurnCache-BHU2-Jmz.js} +1 -1
  327. package/dist/web/assets/{wifi-off-C9lWJmVm.js → wifi-off-CpOAH62M.js} +1 -1
  328. package/dist/web/assets/{workers-BYzrH8by.js → workers-0QvlA2T5.js} +1 -1
  329. package/dist/web/assets/{yaml-D3T8UkT3.js → yaml-BK3qxo7D.js} +1 -1
  330. package/dist/web/index.html +2 -2
  331. package/package.json +1 -1
  332. package/dist/chunks/actions-command-WTFZA7LF.js +0 -2
  333. package/dist/chunks/app-server-runtime-2RM3N4I6.js +0 -2
  334. package/dist/chunks/apps-KDNWYO3G.js +0 -2
  335. package/dist/chunks/chunk-2DFR7PJ4.js +0 -2460
  336. package/dist/chunks/chunk-4CRM2ADK.js +0 -2
  337. package/dist/chunks/chunk-55G6B54U.js +0 -6
  338. package/dist/chunks/chunk-73G5UYBB.js +0 -12
  339. package/dist/chunks/chunk-ARQEJOEK.js +0 -33
  340. package/dist/chunks/chunk-CGBI2VYJ.js +0 -2
  341. package/dist/chunks/chunk-GGIG3XU7.js +0 -3
  342. package/dist/chunks/chunk-JIMU3KDA.js +0 -24
  343. package/dist/chunks/chunk-JUJSA7KI.js +0 -22
  344. package/dist/chunks/chunk-K5SBVO3B.js +0 -195
  345. package/dist/chunks/chunk-KD3QVRIJ.js +0 -21
  346. package/dist/chunks/chunk-L4235TRQ.js +0 -140
  347. package/dist/chunks/chunk-MVF3F5QS.js +0 -2
  348. package/dist/chunks/chunk-OULAKUIN.js +0 -2
  349. package/dist/chunks/chunk-OWNLDB2O.js +0 -2
  350. package/dist/chunks/chunk-QDHMP5FS.js +0 -2
  351. package/dist/chunks/chunk-QKD5OMDI.js +0 -2
  352. package/dist/chunks/chunk-R2BSIRYL.js +0 -3
  353. package/dist/chunks/chunk-STDMBJOQ.js +0 -9
  354. package/dist/chunks/chunk-T4QGDQHP.js +0 -4
  355. package/dist/chunks/chunk-USMZT5FZ.js +0 -18
  356. package/dist/chunks/chunk-VJEZPDBS.js +0 -5
  357. package/dist/chunks/chunk-WDFLCNRC.js +0 -8
  358. package/dist/chunks/chunk-WZYRAR7X.js +0 -16
  359. package/dist/chunks/chunk-YDT7L3VZ.js +0 -24
  360. package/dist/chunks/chunk-YUPBAWBJ.js +0 -554
  361. package/dist/chunks/cli-465VC2WP.js +0 -2
  362. package/dist/chunks/configuration-command-LAAP2EXT.js +0 -2
  363. package/dist/chunks/connected-evidence-XM626247.js +0 -2
  364. package/dist/chunks/core-commands-W7EK552V.js +0 -2
  365. package/dist/chunks/datasets-QJWYTTQL.js +0 -2
  366. package/dist/chunks/desktop-test-3B2D34NF.js +0 -3
  367. package/dist/chunks/dist-HUAE2KFZ.js +0 -2
  368. package/dist/chunks/evaluation-coordination-2MONR4AX.js +0 -2
  369. package/dist/chunks/experiment-improvements-WVQ5FK46.js +0 -2
  370. package/dist/chunks/experiments-S5UQ32QB.js +0 -2
  371. package/dist/chunks/hosted-experiment-improvement-2OWOQLHC.js +0 -3
  372. package/dist/chunks/hosted-harness-runtime-TGFMAV7W.js +0 -2
  373. package/dist/chunks/hosted-profile-candidate-WQSI6HZO.js +0 -3
  374. package/dist/chunks/hosted-profile-compiler-Z2A4TEA6.js +0 -2
  375. package/dist/chunks/hosted-profile-evaluation-control-FKGARUEE.js +0 -2
  376. package/dist/chunks/hosted-profile-evaluation-inspection-QOY2JKV4.js +0 -3
  377. package/dist/chunks/hosted-profile-evaluation-preparation-WVP6CALP.js +0 -3
  378. package/dist/chunks/human-review-TGHQKXFZ.js +0 -2
  379. package/dist/chunks/import-4UE5XNSG.js +0 -4
  380. package/dist/chunks/learning-R2XBMMEM.js +0 -2
  381. package/dist/chunks/opchat-WULL6CUP.js +0 -3
  382. package/dist/chunks/organizations-I37HISVX.js +0 -2
  383. package/dist/chunks/project-agent-T6XKC54C.js +0 -2
  384. package/dist/chunks/sandbox-command-STB47FRY.js +0 -2
  385. package/dist/chunks/src-T3KWWCAH.js +0 -322
  386. package/dist/chunks/taskset-RNYDR4GS.js +0 -2
  387. package/dist/chunks/training-M6FAPRSJ.js +0 -2
  388. package/dist/chunks/workspaces-MFZ3OO6O.js +0 -2
  389. package/dist/web/assets/App-CLFfy_Av.js +0 -154
  390. package/dist/web/assets/MainPane-D3ojiN-p.js +0 -18
  391. package/dist/web/assets/MainPane-DOWsSew1.css +0 -1
  392. package/dist/web/assets/RightSidebarHomePanel-CKs3OwhD.js +0 -1
  393. package/dist/web/assets/SettingsView-BnANbPLS.css +0 -1
  394. package/dist/web/assets/SettingsView-T1vYDPjh.js +0 -5
  395. package/dist/web/assets/TrainingCreationPanel-D75K0yk5.js +0 -1
  396. package/dist/web/assets/WorkSidebarPanel-CODMjVHY.js +0 -1
  397. package/dist/web/assets/WorkspaceGitDialogs-DrVtapQQ.js +0 -1
  398. package/dist/web/assets/index-B5re-RJy.css +0 -1
  399. package/dist/web/assets/useProviderSettings-Bv5B9eNk.js +0 -5
@@ -1,14 +1,14 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/WorkspaceMonacoEditor-BCKzvSj2.js","assets/index-BE-wXZ5R.js","assets/index-B5re-RJy.css","assets/WorkspaceMonacoEditor-BwKcXIZw.css"])))=>i.map(i=>d[i]);
2
- import{j as e,r as l,_ as ka}from"./index-BE-wXZ5R.js";import{T as wa,F as ya,a as Sa,M as Na,d as Ca,i as Ks,h as Ra,j as $a,f as Gs,I as Fa}from"./MarkdownText-DOdOVFXL.js";import{_ as Et,o as ds,s as te,b as Ea,n as un,bH as Pa,e as ge,G as ot,aH as qs,aC as fn,ba as Pe,R as z,bZ as Pt,by as At,bw as Ue,ax as is,b_ as Aa,b3 as La,b$ as Da,b4 as _a,F as Ta,E as pn,t as Ma,X as Xs,p as za,b5 as Ia,aF as Wa,aG as Ba,bV as Oa,c0 as Ua,av as Zs,c1 as Ha,bm as Va,c2 as rs,c3 as Ka,c4 as ls,c5 as Ga,q as qa,T as hn,Q as Xa,c6 as ts,c7 as Za,c8 as os,bF as Re,c9 as Qa,ca as Qs,cb as Ya,cc as Ja,cd as ei}from"./App-CLFfy_Av.js";import{t as ti,a as si,b as ni,m as ai,s as ii,d as ri,f as li,c as oi}from"./training-model-data-CKOkpBBL.js";import{F as Nt}from"./folder-open-CdVKbtGq.js";import{I as Ys}from"./info-BLj0RvhA.js";import{M as ci}from"./minimize-2-Cyg_zD9z.js";import{S as di}from"./save-BDy9tA3E.js";import{C as ui}from"./clipboard-BgrXorn-.js";const mn=Et(["local","sandbox"]),fi=Et(["pinned","saved_for_later"]),pi=ds({id:te().min(1),workspaceKind:mn,workspaceId:te().min(1),workspaceName:te().min(1),path:te().min(1),status:fi,order:un().int().nonnegative().nullable().default(null),sourceSessionId:te().min(1).nullable().default(null),available:Ea().default(!0),createdAt:te().min(1),updatedAt:te().min(1)});ds({items:Pa(pi)});ds({workspaceKind:mn,workspaceId:te().trim().min(1),workspaceName:te().trim().min(1),path:te().trim().min(1),status:Et(["pinned","saved_for_later","none"]),order:un().int().nonnegative().nullable().optional(),sourceSessionId:te().trim().min(1).nullable().optional()});Et(["pin","save_for_later","remove","list"]);function cs(t){let s=t.trim().replaceAll("\\","/");if(s=s.replace(/^(?:workspace|sandbox):file:/,""),s=s.replace(/^\/workspace\/app\//,""),s=s.replace(/^\.\//,""),!s||s.startsWith("/"))throw new Error("File path must be relative to the workspace.");const n=s.split("/").filter(a=>a&&a!==".");if(n.some(a=>a===".."))throw new Error("File path cannot leave the workspace.");if(n.length===0)throw new Error("File path is required.");return n.join("/")}function hi(t){return["sidebar-file",t.workspaceKind,encodeURIComponent(t.workspaceId),encodeURIComponent(cs(t.path))].join(":")}const mi=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],xi=ge("text-align-start",mi);const bi=[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]],gi=ge("chevrons-up",bi);const ji=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],vi=ge("columns-2",ji);const ki=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],wi=ge("eye-off",ki);const yi=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}]],Si=ge("panel-top",yi);const Ni=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],Ci=ge("plug",Ni);const Ri=[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]],$i=ge("redo-2",Ri);const Fi=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],Ei=ge("undo-2",Fi);function Pi({createRuntime:t,goalRuntime:s,subagentRuntime:n=null,onRunSubagentLifecycleAction:a}){const i=t?"Create/Improve Details":"Goal Details",u=t?Z(t.run.state):n?.activeCount?n.label:s?.actionLabel??"No active goal";return e.jsxs("div",{className:"goal-details-view","aria-label":i,children:[e.jsxs("div",{className:"goal-details-header",children:[e.jsxs("div",{className:"goal-details-title",children:[e.jsx(ot,{size:15,"aria-hidden":"true"}),e.jsx("span",{children:i})]}),e.jsx("span",{className:`goal-details-state ${Zi(t?.run.state??null)}`,children:u})]}),e.jsx("div",{className:"goal-details-body",children:t?e.jsx(Ai,{runtime:t}):s||n?e.jsx(Di,{goalRuntime:s,subagentRuntime:n,onRunSubagentLifecycleAction:a}):e.jsx(Xi,{})})]})}function Ai({runtime:t}){const s=t.run,n=s.plan,a=qs(n?.metadata)??qs(s.metadata),i=s.questions,u=i.filter(o=>o.status==="pending"),c=s.sourceRefs,d=s.checkRefs,p=s.state,x=s.target.kind==="agent"?s.target.defaultActionKey:null;return e.jsxs(e.Fragment,{children:[e.jsx(V,{title:"Current Work",children:e.jsx(rt,{rows:[["State",Z(p)],["Operation",s.operation],["Target",Z(s.target.kind)],["Name",s.target.displayName??s.target.id??"Pending"],["Target ID",s.target.id??"Pending"],["Default action",x??n?.defaultChatAction.key??"Pending"],["Adapter",Z(s.adapter.kind)],["Run",s.id],["Revision",String(s.revision)]]})}),e.jsx(V,{title:"Plan",children:n?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"goal-details-summary",children:n.summary}),e.jsx(rt,{rows:[["Objective",n.objective],["Context",n.capturedContextSummary],["Status",Z(n.status)],["Plan ID",n.id],["Run ID",n.runId],["Approval",n.approvalId??"Pending"],["Approved",n.approvedAt??"Not approved"]]})]}):u.length?e.jsx("p",{className:"goal-details-summary",children:"Waiting for answers before the model finalizes the Create plan."}):e.jsx("p",{className:"goal-details-summary",children:"The model is preparing the Create plan."})}),a?e.jsxs(V,{title:"Action Shape",children:[e.jsx(rt,{rows:[["Mode",a.label],["Default action",a.defaultActionKey??"None"],["Direct action",a.directActionHint??"None planned"],["Artifacts",a.artifactPolicy]]}),e.jsx("p",{className:"goal-details-note",children:a.detail})]}):null,i.length?e.jsx(V,{title:"Questions",children:e.jsx("div",{className:"goal-details-list",children:i.map(o=>e.jsxs("article",{className:"goal-details-list-item",children:[e.jsxs("div",{children:[e.jsx("strong",{children:o.title}),e.jsx("span",{className:`goal-details-inline-state ${o.status}`,children:Z(o.status)})]}),e.jsx("p",{children:o.prompt}),o.answer?e.jsxs("small",{children:["Answer: ",o.answer.label??o.answer.value]}):o.options.length?e.jsxs("small",{children:["Options: ",o.options.map(b=>b.label).join(", ")]}):null]},o.id))})}):null,n?.requirements.length?e.jsx(V,{title:"Setup Requirements",children:e.jsx("div",{className:"goal-details-list",children:n.requirements.map(o=>e.jsxs("article",{className:"goal-details-list-item",children:[e.jsxs("div",{children:[e.jsx("strong",{children:o.name}),e.jsx("span",{className:`goal-details-inline-state ${o.status}`,children:Z(o.status)})]}),e.jsxs("small",{children:[Z(o.kind),o.detail?`: ${o.detail}`:""]})]},`${o.kind}:${o.name}`))})}):null,n?.sourcePlan.length?e.jsx(V,{title:"Source Plan",children:e.jsx(St,{refs:n.sourcePlan.map(o=>({id:`${o.operation}:${o.path}`,primary:o.path,secondary:`${Z(o.operation)}: ${o.reason}`}))})}):null,n?.checks.length?e.jsx(V,{title:"Checks",children:e.jsx(St,{refs:n.checks.map(o=>({id:o.name,primary:o.name,secondary:`${o.required?"Required":"Optional"}: ${o.command}`}))})}):null,c.length||d.length?e.jsx(V,{title:"Run Refs",children:e.jsx(St,{refs:[...c.map(o=>({id:`source:${o}`,primary:o,secondary:"Source ref"})),...d.map(o=>({id:`check:${o}`,primary:o,secondary:"Check ref"}))]})}):null,e.jsx(Li,{run:s}),s.blockedReason?e.jsx(V,{title:"Blocked",children:e.jsxs("div",{className:"goal-details-alert",children:[e.jsx(fn,{size:15}),e.jsx("span",{children:s.blockedReason})]})}):null,e.jsx(V,{title:"Raw State",children:e.jsxs("details",{className:"goal-details-raw",children:[e.jsx("summary",{children:"Show structured payload"}),e.jsx("pre",{children:JSON.stringify(s,null,2)})]})})]})}function Li({run:t}){const s=[...t.context.attachments.map(i=>({id:`attachment:${i.id??i.name}`,primary:i.name,secondary:i.ref??i.mediaType??"Attachment"})),...t.context.apps.map(i=>({id:`app:${i.id}`,primary:i.name,secondary:i.required?"Required app context":"Optional app context"})),...t.context.tools.map(i=>({id:`tool:${i.name}`,primary:i.name,secondary:i.outputSummary??i.inputSummary??"Tool context"})),...t.context.targetRepoAssumptions.map(i=>({id:`target:${i}`,primary:i,secondary:"Target assumption"}))],n=t.workflowCapture,a=n?[...n.files.map(i=>({id:`workflow-file:${i}`,primary:i,secondary:"Captured file"})),...n.outputArtifacts.map(i=>({id:`workflow-artifact:${i}`,primary:i,secondary:"Output artifact"})),...n.traceRefs.map(i=>({id:`workflow-trace:${i}`,primary:i,secondary:"Trace"}))]:[];return!s.length&&!a.length?null:e.jsx(V,{title:"Context",children:e.jsx(St,{refs:[...s,...a]})})}function Di({goalRuntime:t,subagentRuntime:s,onRunSubagentLifecycleAction:n}){return e.jsxs(e.Fragment,{children:[t?e.jsxs(V,{title:"Goal",children:[e.jsx("p",{className:"goal-details-summary",children:t.objective}),e.jsx(rt,{rows:[["Status",t.actionLabel],["Runtime",t.timeLabel],["Detail",t.detail]]})]}):null,s?e.jsx(_i,{runtime:s,onRunSubagentLifecycleAction:n}):null,e.jsx(V,{title:"Raw State",children:e.jsxs("details",{className:"goal-details-raw",children:[e.jsx("summary",{children:"Show structured payload"}),e.jsx("pre",{children:JSON.stringify({goalRuntime:t,subagentRuntime:s},null,2)})]})})]})}function _i({runtime:t,onRunSubagentLifecycleAction:s}){const[n,a]=l.useState(null),[i,u]=l.useState(null);Pe(i);const c=async(d,p)=>{if(!s)return;const x=`${d}:${p}`;a(x),u(null);try{await s({runId:d,action:p})}catch(o){u(o instanceof Error?o.message:String(o))}finally{a(o=>o===x?null:o)}};return e.jsxs(e.Fragment,{children:[e.jsxs(V,{title:"Subagents",children:[e.jsx(rt,{rows:[["Latest update",Oi(t)],["Active",String(t.activeCount)],["Completed",String(t.completedCount)],["Failed",String(t.failedCount)],["Cancelled",String(t.cancelledCount)],["Paused",String(t.needsResumeCount)],["Terminal",String(t.terminalCount)],["Usage",Ui(t.usage.totalTokens,t.usage.requestCount)],["Evidence",String(t.evidenceRefs.length)],["Checks",String(t.testsRunCount)]]}),t.blockers.length>0?e.jsx("ul",{className:"goal-details-list compact",children:t.blockers.slice(0,4).map(d=>e.jsxs("li",{className:"goal-details-list-item",children:[e.jsx("span",{className:`goal-details-inline-state ${d.status}`,children:d.status}),e.jsxs("div",{children:[e.jsx("strong",{children:Ct(d.roleId)}),e.jsx("p",{children:d.message})]})]},`${d.runId}:${d.message}`))}):null,e.jsx("ul",{className:"goal-details-list",children:t.runs.slice(0,8).map(d=>e.jsxs("li",{className:"goal-details-list-item",children:[e.jsx("span",{className:`goal-details-inline-state ${d.status}`,children:d.status}),e.jsxs("div",{children:[e.jsx("strong",{children:Ct(d.roleId)}),e.jsx("p",{children:d.objective}),d.report?.summary?e.jsx("small",{children:d.report.summary}):null,s?e.jsx(Mi,{pendingAction:n,run:d,onRun:c}):null]})]},d.id))})]}),t.finalResults.length>0?e.jsx(Ti,{results:t.finalResults}):null]})}function Ti({results:t}){return e.jsx(V,{title:"Child Results",children:e.jsx("ol",{className:"goal-details-task-graph",children:t.slice(0,6).map(s=>e.jsxs("li",{className:"goal-details-task-node",children:[e.jsxs("div",{className:"goal-details-task-node-header",children:[e.jsx("span",{className:`goal-details-inline-state ${s.status}`,children:s.status}),e.jsxs("div",{children:[e.jsx("strong",{children:Ct(s.roleId)}),e.jsx("small",{children:s.objective})]})]}),e.jsx("p",{children:s.summary}),e.jsxs("div",{className:"goal-details-task-node-meta",children:[e.jsxs("span",{children:[s.refs.length," refs"]}),e.jsxs("span",{children:[s.testsRun.length+s.validationAttempts.length," checks"]}),e.jsxs("span",{children:[s.blockers.length," blockers"]}),e.jsx("span",{children:s.confidence?`${Z(s.confidence)} confidence`:"Confidence unknown"})]}),s.findings.length>0?e.jsxs("small",{children:["Findings: ",$e(s.findings,3)]}):null,s.changedFiles.length>0?e.jsxs("small",{children:["Files: ",$e(s.changedFiles,4)]}):null,s.testsRun.length>0?e.jsxs("small",{children:["Tests: ",$e(s.testsRun,3)]}):null,s.validationAttempts.length>0?e.jsxs("small",{children:["Validation: ",$e(s.validationAttempts,2)]}):null,s.refs.length>0?e.jsxs("small",{children:["Refs: ",$e(s.refs.map(Hi),4)]}):null,s.blockers.length>0?e.jsxs("small",{children:["Blockers: ",$e(s.blockers,3)]}):null,s.workspaceRetention?e.jsxs("small",{children:["Workspace: ",Ki(s.workspaceRetention)]}):null,s.importantMessages.length>0?e.jsxs("small",{children:["Messages: ",$e(s.importantMessages.map(Vi),2)]}):null]},s.runId))})})}function Mi({pendingAction:t,run:s,onRun:n}){const a=zi(s);return a.length===0?null:e.jsx("div",{className:"goal-details-actions",children:a.map(i=>{const u=`${s.id}:${i}`,c=t===u;return e.jsx("button",{type:"button",disabled:!!t,onClick:()=>{n(s.id,i)},children:c?"Working...":Ii(i)},i)})})}function zi(t){const s=[],n=Wi(t),a=Bi(t);return n&&s.push("cleanup"),a&&s.push("archive"),s}function Ii(t){return t==="cleanup"?"Clean":t==="archive"?"Archive":"Clean + archive"}function Wi(t){if(!xn(t))return!1;const s=lt(t.metadata);if(!s?.subagentWorkspace&&!s?.workspaceHandoff)return!1;const n=lt(s.lifecycleCleanup),a=lt(n?.workspaceCleanup),i=bn(a?.status);return i!=="removed"&&i!=="deleted"&&i!=="retained"&&i!=="skipped"}function Bi(t){if(!t.childSessionId||!xn(t))return!1;const s=lt(lt(t.metadata)?.childSessionArchive),n=bn(s?.status);return n!=="archived"&&n!=="already_archived"}function xn(t){return t.status==="completed"||t.status==="failed"||t.status==="cancelled"}function Oi(t){const s=t.latestMeaningfulUpdate;return s?`${Ct(s.roleId)} ${s.status}: ${s.message}`:"No structured update"}function Ui(t,s){if(t<=0&&s<=0)return"0 tokens";const n=`${s} ${s===1?"request":"requests"}`;return`${Gi(t)} tokens · ${n}`}function Ct(t){return t.slice(0,1).toUpperCase()+t.slice(1).replace(/[-_]+/g," ")}function Hi(t){return`${t.kind}: ${t.label}`}function Vi(t){return`${Z(t.kind)}: ${t.body}`}function Ki(t){const s=t.expiresAt?`until ${qi(t.expiresAt)}`:"for inspection",n=t.trigger?` · ${Z(t.trigger)}`:"";return`retained ${s}${n}`}function $e(t,s){const n=t.slice(0,s),a=t.length-n.length;return a>0?`${n.join(", ")} +${a}`:n.join(", ")}function Gi(t){if(t<1e3)return String(t);if(t>=1e6){const n=t/1e6;return`${Js(n,n<10?2:1)}M`}const s=t/1e3;return`${Js(s,s<10?1:0)}k`}function qi(t){const s=new Date(t);return Number.isNaN(s.getTime())?t:s.toLocaleString([],{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function Js(t,s){return t.toFixed(s).replace(/\.0+$/,"").replace(/(\.\d*?)0+$/,"$1")}function Xi(){return e.jsxs("div",{className:"goal-details-empty",children:[e.jsx(ot,{size:18}),e.jsx("span",{children:"No active Goal or Create workflow."})]})}function V({children:t,title:s}){return e.jsxs("section",{className:"goal-details-section",children:[e.jsx("h2",{children:s}),t]})}function rt({rows:t}){return e.jsx("dl",{className:"goal-details-grid",children:t.map(([s,n])=>e.jsxs("div",{children:[e.jsx("dt",{children:s}),e.jsx("dd",{children:n})]},s))})}function St({refs:t}){return e.jsx("ul",{className:"goal-details-ref-list",children:t.map(s=>e.jsxs("li",{children:[e.jsx("code",{title:s.primary,children:s.primary}),e.jsx("span",{children:s.secondary})]},s.id))})}function lt(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function bn(t){return typeof t=="string"&&t.trim()?t.trim():null}function Z(t){return t.split(/[_-]/g).filter(Boolean).map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join(" ")}function Zi(t){return t==="ready_local"||t==="published_hosted"?"success":t==="blocked"||t==="failed"||t==="cancelled"?"danger":t==="awaiting_questions"||t==="awaiting_plan_approval"?"warning":"active"}function Qi({sandboxId:t,connection:s}){const[n,a]=l.useState(null),[i,u]=l.useState([]),[c,d]=l.useState(null),[p,x]=l.useState(null),[o,b]=l.useState(null),[S,k]=l.useState(null);Pe(o,{prefix:"Sandbox"}),Pe(S,{prefix:"Sandbox integrations"});const N=n?.integrationLeases??[],F=l.useMemo(()=>i.filter(v=>v.status==="active"),[i]),T=l.useMemo(()=>Ji(n),[n]),I=l.useCallback(async()=>{if(!s){b("OpenPond App server is not connected.");return}if(!t){a(null),u([]),b(null);return}d("summary"),b(null);try{const v=await z.sandbox(s,t),$=await z.integrationConnections(s,en(v.sandbox));a(v.sandbox),u($.connections),k(null)}catch(v){b(v instanceof Error?v.message:String(v))}finally{d(null)}},[s,t]),K=l.useCallback(async()=>{if(!(!s||!n)){x("load"),k(null);try{const[v,$]=await Promise.all([z.integrationConnections(s,en(n)),z.sandboxIntegrationLeases(s,n.id)]);u(v.connections),a($.sandbox)}catch(v){k(v instanceof Error?v.message:String(v))}finally{x(null)}}},[s,n]),H=l.useCallback(async v=>{if(!s||!n)return;const $=Pt(v.provider),D=$?At($):null,M=D?.leasePolicy.allowedCapabilityIds??[];if(!$||!D?.leasePolicy.leaseable||M.length===0){k(`${re(v.provider)} cannot be attached to this sandbox.`);return}x(`attach:${v.id}`),k(null);try{const E=await z.attachSandboxIntegrationConnection(s,n.id,{connectionId:v.id,provider:v.provider,capabilities:M,...v.scopes.length>0?{scopes:v.scopes}:{},...D.leasePolicy.defaultTtlSeconds?{ttlSeconds:D.leasePolicy.defaultTtlSeconds}:{},required:!1});a(E.sandbox)}catch(E){k(E instanceof Error?E.message:String(E))}finally{x(null)}},[s,n]),W=l.useCallback(async v=>{if(!(!s||!n)){x(`remove:${v}`),k(null);try{const $=await z.removeSandboxIntegrationLease(s,n.id,v);a($.sandbox)}catch($){k($ instanceof Error?$.message:String($))}finally{x(null)}}},[s,n]);return l.useEffect(()=>{I()},[I]),t?e.jsxs("div",{className:"sandbox-summary-tab",children:[e.jsxs("section",{className:"sandbox-workspace-section",children:[e.jsxs("div",{className:"sandbox-workspace-heading",children:[e.jsx("h3",{children:"Sandbox"}),e.jsxs("div",{className:"sandbox-workspace-heading-actions",children:[n?e.jsx("span",{children:n.state}):null,e.jsx("button",{type:"button",className:"diff-icon-button",title:"Refresh summary","aria-label":"Refresh summary",disabled:c!==null,onClick:()=>{I()},children:c==="summary"?e.jsx(Ue,{className:"spinning",size:14}):e.jsx(is,{size:14})})]})]}),n?e.jsxs("dl",{className:"sandbox-workspace-kv",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Sandbox"}),e.jsx("dd",{children:tn(n.id)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Spend"}),e.jsxs("dd",{children:[ss(n.reservation.capturedUsd)," / ",ss(n.budget.maxUsd)]})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Reservation"}),e.jsx("dd",{children:n.reservation.status})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Idle cleanup"}),e.jsx("dd",{children:n.quotas?.idleTimeoutSeconds?`${Math.round(n.quotas.idleTimeoutSeconds/60)} min`:"-"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Updated"}),e.jsx("dd",{children:gn(n.updatedAt)})]}),T?e.jsxs("div",{children:[e.jsx("dt",{children:"Receipt"}),e.jsxs("dd",{children:[tn(T.id)," / ",ss(T.totalUsd)]})]}):null]}):e.jsxs("div",{className:"sandbox-workspace-loading",children:[c==="summary"?e.jsx(Ue,{className:"spinning",size:16}):null,e.jsx("span",{children:c==="summary"?"Loading sandbox":"Sandbox unavailable"})]})]}),e.jsxs("section",{className:"sandbox-workspace-section",children:[e.jsxs("div",{className:"sandbox-workspace-heading",children:[e.jsx("h3",{children:"Integrations"}),e.jsxs("div",{className:"sandbox-workspace-heading-actions",children:[e.jsx("span",{children:N.length}),e.jsx("button",{type:"button",className:"diff-icon-button",title:"Refresh integrations","aria-label":"Refresh integrations",disabled:p!==null||!n,onClick:()=>{K()},children:p==="load"?e.jsx(Ue,{className:"spinning",size:14}):e.jsx(is,{size:14})})]})]}),N.length>0?e.jsx("div",{className:"sandbox-workspace-integration-list",children:N.map(v=>e.jsxs("div",{className:"sandbox-workspace-integration-row",children:[e.jsxs("div",{className:"sandbox-workspace-integration-main",children:[e.jsx("span",{children:re(v.provider)}),e.jsxs("small",{children:[v.required?"required":"optional"," / ",sr(v)," / ",Yi(v)]})]}),e.jsx("button",{type:"button",className:"diff-icon-button",title:`Revoke ${re(v.provider)} lease`,"aria-label":`Revoke ${re(v.provider)} lease`,disabled:p!==null,onClick:()=>{W(v.leaseId)},children:p===`remove:${v.leaseId}`?e.jsx(Ue,{className:"spinning",size:14}):e.jsx(wa,{size:14})}),e.jsxs("div",{className:"sandbox-workspace-chip-row",children:[v.capabilities.slice(0,5).map($=>e.jsx("span",{children:tr(v.provider,$)},$)),v.capabilities.length>5?e.jsxs("span",{children:["+",v.capabilities.length-5]}):null]})]},v.leaseId))}):e.jsx("p",{className:"sandbox-workspace-empty",children:"No active integration leases."}),F.length>0?e.jsx("div",{className:"sandbox-workspace-integration-list",children:F.map(v=>{const $=N.some(E=>E.provider===v.provider),M=er(v)?.leasePolicy.allowedCapabilityIds.length??0;return e.jsxs("div",{className:"sandbox-workspace-integration-row compact",children:[e.jsxs("div",{className:"sandbox-workspace-integration-main",children:[e.jsx("span",{children:nr(v)}),e.jsx("small",{children:ar(v,M)})]}),e.jsx("button",{type:"button",className:"diff-icon-button",title:$?`${re(v.provider)} already attached`:`Attach ${re(v.provider)}`,"aria-label":$?`${re(v.provider)} already attached`:`Attach ${re(v.provider)}`,disabled:$||p!==null||M===0,onClick:()=>{H(v)},children:p===`attach:${v.id}`?e.jsx(Ue,{className:"spinning",size:14}):e.jsx(Ci,{size:14})})]},v.id)})}):e.jsx("p",{className:"sandbox-workspace-empty",children:"No connected accounts available."})]})]}):e.jsx("div",{className:"sandbox-summary-tab",children:e.jsx("p",{className:"sandbox-workspace-empty",children:"No sandbox is attached yet."})})}function en(t){return{status:"active"}}function Yi(t){return t.proxyUrl?"runtime proxy available":"metadata only, no runtime proxy"}function Ji(t){return t?.receipts?.at(-1)??null}function er(t){const s=Pt(t.provider);return s?At(s):null}function re(t){const s=Pt(t),n=s?At(s):null;return n?n.label:t==="microsoft_teams"?"Microsoft Teams":t?t.replace(/_/g," "):"Integration"}function tr(t,s){const n=Pt(t);return(n?At(n):null)?.capabilities.find(i=>i.id===s)?.label??s}function sr(t){return t.expiresAt?`expires ${gn(t.expiresAt)}`:"active"}function nr(t){const s=t.providerAccountName?.trim();return s?`${re(t.provider)} / ${s}`:re(t.provider)}function ar(t,s){const n=[];return t.providerWorkspaceName&&n.push(t.providerWorkspaceName),n.push(`${s} lease ${s===1?"capability":"capabilities"}`),t.scopes.length>0&&n.push(`${t.scopes.length} ${t.scopes.length===1?"scope":"scopes"}`),n.join(" / ")}function tn(t){return t.length>10?`${t.slice(0,8)}...`:t}function gn(t){if(!t)return"-";const s=new Date(t);return Number.isNaN(s.valueOf())?"-":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(s)}function ss(t){const s=Number(t??0);return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:s>=10?2:4}).format(Number.isFinite(s)?s:0)}function ir({summary:t}){const s=ti(t.taskset),n=t.taskset.learningSignals.demonstrations.filter(d=>d.approved).length,a=t.taskset.tasks.filter(d=>d.split==="frozen_eval").length,i=t.plan?.recipe.method==="sft"||t.plan?.recipe.method==="grpo"?t.plan.recipe:null,u=si(t.taskset,t.plan),c=t.job?ni(t.job.status,t.job.completedAt,t.job.updatedAt):null;return e.jsxs("div",{className:"training-sidebar-summary",children:[e.jsxs("header",{children:[e.jsx("h2",{children:ai(t.taskset.name)}),e.jsx("span",{children:t.job?ii(t.job.status):t.taskset.readiness?.ready?"Ready to train":"Needs review"})]}),e.jsxs("section",{children:[e.jsx("h3",{children:"Run"}),e.jsxs("dl",{children:[e.jsx(U,{label:"Primary recommendation",value:s.toUpperCase()}),e.jsx(U,{label:"Training stage",value:u}),e.jsx(U,{label:"Base model",value:i?.baseModel.id??"Not selected"}),e.jsx(U,{label:"Compute",value:t.plan?ri(t.plan.destinationId):"Not selected"}),e.jsx(U,{label:"Started",value:li(t.job?.startedAt??null)}),e.jsx(U,{label:"Duration",value:oi(t.job?.startedAt??null,c)})]})]}),e.jsxs("section",{children:[e.jsx("h3",{children:"Data"}),e.jsxs("dl",{children:[e.jsx(U,{label:"Training examples",value:String(n)}),e.jsx(U,{label:"Test examples",value:String(a)}),e.jsx(U,{label:"Dataset sources",value:String(t.taskset.sourceRefs.length)})]})]}),i?e.jsxs("section",{children:[e.jsx("h3",{children:"Recipe"}),e.jsxs("dl",{children:[i.method==="grpo"?e.jsx(U,{label:"RL loss",value:i.loss.method==="gspo-token"?"GSPO-token":i.loss.method.toUpperCase()}):null,e.jsx(U,{label:"LoRA rank",value:String(i.lora.rank)}),e.jsx(U,{label:"Learning rate",value:String(i.optimizer.learningRate)}),e.jsx(U,{label:"Optimizer steps",value:String(i.optimizer.maxSteps)}),e.jsx(U,{label:i.method==="grpo"?"Prompt length":"Sequence length",value:String(i.method==="grpo"?i.dataset.maxPromptTokens:i.dataset.maxSequenceLength)})]})]}):null,e.jsxs("section",{children:[e.jsx("h3",{children:"Result"}),e.jsxs("dl",{children:[e.jsx(U,{label:"Adapter",value:t.lineage?`${u} ready`:"Not created"}),e.jsx(U,{label:"Evaluation",value:t.lineage?.frozenEvaluationArtifactId?"Completed":"Not completed"}),e.jsx(U,{label:"Artifacts",value:String(t.artifacts.length)})]})]})]})}function U({label:t,value:s}){return e.jsxs("div",{children:[e.jsx("dt",{children:t}),e.jsx("dd",{children:s})]})}function rr(t){const s=sn("","","folder");for(const n of t){const a=n.endsWith("/"),i=n.split("/").filter(Boolean);if(i.length===0)continue;let u=s,c="";for(let d=0;d<i.length;d+=1){const p=i[d];c=c?`${c}/${p}`:p;const x=!a&&d===i.length-1?"file":"folder",o=`${x}:${p}`;let b=u.childMap.get(o);b||(b=sn(p,c,x),u.childMap.set(o,b),u.children.push(b)),u=b}}return jn(s.children)}function sn(t,s,n){return{name:t,path:s,type:n,children:[],childMap:new Map}}function jn(t){return t.sort((s,n)=>s.type!==n.type?s.type==="folder"?-1:1:s.name.localeCompare(n.name)).map(s=>({name:s.name,path:s.path,type:s.type,children:jn(s.children)}))}function us({className:t,currentStatus:s,onSetStatus:n}){const a=s==="pinned",i=s==="saved_for_later";return e.jsxs("span",{className:`workspace-file-bookmark-actions ${t??"workspace-file-heading-actions"}`,children:[e.jsx("button",{type:"button",className:a?"active":void 0,"data-tooltip":a?"Unpin file":"Pin file","aria-label":a?"Unpin file":"Pin file","aria-pressed":a,onClick:()=>n(a?"none":"pinned"),children:a?e.jsx(Aa,{size:14}):e.jsx(La,{size:14})}),e.jsx("button",{type:"button",className:i?"active":void 0,"data-tooltip":i?"Remove from Save for later":"Save file for later","aria-label":i?"Remove from Save for later":"Save file for later","aria-pressed":i,onClick:()=>n(i?"none":"saved_for_later"),children:i?e.jsx(Da,{size:14}):e.jsx(_a,{size:14})})]})}function lr({changedByPath:t,expandedFolderPaths:s,rootPath:n,repoFiles:a,selectedPath:i,getFileBookmarkStatus:u,onOpenFile:c,onSetFileBookmarkStatus:d,onToggleFolder:p}){const x=l.useMemo(()=>rr(a),[a]);return e.jsxs("div",{className:"workspace-file-tree-view",children:[e.jsxs("div",{className:"workspace-file-tree-header",children:[e.jsx(Nt,{size:14}),e.jsx("strong",{title:n??void 0,children:n?n.split("/").at(-1):"Files"}),e.jsx("span",{children:a.length})]}),e.jsx("div",{className:"workspace-file-tree",children:x.map(o=>e.jsx(vn,{changedByPath:t,expandedFolderPaths:s,node:o,rootPath:n,selectedPath:i,getFileBookmarkStatus:u,onOpenFile:c,onSetFileBookmarkStatus:d,onToggleFolder:p},`${o.type}:${o.path}`))})]})}function vn({changedByPath:t,depth:s=0,expandedFolderPaths:n,node:a,rootPath:i,selectedPath:u,getFileBookmarkStatus:c,onOpenFile:d,onSetFileBookmarkStatus:p,onToggleFolder:x}){const o=i?`${i}/${a.path}`:a.path,b=a.type==="folder"&&n.has(o),S=t.get(o),k=2+s*11;return a.type==="folder"?e.jsxs("div",{className:"workspace-file-tree-node",children:[e.jsxs("button",{type:"button",className:"workspace-file-tree-row folder","aria-expanded":b,style:{paddingLeft:k},onClick:()=>x(o),children:[b?e.jsx(Nt,{size:14}):e.jsx(Ta,{size:14}),e.jsx("span",{children:a.name})]}),b&&a.children.map(N=>e.jsx(vn,{changedByPath:t,depth:s+1,expandedFolderPaths:n,node:N,rootPath:i,selectedPath:u,getFileBookmarkStatus:c,onOpenFile:d,onSetFileBookmarkStatus:p,onToggleFolder:x},`${N.type}:${N.path}`))]}):e.jsxs("div",{className:`workspace-file-tree-row file ${S?"changed":""} ${u===o?"selected":""}`,style:{paddingLeft:k},children:[e.jsxs("button",{type:"button",className:"workspace-file-tree-row-main",title:o,onClick:()=>d(o),children:[e.jsx(ya,{size:13}),e.jsx("span",{children:a.name}),S&&e.jsxs("small",{children:[e.jsxs("span",{className:"diff-addition",children:["+",S.additions]}),e.jsxs("span",{className:"diff-deletion",children:["-",S.deletions]})]})]}),/\.html?$/i.test(o)&&e.jsx("button",{type:"button",className:"workspace-file-tree-bookmark-actions",title:"View source","aria-label":`View source for ${a.name}`,onClick:()=>d(o,{source:!0}),children:"</>"}),p?e.jsx(us,{className:"workspace-file-tree-bookmark-actions",currentStatus:c?.(o)??null,onSetStatus:N=>p(o,N)}):null]})}function nn({diff:t,expandedFolderPaths:s,rootPath:n,repoFiles:a,selectedPath:i,getFileBookmarkStatus:u,onOpenFile:c,onSetFileBookmarkStatus:d,onToggleFolder:p}){const x=t?.files??[],o=l.useMemo(()=>new Map(x.map(k=>[k.path,k])),[x]),b=n?.replace(/^\/+|\/+$/g,"")||null,S=l.useMemo(()=>{if(!b)return a;const k=`${b}/`;return a.filter(N=>N.startsWith(k)).map(N=>N.slice(k.length)).filter(Boolean)},[b,a]);return e.jsx("div",{className:"workspace-diff-files-view",children:e.jsx(lr,{changedByPath:o,expandedFolderPaths:s,rootPath:b,repoFiles:S,selectedPath:i,getFileBookmarkStatus:u,onOpenFile:c,onSetFileBookmarkStatus:d,onToggleFolder:p})})}function or({collapsed:t,editorControlsVisible:s,hideWhiteSpace:n,loadFullFiles:a,renderMarkdown:i,wordDiffs:u,wordWrap:c,onClose:d,onCopyGitApply:p,onRefresh:x,onToggleCollapsed:o,onToggleEditorControlsVisible:b,onToggleHideWhiteSpace:S,onToggleLoadFullFiles:k,onToggleRenderMarkdown:N,onToggleWordDiffs:F,onToggleWordWrap:T}){return e.jsxs("div",{className:"workspace-diff-options-menu",role:"menu",children:[e.jsx(ue,{icon:e.jsx(is,{size:14}),label:"Refresh",onClick:x,onClose:d}),e.jsx(ue,{checked:c,icon:e.jsx(Sa,{size:14}),label:"Enable word wrap",onClick:T,onClose:d}),e.jsx(ue,{checked:t,icon:e.jsx(gi,{size:14}),label:"Collapse all diffs",onClick:o,onClose:d}),e.jsx("div",{className:"workspace-diff-menu-divider"}),e.jsx(ue,{checked:s,icon:e.jsx(Si,{size:14}),label:"Show editor controls",onClick:b,onClose:d}),e.jsx(ue,{checked:i,icon:e.jsx(pn,{size:14}),label:"Render Markdown",onClick:N,onClose:d}),e.jsx(ue,{checked:!a,icon:e.jsx(ot,{size:14}),label:"Show diffs first",onClick:k,onClose:d}),e.jsx(ue,{checked:u,icon:e.jsx(xi,{size:14}),label:"Enable word diffs",onClick:F,onClose:d}),e.jsx(ue,{checked:n,icon:e.jsx(wi,{size:14}),label:"Hide white space",onClick:S,onClose:d}),e.jsx(ue,{icon:e.jsx(ui,{size:14}),label:"Copy git apply command",onClick:p,onClose:d})]})}function ue({checked:t,icon:s,label:n,onClick:a,onClose:i}){return e.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{a?.(),i()},children:[s,e.jsx("span",{children:n}),t&&e.jsx(Ma,{size:14})]})}function cr({addMenuOpen:t,expanded:s,filteredFiles:n,dirtyFilePaths:a,openFiles:i,goalDetailsAvailable:u,searchOpen:c,searchQuery:d,selectedPath:p,sideChatTabs:x=[],summaryAvailable:o,sourceStatus:b,sourceSwitcher:S,visibleTab:k,getFileBookmarkStatus:N,onCloseFileTab:F,onCloseSideChat:T,onCloseSearch:I,onOpenFile:K,onOpenBrowser:H,onOpenSearch:W,onOpenSideChat:v,onSearchQueryChange:$,onSetFileBookmarkStatus:D,onSelectFile:M,onSelectFiles:E,onSelectGoal:se,onSelectSummary:q,onSelectSideChat:X,onToggleAddMenu:B,onToggleExpanded:Q}){const ne=l.useRef(null);l.useEffect(()=>{if(!t&&!c)return;function w(){t&&B(),c&&I()}function O(_){ne.current?.contains(_.target)||w()}function A(_){_.key==="Escape"&&w()}return document.addEventListener("pointerdown",O),document.addEventListener("keydown",A),()=>{document.removeEventListener("pointerdown",O),document.removeEventListener("keydown",A)}},[t,I,B,c]);function Y(w){if(w.key==="Escape"){I();return}w.key==="Enter"&&n[0]&&K(n[0])}function oe(w){if(!["ArrowRight","ArrowLeft","Home","End"].includes(w.key))return;const O=w.target;if(!(O instanceof HTMLButtonElement)||O.getAttribute("role")!=="tab")return;const A=Array.from(w.currentTarget.querySelectorAll('button[role="tab"]')),_=A.indexOf(O);if(_<0||A.length===0)return;w.preventDefault();const Lt=Ha(_,A.length,w.key),Ae=A[Lt];if(!Ae)return;Ae.focus(),Ae.click();const ct=Ae.id;ct&&window.requestAnimationFrame(()=>document.getElementById(ct)?.focus())}return e.jsxs("div",{className:"workspace-diff-topbar",children:[e.jsxs("div",{className:"workspace-diff-tabs",role:"tablist","aria-label":"Right sidebar views",onKeyDown:oe,children:[u?e.jsxs("button",{type:"button",className:`workspace-diff-tab ${k==="goal"?"active":""}`,role:"tab","aria-selected":k==="goal",onClick:se,children:[e.jsx(ot,{size:14}),e.jsx("span",{children:"Goal"})]}):null,o&&q?e.jsxs("button",{type:"button",className:`workspace-diff-tab ${k==="summary"?"active":""}`,role:"tab","aria-selected":k==="summary",onClick:q,children:[e.jsx(Ys,{size:14}),e.jsx("span",{children:"Summary"})]}):null,e.jsxs("button",{type:"button",className:`workspace-diff-tab ${k==="files"?"active":""}`,role:"tab",id:"right-sidebar-files-tab","aria-controls":"right-sidebar-files-panel","aria-selected":k==="files",tabIndex:k==="files"?0:-1,onClick:E,children:[e.jsx(Nt,{size:14}),e.jsx("span",{children:"Files"})]}),i.map(w=>e.jsxs("div",{className:`workspace-diff-tab file ${k==="file"&&p===w.path?"active":""}`,children:[e.jsxs("button",{type:"button",className:"workspace-diff-tab-main",role:"tab","aria-selected":k==="file"&&p===w.path,title:w.path,onClick:()=>M(w.path),children:[e.jsx(ot,{className:"workspace-diff-tab-icon",size:13}),a.has(w.path)&&e.jsx("span",{className:"workspace-diff-tab-dirty","aria-hidden":"true"}),e.jsx("span",{children:w.path.split("/").pop()})]}),D?e.jsx(us,{className:"workspace-diff-tab-bookmark-actions",currentStatus:N?.(w.path)??null,onSetStatus:O=>D(w.path,O)}):null,e.jsx("button",{type:"button",className:"workspace-diff-tab-close",title:`Close ${w.path}`,onClick:O=>F(w.path,O),children:e.jsx(Xs,{size:12})})]},w.path)),x.map(w=>e.jsxs("div",{className:"workspace-diff-tab right-chat-tab",children:[e.jsxs("button",{type:"button",className:"workspace-diff-tab-main",role:"tab",id:`right-chat-tab-${w.id}`,"aria-controls":`right-chat-panel-${w.id}`,"aria-selected":!1,tabIndex:-1,title:w.title,onClick:()=>X?.(w.id),children:[w.running?e.jsx("span",{className:"right-chat-status-dot","aria-label":"Running"}):null,e.jsx("span",{children:w.title})]}),T?e.jsx("button",{type:"button",className:"workspace-diff-tab-close",title:`Close ${w.title}`,"aria-label":`Close ${w.title}`,onClick:O=>{O.stopPropagation(),T(w.id)},children:e.jsx(Xs,{size:12})}):null]},w.id)),e.jsxs("div",{className:"workspace-diff-add-anchor",ref:ne,children:[e.jsx("button",{type:"button",className:`workspace-diff-add-tab ${t||c?"active":""}`,title:"Add","aria-label":"Add to right sidebar",onClick:B,children:e.jsx(za,{size:15})}),t&&e.jsxs("div",{className:"workspace-diff-add-menu",role:"menu",children:[v?e.jsxs("button",{type:"button",role:"menuitem",onClick:v,children:[e.jsx(Ia,{size:14}),e.jsx("span",{children:"New task"}),e.jsx("kbd",{})]}):null,e.jsxs("button",{type:"button",role:"menuitem",onClick:E,children:[e.jsx(Nt,{size:14}),e.jsx("span",{children:"Files"}),e.jsx("kbd",{})]}),o&&q?e.jsxs("button",{type:"button",role:"menuitem",onClick:q,children:[e.jsx(Ys,{size:14}),e.jsx("span",{children:"Summary"}),e.jsx("kbd",{})]}):null,e.jsxs("button",{type:"button",role:"menuitem",onClick:W,children:[e.jsx(Wa,{size:14}),e.jsx("span",{children:"Open file"}),e.jsx("kbd",{children:"Ctrl+P"})]}),H?e.jsxs("button",{type:"button",role:"menuitem",onClick:H,children:[e.jsx(Ba,{size:14}),e.jsx("span",{children:"Browser"}),e.jsx("kbd",{children:"Ctrl+I"})]}):null]}),c&&e.jsxs("div",{className:"workspace-file-search-popover",children:[e.jsx("input",{autoFocus:!0,placeholder:"Search files",value:d,onChange:w=>$(w.target.value),onKeyDown:Y}),e.jsx("span",{children:"Files"}),e.jsx("div",{className:"workspace-file-search-results",children:n.length===0?e.jsx("small",{children:"Type to search for files"}):n.map(w=>e.jsx("button",{type:"button",onClick:()=>K(w),children:w},w))})]})]})]}),S||b?e.jsxs("div",{className:"workspace-diff-source-bar","aria-label":"Workspace source",children:[S?e.jsx("div",{className:"workspace-diff-source-toggle",role:"group","aria-label":"File source",children:S.options.map(w=>e.jsx("button",{type:"button",className:S.value===w.value?"active":"","aria-pressed":S.value===w.value,onClick:()=>S.onChange(w.value),children:w.label},w.value))}):null,b?e.jsx("span",{className:`workspace-diff-source-status ${b.tone}`,children:b.label}):null]}):null,e.jsx("button",{type:"button",className:"diff-icon-button",title:s?"Restore files panel":"Expand files panel","aria-label":s?"Restore files panel":"Expand files panel",onClick:Q,children:s?e.jsx(ci,{size:14}):e.jsx(Oa,{size:14})})]})}function dr({canCheckActiveFile:t,canSaveActiveFile:s,collapsed:n,editorControlsVisible:a,editorDiagnosticStatus:i,editorDiagnosticsChecking:u,hideWhiteSpace:c,loadFullFiles:d,menuOpen:p,renderMarkdown:x,showEditorCommandBar:o,showRenderMarkdownToggle:b,splitView:S,wordDiffs:k,wordWrap:N,onCopyGitApply:F,onEditorCheck:T,onEditorRedo:I,onEditorSave:K,onEditorUndo:H,onRefresh:W,onToggleCollapsed:v,onToggleEditorControlsVisible:$,onToggleHideWhiteSpace:D,onToggleLoadFullFiles:M,onToggleMenu:E,onToggleRenderMarkdown:se,onToggleSplitView:q,onToggleWordDiffs:X,onToggleWordWrap:B}){return e.jsx("div",{className:"workspace-diff-toolbar",children:e.jsxs("div",{className:"workspace-diff-toolbar-actions",children:[e.jsxs("div",{className:"workspace-diff-menu-anchor",children:[e.jsx("button",{type:"button",className:"diff-icon-button",title:"Diff options","aria-haspopup":"menu","aria-expanded":p,onClick:()=>E(),children:e.jsx(Ua,{size:15})}),p&&e.jsx(or,{collapsed:n,editorControlsVisible:a,hideWhiteSpace:c,loadFullFiles:d,renderMarkdown:x,wordDiffs:k,wordWrap:N,onClose:()=>E(!1),onCopyGitApply:F,onRefresh:W,onToggleCollapsed:v,onToggleEditorControlsVisible:$,onToggleHideWhiteSpace:D,onToggleLoadFullFiles:M,onToggleRenderMarkdown:se,onToggleWordDiffs:X,onToggleWordWrap:B})]}),o&&e.jsxs("div",{className:"workspace-editor-command-bar","aria-label":"Editor controls",children:[e.jsx("button",{type:"button",className:"diff-icon-button",title:"Save file","aria-label":"Save file",disabled:!s,onClick:K,children:e.jsx(di,{size:14})}),e.jsx("button",{type:"button",className:"diff-icon-button",title:"Undo","aria-label":"Undo",onClick:H,children:e.jsx(Ei,{size:14})}),e.jsx("button",{type:"button",className:"diff-icon-button",title:"Redo","aria-label":"Redo",onClick:I,children:e.jsx($i,{size:14})}),e.jsx("button",{type:"button",className:"diff-icon-button",title:"Check file","aria-label":"Check file",disabled:!t,onClick:T,children:u?e.jsx(Ue,{className:"spinning",size:14}):e.jsx(Zs,{size:14})}),i&&e.jsxs("span",{className:`workspace-editor-diagnostic-chip ${i.severity}`,children:[i.severity==="error"||i.severity==="warning"||i.severity==="unavailable"?e.jsx(fn,{size:13}):e.jsx(Zs,{size:13}),e.jsx("span",{children:i.label})]})]}),b&&e.jsx("button",{type:"button",className:`diff-icon-button ${x?"active":""}`,title:x?"Show Markdown source":"Render Markdown","aria-label":x?"Show Markdown source":"Render Markdown","aria-pressed":x,onClick:se,children:e.jsx(pn,{size:14})}),e.jsx("button",{type:"button",className:`diff-icon-button ${S?"active":""}`,title:S?"Show unified diff":"Show split diff","aria-label":S?"Show unified diff":"Show split diff","aria-pressed":S,onClick:q,children:e.jsx(vi,{size:14})})]})})}const ur={cjs:"typescript",css:"css",html:"html",js:"typescript",json:"json",jsx:"typescript",md:"markdown",mjs:"typescript",py:"python",sh:"shell",ts:"typescript",tsx:"typescript",yaml:"yaml",yml:"yaml"};function fs(t){const s=t.split("/").pop()?.toLowerCase()??"";if(s==="dockerfile")return"shell";if(s==="readme"||s==="readme.md")return"markdown";const n=s.includes(".")?s.split(".").pop()??"":"";return ur[n]??"text"}function fr(t,s){return t?s==="markdown"?pr(t):s==="json"?Ee(t,/("(?:\\.|[^"\\])*"(?=\s*:)|"(?:\\.|[^"\\])*"|[-]?\b\d+(?:\.\d+)?\b|\btrue\b|\bfalse\b|\bnull\b|[{}[\]:,])/g):s==="css"?Ee(t,/(\/\*.*?\*\/|#[\da-fA-F]{3,8}\b|--[\w-]+|[.#]?[\w-]+(?=\s*:)|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b\d+(?:\.\d+)?(?:px|rem|em|%|vh|vw)?\b|[{}():;,])/g):s==="html"?Ee(t,/(<!--.*?-->|<\/?[\w-]+|[\w:-]+(?==)|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|[<>/=])/g):s==="shell"?Ee(t,/(#.*$|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b(?:cd|cp|export|git|npm|pnpm|bun|yarn|rm|mkdir|test|if|then|fi|for|do|done|echo)\b|\$[\w_]+|&&|\|\||[|&;=])/g):s==="python"?Ee(t,/(#.*$|"""[\s\S]*?"""|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b(?:class|def|return|if|elif|else|for|while|try|except|finally|with|as|import|from|None|True|False|async|await|lambda|yield)\b|\b[A-Z][\w]*\b|\b\d+(?:\.\d+)?\b|[+\-*/%=<>!&|.:,()[\]{}]+)/g):Ee(t,/(\/\/.*$|\/\*.*?\*\/|`(?:\\.|[^`\\])*`|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b(?:abstract|as|async|await|boolean|break|case|catch|class|const|continue|default|else|enum|export|extends|false|finally|for|from|function|if|import|in|interface|let|new|null|number|of|return|string|switch|throw|true|try|type|undefined|void|while)\b|\b[A-Z][\w]*\b|\b\d+(?:\.\d+)?\b|[+\-*/%=<>!&|?:.,()[\]{}]+)/g):[{text:" ",kind:"plain"}]}function pr(t){return/^\s{0,3}#{1,6}\s/.test(t)?[{text:t,kind:"keyword"}]:/^\s*[-*+]\s/.test(t)?[{text:t,kind:"property"}]:Ee(t,/(`[^`]+`|\*\*[^*]+\*\*|\[[^\]]+\]\([^)]+\)|https?:\/\/\S+)/g)}function hr(t){return/^(\/\/|#|\/\*|<!--)/.test(t)?"comment":/^["'`]/.test(t)?"string":/^[-]?\d/.test(t)||/^#[\da-fA-F]{3,8}\b/.test(t)?"number":/^\b[A-Z]/.test(t)?"type":/^[.#]?[\w-]+$/.test(t)&&t.includes("-")?"property":/^(?:[{}()[\],.:;<>/=+\-*&|!?%]+)$/.test(t)?"operator":/^(?:--|\$)/.test(t)?"property":"keyword"}function Ee(t,s){const n=[];let a=0;for(const i of t.matchAll(s)){const u=i.index??0;u>a&&n.push({text:t.slice(a,u),kind:"plain"});const c=i[0];if(n.push({text:c,kind:hr(c)}),a=u+c.length,/^(\/\/|#|<!--)/.test(c))break}return a<t.length&&n.push({text:t.slice(a),kind:"plain"}),n.length>0?n:[{text:t,kind:"plain"}]}function Rt({language:t,text:s}){return e.jsx(e.Fragment,{children:fr(s,t).map((n,a)=>e.jsx("span",{className:`syntax-token ${n.kind}`,children:n.text},`${a}-${n.text}`))})}function mr({path:t,contentBase64:s}){const n=t.replace(/\\/g,"/").split("/").pop()||"document",a=l.useMemo(()=>{try{const d=atob(s.replace(/\s/g,"")),p=Uint8Array.from(d,x=>x.charCodeAt(0));return new Blob([p],{type:xr(t)})}catch{return null}},[s,t]),[i,u]=l.useState(null);l.useEffect(()=>{if(!a)return;const d=URL.createObjectURL(a);return u({blob:a,url:d}),()=>URL.revokeObjectURL(d)},[a]);const c=i?.blob===a?i.url:null;return a?c?e.jsxs("div",{className:"workspace-document-preview",children:[e.jsxs("div",{className:"workspace-document-preview-card",children:[e.jsx("strong",{children:n}),e.jsx("span",{children:/\.pdf$/i.test(t)?"PDF document":"Word document"}),e.jsx("a",{href:c,download:n,"aria-label":"Download document",title:"Download document",children:e.jsx(Va,{size:16,"aria-hidden":"true"})})]}),e.jsx("iframe",{src:c,title:`${t} preview`})]}):e.jsx("div",{className:"workspace-diff-code-empty",role:"status",children:"Loading document…"}):e.jsx("div",{className:"workspace-diff-code-empty",children:"Document preview unavailable."})}function xr(t){return/\.pdf$/i.test(t)?"application/pdf":/\.docx$/i.test(t)?"application/vnd.openxmlformats-officedocument.wordprocessingml.document":"application/msword"}const br=`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/WorkspaceMonacoEditor-TxLyhzNp.js","assets/index-C8aCGagb.js","assets/index-3iPNbbER.css","assets/WorkspaceMonacoEditor-BwKcXIZw.css"])))=>i.map(i=>d[i]);
2
+ import{j as e,r as l,_ as ka}from"./index-C8aCGagb.js";import{T as wa,F as ya,a as Sa,M as Na,d as Ca,i as Ks,h as Ra,j as $a,f as Gs,I as Fa}from"./MarkdownText-BR4V6lNO.js";import{_ as Et,o as ds,s as te,b as Ea,n as un,bK as Aa,e as ge,K as ot,aK as qs,aF as fn,bd as Ae,V as z,c0 as At,bB as Pt,bz as Ue,aA as is,c1 as Pa,b6 as La,c2 as Da,b7 as _a,F as Ta,J as pn,x as Ma,X as Xs,t as za,b8 as Ia,aI as Wa,aJ as Ba,bY as Oa,c3 as Ua,ay as Zs,c4 as Ha,bo as Va,c5 as rs,c6 as Ka,c7 as ls,c8 as Ga,v as qa,W as hn,U as Xa,c9 as ts,ca as Za,cb as os,bI as Re,cc as Qa,cd as Qs,ce as Ya,cf as Ja,cg as ei}from"./App-s-CJswyt.js";import{t as ti,a as si,b as ni,m as ai,s as ii,d as ri,f as li,c as oi}from"./training-model-data-CKOkpBBL.js";import{F as Nt}from"./folder-open-sYgceW_f.js";import{I as Ys}from"./info-DLdbiUrh.js";import{M as ci}from"./minimize-2-CqcI4zcM.js";import{S as di}from"./save-CtSjPydi.js";import{C as ui}from"./clipboard-Dk158Qp4.js";const mn=Et(["local","sandbox"]),fi=Et(["pinned","saved_for_later"]),pi=ds({id:te().min(1),workspaceKind:mn,workspaceId:te().min(1),workspaceName:te().min(1),path:te().min(1),status:fi,order:un().int().nonnegative().nullable().default(null),sourceSessionId:te().min(1).nullable().default(null),available:Ea().default(!0),createdAt:te().min(1),updatedAt:te().min(1)});ds({items:Aa(pi)});ds({workspaceKind:mn,workspaceId:te().trim().min(1),workspaceName:te().trim().min(1),path:te().trim().min(1),status:Et(["pinned","saved_for_later","none"]),order:un().int().nonnegative().nullable().optional(),sourceSessionId:te().trim().min(1).nullable().optional()});Et(["pin","save_for_later","remove","list"]);function cs(t){let s=t.trim().replaceAll("\\","/");if(s=s.replace(/^(?:workspace|sandbox):file:/,""),s=s.replace(/^\/workspace\/app\//,""),s=s.replace(/^\.\//,""),!s||s.startsWith("/"))throw new Error("File path must be relative to the workspace.");const n=s.split("/").filter(a=>a&&a!==".");if(n.some(a=>a===".."))throw new Error("File path cannot leave the workspace.");if(n.length===0)throw new Error("File path is required.");return n.join("/")}function hi(t){return["sidebar-file",t.workspaceKind,encodeURIComponent(t.workspaceId),encodeURIComponent(cs(t.path))].join(":")}const mi=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],xi=ge("text-align-start",mi);const bi=[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]],gi=ge("chevrons-up",bi);const ji=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],vi=ge("columns-2",ji);const ki=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],wi=ge("eye-off",ki);const yi=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}]],Si=ge("panel-top",yi);const Ni=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],Ci=ge("plug",Ni);const Ri=[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]],$i=ge("redo-2",Ri);const Fi=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],Ei=ge("undo-2",Fi);function Ai({createRuntime:t,goalRuntime:s,subagentRuntime:n=null,onRunSubagentLifecycleAction:a}){const i=t?"Create/Improve Details":"Goal Details",u=t?Z(t.run.state):n?.activeCount?n.label:s?.actionLabel??"No active goal";return e.jsxs("div",{className:"goal-details-view","aria-label":i,children:[e.jsxs("div",{className:"goal-details-header",children:[e.jsxs("div",{className:"goal-details-title",children:[e.jsx(ot,{size:15,"aria-hidden":"true"}),e.jsx("span",{children:i})]}),e.jsx("span",{className:`goal-details-state ${Zi(t?.run.state??null)}`,children:u})]}),e.jsx("div",{className:"goal-details-body",children:t?e.jsx(Pi,{runtime:t}):s||n?e.jsx(Di,{goalRuntime:s,subagentRuntime:n,onRunSubagentLifecycleAction:a}):e.jsx(Xi,{})})]})}function Pi({runtime:t}){const s=t.run,n=s.plan,a=qs(n?.metadata)??qs(s.metadata),i=s.questions,u=i.filter(o=>o.status==="pending"),c=s.sourceRefs,d=s.checkRefs,p=s.state,x=s.target.kind==="agent"?s.target.defaultActionKey:null;return e.jsxs(e.Fragment,{children:[e.jsx(V,{title:"Current Work",children:e.jsx(rt,{rows:[["State",Z(p)],["Operation",s.operation],["Target",Z(s.target.kind)],["Name",s.target.displayName??s.target.id??"Pending"],["Target ID",s.target.id??"Pending"],["Default action",x??n?.defaultChatAction.key??"Pending"],["Adapter",Z(s.adapter.kind)],["Run",s.id],["Revision",String(s.revision)]]})}),e.jsx(V,{title:"Plan",children:n?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"goal-details-summary",children:n.summary}),e.jsx(rt,{rows:[["Objective",n.objective],["Context",n.capturedContextSummary],["Status",Z(n.status)],["Plan ID",n.id],["Run ID",n.runId],["Approval",n.approvalId??"Pending"],["Approved",n.approvedAt??"Not approved"]]})]}):u.length?e.jsx("p",{className:"goal-details-summary",children:"Waiting for answers before the model finalizes the Create plan."}):e.jsx("p",{className:"goal-details-summary",children:"The model is preparing the Create plan."})}),a?e.jsxs(V,{title:"Action Shape",children:[e.jsx(rt,{rows:[["Mode",a.label],["Default action",a.defaultActionKey??"None"],["Direct action",a.directActionHint??"None planned"],["Artifacts",a.artifactPolicy]]}),e.jsx("p",{className:"goal-details-note",children:a.detail})]}):null,i.length?e.jsx(V,{title:"Questions",children:e.jsx("div",{className:"goal-details-list",children:i.map(o=>e.jsxs("article",{className:"goal-details-list-item",children:[e.jsxs("div",{children:[e.jsx("strong",{children:o.title}),e.jsx("span",{className:`goal-details-inline-state ${o.status}`,children:Z(o.status)})]}),e.jsx("p",{children:o.prompt}),o.answer?e.jsxs("small",{children:["Answer: ",o.answer.label??o.answer.value]}):o.options.length?e.jsxs("small",{children:["Options: ",o.options.map(b=>b.label).join(", ")]}):null]},o.id))})}):null,n?.requirements.length?e.jsx(V,{title:"Setup Requirements",children:e.jsx("div",{className:"goal-details-list",children:n.requirements.map(o=>e.jsxs("article",{className:"goal-details-list-item",children:[e.jsxs("div",{children:[e.jsx("strong",{children:o.name}),e.jsx("span",{className:`goal-details-inline-state ${o.status}`,children:Z(o.status)})]}),e.jsxs("small",{children:[Z(o.kind),o.detail?`: ${o.detail}`:""]})]},`${o.kind}:${o.name}`))})}):null,n?.sourcePlan.length?e.jsx(V,{title:"Source Plan",children:e.jsx(St,{refs:n.sourcePlan.map(o=>({id:`${o.operation}:${o.path}`,primary:o.path,secondary:`${Z(o.operation)}: ${o.reason}`}))})}):null,n?.checks.length?e.jsx(V,{title:"Checks",children:e.jsx(St,{refs:n.checks.map(o=>({id:o.name,primary:o.name,secondary:`${o.required?"Required":"Optional"}: ${o.command}`}))})}):null,c.length||d.length?e.jsx(V,{title:"Run Refs",children:e.jsx(St,{refs:[...c.map(o=>({id:`source:${o}`,primary:o,secondary:"Source ref"})),...d.map(o=>({id:`check:${o}`,primary:o,secondary:"Check ref"}))]})}):null,e.jsx(Li,{run:s}),s.blockedReason?e.jsx(V,{title:"Blocked",children:e.jsxs("div",{className:"goal-details-alert",children:[e.jsx(fn,{size:15}),e.jsx("span",{children:s.blockedReason})]})}):null,e.jsx(V,{title:"Raw State",children:e.jsxs("details",{className:"goal-details-raw",children:[e.jsx("summary",{children:"Show structured payload"}),e.jsx("pre",{children:JSON.stringify(s,null,2)})]})})]})}function Li({run:t}){const s=[...t.context.attachments.map(i=>({id:`attachment:${i.id??i.name}`,primary:i.name,secondary:i.ref??i.mediaType??"Attachment"})),...t.context.apps.map(i=>({id:`app:${i.id}`,primary:i.name,secondary:i.required?"Required app context":"Optional app context"})),...t.context.tools.map(i=>({id:`tool:${i.name}`,primary:i.name,secondary:i.outputSummary??i.inputSummary??"Tool context"})),...t.context.targetRepoAssumptions.map(i=>({id:`target:${i}`,primary:i,secondary:"Target assumption"}))],n=t.workflowCapture,a=n?[...n.files.map(i=>({id:`workflow-file:${i}`,primary:i,secondary:"Captured file"})),...n.outputArtifacts.map(i=>({id:`workflow-artifact:${i}`,primary:i,secondary:"Output artifact"})),...n.traceRefs.map(i=>({id:`workflow-trace:${i}`,primary:i,secondary:"Trace"}))]:[];return!s.length&&!a.length?null:e.jsx(V,{title:"Context",children:e.jsx(St,{refs:[...s,...a]})})}function Di({goalRuntime:t,subagentRuntime:s,onRunSubagentLifecycleAction:n}){return e.jsxs(e.Fragment,{children:[t?e.jsxs(V,{title:"Goal",children:[e.jsx("p",{className:"goal-details-summary",children:t.objective}),e.jsx(rt,{rows:[["Status",t.actionLabel],["Runtime",t.timeLabel],["Detail",t.detail]]})]}):null,s?e.jsx(_i,{runtime:s,onRunSubagentLifecycleAction:n}):null,e.jsx(V,{title:"Raw State",children:e.jsxs("details",{className:"goal-details-raw",children:[e.jsx("summary",{children:"Show structured payload"}),e.jsx("pre",{children:JSON.stringify({goalRuntime:t,subagentRuntime:s},null,2)})]})})]})}function _i({runtime:t,onRunSubagentLifecycleAction:s}){const[n,a]=l.useState(null),[i,u]=l.useState(null);Ae(i);const c=async(d,p)=>{if(!s)return;const x=`${d}:${p}`;a(x),u(null);try{await s({runId:d,action:p})}catch(o){u(o instanceof Error?o.message:String(o))}finally{a(o=>o===x?null:o)}};return e.jsxs(e.Fragment,{children:[e.jsxs(V,{title:"Subagents",children:[e.jsx(rt,{rows:[["Latest update",Oi(t)],["Active",String(t.activeCount)],["Completed",String(t.completedCount)],["Failed",String(t.failedCount)],["Cancelled",String(t.cancelledCount)],["Paused",String(t.needsResumeCount)],["Terminal",String(t.terminalCount)],["Usage",Ui(t.usage.totalTokens,t.usage.requestCount)],["Evidence",String(t.evidenceRefs.length)],["Checks",String(t.testsRunCount)]]}),t.blockers.length>0?e.jsx("ul",{className:"goal-details-list compact",children:t.blockers.slice(0,4).map(d=>e.jsxs("li",{className:"goal-details-list-item",children:[e.jsx("span",{className:`goal-details-inline-state ${d.status}`,children:d.status}),e.jsxs("div",{children:[e.jsx("strong",{children:Ct(d.roleId)}),e.jsx("p",{children:d.message})]})]},`${d.runId}:${d.message}`))}):null,e.jsx("ul",{className:"goal-details-list",children:t.runs.slice(0,8).map(d=>e.jsxs("li",{className:"goal-details-list-item",children:[e.jsx("span",{className:`goal-details-inline-state ${d.status}`,children:d.status}),e.jsxs("div",{children:[e.jsx("strong",{children:Ct(d.roleId)}),e.jsx("p",{children:d.objective}),d.report?.summary?e.jsx("small",{children:d.report.summary}):null,s?e.jsx(Mi,{pendingAction:n,run:d,onRun:c}):null]})]},d.id))})]}),t.finalResults.length>0?e.jsx(Ti,{results:t.finalResults}):null]})}function Ti({results:t}){return e.jsx(V,{title:"Child Results",children:e.jsx("ol",{className:"goal-details-task-graph",children:t.slice(0,6).map(s=>e.jsxs("li",{className:"goal-details-task-node",children:[e.jsxs("div",{className:"goal-details-task-node-header",children:[e.jsx("span",{className:`goal-details-inline-state ${s.status}`,children:s.status}),e.jsxs("div",{children:[e.jsx("strong",{children:Ct(s.roleId)}),e.jsx("small",{children:s.objective})]})]}),e.jsx("p",{children:s.summary}),e.jsxs("div",{className:"goal-details-task-node-meta",children:[e.jsxs("span",{children:[s.refs.length," refs"]}),e.jsxs("span",{children:[s.testsRun.length+s.validationAttempts.length," checks"]}),e.jsxs("span",{children:[s.blockers.length," blockers"]}),e.jsx("span",{children:s.confidence?`${Z(s.confidence)} confidence`:"Confidence unknown"})]}),s.findings.length>0?e.jsxs("small",{children:["Findings: ",$e(s.findings,3)]}):null,s.changedFiles.length>0?e.jsxs("small",{children:["Files: ",$e(s.changedFiles,4)]}):null,s.testsRun.length>0?e.jsxs("small",{children:["Tests: ",$e(s.testsRun,3)]}):null,s.validationAttempts.length>0?e.jsxs("small",{children:["Validation: ",$e(s.validationAttempts,2)]}):null,s.refs.length>0?e.jsxs("small",{children:["Refs: ",$e(s.refs.map(Hi),4)]}):null,s.blockers.length>0?e.jsxs("small",{children:["Blockers: ",$e(s.blockers,3)]}):null,s.workspaceRetention?e.jsxs("small",{children:["Workspace: ",Ki(s.workspaceRetention)]}):null,s.importantMessages.length>0?e.jsxs("small",{children:["Messages: ",$e(s.importantMessages.map(Vi),2)]}):null]},s.runId))})})}function Mi({pendingAction:t,run:s,onRun:n}){const a=zi(s);return a.length===0?null:e.jsx("div",{className:"goal-details-actions",children:a.map(i=>{const u=`${s.id}:${i}`,c=t===u;return e.jsx("button",{type:"button",disabled:!!t,onClick:()=>{n(s.id,i)},children:c?"Working...":Ii(i)},i)})})}function zi(t){const s=[],n=Wi(t),a=Bi(t);return n&&s.push("cleanup"),a&&s.push("archive"),s}function Ii(t){return t==="cleanup"?"Clean":t==="archive"?"Archive":"Clean + archive"}function Wi(t){if(!xn(t))return!1;const s=lt(t.metadata);if(!s?.subagentWorkspace&&!s?.workspaceHandoff)return!1;const n=lt(s.lifecycleCleanup),a=lt(n?.workspaceCleanup),i=bn(a?.status);return i!=="removed"&&i!=="deleted"&&i!=="retained"&&i!=="skipped"}function Bi(t){if(!t.childSessionId||!xn(t))return!1;const s=lt(lt(t.metadata)?.childSessionArchive),n=bn(s?.status);return n!=="archived"&&n!=="already_archived"}function xn(t){return t.status==="completed"||t.status==="failed"||t.status==="cancelled"}function Oi(t){const s=t.latestMeaningfulUpdate;return s?`${Ct(s.roleId)} ${s.status}: ${s.message}`:"No structured update"}function Ui(t,s){if(t<=0&&s<=0)return"0 tokens";const n=`${s} ${s===1?"request":"requests"}`;return`${Gi(t)} tokens · ${n}`}function Ct(t){return t.slice(0,1).toUpperCase()+t.slice(1).replace(/[-_]+/g," ")}function Hi(t){return`${t.kind}: ${t.label}`}function Vi(t){return`${Z(t.kind)}: ${t.body}`}function Ki(t){const s=t.expiresAt?`until ${qi(t.expiresAt)}`:"for inspection",n=t.trigger?` · ${Z(t.trigger)}`:"";return`retained ${s}${n}`}function $e(t,s){const n=t.slice(0,s),a=t.length-n.length;return a>0?`${n.join(", ")} +${a}`:n.join(", ")}function Gi(t){if(t<1e3)return String(t);if(t>=1e6){const n=t/1e6;return`${Js(n,n<10?2:1)}M`}const s=t/1e3;return`${Js(s,s<10?1:0)}k`}function qi(t){const s=new Date(t);return Number.isNaN(s.getTime())?t:s.toLocaleString([],{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function Js(t,s){return t.toFixed(s).replace(/\.0+$/,"").replace(/(\.\d*?)0+$/,"$1")}function Xi(){return e.jsxs("div",{className:"goal-details-empty",children:[e.jsx(ot,{size:18}),e.jsx("span",{children:"No active Goal or Create workflow."})]})}function V({children:t,title:s}){return e.jsxs("section",{className:"goal-details-section",children:[e.jsx("h2",{children:s}),t]})}function rt({rows:t}){return e.jsx("dl",{className:"goal-details-grid",children:t.map(([s,n])=>e.jsxs("div",{children:[e.jsx("dt",{children:s}),e.jsx("dd",{children:n})]},s))})}function St({refs:t}){return e.jsx("ul",{className:"goal-details-ref-list",children:t.map(s=>e.jsxs("li",{children:[e.jsx("code",{title:s.primary,children:s.primary}),e.jsx("span",{children:s.secondary})]},s.id))})}function lt(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function bn(t){return typeof t=="string"&&t.trim()?t.trim():null}function Z(t){return t.split(/[_-]/g).filter(Boolean).map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join(" ")}function Zi(t){return t==="ready_local"||t==="published_hosted"?"success":t==="blocked"||t==="failed"||t==="cancelled"?"danger":t==="awaiting_questions"||t==="awaiting_plan_approval"?"warning":"active"}function Qi({sandboxId:t,connection:s}){const[n,a]=l.useState(null),[i,u]=l.useState([]),[c,d]=l.useState(null),[p,x]=l.useState(null),[o,b]=l.useState(null),[S,k]=l.useState(null);Ae(o,{prefix:"Sandbox"}),Ae(S,{prefix:"Sandbox integrations"});const N=n?.integrationLeases??[],F=l.useMemo(()=>i.filter(v=>v.status==="active"),[i]),T=l.useMemo(()=>Ji(n),[n]),I=l.useCallback(async()=>{if(!s){b("OpenPond App server is not connected.");return}if(!t){a(null),u([]),b(null);return}d("summary"),b(null);try{const v=await z.sandbox(s,t),$=await z.integrationConnections(s,en(v.sandbox));a(v.sandbox),u($.connections),k(null)}catch(v){b(v instanceof Error?v.message:String(v))}finally{d(null)}},[s,t]),K=l.useCallback(async()=>{if(!(!s||!n)){x("load"),k(null);try{const[v,$]=await Promise.all([z.integrationConnections(s,en(n)),z.sandboxIntegrationLeases(s,n.id)]);u(v.connections),a($.sandbox)}catch(v){k(v instanceof Error?v.message:String(v))}finally{x(null)}}},[s,n]),H=l.useCallback(async v=>{if(!s||!n)return;const $=At(v.provider),D=$?Pt($):null,M=D?.leasePolicy.allowedCapabilityIds??[];if(!$||!D?.leasePolicy.leaseable||M.length===0){k(`${re(v.provider)} cannot be attached to this sandbox.`);return}x(`attach:${v.id}`),k(null);try{const E=await z.attachSandboxIntegrationConnection(s,n.id,{connectionId:v.id,provider:v.provider,capabilities:M,...v.scopes.length>0?{scopes:v.scopes}:{},...D.leasePolicy.defaultTtlSeconds?{ttlSeconds:D.leasePolicy.defaultTtlSeconds}:{},required:!1});a(E.sandbox)}catch(E){k(E instanceof Error?E.message:String(E))}finally{x(null)}},[s,n]),W=l.useCallback(async v=>{if(!(!s||!n)){x(`remove:${v}`),k(null);try{const $=await z.removeSandboxIntegrationLease(s,n.id,v);a($.sandbox)}catch($){k($ instanceof Error?$.message:String($))}finally{x(null)}}},[s,n]);return l.useEffect(()=>{I()},[I]),t?e.jsxs("div",{className:"sandbox-summary-tab",children:[e.jsxs("section",{className:"sandbox-workspace-section",children:[e.jsxs("div",{className:"sandbox-workspace-heading",children:[e.jsx("h3",{children:"Sandbox"}),e.jsxs("div",{className:"sandbox-workspace-heading-actions",children:[n?e.jsx("span",{children:n.state}):null,e.jsx("button",{type:"button",className:"diff-icon-button",title:"Refresh summary","aria-label":"Refresh summary",disabled:c!==null,onClick:()=>{I()},children:c==="summary"?e.jsx(Ue,{className:"spinning",size:14}):e.jsx(is,{size:14})})]})]}),n?e.jsxs("dl",{className:"sandbox-workspace-kv",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Sandbox"}),e.jsx("dd",{children:tn(n.id)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Spend"}),e.jsxs("dd",{children:[ss(n.reservation.capturedUsd)," / ",ss(n.budget.maxUsd)]})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Reservation"}),e.jsx("dd",{children:n.reservation.status})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Idle cleanup"}),e.jsx("dd",{children:n.quotas?.idleTimeoutSeconds?`${Math.round(n.quotas.idleTimeoutSeconds/60)} min`:"-"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Updated"}),e.jsx("dd",{children:gn(n.updatedAt)})]}),T?e.jsxs("div",{children:[e.jsx("dt",{children:"Receipt"}),e.jsxs("dd",{children:[tn(T.id)," / ",ss(T.totalUsd)]})]}):null]}):e.jsxs("div",{className:"sandbox-workspace-loading",children:[c==="summary"?e.jsx(Ue,{className:"spinning",size:16}):null,e.jsx("span",{children:c==="summary"?"Loading sandbox":"Sandbox unavailable"})]})]}),e.jsxs("section",{className:"sandbox-workspace-section",children:[e.jsxs("div",{className:"sandbox-workspace-heading",children:[e.jsx("h3",{children:"Integrations"}),e.jsxs("div",{className:"sandbox-workspace-heading-actions",children:[e.jsx("span",{children:N.length}),e.jsx("button",{type:"button",className:"diff-icon-button",title:"Refresh integrations","aria-label":"Refresh integrations",disabled:p!==null||!n,onClick:()=>{K()},children:p==="load"?e.jsx(Ue,{className:"spinning",size:14}):e.jsx(is,{size:14})})]})]}),N.length>0?e.jsx("div",{className:"sandbox-workspace-integration-list",children:N.map(v=>e.jsxs("div",{className:"sandbox-workspace-integration-row",children:[e.jsxs("div",{className:"sandbox-workspace-integration-main",children:[e.jsx("span",{children:re(v.provider)}),e.jsxs("small",{children:[v.required?"required":"optional"," / ",sr(v)," / ",Yi(v)]})]}),e.jsx("button",{type:"button",className:"diff-icon-button",title:`Revoke ${re(v.provider)} lease`,"aria-label":`Revoke ${re(v.provider)} lease`,disabled:p!==null,onClick:()=>{W(v.leaseId)},children:p===`remove:${v.leaseId}`?e.jsx(Ue,{className:"spinning",size:14}):e.jsx(wa,{size:14})}),e.jsxs("div",{className:"sandbox-workspace-chip-row",children:[v.capabilities.slice(0,5).map($=>e.jsx("span",{children:tr(v.provider,$)},$)),v.capabilities.length>5?e.jsxs("span",{children:["+",v.capabilities.length-5]}):null]})]},v.leaseId))}):e.jsx("p",{className:"sandbox-workspace-empty",children:"No active integration leases."}),F.length>0?e.jsx("div",{className:"sandbox-workspace-integration-list",children:F.map(v=>{const $=N.some(E=>E.provider===v.provider),M=er(v)?.leasePolicy.allowedCapabilityIds.length??0;return e.jsxs("div",{className:"sandbox-workspace-integration-row compact",children:[e.jsxs("div",{className:"sandbox-workspace-integration-main",children:[e.jsx("span",{children:nr(v)}),e.jsx("small",{children:ar(v,M)})]}),e.jsx("button",{type:"button",className:"diff-icon-button",title:$?`${re(v.provider)} already attached`:`Attach ${re(v.provider)}`,"aria-label":$?`${re(v.provider)} already attached`:`Attach ${re(v.provider)}`,disabled:$||p!==null||M===0,onClick:()=>{H(v)},children:p===`attach:${v.id}`?e.jsx(Ue,{className:"spinning",size:14}):e.jsx(Ci,{size:14})})]},v.id)})}):e.jsx("p",{className:"sandbox-workspace-empty",children:"No connected accounts available."})]})]}):e.jsx("div",{className:"sandbox-summary-tab",children:e.jsx("p",{className:"sandbox-workspace-empty",children:"No sandbox is attached yet."})})}function en(t){return{status:"active"}}function Yi(t){return t.proxyUrl?"runtime proxy available":"metadata only, no runtime proxy"}function Ji(t){return t?.receipts?.at(-1)??null}function er(t){const s=At(t.provider);return s?Pt(s):null}function re(t){const s=At(t),n=s?Pt(s):null;return n?n.label:t==="microsoft_teams"?"Microsoft Teams":t?t.replace(/_/g," "):"Integration"}function tr(t,s){const n=At(t);return(n?Pt(n):null)?.capabilities.find(i=>i.id===s)?.label??s}function sr(t){return t.expiresAt?`expires ${gn(t.expiresAt)}`:"active"}function nr(t){const s=t.providerAccountName?.trim();return s?`${re(t.provider)} / ${s}`:re(t.provider)}function ar(t,s){const n=[];return t.providerWorkspaceName&&n.push(t.providerWorkspaceName),n.push(`${s} lease ${s===1?"capability":"capabilities"}`),t.scopes.length>0&&n.push(`${t.scopes.length} ${t.scopes.length===1?"scope":"scopes"}`),n.join(" / ")}function tn(t){return t.length>10?`${t.slice(0,8)}...`:t}function gn(t){if(!t)return"-";const s=new Date(t);return Number.isNaN(s.valueOf())?"-":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(s)}function ss(t){const s=Number(t??0);return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:s>=10?2:4}).format(Number.isFinite(s)?s:0)}function ir({summary:t}){const s=ti(t.taskset),n=t.taskset.learningSignals.demonstrations.filter(d=>d.approved).length,a=t.taskset.tasks.filter(d=>d.split==="frozen_eval").length,i=t.plan?.recipe.method==="sft"||t.plan?.recipe.method==="grpo"?t.plan.recipe:null,u=si(t.taskset,t.plan),c=t.job?ni(t.job.status,t.job.completedAt,t.job.updatedAt):null;return e.jsxs("div",{className:"training-sidebar-summary",children:[e.jsxs("header",{children:[e.jsx("h2",{children:ai(t.taskset.name)}),e.jsx("span",{children:t.job?ii(t.job.status):t.taskset.readiness?.ready?"Ready to train":"Needs review"})]}),e.jsxs("section",{children:[e.jsx("h3",{children:"Run"}),e.jsxs("dl",{children:[e.jsx(U,{label:"Primary recommendation",value:s.toUpperCase()}),e.jsx(U,{label:"Training stage",value:u}),e.jsx(U,{label:"Base model",value:i?.baseModel.id??"Not selected"}),e.jsx(U,{label:"Compute",value:t.plan?ri(t.plan.destinationId):"Not selected"}),e.jsx(U,{label:"Started",value:li(t.job?.startedAt??null)}),e.jsx(U,{label:"Duration",value:oi(t.job?.startedAt??null,c)})]})]}),e.jsxs("section",{children:[e.jsx("h3",{children:"Data"}),e.jsxs("dl",{children:[e.jsx(U,{label:"Training examples",value:String(n)}),e.jsx(U,{label:"Test examples",value:String(a)}),e.jsx(U,{label:"Dataset sources",value:String(t.taskset.sourceRefs.length)})]})]}),i?e.jsxs("section",{children:[e.jsx("h3",{children:"Recipe"}),e.jsxs("dl",{children:[i.method==="grpo"?e.jsx(U,{label:"RL loss",value:i.loss.method==="gspo-token"?"GSPO-token":i.loss.method.toUpperCase()}):null,e.jsx(U,{label:"LoRA rank",value:String(i.lora.rank)}),e.jsx(U,{label:"Learning rate",value:String(i.optimizer.learningRate)}),e.jsx(U,{label:"Optimizer steps",value:String(i.optimizer.maxSteps)}),e.jsx(U,{label:i.method==="grpo"?"Prompt length":"Sequence length",value:String(i.method==="grpo"?i.dataset.maxPromptTokens:i.dataset.maxSequenceLength)})]})]}):null,e.jsxs("section",{children:[e.jsx("h3",{children:"Result"}),e.jsxs("dl",{children:[e.jsx(U,{label:"Adapter",value:t.lineage?`${u} ready`:"Not created"}),e.jsx(U,{label:"Evaluation",value:t.lineage?.frozenEvaluationArtifactId?"Completed":"Not completed"}),e.jsx(U,{label:"Artifacts",value:String(t.artifacts.length)})]})]})]})}function U({label:t,value:s}){return e.jsxs("div",{children:[e.jsx("dt",{children:t}),e.jsx("dd",{children:s})]})}function rr(t){const s=sn("","","folder");for(const n of t){const a=n.endsWith("/"),i=n.split("/").filter(Boolean);if(i.length===0)continue;let u=s,c="";for(let d=0;d<i.length;d+=1){const p=i[d];c=c?`${c}/${p}`:p;const x=!a&&d===i.length-1?"file":"folder",o=`${x}:${p}`;let b=u.childMap.get(o);b||(b=sn(p,c,x),u.childMap.set(o,b),u.children.push(b)),u=b}}return jn(s.children)}function sn(t,s,n){return{name:t,path:s,type:n,children:[],childMap:new Map}}function jn(t){return t.sort((s,n)=>s.type!==n.type?s.type==="folder"?-1:1:s.name.localeCompare(n.name)).map(s=>({name:s.name,path:s.path,type:s.type,children:jn(s.children)}))}function us({className:t,currentStatus:s,onSetStatus:n}){const a=s==="pinned",i=s==="saved_for_later";return e.jsxs("span",{className:`workspace-file-bookmark-actions ${t??"workspace-file-heading-actions"}`,children:[e.jsx("button",{type:"button",className:a?"active":void 0,"data-tooltip":a?"Unpin file":"Pin file","aria-label":a?"Unpin file":"Pin file","aria-pressed":a,onClick:()=>n(a?"none":"pinned"),children:a?e.jsx(Pa,{size:14}):e.jsx(La,{size:14})}),e.jsx("button",{type:"button",className:i?"active":void 0,"data-tooltip":i?"Remove from Save for later":"Save file for later","aria-label":i?"Remove from Save for later":"Save file for later","aria-pressed":i,onClick:()=>n(i?"none":"saved_for_later"),children:i?e.jsx(Da,{size:14}):e.jsx(_a,{size:14})})]})}function lr({changedByPath:t,expandedFolderPaths:s,rootPath:n,repoFiles:a,selectedPath:i,getFileBookmarkStatus:u,onOpenFile:c,onSetFileBookmarkStatus:d,onToggleFolder:p}){const x=l.useMemo(()=>rr(a),[a]);return e.jsxs("div",{className:"workspace-file-tree-view",children:[e.jsxs("div",{className:"workspace-file-tree-header",children:[e.jsx(Nt,{size:14}),e.jsx("strong",{title:n??void 0,children:n?n.split("/").at(-1):"Files"}),e.jsx("span",{children:a.length})]}),e.jsx("div",{className:"workspace-file-tree",children:x.map(o=>e.jsx(vn,{changedByPath:t,expandedFolderPaths:s,node:o,rootPath:n,selectedPath:i,getFileBookmarkStatus:u,onOpenFile:c,onSetFileBookmarkStatus:d,onToggleFolder:p},`${o.type}:${o.path}`))})]})}function vn({changedByPath:t,depth:s=0,expandedFolderPaths:n,node:a,rootPath:i,selectedPath:u,getFileBookmarkStatus:c,onOpenFile:d,onSetFileBookmarkStatus:p,onToggleFolder:x}){const o=i?`${i}/${a.path}`:a.path,b=a.type==="folder"&&n.has(o),S=t.get(o),k=2+s*11;return a.type==="folder"?e.jsxs("div",{className:"workspace-file-tree-node",children:[e.jsxs("button",{type:"button",className:"workspace-file-tree-row folder","aria-expanded":b,style:{paddingLeft:k},onClick:()=>x(o),children:[b?e.jsx(Nt,{size:14}):e.jsx(Ta,{size:14}),e.jsx("span",{children:a.name})]}),b&&a.children.map(N=>e.jsx(vn,{changedByPath:t,depth:s+1,expandedFolderPaths:n,node:N,rootPath:i,selectedPath:u,getFileBookmarkStatus:c,onOpenFile:d,onSetFileBookmarkStatus:p,onToggleFolder:x},`${N.type}:${N.path}`))]}):e.jsxs("div",{className:`workspace-file-tree-row file ${S?"changed":""} ${u===o?"selected":""}`,style:{paddingLeft:k},children:[e.jsxs("button",{type:"button",className:"workspace-file-tree-row-main",title:o,onClick:()=>d(o),children:[e.jsx(ya,{size:13}),e.jsx("span",{children:a.name}),S&&e.jsxs("small",{children:[e.jsxs("span",{className:"diff-addition",children:["+",S.additions]}),e.jsxs("span",{className:"diff-deletion",children:["-",S.deletions]})]})]}),/\.html?$/i.test(o)&&e.jsx("button",{type:"button",className:"workspace-file-tree-bookmark-actions",title:"View source","aria-label":`View source for ${a.name}`,onClick:()=>d(o,{source:!0}),children:"</>"}),p?e.jsx(us,{className:"workspace-file-tree-bookmark-actions",currentStatus:c?.(o)??null,onSetStatus:N=>p(o,N)}):null]})}function nn({diff:t,expandedFolderPaths:s,rootPath:n,repoFiles:a,selectedPath:i,getFileBookmarkStatus:u,onOpenFile:c,onSetFileBookmarkStatus:d,onToggleFolder:p}){const x=t?.files??[],o=l.useMemo(()=>new Map(x.map(k=>[k.path,k])),[x]),b=n?.replace(/^\/+|\/+$/g,"")||null,S=l.useMemo(()=>{if(!b)return a;const k=`${b}/`;return a.filter(N=>N.startsWith(k)).map(N=>N.slice(k.length)).filter(Boolean)},[b,a]);return e.jsx("div",{className:"workspace-diff-files-view",children:e.jsx(lr,{changedByPath:o,expandedFolderPaths:s,rootPath:b,repoFiles:S,selectedPath:i,getFileBookmarkStatus:u,onOpenFile:c,onSetFileBookmarkStatus:d,onToggleFolder:p})})}function or({collapsed:t,editorControlsVisible:s,hideWhiteSpace:n,loadFullFiles:a,renderMarkdown:i,wordDiffs:u,wordWrap:c,onClose:d,onCopyGitApply:p,onRefresh:x,onToggleCollapsed:o,onToggleEditorControlsVisible:b,onToggleHideWhiteSpace:S,onToggleLoadFullFiles:k,onToggleRenderMarkdown:N,onToggleWordDiffs:F,onToggleWordWrap:T}){return e.jsxs("div",{className:"workspace-diff-options-menu",role:"menu",children:[e.jsx(ue,{icon:e.jsx(is,{size:14}),label:"Refresh",onClick:x,onClose:d}),e.jsx(ue,{checked:c,icon:e.jsx(Sa,{size:14}),label:"Enable word wrap",onClick:T,onClose:d}),e.jsx(ue,{checked:t,icon:e.jsx(gi,{size:14}),label:"Collapse all diffs",onClick:o,onClose:d}),e.jsx("div",{className:"workspace-diff-menu-divider"}),e.jsx(ue,{checked:s,icon:e.jsx(Si,{size:14}),label:"Show editor controls",onClick:b,onClose:d}),e.jsx(ue,{checked:i,icon:e.jsx(pn,{size:14}),label:"Render Markdown",onClick:N,onClose:d}),e.jsx(ue,{checked:!a,icon:e.jsx(ot,{size:14}),label:"Show diffs first",onClick:k,onClose:d}),e.jsx(ue,{checked:u,icon:e.jsx(xi,{size:14}),label:"Enable word diffs",onClick:F,onClose:d}),e.jsx(ue,{checked:n,icon:e.jsx(wi,{size:14}),label:"Hide white space",onClick:S,onClose:d}),e.jsx(ue,{icon:e.jsx(ui,{size:14}),label:"Copy git apply command",onClick:p,onClose:d})]})}function ue({checked:t,icon:s,label:n,onClick:a,onClose:i}){return e.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{a?.(),i()},children:[s,e.jsx("span",{children:n}),t&&e.jsx(Ma,{size:14})]})}function cr({addMenuOpen:t,expanded:s,filteredFiles:n,dirtyFilePaths:a,openFiles:i,goalDetailsAvailable:u,searchOpen:c,searchQuery:d,selectedPath:p,sideChatTabs:x=[],summaryAvailable:o,sourceStatus:b,sourceSwitcher:S,visibleTab:k,getFileBookmarkStatus:N,onCloseFileTab:F,onCloseSideChat:T,onCloseSearch:I,onOpenFile:K,onOpenBrowser:H,onOpenSearch:W,onOpenSideChat:v,onSearchQueryChange:$,onSetFileBookmarkStatus:D,onSelectFile:M,onSelectFiles:E,onSelectGoal:se,onSelectSummary:q,onSelectSideChat:X,onToggleAddMenu:B,onToggleExpanded:Q}){const ne=l.useRef(null);l.useEffect(()=>{if(!t&&!c)return;function w(){t&&B(),c&&I()}function O(_){ne.current?.contains(_.target)||w()}function P(_){_.key==="Escape"&&w()}return document.addEventListener("pointerdown",O),document.addEventListener("keydown",P),()=>{document.removeEventListener("pointerdown",O),document.removeEventListener("keydown",P)}},[t,I,B,c]);function Y(w){if(w.key==="Escape"){I();return}w.key==="Enter"&&n[0]&&K(n[0])}function oe(w){if(!["ArrowRight","ArrowLeft","Home","End"].includes(w.key))return;const O=w.target;if(!(O instanceof HTMLButtonElement)||O.getAttribute("role")!=="tab")return;const P=Array.from(w.currentTarget.querySelectorAll('button[role="tab"]')),_=P.indexOf(O);if(_<0||P.length===0)return;w.preventDefault();const Lt=Ha(_,P.length,w.key),Pe=P[Lt];if(!Pe)return;Pe.focus(),Pe.click();const ct=Pe.id;ct&&window.requestAnimationFrame(()=>document.getElementById(ct)?.focus())}return e.jsxs("div",{className:"workspace-diff-topbar",children:[e.jsxs("div",{className:"workspace-diff-tabs",role:"tablist","aria-label":"Right sidebar views",onKeyDown:oe,children:[u?e.jsxs("button",{type:"button",className:`workspace-diff-tab ${k==="goal"?"active":""}`,role:"tab","aria-selected":k==="goal",onClick:se,children:[e.jsx(ot,{size:14}),e.jsx("span",{children:"Goal"})]}):null,o&&q?e.jsxs("button",{type:"button",className:`workspace-diff-tab ${k==="summary"?"active":""}`,role:"tab","aria-selected":k==="summary",onClick:q,children:[e.jsx(Ys,{size:14}),e.jsx("span",{children:"Summary"})]}):null,e.jsxs("button",{type:"button",className:`workspace-diff-tab ${k==="files"?"active":""}`,role:"tab",id:"right-sidebar-files-tab","aria-controls":"right-sidebar-files-panel","aria-selected":k==="files",tabIndex:k==="files"?0:-1,onClick:E,children:[e.jsx(Nt,{size:14}),e.jsx("span",{children:"Files"})]}),i.map(w=>e.jsxs("div",{className:`workspace-diff-tab file ${k==="file"&&p===w.path?"active":""}`,children:[e.jsxs("button",{type:"button",className:"workspace-diff-tab-main",role:"tab","aria-selected":k==="file"&&p===w.path,title:w.path,onClick:()=>M(w.path),children:[e.jsx(ot,{className:"workspace-diff-tab-icon",size:13}),a.has(w.path)&&e.jsx("span",{className:"workspace-diff-tab-dirty","aria-hidden":"true"}),e.jsx("span",{children:w.path.split("/").pop()})]}),D?e.jsx(us,{className:"workspace-diff-tab-bookmark-actions",currentStatus:N?.(w.path)??null,onSetStatus:O=>D(w.path,O)}):null,e.jsx("button",{type:"button",className:"workspace-diff-tab-close",title:`Close ${w.path}`,onClick:O=>F(w.path,O),children:e.jsx(Xs,{size:12})})]},w.path)),x.map(w=>e.jsxs("div",{className:"workspace-diff-tab right-chat-tab",children:[e.jsxs("button",{type:"button",className:"workspace-diff-tab-main",role:"tab",id:`right-chat-tab-${w.id}`,"aria-controls":`right-chat-panel-${w.id}`,"aria-selected":!1,tabIndex:-1,title:w.title,onClick:()=>X?.(w.id),children:[w.running?e.jsx("span",{className:"right-chat-status-dot","aria-label":"Running"}):null,e.jsx("span",{children:w.title})]}),T?e.jsx("button",{type:"button",className:"workspace-diff-tab-close",title:`Close ${w.title}`,"aria-label":`Close ${w.title}`,onClick:O=>{O.stopPropagation(),T(w.id)},children:e.jsx(Xs,{size:12})}):null]},w.id)),e.jsxs("div",{className:"workspace-diff-add-anchor",ref:ne,children:[e.jsx("button",{type:"button",className:`workspace-diff-add-tab ${t||c?"active":""}`,title:"Add","aria-label":"Add to right sidebar",onClick:B,children:e.jsx(za,{size:15})}),t&&e.jsxs("div",{className:"workspace-diff-add-menu",role:"menu",children:[v?e.jsxs("button",{type:"button",role:"menuitem",onClick:v,children:[e.jsx(Ia,{size:14}),e.jsx("span",{children:"New task"}),e.jsx("kbd",{})]}):null,e.jsxs("button",{type:"button",role:"menuitem",onClick:E,children:[e.jsx(Nt,{size:14}),e.jsx("span",{children:"Files"}),e.jsx("kbd",{})]}),o&&q?e.jsxs("button",{type:"button",role:"menuitem",onClick:q,children:[e.jsx(Ys,{size:14}),e.jsx("span",{children:"Summary"}),e.jsx("kbd",{})]}):null,e.jsxs("button",{type:"button",role:"menuitem",onClick:W,children:[e.jsx(Wa,{size:14}),e.jsx("span",{children:"Open file"}),e.jsx("kbd",{children:"Ctrl+P"})]}),H?e.jsxs("button",{type:"button",role:"menuitem",onClick:H,children:[e.jsx(Ba,{size:14}),e.jsx("span",{children:"Browser"}),e.jsx("kbd",{children:"Ctrl+I"})]}):null]}),c&&e.jsxs("div",{className:"workspace-file-search-popover",children:[e.jsx("input",{autoFocus:!0,placeholder:"Search files",value:d,onChange:w=>$(w.target.value),onKeyDown:Y}),e.jsx("span",{children:"Files"}),e.jsx("div",{className:"workspace-file-search-results",children:n.length===0?e.jsx("small",{children:"Type to search for files"}):n.map(w=>e.jsx("button",{type:"button",onClick:()=>K(w),children:w},w))})]})]})]}),S||b?e.jsxs("div",{className:"workspace-diff-source-bar","aria-label":"Workspace source",children:[S?e.jsx("div",{className:"workspace-diff-source-toggle",role:"group","aria-label":"File source",children:S.options.map(w=>e.jsx("button",{type:"button",className:S.value===w.value?"active":"","aria-pressed":S.value===w.value,onClick:()=>S.onChange(w.value),children:w.label},w.value))}):null,b?e.jsx("span",{className:`workspace-diff-source-status ${b.tone}`,children:b.label}):null]}):null,e.jsx("button",{type:"button",className:"diff-icon-button",title:s?"Restore files panel":"Expand files panel","aria-label":s?"Restore files panel":"Expand files panel",onClick:Q,children:s?e.jsx(ci,{size:14}):e.jsx(Oa,{size:14})})]})}function dr({canCheckActiveFile:t,canSaveActiveFile:s,collapsed:n,editorControlsVisible:a,editorDiagnosticStatus:i,editorDiagnosticsChecking:u,hideWhiteSpace:c,loadFullFiles:d,menuOpen:p,renderMarkdown:x,showEditorCommandBar:o,showRenderMarkdownToggle:b,splitView:S,wordDiffs:k,wordWrap:N,onCopyGitApply:F,onEditorCheck:T,onEditorRedo:I,onEditorSave:K,onEditorUndo:H,onRefresh:W,onToggleCollapsed:v,onToggleEditorControlsVisible:$,onToggleHideWhiteSpace:D,onToggleLoadFullFiles:M,onToggleMenu:E,onToggleRenderMarkdown:se,onToggleSplitView:q,onToggleWordDiffs:X,onToggleWordWrap:B}){return e.jsx("div",{className:"workspace-diff-toolbar",children:e.jsxs("div",{className:"workspace-diff-toolbar-actions",children:[e.jsxs("div",{className:"workspace-diff-menu-anchor",children:[e.jsx("button",{type:"button",className:"diff-icon-button",title:"Diff options","aria-haspopup":"menu","aria-expanded":p,onClick:()=>E(),children:e.jsx(Ua,{size:15})}),p&&e.jsx(or,{collapsed:n,editorControlsVisible:a,hideWhiteSpace:c,loadFullFiles:d,renderMarkdown:x,wordDiffs:k,wordWrap:N,onClose:()=>E(!1),onCopyGitApply:F,onRefresh:W,onToggleCollapsed:v,onToggleEditorControlsVisible:$,onToggleHideWhiteSpace:D,onToggleLoadFullFiles:M,onToggleRenderMarkdown:se,onToggleWordDiffs:X,onToggleWordWrap:B})]}),o&&e.jsxs("div",{className:"workspace-editor-command-bar","aria-label":"Editor controls",children:[e.jsx("button",{type:"button",className:"diff-icon-button",title:"Save file","aria-label":"Save file",disabled:!s,onClick:K,children:e.jsx(di,{size:14})}),e.jsx("button",{type:"button",className:"diff-icon-button",title:"Undo","aria-label":"Undo",onClick:H,children:e.jsx(Ei,{size:14})}),e.jsx("button",{type:"button",className:"diff-icon-button",title:"Redo","aria-label":"Redo",onClick:I,children:e.jsx($i,{size:14})}),e.jsx("button",{type:"button",className:"diff-icon-button",title:"Check file","aria-label":"Check file",disabled:!t,onClick:T,children:u?e.jsx(Ue,{className:"spinning",size:14}):e.jsx(Zs,{size:14})}),i&&e.jsxs("span",{className:`workspace-editor-diagnostic-chip ${i.severity}`,children:[i.severity==="error"||i.severity==="warning"||i.severity==="unavailable"?e.jsx(fn,{size:13}):e.jsx(Zs,{size:13}),e.jsx("span",{children:i.label})]})]}),b&&e.jsx("button",{type:"button",className:`diff-icon-button ${x?"active":""}`,title:x?"Show Markdown source":"Render Markdown","aria-label":x?"Show Markdown source":"Render Markdown","aria-pressed":x,onClick:se,children:e.jsx(pn,{size:14})}),e.jsx("button",{type:"button",className:`diff-icon-button ${S?"active":""}`,title:S?"Show unified diff":"Show split diff","aria-label":S?"Show unified diff":"Show split diff","aria-pressed":S,onClick:q,children:e.jsx(vi,{size:14})})]})})}const ur={cjs:"typescript",css:"css",html:"html",js:"typescript",json:"json",jsx:"typescript",md:"markdown",mjs:"typescript",py:"python",sh:"shell",ts:"typescript",tsx:"typescript",yaml:"yaml",yml:"yaml"};function fs(t){const s=t.split("/").pop()?.toLowerCase()??"";if(s==="dockerfile")return"shell";if(s==="readme"||s==="readme.md")return"markdown";const n=s.includes(".")?s.split(".").pop()??"":"";return ur[n]??"text"}function fr(t,s){return t?s==="markdown"?pr(t):s==="json"?Ee(t,/("(?:\\.|[^"\\])*"(?=\s*:)|"(?:\\.|[^"\\])*"|[-]?\b\d+(?:\.\d+)?\b|\btrue\b|\bfalse\b|\bnull\b|[{}[\]:,])/g):s==="css"?Ee(t,/(\/\*.*?\*\/|#[\da-fA-F]{3,8}\b|--[\w-]+|[.#]?[\w-]+(?=\s*:)|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b\d+(?:\.\d+)?(?:px|rem|em|%|vh|vw)?\b|[{}():;,])/g):s==="html"?Ee(t,/(<!--.*?-->|<\/?[\w-]+|[\w:-]+(?==)|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|[<>/=])/g):s==="shell"?Ee(t,/(#.*$|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b(?:cd|cp|export|git|npm|pnpm|bun|yarn|rm|mkdir|test|if|then|fi|for|do|done|echo)\b|\$[\w_]+|&&|\|\||[|&;=])/g):s==="python"?Ee(t,/(#.*$|"""[\s\S]*?"""|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b(?:class|def|return|if|elif|else|for|while|try|except|finally|with|as|import|from|None|True|False|async|await|lambda|yield)\b|\b[A-Z][\w]*\b|\b\d+(?:\.\d+)?\b|[+\-*/%=<>!&|.:,()[\]{}]+)/g):Ee(t,/(\/\/.*$|\/\*.*?\*\/|`(?:\\.|[^`\\])*`|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b(?:abstract|as|async|await|boolean|break|case|catch|class|const|continue|default|else|enum|export|extends|false|finally|for|from|function|if|import|in|interface|let|new|null|number|of|return|string|switch|throw|true|try|type|undefined|void|while)\b|\b[A-Z][\w]*\b|\b\d+(?:\.\d+)?\b|[+\-*/%=<>!&|?:.,()[\]{}]+)/g):[{text:" ",kind:"plain"}]}function pr(t){return/^\s{0,3}#{1,6}\s/.test(t)?[{text:t,kind:"keyword"}]:/^\s*[-*+]\s/.test(t)?[{text:t,kind:"property"}]:Ee(t,/(`[^`]+`|\*\*[^*]+\*\*|\[[^\]]+\]\([^)]+\)|https?:\/\/\S+)/g)}function hr(t){return/^(\/\/|#|\/\*|<!--)/.test(t)?"comment":/^["'`]/.test(t)?"string":/^[-]?\d/.test(t)||/^#[\da-fA-F]{3,8}\b/.test(t)?"number":/^\b[A-Z]/.test(t)?"type":/^[.#]?[\w-]+$/.test(t)&&t.includes("-")?"property":/^(?:[{}()[\],.:;<>/=+\-*&|!?%]+)$/.test(t)?"operator":/^(?:--|\$)/.test(t)?"property":"keyword"}function Ee(t,s){const n=[];let a=0;for(const i of t.matchAll(s)){const u=i.index??0;u>a&&n.push({text:t.slice(a,u),kind:"plain"});const c=i[0];if(n.push({text:c,kind:hr(c)}),a=u+c.length,/^(\/\/|#|<!--)/.test(c))break}return a<t.length&&n.push({text:t.slice(a),kind:"plain"}),n.length>0?n:[{text:t,kind:"plain"}]}function Rt({language:t,text:s}){return e.jsx(e.Fragment,{children:fr(s,t).map((n,a)=>e.jsx("span",{className:`syntax-token ${n.kind}`,children:n.text},`${a}-${n.text}`))})}function mr({path:t,contentBase64:s}){const n=t.replace(/\\/g,"/").split("/").pop()||"document",a=l.useMemo(()=>{try{const d=atob(s.replace(/\s/g,"")),p=Uint8Array.from(d,x=>x.charCodeAt(0));return new Blob([p],{type:xr(t)})}catch{return null}},[s,t]),[i,u]=l.useState(null);l.useEffect(()=>{if(!a)return;const d=URL.createObjectURL(a);return u({blob:a,url:d}),()=>URL.revokeObjectURL(d)},[a]);const c=i?.blob===a?i.url:null;return a?c?e.jsxs("div",{className:"workspace-document-preview",children:[e.jsxs("div",{className:"workspace-document-preview-card",children:[e.jsx("strong",{children:n}),e.jsx("span",{children:/\.pdf$/i.test(t)?"PDF document":"Word document"}),e.jsx("a",{href:c,download:n,"aria-label":"Download document",title:"Download document",children:e.jsx(Va,{size:16,"aria-hidden":"true"})})]}),e.jsx("iframe",{src:c,title:`${t} preview`})]}):e.jsx("div",{className:"workspace-diff-code-empty",role:"status",children:"Loading document…"}):e.jsx("div",{className:"workspace-diff-code-empty",children:"Document preview unavailable."})}function xr(t){return/\.pdf$/i.test(t)?"application/pdf":/\.docx$/i.test(t)?"application/vnd.openxmlformats-officedocument.wordprocessingml.document":"application/msword"}const br=`
3
3
 
4
- [file truncated]`,gr=l.lazy(()=>ka(()=>import("./WorkspaceMonacoEditor-BCKzvSj2.js").then(t=>t.jc),__vite__mapDeps([0,1,2,3]))),ns=6,jr=18,Fe=22,an=44,vr=160,rn=12;function $t({path:t,workspaceName:s,workspaceRootPath:n,onSelectPath:a}){const i=ls(t,n),u=Ga(i),c=u?kr(i):s?.trim()||"Workspace",p=(u&&c!=="/"&&i.startsWith(`${c}/`)?i.slice(c.length+1):i).split("/").filter(Boolean),x=!!(a&&!u);return e.jsxs("span",{className:"workspace-file-breadcrumbs",title:u?i:`${c} > ${i}`,children:[a&&!u?e.jsx("button",{type:"button",onClick:()=>a(null),children:c}):e.jsx("span",{children:c}),p.map((o,b)=>{const S=b===p.length-1,k=p.slice(0,b+1).join("/");return e.jsxs("span",{className:"workspace-file-breadcrumb-segment",children:[e.jsx(qa,{size:13}),a&&x&&!S?e.jsx("button",{type:"button",onClick:()=>a(k),children:o}):e.jsx("span",{children:o})]},`${b}-${o}`)})]})}function kr(t){const s=/^[A-Za-z]:\//.exec(t);return s?s[0].slice(0,-1):"/"}function wr({collapsed:t=!1,diagnostics:s=[],draftContent:n,editable:a=!1,editorRef:i,error:u,file:c,hideWhiteSpace:d=!1,headerActions:p,imageSrc:x,loading:o,loadFullFiles:b,onOpenImage:S,onSelectBreadcrumbPath:k,onDraftContentChange:N,onLspAction:F,onSave:T,renderMarkdown:I,saveError:K,saving:H=!1,splitView:W=!1,wordDiffs:v=!1,wordWrap:$,workspaceName:D,workspaceRootPath:M}){Pe(u,{prefix:"File preview"}),Pe(K,{prefix:"Save failed"});const E=n??c.content??"",se=l.useMemo(()=>E.split(`
4
+ [file truncated]`,gr=l.lazy(()=>ka(()=>import("./WorkspaceMonacoEditor-TxLyhzNp.js").then(t=>t.jc),__vite__mapDeps([0,1,2,3]))),ns=6,jr=18,Fe=22,an=44,vr=160,rn=12;function $t({path:t,workspaceName:s,workspaceRootPath:n,onSelectPath:a}){const i=ls(t,n),u=Ga(i),c=u?kr(i):s?.trim()||"Workspace",p=(u&&c!=="/"&&i.startsWith(`${c}/`)?i.slice(c.length+1):i).split("/").filter(Boolean),x=!!(a&&!u);return e.jsxs("span",{className:"workspace-file-breadcrumbs",title:u?i:`${c} > ${i}`,children:[a&&!u?e.jsx("button",{type:"button",onClick:()=>a(null),children:c}):e.jsx("span",{children:c}),p.map((o,b)=>{const S=b===p.length-1,k=p.slice(0,b+1).join("/");return e.jsxs("span",{className:"workspace-file-breadcrumb-segment",children:[e.jsx(qa,{size:13}),a&&x&&!S?e.jsx("button",{type:"button",onClick:()=>a(k),children:o}):e.jsx("span",{children:o})]},`${b}-${o}`)})]})}function kr(t){const s=/^[A-Za-z]:\//.exec(t);return s?s[0].slice(0,-1):"/"}function wr({collapsed:t=!1,diagnostics:s=[],draftContent:n,editable:a=!1,editorRef:i,error:u,file:c,hideWhiteSpace:d=!1,headerActions:p,imageSrc:x,loading:o,loadFullFiles:b,onOpenImage:S,onSelectBreadcrumbPath:k,onDraftContentChange:N,onLspAction:F,onSave:T,renderMarkdown:I,saveError:K,saving:H=!1,splitView:W=!1,wordDiffs:v=!1,wordWrap:$,workspaceName:D,workspaceRootPath:M}){Ae(u,{prefix:"File preview"}),Ae(K,{prefix:"Save failed"});const E=n??c.content??"",se=l.useMemo(()=>E.split(`
5
5
  `).slice(0,800),[E]),q=fs(c.path),X=n!=null||c.content!=null,B=E.endsWith(br),Q=I&&X&&rs(c.path),ne=X&&Ka(c.path)&&Nr(E);return x?e.jsxs("div",{className:"workspace-file-preview",children:[e.jsxs("div",{className:"workspace-diff-file-heading",children:[e.jsxs("div",{children:[e.jsx($t,{path:c.path,workspaceName:D,workspaceRootPath:M,onSelectPath:k}),e.jsxs("span",{className:"diff-addition",children:["+",c.additions]}),e.jsxs("span",{className:"diff-deletion",children:["-",c.deletions]})]}),p]}),e.jsx("div",{className:"workspace-file-image-stage",children:e.jsx("button",{type:"button",className:"workspace-file-image-button","aria-label":`Open image preview for ${c.path}`,onClick:S,children:e.jsx("img",{alt:c.path,decoding:"async",src:x})})})]}):!b&&c.patch||!X&&c.patch?W?e.jsx(Sr,{collapsed:t,file:c,hideWhiteSpace:d,onSelectBreadcrumbPath:k,wordDiffs:v,wordWrap:$,headerActions:p,workspaceName:D,workspaceRootPath:M}):e.jsx(yr,{collapsed:t,file:c,hideWhiteSpace:d,wordWrap:$,workspaceName:D,workspaceRootPath:M,onSelectBreadcrumbPath:k,headerActions:p}):e.jsxs("div",{className:`workspace-file-preview ${$?"wrap":""}`,children:[e.jsxs("div",{className:"workspace-diff-file-heading",children:[e.jsxs("div",{children:[e.jsx($t,{path:c.path,workspaceName:D,workspaceRootPath:M,onSelectPath:k}),e.jsxs("span",{className:"diff-addition",children:["+",c.additions]}),e.jsxs("span",{className:"diff-deletion",children:["-",c.deletions]})]}),e.jsxs("span",{className:"workspace-file-heading-end",children:[H?e.jsx("span",{className:"workspace-file-save-state",children:"Saving"}):null,p]})]}),X?Q?e.jsx("div",{className:"workspace-markdown-preview",children:e.jsx(Na,{content:E})}):ne?e.jsx(mr,{path:c.path,contentBase64:E}):a&&!B?e.jsx(l.Suspense,{fallback:e.jsx("div",{className:"workspace-diff-code-empty",children:"Loading editor"}),children:e.jsx(gr,{diagnostics:s,filePath:c.path,onChange:Y=>N?.(Y),onLspAction:F,onSave:()=>T?.(),ref:i,value:E,wordWrap:$})}):e.jsx("div",{className:"workspace-file-code",children:se.map((Y,oe)=>e.jsxs("div",{className:"workspace-file-code-row",children:[e.jsx("span",{children:oe+1}),e.jsx("code",{children:e.jsx(Rt,{language:q,text:Y||" "})})]},`${oe}-${Y}`))}):e.jsx("div",{className:"workspace-diff-code-empty",children:o?"Loading file content":"No file content available."})]})}function yr({collapsed:t=!1,file:s,hideWhiteSpace:n=!1,wordWrap:a,workspaceName:i,workspaceRootPath:u,onSelectBreadcrumbPath:c,headerActions:d}){const p=l.useMemo(()=>wn(s.patch,n),[s.patch,n]),x=fs(s.path);return e.jsxs("div",{className:`workspace-diff-preview ${a?"wrap":""}`,children:[e.jsxs("div",{className:"workspace-diff-file-heading",children:[e.jsxs("div",{children:[e.jsx($t,{path:s.path,workspaceName:i??null,workspaceRootPath:u,onSelectPath:c}),e.jsxs("span",{className:"diff-addition",children:["+",s.additions]}),e.jsxs("span",{className:"diff-deletion",children:["-",s.deletions]})]}),d]}),t?e.jsx("div",{className:"workspace-diff-code-empty",children:"Diff collapsed"}):e.jsx(kn,{ariaLabel:`${s.path} diff`,className:"workspace-diff-code",emptyMessage:"No patch available.",rows:p,renderRow:(o,b)=>o.kind==="spacer"?e.jsx("div",{className:"workspace-diff-spacer",role:"row",children:o.label},`${o.label}-${b}`):e.jsxs("div",{className:`workspace-diff-code-row ${o.kind}`,role:"row",children:[e.jsx("span",{className:"workspace-diff-line-number",role:"cell",children:o.newLine||o.oldLine}),e.jsx("code",{role:"cell",children:e.jsx(Rt,{language:x,text:o.newContent||o.oldContent||" "})})]},`${o.oldLine}-${o.newLine}-${b}`),wordWrap:a})]})}function Sr({collapsed:t,file:s,hideWhiteSpace:n,wordDiffs:a,wordWrap:i,workspaceName:u,workspaceRootPath:c,onSelectBreadcrumbPath:d,headerActions:p}){const x=l.useMemo(()=>wn(s.patch,n),[s.patch,n]),o=fs(s.path);return e.jsxs("div",{className:`workspace-diff-preview split ${i?"wrap":""} ${a?"word-diffs":""}`,children:[e.jsxs("div",{className:"workspace-diff-file-heading",children:[e.jsxs("div",{children:[e.jsx($t,{path:s.path,workspaceName:u,workspaceRootPath:c,onSelectPath:d}),e.jsxs("span",{className:"diff-addition",children:["+",s.additions]}),e.jsxs("span",{className:"diff-deletion",children:["-",s.deletions]})]}),e.jsxs("span",{className:"workspace-file-heading-end",children:[p,e.jsx(Ca,{size:14})]})]}),t?e.jsx("div",{className:"workspace-diff-code-empty",children:"Diff collapsed"}):e.jsx(kn,{ariaLabel:`${s.path} split diff`,className:"workspace-split-code",emptyMessage:"No patch available.",rows:x,renderRow:(b,S)=>b.kind==="spacer"?e.jsx("div",{className:"workspace-diff-spacer split",role:"row",children:b.label},`${b.label}-${S}`):e.jsxs("div",{className:`workspace-split-row ${b.kind}`,role:"row",children:[e.jsx("span",{className:"workspace-diff-line-number old",role:"cell",children:b.oldLine}),e.jsx("code",{className:"old",role:"cell",children:e.jsx(Rt,{language:o,text:b.oldContent||" "})}),e.jsx("span",{className:"workspace-diff-line-number new",role:"cell",children:b.newLine}),e.jsx("code",{className:"new",role:"cell",children:e.jsx(Rt,{language:o,text:b.newContent||" "})})]},`${b.oldLine}-${b.newLine}-${S}`),wordWrap:i})]})}function Nr(t){return t.length>0&&/^[A-Za-z0-9+/=\s]+$/.test(t)}function kn({ariaLabel:t,className:s,emptyMessage:n,rows:a,renderRow:i,wordWrap:u}){const c=!u&&a.length>vr,{endIndex:d,offsetTop:p,scrollRef:x,startIndex:o,totalHeight:b}=Cr(a.length,c);return a.length===0?e.jsx("div",{className:s,role:"table","aria-label":t,children:e.jsx("div",{className:"workspace-diff-code-empty",children:n})}):c?e.jsx("div",{className:`${s} virtualized`,ref:x,role:"table","aria-label":t,"aria-rowcount":a.length,children:e.jsx("div",{className:"workspace-diff-virtual-spacer",style:{height:b},children:e.jsx("div",{className:"workspace-diff-virtual-window",style:{transform:`translateY(${p}px)`},children:a.slice(o,d).map((S,k)=>i(S,o+k))})})}):e.jsx("div",{className:s,role:"table","aria-label":t,children:a.map(i)})}function Cr(t,s){const n=l.useRef(null),[a,i]=l.useState({height:Fe*an,scrollTop:0}),u=l.useCallback(()=>{const x=n.current;x&&i({height:x.clientHeight||Fe*an,scrollTop:x.scrollTop})},[]);if(l.useEffect(()=>{if(!s)return;const x=n.current;if(!x)return;u();let o=0;const b=()=>{if(typeof window>"u"){u();return}window.cancelAnimationFrame(o),o=window.requestAnimationFrame(u)};x.addEventListener("scroll",b,{passive:!0});const S=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>b());return S?.observe(x),()=>{x.removeEventListener("scroll",b),S?.disconnect(),typeof window<"u"&&window.cancelAnimationFrame(o)}},[s,u]),!s)return{endIndex:t,offsetTop:0,scrollRef:n,startIndex:0,totalHeight:t*Fe};const c=Math.ceil(a.height/Fe),d=Math.max(0,Math.floor(a.scrollTop/Fe)-rn);return{endIndex:Math.min(t,d+c+rn*2),offsetTop:d*Fe,scrollRef:n,startIndex:d,totalHeight:t*Fe}}function wn(t,s){if(!t.trim())return[];const n=[];let a=0,i=0,u=null,c=null,d=!1,p=[];function x(){n.push(...Rr(p)),p=[]}function o(){d&&(x(),u=a,c=i,d=!1)}for(const b of t.split(`
6
6
  `)){const S=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(b);if(S){o();const F=Number(S[1]),T=Number(S[2]);if(u!==null&&c!==null){const I=Math.max(F-u,T-c,0);I>0&&n.push({kind:"spacer",label:yn(I)})}a=F,i=T,d=!0;continue}if(b.startsWith("diff --git")||b.startsWith("index ")||b.startsWith("--- ")||b.startsWith("+++ ")||!d||b.startsWith("\\ No newline"))continue;const k=b.slice(1)||" ";if(s&&!k.trim())continue;if(b.startsWith("+")){x(),n.push({kind:"addition",oldLine:"",newLine:String(i||""),oldContent:"",newContent:k}),i+=1;continue}if(b.startsWith("-")){x(),n.push({kind:"deletion",oldLine:String(a||""),newLine:"",oldContent:k,newContent:""}),a+=1;continue}const N=b.startsWith(" ")?b.slice(1)||" ":b||" ";s&&!N.trim()||(p.push({kind:"context",oldLine:String(a||""),newLine:String(i||""),oldContent:N,newContent:N}),a+=1,i+=1)}return o(),n}function Rr(t){if(t.length<jr)return t;const s=t.length-ns*2;return s<=0?t:[...t.slice(0,ns),{kind:"spacer",label:yn(s)},...t.slice(-ns)]}function yn(t){return`${t} unmodified ${t===1?"line":"lines"}`}const Ft=`
7
7
 
8
- [file truncated]`,$r="openpond.sandboxSourceReadback.v1";async function Fr(t,s,n,a=[]){let i;try{i=await z.sandboxDownloadFile(t,s,n,{maxBytes:256*1024})}catch(c){const d=c instanceof Error?c.message:String(c);if(!Er(d))throw c;const p=Lr(a,s,n);if(p)return p;const x=!!ps(a,s)?.artifact,o=await z.sandbox(t,s).catch(()=>null);throw new Error(Pr(n,o?.sandbox??null,d,{hasReadbackArtifact:x}))}const u=i.file.isBinary?i.file.contentsBase64||null:`${i.contents}${i.file.truncated?Ft:""}`;return{path:i.file.path,status:"",additions:0,deletions:0,patch:"",content:u}}function Er(t){return t.includes("sandbox_not_ready")&&t.includes("placement_stale")||t.includes("sandbox_not_running")}function Pr(t,s,n="sandbox_not_ready:placement_stale",a={}){const i=s?Dr(s):null,u=t||"this file";if(a.hasReadbackArtifact)return`Sandbox file content is unavailable because the stopped runtime placement is stale. The latest source checkpoint has a saved readback artifact, but ${u} was not captured as text. Resume the sandbox to inspect it. ${n}`;if(!i)return`Sandbox file content is unavailable because the stopped runtime placement is stale. Resume the sandbox to inspect ${u}. ${n}`;const c=i.preservedSha?i.preservedSha.slice(0,12):null,d=i.sourceRef?` (${i.sourceRef})`:"";return`Sandbox file content is unavailable because the stopped runtime placement is stale. The latest source checkpoint is saved${c?` at ${c}`:""}${d}, but this Desktop app cannot read file bodies from preserved source refs yet. Resume the sandbox to inspect ${u}.`}function Ar(t,s){if(!s)return null;const n=ps(t,s);if(!n)return null;const a=Nn(n.artifact),i=new Map;for(const d of hs(a))i.set(d.path,d);for(const d of Cn(n.artifact)){const p=Sn(n.artifact,d.path);p&&i.set(d.path,p)}const u=[...i.values()].sort((d,p)=>d.path.localeCompare(p.path)),c=[...new Set(u.map(d=>d.path))].sort((d,p)=>d.localeCompare(p));return{appId:s,repoPath:"",initialized:!0,dirty:!1,filesChanged:u.length,additions:u.reduce((d,p)=>d+p.additions,0),deletions:u.reduce((d,p)=>d+p.deletions,0),repoFiles:c,files:u,error:null,updatedAt:He(le(n.artifact)?.createdAt)??n.event.timestamp}}function Lr(t,s,n){if(!s)return null;const a=ps(t,s);return a?Sn(a.artifact,n):null}function ps(t,s){for(let n=t.length-1;n>=0;n-=1){const a=t[n];if(a?.name!=="workspace_action_result")continue;const i=le(a.data),u=le(i?.sourcePreservation),c=le(u?.sourceReadbackArtifact);if(c&&c.schemaVersion===$r&&c.sandboxId===s)return{artifact:c,event:a}}return null}function Sn(t,s){const n=hs(Nn(t)).find(u=>u.path===s),a=Cn(t).find(u=>u.path===s);if(!n&&!a)return null;const i=typeof a?.content=="string"?`${a.content}${a.truncated?Ft:""}`:null;return{path:a?.path??n?.path??s,status:n?.status??"M",additions:n?.additions??0,deletions:n?.deletions??0,patch:n?.patch??"",content:i}}function Nn(t){const s=le(t.patch);return typeof s?.text=="string"?s.text:""}function Cn(t){return(Array.isArray(t.files)?t.files:[]).map(n=>{const a=le(n),i=He(a?.path);return i?{path:i,...typeof a?.content=="string"?{content:a.content}:{},...a?.truncated===!0?{truncated:!0}:{}}:null}).filter(n=>!!n)}function Dr(t){const s=le(t.metadata)??{},n=le(s.sourcePreservation)??le(s.sourcePreserve),a=le(s.sourceChangeDetection),i=He(n?.preservedSha)??He(a?.preservedSha)??null,u=He(n?.sourceRef)??He(a?.sourceRef)??(typeof t.repoRef=="string"?t.repoRef:null);return!i&&!u?null:{preservedSha:i,sourceRef:u}}function le(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function He(t){return typeof t=="string"&&t.trim()?t.trim():null}async function _r(t,s,n,a){const i=await z.sandboxUploadFile(t,s,{path:n,contents:a});return await z.preserveSandboxSource(t,s,{message:"Auto-preserve source after right sidebar save"}),{path:i.file.path,status:"M",additions:0,deletions:0,patch:"",content:a}}function Tr(t){return t.filter(s=>s.type==="file").map(s=>s.path).sort((s,n)=>s.localeCompare(n))}function Mr(t,s){const n=new Map;for(const a of hs(t?.diff??""))n.set(a.path,a);for(const a of zr(s?.porcelain??""))n.has(a.path)||n.set(a.path,a);return[...n.values()].sort((a,i)=>a.path.localeCompare(i.path))}function hs(t){const s=[];let n=null;const a=()=>{n&&(s.push({path:n.path,status:n.status,additions:n.additions,deletions:n.deletions,patch:n.patchLines.join(`
8
+ [file truncated]`,$r="openpond.sandboxSourceReadback.v1";async function Fr(t,s,n,a=[]){let i;try{i=await z.sandboxDownloadFile(t,s,n,{maxBytes:256*1024})}catch(c){const d=c instanceof Error?c.message:String(c);if(!Er(d))throw c;const p=Lr(a,s,n);if(p)return p;const x=!!ps(a,s)?.artifact,o=await z.sandbox(t,s).catch(()=>null);throw new Error(Ar(n,o?.sandbox??null,d,{hasReadbackArtifact:x}))}const u=i.file.isBinary?i.file.contentsBase64||null:`${i.contents}${i.file.truncated?Ft:""}`;return{path:i.file.path,status:"",additions:0,deletions:0,patch:"",content:u}}function Er(t){return t.includes("sandbox_not_ready")&&t.includes("placement_stale")||t.includes("sandbox_not_running")}function Ar(t,s,n="sandbox_not_ready:placement_stale",a={}){const i=s?Dr(s):null,u=t||"this file";if(a.hasReadbackArtifact)return`Sandbox file content is unavailable because the stopped runtime placement is stale. The latest source checkpoint has a saved readback artifact, but ${u} was not captured as text. Resume the sandbox to inspect it. ${n}`;if(!i)return`Sandbox file content is unavailable because the stopped runtime placement is stale. Resume the sandbox to inspect ${u}. ${n}`;const c=i.preservedSha?i.preservedSha.slice(0,12):null,d=i.sourceRef?` (${i.sourceRef})`:"";return`Sandbox file content is unavailable because the stopped runtime placement is stale. The latest source checkpoint is saved${c?` at ${c}`:""}${d}, but this Desktop app cannot read file bodies from preserved source refs yet. Resume the sandbox to inspect ${u}.`}function Pr(t,s){if(!s)return null;const n=ps(t,s);if(!n)return null;const a=Nn(n.artifact),i=new Map;for(const d of hs(a))i.set(d.path,d);for(const d of Cn(n.artifact)){const p=Sn(n.artifact,d.path);p&&i.set(d.path,p)}const u=[...i.values()].sort((d,p)=>d.path.localeCompare(p.path)),c=[...new Set(u.map(d=>d.path))].sort((d,p)=>d.localeCompare(p));return{appId:s,repoPath:"",initialized:!0,dirty:!1,filesChanged:u.length,additions:u.reduce((d,p)=>d+p.additions,0),deletions:u.reduce((d,p)=>d+p.deletions,0),repoFiles:c,files:u,error:null,updatedAt:He(le(n.artifact)?.createdAt)??n.event.timestamp}}function Lr(t,s,n){if(!s)return null;const a=ps(t,s);return a?Sn(a.artifact,n):null}function ps(t,s){for(let n=t.length-1;n>=0;n-=1){const a=t[n];if(a?.name!=="workspace_action_result")continue;const i=le(a.data),u=le(i?.sourcePreservation),c=le(u?.sourceReadbackArtifact);if(c&&c.schemaVersion===$r&&c.sandboxId===s)return{artifact:c,event:a}}return null}function Sn(t,s){const n=hs(Nn(t)).find(u=>u.path===s),a=Cn(t).find(u=>u.path===s);if(!n&&!a)return null;const i=typeof a?.content=="string"?`${a.content}${a.truncated?Ft:""}`:null;return{path:a?.path??n?.path??s,status:n?.status??"M",additions:n?.additions??0,deletions:n?.deletions??0,patch:n?.patch??"",content:i}}function Nn(t){const s=le(t.patch);return typeof s?.text=="string"?s.text:""}function Cn(t){return(Array.isArray(t.files)?t.files:[]).map(n=>{const a=le(n),i=He(a?.path);return i?{path:i,...typeof a?.content=="string"?{content:a.content}:{},...a?.truncated===!0?{truncated:!0}:{}}:null}).filter(n=>!!n)}function Dr(t){const s=le(t.metadata)??{},n=le(s.sourcePreservation)??le(s.sourcePreserve),a=le(s.sourceChangeDetection),i=He(n?.preservedSha)??He(a?.preservedSha)??null,u=He(n?.sourceRef)??He(a?.sourceRef)??(typeof t.repoRef=="string"?t.repoRef:null);return!i&&!u?null:{preservedSha:i,sourceRef:u}}function le(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function He(t){return typeof t=="string"&&t.trim()?t.trim():null}async function _r(t,s,n,a){const i=await z.sandboxUploadFile(t,s,{path:n,contents:a});return await z.preserveSandboxSource(t,s,{message:"Auto-preserve source after right sidebar save"}),{path:i.file.path,status:"M",additions:0,deletions:0,patch:"",content:a}}function Tr(t){return t.filter(s=>s.type==="file").map(s=>s.path).sort((s,n)=>s.localeCompare(n))}function Mr(t,s){const n=new Map;for(const a of hs(t?.diff??""))n.set(a.path,a);for(const a of zr(s?.porcelain??""))n.has(a.path)||n.set(a.path,a);return[...n.values()].sort((a,i)=>a.path.localeCompare(i.path))}function hs(t){const s=[];let n=null;const a=()=>{n&&(s.push({path:n.path,status:n.status,additions:n.additions,deletions:n.deletions,patch:n.patchLines.join(`
9
9
  `),content:null}),n=null)};for(const i of t.split(`
10
10
  `)){if(i.startsWith("diff --git ")){a(),n={path:Wr(i)??"changed-file",status:"M",additions:0,deletions:0,patchLines:[i]};continue}if(n){if(n.patchLines.push(i),i.startsWith("+++ ")){const u=ln(i.slice(4));u&&(n.path=u);continue}if(i.startsWith("--- ")){const u=ln(i.slice(4));u&&n.path==="changed-file"&&(n.path=u);continue}i.startsWith("new file mode ")&&(n.status="A"),i.startsWith("deleted file mode ")&&(n.status="D"),i.startsWith("rename to ")&&(n.status="R",n.path=i.slice(10).trim()||n.path),i.startsWith("+")&&!i.startsWith("+++")&&(n.additions+=1),i.startsWith("-")&&!i.startsWith("---")&&(n.deletions+=1)}}return a(),s}function zr(t){const s=[];for(const n of t.split(`
11
- `)){if(!n.trim())continue;const a=Ir(n);a&&s.push({path:a,status:n.slice(0,2).trim()||"M",additions:0,deletions:0,patch:"",content:null})}return s}function Ir(t){const s=t.slice(3).trim();return s?s.split(" -> ").pop()?.trim()||s:null}function Wr(t){const s=/^diff --git a\/(.+) b\/(.+)$/.exec(t.trim());return s?.[2]??s?.[1]??null}function ln(t){const s=t.trim();return!s||s==="/dev/null"?null:s.startsWith("a/")||s.startsWith("b/")?s.slice(2):s}const Rn="openpond.workspace.editorControlsVisible";function on(){try{return hn.getItem(Rn)==="true"}catch{return!1}}function Br(t){try{hn.setItem(Rn,String(t))}catch{}}function Or({activeDiagnostics:t,activeServers:s,editorDiagnosticsChecking:n,editorLspEnabled:a,showEditorCommandBar:i}){if(!i)return null;if(!a)return{label:"LSP off",severity:"unavailable"};if(n)return{label:"Checking",severity:"info"};const u=t.filter(x=>x.severity==="error").length;if(u>0)return{label:`${u} error${u===1?"":"s"}`,severity:"error"};const c=t.filter(x=>x.severity==="warning").length;if(c>0)return{label:`${c} warning${c===1?"":"s"}`,severity:"warning"};const d=t.length;if(d>0)return{label:`${d} note${d===1?"":"s"}`,severity:"info"};if(!s)return null;const p=s.find(x=>x.status!=="connected");return p?{label:p.id==="none"?"No LSP":`${p.id} unavailable`,severity:"unavailable"}:{label:"No issues",severity:"none"}}const cn=3e3,Ur=2e3,dn=[],Hr=[];function Vr({appId:t,workspaceId:s,workspaceKind:n,connection:a,runtimeEvents:i,diff:u,editorPreferences:c,loading:d,workspaceName:p,workspaceInitialized:x,workspaceError:o,expanded:b,fileRootPath:S,filesWithPreview:k=!1,openFileRequest:N,readOnly:F=!1,sideChatTabs:T,sourceSwitcher:I,tabRequest:K,viewState:H,onRefresh:W,onResizeStart:v,onToggleExpanded:$,onOpenBrowser:D,onOpenBrowserUrl:M,onViewStateChange:E,onCloseSideChat:se,onOpenSideChat:q,onSelectSideChat:X,goalDetails:B,sandboxFileSource:Q,trainingSummary:ne,sidebarFileBookmarks:Y=[],sidebarFileSourceSessionId:oe=null,onSetSidebarFileStatus:w}){return e.jsx(Zr,{appId:t,workspaceId:s,workspaceKind:n,connection:a,runtimeEvents:i??[],diff:u,editorPreferences:c??null,loading:d,workspaceName:p,workspaceInitialized:x,workspaceError:o,expanded:b,fileRootPath:S??null,filesWithPreview:k,openFileRequest:N,readOnly:F,sideChatTabs:T??[],sourceSwitcher:I??null,tabRequest:K??null,viewState:H??null,onRefresh:W,onResizeStart:v,onToggleExpanded:$,onOpenBrowser:D,onOpenBrowserUrl:M,onViewStateChange:E,onCloseSideChat:se,onOpenSideChat:q,onSelectSideChat:X,goalDetails:B??null,sandboxFileSource:Q??null,trainingSummary:ne??null,sidebarFileBookmarks:Y,sidebarFileSourceSessionId:oe,onSetSidebarFileStatus:w})}function Kr(t,s,n,a){return t&&s?.content!=null?{...t,content:s.content}:s&&!t&&as(s)?s:t&&as(t)?t:s&&as(s)?s:t??s??n??os(a)}function as(t){return!!(t.patch||t.content!=null)}function Gr({changedFiles:t,checkpointStatus:s,dirty:n,error:a,loading:i,preservedReadback:u,sandboxMode:c,sourcePending:d}){if(d)return{label:"sandbox pending",tone:"loading"};if(i)return{label:"refreshing",tone:"loading"};if(c&&u&&s)return s;if(a)return{label:"status unavailable",tone:"error"};if(c&&s?.tone==="error"||c&&s&&!n&&t===0)return s;if(n||t>0){const p=Math.max(1,t),x=p===1?"change":"changes";return{label:c?`${p} unpreserved ${x}`:`${p} local ${x}`,tone:"dirty"}}return{label:c?"sandbox clean":"local clean",tone:"clean"}}function qr(t,s){if(!s)return null;for(let n=t.length-1;n>=0;n-=1){const a=t[n];if(a?.name!=="workspace_action_result")continue;const i=a.data&&typeof a.data=="object"&&!Array.isArray(a.data)?a.data:null,u=i?.sourcePreservation&&typeof i.sourcePreservation=="object"&&!Array.isArray(i.sourcePreservation)?i.sourcePreservation:null;if(u?.attempted===!0&&u.sandboxId===s)return u.ok!==!0?{label:"checkpoint failed",tone:"error"}:u.preserved===!0?{label:"checkpoint saved",tone:"clean"}:{label:"checkpoint clean",tone:"clean"}}return null}function Xr(t){const s=t.split("/").filter(Boolean);return s.map((n,a)=>s.slice(0,a+1).join("/"))}function Zr({appId:t,workspaceId:s,workspaceKind:n,connection:a,runtimeEvents:i,diff:u,editorPreferences:c,loading:d,workspaceName:p,workspaceInitialized:x,workspaceError:o,expanded:b,fileRootPath:S,filesWithPreview:k,openFileRequest:N,readOnly:F,sideChatTabs:T,sourceSwitcher:I,tabRequest:K,viewState:H,onRefresh:W,onResizeStart:v,onToggleExpanded:$,onOpenBrowser:D,onOpenBrowserUrl:M,onViewStateChange:E,onCloseSideChat:se,onOpenSideChat:q,onSelectSideChat:X,goalDetails:B,sandboxFileSource:Q,trainingSummary:ne,sidebarFileBookmarks:Y,sidebarFileSourceSessionId:oe,onSetSidebarFileStatus:w}){const O=H??ei(),[A,_]=l.useState(O.activeTab),[Lt,Ae]=l.useState(!1),[ct,ce]=l.useState(!1),[$n,ae]=l.useState(!1),[Dt,_t]=l.useState(""),[J,Ve]=l.useState(()=>[...O.openFilePaths]),[j,je]=l.useState(O.selectedPath),[ms,Fn]=l.useState(!1),[xs,En]=l.useState(!1),[Le,Pn]=l.useState(!1),[Tt,An]=l.useState(!0),[bs,gs]=l.useState(on);Xa(()=>gs(on()));const[js,Ln]=l.useState(!1),[vs,Dn]=l.useState(!1),[ks,_n]=l.useState(!1),[ie,De]=l.useState({}),[dt,ut]=l.useState(()=>new Set),[ws,ft]=l.useState({}),[fe,Ke]=l.useState({}),[ys,Mt]=l.useState(()=>new Set),[Ge,qe]=l.useState(null),[Tn,zt]=l.useState(!1),[Ss,Xe]=l.useState(null),[Ns,It]=l.useState({}),[Mn,Wt]=l.useState({}),[zn,Bt]=l.useState(null),[In,ve]=l.useState(null),[Cs,Ot]=l.useState(null),[Wn,ke]=l.useState(null);Pe(o,{prefix:"Workspace"}),Pe(Ss,{prefix:"Sandbox files"});const[Ut,pt]=l.useState(null),[Bn,Ze]=l.useState({}),[ht,Ht]=l.useState(null),[_e,mt]=l.useState(null),[xt,bt]=l.useState(null),ee=c??Ja.editor,Rs=l.useRef(ie),Vt=l.useRef(ts(O)),Kt=l.useRef(ts(O)),$s=l.useRef(null),Gt=l.useRef(W),de=l.useRef(!1),Qe=l.useRef(null),Ye=l.useRef(0),pe=l.useRef(null),Je=l.useRef(null),P=Q?.sandboxId?.trim()||null,C=!!Q,Te=!!ne||C&&!!P,gt=C?`sandbox:${P??"pending"}`:`workspace:${t??"none"}`,Fs=C?!!P:!!t,Es=l.useRef(gt),he=!!(B?.createRuntime||B?.goalRuntime||B?.subagentRuntime),Me=l.useCallback(async(r={})=>{if(C){if(!a){qe(null),Xe("OpenPond App server is not connected.");return}if(!P){qe(null),Xe(null);return}r.silent||zt(!0);try{const[m,f,g]=await Promise.allSettled([z.sandboxFiles(a,P,{recursive:!0,maxEntries:Ur}),z.sandboxGitStatus(a,P),z.sandboxGitDiff(a,P,{})]);if(m.status==="rejected")throw m.reason;const y=Tr(m.value.files),h=f.status==="fulfilled"?f.value.status:null,R=g.status==="fulfilled"?g.value.diff:null,L=Mr(R,h),it=L.reduce((Jt,es)=>Jt+es.additions,0),va=L.reduce((Jt,es)=>Jt+es.deletions,0);qe({appId:P,repoPath:"",initialized:!0,dirty:h?!h.clean:L.length>0,filesChanged:L.length,additions:it,deletions:va,repoFiles:y,files:L,error:null,updatedAt:new Date().toISOString()}),Xe(null)}catch(m){qe(null),Xe(m instanceof Error?m.message:String(m))}finally{r.silent||zt(!1)}}},[a,P,C]),Ps=l.useMemo(()=>Ar(i,P),[i,P]),As=!!(Ge&&((Ge.files?.length??0)>0||(Ge.repoFiles?.length??0)>0)),On=C&&!As&&!!Ps,me=C?As?Ge:Ps??Ge:u,et=me?.repoPath??null,Un=l.useMemo(()=>qr(i,P),[i,P]),ze=me?.files??dn,Ls=me?.files??dn,we=l.useMemo(()=>new Map(Ls.map(r=>[r.path,r])),[Ls]),ye=l.useMemo(()=>new Map(ze.map(r=>[r.path,r])),[ze]),Ie=me?.repoFiles??(ze.length>0?ze.map(r=>r.path):Hr),We=l.useMemo(()=>ze.filter(r=>!Za(r,Ie)),[Ie,ze]),Se=l.useMemo(()=>xt&&!Ie.includes(xt)?[xt,...Ie]:Ie,[Ie,xt]),Ds=l.useMemo(()=>J.map(r=>we.get(r)??ie[r]??ye.get(r)??os(r)),[we,ye,ie,J]),jt=l.useMemo(()=>{const r={};for(const m of J){if(Re(m))continue;const f=we.get(m)??ie[m]??ye.get(m)??os(m);f.content!=null&&(r[m]=f.content)}return r},[we,ye,ie,J]),Be=l.useMemo(()=>{const r=new Set;for(const[m,f]of Object.entries(fe))f.content!==f.savedContent&&r.add(m);return r},[fe]),Hn=l.useMemo(()=>{const r=Dt.trim().toLowerCase(),m=Se;return r?m.filter(f=>f.toLowerCase().includes(r)):m},[Se,Dt]),qt=l.useMemo(()=>({activeTab:A,openFilePaths:J,selectedPath:j}),[A,J,j]);l.useEffect(()=>{Rs.current=ie},[ie]),l.useEffect(()=>{Qe.current=ht},[ht]),l.useEffect(()=>{Ke(r=>{let m=!1;const f={...r},g=new Set(J),y=u?.updatedAt?Date.parse(u.updatedAt):null;for(const[h,R]of Object.entries(f))g.has(h)||R.content!==R.savedContent||(delete f[h],m=!0);for(const[h,R]of Object.entries(jt)){const L=f[h];if(!L){f[h]={content:R,savedContent:R},m=!0;continue}if(L.content===L.savedContent&&L.savedContent!==R){if(L.savedAt&&(y===null||y<L.savedAt))continue;f[h]={content:R,savedContent:R},m=!0}}return m?f:r})},[u?.updatedAt,jt,J]),l.useEffect(()=>{Gt.current=W},[W]),l.useEffect(()=>{if(!H)return;const r=Qa(H,et);Qs(Vt.current,r)||(Vt.current=r,Kt.current=r,_(r.activeTab),Ve(r.openFilePaths),je(r.selectedPath))},[H,et]),l.useEffect(()=>{if(dt.size>0||Qs(Kt.current,qt))return;const r=ts(qt);Kt.current=r,Vt.current=r,E?.(r)},[qt,E,dt]),l.useEffect(()=>{F||C||!a||!t||!x||u||o||de.current||(de.current=!0,Promise.resolve(Gt.current({silent:!0})).catch(()=>{}).finally(()=>{de.current=!1}))},[t,a,u,F,C,o,x]),l.useEffect(()=>(Es.current!==gt&&(Es.current=gt,pe.current?.abort(new Error("lsp_diagnostics_source_changed")),pe.current=null,Ve([]),je(null),De({}),ut(new Set),ft({}),Ke({}),Mt(new Set),qe(null),Xe(null),zt(!1),It({}),Wt({}),Bt(null),ve(null),ke(null),pt(null),Ze({}),Ht(null),mt(null),bt(null)),()=>{pe.current?.abort(new Error("lsp_diagnostics_unmounted")),pe.current=null}),[gt]),l.useEffect(()=>{if(!(!N||$s.current===N.id)&&!(!N.file&&!Fs)){if($s.current=N.id,N.file){Vn(N.file,N.imageUrl,N.source);return}vt(N.path,{source:N.source})}},[Fs,N]),l.useEffect(()=>{if(!C||(Me(),!a||!P))return;let r=!1;async function m(){if(!(r||de.current)&&!(typeof document<"u"&&document.visibilityState==="hidden")){de.current=!0;try{await Me({silent:!0})}finally{de.current=!1}}}const f=window.setInterval(()=>{m()},cn),g=()=>{m()};return window.addEventListener("focus",g),()=>{r=!0,window.clearInterval(f),window.removeEventListener("focus",g)}},[a,Me,P,C]),l.useEffect(()=>{if(F||C||!a||!t||!x)return;let r=!1;async function m(){if(!(r||de.current)&&!(typeof document<"u"&&document.visibilityState==="hidden")){de.current=!0;try{await Gt.current({silent:!0})}catch{}finally{de.current=!1}}}const f=window.setInterval(()=>{m()},cn),g=()=>{m()};return window.addEventListener("focus",g),()=>{r=!0,window.clearInterval(f),window.removeEventListener("focus",g)}},[t,a,F,C,x]),l.useEffect(()=>{if(C||!a||!t||n==="local_project"){bt(null);return}let r=!1;return z.workspaceTemplateConfig(a,t).then(m=>{r||bt(m.exists?m.configPath??Ya:null)}).catch(()=>{r||bt(null)}),()=>{r=!0}},[t,a,C,n]),l.useEffect(()=>{!j||Se.includes(j)||J.includes(j)||je(We[0]?.path??null)},[We,J,Se,j]),l.useEffect(()=>{B?.active&&he&&_("goal")},[B?.active,he]),l.useEffect(()=>{K&&_(K.tab)},[K]),l.useEffect(()=>{!he&&A==="goal"&&_("files")},[A,he]),l.useEffect(()=>{!Te&&A==="summary"&&_("files")},[A,Te]);const G=A==="file"||k&&A==="files"?j:null;l.useEffect(()=>{if(!a||!G)return;if(Re(G)){ke(null),ve(h=>h===G?null:h);return}const r=Ut?.path===G,m=tt(G);if(F&&(m?.content!=null||m?.patch)){ke(null),ve(h=>h===G?null:h);return}if(!r&&(m?.content!=null||m?.patch&&!Le)){ke(null),ve(h=>h===G?null:h);return}let f=!1;const g=Rs.current[G];return g?.content==null&&(Le||!g?.patch)&&ve(G),ke(null),(C?P?Fr(a,P,G,i):Promise.reject(new Error(Q?.emptyMessage??"No sandbox filesystem is available.")):t?z.workspaceFile(a,t,G):Promise.reject(new Error("Workspace files are unavailable."))).then(h=>{f||De(R=>{const L=R[h.path];return L?.content===h.content&&L.patch===h.patch&&L.status===h.status?R:{...R,[h.path]:h}})}).catch(h=>{f||ke(h instanceof Error?h.message:String(h))}).finally(()=>{f||(ve(h=>h===G?null:h),pt(h=>h&&h.id===Ut?.id&&h.path===G?null:h))}),()=>{f=!0}},[A,t,a,Ut,Le,F,i,Q?.emptyMessage,P,C,G]);function vt(r,m){Ot(null);const f=C?P:t;if(Ks(r)&&!m?.source&&a&&f){Ra(a,f,r,C?"sandbox":"local").then(M).catch(y=>Ot(y instanceof Error?y.message:"Could not open HTML preview."));return}const g=ls(r,et);g&&(ut(y=>{if(!y.has(g))return y;const h=new Set(y);return h.delete(g),h}),De(y=>{if(!(g in y))return y;const h={...y};return delete h[g],h}),ft(y=>{if(!(g in y))return y;const h={...y};return delete h[g],h}),pt({id:Date.now(),path:g}),k||Ve(y=>y.includes(g)?y:[...y,g]),je(g),_(k?"files":"file"),!C&&a&&t&&Re(g)&&mt(g),ce(!1),ae(!1),_t(""))}function Vn(r,m,f=!1){if(Ks(r.path)&&r.content!=null&&!f&&a){$a(a,r.path,r.content).then(M).catch(h=>Ot(h instanceof Error?h.message:"Could not open HTML preview."));return}const g=ls(r.path,et);if(!g)return;const y={...r,path:g};De(h=>({...h,[g]:y})),ut(h=>{const R=new Set(h);return R.add(g),R}),ft(h=>{if(!m){if(!(g in h))return h;const R={...h};return delete R[g],R}return h[g]===m?h:{...h,[g]:m}}),pt(null),ke(null),ve(null),k||Ve(h=>h.includes(g)?h:[...h,g]),je(g),_(k?"files":"file"),ce(!1),ae(!1),_t("")}const Kn=l.useCallback(()=>{gs(r=>{const m=!r;return Br(m),m})},[]),tt=r=>Kr(we.get(r),ie[r],ye.get(r),r),Gn=l.useCallback((r,m)=>{Ke(f=>{const g=f[r],y=g?.savedContent??jt[r]??tt(r).content??"";return{...f,[r]:{content:m,savedContent:y,savedAt:g?.savedAt}}}),Ze(f=>{if(!(r in f))return f;const g={...f};return delete g[r],g})},[we,ye,ie,jt]),Oe=l.useCallback(async(r,m={})=>{if(C||!a||!t||Re(r))return;const f=tt(r),g=m.content??fe[r]?.content??f.content??void 0;if(g?.endsWith(Ft))return;const y=Ye.current+1;Ye.current=y,pe.current?.abort(new Error("lsp_diagnostics_superseded"));const h=new AbortController;pe.current=h,Bt(r);try{const R=await z.workspaceLspTouch(a,t,{path:r,content:g,waitForDiagnostics:m.waitForDiagnostics??!0},{signal:h.signal});if(y!==Ye.current)return;It(L=>({...L,[R.path]:R.diagnostics})),Wt(L=>({...L,[R.path]:R.servers}))}catch(R){if(h.signal.aborted||y!==Ye.current)return;const L=R instanceof Error?R.message:String(R);It(it=>({...it,[r]:[]})),Wt(it=>({...it,[r]:[{id:"lsp",root:"",status:"error",message:L}]}))}finally{if(pe.current===h&&(pe.current=null),h.signal.aborted)return;y===Ye.current&&Bt(R=>R===r?null:R)}},[t,a,we,ye,fe,ie,C]),qn=l.useCallback(async r=>{if(C||!a||!t)throw new Error("Workspace LSP is unavailable.");return z.workspaceLspAction(a,t,r)},[t,a,C]),st=l.useCallback(async r=>{if(!a||!t&&!P||Qe.current===r)return;const m=fe[r];if(!m||m.content===m.savedContent)return;const f=m.content,g=Date.now();Qe.current=r,Ht(r),Ze(y=>{if(!(r in y))return y;const h={...y};return delete h[r],h});try{const y=C?await _r(a,P,r,f):await z.saveWorkspaceFile(a,t,{path:r,content:f});De(h=>({...h,[y.path]:y})),Ke(h=>{const R=h[r];return R?{...h,[r]:{content:R.content,savedContent:f,savedAt:g}}:h}),ee.languageServers!=="off"&&ee.checkOnSave&&await Oe(r,{content:f,waitForDiagnostics:!0}),C?await Me({silent:!0}):await W({silent:!0})}catch(y){Ze(h=>({...h,[r]:y instanceof Error?y.message:String(y)}))}finally{Qe.current===r&&(Qe.current=null),Ht(y=>y===r?null:y)}},[ee.checkOnSave,ee.languageServers,t,a,fe,W,Oe,Me,P,C]),_s=j?tt(j):null,nt=!!(j&&dt.has(j)),Ne=j?fe[j]?.content??_s?.content??null:null,Xn=!!(_s?.patch&&!Le),Xt=!!(!F&&!nt&&A==="file"&&!Xn&&j&&Ne!=null&&!Re(j)&&!(Tt&&rs(j))&&!Ne.endsWith(Ft));l.useEffect(()=>{if(ee.languageServers==="off"||!ee.diagnosticsWhileEditing||!j||!Xt||Ne==null)return;const r=window.setTimeout(()=>{Oe(j,{content:Ne,waitForDiagnostics:!0})},700);return()=>window.clearTimeout(r)},[ee.diagnosticsWhileEditing,ee.languageServers,Oe,Ne,Xt,j]),l.useEffect(()=>{function r(m){!(m.ctrlKey||m.metaKey)||m.key.toLowerCase()!=="s"||A!=="file"||!j||(m.preventDefault(),Be.has(j)&&st(j))}return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[A,Be,st,j]);const Zn=l.useCallback(()=>{j&&(Je.current?Je.current.save():st(j))},[st,j]),Qn=l.useCallback(()=>{Je.current?.undo()},[]),Yn=l.useCallback(()=>{Je.current?.redo()},[]),Jn=l.useCallback(()=>{j&&ee.languageServers!=="off"&&Oe(j,{content:Ne??void 0,waitForDiagnostics:!0})},[ee.languageServers,Oe,Ne,j]);function ea(r,m){if(m.stopPropagation(),!(Be.has(r)&&!window.confirm(`Discard unsaved changes to ${r}?`))&&(Be.has(r)&&(Ke(f=>{if(!(r in f))return f;const g={...f};return delete g[r],g}),Ze(f=>{if(!(r in f))return f;const g={...f};return delete g[r],g})),Ve(f=>f.filter(g=>g!==r)),dt.has(r)&&De(f=>{if(!(r in f))return f;const g={...f};return delete g[r],g}),ft(f=>{if(!(r in f))return f;const g={...f};return delete g[r],g}),ut(f=>{if(!f.has(r))return f;const g=new Set(f);return g.delete(r),g}),j===r)){const f=Ds.find(g=>g.path!==r)??null;je(f?.path??We[0]?.path??null),f||_("files")}}function ta(){_("files"),ce(!1),ae(!1)}function Ts(r){Mt(m=>{const f=new Set(m);return f.has(r)?f.delete(r):f.add(r),f})}function sa(r){r&&Mt(m=>{const f=new Set(m);for(const g of Xr(r))f.add(g);return f}),_("files"),ce(!1),ae(!1)}function na(){const m=`git apply <<'PATCH'
11
+ `)){if(!n.trim())continue;const a=Ir(n);a&&s.push({path:a,status:n.slice(0,2).trim()||"M",additions:0,deletions:0,patch:"",content:null})}return s}function Ir(t){const s=t.slice(3).trim();return s?s.split(" -> ").pop()?.trim()||s:null}function Wr(t){const s=/^diff --git a\/(.+) b\/(.+)$/.exec(t.trim());return s?.[2]??s?.[1]??null}function ln(t){const s=t.trim();return!s||s==="/dev/null"?null:s.startsWith("a/")||s.startsWith("b/")?s.slice(2):s}const Rn="openpond.workspace.editorControlsVisible";function on(){try{return hn.getItem(Rn)==="true"}catch{return!1}}function Br(t){try{hn.setItem(Rn,String(t))}catch{}}function Or({activeDiagnostics:t,activeServers:s,editorDiagnosticsChecking:n,editorLspEnabled:a,showEditorCommandBar:i}){if(!i)return null;if(!a)return{label:"LSP off",severity:"unavailable"};if(n)return{label:"Checking",severity:"info"};const u=t.filter(x=>x.severity==="error").length;if(u>0)return{label:`${u} error${u===1?"":"s"}`,severity:"error"};const c=t.filter(x=>x.severity==="warning").length;if(c>0)return{label:`${c} warning${c===1?"":"s"}`,severity:"warning"};const d=t.length;if(d>0)return{label:`${d} note${d===1?"":"s"}`,severity:"info"};if(!s)return null;const p=s.find(x=>x.status!=="connected");return p?{label:p.id==="none"?"No LSP":`${p.id} unavailable`,severity:"unavailable"}:{label:"No issues",severity:"none"}}const cn=3e3,Ur=2e3,dn=[],Hr=[];function Vr({appId:t,workspaceId:s,workspaceKind:n,connection:a,runtimeEvents:i,diff:u,editorPreferences:c,loading:d,workspaceName:p,workspaceInitialized:x,workspaceError:o,expanded:b,fileRootPath:S,filesWithPreview:k=!1,openFileRequest:N,readOnly:F=!1,sideChatTabs:T,sourceSwitcher:I,tabRequest:K,viewState:H,onRefresh:W,onResizeStart:v,onToggleExpanded:$,onOpenBrowser:D,onOpenBrowserUrl:M,onViewStateChange:E,onCloseSideChat:se,onOpenSideChat:q,onSelectSideChat:X,goalDetails:B,sandboxFileSource:Q,trainingSummary:ne,sidebarFileBookmarks:Y=[],sidebarFileSourceSessionId:oe=null,onSetSidebarFileStatus:w}){return e.jsx(Zr,{appId:t,workspaceId:s,workspaceKind:n,connection:a,runtimeEvents:i??[],diff:u,editorPreferences:c??null,loading:d,workspaceName:p,workspaceInitialized:x,workspaceError:o,expanded:b,fileRootPath:S??null,filesWithPreview:k,openFileRequest:N,readOnly:F,sideChatTabs:T??[],sourceSwitcher:I??null,tabRequest:K??null,viewState:H??null,onRefresh:W,onResizeStart:v,onToggleExpanded:$,onOpenBrowser:D,onOpenBrowserUrl:M,onViewStateChange:E,onCloseSideChat:se,onOpenSideChat:q,onSelectSideChat:X,goalDetails:B??null,sandboxFileSource:Q??null,trainingSummary:ne??null,sidebarFileBookmarks:Y,sidebarFileSourceSessionId:oe,onSetSidebarFileStatus:w})}function Kr(t,s,n,a){return t&&s?.content!=null?{...t,content:s.content}:s&&!t&&as(s)?s:t&&as(t)?t:s&&as(s)?s:t??s??n??os(a)}function as(t){return!!(t.patch||t.content!=null)}function Gr({changedFiles:t,checkpointStatus:s,dirty:n,error:a,loading:i,preservedReadback:u,sandboxMode:c,sourcePending:d}){if(d)return{label:"sandbox pending",tone:"loading"};if(i)return{label:"refreshing",tone:"loading"};if(c&&u&&s)return s;if(a)return{label:"status unavailable",tone:"error"};if(c&&s?.tone==="error"||c&&s&&!n&&t===0)return s;if(n||t>0){const p=Math.max(1,t),x=p===1?"change":"changes";return{label:c?`${p} unpreserved ${x}`:`${p} local ${x}`,tone:"dirty"}}return{label:c?"sandbox clean":"local clean",tone:"clean"}}function qr(t,s){if(!s)return null;for(let n=t.length-1;n>=0;n-=1){const a=t[n];if(a?.name!=="workspace_action_result")continue;const i=a.data&&typeof a.data=="object"&&!Array.isArray(a.data)?a.data:null,u=i?.sourcePreservation&&typeof i.sourcePreservation=="object"&&!Array.isArray(i.sourcePreservation)?i.sourcePreservation:null;if(u?.attempted===!0&&u.sandboxId===s)return u.ok!==!0?{label:"checkpoint failed",tone:"error"}:u.preserved===!0?{label:"checkpoint saved",tone:"clean"}:{label:"checkpoint clean",tone:"clean"}}return null}function Xr(t){const s=t.split("/").filter(Boolean);return s.map((n,a)=>s.slice(0,a+1).join("/"))}function Zr({appId:t,workspaceId:s,workspaceKind:n,connection:a,runtimeEvents:i,diff:u,editorPreferences:c,loading:d,workspaceName:p,workspaceInitialized:x,workspaceError:o,expanded:b,fileRootPath:S,filesWithPreview:k,openFileRequest:N,readOnly:F,sideChatTabs:T,sourceSwitcher:I,tabRequest:K,viewState:H,onRefresh:W,onResizeStart:v,onToggleExpanded:$,onOpenBrowser:D,onOpenBrowserUrl:M,onViewStateChange:E,onCloseSideChat:se,onOpenSideChat:q,onSelectSideChat:X,goalDetails:B,sandboxFileSource:Q,trainingSummary:ne,sidebarFileBookmarks:Y,sidebarFileSourceSessionId:oe,onSetSidebarFileStatus:w}){const O=H??ei(),[P,_]=l.useState(O.activeTab),[Lt,Pe]=l.useState(!1),[ct,ce]=l.useState(!1),[$n,ae]=l.useState(!1),[Dt,_t]=l.useState(""),[J,Ve]=l.useState(()=>[...O.openFilePaths]),[j,je]=l.useState(O.selectedPath),[ms,Fn]=l.useState(!1),[xs,En]=l.useState(!1),[Le,An]=l.useState(!1),[Tt,Pn]=l.useState(!0),[bs,gs]=l.useState(on);Xa(()=>gs(on()));const[js,Ln]=l.useState(!1),[vs,Dn]=l.useState(!1),[ks,_n]=l.useState(!1),[ie,De]=l.useState({}),[dt,ut]=l.useState(()=>new Set),[ws,ft]=l.useState({}),[fe,Ke]=l.useState({}),[ys,Mt]=l.useState(()=>new Set),[Ge,qe]=l.useState(null),[Tn,zt]=l.useState(!1),[Ss,Xe]=l.useState(null),[Ns,It]=l.useState({}),[Mn,Wt]=l.useState({}),[zn,Bt]=l.useState(null),[In,ve]=l.useState(null),[Cs,Ot]=l.useState(null),[Wn,ke]=l.useState(null);Ae(o,{prefix:"Workspace"}),Ae(Ss,{prefix:"Sandbox files"});const[Ut,pt]=l.useState(null),[Bn,Ze]=l.useState({}),[ht,Ht]=l.useState(null),[_e,mt]=l.useState(null),[xt,bt]=l.useState(null),ee=c??Ja.editor,Rs=l.useRef(ie),Vt=l.useRef(ts(O)),Kt=l.useRef(ts(O)),$s=l.useRef(null),Gt=l.useRef(W),de=l.useRef(!1),Qe=l.useRef(null),Ye=l.useRef(0),pe=l.useRef(null),Je=l.useRef(null),A=Q?.sandboxId?.trim()||null,C=!!Q,Te=!!ne||C&&!!A,gt=C?`sandbox:${A??"pending"}`:`workspace:${t??"none"}`,Fs=C?!!A:!!t,Es=l.useRef(gt),he=!!(B?.createRuntime||B?.goalRuntime||B?.subagentRuntime),Me=l.useCallback(async(r={})=>{if(C){if(!a){qe(null),Xe("OpenPond App server is not connected.");return}if(!A){qe(null),Xe(null);return}r.silent||zt(!0);try{const[m,f,g]=await Promise.allSettled([z.sandboxFiles(a,A,{recursive:!0,maxEntries:Ur}),z.sandboxGitStatus(a,A),z.sandboxGitDiff(a,A,{})]);if(m.status==="rejected")throw m.reason;const y=Tr(m.value.files),h=f.status==="fulfilled"?f.value.status:null,R=g.status==="fulfilled"?g.value.diff:null,L=Mr(R,h),it=L.reduce((Jt,es)=>Jt+es.additions,0),va=L.reduce((Jt,es)=>Jt+es.deletions,0);qe({appId:A,repoPath:"",initialized:!0,dirty:h?!h.clean:L.length>0,filesChanged:L.length,additions:it,deletions:va,repoFiles:y,files:L,error:null,updatedAt:new Date().toISOString()}),Xe(null)}catch(m){qe(null),Xe(m instanceof Error?m.message:String(m))}finally{r.silent||zt(!1)}}},[a,A,C]),As=l.useMemo(()=>Pr(i,A),[i,A]),Ps=!!(Ge&&((Ge.files?.length??0)>0||(Ge.repoFiles?.length??0)>0)),On=C&&!Ps&&!!As,me=C?Ps?Ge:As??Ge:u,et=me?.repoPath??null,Un=l.useMemo(()=>qr(i,A),[i,A]),ze=me?.files??dn,Ls=me?.files??dn,we=l.useMemo(()=>new Map(Ls.map(r=>[r.path,r])),[Ls]),ye=l.useMemo(()=>new Map(ze.map(r=>[r.path,r])),[ze]),Ie=me?.repoFiles??(ze.length>0?ze.map(r=>r.path):Hr),We=l.useMemo(()=>ze.filter(r=>!Za(r,Ie)),[Ie,ze]),Se=l.useMemo(()=>xt&&!Ie.includes(xt)?[xt,...Ie]:Ie,[Ie,xt]),Ds=l.useMemo(()=>J.map(r=>we.get(r)??ie[r]??ye.get(r)??os(r)),[we,ye,ie,J]),jt=l.useMemo(()=>{const r={};for(const m of J){if(Re(m))continue;const f=we.get(m)??ie[m]??ye.get(m)??os(m);f.content!=null&&(r[m]=f.content)}return r},[we,ye,ie,J]),Be=l.useMemo(()=>{const r=new Set;for(const[m,f]of Object.entries(fe))f.content!==f.savedContent&&r.add(m);return r},[fe]),Hn=l.useMemo(()=>{const r=Dt.trim().toLowerCase(),m=Se;return r?m.filter(f=>f.toLowerCase().includes(r)):m},[Se,Dt]),qt=l.useMemo(()=>({activeTab:P,openFilePaths:J,selectedPath:j}),[P,J,j]);l.useEffect(()=>{Rs.current=ie},[ie]),l.useEffect(()=>{Qe.current=ht},[ht]),l.useEffect(()=>{Ke(r=>{let m=!1;const f={...r},g=new Set(J),y=u?.updatedAt?Date.parse(u.updatedAt):null;for(const[h,R]of Object.entries(f))g.has(h)||R.content!==R.savedContent||(delete f[h],m=!0);for(const[h,R]of Object.entries(jt)){const L=f[h];if(!L){f[h]={content:R,savedContent:R},m=!0;continue}if(L.content===L.savedContent&&L.savedContent!==R){if(L.savedAt&&(y===null||y<L.savedAt))continue;f[h]={content:R,savedContent:R},m=!0}}return m?f:r})},[u?.updatedAt,jt,J]),l.useEffect(()=>{Gt.current=W},[W]),l.useEffect(()=>{if(!H)return;const r=Qa(H,et);Qs(Vt.current,r)||(Vt.current=r,Kt.current=r,_(r.activeTab),Ve(r.openFilePaths),je(r.selectedPath))},[H,et]),l.useEffect(()=>{if(dt.size>0||Qs(Kt.current,qt))return;const r=ts(qt);Kt.current=r,Vt.current=r,E?.(r)},[qt,E,dt]),l.useEffect(()=>{F||C||!a||!t||!x||u||o||de.current||(de.current=!0,Promise.resolve(Gt.current({silent:!0})).catch(()=>{}).finally(()=>{de.current=!1}))},[t,a,u,F,C,o,x]),l.useEffect(()=>(Es.current!==gt&&(Es.current=gt,pe.current?.abort(new Error("lsp_diagnostics_source_changed")),pe.current=null,Ve([]),je(null),De({}),ut(new Set),ft({}),Ke({}),Mt(new Set),qe(null),Xe(null),zt(!1),It({}),Wt({}),Bt(null),ve(null),ke(null),pt(null),Ze({}),Ht(null),mt(null),bt(null)),()=>{pe.current?.abort(new Error("lsp_diagnostics_unmounted")),pe.current=null}),[gt]),l.useEffect(()=>{if(!(!N||$s.current===N.id)&&!(!N.file&&!Fs)){if($s.current=N.id,N.file){Vn(N.file,N.imageUrl,N.source);return}vt(N.path,{source:N.source})}},[Fs,N]),l.useEffect(()=>{if(!C||(Me(),!a||!A))return;let r=!1;async function m(){if(!(r||de.current)&&!(typeof document<"u"&&document.visibilityState==="hidden")){de.current=!0;try{await Me({silent:!0})}finally{de.current=!1}}}const f=window.setInterval(()=>{m()},cn),g=()=>{m()};return window.addEventListener("focus",g),()=>{r=!0,window.clearInterval(f),window.removeEventListener("focus",g)}},[a,Me,A,C]),l.useEffect(()=>{if(F||C||!a||!t||!x)return;let r=!1;async function m(){if(!(r||de.current)&&!(typeof document<"u"&&document.visibilityState==="hidden")){de.current=!0;try{await Gt.current({silent:!0})}catch{}finally{de.current=!1}}}const f=window.setInterval(()=>{m()},cn),g=()=>{m()};return window.addEventListener("focus",g),()=>{r=!0,window.clearInterval(f),window.removeEventListener("focus",g)}},[t,a,F,C,x]),l.useEffect(()=>{if(C||!a||!t||n==="local_project"){bt(null);return}let r=!1;return z.workspaceTemplateConfig(a,t).then(m=>{r||bt(m.exists?m.configPath??Ya:null)}).catch(()=>{r||bt(null)}),()=>{r=!0}},[t,a,C,n]),l.useEffect(()=>{!j||Se.includes(j)||J.includes(j)||je(We[0]?.path??null)},[We,J,Se,j]),l.useEffect(()=>{B?.active&&he&&_("goal")},[B?.active,he]),l.useEffect(()=>{K&&_(K.tab)},[K]),l.useEffect(()=>{!he&&P==="goal"&&_("files")},[P,he]),l.useEffect(()=>{!Te&&P==="summary"&&_("files")},[P,Te]);const G=P==="file"||k&&P==="files"?j:null;l.useEffect(()=>{if(!a||!G)return;if(Re(G)){ke(null),ve(h=>h===G?null:h);return}const r=Ut?.path===G,m=tt(G);if(F&&(m?.content!=null||m?.patch)){ke(null),ve(h=>h===G?null:h);return}if(!r&&(m?.content!=null||m?.patch&&!Le)){ke(null),ve(h=>h===G?null:h);return}let f=!1;const g=Rs.current[G];return g?.content==null&&(Le||!g?.patch)&&ve(G),ke(null),(C?A?Fr(a,A,G,i):Promise.reject(new Error(Q?.emptyMessage??"No sandbox filesystem is available.")):t?z.workspaceFile(a,t,G):Promise.reject(new Error("Workspace files are unavailable."))).then(h=>{f||De(R=>{const L=R[h.path];return L?.content===h.content&&L.patch===h.patch&&L.status===h.status?R:{...R,[h.path]:h}})}).catch(h=>{f||ke(h instanceof Error?h.message:String(h))}).finally(()=>{f||(ve(h=>h===G?null:h),pt(h=>h&&h.id===Ut?.id&&h.path===G?null:h))}),()=>{f=!0}},[P,t,a,Ut,Le,F,i,Q?.emptyMessage,A,C,G]);function vt(r,m){Ot(null);const f=C?A:t;if(Ks(r)&&!m?.source&&a&&f){Ra(a,f,r,C?"sandbox":"local").then(M).catch(y=>Ot(y instanceof Error?y.message:"Could not open HTML preview."));return}const g=ls(r,et);g&&(ut(y=>{if(!y.has(g))return y;const h=new Set(y);return h.delete(g),h}),De(y=>{if(!(g in y))return y;const h={...y};return delete h[g],h}),ft(y=>{if(!(g in y))return y;const h={...y};return delete h[g],h}),pt({id:Date.now(),path:g}),k||Ve(y=>y.includes(g)?y:[...y,g]),je(g),_(k?"files":"file"),!C&&a&&t&&Re(g)&&mt(g),ce(!1),ae(!1),_t(""))}function Vn(r,m,f=!1){if(Ks(r.path)&&r.content!=null&&!f&&a){$a(a,r.path,r.content).then(M).catch(h=>Ot(h instanceof Error?h.message:"Could not open HTML preview."));return}const g=ls(r.path,et);if(!g)return;const y={...r,path:g};De(h=>({...h,[g]:y})),ut(h=>{const R=new Set(h);return R.add(g),R}),ft(h=>{if(!m){if(!(g in h))return h;const R={...h};return delete R[g],R}return h[g]===m?h:{...h,[g]:m}}),pt(null),ke(null),ve(null),k||Ve(h=>h.includes(g)?h:[...h,g]),je(g),_(k?"files":"file"),ce(!1),ae(!1),_t("")}const Kn=l.useCallback(()=>{gs(r=>{const m=!r;return Br(m),m})},[]),tt=r=>Kr(we.get(r),ie[r],ye.get(r),r),Gn=l.useCallback((r,m)=>{Ke(f=>{const g=f[r],y=g?.savedContent??jt[r]??tt(r).content??"";return{...f,[r]:{content:m,savedContent:y,savedAt:g?.savedAt}}}),Ze(f=>{if(!(r in f))return f;const g={...f};return delete g[r],g})},[we,ye,ie,jt]),Oe=l.useCallback(async(r,m={})=>{if(C||!a||!t||Re(r))return;const f=tt(r),g=m.content??fe[r]?.content??f.content??void 0;if(g?.endsWith(Ft))return;const y=Ye.current+1;Ye.current=y,pe.current?.abort(new Error("lsp_diagnostics_superseded"));const h=new AbortController;pe.current=h,Bt(r);try{const R=await z.workspaceLspTouch(a,t,{path:r,content:g,waitForDiagnostics:m.waitForDiagnostics??!0},{signal:h.signal});if(y!==Ye.current)return;It(L=>({...L,[R.path]:R.diagnostics})),Wt(L=>({...L,[R.path]:R.servers}))}catch(R){if(h.signal.aborted||y!==Ye.current)return;const L=R instanceof Error?R.message:String(R);It(it=>({...it,[r]:[]})),Wt(it=>({...it,[r]:[{id:"lsp",root:"",status:"error",message:L}]}))}finally{if(pe.current===h&&(pe.current=null),h.signal.aborted)return;y===Ye.current&&Bt(R=>R===r?null:R)}},[t,a,we,ye,fe,ie,C]),qn=l.useCallback(async r=>{if(C||!a||!t)throw new Error("Workspace LSP is unavailable.");return z.workspaceLspAction(a,t,r)},[t,a,C]),st=l.useCallback(async r=>{if(!a||!t&&!A||Qe.current===r)return;const m=fe[r];if(!m||m.content===m.savedContent)return;const f=m.content,g=Date.now();Qe.current=r,Ht(r),Ze(y=>{if(!(r in y))return y;const h={...y};return delete h[r],h});try{const y=C?await _r(a,A,r,f):await z.saveWorkspaceFile(a,t,{path:r,content:f});De(h=>({...h,[y.path]:y})),Ke(h=>{const R=h[r];return R?{...h,[r]:{content:R.content,savedContent:f,savedAt:g}}:h}),ee.languageServers!=="off"&&ee.checkOnSave&&await Oe(r,{content:f,waitForDiagnostics:!0}),C?await Me({silent:!0}):await W({silent:!0})}catch(y){Ze(h=>({...h,[r]:y instanceof Error?y.message:String(y)}))}finally{Qe.current===r&&(Qe.current=null),Ht(y=>y===r?null:y)}},[ee.checkOnSave,ee.languageServers,t,a,fe,W,Oe,Me,A,C]),_s=j?tt(j):null,nt=!!(j&&dt.has(j)),Ne=j?fe[j]?.content??_s?.content??null:null,Xn=!!(_s?.patch&&!Le),Xt=!!(!F&&!nt&&P==="file"&&!Xn&&j&&Ne!=null&&!Re(j)&&!(Tt&&rs(j))&&!Ne.endsWith(Ft));l.useEffect(()=>{if(ee.languageServers==="off"||!ee.diagnosticsWhileEditing||!j||!Xt||Ne==null)return;const r=window.setTimeout(()=>{Oe(j,{content:Ne,waitForDiagnostics:!0})},700);return()=>window.clearTimeout(r)},[ee.diagnosticsWhileEditing,ee.languageServers,Oe,Ne,Xt,j]),l.useEffect(()=>{function r(m){!(m.ctrlKey||m.metaKey)||m.key.toLowerCase()!=="s"||P!=="file"||!j||(m.preventDefault(),Be.has(j)&&st(j))}return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[P,Be,st,j]);const Zn=l.useCallback(()=>{j&&(Je.current?Je.current.save():st(j))},[st,j]),Qn=l.useCallback(()=>{Je.current?.undo()},[]),Yn=l.useCallback(()=>{Je.current?.redo()},[]),Jn=l.useCallback(()=>{j&&ee.languageServers!=="off"&&Oe(j,{content:Ne??void 0,waitForDiagnostics:!0})},[ee.languageServers,Oe,Ne,j]);function ea(r,m){if(m.stopPropagation(),!(Be.has(r)&&!window.confirm(`Discard unsaved changes to ${r}?`))&&(Be.has(r)&&(Ke(f=>{if(!(r in f))return f;const g={...f};return delete g[r],g}),Ze(f=>{if(!(r in f))return f;const g={...f};return delete g[r],g})),Ve(f=>f.filter(g=>g!==r)),dt.has(r)&&De(f=>{if(!(r in f))return f;const g={...f};return delete g[r],g}),ft(f=>{if(!(r in f))return f;const g={...f};return delete g[r],g}),ut(f=>{if(!f.has(r))return f;const g=new Set(f);return g.delete(r),g}),j===r)){const f=Ds.find(g=>g.path!==r)??null;je(f?.path??We[0]?.path??null),f||_("files")}}function ta(){_("files"),ce(!1),ae(!1)}function Ts(r){Mt(m=>{const f=new Set(m);return f.has(r)?f.delete(r):f.add(r),f})}function sa(r){r&&Mt(m=>{const f=new Set(m);for(const g of Xr(r))f.add(g);return f}),_("files"),ce(!1),ae(!1)}function na(){const m=`git apply <<'PATCH'
12
12
  ${We.map(f=>f.patch).filter(Boolean).join(`
13
13
  `)}
14
- PATCH`;navigator.clipboard?.writeText(m)}const aa=We.length>0,ia=Se.length>0,ra=J.length>0,la=he||Te||aa||ia||ra,xe=A==="goal"&&he?"goal":A==="summary"&&Te?"summary":A==="file"&&j?"file":"files",oa=xe==="files"?"No files to show":"No local changes",ca=n==="local_project"&&!x&&!o,Ms=C?Tn:d,zs=C?Ss:o,da=Gr({changedFiles:me?.filesChanged??We.length,checkpointStatus:Un,dirty:!!me?.dirty,error:zs,loading:Ms,preservedReadback:On,sandboxMode:C,sourcePending:C&&!P}),ua=Ms?"Loading workspace files":zs?"Workspace files are unavailable":C&&!P?Q?.emptyMessage??"No sandbox filesystem is available.":ca?"Loading workspace files":x?oa:"No local files to show",Is=j?ws[j]??null:null,fa=!Is&&!C&&j&&Re(j)?j:null,Ws=_e?ws[_e]??null:null,pa=!Ws&&!C&&_e&&Re(_e)?_e:null,ha=Gs(a,t,fa),ma=Gs(a,t,pa),Zt=Is??ha,Bs=Ws??ma,Os=xe==="file"||k&&xe==="files"?j:null,xa=!!(Os&&rs(Os)),Us=j?Ns[j]??[]:[],Hs=j?Mn[j]??null:null,Qt=!!(j&&zn===j),Yt=bs&&Xt,at=!F&&!nt&&!C&&ee.languageServers!=="off",ba=l.useMemo(()=>Or({activeDiagnostics:Us,activeServers:Hs,editorDiagnosticsChecking:Qt,editorLspEnabled:at,showEditorCommandBar:Yt}),[Us,Hs,Qt,at,Yt]),ga=l.useCallback(async r=>{if(!a)throw new Error("OpenPond server connection is unavailable.");await z.runSubagentLifecycleAction(a,r.runId,{action:r.action,reason:"User requested from Goal details."}),await W({silent:!0})},[a,W]),be=C?"sandbox":n==="local_project"?"local":null,kt=l.useMemo(()=>{const r=new Map;if(!be||!s)return r;for(const m of Y)m.workspaceKind!==be||m.workspaceId!==s||r.set(m.path,m);return r},[Y,be,s]),wt=l.useCallback(r=>{try{return kt.get(cs(r))?.status??null}catch{return null}},[kt]),yt=l.useCallback((r,m)=>{if(!be||!s||!p||!w)return;let f;try{f=cs(r)}catch{return}const g=kt.get(f),y=new Date().toISOString(),h=g??{id:hi({workspaceKind:be,workspaceId:s,path:f}),workspaceKind:be,workspaceId:s,workspaceName:p,path:f,status:"pinned",order:null,sourceSessionId:oe,available:!0,createdAt:y,updatedAt:y};w(h,m)},[w,kt,oe,be,s,p]),Ce=!!(be&&s&&p&&w),ja=j&&Ce&&!nt?e.jsx(us,{currentStatus:wt(j),onSetStatus:r=>yt(j,r)}):null,Vs=j?e.jsx(wr,{diagnostics:at?Ns[j]??[]:[],draftContent:fe[j]?.content,editorRef:Je,editable:!F&&!nt&&!Zt,error:Wn,file:tt(j),collapsed:xs,hideWhiteSpace:vs,headerActions:ja,imageSrc:Zt,loading:In===j,loadFullFiles:Le,saveError:Bn[j]??null,saving:ht===j,onOpenImage:()=>{Zt&&mt(j)},onDraftContentChange:r=>Gn(j,r),onLspAction:at?qn:void 0,onSave:()=>{st(j)},onSelectBreadcrumbPath:sa,renderMarkdown:Tt,splitView:ks,wordDiffs:js,wordWrap:ms,workspaceName:p,workspaceRootPath:et}):null;return e.jsxs(e.Fragment,{children:[e.jsxs("aside",{className:`workspace-diff-panel ${b?"expanded":""}`,id:"right-sidebar-files-panel",role:"tabpanel","aria-label":"Workspace diffs",children:[!b&&e.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-orientation":"vertical","aria-label":"Resize diff panel",onPointerDown:v}),e.jsx(cr,{addMenuOpen:ct,expanded:b,filteredFiles:Hn,openFiles:Ds,dirtyFilePaths:Be,goalDetailsAvailable:he,searchOpen:$n,searchQuery:Dt,selectedPath:j,sideChatTabs:T,summaryAvailable:Te,sourceStatus:da,sourceSwitcher:I,visibleTab:xe,getFileBookmarkStatus:Ce?wt:void 0,onCloseFileTab:ea,onCloseSideChat:se,onCloseSearch:()=>ae(!1),onOpenFile:vt,onOpenBrowser:D?()=>{ce(!1),ae(!1),D()}:void 0,onOpenSearch:()=>{ce(!1),ae(!0)},onOpenSideChat:q?()=>{ce(!1),ae(!1),q()}:void 0,onSearchQueryChange:_t,onSetFileBookmarkStatus:Ce?yt:void 0,onSelectFile:r=>{je(r),_("file")},onSelectFiles:ta,onSelectGoal:()=>_("goal"),onSelectSummary:()=>{_("summary"),ce(!1),ae(!1)},onSelectSideChat:X,onToggleAddMenu:()=>{ce(r=>!r),ae(!1)},onToggleExpanded:$}),Cs&&e.jsx("div",{className:"workspace-diff-empty",role:"alert",children:Cs}),xe==="goal"&&he?e.jsx(Pi,{createRuntime:B?.createRuntime??null,goalRuntime:B?.goalRuntime??null,subagentRuntime:B?.subagentRuntime??null,onRunSubagentLifecycleAction:a?ga:void 0}):xe==="summary"&&Te?ne?e.jsx(ir,{summary:ne}):e.jsx(Qi,{sandboxId:P,connection:a}):la?e.jsxs(e.Fragment,{children:[e.jsx(dr,{canSaveActiveFile:!!(!F&&!nt&&j&&Be.has(j)&&ht!==j),canCheckActiveFile:at,collapsed:xs,editorControlsVisible:bs,editorDiagnosticStatus:ba,editorDiagnosticsChecking:Qt,hideWhiteSpace:vs,loadFullFiles:Le,menuOpen:Lt,renderMarkdown:Tt,showEditorCommandBar:Yt,showRenderMarkdownToggle:xa,splitView:ks,wordDiffs:js,wordWrap:ms,onCopyGitApply:na,onEditorCheck:Jn,onEditorRedo:Yn,onEditorSave:Zn,onEditorUndo:Qn,onRefresh:()=>{C?Me():W()},onToggleCollapsed:()=>En(r=>!r),onToggleEditorControlsVisible:Kn,onToggleHideWhiteSpace:()=>Dn(r=>!r),onToggleLoadFullFiles:()=>Pn(r=>!r),onToggleMenu:r=>Ae(m=>r??!m),onToggleRenderMarkdown:()=>An(r=>!r),onToggleSplitView:()=>_n(r=>!r),onToggleWordDiffs:()=>Ln(r=>!r),onToggleWordWrap:()=>Fn(r=>!r)}),xe==="files"&&(k?e.jsxs("div",{className:"workspace-diff-files-preview-layout",children:[e.jsx(nn,{diff:me,expandedFolderPaths:ys,rootPath:S,repoFiles:Se,selectedPath:j,getFileBookmarkStatus:Ce?wt:void 0,onOpenFile:vt,onSetFileBookmarkStatus:Ce?yt:void 0,onToggleFolder:Ts}),Vs??e.jsx("div",{className:"workspace-diff-files-preview-empty",children:"Select a file to review its changes."})]}):e.jsx(nn,{diff:me,expandedFolderPaths:ys,rootPath:S,repoFiles:Se,selectedPath:j,getFileBookmarkStatus:Ce?wt:void 0,onOpenFile:vt,onSetFileBookmarkStatus:Ce?yt:void 0,onToggleFolder:Ts})),xe==="file"&&j&&Vs]}):e.jsx("div",{className:"workspace-diff-empty",children:e.jsx("span",{children:ua})})]}),e.jsx(Fa,{open:!!Bs,src:Bs,title:_e??"",onClose:()=>mt(null)})]})}const rl=Object.freeze(Object.defineProperty({__proto__:null,WorkspaceDiffPanel:Vr},Symbol.toStringTag,{value:"Module"}));export{vi as C,Vr as W,rl as a};
14
+ PATCH`;navigator.clipboard?.writeText(m)}const aa=We.length>0,ia=Se.length>0,ra=J.length>0,la=he||Te||aa||ia||ra,xe=P==="goal"&&he?"goal":P==="summary"&&Te?"summary":P==="file"&&j?"file":"files",oa=xe==="files"?"No files to show":"No local changes",ca=n==="local_project"&&!x&&!o,Ms=C?Tn:d,zs=C?Ss:o,da=Gr({changedFiles:me?.filesChanged??We.length,checkpointStatus:Un,dirty:!!me?.dirty,error:zs,loading:Ms,preservedReadback:On,sandboxMode:C,sourcePending:C&&!A}),ua=Ms?"Loading workspace files":zs?"Workspace files are unavailable":C&&!A?Q?.emptyMessage??"No sandbox filesystem is available.":ca?"Loading workspace files":x?oa:"No local files to show",Is=j?ws[j]??null:null,fa=!Is&&!C&&j&&Re(j)?j:null,Ws=_e?ws[_e]??null:null,pa=!Ws&&!C&&_e&&Re(_e)?_e:null,ha=Gs(a,t,fa),ma=Gs(a,t,pa),Zt=Is??ha,Bs=Ws??ma,Os=xe==="file"||k&&xe==="files"?j:null,xa=!!(Os&&rs(Os)),Us=j?Ns[j]??[]:[],Hs=j?Mn[j]??null:null,Qt=!!(j&&zn===j),Yt=bs&&Xt,at=!F&&!nt&&!C&&ee.languageServers!=="off",ba=l.useMemo(()=>Or({activeDiagnostics:Us,activeServers:Hs,editorDiagnosticsChecking:Qt,editorLspEnabled:at,showEditorCommandBar:Yt}),[Us,Hs,Qt,at,Yt]),ga=l.useCallback(async r=>{if(!a)throw new Error("OpenPond server connection is unavailable.");await z.runSubagentLifecycleAction(a,r.runId,{action:r.action,reason:"User requested from Goal details."}),await W({silent:!0})},[a,W]),be=C?"sandbox":n==="local_project"?"local":null,kt=l.useMemo(()=>{const r=new Map;if(!be||!s)return r;for(const m of Y)m.workspaceKind!==be||m.workspaceId!==s||r.set(m.path,m);return r},[Y,be,s]),wt=l.useCallback(r=>{try{return kt.get(cs(r))?.status??null}catch{return null}},[kt]),yt=l.useCallback((r,m)=>{if(!be||!s||!p||!w)return;let f;try{f=cs(r)}catch{return}const g=kt.get(f),y=new Date().toISOString(),h=g??{id:hi({workspaceKind:be,workspaceId:s,path:f}),workspaceKind:be,workspaceId:s,workspaceName:p,path:f,status:"pinned",order:null,sourceSessionId:oe,available:!0,createdAt:y,updatedAt:y};w(h,m)},[w,kt,oe,be,s,p]),Ce=!!(be&&s&&p&&w),ja=j&&Ce&&!nt?e.jsx(us,{currentStatus:wt(j),onSetStatus:r=>yt(j,r)}):null,Vs=j?e.jsx(wr,{diagnostics:at?Ns[j]??[]:[],draftContent:fe[j]?.content,editorRef:Je,editable:!F&&!nt&&!Zt,error:Wn,file:tt(j),collapsed:xs,hideWhiteSpace:vs,headerActions:ja,imageSrc:Zt,loading:In===j,loadFullFiles:Le,saveError:Bn[j]??null,saving:ht===j,onOpenImage:()=>{Zt&&mt(j)},onDraftContentChange:r=>Gn(j,r),onLspAction:at?qn:void 0,onSave:()=>{st(j)},onSelectBreadcrumbPath:sa,renderMarkdown:Tt,splitView:ks,wordDiffs:js,wordWrap:ms,workspaceName:p,workspaceRootPath:et}):null;return e.jsxs(e.Fragment,{children:[e.jsxs("aside",{className:`workspace-diff-panel ${b?"expanded":""}`,id:"right-sidebar-files-panel",role:"tabpanel","aria-label":"Workspace diffs",children:[!b&&e.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-orientation":"vertical","aria-label":"Resize diff panel",onPointerDown:v}),e.jsx(cr,{addMenuOpen:ct,expanded:b,filteredFiles:Hn,openFiles:Ds,dirtyFilePaths:Be,goalDetailsAvailable:he,searchOpen:$n,searchQuery:Dt,selectedPath:j,sideChatTabs:T,summaryAvailable:Te,sourceStatus:da,sourceSwitcher:I,visibleTab:xe,getFileBookmarkStatus:Ce?wt:void 0,onCloseFileTab:ea,onCloseSideChat:se,onCloseSearch:()=>ae(!1),onOpenFile:vt,onOpenBrowser:D?()=>{ce(!1),ae(!1),D()}:void 0,onOpenSearch:()=>{ce(!1),ae(!0)},onOpenSideChat:q?()=>{ce(!1),ae(!1),q()}:void 0,onSearchQueryChange:_t,onSetFileBookmarkStatus:Ce?yt:void 0,onSelectFile:r=>{je(r),_("file")},onSelectFiles:ta,onSelectGoal:()=>_("goal"),onSelectSummary:()=>{_("summary"),ce(!1),ae(!1)},onSelectSideChat:X,onToggleAddMenu:()=>{ce(r=>!r),ae(!1)},onToggleExpanded:$}),Cs&&e.jsx("div",{className:"workspace-diff-empty",role:"alert",children:Cs}),xe==="goal"&&he?e.jsx(Ai,{createRuntime:B?.createRuntime??null,goalRuntime:B?.goalRuntime??null,subagentRuntime:B?.subagentRuntime??null,onRunSubagentLifecycleAction:a?ga:void 0}):xe==="summary"&&Te?ne?e.jsx(ir,{summary:ne}):e.jsx(Qi,{sandboxId:A,connection:a}):la?e.jsxs(e.Fragment,{children:[e.jsx(dr,{canSaveActiveFile:!!(!F&&!nt&&j&&Be.has(j)&&ht!==j),canCheckActiveFile:at,collapsed:xs,editorControlsVisible:bs,editorDiagnosticStatus:ba,editorDiagnosticsChecking:Qt,hideWhiteSpace:vs,loadFullFiles:Le,menuOpen:Lt,renderMarkdown:Tt,showEditorCommandBar:Yt,showRenderMarkdownToggle:xa,splitView:ks,wordDiffs:js,wordWrap:ms,onCopyGitApply:na,onEditorCheck:Jn,onEditorRedo:Yn,onEditorSave:Zn,onEditorUndo:Qn,onRefresh:()=>{C?Me():W()},onToggleCollapsed:()=>En(r=>!r),onToggleEditorControlsVisible:Kn,onToggleHideWhiteSpace:()=>Dn(r=>!r),onToggleLoadFullFiles:()=>An(r=>!r),onToggleMenu:r=>Pe(m=>r??!m),onToggleRenderMarkdown:()=>Pn(r=>!r),onToggleSplitView:()=>_n(r=>!r),onToggleWordDiffs:()=>Ln(r=>!r),onToggleWordWrap:()=>Fn(r=>!r)}),xe==="files"&&(k?e.jsxs("div",{className:"workspace-diff-files-preview-layout",children:[e.jsx(nn,{diff:me,expandedFolderPaths:ys,rootPath:S,repoFiles:Se,selectedPath:j,getFileBookmarkStatus:Ce?wt:void 0,onOpenFile:vt,onSetFileBookmarkStatus:Ce?yt:void 0,onToggleFolder:Ts}),Vs??e.jsx("div",{className:"workspace-diff-files-preview-empty",children:"Select a file to review its changes."})]}):e.jsx(nn,{diff:me,expandedFolderPaths:ys,rootPath:S,repoFiles:Se,selectedPath:j,getFileBookmarkStatus:Ce?wt:void 0,onOpenFile:vt,onSetFileBookmarkStatus:Ce?yt:void 0,onToggleFolder:Ts})),xe==="file"&&j&&Vs]}):e.jsx("div",{className:"workspace-diff-empty",children:e.jsx("span",{children:ua})})]}),e.jsx(Fa,{open:!!Bs,src:Bs,title:_e??"",onClose:()=>mt(null)})]})}const rl=Object.freeze(Object.defineProperty({__proto__:null,WorkspaceDiffPanel:Vr},Symbol.toStringTag,{value:"Module"}));export{vi as C,Vr as W,rl as a};
@@ -1,4 +1,4 @@
1
- import{r as q,j as r}from"./index-BE-wXZ5R.js";import{bH as le,s as L,o as ee,bI as bn,bJ as Qe,n as ze,_ as rn,bK as We,b as en,e as ji,X as Ut,bL as sn,aL as Ai,bt as Ci,ax as An,$ as Ni,av as at,Y as wi,bM as Ii,bm as _i,ba as Ei,bN as Ri,bO as ot,R as xe,bi as Ti,az as Pi,S as Oi,aw as Cn,C as Li,aF as ki,t as Mi}from"./App-CLFfy_Av.js";import{I as qi}from"./info-BLj0RvhA.js";import{M as Fi}from"./monitor-DZvOs_wC.js";import{P as cn}from"./play-BJPzemuY.js";import{G as Di}from"./git-commit-horizontal-CjGIIgRi.js";import{S as Ui}from"./square-Cb2c5td4.js";import{U as lt}from"./upload-D56kThRh.js";const Ee={custom:"custom"};function $i(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var be={},pn={},Ve={},st;function dn(){if(st)return Ve;st=1;function n(s){return typeof s>"u"||s===null}function i(s){return typeof s=="object"&&s!==null}function o(s){return Array.isArray(s)?s:n(s)?[]:[s]}function h(s,f){if(f){const g=Object.keys(f);for(let p=0,l=g.length;p<l;p+=1){const w=g[p];s[w]=f[w]}}return s}function c(s,f){let g="";for(let p=0;p<f;p+=1)g+=s;return g}function u(s){return s===0&&Number.NEGATIVE_INFINITY===1/s}return Ve.isNothing=n,Ve.isObject=i,Ve.toArray=o,Ve.repeat=c,Ve.isNegativeZero=u,Ve.extend=h,Ve}var Nn,ct;function mn(){if(ct)return Nn;ct=1;function n(o,h){let c="";const u=o.reason||"(unknown reason)";return o.mark?(o.mark.name&&(c+='in "'+o.mark.name+'" '),c+="("+(o.mark.line+1)+":"+(o.mark.column+1)+")",!h&&o.mark.snippet&&(c+=`
1
+ import{r as q,j as r}from"./index-C8aCGagb.js";import{bK as le,s as L,o as ee,bL as bn,bM as Qe,n as ze,_ as rn,bN as We,b as en,e as ji,X as Ut,bO as sn,aO as Ai,bv as Ci,aA as An,a2 as Ni,ay as at,a0 as wi,bP as Ii,bo as _i,bd as Ei,bQ as Ri,bR as ot,V as xe,bk as Ti,aC as Pi,T as Oi,az as Cn,C as Li,aI as ki,x as Mi}from"./App-s-CJswyt.js";import{I as qi}from"./info-DLdbiUrh.js";import{M as Fi}from"./monitor-BFVCcbxp.js";import{P as cn}from"./play-C469pVZq.js";import{G as Di}from"./git-commit-horizontal-DrGxH2h4.js";import{S as Ui}from"./square-BuImvLhT.js";import{U as lt}from"./upload-2JkFZo3h.js";const Ee={custom:"custom"};function $i(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var be={},pn={},Ve={},st;function dn(){if(st)return Ve;st=1;function n(s){return typeof s>"u"||s===null}function i(s){return typeof s=="object"&&s!==null}function o(s){return Array.isArray(s)?s:n(s)?[]:[s]}function h(s,f){if(f){const g=Object.keys(f);for(let p=0,l=g.length;p<l;p+=1){const w=g[p];s[w]=f[w]}}return s}function c(s,f){let g="";for(let p=0;p<f;p+=1)g+=s;return g}function u(s){return s===0&&Number.NEGATIVE_INFINITY===1/s}return Ve.isNothing=n,Ve.isObject=i,Ve.toArray=o,Ve.repeat=c,Ve.isNegativeZero=u,Ve.extend=h,Ve}var Nn,ct;function mn(){if(ct)return Nn;ct=1;function n(o,h){let c="";const u=o.reason||"(unknown reason)";return o.mark?(o.mark.name&&(c+='in "'+o.mark.name+'" '),c+="("+(o.mark.line+1)+":"+(o.mark.column+1)+")",!h&&o.mark.snippet&&(c+=`
2
2
 
3
3
  `+o.mark.snippet),u+" "+c):u}function i(o,h){Error.call(this),this.name="YAMLException",this.reason=o,this.mark=h,this.message=n(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i.prototype.toString=function(h){return this.name+": "+n(this,h)},Nn=i,Nn}var wn,ut;function zi(){if(ut)return wn;ut=1;const n=dn();function i(c,u,s,f,g){let p="",l="";const w=Math.floor(g/2)-1;return f-u>w&&(p=" ... ",u=f-w+p.length),s-f>w&&(l=" ...",s=f+w-l.length),{str:p+c.slice(u,s).replace(/\t/g,"→")+l,pos:f-u+p.length}}function o(c,u){return n.repeat(" ",u-c.length)+c}function h(c,u){if(u=Object.create(u||null),!c.buffer)return null;u.maxLength||(u.maxLength=79),typeof u.indent!="number"&&(u.indent=1),typeof u.linesBefore!="number"&&(u.linesBefore=3),typeof u.linesAfter!="number"&&(u.linesAfter=2);const s=/\r?\n|\r|\0/g,f=[0],g=[];let p,l=-1;for(;p=s.exec(c.buffer);)g.push(p.index),f.push(p.index+p[0].length),c.position<=p.index&&l<0&&(l=f.length-2);l<0&&(l=f.length-1);let w="";const T=Math.min(c.line+u.linesAfter,g.length).toString().length,U=u.maxLength-(u.indent+T+3);for(let D=1;D<=u.linesBefore&&!(l-D<0);D++){const Y=i(c.buffer,f[l-D],g[l-D],c.position-(f[l]-f[l-D]),U);w=n.repeat(" ",u.indent)+o((c.line-D+1).toString(),T)+" | "+Y.str+`
4
4
  `+w}const J=i(c.buffer,f[l],g[l],c.position,U);w+=n.repeat(" ",u.indent)+o((c.line+1).toString(),T)+" | "+J.str+`
@@ -0,0 +1 @@
1
+ import{j as e}from"./index-C8aCGagb.js";/* empty css */import{C as z}from"./cloud-upload-k9eqBsHr.js";import{az as j,a2 as _,X as D}from"./App-s-CJswyt.js";import{G as h}from"./git-commit-horizontal-DrGxH2h4.js";import{U as B}from"./upload-2JkFZo3h.js";function F({open:s,branch:l,filesChanged:i,additions:c,deletions:n,message:m,includeUnstaged:g,nextStep:a,draft:p,busy:t,canPush:u,canPublish:b,onMessageChange:f,onIncludeUnstagedChange:C,onNextStepChange:r,onDraftChange:N,onClose:v,onSubmit:k}){return s?e.jsx("div",{className:"git-dialog-backdrop",role:"presentation",children:e.jsxs("form",{className:"git-dialog commit-dialog","aria-label":"Commit changes",onSubmit:o=>{o.preventDefault(),k()},children:[e.jsx(x,{disabled:t,onClose:v}),e.jsx("div",{className:"git-dialog-icon",children:e.jsx(h,{size:18})}),e.jsx("h2",{children:"Commit your changes"}),e.jsxs("div",{className:"git-dialog-row",children:[e.jsx("span",{children:"Branch"}),e.jsxs("strong",{children:[e.jsx(j,{size:14}),l??"No branch"]})]}),e.jsxs("div",{className:"git-dialog-row",children:[e.jsx("span",{children:"Changes"}),e.jsxs("strong",{children:[i," ",i===1?"file":"files",e.jsxs("span",{className:"git-dialog-additions",children:["+",c]}),e.jsxs("span",{className:"git-dialog-deletions",children:["-",n]})]})]}),e.jsxs("label",{className:"git-dialog-toggle",children:[e.jsx("input",{checked:g,disabled:t,type:"checkbox",onChange:o=>C(o.target.checked)}),e.jsx("span",{}),"Include unstaged"]}),e.jsxs("label",{className:"git-dialog-field",children:[e.jsxs("span",{children:["Commit message",e.jsx("small",{children:"Leave blank to use an autogenerated message"})]}),e.jsx("textarea",{value:m,disabled:t,placeholder:"Update workspace",onChange:o=>f(o.target.value)})]}),e.jsxs("fieldset",{className:"git-dialog-next",children:[e.jsx("legend",{children:"Next steps"}),e.jsx(d,{active:a==="commit",icon:e.jsx(h,{size:14}),label:"Commit",disabled:t,onSelect:()=>r("commit")}),e.jsx(d,{active:a==="commit_push",icon:e.jsx(B,{size:14}),label:"Commit & push",disabled:t||!u,onSelect:()=>r("commit_push")}),b&&e.jsx(d,{active:a==="commit_publish",icon:e.jsx(z,{size:14}),label:"Commit & publish",disabled:t,onSelect:()=>r("commit_publish")}),e.jsx(d,{active:a==="commit_pr",icon:e.jsx(_,{size:14}),label:"Commit & create PR",disabled:!0,onSelect:()=>r("commit_pr")})]}),e.jsxs("div",{className:"git-dialog-footer",children:[e.jsxs("label",{className:"git-dialog-toggle draft-toggle",children:[e.jsx("input",{checked:p,disabled:t||a!=="commit_pr",type:"checkbox",onChange:o=>N(o.target.checked)}),e.jsx("span",{}),"Draft"]}),e.jsx("button",{className:"git-dialog-primary",disabled:t||i===0,type:"submit",children:"Continue"})]})]})}):null}function H({open:s,branchName:l,busy:i,onBranchNameChange:c,onSetPrefix:n,onClose:m,onSubmit:g}){return s?e.jsx("div",{className:"git-dialog-backdrop",role:"presentation",children:e.jsxs("form",{className:"git-dialog branch-dialog","aria-label":"Create branch",onSubmit:a=>{a.preventDefault(),g()},children:[e.jsx(x,{disabled:i,onClose:m}),e.jsx("div",{className:"git-dialog-icon",children:e.jsx(j,{size:18})}),e.jsx("h2",{children:"Work here"}),e.jsx("p",{children:"Create a branch to commit changes, push, and create a PR from this worktree."}),e.jsxs("label",{className:"git-dialog-field",children:[e.jsxs("span",{children:["Branch name",e.jsx("button",{className:"git-dialog-inline-action",disabled:i,type:"button",onClick:n,children:"Set prefix"})]}),e.jsx("input",{autoFocus:!0,disabled:i,value:l,onChange:a=>c(a.target.value)})]}),e.jsx("button",{className:"git-dialog-primary full",disabled:i||!l.trim(),type:"submit",children:"Create"})]})}):null}function d({active:s,icon:l,label:i,disabled:c,onSelect:n}){return e.jsxs("button",{"aria-pressed":s,className:s?"active":"",disabled:c,type:"button",onClick:n,children:[l,e.jsx("span",{children:i}),s&&e.jsx("span",{className:"git-dialog-check",children:"✓"})]})}function x({disabled:s,onClose:l}){return e.jsx("button",{className:"git-dialog-close",disabled:s,type:"button",onClick:l,children:e.jsx(D,{size:16})})}export{H as BranchDialog,F as CommitDialog};