openpond 0.2.62 → 0.2.63

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 (496) hide show
  1. package/README.md +2 -0
  2. package/dist/app-server.d.ts +1053 -63
  3. package/dist/app-server.js +1 -1
  4. package/dist/chunks/{acp-DYRBDJRU.js → acp-H3MJCPHX.js} +1 -1
  5. package/dist/chunks/{acp-agent-UTLP7C3I.js → acp-agent-DWA7272M.js} +1 -1
  6. package/dist/chunks/actions-command-IIYOO4LL.js +2 -0
  7. package/dist/chunks/{app-layer-N2H3RBEN.js → app-layer-K7H2WJ56.js} +1 -1
  8. package/dist/chunks/app-server-connected-apps-RM5E2VWF.js +2 -0
  9. package/dist/chunks/app-server-evaluations-XGMGS67X.js +2 -0
  10. package/dist/chunks/app-server-harness-services-BHD6S5II.js +2 -0
  11. package/dist/chunks/app-server-runtime-LFIL6F7D.js +2 -0
  12. package/dist/chunks/apps-QKAHJGQ4.js +2 -0
  13. package/dist/chunks/chunk-25XXZS3E.js +2 -0
  14. package/dist/chunks/chunk-27JGS3KB.js +12 -0
  15. package/dist/chunks/{chunk-7JBB4PXS.js → chunk-2HAWOMZK.js} +1 -1
  16. package/dist/chunks/chunk-2LJCJOJ7.js +2 -0
  17. package/dist/chunks/{chunk-CN5OXQ7A.js → chunk-3YXYBYWK.js} +1 -1
  18. package/dist/chunks/{chunk-GEKORCMN.js → chunk-42V4NV2F.js} +1 -1
  19. package/dist/chunks/{chunk-VAJSRUAB.js → chunk-4FNCBA3Y.js} +1 -1
  20. package/dist/chunks/{chunk-F7D4BMTO.js → chunk-4L6DU6Z2.js} +1 -1
  21. package/dist/chunks/{chunk-SZKFNKWO.js → chunk-4SZ3HKHU.js} +1 -1
  22. package/dist/chunks/chunk-5EP2DZLJ.js +2 -0
  23. package/dist/chunks/chunk-5FU5RLML.js +2 -0
  24. package/dist/chunks/{chunk-6SH4B7DV.js → chunk-5MHYGMJG.js} +1 -1
  25. package/dist/chunks/{chunk-MEK7DLX3.js → chunk-6EBCS57F.js} +1 -1
  26. package/dist/chunks/chunk-6RS4NAOY.js +2 -0
  27. package/dist/chunks/{chunk-NVHZRKXB.js → chunk-7HRLWPPZ.js} +1 -1
  28. package/dist/chunks/chunk-7O6Z3VOZ.js +2 -0
  29. package/dist/chunks/{chunk-P74RR2GB.js → chunk-7WYL2IDD.js} +1 -1
  30. package/dist/chunks/chunk-7YLXGILH.js +2 -0
  31. package/dist/chunks/chunk-7ZLXFKRI.js +2 -0
  32. package/dist/chunks/{chunk-NWOK6NLE.js → chunk-AH26AQN7.js} +1 -1
  33. package/dist/chunks/chunk-AHOBCBVZ.js +2 -0
  34. package/dist/chunks/chunk-B5R53U74.js +2 -0
  35. package/dist/chunks/{chunk-NKZNPTLA.js → chunk-BPZOABMC.js} +1 -1
  36. package/dist/chunks/{chunk-2IIBCCOK.js → chunk-BSPFY3Y5.js} +1 -1
  37. package/dist/chunks/{chunk-5OSM75X5.js → chunk-BU27SLZP.js} +2 -2
  38. package/dist/chunks/chunk-C2AXMKK4.js +2 -0
  39. package/dist/chunks/{chunk-AMO5DVKM.js → chunk-C2LAEGOW.js} +2 -2
  40. package/dist/chunks/{chunk-GNCEZ3UP.js → chunk-CZ5R4JXZ.js} +1 -1
  41. package/dist/chunks/{chunk-JIFUGA3U.js → chunk-DABBHWSF.js} +1 -1
  42. package/dist/chunks/{chunk-VK4TPZTA.js → chunk-DLANLLKH.js} +1 -1
  43. package/dist/chunks/{chunk-WGLVSGFA.js → chunk-DQI5TE6A.js} +2 -2
  44. package/dist/chunks/chunk-DTTFUANI.js +12 -0
  45. package/dist/chunks/{chunk-4TM75R7V.js → chunk-DUL6DXOI.js} +1 -1
  46. package/dist/chunks/{chunk-TGEGXTPR.js → chunk-ELX7VRSU.js} +1 -1
  47. package/dist/chunks/chunk-ERL2M773.js +3 -0
  48. package/dist/chunks/{chunk-4PZWGNX4.js → chunk-ERT32RZA.js} +4 -4
  49. package/dist/chunks/{chunk-RTJCELRR.js → chunk-EZRUWIP6.js} +1 -1
  50. package/dist/chunks/{chunk-LJDBR3RN.js → chunk-F6UQ6PPK.js} +1 -1
  51. package/dist/chunks/chunk-F7QTIHXX.js +2 -0
  52. package/dist/chunks/chunk-FAKDGLZQ.js +8 -0
  53. package/dist/chunks/{chunk-FFWOTZQM.js → chunk-FVRII5XO.js} +1 -1
  54. package/dist/chunks/{chunk-C7M2WBWZ.js → chunk-FYYYECHE.js} +51 -49
  55. package/dist/chunks/chunk-G32BO6M5.js +4 -0
  56. package/dist/chunks/{chunk-NBE74GLF.js → chunk-G6OR5NB6.js} +1 -1
  57. package/dist/chunks/{chunk-GQGLPKU4.js → chunk-GGJUWIGR.js} +1 -1
  58. package/dist/chunks/{chunk-VSQXDS6H.js → chunk-GPL2Z65R.js} +1 -1
  59. package/dist/chunks/{chunk-INO67SEN.js → chunk-GS6ZUSIN.js} +2 -2
  60. package/dist/chunks/{chunk-47AXSBPV.js → chunk-GVARQXYI.js} +1 -1
  61. package/dist/chunks/chunk-GXCUH2VV.js +17 -0
  62. package/dist/chunks/{chunk-OCC43RSJ.js → chunk-GXZCMO6S.js} +1 -1
  63. package/dist/chunks/{chunk-CLFYRN46.js → chunk-H6C4MAUN.js} +1 -1
  64. package/dist/chunks/{chunk-HBLN4OLY.js → chunk-HUCBKXTU.js} +1 -1
  65. package/dist/chunks/{chunk-M5IX6VUA.js → chunk-IHB5GTOJ.js} +2 -2
  66. package/dist/chunks/{chunk-J3B2GM4A.js → chunk-IWWXIUAQ.js} +1 -1
  67. package/dist/chunks/chunk-J572ANHX.js +13 -0
  68. package/dist/chunks/{chunk-AKZPMKWP.js → chunk-J7ZTPXRQ.js} +1 -1
  69. package/dist/chunks/{chunk-CJUVHE4U.js → chunk-JORRZ4BB.js} +1 -1
  70. package/dist/chunks/chunk-JSQRLLN6.js +2 -0
  71. package/dist/chunks/chunk-KCOTDUGW.js +2 -0
  72. package/dist/chunks/{chunk-NK4JKB7C.js → chunk-KHTAAVC2.js} +1 -1
  73. package/dist/chunks/{chunk-LRRBYIGH.js → chunk-LK2K3SPM.js} +2 -2
  74. package/dist/chunks/{chunk-557XSPVS.js → chunk-LKKMLBOH.js} +1 -1
  75. package/dist/chunks/{chunk-U456UP3N.js → chunk-LSZJ5M3X.js} +1 -1
  76. package/dist/chunks/chunk-M3FLEZ4E.js +4 -0
  77. package/dist/chunks/{chunk-Y2KPHVZK.js → chunk-M3SCON53.js} +1 -1
  78. package/dist/chunks/{chunk-VPDG2V2R.js → chunk-MEGKXGW3.js} +1 -1
  79. package/dist/chunks/chunk-MPNJ2BB4.js +2 -0
  80. package/dist/chunks/{chunk-4RZBGKT7.js → chunk-N33D7KCW.js} +1 -1
  81. package/dist/chunks/chunk-N42HT64M.js +2 -0
  82. package/dist/chunks/{chunk-SD64CLJX.js → chunk-N4VHLJBZ.js} +1 -1
  83. package/dist/chunks/chunk-NEJLJ2XY.js +2 -0
  84. package/dist/chunks/chunk-NG2L6D7G.js +2 -0
  85. package/dist/chunks/{chunk-GV3LFSMI.js → chunk-NLYZ5K7U.js} +1 -1
  86. package/dist/chunks/{chunk-F4TJ7WQV.js → chunk-NT7N6KLE.js} +1 -1
  87. package/dist/chunks/{chunk-PAE3PQEC.js → chunk-NZTCH6K5.js} +1 -1
  88. package/dist/chunks/{chunk-BEI4YULC.js → chunk-OG33QAG6.js} +1 -1
  89. package/dist/chunks/chunk-OTUBJV6C.js +6 -0
  90. package/dist/chunks/{chunk-RH43WLBX.js → chunk-PBTXLQAU.js} +1 -1
  91. package/dist/chunks/{chunk-3R4MSE2S.js → chunk-QJ6KUVAR.js} +1 -1
  92. package/dist/chunks/{chunk-7JXZNCBC.js → chunk-QU4UE73E.js} +1 -1
  93. package/dist/chunks/{chunk-WQMXEZVE.js → chunk-R6VJDOQM.js} +3 -3
  94. package/dist/chunks/{chunk-FUSCTBJI.js → chunk-R6WMY6AH.js} +1 -1
  95. package/dist/chunks/{chunk-EIX2V2KU.js → chunk-RDSVU6F6.js} +1 -1
  96. package/dist/chunks/{chunk-R4PDSOB4.js → chunk-RFMME46Z.js} +1 -1
  97. package/dist/chunks/{chunk-GW5SE3FM.js → chunk-RZUCVF2Q.js} +1 -1
  98. package/dist/chunks/{chunk-UC3FXTDL.js → chunk-SFKZITAG.js} +5 -5
  99. package/dist/chunks/{chunk-5A6ER3M2.js → chunk-SHJY5RLU.js} +1 -1
  100. package/dist/chunks/chunk-SI5W5LBV.js +2 -0
  101. package/dist/chunks/chunk-SO42ZB5K.js +2 -0
  102. package/dist/chunks/{chunk-2UDAKLJ4.js → chunk-TCOTXCV6.js} +1 -1
  103. package/dist/chunks/{chunk-QCSLEMZF.js → chunk-U2K7QJCG.js} +1 -1
  104. package/dist/chunks/{chunk-ISIXFK6U.js → chunk-UH4JSSRL.js} +28 -28
  105. package/dist/chunks/{chunk-X4ZT22SG.js → chunk-UPWJSNL5.js} +1 -1
  106. package/dist/chunks/chunk-URNMC46H.js +157 -0
  107. package/dist/chunks/{chunk-NLQ2UPN2.js → chunk-V7KR74NO.js} +1 -1
  108. package/dist/chunks/{chunk-HXZXDDKW.js → chunk-VHXDWAEH.js} +1 -1
  109. package/dist/chunks/{chunk-NE4ESZPT.js → chunk-W2TICQ62.js} +1 -1
  110. package/dist/chunks/chunk-WP2L2NY2.js +2 -0
  111. package/dist/chunks/chunk-WSOUMXH3.js +24 -0
  112. package/dist/chunks/chunk-WWQNMC7C.js +6 -0
  113. package/dist/chunks/chunk-XMHIQ3SK.js +5 -0
  114. package/dist/chunks/{chunk-5MTN6KXV.js → chunk-XNOMIWEY.js} +1 -1
  115. package/dist/chunks/{chunk-ZXT7V64X.js → chunk-XOB6FKQV.js} +1 -1
  116. package/dist/chunks/chunk-Y766IN7Y.js +2 -0
  117. package/dist/chunks/chunk-YCZZ62C2.js +2 -0
  118. package/dist/chunks/chunk-YM4PSVFW.js +4 -0
  119. package/dist/chunks/chunk-YNQWJWIC.js +10 -0
  120. package/dist/chunks/{chunk-GSWBNJGZ.js → chunk-Z3BWCFLV.js} +1 -1
  121. package/dist/chunks/{chunk-GOIKLFXK.js → chunk-ZG6353RM.js} +1 -1
  122. package/dist/chunks/{chunk-T6C5BNXK.js → chunk-ZPTKR3GB.js} +1 -1
  123. package/dist/chunks/{chunk-MNXNZDDW.js → chunk-ZYVHOVKL.js} +1 -1
  124. package/dist/chunks/chunk-ZZHXQCNB.js +22 -0
  125. package/dist/chunks/cli-PSXMIJTF.js +2 -0
  126. package/dist/chunks/{configuration-command-BU2RPG33.js → configuration-command-XYKMXIWF.js} +1 -1
  127. package/dist/chunks/connected-app-executor-6G2LA3PQ.js +2 -0
  128. package/dist/chunks/connected-evidence-IRXYN6YD.js +2 -0
  129. package/dist/chunks/{connected-starting-assets-V5QXRK5Q.js → connected-starting-assets-JONPTII6.js} +1 -1
  130. package/dist/chunks/{continual-FLW6DAJK.js → continual-Z7MO2PF6.js} +1 -1
  131. package/dist/chunks/core-commands-WWN7X3XC.js +2 -0
  132. package/dist/chunks/dataset-preparation-authoring-F3OZIQSP.js +4 -0
  133. package/dist/chunks/datasets-2PC2HP7N.js +2 -0
  134. package/dist/chunks/desktop-test-VU6AFAMO.js +3 -0
  135. package/dist/chunks/dist-47AYOIH6.js +2 -0
  136. package/dist/chunks/{dist-DCSLPBO2.js → dist-MXBEBM4D.js} +1 -1
  137. package/dist/chunks/evaluation-coordination-UOWZHHC5.js +2 -0
  138. package/dist/chunks/experiment-improvements-EB2CV5RA.js +2 -0
  139. package/dist/chunks/experiments-SZQYR6MH.js +2 -0
  140. package/dist/chunks/experiments-signal-2KJCP25D.js +2 -0
  141. package/dist/chunks/{help-PXUUREHZ.js → help-7HXFWIKS.js} +1 -1
  142. package/dist/chunks/host-profile-evaluation-tools-Y2LQ4WQN.js +2 -0
  143. package/dist/chunks/host-profile-external-dataset-FRIGXOO7.js +2 -0
  144. package/dist/chunks/hosted-app-server-composition-PGKQNDW6.js +2 -0
  145. package/dist/chunks/hosted-experiment-improvement-UXC542SZ.js +3 -0
  146. package/dist/chunks/hosted-harness-runtime-6PEI7F2U.js +2 -0
  147. package/dist/chunks/hosted-profile-candidate-HM44BIUX.js +3 -0
  148. package/dist/chunks/hosted-profile-compiler-UAZ4PHYE.js +2 -0
  149. package/dist/chunks/hosted-profile-evaluation-control-EUL57FAB.js +2 -0
  150. package/dist/chunks/hosted-profile-evaluation-inspection-7USY75Z4.js +3 -0
  151. package/dist/chunks/hosted-profile-evaluation-preparation-2LSMZQNA.js +3 -0
  152. package/dist/chunks/{hosted-tasksets-X2YCFYEJ.js → hosted-tasksets-WGXGXJ7E.js} +1 -1
  153. package/dist/chunks/human-review-M26UKGJL.js +2 -0
  154. package/dist/chunks/{import-JWZSZCE4.js → import-6SI4BEKS.js} +2 -2
  155. package/dist/chunks/learning-HM3NWOV5.js +2 -0
  156. package/dist/chunks/local-harness-improvement-runtime-QGWFWNSR.js +2 -0
  157. package/dist/chunks/local-harness-taskset-review-KS4WPMN6.js +2 -0
  158. package/dist/chunks/model-projects-YUAMBQTO.js +2 -0
  159. package/dist/chunks/opchat-AG4CWVY4.js +3 -0
  160. package/dist/chunks/opchat-bounded-chat-IQMP5IIO.js +2 -0
  161. package/dist/chunks/organizations-KDKX77XZ.js +2 -0
  162. package/dist/chunks/{profile-ELE2D7HU.js → profile-O5HL5DTQ.js} +1 -1
  163. package/dist/chunks/project-action-payload-QA24HYGF.js +2 -0
  164. package/dist/chunks/project-agent-XBOOM5TS.js +2 -0
  165. package/dist/chunks/published-experiment-source-GZGN354O.js +2 -0
  166. package/dist/chunks/refiner-profile-service-BJMOYKTC.js +2 -0
  167. package/dist/chunks/{runtime-776NUSE7.js → runtime-XBA744HJ.js} +2 -2
  168. package/dist/chunks/sandbox-command-5ECGS7DG.js +2 -0
  169. package/dist/chunks/{sandbox-template-WP6YCGBK.js → sandbox-template-27U3FQN7.js} +1 -1
  170. package/dist/chunks/saved-work-KUNVTJ7O.js +2 -0
  171. package/dist/chunks/{send-turn-RPB65PME.js → send-turn-FIPWOXWV.js} +1 -1
  172. package/dist/chunks/src-BLWX6DRG.js +424 -0
  173. package/dist/chunks/{src-2R4CMCJ5.js → src-PU7QTFO5.js} +1 -1
  174. package/dist/chunks/standalone-experiment-turn-owner-XIE46VNH.js +2 -0
  175. package/dist/chunks/store-chat-resources-YOEJ2BI6.js +2 -0
  176. package/dist/chunks/{store-continual-support-reviews-R62D2HD6.js → store-continual-support-reviews-FOMYYS25.js} +1 -1
  177. package/dist/chunks/{store-conversation-serving-25O7BAR2.js → store-conversation-serving-K324SQTO.js} +1 -1
  178. package/dist/chunks/{store-create-improve-T5E2GUKK.js → store-create-improve-3LQMIYAP.js} +1 -1
  179. package/dist/chunks/{store-datasets-5Y4U5L3R.js → store-datasets-3KSX7RSO.js} +1 -1
  180. package/dist/chunks/store-evaluation-results-LHCCNNE6.js +7 -0
  181. package/dist/chunks/{store-harness-evaluation-review-settings-I2R3HPO3.js → store-harness-evaluation-review-settings-AAN7KKJ5.js} +1 -1
  182. package/dist/chunks/{store-harness-refinement-candidates-SUT45FQX.js → store-harness-refinement-candidates-3PHL3BUY.js} +1 -1
  183. package/dist/chunks/store-harness-workspaces-ZHNCNWVI.js +2 -0
  184. package/dist/chunks/store-human-review-QJY3ZPPF.js +7 -0
  185. package/dist/chunks/store-learned-preference-migration-validation-X32SRBOM.js +2 -0
  186. package/dist/chunks/{store-learning-MFS4DGQR.js → store-learning-DW3QLQXU.js} +1 -1
  187. package/dist/chunks/{store-learning-credentials-BECWEG2Y.js → store-learning-credentials-67QNTPA7.js} +1 -1
  188. package/dist/chunks/{store-local-experiments-LOH4F4TF.js → store-local-experiments-QTVHJAEP.js} +1 -1
  189. package/dist/chunks/store-model-batch-review-PBYQZJJJ.js +2 -0
  190. package/dist/chunks/store-model-configuration-3SU73CMS.js +3 -0
  191. package/dist/chunks/store-model-project-preparation-TFCG2F2F.js +2 -0
  192. package/dist/chunks/store-ponder-history-WDLMXBIJ.js +2 -0
  193. package/dist/chunks/store-ponder-hosted-DX6E2BVW.js +4 -0
  194. package/dist/chunks/{store-preference-comparison-RNIFLJRW.js → store-preference-comparison-DWV5XSMY.js} +1 -1
  195. package/dist/chunks/{store-schedules-DVQ2PP4F.js → store-schedules-2KUY4T6M.js} +1 -1
  196. package/dist/chunks/{store-sidebar-file-bookmarks-LXWFFYCZ.js → store-sidebar-file-bookmarks-A4XCS7RM.js} +1 -1
  197. package/dist/chunks/{store-sidebar-preferences-4HH7LX6N.js → store-sidebar-preferences-V2PKRXUZ.js} +1 -1
  198. package/dist/chunks/{store-subagents-JLW4GD4Q.js → store-subagents-UGVEFA6M.js} +1 -1
  199. package/dist/chunks/store-task-inbox-QABI4ZAH.js +33 -0
  200. package/dist/chunks/{store-task-inventory-NJXRXFLC.js → store-task-inventory-GEQIZELY.js} +1 -1
  201. package/dist/chunks/store-taskset-drafts-GXABQR5G.js +9 -0
  202. package/dist/chunks/{store-training-VRLU6NFX.js → store-training-CQV7PL3V.js} +1 -1
  203. package/dist/chunks/{store-training-jobs-3ZHG4LGI.js → store-training-jobs-XKN6K66J.js} +18 -10
  204. package/dist/chunks/{store-training-models-KWQD5PRP.js → store-training-models-Q7DTTR4S.js} +1 -1
  205. package/dist/chunks/{store-usage-ZRS3ILF2.js → store-usage-XGAX7NLB.js} +1 -1
  206. package/dist/chunks/{taskset-QDMCQQDJ.js → taskset-ARKJQKYQ.js} +1 -1
  207. package/dist/chunks/taskset-packages-X4K65DTW.js +2 -0
  208. package/dist/chunks/taskset-packages-XK7FSD45.js +2 -0
  209. package/dist/chunks/{teams-bot-GF272RGC.js → teams-bot-UTQAJA6H.js} +1 -1
  210. package/dist/chunks/training-3IWW4256.js +2 -0
  211. package/dist/chunks/{training-DF5UEPY3.js → training-RVIESURJ.js} +1 -1
  212. package/dist/chunks/training-error-2EWDOQ4G.js +2 -0
  213. package/dist/chunks/training-hosted-PFJHYTEU.js +2 -0
  214. package/dist/chunks/training-hosted-checkpoint-evaluation-JJPP7KFW.js +2 -0
  215. package/dist/chunks/training-hosted-feedback-5B2KJGOT.js +2 -0
  216. package/dist/chunks/training-hosted-learning-Y7NHRY4V.js +2 -0
  217. package/dist/chunks/training-hosted-report-UVGTPDOK.js +2 -0
  218. package/dist/chunks/training-hosted-serving-report-OX4A5OKB.js +2 -0
  219. package/dist/chunks/training-hosted-workers-LST4ZUXN.js +2 -0
  220. package/dist/chunks/training-model-start-ROLS3E4V.js +2 -0
  221. package/dist/chunks/{web-search-5RUXYIOF.js → web-search-7FBUBZ66.js} +1 -1
  222. package/dist/chunks/{workspaces-JRY2IE7H.js → workspaces-G3CMY7ZA.js} +1 -1
  223. package/dist/cli.js +1 -1
  224. package/dist/index.js +1 -1
  225. package/dist/sandbox/url.d.ts +3 -1
  226. package/dist/skills/LICENSE +21 -0
  227. package/dist/skills/manifest.json +168 -0
  228. package/dist/skills/openpond-agent-authoring/SKILL.md +9 -3
  229. package/dist/skills/openpond-agent-authoring/references/profile-layout.md +1 -1
  230. package/dist/skills/openpond-agent-authoring/references/validation-and-repair.md +2 -2
  231. package/dist/skills/openpond-cli/SKILL.md +11 -7
  232. package/dist/skills/openpond-cli/references/experiments-and-training.md +1 -1
  233. package/dist/skills/openpond-refiner-authoring/SKILL.md +4 -0
  234. package/dist/skills/openpond-skill-authoring/SKILL.md +5 -1
  235. package/dist/web/assets/App-DY2R8Z6r.js +53 -0
  236. package/dist/web/assets/{AppDialog-BurL61qE.js → AppDialog-8Y0FYalT.js} +1 -1
  237. package/dist/web/assets/AppTerminalPanel-YcnBD5DF.js +2 -0
  238. package/dist/web/assets/{AppToastContext-DZLErwj0.js → AppToastContext-BiQbbVxq.js} +1 -1
  239. package/dist/web/assets/AppsView-Dtte4h6e.js +1 -0
  240. package/dist/web/assets/{AttachmentTypeIcon-CpMSfHCK.js → AttachmentTypeIcon-DgADV7dn.js} +1 -1
  241. package/dist/web/assets/BrowserSidebar-BUqDvEv9.js +1 -0
  242. package/dist/web/assets/{CartesianChart-CEbM980A.js → CartesianChart-J4ChOjvG.js} +1 -1
  243. package/dist/web/assets/ChatTimelineEntry-DC93wlDa.js +8 -0
  244. package/dist/web/assets/ChatTimelineEntry-DztFb85D.css +1 -0
  245. package/dist/web/assets/{CollaborationTabs-DrKJmJZK.js → CollaborationTabs-CFCpk2Ck.js} +1 -1
  246. package/dist/web/assets/CommandMenu-EPPjB14H.js +1 -0
  247. package/dist/web/assets/{CommunityView-BzpIq1lD.js → CommunityView-Okydjpqm.js} +1 -1
  248. package/dist/web/assets/ComposerAttachments-RXCiE88M.js +2 -0
  249. package/dist/web/assets/{ComposerCreateImproveStrip-ChplO9YP.js → ComposerCreateImproveStrip-CSngc8-V.js} +1 -1
  250. package/dist/web/assets/{ConversationImportsSettings-DRHgc7j_.js → ConversationImportsSettings-DS73kyfj.js} +1 -1
  251. package/dist/web/assets/FilePagePreview-Qc4B0vue.js +2 -0
  252. package/dist/web/assets/{GetStartedView-CaBk_mX6.js → GetStartedView-DGFPQ1We.js} +1 -1
  253. package/dist/web/assets/{GettingStartedDialog-JtFLyU3F.js → GettingStartedDialog-DFBYQdHz.js} +1 -1
  254. package/dist/web/assets/{HostedModelLearningReview-hhcjDifK.js → HostedModelLearningReview-BDu3FlcU.js} +1 -1
  255. package/dist/web/assets/{HostedModelLearningSettings-CY8198Y1.js → HostedModelLearningSettings-CHaTHwC8.js} +1 -1
  256. package/dist/web/assets/HtmlVisual-C7GlEVfH.css +1 -0
  257. package/dist/web/assets/HtmlVisual-D9Mh7xds.js +81 -0
  258. package/dist/web/assets/LabModelVersionDetailPage-DgY7lAu5.js +1 -0
  259. package/dist/web/assets/{LabSkillSidebar-HibUEEko.js → LabSkillSidebar-BwtlThO7.js} +1 -1
  260. package/dist/web/assets/LabsRoute-BV7ZJGEw.js +101 -0
  261. package/dist/web/assets/MainChatThread-pzHKd_YN.js +2 -0
  262. package/dist/web/assets/MainPane-6OlLiKKb.js +10 -0
  263. package/dist/web/assets/MainPane-Dje-hfUM.css +1 -0
  264. package/dist/web/assets/NativeSetupTerminal-CPDChcMi.js +2 -0
  265. package/dist/web/assets/NativeSkillSidebar-BEJvt5_H.js +1 -0
  266. package/dist/web/assets/{NewProjectDialog-t9Imnb__.js → NewProjectDialog-CjrjgkTN.js} +1 -1
  267. package/dist/web/assets/{OutputsPage-CeGq_F1S.js → OutputsPage-jzx93QQ3.js} +1 -1
  268. package/dist/web/assets/{PageChrome-VHME5V8j.js → PageChrome-C1M13qG2.js} +1 -1
  269. package/dist/web/assets/{ProjectsPage-2TMZoEPB.js → ProjectsPage-DZrjlMp2.js} +1 -1
  270. package/dist/web/assets/RightChatPanelStack-BsxJg9sy.js +1 -0
  271. package/dist/web/assets/RightSidebarHomePanel-CCVQ9LMB.js +1 -0
  272. package/dist/web/assets/ScheduledWorkPage-Cw1ja2GF.js +1 -0
  273. package/dist/web/assets/{SettingsView-Y8f98GSE.css → SettingsView-Cc0376pY.css} +1 -1
  274. package/dist/web/assets/SettingsView-CckoIki3.js +5 -0
  275. package/dist/web/assets/TasksetDraftEditorPrimitives-ByC8bDjp.js +1 -0
  276. package/dist/web/assets/TeamChatView-OprnSKLF.js +1 -0
  277. package/dist/web/assets/{TerminalOverlay-DlhRpi-X.js → TerminalOverlay-d7A2F9Lx.js} +2 -2
  278. package/dist/web/assets/TrainingCreationPanel-Cyn6R6I6.js +1 -0
  279. package/dist/web/assets/{TrainingDraftPanel-BhhZPPuY.js → TrainingDraftPanel-Mpb5e7t5.js} +1 -1
  280. package/dist/web/assets/TrainingRunLineage-PXzWR65d.css +1 -0
  281. package/dist/web/assets/TrainingRunLineage-VcKz7dIR.js +1 -0
  282. package/dist/web/assets/{UsageSettingsSection-DTZslBeW.js → UsageSettingsSection-FhYymrfc.js} +2 -2
  283. package/dist/web/assets/WorkSidebarPanel-u87uptH0.js +1 -0
  284. package/dist/web/assets/WorkspaceDiffPanel-B5rlW7bA.js +11 -0
  285. package/dist/web/assets/WorkspaceEnvironmentMenu-C8y3537a.js +35 -0
  286. package/dist/web/assets/{WorkspaceFileLocation-ChEeZffU.js → WorkspaceFileLocation-LrEWj4UK.js} +1 -1
  287. package/dist/web/assets/{WorkspaceGitDialogs-D_RUXhTi.js → WorkspaceGitDialogs-NRIMXnkS.js} +1 -1
  288. package/dist/web/assets/{WorkspaceMonacoEditor-BJxaiDrj.js → WorkspaceMonacoEditor-CvDGjKAL.js} +3 -3
  289. package/dist/web/assets/WorkspacePdfPreview-BZ0BbnHv.js +2 -0
  290. package/dist/web/assets/{WorkspacePresentationPreview-A28Poeca.js → WorkspacePresentationPreview-DJrjrvT0.js} +1 -1
  291. package/dist/web/assets/app-models-CUA9XB9U.js +1 -0
  292. package/dist/web/assets/bot-6OhUEmkE.js +1 -0
  293. package/dist/web/assets/browser-sidebar-links-ZyYiYBBd.js +1 -0
  294. package/dist/web/assets/chat-resources-CI8KFVO5.js +1 -0
  295. package/dist/web/assets/{chevron-down-dYn0pd4Q.js → chevron-down-jmVA1BIf.js} +1 -1
  296. package/dist/web/assets/chevron-right-BYmDQ7ti.js +1 -0
  297. package/dist/web/assets/chevron-up-CstyLXH3.js +1 -0
  298. package/dist/web/assets/{chunk-ZFYI4P6C-BmsNtSkR.js → chunk-ONGOAEY6-C__DQmRT.js} +5 -5
  299. package/dist/web/assets/{chunk-BYNVSWIQ-DWh9SmdB.js → chunk-SQBYHWZU-DumrB9SB.js} +1 -1
  300. package/dist/web/assets/{client-choice-storage-DTTLbrYt.js → client-choice-storage-BdQ_YDuk.js} +1 -1
  301. package/dist/web/assets/{cloud-upload-CRMPCFnq.js → cloud-upload-Ck1ufAr8.js} +1 -1
  302. package/dist/web/assets/contracts-BLiqJxBv.js +1 -0
  303. package/dist/web/assets/{copy-DR4ielPn.js → copy-CPkbMfXt.js} +1 -1
  304. package/dist/web/assets/{createLucideIcon-DmttVQ_a.js → createLucideIcon-CXQny8HU.js} +1 -1
  305. package/dist/web/assets/{cssMode-d-2GuNvW.js → cssMode-CYxYl_om.js} +1 -1
  306. package/dist/web/assets/{external-link-B4rPiZEp.js → external-link-CDKOLG_v.js} +1 -1
  307. package/dist/web/assets/{folder-open-BrIUcUk_.js → folder-open-CEtOb_lK.js} +1 -1
  308. package/dist/web/assets/{folder-plus-DwImGEt-.js → folder-plus-CVMYZs3e.js} +1 -1
  309. package/dist/web/assets/{git-commit-horizontal-Ds1mkrlW.js → git-commit-horizontal-DDyhPjxS.js} +1 -1
  310. package/dist/web/assets/{htmlMode-s15GR0Fn.js → htmlMode-DoY4V_j0.js} +1 -1
  311. package/dist/web/assets/icons-D7jkCa2d.js +1 -0
  312. package/dist/web/assets/{image-CY-sHbfQ.js → image-B-PjDSwU.js} +1 -1
  313. package/dist/web/assets/{index-DYrLeSyY.js → index-D9WbJMSq.js} +2 -2
  314. package/dist/web/assets/index-g7UqJhnX.css +1 -0
  315. package/dist/web/assets/{info-aSvM8YlJ.js → info-CCnw-K3b.js} +1 -1
  316. package/dist/web/assets/intake-contracts-BW0Y0C2R.js +1 -0
  317. package/dist/web/assets/{jsonMode-vos9H2hz.js → jsonMode-CeOpZdPj.js} +1 -1
  318. package/dist/web/assets/loader-circle-CPaJeTDy.js +1 -0
  319. package/dist/web/assets/{lspLanguageFeatures-pQmEaoMt.js → lspLanguageFeatures-DAbgLCqZ.js} +1 -1
  320. package/dist/web/assets/{maximize-2-DgF6ZVOM.js → maximize-2-BZX38cpr.js} +1 -1
  321. package/dist/web/assets/message-square-CvgSecgD.js +1 -0
  322. package/dist/web/assets/{monaco.contribution-BPwsKvRB.js → monaco.contribution-CF2JDhi4.js} +2 -2
  323. package/dist/web/assets/{monaco.contribution-CJlccVX3.js → monaco.contribution-cbDqt48m.js} +2 -2
  324. package/dist/web/assets/{monaco.contribution-BbMpa0_-.js → monaco.contribution-m2ze2EsL.js} +2 -2
  325. package/dist/web/assets/{monaco.contribution-pWurLXbm.js → monaco.contribution-yeyow_-Q.js} +2 -2
  326. package/dist/web/assets/{monitor-DlEV241C.js → monitor-By0s4hxb.js} +1 -1
  327. package/dist/web/assets/{paperclip-fnRZSIRc.js → paperclip-BJ2QgJLa.js} +1 -1
  328. package/dist/web/assets/{pdf-CT3zVKCE.js → pdf-C4x-1jjP.js} +1 -1
  329. package/dist/web/assets/pdf.worker.min-BrEVksTu.js +1 -0
  330. package/dist/web/assets/play-D_SuGDBM.js +1 -0
  331. package/dist/web/assets/plus-yw95Iaj8.js +1 -0
  332. package/dist/web/assets/{presentation-Bb8ecExR.js → presentation-I86G1Gd9.js} +1 -1
  333. package/dist/web/assets/{python-DXA1xp0A.js → python-CqFTPj8r.js} +1 -1
  334. package/dist/web/assets/{refresh-cw-B53QjxMO.js → refresh-cw-Dga35Eay.js} +1 -1
  335. package/dist/web/assets/requests-BCbaFiqV.js +1 -0
  336. package/dist/web/assets/{reward-checks-5AOStF27.js → reward-checks-Bcq9ETCA.js} +1 -1
  337. package/dist/web/assets/{save-V1Q4Fcqa.js → save-BLKjYtzR.js} +1 -1
  338. package/dist/web/assets/settings-D7C-Auyi.js +21 -0
  339. package/dist/web/assets/{settings-lists-CtH1A57b.js → settings-lists-DMKA1lCN.js} +5 -5
  340. package/dist/web/assets/square-BY5lG2Ol.js +1 -0
  341. package/dist/web/assets/{square-terminal-Dmgkm5zY.js → square-terminal-B-n7vUex.js} +1 -1
  342. package/dist/web/assets/submit-issue-command-B7Hrt2tU.js +3 -0
  343. package/dist/web/assets/{toggleHighContrast-B-BD2K2Q.js → toggleHighContrast-BhmBE5XE.js} +1 -1
  344. package/dist/web/assets/training-QrdkRQZQ.js +2 -0
  345. package/dist/web/assets/{training-model-data-14942K_Z.js → training-model-data-DB-jg6L_.js} +12 -12
  346. package/dist/web/assets/{tsMode-DdgIcxK3.js → tsMode-BSWEII2p.js} +1 -1
  347. package/dist/web/assets/{upload-82Y6RjLi.js → upload-C4MPhQn8.js} +1 -1
  348. package/dist/web/assets/{useAccountSettings-BgHXNpq_.js → useAccountSettings-9oqWdRLs.js} +1 -1
  349. package/dist/web/assets/useAgentInventory-isO79ui9.js +1 -0
  350. package/dist/web/assets/{useLocalAgentSchedules-CsKv22Hs.js → useLocalAgentSchedules-CZX6PxoK.js} +1 -1
  351. package/dist/web/assets/{useQuery-CPC2wsWm.js → useQuery-BD0Uexmh.js} +1 -1
  352. package/dist/web/assets/{wifi-off-DXOoDN9l.js → wifi-off-Cloe0WuQ.js} +1 -1
  353. package/dist/web/assets/{workers-Clf4hKt5.js → workers-BXagz5eg.js} +1 -1
  354. package/dist/web/assets/x-Dqpel42h.js +1 -0
  355. package/dist/web/assets/{yaml-I1tf8Uxx.js → yaml-sBdvVbCc.js} +1 -1
  356. package/dist/web/index.html +2 -2
  357. package/docs/command-reference.md +22 -4
  358. package/package.json +5 -2
  359. package/dist/chunks/actions-command-6LF4Z4WK.js +0 -2
  360. package/dist/chunks/app-server-connected-apps-3T546FE7.js +0 -2
  361. package/dist/chunks/app-server-evaluations-TXD747QA.js +0 -2
  362. package/dist/chunks/app-server-harness-services-BBCDV5P3.js +0 -2
  363. package/dist/chunks/app-server-runtime-VEJPDAFP.js +0 -2
  364. package/dist/chunks/apps-CTT2XYRR.js +0 -2
  365. package/dist/chunks/chunk-4M3YW3EQ.js +0 -13
  366. package/dist/chunks/chunk-4U2FNXQW.js +0 -2
  367. package/dist/chunks/chunk-547AUVKN.js +0 -2
  368. package/dist/chunks/chunk-557YG77L.js +0 -2
  369. package/dist/chunks/chunk-7KTARW23.js +0 -2
  370. package/dist/chunks/chunk-B42QQUZY.js +0 -2
  371. package/dist/chunks/chunk-EWOTDVDJ.js +0 -4
  372. package/dist/chunks/chunk-GAQLXFOT.js +0 -2
  373. package/dist/chunks/chunk-GLDYJM7O.js +0 -1
  374. package/dist/chunks/chunk-HKV7RX5E.js +0 -2
  375. package/dist/chunks/chunk-IWK3RTLR.js +0 -2
  376. package/dist/chunks/chunk-JX6OX6XE.js +0 -12
  377. package/dist/chunks/chunk-JY3YSI54.js +0 -2
  378. package/dist/chunks/chunk-LILXHGIA.js +0 -2
  379. package/dist/chunks/chunk-LJPO3TEL.js +0 -17
  380. package/dist/chunks/chunk-MNFW5WLD.js +0 -6
  381. package/dist/chunks/chunk-N5GPINVP.js +0 -2
  382. package/dist/chunks/chunk-N663LL27.js +0 -2
  383. package/dist/chunks/chunk-NOSBNHGC.js +0 -18
  384. package/dist/chunks/chunk-NR5VASQB.js +0 -2
  385. package/dist/chunks/chunk-O3MHHGC5.js +0 -151
  386. package/dist/chunks/chunk-OZ6LRNRE.js +0 -2
  387. package/dist/chunks/chunk-PGO4FRHU.js +0 -10
  388. package/dist/chunks/chunk-QAVQJZCM.js +0 -2
  389. package/dist/chunks/chunk-RBDUMASL.js +0 -2
  390. package/dist/chunks/chunk-TM4VEMNN.js +0 -2
  391. package/dist/chunks/chunk-TUCKED4T.js +0 -4
  392. package/dist/chunks/chunk-TVTFEGTU.js +0 -2
  393. package/dist/chunks/chunk-TW3SRBLU.js +0 -22
  394. package/dist/chunks/chunk-UT6F6AIB.js +0 -12
  395. package/dist/chunks/chunk-VE6ZIGUQ.js +0 -2
  396. package/dist/chunks/chunk-VI32G77S.js +0 -2
  397. package/dist/chunks/chunk-VWRTE64Y.js +0 -2
  398. package/dist/chunks/chunk-XSB3T4JZ.js +0 -5
  399. package/dist/chunks/chunk-XWDFXM3S.js +0 -2
  400. package/dist/chunks/chunk-ZQHPGEYT.js +0 -2
  401. package/dist/chunks/cli-GCSO2OAI.js +0 -2
  402. package/dist/chunks/connected-app-executor-UDE7U4KG.js +0 -2
  403. package/dist/chunks/connected-evidence-GXIY2L7C.js +0 -2
  404. package/dist/chunks/core-commands-NJ6TGND4.js +0 -2
  405. package/dist/chunks/dataset-preparation-authoring-IUXUQK3L.js +0 -4
  406. package/dist/chunks/datasets-AH56DKLZ.js +0 -2
  407. package/dist/chunks/desktop-test-PYUTEOWO.js +0 -3
  408. package/dist/chunks/dist-5267UT3V.js +0 -2
  409. package/dist/chunks/evaluation-coordination-3AUICOC5.js +0 -2
  410. package/dist/chunks/experiment-improvements-YS7GGPDW.js +0 -2
  411. package/dist/chunks/experiments-EJZK7FPT.js +0 -2
  412. package/dist/chunks/experiments-signal-NKUIJCIY.js +0 -2
  413. package/dist/chunks/host-profile-evaluation-tools-CTC5JQPD.js +0 -2
  414. package/dist/chunks/host-profile-external-dataset-GJWDY3YT.js +0 -2
  415. package/dist/chunks/hosted-app-server-composition-TLJSKMJT.js +0 -2
  416. package/dist/chunks/hosted-experiment-improvement-TIVXXRPG.js +0 -3
  417. package/dist/chunks/hosted-harness-runtime-SFLJEZFI.js +0 -2
  418. package/dist/chunks/hosted-profile-candidate-DKEMVIYG.js +0 -3
  419. package/dist/chunks/hosted-profile-compiler-V6YR6EHO.js +0 -2
  420. package/dist/chunks/hosted-profile-evaluation-control-ERCXAPZD.js +0 -2
  421. package/dist/chunks/hosted-profile-evaluation-inspection-Q3AIIIB6.js +0 -3
  422. package/dist/chunks/hosted-profile-evaluation-preparation-ELLGH44Z.js +0 -3
  423. package/dist/chunks/human-review-5WM6MSON.js +0 -2
  424. package/dist/chunks/learning-KVLTMRLD.js +0 -2
  425. package/dist/chunks/local-harness-improvement-runtime-IGIKM6GJ.js +0 -2
  426. package/dist/chunks/local-harness-taskset-review-DR2ZIDOH.js +0 -2
  427. package/dist/chunks/model-projects-H22KENI4.js +0 -2
  428. package/dist/chunks/opchat-3S6TSDZO.js +0 -3
  429. package/dist/chunks/opchat-bounded-chat-B7LPCD4U.js +0 -2
  430. package/dist/chunks/organizations-62YNTZTO.js +0 -2
  431. package/dist/chunks/project-action-payload-32F4X2BB.js +0 -2
  432. package/dist/chunks/project-agent-O4REKO6T.js +0 -2
  433. package/dist/chunks/published-experiment-source-DAOTJLIN.js +0 -2
  434. package/dist/chunks/refiner-profile-service-DYMZ7J3X.js +0 -2
  435. package/dist/chunks/sandbox-command-UQ26NDIX.js +0 -2
  436. package/dist/chunks/saved-work-PG52WCRQ.js +0 -2
  437. package/dist/chunks/src-AU6LG7E6.js +0 -421
  438. package/dist/chunks/standalone-experiment-turn-owner-SD3SUTKX.js +0 -2
  439. package/dist/chunks/store-chat-resources-T4LR7K25.js +0 -2
  440. package/dist/chunks/store-evaluation-results-WUVJWCFU.js +0 -7
  441. package/dist/chunks/store-harness-workspaces-IFEFY5CK.js +0 -2
  442. package/dist/chunks/store-human-review-ZQNLZRGG.js +0 -7
  443. package/dist/chunks/store-learned-preference-migration-validation-UH6MJQSH.js +0 -2
  444. package/dist/chunks/store-model-batch-review-QO4VVKWC.js +0 -2
  445. package/dist/chunks/store-model-configuration-C3HSOFD5.js +0 -3
  446. package/dist/chunks/store-model-project-preparation-RQ2YTC2Y.js +0 -2
  447. package/dist/chunks/store-task-inbox-DL5RYFPO.js +0 -33
  448. package/dist/chunks/store-taskset-drafts-UFGN4SGF.js +0 -9
  449. package/dist/chunks/taskset-packages-CBLJFWDQ.js +0 -2
  450. package/dist/chunks/training-error-L5V5IBX3.js +0 -2
  451. package/dist/chunks/training-hosted-I2NDBYGS.js +0 -2
  452. package/dist/chunks/training-hosted-report-4F25RZZ4.js +0 -2
  453. package/dist/chunks/training-hosted-workers-KI767T4Y.js +0 -2
  454. package/dist/skills/openpond-desktop-harness/SKILL.md +0 -113
  455. package/dist/skills/openpond-desktop-harness/agents/openai.yaml +0 -4
  456. package/dist/web/assets/App-DHJVXTI2.js +0 -54
  457. package/dist/web/assets/AppTerminalPanel-RjFlF-a4.js +0 -2
  458. package/dist/web/assets/AppsView-ttlr9ckQ.js +0 -1
  459. package/dist/web/assets/BrowserSidebar-Cp2l0kg0.js +0 -1
  460. package/dist/web/assets/ChatTimelineEntry-BITv20Ze.js +0 -1
  461. package/dist/web/assets/CommandMenu-6oj8FUr6.js +0 -1
  462. package/dist/web/assets/ComposerAttachments-6en7m_ov.js +0 -2
  463. package/dist/web/assets/FilePagePreview-CW4J_1u7.js +0 -2
  464. package/dist/web/assets/LabModelVersionDetailPage-f0tHT-Sn.js +0 -1
  465. package/dist/web/assets/LabsRoute-B61l1b8P.js +0 -101
  466. package/dist/web/assets/MainChatThread-egKi0gLk.js +0 -2
  467. package/dist/web/assets/MainPane-2dj6Dg4l.js +0 -95
  468. package/dist/web/assets/MainPane-BwHw3UYp.css +0 -1
  469. package/dist/web/assets/NativeSetupTerminal-CNHTByLo.js +0 -2
  470. package/dist/web/assets/NativeSkillSidebar-DCdMbSfe.js +0 -1
  471. package/dist/web/assets/RightChatPanelStack-B3mBViGC.js +0 -1
  472. package/dist/web/assets/RightSidebarHomePanel-CxDYSyyx.js +0 -1
  473. package/dist/web/assets/ScheduledWorkPage-Dh47iH11.js +0 -1
  474. package/dist/web/assets/SettingsView-D2bu3tK_.js +0 -5
  475. package/dist/web/assets/TeamChatView-CN17AsgA.js +0 -1
  476. package/dist/web/assets/TrainingCreationPanel-DJKzaNFj.js +0 -1
  477. package/dist/web/assets/TrainingMetricWorkbench-DBy8F1xp.js +0 -1
  478. package/dist/web/assets/WorkSidebarPanel-Ds-eTQLs.js +0 -1
  479. package/dist/web/assets/WorkspaceDiffPanel-D_iyg2D4.js +0 -11
  480. package/dist/web/assets/WorkspaceEnvironmentMenu-Fn-NlfMQ.js +0 -35
  481. package/dist/web/assets/app-models-BviS9b7U.js +0 -1
  482. package/dist/web/assets/browser-sidebar-links-ujSvTf5h.js +0 -1
  483. package/dist/web/assets/chat-resources-3SvnVeKv.js +0 -1
  484. package/dist/web/assets/chevron-right-sFx2xRvT.js +0 -1
  485. package/dist/web/assets/contracts-BHTOD1nd.js +0 -1
  486. package/dist/web/assets/icons-CK5-nxVC.js +0 -1
  487. package/dist/web/assets/index-Dezj4Z2p.css +0 -1
  488. package/dist/web/assets/loader-circle-cyf35w3i.js +0 -1
  489. package/dist/web/assets/play-wI_3FLr4.js +0 -1
  490. package/dist/web/assets/plus-DoJe4fLj.js +0 -1
  491. package/dist/web/assets/settings-BKmRueaw.js +0 -21
  492. package/dist/web/assets/square-BqSK-hv9.js +0 -1
  493. package/dist/web/assets/submit-issue-command-DRgUboVW.js +0 -3
  494. package/dist/web/assets/training-managed-adapter-BXNwgd3P.js +0 -1
  495. package/dist/web/assets/useAgentInventory-B-LNn3up.js +0 -1
  496. package/dist/web/assets/x-IPhrr4ju.js +0 -1
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,h as n,m as r}from"./index-DYrLeSyY.js";import"./icons-CK5-nxVC.js";import{F as i,x as a}from"./training-model-data-14942K_Z.js";import{t as o}from"./refresh-cw-B53QjxMO.js";import{t as s}from"./x-IPhrr4ju.js";import{r as c}from"./AppToastContext-DZLErwj0.js";import{Wt as l,d as u,en as d,f,ft as p,h as m,l as h,m as g,p as _,pt as v,r as y,u as b,vn as x,wn as S}from"./App-DHJVXTI2.js";import{E as C,q as w}from"./MainPane-2dj6Dg4l.js";var T=e(t(),1);function E(e,t){let n=new Set(Array.from(e.matchAll(/(?:^|\s)@([a-zA-Z0-9_-]+)/g),e=>(e[1]??``).toLowerCase()));return t.filter(e=>{let t=e.handle?.toLowerCase(),r=e.name.toLowerCase().replace(/[^a-z0-9_-]+/g,`-`);return t&&n.has(t)||n.has(r)}).map(e=>e.userId)}var D=n(),O=r();function k(e){return(0,O.jsxs)(`div`,{className:`team-chat-composer-reply`,role:`status`,children:[(0,O.jsx)(w,{size:15,"aria-hidden":`true`}),(0,O.jsxs)(`button`,{type:`button`,className:`team-chat-composer-reply-target`,"aria-label":`Jump to message from ${e.authorLabel}`,onClick:e.onJump,children:[(0,O.jsxs)(`strong`,{children:[`Replying to `,e.authorLabel]}),(0,O.jsx)(`span`,{children:_(e.target)})]}),(0,O.jsx)(`button`,{type:`button`,className:`team-chat-icon-button`,"aria-label":`Cancel reply`,"data-tooltip":`Cancel reply`,onClick:e.onCancel,children:(0,O.jsx)(s,{size:14})})]})}function A(e){return(0,O.jsxs)(`button`,{type:`button`,className:`team-chat-message-reply-quote`,"aria-label":`Jump to replied message from ${e.authorLabel}`,onClick:e.onJump,children:[(0,O.jsx)(`strong`,{children:e.authorLabel}),(0,O.jsx)(`span`,{children:_(e.target)})]})}function j(e){let t=(0,T.useRef)(null);if((0,T.useEffect)(()=>{if(!e.menu)return;t.current?.focus();let n=()=>e.onClose(),r=e=>{e.key===`Escape`&&n()};return window.addEventListener(`click`,n),window.addEventListener(`blur`,n),window.addEventListener(`keydown`,r),window.addEventListener(`scroll`,n,!0),()=>{window.removeEventListener(`click`,n),window.removeEventListener(`blur`,n),window.removeEventListener(`keydown`,r),window.removeEventListener(`scroll`,n,!0)}},[e.menu,e.onClose]),!e.menu||typeof document>`u`)return null;let n=(0,O.jsx)(`div`,{className:`team-chat-message-context-menu`,role:`menu`,"aria-label":`Message actions`,style:{left:e.menu.x,top:e.menu.y},onClick:e=>e.stopPropagation(),children:(0,O.jsxs)(`button`,{ref:t,type:`button`,role:`menuitem`,onClick:()=>{e.onReply(e.menu.message),e.onClose()},children:[(0,O.jsx)(w,{size:14}),`Reply`]})});return(0,D.createPortal)(n,document.body)}function M(e){let t=e.clientX||e.fallbackX,n=e.clientY||e.fallbackY;return{x:Math.max(8,Math.min(t,e.viewportWidth-150-8)),y:Math.max(8,Math.min(n,e.viewportHeight-42-8))}}function N(e){return`team-chat-message-${encodeURIComponent(e)}`}function P(e){let[t,n]=(0,T.useState)(!1),[r,a]=(0,T.useState)(e.message.body),c=e.message.refs.find(e=>e.refType===`hosted_ai_thread`),u=e.message.refs.find(e=>e.refType===`agent_run`),p=typeof c?.preview.status==`string`?c.preview.status:null,m=typeof e.message.metadata.deliveryStatus==`string`?e.message.metadata.deliveryStatus:null,h=typeof e.message.metadata.uploadProgress==`string`?e.message.metadata.uploadProgress:null,_=!e.message.deletedAt&&!m,v=g(e.message,e.messagesById),y=v?f(v,e.membersById):null;return(0,O.jsxs)(`article`,{id:N(e.message.id),className:`team-chat-message${e.own?` own`:``}`,tabIndex:-1,onContextMenu:t=>{if(!_)return;t.preventDefault();let n=t.currentTarget.getBoundingClientRect();e.onOpenReplyMenu(e.message,{clientX:t.clientX,clientY:t.clientY,fallbackX:n.right-12,fallbackY:n.top+24})},children:[(0,O.jsx)(R,{member:e.author}),(0,O.jsxs)(`div`,{className:`team-chat-message-content`,children:[(0,O.jsxs)(`header`,{children:[(0,O.jsx)(`strong`,{children:e.author?.name??`Team member`}),(0,O.jsx)(`time`,{children:z(e.message.createdAt)}),e.message.editedAt?(0,O.jsx)(`span`,{children:`edited`}):null,m===`sending`?(0,O.jsx)(`span`,{children:`sending`}):null,m===`sending`&&h?(0,O.jsxs)(`span`,{children:[`uploaded `,h]}):null,m===`failed`?(0,O.jsx)(`span`,{className:`failed`,children:`not sent`}):null,m===`failed`?(0,O.jsxs)(`div`,{className:`team-chat-message-actions visible`,children:[(0,O.jsx)(`button`,{type:`button`,"data-tooltip":`Retry message`,"aria-label":`Retry message`,onClick:()=>void e.onRetry(e.message),children:(0,O.jsx)(o,{size:13})}),(0,O.jsx)(`button`,{type:`button`,"data-tooltip":`Remove failed message`,"aria-label":`Remove failed message`,onClick:()=>e.onDismissFailed(e.message),children:(0,O.jsx)(s,{size:13})})]}):_||e.own&&!e.message.deletedAt?(0,O.jsxs)(`div`,{className:`team-chat-message-actions`,children:[_?(0,O.jsx)(`button`,{type:`button`,"data-tooltip":`Reply`,"aria-label":`Reply to message`,onClick:()=>e.onReply(e.message),children:(0,O.jsx)(w,{size:13})}):null,e.own&&!c?(0,O.jsx)(`button`,{type:`button`,"data-tooltip":`Edit message`,"aria-label":`Edit message`,onClick:()=>n(!0),children:(0,O.jsx)(l,{size:13})}):null,e.own?(0,O.jsx)(`button`,{type:`button`,"data-tooltip":`Delete message`,"aria-label":`Delete message`,onClick:()=>void e.onDelete(e.message),children:(0,O.jsx)(i,{size:13})}):null]}):null]}),v&&y?(0,O.jsx)(A,{authorLabel:y,target:v,onJump:()=>e.onJumpToMessage(v.id)}):null,t?(0,O.jsxs)(`form`,{className:`team-chat-message-edit`,onSubmit:t=>{t.preventDefault(),e.onEdit(e.message,r).then(e=>{e&&n(!1)})},children:[(0,O.jsx)(`textarea`,{autoFocus:!0,value:r,onChange:e=>a(e.currentTarget.value),onKeyDown:t=>{t.key===`Escape`&&(t.preventDefault(),n(!1),a(e.message.body))}}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`button`,{type:`button`,onClick:()=>n(!1),children:`Cancel`}),(0,O.jsx)(`button`,{type:`submit`,disabled:!r.trim(),children:`Save`})]})]}):(0,O.jsx)(`div`,{className:e.message.deletedAt?`deleted`:``,children:e.message.deletedAt?`Message deleted`:e.message.body}),!e.message.deletedAt&&e.message.attachments.length>0?(0,O.jsx)(F,{message:e.message,connection:e.connection}):null,c?(0,O.jsxs)(`button`,{type:`button`,className:`team-chat-thread-link`,onClick:()=>void e.onOpenAiThread(c.refId),children:[(0,O.jsx)(d,{size:14}),(0,O.jsx)(`span`,{children:`Thread`}),p&&p!==`completed`?(0,O.jsx)(`small`,{children:L(p)}):null,(0,O.jsx)(`span`,{"aria-hidden":`true`,children:`›`})]}):null,u?(0,O.jsxs)(`button`,{type:`button`,className:`team-chat-thread-link`,onClick:()=>void e.onOpenAgentConversation(u.refId),children:[(0,O.jsx)(x,{size:14}),(0,O.jsx)(`span`,{children:`Agent run`}),(0,O.jsx)(`small`,{children:L(String(u.preview.status??`queued`))}),(0,O.jsx)(`span`,{"aria-hidden":`true`,children:`›`})]}):null]})]})}function F(e){let t=new Map(Array.isArray(e.message.metadata.localAttachmentPreviews)?e.message.metadata.localAttachmentPreviews.flatMap(e=>{if(!e||typeof e!=`object`)return[];let t=e;return typeof t.id==`string`&&typeof t.url==`string`?[[t.id,t.url]]:[]}):[]);return(0,O.jsx)(`div`,{className:`team-chat-message-images`,children:e.message.attachments.map(n=>(0,O.jsx)(I,{attachmentId:n.id,alt:n.name,teamId:e.message.teamId,connection:e.connection,localUrl:t.get(n.clientAttachmentId)??null},n.id))})}function I(e){let[t,n]=(0,T.useState)(e.localUrl),[r,i]=(0,T.useState)(!1),a=(0,T.useRef)(0);async function s(){if(!e.connection||e.localUrl)e.localUrl||i(!0);else{i(!1);try{let t=await S.teamChatAttachmentDownload(e.connection,e.teamId,e.attachmentId);n(t.url)}catch{n(null),i(!0)}}}return(0,T.useEffect)(()=>{n(e.localUrl),i(!1),a.current=0,e.localUrl||s()},[e.attachmentId,e.connection,e.localUrl,e.teamId]),t?(0,O.jsx)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,"aria-label":`Open ${e.alt}`,children:(0,O.jsx)(`img`,{src:t,alt:e.alt,loading:`lazy`,onError:()=>{!e.localUrl&&a.current<1?(a.current+=1,s()):(n(null),i(!0))}})}):r?(0,O.jsx)(`button`,{type:`button`,className:`team-chat-message-image-retry`,"aria-label":`Retry ${e.alt}`,"data-tooltip":`Retry image`,onClick:()=>{a.current=0,e.localUrl?(i(!1),n(e.localUrl)):s()},children:(0,O.jsx)(o,{size:18})}):(0,O.jsx)(`div`,{className:`team-chat-message-image-loading`,role:`status`,"aria-label":`Loading ${e.alt}`})}function L(e){return e===`pending`?`Starting`:e===`running`?`Responding`:e===`failed`?`Failed`:e===`interrupted`?`Interrupted`:e===`cancelled`?`Cancelled`:e}function R({member:e}){if(e?.image)return(0,O.jsx)(`img`,{className:`team-chat-avatar`,src:e.image,alt:``});let t=(e?.name??`T`).split(/\s+/).slice(0,2).map(e=>e[0]?.toUpperCase()??``).join(``);return(0,O.jsx)(`span`,{className:`team-chat-avatar fallback`,children:t})}function z(e){let t=new Date(e);return Number.isFinite(t.getTime())?t.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`}):``}var B={value:`none`,label:`No project`,detail:`Team conversation`,options:[],busy:!1},V={value:`local`,label:`Local`,detail:`Local execution`,options:[],action:{value:`local`,label:`Local`,detail:`Local execution`,disabled:!1},busy:!1},H=new Set([`codex`,`openai`,`xai`,`openrouter`,`deepseek`,`zai`,`moonshot`,`together`,`groq`,`custom-openai-compatible`]);function U(e,t){return!t||e===t?e:e?`${t}\n\n${e}`:t}function W(){return(0,O.jsx)(`section`,{className:`team-chat-view team-chat-pro-view`,"aria-label":`Team Chat`,children:(0,O.jsxs)(`div`,{className:`team-chat-pro-content`,children:[(0,O.jsx)(`span`,{className:`team-chat-pro-icon`,"aria-hidden":`true`,children:(0,O.jsx)(d,{size:22})}),(0,O.jsx)(`h1`,{children:`Team Chat`}),(0,O.jsx)(`p`,{children:`Team Chat is available with Pro mode.`}),(0,O.jsx)(`small`,{children:`Create or join a Pro team to chat with teammates, coordinate work, and share agents.`})]})})}function G(e){c(e.error);let[t,n]=(0,T.useState)(``),[r,i]=(0,T.useState)(!1),[a,o]=(0,T.useState)(null),[s,l]=(0,T.useState)(null),[d,g]=(0,T.useState)(0),_=(0,T.useRef)(null),x=(0,T.useRef)(!0),S=(0,T.useRef)(e.detail?.thread.id??null);S.current=e.detail?.thread.id??null;let{confirmAction:w,confirmDialog:D,resolveConfirmDialog:A}=v(),F=(0,T.useMemo)(()=>new Map(e.members.map(e=>[e.userId,e])),[e.members]),I=(0,T.useMemo)(()=>new Map((e.detail?.messages??[]).map(e=>[e.id,e])),[e.detail?.messages]),L=e.detail?.thread.id??null,R=a?.threadId===L?I.get(a.message.id)??a.message:null,z=R?.deletedAt?null:R,W=z?m(z):null,G=W?f(W,F):null,K=e.detail?y(e.detail.thread,e.currentUserId):`Team`,q=H.has(e.provider)?e.provider:`codex`,J=q===e.provider?e.model:`gpt-5.6-sol`,Y=(0,T.useMemo)(()=>u({hostedActions:e.agents,profile:e.profile,teamId:e.teamId}),[e.agents,e.profile,e.teamId]),X=e.detail?.messages.at(-1)?.sequence??0;(0,T.useEffect)(()=>{if(!x.current)return;let e=_.current;e&&(e.scrollTop=e.scrollHeight)},[X,e.detail?.thread.id]);let Z=(0,T.useCallback)(e=>{e.deletedAt||e.id.startsWith(`pending:`)||typeof e.metadata.deliveryStatus==`string`||(o({threadId:e.threadId,message:e}),i(!1),l(null),g(e=>e+1))},[]),Q=(0,T.useCallback)(()=>l(null),[]),ee=(0,T.useCallback)((e,t)=>{let n=M({...t,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight});l({message:e,...n})},[]),$=(0,T.useCallback)(e=>{let t=document.getElementById(N(e));t&&(t.scrollIntoView({behavior:`smooth`,block:`center`}),t.focus({preventScroll:!0}))},[]);async function te(a=[],s=null){if(a.some(e=>e.kind!==`image`||![`image/png`,`image/jpeg`,`image/webp`,`image/gif`].includes(e.mediaType)))return e.showToast(`Team chat supports PNG, JPEG, WebP, and GIF images.`,`error`),!1;let c=s;if(z&&c)return e.showToast(`Remove the agent action before replying to a message.`,`error`),!1;if(h(c)){let t=b(c);if(!t)throw Error(`The selected profile agent is missing its profile id.`);if(!await w({title:`Publish ${c.label??c.name??`agent`} to Team?`,body:`This will upload the committed agent source to ${e.teamName??`this Team`}, create its hosted runtime, and then send your message.`,confirmLabel:`Publish and send`,tone:`default`}))return!1;c=await e.onPublishProfileAgent(t)}let l=c?.approvalPolicy?.risk,u=null;if(c?.approvalPolicy?.required&&l&&l!==`read`){let e=l===`destructive`;if(!await w({title:e?`Approve destructive action?`:`Approve external write?`,body:`${c.label??c.name??`This agent action`} will use the workspace connection to ${e?`perform a destructive operation`:`write external data`}. Approve this run only?`,confirmLabel:e?`Approve destructive action`:`Approve write`,tone:e?`danger`:`default`}))return!1;u=crypto.randomUUID()}let d=t,f=e.detail?.thread.id??null,p=z,m=()=>{S.current===f&&(n(e=>U(e,d)),p&&o(e=>e??{threadId:p.threadId,message:p}))};n(``),p&&o(null);try{let t=await e.onSendMessage({body:d,useModel:r,providerId:q,modelId:J,mentionUserIds:E(d,e.members),attachments:a,replyToMessage:p,selectedActionKey:c?.id??null,approvalId:u});return t?r&&i(!1):m(),t}catch(e){throw m(),e}}return(0,O.jsxs)(`section`,{className:`team-chat-view`,children:[(0,O.jsxs)(`div`,{className:`team-chat-main conversation-surface-main`,children:[(0,O.jsxs)(`div`,{className:`team-chat-messages conversation-message-scroll`,role:`log`,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-busy":e.loading,"aria-label":K,tabIndex:0,ref:_,onScroll:e=>{let t=e.currentTarget;x.current=t.scrollHeight-t.scrollTop-t.clientHeight<72},children:[e.detail?.hasMoreBefore?(0,O.jsx)(`button`,{type:`button`,className:`team-chat-load-older`,disabled:e.loading,onClick:()=>void e.onLoadMoreMessages(),children:e.loading?`Loading...`:`Load older messages`}):null,e.loading&&!e.detail?(0,O.jsx)(`div`,{className:`team-chat-empty`,children:`Loading messages...`}):e.detail?.messages.length?e.detail.messages.map(t=>(0,O.jsx)(P,{message:t,author:t.authorUserId?F.get(t.authorUserId)??null:null,own:t.authorUserId===e.currentUserId,onOpenAiThread:e.onOpenAiThread,onOpenAgentConversation:e.onOpenAgentConversation,onEdit:e.onEditMessage,onDelete:e.onDeleteMessage,onRetry:e.onRetryMessage,onDismissFailed:e.onDismissFailedMessage,membersById:F,messagesById:I,onReply:Z,onOpenReplyMenu:ee,onJumpToMessage:$,connection:e.connection},t.id)):(0,O.jsx)(`div`,{className:`team-chat-empty`,children:`No messages yet`})]}),(0,O.jsxs)(`div`,{className:`team-chat-composer-shell conversation-composer-shell`,children:[W&&G?(0,O.jsx)(k,{authorLabel:G,target:W,onCancel:()=>o(null),onJump:()=>$(W.id)}):null,(0,O.jsx)(C,{mode:`dock`,surface:`team`,teamUseModel:r,teamUseModelLocked:!!W,teamMentionMembers:e.members.filter(t=>t.userId!==e.currentUserId),actionCatalog:Y,onTeamUseModelChange:i,prompt:t,contextWindowStatus:e.contextWindowStatus,busy:e.busy,running:!1,focusRequestId:d,submissionScopeKey:`team:${e.detail?.thread.id??`none`}`,showProjectFooter:!1,connection:e.connection,providerSettings:e.providerSettings,provider:q,model:J,projectTarget:B,workspaceTarget:V,codexPermissionMode:e.codexPermissionMode,codexReasoningEffort:e.codexReasoningEffort,openPondCommandAccessMode:e.openPondCommandAccessMode,onProviderChange:e.onProviderChange,onProviderSetupOpen:e.onOpenProviderSettings,onProjectTargetChange:()=>void 0,onWorkspaceTargetChange:()=>void 0,onModelChange:e.onModelChange,onCodexPermissionModeChange:e.onCodexPermissionModeChange,onCodexReasoningEffortChange:e.onCodexReasoningEffortChange,onOpenPondCommandAccessModeChange:e.onOpenPondCommandAccessModeChange,onPromptChange:n,showToast:e.showToast,onSubmit:async(e,t)=>te(e??[],t??null),onStop:()=>!1})]})]}),(0,O.jsx)(j,{menu:s,onClose:Q,onReply:Z}),(0,O.jsx)(p,{state:D,onResolve:A})]})}function K(e){let[t,n]=(0,T.useState)(``),r=e.agentConversation,i=(0,T.useRef)(null),o=(0,T.useRef)(null),c=(0,T.useRef)(null),l=r.messages.at(-1)?.sequence??0,u=[`pending`,`queued`,`running`].includes(r.run.status);(0,T.useEffect)(()=>{let e=i.current;e&&(e.scrollTop=e.scrollHeight)},[l,r.run.status]),(0,T.useEffect)(()=>{o.current?.focus();let t=t=>{t.key===`Escape`&&(t.preventDefault(),e.onCloseAgentConversation())};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e.onCloseAgentConversation]);async function d(r){let i=c.current??crypto.randomUUID();c.current=i;let a=await e.onSendAgentTurn({body:r??t,clientRequestId:i});return a&&(c.current=null,n(``)),a}return(0,O.jsxs)(`aside`,{className:`workspace-diff-panel team-ai-thread-panel`,"aria-label":`${r.agent.name} run`,children:[e.onResizeStart?(0,O.jsx)(`div`,{className:`workspace-diff-resize-handle`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize agent run panel`,onPointerDown:e.onResizeStart}):null,(0,O.jsxs)(`header`,{children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(x,{size:15}),(0,O.jsx)(`strong`,{children:r.agent.name}),(0,O.jsx)(`span`,{children:r.run.status})]}),(0,O.jsx)(`button`,{ref:o,type:`button`,className:`team-chat-icon-button`,"aria-label":`Close agent run`,onClick:e.onCloseAgentConversation,children:(0,O.jsx)(s,{size:16})})]}),(0,O.jsxs)(`div`,{className:`team-ai-thread-messages`,ref:i,role:`log`,"aria-live":`polite`,"aria-relevant":`additions text`,tabIndex:0,children:[r.messages.map(t=>(0,O.jsxs)(`article`,{className:`team-ai-message ${t.role}`,children:[(0,O.jsxs)(`div`,{className:`team-ai-message-author`,children:[t.role===`assistant`?(0,O.jsx)(x,{size:14}):null,(0,O.jsx)(`strong`,{children:t.role===`user`?`Team member`:r.agent.name})]}),(0,O.jsx)(a,{connection:e.connection,content:t.body})]},t.id)),r.messages.length===0?(0,O.jsx)(`div`,{className:`team-chat-empty`,children:`The agent run is starting.`}):null]}),(0,O.jsx)(`div`,{className:`team-ai-thread-composer`,children:(0,O.jsx)(C,{mode:`dock`,surface:`team`,teamUseModel:!1,teamUseModelLocked:!0,prompt:t,contextWindowStatus:e.contextWindowStatus,busy:e.busy||u,running:u,submissionScopeKey:`team-agent:${r.conversationId}`,showProjectFooter:!1,connection:e.connection,providerSettings:e.providerSettings,provider:e.provider,model:e.model,projectTarget:B,workspaceTarget:V,codexPermissionMode:e.codexPermissionMode,codexReasoningEffort:e.codexReasoningEffort,openPondCommandAccessMode:e.openPondCommandAccessMode,onProviderChange:e.onProviderChange,onProviderSetupOpen:e.onOpenProviderSettings,onProjectTargetChange:()=>void 0,onWorkspaceTargetChange:()=>void 0,onModelChange:e.onModelChange,onCodexPermissionModeChange:e.onCodexPermissionModeChange,onCodexReasoningEffortChange:e.onCodexReasoningEffortChange,onOpenPondCommandAccessModeChange:e.onOpenPondCommandAccessModeChange,onPromptChange:e=>{c.current=null,n(e)},showToast:e.showToast,onSubmit:async(e,t,n,r)=>d(r?.promptOverride),onStop:()=>!1})})]})}function q(e){let[t,n]=(0,T.useState)(``),r=e.aiThread,i=new Map(e.members.map(e=>[e.userId,e])),o=r.turns.at(-1)??null,c=(0,T.useRef)(null),l=r.messages.at(-1)?.sequence??0,u=(0,T.useRef)(null),f=H.has(e.provider)?e.provider:`codex`,p=f===e.provider?e.model:`gpt-5.6-sol`,m=!(!r.activeTurn||r.activeTurn.status!==`pending`&&r.activeTurn.status!==`running`);(0,T.useEffect)(()=>{let e=c.current;e&&(e.scrollTop=e.scrollHeight)},[l,r.activeTurn?.partialBody]),(0,T.useEffect)(()=>{u.current?.focus();let t=t=>{t.key===`Escape`&&(t.preventDefault(),e.onCloseAiThread())};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e.onCloseAiThread]);async function h(r){let i=await e.onSendAiTurn({body:r??t,providerId:f,modelId:p});return i&&n(``),i}return(0,O.jsxs)(`aside`,{className:`workspace-diff-panel team-ai-thread-panel`,"aria-label":`AI thread`,children:[e.onResizeStart?(0,O.jsx)(`div`,{className:`workspace-diff-resize-handle`,role:`separator`,"aria-label":`Resize AI thread panel`,"aria-orientation":`vertical`,onPointerDown:e.onResizeStart}):null,(0,O.jsxs)(`header`,{children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(d,{size:15}),(0,O.jsx)(`strong`,{children:`AI thread`}),(0,O.jsxs)(`span`,{children:[r.messages.length,` messages`]})]}),(0,O.jsx)(`button`,{ref:u,type:`button`,className:`team-chat-icon-button`,"data-tooltip":`Close thread`,"aria-label":`Close thread`,onClick:e.onCloseAiThread,children:(0,O.jsx)(s,{size:16})})]}),(0,O.jsxs)(`div`,{className:`team-ai-thread-messages`,ref:c,role:`log`,"aria-live":`polite`,"aria-relevant":`additions text`,tabIndex:0,children:[r.messages.map(t=>(0,O.jsxs)(`article`,{className:`team-ai-message ${t.role}`,children:[(0,O.jsxs)(`div`,{className:`team-ai-message-author`,children:[t.role===`assistant`?(0,O.jsx)(x,{size:14}):null,(0,O.jsx)(`strong`,{children:t.role===`assistant`?`Model`:t.createdByUserId?i.get(t.createdByUserId)?.name??`Team member`:`Team member`})]}),(0,O.jsx)(a,{connection:e.connection,content:t.body})]},t.id)),r.activeTurn?.partialBody?(0,O.jsxs)(`article`,{className:`team-ai-message assistant streaming`,children:[(0,O.jsxs)(`div`,{className:`team-ai-message-author`,children:[(0,O.jsx)(x,{size:14}),(0,O.jsx)(`strong`,{children:`Model`}),(0,O.jsx)(`span`,{children:r.activeTurn.status})]}),(0,O.jsx)(a,{connection:e.connection,content:r.activeTurn.partialBody})]}):r.activeTurn?(0,O.jsx)(`div`,{className:`team-ai-running`,children:r.activeTurn.status===`pending`?`Starting model...`:`Model is responding...`}):o&&[`failed`,`interrupted`,`cancelled`].includes(o.status)?(0,O.jsx)(`div`,{className:`team-ai-turn-state ${o.status}`,children:o.status===`failed`?`Model response failed`:o.status===`interrupted`?`Model response was interrupted`:`Model response was cancelled`}):null]}),(0,O.jsx)(`div`,{className:`team-ai-thread-composer`,children:(0,O.jsx)(C,{mode:`dock`,surface:`team`,teamUseModel:!0,teamUseModelLocked:!0,prompt:t,contextWindowStatus:e.contextWindowStatus,busy:m,running:m,submissionScopeKey:`team-ai:${r.conversationId}`,showProjectFooter:!1,connection:e.connection,providerSettings:e.providerSettings,provider:f,model:p,projectTarget:B,workspaceTarget:V,codexPermissionMode:e.codexPermissionMode,codexReasoningEffort:e.codexReasoningEffort,openPondCommandAccessMode:e.openPondCommandAccessMode,onProviderChange:e.onProviderChange,onProviderSetupOpen:e.onOpenProviderSettings,onProjectTargetChange:()=>void 0,onWorkspaceTargetChange:()=>void 0,onModelChange:e.onModelChange,onCodexPermissionModeChange:e.onCodexPermissionModeChange,onCodexReasoningEffortChange:e.onCodexReasoningEffortChange,onOpenPondCommandAccessModeChange:e.onOpenPondCommandAccessModeChange,onPromptChange:n,showToast:e.showToast,onSubmit:async(e,t,n,r)=>h(r?.promptOverride),onStop:e.onStopAiTurn})})]})}export{K as TeamAgentConversationPanel,q as TeamAiThreadPanel,W as TeamChatProView,G as TeamChatView};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-DYrLeSyY.js";import"./icons-CK5-nxVC.js";import{t as r}from"./loader-circle-cyf35w3i.js";import{t as i}from"./x-IPhrr4ju.js";import{cn as a,fn as o,mn as s}from"./App-DHJVXTI2.js";import"./MainPane-2dj6Dg4l.js";var c=e(t(),1),l=n();function u({creation:e,training:t,compact:n=!1,onOpenTraining:u}){let[d,h]=(0,c.useState)(``),[g,_]=(0,c.useState)(``),v=e.state,y=!!t.busyAction;return(0,c.useEffect)(()=>{h(``),_(``)},[e.id,v]),(0,l.jsxs)(`section`,{className:n?`composer-create-strip ${m(v)} training-create-strip`:`training-approval`,"aria-label":`Training task status`,children:[n?(0,l.jsxs)(`div`,{className:`composer-create-strip-heading`,children:[v===`planning`||v===`materializing`||v===`validating`?(0,l.jsx)(r,{className:`composer-create-spin`,size:15}):v===`failed`?(0,l.jsx)(o,{size:15}):(0,l.jsx)(a,{size:15}),(0,l.jsx)(`span`,{children:f(v)}),(0,l.jsx)(`small`,{children:`training`})]}):null,v===`awaiting_disclosure_approval`?(0,l.jsxs)(`div`,{className:n?`composer-create-plan-summary`:`training-creation-content`,children:[n?null:(0,l.jsx)(`strong`,{children:`Review selected evidence with the authoring model?`}),(0,l.jsxs)(`p`,{children:[`Approve sends excerpts from `,e.request.sourceIds.length,` explicitly selected source`,e.request.sourceIds.length===1?``:`s`,` to `,e.request.analysisModel?.providerId,`/`,e.request.analysisModel?.modelId,` so it can propose a Taskset and grader. This does not start training.`]}),(0,l.jsxs)(`div`,{className:n?`composer-create-actions`:`training-inline-actions`,children:[(0,l.jsxs)(`button`,{className:n?void 0:`training-button`,disabled:y,onClick:()=>void t.actions.approveDisclosure(e.id,!0),children:[(0,l.jsx)(s,{size:13}),(0,l.jsx)(`span`,{children:`Approve evidence`})]}),(0,l.jsxs)(`button`,{className:n?void 0:`training-button secondary`,disabled:y,onClick:()=>void t.actions.approveDisclosure(e.id,!1),children:[(0,l.jsx)(i,{size:13}),(0,l.jsx)(`span`,{children:`Decline`})]}),n&&u?(0,l.jsxs)(`button`,{disabled:y,onClick:u,children:[(0,l.jsx)(a,{size:13}),(0,l.jsx)(`span`,{children:`Open Training`})]}):null]})]}):v===`awaiting_materialization_approval`&&e.proposal?(0,l.jsxs)(`div`,{className:n?`composer-create-plan-summary`:`training-creation-content`,children:[n?null:(0,l.jsx)(`strong`,{children:e.proposal.name}),(0,l.jsx)(`p`,{children:e.proposal.objective}),(0,l.jsxs)(`div`,{className:`training-creation-plan-facts`,children:[(0,l.jsx)(`span`,{children:e.proposal.taskKind.replaceAll(`_`,` `)}),(0,l.jsxs)(`span`,{children:[e.proposal.proposedGraders.length,` grader`,e.proposal.proposedGraders.length===1?``:`s`]}),(0,l.jsx)(`span`,{children:e.proposal.proposedMethod.replaceAll(`_`,` `)})]}),e.request.mode===`customize`?(0,l.jsxs)(`div`,{className:`training-question-answer`,children:[(0,l.jsx)(`input`,{value:g,onChange:e=>_(e.target.value),placeholder:`Revise tasks, graders, fixtures, or policy`}),(0,l.jsx)(`button`,{className:n?void 0:`training-button secondary`,disabled:!g.trim()||y,onClick:async()=>{let n=g;_(``),await t.actions.chatCreation(e.id,n)},children:`Revise`})]}):null,(0,l.jsxs)(`div`,{className:n?`composer-create-actions`:`training-inline-actions`,children:[(0,l.jsxs)(`button`,{className:n?void 0:`training-button`,disabled:y,onClick:()=>void t.actions.materialize(e.id,!0),children:[(0,l.jsx)(s,{size:13}),(0,l.jsx)(`span`,{children:`Materialize Taskset`})]}),u?(0,l.jsxs)(`button`,{className:n?void 0:`training-button secondary`,disabled:y,onClick:u,children:[(0,l.jsx)(a,{size:13}),(0,l.jsx)(`span`,{children:`Review details`})]}):null,(0,l.jsxs)(`button`,{className:n?void 0:`training-button secondary`,disabled:y,onClick:()=>void t.actions.materialize(e.id,!1),children:[(0,l.jsx)(i,{size:13}),(0,l.jsx)(`span`,{children:`Cancel`})]})]})]}):v===`awaiting_questions`?(0,l.jsx)(`div`,{className:n?`composer-create-question`:`training-creation-content`,children:(()=>{let r=e.blockingQuestions.find(e=>!e.answer);return r?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`p`,{children:r.prompt}),(0,l.jsxs)(`div`,{className:`training-question-answer`,children:[(0,l.jsx)(`input`,{value:d,onChange:e=>h(e.target.value)}),(0,l.jsx)(`button`,{className:n?void 0:`training-button`,disabled:!d.trim()||y,onClick:()=>void t.actions.answerQuestions(e.id,{[r.id]:d}),children:`Continue`})]})]}):null})()}):(0,l.jsxs)(`div`,{className:n?`composer-create-status-body`:`training-creation-content`,children:[(0,l.jsx)(`p`,{children:p(e)}),n&&u?(0,l.jsx)(`div`,{className:`composer-create-actions`,children:(0,l.jsxs)(`button`,{onClick:u,children:[(0,l.jsx)(a,{size:13}),(0,l.jsx)(`span`,{children:`Open Training`})]})}):null]})]})}function d({creation:e}){return(0,l.jsxs)(`section`,{className:`chat-create-receipt`,"aria-label":`Training status`,children:[(0,l.jsxs)(`div`,{className:`chat-create-receipt-heading`,children:[(0,l.jsx)(a,{size:14}),(0,l.jsx)(`span`,{children:f(e.state)}),(0,l.jsx)(`small`,{children:`training`})]}),(0,l.jsx)(`p`,{children:e.request.objective??p(e)}),(0,l.jsxs)(`div`,{className:`chat-create-receipt-facts`,children:[(0,l.jsxs)(`span`,{children:[e.request.sourceIds.length,` selected source`,e.request.sourceIds.length===1?``:`s`]}),(0,l.jsx)(`span`,{children:e.request.mode===`customize`?`guided plan`:`fast draft`})]})]})}function f(e){return e===`awaiting_disclosure_approval`?`Training evidence review`:e===`awaiting_materialization_approval`?`Training plan ready`:e===`awaiting_questions`?`Training question`:e===`materializing`?`Materializing Taskset`:e===`ready`?`Taskset ready`:e===`failed`?`Training plan failed`:e===`cancelled`?`Training plan cancelled`:`Preparing training plan`}function p(e){return e.blockedReason?e.blockedReason:e.state===`ready`?`The reviewed Taskset was materialized. Training still requires a separate approval.`:e.state===`cancelled`?`Taskset creation was cancelled.`:e.state===`planning`?`The authoring model is proposing tasks, graders, fixtures, and policy boundaries.`:`Task Creator is ${e.state.replaceAll(`_`,` `)}.`}function m(e){return e===`ready`?`success`:e===`failed`||e===`cancelled`?`danger`:e===`awaiting_disclosure_approval`||e===`awaiting_materialization_approval`||e===`awaiting_questions`?`warning`:`info`}export{u as TrainingCreationPanel,d as TrainingStatusReceipt};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-DYrLeSyY.js";import{At as r,Bt as i,C as a,D as o,Dt as s,F as c,Ht as l,It as u,K as d,Mt as f,Ot as p,P as m,Q as h,R as g,Rt as _,S as v,St as y,T as b,Tt as x,Vt as S,W as C,X as w,_ as T,_t as E,a as ee,at as D,b as te,c as ne,ct as O,d as re,dt as k,f as ie,ft as ae,g as oe,h as se,i as ce,j as A,l as le,n as ue,nt as j,o as de,p as fe,q as pe,r as me,s as he,t as ge,tt as _e,u as ve,ut as M,v as ye,w as be,x as xe,xt as N,yt as P,zt as Se}from"./CartesianChart-CEbM980A.js";import{Bt as Ce}from"./App-DHJVXTI2.js";var F=e(t());function I(){return I=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},I.apply(null,arguments)}var L=e=>{var t=e.cx,n=e.cy,r=e.r,a=e.className,o=l(`recharts-dot`,a);return p(t)&&p(n)&&p(r)?F.createElement(`circle`,I({},i(e),y(e),{className:o,cx:t,cy:n,r})):null},we=[`points`];function R(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function z(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?R(Object(n),!0).forEach(function(t){Te(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Te(e,t,n){return(t=Ee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ee(e){var t=De(e,`string`);return typeof t==`symbol`?t:t+``}function De(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function B(){return B=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},B.apply(null,arguments)}function Oe(e,t){if(e==null)return{};var n,r,i=ke(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ke(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Ae(e){var t=e.option,n=e.dotProps,r=e.className;if((0,F.isValidElement)(t))return(0,F.cloneElement)(t,n);if(typeof t==`function`)return t(n);var i=l(r,typeof t==`boolean`?``:t.className),a=n??{};a.points;var o=Oe(a,we);return F.createElement(L,B({},o,{className:i}))}function je(e,t){return e==null?!1:t?!0:e.length===1}function Me(e){var t=e.points,n=e.dot,r=e.className,i=e.dotClassName,a=e.dataKey,o=e.baseProps,s=e.needClip,c=e.clipPathId,l=e.zIndex,d=l===void 0?g.scatter:l;if(!je(t,n))return null;var f=te(n),p=Se(n),m=t.map((e,r)=>{var s=z(z(z({r:3},o),p),{},{index:r,cx:e.x??void 0,cy:e.y??void 0,dataKey:a,value:e.value,payload:e.payload,points:t});return F.createElement(Ae,{key:`dot-${r}`,option:n,dotProps:s,className:i})}),h={};return s&&c!=null&&(h.clipPath=`url(#clipPath-${f?``:`dots-`}${c})`),F.createElement(b,{zIndex:d},F.createElement(u,B({className:r},h),m))}function V(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?V(Object(n),!0).forEach(function(t){Ne(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ne(e,t,n){return(t=Pe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pe(e){var t=Fe(e,`string`);return typeof t==`symbol`?t:t+``}function Fe(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Ie=e=>{var t=e.point,n=e.childIndex,r=e.mainColor,i=e.activeDot,a=e.dataKey,o=e.clipPath;if(i===!1||t.x==null||t.y==null)return null;var s=H(H(H({},{index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??`none`,strokeWidth:2,stroke:`#fff`,payload:t.payload,value:t.value}),S(i)),y(i)),c=(0,F.isValidElement)(i)?(0,F.cloneElement)(i,s):typeof i==`function`?i(s):F.createElement(L,s);return F.createElement(u,{className:`recharts-active-dot`,clipPath:o},c)};function Le(e){var t=e.points,n=e.mainColor,r=e.activeDot,i=e.itemDataKey,a=e.clipPath,c=e.zIndex,l=c===void 0?g.activeDot:c,u=P(o),d=ne();if(t==null||d==null)return null;var f=t.find(e=>d.includes(e.payload));return s(f)?null:F.createElement(b,{zIndex:l},F.createElement(Ie,{point:f,childIndex:Number(u),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var Re=[`animationElapsedTime`,`isAnimating`,`isEntrance`,`visibleLength`,`strokeDasharray`,`connectNulls`];function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},U.apply(null,arguments)}function ze(e,t){if(e==null)return{};var n,r,i=Be(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Be(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Ve(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function W(e,t){return`${t}px ${e}px`}function He(e){return e.length%2==0?e:[...e,...e]}function Ue(e,t){for(var n=[],r=0;r<t;++r)n.push(...e);return n}function We(e,t,n){var r=He(n),i=r.reduce((e,t)=>e+t,0);if(!i)return W(t,e);for(var a=Math.floor(e/i),o=e%i,s=[],c=0,l=0;c<r.length;l+=(u=r[c])??0,++c){var u,d=r[c];if(d!=null&&l+d>o){s=[...r.slice(0,c),o-l];break}}var f=s.length%2==0?[0,t]:[t];return[...Ue(r,a),...s,...f].map(e=>`${e}px`).join(`, `)}function Ge(e,t,n){return e?We(n,t,`${e}`.split(/[,\s]+/gim).map(e=>parseFloat(e))):W(t,n)}function Ke(e){e.animationElapsedTime,e.isAnimating,e.isEntrance;var t=e.visibleLength,n=e.strokeDasharray,r=e.connectNulls,i=ze(e,Re),a=r??!1,o;if(t!=null){var s=i.pathRef;o=Ge(n,Ve(s?.current??null),t)}else n!=null&&(o=String(n));return F.createElement(d,U({},i,{connectNulls:a,strokeDasharray:o}))}function qe(e){var t=(0,F.useRef)(0),n=(0,F.useRef)(0),r=(0,F.useRef)(!1),i=(0,F.useRef)(e);return i.current!==e&&(t.current=n.current,i.current=e),(0,F.useCallback)((e,i)=>{if(r.current)return null;var a=Math.min(f(t.current+e*i),i);return e>0&&i>0&&(n.current=Math.max(n.current,a),a>=i)?(r.current=!0,null):a},[])}var G=(e,t,n,r)=>A(e,`xAxis`,t,r),K=(e,t,n,r)=>m(e,`xAxis`,t,r),q=(e,t,n,r)=>A(e,`yAxis`,n,r),Je=(e,t,n,r)=>m(e,`yAxis`,n,r),Ye=E([w,G,q,K,Je],(e,t,n,r,i)=>ae(e,`xAxis`)?D(t,r,!1):D(n,i,!1)),Xe=(e,t,n,r,i)=>i;function Ze(e){return e.type===`line`}var Qe=E([c,Xe],(e,t)=>e.filter(Ze).find(e=>e.id===t)),$e=E([w,G,q,K,Je,Qe,Ye,C],(e,t,n,r,i,a,o,s)=>{var c=s.chartData,l=s.dataStartIndex,u=s.dataEndIndex;if(!(a==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||o==null||e!==`horizontal`&&e!==`vertical`)){var d=a.dataKey,f=a.data,p=f!=null&&f.length>0?f:c?.slice(l,u+1);if(p!=null)return xt({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:d,bandSize:o,displayedData:p})}});function et(e){var t=S(e),n=3,r=2;if(t!=null){var i=t.r,a=t.strokeWidth,o=Number(i),s=Number(a);return(Number.isNaN(o)||o<0)&&(o=n),(Number.isNaN(s)||s<0)&&(s=r),{r:o,strokeWidth:s}}return{r:n,strokeWidth:r}}var tt=[`id`],nt=[`type`,`layout`,`connectNulls`,`needClip`,`shape`,`strokeDasharray`],rt=[`activeDot`,`animateNewValues`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`hide`,`isAnimationActive`,`label`,`legendType`,`xAxisId`,`yAxisId`,`id`];function J(){return J=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},J.apply(null,arguments)}function Y(e,t){if(e==null)return{};var n,r,i=it(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function it(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function at(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function X(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?at(Object(n),!0).forEach(function(t){ot(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):at(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ot(e,t,n){return(t=st(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function st(e){var t=ct(e,`string`);return typeof t==`symbol`?t:t+``}function ct(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function lt(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function ut(e){var t=0,n=0;for(var r of e)r.status===`matched`&&r.prev.x!=null&&r.next.x!=null&&(t+=r.next.x-r.prev.x,n++);return n>0?t/n:0}var Z={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,animationInterpolateFn:(e,t)=>{if(e==null)return[];if(t===1)return e.flatMap(e=>e.status===`removed`?[]:[e.next]);var n=ut(e),r=[];for(var i of e)if(i.status===`matched`)r.push(X(X({},i.next),{},{x:x(i.prev.x,i.next.x,t),y:x(i.prev.y,i.next.y,t)}));else if(i.status===`added`){if(i.next.x!=null){var a=i.next.x-n;r.push(X(X({},i.next),{},{x:x(a,i.next.x,t),y:i.next.y}))}else r.push(i.next)}else if(i.status===`removed`&&i.prev.x!=null){var o=i.prev.x+n;r.push(X(X({},i.prev),{},{x:x(i.prev.x,o,t),y:i.prev.y}))}return r},animationMatchBy:se,connectNulls:!1,dot:!0,fill:`#fff`,hide:!1,isAnimationActive:`auto`,label:!1,legendType:`line`,shape:Ke,stroke:`#3182bd`,strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:g.line,type:`linear`},dt=e=>{var t=e.dataKey,n=e.name,r=e.stroke,i=e.legendType;return[{inactive:e.hide,dataKey:t,type:i,color:r,value:M(n,t),payload:e}]},ft=F.memo(e=>{var t=e.dataKey,n=e.data,i=e.stroke,a=e.strokeWidth,o=e.fill,s=e.name,c=e.hide,l=e.unit,u=e.formatter,d=e.tooltipType,f=e.id,p={dataDefinedOnItem:n,getPosition:r,settings:{stroke:i,strokeWidth:a,fill:o,dataKey:t,nameKey:void 0,name:M(s,t),hide:c,type:d,color:i,unit:l,formatter:u,graphicalItemId:f}};return F.createElement(T,{tooltipEntrySettings:p})});function pt(e){var t=e.clipPathId,n=e.points,r=e.props,a=r.dot,o=r.dataKey,s=r.needClip;r.id;var c=Y(r,tt),l=i(c);return F.createElement(Me,{points:n,dot:a,className:`recharts-line-dots`,dotClassName:`recharts-line-dot`,dataKey:o,baseProps:l,needClip:s,clipPathId:t})}function mt(e){var t=e.showLabels,n=e.children,r=e.points,i=(0,F.useMemo)(()=>r?.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return X(X({},t),{},{value:e.value,payload:e.payload,viewBox:t,parentViewBox:void 0,fill:void 0})}),[r]);return F.createElement(xe,{value:t?i:void 0},n)}function ht(e){var t=e.clipPathId,n=e.pathRef,r=e.points,i=e.props,a=e.animationElapsedTime,o=e.isAnimating,s=e.isEntrance,c=e.visibleLength,l=i.type,u=i.layout,d=i.connectNulls,f=i.needClip,p=i.shape,m=i.strokeDasharray,h=Y(i,nt),g=X(X({},_(h)),{},{fill:`none`,className:`recharts-line-curve`,clipPath:f?`url(#clipPath-${t})`:void 0,points:r,type:l,layout:u,connectNulls:d,strokeDasharray:m??i.strokeDasharray,pathRef:n,animationElapsedTime:a,isAnimating:o,isEntrance:i.animateNewValues?s:!1,visibleLength:c});return F.createElement(F.Fragment,null,r?.length>1&&F.createElement(ye,{option:p,DefaultShape:Z.shape,shapeProps:g}),F.createElement(pt,{points:r,clipPathId:t,props:i}))}function gt(e){var t=e.clipPathId,n=e.props,r=e.pathRef,i=e.previousPointsRef,a=n.points,o=n.isAnimationActive,s=n.animationBegin,c=n.animationDuration,l=n.animationEasing,u=n.animationMatchBy,d=n.animationInterpolateFn,f=n.layout,p=lt(r.current),m=fe(n.onAnimationStart,n.onAnimationEnd),h=m.isAnimating,g=m.handleAnimationStart,_=m.handleAnimationEnd,y=!h,b=qe(a),x=(0,F.useCallback)(e=>e>0&&p>0,[p]);return F.createElement(mt,{points:a,showLabels:y},n.children,F.createElement(ie,{animationInput:a,animationIdPrefix:`recharts-line-`,items:a,previousItemsRef:i,isAnimationActive:o,animationBegin:s,animationDuration:c,animationEasing:l,onAnimationStart:g,onAnimationEnd:_,animationInterpolateFn:d,animationMatchBy:u,shouldUpdatePreviousRef:x,layout:f},(e,i,a)=>{var o=h||i<1,s=o?b(i,p):null;return F.createElement(ht,{props:n,points:e,clipPathId:t,pathRef:r,animationElapsedTime:i,isAnimating:o,isEntrance:a,visibleLength:s})}),F.createElement(v,{label:n.label}))}function _t(e){var t=e.clipPathId,n=e.props,r=(0,F.useRef)(null),i=(0,F.useRef)(null);return F.createElement(gt,{props:n,clipPathId:t,previousPointsRef:r,pathRef:i})}var vt=(e,t)=>({x:e.x??void 0,y:e.y??void 0,value:e.value,errorVal:k(e.payload,t)}),yt=class extends F.Component{render(){var e=this.props,t=e.hide,n=e.dot,r=e.points,i=e.className,a=e.xAxisId,o=e.yAxisId,s=e.top,c=e.left,d=e.width,f=e.height,p=e.id,m=e.needClip,h=e.zIndex;if(t)return null;var g=l(`recharts-line`,i),_=p,v=et(n),y=v.r,x=v.strokeWidth,S=te(n),C=y*2+x,w=m?`url(#clipPath-${S?``:`dots-`}${_})`:void 0;return F.createElement(b,{zIndex:h},F.createElement(u,{className:g},m&&F.createElement(`defs`,null,F.createElement(ce,{clipPathId:_,xAxisId:a,yAxisId:o}),!S&&F.createElement(`clipPath`,{id:`clipPath-dots-${_}`},F.createElement(`rect`,{x:c-C/2,y:s-C/2,width:d+C,height:f+C}))),F.createElement(de,{xAxisId:a,yAxisId:o,data:r,dataPointFormatter:vt,errorBarOffset:0},F.createElement(_t,{props:this.props,clipPathId:_}))),F.createElement(Le,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:w}))}};function bt(e){var t=N(e,Z),n=t.activeDot,r=t.animateNewValues,i=t.animationBegin,a=t.animationDuration,o=t.animationEasing,s=t.connectNulls,c=t.dot,l=t.hide,u=t.isAnimationActive,d=t.label,f=t.legendType,p=t.xAxisId,m=t.yAxisId,g=t.id,_=Y(t,rt),v=ee(p,m).needClip,y=le(),b=h(),x=j(),S=P(e=>$e(e,p,m,x,g));if(b!==`horizontal`&&b!==`vertical`||S==null||y==null)return null;var C=y.height,w=y.width,T=y.x,E=y.y;return F.createElement(yt,J({},_,{id:g,connectNulls:s,dot:c,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,isAnimationActive:u,hide:l,label:d,legendType:f,xAxisId:p,yAxisId:m,points:S,layout:b,height:C,width:w,left:T,top:E,needClip:v}))}function xt(e){var t=e.layout,n=e.xAxis,r=e.yAxis,i=e.xAxisTicks,a=e.yAxisTicks,o=e.dataKey,c=e.bandSize;return e.displayedData.map((e,l)=>{var u=k(e,o);if(t===`horizontal`)return{x:O({axis:n,ticks:i,bandSize:c,entry:e,index:l}),y:(s(u)?null:r.scale.map(u))??null,value:u,payload:e};var d=s(u)?null:n.scale.map(u),f=O({axis:r,ticks:a,bandSize:c,entry:e,index:l});return d==null||f==null?null:{x:d,y:f,value:u,payload:e}}).filter(Boolean)}function St(e){var t=N(e,Z),n=j();return F.createElement(re,{id:t.id,type:`line`},e=>F.createElement(F.Fragment,null,F.createElement(oe,{legendPayload:dt(t)}),F.createElement(ft,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:e}),F.createElement(ve,{type:`line`,id:e,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),F.createElement(bt,J({},t,{id:e}))))}var Ct=F.memo(St,pe);Ct.displayName=`Line`;var wt=[`axis`],Tt=(0,F.forwardRef)((e,t)=>F.createElement(ge,{chartName:`LineChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:wt,tooltipPayloadSearcher:be,categoricalChartProps:e,ref:t})),Q=n(),Et=[{id:`optimizer.reward`,label:`Mean reward`,points:[]},{id:`reward.variance`,label:`Reward variance`,points:[]},{id:`optimizer.kl`,label:`Policy update KL`,points:[]},{id:`optimizer.policy_loss`,label:`Policy loss`,points:[]},{id:`optimizer.learning_rate`,label:`Learning rate`,points:[],format:`scientific`}];function Dt({series:e,loading:t=!1,live:n=!1}){let[r,i]=(0,F.useState)(`raw`),a=(0,F.useMemo)(()=>{let r=e.filter(e=>e.points.length);if(!t&&!n)return r;let i=new Map(r.map(e=>[e.id,e]));for(let e of Et)i.has(e.id)||i.set(e.id,e);return[...i.values()]},[n,t,e]),o=a.some(e=>e.points.length>1);return a.length?(0,Q.jsxs)(`section`,{className:`training-metric-workbench`,"aria-label":`Training metrics`,children:[o?(0,Q.jsx)(`div`,{className:`training-metric-workbench-controls`,children:(0,Q.jsx)(Ce,{compact:!0,floating:!0,label:`Metric display`,value:r,options:[{value:`raw`,label:`Raw values`},{value:`smoothed`,label:`Smoothed trend`}],onChange:e=>i(e)})}):null,(0,Q.jsx)(`div`,{className:`training-metric-chart-grid`,children:a.map(e=>(0,Q.jsx)(Ot,{display:r,loading:t&&!e.points.length,metric:e,pending:n&&!e.points.length},e.id))})]}):(0,Q.jsx)(`div`,{className:`training-run-placeholder`,children:`This run did not report chartable metrics.`})}var Ot=(0,F.memo)(function({metric:e,display:t,loading:n,pending:r}){let i=(0,F.useMemo)(()=>t===`smoothed`?jt(e.points,3):e.points,[t,e.points]),o=(0,F.useMemo)(()=>e.points.length?Mt(e.points.map(e=>e.value)):null,[e.points]),s=t=>Nt(t,e.format),c=e.xLabel??`training step`;return(0,Q.jsxs)(`article`,{className:`training-metric-chart-card`,children:[(0,Q.jsxs)(`header`,{children:[(0,Q.jsxs)(`div`,{className:`training-metric-chart-title`,children:[(0,Q.jsx)(`h4`,{children:e.label}),(0,Q.jsx)(`span`,{children:e.points.length?`${e.points.length} ${e.points.length===1?`point`:`points`}`:r?`Live`:`No data`})]}),(0,Q.jsx)(`div`,{className:`training-metric-chart-header-actions`,children:o?(0,Q.jsx)(`strong`,{children:s(o.latest)}):null})]}),e.points.length?(0,Q.jsx)(`div`,{className:`training-metric-card-chart`,"aria-label":`${e.label} by ${c}`,children:(0,Q.jsx)(_e,{height:`100%`,width:`100%`,children:(0,Q.jsxs)(Tt,{data:i,margin:{top:18,right:18,bottom:4,left:0},children:[(0,Q.jsx)(he,{stroke:`var(--border-default)`,strokeDasharray:`3 4`,vertical:!1}),(0,Q.jsx)(me,{axisLine:!1,dataKey:`step`,fontSize:10,stroke:`var(--text-muted)`,tickLine:!1}),(0,Q.jsx)(ue,{axisLine:!1,dataKey:`value`,domain:e.bounds??(e.format===`percent`?[0,1]:[`auto`,`auto`]),fontSize:10,stroke:`var(--text-muted)`,tickFormatter:s,tickLine:!1,width:66}),(0,Q.jsx)(a,{content:t=>(0,Q.jsx)(kt,{active:t.active,format:s,label:e.label,payload:t.payload,xLabel:c}),isAnimationActive:!1}),(0,Q.jsx)(Ct,{activeDot:{fill:`var(--accent-primary)`,r:5},dataKey:`value`,dot:{fill:`var(--accent-primary)`,r:2.5},isAnimationActive:!1,stroke:`var(--accent-primary)`,strokeWidth:2,type:`monotone`})]})})}):(0,Q.jsxs)(`div`,{className:n?`training-metric-chart-empty is-loading`:`training-metric-chart-empty`,children:[n?(0,Q.jsxs)(`span`,{className:`sr-only`,children:[`Loading `,e.label]}):null,n?null:(0,Q.jsx)(`span`,{children:r?`Waiting for rollout…`:`No data reported`})]}),o?(0,Q.jsxs)(`dl`,{className:`training-metric-card-stats`,children:[(0,Q.jsx)($,{label:`Mean`,value:s(o.mean)}),(0,Q.jsx)($,{label:`Min`,value:s(o.min)}),(0,Q.jsx)($,{label:`Max`,value:s(o.max)}),(0,Q.jsx)($,{label:`Std. dev.`,value:s(o.standardDeviation)})]}):null]})});function kt({active:e,payload:t,label:n,format:r,xLabel:i}){if(!e||!t.length)return null;let a=t[0]?.payload;return typeof a?.value==`number`?(0,Q.jsxs)(`div`,{className:`training-chart-tooltip`,children:[(0,Q.jsxs)(`strong`,{children:[At(i),` `,String(a.step??`—`)]}),(0,Q.jsx)(`dl`,{children:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`dt`,{children:n}),(0,Q.jsx)(`dd`,{children:r(a.value)})]})})]}):null}function At(e){return e.replace(/^./,e=>e.toUpperCase())}function $({label:e,value:t}){return(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`dt`,{children:e}),(0,Q.jsx)(`dd`,{children:t})]})}function jt(e,t){return e.map((n,r)=>{let i=e.slice(Math.max(0,r-t+1),r+1);return{step:n.step,value:i.reduce((e,t)=>e+t.value,0)/i.length}})}function Mt(e){let t=[...e].sort((e,t)=>e-t),n=e.reduce((e,t)=>e+t,0)/e.length,r=e.reduce((e,t)=>e+(t-n)**2,0)/e.length;return{latest:e.at(-1),mean:n,min:t[0],max:t.at(-1),standardDeviation:Math.sqrt(r)}}function Nt(e,t=`number`){return t===`percent`?`${(e*100).toFixed(2)}%`:t===`scientific`?e.toExponential(2):Math.abs(e)>=1e3?e.toLocaleString(void 0,{maximumFractionDigits:2}):e.toFixed(4)}export{Dt as t};
@@ -1 +0,0 @@
1
- export{g as WorkSidebarPanel}from"./MainPane-2dj6Dg4l.js";
@@ -1,11 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FilePagePreview-CW4J_1u7.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/index-DYrLeSyY.js","assets/index-Dezj4Z2p.css","assets/icons-CK5-nxVC.js","assets/App-DHJVXTI2.js","assets/useQuery-CPC2wsWm.js","assets/schemas-lO3MoWQr.js","assets/common-BMjyKlX-.js","assets/settings-BKmRueaw.js","assets/client-choice-storage-DTTLbrYt.js","assets/api-client-Dgz-fOMl.js","assets/app-models-BviS9b7U.js","assets/create-pipeline-CyUZrbbO.js","assets/profile-ref-DSNkG6Ol.js","assets/chunk-H3JZ3P5T-B0SCoPw4.js","assets/work-outputs-CK0nHe4g.js","assets/contracts-BHTOD1nd.js","assets/training-managed-adapter-BXNwgd3P.js","assets/chunk-ZFYI4P6C-BmsNtSkR.js","assets/reward-checks-5AOStF27.js","assets/chat-resources-3SvnVeKv.js","assets/ponder-desktop-Dm7tOkKo.js","assets/submit-issue-command-DRgUboVW.js","assets/createLucideIcon-DmttVQ_a.js","assets/connected-app-mentions-D3wRZLwI.js","assets/profile-agent-labels-Duh96b8x.js","assets/browser-sidebar-links-ujSvTf5h.js","assets/browser-url-LACq2Ngu.js","assets/query-scope-BRpcgljO.js","assets/chevron-down-dYn0pd4Q.js","assets/chevron-right-sFx2xRvT.js","assets/copy-DR4ielPn.js","assets/external-link-B4rPiZEp.js","assets/loader-circle-cyf35w3i.js","assets/maximize-2-DgF6ZVOM.js","assets/plus-DoJe4fLj.js","assets/refresh-cw-B53QjxMO.js","assets/square-terminal-Dmgkm5zY.js","assets/x-IPhrr4ju.js","assets/AppToastContext-DZLErwj0.js","assets/models-route-Bl_TmMl6.js","assets/NativeSetupTerminal-CNHTByLo.js","assets/AppDialog-BurL61qE.js","assets/PageChrome-VHME5V8j.js","assets/NativeSetupTerminal-3eR9D_R3.css","assets/organization-types-PP-yuR2J.js","assets/ui-theme.generated-D-mc26qt.js","assets/App-DpFKLxuA.css","assets/WorkspaceMonacoEditor-BJxaiDrj.js","assets/WorkspaceMonacoEditor-C5uazxST.css","assets/WorkspacePresentationPreview-A28Poeca.js","assets/WorkspaceFileLocation-ChEeZffU.js","assets/aiden0z-pptx-renderer.es-Bo43EjzT.js","assets/jszip.min-BWcKrrYP.js"])))=>i.map(i=>d[i]);
2
- import{i as e,n as t}from"./rolldown-runtime-Dd_uD5pT.js";import{g as n,m as r,t as i}from"./index-DYrLeSyY.js";import{t as a}from"./useQuery-CPC2wsWm.js";import{a as o,m as s,o as c,p as l,r as u,v as d}from"./schemas-lO3MoWQr.js";import{n as f,o as p}from"./client-choice-storage-DTTLbrYt.js";import{n as m}from"./app-models-BviS9b7U.js";import{n as h}from"./create-pipeline-CyUZrbbO.js";import{t as g}from"./query-scope-BRpcgljO.js";import"./icons-CK5-nxVC.js";import{t as _}from"./createLucideIcon-DmttVQ_a.js";import{A as v,B as ee,E as te,F as ne,H as y,L as b,M as re,R as x,T as ie,V as ae,_ as oe,a as S,b as C,c as w,f as se,g as ce,h as le,j as ue,m as de,n as fe,o as pe,r as me,s as he,t as ge,v as _e,x as ve,y as ye}from"./training-model-data-14942K_Z.js";import{t as T}from"./folder-open-BrIUcUk_.js";import{t as be}from"./info-aSvM8YlJ.js";import{t as xe}from"./loader-circle-cyf35w3i.js";import{t as Se}from"./maximize-2-DgF6ZVOM.js";import{t as Ce}from"./plus-DoJe4fLj.js";import{t as we}from"./refresh-cw-B53QjxMO.js";import{t as E}from"./save-V1Q4Fcqa.js";import{t as Te}from"./x-IPhrr4ju.js";import{n as Ee,r as De}from"./AppToastContext-DZLErwj0.js";import{$t as Oe,G as D,H as ke,Ht as Ae,J as je,K as Me,R as Ne,U as Pe,V as Fe,W as Ie,Xt as O,Y as Le,Zt as Re,bn as ze,cn as k,en as A,fn as j,ir as Be,k as M,ln as Ve,mn as He,pn as N,q as Ue,qt as We,rn as P,rr as Ge,sn as Ke,wn as F,xn as I,yn as qe,z as Je}from"./App-DHJVXTI2.js";import{n as L,t as R}from"./WorkspaceFileLocation-ChEeZffU.js";var Ye=u([`local`,`sandbox`]),Xe=u([`pinned`,`saved_for_later`]),Ze=s({id:d().min(1),workspaceKind:Ye,workspaceId:d().min(1),workspaceName:d().min(1),path:d().min(1),status:Xe,order:l().int().nonnegative().nullable().default(null),sourceSessionId:d().min(1).nullable().default(null),available:c().default(!0),createdAt:d().min(1),updatedAt:d().min(1)});s({items:o(Ze)}),s({workspaceKind:Ye,workspaceId:d().trim().min(1),workspaceName:d().trim().min(1),path:d().trim().min(1),status:u([`pinned`,`saved_for_later`,`none`]),order:l().int().nonnegative().nullable().optional(),sourceSessionId:d().trim().min(1).nullable().optional()}),u([`pin`,`save_for_later`,`remove`,`list`]);function Qe(e){let t=e.trim().replaceAll(`\\`,`/`);if(t=t.replace(/^(?:workspace|sandbox):file:/,``),t=t.replace(/^\/workspace\/app\//,``),t=t.replace(/^\.\//,``),!t||t.startsWith(`/`))throw Error(`File path must be relative to the workspace.`);let n=t.split(`/`).filter(e=>e&&e!==`.`);if(n.some(e=>e===`..`))throw Error(`File path cannot leave the workspace.`);if(n.length===0)throw Error(`File path is required.`);return n.join(`/`)}function $e(e){return[`sidebar-file`,e.workspaceKind,encodeURIComponent(e.workspaceId),encodeURIComponent(Qe(e.path))].join(`:`)}var et=_(`text-align-start`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]]),tt=_(`chevrons-up`,[[`path`,{d:`m17 11-5-5-5 5`,key:`e8nh98`}],[`path`,{d:`m17 18-5-5-5 5`,key:`2avn1x`}]]),nt=_(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),rt=_(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),it=_(`panel-top`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]),at=_(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),ot=_(`redo-2`,[[`path`,{d:`m15 14 5-5-5-5`,key:`12vg1m`}],[`path`,{d:`M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13`,key:`6uklza`}]]),st=_(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),z=e(n(),1),B=r();function ct({createRuntime:e,goalRuntime:t,subagentRuntime:n=null,onRunSubagentLifecycleAction:r}){let i=e?`Create/Improve Details`:`Goal Details`,a=e?U(e.run.state):n?.activeCount?n.label:t?.actionLabel??`No active goal`;return(0,B.jsxs)(`div`,{className:`goal-details-view`,"aria-label":i,children:[(0,B.jsxs)(`div`,{className:`goal-details-header`,children:[(0,B.jsxs)(`div`,{className:`goal-details-title`,children:[(0,B.jsx)(k,{size:15,"aria-hidden":`true`}),(0,B.jsx)(`span`,{children:i})]}),(0,B.jsx)(`span`,{className:`goal-details-state ${Pt(e?.run.state??null)}`,children:a})]}),(0,B.jsx)(`div`,{className:`goal-details-body`,children:e?(0,B.jsx)(lt,{runtime:e}):t||n?(0,B.jsx)(dt,{goalRuntime:t,subagentRuntime:n,onRunSubagentLifecycleAction:r}):(0,B.jsx)(kt,{})})]})}function lt({runtime:e}){let t=e.run,n=t.plan,r=h(n?.metadata)??h(t.metadata),i=t.questions,a=i.filter(e=>e.status===`pending`),o=t.sourceRefs,s=t.checkRefs,c=t.state,l=t.target.kind===`agent`?t.target.defaultActionKey:null;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(H,{title:`Current Work`,children:(0,B.jsx)(At,{rows:[[`State`,U(c)],[`Operation`,t.operation],[`Target`,U(t.target.kind)],[`Name`,t.target.displayName??t.target.id??`Pending`],[`Target ID`,t.target.id??`Pending`],[`Default action`,l??n?.defaultChatAction.key??`Pending`],[`Adapter`,U(t.adapter.kind)],[`Run`,t.id],[`Revision`,String(t.revision)]]})}),(0,B.jsx)(H,{title:`Plan`,children:n?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{className:`goal-details-summary`,children:n.summary}),(0,B.jsx)(At,{rows:[[`Objective`,n.objective],[`Context`,n.capturedContextSummary],[`Status`,U(n.status)],[`Plan ID`,n.id],[`Run ID`,n.runId],[`Approval`,n.approvalId??`Pending`],[`Approved`,n.approvedAt??`Not approved`]]})]}):a.length?(0,B.jsx)(`p`,{className:`goal-details-summary`,children:`Waiting for answers before the model finalizes the Create plan.`}):(0,B.jsx)(`p`,{className:`goal-details-summary`,children:`The model is preparing the Create plan.`})}),r?(0,B.jsxs)(H,{title:`Action Shape`,children:[(0,B.jsx)(At,{rows:[[`Mode`,r.label],[`Default action`,r.defaultActionKey??`None`],[`Direct action`,r.directActionHint??`None planned`],[`Artifacts`,r.artifactPolicy]]}),(0,B.jsx)(`p`,{className:`goal-details-note`,children:r.detail})]}):null,i.length?(0,B.jsx)(H,{title:`Questions`,children:(0,B.jsx)(`div`,{className:`goal-details-list`,children:i.map(e=>(0,B.jsxs)(`article`,{className:`goal-details-list-item`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:e.title}),(0,B.jsx)(`span`,{className:`goal-details-inline-state ${e.status}`,children:U(e.status)})]}),(0,B.jsx)(`p`,{children:e.prompt}),e.answer?(0,B.jsxs)(`small`,{children:[`Answer: `,e.answer.label??e.answer.value]}):e.options.length?(0,B.jsxs)(`small`,{children:[`Options: `,e.options.map(e=>e.label).join(`, `)]}):null]},e.id))})}):null,n?.requirements.length?(0,B.jsx)(H,{title:`Setup Requirements`,children:(0,B.jsx)(`div`,{className:`goal-details-list`,children:n.requirements.map(e=>(0,B.jsxs)(`article`,{className:`goal-details-list-item`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:e.name}),(0,B.jsx)(`span`,{className:`goal-details-inline-state ${e.status}`,children:U(e.status)})]}),(0,B.jsxs)(`small`,{children:[U(e.kind),e.detail?`: ${e.detail}`:``]})]},`${e.kind}:${e.name}`))})}):null,n?.sourcePlan.length?(0,B.jsx)(H,{title:`Source Plan`,children:(0,B.jsx)(jt,{refs:n.sourcePlan.map(e=>({id:`${e.operation}:${e.path}`,primary:e.path,secondary:`${U(e.operation)}: ${e.reason}`}))})}):null,n?.checks.length?(0,B.jsx)(H,{title:`Checks`,children:(0,B.jsx)(jt,{refs:n.checks.map(e=>({id:e.name,primary:e.name,secondary:`${e.required?`Required`:`Optional`}: ${e.command}`}))})}):null,o.length||s.length?(0,B.jsx)(H,{title:`Run Refs`,children:(0,B.jsx)(jt,{refs:[...o.map(e=>({id:`source:${e}`,primary:e,secondary:`Source ref`})),...s.map(e=>({id:`check:${e}`,primary:e,secondary:`Check ref`}))]})}):null,(0,B.jsx)(ut,{run:t}),t.blockedReason?(0,B.jsx)(H,{title:`Blocked`,children:(0,B.jsxs)(`div`,{className:`goal-details-alert`,children:[(0,B.jsx)(j,{size:15}),(0,B.jsx)(`span`,{children:t.blockedReason})]})}):null,(0,B.jsx)(H,{title:`Raw State`,children:(0,B.jsxs)(`details`,{className:`goal-details-raw`,children:[(0,B.jsx)(`summary`,{children:`Show structured payload`}),(0,B.jsx)(`pre`,{children:JSON.stringify(t,null,2)})]})})]})}function ut({run:e}){let t=[...e.context.attachments.map(e=>({id:`attachment:${e.id??e.name}`,primary:e.name,secondary:e.ref??e.mediaType??`Attachment`})),...e.context.apps.map(e=>({id:`app:${e.id}`,primary:e.name,secondary:e.required?`Required app context`:`Optional app context`})),...e.context.tools.map(e=>({id:`tool:${e.name}`,primary:e.name,secondary:e.outputSummary??e.inputSummary??`Tool context`})),...e.context.targetRepoAssumptions.map(e=>({id:`target:${e}`,primary:e,secondary:`Target assumption`}))],n=e.workflowCapture,r=n?[...n.files.map(e=>({id:`workflow-file:${e}`,primary:e,secondary:`Captured file`})),...n.outputArtifacts.map(e=>({id:`workflow-artifact:${e}`,primary:e,secondary:`Output artifact`})),...n.traceRefs.map(e=>({id:`workflow-trace:${e}`,primary:e,secondary:`Trace`}))]:[];return!t.length&&!r.length?null:(0,B.jsx)(H,{title:`Context`,children:(0,B.jsx)(jt,{refs:[...t,...r]})})}function dt({goalRuntime:e,subagentRuntime:t,onRunSubagentLifecycleAction:n}){return(0,B.jsxs)(B.Fragment,{children:[e?(0,B.jsxs)(H,{title:`Goal`,children:[(0,B.jsx)(`p`,{className:`goal-details-summary`,children:e.objective}),(0,B.jsx)(At,{rows:[[`Status`,e.actionLabel],[`Runtime`,e.timeLabel],[`Detail`,e.detail]]})]}):null,t?(0,B.jsx)(ft,{runtime:t,onRunSubagentLifecycleAction:n}):null,(0,B.jsx)(H,{title:`Raw State`,children:(0,B.jsxs)(`details`,{className:`goal-details-raw`,children:[(0,B.jsx)(`summary`,{children:`Show structured payload`}),(0,B.jsx)(`pre`,{children:JSON.stringify({goalRuntime:e,subagentRuntime:t},null,2)})]})})]})}function ft({runtime:e,onRunSubagentLifecycleAction:t}){let[n,r]=(0,z.useState)(null),[i,a]=(0,z.useState)(null);De(i);let o=async(e,n)=>{if(!t)return;let i=`${e}:${n}`;r(i),a(null);try{await t({runId:e,action:n})}catch(e){a(e instanceof Error?e.message:String(e))}finally{r(e=>e===i?null:e)}};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(H,{title:`Subagents`,children:[(0,B.jsx)(At,{rows:[[`Latest update`,yt(e)],[`Active`,String(e.activeCount)],[`Completed`,String(e.completedCount)],[`Failed`,String(e.failedCount)],[`Cancelled`,String(e.cancelledCount)],[`Paused`,String(e.needsResumeCount)],[`Terminal`,String(e.terminalCount)],[`Usage`,bt(e.usage.totalTokens,e.usage.requestCount)],[`Evidence`,String(e.evidenceRefs.length)],[`Checks`,String(e.testsRunCount)]]}),e.blockers.length>0?(0,B.jsx)(`ul`,{className:`goal-details-list compact`,children:e.blockers.slice(0,4).map(e=>(0,B.jsxs)(`li`,{className:`goal-details-list-item`,children:[(0,B.jsx)(`span`,{className:`goal-details-inline-state ${e.status}`,children:e.status}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:xt(e.roleId)}),(0,B.jsx)(`p`,{children:e.message})]})]},`${e.runId}:${e.message}`))}):null,(0,B.jsx)(`ul`,{className:`goal-details-list`,children:e.runs.slice(0,8).map(e=>(0,B.jsxs)(`li`,{className:`goal-details-list-item`,children:[(0,B.jsx)(`span`,{className:`goal-details-inline-state ${e.status}`,children:e.status}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:xt(e.roleId)}),(0,B.jsx)(`p`,{children:e.objective}),e.report?.summary?(0,B.jsx)(`small`,{children:e.report.summary}):null,t?(0,B.jsx)(V,{pendingAction:n,run:e,onRun:o}):null]})]},e.id))})]}),e.finalResults.length>0?(0,B.jsx)(pt,{results:e.finalResults}):null]})}function pt({results:e}){return(0,B.jsx)(H,{title:`Child Results`,children:(0,B.jsx)(`ol`,{className:`goal-details-task-graph`,children:e.slice(0,6).map(e=>(0,B.jsxs)(`li`,{className:`goal-details-task-node`,children:[(0,B.jsxs)(`div`,{className:`goal-details-task-node-header`,children:[(0,B.jsx)(`span`,{className:`goal-details-inline-state ${e.status}`,children:e.status}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`strong`,{children:xt(e.roleId)}),(0,B.jsx)(`small`,{children:e.objective})]})]}),(0,B.jsx)(`p`,{children:e.summary}),(0,B.jsxs)(`div`,{className:`goal-details-task-node-meta`,children:[(0,B.jsxs)(`span`,{children:[e.refs.length,` refs`]}),(0,B.jsxs)(`span`,{children:[e.testsRun.length+e.validationAttempts.length,` checks`]}),(0,B.jsxs)(`span`,{children:[e.blockers.length,` blockers`]}),(0,B.jsx)(`span`,{children:e.confidence?`${U(e.confidence)} confidence`:`Confidence unknown`})]}),e.findings.length>0?(0,B.jsxs)(`small`,{children:[`Findings: `,Tt(e.findings,3)]}):null,e.changedFiles.length>0?(0,B.jsxs)(`small`,{children:[`Files: `,Tt(e.changedFiles,4)]}):null,e.testsRun.length>0?(0,B.jsxs)(`small`,{children:[`Tests: `,Tt(e.testsRun,3)]}):null,e.validationAttempts.length>0?(0,B.jsxs)(`small`,{children:[`Validation: `,Tt(e.validationAttempts,2)]}):null,e.refs.length>0?(0,B.jsxs)(`small`,{children:[`Refs: `,Tt(e.refs.map(St),4)]}):null,e.blockers.length>0?(0,B.jsxs)(`small`,{children:[`Blockers: `,Tt(e.blockers,3)]}):null,e.workspaceRetention?(0,B.jsxs)(`small`,{children:[`Workspace: `,wt(e.workspaceRetention)]}):null,e.importantMessages.length>0?(0,B.jsxs)(`small`,{children:[`Messages: `,Tt(e.importantMessages.map(Ct),2)]}):null]},e.runId))})})}function V({pendingAction:e,run:t,onRun:n}){let r=mt(t);return r.length===0?null:(0,B.jsx)(`div`,{className:`goal-details-actions`,children:r.map(r=>{let i=e===`${t.id}:${r}`;return(0,B.jsx)(`button`,{type:`button`,disabled:!!e,onClick:()=>void n(t.id,r),children:i?`Working...`:ht(r)},r)})})}function mt(e){let t=[],n=gt(e),r=_t(e);return n&&t.push(`cleanup`),r&&t.push(`archive`),t}function ht(e){return e===`cleanup`?`Clean`:e===`archive`?`Archive`:`Clean + archive`}function gt(e){if(!vt(e))return!1;let t=Mt(e.metadata);if(!t?.subagentWorkspace&&!t?.workspaceHandoff)return!1;let n=Nt(Mt(Mt(t.lifecycleCleanup)?.workspaceCleanup)?.status);return n!==`removed`&&n!==`deleted`&&n!==`retained`&&n!==`skipped`}function _t(e){if(!e.childSessionId||!vt(e))return!1;let t=Nt(Mt(Mt(e.metadata)?.childSessionArchive)?.status);return t!==`archived`&&t!==`already_archived`}function vt(e){return e.status===`completed`||e.status===`failed`||e.status===`cancelled`}function yt(e){let t=e.latestMeaningfulUpdate;return t?`${xt(t.roleId)} ${t.status}: ${t.message}`:`No structured update`}function bt(e,t){if(e<=0&&t<=0)return`0 tokens`;let n=`${t} ${t===1?`request`:`requests`}`;return`${Et(e)} tokens · ${n}`}function xt(e){return e.slice(0,1).toUpperCase()+e.slice(1).replace(/[-_]+/g,` `)}function St(e){return`${e.kind}: ${e.label}`}function Ct(e){return`${U(e.kind)}: ${e.body}`}function wt(e){return`retained ${e.expiresAt?`until ${Dt(e.expiresAt)}`:`for inspection`}${e.trigger?` · ${U(e.trigger)}`:``}`}function Tt(e,t){let n=e.slice(0,t),r=e.length-n.length;return r>0?`${n.join(`, `)} +${r}`:n.join(`, `)}function Et(e){if(e<1e3)return String(e);if(e>=1e6){let t=e/1e6;return`${Ot(t,t<10?2:1)}M`}let t=e/1e3;return`${Ot(t,+(t<10))}k`}function Dt(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString([],{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}function Ot(e,t){return e.toFixed(t).replace(/\.0+$/,``).replace(/(\.\d*?)0+$/,`$1`)}function kt(){return(0,B.jsxs)(`div`,{className:`goal-details-empty`,children:[(0,B.jsx)(k,{size:18}),(0,B.jsx)(`span`,{children:`No active Goal or Create workflow.`})]})}function H({children:e,title:t}){return(0,B.jsxs)(`section`,{className:`goal-details-section`,children:[(0,B.jsx)(`h2`,{children:t}),e]})}function At({rows:e}){return(0,B.jsx)(`dl`,{className:`goal-details-grid`,children:e.map(([e,t])=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e}),(0,B.jsx)(`dd`,{children:t})]},e))})}function jt({refs:e}){return(0,B.jsx)(`ul`,{className:`goal-details-ref-list`,children:e.map(e=>(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`code`,{title:e.primary,children:e.primary}),(0,B.jsx)(`span`,{children:e.secondary})]},e.id))})}function Mt(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:null}function Nt(e){return typeof e==`string`&&e.trim()?e.trim():null}function U(e){return e.split(/[_-]/g).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function Pt(e){return e===`ready_local`||e===`published_hosted`?`success`:e===`blocked`||e===`failed`||e===`cancelled`?`danger`:e===`awaiting_questions`||e===`awaiting_plan_approval`?`warning`:`active`}function Ft({sandboxId:e,connection:t}){let[n,r]=(0,z.useState)(null),[i,a]=(0,z.useState)([]),[o,s]=(0,z.useState)(null),[c,l]=(0,z.useState)(null),[u,d]=(0,z.useState)(null),[f,p]=(0,z.useState)(null);De(u,{prefix:`Sandbox`}),De(f,{prefix:`Sandbox integrations`});let m=n?.integrationLeases??[],h=(0,z.useMemo)(()=>i.filter(e=>e.status===`active`),[i]),g=(0,z.useMemo)(()=>Rt(n),[n]),_=(0,z.useCallback)(async()=>{if(!t)d(`OpenPond App server is not connected.`);else if(!e)r(null),a([]),d(null);else{s(`summary`),d(null);try{let n=await F.sandbox(t,e),i=await F.integrationConnections(t,It(n.sandbox));r(n.sandbox),a(i.connections),p(null)}catch(e){d(e instanceof Error?e.message:String(e))}finally{s(null)}}},[t,e]),v=(0,z.useCallback)(async()=>{if(t&&n){l(`load`),p(null);try{let[e,i]=await Promise.all([F.integrationConnections(t,It(n)),F.sandboxIntegrationLeases(t,n.id)]);a(e.connections),r(i.sandbox)}catch(e){p(e instanceof Error?e.message:String(e))}finally{l(null)}}},[t,n]),ee=(0,z.useCallback)(async e=>{if(!t||!n)return;let i=Be(e.provider),a=i?Ge(i):null,o=a?.leasePolicy.allowedCapabilityIds??[];if(!i||!a?.leasePolicy.leaseable||o.length===0)p(`${W(e.provider)} cannot be attached to this sandbox.`);else{l(`attach:${e.id}`),p(null);try{let i=await F.attachSandboxIntegrationConnection(t,n.id,{connectionId:e.id,provider:e.provider,capabilities:o,...e.scopes.length>0?{scopes:e.scopes}:{},...a.leasePolicy.defaultTtlSeconds?{ttlSeconds:a.leasePolicy.defaultTtlSeconds}:{},required:!1});r(i.sandbox)}catch(e){p(e instanceof Error?e.message:String(e))}finally{l(null)}}},[t,n]),te=(0,z.useCallback)(async e=>{if(t&&n){l(`remove:${e}`),p(null);try{let i=await F.removeSandboxIntegrationLease(t,n.id,e);r(i.sandbox)}catch(e){p(e instanceof Error?e.message:String(e))}finally{l(null)}}},[t,n]);return(0,z.useEffect)(()=>{_()},[_]),e?(0,B.jsxs)(`div`,{className:`sandbox-summary-tab`,children:[(0,B.jsxs)(`section`,{className:`sandbox-workspace-section`,children:[(0,B.jsxs)(`div`,{className:`sandbox-workspace-heading`,children:[(0,B.jsx)(`h3`,{children:`Sandbox`}),(0,B.jsxs)(`div`,{className:`sandbox-workspace-heading-actions`,children:[n?(0,B.jsx)(`span`,{children:n.state}):null,(0,B.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Refresh summary`,"aria-label":`Refresh summary`,disabled:o!==null,onClick:()=>void _(),children:o===`summary`?(0,B.jsx)(xe,{className:`spinning`,size:14}):(0,B.jsx)(we,{size:14})})]})]}),n?(0,B.jsxs)(`dl`,{className:`sandbox-workspace-kv`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Sandbox`}),(0,B.jsx)(`dd`,{children:Wt(n.id)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Spend`}),(0,B.jsxs)(`dd`,{children:[Kt(n.reservation.capturedUsd),` / `,Kt(n.budget.maxUsd)]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Reservation`}),(0,B.jsx)(`dd`,{children:n.reservation.status})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Idle cleanup`}),(0,B.jsx)(`dd`,{children:n.quotas?.idleTimeoutSeconds?`${Math.round(n.quotas.idleTimeoutSeconds/60)} min`:`-`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Updated`}),(0,B.jsx)(`dd`,{children:Gt(n.updatedAt)})]}),g?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Receipt`}),(0,B.jsxs)(`dd`,{children:[Wt(g.id),` / `,Kt(g.totalUsd)]})]}):null]}):(0,B.jsxs)(`div`,{className:`sandbox-workspace-loading`,children:[o===`summary`?(0,B.jsx)(xe,{className:`spinning`,size:16}):null,(0,B.jsx)(`span`,{children:o===`summary`?`Loading sandbox`:`Sandbox unavailable`})]})]}),(0,B.jsxs)(`section`,{className:`sandbox-workspace-section`,children:[(0,B.jsxs)(`div`,{className:`sandbox-workspace-heading`,children:[(0,B.jsx)(`h3`,{children:`Integrations`}),(0,B.jsxs)(`div`,{className:`sandbox-workspace-heading-actions`,children:[(0,B.jsx)(`span`,{children:m.length}),(0,B.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Refresh integrations`,"aria-label":`Refresh integrations`,disabled:c!==null||!n,onClick:()=>void v(),children:c===`load`?(0,B.jsx)(xe,{className:`spinning`,size:14}):(0,B.jsx)(we,{size:14})})]})]}),m.length>0?(0,B.jsx)(`div`,{className:`sandbox-workspace-integration-list`,children:m.map(e=>(0,B.jsxs)(`div`,{className:`sandbox-workspace-integration-row`,children:[(0,B.jsxs)(`div`,{className:`sandbox-workspace-integration-main`,children:[(0,B.jsx)(`span`,{children:W(e.provider)}),(0,B.jsxs)(`small`,{children:[e.required?`required`:`optional`,` / `,Vt(e),` / `,Lt(e)]})]}),(0,B.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Revoke ${W(e.provider)} lease`,"aria-label":`Revoke ${W(e.provider)} lease`,disabled:c!==null,onClick:()=>void te(e.leaseId),children:c===`remove:${e.leaseId}`?(0,B.jsx)(xe,{className:`spinning`,size:14}):(0,B.jsx)(ne,{size:14})}),(0,B.jsxs)(`div`,{className:`sandbox-workspace-chip-row`,children:[e.capabilities.slice(0,5).map(t=>(0,B.jsx)(`span`,{children:Bt(e.provider,t)},t)),e.capabilities.length>5?(0,B.jsxs)(`span`,{children:[`+`,e.capabilities.length-5]}):null]})]},e.leaseId))}):(0,B.jsx)(`p`,{className:`sandbox-workspace-empty`,children:`No active integration leases.`}),h.length>0?(0,B.jsx)(`div`,{className:`sandbox-workspace-integration-list`,children:h.map(e=>{let t=m.some(t=>t.provider===e.provider),n=zt(e)?.leasePolicy.allowedCapabilityIds.length??0;return(0,B.jsxs)(`div`,{className:`sandbox-workspace-integration-row compact`,children:[(0,B.jsxs)(`div`,{className:`sandbox-workspace-integration-main`,children:[(0,B.jsx)(`span`,{children:Ht(e)}),(0,B.jsx)(`small`,{children:Ut(e,n)})]}),(0,B.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:t?`${W(e.provider)} already attached`:`Attach ${W(e.provider)}`,"aria-label":t?`${W(e.provider)} already attached`:`Attach ${W(e.provider)}`,disabled:t||c!==null||n===0,onClick:()=>void ee(e),children:c===`attach:${e.id}`?(0,B.jsx)(xe,{className:`spinning`,size:14}):(0,B.jsx)(at,{size:14})})]},e.id)})}):(0,B.jsx)(`p`,{className:`sandbox-workspace-empty`,children:`No connected accounts available.`})]})]}):(0,B.jsx)(`div`,{className:`sandbox-summary-tab`,children:(0,B.jsx)(`p`,{className:`sandbox-workspace-empty`,children:`No sandbox is attached yet.`})})}function It(e){return{status:`active`}}function Lt(e){return e.proxyUrl?`runtime proxy available`:`metadata only, no runtime proxy`}function Rt(e){return e?.receipts?.at(-1)??null}function zt(e){let t=Be(e.provider);return t?Ge(t):null}function W(e){let t=Be(e),n=t?Ge(t):null;return n?n.label:e===`microsoft_teams`?`Microsoft Teams`:e?e.replace(/_/g,` `):`Integration`}function Bt(e,t){let n=Be(e);return(n?Ge(n):null)?.capabilities.find(e=>e.id===t)?.label??t}function Vt(e){return e.expiresAt?`expires ${Gt(e.expiresAt)}`:`active`}function Ht(e){let t=e.providerAccountName?.trim();return t?`${W(e.provider)} / ${t}`:W(e.provider)}function Ut(e,t){let n=[];return e.providerWorkspaceName&&n.push(e.providerWorkspaceName),n.push(`${t} lease ${t===1?`capability`:`capabilities`}`),e.scopes.length>0&&n.push(`${e.scopes.length} ${e.scopes.length===1?`scope`:`scopes`}`),n.join(` / `)}function Wt(e){return e.length>10?`${e.slice(0,8)}...`:e}function Gt(e){if(!e)return`-`;let t=new Date(e);return Number.isNaN(t.valueOf())?`-`:new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}).format(t)}function Kt(e){let t=Number(e??0);return new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,maximumFractionDigits:t>=10?2:4}).format(Number.isFinite(t)?t:0)}function qt({summary:e}){let t=he(e.taskset),n=e.taskset.learningSignals.demonstrations.filter(e=>e.approved).length,r=e.taskset.tasks.filter(e=>e.split===`frozen_eval`).length,i=e.plan?.recipe.method===`sft`||e.plan?.recipe.method===`grpo`?e.plan.recipe:null,a=se(e.taskset,e.plan),o=e.job?w(e.job.status,e.job.completedAt,e.job.updatedAt):null;return(0,B.jsxs)(`div`,{className:`training-sidebar-summary`,children:[(0,B.jsxs)(`header`,{children:[(0,B.jsx)(`h2`,{children:S(e.taskset.name,t)}),(0,B.jsx)(`span`,{children:e.job?pe(e.job.status):e.taskset.readiness?.ready?`Ready to train`:`Needs review`})]}),(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Run`}),(0,B.jsxs)(`dl`,{children:[(0,B.jsx)(G,{label:`Primary recommendation`,value:t.toUpperCase()}),(0,B.jsx)(G,{label:`Training stage`,value:a}),(0,B.jsx)(G,{label:`Base model`,value:i?.baseModel.id??`Not selected`}),(0,B.jsx)(G,{label:`Compute`,value:e.plan?ge(e.plan.destinationId):`Not selected`}),(0,B.jsx)(G,{label:`Started`,value:fe(e.job?.startedAt??null)}),(0,B.jsx)(G,{label:`Duration`,value:me(e.job?.startedAt??null,o)})]})]}),(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Data`}),(0,B.jsxs)(`dl`,{children:[(0,B.jsx)(G,{label:`Training examples`,value:String(n)}),(0,B.jsx)(G,{label:`Test examples`,value:String(r)}),(0,B.jsx)(G,{label:`Dataset sources`,value:String(e.taskset.sourceRefs.length)})]})]}),i?(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Recipe`}),(0,B.jsxs)(`dl`,{children:[i.method===`grpo`?(0,B.jsx)(G,{label:`RL loss`,value:i.loss.method===`gspo-token`?`GSPO-token`:i.loss.method.toUpperCase()}):null,(0,B.jsx)(G,{label:`LoRA rank`,value:String(i.lora.rank)}),(0,B.jsx)(G,{label:`Learning rate`,value:String(i.optimizer.learningRate)}),(0,B.jsx)(G,{label:`Optimizer steps`,value:String(i.optimizer.maxSteps)}),(0,B.jsx)(G,{label:i.method===`grpo`?`Prompt length`:`Sequence length`,value:String(i.method===`grpo`?i.dataset.maxPromptTokens:i.dataset.maxSequenceLength)})]})]}):null,(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Result`}),(0,B.jsxs)(`dl`,{children:[(0,B.jsx)(G,{label:`Adapter`,value:e.lineage?`${a} ready`:`Not created`}),(0,B.jsx)(G,{label:`Evaluation`,value:e.lineage?.frozenEvaluationArtifactId?`Completed`:`Not completed`}),(0,B.jsx)(G,{label:`Artifacts`,value:String(e.artifacts.length)})]})]})]})}function G({label:e,value:t}){return(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e}),(0,B.jsx)(`dd`,{children:t})]})}function Jt(e){let t=Yt(``,``,`folder`);for(let n of e){let e=n.endsWith(`/`),r=n.split(`/`).filter(Boolean);if(r.length===0)continue;let i=t,a=``;for(let t=0;t<r.length;t+=1){let n=r[t];a=a?`${a}/${n}`:n;let o=!e&&t===r.length-1?`file`:`folder`,s=`${o}:${n}`,c=i.childMap.get(s);c||(c=Yt(n,a,o),i.childMap.set(s,c),i.children.push(c)),i=c}}return Xt(t.children)}function Yt(e,t,n){return{name:e,path:t,type:n,children:[],childMap:new Map}}function Xt(e){return e.sort((e,t)=>e.type===t.type?e.name.localeCompare(t.name):e.type===`folder`?-1:1).map(e=>({name:e.name,path:e.path,type:e.type,children:Xt(e.children)}))}function Zt({className:e,currentStatus:t,onSetStatus:n}){let r=t===`pinned`,i=t===`saved_for_later`;return(0,B.jsxs)(`span`,{className:`workspace-file-bookmark-actions ${e??`workspace-file-heading-actions`}`,children:[(0,B.jsx)(`button`,{type:`button`,className:r?`active`:void 0,"data-tooltip":r?`Unpin file`:`Pin file`,"aria-label":r?`Unpin file`:`Pin file`,"aria-pressed":r,onClick:()=>n(r?`none`:`pinned`),children:r?(0,B.jsx)(O,{size:14}):(0,B.jsx)(Re,{size:14})}),(0,B.jsx)(`button`,{type:`button`,className:i?`active`:void 0,"data-tooltip":i?`Remove from Save for later`:`Save file for later`,"aria-label":i?`Remove from Save for later`:`Save file for later`,"aria-pressed":i,onClick:()=>n(i?`none`:`saved_for_later`),children:i?(0,B.jsx)(ze,{size:14}):(0,B.jsx)(I,{size:14})})]})}function Qt({changedByPath:e,expandedFolderPaths:t,rootPath:n,repoFiles:r,selectedPath:i,getFileBookmarkStatus:a,onOpenFile:o,onSetFileBookmarkStatus:s,onToggleFolder:c}){let l=(0,z.useMemo)(()=>Jt(r),[r]);return(0,B.jsxs)(`div`,{className:`workspace-file-tree-view`,children:[(0,B.jsxs)(`div`,{className:`workspace-file-tree-header`,children:[(0,B.jsx)(T,{size:14}),(0,B.jsx)(`strong`,{title:n??void 0,children:n?n.split(`/`).at(-1):`Files`}),(0,B.jsx)(`span`,{children:r.length})]}),(0,B.jsx)(`div`,{className:`workspace-file-tree`,children:l.map(r=>(0,B.jsx)(K,{changedByPath:e,expandedFolderPaths:t,node:r,rootPath:n,selectedPath:i,getFileBookmarkStatus:a,onOpenFile:o,onSetFileBookmarkStatus:s,onToggleFolder:c},`${r.type}:${r.path}`))})]})}function K({changedByPath:e,depth:t=0,expandedFolderPaths:n,node:r,rootPath:i,selectedPath:a,getFileBookmarkStatus:o,onOpenFile:s,onSetFileBookmarkStatus:c,onToggleFolder:l}){let u=i?`${i}/${r.path}`:r.path,d=r.type===`folder`&&n.has(u),f=e.get(u),p=2+t*11;return r.type===`folder`?(0,B.jsxs)(`div`,{className:`workspace-file-tree-node`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`workspace-file-tree-row folder`,"aria-expanded":d,style:{paddingLeft:p},onClick:()=>l(u),children:[d?(0,B.jsx)(T,{size:14}):(0,B.jsx)(Ke,{size:14}),(0,B.jsx)(`span`,{children:r.name})]}),d&&r.children.map(r=>(0,B.jsx)(K,{changedByPath:e,depth:t+1,expandedFolderPaths:n,node:r,rootPath:i,selectedPath:a,getFileBookmarkStatus:o,onOpenFile:s,onSetFileBookmarkStatus:c,onToggleFolder:l},`${r.type}:${r.path}`))]}):(0,B.jsxs)(`div`,{className:`workspace-file-tree-row file ${f?`changed`:``} ${a===u?`selected`:``}`,style:{paddingLeft:p},children:[(0,B.jsxs)(`button`,{type:`button`,className:`workspace-file-tree-row-main`,title:u,onClick:()=>s(u),children:[(0,B.jsx)(x,{size:13}),(0,B.jsx)(`span`,{children:r.name}),f&&(0,B.jsxs)(`small`,{children:[(0,B.jsxs)(`span`,{className:`diff-addition`,children:[`+`,f.additions]}),(0,B.jsxs)(`span`,{className:`diff-deletion`,children:[`-`,f.deletions]})]})]}),/\.html?$/i.test(u)&&(0,B.jsx)(`button`,{type:`button`,className:`workspace-file-tree-bookmark-actions`,title:`View source`,"aria-label":`View source for ${r.name}`,onClick:()=>s(u,{source:!0}),children:`</>`}),c?(0,B.jsx)(Zt,{className:`workspace-file-tree-bookmark-actions`,currentStatus:o?.(u)??null,onSetStatus:e=>c(u,e)}):null]})}function $t({diff:e,expandedFolderPaths:t,rootPath:n,repoFiles:r,selectedPath:i,getFileBookmarkStatus:a,onOpenFile:o,onSetFileBookmarkStatus:s,onToggleFolder:c}){let l=e?.files??[],u=(0,z.useMemo)(()=>new Map(l.map(e=>[e.path,e])),[l]),d=n?.replace(/^\/+|\/+$/g,``)||null,f=(0,z.useMemo)(()=>{if(!d)return r;let e=`${d}/`;return r.filter(t=>t.startsWith(e)).map(t=>t.slice(e.length)).filter(Boolean)},[d,r]);return(0,B.jsx)(`div`,{className:`workspace-diff-files-view`,children:(0,B.jsx)(Qt,{changedByPath:u,expandedFolderPaths:t,rootPath:d,repoFiles:f,selectedPath:i,getFileBookmarkStatus:a,onOpenFile:o,onSetFileBookmarkStatus:s,onToggleFolder:c})})}function en({collapsed:e,editorControlsVisible:t,hideWhiteSpace:n,loadFullFiles:r,renderMarkdown:i,wordDiffs:a,wordWrap:o,onClose:s,onCopyGitApply:c,onRefresh:l,onToggleCollapsed:u,onToggleEditorControlsVisible:d,onToggleHideWhiteSpace:f,onToggleLoadFullFiles:p,onToggleRenderMarkdown:m,onToggleWordDiffs:h,onToggleWordWrap:g}){return(0,B.jsxs)(`div`,{className:`workspace-diff-options-menu`,role:`menu`,children:[(0,B.jsx)(q,{icon:(0,B.jsx)(we,{size:14}),label:`Refresh`,onClick:l,onClose:s}),(0,B.jsx)(q,{checked:o,icon:(0,B.jsx)(y,{size:14}),label:`Enable word wrap`,onClick:g,onClose:s}),(0,B.jsx)(q,{checked:e,icon:(0,B.jsx)(tt,{size:14}),label:`Collapse all diffs`,onClick:u,onClose:s}),(0,B.jsx)(`div`,{className:`workspace-diff-menu-divider`}),(0,B.jsx)(q,{checked:t,icon:(0,B.jsx)(it,{size:14}),label:`Show editor controls`,onClick:d,onClose:s}),(0,B.jsx)(q,{checked:i,icon:(0,B.jsx)(qe,{size:14}),label:`Render Markdown`,onClick:m,onClose:s}),(0,B.jsx)(q,{checked:!r,icon:(0,B.jsx)(k,{size:14}),label:`Show diffs first`,onClick:p,onClose:s}),(0,B.jsx)(q,{checked:a,icon:(0,B.jsx)(et,{size:14}),label:`Enable word diffs`,onClick:h,onClose:s}),(0,B.jsx)(q,{checked:n,icon:(0,B.jsx)(rt,{size:14}),label:`Hide white space`,onClick:f,onClose:s}),(0,B.jsx)(q,{icon:(0,B.jsx)(ee,{size:14}),label:`Copy git apply command`,onClick:c,onClose:s})]})}function q({checked:e,icon:t,label:n,onClick:r,onClose:i}){return(0,B.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{r?.(),i()},children:[t,(0,B.jsx)(`span`,{children:n}),e&&(0,B.jsx)(He,{size:14})]})}function tn({addMenuOpen:e,expanded:t,filteredFiles:n,dirtyFilePaths:r,openFiles:i,goalDetailsAvailable:a,searchOpen:o,searchQuery:s,selectedPath:c,sideChatTabs:l=[],summaryAvailable:u,sourceStatus:d,sourceSwitcher:f,visibleTab:p,toolbarActions:m,additionalTabs:h,tabOrder:g=[],filesTabOpen:_=!0,onCloseFilesTab:v,overviewTabs:ee=[],outputsLabel:te=`Training`,activeOverviewId:ne,onNewOverview:y,onSelectOverview:re,onCloseOverview:x,getFileBookmarkStatus:ie,onCloseFileTab:ae,onCloseSideChat:oe,onCloseSearch:S,onOpenFile:C,onOpenBrowser:w,onOpenSearch:se,onOpenSideChat:ce,onSearchQueryChange:le,onSetFileBookmarkStatus:ue,onSelectFile:de,onSelectFiles:fe,onSelectOutputs:pe,onSelectGoal:me,onSelectSummary:he,onSelectSideChat:ge,onToggleAddMenu:_e,onToggleExpanded:ve}){let ye=(0,z.useRef)(null),xe=(0,z.useRef)(null);(0,z.useEffect)(()=>{xe.current?.querySelector(`button[role="tab"][aria-selected="true"]`)?.scrollIntoView({block:`nearest`,inline:`nearest`})},[ne,i.length,c,p]),(0,z.useEffect)(()=>{if(!e&&!o)return;function t(){e&&_e(),o&&S()}function n(e){ye.current?.contains(e.target)||t()}function r(e){e.key===`Escape`&&t()}return document.addEventListener(`pointerdown`,n),document.addEventListener(`keydown`,r),()=>{document.removeEventListener(`pointerdown`,n),document.removeEventListener(`keydown`,r)}},[e,S,_e,o]);function we(e){e.key===`Escape`?S():e.key===`Enter`&&(n[0]||s.trim())&&C(n[0]||s.trim())}function E(e){if(![`ArrowRight`,`ArrowLeft`,`Home`,`End`].includes(e.key))return;let t=e.target;if(!(t instanceof HTMLButtonElement)||t.getAttribute(`role`)!==`tab`)return;let n=Array.from(e.currentTarget.querySelectorAll(`button[role="tab"]`)),r=n.indexOf(t);if(r<0||n.length===0)return;e.preventDefault();let i=n[D(r,n.length,e.key)];if(!i)return;i.focus(),i.click();let a=i.id;a&&window.requestAnimationFrame(()=>document.getElementById(a)?.focus())}let Ee=[...ee.map(e=>(0,B.jsxs)(`div`,{className:`workspace-diff-tab file ${p===`outputs`&&ne===e?`active`:``}`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`workspace-diff-tab-main`,role:`tab`,"aria-selected":p===`outputs`&&ne===e,tabIndex:p===`outputs`&&ne===e?0:-1,onClick:()=>re?.(e),children:[(0,B.jsx)(k,{className:`workspace-diff-tab-icon`,size:14}),(0,B.jsx)(`span`,{children:e===-1?te:`New tab`})]}),(0,B.jsx)(`button`,{type:`button`,className:`workspace-diff-tab-close`,"aria-label":e===-1?`Close ${te}`:`Close new tab`,onClick:()=>x?.(e),children:(0,B.jsx)(Te,{size:12})})]},`overview-${e}`)),a?(0,B.jsxs)(`button`,{type:`button`,className:`workspace-diff-tab ${p===`goal`?`active`:``}`,role:`tab`,"aria-selected":p===`goal`,onClick:me,children:[(0,B.jsx)(k,{size:14}),(0,B.jsx)(`span`,{children:`Goal`})]},`goal`):null,u&&he?(0,B.jsxs)(`button`,{type:`button`,className:`workspace-diff-tab ${p===`summary`?`active`:``}`,role:`tab`,"aria-selected":p===`summary`,onClick:he,children:[(0,B.jsx)(be,{size:14}),(0,B.jsx)(`span`,{children:`Summary`})]},`summary`):null,_?(0,B.jsxs)(`div`,{className:`workspace-diff-tab file ${p===`files`?`active`:``}`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`workspace-diff-tab-main`,role:`tab`,id:`right-sidebar-files-tab`,"aria-controls":`right-sidebar-files-panel`,"aria-selected":p===`files`,tabIndex:p===`files`?0:-1,onClick:fe,children:[(0,B.jsx)(T,{className:`workspace-diff-tab-icon`,size:14}),(0,B.jsx)(`span`,{children:`Files`})]}),v?(0,B.jsx)(`button`,{type:`button`,className:`workspace-diff-tab-close`,"aria-label":`Close files tab`,onClick:v,children:(0,B.jsx)(Te,{size:12})}):null]},`files`):null,...i.map(e=>(0,B.jsxs)(`div`,{className:`workspace-diff-tab file ${p===`file`&&c===e.path?`active`:``}`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`workspace-diff-tab-main`,role:`tab`,"aria-selected":p===`file`&&c===e.path,title:e.path,onClick:()=>de(e.path),children:[(0,B.jsx)(k,{className:`workspace-diff-tab-icon`,size:13}),r.has(e.path)&&(0,B.jsx)(`span`,{className:`workspace-diff-tab-dirty`,"aria-hidden":`true`}),(0,B.jsx)(`span`,{children:L(e.path)})]}),ue?(0,B.jsx)(Zt,{className:`workspace-diff-tab-bookmark-actions`,currentStatus:ie?.(e.path)??null,onSetStatus:t=>ue(e.path,t)}):null,(0,B.jsx)(`button`,{type:`button`,className:`workspace-diff-tab-close`,title:`Close ${e.path}`,onClick:t=>ae(e.path,t),children:(0,B.jsx)(Te,{size:12})})]},e.path)),...l.map(e=>(0,B.jsxs)(`div`,{className:`workspace-diff-tab right-chat-tab`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`workspace-diff-tab-main`,role:`tab`,id:`right-chat-tab-${e.id}`,"aria-controls":`right-chat-panel-${e.id}`,"aria-selected":!1,tabIndex:-1,title:e.title,onClick:()=>ge?.(e.id),children:[e.running?(0,B.jsx)(`span`,{className:`right-chat-status-dot`,"aria-label":`Running`}):null,(0,B.jsx)(`span`,{children:e.title})]}),oe?(0,B.jsx)(`button`,{type:`button`,className:`workspace-diff-tab-close`,title:`Close ${e.title}`,"aria-label":`Close ${e.title}`,onClick:t=>{t.stopPropagation(),oe(e.id)},children:(0,B.jsx)(Te,{size:12})}):null]},e.id))].filter(e=>e!==null),De=new Map(g.map((e,t)=>[e,t]));return Ee.sort((e,t)=>(De.get(String(e.key))??g.length)-(De.get(String(t.key))??g.length)),(0,B.jsxs)(`div`,{className:`workspace-diff-topbar`,children:[(0,B.jsxs)(`div`,{className:`workspace-diff-tabs`,role:`tablist`,"aria-label":`Right sidebar views`,ref:xe,onKeyDown:E,children:[Ee,h]}),(0,B.jsxs)(`div`,{className:`workspace-diff-add-anchor`,ref:ye,children:[(0,B.jsx)(`button`,{type:`button`,className:`workspace-diff-add-tab ${!y&&(e||o)?`active`:``}`,title:`Add`,"aria-label":y?`New tab`:`Add to right sidebar`,onClick:y??_e,children:(0,B.jsx)(Ce,{size:15})}),e&&(0,B.jsxs)(`div`,{className:`workspace-diff-add-menu`,role:`menu`,children:[pe?(0,B.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:pe,children:[(0,B.jsx)(k,{size:14}),(0,B.jsx)(`span`,{children:`Training`}),(0,B.jsx)(`kbd`,{})]}):null,ce?(0,B.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:ce,children:[(0,B.jsx)(A,{size:14}),(0,B.jsx)(`span`,{children:`New task`}),(0,B.jsx)(`kbd`,{})]}):null,(0,B.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:fe,children:[(0,B.jsx)(T,{size:14}),(0,B.jsx)(`span`,{children:`Files`}),(0,B.jsx)(`kbd`,{})]}),u&&he?(0,B.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:he,children:[(0,B.jsx)(be,{size:14}),(0,B.jsx)(`span`,{children:`Summary`}),(0,B.jsx)(`kbd`,{})]}):null,(0,B.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:se,children:[(0,B.jsx)(We,{size:14}),(0,B.jsx)(`span`,{children:`Open file`}),(0,B.jsx)(`kbd`,{children:`Ctrl+P`})]}),w?(0,B.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:w,children:[(0,B.jsx)(P,{size:14}),(0,B.jsx)(`span`,{children:`Browser`}),(0,B.jsx)(`kbd`,{children:`Ctrl+I`})]}):null]}),o&&(0,B.jsxs)(`div`,{className:`workspace-file-search-popover`,children:[(0,B.jsx)(`input`,{autoFocus:!0,placeholder:`Search files`,value:s,onChange:e=>le(e.target.value),onKeyDown:we}),(0,B.jsx)(`span`,{children:`Files`}),(0,B.jsx)(`div`,{className:`workspace-file-search-results`,children:n.length===0?(0,B.jsx)(`small`,{children:`Type to search for files`}):n.map(e=>(0,B.jsx)(`button`,{type:`button`,onClick:()=>C(e),children:e},e))})]})]}),p!==`outputs`&&(f||d)?(0,B.jsxs)(`div`,{className:`workspace-diff-source-bar`,"aria-label":`Workspace source`,children:[f?(0,B.jsx)(`div`,{className:`workspace-diff-source-toggle`,role:`group`,"aria-label":`File source`,children:f.options.map(e=>(0,B.jsx)(`button`,{type:`button`,className:f.value===e.value?`active`:``,"aria-pressed":f.value===e.value,onClick:()=>f.onChange(e.value),children:e.label},e.value))}):null,d?(0,B.jsx)(`span`,{className:`workspace-diff-source-status ${d.tone}`,children:d.label}):null]}):null,m,(0,B.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:t?`Restore files panel`:`Expand files panel`,"aria-label":t?`Restore files panel`:`Expand files panel`,onClick:ve,children:t?(0,B.jsx)(b,{size:14}):(0,B.jsx)(Se,{size:14})})]})}function nn({inline:e=!1,canCheckActiveFile:t,canSaveActiveFile:n,collapsed:r,editorControlsVisible:i,editorDiagnosticStatus:a,editorDiagnosticsChecking:o,hideWhiteSpace:s,loadFullFiles:c,menuOpen:l,renderMarkdown:u,showEditorCommandBar:d,showRenderMarkdownToggle:f,splitView:p,wordDiffs:m,wordWrap:h,onCopyGitApply:g,onEditorCheck:_,onEditorRedo:v,onEditorSave:ee,onEditorUndo:te,onRefresh:ne,onToggleCollapsed:y,onToggleEditorControlsVisible:b,onToggleHideWhiteSpace:re,onToggleLoadFullFiles:x,onToggleMenu:ie,onToggleRenderMarkdown:ae,onToggleSplitView:oe,onToggleWordDiffs:S,onToggleWordWrap:C}){return(0,B.jsx)(`div`,{className:`workspace-diff-toolbar ${e?`inline`:``}`,children:(0,B.jsxs)(`div`,{className:`workspace-diff-toolbar-actions`,children:[(0,B.jsxs)(`div`,{className:`workspace-diff-menu-anchor`,children:[(0,B.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Diff options`,"aria-haspopup":`menu`,"aria-expanded":l,onClick:()=>ie(),children:(0,B.jsx)(Oe,{size:15})}),l&&(0,B.jsx)(en,{collapsed:r,editorControlsVisible:i,hideWhiteSpace:s,loadFullFiles:c,renderMarkdown:u,wordDiffs:m,wordWrap:h,onClose:()=>ie(!1),onCopyGitApply:g,onRefresh:ne,onToggleCollapsed:y,onToggleEditorControlsVisible:b,onToggleHideWhiteSpace:re,onToggleLoadFullFiles:x,onToggleRenderMarkdown:ae,onToggleWordDiffs:S,onToggleWordWrap:C})]}),d&&(0,B.jsxs)(`div`,{className:`workspace-editor-command-bar`,"aria-label":`Editor controls`,children:[(0,B.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Save file`,"aria-label":`Save file`,disabled:!n,onClick:ee,children:(0,B.jsx)(E,{size:14})}),(0,B.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Undo`,"aria-label":`Undo`,onClick:te,children:(0,B.jsx)(st,{size:14})}),(0,B.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Redo`,"aria-label":`Redo`,onClick:v,children:(0,B.jsx)(ot,{size:14})}),(0,B.jsx)(`button`,{type:`button`,className:`diff-icon-button`,title:`Check file`,"aria-label":`Check file`,disabled:!t,onClick:_,children:o?(0,B.jsx)(xe,{className:`spinning`,size:14}):(0,B.jsx)(N,{size:14})}),a&&(0,B.jsxs)(`span`,{className:`workspace-editor-diagnostic-chip ${a.severity}`,children:[a.severity===`error`||a.severity===`warning`||a.severity===`unavailable`?(0,B.jsx)(j,{size:13}):(0,B.jsx)(N,{size:13}),(0,B.jsx)(`span`,{children:a.label})]})]}),f&&(0,B.jsx)(`button`,{type:`button`,className:`diff-icon-button ${u?`active`:``}`,title:u?`Show Markdown source`:`Render Markdown`,"aria-label":u?`Show Markdown source`:`Render Markdown`,"aria-pressed":u,onClick:ae,children:(0,B.jsx)(qe,{size:14})}),(0,B.jsx)(`button`,{type:`button`,className:`diff-icon-button ${p?`active`:``}`,title:p?`Show unified diff`:`Show split diff`,"aria-label":p?`Show unified diff`:`Show split diff`,"aria-pressed":p,onClick:oe,children:(0,B.jsx)(nt,{size:14})})]})})}var rn=class{pending=new Map;cancelled=new Set;receive(e,t){let n=t?.loadId;if(n===void 0)return`open`;let r=this.pending.get(e);return t?.loading?(r!==void 0&&r!==n&&this.cancelled.add(r),this.pending.set(e,n),`open`):this.cancelled.delete(n)||r!==void 0&&r!==n?`ignore`:(this.pending.delete(e),r===void 0?`open`:`complete`)}close(e){let t=this.pending.get(e);t!==void 0&&this.cancelled.add(t),this.pending.delete(e)}retain(e){for(let t of this.pending.keys())e.has(t)||this.close(t)}};function an({connection:e,workspaceId:t,sandboxId:n,file:r,dirty:i,onReload:o}){let s=C(r.path)||t,c=Ee(),[l,u]=(0,z.useState)(!1),[d,f]=(0,z.useState)(!1),p=(0,z.useRef)(!0);(0,z.useEffect)(()=>(p.current=!0,()=>{p.current=!1}),[]);let[m,h]=(0,z.useState)(r.readVersion),_=(0,z.useRef)(null),v=a({queryKey:[`open-file-version`,g(e),n??s,r.path],enabled:!!(e&&(n||s)),queryFn:async()=>{if(!n)return F.workspaceFileVersion(e,s,r.path);let t=r.path.includes(`/`)?r.path.slice(0,r.path.lastIndexOf(`/`))||`/`:`.`,{files:i}=await F.sandboxFiles(e,n,{path:t,recursive:!1}),a=i.find(e=>e.path===r.path||e.path.split(`/`).pop()===r.path.split(`/`).pop());if(!a)return{exists:!1,revision:null};let o=`${a.sizeBytes}:${a.updatedAt}`;if(r.readStamp===o)return{exists:!0,revision:r.readVersion??null};if(_.current?.stamp===o)return{exists:!0,revision:_.current.revision??null};let c=await de(e,n,r.path);return _.current={stamp:o,revision:c.readVersion},{exists:!0,revision:c.readVersion??null}},refetchInterval:5e3,refetchOnWindowFocus:!0}),ee=v.refetch;(0,z.useEffect)(()=>{let t=!1;return f(!1),(async()=>{let i=r.contentEncoding===`base64`&&r.content?await ye(r.content):r.readVersion;t||(h(i),e&&(n||s)&&await ee(),t||f(!0))})().catch(()=>{t||f(!0)}),()=>{t=!0}},[ee,e,r.content,r.contentEncoding,r.readVersion,n,s]),(0,z.useEffect)(()=>{m===void 0&&!r.content&&v.data&&h(v.data.revision)},[m,r.content,v.data]);let te=d&&m!==void 0&&!v.isError&&v.data?.exists&&m!==v.data.revision;async function ne(){if(e&&(n||s)&&!l&&(!i||window.confirm(`Discard unsaved edits and refresh this file from disk?`))){u(!0);try{let t=await v.refetch();if(t.error)throw t.error;if(!n&&M(r.path)){let n=/^(?:[~/\\]|[A-Za-z]:)/.test(r.path)?await F.signLocalImageUrl(e,{path:r.path}):await F.signWorkspaceImageUrl(e,{appId:s,path:r.path}),i=new URL(n.url);if(i.searchParams.set(`refresh`,String(Date.now())),!p.current)return;o({...r,readVersion:t.data?.revision},i.href)}else{let i=n?await de(e,n,r.path):await F.workspaceFile(e,s,r.path);if(!p.current)return;o(i,M(r.path)&&i.contentEncoding===`base64`&&i.content?`data:image/${/\.jpe?g$/i.test(r.path)?`jpeg`:r.path.split(`.`).pop()};base64,${i.content}`:void 0),h(i.readVersion??t.data?.revision)}v.refetch()}catch(e){p.current&&c?.(e instanceof Error?e.message:`Could not refresh file.`,`error`)}finally{p.current&&u(!1)}}}return!te&&!l?null:(0,B.jsxs)(`button`,{type:`button`,className:`workspace-file-refresh`,disabled:l||!e||!n&&!s,onClick:()=>void ne(),"aria-label":`Reload updated file`,title:te?`The file changed. Reload to show the latest version.`:`Reload this file from disk`,children:[(0,B.jsx)(we,{size:14,className:l?`spinning`:void 0}),(0,B.jsx)(`span`,{children:l?`Reloading…`:`Reload`})]})}var on={cjs:`typescript`,css:`css`,html:`html`,js:`typescript`,json:`json`,jsx:`typescript`,md:`markdown`,mjs:`typescript`,py:`python`,sh:`shell`,ts:`typescript`,tsx:`typescript`,yaml:`yaml`,yml:`yaml`};function sn(e){let t=e.split(`/`).pop()?.toLowerCase()??``;return t===`dockerfile`?`shell`:t===`readme`||t===`readme.md`?`markdown`:on[t.includes(`.`)?t.split(`.`).pop()??``:``]??`text`}function cn(e,t){return e?t===`markdown`?ln(e):t===`json`?J(e,/("(?:\\.|[^"\\])*"(?=\s*:)|"(?:\\.|[^"\\])*"|[-]?\b\d+(?:\.\d+)?\b|\btrue\b|\bfalse\b|\bnull\b|[{}[\]:,])/g):t===`css`?J(e,/(\/\*.*?\*\/|#[\da-fA-F]{3,8}\b|--[\w-]+|[.#]?[\w-]+(?=\s*:)|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b\d+(?:\.\d+)?(?:px|rem|em|%|vh|vw)?\b|[{}():;,])/g):t===`html`?J(e,/(<!--.*?-->|<\/?[\w-]+|[\w:-]+(?==)|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|[<>/=])/g):t===`shell`?J(e,/(#.*$|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b(?:cd|cp|export|git|npm|pnpm|bun|yarn|rm|mkdir|test|if|then|fi|for|do|done|echo)\b|\$[\w_]+|&&|\|\||[|&;=])/g):t===`python`?J(e,/(#.*$|"""[\s\S]*?"""|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b(?:class|def|return|if|elif|else|for|while|try|except|finally|with|as|import|from|None|True|False|async|await|lambda|yield)\b|\b[A-Z][\w]*\b|\b\d+(?:\.\d+)?\b|[+\-*/%=<>!&|.:,()[\]{}]+)/g):J(e,/(\/\/.*$|\/\*.*?\*\/|`(?:\\.|[^`\\])*`|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\b(?:abstract|as|async|await|boolean|break|case|catch|class|const|continue|default|else|enum|export|extends|false|finally|for|from|function|if|import|in|interface|let|new|null|number|of|return|string|switch|throw|true|try|type|undefined|void|while)\b|\b[A-Z][\w]*\b|\b\d+(?:\.\d+)?\b|[+\-*/%=<>!&|?:.,()[\]{}]+)/g):[{text:` `,kind:`plain`}]}function ln(e){return/^\s{0,3}#{1,6}\s/.test(e)?[{text:e,kind:`keyword`}]:/^\s*[-*+]\s/.test(e)?[{text:e,kind:`property`}]:J(e,/(`[^`]+`|\*\*[^*]+\*\*|\[[^\]]+\]\([^)]+\)|https?:\/\/\S+)/g)}function un(e){return/^(\/\/|#|\/\*|<!--)/.test(e)?`comment`:/^["'`]/.test(e)?`string`:/^[-]?\d/.test(e)||/^#[\da-fA-F]{3,8}\b/.test(e)?`number`:/^\b[A-Z]/.test(e)?`type`:/^[.#]?[\w-]+$/.test(e)&&e.includes(`-`)?`property`:/^(?:[{}()[\],.:;<>/=+\-*&|!?%]+)$/.test(e)?`operator`:/^(?:--|\$)/.test(e)?`property`:`keyword`}function J(e,t){let n=[],r=0;for(let i of e.matchAll(t)){let t=i.index??0;t>r&&n.push({text:e.slice(r,t),kind:`plain`});let a=i[0];if(n.push({text:a,kind:un(a)}),r=t+a.length,/^(\/\/|#|<!--)/.test(a))break}return r<e.length&&n.push({text:e.slice(r),kind:`plain`}),n.length>0?n:[{text:e,kind:`plain`}]}function Y({language:e,text:t}){return(0,B.jsx)(B.Fragment,{children:cn(t,e).map((e,t)=>(0,B.jsx)(`span`,{className:`syntax-token ${e.kind}`,children:e.text},`${t}-${e.text}`))})}var dn=(0,z.lazy)(()=>i(()=>import(`./FilePagePreview-CW4J_1u7.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48])));function X({path:e,contentBase64:t}){let n=L(e),r=(0,z.useMemo)(()=>{try{let n=atob(t.replace(/\s/g,``)),r=Uint8Array.from(n,e=>e.charCodeAt(0));return new Blob([r],{type:Z(e)})}catch{return null}},[t,e]),[i,a]=(0,z.useState)(null);(0,z.useEffect)(()=>{if(!r)return;let e=URL.createObjectURL(r);return a({blob:r,url:e}),()=>URL.revokeObjectURL(e)},[r]);let o=i?.blob===r?i.url:null;return r?o?(0,B.jsxs)(`div`,{className:`workspace-document-preview`,children:[(0,B.jsxs)(`div`,{className:`workspace-document-preview-card`,children:[(0,B.jsx)(R,{path:e}),(0,B.jsxs)(`div`,{className:`workspace-document-preview-actions`,children:[(0,B.jsx)(`span`,{children:/\.pdf$/i.test(e)?`PDF`:`Word`}),(0,B.jsx)(`a`,{href:o,download:n,"aria-label":`Download document`,title:`Download document`,children:(0,B.jsx)(Ve,{size:16,"aria-hidden":`true`})})]})]}),/\.docx$/i.test(e)?(0,B.jsx)(z.Suspense,{fallback:(0,B.jsx)(`div`,{role:`status`,children:`Loading document…`}),children:(0,B.jsx)(dn,{thumbnail:!1,file:{path:e,content:t,contentEncoding:`base64`,status:``,additions:0,deletions:0,patch:``}})}):(0,B.jsx)(`iframe`,{src:o,title:`${e} preview`})]}):(0,B.jsx)(`div`,{className:`workspace-diff-code-empty`,role:`status`,children:`Loading document…`}):(0,B.jsx)(`div`,{className:`workspace-diff-code-empty`,children:`Document preview unavailable.`})}function Z(e){return/\.pdf$/i.test(e)?`application/pdf`:/\.docx$/i.test(e)?`application/vnd.openxmlformats-officedocument.wordprocessingml.document`:`application/msword`}var fn=`
3
-
4
- [file truncated]`,pn=(0,z.lazy)(()=>i(()=>import(`./WorkspaceMonacoEditor-BJxaiDrj.js`).then(e=>e.t),__vite__mapDeps([49,1,2,3,50]))),mn=(0,z.lazy)(()=>i(()=>import(`./WorkspacePresentationPreview-A28Poeca.js`),__vite__mapDeps([51,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,52,53,54]))),hn=6,gn=18,_n=22,vn=160,yn=12;function bn({collapsed:e=!1,diagnostics:t=[],draftContent:n,editable:r=!1,editorRef:i,error:a,file:o,hideWhiteSpace:s=!1,headerActions:c,imageSrc:l,loading:u,loadFullFiles:d,onOpenImage:f,onSelectBreadcrumbPath:p,onDraftContentChange:m,onLspAction:h,onSave:g,renderMarkdown:_,saveError:v,saving:ee=!1,splitView:te=!1,wordDiffs:ne=!1,wordWrap:y,workspaceName:b,workspaceRootPath:re}){De(a,{prefix:`File preview`}),De(v,{prefix:`Save failed`});let x=o.contentEncoding===`base64`?o.content??``:n??o.content??``,ie=(0,z.useMemo)(()=>x.split(`
5
- `).slice(0,800),[x]),ae=sn(o.path),oe=n!=null||o.content!=null,S=x.endsWith(fn),C=_&&oe&&Pe(o.path),w=Ie(o),se=oe&&(o.contentEncoding===`base64`||ke(o.path))&&Cn(x);return l?(0,B.jsxs)(`div`,{className:`workspace-file-preview`,children:[(0,B.jsxs)(`div`,{className:`workspace-diff-file-heading`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(R,{path:o.path,workspaceName:b,workspaceRootPath:re,onSelectPath:p}),(0,B.jsxs)(`span`,{className:`diff-addition`,children:[`+`,o.additions]}),(0,B.jsxs)(`span`,{className:`diff-deletion`,children:[`-`,o.deletions]})]}),c]}),(0,B.jsx)(`div`,{className:`workspace-file-image-stage`,children:(0,B.jsx)(`button`,{type:`button`,className:`workspace-file-image-button`,"aria-label":`Open image preview for ${o.path}`,onClick:f,children:(0,B.jsx)(`img`,{alt:o.path,decoding:`async`,src:l})})})]}):!d&&o.patch||!oe&&o.patch?te?(0,B.jsx)(Sn,{collapsed:e,file:o,hideWhiteSpace:s,onSelectBreadcrumbPath:p,wordDiffs:ne,wordWrap:y,headerActions:c,workspaceName:b,workspaceRootPath:re}):(0,B.jsx)(xn,{collapsed:e,file:o,hideWhiteSpace:s,wordWrap:y,workspaceName:b,workspaceRootPath:re,onSelectBreadcrumbPath:p,headerActions:c}):(0,B.jsxs)(`div`,{className:`workspace-file-preview ${y?`wrap`:``} ${se?`document-only`:``}`,children:[se?null:(0,B.jsxs)(`div`,{className:`workspace-diff-file-heading`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(R,{path:o.path,workspaceName:b,workspaceRootPath:re,onSelectPath:p}),(0,B.jsxs)(`span`,{className:`diff-addition`,children:[`+`,o.additions]}),(0,B.jsxs)(`span`,{className:`diff-deletion`,children:[`-`,o.deletions]})]}),(0,B.jsxs)(`span`,{className:`workspace-file-heading-end`,children:[ee?(0,B.jsx)(`span`,{className:`workspace-file-save-state`,children:`Saving`}):null,c]})]}),oe?C?(0,B.jsx)(`div`,{className:`workspace-markdown-preview`,children:(0,B.jsx)(ve,{content:x})}):w&&se?(0,B.jsx)(z.Suspense,{fallback:(0,B.jsx)(`div`,{className:`workspace-diff-code-empty`,role:`status`,children:`Loading presentation…`}),children:(0,B.jsx)(mn,{path:o.path,contentBase64:x})}):se?(0,B.jsx)(X,{path:o.path,contentBase64:x}):r&&!S?(0,B.jsx)(z.Suspense,{fallback:(0,B.jsx)(`div`,{className:`workspace-diff-code-empty`,children:`Loading editor`}),children:(0,B.jsx)(pn,{diagnostics:t,filePath:o.path,onChange:e=>m?.(e),onLspAction:h,onSave:()=>g?.(),ref:i,value:x,wordWrap:y})}):(0,B.jsx)(`div`,{className:`workspace-file-code`,children:ie.map((e,t)=>(0,B.jsxs)(`div`,{className:`workspace-file-code-row`,children:[(0,B.jsx)(`span`,{children:t+1}),(0,B.jsx)(`code`,{children:(0,B.jsx)(Y,{language:ae,text:e||` `})})]},`${t}-${e}`))}):(0,B.jsx)(`div`,{className:`workspace-diff-code-empty`,children:u?`Loading file content…`:`No file content available.`})]})}function xn({collapsed:e=!1,file:t,hideWhiteSpace:n=!1,wordWrap:r,workspaceName:i,workspaceRootPath:a,onSelectBreadcrumbPath:o,headerActions:s}){let c=(0,z.useMemo)(()=>En(t.patch,n),[t.patch,n]),l=sn(t.path);return(0,B.jsxs)(`div`,{className:`workspace-diff-preview ${r?`wrap`:``}`,children:[(0,B.jsxs)(`div`,{className:`workspace-diff-file-heading`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(R,{path:t.path,workspaceName:i??null,workspaceRootPath:a,onSelectPath:o}),(0,B.jsxs)(`span`,{className:`diff-addition`,children:[`+`,t.additions]}),(0,B.jsxs)(`span`,{className:`diff-deletion`,children:[`-`,t.deletions]})]}),s]}),e?(0,B.jsx)(`div`,{className:`workspace-diff-code-empty`,children:`Diff collapsed`}):(0,B.jsx)(wn,{ariaLabel:`${t.path} diff`,className:`workspace-diff-code`,emptyMessage:`No patch available.`,rows:c,renderRow:(e,t)=>e.kind===`spacer`?(0,B.jsx)(`div`,{className:`workspace-diff-spacer`,role:`row`,children:e.label},`${e.label}-${t}`):(0,B.jsxs)(`div`,{className:`workspace-diff-code-row ${e.kind}`,role:`row`,children:[(0,B.jsx)(`span`,{className:`workspace-diff-line-number`,role:`cell`,children:e.newLine||e.oldLine}),(0,B.jsx)(`code`,{role:`cell`,children:(0,B.jsx)(Y,{language:l,text:e.newContent||e.oldContent||` `})})]},`${e.oldLine}-${e.newLine}-${t}`),wordWrap:r})]})}function Sn({collapsed:e,file:t,hideWhiteSpace:n,wordDiffs:r,wordWrap:i,workspaceName:a,workspaceRootPath:o,onSelectBreadcrumbPath:s,headerActions:c}){let l=(0,z.useMemo)(()=>En(t.patch,n),[t.patch,n]),u=sn(t.path);return(0,B.jsxs)(`div`,{className:`workspace-diff-preview split ${i?`wrap`:``} ${r?`word-diffs`:``}`,children:[(0,B.jsxs)(`div`,{className:`workspace-diff-file-heading`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(R,{path:t.path,workspaceName:a,workspaceRootPath:o,onSelectPath:s}),(0,B.jsxs)(`span`,{className:`diff-addition`,children:[`+`,t.additions]}),(0,B.jsxs)(`span`,{className:`diff-deletion`,children:[`-`,t.deletions]})]}),(0,B.jsxs)(`span`,{className:`workspace-file-heading-end`,children:[c,(0,B.jsx)(ae,{size:14})]})]}),e?(0,B.jsx)(`div`,{className:`workspace-diff-code-empty`,children:`Diff collapsed`}):(0,B.jsx)(wn,{ariaLabel:`${t.path} split diff`,className:`workspace-split-code`,emptyMessage:`No patch available.`,rows:l,renderRow:(e,t)=>e.kind===`spacer`?(0,B.jsx)(`div`,{className:`workspace-diff-spacer split`,role:`row`,children:e.label},`${e.label}-${t}`):(0,B.jsxs)(`div`,{className:`workspace-split-row ${e.kind}`,role:`row`,children:[(0,B.jsx)(`span`,{className:`workspace-diff-line-number old`,role:`cell`,children:e.oldLine}),(0,B.jsx)(`code`,{className:`old`,role:`cell`,children:(0,B.jsx)(Y,{language:u,text:e.oldContent||` `})}),(0,B.jsx)(`span`,{className:`workspace-diff-line-number new`,role:`cell`,children:e.newLine}),(0,B.jsx)(`code`,{className:`new`,role:`cell`,children:(0,B.jsx)(Y,{language:u,text:e.newContent||` `})})]},`${e.oldLine}-${e.newLine}-${t}`),wordWrap:i})]})}function Cn(e){return e.length>0&&/^[A-Za-z0-9+/=\s]+$/.test(e)}function wn({ariaLabel:e,className:t,emptyMessage:n,rows:r,renderRow:i,wordWrap:a}){let o=!a&&r.length>vn,{endIndex:s,offsetTop:c,scrollRef:l,startIndex:u,totalHeight:d}=Tn(r.length,o);return r.length===0?(0,B.jsx)(`div`,{className:t,role:`table`,"aria-label":e,children:(0,B.jsx)(`div`,{className:`workspace-diff-code-empty`,children:n})}):o?(0,B.jsx)(`div`,{className:`${t} virtualized`,ref:l,role:`table`,"aria-label":e,"aria-rowcount":r.length,children:(0,B.jsx)(`div`,{className:`workspace-diff-virtual-spacer`,style:{height:d},children:(0,B.jsx)(`div`,{className:`workspace-diff-virtual-window`,style:{transform:`translateY(${c}px)`},children:r.slice(u,s).map((e,t)=>i(e,u+t))})})}):(0,B.jsx)(`div`,{className:t,role:`table`,"aria-label":e,children:r.map(i)})}function Tn(e,t){let n=(0,z.useRef)(null),[r,i]=(0,z.useState)({height:968,scrollTop:0}),a=(0,z.useCallback)(()=>{let e=n.current;e&&i({height:e.clientHeight||968,scrollTop:e.scrollTop})},[]);if((0,z.useEffect)(()=>{if(!t)return;let e=n.current;if(!e)return;a();let r=0,i=()=>{typeof window>`u`?a():(window.cancelAnimationFrame(r),r=window.requestAnimationFrame(a))};e.addEventListener(`scroll`,i,{passive:!0});let o=typeof ResizeObserver>`u`?null:new ResizeObserver(()=>i());return o?.observe(e),()=>{e.removeEventListener(`scroll`,i),o?.disconnect(),typeof window<`u`&&window.cancelAnimationFrame(r)}},[t,a]),!t)return{endIndex:e,offsetTop:0,scrollRef:n,startIndex:0,totalHeight:e*_n};let o=Math.ceil(r.height/_n),s=Math.max(0,Math.floor(r.scrollTop/_n)-yn);return{endIndex:Math.min(e,s+o+24),offsetTop:s*_n,scrollRef:n,startIndex:s,totalHeight:e*_n}}function En(e,t){if(!e.trim())return[];let n=[],r=0,i=0,a=null,o=null,s=!1,c=[];function l(){n.push(...Dn(c)),c=[]}function u(){s&&=(l(),a=r,o=i,!1)}for(let d of e.split(`
6
- `)){let e=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(d);if(e){u();let t=Number(e[1]),c=Number(e[2]);if(a!==null&&o!==null){let e=Math.max(t-a,c-o,0);e>0&&n.push({kind:`spacer`,label:On(e)})}r=t,i=c,s=!0;continue}if(d.startsWith(`diff --git`)||d.startsWith(`index `)||d.startsWith(`--- `)||d.startsWith(`+++ `)||!s||d.startsWith(`\\ No newline`))continue;let f=d.slice(1)||` `;if(t&&!f.trim())continue;if(d.startsWith(`+`)){l(),n.push({kind:`addition`,oldLine:``,newLine:String(i||``),oldContent:``,newContent:f}),i+=1;continue}if(d.startsWith(`-`)){l(),n.push({kind:`deletion`,oldLine:String(r||``),newLine:``,oldContent:f,newContent:``}),r+=1;continue}let p=d.startsWith(` `)?d.slice(1)||` `:d||` `;(!t||p.trim())&&(c.push({kind:`context`,oldLine:String(r||``),newLine:String(i||``),oldContent:p,newContent:p}),r+=1,i+=1)}return u(),n}function Dn(e){if(e.length<gn)return e;let t=e.length-12;return t<=0?e:[...e.slice(0,hn),{kind:`spacer`,label:On(t)},...e.slice(-6)]}function On(e){return`${e} unmodified ${e===1?`line`:`lines`}`}var kn=`openpond.workspace.editorControlsVisible`;function An(){try{return f.getItem(kn)===`true`}catch{return!1}}function jn(e){try{f.setItem(kn,String(e))}catch{}}function Mn({activeDiagnostics:e,activeServers:t,editorDiagnosticsChecking:n,editorLspEnabled:r,showEditorCommandBar:i}){if(!i)return null;if(!r)return{label:`LSP off`,severity:`unavailable`};if(n)return{label:`Checking`,severity:`info`};let a=e.filter(e=>e.severity===`error`).length;if(a>0)return{label:`${a} error${a===1?``:`s`}`,severity:`error`};let o=e.filter(e=>e.severity===`warning`).length;if(o>0)return{label:`${o} warning${o===1?``:`s`}`,severity:`warning`};let s=e.length;if(s>0)return{label:`${s} note${s===1?``:`s`}`,severity:`info`};if(!t)return null;let c=t.find(e=>e.status!==`connected`);return c?{label:c.id===`none`?`No LSP`:`${c.id} unavailable`,severity:`unavailable`}:{label:`No issues`,severity:`none`}}var Nn=t({WorkspaceDiffPanel:()=>Rn}),Pn=3e3,Fn=2e3,In=[],Ln=[];function Rn({appId:e,workspaceId:t,workspaceKind:n,connection:r,runtimeEvents:i,diff:a,editorPreferences:o,loading:s,workspaceName:c,workspaceInitialized:l,workspaceError:u,expanded:d,fileRootPath:f,filesWithPreview:p=!1,openFileRequest:m,readOnly:h=!1,sideChatTabs:g,sourceSwitcher:_,tabRequest:v,renderOutputs:ee,outputsLabel:te,additionalTabs:ne,viewState:y,onRefresh:b,onResizeStart:re,onToggleExpanded:x,onOpenBrowser:ie,onOpenBrowserUrl:ae,onViewStateChange:oe,onCloseSideChat:S,onOpenSideChat:C,onSelectSideChat:w,goalDetails:se,sandboxFileSource:ce,trainingSummary:le,sidebarFileBookmarks:ue=[],sidebarFileSourceSessionId:de=null,onSetSidebarFileStatus:fe}){return(0,B.jsx)(Wn,{appId:e,workspaceId:t,workspaceKind:n,connection:r,runtimeEvents:i??[],diff:a,editorPreferences:o??null,loading:s,workspaceName:c,workspaceInitialized:l,workspaceError:u,expanded:d,fileRootPath:f??null,filesWithPreview:p,openFileRequest:m,readOnly:h,sideChatTabs:g??[],sourceSwitcher:_??null,tabRequest:v??null,additionalTabs:ne,renderOutputs:ee??null,outputsLabel:te,viewState:y??null,onRefresh:b,onResizeStart:re,onToggleExpanded:x,onOpenBrowser:ie,onOpenBrowserUrl:ae,onViewStateChange:oe,onCloseSideChat:S,onOpenSideChat:C,onSelectSideChat:w,goalDetails:se??null,sandboxFileSource:ce??null,trainingSummary:le??null,sidebarFileBookmarks:ue,sidebarFileSourceSessionId:de,onSetSidebarFileStatus:fe})}function zn(e,t,n,r){return e&&t?.content!=null?{...e,content:t.content,contentType:t.contentType,contentEncoding:t.contentEncoding,readVersion:t.readVersion,readStamp:t.readStamp}:t&&!e&&Bn(t)?t:e&&Bn(e)?e:t&&Bn(t)?t:e??t??n??je(r)}function Bn(e){return!!(e.patch||e.content!=null)}function Vn({changedFiles:e,checkpointStatus:t,dirty:n,error:r,loading:i,preservedReadback:a,sandboxMode:o,sourcePending:s}){if(s)return{label:`sandbox pending`,tone:`loading`};if(i)return{label:`refreshing`,tone:`loading`};if(o&&a&&t)return t;if(r)return{label:`status unavailable`,tone:`error`};if(o&&t?.tone===`error`||o&&t&&!n&&e===0)return t;if(n||e>0){let t=Math.max(1,e),n=t===1?`change`:`changes`;return{label:o?`${t} unpreserved ${n}`:`${t} local ${n}`,tone:`dirty`}}return{label:o?`sandbox clean`:`local clean`,tone:`clean`}}function Hn(e,t){if(!t)return null;for(let n=e.length-1;n>=0;--n){let r=e[n];if(r?.name!==`workspace_action_result`)continue;let i=r.data&&typeof r.data==`object`&&!Array.isArray(r.data)?r.data:null,a=i?.sourcePreservation&&typeof i.sourcePreservation==`object`&&!Array.isArray(i.sourcePreservation)?i.sourcePreservation:null;if(a?.attempted===!0&&a.sandboxId===t)return a.ok===!0?a.preserved===!0?{label:`checkpoint saved`,tone:`clean`}:{label:`checkpoint clean`,tone:`clean`}:{label:`checkpoint failed`,tone:`error`}}return null}function Un(e){let t=e.split(`/`).filter(Boolean);return t.map((e,n)=>t.slice(0,n+1).join(`/`))}function Wn({appId:e,workspaceId:t,workspaceKind:n,connection:r,runtimeEvents:i,diff:a,editorPreferences:o,loading:s,workspaceName:c,workspaceInitialized:l,workspaceError:u,expanded:d,fileRootPath:f,filesWithPreview:h,openFileRequest:g,readOnly:_,sideChatTabs:ee,sourceSwitcher:ne,tabRequest:y,renderOutputs:b,outputsLabel:x,additionalTabs:ae,viewState:S,onRefresh:w,onResizeStart:se,onToggleExpanded:fe,onOpenBrowser:pe,onOpenBrowserUrl:me,onViewStateChange:he,onCloseSideChat:ge,onOpenSideChat:ve,onSelectSideChat:ye,goalDetails:T,sandboxFileSource:be,trainingSummary:xe,sidebarFileBookmarks:Se,sidebarFileSourceSessionId:Ce,onSetSidebarFileStatus:we}){let E=S??Je(),[Te,Ee]=(0,z.useState)(!b||y?.tab===`files`||E.filesTabOpen),[Oe,D]=(0,z.useState)(E.overviewTabs),[Ie,O]=(0,z.useState)(E.activeOverviewId),Re=(0,z.useRef)(Math.max(0,...E.overviewTabs)+1),[ze,k]=(0,z.useState)(E.tabOrder),[A,j]=(0,z.useState)(y?.tab??E.activeTab),[Be,Ve]=(0,z.useState)(!1),[He,N]=(0,z.useState)(!1),[We,P]=(0,z.useState)(!1),[Ge,Ke]=(0,z.useState)(``),[I,qe]=(0,z.useState)(()=>[...E.openFilePaths]),[L,R]=(0,z.useState)(E.selectedPath),[Ye,Xe]=(0,z.useState)(!1),[Ze,et]=(0,z.useState)(!1),[tt,nt]=(0,z.useState)(!1),[rt,it]=(0,z.useState)(!0),[at,ot]=(0,z.useState)(An);p(()=>ot(An()));let[st,lt]=(0,z.useState)(!1),[ut,dt]=(0,z.useState)(!1),[ft,pt]=(0,z.useState)(!1),[V,mt]=(0,z.useState)({}),ht=(0,z.useRef)(new rn),[gt,_t]=(0,z.useState)({}),[vt,yt]=(0,z.useState)(()=>new Set),[bt,xt]=(0,z.useState)({}),[St,Ct]=(0,z.useState)({}),[wt,Tt]=(0,z.useState)(()=>new Set),[Et,Dt]=(0,z.useState)(null),[Ot,kt]=(0,z.useState)(!1),[H,At]=(0,z.useState)(null),[jt,Mt]=(0,z.useState)({}),[Nt,U]=(0,z.useState)({}),[Pt,It]=(0,z.useState)(null),[Lt,Rt]=(0,z.useState)(null),[zt,W]=(0,z.useState)(null),[Bt,Vt]=(0,z.useState)(null);De(u,{prefix:`Workspace`}),De(H,{prefix:`Sandbox files`});let[Ht,Ut]=(0,z.useState)(null),[Wt,Gt]=(0,z.useState)({}),[Kt,G]=(0,z.useState)(null),[Jt,Yt]=(0,z.useState)(null),[Xt,Qt]=(0,z.useState)(null),K=o??m.editor,en=(0,z.useRef)(V),q=(0,z.useRef)(Ne(E)),on=(0,z.useRef)(Ne(E)),sn=(0,z.useRef)(null),cn=(0,z.useRef)(w),ln=(0,z.useRef)(!1),un=(0,z.useRef)(null),J=(0,z.useRef)(0),Y=(0,z.useRef)(null),dn=(0,z.useRef)(null),X=be?.sandboxId?.trim()||null,Z=!!be,fn=!!xe||Z&&!!X,pn=Z?`sandbox:${X??`pending`}`:`workspace:${e??`none`}`,mn=Z?!!X:!!(e||r&&g&&C(g.path)),hn=(0,z.useRef)(pn),gn=!!(T?.createRuntime||T?.goalRuntime||T?.subagentRuntime),_n=(0,z.useCallback)(async(e={})=>{if(Z){if(!r)Dt(null),At(`OpenPond App server is not connected.`);else if(!X)Dt(null),At(null);else{e.silent||kt(!0);try{let[e,t,n]=await Promise.allSettled([F.sandboxFiles(r,X,{recursive:!0,maxEntries:Fn}),F.sandboxGitStatus(r,X),F.sandboxGitDiff(r,X,{})]);if(e.status===`rejected`)throw e.reason;let i=ce(e.value.files),a=t.status===`fulfilled`?t.value.status:null,o=n.status===`fulfilled`?n.value.diff:null,s=le(o,a),c=s.reduce((e,t)=>e+t.additions,0),l=s.reduce((e,t)=>e+t.deletions,0);Dt({appId:X,repoPath:``,initialized:!0,dirty:a?!a.clean:s.length>0,filesChanged:s.length,additions:c,deletions:l,repoFiles:i,files:s,error:null,updatedAt:new Date().toISOString()}),At(null)}catch(e){Dt(null),At(e instanceof Error?e.message:String(e))}finally{e.silent||kt(!1)}}}},[r,X,Z]),vn=(0,z.useMemo)(()=>oe(i,X),[i,X]),yn=!!(Et&&((Et.files?.length??0)>0||(Et.repoFiles?.length??0)>0)),xn=Z&&!yn&&!!vn,Sn=Z?yn?Et:vn??Et:a,Cn=Sn?.repoPath??null,wn=(0,z.useMemo)(()=>Hn(i,X),[i,X]),Tn=Sn?.files??In,En=Sn?.files??In,Dn=(0,z.useMemo)(()=>new Map(En.map(e=>[e.path,e])),[En]),On=(0,z.useMemo)(()=>new Map(Tn.map(e=>[e.path,e])),[Tn]),kn=Sn?.repoFiles??(Tn.length>0?Tn.map(e=>e.path):Ln),Nn=(0,z.useMemo)(()=>Tn.filter(e=>!Fe(e,kn)),[kn,Tn]),Rn=(0,z.useMemo)(()=>Xt&&!kn.includes(Xt)?[Xt,...kn]:kn,[kn,Xt]),Bn=(0,z.useMemo)(()=>I.map(e=>Dn.get(e)??V[e]??On.get(e)??je(e)),[Dn,On,V,I]),Wn=(0,z.useMemo)(()=>{let e={};for(let t of I){if(M(t)||ke(t))continue;let n=zn(Dn.get(t),V[t],On.get(t),t);n.content!=null&&n.contentEncoding!==`base64`&&(e[t]=n.content)}return e},[Dn,On,V,I]),Gn=(0,z.useMemo)(()=>{let e=new Set;for(let[t,n]of Object.entries(St))n.content!==n.savedContent&&e.add(t);return e},[St]),Kn=(0,z.useMemo)(()=>{let e=Ge.trim().toLowerCase(),t=Rn;return e?t.filter(t=>t.toLowerCase().includes(e)):t},[Rn,Ge]),qn=(0,z.useMemo)(()=>({activeTab:A,openFilePaths:I,selectedPath:L,filesTabOpen:Te,overviewTabs:Oe,activeOverviewId:Ie,tabOrder:ze}),[A,I,L,Te,Oe,Ie,ze]);(0,z.useEffect)(()=>{en.current=V},[V]),(0,z.useEffect)(()=>{un.current=Kt},[Kt]),(0,z.useEffect)(()=>{Ct(e=>{let t=!1,n={...e},r=new Set(I),i=a?.updatedAt?Date.parse(a.updatedAt):null;for(let[e,i]of Object.entries(n))r.has(e)||i.content!==i.savedContent||(delete n[e],t=!0);for(let[e,r]of Object.entries(Wn)){let a=n[e];if(!a)n[e]={content:r,savedContent:r},t=!0;else if(a.content===a.savedContent&&a.savedContent!==r){if(a.savedAt&&(i===null||i<a.savedAt))continue;n[e]={content:r,savedContent:r},t=!0}}return t?n:e})},[a?.updatedAt,Wn,I]),(0,z.useEffect)(()=>{cn.current=w},[w]),(0,z.useEffect)(()=>{if(!S)return;let e=Me(S,Cn);vt.size>0?q.current=e:Le(q.current,e)||(q.current=e,on.current=e,j(t=>y?.tab===`outputs`&&t===`outputs`?t:e.activeTab),qe(e.openFilePaths),R(e.selectedPath),Ee(!b||e.filesTabOpen),D(e.overviewTabs),O(e.activeOverviewId),k(e.tabOrder),Re.current=Math.max(0,...e.overviewTabs)+1)},[S,Cn,y?.tab,vt]),(0,z.useEffect)(()=>{if(vt.size>0||Le(on.current,qn))return;let e=Ne(qn);on.current=e,q.current=e,he?.(e)},[qn,he,vt]),(0,z.useEffect)(()=>{_||Z||!r||!e||!l||a||u||ln.current||(ln.current=!0,Promise.resolve(cn.current({silent:!0})).catch(()=>{}).finally(()=>{ln.current=!1}))},[e,r,a,_,Z,u,l]),(0,z.useEffect)(()=>{if(hn.current!==pn){hn.current=pn,Y.current?.abort(Error(`lsp_diagnostics_source_changed`)),Y.current=null;let e=new Set([...vt].filter(e=>C(e)&&gt[e]===null));qe(t=>t.filter(t=>e.has(t))),R(t=>t&&e.has(t)?t:null),mt(t=>Object.fromEntries(Object.entries(t).filter(([t])=>e.has(t)))),yt(e),_t(t=>Object.fromEntries(Object.entries(t).filter(([t])=>e.has(t)))),ht.current.retain(e),xt(t=>Object.fromEntries(Object.entries(t).filter(([t])=>e.has(t)))),Ct({}),Tt(new Set),Dt(null),At(null),kt(!1),Mt({}),U({}),It(null),Rt(t=>t&&e.has(t)?t:null),Vt(null),Ut(null),Gt({}),G(null),Yt(null),Qt(null)}return()=>{Y.current?.abort(Error(`lsp_diagnostics_unmounted`)),Y.current=null}},[pn]),(0,z.useEffect)(()=>{g&&sn.current!==g.id&&(g.file||mn)&&(sn.current=g.id,g.file?Zn(g.file,g.imageUrl,g.source,g):Xn(g.path,{source:g.source}))},[mn,g]),(0,z.useEffect)(()=>{if(!Z||(_n(),!r||!X))return;let e=!1;async function t(){if(!(e||ln.current)&&(typeof document>`u`||document.visibilityState!==`hidden`)){ln.current=!0;try{await _n({silent:!0})}finally{ln.current=!1}}}let n=window.setInterval(()=>{t()},Pn),i=()=>{t()};return window.addEventListener(`focus`,i),()=>{e=!0,window.clearInterval(n),window.removeEventListener(`focus`,i)}},[r,_n,X,Z]),(0,z.useEffect)(()=>{if(_||Z||!r||!e||!l)return;let t=!1;async function n(){if(!(t||ln.current)&&(typeof document>`u`||document.visibilityState!==`hidden`)){ln.current=!0;try{await cn.current({silent:!0})}catch{}finally{ln.current=!1}}}let i=window.setInterval(()=>{n()},Pn),a=()=>{n()};return window.addEventListener(`focus`,a),()=>{t=!0,window.clearInterval(i),window.removeEventListener(`focus`,a)}},[e,r,_,Z,l]),(0,z.useEffect)(()=>{if(Z||!r||!e||n===`local_project`){Qt(null);return}let t=!1;return F.workspaceTemplateConfig(r,e).then(e=>{t||Qt(e.exists?e.configPath??`openpond.config.json`:null)}).catch(()=>{t||Qt(null)}),()=>{t=!0}},[e,r,Z,n]),(0,z.useEffect)(()=>{!L||Rn.includes(L)||I.includes(L)||R(Nn[0]?.path??null)},[Nn,I,Rn,L]),(0,z.useEffect)(()=>{T?.active&&gn&&j(`goal`)},[T?.active,gn]),(0,z.useEffect)(()=>{if(y){if(y.tab===`files`&&mr(),y.tab===`outputs`){if(y.overview===`experiments`)D(e=>e.includes(-1)?e:[...e,-1]),O(-1),k(e=>e.includes(`overview--1`)?e:[...e,`overview--1`]);else if(y.overview===`new`){let e=Oe.find(e=>e!==-1)??Re.current++;D(t=>t.includes(e)?t:[...t,e]),O(e),k(t=>t.includes(`overview-${e}`)?t:[...t,`overview-${e}`])}}j(y.tab)}},[y]),(0,z.useEffect)(()=>{!gn&&A===`goal`&&j(`files`)},[A,gn]),(0,z.useEffect)(()=>{!fn&&A===`summary`&&j(`files`)},[A,fn]);let Q=A===`file`||h&&A===`files`?L:null;(0,z.useEffect)(()=>{if(!r||!Q||vt.has(Q))return;if(M(Q)){Vt(null),Rt(e=>e===Q?null:e);return}let t=Ht?.path===Q,n=$n(Q);if(_&&(n?.content!=null||n?.patch)||!t&&(n?.content!=null||n?.patch&&!tt)){Vt(null),Rt(e=>e===Q?null:e);return}let a=!1,o=en.current[Q];o?.content==null&&(tt||!o?.patch)&&Rt(Q),Vt(null);let s=e||C(Q);return(Z?X?de(r,X,Q,i):Promise.reject(Error(be?.emptyMessage??`No sandbox filesystem is available.`)):s?F.workspaceFile(r,s,Q):Promise.reject(Error(`Workspace files are unavailable.`))).then(e=>{a||mt(t=>{let n=t[e.path];return n?.content===e.content&&n.contentType===e.contentType&&n.contentEncoding===e.contentEncoding&&n.patch===e.patch&&n.status===e.status?t:{...t,[e.path]:e}})}).catch(e=>{a||Vt(e instanceof Error?e.message:String(e))}).finally(()=>{a||(Rt(e=>e===Q?null:e),Ut(e=>e&&e.id===Ht?.id&&e.path===Q?null:e))}),()=>{a=!0}},[A,e,r,Ht,tt,_,i,be?.emptyMessage,X,Z,Q,vt]);function Jn(e){let t=A===`outputs`||b&&A===`files`&&!Te?`overview-${Ie}`:null;t&&D(e=>e.filter(e=>e!==Ie)),k(n=>n.includes(e)?t?n.filter(e=>e!==t):n:t&&n.includes(t)?n.map(n=>n===t?e:n):[...n,e])}function Yn(){if(Oe.some(e=>e!==-1))O(Oe.filter(e=>e!==-1).at(-1));else{let e=Re.current++;D([e]),O(e),k(t=>[...t,`overview-${e}`])}j(`outputs`)}function Xn(t,n){W(null);let i=Z?X:e;if(re(t)&&!n?.source&&r&&i){ue(r,i,t,Z?`sandbox`:`local`).then(me).catch(e=>W(e instanceof Error?e.message:`Could not open HTML preview.`));return}let a=Ue(t,Cn);a&&(ht.current.close(a),_t(e=>{if(!Object.hasOwn(e,a))return e;let t={...e};return delete t[a],t}),Jn(h?`files`:a),h&&Ee(!0),yt(e=>{if(!e.has(a))return e;let t=new Set(e);return t.delete(a),t}),mt(e=>{if(!(a in e))return e;let t={...e};return delete t[a],t}),xt(e=>{if(!(a in e))return e;let t={...e};return delete t[a],t}),Ut({id:Date.now(),path:a}),h||qe(e=>e.includes(a)?e:[...e,a]),R(a),j(h?`files`:`file`),!Z&&r&&e&&M(a)&&Yt(a),N(!1),P(!1),Ke(``))}function Zn(e,t,n=!1,i){if(re(e.path)&&e.content!=null&&!n&&r){v(r,e.path,e.content).then(me).catch(e=>W(e instanceof Error?e.message:`Could not open HTML preview.`));return}let a=C(e.path)?e.path:Ue(e.path,Cn);if(!a)return;let o=ht.current.receive(a,i);if(o===`ignore`)return;let s=o===`complete`;if(s&&!h&&!I.includes(a))return;s||(Jn(h?`files`:a),h&&Ee(!0)),i?.sandboxId!==void 0&&_t(e=>({...e,[a]:i.sandboxId}));let c={...e,path:a};mt(e=>i?.loading&&e[a]?.content!=null?e:{...e,[a]:c}),yt(e=>{let t=new Set(e);return t.add(a),t}),xt(e=>{if(!t){if(!(a in e))return e;let t={...e};return delete t[a],t}return e[a]===t?e:{...e,[a]:t}}),s?(L===a&&Vt(i?.error??null),Rt(e=>e===a?null:e)):(Ut(null),Vt(i?.error??null),Rt(i?.loading?a:null),h||qe(e=>e.includes(a)?e:[...e,a]),R(a),j(h?`files`:`file`),N(!1),P(!1),Ke(``))}let Qn=(0,z.useCallback)(()=>{ot(e=>{let t=!e;return jn(t),t})},[]),$n=e=>zn(Dn.get(e),V[e],On.get(e),e),er=(0,z.useCallback)((e,t)=>{Ct(n=>{let r=n[e],i=r?.savedContent??Wn[e]??$n(e).content??``;return{...n,[e]:{content:t,savedContent:i,savedAt:r?.savedAt}}}),Gt(t=>{if(!(e in t))return t;let n={...t};return delete n[e],n})},[Dn,On,V,Wn]),tr=(0,z.useCallback)(async(t,n={})=>{if(Z||!r||!e||M(t))return;let i=$n(t),a=n.content??St[t]?.content??i.content??void 0;if(a?.endsWith(`
7
-
8
- [file truncated]`))return;let o=J.current+1;J.current=o,Y.current?.abort(Error(`lsp_diagnostics_superseded`));let s=new AbortController;Y.current=s,It(t);try{let i=await F.workspaceLspTouch(r,e,{path:t,content:a,waitForDiagnostics:n.waitForDiagnostics??!0},{signal:s.signal});if(o!==J.current)return;Mt(e=>({...e,[i.path]:i.diagnostics})),U(e=>({...e,[i.path]:i.servers}))}catch(e){if(s.signal.aborted||o!==J.current)return;let n=e instanceof Error?e.message:String(e);Mt(e=>({...e,[t]:[]})),U(e=>({...e,[t]:[{id:`lsp`,root:``,status:`error`,message:n}]}))}finally{Y.current===s&&(Y.current=null),!s.signal.aborted&&o===J.current&&It(e=>e===t?null:e)}},[e,r,Dn,On,St,V,Z]),nr=(0,z.useCallback)(async t=>{if(Z||!r||!e)throw Error(`Workspace LSP is unavailable.`);return F.workspaceLspAction(r,e,t)},[e,r,Z]),rr=(0,z.useCallback)(async t=>{if(!r||!e&&!X||un.current===t)return;let n=St[t];if(!n||n.content===n.savedContent)return;let i=n.content,a=Date.now();un.current=t,G(t),Gt(e=>{if(!(t in e))return e;let n={...e};return delete n[t],n});try{let n=Z?await _e(r,X,t,i):await F.saveWorkspaceFile(r,e,{path:t,content:i});mt(e=>({...e,[n.path]:n})),Ct(e=>{let n=e[t];return n?{...e,[t]:{content:n.content,savedContent:i,savedAt:a}}:e}),K.languageServers!==`off`&&K.checkOnSave&&await tr(t,{content:i,waitForDiagnostics:!0}),Z?await _n({silent:!0}):await w({silent:!0})}catch(e){Gt(n=>({...n,[t]:e instanceof Error?e.message:String(e)}))}finally{un.current===t&&(un.current=null),G(e=>e===t?null:e)}},[K.checkOnSave,K.languageServers,e,r,St,w,tr,_n,X,Z]),ir=L?$n(L):null,ar=!!(L&&vt.has(L)),or=L?St[L]?.content??ir?.content??null:null,sr=!(!ir?.patch||tt),cr=!(_||ar||A!==`file`||sr||!L||or==null||M(L)||ke(L)||ir?.contentEncoding===`base64`||rt&&Pe(L)||or.endsWith(`
9
-
10
- [file truncated]`));(0,z.useEffect)(()=>{if(K.languageServers===`off`||!K.diagnosticsWhileEditing||!L||!cr||or==null)return;let e=window.setTimeout(()=>{tr(L,{content:or,waitForDiagnostics:!0})},700);return()=>window.clearTimeout(e)},[K.diagnosticsWhileEditing,K.languageServers,tr,or,cr,L]),(0,z.useEffect)(()=>{function e(e){(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`s`&&A===`file`&&L&&(e.preventDefault(),Gn.has(L)&&rr(L))}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[A,Gn,rr,L]);let lr=(0,z.useCallback)(()=>{L&&(dn.current?dn.current.save():rr(L))},[rr,L]),ur=(0,z.useCallback)(()=>{dn.current?.undo()},[]),dr=(0,z.useCallback)(()=>{dn.current?.redo()},[]),fr=(0,z.useCallback)(()=>{L&&K.languageServers!==`off`&&tr(L,{content:or??void 0,waitForDiagnostics:!0})},[K.languageServers,tr,or,L]);function pr(e,t){if(t.stopPropagation(),(!Gn.has(e)||window.confirm(`Discard unsaved changes to ${e}?`))&&(Gn.has(e)&&(Ct(t=>{if(!(e in t))return t;let n={...t};return delete n[e],n}),Gt(t=>{if(!(e in t))return t;let n={...t};return delete n[e],n})),ht.current.close(e),_t(t=>{if(!Object.hasOwn(t,e))return t;let n={...t};return delete n[e],n}),qe(t=>t.filter(t=>t!==e)),k(t=>t.filter(t=>t!==e)),vt.has(e)&&mt(t=>{if(!(e in t))return t;let n={...t};return delete n[e],n}),xt(t=>{if(!(e in t))return t;let n={...t};return delete n[e],n}),yt(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n}),L===e)){let t=Bn.findIndex(t=>t.path===e),n=Bn[t+1]??Bn[t-1]??null;R(n?.path??null),!n&&A===`file`&&(b?Yn():j(`files`))}}function mr(){Jn(`files`),Ee(!0),j(`files`),N(!1),P(!1)}function hr(e){Tt(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}function gr(e){Jn(`files`),Ee(!0),e&&Tt(t=>{let n=new Set(t);for(let t of Un(e))n.add(t);return n}),j(`files`),N(!1),P(!1)}function _r(){let e=`git apply <<'PATCH'\n${Nn.map(e=>e.patch).filter(Boolean).join(`
11
- `)}\nPATCH`;navigator.clipboard?.writeText(e)}let vr=Nn.length>0,yr=Rn.length>0,br=I.length>0,xr=gn||fn||vr||yr||br,$=A===`outputs`&&b?`outputs`:A===`goal`&&gn?`goal`:A===`summary`&&fn?`summary`:A===`file`&&L?`file`:b&&!Te?`outputs`:`files`;(0,z.useEffect)(()=>{if($!==`outputs`||Oe.length)return;let e=Re.current++;D([e]),O(e),k(t=>[...t,`overview-${e}`]),j(`outputs`)},[Oe.length,$]);let Sr=$===`files`?`No files to show`:`No local changes`,Cr=n===`local_project`&&!l&&!u,wr=Z?Ot:s,Tr=Z?H:u,Er=Vn({changedFiles:Sn?.filesChanged??Nn.length,checkpointStatus:wn,dirty:!!Sn?.dirty,error:Tr,loading:wr,preservedReadback:xn,sandboxMode:Z,sourcePending:Z&&!X}),Dr=wr?`Loading workspace files`:Tr?`Workspace files are unavailable`:Z&&!X?be?.emptyMessage??`No sandbox filesystem is available.`:Cr?`Loading workspace files`:l?Sr:`No local files to show`,Or=L?bt[L]??null:null,kr=!Or&&!Z&&L&&M(L)?L:null,Ar=Jt?bt[Jt]??null:null,jr=!Ar&&!Z&&Jt&&M(Jt)?Jt:null,Mr=te(r,e,kr),Nr=te(r,e,jr),Pr=Or??Mr,Fr=Ar??Nr,Ir=$===`file`||h&&$===`files`?L:null,Lr=!!(Ir&&Pe(Ir)),Rr=L?jt[L]??[]:[],zr=L?Nt[L]??null:null,Br=!!(L&&Pt===L),Vr=at&&cr,Hr=!_&&!ar&&!Z&&K.languageServers!==`off`,Ur=(0,z.useMemo)(()=>Mn({activeDiagnostics:Rr,activeServers:zr,editorDiagnosticsChecking:Br,editorLspEnabled:Hr,showEditorCommandBar:Vr}),[Rr,zr,Br,Hr,Vr]),Wr=(0,z.useCallback)(async e=>{if(!r)throw Error(`OpenPond server connection is unavailable.`);await F.runSubagentLifecycleAction(r,e.runId,{action:e.action,reason:`User requested from Goal details.`}),await w({silent:!0})},[r,w]),Gr=Z?`sandbox`:n===`local_project`?`local`:null,Kr=(0,z.useMemo)(()=>{let e=new Map;if(!Gr)return e;for(let n of Se)n.workspaceKind===Gr&&n.workspaceId===(t??(Gr===`local`?C(n.path):null))&&e.set(n.path,n);return e},[Se,Gr,t]),qr=(0,z.useCallback)(e=>{try{return Kr.get(Qe(e))?.status??null}catch{return null}},[Kr]),Jr=(0,z.useCallback)((e,n)=>{let r=t??(Gr===`local`?C(e):null);if(!Gr||!r||!we)return;let i;try{i=Qe(e)}catch{return}let a=Kr.get(i),o=new Date().toISOString();we(a??{id:$e({workspaceKind:Gr,workspaceId:r,path:i}),workspaceKind:Gr,workspaceId:r,workspaceName:c??`Local files`,path:i,status:`pinned`,order:null,sourceSessionId:Ce,available:!0,createdAt:o,updatedAt:o},n)},[we,Kr,Ce,Gr,t,c]),Yr=!!(Gr&&we&&(t||Gr===`local`&&I.some(e=>C(e)))),Xr=L&&Yr&&!ar?(0,B.jsx)(Zt,{currentStatus:qr(L),onSetStatus:e=>Jr(L,e)}):null,Zr=L?(0,B.jsxs)(`div`,{className:`workspace-active-file-preview`,children:[(0,B.jsx)(an,{file:$n(L),connection:r,workspaceId:e,sandboxId:Object.hasOwn(gt,L)?gt[L]:Z?X:null,dirty:Gn.has(L),onReload:(e,t)=>{mt(t=>({...t,[L]:{...e,path:L}})),Ct(e=>{let t={...e};return delete t[L],t}),t&&xt(e=>({...e,[L]:t})),Vt(null),!ke(L)&&!M(L)&&nt(!0)}},`${pn}:${gt[L]??`local`}:${L}`),(0,B.jsx)(bn,{diagnostics:Hr?jt[L]??[]:[],draftContent:St[L]?.content,editorRef:dn,editable:cr&&!Pr,error:Bt,file:$n(L),collapsed:Ze,hideWhiteSpace:ut,headerActions:Xr,imageSrc:Pr,loading:Lt===L,loadFullFiles:tt,saveError:Wt[L]??null,saving:Kt===L,onOpenImage:()=>{Pr&&Yt(L)},onDraftContentChange:e=>er(L,e),onLspAction:Hr?nr:void 0,onSave:()=>void rr(L),onSelectBreadcrumbPath:gr,renderMarkdown:rt,splitView:ft,wordDiffs:st,wordWrap:Ye,workspaceName:c,workspaceRootPath:Cn})]}):null,Qr=($===`file`||h&&$===`files`)&&L&&!ke(L)&&!M(L)&&ir?.contentEncoding!==`base64`?(0,B.jsx)(nn,{inline:!0,canSaveActiveFile:!(_||ar||!L||!Gn.has(L)||Kt===L),canCheckActiveFile:Hr,collapsed:Ze,editorControlsVisible:at,editorDiagnosticStatus:Ur,editorDiagnosticsChecking:Br,hideWhiteSpace:ut,loadFullFiles:tt,menuOpen:Be,renderMarkdown:rt,showEditorCommandBar:Vr,showRenderMarkdownToggle:Lr,splitView:ft,wordDiffs:st,wordWrap:Ye,onCopyGitApply:_r,onEditorCheck:fr,onEditorRedo:dr,onEditorSave:lr,onEditorUndo:ur,onRefresh:()=>void(Z?_n():w()),onToggleCollapsed:()=>et(e=>!e),onToggleEditorControlsVisible:Qn,onToggleHideWhiteSpace:()=>dt(e=>!e),onToggleLoadFullFiles:()=>nt(e=>!e),onToggleMenu:e=>Ve(t=>e??!t),onToggleRenderMarkdown:()=>it(e=>!e),onToggleSplitView:()=>pt(e=>!e),onToggleWordDiffs:()=>lt(e=>!e),onToggleWordWrap:()=>Xe(e=>!e)}):null;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`aside`,{className:`workspace-diff-panel ${$===`outputs`?`workspace-diff-overview`:``} ${d?`expanded`:``}`,id:`right-sidebar-files-panel`,role:`tabpanel`,"aria-label":`Workspace diffs`,children:[!d&&(0,B.jsx)(`div`,{className:`workspace-diff-resize-handle`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize diff panel`,onPointerDown:se}),(0,B.jsx)(tn,{addMenuOpen:He,expanded:d,filteredFiles:Kn,openFiles:Bn,dirtyFilePaths:Gn,goalDetailsAvailable:gn,searchOpen:We,searchQuery:Ge,selectedPath:L,sideChatTabs:ee,summaryAvailable:fn,onSelectOutputs:b?()=>{D(e=>e.includes(-1)?e:[...e,-1]),O(-1),k(e=>e.includes(`overview--1`)?e:[...e,`overview--1`]),j(`outputs`),N(!1),P(!1)}:void 0,sourceStatus:Er,sourceSwitcher:ne,visibleTab:$,additionalTabs:ae,toolbarActions:Qr,tabOrder:ze,filesTabOpen:Te,onCloseFilesTab:b?()=>{Ee(!1),k(e=>e.filter(e=>e!==`files`)),A===`files`&&Yn()}:void 0,overviewTabs:b?Oe:[],outputsLabel:x,activeOverviewId:Ie,onNewOverview:b?()=>{let e=Re.current++;D(t=>[...t,e]),k(t=>[...t,`overview-${e}`]),O(e),j(`outputs`),N(!1),P(!1)}:void 0,onSelectOverview:e=>{O(e),j(`outputs`)},onCloseOverview:e=>{let t=Oe.filter(t=>t!==e);if(D(t),k(t=>t.filter(t=>t!==`overview-${e}`)),e===Ie&&A===`outputs`){if(t.length)O(t[t.length-1]);else if(b){let e=Re.current++;D([e]),O(e),j(`outputs`),k(t=>[...t,`overview-${e}`])}else if(Bn.length&&L)j(`file`);else if(Te)j(`files`);else{let e=Re.current++;D([e]),k(t=>[...t,`overview-${e}`]),O(e)}}},getFileBookmarkStatus:Yr?qr:void 0,onCloseFileTab:pr,onCloseSideChat:ge,onCloseSearch:()=>P(!1),onOpenFile:Xn,onOpenBrowser:pe?()=>{N(!1),P(!1),pe()}:void 0,onOpenSearch:()=>{N(!1),P(!0)},onOpenSideChat:ve?()=>{N(!1),P(!1),ve()}:void 0,onSearchQueryChange:Ke,onSetFileBookmarkStatus:Yr?Jr:void 0,onSelectFile:e=>{R(e),j(`file`)},onSelectFiles:mr,onSelectGoal:()=>j(`goal`),onSelectSummary:()=>{j(`summary`),N(!1),P(!1)},onSelectSideChat:ye,onToggleAddMenu:()=>{N(e=>!e),P(!1)},onToggleExpanded:fe}),zt&&(0,B.jsx)(Ae,{error:zt}),b?Oe.map(e=>(0,B.jsx)(`div`,{className:`workspace-diff-tool-view`,hidden:$!==`outputs`||Ie!==e,inert:$!==`outputs`||Ie!==e,children:b(()=>{P(!0),N(!1)},e)},e)):null,$===`outputs`&&b?null:$===`goal`&&gn?(0,B.jsx)(ct,{createRuntime:T?.createRuntime??null,goalRuntime:T?.goalRuntime??null,subagentRuntime:T?.subagentRuntime??null,onRunSubagentLifecycleAction:r?Wr:void 0}):$===`summary`&&fn?xe?(0,B.jsx)(qt,{summary:xe}):(0,B.jsx)(Ft,{sandboxId:X,connection:r}):xr?(0,B.jsxs)(B.Fragment,{children:[$===`files`&&(h?(0,B.jsxs)(`div`,{className:`workspace-diff-files-preview-layout`,children:[(0,B.jsx)($t,{diff:Sn,expandedFolderPaths:wt,rootPath:f,repoFiles:Rn,selectedPath:L,getFileBookmarkStatus:Yr?qr:void 0,onOpenFile:Xn,onSetFileBookmarkStatus:Yr?Jr:void 0,onToggleFolder:hr}),Zr??(0,B.jsx)(`div`,{className:`workspace-diff-files-preview-empty`,children:`Select a file to review its changes.`})]}):(0,B.jsx)($t,{diff:Sn,expandedFolderPaths:wt,rootPath:f,repoFiles:Rn,selectedPath:L,getFileBookmarkStatus:Yr?qr:void 0,onOpenFile:Xn,onSetFileBookmarkStatus:Yr?Jr:void 0,onToggleFolder:hr})),$===`file`&&L&&Zr]}):(0,B.jsx)(`div`,{className:`workspace-diff-empty`,children:(0,B.jsx)(`span`,{children:Dr})})]}),(0,B.jsx)(ie,{open:!!Fr,src:Fr,title:Jt??``,onClose:()=>Yt(null)})]})}export{Nn as n,nt as r,Rn as t};