openpond 0.2.67 → 0.2.69

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (573) hide show
  1. package/dist/app-server.d.ts +668 -1
  2. package/dist/app-server.js +1 -1
  3. package/dist/chunks/account-context-V3KLSNKS.js +12 -0
  4. package/dist/chunks/{acp-NASAJV5E.js → acp-ER6CUXG2.js} +1 -1
  5. package/dist/chunks/{acp-agent-C3CRF6DT.js → acp-agent-AYJ5RPVF.js} +1 -1
  6. package/dist/chunks/actions-command-BBUS3HDK.js +2 -0
  7. package/dist/chunks/{app-layer-XIEZ6ALX.js → app-layer-JCEWGUDH.js} +1 -1
  8. package/dist/chunks/{app-server-connected-apps-IB6M35NS.js → app-server-connected-apps-ILXBFD3S.js} +1 -1
  9. package/dist/chunks/app-server-evaluations-RRLYWLPK.js +2 -0
  10. package/dist/chunks/app-server-harness-services-XXM336NU.js +2 -0
  11. package/dist/chunks/app-server-runtime-43MCH5SY.js +2 -0
  12. package/dist/chunks/apps-VNFGMQFG.js +2 -0
  13. package/dist/chunks/{chunk-W3ZILZUL.js → chunk-22RLEU3Q.js} +1 -1
  14. package/dist/chunks/chunk-2PXKSAG6.js +2 -0
  15. package/dist/chunks/{chunk-XEU4J4GJ.js → chunk-2TGHZXJE.js} +2 -2
  16. package/dist/chunks/{chunk-AXO6OHJB.js → chunk-3A2Y7UK3.js} +1 -1
  17. package/dist/chunks/chunk-3Z4VM2LF.js +4 -0
  18. package/dist/chunks/{chunk-V3T2OJBZ.js → chunk-4BUM6JEC.js} +2 -2
  19. package/dist/chunks/chunk-4G3GTEVS.js +23 -0
  20. package/dist/chunks/{chunk-43QYVOYA.js → chunk-4KNPCJR4.js} +1 -1
  21. package/dist/chunks/chunk-4KTGYHCE.js +2 -0
  22. package/dist/chunks/chunk-4PUOWSDE.js +13 -0
  23. package/dist/chunks/chunk-55YD4UTW.js +2 -0
  24. package/dist/chunks/chunk-5G7BQAUA.js +2 -0
  25. package/dist/chunks/chunk-65FJWWXG.js +2 -0
  26. package/dist/chunks/{chunk-4EZI4KCT.js → chunk-65WRWLUD.js} +1 -1
  27. package/dist/chunks/chunk-6D3FI2XT.js +2 -0
  28. package/dist/chunks/chunk-7EQLW2KM.js +12 -0
  29. package/dist/chunks/{chunk-5TPYBXWM.js → chunk-7NCM6GBN.js} +1 -1
  30. package/dist/chunks/chunk-7OFD6TFD.js +2 -0
  31. package/dist/chunks/chunk-7OKZCJHS.js +3 -0
  32. package/dist/chunks/{chunk-ADOCQA4D.js → chunk-7PKDJHT6.js} +1 -1
  33. package/dist/chunks/chunk-7RJOCGQ6.js +2 -0
  34. package/dist/chunks/{chunk-YR5URT73.js → chunk-7RSQOC5M.js} +3 -3
  35. package/dist/chunks/{chunk-FVK4W27G.js → chunk-AFH462DO.js} +1 -1
  36. package/dist/chunks/{chunk-GUG2SWRZ.js → chunk-AFKFN25T.js} +1 -1
  37. package/dist/chunks/chunk-AFYYIJ6K.js +2 -0
  38. package/dist/chunks/{chunk-U3MVH2YT.js → chunk-APKXXAUF.js} +1 -1
  39. package/dist/chunks/chunk-AQUZCWM3.js +2 -0
  40. package/dist/chunks/chunk-AUO5DCEU.js +2 -0
  41. package/dist/chunks/chunk-AYOMVI7J.js +2 -0
  42. package/dist/chunks/{chunk-RWRKUO5D.js → chunk-B66QCXH2.js} +1 -1
  43. package/dist/chunks/chunk-BDZDWHBJ.js +6 -0
  44. package/dist/chunks/chunk-BU6MW65V.js +10 -0
  45. package/dist/chunks/{chunk-P6NQYXN6.js → chunk-CCZ276IA.js} +1 -1
  46. package/dist/chunks/{chunk-YONDU5TN.js → chunk-CIZI6Z7D.js} +1 -1
  47. package/dist/chunks/{chunk-ATFV2NA4.js → chunk-CO23RRN7.js} +1 -1
  48. package/dist/chunks/{chunk-QAFXQHHG.js → chunk-D6L6UNUQ.js} +2 -2
  49. package/dist/chunks/chunk-DDOIPTOM.js +2 -0
  50. package/dist/chunks/{chunk-CSU7RDA5.js → chunk-DKOVZ6R2.js} +3 -3
  51. package/dist/chunks/chunk-DRLP7GIU.js +2 -0
  52. package/dist/chunks/{chunk-XDFXKRTI.js → chunk-DWF3FCY4.js} +1 -1
  53. package/dist/chunks/chunk-DXJC3QW7.js +2 -0
  54. package/dist/chunks/{chunk-IDILAYCW.js → chunk-E2JB5OCO.js} +1 -1
  55. package/dist/chunks/{chunk-GI7LTJV3.js → chunk-EDYCSW22.js} +1 -1
  56. package/dist/chunks/{chunk-4JYTFEND.js → chunk-EFP75UEX.js} +1 -1
  57. package/dist/chunks/{chunk-CX7HKSQ4.js → chunk-EGP6DF34.js} +2 -2
  58. package/dist/chunks/{chunk-D5OFN47Z.js → chunk-ESYPMD7Q.js} +1 -1
  59. package/dist/chunks/{chunk-36FNNR5N.js → chunk-EWDDDHJN.js} +1 -1
  60. package/dist/chunks/{chunk-PWKJ5KLZ.js → chunk-EXYSD45J.js} +1 -1
  61. package/dist/chunks/{chunk-R6VI7MX5.js → chunk-EYTTZ5H4.js} +1 -1
  62. package/dist/chunks/{chunk-WD6ANOLL.js → chunk-FNGZ4UDZ.js} +1 -1
  63. package/dist/chunks/{chunk-YKTJPCYZ.js → chunk-G4FRBT7G.js} +4 -4
  64. package/dist/chunks/{chunk-JFZ6USNQ.js → chunk-G7X73SBG.js} +1 -1
  65. package/dist/chunks/{chunk-ULJZ7NUF.js → chunk-GY7YSD6J.js} +1 -1
  66. package/dist/chunks/{chunk-CWAQOFLP.js → chunk-GYYJ47GX.js} +1 -1
  67. package/dist/chunks/chunk-HG2YFMVU.js +4 -0
  68. package/dist/chunks/{chunk-YQBL5P6R.js → chunk-HKVFU3B3.js} +1 -1
  69. package/dist/chunks/{chunk-VEXJV5H5.js → chunk-IIT66347.js} +4 -4
  70. package/dist/chunks/{chunk-B2K5WQZE.js → chunk-IO5DZUKL.js} +1 -1
  71. package/dist/chunks/chunk-J256AEEE.js +2 -0
  72. package/dist/chunks/{chunk-CRDKBFRN.js → chunk-JEMECEQH.js} +1 -1
  73. package/dist/chunks/{chunk-YMCF5GR2.js → chunk-JQOVC35K.js} +1 -1
  74. package/dist/chunks/{chunk-6LFTQBXP.js → chunk-JT5YQ52I.js} +1 -1
  75. package/dist/chunks/chunk-JVMSN7LH.js +2 -0
  76. package/dist/chunks/{chunk-HORMGT2Q.js → chunk-JXYJQT5Q.js} +1 -1
  77. package/dist/chunks/{chunk-WDKZMXIU.js → chunk-K7KBFM2T.js} +1 -1
  78. package/dist/chunks/{chunk-UBTP3QWI.js → chunk-KCLMA2IH.js} +1 -1
  79. package/dist/chunks/chunk-KDER7R45.js +2 -0
  80. package/dist/chunks/{chunk-R6MMWEH4.js → chunk-KP2MYTP5.js} +1 -1
  81. package/dist/chunks/{chunk-TV2LE2BD.js → chunk-KU4TPDPH.js} +2 -2
  82. package/dist/chunks/{chunk-WJSJXK2N.js → chunk-KUE46HTH.js} +1 -1
  83. package/dist/chunks/chunk-LSKMALD6.js +161 -0
  84. package/dist/chunks/chunk-LVXL7T5O.js +2 -0
  85. package/dist/chunks/{chunk-TSQ2I6XV.js → chunk-M4A7G4S5.js} +2 -2
  86. package/dist/chunks/{chunk-MX7KV5DA.js → chunk-M4ZHFDRJ.js} +1 -1
  87. package/dist/chunks/chunk-M5X7XKXY.js +12 -0
  88. package/dist/chunks/{chunk-XT5WUQGT.js → chunk-MIFVX5PK.js} +1 -1
  89. package/dist/chunks/{chunk-4VZJQRQI.js → chunk-MOXIGLN2.js} +1 -1
  90. package/dist/chunks/{chunk-UKSSFB4Q.js → chunk-N5EAVX4G.js} +1 -1
  91. package/dist/chunks/{chunk-4B7EGNYX.js → chunk-NMMHXYDJ.js} +1 -1
  92. package/dist/chunks/{chunk-EBOTNBUS.js → chunk-NRYC4NH6.js} +1 -1
  93. package/dist/chunks/chunk-NSSZ2ZIU.js +2 -0
  94. package/dist/chunks/chunk-NW6WGGSL.js +2 -0
  95. package/dist/chunks/{chunk-7P5SH3CI.js → chunk-NZDLL6JN.js} +1 -1
  96. package/dist/chunks/{chunk-4TTXNVCE.js → chunk-OFJPOTES.js} +1 -1
  97. package/dist/chunks/chunk-OUJ63LMU.js +2 -0
  98. package/dist/chunks/{chunk-SD2XDZQW.js → chunk-P4QM63L3.js} +1 -1
  99. package/dist/chunks/chunk-PACLKDTN.js +2 -0
  100. package/dist/chunks/{chunk-VPAEFG7X.js → chunk-PAYFJHPO.js} +1 -1
  101. package/dist/chunks/{chunk-OPTJYDZN.js → chunk-PHZZBXDO.js} +1 -1
  102. package/dist/chunks/{chunk-HPTEJBP4.js → chunk-PKJHN666.js} +1 -1
  103. package/dist/chunks/{chunk-HNDAGZCF.js → chunk-PLROXHG2.js} +1 -1
  104. package/dist/chunks/{chunk-UNE52L3Y.js → chunk-PNPV2LDE.js} +1 -1
  105. package/dist/chunks/{chunk-2RSGVLZT.js → chunk-PSY6IRJE.js} +8 -8
  106. package/dist/chunks/{chunk-SVNEPXU3.js → chunk-Q73RKX7I.js} +1 -1
  107. package/dist/chunks/{chunk-IF5A3XWP.js → chunk-Q7FBVLLB.js} +1 -1
  108. package/dist/chunks/{chunk-V5AOM5MZ.js → chunk-Q7P34B2O.js} +1 -1
  109. package/dist/chunks/{chunk-375PADDM.js → chunk-QLGP2OAQ.js} +1 -1
  110. package/dist/chunks/{chunk-QQLS5FB7.js → chunk-QUNQM2E3.js} +1 -1
  111. package/dist/chunks/chunk-R2FYCJL6.js +2 -0
  112. package/dist/chunks/{chunk-6HQUIKC5.js → chunk-R4EEGWXB.js} +1 -1
  113. package/dist/chunks/chunk-R6I623SZ.js +11 -0
  114. package/dist/chunks/chunk-RCQYEHHD.js +2 -0
  115. package/dist/chunks/{chunk-26ID6A5C.js → chunk-RCRZXHAI.js} +1 -1
  116. package/dist/chunks/{chunk-TGULVWPV.js → chunk-RFQD6B44.js} +1 -1
  117. package/dist/chunks/{chunk-3WJQ4IGK.js → chunk-RPM4FDRX.js} +1 -1
  118. package/dist/chunks/{chunk-MCBRB5D6.js → chunk-RY46UPBO.js} +4 -4
  119. package/dist/chunks/{chunk-K3LS5SK7.js → chunk-SDHG6CKU.js} +1 -1
  120. package/dist/chunks/{chunk-XKZ4PFMQ.js → chunk-SO4GMSNP.js} +1 -1
  121. package/dist/chunks/{chunk-O6ZYDHEJ.js → chunk-SSHE6B7Z.js} +1 -1
  122. package/dist/chunks/{chunk-SH7POUVX.js → chunk-SV7ZBEK2.js} +6 -6
  123. package/dist/chunks/{chunk-SODAOLAP.js → chunk-TB5P3FWM.js} +1 -1
  124. package/dist/chunks/{chunk-BJXPQIVD.js → chunk-U7D6Q744.js} +1 -1
  125. package/dist/chunks/chunk-U7X5ZLAL.js +2 -0
  126. package/dist/chunks/{chunk-N54CPLVD.js → chunk-UANH7U3Y.js} +1 -1
  127. package/dist/chunks/{chunk-BUZ7CBJC.js → chunk-UGFSAG4U.js} +1 -1
  128. package/dist/chunks/chunk-ULTV6INR.js +2 -0
  129. package/dist/chunks/{chunk-V3ILZQER.js → chunk-UMAVVMXL.js} +7 -7
  130. package/dist/chunks/chunk-V24VHT76.js +2 -0
  131. package/dist/chunks/chunk-VEBW7NKD.js +2 -0
  132. package/dist/chunks/chunk-VJR2GNRY.js +2 -0
  133. package/dist/chunks/{chunk-JD76ANPN.js → chunk-VJYOKU3C.js} +1 -1
  134. package/dist/chunks/{chunk-H2XG5N7D.js → chunk-VWWKWYSQ.js} +1 -1
  135. package/dist/chunks/chunk-WCNPGKST.js +2 -0
  136. package/dist/chunks/chunk-WD4KAKEX.js +2 -0
  137. package/dist/chunks/chunk-WGQ3FMRF.js +2 -0
  138. package/dist/chunks/{chunk-6C3CXME7.js → chunk-WNXUSELC.js} +1 -1
  139. package/dist/chunks/{chunk-RS526BG7.js → chunk-WZ35ICTE.js} +3 -3
  140. package/dist/chunks/chunk-XHACK2KR.js +2 -0
  141. package/dist/chunks/chunk-XOPHFUUY.js +2 -0
  142. package/dist/chunks/{chunk-ZVMQLIRA.js → chunk-XT4CSKHM.js} +1 -1
  143. package/dist/chunks/{chunk-KQD36SBJ.js → chunk-XY7HFXLH.js} +1 -1
  144. package/dist/chunks/{chunk-UXO33ST5.js → chunk-XYZV3FKD.js} +1 -1
  145. package/dist/chunks/{chunk-GC6RJBRZ.js → chunk-Y2WNZWT2.js} +1 -1
  146. package/dist/chunks/chunk-Y4I6CFZJ.js +2 -0
  147. package/dist/chunks/chunk-YDZBX4XQ.js +2 -0
  148. package/dist/chunks/chunk-YI6ME6PU.js +22 -0
  149. package/dist/chunks/{chunk-H42UW6IF.js → chunk-YXMYK5P7.js} +1 -1
  150. package/dist/chunks/{chunk-QFL2VQKX.js → chunk-Z33RVGP6.js} +1 -1
  151. package/dist/chunks/chunk-Z5CQXPIS.js +6 -0
  152. package/dist/chunks/{chunk-OY4B7Y3T.js → chunk-ZDEIVUUI.js} +1 -1
  153. package/dist/chunks/{chunk-XGJG2ZKE.js → chunk-ZIQJDTQB.js} +1 -1
  154. package/dist/chunks/{chunk-IR2Y2VQY.js → chunk-ZYLLPRPU.js} +1 -1
  155. package/dist/chunks/cli-R7TAP6Z2.js +2 -0
  156. package/dist/chunks/{command-NWOZXU57.js → command-LNOVZQSK.js} +3 -3
  157. package/dist/chunks/{configuration-command-ZEIBQKB3.js → configuration-command-C3QBDFND.js} +1 -1
  158. package/dist/chunks/connected-app-executor-LAEAQUJS.js +2 -0
  159. package/dist/chunks/connected-evidence-VKY6O2JW.js +2 -0
  160. package/dist/chunks/{connected-starting-assets-66Y46ZPM.js → connected-starting-assets-5LAJ7CZY.js} +1 -1
  161. package/dist/chunks/{connection-GDWPMHPC.js → connection-VMBXW5PD.js} +1 -1
  162. package/dist/chunks/{continual-TNPTWTKK.js → continual-FVOLGGOE.js} +1 -1
  163. package/dist/chunks/core-commands-5TNBVR72.js +2 -0
  164. package/dist/chunks/dataset-preparation-authoring-UUYFWWCT.js +4 -0
  165. package/dist/chunks/datasets-BIDZJYDC.js +2 -0
  166. package/dist/chunks/desktop-test-BY2MS3UL.js +3 -0
  167. package/dist/chunks/dist-2MKJC6HN.js +2 -0
  168. package/dist/chunks/{dist-GR56E3QK.js → dist-DKE7RJZN.js} +1 -1
  169. package/dist/chunks/evaluation-coordination-FXB4DXZA.js +2 -0
  170. package/dist/chunks/experiment-improvements-JPDLKZXD.js +2 -0
  171. package/dist/chunks/experiments-IEN7RXLX.js +2 -0
  172. package/dist/chunks/experiments-signal-L32D36NH.js +2 -0
  173. package/dist/chunks/{extension-UH34ZF7N.js → extension-3EKIT6BB.js} +1 -1
  174. package/dist/chunks/{help-O53DTZGN.js → help-PLQJOP4P.js} +1 -1
  175. package/dist/chunks/host-profile-evaluation-tools-UF4ATIUF.js +2 -0
  176. package/dist/chunks/host-profile-external-dataset-KSEPXY2S.js +2 -0
  177. package/dist/chunks/hosted-app-server-composition-GZES7QXJ.js +2 -0
  178. package/dist/chunks/hosted-experiment-improvement-VG2WE7XZ.js +3 -0
  179. package/dist/chunks/hosted-harness-runtime-MMTLCL23.js +2 -0
  180. package/dist/chunks/hosted-profile-candidate-PTGQLPZO.js +3 -0
  181. package/dist/chunks/hosted-profile-compiler-FS5R6CHJ.js +2 -0
  182. package/dist/chunks/hosted-profile-evaluation-control-UUEZEMXU.js +2 -0
  183. package/dist/chunks/hosted-profile-evaluation-inspection-4F7OEF4T.js +3 -0
  184. package/dist/chunks/hosted-profile-evaluation-preparation-LIJJZDHQ.js +3 -0
  185. package/dist/chunks/hosted-tasksets-V24IBVJX.js +2 -0
  186. package/dist/chunks/human-review-6V6EMNVN.js +2 -0
  187. package/dist/chunks/{import-OBAKUJPM.js → import-SI24Z7EF.js} +2 -2
  188. package/dist/chunks/{learning-CRR6NRPN.js → learning-LAXMGWSQ.js} +1 -1
  189. package/dist/chunks/learning-Y3UKNUGE.js +2 -0
  190. package/dist/chunks/local-harness-improvement-runtime-3YJQRYXC.js +2 -0
  191. package/dist/chunks/local-harness-taskset-review-XQHQ6JCR.js +2 -0
  192. package/dist/chunks/{model-projects-HP4DELCP.js → model-projects-6YWVD2TS.js} +1 -1
  193. package/dist/chunks/opchat-SV67HVMX.js +3 -0
  194. package/dist/chunks/opchat-bounded-chat-KLMIYSZZ.js +2 -0
  195. package/dist/chunks/organizations-OZZFX7RG.js +2 -0
  196. package/dist/chunks/{profile-3WZJ65CT.js → profile-TD5U3INY.js} +1 -1
  197. package/dist/chunks/project-action-payload-TK6G4VMC.js +2 -0
  198. package/dist/chunks/project-agent-FFXPNXCO.js +2 -0
  199. package/dist/chunks/published-experiment-source-SDXUVPE7.js +2 -0
  200. package/dist/chunks/refiner-profile-service-56VYLZQJ.js +2 -0
  201. package/dist/chunks/{runtime-XP4DEGR3.js → runtime-Q7JUJO4D.js} +2 -2
  202. package/dist/chunks/sandbox-command-4BCUDAED.js +2 -0
  203. package/dist/chunks/{sandbox-template-YFMHEMUQ.js → sandbox-template-GOY7QQUY.js} +1 -1
  204. package/dist/chunks/saved-work-M6PUHKCC.js +2 -0
  205. package/dist/chunks/{send-turn-D3GTSSHI.js → send-turn-YLY3YNEQ.js} +1 -1
  206. package/dist/chunks/setup-RMZ2BHLM.js +2 -0
  207. package/dist/chunks/{src-GQPWOPYA.js → src-C3ZUESMK.js} +1 -1
  208. package/dist/chunks/src-MT4B43TD.js +424 -0
  209. package/dist/chunks/standalone-experiment-turn-owner-TW5MTWIO.js +2 -0
  210. package/dist/chunks/store-chat-resources-IRHBW2EC.js +2 -0
  211. package/dist/chunks/{store-continual-support-reviews-VVRQO2JK.js → store-continual-support-reviews-3KK42L4I.js} +1 -1
  212. package/dist/chunks/store-conversation-serving-IVURK52V.js +2 -0
  213. package/dist/chunks/{store-create-improve-2XI36AET.js → store-create-improve-UTCLBXF2.js} +1 -1
  214. package/dist/chunks/{store-datasets-UFY422NG.js → store-datasets-4AQOVAQY.js} +1 -1
  215. package/dist/chunks/store-evaluation-results-PK2P3IMH.js +7 -0
  216. package/dist/chunks/{store-harness-workspaces-SGUEYDO2.js → store-harness-workspaces-YEXB4IRV.js} +1 -1
  217. package/dist/chunks/store-human-review-O4BVHP25.js +7 -0
  218. package/dist/chunks/store-learned-preference-migration-validation-44SVX6YB.js +2 -0
  219. package/dist/chunks/{store-learning-BFOT4QVT.js → store-learning-SIUQIY5C.js} +1 -1
  220. package/dist/chunks/{store-learning-credentials-DYTMWQTC.js → store-learning-credentials-BUHR7SN6.js} +1 -1
  221. package/dist/chunks/store-local-experiments-BHVTKPPE.js +97 -0
  222. package/dist/chunks/store-model-batch-review-RVAYUVK2.js +2 -0
  223. package/dist/chunks/{store-model-configuration-NJFWSYSA.js → store-model-configuration-6L3OYXF4.js} +1 -1
  224. package/dist/chunks/store-model-project-preparation-AAEKCF6V.js +2 -0
  225. package/dist/chunks/store-modification-recordings-LCPK6K2T.js +9 -0
  226. package/dist/chunks/{store-preference-comparison-MZAYONCK.js → store-preference-comparison-5YVIQNVB.js} +1 -1
  227. package/dist/chunks/{store-sidebar-file-bookmarks-J3JEVAYR.js → store-sidebar-file-bookmarks-WLMYDA4E.js} +1 -1
  228. package/dist/chunks/{store-sidebar-preferences-2JHTFXJK.js → store-sidebar-preferences-AFMYIDWT.js} +1 -1
  229. package/dist/chunks/{store-subagents-PUBQVWSU.js → store-subagents-KFPVSTRO.js} +1 -1
  230. package/dist/chunks/{store-task-inbox-3BREANOX.js → store-task-inbox-L6IQTY26.js} +1 -1
  231. package/dist/chunks/{store-task-inventory-5HRZCDUT.js → store-task-inventory-QWS2C656.js} +1 -1
  232. package/dist/chunks/store-taskset-drafts-FRFL6ITK.js +9 -0
  233. package/dist/chunks/{store-training-S3FXWLT6.js → store-training-FYXZU2FE.js} +1 -1
  234. package/dist/chunks/{store-training-jobs-2LCXPA7G.js → store-training-jobs-3N3VKPIY.js} +1 -1
  235. package/dist/chunks/{store-training-models-7AMKS7ZW.js → store-training-models-VOFVGPZR.js} +1 -1
  236. package/dist/chunks/{taskset-PLKWRT4X.js → taskset-UDDLFYKV.js} +1 -1
  237. package/dist/chunks/taskset-catalog-RZYEBCRQ.js +2 -0
  238. package/dist/chunks/taskset-packages-T6B6HYKZ.js +2 -0
  239. package/dist/chunks/taskset-packages-WMG5DUBN.js +2 -0
  240. package/dist/chunks/{teams-bot-VQXUA7U4.js → teams-bot-YCUTDDDC.js} +1 -1
  241. package/dist/chunks/tool-learning-ZQ6NSJ5K.js +2 -0
  242. package/dist/chunks/training-5NT2YB2L.js +2 -0
  243. package/dist/chunks/training-5UMT45UL.js +2 -0
  244. package/dist/chunks/training-UY6KRG4M.js +2 -0
  245. package/dist/chunks/{training-error-LQKCOQDJ.js → training-error-WF463UNZ.js} +1 -1
  246. package/dist/chunks/{training-hardware-ESXRWUIK.js → training-hardware-UWQCRDMV.js} +1 -1
  247. package/dist/chunks/training-hosted-CKSDRVL6.js +2 -0
  248. package/dist/chunks/training-hosted-alphaedit-HSMRDJTD.js +2 -0
  249. package/dist/chunks/training-hosted-decision-7JALOU6O.js +2 -0
  250. package/dist/chunks/training-hosted-engram-SXO75MFG.js +2 -0
  251. package/dist/chunks/{training-hosted-learning-WQ2IP5FP.js → training-hosted-learning-E2N32YU5.js} +1 -1
  252. package/dist/chunks/training-hosted-modification-comparison-TXFDJFTG.js +2 -0
  253. package/dist/chunks/training-hosted-neuron-training-J42WK4EH.js +2 -0
  254. package/dist/chunks/training-hosted-serving-report-BAEABGJH.js +2 -0
  255. package/dist/chunks/training-hosted-steering-T556BUBG.js +2 -0
  256. package/dist/chunks/training-model-start-P3PXDWNT.js +2 -0
  257. package/dist/chunks/web-search-ZEKJHZW4.js +2 -0
  258. package/dist/chunks/{workspaces-MCS2AQX6.js → workspaces-EK62ANTB.js} +1 -1
  259. package/dist/cli.js +1 -1
  260. package/dist/index.js +1 -1
  261. package/dist/sandbox/runtime-handle.d.ts +3 -5
  262. package/dist/sandbox/sandbox-instance-client.d.ts +11 -5
  263. package/dist/sandbox/types/billing.d.ts +140 -6
  264. package/dist/sandbox/types/io.d.ts +3 -0
  265. package/dist/sandbox/types/responses.d.ts +11 -1
  266. package/dist/sandbox/types/snapshots.d.ts +52 -3
  267. package/dist/sandbox-template/manifest.js +1 -1
  268. package/dist/skills/manifest.json +3 -3
  269. package/dist/skills/openpond-cli/references/experiments-and-training.md +461 -1
  270. package/dist/web/assets/App-CCuh99JW.js +54 -0
  271. package/dist/web/assets/{AppDialog-BvskhHE9.js → AppDialog-CxjDHVk9.js} +1 -1
  272. package/dist/web/assets/AppTerminalPanel-CKJIVpKa.js +2 -0
  273. package/dist/web/assets/{AppToastContext-D2788RqX.js → AppToastContext-EpiT1dHs.js} +1 -1
  274. package/dist/web/assets/AppsView-BsMyPX_3.js +1 -0
  275. package/dist/web/assets/{AttachmentTypeIcon-DVluUHuc.js → AttachmentTypeIcon-BXvZy5gB.js} +1 -1
  276. package/dist/web/assets/BrowserSidebar-BIIV4aq4.js +1 -0
  277. package/dist/web/assets/{CartesianChart-DdBZ69lI.js → CartesianChart-brqLBqnF.js} +1 -1
  278. package/dist/web/assets/ChatTimelineEntry-CwZbn16X.js +8 -0
  279. package/dist/web/assets/{CollaborationTabs-ba6WupeJ.js → CollaborationTabs-BU4uc4tZ.js} +1 -1
  280. package/dist/web/assets/{CommandMenu-D7wTaEgl.js → CommandMenu-DkWpXR55.js} +1 -1
  281. package/dist/web/assets/CommunityView-CsSxJZGn.js +1 -0
  282. package/dist/web/assets/{ComposerAttachments-aO90qXYz.js → ComposerAttachments-BdJGCYzI.js} +1 -1
  283. package/dist/web/assets/{ComposerCreateImproveStrip-BPUJBSyS.js → ComposerCreateImproveStrip-CWy0j1vv.js} +1 -1
  284. package/dist/web/assets/{ConversationImportsSettings-Bo836wKJ.js → ConversationImportsSettings-DCmiakbZ.js} +1 -1
  285. package/dist/web/assets/DatasetReviewImport-DEnF_pGu.js +1 -0
  286. package/dist/web/assets/ExperimentTrainingDataWorkspace-WhwQ0QBi.js +2 -0
  287. package/dist/web/assets/{FilePagePreview-C6wIp6uX.js → FilePagePreview-BRhhz99q.js} +2 -2
  288. package/dist/web/assets/{GetStartedView-CxMv8q-h.js → GetStartedView-CLVD-qEi.js} +1 -1
  289. package/dist/web/assets/{GettingStartedDialog-CEb0cS-o.js → GettingStartedDialog-CMxaAMg-.js} +1 -1
  290. package/dist/web/assets/HostedModelLearningReview-Cn-j-rDo.js +1 -0
  291. package/dist/web/assets/HostedModelLearningSettings-VNBvf38S.js +1 -0
  292. package/dist/web/assets/{HtmlVisual-CCuUkYT8.js → HtmlVisual-D5y2WG9L.js} +10 -10
  293. package/dist/web/assets/LabModelVersionDetailPage-BxRmYD6h.js +1 -0
  294. package/dist/web/assets/{TrainingRunLineage-PXzWR65d.css → LabModelWorkspace-DOrgCk9Z.css} +1 -1
  295. package/dist/web/assets/LabModelWorkspace-u2Ulm_z4.js +1 -0
  296. package/dist/web/assets/{LabSkillSidebar-CFROlATQ.js → LabSkillSidebar-C7IceJTJ.js} +1 -1
  297. package/dist/web/assets/LabsRoute-C9Y0GU34.css +1 -0
  298. package/dist/web/assets/LabsRoute-CbztQaEf.js +74 -0
  299. package/dist/web/assets/LearningBatchesPage-B1NZTBSv.css +1 -0
  300. package/dist/web/assets/LearningBatchesPage-CJqgZNvM.js +26 -0
  301. package/dist/web/assets/MainChatThread-DNMfrrRq.js +2 -0
  302. package/dist/web/assets/{MainPane-BOWkynGB.css → MainPane-BZlNLfTM.css} +1 -1
  303. package/dist/web/assets/MainPane-CQQxSDPS.js +13 -0
  304. package/dist/web/assets/ModelProjectPageHeader-Dge19aE1.js +1 -0
  305. package/dist/web/assets/NativeSetupTerminal-D4JnbpyD.js +2 -0
  306. package/dist/web/assets/{NativeSkillSidebar-MAJWS4mL.js → NativeSkillSidebar-Jzx1BeKV.js} +1 -1
  307. package/dist/web/assets/{NewProjectDialog-MQiUBVx3.js → NewProjectDialog-DcnGzEd9.js} +1 -1
  308. package/dist/web/assets/{OutputsPage-DpF-aRTu.js → OutputsPage-Cmk15Vt_.js} +1 -1
  309. package/dist/web/assets/{PageChrome-8gH2hyDb.js → PageChrome-Cz_fCqtn.js} +1 -1
  310. package/dist/web/assets/{ProjectsPage-BQ98oGyu.js → ProjectsPage-BZ3Eo3Mz.js} +1 -1
  311. package/dist/web/assets/RightChatPanelStack-C6H2vU9N.js +1 -0
  312. package/dist/web/assets/RightSidebarHomePanel-BfMMVkM1.js +1 -0
  313. package/dist/web/assets/{ScheduledWorkPage-CGCqZz_H.js → ScheduledWorkPage-CAkSwM0T.js} +1 -1
  314. package/dist/web/assets/{SettingsView-CqpMFLxy.js → SettingsView-DvQXGw3_.js} +3 -3
  315. package/dist/web/assets/{TasksetDraftEditorPrimitives-DJvIvzBb.js → TasksetDraftEditorPrimitives-JuU1k8vr.js} +1 -1
  316. package/dist/web/assets/TeamChatView-DmHjr8W9.js +1 -0
  317. package/dist/web/assets/{TerminalOverlay-D--M876l.js → TerminalOverlay-DlaM9d8F.js} +1 -1
  318. package/dist/web/assets/{TrainingCreationPanel-DDUoHQHU.js → TrainingCreationPanel-ClpylNsr.js} +1 -1
  319. package/dist/web/assets/{TrainingDraftPanel-CwLXn3Z7.js → TrainingDraftPanel-6tH2xSDj.js} +1 -1
  320. package/dist/web/assets/{UsageSettingsSection-CGwPregx.js → UsageSettingsSection-CzDqxOYM.js} +2 -2
  321. package/dist/web/assets/WorkSidebarPanel-CY-AHZ4-.js +1 -0
  322. package/dist/web/assets/WorkspaceDiffPanel-B4e0lyF7.js +11 -0
  323. package/dist/web/assets/WorkspaceEnvironmentMenu-D01ZkZZF.js +35 -0
  324. package/dist/web/assets/{WorkspaceFileLocation-D-ctFM4d.js → WorkspaceFileLocation-C5s_njZb.js} +1 -1
  325. package/dist/web/assets/{WorkspaceGitDialogs-CQ28j3R7.js → WorkspaceGitDialogs-DjPZ6KIh.js} +1 -1
  326. package/dist/web/assets/{WorkspaceMonacoEditor-BrZs6-EW.js → WorkspaceMonacoEditor-CC4sfOiU.js} +3 -3
  327. package/dist/web/assets/{WorkspacePdfPreview-CU6PSjjN.js → WorkspacePdfPreview-vszQqFa4.js} +2 -2
  328. package/dist/web/assets/{WorkspacePresentationPreview-IjXVXpIy.js → WorkspacePresentationPreview-DQTvhaRD.js} +1 -1
  329. package/dist/web/assets/api-client-DJRVOFzS.js +1 -0
  330. package/dist/web/assets/{app-models-CKXrDTEU.js → app-models-BUdzQbXo.js} +1 -1
  331. package/dist/web/assets/bot-Doyx3T4j.js +1 -0
  332. package/dist/web/assets/{browser-sidebar-links-D9v2cyJa.js → browser-sidebar-links-PVPCrsDJ.js} +1 -1
  333. package/dist/web/assets/chat-resources-Beh5lB36.js +1 -0
  334. package/dist/web/assets/chevron-down-DX1hzujj.js +1 -0
  335. package/dist/web/assets/chevron-right-DHN0y3KC.js +1 -0
  336. package/dist/web/assets/chevron-up-_QrW88NF.js +1 -0
  337. package/dist/web/assets/{chunk-TLSP5JKG-BrrVo5rJ.js → chunk-3BYFS4RO-ztZjcMmt.js} +1 -1
  338. package/dist/web/assets/chunk-AG6UJ3DI-D9KZjTYP.js +1 -0
  339. package/dist/web/assets/chunk-C3TS766N-ppRhs95p.js +1 -0
  340. package/dist/web/assets/chunk-GCUWJUUM-Dy6oUNJ6.js +9 -0
  341. package/dist/web/assets/chunk-GS5HEE4M-C0RLeIsy.js +1 -0
  342. package/dist/web/assets/{chunk-H3JZ3P5T-CzpTARDY.js → chunk-H3JZ3P5T-DolwEJXo.js} +2 -2
  343. package/dist/web/assets/chunk-Q4RGCEOI-Cr-dg4Nk.js +1 -0
  344. package/dist/web/assets/client-DwZ92xtu.js +1 -0
  345. package/dist/web/assets/{client-choice-storage-DUWsS4X0.js → client-choice-storage-DitqKiIT.js} +1 -1
  346. package/dist/web/assets/cloud-upload-HdzNTgr2.js +1 -0
  347. package/dist/web/assets/common-BWVSBnpX.js +1 -0
  348. package/dist/web/assets/copy-DTQhoBNg.js +1 -0
  349. package/dist/web/assets/create-pipeline-DsZzNkt9.js +1 -0
  350. package/dist/web/assets/{cssMode-SclUkqPt.js → cssMode-BRTtfXxU.js} +1 -1
  351. package/dist/web/assets/dataset-workspaces-BTPi71mz.js +1 -0
  352. package/dist/web/assets/external-link-H1629UU6.js +1 -0
  353. package/dist/web/assets/folder-open-CAGdWOrr.js +1 -0
  354. package/dist/web/assets/folder-plus-C14cs2mE.js +1 -0
  355. package/dist/web/assets/git-commit-horizontal-DFUfuVvF.js +1 -0
  356. package/dist/web/assets/{htmlMode-X3mQtOeh.js → htmlMode-BVaCcL76.js} +1 -1
  357. package/dist/web/assets/icons-Bk2b68aC.js +1 -0
  358. package/dist/web/assets/image-0DPVY6Ev.js +1 -0
  359. package/dist/web/assets/{index-LXNhSUEL.js → index-B6XX_0h3.js} +2 -2
  360. package/dist/web/assets/info-C8b_tafZ.js +1 -0
  361. package/dist/web/assets/{intake-contracts-wCkD2ErR.js → intake-contracts-B8JZKYwb.js} +1 -1
  362. package/dist/web/assets/{jsonMode-BoKiIdHd.js → jsonMode-BCKKQmmV.js} +1 -1
  363. package/dist/web/assets/loader-circle-y-SSPwpk.js +1 -0
  364. package/dist/web/assets/{lspLanguageFeatures-CO2mzpy1.js → lspLanguageFeatures-DozmNUOx.js} +1 -1
  365. package/dist/web/assets/maximize-2-CByk9-zN.js +1 -0
  366. package/dist/web/assets/message-square-C889vRqm.js +1 -0
  367. package/dist/web/assets/{monaco.contribution-wacA5FjV.js → monaco.contribution-B9q6qbbo.js} +2 -2
  368. package/dist/web/assets/{monaco.contribution-CVe3mWSY.js → monaco.contribution-BITdsRbn.js} +2 -2
  369. package/dist/web/assets/{monaco.contribution-hrusiaZi.js → monaco.contribution-BqA-XZ44.js} +2 -2
  370. package/dist/web/assets/{monaco.contribution-C7CAQIKF.js → monaco.contribution-DxAV1oS5.js} +2 -2
  371. package/dist/web/assets/monitor-BtxlcLuI.js +1 -0
  372. package/dist/web/assets/paperclip-BeIdaspf.js +1 -0
  373. package/dist/web/assets/{pdf-Ct3M2mVw.js → pdf-perlzwEB.js} +1 -1
  374. package/dist/web/assets/play-CHXXdkuO.js +1 -0
  375. package/dist/web/assets/plus-DFFWjhPw.js +1 -0
  376. package/dist/web/assets/{ponder-desktop-D-zB6X4L.js → ponder-desktop-Ca-9KggQ.js} +1 -1
  377. package/dist/web/assets/presentation-0bzvu6_u.js +1 -0
  378. package/dist/web/assets/{profile-ref-CCxrOCio.js → profile-ref-D8lxL7dW.js} +1 -1
  379. package/dist/web/assets/{python-C0-pUUAU.js → python-B9hOnkOI.js} +1 -1
  380. package/dist/web/assets/refresh-cw-D61-Ozk3.js +1 -0
  381. package/dist/web/assets/{requests-DjSt-duM.js → requests-DmeUYik4.js} +1 -1
  382. package/dist/web/assets/reward-checks-DJJZYgf8.js +7 -0
  383. package/dist/web/assets/save-iEMNZoPe.js +1 -0
  384. package/dist/web/assets/schemas-Brv9Vmnk.js +64 -0
  385. package/dist/web/assets/settings-BC-bzgk6.js +21 -0
  386. package/dist/web/assets/settings-lists-C84qxFmP.js +5 -0
  387. package/dist/web/assets/square-BE_4JMR3.js +1 -0
  388. package/dist/web/assets/square-terminal-Djpzo2Qs.js +1 -0
  389. package/dist/web/assets/{submit-issue-command-Gk3RKrY-.js → submit-issue-command-HfKzyxg5.js} +1 -1
  390. package/dist/web/assets/{toggleHighContrast-BnYUBgZB.js → toggleHighContrast-ClsXu39R.js} +1 -1
  391. package/dist/web/assets/training-DWfghwfZ.js +1 -0
  392. package/dist/web/assets/{training-model-data-CxR3xpmK.js → training-model-data-CIysl8wH.js} +4 -4
  393. package/dist/web/assets/{tsMode-BVNyOY8h.js → tsMode-nbmaMc-D.js} +1 -1
  394. package/dist/web/assets/upload-C6ug8RD-.js +1 -0
  395. package/dist/web/assets/{useAccountSettings-4_XfwJQi.js → useAccountSettings-Dr9h4Qz_.js} +1 -1
  396. package/dist/web/assets/{useAgentInventory-CVuamyT3.js → useAgentInventory-ByCk2JAv.js} +1 -1
  397. package/dist/web/assets/useChatContextSelection-C0eMm2g6.js +1 -0
  398. package/dist/web/assets/{useLocalAgentSchedules-CmwN4ohy.js → useLocalAgentSchedules-Do0y_leJ.js} +1 -1
  399. package/dist/web/assets/useQuery-D2MQ7e5U.js +1 -0
  400. package/dist/web/assets/wifi-off-Dr-CapyW.js +1 -0
  401. package/dist/web/assets/work-outputs-D_8TovAK.js +1 -0
  402. package/dist/web/assets/{workers-CjtQ2aBD.js → workers-DKvM2NdM.js} +1 -1
  403. package/dist/web/assets/x-Jx2jlP9u.js +1 -0
  404. package/dist/web/assets/{yaml-N1KUjBZ8.js → yaml-C02vq4ar.js} +1 -1
  405. package/dist/web/index.html +1 -1
  406. package/docs/command-reference.md +104 -3
  407. package/package.json +1 -1
  408. package/dist/chunks/account-context-TIJOM22A.js +0 -12
  409. package/dist/chunks/actions-command-BYPLSGZL.js +0 -2
  410. package/dist/chunks/app-server-evaluations-5YZUFXQ2.js +0 -2
  411. package/dist/chunks/app-server-harness-services-N5F5QVZI.js +0 -2
  412. package/dist/chunks/app-server-runtime-HJ2N57DL.js +0 -2
  413. package/dist/chunks/apps-WJTW64NW.js +0 -2
  414. package/dist/chunks/chunk-263WS3TB.js +0 -2
  415. package/dist/chunks/chunk-27JGS3KB.js +0 -12
  416. package/dist/chunks/chunk-2UZHLO2V.js +0 -23
  417. package/dist/chunks/chunk-2W22IXHB.js +0 -2
  418. package/dist/chunks/chunk-46RMTR2Z.js +0 -2
  419. package/dist/chunks/chunk-4JJ4RYIB.js +0 -6
  420. package/dist/chunks/chunk-4NN5OLKW.js +0 -161
  421. package/dist/chunks/chunk-543QHE3D.js +0 -2
  422. package/dist/chunks/chunk-5QOFUGYQ.js +0 -2
  423. package/dist/chunks/chunk-5ZNE43XC.js +0 -10
  424. package/dist/chunks/chunk-6IS5OLI5.js +0 -2
  425. package/dist/chunks/chunk-7HAGSE7L.js +0 -2
  426. package/dist/chunks/chunk-AXYAEWWA.js +0 -2
  427. package/dist/chunks/chunk-B7XJBP4U.js +0 -2
  428. package/dist/chunks/chunk-BBIA24GD.js +0 -10
  429. package/dist/chunks/chunk-CJDGLPNX.js +0 -4
  430. package/dist/chunks/chunk-DAEUVT2I.js +0 -6
  431. package/dist/chunks/chunk-FCXDPVGJ.js +0 -3
  432. package/dist/chunks/chunk-FE2ENE3U.js +0 -2
  433. package/dist/chunks/chunk-H6EUFJJK.js +0 -2
  434. package/dist/chunks/chunk-IOSBGCRT.js +0 -2
  435. package/dist/chunks/chunk-IXZ5ZGIL.js +0 -12
  436. package/dist/chunks/chunk-K6DB5QWG.js +0 -2
  437. package/dist/chunks/chunk-LI56PPCN.js +0 -2
  438. package/dist/chunks/chunk-OE2OOWEQ.js +0 -2
  439. package/dist/chunks/chunk-OYIFH2OM.js +0 -2
  440. package/dist/chunks/chunk-QOUOU7FE.js +0 -22
  441. package/dist/chunks/chunk-R5GRESW3.js +0 -2
  442. package/dist/chunks/chunk-TERKCK4I.js +0 -2
  443. package/dist/chunks/chunk-TS5HNRZB.js +0 -2
  444. package/dist/chunks/chunk-V3KEG6MI.js +0 -2
  445. package/dist/chunks/chunk-WGISITX6.js +0 -4
  446. package/dist/chunks/chunk-XD4ZIQZ2.js +0 -2
  447. package/dist/chunks/chunk-XHU4BZQY.js +0 -13
  448. package/dist/chunks/chunk-ZWEY66RT.js +0 -2
  449. package/dist/chunks/cli-HV32F7HD.js +0 -2
  450. package/dist/chunks/connected-app-executor-DFHWNMRM.js +0 -2
  451. package/dist/chunks/connected-evidence-WOM6N5HO.js +0 -2
  452. package/dist/chunks/core-commands-GWRHH53F.js +0 -2
  453. package/dist/chunks/dataset-preparation-authoring-WJ2XEUO7.js +0 -4
  454. package/dist/chunks/datasets-XIMF54QN.js +0 -2
  455. package/dist/chunks/desktop-test-HF42V2EP.js +0 -3
  456. package/dist/chunks/dist-T6ES2TSM.js +0 -2
  457. package/dist/chunks/evaluation-coordination-WZT6FDMS.js +0 -2
  458. package/dist/chunks/experiment-improvements-H35VS6XZ.js +0 -2
  459. package/dist/chunks/experiments-F54C32EE.js +0 -2
  460. package/dist/chunks/experiments-signal-ONIGTGYR.js +0 -2
  461. package/dist/chunks/host-profile-evaluation-tools-LMCJ3MDJ.js +0 -2
  462. package/dist/chunks/host-profile-external-dataset-4HOXANWK.js +0 -2
  463. package/dist/chunks/hosted-app-server-composition-Y64A2A2B.js +0 -2
  464. package/dist/chunks/hosted-experiment-improvement-B2V2WIUI.js +0 -3
  465. package/dist/chunks/hosted-harness-runtime-C7I4KSDK.js +0 -2
  466. package/dist/chunks/hosted-profile-candidate-CXPVEEYQ.js +0 -3
  467. package/dist/chunks/hosted-profile-compiler-FGCI2VRW.js +0 -2
  468. package/dist/chunks/hosted-profile-evaluation-control-INNUYMBD.js +0 -2
  469. package/dist/chunks/hosted-profile-evaluation-inspection-UPTBRYMS.js +0 -3
  470. package/dist/chunks/hosted-profile-evaluation-preparation-TIQSVKLQ.js +0 -3
  471. package/dist/chunks/hosted-tasksets-7VMYOTIO.js +0 -2
  472. package/dist/chunks/human-review-7XC77NQP.js +0 -2
  473. package/dist/chunks/learning-3XDGIYUL.js +0 -2
  474. package/dist/chunks/local-harness-improvement-runtime-UIKQSAMM.js +0 -2
  475. package/dist/chunks/local-harness-taskset-review-6KJN3EQL.js +0 -2
  476. package/dist/chunks/opchat-NWYWWIA7.js +0 -3
  477. package/dist/chunks/opchat-bounded-chat-ICURZM6R.js +0 -2
  478. package/dist/chunks/organizations-7DBQGCCV.js +0 -2
  479. package/dist/chunks/project-action-payload-7DRABTHY.js +0 -2
  480. package/dist/chunks/project-agent-AXJOWXRU.js +0 -2
  481. package/dist/chunks/published-experiment-source-YBBPLNF2.js +0 -2
  482. package/dist/chunks/refiner-profile-service-ATEFPF5O.js +0 -2
  483. package/dist/chunks/sandbox-command-CF2PJCFX.js +0 -2
  484. package/dist/chunks/saved-work-3OAVRBH3.js +0 -2
  485. package/dist/chunks/setup-RHIMFI2Y.js +0 -2
  486. package/dist/chunks/src-V236S6MV.js +0 -424
  487. package/dist/chunks/standalone-experiment-turn-owner-CDRMGLWW.js +0 -2
  488. package/dist/chunks/store-chat-resources-P4EKCLSY.js +0 -2
  489. package/dist/chunks/store-conversation-serving-YFEZYQD3.js +0 -2
  490. package/dist/chunks/store-evaluation-results-VBH4R2U7.js +0 -7
  491. package/dist/chunks/store-human-review-RFCVZ3HP.js +0 -7
  492. package/dist/chunks/store-learned-preference-migration-validation-FNBGGZU6.js +0 -2
  493. package/dist/chunks/store-local-experiments-XPXGYXNM.js +0 -97
  494. package/dist/chunks/store-model-batch-review-J2L5JQV2.js +0 -2
  495. package/dist/chunks/store-model-project-preparation-OCLIFKI2.js +0 -2
  496. package/dist/chunks/store-taskset-drafts-BNKUVHPA.js +0 -9
  497. package/dist/chunks/taskset-packages-SXBLYHSP.js +0 -2
  498. package/dist/chunks/taskset-packages-V5T4V7YN.js +0 -2
  499. package/dist/chunks/tool-learning-47XQKELE.js +0 -2
  500. package/dist/chunks/training-7VQNCOGH.js +0 -2
  501. package/dist/chunks/training-VKLPNCMC.js +0 -2
  502. package/dist/chunks/training-hosted-NNE6BP6S.js +0 -2
  503. package/dist/chunks/training-hosted-serving-report-VZ4SMLMG.js +0 -2
  504. package/dist/chunks/training-model-start-G7YDZ7ZG.js +0 -2
  505. package/dist/chunks/web-search-56QRZGPR.js +0 -2
  506. package/dist/web/assets/App-DmEA-Lia.js +0 -53
  507. package/dist/web/assets/AppTerminalPanel-ScQKJV4z.js +0 -2
  508. package/dist/web/assets/AppsView-B1uNg9IQ.js +0 -1
  509. package/dist/web/assets/BrowserSidebar-DfVQoJHn.js +0 -1
  510. package/dist/web/assets/ChatTimelineEntry-Bbc6HRks.js +0 -8
  511. package/dist/web/assets/CommunityView-mO58f2B0.js +0 -1
  512. package/dist/web/assets/HostedModelLearningReview-BQIS7hkd.js +0 -1
  513. package/dist/web/assets/HostedModelLearningSettings-BQ-YeFMT.js +0 -1
  514. package/dist/web/assets/LabModelVersionDetailPage-BkHeVbAx.js +0 -1
  515. package/dist/web/assets/LabsRoute-CE45yAXJ.css +0 -1
  516. package/dist/web/assets/LabsRoute-YA9YckKj.js +0 -101
  517. package/dist/web/assets/MainChatThread-DpyPgGKW.js +0 -2
  518. package/dist/web/assets/MainPane-WOeodByM.js +0 -10
  519. package/dist/web/assets/NativeSetupTerminal-fmG2c65K.js +0 -2
  520. package/dist/web/assets/RightChatPanelStack-Bs7A4dLs.js +0 -1
  521. package/dist/web/assets/RightSidebarHomePanel-C-D4kba2.js +0 -1
  522. package/dist/web/assets/TeamChatView-DjmIaLO1.js +0 -1
  523. package/dist/web/assets/TrainingRunLineage-CtYe1KGX.js +0 -1
  524. package/dist/web/assets/WorkSidebarPanel-C6wWuo7U.js +0 -1
  525. package/dist/web/assets/WorkspaceDiffPanel-JDOUmrC-.js +0 -11
  526. package/dist/web/assets/WorkspaceEnvironmentMenu-sfL5LZeB.js +0 -35
  527. package/dist/web/assets/api-client-Dgz-fOMl.js +0 -1
  528. package/dist/web/assets/bot-Cd761lRF.js +0 -1
  529. package/dist/web/assets/chat-resources-BUDXdoG0.js +0 -1
  530. package/dist/web/assets/chevron-down-DEbd6Ek-.js +0 -1
  531. package/dist/web/assets/chevron-right-DLYNg_Oq.js +0 -1
  532. package/dist/web/assets/chevron-up-DFJJccDl.js +0 -1
  533. package/dist/web/assets/chunk-GHPCQXG5-DKDBSd8H.js +0 -9
  534. package/dist/web/assets/chunk-GJRXJL6G-luaxRTYI.js +0 -1
  535. package/dist/web/assets/chunk-JDQVAG3R-C0-rh1aR.js +0 -1
  536. package/dist/web/assets/chunk-XMVSQIK4-BBU7r_NH.js +0 -1
  537. package/dist/web/assets/client-BNjO4Xi8.js +0 -1
  538. package/dist/web/assets/cloud-upload-CoM1FGeB.js +0 -1
  539. package/dist/web/assets/common-CFsO2ppZ.js +0 -1
  540. package/dist/web/assets/copy-BGOhV6Pk.js +0 -1
  541. package/dist/web/assets/create-pipeline-DRR0Qeec.js +0 -1
  542. package/dist/web/assets/createLucideIcon-Bv-_eGcE.js +0 -1
  543. package/dist/web/assets/external-link-CVXsNeO3.js +0 -1
  544. package/dist/web/assets/folder-open-MnOmh19D.js +0 -1
  545. package/dist/web/assets/folder-plus-BRddLBtO.js +0 -1
  546. package/dist/web/assets/git-commit-horizontal-Bm4rkXug.js +0 -1
  547. package/dist/web/assets/icons-CZxmQtZs.js +0 -1
  548. package/dist/web/assets/image-BViGUAiq.js +0 -1
  549. package/dist/web/assets/info-DYPIbKKD.js +0 -1
  550. package/dist/web/assets/loader-circle-JFgFNsP5.js +0 -1
  551. package/dist/web/assets/maximize-2-DXZCQO0b.js +0 -1
  552. package/dist/web/assets/message-square-cOCAL8J1.js +0 -1
  553. package/dist/web/assets/models-route-CWcJuOd0.js +0 -1
  554. package/dist/web/assets/monitor-B35XSAvn.js +0 -1
  555. package/dist/web/assets/paperclip-CKgDxioG.js +0 -1
  556. package/dist/web/assets/play-DzqLr7fM.js +0 -1
  557. package/dist/web/assets/plus-Ddp1vXnw.js +0 -1
  558. package/dist/web/assets/presentation-B0S9v7ib.js +0 -1
  559. package/dist/web/assets/refresh-cw-D45mW-vs.js +0 -1
  560. package/dist/web/assets/reward-checks-D139zwha.js +0 -7
  561. package/dist/web/assets/save-Gu4R_82E.js +0 -1
  562. package/dist/web/assets/schemas-C9IwV7NS.js +0 -64
  563. package/dist/web/assets/settings-DdonLCIN.js +0 -21
  564. package/dist/web/assets/settings-lists-CFHFtO0D.js +0 -5
  565. package/dist/web/assets/square-Dqduqyyu.js +0 -1
  566. package/dist/web/assets/square-terminal-DS3zwi6X.js +0 -1
  567. package/dist/web/assets/training-QBuGBGJd.js +0 -2
  568. package/dist/web/assets/upload-ABSJxuUM.js +0 -1
  569. package/dist/web/assets/useQuery-CCjwL8VI.js +0 -1
  570. package/dist/web/assets/wifi-off-DGJH7Pke.js +0 -1
  571. package/dist/web/assets/work-outputs-CnbRtTLg.js +0 -1
  572. package/dist/web/assets/x-B-_zJVOZ.js +0 -1
  573. /package/dist/chunks/{chunk-SFR32TMJ.js → chunk-JXLDEYRW.js} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{d as v}from"./chunk-KQD36SBJ.js";import{h as b,i as E}from"./chunk-CSU7RDA5.js";import{b as S}from"./chunk-L3KS6MOV.js";import{m as u,o as f}from"./chunk-RCT3O3HQ.js";import{a as p}from"./chunk-FTQLQJQV.js";var c="desktop-personal",L="personal-default";async function K(s){let a=await s.store.getSelectedHarnessWorkspace({ownerKind:"personal",ownerId:c});if(a&&a.metadata.selectionEligible!==!1)return await v({store:s.store,storeDir:s.storeDir,workspaceId:a.id}),H(s.store,a.id,a.currentChannel.release?.contentHash??null);let t=(await s.store.listHarnessWorkspaces({ownerKind:"personal",ownerId:c})).find(o=>o.metadata.selectionEligible!==!1);if(t)return await s.store.selectHarnessWorkspace({ownerKind:"personal",ownerId:c,workspaceId:t.id,updatedAt:(s.now??(()=>new Date().toISOString()))()}),H(s.store,t.id,t.currentChannel.release?.contentHash??null);let r=await s.loadProfileState(),n=r.mode==="local"&&r.sourcePath&&!r.error?await E({store:s.store,storeDir:s.storeDir,id:L,ownerId:c,name:r.activeProfile?.trim()||"Personal Harness",profile:r,now:s.now}):await b({store:s.store,storeDir:s.storeDir,id:L,ownerId:c,name:"Personal Harness",now:s.now});return await s.store.selectHarnessWorkspace({ownerKind:"personal",ownerId:c,workspaceId:n.workspace.id,updatedAt:(s.now??(()=>new Date().toISOString()))()}),n.release}p(K,"ensureSelectedLocalHarnessWorkspace");async function W(s){let a=await s.getSelectedHarnessWorkspace({ownerKind:"personal",ownerId:c});return a?H(s,a.id,a.currentChannel.release?.contentHash??null):null}p(W,"resolveSelectedLocalHarnessRelease");async function H(s,a,t){if(!t)throw new Error(`Selected Harness workspace ${a} has no current release.`);let r=await s.getHarnessReleaseRecord(t);if(!r||r.workspaceId!==a)throw new Error(`Selected Harness workspace ${a} points to a missing release ${t}.`);return f(r.agentSnapshot,"Selected Agent snapshot"),f(r.harnessRelease,"Selected Harness release"),r}p(H,"requireCurrentRelease");import{promises as I}from"node:fs";import i from"node:path";async function J(s,a){if(a){let n=await s.getHarnessReleaseRecord(a.contentHash);if(!n||n.harnessRelease.id!==a.id)throw new Error("The selected immutable Harness release is unavailable.");let o=await s.getHarnessWorkspace(n.workspaceId);if(!o||o.ownerScope.kind!=="personal"||o.ownerScope.id!==c)throw new Error("The selected Harness release is not available to this local owner.");return f(n.agentSnapshot,"Selected Agent snapshot"),f(n.harnessRelease,"Selected Harness release"),A({workspace:o,release:n})}let t=await W(s);if(!t)return null;let r=await s.getSelectedHarnessWorkspace({ownerKind:"personal",ownerId:c});if(!r||r.id!==t.workspaceId)throw new Error("Selected Harness workspace changed while its release was being admitted.");return A({workspace:r,release:t})}p(J,"loadSelectedLocalHarnessRuntime");async function A(s){let{workspace:a,release:t}=s;if(t.workspaceId!==a.id)throw new Error("Harness release does not belong to the requested workspace.");let r=i.join(t.bundlePath,"source");await Promise.all(t.harnessRelease.files.map(e=>x(r,e.path,e.contentHash)));let n=await Promise.all(t.agentSnapshot.instructions.map(async e=>({path:e.path,content:await g(r,e.path,e.contentHash)}))),o=[],m=new Map;for(let e of t.agentSnapshot.skills){let l=await g(r,e.path,e.contentHash),d=S(l);if(!d.name||!d.description||d.messages.length>0)throw new Error(`Released Harness Skill ${e.path} is invalid: ${d.messages.join(" ")||"missing name or description"}`);if(m.has(d.name))throw new Error(`Released Harness has duplicate Skill ${d.name}.`);let k=`${i.posix.dirname(e.path)}/`,P=t.harnessRelease.files.filter(h=>h.visibility==="policy"&&h.path.startsWith(k)&&h.path!==e.path).map(h=>h.path.slice(k.length)).sort(),y={name:d.name,description:d.description,path:e.path,scope:"profile",enabled:!0,sourcePath:r,charCount:l.length,sourceHash:e.contentHash,validationStatus:"valid",validationMessages:[],resourceFiles:P};o.push(y),m.set(y.name,async()=>{let h=await g(r,e.path,e.contentHash),w=S(h);if(!w.name||!w.description||w.messages.length>0)throw new Error(`Released Harness Skill ${e.path} failed validation while loading.`);return{name:w.name,description:w.description,body:w.body,path:e.path,sourceHash:e.contentHash,charCount:h.length,packagePath:i.join(r,...i.posix.dirname(e.path).split("/")),resourceFiles:P}})}o.sort((e,l)=>e.name.localeCompare(l.name));let $={profileSourcePath:r,skills:o,readSkill:m.size>0?async e=>{let l=m.get(e);if(!l)throw new Error(`Released Harness Skill not found: ${e}`);return l()}:null},R=n.sort((e,l)=>e.path.localeCompare(l.path)).map(({path:e,content:l})=>[`Active Harness instruction (${e}):`,l.trim()].join(`
2
+ import{d as v}from"./chunk-XY7HFXLH.js";import{h as b,i as E}from"./chunk-DKOVZ6R2.js";import{b as S}from"./chunk-L3KS6MOV.js";import{m as u,o as f}from"./chunk-RCT3O3HQ.js";import{a as p}from"./chunk-FTQLQJQV.js";var c="desktop-personal",L="personal-default";async function K(s){let a=await s.store.getSelectedHarnessWorkspace({ownerKind:"personal",ownerId:c});if(a&&a.metadata.selectionEligible!==!1)return await v({store:s.store,storeDir:s.storeDir,workspaceId:a.id}),H(s.store,a.id,a.currentChannel.release?.contentHash??null);let t=(await s.store.listHarnessWorkspaces({ownerKind:"personal",ownerId:c})).find(o=>o.metadata.selectionEligible!==!1);if(t)return await s.store.selectHarnessWorkspace({ownerKind:"personal",ownerId:c,workspaceId:t.id,updatedAt:(s.now??(()=>new Date().toISOString()))()}),H(s.store,t.id,t.currentChannel.release?.contentHash??null);let r=await s.loadProfileState(),n=r.mode==="local"&&r.sourcePath&&!r.error?await E({store:s.store,storeDir:s.storeDir,id:L,ownerId:c,name:r.activeProfile?.trim()||"Personal Harness",profile:r,now:s.now}):await b({store:s.store,storeDir:s.storeDir,id:L,ownerId:c,name:"Personal Harness",now:s.now});return await s.store.selectHarnessWorkspace({ownerKind:"personal",ownerId:c,workspaceId:n.workspace.id,updatedAt:(s.now??(()=>new Date().toISOString()))()}),n.release}p(K,"ensureSelectedLocalHarnessWorkspace");async function W(s){let a=await s.getSelectedHarnessWorkspace({ownerKind:"personal",ownerId:c});return a?H(s,a.id,a.currentChannel.release?.contentHash??null):null}p(W,"resolveSelectedLocalHarnessRelease");async function H(s,a,t){if(!t)throw new Error(`Selected Harness workspace ${a} has no current release.`);let r=await s.getHarnessReleaseRecord(t);if(!r||r.workspaceId!==a)throw new Error(`Selected Harness workspace ${a} points to a missing release ${t}.`);return f(r.agentSnapshot,"Selected Agent snapshot"),f(r.harnessRelease,"Selected Harness release"),r}p(H,"requireCurrentRelease");import{promises as I}from"node:fs";import i from"node:path";async function J(s,a){if(a){let n=await s.getHarnessReleaseRecord(a.contentHash);if(!n||n.harnessRelease.id!==a.id)throw new Error("The selected immutable Harness release is unavailable.");let o=await s.getHarnessWorkspace(n.workspaceId);if(!o||o.ownerScope.kind!=="personal"||o.ownerScope.id!==c)throw new Error("The selected Harness release is not available to this local owner.");return f(n.agentSnapshot,"Selected Agent snapshot"),f(n.harnessRelease,"Selected Harness release"),A({workspace:o,release:n})}let t=await W(s);if(!t)return null;let r=await s.getSelectedHarnessWorkspace({ownerKind:"personal",ownerId:c});if(!r||r.id!==t.workspaceId)throw new Error("Selected Harness workspace changed while its release was being admitted.");return A({workspace:r,release:t})}p(J,"loadSelectedLocalHarnessRuntime");async function A(s){let{workspace:a,release:t}=s;if(t.workspaceId!==a.id)throw new Error("Harness release does not belong to the requested workspace.");let r=i.join(t.bundlePath,"source");await Promise.all(t.harnessRelease.files.map(e=>x(r,e.path,e.contentHash)));let n=await Promise.all(t.agentSnapshot.instructions.map(async e=>({path:e.path,content:await g(r,e.path,e.contentHash)}))),o=[],m=new Map;for(let e of t.agentSnapshot.skills){let l=await g(r,e.path,e.contentHash),d=S(l);if(!d.name||!d.description||d.messages.length>0)throw new Error(`Released Harness Skill ${e.path} is invalid: ${d.messages.join(" ")||"missing name or description"}`);if(m.has(d.name))throw new Error(`Released Harness has duplicate Skill ${d.name}.`);let k=`${i.posix.dirname(e.path)}/`,P=t.harnessRelease.files.filter(h=>h.visibility==="policy"&&h.path.startsWith(k)&&h.path!==e.path).map(h=>h.path.slice(k.length)).sort(),y={name:d.name,description:d.description,path:e.path,scope:"profile",enabled:!0,sourcePath:r,charCount:l.length,sourceHash:e.contentHash,validationStatus:"valid",validationMessages:[],resourceFiles:P};o.push(y),m.set(y.name,async()=>{let h=await g(r,e.path,e.contentHash),w=S(h);if(!w.name||!w.description||w.messages.length>0)throw new Error(`Released Harness Skill ${e.path} failed validation while loading.`);return{name:w.name,description:w.description,body:w.body,path:e.path,sourceHash:e.contentHash,charCount:h.length,packagePath:i.join(r,...i.posix.dirname(e.path).split("/")),resourceFiles:P}})}o.sort((e,l)=>e.name.localeCompare(l.name));let $={profileSourcePath:r,skills:o,readSkill:m.size>0?async e=>{let l=m.get(e);if(!l)throw new Error(`Released Harness Skill not found: ${e}`);return l()}:null},R=n.sort((e,l)=>e.path.localeCompare(l.path)).map(({path:e,content:l})=>[`Active Harness instruction (${e}):`,l.trim()].join(`
3
3
  `)).filter(e=>e.trim().length>0),D=[["Harness capability receipt:",JSON.stringify({harnessRelease:{id:t.harnessRelease.id,contentHash:t.harnessRelease.contentHash},agentSnapshot:{id:t.agentSnapshot.id,contentHash:t.agentSnapshot.contentHash},files:t.harnessRelease.files.filter(e=>e.visibility==="policy").map(e=>({path:e.path,contentHash:e.contentHash})),skills:t.agentSnapshot.skills.map(e=>e.path),agents:t.agentSnapshot.agents.map(e=>e.path),tools:t.agentSnapshot.toolDeclarations.map(e=>e.name),capabilityRequirements:t.agentSnapshot.capabilityRequirements})].join(`
4
4
  `),R.length>0?["Active Harness preflight:","Apply the following released instructions when planning work and immediately before every tool call.","Preflight each call: (1) identify any active instruction that matches the planned operation, (2) inspect the exact tool arguments for a forbidden pattern, and (3) rewrite the call before sending it when a pattern matches. Compliance is required even when the prohibited call might still succeed.",...R].join(`
5
5
 
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{b as f}from"./chunk-IR2Y2VQY.js";import{Z as c}from"./chunk-6I5AUTVO.js";import{C as w,D as I,z as g}from"./chunk-CJDGLPNX.js";import{b as m}from"./chunk-FYWQWKVS.js";import{f as R}from"./chunk-ZY32SZ2P.js";import{A as r}from"./chunk-X2J2P5ZT.js";import{a as d}from"./chunk-FTQLQJQV.js";import n from"node:path";import{readFile as y}from"node:fs/promises";var A=r.object({profileId:r.string().min(1),sourceRevision:r.string().min(1),repositoryId:r.string().min(1),harnessRelease:r.object({id:r.string().min(1),contentHash:r.string().regex(/^[a-f0-9]{64}$/)}).strict(),hostExecution:r.object({conversationId:r.string().min(1),turnId:r.string().min(1)}).strict().optional(),workspaceId:r.string().min(1),assetsPath:r.string().min(1).refine(n.isAbsolute)}).strict();async function _(p,e){let t=A.parse(e),s=await f(p,t.harnessRelease);if(!s||n.resolve(s.release.bundlePath)!==n.resolve(t.assetsPath))throw new Error("Hosted Profile release changed after admission.");let o=s.release.harnessRelease.metadata.profile;if(!o||typeof o!="object"||o.id!==t.profileId||o.sourceRevision!==t.sourceRevision||o.repositoryId!==void 0&&o.repositoryId!==t.repositoryId)throw new Error("Hosted Profile provenance differs from admitted release.");return{profile:I(),profileLibrary:w()}}d(_,"loadHostedProfileStateAndLibrary");async function B(p,e){let t=A.parse(e),s=await f(p,t.harnessRelease);if(!s||n.resolve(s.release.bundlePath)!==n.resolve(t.assetsPath))throw new Error("Hosted Profile workflow release is unavailable.");let o=s.release.harnessRelease.metadata.profile;if(o?.id!==t.profileId||o.sourceRevision!==t.sourceRevision||o.repositoryId!==void 0&&o.repositoryId!==t.repositoryId)throw new Error("Hosted Profile workflow provenance changed.");let a=t.harnessRelease,l={source:"openpond_git",repositoryId:t.repositoryId,profileId:t.profileId};if(!s.release.harnessRelease.files.some(u=>u.path==="workflows/catalog.json"))return{profileRef:l,sourceRevision:t.sourceRevision,harnessRelease:a,workflows:[]};let i=n.join(s.release.bundlePath,"source","workflows"),v=R({agentSnapshot:s.release.agentSnapshot,harnessRelease:s.release.harnessRelease,catalogBytes:await y(n.join(i,"catalog.json")),actionBytes:await y(n.join(i,"actions.json"))});return{profileRef:l,sourceRevision:t.sourceRevision,harnessRelease:a,workflows:v.catalog.workflows.map(u=>({workflow:u,binding:{schemaVersion:"openpond.profileWorkflowBinding.v1",profileId:t.profileId,sourceRevision:t.sourceRevision,harnessRelease:a,catalogHash:v.catalogHash,workflowId:u.id}}))}}d(B,"listHostedProfileWorkflows");import{createHash as U,randomUUID as h}from"node:crypto";var b=r.object({approval:g,revision:r.number().int().positive()}).strict(),P=r.object({record:m}).strict(),x=r.object({startedAt:r.string().min(1),requestOrdinal:r.number().int().nonnegative(),id:r.string().min(1)}).strict(),k=r.object({records:r.array(m).max(200),nextBefore:x.nullable()}).strict(),H=1e4,S=class{constructor(e){this.client=e}client;static{d(this,"HostedApprovalStorage")}async readApproval(e){let t=await this.client.request({contractVersion:c,requestId:h(),operation:"approval/get",params:{approvalId:e}});return t===null?null:b.parse(t)}async getApproval(e){return(await this.readApproval(e))?.approval??null}async putApproval(e){let t=g.parse(e.approval);if(!e.requestId.trim())throw new Error("Approval mutation requires a stable request ID.");return b.parse(await this.client.request({contractVersion:c,requestId:e.requestId,operation:"approval/upsert",params:{approval:t,expectedRevision:e.expectedRevision}}))}},M=class{constructor(e){this.client=e}client;static{d(this,"HostedModelUsageStorage")}async upsertModelUsageRecord(e){let t=m.parse(e),s=U("sha256").update(JSON.stringify(t)).digest("hex"),o=await this.client.request({contractVersion:c,requestId:`usage:${s}`,operation:"usage/upsert",params:{record:t}}),a=P.parse(o).record;if(a.requestId!==t.requestId)throw new Error("Host usage upsert changed request identity.");return a}async getModelUsageRecordByRequestId(e){let t=await this.client.request({contractVersion:c,requestId:h(),operation:"usage/getByRequestId",params:{requestId:e}});return t===null?null:P.parse(t).record}async listModelUsageRecords(e={}){let t=e.limit===void 0||e.limit>=H,s=e.limit===void 0?H:Math.max(1,Math.min(1e4,Math.trunc(e.limit))),o={...e.sessionId?{sessionId:e.sessionId}:{},...e.turnId?{turnId:e.turnId}:{},...e.provider?{provider:e.provider}:{},...e.model?{model:e.model}:{},...e.startedAtFrom?{startedAtFrom:e.startedAtFrom}:{},...e.startedAtTo?{startedAtTo:e.startedAtTo}:{},...e.visibility&&e.visibility!=="all"?{visibility:e.visibility}:{},...e.status&&e.status!=="all"?{status:e.status}:{}},a=[],l=null;for(;a.length<s+(t?1:0);){let i=k.parse(await this.client.request({contractVersion:c,requestId:h(),operation:"usage/page",params:{query:o,before:l,limit:Math.min(200,s+(t?1:0)-a.length)}}));if(a.push(...i.records),a.length>s)throw new Error(`Hosted usage query exceeds ${s} rows; narrow its filters or use a streamed aggregation.`);if(i.nextBefore===null)break;if(i.records.length===0||JSON.stringify(i.nextBefore)===JSON.stringify(l))throw new Error("Host usage cursor did not advance.");l=i.nextBefore}return a}async listModelUsageRecordsComplete(e={}){return this.listModelUsageRecords(e)}};export{A as a,_ as b,B as c,S as d,M as e};
2
+ import{b as f}from"./chunk-ZYLLPRPU.js";import{Z as c}from"./chunk-6I5AUTVO.js";import{C as w,D as I,z as g}from"./chunk-HG2YFMVU.js";import{b as m}from"./chunk-FYWQWKVS.js";import{f as R}from"./chunk-ZY32SZ2P.js";import{A as r}from"./chunk-X2J2P5ZT.js";import{a as d}from"./chunk-FTQLQJQV.js";import n from"node:path";import{readFile as y}from"node:fs/promises";var A=r.object({profileId:r.string().min(1),sourceRevision:r.string().min(1),repositoryId:r.string().min(1),harnessRelease:r.object({id:r.string().min(1),contentHash:r.string().regex(/^[a-f0-9]{64}$/)}).strict(),hostExecution:r.object({conversationId:r.string().min(1),turnId:r.string().min(1)}).strict().optional(),workspaceId:r.string().min(1),assetsPath:r.string().min(1).refine(n.isAbsolute)}).strict();async function _(p,e){let t=A.parse(e),s=await f(p,t.harnessRelease);if(!s||n.resolve(s.release.bundlePath)!==n.resolve(t.assetsPath))throw new Error("Hosted Profile release changed after admission.");let o=s.release.harnessRelease.metadata.profile;if(!o||typeof o!="object"||o.id!==t.profileId||o.sourceRevision!==t.sourceRevision||o.repositoryId!==void 0&&o.repositoryId!==t.repositoryId)throw new Error("Hosted Profile provenance differs from admitted release.");return{profile:I(),profileLibrary:w()}}d(_,"loadHostedProfileStateAndLibrary");async function B(p,e){let t=A.parse(e),s=await f(p,t.harnessRelease);if(!s||n.resolve(s.release.bundlePath)!==n.resolve(t.assetsPath))throw new Error("Hosted Profile workflow release is unavailable.");let o=s.release.harnessRelease.metadata.profile;if(o?.id!==t.profileId||o.sourceRevision!==t.sourceRevision||o.repositoryId!==void 0&&o.repositoryId!==t.repositoryId)throw new Error("Hosted Profile workflow provenance changed.");let a=t.harnessRelease,l={source:"openpond_git",repositoryId:t.repositoryId,profileId:t.profileId};if(!s.release.harnessRelease.files.some(u=>u.path==="workflows/catalog.json"))return{profileRef:l,sourceRevision:t.sourceRevision,harnessRelease:a,workflows:[]};let i=n.join(s.release.bundlePath,"source","workflows"),v=R({agentSnapshot:s.release.agentSnapshot,harnessRelease:s.release.harnessRelease,catalogBytes:await y(n.join(i,"catalog.json")),actionBytes:await y(n.join(i,"actions.json"))});return{profileRef:l,sourceRevision:t.sourceRevision,harnessRelease:a,workflows:v.catalog.workflows.map(u=>({workflow:u,binding:{schemaVersion:"openpond.profileWorkflowBinding.v1",profileId:t.profileId,sourceRevision:t.sourceRevision,harnessRelease:a,catalogHash:v.catalogHash,workflowId:u.id}}))}}d(B,"listHostedProfileWorkflows");import{createHash as U,randomUUID as h}from"node:crypto";var b=r.object({approval:g,revision:r.number().int().positive()}).strict(),P=r.object({record:m}).strict(),x=r.object({startedAt:r.string().min(1),requestOrdinal:r.number().int().nonnegative(),id:r.string().min(1)}).strict(),k=r.object({records:r.array(m).max(200),nextBefore:x.nullable()}).strict(),H=1e4,S=class{constructor(e){this.client=e}client;static{d(this,"HostedApprovalStorage")}async readApproval(e){let t=await this.client.request({contractVersion:c,requestId:h(),operation:"approval/get",params:{approvalId:e}});return t===null?null:b.parse(t)}async getApproval(e){return(await this.readApproval(e))?.approval??null}async putApproval(e){let t=g.parse(e.approval);if(!e.requestId.trim())throw new Error("Approval mutation requires a stable request ID.");return b.parse(await this.client.request({contractVersion:c,requestId:e.requestId,operation:"approval/upsert",params:{approval:t,expectedRevision:e.expectedRevision}}))}},M=class{constructor(e){this.client=e}client;static{d(this,"HostedModelUsageStorage")}async upsertModelUsageRecord(e){let t=m.parse(e),s=U("sha256").update(JSON.stringify(t)).digest("hex"),o=await this.client.request({contractVersion:c,requestId:`usage:${s}`,operation:"usage/upsert",params:{record:t}}),a=P.parse(o).record;if(a.requestId!==t.requestId)throw new Error("Host usage upsert changed request identity.");return a}async getModelUsageRecordByRequestId(e){let t=await this.client.request({contractVersion:c,requestId:h(),operation:"usage/getByRequestId",params:{requestId:e}});return t===null?null:P.parse(t).record}async listModelUsageRecords(e={}){let t=e.limit===void 0||e.limit>=H,s=e.limit===void 0?H:Math.max(1,Math.min(1e4,Math.trunc(e.limit))),o={...e.sessionId?{sessionId:e.sessionId}:{},...e.turnId?{turnId:e.turnId}:{},...e.provider?{provider:e.provider}:{},...e.model?{model:e.model}:{},...e.startedAtFrom?{startedAtFrom:e.startedAtFrom}:{},...e.startedAtTo?{startedAtTo:e.startedAtTo}:{},...e.visibility&&e.visibility!=="all"?{visibility:e.visibility}:{},...e.status&&e.status!=="all"?{status:e.status}:{}},a=[],l=null;for(;a.length<s+(t?1:0);){let i=k.parse(await this.client.request({contractVersion:c,requestId:h(),operation:"usage/page",params:{query:o,before:l,limit:Math.min(200,s+(t?1:0)-a.length)}}));if(a.push(...i.records),a.length>s)throw new Error(`Hosted usage query exceeds ${s} rows; narrow its filters or use a streamed aggregation.`);if(i.nextBefore===null)break;if(i.records.length===0||JSON.stringify(i.nextBefore)===JSON.stringify(l))throw new Error("Host usage cursor did not advance.");l=i.nextBefore}return a}async listModelUsageRecordsComplete(e={}){return this.listModelUsageRecords(e)}};export{A as a,_ as b,B as c,S as d,M as e};
@@ -1,9 +1,9 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as pt}from"./chunk-2RSGVLZT.js";import{a as D,b as Fe,d as de}from"./chunk-HPTEJBP4.js";import{b as mt,c as ft}from"./chunk-QFL2VQKX.js";import{a as Je,b as Ye,c as Ze,d as ce}from"./chunk-ADOCQA4D.js";import{a as M,b as ue}from"./chunk-4EZI4KCT.js";import{_ as lt,a as le,d as $e,e as Ve,g as tt,j as rt,k as st,na as ut,oa as dt,pa as gt,v as at,w as Y,y as it}from"./chunk-4NN5OLKW.js";import{g as ct}from"./chunk-RWRKUO5D.js";import{a as ze}from"./chunk-PYNW5OFA.js";import{b as et}from"./chunk-4VZJQRQI.js";import{a as Xe}from"./chunk-VFH5C6D2.js";import{b as Ge,d as Qe}from"./chunk-R6VI7MX5.js";import{k as Ke}from"./chunk-CSU7RDA5.js";import{a as ot,b as nt}from"./chunk-GW766ZSO.js";import{i as Be,p as Ue}from"./chunk-MCBRB5D6.js";import{s as L,u as B,v as ie,z as Le}from"./chunk-4TTXNVCE.js";import{a as T,d as X}from"./chunk-BJXPQIVD.js";import{c as We}from"./chunk-L3KS6MOV.js";import{F as Ne,Ga as qe,g as Me}from"./chunk-CJDGLPNX.js";import{a as je}from"./chunk-BL3CZWWD.js";import{a as tr}from"./chunk-JFXINDOQ.js";import{b as De}from"./chunk-O6ZYDHEJ.js";import{g as be}from"./chunk-AJXWJLZA.js";import{_ as Ce,ca as He,fa as Oe}from"./chunk-SH7POUVX.js";import{F as Ie}from"./chunk-2MEOUS24.js";import{n as H}from"./chunk-RCT3O3HQ.js";import{p as _e}from"./chunk-UGOK7VTC.js";import{a as n,e as er}from"./chunk-FTQLQJQV.js";import{randomUUID as Pr}from"node:crypto";import{mkdir as Rr}from"node:fs/promises";import q from"node:path";function ht(e){return async(t,r)=>{let s=await e?.(t,r)??null;if((t.metadata?.standaloneExperiment!==void 0||t.metadata?.localProfileExperiment!==void 0)&&!s)throw new Error("This native Experiment session has no active durable model-dispatch owner.");return s}}n(ht,"experimentSessionStreamResolver");var St=er(tr(),1);import{randomUUID as pe}from"node:crypto";var rr=15e3,or=3e4;function Wr(e){let t=new Set,r=null,s=null;async function p(a){if(!a.profileRef||!a.profileWorkflowId)throw new Error(a.profileMigrationError??`Chat Workflow ${a.id} has no Profile package.`);let u=await e.getSession(a.sessionId),i=await e.resolveProfileOwner(u,a.profileRef),c=await e.readProfilePackage(i.sourcePath,a.profileWorkflowId);return{...a,name:c.name,prompt:c.prompt}}n(p,"authoredWorkflow");async function h(){for(let a of await e.store.listChatWorkflows())if(!(a.profileRef&&a.profileWorkflowId))try{let u=await e.getSession(a.sessionId);if(!u.currentProfile)throw new Error("Original session has no explicit Profile owner.");let i=await e.resolveProfileOwner(u,u.currentProfile),c={...a,profileRef:i.ref,profileWorkflowId:a.profileWorkflowId??`chat-${a.id.toLowerCase()}`,profileMigrationError:null};await e.saveProfilePackage(i.sourcePath,c),await e.store.patchChatWorkflow(a.id,()=>c)}catch(u){let i=`Profile package migration unresolved: ${u instanceof Error?u.message:String(u)}`;await e.store.patchChatWorkflow(a.id,c=>({...c,profileMigrationError:i})),e.logger?.warn("chat workflow Profile migration unresolved",{workflowId:a.id,error:i})}}n(h,"migrateExistingWorkflows");async function w(a){let u=await e.getSession(a.sessionId),i=await e.resolveProfileOwner(u),c=T(),g=Z(a.recurrence,new Date,0);if(!g.value)throw new Error(g.error??"This workflow has no future occurrence.");let k={id:pe(),sessionId:u.id,sessionTitle:u.title,sourceTurnId:a.sourceTurnId??null,name:a.name,prompt:a.prompt,profileRef:i.ref,profileWorkflowId:`chat-${pe()}`,recurrence:a.recurrence,enabled:!0,nextRunAt:g.value,lastRunAt:null,lastRunStatus:null,lastRunId:null,lastError:g.error,scheduledRunCount:0,createdAt:c,updatedAt:c};return await e.saveProfilePackage(i.sourcePath,k),e.store.upsertChatWorkflow(k)}n(w,"create");async function v(){if(e.isClosing())return;let a=await e.store.listDueChatWorkflows(T());for(let u of a)if(!t.has(u.id)){if(e.isSessionTurnActive(u.sessionId)){await e.store.patchChatWorkflow(u.id,i=>({...i,nextRunAt:new Date(Date.now()+or).toISOString(),lastError:"Waiting for the attached chat to finish its current turn.",updatedAt:T()}));continue}await d(u,u.nextRunAt??T(),"schedule")}}n(v,"runTick");function l(){if(s)return s;let a=v().finally(()=>{s===a&&(s=null)});return s=a,a}n(l,"trackedTick");async function d(a,u,i){a=await p(a);let c=T(),g=e.store.home?await Oe(e.store.home):void 0,k={definitionSnapshot:structuredClone(a),...g?{configurationSnapshot:{effectiveRevision:g.effectiveRevision,sources:g.sources}}:{},id:pe(),workflowId:a.id,sessionId:a.sessionId,scheduledFor:u,trigger:i,status:"queued",turnId:null,error:null,createdAt:c,startedAt:null,completedAt:null,updatedAt:c},y=await e.store.insertChatWorkflowRun(k);return t.add(a.id),e.queue.enqueue({label:"chat-workflow-run",metadata:{workflowId:a.id,sessionId:a.sessionId,trigger:i,scheduledFor:u}},async()=>{try{await f(a,y)}finally{t.delete(a.id)}}),y}n(d,"enqueue");async function f(a,u){let i=T();await e.store.patchChatWorkflowRun(u.id,S=>({...S,status:"running",startedAt:i,updatedAt:i}));let c=null,g=null;try{c=await e.sendTurn(a.sessionId,{prompt:a.prompt,metadata:{interactionKind:"scheduled_workflow",chatWorkflowId:a.id,chatWorkflowName:a.name,chatWorkflowRunId:u.id,scheduledFor:u.scheduledFor}})}catch(S){g=S instanceof Error?S.message:String(S)}let k=T(),y=c?.status==="completed"?"succeeded":"failed";await e.store.patchChatWorkflowRun(u.id,S=>({...S,status:y,turnId:c?.id??null,error:g??c?.error??null,completedAt:k,updatedAt:k})),await e.store.patchChatWorkflow(a.id,S=>{let b=S.scheduledRunCount+(u.trigger==="schedule"?1:0),P=u.trigger==="manual"?{value:S.nextRunAt,error:null}:Z(S.recurrence,new Date,b);return{...S,enabled:P.value?S.enabled:!1,nextRunAt:S.enabled?P.value:null,lastRunAt:k,lastRunStatus:y,lastRunId:u.id,lastError:P.error??g??c?.error??null,scheduledRunCount:b,updatedAt:k}})}return n(f,"execute"),{async start(){r||(await h(),l().catch(a=>e.logger?.warn("chat workflow tick failed",{error:String(a)})),r=setInterval(()=>{l().catch(a=>e.logger?.warn("chat workflow tick failed",{error:String(a)}))},e.tickMs??rr),r.unref?.())},async stop(){r&&clearInterval(r),r=null,await s?.catch(()=>{})},create:w,async list(a){let u=await e.store.listChatWorkflows({sessionId:a});return Promise.all(u.map(async i=>{try{return await p(i)}catch(c){return{...i,profileMigrationError:c instanceof Error?c.message:String(c)}}}))},listRuns:n(a=>e.store.listChatWorkflowRuns(a),"listRuns"),async patch(a,u){let i=await e.store.getChatWorkflow(a);if(!i)return null;let c=T();if("enabled"in u){let S=u.enabled?Z(i.recurrence,new Date,i.scheduledRunCount):{value:null,error:null};return e.store.patchChatWorkflow(a,b=>({...b,enabled:u.enabled&&!!S.value,nextRunAt:u.enabled?S.value:null,lastError:S.error,updatedAt:c}))}let g=Z(u.recurrence,new Date,0);if(!i.profileRef||!i.profileWorkflowId)throw new Error(`Chat Workflow ${a} has no resolved Profile owner; migrate it before editing.`);let k=await e.getSession(i.sessionId),y=await e.resolveProfileOwner(k,i.profileRef);return await e.saveProfilePackage(y.sourcePath,{...i,name:u.name,prompt:u.prompt}),e.store.patchChatWorkflow(a,S=>({...S,name:u.name,prompt:u.prompt,recurrence:u.recurrence,enabled:!!g.value,nextRunAt:g.value,lastError:g.error,scheduledRunCount:0,updatedAt:c}))},remove:n(a=>e.store.deleteChatWorkflow(a),"remove"),async runNow(a){let u=await e.store.getChatWorkflow(a);if(!u)throw new Error("Chat workflow not found.");if(e.isSessionTurnActive(u.sessionId))throw new Error("The attached chat is currently running a turn.");return d(u,T(),"manual")}}}n(Wr,"createChatWorkflowLoop");var nr={sunday:0,monday:1,tuesday:2,wednesday:3,thursday:4,friday:5,saturday:6};function Z(e,t,r){try{return{value:me(e,t,r),error:null}}catch(s){return{value:null,error:s instanceof Error?s.message:String(s)}}}n(Z,"safeNextOccurrence");function me(e,t,r){if(e.end.kind==="after_occurrences"&&r>=e.end.occurrences)return null;let s=wt(e.startDate,e.localTime,e.timeZone);if(e.kind==="once")return s.getTime()>t.getTime()?s.toISOString():null;let[p,h]=e.localTime.split(":").map(Number),w=e.kind==="daily"?`${h} ${p} * * *`:e.kind==="weekdays"?`${h} ${p} * * 1-5`:e.kind==="weekly"?`${h} ${p} * * ${(e.weekdays??[]).map(d=>nr[d]).join(",")}`:`${h} ${p} ${e.dayOfMonth} * *`,v=new Date(Math.max(t.getTime(),s.getTime()-1e3)),l=St.CronExpressionParser.parse(w,{currentDate:v,tz:e.timeZone}).next().toDate();if(e.end.kind==="on_date"){let d=wt(e.end.date,"23:59",e.timeZone);if(l.getTime()>d.getTime()+59999)return null}return l.toISOString()}n(me,"nextOccurrence");function wt(e,t,r){let[s,p,h]=e.split("-").map(Number),[w,v]=t.split(":").map(Number),l=Date.UTC(s,p-1,h,w,v),d=new Date(l);for(let f=0;f<3;f+=1){let a=new Intl.DateTimeFormat("en-CA",{timeZone:r,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).formatToParts(d),u=Object.fromEntries(a.map(g=>[g.type,g.value])),i=Date.UTC(Number(u.year),Number(u.month)-1,Number(u.day),Number(u.hour),Number(u.minute)),c=l-i;if(c===0)return d;d=new Date(d.getTime()+c)}return d}n(wt,"zonedLocalDateTime");function vt(e){return _e(e,t=>{let r=0,s=0;t.exec("BEGIN IMMEDIATE");try{for(let[p,h,w]of[["local_agent_schedule_runs","local_agent_schedules","scheduleId"],["chat_workflow_runs","chat_workflows","workflowId"]]){let v=t.prepare(`SELECT id, payload FROM ${p} WHERE status IN ('queued','running')`).all();for(let l of v){let d=JSON.parse(l.payload),f=new Date().toISOString(),a=typeof d.turnId=="string"?t.prepare("SELECT payload FROM turns WHERE id = ?").get(d.turnId):void 0,i=(a?JSON.parse(a.payload):null)?.status==="completed",c=i?"The previous scheduled turn completed before shutdown.":"OpenPond stopped before this scheduled run was settled. Its external outcome may be unknown. Review the run before retrying or enabling this schedule.",g=i?"succeeded":"failed";t.prepare(`UPDATE ${p} SET status=?, payload=?, updated_at=? WHERE id=?`).run(g,JSON.stringify({...d,status:g,error:i?null:c,completedAt:f,updatedAt:f}),f,l.id);let k=t.prepare(`SELECT payload FROM ${h} WHERE id = ?`).get(String(d[w]));if(k&&!i){let y=JSON.parse(k.payload);t.prepare(`UPDATE ${h} SET enabled=0, next_run_at=NULL, payload=?, updated_at=? WHERE id=?`).run(JSON.stringify({...y,enabled:!1,nextRunAt:null,lastRunStatus:g,lastRunId:l.id,lastError:c,updatedAt:f}),f,String(d[w]))}if(i&&k&&h==="chat_workflows"){let y=qe.parse(JSON.parse(k.payload)),S=y.scheduledRunCount+(d.trigger==="schedule"?1:0),b=d.trigger==="manual"?y.nextRunAt:me(y.recurrence,new Date(f),S),P=y.enabled&&b!==null;t.prepare("UPDATE chat_workflows SET enabled=?, next_run_at=?, payload=?, updated_at=? WHERE id=?").run(P?1:0,P?b:null,JSON.stringify({...y,enabled:P,nextRunAt:P?b:null,scheduledRunCount:S,lastRunStatus:g,lastRunId:l.id,lastRunAt:f,lastError:null,updatedAt:f}),f,y.id)}i?r+=1:s+=1}}return t.exec("COMMIT"),{recovered:r,needsReview:s}}catch(p){throw t.exec("ROLLBACK"),p}})}n(vt,"reconcileInterruptedScheduledWork");async function kt(e,t){let r=sr(e);if(!r)return null;let s=await t.loadProfileState();return r==="help"?ar(s):ir(s)}n(kt,"runProfileSkillCommand");function sr(e){let t=/^\/skill(?:\s+([\s\S]*))?$/i.exec(e.trim());if(!t)return null;let r=t[1]?.trim().toLowerCase()??"";return!r||r==="list"?"list":r==="help"?"help":null}n(sr,"readOnlyProfileSkillAction");function ar(e){return{handled:!0,action:"help",profile:e,message:["Profile skills support:","- /skill list","- /skill create <what the skill should help with>","- /skill create <skill-name>: <what the skill should help with>","- /skill create --name <skill-name> <what the skill should help with>","- /skill edit <skill-name> <change request>","","Create and edit run as normal model turns with the bundled OpenPond Skill Authoring skill. Skills may include SKILL.md plus focused scripts, references, and assets. Use an Agent when the workflow needs code, actions, durable runtime behavior, setup, or Evals."].join(`
2
+ import{a as pt}from"./chunk-PSY6IRJE.js";import{a as D,b as Fe,d as de}from"./chunk-PKJHN666.js";import{b as mt,c as ft}from"./chunk-Z33RVGP6.js";import{a as Je,b as Ye,c as Ze,d as ce}from"./chunk-7PKDJHT6.js";import{a as M,b as ue}from"./chunk-65WRWLUD.js";import{_ as lt,a as le,d as $e,e as Ve,g as tt,j as rt,k as st,na as ut,oa as dt,pa as gt,v as at,w as Y,y as it}from"./chunk-LSKMALD6.js";import{g as ct}from"./chunk-B66QCXH2.js";import{a as ze}from"./chunk-PYNW5OFA.js";import{b as et}from"./chunk-MOXIGLN2.js";import{a as Xe}from"./chunk-VFH5C6D2.js";import{b as Ge,d as Qe}from"./chunk-EYTTZ5H4.js";import{k as Ke}from"./chunk-DKOVZ6R2.js";import{a as ot,b as nt}from"./chunk-GW766ZSO.js";import{i as Be,p as Ue}from"./chunk-RY46UPBO.js";import{s as L,u as B,v as ie,z as We}from"./chunk-OFJPOTES.js";import{a as T,d as X}from"./chunk-U7D6Q744.js";import{F as Ne,Ga as qe,g as Me}from"./chunk-HG2YFMVU.js";import{a as je}from"./chunk-BL3CZWWD.js";import{c as Oe}from"./chunk-L3KS6MOV.js";import{b as De}from"./chunk-SSHE6B7Z.js";import{a as tr}from"./chunk-JFXINDOQ.js";import{g as Le}from"./chunk-AJXWJLZA.js";import{_ as _e,ca as Ce,fa as He}from"./chunk-SV7ZBEK2.js";import{F as be}from"./chunk-2MEOUS24.js";import{n as H}from"./chunk-RCT3O3HQ.js";import{p as Ie}from"./chunk-UGOK7VTC.js";import{a as n,e as er}from"./chunk-FTQLQJQV.js";import{randomUUID as Pr}from"node:crypto";import{mkdir as Rr}from"node:fs/promises";import q from"node:path";function ht(e){return async(t,r)=>{let s=await e?.(t,r)??null;if((t.metadata?.standaloneExperiment!==void 0||t.metadata?.localProfileExperiment!==void 0)&&!s)throw new Error("This native Experiment session has no active durable model-dispatch owner.");return s}}n(ht,"experimentSessionStreamResolver");var St=er(tr(),1);import{randomUUID as pe}from"node:crypto";var rr=15e3,or=3e4;function Wr(e){let t=new Set,r=null,s=null;async function p(a){if(!a.profileRef||!a.profileWorkflowId)throw new Error(a.profileMigrationError??`Chat Workflow ${a.id} has no Profile package.`);let u=await e.getSession(a.sessionId),i=await e.resolveProfileOwner(u,a.profileRef),c=await e.readProfilePackage(i.sourcePath,a.profileWorkflowId);return{...a,name:c.name,prompt:c.prompt}}n(p,"authoredWorkflow");async function h(){for(let a of await e.store.listChatWorkflows())if(!(a.profileRef&&a.profileWorkflowId))try{let u=await e.getSession(a.sessionId);if(!u.currentProfile)throw new Error("Original session has no explicit Profile owner.");let i=await e.resolveProfileOwner(u,u.currentProfile),c={...a,profileRef:i.ref,profileWorkflowId:a.profileWorkflowId??`chat-${a.id.toLowerCase()}`,profileMigrationError:null};await e.saveProfilePackage(i.sourcePath,c),await e.store.patchChatWorkflow(a.id,()=>c)}catch(u){let i=`Profile package migration unresolved: ${u instanceof Error?u.message:String(u)}`;await e.store.patchChatWorkflow(a.id,c=>({...c,profileMigrationError:i})),e.logger?.warn("chat workflow Profile migration unresolved",{workflowId:a.id,error:i})}}n(h,"migrateExistingWorkflows");async function w(a){let u=await e.getSession(a.sessionId),i=await e.resolveProfileOwner(u),c=T(),g=Z(a.recurrence,new Date,0);if(!g.value)throw new Error(g.error??"This workflow has no future occurrence.");let k={id:pe(),sessionId:u.id,sessionTitle:u.title,sourceTurnId:a.sourceTurnId??null,name:a.name,prompt:a.prompt,profileRef:i.ref,profileWorkflowId:`chat-${pe()}`,recurrence:a.recurrence,enabled:!0,nextRunAt:g.value,lastRunAt:null,lastRunStatus:null,lastRunId:null,lastError:g.error,scheduledRunCount:0,createdAt:c,updatedAt:c};return await e.saveProfilePackage(i.sourcePath,k),e.store.upsertChatWorkflow(k)}n(w,"create");async function v(){if(e.isClosing())return;let a=await e.store.listDueChatWorkflows(T());for(let u of a)if(!t.has(u.id)){if(e.isSessionTurnActive(u.sessionId)){await e.store.patchChatWorkflow(u.id,i=>({...i,nextRunAt:new Date(Date.now()+or).toISOString(),lastError:"Waiting for the attached chat to finish its current turn.",updatedAt:T()}));continue}await d(u,u.nextRunAt??T(),"schedule")}}n(v,"runTick");function l(){if(s)return s;let a=v().finally(()=>{s===a&&(s=null)});return s=a,a}n(l,"trackedTick");async function d(a,u,i){a=await p(a);let c=T(),g=e.store.home?await He(e.store.home):void 0,k={definitionSnapshot:structuredClone(a),...g?{configurationSnapshot:{effectiveRevision:g.effectiveRevision,sources:g.sources}}:{},id:pe(),workflowId:a.id,sessionId:a.sessionId,scheduledFor:u,trigger:i,status:"queued",turnId:null,error:null,createdAt:c,startedAt:null,completedAt:null,updatedAt:c},y=await e.store.insertChatWorkflowRun(k);return t.add(a.id),e.queue.enqueue({label:"chat-workflow-run",metadata:{workflowId:a.id,sessionId:a.sessionId,trigger:i,scheduledFor:u}},async()=>{try{await f(a,y)}finally{t.delete(a.id)}}),y}n(d,"enqueue");async function f(a,u){let i=T();await e.store.patchChatWorkflowRun(u.id,S=>({...S,status:"running",startedAt:i,updatedAt:i}));let c=null,g=null;try{c=await e.sendTurn(a.sessionId,{prompt:a.prompt,metadata:{interactionKind:"scheduled_workflow",chatWorkflowId:a.id,chatWorkflowName:a.name,chatWorkflowRunId:u.id,scheduledFor:u.scheduledFor}})}catch(S){g=S instanceof Error?S.message:String(S)}let k=T(),y=c?.status==="completed"?"succeeded":"failed";await e.store.patchChatWorkflowRun(u.id,S=>({...S,status:y,turnId:c?.id??null,error:g??c?.error??null,completedAt:k,updatedAt:k})),await e.store.patchChatWorkflow(a.id,S=>{let b=S.scheduledRunCount+(u.trigger==="schedule"?1:0),P=u.trigger==="manual"?{value:S.nextRunAt,error:null}:Z(S.recurrence,new Date,b);return{...S,enabled:P.value?S.enabled:!1,nextRunAt:S.enabled?P.value:null,lastRunAt:k,lastRunStatus:y,lastRunId:u.id,lastError:P.error??g??c?.error??null,scheduledRunCount:b,updatedAt:k}})}return n(f,"execute"),{async start(){r||(await h(),l().catch(a=>e.logger?.warn("chat workflow tick failed",{error:String(a)})),r=setInterval(()=>{l().catch(a=>e.logger?.warn("chat workflow tick failed",{error:String(a)}))},e.tickMs??rr),r.unref?.())},async stop(){r&&clearInterval(r),r=null,await s?.catch(()=>{})},create:w,async list(a){let u=await e.store.listChatWorkflows({sessionId:a});return Promise.all(u.map(async i=>{try{return await p(i)}catch(c){return{...i,profileMigrationError:c instanceof Error?c.message:String(c)}}}))},listRuns:n(a=>e.store.listChatWorkflowRuns(a),"listRuns"),async patch(a,u){let i=await e.store.getChatWorkflow(a);if(!i)return null;let c=T();if("enabled"in u){let S=u.enabled?Z(i.recurrence,new Date,i.scheduledRunCount):{value:null,error:null};return e.store.patchChatWorkflow(a,b=>({...b,enabled:u.enabled&&!!S.value,nextRunAt:u.enabled?S.value:null,lastError:S.error,updatedAt:c}))}let g=Z(u.recurrence,new Date,0);if(!i.profileRef||!i.profileWorkflowId)throw new Error(`Chat Workflow ${a} has no resolved Profile owner; migrate it before editing.`);let k=await e.getSession(i.sessionId),y=await e.resolveProfileOwner(k,i.profileRef);return await e.saveProfilePackage(y.sourcePath,{...i,name:u.name,prompt:u.prompt}),e.store.patchChatWorkflow(a,S=>({...S,name:u.name,prompt:u.prompt,recurrence:u.recurrence,enabled:!!g.value,nextRunAt:g.value,lastError:g.error,scheduledRunCount:0,updatedAt:c}))},remove:n(a=>e.store.deleteChatWorkflow(a),"remove"),async runNow(a){let u=await e.store.getChatWorkflow(a);if(!u)throw new Error("Chat workflow not found.");if(e.isSessionTurnActive(u.sessionId))throw new Error("The attached chat is currently running a turn.");return d(u,T(),"manual")}}}n(Wr,"createChatWorkflowLoop");var nr={sunday:0,monday:1,tuesday:2,wednesday:3,thursday:4,friday:5,saturday:6};function Z(e,t,r){try{return{value:me(e,t,r),error:null}}catch(s){return{value:null,error:s instanceof Error?s.message:String(s)}}}n(Z,"safeNextOccurrence");function me(e,t,r){if(e.end.kind==="after_occurrences"&&r>=e.end.occurrences)return null;let s=wt(e.startDate,e.localTime,e.timeZone);if(e.kind==="once")return s.getTime()>t.getTime()?s.toISOString():null;let[p,h]=e.localTime.split(":").map(Number),w=e.kind==="daily"?`${h} ${p} * * *`:e.kind==="weekdays"?`${h} ${p} * * 1-5`:e.kind==="weekly"?`${h} ${p} * * ${(e.weekdays??[]).map(d=>nr[d]).join(",")}`:`${h} ${p} ${e.dayOfMonth} * *`,v=new Date(Math.max(t.getTime(),s.getTime()-1e3)),l=St.CronExpressionParser.parse(w,{currentDate:v,tz:e.timeZone}).next().toDate();if(e.end.kind==="on_date"){let d=wt(e.end.date,"23:59",e.timeZone);if(l.getTime()>d.getTime()+59999)return null}return l.toISOString()}n(me,"nextOccurrence");function wt(e,t,r){let[s,p,h]=e.split("-").map(Number),[w,v]=t.split(":").map(Number),l=Date.UTC(s,p-1,h,w,v),d=new Date(l);for(let f=0;f<3;f+=1){let a=new Intl.DateTimeFormat("en-CA",{timeZone:r,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).formatToParts(d),u=Object.fromEntries(a.map(g=>[g.type,g.value])),i=Date.UTC(Number(u.year),Number(u.month)-1,Number(u.day),Number(u.hour),Number(u.minute)),c=l-i;if(c===0)return d;d=new Date(d.getTime()+c)}return d}n(wt,"zonedLocalDateTime");function vt(e){return Ie(e,t=>{let r=0,s=0;t.exec("BEGIN IMMEDIATE");try{for(let[p,h,w]of[["local_agent_schedule_runs","local_agent_schedules","scheduleId"],["chat_workflow_runs","chat_workflows","workflowId"]]){let v=t.prepare(`SELECT id, payload FROM ${p} WHERE status IN ('queued','running')`).all();for(let l of v){let d=JSON.parse(l.payload),f=new Date().toISOString(),a=typeof d.turnId=="string"?t.prepare("SELECT payload FROM turns WHERE id = ?").get(d.turnId):void 0,i=(a?JSON.parse(a.payload):null)?.status==="completed",c=i?"The previous scheduled turn completed before shutdown.":"OpenPond stopped before this scheduled run was settled. Its external outcome may be unknown. Review the run before retrying or enabling this schedule.",g=i?"succeeded":"failed";t.prepare(`UPDATE ${p} SET status=?, payload=?, updated_at=? WHERE id=?`).run(g,JSON.stringify({...d,status:g,error:i?null:c,completedAt:f,updatedAt:f}),f,l.id);let k=t.prepare(`SELECT payload FROM ${h} WHERE id = ?`).get(String(d[w]));if(k&&!i){let y=JSON.parse(k.payload);t.prepare(`UPDATE ${h} SET enabled=0, next_run_at=NULL, payload=?, updated_at=? WHERE id=?`).run(JSON.stringify({...y,enabled:!1,nextRunAt:null,lastRunStatus:g,lastRunId:l.id,lastError:c,updatedAt:f}),f,String(d[w]))}if(i&&k&&h==="chat_workflows"){let y=qe.parse(JSON.parse(k.payload)),S=y.scheduledRunCount+(d.trigger==="schedule"?1:0),b=d.trigger==="manual"?y.nextRunAt:me(y.recurrence,new Date(f),S),P=y.enabled&&b!==null;t.prepare("UPDATE chat_workflows SET enabled=?, next_run_at=?, payload=?, updated_at=? WHERE id=?").run(P?1:0,P?b:null,JSON.stringify({...y,enabled:P,nextRunAt:P?b:null,scheduledRunCount:S,lastRunStatus:g,lastRunId:l.id,lastRunAt:f,lastError:null,updatedAt:f}),f,y.id)}i?r+=1:s+=1}}return t.exec("COMMIT"),{recovered:r,needsReview:s}}catch(p){throw t.exec("ROLLBACK"),p}})}n(vt,"reconcileInterruptedScheduledWork");async function kt(e,t){let r=sr(e);if(!r)return null;let s=await t.loadProfileState();return r==="help"?ar(s):ir(s)}n(kt,"runProfileSkillCommand");function sr(e){let t=/^\/skill(?:\s+([\s\S]*))?$/i.exec(e.trim());if(!t)return null;let r=t[1]?.trim().toLowerCase()??"";return!r||r==="list"?"list":r==="help"?"help":null}n(sr,"readOnlyProfileSkillAction");function ar(e){return{handled:!0,action:"help",profile:e,message:["Profile skills support:","- /skill list","- /skill create <what the skill should help with>","- /skill create <skill-name>: <what the skill should help with>","- /skill create --name <skill-name> <what the skill should help with>","- /skill edit <skill-name> <change request>","","Create and edit run as normal model turns with the bundled OpenPond Skill Authoring skill. Skills may include SKILL.md plus focused scripts, references, and assets. Use an Agent when the workflow needs code, actions, durable runtime behavior, setup, or Evals."].join(`
3
3
  `)}}n(ar,"profileSkillHelp");function ir(e){let t=e.skills.slice().sort((s,p)=>s.name.localeCompare(p.name));return{handled:!0,action:"list",message:t.length===0?"No profile skills found in the active profile.":[`Profile skills (${t.length}):`,...t.map(s=>{let p=s.validationStatus==="valid"?"valid":`invalid: ${s.validationMessages.join("; ")}`;return`- ${s.name} (${p}) ${s.path}`})].join(`
4
- `),skills:t,profile:e}}n(ir,"listProfileSkills");import{randomUUID as lr}from"node:crypto";function yt(e){return async function*({messages:t,signal:r}){for await(let s of e({model:Ie,messages:t,requestId:`harness-continuous-review:${lr()}`,reasoningEffort:"medium",maxTokens:be,signal:r}))s.type==="text_delta"&&s.text?yield{text:s.text}:s.type==="usage"&&(yield{usage:{promptTokens:s.usage.prompt_tokens??0,completionTokens:s.usage.completion_tokens??0,totalTokens:s.usage.total_tokens??0}})}}n(yt,"createLocalHarnessEvaluationReviewModelStream");import{promises as Ct}from"node:fs";import N from"node:path";import{createHash as ur}from"node:crypto";import{access as cr,readFile as Pt}from"node:fs/promises";import x from"node:path";import{fileURLToPath as dr}from"node:url";var Tt=["openpond-cli","openpond-skill-authoring","openpond-agent-authoring","openpond-refiner-authoring"],Rt={"openpond-cli":["references/experiments-and-training.md","references/compact-resource-tables.md","references/diagnose-and-improve.md"],"openpond-skill-authoring":["references/skill-package-layout.md","references/copying-and-adaptation.md","references/validation-and-repair.md"],"openpond-agent-authoring":["references/profile-layout.md","references/action-and-chat-design.md","references/integrations-and-setup.md","references/validation-and-repair.md"],"openpond-refiner-authoring":["references/review-profile.md","references/core-boundary.md","references/validation-and-activation.md"]},Et=x.dirname(dr(import.meta.url));function At(e){return Tt.includes(e)}n(At,"isBundledAuthoringSkillName");async function xt(e=process.cwd()){return Promise.all(Tt.map(t=>ee(t,e)))}n(xt,"loadBundledAuthoringSkills");async function ee(e,t=process.cwd()){let r=await _t(e,t),s=await It(e,t),p=Ne.find(h=>h.name===e);if(!p)throw new Error(`Built-in OpenPond authoring skill metadata not found: ${e}`);return{...p,path:x.join(r,"SKILL.md"),sourcePath:r,charCount:s.length,sourceHash:ur("sha256").update(s).digest("hex"),validationMessages:[...p.validationMessages],resourceFiles:[...p.resourceFiles]}}n(ee,"loadBundledAuthoringProfileSkill");async function bt(e,t=process.cwd()){let r=await ee(e,t),s=await It(e,t);return{name:r.name,description:r.description,body:s,path:r.path,sourceHash:r.sourceHash,charCount:r.charCount,packagePath:r.sourcePath,resourceFiles:r.resourceFiles}}n(bt,"readBundledAuthoringProfileSkill");async function It(e,t=process.cwd()){let r=await _t(e,t),[s,...p]=await Promise.all([Pt(x.join(r,"SKILL.md"),"utf8"),...Rt[e].map(h=>Pt(x.join(r,h),"utf8"))]);return[s.trim(),...p.map((h,w)=>`
4
+ `),skills:t,profile:e}}n(ir,"listProfileSkills");import{randomUUID as lr}from"node:crypto";function yt(e){return async function*({messages:t,signal:r}){for await(let s of e({model:be,messages:t,requestId:`harness-continuous-review:${lr()}`,reasoningEffort:"medium",maxTokens:Le,signal:r}))s.type==="text_delta"&&s.text?yield{text:s.text}:s.type==="usage"&&(yield{usage:{promptTokens:s.usage.prompt_tokens??0,completionTokens:s.usage.completion_tokens??0,totalTokens:s.usage.total_tokens??0}})}}n(yt,"createLocalHarnessEvaluationReviewModelStream");import{promises as Ct}from"node:fs";import N from"node:path";import{createHash as ur}from"node:crypto";import{access as cr,readFile as Pt}from"node:fs/promises";import x from"node:path";import{fileURLToPath as dr}from"node:url";var Tt=["openpond-cli","openpond-skill-authoring","openpond-agent-authoring","openpond-refiner-authoring"],Rt={"openpond-cli":["references/experiments-and-training.md","references/compact-resource-tables.md","references/diagnose-and-improve.md"],"openpond-skill-authoring":["references/skill-package-layout.md","references/copying-and-adaptation.md","references/validation-and-repair.md"],"openpond-agent-authoring":["references/profile-layout.md","references/action-and-chat-design.md","references/integrations-and-setup.md","references/validation-and-repair.md"],"openpond-refiner-authoring":["references/review-profile.md","references/core-boundary.md","references/validation-and-activation.md"]},Et=x.dirname(dr(import.meta.url));function At(e){return Tt.includes(e)}n(At,"isBundledAuthoringSkillName");async function xt(e=process.cwd()){return Promise.all(Tt.map(t=>ee(t,e)))}n(xt,"loadBundledAuthoringSkills");async function ee(e,t=process.cwd()){let r=await _t(e,t),s=await It(e,t),p=Ne.find(h=>h.name===e);if(!p)throw new Error(`Built-in OpenPond authoring skill metadata not found: ${e}`);return{...p,path:x.join(r,"SKILL.md"),sourcePath:r,charCount:s.length,sourceHash:ur("sha256").update(s).digest("hex"),validationMessages:[...p.validationMessages],resourceFiles:[...p.resourceFiles]}}n(ee,"loadBundledAuthoringProfileSkill");async function bt(e,t=process.cwd()){let r=await ee(e,t),s=await It(e,t);return{name:r.name,description:r.description,body:s,path:r.path,sourceHash:r.sourceHash,charCount:r.charCount,packagePath:r.sourcePath,resourceFiles:r.resourceFiles}}n(bt,"readBundledAuthoringProfileSkill");async function It(e,t=process.cwd()){let r=await _t(e,t),[s,...p]=await Promise.all([Pt(x.join(r,"SKILL.md"),"utf8"),...Rt[e].map(h=>Pt(x.join(r,h),"utf8"))]);return[s.trim(),...p.map((h,w)=>`
5
5
  ## Bundled reference: ${Rt[e][w]}
6
6
 
7
7
  ${h.trim()}`)].join(`
8
- `)}n(It,"loadBundledAuthoringSkillBundle");async function _t(e,t=process.cwd(),r=process.execPath){let s=[x.resolve(t,"apps","cli","skills",e),x.resolve(t,"dist","skills",e),x.resolve(x.dirname(r),"skills",e),x.resolve(Et,"skills",e),x.resolve(Et,"..","skills",e)];for(let p of s)if(await cr(x.join(p,"SKILL.md")).then(()=>!0,()=>!1))return p;throw new Error(`Bundled OpenPond authoring skill ${e} was not found. Checked: ${s.join(", ")}`)}n(_t,"resolveBundledAuthoringSkillRoot");var Ht=24e3;function Wt(e){return[{name:"refiner_profile_inspect",description:"Inspect the separately versioned active Refiner Review Profile, its immutable release identity, and recent transitions. Use before editing Refiner behavior.",parameters:{type:"object",additionalProperties:!1,properties:{}},execute:n(async t=>I(t.callId,"refiner_profile_inspect",await(await import("./refiner-profile-service-ATEFPF5O.js")).inspectRefinerProfile(e.storeDir)),"execute")},{name:"refiner_profile_update",description:"Validate and write a complete JSON Refiner Review Profile as a new immutable Refiner release. Activation is explicit; normal Harness refinement never calls this tool.",parameters:{type:"object",additionalProperties:!1,properties:{profile:{type:"object",additionalProperties:!1,properties:{schemaVersion:{type:"string",const:"openpond.refinerReviewProfile.v1"},id:{type:"string",minLength:1,maxLength:120},version:{type:"string",minLength:1,maxLength:120},name:{type:"string",minLength:1,maxLength:200},objective:{type:"string",minLength:1,maxLength:1e4},instructions:{type:"array",maxItems:100,items:{type:"object",additionalProperties:!1,properties:{id:{type:"string",minLength:1,maxLength:120},text:{type:"string",minLength:1,maxLength:1e4}},required:["id","text"]}},allowedProposalRoutes:{type:"array",items:{type:"string",enum:["memory","prompt","skill","agent"]},maxItems:4},allowedExternalRoutes:{type:"array",items:{type:"string",enum:["runtime","product","taskset","training"]},maxItems:4}},required:["schemaVersion","id","version","name","objective","instructions","allowedProposalRoutes","allowedExternalRoutes"]},activate:{type:"boolean"},reason:{type:"string",minLength:1,maxLength:1e4}},required:["profile","activate","reason"]},execute:n(async t=>{let r=await ee("openpond-refiner-authoring");return I(t.callId,"refiner_profile_update",await(await import("./refiner-profile-service-ATEFPF5O.js")).updateRefinerProfile(e.storeDir,{profile:t.args.profile,activate:t.args.activate,reason:te(t.args.reason,1e4),actor:`work:${t.session.id}`,authoringSkillHash:r.sourceHash}))},"execute")},{name:"memory_search",description:"Search bounded active Personal Harness memory without loading the full memory corpus into context. Returns ranked stable memory keys and excerpts.",parameters:{type:"object",additionalProperties:!1,properties:{query:{type:"string",minLength:1,maxLength:500},limit:{type:"integer",minimum:1,maximum:20}},required:["query"]},execute:n(async t=>{let r=await M(e.store,t.session.id);if(!r)throw new Error("No Local Harness is selected for this run.");let s=te(t.args.query,500).toLowerCase(),p=[...new Set(s.split(/[^a-z0-9]+/).filter(l=>l.length>1))],h=typeof t.args.limit=="number"?Math.max(1,Math.min(20,Math.trunc(t.args.limit))):8,v=(await e.store.listHarnessMemories(r.workspace.id)).map(l=>{let d=`${l.key} ${l.tags.join(" ")} ${l.content}`.toLowerCase(),f=p.reduce((a,u)=>a+(d.includes(u)?1:0),0);return{entry:l,score:f}}).filter(({score:l})=>p.length===0||l>0).sort((l,d)=>d.score-l.score||d.entry.updatedAt.localeCompare(l.entry.updatedAt)).slice(0,h).map(({entry:l,score:d})=>({key:l.key,revision:l.revision,score:d,excerpt:l.content.slice(0,1e3),tags:l.tags,updatedAt:l.updatedAt}));return I(t.callId,"memory_search",{query:s,matches:v})},"execute")},{name:"memory_inspect",description:"Read one exact active Personal Harness memory entry returned by memory_search.",parameters:{type:"object",additionalProperties:!1,properties:{key:{type:"string",minLength:1,maxLength:120}},required:["key"]},execute:n(async t=>{let r=await M(e.store,t.session.id);if(!r)throw new Error("No Local Harness is selected for this run.");let s=te(t.args.key,120).toLowerCase(),p=await e.store.getHarnessMemory(r.workspace.id,s);if(!p||p.status!=="active")throw new Error(`Harness memory does not exist: ${s}.`);return I(t.callId,"memory_inspect",p)},"execute")},{name:"context_read",description:"Read a bounded slice of the current Agent run's canonical host-owned turns or runtime events. This never exposes other conversations or the whole history corpus.",parameters:{type:"object",additionalProperties:!1,properties:{scope:{type:"string",enum:["turns","events"]},limit:{type:"integer",minimum:1,maximum:50}},required:["scope"]},execute:n(async t=>{let r=typeof t.args.limit=="number"?Math.max(1,Math.min(50,Math.trunc(t.args.limit))):12;if(t.args.scope==="turns"){let s=await e.store.turnsForSession(t.session.id,r);return I(t.callId,"context_read",{scope:"turns",values:s.map(p=>Ot(p,6e3))})}if(t.args.scope==="events"){let s=await e.store.runtimeEventsForSession(t.session.id,{limit:r});return I(t.callId,"context_read",{scope:"events",values:s.map(p=>Ot(p,6e3))})}throw new Error("context_read scope must be turns or events.")},"execute")},{name:"harness_inspect",description:"Inspect the immutable Harness release pinned to this Agent run. With no path, returns its release, overlay, and component catalog. With a policy-visible text path, returns bounded exact source content.",parameters:{type:"object",additionalProperties:!1,properties:{path:{type:"string",minLength:1,description:"Optional exact Harness-relative source path from the returned catalog."}}},execute:n(async t=>{let r=await M(e.store,t.session.id);if(!r)throw new Error("No Local Harness release is selected for this run.");let s=await e.store.getHarnessRunOverlay(t.session.id),p=N.join(r.release.bundlePath,"source"),h=je.parse(JSON.parse(await Ct.readFile(N.join(p,"harness.json"),"utf8"))),w=typeof t.args.path=="string"?t.args.path.trim().replaceAll("\\","/"):null,v=null;if(w){let l=h.files.find(f=>f.path===w);if(!l||l.visibility!=="policy")throw new Error(`Harness source is not policy-visible or declared: ${w}`);if(!l.mediaType.startsWith("text/")&&l.mediaType!=="application/json")throw new Error(`Harness source is not inspectable text: ${w}`);let d=await Ct.readFile(pr(p,w),"utf8");v={path:w,content:d.slice(0,Ht),truncated:d.length>Ht}}return I(t.callId,"harness_inspect",{workspace:{id:r.workspace.id,name:r.workspace.name,revision:r.workspace.revision,channel:r.workspace.currentChannel},pinnedRelease:{id:r.release.harnessRelease.id,contentHash:r.release.harnessRelease.contentHash,sourceRevision:r.release.sourceRevision},overlay:s?{id:s.id,revision:s.revision,status:s.status,contentHash:s.contentHash}:null,components:h.files.filter(l=>l.visibility==="policy").map(l=>({kind:l.kind,path:l.path,portability:l.portability})),source:v})},"execute")},{name:"skill_inspect",description:"Read one exact textual Skill from the immutable Harness release pinned to this run. Use this before asking the Refiner to update an existing Skill.",parameters:{type:"object",additionalProperties:!1,properties:{name:{type:"string",minLength:1,description:"Exact Skill name from harness_inspect."}},required:["name"]},execute:n(async t=>{let r=await M(e.store,t.session.id),s=typeof t.args.name=="string"?t.args.name.trim():"";if(!r?.skillRuntime.readSkill||!s)throw new Error("A valid Skill name and a selected Local Harness are required.");return I(t.callId,"skill_inspect",await r.skillRuntime.readSkill(s))},"execute")},{name:"refine_request",description:"Mark a concrete reusable lesson from the current turn for bounded Harness refinement at the next safe tool boundary. Immediate task recovery remains your responsibility. Do not call for one-off errors or transient facts.",parameters:{type:"object",additionalProperties:!1,properties:{summary:{type:"string",minLength:1,maxLength:2e3},suggestedRoute:{type:"string",enum:["runtime","memory","prompt","skill","agent","product","taskset","training"]}},required:["summary"]},execute:n(async t=>I(t.callId,"refine_request",{queuedAtBoundary:!0,summary:te(t.args.summary,2e3),suggestedRoute:typeof t.args.suggestedRoute=="string"?t.args.suggestedRoute:null}),"execute")},{name:"refine_status",description:"Inspect bounded Refiner trigger, proposal, route, validation, and outcome status for this Agent run.",parameters:{type:"object",additionalProperties:!1,properties:{}},execute:n(async t=>{let r=await M(e.store,t.session.id);if(!r)throw new Error("No Local Harness is selected for this run.");let s=n(async i=>e.store.listHarnessImprovementArtifacts(r.workspace.id,i,200),"all"),p=(await s("trigger_decision")).filter(i=>i.schemaVersion==="openpond.refinementTriggerDecision.v1").filter(i=>i.runRef===t.session.id),h=new Set(p.map(i=>U(i))),w=n(i=>h.has(U(fe(i.trigger))),"relatedToTrigger"),v=(await s("route_decision")).filter(i=>i.schemaVersion==="openpond.improvementRouteDecision.v1").filter(w),l=(await s("refiner_outcome")).filter(i=>i.schemaVersion==="openpond.harnessRefinerOutcome.v1").filter(w),d=new Set(l.flatMap(i=>{let c=fe(i.proposal);return c.id&&c.contentHash?[U(c)]:[]})),f=(await s("proposal")).filter(i=>i.schemaVersion==="openpond.harnessImprovementProposal.v1").filter(i=>d.has(U(i))),a=n(i=>d.has(U(fe(i.proposal))),"relatedToProposal"),u=[{kind:"trigger_decision",values:p},{kind:"route_decision",values:v},{kind:"proposal",values:f},{kind:"targeted_validation",values:(await s("targeted_validation")).filter(a)},{kind:"apply_receipt",values:(await s("apply_receipt")).filter(a)},{kind:"refiner_outcome",values:l}];return I(t.callId,"refine_status",{runId:t.session.id,artifacts:u})},"execute")}]}n(Wt,"createLocalHarnessModelToolDefinitions");function U(e){return`${String(e.id??"")}:${String(e.contentHash??"")}`}n(U,"artifactRefKey");function fe(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}n(fe,"asRecord");function I(e,t,r){return{toolCallId:e,name:t,ok:!0,contentText:JSON.stringify(r),data:r}}n(I,"modelResult");function te(e,t){if(typeof e!="string"||!e.trim())throw new Error("A non-empty refinement summary is required.");return e.trim().slice(0,t)}n(te,"boundedText");function Ot(e,t){let r=JSON.stringify(e);return r.length<=t?e:{truncated:!0,json:r.slice(0,t)}}n(Ot,"boundedJson");function pr(e,t){let r=N.resolve(e),s=N.resolve(r,...t.split("/")),p=N.relative(r,s);if(!p||p.startsWith("..")||N.isAbsolute(p))throw new Error(`Harness source path escapes its release: ${t}`);return s}n(pr,"containedSourcePath");function Lt(){return{loadOpenPondProfileStateForRef:ie,executeProfileSkillCommand:n(({prompt:e,profileRef:t})=>kt(e,{loadProfileState:n(()=>ie(t),"loadProfileState")}),"executeProfileSkillCommand")}}n(Lt,"createProfileTurnDependencies");import{randomUUID as mr}from"node:crypto";import{setTimeout as fr}from"node:timers/promises";async function Dt(e,t){if(t.metadata?.titleSource||t.archived||t.hiddenFromDefaultSidebar)return t;let s=(await e.runtimeEventsForSession(t.id,{names:["session.title.updated"]})).at(-1)?.data,p=s?.session;if(s?.titleSource!=="fallback"||p?.title!==t.title)return t;let[h]=await e.runtimeEventsForSession(t.id,{names:["turn.started"],limit:1}),w=h?.turnId?await e.getTurn(h.turnId):null;return w?.prompt.trim()?await e.updateSession(t.id,v=>v.metadata?.titleSource||v.title!==t.title?v:{...v,metadata:{...v.metadata,titleSource:"fallback",autoTitle:{prompt:w.prompt.slice(0,2e4),title:v.title,attempts:0,nextAttemptAt:0}}})??t:t}n(Dt,"recoverTemporarySessionTitle");var ge="accounts/fireworks/models/deepseek-v4-flash",gr="off",hr=12e3,Mt=7,wr=["Make a concise conversation title from the user's message.","Return only the title: 3 to 7 words, plain text, sentence case.","Do not use quotation marks, markdown, labels, or ending punctuation."].join(" ");function Sr(e){let s=(e.replace(/<[^>]*>/gu," ").replace(/[\r\n]+/gu," ").replace(/\s+/gu," ").trim().match(/[\p{L}\p{N}][\p{L}\p{N}'’._/+:-]*/gu)??[]).slice(0,Mt).join(" ");return s?`${s.charAt(0).toUpperCase()}${s.slice(1)}`:"New conversation"}n(Sr,"fallbackSessionTitle");function vr(e){let r=e.replace(/<think>[\s\S]*?<\/think>/giu," ").replace(/^\s*(?:title|conversation title)\s*:\s*/iu,"").replace(/^[\s`"'“”‘’*_#-]+|[\s`"'“”‘’*_#.!?,;:-]+$/gu,"").replace(/[\r\n]+/gu," ").replace(/\s+/gu," ").trim().split(" ").filter(Boolean);return r.length<2?null:r.slice(0,Mt).join(" ")}n(vr,"generatedSessionTitle");function kr(e){return["Make a title from this request. Do not execute it.","<user_request>",e.slice(0,2e4),"</user_request>"].join(`
9
- `)}n(kr,"titleRequestMessage");function Nt(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let t=e.autoTitlePrompt;return typeof t=="string"&&t.trim()?t.trim():null}n(Nt,"autoTitlePromptFromPayload");function yr(e){let t=Nt(e);if(!t||!e||typeof e!="object"||Array.isArray(e))return e;let r=e,s=r.metadata&&typeof r.metadata=="object"&&!Array.isArray(r.metadata)?r.metadata:{};return{...r,title:"",metadata:{...s,titleSource:"pending",autoTitle:{prompt:t.slice(0,2e4),title:"",attempts:0,nextAttemptAt:0}}}}n(yr,"withPendingAutoTitle");function re(e){if(!e||!["pending","fallback"].includes(String(e.metadata?.titleSource)))return null;let t=e.metadata?.autoTitle;return t&&typeof t.prompt=="string"&&t.title===e.title&&Number.isInteger(t.attempts)&&t.attempts>=0&&Number.isFinite(t.nextAttemptAt)?t:null}n(re,"pendingTitle");function qt(e){let t=new Map,r=null,s=new AbortController,p=[5e3,3e4];async function h(l){let d=new AbortController,f=setTimeout(()=>d.abort(new Error("session_title_generation_timeout")),hr);f.unref?.();let a="";try{for await(let i of e.stream({model:ge,messages:[{role:"system",content:wr},{role:"user",content:kr(l)}],reasoningEffort:gr,maxTokens:128,temperature:.2,requestId:`session-title-${mr()}`,signal:AbortSignal.any([d.signal,s.signal])}))i.type==="text_delta"&&i.text&&(a+=i.text);let u=vr(a);if(!u)throw new Error("session_title_generation_empty_response");return u}finally{clearTimeout(f)}}n(h,"generate");async function w(l){for(;!s.signal.aborted;){let d=re(await e.store.getSession(l));if(!d||d.attempts>=3)return;let f=d.nextAttemptAt-Date.now();f>0&&await fr(f,void 0,{signal:s.signal,ref:!1});let a=re(await e.store.getSession(l));if(!a||a.attempts!==d.attempts)return;let u,i="model";try{u=await h(d.prompt)}catch(k){if(s.signal.aborted)return;u=Sr(d.prompt),i="fallback",e.logger.warn("session title generation used temporary title",{error:k instanceof Error?k.message:String(k),model:ge,sessionId:l,attempt:d.attempts+1})}if(s.signal.aborted)return;let c=!1,g=await e.store.updateSession(l,k=>{let y=re(k);return!y||y.attempts!==d.attempts||y.prompt!==d.prompt?k:(c=!0,{...k,title:u,metadata:{...k.metadata,titleSource:i,autoTitle:i==="model"?null:{...d,title:u,attempts:d.attempts+1,nextAttemptAt:Date.now()+(p[d.attempts]??0)}}})});if(!c||!g||(await e.appendRuntimeEvent(X({sessionId:l,name:"session.title.updated",source:"server",status:"completed",data:{session:g,model:ge,titleSource:i}})),i==="model"))return}}n(w,"run");function v(l){if(s.signal.aborted)return Promise.resolve();let d=t.get(l);if(d)return d;let f=w(l).catch(a=>{s.signal.aborted||e.logger.warn("session title generation failed",{error:a instanceof Error?a.message:String(a),sessionId:l})}).finally(()=>t.delete(l));return t.set(l,f),f}return n(v,"schedule"),{wrapCreateSession(l){return this.recover().catch(d=>e.logger.warn("Session title recovery failed",{error:String(d)})),async d=>{let f=await l(yr(d));return Nt(d)&&v(f.id),f}},schedule:v,recover(){return r||(r=(async()=>{for(let l of await e.store.sessionShells()){if(s.signal.aborted)return;let d=await Dt(e.store,l);re(d)&&v(l.id)}})().finally(()=>{r=null}),r)},async close(){s.abort(),await r?.catch(()=>{}),await Promise.allSettled(t.values())}}}n(qt,"createSessionTitleService");var Er=3,Tr=["sqlite_store","runtime_event_bus","session_store","hosted_provider","web_search","connected_apps","workspace_tools","command_approvals","harness","refiner","agent_runtime","jsonl_transport"];async function gn(e={}){if(e.runtimeStorage)return(await import("./hosted-app-server-composition-Y64A2A2B.js")).createHostedOwnedAppServer({...e,runtimeStorage:e.runtimeStorage});let t=q.resolve(e.storeDir??de());return Fe(t,()=>Ar({...e,storeDir:t}))}n(gn,"createOpenPondAppServer");async function Ar(e){let t=q.resolve(e.storeDir??de()),r=!!e.embedding;if(r&&!e.streamOpenPondHostedChatTurn)throw new Error("Embedded Work requires an explicit model-stream adapter.");let s=e.services??{},p=await $(s.webSearch,r,async()=>(await import("./web-search-56QRZGPR.js")).createWebSearchExecutorFromEnv()),h=await $(s.scheduling,r,async()=>(await import("./saved-work-3OAVRBH3.js")).createHostedSavedWork),w=await $(s.connectedApps,r,async()=>{let[o,m]=await Promise.all([import("./connected-app-executor-DFHWNMRM.js"),import("./app-server-connected-apps-IB6M35NS.js")]);return{execute:o.createCloudConnectedAppToolExecutor(),list:m.listAppServerIntegrationConnections}}),v=await $(s.tasksets,r,async()=>(await import("./hosted-tasksets-7VMYOTIO.js")).executeHostedTasksetAction),l=s.backgroundReview??!r,d=!r&&!!v;await Ce(t),l&&await(await import("./refiner-profile-service-ATEFPF5O.js")).initializeRefinerProfile(t);let f=q.resolve(e.workspaceDir??process.cwd());await Rr(f,{recursive:!0});let a=e.version??De,u=Ue(),i=Ve({channel:"app-server",logDir:q.join(t,"logs"),metadata:{version:a,runtimeVersion:u,placement:"hosted_work"}});D(()=>i.flush());let c=new pt(t,{logger:i});D(()=>c.close()),await c.recentTurns(1);let g=c,k=n(async()=>(await He(t)).preferences,"loadRuntimePreferences"),y=vt(t);(y.recovered||y.needsReview)&&i.warn("Scheduled work requires review after restart",y);let S=nt(e.streamOpenPondHostedChatTurn??Be,{enabled:ot()}),b=yt(S),{appendRuntimeEvent:P,closeEventSubscribers:jt,subscribeRuntimeEvents:Ft}=it({logger:i,store:g}),he=Y({queueId:"turn-follow-up",logger:i}),we=Y({queueId:"harness-refiner",logger:i}),Se=Y({queueId:"subagent",logger:i});if(e.harness&&e.profileSource)throw new Error("Configure either an explicit Harness source or Profile source for this app-server.");let A=null,z,oe;if(e.experimentHarnessSource){if(!e.experimentPolicyClient||e.profileSource||e.harness||e.runtimeStorage)throw new Error("A published standalone Experiment source requires its isolated policy owner and local case store.");let o=e.experimentHarnessSource.sourcePackage;z=await(await import("./published-experiment-source-YBBPLNF2.js")).installPublishedExperimentSource({store:c,storeDir:t,ownerId:e.experimentHarnessSource.ownerId,sourcePackage:o,reference:{harnessRelease:{id:o.harnessRelease.id,contentHash:o.harnessRelease.contentHash},agentSnapshot:{id:o.agentSnapshot.id,contentHash:o.agentSnapshot.contentHash},sourcePackageHash:o.contentHash},createdAt:T()})}if(e.profileSource){let o=e.profileSource;if(!o.repositoryId.trim()||!o.profileId.trim()||!o.sourceRevision.trim())throw new Error("Explicit Profile source requires an identity and accepted revision.");let m=await Le({repoPath:o.repoPath,profileId:o.profileId});if(m.mode!=="local"||!m.sourcePath||m.error||m.git?.isRepo&&(m.git.head!==o.sourceRevision||m.git.dirty))throw new Error("Explicit Profile source does not match its accepted revision.");A=await Je({store:c,storeDir:t,workspaceId:`${Xe}${H({profileId:o.profileId,sourceRevision:o.sourceRevision}).slice(0,24)}`,ownerId:"desktop-personal",name:o.profileId,profile:m,sourceRevision:o.sourceRevision,repositoryId:o.repositoryId})}e.harness&&(await Ke({store:c,storeDir:t,sourceDir:e.harness.sourceDirectory,id:e.harness.workspaceId,name:e.harness.name,ownerId:"desktop-personal"}),await c.selectHarnessWorkspace({ownerKind:"personal",ownerId:"desktop-personal",workspaceId:e.harness.workspaceId,updatedAt:T()})),await Ge({store:c,storeDir:t,loadProfileState:L,now:T}).catch(o=>{i.warn("app-server Harness initialization failed",{error:o})});let V=rt({appendRuntimeEvent:P,findLocalProject:n(o=>lt(c,o),"findLocalProject"),onRepositoryInstructionDiagnostic:n((o,m)=>{i.warn("repository instruction file skipped",{diagnostic:o,sessionId:m.id})},"onRepositoryInstructionDiagnostic")}),{createSession:j,getSession:C,updateSession:K,completeTurn:Bt,failTurn:Ut,interruptTurn:$t}=dt({store:g,defaultSessionCwd:n(()=>f,"defaultSessionCwd"),appendRuntimeEvent:P,loadAppPreferences:k,loadLastUsedProfile:n(async()=>(await B()).lastUsed,"loadLastUsedProfile")}),ve=qt({appendRuntimeEvent:P,store:g,logger:i,stream:S}),ke=r?j:ve.wrapCreateSession(j),J=at({workspaceDir:f,logger:i,getSession:C,updateSession:K,appendRuntimeEvent:P,sandboxRequest:e.sandboxRequest??(r?async()=>{throw new Error("Sandbox execution is not configured in this app-server deployment.")}:void 0)}),zt=d?await(await import("./local-harness-taskset-review-6KJN3EQL.js")).createLocalHarnessTasksetReviewControl({store:c,storeDir:t,evaluationRuntime:{streamOpenPondHostedChatTurn:S,workRuntime:{createSession:j,getSession:C,executeWorkspaceTool:J.executeWorkspaceTool,runtimeEventsForSession:n(o=>g.runtimeEventsForSession(o),"runtimeEventsForSession")},resolveReleasedHarness:n(async()=>{let o=await Qe(c);return o?{agentSnapshot:o.release.agentSnapshot,harnessRelease:o.release.harnessRelease,instructionContext:o.instructionContext}:null},"resolveReleasedHarness")}}):void 0,ye=n(async o=>{await g.upsertApproval(o)},"upsertApproval"),Pe=et({upsertApproval:ye,appendRuntimeEvent:P}),Vt=await $(s.projectActions,r,async()=>(await import("./project-action-payload-7DRABTHY.js")).createProjectActionRunPayload({appendRuntimeEvent:P,resolveProjectRoot:n(async()=>null,"resolveProjectRoot")})),Kt=n(async o=>{try{await g.upsertModelUsageRecord(o)}catch(m){await P(br(o,m)).catch(()=>{})}},"safeUpsertModelUsageRecord"),Re=l?(await import("./local-harness-improvement-runtime-UIKQSAMM.js")).createLocalHarnessImprovementRuntime({store:c,storeDir:t,queue:we,streamOpenPondHostedChatTurn:S,appendRuntimeEvent:P,upsertModelUsageRecord:Kt}):void 0;await Re?.reconcilePending();let ne=e.profileExternalDataset?await(A&&e.profileExternalDatasetClient?(await import("./host-profile-external-dataset-4HOXANWK.js")).createHostProfileExternalDataset({value:e.profileExternalDataset,release:A,sourceRevision:e.profileSource.sourceRevision,client:e.profileExternalDatasetClient}):Promise.reject(new Error("External Dataset execution requires an explicit private Profile source owner."))):null,Jt=$e({deviceId:`evaluation-${H(t).slice(0,24)}`,storeDir:t,runtimeEventsForSession:n(o=>g.runtimeEventsForSession(o),"runtimeEventsForSession")}),_=A?(await import("./host-profile-evaluation-tools-LMCJ3MDJ.js")).createHostProfileEvaluationTools({storeDir:t,release:A,getTurn:n(o=>g.getTurn(o),"getTurn"),getSession:C,saveOutput:Jt.saveOwnedOutputBytes,recordOutput:n(async(o,m,E)=>{await P({id:Pr(),timestamp:new Date().toISOString(),name:"workspace_action_result",source:"server",sessionId:o,turnId:m,action:"work_output_save",status:"completed",output:`Saved ${E.outputRef.title} as immutable case output.`,data:E})},"recordOutput"),authorize:n(async o=>{if(ne){await ne.authorize(o);return}let m=await Te();if(!m||m.ref.profileId!==e.profileSource?.profileId||m.sourceRevision!==e.profileSource?.sourceRevision)throw new Error("The released evaluation source authority changed.");let E=await c.getHarnessReleaseRecord(A.harnessRelease.contentHash);if(!E||E.harnessRelease.contentHash!==A.harnessRelease.contentHash)throw new Error("The isolated evaluation release is unavailable.")},"authorize")}):null,G=e.embedding?gt(e.embedding,async(o,m)=>{let E=await g.getTurn(o);if(!E)throw new Error("Embedded turn is unavailable.");let O=await C(E.sessionId),F=O.metadata?.embeddingToolBindings,W=[...m].sort((Q,Zt)=>Q.name.localeCompare(Zt.name));if(F!==void 0&&H(F)!==H(W))throw new Error("Embedded tool bindings changed; start a new thread.");await K(O.id,{metadata:{...O.metadata,embeddingToolBindings:W}}),await g.updateTurn(o,Q=>({...Q,metadata:{...Q.metadata,toolBindings:W}}))}):void 0,R=ut({executionHost:r?"embedded":"local",storageHome:t,workInputsForSession:e.workInputsForSession,finalizeWorkTurn:e.finalizeWorkTurn,isolatedProfileEvaluationForTurn:_?async o=>{if(o.metadata?.profileEvaluationRun===void 0)return!1;if(!_.ownsSession(o.id))throw new Error("A Profile evaluation target has no actual admitted case owner.");return!0}:void 0,executeProfileEvaluationAction:_?.executeAction,resolveModelTools:e.resolveModelTools||_||G?async o=>{let m=_?_.ownsSession(o.session.id)?await _.resolveTools(o):await G?.(o)??[]:G?await G(o):o.tools;return e.resolveModelTools?e.resolveModelTools({...o,tools:m}):m}:void 0,...r?{hostedToolFlags:{toolMode:"native",nativeToolTransport:!0,nativeToolProviderDenylist:[],textToolFallback:!1}}:{},attachmentRootDir:q.join(t,"attachments"),store:g,inboxStore:c,createSession:j,upsertApproval:ye,getSession:C,updateSession:K,completeTurn:Bt,failTurn:Ut,interruptTurn:$t,defaultSessionCwd:n(()=>f,"defaultSessionCwd"),findOpenPondApp:n(async o=>xr(o,f),"findOpenPondApp"),resolveSessionWorkspaceCwd:n(async o=>o.cwd?.trim()||f,"resolveSessionWorkspaceCwd"),ensureCodexRuntime:n(async()=>{throw new Error("The hosted app-server placement uses the OpenPond provider; Codex process hosting is not configured.")},"ensureCodexRuntime"),appendWorkspaceDiffEvent:J.appendWorkspaceDiffEvent,workspaceDiffBaseline:J.workspaceDiffBaseline,appendRuntimeEvent:P,processHarnessImprovementBoundary:Re,executeWorkspaceTool:J.executeWorkspaceTool,executeOpenPondCommand:Pe.executeCommand,executeProjectAction:Vt,executeDatasetBuilderAction:v,loadOpenPondProfileState:L,...Lt(),...r||s.profileActions===!1?{executeProfileSkillCommand:void 0}:{},loadOpenPondProfileLibrary:B,readOpenPondProfileSkill:We,loadSelectedHarnessRuntime:n(o=>ce(c,o),"loadSelectedHarnessRuntime"),ensureHarnessRunOverlay:n(o=>ue({store:c,...o}),"ensureHarnessRunOverlay"),harnessModelTools:Wt({store:c,storeDir:t}).filter(o=>l||!["refiner_profile_inspect","refiner_profile_update","refine_request","refine_status"].includes(o.name)),loadBuiltInOpenPondSkills:n(async()=>[await mt(),...await xt()],"loadBuiltInOpenPondSkills"),readBuiltInOpenPondSkill:n(async o=>{if(o==="openpond-taskset-authoring")return ft();if(At(o))return bt(o);throw new Error(`Built-in OpenPond skill not found: ${o}`)},"readBuiltInOpenPondSkill"),executeWebSearch:p,createScheduledWork:h,executeConnectedAppTool:w?.execute,listIntegrationConnections:w?.list,loadPersonalizationSoul:n(async()=>(await tt(c,t)).soul,"loadPersonalizationSoul"),loadAppPreferences:k,maybeCreateScaffoldForTurn:V.maybeCreateScaffoldForTurn,hostedSystemPrompt:V.hostedSystemPrompt,appendAssistantText:V.appendAssistantText,appendHostedContextUsage:V.appendHostedContextUsage,streamOpenPondHostedChatTurn:S,turnFollowUpQueue:he,resolveSessionModelStream:ht(async(o,m)=>await oe?.resolveSessionModelStream(o,m)??await e.resolveSessionModelStream?.(o,m)??null),subagentQueue:Se,maxHostedWorkspaceToolRounds:e.experimentHarnessSource?(await import("./experiments-VOCZ4DW3.js")).STANDALONE_EXPERIMENT_MAX_POLICY_CALLS:ct(e.maxHostedWorkspaceToolRounds),maxRepeatedInvalidToolRequests:Er});D(()=>R.close()),await R.recoverPendingSubagentCompletions(),await R.recoverTaskInbox();async function Gt(o,m){let E=await R.resolveNativeAgentApproval(o,m);if(E)return E;let O=await Pe.resolveApproval(o,m);if(O)return O;let F=await R.resolveCreateImproveApproval(o,m);if(F)return F;let W=await R.resolveSubagentPatchApplyApproval(o,m);if(W)return W;throw new Error(`Approval not found: ${o}`)}n(Gt,"resolveApproval");let Ee=!1,Te=n(async()=>{if(e.profileSource)return{ref:{source:"openpond_git",repositoryId:e.profileSource.repositoryId,profileId:e.profileSource.profileId},sourceRevision:e.profileSource.sourceRevision};let[o,m]=await Promise.all([B(),L()]);return o.lastUsed&&m.git?.head&&!m.git.dirty?{ref:o.lastUsed,sourceRevision:m.git.head}:null},"selectedEvaluationProfile"),Ae=n(async()=>{if(e.profileSource&&A)return Ze({store:c,release:A,ref:{source:"openpond_git",repositoryId:e.profileSource.repositoryId,profileId:e.profileSource.profileId},sourceRevision:e.profileSource.sourceRevision});let[o,m]=await Promise.all([B(),L()]);if(!o.lastUsed)throw new Error("Select a Profile before loading its workflows.");return Ye({store:c,storeDir:t,ref:o.lastUsed,profile:m,reloadProfile:L})},"listProfileWorkflows");if(z){let o=z;oe=(await import("./standalone-experiment-turn-owner-CDRMGLWW.js")).createStandaloneExperimentTurnOwner({store:c,createSession:j,sendTurn:R.sendTurn,interruptSessionTurn:R.interruptSessionTurn,authorizeWorkspace:n(async(m,E)=>{if(E.id!==o.workspace.id||H(E.ownerScope)!==H(o.workspace.ownerScope)||m.sourcePackageHash!==o.workspace.metadata.experimentSourcePackageHash||m.harnessRelease.id!==o.release.harnessRelease.id||m.harnessRelease.contentHash!==o.release.harnessRelease.contentHash)throw new Error("Standalone Experiment source differs from this execution owner's admitted closure.")},"authorizeWorkspace")})}let se=le(async()=>{let{createAppServerEvaluations:o}=await import("./app-server-evaluations-5YZUFXQ2.js");return o({options:e,store:c,storeDir:t,explicitProfileRelease:A,externalDataset:ne,isolatedProfileTools:_,selectedEvaluationProfile:Te,listProfileWorkflows:Ae,createSessionWithAutoTitle:ke,turnRunner:R,streamOpenPondHostedChatTurn:S,publishedExperimentSource:z,standaloneExperimentOwner:oe})}),Qt=se.methods(["listProfileEvaluations","executeProfileEvaluationCase","executeExperimentCase","cancelExperimentCase","executeProfileEvaluationRun","prepareProfileEvaluationRun","runPreparedProfileEvaluation","runProfileEvaluationSuite","compareProfileEvaluationRuns","buildProfileEvaluationReport"]);D(()=>se.close());let ae=le(async()=>{let{createAppServerHarnessServices:o}=await import("./app-server-harness-services-N5F5QVZI.js");return o({store:c,storeDir:t,backgroundReview:l,harnessEvaluationEnabled:d,harnessEvaluationReviewStream:b,harnessTasksetReview:zt})}),Xt=ae.methods(["inspectHarness","reviewHarnessProposal","reviewHarness","acceptHarnessEvaluationReview","materializeHarnessEvaluationTaskset","runHarnessEvaluationBaseline","validateHarness","updateHarnessBackgroundReview","diffHarness","rollbackHarness","inspectRefiner","updateRefiner","activateRefiner","rollbackRefiner"]);D(()=>ae.close());let Yt=ze({ports:st({placement:"hosted_work",connectedAppProviders:w?void 0:[],featureOverrides:{harnessBackgroundReview:l,harnessProposalReview:l,harnessReview:d,harnessEvaluationReview:d,harnessEvaluationReviewAcceptance:d,harnessEvaluationTasksetMaterialization:d,harnessEvaluationBaseline:d,refinerProfiles:l,immutableRefinerAdmission:l},createSession:ke,getSession:C,turnsForSession:n(o=>g.turnsForSession(o,1e3),"turnsForSession"),runtimeEventsForSession:n(o=>g.runtimeEventsForSession(o),"runtimeEventsForSession"),sendTurn:R.sendTurn,steerSessionTurn:R.steerSessionTurn,readTaskInbox:R.readTaskInbox,queueTaskInput:R.queueTaskInput,updateTaskInput:R.updateTaskInput,isSessionTurnActive:R.isSessionTurnActive,waitForSessionTurnSettlement:R.waitForSessionTurnSettlement,interruptSessionTurn:R.interruptSessionTurn,resolveApproval:Gt,listProfileWorkflows:Ae,loadProfileTrainingSource:n(async()=>{if(!e.profileSource||!A)throw new Error("An explicit published Profile is required for hosted training source export.");return(await import("./profile-training-source-VIND2MM2.js")).profileTrainingSource({release:A,storeDir:t})},"loadProfileTrainingSource"),...Qt,...Xt,subscribeRuntimeEvents:Ft,observeRuntimeOperation:n(o=>{i.info("agent runtime operation",o)},"observeRuntimeOperation")}),close:n(async()=>{Ee||(Ee=!0,await ve.close(),await Promise.all([se.close(),ae.close(),R.close()]),_?.close(),await Promise.all([he.drain(),we.drain(),Se.drain()]),await jt(),await c.close(),await i.flush())},"close")}),xe=Tr.filter(o=>(o!=="web_search"||!!p)&&(o!=="connected_apps"||!!w)&&(o!=="refiner"||l));return i.info("app-server ready",{storePath:c.storePath,workspaceDir:f,composition:xe}),{...Yt,updateSession:K,pinSessionHarness:n(async o=>{let m=await ce(c,await C(o));if(!m)return null;let E={id:m.release.harnessRelease.id,contentHash:m.release.harnessRelease.contentHash};return await ue({store:c,runId:o,workspace:m.workspace,harnessRelease:E,admittedAt:T()}),E},"pinSessionHarness"),storePath:c.storePath,workspaceDir:f,composition:xe}}n(Ar,"createOwnedAppServer");function xr(e,t){return{id:e||Me(t),name:q.basename(t)||"Sandbox workspace",description:null,visibility:"private",gitOwner:null,gitRepo:null,gitHost:null,defaultBranch:null,sandbox:!1,updatedAt:T(),latestDeployment:null}}n(xr,"workspaceApp");function br(e,t){return X({sessionId:e.sessionId??void 0,turnId:e.turnId??void 0,name:"diagnostic",source:"server",status:"failed",output:t instanceof Error?t.message:"Failed to persist model usage record.",data:{kind:"model_usage_record_failed",requestId:e.requestId,provider:e.provider,model:e.model}})}n(br,"runtimeDiagnostic");async function $(e,t,r){if(e!==!1)return e!==void 0?e:t?void 0:r()}n($,"selectService");export{ht as a,Wr as b,vt as c,yt as d,At as e,xt as f,ee as g,bt as h,Wt as i,Lt as j,qt as k,Tr as l,gn as m};
8
+ `)}n(It,"loadBundledAuthoringSkillBundle");async function _t(e,t=process.cwd(),r=process.execPath){let s=[x.resolve(t,"apps","cli","skills",e),x.resolve(t,"dist","skills",e),x.resolve(x.dirname(r),"skills",e),x.resolve(Et,"skills",e),x.resolve(Et,"..","skills",e)];for(let p of s)if(await cr(x.join(p,"SKILL.md")).then(()=>!0,()=>!1))return p;throw new Error(`Bundled OpenPond authoring skill ${e} was not found. Checked: ${s.join(", ")}`)}n(_t,"resolveBundledAuthoringSkillRoot");var Ht=24e3;function Wt(e){return[{name:"refiner_profile_inspect",description:"Inspect the separately versioned active Refiner Review Profile, its immutable release identity, and recent transitions. Use before editing Refiner behavior.",parameters:{type:"object",additionalProperties:!1,properties:{}},execute:n(async t=>I(t.callId,"refiner_profile_inspect",await(await import("./refiner-profile-service-56VYLZQJ.js")).inspectRefinerProfile(e.storeDir)),"execute")},{name:"refiner_profile_update",description:"Validate and write a complete JSON Refiner Review Profile as a new immutable Refiner release. Activation is explicit; normal Harness refinement never calls this tool.",parameters:{type:"object",additionalProperties:!1,properties:{profile:{type:"object",additionalProperties:!1,properties:{schemaVersion:{type:"string",const:"openpond.refinerReviewProfile.v1"},id:{type:"string",minLength:1,maxLength:120},version:{type:"string",minLength:1,maxLength:120},name:{type:"string",minLength:1,maxLength:200},objective:{type:"string",minLength:1,maxLength:1e4},instructions:{type:"array",maxItems:100,items:{type:"object",additionalProperties:!1,properties:{id:{type:"string",minLength:1,maxLength:120},text:{type:"string",minLength:1,maxLength:1e4}},required:["id","text"]}},allowedProposalRoutes:{type:"array",items:{type:"string",enum:["memory","prompt","skill","agent"]},maxItems:4},allowedExternalRoutes:{type:"array",items:{type:"string",enum:["runtime","product","taskset","training"]},maxItems:4}},required:["schemaVersion","id","version","name","objective","instructions","allowedProposalRoutes","allowedExternalRoutes"]},activate:{type:"boolean"},reason:{type:"string",minLength:1,maxLength:1e4}},required:["profile","activate","reason"]},execute:n(async t=>{let r=await ee("openpond-refiner-authoring");return I(t.callId,"refiner_profile_update",await(await import("./refiner-profile-service-56VYLZQJ.js")).updateRefinerProfile(e.storeDir,{profile:t.args.profile,activate:t.args.activate,reason:te(t.args.reason,1e4),actor:`work:${t.session.id}`,authoringSkillHash:r.sourceHash}))},"execute")},{name:"memory_search",description:"Search bounded active Personal Harness memory without loading the full memory corpus into context. Returns ranked stable memory keys and excerpts.",parameters:{type:"object",additionalProperties:!1,properties:{query:{type:"string",minLength:1,maxLength:500},limit:{type:"integer",minimum:1,maximum:20}},required:["query"]},execute:n(async t=>{let r=await M(e.store,t.session.id);if(!r)throw new Error("No Local Harness is selected for this run.");let s=te(t.args.query,500).toLowerCase(),p=[...new Set(s.split(/[^a-z0-9]+/).filter(l=>l.length>1))],h=typeof t.args.limit=="number"?Math.max(1,Math.min(20,Math.trunc(t.args.limit))):8,v=(await e.store.listHarnessMemories(r.workspace.id)).map(l=>{let d=`${l.key} ${l.tags.join(" ")} ${l.content}`.toLowerCase(),f=p.reduce((a,u)=>a+(d.includes(u)?1:0),0);return{entry:l,score:f}}).filter(({score:l})=>p.length===0||l>0).sort((l,d)=>d.score-l.score||d.entry.updatedAt.localeCompare(l.entry.updatedAt)).slice(0,h).map(({entry:l,score:d})=>({key:l.key,revision:l.revision,score:d,excerpt:l.content.slice(0,1e3),tags:l.tags,updatedAt:l.updatedAt}));return I(t.callId,"memory_search",{query:s,matches:v})},"execute")},{name:"memory_inspect",description:"Read one exact active Personal Harness memory entry returned by memory_search.",parameters:{type:"object",additionalProperties:!1,properties:{key:{type:"string",minLength:1,maxLength:120}},required:["key"]},execute:n(async t=>{let r=await M(e.store,t.session.id);if(!r)throw new Error("No Local Harness is selected for this run.");let s=te(t.args.key,120).toLowerCase(),p=await e.store.getHarnessMemory(r.workspace.id,s);if(!p||p.status!=="active")throw new Error(`Harness memory does not exist: ${s}.`);return I(t.callId,"memory_inspect",p)},"execute")},{name:"context_read",description:"Read a bounded slice of the current Agent run's canonical host-owned turns or runtime events. This never exposes other conversations or the whole history corpus.",parameters:{type:"object",additionalProperties:!1,properties:{scope:{type:"string",enum:["turns","events"]},limit:{type:"integer",minimum:1,maximum:50}},required:["scope"]},execute:n(async t=>{let r=typeof t.args.limit=="number"?Math.max(1,Math.min(50,Math.trunc(t.args.limit))):12;if(t.args.scope==="turns"){let s=await e.store.turnsForSession(t.session.id,r);return I(t.callId,"context_read",{scope:"turns",values:s.map(p=>Ot(p,6e3))})}if(t.args.scope==="events"){let s=await e.store.runtimeEventsForSession(t.session.id,{limit:r});return I(t.callId,"context_read",{scope:"events",values:s.map(p=>Ot(p,6e3))})}throw new Error("context_read scope must be turns or events.")},"execute")},{name:"harness_inspect",description:"Inspect the immutable Harness release pinned to this Agent run. With no path, returns its release, overlay, and component catalog. With a policy-visible text path, returns bounded exact source content.",parameters:{type:"object",additionalProperties:!1,properties:{path:{type:"string",minLength:1,description:"Optional exact Harness-relative source path from the returned catalog."}}},execute:n(async t=>{let r=await M(e.store,t.session.id);if(!r)throw new Error("No Local Harness release is selected for this run.");let s=await e.store.getHarnessRunOverlay(t.session.id),p=N.join(r.release.bundlePath,"source"),h=je.parse(JSON.parse(await Ct.readFile(N.join(p,"harness.json"),"utf8"))),w=typeof t.args.path=="string"?t.args.path.trim().replaceAll("\\","/"):null,v=null;if(w){let l=h.files.find(f=>f.path===w);if(!l||l.visibility!=="policy")throw new Error(`Harness source is not policy-visible or declared: ${w}`);if(!l.mediaType.startsWith("text/")&&l.mediaType!=="application/json")throw new Error(`Harness source is not inspectable text: ${w}`);let d=await Ct.readFile(pr(p,w),"utf8");v={path:w,content:d.slice(0,Ht),truncated:d.length>Ht}}return I(t.callId,"harness_inspect",{workspace:{id:r.workspace.id,name:r.workspace.name,revision:r.workspace.revision,channel:r.workspace.currentChannel},pinnedRelease:{id:r.release.harnessRelease.id,contentHash:r.release.harnessRelease.contentHash,sourceRevision:r.release.sourceRevision},overlay:s?{id:s.id,revision:s.revision,status:s.status,contentHash:s.contentHash}:null,components:h.files.filter(l=>l.visibility==="policy").map(l=>({kind:l.kind,path:l.path,portability:l.portability})),source:v})},"execute")},{name:"skill_inspect",description:"Read one exact textual Skill from the immutable Harness release pinned to this run. Use this before asking the Refiner to update an existing Skill.",parameters:{type:"object",additionalProperties:!1,properties:{name:{type:"string",minLength:1,description:"Exact Skill name from harness_inspect."}},required:["name"]},execute:n(async t=>{let r=await M(e.store,t.session.id),s=typeof t.args.name=="string"?t.args.name.trim():"";if(!r?.skillRuntime.readSkill||!s)throw new Error("A valid Skill name and a selected Local Harness are required.");return I(t.callId,"skill_inspect",await r.skillRuntime.readSkill(s))},"execute")},{name:"refine_request",description:"Mark a concrete reusable lesson from the current turn for bounded Harness refinement at the next safe tool boundary. Immediate task recovery remains your responsibility. Do not call for one-off errors or transient facts.",parameters:{type:"object",additionalProperties:!1,properties:{summary:{type:"string",minLength:1,maxLength:2e3},suggestedRoute:{type:"string",enum:["runtime","memory","prompt","skill","agent","product","taskset","training"]}},required:["summary"]},execute:n(async t=>I(t.callId,"refine_request",{queuedAtBoundary:!0,summary:te(t.args.summary,2e3),suggestedRoute:typeof t.args.suggestedRoute=="string"?t.args.suggestedRoute:null}),"execute")},{name:"refine_status",description:"Inspect bounded Refiner trigger, proposal, route, validation, and outcome status for this Agent run.",parameters:{type:"object",additionalProperties:!1,properties:{}},execute:n(async t=>{let r=await M(e.store,t.session.id);if(!r)throw new Error("No Local Harness is selected for this run.");let s=n(async i=>e.store.listHarnessImprovementArtifacts(r.workspace.id,i,200),"all"),p=(await s("trigger_decision")).filter(i=>i.schemaVersion==="openpond.refinementTriggerDecision.v1").filter(i=>i.runRef===t.session.id),h=new Set(p.map(i=>U(i))),w=n(i=>h.has(U(fe(i.trigger))),"relatedToTrigger"),v=(await s("route_decision")).filter(i=>i.schemaVersion==="openpond.improvementRouteDecision.v1").filter(w),l=(await s("refiner_outcome")).filter(i=>i.schemaVersion==="openpond.harnessRefinerOutcome.v1").filter(w),d=new Set(l.flatMap(i=>{let c=fe(i.proposal);return c.id&&c.contentHash?[U(c)]:[]})),f=(await s("proposal")).filter(i=>i.schemaVersion==="openpond.harnessImprovementProposal.v1").filter(i=>d.has(U(i))),a=n(i=>d.has(U(fe(i.proposal))),"relatedToProposal"),u=[{kind:"trigger_decision",values:p},{kind:"route_decision",values:v},{kind:"proposal",values:f},{kind:"targeted_validation",values:(await s("targeted_validation")).filter(a)},{kind:"apply_receipt",values:(await s("apply_receipt")).filter(a)},{kind:"refiner_outcome",values:l}];return I(t.callId,"refine_status",{runId:t.session.id,artifacts:u})},"execute")}]}n(Wt,"createLocalHarnessModelToolDefinitions");function U(e){return`${String(e.id??"")}:${String(e.contentHash??"")}`}n(U,"artifactRefKey");function fe(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}n(fe,"asRecord");function I(e,t,r){return{toolCallId:e,name:t,ok:!0,contentText:JSON.stringify(r),data:r}}n(I,"modelResult");function te(e,t){if(typeof e!="string"||!e.trim())throw new Error("A non-empty refinement summary is required.");return e.trim().slice(0,t)}n(te,"boundedText");function Ot(e,t){let r=JSON.stringify(e);return r.length<=t?e:{truncated:!0,json:r.slice(0,t)}}n(Ot,"boundedJson");function pr(e,t){let r=N.resolve(e),s=N.resolve(r,...t.split("/")),p=N.relative(r,s);if(!p||p.startsWith("..")||N.isAbsolute(p))throw new Error(`Harness source path escapes its release: ${t}`);return s}n(pr,"containedSourcePath");function Lt(){return{loadOpenPondProfileStateForRef:ie,executeProfileSkillCommand:n(({prompt:e,profileRef:t})=>kt(e,{loadProfileState:n(()=>ie(t),"loadProfileState")}),"executeProfileSkillCommand")}}n(Lt,"createProfileTurnDependencies");import{randomUUID as mr}from"node:crypto";import{setTimeout as fr}from"node:timers/promises";async function Dt(e,t){if(t.metadata?.titleSource||t.archived||t.hiddenFromDefaultSidebar)return t;let s=(await e.runtimeEventsForSession(t.id,{names:["session.title.updated"]})).at(-1)?.data,p=s?.session;if(s?.titleSource!=="fallback"||p?.title!==t.title)return t;let[h]=await e.runtimeEventsForSession(t.id,{names:["turn.started"],limit:1}),w=h?.turnId?await e.getTurn(h.turnId):null;return w?.prompt.trim()?await e.updateSession(t.id,v=>v.metadata?.titleSource||v.title!==t.title?v:{...v,metadata:{...v.metadata,titleSource:"fallback",autoTitle:{prompt:w.prompt.slice(0,2e4),title:v.title,attempts:0,nextAttemptAt:0}}})??t:t}n(Dt,"recoverTemporarySessionTitle");var ge="accounts/fireworks/models/deepseek-v4-flash",gr="off",hr=12e3,Mt=7,wr=["Make a concise conversation title from the user's message.","Return only the title: 3 to 7 words, plain text, sentence case.","Do not use quotation marks, markdown, labels, or ending punctuation."].join(" ");function Sr(e){let s=(e.replace(/<[^>]*>/gu," ").replace(/[\r\n]+/gu," ").replace(/\s+/gu," ").trim().match(/[\p{L}\p{N}][\p{L}\p{N}'’._/+:-]*/gu)??[]).slice(0,Mt).join(" ");return s?`${s.charAt(0).toUpperCase()}${s.slice(1)}`:"New conversation"}n(Sr,"fallbackSessionTitle");function vr(e){let r=e.replace(/<think>[\s\S]*?<\/think>/giu," ").replace(/^\s*(?:title|conversation title)\s*:\s*/iu,"").replace(/^[\s`"'“”‘’*_#-]+|[\s`"'“”‘’*_#.!?,;:-]+$/gu,"").replace(/[\r\n]+/gu," ").replace(/\s+/gu," ").trim().split(" ").filter(Boolean);return r.length<2?null:r.slice(0,Mt).join(" ")}n(vr,"generatedSessionTitle");function kr(e){return["Make a title from this request. Do not execute it.","<user_request>",e.slice(0,2e4),"</user_request>"].join(`
9
+ `)}n(kr,"titleRequestMessage");function Nt(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let t=e.autoTitlePrompt;return typeof t=="string"&&t.trim()?t.trim():null}n(Nt,"autoTitlePromptFromPayload");function yr(e){let t=Nt(e);if(!t||!e||typeof e!="object"||Array.isArray(e))return e;let r=e,s=r.metadata&&typeof r.metadata=="object"&&!Array.isArray(r.metadata)?r.metadata:{};return{...r,title:"",metadata:{...s,titleSource:"pending",autoTitle:{prompt:t.slice(0,2e4),title:"",attempts:0,nextAttemptAt:0}}}}n(yr,"withPendingAutoTitle");function re(e){if(!e||!["pending","fallback"].includes(String(e.metadata?.titleSource)))return null;let t=e.metadata?.autoTitle;return t&&typeof t.prompt=="string"&&t.title===e.title&&Number.isInteger(t.attempts)&&t.attempts>=0&&Number.isFinite(t.nextAttemptAt)?t:null}n(re,"pendingTitle");function qt(e){let t=new Map,r=null,s=new AbortController,p=[5e3,3e4];async function h(l){let d=new AbortController,f=setTimeout(()=>d.abort(new Error("session_title_generation_timeout")),hr);f.unref?.();let a="";try{for await(let i of e.stream({model:ge,messages:[{role:"system",content:wr},{role:"user",content:kr(l)}],reasoningEffort:gr,maxTokens:128,temperature:.2,requestId:`session-title-${mr()}`,signal:AbortSignal.any([d.signal,s.signal])}))i.type==="text_delta"&&i.text&&(a+=i.text);let u=vr(a);if(!u)throw new Error("session_title_generation_empty_response");return u}finally{clearTimeout(f)}}n(h,"generate");async function w(l){for(;!s.signal.aborted;){let d=re(await e.store.getSession(l));if(!d||d.attempts>=3)return;let f=d.nextAttemptAt-Date.now();f>0&&await fr(f,void 0,{signal:s.signal,ref:!1});let a=re(await e.store.getSession(l));if(!a||a.attempts!==d.attempts)return;let u,i="model";try{u=await h(d.prompt)}catch(k){if(s.signal.aborted)return;u=Sr(d.prompt),i="fallback",e.logger.warn("session title generation used temporary title",{error:k instanceof Error?k.message:String(k),model:ge,sessionId:l,attempt:d.attempts+1})}if(s.signal.aborted)return;let c=!1,g=await e.store.updateSession(l,k=>{let y=re(k);return!y||y.attempts!==d.attempts||y.prompt!==d.prompt?k:(c=!0,{...k,title:u,metadata:{...k.metadata,titleSource:i,autoTitle:i==="model"?null:{...d,title:u,attempts:d.attempts+1,nextAttemptAt:Date.now()+(p[d.attempts]??0)}}})});if(!c||!g||(await e.appendRuntimeEvent(X({sessionId:l,name:"session.title.updated",source:"server",status:"completed",data:{session:g,model:ge,titleSource:i}})),i==="model"))return}}n(w,"run");function v(l){if(s.signal.aborted)return Promise.resolve();let d=t.get(l);if(d)return d;let f=w(l).catch(a=>{s.signal.aborted||e.logger.warn("session title generation failed",{error:a instanceof Error?a.message:String(a),sessionId:l})}).finally(()=>t.delete(l));return t.set(l,f),f}return n(v,"schedule"),{wrapCreateSession(l){return this.recover().catch(d=>e.logger.warn("Session title recovery failed",{error:String(d)})),async d=>{let f=await l(yr(d));return Nt(d)&&v(f.id),f}},schedule:v,recover(){return r||(r=(async()=>{for(let l of await e.store.sessionShells()){if(s.signal.aborted)return;let d=await Dt(e.store,l);re(d)&&v(l.id)}})().finally(()=>{r=null}),r)},async close(){s.abort(),await r?.catch(()=>{}),await Promise.allSettled(t.values())}}}n(qt,"createSessionTitleService");var Er=3,Tr=["sqlite_store","runtime_event_bus","session_store","hosted_provider","web_search","connected_apps","workspace_tools","command_approvals","harness","refiner","agent_runtime","jsonl_transport"];async function gn(e={}){if(e.runtimeStorage)return(await import("./hosted-app-server-composition-GZES7QXJ.js")).createHostedOwnedAppServer({...e,runtimeStorage:e.runtimeStorage});let t=q.resolve(e.storeDir??de());return Fe(t,()=>Ar({...e,storeDir:t}))}n(gn,"createOpenPondAppServer");async function Ar(e){let t=q.resolve(e.storeDir??de()),r=!!e.embedding;if(r&&!e.streamOpenPondHostedChatTurn)throw new Error("Embedded Work requires an explicit model-stream adapter.");let s=e.services??{},p=await $(s.webSearch,r,async()=>(await import("./web-search-ZEKJHZW4.js")).createWebSearchExecutorFromEnv()),h=await $(s.scheduling,r,async()=>(await import("./saved-work-M6PUHKCC.js")).createHostedSavedWork),w=await $(s.connectedApps,r,async()=>{let[o,m]=await Promise.all([import("./connected-app-executor-LAEAQUJS.js"),import("./app-server-connected-apps-ILXBFD3S.js")]);return{execute:o.createCloudConnectedAppToolExecutor(),list:m.listAppServerIntegrationConnections}}),v=await $(s.tasksets,r,async()=>(await import("./hosted-tasksets-V24IBVJX.js")).executeHostedTasksetAction),l=s.backgroundReview??!r,d=!r&&!!v;await _e(t),l&&await(await import("./refiner-profile-service-56VYLZQJ.js")).initializeRefinerProfile(t);let f=q.resolve(e.workspaceDir??process.cwd());await Rr(f,{recursive:!0});let a=e.version??De,u=Ue(),i=Ve({channel:"app-server",logDir:q.join(t,"logs"),metadata:{version:a,runtimeVersion:u,placement:"hosted_work"}});D(()=>i.flush());let c=new pt(t,{logger:i});D(()=>c.close()),await c.recentTurns(1);let g=c,k=n(async()=>(await Ce(t)).preferences,"loadRuntimePreferences"),y=vt(t);(y.recovered||y.needsReview)&&i.warn("Scheduled work requires review after restart",y);let S=nt(e.streamOpenPondHostedChatTurn??Be,{enabled:ot()}),b=yt(S),{appendRuntimeEvent:P,closeEventSubscribers:jt,subscribeRuntimeEvents:Ft}=it({logger:i,store:g}),he=Y({queueId:"turn-follow-up",logger:i}),we=Y({queueId:"harness-refiner",logger:i}),Se=Y({queueId:"subagent",logger:i});if(e.harness&&e.profileSource)throw new Error("Configure either an explicit Harness source or Profile source for this app-server.");let A=null,z,oe;if(e.experimentHarnessSource){if(!e.experimentPolicyClient||e.profileSource||e.harness||e.runtimeStorage)throw new Error("A published standalone Experiment source requires its isolated policy owner and local case store.");let o=e.experimentHarnessSource.sourcePackage;z=await(await import("./published-experiment-source-SDXUVPE7.js")).installPublishedExperimentSource({store:c,storeDir:t,ownerId:e.experimentHarnessSource.ownerId,sourcePackage:o,reference:{harnessRelease:{id:o.harnessRelease.id,contentHash:o.harnessRelease.contentHash},agentSnapshot:{id:o.agentSnapshot.id,contentHash:o.agentSnapshot.contentHash},sourcePackageHash:o.contentHash},createdAt:T()})}if(e.profileSource){let o=e.profileSource;if(!o.repositoryId.trim()||!o.profileId.trim()||!o.sourceRevision.trim())throw new Error("Explicit Profile source requires an identity and accepted revision.");let m=await We({repoPath:o.repoPath,profileId:o.profileId});if(m.mode!=="local"||!m.sourcePath||m.error||m.git?.isRepo&&(m.git.head!==o.sourceRevision||m.git.dirty))throw new Error("Explicit Profile source does not match its accepted revision.");A=await Je({store:c,storeDir:t,workspaceId:`${Xe}${H({profileId:o.profileId,sourceRevision:o.sourceRevision}).slice(0,24)}`,ownerId:"desktop-personal",name:o.profileId,profile:m,sourceRevision:o.sourceRevision,repositoryId:o.repositoryId})}e.harness&&(await Ke({store:c,storeDir:t,sourceDir:e.harness.sourceDirectory,id:e.harness.workspaceId,name:e.harness.name,ownerId:"desktop-personal"}),await c.selectHarnessWorkspace({ownerKind:"personal",ownerId:"desktop-personal",workspaceId:e.harness.workspaceId,updatedAt:T()})),await Ge({store:c,storeDir:t,loadProfileState:L,now:T}).catch(o=>{i.warn("app-server Harness initialization failed",{error:o})});let V=rt({appendRuntimeEvent:P,findLocalProject:n(o=>lt(c,o),"findLocalProject"),onRepositoryInstructionDiagnostic:n((o,m)=>{i.warn("repository instruction file skipped",{diagnostic:o,sessionId:m.id})},"onRepositoryInstructionDiagnostic")}),{createSession:j,getSession:C,updateSession:K,completeTurn:Bt,failTurn:Ut,interruptTurn:$t}=dt({store:g,defaultSessionCwd:n(()=>f,"defaultSessionCwd"),appendRuntimeEvent:P,loadAppPreferences:k,loadLastUsedProfile:n(async()=>(await B()).lastUsed,"loadLastUsedProfile")}),ve=qt({appendRuntimeEvent:P,store:g,logger:i,stream:S}),ke=r?j:ve.wrapCreateSession(j),J=at({workspaceDir:f,logger:i,getSession:C,updateSession:K,appendRuntimeEvent:P,sandboxRequest:e.sandboxRequest??(r?async()=>{throw new Error("Sandbox execution is not configured in this app-server deployment.")}:void 0)}),zt=d?await(await import("./local-harness-taskset-review-XQHQ6JCR.js")).createLocalHarnessTasksetReviewControl({store:c,storeDir:t,evaluationRuntime:{streamOpenPondHostedChatTurn:S,workRuntime:{createSession:j,getSession:C,executeWorkspaceTool:J.executeWorkspaceTool,runtimeEventsForSession:n(o=>g.runtimeEventsForSession(o),"runtimeEventsForSession")},resolveReleasedHarness:n(async()=>{let o=await Qe(c);return o?{agentSnapshot:o.release.agentSnapshot,harnessRelease:o.release.harnessRelease,instructionContext:o.instructionContext}:null},"resolveReleasedHarness")}}):void 0,ye=n(async o=>{await g.upsertApproval(o)},"upsertApproval"),Pe=et({upsertApproval:ye,appendRuntimeEvent:P}),Vt=await $(s.projectActions,r,async()=>(await import("./project-action-payload-TK6G4VMC.js")).createProjectActionRunPayload({appendRuntimeEvent:P,resolveProjectRoot:n(async()=>null,"resolveProjectRoot")})),Kt=n(async o=>{try{await g.upsertModelUsageRecord(o)}catch(m){await P(br(o,m)).catch(()=>{})}},"safeUpsertModelUsageRecord"),Re=l?(await import("./local-harness-improvement-runtime-3YJQRYXC.js")).createLocalHarnessImprovementRuntime({store:c,storeDir:t,queue:we,streamOpenPondHostedChatTurn:S,appendRuntimeEvent:P,upsertModelUsageRecord:Kt}):void 0;await Re?.reconcilePending();let ne=e.profileExternalDataset?await(A&&e.profileExternalDatasetClient?(await import("./host-profile-external-dataset-KSEPXY2S.js")).createHostProfileExternalDataset({value:e.profileExternalDataset,release:A,sourceRevision:e.profileSource.sourceRevision,client:e.profileExternalDatasetClient}):Promise.reject(new Error("External Dataset execution requires an explicit private Profile source owner."))):null,Jt=$e({deviceId:`evaluation-${H(t).slice(0,24)}`,storeDir:t,runtimeEventsForSession:n(o=>g.runtimeEventsForSession(o),"runtimeEventsForSession")}),_=A?(await import("./host-profile-evaluation-tools-UF4ATIUF.js")).createHostProfileEvaluationTools({storeDir:t,release:A,getTurn:n(o=>g.getTurn(o),"getTurn"),getSession:C,saveOutput:Jt.saveOwnedOutputBytes,recordOutput:n(async(o,m,E)=>{await P({id:Pr(),timestamp:new Date().toISOString(),name:"workspace_action_result",source:"server",sessionId:o,turnId:m,action:"work_output_save",status:"completed",output:`Saved ${E.outputRef.title} as immutable case output.`,data:E})},"recordOutput"),authorize:n(async o=>{if(ne){await ne.authorize(o);return}let m=await Te();if(!m||m.ref.profileId!==e.profileSource?.profileId||m.sourceRevision!==e.profileSource?.sourceRevision)throw new Error("The released evaluation source authority changed.");let E=await c.getHarnessReleaseRecord(A.harnessRelease.contentHash);if(!E||E.harnessRelease.contentHash!==A.harnessRelease.contentHash)throw new Error("The isolated evaluation release is unavailable.")},"authorize")}):null,G=e.embedding?gt(e.embedding,async(o,m)=>{let E=await g.getTurn(o);if(!E)throw new Error("Embedded turn is unavailable.");let O=await C(E.sessionId),F=O.metadata?.embeddingToolBindings,W=[...m].sort((Q,Zt)=>Q.name.localeCompare(Zt.name));if(F!==void 0&&H(F)!==H(W))throw new Error("Embedded tool bindings changed; start a new thread.");await K(O.id,{metadata:{...O.metadata,embeddingToolBindings:W}}),await g.updateTurn(o,Q=>({...Q,metadata:{...Q.metadata,toolBindings:W}}))}):void 0,R=ut({executionHost:r?"embedded":"local",storageHome:t,workInputsForSession:e.workInputsForSession,finalizeWorkTurn:e.finalizeWorkTurn,isolatedProfileEvaluationForTurn:_?async o=>{if(o.metadata?.profileEvaluationRun===void 0)return!1;if(!_.ownsSession(o.id))throw new Error("A Profile evaluation target has no actual admitted case owner.");return!0}:void 0,executeProfileEvaluationAction:_?.executeAction,resolveModelTools:e.resolveModelTools||_||G?async o=>{let m=_?_.ownsSession(o.session.id)?await _.resolveTools(o):await G?.(o)??[]:G?await G(o):o.tools;return e.resolveModelTools?e.resolveModelTools({...o,tools:m}):m}:void 0,...r?{hostedToolFlags:{toolMode:"native",nativeToolTransport:!0,nativeToolProviderDenylist:[],textToolFallback:!1}}:{},attachmentRootDir:q.join(t,"attachments"),store:g,inboxStore:c,createSession:j,upsertApproval:ye,getSession:C,updateSession:K,completeTurn:Bt,failTurn:Ut,interruptTurn:$t,defaultSessionCwd:n(()=>f,"defaultSessionCwd"),findOpenPondApp:n(async o=>xr(o,f),"findOpenPondApp"),resolveSessionWorkspaceCwd:n(async o=>o.cwd?.trim()||f,"resolveSessionWorkspaceCwd"),ensureCodexRuntime:n(async()=>{throw new Error("The hosted app-server placement uses the OpenPond provider; Codex process hosting is not configured.")},"ensureCodexRuntime"),appendWorkspaceDiffEvent:J.appendWorkspaceDiffEvent,workspaceDiffBaseline:J.workspaceDiffBaseline,appendRuntimeEvent:P,processHarnessImprovementBoundary:Re,executeWorkspaceTool:J.executeWorkspaceTool,executeOpenPondCommand:Pe.executeCommand,executeProjectAction:Vt,executeDatasetBuilderAction:v,loadOpenPondProfileState:L,...Lt(),...r||s.profileActions===!1?{executeProfileSkillCommand:void 0}:{},loadOpenPondProfileLibrary:B,readOpenPondProfileSkill:Oe,loadSelectedHarnessRuntime:n(o=>ce(c,o),"loadSelectedHarnessRuntime"),ensureHarnessRunOverlay:n(o=>ue({store:c,...o}),"ensureHarnessRunOverlay"),harnessModelTools:Wt({store:c,storeDir:t}).filter(o=>l||!["refiner_profile_inspect","refiner_profile_update","refine_request","refine_status"].includes(o.name)),loadBuiltInOpenPondSkills:n(async()=>[await mt(),...await xt()],"loadBuiltInOpenPondSkills"),readBuiltInOpenPondSkill:n(async o=>{if(o==="openpond-taskset-authoring")return ft();if(At(o))return bt(o);throw new Error(`Built-in OpenPond skill not found: ${o}`)},"readBuiltInOpenPondSkill"),executeWebSearch:p,createScheduledWork:h,executeConnectedAppTool:w?.execute,listIntegrationConnections:w?.list,loadPersonalizationSoul:n(async()=>(await tt(c,t)).soul,"loadPersonalizationSoul"),loadAppPreferences:k,maybeCreateScaffoldForTurn:V.maybeCreateScaffoldForTurn,hostedSystemPrompt:V.hostedSystemPrompt,appendAssistantText:V.appendAssistantText,appendHostedContextUsage:V.appendHostedContextUsage,streamOpenPondHostedChatTurn:S,turnFollowUpQueue:he,resolveSessionModelStream:ht(async(o,m)=>await oe?.resolveSessionModelStream(o,m)??await e.resolveSessionModelStream?.(o,m)??null),subagentQueue:Se,maxHostedWorkspaceToolRounds:e.experimentHarnessSource?(await import("./experiments-VOCZ4DW3.js")).STANDALONE_EXPERIMENT_MAX_POLICY_CALLS:ct(e.maxHostedWorkspaceToolRounds),maxRepeatedInvalidToolRequests:Er});D(()=>R.close()),await R.recoverPendingSubagentCompletions(),await R.recoverTaskInbox();async function Gt(o,m){let E=await R.resolveNativeAgentApproval(o,m);if(E)return E;let O=await Pe.resolveApproval(o,m);if(O)return O;let F=await R.resolveCreateImproveApproval(o,m);if(F)return F;let W=await R.resolveSubagentPatchApplyApproval(o,m);if(W)return W;throw new Error(`Approval not found: ${o}`)}n(Gt,"resolveApproval");let Ee=!1,Te=n(async()=>{if(e.profileSource)return{ref:{source:"openpond_git",repositoryId:e.profileSource.repositoryId,profileId:e.profileSource.profileId},sourceRevision:e.profileSource.sourceRevision};let[o,m]=await Promise.all([B(),L()]);return o.lastUsed&&m.git?.head&&!m.git.dirty?{ref:o.lastUsed,sourceRevision:m.git.head}:null},"selectedEvaluationProfile"),Ae=n(async()=>{if(e.profileSource&&A)return Ze({store:c,release:A,ref:{source:"openpond_git",repositoryId:e.profileSource.repositoryId,profileId:e.profileSource.profileId},sourceRevision:e.profileSource.sourceRevision});let[o,m]=await Promise.all([B(),L()]);if(!o.lastUsed)throw new Error("Select a Profile before loading its workflows.");return Ye({store:c,storeDir:t,ref:o.lastUsed,profile:m,reloadProfile:L})},"listProfileWorkflows");if(z){let o=z;oe=(await import("./standalone-experiment-turn-owner-TW5MTWIO.js")).createStandaloneExperimentTurnOwner({store:c,createSession:j,sendTurn:R.sendTurn,interruptSessionTurn:R.interruptSessionTurn,authorizeWorkspace:n(async(m,E)=>{if(E.id!==o.workspace.id||H(E.ownerScope)!==H(o.workspace.ownerScope)||m.sourcePackageHash!==o.workspace.metadata.experimentSourcePackageHash||m.harnessRelease.id!==o.release.harnessRelease.id||m.harnessRelease.contentHash!==o.release.harnessRelease.contentHash)throw new Error("Standalone Experiment source differs from this execution owner's admitted closure.")},"authorizeWorkspace")})}let se=le(async()=>{let{createAppServerEvaluations:o}=await import("./app-server-evaluations-RRLYWLPK.js");return o({options:e,store:c,storeDir:t,explicitProfileRelease:A,externalDataset:ne,isolatedProfileTools:_,selectedEvaluationProfile:Te,listProfileWorkflows:Ae,createSessionWithAutoTitle:ke,turnRunner:R,streamOpenPondHostedChatTurn:S,publishedExperimentSource:z,standaloneExperimentOwner:oe})}),Qt=se.methods(["listProfileEvaluations","executeProfileEvaluationCase","executeExperimentCase","cancelExperimentCase","executeProfileEvaluationRun","prepareProfileEvaluationRun","runPreparedProfileEvaluation","runProfileEvaluationSuite","compareProfileEvaluationRuns","buildProfileEvaluationReport"]);D(()=>se.close());let ae=le(async()=>{let{createAppServerHarnessServices:o}=await import("./app-server-harness-services-XXM336NU.js");return o({store:c,storeDir:t,backgroundReview:l,harnessEvaluationEnabled:d,harnessEvaluationReviewStream:b,harnessTasksetReview:zt})}),Xt=ae.methods(["inspectHarness","reviewHarnessProposal","reviewHarness","acceptHarnessEvaluationReview","materializeHarnessEvaluationTaskset","runHarnessEvaluationBaseline","validateHarness","updateHarnessBackgroundReview","diffHarness","rollbackHarness","inspectRefiner","updateRefiner","activateRefiner","rollbackRefiner"]);D(()=>ae.close());let Yt=ze({ports:st({placement:"hosted_work",connectedAppProviders:w?void 0:[],featureOverrides:{harnessBackgroundReview:l,harnessProposalReview:l,harnessReview:d,harnessEvaluationReview:d,harnessEvaluationReviewAcceptance:d,harnessEvaluationTasksetMaterialization:d,harnessEvaluationBaseline:d,refinerProfiles:l,immutableRefinerAdmission:l},createSession:ke,getSession:C,turnsForSession:n(o=>g.turnsForSession(o,1e3),"turnsForSession"),runtimeEventsForSession:n(o=>g.runtimeEventsForSession(o),"runtimeEventsForSession"),sendTurn:R.sendTurn,steerSessionTurn:R.steerSessionTurn,readTaskInbox:R.readTaskInbox,queueTaskInput:R.queueTaskInput,updateTaskInput:R.updateTaskInput,isSessionTurnActive:R.isSessionTurnActive,waitForSessionTurnSettlement:R.waitForSessionTurnSettlement,interruptSessionTurn:R.interruptSessionTurn,resolveApproval:Gt,listProfileWorkflows:Ae,loadProfileTrainingSource:n(async()=>{if(!e.profileSource||!A)throw new Error("An explicit published Profile is required for hosted training source export.");return(await import("./profile-training-source-VIND2MM2.js")).profileTrainingSource({release:A,storeDir:t})},"loadProfileTrainingSource"),...Qt,...Xt,subscribeRuntimeEvents:Ft,observeRuntimeOperation:n(o=>{i.info("agent runtime operation",o)},"observeRuntimeOperation")}),close:n(async()=>{Ee||(Ee=!0,await ve.close(),await Promise.all([se.close(),ae.close(),R.close()]),_?.close(),await Promise.all([he.drain(),we.drain(),Se.drain()]),await jt(),await c.close(),await i.flush())},"close")}),xe=Tr.filter(o=>(o!=="web_search"||!!p)&&(o!=="connected_apps"||!!w)&&(o!=="refiner"||l));return i.info("app-server ready",{storePath:c.storePath,workspaceDir:f,composition:xe}),{...Yt,updateSession:K,pinSessionHarness:n(async o=>{let m=await ce(c,await C(o));if(!m)return null;let E={id:m.release.harnessRelease.id,contentHash:m.release.harnessRelease.contentHash};return await ue({store:c,runId:o,workspace:m.workspace,harnessRelease:E,admittedAt:T()}),E},"pinSessionHarness"),storePath:c.storePath,workspaceDir:f,composition:xe}}n(Ar,"createOwnedAppServer");function xr(e,t){return{id:e||Me(t),name:q.basename(t)||"Sandbox workspace",description:null,visibility:"private",gitOwner:null,gitRepo:null,gitHost:null,defaultBranch:null,sandbox:!1,updatedAt:T(),latestDeployment:null}}n(xr,"workspaceApp");function br(e,t){return X({sessionId:e.sessionId??void 0,turnId:e.turnId??void 0,name:"diagnostic",source:"server",status:"failed",output:t instanceof Error?t.message:"Failed to persist model usage record.",data:{kind:"model_usage_record_failed",requestId:e.requestId,provider:e.provider,model:e.model}})}n(br,"runtimeDiagnostic");async function $(e,t,r){if(e!==!1)return e!==void 0?e:t?void 0:r()}n($,"selectService");export{ht as a,Wr as b,vt as c,yt as d,At as e,xt as f,ee as g,bt as h,Wt as i,Lt as j,qt as k,Tr as l,gn as m};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as k}from"./chunk-6FA3GG5B.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as r}from"./chunk-FTQLQJQV.js";var b=3e3,h=9999,l="openpond.yaml",ie="openpond-template-plan.json",M="openpond.sandboxTemplate.buildPlan.v1",C=["google","github","x"],S=new Set([22,2222,2375,2376,3108,5900,5901,6080,7818]),w=e.array(e.string().trim().min(1).max(1e3)).max(50),d=e.string().trim().min(1).max(4096).refine(N,{message:"path must be a relative workspace path"}),O=e.string().trim().min(1).max(500).refine(t=>!t.includes("\0")&&!/\s/.test(t),"image ref must be a single OCI reference"),D=e.string().trim().regex(/^sha256:[0-9a-f]{64}$/i),R=e.string().trim().min(1).max(500).refine(t=>t.startsWith("/")&&!t.includes("\0"),"workspaceRoot must be an absolute guest path"),$=e.object({ref:O,digest:D.optional(),registrySecretRef:e.string().trim().min(1).max(500).optional(),platform:e.literal("linux/amd64").optional(),workspaceRoot:R.optional()}).strict(),q=e.object({context:d.default("."),path:d.default("Dockerfile"),target:e.string().trim().min(1).max(191).optional(),buildArgs:e.record(e.string().max(191),e.string().max(500)).optional(),registrySecretRefs:e.array(e.string().trim().min(1).max(500)).max(10).optional(),platform:e.literal("linux/amd64").optional(),workspaceRoot:R.optional()}).strict(),L=e.object({base:e.string().trim().min(1).max(120).optional(),snapshot:e.string().trim().min(1).max(191).optional(),image:$.optional(),dockerfile:q.optional()}).strict().superRefine((t,a)=>{[t.base,t.snapshot,t.image,t.dockerfile].filter(Boolean).length!==1&&a.addIssue({code:e.ZodIssueCode.custom,message:"runtime must declare exactly one of base, snapshot, image, or dockerfile"})}),T=e.object({cpu:e.number().positive().max(8).optional(),memoryGb:e.number().positive().max(32).optional(),diskGb:e.number().positive().max(100).optional()}).strict(),V=e.object({provider:e.enum(C),scopes:e.array(e.string().trim().min(1).max(200)).max(100).default([]),capabilities:e.array(e.string().trim().min(1).max(200)).max(100).default([])}).strict(),z=e.object({models:e.array(e.string().trim().min(1).max(200)).max(100).default([]),scopes:e.array(e.string().trim().min(1).max(200)).max(100).default([])}).strict(),Z=e.object({opchat:z.optional()}).catchall(e.record(e.string(),e.unknown())).default({}),j=e.object({name:e.string().trim().regex(/^[A-Za-z_][A-Za-z0-9_-]*$/).max(63).optional(),mountPath:e.string().trim().min(1).max(256).optional(),storageGb:e.number().int().positive().max(100).optional(),deleteOnSandboxDelete:e.boolean().optional()}).strict(),E=e.object({port:e.number().int().min(b).max(h).refine(t=>!S.has(t),{message:"preview port is reserved"}),protocol:e.literal("http").default("http"),label:e.string().trim().min(1).max(80).optional(),access:e.enum(["private","public"]).default("private"),path:e.string().trim().min(1).max(512).refine(t=>t.startsWith("/"),{message:"preview path must start with /"}).default("/")}).strict(),_=e.object({command:e.string().trim().min(1).max(1e3),cwd:d.optional(),timeoutSeconds:e.number().int().positive().max(86400).optional(),requiresStart:e.boolean().default(!1),ports:e.array(E).max(20).default([]),artifactPaths:e.array(d).max(100).default([])}).strict(),I=_.extend({name:e.string().trim().min(1).max(80)}).strict(),F=e.object({name:e.string().trim().min(1).max(80).optional(),service:e.string().trim().min(1).max(80).optional(),port:e.number().int().min(b).max(h).refine(t=>!S.has(t),{message:"app MCP port is reserved"}),path:e.string().trim().min(1).max(512).refine(t=>t.startsWith("/"),{message:"app MCP path must start with /"}).default("/mcp")}).strict(),B=e.object({name:e.string().trim().min(1).max(80).optional(),port:e.number().int().min(b).max(h).refine(t=>!S.has(t),{message:"validation probe port is reserved"}),path:e.string().trim().min(1).max(512).refine(t=>t.startsWith("/"),{message:"validation probe path must start with /"}).default("/"),expectedStatus:e.number().int().min(100).max(599).default(200)}).strict(),W=e.record(e.string(),e.unknown()).refine(t=>t.type==="object","input schema must be a JSON schema object"),J=e.object({name:e.string().trim().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(191),required:e.boolean().default(!1),secret:e.boolean().default(!0),description:e.string().trim().max(500).optional()}).strict(),g=e.string().trim().min(1).max(120),G=e.object({name:e.string().trim().min(1).max(120),description:e.string().trim().max(500).optional(),cron:e.string().trim().min(1).max(500).optional(),rate:e.string().trim().min(1).max(500).optional(),once:g.optional(),scheduleType:e.enum(["rate","cron","once"]).optional(),scheduleExpression:e.string().trim().min(1).max(500).optional(),timezone:e.string().trim().min(1).max(100).optional(),enabled:e.boolean().default(!0),startAt:g.optional(),endAt:g.optional(),maxRuns:e.number().int().positive().nullable().optional(),runtimePolicy:e.enum(["run_and_stop","run_and_archive","run_and_delete","use_existing_running"]).default("run_and_stop"),action:e.string().trim().min(1).max(120).optional(),actionName:e.string().trim().min(1).max(120).optional(),command:e.string().trim().min(1).max(2e3).optional(),target:e.object({kind:e.enum(["start","action","service","command"]).optional(),name:e.string().trim().min(1).max(120).optional(),actionName:e.string().trim().min(1).max(120).optional(),command:e.string().trim().min(1).max(2e3).optional(),requiresStart:e.boolean().optional()}).strict().optional(),requiresStart:e.boolean().optional(),budget:e.object({maxUsd:e.string().trim().min(1).max(40).optional()}).strict().optional(),resources:T.optional(),quotas:e.record(e.string(),e.unknown()).optional(),lifecycle:e.record(e.string(),e.unknown()).optional(),retentionPolicy:e.record(e.string(),e.unknown()).optional(),env:e.array(e.object({name:e.string().trim().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(191),value:e.string().optional(),secretRef:e.string().optional()}).strict()).max(100).optional(),integrationLeases:e.array(e.record(e.string(),e.unknown())).max(20).optional(),metadata:e.record(e.string(),e.unknown()).optional()}).strict().superRefine((t,a)=>{[t.cron,t.rate,t.once,t.scheduleExpression].filter(m=>typeof m=="string"&&m.trim()).length!==1&&a.addIssue({code:e.ZodIssueCode.custom,path:["scheduleExpression"],message:"schedule must declare exactly one of cron, rate, once, or scheduleExpression"}),t.scheduleExpression&&!t.scheduleType&&a.addIssue({code:e.ZodIssueCode.custom,path:["scheduleType"],message:"scheduleType is required with scheduleExpression"});let i=t.command??t.target?.command??null,o=t.target?.name??null,s=t.actionName??t.action??t.target?.actionName??(t.target?.kind==="action"?o:null),c=t.target?.kind??(i?"command":"action");c==="action"&&!s&&a.addIssue({code:e.ZodIssueCode.custom,path:["action"],message:"schedule action target is required"}),c==="service"&&!o&&a.addIssue({code:e.ZodIssueCode.custom,path:["target","name"],message:"schedule service target name is required"}),c==="command"&&!i&&a.addIssue({code:e.ZodIssueCode.custom,path:["command"],message:"schedule command target is required"})}),v=e.object({schemaVersion:e.literal(1),name:e.string().trim().min(1).max(80).regex(/^[a-z0-9][a-z0-9-]*[a-z0-9]$/),version:e.string().trim().min(1).max(40),useCase:e.string().trim().min(1).max(80),description:e.string().trim().min(1).max(500),runtime:L,resources:T.optional(),setup:e.object({commands:w.default([])}).strict().default({commands:[]}),validation:e.object({commands:w.min(1),probes:e.array(B).max(20).default([])}).strict(),start:_,actions:e.array(I).max(20).default([]),services:e.array(I).max(20).default([]),schedules:e.array(G).max(20).default([]),mcp:e.object({endpoints:e.array(F).max(10).default([])}).strict().default({endpoints:[]}),volumes:e.array(j).max(5).default([]),integrations:e.object({requiredLeases:e.array(V).max(20).default([])}).strict().default({requiredLeases:[]}),permissions:Z,inputs:e.object({schema:W.default({type:"object"}),env:e.array(J).max(100).default([])}).strict().default({schema:{type:"object"},env:[]}),artifacts:e.object({paths:e.array(d).max(100).default([])}).strict().default({paths:[]}),network:e.object({egress:e.enum(["restricted","allow","block"]).default("restricted")}).strict().default({egress:"restricted"})}).strict().superRefine((t,a)=>{Q(t,a),y(a,t.volumes.flatMap(n=>n.name?[n.name]:[]),"volume names must be unique","volumes"),ee(t,a),te(t,a),ae(t,a),ne(t,a)}),me=e.object({path:e.string(),message:e.string(),code:e.string()});function K(t){let a;try{a=k.load(t)}catch(n){return{ok:!1,manifest:null,diagnostics:[{path:"$",code:"invalid_yaml",message:n instanceof Error?n.message:"Invalid YAML"}]}}return U(a)}r(K,"validateSandboxTemplateYaml");function U(t){if(!t||typeof t!="object"||Array.isArray(t))return{ok:!1,manifest:null,diagnostics:[{path:"$",code:"invalid_type",message:`${l} must be an object`}]};if(Object.prototype.hasOwnProperty.call(t,"databases"))return{ok:!1,manifest:null,diagnostics:[{path:"$.databases",code:"database_resources_removed",message:"managed database requests are unsupported for Firecracker sandbox templates; use a durable volume with SQLite or files instead"}]};let a=v.safeParse(t);return a.success?{ok:!0,manifest:a.data,diagnostics:[]}:{ok:!1,manifest:null,diagnostics:a.error.issues.map(n=>({path:H(n.path),code:n.code,message:n.message}))}}r(U,"validateSandboxTemplateManifest");function ce(t){let a=K(t);if(!a.ok)throw new Error(X(a.diagnostics));return a.manifest}r(ce,"parseSandboxTemplateYaml");function X(t){return t.map(a=>`${a.path}: ${a.message}`).join(`
2
+ import{a as k}from"./chunk-6FA3GG5B.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as r}from"./chunk-FTQLQJQV.js";var b=3e3,h=9999,l="openpond.yaml",ie="openpond-template-plan.json",M="openpond.sandboxTemplate.buildPlan.v1",C=["google","github","x"],S=new Set([22,2222,2375,2376,3108,5900,5901,6080,7818]),w=e.array(e.string().trim().min(1).max(1e3)).max(50),d=e.string().trim().min(1).max(4096).refine(N,{message:"path must be a relative workspace path"}),O=e.string().trim().min(1).max(500).refine(t=>!t.includes("\0")&&!/\s/.test(t),"image ref must be a single OCI reference"),D=e.string().trim().regex(/^sha256:[0-9a-f]{64}$/i),R=e.string().trim().min(1).max(500).refine(t=>t.startsWith("/")&&!t.includes("\0"),"workspaceRoot must be an absolute guest path"),$=e.object({ref:O,digest:D.optional(),registrySecretRef:e.string().trim().min(1).max(500).optional(),platform:e.literal("linux/amd64").optional(),workspaceRoot:R.optional()}).strict(),q=e.object({context:d.default("."),path:d.default("Dockerfile"),target:e.string().trim().min(1).max(191).optional(),buildArgs:e.record(e.string().max(191),e.string().max(500)).optional(),registrySecretRefs:e.array(e.string().trim().min(1).max(500)).max(10).optional(),platform:e.literal("linux/amd64").optional(),workspaceRoot:R.optional()}).strict(),L=e.object({base:e.string().trim().min(1).max(120).optional(),snapshot:e.string().trim().min(1).max(191).optional(),image:$.optional(),dockerfile:q.optional()}).strict().superRefine((t,a)=>{[t.base,t.snapshot,t.image,t.dockerfile].filter(Boolean).length!==1&&a.addIssue({code:e.ZodIssueCode.custom,message:"runtime must declare exactly one of base, snapshot, image, or dockerfile"})}),T=e.object({cpu:e.number().positive().max(8).optional(),memoryGb:e.number().positive().max(32).optional(),diskGb:e.number().positive().max(100).optional()}).strict(),V=e.object({provider:e.enum(C),scopes:e.array(e.string().trim().min(1).max(200)).max(100).default([]),capabilities:e.array(e.string().trim().min(1).max(200)).max(100).default([])}).strict(),z=e.object({models:e.array(e.string().trim().min(1).max(200)).max(100).default([]),scopes:e.array(e.string().trim().min(1).max(200)).max(100).default([])}).strict(),Z=e.object({opchat:z.optional()}).catchall(e.record(e.string(),e.unknown())).default({}),j=e.object({name:e.string().trim().regex(/^[A-Za-z_][A-Za-z0-9_-]*$/).max(63).optional(),mountPath:e.string().trim().min(1).max(256).optional(),storageGb:e.number().int().positive().max(100).optional(),deleteOnSandboxDelete:e.boolean().optional()}).strict(),E=e.object({port:e.number().int().min(b).max(h).refine(t=>!S.has(t),{message:"preview port is reserved"}),protocol:e.literal("http").default("http"),label:e.string().trim().min(1).max(80).optional(),access:e.enum(["private","public"]).default("private"),path:e.string().trim().min(1).max(512).refine(t=>t.startsWith("/"),{message:"preview path must start with /"}).default("/")}).strict(),_=e.object({command:e.string().trim().min(1).max(1e3),cwd:d.optional(),timeoutSeconds:e.number().int().positive().max(86400).optional(),requiresStart:e.boolean().default(!1),ports:e.array(E).max(20).default([]),artifactPaths:e.array(d).max(100).default([])}).strict(),I=_.extend({name:e.string().trim().min(1).max(80)}).strict(),B=e.object({name:e.string().trim().min(1).max(80).optional(),service:e.string().trim().min(1).max(80).optional(),port:e.number().int().min(b).max(h).refine(t=>!S.has(t),{message:"app MCP port is reserved"}),path:e.string().trim().min(1).max(512).refine(t=>t.startsWith("/"),{message:"app MCP path must start with /"}).default("/mcp")}).strict(),F=e.object({name:e.string().trim().min(1).max(80).optional(),port:e.number().int().min(b).max(h).refine(t=>!S.has(t),{message:"validation probe port is reserved"}),path:e.string().trim().min(1).max(512).refine(t=>t.startsWith("/"),{message:"validation probe path must start with /"}).default("/"),expectedStatus:e.number().int().min(100).max(599).default(200)}).strict(),W=e.record(e.string(),e.unknown()).refine(t=>t.type==="object","input schema must be a JSON schema object"),J=e.object({name:e.string().trim().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(191),required:e.boolean().default(!1),secret:e.boolean().default(!0),description:e.string().trim().max(500).optional()}).strict(),g=e.string().trim().min(1).max(120),G=e.object({name:e.string().trim().min(1).max(120),description:e.string().trim().max(500).optional(),cron:e.string().trim().min(1).max(500).optional(),rate:e.string().trim().min(1).max(500).optional(),once:g.optional(),scheduleType:e.enum(["rate","cron","once"]).optional(),scheduleExpression:e.string().trim().min(1).max(500).optional(),timezone:e.string().trim().min(1).max(100).optional(),enabled:e.boolean().default(!0),startAt:g.optional(),endAt:g.optional(),maxRuns:e.number().int().positive().nullable().optional(),runtimePolicy:e.enum(["run_and_stop","run_and_archive","run_and_delete","use_existing_running"]).default("run_and_stop"),action:e.string().trim().min(1).max(120).optional(),actionName:e.string().trim().min(1).max(120).optional(),command:e.string().trim().min(1).max(2e3).optional(),target:e.object({kind:e.enum(["start","action","service","command"]).optional(),name:e.string().trim().min(1).max(120).optional(),actionName:e.string().trim().min(1).max(120).optional(),command:e.string().trim().min(1).max(2e3).optional(),requiresStart:e.boolean().optional()}).strict().optional(),requiresStart:e.boolean().optional(),budget:e.object({maxUsd:e.string().trim().min(1).max(40).optional()}).strict().optional(),resources:T.optional(),quotas:e.record(e.string(),e.unknown()).optional(),lifecycle:e.record(e.string(),e.unknown()).optional(),retentionPolicy:e.record(e.string(),e.unknown()).optional(),env:e.array(e.object({name:e.string().trim().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(191),value:e.string().optional(),secretRef:e.string().optional()}).strict()).max(100).optional(),integrationLeases:e.array(e.record(e.string(),e.unknown())).max(20).optional(),metadata:e.record(e.string(),e.unknown()).optional()}).strict().superRefine((t,a)=>{[t.cron,t.rate,t.once,t.scheduleExpression].filter(m=>typeof m=="string"&&m.trim()).length!==1&&a.addIssue({code:e.ZodIssueCode.custom,path:["scheduleExpression"],message:"schedule must declare exactly one of cron, rate, once, or scheduleExpression"}),t.scheduleExpression&&!t.scheduleType&&a.addIssue({code:e.ZodIssueCode.custom,path:["scheduleType"],message:"scheduleType is required with scheduleExpression"});let i=t.command??t.target?.command??null,o=t.target?.name??null,s=t.actionName??t.action??t.target?.actionName??(t.target?.kind==="action"?o:null),c=t.target?.kind??(i?"command":"action");c==="action"&&!s&&a.addIssue({code:e.ZodIssueCode.custom,path:["action"],message:"schedule action target is required"}),c==="service"&&!o&&a.addIssue({code:e.ZodIssueCode.custom,path:["target","name"],message:"schedule service target name is required"}),c==="command"&&!i&&a.addIssue({code:e.ZodIssueCode.custom,path:["command"],message:"schedule command target is required"})}),v=e.object({schemaVersion:e.literal(1),name:e.string().trim().min(1).max(80).regex(/^[a-z0-9][a-z0-9-]*[a-z0-9]$/),version:e.string().trim().min(1).max(40),useCase:e.string().trim().min(1).max(80),description:e.string().trim().min(1).max(500),runtime:L,resources:T.optional(),setup:e.object({commands:w.default([])}).strict().default({commands:[]}),validation:e.object({commands:w.min(1),probes:e.array(F).max(20).default([])}).strict(),start:_,actions:e.array(I).max(20).default([]),services:e.array(I).max(20).default([]),schedules:e.array(G).max(20).default([]),mcp:e.object({endpoints:e.array(B).max(10).default([])}).strict().default({endpoints:[]}),volumes:e.array(j).max(5).default([]),integrations:e.object({requiredLeases:e.array(V).max(20).default([])}).strict().default({requiredLeases:[]}),permissions:Z,inputs:e.object({schema:W.default({type:"object"}),env:e.array(J).max(100).default([])}).strict().default({schema:{type:"object"},env:[]}),artifacts:e.object({paths:e.array(d).max(100).default([])}).strict().default({paths:[]}),network:e.object({egress:e.enum(["restricted","allow","block"]).default("restricted")}).strict().default({egress:"restricted"})}).strict().superRefine((t,a)=>{Q(t,a),y(a,t.volumes.flatMap(n=>n.name?[n.name]:[]),"volume names must be unique","volumes"),ee(t,a),te(t,a),ae(t,a),ne(t,a)}),me=e.object({path:e.string(),message:e.string(),code:e.string()});function K(t){let a;try{a=k.load(t)}catch(n){return{ok:!1,manifest:null,diagnostics:[{path:"$",code:"invalid_yaml",message:n instanceof Error?n.message:"Invalid YAML"}]}}return U(a)}r(K,"validateSandboxTemplateYaml");function U(t){if(!t||typeof t!="object"||Array.isArray(t))return{ok:!1,manifest:null,diagnostics:[{path:"$",code:"invalid_type",message:`${l} must be an object`}]};if(Object.prototype.hasOwnProperty.call(t,"databases"))return{ok:!1,manifest:null,diagnostics:[{path:"$.databases",code:"database_resources_removed",message:"managed database requests are unsupported for sandbox templates; use a durable volume with SQLite or files instead"}]};let a=v.safeParse(t);return a.success?{ok:!0,manifest:a.data,diagnostics:[]}:{ok:!1,manifest:null,diagnostics:a.error.issues.map(n=>({path:H(n.path),code:n.code,message:n.message}))}}r(U,"validateSandboxTemplateManifest");function ce(t){let a=K(t);if(!a.ok)throw new Error(X(a.diagnostics));return a.manifest}r(ce,"parseSandboxTemplateYaml");function X(t){return t.map(a=>`${a.path}: ${a.message}`).join(`
3
3
  `)}r(X,"formatSandboxTemplateDiagnostics");function pe(t){return v.parse(t)}r(pe,"defineSandboxTemplate");function de(t={}){return T.parse(t)}r(de,"sandboxTemplateResources");function le(t){return j.parse({...t,deleteOnSandboxDelete:t.deleteOnSandboxDelete??!1})}r(le,"sandboxTemplateDurableVolume");function ue(t,a={}){return E.parse({...a,port:t})}r(ue,"sandboxTemplatePreviewPort");function ge(t){let a=d.parse(t.targetPath),n=t.accept?.map(s=>s.trim()).filter(s=>s.length>0),i={targetPath:a,...n&&n.length>0?{accept:n}:{}},o={...t.title?.trim()?{title:t.title.trim()}:{},...t.description?.trim()?{description:t.description.trim()}:{},"x-openpond-upload":i};return t.multiple?{...o,"x-openpond-upload":{...i,multiple:!0},type:"array",items:{type:"string",format:"file"}}:{...o,type:"string",format:"file"}}r(ge,"sandboxTemplateFileInput");function A(t){return[{kind:"start",name:"start",...t.start,artifactPaths:f(t.start,t)},...t.actions.map(a=>({kind:"action",name:a.name,command:a.command,cwd:a.cwd,timeoutSeconds:a.timeoutSeconds,requiresStart:a.requiresStart,ports:a.ports,artifactPaths:f(a,t)})),...t.services.map(a=>({kind:"service",name:a.name,command:a.command,cwd:a.cwd,timeoutSeconds:a.timeoutSeconds,requiresStart:a.requiresStart,ports:a.ports,artifactPaths:f(a,t)}))]}r(A,"sandboxTemplateExecutableEntries");function Y(t){let a=A(t);return{template:{name:t.name,version:t.version,useCase:t.useCase,runtime:t.runtime},resources:t.resources??null,volumes:t.volumes,executables:a.map(n=>({kind:n.kind,name:n.name,command:n.command,cwd:n.cwd??null,timeoutSeconds:n.timeoutSeconds??null,requiresStart:n.requiresStart,ports:n.ports.map(i=>i.port),artifactPaths:n.artifactPaths})),ports:a.flatMap(n=>n.ports.map(i=>({executable:n.name,kind:n.kind,port:i.port,access:i.access,label:i.label??null}))),appMcpEndpoints:t.mcp.endpoints.map(n=>({name:n.name??null,service:n.service??null,port:n.port,path:n.path})),validation:{commands:t.validation.commands,probes:t.validation.probes},schedules:t.schedules}}r(Y,"sandboxTemplateBuildMetadata");function xe(t){return{kind:M,schemaVersion:1,manifestFile:t.manifestFile,projectRoot:t.projectRoot,manifest:t.manifest,metadata:Y(t.manifest),executables:A(t.manifest)}}r(xe,"sandboxTemplateBuildPlan");function fe(t){let a=t.name.trim()||"Sandbox Template",n=se(a),i=t.description?.trim()||`Local scaffold for ${a}.`;return{".gitignore":["node_modules","artifacts",".DS_Store",""].join(`
4
4
  `),"README.md":[`# ${a}`,"","Local sandbox template scaffold.","","## Commands","","- `pnpm dev` starts the preview service on port 3000.","- `pnpm process` writes a sample artifact.",`- \`pnpm validate\` validates ${l}.`,""].join(`
5
5
  `),"package.json":`${JSON.stringify({private:!0,type:"module",scripts:{dev:"node src/server.ts",process:"node scripts/process.ts",validate:`openpond sandbox-template validate --file ${l}`}},null,2)}
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{P as k,Q as E,_ as S}from"./chunk-SH7POUVX.js";import{f as B}from"./chunk-UGOK7VTC.js";import{a as l}from"./chunk-FTQLQJQV.js";import T from"node:path";var P="default",H=["apiKey","baseUrl","apiBaseUrl","chatApiBaseUrl","token","appId","conversationId"];function y(t,e){return Object.prototype.hasOwnProperty.call(t,e)}l(y,"hasOwn");function m(t){if(typeof t!="string")return null;let e=t.trim();return e.length>0?e:null}l(m,"normalizeHandle");function d(t){if(typeof t!="string")return null;let e=t.trim();return e?e.replace(/\/$/,""):null}l(d,"normalizeBaseUrl");function N(t){let e=m(t);if(!e)throw new Error("profile handle must be non-empty");return e}l(N,"requireHandle");function $(t){if(typeof t!="string")throw new Error("apiKey must be a non-empty string");let e=t.trim();if(!e)throw new Error("apiKey must be a non-empty string");return e}l($,"requireApiKey");function b(t,e){let n=m(t),s=m(e);return!!(n&&s&&n.toLowerCase()===s.toLowerCase())}l(b,"handleEquals");function R(t,e,n){let s=d(n);return t.findIndex(r=>b(r.handle,e)?s?d(r.baseUrl)===s:!0:!1)}l(R,"findAccountIndex");function U(t){let e=m(t.handle)??P,n=d(t.baseUrl);return n?{handle:e,baseUrl:n}:{handle:e}}l(U,"selectorFromAccount");function A(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=m(typeof e.handle=="string"?e.handle:void 0);if(!n)return null;let s=d(typeof e.baseUrl=="string"?e.baseUrl:void 0);return s?{handle:n,baseUrl:s}:{handle:n}}l(A,"sanitizeActiveProfile");function x(t){if(!t||typeof t!="object"||Array.isArray(t))return;let e=t,n=typeof e.repoPath=="string"?e.repoPath.trim():"",s=typeof e.profile=="string"&&e.profile.trim()?e.profile.trim():"default";if(!n)return;let r={repoPath:n,profile:s,mode:"local"};if(e.lastCheck&&typeof e.lastCheck=="object"&&!Array.isArray(e.lastCheck)){let o=e.lastCheck,a=o.command,c=o.status,f=o.checkedAt;(a==="inspect"||a==="build"||a==="validate"||a==="eval"||a==="run")&&(c==="passed"||c==="failed")&&typeof f=="string"&&(r.lastCheck={command:a,status:c,checkedAt:f,...typeof o.exitCode=="number"||o.exitCode===null?{exitCode:o.exitCode}:{},...typeof o.sourceHead=="string"||o.sourceHead===null?{sourceHead:o.sourceHead}:{}})}if(e.lastPush&&typeof e.lastPush=="object"&&!Array.isArray(e.lastPush)){let o=e.lastPush,a=o.status,c=o.pushedAt;(a==="pushed"||a==="failed")&&typeof c=="string"&&(r.lastPush={status:a,pushedAt:c,...typeof o.teamId=="string"||o.teamId===null?{teamId:o.teamId}:{},...typeof o.projectId=="string"||o.projectId===null?{projectId:o.projectId}:{},...typeof o.localHead=="string"||o.localHead===null?{localHead:o.localHead}:{},...typeof o.hostedHead=="string"||o.hostedHead===null?{hostedHead:o.hostedHead}:{},...typeof o.sourceRef=="string"||o.sourceRef===null?{sourceRef:o.sourceRef}:{},...o.promotionStatus==="uploaded"||o.promotionStatus==="hosted_source_materialized"||o.promotionStatus==="hosted_source_materialize_failed"||o.promotionStatus==="hosted_source_check_pending"||o.promotionStatus==="hosted_source_check_failed"||o.promotionStatus==="hosted_source_published"||o.promotionStatus==="hosted_source_publish_failed"||o.promotionStatus==="hosted_run_pending"||o.promotionStatus==="hosted_run_passed"||o.promotionStatus==="hosted_run_failed"||o.promotionStatus===null?{promotionStatus:o.promotionStatus}:{},...o.hostedRunStatus==="not_started"||o.hostedRunStatus==="running"||o.hostedRunStatus==="passed"||o.hostedRunStatus==="failed"||o.hostedRunStatus===null?{hostedRunStatus:o.hostedRunStatus}:{},...typeof o.hostedRunAgentId=="string"||o.hostedRunAgentId===null?{hostedRunAgentId:o.hostedRunAgentId}:{},...typeof o.hostedRunId=="string"||o.hostedRunId===null?{hostedRunId:o.hostedRunId}:{},...typeof o.hostedRunAt=="string"||o.hostedRunAt===null?{hostedRunAt:o.hostedRunAt}:{},...z(o.hostedSourceMaterialization)?{hostedSourceMaterialization:z(o.hostedSourceMaterialization)}:{},...K(o.hostedSourceCheck)?{hostedSourceCheck:K(o.hostedSourceCheck)}:{},...j(o.hostedPublish)?{hostedPublish:j(o.hostedPublish)}:{},...M(o.hostedRun)?{hostedRun:M(o.hostedRun)}:{},...typeof o.error=="string"||o.error===null?{error:o.error}:{}})}if(Array.isArray(e.profiles)){let o=e.profiles.flatMap(a=>{let c=x(a);if(!c)return[];let f=a,p=f.source==="github"||f.source==="openpond_git"?f.source:"local",g=typeof f.repositoryId=="string"&&f.repositoryId.trim()?f.repositoryId.trim():T.resolve(c.repoPath);return[{source:p,repositoryId:g,repoPath:c.repoPath,profile:c.profile,...c.lastCheck?{lastCheck:c.lastCheck}:{},...c.lastPush?{lastPush:c.lastPush}:{}}]});o.length>0&&(r.profiles=o)}return r}l(x,"sanitizeLocalOpenPondProfile");function z(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=I(e.status);return n?{status:n,...i(e,"agentId"),...i(e,"runtimeAgentId"),...i(e,"projectId"),...i(e,"sourceRoot"),...i(e,"sourceRef"),...i(e,"sourceCommitSha"),...i(e,"manifestHash"),...i(e,"manifestPath"),...i(e,"manifestSyncedAt"),...O(e,"fileCount"),...O(e,"totalBytes"),...i(e,"generatedManifestPath"),...C(e,"synthesizedOpenPondYaml"),...i(e,"uploadMetadataPath"),...u(e,"setupCommands"),...u(e,"validationCommands"),...i(e,"materializedAt"),...i(e,"error")}:null}l(z,"sanitizeHostedMaterializationStatus");function K(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=I(e.status);return n?{status:n,...i(e,"agentId"),...i(e,"deployPlanStatus"),...C(e,"canRun"),...C(e,"canDeploy"),...i(e,"sourceRef"),...i(e,"sourceCommitSha"),...i(e,"manifestHash"),...i(e,"manifestPath"),...u(e,"setupCommands"),...u(e,"validationCommands"),...u(e,"requiredChecks"),...u(e,"evalNames"),...u(e,"blockedReasons"),...u(e,"staleReasons"),...i(e,"runtimeId"),...i(e,"sandboxId"),...u(e,"traceArtifactRefs"),...u(e,"evalResultArtifactRefs"),...u(e,"validatorArtifactRefs"),...i(e,"checkedAt"),...i(e,"error")}:null}l(K,"sanitizeHostedSourceCheckStatus");function j(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=I(e.status);return n?{status:n,...i(e,"agentId"),...i(e,"snapshotId"),...i(e,"sourceRef"),...i(e,"sourceCommitSha"),...i(e,"manifestHash"),...i(e,"manifestPath"),...i(e,"buildStatus"),...i(e,"validationStatus"),...i(e,"evalStatus"),...i(e,"publishedAt"),...i(e,"error")}:null}l(j,"sanitizeHostedPublishStatus");function M(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=I(e.status);return n?{status:n,...i(e,"agentId"),...i(e,"runId"),...i(e,"runtimeId"),...i(e,"sandboxId"),...i(e,"sourceRef"),...i(e,"sourceCommitSha"),...i(e,"manifestHash"),...i(e,"setupGateStatus"),...u(e,"setupRequirementRefs"),...u(e,"artifactRefs"),...u(e,"traceArtifactRefs"),...u(e,"evalArtifactRefs"),...i(e,"startedAt"),...i(e,"completedAt"),...i(e,"error")}:null}l(M,"sanitizeHostedRunSummary");function i(t,e){let n=t[e];return typeof n=="string"||n===null?{[e]:n}:{}}l(i,"nullableStringProp");function C(t,e){let n=t[e];return typeof n=="boolean"||n===null?{[e]:n}:{}}l(C,"nullableBooleanProp");function O(t,e){let n=t[e];return typeof n=="number"||n===null?{[e]:n}:{}}l(O,"nullableNumberProp");function u(t,e){let n=t[e];if(!Array.isArray(n))return{};let s=n.filter(r=>typeof r=="string");return{[e]:s}}l(u,"stringArrayProp");function I(t){return typeof t=="string"&&t.trim()?t.trim():null}l(I,"stringField");function D(t,e){if(!b(t.handle,e.handle))return!1;let n=d(e.baseUrl);return n?d(t.baseUrl)===n:!d(t.baseUrl)}l(D,"accountMatchesSelector");function v(t,e,n={}){let s=d(e.baseUrl);if(s)return R(t,e.handle,s);let r=t.findIndex(a=>D(a,e));if(r!==-1)return r;let o=t.map((a,c)=>({account:a,index:c})).filter(({account:a})=>b(a.handle,e.handle));if(o.length>1&&n.requireUnambiguous)throw new Error(`multiple profiles found for ${e.handle}; pass --base-url to select one`);return o[0]?.index??-1}l(v,"findAccountIndexForSelector");function F(t){if(!t||typeof t!="object"||Array.isArray(t))return;let e=t,n={};return typeof e.token=="string"&&(n.token=e.token),(typeof e.appId=="string"||e.appId===null)&&(n.appId=e.appId),(typeof e.conversationId=="string"||e.conversationId===null)&&(n.conversationId=e.conversationId),Object.keys(n).length>0?n:void 0}l(F,"sanitizeSession");function Y(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=m(typeof e.handle=="string"?e.handle:void 0);if(!n)return null;let s={handle:n};typeof e.apiKey=="string"&&(s.apiKey=e.apiKey),typeof e.baseUrl=="string"&&(s.baseUrl=e.baseUrl),typeof e.apiBaseUrl=="string"&&(s.apiBaseUrl=e.apiBaseUrl),typeof e.chatApiBaseUrl=="string"&&(s.chatApiBaseUrl=e.chatApiBaseUrl),typeof e.environment=="string"&&(s.environment=e.environment);let r=F(e.session);return r&&(s.session=r),s}l(Y,"sanitizeAccount");function J(t){let e={};return typeof t.token=="string"&&(e.token=t.token),(typeof t.appId=="string"||t.appId===null)&&(e.appId=t.appId),(typeof t.conversationId=="string"||t.conversationId===null)&&(e.conversationId=t.conversationId),Object.keys(e).length>0?e:void 0}l(J,"extractLegacySession");function Q(t,e){let n={handle:e};typeof t.apiKey=="string"&&(n.apiKey=t.apiKey),typeof t.baseUrl=="string"&&(n.baseUrl=t.baseUrl),typeof t.apiBaseUrl=="string"&&(n.apiBaseUrl=t.apiBaseUrl),typeof t.chatApiBaseUrl=="string"&&(n.chatApiBaseUrl=t.chatApiBaseUrl);let s=J(t);return s&&(n.session=s),n}l(Q,"extractLegacyAccount");function L(t){let e={};typeof t.lspEnabled=="boolean"&&(e.lspEnabled=t.lspEnabled),(t.executionMode==="local"||t.executionMode==="hosted")&&(e.executionMode=t.executionMode),(t.mode==="general"||t.mode==="builder")&&(e.mode=t.mode);let n=x(t.openpondProfile);n&&(e.openpondProfile=n);let s=[],r=Array.isArray(t.accounts)?t.accounts:[];for(let f of r){let p=Y(f);p&&R(s,p.handle,p.baseUrl)===-1&&s.push(p)}if(s.length===0){let f=A(t.activeProfile)?.handle||P;s.push(Q(t,f))}let o=A(t.activeProfile),a=o?v(s,o):-1,c=s[a===-1?0:a];return e.accounts=s,e.activeProfile=U(c),e}l(L,"normalizeGlobalConfig");function V(t,e,n){let s=t.accounts??[],r=d(n??process.env.OPENPOND_BASE_URL),o=m(e);if(o)return r?{handle:o,baseUrl:r}:{handle:o};let a=m(process.env.OPENPOND_ACCOUNT);if(a)return r?{handle:a,baseUrl:r}:{handle:a};let c=A(t.activeProfile);return c?r?{handle:c.handle,baseUrl:r}:c:s[0]?U(s[0]):{handle:P}}l(V,"resolveRequestedProfile");function w(t,e,n){let s=d(n);if(s){let o=R(t,e,s);if(o!==-1)return t[o]}else{let o=t.filter(a=>b(a.handle,e));if(o.length>1)throw new Error(`multiple profiles found for ${e}; pass --base-url to select one`);if(o.length===1)return o[0]}let r={handle:e};return s&&(r.baseUrl=s),t.push(r),r}l(w,"ensureAccount");function q(t){t.session&&Object.keys(t.session).length===0&&delete t.session}l(q,"cleanupAccount");function W(t,e,n,s){let r=n===null||n===void 0&&s.undefinedDeletes;switch(e){case"apiKey":{if(r){delete t.apiKey;return}typeof n=="string"&&(t.apiKey=n);return}case"baseUrl":{if(r){delete t.baseUrl;return}typeof n=="string"&&(t.baseUrl=n);return}case"apiBaseUrl":{if(r){delete t.apiBaseUrl;return}typeof n=="string"&&(t.apiBaseUrl=n);return}case"chatApiBaseUrl":{if(r){delete t.chatApiBaseUrl;return}typeof n=="string"&&(t.chatApiBaseUrl=n);return}case"token":case"appId":case"conversationId":{if(t.session||(t.session={}),r){delete t.session[e],q(t);return}(typeof n=="string"||n===null)&&(t.session[e]=n),q(t);return}}}l(W,"applyScopedKey");function X(t,e,n){if(!H.some(f=>y(e,f)))return!1;let r=t.accounts??[],o=A(e.activeProfile)??V(t),a=d(y(e,"baseUrl")?e.baseUrl??null:o.baseUrl??process.env.OPENPOND_BASE_URL),c=w(r,o.handle,a);for(let f of H)y(e,f)&&W(c,f,e[f],n);return t.accounts=r,t.activeProfile=U(c),!0}l(X,"applyAccountPatch");function Z(t,e){if(y(e,"lspEnabled")&&(typeof e.lspEnabled=="boolean"?t.lspEnabled=e.lspEnabled:e.lspEnabled===null&&delete t.lspEnabled),y(e,"executionMode")&&(e.executionMode==="local"||e.executionMode==="hosted"?t.executionMode=e.executionMode:e.executionMode===null&&delete t.executionMode),y(e,"mode")&&(e.mode==="general"||e.mode==="builder"?t.mode=e.mode:e.mode===null&&delete t.mode),y(e,"activeProfile")){let n=A(e.activeProfile);if(n){let s=v(t.accounts??[],n);t.activeProfile=s===-1?n:U((t.accounts??[])[s])}else e.activeProfile===null&&delete t.activeProfile}if(y(e,"openpondProfile")){let n=x(e.openpondProfile);n?t.openpondProfile=n:e.openpondProfile===null&&delete t.openpondProfile}}l(Z,"applyTopLevelPatch");async function _(t){let e=B();return await S(e),await E(e,n=>{let s=L(n);return t(s),s})}l(_,"updateGlobalConfig");async function ee(){let t=B();return await S(t),L(await k(t))}l(ee,"loadGlobalConfig");async function G(){let t=await ee(),e=A(t.activeProfile);return(t.accounts??[]).map(n=>{let s=m(n.handle)??P;return{handle:s,baseUrl:d(n.baseUrl),apiBaseUrl:d(n.apiBaseUrl),chatApiBaseUrl:d(n.chatApiBaseUrl),environment:n.environment?.trim()||null,isActive:!!(e&&D({...n,handle:s},e)),hasApiKey:!!n.apiKey?.trim(),hasSessionToken:!!n.session?.token?.trim(),sessionAppId:n.session?.appId??null,sessionConversationId:n.session?.conversationId??null}})}l(G,"listConfiguredProfiles");async function se(t,e={}){let n=N(t),s=d(e.baseUrl),r=-1;await _(a=>{let c=a.accounts??[];if(r=v(c,s?{handle:n,baseUrl:s}:{handle:n},{requireUnambiguous:!0}),r===-1)throw new Error(`profile not found: ${n}`);a.activeProfile=U(c[r])});let o=await G();return o.find(a=>a.isActive)??o[r]}l(se,"setActiveProfile");async function re(t){let e=N(t.handle),n=$(t.apiKey),s=d(t.baseUrl),r=d(t.apiBaseUrl),o=d(t.chatApiBaseUrl),a={handle:e};await _(p=>{let g=p.accounts??[],h=w(g,e,s);h.apiKey=n,s&&(h.baseUrl=s),r?h.apiBaseUrl=r:t.apiBaseUrl===null&&delete h.apiBaseUrl,o?h.chatApiBaseUrl=o:t.chatApiBaseUrl===null&&delete h.chatApiBaseUrl,t.environment===null?delete h.environment:typeof t.environment=="string"&&t.environment.trim()&&(h.environment=t.environment.trim()),p.accounts=g,a=U(h),t.setActive!==!1&&(p.activeProfile=a)});let f=(await G()).find(p=>b(p.handle,a.handle)?s?d(p.baseUrl)===s:!0:!1);if(!f)throw new Error(`failed to save profile: ${e}`);return f}l(re,"saveProfileApiKey");async function ie(t){await _(e=>{Z(e,t),X(e,t,{undefinedDeletes:!1})})}l(ie,"saveGlobalConfig");export{_ as a,ee as b,G as c,se as d,re as e,ie as f};
2
+ import{P as k,Q as E,_ as S}from"./chunk-SV7ZBEK2.js";import{f as B}from"./chunk-UGOK7VTC.js";import{a as l}from"./chunk-FTQLQJQV.js";import T from"node:path";var P="default",H=["apiKey","baseUrl","apiBaseUrl","chatApiBaseUrl","token","appId","conversationId"];function y(t,e){return Object.prototype.hasOwnProperty.call(t,e)}l(y,"hasOwn");function m(t){if(typeof t!="string")return null;let e=t.trim();return e.length>0?e:null}l(m,"normalizeHandle");function d(t){if(typeof t!="string")return null;let e=t.trim();return e?e.replace(/\/$/,""):null}l(d,"normalizeBaseUrl");function N(t){let e=m(t);if(!e)throw new Error("profile handle must be non-empty");return e}l(N,"requireHandle");function $(t){if(typeof t!="string")throw new Error("apiKey must be a non-empty string");let e=t.trim();if(!e)throw new Error("apiKey must be a non-empty string");return e}l($,"requireApiKey");function b(t,e){let n=m(t),s=m(e);return!!(n&&s&&n.toLowerCase()===s.toLowerCase())}l(b,"handleEquals");function R(t,e,n){let s=d(n);return t.findIndex(r=>b(r.handle,e)?s?d(r.baseUrl)===s:!0:!1)}l(R,"findAccountIndex");function U(t){let e=m(t.handle)??P,n=d(t.baseUrl);return n?{handle:e,baseUrl:n}:{handle:e}}l(U,"selectorFromAccount");function A(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=m(typeof e.handle=="string"?e.handle:void 0);if(!n)return null;let s=d(typeof e.baseUrl=="string"?e.baseUrl:void 0);return s?{handle:n,baseUrl:s}:{handle:n}}l(A,"sanitizeActiveProfile");function x(t){if(!t||typeof t!="object"||Array.isArray(t))return;let e=t,n=typeof e.repoPath=="string"?e.repoPath.trim():"",s=typeof e.profile=="string"&&e.profile.trim()?e.profile.trim():"default";if(!n)return;let r={repoPath:n,profile:s,mode:"local"};if(e.lastCheck&&typeof e.lastCheck=="object"&&!Array.isArray(e.lastCheck)){let o=e.lastCheck,a=o.command,c=o.status,f=o.checkedAt;(a==="inspect"||a==="build"||a==="validate"||a==="eval"||a==="run")&&(c==="passed"||c==="failed")&&typeof f=="string"&&(r.lastCheck={command:a,status:c,checkedAt:f,...typeof o.exitCode=="number"||o.exitCode===null?{exitCode:o.exitCode}:{},...typeof o.sourceHead=="string"||o.sourceHead===null?{sourceHead:o.sourceHead}:{}})}if(e.lastPush&&typeof e.lastPush=="object"&&!Array.isArray(e.lastPush)){let o=e.lastPush,a=o.status,c=o.pushedAt;(a==="pushed"||a==="failed")&&typeof c=="string"&&(r.lastPush={status:a,pushedAt:c,...typeof o.teamId=="string"||o.teamId===null?{teamId:o.teamId}:{},...typeof o.projectId=="string"||o.projectId===null?{projectId:o.projectId}:{},...typeof o.localHead=="string"||o.localHead===null?{localHead:o.localHead}:{},...typeof o.hostedHead=="string"||o.hostedHead===null?{hostedHead:o.hostedHead}:{},...typeof o.sourceRef=="string"||o.sourceRef===null?{sourceRef:o.sourceRef}:{},...o.promotionStatus==="uploaded"||o.promotionStatus==="hosted_source_materialized"||o.promotionStatus==="hosted_source_materialize_failed"||o.promotionStatus==="hosted_source_check_pending"||o.promotionStatus==="hosted_source_check_failed"||o.promotionStatus==="hosted_source_published"||o.promotionStatus==="hosted_source_publish_failed"||o.promotionStatus==="hosted_run_pending"||o.promotionStatus==="hosted_run_passed"||o.promotionStatus==="hosted_run_failed"||o.promotionStatus===null?{promotionStatus:o.promotionStatus}:{},...o.hostedRunStatus==="not_started"||o.hostedRunStatus==="running"||o.hostedRunStatus==="passed"||o.hostedRunStatus==="failed"||o.hostedRunStatus===null?{hostedRunStatus:o.hostedRunStatus}:{},...typeof o.hostedRunAgentId=="string"||o.hostedRunAgentId===null?{hostedRunAgentId:o.hostedRunAgentId}:{},...typeof o.hostedRunId=="string"||o.hostedRunId===null?{hostedRunId:o.hostedRunId}:{},...typeof o.hostedRunAt=="string"||o.hostedRunAt===null?{hostedRunAt:o.hostedRunAt}:{},...z(o.hostedSourceMaterialization)?{hostedSourceMaterialization:z(o.hostedSourceMaterialization)}:{},...K(o.hostedSourceCheck)?{hostedSourceCheck:K(o.hostedSourceCheck)}:{},...j(o.hostedPublish)?{hostedPublish:j(o.hostedPublish)}:{},...M(o.hostedRun)?{hostedRun:M(o.hostedRun)}:{},...typeof o.error=="string"||o.error===null?{error:o.error}:{}})}if(Array.isArray(e.profiles)){let o=e.profiles.flatMap(a=>{let c=x(a);if(!c)return[];let f=a,p=f.source==="github"||f.source==="openpond_git"?f.source:"local",g=typeof f.repositoryId=="string"&&f.repositoryId.trim()?f.repositoryId.trim():T.resolve(c.repoPath);return[{source:p,repositoryId:g,repoPath:c.repoPath,profile:c.profile,...c.lastCheck?{lastCheck:c.lastCheck}:{},...c.lastPush?{lastPush:c.lastPush}:{}}]});o.length>0&&(r.profiles=o)}return r}l(x,"sanitizeLocalOpenPondProfile");function z(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=I(e.status);return n?{status:n,...i(e,"agentId"),...i(e,"runtimeAgentId"),...i(e,"projectId"),...i(e,"sourceRoot"),...i(e,"sourceRef"),...i(e,"sourceCommitSha"),...i(e,"manifestHash"),...i(e,"manifestPath"),...i(e,"manifestSyncedAt"),...O(e,"fileCount"),...O(e,"totalBytes"),...i(e,"generatedManifestPath"),...C(e,"synthesizedOpenPondYaml"),...i(e,"uploadMetadataPath"),...u(e,"setupCommands"),...u(e,"validationCommands"),...i(e,"materializedAt"),...i(e,"error")}:null}l(z,"sanitizeHostedMaterializationStatus");function K(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=I(e.status);return n?{status:n,...i(e,"agentId"),...i(e,"deployPlanStatus"),...C(e,"canRun"),...C(e,"canDeploy"),...i(e,"sourceRef"),...i(e,"sourceCommitSha"),...i(e,"manifestHash"),...i(e,"manifestPath"),...u(e,"setupCommands"),...u(e,"validationCommands"),...u(e,"requiredChecks"),...u(e,"evalNames"),...u(e,"blockedReasons"),...u(e,"staleReasons"),...i(e,"runtimeId"),...i(e,"sandboxId"),...u(e,"traceArtifactRefs"),...u(e,"evalResultArtifactRefs"),...u(e,"validatorArtifactRefs"),...i(e,"checkedAt"),...i(e,"error")}:null}l(K,"sanitizeHostedSourceCheckStatus");function j(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=I(e.status);return n?{status:n,...i(e,"agentId"),...i(e,"snapshotId"),...i(e,"sourceRef"),...i(e,"sourceCommitSha"),...i(e,"manifestHash"),...i(e,"manifestPath"),...i(e,"buildStatus"),...i(e,"validationStatus"),...i(e,"evalStatus"),...i(e,"publishedAt"),...i(e,"error")}:null}l(j,"sanitizeHostedPublishStatus");function M(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=I(e.status);return n?{status:n,...i(e,"agentId"),...i(e,"runId"),...i(e,"runtimeId"),...i(e,"sandboxId"),...i(e,"sourceRef"),...i(e,"sourceCommitSha"),...i(e,"manifestHash"),...i(e,"setupGateStatus"),...u(e,"setupRequirementRefs"),...u(e,"artifactRefs"),...u(e,"traceArtifactRefs"),...u(e,"evalArtifactRefs"),...i(e,"startedAt"),...i(e,"completedAt"),...i(e,"error")}:null}l(M,"sanitizeHostedRunSummary");function i(t,e){let n=t[e];return typeof n=="string"||n===null?{[e]:n}:{}}l(i,"nullableStringProp");function C(t,e){let n=t[e];return typeof n=="boolean"||n===null?{[e]:n}:{}}l(C,"nullableBooleanProp");function O(t,e){let n=t[e];return typeof n=="number"||n===null?{[e]:n}:{}}l(O,"nullableNumberProp");function u(t,e){let n=t[e];if(!Array.isArray(n))return{};let s=n.filter(r=>typeof r=="string");return{[e]:s}}l(u,"stringArrayProp");function I(t){return typeof t=="string"&&t.trim()?t.trim():null}l(I,"stringField");function D(t,e){if(!b(t.handle,e.handle))return!1;let n=d(e.baseUrl);return n?d(t.baseUrl)===n:!d(t.baseUrl)}l(D,"accountMatchesSelector");function v(t,e,n={}){let s=d(e.baseUrl);if(s)return R(t,e.handle,s);let r=t.findIndex(a=>D(a,e));if(r!==-1)return r;let o=t.map((a,c)=>({account:a,index:c})).filter(({account:a})=>b(a.handle,e.handle));if(o.length>1&&n.requireUnambiguous)throw new Error(`multiple profiles found for ${e.handle}; pass --base-url to select one`);return o[0]?.index??-1}l(v,"findAccountIndexForSelector");function F(t){if(!t||typeof t!="object"||Array.isArray(t))return;let e=t,n={};return typeof e.token=="string"&&(n.token=e.token),(typeof e.appId=="string"||e.appId===null)&&(n.appId=e.appId),(typeof e.conversationId=="string"||e.conversationId===null)&&(n.conversationId=e.conversationId),Object.keys(n).length>0?n:void 0}l(F,"sanitizeSession");function Y(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=m(typeof e.handle=="string"?e.handle:void 0);if(!n)return null;let s={handle:n};typeof e.apiKey=="string"&&(s.apiKey=e.apiKey),typeof e.baseUrl=="string"&&(s.baseUrl=e.baseUrl),typeof e.apiBaseUrl=="string"&&(s.apiBaseUrl=e.apiBaseUrl),typeof e.chatApiBaseUrl=="string"&&(s.chatApiBaseUrl=e.chatApiBaseUrl),typeof e.environment=="string"&&(s.environment=e.environment);let r=F(e.session);return r&&(s.session=r),s}l(Y,"sanitizeAccount");function J(t){let e={};return typeof t.token=="string"&&(e.token=t.token),(typeof t.appId=="string"||t.appId===null)&&(e.appId=t.appId),(typeof t.conversationId=="string"||t.conversationId===null)&&(e.conversationId=t.conversationId),Object.keys(e).length>0?e:void 0}l(J,"extractLegacySession");function Q(t,e){let n={handle:e};typeof t.apiKey=="string"&&(n.apiKey=t.apiKey),typeof t.baseUrl=="string"&&(n.baseUrl=t.baseUrl),typeof t.apiBaseUrl=="string"&&(n.apiBaseUrl=t.apiBaseUrl),typeof t.chatApiBaseUrl=="string"&&(n.chatApiBaseUrl=t.chatApiBaseUrl);let s=J(t);return s&&(n.session=s),n}l(Q,"extractLegacyAccount");function L(t){let e={};typeof t.lspEnabled=="boolean"&&(e.lspEnabled=t.lspEnabled),(t.executionMode==="local"||t.executionMode==="hosted")&&(e.executionMode=t.executionMode),(t.mode==="general"||t.mode==="builder")&&(e.mode=t.mode);let n=x(t.openpondProfile);n&&(e.openpondProfile=n);let s=[],r=Array.isArray(t.accounts)?t.accounts:[];for(let f of r){let p=Y(f);p&&R(s,p.handle,p.baseUrl)===-1&&s.push(p)}if(s.length===0){let f=A(t.activeProfile)?.handle||P;s.push(Q(t,f))}let o=A(t.activeProfile),a=o?v(s,o):-1,c=s[a===-1?0:a];return e.accounts=s,e.activeProfile=U(c),e}l(L,"normalizeGlobalConfig");function V(t,e,n){let s=t.accounts??[],r=d(n??process.env.OPENPOND_BASE_URL),o=m(e);if(o)return r?{handle:o,baseUrl:r}:{handle:o};let a=m(process.env.OPENPOND_ACCOUNT);if(a)return r?{handle:a,baseUrl:r}:{handle:a};let c=A(t.activeProfile);return c?r?{handle:c.handle,baseUrl:r}:c:s[0]?U(s[0]):{handle:P}}l(V,"resolveRequestedProfile");function w(t,e,n){let s=d(n);if(s){let o=R(t,e,s);if(o!==-1)return t[o]}else{let o=t.filter(a=>b(a.handle,e));if(o.length>1)throw new Error(`multiple profiles found for ${e}; pass --base-url to select one`);if(o.length===1)return o[0]}let r={handle:e};return s&&(r.baseUrl=s),t.push(r),r}l(w,"ensureAccount");function q(t){t.session&&Object.keys(t.session).length===0&&delete t.session}l(q,"cleanupAccount");function W(t,e,n,s){let r=n===null||n===void 0&&s.undefinedDeletes;switch(e){case"apiKey":{if(r){delete t.apiKey;return}typeof n=="string"&&(t.apiKey=n);return}case"baseUrl":{if(r){delete t.baseUrl;return}typeof n=="string"&&(t.baseUrl=n);return}case"apiBaseUrl":{if(r){delete t.apiBaseUrl;return}typeof n=="string"&&(t.apiBaseUrl=n);return}case"chatApiBaseUrl":{if(r){delete t.chatApiBaseUrl;return}typeof n=="string"&&(t.chatApiBaseUrl=n);return}case"token":case"appId":case"conversationId":{if(t.session||(t.session={}),r){delete t.session[e],q(t);return}(typeof n=="string"||n===null)&&(t.session[e]=n),q(t);return}}}l(W,"applyScopedKey");function X(t,e,n){if(!H.some(f=>y(e,f)))return!1;let r=t.accounts??[],o=A(e.activeProfile)??V(t),a=d(y(e,"baseUrl")?e.baseUrl??null:o.baseUrl??process.env.OPENPOND_BASE_URL),c=w(r,o.handle,a);for(let f of H)y(e,f)&&W(c,f,e[f],n);return t.accounts=r,t.activeProfile=U(c),!0}l(X,"applyAccountPatch");function Z(t,e){if(y(e,"lspEnabled")&&(typeof e.lspEnabled=="boolean"?t.lspEnabled=e.lspEnabled:e.lspEnabled===null&&delete t.lspEnabled),y(e,"executionMode")&&(e.executionMode==="local"||e.executionMode==="hosted"?t.executionMode=e.executionMode:e.executionMode===null&&delete t.executionMode),y(e,"mode")&&(e.mode==="general"||e.mode==="builder"?t.mode=e.mode:e.mode===null&&delete t.mode),y(e,"activeProfile")){let n=A(e.activeProfile);if(n){let s=v(t.accounts??[],n);t.activeProfile=s===-1?n:U((t.accounts??[])[s])}else e.activeProfile===null&&delete t.activeProfile}if(y(e,"openpondProfile")){let n=x(e.openpondProfile);n?t.openpondProfile=n:e.openpondProfile===null&&delete t.openpondProfile}}l(Z,"applyTopLevelPatch");async function _(t){let e=B();return await S(e),await E(e,n=>{let s=L(n);return t(s),s})}l(_,"updateGlobalConfig");async function ee(){let t=B();return await S(t),L(await k(t))}l(ee,"loadGlobalConfig");async function G(){let t=await ee(),e=A(t.activeProfile);return(t.accounts??[]).map(n=>{let s=m(n.handle)??P;return{handle:s,baseUrl:d(n.baseUrl),apiBaseUrl:d(n.apiBaseUrl),chatApiBaseUrl:d(n.chatApiBaseUrl),environment:n.environment?.trim()||null,isActive:!!(e&&D({...n,handle:s},e)),hasApiKey:!!n.apiKey?.trim(),hasSessionToken:!!n.session?.token?.trim(),sessionAppId:n.session?.appId??null,sessionConversationId:n.session?.conversationId??null}})}l(G,"listConfiguredProfiles");async function se(t,e={}){let n=N(t),s=d(e.baseUrl),r=-1;await _(a=>{let c=a.accounts??[];if(r=v(c,s?{handle:n,baseUrl:s}:{handle:n},{requireUnambiguous:!0}),r===-1)throw new Error(`profile not found: ${n}`);a.activeProfile=U(c[r])});let o=await G();return o.find(a=>a.isActive)??o[r]}l(se,"setActiveProfile");async function re(t){let e=N(t.handle),n=$(t.apiKey),s=d(t.baseUrl),r=d(t.apiBaseUrl),o=d(t.chatApiBaseUrl),a={handle:e};await _(p=>{let g=p.accounts??[],h=w(g,e,s);h.apiKey=n,s&&(h.baseUrl=s),r?h.apiBaseUrl=r:t.apiBaseUrl===null&&delete h.apiBaseUrl,o?h.chatApiBaseUrl=o:t.chatApiBaseUrl===null&&delete h.chatApiBaseUrl,t.environment===null?delete h.environment:typeof t.environment=="string"&&t.environment.trim()&&(h.environment=t.environment.trim()),p.accounts=g,a=U(h),t.setActive!==!1&&(p.activeProfile=a)});let f=(await G()).find(p=>b(p.handle,a.handle)?s?d(p.baseUrl)===s:!0:!1);if(!f)throw new Error(`failed to save profile: ${e}`);return f}l(re,"saveProfileApiKey");async function ie(t){await _(e=>{Z(e,t),X(e,t,{undefinedDeletes:!1})})}l(ie,"saveGlobalConfig");export{_ as a,ee as b,G as c,se as d,re as e,ie as f};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{b as h,g as T}from"./chunk-YONDU5TN.js";import{f as u}from"./chunk-AXYAEWWA.js";import{m}from"./chunk-RCT3O3HQ.js";import{a as l}from"./chunk-FTQLQJQV.js";import{cp as P,lstat as k,mkdir as $,mkdtemp as j,readFile as v,readdir as b,rename as x,rm as z}from"node:fs/promises";import c from"node:path";async function B(s,i,r,t={}){return L(c.join(s,"training","tasksets"),i,r,t)}l(B,"materializeImmutableTasksetPackage");async function L(s,i,r,t={}){if(!/^[a-z0-9][a-z0-9-]{1,239}$/.test(r))throw new Error("Taskset package identity is not a safe directory name.");await $(s,{recursive:!0});let e=await j(c.join(s,".starter-")),o=c.join(s,r);try{if(t.source){let n=await k(t.source.directory);if(!n.isDirectory()||n.isSymbolicLink())throw new Error("Taskset source must be a regular directory.");await y(t.source.directory);for(let d of await b(t.source.directory))await P(c.join(t.source.directory,d),c.join(e,d),{recursive:!0,force:!1,errorOnExist:!0});if(await y(e),await h(e)!==t.source.packageHash)throw new Error("Taskset draft files changed during publication. Refresh before publishing.")}await T(i.taskset,e,{generatedFiles:i.generatedFiles}),await t.verify?.(e);let a=(await y(e)).sort();try{await x(e,o)}catch(n){if(!["EEXIST","ENOTEMPTY"].includes(n.code??""))throw n;let d=await k(o);if(!d.isDirectory()||d.isSymbolicLink())throw new Error("Starter package destination is not a regular directory.");let S=await y(o);if(JSON.stringify(S.sort())!==JSON.stringify(a))throw new Error("Existing starter package has a different file inventory.");for(let w of a){let p=c.join(o,w),g=await k(p);if(!g.isFile()||g.isSymbolicLink()||!(await v(p)).equals(await v(c.join(e,w))))throw new Error("Existing starter package differs from the pinned creation attempt.")}}return o}finally{await z(e,{recursive:!0,force:!0})}}l(L,"materializeImmutableTasksetPackageAtRoot");async function y(s,i=""){let r=[];for(let t of await b(c.join(s,i),{withFileTypes:!0})){let e=c.join(i,t.name);if(t.isSymbolicLink())throw new Error("Starter packages cannot contain symbolic links.");if(t.isDirectory())r.push(...await y(s,e));else if(t.isFile())r.push(e);else throw new Error("Starter packages must contain regular files and directories.")}return r}l(y,"regularFiles");import{lstat as E,readFile as F}from"node:fs/promises";import f from"node:path";function I(s,i,r){let t=f.resolve(s),e=f.resolve(t,r.artifactRef);if(!e.startsWith(`${t}${f.sep}`))throw new Error(`Taskset asset ${r.id} escapes its package.`);if(i.metadata.portableFileInventory===void 0){if(!e.startsWith(`${f.join(t,"assets")}${f.sep}`))throw new Error(`Work asset ${r.id} must resolve inside the Taskset assets directory.`)}else{let a=u.parse(i.metadata.portableFileInventory).find(n=>n.asset.id===r.id&&n.sourcePath===r.artifactRef);if(!a||a.asset.visibility!=="policy"||a.asset.contentHash!==r.sha256||a.asset.sizeBytes!==r.sizeBytes||a.asset.mediaType!==r.mediaType)throw new Error(`Taskset asset ${r.id} differs from its declared policy inventory.`)}return e}l(I,"resolveTasksetPolicyAssetPath");async function J(s,i){let r=u.parse(i.metadata.portableFileInventory??[]);for(let t of r){let e=f.resolve(s,t.sourcePath);if(!e.startsWith(`${f.resolve(s)}${f.sep}`))throw new Error("Taskset inventory file escapes its package.");let o=await E(e);if(!o.isFile()||o.isSymbolicLink())throw new Error("Taskset inventory requires regular files.");let a=await F(e);if(a.length!==t.asset.sizeBytes||m(a)!==t.asset.contentHash)throw new Error(`Taskset file differs from its immutable inventory: ${t.asset.id}.`)}for(let t of i.tasks)for(let e of t.assets??[]){let o=I(s,i,e),a=await E(o);if(!a.isFile()||a.isSymbolicLink())throw new Error(`Taskset asset ${e.id} is not a regular file.`);let n=await F(o);if(n.byteLength!==e.sizeBytes||m(n)!==e.sha256)throw new Error(`Taskset asset ${e.id} does not match its immutable manifest.`)}}l(J,"verifyPublishedTasksetAssets");export{B as a,L as b,I as c,J as d};
2
+ import{b as h,g as T}from"./chunk-CIZI6Z7D.js";import{c as u}from"./chunk-JVMSN7LH.js";import{m}from"./chunk-RCT3O3HQ.js";import{a as l}from"./chunk-FTQLQJQV.js";import{cp as P,lstat as k,mkdir as $,mkdtemp as j,readFile as v,readdir as b,rename as x,rm as z}from"node:fs/promises";import c from"node:path";async function B(s,i,r,t={}){return L(c.join(s,"training","tasksets"),i,r,t)}l(B,"materializeImmutableTasksetPackage");async function L(s,i,r,t={}){if(!/^[a-z0-9][a-z0-9-]{1,239}$/.test(r))throw new Error("Taskset package identity is not a safe directory name.");await $(s,{recursive:!0});let e=await j(c.join(s,".starter-")),o=c.join(s,r);try{if(t.source){let n=await k(t.source.directory);if(!n.isDirectory()||n.isSymbolicLink())throw new Error("Taskset source must be a regular directory.");await y(t.source.directory);for(let d of await b(t.source.directory))await P(c.join(t.source.directory,d),c.join(e,d),{recursive:!0,force:!1,errorOnExist:!0});if(await y(e),await h(e)!==t.source.packageHash)throw new Error("Taskset draft files changed during publication. Refresh before publishing.")}await T(i.taskset,e,{generatedFiles:i.generatedFiles}),await t.verify?.(e);let a=(await y(e)).sort();try{await x(e,o)}catch(n){if(!["EEXIST","ENOTEMPTY"].includes(n.code??""))throw n;let d=await k(o);if(!d.isDirectory()||d.isSymbolicLink())throw new Error("Starter package destination is not a regular directory.");let S=await y(o);if(JSON.stringify(S.sort())!==JSON.stringify(a))throw new Error("Existing starter package has a different file inventory.");for(let w of a){let p=c.join(o,w),g=await k(p);if(!g.isFile()||g.isSymbolicLink()||!(await v(p)).equals(await v(c.join(e,w))))throw new Error("Existing starter package differs from the pinned creation attempt.")}}return o}finally{await z(e,{recursive:!0,force:!0})}}l(L,"materializeImmutableTasksetPackageAtRoot");async function y(s,i=""){let r=[];for(let t of await b(c.join(s,i),{withFileTypes:!0})){let e=c.join(i,t.name);if(t.isSymbolicLink())throw new Error("Starter packages cannot contain symbolic links.");if(t.isDirectory())r.push(...await y(s,e));else if(t.isFile())r.push(e);else throw new Error("Starter packages must contain regular files and directories.")}return r}l(y,"regularFiles");import{lstat as E,readFile as F}from"node:fs/promises";import f from"node:path";function I(s,i,r){let t=f.resolve(s),e=f.resolve(t,r.artifactRef);if(!e.startsWith(`${t}${f.sep}`))throw new Error(`Taskset asset ${r.id} escapes its package.`);if(i.metadata.portableFileInventory===void 0){if(!e.startsWith(`${f.join(t,"assets")}${f.sep}`))throw new Error(`Work asset ${r.id} must resolve inside the Taskset assets directory.`)}else{let a=u.parse(i.metadata.portableFileInventory).find(n=>n.asset.id===r.id&&n.sourcePath===r.artifactRef);if(!a||a.asset.visibility!=="policy"||a.asset.contentHash!==r.sha256||a.asset.sizeBytes!==r.sizeBytes||a.asset.mediaType!==r.mediaType)throw new Error(`Taskset asset ${r.id} differs from its declared policy inventory.`)}return e}l(I,"resolveTasksetPolicyAssetPath");async function J(s,i){let r=u.parse(i.metadata.portableFileInventory??[]);for(let t of r){let e=f.resolve(s,t.sourcePath);if(!e.startsWith(`${f.resolve(s)}${f.sep}`))throw new Error("Taskset inventory file escapes its package.");let o=await E(e);if(!o.isFile()||o.isSymbolicLink())throw new Error("Taskset inventory requires regular files.");let a=await F(e);if(a.length!==t.asset.sizeBytes||m(a)!==t.asset.contentHash)throw new Error(`Taskset file differs from its immutable inventory: ${t.asset.id}.`)}for(let t of i.tasks)for(let e of t.assets??[]){let o=I(s,i,e),a=await E(o);if(!a.isFile()||a.isSymbolicLink())throw new Error(`Taskset asset ${e.id} is not a regular file.`);let n=await F(o);if(n.byteLength!==e.sizeBytes||m(n)!==e.sha256)throw new Error(`Taskset asset ${e.id} does not match its immutable manifest.`)}}l(J,"verifyPublishedTasksetAssets");export{B as a,L as b,I as c,J as d};