openpond 0.2.70 → 0.2.72

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 (361) hide show
  1. package/dist/app-server.js +1 -1
  2. package/dist/chunks/{acp-QTA6IU6W.js → acp-7A2UPCG5.js} +1 -1
  3. package/dist/chunks/{acp-agent-N77HPAYQ.js → acp-agent-AGALGR6V.js} +1 -1
  4. package/dist/chunks/{actions-command-BZQCUDMD.js → actions-command-AXGXBU75.js} +1 -1
  5. package/dist/chunks/{app-layer-YQQNLIXA.js → app-layer-DUCNCJ2X.js} +1 -1
  6. package/dist/chunks/{app-server-evaluations-RRLYWLPK.js → app-server-evaluations-SNWXULKD.js} +1 -1
  7. package/dist/chunks/{app-server-harness-services-XXM336NU.js → app-server-harness-services-YNMGMKPK.js} +1 -1
  8. package/dist/chunks/app-server-runtime-BKJ7L6JZ.js +2 -0
  9. package/dist/chunks/{apps-WG7WY5CB.js → apps-2OWE23BH.js} +1 -1
  10. package/dist/chunks/{chunk-ZDEIVUUI.js → chunk-27OJ2OLP.js} +1 -1
  11. package/dist/chunks/{chunk-NSSZ2ZIU.js → chunk-2EAZB2MW.js} +1 -1
  12. package/dist/chunks/{chunk-DRLP7GIU.js → chunk-2GEZ3ZY7.js} +1 -1
  13. package/dist/chunks/{chunk-PAYFJHPO.js → chunk-2PVW2XFF.js} +1 -1
  14. package/dist/chunks/chunk-2Q2AWPP2.js +2 -0
  15. package/dist/chunks/{chunk-Y2WNZWT2.js → chunk-2Q6FTL4C.js} +1 -1
  16. package/dist/chunks/{chunk-KP2MYTP5.js → chunk-2QHB5P2K.js} +1 -1
  17. package/dist/chunks/{chunk-HG2YFMVU.js → chunk-2THZ6GZY.js} +1 -1
  18. package/dist/chunks/{chunk-DXJC3QW7.js → chunk-3VT2PPKW.js} +1 -1
  19. package/dist/chunks/{chunk-4BUM6JEC.js → chunk-4JKWCLTQ.js} +1 -1
  20. package/dist/chunks/{chunk-AQUZCWM3.js → chunk-5TPJ5ECJ.js} +1 -1
  21. package/dist/chunks/{chunk-RCQYEHHD.js → chunk-5TTQCT3G.js} +1 -1
  22. package/dist/chunks/{chunk-NMMHXYDJ.js → chunk-5WFKBZCU.js} +1 -1
  23. package/dist/chunks/{chunk-P4QM63L3.js → chunk-5ZBDHIIE.js} +1 -1
  24. package/dist/chunks/{chunk-WD4KAKEX.js → chunk-64EDQ7UV.js} +1 -1
  25. package/dist/chunks/{chunk-KU4TPDPH.js → chunk-6LAGMWJE.js} +1 -1
  26. package/dist/chunks/{chunk-VJYOKU3C.js → chunk-6OD2FKUS.js} +1 -1
  27. package/dist/chunks/{chunk-65FJWWXG.js → chunk-6YR5IYHH.js} +1 -1
  28. package/dist/chunks/{chunk-AUO5DCEU.js → chunk-73COPJ32.js} +1 -1
  29. package/dist/chunks/{chunk-SSHE6B7Z.js → chunk-AITV76GO.js} +1 -1
  30. package/dist/chunks/{chunk-PLROXHG2.js → chunk-ATI52WMB.js} +1 -1
  31. package/dist/chunks/chunk-AWD72O3G.js +2 -0
  32. package/dist/chunks/{chunk-DKOVZ6R2.js → chunk-BQNU4HZW.js} +1 -1
  33. package/dist/chunks/{chunk-UANH7U3Y.js → chunk-BTEBZYK3.js} +1 -1
  34. package/dist/chunks/{chunk-3Z4VM2LF.js → chunk-BUMCJHQP.js} +1 -1
  35. package/dist/chunks/{chunk-BU6MW65V.js → chunk-BYVE4TMU.js} +1 -1
  36. package/dist/chunks/{chunk-PNPV2LDE.js → chunk-BZS2PA4O.js} +1 -1
  37. package/dist/chunks/{chunk-AFYYIJ6K.js → chunk-C7NQPICU.js} +1 -1
  38. package/dist/chunks/{chunk-EWH64WRR.js → chunk-CAYKEJJY.js} +1 -1
  39. package/dist/chunks/{chunk-K7KBFM2T.js → chunk-CBD554GZ.js} +1 -1
  40. package/dist/chunks/{chunk-7RJOCGQ6.js → chunk-CHRED2FK.js} +1 -1
  41. package/dist/chunks/{chunk-3A2Y7UK3.js → chunk-CQRA5TXF.js} +1 -1
  42. package/dist/chunks/{chunk-GYYJ47GX.js → chunk-CWE2N3JI.js} +1 -1
  43. package/dist/chunks/{chunk-ZYLLPRPU.js → chunk-CX4T7I47.js} +1 -1
  44. package/dist/chunks/{chunk-TAXCMCYZ.js → chunk-CX4U32VO.js} +4 -4
  45. package/dist/chunks/{chunk-7TM25J6S.js → chunk-DFSQ5HZ7.js} +2 -2
  46. package/dist/chunks/{chunk-2PXKSAG6.js → chunk-DLOJG7LP.js} +1 -1
  47. package/dist/chunks/{chunk-BGMAWETL.js → chunk-DNRC6TPJ.js} +1 -1
  48. package/dist/chunks/{chunk-5FSPDSAO.js → chunk-DUR32LJG.js} +1 -1
  49. package/dist/chunks/{chunk-FHDH4OUA.js → chunk-EHMA5XS7.js} +1 -1
  50. package/dist/chunks/{chunk-Z33RVGP6.js → chunk-ENY24ZBB.js} +1 -1
  51. package/dist/chunks/{chunk-JVNKSU27.js → chunk-F3IEAU7O.js} +1 -1
  52. package/dist/chunks/{chunk-M4A7G4S5.js → chunk-FOAM3YZQ.js} +1 -1
  53. package/dist/chunks/{chunk-VJR2GNRY.js → chunk-FVMTQSVW.js} +1 -1
  54. package/dist/chunks/{chunk-YI6ME6PU.js → chunk-GG6PM7TB.js} +1 -1
  55. package/dist/chunks/{chunk-DDOIPTOM.js → chunk-GMA365GI.js} +1 -1
  56. package/dist/chunks/{chunk-KCLMA2IH.js → chunk-GPGXBKXU.js} +1 -1
  57. package/dist/chunks/{chunk-JVMSN7LH.js → chunk-GR4MJJCE.js} +1 -1
  58. package/dist/chunks/{chunk-7OFD6TFD.js → chunk-HA762QYM.js} +1 -1
  59. package/dist/chunks/{chunk-Q7FBVLLB.js → chunk-HBGTHOOB.js} +1 -1
  60. package/dist/chunks/{chunk-AFH462DO.js → chunk-HT6ILPD6.js} +1 -1
  61. package/dist/chunks/{chunk-XYZV3FKD.js → chunk-I6KTJ3GH.js} +1 -1
  62. package/dist/chunks/{chunk-OUJ63LMU.js → chunk-IA6CTX7A.js} +1 -1
  63. package/dist/chunks/{chunk-XHACK2KR.js → chunk-IUYGQO2K.js} +1 -1
  64. package/dist/chunks/{chunk-55YD4UTW.js → chunk-IV2HEX3I.js} +1 -1
  65. package/dist/chunks/{chunk-MOXIGLN2.js → chunk-JALL5NPH.js} +1 -1
  66. package/dist/chunks/{chunk-U7X5ZLAL.js → chunk-JCHLDNCX.js} +1 -1
  67. package/dist/chunks/{chunk-7PKDJHT6.js → chunk-JH4RACOB.js} +1 -1
  68. package/dist/chunks/{chunk-MIFVX5PK.js → chunk-JSDGOQ5U.js} +1 -1
  69. package/dist/chunks/{chunk-65WRWLUD.js → chunk-JVEIK4RH.js} +1 -1
  70. package/dist/chunks/{chunk-PPF6EBTQ.js → chunk-K3WM4NEC.js} +1 -1
  71. package/dist/chunks/{chunk-CCZ276IA.js → chunk-KOIXRLZZ.js} +1 -1
  72. package/dist/chunks/{chunk-6C6ZCYTL.js → chunk-KRJZ5CW3.js} +1 -1
  73. package/dist/chunks/{chunk-CUB6PWAJ.js → chunk-KTQWWCP2.js} +6 -6
  74. package/dist/chunks/{chunk-Y4E5AAI7.js → chunk-KUEVP7WM.js} +1 -1
  75. package/dist/chunks/{chunk-U7D6Q744.js → chunk-L5L3H6CI.js} +1 -1
  76. package/dist/chunks/{chunk-VWWKWYSQ.js → chunk-LHTRQAPZ.js} +1 -1
  77. package/dist/chunks/{chunk-QLGP2OAQ.js → chunk-MLLMLXKG.js} +1 -1
  78. package/dist/chunks/{chunk-QUNQM2E3.js → chunk-MPEK4ZNY.js} +1 -1
  79. package/dist/chunks/{chunk-EGP6DF34.js → chunk-MPXOPL7R.js} +2 -2
  80. package/dist/chunks/{chunk-PHZZBXDO.js → chunk-MQMMJKOZ.js} +1 -1
  81. package/dist/chunks/{chunk-B66QCXH2.js → chunk-MWPMYCYB.js} +1 -1
  82. package/dist/chunks/{chunk-5G7BQAUA.js → chunk-N5FT6PTI.js} +1 -1
  83. package/dist/chunks/{chunk-SDHG6CKU.js → chunk-NDNSLCPE.js} +1 -1
  84. package/dist/chunks/{chunk-WCNPGKST.js → chunk-O4YHISU2.js} +1 -1
  85. package/dist/chunks/{chunk-IO5DZUKL.js → chunk-OI4DAZ4U.js} +1 -1
  86. package/dist/chunks/{chunk-Q73RKX7I.js → chunk-OIIE5GUK.js} +1 -1
  87. package/dist/chunks/{chunk-N5EAVX4G.js → chunk-OOKHHOIU.js} +1 -1
  88. package/dist/chunks/{chunk-7OKZCJHS.js → chunk-OXRN2257.js} +1 -1
  89. package/dist/chunks/{chunk-HES4VP3D.js → chunk-PYPXP5R3.js} +1 -1
  90. package/dist/chunks/{chunk-ZK3ET5EP.js → chunk-QKBMXL4D.js} +3 -3
  91. package/dist/chunks/{chunk-YAA7F5LI.js → chunk-QKGNAYSC.js} +1 -1
  92. package/dist/chunks/{chunk-KDER7R45.js → chunk-RIFWD5XM.js} +1 -1
  93. package/dist/chunks/{chunk-WZ35ICTE.js → chunk-RWBP2H4M.js} +1 -1
  94. package/dist/chunks/{chunk-SO4GMSNP.js → chunk-S5ACNR5Y.js} +1 -1
  95. package/dist/chunks/{chunk-M4ZHFDRJ.js → chunk-SRK4WX7D.js} +1 -1
  96. package/dist/chunks/{chunk-XY7HFXLH.js → chunk-SVLVIYH2.js} +1 -1
  97. package/dist/chunks/{chunk-FNGZ4UDZ.js → chunk-T6ML5SCD.js} +1 -1
  98. package/dist/chunks/{chunk-CO23RRN7.js → chunk-TD5YYA5Z.js} +1 -1
  99. package/dist/chunks/{chunk-7NCM6GBN.js → chunk-TOWY6Y23.js} +1 -1
  100. package/dist/chunks/{chunk-OXQ2WFIH.js → chunk-TR5UC5AF.js} +1 -1
  101. package/dist/chunks/{chunk-JQOVC35K.js → chunk-UCPD526R.js} +1 -1
  102. package/dist/chunks/{chunk-Y4I6CFZJ.js → chunk-UGDBMRCT.js} +1 -1
  103. package/dist/chunks/{chunk-E2JB5OCO.js → chunk-UZE3C2SF.js} +1 -1
  104. package/dist/chunks/{chunk-PACLKDTN.js → chunk-V4VM2R6D.js} +1 -1
  105. package/dist/chunks/{chunk-XOPHFUUY.js → chunk-VMBWCIGG.js} +1 -1
  106. package/dist/chunks/{chunk-CIZI6Z7D.js → chunk-VMW23TIZ.js} +1 -1
  107. package/dist/chunks/{chunk-4G3GTEVS.js → chunk-VSQPWLAG.js} +1 -1
  108. package/dist/chunks/{chunk-54755JYM.js → chunk-VXFGSFIE.js} +2 -2
  109. package/dist/chunks/{chunk-R2FYCJL6.js → chunk-W4JBPYGW.js} +1 -1
  110. package/dist/chunks/{chunk-JZKTBYNB.js → chunk-WMJEQK4G.js} +1 -1
  111. package/dist/chunks/{chunk-ESYPMD7Q.js → chunk-X2MJFTLS.js} +1 -1
  112. package/dist/chunks/{chunk-67U7PAMU.js → chunk-X7ZMUWJO.js} +1 -1
  113. package/dist/chunks/{chunk-WGQ3FMRF.js → chunk-XKDOPNQ5.js} +1 -1
  114. package/dist/chunks/{chunk-EYTTZ5H4.js → chunk-XLZMSD5K.js} +1 -1
  115. package/dist/chunks/{chunk-ZIQJDTQB.js → chunk-XTT3K3TR.js} +1 -1
  116. package/dist/chunks/{chunk-Q7P34B2O.js → chunk-YFHQRDNQ.js} +1 -1
  117. package/dist/chunks/{chunk-UGFSAG4U.js → chunk-YG3HITOU.js} +1 -1
  118. package/dist/chunks/{chunk-DWF3FCY4.js → chunk-Z5R4OSGC.js} +1 -1
  119. package/dist/chunks/{chunk-JT5YQ52I.js → chunk-Z6HWSTEP.js} +1 -1
  120. package/dist/chunks/{chunk-4PUOWSDE.js → chunk-ZEOYNUHL.js} +1 -1
  121. package/dist/chunks/{chunk-4KTGYHCE.js → chunk-ZMRP2A7K.js} +1 -1
  122. package/dist/chunks/{chunk-OL3L3U36.js → chunk-ZSWATWK2.js} +1 -1
  123. package/dist/chunks/cli-KXU5DNVV.js +2 -0
  124. package/dist/chunks/{command-5AXJMFYC.js → command-X35I53H3.js} +3 -3
  125. package/dist/chunks/{configuration-command-5LUNWPOL.js → configuration-command-VJUK34UQ.js} +1 -1
  126. package/dist/chunks/{connected-app-executor-DHXZE4X3.js → connected-app-executor-JBFJF2H5.js} +1 -1
  127. package/dist/chunks/{connected-evidence-NWMPICKJ.js → connected-evidence-CQ533AML.js} +1 -1
  128. package/dist/chunks/{connected-starting-assets-NRVXIKQ2.js → connected-starting-assets-RL5X6LZ7.js} +1 -1
  129. package/dist/chunks/{continual-UCKQ2QLH.js → continual-PHGIZFF6.js} +1 -1
  130. package/dist/chunks/{core-commands-ZPBX35M2.js → core-commands-5DYMDWXY.js} +1 -1
  131. package/dist/chunks/{dataset-preparation-authoring-UUYFWWCT.js → dataset-preparation-authoring-UDSX33YK.js} +1 -1
  132. package/dist/chunks/{datasets-6K3ZANIV.js → datasets-BW4JFUUU.js} +1 -1
  133. package/dist/chunks/{desktop-test-57INNJ76.js → desktop-test-RIG4CB2Z.js} +1 -1
  134. package/dist/chunks/{dist-2MKJC6HN.js → dist-C5XFRP53.js} +1 -1
  135. package/dist/chunks/{evaluation-coordination-B7CN4R2D.js → evaluation-coordination-6QJ6XTUX.js} +1 -1
  136. package/dist/chunks/{experiment-improvements-G357VLDB.js → experiment-improvements-2XF63AQ4.js} +1 -1
  137. package/dist/chunks/{experiments-BHQO26LJ.js → experiments-3S2BVNK6.js} +1 -1
  138. package/dist/chunks/{experiments-signal-BI6NKETB.js → experiments-signal-IRBHGGW5.js} +1 -1
  139. package/dist/chunks/{help-UQN5RUPA.js → help-Q2VMJVTR.js} +1 -1
  140. package/dist/chunks/host-profile-evaluation-tools-5LZQHA32.js +2 -0
  141. package/dist/chunks/{host-profile-external-dataset-KSEPXY2S.js → host-profile-external-dataset-C6ZPMTX6.js} +1 -1
  142. package/dist/chunks/{hosted-app-server-composition-WDDO6F23.js → hosted-app-server-composition-AYZM2HY6.js} +1 -1
  143. package/dist/chunks/{hosted-experiment-improvement-VVYXQ65K.js → hosted-experiment-improvement-SMZJYRJ7.js} +1 -1
  144. package/dist/chunks/hosted-harness-runtime-QWIFAITG.js +2 -0
  145. package/dist/chunks/{hosted-profile-candidate-PTGQLPZO.js → hosted-profile-candidate-WOMWAE5N.js} +1 -1
  146. package/dist/chunks/{hosted-profile-compiler-FS5R6CHJ.js → hosted-profile-compiler-NZ2BXN32.js} +1 -1
  147. package/dist/chunks/{hosted-profile-evaluation-control-UUEZEMXU.js → hosted-profile-evaluation-control-3ECFFM7E.js} +1 -1
  148. package/dist/chunks/{hosted-profile-evaluation-inspection-4F7OEF4T.js → hosted-profile-evaluation-inspection-TM7RKONG.js} +1 -1
  149. package/dist/chunks/{hosted-profile-evaluation-preparation-LIJJZDHQ.js → hosted-profile-evaluation-preparation-2MZIRT75.js} +1 -1
  150. package/dist/chunks/{hosted-tasksets-KCLNMPG5.js → hosted-tasksets-IUK3VWSL.js} +1 -1
  151. package/dist/chunks/{human-review-PX6DBIFT.js → human-review-PG4WWVWV.js} +1 -1
  152. package/dist/chunks/{import-2HEYPHPW.js → import-FAZAVZBF.js} +1 -1
  153. package/dist/chunks/{learning-Y3UKNUGE.js → learning-3XDYMYBE.js} +1 -1
  154. package/dist/chunks/{learning-LSXBL5DB.js → learning-OR4CYV4B.js} +1 -1
  155. package/dist/chunks/local-harness-improvement-runtime-OYLTKMJU.js +2 -0
  156. package/dist/chunks/local-harness-taskset-review-I7YU4RZI.js +2 -0
  157. package/dist/chunks/{model-projects-6YWVD2TS.js → model-projects-POZRHXTF.js} +1 -1
  158. package/dist/chunks/{opchat-66BCRKEZ.js → opchat-TCZA6373.js} +1 -1
  159. package/dist/chunks/{opchat-bounded-chat-KQWXZVFN.js → opchat-bounded-chat-GMYDXLWB.js} +1 -1
  160. package/dist/chunks/{organizations-IOYWDOCC.js → organizations-PYKGA2P2.js} +1 -1
  161. package/dist/chunks/{profile-YH6G3ZTD.js → profile-GYYI555I.js} +1 -1
  162. package/dist/chunks/project-action-payload-FE6M2OXJ.js +2 -0
  163. package/dist/chunks/{project-agent-RYVMKW2F.js → project-agent-4ISJFMJD.js} +1 -1
  164. package/dist/chunks/{published-experiment-source-SDXUVPE7.js → published-experiment-source-E2YAJCLM.js} +1 -1
  165. package/dist/chunks/{refiner-profile-service-56VYLZQJ.js → refiner-profile-service-LKGXD5WJ.js} +1 -1
  166. package/dist/chunks/{runtime-ISLJIGWC.js → runtime-UDLOZD4Y.js} +2 -2
  167. package/dist/chunks/{sandbox-command-DI45NRTV.js → sandbox-command-4J6DAY7T.js} +1 -1
  168. package/dist/chunks/{sandbox-template-T42MDUSR.js → sandbox-template-TSXWJMWG.js} +1 -1
  169. package/dist/chunks/saved-work-QTEBKVUB.js +2 -0
  170. package/dist/chunks/{send-turn-YLY3YNEQ.js → send-turn-4MH4WMLW.js} +1 -1
  171. package/dist/chunks/{setup-D6TY2GWV.js → setup-IVT2FQSE.js} +1 -1
  172. package/dist/chunks/{src-7RN7BF4W.js → src-DC7N2H7A.js} +111 -113
  173. package/dist/chunks/{src-LF5X4RNQ.js → src-TOSQX36I.js} +1 -1
  174. package/dist/chunks/{standalone-experiment-turn-owner-TW5MTWIO.js → standalone-experiment-turn-owner-UYPA6XHW.js} +1 -1
  175. package/dist/chunks/{store-chat-resources-IRHBW2EC.js → store-chat-resources-QLXKKYYC.js} +1 -1
  176. package/dist/chunks/{store-continual-support-reviews-3KK42L4I.js → store-continual-support-reviews-4F2BOG3H.js} +1 -1
  177. package/dist/chunks/{store-conversation-serving-IVURK52V.js → store-conversation-serving-EUD47W6X.js} +1 -1
  178. package/dist/chunks/{store-create-improve-UTCLBXF2.js → store-create-improve-QUOTNNIM.js} +1 -1
  179. package/dist/chunks/{store-datasets-4AQOVAQY.js → store-datasets-ZUC7CNVO.js} +1 -1
  180. package/dist/chunks/{store-evaluation-results-PK2P3IMH.js → store-evaluation-results-LHHPHESK.js} +1 -1
  181. package/dist/chunks/{store-harness-workspaces-YEXB4IRV.js → store-harness-workspaces-TKX5PZWP.js} +1 -1
  182. package/dist/chunks/{store-human-review-O4BVHP25.js → store-human-review-7WZWRJ6X.js} +1 -1
  183. package/dist/chunks/{store-learned-preference-migration-validation-44SVX6YB.js → store-learned-preference-migration-validation-MVNKBR4X.js} +1 -1
  184. package/dist/chunks/{store-learning-SIUQIY5C.js → store-learning-WLUW2PWE.js} +1 -1
  185. package/dist/chunks/{store-learning-credentials-BUHR7SN6.js → store-learning-credentials-FDKCEDHK.js} +1 -1
  186. package/dist/chunks/{store-local-experiments-BHVTKPPE.js → store-local-experiments-HB53QFLL.js} +1 -1
  187. package/dist/chunks/{store-model-batch-review-RVAYUVK2.js → store-model-batch-review-O3I6GIAA.js} +1 -1
  188. package/dist/chunks/{store-model-configuration-AYFGMC5D.js → store-model-configuration-CDIGNU6Q.js} +1 -1
  189. package/dist/chunks/{store-model-project-preparation-5DEIS7TB.js → store-model-project-preparation-QMQ2HMJV.js} +1 -1
  190. package/dist/chunks/{store-modification-recordings-LCPK6K2T.js → store-modification-recordings-W4VEZKKQ.js} +1 -1
  191. package/dist/chunks/{store-preference-comparison-5YVIQNVB.js → store-preference-comparison-JKURBESE.js} +1 -1
  192. package/dist/chunks/{store-sidebar-file-bookmarks-WLMYDA4E.js → store-sidebar-file-bookmarks-KAEDHVVF.js} +1 -1
  193. package/dist/chunks/{store-sidebar-preferences-AFMYIDWT.js → store-sidebar-preferences-QPBLTHY6.js} +1 -1
  194. package/dist/chunks/{store-subagents-KFPVSTRO.js → store-subagents-ZELQP3MX.js} +1 -1
  195. package/dist/chunks/{store-task-inbox-L6IQTY26.js → store-task-inbox-4ZDQR2E7.js} +1 -1
  196. package/dist/chunks/{store-task-inventory-QWS2C656.js → store-task-inventory-CTIJDLYE.js} +1 -1
  197. package/dist/chunks/{store-taskset-drafts-EAOOY6CR.js → store-taskset-drafts-FRPBYLTW.js} +1 -1
  198. package/dist/chunks/{store-training-FYXZU2FE.js → store-training-WQAYUT7B.js} +1 -1
  199. package/dist/chunks/{store-training-jobs-3N3VKPIY.js → store-training-jobs-O5EHGTH7.js} +1 -1
  200. package/dist/chunks/{store-training-models-VOFVGPZR.js → store-training-models-YSZMC66T.js} +1 -1
  201. package/dist/chunks/{taskset-HNDIGYQG.js → taskset-OVYM4QMS.js} +1 -1
  202. package/dist/chunks/{taskset-packages-WMG5DUBN.js → taskset-packages-FUQWNTSB.js} +1 -1
  203. package/dist/chunks/{taskset-packages-T6B6HYKZ.js → taskset-packages-GM6IUOTY.js} +1 -1
  204. package/dist/chunks/{teams-bot-Z5CZLWE4.js → teams-bot-U2M3ORWR.js} +1 -1
  205. package/dist/chunks/{tool-learning-ZQ6NSJ5K.js → tool-learning-NXVR4YPA.js} +1 -1
  206. package/dist/chunks/{training-JTYQA7GA.js → training-EQ7G5FDY.js} +1 -1
  207. package/dist/chunks/training-LQUAL4Y4.js +2 -0
  208. package/dist/chunks/training-PEZYJ2SN.js +2 -0
  209. package/dist/chunks/{training-hosted-36SZFS4U.js → training-hosted-XKSUTMLQ.js} +1 -1
  210. package/dist/chunks/{training-hosted-alphaedit-HSMRDJTD.js → training-hosted-alphaedit-VCOEYLKK.js} +1 -1
  211. package/dist/chunks/{training-hosted-decision-7JALOU6O.js → training-hosted-decision-IKWWXA56.js} +1 -1
  212. package/dist/chunks/{training-hosted-engram-SXO75MFG.js → training-hosted-engram-3TOPPVSW.js} +1 -1
  213. package/dist/chunks/{training-hosted-learning-E2N32YU5.js → training-hosted-learning-UEBGSSNC.js} +1 -1
  214. package/dist/chunks/{training-hosted-modification-comparison-TXFDJFTG.js → training-hosted-modification-comparison-C6S4JFHW.js} +1 -1
  215. package/dist/chunks/{training-hosted-neuron-training-J42WK4EH.js → training-hosted-neuron-training-EP2U4PHG.js} +1 -1
  216. package/dist/chunks/{training-hosted-serving-report-BAEABGJH.js → training-hosted-serving-report-KJMRZJLQ.js} +1 -1
  217. package/dist/chunks/{training-hosted-steering-T556BUBG.js → training-hosted-steering-I27DV6A2.js} +1 -1
  218. package/dist/chunks/{training-model-start-P3PXDWNT.js → training-model-start-NWXNGRDC.js} +1 -1
  219. package/dist/chunks/{workspaces-EK62ANTB.js → workspaces-FVQYJPOS.js} +1 -1
  220. package/dist/cli.js +1 -1
  221. package/dist/index.js +1 -1
  222. package/dist/skills/manifest.json +3 -3
  223. package/dist/skills/openpond-cli/references/experiments-and-training.md +19 -0
  224. package/dist/web/assets/App-QM6Y2Eod.js +54 -0
  225. package/dist/web/assets/{AppDialog-x1HU1uLv.js → AppDialog-C8um481a.js} +1 -1
  226. package/dist/web/assets/{AppTerminalPanel-CNIKmqKc.js → AppTerminalPanel-OwNr-bp6.js} +2 -2
  227. package/dist/web/assets/{AppToastContext-DNWd43HS.js → AppToastContext-BQ4iRFif.js} +1 -1
  228. package/dist/web/assets/{AppsView-BvOD83Z1.js → AppsView-mk8m_Cra.js} +1 -1
  229. package/dist/web/assets/{AttachmentTypeIcon-BLdDr3JZ.js → AttachmentTypeIcon-SITPqTtF.js} +1 -1
  230. package/dist/web/assets/{BrowserSidebar-Ar0FlFKg.js → BrowserSidebar-BghdIKTB.js} +1 -1
  231. package/dist/web/assets/{CartesianChart-tS7f1HZv.js → CartesianChart-BdRx7q_O.js} +1 -1
  232. package/dist/web/assets/{ChatTimelineEntry-z7_kur3h.js → ChatTimelineEntry-BBOnAzJB.js} +1 -1
  233. package/dist/web/assets/{CollaborationTabs-CaiFEKrv.js → CollaborationTabs-Beja-9s5.js} +1 -1
  234. package/dist/web/assets/{CommandMenu-BpubEqaA.js → CommandMenu-CQtrSUpu.js} +1 -1
  235. package/dist/web/assets/{CommunityView-TGR4s99l.js → CommunityView-LPTAakS-.js} +1 -1
  236. package/dist/web/assets/{ComposerAttachments-DPWCjKXz.js → ComposerAttachments-DI-Gr7Zw.js} +1 -1
  237. package/dist/web/assets/{ComposerCreateImproveStrip-Drji01_6.js → ComposerCreateImproveStrip-CY5Uw1yc.js} +1 -1
  238. package/dist/web/assets/{ConversationImportsSettings-B_oW0cz7.js → ConversationImportsSettings-DFwhKERw.js} +1 -1
  239. package/dist/web/assets/{DatasetReviewImport-Dr3unJSY.js → DatasetReviewImport-C9xraQk7.js} +1 -1
  240. package/dist/web/assets/{ExperimentTrainingDataWorkspace-DObvpJAw.js → ExperimentTrainingDataWorkspace-Cx58S6R_.js} +2 -2
  241. package/dist/web/assets/{FilePagePreview-9kkXbARN.js → FilePagePreview-dlbmR8s8.js} +2 -2
  242. package/dist/web/assets/{GetStartedView-Dv2b_SlH.js → GetStartedView-BkTV_shK.js} +1 -1
  243. package/dist/web/assets/{GettingStartedDialog-sPaPMc61.js → GettingStartedDialog-DulDLYnr.js} +1 -1
  244. package/dist/web/assets/{HostedModelLearningReview-BlwhGxS6.js → HostedModelLearningReview--fXJEOfI.js} +1 -1
  245. package/dist/web/assets/{HostedModelLearningSettings-B5ahk3je.js → HostedModelLearningSettings-BEb7B_PC.js} +1 -1
  246. package/dist/web/assets/{HtmlVisual-rGsClq0p.js → HtmlVisual-BS61T2qR.js} +1 -1
  247. package/dist/web/assets/{LabModelVersionDetailPage-Da7AwZWV.js → LabModelVersionDetailPage-CmzUIDbR.js} +1 -1
  248. package/dist/web/assets/{LabModelWorkspace-DTeYViWH.js → LabModelWorkspace-DoAnQKWk.js} +1 -1
  249. package/dist/web/assets/{LabSkillSidebar-BieHbNl6.js → LabSkillSidebar-DJTm7ZQs.js} +1 -1
  250. package/dist/web/assets/{LabsRoute-D3XqPB0-.js → LabsRoute-DNtBot4a.js} +4 -4
  251. package/dist/web/assets/{LearningBatchesPage-CCBuf2u4.js → LearningBatchesPage-C_oQjciE.js} +1 -1
  252. package/dist/web/assets/{MainChatThread-B6BQJfcq.js → MainChatThread-D9e-to8e.js} +2 -2
  253. package/dist/web/assets/{MainPane-D3fQou29.js → MainPane-mWeD0M-f.js} +6 -6
  254. package/dist/web/assets/{ModelProjectPageHeader-BZn9Lu_J.js → ModelProjectPageHeader-BecKU_2p.js} +1 -1
  255. package/dist/web/assets/{NativeSetupTerminal-Bglqab_g.js → NativeSetupTerminal-DO0DN4fH.js} +2 -2
  256. package/dist/web/assets/{NativeSkillSidebar-pUGRdnV_.js → NativeSkillSidebar-jnxgQASC.js} +1 -1
  257. package/dist/web/assets/{NewProjectDialog-BpHN38MA.js → NewProjectDialog-ByHR4vMf.js} +1 -1
  258. package/dist/web/assets/{OutputsPage-LunDCQ6w.js → OutputsPage-DZY4BUCy.js} +1 -1
  259. package/dist/web/assets/{PageChrome-DThEcWAx.js → PageChrome-DjPuwWsn.js} +1 -1
  260. package/dist/web/assets/{ProjectsPage-vct_TQgL.js → ProjectsPage-DKbwhIM4.js} +1 -1
  261. package/dist/web/assets/{RightChatPanelStack-CgFK7DY0.js → RightChatPanelStack-BARH0XuL.js} +1 -1
  262. package/dist/web/assets/RightSidebarHomePanel-qKL8dZrN.js +1 -0
  263. package/dist/web/assets/{ScheduledWorkPage-mmaZfybl.js → ScheduledWorkPage-CElrmRz9.js} +1 -1
  264. package/dist/web/assets/{SettingsView-CJfeRsWR.js → SettingsView-CsFSjE9s.js} +3 -3
  265. package/dist/web/assets/{TasksetDraftEditorPrimitives-CuimAfkv.js → TasksetDraftEditorPrimitives-DJoYkvWq.js} +1 -1
  266. package/dist/web/assets/{TeamChatView-BcK0lF1b.js → TeamChatView-D9Y4e98Y.js} +1 -1
  267. package/dist/web/assets/{TerminalOverlay-0pzEvy-C.js → TerminalOverlay-CUO8yZjy.js} +1 -1
  268. package/dist/web/assets/{TrainingCreationPanel-CcyzFz7l.js → TrainingCreationPanel-_mnLQ1HA.js} +1 -1
  269. package/dist/web/assets/{TrainingDraftPanel-DSLZXdLz.js → TrainingDraftPanel-CCqQTHo5.js} +1 -1
  270. package/dist/web/assets/{UsageSettingsSection-BT9pcnCn.js → UsageSettingsSection-CdWq5oYC.js} +1 -1
  271. package/dist/web/assets/WorkSidebarPanel-DRXaK-E6.js +1 -0
  272. package/dist/web/assets/{WorkspaceDiffPanel-Bbz5qrVA.js → WorkspaceDiffPanel-CdHr8bX6.js} +3 -3
  273. package/dist/web/assets/{WorkspaceEnvironmentMenu-6hXpvMTl.js → WorkspaceEnvironmentMenu-BnUh4dg9.js} +1 -1
  274. package/dist/web/assets/{WorkspaceFileLocation-BijVemBl.js → WorkspaceFileLocation-VzrSq_Ki.js} +1 -1
  275. package/dist/web/assets/{WorkspaceGitDialogs-BOO0E5i9.js → WorkspaceGitDialogs-nwvQOm9r.js} +1 -1
  276. package/dist/web/assets/{WorkspaceMonacoEditor-B_YzK7Do.js → WorkspaceMonacoEditor-m3bCIpZe.js} +3 -3
  277. package/dist/web/assets/{WorkspacePdfPreview-CFti1fvu.js → WorkspacePdfPreview-u6Iv0qr0.js} +2 -2
  278. package/dist/web/assets/{WorkspacePresentationPreview-DPAhNaV6.js → WorkspacePresentationPreview-CjvTjhUO.js} +1 -1
  279. package/dist/web/assets/{bot-BE2rL_qv.js → bot-DiDSZBLn.js} +1 -1
  280. package/dist/web/assets/{chat-resources-Beh5lB36.js → chat-resources-CmBtWC5V.js} +1 -1
  281. package/dist/web/assets/chevron-down-CqxKXYPf.js +1 -0
  282. package/dist/web/assets/chevron-right-ClP6ukIq.js +1 -0
  283. package/dist/web/assets/chevron-up-DY7wpdJ1.js +1 -0
  284. package/dist/web/assets/{chunk-C3TS766N-j1MK0e3c.js → chunk-C3TS766N-DSA4vs-Y.js} +1 -1
  285. package/dist/web/assets/{client-BnJhN-14.js → client-_uDCFdg5.js} +1 -1
  286. package/dist/web/assets/{client-choice-storage-CQ0CNkzG.js → client-choice-storage-CRKZpilL.js} +1 -1
  287. package/dist/web/assets/{cloud-upload-DFjZE4O4.js → cloud-upload-CWamjPts.js} +1 -1
  288. package/dist/web/assets/{copy-CGrLUtw5.js → copy-B56YjDkW.js} +1 -1
  289. package/dist/web/assets/{cssMode-DvRw2fUx.js → cssMode-BuC9qQvo.js} +1 -1
  290. package/dist/web/assets/{external-link-3ZnEFUXd.js → external-link-BSn21e-y.js} +1 -1
  291. package/dist/web/assets/{folder-open-i9n8450i.js → folder-open-CaJGWSr2.js} +1 -1
  292. package/dist/web/assets/{folder-plus-cu8Md_ej.js → folder-plus-eTUep-az.js} +1 -1
  293. package/dist/web/assets/{git-commit-horizontal-CwckmC09.js → git-commit-horizontal-Buk_hy6T.js} +1 -1
  294. package/dist/web/assets/{htmlMode-8VF4Ovtw.js → htmlMode-D7kF2kDL.js} +1 -1
  295. package/dist/web/assets/{icons-4yRSxBZj.js → icons-B4B5eUyR.js} +1 -1
  296. package/dist/web/assets/{image-D-umhyyK.js → image--4h1aK2l.js} +1 -1
  297. package/dist/web/assets/{index-DiVhx1GM.js → index-CCaTs7xt.js} +2 -2
  298. package/dist/web/assets/{info-Dq2RsPDJ.js → info-DjMTH4sJ.js} +1 -1
  299. package/dist/web/assets/{jsonMode-CvCYQHkB.js → jsonMode-BVX_7KjE.js} +1 -1
  300. package/dist/web/assets/loader-circle-DNHvEoaP.js +1 -0
  301. package/dist/web/assets/{lspLanguageFeatures-CjufNNFF.js → lspLanguageFeatures-RBOb-3wX.js} +1 -1
  302. package/dist/web/assets/{maximize-2-CKY8dua6.js → maximize-2-Cjg-f1xT.js} +1 -1
  303. package/dist/web/assets/{message-square-CVDgKlKX.js → message-square-oIMQDMc3.js} +1 -1
  304. package/dist/web/assets/{monaco.contribution-BYAgjZbj.js → monaco.contribution-CIbGU5-C.js} +2 -2
  305. package/dist/web/assets/{monaco.contribution-PjJ1258q.js → monaco.contribution-CIwt2mTE.js} +2 -2
  306. package/dist/web/assets/{monaco.contribution-BYY3-y9l.js → monaco.contribution-Dd1cPdSS.js} +2 -2
  307. package/dist/web/assets/{monaco.contribution-Bh0CKj9i.js → monaco.contribution-KRLNg324.js} +2 -2
  308. package/dist/web/assets/{monitor-UYe42gew.js → monitor-BWaitd6I.js} +1 -1
  309. package/dist/web/assets/{paperclip-DrlSVUoz.js → paperclip-FYK6OySO.js} +1 -1
  310. package/dist/web/assets/{pdf-BMhday2W.js → pdf-DbwlsqZP.js} +1 -1
  311. package/dist/web/assets/play-DieChKfF.js +1 -0
  312. package/dist/web/assets/plus-DkfcQyma.js +1 -0
  313. package/dist/web/assets/{presentation-DcZKqH7w.js → presentation-B6MaAPC7.js} +1 -1
  314. package/dist/web/assets/{python-CiA01i07.js → python-DRYJxjiM.js} +1 -1
  315. package/dist/web/assets/{refresh-cw-00D-GDnF.js → refresh-cw-DOVpqCfJ.js} +1 -1
  316. package/dist/web/assets/{save-CXe7bqR7.js → save-BuyyyR4Q.js} +1 -1
  317. package/dist/web/assets/{settings-lists-B5J40WM6.js → settings-lists-BeAdxSjx.js} +1 -1
  318. package/dist/web/assets/square-D0YnIVh6.js +1 -0
  319. package/dist/web/assets/{square-terminal-DxC7TTds.js → square-terminal-DTOIZy6_.js} +1 -1
  320. package/dist/web/assets/{submit-issue-command-Dq3TqJLV.js → submit-issue-command-V--K9lVQ.js} +1 -1
  321. package/dist/web/assets/{toggleHighContrast-BH3Jckfo.js → toggleHighContrast-nNzCoE0h.js} +1 -1
  322. package/dist/web/assets/training-DZgfVcI-.js +1 -0
  323. package/dist/web/assets/{training-model-data-B6IZ3x-t.js → training-model-data-CWoTokkb.js} +1 -1
  324. package/dist/web/assets/{tsMode-DXkj4bqC.js → tsMode-BfVi5_FZ.js} +1 -1
  325. package/dist/web/assets/{upload-B3KRHVHl.js → upload-C2MnlWjj.js} +1 -1
  326. package/dist/web/assets/{useAccountSettings-BGRkTRrp.js → useAccountSettings-QwRbZIKu.js} +1 -1
  327. package/dist/web/assets/{useAgentInventory-D_1AlAZJ.js → useAgentInventory-B7xEgMCA.js} +1 -1
  328. package/dist/web/assets/{useChatContextSelection-hoMSuUSE.js → useChatContextSelection-O6wo4EqD.js} +1 -1
  329. package/dist/web/assets/{useLocalAgentSchedules-DxTER7Ow.js → useLocalAgentSchedules-DpHnOGoV.js} +1 -1
  330. package/dist/web/assets/{useQuery-DkPec_9x.js → useQuery-CvZ8bzdW.js} +1 -1
  331. package/dist/web/assets/{wifi-off-CMzpvbWl.js → wifi-off-B8d12Alh.js} +1 -1
  332. package/dist/web/assets/{workers-ziY_bTv2.js → workers-sIVKxb8c.js} +1 -1
  333. package/dist/web/assets/x-BvVvVB-j.js +1 -0
  334. package/dist/web/assets/{yaml-mSvqVSko.js → yaml-8-aLM3zj.js} +1 -1
  335. package/dist/web/index.html +1 -1
  336. package/docs/command-reference.md +1 -0
  337. package/package.json +1 -1
  338. package/dist/chunks/app-server-runtime-B7AMBGQZ.js +0 -2
  339. package/dist/chunks/chunk-6D3FI2XT.js +0 -2
  340. package/dist/chunks/chunk-VEBW7NKD.js +0 -2
  341. package/dist/chunks/cli-ALEEFAJ7.js +0 -2
  342. package/dist/chunks/host-profile-evaluation-tools-UF4ATIUF.js +0 -2
  343. package/dist/chunks/hosted-harness-runtime-MMTLCL23.js +0 -2
  344. package/dist/chunks/local-harness-improvement-runtime-3YJQRYXC.js +0 -2
  345. package/dist/chunks/local-harness-taskset-review-E5GN5LTR.js +0 -2
  346. package/dist/chunks/project-action-payload-53OH6WDH.js +0 -2
  347. package/dist/chunks/saved-work-54I5ZJTC.js +0 -2
  348. package/dist/chunks/training-5NT2YB2L.js +0 -2
  349. package/dist/chunks/training-UY6KRG4M.js +0 -2
  350. package/dist/web/assets/App-CXhxya9x.js +0 -54
  351. package/dist/web/assets/RightSidebarHomePanel-BJmzUcmy.js +0 -1
  352. package/dist/web/assets/WorkSidebarPanel-CP-nHAsJ.js +0 -1
  353. package/dist/web/assets/chevron-down-Bn8yph2O.js +0 -1
  354. package/dist/web/assets/chevron-right-BU-jUmb2.js +0 -1
  355. package/dist/web/assets/chevron-up-DacwuDJZ.js +0 -1
  356. package/dist/web/assets/loader-circle-DBl6qqtR.js +0 -1
  357. package/dist/web/assets/play-DIqZnaNf.js +0 -1
  358. package/dist/web/assets/plus-CFNxAPMK.js +0 -1
  359. package/dist/web/assets/square-DJEaBefe.js +0 -1
  360. package/dist/web/assets/training-DWfghwfZ.js +0 -1
  361. package/dist/web/assets/x-omjwMPbJ.js +0 -1
