openpond 0.2.59 → 0.2.60

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 (365) hide show
  1. package/README.md +27 -0
  2. package/dist/app-server.d.ts +7 -0
  3. package/dist/app-server.js +1 -1
  4. package/dist/chunks/acp-ARBNMIPT.js +2 -0
  5. package/dist/chunks/acp-agent-53COYDHB.js +21 -0
  6. package/dist/chunks/{actions-command-JJ3CU7J6.js → actions-command-6YSZ7EJS.js} +1 -1
  7. package/dist/chunks/{app-layer-KAUZAHGE.js → app-layer-TVG7KTW6.js} +1 -1
  8. package/dist/chunks/{app-server-connected-apps-SXGZOUJJ.js → app-server-connected-apps-K62M6LCT.js} +1 -1
  9. package/dist/chunks/{app-server-evaluations-N4OMTPCI.js → app-server-evaluations-RM6WXX3H.js} +1 -1
  10. package/dist/chunks/app-server-harness-services-RLKMWOQ4.js +2 -0
  11. package/dist/chunks/app-server-runtime-OKMEHNEU.js +2 -0
  12. package/dist/chunks/apps-YWZL2H34.js +2 -0
  13. package/dist/chunks/{chunk-JUQMSHNR.js → chunk-23P2O7PH.js} +1 -1
  14. package/dist/chunks/{chunk-PF5R6CMP.js → chunk-2GICDASL.js} +1 -1
  15. package/dist/chunks/{chunk-6MI4KKWF.js → chunk-2ITZW2CN.js} +1 -1
  16. package/dist/chunks/chunk-2MMCZHKL.js +2 -0
  17. package/dist/chunks/{chunk-EOBHQ3JT.js → chunk-2PAJCXFC.js} +1 -1
  18. package/dist/chunks/{chunk-GYJQKCEO.js → chunk-2RNCXDJC.js} +1 -1
  19. package/dist/chunks/{chunk-APB2STJK.js → chunk-2SUMZ73C.js} +1 -1
  20. package/dist/chunks/{chunk-DZUN5YWB.js → chunk-3CWRTKHY.js} +1 -1
  21. package/dist/chunks/{chunk-TRQQNFMO.js → chunk-44LWH5U6.js} +1 -1
  22. package/dist/chunks/{chunk-BVQWVIGK.js → chunk-52KIORRX.js} +1 -1
  23. package/dist/chunks/{chunk-TG7P7BSV.js → chunk-5RHYSQZ5.js} +1 -1
  24. package/dist/chunks/{chunk-3QIB5FXI.js → chunk-5ZBLCWEJ.js} +1 -1
  25. package/dist/chunks/{chunk-25JDHAZ5.js → chunk-637UACKH.js} +1 -1
  26. package/dist/chunks/{chunk-VRODAXFS.js → chunk-655DQ6AX.js} +26 -26
  27. package/dist/chunks/{chunk-N4FFQPLR.js → chunk-6GWOVHIG.js} +1 -1
  28. package/dist/chunks/chunk-6HQB3MQO.js +2 -0
  29. package/dist/chunks/{chunk-GOPFFQZU.js → chunk-7LZISGTA.js} +2 -2
  30. package/dist/chunks/{chunk-MMQRHR3V.js → chunk-7RC5WPVT.js} +1 -1
  31. package/dist/chunks/{chunk-H6IW2R22.js → chunk-7YTHEMWI.js} +1 -1
  32. package/dist/chunks/{chunk-PCSIOUHF.js → chunk-A3L74U3W.js} +1 -1
  33. package/dist/chunks/{chunk-XMKCCLGB.js → chunk-A66CSUBJ.js} +1 -1
  34. package/dist/chunks/{chunk-OUVIWDL2.js → chunk-AGVOGPAZ.js} +1 -1
  35. package/dist/chunks/{chunk-U2MAPON2.js → chunk-AW5Q6NXT.js} +1 -1
  36. package/dist/chunks/{chunk-7AVNZF36.js → chunk-B46HZ3MX.js} +1 -1
  37. package/dist/chunks/{chunk-KGNCKIFP.js → chunk-BIPQCJ5V.js} +1 -1
  38. package/dist/chunks/{chunk-776WNDV2.js → chunk-BIQ33JV5.js} +1 -1
  39. package/dist/chunks/{chunk-JFXWI3EN.js → chunk-BK63OQRW.js} +1 -1
  40. package/dist/chunks/{chunk-BO5JZYWG.js → chunk-CFSIU6CW.js} +1 -1
  41. package/dist/chunks/{chunk-WC42WOLG.js → chunk-D3RRUWNN.js} +1 -1
  42. package/dist/chunks/{chunk-X4OSOOSU.js → chunk-D4UX2O45.js} +1 -1
  43. package/dist/chunks/{chunk-GJ2ZJFDD.js → chunk-DG4TYVPF.js} +1 -1
  44. package/dist/chunks/{chunk-QIKWJ2AA.js → chunk-DGIEXZJV.js} +1 -1
  45. package/dist/chunks/{chunk-JMBQYBPI.js → chunk-DIGX56JY.js} +1 -1
  46. package/dist/chunks/{chunk-4GPXTISD.js → chunk-DISNCX6R.js} +1 -1
  47. package/dist/chunks/{chunk-EWOSLZDX.js → chunk-DK7IKI7O.js} +1 -1
  48. package/dist/chunks/{chunk-74IIXVAE.js → chunk-DX7YEUNQ.js} +1 -1
  49. package/dist/chunks/{chunk-523TE4BI.js → chunk-E63VWAQA.js} +1 -1
  50. package/dist/chunks/{chunk-OLDK2LKJ.js → chunk-EL454L26.js} +1 -1
  51. package/dist/chunks/{chunk-WRI4XKSK.js → chunk-ENSB6ZTM.js} +1 -1
  52. package/dist/chunks/{chunk-EAPFMACH.js → chunk-ERJV5BMC.js} +1 -1
  53. package/dist/chunks/{chunk-RNIAFXMB.js → chunk-EXJGCNRS.js} +1 -1
  54. package/dist/chunks/chunk-F5KCCDQM.js +2 -0
  55. package/dist/chunks/{chunk-57TRXBLT.js → chunk-FSQWAANK.js} +1 -1
  56. package/dist/chunks/{chunk-BGJYITVI.js → chunk-G5B3PB5X.js} +1 -1
  57. package/dist/chunks/{chunk-ARLOVWQ3.js → chunk-GAWGIJQG.js} +1 -1
  58. package/dist/chunks/{chunk-ABZ2ZOLU.js → chunk-GGGF5NHJ.js} +1 -1
  59. package/dist/chunks/{chunk-4EDIRCD3.js → chunk-GOYBYYPQ.js} +1 -1
  60. package/dist/chunks/{chunk-H7ATCPPB.js → chunk-H3BSIAQO.js} +1 -1
  61. package/dist/chunks/{chunk-RBZH6A6M.js → chunk-HCEJAOIF.js} +1 -1
  62. package/dist/chunks/{chunk-OPNRWESL.js → chunk-IFQCOSU6.js} +1 -1
  63. package/dist/chunks/{chunk-VGRMAGOK.js → chunk-IJHZBHEK.js} +2 -2
  64. package/dist/chunks/{chunk-GUOLMLZN.js → chunk-ISFIDCIH.js} +1 -1
  65. package/dist/chunks/{chunk-PY6K2JRH.js → chunk-ITKTILKI.js} +1 -1
  66. package/dist/chunks/{chunk-3CDEBKSU.js → chunk-IUBARBGI.js} +1 -1
  67. package/dist/chunks/{chunk-2L5XWJJ5.js → chunk-J24I74EM.js} +1 -1
  68. package/dist/chunks/{chunk-IRV6GWGG.js → chunk-J7QGHA7G.js} +3 -3
  69. package/dist/chunks/{chunk-FAYASU7Z.js → chunk-JGWINTT5.js} +1 -1
  70. package/dist/chunks/{chunk-GL3NX3F3.js → chunk-JHEFWB6O.js} +1 -1
  71. package/dist/chunks/{chunk-V34H7Y2T.js → chunk-JHMS2WXM.js} +2 -2
  72. package/dist/chunks/{chunk-PSGGOZFM.js → chunk-JHR3LF2F.js} +1 -1
  73. package/dist/chunks/{chunk-O4VIXU7A.js → chunk-KGLJU66U.js} +3 -3
  74. package/dist/chunks/{chunk-XEOEKFG6.js → chunk-KJFRCVQC.js} +1 -1
  75. package/dist/chunks/chunk-KNO355LC.js +2 -0
  76. package/dist/chunks/{chunk-BQS7Z4AP.js → chunk-LD7PGREF.js} +2 -2
  77. package/dist/chunks/{chunk-MNC4YUDI.js → chunk-LHA7RQBA.js} +1 -1
  78. package/dist/chunks/{chunk-RZUEVS64.js → chunk-LO3O45IX.js} +1 -1
  79. package/dist/chunks/{chunk-TIHXUKFD.js → chunk-M2SKXY5C.js} +2 -2
  80. package/dist/chunks/{chunk-2IHO4GDJ.js → chunk-M3ZQDPRS.js} +1 -1
  81. package/dist/chunks/{chunk-DPHAN6N3.js → chunk-M4ZF44H5.js} +1 -1
  82. package/dist/chunks/{chunk-Y4OWBBDD.js → chunk-M55H7KVR.js} +1 -1
  83. package/dist/chunks/{chunk-NTB2O4RP.js → chunk-MGKMIRYG.js} +1 -1
  84. package/dist/chunks/{chunk-XJZSIXEO.js → chunk-MJGU2JJ2.js} +2 -2
  85. package/dist/chunks/{chunk-7K7O3CKY.js → chunk-MS37ISA4.js} +2 -2
  86. package/dist/chunks/{chunk-BRORSFJX.js → chunk-NCKXI2VB.js} +11 -11
  87. package/dist/chunks/chunk-NHUUCNAD.js +2 -0
  88. package/dist/chunks/{chunk-2WKUBGIF.js → chunk-O3VP46SE.js} +1 -1
  89. package/dist/chunks/{chunk-EUMXMT3S.js → chunk-O4FBOUNX.js} +1 -1
  90. package/dist/chunks/chunk-O6IFVTZT.js +9 -0
  91. package/dist/chunks/{chunk-ZH3K7LKQ.js → chunk-O7B44IYN.js} +1 -1
  92. package/dist/chunks/{chunk-ZAN4DYLH.js → chunk-OGMDEA3Y.js} +1 -1
  93. package/dist/chunks/{chunk-BL3YH2QU.js → chunk-OKBIWRHC.js} +1 -1
  94. package/dist/chunks/{chunk-FFRFSDBM.js → chunk-ON2RNOCG.js} +1 -1
  95. package/dist/chunks/{chunk-76M2MEHV.js → chunk-ONDCV5QC.js} +1 -1
  96. package/dist/chunks/{chunk-UCPGRPWY.js → chunk-OQ4VGCRG.js} +1 -1
  97. package/dist/chunks/{chunk-GVZLGS2U.js → chunk-OWK7HU5I.js} +1 -1
  98. package/dist/chunks/{chunk-JQKSXCAJ.js → chunk-OY5HC2P6.js} +1 -1
  99. package/dist/chunks/{chunk-T5AACNJI.js → chunk-P7HRF4FM.js} +1 -1
  100. package/dist/chunks/{chunk-7ED24PP6.js → chunk-PCNLC5H3.js} +1 -1
  101. package/dist/chunks/{chunk-ES2ISFJC.js → chunk-PF56N7ZY.js} +1 -1
  102. package/dist/chunks/{chunk-OX3XZKGK.js → chunk-PKALOVHC.js} +2 -2
  103. package/dist/chunks/{chunk-ZCHXGRRU.js → chunk-PR5TYTY4.js} +1 -1
  104. package/dist/chunks/{chunk-Q4TBTRIG.js → chunk-PWK5Z5S3.js} +1 -1
  105. package/dist/chunks/chunk-PXS4SVQG.js +16 -0
  106. package/dist/chunks/{chunk-AY64VY4E.js → chunk-QGOPYQW3.js} +1 -1
  107. package/dist/chunks/{chunk-LPWBIGKW.js → chunk-R7YEURUQ.js} +1 -1
  108. package/dist/chunks/{chunk-ACYFMLWG.js → chunk-RCA6NGVA.js} +2 -2
  109. package/dist/chunks/{chunk-DUURYZOI.js → chunk-RG3NH6YQ.js} +1 -1
  110. package/dist/chunks/{chunk-ATAOHSFR.js → chunk-RJIUOLWY.js} +1 -1
  111. package/dist/chunks/{chunk-37MWETFU.js → chunk-RXE3FYMJ.js} +1 -1
  112. package/dist/chunks/chunk-RYGWCN2R.js +2 -0
  113. package/dist/chunks/{chunk-VYLGI3IH.js → chunk-SFNCAPCJ.js} +1 -1
  114. package/dist/chunks/{chunk-Z4Z5UOZM.js → chunk-SG6JZ7HD.js} +1 -1
  115. package/dist/chunks/{chunk-IFDALGZE.js → chunk-SKRNWRKV.js} +5 -5
  116. package/dist/chunks/{chunk-ANFDRKUU.js → chunk-SLZH4Z6C.js} +1 -1
  117. package/dist/chunks/{chunk-WN3V6KDN.js → chunk-SPDSSMFD.js} +1 -1
  118. package/dist/chunks/{chunk-EQOV34UH.js → chunk-STWRTNRK.js} +1 -1
  119. package/dist/chunks/{chunk-XMWXH7TS.js → chunk-T5J7HIHR.js} +1 -1
  120. package/dist/chunks/{chunk-E72UU4VX.js → chunk-TBUAQWFS.js} +1 -1
  121. package/dist/chunks/{chunk-ZUJ3XUCP.js → chunk-TEPRCBDV.js} +1 -1
  122. package/dist/chunks/{chunk-2G4BEISF.js → chunk-TOFMA2L5.js} +2 -2
  123. package/dist/chunks/{chunk-TKLBP3MM.js → chunk-UFHLLSCE.js} +1 -1
  124. package/dist/chunks/{chunk-BE6SS65L.js → chunk-UJKQLO6B.js} +2 -2
  125. package/dist/chunks/{chunk-O3RF72BT.js → chunk-UZQNFTLR.js} +1 -1
  126. package/dist/chunks/{chunk-F74GBN6K.js → chunk-V2HMWCT6.js} +1 -1
  127. package/dist/chunks/{chunk-6ZFPQYHG.js → chunk-V4KT5FCJ.js} +1 -1
  128. package/dist/chunks/{chunk-TVQAPBLZ.js → chunk-VHSX3JPX.js} +1 -1
  129. package/dist/chunks/{chunk-22VMH6JV.js → chunk-W2SXOGTQ.js} +1 -1
  130. package/dist/chunks/{chunk-PH6IORGZ.js → chunk-WDEO44UN.js} +1 -1
  131. package/dist/chunks/{chunk-LNCHFVHT.js → chunk-WEHBK3MC.js} +1 -1
  132. package/dist/chunks/{chunk-KO3HNMLJ.js → chunk-WGX7WY4N.js} +1 -1
  133. package/dist/chunks/{chunk-CKMSBAI2.js → chunk-WHREO7A2.js} +1 -1
  134. package/dist/chunks/{chunk-N6ENLEMY.js → chunk-WS2ZZBAQ.js} +3 -3
  135. package/dist/chunks/{chunk-DIO5CB6U.js → chunk-WYZWDMMF.js} +1 -1
  136. package/dist/chunks/{chunk-MQULU465.js → chunk-XO3H32KX.js} +1 -1
  137. package/dist/chunks/{chunk-FKJHEZCW.js → chunk-XQBIHPPX.js} +1 -1
  138. package/dist/chunks/chunk-XRKFTPHD.js +2 -0
  139. package/dist/chunks/{chunk-YHHF4Q7Y.js → chunk-XSCIOQYE.js} +1 -1
  140. package/dist/chunks/{chunk-COHMDT7A.js → chunk-XTWEWYK7.js} +7 -7
  141. package/dist/chunks/{chunk-AQD7K4Z5.js → chunk-Y3GIM6WK.js} +1 -1
  142. package/dist/chunks/{chunk-74ZXXBGN.js → chunk-Y54RKLOI.js} +1 -1
  143. package/dist/chunks/{chunk-C37PUHA6.js → chunk-Y777GISF.js} +1 -1
  144. package/dist/chunks/{chunk-PFSMXKTI.js → chunk-YDU3S6UT.js} +1 -1
  145. package/dist/chunks/{chunk-UGL7WF3W.js → chunk-YOZIZYSC.js} +1 -1
  146. package/dist/chunks/{chunk-OSIO7PLX.js → chunk-YQKOB56U.js} +1 -1
  147. package/dist/chunks/chunk-YVNDDNMK.js +3 -0
  148. package/dist/chunks/{chunk-U5FKRYJO.js → chunk-ZAZKJJOT.js} +1 -1
  149. package/dist/chunks/{chunk-2RNQQNB7.js → chunk-ZR7LIMJS.js} +1 -1
  150. package/dist/chunks/{chunk-PQJTYOR2.js → chunk-ZTJOOY2F.js} +1 -1
  151. package/dist/chunks/{chunk-GPVCOEUH.js → chunk-ZTVXRZ6D.js} +1 -1
  152. package/dist/chunks/cli-CNYNXKGQ.js +2 -0
  153. package/dist/chunks/configuration-command-5K7EE2J5.js +2 -0
  154. package/dist/chunks/connected-app-executor-E25XCNAS.js +2 -0
  155. package/dist/chunks/connected-evidence-QNSO5BTF.js +2 -0
  156. package/dist/chunks/connection-Y2KCMBYD.js +2 -0
  157. package/dist/chunks/{continual-WFPIDWPH.js → continual-SOO3QBNQ.js} +1 -1
  158. package/dist/chunks/core-commands-ZTWPYAFQ.js +2 -0
  159. package/dist/chunks/datasets-XPUMWGOC.js +2 -0
  160. package/dist/chunks/desktop-test-HVSW4JHY.js +3 -0
  161. package/dist/chunks/dist-4N6AHWNN.js +2 -0
  162. package/dist/chunks/{dist-OMGUJYPD.js → dist-N6R6VNFD.js} +1 -1
  163. package/dist/chunks/{dist-OGLX76LL.js → dist-QN7WKZ2D.js} +1 -1
  164. package/dist/chunks/{enclave-QS4BUNDU.js → enclave-VURYNILU.js} +1 -1
  165. package/dist/chunks/evaluation-coordination-AOTFPVMS.js +2 -0
  166. package/dist/chunks/experiment-improvements-75CN3VI7.js +2 -0
  167. package/dist/chunks/experiments-AGAHM2AK.js +2 -0
  168. package/dist/chunks/{experiments-VFQGE4HC.js → experiments-DYSHYBGB.js} +1 -1
  169. package/dist/chunks/{extension-JCUA3RWV.js → extension-UT4CSDJF.js} +1 -1
  170. package/dist/chunks/help-KU52CFMW.js +8 -0
  171. package/dist/chunks/host-profile-evaluation-tools-LZDMQCMT.js +2 -0
  172. package/dist/chunks/host-profile-external-dataset-VK3NJHMC.js +2 -0
  173. package/dist/chunks/hosted-app-server-composition-P7V7K7CG.js +2 -0
  174. package/dist/chunks/{hosted-experiment-improvement-42YWXB3P.js → hosted-experiment-improvement-P433KDX2.js} +1 -1
  175. package/dist/chunks/hosted-harness-runtime-Y4DONWPC.js +2 -0
  176. package/dist/chunks/{hosted-profile-candidate-HVVC43XQ.js → hosted-profile-candidate-72MMPN6U.js} +1 -1
  177. package/dist/chunks/hosted-profile-compiler-RXHLK224.js +2 -0
  178. package/dist/chunks/hosted-profile-evaluation-control-LS4DCSDO.js +2 -0
  179. package/dist/chunks/{hosted-profile-evaluation-inspection-BUWLCKCD.js → hosted-profile-evaluation-inspection-3Q6EHO66.js} +1 -1
  180. package/dist/chunks/{hosted-profile-evaluation-preparation-3XLRR6UH.js → hosted-profile-evaluation-preparation-ZD27HNLF.js} +1 -1
  181. package/dist/chunks/{hosted-tasksets-THKM5QY5.js → hosted-tasksets-V2PQZJN4.js} +1 -1
  182. package/dist/chunks/human-review-4FJFINQX.js +2 -0
  183. package/dist/chunks/{import-CBDJ4DME.js → import-GBHSLA3G.js} +1 -1
  184. package/dist/chunks/{learning-ACEVFL5M.js → learning-U3FZL5YB.js} +1 -1
  185. package/dist/chunks/local-harness-improvement-runtime-UP2P7UT4.js +2 -0
  186. package/dist/chunks/local-harness-taskset-review-ZNOKSPJJ.js +2 -0
  187. package/dist/chunks/{local-scope-HVF2GZ5W.js → local-scope-62GWHDXS.js} +1 -1
  188. package/dist/chunks/{model-projects-QPO22JPA.js → model-projects-LQ4C6R3X.js} +1 -1
  189. package/dist/chunks/opchat-Q4PIWPYW.js +3 -0
  190. package/dist/chunks/organizations-TEH6HBQ3.js +2 -0
  191. package/dist/chunks/{profile-Y2MCSOUK.js → profile-SWPVCGTR.js} +1 -1
  192. package/dist/chunks/{profile-training-source-6GOT7AHM.js → profile-training-source-J73ZLNSC.js} +1 -1
  193. package/dist/chunks/project-action-payload-OU3ZPHW7.js +2 -0
  194. package/dist/chunks/project-agent-J7ILCRBS.js +2 -0
  195. package/dist/chunks/{published-experiment-source-5TMGLKDM.js → published-experiment-source-HVHKSYDL.js} +1 -1
  196. package/dist/chunks/refiner-profile-service-E7YU4E3N.js +2 -0
  197. package/dist/chunks/{runtime-QFXCXSVB.js → runtime-LIPHPKKJ.js} +2 -2
  198. package/dist/chunks/sandbox-command-G6KID3OP.js +2 -0
  199. package/dist/chunks/{sandbox-template-XWWPWWNR.js → sandbox-template-MZTMAUFS.js} +1 -1
  200. package/dist/chunks/saved-work-LOUWLF37.js +2 -0
  201. package/dist/chunks/{send-turn-SIXOZUVJ.js → send-turn-UEUEGY5W.js} +1 -1
  202. package/dist/chunks/{src-EZAKCCUV.js → src-7WMZOWZZ.js} +102 -95
  203. package/dist/chunks/{src-6SHCCYEN.js → src-MVAK6D6Y.js} +1 -1
  204. package/dist/chunks/standalone-experiment-turn-owner-YRKEOEJ2.js +2 -0
  205. package/dist/chunks/{store-continual-support-reviews-GDX6CSUU.js → store-continual-support-reviews-FJLLNKCY.js} +1 -1
  206. package/dist/chunks/{store-conversation-serving-W55XMDH4.js → store-conversation-serving-4KWR4IZY.js} +1 -1
  207. package/dist/chunks/{store-create-improve-A7E7CUPZ.js → store-create-improve-JWBJZRAU.js} +1 -1
  208. package/dist/chunks/{store-datasets-HKF3EO7B.js → store-datasets-4N2M6Y3K.js} +2 -2
  209. package/dist/chunks/{store-evaluation-results-645RFBGR.js → store-evaluation-results-OBM4623U.js} +1 -1
  210. package/dist/chunks/{store-harness-memory-VINCZ4GK.js → store-harness-memory-4HUEMRCD.js} +1 -1
  211. package/dist/chunks/{store-harness-refinement-candidates-EA5KFQPH.js → store-harness-refinement-candidates-NMRWMN23.js} +1 -1
  212. package/dist/chunks/store-harness-workspaces-BGONIQDY.js +2 -0
  213. package/dist/chunks/{store-human-review-F5KESW52.js → store-human-review-J75SIZAL.js} +1 -1
  214. package/dist/chunks/store-learned-preference-migration-validation-VLASM4CT.js +2 -0
  215. package/dist/chunks/store-learning-TUCQFBLT.js +2 -0
  216. package/dist/chunks/{store-learning-credentials-WZQJ4HPJ.js → store-learning-credentials-S4RF57NV.js} +1 -1
  217. package/dist/chunks/{store-local-experiments-HWQWNTIU.js → store-local-experiments-LULRLTII.js} +5 -5
  218. package/dist/chunks/{store-model-batch-review-TOCSDVAP.js → store-model-batch-review-SVL4MT6D.js} +1 -1
  219. package/dist/chunks/{store-model-configuration-6543ASY2.js → store-model-configuration-ZHDSM3XM.js} +2 -2
  220. package/dist/chunks/{store-preference-comparison-LV32MHVL.js → store-preference-comparison-YMMCKXS5.js} +1 -1
  221. package/dist/chunks/{store-schedules-VGTEQVKH.js → store-schedules-6Z4QS3NU.js} +1 -1
  222. package/dist/chunks/{store-sidebar-file-bookmarks-53B7QIGS.js → store-sidebar-file-bookmarks-MX6EP6OB.js} +2 -2
  223. package/dist/chunks/{store-sidebar-preferences-YXGEJVUO.js → store-sidebar-preferences-VYREPW26.js} +1 -1
  224. package/dist/chunks/{store-subagents-HRCAK7VZ.js → store-subagents-WGBCRALX.js} +1 -1
  225. package/dist/chunks/{store-task-inbox-WF74W4U2.js → store-task-inbox-43BNZSB7.js} +6 -6
  226. package/dist/chunks/{store-task-inventory-KHCTEZVK.js → store-task-inventory-AEW4POAJ.js} +2 -2
  227. package/dist/chunks/{store-taskset-drafts-3ACG5AVX.js → store-taskset-drafts-DKFO2CYB.js} +1 -1
  228. package/dist/chunks/{store-training-R46WOGXB.js → store-training-6PFFR6ST.js} +1 -1
  229. package/dist/chunks/{store-training-jobs-D4LECE7O.js → store-training-jobs-ANDEBQ67.js} +2 -2
  230. package/dist/chunks/{store-training-models-EQVNXOVB.js → store-training-models-OOI4ZJPX.js} +2 -2
  231. package/dist/chunks/{store-usage-IE2U2FD3.js → store-usage-U72RNW64.js} +1 -1
  232. package/dist/chunks/{store-work-evidence-QQDKM5AQ.js → store-work-evidence-NY5OBATB.js} +1 -1
  233. package/dist/chunks/{taskset-NR2X2UOK.js → taskset-SL3YOXW7.js} +1 -1
  234. package/dist/chunks/{taskset-packages-ONULEIVI.js → taskset-packages-3PCEYYDA.js} +1 -1
  235. package/dist/chunks/{teams-bot-CHUYMD6K.js → teams-bot-IDEF3BMI.js} +1 -1
  236. package/dist/chunks/{training-IDSGYGU2.js → training-57ISIC7U.js} +1 -1
  237. package/dist/chunks/web-search-222Y63QW.js +2 -0
  238. package/dist/chunks/{workspaces-2TJRDM5K.js → workspaces-5DF4H5EX.js} +1 -1
  239. package/dist/cli.js +1 -1
  240. package/dist/index.js +1 -1
  241. package/dist/sandbox-template/manifest.js +1 -1
  242. package/dist/web/assets/{App-CaRMZoxo.css → App-DbYvV_W6.css} +1 -1
  243. package/dist/web/assets/{App-pcwmC4IR.js → App-nzE7JU_O.js} +4 -4
  244. package/dist/web/assets/{AppDialog-CdHad7GT.js → AppDialog-VtNvqbDm.js} +1 -1
  245. package/dist/web/assets/{AppTerminalPanel-CrmoOgd4.js → AppTerminalPanel-BMfKdrrN.js} +2 -2
  246. package/dist/web/assets/{AppsView-0P6cBsD4.js → AppsView-CdWyrDEb.js} +1 -1
  247. package/dist/web/assets/{BrowserSidebar-Cb6edJw6.js → BrowserSidebar-CtOIciOa.js} +1 -1
  248. package/dist/web/assets/{CartesianChart-B2Sxi0lv.js → CartesianChart-u1lvLM30.js} +1 -1
  249. package/dist/web/assets/{CollaborationTabs-PP0AIXhb.js → CollaborationTabs-CaBfDYRW.js} +1 -1
  250. package/dist/web/assets/{CommandMenu-GfQIMe6W.js → CommandMenu-CFW3WJ11.js} +1 -1
  251. package/dist/web/assets/{CommunityView-V6KmMl5n.js → CommunityView-D2EjaeuH.js} +1 -1
  252. package/dist/web/assets/{ComposerCreateImproveStrip-oeVeyhPX.js → ComposerCreateImproveStrip-6wYSJdzv.js} +1 -1
  253. package/dist/web/assets/{ConversationImportsSettings-CuQcvVgE.js → ConversationImportsSettings-BJ4QhF7p.js} +1 -1
  254. package/dist/web/assets/{GetStartedView-2oZ068h_.js → GetStartedView-DBcOwIJn.js} +1 -1
  255. package/dist/web/assets/{HostedModelLearningReview-DLzak_Vf.js → HostedModelLearningReview-BNpK6_W9.js} +1 -1
  256. package/dist/web/assets/{HostedModelLearningSettings-Eca6Pd9R.js → HostedModelLearningSettings-SrsdeeoA.js} +1 -1
  257. package/dist/web/assets/{LabModelVersionDetailPage-DsBblnMp.js → LabModelVersionDetailPage-Cd6bRHt9.js} +1 -1
  258. package/dist/web/assets/{LabSkillSidebar-DDknttrB.js → LabSkillSidebar-CQfvel4w.js} +1 -1
  259. package/dist/web/assets/{LabsRoute-CgNiUHsy.js → LabsRoute-sXLJt1KR.js} +4 -4
  260. package/dist/web/assets/{MainChatThread-yCVg99LU.js → MainChatThread-dlDDK2JM.js} +2 -2
  261. package/dist/web/assets/{MainPane-C86le7UF.js → MainPane-DCz38-qy.js} +4 -4
  262. package/dist/web/assets/{MarkdownText-BBVriBCj.js → MarkdownText-Drjq6-JM.js} +1 -1
  263. package/dist/web/assets/{NativeSkillSidebar-D2uVZkqh.js → NativeSkillSidebar-jncZijt-.js} +1 -1
  264. package/dist/web/assets/{NewExperienceSwitcher-DuD6GScJ.js → NewExperienceSwitcher-DXKzoMaM.js} +1 -1
  265. package/dist/web/assets/{NewProjectDialog-B6XZkJrU.js → NewProjectDialog-DIyjAxJG.js} +1 -1
  266. package/dist/web/assets/{OutputsPage-PUlmcWjv.js → OutputsPage-Dy1cNr3n.js} +1 -1
  267. package/dist/web/assets/{ProjectsPage-DWBRmej6.js → ProjectsPage-D2EeybIv.js} +1 -1
  268. package/dist/web/assets/{RightChatPanelStack-HaCVep4t.js → RightChatPanelStack-4wUL-W9_.js} +1 -1
  269. package/dist/web/assets/{RightSidebarHomePanel-BUtdPb2L.js → RightSidebarHomePanel-Bd_AHUp8.js} +1 -1
  270. package/dist/web/assets/{ScheduledWorkPage-Dg9GkGrT.js → ScheduledWorkPage-BJkSzwz2.js} +1 -1
  271. package/dist/web/assets/{SettingsView-DtldfnV-.js → SettingsView-BhcP72KH.js} +3 -3
  272. package/dist/web/assets/{TeamChatView-C71JX4je.js → TeamChatView-CR0fdicZ.js} +1 -1
  273. package/dist/web/assets/{TerminalOverlay-B4F6Q36s.js → TerminalOverlay-DGrZRZ_3.js} +10 -10
  274. package/dist/web/assets/{TrainingCreationPanel-B9MxFzQx.js → TrainingCreationPanel-BsTG7aFS.js} +1 -1
  275. package/dist/web/assets/{TrainingDraftPanel-7C48sHfC.js → TrainingDraftPanel-ByErrht7.js} +1 -1
  276. package/dist/web/assets/{UsageSettingsSection-CC57FcUB.js → UsageSettingsSection-DeYTJbcM.js} +1 -1
  277. package/dist/web/assets/{WorkSidebarPanel-Cto1usLM.js → WorkSidebarPanel-DcNvEEoy.js} +1 -1
  278. package/dist/web/assets/{WorkspaceDiffPanel-CL7wi3kp.js → WorkspaceDiffPanel-CdPRcYWN.js} +3 -3
  279. package/dist/web/assets/{WorkspaceEnvironmentMenu-zdzSDofs.js → WorkspaceEnvironmentMenu-xUYg-iGn.js} +1 -1
  280. package/dist/web/assets/{WorkspaceGitDialogs-CZSmjnrc.js → WorkspaceGitDialogs-CBViLL3S.js} +1 -1
  281. package/dist/web/assets/{WorkspaceMonacoEditor-TrUDJMKb.js → WorkspaceMonacoEditor-frxie2_S.js} +3 -3
  282. package/dist/web/assets/{agent-connections-4Dza2mDg.js → agent-connections-D7ao-vbU.js} +1 -1
  283. package/dist/web/assets/{arrow-up-right-xKb5kWQJ.js → arrow-up-right-DCWPxdbD.js} +1 -1
  284. package/dist/web/assets/{chunk-P3BRSSRD-BsGTkgyC.js → chunk-P3BRSSRD-B5JXa0Nh.js} +1 -1
  285. package/dist/web/assets/{clipboard-BgjV3aCx.js → clipboard-B-GnMVLp.js} +1 -1
  286. package/dist/web/assets/{cloud-upload-Bw9XUsKQ.js → cloud-upload-DpaGFZ9J.js} +1 -1
  287. package/dist/web/assets/{cssMode-DxsFJGb-.js → cssMode-DJHE7R3W.js} +1 -1
  288. package/dist/web/assets/{folder-open-CbmUjIYS.js → folder-open-B-DFLDFH.js} +1 -1
  289. package/dist/web/assets/{folder-plus-slsst7Ct.js → folder-plus-CPXxPvSH.js} +1 -1
  290. package/dist/web/assets/{git-commit-horizontal-BIS-8MuS.js → git-commit-horizontal-DCTzcivA.js} +1 -1
  291. package/dist/web/assets/{htmlMode-BE4VOrZo.js → htmlMode-DxZVBAYd.js} +1 -1
  292. package/dist/web/assets/index-BojtIRzO.css +1 -0
  293. package/dist/web/assets/{index-DEg0S7Qk.js → index-Di1MU6Xr.js} +2 -2
  294. package/dist/web/assets/{info-5bL9xSSf.js → info-BMxsR_bn.js} +1 -1
  295. package/dist/web/assets/{jsonMode-CYimnBhD.js → jsonMode-CzWoMkpp.js} +1 -1
  296. package/dist/web/assets/{lspLanguageFeatures-CiFuk-P7.js → lspLanguageFeatures-15K7ND6Q.js} +1 -1
  297. package/dist/web/assets/{minimize-2-BGVWKvTg.js → minimize-2-DwUgqXoR.js} +1 -1
  298. package/dist/web/assets/{monaco.contribution-DkLVGT8N.js → monaco.contribution-BBLKjER5.js} +2 -2
  299. package/dist/web/assets/{monaco.contribution-BTY4dJ0f.js → monaco.contribution-DBjvSu8p.js} +2 -2
  300. package/dist/web/assets/{monaco.contribution-DUE3CQph.js → monaco.contribution-DUWvjhIG.js} +2 -2
  301. package/dist/web/assets/{monaco.contribution-C7sMrcos.js → monaco.contribution-w0zfkYLX.js} +2 -2
  302. package/dist/web/assets/{monitor-B5hx_tzp.js → monitor-Ihu5LVYx.js} +1 -1
  303. package/dist/web/assets/{play-pmSO95Qg.js → play-D_YGCdxU.js} +1 -1
  304. package/dist/web/assets/{python-CiZvL3LX.js → python-Q4OuoXYc.js} +1 -1
  305. package/dist/web/assets/{save-CvYL4DUg.js → save-DJYUOhtD.js} +1 -1
  306. package/dist/web/assets/{square-DT_uFOml.js → square-DXtoCBNw.js} +1 -1
  307. package/dist/web/assets/{toggleHighContrast-CrE1_HY0.js → toggleHighContrast-CaNeuWVE.js} +1 -1
  308. package/dist/web/assets/{tsMode-CI_PdZmj.js → tsMode-CJnQ2wmM.js} +1 -1
  309. package/dist/web/assets/{upload-PVi8vC3T.js → upload-fCP3_OEO.js} +1 -1
  310. package/dist/web/assets/{useLocalAgentSchedules-BHJNVf42.js → useLocalAgentSchedules-BFoH_gwZ.js} +1 -1
  311. package/dist/web/assets/{useProviderSettings-CU3zXyie.js → useProviderSettings-2eysgqiA.js} +1 -1
  312. package/dist/web/assets/{useSessionTurnCache-BE7cipLX.js → useSessionTurnCache-DLF5SPD-.js} +1 -1
  313. package/dist/web/assets/{wifi-off-7WiFuOhD.js → wifi-off-DZoiFrRz.js} +1 -1
  314. package/dist/web/assets/{workers-Cv8r4CvM.js → workers-D5nr74M-.js} +1 -1
  315. package/dist/web/assets/{yaml-Bj7mdkV2.js → yaml-CwsoTJmk.js} +1 -1
  316. package/dist/web/index.html +2 -2
  317. package/docs/command-reference.md +12 -0
  318. package/package.json +1 -1
  319. package/dist/chunks/app-server-harness-services-DDFUMNYC.js +0 -2
  320. package/dist/chunks/app-server-runtime-SVB6L26M.js +0 -2
  321. package/dist/chunks/apps-EZB56RHV.js +0 -2
  322. package/dist/chunks/chunk-7UH4YDA7.js +0 -3
  323. package/dist/chunks/chunk-CGWA54LE.js +0 -2
  324. package/dist/chunks/chunk-K44RHALX.js +0 -2
  325. package/dist/chunks/chunk-MFMYWZK2.js +0 -2
  326. package/dist/chunks/chunk-P2RSBSCT.js +0 -2
  327. package/dist/chunks/chunk-QDC4OW3S.js +0 -2
  328. package/dist/chunks/chunk-SF5HJ7PL.js +0 -16
  329. package/dist/chunks/chunk-YBT2NB32.js +0 -2
  330. package/dist/chunks/chunk-YCQSVHCD.js +0 -9
  331. package/dist/chunks/cli-5DFVQL5Y.js +0 -2
  332. package/dist/chunks/configuration-command-JS6U3RMC.js +0 -2
  333. package/dist/chunks/connected-app-executor-UBMGMV76.js +0 -2
  334. package/dist/chunks/connected-evidence-NLAIEVQ3.js +0 -2
  335. package/dist/chunks/connection-NZSD3U5O.js +0 -2
  336. package/dist/chunks/core-commands-U4IBRRY5.js +0 -2
  337. package/dist/chunks/datasets-UX47DTTB.js +0 -2
  338. package/dist/chunks/desktop-test-UUU7PD4P.js +0 -3
  339. package/dist/chunks/dist-W5MJYSPF.js +0 -2
  340. package/dist/chunks/evaluation-coordination-3YQN5JQW.js +0 -2
  341. package/dist/chunks/experiment-improvements-ZRVD2AGY.js +0 -2
  342. package/dist/chunks/experiments-JEB5A2N5.js +0 -2
  343. package/dist/chunks/help-KA4OINP5.js +0 -8
  344. package/dist/chunks/host-profile-evaluation-tools-2URLU5SG.js +0 -2
  345. package/dist/chunks/host-profile-external-dataset-B2AQNSDR.js +0 -2
  346. package/dist/chunks/hosted-app-server-composition-VJQ3FM4I.js +0 -2
  347. package/dist/chunks/hosted-harness-runtime-BM4WONJN.js +0 -2
  348. package/dist/chunks/hosted-profile-compiler-RKDWHYK3.js +0 -2
  349. package/dist/chunks/hosted-profile-evaluation-control-57V24UGU.js +0 -2
  350. package/dist/chunks/human-review-CSYAW4PC.js +0 -2
  351. package/dist/chunks/local-harness-improvement-runtime-3T6E7I5Q.js +0 -2
  352. package/dist/chunks/local-harness-taskset-review-LQPQBALH.js +0 -2
  353. package/dist/chunks/opchat-6ADSONAD.js +0 -3
  354. package/dist/chunks/organizations-GT24ZTCN.js +0 -2
  355. package/dist/chunks/project-action-payload-GHSLE7K3.js +0 -2
  356. package/dist/chunks/project-agent-YYSQIHVE.js +0 -2
  357. package/dist/chunks/refiner-profile-service-ZK7KAFP5.js +0 -2
  358. package/dist/chunks/sandbox-command-U6346TVJ.js +0 -2
  359. package/dist/chunks/saved-work-SWHZ4OLO.js +0 -2
  360. package/dist/chunks/standalone-experiment-turn-owner-LIAQWTGI.js +0 -2
  361. package/dist/chunks/store-harness-workspaces-XUM4Z66X.js +0 -2
  362. package/dist/chunks/store-learned-preference-migration-validation-V27XD4I7.js +0 -2
  363. package/dist/chunks/store-learning-WLG6KFIO.js +0 -2
  364. package/dist/chunks/web-search-BPON7H5N.js +0 -2
  365. package/dist/web/assets/index-erq7hUne.css +0 -1
