openpond 0.2.67 → 0.2.69

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 (573) hide show
  1. package/dist/app-server.d.ts +668 -1
  2. package/dist/app-server.js +1 -1
  3. package/dist/chunks/account-context-V3KLSNKS.js +12 -0
  4. package/dist/chunks/{acp-NASAJV5E.js → acp-ER6CUXG2.js} +1 -1
  5. package/dist/chunks/{acp-agent-C3CRF6DT.js → acp-agent-AYJ5RPVF.js} +1 -1
  6. package/dist/chunks/actions-command-BBUS3HDK.js +2 -0
  7. package/dist/chunks/{app-layer-XIEZ6ALX.js → app-layer-JCEWGUDH.js} +1 -1
  8. package/dist/chunks/{app-server-connected-apps-IB6M35NS.js → app-server-connected-apps-ILXBFD3S.js} +1 -1
  9. package/dist/chunks/app-server-evaluations-RRLYWLPK.js +2 -0
  10. package/dist/chunks/app-server-harness-services-XXM336NU.js +2 -0
  11. package/dist/chunks/app-server-runtime-43MCH5SY.js +2 -0
  12. package/dist/chunks/apps-VNFGMQFG.js +2 -0
  13. package/dist/chunks/{chunk-W3ZILZUL.js → chunk-22RLEU3Q.js} +1 -1
  14. package/dist/chunks/chunk-2PXKSAG6.js +2 -0
  15. package/dist/chunks/{chunk-XEU4J4GJ.js → chunk-2TGHZXJE.js} +2 -2
  16. package/dist/chunks/{chunk-AXO6OHJB.js → chunk-3A2Y7UK3.js} +1 -1
  17. package/dist/chunks/chunk-3Z4VM2LF.js +4 -0
  18. package/dist/chunks/{chunk-V3T2OJBZ.js → chunk-4BUM6JEC.js} +2 -2
  19. package/dist/chunks/chunk-4G3GTEVS.js +23 -0
  20. package/dist/chunks/{chunk-43QYVOYA.js → chunk-4KNPCJR4.js} +1 -1
  21. package/dist/chunks/chunk-4KTGYHCE.js +2 -0
  22. package/dist/chunks/chunk-4PUOWSDE.js +13 -0
  23. package/dist/chunks/chunk-55YD4UTW.js +2 -0
  24. package/dist/chunks/chunk-5G7BQAUA.js +2 -0
  25. package/dist/chunks/chunk-65FJWWXG.js +2 -0
  26. package/dist/chunks/{chunk-4EZI4KCT.js → chunk-65WRWLUD.js} +1 -1
  27. package/dist/chunks/chunk-6D3FI2XT.js +2 -0
  28. package/dist/chunks/chunk-7EQLW2KM.js +12 -0
  29. package/dist/chunks/{chunk-5TPYBXWM.js → chunk-7NCM6GBN.js} +1 -1
  30. package/dist/chunks/chunk-7OFD6TFD.js +2 -0
  31. package/dist/chunks/chunk-7OKZCJHS.js +3 -0
  32. package/dist/chunks/{chunk-ADOCQA4D.js → chunk-7PKDJHT6.js} +1 -1
  33. package/dist/chunks/chunk-7RJOCGQ6.js +2 -0
  34. package/dist/chunks/{chunk-YR5URT73.js → chunk-7RSQOC5M.js} +3 -3
  35. package/dist/chunks/{chunk-FVK4W27G.js → chunk-AFH462DO.js} +1 -1
  36. package/dist/chunks/{chunk-GUG2SWRZ.js → chunk-AFKFN25T.js} +1 -1
  37. package/dist/chunks/chunk-AFYYIJ6K.js +2 -0
  38. package/dist/chunks/{chunk-U3MVH2YT.js → chunk-APKXXAUF.js} +1 -1
  39. package/dist/chunks/chunk-AQUZCWM3.js +2 -0
  40. package/dist/chunks/chunk-AUO5DCEU.js +2 -0
  41. package/dist/chunks/chunk-AYOMVI7J.js +2 -0
  42. package/dist/chunks/{chunk-RWRKUO5D.js → chunk-B66QCXH2.js} +1 -1
  43. package/dist/chunks/chunk-BDZDWHBJ.js +6 -0
  44. package/dist/chunks/chunk-BU6MW65V.js +10 -0
  45. package/dist/chunks/{chunk-P6NQYXN6.js → chunk-CCZ276IA.js} +1 -1
  46. package/dist/chunks/{chunk-YONDU5TN.js → chunk-CIZI6Z7D.js} +1 -1
  47. package/dist/chunks/{chunk-ATFV2NA4.js → chunk-CO23RRN7.js} +1 -1
  48. package/dist/chunks/{chunk-QAFXQHHG.js → chunk-D6L6UNUQ.js} +2 -2
  49. package/dist/chunks/chunk-DDOIPTOM.js +2 -0
  50. package/dist/chunks/{chunk-CSU7RDA5.js → chunk-DKOVZ6R2.js} +3 -3
  51. package/dist/chunks/chunk-DRLP7GIU.js +2 -0
  52. package/dist/chunks/{chunk-XDFXKRTI.js → chunk-DWF3FCY4.js} +1 -1
  53. package/dist/chunks/chunk-DXJC3QW7.js +2 -0
  54. package/dist/chunks/{chunk-IDILAYCW.js → chunk-E2JB5OCO.js} +1 -1
  55. package/dist/chunks/{chunk-GI7LTJV3.js → chunk-EDYCSW22.js} +1 -1
  56. package/dist/chunks/{chunk-4JYTFEND.js → chunk-EFP75UEX.js} +1 -1
  57. package/dist/chunks/{chunk-CX7HKSQ4.js → chunk-EGP6DF34.js} +2 -2
  58. package/dist/chunks/{chunk-D5OFN47Z.js → chunk-ESYPMD7Q.js} +1 -1
  59. package/dist/chunks/{chunk-36FNNR5N.js → chunk-EWDDDHJN.js} +1 -1
  60. package/dist/chunks/{chunk-PWKJ5KLZ.js → chunk-EXYSD45J.js} +1 -1
  61. package/dist/chunks/{chunk-R6VI7MX5.js → chunk-EYTTZ5H4.js} +1 -1
  62. package/dist/chunks/{chunk-WD6ANOLL.js → chunk-FNGZ4UDZ.js} +1 -1
  63. package/dist/chunks/{chunk-YKTJPCYZ.js → chunk-G4FRBT7G.js} +4 -4
  64. package/dist/chunks/{chunk-JFZ6USNQ.js → chunk-G7X73SBG.js} +1 -1
  65. package/dist/chunks/{chunk-ULJZ7NUF.js → chunk-GY7YSD6J.js} +1 -1
  66. package/dist/chunks/{chunk-CWAQOFLP.js → chunk-GYYJ47GX.js} +1 -1
  67. package/dist/chunks/chunk-HG2YFMVU.js +4 -0
  68. package/dist/chunks/{chunk-YQBL5P6R.js → chunk-HKVFU3B3.js} +1 -1
  69. package/dist/chunks/{chunk-VEXJV5H5.js → chunk-IIT66347.js} +4 -4
  70. package/dist/chunks/{chunk-B2K5WQZE.js → chunk-IO5DZUKL.js} +1 -1
  71. package/dist/chunks/chunk-J256AEEE.js +2 -0
  72. package/dist/chunks/{chunk-CRDKBFRN.js → chunk-JEMECEQH.js} +1 -1
  73. package/dist/chunks/{chunk-YMCF5GR2.js → chunk-JQOVC35K.js} +1 -1
  74. package/dist/chunks/{chunk-6LFTQBXP.js → chunk-JT5YQ52I.js} +1 -1
  75. package/dist/chunks/chunk-JVMSN7LH.js +2 -0
  76. package/dist/chunks/{chunk-HORMGT2Q.js → chunk-JXYJQT5Q.js} +1 -1
  77. package/dist/chunks/{chunk-WDKZMXIU.js → chunk-K7KBFM2T.js} +1 -1
  78. package/dist/chunks/{chunk-UBTP3QWI.js → chunk-KCLMA2IH.js} +1 -1
  79. package/dist/chunks/chunk-KDER7R45.js +2 -0
  80. package/dist/chunks/{chunk-R6MMWEH4.js → chunk-KP2MYTP5.js} +1 -1
  81. package/dist/chunks/{chunk-TV2LE2BD.js → chunk-KU4TPDPH.js} +2 -2
  82. package/dist/chunks/{chunk-WJSJXK2N.js → chunk-KUE46HTH.js} +1 -1
  83. package/dist/chunks/chunk-LSKMALD6.js +161 -0
  84. package/dist/chunks/chunk-LVXL7T5O.js +2 -0
  85. package/dist/chunks/{chunk-TSQ2I6XV.js → chunk-M4A7G4S5.js} +2 -2
  86. package/dist/chunks/{chunk-MX7KV5DA.js → chunk-M4ZHFDRJ.js} +1 -1
  87. package/dist/chunks/chunk-M5X7XKXY.js +12 -0
  88. package/dist/chunks/{chunk-XT5WUQGT.js → chunk-MIFVX5PK.js} +1 -1
  89. package/dist/chunks/{chunk-4VZJQRQI.js → chunk-MOXIGLN2.js} +1 -1
  90. package/dist/chunks/{chunk-UKSSFB4Q.js → chunk-N5EAVX4G.js} +1 -1
  91. package/dist/chunks/{chunk-4B7EGNYX.js → chunk-NMMHXYDJ.js} +1 -1
  92. package/dist/chunks/{chunk-EBOTNBUS.js → chunk-NRYC4NH6.js} +1 -1
  93. package/dist/chunks/chunk-NSSZ2ZIU.js +2 -0
  94. package/dist/chunks/chunk-NW6WGGSL.js +2 -0
  95. package/dist/chunks/{chunk-7P5SH3CI.js → chunk-NZDLL6JN.js} +1 -1
  96. package/dist/chunks/{chunk-4TTXNVCE.js → chunk-OFJPOTES.js} +1 -1
  97. package/dist/chunks/chunk-OUJ63LMU.js +2 -0
  98. package/dist/chunks/{chunk-SD2XDZQW.js → chunk-P4QM63L3.js} +1 -1
  99. package/dist/chunks/chunk-PACLKDTN.js +2 -0
  100. package/dist/chunks/{chunk-VPAEFG7X.js → chunk-PAYFJHPO.js} +1 -1
  101. package/dist/chunks/{chunk-OPTJYDZN.js → chunk-PHZZBXDO.js} +1 -1
  102. package/dist/chunks/{chunk-HPTEJBP4.js → chunk-PKJHN666.js} +1 -1
  103. package/dist/chunks/{chunk-HNDAGZCF.js → chunk-PLROXHG2.js} +1 -1
  104. package/dist/chunks/{chunk-UNE52L3Y.js → chunk-PNPV2LDE.js} +1 -1
  105. package/dist/chunks/{chunk-2RSGVLZT.js → chunk-PSY6IRJE.js} +8 -8
  106. package/dist/chunks/{chunk-SVNEPXU3.js → chunk-Q73RKX7I.js} +1 -1
  107. package/dist/chunks/{chunk-IF5A3XWP.js → chunk-Q7FBVLLB.js} +1 -1
  108. package/dist/chunks/{chunk-V5AOM5MZ.js → chunk-Q7P34B2O.js} +1 -1
  109. package/dist/chunks/{chunk-375PADDM.js → chunk-QLGP2OAQ.js} +1 -1
  110. package/dist/chunks/{chunk-QQLS5FB7.js → chunk-QUNQM2E3.js} +1 -1
  111. package/dist/chunks/chunk-R2FYCJL6.js +2 -0
  112. package/dist/chunks/{chunk-6HQUIKC5.js → chunk-R4EEGWXB.js} +1 -1
  113. package/dist/chunks/chunk-R6I623SZ.js +11 -0
  114. package/dist/chunks/chunk-RCQYEHHD.js +2 -0
  115. package/dist/chunks/{chunk-26ID6A5C.js → chunk-RCRZXHAI.js} +1 -1
  116. package/dist/chunks/{chunk-TGULVWPV.js → chunk-RFQD6B44.js} +1 -1
  117. package/dist/chunks/{chunk-3WJQ4IGK.js → chunk-RPM4FDRX.js} +1 -1
  118. package/dist/chunks/{chunk-MCBRB5D6.js → chunk-RY46UPBO.js} +4 -4
  119. package/dist/chunks/{chunk-K3LS5SK7.js → chunk-SDHG6CKU.js} +1 -1
  120. package/dist/chunks/{chunk-XKZ4PFMQ.js → chunk-SO4GMSNP.js} +1 -1
  121. package/dist/chunks/{chunk-O6ZYDHEJ.js → chunk-SSHE6B7Z.js} +1 -1
  122. package/dist/chunks/{chunk-SH7POUVX.js → chunk-SV7ZBEK2.js} +6 -6
  123. package/dist/chunks/{chunk-SODAOLAP.js → chunk-TB5P3FWM.js} +1 -1
  124. package/dist/chunks/{chunk-BJXPQIVD.js → chunk-U7D6Q744.js} +1 -1
  125. package/dist/chunks/chunk-U7X5ZLAL.js +2 -0
  126. package/dist/chunks/{chunk-N54CPLVD.js → chunk-UANH7U3Y.js} +1 -1
  127. package/dist/chunks/{chunk-BUZ7CBJC.js → chunk-UGFSAG4U.js} +1 -1
  128. package/dist/chunks/chunk-ULTV6INR.js +2 -0
  129. package/dist/chunks/{chunk-V3ILZQER.js → chunk-UMAVVMXL.js} +7 -7
  130. package/dist/chunks/chunk-V24VHT76.js +2 -0
  131. package/dist/chunks/chunk-VEBW7NKD.js +2 -0
  132. package/dist/chunks/chunk-VJR2GNRY.js +2 -0
  133. package/dist/chunks/{chunk-JD76ANPN.js → chunk-VJYOKU3C.js} +1 -1
  134. package/dist/chunks/{chunk-H2XG5N7D.js → chunk-VWWKWYSQ.js} +1 -1
  135. package/dist/chunks/chunk-WCNPGKST.js +2 -0
  136. package/dist/chunks/chunk-WD4KAKEX.js +2 -0
  137. package/dist/chunks/chunk-WGQ3FMRF.js +2 -0
  138. package/dist/chunks/{chunk-6C3CXME7.js → chunk-WNXUSELC.js} +1 -1
  139. package/dist/chunks/{chunk-RS526BG7.js → chunk-WZ35ICTE.js} +3 -3
  140. package/dist/chunks/chunk-XHACK2KR.js +2 -0
  141. package/dist/chunks/chunk-XOPHFUUY.js +2 -0
  142. package/dist/chunks/{chunk-ZVMQLIRA.js → chunk-XT4CSKHM.js} +1 -1
  143. package/dist/chunks/{chunk-KQD36SBJ.js → chunk-XY7HFXLH.js} +1 -1
  144. package/dist/chunks/{chunk-UXO33ST5.js → chunk-XYZV3FKD.js} +1 -1
  145. package/dist/chunks/{chunk-GC6RJBRZ.js → chunk-Y2WNZWT2.js} +1 -1
  146. package/dist/chunks/chunk-Y4I6CFZJ.js +2 -0
  147. package/dist/chunks/chunk-YDZBX4XQ.js +2 -0
  148. package/dist/chunks/chunk-YI6ME6PU.js +22 -0
  149. package/dist/chunks/{chunk-H42UW6IF.js → chunk-YXMYK5P7.js} +1 -1
  150. package/dist/chunks/{chunk-QFL2VQKX.js → chunk-Z33RVGP6.js} +1 -1
  151. package/dist/chunks/chunk-Z5CQXPIS.js +6 -0
  152. package/dist/chunks/{chunk-OY4B7Y3T.js → chunk-ZDEIVUUI.js} +1 -1
  153. package/dist/chunks/{chunk-XGJG2ZKE.js → chunk-ZIQJDTQB.js} +1 -1
  154. package/dist/chunks/{chunk-IR2Y2VQY.js → chunk-ZYLLPRPU.js} +1 -1
  155. package/dist/chunks/cli-R7TAP6Z2.js +2 -0
  156. package/dist/chunks/{command-NWOZXU57.js → command-LNOVZQSK.js} +3 -3
  157. package/dist/chunks/{configuration-command-ZEIBQKB3.js → configuration-command-C3QBDFND.js} +1 -1
  158. package/dist/chunks/connected-app-executor-LAEAQUJS.js +2 -0
  159. package/dist/chunks/connected-evidence-VKY6O2JW.js +2 -0
  160. package/dist/chunks/{connected-starting-assets-66Y46ZPM.js → connected-starting-assets-5LAJ7CZY.js} +1 -1
  161. package/dist/chunks/{connection-GDWPMHPC.js → connection-VMBXW5PD.js} +1 -1
  162. package/dist/chunks/{continual-TNPTWTKK.js → continual-FVOLGGOE.js} +1 -1
  163. package/dist/chunks/core-commands-5TNBVR72.js +2 -0
  164. package/dist/chunks/dataset-preparation-authoring-UUYFWWCT.js +4 -0
  165. package/dist/chunks/datasets-BIDZJYDC.js +2 -0
  166. package/dist/chunks/desktop-test-BY2MS3UL.js +3 -0
  167. package/dist/chunks/dist-2MKJC6HN.js +2 -0
  168. package/dist/chunks/{dist-GR56E3QK.js → dist-DKE7RJZN.js} +1 -1
  169. package/dist/chunks/evaluation-coordination-FXB4DXZA.js +2 -0
  170. package/dist/chunks/experiment-improvements-JPDLKZXD.js +2 -0
  171. package/dist/chunks/experiments-IEN7RXLX.js +2 -0
  172. package/dist/chunks/experiments-signal-L32D36NH.js +2 -0
  173. package/dist/chunks/{extension-UH34ZF7N.js → extension-3EKIT6BB.js} +1 -1
  174. package/dist/chunks/{help-O53DTZGN.js → help-PLQJOP4P.js} +1 -1
  175. package/dist/chunks/host-profile-evaluation-tools-UF4ATIUF.js +2 -0
  176. package/dist/chunks/host-profile-external-dataset-KSEPXY2S.js +2 -0
  177. package/dist/chunks/hosted-app-server-composition-GZES7QXJ.js +2 -0
  178. package/dist/chunks/hosted-experiment-improvement-VG2WE7XZ.js +3 -0
  179. package/dist/chunks/hosted-harness-runtime-MMTLCL23.js +2 -0
  180. package/dist/chunks/hosted-profile-candidate-PTGQLPZO.js +3 -0
  181. package/dist/chunks/hosted-profile-compiler-FS5R6CHJ.js +2 -0
  182. package/dist/chunks/hosted-profile-evaluation-control-UUEZEMXU.js +2 -0
  183. package/dist/chunks/hosted-profile-evaluation-inspection-4F7OEF4T.js +3 -0
  184. package/dist/chunks/hosted-profile-evaluation-preparation-LIJJZDHQ.js +3 -0
  185. package/dist/chunks/hosted-tasksets-V24IBVJX.js +2 -0
  186. package/dist/chunks/human-review-6V6EMNVN.js +2 -0
  187. package/dist/chunks/{import-OBAKUJPM.js → import-SI24Z7EF.js} +2 -2
  188. package/dist/chunks/{learning-CRR6NRPN.js → learning-LAXMGWSQ.js} +1 -1
  189. package/dist/chunks/learning-Y3UKNUGE.js +2 -0
  190. package/dist/chunks/local-harness-improvement-runtime-3YJQRYXC.js +2 -0
  191. package/dist/chunks/local-harness-taskset-review-XQHQ6JCR.js +2 -0
  192. package/dist/chunks/{model-projects-HP4DELCP.js → model-projects-6YWVD2TS.js} +1 -1
  193. package/dist/chunks/opchat-SV67HVMX.js +3 -0
  194. package/dist/chunks/opchat-bounded-chat-KLMIYSZZ.js +2 -0
  195. package/dist/chunks/organizations-OZZFX7RG.js +2 -0
  196. package/dist/chunks/{profile-3WZJ65CT.js → profile-TD5U3INY.js} +1 -1
  197. package/dist/chunks/project-action-payload-TK6G4VMC.js +2 -0
  198. package/dist/chunks/project-agent-FFXPNXCO.js +2 -0
  199. package/dist/chunks/published-experiment-source-SDXUVPE7.js +2 -0
  200. package/dist/chunks/refiner-profile-service-56VYLZQJ.js +2 -0
  201. package/dist/chunks/{runtime-XP4DEGR3.js → runtime-Q7JUJO4D.js} +2 -2
  202. package/dist/chunks/sandbox-command-4BCUDAED.js +2 -0
  203. package/dist/chunks/{sandbox-template-YFMHEMUQ.js → sandbox-template-GOY7QQUY.js} +1 -1
  204. package/dist/chunks/saved-work-M6PUHKCC.js +2 -0
  205. package/dist/chunks/{send-turn-D3GTSSHI.js → send-turn-YLY3YNEQ.js} +1 -1
  206. package/dist/chunks/setup-RMZ2BHLM.js +2 -0
  207. package/dist/chunks/{src-GQPWOPYA.js → src-C3ZUESMK.js} +1 -1
  208. package/dist/chunks/src-MT4B43TD.js +424 -0
  209. package/dist/chunks/standalone-experiment-turn-owner-TW5MTWIO.js +2 -0
  210. package/dist/chunks/store-chat-resources-IRHBW2EC.js +2 -0
  211. package/dist/chunks/{store-continual-support-reviews-VVRQO2JK.js → store-continual-support-reviews-3KK42L4I.js} +1 -1
  212. package/dist/chunks/store-conversation-serving-IVURK52V.js +2 -0
  213. package/dist/chunks/{store-create-improve-2XI36AET.js → store-create-improve-UTCLBXF2.js} +1 -1
  214. package/dist/chunks/{store-datasets-UFY422NG.js → store-datasets-4AQOVAQY.js} +1 -1
  215. package/dist/chunks/store-evaluation-results-PK2P3IMH.js +7 -0
  216. package/dist/chunks/{store-harness-workspaces-SGUEYDO2.js → store-harness-workspaces-YEXB4IRV.js} +1 -1
  217. package/dist/chunks/store-human-review-O4BVHP25.js +7 -0
  218. package/dist/chunks/store-learned-preference-migration-validation-44SVX6YB.js +2 -0
  219. package/dist/chunks/{store-learning-BFOT4QVT.js → store-learning-SIUQIY5C.js} +1 -1
  220. package/dist/chunks/{store-learning-credentials-DYTMWQTC.js → store-learning-credentials-BUHR7SN6.js} +1 -1
  221. package/dist/chunks/store-local-experiments-BHVTKPPE.js +97 -0
  222. package/dist/chunks/store-model-batch-review-RVAYUVK2.js +2 -0
  223. package/dist/chunks/{store-model-configuration-NJFWSYSA.js → store-model-configuration-6L3OYXF4.js} +1 -1
  224. package/dist/chunks/store-model-project-preparation-AAEKCF6V.js +2 -0
  225. package/dist/chunks/store-modification-recordings-LCPK6K2T.js +9 -0
  226. package/dist/chunks/{store-preference-comparison-MZAYONCK.js → store-preference-comparison-5YVIQNVB.js} +1 -1
  227. package/dist/chunks/{store-sidebar-file-bookmarks-J3JEVAYR.js → store-sidebar-file-bookmarks-WLMYDA4E.js} +1 -1
  228. package/dist/chunks/{store-sidebar-preferences-2JHTFXJK.js → store-sidebar-preferences-AFMYIDWT.js} +1 -1
  229. package/dist/chunks/{store-subagents-PUBQVWSU.js → store-subagents-KFPVSTRO.js} +1 -1
  230. package/dist/chunks/{store-task-inbox-3BREANOX.js → store-task-inbox-L6IQTY26.js} +1 -1
  231. package/dist/chunks/{store-task-inventory-5HRZCDUT.js → store-task-inventory-QWS2C656.js} +1 -1
  232. package/dist/chunks/store-taskset-drafts-FRFL6ITK.js +9 -0
  233. package/dist/chunks/{store-training-S3FXWLT6.js → store-training-FYXZU2FE.js} +1 -1
  234. package/dist/chunks/{store-training-jobs-2LCXPA7G.js → store-training-jobs-3N3VKPIY.js} +1 -1
  235. package/dist/chunks/{store-training-models-7AMKS7ZW.js → store-training-models-VOFVGPZR.js} +1 -1
  236. package/dist/chunks/{taskset-PLKWRT4X.js → taskset-UDDLFYKV.js} +1 -1
  237. package/dist/chunks/taskset-catalog-RZYEBCRQ.js +2 -0
  238. package/dist/chunks/taskset-packages-T6B6HYKZ.js +2 -0
  239. package/dist/chunks/taskset-packages-WMG5DUBN.js +2 -0
  240. package/dist/chunks/{teams-bot-VQXUA7U4.js → teams-bot-YCUTDDDC.js} +1 -1
  241. package/dist/chunks/tool-learning-ZQ6NSJ5K.js +2 -0
  242. package/dist/chunks/training-5NT2YB2L.js +2 -0
  243. package/dist/chunks/training-5UMT45UL.js +2 -0
  244. package/dist/chunks/training-UY6KRG4M.js +2 -0
  245. package/dist/chunks/{training-error-LQKCOQDJ.js → training-error-WF463UNZ.js} +1 -1
  246. package/dist/chunks/{training-hardware-ESXRWUIK.js → training-hardware-UWQCRDMV.js} +1 -1
  247. package/dist/chunks/training-hosted-CKSDRVL6.js +2 -0
  248. package/dist/chunks/training-hosted-alphaedit-HSMRDJTD.js +2 -0
  249. package/dist/chunks/training-hosted-decision-7JALOU6O.js +2 -0
  250. package/dist/chunks/training-hosted-engram-SXO75MFG.js +2 -0
  251. package/dist/chunks/{training-hosted-learning-WQ2IP5FP.js → training-hosted-learning-E2N32YU5.js} +1 -1
  252. package/dist/chunks/training-hosted-modification-comparison-TXFDJFTG.js +2 -0
  253. package/dist/chunks/training-hosted-neuron-training-J42WK4EH.js +2 -0
  254. package/dist/chunks/training-hosted-serving-report-BAEABGJH.js +2 -0
  255. package/dist/chunks/training-hosted-steering-T556BUBG.js +2 -0
  256. package/dist/chunks/training-model-start-P3PXDWNT.js +2 -0
  257. package/dist/chunks/web-search-ZEKJHZW4.js +2 -0
  258. package/dist/chunks/{workspaces-MCS2AQX6.js → workspaces-EK62ANTB.js} +1 -1
  259. package/dist/cli.js +1 -1
  260. package/dist/index.js +1 -1
  261. package/dist/sandbox/runtime-handle.d.ts +3 -5
  262. package/dist/sandbox/sandbox-instance-client.d.ts +11 -5
  263. package/dist/sandbox/types/billing.d.ts +140 -6
  264. package/dist/sandbox/types/io.d.ts +3 -0
  265. package/dist/sandbox/types/responses.d.ts +11 -1
  266. package/dist/sandbox/types/snapshots.d.ts +52 -3
  267. package/dist/sandbox-template/manifest.js +1 -1
  268. package/dist/skills/manifest.json +3 -3
  269. package/dist/skills/openpond-cli/references/experiments-and-training.md +461 -1
  270. package/dist/web/assets/App-CCuh99JW.js +54 -0
  271. package/dist/web/assets/{AppDialog-BvskhHE9.js → AppDialog-CxjDHVk9.js} +1 -1
  272. package/dist/web/assets/AppTerminalPanel-CKJIVpKa.js +2 -0
  273. package/dist/web/assets/{AppToastContext-D2788RqX.js → AppToastContext-EpiT1dHs.js} +1 -1
  274. package/dist/web/assets/AppsView-BsMyPX_3.js +1 -0
  275. package/dist/web/assets/{AttachmentTypeIcon-DVluUHuc.js → AttachmentTypeIcon-BXvZy5gB.js} +1 -1
  276. package/dist/web/assets/BrowserSidebar-BIIV4aq4.js +1 -0
  277. package/dist/web/assets/{CartesianChart-DdBZ69lI.js → CartesianChart-brqLBqnF.js} +1 -1
  278. package/dist/web/assets/ChatTimelineEntry-CwZbn16X.js +8 -0
  279. package/dist/web/assets/{CollaborationTabs-ba6WupeJ.js → CollaborationTabs-BU4uc4tZ.js} +1 -1
  280. package/dist/web/assets/{CommandMenu-D7wTaEgl.js → CommandMenu-DkWpXR55.js} +1 -1
  281. package/dist/web/assets/CommunityView-CsSxJZGn.js +1 -0
  282. package/dist/web/assets/{ComposerAttachments-aO90qXYz.js → ComposerAttachments-BdJGCYzI.js} +1 -1
  283. package/dist/web/assets/{ComposerCreateImproveStrip-BPUJBSyS.js → ComposerCreateImproveStrip-CWy0j1vv.js} +1 -1
  284. package/dist/web/assets/{ConversationImportsSettings-Bo836wKJ.js → ConversationImportsSettings-DCmiakbZ.js} +1 -1
  285. package/dist/web/assets/DatasetReviewImport-DEnF_pGu.js +1 -0
  286. package/dist/web/assets/ExperimentTrainingDataWorkspace-WhwQ0QBi.js +2 -0
  287. package/dist/web/assets/{FilePagePreview-C6wIp6uX.js → FilePagePreview-BRhhz99q.js} +2 -2
  288. package/dist/web/assets/{GetStartedView-CxMv8q-h.js → GetStartedView-CLVD-qEi.js} +1 -1
  289. package/dist/web/assets/{GettingStartedDialog-CEb0cS-o.js → GettingStartedDialog-CMxaAMg-.js} +1 -1
  290. package/dist/web/assets/HostedModelLearningReview-Cn-j-rDo.js +1 -0
  291. package/dist/web/assets/HostedModelLearningSettings-VNBvf38S.js +1 -0
  292. package/dist/web/assets/{HtmlVisual-CCuUkYT8.js → HtmlVisual-D5y2WG9L.js} +10 -10
  293. package/dist/web/assets/LabModelVersionDetailPage-BxRmYD6h.js +1 -0
  294. package/dist/web/assets/{TrainingRunLineage-PXzWR65d.css → LabModelWorkspace-DOrgCk9Z.css} +1 -1
  295. package/dist/web/assets/LabModelWorkspace-u2Ulm_z4.js +1 -0
  296. package/dist/web/assets/{LabSkillSidebar-CFROlATQ.js → LabSkillSidebar-C7IceJTJ.js} +1 -1
  297. package/dist/web/assets/LabsRoute-C9Y0GU34.css +1 -0
  298. package/dist/web/assets/LabsRoute-CbztQaEf.js +74 -0
  299. package/dist/web/assets/LearningBatchesPage-B1NZTBSv.css +1 -0
  300. package/dist/web/assets/LearningBatchesPage-CJqgZNvM.js +26 -0
  301. package/dist/web/assets/MainChatThread-DNMfrrRq.js +2 -0
  302. package/dist/web/assets/{MainPane-BOWkynGB.css → MainPane-BZlNLfTM.css} +1 -1
  303. package/dist/web/assets/MainPane-CQQxSDPS.js +13 -0
  304. package/dist/web/assets/ModelProjectPageHeader-Dge19aE1.js +1 -0
  305. package/dist/web/assets/NativeSetupTerminal-D4JnbpyD.js +2 -0
  306. package/dist/web/assets/{NativeSkillSidebar-MAJWS4mL.js → NativeSkillSidebar-Jzx1BeKV.js} +1 -1
  307. package/dist/web/assets/{NewProjectDialog-MQiUBVx3.js → NewProjectDialog-DcnGzEd9.js} +1 -1
  308. package/dist/web/assets/{OutputsPage-DpF-aRTu.js → OutputsPage-Cmk15Vt_.js} +1 -1
  309. package/dist/web/assets/{PageChrome-8gH2hyDb.js → PageChrome-Cz_fCqtn.js} +1 -1
  310. package/dist/web/assets/{ProjectsPage-BQ98oGyu.js → ProjectsPage-BZ3Eo3Mz.js} +1 -1
  311. package/dist/web/assets/RightChatPanelStack-C6H2vU9N.js +1 -0
  312. package/dist/web/assets/RightSidebarHomePanel-BfMMVkM1.js +1 -0
  313. package/dist/web/assets/{ScheduledWorkPage-CGCqZz_H.js → ScheduledWorkPage-CAkSwM0T.js} +1 -1
  314. package/dist/web/assets/{SettingsView-CqpMFLxy.js → SettingsView-DvQXGw3_.js} +3 -3
  315. package/dist/web/assets/{TasksetDraftEditorPrimitives-DJvIvzBb.js → TasksetDraftEditorPrimitives-JuU1k8vr.js} +1 -1
  316. package/dist/web/assets/TeamChatView-DmHjr8W9.js +1 -0
  317. package/dist/web/assets/{TerminalOverlay-D--M876l.js → TerminalOverlay-DlaM9d8F.js} +1 -1
  318. package/dist/web/assets/{TrainingCreationPanel-DDUoHQHU.js → TrainingCreationPanel-ClpylNsr.js} +1 -1
  319. package/dist/web/assets/{TrainingDraftPanel-CwLXn3Z7.js → TrainingDraftPanel-6tH2xSDj.js} +1 -1
  320. package/dist/web/assets/{UsageSettingsSection-CGwPregx.js → UsageSettingsSection-CzDqxOYM.js} +2 -2
  321. package/dist/web/assets/WorkSidebarPanel-CY-AHZ4-.js +1 -0
  322. package/dist/web/assets/WorkspaceDiffPanel-B4e0lyF7.js +11 -0
  323. package/dist/web/assets/WorkspaceEnvironmentMenu-D01ZkZZF.js +35 -0
  324. package/dist/web/assets/{WorkspaceFileLocation-D-ctFM4d.js → WorkspaceFileLocation-C5s_njZb.js} +1 -1
  325. package/dist/web/assets/{WorkspaceGitDialogs-CQ28j3R7.js → WorkspaceGitDialogs-DjPZ6KIh.js} +1 -1
  326. package/dist/web/assets/{WorkspaceMonacoEditor-BrZs6-EW.js → WorkspaceMonacoEditor-CC4sfOiU.js} +3 -3
  327. package/dist/web/assets/{WorkspacePdfPreview-CU6PSjjN.js → WorkspacePdfPreview-vszQqFa4.js} +2 -2
  328. package/dist/web/assets/{WorkspacePresentationPreview-IjXVXpIy.js → WorkspacePresentationPreview-DQTvhaRD.js} +1 -1
  329. package/dist/web/assets/api-client-DJRVOFzS.js +1 -0
  330. package/dist/web/assets/{app-models-CKXrDTEU.js → app-models-BUdzQbXo.js} +1 -1
  331. package/dist/web/assets/bot-Doyx3T4j.js +1 -0
  332. package/dist/web/assets/{browser-sidebar-links-D9v2cyJa.js → browser-sidebar-links-PVPCrsDJ.js} +1 -1
  333. package/dist/web/assets/chat-resources-Beh5lB36.js +1 -0
  334. package/dist/web/assets/chevron-down-DX1hzujj.js +1 -0
  335. package/dist/web/assets/chevron-right-DHN0y3KC.js +1 -0
  336. package/dist/web/assets/chevron-up-_QrW88NF.js +1 -0
  337. package/dist/web/assets/{chunk-TLSP5JKG-BrrVo5rJ.js → chunk-3BYFS4RO-ztZjcMmt.js} +1 -1
  338. package/dist/web/assets/chunk-AG6UJ3DI-D9KZjTYP.js +1 -0
  339. package/dist/web/assets/chunk-C3TS766N-ppRhs95p.js +1 -0
  340. package/dist/web/assets/chunk-GCUWJUUM-Dy6oUNJ6.js +9 -0
  341. package/dist/web/assets/chunk-GS5HEE4M-C0RLeIsy.js +1 -0
  342. package/dist/web/assets/{chunk-H3JZ3P5T-CzpTARDY.js → chunk-H3JZ3P5T-DolwEJXo.js} +2 -2
  343. package/dist/web/assets/chunk-Q4RGCEOI-Cr-dg4Nk.js +1 -0
  344. package/dist/web/assets/client-DwZ92xtu.js +1 -0
  345. package/dist/web/assets/{client-choice-storage-DUWsS4X0.js → client-choice-storage-DitqKiIT.js} +1 -1
  346. package/dist/web/assets/cloud-upload-HdzNTgr2.js +1 -0
  347. package/dist/web/assets/common-BWVSBnpX.js +1 -0
  348. package/dist/web/assets/copy-DTQhoBNg.js +1 -0
  349. package/dist/web/assets/create-pipeline-DsZzNkt9.js +1 -0
  350. package/dist/web/assets/{cssMode-SclUkqPt.js → cssMode-BRTtfXxU.js} +1 -1
  351. package/dist/web/assets/dataset-workspaces-BTPi71mz.js +1 -0
  352. package/dist/web/assets/external-link-H1629UU6.js +1 -0
  353. package/dist/web/assets/folder-open-CAGdWOrr.js +1 -0
  354. package/dist/web/assets/folder-plus-C14cs2mE.js +1 -0
  355. package/dist/web/assets/git-commit-horizontal-DFUfuVvF.js +1 -0
  356. package/dist/web/assets/{htmlMode-X3mQtOeh.js → htmlMode-BVaCcL76.js} +1 -1
  357. package/dist/web/assets/icons-Bk2b68aC.js +1 -0
  358. package/dist/web/assets/image-0DPVY6Ev.js +1 -0
  359. package/dist/web/assets/{index-LXNhSUEL.js → index-B6XX_0h3.js} +2 -2
  360. package/dist/web/assets/info-C8b_tafZ.js +1 -0
  361. package/dist/web/assets/{intake-contracts-wCkD2ErR.js → intake-contracts-B8JZKYwb.js} +1 -1
  362. package/dist/web/assets/{jsonMode-BoKiIdHd.js → jsonMode-BCKKQmmV.js} +1 -1
  363. package/dist/web/assets/loader-circle-y-SSPwpk.js +1 -0
  364. package/dist/web/assets/{lspLanguageFeatures-CO2mzpy1.js → lspLanguageFeatures-DozmNUOx.js} +1 -1
  365. package/dist/web/assets/maximize-2-CByk9-zN.js +1 -0
  366. package/dist/web/assets/message-square-C889vRqm.js +1 -0
  367. package/dist/web/assets/{monaco.contribution-wacA5FjV.js → monaco.contribution-B9q6qbbo.js} +2 -2
  368. package/dist/web/assets/{monaco.contribution-CVe3mWSY.js → monaco.contribution-BITdsRbn.js} +2 -2
  369. package/dist/web/assets/{monaco.contribution-hrusiaZi.js → monaco.contribution-BqA-XZ44.js} +2 -2
  370. package/dist/web/assets/{monaco.contribution-C7CAQIKF.js → monaco.contribution-DxAV1oS5.js} +2 -2
  371. package/dist/web/assets/monitor-BtxlcLuI.js +1 -0
  372. package/dist/web/assets/paperclip-BeIdaspf.js +1 -0
  373. package/dist/web/assets/{pdf-Ct3M2mVw.js → pdf-perlzwEB.js} +1 -1
  374. package/dist/web/assets/play-CHXXdkuO.js +1 -0
  375. package/dist/web/assets/plus-DFFWjhPw.js +1 -0
  376. package/dist/web/assets/{ponder-desktop-D-zB6X4L.js → ponder-desktop-Ca-9KggQ.js} +1 -1
  377. package/dist/web/assets/presentation-0bzvu6_u.js +1 -0
  378. package/dist/web/assets/{profile-ref-CCxrOCio.js → profile-ref-D8lxL7dW.js} +1 -1
  379. package/dist/web/assets/{python-C0-pUUAU.js → python-B9hOnkOI.js} +1 -1
  380. package/dist/web/assets/refresh-cw-D61-Ozk3.js +1 -0
  381. package/dist/web/assets/{requests-DjSt-duM.js → requests-DmeUYik4.js} +1 -1
  382. package/dist/web/assets/reward-checks-DJJZYgf8.js +7 -0
  383. package/dist/web/assets/save-iEMNZoPe.js +1 -0
  384. package/dist/web/assets/schemas-Brv9Vmnk.js +64 -0
  385. package/dist/web/assets/settings-BC-bzgk6.js +21 -0
  386. package/dist/web/assets/settings-lists-C84qxFmP.js +5 -0
  387. package/dist/web/assets/square-BE_4JMR3.js +1 -0
  388. package/dist/web/assets/square-terminal-Djpzo2Qs.js +1 -0
  389. package/dist/web/assets/{submit-issue-command-Gk3RKrY-.js → submit-issue-command-HfKzyxg5.js} +1 -1
  390. package/dist/web/assets/{toggleHighContrast-BnYUBgZB.js → toggleHighContrast-ClsXu39R.js} +1 -1
  391. package/dist/web/assets/training-DWfghwfZ.js +1 -0
  392. package/dist/web/assets/{training-model-data-CxR3xpmK.js → training-model-data-CIysl8wH.js} +4 -4
  393. package/dist/web/assets/{tsMode-BVNyOY8h.js → tsMode-nbmaMc-D.js} +1 -1
  394. package/dist/web/assets/upload-C6ug8RD-.js +1 -0
  395. package/dist/web/assets/{useAccountSettings-4_XfwJQi.js → useAccountSettings-Dr9h4Qz_.js} +1 -1
  396. package/dist/web/assets/{useAgentInventory-CVuamyT3.js → useAgentInventory-ByCk2JAv.js} +1 -1
  397. package/dist/web/assets/useChatContextSelection-C0eMm2g6.js +1 -0
  398. package/dist/web/assets/{useLocalAgentSchedules-CmwN4ohy.js → useLocalAgentSchedules-Do0y_leJ.js} +1 -1
  399. package/dist/web/assets/useQuery-D2MQ7e5U.js +1 -0
  400. package/dist/web/assets/wifi-off-Dr-CapyW.js +1 -0
  401. package/dist/web/assets/work-outputs-D_8TovAK.js +1 -0
  402. package/dist/web/assets/{workers-CjtQ2aBD.js → workers-DKvM2NdM.js} +1 -1
  403. package/dist/web/assets/x-Jx2jlP9u.js +1 -0
  404. package/dist/web/assets/{yaml-N1KUjBZ8.js → yaml-C02vq4ar.js} +1 -1
  405. package/dist/web/index.html +1 -1
  406. package/docs/command-reference.md +104 -3
  407. package/package.json +1 -1
  408. package/dist/chunks/account-context-TIJOM22A.js +0 -12
  409. package/dist/chunks/actions-command-BYPLSGZL.js +0 -2
  410. package/dist/chunks/app-server-evaluations-5YZUFXQ2.js +0 -2
  411. package/dist/chunks/app-server-harness-services-N5F5QVZI.js +0 -2
  412. package/dist/chunks/app-server-runtime-HJ2N57DL.js +0 -2
  413. package/dist/chunks/apps-WJTW64NW.js +0 -2
  414. package/dist/chunks/chunk-263WS3TB.js +0 -2
  415. package/dist/chunks/chunk-27JGS3KB.js +0 -12
  416. package/dist/chunks/chunk-2UZHLO2V.js +0 -23
  417. package/dist/chunks/chunk-2W22IXHB.js +0 -2
  418. package/dist/chunks/chunk-46RMTR2Z.js +0 -2
  419. package/dist/chunks/chunk-4JJ4RYIB.js +0 -6
  420. package/dist/chunks/chunk-4NN5OLKW.js +0 -161
  421. package/dist/chunks/chunk-543QHE3D.js +0 -2
  422. package/dist/chunks/chunk-5QOFUGYQ.js +0 -2
  423. package/dist/chunks/chunk-5ZNE43XC.js +0 -10
  424. package/dist/chunks/chunk-6IS5OLI5.js +0 -2
  425. package/dist/chunks/chunk-7HAGSE7L.js +0 -2
  426. package/dist/chunks/chunk-AXYAEWWA.js +0 -2
  427. package/dist/chunks/chunk-B7XJBP4U.js +0 -2
  428. package/dist/chunks/chunk-BBIA24GD.js +0 -10
  429. package/dist/chunks/chunk-CJDGLPNX.js +0 -4
  430. package/dist/chunks/chunk-DAEUVT2I.js +0 -6
  431. package/dist/chunks/chunk-FCXDPVGJ.js +0 -3
  432. package/dist/chunks/chunk-FE2ENE3U.js +0 -2
  433. package/dist/chunks/chunk-H6EUFJJK.js +0 -2
  434. package/dist/chunks/chunk-IOSBGCRT.js +0 -2
  435. package/dist/chunks/chunk-IXZ5ZGIL.js +0 -12
  436. package/dist/chunks/chunk-K6DB5QWG.js +0 -2
  437. package/dist/chunks/chunk-LI56PPCN.js +0 -2
  438. package/dist/chunks/chunk-OE2OOWEQ.js +0 -2
  439. package/dist/chunks/chunk-OYIFH2OM.js +0 -2
  440. package/dist/chunks/chunk-QOUOU7FE.js +0 -22
  441. package/dist/chunks/chunk-R5GRESW3.js +0 -2
  442. package/dist/chunks/chunk-TERKCK4I.js +0 -2
  443. package/dist/chunks/chunk-TS5HNRZB.js +0 -2
  444. package/dist/chunks/chunk-V3KEG6MI.js +0 -2
  445. package/dist/chunks/chunk-WGISITX6.js +0 -4
  446. package/dist/chunks/chunk-XD4ZIQZ2.js +0 -2
  447. package/dist/chunks/chunk-XHU4BZQY.js +0 -13
  448. package/dist/chunks/chunk-ZWEY66RT.js +0 -2
  449. package/dist/chunks/cli-HV32F7HD.js +0 -2
  450. package/dist/chunks/connected-app-executor-DFHWNMRM.js +0 -2
  451. package/dist/chunks/connected-evidence-WOM6N5HO.js +0 -2
  452. package/dist/chunks/core-commands-GWRHH53F.js +0 -2
  453. package/dist/chunks/dataset-preparation-authoring-WJ2XEUO7.js +0 -4
  454. package/dist/chunks/datasets-XIMF54QN.js +0 -2
  455. package/dist/chunks/desktop-test-HF42V2EP.js +0 -3
  456. package/dist/chunks/dist-T6ES2TSM.js +0 -2
  457. package/dist/chunks/evaluation-coordination-WZT6FDMS.js +0 -2
  458. package/dist/chunks/experiment-improvements-H35VS6XZ.js +0 -2
  459. package/dist/chunks/experiments-F54C32EE.js +0 -2
  460. package/dist/chunks/experiments-signal-ONIGTGYR.js +0 -2
  461. package/dist/chunks/host-profile-evaluation-tools-LMCJ3MDJ.js +0 -2
  462. package/dist/chunks/host-profile-external-dataset-4HOXANWK.js +0 -2
  463. package/dist/chunks/hosted-app-server-composition-Y64A2A2B.js +0 -2
  464. package/dist/chunks/hosted-experiment-improvement-B2V2WIUI.js +0 -3
  465. package/dist/chunks/hosted-harness-runtime-C7I4KSDK.js +0 -2
  466. package/dist/chunks/hosted-profile-candidate-CXPVEEYQ.js +0 -3
  467. package/dist/chunks/hosted-profile-compiler-FGCI2VRW.js +0 -2
  468. package/dist/chunks/hosted-profile-evaluation-control-INNUYMBD.js +0 -2
  469. package/dist/chunks/hosted-profile-evaluation-inspection-UPTBRYMS.js +0 -3
  470. package/dist/chunks/hosted-profile-evaluation-preparation-TIQSVKLQ.js +0 -3
  471. package/dist/chunks/hosted-tasksets-7VMYOTIO.js +0 -2
  472. package/dist/chunks/human-review-7XC77NQP.js +0 -2
  473. package/dist/chunks/learning-3XDGIYUL.js +0 -2
  474. package/dist/chunks/local-harness-improvement-runtime-UIKQSAMM.js +0 -2
  475. package/dist/chunks/local-harness-taskset-review-6KJN3EQL.js +0 -2
  476. package/dist/chunks/opchat-NWYWWIA7.js +0 -3
  477. package/dist/chunks/opchat-bounded-chat-ICURZM6R.js +0 -2
  478. package/dist/chunks/organizations-7DBQGCCV.js +0 -2
  479. package/dist/chunks/project-action-payload-7DRABTHY.js +0 -2
  480. package/dist/chunks/project-agent-AXJOWXRU.js +0 -2
  481. package/dist/chunks/published-experiment-source-YBBPLNF2.js +0 -2
  482. package/dist/chunks/refiner-profile-service-ATEFPF5O.js +0 -2
  483. package/dist/chunks/sandbox-command-CF2PJCFX.js +0 -2
  484. package/dist/chunks/saved-work-3OAVRBH3.js +0 -2
  485. package/dist/chunks/setup-RHIMFI2Y.js +0 -2
  486. package/dist/chunks/src-V236S6MV.js +0 -424
  487. package/dist/chunks/standalone-experiment-turn-owner-CDRMGLWW.js +0 -2
  488. package/dist/chunks/store-chat-resources-P4EKCLSY.js +0 -2
  489. package/dist/chunks/store-conversation-serving-YFEZYQD3.js +0 -2
  490. package/dist/chunks/store-evaluation-results-VBH4R2U7.js +0 -7
  491. package/dist/chunks/store-human-review-RFCVZ3HP.js +0 -7
  492. package/dist/chunks/store-learned-preference-migration-validation-FNBGGZU6.js +0 -2
  493. package/dist/chunks/store-local-experiments-XPXGYXNM.js +0 -97
  494. package/dist/chunks/store-model-batch-review-J2L5JQV2.js +0 -2
  495. package/dist/chunks/store-model-project-preparation-OCLIFKI2.js +0 -2
  496. package/dist/chunks/store-taskset-drafts-BNKUVHPA.js +0 -9
  497. package/dist/chunks/taskset-packages-SXBLYHSP.js +0 -2
  498. package/dist/chunks/taskset-packages-V5T4V7YN.js +0 -2
  499. package/dist/chunks/tool-learning-47XQKELE.js +0 -2
  500. package/dist/chunks/training-7VQNCOGH.js +0 -2
  501. package/dist/chunks/training-VKLPNCMC.js +0 -2
  502. package/dist/chunks/training-hosted-NNE6BP6S.js +0 -2
  503. package/dist/chunks/training-hosted-serving-report-VZ4SMLMG.js +0 -2
  504. package/dist/chunks/training-model-start-G7YDZ7ZG.js +0 -2
  505. package/dist/chunks/web-search-56QRZGPR.js +0 -2
  506. package/dist/web/assets/App-DmEA-Lia.js +0 -53
  507. package/dist/web/assets/AppTerminalPanel-ScQKJV4z.js +0 -2
  508. package/dist/web/assets/AppsView-B1uNg9IQ.js +0 -1
  509. package/dist/web/assets/BrowserSidebar-DfVQoJHn.js +0 -1
  510. package/dist/web/assets/ChatTimelineEntry-Bbc6HRks.js +0 -8
  511. package/dist/web/assets/CommunityView-mO58f2B0.js +0 -1
  512. package/dist/web/assets/HostedModelLearningReview-BQIS7hkd.js +0 -1
  513. package/dist/web/assets/HostedModelLearningSettings-BQ-YeFMT.js +0 -1
  514. package/dist/web/assets/LabModelVersionDetailPage-BkHeVbAx.js +0 -1
  515. package/dist/web/assets/LabsRoute-CE45yAXJ.css +0 -1
  516. package/dist/web/assets/LabsRoute-YA9YckKj.js +0 -101
  517. package/dist/web/assets/MainChatThread-DpyPgGKW.js +0 -2
  518. package/dist/web/assets/MainPane-WOeodByM.js +0 -10
  519. package/dist/web/assets/NativeSetupTerminal-fmG2c65K.js +0 -2
  520. package/dist/web/assets/RightChatPanelStack-Bs7A4dLs.js +0 -1
  521. package/dist/web/assets/RightSidebarHomePanel-C-D4kba2.js +0 -1
  522. package/dist/web/assets/TeamChatView-DjmIaLO1.js +0 -1
  523. package/dist/web/assets/TrainingRunLineage-CtYe1KGX.js +0 -1
  524. package/dist/web/assets/WorkSidebarPanel-C6wWuo7U.js +0 -1
  525. package/dist/web/assets/WorkspaceDiffPanel-JDOUmrC-.js +0 -11
  526. package/dist/web/assets/WorkspaceEnvironmentMenu-sfL5LZeB.js +0 -35
  527. package/dist/web/assets/api-client-Dgz-fOMl.js +0 -1
  528. package/dist/web/assets/bot-Cd761lRF.js +0 -1
  529. package/dist/web/assets/chat-resources-BUDXdoG0.js +0 -1
  530. package/dist/web/assets/chevron-down-DEbd6Ek-.js +0 -1
  531. package/dist/web/assets/chevron-right-DLYNg_Oq.js +0 -1
  532. package/dist/web/assets/chevron-up-DFJJccDl.js +0 -1
  533. package/dist/web/assets/chunk-GHPCQXG5-DKDBSd8H.js +0 -9
  534. package/dist/web/assets/chunk-GJRXJL6G-luaxRTYI.js +0 -1
  535. package/dist/web/assets/chunk-JDQVAG3R-C0-rh1aR.js +0 -1
  536. package/dist/web/assets/chunk-XMVSQIK4-BBU7r_NH.js +0 -1
  537. package/dist/web/assets/client-BNjO4Xi8.js +0 -1
  538. package/dist/web/assets/cloud-upload-CoM1FGeB.js +0 -1
  539. package/dist/web/assets/common-CFsO2ppZ.js +0 -1
  540. package/dist/web/assets/copy-BGOhV6Pk.js +0 -1
  541. package/dist/web/assets/create-pipeline-DRR0Qeec.js +0 -1
  542. package/dist/web/assets/createLucideIcon-Bv-_eGcE.js +0 -1
  543. package/dist/web/assets/external-link-CVXsNeO3.js +0 -1
  544. package/dist/web/assets/folder-open-MnOmh19D.js +0 -1
  545. package/dist/web/assets/folder-plus-BRddLBtO.js +0 -1
  546. package/dist/web/assets/git-commit-horizontal-Bm4rkXug.js +0 -1
  547. package/dist/web/assets/icons-CZxmQtZs.js +0 -1
  548. package/dist/web/assets/image-BViGUAiq.js +0 -1
  549. package/dist/web/assets/info-DYPIbKKD.js +0 -1
  550. package/dist/web/assets/loader-circle-JFgFNsP5.js +0 -1
  551. package/dist/web/assets/maximize-2-DXZCQO0b.js +0 -1
  552. package/dist/web/assets/message-square-cOCAL8J1.js +0 -1
  553. package/dist/web/assets/models-route-CWcJuOd0.js +0 -1
  554. package/dist/web/assets/monitor-B35XSAvn.js +0 -1
  555. package/dist/web/assets/paperclip-CKgDxioG.js +0 -1
  556. package/dist/web/assets/play-DzqLr7fM.js +0 -1
  557. package/dist/web/assets/plus-Ddp1vXnw.js +0 -1
  558. package/dist/web/assets/presentation-B0S9v7ib.js +0 -1
  559. package/dist/web/assets/refresh-cw-D45mW-vs.js +0 -1
  560. package/dist/web/assets/reward-checks-D139zwha.js +0 -7
  561. package/dist/web/assets/save-Gu4R_82E.js +0 -1
  562. package/dist/web/assets/schemas-C9IwV7NS.js +0 -64
  563. package/dist/web/assets/settings-DdonLCIN.js +0 -21
  564. package/dist/web/assets/settings-lists-CFHFtO0D.js +0 -5
  565. package/dist/web/assets/square-Dqduqyyu.js +0 -1
  566. package/dist/web/assets/square-terminal-DS3zwi6X.js +0 -1
  567. package/dist/web/assets/training-QBuGBGJd.js +0 -2
  568. package/dist/web/assets/upload-ABSJxuUM.js +0 -1
  569. package/dist/web/assets/useQuery-CCjwL8VI.js +0 -1
  570. package/dist/web/assets/wifi-off-DGJH7Pke.js +0 -1
  571. package/dist/web/assets/work-outputs-CnbRtTLg.js +0 -1
  572. package/dist/web/assets/x-B-_zJVOZ.js +0 -1
  573. /package/dist/chunks/{chunk-SFR32TMJ.js → chunk-JXLDEYRW.js} +0 -0
@@ -0,0 +1,11 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FilePagePreview-BRhhz99q.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/index-B6XX_0h3.js","assets/index-g7UqJhnX.css","assets/icons-Bk2b68aC.js","assets/App-CCuh99JW.js","assets/useQuery-D2MQ7e5U.js","assets/schemas-Brv9Vmnk.js","assets/common-BWVSBnpX.js","assets/settings-BC-bzgk6.js","assets/client-choice-storage-DitqKiIT.js","assets/api-client-DJRVOFzS.js","assets/requests-DmeUYik4.js","assets/create-pipeline-DsZzNkt9.js","assets/profile-ref-D8lxL7dW.js","assets/chunk-H3JZ3P5T-DolwEJXo.js","assets/work-outputs-D_8TovAK.js","assets/chunk-GS5HEE4M-C0RLeIsy.js","assets/chunk-GCUWJUUM-Dy6oUNJ6.js","assets/reward-checks-DJJZYgf8.js","assets/intake-contracts-B8JZKYwb.js","assets/training-DWfghwfZ.js","assets/chunk-Q4RGCEOI-Cr-dg4Nk.js","assets/ponder-desktop-Ca-9KggQ.js","assets/chat-resources-Beh5lB36.js","assets/app-models-BUdzQbXo.js","assets/model-display-zPvC4L2B.js","assets/submit-issue-command-HfKzyxg5.js","assets/connected-app-mentions-D3wRZLwI.js","assets/profile-agent-labels-Duh96b8x.js","assets/browser-sidebar-links-PVPCrsDJ.js","assets/browser-url-LACq2Ngu.js","assets/query-scope-BRpcgljO.js","assets/bot-Doyx3T4j.js","assets/chevron-down-DX1hzujj.js","assets/chevron-right-DHN0y3KC.js","assets/copy-DTQhoBNg.js","assets/external-link-H1629UU6.js","assets/loader-circle-y-SSPwpk.js","assets/maximize-2-CByk9-zN.js","assets/message-square-C889vRqm.js","assets/plus-DFFWjhPw.js","assets/refresh-cw-D61-Ozk3.js","assets/square-terminal-Djpzo2Qs.js","assets/x-Jx2jlP9u.js","assets/AppToastContext-EpiT1dHs.js","assets/NativeSetupTerminal-D4JnbpyD.js","assets/AppDialog-CxjDHVk9.js","assets/PageChrome-Cz_fCqtn.js","assets/NativeSetupTerminal-3eR9D_R3.css","assets/organization-types-PP-yuR2J.js","assets/ui-theme.generated-D-mc26qt.js","assets/App-DpFKLxuA.css","assets/pdf.worker.min-BrEVksTu.js","assets/WorkspacePdfPreview-vszQqFa4.js","assets/WorkspaceMonacoEditor-CC4sfOiU.js","assets/WorkspaceMonacoEditor-C5uazxST.css","assets/WorkspacePresentationPreview-DQTvhaRD.js","assets/WorkspaceFileLocation-C5s_njZb.js","assets/aiden0z-pptx-renderer.es-Bo43EjzT.js","assets/jszip.min-BWcKrrYP.js"])))=>i.map(i=>d[i]);
2
+ import{i as e,n as t}from"./rolldown-runtime-Dd_uD5pT.js";import{g as n,m as r,t as i}from"./index-B6XX_0h3.js";import{t as a}from"./useQuery-D2MQ7e5U.js";import{a as o,m as s,o as c,p as l,r as u,v as d}from"./schemas-Brv9Vmnk.js";import{n as f,o as p}from"./client-choice-storage-DitqKiIT.js";import{n as m}from"./create-pipeline-DsZzNkt9.js";import{n as ee}from"./app-models-BUdzQbXo.js";import{t as h}from"./query-scope-BRpcgljO.js";import{t as g}from"./icons-Bk2b68aC.js";import{A as _,B as te,E as ne,F as re,L as v,M as y,R as b,T as x,V as ie,_ as ae,a as oe,b as S,c as se,f as C,g as ce,h as le,j as ue,m as de,n as fe,o as pe,r as me,s as he,t as ge,v as _e,x as ve,y as ye}from"./training-model-data-CIysl8wH.js";import{t as be}from"./chevron-up-_QrW88NF.js";import{t as w}from"./folder-open-CAGdWOrr.js";import{t as xe}from"./info-C8b_tafZ.js";import{t as T}from"./loader-circle-y-SSPwpk.js";import{t as Se}from"./maximize-2-CByk9-zN.js";import{t as Ce}from"./message-square-C889vRqm.js";import{t as we}from"./plus-DFFWjhPw.js";import{t as E}from"./refresh-cw-D61-Ozk3.js";import{t as Te}from"./save-iEMNZoPe.js";import{t as Ee}from"./x-Jx2jlP9u.js";import{n as D,r as De}from"./AppToastContext-EpiT1dHs.js";import{$t as O,B as Oe,G as ke,Gt as Ae,H as je,J as Me,K as Ne,L as Pe,O as Fe,R as Ie,Sn as Le,Tn as k,U as A,V as Re,W as ze,Xt as Be,an as j,bn as M,dn as N,en as Ve,gn as He,gr as Ue,hn as P,hr as We,ln as F,mn as Ge,nn as Ke,q as qe,un as I,xn as Je}from"./App-CCuh99JW.js";import{n as L,t as R}from"./WorkspaceFileLocation-C5s_njZb.js";var Ye=u([`local`,`sandbox`]),Xe=u([`pinned`,`saved_for_later`]),Ze=s({id:d().min(1),workspaceKind:Ye,workspaceId:d().min(1),workspaceName:d().min(1),path:d().min(1),status:Xe,order:l().int().nonnegative().nullable().default(null),sourceSessionId:d().min(1).nullable().default(null),available:c().default(!0),createdAt:d().min(1),updatedAt:d().min(1)});s({items:o(Ze)}),s({workspaceKind:Ye,workspaceId:d().trim().min(1),workspaceName:d().trim().min(1),path:d().trim().min(1),status:u([`pinned`,`saved_for_later`,`none`]),order:l().int().nonnegative().nullable().optional(),sourceSessionId:d().trim().min(1).nullable().optional()}),u([`pin`,`save_for_later`,`remove`,`list`]);function Qe(e){let t=e.trim().replaceAll(`\\`,`/`);if(t=t.replace(/^(?:workspace|sandbox):file:/,``),t=t.replace(/^\/workspace\/app\//,``),t=t.replace(/^\.\//,``),!t||t.startsWith(`/`))throw Error(`File path must be relative to the workspace.`);let n=t.split(`/`).filter(e=>e&&e!==`.`);if(n.some(e=>e===`..`))throw Error(`File path cannot leave the workspace.`);if(n.length===0)throw Error(`File path is required.`);return n.join(`/`)}function $e(e){return[`sidebar-file`,e.workspaceKind,encodeURIComponent(e.workspaceId),encodeURIComponent(Qe(e.path))].join(`:`)}var et=g(`text-align-start`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]]),tt=g(`chevrons-up`,[[`path`,{d:`m17 11-5-5-5 5`,key:`e8nh98`}],[`path`,{d:`m17 18-5-5-5 5`,key:`2avn1x`}]]),nt=g(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),rt=g(`eye-off`,[[`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`}]]),it=g(`panel-top`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]),at=g(`plug`,[[`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`}]]),ot=g(`redo-2`,[[`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`}]]),st=g(`undo-2`,[[`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`}]]),z=e(n(),1),B=r();function ct({createRuntime:e,goalRuntime:t,subagentRuntime:n=null,onRunSubagentLifecycleAction:r}){let i=e?`Create/Improve Details`:`Goal Details`,a=e?U(e.run.state):n?.activeCount?n.label:t?.actionLabel??`No active goal`;return(0,B.jsxs)(`div`,{className:`goal-details-view`,"aria-label":i,children:[(0,B.jsxs)(`div`,{className:`goal-details-header`,children:[(0,B.jsxs)(`div`,{className:`goal-details-title`,children:[(0,B.jsx)(I,{size:15,"aria-hidden":`true`}),(0,B.jsx)(`span`,{children:i})]}),(0,B.jsx)(`span`,{className:`goal-details-state ${Pt(e?.run.state??null)}`,children:a})]}),(0,B.jsx)(`div`,{className:`goal-details-body`,children:e?(0,B.jsx)(lt,{runtime:e}):t||n?(0,B.jsx)(dt,{goalRuntime:t,subagentRuntime:n,onRunSubagentLifecycleAction:r}):(0,B.jsx)(kt,{})})]})}function lt({runtime:e}){let t=e.run,n=t.plan,r=m(n?.metadata)??m(t.metadata),i=t.questions,a=i.filter(e=>e.status===`pending`),o=t.sourceRefs,s=t.checkRefs,c=t.state,l=t.target.kind===`agent`?t.target.defaultActionKey:null;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(H,{title:`Current Work`,children:(0,B.jsx)(At,{rows:[[`State`,U(c)],[`Operation`,t.operation],[`Target`,U(t.target.kind)],[`Name`,t.target.displayName??t.target.id??`Pending`],[`Target ID`,t.target.id??`Pending`],[`Default action`,l??n?.defaultChatAction.key??`Pending`],[`Adapter`,U(t.adapter.kind)],[`Run`,t.id],[`Revision`,String(t.revision)]]})}),(0,B.jsx)(H,{title:`Plan`,children:n?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{className:`goal-details-summary`,children:n.summary}),(0,B.jsx)(At,{rows:[[`Objective`,n.objective],[`Context`,n.capturedContextSummary],[`Status`,U(n.status)],[`Plan ID`,n.id],[`Run ID`,n.runId],[`Approval`,n.approvalId??`Pending`],[`Approved`,n.approvedAt??`Not approved`]]})]}):a.length?(0,B.jsx)(`p`,{className:`goal-details-summary`,children:`Waiting for answers before the model finalizes the Create plan.`}):(0,B.jsx)(`p`,{className:`goal-details-summary`,children:`The model is preparing the Create plan.`})}),r?(0,B.jsxs)(H,{title:`Action Shape`,children:[(0,B.jsx)(At,{rows:[[`Mode`,r.label],[`Default action`,r.defaultActionKey??`None`],[`Direct action`,r.directActionHint??`None planned`],[`Artifacts`,r.artifactPolicy]]}),(0,B.jsx)(`p`,{className:`goal-details-note`,children:r.detail})]}):null,i.length?(0,B.jsx)(H,{title:`Questions`,children:(0,B.jsx)(`div`,{className:`goal-details-list`,children:i.map(e=>(0,B.jsxs)(`article`,{className:`goal-details-list-item`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:e.title}),(0,B.jsx)(`span`,{className:`goal-details-inline-state ${e.status}`,children:U(e.status)})]}),(0,B.jsx)(`p`,{children:e.prompt}),e.answer?(0,B.jsxs)(`small`,{children:[`Answer: `,e.answer.label??e.answer.value]}):e.options.length?(0,B.jsxs)(`small`,{children:[`Options: `,e.options.map(e=>e.label).join(`, `)]}):null]},e.id))})}):null,n?.requirements.length?(0,B.jsx)(H,{title:`Setup Requirements`,children:(0,B.jsx)(`div`,{className:`goal-details-list`,children:n.requirements.map(e=>(0,B.jsxs)(`article`,{className:`goal-details-list-item`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:e.name}),(0,B.jsx)(`span`,{className:`goal-details-inline-state ${e.status}`,children:U(e.status)})]}),(0,B.jsxs)(`small`,{children:[U(e.kind),e.detail?`: ${e.detail}`:``]})]},`${e.kind}:${e.name}`))})}):null,n?.sourcePlan.length?(0,B.jsx)(H,{title:`Source Plan`,children:(0,B.jsx)(jt,{refs:n.sourcePlan.map(e=>({id:`${e.operation}:${e.path}`,primary:e.path,secondary:`${U(e.operation)}: ${e.reason}`}))})}):null,n?.checks.length?(0,B.jsx)(H,{title:`Checks`,children:(0,B.jsx)(jt,{refs:n.checks.map(e=>({id:e.name,primary:e.name,secondary:`${e.required?`Required`:`Optional`}: ${e.command}`}))})}):null,o.length||s.length?(0,B.jsx)(H,{title:`Run Refs`,children:(0,B.jsx)(jt,{refs:[...o.map(e=>({id:`source:${e}`,primary:e,secondary:`Source ref`})),...s.map(e=>({id:`check:${e}`,primary:e,secondary:`Check ref`}))]})}):null,(0,B.jsx)(ut,{run:t}),t.blockedReason?(0,B.jsx)(H,{title:`Blocked`,children:(0,B.jsxs)(`div`,{className:`goal-details-alert`,children:[(0,B.jsx)(Ge,{size:15}),(0,B.jsx)(`span`,{children:t.blockedReason})]})}):null,(0,B.jsx)(H,{title:`Raw State`,children:(0,B.jsxs)(`details`,{className:`goal-details-raw`,children:[(0,B.jsx)(`summary`,{children:`Show structured payload`}),(0,B.jsx)(`pre`,{children:JSON.stringify(t,null,2)})]})})]})}function ut({run:e}){let t=[...e.context.attachments.map(e=>({id:`attachment:${e.id??e.name}`,primary:e.name,secondary:e.ref??e.mediaType??`Attachment`})),...e.context.apps.map(e=>({id:`app:${e.id}`,primary:e.name,secondary:e.required?`Required app context`:`Optional app context`})),...e.context.tools.map(e=>({id:`tool:${e.name}`,primary:e.name,secondary:e.outputSummary??e.inputSummary??`Tool context`})),...e.context.targetRepoAssumptions.map(e=>({id:`target:${e}`,primary:e,secondary:`Target assumption`}))],n=e.workflowCapture,r=n?[...n.files.map(e=>({id:`workflow-file:${e}`,primary:e,secondary:`Captured file`})),...n.outputArtifacts.map(e=>({id:`workflow-artifact:${e}`,primary:e,secondary:`Output artifact`})),...n.traceRefs.map(e=>({id:`workflow-trace:${e}`,primary:e,secondary:`Trace`}))]:[];return!t.length&&!r.length?null:(0,B.jsx)(H,{title:`Context`,children:(0,B.jsx)(jt,{refs:[...t,...r]})})}function dt({goalRuntime:e,subagentRuntime:t,onRunSubagentLifecycleAction:n}){return(0,B.jsxs)(B.Fragment,{children:[e?(0,B.jsxs)(H,{title:`Goal`,children:[(0,B.jsx)(`p`,{className:`goal-details-summary`,children:e.objective}),(0,B.jsx)(At,{rows:[[`Status`,e.actionLabel],[`Runtime`,e.timeLabel],[`Detail`,e.detail]]})]}):null,t?(0,B.jsx)(ft,{runtime:t,onRunSubagentLifecycleAction:n}):null,(0,B.jsx)(H,{title:`Raw State`,children:(0,B.jsxs)(`details`,{className:`goal-details-raw`,children:[(0,B.jsx)(`summary`,{children:`Show structured payload`}),(0,B.jsx)(`pre`,{children:JSON.stringify({goalRuntime:e,subagentRuntime:t},null,2)})]})})]})}function ft({runtime:e,onRunSubagentLifecycleAction:t}){let[n,r]=(0,z.useState)(null),[i,a]=(0,z.useState)(null);De(i);let o=async(e,n)=>{if(!t)return;let i=`${e}:${n}`;r(i),a(null);try{await t({runId:e,action:n})}catch(e){a(e instanceof Error?e.message:String(e))}finally{r(e=>e===i?null:e)}};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(H,{title:`Subagents`,children:[(0,B.jsx)(At,{rows:[[`Latest update`,yt(e)],[`Active`,String(e.activeCount)],[`Completed`,String(e.completedCount)],[`Failed`,String(e.failedCount)],[`Cancelled`,String(e.cancelledCount)],[`Paused`,String(e.needsResumeCount)],[`Terminal`,String(e.terminalCount)],[`Usage`,bt(e.usage.totalTokens,e.usage.requestCount)],[`Evidence`,String(e.evidenceRefs.length)],[`Checks`,String(e.testsRunCount)]]}),e.blockers.length>0?(0,B.jsx)(`ul`,{className:`goal-details-list compact`,children:e.blockers.slice(0,4).map(e=>(0,B.jsxs)(`li`,{className:`goal-details-list-item`,children:[(0,B.jsx)(`span`,{className:`goal-details-inline-state ${e.status}`,children:e.status}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:xt(e.roleId)}),(0,B.jsx)(`p`,{children:e.message})]})]},`${e.runId}:${e.message}`))}):null,(0,B.jsx)(`ul`,{className:`goal-details-list`,children:e.runs.slice(0,8).map(e=>(0,B.jsxs)(`li`,{className:`goal-details-list-item`,children:[(0,B.jsx)(`span`,{className:`goal-details-inline-state ${e.status}`,children:e.status}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:xt(e.roleId)}),(0,B.jsx)(`p`,{children:e.objective}),e.report?.summary?(0,B.jsx)(`small`,{children:e.report.summary}):null,t?(0,B.jsx)(mt,{pendingAction:n,run:e,onRun:o}):null]})]},e.id))})]}),e.finalResults.length>0?(0,B.jsx)(pt,{results:e.finalResults}):null]})}function pt({results:e}){return(0,B.jsx)(H,{title:`Child Results`,children:(0,B.jsx)(`ol`,{className:`goal-details-task-graph`,children:e.slice(0,6).map(e=>(0,B.jsxs)(`li`,{className:`goal-details-task-node`,children:[(0,B.jsxs)(`div`,{className:`goal-details-task-node-header`,children:[(0,B.jsx)(`span`,{className:`goal-details-inline-state ${e.status}`,children:e.status}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:xt(e.roleId)}),(0,B.jsx)(`small`,{children:e.objective})]})]}),(0,B.jsx)(`p`,{children:e.summary}),(0,B.jsxs)(`div`,{className:`goal-details-task-node-meta`,children:[(0,B.jsxs)(`span`,{children:[e.refs.length,` refs`]}),(0,B.jsxs)(`span`,{children:[e.testsRun.length+e.validationAttempts.length,` checks`]}),(0,B.jsxs)(`span`,{children:[e.blockers.length,` blockers`]}),(0,B.jsx)(`span`,{children:e.confidence?`${U(e.confidence)} confidence`:`Confidence unknown`})]}),e.findings.length>0?(0,B.jsxs)(`small`,{children:[`Findings: `,Tt(e.findings,3)]}):null,e.changedFiles.length>0?(0,B.jsxs)(`small`,{children:[`Files: `,Tt(e.changedFiles,4)]}):null,e.testsRun.length>0?(0,B.jsxs)(`small`,{children:[`Tests: `,Tt(e.testsRun,3)]}):null,e.validationAttempts.length>0?(0,B.jsxs)(`small`,{children:[`Validation: `,Tt(e.validationAttempts,2)]}):null,e.refs.length>0?(0,B.jsxs)(`small`,{children:[`Refs: `,Tt(e.refs.map(St),4)]}):null,e.blockers.length>0?(0,B.jsxs)(`small`,{children:[`Blockers: `,Tt(e.blockers,3)]}):null,e.workspaceRetention?(0,B.jsxs)(`small`,{children:[`Workspace: `,wt(e.workspaceRetention)]}):null,e.importantMessages.length>0?(0,B.jsxs)(`small`,{children:[`Messages: `,Tt(e.importantMessages.map(Ct),2)]}):null]},e.runId))})})}function mt({pendingAction:e,run:t,onRun:n}){let r=ht(t);return r.length===0?null:(0,B.jsx)(`div`,{className:`goal-details-actions`,children:r.map(r=>{let i=e===`${t.id}:${r}`;return(0,B.jsx)(`button`,{type:`button`,disabled:!!e,onClick:()=>void n(t.id,r),children:i?`Working...`:gt(r)},r)})})}function ht(e){let t=[],n=_t(e),r=vt(e);return n&&t.push(`cleanup`),r&&t.push(`archive`),t}function gt(e){return e===`cleanup`?`Clean`:e===`archive`?`Archive`:`Clean + archive`}function _t(e){if(!V(e))return!1;let t=Mt(e.metadata);if(!t?.subagentWorkspace&&!t?.workspaceHandoff)return!1;let n=Nt(Mt(Mt(t.lifecycleCleanup)?.workspaceCleanup)?.status);return n!==`removed`&&n!==`deleted`&&n!==`retained`&&n!==`skipped`}function vt(e){if(!e.childSessionId||!V(e))return!1;let t=Nt(Mt(Mt(e.metadata)?.childSessionArchive)?.status);return t!==`archived`&&t!==`already_archived`}function V(e){return e.status===`completed`||e.status===`failed`||e.status===`cancelled`}function yt(e){let t=e.latestMeaningfulUpdate;return t?`${xt(t.roleId)} ${t.status}: ${t.message}`:`No structured update`}function bt(e,t){if(e<=0&&t<=0)return`0 tokens`;let n=`${t} ${t===1?`request`:`requests`}`;return`${Et(e)} tokens · ${n}`}function xt(e){return e.slice(0,1).toUpperCase()+e.slice(1).replace(/[-_]+/g,` `)}function St(e){return`${e.kind}: ${e.label}`}function Ct(e){return`${U(e.kind)}: ${e.body}`}function wt(e){return`retained ${e.expiresAt?`until ${Dt(e.expiresAt)}`:`for inspection`}${e.trigger?` · ${U(e.trigger)}`:``}`}function Tt(e,t){let n=e.slice(0,t),r=e.length-n.length;return r>0?`${n.join(`, `)} +${r}`:n.join(`, `)}function Et(e){if(e<1e3)return String(e);if(e>=1e6){let t=e/1e6;return`${Ot(t,t<10?2:1)}M`}let t=e/1e3;return`${Ot(t,+(t<10))}k`}function Dt(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString([],{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}function Ot(e,t){return e.toFixed(t).replace(/\.0+$/,``).replace(/(\.\d*?)0+$/,`$1`)}function kt(){return(0,B.jsxs)(`div`,{className:`goal-details-empty`,children:[(0,B.jsx)(I,{size:18}),(0,B.jsx)(`span`,{children:`No active Goal or Create workflow.`})]})}function H({children:e,title:t}){return(0,B.jsxs)(`section`,{className:`goal-details-section`,children:[(0,B.jsx)(`h2`,{children:t}),e]})}function At({rows:e}){return(0,B.jsx)(`dl`,{className:`goal-details-grid`,children:e.map(([e,t])=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e}),(0,B.jsx)(`dd`,{children:t})]},e))})}function jt({refs:e}){return(0,B.jsx)(`ul`,{className:`goal-details-ref-list`,children:e.map(e=>(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`code`,{title:e.primary,children:e.primary}),(0,B.jsx)(`span`,{children:e.secondary})]},e.id))})}function Mt(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:null}function Nt(e){return typeof e==`string`&&e.trim()?e.trim():null}function U(e){return e.split(/[_-]/g).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function Pt(e){return e===`ready_local`||e===`published_hosted`?`success`:e===`blocked`||e===`failed`||e===`cancelled`?`danger`:e===`awaiting_questions`||e===`awaiting_plan_approval`?`warning`:`active`}function Ft({sandboxId:e,connection:t}){let[n,r]=(0,z.useState)(null),[i,a]=(0,z.useState)([]),[o,s]=(0,z.useState)(null),[c,l]=(0,z.useState)(null),[u,d]=(0,z.useState)(null),[f,p]=(0,z.useState)(null);De(u,{prefix:`Sandbox`}),De(f,{prefix:`Sandbox integrations`});let m=n?.integrationLeases??[],ee=(0,z.useMemo)(()=>i.filter(e=>e.status===`active`),[i]),h=(0,z.useMemo)(()=>Rt(n),[n]),g=(0,z.useCallback)(async()=>{if(!t)d(`OpenPond App server is not connected.`);else if(!e)r(null),a([]),d(null);else{s(`summary`),d(null);try{let n=await k.sandbox(t,e),i=await k.integrationConnections(t,It(n.sandbox));r(n.sandbox),a(i.connections),p(null)}catch(e){d(e instanceof Error?e.message:String(e))}finally{s(null)}}},[t,e]),_=(0,z.useCallback)(async()=>{if(t&&n){l(`load`),p(null);try{let[e,i]=await Promise.all([k.integrationConnections(t,It(n)),k.sandboxIntegrationLeases(t,n.id)]);a(e.connections),r(i.sandbox)}catch(e){p(e instanceof Error?e.message:String(e))}finally{l(null)}}},[t,n]),te=(0,z.useCallback)(async e=>{if(!t||!n)return;let i=Ue(e.provider),a=i?We(i):null,o=a?.leasePolicy.allowedCapabilityIds??[];if(!i||!a?.leasePolicy.leaseable||o.length===0)p(`${W(e.provider)} cannot be attached to this sandbox.`);else{l(`attach:${e.id}`),p(null);try{let i=await k.attachSandboxIntegrationConnection(t,n.id,{connectionId:e.id,provider:e.provider,capabilities:o,...e.scopes.length>0?{scopes:e.scopes}:{},...a.leasePolicy.defaultTtlSeconds?{ttlSeconds:a.leasePolicy.defaultTtlSeconds}:{},required:!1});r(i.sandbox)}catch(e){p(e instanceof Error?e.message:String(e))}finally{l(null)}}},[t,n]),ne=(0,z.useCallback)(async e=>{if(t&&n){l(`remove:${e}`),p(null);try{let i=await k.removeSandboxIntegrationLease(t,n.id,e);r(i.sandbox)}catch(e){p(e instanceof Error?e.message:String(e))}finally{l(null)}}},[t,n]);return(0,z.useEffect)(()=>{g()},[g]),e?(0,B.jsxs)(`div`,{className:`sandbox-summary-tab`,children:[(0,B.jsxs)(`section`,{className:`sandbox-workspace-section`,children:[(0,B.jsxs)(`div`,{className:`sandbox-workspace-heading`,children:[(0,B.jsx)(`h3`,{children:`Sandbox`}),(0,B.jsxs)(`div`,{className:`sandbox-workspace-heading-actions`,children:[n?(0,B.jsx)(`span`,{children:n.state}):null,(0,B.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Refresh summary`,"aria-label":`Refresh summary`,disabled:o!==null,onClick:()=>void g(),children:o===`summary`?(0,B.jsx)(T,{className:`spinning`,size:14}):(0,B.jsx)(E,{size:14})})]})]}),n?(0,B.jsxs)(`dl`,{className:`sandbox-workspace-kv`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Sandbox`}),(0,B.jsx)(`dd`,{children:Wt(n.id)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Spend`}),(0,B.jsxs)(`dd`,{children:[Kt(n.reservation.capturedUsd),` / `,Kt(n.budget.maxUsd)]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Reservation`}),(0,B.jsx)(`dd`,{children:n.reservation.status})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Idle cleanup`}),(0,B.jsx)(`dd`,{children:n.quotas?.idleTimeoutSeconds?`${Math.round(n.quotas.idleTimeoutSeconds/60)} min`:`-`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Updated`}),(0,B.jsx)(`dd`,{children:Gt(n.updatedAt)})]}),h?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Receipt`}),(0,B.jsxs)(`dd`,{children:[Wt(h.id),` / `,Kt(h.totalUsd)]})]}):null]}):(0,B.jsxs)(`div`,{className:`sandbox-workspace-loading`,children:[o===`summary`?(0,B.jsx)(T,{className:`spinning`,size:16}):null,(0,B.jsx)(`span`,{children:o===`summary`?`Loading sandbox`:`Sandbox unavailable`})]})]}),(0,B.jsxs)(`section`,{className:`sandbox-workspace-section`,children:[(0,B.jsxs)(`div`,{className:`sandbox-workspace-heading`,children:[(0,B.jsx)(`h3`,{children:`Integrations`}),(0,B.jsxs)(`div`,{className:`sandbox-workspace-heading-actions`,children:[(0,B.jsx)(`span`,{children:m.length}),(0,B.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Refresh integrations`,"aria-label":`Refresh integrations`,disabled:c!==null||!n,onClick:()=>void _(),children:c===`load`?(0,B.jsx)(T,{className:`spinning`,size:14}):(0,B.jsx)(E,{size:14})})]})]}),m.length>0?(0,B.jsx)(`div`,{className:`sandbox-workspace-integration-list`,children:m.map(e=>(0,B.jsxs)(`div`,{className:`sandbox-workspace-integration-row`,children:[(0,B.jsxs)(`div`,{className:`sandbox-workspace-integration-main`,children:[(0,B.jsx)(`span`,{children:W(e.provider)}),(0,B.jsxs)(`small`,{children:[e.required?`required`:`optional`,` / `,Vt(e),` / `,Lt(e)]})]}),(0,B.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Revoke ${W(e.provider)} lease`,"aria-label":`Revoke ${W(e.provider)} lease`,disabled:c!==null,onClick:()=>void ne(e.leaseId),children:c===`remove:${e.leaseId}`?(0,B.jsx)(T,{className:`spinning`,size:14}):(0,B.jsx)(re,{size:14})}),(0,B.jsxs)(`div`,{className:`sandbox-workspace-chip-row`,children:[e.capabilities.slice(0,5).map(t=>(0,B.jsx)(`span`,{children:Bt(e.provider,t)},t)),e.capabilities.length>5?(0,B.jsxs)(`span`,{children:[`+`,e.capabilities.length-5]}):null]})]},e.leaseId))}):(0,B.jsx)(`p`,{className:`sandbox-workspace-empty`,children:`No active integration leases.`}),ee.length>0?(0,B.jsx)(`div`,{className:`sandbox-workspace-integration-list`,children:ee.map(e=>{let t=m.some(t=>t.provider===e.provider),n=zt(e)?.leasePolicy.allowedCapabilityIds.length??0;return(0,B.jsxs)(`div`,{className:`sandbox-workspace-integration-row compact`,children:[(0,B.jsxs)(`div`,{className:`sandbox-workspace-integration-main`,children:[(0,B.jsx)(`span`,{children:Ht(e)}),(0,B.jsx)(`small`,{children:Ut(e,n)})]}),(0,B.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:t?`${W(e.provider)} already attached`:`Attach ${W(e.provider)}`,"aria-label":t?`${W(e.provider)} already attached`:`Attach ${W(e.provider)}`,disabled:t||c!==null||n===0,onClick:()=>void te(e),children:c===`attach:${e.id}`?(0,B.jsx)(T,{className:`spinning`,size:14}):(0,B.jsx)(at,{size:14})})]},e.id)})}):(0,B.jsx)(`p`,{className:`sandbox-workspace-empty`,children:`No connected accounts available.`})]})]}):(0,B.jsx)(`div`,{className:`sandbox-summary-tab`,children:(0,B.jsx)(`p`,{className:`sandbox-workspace-empty`,children:`No sandbox is attached yet.`})})}function It(e){return{status:`active`}}function Lt(e){return e.proxyUrl?`runtime proxy available`:`metadata only, no runtime proxy`}function Rt(e){return e?.receipts?.at(-1)??null}function zt(e){let t=Ue(e.provider);return t?We(t):null}function W(e){let t=Ue(e),n=t?We(t):null;return n?n.label:e===`microsoft_teams`?`Microsoft Teams`:e?e.replace(/_/g,` `):`Integration`}function Bt(e,t){let n=Ue(e);return(n?We(n):null)?.capabilities.find(e=>e.id===t)?.label??t}function Vt(e){return e.expiresAt?`expires ${Gt(e.expiresAt)}`:`active`}function Ht(e){let t=e.providerAccountName?.trim();return t?`${W(e.provider)} / ${t}`:W(e.provider)}function Ut(e,t){let n=[];return e.providerWorkspaceName&&n.push(e.providerWorkspaceName),n.push(`${t} lease ${t===1?`capability`:`capabilities`}`),e.scopes.length>0&&n.push(`${e.scopes.length} ${e.scopes.length===1?`scope`:`scopes`}`),n.join(` / `)}function Wt(e){return e.length>10?`${e.slice(0,8)}...`:e}function Gt(e){if(!e)return`-`;let t=new Date(e);return Number.isNaN(t.valueOf())?`-`:new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}).format(t)}function Kt(e){let t=Number(e??0);return new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,maximumFractionDigits:t>=10?2:4}).format(Number.isFinite(t)?t:0)}function qt({summary:e}){let t=he(e.taskset),n=e.taskset.learningSignals.demonstrations.filter(e=>e.approved).length,r=e.taskset.tasks.filter(e=>e.split===`frozen_eval`).length,i=e.plan?.recipe.method===`sft`||e.plan?.recipe.method===`grpo`?e.plan.recipe:null,a=C(e.taskset,e.plan),o=e.job?se(e.job.status,e.job.completedAt,e.job.updatedAt):null;return(0,B.jsxs)(`div`,{className:`training-sidebar-summary`,children:[(0,B.jsxs)(`header`,{children:[(0,B.jsx)(`h2`,{children:oe(e.taskset.name,t)}),(0,B.jsx)(`span`,{children:e.job?pe(e.job.status):e.taskset.readiness?.ready?`Ready to train`:`Needs review`})]}),(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Run`}),(0,B.jsxs)(`dl`,{children:[(0,B.jsx)(G,{label:`Primary recommendation`,value:t.toUpperCase()}),(0,B.jsx)(G,{label:`Training stage`,value:a}),(0,B.jsx)(G,{label:`Base model`,value:i?.baseModel.id??`Not selected`}),(0,B.jsx)(G,{label:`Compute`,value:e.plan?ge(e.plan.destinationId):`Not selected`}),(0,B.jsx)(G,{label:`Started`,value:fe(e.job?.startedAt??null)}),(0,B.jsx)(G,{label:`Duration`,value:me(e.job?.startedAt??null,o)})]})]}),(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Data`}),(0,B.jsxs)(`dl`,{children:[(0,B.jsx)(G,{label:`Training examples`,value:String(n)}),(0,B.jsx)(G,{label:`Test examples`,value:String(r)}),(0,B.jsx)(G,{label:`Dataset sources`,value:String(e.taskset.sourceRefs.length)})]})]}),i?(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Recipe`}),(0,B.jsxs)(`dl`,{children:[i.method===`grpo`?(0,B.jsx)(G,{label:`RL loss`,value:i.loss.method===`gspo-token`?`GSPO-token`:i.loss.method.toUpperCase()}):null,(0,B.jsx)(G,{label:`LoRA rank`,value:String(i.lora.rank)}),(0,B.jsx)(G,{label:`Learning rate`,value:String(i.optimizer.learningRate)}),(0,B.jsx)(G,{label:`Optimizer steps`,value:String(i.optimizer.maxSteps)}),(0,B.jsx)(G,{label:i.method===`grpo`?`Prompt length`:`Sequence length`,value:String(i.method===`grpo`?i.dataset.maxPromptTokens:i.dataset.maxSequenceLength)})]})]}):null,(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Result`}),(0,B.jsxs)(`dl`,{children:[(0,B.jsx)(G,{label:`Adapter`,value:e.lineage?`${a} ready`:`Not created`}),(0,B.jsx)(G,{label:`Evaluation`,value:e.lineage?.frozenEvaluationArtifactId?`Completed`:`Not completed`}),(0,B.jsx)(G,{label:`Artifacts`,value:String(e.artifacts.length)})]})]})]})}function G({label:e,value:t}){return(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e}),(0,B.jsx)(`dd`,{children:t})]})}function Jt(e){let t=Yt(``,``,`folder`);for(let n of e){let e=n.endsWith(`/`),r=n.split(`/`).filter(Boolean);if(r.length===0)continue;let i=t,a=``;for(let t=0;t<r.length;t+=1){let n=r[t];a=a?`${a}/${n}`:n;let o=!e&&t===r.length-1?`file`:`folder`,s=`${o}:${n}`,c=i.childMap.get(s);c||(c=Yt(n,a,o),i.childMap.set(s,c),i.children.push(c)),i=c}}return Xt(t.children)}function Yt(e,t,n){return{name:e,path:t,type:n,children:[],childMap:new Map}}function Xt(e){return e.sort((e,t)=>e.type===t.type?e.name.localeCompare(t.name):e.type===`folder`?-1:1).map(e=>({name:e.name,path:e.path,type:e.type,children:Xt(e.children)}))}function Zt({className:e,currentStatus:t,onSetStatus:n}){let r=t===`pinned`,i=t===`saved_for_later`;return(0,B.jsxs)(`span`,{className:`workspace-file-bookmark-actions ${e??`workspace-file-heading-actions`}`,children:[(0,B.jsx)(`button`,{type:`button`,className:r?`active`:void 0,"data-tooltip":r?`Unpin file`:`Pin file`,"aria-label":r?`Unpin file`:`Pin file`,"aria-pressed":r,onClick:()=>n(r?`none`:`pinned`),children:r?(0,B.jsx)(O,{size:14}):(0,B.jsx)(Ve,{size:14})}),(0,B.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?(0,B.jsx)(Je,{size:14}):(0,B.jsx)(Le,{size:14})})]})}function Qt({changedByPath:e,expandedFolderPaths:t,rootPath:n,repoFiles:r,selectedPath:i,getFileBookmarkStatus:a,onOpenFile:o,onSetFileBookmarkStatus:s,onToggleFolder:c}){let l=(0,z.useMemo)(()=>Jt(r),[r]);return(0,B.jsxs)(`div`,{className:`workspace-file-tree-view`,children:[(0,B.jsxs)(`div`,{className:`workspace-file-tree-header`,children:[(0,B.jsx)(w,{size:14}),(0,B.jsx)(`strong`,{title:n??void 0,children:n?n.split(`/`).at(-1):`Files`}),(0,B.jsx)(`span`,{children:r.length})]}),(0,B.jsx)(`div`,{className:`workspace-file-tree`,children:l.map(r=>(0,B.jsx)(K,{changedByPath:e,expandedFolderPaths:t,node:r,rootPath:n,selectedPath:i,getFileBookmarkStatus:a,onOpenFile:o,onSetFileBookmarkStatus:s,onToggleFolder:c},`${r.type}:${r.path}`))})]})}function K({changedByPath:e,depth:t=0,expandedFolderPaths:n,node:r,rootPath:i,selectedPath:a,getFileBookmarkStatus:o,onOpenFile:s,onSetFileBookmarkStatus:c,onToggleFolder:l}){let u=i?`${i}/${r.path}`:r.path,d=r.type===`folder`&&n.has(u),f=e.get(u),p=2+t*11;return r.type===`folder`?(0,B.jsxs)(`div`,{className:`workspace-file-tree-node`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`workspace-file-tree-row folder`,"aria-expanded":d,style:{paddingLeft:p},onClick:()=>l(u),children:[d?(0,B.jsx)(w,{size:14}):(0,B.jsx)(F,{size:14}),(0,B.jsx)(`span`,{children:r.name})]}),d&&r.children.map(r=>(0,B.jsx)(K,{changedByPath:e,depth:t+1,expandedFolderPaths:n,node:r,rootPath:i,selectedPath:a,getFileBookmarkStatus:o,onOpenFile:s,onSetFileBookmarkStatus:c,onToggleFolder:l},`${r.type}:${r.path}`))]}):(0,B.jsxs)(`div`,{className:`workspace-file-tree-row file ${f?`changed`:``} ${a===u?`selected`:``}`,style:{paddingLeft:p},children:[(0,B.jsxs)(`button`,{type:`button`,className:`workspace-file-tree-row-main`,title:u,onClick:()=>s(u),children:[(0,B.jsx)(b,{size:13}),(0,B.jsx)(`span`,{children:r.name}),f&&(0,B.jsxs)(`small`,{children:[(0,B.jsxs)(`span`,{className:`diff-addition`,children:[`+`,f.additions]}),(0,B.jsxs)(`span`,{className:`diff-deletion`,children:[`-`,f.deletions]})]})]}),/\.html?$/i.test(u)&&(0,B.jsx)(`button`,{type:`button`,className:`workspace-file-tree-bookmark-actions`,title:`View source`,"aria-label":`View source for ${r.name}`,onClick:()=>s(u,{source:!0}),children:`</>`}),c?(0,B.jsx)(Zt,{className:`workspace-file-tree-bookmark-actions`,currentStatus:o?.(u)??null,onSetStatus:e=>c(u,e)}):null]})}function $t({diff:e,expandedFolderPaths:t,rootPath:n,repoFiles:r,selectedPath:i,getFileBookmarkStatus:a,onOpenFile:o,onSetFileBookmarkStatus:s,onToggleFolder:c}){let l=e?.files??[],u=(0,z.useMemo)(()=>new Map(l.map(e=>[e.path,e])),[l]),d=n?.replace(/^\/+|\/+$/g,``)||null,f=(0,z.useMemo)(()=>{if(!d)return r;let e=`${d}/`;return r.filter(t=>t.startsWith(e)).map(t=>t.slice(e.length)).filter(Boolean)},[d,r]);return(0,B.jsx)(`div`,{className:`workspace-diff-files-view`,children:(0,B.jsx)(Qt,{changedByPath:u,expandedFolderPaths:t,rootPath:d,repoFiles:f,selectedPath:i,getFileBookmarkStatus:a,onOpenFile:o,onSetFileBookmarkStatus:s,onToggleFolder:c})})}function en({collapsed:e,editorControlsVisible:t,hideWhiteSpace:n,loadFullFiles:r,renderMarkdown:i,wordDiffs:a,wordWrap:o,onClose:s,onCopyGitApply:c,onRefresh:l,onToggleCollapsed:u,onToggleEditorControlsVisible:d,onToggleHideWhiteSpace:f,onToggleLoadFullFiles:p,onToggleRenderMarkdown:m,onToggleWordDiffs:ee,onToggleWordWrap:h}){return(0,B.jsxs)(`div`,{className:`workspace-diff-options-menu`,role:`menu`,children:[(0,B.jsx)(q,{icon:(0,B.jsx)(E,{size:14}),label:`Refresh`,onClick:l,onClose:s}),(0,B.jsx)(q,{checked:o,icon:(0,B.jsx)(ie,{size:14}),label:`Enable word wrap`,onClick:h,onClose:s}),(0,B.jsx)(q,{checked:e,icon:(0,B.jsx)(tt,{size:14}),label:`Collapse all diffs`,onClick:u,onClose:s}),(0,B.jsx)(`div`,{className:`workspace-diff-menu-divider`}),(0,B.jsx)(q,{checked:t,icon:(0,B.jsx)(it,{size:14}),label:`Show editor controls`,onClick:d,onClose:s}),(0,B.jsx)(q,{checked:i,icon:(0,B.jsx)(M,{size:14}),label:`Render Markdown`,onClick:m,onClose:s}),(0,B.jsx)(q,{checked:!r,icon:(0,B.jsx)(I,{size:14}),label:`Show diffs first`,onClick:p,onClose:s}),(0,B.jsx)(q,{checked:a,icon:(0,B.jsx)(et,{size:14}),label:`Enable word diffs`,onClick:ee,onClose:s}),(0,B.jsx)(q,{checked:n,icon:(0,B.jsx)(rt,{size:14}),label:`Hide white space`,onClick:f,onClose:s}),(0,B.jsx)(q,{icon:(0,B.jsx)(te,{size:14}),label:`Copy git apply command`,onClick:c,onClose:s})]})}function q({checked:e,icon:t,label:n,onClick:r,onClose:i}){return(0,B.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{r?.(),i()},children:[t,(0,B.jsx)(`span`,{children:n}),e&&(0,B.jsx)(He,{size:14})]})}function tn({addMenuOpen:e,expanded:t,filteredFiles:n,dirtyFilePaths:r,openFiles:i,goalDetailsAvailable:a,searchOpen:o,searchQuery:s,selectedPath:c,sideChatTabs:l=[],summaryAvailable:u,sourceStatus:d,sourceSwitcher:f,visibleTab:p,toolbarActions:m,additionalTabs:ee,tabOrder:h=[],filesTabOpen:g=!0,onCloseFilesTab:_,overviewTabs:te=[],outputsLabel:ne=`Training`,activeOverviewId:re,onNewOverview:y,onSelectOverview:b,onCloseOverview:x,getFileBookmarkStatus:ie,onCloseFileTab:ae,onCloseSideChat:oe,onCloseSearch:S,onOpenFile:se,onOpenBrowser:C,onOpenSearch:ce,onOpenSideChat:le,onSearchQueryChange:ue,onSetFileBookmarkStatus:de,onSelectFile:fe,onSelectFiles:pe,onSelectOutputs:me,onSelectGoal:he,onSelectSummary:ge,onSelectSideChat:_e,onToggleAddMenu:ve,onToggleExpanded:ye}){let be=(0,z.useRef)(null),T=(0,z.useRef)(null);(0,z.useEffect)(()=>{T.current?.querySelector(`button[role="tab"][aria-selected="true"]`)?.scrollIntoView({block:`nearest`,inline:`nearest`})},[re,i.length,c,p]),(0,z.useEffect)(()=>{if(!e&&!o)return;function t(){e&&ve(),o&&S()}function n(e){be.current?.contains(e.target)||t()}function r(e){e.key===`Escape`&&t()}return document.addEventListener(`pointerdown`,n),document.addEventListener(`keydown`,r),()=>{document.removeEventListener(`pointerdown`,n),document.removeEventListener(`keydown`,r)}},[e,S,ve,o]);function E(e){e.key===`Escape`?S():e.key===`Enter`&&(n[0]||s.trim())&&se(n[0]||s.trim())}function Te(e){if(![`ArrowRight`,`ArrowLeft`,`Home`,`End`].includes(e.key))return;let t=e.target;if(!(t instanceof HTMLButtonElement)||t.getAttribute(`role`)!==`tab`)return;let n=Array.from(e.currentTarget.querySelectorAll(`button[role="tab"]`)),r=n.indexOf(t);if(r<0||n.length===0)return;e.preventDefault();let i=n[ze(r,n.length,e.key)];if(!i)return;i.focus(),i.click();let a=i.id;a&&window.requestAnimationFrame(()=>document.getElementById(a)?.focus())}let D=[...te.map(e=>(0,B.jsxs)(`div`,{className:`workspace-diff-tab file ${p===`outputs`&&re===e?`active`:``}`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`workspace-diff-tab-main`,role:`tab`,"aria-selected":p===`outputs`&&re===e,tabIndex:p===`outputs`&&re===e?0:-1,onClick:()=>b?.(e),children:[(0,B.jsx)(I,{className:`workspace-diff-tab-icon`,size:14}),(0,B.jsx)(`span`,{children:e===-2?`Agents`:e===-1?ne:`New tab`})]}),(0,B.jsx)(`button`,{type:`button`,className:`workspace-diff-tab-close`,"aria-label":e===-2?`Close Agents`:e===-1?`Close ${ne}`:`Close new tab`,onClick:()=>x?.(e),children:(0,B.jsx)(Ee,{size:12})})]},`overview-${e}`)),a?(0,B.jsxs)(`button`,{type:`button`,className:`workspace-diff-tab ${p===`goal`?`active`:``}`,role:`tab`,"aria-selected":p===`goal`,onClick:he,children:[(0,B.jsx)(I,{size:14}),(0,B.jsx)(`span`,{children:`Goal`})]},`goal`):null,u&&ge?(0,B.jsxs)(`button`,{type:`button`,className:`workspace-diff-tab ${p===`summary`?`active`:``}`,role:`tab`,"aria-selected":p===`summary`,onClick:ge,children:[(0,B.jsx)(xe,{size:14}),(0,B.jsx)(`span`,{children:`Summary`})]},`summary`):null,g?(0,B.jsxs)(`div`,{className:`workspace-diff-tab file ${p===`files`?`active`:``}`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`workspace-diff-tab-main`,role:`tab`,id:`right-sidebar-files-tab`,"aria-controls":`right-sidebar-files-panel`,"aria-selected":p===`files`,tabIndex:p===`files`?0:-1,onClick:pe,children:[(0,B.jsx)(w,{className:`workspace-diff-tab-icon`,size:14}),(0,B.jsx)(`span`,{children:`Files`})]}),_?(0,B.jsx)(`button`,{type:`button`,className:`workspace-diff-tab-close`,"aria-label":`Close files tab`,onClick:_,children:(0,B.jsx)(Ee,{size:12})}):null]},`files`):null,...i.map(e=>(0,B.jsxs)(`div`,{className:`workspace-diff-tab file ${p===`file`&&c===e.path?`active`:``}`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`workspace-diff-tab-main`,role:`tab`,"aria-selected":p===`file`&&c===e.path,title:e.path,onClick:()=>fe(e.path),children:[(0,B.jsx)(I,{className:`workspace-diff-tab-icon`,size:13}),r.has(e.path)&&(0,B.jsx)(`span`,{className:`workspace-diff-tab-dirty`,"aria-hidden":`true`}),(0,B.jsx)(`span`,{children:L(e.path)})]}),de?(0,B.jsx)(Zt,{className:`workspace-diff-tab-bookmark-actions`,currentStatus:ie?.(e.path)??null,onSetStatus:t=>de(e.path,t)}):null,(0,B.jsx)(`button`,{type:`button`,className:`workspace-diff-tab-close`,title:`Close ${e.path}`,onClick:t=>ae(e.path,t),children:(0,B.jsx)(Ee,{size:12})})]},e.path)),...l.map(e=>(0,B.jsxs)(`div`,{className:`workspace-diff-tab right-chat-tab`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`workspace-diff-tab-main`,role:`tab`,id:`right-chat-tab-${e.id}`,"aria-controls":`right-chat-panel-${e.id}`,"aria-selected":!1,tabIndex:-1,title:e.title,onClick:()=>_e?.(e.id),children:[e.running?(0,B.jsx)(`span`,{className:`right-chat-status-dot`,"aria-label":`Running`}):null,(0,B.jsx)(`span`,{children:e.title})]}),oe?(0,B.jsx)(`button`,{type:`button`,className:`workspace-diff-tab-close`,title:`Close ${e.title}`,"aria-label":`Close ${e.title}`,onClick:t=>{t.stopPropagation(),oe(e.id)},children:(0,B.jsx)(Ee,{size:12})}):null]},e.id))].filter(e=>e!==null),De=new Map(h.map((e,t)=>[e,t]));return D.sort((e,t)=>(De.get(String(e.key))??h.length)-(De.get(String(t.key))??h.length)),(0,B.jsxs)(`div`,{className:`workspace-diff-topbar`,children:[(0,B.jsxs)(`div`,{className:`workspace-diff-tabs`,role:`tablist`,"aria-label":`Right sidebar views`,ref:T,onKeyDown:Te,children:[D,ee]}),(0,B.jsxs)(`div`,{className:`workspace-diff-add-anchor`,ref:be,children:[(0,B.jsx)(`button`,{type:`button`,className:`workspace-diff-add-tab ${!y&&(e||o)?`active`:``}`,title:`Add`,"aria-label":y?`New tab`:`Add to right sidebar`,onClick:y??ve,children:(0,B.jsx)(we,{size:15})}),e&&(0,B.jsxs)(`div`,{className:`workspace-diff-add-menu`,role:`menu`,children:[me?(0,B.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:me,children:[(0,B.jsx)(I,{size:14}),(0,B.jsx)(`span`,{children:`Training`}),(0,B.jsx)(`kbd`,{})]}):null,le?(0,B.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:le,children:[(0,B.jsx)(Ce,{size:14}),(0,B.jsx)(`span`,{children:`New task`}),(0,B.jsx)(`kbd`,{})]}):null,(0,B.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:pe,children:[(0,B.jsx)(w,{size:14}),(0,B.jsx)(`span`,{children:`Files`}),(0,B.jsx)(`kbd`,{})]}),u&&ge?(0,B.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:ge,children:[(0,B.jsx)(xe,{size:14}),(0,B.jsx)(`span`,{children:`Summary`}),(0,B.jsx)(`kbd`,{})]}):null,(0,B.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:ce,children:[(0,B.jsx)(Be,{size:14}),(0,B.jsx)(`span`,{children:`Open file`}),(0,B.jsx)(`kbd`,{children:`Ctrl+P`})]}),C?(0,B.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:C,children:[(0,B.jsx)(j,{size:14}),(0,B.jsx)(`span`,{children:`Browser`}),(0,B.jsx)(`kbd`,{children:`Ctrl+I`})]}):null]}),o&&(0,B.jsxs)(`div`,{className:`workspace-file-search-popover`,children:[(0,B.jsx)(`input`,{autoFocus:!0,placeholder:`Search files`,value:s,onChange:e=>ue(e.target.value),onKeyDown:E}),(0,B.jsx)(`span`,{children:`Files`}),(0,B.jsx)(`div`,{className:`workspace-file-search-results`,children:n.length===0?(0,B.jsx)(`small`,{children:`Type to search for files`}):n.map(e=>(0,B.jsx)(`button`,{type:`button`,onClick:()=>se(e),children:e},e))})]})]}),p!==`outputs`&&(f||d)?(0,B.jsxs)(`div`,{className:`workspace-diff-source-bar`,"aria-label":`Workspace source`,children:[f?(0,B.jsx)(`div`,{className:`workspace-diff-source-toggle`,role:`group`,"aria-label":`File source`,children:f.options.map(e=>(0,B.jsx)(`button`,{type:`button`,className:f.value===e.value?`active`:``,"aria-pressed":f.value===e.value,onClick:()=>f.onChange(e.value),children:e.label},e.value))}):null,d?(0,B.jsx)(`span`,{className:`workspace-diff-source-status ${d.tone}`,children:d.label}):null]}):null,m,(0,B.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:t?`Restore files panel`:`Expand files panel`,"aria-label":t?`Restore files panel`:`Expand files panel`,onClick:ye,children:t?(0,B.jsx)(v,{size:14}):(0,B.jsx)(Se,{size:14})})]})}function nn({inline:e=!1,canCheckActiveFile:t,canSaveActiveFile:n,collapsed:r,editorControlsVisible:i,editorDiagnosticStatus:a,editorDiagnosticsChecking:o,hideWhiteSpace:s,loadFullFiles:c,menuOpen:l,renderMarkdown:u,showEditorCommandBar:d,showRenderMarkdownToggle:f,splitView:p,wordDiffs:m,wordWrap:ee,onCopyGitApply:h,onEditorCheck:g,onEditorRedo:_,onEditorSave:te,onEditorUndo:ne,onRefresh:re,onToggleCollapsed:v,onToggleEditorControlsVisible:y,onToggleHideWhiteSpace:b,onToggleLoadFullFiles:x,onToggleMenu:ie,onToggleRenderMarkdown:ae,onToggleSplitView:oe,onToggleWordDiffs:S,onToggleWordWrap:se}){return(0,B.jsx)(`div`,{className:`workspace-diff-toolbar ${e?`inline`:``}`,children:(0,B.jsxs)(`div`,{className:`workspace-diff-toolbar-actions`,children:[(0,B.jsxs)(`div`,{className:`workspace-diff-menu-anchor`,children:[(0,B.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Diff options`,"aria-haspopup":`menu`,"aria-expanded":l,onClick:()=>ie(),children:(0,B.jsx)(Ke,{size:15})}),l&&(0,B.jsx)(en,{collapsed:r,editorControlsVisible:i,hideWhiteSpace:s,loadFullFiles:c,renderMarkdown:u,wordDiffs:m,wordWrap:ee,onClose:()=>ie(!1),onCopyGitApply:h,onRefresh:re,onToggleCollapsed:v,onToggleEditorControlsVisible:y,onToggleHideWhiteSpace:b,onToggleLoadFullFiles:x,onToggleRenderMarkdown:ae,onToggleWordDiffs:S,onToggleWordWrap:se})]}),d&&(0,B.jsxs)(`div`,{className:`workspace-editor-command-bar`,"aria-label":`Editor controls`,children:[(0,B.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Save file`,"aria-label":`Save file`,disabled:!n,onClick:te,children:(0,B.jsx)(Te,{size:14})}),(0,B.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Undo`,"aria-label":`Undo`,onClick:ne,children:(0,B.jsx)(st,{size:14})}),(0,B.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Redo`,"aria-label":`Redo`,onClick:_,children:(0,B.jsx)(ot,{size:14})}),(0,B.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Check file`,"aria-label":`Check file`,disabled:!t,onClick:g,children:o?(0,B.jsx)(T,{className:`spinning`,size:14}):(0,B.jsx)(P,{size:14})}),a&&(0,B.jsxs)(`span`,{className:`workspace-editor-diagnostic-chip ${a.severity}`,children:[a.severity===`error`||a.severity===`warning`||a.severity===`unavailable`?(0,B.jsx)(Ge,{size:13}):(0,B.jsx)(P,{size:13}),(0,B.jsx)(`span`,{children:a.label})]})]}),f&&(0,B.jsx)(`button`,{type:`button`,className:`diff-icon-button ${u?`active`:``}`,title:u?`Show Markdown source`:`Render Markdown`,"aria-label":u?`Show Markdown source`:`Render Markdown`,"aria-pressed":u,onClick:ae,children:(0,B.jsx)(M,{size:14})}),(0,B.jsx)(`button`,{type:`button`,className:`diff-icon-button ${p?`active`:``}`,title:p?`Show unified diff`:`Show split diff`,"aria-label":p?`Show unified diff`:`Show split diff`,"aria-pressed":p,onClick:oe,children:(0,B.jsx)(nt,{size:14})})]})})}var rn=class{pending=new Map;cancelled=new Set;receive(e,t){let n=t?.loadId;if(n===void 0)return`open`;let r=this.pending.get(e);return t?.loading?(r!==void 0&&r!==n&&this.cancelled.add(r),this.pending.set(e,n),`open`):this.cancelled.delete(n)||r!==void 0&&r!==n?`ignore`:(this.pending.delete(e),r===void 0?`open`:`complete`)}close(e){let t=this.pending.get(e);t!==void 0&&this.cancelled.add(t),this.pending.delete(e)}retain(e){for(let t of this.pending.keys())e.has(t)||this.close(t)}};function an({connection:e,workspaceId:t,sandboxId:n,file:r,dirty:i,onReload:o}){let s=S(r.path)||t,c=D(),[l,u]=(0,z.useState)(!1),[d,f]=(0,z.useState)(!1),p=(0,z.useRef)(!0);(0,z.useEffect)(()=>(p.current=!0,()=>{p.current=!1}),[]);let[m,ee]=(0,z.useState)(r.readVersion),g=(0,z.useRef)(null),_=a({queryKey:[`open-file-version`,h(e),n??s,r.path],enabled:!!(e&&(n||s)),queryFn:async()=>{if(!n)return k.workspaceFileVersion(e,s,r.path);let t=r.path.includes(`/`)?r.path.slice(0,r.path.lastIndexOf(`/`))||`/`:`.`,{files:i}=await k.sandboxFiles(e,n,{path:t,recursive:!1}),a=i.find(e=>e.path===r.path||e.path.split(`/`).pop()===r.path.split(`/`).pop());if(!a)return{exists:!1,revision:null};let o=`${a.sizeBytes}:${a.updatedAt}`;if(r.readStamp===o)return{exists:!0,revision:r.readVersion??null};if(g.current?.stamp===o)return{exists:!0,revision:g.current.revision??null};let c=await de(e,n,r.path);return g.current={stamp:o,revision:c.readVersion},{exists:!0,revision:c.readVersion??null}},refetchInterval:5e3,refetchOnWindowFocus:!0}),te=_.refetch;(0,z.useEffect)(()=>{let t=!1;return f(!1),(async()=>{let i=r.contentEncoding===`base64`&&r.content?await ye(r.content):r.readVersion;t||(ee(i),e&&(n||s)&&await te(),t||f(!0))})().catch(()=>{t||f(!0)}),()=>{t=!0}},[te,e,r.content,r.contentEncoding,r.readVersion,n,s]),(0,z.useEffect)(()=>{m===void 0&&!r.content&&_.data&&ee(_.data.revision)},[m,r.content,_.data]);let ne=d&&m!==void 0&&!_.isError&&_.data?.exists&&m!==_.data.revision;async function re(){if(e&&(n||s)&&!l&&(!i||window.confirm(`Discard unsaved edits and refresh this file from disk?`))){u(!0);try{let t=await _.refetch();if(t.error)throw t.error;if(!n&&Fe(r.path)){let n=/^(?:[~/\\]|[A-Za-z]:)/.test(r.path)?await k.signLocalImageUrl(e,{path:r.path}):await k.signWorkspaceImageUrl(e,{appId:s,path:r.path}),i=new URL(n.url);if(i.searchParams.set(`refresh`,String(Date.now())),!p.current)return;o({...r,readVersion:t.data?.revision},i.href)}else{let i=n?await de(e,n,r.path):await k.workspaceFile(e,s,r.path);if(!p.current)return;o(i,Fe(r.path)&&i.contentEncoding===`base64`&&i.content?`data:image/${/\.jpe?g$/i.test(r.path)?`jpeg`:r.path.split(`.`).pop()};base64,${i.content}`:void 0),ee(i.readVersion??t.data?.revision)}_.refetch()}catch(e){p.current&&c?.(e instanceof Error?e.message:`Could not refresh file.`,`error`)}finally{p.current&&u(!1)}}}return!ne&&!l?null:(0,B.jsxs)(`button`,{type:`button`,className:`workspace-file-refresh`,disabled:l||!e||!n&&!s,onClick:()=>void re(),"aria-label":`Reload updated file`,title:ne?`The file changed. Reload to show the latest version.`:`Reload this file from disk`,children:[(0,B.jsx)(E,{size:14,className:l?`spinning`:void 0}),(0,B.jsx)(`span`,{children:l?`Reloading…`:`Reload`})]})}var on={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 sn(e){let t=e.split(`/`).pop()?.toLowerCase()??``;return t===`dockerfile`?`shell`:t===`readme`||t===`readme.md`?`markdown`:on[t.includes(`.`)?t.split(`.`).pop()??``:``]??`text`}function cn(e,t){return e?t===`markdown`?ln(e):t===`json`?J(e,/("(?:\\.|[^"\\])*"(?=\s*:)|"(?:\\.|[^"\\])*"|[-]?\b\d+(?:\.\d+)?\b|\btrue\b|\bfalse\b|\bnull\b|[{}[\]:,])/g):t===`css`?J(e,/(\/\*.*?\*\/|#[\da-fA-F]{3,8}\b|--[\w-]+|[.#]?[\w-]+(?=\s*:)|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b\d+(?:\.\d+)?(?:px|rem|em|%|vh|vw)?\b|[{}():;,])/g):t===`html`?J(e,/(<!--.*?-->|<\/?[\w-]+|[\w:-]+(?==)|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|[<>/=])/g):t===`shell`?J(e,/(#.*$|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b(?:cd|cp|export|git|npm|pnpm|bun|yarn|rm|mkdir|test|if|then|fi|for|do|done|echo)\b|\$[\w_]+|&&|\|\||[|&;=])/g):t===`python`?J(e,/(#.*$|"""[\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):J(e,/(\/\/.*$|\/\*.*?\*\/|`(?:\\.|[^`\\])*`|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\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 ln(e){return/^\s{0,3}#{1,6}\s/.test(e)?[{text:e,kind:`keyword`}]:/^\s*[-*+]\s/.test(e)?[{text:e,kind:`property`}]:J(e,/(`[^`]+`|\*\*[^*]+\*\*|\[[^\]]+\]\([^)]+\)|https?:\/\/\S+)/g)}function un(e){return/^(\/\/|#|\/\*|<!--)/.test(e)?`comment`:/^["'`]/.test(e)?`string`:/^[-]?\d/.test(e)||/^#[\da-fA-F]{3,8}\b/.test(e)?`number`:/^\b[A-Z]/.test(e)?`type`:/^[.#]?[\w-]+$/.test(e)&&e.includes(`-`)?`property`:/^(?:[{}()[\],.:;<>/=+\-*&|!?%]+)$/.test(e)?`operator`:/^(?:--|\$)/.test(e)?`property`:`keyword`}function J(e,t){let n=[],r=0;for(let i of e.matchAll(t)){let t=i.index??0;t>r&&n.push({text:e.slice(r,t),kind:`plain`});let a=i[0];if(n.push({text:a,kind:un(a)}),r=t+a.length,/^(\/\/|#|<!--)/.test(a))break}return r<e.length&&n.push({text:e.slice(r),kind:`plain`}),n.length>0?n:[{text:e,kind:`plain`}]}function Y({language:e,text:t}){return(0,B.jsx)(B.Fragment,{children:cn(t,e).map((e,t)=>(0,B.jsx)(`span`,{className:`syntax-token ${e.kind}`,children:e.text},`${t}-${e.text}`))})}var dn=(0,z.lazy)(()=>i(()=>import(`./FilePagePreview-BRhhz99q.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53]))),X=(0,z.lazy)(()=>i(()=>import(`./WorkspacePdfPreview-vszQqFa4.js`),__vite__mapDeps([54,1,2,3,45,53])));function Z({path:e,contentBase64:t}){let n=L(e),r=(0,z.useMemo)(()=>{try{let n=atob(t.replace(/\s/g,``)),r=Uint8Array.from(n,e=>e.charCodeAt(0));return new Blob([r],{type:fn(e)})}catch{return null}},[t,e]),[i,a]=(0,z.useState)(null);(0,z.useEffect)(()=>{if(!r)return;let e=URL.createObjectURL(r);return a({blob:r,url:e}),()=>URL.revokeObjectURL(e)},[r]);let o=i?.blob===r?i.url:null;return r?o?(0,B.jsxs)(`div`,{className:`workspace-document-preview`,children:[(0,B.jsxs)(`div`,{className:`workspace-document-preview-card`,children:[(0,B.jsx)(R,{path:e}),(0,B.jsxs)(`div`,{className:`workspace-document-preview-actions`,children:[(0,B.jsx)(`span`,{children:/\.pdf$/i.test(e)?`PDF`:`Word`}),(0,B.jsx)(`a`,{href:o,download:n,"aria-label":`Download document`,title:`Download document`,children:(0,B.jsx)(N,{size:16,"aria-hidden":`true`})})]})]}),/\.docx$/i.test(e)?(0,B.jsx)(z.Suspense,{fallback:(0,B.jsx)(`div`,{role:`status`,children:`Loading document…`}),children:(0,B.jsx)(dn,{thumbnail:!1,file:{path:e,content:t,contentEncoding:`base64`,status:``,additions:0,deletions:0,patch:``}})}):(0,B.jsx)(z.Suspense,{fallback:(0,B.jsx)(`div`,{role:`status`,children:`Loading document…`}),children:(0,B.jsx)(X,{contentBase64:t})})]}):(0,B.jsx)(`div`,{className:`workspace-diff-code-empty`,role:`status`,children:`Loading document…`}):(0,B.jsx)(`div`,{className:`workspace-diff-code-empty`,children:`Document preview unavailable.`})}function fn(e){return/\.pdf$/i.test(e)?`application/pdf`:/\.docx$/i.test(e)?`application/vnd.openxmlformats-officedocument.wordprocessingml.document`:`application/msword`}var pn=`
3
+
4
+ [file truncated]`,mn=(0,z.lazy)(()=>i(()=>import(`./WorkspaceMonacoEditor-CC4sfOiU.js`).then(e=>e.t),__vite__mapDeps([55,1,2,3,56]))),hn=(0,z.lazy)(()=>i(()=>import(`./WorkspacePresentationPreview-DQTvhaRD.js`),__vite__mapDeps([57,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,58,59,60]))),gn=6,_n=18,vn=22,yn=160,bn=12;function xn({collapsed:e=!1,diagnostics:t=[],draftContent:n,editable:r=!1,editorRef:i,error:a,file:o,hideWhiteSpace:s=!1,headerActions:c,imageSrc:l,loading:u,loadFullFiles:d,onOpenImage:f,onSelectBreadcrumbPath:p,onDraftContentChange:m,onLspAction:ee,onSave:h,renderMarkdown:g,saveError:_,saving:te=!1,splitView:ne=!1,wordDiffs:re=!1,wordWrap:v,workspaceName:y,workspaceRootPath:b}){De(a,{prefix:`File preview`}),De(_,{prefix:`Save failed`});let x=o.contentEncoding===`base64`?o.content??``:n??o.content??``,ie=(0,z.useMemo)(()=>x.split(`
5
+ `).slice(0,800),[x]),ae=sn(o.path),oe=n!=null||o.content!=null,S=x.endsWith(pn),se=g&&oe&&je(o.path),C=A(o),ce=oe&&(o.contentEncoding===`base64`||Re(o.path))&&wn(x);return l?(0,B.jsxs)(`div`,{className:`workspace-file-preview`,children:[(0,B.jsxs)(`div`,{className:`workspace-diff-file-heading`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(R,{path:o.path,workspaceName:y,workspaceRootPath:b,onSelectPath:p}),(0,B.jsxs)(`span`,{className:`diff-addition`,children:[`+`,o.additions]}),(0,B.jsxs)(`span`,{className:`diff-deletion`,children:[`-`,o.deletions]})]}),c]}),(0,B.jsx)(`div`,{className:`workspace-file-image-stage`,children:(0,B.jsx)(`button`,{type:`button`,className:`workspace-file-image-button`,"aria-label":`Open image preview for ${o.path}`,onClick:f,children:(0,B.jsx)(`img`,{alt:o.path,decoding:`async`,src:l})})})]}):!d&&o.patch||!oe&&o.patch?ne?(0,B.jsx)(Cn,{collapsed:e,file:o,hideWhiteSpace:s,onSelectBreadcrumbPath:p,wordDiffs:re,wordWrap:v,headerActions:c,workspaceName:y,workspaceRootPath:b}):(0,B.jsx)(Sn,{collapsed:e,file:o,hideWhiteSpace:s,wordWrap:v,workspaceName:y,workspaceRootPath:b,onSelectBreadcrumbPath:p,headerActions:c}):(0,B.jsxs)(`div`,{className:`workspace-file-preview ${v?`wrap`:``} ${ce?`document-only`:``}`,children:[ce?null:(0,B.jsxs)(`div`,{className:`workspace-diff-file-heading`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(R,{path:o.path,workspaceName:y,workspaceRootPath:b,onSelectPath:p}),(0,B.jsxs)(`span`,{className:`diff-addition`,children:[`+`,o.additions]}),(0,B.jsxs)(`span`,{className:`diff-deletion`,children:[`-`,o.deletions]})]}),(0,B.jsxs)(`span`,{className:`workspace-file-heading-end`,children:[te?(0,B.jsx)(`span`,{className:`workspace-file-save-state`,children:`Saving`}):null,c]})]}),oe?se?(0,B.jsx)(`div`,{className:`workspace-markdown-preview`,children:(0,B.jsx)(ve,{content:x})}):C&&ce?(0,B.jsx)(z.Suspense,{fallback:(0,B.jsx)(`div`,{className:`workspace-diff-code-empty`,role:`status`,children:`Loading presentation…`}),children:(0,B.jsx)(hn,{path:o.path,contentBase64:x})}):ce?(0,B.jsx)(Z,{path:o.path,contentBase64:x}):r&&!S?(0,B.jsx)(z.Suspense,{fallback:(0,B.jsx)(`div`,{className:`workspace-diff-code-empty`,children:`Loading editor`}),children:(0,B.jsx)(mn,{diagnostics:t,filePath:o.path,onChange:e=>m?.(e),onLspAction:ee,onSave:()=>h?.(),ref:i,value:x,wordWrap:v})}):(0,B.jsx)(`div`,{className:`workspace-file-code`,children:ie.map((e,t)=>(0,B.jsxs)(`div`,{className:`workspace-file-code-row`,children:[(0,B.jsx)(`span`,{children:t+1}),(0,B.jsx)(`code`,{children:(0,B.jsx)(Y,{language:ae,text:e||` `})})]},`${t}-${e}`))}):(0,B.jsx)(`div`,{className:`workspace-diff-code-empty`,children:u?`Loading file content…`:`No file content available.`})]})}function Sn({collapsed:e=!1,file:t,hideWhiteSpace:n=!1,wordWrap:r,workspaceName:i,workspaceRootPath:a,onSelectBreadcrumbPath:o,headerActions:s}){let c=(0,z.useMemo)(()=>Dn(t.patch,n),[t.patch,n]),l=sn(t.path);return(0,B.jsxs)(`div`,{className:`workspace-diff-preview ${r?`wrap`:``}`,children:[(0,B.jsxs)(`div`,{className:`workspace-diff-file-heading`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(R,{path:t.path,workspaceName:i??null,workspaceRootPath:a,onSelectPath:o}),(0,B.jsxs)(`span`,{className:`diff-addition`,children:[`+`,t.additions]}),(0,B.jsxs)(`span`,{className:`diff-deletion`,children:[`-`,t.deletions]})]}),s]}),e?(0,B.jsx)(`div`,{className:`workspace-diff-code-empty`,children:`Diff collapsed`}):(0,B.jsx)(Tn,{ariaLabel:`${t.path} diff`,className:`workspace-diff-code`,emptyMessage:`No patch available.`,rows:c,renderRow:(e,t)=>e.kind===`spacer`?(0,B.jsx)(`div`,{className:`workspace-diff-spacer`,role:`row`,children:e.label},`${e.label}-${t}`):(0,B.jsxs)(`div`,{className:`workspace-diff-code-row ${e.kind}`,role:`row`,children:[(0,B.jsx)(`span`,{className:`workspace-diff-line-number`,role:`cell`,children:e.newLine||e.oldLine}),(0,B.jsx)(`code`,{role:`cell`,children:(0,B.jsx)(Y,{language:l,text:e.newContent||e.oldContent||` `})})]},`${e.oldLine}-${e.newLine}-${t}`),wordWrap:r})]})}function Cn({collapsed:e,file:t,hideWhiteSpace:n,wordDiffs:r,wordWrap:i,workspaceName:a,workspaceRootPath:o,onSelectBreadcrumbPath:s,headerActions:c}){let l=(0,z.useMemo)(()=>Dn(t.patch,n),[t.patch,n]),u=sn(t.path);return(0,B.jsxs)(`div`,{className:`workspace-diff-preview split ${i?`wrap`:``} ${r?`word-diffs`:``}`,children:[(0,B.jsxs)(`div`,{className:`workspace-diff-file-heading`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(R,{path:t.path,workspaceName:a,workspaceRootPath:o,onSelectPath:s}),(0,B.jsxs)(`span`,{className:`diff-addition`,children:[`+`,t.additions]}),(0,B.jsxs)(`span`,{className:`diff-deletion`,children:[`-`,t.deletions]})]}),(0,B.jsxs)(`span`,{className:`workspace-file-heading-end`,children:[c,(0,B.jsx)(be,{size:14})]})]}),e?(0,B.jsx)(`div`,{className:`workspace-diff-code-empty`,children:`Diff collapsed`}):(0,B.jsx)(Tn,{ariaLabel:`${t.path} split diff`,className:`workspace-split-code`,emptyMessage:`No patch available.`,rows:l,renderRow:(e,t)=>e.kind===`spacer`?(0,B.jsx)(`div`,{className:`workspace-diff-spacer split`,role:`row`,children:e.label},`${e.label}-${t}`):(0,B.jsxs)(`div`,{className:`workspace-split-row ${e.kind}`,role:`row`,children:[(0,B.jsx)(`span`,{className:`workspace-diff-line-number old`,role:`cell`,children:e.oldLine}),(0,B.jsx)(`code`,{className:`old`,role:`cell`,children:(0,B.jsx)(Y,{language:u,text:e.oldContent||` `})}),(0,B.jsx)(`span`,{className:`workspace-diff-line-number new`,role:`cell`,children:e.newLine}),(0,B.jsx)(`code`,{className:`new`,role:`cell`,children:(0,B.jsx)(Y,{language:u,text:e.newContent||` `})})]},`${e.oldLine}-${e.newLine}-${t}`),wordWrap:i})]})}function wn(e){return e.length>0&&/^[A-Za-z0-9+/=\s]+$/.test(e)}function Tn({ariaLabel:e,className:t,emptyMessage:n,rows:r,renderRow:i,wordWrap:a}){let o=!a&&r.length>yn,{endIndex:s,offsetTop:c,scrollRef:l,startIndex:u,totalHeight:d}=En(r.length,o);return r.length===0?(0,B.jsx)(`div`,{className:t,role:`table`,"aria-label":e,children:(0,B.jsx)(`div`,{className:`workspace-diff-code-empty`,children:n})}):o?(0,B.jsx)(`div`,{className:`${t} virtualized`,ref:l,role:`table`,"aria-label":e,"aria-rowcount":r.length,children:(0,B.jsx)(`div`,{className:`workspace-diff-virtual-spacer`,style:{height:d},children:(0,B.jsx)(`div`,{className:`workspace-diff-virtual-window`,style:{transform:`translateY(${c}px)`},children:r.slice(u,s).map((e,t)=>i(e,u+t))})})}):(0,B.jsx)(`div`,{className:t,role:`table`,"aria-label":e,children:r.map(i)})}function En(e,t){let n=(0,z.useRef)(null),[r,i]=(0,z.useState)({height:968,scrollTop:0}),a=(0,z.useCallback)(()=>{let e=n.current;e&&i({height:e.clientHeight||968,scrollTop:e.scrollTop})},[]);if((0,z.useEffect)(()=>{if(!t)return;let e=n.current;if(!e)return;a();let r=0,i=()=>{typeof window>`u`?a():(window.cancelAnimationFrame(r),r=window.requestAnimationFrame(a))};e.addEventListener(`scroll`,i,{passive:!0});let o=typeof ResizeObserver>`u`?null:new ResizeObserver(()=>i());return o?.observe(e),()=>{e.removeEventListener(`scroll`,i),o?.disconnect(),typeof window<`u`&&window.cancelAnimationFrame(r)}},[t,a]),!t)return{endIndex:e,offsetTop:0,scrollRef:n,startIndex:0,totalHeight:e*vn};let o=Math.ceil(r.height/vn),s=Math.max(0,Math.floor(r.scrollTop/vn)-bn);return{endIndex:Math.min(e,s+o+24),offsetTop:s*vn,scrollRef:n,startIndex:s,totalHeight:e*vn}}function Dn(e,t){if(!e.trim())return[];let n=[],r=0,i=0,a=null,o=null,s=!1,c=[];function l(){n.push(...On(c)),c=[]}function u(){s&&=(l(),a=r,o=i,!1)}for(let d of e.split(`
6
+ `)){let e=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(d);if(e){u();let t=Number(e[1]),c=Number(e[2]);if(a!==null&&o!==null){let e=Math.max(t-a,c-o,0);e>0&&n.push({kind:`spacer`,label:kn(e)})}r=t,i=c,s=!0;continue}if(d.startsWith(`diff --git`)||d.startsWith(`index `)||d.startsWith(`--- `)||d.startsWith(`+++ `)||!s||d.startsWith(`\\ No newline`))continue;let f=d.slice(1)||` `;if(t&&!f.trim())continue;if(d.startsWith(`+`)){l(),n.push({kind:`addition`,oldLine:``,newLine:String(i||``),oldContent:``,newContent:f}),i+=1;continue}if(d.startsWith(`-`)){l(),n.push({kind:`deletion`,oldLine:String(r||``),newLine:``,oldContent:f,newContent:``}),r+=1;continue}let p=d.startsWith(` `)?d.slice(1)||` `:d||` `;(!t||p.trim())&&(c.push({kind:`context`,oldLine:String(r||``),newLine:String(i||``),oldContent:p,newContent:p}),r+=1,i+=1)}return u(),n}function On(e){if(e.length<_n)return e;let t=e.length-12;return t<=0?e:[...e.slice(0,gn),{kind:`spacer`,label:kn(t)},...e.slice(-6)]}function kn(e){return`${e} unmodified ${e===1?`line`:`lines`}`}var An=`openpond.workspace.editorControlsVisible`;function jn(){try{return f.getItem(An)===`true`}catch{return!1}}function Mn(e){try{f.setItem(An,String(e))}catch{}}function Nn({activeDiagnostics:e,activeServers:t,editorDiagnosticsChecking:n,editorLspEnabled:r,showEditorCommandBar:i}){if(!i)return null;if(!r)return{label:`LSP off`,severity:`unavailable`};if(n)return{label:`Checking`,severity:`info`};let a=e.filter(e=>e.severity===`error`).length;if(a>0)return{label:`${a} error${a===1?``:`s`}`,severity:`error`};let o=e.filter(e=>e.severity===`warning`).length;if(o>0)return{label:`${o} warning${o===1?``:`s`}`,severity:`warning`};let s=e.length;if(s>0)return{label:`${s} note${s===1?``:`s`}`,severity:`info`};if(!t)return null;let c=t.find(e=>e.status!==`connected`);return c?{label:c.id===`none`?`No LSP`:`${c.id} unavailable`,severity:`unavailable`}:{label:`No issues`,severity:`none`}}var Pn=t({WorkspaceDiffPanel:()=>zn}),Fn=3e3,In=2e3,Ln=[],Rn=[];function zn({appId:e,workspaceId:t,workspaceKind:n,connection:r,runtimeEvents:i,diff:a,editorPreferences:o,loading:s,workspaceName:c,workspaceInitialized:l,workspaceError:u,expanded:d,fileRootPath:f,filesWithPreview:p=!1,openFileRequest:m,readOnly:ee=!1,sideChatTabs:h,sourceSwitcher:g,tabRequest:_,renderOutputs:te,outputsLabel:ne,additionalTabs:re,viewState:v,onRefresh:y,onResizeStart:b,onToggleExpanded:x,onOpenBrowser:ie,onOpenBrowserUrl:ae,onViewStateChange:oe,onCloseSideChat:S,onOpenSideChat:se,onSelectSideChat:C,goalDetails:ce,sandboxFileSource:le,trainingSummary:ue,sidebarFileBookmarks:de=[],sidebarFileSourceSessionId:fe=null,onSetSidebarFileStatus:pe}){return(0,B.jsx)(Gn,{appId:e,workspaceId:t,workspaceKind:n,connection:r,runtimeEvents:i??[],diff:a,editorPreferences:o??null,loading:s,workspaceName:c,workspaceInitialized:l,workspaceError:u,expanded:d,fileRootPath:f??null,filesWithPreview:p,openFileRequest:m,readOnly:ee,sideChatTabs:h??[],sourceSwitcher:g??null,tabRequest:_??null,additionalTabs:re,renderOutputs:te??null,outputsLabel:ne,viewState:v??null,onRefresh:y,onResizeStart:b,onToggleExpanded:x,onOpenBrowser:ie,onOpenBrowserUrl:ae,onViewStateChange:oe,onCloseSideChat:S,onOpenSideChat:se,onSelectSideChat:C,goalDetails:ce??null,sandboxFileSource:le??null,trainingSummary:ue??null,sidebarFileBookmarks:de,sidebarFileSourceSessionId:fe,onSetSidebarFileStatus:pe})}function Bn(e,t,n,r){return e&&t?.content!=null?{...e,content:t.content,contentType:t.contentType,contentEncoding:t.contentEncoding,readVersion:t.readVersion,readStamp:t.readStamp}:t&&!e&&Vn(t)?t:e&&Vn(e)?e:t&&Vn(t)?t:e??t??n??qe(r)}function Vn(e){return!!(e.patch||e.content!=null)}function Hn({changedFiles:e,checkpointStatus:t,dirty:n,error:r,loading:i,preservedReadback:a,sandboxMode:o,sourcePending:s}){if(s)return{label:`sandbox pending`,tone:`loading`};if(i)return{label:`refreshing`,tone:`loading`};if(o&&a&&t)return t;if(r)return{label:`status unavailable`,tone:`error`};if(o&&t?.tone===`error`||o&&t&&!n&&e===0)return t;if(n||e>0){let t=Math.max(1,e),n=t===1?`change`:`changes`;return{label:o?`${t} unpreserved ${n}`:`${t} local ${n}`,tone:`dirty`}}return{label:o?`sandbox clean`:`local clean`,tone:`clean`}}function Un(e,t){if(!t)return null;for(let n=e.length-1;n>=0;--n){let r=e[n];if(r?.name!==`workspace_action_result`)continue;let i=r.data&&typeof r.data==`object`&&!Array.isArray(r.data)?r.data:null,a=i?.sourcePreservation&&typeof i.sourcePreservation==`object`&&!Array.isArray(i.sourcePreservation)?i.sourcePreservation:null;if(a?.attempted===!0&&a.sandboxId===t)return a.ok===!0?a.preserved===!0?{label:`checkpoint saved`,tone:`clean`}:{label:`checkpoint clean`,tone:`clean`}:{label:`checkpoint failed`,tone:`error`}}return null}function Wn(e){let t=e.split(`/`).filter(Boolean);return t.map((e,n)=>t.slice(0,n+1).join(`/`))}function Gn({appId:e,workspaceId:t,workspaceKind:n,connection:r,runtimeEvents:i,diff:a,editorPreferences:o,loading:s,workspaceName:c,workspaceInitialized:l,workspaceError:u,expanded:d,fileRootPath:f,filesWithPreview:m,openFileRequest:h,readOnly:g,sideChatTabs:te,sourceSwitcher:re,tabRequest:v,renderOutputs:b,outputsLabel:ie,additionalTabs:oe,viewState:se,onRefresh:C,onResizeStart:fe,onToggleExpanded:pe,onOpenBrowser:me,onOpenBrowserUrl:he,onViewStateChange:ge,onCloseSideChat:ve,onOpenSideChat:ye,onSelectSideChat:be,goalDetails:w,sandboxFileSource:xe,trainingSummary:T,sidebarFileBookmarks:Se,sidebarFileSourceSessionId:Ce,onSetSidebarFileStatus:we}){let E=se??Ie(),[Te,Ee]=(0,z.useState)(!b||v?.tab===`files`||E.filesTabOpen),[D,O]=(0,z.useState)(E.overviewTabs),[Le,A]=(0,z.useState)(E.activeOverviewId),ze=(0,z.useRef)(Math.max(0,...E.overviewTabs)+1),[Be,j]=(0,z.useState)(E.tabOrder),[M,N]=(0,z.useState)(v?.tab??E.activeTab),[Ve,He]=(0,z.useState)(!1),[Ue,P]=(0,z.useState)(!1),[We,F]=(0,z.useState)(!1),[Ge,Ke]=(0,z.useState)(``),[I,Je]=(0,z.useState)(()=>[...E.openFilePaths]),[L,R]=(0,z.useState)(E.selectedPath),[Ye,Xe]=(0,z.useState)(!1),[Ze,et]=(0,z.useState)(!1),[tt,nt]=(0,z.useState)(!1),[rt,it]=(0,z.useState)(!0),[at,ot]=(0,z.useState)(jn);p(()=>ot(jn()));let[st,lt]=(0,z.useState)(!1),[ut,dt]=(0,z.useState)(!1),[ft,pt]=(0,z.useState)(!1),[mt,ht]=(0,z.useState)({}),gt=(0,z.useRef)(new rn),[_t,vt]=(0,z.useState)({}),[V,yt]=(0,z.useState)(()=>new Set),[bt,xt]=(0,z.useState)({}),[St,Ct]=(0,z.useState)({}),[wt,Tt]=(0,z.useState)(()=>new Set),[Et,Dt]=(0,z.useState)(null),[Ot,kt]=(0,z.useState)(!1),[H,At]=(0,z.useState)(null),[jt,Mt]=(0,z.useState)({}),[Nt,U]=(0,z.useState)({}),[Pt,It]=(0,z.useState)(null),[Lt,Rt]=(0,z.useState)(null),[zt,W]=(0,z.useState)(null),[Bt,Vt]=(0,z.useState)(null);De(u,{prefix:`Workspace`}),De(H,{prefix:`Sandbox files`});let[Ht,Ut]=(0,z.useState)(null),[Wt,Gt]=(0,z.useState)({}),[Kt,G]=(0,z.useState)(null),[Jt,Yt]=(0,z.useState)(null),[Xt,Qt]=(0,z.useState)(null),K=o??ee.editor,en=(0,z.useRef)(mt),q=(0,z.useRef)(Pe(E)),on=(0,z.useRef)(Pe(E)),sn=(0,z.useRef)(null),cn=(0,z.useRef)(C),ln=(0,z.useRef)(!1),un=(0,z.useRef)(null),J=(0,z.useRef)(0),Y=(0,z.useRef)(null),dn=(0,z.useRef)(null),X=xe?.sandboxId?.trim()||null,Z=!!xe,fn=!!T||Z&&!!X,pn=Z?`sandbox:${X??`pending`}`:`workspace:${e??`none`}`,mn=Z?!!X:!!(e||r&&h&&S(h.path)),hn=(0,z.useRef)(pn),gn=!!(w?.createRuntime||w?.goalRuntime||w?.subagentRuntime),_n=(0,z.useCallback)(async(e={})=>{if(Z){if(!r)Dt(null),At(`OpenPond App server is not connected.`);else if(!X)Dt(null),At(null);else{e.silent||kt(!0);try{let[e,t,n]=await Promise.allSettled([k.sandboxFiles(r,X,{recursive:!0,maxEntries:In}),k.sandboxGitStatus(r,X),k.sandboxGitDiff(r,X,{})]);if(e.status===`rejected`)throw e.reason;let i=ce(e.value.files),a=t.status===`fulfilled`?t.value.status:null,o=n.status===`fulfilled`?n.value.diff:null,s=le(o,a),c=s.reduce((e,t)=>e+t.additions,0),l=s.reduce((e,t)=>e+t.deletions,0);Dt({appId:X,repoPath:``,initialized:!0,dirty:a?!a.clean:s.length>0,filesChanged:s.length,additions:c,deletions:l,repoFiles:i,files:s,error:null,updatedAt:new Date().toISOString()}),At(null)}catch(e){Dt(null),At(e instanceof Error?e.message:String(e))}finally{e.silent||kt(!1)}}}},[r,X,Z]),vn=(0,z.useMemo)(()=>ae(i,X),[i,X]),yn=!!(Et&&((Et.files?.length??0)>0||(Et.repoFiles?.length??0)>0)),bn=Z&&!yn&&!!vn,Sn=Z?yn?Et:vn??Et:a,Cn=Sn?.repoPath??null,wn=(0,z.useMemo)(()=>Un(i,X),[i,X]),Tn=Sn?.files??Ln,En=Sn?.files??Ln,Dn=(0,z.useMemo)(()=>new Map(En.map(e=>[e.path,e])),[En]),On=(0,z.useMemo)(()=>new Map(Tn.map(e=>[e.path,e])),[Tn]),kn=Sn?.repoFiles??(Tn.length>0?Tn.map(e=>e.path):Rn),An=(0,z.useMemo)(()=>Tn.filter(e=>!Oe(e,kn)),[kn,Tn]),Pn=(0,z.useMemo)(()=>Xt&&!kn.includes(Xt)?[Xt,...kn]:kn,[kn,Xt]),zn=(0,z.useMemo)(()=>I.map(e=>Dn.get(e)??mt[e]??On.get(e)??qe(e)),[Dn,On,mt,I]),Vn=(0,z.useMemo)(()=>{let e={};for(let t of I){if(Fe(t)||Re(t))continue;let n=Bn(Dn.get(t),mt[t],On.get(t),t);n.content!=null&&n.contentEncoding!==`base64`&&(e[t]=n.content)}return e},[Dn,On,mt,I]),Gn=(0,z.useMemo)(()=>{let e=new Set;for(let[t,n]of Object.entries(St))n.content!==n.savedContent&&e.add(t);return e},[St]),Kn=(0,z.useMemo)(()=>{let e=Ge.trim().toLowerCase(),t=Pn;return e?t.filter(t=>t.toLowerCase().includes(e)):t},[Pn,Ge]),qn=(0,z.useMemo)(()=>({activeTab:M,openFilePaths:I,selectedPath:L,filesTabOpen:Te,overviewTabs:D,activeOverviewId:Le,tabOrder:Be}),[M,I,L,Te,D,Le,Be]);(0,z.useEffect)(()=>{en.current=mt},[mt]),(0,z.useEffect)(()=>{un.current=Kt},[Kt]),(0,z.useEffect)(()=>{Ct(e=>{let t=!1,n={...e},r=new Set(I),i=a?.updatedAt?Date.parse(a.updatedAt):null;for(let[e,i]of Object.entries(n))r.has(e)||i.content!==i.savedContent||(delete n[e],t=!0);for(let[e,r]of Object.entries(Vn)){let a=n[e];if(!a)n[e]={content:r,savedContent:r},t=!0;else if(a.content===a.savedContent&&a.savedContent!==r){if(a.savedAt&&(i===null||i<a.savedAt))continue;n[e]={content:r,savedContent:r},t=!0}}return t?n:e})},[a?.updatedAt,Vn,I]),(0,z.useEffect)(()=>{cn.current=C},[C]),(0,z.useEffect)(()=>{if(!se)return;let e=ke(se,Cn);V.size>0?q.current=e:Me(q.current,e)||(q.current=e,on.current=e,N(t=>v?.tab===`outputs`&&t===`outputs`?t:e.activeTab),Je(e.openFilePaths),R(e.selectedPath),Ee(!b||e.filesTabOpen),O(e.overviewTabs),A(e.activeOverviewId),j(e.tabOrder),ze.current=Math.max(0,...e.overviewTabs)+1)},[se,Cn,v?.tab,V]),(0,z.useEffect)(()=>{if(V.size>0||Me(on.current,qn))return;let e=Pe(qn);on.current=e,q.current=e,ge?.(e)},[qn,ge,V]),(0,z.useEffect)(()=>{g||Z||!r||!e||!l||a||u||ln.current||(ln.current=!0,Promise.resolve(cn.current({silent:!0})).catch(()=>{}).finally(()=>{ln.current=!1}))},[e,r,a,g,Z,u,l]),(0,z.useEffect)(()=>{if(hn.current!==pn){hn.current=pn,Y.current?.abort(Error(`lsp_diagnostics_source_changed`)),Y.current=null;let e=new Set([...V].filter(e=>S(e)&&_t[e]===null));Je(t=>t.filter(t=>e.has(t))),R(t=>t&&e.has(t)?t:null),ht(t=>Object.fromEntries(Object.entries(t).filter(([t])=>e.has(t)))),yt(e),vt(t=>Object.fromEntries(Object.entries(t).filter(([t])=>e.has(t)))),gt.current.retain(e),xt(t=>Object.fromEntries(Object.entries(t).filter(([t])=>e.has(t)))),Ct({}),Tt(new Set),Dt(null),At(null),kt(!1),Mt({}),U({}),It(null),Rt(t=>t&&e.has(t)?t:null),Vt(null),Ut(null),Gt({}),G(null),Yt(null),Qt(null)}return()=>{Y.current?.abort(Error(`lsp_diagnostics_unmounted`)),Y.current=null}},[pn]),(0,z.useEffect)(()=>{h&&sn.current!==h.id&&(h.file||mn)&&(sn.current=h.id,h.file?Zn(h.file,h.imageUrl,h.source,h):Xn(h.path,{source:h.source}))},[mn,h]),(0,z.useEffect)(()=>{if(!Z||(_n(),!r||!X))return;let e=!1;async function t(){if(!(e||ln.current)&&(typeof document>`u`||document.visibilityState!==`hidden`)){ln.current=!0;try{await _n({silent:!0})}finally{ln.current=!1}}}let n=window.setInterval(()=>{t()},Fn),i=()=>{t()};return window.addEventListener(`focus`,i),()=>{e=!0,window.clearInterval(n),window.removeEventListener(`focus`,i)}},[r,_n,X,Z]),(0,z.useEffect)(()=>{if(g||Z||!r||!e||!l)return;let t=!1;async function n(){if(!(t||ln.current)&&(typeof document>`u`||document.visibilityState!==`hidden`)){ln.current=!0;try{await cn.current({silent:!0})}catch{}finally{ln.current=!1}}}let i=window.setInterval(()=>{n()},Fn),a=()=>{n()};return window.addEventListener(`focus`,a),()=>{t=!0,window.clearInterval(i),window.removeEventListener(`focus`,a)}},[e,r,g,Z,l]),(0,z.useEffect)(()=>{if(Z||!r||!e||n===`local_project`){Qt(null);return}let t=!1;return k.workspaceTemplateConfig(r,e).then(e=>{t||Qt(e.exists?e.configPath??`openpond.config.json`:null)}).catch(()=>{t||Qt(null)}),()=>{t=!0}},[e,r,Z,n]),(0,z.useEffect)(()=>{!L||Pn.includes(L)||I.includes(L)||R(An[0]?.path??null)},[An,I,Pn,L]),(0,z.useEffect)(()=>{w?.active&&gn&&N(`goal`)},[w?.active,gn]),(0,z.useEffect)(()=>{if(v){if(v.tab===`files`&&mr(),v.tab===`outputs`){if(v.overview===`agents`)O(e=>e.includes(-2)?e:[...e,-2]),A(-2),j(e=>e.includes(`overview--2`)?e:[...e,`overview--2`]);else if(v.overview===`experiments`)O(e=>e.includes(-1)?e:[...e,-1]),A(-1),j(e=>e.includes(`overview--1`)?e:[...e,`overview--1`]);else if(v.overview===`new`){let e=D.find(e=>e>=0)??ze.current++;O(t=>t.includes(e)?t:[...t,e]),A(e),j(t=>t.includes(`overview-${e}`)?t:[...t,`overview-${e}`])}}N(v.tab)}},[v]),(0,z.useEffect)(()=>{!gn&&M===`goal`&&N(`files`)},[M,gn]),(0,z.useEffect)(()=>{!fn&&M===`summary`&&N(`files`)},[M,fn]);let Q=M===`file`||m&&M===`files`?L:null;(0,z.useEffect)(()=>{if(!r||!Q||V.has(Q))return;if(Fe(Q)){Vt(null),Rt(e=>e===Q?null:e);return}let t=Ht?.path===Q,n=$n(Q);if(g&&(n?.content!=null||n?.patch)||!t&&(n?.content!=null||n?.patch&&!tt)){Vt(null),Rt(e=>e===Q?null:e);return}let a=!1,o=en.current[Q];o?.content==null&&(tt||!o?.patch)&&Rt(Q),Vt(null);let s=e||S(Q);return(Z?X?de(r,X,Q,i):Promise.reject(Error(xe?.emptyMessage??`No sandbox filesystem is available.`)):s?k.workspaceFile(r,s,Q):Promise.reject(Error(`Workspace files are unavailable.`))).then(e=>{a||ht(t=>{let n=t[e.path];return n?.content===e.content&&n.contentType===e.contentType&&n.contentEncoding===e.contentEncoding&&n.patch===e.patch&&n.status===e.status?t:{...t,[e.path]:e}})}).catch(e=>{a||Vt(e instanceof Error?e.message:String(e))}).finally(()=>{a||(Rt(e=>e===Q?null:e),Ut(e=>e&&e.id===Ht?.id&&e.path===Q?null:e))}),()=>{a=!0}},[M,e,r,Ht,tt,g,i,xe?.emptyMessage,X,Z,Q,V]);function Jn(e){let t=M===`outputs`||b&&M===`files`&&!Te?`overview-${Le}`:null;t&&O(e=>e.filter(e=>e!==Le)),j(n=>n.includes(e)?t?n.filter(e=>e!==t):n:t&&n.includes(t)?n.map(n=>n===t?e:n):[...n,e])}function Yn(){if(D.some(e=>e>=0))A(D.filter(e=>e>=0).at(-1));else{let e=ze.current++;O([e]),A(e),j(t=>[...t,`overview-${e}`])}N(`outputs`)}function Xn(t,n){W(null);let i=Z?X:e;if(y(t)&&!n?.source&&r&&i){ue(r,i,t,Z?`sandbox`:`local`).then(he).catch(e=>W(e instanceof Error?e.message:`Could not open HTML preview.`));return}let a=Ne(t,Cn);a&&(gt.current.close(a),vt(e=>{if(!Object.hasOwn(e,a))return e;let t={...e};return delete t[a],t}),Jn(m?`files`:a),m&&Ee(!0),yt(e=>{if(!e.has(a))return e;let t=new Set(e);return t.delete(a),t}),ht(e=>{if(!(a in e))return e;let t={...e};return delete t[a],t}),xt(e=>{if(!(a in e))return e;let t={...e};return delete t[a],t}),Ut({id:Date.now(),path:a}),m||Je(e=>e.includes(a)?e:[...e,a]),R(a),N(m?`files`:`file`),!Z&&r&&e&&Fe(a)&&Yt(a),P(!1),F(!1),Ke(``))}function Zn(e,t,n=!1,i){if(y(e.path)&&e.content!=null&&!n&&r){_(r,e.path,e.content).then(he).catch(e=>W(e instanceof Error?e.message:`Could not open HTML preview.`));return}let a=S(e.path)?e.path:Ne(e.path,Cn);if(!a)return;let o=gt.current.receive(a,i);if(o===`ignore`)return;let s=o===`complete`;if(s&&!m&&!I.includes(a))return;s||(Jn(m?`files`:a),m&&Ee(!0)),i?.sandboxId!==void 0&&vt(e=>({...e,[a]:i.sandboxId}));let c={...e,path:a};ht(e=>i?.loading&&e[a]?.content!=null?e:{...e,[a]:c}),yt(e=>{let t=new Set(e);return t.add(a),t}),xt(e=>{if(!t){if(!(a in e))return e;let t={...e};return delete t[a],t}return e[a]===t?e:{...e,[a]:t}}),s?(L===a&&Vt(i?.error??null),Rt(e=>e===a?null:e)):(Ut(null),Vt(i?.error??null),Rt(i?.loading?a:null),m||Je(e=>e.includes(a)?e:[...e,a]),R(a),N(m?`files`:`file`),P(!1),F(!1),Ke(``))}let Qn=(0,z.useCallback)(()=>{ot(e=>{let t=!e;return Mn(t),t})},[]),$n=e=>Bn(Dn.get(e),mt[e],On.get(e),e),er=(0,z.useCallback)((e,t)=>{Ct(n=>{let r=n[e],i=r?.savedContent??Vn[e]??$n(e).content??``;return{...n,[e]:{content:t,savedContent:i,savedAt:r?.savedAt}}}),Gt(t=>{if(!(e in t))return t;let n={...t};return delete n[e],n})},[Dn,On,mt,Vn]),tr=(0,z.useCallback)(async(t,n={})=>{if(Z||!r||!e||Fe(t))return;let i=$n(t),a=n.content??St[t]?.content??i.content??void 0;if(a?.endsWith(`
7
+
8
+ [file truncated]`))return;let o=J.current+1;J.current=o,Y.current?.abort(Error(`lsp_diagnostics_superseded`));let s=new AbortController;Y.current=s,It(t);try{let i=await k.workspaceLspTouch(r,e,{path:t,content:a,waitForDiagnostics:n.waitForDiagnostics??!0},{signal:s.signal});if(o!==J.current)return;Mt(e=>({...e,[i.path]:i.diagnostics})),U(e=>({...e,[i.path]:i.servers}))}catch(e){if(s.signal.aborted||o!==J.current)return;let n=e instanceof Error?e.message:String(e);Mt(e=>({...e,[t]:[]})),U(e=>({...e,[t]:[{id:`lsp`,root:``,status:`error`,message:n}]}))}finally{Y.current===s&&(Y.current=null),!s.signal.aborted&&o===J.current&&It(e=>e===t?null:e)}},[e,r,Dn,On,St,mt,Z]),nr=(0,z.useCallback)(async t=>{if(Z||!r||!e)throw Error(`Workspace LSP is unavailable.`);return k.workspaceLspAction(r,e,t)},[e,r,Z]),rr=(0,z.useCallback)(async t=>{if(!r||!e&&!X||un.current===t)return;let n=St[t];if(!n||n.content===n.savedContent)return;let i=n.content,a=Date.now();un.current=t,G(t),Gt(e=>{if(!(t in e))return e;let n={...e};return delete n[t],n});try{let n=Z?await _e(r,X,t,i):await k.saveWorkspaceFile(r,e,{path:t,content:i});ht(e=>({...e,[n.path]:n})),Ct(e=>{let n=e[t];return n?{...e,[t]:{content:n.content,savedContent:i,savedAt:a}}:e}),K.languageServers!==`off`&&K.checkOnSave&&await tr(t,{content:i,waitForDiagnostics:!0}),Z?await _n({silent:!0}):await C({silent:!0})}catch(e){Gt(n=>({...n,[t]:e instanceof Error?e.message:String(e)}))}finally{un.current===t&&(un.current=null),G(e=>e===t?null:e)}},[K.checkOnSave,K.languageServers,e,r,St,C,tr,_n,X,Z]),ir=L?$n(L):null,ar=!!(L&&V.has(L)),or=L?St[L]?.content??ir?.content??null:null,sr=!(!ir?.patch||tt),cr=!(g||ar||M!==`file`||sr||!L||or==null||Fe(L)||Re(L)||ir?.contentEncoding===`base64`||rt&&je(L)||or.endsWith(`
9
+
10
+ [file truncated]`));(0,z.useEffect)(()=>{if(K.languageServers===`off`||!K.diagnosticsWhileEditing||!L||!cr||or==null)return;let e=window.setTimeout(()=>{tr(L,{content:or,waitForDiagnostics:!0})},700);return()=>window.clearTimeout(e)},[K.diagnosticsWhileEditing,K.languageServers,tr,or,cr,L]),(0,z.useEffect)(()=>{function e(e){(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`s`&&M===`file`&&L&&(e.preventDefault(),Gn.has(L)&&rr(L))}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[M,Gn,rr,L]);let lr=(0,z.useCallback)(()=>{L&&(dn.current?dn.current.save():rr(L))},[rr,L]),ur=(0,z.useCallback)(()=>{dn.current?.undo()},[]),dr=(0,z.useCallback)(()=>{dn.current?.redo()},[]),fr=(0,z.useCallback)(()=>{L&&K.languageServers!==`off`&&tr(L,{content:or??void 0,waitForDiagnostics:!0})},[K.languageServers,tr,or,L]);function pr(e,t){if(t.stopPropagation(),(!Gn.has(e)||window.confirm(`Discard unsaved changes to ${e}?`))&&(Gn.has(e)&&(Ct(t=>{if(!(e in t))return t;let n={...t};return delete n[e],n}),Gt(t=>{if(!(e in t))return t;let n={...t};return delete n[e],n})),gt.current.close(e),vt(t=>{if(!Object.hasOwn(t,e))return t;let n={...t};return delete n[e],n}),Je(t=>t.filter(t=>t!==e)),j(t=>t.filter(t=>t!==e)),V.has(e)&&ht(t=>{if(!(e in t))return t;let n={...t};return delete n[e],n}),xt(t=>{if(!(e in t))return t;let n={...t};return delete n[e],n}),yt(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n}),L===e)){let t=zn.findIndex(t=>t.path===e),n=zn[t+1]??zn[t-1]??null;R(n?.path??null),!n&&M===`file`&&(b?Yn():N(`files`))}}function mr(){Jn(`files`),Ee(!0),N(`files`),P(!1),F(!1)}function hr(e){Tt(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}function gr(e){Jn(`files`),Ee(!0),e&&Tt(t=>{let n=new Set(t);for(let t of Wn(e))n.add(t);return n}),N(`files`),P(!1),F(!1)}function _r(){let e=`git apply <<'PATCH'\n${An.map(e=>e.patch).filter(Boolean).join(`
11
+ `)}\nPATCH`;navigator.clipboard?.writeText(e)}let vr=An.length>0,yr=Pn.length>0,br=I.length>0,xr=gn||fn||vr||yr||br,$=M===`outputs`&&b?`outputs`:M===`goal`&&gn?`goal`:M===`summary`&&fn?`summary`:M===`file`&&L?`file`:b&&!Te?`outputs`:`files`;(0,z.useEffect)(()=>{if($!==`outputs`||D.length)return;let e=ze.current++;O([e]),A(e),j(t=>[...t,`overview-${e}`]),N(`outputs`)},[D.length,$]);let Sr=$===`files`?`No files to show`:`No local changes`,Cr=n===`local_project`&&!l&&!u,wr=Z?Ot:s,Tr=Z?H:u,Er=Hn({changedFiles:Sn?.filesChanged??An.length,checkpointStatus:wn,dirty:!!Sn?.dirty,error:Tr,loading:wr,preservedReadback:bn,sandboxMode:Z,sourcePending:Z&&!X}),Dr=wr?`Loading workspace files`:Tr?`Workspace files are unavailable`:Z&&!X?xe?.emptyMessage??`No sandbox filesystem is available.`:Cr?`Loading workspace files`:l?Sr:`No local files to show`,Or=L?bt[L]??null:null,kr=!Or&&!Z&&L&&Fe(L)?L:null,Ar=Jt?bt[Jt]??null:null,jr=!Ar&&!Z&&Jt&&Fe(Jt)?Jt:null,Mr=ne(r,e,kr),Nr=ne(r,e,jr),Pr=Or??Mr,Fr=Ar??Nr,Ir=$===`file`||m&&$===`files`?L:null,Lr=!!(Ir&&je(Ir)),Rr=L?jt[L]??[]:[],zr=L?Nt[L]??null:null,Br=!!(L&&Pt===L),Vr=at&&cr,Hr=!g&&!ar&&!Z&&K.languageServers!==`off`,Ur=(0,z.useMemo)(()=>Nn({activeDiagnostics:Rr,activeServers:zr,editorDiagnosticsChecking:Br,editorLspEnabled:Hr,showEditorCommandBar:Vr}),[Rr,zr,Br,Hr,Vr]),Wr=(0,z.useCallback)(async e=>{if(!r)throw Error(`OpenPond server connection is unavailable.`);await k.runSubagentLifecycleAction(r,e.runId,{action:e.action,reason:`User requested from Goal details.`}),await C({silent:!0})},[r,C]),Gr=Z?`sandbox`:n===`local_project`?`local`:null,Kr=(0,z.useMemo)(()=>{let e=new Map;if(!Gr)return e;for(let n of Se)n.workspaceKind===Gr&&n.workspaceId===(t??(Gr===`local`?S(n.path):null))&&e.set(n.path,n);return e},[Se,Gr,t]),qr=(0,z.useCallback)(e=>{try{return Kr.get(Qe(e))?.status??null}catch{return null}},[Kr]),Jr=(0,z.useCallback)((e,n)=>{let r=t??(Gr===`local`?S(e):null);if(!Gr||!r||!we)return;let i;try{i=Qe(e)}catch{return}let a=Kr.get(i),o=new Date().toISOString();we(a??{id:$e({workspaceKind:Gr,workspaceId:r,path:i}),workspaceKind:Gr,workspaceId:r,workspaceName:c??`Local files`,path:i,status:`pinned`,order:null,sourceSessionId:Ce,available:!0,createdAt:o,updatedAt:o},n)},[we,Kr,Ce,Gr,t,c]),Yr=!!(Gr&&we&&(t||Gr===`local`&&I.some(e=>S(e)))),Xr=L&&Yr&&!ar?(0,B.jsx)(Zt,{currentStatus:qr(L),onSetStatus:e=>Jr(L,e)}):null,Zr=L?(0,B.jsxs)(`div`,{className:`workspace-active-file-preview`,children:[(0,B.jsx)(an,{file:$n(L),connection:r,workspaceId:e,sandboxId:Object.hasOwn(_t,L)?_t[L]:Z?X:null,dirty:Gn.has(L),onReload:(e,t)=>{ht(t=>({...t,[L]:{...e,path:L}})),Ct(e=>{let t={...e};return delete t[L],t}),t&&xt(e=>({...e,[L]:t})),Vt(null),!Re(L)&&!Fe(L)&&nt(!0)}},`${pn}:${_t[L]??`local`}:${L}`),(0,B.jsx)(xn,{diagnostics:Hr?jt[L]??[]:[],draftContent:St[L]?.content,editorRef:dn,editable:cr&&!Pr,error:Bt,file:$n(L),collapsed:Ze,hideWhiteSpace:ut,headerActions:Xr,imageSrc:Pr,loading:Lt===L,loadFullFiles:tt,saveError:Wt[L]??null,saving:Kt===L,onOpenImage:()=>{Pr&&Yt(L)},onDraftContentChange:e=>er(L,e),onLspAction:Hr?nr:void 0,onSave:()=>void rr(L),onSelectBreadcrumbPath:gr,renderMarkdown:rt,splitView:ft,wordDiffs:st,wordWrap:Ye,workspaceName:c,workspaceRootPath:Cn})]}):null,Qr=($===`file`||m&&$===`files`)&&L&&!Re(L)&&!Fe(L)&&ir?.contentEncoding!==`base64`?(0,B.jsx)(nn,{inline:!0,canSaveActiveFile:!(g||ar||!L||!Gn.has(L)||Kt===L),canCheckActiveFile:Hr,collapsed:Ze,editorControlsVisible:at,editorDiagnosticStatus:Ur,editorDiagnosticsChecking:Br,hideWhiteSpace:ut,loadFullFiles:tt,menuOpen:Ve,renderMarkdown:rt,showEditorCommandBar:Vr,showRenderMarkdownToggle:Lr,splitView:ft,wordDiffs:st,wordWrap:Ye,onCopyGitApply:_r,onEditorCheck:fr,onEditorRedo:dr,onEditorSave:lr,onEditorUndo:ur,onRefresh:()=>void(Z?_n():C()),onToggleCollapsed:()=>et(e=>!e),onToggleEditorControlsVisible:Qn,onToggleHideWhiteSpace:()=>dt(e=>!e),onToggleLoadFullFiles:()=>nt(e=>!e),onToggleMenu:e=>He(t=>e??!t),onToggleRenderMarkdown:()=>it(e=>!e),onToggleSplitView:()=>pt(e=>!e),onToggleWordDiffs:()=>lt(e=>!e),onToggleWordWrap:()=>Xe(e=>!e)}):null;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`aside`,{className:`workspace-diff-panel ${$===`outputs`?`workspace-diff-overview`:``} ${d?`expanded`:``}`,id:`right-sidebar-files-panel`,role:`tabpanel`,"aria-label":`Workspace diffs`,children:[!d&&(0,B.jsx)(`div`,{className:`workspace-diff-resize-handle`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize diff panel`,onPointerDown:fe}),(0,B.jsx)(tn,{addMenuOpen:Ue,expanded:d,filteredFiles:Kn,openFiles:zn,dirtyFilePaths:Gn,goalDetailsAvailable:gn,searchOpen:We,searchQuery:Ge,selectedPath:L,sideChatTabs:te,summaryAvailable:fn,onSelectOutputs:b?()=>{O(e=>e.includes(-1)?e:[...e,-1]),A(-1),j(e=>e.includes(`overview--1`)?e:[...e,`overview--1`]),N(`outputs`),P(!1),F(!1)}:void 0,sourceStatus:Er,sourceSwitcher:re,visibleTab:$,additionalTabs:oe,toolbarActions:Qr,tabOrder:Be,filesTabOpen:Te,onCloseFilesTab:b?()=>{Ee(!1),j(e=>e.filter(e=>e!==`files`)),M===`files`&&Yn()}:void 0,overviewTabs:b?D:[],outputsLabel:ie,activeOverviewId:Le,onNewOverview:b?()=>{let e=ze.current++;O(t=>[...t,e]),j(t=>[...t,`overview-${e}`]),A(e),N(`outputs`),P(!1),F(!1)}:void 0,onSelectOverview:e=>{A(e),N(`outputs`)},onCloseOverview:e=>{let t=D.filter(t=>t!==e);if(O(t),j(t=>t.filter(t=>t!==`overview-${e}`)),e===Le&&M===`outputs`){if(t.length)A(t[t.length-1]);else if(b){let e=ze.current++;O([e]),A(e),N(`outputs`),j(t=>[...t,`overview-${e}`])}else if(zn.length&&L)N(`file`);else if(Te)N(`files`);else{let e=ze.current++;O([e]),j(t=>[...t,`overview-${e}`]),A(e)}}},getFileBookmarkStatus:Yr?qr:void 0,onCloseFileTab:pr,onCloseSideChat:ve,onCloseSearch:()=>F(!1),onOpenFile:Xn,onOpenBrowser:me?()=>{P(!1),F(!1),me()}:void 0,onOpenSearch:()=>{P(!1),F(!0)},onOpenSideChat:ye?()=>{P(!1),F(!1),ye()}:void 0,onSearchQueryChange:Ke,onSetFileBookmarkStatus:Yr?Jr:void 0,onSelectFile:e=>{R(e),N(`file`)},onSelectFiles:mr,onSelectGoal:()=>N(`goal`),onSelectSummary:()=>{N(`summary`),P(!1),F(!1)},onSelectSideChat:be,onToggleAddMenu:()=>{P(e=>!e),F(!1)},onToggleExpanded:pe}),zt&&(0,B.jsx)(Ae,{error:zt}),b?D.map(e=>(0,B.jsx)(`div`,{className:`workspace-diff-tool-view`,hidden:$!==`outputs`||Le!==e,inert:$!==`outputs`||Le!==e,children:b(()=>{F(!0),P(!1)},e)},e)):null,$===`outputs`&&b?null:$===`goal`&&gn?(0,B.jsx)(ct,{createRuntime:w?.createRuntime??null,goalRuntime:w?.goalRuntime??null,subagentRuntime:w?.subagentRuntime??null,onRunSubagentLifecycleAction:r?Wr:void 0}):$===`summary`&&fn?T?(0,B.jsx)(qt,{summary:T}):(0,B.jsx)(Ft,{sandboxId:X,connection:r}):xr?(0,B.jsxs)(B.Fragment,{children:[$===`files`&&(m?(0,B.jsxs)(`div`,{className:`workspace-diff-files-preview-layout`,children:[(0,B.jsx)($t,{diff:Sn,expandedFolderPaths:wt,rootPath:f,repoFiles:Pn,selectedPath:L,getFileBookmarkStatus:Yr?qr:void 0,onOpenFile:Xn,onSetFileBookmarkStatus:Yr?Jr:void 0,onToggleFolder:hr}),Zr??(0,B.jsx)(`div`,{className:`workspace-diff-files-preview-empty`,children:`Select a file to review its changes.`})]}):(0,B.jsx)($t,{diff:Sn,expandedFolderPaths:wt,rootPath:f,repoFiles:Pn,selectedPath:L,getFileBookmarkStatus:Yr?qr:void 0,onOpenFile:Xn,onSetFileBookmarkStatus:Yr?Jr:void 0,onToggleFolder:hr})),$===`file`&&L&&Zr]}):(0,B.jsx)(`div`,{className:`workspace-diff-empty`,children:(0,B.jsx)(`span`,{children:Dr})})]}),(0,B.jsx)(x,{open:!!Fr,src:Fr,title:Jt??``,onClose:()=>Yt(null)})]})}export{Pn as n,nt as r,zn as t};
@@ -0,0 +1,35 @@
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-B6XX_0h3.js";import{S as r,a as i,d as a,g as o,m as s,o as c,p as l,r as u,v as d}from"./schemas-Brv9Vmnk.js";import{t as f}from"./icons-Bk2b68aC.js";import{t as p}from"./chevron-down-DX1hzujj.js";import{t as m}from"./external-link-H1629UU6.js";import{t as h}from"./git-commit-horizontal-DFUfuVvF.js";import{t as g}from"./info-C8b_tafZ.js";import{t as _}from"./monitor-BtxlcLuI.js";import{t as v}from"./play-CHXXdkuO.js";import{t as y}from"./refresh-cw-D61-Ozk3.js";import{t as b}from"./square-BE_4JMR3.js";import{t as x}from"./square-terminal-Djpzo2Qs.js";import{t as S}from"./upload-C6ug8RD-.js";import{t as C}from"./x-Jx2jlP9u.js";import{r as w}from"./AppToastContext-EpiT1dHs.js";import{r as T}from"./organization-types-PP-yuR2J.js";import{n as E}from"./ui-theme.generated-D-mc26qt.js";import{Jt as D,Tn as O,Xt as ee,a as k,cn as A,dn as te,gn as ne,gt as j,hn as M,o as re,on as N,sn as P,tn as ie,wn as ae,yn as oe}from"./App-CCuh99JW.js";var F={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`},se;se||={};function ce(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var I={},L={},R={},z;function B(){if(z)return R;z=1;function e(e){return e==null}function t(e){return typeof e==`object`&&!!e}function n(t){return Array.isArray(t)?t:e(t)?[]:[t]}function r(e,t){if(t){let n=Object.keys(t);for(let r=0,i=n.length;r<i;r+=1){let i=n[r];e[i]=t[i]}}return e}function i(e,t){let n=``;for(let r=0;r<t;r+=1)n+=e;return n}function a(e){return e===0&&1/e==-1/0}return R.isNothing=e,R.isObject=t,R.toArray=n,R.repeat=i,R.isNegativeZero=a,R.extend=r,R}var le,V;function H(){if(V)return le;V=1;function e(e,t){let n=``,r=e.reason||`(unknown reason)`;return e.mark?(e.mark.name&&(n+=`in "`+e.mark.name+`" `),n+=`(`+(e.mark.line+1)+`:`+(e.mark.column+1)+`)`,!t&&e.mark.snippet&&(n+=`
2
+
3
+ `+e.mark.snippet),r+` `+n):r}function t(t,n){Error.call(this),this.name=`YAMLException`,this.reason=t,this.mark=n,this.message=e(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack||``}return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t.prototype.toString=function(t){return this.name+`: `+e(this,t)},le=t,le}var U,ue;function de(){if(ue)return U;ue=1;let e=B();function t(e,t,n,r,i){let a=``,o=``,s=Math.floor(i/2)-1;return r-t>s&&(a=` ... `,t=r-s+a.length),n-r>s&&(o=` ...`,n=r+s-o.length),{str:a+e.slice(t,n).replace(/\t/g,`→`)+o,pos:r-t+a.length}}function n(t,n){return e.repeat(` `,n-t.length)+t}function r(r,i){if(i=Object.create(i||null),!r.buffer)return null;i.maxLength||(i.maxLength=79),typeof i.indent!=`number`&&(i.indent=1),typeof i.linesBefore!=`number`&&(i.linesBefore=3),typeof i.linesAfter!=`number`&&(i.linesAfter=2);let a=/\r?\n|\r|\0/g,o=[0],s=[],c,l=-1;for(;c=a.exec(r.buffer);)s.push(c.index),o.push(c.index+c[0].length),r.position<=c.index&&l<0&&(l=o.length-2);l<0&&(l=o.length-1);let u=``,d=Math.min(r.line+i.linesAfter,s.length).toString().length,f=i.maxLength-(i.indent+d+3);for(let a=1;a<=i.linesBefore&&!(l-a<0);a++){let c=t(r.buffer,o[l-a],s[l-a],r.position-(o[l]-o[l-a]),f);u=e.repeat(` `,i.indent)+n((r.line-a+1).toString(),d)+` | `+c.str+`
4
+ `+u}let p=t(r.buffer,o[l],s[l],r.position,f);u+=e.repeat(` `,i.indent)+n((r.line+1).toString(),d)+` | `+p.str+`
5
+ `,u+=e.repeat(`-`,i.indent+d+3+p.pos)+`^
6
+ `;for(let a=1;a<=i.linesAfter&&!(l+a>=s.length);a++){let c=t(r.buffer,o[l+a],s[l+a],r.position-(o[l]-o[l+a]),f);u+=e.repeat(` `,i.indent)+n((r.line+a+1).toString(),d)+` | `+c.str+`
7
+ `}return u.replace(/\n$/,``)}return U=r,U}var W,fe;function G(){if(fe)return W;fe=1;let e=H(),t=[`kind`,`multi`,`resolve`,`construct`,`instanceOf`,`predicate`,`represent`,`representName`,`defaultStyle`,`styleAliases`],n=[`scalar`,`sequence`,`mapping`];function r(e){let t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(e){t[String(e)]=n})}),t}function i(i,a){if(a||={},Object.keys(a).forEach(function(n){if(t.indexOf(n)===-1)throw new e(`Unknown option "`+n+`" is met in definition of "`+i+`" YAML type.`)}),this.options=a,this.tag=i,this.kind=a.kind||null,this.resolve=a.resolve||function(){return!0},this.construct=a.construct||function(e){return e},this.instanceOf=a.instanceOf||null,this.predicate=a.predicate||null,this.represent=a.represent||null,this.representName=a.representName||null,this.defaultStyle=a.defaultStyle||null,this.multi=a.multi||!1,this.styleAliases=r(a.styleAliases||null),n.indexOf(this.kind)===-1)throw new e(`Unknown kind "`+this.kind+`" is specified for "`+i+`" YAML type.`)}return W=i,W}var pe,K;function q(){if(K)return pe;K=1;let e=H(),t=G();function n(e,t){let n=[];return e[t].forEach(function(e){let t=n.length;n.forEach(function(n,r){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=r)}),n[t]=e}),n}function r(){let e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function t(t){t.multi?(e.multi[t.kind].push(t),e.multi.fallback.push(t)):e[t.kind][t.tag]=e.fallback[t.tag]=t}for(let e=0,n=arguments.length;e<n;e+=1)arguments[e].forEach(t);return e}function i(e){return this.extend(e)}return i.prototype.extend=function(a){let o=[],s=[];if(a instanceof t)s.push(a);else if(Array.isArray(a))s=s.concat(a);else if(a&&(Array.isArray(a.implicit)||Array.isArray(a.explicit)))a.implicit&&(o=o.concat(a.implicit)),a.explicit&&(s=s.concat(a.explicit));else throw new e(`Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })`);o.forEach(function(n){if(!(n instanceof t))throw new e(`Specified list of YAML types (or a single Type object) contains a non-Type object.`);if(n.loadKind&&n.loadKind!==`scalar`)throw new e(`There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.`);if(n.multi)throw new e(`There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.`)}),s.forEach(function(n){if(!(n instanceof t))throw new e(`Specified list of YAML types (or a single Type object) contains a non-Type object.`)});let c=Object.create(i.prototype);return c.implicit=(this.implicit||[]).concat(o),c.explicit=(this.explicit||[]).concat(s),c.compiledImplicit=n(c,`implicit`),c.compiledExplicit=n(c,`explicit`),c.compiledTypeMap=r(c.compiledImplicit,c.compiledExplicit),c},pe=i,pe}var me,he;function ge(){return he||(he=1,me=new(G())(`tag:yaml.org,2002:str`,{kind:`scalar`,construct:function(e){return e===null?``:e}})),me}var _e,J;function ve(){return J||(J=1,_e=new(G())(`tag:yaml.org,2002:seq`,{kind:`sequence`,construct:function(e){return e===null?[]:e}})),_e}var Y,X;function ye(){return X||(X=1,Y=new(G())(`tag:yaml.org,2002:map`,{kind:`mapping`,construct:function(e){return e===null?{}:e}})),Y}var be,xe;function Se(){return xe||(xe=1,be=new(q())({explicit:[ge(),ve(),ye()]})),be}var Ce,we;function Te(){if(we)return Ce;we=1;let e=G();function t(e){if(e===null)return!0;let t=e.length;return t===1&&e===`~`||t===4&&(e===`null`||e===`Null`||e===`NULL`)}function n(){return null}function r(e){return e===null}return Ce=new e(`tag:yaml.org,2002:null`,{kind:`scalar`,resolve:t,construct:n,predicate:r,represent:{canonical:function(){return`~`},lowercase:function(){return`null`},uppercase:function(){return`NULL`},camelcase:function(){return`Null`},empty:function(){return``}},defaultStyle:`lowercase`}),Ce}var Ee,De;function Oe(){if(De)return Ee;De=1;let e=G();function t(e){if(e===null)return!1;let t=e.length;return t===4&&(e===`true`||e===`True`||e===`TRUE`)||t===5&&(e===`false`||e===`False`||e===`FALSE`)}function n(e){return e===`true`||e===`True`||e===`TRUE`}function r(e){return Object.prototype.toString.call(e)===`[object Boolean]`}return Ee=new e(`tag:yaml.org,2002:bool`,{kind:`scalar`,resolve:t,construct:n,predicate:r,represent:{lowercase:function(e){return e?`true`:`false`},uppercase:function(e){return e?`TRUE`:`FALSE`},camelcase:function(e){return e?`True`:`False`}},defaultStyle:`lowercase`}),Ee}var ke,Ae;function je(){if(Ae)return ke;Ae=1;let e=B(),t=G();function n(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function r(e){return e>=48&&e<=55}function i(e){return e>=48&&e<=57}function a(e){if(e===null)return!1;let t=e.length,a=0,s=!1;if(!t)return!1;let c=e[a];if((c===`-`||c===`+`)&&(c=e[++a]),c===`0`){if(a+1===t)return!0;if(c=e[++a],c===`b`){for(a++;a<t;a++){if(c=e[a],c!==`0`&&c!==`1`)return!1;s=!0}return s&&isFinite(o(e))}if(c===`x`){for(a++;a<t;a++){if(!n(e.charCodeAt(a)))return!1;s=!0}return s&&isFinite(o(e))}if(c===`o`){for(a++;a<t;a++){if(!r(e.charCodeAt(a)))return!1;s=!0}return s&&isFinite(o(e))}}for(;a<t;a++){if(!i(e.charCodeAt(a)))return!1;s=!0}return s?isFinite(o(e)):!1}function o(e){let t=e,n=1,r=t[0];if((r===`-`||r===`+`)&&(r===`-`&&(n=-1),t=t.slice(1),r=t[0]),t===`0`)return 0;if(r===`0`){if(t[1]===`b`)return n*parseInt(t.slice(2),2);if(t[1]===`x`)return n*parseInt(t.slice(2),16);if(t[1]===`o`)return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}function s(e){return o(e)}function c(t){return Object.prototype.toString.call(t)===`[object Number]`&&t%1==0&&!e.isNegativeZero(t)}return ke=new t(`tag:yaml.org,2002:int`,{kind:`scalar`,resolve:a,construct:s,predicate:c,represent:{binary:function(e){return e>=0?`0b`+e.toString(2):`-0b`+e.toString(2).slice(1)},octal:function(e){return e>=0?`0o`+e.toString(8):`-0o`+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?`0x`+e.toString(16).toUpperCase():`-0x`+e.toString(16).toUpperCase().slice(1)}},defaultStyle:`decimal`,styleAliases:{binary:[2,`bin`],octal:[8,`oct`],decimal:[10,`dec`],hexadecimal:[16,`hex`]}}),ke}var Me,Ne;function Pe(){if(Ne)return Me;Ne=1;let e=B(),t=G(),n=RegExp(`^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`),r=RegExp(`^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`);function i(e){return e===null||!n.test(e)?!1:isFinite(parseFloat(e,10))?!0:r.test(e)}function a(e){let t=e.toLowerCase(),n=t[0]===`-`?-1:1;return`+-`.indexOf(t[0])>=0&&(t=t.slice(1)),t===`.inf`?n===1?1/0:-1/0:t===`.nan`?NaN:n*parseFloat(t,10)}let o=/^[-+]?[0-9]+e/;function s(t,n){if(isNaN(t))switch(n){case`lowercase`:return`.nan`;case`uppercase`:return`.NAN`;case`camelcase`:return`.NaN`}else if(t===1/0)switch(n){case`lowercase`:return`.inf`;case`uppercase`:return`.INF`;case`camelcase`:return`.Inf`}else if(t===-1/0)switch(n){case`lowercase`:return`-.inf`;case`uppercase`:return`-.INF`;case`camelcase`:return`-.Inf`}else if(e.isNegativeZero(t))return`-0.0`;let r=t.toString(10);return o.test(r)?r.replace(`e`,`.e`):r}function c(t){return Object.prototype.toString.call(t)===`[object Number]`&&(t%1!=0||e.isNegativeZero(t))}return Me=new t(`tag:yaml.org,2002:float`,{kind:`scalar`,resolve:i,construct:a,predicate:c,represent:s,defaultStyle:`lowercase`}),Me}var Fe,Ie;function Le(){return Ie||(Ie=1,Fe=Se().extend({implicit:[Te(),Oe(),je(),Pe()]})),Fe}var Z,Re;function ze(){return Re||(Re=1,Z=Le()),Z}var Be,Ve;function He(){if(Ve)return Be;Ve=1;let e=G(),t=RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$`),n=RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$`);function r(e){return e===null?!1:t.exec(e)!==null||n.exec(e)!==null}function i(e){let r=0,i=null,a=t.exec(e);if(a===null&&(a=n.exec(e)),a===null)throw Error(`Date resolve error`);let o=+a[1],s=a[2]-1,c=+a[3];if(!a[4])return new Date(Date.UTC(o,s,c));let l=+a[4],u=+a[5],d=+a[6];if(a[7]){for(r=a[7].slice(0,3);r.length<3;)r+=`0`;r=+r}if(a[9]){let e=+a[10],t=+(a[11]||0);i=(e*60+t)*6e4,a[9]===`-`&&(i=-i)}let f=new Date(Date.UTC(o,s,c,l,u,d,r));return i&&f.setTime(f.getTime()-i),f}function a(e){return e.toISOString()}return Be=new e(`tag:yaml.org,2002:timestamp`,{kind:`scalar`,resolve:r,construct:i,instanceOf:Date,represent:a}),Be}var Ue,We;function Ge(){if(We)return Ue;We=1;let e=G();function t(e){return e===`<<`||e===null}return Ue=new e(`tag:yaml.org,2002:merge`,{kind:`scalar`,resolve:t}),Ue}var Ke,qe;function Je(){if(qe)return Ke;qe=1;let e=G();function t(e){if(e===null)return!1;let t=0,n=e.length;for(let r=0;r<n;r++){let n=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
8
+ \r`.indexOf(e.charAt(r));if(!(n>64)){if(n<0)return!1;t+=6}}return t%8==0}function n(e){let t=e.replace(/[\r\n=]/g,``),n=t.length,r=0,i=[];for(let e=0;e<n;e++)e%4==0&&e&&(i.push(r>>16&255),i.push(r>>8&255),i.push(r&255)),r=r<<6|`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
9
+ \r`.indexOf(t.charAt(e));let a=n%4*6;return a===0?(i.push(r>>16&255),i.push(r>>8&255),i.push(r&255)):a===18?(i.push(r>>10&255),i.push(r>>2&255)):a===12&&i.push(r>>4&255),new Uint8Array(i)}function r(e){let t=``,n=0,r=e.length,i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
10
+ \r`;for(let a=0;a<r;a++)a%3==0&&a&&(t+=i[n>>18&63],t+=i[n>>12&63],t+=i[n>>6&63],t+=i[n&63]),n=(n<<8)+e[a];let a=r%3;return a===0?(t+=i[n>>18&63],t+=i[n>>12&63],t+=i[n>>6&63],t+=i[n&63]):a===2?(t+=i[n>>10&63],t+=i[n>>4&63],t+=i[n<<2&63],t+=i[64]):a===1&&(t+=i[n>>2&63],t+=i[n<<4&63],t+=i[64],t+=i[64]),t}function i(e){return Object.prototype.toString.call(e)===`[object Uint8Array]`}return Ke=new e(`tag:yaml.org,2002:binary`,{kind:`scalar`,resolve:t,construct:n,predicate:i,represent:r}),Ke}var Ye,Xe;function Ze(){if(Xe)return Ye;Xe=1;let e=G(),t=Object.prototype.hasOwnProperty,n=Object.prototype.toString;function r(e){if(e===null)return!0;let r=[],i=e;for(let e=0,a=i.length;e<a;e+=1){let a=i[e],o=!1;if(n.call(a)!==`[object Object]`)return!1;let s;for(s in a)if(t.call(a,s)){if(!o)o=!0;else return!1}if(!o)return!1;if(r.indexOf(s)===-1)r.push(s);else return!1}return!0}function i(e){return e===null?[]:e}return Ye=new e(`tag:yaml.org,2002:omap`,{kind:`sequence`,resolve:r,construct:i}),Ye}var Qe,$e;function et(){if($e)return Qe;$e=1;let e=G(),t=Object.prototype.toString;function n(e){if(e===null)return!0;let n=e,r=Array(n.length);for(let e=0,i=n.length;e<i;e+=1){let i=n[e];if(t.call(i)!==`[object Object]`)return!1;let a=Object.keys(i);if(a.length!==1)return!1;r[e]=[a[0],i[a[0]]]}return!0}function r(e){if(e===null)return[];let t=e,n=Array(t.length);for(let e=0,r=t.length;e<r;e+=1){let r=t[e],i=Object.keys(r);n[e]=[i[0],r[i[0]]]}return n}return Qe=new e(`tag:yaml.org,2002:pairs`,{kind:`sequence`,resolve:n,construct:r}),Qe}var tt,nt;function rt(){if(nt)return tt;nt=1;let e=G(),t=Object.prototype.hasOwnProperty;function n(e){if(e===null)return!0;let n=e;for(let e in n)if(t.call(n,e)&&n[e]!==null)return!1;return!0}function r(e){return e===null?{}:e}return tt=new e(`tag:yaml.org,2002:set`,{kind:`mapping`,resolve:n,construct:r}),tt}var it,at;function ot(){return at||(at=1,it=ze().extend({implicit:[He(),Ge()],explicit:[Je(),Ze(),et(),rt()]})),it}var st;function ct(){if(st)return L;st=1;let e=B(),t=H(),n=de(),r=ot(),i=Object.prototype.hasOwnProperty,a=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,o=/[\x85\u2028\u2029]/,s=/[,\[\]{}]/,c=/^(?:!|!!|![0-9A-Za-z-]+!)$/,l=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function u(e){return Object.prototype.toString.call(e)}function d(e){return e===10||e===13}function f(e){return e===9||e===32}function p(e){return e===9||e===32||e===10||e===13}function m(e){return e===44||e===91||e===93||e===123||e===125}function h(e){if(e>=48&&e<=57)return e-48;let t=e|32;return t>=97&&t<=102?t-97+10:-1}function g(e){return e===120?2:e===117?4:e===85?8:0}function _(e){return e>=48&&e<=57?e-48:-1}function v(e){switch(e){case 48:return`\0`;case 97:return`\x07`;case 98:return`\b`;case 116:return` `;case 9:return` `;case 110:return`
11
+ `;case 118:return`\v`;case 102:return`\f`;case 114:return`\r`;case 101:return`\x1B`;case 32:return` `;case 34:return`"`;case 47:return`/`;case 92:return`\\`;case 78:return`…`;case 95:return`\xA0`;case 76:return`\u2028`;case 80:return`\u2029`;default:return``}}function y(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function b(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}let x=Array(256),S=Array(256);for(let e=0;e<256;e++)x[e]=+!!v(e),S[e]=v(e);function C(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||r,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.maxDepth=typeof t.maxDepth==`number`?t.maxDepth:100,this.maxTotalMergeKeys=typeof t.maxTotalMergeKeys==`number`?t.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function w(e,r){let i={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return i.snippet=n(i),new t(r,i)}function T(e,t){throw w(e,t)}function E(e,t){e.onWarning&&e.onWarning.call(null,w(e,t))}function D(e,t,n){let r=e.anchorMapTransactions;if(r.length!==0){let n=r[r.length-1];i.call(n,t)||(n[t]={existed:i.call(e.anchorMap,t),value:e.anchorMap[t]})}e.anchorMap[t]=n}function O(e){e.anchorMapTransactions.push(Object.create(null))}function ee(e){let t=e.anchorMapTransactions.pop(),n=e.anchorMapTransactions;if(n.length===0)return;let r=n[n.length-1],a=Object.keys(t);for(let e=0,n=a.length;e<n;e+=1){let n=a[e];i.call(r,n)||(r[n]=t[n])}}function k(e){let t=e.anchorMapTransactions.pop(),n=Object.keys(t);for(let r=n.length-1;r>=0;--r){let i=t[n[r]];i.existed?e.anchorMap[n[r]]=i.value:delete e.anchorMap[n[r]]}}function A(e){return{position:e.position,line:e.line,lineStart:e.lineStart,lineIndent:e.lineIndent,firstTabInLine:e.firstTabInLine,tag:e.tag,anchor:e.anchor,kind:e.kind,result:e.result}}function te(e,t){e.position=t.position,e.line=t.line,e.lineStart=t.lineStart,e.lineIndent=t.lineIndent,e.firstTabInLine=t.firstTabInLine,e.tag=t.tag,e.anchor=t.anchor,e.kind=t.kind,e.result=t.result}let ne={YAML:function(e,t,n){e.version!==null&&T(e,`duplication of %YAML directive`),n.length!==1&&T(e,`YAML directive accepts exactly one argument`);let r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]);r===null&&T(e,`ill-formed argument of the YAML directive`);let i=parseInt(r[1],10),a=parseInt(r[2],10);i!==1&&T(e,`unacceptable YAML version of the document`),e.version=n[0],e.checkLineBreaks=a<2,a!==1&&a!==2&&E(e,`unsupported YAML version of the document`)},TAG:function(e,t,n){let r;n.length!==2&&T(e,`TAG directive accepts exactly two arguments`);let a=n[0];r=n[1],c.test(a)||T(e,`ill-formed tag handle (first argument) of the TAG directive`),i.call(e.tagMap,a)&&T(e,`there is a previously declared suffix for "`+a+`" tag handle`),l.test(r)||T(e,`ill-formed tag prefix (second argument) of the TAG directive`);try{r=decodeURIComponent(r)}catch{T(e,`tag prefix is malformed: `+r)}e.tagMap[a]=r}};function j(e,t,n,r){if(t<n){let i=e.input.slice(t,n);if(r)for(let t=0,n=i.length;t<n;t+=1){let n=i.charCodeAt(t);n===9||n>=32&&n<=1114111||T(e,`expected valid JSON character`)}else a.test(i)&&T(e,`the stream contains non-printable characters`);e.result+=i}}function M(t,n,r,a){e.isObject(r)||T(t,`cannot merge mappings; the provided source object is unacceptable`);let o=Object.keys(r);for(let e=0,s=o.length;e<s;e+=1){let s=o[e];t.maxTotalMergeKeys!==-1&&++t.totalMergeKeys>t.maxTotalMergeKeys&&T(t,`merge keys exceeded maxTotalMergeKeys (`+t.maxTotalMergeKeys+`)`),i.call(n,s)||(b(n,s,r[s]),a[s]=!0)}}function re(e,t,n,r,a,o,s,c,l){if(Array.isArray(a)){a=Array.prototype.slice.call(a);for(let t=0,n=a.length;t<n;t+=1)Array.isArray(a[t])&&T(e,`nested arrays are not supported inside keys`),typeof a==`object`&&u(a[t])===`[object Object]`&&(a[t]=`[object Object]`)}if(typeof a==`object`&&u(a)===`[object Object]`&&(a=`[object Object]`),a=String(a),t===null&&(t={}),r===`tag:yaml.org,2002:merge`){if(Array.isArray(o))for(let r=0,i=o.length;r<i;r+=1)M(e,t,o[r],n);else M(e,t,o,n)}else!e.json&&!i.call(n,a)&&i.call(t,a)&&(e.line=s||e.line,e.lineStart=c||e.lineStart,e.position=l||e.position,T(e,`duplicated mapping key`)),b(t,a,o),delete n[a];return t}function N(e){let t=e.input.charCodeAt(e.position);t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):T(e,`a line break is expected`),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function P(e,t,n){let r=0,i=e.input.charCodeAt(e.position);for(;i!==0;){for(;f(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(d(i))for(N(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&E(e,`deficient indentation`),r}function ie(e){let t=e.position,n=e.input.charCodeAt(t);return!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||p(n)))}function ae(t,n){n===1?t.result+=` `:n>1&&(t.result+=e.repeat(`
12
+ `,n-1))}function oe(e,t,n){let r,i,a,o,s,c,l=e.kind,u=e.result,h=e.input.charCodeAt(e.position);if(p(h)||m(h)||h===35||h===38||h===42||h===33||h===124||h===62||h===39||h===34||h===37||h===64||h===96)return!1;if(h===63||h===45){let t=e.input.charCodeAt(e.position+1);if(p(t)||n&&m(t))return!1}for(e.kind=`scalar`,e.result=``,r=i=e.position,a=!1;h!==0;){if(h===58){let t=e.input.charCodeAt(e.position+1);if(p(t)||n&&m(t))break}else if(h===35){if(p(e.input.charCodeAt(e.position-1)))break}else if(e.position===e.lineStart&&ie(e)||n&&m(h))break;else if(d(h)){if(o=e.line,s=e.lineStart,c=e.lineIndent,P(e,!1,-1),e.lineIndent>=t){a=!0,h=e.input.charCodeAt(e.position);continue}e.position=i,e.line=o,e.lineStart=s,e.lineIndent=c;break}a&&=(j(e,r,i,!1),ae(e,e.line-o),r=i=e.position,!1),f(h)||(i=e.position+1),h=e.input.charCodeAt(++e.position)}return j(e,r,i,!1),e.result?!0:(e.kind=l,e.result=u,!1)}function F(e,t){let n,r,i=e.input.charCodeAt(e.position);if(i!==39)return!1;for(e.kind=`scalar`,e.result=``,e.position++,n=r=e.position;(i=e.input.charCodeAt(e.position))!==0;)if(i===39){if(j(e,n,e.position,!0),i=e.input.charCodeAt(++e.position),i===39)n=e.position,e.position++,r=e.position;else return!0}else d(i)?(j(e,n,r,!0),ae(e,P(e,!1,t)),n=r=e.position):e.position===e.lineStart&&ie(e)?T(e,`unexpected end of the document within a single quoted scalar`):(e.position++,f(i)||(r=e.position));T(e,`unexpected end of the stream within a single quoted scalar`)}function se(e,t){let n,r,i,a=e.input.charCodeAt(e.position);if(a!==34)return!1;for(e.kind=`scalar`,e.result=``,e.position++,n=r=e.position;(a=e.input.charCodeAt(e.position))!==0;)if(a===34)return j(e,n,e.position,!0),e.position++,!0;else if(a===92){if(j(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),d(a))P(e,!1,t);else if(a<256&&x[a])e.result+=S[a],e.position++;else if((i=g(a))>0){let t=i,n=0;for(;t>0;t--)a=e.input.charCodeAt(++e.position),(i=h(a))>=0?n=(n<<4)+i:T(e,`expected hexadecimal character`);e.result+=y(n),e.position++}else T(e,`unknown escape sequence`);n=r=e.position}else d(a)?(j(e,n,r,!0),ae(e,P(e,!1,t)),n=r=e.position):e.position===e.lineStart&&ie(e)?T(e,`unexpected end of the document within a double quoted scalar`):(e.position++,f(a)||(r=e.position));T(e,`unexpected end of the stream within a double quoted scalar`)}function ce(e,t){let n=!0,r,i,a,o=e.tag,s,c=e.anchor,l,u,d,f,m=Object.create(null),h,g,_,v=e.input.charCodeAt(e.position);if(v===91)l=93,f=!1,s=[];else if(v===123)l=125,f=!0,s={};else return!1;for(e.anchor!==null&&D(e,e.anchor,s),v=e.input.charCodeAt(++e.position);v!==0;){if(P(e,!0,t),v=e.input.charCodeAt(e.position),v===l)return e.position++,e.tag=o,e.anchor=c,e.kind=f?`mapping`:`sequence`,e.result=s,!0;n?v===44&&T(e,`expected the node content, but found ','`):T(e,`missed comma between flow collection entries`),g=h=_=null,u=d=!1,v===63&&p(e.input.charCodeAt(e.position+1))&&(u=d=!0,e.position++,P(e,!0,t)),r=e.line,i=e.lineStart,a=e.position,W(e,t,1,!1,!0),g=e.tag,h=e.result,P(e,!0,t),v=e.input.charCodeAt(e.position),(d||e.line===r)&&v===58&&(u=!0,v=e.input.charCodeAt(++e.position),P(e,!0,t),W(e,t,1,!1,!0),_=e.result),f?re(e,s,m,g,h,_,r,i,a):u?s.push(re(e,null,m,g,h,_,r,i,a)):s.push(h),P(e,!0,t),v=e.input.charCodeAt(e.position),v===44?(n=!0,v=e.input.charCodeAt(++e.position)):n=!1}T(e,`unexpected end of the stream within a flow collection`)}function I(t,n){let r,i=1,a=!1,o=!1,s=n,c=0,l=!1,u,p=t.input.charCodeAt(t.position);if(p===124)r=!1;else if(p===62)r=!0;else return!1;for(t.kind=`scalar`,t.result=``;p!==0;)if(p=t.input.charCodeAt(++t.position),p===43||p===45)i===1?i=p===43?3:2:T(t,`repeat of a chomping mode identifier`);else if((u=_(p))>=0)u===0?T(t,`bad explicit indentation width of a block scalar; it cannot be less than one`):o?T(t,`repeat of an indentation width identifier`):(s=n+u-1,o=!0);else break;if(f(p)){do p=t.input.charCodeAt(++t.position);while(f(p));if(p===35)do p=t.input.charCodeAt(++t.position);while(!d(p)&&p!==0)}for(;p!==0;){for(N(t),t.lineIndent=0,p=t.input.charCodeAt(t.position);(!o||t.lineIndent<s)&&p===32;)t.lineIndent++,p=t.input.charCodeAt(++t.position);if(!o&&t.lineIndent>s&&(s=t.lineIndent),d(p)){c++;continue}if(!o&&s===0&&T(t,`missing indentation for block scalar`),t.lineIndent<s){i===3?t.result+=e.repeat(`
13
+ `,a?1+c:c):i===1&&a&&(t.result+=`
14
+ `);break}r?f(p)?(l=!0,t.result+=e.repeat(`
15
+ `,a?1+c:c)):l?(l=!1,t.result+=e.repeat(`
16
+ `,c+1)):c===0?a&&(t.result+=` `):t.result+=e.repeat(`
17
+ `,c):t.result+=e.repeat(`
18
+ `,a?1+c:c),a=!0,o=!0,c=0;let n=t.position;for(;!d(p)&&p!==0;)p=t.input.charCodeAt(++t.position);j(t,n,t.position,!1)}return!0}function R(e,t){let n=e.tag,r=e.anchor,i=[],a=!1;if(e.firstTabInLine!==-1)return!1;e.anchor!==null&&D(e,e.anchor,i);let o=e.input.charCodeAt(e.position);for(;o!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,T(e,`tab characters must not be used in indentation`)),o===45&&p(e.input.charCodeAt(e.position+1)));){if(a=!0,e.position++,P(e,!0,-1)&&e.lineIndent<=t){i.push(null),o=e.input.charCodeAt(e.position);continue}let n=e.line;if(W(e,t,3,!1,!0),i.push(e.result),P(e,!0,-1),o=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&o!==0)T(e,`bad indentation of a sequence entry`);else if(e.lineIndent<t)break}return a?(e.tag=n,e.anchor=r,e.kind=`sequence`,e.result=i,!0):!1}function z(e,t,n){let r,i,a,o,s=e.tag,c=e.anchor,l={},u=Object.create(null),d=null,m=null,h=null,g=!1,_=!1;if(e.firstTabInLine!==-1)return!1;e.anchor!==null&&D(e,e.anchor,l);let v=e.input.charCodeAt(e.position);for(;v!==0;){!g&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,T(e,`tab characters must not be used in indentation`));let y=e.input.charCodeAt(e.position+1),b=e.line;if((v===63||v===58)&&p(y))v===63?(g&&(re(e,l,u,d,m,null,i,a,o),d=m=h=null),_=!0,g=!0,r=!0):g?(g=!1,r=!0):T(e,`incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line`),e.position+=1,v=y;else{if(i=e.line,a=e.lineStart,o=e.position,!W(e,n,2,!1,!0))break;if(e.line===b){for(v=e.input.charCodeAt(e.position);f(v);)v=e.input.charCodeAt(++e.position);if(v===58)v=e.input.charCodeAt(++e.position),p(v)||T(e,`a whitespace character is expected after the key-value separator within a block mapping`),g&&(re(e,l,u,d,m,null,i,a,o),d=m=h=null),_=!0,g=!1,r=!1,d=e.tag,m=e.result;else if(_)T(e,`can not read an implicit mapping pair; a colon is missed`);else return e.tag=s,e.anchor=c,!0}else if(_)T(e,`can not read a block mapping entry; a multiline key may not be an implicit key`);else return e.tag=s,e.anchor=c,!0}if((e.line===b||e.lineIndent>t)&&(g&&(i=e.line,a=e.lineStart,o=e.position),W(e,t,4,!0,r)&&(g?m=e.result:h=e.result),g||(re(e,l,u,d,m,h,i,a,o),d=m=h=null),P(e,!0,-1),v=e.input.charCodeAt(e.position)),(e.line===b||e.lineIndent>t)&&v!==0)T(e,`bad indentation of a mapping entry`);else if(e.lineIndent<t)break}return g&&re(e,l,u,d,m,null,i,a,o),_&&(e.tag=s,e.anchor=c,e.kind=`mapping`,e.result=l),_}function le(e){let t=!1,n=!1,r,a,o=e.input.charCodeAt(e.position);if(o!==33)return!1;e.tag!==null&&T(e,`duplication of a tag property`),o=e.input.charCodeAt(++e.position),o===60?(t=!0,o=e.input.charCodeAt(++e.position)):o===33?(n=!0,r=`!!`,o=e.input.charCodeAt(++e.position)):r=`!`;let u=e.position;if(t){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(a=e.input.slice(u,e.position),o=e.input.charCodeAt(++e.position)):T(e,`unexpected end of the stream within a verbatim tag`)}else{for(;o!==0&&!p(o);)o===33&&(n?T(e,`tag suffix cannot contain exclamation marks`):(r=e.input.slice(u-1,e.position+1),c.test(r)||T(e,`named tag handle cannot contain such characters`),n=!0,u=e.position+1)),o=e.input.charCodeAt(++e.position);a=e.input.slice(u,e.position),s.test(a)&&T(e,`tag suffix cannot contain flow indicator characters`)}a&&!l.test(a)&&T(e,`tag name cannot contain such characters: `+a);try{a=decodeURIComponent(a)}catch{T(e,`tag name is malformed: `+a)}return t?e.tag=a:i.call(e.tagMap,r)?e.tag=e.tagMap[r]+a:r===`!`?e.tag=`!`+a:r===`!!`?e.tag=`tag:yaml.org,2002:`+a:T(e,`undeclared tag handle "`+r+`"`),!0}function V(e){let t=e.input.charCodeAt(e.position);if(t!==38)return!1;e.anchor!==null&&T(e,`duplication of an anchor property`),t=e.input.charCodeAt(++e.position);let n=e.position;for(;t!==0&&!p(t)&&!m(t);)t=e.input.charCodeAt(++e.position);return e.position===n&&T(e,`name of an anchor node must contain at least one character`),e.anchor=e.input.slice(n,e.position),!0}function U(e){let t=e.input.charCodeAt(e.position);if(t!==42)return!1;t=e.input.charCodeAt(++e.position);let n=e.position;for(;t!==0&&!p(t)&&!m(t);)t=e.input.charCodeAt(++e.position);e.position===n&&T(e,`name of an alias node must contain at least one character`);let r=e.input.slice(n,e.position);return i.call(e.anchorMap,r)||T(e,`unidentified alias "`+r+`"`),e.result=e.anchorMap[r],P(e,!0,-1),!0}function ue(e,t,n,r){let i=A(e);return O(e),te(e,t),e.tag=null,e.anchor=null,e.kind=null,e.result=null,z(e,n,r)&&e.kind===`mapping`?(ee(e),!0):(k(e),te(e,i),!1)}function W(e,t,n,r,a){let o,s,c=1,l=!1,u=!1,d=null,f,p,m;e.depth>=e.maxDepth&&T(e,`nesting exceeded maxDepth (`+e.maxDepth+`)`),e.depth+=1,e.listener!==null&&e.listener(`open`,e),e.tag=null,e.anchor=null,e.kind=null,e.result=null;let h=o=s=n===4||n===3;if(r&&P(e,!0,-1)&&(l=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;;){let n=e.input.charCodeAt(e.position),r=A(e);if(l&&(n===33&&e.tag!==null||n===38&&e.anchor!==null)||!le(e)&&!V(e))break;d===null&&(d=r),P(e,!0,-1)?(l=!0,s=h,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)):s=!1}if(s&&=l||a,c===1||n===4){if(p=n===1||n===2?t:t+1,m=e.position-e.lineStart,c===1){if(s&&(R(e,m)||z(e,m,p))||ce(e,p))u=!0;else{let t=e.input.charCodeAt(e.position);d!==null&&h&&!s&&t!==124&&t!==62&&ue(e,d,d.position-d.lineStart,p)||o&&I(e,p)||F(e,p)||se(e,p)?u=!0:U(e)?(u=!0,(e.tag!==null||e.anchor!==null)&&T(e,`alias node should not have any properties`)):oe(e,p,n===1)&&(u=!0,e.tag===null&&(e.tag=`?`)),e.anchor!==null&&D(e,e.anchor,e.result)}}else c===0&&(u=s&&R(e,m))}if(e.tag===null)e.anchor!==null&&D(e,e.anchor,e.result);else if(e.tag===`?`){e.result!==null&&e.kind!==`scalar`&&T(e,`unacceptable node kind for !<?> tag; it should be "scalar", not "`+e.kind+`"`);for(let t=0,n=e.implicitTypes.length;t<n;t+=1)if(f=e.implicitTypes[t],f.resolve(e.result)){e.result=f.construct(e.result),e.tag=f.tag,e.anchor!==null&&D(e,e.anchor,e.result);break}}else if(e.tag!==`!`){if(i.call(e.typeMap[e.kind||`fallback`],e.tag))f=e.typeMap[e.kind||`fallback`][e.tag];else{f=null;let t=e.typeMap.multi[e.kind||`fallback`];for(let n=0,r=t.length;n<r;n+=1)if(e.tag.slice(0,t[n].tag.length)===t[n].tag){f=t[n];break}}f||T(e,`unknown tag !<`+e.tag+`>`),e.result!==null&&f.kind!==e.kind&&T(e,`unacceptable node kind for !<`+e.tag+`> tag; it should be "`+f.kind+`", not "`+e.kind+`"`),f.resolve(e.result,e.tag)?(e.result=f.construct(e.result,e.tag),e.anchor!==null&&D(e,e.anchor,e.result)):T(e,`cannot resolve a node with !<`+e.tag+`> explicit tag`)}return e.listener!==null&&e.listener(`close`,e),--e.depth,e.tag!==null||e.anchor!==null||u}function fe(e){let t=e.position,n=!1,r;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(r=e.input.charCodeAt(e.position))!==0&&(P(e,!0,-1),r=e.input.charCodeAt(e.position),!(e.lineIndent>0||r!==37));){n=!0,r=e.input.charCodeAt(++e.position);let t=e.position;for(;r!==0&&!p(r);)r=e.input.charCodeAt(++e.position);let a=e.input.slice(t,e.position),o=[];for(a.length<1&&T(e,`directive name must not be less than one character in length`);r!==0;){for(;f(r);)r=e.input.charCodeAt(++e.position);if(r===35){do r=e.input.charCodeAt(++e.position);while(r!==0&&!d(r));break}if(d(r))break;for(t=e.position;r!==0&&!p(r);)r=e.input.charCodeAt(++e.position);o.push(e.input.slice(t,e.position))}r!==0&&N(e),i.call(ne,a)?ne[a](e,a,o):E(e,`unknown document directive "`+a+`"`)}P(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,P(e,!0,-1)):n&&T(e,`directives end mark is expected`),W(e,e.lineIndent-1,4,!1,!0),P(e,!0,-1),e.checkLineBreaks&&o.test(e.input.slice(t,e.position))&&E(e,`non-ASCII line breaks are interpreted as content`),e.documents.push(e.result),e.position===e.lineStart&&ie(e)?e.input.charCodeAt(e.position)===46&&(e.position+=3,P(e,!0,-1)):e.position<e.length-1&&T(e,`end of the stream or a document separator is expected`)}function G(e,t){e=String(e),t||={},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
19
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));let n=new C(e,t),r=e.indexOf(`\0`);for(r!==-1&&(n.position=r,T(n,`null byte is not allowed in input`)),n.input+=`\0`;n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)fe(n);return n.documents}function pe(e,t,n){typeof t==`object`&&t&&n===void 0&&(n=t,t=null);let r=G(e,n);if(typeof t!=`function`)return r;for(let e=0,n=r.length;e<n;e+=1)t(r[e])}function K(e,n){let r=G(e,n);if(r.length!==0){if(r.length===1)return r[0];throw new t(`expected a single document in the stream, but found more`)}}return L.loadAll=pe,L.load=K,L}var lt={},ut;function dt(){if(ut)return lt;ut=1;let e=B(),t=H(),n=ot(),r=Object.prototype.toString,i=Object.prototype.hasOwnProperty,a=65279,o={};o[0]=`\\0`,o[7]=`\\a`,o[8]=`\\b`,o[9]=`\\t`,o[10]=`\\n`,o[11]=`\\v`,o[12]=`\\f`,o[13]=`\\r`,o[27]=`\\e`,o[34]=`\\"`,o[92]=`\\\\`,o[133]=`\\N`,o[160]=`\\_`,o[8232]=`\\L`,o[8233]=`\\P`;let s=[`y`,`Y`,`yes`,`Yes`,`YES`,`on`,`On`,`ON`,`n`,`N`,`no`,`No`,`NO`,`off`,`Off`,`OFF`],c=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function l(e,t){if(t===null)return{};let n={},r=Object.keys(t);for(let a=0,o=r.length;a<o;a+=1){let o=r[a],s=String(t[o]);o.slice(0,2)===`!!`&&(o=`tag:yaml.org,2002:`+o.slice(2));let c=e.compiledTypeMap.fallback[o];c&&i.call(c.styleAliases,s)&&(s=c.styleAliases[s]),n[o]=s}return n}function u(n){let r,i,a=n.toString(16).toUpperCase();if(n<=255)r=`x`,i=2;else if(n<=65535)r=`u`,i=4;else if(n<=4294967295)r=`U`,i=8;else throw new t(`code point within a string may not be greater than 0xFFFFFFFF`);return`\\`+r+e.repeat(`0`,i-a.length)+a}function d(t){this.schema=t.schema||n,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=e.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=l(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.quotingType=t.quotingType===`"`?2:1,this.forceQuotes=t.forceQuotes||!1,this.replacer=typeof t.replacer==`function`?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result=``,this.duplicates=[],this.usedDuplicates=null}function f(t,n){let r=e.repeat(` `,n),i=0,a=``,o=t.length;for(;i<o;){let e,n=t.indexOf(`
20
+ `,i);n===-1?(e=t.slice(i),i=o):(e=t.slice(i,n+1),i=n+1),e.length&&e!==`
21
+ `&&(a+=r),a+=e}return a}function p(t,n){return`
22
+ `+e.repeat(` `,t.indent*n)}function m(e,t){for(let n=0,r=e.implicitTypes.length;n<r;n+=1)if(e.implicitTypes[n].resolve(t))return!0;return!1}function h(e){return e===32||e===9}function g(e){return e>=32&&e<=126||e>=161&&e<=55295&&e!==8232&&e!==8233||e>=57344&&e<=65533&&e!==a||e>=65536&&e<=1114111}function _(e){return g(e)&&e!==a&&e!==13&&e!==10}function v(e,t,n){let r=_(e),i=r&&!h(e);return(n?r:r&&e!==44&&e!==91&&e!==93&&e!==123&&e!==125)&&e!==35&&!(t===58&&!i)||_(t)&&!h(t)&&e===35||t===58&&i}function y(e){return g(e)&&e!==a&&!h(e)&&e!==45&&e!==63&&e!==58&&e!==44&&e!==91&&e!==93&&e!==123&&e!==125&&e!==35&&e!==38&&e!==42&&e!==33&&e!==124&&e!==61&&e!==62&&e!==39&&e!==34&&e!==37&&e!==64&&e!==96}function b(e){return!h(e)&&e!==58}function x(e,t){let n=e.charCodeAt(t),r;return n>=55296&&n<=56319&&t+1<e.length&&(r=e.charCodeAt(t+1),r>=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}function S(e){return/^\n* /.test(e)}function C(e,t,n,r,i,a,o,s){let c,l=0,u=null,d=!1,f=!1,p=r!==-1,m=-1,h=y(x(e,0))&&b(x(e,e.length-1));if(t||o)for(c=0;c<e.length;l>=65536?c+=2:c++){if(l=x(e,c),!g(l))return 5;h&&=v(l,u,s),u=l}else{for(c=0;c<e.length;l>=65536?c+=2:c++){if(l=x(e,c),l===10)d=!0,p&&(f||=c-m-1>r&&e[m+1]!==` `,m=c);else if(!g(l))return 5;h&&=v(l,u,s),u=l}f||=p&&c-m-1>r&&e[m+1]!==` `}return!d&&!f?h&&!o&&!i(e)?1:a===2?5:2:n>9&&S(e)?5:o?a===2?5:2:f?4:3}function w(e,n,r,i,a){e.dump=(function(){if(n.length===0)return e.quotingType===2?`""`:`''`;if(!e.noCompatMode&&(s.indexOf(n)!==-1||c.test(n)))return e.quotingType===2?`"`+n+`"`:`'`+n+`'`;let o=e.indent*Math.max(1,r),l=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),u=i||e.flowLevel>-1&&r>=e.flowLevel;function d(t){return m(e,t)}switch(C(n,u,e.indent,l,d,e.quotingType,e.forceQuotes&&!i,a)){case 1:return n;case 2:return`'`+n.replace(/'/g,`''`)+`'`;case 3:return`|`+T(n,e.indent)+E(f(n,o));case 4:return`>`+T(n,e.indent)+E(f(D(n,l),o));case 5:return`"`+ee(n)+`"`;default:throw new t(`impossible error: invalid scalar style`)}})()}function T(e,t){let n=S(e)?String(t):``,r=e[e.length-1]===`
23
+ `;return n+(r&&(e[e.length-2]===`
24
+ `||e===`
25
+ `)?`+`:r?``:`-`)+`
26
+ `}function E(e){return e[e.length-1]===`
27
+ `?e.slice(0,-1):e}function D(e,t){let n=/(\n+)([^\n]*)/g,r=(function(){let r=e.indexOf(`
28
+ `);return r=r===-1?e.length:r,n.lastIndex=r,O(e.slice(0,r),t)})(),i=e[0]===`
29
+ `||e[0]===` `,a,o;for(;o=n.exec(e);){let e=o[1],n=o[2];a=n[0]===` `,r+=e+(!i&&!a&&n!==``?`
30
+ `:``)+O(n,t),i=a}return r}function O(e,t){if(e===``||e[0]===` `)return e;let n=/ [^ ]/g,r,i=0,a,o=0,s=0,c=``;for(;r=n.exec(e);)s=r.index,s-i>t&&(a=o>i?o:s,c+=`
31
+ `+e.slice(i,a),i=a+1),o=s;return c+=`
32
+ `,e.length-i>t&&o>i?c+=e.slice(i,o)+`
33
+ `+e.slice(o+1):c+=e.slice(i),c.slice(1)}function ee(e){let t=``,n=0;for(let r=0;r<e.length;n>=65536?r+=2:r++){n=x(e,r);let i=o[n];!i&&g(n)?(t+=e[r],n>=65536&&(t+=e[r+1])):t+=i||u(n)}return t}function k(e,t,n){let r=``,i=e.tag;for(let i=0,a=n.length;i<a;i+=1){let a=n[i];e.replacer&&(a=e.replacer.call(n,String(i),a)),(M(e,t,a,!1,!1)||a===void 0&&M(e,t,null,!1,!1))&&(r!==``&&(r+=`,`+(e.condenseFlow?``:` `)),r+=e.dump)}e.tag=i,e.dump=`[`+r+`]`}function A(e,t,n,r){let i=``,a=e.tag;for(let a=0,o=n.length;a<o;a+=1){let o=n[a];e.replacer&&(o=e.replacer.call(n,String(a),o)),(M(e,t+1,o,!0,!0,!1,!0)||o===void 0&&M(e,t+1,null,!0,!0,!1,!0))&&((!r||i!==``)&&(i+=p(e,t)),e.dump&&e.dump.charCodeAt(0)===10?i+=`-`:i+=`- `,i+=e.dump)}e.tag=a,e.dump=i||`[]`}function te(e,t,n){let r=``,i=e.tag,a=Object.keys(n);for(let i=0,o=a.length;i<o;i+=1){let o=``;r!==``&&(o+=`, `),e.condenseFlow&&(o+=`"`);let s=a[i],c=n[s];e.replacer&&(c=e.replacer.call(n,s,c)),M(e,t,s,!1,!1)&&(e.dump.length>1024&&(o+=`? `),o+=e.dump+(e.condenseFlow?`"`:``)+`:`+(e.condenseFlow?``:` `),M(e,t,c,!1,!1)&&(o+=e.dump,r+=o))}e.tag=i,e.dump=`{`+r+`}`}function ne(e,n,r,i){let a=``,o=e.tag,s=Object.keys(r);if(e.sortKeys===!0)s.sort();else if(typeof e.sortKeys==`function`)s.sort(e.sortKeys);else if(e.sortKeys)throw new t(`sortKeys must be a boolean or a function`);for(let t=0,o=s.length;t<o;t+=1){let o=``;(!i||a!==``)&&(o+=p(e,n));let c=s[t],l=r[c];if(e.replacer&&(l=e.replacer.call(r,c,l)),!M(e,n+1,c,!0,!0,!0))continue;let u=e.tag!==null&&e.tag!==`?`||e.dump&&e.dump.length>1024;u&&(e.dump&&e.dump.charCodeAt(0)===10?o+=`?`:o+=`? `),o+=e.dump,u&&(o+=p(e,n)),M(e,n+1,l,!0,u)&&(e.dump&&e.dump.charCodeAt(0)===10?o+=`:`:o+=`: `,o+=e.dump,a+=o)}e.tag=o,e.dump=a||`{}`}function j(e,n,a){let o=a?e.explicitTypes:e.implicitTypes;for(let s=0,c=o.length;s<c;s+=1){let c=o[s];if((c.instanceOf||c.predicate)&&(!c.instanceOf||typeof n==`object`&&n instanceof c.instanceOf)&&(!c.predicate||c.predicate(n))){if(e.tag=a?c.multi&&c.representName?c.representName(n):c.tag:`?`,c.represent){let a=e.styleMap[c.tag]||c.defaultStyle,o;if(r.call(c.represent)===`[object Function]`)o=c.represent(n,a);else if(i.call(c.represent,a))o=c.represent[a](n,a);else throw new t(`!<`+c.tag+`> tag resolver accepts not "`+a+`" style`);e.dump=o}return!0}}return!1}function M(e,n,i,a,o,s,c){e.tag=null,e.dump=i,j(e,i,!1)||j(e,i,!0);let l=r.call(e.dump),u=a;a&&=e.flowLevel<0||e.flowLevel>n;let d=l===`[object Object]`||l===`[object Array]`,f,p;if(d&&(f=e.duplicates.indexOf(i),p=f!==-1),(e.tag!==null&&e.tag!==`?`||p||e.indent!==2&&n>0)&&(o=!1),p&&e.usedDuplicates[f])e.dump=`*ref_`+f;else{if(d&&p&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),l===`[object Object]`)a&&Object.keys(e.dump).length!==0?(ne(e,n,e.dump,o),p&&(e.dump=`&ref_`+f+e.dump)):(te(e,n,e.dump),p&&(e.dump=`&ref_`+f+` `+e.dump));else if(l===`[object Array]`)a&&e.dump.length!==0?(e.noArrayIndent&&!c&&n>0?A(e,n-1,e.dump,o):A(e,n,e.dump,o),p&&(e.dump=`&ref_`+f+e.dump)):(k(e,n,e.dump),p&&(e.dump=`&ref_`+f+` `+e.dump));else if(l===`[object String]`)e.tag!==`?`&&w(e,e.dump,n,s,u);else if(l===`[object Undefined]`)return!1;else{if(e.skipInvalid)return!1;throw new t(`unacceptable kind of an object to dump `+l)}if(e.tag!==null&&e.tag!==`?`){let t=encodeURI(e.tag[0]===`!`?e.tag.slice(1):e.tag).replace(/!/g,`%21`);t=e.tag[0]===`!`?`!`+t:t.slice(0,18)===`tag:yaml.org,2002:`?`!!`+t.slice(18):`!<`+t+`>`,e.dump=t+` `+e.dump}}return!0}function re(e,t){let n=[],r=[];N(e,n,r);let i=r.length;for(let e=0;e<i;e+=1)t.duplicates.push(n[r[e]]);t.usedDuplicates=Array(i)}function N(e,t,n){if(typeof e==`object`&&e){let r=t.indexOf(e);if(r!==-1)n.indexOf(r)===-1&&n.push(r);else if(t.push(e),Array.isArray(e))for(let r=0,i=e.length;r<i;r+=1)N(e[r],t,n);else{let r=Object.keys(e);for(let i=0,a=r.length;i<a;i+=1)N(e[r[i]],t,n)}}}function P(e,t){t||={};let n=new d(t);n.noRefs||re(e,n);let r=e;return n.replacer&&(r=n.replacer.call({"":r},``,r)),M(n,0,r,!0,!0)?n.dump+`
34
+ `:``}return lt.dump=P,lt}var ft;function pt(){if(ft)return I;ft=1;let e=ct(),t=dt();function n(e,t){return function(){throw Error(`Function yaml.`+e+` is removed in js-yaml 4. Use yaml.`+t+` instead, which is now safe by default.`)}}return I.Type=G(),I.Schema=q(),I.FAILSAFE_SCHEMA=Se(),I.JSON_SCHEMA=Le(),I.CORE_SCHEMA=ze(),I.DEFAULT_SCHEMA=ot(),I.load=e.load,I.loadAll=e.loadAll,I.dump=t.dump,I.YAMLException=H(),I.types={binary:Je(),float:Pe(),map:ye(),null:Te(),pairs:et(),set:rt(),timestamp:He(),bool:Oe(),int:je(),merge:Ge(),omap:Ze(),seq:ve(),str:ge()},I.safeLoad=n(`safeLoad`,`load`),I.safeLoadAll=n(`safeLoadAll`,`loadAll`),I.safeDump=n(`safeDump`,`dump`),I}var{Type:mt,Schema:ht,FAILSAFE_SCHEMA:gt,JSON_SCHEMA:_t,CORE_SCHEMA:vt,DEFAULT_SCHEMA:yt,load:bt,loadAll:xt,dump:St,YAMLException:Ct,types:wt,safeLoad:Tt,safeLoadAll:Et,safeDump:Dt}=ce(pt()),Ot=3e3,kt=9999,At=`openpond.yaml`,jt=[`google`,`github`,`x`],Mt=new Set([22,2222,2375,2376,3108,5900,5901,6080,7818]),Nt=i(d().trim().min(1).max(1e3)).max(50),Pt=d().trim().min(1).max(4096).refine(nn,{message:`path must be a relative workspace path`}),Ft=d().trim().min(1).max(500).refine(e=>!e.includes(`\0`)&&!/\s/.test(e),`image ref must be a single OCI reference`),It=d().trim().regex(/^sha256:[0-9a-f]{64}$/i),Lt=d().trim().min(1).max(500).refine(e=>e.startsWith(`/`)&&!e.includes(`\0`),`workspaceRoot must be an absolute guest path`),Rt=s({ref:Ft,digest:It.optional(),registrySecretRef:d().trim().min(1).max(500).optional(),platform:a(`linux/amd64`).optional(),workspaceRoot:Lt.optional()}).strict(),zt=s({context:Pt.default(`.`),path:Pt.default(`Dockerfile`),target:d().trim().min(1).max(191).optional(),buildArgs:o(d().max(191),d().max(500)).optional(),registrySecretRefs:i(d().trim().min(1).max(500)).max(10).optional(),platform:a(`linux/amd64`).optional(),workspaceRoot:Lt.optional()}).strict(),Bt=s({base:d().trim().min(1).max(120).optional(),snapshot:d().trim().min(1).max(191).optional(),image:Rt.optional(),dockerfile:zt.optional()}).strict().superRefine((e,t)=>{[e.base,e.snapshot,e.image,e.dockerfile].filter(Boolean).length!==1&&t.addIssue({code:F.custom,message:`runtime must declare exactly one of base, snapshot, image, or dockerfile`})}),Vt=s({cpu:l().positive().max(8).optional(),memoryGb:l().positive().max(32).optional(),diskGb:l().positive().max(100).optional()}).strict(),Ht=s({provider:u(jt),scopes:i(d().trim().min(1).max(200)).max(100).default([]),capabilities:i(d().trim().min(1).max(200)).max(100).default([])}).strict(),Ut=s({models:i(d().trim().min(1).max(200)).max(100).default([]),scopes:i(d().trim().min(1).max(200)).max(100).default([])}).strict(),Wt=s({opchat:Ut.optional()}).catchall(o(d(),r())).default({}),Gt=s({name:d().trim().regex(/^[A-Za-z_][A-Za-z0-9_-]*$/).max(63).optional(),mountPath:d().trim().min(1).max(256).optional(),storageGb:l().int().positive().max(100).optional(),deleteOnSandboxDelete:c().optional()}).strict(),Kt=s({port:l().int().min(Ot).max(kt).refine(e=>!Mt.has(e),{message:`preview port is reserved`}),protocol:a(`http`).default(`http`),label:d().trim().min(1).max(80).optional(),access:u([`private`,`public`]).default(`private`),path:d().trim().min(1).max(512).refine(e=>e.startsWith(`/`),{message:`preview path must start with /`}).default(`/`)}).strict(),qt=s({command:d().trim().min(1).max(1e3),cwd:Pt.optional(),timeoutSeconds:l().int().positive().max(86400).optional(),requiresStart:c().default(!1),ports:i(Kt).max(20).default([]),artifactPaths:i(Pt).max(100).default([])}).strict(),Jt=qt.extend({name:d().trim().min(1).max(80)}).strict(),Yt=s({name:d().trim().min(1).max(80).optional(),service:d().trim().min(1).max(80).optional(),port:l().int().min(Ot).max(kt).refine(e=>!Mt.has(e),{message:`app MCP port is reserved`}),path:d().trim().min(1).max(512).refine(e=>e.startsWith(`/`),{message:`app MCP path must start with /`}).default(`/mcp`)}).strict(),Xt=s({name:d().trim().min(1).max(80).optional(),port:l().int().min(Ot).max(kt).refine(e=>!Mt.has(e),{message:`validation probe port is reserved`}),path:d().trim().min(1).max(512).refine(e=>e.startsWith(`/`),{message:`validation probe path must start with /`}).default(`/`),expectedStatus:l().int().min(100).max(599).default(200)}).strict(),Zt=o(d(),r()).refine(e=>e.type===`object`,`input schema must be a JSON schema object`),Qt=s({name:d().trim().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(191),required:c().default(!1),secret:c().default(!0),description:d().trim().max(500).optional()}).strict(),$t=d().trim().min(1).max(120),en=s({name:d().trim().min(1).max(120),description:d().trim().max(500).optional(),cron:d().trim().min(1).max(500).optional(),rate:d().trim().min(1).max(500).optional(),once:$t.optional(),scheduleType:u([`rate`,`cron`,`once`]).optional(),scheduleExpression:d().trim().min(1).max(500).optional(),timezone:d().trim().min(1).max(100).optional(),enabled:c().default(!0),startAt:$t.optional(),endAt:$t.optional(),maxRuns:l().int().positive().nullable().optional(),runtimePolicy:u([`run_and_stop`,`run_and_archive`,`run_and_delete`,`use_existing_running`]).default(`run_and_stop`),action:d().trim().min(1).max(120).optional(),actionName:d().trim().min(1).max(120).optional(),command:d().trim().min(1).max(2e3).optional(),target:s({kind:u([`start`,`action`,`service`,`command`]).optional(),name:d().trim().min(1).max(120).optional(),actionName:d().trim().min(1).max(120).optional(),command:d().trim().min(1).max(2e3).optional(),requiresStart:c().optional()}).strict().optional(),requiresStart:c().optional(),budget:s({maxUsd:d().trim().min(1).max(40).optional()}).strict().optional(),resources:Vt.optional(),quotas:o(d(),r()).optional(),lifecycle:o(d(),r()).optional(),retentionPolicy:o(d(),r()).optional(),env:i(s({name:d().trim().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(191),value:d().optional(),secretRef:d().optional()}).strict()).max(100).optional(),integrationLeases:i(o(d(),r())).max(20).optional(),metadata:o(d(),r()).optional()}).strict().superRefine((e,t)=>{[e.cron,e.rate,e.once,e.scheduleExpression].filter(e=>typeof e==`string`&&e.trim()).length!==1&&t.addIssue({code:F.custom,path:[`scheduleExpression`],message:`schedule must declare exactly one of cron, rate, once, or scheduleExpression`}),e.scheduleExpression&&!e.scheduleType&&t.addIssue({code:F.custom,path:[`scheduleType`],message:`scheduleType is required with scheduleExpression`});let n=e.command??e.target?.command??null,r=e.target?.name??null,i=e.actionName??e.action??e.target?.actionName??(e.target?.kind===`action`?r:null),a=e.target?.kind??(n?`command`:`action`);a===`action`&&!i&&t.addIssue({code:F.custom,path:[`action`],message:`schedule action target is required`}),a===`service`&&!r&&t.addIssue({code:F.custom,path:[`target`,`name`],message:`schedule service target name is required`}),a===`command`&&!n&&t.addIssue({code:F.custom,path:[`command`],message:`schedule command target is required`})});s({schemaVersion:a(1),name:d().trim().min(1).max(80).regex(/^[a-z0-9][a-z0-9-]*[a-z0-9]$/),version:d().trim().min(1).max(40),useCase:d().trim().min(1).max(80),description:d().trim().min(1).max(500),runtime:Bt,resources:Vt.optional(),setup:s({commands:Nt.default([])}).strict().default({commands:[]}),validation:s({commands:Nt.min(1),probes:i(Xt).max(20).default([])}).strict(),start:qt,actions:i(Jt).max(20).default([]),services:i(Jt).max(20).default([]),schedules:i(en).max(20).default([]),mcp:s({endpoints:i(Yt).max(10).default([])}).strict().default({endpoints:[]}),volumes:i(Gt).max(5).default([]),integrations:s({requiredLeases:i(Ht).max(20).default([])}).strict().default({requiredLeases:[]}),permissions:Wt,inputs:s({schema:Zt.default({type:`object`}),env:i(Qt).max(100).default([])}).strict().default({schema:{type:`object`},env:[]}),artifacts:s({paths:i(Pt).max(100).default([])}).strict().default({paths:[]}),network:s({egress:u([`restricted`,`allow`,`block`]).default(`restricted`)}).strict().default({egress:`restricted`})}).strict().superRefine((e,t)=>{an(e,t),rn(t,e.volumes.flatMap(e=>e.name?[e.name]:[]),`volume names must be unique`,`volumes`),on(e,t),sn(e,t),cn(e,t),ln(e,t)}),s({path:d(),message:d(),code:d()});function tn(e){return[{kind:`start`,name:`start`,...e.start,artifactPaths:dn(e.start,e)},...e.actions.map(t=>({kind:`action`,name:t.name,command:t.command,cwd:t.cwd,timeoutSeconds:t.timeoutSeconds,requiresStart:t.requiresStart,ports:t.ports,artifactPaths:dn(t,e)})),...e.services.map(t=>({kind:`service`,name:t.name,command:t.command,cwd:t.cwd,timeoutSeconds:t.timeoutSeconds,requiresStart:t.requiresStart,ports:t.ports,artifactPaths:dn(t,e)}))]}function nn(e){return!e.includes(`\0`)&&!e.startsWith(`/`)&&!e.split(/[\\/]+/).some(e=>e===`..`||e===``)}function rn(e,t,n,r){let i=new Set;for(let a of t){if(i.has(a)){e.addIssue({code:F.custom,path:[r],message:n});return}i.add(a)}}function an(e,t){rn(t,[`start`,...e.actions.map(e=>e.name),...e.services.map(e=>e.name)],`start, action, and service names must be unique`,`actions`)}function on(e,t){let n=un(e.inputs.schema.properties),r=new Set(e.volumes.map(e=>e.name).filter(e=>!!e));for(let[e,i]of Object.entries(n)){let n=un(i),a=un(n[`x-openpond-upload`]??n.xOpenPondUpload),o=typeof a.targetPath==`string`&&a.targetPath.trim()?a.targetPath.trim():typeof a.path==`string`&&a.path.trim()?a.path.trim():``;if(!o)continue;let s=o.replace(/^workspace\//,``).replace(/^\/+/,``).replace(/\/+$/,``);if(!nn(s)){t.addIssue({code:F.custom,path:[`inputs`,`schema`,`properties`,e,`x-openpond-upload`,`targetPath`],message:`upload target must be a relative workspace path`});continue}let c=s.split(`/`);c[0]===`volumes`&&(!c[1]||!r.has(c[1]))&&t.addIssue({code:F.custom,path:[`inputs`,`schema`,`properties`,e,`x-openpond-upload`,`targetPath`],message:`upload target references an undeclared volume`})}}function sn(e,t){rn(t,e.inputs.env.map(e=>e.name),`env input names must be unique`,`inputs`)}function cn(e,t){let n=new Map(e.services.map(e=>[e.name,new Set(e.ports.map(e=>e.port))])),r=new Set([...e.start.ports.map(e=>e.port),...e.services.flatMap(e=>e.ports.map(e=>e.port))]);for(let[i,a]of e.mcp.endpoints.entries())if(a.service){let e=n.get(a.service);if(!e){t.addIssue({code:F.custom,path:[`mcp`,`endpoints`,i,`service`],message:`app MCP service does not exist: ${a.service}`});continue}e.has(a.port)||t.addIssue({code:F.custom,path:[`mcp`,`endpoints`,i,`port`],message:`app MCP port ${a.port} is not declared on service ${a.service}`})}else r.has(a.port)||t.addIssue({code:F.custom,path:[`mcp`,`endpoints`,i,`port`],message:`app MCP port ${a.port} is not declared on start or services`})}function ln(e,t){let n=new Set(e.actions.map(e=>e.name)),r=new Set(e.services.map(e=>e.name));for(let[i,a]of e.schedules.entries()){let e=a.command??a.target?.command??null;if(a.target?.kind===`command`||e)continue;let o=a.actionName??a.action??a.target?.actionName??(a.target?.kind===`action`?a.target?.name:null);if(o&&!n.has(o)&&t.addIssue({code:F.custom,path:[`schedules`,i,`action`],message:`schedule action target does not exist: ${o}`}),a.target?.kind===`service`){let e=a.target.name??``;e&&!r.has(e)&&t.addIssue({code:F.custom,path:[`schedules`,i,`target`,`name`],message:`schedule service target does not exist: ${e}`})}}}function un(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function dn(e,t){return e.artifactPaths.length>0?e.artifactPaths:t.artifacts.paths}var fn=f(`hammer`,[[`path`,{d:`m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9`,key:`1hayfq`}],[`path`,{d:`m18 15 4-4`,key:`16gjal`}],[`path`,{d:`m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5`,key:`15ts47`}]]),Q=e(t(),1);function pn(e){let t=Fn(Fn(e?.data).preview);return(typeof t.url==`string`?t.url.trim():``)||null}function mn(){let e=window.open(``,`_blank`);return e?(e.document.write(`<!doctype html><html data-theme="${j()}"><head><title>Opening sandbox preview</title><style>${E}</style></head><body style="margin:0;background:var(--surface-page);color:var(--text-primary);font:14px system-ui,sans-serif;display:grid;place-items:center;height:100vh;">Opening sandbox preview...</body></html>`),e.document.close(),e):null}function hn(e,t){t?e?(e.opener=null,e.location.href=t):window.open(t,`_blank`,`noopener,noreferrer`):e?.close()}function gn(e){let t=vn(e),n=yn(Fn(e?.resources)),r=Fn(Fn(e?.inputs).schema),i=Fn(r.properties),a=new Set(Nn(r.required)),o=[],s=[];for(let[e,t]of Object.entries(i)){let n=Fn(t),r=Fn(n[`x-openpond-upload`]??n.xOpenPondUpload),i=typeof n.type==`string`?n.type:`string`,c=Fn(n.items),l=Dn(n,r),u=n.format===`file`||r.enabled===!0||i===`array`&&c.format===`file`,d=typeof n.title==`string`&&n.title.trim()?n.title.trim():Pn(e);u?s.push({name:e,label:d,required:a.has(e),multiple:i===`array`||r.multiple===!0,accept:On(r,n),targetPath:kn(r,e),targetNames:l}):(i===`string`||i===`number`||i===`integer`||i===`boolean`)&&o.push({name:e,label:d,required:a.has(e),type:i,defaultValue:typeof n.default==`string`||typeof n.default==`number`||typeof n.default==`boolean`?String(n.default):``,targetNames:l})}return{entrypoints:t,scalarInputs:o,fileInputs:s,envInputs:xn(e),resources:n,volumes:bn(e,s),schedules:Sn(e)}}function _n(e,t){let n=t.trim();return e.filter(e=>!e.targetNames||e.targetNames.length===0||e.targetNames.includes(n))}function vn(e){return e?tn(e).flatMap(e=>{if(e.kind===`action`)return[];let t=e.name.trim(),n=e.command.trim(),r=jn(e.timeoutSeconds),i=e.ports.flatMap(e=>{let t=jn(e.port);return t?[{port:t,label:typeof e.label==`string`&&e.label.trim()?e.label.trim():`web`,access:e.access===`public`?`public`:`private`,path:typeof e.path==`string`&&e.path.trim()?e.path.trim():`/`}]:[]});return t&&n?[{name:t,command:n,timeoutSeconds:r,ports:i}]:[]}):[]}function yn(e){return{cpu:An(e.cpu)??1,memoryGb:An(e.memoryGb)??1,diskGb:An(e.diskGb)??8}}function bn(e,t){let n=Array.isArray(e?.volumes)?e.volumes:[];if(n.length>0)return n.map((e,t)=>{let n=t===0?`volume`:`volume-${t+1}`,r=typeof e.name==`string`&&e.name.trim()?e.name.trim():n;return{name:r,mountPath:typeof e.mountPath==`string`&&e.mountPath.trim()?e.mountPath.trim():`/workspace/volumes/${r}`,...jn(e.storageGb)?{storageGb:jn(e.storageGb)??void 0}:{},deleteOnSandboxDelete:e.deleteOnSandboxDelete===!0}});let r=t.find(e=>e.targetPath.startsWith(`volumes/`));if(!r)return[];let[,i=`volume`]=r.targetPath.split(`/`);return[{name:i,mountPath:`/workspace/volumes/${i}`,storageGb:8,deleteOnSandboxDelete:!1}]}function xn(e){return(Array.isArray(e?.inputs.env)?e.inputs.env:[]).flatMap(e=>{let t=typeof e.name==`string`?e.name.trim():``;return t?[{name:t,required:e.required===!0,secret:e.secret!==!1,description:typeof e.description==`string`?e.description.trim():``}]:[]})}function Sn(e){return e?.schedules?.length?e.schedules.flatMap(t=>{let n=typeof t.name==`string`?t.name.trim():``,r=Cn(t);if(!n||!r.scheduleExpression)return[];try{return[{name:n,...typeof t.description==`string`&&t.description.trim()?{description:t.description.trim()}:{},enabled:!1,...r,...typeof t.timezone==`string`&&t.timezone.trim()?{timezone:t.timezone.trim()}:{},...typeof t.startAt==`string`&&t.startAt.trim()?{startAt:t.startAt.trim()}:{},...typeof t.endAt==`string`&&t.endAt.trim()?{endAt:t.endAt.trim()}:{},...typeof t.maxRuns==`number`&&Number.isInteger(t.maxRuns)&&t.maxRuns>0?{maxRuns:t.maxRuns}:{},runtimePolicy:t.runtimePolicy,target:wn(e,t),...t.budget?{budget:t.budget}:{},...t.resources?{resources:t.resources}:{},...t.quotas?{quotas:t.quotas}:{},...t.lifecycle?{lifecycle:t.lifecycle}:{},...t.retentionPolicy?{retentionPolicy:t.retentionPolicy}:{},...t.env?{env:t.env}:{},...t.integrationLeases?{integrationLeases:t.integrationLeases}:{},metadata:{...Fn(t.metadata),manifestScheduleName:n,source:`openpond-app-sandbox-template-start`}}]}catch{return[]}}):[]}function Cn(e){return e.scheduleExpression?{scheduleType:e.scheduleType??`cron`,scheduleExpression:e.scheduleExpression}:e.rate?{scheduleType:`rate`,scheduleExpression:/^rate\(/i.test(e.rate)?e.rate:`rate(${e.rate})`}:e.once?{scheduleType:`once`,scheduleExpression:/^at\(/i.test(e.once)?e.once:`at(${e.once})`}:{scheduleType:`cron`,scheduleExpression:e.cron??``}}function wn(e,t){let n=t.command??t.target?.command??null;if(n)return{kind:`command`,command:n,requiresStart:t.requiresStart??t.target?.requiresStart??!1};let r=t.target?.kind??`action`;if(r===`start`)return{kind:`command`,command:e.start.command,requiresStart:t.requiresStart??t.target?.requiresStart??e.start.requiresStart??!1};if(r===`service`){let n=t.target?.name??``,r=e.services.find(e=>e.name===n);if(!r)throw Error(`schedule_service_target_missing`);return{kind:`command`,command:r.command,requiresStart:t.requiresStart??t.target?.requiresStart??r.requiresStart??!1}}let i=t.actionName??t.action??t.target?.actionName??(t.target?.kind===`action`?t.target?.name:void 0),a=e.actions.find(e=>e.name===i);if(!a)throw Error(`schedule_action_target_missing`);return{kind:`command`,command:a.command,requiresStart:t.requiresStart??t.target?.requiresStart??a.requiresStart??!1}}function Tn(e,t){return e.flatMap(e=>{let n=(t[e.name]??``).trim();return n?[{name:e.name,secretRef:n}]:[]})}function En(e,t){let n={};for(let r of e){let e=t[r.name]??``;if(e.trim()||r.required){if(r.type===`boolean`)n[r.name]=e===`true`;else if(r.type===`number`||r.type===`integer`){let t=Number(e);Number.isFinite(t)&&(n[r.name]=r.type===`integer`?Math.trunc(t):t)}else n[r.name]=e}}return n}function Dn(e,t){let n=Nn(e[`x-openpond-targets`]??e.xOpenPondTargets??t.targets??t.actions).map(e=>e.trim()).filter(Boolean);return n.length>0?[...new Set(n)]:null}function On(e,t){return typeof e.accept==`string`?e.accept.trim():Array.isArray(e.accept)?e.accept.filter(e=>typeof e==`string`).join(`,`):typeof t.accept==`string`?t.accept.trim():``}function kn(e,t){return(typeof e.targetPath==`string`&&e.targetPath.trim()?e.targetPath.trim():typeof e.path==`string`&&e.path.trim()?e.path.trim():`uploads/${t}`).replace(/^\/+/,``).replace(/^workspace\//,``).replace(/\/+$/,``)}function An(e){let t=Number(e);return Number.isFinite(t)&&t>0?t:null}function jn(e){let t=Number(e);return Number.isInteger(t)&&t>0?t:null}function Mn(e,t){return[t,...e.slice(1)]}function Nn(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function Pn(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[-_]+/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function Fn(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}var $=n();function In({busy:e,defaultRepoUrl:t,projectName:n,commitBeforeCreate:r,templateManifest:i,uploadBeforeCreate:a,onClose:o,onSubmit:s}){let c=(0,Q.useMemo)(()=>gn(i),[i]),l=c.entrypoints[0]??null,[u,d]=(0,Q.useState)(t),[f,p]=(0,Q.useState)(l?.name??``),[h,g]=(0,Q.useState)(l?.command??``),[_,v]=(0,Q.useState)(l?.timeoutSeconds?String(l.timeoutSeconds):``),[y,b]=(0,Q.useState)(`Update ${n}`),[x,S]=(0,Q.useState)(`0.05`),[w,T]=(0,Q.useState)(()=>Object.fromEntries(c.scalarInputs.map(e=>[e.name,e.defaultValue]))),[E,D]=(0,Q.useState)(()=>Object.fromEntries(c.envInputs.map(e=>[e.name,``]))),[O,ee]=(0,Q.useState)({}),k=c.volumes[0]??null,[A,te]=(0,Q.useState)(c.volumes.length>0||c.fileInputs.length>0),[ne,j]=(0,Q.useState)(k?.name??`volume`),[M,re]=(0,Q.useState)(k?.mountPath??`/workspace/volumes/volume`),[N,P]=(0,Q.useState)(String(k?.storageGb??8)),[ie,ae]=(0,Q.useState)(!(k?.deleteOnSandboxDelete??!1)),[F,se]=(0,Q.useState)(c.schedules),ce=c.entrypoints.find(e=>e.name===f)??l,I=ce?.ports??[],L=I[0]??null,[R,z]=(0,Q.useState)(!!L),[B,le]=(0,Q.useState)(L?String(L.port):``),V=Number(B),H=Number(x),U=Number(N),ue=Number(_),de=!_.trim()||Number.isInteger(ue)&&ue>0&&ue<=86400,W=!R||Number.isInteger(V)&&V>=3e3&&V<=9999&&I.some(e=>e.port===V),fe=Number.isFinite(H)&&H>0,G=!A||Number.isInteger(U)&&U>0,pe=F.every(e=>!e.enabled||!!e.scheduleExpression.trim()),K=_n(c.scalarInputs,f),q=_n(c.fileInputs,f),me=c.envInputs.every(e=>!e.required||!!(E[e.name]??``).trim()),he=c.envInputs.filter(e=>e.required&&!(E[e.name]??``).trim()),ge=(a||!!u.trim())&&!!h.trim()&&fe&&de&&G&&K.every(e=>!e.required||!!(w[e.name]??``).trim())&&q.every(e=>!e.required||(O[e.name]?.length??0)>0)&&me&&pe&&W;function _e(e){p(e);let t=c.entrypoints.find(t=>t.name===e);if(!t)return;g(t.command),v(t.timeoutSeconds?String(t.timeoutSeconds):``);let n=t.ports[0]??null;le(n?String(n.port):``),z(!!n)}function J(e,t){T(n=>({...n,[e]:t}))}function ve(e,t){D(n=>({...n,[e]:t}))}function Y(e,t){let n=Array.from(t.target.files??[]);ee(t=>({...t,[e.name]:e.multiple?n:n.slice(0,1)}))}function X(e,t){se(n=>n.map((n,r)=>r===e?{...n,...t}:n))}function ye(t){t.preventDefault(),ge&&!e&&s({repoUrl:u.trim(),command:h.trim(),entrypointName:f,commitMessage:y.trim(),budgetUsd:x.trim(),params:En(K,w),env:Tn(c.envInputs,E),timeoutSeconds:_.trim()&&Number.isInteger(ue)?ue:ce?.timeoutSeconds??null,uploads:q.flatMap(e=>{let t=O[e.name]??[];return t.length>0?[{inputName:e.name,label:e.label,targetPath:e.targetPath,multiple:e.multiple,files:t}]:[]}),resources:c.resources,volumes:A?Mn(c.volumes,{...ne.trim()?{name:ne.trim()}:{},...M.trim()?{mountPath:M.trim()}:{},...Number.isInteger(U)&&U>0?{storageGb:U}:{},deleteOnSandboxDelete:!ie}):[],schedules:F.filter(e=>e.enabled),openPreview:R,previewPort:R?V:null,previewLabel:I.find(e=>e.port===V)?.label??`web`,previewAccess:I.find(e=>e.port===V)?.access??`private`})}return(0,$.jsx)(`div`,{className:`git-dialog-backdrop`,role:`presentation`,children:(0,$.jsxs)(`form`,{className:`git-dialog run-once-dialog sandbox-start-dialog`,role:`dialog`,"aria-modal":`true`,"aria-label":`Start sandbox`,onSubmit:ye,children:[(0,$.jsx)(`button`,{className:`git-dialog-close`,disabled:e,type:`button`,title:`Close`,"aria-label":`Close`,onClick:o,children:(0,$.jsx)(C,{size:15})}),(0,$.jsxs)(`div`,{className:`sandbox-start-dialog-heading`,children:[(0,$.jsx)(`div`,{className:`git-dialog-icon`,children:(0,$.jsx)(oe,{size:18})}),(0,$.jsx)(`h2`,{children:`Start sandbox`}),(0,$.jsxs)(`div`,{className:`git-dialog-row`,children:[(0,$.jsx)(`span`,{children:`Project`}),(0,$.jsx)(`strong`,{children:n})]})]}),(0,$.jsxs)(`div`,{className:`sandbox-start-dialog-body`,children:[a?null:(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:`Repository`}),(0,$.jsx)(`input`,{disabled:e,value:u,onChange:e=>d(e.target.value)})]}),r?(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:`Commit message`}),(0,$.jsx)(`input`,{disabled:e,value:y,onChange:e=>b(e.target.value)})]}):null,c.entrypoints.length>0?(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:`Run target`}),(0,$.jsx)(`select`,{disabled:e,value:f,onChange:e=>_e(e.target.value),children:c.entrypoints.map(e=>(0,$.jsx)(`option`,{value:e.name,children:e.name},e.name))})]}):null,(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:`Shell command`}),(0,$.jsx)(`input`,{disabled:e,value:h,onChange:e=>g(e.target.value)})]}),(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:`Timeout seconds`}),(0,$.jsx)(`input`,{disabled:e,inputMode:`numeric`,value:_,onChange:e=>v(e.target.value)})]}),K.map(t=>t.type===`boolean`?(0,$.jsxs)(`label`,{className:`git-dialog-toggle`,children:[(0,$.jsx)(`input`,{checked:(w[t.name]??``)===`true`,disabled:e,type:`checkbox`,onChange:e=>J(t.name,e.target.checked?`true`:`false`)}),(0,$.jsx)(`span`,{}),t.label]},t.name):(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:t.label}),(0,$.jsx)(`input`,{disabled:e,inputMode:t.type===`number`||t.type===`integer`?`decimal`:void 0,value:w[t.name]??``,onChange:e=>J(t.name,e.target.value)})]},t.name)),q.map(t=>(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:t.label}),(0,$.jsx)(`input`,{accept:t.accept||void 0,disabled:e,multiple:t.multiple,type:`file`,onChange:e=>Y(t,e)})]},t.name)),c.envInputs.length>0?(0,$.jsxs)(`div`,{className:`sandbox-start-env-section`,children:[(0,$.jsx)(`div`,{className:`sandbox-start-section-title`,children:`Environment`}),he.length>0?(0,$.jsxs)(`p`,{className:`sandbox-start-env-warning`,role:`status`,children:[`Required sandbox secret ref missing: `,he.map(e=>e.name).join(`, `)]}):null,c.envInputs.map(t=>{let n=E[t.name]??``,r=t.required&&!n.trim(),i=`sandbox-env-${t.name}-description`;return(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsxs)(`span`,{children:[t.name,t.required?` *`:``]}),(0,$.jsx)(`input`,{"aria-describedby":i,"aria-invalid":r,disabled:e,placeholder:`openpond://secret/...`,value:n,onChange:e=>ve(t.name,e.target.value)}),(0,$.jsx)(`small`,{id:i,children:r?`Add a sandbox secret ref before starting.`:t.description||`Sandbox secret ref only.`})]},t.name)})]}):null,q.length>0||c.volumes.length>0?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`label`,{className:`git-dialog-toggle`,children:[(0,$.jsx)(`input`,{checked:A,disabled:e,type:`checkbox`,onChange:e=>te(e.target.checked)}),(0,$.jsx)(`span`,{}),`Mount volume`]}),A?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`run-once-dialog-grid`,children:[(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:`Volume`}),(0,$.jsx)(`input`,{disabled:e,value:ne,onChange:e=>j(e.target.value)})]}),(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:`Storage GiB`}),(0,$.jsx)(`input`,{disabled:e,inputMode:`numeric`,value:N,onChange:e=>P(e.target.value)})]})]}),(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:`Mount path`}),(0,$.jsx)(`input`,{disabled:e,value:M,onChange:e=>re(e.target.value)})]}),(0,$.jsxs)(`label`,{className:`git-dialog-toggle`,children:[(0,$.jsx)(`input`,{checked:ie,disabled:e,type:`checkbox`,onChange:e=>ae(e.target.checked)}),(0,$.jsx)(`span`,{}),`Keep volume`]})]}):null]}):null,F.length>0?(0,$.jsxs)(`div`,{className:`sandbox-start-schedules`,children:[(0,$.jsx)(`div`,{className:`sandbox-start-section-title`,children:`Schedules`}),F.map((t,n)=>(0,$.jsxs)(`div`,{className:`sandbox-start-schedule-row`,children:[(0,$.jsxs)(`label`,{className:`git-dialog-toggle`,children:[(0,$.jsx)(`input`,{checked:t.enabled,disabled:e,type:`checkbox`,onChange:e=>X(n,{enabled:e.target.checked})}),(0,$.jsx)(`span`,{}),t.name]}),(0,$.jsxs)(`div`,{className:`run-once-dialog-grid`,children:[(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:`Type`}),(0,$.jsxs)(`select`,{disabled:e||!t.enabled,value:t.scheduleType,onChange:e=>X(n,{scheduleType:e.target.value}),children:[(0,$.jsx)(`option`,{value:`rate`,children:`Rate`}),(0,$.jsx)(`option`,{value:`cron`,children:`Cron`}),(0,$.jsx)(`option`,{value:`once`,children:`Once`})]})]}),(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:`Max runs`}),(0,$.jsx)(`input`,{disabled:e||!t.enabled,inputMode:`numeric`,value:t.maxRuns??``,onChange:e=>{let t=Number(e.target.value);X(n,{maxRuns:Number.isInteger(t)&&t>0?t:null})}})]})]}),(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:`Expression`}),(0,$.jsx)(`input`,{disabled:e||!t.enabled,value:t.scheduleExpression,onChange:e=>X(n,{scheduleExpression:e.target.value})})]})]},t.name))]}):null,(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:`Budget`}),(0,$.jsx)(`input`,{disabled:e,inputMode:`decimal`,value:x,onChange:e=>S(e.target.value)})]}),I.length>0?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`label`,{className:`git-dialog-toggle`,children:[(0,$.jsx)(`input`,{checked:R,disabled:e,type:`checkbox`,onChange:e=>z(e.target.checked)}),(0,$.jsx)(`span`,{}),`Open preview`]}),(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:`Preview port`}),(0,$.jsx)(`select`,{disabled:e||!R,value:B,onChange:e=>le(e.target.value),children:I.map(e=>(0,$.jsx)(`option`,{value:e.port,children:e.label?`${e.label} (${e.port})`:e.port},e.port))})]})]}):null]}),(0,$.jsxs)(`div`,{className:`git-dialog-footer sandbox-start-dialog-footer`,children:[(0,$.jsx)(`button`,{className:`git-dialog-secondary`,disabled:e,type:`button`,onClick:o,children:`Cancel`}),(0,$.jsxs)(`button`,{className:`git-dialog-primary`,disabled:e||!ge,title:me?void 0:`Required sandbox secret refs are missing.`,type:`submit`,children:[(0,$.jsx)(m,{size:14}),`Start`]})]})]})})}function Ln({busy:e,projectName:t,templateManifest:n,onClose:r,onSubmit:i}){let a=(0,Q.useMemo)(()=>gn(n),[n]),o=(0,Q.useMemo)(()=>n?tn(n).filter(e=>e.kind===`action`):[],[n]),s=o[0]??null,[c,l]=(0,Q.useState)(`sandbox`),[u,d]=(0,Q.useState)(s?.name??``),[f,p]=(0,Q.useState)(()=>Object.fromEntries(a.scalarInputs.map(e=>[e.name,e.defaultValue]))),[m,h]=(0,Q.useState)(()=>Object.fromEntries(a.envInputs.map(e=>[e.name,``]))),[g,_]=(0,Q.useState)({}),y=_n(a.scalarInputs,u),b=_n(a.fileInputs,u),x=c===`sandbox`?a.envInputs:[],S=y.every(e=>!e.required||!!(f[e.name]??``).trim()),w=b.every(e=>!e.required||(g[e.name]?.length??0)>0),T=x.every(e=>!e.required||!!(m[e.name]??``).trim()),E=x.filter(e=>e.required&&!(m[e.name]??``).trim()),D=!!u&&S&&w&&T;function O(e,t){p(n=>({...n,[e]:t}))}function ee(e,t){h(n=>({...n,[e]:t}))}function k(e,t,n){let r=Array.from(n.target.files??[]);_(n=>({...n,[e]:t?r:r.slice(0,1)}))}function A(t){t.preventDefault(),D&&!e&&i({mode:c,target:u,params:En(y,f),env:c===`sandbox`?Tn(x,m):[],uploads:b.flatMap(e=>{let t=g[e.name]??[];return t.length>0?[{inputName:e.name,label:e.label,targetPath:e.targetPath,multiple:e.multiple,files:t}]:[]})})}return(0,$.jsx)(`div`,{className:`git-dialog-backdrop`,role:`presentation`,children:(0,$.jsxs)(`form`,{className:`git-dialog run-once-dialog sandbox-start-dialog`,role:`dialog`,"aria-modal":`true`,"aria-label":`Run sandbox action`,onSubmit:A,children:[(0,$.jsx)(`button`,{className:`git-dialog-close`,disabled:e,type:`button`,title:`Close`,"aria-label":`Close`,onClick:r,children:(0,$.jsx)(C,{size:15})}),(0,$.jsxs)(`div`,{className:`sandbox-start-dialog-heading`,children:[(0,$.jsx)(`div`,{className:`git-dialog-icon`,children:(0,$.jsx)(v,{size:18})}),(0,$.jsx)(`h2`,{children:`Run action`}),(0,$.jsxs)(`div`,{className:`git-dialog-row`,children:[(0,$.jsx)(`span`,{children:`Project`}),(0,$.jsx)(`strong`,{children:t})]})]}),(0,$.jsxs)(`div`,{className:`sandbox-start-dialog-body`,children:[(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:`Action`}),(0,$.jsx)(`select`,{disabled:e||o.length===0,value:u,onChange:e=>d(e.target.value),children:o.map(e=>(0,$.jsx)(`option`,{value:e.name,children:e.name},e.name))})]}),(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:`Run on`}),(0,$.jsxs)(`select`,{disabled:e,value:c,onChange:e=>l(e.target.value===`local`?`local`:`sandbox`),children:[(0,$.jsx)(`option`,{value:`sandbox`,children:`Hosted sandbox (start/update)`}),(0,$.jsx)(`option`,{value:`local`,children:`Local machine`})]})]}),y.map(t=>t.type===`boolean`?(0,$.jsxs)(`label`,{className:`git-dialog-toggle`,children:[(0,$.jsx)(`input`,{checked:(f[t.name]??``)===`true`,disabled:e,type:`checkbox`,onChange:e=>O(t.name,e.target.checked?`true`:`false`)}),(0,$.jsx)(`span`,{}),t.label]},t.name):(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:t.label}),(0,$.jsx)(`input`,{disabled:e,inputMode:t.type===`number`||t.type===`integer`?`decimal`:void 0,value:f[t.name]??``,onChange:e=>O(t.name,e.target.value)})]},t.name)),b.map(t=>(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsx)(`span`,{children:t.label}),(0,$.jsx)(`input`,{accept:t.accept||void 0,disabled:e,multiple:t.multiple,type:`file`,onChange:e=>k(t.name,t.multiple,e)})]},t.name)),x.length>0?(0,$.jsxs)(`div`,{className:`sandbox-start-env-section`,children:[(0,$.jsx)(`div`,{className:`sandbox-start-section-title`,children:`Environment`}),E.length>0?(0,$.jsxs)(`p`,{className:`sandbox-start-env-warning`,role:`status`,children:[`Required sandbox secret ref missing: `,E.map(e=>e.name).join(`, `)]}):null,x.map(t=>{let n=m[t.name]??``,r=t.required&&!n.trim(),i=`sandbox-action-env-${t.name}-description`;return(0,$.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,$.jsxs)(`span`,{children:[t.name,t.required?` *`:``]}),(0,$.jsx)(`input`,{"aria-describedby":i,"aria-invalid":r,disabled:e,placeholder:`openpond://secret/...`,value:n,onChange:e=>ee(t.name,e.target.value)}),(0,$.jsx)(`small`,{id:i,children:r?`Add a sandbox secret ref before running.`:t.description||`Sandbox secret ref only.`})]},t.name)})]}):null]}),(0,$.jsxs)(`div`,{className:`git-dialog-footer sandbox-start-dialog-footer`,children:[(0,$.jsx)(`button`,{className:`git-dialog-secondary`,disabled:e,type:`button`,onClick:r,children:`Cancel`}),(0,$.jsxs)(`button`,{className:`git-dialog-primary`,disabled:e||!D,title:T?void 0:`Required sandbox secret refs are missing.`,type:`submit`,children:[(0,$.jsx)(v,{size:14}),`Run`]})]})]})})}function Rn(e,t){let n=e.trim().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`agent`;return t===`cron`?`name: ${n}\nversion: 0.1.0\nuseCase: scheduled_report\nstart:\n command: pnpm report\nschedules:\n - name: daily-report\n command: pnpm report\n cron: \"0 9 * * *\"`:t===`background`?`name: ${n}\nversion: 0.1.0\nuseCase: background_worker\nstart:\n command: pnpm worker\nservices:\n - name: worker\n command: pnpm worker`:t===`resources`?`name: ${n}\nversion: 0.1.0\nuseCase: resource_profile\nresources:\n cpu: 1\n memoryGb: 2\n diskGb: 16\nstart:\n command: pnpm start`:`name: ${n}\nversion: 0.1.0\nuseCase: action\nstart:\n command: pnpm start\nactions:\n - name: hello\n command: pnpm hello`}function zn(e,t){return t||(e===`missing_config`?`${At} missing`:e===`needs_project`?`Local config is ready`:e===`needs_sync`?`Project needs manifest sync`:e===`needs_agent`?`Project is synced`:e===`ready`?`Agent is ready`:`Setup unavailable`)}function Bn(e){return e?.source===`openpond`?`OpenPond Git`:e?.source===`github`?`GitHub`:e?.source===`local_git`?`Local Git`:e?.source===`local_folder`?`Local folder`:`Workspace`}function Vn(e){let t=$n($n(e.data).remote);return(typeof t.remoteUrl==`string`?t.remoteUrl.trim():``)||null}function Hn(e){let t=$n($n(e.data).sandbox);return(typeof t.id==`string`?t.id.trim():``)||null}function Un(e){return e?typeof e.metadata?.name==`string`&&e.metadata.name.trim()?e.metadata.name.trim():e.projectId?`Project sandbox ${tr(e.id)}`:e.agentId?`Agent sandbox ${tr(e.id)}`:`Sandbox ${tr(e.id)}`:null}function Wn(e,t){return{sourceSandboxId:t,name:e.name,...e.description?{description:e.description}:{},scheduleType:e.scheduleType,scheduleExpression:e.scheduleExpression,enabled:!0,...e.timezone?{timezone:e.timezone}:{},...e.startAt?{startAt:e.startAt}:{},...e.endAt?{endAt:e.endAt}:{},...e.maxRuns===void 0?{}:{maxRuns:e.maxRuns},...e.runtimePolicy?{runtimePolicy:e.runtimePolicy}:{},target:e.target,...e.budget?{budget:e.budget}:{},...e.resources?{resources:e.resources}:{},...e.quotas?{quotas:e.quotas}:{},...e.lifecycle?{lifecycle:e.lifecycle}:{},...e.retentionPolicy?{retentionPolicy:e.retentionPolicy}:{},...e.env?{env:e.env}:{},...e.integrationLeases?{integrationLeases:e.integrationLeases}:{},metadata:e.metadata??{},managementSource:`openpond.yaml`,manifestPath:At}}function Gn(e){let t=e?.gitOwner?.trim()??``,n=e?.gitRepo?.trim()??``,r=e?.gitHost?.trim()??``;if(!t||!n||!r)return null;let i=n.endsWith(`.git`)?n:`${n}.git`;return/^https?:\/\//i.test(r)?`${r.replace(/\/+$/,``)}/${t}/${i}`:`https://${r.replace(/\/+$/,``)}/${t}/${i}`}function Kn(e,t){let n=t.trim();if(e===`github_repo`){let[e,t]=n.replace(/^https:\/\/github\.com\//i,``).replace(/^git@github\.com:/i,``).replace(/\.git$/i,``).split(`/`).filter(Boolean);return{gitHost:`github.com`,gitOwner:e??null,gitRepo:t??null,internalRepoPath:null,templateRepoUrl:null}}return e===`internal_repo`?{gitHost:`openpond.ai`,gitOwner:null,gitRepo:n.split(`/`).filter(Boolean).at(-1)??null,internalRepoPath:n||null,templateRepoUrl:null}:e===`template`?{gitHost:null,gitOwner:null,gitRepo:null,internalRepoPath:null,templateRepoUrl:n||null}:{gitHost:null,gitOwner:null,gitRepo:null,internalRepoPath:null,templateRepoUrl:null}}function qn(e,t){let n=e.trim().replace(/^\/+/,``).replace(/^workspace\//,``).replace(/\/+$/,``),r=t.trim().replace(/[/\\]+/g,`-`).replace(/[^A-Za-z0-9._-]+/g,`-`).replace(/^-+|-+$/g,``)||`upload`;return`${n||`uploads`}/${r}`}function Jn(e,t){return`OPENPOND_REPLAY_PARAMS_BASE64='${Qn({input:t})}' ${e}`}function Yn(e,t,n){return[`cd`,Xn(e),`&&`,`openpond`,`sandbox-template`,t,`--file`,At,`--target`,Xn(n)].join(` `)}function Xn(e){return`'${e.replace(/'/g,`'\\''`)}'`}function Zn(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{let[,e=``]=(typeof r.result==`string`?r.result:``).split(`,`,2);t(e)},r.onerror=()=>n(r.error??Error(`Failed to read file`)),r.readAsDataURL(e)})}function Qn(e){let t=JSON.stringify(e),n=new TextEncoder().encode(t),r=``;for(let e of n)r+=String.fromCharCode(e);return window.btoa(r)}function $n(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function er(e){return e instanceof Error?e.message:String(e)}function tr(e){return e.length<=10?e:`${e.slice(0,6)}...${e.slice(-4)}`}async function nr(e){e&&(await e(`sandbox_preserve_source`),await e(`sandbox_stop`))}function rr(e){return{...e.teamId?{teamId:e.teamId}:{},...e.projectId?{projectId:e.projectId}:{},runtime:{runtimeId:e.runtimeId},visibility:`team`,budget:{maxUsd:`0.05`},quotas:{idleTimeoutSeconds:900,maxSpendUsd:`0.05`},metadata:{source:`openpond-app-environment-menu-sandbox-resume`,resumeSandboxId:e.id,previousState:e.state}}}function ir({canCreateSandboxProject:e,canInitGit:t,defaultSandboxRepoUrl:n,gitWorkspace:r,hasRemote:i,isProjectWorkspace:a,isSandboxWorkspace:o,managed:s,onOpenCommitDialog:c,onRunTerminalCommand:l,onWorkspaceToolAction:u,projectSandboxTemplate:d,projectSandboxTemplateValid:f,sandboxTemplateActionTargetCount:p,sandboxTemplateServiceTargets:m,sandboxResumeTarget:g,selectedApp:_,selectedProject:C,setSandboxCreateDialogOpen:w,setSandboxRunActionDialogOpen:T,workspaceBusyValue:E,workspaceReady:D,workspaceState:O}){let ee=[{icon:(0,$.jsx)(A,{size:14}),label:`Initialize Git`,disabled:s||!t||E||!D||!u,onSelect:()=>u?.(`git_init`)},{icon:(0,$.jsx)(h,{size:14}),label:`Commit changes`,disabled:s||!r||E||!D||!O?.dirty||!c,onSelect:()=>c?.(`commit`)},{icon:(0,$.jsx)(S,{size:14}),label:`Push branch`,disabled:s||!r||E||!D||!i||!u,onSelect:()=>u?.(`git_push`)},{icon:(0,$.jsx)(y,{size:14}),label:`Fetch remote`,disabled:s||!r||E||!D||!i||!u,onSelect:()=>u?.(`git_fetch`)},{icon:(0,$.jsx)(N,{size:14}),label:`Create PR`,disabled:!0,onSelect:()=>void 0}],k=[...d?[]:[{icon:(0,$.jsx)(oe,{size:14}),label:`Create sandbox template`,disabled:s||E||!D||!u,onSelect:()=>u?.(`create_sandbox_template_scaffold`)}],{icon:(0,$.jsx)(M,{size:14}),label:`Validate ${At}`,disabled:s||E||!D||!u,onSelect:()=>u?.(`validate_sandbox_template`)},{icon:(0,$.jsx)(fn,{size:14}),label:`Build template`,disabled:s||E||!D||!u,onSelect:()=>u?.(`build_sandbox_template`)},{icon:(0,$.jsx)(v,{size:14}),label:`Run start locally`,disabled:s||E||!D||!u,onSelect:()=>u?.(`run_sandbox_template`,{mode:`local`,target:`start`})},{icon:(0,$.jsx)(v,{size:14}),label:`Run action`,disabled:s||E||!D||!f||p===0,onSelect:()=>T(!0)},...m.map(e=>({icon:(0,$.jsx)(x,{size:14}),label:`Dev ${e.name} locally`,disabled:s||E||!D||!f||!C?.sandboxTemplate?.rootPath||!l,onSelect:()=>l?.(Yn(C?.sandboxTemplate?.rootPath??``,`dev`,e.name))})),{icon:(0,$.jsx)(oe,{size:14}),label:`Start sandbox`,disabled:s||E||!D||!e,onSelect:()=>w(!0)}],ne=[{icon:(0,$.jsx)(y,{size:14}),label:`Sandbox status`,disabled:E||!u,onSelect:()=>u?.(`sandbox_status`)},{icon:(0,$.jsx)(v,{size:14}),label:`Resume sandbox`,disabled:E||!u||!g?.runtimeId||g.state===`running`||g.state===`creating`,onSelect:()=>g?.runtimeId?u?.(`sandbox_create`,rr(g)):void 0},{icon:(0,$.jsx)(ae,{size:14}),label:`Sandbox logs`,disabled:E||!u,onSelect:()=>u?.(`sandbox_logs`)},{icon:(0,$.jsx)(M,{size:14}),label:`Receipts`,disabled:E||!u,onSelect:()=>u?.(`sandbox_receipts`)},{icon:(0,$.jsx)(te,{size:14}),label:`Export patch`,disabled:E||!u,onSelect:()=>u?.(`sandbox_git_export_patch`)},{icon:(0,$.jsx)(S,{size:14}),label:`Apply locally`,disabled:E||!u,onSelect:()=>u?.(`sandbox_git_apply_patch_local`)},{icon:(0,$.jsx)(b,{size:14}),label:`Checkpoint and stop`,disabled:E||!u,onSelect:()=>nr(u)}];return{gitActionItems:ee,sandboxActionItems:o?ne:a?k:[{icon:(0,$.jsx)(oe,{size:14}),label:n?`Create sandbox from repo`:`Create sandbox`,disabled:E||!u,onSelect:()=>u?.(`sandbox_create`,{...n?{repo:n}:{},visibility:`team`,budget:{maxUsd:`0.05`},quotas:{maxSpendUsd:`0.05`},metadata:{source:`openpond-app-environment-menu-sandbox`,..._?.name?{appName:_.name}:{}}})},{icon:(0,$.jsx)(y,{size:14}),label:`List templates`,disabled:E||!u,onSelect:()=>u?.(`sandbox_templates`)}]}}function ar({busy:e,error:t,projectName:n,onClose:r,onSubmit:i}){let[a,o]=(0,Q.useState)(`action`),[s,c]=(0,Q.useState)(At),l=n.trim()||`local-agent`;return(0,$.jsxs)(lr,{title:`Add Agent config`,busy:e,error:t,onClose:r,children:[(0,$.jsxs)(`label`,{children:[(0,$.jsx)(`span`,{children:`Template preset`}),(0,$.jsxs)(`select`,{value:a,onChange:e=>o(e.target.value),disabled:e,children:[(0,$.jsx)(`option`,{value:`action`,children:`Action`}),(0,$.jsx)(`option`,{value:`cron`,children:`Cron`}),(0,$.jsx)(`option`,{value:`background`,children:`Background worker`}),(0,$.jsx)(`option`,{value:`resources`,children:`Resource profile`})]})]}),(0,$.jsxs)(`label`,{children:[(0,$.jsx)(`span`,{children:`Manifest path`}),(0,$.jsx)(`input`,{value:s,onChange:e=>c(e.target.value),disabled:e})]}),(0,$.jsx)(`pre`,{children:Rn(l,a)}),(0,$.jsx)(ur,{busy:e,actionLabel:`Write config`,canSubmit:!!s.trim(),onClose:r,onSubmit:()=>i({name:l,preset:a,manifestPath:s.trim()})})]})}function or({busy:e,defaultBranch:t,defaultTeamId:n,error:r,projectName:i,sourceIdentity:a,onClose:o,onSubmit:s}){let c=n,[l,u]=(0,Q.useState)(i),[d,f]=(0,Q.useState)(/github\.com[:/]/i.test(a)?`github_repo`:`manual`),[p,m]=(0,Q.useState)(a),[h,g]=(0,Q.useState)(t||`main`),[_,v]=(0,Q.useState)(!0);return(0,$.jsxs)(lr,{title:`Connect Project`,busy:e,error:r,onClose:o,children:[(0,$.jsxs)(`label`,{children:[(0,$.jsx)(`span`,{children:`Project name`}),(0,$.jsx)(`input`,{value:l,onChange:e=>u(e.target.value),disabled:e})]}),(0,$.jsxs)(`div`,{className:`agent-setup-two-col`,children:[(0,$.jsxs)(`label`,{children:[(0,$.jsx)(`span`,{children:`Source type`}),(0,$.jsxs)(`select`,{value:d,onChange:e=>f(e.target.value),disabled:e,children:[(0,$.jsx)(`option`,{value:`manual`,children:`Manual`}),(0,$.jsx)(`option`,{value:`github_repo`,children:`GitHub repo`}),(0,$.jsx)(`option`,{value:`internal_repo`,children:`Internal repo`}),(0,$.jsx)(`option`,{value:`template`,children:`Template`})]})]}),(0,$.jsxs)(`label`,{children:[(0,$.jsx)(`span`,{children:`Default branch`}),(0,$.jsx)(`input`,{value:h,onChange:e=>g(e.target.value),disabled:e})]})]}),(0,$.jsxs)(`label`,{children:[(0,$.jsx)(`span`,{children:`Source identity`}),(0,$.jsx)(`input`,{value:p,onChange:e=>m(e.target.value),disabled:e})]}),(0,$.jsxs)(`label`,{className:`agent-setup-check`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:_,onChange:e=>v(e.target.checked),disabled:e}),(0,$.jsx)(`span`,{children:`Sync now`})]}),(0,$.jsx)(ur,{busy:e,actionLabel:_?`Connect and sync`:`Connect Project`,canSubmit:!!(l.trim()&&c),onClose:o,onSubmit:()=>s({teamId:c,projectName:l.trim(),sourceType:d,sourceIdentity:p.trim(),defaultBranch:h.trim(),syncNow:_})})]})}function sr({busy:e,defaultName:t,error:n,onClose:r,onSubmit:i}){let[a,o]=(0,Q.useState)(t),[s,c]=(0,Q.useState)(!0);return(0,$.jsxs)(lr,{title:`Create Agent`,busy:e,error:n,onClose:r,children:[(0,$.jsxs)(`label`,{children:[(0,$.jsx)(`span`,{children:`Agent name`}),(0,$.jsx)(`input`,{value:a,onChange:e=>o(e.target.value),disabled:e})]}),(0,$.jsx)(`div`,{className:`agent-setup-summary`,children:`Entire manifest · Manual trigger · Package defaults`}),(0,$.jsxs)(`label`,{className:`agent-setup-check`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:s,onChange:e=>c(e.target.checked),disabled:e}),(0,$.jsx)(`span`,{children:`Create and test run`})]}),(0,$.jsx)(ur,{busy:e,actionLabel:`Create Agent`,canSubmit:!!a.trim(),onClose:r,onSubmit:()=>i({agentName:a.trim(),createTestRun:s})})]})}function cr({actionLabel:e,busy:t,error:n,summary:r,title:i,onClose:a,onSubmit:o}){return(0,$.jsxs)(lr,{title:i,busy:t,error:n,onClose:a,children:[(0,$.jsx)(`div`,{className:`agent-setup-summary`,children:r}),(0,$.jsx)(ur,{busy:t,actionLabel:e,canSubmit:!0,onClose:a,onSubmit:o})]})}function lr({busy:e,children:t,error:n,title:r,onClose:i}){return w(n),(0,$.jsx)(`div`,{className:`agent-setup-dialog-backdrop`,role:`presentation`,onMouseDown:i,children:(0,$.jsxs)(`section`,{className:`agent-setup-dialog`,role:`dialog`,"aria-modal":`true`,"aria-label":r,onMouseDown:e=>e.stopPropagation(),children:[(0,$.jsxs)(`header`,{children:[(0,$.jsx)(`h3`,{children:r}),(0,$.jsx)(`button`,{type:`button`,disabled:e,onClick:i,children:`Close`})]}),(0,$.jsx)(`div`,{className:`agent-setup-fields`,children:t})]})})}function ur({actionLabel:e,busy:t,canSubmit:n,onClose:r,onSubmit:i}){return(0,$.jsxs)(`div`,{className:`agent-setup-dialog-actions`,children:[(0,$.jsx)(`button`,{type:`button`,disabled:t,onClick:r,children:`Cancel`}),(0,$.jsx)(`button`,{type:`button`,disabled:t||!n,onClick:i,children:t?`Working`:e})]})}function dr(e){return e.split(`
35
+ `).filter(e=>e.trim()).length}function fr(e){return e.status===`loading`?`Checking sandbox changes`:e.status===`error`?`Sandbox status unavailable`:e.status===`ready`?e.changedFiles===0?`Sandbox clean`:`${e.changedFiles} sandbox changed ${e.changedFiles===1?`file`:`files`}`:`Sandbox changes unknown`}function pr(e){return e>0&&e%3600==0?`${e/3600} hr`:e>0&&e%60==0?`${e/60} min`:`${e} sec`}function mr(e){let t=e?.trim();if(!t)return null;if(t.startsWith(`$`))return t;let n=Number(t);if(!Number.isFinite(n))return`$${t}`;if(n===0)return`$0`;let r=n>=1?2:4;return`$${n.toFixed(r).replace(/0+$/,``).replace(/\.$/,``)}`}function hr(e){return e.receipts.slice().sort((e,t)=>Date.parse(t.createdAt)-Date.parse(e.createdAt))[0]??null}function gr(e){let t=hr(e);if(t){let n=mr(t.totalUsd);if(t.reason===`idle_timeout`)return n?`stopped by idle timeout · charged ${n}`:`stopped by idle timeout`;if(t.reason===`budget_exhausted`)return n?`budget exhausted · charged ${n}`:`budget exhausted`;if(e.state!==`running`)return n?`receipt ${t.status} · charged ${n}`:`receipt ${t.status}`}if(e.reservation.status===`reserved`){let t=mr(e.reservation.reservedUsd);return t?`reservation active ${t}`:`reservation active`}if(e.reservation.status===`captured`){let t=mr(e.reservation.capturedUsd);return t?`captured ${t}`:`captured`}return e.reservation.status===`released`?`reservation released`:null}function _r(e){if(!e)return`Loading sandbox policy`;let t=typeof e.quotas?.idleTimeoutSeconds==`number`&&e.quotas.idleTimeoutSeconds>0?e.quotas.idleTimeoutSeconds:null,n=mr(e.quotas?.maxSpendUsd??e.budget.maxUsd),r=[t?`Auto-stop after ${pr(t)} idle`:`Auto-stop policy unavailable`];n&&r.push(`cap ${n}`);let i=gr(e);return i&&r.push(i),r.join(` · `)}function vr({mode:e,busy:t,workspaceState:n,workspaceId:r,workspaceKind:i,selectedApp:a,selectedProject:o,workspaceBusy:s,defaultTeamId:c,workspaceDiff:l,managedWorkspace:u,showDiffControls:d,diffPanelOpen:f,onToggleDiffPanel:m,onRunTerminalCommand:h,onWorkspaceToolAction:v,onOpenCommitDialog:y,onWorkspaceBranchChange:b,onWorkspaceBranchCreate:x,connection:S,onBootstrap:C,onOpenSandboxWorkspace:w}){let[E,A]=(0,Q.useState)(!1),[te,j]=(0,Q.useState)(!1),[M,N]=(0,Q.useState)(``),[ae,F]=(0,Q.useState)(!1),[se,ce]=(0,Q.useState)(!1),[I,L]=(0,Q.useState)(null),[R,z]=(0,Q.useState)(!1),[B,le]=(0,Q.useState)(!1),[V,H]=(0,Q.useState)(null),[U,ue]=(0,Q.useState)([]),[de,W]=(0,Q.useState)([]),[fe,G]=(0,Q.useState)([]),[pe,K]=(0,Q.useState)({status:`idle`,changedFiles:0,error:null}),[q,me]=(0,Q.useState)(null),he=(0,Q.useRef)(null),ge=(0,Q.useRef)(null),_e=!!n?.initialized,J=!!s,ve=!!u,Y=i===`local_project`||!!o,X=i===`sandbox`||i===`sandbox_template`,ye=X&&r?.trim()||null,be=X?0:l?.additions??0,xe=X?0:l?.deletions??0,Se=X?pe.changedFiles:l?.filesChanged??n?.changedFilesCount??0,Ce=Se>0,we=X?fr(pe):Ce?`${Se} changed ${Se===1?`file`:`files`}`:`No changes`,Te=X?_r(q):``,Ee=n?.source!==`local_folder`,De=Y&&n?.source===`local_folder`,Oe=!!n?.remoteUrl,ke=n?.remoteUrl?.trim()??``,Ae=Gn(a??null),je=!!o?.sandboxTemplate?.detected,Me=!!(o?.sandboxTemplate?.valid&&o.sandboxTemplate.normalizedManifest),Ne=o?.sandboxTemplate?.normalizedManifest??null,Pe=Ne?tn(Ne):[],Fe=Pe.filter(e=>e.kind===`action`),Ie=Pe.filter(e=>e.kind===`service`),Le=!!o?.linkedOpenPondApp?.appId,Z=re({localProject:o,organizations:U,projects:de,agents:fe,defaultTeamId:c}),Re=k(U,c),ze=Y&&je&&!Le,Be=Y&&je&&Me&&(ze||!!ke),Ve=n?Array.from(new Set([n.currentBranch,...n.branches].filter(e=>!!e))):[],He=n?.initialized?n.currentBranch??Ve[0]??`No branch`:`Not synced`,Ue=Bn(n),We=(0,Q.useMemo)(()=>{let e=M.trim().toLowerCase();return e?Ve.filter(t=>t.toLowerCase().includes(e)):Ve},[Ve,M]);(0,Q.useEffect)(()=>{if(!E)return;function e(e){he.current?.contains(e.target)||A(!1)}function t(e){e.key===`Escape`&&A(!1)}return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[E]),(0,Q.useEffect)(()=>{E&&te&&ge.current?.focus()},[te,E]),(0,Q.useEffect)(()=>{if(!S||!E||!Y)return;let e=!1;return le(!0),H(null),O.organizations(S).then(async t=>{if(e)return;let n=t.organizations.map(T).filter(e=>!!e).filter(e=>e.status===`active`);ue(n);let r=k(n,c);if(!r)return;let[i,a]=await Promise.all([O.listSandboxProjects(S,{teamId:r.teamId}),O.listSandboxAgents(S,{teamId:r.teamId})]);e||(W(i.projects),G(a.agents))}).catch(t=>{e||H(er(t))}).finally(()=>{e||le(!1)}),()=>{e=!0}},[S,c,Y,E]),(0,Q.useEffect)(()=>{if(!E||!X||!S||!ye){K({status:`idle`,changedFiles:0,error:null});return}let e=!1;return K(e=>({status:`loading`,changedFiles:e.changedFiles,error:null})),O.sandboxGitStatus(S,ye).then(t=>{e||K({status:`ready`,changedFiles:dr(t.status?.porcelain??``),error:null})}).catch(t=>{e||K({status:`error`,changedFiles:0,error:er(t)})}),()=>{e=!0}},[S,X,E,ye]),(0,Q.useEffect)(()=>{if(!E||!X||!S||!ye){me(null);return}let e=!1;return O.sandbox(S,ye).then(t=>{e||me(t.sandbox)}).catch(()=>{e||me(null)}),()=>{e=!0}},[S,X,E,ye]);async function Ge(e){if(!v)return;let t=e.openPreview?mn():null,r=e.repoUrl||ke;if(ze){if(Oe&&!window.confirm(`Replace the current origin remote with a new OpenPond repo before starting the sandbox?`)){hn(t,null);return}let i=await v(`publish_openpond_repo`,{replaceOrigin:Oe,...n?.dirty?{commitDirty:!0,commitMessage:e.commitMessage}:{}});if(!i?.ok){hn(t,null);return}r=Vn(i)??r}else if(Ee&&Oe&&(n?.dirty&&!(await v(`git_commit`,{message:e.commitMessage,includeUnstaged:!0,runChecks:!1}))?.ok||!(await v(`git_push`,{runChecks:!1}))?.ok)){hn(t,null);return}if(!r){hn(t,null);return}let i=await v(`sandbox_create`,{repo:r,visibility:`team`,resources:e.resources,budget:{maxUsd:e.budgetUsd},quotas:{idleTimeoutSeconds:900,maxSpendUsd:e.budgetUsd},...e.env.length>0?{env:e.env}:{},...e.volumes.length>0?{volumes:e.volumes}:{},metadata:{source:`openpond-app-local-sandbox-template-start`,...e.entrypointName?{entrypointName:e.entrypointName}:{},...o?.id?{localProjectId:o.id}:{},...o?.name?{projectName:o.name}:{},...Ne?{templateName:Ne.name,templateVersion:Ne.version,templateUseCase:Ne.useCase,templateTargets:Pe.map(e=>({name:e.name,kind:e.kind}))}:{}},...e.openPreview&&e.previewPort?{previewPort:e.previewPort,previewLabel:e.previewLabel,previewAccess:e.previewAccess,previewAutoStart:!0}:{}}),a=pn(i);if(e.openPreview&&hn(t,a),!i?.ok)return;let s=Hn(i);for(let e of Ne?.setup.commands??[])if(!(await v(`sandbox_exec`,{command:e,timeoutSeconds:900}))?.ok)return;let c={};for(let t of e.uploads){let e=[];for(let n of t.files){let r=qn(t.targetPath,n.name);if(!(await v(`sandbox_upload_file`,{path:r,contentsBase64:await Zn(n)}))?.ok)return;e.push(r)}c[t.inputName]=t.multiple?e:e[0]??``}if((await v(`sandbox_exec`,{command:Jn(e.command,{...e.params,...c}),timeoutSeconds:e.timeoutSeconds??900}))?.ok){if(s){for(let t of e.schedules)if(!(await v(`sandbox_schedule_create`,Wn(t,s)))?.ok)return}F(!1)}}async function Ke(e){if(!v)return;let t={},n=[];for(let r of e.uploads){let e=[];for(let t of r.files){let i=qn(r.targetPath,t.name),a=await Zn(t);n.push({path:i,contentsBase64:a}),e.push(i)}t[r.inputName]=r.multiple?e:e[0]??``}ce(!1),await v(`run_sandbox_template`,{mode:e.mode,target:e.target,params:{...e.params,...t},...e.env.length>0?{env:e.env}:{},...n.length>0?{uploads:n}:{}})}async function qe(e=Re?.teamId){if(!S||!e)return;let[t,n]=await Promise.all([O.listSandboxProjects(S,{teamId:e}),O.listSandboxAgents(S,{teamId:e})]);W(t.projects),G(n.agents)}async function Je(e){if(v&&o){z(!0),H(null);try{if(!(await v(`create_sandbox_template_scaffold`,{manifestOnly:!0,manifestContent:Rn(e.name,e.preset),name:e.name,preset:e.preset,manifestPath:e.manifestPath}))?.ok)return;L(null)}catch(e){H(er(e))}finally{z(!1)}}}async function Ye(e){if(!S||!o||!C)return;let t=e.teamId;z(!0),H(null);try{let n=Kn(e.sourceType,e.sourceIdentity),r=(await O.upsertSandboxProject(S,{teamId:t,name:e.projectName,sourceType:e.sourceType,normalizedSourceIdentity:e.sourceIdentity||e.projectName,defaultBranch:e.defaultBranch||null,gitProvider:e.sourceType===`github_repo`?`github`:null,gitHost:n.gitHost,gitOwner:n.gitOwner,gitRepo:n.gitRepo,internalRepoPath:n.internalRepoPath,templateRepoUrl:n.templateRepoUrl,sourceConfig:{sourceType:e.sourceType,sourceValue:e.sourceIdentity||e.projectName},metadata:{source:`openpond-app-local-project-agent-setup`}})).project;e.syncNow&&(r=(await O.syncSandboxProject(S,r.id,{teamId:t})).project),C((await O.updateLocalProjectAgentSetup(S,o.id,{linkedSandboxProject:{teamId:t,projectId:r.id,projectSlug:r.slug,projectName:r.name,sourceRepoUrl:e.sourceIdentity||null,defaultBranch:r.defaultBranch,lastUploadedCommit:null,lastUploadTransport:null,manifestPath:r.sandboxManifestPath,manifestHash:r.sandboxManifestHash,syncedAt:r.sandboxManifestSyncedAt,linkedAt:new Date().toISOString()}})).bootstrap),W(e=>[r,...e.filter(e=>e.id!==r.id)]),L(null)}catch(e){H(er(e))}finally{z(!1)}}async function Xe(){if(!S||!o||!Z.project||!C)return;let e=Z.project;z(!0),H(null);try{let t=(await O.syncSandboxProject(S,e.id,{teamId:e.teamId})).project;C((await O.updateLocalProjectAgentSetup(S,o.id,{linkedSandboxProject:{teamId:t.teamId,projectId:t.id,projectSlug:t.slug,projectName:t.name,sourceRepoUrl:n?.remoteUrl??o.linkedSandboxProject?.sourceRepoUrl??null,defaultBranch:t.defaultBranch,lastUploadedCommit:o.linkedSandboxProject?.lastUploadedCommit??null,lastUploadTransport:o.linkedSandboxProject?.lastUploadTransport??null,manifestPath:t.sandboxManifestPath,manifestHash:t.sandboxManifestHash,syncedAt:t.sandboxManifestSyncedAt,linkedAt:o.linkedSandboxProject?.linkedAt??new Date().toISOString()}})).bootstrap),W(e=>[t,...e.filter(e=>e.id!==t.id)]),L(null)}catch(e){H(er(e))}finally{z(!1)}}async function Ze(e){if(!S||!o||!Z.project||!C)return;let t=Z.project;z(!0),H(null);try{let n=(await O.upsertSandboxAgent(S,{teamId:t.teamId,projectId:t.id,name:e.agentName,selectedEntrypoint:{scope:`entire_manifest`,name:null},triggerType:`manual`,backgroundTaskPolicy:{},defaultWorkflowMode:`attempt`,defaultResourcePolicy:{},metadata:{source:`openpond-app-local-project-agent-setup`}})).agent,r=null,i=null;if(e.createTestRun){let e=await O.runSandboxAgent(S,n.id,{teamId:t.teamId,triggerType:`manual`,metadata:{source:`openpond-app-local-project-agent-setup`}});r=e.sandbox??null,i=r?.id??e.run.sandboxId??null}C((await O.updateLocalProjectAgentSetup(S,o.id,{preferredSandboxAgentId:n.id})).bootstrap),G(e=>[n,...e.filter(e=>e.id!==n.id)]),L(null),i&&await w?.({sandboxId:i,name:Un(r)??`${n.name} sandbox`})}catch(e){H(er(e))}finally{z(!1)}}async function Qe(){if(S&&Z.agent){z(!0),H(null);try{let e=await O.runSandboxAgent(S,Z.agent.id,{teamId:Z.agent.teamId,triggerType:`manual`,metadata:{source:`openpond-app-local-project-agent-setup`}});await qe(Z.agent.teamId),L(null);let t=e.sandbox?.id??e.run.sandboxId;t&&await w?.({sandboxId:t,name:Un(e.sandbox??null)??`${Z.agent.name} sandbox`})}catch(e){H(er(e))}finally{z(!1)}}}let{gitActionItems:$e,sandboxActionItems:et}=ir({busy:t,canCreateSandboxProject:Be,canInitGit:De,defaultSandboxRepoUrl:Ae??``,gitWorkspace:Ee,hasRemote:Oe,isProjectWorkspace:Y,isSandboxWorkspace:X,managed:ve,onOpenCommitDialog:y,onRunTerminalCommand:h,onWorkspaceToolAction:v,projectSandboxTemplate:je,projectSandboxTemplateValid:Me,sandboxTemplateActionTargetCount:Fe.length,sandboxTemplateServiceTargets:Ie,sandboxResumeTarget:q?{id:q.id,runtimeId:q.runtimeId??null,teamId:q.teamId??null,projectId:q.projectId??null,state:q.state??null}:null,selectedApp:a,selectedProject:o,setSandboxCreateDialogOpen:F,setSandboxRunActionDialogOpen:ce,workspaceBusyValue:J,workspaceReady:_e,workspaceState:n});if(!n)return null;function tt(e){A(!1),e.onSelect()}return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`workspace-environment-menu ${e===`dock`?`open-up`:``} ${e===`topbar`?`topbar`:``}`,ref:he,children:[(0,$.jsx)(`button`,{type:`button`,className:`environment-info-button ${e===`topbar`?`titlebar-icon`:`composer-icon`} ${E?`active`:``}`,title:`Environment`,"data-tooltip":`Environment`,"aria-label":`Environment`,"aria-haspopup":`menu`,"aria-expanded":E,onClick:()=>A(e=>!e),children:(0,$.jsx)(g,{size:16})}),E&&(0,$.jsxs)(`div`,{className:`environment-popover`,role:`menu`,"aria-label":`Environment`,children:[(0,$.jsx)(`div`,{className:`environment-popover-header`,children:(0,$.jsx)(`span`,{children:`Environment`})}),Y&&o?(0,$.jsxs)(`button`,{type:`button`,className:`environment-row`,disabled:B||!Z.canAct||R,title:B?`Loading Agent setup state`:Z.reason??`Set up this project as an Agent`,onClick:()=>{!B&&Z.canAct&&(Z.state===`missing_config`&&L(`config`),Z.state===`needs_project`&&L(`connect`),Z.state===`needs_sync`&&L(`sync`),Z.state===`needs_agent`&&L(`agent`),Z.state===`ready`&&L(`run`),A(!1))},children:[(0,$.jsx)(oe,{size:15}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`strong`,{children:`Agent setup`}),(0,$.jsx)(`small`,{children:B?`Loading setup state`:zn(Z.state,Z.reason)})]}),(0,$.jsx)(`span`,{className:`environment-row-action`,children:R?`Working`:B?`Loading`:Z.actionLabel})]}):null,(0,$.jsxs)(`button`,{type:`button`,className:`environment-row ${f?`active`:``}`,disabled:!d||!m,onClick:()=>{A(!1),m?.()},children:[(0,$.jsx)(ie,{size:15}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`strong`,{children:`Changes`}),(0,$.jsx)(`small`,{children:we})]}),!X&&(Ce||l)&&(0,$.jsxs)(`span`,{className:`environment-change-counts`,children:[(0,$.jsxs)(`span`,{className:`diff-addition`,children:[`+`,be]}),(0,$.jsxs)(`span`,{className:`diff-deletion`,children:[`-`,xe]})]})]}),(0,$.jsxs)(`div`,{className:`environment-row static`,children:[(0,$.jsx)(_,{size:15}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`strong`,{children:Ue}),(0,$.jsx)(`small`,{children:n.repoPath||n.workspacePath})]})]}),X?(0,$.jsxs)(`div`,{className:`environment-row static`,title:Te,children:[(0,$.jsx)(D,{size:15}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`strong`,{children:`Idle cleanup`}),(0,$.jsx)(`small`,{children:Te})]})]}):null,(0,$.jsxs)(`button`,{type:`button`,className:`environment-row ${te?`active`:``}`,disabled:ve||!Ee||t||J||!n.initialized,"aria-expanded":te,onClick:()=>j(e=>!e),children:[(0,$.jsx)(P,{size:15}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`strong`,{children:He}),(0,$.jsx)(`small`,{children:ve?`Managed workspace`:Ee?`Branch`:`Git not initialized`})]}),(0,$.jsx)(p,{size:13})]}),te&&(0,$.jsxs)(`div`,{className:`environment-branch-panel`,children:[(0,$.jsxs)(`label`,{className:`environment-branch-search`,children:[(0,$.jsx)(ee,{size:13}),(0,$.jsx)(`input`,{ref:ge,value:M,placeholder:`Search branches`,onChange:e=>N(e.target.value)})]}),(0,$.jsxs)(`div`,{className:`environment-branch-list`,children:[We.map(e=>{let r=e===n.currentBranch,i=t||n.dirty&&!r;return(0,$.jsxs)(`button`,{type:`button`,className:r?`selected`:``,disabled:i,role:`menuitemradio`,"aria-checked":r,title:i&&!r?`Commit or discard local changes before switching branches.`:e,onClick:()=>{A(!1),r||b?.(e)},children:[(0,$.jsx)(P,{size:13}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`strong`,{children:e}),r&&n.dirty&&(0,$.jsxs)(`small`,{children:[`Uncommitted: `,n.changedFilesCount,` `,n.changedFilesCount===1?`file`:`files`]})]}),r&&(0,$.jsx)(ne,{size:14})]},e)}),We.length===0&&(0,$.jsx)(`div`,{className:`environment-branch-empty`,children:`No branches found`})]}),(0,$.jsxs)(`button`,{type:`button`,className:`environment-branch-create`,disabled:t||!n.initialized||!x,onClick:()=>{A(!1),x?.()},children:[(0,$.jsx)(P,{size:14}),(0,$.jsx)(`span`,{children:`Create branch`})]})]}),(0,$.jsx)(`div`,{className:`environment-section-title`,children:`Git`}),$e.map(e=>(0,$.jsxs)(`button`,{type:`button`,className:`environment-action`,disabled:e.disabled,onClick:()=>tt(e),children:[e.icon,(0,$.jsx)(`span`,{children:e.label})]},e.label)),(0,$.jsx)(`div`,{className:`environment-section-title`,children:`Sandbox`}),et.map(e=>(0,$.jsxs)(`button`,{type:`button`,className:`environment-action`,disabled:e.disabled,onClick:()=>tt(e),children:[e.icon,(0,$.jsx)(`span`,{children:e.label})]},e.label))]})]}),ae&&(0,$.jsx)(In,{busy:J,commitBeforeCreate:(ze||Ee&&Oe)&&!!n?.dirty,defaultRepoUrl:ke,projectName:o?.name??`sandbox template`,templateManifest:o?.sandboxTemplate?.normalizedManifest??null,uploadBeforeCreate:ze,onClose:()=>{J||F(!1)},onSubmit:e=>void Ge(e)}),se&&(0,$.jsx)(Ln,{busy:J,projectName:o?.name??`sandbox template`,templateManifest:o?.sandboxTemplate?.normalizedManifest??null,onClose:()=>{J||ce(!1)},onSubmit:e=>void Ke(e)}),I===`config`&&o?(0,$.jsx)(ar,{busy:R,error:V,projectName:o.name,onClose:()=>!R&&L(null),onSubmit:e=>void Je(e)}):null,I===`connect`&&o&&Re?(0,$.jsx)(or,{busy:R,error:V,defaultTeamId:Re.teamId,projectName:o.name,sourceIdentity:n?.remoteUrl??``,defaultBranch:n?.currentBranch??`main`,onClose:()=>!R&&L(null),onSubmit:e=>void Ye(e)}):null,I===`sync`&&Z.project?(0,$.jsx)(cr,{busy:R,error:V,title:`Sync Project`,actionLabel:`Sync Project`,summary:`${Z.project.name} · ${Z.project.sandboxManifestPath??`openpond.yaml`}`,onClose:()=>!R&&L(null),onSubmit:()=>void Xe()}):null,I===`agent`&&Z.project?(0,$.jsx)(sr,{busy:R,error:V,defaultName:`${o?.name??Z.project.name} Agent`,onClose:()=>!R&&L(null),onSubmit:e=>void Ze(e)}):null,I===`run`&&Z.agent?(0,$.jsx)(cr,{busy:R,error:V,title:`Run Agent`,actionLabel:`Run Agent`,summary:Z.agent.name,onClose:()=>!R&&L(null),onSubmit:()=>void Qe()}):null]})}export{vr as WorkspaceEnvironmentMenu};
@@ -1 +1 @@
1
- import{m as e}from"./index-LXNhSUEL.js";import"./icons-CZxmQtZs.js";import{t}from"./chevron-right-DLYNg_Oq.js";import{K as n,z as r}from"./App-DmEA-Lia.js";var i=e();function a(e){return(e.replace(/\\/g,`/`).split(`/`).pop()||`File`).replace(/^\d{3}-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}-/i,``)}function o({path:e,workspaceName:o=null,workspaceRootPath:c,onSelectPath:l}){let u=n(e,c),d=r(u),f=d?s(u):o?.trim()||`Workspace`,p=(d&&f!==`/`&&u.startsWith(`${f}/`)?u.slice(f.length+1):u).split(`/`).filter(Boolean),m=!(!l||d);return(0,i.jsxs)(`details`,{className:`workspace-file-location`,children:[(0,i.jsx)(`summary`,{title:e,"aria-label":`File path: ${a(e)}`,children:a(e)}),(0,i.jsxs)(`div`,{className:`workspace-file-path-popover`,children:[(0,i.jsxs)(`span`,{className:`workspace-file-breadcrumbs`,children:[l&&!d?(0,i.jsx)(`button`,{type:`button`,onClick:()=>l(null),children:f}):(0,i.jsx)(`span`,{children:f}),p.map((e,n)=>{let r=n===p.length-1,a=p.slice(0,n+1).join(`/`);return(0,i.jsxs)(`span`,{className:`workspace-file-breadcrumb-segment`,children:[(0,i.jsx)(t,{size:13}),l&&m&&!r?(0,i.jsx)(`button`,{type:`button`,onClick:()=>l(a),children:e}):(0,i.jsx)(`span`,{children:e})]},`${n}-${e}`)})]}),(0,i.jsx)(`code`,{children:e})]})]},e)}function s(e){let t=/^[A-Za-z]:\//.exec(e);return t?t[0].slice(0,-1):`/`}export{a as n,o as t};
1
+ import{m as e}from"./index-B6XX_0h3.js";import"./icons-Bk2b68aC.js";import{t}from"./chevron-right-DHN0y3KC.js";import{K as n,z as r}from"./App-CCuh99JW.js";var i=e();function a(e){return(e.replace(/\\/g,`/`).split(`/`).pop()||`File`).replace(/^\d{3}-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}-/i,``)}function o({path:e,workspaceName:o=null,workspaceRootPath:c,onSelectPath:l}){let u=n(e,c),d=r(u),f=d?s(u):o?.trim()||`Workspace`,p=(d&&f!==`/`&&u.startsWith(`${f}/`)?u.slice(f.length+1):u).split(`/`).filter(Boolean),m=!(!l||d);return(0,i.jsxs)(`details`,{className:`workspace-file-location`,children:[(0,i.jsx)(`summary`,{title:e,"aria-label":`File path: ${a(e)}`,children:a(e)}),(0,i.jsxs)(`div`,{className:`workspace-file-path-popover`,children:[(0,i.jsxs)(`span`,{className:`workspace-file-breadcrumbs`,children:[l&&!d?(0,i.jsx)(`button`,{type:`button`,onClick:()=>l(null),children:f}):(0,i.jsx)(`span`,{children:f}),p.map((e,n)=>{let r=n===p.length-1,a=p.slice(0,n+1).join(`/`);return(0,i.jsxs)(`span`,{className:`workspace-file-breadcrumb-segment`,children:[(0,i.jsx)(t,{size:13}),l&&m&&!r?(0,i.jsx)(`button`,{type:`button`,onClick:()=>l(a),children:e}):(0,i.jsx)(`span`,{children:e})]},`${n}-${e}`)})]}),(0,i.jsx)(`code`,{children:e})]})]},e)}function s(e){let t=/^[A-Za-z]:\//.exec(e);return t?t[0].slice(0,-1):`/`}export{a as n,o as t};
@@ -1 +1 @@
1
- import{m as e}from"./index-LXNhSUEL.js";import"./icons-CZxmQtZs.js";import{t}from"./cloud-upload-CoM1FGeB.js";import{t as n}from"./git-commit-horizontal-Bm4rkXug.js";import{t as r}from"./upload-ABSJxuUM.js";import{t as i}from"./x-B-_zJVOZ.js";import{nn as a,tn as o}from"./App-DmEA-Lia.js";var s=e();function c({open:e,branch:i,filesChanged:c,additions:l,deletions:f,message:p,includeUnstaged:m,nextStep:h,draft:g,busy:_,canPush:v,canPublish:y,onMessageChange:b,onIncludeUnstagedChange:x,onNextStepChange:S,onDraftChange:C,onClose:w,onSubmit:T}){return e?(0,s.jsx)(`div`,{className:`git-dialog-backdrop`,role:`presentation`,children:(0,s.jsxs)(`form`,{className:`git-dialog commit-dialog`,"aria-label":`Commit changes`,onSubmit:e=>{e.preventDefault(),T()},children:[(0,s.jsx)(d,{disabled:_,onClose:w}),(0,s.jsx)(`div`,{className:`git-dialog-icon`,children:(0,s.jsx)(n,{size:18})}),(0,s.jsx)(`h2`,{children:`Commit your changes`}),(0,s.jsxs)(`div`,{className:`git-dialog-row`,children:[(0,s.jsx)(`span`,{children:`Branch`}),(0,s.jsxs)(`strong`,{children:[(0,s.jsx)(a,{size:14}),i??`No branch`]})]}),(0,s.jsxs)(`div`,{className:`git-dialog-row`,children:[(0,s.jsx)(`span`,{children:`Changes`}),(0,s.jsxs)(`strong`,{children:[c,` `,c===1?`file`:`files`,(0,s.jsxs)(`span`,{className:`git-dialog-additions`,children:[`+`,l]}),(0,s.jsxs)(`span`,{className:`git-dialog-deletions`,children:[`-`,f]})]})]}),(0,s.jsxs)(`label`,{className:`git-dialog-toggle`,children:[(0,s.jsx)(`input`,{checked:m,disabled:_,type:`checkbox`,onChange:e=>x(e.target.checked)}),(0,s.jsx)(`span`,{}),`Include unstaged`]}),(0,s.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,s.jsxs)(`span`,{children:[`Commit message`,(0,s.jsx)(`small`,{children:`Leave blank to use an autogenerated message`})]}),(0,s.jsx)(`textarea`,{value:p,disabled:_,placeholder:`Update workspace`,onChange:e=>b(e.target.value)})]}),(0,s.jsxs)(`fieldset`,{className:`git-dialog-next`,children:[(0,s.jsx)(`legend`,{children:`Next steps`}),(0,s.jsx)(u,{active:h===`commit`,icon:(0,s.jsx)(n,{size:14}),label:`Commit`,disabled:_,onSelect:()=>S(`commit`)}),(0,s.jsx)(u,{active:h===`commit_push`,icon:(0,s.jsx)(r,{size:14}),label:`Commit & push`,disabled:_||!v,onSelect:()=>S(`commit_push`)}),y&&(0,s.jsx)(u,{active:h===`commit_publish`,icon:(0,s.jsx)(t,{size:14}),label:`Commit & publish`,disabled:_,onSelect:()=>S(`commit_publish`)}),(0,s.jsx)(u,{active:h===`commit_pr`,icon:(0,s.jsx)(o,{size:14}),label:`Commit & create PR`,disabled:!0,onSelect:()=>S(`commit_pr`)})]}),(0,s.jsxs)(`div`,{className:`git-dialog-footer`,children:[(0,s.jsxs)(`label`,{className:`git-dialog-toggle draft-toggle`,children:[(0,s.jsx)(`input`,{checked:g,disabled:_||h!==`commit_pr`,type:`checkbox`,onChange:e=>C(e.target.checked)}),(0,s.jsx)(`span`,{}),`Draft`]}),(0,s.jsx)(`button`,{className:`git-dialog-primary`,disabled:_||c===0,type:`submit`,children:`Continue`})]})]})}):null}function l({open:e,branchName:t,busy:n,onBranchNameChange:r,onSetPrefix:i,onClose:o,onSubmit:c}){return e?(0,s.jsx)(`div`,{className:`git-dialog-backdrop`,role:`presentation`,children:(0,s.jsxs)(`form`,{className:`git-dialog branch-dialog`,"aria-label":`Create branch`,onSubmit:e=>{e.preventDefault(),c()},children:[(0,s.jsx)(d,{disabled:n,onClose:o}),(0,s.jsx)(`div`,{className:`git-dialog-icon`,children:(0,s.jsx)(a,{size:18})}),(0,s.jsx)(`h2`,{children:`Work here`}),(0,s.jsx)(`p`,{children:`Create a branch to commit changes, push, and create a PR from this worktree.`}),(0,s.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,s.jsxs)(`span`,{children:[`Branch name`,(0,s.jsx)(`button`,{className:`git-dialog-inline-action`,disabled:n,type:`button`,onClick:i,children:`Set prefix`})]}),(0,s.jsx)(`input`,{autoFocus:!0,disabled:n,value:t,onChange:e=>r(e.target.value)})]}),(0,s.jsx)(`button`,{className:`git-dialog-primary full`,disabled:n||!t.trim(),type:`submit`,children:`Create`})]})}):null}function u({active:e,icon:t,label:n,disabled:r,onSelect:i}){return(0,s.jsxs)(`button`,{"aria-pressed":e,className:e?`active`:``,disabled:r,type:`button`,onClick:i,children:[t,(0,s.jsx)(`span`,{children:n}),e&&(0,s.jsx)(`span`,{className:`git-dialog-check`,children:`✓`})]})}function d({disabled:e,onClose:t}){return(0,s.jsx)(`button`,{className:`git-dialog-close`,disabled:e,type:`button`,onClick:t,children:(0,s.jsx)(i,{size:16})})}export{l as BranchDialog,c as CommitDialog};
1
+ import{m as e}from"./index-B6XX_0h3.js";import"./icons-Bk2b68aC.js";import{t}from"./cloud-upload-HdzNTgr2.js";import{t as n}from"./git-commit-horizontal-DFUfuVvF.js";import{t as r}from"./upload-C6ug8RD-.js";import{t as i}from"./x-Jx2jlP9u.js";import{on as a,sn as o}from"./App-CCuh99JW.js";var s=e();function c({open:e,branch:i,filesChanged:c,additions:l,deletions:f,message:p,includeUnstaged:m,nextStep:h,draft:g,busy:_,canPush:v,canPublish:y,onMessageChange:b,onIncludeUnstagedChange:x,onNextStepChange:S,onDraftChange:C,onClose:w,onSubmit:T}){return e?(0,s.jsx)(`div`,{className:`git-dialog-backdrop`,role:`presentation`,children:(0,s.jsxs)(`form`,{className:`git-dialog commit-dialog`,"aria-label":`Commit changes`,onSubmit:e=>{e.preventDefault(),T()},children:[(0,s.jsx)(d,{disabled:_,onClose:w}),(0,s.jsx)(`div`,{className:`git-dialog-icon`,children:(0,s.jsx)(n,{size:18})}),(0,s.jsx)(`h2`,{children:`Commit your changes`}),(0,s.jsxs)(`div`,{className:`git-dialog-row`,children:[(0,s.jsx)(`span`,{children:`Branch`}),(0,s.jsxs)(`strong`,{children:[(0,s.jsx)(o,{size:14}),i??`No branch`]})]}),(0,s.jsxs)(`div`,{className:`git-dialog-row`,children:[(0,s.jsx)(`span`,{children:`Changes`}),(0,s.jsxs)(`strong`,{children:[c,` `,c===1?`file`:`files`,(0,s.jsxs)(`span`,{className:`git-dialog-additions`,children:[`+`,l]}),(0,s.jsxs)(`span`,{className:`git-dialog-deletions`,children:[`-`,f]})]})]}),(0,s.jsxs)(`label`,{className:`git-dialog-toggle`,children:[(0,s.jsx)(`input`,{checked:m,disabled:_,type:`checkbox`,onChange:e=>x(e.target.checked)}),(0,s.jsx)(`span`,{}),`Include unstaged`]}),(0,s.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,s.jsxs)(`span`,{children:[`Commit message`,(0,s.jsx)(`small`,{children:`Leave blank to use an autogenerated message`})]}),(0,s.jsx)(`textarea`,{value:p,disabled:_,placeholder:`Update workspace`,onChange:e=>b(e.target.value)})]}),(0,s.jsxs)(`fieldset`,{className:`git-dialog-next`,children:[(0,s.jsx)(`legend`,{children:`Next steps`}),(0,s.jsx)(u,{active:h===`commit`,icon:(0,s.jsx)(n,{size:14}),label:`Commit`,disabled:_,onSelect:()=>S(`commit`)}),(0,s.jsx)(u,{active:h===`commit_push`,icon:(0,s.jsx)(r,{size:14}),label:`Commit & push`,disabled:_||!v,onSelect:()=>S(`commit_push`)}),y&&(0,s.jsx)(u,{active:h===`commit_publish`,icon:(0,s.jsx)(t,{size:14}),label:`Commit & publish`,disabled:_,onSelect:()=>S(`commit_publish`)}),(0,s.jsx)(u,{active:h===`commit_pr`,icon:(0,s.jsx)(a,{size:14}),label:`Commit & create PR`,disabled:!0,onSelect:()=>S(`commit_pr`)})]}),(0,s.jsxs)(`div`,{className:`git-dialog-footer`,children:[(0,s.jsxs)(`label`,{className:`git-dialog-toggle draft-toggle`,children:[(0,s.jsx)(`input`,{checked:g,disabled:_||h!==`commit_pr`,type:`checkbox`,onChange:e=>C(e.target.checked)}),(0,s.jsx)(`span`,{}),`Draft`]}),(0,s.jsx)(`button`,{className:`git-dialog-primary`,disabled:_||c===0,type:`submit`,children:`Continue`})]})]})}):null}function l({open:e,branchName:t,busy:n,onBranchNameChange:r,onSetPrefix:i,onClose:a,onSubmit:c}){return e?(0,s.jsx)(`div`,{className:`git-dialog-backdrop`,role:`presentation`,children:(0,s.jsxs)(`form`,{className:`git-dialog branch-dialog`,"aria-label":`Create branch`,onSubmit:e=>{e.preventDefault(),c()},children:[(0,s.jsx)(d,{disabled:n,onClose:a}),(0,s.jsx)(`div`,{className:`git-dialog-icon`,children:(0,s.jsx)(o,{size:18})}),(0,s.jsx)(`h2`,{children:`Work here`}),(0,s.jsx)(`p`,{children:`Create a branch to commit changes, push, and create a PR from this worktree.`}),(0,s.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,s.jsxs)(`span`,{children:[`Branch name`,(0,s.jsx)(`button`,{className:`git-dialog-inline-action`,disabled:n,type:`button`,onClick:i,children:`Set prefix`})]}),(0,s.jsx)(`input`,{autoFocus:!0,disabled:n,value:t,onChange:e=>r(e.target.value)})]}),(0,s.jsx)(`button`,{className:`git-dialog-primary full`,disabled:n||!t.trim(),type:`submit`,children:`Create`})]})}):null}function u({active:e,icon:t,label:n,disabled:r,onSelect:i}){return(0,s.jsxs)(`button`,{"aria-pressed":e,className:e?`active`:``,disabled:r,type:`button`,onClick:i,children:[t,(0,s.jsx)(`span`,{children:n}),e&&(0,s.jsx)(`span`,{className:`git-dialog-check`,children:`✓`})]})}function d({disabled:e,onClose:t}){return(0,s.jsx)(`button`,{className:`git-dialog-close`,disabled:e,type:`button`,onClick:t,children:(0,s.jsx)(i,{size:16})})}export{l as BranchDialog,c as CommitDialog};