@@ -1 +1 @@
1
- import{m as e}from"./index-DiVhx1GM.js";import{r as t}from"./PageChrome-DThEcWAx.js";var n=e();function r({title:e,description:r,titleAside:i,status:a,actions:o,layout:s=`default`,metrics:c=[]}){let l=c.length?(0,n.jsx)(`dl`,{className:`model-project-page-metrics`,children:c.map(e=>(0,n.jsxs)(`div`,{children:[(0,n.jsx)(`dt`,{children:e.label}),(0,n.jsx)(`dd`,{children:e.onSelect?(0,n.jsx)(`button`,{"aria-label":e.ariaLabel,className:`model-project-page-metric-link`,type:`button`,onClick:e.onSelect,children:e.value}):e.value}),e.hint?(0,n.jsx)(`small`,{children:e.hint}):null]},e.label))}):null;return(0,n.jsx)(t,{title:(0,n.jsxs)(`div`,{className:`model-project-page-title-row`,children:[(0,n.jsx)(`h1`,{children:e}),i]}),actions:(0,n.jsxs)(n.Fragment,{children:[a,o]}),fallback:(0,n.jsxs)(`header`,{className:`model-project-page-header model-project-page-header-${s}`,children:[(0,n.jsxs)(`div`,{className:`model-project-page-heading`,children:[(0,n.jsxs)(`div`,{children:[(0,n.jsxs)(`div`,{className:`model-project-page-title-row`,children:[(0,n.jsx)(`h1`,{children:e}),i,a]}),(0,n.jsx)(`p`,{children:r})]}),o?(0,n.jsx)(`div`,{className:`model-project-page-actions`,children:o}):null]}),l]}),children:l})}export{r as t};
1
+ import{m as e}from"./index-CCaTs7xt.js";import{r as t}from"./PageChrome-DjPuwWsn.js";var n=e();function r({title:e,description:r,titleAside:i,status:a,actions:o,layout:s=`default`,metrics:c=[]}){let l=c.length?(0,n.jsx)(`dl`,{className:`model-project-page-metrics`,children:c.map(e=>(0,n.jsxs)(`div`,{children:[(0,n.jsx)(`dt`,{children:e.label}),(0,n.jsx)(`dd`,{children:e.onSelect?(0,n.jsx)(`button`,{"aria-label":e.ariaLabel,className:`model-project-page-metric-link`,type:`button`,onClick:e.onSelect,children:e.value}):e.value}),e.hint?(0,n.jsx)(`small`,{children:e.hint}):null]},e.label))}):null;return(0,n.jsx)(t,{title:(0,n.jsxs)(`div`,{className:`model-project-page-title-row`,children:[(0,n.jsx)(`h1`,{children:e}),i]}),actions:(0,n.jsxs)(n.Fragment,{children:[a,o]}),fallback:(0,n.jsxs)(`header`,{className:`model-project-page-header model-project-page-header-${s}`,children:[(0,n.jsxs)(`div`,{className:`model-project-page-heading`,children:[(0,n.jsxs)(`div`,{children:[(0,n.jsxs)(`div`,{className:`model-project-page-title-row`,children:[(0,n.jsx)(`h1`,{children:e}),i,a]}),(0,n.jsx)(`p`,{children:r})]}),o?(0,n.jsx)(`div`,{className:`model-project-page-actions`,children:o}):null]}),l]}),children:l})}export{r as t};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TerminalOverlay-0pzEvy-C.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/index-DiVhx1GM.js","assets/index-g7UqJhnX.css","assets/api-client-DJRVOFzS.js","assets/icons-4yRSxBZj.js","assets/chevron-down-Bn8yph2O.js","assets/plus-CFNxAPMK.js","assets/x-omjwMPbJ.js","assets/AppToastContext-DNWd43HS.js","assets/ui-theme.generated-D-mc26qt.js","assets/App-CXhxya9x.js","assets/useQuery-DkPec_9x.js","assets/schemas-Brv9Vmnk.js","assets/common-BWVSBnpX.js","assets/settings-BC-bzgk6.js","assets/client-choice-storage-CQ0CNkzG.js","assets/requests-DmeUYik4.js","assets/create-pipeline-DsZzNkt9.js","assets/profile-ref-D8lxL7dW.js","assets/chunk-H3JZ3P5T-DolwEJXo.js","assets/work-outputs-D_8TovAK.js","assets/chunk-GS5HEE4M-C0RLeIsy.js","assets/chunk-GCUWJUUM-Dy6oUNJ6.js","assets/reward-checks-DJJZYgf8.js","assets/intake-contracts-B8JZKYwb.js","assets/training-DWfghwfZ.js","assets/chunk-Q4RGCEOI-Cr-dg4Nk.js","assets/ponder-desktop-Ca-9KggQ.js","assets/chat-resources-Beh5lB36.js","assets/app-models-BUdzQbXo.js","assets/model-display-zPvC4L2B.js","assets/submit-issue-command-Dq3TqJLV.js","assets/connected-app-mentions-D3wRZLwI.js","assets/profile-agent-labels-Duh96b8x.js","assets/browser-sidebar-links-PVPCrsDJ.js","assets/browser-url-LACq2Ngu.js","assets/query-scope-BRpcgljO.js","assets/bot-BE2rL_qv.js","assets/chevron-right-BU-jUmb2.js","assets/copy-CGrLUtw5.js","assets/external-link-3ZnEFUXd.js","assets/loader-circle-DBl6qqtR.js","assets/maximize-2-CKY8dua6.js","assets/message-square-CVDgKlKX.js","assets/refresh-cw-00D-GDnF.js","assets/square-terminal-DxC7TTds.js","assets/PageChrome-DThEcWAx.js","assets/AppDialog-x1HU1uLv.js","assets/organization-types-PP-yuR2J.js","assets/App-DpFKLxuA.css","assets/TerminalOverlay-DoUFGstN.css"])))=>i.map(i=>d[i]);
2
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,h as n,m as r,t as i}from"./index-DiVhx1GM.js";import{t as a}from"./AppDialog-x1HU1uLv.js";var o=e(t(),1),s=n(),c=r(),l=(0,o.lazy)(()=>i(()=>import(`./TerminalOverlay-0pzEvy-C.js`).then(e=>({default:e.TerminalOverlay})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51])));function u({connection:e,command:t,displayCommand:n=`OpenPond setup`,onClose:r,onComplete:i,modal:u=!1}){let[d,f]=(0,o.useState)([]),[p]=(0,o.useState)(()=>({kind:`draft`,id:`native-setup-${crypto.randomUUID()}`})),m=(0,o.useRef)(!1),[h]=(0,o.useState)(()=>({command:t,displayCommand:n}));(0,o.useEffect)(()=>{!m.current&&d.some(e=>e.lastCommand!==null&&e.lastExitCode===0&&e.commandStatus===`success`)&&(m.current=!0,i?.())},[d,i]);let g=(0,c.jsx)(o.Suspense,{fallback:(0,c.jsx)(`p`,{role:`status`,children:`Opening setup terminal…`}),children:(0,c.jsx)(l,{open:!0,disposeOnUnmount:!0,connection:e,scope:p,tabs:d,onTabsChange:f,cwd:null,appId:null,workspaceName:`Agent setup`,queuedCommand:null,setupCommand:h,onClose:r})});return(0,s.createPortal)(u?(0,c.jsx)(a,{ariaLabel:`Agent setup terminal`,backdropClassName:`native-setup-modal-backdrop`,className:`native-setup-terminal`,onClose:r,children:g}):(0,c.jsx)(`div`,{className:`native-setup-terminal`,children:g}),document.body)}export{u as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TerminalOverlay-CUO8yZjy.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/index-CCaTs7xt.js","assets/index-g7UqJhnX.css","assets/api-client-DJRVOFzS.js","assets/icons-B4B5eUyR.js","assets/chevron-down-CqxKXYPf.js","assets/plus-DkfcQyma.js","assets/x-BvVvVB-j.js","assets/AppToastContext-BQ4iRFif.js","assets/ui-theme.generated-D-mc26qt.js","assets/App-QM6Y2Eod.js","assets/useQuery-CvZ8bzdW.js","assets/schemas-Brv9Vmnk.js","assets/common-BWVSBnpX.js","assets/settings-BC-bzgk6.js","assets/client-choice-storage-CRKZpilL.js","assets/requests-DmeUYik4.js","assets/create-pipeline-DsZzNkt9.js","assets/profile-ref-D8lxL7dW.js","assets/chunk-H3JZ3P5T-DolwEJXo.js","assets/work-outputs-D_8TovAK.js","assets/chunk-GS5HEE4M-C0RLeIsy.js","assets/chunk-GCUWJUUM-Dy6oUNJ6.js","assets/reward-checks-DJJZYgf8.js","assets/intake-contracts-B8JZKYwb.js","assets/training-DZgfVcI-.js","assets/chunk-Q4RGCEOI-Cr-dg4Nk.js","assets/ponder-desktop-Ca-9KggQ.js","assets/chat-resources-CmBtWC5V.js","assets/app-models-BUdzQbXo.js","assets/model-display-zPvC4L2B.js","assets/submit-issue-command-V--K9lVQ.js","assets/connected-app-mentions-D3wRZLwI.js","assets/profile-agent-labels-Duh96b8x.js","assets/browser-sidebar-links-PVPCrsDJ.js","assets/browser-url-LACq2Ngu.js","assets/query-scope-BRpcgljO.js","assets/bot-DiDSZBLn.js","assets/chevron-right-ClP6ukIq.js","assets/copy-B56YjDkW.js","assets/external-link-BSn21e-y.js","assets/loader-circle-DNHvEoaP.js","assets/maximize-2-Cjg-f1xT.js","assets/message-square-oIMQDMc3.js","assets/refresh-cw-DOVpqCfJ.js","assets/square-terminal-DTOIZy6_.js","assets/PageChrome-DjPuwWsn.js","assets/AppDialog-C8um481a.js","assets/organization-types-PP-yuR2J.js","assets/App-DpFKLxuA.css","assets/TerminalOverlay-DoUFGstN.css"])))=>i.map(i=>d[i]);
2
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,h as n,m as r,t as i}from"./index-CCaTs7xt.js";import{t as a}from"./AppDialog-C8um481a.js";var o=e(t(),1),s=n(),c=r(),l=(0,o.lazy)(()=>i(()=>import(`./TerminalOverlay-CUO8yZjy.js`).then(e=>({default:e.TerminalOverlay})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51])));function u({connection:e,command:t,displayCommand:n=`OpenPond setup`,onClose:r,onComplete:i,modal:u=!1}){let[d,f]=(0,o.useState)([]),[p]=(0,o.useState)(()=>({kind:`draft`,id:`native-setup-${crypto.randomUUID()}`})),m=(0,o.useRef)(!1),[h]=(0,o.useState)(()=>({command:t,displayCommand:n}));(0,o.useEffect)(()=>{!m.current&&d.some(e=>e.lastCommand!==null&&e.lastExitCode===0&&e.commandStatus===`success`)&&(m.current=!0,i?.())},[d,i]);let g=(0,c.jsx)(o.Suspense,{fallback:(0,c.jsx)(`p`,{role:`status`,children:`Opening setup terminal…`}),children:(0,c.jsx)(l,{open:!0,disposeOnUnmount:!0,connection:e,scope:p,tabs:d,onTabsChange:f,cwd:null,appId:null,workspaceName:`Agent setup`,queuedCommand:null,setupCommand:h,onClose:r})});return(0,s.createPortal)(u?(0,c.jsx)(a,{ariaLabel:`Agent setup terminal`,backdropClassName:`native-setup-modal-backdrop`,className:`native-setup-terminal`,onClose:r,children:g}):(0,c.jsx)(`div`,{className:`native-setup-terminal`,children:g}),document.body)}export{u as t};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-DiVhx1GM.js";import"./icons-4yRSxBZj.js";import{L as r}from"./training-model-data-B6IZ3x-t.js";import{t as i}from"./maximize-2-CKY8dua6.js";import{t as a}from"./x-omjwMPbJ.js";import{Ut as o,un as s}from"./App-CXhxya9x.js";var c=e(t(),1),l=n();function u({expanded:e,skill:t,onClose:n,onResizeStart:u,onToggleExpanded:d}){let[f,p]=(0,c.useState)({skill:t,path:`SKILL.md`}),m=t.files?.find(e=>f.skill===t&&e.path===f.path)??t.files?.[0],h=m?.path??t.path,g=m?.body??t.body,_=h.split(`/`).at(-1)??h;return(0,l.jsxs)(`aside`,{className:`workspace-diff-panel native-skill-sidebar ${e?`expanded`:``}`,"aria-label":`Skill source: ${t.name}`,children:[e?null:(0,l.jsx)(`div`,{className:`workspace-diff-resize-handle`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize native skill source`,onPointerDown:u}),(0,l.jsxs)(`div`,{className:`workspace-diff-topbar native-skill-sidebar-topbar`,children:[t.files?.length?(0,l.jsx)(o,{compact:!0,floating:!0,label:`Skill file`,value:h,options:t.files.map(e=>({value:e.path,label:e.path})),onChange:e=>p({skill:t,path:e})}):(0,l.jsx)(`div`,{className:`workspace-diff-tabs`,role:`tablist`,"aria-label":`Native skill files`,children:(0,l.jsxs)(`button`,{className:`workspace-diff-tab active`,type:`button`,role:`tab`,"aria-selected":!0,children:[(0,l.jsx)(s,{size:14}),(0,l.jsx)(`span`,{children:_})]})}),(0,l.jsxs)(`div`,{className:`workspace-diff-toolbar-actions`,children:[(0,l.jsx)(`button`,{className:`diff-icon-button`,type:`button`,title:e?`Dock sidebar`:`Expand sidebar`,"aria-label":e?`Dock sidebar`:`Expand sidebar`,onClick:d,children:e?(0,l.jsx)(r,{size:14}):(0,l.jsx)(i,{size:14})}),(0,l.jsx)(`button`,{className:`diff-icon-button`,type:`button`,title:`Close skill source`,"aria-label":`Close skill source`,onClick:n,children:(0,l.jsx)(a,{size:14})})]})]}),(0,l.jsxs)(`div`,{className:`native-skill-sidebar-body`,children:[(0,l.jsxs)(`header`,{className:`native-skill-source-header`,children:[(0,l.jsx)(`h2`,{children:t.name}),(0,l.jsx)(`p`,{children:t.description}),(0,l.jsx)(`code`,{children:h})]}),(0,l.jsx)(`pre`,{className:`native-skill-markdown-source`,"aria-label":`${t.name} Markdown source`,children:(0,l.jsx)(`code`,{children:g})})]})]})}export{u as NativeSkillSidebar};
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-CCaTs7xt.js";import"./icons-B4B5eUyR.js";import{L as r}from"./training-model-data-CWoTokkb.js";import{t as i}from"./maximize-2-Cjg-f1xT.js";import{t as a}from"./x-BvVvVB-j.js";import{Ut as o,un as s}from"./App-QM6Y2Eod.js";var c=e(t(),1),l=n();function u({expanded:e,skill:t,onClose:n,onResizeStart:u,onToggleExpanded:d}){let[f,p]=(0,c.useState)({skill:t,path:`SKILL.md`}),m=t.files?.find(e=>f.skill===t&&e.path===f.path)??t.files?.[0],h=m?.path??t.path,g=m?.body??t.body,_=h.split(`/`).at(-1)??h;return(0,l.jsxs)(`aside`,{className:`workspace-diff-panel native-skill-sidebar ${e?`expanded`:``}`,"aria-label":`Skill source: ${t.name}`,children:[e?null:(0,l.jsx)(`div`,{className:`workspace-diff-resize-handle`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize native skill source`,onPointerDown:u}),(0,l.jsxs)(`div`,{className:`workspace-diff-topbar native-skill-sidebar-topbar`,children:[t.files?.length?(0,l.jsx)(o,{compact:!0,floating:!0,label:`Skill file`,value:h,options:t.files.map(e=>({value:e.path,label:e.path})),onChange:e=>p({skill:t,path:e})}):(0,l.jsx)(`div`,{className:`workspace-diff-tabs`,role:`tablist`,"aria-label":`Native skill files`,children:(0,l.jsxs)(`button`,{className:`workspace-diff-tab active`,type:`button`,role:`tab`,"aria-selected":!0,children:[(0,l.jsx)(s,{size:14}),(0,l.jsx)(`span`,{children:_})]})}),(0,l.jsxs)(`div`,{className:`workspace-diff-toolbar-actions`,children:[(0,l.jsx)(`button`,{className:`diff-icon-button`,type:`button`,title:e?`Dock sidebar`:`Expand sidebar`,"aria-label":e?`Dock sidebar`:`Expand sidebar`,onClick:d,children:e?(0,l.jsx)(r,{size:14}):(0,l.jsx)(i,{size:14})}),(0,l.jsx)(`button`,{className:`diff-icon-button`,type:`button`,title:`Close skill source`,"aria-label":`Close skill source`,onClick:n,children:(0,l.jsx)(a,{size:14})})]})]}),(0,l.jsxs)(`div`,{className:`native-skill-sidebar-body`,children:[(0,l.jsxs)(`header`,{className:`native-skill-source-header`,children:[(0,l.jsx)(`h2`,{children:t.name}),(0,l.jsx)(`p`,{children:t.description}),(0,l.jsx)(`code`,{children:h})]}),(0,l.jsx)(`pre`,{className:`native-skill-markdown-source`,"aria-label":`${t.name} Markdown source`,children:(0,l.jsx)(`code`,{children:g})})]})]})}export{u as NativeSkillSidebar};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-DiVhx1GM.js";import"./icons-4yRSxBZj.js";import{t as r}from"./folder-open-i9n8450i.js";import{t as i}from"./folder-plus-cu8Md_ej.js";import{t as a}from"./monitor-UYe42gew.js";import{t as o}from"./x-omjwMPbJ.js";import{Gt as s,ln as c,pn as l}from"./App-CXhxya9x.js";var u=e(t(),1),d=n();function f({open:e,mode:t=`local`,name:n,path:f,directory:p,busy:m,onNameChange:h,onPathChange:g,onClose:_,onSubmit:v}){let[y,b]=(0,u.useState)([]),[x,S]=(0,u.useState)(``),[C,w]=(0,u.useState)(``),[T,E]=(0,u.useState)(!1),D=(0,u.useRef)(null),O=(0,u.useRef)(null);if((0,u.useEffect)(()=>{if(e)return D.current=document.activeElement instanceof HTMLElement?document.activeElement:null,()=>D.current?.focus()},[e]),!e)return null;let k=t===`cloud`,A=t===`existing-local`,j=k?l:A?r:i,M=k?`New Cloud Project`:A?`Create project`:`New Local Project`,N=k?`Create a hosted project in OpenPond Cloud.`:`Create a new local Git project and add it to Projects.`,P=!!window.openpond?.selectFolder,F=P?`This computer`:`Connected computer`,I=async()=>{if(!P&&!T){E(!0);return}let e=P?await window.openpond.selectFolder():{path:f.trim(),canceled:!1},t=e.path?.trim();t&&!e.canceled&&(y.includes(t)?w(`This folder is already selected.`):(b(e=>[...e,t]),x||S(t),n.trim()||h(t.split(/[\\/]/).filter(Boolean).at(-1)??t),P||(g(``),E(!1)),w(``)))},L=m||(A?!n.trim()||y.length===0:!n.trim()),R=m?`Creating`:k?`Create Cloud Project`:`Create project`;return(0,d.jsx)(`div`,{className:`git-dialog-backdrop`,role:`presentation`,onKeyDown:e=>{e.key===`Escape`&&!m&&(e.stopPropagation(),_())},children:(0,d.jsxs)(`form`,{ref:O,className:`git-dialog new-project-dialog${A?` new-project-collection`:``}`,role:`dialog`,"aria-modal":`true`,"aria-label":`Create project`,onKeyDown:e=>{if(e.key!==`Tab`)return;let t=Array.from(O.current?.querySelectorAll(`button:not(:disabled), input:not(:disabled)`)??[]);if(!t.length)return;let n=t[0],r=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())},onSubmit:async e=>{e.preventDefault(),w(``),await v(A?{name:n.trim(),sourceFolders:y,primaryFolder:x}:void 0)||w(`Project could not be created. Check the selected folders and try again.`)},children:[(0,d.jsx)(`button`,{className:`git-dialog-close`,disabled:m,type:`button`,onClick:_,children:(0,d.jsx)(o,{size:14})}),A?null:(0,d.jsx)(`div`,{className:`git-dialog-icon`,children:(0,d.jsx)(j,{size:18})}),(0,d.jsx)(`h2`,{children:M}),A?null:(0,d.jsx)(`p`,{children:N}),A?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(`label`,{className:`new-project-name-field`,children:[(0,d.jsx)(c,{size:16,"aria-hidden":`true`}),(0,d.jsx)(`input`,{autoFocus:!0,"aria-label":`Project name`,disabled:m,value:n,onChange:e=>h(e.target.value),placeholder:`Project name`})]}),(0,d.jsxs)(`div`,{className:`new-project-source-heading`,children:[(0,d.jsx)(`span`,{children:`Source folders`}),y.length?(0,d.jsxs)(`span`,{children:[(0,d.jsx)(a,{size:15,"aria-hidden":`true`}),F]}):null]}),(0,d.jsxs)(`div`,{className:`new-project-source-box${y.length?` populated`:` empty`}`,children:[y.length===0?(0,d.jsxs)(`div`,{className:`new-project-empty-source`,children:[(0,d.jsxs)(`span`,{children:[`Add a folder on `,P?`this`:`the connected`,` computer`]}),(0,d.jsxs)(`button`,{type:`button`,disabled:m,onClick:()=>void I(),children:[(0,d.jsx)(i,{size:14,"aria-hidden":`true`}),`Add`]})]}):(0,d.jsx)(`ul`,{className:`new-project-folder-list`,children:y.map(e=>(0,d.jsxs)(`li`,{className:`new-project-folder-row`,children:[(0,d.jsx)(c,{size:15,"aria-hidden":`true`}),(0,d.jsx)(`span`,{title:e,"aria-label":e,children:e.split(/[\\/]/).filter(Boolean).at(-1)??e}),x===e?(0,d.jsx)(`span`,{className:`new-project-primary-pill`,children:`Primary`}):(0,d.jsx)(`button`,{className:`new-project-make-primary`,type:`button`,disabled:m,onClick:()=>S(e),children:`Make primary`}),(0,d.jsx)(`button`,{className:`new-project-remove`,type:`button`,disabled:m,"aria-label":`Remove ${e}`,onClick:()=>{b(t=>{let n=t.filter(t=>t!==e);return x===e&&S(n[0]??``),n})},children:(0,d.jsx)(o,{size:14,"aria-hidden":`true`})})]},e))}),y.length?(0,d.jsxs)(`button`,{className:`new-project-add-row`,type:`button`,disabled:m,onClick:()=>void I(),children:[(0,d.jsx)(i,{size:15,"aria-hidden":`true`}),`Add folder`]}):null,T?(0,d.jsxs)(`label`,{className:`new-project-manual-path`,children:[(0,d.jsx)(`span`,{children:`Folder path on connected computer`}),(0,d.jsx)(`input`,{value:f,onChange:e=>g(e.target.value),placeholder:`/path/to/folder`,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),I())}}),(0,d.jsx)(`button`,{type:`button`,disabled:!f.trim(),onClick:()=>void I(),children:`Add folder`})]}):null]})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,d.jsx)(`span`,{children:`Project name`}),(0,d.jsx)(`input`,{autoFocus:!0,disabled:m,placeholder:`New project`,value:n,onChange:e=>h(e.target.value)})]}),(0,d.jsxs)(`div`,{className:`git-dialog-row`,children:[(0,d.jsx)(`span`,{children:`Location`}),(0,d.jsx)(`strong`,{className:`git-dialog-path`,children:k?`OpenPond Cloud`:p})]})]}),C?(0,d.jsx)(s,{error:C}):null,(0,d.jsxs)(`div`,{className:`new-project-footer`,children:[(0,d.jsx)(`button`,{className:`new-project-cancel`,type:`button`,disabled:m,onClick:_,children:`Cancel`}),(0,d.jsx)(`button`,{className:`git-dialog-primary`,disabled:L,type:`submit`,children:R})]})]})})}export{f as NewProjectDialog};
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-CCaTs7xt.js";import"./icons-B4B5eUyR.js";import{t as r}from"./folder-open-CaJGWSr2.js";import{t as i}from"./folder-plus-eTUep-az.js";import{t as a}from"./monitor-BWaitd6I.js";import{t as o}from"./x-BvVvVB-j.js";import{Gt as s,ln as c,pn as l}from"./App-QM6Y2Eod.js";var u=e(t(),1),d=n();function f({open:e,mode:t=`local`,name:n,path:f,directory:p,busy:m,onNameChange:h,onPathChange:g,onClose:_,onSubmit:v}){let[y,b]=(0,u.useState)([]),[x,S]=(0,u.useState)(``),[C,w]=(0,u.useState)(``),[T,E]=(0,u.useState)(!1),D=(0,u.useRef)(null),O=(0,u.useRef)(null);if((0,u.useEffect)(()=>{if(e)return D.current=document.activeElement instanceof HTMLElement?document.activeElement:null,()=>D.current?.focus()},[e]),!e)return null;let k=t===`cloud`,A=t===`existing-local`,j=k?l:A?r:i,M=k?`New Cloud Project`:A?`Create project`:`New Local Project`,N=k?`Create a hosted project in OpenPond Cloud.`:`Create a new local Git project and add it to Projects.`,P=!!window.openpond?.selectFolder,F=P?`This computer`:`Connected computer`,I=async()=>{if(!P&&!T){E(!0);return}let e=P?await window.openpond.selectFolder():{path:f.trim(),canceled:!1},t=e.path?.trim();t&&!e.canceled&&(y.includes(t)?w(`This folder is already selected.`):(b(e=>[...e,t]),x||S(t),n.trim()||h(t.split(/[\\/]/).filter(Boolean).at(-1)??t),P||(g(``),E(!1)),w(``)))},L=m||(A?!n.trim()||y.length===0:!n.trim()),R=m?`Creating`:k?`Create Cloud Project`:`Create project`;return(0,d.jsx)(`div`,{className:`git-dialog-backdrop`,role:`presentation`,onKeyDown:e=>{e.key===`Escape`&&!m&&(e.stopPropagation(),_())},children:(0,d.jsxs)(`form`,{ref:O,className:`git-dialog new-project-dialog${A?` new-project-collection`:``}`,role:`dialog`,"aria-modal":`true`,"aria-label":`Create project`,onKeyDown:e=>{if(e.key!==`Tab`)return;let t=Array.from(O.current?.querySelectorAll(`button:not(:disabled), input:not(:disabled)`)??[]);if(!t.length)return;let n=t[0],r=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())},onSubmit:async e=>{e.preventDefault(),w(``),await v(A?{name:n.trim(),sourceFolders:y,primaryFolder:x}:void 0)||w(`Project could not be created. Check the selected folders and try again.`)},children:[(0,d.jsx)(`button`,{className:`git-dialog-close`,disabled:m,type:`button`,onClick:_,children:(0,d.jsx)(o,{size:14})}),A?null:(0,d.jsx)(`div`,{className:`git-dialog-icon`,children:(0,d.jsx)(j,{size:18})}),(0,d.jsx)(`h2`,{children:M}),A?null:(0,d.jsx)(`p`,{children:N}),A?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(`label`,{className:`new-project-name-field`,children:[(0,d.jsx)(c,{size:16,"aria-hidden":`true`}),(0,d.jsx)(`input`,{autoFocus:!0,"aria-label":`Project name`,disabled:m,value:n,onChange:e=>h(e.target.value),placeholder:`Project name`})]}),(0,d.jsxs)(`div`,{className:`new-project-source-heading`,children:[(0,d.jsx)(`span`,{children:`Source folders`}),y.length?(0,d.jsxs)(`span`,{children:[(0,d.jsx)(a,{size:15,"aria-hidden":`true`}),F]}):null]}),(0,d.jsxs)(`div`,{className:`new-project-source-box${y.length?` populated`:` empty`}`,children:[y.length===0?(0,d.jsxs)(`div`,{className:`new-project-empty-source`,children:[(0,d.jsxs)(`span`,{children:[`Add a folder on `,P?`this`:`the connected`,` computer`]}),(0,d.jsxs)(`button`,{type:`button`,disabled:m,onClick:()=>void I(),children:[(0,d.jsx)(i,{size:14,"aria-hidden":`true`}),`Add`]})]}):(0,d.jsx)(`ul`,{className:`new-project-folder-list`,children:y.map(e=>(0,d.jsxs)(`li`,{className:`new-project-folder-row`,children:[(0,d.jsx)(c,{size:15,"aria-hidden":`true`}),(0,d.jsx)(`span`,{title:e,"aria-label":e,children:e.split(/[\\/]/).filter(Boolean).at(-1)??e}),x===e?(0,d.jsx)(`span`,{className:`new-project-primary-pill`,children:`Primary`}):(0,d.jsx)(`button`,{className:`new-project-make-primary`,type:`button`,disabled:m,onClick:()=>S(e),children:`Make primary`}),(0,d.jsx)(`button`,{className:`new-project-remove`,type:`button`,disabled:m,"aria-label":`Remove ${e}`,onClick:()=>{b(t=>{let n=t.filter(t=>t!==e);return x===e&&S(n[0]??``),n})},children:(0,d.jsx)(o,{size:14,"aria-hidden":`true`})})]},e))}),y.length?(0,d.jsxs)(`button`,{className:`new-project-add-row`,type:`button`,disabled:m,onClick:()=>void I(),children:[(0,d.jsx)(i,{size:15,"aria-hidden":`true`}),`Add folder`]}):null,T?(0,d.jsxs)(`label`,{className:`new-project-manual-path`,children:[(0,d.jsx)(`span`,{children:`Folder path on connected computer`}),(0,d.jsx)(`input`,{value:f,onChange:e=>g(e.target.value),placeholder:`/path/to/folder`,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),I())}}),(0,d.jsx)(`button`,{type:`button`,disabled:!f.trim(),onClick:()=>void I(),children:`Add folder`})]}):null]})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,d.jsx)(`span`,{children:`Project name`}),(0,d.jsx)(`input`,{autoFocus:!0,disabled:m,placeholder:`New project`,value:n,onChange:e=>h(e.target.value)})]}),(0,d.jsxs)(`div`,{className:`git-dialog-row`,children:[(0,d.jsx)(`span`,{children:`Location`}),(0,d.jsx)(`strong`,{className:`git-dialog-path`,children:k?`OpenPond Cloud`:p})]})]}),C?(0,d.jsx)(s,{error:C}):null,(0,d.jsxs)(`div`,{className:`new-project-footer`,children:[(0,d.jsx)(`button`,{className:`new-project-cancel`,type:`button`,disabled:m,onClick:_,children:`Cancel`}),(0,d.jsx)(`button`,{className:`git-dialog-primary`,disabled:L,type:`submit`,children:R})]})]})})}export{f as NewProjectDialog};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-DiVhx1GM.js";import"./icons-4yRSxBZj.js";import{C as r,R as i,S as a,z as o}from"./training-model-data-B6IZ3x-t.js";import{i as s,n as c,r as l,t as u}from"./presentation-DcZKqH7w.js";import{t as d}from"./folder-open-i9n8450i.js";import{t as f}from"./image-D-umhyyK.js";import{t as p}from"./loader-circle-DBl6qqtR.js";import{t as m}from"./x-omjwMPbJ.js";import{Gt as h,Tn as g,dn as _,un as v}from"./App-CXhxya9x.js";var y=e(t(),1),b=`application/vnd.openxmlformats-officedocument.wordprocessingml.document`,x=`application/vnd.openxmlformats-officedocument.presentationml.presentation`,S=`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`;function C(e){let t=e.contentType.toLowerCase(),n=e.title.toLowerCase();return t===b||n.endsWith(`.docx`)?{label:`Document`,type:`document`}:t===`application/pdf`||n.endsWith(`.pdf`)?{label:`PDF`,type:`pdf`}:t===x||n.endsWith(`.pptx`)?{label:`Presentation`,type:`presentation`}:t===S||t===`text/csv`||t===`text/tab-separated-values`||n.endsWith(`.xlsx`)||n.endsWith(`.csv`)||n.endsWith(`.tsv`)?{label:`Table`,type:`table`}:t===`text/html`||n.endsWith(`.html`)?{label:`HTML`,type:`html`}:t===`application/json`||t===`text/markdown`||t===`text/plain`?{label:`Text`,type:`text`}:t.startsWith(`image/`)?{label:`Image`,type:`image`}:t.startsWith(`audio/`)?{label:`Audio`,type:`audio`}:t.startsWith(`video/`)?{label:`Video`,type:`video`}:{label:`File`,type:`file`}}function w(e){return[...e].sort((e,t)=>T(t.createdAt)-T(e.createdAt)||t.revision-e.revision)}function T(e){let t=new Date(e).getTime();return Number.isNaN(t)?0:t}var E=15e3,D=new Map;function O(e){let t=(0,y.useMemo)(()=>e?j(e):null,[e]),n=t?k(t):null,[r,i]=(0,y.useState)(n??[]),[a,o]=(0,y.useState)(!!e&&!n),[s,c]=(0,y.useState)(null);return(0,y.useEffect)(()=>{let n=!1;if(!e||!t){i([]),o(!1),c(null);return}let r=k(t);return i(r??[]),o(!r),c(null),A(e).then(e=>{n||i(e)}).catch(e=>{n||c(M(e))}).finally(()=>{n||o(!1)}),()=>{n=!0}},[t,e]),{error:s,loading:a,outputs:r}}function k(e){let t=D.get(e);return t&&t.refreshedAt>0?t.outputs:null}function A(e){let t=j(e),n=D.get(t);if(n?.request)return n.request;if(n&&n.refreshedAt>0&&Date.now()-n.refreshedAt<E)return Promise.resolve(n.outputs);let r=g.workOutputs(e).then(e=>w(e.outputs)).then(e=>(D.set(t,{outputs:e,refreshedAt:Date.now(),request:null}),e)).catch(e=>{throw n?D.set(t,{...n,request:null}):D.delete(t),e});return D.set(t,{outputs:n?.outputs??[],refreshedAt:n?.refreshedAt??0,request:r}),r}function j(e){return`${e.serverUrl}\0${e.token}`}function M(e){return e instanceof Error?e.message:`Could not load Work outputs.`}var N=n(),P=`all`,F=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function I({connection:e,onViewChat:t}){let{error:n,loading:i,outputs:a}=O(e),[o,s]=(0,y.useState)(P),[c,l]=(0,y.useState)(null),[u,d]=(0,y.useState)(null),[f,m]=(0,y.useState)(null);(0,y.useEffect)(()=>()=>{f?.objectUrl&&URL.revokeObjectURL(f.objectUrl)},[f?.objectUrl]);let v=(0,y.useMemo)(()=>Array.from(new Set(a.map(e=>C(e).label))).sort((e,t)=>e.localeCompare(t)),[a]),b=v.includes(o)?o:P,x=(0,y.useMemo)(()=>b===P?a:a.filter(e=>C(e).label===b),[b,a]);async function S(t){if(!e)return;let n=V(t);d(n),l(null);try{let n=await g.workspaceTool(e,t.sourceTaskId,{action:`work_output_read`,source:`ui_button`,args:{outputId:t.id,revision:t.revision}});if(!n.ok)throw Error(n.output);let r=G(n.data),i=typeof r.contentsBase64==`string`?r.contentsBase64:``;if(!i)throw Error(`The output did not include file data.`);let a=new File([W(i)],t.title,{type:t.contentType}),o=C(t),s=o.type===`text`||o.type===`html`;f?.objectUrl&&URL.revokeObjectURL(f.objectUrl),m({file:a,objectUrl:s?null:URL.createObjectURL(a),output:t,text:s?await a.text():null})}catch(e){l(K(e))}finally{d(null)}}async function w(e){if(e.location.kind!==`local`)return;let t=await r(e.location.path,e.title);!t.ok&&!t.canceled&&l(`Could not save a copy of the Work output.`)}return(0,N.jsxs)(`section`,{"aria-label":`Outputs`,className:`outputs-view${f?` detail-open`:``}`,children:[(0,N.jsx)(`div`,{className:`outputs-scroll`,children:(0,N.jsxs)(`div`,{className:`outputs-content`,children:[a.length>0?(0,N.jsx)(`header`,{className:`outputs-header`,children:(0,N.jsx)(`label`,{className:`outputs-filter`,children:(0,N.jsxs)(`select`,{"aria-label":`Filter files by file type`,onChange:e=>s(e.target.value),value:b,children:[(0,N.jsx)(`option`,{value:P,children:`All file types`}),v.map(e=>(0,N.jsx)(`option`,{value:e,children:e},e))]})})}):null,n||c?(0,N.jsx)(h,{error:c??n}):null,e?i&&a.length===0?(0,N.jsxs)(`div`,{className:`outputs-loading`,role:`status`,children:[(0,N.jsx)(p,{className:`outputs-spin`,size:16}),(0,N.jsx)(`span`,{children:`Loading files`})]}):a.length===0?(0,N.jsx)(B,{children:`Files created in Work will appear here.`}):x.length===0?(0,N.jsx)(B,{children:`No files match this file type.`}):(0,N.jsx)(`div`,{className:`outputs-grid`,"data-testid":`desktop-output-cards`,children:x.map(e=>{let n=C(e),r=V(e);return(0,N.jsxs)(`article`,{className:`output-card`,children:[(0,N.jsxs)(`button`,{"aria-label":`Preview ${e.title}`,className:`output-card-main`,disabled:u===r,onClick:()=>void S(e),type:`button`,children:[(0,N.jsx)(`span`,{className:`output-card-icon`,children:(0,N.jsx)(R,{type:n.type})}),(0,N.jsxs)(`span`,{className:`output-card-copy`,children:[(0,N.jsx)(`strong`,{children:e.title}),(0,N.jsxs)(`small`,{children:[n.label,` · `,H(e.sizeBytes)]}),(0,N.jsxs)(`small`,{children:[`Revision `,e.revision,` ·`,` `,(0,N.jsx)(`time`,{dateTime:e.createdAt,children:U(e.createdAt)})]})]}),u===r?(0,N.jsx)(p,{className:`outputs-spin`,size:15}):null]}),(0,N.jsxs)(`div`,{className:`output-card-actions`,children:[e.location.kind===`local`?(0,N.jsx)(`button`,{"aria-label":`Download ${e.title}`,className:`output-download-button`,onClick:()=>void w(e),title:`Download`,type:`button`,children:(0,N.jsx)(_,{"aria-hidden":`true`,size:14})}):null,(0,N.jsx)(`button`,{onClick:()=>t(e.sourceTaskId),type:`button`,children:`View chat`})]})]},r)})}):(0,N.jsx)(B,{children:`Connect to the local OpenPond server to view outputs.`})]})}),f?(0,N.jsx)(L,{onClose:()=>m(null),onSave:()=>void w(f.output),onViewChat:()=>t(f.output.sourceTaskId),preview:f}):null]})}function L({onClose:e,onSave:t,onViewChat:n,preview:r}){let i=C(r.output);return(0,N.jsxs)(`aside`,{"aria-label":`${r.output.title} preview`,className:`output-detail`,children:[(0,N.jsxs)(`header`,{className:`output-detail-header`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h2`,{children:r.output.title}),(0,N.jsxs)(`p`,{children:[i.label,` · Revision `,r.output.revision]})]}),(0,N.jsx)(`button`,{"aria-label":`Close output preview`,onClick:e,type:`button`,children:(0,N.jsx)(m,{size:16})})]}),(0,N.jsx)(`div`,{className:`output-preview-surface`,children:r.text===null?i.type===`image`&&r.objectUrl?(0,N.jsx)(`img`,{alt:r.output.title,src:r.objectUrl}):i.type===`pdf`&&r.objectUrl?(0,N.jsx)(`iframe`,{src:r.objectUrl,title:r.output.title}):i.type===`audio`&&r.objectUrl?(0,N.jsx)(`audio`,{controls:!0,src:r.objectUrl}):i.type===`video`&&r.objectUrl?(0,N.jsx)(`video`,{controls:!0,src:r.objectUrl}):(0,N.jsxs)(`div`,{className:`output-native-preview`,children:[(0,N.jsx)(R,{type:i.type}),(0,N.jsx)(`p`,{children:`This file type uses its native application for detailed review.`})]}):i.type===`html`?(0,N.jsx)(`iframe`,{sandbox:``,srcDoc:r.text,title:r.output.title}):(0,N.jsx)(`pre`,{children:r.text})}),(0,N.jsxs)(`div`,{className:`output-detail-actions`,children:[r.output.location.kind===`local`?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`button`,{onClick:()=>void a(r.output.location.kind===`local`?r.output.location.path:``),type:`button`,children:[(0,N.jsx)(d,{size:14}),`Reveal`]}),(0,N.jsx)(`button`,{"aria-label":`Download ${r.output.title}`,className:`output-download-button`,onClick:t,title:`Download`,type:`button`,children:(0,N.jsx)(_,{"aria-hidden":`true`,size:14})})]}):null,(0,N.jsx)(`button`,{onClick:n,type:`button`,children:`View chat`})]})]})}function R({type:e}){let t=z(e);return(0,N.jsx)(t,{"aria-hidden":`true`,size:18})}function z(e){return e===`audio`?s:e===`html`||e===`text`?o:e===`image`?f:e===`presentation`?u:e===`table`?l:e===`video`?c:e===`file`?i:v}function B({children:e}){return(0,N.jsx)(`p`,{className:`outputs-empty`,children:e})}function V(e){return`${e.sourceTaskId}:${e.id}:${e.revision}`}function H(e){return e<1e3?`${e} B`:e<1e6?`${(e/1e3).toFixed(1)} KB`:`${(e/1e6).toFixed(1)} MB`}function U(e){let t=new Date(e);return Number.isNaN(t.getTime())?`Unknown date`:F.format(t)}function W(e){let t=window.atob(e),n=new ArrayBuffer(t.length),r=new Uint8Array(n);for(let e=0;e<t.length;e+=1)r[e]=t.charCodeAt(e);return n}function G(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function K(e){return e instanceof Error?e.message:`Could not load Work outputs.`}export{I as OutputsPage};
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-CCaTs7xt.js";import"./icons-B4B5eUyR.js";import{C as r,R as i,S as a,z as o}from"./training-model-data-CWoTokkb.js";import{i as s,n as c,r as l,t as u}from"./presentation-B6MaAPC7.js";import{t as d}from"./folder-open-CaJGWSr2.js";import{t as f}from"./image--4h1aK2l.js";import{t as p}from"./loader-circle-DNHvEoaP.js";import{t as m}from"./x-BvVvVB-j.js";import{Gt as h,Tn as g,dn as _,un as v}from"./App-QM6Y2Eod.js";var y=e(t(),1),b=`application/vnd.openxmlformats-officedocument.wordprocessingml.document`,x=`application/vnd.openxmlformats-officedocument.presentationml.presentation`,S=`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`;function C(e){let t=e.contentType.toLowerCase(),n=e.title.toLowerCase();return t===b||n.endsWith(`.docx`)?{label:`Document`,type:`document`}:t===`application/pdf`||n.endsWith(`.pdf`)?{label:`PDF`,type:`pdf`}:t===x||n.endsWith(`.pptx`)?{label:`Presentation`,type:`presentation`}:t===S||t===`text/csv`||t===`text/tab-separated-values`||n.endsWith(`.xlsx`)||n.endsWith(`.csv`)||n.endsWith(`.tsv`)?{label:`Table`,type:`table`}:t===`text/html`||n.endsWith(`.html`)?{label:`HTML`,type:`html`}:t===`application/json`||t===`text/markdown`||t===`text/plain`?{label:`Text`,type:`text`}:t.startsWith(`image/`)?{label:`Image`,type:`image`}:t.startsWith(`audio/`)?{label:`Audio`,type:`audio`}:t.startsWith(`video/`)?{label:`Video`,type:`video`}:{label:`File`,type:`file`}}function w(e){return[...e].sort((e,t)=>T(t.createdAt)-T(e.createdAt)||t.revision-e.revision)}function T(e){let t=new Date(e).getTime();return Number.isNaN(t)?0:t}var E=15e3,D=new Map;function O(e){let t=(0,y.useMemo)(()=>e?j(e):null,[e]),n=t?k(t):null,[r,i]=(0,y.useState)(n??[]),[a,o]=(0,y.useState)(!!e&&!n),[s,c]=(0,y.useState)(null);return(0,y.useEffect)(()=>{let n=!1;if(!e||!t){i([]),o(!1),c(null);return}let r=k(t);return i(r??[]),o(!r),c(null),A(e).then(e=>{n||i(e)}).catch(e=>{n||c(M(e))}).finally(()=>{n||o(!1)}),()=>{n=!0}},[t,e]),{error:s,loading:a,outputs:r}}function k(e){let t=D.get(e);return t&&t.refreshedAt>0?t.outputs:null}function A(e){let t=j(e),n=D.get(t);if(n?.request)return n.request;if(n&&n.refreshedAt>0&&Date.now()-n.refreshedAt<E)return Promise.resolve(n.outputs);let r=g.workOutputs(e).then(e=>w(e.outputs)).then(e=>(D.set(t,{outputs:e,refreshedAt:Date.now(),request:null}),e)).catch(e=>{throw n?D.set(t,{...n,request:null}):D.delete(t),e});return D.set(t,{outputs:n?.outputs??[],refreshedAt:n?.refreshedAt??0,request:r}),r}function j(e){return`${e.serverUrl}\0${e.token}`}function M(e){return e instanceof Error?e.message:`Could not load Work outputs.`}var N=n(),P=`all`,F=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function I({connection:e,onViewChat:t}){let{error:n,loading:i,outputs:a}=O(e),[o,s]=(0,y.useState)(P),[c,l]=(0,y.useState)(null),[u,d]=(0,y.useState)(null),[f,m]=(0,y.useState)(null);(0,y.useEffect)(()=>()=>{f?.objectUrl&&URL.revokeObjectURL(f.objectUrl)},[f?.objectUrl]);let v=(0,y.useMemo)(()=>Array.from(new Set(a.map(e=>C(e).label))).sort((e,t)=>e.localeCompare(t)),[a]),b=v.includes(o)?o:P,x=(0,y.useMemo)(()=>b===P?a:a.filter(e=>C(e).label===b),[b,a]);async function S(t){if(!e)return;let n=V(t);d(n),l(null);try{let n=await g.workspaceTool(e,t.sourceTaskId,{action:`work_output_read`,source:`ui_button`,args:{outputId:t.id,revision:t.revision}});if(!n.ok)throw Error(n.output);let r=G(n.data),i=typeof r.contentsBase64==`string`?r.contentsBase64:``;if(!i)throw Error(`The output did not include file data.`);let a=new File([W(i)],t.title,{type:t.contentType}),o=C(t),s=o.type===`text`||o.type===`html`;f?.objectUrl&&URL.revokeObjectURL(f.objectUrl),m({file:a,objectUrl:s?null:URL.createObjectURL(a),output:t,text:s?await a.text():null})}catch(e){l(K(e))}finally{d(null)}}async function w(e){if(e.location.kind!==`local`)return;let t=await r(e.location.path,e.title);!t.ok&&!t.canceled&&l(`Could not save a copy of the Work output.`)}return(0,N.jsxs)(`section`,{"aria-label":`Outputs`,className:`outputs-view${f?` detail-open`:``}`,children:[(0,N.jsx)(`div`,{className:`outputs-scroll`,children:(0,N.jsxs)(`div`,{className:`outputs-content`,children:[a.length>0?(0,N.jsx)(`header`,{className:`outputs-header`,children:(0,N.jsx)(`label`,{className:`outputs-filter`,children:(0,N.jsxs)(`select`,{"aria-label":`Filter files by file type`,onChange:e=>s(e.target.value),value:b,children:[(0,N.jsx)(`option`,{value:P,children:`All file types`}),v.map(e=>(0,N.jsx)(`option`,{value:e,children:e},e))]})})}):null,n||c?(0,N.jsx)(h,{error:c??n}):null,e?i&&a.length===0?(0,N.jsxs)(`div`,{className:`outputs-loading`,role:`status`,children:[(0,N.jsx)(p,{className:`outputs-spin`,size:16}),(0,N.jsx)(`span`,{children:`Loading files`})]}):a.length===0?(0,N.jsx)(B,{children:`Files created in Work will appear here.`}):x.length===0?(0,N.jsx)(B,{children:`No files match this file type.`}):(0,N.jsx)(`div`,{className:`outputs-grid`,"data-testid":`desktop-output-cards`,children:x.map(e=>{let n=C(e),r=V(e);return(0,N.jsxs)(`article`,{className:`output-card`,children:[(0,N.jsxs)(`button`,{"aria-label":`Preview ${e.title}`,className:`output-card-main`,disabled:u===r,onClick:()=>void S(e),type:`button`,children:[(0,N.jsx)(`span`,{className:`output-card-icon`,children:(0,N.jsx)(R,{type:n.type})}),(0,N.jsxs)(`span`,{className:`output-card-copy`,children:[(0,N.jsx)(`strong`,{children:e.title}),(0,N.jsxs)(`small`,{children:[n.label,` · `,H(e.sizeBytes)]}),(0,N.jsxs)(`small`,{children:[`Revision `,e.revision,` ·`,` `,(0,N.jsx)(`time`,{dateTime:e.createdAt,children:U(e.createdAt)})]})]}),u===r?(0,N.jsx)(p,{className:`outputs-spin`,size:15}):null]}),(0,N.jsxs)(`div`,{className:`output-card-actions`,children:[e.location.kind===`local`?(0,N.jsx)(`button`,{"aria-label":`Download ${e.title}`,className:`output-download-button`,onClick:()=>void w(e),title:`Download`,type:`button`,children:(0,N.jsx)(_,{"aria-hidden":`true`,size:14})}):null,(0,N.jsx)(`button`,{onClick:()=>t(e.sourceTaskId),type:`button`,children:`View chat`})]})]},r)})}):(0,N.jsx)(B,{children:`Connect to the local OpenPond server to view outputs.`})]})}),f?(0,N.jsx)(L,{onClose:()=>m(null),onSave:()=>void w(f.output),onViewChat:()=>t(f.output.sourceTaskId),preview:f}):null]})}function L({onClose:e,onSave:t,onViewChat:n,preview:r}){let i=C(r.output);return(0,N.jsxs)(`aside`,{"aria-label":`${r.output.title} preview`,className:`output-detail`,children:[(0,N.jsxs)(`header`,{className:`output-detail-header`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h2`,{children:r.output.title}),(0,N.jsxs)(`p`,{children:[i.label,` · Revision `,r.output.revision]})]}),(0,N.jsx)(`button`,{"aria-label":`Close output preview`,onClick:e,type:`button`,children:(0,N.jsx)(m,{size:16})})]}),(0,N.jsx)(`div`,{className:`output-preview-surface`,children:r.text===null?i.type===`image`&&r.objectUrl?(0,N.jsx)(`img`,{alt:r.output.title,src:r.objectUrl}):i.type===`pdf`&&r.objectUrl?(0,N.jsx)(`iframe`,{src:r.objectUrl,title:r.output.title}):i.type===`audio`&&r.objectUrl?(0,N.jsx)(`audio`,{controls:!0,src:r.objectUrl}):i.type===`video`&&r.objectUrl?(0,N.jsx)(`video`,{controls:!0,src:r.objectUrl}):(0,N.jsxs)(`div`,{className:`output-native-preview`,children:[(0,N.jsx)(R,{type:i.type}),(0,N.jsx)(`p`,{children:`This file type uses its native application for detailed review.`})]}):i.type===`html`?(0,N.jsx)(`iframe`,{sandbox:``,srcDoc:r.text,title:r.output.title}):(0,N.jsx)(`pre`,{children:r.text})}),(0,N.jsxs)(`div`,{className:`output-detail-actions`,children:[r.output.location.kind===`local`?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`button`,{onClick:()=>void a(r.output.location.kind===`local`?r.output.location.path:``),type:`button`,children:[(0,N.jsx)(d,{size:14}),`Reveal`]}),(0,N.jsx)(`button`,{"aria-label":`Download ${r.output.title}`,className:`output-download-button`,onClick:t,title:`Download`,type:`button`,children:(0,N.jsx)(_,{"aria-hidden":`true`,size:14})})]}):null,(0,N.jsx)(`button`,{onClick:n,type:`button`,children:`View chat`})]})]})}function R({type:e}){let t=z(e);return(0,N.jsx)(t,{"aria-hidden":`true`,size:18})}function z(e){return e===`audio`?s:e===`html`||e===`text`?o:e===`image`?f:e===`presentation`?u:e===`table`?l:e===`video`?c:e===`file`?i:v}function B({children:e}){return(0,N.jsx)(`p`,{className:`outputs-empty`,children:e})}function V(e){return`${e.sourceTaskId}:${e.id}:${e.revision}`}function H(e){return e<1e3?`${e} B`:e<1e6?`${(e/1e3).toFixed(1)} KB`:`${(e/1e6).toFixed(1)} MB`}function U(e){let t=new Date(e);return Number.isNaN(t.getTime())?`Unknown date`:F.format(t)}function W(e){let t=window.atob(e),n=new ArrayBuffer(t.length),r=new Uint8Array(n);for(let e=0;e<t.length;e+=1)r[e]=t.charCodeAt(e);return n}function G(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function K(e){return e instanceof Error?e.message:`Could not load Work outputs.`}export{I as OutputsPage};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,h as n,m as r}from"./index-DiVhx1GM.js";var i=e(t(),1),a=n(),o=r(),s=(0,i.createContext)(null);function c({children:e}){let[t,n]=(0,i.useState)(null),[r,a]=(0,i.useState)(null),[c,l]=(0,i.useState)(null),u=(0,i.useMemo)(()=>({title:t,actions:r,activity:c,setTitle:n,setActions:a,setActivity:l}),[t,r,c]);return(0,o.jsx)(s.Provider,{value:u,children:e})}function l({children:e}){return(0,o.jsx)(s.Provider,{value:null,children:e})}function u({children:e,className:t=``}){let n=(0,i.useContext)(s);return(0,o.jsx)(`div`,{ref:n?.setTitle,className:`page-chrome-title-target ${t}`,children:e?(0,o.jsx)(`div`,{className:`page-chrome-fallback`,children:e}):null})}function d({className:e=``}){let t=(0,i.useContext)(s);return(0,o.jsx)(`div`,{ref:t?.setActions,className:e})}function f({title:e,actions:t,fallback:n,children:r}){let c=(0,i.useContext)(s);return c?(0,o.jsxs)(o.Fragment,{children:[c.title?(0,a.createPortal)((0,o.jsx)(`div`,{className:`page-chrome-title`,children:e}),c.title):null,c.actions&&t?(0,a.createPortal)(t,c.actions):null,r]}):n??(0,o.jsxs)(`header`,{children:[e,t]})}export{u as a,c as i,l as n,f as r,d as t};
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,h as n,m as r}from"./index-CCaTs7xt.js";var i=e(t(),1),a=n(),o=r(),s=(0,i.createContext)(null);function c({children:e}){let[t,n]=(0,i.useState)(null),[r,a]=(0,i.useState)(null),[c,l]=(0,i.useState)(null),u=(0,i.useMemo)(()=>({title:t,actions:r,activity:c,setTitle:n,setActions:a,setActivity:l}),[t,r,c]);return(0,o.jsx)(s.Provider,{value:u,children:e})}function l({children:e}){return(0,o.jsx)(s.Provider,{value:null,children:e})}function u({children:e,className:t=``}){let n=(0,i.useContext)(s);return(0,o.jsx)(`div`,{ref:n?.setTitle,className:`page-chrome-title-target ${t}`,children:e?(0,o.jsx)(`div`,{className:`page-chrome-fallback`,children:e}):null})}function d({className:e=``}){let t=(0,i.useContext)(s);return(0,o.jsx)(`div`,{ref:t?.setActions,className:e})}function f({title:e,actions:t,fallback:n,children:r}){let c=(0,i.useContext)(s);return c?(0,o.jsxs)(o.Fragment,{children:[c.title?(0,a.createPortal)((0,o.jsx)(`div`,{className:`page-chrome-title`,children:e}),c.title):null,c.actions&&t?(0,a.createPortal)(t,c.actions):null,r]}):n??(0,o.jsxs)(`header`,{children:[e,t]})}export{u as a,c as i,l as n,f as r,d as t};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-DiVhx1GM.js";import{h as r}from"./app-models-BUdzQbXo.js";import"./icons-4yRSxBZj.js";import{t as i}from"./cloud-upload-DFjZE4O4.js";import{t as a}from"./external-link-3ZnEFUXd.js";import{$t as o,Cn as s,Gt as c,Tn as l,cn as u,en as d,pn as f,qt as p,s as m}from"./App-CXhxya9x.js";var h=e(t(),1);function g(e,t){let n=e.project.sourceLabel?.trim()??``;if(e.project.sourceType===`github_repo`&&n){if(/^https?:\/\//i.test(n))return n;if(/^[^/\s]+\/[^/\s]+$/.test(n))return`https://github.com/${n}`}return m({accountBaseUrl:t,organizationSlug:e.project.organizationSlug,projectSlug:e.project.slug})}function _(e,t){return e.kind===`cloud`?g(e,t):e.project.linkedSandboxProject?.sourceRepoUrl??null}function v(e){return e.replace(/^https?:\/\//i,``).replace(/\/$/,``)}async function y(e){let t=window.openpond?.browser;if(t){let n=await t.openExternal({conversationId:`projects`,url:e});if(!n.ok)throw Error(n.error??`Unable to open project URL.`)}else window.open(e,`_blank`,`noopener,noreferrer`)}var b=n();function x({loading:e,workspace:t,linked:n,unavailable:r}){if(e)return(0,b.jsx)(E,{children:`Loading environments…`});if(!n)return(0,b.jsx)(E,{children:`Upload this local project to create cloud development environments.`});if(r)return(0,b.jsx)(E,{error:!0,children:`Unable to load environments.`});if(!t?.environments.length)return(0,b.jsx)(E,{children:`No development environment has been created for this project yet.`});let i=A(t);return(0,b.jsx)(T,{headings:[`Environment`,`Status`,`Branch`,`Default`,`Updated`],children:t.environments.map(({sandbox:e,runtime:t})=>(0,b.jsxs)(`tr`,{children:[(0,b.jsx)(`td`,{children:(0,b.jsx)(`strong`,{children:j(e.metadata,e.id)})}),(0,b.jsx)(`td`,{children:(0,b.jsx)(D,{status:e.state})}),(0,b.jsx)(`td`,{children:(0,b.jsx)(`code`,{children:t?.baseBranch??e.repoRef??`Not available`})}),(0,b.jsx)(`td`,{children:e.id===i?`Preferred`:`—`}),(0,b.jsx)(`td`,{children:I(e.updatedAt)})]},e.id))})}function S({loading:e,workspace:t,linked:n,unavailable:r}){return e?(0,b.jsx)(E,{children:`Loading deployments…`}):n?r||t?.errors.deployments?(0,b.jsx)(E,{error:!0,children:`Unable to load deployments.`}):t?.website?t.deployments.length?(0,b.jsx)(T,{headings:[`Deployment`,`Status`,`Commit`,`Build`,`Created by`,`Created`],children:t.deployments.map(e=>(0,b.jsx)(O,{deployment:e},e.release.id))}):(0,b.jsx)(E,{children:`No deployments yet.`}):(0,b.jsx)(E,{children:`Set up Website before creating a deployment.`}):(0,b.jsx)(E,{children:`Upload this local project before creating deployments.`})}function C({loading:e,workspace:t,linked:n,unavailable:r}){let[i,a]=(0,h.useState)(null);return e?(0,b.jsx)(E,{children:`Loading requests…`}):n?r||t?.errors.requests?(0,b.jsx)(E,{error:!0,children:`Unable to load requests.`}):t?.website?t.requests.length?(0,b.jsx)(`div`,{className:`project-detail-table-frame`,children:(0,b.jsxs)(`table`,{className:`project-detail-table project-request-table`,children:[(0,b.jsx)(`thead`,{children:(0,b.jsxs)(`tr`,{children:[(0,b.jsx)(`th`,{children:`Request`}),(0,b.jsx)(`th`,{children:`Status`}),(0,b.jsx)(`th`,{children:`Runtime`}),(0,b.jsx)(`th`,{children:`Started`}),(0,b.jsx)(`th`,{children:`Duration`})]})}),t.requests.map(e=>{let t=i===e.id;return(0,b.jsxs)(`tbody`,{children:[(0,b.jsxs)(`tr`,{"aria-expanded":t,className:`project-request-row`,onClick:()=>a(t=>t===e.id?null:e.id),children:[(0,b.jsxs)(`td`,{children:[(0,b.jsx)(`code`,{children:e.method}),` `,N(e.path)]}),(0,b.jsx)(`td`,{children:(0,b.jsx)(D,{status:String(e.responseStatus),tone:e.outcome===`failure`?`error`:`success`})}),(0,b.jsx)(`td`,{children:e.coldStart===null?`Unknown`:e.coldStart?`Cold`:`Warm`}),(0,b.jsx)(`td`,{children:I(e.startedAt)}),(0,b.jsx)(`td`,{children:F(e.totalDurationMs)})]}),t?(0,b.jsx)(k,{trace:e}):null]},e.id)})]})}):(0,b.jsx)(E,{children:`No requests yet.`}):(0,b.jsx)(E,{children:`Set up Website to receive requests.`}):(0,b.jsx)(E,{children:`Upload this local project and set up Website to receive requests.`})}function w({loading:e,workspace:t,linked:n,unavailable:r}){if(e)return(0,b.jsx)(E,{children:`Loading website…`});if(!n)return(0,b.jsx)(E,{children:`Upload this local project before setting up Website.`});if(r||t?.errors.website)return(0,b.jsx)(E,{error:!0,children:`Unable to load the website.`});let i=t?.website??null,a=i?.settings.platformDomain?`https://${i.settings.platformDomain}`:null,o=i?.releases.find(e=>e.id===i.settings.activeReleaseId)?.sourceCommitSha??null,s=[[`Public URL`,a?(0,b.jsx)(`a`,{href:a,onClick:e=>{e.preventDefault(),y(a)},children:v(a)}):`Not assigned`],[`Live release`,i?.settings.activeReleaseId?`Active`:`Not published`],[`Source`,o?P(o):`Not available`],[`Account database`,M(t)],[`Availability`,i?.settings.runtimePolicy?.availabilityMode===`always_on`?`Always on`:`On demand`]];return(0,b.jsxs)(`div`,{className:`project-detail-table-frame`,children:[(0,b.jsxs)(`table`,{className:`project-detail-table`,children:[(0,b.jsx)(`thead`,{children:(0,b.jsxs)(`tr`,{children:[(0,b.jsx)(`th`,{children:`Setting`}),(0,b.jsx)(`th`,{children:`Value`})]})}),(0,b.jsx)(`tbody`,{children:s.map(([e,t])=>(0,b.jsxs)(`tr`,{children:[(0,b.jsx)(`td`,{children:e}),(0,b.jsx)(`td`,{children:t})]},e))})]}),i?null:(0,b.jsx)(`div`,{className:`project-detail-table-note`,children:`Website has not been set up for this project.`})]})}function T({headings:e,children:t}){return(0,b.jsx)(`div`,{className:`project-detail-table-frame`,children:(0,b.jsxs)(`table`,{className:`project-detail-table`,children:[(0,b.jsx)(`thead`,{children:(0,b.jsx)(`tr`,{children:e.map(e=>(0,b.jsx)(`th`,{children:e},e))})}),(0,b.jsx)(`tbody`,{children:t})]})})}function E({children:e,error:t=!1}){return(0,b.jsx)(`div`,{className:`project-detail-empty${t?` error`:``}`,children:e})}function D({status:e,tone:t}){return(0,b.jsx)(`span`,{className:`project-detail-status${t?` ${t}`:``}`,children:e.replaceAll(`_`,` `)})}function O({deployment:e}){let{build:t,release:n}=e;return(0,b.jsxs)(`tr`,{children:[(0,b.jsx)(`td`,{children:(0,b.jsxs)(`strong`,{children:[`v`,n.version]})}),(0,b.jsx)(`td`,{children:(0,b.jsx)(D,{status:n.status,tone:n.status===`failed`?`error`:n.status===`active`||n.status===`ready`?`success`:void 0})}),(0,b.jsx)(`td`,{children:(0,b.jsx)(`code`,{children:n.sourceCommitSha?P(n.sourceCommitSha):`Not available`})}),(0,b.jsx)(`td`,{children:t?`${t.status.replaceAll(`_`,` `)} · ${t.currentStage.replaceAll(`_`,` `)}`:`Not started`}),(0,b.jsx)(`td`,{children:e.creatorName??`Unknown`}),(0,b.jsx)(`td`,{children:I(n.createdAt)})]})}function k({trace:e}){return(0,b.jsx)(`tr`,{className:`project-request-detail`,children:(0,b.jsxs)(`td`,{colSpan:5,children:[(0,b.jsx)(`dl`,{children:e.stages.map((e,t)=>(0,b.jsxs)(`div`,{children:[(0,b.jsxs)(`dt`,{children:[e.name.replaceAll(`_`,` `),e.errorCode?` · ${e.errorCode}`:``]}),(0,b.jsx)(`dd`,{children:F(e.durationMs)})]},`${e.name}:${t}`))}),e.errorCode?(0,b.jsx)(`p`,{children:e.errorCode}):null]})})}function A(e){let t=e.project.metadata.preferredDevelopmentSandboxId;return typeof t==`string`&&t.trim()?t:null}function j(e,t){for(let t of[`name`,`label`,`environmentName`]){let n=e[t];if(typeof n==`string`&&n.trim())return n}return t.length>18?t.slice(0,18):t}function M(e){return e?.website?e.errors.database?`Unavailable`:e.database?.status===`ready`?`Connected · ${e.database.provider}`:e.database?.status===`provisioning`?`Connecting…`:`Not connected`:`Set up the website first`}function N(e){let t=e.indexOf(`/ingress`);return t===-1?e:`/api${e.slice(t+8)||`/`}`}function P(e){return e.length>12?e.slice(0,12):e}function F(e){return e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(e<1e4?2:1)} s`}function I(e){let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function L({accountBaseUrl:e,connection:t,project:n,taskCount:r,teamName:u,onBack:f,onNewTask:m,onTogglePinned:g,onUploadLocalProject:v}){let[T,E]=(0,h.useState)(`source`),[D,O]=(0,h.useState)(null),[k,A]=(0,h.useState)(null),[j,M]=(0,h.useState)(!1),[N,P]=(0,h.useState)([]),[F,I]=(0,h.useState)(!1),[L,K]=(0,h.useState)(null),q=H(n);(0,h.useEffect)(()=>{E(`source`)},[n.id]),(0,h.useEffect)(()=>{let e=!0;if(A(null),O(null),M(!1),P([]),K(null),!t)return I(!1),()=>{e=!1};I(!0);let r=q?R(t,q):Promise.resolve(null),i=n.kind===`local`?l.localProjectActions(t,n.project.id):Promise.resolve(null);return Promise.allSettled([r,i]).then(([t,r])=>{if(!e)return;t.status===`fulfilled`&&t.value&&(O(t.value.project),A(t.value.workspace),M(t.value.workspaceUnavailable)),r.status===`fulfilled`&&r.value&&P(r.value.actions.map(W));let i=[t,r].filter(e=>e.status===`rejected`);i.length>0&&i.length===Number(!!q)+Number(n.kind===`local`)&&K(i[0]?.reason instanceof Error?i[0].reason.message:`Project details could not be loaded.`),I(!1)}),()=>{e=!1}},[t,q?.projectId,q?.teamId,n]);let J=(0,h.useMemo)(()=>G(U(D),N),[D,N]),Y=_(n,e),X=V({hostedProject:D,project:n,repositoryUrl:Y,taskCount:r,teamName:u});return(0,b.jsxs)(`section`,{"aria-label":`${n.project.name} project`,className:`project-detail-view`,children:[(0,b.jsxs)(`header`,{className:`project-detail-header`,children:[(0,b.jsxs)(`div`,{className:`project-detail-heading`,children:[(0,b.jsxs)(`button`,{className:`project-detail-back`,onClick:f,type:`button`,children:[(0,b.jsx)(s,{"aria-hidden":`true`,size:15}),(0,b.jsx)(`span`,{children:`Projects`})]}),(0,b.jsx)(`h1`,{children:n.project.name})]}),(0,b.jsxs)(`div`,{className:`project-detail-actions`,children:[n.kind===`local`?(0,b.jsxs)(`button`,{onClick:()=>v(n),type:`button`,children:[(0,b.jsx)(i,{"aria-hidden":`true`,size:14}),(0,b.jsx)(`span`,{children:`Upload`})]}):null,Y?(0,b.jsxs)(`button`,{onClick:()=>void y(Y),type:`button`,children:[(0,b.jsx)(a,{"aria-hidden":`true`,size:14}),(0,b.jsx)(`span`,{children:`Open repository`})]}):null,(0,b.jsxs)(`button`,{onClick:()=>m(n),type:`button`,children:[(0,b.jsx)(p,{"aria-hidden":`true`,size:14}),(0,b.jsx)(`span`,{children:`New task`})]}),(0,b.jsx)(`button`,{"aria-label":`${n.pinned?`Unpin`:`Pin`} ${n.project.name}`,onClick:()=>g(n),title:n.pinned?`Unpin project`:`Pin project`,type:`button`,children:n.pinned?(0,b.jsx)(o,{"aria-hidden":`true`,size:14}):(0,b.jsx)(d,{"aria-hidden":`true`,size:14})})]})]}),(0,b.jsxs)(`div`,{"aria-label":`Project detail`,className:`project-detail-tabs`,role:`tablist`,children:[(0,b.jsx)(`button`,{"aria-selected":T===`source`,onClick:()=>E(`source`),role:`tab`,type:`button`,children:`Source`}),(0,b.jsxs)(`button`,{"aria-selected":T===`actions`,onClick:()=>E(`actions`),role:`tab`,type:`button`,children:[`Project Actions`,J.length>0?(0,b.jsx)(`span`,{children:J.length}):null]}),(0,b.jsx)(`button`,{"aria-selected":T===`environments`,onClick:()=>E(`environments`),role:`tab`,type:`button`,children:`Environments`}),(0,b.jsx)(`button`,{"aria-selected":T===`deployments`,onClick:()=>E(`deployments`),role:`tab`,type:`button`,children:`Deployments`}),(0,b.jsx)(`button`,{"aria-selected":T===`requests`,onClick:()=>E(`requests`),role:`tab`,type:`button`,children:`Requests`}),(0,b.jsx)(`button`,{"aria-selected":T===`website`,onClick:()=>E(`website`),role:`tab`,type:`button`,children:`Website`})]}),L?(0,b.jsx)(c,{error:L}):null,T===`source`?(0,b.jsx)(z,{loading:F,rows:X}):T===`actions`?(0,b.jsx)(B,{actions:J,loading:F}):T===`environments`?(0,b.jsx)(x,{linked:!!q,loading:F,unavailable:j,workspace:k}):T===`deployments`?(0,b.jsx)(S,{linked:!!q,loading:F,unavailable:j,workspace:k}):T===`requests`?(0,b.jsx)(C,{linked:!!q,loading:F,unavailable:j,workspace:k}):(0,b.jsx)(w,{linked:!!q,loading:F,unavailable:j,workspace:k})]})}async function R(e,t){try{let n=await l.getSandboxProjectWorkspace(e,t.projectId,{teamId:t.teamId});return{project:n.project,workspace:n,workspaceUnavailable:!1}}catch{return{project:(await l.getSandboxProject(e,t.projectId,{teamId:t.teamId})).project,workspace:null,workspaceUnavailable:!0}}}function z({loading:e,rows:t}){return(0,b.jsx)(`div`,{className:`project-detail-table-frame`,children:(0,b.jsxs)(`table`,{className:`project-detail-table`,children:[(0,b.jsx)(`thead`,{children:(0,b.jsxs)(`tr`,{children:[(0,b.jsx)(`th`,{children:`Setting`}),(0,b.jsx)(`th`,{children:`Value`})]})}),(0,b.jsx)(`tbody`,{children:t.map(([t,n])=>(0,b.jsxs)(`tr`,{children:[(0,b.jsx)(`td`,{children:t}),(0,b.jsx)(`td`,{children:e&&t===`Latest commit`?`Loading…`:n})]},t))})]})})}function B({actions:e,loading:t}){return t?(0,b.jsx)(`div`,{className:`project-detail-empty`,children:`Loading Project Actions…`}):e.length===0?(0,b.jsx)(`div`,{className:`project-detail-empty`,children:`No Project Actions are registered from this source.`}):(0,b.jsx)(`div`,{className:`project-detail-table-frame`,children:(0,b.jsxs)(`table`,{className:`project-detail-table actions`,children:[(0,b.jsx)(`thead`,{children:(0,b.jsxs)(`tr`,{children:[(0,b.jsx)(`th`,{children:`Action`}),(0,b.jsx)(`th`,{children:`Description`}),(0,b.jsx)(`th`,{children:`Source`})]})}),(0,b.jsx)(`tbody`,{children:e.map(e=>(0,b.jsxs)(`tr`,{children:[(0,b.jsx)(`td`,{children:(0,b.jsx)(`code`,{children:e.id})}),(0,b.jsx)(`td`,{children:e.description??`No description`}),(0,b.jsx)(`td`,{children:e.source===`hosted`?`Hosted project`:`Local source`})]},`${e.source}:${e.id}`))})]})})}function V(e){let{hostedProject:t,project:n,repositoryUrl:r,taskCount:i,teamName:a}=e,o=n.kind===`local`?n.project.linkedSandboxProject:null,s=t?.gitBranch??t?.defaultBranch??(n.kind===`cloud`?n.project.defaultBranch:o?.defaultBranch)??`Not set`,c=t?K(t):o?.lastUploadedCommit??null,l=t?.sandboxManifestSyncedAt??(n.kind===`cloud`?n.project.syncedAt:o?.syncedAt)??null;return[[`Repository`,r?(0,b.jsx)(`a`,{href:r,onClick:e=>{e.preventDefault(),y(r)},children:v(r)}):n.kind===`local`?n.project.path:`Not available`],...n.kind===`local`?[[`Primary folder`,n.project.workspacePath],[`Source folders`,(0,b.jsx)(`ul`,{className:`project-source-folder-list`,children:(n.project.sourceFolders??[n.project.workspacePath]).map(e=>(0,b.jsx)(`li`,{children:e},e))},`source-folders`)]]:[],[`Branch`,s],[`Latest commit`,c?q(c):`Not available`],[`Last synced`,l?J(l):`Not available`],[`Team`,a??(n.kind===`cloud`?n.project.organizationName:null)??`Local only`],[`Tasks`,String(i)]]}function H(e){if(e.kind===`cloud`)return{projectId:e.project.id,teamId:e.project.teamId};let t=e.project.linkedSandboxProject;return t?{projectId:t.projectId,teamId:t.teamId}:null}function U(e){let t=e?.sandboxActionRegistry?.actions;return Array.isArray(t)?t.flatMap(e=>{if(!e||typeof e!=`object`||Array.isArray(e))return[];let t=e,n=typeof(t.id??t.name)==`string`?String(t.id??t.name).trim():``;return n?[{id:n,description:typeof t.description==`string`?t.description:null,source:`hosted`}]:[]}):[]}function W(e){return{id:e.id,description:e.description??e.label??e.name??null,source:`local`}}function G(e,t){let n=new Map;for(let r of[...e,...t])n.has(r.id)||n.set(r.id,r);return Array.from(n.values()).sort((e,t)=>e.id.localeCompare(t.id))}function K(e){return[e.sourceConfig.commitSha,e.sourceConfig.sourceCommitSha,e.metadata.commitSha,e.metadata.sourceCommitSha,e.templateRemoteSha].find(e=>typeof e==`string`&&!!e.trim())??null}function q(e){return e.length>12?e.slice(0,12):e}function J(e){let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}var Y=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function X({accountBaseUrl:e,connection:t,projects:n,taskCountByProjectId:a,teamName:s,onNewCloudProject:c,onNewLocalProject:l,onNewTask:m,onTogglePinned:g,onUploadLocalProject:_}){let[v,y]=(0,h.useState)(null),x=(0,h.useMemo)(()=>n.find(e=>e.id===v)??null,[n,v]);return(0,h.useEffect)(()=>{v&&!x&&y(null)},[x,v]),x?(0,b.jsx)(L,{accountBaseUrl:e,connection:t,onBack:()=>y(null),onNewTask:m,onTogglePinned:g,onUploadLocalProject:_,project:x,taskCount:a[x.id]??0,teamName:s}):(0,b.jsxs)(`section`,{"aria-label":`Projects`,className:`projects-page`,children:[(0,b.jsxs)(`header`,{className:`projects-page-header`,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`h1`,{children:`Projects`}),(0,b.jsxs)(`p`,{children:[`Local projects on this device and hosted projects for `,s??`your active team`,`.`]})]}),(0,b.jsxs)(`div`,{className:`projects-cloud-actions`,children:[(0,b.jsxs)(`button`,{className:`projects-cloud-button`,onClick:l,type:`button`,children:[(0,b.jsx)(u,{"aria-hidden":`true`,size:15}),(0,b.jsx)(`span`,{children:`Add project`})]}),(0,b.jsxs)(`button`,{className:`projects-cloud-button`,onClick:c,type:`button`,children:[(0,b.jsx)(f,{"aria-hidden":`true`,size:15}),(0,b.jsx)(`span`,{children:`New cloud project`})]})]})]}),n.length===0?(0,b.jsxs)(`div`,{className:`projects-empty`,children:[(0,b.jsx)(u,{"aria-hidden":`true`,size:24}),(0,b.jsx)(`h2`,{children:`No projects yet`}),(0,b.jsx)(`p`,{children:`Add folders from this computer or create a hosted project.`})]}):(0,b.jsx)(`div`,{className:`projects-table-frame`,children:(0,b.jsxs)(`table`,{className:`projects-table`,children:[(0,b.jsx)(`thead`,{children:(0,b.jsxs)(`tr`,{children:[(0,b.jsx)(`th`,{scope:`col`,children:`Project`}),(0,b.jsx)(`th`,{scope:`col`,children:`Location`}),(0,b.jsx)(`th`,{scope:`col`,children:`Tasks`}),(0,b.jsx)(`th`,{scope:`col`,children:`Updated`}),(0,b.jsx)(`th`,{"aria-label":`Project actions`,scope:`col`})]})}),(0,b.jsx)(`tbody`,{children:n.map(t=>{let n=t.project.updatedAt;return(0,b.jsxs)(`tr`,{children:[(0,b.jsx)(`td`,{children:(0,b.jsxs)(`button`,{className:`projects-name-button`,onClick:()=>y(t.id),type:`button`,children:[(0,b.jsx)(`span`,{className:`projects-kind-icon ${Z(t)}`,children:r(t)?(0,b.jsx)(u,{"aria-hidden":`true`,size:16}):(0,b.jsx)(f,{"aria-hidden":`true`,size:16})}),(0,b.jsx)(`span`,{className:`projects-name-copy`,children:(0,b.jsx)(`strong`,{children:t.project.name})})]})}),(0,b.jsx)(`td`,{children:r(t)?(0,b.jsxs)(`div`,{className:`projects-location-cell`,children:[(0,b.jsx)(`span`,{className:`projects-location`,title:t.project.path,children:t.project.path}),(0,b.jsxs)(`button`,{className:`projects-upload-button`,onClick:()=>_(t),title:`Upload ${t.project.name} to the active team`,type:`button`,children:[(0,b.jsx)(i,{"aria-hidden":`true`,size:13}),(0,b.jsx)(`span`,{children:`Upload`})]})]}):(0,b.jsx)(Q,{accountBaseUrl:e,project:t})}),(0,b.jsx)(`td`,{children:a[t.id]??0}),(0,b.jsx)(`td`,{children:n?(0,b.jsx)(`time`,{dateTime:n,children:$(n)}):(0,b.jsx)(`span`,{className:`projects-table-muted`,children:`—`})}),(0,b.jsx)(`td`,{children:(0,b.jsxs)(`div`,{className:`projects-row-actions`,children:[(0,b.jsx)(`button`,{"aria-label":`Start a new task in ${t.project.name}`,onClick:()=>m(t),title:`New task`,type:`button`,children:(0,b.jsx)(p,{"aria-hidden":`true`,size:15})}),(0,b.jsx)(`button`,{"aria-label":`${t.pinned?`Unpin`:`Pin`} ${t.project.name}`,onClick:()=>g(t),title:t.pinned?`Unpin project`:`Pin project`,type:`button`,children:t.pinned?(0,b.jsx)(o,{"aria-hidden":`true`,size:15}):(0,b.jsx)(d,{"aria-hidden":`true`,size:15})})]})})]},t.id)})})]})})]})}function Z(e){return r(e)?e.project.linkedSandboxProject&&e.cloudLinkTrusted?`linked`:`desktop`:`cloud`}function Q({accountBaseUrl:e,project:t}){let n=g(t,e);return n?(0,b.jsxs)(`a`,{className:`projects-location-link`,href:n,onClick:e=>{e.preventDefault(),y(n)},title:n,children:[(0,b.jsx)(`span`,{children:v(n)}),(0,b.jsx)(a,{"aria-hidden":`true`,size:12})]}):(0,b.jsx)(`span`,{className:`projects-table-muted`,children:`Repository unavailable`})}function $(e){let t=Date.parse(e);return Number.isFinite(t)?Y.format(t):e}export{X as ProjectsPage};
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-CCaTs7xt.js";import{h as r}from"./app-models-BUdzQbXo.js";import"./icons-B4B5eUyR.js";import{t as i}from"./cloud-upload-CWamjPts.js";import{t as a}from"./external-link-BSn21e-y.js";import{$t as o,Cn as s,Gt as c,Tn as l,cn as u,en as d,pn as f,qt as p,s as m}from"./App-QM6Y2Eod.js";var h=e(t(),1);function g(e,t){let n=e.project.sourceLabel?.trim()??``;if(e.project.sourceType===`github_repo`&&n){if(/^https?:\/\//i.test(n))return n;if(/^[^/\s]+\/[^/\s]+$/.test(n))return`https://github.com/${n}`}return m({accountBaseUrl:t,organizationSlug:e.project.organizationSlug,projectSlug:e.project.slug})}function _(e,t){return e.kind===`cloud`?g(e,t):e.project.linkedSandboxProject?.sourceRepoUrl??null}function v(e){return e.replace(/^https?:\/\//i,``).replace(/\/$/,``)}async function y(e){let t=window.openpond?.browser;if(t){let n=await t.openExternal({conversationId:`projects`,url:e});if(!n.ok)throw Error(n.error??`Unable to open project URL.`)}else window.open(e,`_blank`,`noopener,noreferrer`)}var b=n();function x({loading:e,workspace:t,linked:n,unavailable:r}){if(e)return(0,b.jsx)(E,{children:`Loading environments…`});if(!n)return(0,b.jsx)(E,{children:`Upload this local project to create cloud development environments.`});if(r)return(0,b.jsx)(E,{error:!0,children:`Unable to load environments.`});if(!t?.environments.length)return(0,b.jsx)(E,{children:`No development environment has been created for this project yet.`});let i=A(t);return(0,b.jsx)(T,{headings:[`Environment`,`Status`,`Branch`,`Default`,`Updated`],children:t.environments.map(({sandbox:e,runtime:t})=>(0,b.jsxs)(`tr`,{children:[(0,b.jsx)(`td`,{children:(0,b.jsx)(`strong`,{children:j(e.metadata,e.id)})}),(0,b.jsx)(`td`,{children:(0,b.jsx)(D,{status:e.state})}),(0,b.jsx)(`td`,{children:(0,b.jsx)(`code`,{children:t?.baseBranch??e.repoRef??`Not available`})}),(0,b.jsx)(`td`,{children:e.id===i?`Preferred`:`—`}),(0,b.jsx)(`td`,{children:I(e.updatedAt)})]},e.id))})}function S({loading:e,workspace:t,linked:n,unavailable:r}){return e?(0,b.jsx)(E,{children:`Loading deployments…`}):n?r||t?.errors.deployments?(0,b.jsx)(E,{error:!0,children:`Unable to load deployments.`}):t?.website?t.deployments.length?(0,b.jsx)(T,{headings:[`Deployment`,`Status`,`Commit`,`Build`,`Created by`,`Created`],children:t.deployments.map(e=>(0,b.jsx)(O,{deployment:e},e.release.id))}):(0,b.jsx)(E,{children:`No deployments yet.`}):(0,b.jsx)(E,{children:`Set up Website before creating a deployment.`}):(0,b.jsx)(E,{children:`Upload this local project before creating deployments.`})}function C({loading:e,workspace:t,linked:n,unavailable:r}){let[i,a]=(0,h.useState)(null);return e?(0,b.jsx)(E,{children:`Loading requests…`}):n?r||t?.errors.requests?(0,b.jsx)(E,{error:!0,children:`Unable to load requests.`}):t?.website?t.requests.length?(0,b.jsx)(`div`,{className:`project-detail-table-frame`,children:(0,b.jsxs)(`table`,{className:`project-detail-table project-request-table`,children:[(0,b.jsx)(`thead`,{children:(0,b.jsxs)(`tr`,{children:[(0,b.jsx)(`th`,{children:`Request`}),(0,b.jsx)(`th`,{children:`Status`}),(0,b.jsx)(`th`,{children:`Runtime`}),(0,b.jsx)(`th`,{children:`Started`}),(0,b.jsx)(`th`,{children:`Duration`})]})}),t.requests.map(e=>{let t=i===e.id;return(0,b.jsxs)(`tbody`,{children:[(0,b.jsxs)(`tr`,{"aria-expanded":t,className:`project-request-row`,onClick:()=>a(t=>t===e.id?null:e.id),children:[(0,b.jsxs)(`td`,{children:[(0,b.jsx)(`code`,{children:e.method}),` `,N(e.path)]}),(0,b.jsx)(`td`,{children:(0,b.jsx)(D,{status:String(e.responseStatus),tone:e.outcome===`failure`?`error`:`success`})}),(0,b.jsx)(`td`,{children:e.coldStart===null?`Unknown`:e.coldStart?`Cold`:`Warm`}),(0,b.jsx)(`td`,{children:I(e.startedAt)}),(0,b.jsx)(`td`,{children:F(e.totalDurationMs)})]}),t?(0,b.jsx)(k,{trace:e}):null]},e.id)})]})}):(0,b.jsx)(E,{children:`No requests yet.`}):(0,b.jsx)(E,{children:`Set up Website to receive requests.`}):(0,b.jsx)(E,{children:`Upload this local project and set up Website to receive requests.`})}function w({loading:e,workspace:t,linked:n,unavailable:r}){if(e)return(0,b.jsx)(E,{children:`Loading website…`});if(!n)return(0,b.jsx)(E,{children:`Upload this local project before setting up Website.`});if(r||t?.errors.website)return(0,b.jsx)(E,{error:!0,children:`Unable to load the website.`});let i=t?.website??null,a=i?.settings.platformDomain?`https://${i.settings.platformDomain}`:null,o=i?.releases.find(e=>e.id===i.settings.activeReleaseId)?.sourceCommitSha??null,s=[[`Public URL`,a?(0,b.jsx)(`a`,{href:a,onClick:e=>{e.preventDefault(),y(a)},children:v(a)}):`Not assigned`],[`Live release`,i?.settings.activeReleaseId?`Active`:`Not published`],[`Source`,o?P(o):`Not available`],[`Account database`,M(t)],[`Availability`,i?.settings.runtimePolicy?.availabilityMode===`always_on`?`Always on`:`On demand`]];return(0,b.jsxs)(`div`,{className:`project-detail-table-frame`,children:[(0,b.jsxs)(`table`,{className:`project-detail-table`,children:[(0,b.jsx)(`thead`,{children:(0,b.jsxs)(`tr`,{children:[(0,b.jsx)(`th`,{children:`Setting`}),(0,b.jsx)(`th`,{children:`Value`})]})}),(0,b.jsx)(`tbody`,{children:s.map(([e,t])=>(0,b.jsxs)(`tr`,{children:[(0,b.jsx)(`td`,{children:e}),(0,b.jsx)(`td`,{children:t})]},e))})]}),i?null:(0,b.jsx)(`div`,{className:`project-detail-table-note`,children:`Website has not been set up for this project.`})]})}function T({headings:e,children:t}){return(0,b.jsx)(`div`,{className:`project-detail-table-frame`,children:(0,b.jsxs)(`table`,{className:`project-detail-table`,children:[(0,b.jsx)(`thead`,{children:(0,b.jsx)(`tr`,{children:e.map(e=>(0,b.jsx)(`th`,{children:e},e))})}),(0,b.jsx)(`tbody`,{children:t})]})})}function E({children:e,error:t=!1}){return(0,b.jsx)(`div`,{className:`project-detail-empty${t?` error`:``}`,children:e})}function D({status:e,tone:t}){return(0,b.jsx)(`span`,{className:`project-detail-status${t?` ${t}`:``}`,children:e.replaceAll(`_`,` `)})}function O({deployment:e}){let{build:t,release:n}=e;return(0,b.jsxs)(`tr`,{children:[(0,b.jsx)(`td`,{children:(0,b.jsxs)(`strong`,{children:[`v`,n.version]})}),(0,b.jsx)(`td`,{children:(0,b.jsx)(D,{status:n.status,tone:n.status===`failed`?`error`:n.status===`active`||n.status===`ready`?`success`:void 0})}),(0,b.jsx)(`td`,{children:(0,b.jsx)(`code`,{children:n.sourceCommitSha?P(n.sourceCommitSha):`Not available`})}),(0,b.jsx)(`td`,{children:t?`${t.status.replaceAll(`_`,` `)} · ${t.currentStage.replaceAll(`_`,` `)}`:`Not started`}),(0,b.jsx)(`td`,{children:e.creatorName??`Unknown`}),(0,b.jsx)(`td`,{children:I(n.createdAt)})]})}function k({trace:e}){return(0,b.jsx)(`tr`,{className:`project-request-detail`,children:(0,b.jsxs)(`td`,{colSpan:5,children:[(0,b.jsx)(`dl`,{children:e.stages.map((e,t)=>(0,b.jsxs)(`div`,{children:[(0,b.jsxs)(`dt`,{children:[e.name.replaceAll(`_`,` `),e.errorCode?` · ${e.errorCode}`:``]}),(0,b.jsx)(`dd`,{children:F(e.durationMs)})]},`${e.name}:${t}`))}),e.errorCode?(0,b.jsx)(`p`,{children:e.errorCode}):null]})})}function A(e){let t=e.project.metadata.preferredDevelopmentSandboxId;return typeof t==`string`&&t.trim()?t:null}function j(e,t){for(let t of[`name`,`label`,`environmentName`]){let n=e[t];if(typeof n==`string`&&n.trim())return n}return t.length>18?t.slice(0,18):t}function M(e){return e?.website?e.errors.database?`Unavailable`:e.database?.status===`ready`?`Connected · ${e.database.provider}`:e.database?.status===`provisioning`?`Connecting…`:`Not connected`:`Set up the website first`}function N(e){let t=e.indexOf(`/ingress`);return t===-1?e:`/api${e.slice(t+8)||`/`}`}function P(e){return e.length>12?e.slice(0,12):e}function F(e){return e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(e<1e4?2:1)} s`}function I(e){let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function L({accountBaseUrl:e,connection:t,project:n,taskCount:r,teamName:u,onBack:f,onNewTask:m,onTogglePinned:g,onUploadLocalProject:v}){let[T,E]=(0,h.useState)(`source`),[D,O]=(0,h.useState)(null),[k,A]=(0,h.useState)(null),[j,M]=(0,h.useState)(!1),[N,P]=(0,h.useState)([]),[F,I]=(0,h.useState)(!1),[L,K]=(0,h.useState)(null),q=H(n);(0,h.useEffect)(()=>{E(`source`)},[n.id]),(0,h.useEffect)(()=>{let e=!0;if(A(null),O(null),M(!1),P([]),K(null),!t)return I(!1),()=>{e=!1};I(!0);let r=q?R(t,q):Promise.resolve(null),i=n.kind===`local`?l.localProjectActions(t,n.project.id):Promise.resolve(null);return Promise.allSettled([r,i]).then(([t,r])=>{if(!e)return;t.status===`fulfilled`&&t.value&&(O(t.value.project),A(t.value.workspace),M(t.value.workspaceUnavailable)),r.status===`fulfilled`&&r.value&&P(r.value.actions.map(W));let i=[t,r].filter(e=>e.status===`rejected`);i.length>0&&i.length===Number(!!q)+Number(n.kind===`local`)&&K(i[0]?.reason instanceof Error?i[0].reason.message:`Project details could not be loaded.`),I(!1)}),()=>{e=!1}},[t,q?.projectId,q?.teamId,n]);let J=(0,h.useMemo)(()=>G(U(D),N),[D,N]),Y=_(n,e),X=V({hostedProject:D,project:n,repositoryUrl:Y,taskCount:r,teamName:u});return(0,b.jsxs)(`section`,{"aria-label":`${n.project.name} project`,className:`project-detail-view`,children:[(0,b.jsxs)(`header`,{className:`project-detail-header`,children:[(0,b.jsxs)(`div`,{className:`project-detail-heading`,children:[(0,b.jsxs)(`button`,{className:`project-detail-back`,onClick:f,type:`button`,children:[(0,b.jsx)(s,{"aria-hidden":`true`,size:15}),(0,b.jsx)(`span`,{children:`Projects`})]}),(0,b.jsx)(`h1`,{children:n.project.name})]}),(0,b.jsxs)(`div`,{className:`project-detail-actions`,children:[n.kind===`local`?(0,b.jsxs)(`button`,{onClick:()=>v(n),type:`button`,children:[(0,b.jsx)(i,{"aria-hidden":`true`,size:14}),(0,b.jsx)(`span`,{children:`Upload`})]}):null,Y?(0,b.jsxs)(`button`,{onClick:()=>void y(Y),type:`button`,children:[(0,b.jsx)(a,{"aria-hidden":`true`,size:14}),(0,b.jsx)(`span`,{children:`Open repository`})]}):null,(0,b.jsxs)(`button`,{onClick:()=>m(n),type:`button`,children:[(0,b.jsx)(p,{"aria-hidden":`true`,size:14}),(0,b.jsx)(`span`,{children:`New task`})]}),(0,b.jsx)(`button`,{"aria-label":`${n.pinned?`Unpin`:`Pin`} ${n.project.name}`,onClick:()=>g(n),title:n.pinned?`Unpin project`:`Pin project`,type:`button`,children:n.pinned?(0,b.jsx)(o,{"aria-hidden":`true`,size:14}):(0,b.jsx)(d,{"aria-hidden":`true`,size:14})})]})]}),(0,b.jsxs)(`div`,{"aria-label":`Project detail`,className:`project-detail-tabs`,role:`tablist`,children:[(0,b.jsx)(`button`,{"aria-selected":T===`source`,onClick:()=>E(`source`),role:`tab`,type:`button`,children:`Source`}),(0,b.jsxs)(`button`,{"aria-selected":T===`actions`,onClick:()=>E(`actions`),role:`tab`,type:`button`,children:[`Project Actions`,J.length>0?(0,b.jsx)(`span`,{children:J.length}):null]}),(0,b.jsx)(`button`,{"aria-selected":T===`environments`,onClick:()=>E(`environments`),role:`tab`,type:`button`,children:`Environments`}),(0,b.jsx)(`button`,{"aria-selected":T===`deployments`,onClick:()=>E(`deployments`),role:`tab`,type:`button`,children:`Deployments`}),(0,b.jsx)(`button`,{"aria-selected":T===`requests`,onClick:()=>E(`requests`),role:`tab`,type:`button`,children:`Requests`}),(0,b.jsx)(`button`,{"aria-selected":T===`website`,onClick:()=>E(`website`),role:`tab`,type:`button`,children:`Website`})]}),L?(0,b.jsx)(c,{error:L}):null,T===`source`?(0,b.jsx)(z,{loading:F,rows:X}):T===`actions`?(0,b.jsx)(B,{actions:J,loading:F}):T===`environments`?(0,b.jsx)(x,{linked:!!q,loading:F,unavailable:j,workspace:k}):T===`deployments`?(0,b.jsx)(S,{linked:!!q,loading:F,unavailable:j,workspace:k}):T===`requests`?(0,b.jsx)(C,{linked:!!q,loading:F,unavailable:j,workspace:k}):(0,b.jsx)(w,{linked:!!q,loading:F,unavailable:j,workspace:k})]})}async function R(e,t){try{let n=await l.getSandboxProjectWorkspace(e,t.projectId,{teamId:t.teamId});return{project:n.project,workspace:n,workspaceUnavailable:!1}}catch{return{project:(await l.getSandboxProject(e,t.projectId,{teamId:t.teamId})).project,workspace:null,workspaceUnavailable:!0}}}function z({loading:e,rows:t}){return(0,b.jsx)(`div`,{className:`project-detail-table-frame`,children:(0,b.jsxs)(`table`,{className:`project-detail-table`,children:[(0,b.jsx)(`thead`,{children:(0,b.jsxs)(`tr`,{children:[(0,b.jsx)(`th`,{children:`Setting`}),(0,b.jsx)(`th`,{children:`Value`})]})}),(0,b.jsx)(`tbody`,{children:t.map(([t,n])=>(0,b.jsxs)(`tr`,{children:[(0,b.jsx)(`td`,{children:t}),(0,b.jsx)(`td`,{children:e&&t===`Latest commit`?`Loading…`:n})]},t))})]})})}function B({actions:e,loading:t}){return t?(0,b.jsx)(`div`,{className:`project-detail-empty`,children:`Loading Project Actions…`}):e.length===0?(0,b.jsx)(`div`,{className:`project-detail-empty`,children:`No Project Actions are registered from this source.`}):(0,b.jsx)(`div`,{className:`project-detail-table-frame`,children:(0,b.jsxs)(`table`,{className:`project-detail-table actions`,children:[(0,b.jsx)(`thead`,{children:(0,b.jsxs)(`tr`,{children:[(0,b.jsx)(`th`,{children:`Action`}),(0,b.jsx)(`th`,{children:`Description`}),(0,b.jsx)(`th`,{children:`Source`})]})}),(0,b.jsx)(`tbody`,{children:e.map(e=>(0,b.jsxs)(`tr`,{children:[(0,b.jsx)(`td`,{children:(0,b.jsx)(`code`,{children:e.id})}),(0,b.jsx)(`td`,{children:e.description??`No description`}),(0,b.jsx)(`td`,{children:e.source===`hosted`?`Hosted project`:`Local source`})]},`${e.source}:${e.id}`))})]})})}function V(e){let{hostedProject:t,project:n,repositoryUrl:r,taskCount:i,teamName:a}=e,o=n.kind===`local`?n.project.linkedSandboxProject:null,s=t?.gitBranch??t?.defaultBranch??(n.kind===`cloud`?n.project.defaultBranch:o?.defaultBranch)??`Not set`,c=t?K(t):o?.lastUploadedCommit??null,l=t?.sandboxManifestSyncedAt??(n.kind===`cloud`?n.project.syncedAt:o?.syncedAt)??null;return[[`Repository`,r?(0,b.jsx)(`a`,{href:r,onClick:e=>{e.preventDefault(),y(r)},children:v(r)}):n.kind===`local`?n.project.path:`Not available`],...n.kind===`local`?[[`Primary folder`,n.project.workspacePath],[`Source folders`,(0,b.jsx)(`ul`,{className:`project-source-folder-list`,children:(n.project.sourceFolders??[n.project.workspacePath]).map(e=>(0,b.jsx)(`li`,{children:e},e))},`source-folders`)]]:[],[`Branch`,s],[`Latest commit`,c?q(c):`Not available`],[`Last synced`,l?J(l):`Not available`],[`Team`,a??(n.kind===`cloud`?n.project.organizationName:null)??`Local only`],[`Tasks`,String(i)]]}function H(e){if(e.kind===`cloud`)return{projectId:e.project.id,teamId:e.project.teamId};let t=e.project.linkedSandboxProject;return t?{projectId:t.projectId,teamId:t.teamId}:null}function U(e){let t=e?.sandboxActionRegistry?.actions;return Array.isArray(t)?t.flatMap(e=>{if(!e||typeof e!=`object`||Array.isArray(e))return[];let t=e,n=typeof(t.id??t.name)==`string`?String(t.id??t.name).trim():``;return n?[{id:n,description:typeof t.description==`string`?t.description:null,source:`hosted`}]:[]}):[]}function W(e){return{id:e.id,description:e.description??e.label??e.name??null,source:`local`}}function G(e,t){let n=new Map;for(let r of[...e,...t])n.has(r.id)||n.set(r.id,r);return Array.from(n.values()).sort((e,t)=>e.id.localeCompare(t.id))}function K(e){return[e.sourceConfig.commitSha,e.sourceConfig.sourceCommitSha,e.metadata.commitSha,e.metadata.sourceCommitSha,e.templateRemoteSha].find(e=>typeof e==`string`&&!!e.trim())??null}function q(e){return e.length>12?e.slice(0,12):e}function J(e){let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}var Y=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function X({accountBaseUrl:e,connection:t,projects:n,taskCountByProjectId:a,teamName:s,onNewCloudProject:c,onNewLocalProject:l,onNewTask:m,onTogglePinned:g,onUploadLocalProject:_}){let[v,y]=(0,h.useState)(null),x=(0,h.useMemo)(()=>n.find(e=>e.id===v)??null,[n,v]);return(0,h.useEffect)(()=>{v&&!x&&y(null)},[x,v]),x?(0,b.jsx)(L,{accountBaseUrl:e,connection:t,onBack:()=>y(null),onNewTask:m,onTogglePinned:g,onUploadLocalProject:_,project:x,taskCount:a[x.id]??0,teamName:s}):(0,b.jsxs)(`section`,{"aria-label":`Projects`,className:`projects-page`,children:[(0,b.jsxs)(`header`,{className:`projects-page-header`,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`h1`,{children:`Projects`}),(0,b.jsxs)(`p`,{children:[`Local projects on this device and hosted projects for `,s??`your active team`,`.`]})]}),(0,b.jsxs)(`div`,{className:`projects-cloud-actions`,children:[(0,b.jsxs)(`button`,{className:`projects-cloud-button`,onClick:l,type:`button`,children:[(0,b.jsx)(u,{"aria-hidden":`true`,size:15}),(0,b.jsx)(`span`,{children:`Add project`})]}),(0,b.jsxs)(`button`,{className:`projects-cloud-button`,onClick:c,type:`button`,children:[(0,b.jsx)(f,{"aria-hidden":`true`,size:15}),(0,b.jsx)(`span`,{children:`New cloud project`})]})]})]}),n.length===0?(0,b.jsxs)(`div`,{className:`projects-empty`,children:[(0,b.jsx)(u,{"aria-hidden":`true`,size:24}),(0,b.jsx)(`h2`,{children:`No projects yet`}),(0,b.jsx)(`p`,{children:`Add folders from this computer or create a hosted project.`})]}):(0,b.jsx)(`div`,{className:`projects-table-frame`,children:(0,b.jsxs)(`table`,{className:`projects-table`,children:[(0,b.jsx)(`thead`,{children:(0,b.jsxs)(`tr`,{children:[(0,b.jsx)(`th`,{scope:`col`,children:`Project`}),(0,b.jsx)(`th`,{scope:`col`,children:`Location`}),(0,b.jsx)(`th`,{scope:`col`,children:`Tasks`}),(0,b.jsx)(`th`,{scope:`col`,children:`Updated`}),(0,b.jsx)(`th`,{"aria-label":`Project actions`,scope:`col`})]})}),(0,b.jsx)(`tbody`,{children:n.map(t=>{let n=t.project.updatedAt;return(0,b.jsxs)(`tr`,{children:[(0,b.jsx)(`td`,{children:(0,b.jsxs)(`button`,{className:`projects-name-button`,onClick:()=>y(t.id),type:`button`,children:[(0,b.jsx)(`span`,{className:`projects-kind-icon ${Z(t)}`,children:r(t)?(0,b.jsx)(u,{"aria-hidden":`true`,size:16}):(0,b.jsx)(f,{"aria-hidden":`true`,size:16})}),(0,b.jsx)(`span`,{className:`projects-name-copy`,children:(0,b.jsx)(`strong`,{children:t.project.name})})]})}),(0,b.jsx)(`td`,{children:r(t)?(0,b.jsxs)(`div`,{className:`projects-location-cell`,children:[(0,b.jsx)(`span`,{className:`projects-location`,title:t.project.path,children:t.project.path}),(0,b.jsxs)(`button`,{className:`projects-upload-button`,onClick:()=>_(t),title:`Upload ${t.project.name} to the active team`,type:`button`,children:[(0,b.jsx)(i,{"aria-hidden":`true`,size:13}),(0,b.jsx)(`span`,{children:`Upload`})]})]}):(0,b.jsx)(Q,{accountBaseUrl:e,project:t})}),(0,b.jsx)(`td`,{children:a[t.id]??0}),(0,b.jsx)(`td`,{children:n?(0,b.jsx)(`time`,{dateTime:n,children:$(n)}):(0,b.jsx)(`span`,{className:`projects-table-muted`,children:`—`})}),(0,b.jsx)(`td`,{children:(0,b.jsxs)(`div`,{className:`projects-row-actions`,children:[(0,b.jsx)(`button`,{"aria-label":`Start a new task in ${t.project.name}`,onClick:()=>m(t),title:`New task`,type:`button`,children:(0,b.jsx)(p,{"aria-hidden":`true`,size:15})}),(0,b.jsx)(`button`,{"aria-label":`${t.pinned?`Unpin`:`Pin`} ${t.project.name}`,onClick:()=>g(t),title:t.pinned?`Unpin project`:`Pin project`,type:`button`,children:t.pinned?(0,b.jsx)(o,{"aria-hidden":`true`,size:15}):(0,b.jsx)(d,{"aria-hidden":`true`,size:15})})]})})]},t.id)})})]})})]})}function Z(e){return r(e)?e.project.linkedSandboxProject&&e.cloudLinkTrusted?`linked`:`desktop`:`cloud`}function Q({accountBaseUrl:e,project:t}){let n=g(t,e);return n?(0,b.jsxs)(`a`,{className:`projects-location-link`,href:n,onClick:e=>{e.preventDefault(),y(n)},title:n,children:[(0,b.jsx)(`span`,{children:v(n)}),(0,b.jsx)(a,{"aria-hidden":`true`,size:12})]}):(0,b.jsx)(`span`,{className:`projects-table-muted`,children:`Repository unavailable`})}function $(e){let t=Date.parse(e);return Number.isFinite(t)?Y.format(t):e}export{X as ProjectsPage};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-DiVhx1GM.js";import{w as r,x as i}from"./submit-issue-command-Dq3TqJLV.js";import{a,l as o,n as s,t as ee}from"./browser-sidebar-links-PVPCrsDJ.js";import"./icons-4yRSxBZj.js";import{t as c}from"./folder-open-i9n8450i.js";import{i as te,n as ne,r as re,t as ie}from"./ChatTimelineEntry-z7_kur3h.js";import{t as l}from"./message-square-CVDgKlKX.js";import{t as ae}from"./plus-CFNxAPMK.js";import{t as oe}from"./x-omjwMPbJ.js";import{$ as u,at as se,i as d,ot as f,rt as p,st as ce}from"./App-CXhxya9x.js";import{Dt as le,Et as m,Lt as h,Ot as g,Tt as ue,bt as de,xt as fe,zt as pe}from"./MainPane-D3fQou29.js";var _=e(t(),1),v=n();function me({panel:e,runtimeEventStore:t,actionCatalog:n,createImproveActions:r,contextCompaction:i,steerActiveResponses:c,initialScrollState:l,codexPermissionMode:ae,codexReasoningEffort:oe,openPondCommandAccessMode:u,connection:d,connectedAppMentions:p,mentionApps:me,codexPersonalSkills:y,profileSkills:b,profileTarget:x,projectTarget:S,providerSettings:C,accountBaseUrl:w,billingOrganizationSlug:T,billingTeamId:E,showToast:D,workspaceTarget:O,onCodexPermissionModeChange:k,onCodexReasoningEffortChange:A,onOpenPondCommandAccessModeChange:j,onModelChange:M,onOpenAttachmentInSidebar:N,onOpenFileInSidebar:P,onOpenProfileSettings:F,onOpenSession:I,onOpenPonder:L,onProviderChange:R,onProviderSetupOpen:he,onPromptChange:ge,onProfileTargetChange:z,onScrollStateChange:_e,onProjectTargetChange:ve,onResolveApproval:ye,onShowBrowserPanel:B,onStop:V,onSubmit:H,onWorkspaceTargetChange:be}){let U=(0,_.useRef)(null),[W]=(0,_.useState)(()=>new m),G=(0,_.useRef)(l?.stickyToBottom??!0),K=(0,_.useRef)(!1);g(t,e.runtimeSource===`live`?e.sessionId:null,P);let q=ue(t,e.runtimeSource===`live`?e.sessionId:null),J=(0,_.useMemo)(()=>{if(e.runtimeSource===`history`||!e.sessionId)return e;let t=q.events,n=se(t,[]);return{...e,messages:s(W.project(t),e.pendingUserMessage),createImproveRun:o({events:t}),contextWindowStatus:a({provider:e.provider,snapshot:f(n,e.sessionId),preferences:i}),goalRuntime:ce(n,e.sessionId)}},[W,i,q,e]),Y=J.running&&!J.pendingApproval&&pe(J.messages),X=(0,_.useMemo)(()=>J.createImproveRun?{...r,run:J.createImproveRun}:null,[J.createImproveRun,r]),Z=(0,_.useMemo)(()=>h(J.messages,{showThinkingIndicator:Y}),[J.messages,Y]),xe=te(J.messages,J.sessionId??`draft:${J.id}`),Q=J.messages.at(-1),$=re({connection:d,latestTurnId:Q?.turnId??null,sessionId:J.sessionId,turnRunning:J.running}),Se=[J.id,J.sessionId??`draft`,Z.length,Q?.id??``,Q?.content?.length??0,Q?.timestamp??``,Y?`thinking`:``].join(`:`);(0,_.useLayoutEffect)(()=>{let e=U.current;e&&!K.current&&(K.current=!0,e.scrollTop=l?.stickyToBottom?e.scrollHeight:l?.scrollTop??0)},[l]),le({contentKey:Se,onContentChange:e=>{G.current&&(e.scrollTop=e.scrollHeight)},threadRef:U});let Ce=(0,_.useCallback)((e,t)=>{let n=J.sessionId??`side-chat:${J.id}`;ee({conversationId:n,href:e,explicitFile:t?.explicitFile,newTab:t?.newTab}).then(e=>{e&&B()})},[J.id,J.sessionId,B]),we=(0,_.useCallback)(async(e,t)=>{let n=t.action===`answer`?t.text:`Dismiss this question`;if(!await H([],null,null,{displayPrompt:n,promptOverride:n,turnMetadata:{userQuestionResolution:t}}))throw Error(`The question response could not be sent.`)},[H]);return(0,v.jsxs)(`section`,{"data-thread-session":J.sessionId??void 0,className:`right-chat-pane ${J.pendingApproval?`has-approval`:``}`,id:`right-chat-panel-${J.id}`,role:`tabpanel`,"aria-labelledby":`right-chat-tab-${J.id}`,children:[(0,v.jsx)(`div`,{className:`chat-thread right-chat-thread`,ref:U,onScroll:e=>{let t=e.currentTarget;G.current=t.scrollHeight-t.scrollTop-t.clientHeight<=72,_e({scrollTop:t.scrollTop,stickyToBottom:G.current})},children:Z.map(t=>(0,v.jsx)(ie,{row:t,renderMessage:t=>(0,v.jsx)(ne,{activeWorkspaceAppId:J.activeWorkspaceAppId,accountBaseUrl:w,billingOrganizationSlug:T,billingTeamId:E,connection:d,animateInitialContent:t.message.role===`assistant`&&xe.has(t.message.id),kvCacheSummary:t.showFooter&&t.message.turnId?$.get(t.message.turnId)??null:null,message:t.message,codexRecoveryEnabled:t.message.turnId===Q?.turnId,onOpenBrowserLink:Ce,onOpenAttachmentInSidebar:N,onOpenFileInSidebar:P,onOpenProfileSettings:F,onResolveUserQuestion:we,onOpenSession:I,onOpenPonder:L,userAttachmentDisplay:e.provider===`codex`?`compact`:`full`,workspaceRootPath:J.workspaceRootPath,showFooter:t.showFooter},t.id)},t.id))}),(0,v.jsxs)(`div`,{className:`composer-stack dock right-chat-composer ${J.pendingApproval?`has-approval`:``}`,children:[(0,v.jsx)(de,{connection:d,showToast:D,approval:J.pendingApproval,onResolve:ye}),(0,v.jsx)(fe,{mode:`dock`,prompt:e.prompt,mentionApps:me,connectedAppMentions:p,profileSkills:e.provider===`codex`?y:b,profileTarget:e.provider===`codex`?null:x,selectedMentionAppId:null,contextWindowStatus:J.contextWindowStatus,goalRuntime:J.goalRuntime,createImproveRuntime:X,busy:J.running,running:J.running,steerActiveResponses:c,taskSessionId:e.runtimeSource===`live`?e.sessionId:null,goalSessionId:e.sessionId,taskEvents:q.events,submissionScopeKey:J.sessionId??J.id,showProjectFooter:!1,connection:d,providerSettings:C,provider:e.provider,model:e.model,projectTarget:S,actionCatalog:n,workspaceTarget:O,codexPermissionMode:ae,codexReasoningEffort:oe,openPondCommandAccessMode:e.provider===`codex`?u:J.session?.openPondCommandAccessMode??u,onProviderChange:R,onProviderSetupOpen:he,onProjectTargetChange:ve,onWorkspaceTargetChange:be,onModelChange:M,onCodexPermissionModeChange:k,onCodexReasoningEffortChange:A,onOpenPondCommandAccessModeChange:j,onPromptChange:ge,onProfileTargetChange:z,onMentionAppSelect:void 0,showToast:D,onSubmit:H,onStop:V})]})]})}function y({panels:e,runtimeEventStore:t,actionCatalog:n=[],createImproveActions:a,contextCompaction:o,steerActiveResponses:s,busy:ee,codexPermissionMode:te,codexReasoningEffort:ne,openPondCommandAccessMode:re,connection:ie,connectedAppMentions:se,mentionApps:f,codexPersonalSkills:ce,profileSkills:le=[],profileLibrary:m={lastUsed:null,profiles:[]},extensionCatalog:h,projectTarget:g,providerSettings:ue,accountBaseUrl:de,billingOrganizationSlug:fe,billingTeamId:pe,showToast:y,workspaceTarget:b,onAddChat:x,onActivatePanel:S,onClosePanel:C,onCodexPermissionModeChange:w,onCodexReasoningEffortChange:T,onOpenPondCommandAccessModeChange:E,onModelChange:D,onOpenAttachmentInSidebar:O,onOpenFileInSidebar:k,onOpenProfileSettings:A,onOpenSession:j,onOpenPonder:M,onProviderChange:N,onProviderSetupOpen:P,onPromptChange:F,onProfileTargetChange:I,onScrollStateChange:L,onProjectTargetChange:R,onResolveApproval:he,onResizeStart:ge,onSelectFiles:z,onShowBrowserPanel:_e,onStop:ve,onSubmit:ye,onWorkspaceTargetChange:B}){let[V,H]=(0,_.useState)(!1),[be,U]=(0,_.useState)(()=>d(e)?.id??null),W=(0,_.useRef)(null),G=(0,_.useRef)(new Map),K=(0,_.useRef)(new Set(e.map(e=>e.id))),q=(0,_.useRef)(new Map(e.map(e=>[e.id,e.activationVersion]))),J=e.find(e=>e.id===be)??e.at(-1)??null,Y=J?.session?.currentProfile??m.lastUsed,X=p(m,Y),Z=X?u(X,h):le,xe=X?[...n.filter(e=>!r(e)),...i(X)]:n;(0,_.useEffect)(()=>{let t=K.current,n=q.current,r=null,i=null;for(let a of e)t.has(a.id)||(r=a),t.has(a.id)&&a.activationVersion>(n.get(a.id)??0)&&(i=a);K.current=new Set(e.map(e=>e.id)),q.current=new Map(e.map(e=>[e.id,e.activationVersion])),U(t=>i?i.id:r?r.id:t&&e.some(e=>e.id===t)?t:e.at(-1)?.id??null)},[e]),(0,_.useEffect)(()=>{if(!V)return;function e(e){W.current?.contains(e.target)||H(!1)}function t(e){e.key===`Escape`&&H(!1)}return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[V]);let Q=(0,_.useCallback)((e,t=!1)=>{U(e),S(e),t&&window.requestAnimationFrame(()=>G.current.get(e)?.focus())},[S]),$=(0,_.useCallback)((e=!1)=>{z(),e&&window.requestAnimationFrame(()=>{document.getElementById(`right-sidebar-files-tab`)?.focus()})},[z]),Se=(0,_.useCallback)((t,n)=>{let r=e.findIndex(e=>e.id===n);if(r<0)return;let i=r+1,a=null;if(t.key===`ArrowRight`&&(a=(i+1)%(e.length+1)),t.key===`ArrowLeft`&&(a=(i-1+e.length+1)%(e.length+1)),t.key===`Home`&&(a=0),t.key===`End`&&(a=e.length),a===null)return;if(t.preventDefault(),a===0){$(!0);return}let o=e[a-1];o&&Q(o.id,!0)},[e,$,Q]),Ce=(0,_.useCallback)(t=>{if(![`ArrowRight`,`ArrowLeft`,`Home`,`End`].includes(t.key)||(t.preventDefault(),t.key===`Home`))return;let n=t.key===`ArrowLeft`||t.key===`End`?e.at(-1):e[0];n&&Q(n.id,!0)},[e,Q]);return(0,v.jsxs)(`aside`,{className:`workspace-diff-panel right-chat-panel-stack`,"aria-label":`Side chats`,children:[(0,v.jsx)(`div`,{className:`workspace-diff-resize-handle`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize side chat panel`,onPointerDown:ge}),(0,v.jsx)(`div`,{className:`workspace-diff-topbar right-chat-topbar`,children:(0,v.jsxs)(`div`,{className:`workspace-diff-tabs`,role:`tablist`,"aria-label":`Right sidebar views`,children:[(0,v.jsxs)(`button`,{type:`button`,className:`workspace-diff-tab`,role:`tab`,id:`right-sidebar-files-tab`,"aria-controls":`right-sidebar-files-panel`,"aria-selected":!1,tabIndex:-1,onClick:()=>$(!1),onKeyDown:Ce,children:[(0,v.jsx)(c,{size:14}),(0,v.jsx)(`span`,{children:`Files`})]}),e.map(e=>{let t=e.id===J?.id;return(0,v.jsxs)(`div`,{className:`workspace-diff-tab right-chat-tab ${t?`active`:``}`,children:[(0,v.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":t,tabIndex:t?0:-1,title:e.title,ref:t=>{t?G.current.set(e.id,t):G.current.delete(e.id)},onClick:()=>Q(e.id),onKeyDown:t=>Se(t,e.id),children:[e.running?(0,v.jsx)(`span`,{className:`right-chat-status-dot`,"aria-label":`Running`}):null,(0,v.jsx)(`span`,{children:e.title})]}),(0,v.jsx)(`button`,{type:`button`,className:`workspace-diff-tab-close`,title:`Close ${e.title}`,"aria-label":`Close ${e.title}`,onClick:t=>{t.stopPropagation(),C(e.id)},children:(0,v.jsx)(oe,{size:12})})]},e.id)}),(0,v.jsxs)(`div`,{className:`workspace-diff-add-anchor`,ref:W,children:[(0,v.jsx)(`button`,{type:`button`,className:`workspace-diff-add-tab ${V?`active`:``}`,title:`Add to right sidebar`,"aria-label":`Add to right sidebar`,"aria-haspopup":`menu`,"aria-expanded":V,onClick:()=>H(e=>!e),children:(0,v.jsx)(ae,{size:15})}),V?(0,v.jsxs)(`div`,{className:`workspace-diff-add-menu right-chat-add-popover`,role:`menu`,children:[(0,v.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{H(!1),x()},children:[(0,v.jsx)(l,{size:13}),(0,v.jsx)(`span`,{children:`New task`})]}),(0,v.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{H(!1),z()},children:[(0,v.jsx)(c,{size:13}),(0,v.jsx)(`span`,{children:`Files`})]})]}):null]})]})}),(0,v.jsx)(`div`,{className:`right-chat-stack-body panes-1`,children:J?(0,v.jsx)(me,{busy:ee,createImproveActions:a,contextCompaction:o,steerActiveResponses:s,codexPermissionMode:te,codexReasoningEffort:ne,openPondCommandAccessMode:re,connection:ie,connectedAppMentions:se,actionCatalog:xe,mentionApps:f,codexPersonalSkills:ce,profileSkills:Z,profileTarget:null,panel:J,runtimeEventStore:t,initialScrollState:{scrollTop:J.scrollTop,stickyToBottom:J.stickyToBottom},projectTarget:g,providerSettings:ue,accountBaseUrl:de,billingOrganizationSlug:fe,billingTeamId:pe,showToast:y,workspaceTarget:b,onCodexPermissionModeChange:w,onCodexReasoningEffortChange:T,onOpenPondCommandAccessModeChange:e=>E(e,J.session),onModelChange:e=>D(J.id,e),onOpenAttachmentInSidebar:O,onOpenFileInSidebar:k,onOpenProfileSettings:A,onOpenSession:j,onOpenPonder:M,onProviderChange:(e,t)=>N(J.id,e,t),onProviderSetupOpen:P,onPromptChange:e=>F(J.id,e),onProfileTargetChange:e=>I(J.sessionId,e),onScrollStateChange:e=>L(J.id,e),onProjectTargetChange:R,onResolveApproval:he,onShowBrowserPanel:_e,onStop:()=>ve(J.sessionId),onSubmit:(e,t,n,r)=>ye(J.id,e,t,n,r),onWorkspaceTargetChange:B},J.id):null})]})}export{y as RightChatPanelStack};
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-CCaTs7xt.js";import{w as r,x as i}from"./submit-issue-command-V--K9lVQ.js";import{a,l as o,n as s,t as ee}from"./browser-sidebar-links-PVPCrsDJ.js";import"./icons-B4B5eUyR.js";import{t as c}from"./folder-open-CaJGWSr2.js";import{i as te,n as ne,r as re,t as ie}from"./ChatTimelineEntry-BBOnAzJB.js";import{t as l}from"./message-square-oIMQDMc3.js";import{t as ae}from"./plus-DkfcQyma.js";import{t as oe}from"./x-BvVvVB-j.js";import{$ as u,at as se,i as d,ot as f,rt as p,st as ce}from"./App-QM6Y2Eod.js";import{Dt as le,Et as m,Lt as h,Ot as g,Tt as ue,bt as de,xt as fe,zt as pe}from"./MainPane-mWeD0M-f.js";var _=e(t(),1),v=n();function me({panel:e,runtimeEventStore:t,actionCatalog:n,createImproveActions:r,contextCompaction:i,steerActiveResponses:c,initialScrollState:l,codexPermissionMode:ae,codexReasoningEffort:oe,openPondCommandAccessMode:u,connection:d,connectedAppMentions:p,mentionApps:me,codexPersonalSkills:y,profileSkills:b,profileTarget:x,projectTarget:S,providerSettings:C,accountBaseUrl:w,billingOrganizationSlug:T,billingTeamId:E,showToast:D,workspaceTarget:O,onCodexPermissionModeChange:k,onCodexReasoningEffortChange:A,onOpenPondCommandAccessModeChange:j,onModelChange:M,onOpenAttachmentInSidebar:N,onOpenFileInSidebar:P,onOpenProfileSettings:F,onOpenSession:I,onOpenPonder:L,onProviderChange:R,onProviderSetupOpen:he,onPromptChange:ge,onProfileTargetChange:z,onScrollStateChange:_e,onProjectTargetChange:ve,onResolveApproval:ye,onShowBrowserPanel:B,onStop:V,onSubmit:H,onWorkspaceTargetChange:be}){let U=(0,_.useRef)(null),[W]=(0,_.useState)(()=>new m),G=(0,_.useRef)(l?.stickyToBottom??!0),K=(0,_.useRef)(!1);g(t,e.runtimeSource===`live`?e.sessionId:null,P);let q=ue(t,e.runtimeSource===`live`?e.sessionId:null),J=(0,_.useMemo)(()=>{if(e.runtimeSource===`history`||!e.sessionId)return e;let t=q.events,n=se(t,[]);return{...e,messages:s(W.project(t),e.pendingUserMessage),createImproveRun:o({events:t}),contextWindowStatus:a({provider:e.provider,snapshot:f(n,e.sessionId),preferences:i}),goalRuntime:ce(n,e.sessionId)}},[W,i,q,e]),Y=J.running&&!J.pendingApproval&&pe(J.messages),X=(0,_.useMemo)(()=>J.createImproveRun?{...r,run:J.createImproveRun}:null,[J.createImproveRun,r]),Z=(0,_.useMemo)(()=>h(J.messages,{showThinkingIndicator:Y}),[J.messages,Y]),xe=te(J.messages,J.sessionId??`draft:${J.id}`),Q=J.messages.at(-1),$=re({connection:d,latestTurnId:Q?.turnId??null,sessionId:J.sessionId,turnRunning:J.running}),Se=[J.id,J.sessionId??`draft`,Z.length,Q?.id??``,Q?.content?.length??0,Q?.timestamp??``,Y?`thinking`:``].join(`:`);(0,_.useLayoutEffect)(()=>{let e=U.current;e&&!K.current&&(K.current=!0,e.scrollTop=l?.stickyToBottom?e.scrollHeight:l?.scrollTop??0)},[l]),le({contentKey:Se,onContentChange:e=>{G.current&&(e.scrollTop=e.scrollHeight)},threadRef:U});let Ce=(0,_.useCallback)((e,t)=>{let n=J.sessionId??`side-chat:${J.id}`;ee({conversationId:n,href:e,explicitFile:t?.explicitFile,newTab:t?.newTab}).then(e=>{e&&B()})},[J.id,J.sessionId,B]),we=(0,_.useCallback)(async(e,t)=>{let n=t.action===`answer`?t.text:`Dismiss this question`;if(!await H([],null,null,{displayPrompt:n,promptOverride:n,turnMetadata:{userQuestionResolution:t}}))throw Error(`The question response could not be sent.`)},[H]);return(0,v.jsxs)(`section`,{"data-thread-session":J.sessionId??void 0,className:`right-chat-pane ${J.pendingApproval?`has-approval`:``}`,id:`right-chat-panel-${J.id}`,role:`tabpanel`,"aria-labelledby":`right-chat-tab-${J.id}`,children:[(0,v.jsx)(`div`,{className:`chat-thread right-chat-thread`,ref:U,onScroll:e=>{let t=e.currentTarget;G.current=t.scrollHeight-t.scrollTop-t.clientHeight<=72,_e({scrollTop:t.scrollTop,stickyToBottom:G.current})},children:Z.map(t=>(0,v.jsx)(ie,{row:t,renderMessage:t=>(0,v.jsx)(ne,{activeWorkspaceAppId:J.activeWorkspaceAppId,accountBaseUrl:w,billingOrganizationSlug:T,billingTeamId:E,connection:d,animateInitialContent:t.message.role===`assistant`&&xe.has(t.message.id),kvCacheSummary:t.showFooter&&t.message.turnId?$.get(t.message.turnId)??null:null,message:t.message,codexRecoveryEnabled:t.message.turnId===Q?.turnId,onOpenBrowserLink:Ce,onOpenAttachmentInSidebar:N,onOpenFileInSidebar:P,onOpenProfileSettings:F,onResolveUserQuestion:we,onOpenSession:I,onOpenPonder:L,userAttachmentDisplay:e.provider===`codex`?`compact`:`full`,workspaceRootPath:J.workspaceRootPath,showFooter:t.showFooter},t.id)},t.id))}),(0,v.jsxs)(`div`,{className:`composer-stack dock right-chat-composer ${J.pendingApproval?`has-approval`:``}`,children:[(0,v.jsx)(de,{connection:d,showToast:D,approval:J.pendingApproval,onResolve:ye}),(0,v.jsx)(fe,{mode:`dock`,prompt:e.prompt,mentionApps:me,connectedAppMentions:p,profileSkills:e.provider===`codex`?y:b,profileTarget:e.provider===`codex`?null:x,selectedMentionAppId:null,contextWindowStatus:J.contextWindowStatus,goalRuntime:J.goalRuntime,createImproveRuntime:X,busy:J.running,running:J.running,steerActiveResponses:c,taskSessionId:e.runtimeSource===`live`?e.sessionId:null,goalSessionId:e.sessionId,taskEvents:q.events,submissionScopeKey:J.sessionId??J.id,showProjectFooter:!1,connection:d,providerSettings:C,provider:e.provider,model:e.model,projectTarget:S,actionCatalog:n,workspaceTarget:O,codexPermissionMode:ae,codexReasoningEffort:oe,openPondCommandAccessMode:e.provider===`codex`?u:J.session?.openPondCommandAccessMode??u,onProviderChange:R,onProviderSetupOpen:he,onProjectTargetChange:ve,onWorkspaceTargetChange:be,onModelChange:M,onCodexPermissionModeChange:k,onCodexReasoningEffortChange:A,onOpenPondCommandAccessModeChange:j,onPromptChange:ge,onProfileTargetChange:z,onMentionAppSelect:void 0,showToast:D,onSubmit:H,onStop:V})]})]})}function y({panels:e,runtimeEventStore:t,actionCatalog:n=[],createImproveActions:a,contextCompaction:o,steerActiveResponses:s,busy:ee,codexPermissionMode:te,codexReasoningEffort:ne,openPondCommandAccessMode:re,connection:ie,connectedAppMentions:se,mentionApps:f,codexPersonalSkills:ce,profileSkills:le=[],profileLibrary:m={lastUsed:null,profiles:[]},extensionCatalog:h,projectTarget:g,providerSettings:ue,accountBaseUrl:de,billingOrganizationSlug:fe,billingTeamId:pe,showToast:y,workspaceTarget:b,onAddChat:x,onActivatePanel:S,onClosePanel:C,onCodexPermissionModeChange:w,onCodexReasoningEffortChange:T,onOpenPondCommandAccessModeChange:E,onModelChange:D,onOpenAttachmentInSidebar:O,onOpenFileInSidebar:k,onOpenProfileSettings:A,onOpenSession:j,onOpenPonder:M,onProviderChange:N,onProviderSetupOpen:P,onPromptChange:F,onProfileTargetChange:I,onScrollStateChange:L,onProjectTargetChange:R,onResolveApproval:he,onResizeStart:ge,onSelectFiles:z,onShowBrowserPanel:_e,onStop:ve,onSubmit:ye,onWorkspaceTargetChange:B}){let[V,H]=(0,_.useState)(!1),[be,U]=(0,_.useState)(()=>d(e)?.id??null),W=(0,_.useRef)(null),G=(0,_.useRef)(new Map),K=(0,_.useRef)(new Set(e.map(e=>e.id))),q=(0,_.useRef)(new Map(e.map(e=>[e.id,e.activationVersion]))),J=e.find(e=>e.id===be)??e.at(-1)??null,Y=J?.session?.currentProfile??m.lastUsed,X=p(m,Y),Z=X?u(X,h):le,xe=X?[...n.filter(e=>!r(e)),...i(X)]:n;(0,_.useEffect)(()=>{let t=K.current,n=q.current,r=null,i=null;for(let a of e)t.has(a.id)||(r=a),t.has(a.id)&&a.activationVersion>(n.get(a.id)??0)&&(i=a);K.current=new Set(e.map(e=>e.id)),q.current=new Map(e.map(e=>[e.id,e.activationVersion])),U(t=>i?i.id:r?r.id:t&&e.some(e=>e.id===t)?t:e.at(-1)?.id??null)},[e]),(0,_.useEffect)(()=>{if(!V)return;function e(e){W.current?.contains(e.target)||H(!1)}function t(e){e.key===`Escape`&&H(!1)}return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[V]);let Q=(0,_.useCallback)((e,t=!1)=>{U(e),S(e),t&&window.requestAnimationFrame(()=>G.current.get(e)?.focus())},[S]),$=(0,_.useCallback)((e=!1)=>{z(),e&&window.requestAnimationFrame(()=>{document.getElementById(`right-sidebar-files-tab`)?.focus()})},[z]),Se=(0,_.useCallback)((t,n)=>{let r=e.findIndex(e=>e.id===n);if(r<0)return;let i=r+1,a=null;if(t.key===`ArrowRight`&&(a=(i+1)%(e.length+1)),t.key===`ArrowLeft`&&(a=(i-1+e.length+1)%(e.length+1)),t.key===`Home`&&(a=0),t.key===`End`&&(a=e.length),a===null)return;if(t.preventDefault(),a===0){$(!0);return}let o=e[a-1];o&&Q(o.id,!0)},[e,$,Q]),Ce=(0,_.useCallback)(t=>{if(![`ArrowRight`,`ArrowLeft`,`Home`,`End`].includes(t.key)||(t.preventDefault(),t.key===`Home`))return;let n=t.key===`ArrowLeft`||t.key===`End`?e.at(-1):e[0];n&&Q(n.id,!0)},[e,Q]);return(0,v.jsxs)(`aside`,{className:`workspace-diff-panel right-chat-panel-stack`,"aria-label":`Side chats`,children:[(0,v.jsx)(`div`,{className:`workspace-diff-resize-handle`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize side chat panel`,onPointerDown:ge}),(0,v.jsx)(`div`,{className:`workspace-diff-topbar right-chat-topbar`,children:(0,v.jsxs)(`div`,{className:`workspace-diff-tabs`,role:`tablist`,"aria-label":`Right sidebar views`,children:[(0,v.jsxs)(`button`,{type:`button`,className:`workspace-diff-tab`,role:`tab`,id:`right-sidebar-files-tab`,"aria-controls":`right-sidebar-files-panel`,"aria-selected":!1,tabIndex:-1,onClick:()=>$(!1),onKeyDown:Ce,children:[(0,v.jsx)(c,{size:14}),(0,v.jsx)(`span`,{children:`Files`})]}),e.map(e=>{let t=e.id===J?.id;return(0,v.jsxs)(`div`,{className:`workspace-diff-tab right-chat-tab ${t?`active`:``}`,children:[(0,v.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":t,tabIndex:t?0:-1,title:e.title,ref:t=>{t?G.current.set(e.id,t):G.current.delete(e.id)},onClick:()=>Q(e.id),onKeyDown:t=>Se(t,e.id),children:[e.running?(0,v.jsx)(`span`,{className:`right-chat-status-dot`,"aria-label":`Running`}):null,(0,v.jsx)(`span`,{children:e.title})]}),(0,v.jsx)(`button`,{type:`button`,className:`workspace-diff-tab-close`,title:`Close ${e.title}`,"aria-label":`Close ${e.title}`,onClick:t=>{t.stopPropagation(),C(e.id)},children:(0,v.jsx)(oe,{size:12})})]},e.id)}),(0,v.jsxs)(`div`,{className:`workspace-diff-add-anchor`,ref:W,children:[(0,v.jsx)(`button`,{type:`button`,className:`workspace-diff-add-tab ${V?`active`:``}`,title:`Add to right sidebar`,"aria-label":`Add to right sidebar`,"aria-haspopup":`menu`,"aria-expanded":V,onClick:()=>H(e=>!e),children:(0,v.jsx)(ae,{size:15})}),V?(0,v.jsxs)(`div`,{className:`workspace-diff-add-menu right-chat-add-popover`,role:`menu`,children:[(0,v.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{H(!1),x()},children:[(0,v.jsx)(l,{size:13}),(0,v.jsx)(`span`,{children:`New task`})]}),(0,v.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{H(!1),z()},children:[(0,v.jsx)(c,{size:13}),(0,v.jsx)(`span`,{children:`Files`})]})]}):null]})]})}),(0,v.jsx)(`div`,{className:`right-chat-stack-body panes-1`,children:J?(0,v.jsx)(me,{busy:ee,createImproveActions:a,contextCompaction:o,steerActiveResponses:s,codexPermissionMode:te,codexReasoningEffort:ne,openPondCommandAccessMode:re,connection:ie,connectedAppMentions:se,actionCatalog:xe,mentionApps:f,codexPersonalSkills:ce,profileSkills:Z,profileTarget:null,panel:J,runtimeEventStore:t,initialScrollState:{scrollTop:J.scrollTop,stickyToBottom:J.stickyToBottom},projectTarget:g,providerSettings:ue,accountBaseUrl:de,billingOrganizationSlug:fe,billingTeamId:pe,showToast:y,workspaceTarget:b,onCodexPermissionModeChange:w,onCodexReasoningEffortChange:T,onOpenPondCommandAccessModeChange:e=>E(e,J.session),onModelChange:e=>D(J.id,e),onOpenAttachmentInSidebar:O,onOpenFileInSidebar:k,onOpenProfileSettings:A,onOpenSession:j,onOpenPonder:M,onProviderChange:(e,t)=>N(J.id,e,t),onProviderSetupOpen:P,onPromptChange:e=>F(J.id,e),onProfileTargetChange:e=>I(J.sessionId,e),onScrollStateChange:e=>L(J.id,e),onProjectTargetChange:R,onResolveApproval:he,onShowBrowserPanel:_e,onStop:()=>ve(J.sessionId),onSubmit:(e,t,n,r)=>ye(J.id,e,t,n,r),onWorkspaceTargetChange:B},J.id):null})]})}export{y as RightChatPanelStack};
@@ -0,0 +1 @@
1
+ export{yt as RightSidebarHomePanel}from"./MainPane-mWeD0M-f.js";
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-DiVhx1GM.js";import{n as r,o as i}from"./client-choice-storage-CQ0CNkzG.js";import{t as a}from"./requests-DmeUYik4.js";import{n as o,o as s,r as c}from"./ComposerAttachments-DPWCjKXz.js";import"./icons-4yRSxBZj.js";import{F as l,I as u,L as d,V as f}from"./training-model-data-B6IZ3x-t.js";import{t as p}from"./external-link-3ZnEFUXd.js";import{t as m}from"./loader-circle-DBl6qqtR.js";import{t as h}from"./maximize-2-CKY8dua6.js";import{t as g}from"./play-DIqZnaNf.js";import{t as _}from"./refresh-cw-00D-GDnF.js";import{t as v}from"./save-CXe7bqR7.js";import{t as y}from"./x-omjwMPbJ.js";import{r as b}from"./AppToastContext-DNWd43HS.js";import{Cn as x,Gt as S,Tn as C,Zt as w,rn as T,vn as E}from"./App-CXhxya9x.js";import{t as D}from"./useLocalAgentSchedules-DxTER7Ow.js";var O=e(t(),1),k=3e4;function A(e){let[t,n]=(0,O.useState)([]),[r,i]=(0,O.useState)([]),[a,o]=(0,O.useState)(null),[s,c]=(0,O.useState)(!1),[l,u]=(0,O.useState)(null),[d,f]=(0,O.useState)(()=>new Set);async function p(e,t){t&&c(!0);try{let t=await C.hostedSavedWork(e);n(t.definitions),i(t.runs),o(t.webBaseUrl??null),u(null)}catch(e){u(j(e))}finally{t&&c(!1)}}(0,O.useEffect)(()=>{if(!e){n([]),i([]),o(null),u(null),c(!1);return}let t=!1,r=async r=>{if(!t){r&&c(!0);try{let r=await C.hostedSavedWork(e);if(t)return;n(r.definitions),i(r.runs),o(r.webBaseUrl??null),u(null)}catch(e){t||u(j(e))}finally{!t&&r&&c(!1)}}};r(!0);let a=window.setInterval(()=>void r(!1),k);return()=>{t=!0,window.clearInterval(a)}},[e]);async function m(){e&&await p(e,!0)}async function h(t){e&&(await C.createHostedSavedWork(e,t),await p(e,!1))}async function g(e,t){await y(e,async n=>{await C.updateHostedSavedWork(n,e,t)})}async function _(e){await y(e,async t=>{await C.deleteHostedSavedWork(t,e)})}async function v(e){await y(e,async t=>{await C.runHostedSavedWork(t,e,crypto.randomUUID())})}async function y(t,n){if(e&&!d.has(t)){b(t,!0);try{await n(e),await p(e,!1)}catch(e){throw u(j(e)),e}finally{b(t,!1)}}}function b(e,t){f(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})}return{create:h,definitions:t,error:l,loading:s,pendingScheduleIds:d,refresh:m,remove:_,run:v,runs:r,update:g,webBaseUrl:a}}function j(e){return e instanceof Error?e.message:String(e)}var M=3e4;function ee(e){let[t,n]=(0,O.useState)([]),[r,i]=(0,O.useState)([]),[a,o]=(0,O.useState)(!1),[s,c]=(0,O.useState)(null),[l,u]=(0,O.useState)(()=>new Set),d=(0,O.useCallback)(async t=>{if(e){t&&o(!0);try{let t=await C.chatWorkflows(e);n(t.workflows),i(t.runs),c(null)}catch(e){c(e instanceof Error?e.message:String(e))}finally{t&&o(!1)}}},[e]);(0,O.useEffect)(()=>{if(!e){n([]),i([]),c(null),o(!1);return}d(!0);let t=window.setInterval(()=>void d(!1),M);return()=>window.clearInterval(t)},[e,d]);async function f(e,t){if(!l.has(e)){u(t=>new Set(t).add(e));try{await t(),await d(!1)}catch(e){throw c(e instanceof Error?e.message:String(e)),e}finally{u(t=>{let n=new Set(t);return n.delete(e),n})}}}return{workflows:t,runs:r,loading:a,error:s,pendingIds:l,refresh:()=>d(!0),update:(t,n)=>f(t,()=>C.updateChatWorkflow(e,t,n)),remove:t=>f(t,()=>C.deleteChatWorkflow(e,t)),run:t=>f(t,()=>C.runChatWorkflow(e,t))}}var N=`openpond.scheduled-work.view.v1`;function te(e=F()){try{return e?.getItem(N)===`list`?`list`:`calendar`}catch{return`calendar`}}function P(e,t=F()){try{t?.setItem(N,e)}catch{}}function F(){if(typeof window>`u`)return null;try{return r}catch{return null}}function I(e,t){if(!e)return`None`;let n=new Date(e);if(!Number.isFinite(n.getTime()))return`None`;try{return n.toLocaleString(void 0,{month:`short`,day:`numeric`,year:`numeric`,hour:`numeric`,minute:`2-digit`,...t?{timeZone:t,timeZoneName:`short`}:{}})}catch{return n.toLocaleString()}}function L(e){return R(e.replaceAll(`_`,` `))}function R(e){return e.replace(/^./,e=>e.toUpperCase())}function z(e){let[t=`0`,n=`00`]=e.split(`:`);return new Date(2020,0,1,Number(t),Number(n)).toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`})}var B=n();function V({run:e}){let t=e.error||e.stderr||e.stdout;return(0,B.jsxs)(`details`,{className:`scheduled-run-row`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:L(e.status)}),(0,B.jsx)(`small`,{children:I(e.createdAt,null)})]}),(0,B.jsx)(`span`,{className:`scheduled-run-trigger`,children:e.trigger===`manual`?`Manual`:`Scheduled`})]}),t?(0,B.jsx)(`pre`,{children:t}):null]})}function H({onOpen:e,run:t}){return(0,B.jsxs)(`button`,{className:`scheduled-run-row hosted`,onClick:e,type:`button`,children:[(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:L(t.status)}),(0,B.jsx)(`small`,{children:I(t.createdAt,null)})]}),(0,B.jsxs)(`span`,{className:`scheduled-run-trigger`,children:[R(t.triggerKind),` `,(0,B.jsx)(p,{size:11})]}),t.deliveryError?(0,B.jsx)(`p`,{children:t.deliveryError}):null]})}function U({children:e,detailExpanded:t,kind:n=`schedule`,label:r,onClose:i,onDetailResizeStart:a,onToggleDetailExpanded:o}){return(0,B.jsxs)(`aside`,{"aria-label":r,className:`workspace-diff-panel scheduled-detail${t?` expanded`:``}`,children:[t?null:(0,B.jsx)(`div`,{"aria-label":`Resize schedule details`,"aria-orientation":`vertical`,className:`workspace-diff-resize-handle`,onPointerDown:a,role:`separator`}),(0,B.jsxs)(`div`,{className:`workspace-diff-topbar`,children:[(0,B.jsx)(`div`,{className:`workspace-diff-tabs`,role:`tablist`,"aria-label":`${n===`workflow`?`Workflow`:`Schedule`} details`,children:(0,B.jsxs)(`button`,{"aria-selected":`true`,className:`workspace-diff-tab active`,role:`tab`,type:`button`,children:[(0,B.jsx)(E,{size:14}),(0,B.jsx)(`span`,{children:n===`workflow`?`Workflow`:`Schedule`})]})}),(0,B.jsxs)(`div`,{className:`workspace-diff-toolbar-actions`,children:[(0,B.jsx)(`button`,{"aria-label":t?`Dock ${n} details`:`Expand ${n} details`,className:`diff-icon-button`,onClick:o,title:t?`Dock ${n} details`:`Expand ${n} details`,type:`button`,children:t?(0,B.jsx)(d,{size:14}):(0,B.jsx)(h,{size:14})}),(0,B.jsx)(`button`,{"aria-label":`Close ${n} details`,className:`diff-icon-button`,onClick:i,title:`Close ${n} details`,type:`button`,children:(0,B.jsx)(y,{size:14})})]})]}),(0,B.jsx)(`div`,{className:`scheduled-detail-body`,children:e})]})}function W({children:e,title:t}){return(0,B.jsxs)(`section`,{className:`scheduled-detail-section`,children:[(0,B.jsx)(`div`,{className:`scheduled-detail-section-heading`,children:(0,B.jsx)(`h3`,{children:t})}),e]})}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 K({children:e}){return(0,B.jsx)(`p`,{className:`scheduled-empty`,children:e})}function ne({label:e}){return(0,B.jsxs)(`div`,{className:`scheduled-loading`,role:`status`,children:[(0,B.jsx)(m,{className:`scheduled-spin`,size:16}),(0,B.jsx)(`span`,{children:e})]})}var q=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`];function re({items:e,onSelect:t,selectedKey:n}){let[r,i]=(0,O.useState)(()=>se(new Date)),a=(0,O.useMemo)(()=>J(r),[r]),o=(0,O.useMemo)(()=>ie(e),[e]),s=new Intl.DateTimeFormat(void 0,{month:`long`,year:`numeric`}).format(r),c=e.filter(e=>!ae(e.nextRunAt));return(0,B.jsxs)(`div`,{className:`scheduled-calendar`,children:[(0,B.jsxs)(`div`,{className:`scheduled-calendar-toolbar`,children:[(0,B.jsx)(`strong`,{children:s}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`button`,{"aria-label":`Previous month`,className:`scheduled-icon-button`,onClick:()=>i(ce(r,-1)),type:`button`,children:(0,B.jsx)(x,{size:15})}),(0,B.jsx)(`button`,{className:`scheduled-calendar-today`,onClick:()=>i(se(new Date)),type:`button`,children:`Today`}),(0,B.jsx)(`button`,{"aria-label":`Next month`,className:`scheduled-icon-button`,onClick:()=>i(ce(r,1)),type:`button`,children:(0,B.jsx)(f,{size:15})})]})]}),(0,B.jsxs)(`div`,{className:`scheduled-calendar-grid`,role:`grid`,"aria-label":s,children:[q.map(e=>(0,B.jsx)(`div`,{className:`scheduled-calendar-weekday`,role:`columnheader`,children:e},e)),a.map(e=>{let i=oe(e),a=o.get(i)??[],s=e.getMonth()!==r.getMonth(),c=i===oe(new Date);return(0,B.jsxs)(`div`,{className:`scheduled-calendar-day${s?` outside`:``}${c?` today`:``}`,role:`gridcell`,children:[(0,B.jsx)(`span`,{className:`scheduled-calendar-day-number`,children:e.getDate()}),(0,B.jsx)(`div`,{className:`scheduled-calendar-events`,children:a.map(e=>(0,B.jsxs)(`button`,{"aria-current":n===e.key?`true`:void 0,className:`scheduled-calendar-event${e.enabled?``:` paused`}`,onClick:()=>t(e.key),title:e.title,type:`button`,children:[(0,B.jsx)(`span`,{children:le(e.nextRunAt)}),(0,B.jsx)(`strong`,{children:e.title})]},e.key))})]},i)})]}),c.length?(0,B.jsxs)(`div`,{className:`scheduled-calendar-unscheduled`,children:[(0,B.jsx)(`span`,{children:`No upcoming run`}),(0,B.jsx)(`div`,{children:c.map(e=>(0,B.jsx)(`button`,{onClick:()=>t(e.key),type:`button`,children:e.title},e.key))})]}):null]})}function J(e){let t=new Date(e.getFullYear(),e.getMonth(),1),n=new Date(t);return n.setDate(t.getDate()-t.getDay()),Array.from({length:42},(e,t)=>{let r=new Date(n);return r.setDate(n.getDate()+t),r})}function ie(e){let t=new Map;for(let n of e){let e=ae(n.nextRunAt);if(!e)continue;let r=oe(e);t.set(r,[...t.get(r)??[],n])}for(let e of t.values())e.sort((e,t)=>e.nextRunAt.localeCompare(t.nextRunAt));return t}function ae(e){if(!e)return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t}function oe(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function se(e){return new Date(e.getFullYear(),e.getMonth(),1)}function ce(e,t){return new Date(e.getFullYear(),e.getMonth()+t,1)}function le(e){return new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(new Date(e))}function ue({entry:e,onSelect:t,selected:n}){return(0,B.jsxs)(`button`,{"aria-current":n?`true`:void 0,className:`scheduled-list-row`,onClick:t,type:`button`,children:[(0,B.jsx)(`span`,{className:`scheduled-status-dot`}),(0,B.jsxs)(`span`,{className:`scheduled-list-copy`,children:[(0,B.jsx)(`span`,{className:`scheduled-list-title`,children:(0,B.jsx)(`strong`,{children:e.workflow.label})}),(0,B.jsx)(`span`,{children:e.workflow.description}),(0,B.jsxs)(`small`,{children:[`On demand · Source `,e.binding.sourceRevision.slice(0,10)]})]})]})}function de({cadence:e,onSelect:t,schedule:n,selected:r}){return(0,B.jsxs)(`button`,{"aria-current":r?`true`:void 0,className:`scheduled-list-row`,onClick:t,type:`button`,children:[(0,B.jsx)(`span`,{className:`scheduled-status-dot ${n.enabled?`active`:`paused`}`}),(0,B.jsxs)(`span`,{className:`scheduled-list-copy`,children:[(0,B.jsx)(`span`,{className:`scheduled-list-title`,children:(0,B.jsx)(`strong`,{children:n.scheduleName})}),(0,B.jsx)(`span`,{children:n.localProjectName}),(0,B.jsxs)(`small`,{children:[e,n.nextRunAt?` · Next ${I(n.nextRunAt,n.timezone)}`:` · No next run`]})]})]})}function fe({cadence:e,definition:t,onSelect:n,schedule:r,selected:i}){return(0,B.jsxs)(`button`,{"aria-current":i?`true`:void 0,className:`scheduled-list-row`,onClick:n,type:`button`,children:[(0,B.jsx)(`span`,{className:`scheduled-status-dot ${r.enabled?`active`:`paused`}`}),(0,B.jsxs)(`span`,{className:`scheduled-list-copy`,children:[(0,B.jsxs)(`span`,{className:`scheduled-list-title`,children:[(0,B.jsx)(`strong`,{children:t.name}),(0,B.jsx)(`small`,{className:`scheduled-environment-badge hosted`,children:`Hosted`})]}),(0,B.jsx)(`span`,{children:t.prompt}),(0,B.jsxs)(`small`,{children:[e,r.nextRunAt?` · Next ${I(r.nextRunAt,r.timeZone)}`:` · No next run`]})]})]})}function pe({cadence:e,onSelect:t,selected:n,workflow:r}){return(0,B.jsxs)(`button`,{"aria-current":n?`true`:void 0,className:`scheduled-list-row`,onClick:t,type:`button`,children:[(0,B.jsx)(`span`,{className:`scheduled-status-dot ${r.enabled?`active`:`paused`}`}),(0,B.jsxs)(`span`,{className:`scheduled-list-copy`,children:[(0,B.jsxs)(`span`,{className:`scheduled-list-title`,children:[(0,B.jsx)(`strong`,{children:r.name}),(0,B.jsx)(`small`,{className:`scheduled-environment-badge`,children:`Chat`})]}),(0,B.jsx)(`span`,{children:r.prompt}),(0,B.jsxs)(`small`,{children:[`Runs in `,r.sessionTitle,` · `,e,r.nextRunAt?` · Next ${I(r.nextRunAt,r.recurrence.timeZone)}`:` · No next run`]})]})]})}function me(e,t){return e.filter(e=>t===`active`?e.enabled:t!==`paused`||!e.enabled).sort((e,t)=>(e.nextRunAt?new Date(e.nextRunAt).getTime():1/0)-(t.nextRunAt?new Date(t.nextRunAt).getTime():1/0)||e.name.localeCompare(t.name))}function he(e){let t=z(e.localTime);return e.kind===`once`?`Once on ${e.startDate} at ${t} · ${e.timeZone}`:e.kind===`weekdays`?`Weekdays at ${t} · ${e.timeZone}`:e.kind===`weekly`?`${e.weekdays?.map(R).join(`, `)??`Weekly`} at ${t} · ${e.timeZone}`:e.kind===`monthly`?`Monthly on day ${e.dayOfMonth??1} at ${t} · ${e.timeZone}`:`Daily at ${t} · ${e.timeZone}`}function ge({detailExpanded:e,onClose:t,onDelete:n,onDetailResizeStart:r,onRun:i,onToggle:a,onToggleDetailExpanded:o,pending:s,runs:c,workflow:d}){return(0,B.jsxs)(U,{detailExpanded:e,label:`${d.name} details`,onClose:t,onDetailResizeStart:r,onToggleDetailExpanded:o,children:[(0,B.jsx)(`div`,{className:`scheduled-detail-header`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`scheduled-detail-title-row`,children:[(0,B.jsx)(`h2`,{children:`Workflow details`}),(0,B.jsx)(`span`,{children:d.enabled?`Active`:`Paused`})]}),(0,B.jsx)(`p`,{children:d.name})]})}),(0,B.jsx)(W,{title:`Prompt`,children:(0,B.jsx)(`pre`,{className:`scheduled-prompt`,children:d.prompt})}),(0,B.jsx)(W,{title:`Profile source`,children:d.profileRef&&d.profileWorkflowId?(0,B.jsxs)(`p`,{children:[d.profileRef.profileId,` · workflows/`,d.profileWorkflowId,`/PROMPT.md`]}):(0,B.jsx)(`p`,{className:`scheduled-detail-error`,children:d.profileMigrationError??`Profile package is unresolved.`})}),(0,B.jsxs)(W,{title:`Delivery`,children:[(0,B.jsxs)(`dl`,{className:`scheduled-detail-fields`,children:[(0,B.jsx)(G,{label:`Runs in`,value:d.sessionTitle}),(0,B.jsx)(G,{label:`Cadence`,value:he(d.recurrence)}),(0,B.jsx)(G,{label:`Next run`,value:I(d.nextRunAt,d.recurrence.timeZone)}),(0,B.jsx)(G,{label:`Last run`,value:I(d.lastRunAt,d.recurrence.timeZone)})]}),d.lastError?(0,B.jsx)(`p`,{className:`scheduled-detail-error`,children:d.lastError}):null]}),(0,B.jsxs)(`div`,{className:`scheduled-detail-actions`,children:[(0,B.jsxs)(`button`,{disabled:s,onClick:()=>void i(),type:`button`,children:[(0,B.jsx)(w,{size:15}),(0,B.jsx)(`span`,{children:`Run now`})]}),(0,B.jsxs)(`button`,{disabled:s,onClick:()=>void a(),type:`button`,children:[d.enabled?(0,B.jsx)(u,{size:15}):(0,B.jsx)(g,{size:15}),(0,B.jsx)(`span`,{children:d.enabled?`Pause`:`Resume`})]}),(0,B.jsxs)(`button`,{disabled:s,onClick:()=>void n(),type:`button`,children:[(0,B.jsx)(l,{size:15}),(0,B.jsx)(`span`,{children:`Delete`})]})]}),(0,B.jsx)(W,{title:`Runs`,children:c.length===0?(0,B.jsx)(`p`,{className:`scheduled-no-runs`,children:`No runs yet.`}):(0,B.jsx)(`div`,{className:`scheduled-run-list`,children:c.map(e=>(0,B.jsxs)(`div`,{className:`scheduled-run-row`,children:[(0,B.jsx)(`span`,{children:R(e.status)}),(0,B.jsx)(`small`,{children:I(e.createdAt,d.recurrence.timeZone)}),e.error?(0,B.jsx)(`p`,{children:e.error}):null]},e.id))})})]})}async function _e(e){let t=e.catalog.workflows.find(t=>t.workflow.id===e.workflowId);if(!t)throw Error(`Selected Profile workflow is unavailable.`);let n=e.client??C,r=await n.createSession(e.connection,{experience:`work`,provider:`openpond`,...e.workspaceTarget===`local`?{metadata:{workspaceTarget:`local`}}:{},currentProfile:e.catalog.profileRef,profileWorkflowBinding:t.binding,title:t.workflow.label});return e.onSessionCreated?.(r.id),await n.sendTurn(e.connection,r.id,{prompt:e.prompt?.trim()||t.workflow.label,workflowInput:e.value,...e.attachments?.length?{attachments:e.attachments}:{},approvalPolicy:`on-request`,sandbox:`workspace-write`,codexPermissionMode:`default`}),r.id}function ve({catalog:e,connection:t,detailExpanded:n,entry:r,onClose:i,onDetailResizeStart:l,onOpenSession:u,onToggleDetailExpanded:d}){let[f,p]=(0,O.useState)(``),[m,h]=(0,O.useState)([]),[g,_]=(0,O.useState)(`{}`),[v,y]=(0,O.useState)(e.profileRef.source===`local`?`local`:`hosted`),[b,x]=(0,O.useState)(!1),[C,T]=(0,O.useState)(null),E=r.workflow;async function D(n){if(n.preventDefault(),!b){x(!0),T(null);try{let n=JSON.parse(g);if(m.length>a.maxAttachments)throw Error(`Choose at most ${a.maxAttachments} files.`);let r=await Promise.all(m.map(async e=>{if(e.size>a.maxAttachmentBytes)throw Error(`${e.name} exceeds the attachment size limit.`);return s({id:c(),file:e,name:e.name,mediaType:e.type||`application/octet-stream`,sizeBytes:e.size,kind:o(e)})}));await _e({connection:t,catalog:e,workflowId:E.id,value:n,prompt:f,attachments:r,workspaceTarget:v,onSessionCreated:u})}catch(e){T(e instanceof Error?e.message:String(e))}finally{x(!1)}}}return(0,B.jsxs)(U,{detailExpanded:n,kind:`workflow`,label:`${E.label} details`,onClose:i,onDetailResizeStart:l,onToggleDetailExpanded:d,children:[(0,B.jsx)(`div`,{className:`scheduled-detail-header`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`scheduled-detail-title-row`,children:(0,B.jsx)(`h2`,{children:`Workflow details`})}),(0,B.jsx)(`p`,{children:E.label})]})}),(0,B.jsx)(W,{title:`Description`,children:(0,B.jsx)(`p`,{children:E.description})}),(0,B.jsxs)(W,{title:`Source`,children:[(0,B.jsxs)(`p`,{children:[`workflows/`,E.id,`/`,E.invocation.kind===`instructions`?`PROMPT.md`:`ACTION.json`]}),(0,B.jsxs)(`p`,{children:[`Revision `,r.binding.sourceRevision.slice(0,12),` · Release `,r.binding.harnessRelease.contentHash.slice(0,12)]})]}),E.skillPaths.length>0?(0,B.jsx)(W,{title:`Skills`,children:(0,B.jsx)(`p`,{children:E.skillPaths.join(`, `)})}):null,E.invocation.kind===`instructions`?(0,B.jsx)(W,{title:`Instructions`,children:(0,B.jsx)(`pre`,{className:`scheduled-prompt`,children:E.invocation.instructions})}):null,(0,B.jsx)(W,{title:`Start a run`,children:(0,B.jsxs)(`form`,{className:`scheduled-profile-workflow-form`,onSubmit:e=>void D(e),children:[(0,B.jsx)(`label`,{htmlFor:`scheduled-profile-workflow-prompt`,children:`Instructions for this run`}),(0,B.jsx)(`textarea`,{id:`scheduled-profile-workflow-prompt`,onChange:e=>p(e.target.value),value:f}),(0,B.jsx)(`label`,{htmlFor:`scheduled-profile-workflow-files`,children:`Files for this run`}),(0,B.jsx)(`input`,{id:`scheduled-profile-workflow-files`,type:`file`,multiple:!0,onChange:e=>h(Array.from(e.target.files??[]))}),m.length>0?(0,B.jsx)(`small`,{children:m.map(e=>e.name).join(`, `)}):null,(0,B.jsx)(`label`,{htmlFor:`scheduled-profile-workflow-target`,children:`Run in`}),(0,B.jsxs)(`select`,{id:`scheduled-profile-workflow-target`,value:v,onChange:e=>y(e.target.value),children:[(0,B.jsx)(`option`,{value:`local`,children:`Desktop local workspace`}),(0,B.jsx)(`option`,{value:`hosted`,children:`Hosted Work`})]}),E.invocation.kind===`agent_action`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`label`,{htmlFor:`scheduled-profile-workflow-input`,children:`Input JSON`}),(0,B.jsx)(`textarea`,{id:`scheduled-profile-workflow-input`,onChange:e=>_(e.target.value),value:g})]}):null,C?(0,B.jsx)(S,{error:C}):null,(0,B.jsx)(`div`,{className:`scheduled-detail-actions`,children:(0,B.jsxs)(`button`,{disabled:b,type:`submit`,children:[(0,B.jsx)(w,{size:15}),(0,B.jsx)(`span`,{children:b?`Starting…`:`Run now`})]})})]})})]})}function ye(e){return e.flatMap(e=>e.schedules.map(t=>({definition:e,schedule:t})))}function be(e,t){return e.filter(e=>t===`active`?e.schedule.enabled:t!==`paused`||!e.schedule.enabled).sort((e,t)=>$(e.schedule.nextRunAt)-$(t.schedule.nextRunAt)||e.definition.name.localeCompare(t.definition.name))}function xe(e,t){return e.filter(e=>t===`active`?e.enabled:t!==`paused`||!e.enabled).sort((e,t)=>$(e.nextRunAt)-$(t.nextRunAt)||e.scheduleName.localeCompare(t.scheduleName))}function Se(e,t,n){return[...e.map(e=>({kind:`chat`,workflow:e})),...t.map(e=>({kind:`local`,schedule:e})),...n.map(e=>({kind:`hosted`,row:e}))].sort((e,t)=>{let n=$(Te(e)),r=$(Te(t));if(n!==r)return n-r;let i=Ee(e),a=Ee(t);return i.localeCompare(a)})}function Ce(e){return e.kind===`chat`?{enabled:e.workflow.enabled,key:X(e.workflow.id),nextRunAt:e.workflow.nextRunAt,title:e.workflow.name}:e.kind===`local`?{enabled:e.schedule.enabled,key:Y(e.schedule.id),nextRunAt:e.schedule.nextRunAt,title:e.schedule.scheduleName}:{enabled:e.row.schedule.enabled,key:Q(e.row.schedule.id),nextRunAt:e.row.schedule.nextRunAt,title:e.row.definition.name}}function we(e){let t=e.recurrence;return t?he(t):e.expression??`Manual`}function Te(e){return e.kind===`chat`?e.workflow.nextRunAt:e.kind===`local`?e.schedule.nextRunAt:e.row.schedule.nextRunAt}function Ee(e){return e.kind===`chat`?e.workflow.name:e.kind===`local`?e.schedule.scheduleName:e.row.definition.name}function De(e){let t=e.timezone?` · ${e.timezone}`:``;if(e.scheduleType===`rate`)return`Every ${e.scheduleExpression}${t}`;let n=e.scheduleExpression.trim().split(/\s+/);if(n.length===5&&/^\d+$/.test(n[0])&&/^\d+$/.test(n[1])){let e=z(`${n[1].padStart(2,`0`)}:${n[0].padStart(2,`0`)}`);if(n[2]===`*`&&n[3]===`*`&&n[4]===`*`)return`Daily at ${e}${t}`;if(n[2]===`*`&&n[3]===`*`&&n[4]===`MON-FRI`)return`Weekdays at ${e}${t}`}return`Cron ${e.scheduleExpression}${t}`}function Y(e){return`local:${e}`}function X(e){return`chat:${e}`}function Z(e){return`profile:${e}`}function Q(e){return`hosted:${e}`}function $(e){if(!e)return 2**53-1;let t=new Date(e).getTime();return Number.isFinite(t)?t:2**53-1}var Oe=[`sunday`,`monday`,`tuesday`,`wednesday`,`thursday`,`friday`,`saturday`];function ke({connection:e,selectedProfileKey:t,onOpenSession:n,detailOpen:r,detailExpanded:a,onDetailOpenChange:o,onDetailResizeStart:s,onToggleDetailExpanded:c}){let l=A(e),u=ee(e),d=D(e),[f,p]=(0,O.useState)(null),[m,h]=(0,O.useState)(!1),[g,v]=(0,O.useState)(null),[y,x]=(0,O.useState)(`all`),[S,w]=(0,O.useState)(te);i(()=>w(te()));let[E,k]=(0,O.useState)(!1),[j,M]=(0,O.useState)(null),N=(0,O.useMemo)(()=>ye(l.definitions),[l.definitions]),F=(0,O.useMemo)(()=>be(N,y),[y,N]),I=(0,O.useMemo)(()=>xe(d.schedules,y),[y,d.schedules]),L=(0,O.useMemo)(()=>me(u.workflows,y),[u.workflows,y]),R=N.find(e=>Q(e.schedule.id)===j)??null,z=d.schedules.find(e=>Y(e.id)===j)??null,V=u.workflows.find(e=>X(e.id)===j)??null,H=f?.workflows.find(e=>Z(e.workflow.id)===j)??null,U=R?l.runs.filter(e=>e.scheduleId===R.schedule.id):[],W=(0,O.useMemo)(()=>Se(L,I,F),[L,I,F]),G=(0,O.useMemo)(()=>[...W.map(Ce),...f?.workflows.map(e=>({enabled:!0,key:Z(e.workflow.id),nextRunAt:null,title:e.workflow.label}))??[]],[W,f]);b(l.error,{prefix:`Workflows`}),b(d.error,{prefix:`Local schedules`}),b(u.error,{prefix:`Chat workflows`}),b(g,{prefix:`Profile workflows`}),(0,O.useEffect)(()=>{if(!e||!t){p(null),v(null);return}let n=!0;return h(!0),C.profileWorkflows(e).then(e=>{n&&(p(e),v(null))}).catch(e=>{n&&v(e instanceof Error?e.message:String(e))}).finally(()=>{n&&h(!1)}),()=>{n=!1}},[e,t]),(0,O.useEffect)(()=>{j&&!R&&!z&&!V&&!H&&!m&&M(null)},[m,V,R,z,H,j]),(0,O.useEffect)(()=>{!r&&j&&M(null)},[r,j]),(0,O.useEffect)(()=>()=>o(!1),[o]);function q(e){M(e),o(!0)}function J(){M(null),o(!1)}function ie(e){w(e),P(e)}async function ae(){k(!0);try{await Promise.all([l.refresh(),d.refresh(),u.refresh(),e&&t?C.profileWorkflows(e).then(p):Promise.resolve()])}finally{k(!1)}}return(0,B.jsxs)(`section`,{"aria-label":`Workflows`,className:`scheduled-work-view${R||z||V||H?` detail-open`:``}${a?` detail-expanded`:``}`,children:[(0,B.jsx)(`div`,{className:`scheduled-work-scroll`,children:(0,B.jsxs)(`div`,{className:`scheduled-work-content`,children:[(0,B.jsxs)(`header`,{className:`scheduled-work-header`,children:[(0,B.jsxs)(`div`,{"aria-label":`Workflow view`,className:`scheduled-view-tabs`,role:`tablist`,children:[(0,B.jsx)(`button`,{"aria-selected":S===`calendar`,className:S===`calendar`?`active`:void 0,onClick:()=>ie(`calendar`),role:`tab`,type:`button`,children:`Calendar`}),(0,B.jsx)(`button`,{"aria-selected":S===`list`,className:S===`list`?`active`:void 0,onClick:()=>ie(`list`),role:`tab`,type:`button`,children:`List`})]}),(0,B.jsxs)(`div`,{className:`scheduled-work-header-actions`,children:[(0,B.jsx)(`button`,{"aria-label":`Refresh schedules`,className:`scheduled-icon-button`,disabled:!e||l.loading||d.loading||u.loading||m,onClick:()=>void ae(),title:`Refresh schedules`,type:`button`,children:(0,B.jsx)(_,{className:E?`scheduled-spin`:void 0,size:16})}),(0,B.jsxs)(`label`,{className:`scheduled-filter`,children:[(0,B.jsx)(T,{"aria-hidden":`true`,size:16}),(0,B.jsxs)(`select`,{"aria-label":`Schedule filter`,onChange:e=>x(e.target.value),value:y,children:[(0,B.jsx)(`option`,{value:`active`,children:`Active`}),(0,B.jsx)(`option`,{value:`paused`,children:`Paused`}),(0,B.jsx)(`option`,{value:`all`,children:`All`})]})]})]})]}),(0,B.jsx)(`section`,{"aria-busy":l.loading||d.loading||u.loading||m,className:`scheduled-list`,children:e?(l.loading||d.loading||u.loading||m)&&N.length===0&&d.schedules.length===0&&u.workflows.length===0&&!f?.workflows.length?(0,B.jsx)(ne,{label:`Loading schedules`}):l.error&&d.error&&N.length===0&&d.schedules.length===0?(0,B.jsx)(K,{children:`Schedules are unavailable. Refresh to try again.`}):W.length===0&&!f?.workflows.length?(0,B.jsx)(K,{children:`Create a scheduled task here or ask for one in Work.`}):S===`calendar`?(0,B.jsx)(re,{items:G,onSelect:q,selectedKey:j}):(0,B.jsxs)(`div`,{className:`scheduled-list-rows`,children:[f?.workflows.map(e=>(0,B.jsx)(ue,{entry:e,onSelect:()=>q(Z(e.workflow.id)),selected:j===Z(e.workflow.id)},Z(e.workflow.id))),W.map(e=>e.kind===`chat`?(0,B.jsx)(pe,{cadence:he(e.workflow.recurrence),onSelect:()=>q(X(e.workflow.id)),selected:j===X(e.workflow.id),workflow:e.workflow},X(e.workflow.id)):e.kind===`local`?(0,B.jsx)(de,{cadence:De(e.schedule),onSelect:()=>q(Y(e.schedule.id)),schedule:e.schedule,selected:j===Y(e.schedule.id)},Y(e.schedule.id)):(0,B.jsx)(fe,{cadence:we(e.row.schedule),definition:e.row.definition,onSelect:()=>q(Q(e.row.schedule.id)),schedule:e.row.schedule,selected:j===Q(e.row.schedule.id)},Q(e.row.schedule.id)))]}):(0,B.jsx)(K,{children:`Connect to OpenPond to view scheduled Work.`})})]})}),H&&f&&e?(0,B.jsx)(ve,{catalog:f,connection:e,detailExpanded:a,entry:H,onClose:J,onDetailResizeStart:s,onOpenSession:n,onToggleDetailExpanded:c},H.workflow.id):R?(0,B.jsx)(je,{onClose:J,onDelete:async()=>{await l.remove(R.schedule.id),J()},onRun:()=>l.run(R.schedule.id),onSave:e=>l.update(R.schedule.id,e),onToggle:()=>l.update(R.schedule.id,{enabled:!R.schedule.enabled}),pending:l.pendingScheduleIds.has(R.schedule.id),row:R,runs:U,detailExpanded:a,onDetailResizeStart:s,onToggleDetailExpanded:c,webBaseUrl:l.webBaseUrl},`${R.schedule.id}:${R.definition.version}:${R.schedule.configurationVersion}`):V?(0,B.jsx)(ge,{detailExpanded:a,onClose:J,onDelete:async()=>{await u.remove(V.id),J()},onDetailResizeStart:s,onRun:()=>u.run(V.id),onToggle:()=>u.update(V.id,{enabled:!V.enabled}),onToggleDetailExpanded:c,pending:u.pendingIds.has(V.id),runs:u.runs.filter(e=>e.workflowId===V.id),workflow:V},V.id):z?(0,B.jsx)(Ae,{connection:e,onClose:J,onRun:()=>d.run(z),onToggle:()=>d.toggle(z),pending:d.pendingScheduleIds.has(z.id),schedule:z,detailExpanded:a,onDetailResizeStart:s,onToggleDetailExpanded:c},z.id):null]})}function Ae({connection:e,detailExpanded:t,onClose:n,onDetailResizeStart:r,onRun:i,onToggleDetailExpanded:a,onToggle:o,pending:s,schedule:c}){let l=Pe(e,c.id);return b(l.error,{prefix:`Local schedule runs`}),(0,B.jsxs)(U,{detailExpanded:t,label:`${c.scheduleName} details`,onClose:n,onDetailResizeStart:r,onToggleDetailExpanded:a,children:[(0,B.jsx)(`div`,{className:`scheduled-detail-header`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`scheduled-detail-title-row`,children:[(0,B.jsx)(`h2`,{children:`Schedule details`}),(0,B.jsx)(`span`,{children:c.enabled?`Active`:`Paused`})]}),(0,B.jsx)(`p`,{children:c.scheduleName})]})}),(0,B.jsxs)(W,{title:`Task`,children:[(0,B.jsxs)(`dl`,{className:`scheduled-detail-fields`,children:[(0,B.jsx)(G,{label:`Environment`,value:`Local`}),(0,B.jsx)(G,{label:`Project`,value:c.localProjectName}),(0,B.jsx)(G,{label:`Agent`,value:c.agentName}),(0,B.jsx)(G,{label:`Action`,value:c.targetAction})]}),(0,B.jsx)(`pre`,{className:`scheduled-prompt`,children:Ne(c)})]}),(0,B.jsxs)(W,{title:`Schedule`,children:[(0,B.jsxs)(`dl`,{className:`scheduled-detail-fields`,children:[(0,B.jsx)(G,{label:`Cadence`,value:De(c)}),(0,B.jsx)(G,{label:`Expression`,value:c.scheduleExpression}),(0,B.jsx)(G,{label:`Timezone`,value:c.timezone??`Local time`}),(0,B.jsx)(G,{label:`Next run`,value:I(c.nextRunAt,c.timezone)}),(0,B.jsx)(G,{label:`Last run`,value:I(c.lastRunAt,c.timezone)})]}),c.lastError?(0,B.jsx)(`p`,{className:`scheduled-detail-error`,children:c.lastError}):null]}),(0,B.jsxs)(`div`,{className:`scheduled-detail-actions`,children:[(0,B.jsxs)(`button`,{disabled:s,onClick:()=>void i(),type:`button`,children:[(0,B.jsx)(w,{size:15}),(0,B.jsx)(`span`,{children:`Run now`})]}),(0,B.jsxs)(`button`,{disabled:s,onClick:()=>void o(),type:`button`,children:[c.enabled?(0,B.jsx)(u,{size:15}):(0,B.jsx)(g,{size:15}),(0,B.jsx)(`span`,{children:c.enabled?`Pause`:`Resume`})]})]}),(0,B.jsx)(W,{title:`Runs`,children:l.loading&&l.runs.length===0?(0,B.jsx)(ne,{label:`Loading runs`}):l.runs.length===0?(0,B.jsx)(`p`,{className:`scheduled-no-runs`,children:`No runs yet.`}):(0,B.jsx)(`div`,{className:`scheduled-run-list`,children:l.runs.map(e=>(0,B.jsx)(V,{run:e},e.id))})})]})}function je({detailExpanded:e,onClose:t,onDelete:n,onDetailResizeStart:r,onRun:i,onSave:a,onToggleDetailExpanded:o,onToggle:s,pending:c,row:d,runs:f,webBaseUrl:m}){let h=Me(d.schedule),[_,y]=(0,O.useState)(d.definition.name),[b,x]=(0,O.useState)(d.definition.prompt),[S,C]=(0,O.useState)(h.kind),[T,E]=(0,O.useState)(h.timeZone),[D,k]=(0,O.useState)(h.startDate),[A,j]=(0,O.useState)(h.localTime),[M,ee]=(0,O.useState)(h.weekdays?.[0]??`monday`),[N,te]=(0,O.useState)(h.dayOfMonth??1),P=f[0]?.conversationId??null,F=m?Fe(m,P):null,L=_!==d.definition.name||b!==d.definition.prompt||S!==h.kind||T!==h.timeZone||D!==h.startDate||A!==h.localTime||M!==(h.weekdays?.[0]??`monday`)||N!==(h.dayOfMonth??1);async function z(e){e.preventDefault(),await a({name:_,prompt:b,recurrence:{version:1,kind:S,timeZone:T,startDate:D,localTime:A,end:{kind:`never`},...S===`weekly`?{weekdays:[M]}:{},...S===`monthly`?{dayOfMonth:N}:{}}})}return(0,B.jsx)(U,{detailExpanded:e,label:`${d.definition.name} details`,onClose:t,onDetailResizeStart:r,onToggleDetailExpanded:o,children:(0,B.jsxs)(`form`,{onSubmit:z,children:[(0,B.jsxs)(`div`,{className:`scheduled-detail-header`,children:[(0,B.jsx)(`div`,{children:(0,B.jsxs)(`div`,{className:`scheduled-detail-title-row`,children:[(0,B.jsx)(`h2`,{children:`Schedule details`}),(0,B.jsx)(`span`,{children:d.schedule.enabled?`Active`:`Paused`})]})}),(0,B.jsx)(`div`,{className:`scheduled-detail-header-controls`,children:(0,B.jsx)(`button`,{"aria-label":`Delete schedule`,className:`scheduled-icon-button`,disabled:c,onClick:()=>void n(),title:`Delete schedule`,type:`button`,children:(0,B.jsx)(l,{size:16})})})]}),(0,B.jsxs)(W,{title:`Task`,children:[(0,B.jsxs)(`label`,{className:`scheduled-field`,children:[(0,B.jsx)(`span`,{children:`Name`}),(0,B.jsx)(`input`,{maxLength:180,onChange:e=>y(e.target.value),required:!0,value:_})]}),(0,B.jsxs)(`label`,{className:`scheduled-field`,children:[(0,B.jsx)(`span`,{children:`Prompt`}),(0,B.jsx)(`textarea`,{onChange:e=>x(e.target.value),required:!0,value:b})]})]}),(0,B.jsxs)(W,{title:`Schedule`,children:[(0,B.jsxs)(`div`,{className:`scheduled-field-grid`,children:[(0,B.jsxs)(`label`,{className:`scheduled-field`,children:[(0,B.jsx)(`span`,{children:`Repeat`}),(0,B.jsxs)(`select`,{onChange:e=>C(e.target.value),value:S,children:[(0,B.jsx)(`option`,{value:`once`,children:`Once`}),(0,B.jsx)(`option`,{value:`daily`,children:`Daily`}),(0,B.jsx)(`option`,{value:`weekdays`,children:`Weekdays`}),(0,B.jsx)(`option`,{value:`weekly`,children:`Weekly`}),(0,B.jsx)(`option`,{value:`monthly`,children:`Monthly`})]})]}),S===`weekly`?(0,B.jsxs)(`label`,{className:`scheduled-field`,children:[(0,B.jsx)(`span`,{children:`Day`}),(0,B.jsx)(`select`,{onChange:e=>ee(e.target.value),value:M,children:Oe.map(e=>(0,B.jsx)(`option`,{value:e,children:R(e)},e))})]}):S===`monthly`?(0,B.jsxs)(`label`,{className:`scheduled-field`,children:[(0,B.jsx)(`span`,{children:`Day of month`}),(0,B.jsx)(`input`,{max:31,min:1,onChange:e=>te(Number(e.target.value)),type:`number`,value:N})]}):null,(0,B.jsxs)(`label`,{className:`scheduled-field`,children:[(0,B.jsx)(`span`,{children:`Start date`}),(0,B.jsx)(`input`,{onChange:e=>k(e.target.value),required:!0,type:`date`,value:D})]}),(0,B.jsxs)(`label`,{className:`scheduled-field`,children:[(0,B.jsx)(`span`,{children:`Time`}),(0,B.jsx)(`input`,{onChange:e=>j(e.target.value),required:!0,type:`time`,value:A})]}),(0,B.jsxs)(`label`,{className:`scheduled-field scheduled-field-wide`,children:[(0,B.jsx)(`span`,{children:`Timezone`}),(0,B.jsx)(`input`,{onChange:e=>E(e.target.value),required:!0,value:T})]})]}),(0,B.jsxs)(`p`,{className:`scheduled-next-run`,children:[`Next run: `,I(d.schedule.nextRunAt,h.timeZone)]})]}),(0,B.jsxs)(`div`,{className:`scheduled-detail-actions`,children:[L?(0,B.jsxs)(`button`,{disabled:c,type:`submit`,children:[(0,B.jsx)(v,{size:15}),(0,B.jsx)(`span`,{children:`Save`})]}):null,(0,B.jsxs)(`button`,{disabled:c,onClick:()=>void i(),type:`button`,children:[(0,B.jsx)(w,{size:15}),(0,B.jsx)(`span`,{children:`Run now`})]}),(0,B.jsxs)(`button`,{disabled:c,onClick:()=>void s(),type:`button`,children:[d.schedule.enabled?(0,B.jsx)(u,{size:15}):(0,B.jsx)(g,{size:15}),(0,B.jsx)(`span`,{children:d.schedule.enabled?`Pause`:`Resume`})]})]}),(0,B.jsxs)(`button`,{className:`scheduled-open-chat`,disabled:c||!F,onClick:()=>{F&&Ie(F,P)},type:`button`,children:[(0,B.jsx)(`span`,{children:`Open hosted chat`}),(0,B.jsx)(p,{size:14})]}),(0,B.jsx)(W,{title:`Runs`,children:f.length===0?(0,B.jsx)(`p`,{className:`scheduled-no-runs`,children:`No runs yet.`}):(0,B.jsx)(`div`,{className:`scheduled-run-list`,children:f.map(e=>(0,B.jsx)(H,{onOpen:()=>{m&&Ie(Fe(m,e.conversationId),e.conversationId)},run:e},e.id))})})]})})}function Me(e){return e.recurrence??{version:1,kind:`daily`,timeZone:e.timeZone||Re(),startDate:Le(),localTime:`08:00`,end:{kind:`never`}}}function Ne(e){let t=e.input.prompt;return typeof t==`string`&&t.trim()?t.trim():Object.keys(e.input).length>0?JSON.stringify(e.input,null,2):`No task input configured.`}function Pe(e,t){let[n,r]=(0,O.useState)([]),[i,a]=(0,O.useState)(!1),[o,s]=(0,O.useState)(null);return(0,O.useEffect)(()=>{if(!e){r([]),a(!1),s(null);return}let n=!1;return a(!0),C.localAgentScheduleRuns(e,t,{limit:20}).then(e=>{n||(r(e.runs),s(null))}).catch(e=>{n||s(ze(e))}).finally(()=>{n||a(!1)}),()=>{n=!0}},[e,t]),{error:o,loading:i,runs:n}}function Fe(e,t){let n=new URL(e);return n.pathname=t?`/sandboxes/work/${encodeURIComponent(t)}`:`/sandboxes/work`,n.search=``,n.hash=``,n.toString()}async function Ie(e,t){let n=window.openpond?.browser;n?.openExternal&&(await n.openExternal({conversationId:t??`hosted-scheduled-work`,url:e})).ok||window.open(e,`_blank`,`noopener,noreferrer`)}function Le(){return new Date().toISOString().slice(0,10)}function Re(){return Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`}function ze(e){return e instanceof Error?e.message:String(e)}export{ke as ScheduledWorkPage};
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-CCaTs7xt.js";import{n as r,o as i}from"./client-choice-storage-CRKZpilL.js";import{t as a}from"./requests-DmeUYik4.js";import{n as o,o as s,r as c}from"./ComposerAttachments-DI-Gr7Zw.js";import"./icons-B4B5eUyR.js";import{F as l,I as u,L as d,V as f}from"./training-model-data-CWoTokkb.js";import{t as p}from"./external-link-BSn21e-y.js";import{t as m}from"./loader-circle-DNHvEoaP.js";import{t as h}from"./maximize-2-Cjg-f1xT.js";import{t as g}from"./play-DieChKfF.js";import{t as _}from"./refresh-cw-DOVpqCfJ.js";import{t as v}from"./save-BuyyyR4Q.js";import{t as y}from"./x-BvVvVB-j.js";import{r as b}from"./AppToastContext-BQ4iRFif.js";import{Cn as x,Gt as S,Tn as C,Zt as w,rn as T,vn as E}from"./App-QM6Y2Eod.js";import{t as D}from"./useLocalAgentSchedules-DpHnOGoV.js";var O=e(t(),1),k=3e4;function A(e){let[t,n]=(0,O.useState)([]),[r,i]=(0,O.useState)([]),[a,o]=(0,O.useState)(null),[s,c]=(0,O.useState)(!1),[l,u]=(0,O.useState)(null),[d,f]=(0,O.useState)(()=>new Set);async function p(e,t){t&&c(!0);try{let t=await C.hostedSavedWork(e);n(t.definitions),i(t.runs),o(t.webBaseUrl??null),u(null)}catch(e){u(j(e))}finally{t&&c(!1)}}(0,O.useEffect)(()=>{if(!e){n([]),i([]),o(null),u(null),c(!1);return}let t=!1,r=async r=>{if(!t){r&&c(!0);try{let r=await C.hostedSavedWork(e);if(t)return;n(r.definitions),i(r.runs),o(r.webBaseUrl??null),u(null)}catch(e){t||u(j(e))}finally{!t&&r&&c(!1)}}};r(!0);let a=window.setInterval(()=>void r(!1),k);return()=>{t=!0,window.clearInterval(a)}},[e]);async function m(){e&&await p(e,!0)}async function h(t){e&&(await C.createHostedSavedWork(e,t),await p(e,!1))}async function g(e,t){await y(e,async n=>{await C.updateHostedSavedWork(n,e,t)})}async function _(e){await y(e,async t=>{await C.deleteHostedSavedWork(t,e)})}async function v(e){await y(e,async t=>{await C.runHostedSavedWork(t,e,crypto.randomUUID())})}async function y(t,n){if(e&&!d.has(t)){b(t,!0);try{await n(e),await p(e,!1)}catch(e){throw u(j(e)),e}finally{b(t,!1)}}}function b(e,t){f(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})}return{create:h,definitions:t,error:l,loading:s,pendingScheduleIds:d,refresh:m,remove:_,run:v,runs:r,update:g,webBaseUrl:a}}function j(e){return e instanceof Error?e.message:String(e)}var M=3e4;function ee(e){let[t,n]=(0,O.useState)([]),[r,i]=(0,O.useState)([]),[a,o]=(0,O.useState)(!1),[s,c]=(0,O.useState)(null),[l,u]=(0,O.useState)(()=>new Set),d=(0,O.useCallback)(async t=>{if(e){t&&o(!0);try{let t=await C.chatWorkflows(e);n(t.workflows),i(t.runs),c(null)}catch(e){c(e instanceof Error?e.message:String(e))}finally{t&&o(!1)}}},[e]);(0,O.useEffect)(()=>{if(!e){n([]),i([]),c(null),o(!1);return}d(!0);let t=window.setInterval(()=>void d(!1),M);return()=>window.clearInterval(t)},[e,d]);async function f(e,t){if(!l.has(e)){u(t=>new Set(t).add(e));try{await t(),await d(!1)}catch(e){throw c(e instanceof Error?e.message:String(e)),e}finally{u(t=>{let n=new Set(t);return n.delete(e),n})}}}return{workflows:t,runs:r,loading:a,error:s,pendingIds:l,refresh:()=>d(!0),update:(t,n)=>f(t,()=>C.updateChatWorkflow(e,t,n)),remove:t=>f(t,()=>C.deleteChatWorkflow(e,t)),run:t=>f(t,()=>C.runChatWorkflow(e,t))}}var N=`openpond.scheduled-work.view.v1`;function te(e=F()){try{return e?.getItem(N)===`list`?`list`:`calendar`}catch{return`calendar`}}function P(e,t=F()){try{t?.setItem(N,e)}catch{}}function F(){if(typeof window>`u`)return null;try{return r}catch{return null}}function I(e,t){if(!e)return`None`;let n=new Date(e);if(!Number.isFinite(n.getTime()))return`None`;try{return n.toLocaleString(void 0,{month:`short`,day:`numeric`,year:`numeric`,hour:`numeric`,minute:`2-digit`,...t?{timeZone:t,timeZoneName:`short`}:{}})}catch{return n.toLocaleString()}}function L(e){return R(e.replaceAll(`_`,` `))}function R(e){return e.replace(/^./,e=>e.toUpperCase())}function z(e){let[t=`0`,n=`00`]=e.split(`:`);return new Date(2020,0,1,Number(t),Number(n)).toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`})}var B=n();function V({run:e}){let t=e.error||e.stderr||e.stdout;return(0,B.jsxs)(`details`,{className:`scheduled-run-row`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:L(e.status)}),(0,B.jsx)(`small`,{children:I(e.createdAt,null)})]}),(0,B.jsx)(`span`,{className:`scheduled-run-trigger`,children:e.trigger===`manual`?`Manual`:`Scheduled`})]}),t?(0,B.jsx)(`pre`,{children:t}):null]})}function H({onOpen:e,run:t}){return(0,B.jsxs)(`button`,{className:`scheduled-run-row hosted`,onClick:e,type:`button`,children:[(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:L(t.status)}),(0,B.jsx)(`small`,{children:I(t.createdAt,null)})]}),(0,B.jsxs)(`span`,{className:`scheduled-run-trigger`,children:[R(t.triggerKind),` `,(0,B.jsx)(p,{size:11})]}),t.deliveryError?(0,B.jsx)(`p`,{children:t.deliveryError}):null]})}function U({children:e,detailExpanded:t,kind:n=`schedule`,label:r,onClose:i,onDetailResizeStart:a,onToggleDetailExpanded:o}){return(0,B.jsxs)(`aside`,{"aria-label":r,className:`workspace-diff-panel scheduled-detail${t?` expanded`:``}`,children:[t?null:(0,B.jsx)(`div`,{"aria-label":`Resize schedule details`,"aria-orientation":`vertical`,className:`workspace-diff-resize-handle`,onPointerDown:a,role:`separator`}),(0,B.jsxs)(`div`,{className:`workspace-diff-topbar`,children:[(0,B.jsx)(`div`,{className:`workspace-diff-tabs`,role:`tablist`,"aria-label":`${n===`workflow`?`Workflow`:`Schedule`} details`,children:(0,B.jsxs)(`button`,{"aria-selected":`true`,className:`workspace-diff-tab active`,role:`tab`,type:`button`,children:[(0,B.jsx)(E,{size:14}),(0,B.jsx)(`span`,{children:n===`workflow`?`Workflow`:`Schedule`})]})}),(0,B.jsxs)(`div`,{className:`workspace-diff-toolbar-actions`,children:[(0,B.jsx)(`button`,{"aria-label":t?`Dock ${n} details`:`Expand ${n} details`,className:`diff-icon-button`,onClick:o,title:t?`Dock ${n} details`:`Expand ${n} details`,type:`button`,children:t?(0,B.jsx)(d,{size:14}):(0,B.jsx)(h,{size:14})}),(0,B.jsx)(`button`,{"aria-label":`Close ${n} details`,className:`diff-icon-button`,onClick:i,title:`Close ${n} details`,type:`button`,children:(0,B.jsx)(y,{size:14})})]})]}),(0,B.jsx)(`div`,{className:`scheduled-detail-body`,children:e})]})}function W({children:e,title:t}){return(0,B.jsxs)(`section`,{className:`scheduled-detail-section`,children:[(0,B.jsx)(`div`,{className:`scheduled-detail-section-heading`,children:(0,B.jsx)(`h3`,{children:t})}),e]})}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 K({children:e}){return(0,B.jsx)(`p`,{className:`scheduled-empty`,children:e})}function ne({label:e}){return(0,B.jsxs)(`div`,{className:`scheduled-loading`,role:`status`,children:[(0,B.jsx)(m,{className:`scheduled-spin`,size:16}),(0,B.jsx)(`span`,{children:e})]})}var q=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`];function re({items:e,onSelect:t,selectedKey:n}){let[r,i]=(0,O.useState)(()=>se(new Date)),a=(0,O.useMemo)(()=>J(r),[r]),o=(0,O.useMemo)(()=>ie(e),[e]),s=new Intl.DateTimeFormat(void 0,{month:`long`,year:`numeric`}).format(r),c=e.filter(e=>!ae(e.nextRunAt));return(0,B.jsxs)(`div`,{className:`scheduled-calendar`,children:[(0,B.jsxs)(`div`,{className:`scheduled-calendar-toolbar`,children:[(0,B.jsx)(`strong`,{children:s}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`button`,{"aria-label":`Previous month`,className:`scheduled-icon-button`,onClick:()=>i(ce(r,-1)),type:`button`,children:(0,B.jsx)(x,{size:15})}),(0,B.jsx)(`button`,{className:`scheduled-calendar-today`,onClick:()=>i(se(new Date)),type:`button`,children:`Today`}),(0,B.jsx)(`button`,{"aria-label":`Next month`,className:`scheduled-icon-button`,onClick:()=>i(ce(r,1)),type:`button`,children:(0,B.jsx)(f,{size:15})})]})]}),(0,B.jsxs)(`div`,{className:`scheduled-calendar-grid`,role:`grid`,"aria-label":s,children:[q.map(e=>(0,B.jsx)(`div`,{className:`scheduled-calendar-weekday`,role:`columnheader`,children:e},e)),a.map(e=>{let i=oe(e),a=o.get(i)??[],s=e.getMonth()!==r.getMonth(),c=i===oe(new Date);return(0,B.jsxs)(`div`,{className:`scheduled-calendar-day${s?` outside`:``}${c?` today`:``}`,role:`gridcell`,children:[(0,B.jsx)(`span`,{className:`scheduled-calendar-day-number`,children:e.getDate()}),(0,B.jsx)(`div`,{className:`scheduled-calendar-events`,children:a.map(e=>(0,B.jsxs)(`button`,{"aria-current":n===e.key?`true`:void 0,className:`scheduled-calendar-event${e.enabled?``:` paused`}`,onClick:()=>t(e.key),title:e.title,type:`button`,children:[(0,B.jsx)(`span`,{children:le(e.nextRunAt)}),(0,B.jsx)(`strong`,{children:e.title})]},e.key))})]},i)})]}),c.length?(0,B.jsxs)(`div`,{className:`scheduled-calendar-unscheduled`,children:[(0,B.jsx)(`span`,{children:`No upcoming run`}),(0,B.jsx)(`div`,{children:c.map(e=>(0,B.jsx)(`button`,{onClick:()=>t(e.key),type:`button`,children:e.title},e.key))})]}):null]})}function J(e){let t=new Date(e.getFullYear(),e.getMonth(),1),n=new Date(t);return n.setDate(t.getDate()-t.getDay()),Array.from({length:42},(e,t)=>{let r=new Date(n);return r.setDate(n.getDate()+t),r})}function ie(e){let t=new Map;for(let n of e){let e=ae(n.nextRunAt);if(!e)continue;let r=oe(e);t.set(r,[...t.get(r)??[],n])}for(let e of t.values())e.sort((e,t)=>e.nextRunAt.localeCompare(t.nextRunAt));return t}function ae(e){if(!e)return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t}function oe(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function se(e){return new Date(e.getFullYear(),e.getMonth(),1)}function ce(e,t){return new Date(e.getFullYear(),e.getMonth()+t,1)}function le(e){return new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(new Date(e))}function ue({entry:e,onSelect:t,selected:n}){return(0,B.jsxs)(`button`,{"aria-current":n?`true`:void 0,className:`scheduled-list-row`,onClick:t,type:`button`,children:[(0,B.jsx)(`span`,{className:`scheduled-status-dot`}),(0,B.jsxs)(`span`,{className:`scheduled-list-copy`,children:[(0,B.jsx)(`span`,{className:`scheduled-list-title`,children:(0,B.jsx)(`strong`,{children:e.workflow.label})}),(0,B.jsx)(`span`,{children:e.workflow.description}),(0,B.jsxs)(`small`,{children:[`On demand · Source `,e.binding.sourceRevision.slice(0,10)]})]})]})}function de({cadence:e,onSelect:t,schedule:n,selected:r}){return(0,B.jsxs)(`button`,{"aria-current":r?`true`:void 0,className:`scheduled-list-row`,onClick:t,type:`button`,children:[(0,B.jsx)(`span`,{className:`scheduled-status-dot ${n.enabled?`active`:`paused`}`}),(0,B.jsxs)(`span`,{className:`scheduled-list-copy`,children:[(0,B.jsx)(`span`,{className:`scheduled-list-title`,children:(0,B.jsx)(`strong`,{children:n.scheduleName})}),(0,B.jsx)(`span`,{children:n.localProjectName}),(0,B.jsxs)(`small`,{children:[e,n.nextRunAt?` · Next ${I(n.nextRunAt,n.timezone)}`:` · No next run`]})]})]})}function fe({cadence:e,definition:t,onSelect:n,schedule:r,selected:i}){return(0,B.jsxs)(`button`,{"aria-current":i?`true`:void 0,className:`scheduled-list-row`,onClick:n,type:`button`,children:[(0,B.jsx)(`span`,{className:`scheduled-status-dot ${r.enabled?`active`:`paused`}`}),(0,B.jsxs)(`span`,{className:`scheduled-list-copy`,children:[(0,B.jsxs)(`span`,{className:`scheduled-list-title`,children:[(0,B.jsx)(`strong`,{children:t.name}),(0,B.jsx)(`small`,{className:`scheduled-environment-badge hosted`,children:`Hosted`})]}),(0,B.jsx)(`span`,{children:t.prompt}),(0,B.jsxs)(`small`,{children:[e,r.nextRunAt?` · Next ${I(r.nextRunAt,r.timeZone)}`:` · No next run`]})]})]})}function pe({cadence:e,onSelect:t,selected:n,workflow:r}){return(0,B.jsxs)(`button`,{"aria-current":n?`true`:void 0,className:`scheduled-list-row`,onClick:t,type:`button`,children:[(0,B.jsx)(`span`,{className:`scheduled-status-dot ${r.enabled?`active`:`paused`}`}),(0,B.jsxs)(`span`,{className:`scheduled-list-copy`,children:[(0,B.jsxs)(`span`,{className:`scheduled-list-title`,children:[(0,B.jsx)(`strong`,{children:r.name}),(0,B.jsx)(`small`,{className:`scheduled-environment-badge`,children:`Chat`})]}),(0,B.jsx)(`span`,{children:r.prompt}),(0,B.jsxs)(`small`,{children:[`Runs in `,r.sessionTitle,` · `,e,r.nextRunAt?` · Next ${I(r.nextRunAt,r.recurrence.timeZone)}`:` · No next run`]})]})]})}function me(e,t){return e.filter(e=>t===`active`?e.enabled:t!==`paused`||!e.enabled).sort((e,t)=>(e.nextRunAt?new Date(e.nextRunAt).getTime():1/0)-(t.nextRunAt?new Date(t.nextRunAt).getTime():1/0)||e.name.localeCompare(t.name))}function he(e){let t=z(e.localTime);return e.kind===`once`?`Once on ${e.startDate} at ${t} · ${e.timeZone}`:e.kind===`weekdays`?`Weekdays at ${t} · ${e.timeZone}`:e.kind===`weekly`?`${e.weekdays?.map(R).join(`, `)??`Weekly`} at ${t} · ${e.timeZone}`:e.kind===`monthly`?`Monthly on day ${e.dayOfMonth??1} at ${t} · ${e.timeZone}`:`Daily at ${t} · ${e.timeZone}`}function ge({detailExpanded:e,onClose:t,onDelete:n,onDetailResizeStart:r,onRun:i,onToggle:a,onToggleDetailExpanded:o,pending:s,runs:c,workflow:d}){return(0,B.jsxs)(U,{detailExpanded:e,label:`${d.name} details`,onClose:t,onDetailResizeStart:r,onToggleDetailExpanded:o,children:[(0,B.jsx)(`div`,{className:`scheduled-detail-header`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`scheduled-detail-title-row`,children:[(0,B.jsx)(`h2`,{children:`Workflow details`}),(0,B.jsx)(`span`,{children:d.enabled?`Active`:`Paused`})]}),(0,B.jsx)(`p`,{children:d.name})]})}),(0,B.jsx)(W,{title:`Prompt`,children:(0,B.jsx)(`pre`,{className:`scheduled-prompt`,children:d.prompt})}),(0,B.jsx)(W,{title:`Profile source`,children:d.profileRef&&d.profileWorkflowId?(0,B.jsxs)(`p`,{children:[d.profileRef.profileId,` · workflows/`,d.profileWorkflowId,`/PROMPT.md`]}):(0,B.jsx)(`p`,{className:`scheduled-detail-error`,children:d.profileMigrationError??`Profile package is unresolved.`})}),(0,B.jsxs)(W,{title:`Delivery`,children:[(0,B.jsxs)(`dl`,{className:`scheduled-detail-fields`,children:[(0,B.jsx)(G,{label:`Runs in`,value:d.sessionTitle}),(0,B.jsx)(G,{label:`Cadence`,value:he(d.recurrence)}),(0,B.jsx)(G,{label:`Next run`,value:I(d.nextRunAt,d.recurrence.timeZone)}),(0,B.jsx)(G,{label:`Last run`,value:I(d.lastRunAt,d.recurrence.timeZone)})]}),d.lastError?(0,B.jsx)(`p`,{className:`scheduled-detail-error`,children:d.lastError}):null]}),(0,B.jsxs)(`div`,{className:`scheduled-detail-actions`,children:[(0,B.jsxs)(`button`,{disabled:s,onClick:()=>void i(),type:`button`,children:[(0,B.jsx)(w,{size:15}),(0,B.jsx)(`span`,{children:`Run now`})]}),(0,B.jsxs)(`button`,{disabled:s,onClick:()=>void a(),type:`button`,children:[d.enabled?(0,B.jsx)(u,{size:15}):(0,B.jsx)(g,{size:15}),(0,B.jsx)(`span`,{children:d.enabled?`Pause`:`Resume`})]}),(0,B.jsxs)(`button`,{disabled:s,onClick:()=>void n(),type:`button`,children:[(0,B.jsx)(l,{size:15}),(0,B.jsx)(`span`,{children:`Delete`})]})]}),(0,B.jsx)(W,{title:`Runs`,children:c.length===0?(0,B.jsx)(`p`,{className:`scheduled-no-runs`,children:`No runs yet.`}):(0,B.jsx)(`div`,{className:`scheduled-run-list`,children:c.map(e=>(0,B.jsxs)(`div`,{className:`scheduled-run-row`,children:[(0,B.jsx)(`span`,{children:R(e.status)}),(0,B.jsx)(`small`,{children:I(e.createdAt,d.recurrence.timeZone)}),e.error?(0,B.jsx)(`p`,{children:e.error}):null]},e.id))})})]})}async function _e(e){let t=e.catalog.workflows.find(t=>t.workflow.id===e.workflowId);if(!t)throw Error(`Selected Profile workflow is unavailable.`);let n=e.client??C,r=await n.createSession(e.connection,{experience:`work`,provider:`openpond`,...e.workspaceTarget===`local`?{metadata:{workspaceTarget:`local`}}:{},currentProfile:e.catalog.profileRef,profileWorkflowBinding:t.binding,title:t.workflow.label});return e.onSessionCreated?.(r.id),await n.sendTurn(e.connection,r.id,{prompt:e.prompt?.trim()||t.workflow.label,workflowInput:e.value,...e.attachments?.length?{attachments:e.attachments}:{},approvalPolicy:`on-request`,sandbox:`workspace-write`,codexPermissionMode:`default`}),r.id}function ve({catalog:e,connection:t,detailExpanded:n,entry:r,onClose:i,onDetailResizeStart:l,onOpenSession:u,onToggleDetailExpanded:d}){let[f,p]=(0,O.useState)(``),[m,h]=(0,O.useState)([]),[g,_]=(0,O.useState)(`{}`),[v,y]=(0,O.useState)(e.profileRef.source===`local`?`local`:`hosted`),[b,x]=(0,O.useState)(!1),[C,T]=(0,O.useState)(null),E=r.workflow;async function D(n){if(n.preventDefault(),!b){x(!0),T(null);try{let n=JSON.parse(g);if(m.length>a.maxAttachments)throw Error(`Choose at most ${a.maxAttachments} files.`);let r=await Promise.all(m.map(async e=>{if(e.size>a.maxAttachmentBytes)throw Error(`${e.name} exceeds the attachment size limit.`);return s({id:c(),file:e,name:e.name,mediaType:e.type||`application/octet-stream`,sizeBytes:e.size,kind:o(e)})}));await _e({connection:t,catalog:e,workflowId:E.id,value:n,prompt:f,attachments:r,workspaceTarget:v,onSessionCreated:u})}catch(e){T(e instanceof Error?e.message:String(e))}finally{x(!1)}}}return(0,B.jsxs)(U,{detailExpanded:n,kind:`workflow`,label:`${E.label} details`,onClose:i,onDetailResizeStart:l,onToggleDetailExpanded:d,children:[(0,B.jsx)(`div`,{className:`scheduled-detail-header`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`scheduled-detail-title-row`,children:(0,B.jsx)(`h2`,{children:`Workflow details`})}),(0,B.jsx)(`p`,{children:E.label})]})}),(0,B.jsx)(W,{title:`Description`,children:(0,B.jsx)(`p`,{children:E.description})}),(0,B.jsxs)(W,{title:`Source`,children:[(0,B.jsxs)(`p`,{children:[`workflows/`,E.id,`/`,E.invocation.kind===`instructions`?`PROMPT.md`:`ACTION.json`]}),(0,B.jsxs)(`p`,{children:[`Revision `,r.binding.sourceRevision.slice(0,12),` · Release `,r.binding.harnessRelease.contentHash.slice(0,12)]})]}),E.skillPaths.length>0?(0,B.jsx)(W,{title:`Skills`,children:(0,B.jsx)(`p`,{children:E.skillPaths.join(`, `)})}):null,E.invocation.kind===`instructions`?(0,B.jsx)(W,{title:`Instructions`,children:(0,B.jsx)(`pre`,{className:`scheduled-prompt`,children:E.invocation.instructions})}):null,(0,B.jsx)(W,{title:`Start a run`,children:(0,B.jsxs)(`form`,{className:`scheduled-profile-workflow-form`,onSubmit:e=>void D(e),children:[(0,B.jsx)(`label`,{htmlFor:`scheduled-profile-workflow-prompt`,children:`Instructions for this run`}),(0,B.jsx)(`textarea`,{id:`scheduled-profile-workflow-prompt`,onChange:e=>p(e.target.value),value:f}),(0,B.jsx)(`label`,{htmlFor:`scheduled-profile-workflow-files`,children:`Files for this run`}),(0,B.jsx)(`input`,{id:`scheduled-profile-workflow-files`,type:`file`,multiple:!0,onChange:e=>h(Array.from(e.target.files??[]))}),m.length>0?(0,B.jsx)(`small`,{children:m.map(e=>e.name).join(`, `)}):null,(0,B.jsx)(`label`,{htmlFor:`scheduled-profile-workflow-target`,children:`Run in`}),(0,B.jsxs)(`select`,{id:`scheduled-profile-workflow-target`,value:v,onChange:e=>y(e.target.value),children:[(0,B.jsx)(`option`,{value:`local`,children:`Desktop local workspace`}),(0,B.jsx)(`option`,{value:`hosted`,children:`Hosted Work`})]}),E.invocation.kind===`agent_action`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`label`,{htmlFor:`scheduled-profile-workflow-input`,children:`Input JSON`}),(0,B.jsx)(`textarea`,{id:`scheduled-profile-workflow-input`,onChange:e=>_(e.target.value),value:g})]}):null,C?(0,B.jsx)(S,{error:C}):null,(0,B.jsx)(`div`,{className:`scheduled-detail-actions`,children:(0,B.jsxs)(`button`,{disabled:b,type:`submit`,children:[(0,B.jsx)(w,{size:15}),(0,B.jsx)(`span`,{children:b?`Starting…`:`Run now`})]})})]})})]})}function ye(e){return e.flatMap(e=>e.schedules.map(t=>({definition:e,schedule:t})))}function be(e,t){return e.filter(e=>t===`active`?e.schedule.enabled:t!==`paused`||!e.schedule.enabled).sort((e,t)=>$(e.schedule.nextRunAt)-$(t.schedule.nextRunAt)||e.definition.name.localeCompare(t.definition.name))}function xe(e,t){return e.filter(e=>t===`active`?e.enabled:t!==`paused`||!e.enabled).sort((e,t)=>$(e.nextRunAt)-$(t.nextRunAt)||e.scheduleName.localeCompare(t.scheduleName))}function Se(e,t,n){return[...e.map(e=>({kind:`chat`,workflow:e})),...t.map(e=>({kind:`local`,schedule:e})),...n.map(e=>({kind:`hosted`,row:e}))].sort((e,t)=>{let n=$(Te(e)),r=$(Te(t));if(n!==r)return n-r;let i=Ee(e),a=Ee(t);return i.localeCompare(a)})}function Ce(e){return e.kind===`chat`?{enabled:e.workflow.enabled,key:X(e.workflow.id),nextRunAt:e.workflow.nextRunAt,title:e.workflow.name}:e.kind===`local`?{enabled:e.schedule.enabled,key:Y(e.schedule.id),nextRunAt:e.schedule.nextRunAt,title:e.schedule.scheduleName}:{enabled:e.row.schedule.enabled,key:Q(e.row.schedule.id),nextRunAt:e.row.schedule.nextRunAt,title:e.row.definition.name}}function we(e){let t=e.recurrence;return t?he(t):e.expression??`Manual`}function Te(e){return e.kind===`chat`?e.workflow.nextRunAt:e.kind===`local`?e.schedule.nextRunAt:e.row.schedule.nextRunAt}function Ee(e){return e.kind===`chat`?e.workflow.name:e.kind===`local`?e.schedule.scheduleName:e.row.definition.name}function De(e){let t=e.timezone?` · ${e.timezone}`:``;if(e.scheduleType===`rate`)return`Every ${e.scheduleExpression}${t}`;let n=e.scheduleExpression.trim().split(/\s+/);if(n.length===5&&/^\d+$/.test(n[0])&&/^\d+$/.test(n[1])){let e=z(`${n[1].padStart(2,`0`)}:${n[0].padStart(2,`0`)}`);if(n[2]===`*`&&n[3]===`*`&&n[4]===`*`)return`Daily at ${e}${t}`;if(n[2]===`*`&&n[3]===`*`&&n[4]===`MON-FRI`)return`Weekdays at ${e}${t}`}return`Cron ${e.scheduleExpression}${t}`}function Y(e){return`local:${e}`}function X(e){return`chat:${e}`}function Z(e){return`profile:${e}`}function Q(e){return`hosted:${e}`}function $(e){if(!e)return 2**53-1;let t=new Date(e).getTime();return Number.isFinite(t)?t:2**53-1}var Oe=[`sunday`,`monday`,`tuesday`,`wednesday`,`thursday`,`friday`,`saturday`];function ke({connection:e,selectedProfileKey:t,onOpenSession:n,detailOpen:r,detailExpanded:a,onDetailOpenChange:o,onDetailResizeStart:s,onToggleDetailExpanded:c}){let l=A(e),u=ee(e),d=D(e),[f,p]=(0,O.useState)(null),[m,h]=(0,O.useState)(!1),[g,v]=(0,O.useState)(null),[y,x]=(0,O.useState)(`all`),[S,w]=(0,O.useState)(te);i(()=>w(te()));let[E,k]=(0,O.useState)(!1),[j,M]=(0,O.useState)(null),N=(0,O.useMemo)(()=>ye(l.definitions),[l.definitions]),F=(0,O.useMemo)(()=>be(N,y),[y,N]),I=(0,O.useMemo)(()=>xe(d.schedules,y),[y,d.schedules]),L=(0,O.useMemo)(()=>me(u.workflows,y),[u.workflows,y]),R=N.find(e=>Q(e.schedule.id)===j)??null,z=d.schedules.find(e=>Y(e.id)===j)??null,V=u.workflows.find(e=>X(e.id)===j)??null,H=f?.workflows.find(e=>Z(e.workflow.id)===j)??null,U=R?l.runs.filter(e=>e.scheduleId===R.schedule.id):[],W=(0,O.useMemo)(()=>Se(L,I,F),[L,I,F]),G=(0,O.useMemo)(()=>[...W.map(Ce),...f?.workflows.map(e=>({enabled:!0,key:Z(e.workflow.id),nextRunAt:null,title:e.workflow.label}))??[]],[W,f]);b(l.error,{prefix:`Workflows`}),b(d.error,{prefix:`Local schedules`}),b(u.error,{prefix:`Chat workflows`}),b(g,{prefix:`Profile workflows`}),(0,O.useEffect)(()=>{if(!e||!t){p(null),v(null);return}let n=!0;return h(!0),C.profileWorkflows(e).then(e=>{n&&(p(e),v(null))}).catch(e=>{n&&v(e instanceof Error?e.message:String(e))}).finally(()=>{n&&h(!1)}),()=>{n=!1}},[e,t]),(0,O.useEffect)(()=>{j&&!R&&!z&&!V&&!H&&!m&&M(null)},[m,V,R,z,H,j]),(0,O.useEffect)(()=>{!r&&j&&M(null)},[r,j]),(0,O.useEffect)(()=>()=>o(!1),[o]);function q(e){M(e),o(!0)}function J(){M(null),o(!1)}function ie(e){w(e),P(e)}async function ae(){k(!0);try{await Promise.all([l.refresh(),d.refresh(),u.refresh(),e&&t?C.profileWorkflows(e).then(p):Promise.resolve()])}finally{k(!1)}}return(0,B.jsxs)(`section`,{"aria-label":`Workflows`,className:`scheduled-work-view${R||z||V||H?` detail-open`:``}${a?` detail-expanded`:``}`,children:[(0,B.jsx)(`div`,{className:`scheduled-work-scroll`,children:(0,B.jsxs)(`div`,{className:`scheduled-work-content`,children:[(0,B.jsxs)(`header`,{className:`scheduled-work-header`,children:[(0,B.jsxs)(`div`,{"aria-label":`Workflow view`,className:`scheduled-view-tabs`,role:`tablist`,children:[(0,B.jsx)(`button`,{"aria-selected":S===`calendar`,className:S===`calendar`?`active`:void 0,onClick:()=>ie(`calendar`),role:`tab`,type:`button`,children:`Calendar`}),(0,B.jsx)(`button`,{"aria-selected":S===`list`,className:S===`list`?`active`:void 0,onClick:()=>ie(`list`),role:`tab`,type:`button`,children:`List`})]}),(0,B.jsxs)(`div`,{className:`scheduled-work-header-actions`,children:[(0,B.jsx)(`button`,{"aria-label":`Refresh schedules`,className:`scheduled-icon-button`,disabled:!e||l.loading||d.loading||u.loading||m,onClick:()=>void ae(),title:`Refresh schedules`,type:`button`,children:(0,B.jsx)(_,{className:E?`scheduled-spin`:void 0,size:16})}),(0,B.jsxs)(`label`,{className:`scheduled-filter`,children:[(0,B.jsx)(T,{"aria-hidden":`true`,size:16}),(0,B.jsxs)(`select`,{"aria-label":`Schedule filter`,onChange:e=>x(e.target.value),value:y,children:[(0,B.jsx)(`option`,{value:`active`,children:`Active`}),(0,B.jsx)(`option`,{value:`paused`,children:`Paused`}),(0,B.jsx)(`option`,{value:`all`,children:`All`})]})]})]})]}),(0,B.jsx)(`section`,{"aria-busy":l.loading||d.loading||u.loading||m,className:`scheduled-list`,children:e?(l.loading||d.loading||u.loading||m)&&N.length===0&&d.schedules.length===0&&u.workflows.length===0&&!f?.workflows.length?(0,B.jsx)(ne,{label:`Loading schedules`}):l.error&&d.error&&N.length===0&&d.schedules.length===0?(0,B.jsx)(K,{children:`Schedules are unavailable. Refresh to try again.`}):W.length===0&&!f?.workflows.length?(0,B.jsx)(K,{children:`Create a scheduled task here or ask for one in Work.`}):S===`calendar`?(0,B.jsx)(re,{items:G,onSelect:q,selectedKey:j}):(0,B.jsxs)(`div`,{className:`scheduled-list-rows`,children:[f?.workflows.map(e=>(0,B.jsx)(ue,{entry:e,onSelect:()=>q(Z(e.workflow.id)),selected:j===Z(e.workflow.id)},Z(e.workflow.id))),W.map(e=>e.kind===`chat`?(0,B.jsx)(pe,{cadence:he(e.workflow.recurrence),onSelect:()=>q(X(e.workflow.id)),selected:j===X(e.workflow.id),workflow:e.workflow},X(e.workflow.id)):e.kind===`local`?(0,B.jsx)(de,{cadence:De(e.schedule),onSelect:()=>q(Y(e.schedule.id)),schedule:e.schedule,selected:j===Y(e.schedule.id)},Y(e.schedule.id)):(0,B.jsx)(fe,{cadence:we(e.row.schedule),definition:e.row.definition,onSelect:()=>q(Q(e.row.schedule.id)),schedule:e.row.schedule,selected:j===Q(e.row.schedule.id)},Q(e.row.schedule.id)))]}):(0,B.jsx)(K,{children:`Connect to OpenPond to view scheduled Work.`})})]})}),H&&f&&e?(0,B.jsx)(ve,{catalog:f,connection:e,detailExpanded:a,entry:H,onClose:J,onDetailResizeStart:s,onOpenSession:n,onToggleDetailExpanded:c},H.workflow.id):R?(0,B.jsx)(je,{onClose:J,onDelete:async()=>{await l.remove(R.schedule.id),J()},onRun:()=>l.run(R.schedule.id),onSave:e=>l.update(R.schedule.id,e),onToggle:()=>l.update(R.schedule.id,{enabled:!R.schedule.enabled}),pending:l.pendingScheduleIds.has(R.schedule.id),row:R,runs:U,detailExpanded:a,onDetailResizeStart:s,onToggleDetailExpanded:c,webBaseUrl:l.webBaseUrl},`${R.schedule.id}:${R.definition.version}:${R.schedule.configurationVersion}`):V?(0,B.jsx)(ge,{detailExpanded:a,onClose:J,onDelete:async()=>{await u.remove(V.id),J()},onDetailResizeStart:s,onRun:()=>u.run(V.id),onToggle:()=>u.update(V.id,{enabled:!V.enabled}),onToggleDetailExpanded:c,pending:u.pendingIds.has(V.id),runs:u.runs.filter(e=>e.workflowId===V.id),workflow:V},V.id):z?(0,B.jsx)(Ae,{connection:e,onClose:J,onRun:()=>d.run(z),onToggle:()=>d.toggle(z),pending:d.pendingScheduleIds.has(z.id),schedule:z,detailExpanded:a,onDetailResizeStart:s,onToggleDetailExpanded:c},z.id):null]})}function Ae({connection:e,detailExpanded:t,onClose:n,onDetailResizeStart:r,onRun:i,onToggleDetailExpanded:a,onToggle:o,pending:s,schedule:c}){let l=Pe(e,c.id);return b(l.error,{prefix:`Local schedule runs`}),(0,B.jsxs)(U,{detailExpanded:t,label:`${c.scheduleName} details`,onClose:n,onDetailResizeStart:r,onToggleDetailExpanded:a,children:[(0,B.jsx)(`div`,{className:`scheduled-detail-header`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`scheduled-detail-title-row`,children:[(0,B.jsx)(`h2`,{children:`Schedule details`}),(0,B.jsx)(`span`,{children:c.enabled?`Active`:`Paused`})]}),(0,B.jsx)(`p`,{children:c.scheduleName})]})}),(0,B.jsxs)(W,{title:`Task`,children:[(0,B.jsxs)(`dl`,{className:`scheduled-detail-fields`,children:[(0,B.jsx)(G,{label:`Environment`,value:`Local`}),(0,B.jsx)(G,{label:`Project`,value:c.localProjectName}),(0,B.jsx)(G,{label:`Agent`,value:c.agentName}),(0,B.jsx)(G,{label:`Action`,value:c.targetAction})]}),(0,B.jsx)(`pre`,{className:`scheduled-prompt`,children:Ne(c)})]}),(0,B.jsxs)(W,{title:`Schedule`,children:[(0,B.jsxs)(`dl`,{className:`scheduled-detail-fields`,children:[(0,B.jsx)(G,{label:`Cadence`,value:De(c)}),(0,B.jsx)(G,{label:`Expression`,value:c.scheduleExpression}),(0,B.jsx)(G,{label:`Timezone`,value:c.timezone??`Local time`}),(0,B.jsx)(G,{label:`Next run`,value:I(c.nextRunAt,c.timezone)}),(0,B.jsx)(G,{label:`Last run`,value:I(c.lastRunAt,c.timezone)})]}),c.lastError?(0,B.jsx)(`p`,{className:`scheduled-detail-error`,children:c.lastError}):null]}),(0,B.jsxs)(`div`,{className:`scheduled-detail-actions`,children:[(0,B.jsxs)(`button`,{disabled:s,onClick:()=>void i(),type:`button`,children:[(0,B.jsx)(w,{size:15}),(0,B.jsx)(`span`,{children:`Run now`})]}),(0,B.jsxs)(`button`,{disabled:s,onClick:()=>void o(),type:`button`,children:[c.enabled?(0,B.jsx)(u,{size:15}):(0,B.jsx)(g,{size:15}),(0,B.jsx)(`span`,{children:c.enabled?`Pause`:`Resume`})]})]}),(0,B.jsx)(W,{title:`Runs`,children:l.loading&&l.runs.length===0?(0,B.jsx)(ne,{label:`Loading runs`}):l.runs.length===0?(0,B.jsx)(`p`,{className:`scheduled-no-runs`,children:`No runs yet.`}):(0,B.jsx)(`div`,{className:`scheduled-run-list`,children:l.runs.map(e=>(0,B.jsx)(V,{run:e},e.id))})})]})}function je({detailExpanded:e,onClose:t,onDelete:n,onDetailResizeStart:r,onRun:i,onSave:a,onToggleDetailExpanded:o,onToggle:s,pending:c,row:d,runs:f,webBaseUrl:m}){let h=Me(d.schedule),[_,y]=(0,O.useState)(d.definition.name),[b,x]=(0,O.useState)(d.definition.prompt),[S,C]=(0,O.useState)(h.kind),[T,E]=(0,O.useState)(h.timeZone),[D,k]=(0,O.useState)(h.startDate),[A,j]=(0,O.useState)(h.localTime),[M,ee]=(0,O.useState)(h.weekdays?.[0]??`monday`),[N,te]=(0,O.useState)(h.dayOfMonth??1),P=f[0]?.conversationId??null,F=m?Fe(m,P):null,L=_!==d.definition.name||b!==d.definition.prompt||S!==h.kind||T!==h.timeZone||D!==h.startDate||A!==h.localTime||M!==(h.weekdays?.[0]??`monday`)||N!==(h.dayOfMonth??1);async function z(e){e.preventDefault(),await a({name:_,prompt:b,recurrence:{version:1,kind:S,timeZone:T,startDate:D,localTime:A,end:{kind:`never`},...S===`weekly`?{weekdays:[M]}:{},...S===`monthly`?{dayOfMonth:N}:{}}})}return(0,B.jsx)(U,{detailExpanded:e,label:`${d.definition.name} details`,onClose:t,onDetailResizeStart:r,onToggleDetailExpanded:o,children:(0,B.jsxs)(`form`,{onSubmit:z,children:[(0,B.jsxs)(`div`,{className:`scheduled-detail-header`,children:[(0,B.jsx)(`div`,{children:(0,B.jsxs)(`div`,{className:`scheduled-detail-title-row`,children:[(0,B.jsx)(`h2`,{children:`Schedule details`}),(0,B.jsx)(`span`,{children:d.schedule.enabled?`Active`:`Paused`})]})}),(0,B.jsx)(`div`,{className:`scheduled-detail-header-controls`,children:(0,B.jsx)(`button`,{"aria-label":`Delete schedule`,className:`scheduled-icon-button`,disabled:c,onClick:()=>void n(),title:`Delete schedule`,type:`button`,children:(0,B.jsx)(l,{size:16})})})]}),(0,B.jsxs)(W,{title:`Task`,children:[(0,B.jsxs)(`label`,{className:`scheduled-field`,children:[(0,B.jsx)(`span`,{children:`Name`}),(0,B.jsx)(`input`,{maxLength:180,onChange:e=>y(e.target.value),required:!0,value:_})]}),(0,B.jsxs)(`label`,{className:`scheduled-field`,children:[(0,B.jsx)(`span`,{children:`Prompt`}),(0,B.jsx)(`textarea`,{onChange:e=>x(e.target.value),required:!0,value:b})]})]}),(0,B.jsxs)(W,{title:`Schedule`,children:[(0,B.jsxs)(`div`,{className:`scheduled-field-grid`,children:[(0,B.jsxs)(`label`,{className:`scheduled-field`,children:[(0,B.jsx)(`span`,{children:`Repeat`}),(0,B.jsxs)(`select`,{onChange:e=>C(e.target.value),value:S,children:[(0,B.jsx)(`option`,{value:`once`,children:`Once`}),(0,B.jsx)(`option`,{value:`daily`,children:`Daily`}),(0,B.jsx)(`option`,{value:`weekdays`,children:`Weekdays`}),(0,B.jsx)(`option`,{value:`weekly`,children:`Weekly`}),(0,B.jsx)(`option`,{value:`monthly`,children:`Monthly`})]})]}),S===`weekly`?(0,B.jsxs)(`label`,{className:`scheduled-field`,children:[(0,B.jsx)(`span`,{children:`Day`}),(0,B.jsx)(`select`,{onChange:e=>ee(e.target.value),value:M,children:Oe.map(e=>(0,B.jsx)(`option`,{value:e,children:R(e)},e))})]}):S===`monthly`?(0,B.jsxs)(`label`,{className:`scheduled-field`,children:[(0,B.jsx)(`span`,{children:`Day of month`}),(0,B.jsx)(`input`,{max:31,min:1,onChange:e=>te(Number(e.target.value)),type:`number`,value:N})]}):null,(0,B.jsxs)(`label`,{className:`scheduled-field`,children:[(0,B.jsx)(`span`,{children:`Start date`}),(0,B.jsx)(`input`,{onChange:e=>k(e.target.value),required:!0,type:`date`,value:D})]}),(0,B.jsxs)(`label`,{className:`scheduled-field`,children:[(0,B.jsx)(`span`,{children:`Time`}),(0,B.jsx)(`input`,{onChange:e=>j(e.target.value),required:!0,type:`time`,value:A})]}),(0,B.jsxs)(`label`,{className:`scheduled-field scheduled-field-wide`,children:[(0,B.jsx)(`span`,{children:`Timezone`}),(0,B.jsx)(`input`,{onChange:e=>E(e.target.value),required:!0,value:T})]})]}),(0,B.jsxs)(`p`,{className:`scheduled-next-run`,children:[`Next run: `,I(d.schedule.nextRunAt,h.timeZone)]})]}),(0,B.jsxs)(`div`,{className:`scheduled-detail-actions`,children:[L?(0,B.jsxs)(`button`,{disabled:c,type:`submit`,children:[(0,B.jsx)(v,{size:15}),(0,B.jsx)(`span`,{children:`Save`})]}):null,(0,B.jsxs)(`button`,{disabled:c,onClick:()=>void i(),type:`button`,children:[(0,B.jsx)(w,{size:15}),(0,B.jsx)(`span`,{children:`Run now`})]}),(0,B.jsxs)(`button`,{disabled:c,onClick:()=>void s(),type:`button`,children:[d.schedule.enabled?(0,B.jsx)(u,{size:15}):(0,B.jsx)(g,{size:15}),(0,B.jsx)(`span`,{children:d.schedule.enabled?`Pause`:`Resume`})]})]}),(0,B.jsxs)(`button`,{className:`scheduled-open-chat`,disabled:c||!F,onClick:()=>{F&&Ie(F,P)},type:`button`,children:[(0,B.jsx)(`span`,{children:`Open hosted chat`}),(0,B.jsx)(p,{size:14})]}),(0,B.jsx)(W,{title:`Runs`,children:f.length===0?(0,B.jsx)(`p`,{className:`scheduled-no-runs`,children:`No runs yet.`}):(0,B.jsx)(`div`,{className:`scheduled-run-list`,children:f.map(e=>(0,B.jsx)(H,{onOpen:()=>{m&&Ie(Fe(m,e.conversationId),e.conversationId)},run:e},e.id))})})]})})}function Me(e){return e.recurrence??{version:1,kind:`daily`,timeZone:e.timeZone||Re(),startDate:Le(),localTime:`08:00`,end:{kind:`never`}}}function Ne(e){let t=e.input.prompt;return typeof t==`string`&&t.trim()?t.trim():Object.keys(e.input).length>0?JSON.stringify(e.input,null,2):`No task input configured.`}function Pe(e,t){let[n,r]=(0,O.useState)([]),[i,a]=(0,O.useState)(!1),[o,s]=(0,O.useState)(null);return(0,O.useEffect)(()=>{if(!e){r([]),a(!1),s(null);return}let n=!1;return a(!0),C.localAgentScheduleRuns(e,t,{limit:20}).then(e=>{n||(r(e.runs),s(null))}).catch(e=>{n||s(ze(e))}).finally(()=>{n||a(!1)}),()=>{n=!0}},[e,t]),{error:o,loading:i,runs:n}}function Fe(e,t){let n=new URL(e);return n.pathname=t?`/sandboxes/work/${encodeURIComponent(t)}`:`/sandboxes/work`,n.search=``,n.hash=``,n.toString()}async function Ie(e,t){let n=window.openpond?.browser;n?.openExternal&&(await n.openExternal({conversationId:t??`hosted-scheduled-work`,url:e})).ok||window.open(e,`_blank`,`noopener,noreferrer`)}function Le(){return new Date().toISOString().slice(0,10)}function Re(){return Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`}function ze(e){return e instanceof Error?e.message:String(e)}export{ke as ScheduledWorkPage};