@@ -1 +1 @@
1
- import{r as h,j as e}from"./index-DEg0S7Qk.js";import{bA as f,aG as b,L as d,y as x,X as j}from"./App-pcwmC4IR.js";/* empty css */function C({creation:s,training:r,compact:i=!1,onOpenTraining:t}){const[o,g]=h.useState(""),[c,u]=h.useState(""),n=s.state,a=!!r.busyAction;return h.useEffect(()=>{g(""),u("")},[s.id,n]),e.jsxs("section",{className:i?`composer-create-strip ${k(n)} training-create-strip`:"training-approval","aria-label":"Training task status",children:[i?e.jsxs("div",{className:"composer-create-strip-heading",children:[n==="planning"||n==="materializing"||n==="validating"?e.jsx(f,{className:"composer-create-spin",size:15}):n==="failed"?e.jsx(b,{size:15}):e.jsx(d,{size:15}),e.jsx("span",{children:v(n)}),e.jsx("small",{children:"training"})]}):null,n==="awaiting_disclosure_approval"?e.jsxs("div",{className:i?"composer-create-plan-summary":"training-creation-content",children:[i?null:e.jsx("strong",{children:"Review selected evidence with the authoring model?"}),e.jsxs("p",{children:["Approve sends excerpts from ",s.request.sourceIds.length," explicitly selected source",s.request.sourceIds.length===1?"":"s"," to ",s.request.analysisModel?.providerId,"/",s.request.analysisModel?.modelId," so it can propose a Taskset and grader. This does not start training."]}),e.jsxs("div",{className:i?"composer-create-actions":"training-inline-actions",children:[e.jsxs("button",{className:i?void 0:"training-button",disabled:a,onClick:()=>{r.actions.approveDisclosure(s.id,!0)},children:[e.jsx(x,{size:13}),e.jsx("span",{children:"Approve evidence"})]}),e.jsxs("button",{className:i?void 0:"training-button secondary",disabled:a,onClick:()=>{r.actions.approveDisclosure(s.id,!1)},children:[e.jsx(j,{size:13}),e.jsx("span",{children:"Decline"})]}),i&&t?e.jsxs("button",{disabled:a,onClick:t,children:[e.jsx(d,{size:13}),e.jsx("span",{children:"Open Training"})]}):null]})]}):n==="awaiting_materialization_approval"&&s.proposal?e.jsxs("div",{className:i?"composer-create-plan-summary":"training-creation-content",children:[i?null:e.jsx("strong",{children:s.proposal.name}),e.jsx("p",{children:s.proposal.objective}),e.jsxs("div",{className:"training-creation-plan-facts",children:[e.jsx("span",{children:s.proposal.taskKind.replaceAll("_"," ")}),e.jsxs("span",{children:[s.proposal.proposedGraders.length," grader",s.proposal.proposedGraders.length===1?"":"s"]}),e.jsx("span",{children:s.proposal.proposedMethod.replaceAll("_"," ")})]}),s.request.mode==="customize"?e.jsxs("div",{className:"training-question-answer",children:[e.jsx("input",{value:c,onChange:l=>u(l.target.value),placeholder:"Revise tasks, graders, fixtures, or policy"}),e.jsx("button",{className:i?void 0:"training-button secondary",disabled:!c.trim()||a,onClick:async()=>{const l=c;u(""),await r.actions.chatCreation(s.id,l)},children:"Revise"})]}):null,e.jsxs("div",{className:i?"composer-create-actions":"training-inline-actions",children:[e.jsxs("button",{className:i?void 0:"training-button",disabled:a,onClick:()=>{r.actions.materialize(s.id,!0)},children:[e.jsx(x,{size:13}),e.jsx("span",{children:"Materialize Taskset"})]}),t?e.jsxs("button",{className:i?void 0:"training-button secondary",disabled:a,onClick:t,children:[e.jsx(d,{size:13}),e.jsx("span",{children:"Review details"})]}):null,e.jsxs("button",{className:i?void 0:"training-button secondary",disabled:a,onClick:()=>{r.actions.materialize(s.id,!1)},children:[e.jsx(j,{size:13}),e.jsx("span",{children:"Cancel"})]})]})]}):n==="awaiting_questions"?e.jsx("div",{className:i?"composer-create-question":"training-creation-content",children:(()=>{const l=s.blockingQuestions.find(p=>!p.answer);return l?e.jsxs(e.Fragment,{children:[e.jsx("p",{children:l.prompt}),e.jsxs("div",{className:"training-question-answer",children:[e.jsx("input",{value:o,onChange:p=>g(p.target.value)}),e.jsx("button",{className:i?void 0:"training-button",disabled:!o.trim()||a,onClick:()=>{r.actions.answerQuestions(s.id,{[l.id]:o})},children:"Continue"})]})]}):null})()}):e.jsxs("div",{className:i?"composer-create-status-body":"training-creation-content",children:[e.jsx("p",{children:m(s)}),i&&t?e.jsx("div",{className:"composer-create-actions",children:e.jsxs("button",{onClick:t,children:[e.jsx(d,{size:13}),e.jsx("span",{children:"Open Training"})]})}):null]})]})}function y({creation:s}){return e.jsxs("section",{className:"chat-create-receipt","aria-label":"Training status",children:[e.jsxs("div",{className:"chat-create-receipt-heading",children:[e.jsx(d,{size:14}),e.jsx("span",{children:v(s.state)}),e.jsx("small",{children:"training"})]}),e.jsx("p",{children:s.request.objective??m(s)}),e.jsxs("div",{className:"chat-create-receipt-facts",children:[e.jsxs("span",{children:[s.request.sourceIds.length," selected source",s.request.sourceIds.length===1?"":"s"]}),e.jsx("span",{children:s.request.mode==="customize"?"guided plan":"fast draft"})]})]})}function v(s){return s==="awaiting_disclosure_approval"?"Training evidence review":s==="awaiting_materialization_approval"?"Training plan ready":s==="awaiting_questions"?"Training question":s==="materializing"?"Materializing Taskset":s==="ready"?"Taskset ready":s==="failed"?"Training plan failed":s==="cancelled"?"Training plan cancelled":"Preparing training plan"}function m(s){return s.blockedReason?s.blockedReason:s.state==="ready"?"The reviewed Taskset was materialized. Training still requires a separate approval.":s.state==="cancelled"?"Taskset creation was cancelled.":s.state==="planning"?"The authoring model is proposing tasks, graders, fixtures, and policy boundaries.":`Task Creator is ${s.state.replaceAll("_"," ")}.`}function k(s){return s==="ready"?"success":s==="failed"||s==="cancelled"?"danger":s==="awaiting_disclosure_approval"||s==="awaiting_materialization_approval"||s==="awaiting_questions"?"warning":"info"}export{C as TrainingCreationPanel,y as TrainingStatusReceipt};
1
+ import{r as h,j as e}from"./index-Di1MU6Xr.js";import{bA as f,aG as b,L as d,y as x,X as j}from"./App-nzE7JU_O.js";/* empty css */function C({creation:s,training:r,compact:i=!1,onOpenTraining:t}){const[o,g]=h.useState(""),[c,u]=h.useState(""),n=s.state,a=!!r.busyAction;return h.useEffect(()=>{g(""),u("")},[s.id,n]),e.jsxs("section",{className:i?`composer-create-strip ${k(n)} training-create-strip`:"training-approval","aria-label":"Training task status",children:[i?e.jsxs("div",{className:"composer-create-strip-heading",children:[n==="planning"||n==="materializing"||n==="validating"?e.jsx(f,{className:"composer-create-spin",size:15}):n==="failed"?e.jsx(b,{size:15}):e.jsx(d,{size:15}),e.jsx("span",{children:v(n)}),e.jsx("small",{children:"training"})]}):null,n==="awaiting_disclosure_approval"?e.jsxs("div",{className:i?"composer-create-plan-summary":"training-creation-content",children:[i?null:e.jsx("strong",{children:"Review selected evidence with the authoring model?"}),e.jsxs("p",{children:["Approve sends excerpts from ",s.request.sourceIds.length," explicitly selected source",s.request.sourceIds.length===1?"":"s"," to ",s.request.analysisModel?.providerId,"/",s.request.analysisModel?.modelId," so it can propose a Taskset and grader. This does not start training."]}),e.jsxs("div",{className:i?"composer-create-actions":"training-inline-actions",children:[e.jsxs("button",{className:i?void 0:"training-button",disabled:a,onClick:()=>{r.actions.approveDisclosure(s.id,!0)},children:[e.jsx(x,{size:13}),e.jsx("span",{children:"Approve evidence"})]}),e.jsxs("button",{className:i?void 0:"training-button secondary",disabled:a,onClick:()=>{r.actions.approveDisclosure(s.id,!1)},children:[e.jsx(j,{size:13}),e.jsx("span",{children:"Decline"})]}),i&&t?e.jsxs("button",{disabled:a,onClick:t,children:[e.jsx(d,{size:13}),e.jsx("span",{children:"Open Training"})]}):null]})]}):n==="awaiting_materialization_approval"&&s.proposal?e.jsxs("div",{className:i?"composer-create-plan-summary":"training-creation-content",children:[i?null:e.jsx("strong",{children:s.proposal.name}),e.jsx("p",{children:s.proposal.objective}),e.jsxs("div",{className:"training-creation-plan-facts",children:[e.jsx("span",{children:s.proposal.taskKind.replaceAll("_"," ")}),e.jsxs("span",{children:[s.proposal.proposedGraders.length," grader",s.proposal.proposedGraders.length===1?"":"s"]}),e.jsx("span",{children:s.proposal.proposedMethod.replaceAll("_"," ")})]}),s.request.mode==="customize"?e.jsxs("div",{className:"training-question-answer",children:[e.jsx("input",{value:c,onChange:l=>u(l.target.value),placeholder:"Revise tasks, graders, fixtures, or policy"}),e.jsx("button",{className:i?void 0:"training-button secondary",disabled:!c.trim()||a,onClick:async()=>{const l=c;u(""),await r.actions.chatCreation(s.id,l)},children:"Revise"})]}):null,e.jsxs("div",{className:i?"composer-create-actions":"training-inline-actions",children:[e.jsxs("button",{className:i?void 0:"training-button",disabled:a,onClick:()=>{r.actions.materialize(s.id,!0)},children:[e.jsx(x,{size:13}),e.jsx("span",{children:"Materialize Taskset"})]}),t?e.jsxs("button",{className:i?void 0:"training-button secondary",disabled:a,onClick:t,children:[e.jsx(d,{size:13}),e.jsx("span",{children:"Review details"})]}):null,e.jsxs("button",{className:i?void 0:"training-button secondary",disabled:a,onClick:()=>{r.actions.materialize(s.id,!1)},children:[e.jsx(j,{size:13}),e.jsx("span",{children:"Cancel"})]})]})]}):n==="awaiting_questions"?e.jsx("div",{className:i?"composer-create-question":"training-creation-content",children:(()=>{const l=s.blockingQuestions.find(p=>!p.answer);return l?e.jsxs(e.Fragment,{children:[e.jsx("p",{children:l.prompt}),e.jsxs("div",{className:"training-question-answer",children:[e.jsx("input",{value:o,onChange:p=>g(p.target.value)}),e.jsx("button",{className:i?void 0:"training-button",disabled:!o.trim()||a,onClick:()=>{r.actions.answerQuestions(s.id,{[l.id]:o})},children:"Continue"})]})]}):null})()}):e.jsxs("div",{className:i?"composer-create-status-body":"training-creation-content",children:[e.jsx("p",{children:m(s)}),i&&t?e.jsx("div",{className:"composer-create-actions",children:e.jsxs("button",{onClick:t,children:[e.jsx(d,{size:13}),e.jsx("span",{children:"Open Training"})]})}):null]})]})}function y({creation:s}){return e.jsxs("section",{className:"chat-create-receipt","aria-label":"Training status",children:[e.jsxs("div",{className:"chat-create-receipt-heading",children:[e.jsx(d,{size:14}),e.jsx("span",{children:v(s.state)}),e.jsx("small",{children:"training"})]}),e.jsx("p",{children:s.request.objective??m(s)}),e.jsxs("div",{className:"chat-create-receipt-facts",children:[e.jsxs("span",{children:[s.request.sourceIds.length," selected source",s.request.sourceIds.length===1?"":"s"]}),e.jsx("span",{children:s.request.mode==="customize"?"guided plan":"fast draft"})]})]})}function v(s){return s==="awaiting_disclosure_approval"?"Training evidence review":s==="awaiting_materialization_approval"?"Training plan ready":s==="awaiting_questions"?"Training question":s==="materializing"?"Materializing Taskset":s==="ready"?"Taskset ready":s==="failed"?"Training plan failed":s==="cancelled"?"Training plan cancelled":"Preparing training plan"}function m(s){return s.blockedReason?s.blockedReason:s.state==="ready"?"The reviewed Taskset was materialized. Training still requires a separate approval.":s.state==="cancelled"?"Taskset creation was cancelled.":s.state==="planning"?"The authoring model is proposing tasks, graders, fixtures, and policy boundaries.":`Task Creator is ${s.state.replaceAll("_"," ")}.`}function k(s){return s==="ready"?"success":s==="failed"||s==="cancelled"?"danger":s==="awaiting_disclosure_approval"||s==="awaiting_materialization_approval"||s==="awaiting_questions"?"warning":"info"}export{C as TrainingCreationPanel,y as TrainingStatusReceipt};
@@ -1 +1 @@
1
- import{j as s}from"./index-DEg0S7Qk.js";import{bz as p,bZ as j}from"./App-pcwmC4IR.js";import{M as x}from"./minimize-2-BGVWKvTg.js";/* empty css */function k({training:r,sessionId:t,expanded:i,onOpenTraining:d,onResizeStart:o,onToggleExpanded:l}){const n=r.payload?.sources.filter(e=>e.sessionId===t)??[],c=new Set(n.map(e=>e.id)),a=r.payload?.creations.find(e=>e.request.sourceIds.some(h=>c.has(h)))??null;return s.jsxs("aside",{className:`workspace-diff-panel training-draft-panel ${i?"expanded":""}`,"aria-label":"Training task draft",children:[i?null:s.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-orientation":"vertical","aria-label":"Resize task draft",onPointerDown:o}),s.jsxs("div",{className:"workspace-diff-topbar",children:[s.jsx("div",{className:"workspace-diff-tabs",children:s.jsxs("button",{type:"button",className:"workspace-diff-tab active",children:[s.jsx(p,{size:14}),s.jsx("span",{children:"Task draft"})]})}),s.jsx("div",{className:"workspace-diff-toolbar-actions",children:s.jsx("button",{className:"diff-icon-button",type:"button",onClick:l,"aria-label":i?"Dock task draft":"Expand task draft",children:i?s.jsx(x,{size:14}):s.jsx(j,{size:14})})})]}),s.jsxs("div",{className:"training-draft-body",children:[s.jsx("span",{className:"training-eyebrow",children:"Selected chat"}),s.jsx("h2",{children:n[0]?.title??"Not added to training"}),s.jsxs("dl",{className:"training-definition",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Sources"}),s.jsx("dd",{children:n.length})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Status"}),s.jsx("dd",{children:a?.state.replaceAll("_"," ")??"No draft"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Method"}),s.jsx("dd",{children:a?.proposal?.proposedMethod??"Pending"})]})]}),a?.proposal?s.jsxs(s.Fragment,{children:[s.jsx("h3",{children:a.proposal.name}),s.jsx("p",{children:a.proposal.objective})]}):s.jsxs("p",{children:["Add this chat with the sidebar action or run ",s.jsx("code",{children:"/train"}),"."]}),a?.blockedReason?s.jsx("p",{className:"training-draft-warning",children:a.blockedReason}):null,s.jsx("button",{className:"training-button secondary",type:"button",onClick:d,children:"Open Training"})]})]})}export{k as TrainingDraftPanel};
1
+ import{j as s}from"./index-Di1MU6Xr.js";import{bz as p,bZ as j}from"./App-nzE7JU_O.js";import{M as x}from"./minimize-2-DwUgqXoR.js";/* empty css */function k({training:r,sessionId:t,expanded:i,onOpenTraining:d,onResizeStart:o,onToggleExpanded:l}){const n=r.payload?.sources.filter(e=>e.sessionId===t)??[],c=new Set(n.map(e=>e.id)),a=r.payload?.creations.find(e=>e.request.sourceIds.some(h=>c.has(h)))??null;return s.jsxs("aside",{className:`workspace-diff-panel training-draft-panel ${i?"expanded":""}`,"aria-label":"Training task draft",children:[i?null:s.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-orientation":"vertical","aria-label":"Resize task draft",onPointerDown:o}),s.jsxs("div",{className:"workspace-diff-topbar",children:[s.jsx("div",{className:"workspace-diff-tabs",children:s.jsxs("button",{type:"button",className:"workspace-diff-tab active",children:[s.jsx(p,{size:14}),s.jsx("span",{children:"Task draft"})]})}),s.jsx("div",{className:"workspace-diff-toolbar-actions",children:s.jsx("button",{className:"diff-icon-button",type:"button",onClick:l,"aria-label":i?"Dock task draft":"Expand task draft",children:i?s.jsx(x,{size:14}):s.jsx(j,{size:14})})})]}),s.jsxs("div",{className:"training-draft-body",children:[s.jsx("span",{className:"training-eyebrow",children:"Selected chat"}),s.jsx("h2",{children:n[0]?.title??"Not added to training"}),s.jsxs("dl",{className:"training-definition",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Sources"}),s.jsx("dd",{children:n.length})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Status"}),s.jsx("dd",{children:a?.state.replaceAll("_"," ")??"No draft"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Method"}),s.jsx("dd",{children:a?.proposal?.proposedMethod??"Pending"})]})]}),a?.proposal?s.jsxs(s.Fragment,{children:[s.jsx("h3",{children:a.proposal.name}),s.jsx("p",{children:a.proposal.objective})]}):s.jsxs("p",{children:["Add this chat with the sidebar action or run ",s.jsx("code",{children:"/train"}),"."]}),a?.blockedReason?s.jsx("p",{className:"training-draft-warning",children:a.blockedReason}):null,s.jsx("button",{className:"training-button secondary",type:"button",onClick:d,children:"Open Training"})]})]})}export{k as TrainingDraftPanel};
@@ -1,4 +1,4 @@
1
- import{r as f,j as l}from"./index-DEg0S7Qk.js";import{aE as ia,bA as kt,bQ as la,be as oa,W as Te}from"./App-pcwmC4IR.js";import{A as sa}from"./arrow-up-right-xKb5kWQJ.js";import{w as ca,c as me,s as ua,i as le,a as _e,u as jt,r as Fe,b as ze,S as da,d as oe,e as ma,p as At,f as fa,g as va,h as ha,j as pa,k as ga,l as ue,m as ya,n as nt,o as ba,q as xa,t as ka,v as ja,x as Aa,y as je,z as $e,A as Le,B as Pa,C as Pt,R as Sa,D as Ia,E as z,F as Ta,G as wa,H as ne,I as Oa,J,K as Q,L as St,M as It,N as Tt,O as Ca,P as Na,Q as rt,T as Ma,U as it,V as Ea,W as pe,X as Ue,Y as Da,Z as wt,_ as $a,$ as La,a0 as Ba,a1 as We,a2 as $,a3 as Ot,a4 as Ra,a5 as qa,a6 as Ka,a7 as _a,a8 as Fa,a9 as za,aa as Ct,ab as Ua,ac as Wa,ad as Ha,ae as lt,af as Nt,ag as Ga,ah as Va,ai as Ya,aj as Xa,ak as Za,al as Ja,am as Qa,an as en,ao as ot,ap as tn,aq as an,ar as nn,as as rn,at as ln,au as on,av as sn}from"./CartesianChart-B2Sxi0lv.js";const Mt=Math.cos,ge=Math.sin,R=Math.sqrt,ye=Math.PI,Ae=2*ye,He={draw(e,t){const a=R(t/ye);e.moveTo(a,0),e.arc(0,0,a,0,Ae)}},cn={draw(e,t){const a=R(t/5)/2;e.moveTo(-3*a,-a),e.lineTo(-a,-a),e.lineTo(-a,-3*a),e.lineTo(a,-3*a),e.lineTo(a,-a),e.lineTo(3*a,-a),e.lineTo(3*a,a),e.lineTo(a,a),e.lineTo(a,3*a),e.lineTo(-a,3*a),e.lineTo(-a,a),e.lineTo(-3*a,a),e.closePath()}},Et=R(1/3),un=Et*2,dn={draw(e,t){const a=R(t/un),n=a*Et;e.moveTo(0,-a),e.lineTo(n,0),e.lineTo(0,a),e.lineTo(-n,0),e.closePath()}},mn={draw(e,t){const a=R(t),n=-a/2;e.rect(n,n,a,a)}},fn=.8908130915292852,Dt=ge(ye/10)/ge(7*ye/10),vn=ge(Ae/10)*Dt,hn=-Mt(Ae/10)*Dt,pn={draw(e,t){const a=R(t*fn),n=vn*a,r=hn*a;e.moveTo(0,-a),e.lineTo(n,r);for(let i=1;i<5;++i){const o=Ae*i/5,u=Mt(o),d=ge(o);e.lineTo(d*a,-u*a),e.lineTo(u*n-d*r,d*n+u*r)}e.closePath()}},we=R(3),gn={draw(e,t){const a=-R(t/(we*3));e.moveTo(0,a*2),e.lineTo(-we*a,-a),e.lineTo(we*a,-a),e.closePath()}},N=-.5,M=R(3)/2,Be=1/R(12),yn=(Be/2+1)*3,bn={draw(e,t){const a=R(t/yn),n=a/2,r=a*Be,i=n,o=a*Be+a,u=-i,d=o;e.moveTo(n,r),e.lineTo(i,o),e.lineTo(u,d),e.lineTo(N*n-M*r,M*n+N*r),e.lineTo(N*i-M*o,M*i+N*o),e.lineTo(N*u-M*d,M*u+N*d),e.lineTo(N*n+M*r,N*r-M*n),e.lineTo(N*i+M*o,N*o-M*i),e.lineTo(N*u+M*d,N*d-M*u),e.closePath()}};function xn(e,t){let a=null,n=ca(r);e=typeof e=="function"?e:me(e||He),t=typeof t=="function"?t:me(t===void 0?64:+t);function r(){let i;if(a||(a=i=n()),e.apply(this,arguments).draw(a,+t.apply(this,arguments)),i)return a=null,i+""||null}return r.type=function(i){return arguments.length?(e=typeof i=="function"?i:me(i),r):e},r.size=function(i){return arguments.length?(t=typeof i=="function"?i:me(+i),r):t},r.context=function(i){return arguments.length?(a=i??null,r):a},r}var kn=["type","size","sizeType"];function Re(){return Re=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},Re.apply(null,arguments)}function st(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),a.push.apply(a,n)}return a}function ct(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?st(Object(a),!0).forEach(function(n){jn(e,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):st(Object(a)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(a,n))})}return e}function jn(e,t,a){return(t=An(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function An(e){var t=Pn(e,"string");return typeof t=="symbol"?t:t+""}function Pn(e,t){if(typeof e!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var n=a.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Sn(e,t){if(e==null)return{};var a,n,r=In(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)a=i[n],t.indexOf(a)===-1&&{}.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function In(e,t){if(e==null)return{};var a={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;a[n]=e[n]}return a}var $t={symbolCircle:He,symbolCross:cn,symbolDiamond:dn,symbolSquare:mn,symbolStar:pn,symbolTriangle:gn,symbolWye:bn},Tn=Math.PI/180,wn=e=>{var t="symbol".concat(jt(e));return $t[t]||He},On=(e,t,a)=>{if(t==="area")return e;switch(a){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var n=18*Tn;return 1.25*e*e*(Math.tan(n)-Math.tan(n*2)*Math.tan(n)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},Cn=(e,t)=>{$t["symbol".concat(jt(e))]=t},Lt=e=>{var t=e.type,a=t===void 0?"circle":t,n=e.size,r=n===void 0?64:n,i=e.sizeType,o=i===void 0?"area":i,u=Sn(e,kn),d=ct(ct({},u),{},{type:a,size:r,sizeType:o}),s="circle";typeof a=="string"&&(s=a);var c=()=>{var b=wn(s),p=xn().type(b).size(On(r,o,s)),x=p();if(x!==null)return x},m=d.className,v=d.cx,y=d.cy,h=ua(d);return le(v)&&le(y)&&le(r)?f.createElement("path",Re({},h,{className:_e("recharts-symbols",m),transform:"translate(".concat(v,", ").concat(y,")"),d:c()})):null};Lt.registerSymbol=Cn;function be(){return be=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},be.apply(null,arguments)}function ut(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),a.push.apply(a,n)}return a}function Bt(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?ut(Object(a),!0).forEach(function(n){Nn(e,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):ut(Object(a)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(a,n))})}return e}function Nn(e,t,a){return(t=Mn(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function Mn(e){var t=En(e,"string");return typeof t=="symbol"?t:t+""}function En(e,t){if(typeof e!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var n=a.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var E=32,Dn={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function $n(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function Ln(e){var t=e.data,a=e.iconType,n=e.inactiveColor,r=E/2,i=E/6,o=E/3,u=t.inactive?n:t.color,d=a??t.type;if(d==="none")return null;if(d==="plainline")return f.createElement("line",{strokeWidth:4,fill:"none",stroke:u,strokeDasharray:$n(t.payload),x1:0,y1:r,x2:E,y2:r,className:"recharts-legend-icon"});if(d==="line")return f.createElement("path",{strokeWidth:4,fill:"none",stroke:u,d:"M0,".concat(r,"h").concat(o,`
1
+ import{r as f,j as l}from"./index-Di1MU6Xr.js";import{aE as ia,bA as kt,bQ as la,be as oa,W as Te}from"./App-nzE7JU_O.js";import{A as sa}from"./arrow-up-right-DCWPxdbD.js";import{w as ca,c as me,s as ua,i as le,a as _e,u as jt,r as Fe,b as ze,S as da,d as oe,e as ma,p as At,f as fa,g as va,h as ha,j as pa,k as ga,l as ue,m as ya,n as nt,o as ba,q as xa,t as ka,v as ja,x as Aa,y as je,z as $e,A as Le,B as Pa,C as Pt,R as Sa,D as Ia,E as z,F as Ta,G as wa,H as ne,I as Oa,J,K as Q,L as St,M as It,N as Tt,O as Ca,P as Na,Q as rt,T as Ma,U as it,V as Ea,W as pe,X as Ue,Y as Da,Z as wt,_ as $a,$ as La,a0 as Ba,a1 as We,a2 as $,a3 as Ot,a4 as Ra,a5 as qa,a6 as Ka,a7 as _a,a8 as Fa,a9 as za,aa as Ct,ab as Ua,ac as Wa,ad as Ha,ae as lt,af as Nt,ag as Ga,ah as Va,ai as Ya,aj as Xa,ak as Za,al as Ja,am as Qa,an as en,ao as ot,ap as tn,aq as an,ar as nn,as as rn,at as ln,au as on,av as sn}from"./CartesianChart-u1lvLM30.js";const Mt=Math.cos,ge=Math.sin,R=Math.sqrt,ye=Math.PI,Ae=2*ye,He={draw(e,t){const a=R(t/ye);e.moveTo(a,0),e.arc(0,0,a,0,Ae)}},cn={draw(e,t){const a=R(t/5)/2;e.moveTo(-3*a,-a),e.lineTo(-a,-a),e.lineTo(-a,-3*a),e.lineTo(a,-3*a),e.lineTo(a,-a),e.lineTo(3*a,-a),e.lineTo(3*a,a),e.lineTo(a,a),e.lineTo(a,3*a),e.lineTo(-a,3*a),e.lineTo(-a,a),e.lineTo(-3*a,a),e.closePath()}},Et=R(1/3),un=Et*2,dn={draw(e,t){const a=R(t/un),n=a*Et;e.moveTo(0,-a),e.lineTo(n,0),e.lineTo(0,a),e.lineTo(-n,0),e.closePath()}},mn={draw(e,t){const a=R(t),n=-a/2;e.rect(n,n,a,a)}},fn=.8908130915292852,Dt=ge(ye/10)/ge(7*ye/10),vn=ge(Ae/10)*Dt,hn=-Mt(Ae/10)*Dt,pn={draw(e,t){const a=R(t*fn),n=vn*a,r=hn*a;e.moveTo(0,-a),e.lineTo(n,r);for(let i=1;i<5;++i){const o=Ae*i/5,u=Mt(o),d=ge(o);e.lineTo(d*a,-u*a),e.lineTo(u*n-d*r,d*n+u*r)}e.closePath()}},we=R(3),gn={draw(e,t){const a=-R(t/(we*3));e.moveTo(0,a*2),e.lineTo(-we*a,-a),e.lineTo(we*a,-a),e.closePath()}},N=-.5,M=R(3)/2,Be=1/R(12),yn=(Be/2+1)*3,bn={draw(e,t){const a=R(t/yn),n=a/2,r=a*Be,i=n,o=a*Be+a,u=-i,d=o;e.moveTo(n,r),e.lineTo(i,o),e.lineTo(u,d),e.lineTo(N*n-M*r,M*n+N*r),e.lineTo(N*i-M*o,M*i+N*o),e.lineTo(N*u-M*d,M*u+N*d),e.lineTo(N*n+M*r,N*r-M*n),e.lineTo(N*i+M*o,N*o-M*i),e.lineTo(N*u+M*d,N*d-M*u),e.closePath()}};function xn(e,t){let a=null,n=ca(r);e=typeof e=="function"?e:me(e||He),t=typeof t=="function"?t:me(t===void 0?64:+t);function r(){let i;if(a||(a=i=n()),e.apply(this,arguments).draw(a,+t.apply(this,arguments)),i)return a=null,i+""||null}return r.type=function(i){return arguments.length?(e=typeof i=="function"?i:me(i),r):e},r.size=function(i){return arguments.length?(t=typeof i=="function"?i:me(+i),r):t},r.context=function(i){return arguments.length?(a=i??null,r):a},r}var kn=["type","size","sizeType"];function Re(){return Re=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},Re.apply(null,arguments)}function st(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),a.push.apply(a,n)}return a}function ct(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?st(Object(a),!0).forEach(function(n){jn(e,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):st(Object(a)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(a,n))})}return e}function jn(e,t,a){return(t=An(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function An(e){var t=Pn(e,"string");return typeof t=="symbol"?t:t+""}function Pn(e,t){if(typeof e!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var n=a.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Sn(e,t){if(e==null)return{};var a,n,r=In(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)a=i[n],t.indexOf(a)===-1&&{}.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function In(e,t){if(e==null)return{};var a={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;a[n]=e[n]}return a}var $t={symbolCircle:He,symbolCross:cn,symbolDiamond:dn,symbolSquare:mn,symbolStar:pn,symbolTriangle:gn,symbolWye:bn},Tn=Math.PI/180,wn=e=>{var t="symbol".concat(jt(e));return $t[t]||He},On=(e,t,a)=>{if(t==="area")return e;switch(a){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var n=18*Tn;return 1.25*e*e*(Math.tan(n)-Math.tan(n*2)*Math.tan(n)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},Cn=(e,t)=>{$t["symbol".concat(jt(e))]=t},Lt=e=>{var t=e.type,a=t===void 0?"circle":t,n=e.size,r=n===void 0?64:n,i=e.sizeType,o=i===void 0?"area":i,u=Sn(e,kn),d=ct(ct({},u),{},{type:a,size:r,sizeType:o}),s="circle";typeof a=="string"&&(s=a);var c=()=>{var b=wn(s),p=xn().type(b).size(On(r,o,s)),x=p();if(x!==null)return x},m=d.className,v=d.cx,y=d.cy,h=ua(d);return le(v)&&le(y)&&le(r)?f.createElement("path",Re({},h,{className:_e("recharts-symbols",m),transform:"translate(".concat(v,", ").concat(y,")"),d:c()})):null};Lt.registerSymbol=Cn;function be(){return be=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},be.apply(null,arguments)}function ut(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),a.push.apply(a,n)}return a}function Bt(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?ut(Object(a),!0).forEach(function(n){Nn(e,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):ut(Object(a)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(a,n))})}return e}function Nn(e,t,a){return(t=Mn(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function Mn(e){var t=En(e,"string");return typeof t=="symbol"?t:t+""}function En(e,t){if(typeof e!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var n=a.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var E=32,Dn={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function $n(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function Ln(e){var t=e.data,a=e.iconType,n=e.inactiveColor,r=E/2,i=E/6,o=E/3,u=t.inactive?n:t.color,d=a??t.type;if(d==="none")return null;if(d==="plainline")return f.createElement("line",{strokeWidth:4,fill:"none",stroke:u,strokeDasharray:$n(t.payload),x1:0,y1:r,x2:E,y2:r,className:"recharts-legend-icon"});if(d==="line")return f.createElement("path",{strokeWidth:4,fill:"none",stroke:u,d:"M0,".concat(r,"h").concat(o,`
2
2
  A`).concat(i,",").concat(i,",0,1,1,").concat(2*o,",").concat(r,`
3
3
  H`).concat(E,"M").concat(2*o,",").concat(r,`
4
4
  A`).concat(i,",").concat(i,",0,1,1,").concat(o,",").concat(r),className:"recharts-legend-icon"});if(d==="rect")return f.createElement("path",{stroke:"none",fill:u,d:"M0,".concat(E/8,"h").concat(E,"v").concat(E*3/4,"h").concat(-E,"z"),className:"recharts-legend-icon"});if(f.isValidElement(t.legendIcon)){var s=Bt({},t);return delete s.legendIcon,f.cloneElement(t.legendIcon,s)}return f.createElement(Lt,{fill:u,cx:r,cy:r,size:E,sizeType:"diameter",type:d})}function Bn(e){var t=e.payload,a=e.iconSize,n=e.layout,r=e.formatter,i=e.inactiveColor,o=e.iconType,u=e.labelStyle,d={x:0,y:0,width:E,height:E},s={display:n==="horizontal"?"inline-block":"block",marginRight:10},c={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((m,v)=>{var y=m.formatter||r,h=_e({"recharts-legend-item":!0,["legend-item-".concat(v)]:!0,inactive:m.inactive});if(m.type==="none")return null;var b=typeof u=="object"?Bt({},u):{};b.color=m.inactive?i:b.color||m.color;var p=y?y(m.value,m,v):m.value;return f.createElement("li",be({className:h,style:s,key:"legend-item-".concat(v)},ze(e,m,v)),f.createElement(da,{width:a,height:a,viewBox:d,style:c,"aria-label":m.value==null?"legend icon":"".concat(m.value," legend icon")},f.createElement(Ln,{data:m,iconType:o,inactiveColor:i})),f.createElement("span",{className:"recharts-legend-item-text",style:b},p))})}var Rn=e=>{var t=Fe(e,Dn),a=t.payload,n=t.layout,r=t.align;if(!a||!a.length)return null;var i={padding:0,margin:0,textAlign:n==="horizontal"?r:"left"};return f.createElement("ul",{className:"recharts-default-legend",style:i},f.createElement(Bn,be({},t,{payload:a})))};function qn(){return oe(ma)}var Kn=["contextPayload"];function qe(){return qe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},qe.apply(null,arguments)}function _n(e,t){return Wn(e)||Un(e,t)||zn(e,t)||Fn()}function Fn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
@@ -1 +1 @@
1
- import{r as f,j as e}from"./index-DEg0S7Qk.js";import{bZ as J,L as y,az as X,bQ as _,W as w,ci as Y}from"./App-pcwmC4IR.js";import{M as ee,r as B,s as te,T as ie}from"./MarkdownText-BBVriBCj.js";import{F as W}from"./folder-open-CbmUjIYS.js";import{M as ne}from"./minimize-2-BGVWKvTg.js";import{P as E}from"./MainPane-C86le7UF.js";import"./arrow-up-right-xKb5kWQJ.js";import"./cloud-upload-Bw9XUsKQ.js";import"./square-DT_uFOml.js";import"./play-pmSO95Qg.js";function Ce({chatMessages:i,connection:r,contextWindowStatus:l,expanded:s,runtimeEvents:c,sessionId:d,showToast:u,onResizeStart:M,onToggleExpanded:S,onUseOutput:P,onHandoffOutput:T,onReviseOutput:D,onAgentPackageInstalled:I}){const[k,K]=f.useState("outputs"),[j,x]=f.useState(null),[o,m]=f.useState(null),[v,N]=f.useState(""),[V,H]=f.useState({}),A=f.useMemo(()=>oe(c),[c]),U=f.useMemo(()=>ae(A),[A]),R=f.useMemo(()=>se(i),[i]),$=f.useMemo(()=>re(i),[i]),z=f.useMemo(()=>le(i),[i]);f.useEffect(()=>()=>{o?.objectUrl&&URL.revokeObjectURL(o.objectUrl)},[o?.objectUrl]);async function b(t){if(!r||!d||t.kind!=="file")return null;x(p(t));try{const n=await w.workspaceTool(r,d,{action:"work_output_read",source:"ui_button",args:{outputId:t.id,revision:t.revision}});if(!n.ok)throw new Error(n.output);const a=pe(n.data),h=typeof a.contentsBase64=="string"?a.contentsBase64:"";if(!h)throw new Error("The output did not include file data.");return new File([de(h)],t.title,{type:t.contentType})}catch(n){return u(n instanceof Error?n.message:"Could not load the output.","error"),null}finally{x(null)}}async function Q(t){const n=await b(t);if(!n)return;o?.objectUrl&&URL.revokeObjectURL(o.objectUrl);const a=t.kind==="file"&&(t.contentType.startsWith("text/")||t.contentType==="application/json");N(""),m({output:t,file:n,text:a?await n.text():null,objectUrl:a?null:URL.createObjectURL(n)})}async function Z(t){const n=await b(t);n&&(P(n),u("Added the output to the task as input.","success"))}async function O(t,n){const a=n.kind==="file"?await b(n):null;n.kind==="file"&&!a||await T(t,n,a)}async function q(t){if(!(!r||!d)&&window.confirm(`Delete ${t.title} revision ${t.revision} from this device?`)){x(p(t));try{const n=await w.workspaceTool(r,d,{action:"work_output_delete",source:"ui_button",args:{outputId:t.id,revision:t.revision}});if(!n.ok)throw new Error(n.output);o?.output.id===t.id&&m(null),u("Work output deleted.","success")}catch(n){u(n instanceof Error?n.message:"Could not delete the output.","error")}finally{x(null)}}}async function G(t){if(!r||!d||!window.confirm(`Add ${t.title} version ${t.versionId} to your active Agents profile?`))return;const n=async a=>w.workspaceTool(r,d,{action:"work_agent_package_install",source:"ui_button",args:{outputId:t.id,revision:t.revision,overwrite:a}});x(p(t));try{let a;try{a=await n(!1)}catch(h){if(!(h instanceof Error?h.message:"Agent installation failed.").includes("already exists")||!window.confirm(`${t.agentId} already exists. Replace its active checkout with this immutable version?`))throw h;a=await n(!0)}if(!a.ok)throw new Error(a.output);await I?.(),u(`${t.title} was added to Agents. Its package remains available in this Work task.`,"success")}catch(a){u(a instanceof Error?a.message:"Could not add the Agent package.","error")}finally{x(null)}}return e.jsxs("aside",{className:`workspace-diff-panel work-sidebar-panel ${s?"expanded":""}`,"aria-label":"Work details",children:[s?null:e.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-orientation":"vertical","aria-label":"Resize Work details",onPointerDown:M}),e.jsxs("div",{className:"workspace-diff-topbar",children:[e.jsx("div",{className:"workspace-diff-tabs",role:"tablist","aria-label":"Work details",children:[["outputs","Outputs"],["activity","Activity"],["context","Context"]].map(([t,n])=>e.jsx("button",{type:"button",className:`workspace-diff-tab ${k===t?"active":""}`,role:"tab","aria-selected":k===t,onClick:()=>K(t),children:n},t))}),e.jsx("div",{className:"workspace-diff-toolbar-actions",children:e.jsx("button",{type:"button",className:"diff-icon-button",title:s?"Dock sidebar":"Expand sidebar","aria-label":s?"Dock sidebar":"Expand sidebar",onClick:S,children:s?e.jsx(ne,{size:14}):e.jsx(J,{size:14})})})]}),e.jsxs("div",{className:"work-sidebar-body",children:[k==="outputs"?o?e.jsxs("div",{className:"work-output-preview",children:[e.jsxs("header",{children:[e.jsx("button",{type:"button",onClick:()=>{o.objectUrl&&URL.revokeObjectURL(o.objectUrl),m(null)},children:"Outputs"}),e.jsxs("strong",{children:[o.output.title," · revision ",o.output.revision]})]}),o.text!==null?e.jsx(ee,{content:o.text}):o.output.kind==="file"&&o.output.contentType.startsWith("image/")&&o.objectUrl?e.jsx("img",{src:o.objectUrl,alt:o.output.title}):o.output.kind==="file"&&o.output.contentType==="application/pdf"&&o.objectUrl?e.jsx("iframe",{src:o.objectUrl,title:o.output.title}):o.output.kind==="file"&&o.output.contentType.startsWith("audio/")&&o.objectUrl?e.jsx("audio",{controls:!0,src:o.objectUrl}):o.output.kind==="file"&&o.output.contentType.startsWith("video/")&&o.objectUrl?e.jsx("video",{controls:!0,src:o.objectUrl}):e.jsx("p",{children:"This file type uses its native application for detailed review."}),e.jsxs("section",{className:"work-output-annotation",children:[e.jsx("label",{htmlFor:"work-output-revision-note",children:"Revision note"}),e.jsx("textarea",{id:"work-output-revision-note",value:v,onChange:t=>N(t.target.value),placeholder:"Describe the exact change to make in the next revision."}),e.jsx("button",{type:"button",disabled:!v.trim(),onClick:()=>{D(o.output,o.file,v.trim()),u(`Prepared revision ${o.output.revision+1}.`,"success")},children:"Revise this version"})]})]}):U.length>0?e.jsx("div",{className:"work-output-list",children:U.map(t=>{const n=t.revisions.find(a=>a.revision===V[t.id])??t.revisions[0];return e.jsxs("article",{className:"work-output-card",children:[e.jsxs("header",{children:[e.jsx(y,{size:16}),e.jsxs("span",{children:[e.jsx("strong",{children:n.title}),t.revisions.length>1?e.jsxs("label",{className:"work-output-version",children:[e.jsx("span",{children:"Version"}),e.jsx("select",{value:n.revision,onChange:a=>H(h=>({...h,[t.id]:Number(a.target.value)})),children:t.revisions.map(a=>e.jsxs("option",{value:a.revision,children:["Revision ",a.revision]},p(a)))})]}):e.jsxs("small",{children:["Revision ",n.revision]}),e.jsx("small",{children:ce(n)})]})]}),n.validation.length>0?e.jsxs("div",{className:"work-output-validation",children:[e.jsx(X,{size:13}),e.jsxs("span",{children:[n.validation.filter(a=>a.status==="passed").length," ","checks passed"]})]}):null,e.jsxs("div",{className:"work-output-actions",children:[n.kind==="file"&&n.location.kind==="local"?e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:()=>{B(L(n))},children:[e.jsx(W,{size:13}),"Reveal"]}),e.jsx("button",{type:"button",onClick:async()=>{const a=await te(L(n),n.title);a.ok?u("Saved a copy of the Work output.","success"):a.canceled||u("Could not save a copy of the Work output.","error")},children:"Save as"})]}):null,n.kind==="file"?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",disabled:j===p(n),onClick:()=>{Q(n)},children:"Preview"}),e.jsxs("button",{type:"button",disabled:j===p(n),onClick:()=>{Z(n)},children:[e.jsx(E,{size:13}),"Use as input"]})]}):n.kind==="agent_package"?e.jsx("button",{type:"button",disabled:j===p(n),onClick:()=>{G(n)},children:"Add to Agents"}):"url"in n&&n.url?e.jsx("button",{type:"button",onClick:()=>window.open(n.url,"_blank","noopener,noreferrer"),children:"Open"}):null,n.kind==="file"&&n.location.kind==="local"?e.jsxs("button",{type:"button",className:"danger",disabled:j===p(n),onClick:()=>{q(n)},children:[e.jsx(ie,{size:13}),"Delete"]}):null,e.jsx("button",{type:"button",disabled:j===p(n),onClick:()=>{O("chat",n)},children:"Continue in Chat"}),e.jsx("button",{type:"button",disabled:j===p(n),onClick:()=>{O("work",n)},children:"Continue in repository Work"})]})]},t.id)})}):$.length>0?e.jsx("div",{className:"work-output-list",children:$.map(t=>e.jsxs("article",{className:"work-output-card",children:[e.jsxs("header",{children:[e.jsx(y,{size:16}),e.jsxs("span",{children:[e.jsx("strong",{children:t.title}),e.jsx("small",{children:C(t.sizeBytes)})]})]}),e.jsx("div",{className:"work-output-actions",children:e.jsxs("button",{type:"button",onClick:()=>{B(t.path)},children:[e.jsx(W,{size:13}),"Reveal"]})})]},t.path))}):e.jsx(F,{icon:y,title:"No saved outputs yet",detail:"Finished files and connected results will appear here."}):null,k==="activity"?R.length>0?e.jsx("div",{className:"work-activity-list",children:R.map(t=>e.jsxs("details",{className:`work-activity-row ${t.state??""}`,children:[e.jsxs("summary",{children:[e.jsx(_,{size:14}),e.jsx("span",{children:t.label}),e.jsx("small",{children:t.state??"completed"})]}),e.jsx("p",{children:t.content}),t.detail?e.jsx("pre",{children:t.detail}):null]},t.id))}):e.jsx(F,{icon:_,title:"No activity yet",detail:"Commands, tool receipts, and checks appear while Work runs."}):null,k==="context"?e.jsxs("div",{className:"work-context",children:[e.jsxs("section",{children:[e.jsx("h3",{children:"Model context"}),e.jsx("p",{children:l.summary}),e.jsx("small",{children:l.tokensLabel})]}),e.jsxs("section",{children:[e.jsx("h3",{children:"Task inputs and sources"}),z.length>0?e.jsx("ul",{children:z.map(t=>e.jsxs("li",{children:[e.jsx(E,{size:13}),e.jsxs("span",{children:[e.jsx("strong",{children:t.title}),e.jsx("small",{children:t.detail})]})]},t.key))}):e.jsx("p",{children:"No attached files or cited sources yet."})]})]}):null]})]})}function se(i){return i.flatMap(r=>r.activities??[]).filter(r=>r.kind!=="reasoning").reverse()}function re(i){const r=new Map;for(const l of i)for(const s of l.activities??[])for(const c of s.artifacts??[])!c.path||c.sizeBytes===null||r.set(c.path,{path:c.path,title:c.title,sizeBytes:c.sizeBytes});return[...r.values()].sort((l,s)=>s.path.localeCompare(l.path))}function oe(i){const r=new Map,l=new Set;for(const s of i){const c=g(s.data);if(s.action==="work_output_delete"&&s.status==="completed"){for(const d of c){const u=p(d);l.add(u),r.delete(u)}continue}if(s.action!=="work_output_read")for(const d of c){const u=p(d);l.has(u)||r.set(u,d)}}return[...r.values()].sort((s,c)=>c.createdAt.localeCompare(s.createdAt)||c.revision-s.revision)}function p(i){return`${i.id}:${i.revision}`}function ae(i){const r=new Map;for(const l of i){const s=r.get(l.id)??[];s.push(l),r.set(l.id,s)}return[...r.entries()].map(([l,s])=>({id:l,revisions:s.sort((c,d)=>d.revision-c.revision||d.createdAt.localeCompare(c.createdAt))})).sort((l,s)=>s.revisions[0].createdAt.localeCompare(l.revisions[0].createdAt))}function g(i,r=[],l=new Set,s=0){if(s>8||i==null)return r;const c=Y.safeParse(i);if(c.success){const d=`${c.data.id}:${c.data.revision}`;return l.has(d)||(l.add(d),r.push(c.data)),r}if(Array.isArray(i)){for(const d of i)g(d,r,l,s+1);return r}if(typeof i=="object")for(const d of Object.values(i))g(d,r,l,s+1);return r}function le(i){const r=new Map;for(const l of i){for(const s of l.attachments??[])r.set(`attachment:${s.id}`,{key:`attachment:${s.id}`,title:s.name,detail:`${s.mediaType} · ${C(s.sizeBytes)}`});for(const s of l.sources??[])r.set(`source:${s.id}`,{key:`source:${s.id}`,title:s.title,detail:s.sourceName??ue(s.url)})}return[...r.values()]}function F({icon:i,title:r,detail:l}){return e.jsxs("div",{className:"work-sidebar-empty",children:[e.jsx(i,{size:22}),e.jsx("strong",{children:r}),e.jsx("p",{children:l})]})}function ce(i){return i.kind==="deployment"?"Deployment":i.kind==="source_change"?"Source change":i.kind==="external_resource"?i.provider:i.kind==="agent_package"?`${i.actions.length} action${i.actions.length===1?"":"s"}`:i.location.kind==="local"?C(i.sizeBytes):i.location.kind==="managed"?"Managed file":i.location.provider}function C(i){return i<1024?`${i} B`:i<1024*1024?`${Math.round(i/1024)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`}function de(i){const r=window.atob(i),l=new ArrayBuffer(r.length),s=new Uint8Array(l);for(let c=0;c<r.length;c+=1)s[c]=r.charCodeAt(c);return l}function L(i){return i.kind==="file"&&i.location.kind==="local"?i.location.path:""}function ue(i){try{return new URL(i).hostname||i}catch{return i}}function pe(i){return i&&typeof i=="object"&&!Array.isArray(i)?i:{}}export{Ce as WorkSidebarPanel,re as visibleChatFileArtifacts,se as visibleWorkActivities,oe as workOutputsFromEvents};
1
+ import{r as f,j as e}from"./index-Di1MU6Xr.js";import{bZ as J,L as y,az as X,bQ as _,W as w,ci as Y}from"./App-nzE7JU_O.js";import{M as ee,r as B,s as te,T as ie}from"./MarkdownText-Drjq6-JM.js";import{F as W}from"./folder-open-B-DFLDFH.js";import{M as ne}from"./minimize-2-DwUgqXoR.js";import{P as E}from"./MainPane-DCz38-qy.js";import"./arrow-up-right-DCWPxdbD.js";import"./cloud-upload-DpaGFZ9J.js";import"./square-DXtoCBNw.js";import"./play-D_YGCdxU.js";function Ce({chatMessages:i,connection:r,contextWindowStatus:l,expanded:s,runtimeEvents:c,sessionId:d,showToast:u,onResizeStart:M,onToggleExpanded:S,onUseOutput:P,onHandoffOutput:T,onReviseOutput:D,onAgentPackageInstalled:I}){const[k,K]=f.useState("outputs"),[j,x]=f.useState(null),[o,m]=f.useState(null),[v,N]=f.useState(""),[V,H]=f.useState({}),A=f.useMemo(()=>oe(c),[c]),U=f.useMemo(()=>ae(A),[A]),R=f.useMemo(()=>se(i),[i]),$=f.useMemo(()=>re(i),[i]),z=f.useMemo(()=>le(i),[i]);f.useEffect(()=>()=>{o?.objectUrl&&URL.revokeObjectURL(o.objectUrl)},[o?.objectUrl]);async function b(t){if(!r||!d||t.kind!=="file")return null;x(p(t));try{const n=await w.workspaceTool(r,d,{action:"work_output_read",source:"ui_button",args:{outputId:t.id,revision:t.revision}});if(!n.ok)throw new Error(n.output);const a=pe(n.data),h=typeof a.contentsBase64=="string"?a.contentsBase64:"";if(!h)throw new Error("The output did not include file data.");return new File([de(h)],t.title,{type:t.contentType})}catch(n){return u(n instanceof Error?n.message:"Could not load the output.","error"),null}finally{x(null)}}async function Q(t){const n=await b(t);if(!n)return;o?.objectUrl&&URL.revokeObjectURL(o.objectUrl);const a=t.kind==="file"&&(t.contentType.startsWith("text/")||t.contentType==="application/json");N(""),m({output:t,file:n,text:a?await n.text():null,objectUrl:a?null:URL.createObjectURL(n)})}async function Z(t){const n=await b(t);n&&(P(n),u("Added the output to the task as input.","success"))}async function O(t,n){const a=n.kind==="file"?await b(n):null;n.kind==="file"&&!a||await T(t,n,a)}async function q(t){if(!(!r||!d)&&window.confirm(`Delete ${t.title} revision ${t.revision} from this device?`)){x(p(t));try{const n=await w.workspaceTool(r,d,{action:"work_output_delete",source:"ui_button",args:{outputId:t.id,revision:t.revision}});if(!n.ok)throw new Error(n.output);o?.output.id===t.id&&m(null),u("Work output deleted.","success")}catch(n){u(n instanceof Error?n.message:"Could not delete the output.","error")}finally{x(null)}}}async function G(t){if(!r||!d||!window.confirm(`Add ${t.title} version ${t.versionId} to your active Agents profile?`))return;const n=async a=>w.workspaceTool(r,d,{action:"work_agent_package_install",source:"ui_button",args:{outputId:t.id,revision:t.revision,overwrite:a}});x(p(t));try{let a;try{a=await n(!1)}catch(h){if(!(h instanceof Error?h.message:"Agent installation failed.").includes("already exists")||!window.confirm(`${t.agentId} already exists. Replace its active checkout with this immutable version?`))throw h;a=await n(!0)}if(!a.ok)throw new Error(a.output);await I?.(),u(`${t.title} was added to Agents. Its package remains available in this Work task.`,"success")}catch(a){u(a instanceof Error?a.message:"Could not add the Agent package.","error")}finally{x(null)}}return e.jsxs("aside",{className:`workspace-diff-panel work-sidebar-panel ${s?"expanded":""}`,"aria-label":"Work details",children:[s?null:e.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-orientation":"vertical","aria-label":"Resize Work details",onPointerDown:M}),e.jsxs("div",{className:"workspace-diff-topbar",children:[e.jsx("div",{className:"workspace-diff-tabs",role:"tablist","aria-label":"Work details",children:[["outputs","Outputs"],["activity","Activity"],["context","Context"]].map(([t,n])=>e.jsx("button",{type:"button",className:`workspace-diff-tab ${k===t?"active":""}`,role:"tab","aria-selected":k===t,onClick:()=>K(t),children:n},t))}),e.jsx("div",{className:"workspace-diff-toolbar-actions",children:e.jsx("button",{type:"button",className:"diff-icon-button",title:s?"Dock sidebar":"Expand sidebar","aria-label":s?"Dock sidebar":"Expand sidebar",onClick:S,children:s?e.jsx(ne,{size:14}):e.jsx(J,{size:14})})})]}),e.jsxs("div",{className:"work-sidebar-body",children:[k==="outputs"?o?e.jsxs("div",{className:"work-output-preview",children:[e.jsxs("header",{children:[e.jsx("button",{type:"button",onClick:()=>{o.objectUrl&&URL.revokeObjectURL(o.objectUrl),m(null)},children:"Outputs"}),e.jsxs("strong",{children:[o.output.title," · revision ",o.output.revision]})]}),o.text!==null?e.jsx(ee,{content:o.text}):o.output.kind==="file"&&o.output.contentType.startsWith("image/")&&o.objectUrl?e.jsx("img",{src:o.objectUrl,alt:o.output.title}):o.output.kind==="file"&&o.output.contentType==="application/pdf"&&o.objectUrl?e.jsx("iframe",{src:o.objectUrl,title:o.output.title}):o.output.kind==="file"&&o.output.contentType.startsWith("audio/")&&o.objectUrl?e.jsx("audio",{controls:!0,src:o.objectUrl}):o.output.kind==="file"&&o.output.contentType.startsWith("video/")&&o.objectUrl?e.jsx("video",{controls:!0,src:o.objectUrl}):e.jsx("p",{children:"This file type uses its native application for detailed review."}),e.jsxs("section",{className:"work-output-annotation",children:[e.jsx("label",{htmlFor:"work-output-revision-note",children:"Revision note"}),e.jsx("textarea",{id:"work-output-revision-note",value:v,onChange:t=>N(t.target.value),placeholder:"Describe the exact change to make in the next revision."}),e.jsx("button",{type:"button",disabled:!v.trim(),onClick:()=>{D(o.output,o.file,v.trim()),u(`Prepared revision ${o.output.revision+1}.`,"success")},children:"Revise this version"})]})]}):U.length>0?e.jsx("div",{className:"work-output-list",children:U.map(t=>{const n=t.revisions.find(a=>a.revision===V[t.id])??t.revisions[0];return e.jsxs("article",{className:"work-output-card",children:[e.jsxs("header",{children:[e.jsx(y,{size:16}),e.jsxs("span",{children:[e.jsx("strong",{children:n.title}),t.revisions.length>1?e.jsxs("label",{className:"work-output-version",children:[e.jsx("span",{children:"Version"}),e.jsx("select",{value:n.revision,onChange:a=>H(h=>({...h,[t.id]:Number(a.target.value)})),children:t.revisions.map(a=>e.jsxs("option",{value:a.revision,children:["Revision ",a.revision]},p(a)))})]}):e.jsxs("small",{children:["Revision ",n.revision]}),e.jsx("small",{children:ce(n)})]})]}),n.validation.length>0?e.jsxs("div",{className:"work-output-validation",children:[e.jsx(X,{size:13}),e.jsxs("span",{children:[n.validation.filter(a=>a.status==="passed").length," ","checks passed"]})]}):null,e.jsxs("div",{className:"work-output-actions",children:[n.kind==="file"&&n.location.kind==="local"?e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:()=>{B(L(n))},children:[e.jsx(W,{size:13}),"Reveal"]}),e.jsx("button",{type:"button",onClick:async()=>{const a=await te(L(n),n.title);a.ok?u("Saved a copy of the Work output.","success"):a.canceled||u("Could not save a copy of the Work output.","error")},children:"Save as"})]}):null,n.kind==="file"?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",disabled:j===p(n),onClick:()=>{Q(n)},children:"Preview"}),e.jsxs("button",{type:"button",disabled:j===p(n),onClick:()=>{Z(n)},children:[e.jsx(E,{size:13}),"Use as input"]})]}):n.kind==="agent_package"?e.jsx("button",{type:"button",disabled:j===p(n),onClick:()=>{G(n)},children:"Add to Agents"}):"url"in n&&n.url?e.jsx("button",{type:"button",onClick:()=>window.open(n.url,"_blank","noopener,noreferrer"),children:"Open"}):null,n.kind==="file"&&n.location.kind==="local"?e.jsxs("button",{type:"button",className:"danger",disabled:j===p(n),onClick:()=>{q(n)},children:[e.jsx(ie,{size:13}),"Delete"]}):null,e.jsx("button",{type:"button",disabled:j===p(n),onClick:()=>{O("chat",n)},children:"Continue in Chat"}),e.jsx("button",{type:"button",disabled:j===p(n),onClick:()=>{O("work",n)},children:"Continue in repository Work"})]})]},t.id)})}):$.length>0?e.jsx("div",{className:"work-output-list",children:$.map(t=>e.jsxs("article",{className:"work-output-card",children:[e.jsxs("header",{children:[e.jsx(y,{size:16}),e.jsxs("span",{children:[e.jsx("strong",{children:t.title}),e.jsx("small",{children:C(t.sizeBytes)})]})]}),e.jsx("div",{className:"work-output-actions",children:e.jsxs("button",{type:"button",onClick:()=>{B(t.path)},children:[e.jsx(W,{size:13}),"Reveal"]})})]},t.path))}):e.jsx(F,{icon:y,title:"No saved outputs yet",detail:"Finished files and connected results will appear here."}):null,k==="activity"?R.length>0?e.jsx("div",{className:"work-activity-list",children:R.map(t=>e.jsxs("details",{className:`work-activity-row ${t.state??""}`,children:[e.jsxs("summary",{children:[e.jsx(_,{size:14}),e.jsx("span",{children:t.label}),e.jsx("small",{children:t.state??"completed"})]}),e.jsx("p",{children:t.content}),t.detail?e.jsx("pre",{children:t.detail}):null]},t.id))}):e.jsx(F,{icon:_,title:"No activity yet",detail:"Commands, tool receipts, and checks appear while Work runs."}):null,k==="context"?e.jsxs("div",{className:"work-context",children:[e.jsxs("section",{children:[e.jsx("h3",{children:"Model context"}),e.jsx("p",{children:l.summary}),e.jsx("small",{children:l.tokensLabel})]}),e.jsxs("section",{children:[e.jsx("h3",{children:"Task inputs and sources"}),z.length>0?e.jsx("ul",{children:z.map(t=>e.jsxs("li",{children:[e.jsx(E,{size:13}),e.jsxs("span",{children:[e.jsx("strong",{children:t.title}),e.jsx("small",{children:t.detail})]})]},t.key))}):e.jsx("p",{children:"No attached files or cited sources yet."})]})]}):null]})]})}function se(i){return i.flatMap(r=>r.activities??[]).filter(r=>r.kind!=="reasoning").reverse()}function re(i){const r=new Map;for(const l of i)for(const s of l.activities??[])for(const c of s.artifacts??[])!c.path||c.sizeBytes===null||r.set(c.path,{path:c.path,title:c.title,sizeBytes:c.sizeBytes});return[...r.values()].sort((l,s)=>s.path.localeCompare(l.path))}function oe(i){const r=new Map,l=new Set;for(const s of i){const c=g(s.data);if(s.action==="work_output_delete"&&s.status==="completed"){for(const d of c){const u=p(d);l.add(u),r.delete(u)}continue}if(s.action!=="work_output_read")for(const d of c){const u=p(d);l.has(u)||r.set(u,d)}}return[...r.values()].sort((s,c)=>c.createdAt.localeCompare(s.createdAt)||c.revision-s.revision)}function p(i){return`${i.id}:${i.revision}`}function ae(i){const r=new Map;for(const l of i){const s=r.get(l.id)??[];s.push(l),r.set(l.id,s)}return[...r.entries()].map(([l,s])=>({id:l,revisions:s.sort((c,d)=>d.revision-c.revision||d.createdAt.localeCompare(c.createdAt))})).sort((l,s)=>s.revisions[0].createdAt.localeCompare(l.revisions[0].createdAt))}function g(i,r=[],l=new Set,s=0){if(s>8||i==null)return r;const c=Y.safeParse(i);if(c.success){const d=`${c.data.id}:${c.data.revision}`;return l.has(d)||(l.add(d),r.push(c.data)),r}if(Array.isArray(i)){for(const d of i)g(d,r,l,s+1);return r}if(typeof i=="object")for(const d of Object.values(i))g(d,r,l,s+1);return r}function le(i){const r=new Map;for(const l of i){for(const s of l.attachments??[])r.set(`attachment:${s.id}`,{key:`attachment:${s.id}`,title:s.name,detail:`${s.mediaType} · ${C(s.sizeBytes)}`});for(const s of l.sources??[])r.set(`source:${s.id}`,{key:`source:${s.id}`,title:s.title,detail:s.sourceName??ue(s.url)})}return[...r.values()]}function F({icon:i,title:r,detail:l}){return e.jsxs("div",{className:"work-sidebar-empty",children:[e.jsx(i,{size:22}),e.jsx("strong",{children:r}),e.jsx("p",{children:l})]})}function ce(i){return i.kind==="deployment"?"Deployment":i.kind==="source_change"?"Source change":i.kind==="external_resource"?i.provider:i.kind==="agent_package"?`${i.actions.length} action${i.actions.length===1?"":"s"}`:i.location.kind==="local"?C(i.sizeBytes):i.location.kind==="managed"?"Managed file":i.location.provider}function C(i){return i<1024?`${i} B`:i<1024*1024?`${Math.round(i/1024)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`}function de(i){const r=window.atob(i),l=new ArrayBuffer(r.length),s=new Uint8Array(l);for(let c=0;c<r.length;c+=1)s[c]=r.charCodeAt(c);return l}function L(i){return i.kind==="file"&&i.location.kind==="local"?i.location.path:""}function ue(i){try{return new URL(i).hostname||i}catch{return i}}function pe(i){return i&&typeof i=="object"&&!Array.isArray(i)?i:{}}export{Ce as WorkSidebarPanel,re as visibleChatFileArtifacts,se as visibleWorkActivities,oe as workOutputsFromEvents};
@@ -1,7 +1,7 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/WorkspaceMonacoEditor-TrUDJMKb.js","assets/index-DEg0S7Qk.js","assets/index-erq7hUne.css","assets/WorkspaceMonacoEditor-BwKcXIZw.css"])))=>i.map(i=>d[i]);
2
- import{j as e,r as l,_ as ka}from"./index-DEg0S7Qk.js";import{T as wa,F as ya,a as Sa,M as Na,d as Ca,i as Ks,h as Ra,j as $a,f as Gs,I as Fa}from"./MarkdownText-BBVriBCj.js";import{_ as Et,o as ds,s as te,b as Ea,n as un,bL as Aa,e as ge,L as ot,aL as qs,aG as fn,be as Ae,W as z,c1 as At,bC as Pt,bA as Ue,aB as is,c2 as Pa,b7 as La,c3 as Da,b8 as _a,F as Ta,K as pn,y as Ma,X as Xs,v as za,b9 as Ia,aJ as Wa,aK as Ba,bZ as Oa,c4 as Ua,az as Zs,c5 as Ha,bp as Va,c6 as rs,c7 as Ka,c8 as ls,c9 as Ga,w as qa,Y as hn,V as Xa,ca as ts,cb as Za,cc as os,bJ as Re,cd as Qa,ce as Qs,cf as Ya,cg as Ja,ch as ei}from"./App-pcwmC4IR.js";import{t as ti,a as si,b as ni,m as ai,s as ii,d as ri,f as li,c as oi}from"./training-model-data-CKOkpBBL.js";import{F as Nt}from"./folder-open-CbmUjIYS.js";import{I as Ys}from"./info-5bL9xSSf.js";import{M as ci}from"./minimize-2-BGVWKvTg.js";import{S as di}from"./save-CvYL4DUg.js";import{C as ui}from"./clipboard-BgjV3aCx.js";const mn=Et(["local","sandbox"]),fi=Et(["pinned","saved_for_later"]),pi=ds({id:te().min(1),workspaceKind:mn,workspaceId:te().min(1),workspaceName:te().min(1),path:te().min(1),status:fi,order:un().int().nonnegative().nullable().default(null),sourceSessionId:te().min(1).nullable().default(null),available:Ea().default(!0),createdAt:te().min(1),updatedAt:te().min(1)});ds({items:Aa(pi)});ds({workspaceKind:mn,workspaceId:te().trim().min(1),workspaceName:te().trim().min(1),path:te().trim().min(1),status:Et(["pinned","saved_for_later","none"]),order:un().int().nonnegative().nullable().optional(),sourceSessionId:te().trim().min(1).nullable().optional()});Et(["pin","save_for_later","remove","list"]);function cs(t){let s=t.trim().replaceAll("\\","/");if(s=s.replace(/^(?:workspace|sandbox):file:/,""),s=s.replace(/^\/workspace\/app\//,""),s=s.replace(/^\.\//,""),!s||s.startsWith("/"))throw new Error("File path must be relative to the workspace.");const n=s.split("/").filter(a=>a&&a!==".");if(n.some(a=>a===".."))throw new Error("File path cannot leave the workspace.");if(n.length===0)throw new Error("File path is required.");return n.join("/")}function hi(t){return["sidebar-file",t.workspaceKind,encodeURIComponent(t.workspaceId),encodeURIComponent(cs(t.path))].join(":")}const mi=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],xi=ge("text-align-start",mi);const bi=[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]],gi=ge("chevrons-up",bi);const ji=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],vi=ge("columns-2",ji);const ki=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],wi=ge("eye-off",ki);const yi=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}]],Si=ge("panel-top",yi);const Ni=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],Ci=ge("plug",Ni);const Ri=[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]],$i=ge("redo-2",Ri);const Fi=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],Ei=ge("undo-2",Fi);function Ai({createRuntime:t,goalRuntime:s,subagentRuntime:n=null,onRunSubagentLifecycleAction:a}){const i=t?"Create/Improve Details":"Goal Details",u=t?Z(t.run.state):n?.activeCount?n.label:s?.actionLabel??"No active goal";return e.jsxs("div",{className:"goal-details-view","aria-label":i,children:[e.jsxs("div",{className:"goal-details-header",children:[e.jsxs("div",{className:"goal-details-title",children:[e.jsx(ot,{size:15,"aria-hidden":"true"}),e.jsx("span",{children:i})]}),e.jsx("span",{className:`goal-details-state ${Zi(t?.run.state??null)}`,children:u})]}),e.jsx("div",{className:"goal-details-body",children:t?e.jsx(Pi,{runtime:t}):s||n?e.jsx(Di,{goalRuntime:s,subagentRuntime:n,onRunSubagentLifecycleAction:a}):e.jsx(Xi,{})})]})}function Pi({runtime:t}){const s=t.run,n=s.plan,a=qs(n?.metadata)??qs(s.metadata),i=s.questions,u=i.filter(o=>o.status==="pending"),c=s.sourceRefs,d=s.checkRefs,p=s.state,x=s.target.kind==="agent"?s.target.defaultActionKey:null;return e.jsxs(e.Fragment,{children:[e.jsx(V,{title:"Current Work",children:e.jsx(rt,{rows:[["State",Z(p)],["Operation",s.operation],["Target",Z(s.target.kind)],["Name",s.target.displayName??s.target.id??"Pending"],["Target ID",s.target.id??"Pending"],["Default action",x??n?.defaultChatAction.key??"Pending"],["Adapter",Z(s.adapter.kind)],["Run",s.id],["Revision",String(s.revision)]]})}),e.jsx(V,{title:"Plan",children:n?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"goal-details-summary",children:n.summary}),e.jsx(rt,{rows:[["Objective",n.objective],["Context",n.capturedContextSummary],["Status",Z(n.status)],["Plan ID",n.id],["Run ID",n.runId],["Approval",n.approvalId??"Pending"],["Approved",n.approvedAt??"Not approved"]]})]}):u.length?e.jsx("p",{className:"goal-details-summary",children:"Waiting for answers before the model finalizes the Create plan."}):e.jsx("p",{className:"goal-details-summary",children:"The model is preparing the Create plan."})}),a?e.jsxs(V,{title:"Action Shape",children:[e.jsx(rt,{rows:[["Mode",a.label],["Default action",a.defaultActionKey??"None"],["Direct action",a.directActionHint??"None planned"],["Artifacts",a.artifactPolicy]]}),e.jsx("p",{className:"goal-details-note",children:a.detail})]}):null,i.length?e.jsx(V,{title:"Questions",children:e.jsx("div",{className:"goal-details-list",children:i.map(o=>e.jsxs("article",{className:"goal-details-list-item",children:[e.jsxs("div",{children:[e.jsx("strong",{children:o.title}),e.jsx("span",{className:`goal-details-inline-state ${o.status}`,children:Z(o.status)})]}),e.jsx("p",{children:o.prompt}),o.answer?e.jsxs("small",{children:["Answer: ",o.answer.label??o.answer.value]}):o.options.length?e.jsxs("small",{children:["Options: ",o.options.map(b=>b.label).join(", ")]}):null]},o.id))})}):null,n?.requirements.length?e.jsx(V,{title:"Setup Requirements",children:e.jsx("div",{className:"goal-details-list",children:n.requirements.map(o=>e.jsxs("article",{className:"goal-details-list-item",children:[e.jsxs("div",{children:[e.jsx("strong",{children:o.name}),e.jsx("span",{className:`goal-details-inline-state ${o.status}`,children:Z(o.status)})]}),e.jsxs("small",{children:[Z(o.kind),o.detail?`: ${o.detail}`:""]})]},`${o.kind}:${o.name}`))})}):null,n?.sourcePlan.length?e.jsx(V,{title:"Source Plan",children:e.jsx(St,{refs:n.sourcePlan.map(o=>({id:`${o.operation}:${o.path}`,primary:o.path,secondary:`${Z(o.operation)}: ${o.reason}`}))})}):null,n?.checks.length?e.jsx(V,{title:"Checks",children:e.jsx(St,{refs:n.checks.map(o=>({id:o.name,primary:o.name,secondary:`${o.required?"Required":"Optional"}: ${o.command}`}))})}):null,c.length||d.length?e.jsx(V,{title:"Run Refs",children:e.jsx(St,{refs:[...c.map(o=>({id:`source:${o}`,primary:o,secondary:"Source ref"})),...d.map(o=>({id:`check:${o}`,primary:o,secondary:"Check ref"}))]})}):null,e.jsx(Li,{run:s}),s.blockedReason?e.jsx(V,{title:"Blocked",children:e.jsxs("div",{className:"goal-details-alert",children:[e.jsx(fn,{size:15}),e.jsx("span",{children:s.blockedReason})]})}):null,e.jsx(V,{title:"Raw State",children:e.jsxs("details",{className:"goal-details-raw",children:[e.jsx("summary",{children:"Show structured payload"}),e.jsx("pre",{children:JSON.stringify(s,null,2)})]})})]})}function Li({run:t}){const s=[...t.context.attachments.map(i=>({id:`attachment:${i.id??i.name}`,primary:i.name,secondary:i.ref??i.mediaType??"Attachment"})),...t.context.apps.map(i=>({id:`app:${i.id}`,primary:i.name,secondary:i.required?"Required app context":"Optional app context"})),...t.context.tools.map(i=>({id:`tool:${i.name}`,primary:i.name,secondary:i.outputSummary??i.inputSummary??"Tool context"})),...t.context.targetRepoAssumptions.map(i=>({id:`target:${i}`,primary:i,secondary:"Target assumption"}))],n=t.workflowCapture,a=n?[...n.files.map(i=>({id:`workflow-file:${i}`,primary:i,secondary:"Captured file"})),...n.outputArtifacts.map(i=>({id:`workflow-artifact:${i}`,primary:i,secondary:"Output artifact"})),...n.traceRefs.map(i=>({id:`workflow-trace:${i}`,primary:i,secondary:"Trace"}))]:[];return!s.length&&!a.length?null:e.jsx(V,{title:"Context",children:e.jsx(St,{refs:[...s,...a]})})}function Di({goalRuntime:t,subagentRuntime:s,onRunSubagentLifecycleAction:n}){return e.jsxs(e.Fragment,{children:[t?e.jsxs(V,{title:"Goal",children:[e.jsx("p",{className:"goal-details-summary",children:t.objective}),e.jsx(rt,{rows:[["Status",t.actionLabel],["Runtime",t.timeLabel],["Detail",t.detail]]})]}):null,s?e.jsx(_i,{runtime:s,onRunSubagentLifecycleAction:n}):null,e.jsx(V,{title:"Raw State",children:e.jsxs("details",{className:"goal-details-raw",children:[e.jsx("summary",{children:"Show structured payload"}),e.jsx("pre",{children:JSON.stringify({goalRuntime:t,subagentRuntime:s},null,2)})]})})]})}function _i({runtime:t,onRunSubagentLifecycleAction:s}){const[n,a]=l.useState(null),[i,u]=l.useState(null);Ae(i);const c=async(d,p)=>{if(!s)return;const x=`${d}:${p}`;a(x),u(null);try{await s({runId:d,action:p})}catch(o){u(o instanceof Error?o.message:String(o))}finally{a(o=>o===x?null:o)}};return e.jsxs(e.Fragment,{children:[e.jsxs(V,{title:"Subagents",children:[e.jsx(rt,{rows:[["Latest update",Oi(t)],["Active",String(t.activeCount)],["Completed",String(t.completedCount)],["Failed",String(t.failedCount)],["Cancelled",String(t.cancelledCount)],["Paused",String(t.needsResumeCount)],["Terminal",String(t.terminalCount)],["Usage",Ui(t.usage.totalTokens,t.usage.requestCount)],["Evidence",String(t.evidenceRefs.length)],["Checks",String(t.testsRunCount)]]}),t.blockers.length>0?e.jsx("ul",{className:"goal-details-list compact",children:t.blockers.slice(0,4).map(d=>e.jsxs("li",{className:"goal-details-list-item",children:[e.jsx("span",{className:`goal-details-inline-state ${d.status}`,children:d.status}),e.jsxs("div",{children:[e.jsx("strong",{children:Ct(d.roleId)}),e.jsx("p",{children:d.message})]})]},`${d.runId}:${d.message}`))}):null,e.jsx("ul",{className:"goal-details-list",children:t.runs.slice(0,8).map(d=>e.jsxs("li",{className:"goal-details-list-item",children:[e.jsx("span",{className:`goal-details-inline-state ${d.status}`,children:d.status}),e.jsxs("div",{children:[e.jsx("strong",{children:Ct(d.roleId)}),e.jsx("p",{children:d.objective}),d.report?.summary?e.jsx("small",{children:d.report.summary}):null,s?e.jsx(Mi,{pendingAction:n,run:d,onRun:c}):null]})]},d.id))})]}),t.finalResults.length>0?e.jsx(Ti,{results:t.finalResults}):null]})}function Ti({results:t}){return e.jsx(V,{title:"Child Results",children:e.jsx("ol",{className:"goal-details-task-graph",children:t.slice(0,6).map(s=>e.jsxs("li",{className:"goal-details-task-node",children:[e.jsxs("div",{className:"goal-details-task-node-header",children:[e.jsx("span",{className:`goal-details-inline-state ${s.status}`,children:s.status}),e.jsxs("div",{children:[e.jsx("strong",{children:Ct(s.roleId)}),e.jsx("small",{children:s.objective})]})]}),e.jsx("p",{children:s.summary}),e.jsxs("div",{className:"goal-details-task-node-meta",children:[e.jsxs("span",{children:[s.refs.length," refs"]}),e.jsxs("span",{children:[s.testsRun.length+s.validationAttempts.length," checks"]}),e.jsxs("span",{children:[s.blockers.length," blockers"]}),e.jsx("span",{children:s.confidence?`${Z(s.confidence)} confidence`:"Confidence unknown"})]}),s.findings.length>0?e.jsxs("small",{children:["Findings: ",$e(s.findings,3)]}):null,s.changedFiles.length>0?e.jsxs("small",{children:["Files: ",$e(s.changedFiles,4)]}):null,s.testsRun.length>0?e.jsxs("small",{children:["Tests: ",$e(s.testsRun,3)]}):null,s.validationAttempts.length>0?e.jsxs("small",{children:["Validation: ",$e(s.validationAttempts,2)]}):null,s.refs.length>0?e.jsxs("small",{children:["Refs: ",$e(s.refs.map(Hi),4)]}):null,s.blockers.length>0?e.jsxs("small",{children:["Blockers: ",$e(s.blockers,3)]}):null,s.workspaceRetention?e.jsxs("small",{children:["Workspace: ",Ki(s.workspaceRetention)]}):null,s.importantMessages.length>0?e.jsxs("small",{children:["Messages: ",$e(s.importantMessages.map(Vi),2)]}):null]},s.runId))})})}function Mi({pendingAction:t,run:s,onRun:n}){const a=zi(s);return a.length===0?null:e.jsx("div",{className:"goal-details-actions",children:a.map(i=>{const u=`${s.id}:${i}`,c=t===u;return e.jsx("button",{type:"button",disabled:!!t,onClick:()=>{n(s.id,i)},children:c?"Working...":Ii(i)},i)})})}function zi(t){const s=[],n=Wi(t),a=Bi(t);return n&&s.push("cleanup"),a&&s.push("archive"),s}function Ii(t){return t==="cleanup"?"Clean":t==="archive"?"Archive":"Clean + archive"}function Wi(t){if(!xn(t))return!1;const s=lt(t.metadata);if(!s?.subagentWorkspace&&!s?.workspaceHandoff)return!1;const n=lt(s.lifecycleCleanup),a=lt(n?.workspaceCleanup),i=bn(a?.status);return i!=="removed"&&i!=="deleted"&&i!=="retained"&&i!=="skipped"}function Bi(t){if(!t.childSessionId||!xn(t))return!1;const s=lt(lt(t.metadata)?.childSessionArchive),n=bn(s?.status);return n!=="archived"&&n!=="already_archived"}function xn(t){return t.status==="completed"||t.status==="failed"||t.status==="cancelled"}function Oi(t){const s=t.latestMeaningfulUpdate;return s?`${Ct(s.roleId)} ${s.status}: ${s.message}`:"No structured update"}function Ui(t,s){if(t<=0&&s<=0)return"0 tokens";const n=`${s} ${s===1?"request":"requests"}`;return`${Gi(t)} tokens · ${n}`}function Ct(t){return t.slice(0,1).toUpperCase()+t.slice(1).replace(/[-_]+/g," ")}function Hi(t){return`${t.kind}: ${t.label}`}function Vi(t){return`${Z(t.kind)}: ${t.body}`}function Ki(t){const s=t.expiresAt?`until ${qi(t.expiresAt)}`:"for inspection",n=t.trigger?` · ${Z(t.trigger)}`:"";return`retained ${s}${n}`}function $e(t,s){const n=t.slice(0,s),a=t.length-n.length;return a>0?`${n.join(", ")} +${a}`:n.join(", ")}function Gi(t){if(t<1e3)return String(t);if(t>=1e6){const n=t/1e6;return`${Js(n,n<10?2:1)}M`}const s=t/1e3;return`${Js(s,s<10?1:0)}k`}function qi(t){const s=new Date(t);return Number.isNaN(s.getTime())?t:s.toLocaleString([],{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function Js(t,s){return t.toFixed(s).replace(/\.0+$/,"").replace(/(\.\d*?)0+$/,"$1")}function Xi(){return e.jsxs("div",{className:"goal-details-empty",children:[e.jsx(ot,{size:18}),e.jsx("span",{children:"No active Goal or Create workflow."})]})}function V({children:t,title:s}){return e.jsxs("section",{className:"goal-details-section",children:[e.jsx("h2",{children:s}),t]})}function rt({rows:t}){return e.jsx("dl",{className:"goal-details-grid",children:t.map(([s,n])=>e.jsxs("div",{children:[e.jsx("dt",{children:s}),e.jsx("dd",{children:n})]},s))})}function St({refs:t}){return e.jsx("ul",{className:"goal-details-ref-list",children:t.map(s=>e.jsxs("li",{children:[e.jsx("code",{title:s.primary,children:s.primary}),e.jsx("span",{children:s.secondary})]},s.id))})}function lt(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function bn(t){return typeof t=="string"&&t.trim()?t.trim():null}function Z(t){return t.split(/[_-]/g).filter(Boolean).map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join(" ")}function Zi(t){return t==="ready_local"||t==="published_hosted"?"success":t==="blocked"||t==="failed"||t==="cancelled"?"danger":t==="awaiting_questions"||t==="awaiting_plan_approval"?"warning":"active"}function Qi({sandboxId:t,connection:s}){const[n,a]=l.useState(null),[i,u]=l.useState([]),[c,d]=l.useState(null),[p,x]=l.useState(null),[o,b]=l.useState(null),[S,k]=l.useState(null);Ae(o,{prefix:"Sandbox"}),Ae(S,{prefix:"Sandbox integrations"});const N=n?.integrationLeases??[],F=l.useMemo(()=>i.filter(v=>v.status==="active"),[i]),T=l.useMemo(()=>Ji(n),[n]),I=l.useCallback(async()=>{if(!s){b("OpenPond App server is not connected.");return}if(!t){a(null),u([]),b(null);return}d("summary"),b(null);try{const v=await z.sandbox(s,t),$=await z.integrationConnections(s,en(v.sandbox));a(v.sandbox),u($.connections),k(null)}catch(v){b(v instanceof Error?v.message:String(v))}finally{d(null)}},[s,t]),K=l.useCallback(async()=>{if(!(!s||!n)){x("load"),k(null);try{const[v,$]=await Promise.all([z.integrationConnections(s,en(n)),z.sandboxIntegrationLeases(s,n.id)]);u(v.connections),a($.sandbox)}catch(v){k(v instanceof Error?v.message:String(v))}finally{x(null)}}},[s,n]),H=l.useCallback(async v=>{if(!s||!n)return;const $=At(v.provider),D=$?Pt($):null,M=D?.leasePolicy.allowedCapabilityIds??[];if(!$||!D?.leasePolicy.leaseable||M.length===0){k(`${re(v.provider)} cannot be attached to this sandbox.`);return}x(`attach:${v.id}`),k(null);try{const E=await z.attachSandboxIntegrationConnection(s,n.id,{connectionId:v.id,provider:v.provider,capabilities:M,...v.scopes.length>0?{scopes:v.scopes}:{},...D.leasePolicy.defaultTtlSeconds?{ttlSeconds:D.leasePolicy.defaultTtlSeconds}:{},required:!1});a(E.sandbox)}catch(E){k(E instanceof Error?E.message:String(E))}finally{x(null)}},[s,n]),W=l.useCallback(async v=>{if(!(!s||!n)){x(`remove:${v}`),k(null);try{const $=await z.removeSandboxIntegrationLease(s,n.id,v);a($.sandbox)}catch($){k($ instanceof Error?$.message:String($))}finally{x(null)}}},[s,n]);return l.useEffect(()=>{I()},[I]),t?e.jsxs("div",{className:"sandbox-summary-tab",children:[e.jsxs("section",{className:"sandbox-workspace-section",children:[e.jsxs("div",{className:"sandbox-workspace-heading",children:[e.jsx("h3",{children:"Sandbox"}),e.jsxs("div",{className:"sandbox-workspace-heading-actions",children:[n?e.jsx("span",{children:n.state}):null,e.jsx("button",{type:"button",className:"diff-icon-button",title:"Refresh summary","aria-label":"Refresh summary",disabled:c!==null,onClick:()=>{I()},children:c==="summary"?e.jsx(Ue,{className:"spinning",size:14}):e.jsx(is,{size:14})})]})]}),n?e.jsxs("dl",{className:"sandbox-workspace-kv",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Sandbox"}),e.jsx("dd",{children:tn(n.id)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Spend"}),e.jsxs("dd",{children:[ss(n.reservation.capturedUsd)," / ",ss(n.budget.maxUsd)]})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Reservation"}),e.jsx("dd",{children:n.reservation.status})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Idle cleanup"}),e.jsx("dd",{children:n.quotas?.idleTimeoutSeconds?`${Math.round(n.quotas.idleTimeoutSeconds/60)} min`:"-"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Updated"}),e.jsx("dd",{children:gn(n.updatedAt)})]}),T?e.jsxs("div",{children:[e.jsx("dt",{children:"Receipt"}),e.jsxs("dd",{children:[tn(T.id)," / ",ss(T.totalUsd)]})]}):null]}):e.jsxs("div",{className:"sandbox-workspace-loading",children:[c==="summary"?e.jsx(Ue,{className:"spinning",size:16}):null,e.jsx("span",{children:c==="summary"?"Loading sandbox":"Sandbox unavailable"})]})]}),e.jsxs("section",{className:"sandbox-workspace-section",children:[e.jsxs("div",{className:"sandbox-workspace-heading",children:[e.jsx("h3",{children:"Integrations"}),e.jsxs("div",{className:"sandbox-workspace-heading-actions",children:[e.jsx("span",{children:N.length}),e.jsx("button",{type:"button",className:"diff-icon-button",title:"Refresh integrations","aria-label":"Refresh integrations",disabled:p!==null||!n,onClick:()=>{K()},children:p==="load"?e.jsx(Ue,{className:"spinning",size:14}):e.jsx(is,{size:14})})]})]}),N.length>0?e.jsx("div",{className:"sandbox-workspace-integration-list",children:N.map(v=>e.jsxs("div",{className:"sandbox-workspace-integration-row",children:[e.jsxs("div",{className:"sandbox-workspace-integration-main",children:[e.jsx("span",{children:re(v.provider)}),e.jsxs("small",{children:[v.required?"required":"optional"," / ",sr(v)," / ",Yi(v)]})]}),e.jsx("button",{type:"button",className:"diff-icon-button",title:`Revoke ${re(v.provider)} lease`,"aria-label":`Revoke ${re(v.provider)} lease`,disabled:p!==null,onClick:()=>{W(v.leaseId)},children:p===`remove:${v.leaseId}`?e.jsx(Ue,{className:"spinning",size:14}):e.jsx(wa,{size:14})}),e.jsxs("div",{className:"sandbox-workspace-chip-row",children:[v.capabilities.slice(0,5).map($=>e.jsx("span",{children:tr(v.provider,$)},$)),v.capabilities.length>5?e.jsxs("span",{children:["+",v.capabilities.length-5]}):null]})]},v.leaseId))}):e.jsx("p",{className:"sandbox-workspace-empty",children:"No active integration leases."}),F.length>0?e.jsx("div",{className:"sandbox-workspace-integration-list",children:F.map(v=>{const $=N.some(E=>E.provider===v.provider),M=er(v)?.leasePolicy.allowedCapabilityIds.length??0;return e.jsxs("div",{className:"sandbox-workspace-integration-row compact",children:[e.jsxs("div",{className:"sandbox-workspace-integration-main",children:[e.jsx("span",{children:nr(v)}),e.jsx("small",{children:ar(v,M)})]}),e.jsx("button",{type:"button",className:"diff-icon-button",title:$?`${re(v.provider)} already attached`:`Attach ${re(v.provider)}`,"aria-label":$?`${re(v.provider)} already attached`:`Attach ${re(v.provider)}`,disabled:$||p!==null||M===0,onClick:()=>{H(v)},children:p===`attach:${v.id}`?e.jsx(Ue,{className:"spinning",size:14}):e.jsx(Ci,{size:14})})]},v.id)})}):e.jsx("p",{className:"sandbox-workspace-empty",children:"No connected accounts available."})]})]}):e.jsx("div",{className:"sandbox-summary-tab",children:e.jsx("p",{className:"sandbox-workspace-empty",children:"No sandbox is attached yet."})})}function en(t){return{status:"active"}}function Yi(t){return t.proxyUrl?"runtime proxy available":"metadata only, no runtime proxy"}function Ji(t){return t?.receipts?.at(-1)??null}function er(t){const s=At(t.provider);return s?Pt(s):null}function re(t){const s=At(t),n=s?Pt(s):null;return n?n.label:t==="microsoft_teams"?"Microsoft Teams":t?t.replace(/_/g," "):"Integration"}function tr(t,s){const n=At(t);return(n?Pt(n):null)?.capabilities.find(i=>i.id===s)?.label??s}function sr(t){return t.expiresAt?`expires ${gn(t.expiresAt)}`:"active"}function nr(t){const s=t.providerAccountName?.trim();return s?`${re(t.provider)} / ${s}`:re(t.provider)}function ar(t,s){const n=[];return t.providerWorkspaceName&&n.push(t.providerWorkspaceName),n.push(`${s} lease ${s===1?"capability":"capabilities"}`),t.scopes.length>0&&n.push(`${t.scopes.length} ${t.scopes.length===1?"scope":"scopes"}`),n.join(" / ")}function tn(t){return t.length>10?`${t.slice(0,8)}...`:t}function gn(t){if(!t)return"-";const s=new Date(t);return Number.isNaN(s.valueOf())?"-":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(s)}function ss(t){const s=Number(t??0);return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:s>=10?2:4}).format(Number.isFinite(s)?s:0)}function ir({summary:t}){const s=ti(t.taskset),n=t.taskset.learningSignals.demonstrations.filter(d=>d.approved).length,a=t.taskset.tasks.filter(d=>d.split==="frozen_eval").length,i=t.plan?.recipe.method==="sft"||t.plan?.recipe.method==="grpo"?t.plan.recipe:null,u=si(t.taskset,t.plan),c=t.job?ni(t.job.status,t.job.completedAt,t.job.updatedAt):null;return e.jsxs("div",{className:"training-sidebar-summary",children:[e.jsxs("header",{children:[e.jsx("h2",{children:ai(t.taskset.name)}),e.jsx("span",{children:t.job?ii(t.job.status):t.taskset.readiness?.ready?"Ready to train":"Needs review"})]}),e.jsxs("section",{children:[e.jsx("h3",{children:"Run"}),e.jsxs("dl",{children:[e.jsx(U,{label:"Primary recommendation",value:s.toUpperCase()}),e.jsx(U,{label:"Training stage",value:u}),e.jsx(U,{label:"Base model",value:i?.baseModel.id??"Not selected"}),e.jsx(U,{label:"Compute",value:t.plan?ri(t.plan.destinationId):"Not selected"}),e.jsx(U,{label:"Started",value:li(t.job?.startedAt??null)}),e.jsx(U,{label:"Duration",value:oi(t.job?.startedAt??null,c)})]})]}),e.jsxs("section",{children:[e.jsx("h3",{children:"Data"}),e.jsxs("dl",{children:[e.jsx(U,{label:"Training examples",value:String(n)}),e.jsx(U,{label:"Test examples",value:String(a)}),e.jsx(U,{label:"Dataset sources",value:String(t.taskset.sourceRefs.length)})]})]}),i?e.jsxs("section",{children:[e.jsx("h3",{children:"Recipe"}),e.jsxs("dl",{children:[i.method==="grpo"?e.jsx(U,{label:"RL loss",value:i.loss.method==="gspo-token"?"GSPO-token":i.loss.method.toUpperCase()}):null,e.jsx(U,{label:"LoRA rank",value:String(i.lora.rank)}),e.jsx(U,{label:"Learning rate",value:String(i.optimizer.learningRate)}),e.jsx(U,{label:"Optimizer steps",value:String(i.optimizer.maxSteps)}),e.jsx(U,{label:i.method==="grpo"?"Prompt length":"Sequence length",value:String(i.method==="grpo"?i.dataset.maxPromptTokens:i.dataset.maxSequenceLength)})]})]}):null,e.jsxs("section",{children:[e.jsx("h3",{children:"Result"}),e.jsxs("dl",{children:[e.jsx(U,{label:"Adapter",value:t.lineage?`${u} ready`:"Not created"}),e.jsx(U,{label:"Evaluation",value:t.lineage?.frozenEvaluationArtifactId?"Completed":"Not completed"}),e.jsx(U,{label:"Artifacts",value:String(t.artifacts.length)})]})]})]})}function U({label:t,value:s}){return e.jsxs("div",{children:[e.jsx("dt",{children:t}),e.jsx("dd",{children:s})]})}function rr(t){const s=sn("","","folder");for(const n of t){const a=n.endsWith("/"),i=n.split("/").filter(Boolean);if(i.length===0)continue;let u=s,c="";for(let d=0;d<i.length;d+=1){const p=i[d];c=c?`${c}/${p}`:p;const x=!a&&d===i.length-1?"file":"folder",o=`${x}:${p}`;let b=u.childMap.get(o);b||(b=sn(p,c,x),u.childMap.set(o,b),u.children.push(b)),u=b}}return jn(s.children)}function sn(t,s,n){return{name:t,path:s,type:n,children:[],childMap:new Map}}function jn(t){return t.sort((s,n)=>s.type!==n.type?s.type==="folder"?-1:1:s.name.localeCompare(n.name)).map(s=>({name:s.name,path:s.path,type:s.type,children:jn(s.children)}))}function us({className:t,currentStatus:s,onSetStatus:n}){const a=s==="pinned",i=s==="saved_for_later";return e.jsxs("span",{className:`workspace-file-bookmark-actions ${t??"workspace-file-heading-actions"}`,children:[e.jsx("button",{type:"button",className:a?"active":void 0,"data-tooltip":a?"Unpin file":"Pin file","aria-label":a?"Unpin file":"Pin file","aria-pressed":a,onClick:()=>n(a?"none":"pinned"),children:a?e.jsx(Pa,{size:14}):e.jsx(La,{size:14})}),e.jsx("button",{type:"button",className:i?"active":void 0,"data-tooltip":i?"Remove from Save for later":"Save file for later","aria-label":i?"Remove from Save for later":"Save file for later","aria-pressed":i,onClick:()=>n(i?"none":"saved_for_later"),children:i?e.jsx(Da,{size:14}):e.jsx(_a,{size:14})})]})}function lr({changedByPath:t,expandedFolderPaths:s,rootPath:n,repoFiles:a,selectedPath:i,getFileBookmarkStatus:u,onOpenFile:c,onSetFileBookmarkStatus:d,onToggleFolder:p}){const x=l.useMemo(()=>rr(a),[a]);return e.jsxs("div",{className:"workspace-file-tree-view",children:[e.jsxs("div",{className:"workspace-file-tree-header",children:[e.jsx(Nt,{size:14}),e.jsx("strong",{title:n??void 0,children:n?n.split("/").at(-1):"Files"}),e.jsx("span",{children:a.length})]}),e.jsx("div",{className:"workspace-file-tree",children:x.map(o=>e.jsx(vn,{changedByPath:t,expandedFolderPaths:s,node:o,rootPath:n,selectedPath:i,getFileBookmarkStatus:u,onOpenFile:c,onSetFileBookmarkStatus:d,onToggleFolder:p},`${o.type}:${o.path}`))})]})}function vn({changedByPath:t,depth:s=0,expandedFolderPaths:n,node:a,rootPath:i,selectedPath:u,getFileBookmarkStatus:c,onOpenFile:d,onSetFileBookmarkStatus:p,onToggleFolder:x}){const o=i?`${i}/${a.path}`:a.path,b=a.type==="folder"&&n.has(o),S=t.get(o),k=2+s*11;return a.type==="folder"?e.jsxs("div",{className:"workspace-file-tree-node",children:[e.jsxs("button",{type:"button",className:"workspace-file-tree-row folder","aria-expanded":b,style:{paddingLeft:k},onClick:()=>x(o),children:[b?e.jsx(Nt,{size:14}):e.jsx(Ta,{size:14}),e.jsx("span",{children:a.name})]}),b&&a.children.map(N=>e.jsx(vn,{changedByPath:t,depth:s+1,expandedFolderPaths:n,node:N,rootPath:i,selectedPath:u,getFileBookmarkStatus:c,onOpenFile:d,onSetFileBookmarkStatus:p,onToggleFolder:x},`${N.type}:${N.path}`))]}):e.jsxs("div",{className:`workspace-file-tree-row file ${S?"changed":""} ${u===o?"selected":""}`,style:{paddingLeft:k},children:[e.jsxs("button",{type:"button",className:"workspace-file-tree-row-main",title:o,onClick:()=>d(o),children:[e.jsx(ya,{size:13}),e.jsx("span",{children:a.name}),S&&e.jsxs("small",{children:[e.jsxs("span",{className:"diff-addition",children:["+",S.additions]}),e.jsxs("span",{className:"diff-deletion",children:["-",S.deletions]})]})]}),/\.html?$/i.test(o)&&e.jsx("button",{type:"button",className:"workspace-file-tree-bookmark-actions",title:"View source","aria-label":`View source for ${a.name}`,onClick:()=>d(o,{source:!0}),children:"</>"}),p?e.jsx(us,{className:"workspace-file-tree-bookmark-actions",currentStatus:c?.(o)??null,onSetStatus:N=>p(o,N)}):null]})}function nn({diff:t,expandedFolderPaths:s,rootPath:n,repoFiles:a,selectedPath:i,getFileBookmarkStatus:u,onOpenFile:c,onSetFileBookmarkStatus:d,onToggleFolder:p}){const x=t?.files??[],o=l.useMemo(()=>new Map(x.map(k=>[k.path,k])),[x]),b=n?.replace(/^\/+|\/+$/g,"")||null,S=l.useMemo(()=>{if(!b)return a;const k=`${b}/`;return a.filter(N=>N.startsWith(k)).map(N=>N.slice(k.length)).filter(Boolean)},[b,a]);return e.jsx("div",{className:"workspace-diff-files-view",children:e.jsx(lr,{changedByPath:o,expandedFolderPaths:s,rootPath:b,repoFiles:S,selectedPath:i,getFileBookmarkStatus:u,onOpenFile:c,onSetFileBookmarkStatus:d,onToggleFolder:p})})}function or({collapsed:t,editorControlsVisible:s,hideWhiteSpace:n,loadFullFiles:a,renderMarkdown:i,wordDiffs:u,wordWrap:c,onClose:d,onCopyGitApply:p,onRefresh:x,onToggleCollapsed:o,onToggleEditorControlsVisible:b,onToggleHideWhiteSpace:S,onToggleLoadFullFiles:k,onToggleRenderMarkdown:N,onToggleWordDiffs:F,onToggleWordWrap:T}){return e.jsxs("div",{className:"workspace-diff-options-menu",role:"menu",children:[e.jsx(ue,{icon:e.jsx(is,{size:14}),label:"Refresh",onClick:x,onClose:d}),e.jsx(ue,{checked:c,icon:e.jsx(Sa,{size:14}),label:"Enable word wrap",onClick:T,onClose:d}),e.jsx(ue,{checked:t,icon:e.jsx(gi,{size:14}),label:"Collapse all diffs",onClick:o,onClose:d}),e.jsx("div",{className:"workspace-diff-menu-divider"}),e.jsx(ue,{checked:s,icon:e.jsx(Si,{size:14}),label:"Show editor controls",onClick:b,onClose:d}),e.jsx(ue,{checked:i,icon:e.jsx(pn,{size:14}),label:"Render Markdown",onClick:N,onClose:d}),e.jsx(ue,{checked:!a,icon:e.jsx(ot,{size:14}),label:"Show diffs first",onClick:k,onClose:d}),e.jsx(ue,{checked:u,icon:e.jsx(xi,{size:14}),label:"Enable word diffs",onClick:F,onClose:d}),e.jsx(ue,{checked:n,icon:e.jsx(wi,{size:14}),label:"Hide white space",onClick:S,onClose:d}),e.jsx(ue,{icon:e.jsx(ui,{size:14}),label:"Copy git apply command",onClick:p,onClose:d})]})}function ue({checked:t,icon:s,label:n,onClick:a,onClose:i}){return e.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{a?.(),i()},children:[s,e.jsx("span",{children:n}),t&&e.jsx(Ma,{size:14})]})}function cr({addMenuOpen:t,expanded:s,filteredFiles:n,dirtyFilePaths:a,openFiles:i,goalDetailsAvailable:u,searchOpen:c,searchQuery:d,selectedPath:p,sideChatTabs:x=[],summaryAvailable:o,sourceStatus:b,sourceSwitcher:S,visibleTab:k,getFileBookmarkStatus:N,onCloseFileTab:F,onCloseSideChat:T,onCloseSearch:I,onOpenFile:K,onOpenBrowser:H,onOpenSearch:W,onOpenSideChat:v,onSearchQueryChange:$,onSetFileBookmarkStatus:D,onSelectFile:M,onSelectFiles:E,onSelectGoal:se,onSelectSummary:q,onSelectSideChat:X,onToggleAddMenu:B,onToggleExpanded:Q}){const ne=l.useRef(null);l.useEffect(()=>{if(!t&&!c)return;function w(){t&&B(),c&&I()}function O(_){ne.current?.contains(_.target)||w()}function P(_){_.key==="Escape"&&w()}return document.addEventListener("pointerdown",O),document.addEventListener("keydown",P),()=>{document.removeEventListener("pointerdown",O),document.removeEventListener("keydown",P)}},[t,I,B,c]);function Y(w){if(w.key==="Escape"){I();return}w.key==="Enter"&&n[0]&&K(n[0])}function oe(w){if(!["ArrowRight","ArrowLeft","Home","End"].includes(w.key))return;const O=w.target;if(!(O instanceof HTMLButtonElement)||O.getAttribute("role")!=="tab")return;const P=Array.from(w.currentTarget.querySelectorAll('button[role="tab"]')),_=P.indexOf(O);if(_<0||P.length===0)return;w.preventDefault();const Lt=Ha(_,P.length,w.key),Pe=P[Lt];if(!Pe)return;Pe.focus(),Pe.click();const ct=Pe.id;ct&&window.requestAnimationFrame(()=>document.getElementById(ct)?.focus())}return e.jsxs("div",{className:"workspace-diff-topbar",children:[e.jsxs("div",{className:"workspace-diff-tabs",role:"tablist","aria-label":"Right sidebar views",onKeyDown:oe,children:[u?e.jsxs("button",{type:"button",className:`workspace-diff-tab ${k==="goal"?"active":""}`,role:"tab","aria-selected":k==="goal",onClick:se,children:[e.jsx(ot,{size:14}),e.jsx("span",{children:"Goal"})]}):null,o&&q?e.jsxs("button",{type:"button",className:`workspace-diff-tab ${k==="summary"?"active":""}`,role:"tab","aria-selected":k==="summary",onClick:q,children:[e.jsx(Ys,{size:14}),e.jsx("span",{children:"Summary"})]}):null,e.jsxs("button",{type:"button",className:`workspace-diff-tab ${k==="files"?"active":""}`,role:"tab",id:"right-sidebar-files-tab","aria-controls":"right-sidebar-files-panel","aria-selected":k==="files",tabIndex:k==="files"?0:-1,onClick:E,children:[e.jsx(Nt,{size:14}),e.jsx("span",{children:"Files"})]}),i.map(w=>e.jsxs("div",{className:`workspace-diff-tab file ${k==="file"&&p===w.path?"active":""}`,children:[e.jsxs("button",{type:"button",className:"workspace-diff-tab-main",role:"tab","aria-selected":k==="file"&&p===w.path,title:w.path,onClick:()=>M(w.path),children:[e.jsx(ot,{className:"workspace-diff-tab-icon",size:13}),a.has(w.path)&&e.jsx("span",{className:"workspace-diff-tab-dirty","aria-hidden":"true"}),e.jsx("span",{children:w.path.split("/").pop()})]}),D?e.jsx(us,{className:"workspace-diff-tab-bookmark-actions",currentStatus:N?.(w.path)??null,onSetStatus:O=>D(w.path,O)}):null,e.jsx("button",{type:"button",className:"workspace-diff-tab-close",title:`Close ${w.path}`,onClick:O=>F(w.path,O),children:e.jsx(Xs,{size:12})})]},w.path)),x.map(w=>e.jsxs("div",{className:"workspace-diff-tab right-chat-tab",children:[e.jsxs("button",{type:"button",className:"workspace-diff-tab-main",role:"tab",id:`right-chat-tab-${w.id}`,"aria-controls":`right-chat-panel-${w.id}`,"aria-selected":!1,tabIndex:-1,title:w.title,onClick:()=>X?.(w.id),children:[w.running?e.jsx("span",{className:"right-chat-status-dot","aria-label":"Running"}):null,e.jsx("span",{children:w.title})]}),T?e.jsx("button",{type:"button",className:"workspace-diff-tab-close",title:`Close ${w.title}`,"aria-label":`Close ${w.title}`,onClick:O=>{O.stopPropagation(),T(w.id)},children:e.jsx(Xs,{size:12})}):null]},w.id)),e.jsxs("div",{className:"workspace-diff-add-anchor",ref:ne,children:[e.jsx("button",{type:"button",className:`workspace-diff-add-tab ${t||c?"active":""}`,title:"Add","aria-label":"Add to right sidebar",onClick:B,children:e.jsx(za,{size:15})}),t&&e.jsxs("div",{className:"workspace-diff-add-menu",role:"menu",children:[v?e.jsxs("button",{type:"button",role:"menuitem",onClick:v,children:[e.jsx(Ia,{size:14}),e.jsx("span",{children:"New task"}),e.jsx("kbd",{})]}):null,e.jsxs("button",{type:"button",role:"menuitem",onClick:E,children:[e.jsx(Nt,{size:14}),e.jsx("span",{children:"Files"}),e.jsx("kbd",{})]}),o&&q?e.jsxs("button",{type:"button",role:"menuitem",onClick:q,children:[e.jsx(Ys,{size:14}),e.jsx("span",{children:"Summary"}),e.jsx("kbd",{})]}):null,e.jsxs("button",{type:"button",role:"menuitem",onClick:W,children:[e.jsx(Wa,{size:14}),e.jsx("span",{children:"Open file"}),e.jsx("kbd",{children:"Ctrl+P"})]}),H?e.jsxs("button",{type:"button",role:"menuitem",onClick:H,children:[e.jsx(Ba,{size:14}),e.jsx("span",{children:"Browser"}),e.jsx("kbd",{children:"Ctrl+I"})]}):null]}),c&&e.jsxs("div",{className:"workspace-file-search-popover",children:[e.jsx("input",{autoFocus:!0,placeholder:"Search files",value:d,onChange:w=>$(w.target.value),onKeyDown:Y}),e.jsx("span",{children:"Files"}),e.jsx("div",{className:"workspace-file-search-results",children:n.length===0?e.jsx("small",{children:"Type to search for files"}):n.map(w=>e.jsx("button",{type:"button",onClick:()=>K(w),children:w},w))})]})]})]}),S||b?e.jsxs("div",{className:"workspace-diff-source-bar","aria-label":"Workspace source",children:[S?e.jsx("div",{className:"workspace-diff-source-toggle",role:"group","aria-label":"File source",children:S.options.map(w=>e.jsx("button",{type:"button",className:S.value===w.value?"active":"","aria-pressed":S.value===w.value,onClick:()=>S.onChange(w.value),children:w.label},w.value))}):null,b?e.jsx("span",{className:`workspace-diff-source-status ${b.tone}`,children:b.label}):null]}):null,e.jsx("button",{type:"button",className:"diff-icon-button",title:s?"Restore files panel":"Expand files panel","aria-label":s?"Restore files panel":"Expand files panel",onClick:Q,children:s?e.jsx(ci,{size:14}):e.jsx(Oa,{size:14})})]})}function dr({canCheckActiveFile:t,canSaveActiveFile:s,collapsed:n,editorControlsVisible:a,editorDiagnosticStatus:i,editorDiagnosticsChecking:u,hideWhiteSpace:c,loadFullFiles:d,menuOpen:p,renderMarkdown:x,showEditorCommandBar:o,showRenderMarkdownToggle:b,splitView:S,wordDiffs:k,wordWrap:N,onCopyGitApply:F,onEditorCheck:T,onEditorRedo:I,onEditorSave:K,onEditorUndo:H,onRefresh:W,onToggleCollapsed:v,onToggleEditorControlsVisible:$,onToggleHideWhiteSpace:D,onToggleLoadFullFiles:M,onToggleMenu:E,onToggleRenderMarkdown:se,onToggleSplitView:q,onToggleWordDiffs:X,onToggleWordWrap:B}){return e.jsx("div",{className:"workspace-diff-toolbar",children:e.jsxs("div",{className:"workspace-diff-toolbar-actions",children:[e.jsxs("div",{className:"workspace-diff-menu-anchor",children:[e.jsx("button",{type:"button",className:"diff-icon-button",title:"Diff options","aria-haspopup":"menu","aria-expanded":p,onClick:()=>E(),children:e.jsx(Ua,{size:15})}),p&&e.jsx(or,{collapsed:n,editorControlsVisible:a,hideWhiteSpace:c,loadFullFiles:d,renderMarkdown:x,wordDiffs:k,wordWrap:N,onClose:()=>E(!1),onCopyGitApply:F,onRefresh:W,onToggleCollapsed:v,onToggleEditorControlsVisible:$,onToggleHideWhiteSpace:D,onToggleLoadFullFiles:M,onToggleRenderMarkdown:se,onToggleWordDiffs:X,onToggleWordWrap:B})]}),o&&e.jsxs("div",{className:"workspace-editor-command-bar","aria-label":"Editor controls",children:[e.jsx("button",{type:"button",className:"diff-icon-button",title:"Save file","aria-label":"Save file",disabled:!s,onClick:K,children:e.jsx(di,{size:14})}),e.jsx("button",{type:"button",className:"diff-icon-button",title:"Undo","aria-label":"Undo",onClick:H,children:e.jsx(Ei,{size:14})}),e.jsx("button",{type:"button",className:"diff-icon-button",title:"Redo","aria-label":"Redo",onClick:I,children:e.jsx($i,{size:14})}),e.jsx("button",{type:"button",className:"diff-icon-button",title:"Check file","aria-label":"Check file",disabled:!t,onClick:T,children:u?e.jsx(Ue,{className:"spinning",size:14}):e.jsx(Zs,{size:14})}),i&&e.jsxs("span",{className:`workspace-editor-diagnostic-chip ${i.severity}`,children:[i.severity==="error"||i.severity==="warning"||i.severity==="unavailable"?e.jsx(fn,{size:13}):e.jsx(Zs,{size:13}),e.jsx("span",{children:i.label})]})]}),b&&e.jsx("button",{type:"button",className:`diff-icon-button ${x?"active":""}`,title:x?"Show Markdown source":"Render Markdown","aria-label":x?"Show Markdown source":"Render Markdown","aria-pressed":x,onClick:se,children:e.jsx(pn,{size:14})}),e.jsx("button",{type:"button",className:`diff-icon-button ${S?"active":""}`,title:S?"Show unified diff":"Show split diff","aria-label":S?"Show unified diff":"Show split diff","aria-pressed":S,onClick:q,children:e.jsx(vi,{size:14})})]})})}const ur={cjs:"typescript",css:"css",html:"html",js:"typescript",json:"json",jsx:"typescript",md:"markdown",mjs:"typescript",py:"python",sh:"shell",ts:"typescript",tsx:"typescript",yaml:"yaml",yml:"yaml"};function fs(t){const s=t.split("/").pop()?.toLowerCase()??"";if(s==="dockerfile")return"shell";if(s==="readme"||s==="readme.md")return"markdown";const n=s.includes(".")?s.split(".").pop()??"":"";return ur[n]??"text"}function fr(t,s){return t?s==="markdown"?pr(t):s==="json"?Ee(t,/("(?:\\.|[^"\\])*"(?=\s*:)|"(?:\\.|[^"\\])*"|[-]?\b\d+(?:\.\d+)?\b|\btrue\b|\bfalse\b|\bnull\b|[{}[\]:,])/g):s==="css"?Ee(t,/(\/\*.*?\*\/|#[\da-fA-F]{3,8}\b|--[\w-]+|[.#]?[\w-]+(?=\s*:)|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b\d+(?:\.\d+)?(?:px|rem|em|%|vh|vw)?\b|[{}():;,])/g):s==="html"?Ee(t,/(<!--.*?-->|<\/?[\w-]+|[\w:-]+(?==)|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|[<>/=])/g):s==="shell"?Ee(t,/(#.*$|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b(?:cd|cp|export|git|npm|pnpm|bun|yarn|rm|mkdir|test|if|then|fi|for|do|done|echo)\b|\$[\w_]+|&&|\|\||[|&;=])/g):s==="python"?Ee(t,/(#.*$|"""[\s\S]*?"""|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b(?:class|def|return|if|elif|else|for|while|try|except|finally|with|as|import|from|None|True|False|async|await|lambda|yield)\b|\b[A-Z][\w]*\b|\b\d+(?:\.\d+)?\b|[+\-*/%=<>!&|.:,()[\]{}]+)/g):Ee(t,/(\/\/.*$|\/\*.*?\*\/|`(?:\\.|[^`\\])*`|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b(?:abstract|as|async|await|boolean|break|case|catch|class|const|continue|default|else|enum|export|extends|false|finally|for|from|function|if|import|in|interface|let|new|null|number|of|return|string|switch|throw|true|try|type|undefined|void|while)\b|\b[A-Z][\w]*\b|\b\d+(?:\.\d+)?\b|[+\-*/%=<>!&|?:.,()[\]{}]+)/g):[{text:" ",kind:"plain"}]}function pr(t){return/^\s{0,3}#{1,6}\s/.test(t)?[{text:t,kind:"keyword"}]:/^\s*[-*+]\s/.test(t)?[{text:t,kind:"property"}]:Ee(t,/(`[^`]+`|\*\*[^*]+\*\*|\[[^\]]+\]\([^)]+\)|https?:\/\/\S+)/g)}function hr(t){return/^(\/\/|#|\/\*|<!--)/.test(t)?"comment":/^["'`]/.test(t)?"string":/^[-]?\d/.test(t)||/^#[\da-fA-F]{3,8}\b/.test(t)?"number":/^\b[A-Z]/.test(t)?"type":/^[.#]?[\w-]+$/.test(t)&&t.includes("-")?"property":/^(?:[{}()[\],.:;<>/=+\-*&|!?%]+)$/.test(t)?"operator":/^(?:--|\$)/.test(t)?"property":"keyword"}function Ee(t,s){const n=[];let a=0;for(const i of t.matchAll(s)){const u=i.index??0;u>a&&n.push({text:t.slice(a,u),kind:"plain"});const c=i[0];if(n.push({text:c,kind:hr(c)}),a=u+c.length,/^(\/\/|#|<!--)/.test(c))break}return a<t.length&&n.push({text:t.slice(a),kind:"plain"}),n.length>0?n:[{text:t,kind:"plain"}]}function Rt({language:t,text:s}){return e.jsx(e.Fragment,{children:fr(s,t).map((n,a)=>e.jsx("span",{className:`syntax-token ${n.kind}`,children:n.text},`${a}-${n.text}`))})}function mr({path:t,contentBase64:s}){const n=t.replace(/\\/g,"/").split("/").pop()||"document",a=l.useMemo(()=>{try{const d=atob(s.replace(/\s/g,"")),p=Uint8Array.from(d,x=>x.charCodeAt(0));return new Blob([p],{type:xr(t)})}catch{return null}},[s,t]),[i,u]=l.useState(null);l.useEffect(()=>{if(!a)return;const d=URL.createObjectURL(a);return u({blob:a,url:d}),()=>URL.revokeObjectURL(d)},[a]);const c=i?.blob===a?i.url:null;return a?c?e.jsxs("div",{className:"workspace-document-preview",children:[e.jsxs("div",{className:"workspace-document-preview-card",children:[e.jsx("strong",{children:n}),e.jsx("span",{children:/\.pdf$/i.test(t)?"PDF document":"Word document"}),e.jsx("a",{href:c,download:n,"aria-label":"Download document",title:"Download document",children:e.jsx(Va,{size:16,"aria-hidden":"true"})})]}),e.jsx("iframe",{src:c,title:`${t} preview`})]}):e.jsx("div",{className:"workspace-diff-code-empty",role:"status",children:"Loading document…"}):e.jsx("div",{className:"workspace-diff-code-empty",children:"Document preview unavailable."})}function xr(t){return/\.pdf$/i.test(t)?"application/pdf":/\.docx$/i.test(t)?"application/vnd.openxmlformats-officedocument.wordprocessingml.document":"application/msword"}const br=`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/WorkspaceMonacoEditor-frxie2_S.js","assets/index-Di1MU6Xr.js","assets/index-BojtIRzO.css","assets/WorkspaceMonacoEditor-BwKcXIZw.css"])))=>i.map(i=>d[i]);
2
+ import{j as e,r as l,_ as ka}from"./index-Di1MU6Xr.js";import{T as wa,F as ya,a as Sa,M as Na,d as Ca,i as Ks,h as Ra,j as $a,f as Gs,I as Fa}from"./MarkdownText-Drjq6-JM.js";import{_ as Et,o as ds,s as te,b as Ea,n as un,bL as Aa,e as ge,L as ot,aL as qs,aG as fn,be as Ae,W as z,c1 as At,bC as Pt,bA as Ue,aB as is,c2 as Pa,b7 as La,c3 as Da,b8 as _a,F as Ta,K as pn,y as Ma,X as Xs,v as za,b9 as Ia,aJ as Wa,aK as Ba,bZ as Oa,c4 as Ua,az as Zs,c5 as Ha,bp as Va,c6 as rs,c7 as Ka,c8 as ls,c9 as Ga,w as qa,Y as hn,V as Xa,ca as ts,cb as Za,cc as os,bJ as Re,cd as Qa,ce as Qs,cf as Ya,cg as Ja,ch as ei}from"./App-nzE7JU_O.js";import{t as ti,a as si,b as ni,m as ai,s as ii,d as ri,f as li,c as oi}from"./training-model-data-CKOkpBBL.js";import{F as Nt}from"./folder-open-B-DFLDFH.js";import{I as Ys}from"./info-BMxsR_bn.js";import{M as ci}from"./minimize-2-DwUgqXoR.js";import{S as di}from"./save-DJYUOhtD.js";import{C as ui}from"./clipboard-B-GnMVLp.js";const mn=Et(["local","sandbox"]),fi=Et(["pinned","saved_for_later"]),pi=ds({id:te().min(1),workspaceKind:mn,workspaceId:te().min(1),workspaceName:te().min(1),path:te().min(1),status:fi,order:un().int().nonnegative().nullable().default(null),sourceSessionId:te().min(1).nullable().default(null),available:Ea().default(!0),createdAt:te().min(1),updatedAt:te().min(1)});ds({items:Aa(pi)});ds({workspaceKind:mn,workspaceId:te().trim().min(1),workspaceName:te().trim().min(1),path:te().trim().min(1),status:Et(["pinned","saved_for_later","none"]),order:un().int().nonnegative().nullable().optional(),sourceSessionId:te().trim().min(1).nullable().optional()});Et(["pin","save_for_later","remove","list"]);function cs(t){let s=t.trim().replaceAll("\\","/");if(s=s.replace(/^(?:workspace|sandbox):file:/,""),s=s.replace(/^\/workspace\/app\//,""),s=s.replace(/^\.\//,""),!s||s.startsWith("/"))throw new Error("File path must be relative to the workspace.");const n=s.split("/").filter(a=>a&&a!==".");if(n.some(a=>a===".."))throw new Error("File path cannot leave the workspace.");if(n.length===0)throw new Error("File path is required.");return n.join("/")}function hi(t){return["sidebar-file",t.workspaceKind,encodeURIComponent(t.workspaceId),encodeURIComponent(cs(t.path))].join(":")}const mi=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],xi=ge("text-align-start",mi);const bi=[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]],gi=ge("chevrons-up",bi);const ji=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],vi=ge("columns-2",ji);const ki=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],wi=ge("eye-off",ki);const yi=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}]],Si=ge("panel-top",yi);const Ni=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],Ci=ge("plug",Ni);const Ri=[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]],$i=ge("redo-2",Ri);const Fi=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],Ei=ge("undo-2",Fi);function Ai({createRuntime:t,goalRuntime:s,subagentRuntime:n=null,onRunSubagentLifecycleAction:a}){const i=t?"Create/Improve Details":"Goal Details",u=t?Z(t.run.state):n?.activeCount?n.label:s?.actionLabel??"No active goal";return e.jsxs("div",{className:"goal-details-view","aria-label":i,children:[e.jsxs("div",{className:"goal-details-header",children:[e.jsxs("div",{className:"goal-details-title",children:[e.jsx(ot,{size:15,"aria-hidden":"true"}),e.jsx("span",{children:i})]}),e.jsx("span",{className:`goal-details-state ${Zi(t?.run.state??null)}`,children:u})]}),e.jsx("div",{className:"goal-details-body",children:t?e.jsx(Pi,{runtime:t}):s||n?e.jsx(Di,{goalRuntime:s,subagentRuntime:n,onRunSubagentLifecycleAction:a}):e.jsx(Xi,{})})]})}function Pi({runtime:t}){const s=t.run,n=s.plan,a=qs(n?.metadata)??qs(s.metadata),i=s.questions,u=i.filter(o=>o.status==="pending"),c=s.sourceRefs,d=s.checkRefs,p=s.state,x=s.target.kind==="agent"?s.target.defaultActionKey:null;return e.jsxs(e.Fragment,{children:[e.jsx(V,{title:"Current Work",children:e.jsx(rt,{rows:[["State",Z(p)],["Operation",s.operation],["Target",Z(s.target.kind)],["Name",s.target.displayName??s.target.id??"Pending"],["Target ID",s.target.id??"Pending"],["Default action",x??n?.defaultChatAction.key??"Pending"],["Adapter",Z(s.adapter.kind)],["Run",s.id],["Revision",String(s.revision)]]})}),e.jsx(V,{title:"Plan",children:n?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"goal-details-summary",children:n.summary}),e.jsx(rt,{rows:[["Objective",n.objective],["Context",n.capturedContextSummary],["Status",Z(n.status)],["Plan ID",n.id],["Run ID",n.runId],["Approval",n.approvalId??"Pending"],["Approved",n.approvedAt??"Not approved"]]})]}):u.length?e.jsx("p",{className:"goal-details-summary",children:"Waiting for answers before the model finalizes the Create plan."}):e.jsx("p",{className:"goal-details-summary",children:"The model is preparing the Create plan."})}),a?e.jsxs(V,{title:"Action Shape",children:[e.jsx(rt,{rows:[["Mode",a.label],["Default action",a.defaultActionKey??"None"],["Direct action",a.directActionHint??"None planned"],["Artifacts",a.artifactPolicy]]}),e.jsx("p",{className:"goal-details-note",children:a.detail})]}):null,i.length?e.jsx(V,{title:"Questions",children:e.jsx("div",{className:"goal-details-list",children:i.map(o=>e.jsxs("article",{className:"goal-details-list-item",children:[e.jsxs("div",{children:[e.jsx("strong",{children:o.title}),e.jsx("span",{className:`goal-details-inline-state ${o.status}`,children:Z(o.status)})]}),e.jsx("p",{children:o.prompt}),o.answer?e.jsxs("small",{children:["Answer: ",o.answer.label??o.answer.value]}):o.options.length?e.jsxs("small",{children:["Options: ",o.options.map(b=>b.label).join(", ")]}):null]},o.id))})}):null,n?.requirements.length?e.jsx(V,{title:"Setup Requirements",children:e.jsx("div",{className:"goal-details-list",children:n.requirements.map(o=>e.jsxs("article",{className:"goal-details-list-item",children:[e.jsxs("div",{children:[e.jsx("strong",{children:o.name}),e.jsx("span",{className:`goal-details-inline-state ${o.status}`,children:Z(o.status)})]}),e.jsxs("small",{children:[Z(o.kind),o.detail?`: ${o.detail}`:""]})]},`${o.kind}:${o.name}`))})}):null,n?.sourcePlan.length?e.jsx(V,{title:"Source Plan",children:e.jsx(St,{refs:n.sourcePlan.map(o=>({id:`${o.operation}:${o.path}`,primary:o.path,secondary:`${Z(o.operation)}: ${o.reason}`}))})}):null,n?.checks.length?e.jsx(V,{title:"Checks",children:e.jsx(St,{refs:n.checks.map(o=>({id:o.name,primary:o.name,secondary:`${o.required?"Required":"Optional"}: ${o.command}`}))})}):null,c.length||d.length?e.jsx(V,{title:"Run Refs",children:e.jsx(St,{refs:[...c.map(o=>({id:`source:${o}`,primary:o,secondary:"Source ref"})),...d.map(o=>({id:`check:${o}`,primary:o,secondary:"Check ref"}))]})}):null,e.jsx(Li,{run:s}),s.blockedReason?e.jsx(V,{title:"Blocked",children:e.jsxs("div",{className:"goal-details-alert",children:[e.jsx(fn,{size:15}),e.jsx("span",{children:s.blockedReason})]})}):null,e.jsx(V,{title:"Raw State",children:e.jsxs("details",{className:"goal-details-raw",children:[e.jsx("summary",{children:"Show structured payload"}),e.jsx("pre",{children:JSON.stringify(s,null,2)})]})})]})}function Li({run:t}){const s=[...t.context.attachments.map(i=>({id:`attachment:${i.id??i.name}`,primary:i.name,secondary:i.ref??i.mediaType??"Attachment"})),...t.context.apps.map(i=>({id:`app:${i.id}`,primary:i.name,secondary:i.required?"Required app context":"Optional app context"})),...t.context.tools.map(i=>({id:`tool:${i.name}`,primary:i.name,secondary:i.outputSummary??i.inputSummary??"Tool context"})),...t.context.targetRepoAssumptions.map(i=>({id:`target:${i}`,primary:i,secondary:"Target assumption"}))],n=t.workflowCapture,a=n?[...n.files.map(i=>({id:`workflow-file:${i}`,primary:i,secondary:"Captured file"})),...n.outputArtifacts.map(i=>({id:`workflow-artifact:${i}`,primary:i,secondary:"Output artifact"})),...n.traceRefs.map(i=>({id:`workflow-trace:${i}`,primary:i,secondary:"Trace"}))]:[];return!s.length&&!a.length?null:e.jsx(V,{title:"Context",children:e.jsx(St,{refs:[...s,...a]})})}function Di({goalRuntime:t,subagentRuntime:s,onRunSubagentLifecycleAction:n}){return e.jsxs(e.Fragment,{children:[t?e.jsxs(V,{title:"Goal",children:[e.jsx("p",{className:"goal-details-summary",children:t.objective}),e.jsx(rt,{rows:[["Status",t.actionLabel],["Runtime",t.timeLabel],["Detail",t.detail]]})]}):null,s?e.jsx(_i,{runtime:s,onRunSubagentLifecycleAction:n}):null,e.jsx(V,{title:"Raw State",children:e.jsxs("details",{className:"goal-details-raw",children:[e.jsx("summary",{children:"Show structured payload"}),e.jsx("pre",{children:JSON.stringify({goalRuntime:t,subagentRuntime:s},null,2)})]})})]})}function _i({runtime:t,onRunSubagentLifecycleAction:s}){const[n,a]=l.useState(null),[i,u]=l.useState(null);Ae(i);const c=async(d,p)=>{if(!s)return;const x=`${d}:${p}`;a(x),u(null);try{await s({runId:d,action:p})}catch(o){u(o instanceof Error?o.message:String(o))}finally{a(o=>o===x?null:o)}};return e.jsxs(e.Fragment,{children:[e.jsxs(V,{title:"Subagents",children:[e.jsx(rt,{rows:[["Latest update",Oi(t)],["Active",String(t.activeCount)],["Completed",String(t.completedCount)],["Failed",String(t.failedCount)],["Cancelled",String(t.cancelledCount)],["Paused",String(t.needsResumeCount)],["Terminal",String(t.terminalCount)],["Usage",Ui(t.usage.totalTokens,t.usage.requestCount)],["Evidence",String(t.evidenceRefs.length)],["Checks",String(t.testsRunCount)]]}),t.blockers.length>0?e.jsx("ul",{className:"goal-details-list compact",children:t.blockers.slice(0,4).map(d=>e.jsxs("li",{className:"goal-details-list-item",children:[e.jsx("span",{className:`goal-details-inline-state ${d.status}`,children:d.status}),e.jsxs("div",{children:[e.jsx("strong",{children:Ct(d.roleId)}),e.jsx("p",{children:d.message})]})]},`${d.runId}:${d.message}`))}):null,e.jsx("ul",{className:"goal-details-list",children:t.runs.slice(0,8).map(d=>e.jsxs("li",{className:"goal-details-list-item",children:[e.jsx("span",{className:`goal-details-inline-state ${d.status}`,children:d.status}),e.jsxs("div",{children:[e.jsx("strong",{children:Ct(d.roleId)}),e.jsx("p",{children:d.objective}),d.report?.summary?e.jsx("small",{children:d.report.summary}):null,s?e.jsx(Mi,{pendingAction:n,run:d,onRun:c}):null]})]},d.id))})]}),t.finalResults.length>0?e.jsx(Ti,{results:t.finalResults}):null]})}function Ti({results:t}){return e.jsx(V,{title:"Child Results",children:e.jsx("ol",{className:"goal-details-task-graph",children:t.slice(0,6).map(s=>e.jsxs("li",{className:"goal-details-task-node",children:[e.jsxs("div",{className:"goal-details-task-node-header",children:[e.jsx("span",{className:`goal-details-inline-state ${s.status}`,children:s.status}),e.jsxs("div",{children:[e.jsx("strong",{children:Ct(s.roleId)}),e.jsx("small",{children:s.objective})]})]}),e.jsx("p",{children:s.summary}),e.jsxs("div",{className:"goal-details-task-node-meta",children:[e.jsxs("span",{children:[s.refs.length," refs"]}),e.jsxs("span",{children:[s.testsRun.length+s.validationAttempts.length," checks"]}),e.jsxs("span",{children:[s.blockers.length," blockers"]}),e.jsx("span",{children:s.confidence?`${Z(s.confidence)} confidence`:"Confidence unknown"})]}),s.findings.length>0?e.jsxs("small",{children:["Findings: ",$e(s.findings,3)]}):null,s.changedFiles.length>0?e.jsxs("small",{children:["Files: ",$e(s.changedFiles,4)]}):null,s.testsRun.length>0?e.jsxs("small",{children:["Tests: ",$e(s.testsRun,3)]}):null,s.validationAttempts.length>0?e.jsxs("small",{children:["Validation: ",$e(s.validationAttempts,2)]}):null,s.refs.length>0?e.jsxs("small",{children:["Refs: ",$e(s.refs.map(Hi),4)]}):null,s.blockers.length>0?e.jsxs("small",{children:["Blockers: ",$e(s.blockers,3)]}):null,s.workspaceRetention?e.jsxs("small",{children:["Workspace: ",Ki(s.workspaceRetention)]}):null,s.importantMessages.length>0?e.jsxs("small",{children:["Messages: ",$e(s.importantMessages.map(Vi),2)]}):null]},s.runId))})})}function Mi({pendingAction:t,run:s,onRun:n}){const a=zi(s);return a.length===0?null:e.jsx("div",{className:"goal-details-actions",children:a.map(i=>{const u=`${s.id}:${i}`,c=t===u;return e.jsx("button",{type:"button",disabled:!!t,onClick:()=>{n(s.id,i)},children:c?"Working...":Ii(i)},i)})})}function zi(t){const s=[],n=Wi(t),a=Bi(t);return n&&s.push("cleanup"),a&&s.push("archive"),s}function Ii(t){return t==="cleanup"?"Clean":t==="archive"?"Archive":"Clean + archive"}function Wi(t){if(!xn(t))return!1;const s=lt(t.metadata);if(!s?.subagentWorkspace&&!s?.workspaceHandoff)return!1;const n=lt(s.lifecycleCleanup),a=lt(n?.workspaceCleanup),i=bn(a?.status);return i!=="removed"&&i!=="deleted"&&i!=="retained"&&i!=="skipped"}function Bi(t){if(!t.childSessionId||!xn(t))return!1;const s=lt(lt(t.metadata)?.childSessionArchive),n=bn(s?.status);return n!=="archived"&&n!=="already_archived"}function xn(t){return t.status==="completed"||t.status==="failed"||t.status==="cancelled"}function Oi(t){const s=t.latestMeaningfulUpdate;return s?`${Ct(s.roleId)} ${s.status}: ${s.message}`:"No structured update"}function Ui(t,s){if(t<=0&&s<=0)return"0 tokens";const n=`${s} ${s===1?"request":"requests"}`;return`${Gi(t)} tokens · ${n}`}function Ct(t){return t.slice(0,1).toUpperCase()+t.slice(1).replace(/[-_]+/g," ")}function Hi(t){return`${t.kind}: ${t.label}`}function Vi(t){return`${Z(t.kind)}: ${t.body}`}function Ki(t){const s=t.expiresAt?`until ${qi(t.expiresAt)}`:"for inspection",n=t.trigger?` · ${Z(t.trigger)}`:"";return`retained ${s}${n}`}function $e(t,s){const n=t.slice(0,s),a=t.length-n.length;return a>0?`${n.join(", ")} +${a}`:n.join(", ")}function Gi(t){if(t<1e3)return String(t);if(t>=1e6){const n=t/1e6;return`${Js(n,n<10?2:1)}M`}const s=t/1e3;return`${Js(s,s<10?1:0)}k`}function qi(t){const s=new Date(t);return Number.isNaN(s.getTime())?t:s.toLocaleString([],{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function Js(t,s){return t.toFixed(s).replace(/\.0+$/,"").replace(/(\.\d*?)0+$/,"$1")}function Xi(){return e.jsxs("div",{className:"goal-details-empty",children:[e.jsx(ot,{size:18}),e.jsx("span",{children:"No active Goal or Create workflow."})]})}function V({children:t,title:s}){return e.jsxs("section",{className:"goal-details-section",children:[e.jsx("h2",{children:s}),t]})}function rt({rows:t}){return e.jsx("dl",{className:"goal-details-grid",children:t.map(([s,n])=>e.jsxs("div",{children:[e.jsx("dt",{children:s}),e.jsx("dd",{children:n})]},s))})}function St({refs:t}){return e.jsx("ul",{className:"goal-details-ref-list",children:t.map(s=>e.jsxs("li",{children:[e.jsx("code",{title:s.primary,children:s.primary}),e.jsx("span",{children:s.secondary})]},s.id))})}function lt(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function bn(t){return typeof t=="string"&&t.trim()?t.trim():null}function Z(t){return t.split(/[_-]/g).filter(Boolean).map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join(" ")}function Zi(t){return t==="ready_local"||t==="published_hosted"?"success":t==="blocked"||t==="failed"||t==="cancelled"?"danger":t==="awaiting_questions"||t==="awaiting_plan_approval"?"warning":"active"}function Qi({sandboxId:t,connection:s}){const[n,a]=l.useState(null),[i,u]=l.useState([]),[c,d]=l.useState(null),[p,x]=l.useState(null),[o,b]=l.useState(null),[S,k]=l.useState(null);Ae(o,{prefix:"Sandbox"}),Ae(S,{prefix:"Sandbox integrations"});const N=n?.integrationLeases??[],F=l.useMemo(()=>i.filter(v=>v.status==="active"),[i]),T=l.useMemo(()=>Ji(n),[n]),I=l.useCallback(async()=>{if(!s){b("OpenPond App server is not connected.");return}if(!t){a(null),u([]),b(null);return}d("summary"),b(null);try{const v=await z.sandbox(s,t),$=await z.integrationConnections(s,en(v.sandbox));a(v.sandbox),u($.connections),k(null)}catch(v){b(v instanceof Error?v.message:String(v))}finally{d(null)}},[s,t]),K=l.useCallback(async()=>{if(!(!s||!n)){x("load"),k(null);try{const[v,$]=await Promise.all([z.integrationConnections(s,en(n)),z.sandboxIntegrationLeases(s,n.id)]);u(v.connections),a($.sandbox)}catch(v){k(v instanceof Error?v.message:String(v))}finally{x(null)}}},[s,n]),H=l.useCallback(async v=>{if(!s||!n)return;const $=At(v.provider),D=$?Pt($):null,M=D?.leasePolicy.allowedCapabilityIds??[];if(!$||!D?.leasePolicy.leaseable||M.length===0){k(`${re(v.provider)} cannot be attached to this sandbox.`);return}x(`attach:${v.id}`),k(null);try{const E=await z.attachSandboxIntegrationConnection(s,n.id,{connectionId:v.id,provider:v.provider,capabilities:M,...v.scopes.length>0?{scopes:v.scopes}:{},...D.leasePolicy.defaultTtlSeconds?{ttlSeconds:D.leasePolicy.defaultTtlSeconds}:{},required:!1});a(E.sandbox)}catch(E){k(E instanceof Error?E.message:String(E))}finally{x(null)}},[s,n]),W=l.useCallback(async v=>{if(!(!s||!n)){x(`remove:${v}`),k(null);try{const $=await z.removeSandboxIntegrationLease(s,n.id,v);a($.sandbox)}catch($){k($ instanceof Error?$.message:String($))}finally{x(null)}}},[s,n]);return l.useEffect(()=>{I()},[I]),t?e.jsxs("div",{className:"sandbox-summary-tab",children:[e.jsxs("section",{className:"sandbox-workspace-section",children:[e.jsxs("div",{className:"sandbox-workspace-heading",children:[e.jsx("h3",{children:"Sandbox"}),e.jsxs("div",{className:"sandbox-workspace-heading-actions",children:[n?e.jsx("span",{children:n.state}):null,e.jsx("button",{type:"button",className:"diff-icon-button",title:"Refresh summary","aria-label":"Refresh summary",disabled:c!==null,onClick:()=>{I()},children:c==="summary"?e.jsx(Ue,{className:"spinning",size:14}):e.jsx(is,{size:14})})]})]}),n?e.jsxs("dl",{className:"sandbox-workspace-kv",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Sandbox"}),e.jsx("dd",{children:tn(n.id)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Spend"}),e.jsxs("dd",{children:[ss(n.reservation.capturedUsd)," / ",ss(n.budget.maxUsd)]})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Reservation"}),e.jsx("dd",{children:n.reservation.status})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Idle cleanup"}),e.jsx("dd",{children:n.quotas?.idleTimeoutSeconds?`${Math.round(n.quotas.idleTimeoutSeconds/60)} min`:"-"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Updated"}),e.jsx("dd",{children:gn(n.updatedAt)})]}),T?e.jsxs("div",{children:[e.jsx("dt",{children:"Receipt"}),e.jsxs("dd",{children:[tn(T.id)," / ",ss(T.totalUsd)]})]}):null]}):e.jsxs("div",{className:"sandbox-workspace-loading",children:[c==="summary"?e.jsx(Ue,{className:"spinning",size:16}):null,e.jsx("span",{children:c==="summary"?"Loading sandbox":"Sandbox unavailable"})]})]}),e.jsxs("section",{className:"sandbox-workspace-section",children:[e.jsxs("div",{className:"sandbox-workspace-heading",children:[e.jsx("h3",{children:"Integrations"}),e.jsxs("div",{className:"sandbox-workspace-heading-actions",children:[e.jsx("span",{children:N.length}),e.jsx("button",{type:"button",className:"diff-icon-button",title:"Refresh integrations","aria-label":"Refresh integrations",disabled:p!==null||!n,onClick:()=>{K()},children:p==="load"?e.jsx(Ue,{className:"spinning",size:14}):e.jsx(is,{size:14})})]})]}),N.length>0?e.jsx("div",{className:"sandbox-workspace-integration-list",children:N.map(v=>e.jsxs("div",{className:"sandbox-workspace-integration-row",children:[e.jsxs("div",{className:"sandbox-workspace-integration-main",children:[e.jsx("span",{children:re(v.provider)}),e.jsxs("small",{children:[v.required?"required":"optional"," / ",sr(v)," / ",Yi(v)]})]}),e.jsx("button",{type:"button",className:"diff-icon-button",title:`Revoke ${re(v.provider)} lease`,"aria-label":`Revoke ${re(v.provider)} lease`,disabled:p!==null,onClick:()=>{W(v.leaseId)},children:p===`remove:${v.leaseId}`?e.jsx(Ue,{className:"spinning",size:14}):e.jsx(wa,{size:14})}),e.jsxs("div",{className:"sandbox-workspace-chip-row",children:[v.capabilities.slice(0,5).map($=>e.jsx("span",{children:tr(v.provider,$)},$)),v.capabilities.length>5?e.jsxs("span",{children:["+",v.capabilities.length-5]}):null]})]},v.leaseId))}):e.jsx("p",{className:"sandbox-workspace-empty",children:"No active integration leases."}),F.length>0?e.jsx("div",{className:"sandbox-workspace-integration-list",children:F.map(v=>{const $=N.some(E=>E.provider===v.provider),M=er(v)?.leasePolicy.allowedCapabilityIds.length??0;return e.jsxs("div",{className:"sandbox-workspace-integration-row compact",children:[e.jsxs("div",{className:"sandbox-workspace-integration-main",children:[e.jsx("span",{children:nr(v)}),e.jsx("small",{children:ar(v,M)})]}),e.jsx("button",{type:"button",className:"diff-icon-button",title:$?`${re(v.provider)} already attached`:`Attach ${re(v.provider)}`,"aria-label":$?`${re(v.provider)} already attached`:`Attach ${re(v.provider)}`,disabled:$||p!==null||M===0,onClick:()=>{H(v)},children:p===`attach:${v.id}`?e.jsx(Ue,{className:"spinning",size:14}):e.jsx(Ci,{size:14})})]},v.id)})}):e.jsx("p",{className:"sandbox-workspace-empty",children:"No connected accounts available."})]})]}):e.jsx("div",{className:"sandbox-summary-tab",children:e.jsx("p",{className:"sandbox-workspace-empty",children:"No sandbox is attached yet."})})}function en(t){return{status:"active"}}function Yi(t){return t.proxyUrl?"runtime proxy available":"metadata only, no runtime proxy"}function Ji(t){return t?.receipts?.at(-1)??null}function er(t){const s=At(t.provider);return s?Pt(s):null}function re(t){const s=At(t),n=s?Pt(s):null;return n?n.label:t==="microsoft_teams"?"Microsoft Teams":t?t.replace(/_/g," "):"Integration"}function tr(t,s){const n=At(t);return(n?Pt(n):null)?.capabilities.find(i=>i.id===s)?.label??s}function sr(t){return t.expiresAt?`expires ${gn(t.expiresAt)}`:"active"}function nr(t){const s=t.providerAccountName?.trim();return s?`${re(t.provider)} / ${s}`:re(t.provider)}function ar(t,s){const n=[];return t.providerWorkspaceName&&n.push(t.providerWorkspaceName),n.push(`${s} lease ${s===1?"capability":"capabilities"}`),t.scopes.length>0&&n.push(`${t.scopes.length} ${t.scopes.length===1?"scope":"scopes"}`),n.join(" / ")}function tn(t){return t.length>10?`${t.slice(0,8)}...`:t}function gn(t){if(!t)return"-";const s=new Date(t);return Number.isNaN(s.valueOf())?"-":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(s)}function ss(t){const s=Number(t??0);return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:s>=10?2:4}).format(Number.isFinite(s)?s:0)}function ir({summary:t}){const s=ti(t.taskset),n=t.taskset.learningSignals.demonstrations.filter(d=>d.approved).length,a=t.taskset.tasks.filter(d=>d.split==="frozen_eval").length,i=t.plan?.recipe.method==="sft"||t.plan?.recipe.method==="grpo"?t.plan.recipe:null,u=si(t.taskset,t.plan),c=t.job?ni(t.job.status,t.job.completedAt,t.job.updatedAt):null;return e.jsxs("div",{className:"training-sidebar-summary",children:[e.jsxs("header",{children:[e.jsx("h2",{children:ai(t.taskset.name)}),e.jsx("span",{children:t.job?ii(t.job.status):t.taskset.readiness?.ready?"Ready to train":"Needs review"})]}),e.jsxs("section",{children:[e.jsx("h3",{children:"Run"}),e.jsxs("dl",{children:[e.jsx(U,{label:"Primary recommendation",value:s.toUpperCase()}),e.jsx(U,{label:"Training stage",value:u}),e.jsx(U,{label:"Base model",value:i?.baseModel.id??"Not selected"}),e.jsx(U,{label:"Compute",value:t.plan?ri(t.plan.destinationId):"Not selected"}),e.jsx(U,{label:"Started",value:li(t.job?.startedAt??null)}),e.jsx(U,{label:"Duration",value:oi(t.job?.startedAt??null,c)})]})]}),e.jsxs("section",{children:[e.jsx("h3",{children:"Data"}),e.jsxs("dl",{children:[e.jsx(U,{label:"Training examples",value:String(n)}),e.jsx(U,{label:"Test examples",value:String(a)}),e.jsx(U,{label:"Dataset sources",value:String(t.taskset.sourceRefs.length)})]})]}),i?e.jsxs("section",{children:[e.jsx("h3",{children:"Recipe"}),e.jsxs("dl",{children:[i.method==="grpo"?e.jsx(U,{label:"RL loss",value:i.loss.method==="gspo-token"?"GSPO-token":i.loss.method.toUpperCase()}):null,e.jsx(U,{label:"LoRA rank",value:String(i.lora.rank)}),e.jsx(U,{label:"Learning rate",value:String(i.optimizer.learningRate)}),e.jsx(U,{label:"Optimizer steps",value:String(i.optimizer.maxSteps)}),e.jsx(U,{label:i.method==="grpo"?"Prompt length":"Sequence length",value:String(i.method==="grpo"?i.dataset.maxPromptTokens:i.dataset.maxSequenceLength)})]})]}):null,e.jsxs("section",{children:[e.jsx("h3",{children:"Result"}),e.jsxs("dl",{children:[e.jsx(U,{label:"Adapter",value:t.lineage?`${u} ready`:"Not created"}),e.jsx(U,{label:"Evaluation",value:t.lineage?.frozenEvaluationArtifactId?"Completed":"Not completed"}),e.jsx(U,{label:"Artifacts",value:String(t.artifacts.length)})]})]})]})}function U({label:t,value:s}){return e.jsxs("div",{children:[e.jsx("dt",{children:t}),e.jsx("dd",{children:s})]})}function rr(t){const s=sn("","","folder");for(const n of t){const a=n.endsWith("/"),i=n.split("/").filter(Boolean);if(i.length===0)continue;let u=s,c="";for(let d=0;d<i.length;d+=1){const p=i[d];c=c?`${c}/${p}`:p;const x=!a&&d===i.length-1?"file":"folder",o=`${x}:${p}`;let b=u.childMap.get(o);b||(b=sn(p,c,x),u.childMap.set(o,b),u.children.push(b)),u=b}}return jn(s.children)}function sn(t,s,n){return{name:t,path:s,type:n,children:[],childMap:new Map}}function jn(t){return t.sort((s,n)=>s.type!==n.type?s.type==="folder"?-1:1:s.name.localeCompare(n.name)).map(s=>({name:s.name,path:s.path,type:s.type,children:jn(s.children)}))}function us({className:t,currentStatus:s,onSetStatus:n}){const a=s==="pinned",i=s==="saved_for_later";return e.jsxs("span",{className:`workspace-file-bookmark-actions ${t??"workspace-file-heading-actions"}`,children:[e.jsx("button",{type:"button",className:a?"active":void 0,"data-tooltip":a?"Unpin file":"Pin file","aria-label":a?"Unpin file":"Pin file","aria-pressed":a,onClick:()=>n(a?"none":"pinned"),children:a?e.jsx(Pa,{size:14}):e.jsx(La,{size:14})}),e.jsx("button",{type:"button",className:i?"active":void 0,"data-tooltip":i?"Remove from Save for later":"Save file for later","aria-label":i?"Remove from Save for later":"Save file for later","aria-pressed":i,onClick:()=>n(i?"none":"saved_for_later"),children:i?e.jsx(Da,{size:14}):e.jsx(_a,{size:14})})]})}function lr({changedByPath:t,expandedFolderPaths:s,rootPath:n,repoFiles:a,selectedPath:i,getFileBookmarkStatus:u,onOpenFile:c,onSetFileBookmarkStatus:d,onToggleFolder:p}){const x=l.useMemo(()=>rr(a),[a]);return e.jsxs("div",{className:"workspace-file-tree-view",children:[e.jsxs("div",{className:"workspace-file-tree-header",children:[e.jsx(Nt,{size:14}),e.jsx("strong",{title:n??void 0,children:n?n.split("/").at(-1):"Files"}),e.jsx("span",{children:a.length})]}),e.jsx("div",{className:"workspace-file-tree",children:x.map(o=>e.jsx(vn,{changedByPath:t,expandedFolderPaths:s,node:o,rootPath:n,selectedPath:i,getFileBookmarkStatus:u,onOpenFile:c,onSetFileBookmarkStatus:d,onToggleFolder:p},`${o.type}:${o.path}`))})]})}function vn({changedByPath:t,depth:s=0,expandedFolderPaths:n,node:a,rootPath:i,selectedPath:u,getFileBookmarkStatus:c,onOpenFile:d,onSetFileBookmarkStatus:p,onToggleFolder:x}){const o=i?`${i}/${a.path}`:a.path,b=a.type==="folder"&&n.has(o),S=t.get(o),k=2+s*11;return a.type==="folder"?e.jsxs("div",{className:"workspace-file-tree-node",children:[e.jsxs("button",{type:"button",className:"workspace-file-tree-row folder","aria-expanded":b,style:{paddingLeft:k},onClick:()=>x(o),children:[b?e.jsx(Nt,{size:14}):e.jsx(Ta,{size:14}),e.jsx("span",{children:a.name})]}),b&&a.children.map(N=>e.jsx(vn,{changedByPath:t,depth:s+1,expandedFolderPaths:n,node:N,rootPath:i,selectedPath:u,getFileBookmarkStatus:c,onOpenFile:d,onSetFileBookmarkStatus:p,onToggleFolder:x},`${N.type}:${N.path}`))]}):e.jsxs("div",{className:`workspace-file-tree-row file ${S?"changed":""} ${u===o?"selected":""}`,style:{paddingLeft:k},children:[e.jsxs("button",{type:"button",className:"workspace-file-tree-row-main",title:o,onClick:()=>d(o),children:[e.jsx(ya,{size:13}),e.jsx("span",{children:a.name}),S&&e.jsxs("small",{children:[e.jsxs("span",{className:"diff-addition",children:["+",S.additions]}),e.jsxs("span",{className:"diff-deletion",children:["-",S.deletions]})]})]}),/\.html?$/i.test(o)&&e.jsx("button",{type:"button",className:"workspace-file-tree-bookmark-actions",title:"View source","aria-label":`View source for ${a.name}`,onClick:()=>d(o,{source:!0}),children:"</>"}),p?e.jsx(us,{className:"workspace-file-tree-bookmark-actions",currentStatus:c?.(o)??null,onSetStatus:N=>p(o,N)}):null]})}function nn({diff:t,expandedFolderPaths:s,rootPath:n,repoFiles:a,selectedPath:i,getFileBookmarkStatus:u,onOpenFile:c,onSetFileBookmarkStatus:d,onToggleFolder:p}){const x=t?.files??[],o=l.useMemo(()=>new Map(x.map(k=>[k.path,k])),[x]),b=n?.replace(/^\/+|\/+$/g,"")||null,S=l.useMemo(()=>{if(!b)return a;const k=`${b}/`;return a.filter(N=>N.startsWith(k)).map(N=>N.slice(k.length)).filter(Boolean)},[b,a]);return e.jsx("div",{className:"workspace-diff-files-view",children:e.jsx(lr,{changedByPath:o,expandedFolderPaths:s,rootPath:b,repoFiles:S,selectedPath:i,getFileBookmarkStatus:u,onOpenFile:c,onSetFileBookmarkStatus:d,onToggleFolder:p})})}function or({collapsed:t,editorControlsVisible:s,hideWhiteSpace:n,loadFullFiles:a,renderMarkdown:i,wordDiffs:u,wordWrap:c,onClose:d,onCopyGitApply:p,onRefresh:x,onToggleCollapsed:o,onToggleEditorControlsVisible:b,onToggleHideWhiteSpace:S,onToggleLoadFullFiles:k,onToggleRenderMarkdown:N,onToggleWordDiffs:F,onToggleWordWrap:T}){return e.jsxs("div",{className:"workspace-diff-options-menu",role:"menu",children:[e.jsx(ue,{icon:e.jsx(is,{size:14}),label:"Refresh",onClick:x,onClose:d}),e.jsx(ue,{checked:c,icon:e.jsx(Sa,{size:14}),label:"Enable word wrap",onClick:T,onClose:d}),e.jsx(ue,{checked:t,icon:e.jsx(gi,{size:14}),label:"Collapse all diffs",onClick:o,onClose:d}),e.jsx("div",{className:"workspace-diff-menu-divider"}),e.jsx(ue,{checked:s,icon:e.jsx(Si,{size:14}),label:"Show editor controls",onClick:b,onClose:d}),e.jsx(ue,{checked:i,icon:e.jsx(pn,{size:14}),label:"Render Markdown",onClick:N,onClose:d}),e.jsx(ue,{checked:!a,icon:e.jsx(ot,{size:14}),label:"Show diffs first",onClick:k,onClose:d}),e.jsx(ue,{checked:u,icon:e.jsx(xi,{size:14}),label:"Enable word diffs",onClick:F,onClose:d}),e.jsx(ue,{checked:n,icon:e.jsx(wi,{size:14}),label:"Hide white space",onClick:S,onClose:d}),e.jsx(ue,{icon:e.jsx(ui,{size:14}),label:"Copy git apply command",onClick:p,onClose:d})]})}function ue({checked:t,icon:s,label:n,onClick:a,onClose:i}){return e.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{a?.(),i()},children:[s,e.jsx("span",{children:n}),t&&e.jsx(Ma,{size:14})]})}function cr({addMenuOpen:t,expanded:s,filteredFiles:n,dirtyFilePaths:a,openFiles:i,goalDetailsAvailable:u,searchOpen:c,searchQuery:d,selectedPath:p,sideChatTabs:x=[],summaryAvailable:o,sourceStatus:b,sourceSwitcher:S,visibleTab:k,getFileBookmarkStatus:N,onCloseFileTab:F,onCloseSideChat:T,onCloseSearch:I,onOpenFile:K,onOpenBrowser:H,onOpenSearch:W,onOpenSideChat:v,onSearchQueryChange:$,onSetFileBookmarkStatus:D,onSelectFile:M,onSelectFiles:E,onSelectGoal:se,onSelectSummary:q,onSelectSideChat:X,onToggleAddMenu:B,onToggleExpanded:Q}){const ne=l.useRef(null);l.useEffect(()=>{if(!t&&!c)return;function w(){t&&B(),c&&I()}function O(_){ne.current?.contains(_.target)||w()}function P(_){_.key==="Escape"&&w()}return document.addEventListener("pointerdown",O),document.addEventListener("keydown",P),()=>{document.removeEventListener("pointerdown",O),document.removeEventListener("keydown",P)}},[t,I,B,c]);function Y(w){if(w.key==="Escape"){I();return}w.key==="Enter"&&n[0]&&K(n[0])}function oe(w){if(!["ArrowRight","ArrowLeft","Home","End"].includes(w.key))return;const O=w.target;if(!(O instanceof HTMLButtonElement)||O.getAttribute("role")!=="tab")return;const P=Array.from(w.currentTarget.querySelectorAll('button[role="tab"]')),_=P.indexOf(O);if(_<0||P.length===0)return;w.preventDefault();const Lt=Ha(_,P.length,w.key),Pe=P[Lt];if(!Pe)return;Pe.focus(),Pe.click();const ct=Pe.id;ct&&window.requestAnimationFrame(()=>document.getElementById(ct)?.focus())}return e.jsxs("div",{className:"workspace-diff-topbar",children:[e.jsxs("div",{className:"workspace-diff-tabs",role:"tablist","aria-label":"Right sidebar views",onKeyDown:oe,children:[u?e.jsxs("button",{type:"button",className:`workspace-diff-tab ${k==="goal"?"active":""}`,role:"tab","aria-selected":k==="goal",onClick:se,children:[e.jsx(ot,{size:14}),e.jsx("span",{children:"Goal"})]}):null,o&&q?e.jsxs("button",{type:"button",className:`workspace-diff-tab ${k==="summary"?"active":""}`,role:"tab","aria-selected":k==="summary",onClick:q,children:[e.jsx(Ys,{size:14}),e.jsx("span",{children:"Summary"})]}):null,e.jsxs("button",{type:"button",className:`workspace-diff-tab ${k==="files"?"active":""}`,role:"tab",id:"right-sidebar-files-tab","aria-controls":"right-sidebar-files-panel","aria-selected":k==="files",tabIndex:k==="files"?0:-1,onClick:E,children:[e.jsx(Nt,{size:14}),e.jsx("span",{children:"Files"})]}),i.map(w=>e.jsxs("div",{className:`workspace-diff-tab file ${k==="file"&&p===w.path?"active":""}`,children:[e.jsxs("button",{type:"button",className:"workspace-diff-tab-main",role:"tab","aria-selected":k==="file"&&p===w.path,title:w.path,onClick:()=>M(w.path),children:[e.jsx(ot,{className:"workspace-diff-tab-icon",size:13}),a.has(w.path)&&e.jsx("span",{className:"workspace-diff-tab-dirty","aria-hidden":"true"}),e.jsx("span",{children:w.path.split("/").pop()})]}),D?e.jsx(us,{className:"workspace-diff-tab-bookmark-actions",currentStatus:N?.(w.path)??null,onSetStatus:O=>D(w.path,O)}):null,e.jsx("button",{type:"button",className:"workspace-diff-tab-close",title:`Close ${w.path}`,onClick:O=>F(w.path,O),children:e.jsx(Xs,{size:12})})]},w.path)),x.map(w=>e.jsxs("div",{className:"workspace-diff-tab right-chat-tab",children:[e.jsxs("button",{type:"button",className:"workspace-diff-tab-main",role:"tab",id:`right-chat-tab-${w.id}`,"aria-controls":`right-chat-panel-${w.id}`,"aria-selected":!1,tabIndex:-1,title:w.title,onClick:()=>X?.(w.id),children:[w.running?e.jsx("span",{className:"right-chat-status-dot","aria-label":"Running"}):null,e.jsx("span",{children:w.title})]}),T?e.jsx("button",{type:"button",className:"workspace-diff-tab-close",title:`Close ${w.title}`,"aria-label":`Close ${w.title}`,onClick:O=>{O.stopPropagation(),T(w.id)},children:e.jsx(Xs,{size:12})}):null]},w.id)),e.jsxs("div",{className:"workspace-diff-add-anchor",ref:ne,children:[e.jsx("button",{type:"button",className:`workspace-diff-add-tab ${t||c?"active":""}`,title:"Add","aria-label":"Add to right sidebar",onClick:B,children:e.jsx(za,{size:15})}),t&&e.jsxs("div",{className:"workspace-diff-add-menu",role:"menu",children:[v?e.jsxs("button",{type:"button",role:"menuitem",onClick:v,children:[e.jsx(Ia,{size:14}),e.jsx("span",{children:"New task"}),e.jsx("kbd",{})]}):null,e.jsxs("button",{type:"button",role:"menuitem",onClick:E,children:[e.jsx(Nt,{size:14}),e.jsx("span",{children:"Files"}),e.jsx("kbd",{})]}),o&&q?e.jsxs("button",{type:"button",role:"menuitem",onClick:q,children:[e.jsx(Ys,{size:14}),e.jsx("span",{children:"Summary"}),e.jsx("kbd",{})]}):null,e.jsxs("button",{type:"button",role:"menuitem",onClick:W,children:[e.jsx(Wa,{size:14}),e.jsx("span",{children:"Open file"}),e.jsx("kbd",{children:"Ctrl+P"})]}),H?e.jsxs("button",{type:"button",role:"menuitem",onClick:H,children:[e.jsx(Ba,{size:14}),e.jsx("span",{children:"Browser"}),e.jsx("kbd",{children:"Ctrl+I"})]}):null]}),c&&e.jsxs("div",{className:"workspace-file-search-popover",children:[e.jsx("input",{autoFocus:!0,placeholder:"Search files",value:d,onChange:w=>$(w.target.value),onKeyDown:Y}),e.jsx("span",{children:"Files"}),e.jsx("div",{className:"workspace-file-search-results",children:n.length===0?e.jsx("small",{children:"Type to search for files"}):n.map(w=>e.jsx("button",{type:"button",onClick:()=>K(w),children:w},w))})]})]})]}),S||b?e.jsxs("div",{className:"workspace-diff-source-bar","aria-label":"Workspace source",children:[S?e.jsx("div",{className:"workspace-diff-source-toggle",role:"group","aria-label":"File source",children:S.options.map(w=>e.jsx("button",{type:"button",className:S.value===w.value?"active":"","aria-pressed":S.value===w.value,onClick:()=>S.onChange(w.value),children:w.label},w.value))}):null,b?e.jsx("span",{className:`workspace-diff-source-status ${b.tone}`,children:b.label}):null]}):null,e.jsx("button",{type:"button",className:"diff-icon-button",title:s?"Restore files panel":"Expand files panel","aria-label":s?"Restore files panel":"Expand files panel",onClick:Q,children:s?e.jsx(ci,{size:14}):e.jsx(Oa,{size:14})})]})}function dr({canCheckActiveFile:t,canSaveActiveFile:s,collapsed:n,editorControlsVisible:a,editorDiagnosticStatus:i,editorDiagnosticsChecking:u,hideWhiteSpace:c,loadFullFiles:d,menuOpen:p,renderMarkdown:x,showEditorCommandBar:o,showRenderMarkdownToggle:b,splitView:S,wordDiffs:k,wordWrap:N,onCopyGitApply:F,onEditorCheck:T,onEditorRedo:I,onEditorSave:K,onEditorUndo:H,onRefresh:W,onToggleCollapsed:v,onToggleEditorControlsVisible:$,onToggleHideWhiteSpace:D,onToggleLoadFullFiles:M,onToggleMenu:E,onToggleRenderMarkdown:se,onToggleSplitView:q,onToggleWordDiffs:X,onToggleWordWrap:B}){return e.jsx("div",{className:"workspace-diff-toolbar",children:e.jsxs("div",{className:"workspace-diff-toolbar-actions",children:[e.jsxs("div",{className:"workspace-diff-menu-anchor",children:[e.jsx("button",{type:"button",className:"diff-icon-button",title:"Diff options","aria-haspopup":"menu","aria-expanded":p,onClick:()=>E(),children:e.jsx(Ua,{size:15})}),p&&e.jsx(or,{collapsed:n,editorControlsVisible:a,hideWhiteSpace:c,loadFullFiles:d,renderMarkdown:x,wordDiffs:k,wordWrap:N,onClose:()=>E(!1),onCopyGitApply:F,onRefresh:W,onToggleCollapsed:v,onToggleEditorControlsVisible:$,onToggleHideWhiteSpace:D,onToggleLoadFullFiles:M,onToggleRenderMarkdown:se,onToggleWordDiffs:X,onToggleWordWrap:B})]}),o&&e.jsxs("div",{className:"workspace-editor-command-bar","aria-label":"Editor controls",children:[e.jsx("button",{type:"button",className:"diff-icon-button",title:"Save file","aria-label":"Save file",disabled:!s,onClick:K,children:e.jsx(di,{size:14})}),e.jsx("button",{type:"button",className:"diff-icon-button",title:"Undo","aria-label":"Undo",onClick:H,children:e.jsx(Ei,{size:14})}),e.jsx("button",{type:"button",className:"diff-icon-button",title:"Redo","aria-label":"Redo",onClick:I,children:e.jsx($i,{size:14})}),e.jsx("button",{type:"button",className:"diff-icon-button",title:"Check file","aria-label":"Check file",disabled:!t,onClick:T,children:u?e.jsx(Ue,{className:"spinning",size:14}):e.jsx(Zs,{size:14})}),i&&e.jsxs("span",{className:`workspace-editor-diagnostic-chip ${i.severity}`,children:[i.severity==="error"||i.severity==="warning"||i.severity==="unavailable"?e.jsx(fn,{size:13}):e.jsx(Zs,{size:13}),e.jsx("span",{children:i.label})]})]}),b&&e.jsx("button",{type:"button",className:`diff-icon-button ${x?"active":""}`,title:x?"Show Markdown source":"Render Markdown","aria-label":x?"Show Markdown source":"Render Markdown","aria-pressed":x,onClick:se,children:e.jsx(pn,{size:14})}),e.jsx("button",{type:"button",className:`diff-icon-button ${S?"active":""}`,title:S?"Show unified diff":"Show split diff","aria-label":S?"Show unified diff":"Show split diff","aria-pressed":S,onClick:q,children:e.jsx(vi,{size:14})})]})})}const ur={cjs:"typescript",css:"css",html:"html",js:"typescript",json:"json",jsx:"typescript",md:"markdown",mjs:"typescript",py:"python",sh:"shell",ts:"typescript",tsx:"typescript",yaml:"yaml",yml:"yaml"};function fs(t){const s=t.split("/").pop()?.toLowerCase()??"";if(s==="dockerfile")return"shell";if(s==="readme"||s==="readme.md")return"markdown";const n=s.includes(".")?s.split(".").pop()??"":"";return ur[n]??"text"}function fr(t,s){return t?s==="markdown"?pr(t):s==="json"?Ee(t,/("(?:\\.|[^"\\])*"(?=\s*:)|"(?:\\.|[^"\\])*"|[-]?\b\d+(?:\.\d+)?\b|\btrue\b|\bfalse\b|\bnull\b|[{}[\]:,])/g):s==="css"?Ee(t,/(\/\*.*?\*\/|#[\da-fA-F]{3,8}\b|--[\w-]+|[.#]?[\w-]+(?=\s*:)|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b\d+(?:\.\d+)?(?:px|rem|em|%|vh|vw)?\b|[{}():;,])/g):s==="html"?Ee(t,/(<!--.*?-->|<\/?[\w-]+|[\w:-]+(?==)|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|[<>/=])/g):s==="shell"?Ee(t,/(#.*$|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b(?:cd|cp|export|git|npm|pnpm|bun|yarn|rm|mkdir|test|if|then|fi|for|do|done|echo)\b|\$[\w_]+|&&|\|\||[|&;=])/g):s==="python"?Ee(t,/(#.*$|"""[\s\S]*?"""|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b(?:class|def|return|if|elif|else|for|while|try|except|finally|with|as|import|from|None|True|False|async|await|lambda|yield)\b|\b[A-Z][\w]*\b|\b\d+(?:\.\d+)?\b|[+\-*/%=<>!&|.:,()[\]{}]+)/g):Ee(t,/(\/\/.*$|\/\*.*?\*\/|`(?:\\.|[^`\\])*`|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b(?:abstract|as|async|await|boolean|break|case|catch|class|const|continue|default|else|enum|export|extends|false|finally|for|from|function|if|import|in|interface|let|new|null|number|of|return|string|switch|throw|true|try|type|undefined|void|while)\b|\b[A-Z][\w]*\b|\b\d+(?:\.\d+)?\b|[+\-*/%=<>!&|?:.,()[\]{}]+)/g):[{text:" ",kind:"plain"}]}function pr(t){return/^\s{0,3}#{1,6}\s/.test(t)?[{text:t,kind:"keyword"}]:/^\s*[-*+]\s/.test(t)?[{text:t,kind:"property"}]:Ee(t,/(`[^`]+`|\*\*[^*]+\*\*|\[[^\]]+\]\([^)]+\)|https?:\/\/\S+)/g)}function hr(t){return/^(\/\/|#|\/\*|<!--)/.test(t)?"comment":/^["'`]/.test(t)?"string":/^[-]?\d/.test(t)||/^#[\da-fA-F]{3,8}\b/.test(t)?"number":/^\b[A-Z]/.test(t)?"type":/^[.#]?[\w-]+$/.test(t)&&t.includes("-")?"property":/^(?:[{}()[\],.:;<>/=+\-*&|!?%]+)$/.test(t)?"operator":/^(?:--|\$)/.test(t)?"property":"keyword"}function Ee(t,s){const n=[];let a=0;for(const i of t.matchAll(s)){const u=i.index??0;u>a&&n.push({text:t.slice(a,u),kind:"plain"});const c=i[0];if(n.push({text:c,kind:hr(c)}),a=u+c.length,/^(\/\/|#|<!--)/.test(c))break}return a<t.length&&n.push({text:t.slice(a),kind:"plain"}),n.length>0?n:[{text:t,kind:"plain"}]}function Rt({language:t,text:s}){return e.jsx(e.Fragment,{children:fr(s,t).map((n,a)=>e.jsx("span",{className:`syntax-token ${n.kind}`,children:n.text},`${a}-${n.text}`))})}function mr({path:t,contentBase64:s}){const n=t.replace(/\\/g,"/").split("/").pop()||"document",a=l.useMemo(()=>{try{const d=atob(s.replace(/\s/g,"")),p=Uint8Array.from(d,x=>x.charCodeAt(0));return new Blob([p],{type:xr(t)})}catch{return null}},[s,t]),[i,u]=l.useState(null);l.useEffect(()=>{if(!a)return;const d=URL.createObjectURL(a);return u({blob:a,url:d}),()=>URL.revokeObjectURL(d)},[a]);const c=i?.blob===a?i.url:null;return a?c?e.jsxs("div",{className:"workspace-document-preview",children:[e.jsxs("div",{className:"workspace-document-preview-card",children:[e.jsx("strong",{children:n}),e.jsx("span",{children:/\.pdf$/i.test(t)?"PDF document":"Word document"}),e.jsx("a",{href:c,download:n,"aria-label":"Download document",title:"Download document",children:e.jsx(Va,{size:16,"aria-hidden":"true"})})]}),e.jsx("iframe",{src:c,title:`${t} preview`})]}):e.jsx("div",{className:"workspace-diff-code-empty",role:"status",children:"Loading document…"}):e.jsx("div",{className:"workspace-diff-code-empty",children:"Document preview unavailable."})}function xr(t){return/\.pdf$/i.test(t)?"application/pdf":/\.docx$/i.test(t)?"application/vnd.openxmlformats-officedocument.wordprocessingml.document":"application/msword"}const br=`
3
3
 
4
- [file truncated]`,gr=l.lazy(()=>ka(()=>import("./WorkspaceMonacoEditor-TrUDJMKb.js").then(t=>t.jc),__vite__mapDeps([0,1,2,3]))),ns=6,jr=18,Fe=22,an=44,vr=160,rn=12;function $t({path:t,workspaceName:s,workspaceRootPath:n,onSelectPath:a}){const i=ls(t,n),u=Ga(i),c=u?kr(i):s?.trim()||"Workspace",p=(u&&c!=="/"&&i.startsWith(`${c}/`)?i.slice(c.length+1):i).split("/").filter(Boolean),x=!!(a&&!u);return e.jsxs("span",{className:"workspace-file-breadcrumbs",title:u?i:`${c} > ${i}`,children:[a&&!u?e.jsx("button",{type:"button",onClick:()=>a(null),children:c}):e.jsx("span",{children:c}),p.map((o,b)=>{const S=b===p.length-1,k=p.slice(0,b+1).join("/");return e.jsxs("span",{className:"workspace-file-breadcrumb-segment",children:[e.jsx(qa,{size:13}),a&&x&&!S?e.jsx("button",{type:"button",onClick:()=>a(k),children:o}):e.jsx("span",{children:o})]},`${b}-${o}`)})]})}function kr(t){const s=/^[A-Za-z]:\//.exec(t);return s?s[0].slice(0,-1):"/"}function wr({collapsed:t=!1,diagnostics:s=[],draftContent:n,editable:a=!1,editorRef:i,error:u,file:c,hideWhiteSpace:d=!1,headerActions:p,imageSrc:x,loading:o,loadFullFiles:b,onOpenImage:S,onSelectBreadcrumbPath:k,onDraftContentChange:N,onLspAction:F,onSave:T,renderMarkdown:I,saveError:K,saving:H=!1,splitView:W=!1,wordDiffs:v=!1,wordWrap:$,workspaceName:D,workspaceRootPath:M}){Ae(u,{prefix:"File preview"}),Ae(K,{prefix:"Save failed"});const E=n??c.content??"",se=l.useMemo(()=>E.split(`
4
+ [file truncated]`,gr=l.lazy(()=>ka(()=>import("./WorkspaceMonacoEditor-frxie2_S.js").then(t=>t.jc),__vite__mapDeps([0,1,2,3]))),ns=6,jr=18,Fe=22,an=44,vr=160,rn=12;function $t({path:t,workspaceName:s,workspaceRootPath:n,onSelectPath:a}){const i=ls(t,n),u=Ga(i),c=u?kr(i):s?.trim()||"Workspace",p=(u&&c!=="/"&&i.startsWith(`${c}/`)?i.slice(c.length+1):i).split("/").filter(Boolean),x=!!(a&&!u);return e.jsxs("span",{className:"workspace-file-breadcrumbs",title:u?i:`${c} > ${i}`,children:[a&&!u?e.jsx("button",{type:"button",onClick:()=>a(null),children:c}):e.jsx("span",{children:c}),p.map((o,b)=>{const S=b===p.length-1,k=p.slice(0,b+1).join("/");return e.jsxs("span",{className:"workspace-file-breadcrumb-segment",children:[e.jsx(qa,{size:13}),a&&x&&!S?e.jsx("button",{type:"button",onClick:()=>a(k),children:o}):e.jsx("span",{children:o})]},`${b}-${o}`)})]})}function kr(t){const s=/^[A-Za-z]:\//.exec(t);return s?s[0].slice(0,-1):"/"}function wr({collapsed:t=!1,diagnostics:s=[],draftContent:n,editable:a=!1,editorRef:i,error:u,file:c,hideWhiteSpace:d=!1,headerActions:p,imageSrc:x,loading:o,loadFullFiles:b,onOpenImage:S,onSelectBreadcrumbPath:k,onDraftContentChange:N,onLspAction:F,onSave:T,renderMarkdown:I,saveError:K,saving:H=!1,splitView:W=!1,wordDiffs:v=!1,wordWrap:$,workspaceName:D,workspaceRootPath:M}){Ae(u,{prefix:"File preview"}),Ae(K,{prefix:"Save failed"});const E=n??c.content??"",se=l.useMemo(()=>E.split(`
5
5
  `).slice(0,800),[E]),q=fs(c.path),X=n!=null||c.content!=null,B=E.endsWith(br),Q=I&&X&&rs(c.path),ne=X&&Ka(c.path)&&Nr(E);return x?e.jsxs("div",{className:"workspace-file-preview",children:[e.jsxs("div",{className:"workspace-diff-file-heading",children:[e.jsxs("div",{children:[e.jsx($t,{path:c.path,workspaceName:D,workspaceRootPath:M,onSelectPath:k}),e.jsxs("span",{className:"diff-addition",children:["+",c.additions]}),e.jsxs("span",{className:"diff-deletion",children:["-",c.deletions]})]}),p]}),e.jsx("div",{className:"workspace-file-image-stage",children:e.jsx("button",{type:"button",className:"workspace-file-image-button","aria-label":`Open image preview for ${c.path}`,onClick:S,children:e.jsx("img",{alt:c.path,decoding:"async",src:x})})})]}):!b&&c.patch||!X&&c.patch?W?e.jsx(Sr,{collapsed:t,file:c,hideWhiteSpace:d,onSelectBreadcrumbPath:k,wordDiffs:v,wordWrap:$,headerActions:p,workspaceName:D,workspaceRootPath:M}):e.jsx(yr,{collapsed:t,file:c,hideWhiteSpace:d,wordWrap:$,workspaceName:D,workspaceRootPath:M,onSelectBreadcrumbPath:k,headerActions:p}):e.jsxs("div",{className:`workspace-file-preview ${$?"wrap":""}`,children:[e.jsxs("div",{className:"workspace-diff-file-heading",children:[e.jsxs("div",{children:[e.jsx($t,{path:c.path,workspaceName:D,workspaceRootPath:M,onSelectPath:k}),e.jsxs("span",{className:"diff-addition",children:["+",c.additions]}),e.jsxs("span",{className:"diff-deletion",children:["-",c.deletions]})]}),e.jsxs("span",{className:"workspace-file-heading-end",children:[H?e.jsx("span",{className:"workspace-file-save-state",children:"Saving"}):null,p]})]}),X?Q?e.jsx("div",{className:"workspace-markdown-preview",children:e.jsx(Na,{content:E})}):ne?e.jsx(mr,{path:c.path,contentBase64:E}):a&&!B?e.jsx(l.Suspense,{fallback:e.jsx("div",{className:"workspace-diff-code-empty",children:"Loading editor"}),children:e.jsx(gr,{diagnostics:s,filePath:c.path,onChange:Y=>N?.(Y),onLspAction:F,onSave:()=>T?.(),ref:i,value:E,wordWrap:$})}):e.jsx("div",{className:"workspace-file-code",children:se.map((Y,oe)=>e.jsxs("div",{className:"workspace-file-code-row",children:[e.jsx("span",{children:oe+1}),e.jsx("code",{children:e.jsx(Rt,{language:q,text:Y||" "})})]},`${oe}-${Y}`))}):e.jsx("div",{className:"workspace-diff-code-empty",children:o?"Loading file content":"No file content available."})]})}function yr({collapsed:t=!1,file:s,hideWhiteSpace:n=!1,wordWrap:a,workspaceName:i,workspaceRootPath:u,onSelectBreadcrumbPath:c,headerActions:d}){const p=l.useMemo(()=>wn(s.patch,n),[s.patch,n]),x=fs(s.path);return e.jsxs("div",{className:`workspace-diff-preview ${a?"wrap":""}`,children:[e.jsxs("div",{className:"workspace-diff-file-heading",children:[e.jsxs("div",{children:[e.jsx($t,{path:s.path,workspaceName:i??null,workspaceRootPath:u,onSelectPath:c}),e.jsxs("span",{className:"diff-addition",children:["+",s.additions]}),e.jsxs("span",{className:"diff-deletion",children:["-",s.deletions]})]}),d]}),t?e.jsx("div",{className:"workspace-diff-code-empty",children:"Diff collapsed"}):e.jsx(kn,{ariaLabel:`${s.path} diff`,className:"workspace-diff-code",emptyMessage:"No patch available.",rows:p,renderRow:(o,b)=>o.kind==="spacer"?e.jsx("div",{className:"workspace-diff-spacer",role:"row",children:o.label},`${o.label}-${b}`):e.jsxs("div",{className:`workspace-diff-code-row ${o.kind}`,role:"row",children:[e.jsx("span",{className:"workspace-diff-line-number",role:"cell",children:o.newLine||o.oldLine}),e.jsx("code",{role:"cell",children:e.jsx(Rt,{language:x,text:o.newContent||o.oldContent||" "})})]},`${o.oldLine}-${o.newLine}-${b}`),wordWrap:a})]})}function Sr({collapsed:t,file:s,hideWhiteSpace:n,wordDiffs:a,wordWrap:i,workspaceName:u,workspaceRootPath:c,onSelectBreadcrumbPath:d,headerActions:p}){const x=l.useMemo(()=>wn(s.patch,n),[s.patch,n]),o=fs(s.path);return e.jsxs("div",{className:`workspace-diff-preview split ${i?"wrap":""} ${a?"word-diffs":""}`,children:[e.jsxs("div",{className:"workspace-diff-file-heading",children:[e.jsxs("div",{children:[e.jsx($t,{path:s.path,workspaceName:u,workspaceRootPath:c,onSelectPath:d}),e.jsxs("span",{className:"diff-addition",children:["+",s.additions]}),e.jsxs("span",{className:"diff-deletion",children:["-",s.deletions]})]}),e.jsxs("span",{className:"workspace-file-heading-end",children:[p,e.jsx(Ca,{size:14})]})]}),t?e.jsx("div",{className:"workspace-diff-code-empty",children:"Diff collapsed"}):e.jsx(kn,{ariaLabel:`${s.path} split diff`,className:"workspace-split-code",emptyMessage:"No patch available.",rows:x,renderRow:(b,S)=>b.kind==="spacer"?e.jsx("div",{className:"workspace-diff-spacer split",role:"row",children:b.label},`${b.label}-${S}`):e.jsxs("div",{className:`workspace-split-row ${b.kind}`,role:"row",children:[e.jsx("span",{className:"workspace-diff-line-number old",role:"cell",children:b.oldLine}),e.jsx("code",{className:"old",role:"cell",children:e.jsx(Rt,{language:o,text:b.oldContent||" "})}),e.jsx("span",{className:"workspace-diff-line-number new",role:"cell",children:b.newLine}),e.jsx("code",{className:"new",role:"cell",children:e.jsx(Rt,{language:o,text:b.newContent||" "})})]},`${b.oldLine}-${b.newLine}-${S}`),wordWrap:i})]})}function Nr(t){return t.length>0&&/^[A-Za-z0-9+/=\s]+$/.test(t)}function kn({ariaLabel:t,className:s,emptyMessage:n,rows:a,renderRow:i,wordWrap:u}){const c=!u&&a.length>vr,{endIndex:d,offsetTop:p,scrollRef:x,startIndex:o,totalHeight:b}=Cr(a.length,c);return a.length===0?e.jsx("div",{className:s,role:"table","aria-label":t,children:e.jsx("div",{className:"workspace-diff-code-empty",children:n})}):c?e.jsx("div",{className:`${s} virtualized`,ref:x,role:"table","aria-label":t,"aria-rowcount":a.length,children:e.jsx("div",{className:"workspace-diff-virtual-spacer",style:{height:b},children:e.jsx("div",{className:"workspace-diff-virtual-window",style:{transform:`translateY(${p}px)`},children:a.slice(o,d).map((S,k)=>i(S,o+k))})})}):e.jsx("div",{className:s,role:"table","aria-label":t,children:a.map(i)})}function Cr(t,s){const n=l.useRef(null),[a,i]=l.useState({height:Fe*an,scrollTop:0}),u=l.useCallback(()=>{const x=n.current;x&&i({height:x.clientHeight||Fe*an,scrollTop:x.scrollTop})},[]);if(l.useEffect(()=>{if(!s)return;const x=n.current;if(!x)return;u();let o=0;const b=()=>{if(typeof window>"u"){u();return}window.cancelAnimationFrame(o),o=window.requestAnimationFrame(u)};x.addEventListener("scroll",b,{passive:!0});const S=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>b());return S?.observe(x),()=>{x.removeEventListener("scroll",b),S?.disconnect(),typeof window<"u"&&window.cancelAnimationFrame(o)}},[s,u]),!s)return{endIndex:t,offsetTop:0,scrollRef:n,startIndex:0,totalHeight:t*Fe};const c=Math.ceil(a.height/Fe),d=Math.max(0,Math.floor(a.scrollTop/Fe)-rn);return{endIndex:Math.min(t,d+c+rn*2),offsetTop:d*Fe,scrollRef:n,startIndex:d,totalHeight:t*Fe}}function wn(t,s){if(!t.trim())return[];const n=[];let a=0,i=0,u=null,c=null,d=!1,p=[];function x(){n.push(...Rr(p)),p=[]}function o(){d&&(x(),u=a,c=i,d=!1)}for(const b of t.split(`
6
6
  `)){const S=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(b);if(S){o();const F=Number(S[1]),T=Number(S[2]);if(u!==null&&c!==null){const I=Math.max(F-u,T-c,0);I>0&&n.push({kind:"spacer",label:yn(I)})}a=F,i=T,d=!0;continue}if(b.startsWith("diff --git")||b.startsWith("index ")||b.startsWith("--- ")||b.startsWith("+++ ")||!d||b.startsWith("\\ No newline"))continue;const k=b.slice(1)||" ";if(s&&!k.trim())continue;if(b.startsWith("+")){x(),n.push({kind:"addition",oldLine:"",newLine:String(i||""),oldContent:"",newContent:k}),i+=1;continue}if(b.startsWith("-")){x(),n.push({kind:"deletion",oldLine:String(a||""),newLine:"",oldContent:k,newContent:""}),a+=1;continue}const N=b.startsWith(" ")?b.slice(1)||" ":b||" ";s&&!N.trim()||(p.push({kind:"context",oldLine:String(a||""),newLine:String(i||""),oldContent:N,newContent:N}),a+=1,i+=1)}return o(),n}function Rr(t){if(t.length<jr)return t;const s=t.length-ns*2;return s<=0?t:[...t.slice(0,ns),{kind:"spacer",label:yn(s)},...t.slice(-ns)]}function yn(t){return`${t} unmodified ${t===1?"line":"lines"}`}const Ft=`
7
7
 
@@ -1,4 +1,4 @@
1
- import{r as q,j as r}from"./index-DEg0S7Qk.js";import{bL as le,s as L,o as ee,bM as bn,bN as Qe,n as Be,_ as rn,bO as We,b as en,e as ji,X as Ut,bP as sn,aP as Ai,bw as Ci,aB as An,a3 as Ni,az as at,a1 as wi,bQ as _i,bp as Ii,be as Ei,bR as Ri,bS as ot,W as xe,bl as Pi,aD as Ti,U as Oi,aA as Cn,C as Li,aJ as ki,y as Mi}from"./App-pcwmC4IR.js";import{I as qi}from"./info-5bL9xSSf.js";import{M as Fi}from"./monitor-B5hx_tzp.js";import{P as cn}from"./play-pmSO95Qg.js";import{G as Di}from"./git-commit-horizontal-BIS-8MuS.js";import{S as Ui}from"./square-DT_uFOml.js";import{U as lt}from"./upload-PVi8vC3T.js";const Ee={custom:"custom"};function $i(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var be={},pn={},Ve={},st;function dn(){if(st)return Ve;st=1;function n(s){return typeof s>"u"||s===null}function i(s){return typeof s=="object"&&s!==null}function o(s){return Array.isArray(s)?s:n(s)?[]:[s]}function h(s,f){if(f){const g=Object.keys(f);for(let p=0,l=g.length;p<l;p+=1){const w=g[p];s[w]=f[w]}}return s}function c(s,f){let g="";for(let p=0;p<f;p+=1)g+=s;return g}function u(s){return s===0&&Number.NEGATIVE_INFINITY===1/s}return Ve.isNothing=n,Ve.isObject=i,Ve.toArray=o,Ve.repeat=c,Ve.isNegativeZero=u,Ve.extend=h,Ve}var Nn,ct;function mn(){if(ct)return Nn;ct=1;function n(o,h){let c="";const u=o.reason||"(unknown reason)";return o.mark?(o.mark.name&&(c+='in "'+o.mark.name+'" '),c+="("+(o.mark.line+1)+":"+(o.mark.column+1)+")",!h&&o.mark.snippet&&(c+=`
1
+ import{r as q,j as r}from"./index-Di1MU6Xr.js";import{bL as le,s as L,o as ee,bM as bn,bN as Qe,n as Be,_ as rn,bO as We,b as en,e as ji,X as Ut,bP as sn,aP as Ai,bw as Ci,aB as An,a3 as Ni,az as at,a1 as wi,bQ as _i,bp as Ii,be as Ei,bR as Ri,bS as ot,W as xe,bl as Pi,aD as Ti,U as Oi,aA as Cn,C as Li,aJ as ki,y as Mi}from"./App-nzE7JU_O.js";import{I as qi}from"./info-BMxsR_bn.js";import{M as Fi}from"./monitor-Ihu5LVYx.js";import{P as cn}from"./play-D_YGCdxU.js";import{G as Di}from"./git-commit-horizontal-DCTzcivA.js";import{S as Ui}from"./square-DXtoCBNw.js";import{U as lt}from"./upload-fCP3_OEO.js";const Ee={custom:"custom"};function $i(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var be={},pn={},Ve={},st;function dn(){if(st)return Ve;st=1;function n(s){return typeof s>"u"||s===null}function i(s){return typeof s=="object"&&s!==null}function o(s){return Array.isArray(s)?s:n(s)?[]:[s]}function h(s,f){if(f){const g=Object.keys(f);for(let p=0,l=g.length;p<l;p+=1){const w=g[p];s[w]=f[w]}}return s}function c(s,f){let g="";for(let p=0;p<f;p+=1)g+=s;return g}function u(s){return s===0&&Number.NEGATIVE_INFINITY===1/s}return Ve.isNothing=n,Ve.isObject=i,Ve.toArray=o,Ve.repeat=c,Ve.isNegativeZero=u,Ve.extend=h,Ve}var Nn,ct;function mn(){if(ct)return Nn;ct=1;function n(o,h){let c="";const u=o.reason||"(unknown reason)";return o.mark?(o.mark.name&&(c+='in "'+o.mark.name+'" '),c+="("+(o.mark.line+1)+":"+(o.mark.column+1)+")",!h&&o.mark.snippet&&(c+=`
2
2
 
3
3
  `+o.mark.snippet),u+" "+c):u}function i(o,h){Error.call(this),this.name="YAMLException",this.reason=o,this.mark=h,this.message=n(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i.prototype.toString=function(h){return this.name+": "+n(this,h)},Nn=i,Nn}var wn,ut;function Bi(){if(ut)return wn;ut=1;const n=dn();function i(c,u,s,f,g){let p="",l="";const w=Math.floor(g/2)-1;return f-u>w&&(p=" ... ",u=f-w+p.length),s-f>w&&(l=" ...",s=f+w-l.length),{str:p+c.slice(u,s).replace(/\t/g,"→")+l,pos:f-u+p.length}}function o(c,u){return n.repeat(" ",u-c.length)+c}function h(c,u){if(u=Object.create(u||null),!c.buffer)return null;u.maxLength||(u.maxLength=79),typeof u.indent!="number"&&(u.indent=1),typeof u.linesBefore!="number"&&(u.linesBefore=3),typeof u.linesAfter!="number"&&(u.linesAfter=2);const s=/\r?\n|\r|\0/g,f=[0],g=[];let p,l=-1;for(;p=s.exec(c.buffer);)g.push(p.index),f.push(p.index+p[0].length),c.position<=p.index&&l<0&&(l=f.length-2);l<0&&(l=f.length-1);let w="";const P=Math.min(c.line+u.linesAfter,g.length).toString().length,U=u.maxLength-(u.indent+P+3);for(let D=1;D<=u.linesBefore&&!(l-D<0);D++){const Y=i(c.buffer,f[l-D],g[l-D],c.position-(f[l]-f[l-D]),U);w=n.repeat(" ",u.indent)+o((c.line-D+1).toString(),P)+" | "+Y.str+`
4
4
  `+w}const J=i(c.buffer,f[l],g[l],c.position,U);w+=n.repeat(" ",u.indent)+o((c.line+1).toString(),P)+" | "+J.str+`
@@ -1 +1 @@
1
- import{j as e}from"./index-DEg0S7Qk.js";/* empty css */import{C as z}from"./cloud-upload-Bw9XUsKQ.js";import{aA as j,a3 as _,X as D}from"./App-pcwmC4IR.js";import{G as h}from"./git-commit-horizontal-BIS-8MuS.js";import{U as B}from"./upload-PVi8vC3T.js";function E({open:s,branch:l,filesChanged:i,additions:c,deletions:n,message:m,includeUnstaged:g,nextStep:a,draft:p,busy:t,canPush:u,canPublish:b,onMessageChange:f,onIncludeUnstagedChange:C,onNextStepChange:r,onDraftChange:N,onClose:v,onSubmit:k}){return s?e.jsx("div",{className:"git-dialog-backdrop",role:"presentation",children:e.jsxs("form",{className:"git-dialog commit-dialog","aria-label":"Commit changes",onSubmit:o=>{o.preventDefault(),k()},children:[e.jsx(x,{disabled:t,onClose:v}),e.jsx("div",{className:"git-dialog-icon",children:e.jsx(h,{size:18})}),e.jsx("h2",{children:"Commit your changes"}),e.jsxs("div",{className:"git-dialog-row",children:[e.jsx("span",{children:"Branch"}),e.jsxs("strong",{children:[e.jsx(j,{size:14}),l??"No branch"]})]}),e.jsxs("div",{className:"git-dialog-row",children:[e.jsx("span",{children:"Changes"}),e.jsxs("strong",{children:[i," ",i===1?"file":"files",e.jsxs("span",{className:"git-dialog-additions",children:["+",c]}),e.jsxs("span",{className:"git-dialog-deletions",children:["-",n]})]})]}),e.jsxs("label",{className:"git-dialog-toggle",children:[e.jsx("input",{checked:g,disabled:t,type:"checkbox",onChange:o=>C(o.target.checked)}),e.jsx("span",{}),"Include unstaged"]}),e.jsxs("label",{className:"git-dialog-field",children:[e.jsxs("span",{children:["Commit message",e.jsx("small",{children:"Leave blank to use an autogenerated message"})]}),e.jsx("textarea",{value:m,disabled:t,placeholder:"Update workspace",onChange:o=>f(o.target.value)})]}),e.jsxs("fieldset",{className:"git-dialog-next",children:[e.jsx("legend",{children:"Next steps"}),e.jsx(d,{active:a==="commit",icon:e.jsx(h,{size:14}),label:"Commit",disabled:t,onSelect:()=>r("commit")}),e.jsx(d,{active:a==="commit_push",icon:e.jsx(B,{size:14}),label:"Commit & push",disabled:t||!u,onSelect:()=>r("commit_push")}),b&&e.jsx(d,{active:a==="commit_publish",icon:e.jsx(z,{size:14}),label:"Commit & publish",disabled:t,onSelect:()=>r("commit_publish")}),e.jsx(d,{active:a==="commit_pr",icon:e.jsx(_,{size:14}),label:"Commit & create PR",disabled:!0,onSelect:()=>r("commit_pr")})]}),e.jsxs("div",{className:"git-dialog-footer",children:[e.jsxs("label",{className:"git-dialog-toggle draft-toggle",children:[e.jsx("input",{checked:p,disabled:t||a!=="commit_pr",type:"checkbox",onChange:o=>N(o.target.checked)}),e.jsx("span",{}),"Draft"]}),e.jsx("button",{className:"git-dialog-primary",disabled:t||i===0,type:"submit",children:"Continue"})]})]})}):null}function F({open:s,branchName:l,busy:i,onBranchNameChange:c,onSetPrefix:n,onClose:m,onSubmit:g}){return s?e.jsx("div",{className:"git-dialog-backdrop",role:"presentation",children:e.jsxs("form",{className:"git-dialog branch-dialog","aria-label":"Create branch",onSubmit:a=>{a.preventDefault(),g()},children:[e.jsx(x,{disabled:i,onClose:m}),e.jsx("div",{className:"git-dialog-icon",children:e.jsx(j,{size:18})}),e.jsx("h2",{children:"Work here"}),e.jsx("p",{children:"Create a branch to commit changes, push, and create a PR from this worktree."}),e.jsxs("label",{className:"git-dialog-field",children:[e.jsxs("span",{children:["Branch name",e.jsx("button",{className:"git-dialog-inline-action",disabled:i,type:"button",onClick:n,children:"Set prefix"})]}),e.jsx("input",{autoFocus:!0,disabled:i,value:l,onChange:a=>c(a.target.value)})]}),e.jsx("button",{className:"git-dialog-primary full",disabled:i||!l.trim(),type:"submit",children:"Create"})]})}):null}function d({active:s,icon:l,label:i,disabled:c,onSelect:n}){return e.jsxs("button",{"aria-pressed":s,className:s?"active":"",disabled:c,type:"button",onClick:n,children:[l,e.jsx("span",{children:i}),s&&e.jsx("span",{className:"git-dialog-check",children:"✓"})]})}function x({disabled:s,onClose:l}){return e.jsx("button",{className:"git-dialog-close",disabled:s,type:"button",onClick:l,children:e.jsx(D,{size:16})})}export{F as BranchDialog,E as CommitDialog};
1
+ import{j as e}from"./index-Di1MU6Xr.js";/* empty css */import{C as z}from"./cloud-upload-DpaGFZ9J.js";import{aA as j,a3 as _,X as D}from"./App-nzE7JU_O.js";import{G as h}from"./git-commit-horizontal-DCTzcivA.js";import{U as B}from"./upload-fCP3_OEO.js";function E({open:s,branch:l,filesChanged:i,additions:c,deletions:n,message:m,includeUnstaged:g,nextStep:a,draft:p,busy:t,canPush:u,canPublish:b,onMessageChange:f,onIncludeUnstagedChange:C,onNextStepChange:r,onDraftChange:N,onClose:v,onSubmit:k}){return s?e.jsx("div",{className:"git-dialog-backdrop",role:"presentation",children:e.jsxs("form",{className:"git-dialog commit-dialog","aria-label":"Commit changes",onSubmit:o=>{o.preventDefault(),k()},children:[e.jsx(x,{disabled:t,onClose:v}),e.jsx("div",{className:"git-dialog-icon",children:e.jsx(h,{size:18})}),e.jsx("h2",{children:"Commit your changes"}),e.jsxs("div",{className:"git-dialog-row",children:[e.jsx("span",{children:"Branch"}),e.jsxs("strong",{children:[e.jsx(j,{size:14}),l??"No branch"]})]}),e.jsxs("div",{className:"git-dialog-row",children:[e.jsx("span",{children:"Changes"}),e.jsxs("strong",{children:[i," ",i===1?"file":"files",e.jsxs("span",{className:"git-dialog-additions",children:["+",c]}),e.jsxs("span",{className:"git-dialog-deletions",children:["-",n]})]})]}),e.jsxs("label",{className:"git-dialog-toggle",children:[e.jsx("input",{checked:g,disabled:t,type:"checkbox",onChange:o=>C(o.target.checked)}),e.jsx("span",{}),"Include unstaged"]}),e.jsxs("label",{className:"git-dialog-field",children:[e.jsxs("span",{children:["Commit message",e.jsx("small",{children:"Leave blank to use an autogenerated message"})]}),e.jsx("textarea",{value:m,disabled:t,placeholder:"Update workspace",onChange:o=>f(o.target.value)})]}),e.jsxs("fieldset",{className:"git-dialog-next",children:[e.jsx("legend",{children:"Next steps"}),e.jsx(d,{active:a==="commit",icon:e.jsx(h,{size:14}),label:"Commit",disabled:t,onSelect:()=>r("commit")}),e.jsx(d,{active:a==="commit_push",icon:e.jsx(B,{size:14}),label:"Commit & push",disabled:t||!u,onSelect:()=>r("commit_push")}),b&&e.jsx(d,{active:a==="commit_publish",icon:e.jsx(z,{size:14}),label:"Commit & publish",disabled:t,onSelect:()=>r("commit_publish")}),e.jsx(d,{active:a==="commit_pr",icon:e.jsx(_,{size:14}),label:"Commit & create PR",disabled:!0,onSelect:()=>r("commit_pr")})]}),e.jsxs("div",{className:"git-dialog-footer",children:[e.jsxs("label",{className:"git-dialog-toggle draft-toggle",children:[e.jsx("input",{checked:p,disabled:t||a!=="commit_pr",type:"checkbox",onChange:o=>N(o.target.checked)}),e.jsx("span",{}),"Draft"]}),e.jsx("button",{className:"git-dialog-primary",disabled:t||i===0,type:"submit",children:"Continue"})]})]})}):null}function F({open:s,branchName:l,busy:i,onBranchNameChange:c,onSetPrefix:n,onClose:m,onSubmit:g}){return s?e.jsx("div",{className:"git-dialog-backdrop",role:"presentation",children:e.jsxs("form",{className:"git-dialog branch-dialog","aria-label":"Create branch",onSubmit:a=>{a.preventDefault(),g()},children:[e.jsx(x,{disabled:i,onClose:m}),e.jsx("div",{className:"git-dialog-icon",children:e.jsx(j,{size:18})}),e.jsx("h2",{children:"Work here"}),e.jsx("p",{children:"Create a branch to commit changes, push, and create a PR from this worktree."}),e.jsxs("label",{className:"git-dialog-field",children:[e.jsxs("span",{children:["Branch name",e.jsx("button",{className:"git-dialog-inline-action",disabled:i,type:"button",onClick:n,children:"Set prefix"})]}),e.jsx("input",{autoFocus:!0,disabled:i,value:l,onChange:a=>c(a.target.value)})]}),e.jsx("button",{className:"git-dialog-primary full",disabled:i||!l.trim(),type:"submit",children:"Create"})]})}):null}function d({active:s,icon:l,label:i,disabled:c,onSelect:n}){return e.jsxs("button",{"aria-pressed":s,className:s?"active":"",disabled:c,type:"button",onClick:n,children:[l,e.jsx("span",{children:i}),s&&e.jsx("span",{className:"git-dialog-check",children:"✓"})]})}function x({disabled:s,onClose:l}){return e.jsx("button",{className:"git-dialog-close",disabled:s,type:"button",onClick:l,children:e.jsx(D,{size:16})})}export{F as BranchDialog,E as CommitDialog};