openpond 0.2.66 → 0.2.68

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 (580) hide show
  1. package/dist/app-server.d.ts +691 -1
  2. package/dist/app-server.js +1 -1
  3. package/dist/chunks/{account-context-TIJOM22A.js → account-context-MWB6HN6I.js} +1 -1
  4. package/dist/chunks/{acp-YYZ3ZO3Q.js → acp-2OIXATRY.js} +1 -1
  5. package/dist/chunks/{acp-agent-T26S7TU2.js → acp-agent-PAGX2B47.js} +1 -1
  6. package/dist/chunks/actions-command-2VE6YI4W.js +2 -0
  7. package/dist/chunks/{app-layer-5XUMNHDO.js → app-layer-YNEUEOEP.js} +1 -1
  8. package/dist/chunks/{app-server-connected-apps-IB6M35NS.js → app-server-connected-apps-TZOAUOYR.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-GBX65JJ7.js +2 -0
  12. package/dist/chunks/apps-RSFEJOQN.js +2 -0
  13. package/dist/chunks/chunk-2PXKSAG6.js +2 -0
  14. package/dist/chunks/{chunk-GRLQHYAU.js → chunk-2TGHZXJE.js} +2 -2
  15. package/dist/chunks/{chunk-YU4JYWCA.js → chunk-3A2Y7UK3.js} +1 -1
  16. package/dist/chunks/chunk-3Z4VM2LF.js +4 -0
  17. package/dist/chunks/chunk-4BUM6JEC.js +33 -0
  18. package/dist/chunks/chunk-4G3GTEVS.js +23 -0
  19. package/dist/chunks/{chunk-FUFI4THX.js → chunk-4KNPCJR4.js} +1 -1
  20. package/dist/chunks/chunk-4KTGYHCE.js +2 -0
  21. package/dist/chunks/chunk-4PUOWSDE.js +13 -0
  22. package/dist/chunks/chunk-55YD4UTW.js +2 -0
  23. package/dist/chunks/chunk-5G7BQAUA.js +2 -0
  24. package/dist/chunks/chunk-65FJWWXG.js +2 -0
  25. package/dist/chunks/{chunk-2GJD23CM.js → chunk-65WRWLUD.js} +1 -1
  26. package/dist/chunks/chunk-6D3FI2XT.js +2 -0
  27. package/dist/chunks/chunk-73TW6BKK.js +6 -0
  28. package/dist/chunks/{chunk-6S2MWJVD.js → chunk-7NCM6GBN.js} +1 -1
  29. package/dist/chunks/chunk-7OFD6TFD.js +2 -0
  30. package/dist/chunks/chunk-7OKZCJHS.js +3 -0
  31. package/dist/chunks/{chunk-NTM3KQ25.js → chunk-7PKDJHT6.js} +1 -1
  32. package/dist/chunks/chunk-7RJOCGQ6.js +2 -0
  33. package/dist/chunks/{chunk-SAZTOGX6.js → chunk-7RSQOC5M.js} +3 -3
  34. package/dist/chunks/{chunk-6TRVEA3T.js → chunk-AFH462DO.js} +1 -1
  35. package/dist/chunks/{chunk-GUG2SWRZ.js → chunk-AFKFN25T.js} +1 -1
  36. package/dist/chunks/chunk-AFYYIJ6K.js +2 -0
  37. package/dist/chunks/chunk-APKXXAUF.js +2 -0
  38. package/dist/chunks/chunk-AQUZCWM3.js +2 -0
  39. package/dist/chunks/chunk-AUO5DCEU.js +2 -0
  40. package/dist/chunks/chunk-AYOMVI7J.js +2 -0
  41. package/dist/chunks/{chunk-EVQISX7M.js → chunk-B66QCXH2.js} +1 -1
  42. package/dist/chunks/{chunk-S6UCVXBC.js → chunk-BHKXPWFB.js} +1 -1
  43. package/dist/chunks/chunk-BU6MW65V.js +10 -0
  44. package/dist/chunks/{chunk-C5B3FMV3.js → chunk-CCZ276IA.js} +1 -1
  45. package/dist/chunks/{chunk-LYVHYT3L.js → chunk-CIZI6Z7D.js} +1 -1
  46. package/dist/chunks/{chunk-4D3CICBG.js → chunk-CO23RRN7.js} +1 -1
  47. package/dist/chunks/{chunk-QAFXQHHG.js → chunk-D6L6UNUQ.js} +2 -2
  48. package/dist/chunks/chunk-DDOIPTOM.js +2 -0
  49. package/dist/chunks/{chunk-ZU3YBRXS.js → chunk-DKOVZ6R2.js} +3 -3
  50. package/dist/chunks/chunk-DRLP7GIU.js +2 -0
  51. package/dist/chunks/{chunk-DAEUVT2I.js → chunk-DRTHKWHK.js} +1 -1
  52. package/dist/chunks/{chunk-W22KWKF6.js → chunk-DWF3FCY4.js} +1 -1
  53. package/dist/chunks/{chunk-NABPZ7AK.js → chunk-DWM5G7BU.js} +1 -1
  54. package/dist/chunks/chunk-DXJC3QW7.js +2 -0
  55. package/dist/chunks/{chunk-V3S2B6WU.js → chunk-E2JB5OCO.js} +1 -1
  56. package/dist/chunks/{chunk-GI7LTJV3.js → chunk-EDYCSW22.js} +1 -1
  57. package/dist/chunks/{chunk-4JYTFEND.js → chunk-EFP75UEX.js} +1 -1
  58. package/dist/chunks/{chunk-WKHGXLJD.js → chunk-EGP6DF34.js} +2 -2
  59. package/dist/chunks/{chunk-M5QPL5NO.js → chunk-ESYPMD7Q.js} +1 -1
  60. package/dist/chunks/{chunk-PWKJ5KLZ.js → chunk-EXYSD45J.js} +1 -1
  61. package/dist/chunks/{chunk-XHBMK6LC.js → chunk-EYTTZ5H4.js} +1 -1
  62. package/dist/chunks/chunk-FKUWCJ73.js +161 -0
  63. package/dist/chunks/{chunk-U2BD545L.js → chunk-FNGZ4UDZ.js} +1 -1
  64. package/dist/chunks/{chunk-JFZ6USNQ.js → chunk-G7X73SBG.js} +1 -1
  65. package/dist/chunks/{chunk-36FNNR5N.js → chunk-GEYZVOGD.js} +1 -1
  66. package/dist/chunks/{chunk-ULJZ7NUF.js → chunk-GY7YSD6J.js} +1 -1
  67. package/dist/chunks/{chunk-JLW5BQVO.js → chunk-GYYJ47GX.js} +1 -1
  68. package/dist/chunks/chunk-HG2YFMVU.js +4 -0
  69. package/dist/chunks/{chunk-BTJACFU3.js → chunk-HKVFU3B3.js} +1 -1
  70. package/dist/chunks/chunk-IHAEZ73V.js +2 -0
  71. package/dist/chunks/{chunk-LI3FTPAH.js → chunk-IIT66347.js} +4 -4
  72. package/dist/chunks/{chunk-Q4AXZY2P.js → chunk-IO5DZUKL.js} +1 -1
  73. package/dist/chunks/chunk-J256AEEE.js +2 -0
  74. package/dist/chunks/{chunk-CRDKBFRN.js → chunk-JEMECEQH.js} +1 -1
  75. package/dist/chunks/{chunk-7P5SH3CI.js → chunk-JPUSTFZC.js} +1 -1
  76. package/dist/chunks/{chunk-5AU5Y6KS.js → chunk-JQOVC35K.js} +1 -1
  77. package/dist/chunks/{chunk-VS3AMJEK.js → chunk-JT5YQ52I.js} +1 -1
  78. package/dist/chunks/chunk-JVMSN7LH.js +2 -0
  79. package/dist/chunks/{chunk-HORMGT2Q.js → chunk-JXYJQT5Q.js} +1 -1
  80. package/dist/chunks/{chunk-OTUS7NTQ.js → chunk-K7KBFM2T.js} +1 -1
  81. package/dist/chunks/{chunk-FS2VKOT7.js → chunk-KCLMA2IH.js} +1 -1
  82. package/dist/chunks/chunk-KDER7R45.js +2 -0
  83. package/dist/chunks/{chunk-WBO6FQHR.js → chunk-KOC3YJEU.js} +2 -2
  84. package/dist/chunks/{chunk-6ZTP6CUJ.js → chunk-KP2MYTP5.js} +1 -1
  85. package/dist/chunks/{chunk-YRDPVTEI.js → chunk-KU4TPDPH.js} +2 -2
  86. package/dist/chunks/{chunk-WJSJXK2N.js → chunk-KUE46HTH.js} +1 -1
  87. package/dist/chunks/chunk-LVXL7T5O.js +2 -0
  88. package/dist/chunks/{chunk-5KWKSR4P.js → chunk-M4A7G4S5.js} +2 -2
  89. package/dist/chunks/{chunk-KAWXVMHI.js → chunk-M4ZHFDRJ.js} +1 -1
  90. package/dist/chunks/{chunk-HX6GXMDK.js → chunk-MEJLWNRS.js} +1 -1
  91. package/dist/chunks/{chunk-B666Z2NS.js → chunk-MIFVX5PK.js} +1 -1
  92. package/dist/chunks/{chunk-66HFW4OU.js → chunk-MOXIGLN2.js} +1 -1
  93. package/dist/chunks/{chunk-7XOUM6RK.js → chunk-N5EAVX4G.js} +1 -1
  94. package/dist/chunks/{chunk-Z2TOBS3P.js → chunk-NMMHXYDJ.js} +1 -1
  95. package/dist/chunks/{chunk-EBOTNBUS.js → chunk-NRYC4NH6.js} +1 -1
  96. package/dist/chunks/chunk-NSSZ2ZIU.js +2 -0
  97. package/dist/chunks/{chunk-4TTXNVCE.js → chunk-OFJPOTES.js} +1 -1
  98. package/dist/chunks/chunk-OIH2LPIT.js +2 -0
  99. package/dist/chunks/chunk-OUJ63LMU.js +2 -0
  100. package/dist/chunks/{chunk-DXA2UHBE.js → chunk-P4QM63L3.js} +1 -1
  101. package/dist/chunks/chunk-PACLKDTN.js +2 -0
  102. package/dist/chunks/{chunk-AF3AVDPP.js → chunk-PAYFJHPO.js} +1 -1
  103. package/dist/chunks/{chunk-OPTJYDZN.js → chunk-PHZZBXDO.js} +1 -1
  104. package/dist/chunks/{chunk-HPTEJBP4.js → chunk-PKJHN666.js} +1 -1
  105. package/dist/chunks/{chunk-HNDAGZCF.js → chunk-PLROXHG2.js} +1 -1
  106. package/dist/chunks/{chunk-W7NXFRHN.js → chunk-PNPV2LDE.js} +1 -1
  107. package/dist/chunks/{chunk-DSJZS77R.js → chunk-PSY6IRJE.js} +8 -8
  108. package/dist/chunks/{chunk-UK5LGSGT.js → chunk-Q73RKX7I.js} +1 -1
  109. package/dist/chunks/{chunk-PLVWARB7.js → chunk-Q7FBVLLB.js} +1 -1
  110. package/dist/chunks/{chunk-QAEZNFAM.js → chunk-Q7P34B2O.js} +1 -1
  111. package/dist/chunks/{chunk-QYQZQVVN.js → chunk-QLGP2OAQ.js} +1 -1
  112. package/dist/chunks/{chunk-GIU3Z45P.js → chunk-QUNQM2E3.js} +1 -1
  113. package/dist/chunks/chunk-R2FYCJL6.js +2 -0
  114. package/dist/chunks/{chunk-KOKBDIGR.js → chunk-R4EEGWXB.js} +1 -1
  115. package/dist/chunks/chunk-RBTDSI4L.js +11 -0
  116. package/dist/chunks/chunk-RCQYEHHD.js +2 -0
  117. package/dist/chunks/{chunk-TGULVWPV.js → chunk-RFQD6B44.js} +1 -1
  118. package/dist/chunks/{chunk-3WJQ4IGK.js → chunk-RPM4FDRX.js} +1 -1
  119. package/dist/chunks/{chunk-MCBRB5D6.js → chunk-RY46UPBO.js} +4 -4
  120. package/dist/chunks/{chunk-67HXM6AL.js → chunk-SDHG6CKU.js} +1 -1
  121. package/dist/chunks/{chunk-DIDQHTAX.js → chunk-SO4GMSNP.js} +1 -1
  122. package/dist/chunks/{chunk-O6ZYDHEJ.js → chunk-SSHE6B7Z.js} +1 -1
  123. package/dist/chunks/{chunk-SH7POUVX.js → chunk-SV7ZBEK2.js} +6 -6
  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-LARJARMS.js → chunk-UANH7U3Y.js} +1 -1
  127. package/dist/chunks/{chunk-CYQLXS2U.js → chunk-UGFSAG4U.js} +1 -1
  128. package/dist/chunks/chunk-ULTV6INR.js +2 -0
  129. package/dist/chunks/{chunk-FHLSLOKH.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-5Z3AU5CL.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-GFAI2MCJ.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-UXPO3ZV7.js → chunk-XQAUHXL4.js} +4 -4
  143. package/dist/chunks/{chunk-OXRVILDW.js → chunk-XT4CSKHM.js} +1 -1
  144. package/dist/chunks/{chunk-QJJNHKLT.js → chunk-XY7HFXLH.js} +1 -1
  145. package/dist/chunks/{chunk-ZUT4EM64.js → chunk-XYZV3FKD.js} +1 -1
  146. package/dist/chunks/{chunk-7FBWUVX7.js → chunk-Y2WNZWT2.js} +1 -1
  147. package/dist/chunks/chunk-Y4I6CFZJ.js +2 -0
  148. package/dist/chunks/chunk-YDZBX4XQ.js +2 -0
  149. package/dist/chunks/chunk-YI6ME6PU.js +22 -0
  150. package/dist/chunks/{chunk-H42UW6IF.js → chunk-YXMYK5P7.js} +1 -1
  151. package/dist/chunks/{chunk-D7R2AAX2.js → chunk-Z33RVGP6.js} +1 -1
  152. package/dist/chunks/{chunk-B32CW3NT.js → chunk-ZDEIVUUI.js} +1 -1
  153. package/dist/chunks/{chunk-IEVJLG3V.js → chunk-ZIQJDTQB.js} +1 -1
  154. package/dist/chunks/{chunk-GDJ4X2ZN.js → chunk-ZYLLPRPU.js} +1 -1
  155. package/dist/chunks/cli-R7TAP6Z2.js +2 -0
  156. package/dist/chunks/command-LNOVZQSK.js +58 -0
  157. package/dist/chunks/{configuration-command-4WTS2MZS.js → configuration-command-CNITTZRP.js} +1 -1
  158. package/dist/chunks/connected-app-executor-FGWCLOJO.js +2 -0
  159. package/dist/chunks/connected-evidence-5VZBYNWN.js +2 -0
  160. package/dist/chunks/{connected-starting-assets-4LDXQVLN.js → connected-starting-assets-KWOFEIE4.js} +1 -1
  161. package/dist/chunks/{connection-GDWPMHPC.js → connection-VMBXW5PD.js} +1 -1
  162. package/dist/chunks/{continual-HQCFY7GN.js → continual-FVOLGGOE.js} +1 -1
  163. package/dist/chunks/core-commands-BPYXVT7O.js +2 -0
  164. package/dist/chunks/dataset-preparation-authoring-UUYFWWCT.js +4 -0
  165. package/dist/chunks/datasets-E5TXSVIY.js +2 -0
  166. package/dist/chunks/desktop-test-FX7DTY4N.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-KUTZEEPB.js +2 -0
  170. package/dist/chunks/experiment-improvements-PQNR5YHN.js +2 -0
  171. package/dist/chunks/experiments-Z4BJWT3Y.js +2 -0
  172. package/dist/chunks/experiments-signal-3GCLKUWZ.js +2 -0
  173. package/dist/chunks/{extension-UH34ZF7N.js → extension-3EKIT6BB.js} +1 -1
  174. package/dist/chunks/{help-JQA3YMCX.js → help-K6YLZ3KL.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-LA3BZ4SE.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-NXVF4AQA.js +2 -0
  186. package/dist/chunks/human-review-2ZOB7CJZ.js +2 -0
  187. package/dist/chunks/{import-CLWTKDG6.js → import-YHYKZ6JN.js} +2 -2
  188. package/dist/chunks/javascript-isolate-process-source-YAT3GPW4.js +2 -0
  189. package/dist/chunks/javascript-verifier-worker-source-LGRP74W4.js +2 -0
  190. package/dist/chunks/{learning-XTY5VOTK.js → learning-LAXMGWSQ.js} +1 -1
  191. package/dist/chunks/learning-Y3UKNUGE.js +2 -0
  192. package/dist/chunks/local-harness-improvement-runtime-3YJQRYXC.js +2 -0
  193. package/dist/chunks/local-harness-taskset-review-XQHQ6JCR.js +2 -0
  194. package/dist/chunks/{model-projects-GHWCKDON.js → model-projects-6YWVD2TS.js} +1 -1
  195. package/dist/chunks/opchat-XXI2ZM53.js +3 -0
  196. package/dist/chunks/opchat-bounded-chat-3MZGCRLY.js +2 -0
  197. package/dist/chunks/organizations-W7HI2JA4.js +2 -0
  198. package/dist/chunks/{profile-RIDNU2I5.js → profile-P2SJPBOJ.js} +1 -1
  199. package/dist/chunks/project-action-payload-LTIQBX77.js +2 -0
  200. package/dist/chunks/project-agent-XRIXMXQK.js +2 -0
  201. package/dist/chunks/published-experiment-source-SDXUVPE7.js +2 -0
  202. package/dist/chunks/refiner-profile-service-56VYLZQJ.js +2 -0
  203. package/dist/chunks/{runtime-VSOOPNYN.js → runtime-Q7JUJO4D.js} +2 -2
  204. package/dist/chunks/sandbox-command-HVA5FJU4.js +2 -0
  205. package/dist/chunks/{sandbox-template-NN3XQI7M.js → sandbox-template-U536EEWY.js} +1 -1
  206. package/dist/chunks/saved-work-KSIQPXC2.js +2 -0
  207. package/dist/chunks/{send-turn-D3GTSSHI.js → send-turn-YLY3YNEQ.js} +1 -1
  208. package/dist/chunks/setup-RMZ2BHLM.js +2 -0
  209. package/dist/chunks/{src-662QOKNP.js → src-C3ZUESMK.js} +1 -1
  210. package/dist/chunks/src-SGQYVBNQ.js +424 -0
  211. package/dist/chunks/standalone-experiment-turn-owner-TW5MTWIO.js +2 -0
  212. package/dist/chunks/store-chat-resources-IRHBW2EC.js +2 -0
  213. package/dist/chunks/{store-continual-support-reviews-7PDLGRWF.js → store-continual-support-reviews-3KK42L4I.js} +1 -1
  214. package/dist/chunks/store-conversation-serving-IVURK52V.js +2 -0
  215. package/dist/chunks/{store-create-improve-G46KIUVT.js → store-create-improve-UTCLBXF2.js} +1 -1
  216. package/dist/chunks/{store-datasets-O67F75BL.js → store-datasets-4AQOVAQY.js} +1 -1
  217. package/dist/chunks/store-evaluation-results-PK2P3IMH.js +7 -0
  218. package/dist/chunks/{store-harness-workspaces-PJJQ74G6.js → store-harness-workspaces-YEXB4IRV.js} +1 -1
  219. package/dist/chunks/store-human-review-O4BVHP25.js +7 -0
  220. package/dist/chunks/store-learned-preference-migration-validation-44SVX6YB.js +2 -0
  221. package/dist/chunks/{store-learning-6P6IS7GH.js → store-learning-SIUQIY5C.js} +1 -1
  222. package/dist/chunks/{store-learning-credentials-EGJ2WTZI.js → store-learning-credentials-BUHR7SN6.js} +1 -1
  223. package/dist/chunks/store-local-experiments-BHVTKPPE.js +97 -0
  224. package/dist/chunks/store-model-batch-review-RVAYUVK2.js +2 -0
  225. package/dist/chunks/{store-model-configuration-T6XJJDAB.js → store-model-configuration-6L3OYXF4.js} +1 -1
  226. package/dist/chunks/store-model-project-preparation-AAEKCF6V.js +2 -0
  227. package/dist/chunks/store-modification-recordings-LCPK6K2T.js +9 -0
  228. package/dist/chunks/{store-preference-comparison-XQFTLMGH.js → store-preference-comparison-5YVIQNVB.js} +1 -1
  229. package/dist/chunks/{store-sidebar-file-bookmarks-J3JEVAYR.js → store-sidebar-file-bookmarks-WLMYDA4E.js} +1 -1
  230. package/dist/chunks/{store-sidebar-preferences-2JHTFXJK.js → store-sidebar-preferences-AFMYIDWT.js} +1 -1
  231. package/dist/chunks/{store-subagents-PUBQVWSU.js → store-subagents-KFPVSTRO.js} +1 -1
  232. package/dist/chunks/{store-task-inbox-VVXZUJIO.js → store-task-inbox-L6IQTY26.js} +1 -1
  233. package/dist/chunks/{store-task-inventory-MQX44AI6.js → store-task-inventory-QWS2C656.js} +1 -1
  234. package/dist/chunks/store-taskset-drafts-FRFL6ITK.js +9 -0
  235. package/dist/chunks/{store-training-DUVIDYK5.js → store-training-FYXZU2FE.js} +1 -1
  236. package/dist/chunks/{store-training-jobs-HHFH3V5O.js → store-training-jobs-3N3VKPIY.js} +1 -1
  237. package/dist/chunks/{store-training-models-C7UUZDTO.js → store-training-models-VOFVGPZR.js} +1 -1
  238. package/dist/chunks/{taskset-7FQCJ55X.js → taskset-UDDLFYKV.js} +1 -1
  239. package/dist/chunks/taskset-catalog-RZYEBCRQ.js +2 -0
  240. package/dist/chunks/taskset-packages-T6B6HYKZ.js +2 -0
  241. package/dist/chunks/taskset-packages-WMG5DUBN.js +2 -0
  242. package/dist/chunks/{teams-bot-FXMCOCPP.js → teams-bot-MPWL2PP4.js} +1 -1
  243. package/dist/chunks/tool-learning-ZQ6NSJ5K.js +2 -0
  244. package/dist/chunks/training-5NT2YB2L.js +2 -0
  245. package/dist/chunks/training-5UMT45UL.js +2 -0
  246. package/dist/chunks/training-UY6KRG4M.js +2 -0
  247. package/dist/chunks/{training-error-LQKCOQDJ.js → training-error-WF463UNZ.js} +1 -1
  248. package/dist/chunks/{training-hardware-ESXRWUIK.js → training-hardware-UWQCRDMV.js} +1 -1
  249. package/dist/chunks/training-hosted-CKSDRVL6.js +2 -0
  250. package/dist/chunks/training-hosted-alphaedit-HSMRDJTD.js +2 -0
  251. package/dist/chunks/training-hosted-checkpoint-evaluation-2X7RSOLC.js +2 -0
  252. package/dist/chunks/training-hosted-decision-7JALOU6O.js +2 -0
  253. package/dist/chunks/training-hosted-engram-SXO75MFG.js +2 -0
  254. package/dist/chunks/{training-hosted-learning-YN5VD3PW.js → training-hosted-learning-E2N32YU5.js} +1 -1
  255. package/dist/chunks/training-hosted-modification-comparison-TXFDJFTG.js +2 -0
  256. package/dist/chunks/training-hosted-neuron-training-J42WK4EH.js +2 -0
  257. package/dist/chunks/training-hosted-report-T633TNJG.js +2 -0
  258. package/dist/chunks/training-hosted-serving-report-BAEABGJH.js +2 -0
  259. package/dist/chunks/training-hosted-steering-T556BUBG.js +2 -0
  260. package/dist/chunks/training-hosted-workers-Y2PO5IOA.js +2 -0
  261. package/dist/chunks/training-model-start-P3PXDWNT.js +2 -0
  262. package/dist/chunks/web-search-ZEKJHZW4.js +2 -0
  263. package/dist/chunks/{workspaces-MCS2AQX6.js → workspaces-EK62ANTB.js} +1 -1
  264. package/dist/cli.js +1 -1
  265. package/dist/index.js +1 -1
  266. package/dist/sandbox/types/billing.d.ts +87 -6
  267. package/dist/sandbox/types/io.d.ts +3 -0
  268. package/dist/sandbox-template/manifest.js +1 -1
  269. package/dist/skills/manifest.json +3 -3
  270. package/dist/skills/openpond-cli/references/experiments-and-training.md +461 -1
  271. package/dist/web/assets/App-CCuh99JW.js +54 -0
  272. package/dist/web/assets/{AppDialog-DuSd0wk6.js → AppDialog-CxjDHVk9.js} +1 -1
  273. package/dist/web/assets/AppTerminalPanel-CKJIVpKa.js +2 -0
  274. package/dist/web/assets/{AppToastContext-Dklk6CaG.js → AppToastContext-EpiT1dHs.js} +1 -1
  275. package/dist/web/assets/AppsView-BsMyPX_3.js +1 -0
  276. package/dist/web/assets/{AppsView-DNHWzJb2.css → AppsView-D3vVesNd.css} +1 -1
  277. package/dist/web/assets/{AttachmentTypeIcon-DipNT6Tj.js → AttachmentTypeIcon-BXvZy5gB.js} +1 -1
  278. package/dist/web/assets/BrowserSidebar-BIIV4aq4.js +1 -0
  279. package/dist/web/assets/{CartesianChart-UU1sdoUO.js → CartesianChart-brqLBqnF.js} +1 -1
  280. package/dist/web/assets/ChatTimelineEntry-CwZbn16X.js +8 -0
  281. package/dist/web/assets/{CollaborationTabs-BWYRQ1PE.js → CollaborationTabs-BU4uc4tZ.js} +1 -1
  282. package/dist/web/assets/{CommandMenu-B08F9x5g.js → CommandMenu-DkWpXR55.js} +1 -1
  283. package/dist/web/assets/CommunityView-CsSxJZGn.js +1 -0
  284. package/dist/web/assets/{ComposerAttachments-srWBKvCv.js → ComposerAttachments-BdJGCYzI.js} +1 -1
  285. package/dist/web/assets/{ComposerCreateImproveStrip-DqTpU5cO.js → ComposerCreateImproveStrip-CWy0j1vv.js} +1 -1
  286. package/dist/web/assets/{ConversationImportsSettings-2KC-KQvu.js → ConversationImportsSettings-DCmiakbZ.js} +1 -1
  287. package/dist/web/assets/DatasetReviewImport-DEnF_pGu.js +1 -0
  288. package/dist/web/assets/ExperimentTrainingDataWorkspace-WhwQ0QBi.js +2 -0
  289. package/dist/web/assets/{FilePagePreview-B-iUVPhh.js → FilePagePreview-BRhhz99q.js} +2 -2
  290. package/dist/web/assets/{GetStartedView-5v0vBWXy.js → GetStartedView-CLVD-qEi.js} +1 -1
  291. package/dist/web/assets/{GettingStartedDialog-Bn4072K-.js → GettingStartedDialog-CMxaAMg-.js} +1 -1
  292. package/dist/web/assets/HostedModelLearningReview-Cn-j-rDo.js +1 -0
  293. package/dist/web/assets/HostedModelLearningSettings-VNBvf38S.js +1 -0
  294. package/dist/web/assets/{HtmlVisual-C2WsMj90.js → HtmlVisual-D5y2WG9L.js} +10 -10
  295. package/dist/web/assets/LabModelVersionDetailPage-BxRmYD6h.js +1 -0
  296. package/dist/web/assets/{TrainingRunLineage-PXzWR65d.css → LabModelWorkspace-DOrgCk9Z.css} +1 -1
  297. package/dist/web/assets/LabModelWorkspace-u2Ulm_z4.js +1 -0
  298. package/dist/web/assets/{LabSkillSidebar-C50P74LI.js → LabSkillSidebar-C7IceJTJ.js} +1 -1
  299. package/dist/web/assets/LabsRoute-C9Y0GU34.css +1 -0
  300. package/dist/web/assets/LabsRoute-CbztQaEf.js +74 -0
  301. package/dist/web/assets/LearningBatchesPage-B1NZTBSv.css +1 -0
  302. package/dist/web/assets/LearningBatchesPage-CJqgZNvM.js +26 -0
  303. package/dist/web/assets/MainChatThread-DNMfrrRq.js +2 -0
  304. package/dist/web/assets/{MainPane-Dje-hfUM.css → MainPane-BZlNLfTM.css} +1 -1
  305. package/dist/web/assets/MainPane-CQQxSDPS.js +13 -0
  306. package/dist/web/assets/ModelProjectPageHeader-Dge19aE1.js +1 -0
  307. package/dist/web/assets/NativeSetupTerminal-D4JnbpyD.js +2 -0
  308. package/dist/web/assets/{NativeSkillSidebar-Clv0IWyn.js → NativeSkillSidebar-Jzx1BeKV.js} +1 -1
  309. package/dist/web/assets/{NewProjectDialog-Cw_F5Eaa.js → NewProjectDialog-DcnGzEd9.js} +1 -1
  310. package/dist/web/assets/{OutputsPage-Btyiie4B.js → OutputsPage-Cmk15Vt_.js} +1 -1
  311. package/dist/web/assets/{PageChrome-BLLw_cEA.js → PageChrome-Cz_fCqtn.js} +1 -1
  312. package/dist/web/assets/{ProjectsPage-BpSHWQgj.js → ProjectsPage-BZ3Eo3Mz.js} +1 -1
  313. package/dist/web/assets/RightChatPanelStack-C6H2vU9N.js +1 -0
  314. package/dist/web/assets/RightSidebarHomePanel-BfMMVkM1.js +1 -0
  315. package/dist/web/assets/{ScheduledWorkPage-WytWGQgw.js → ScheduledWorkPage-CAkSwM0T.js} +1 -1
  316. package/dist/web/assets/{SettingsView-BJq5zNkv.js → SettingsView-DvQXGw3_.js} +3 -3
  317. package/dist/web/assets/{TasksetDraftEditorPrimitives-BxFEWI9W.js → TasksetDraftEditorPrimitives-JuU1k8vr.js} +1 -1
  318. package/dist/web/assets/TeamChatView-DmHjr8W9.js +1 -0
  319. package/dist/web/assets/{TerminalOverlay-C7OM2F0-.js → TerminalOverlay-DlaM9d8F.js} +1 -1
  320. package/dist/web/assets/{TrainingCreationPanel-KH5GFacT.js → TrainingCreationPanel-ClpylNsr.js} +1 -1
  321. package/dist/web/assets/{TrainingDraftPanel-DzOw13Md.js → TrainingDraftPanel-6tH2xSDj.js} +1 -1
  322. package/dist/web/assets/{UsageSettingsSection-nZHno_4P.js → UsageSettingsSection-CzDqxOYM.js} +2 -2
  323. package/dist/web/assets/WorkSidebarPanel-CY-AHZ4-.js +1 -0
  324. package/dist/web/assets/WorkspaceDiffPanel-B4e0lyF7.js +11 -0
  325. package/dist/web/assets/WorkspaceEnvironmentMenu-D01ZkZZF.js +35 -0
  326. package/dist/web/assets/{WorkspaceFileLocation-1U8DDj1J.js → WorkspaceFileLocation-C5s_njZb.js} +1 -1
  327. package/dist/web/assets/{WorkspaceGitDialogs-BO1EUA3G.js → WorkspaceGitDialogs-DjPZ6KIh.js} +1 -1
  328. package/dist/web/assets/{WorkspaceMonacoEditor-Rqq_sKW_.js → WorkspaceMonacoEditor-CC4sfOiU.js} +3 -3
  329. package/dist/web/assets/{WorkspacePdfPreview-zmmMp09R.js → WorkspacePdfPreview-vszQqFa4.js} +2 -2
  330. package/dist/web/assets/{WorkspacePresentationPreview-DNbhGjkE.js → WorkspacePresentationPreview-DQTvhaRD.js} +1 -1
  331. package/dist/web/assets/api-client-DJRVOFzS.js +1 -0
  332. package/dist/web/assets/{app-models-Cz3yxq4x.js → app-models-BUdzQbXo.js} +1 -1
  333. package/dist/web/assets/bot-Doyx3T4j.js +1 -0
  334. package/dist/web/assets/{browser-sidebar-links-ZyYiYBBd.js → browser-sidebar-links-PVPCrsDJ.js} +1 -1
  335. package/dist/web/assets/chat-resources-Beh5lB36.js +1 -0
  336. package/dist/web/assets/chevron-down-DX1hzujj.js +1 -0
  337. package/dist/web/assets/chevron-right-DHN0y3KC.js +1 -0
  338. package/dist/web/assets/chevron-up-_QrW88NF.js +1 -0
  339. package/dist/web/assets/chunk-3BYFS4RO-ztZjcMmt.js +1 -0
  340. package/dist/web/assets/chunk-AG6UJ3DI-D9KZjTYP.js +1 -0
  341. package/dist/web/assets/chunk-C3TS766N-ppRhs95p.js +1 -0
  342. package/dist/web/assets/chunk-GCUWJUUM-Dy6oUNJ6.js +9 -0
  343. package/dist/web/assets/chunk-GS5HEE4M-C0RLeIsy.js +1 -0
  344. package/dist/web/assets/chunk-H3JZ3P5T-DolwEJXo.js +2 -0
  345. package/dist/web/assets/chunk-Q4RGCEOI-Cr-dg4Nk.js +1 -0
  346. package/dist/web/assets/client-DwZ92xtu.js +1 -0
  347. package/dist/web/assets/{client-choice-storage-CXlWJW5g.js → client-choice-storage-DitqKiIT.js} +1 -1
  348. package/dist/web/assets/cloud-upload-HdzNTgr2.js +1 -0
  349. package/dist/web/assets/common-BWVSBnpX.js +1 -0
  350. package/dist/web/assets/copy-DTQhoBNg.js +1 -0
  351. package/dist/web/assets/create-pipeline-DsZzNkt9.js +1 -0
  352. package/dist/web/assets/{cssMode-Cps-05f3.js → cssMode-BRTtfXxU.js} +1 -1
  353. package/dist/web/assets/dataset-workspaces-BTPi71mz.js +1 -0
  354. package/dist/web/assets/external-link-H1629UU6.js +1 -0
  355. package/dist/web/assets/folder-open-CAGdWOrr.js +1 -0
  356. package/dist/web/assets/folder-plus-C14cs2mE.js +1 -0
  357. package/dist/web/assets/git-commit-horizontal-DFUfuVvF.js +1 -0
  358. package/dist/web/assets/{htmlMode-Do72TyNy.js → htmlMode-BVaCcL76.js} +1 -1
  359. package/dist/web/assets/icons-Bk2b68aC.js +1 -0
  360. package/dist/web/assets/image-0DPVY6Ev.js +1 -0
  361. package/dist/web/assets/{index-D7igQSAg.js → index-B6XX_0h3.js} +2 -2
  362. package/dist/web/assets/info-C8b_tafZ.js +1 -0
  363. package/dist/web/assets/intake-contracts-B8JZKYwb.js +1 -0
  364. package/dist/web/assets/{jsonMode-B2N7W15Y.js → jsonMode-BCKKQmmV.js} +1 -1
  365. package/dist/web/assets/loader-circle-y-SSPwpk.js +1 -0
  366. package/dist/web/assets/{lspLanguageFeatures-DPmyOFVA.js → lspLanguageFeatures-DozmNUOx.js} +1 -1
  367. package/dist/web/assets/maximize-2-CByk9-zN.js +1 -0
  368. package/dist/web/assets/message-square-C889vRqm.js +1 -0
  369. package/dist/web/assets/{monaco.contribution-DqqJBDzF.js → monaco.contribution-B9q6qbbo.js} +2 -2
  370. package/dist/web/assets/{monaco.contribution-BfOxF9PJ.js → monaco.contribution-BITdsRbn.js} +2 -2
  371. package/dist/web/assets/{monaco.contribution-DNONXznc.js → monaco.contribution-BqA-XZ44.js} +2 -2
  372. package/dist/web/assets/{monaco.contribution-CRdTg0FH.js → monaco.contribution-DxAV1oS5.js} +2 -2
  373. package/dist/web/assets/monitor-BtxlcLuI.js +1 -0
  374. package/dist/web/assets/paperclip-BeIdaspf.js +1 -0
  375. package/dist/web/assets/{pdf-BCq2Oosd.js → pdf-perlzwEB.js} +1 -1
  376. package/dist/web/assets/play-CHXXdkuO.js +1 -0
  377. package/dist/web/assets/plus-DFFWjhPw.js +1 -0
  378. package/dist/web/assets/{ponder-desktop-Dm7tOkKo.js → ponder-desktop-Ca-9KggQ.js} +1 -1
  379. package/dist/web/assets/presentation-0bzvu6_u.js +1 -0
  380. package/dist/web/assets/{profile-ref-DSNkG6Ol.js → profile-ref-D8lxL7dW.js} +1 -1
  381. package/dist/web/assets/{python-DuGMr666.js → python-B9hOnkOI.js} +1 -1
  382. package/dist/web/assets/refresh-cw-D61-Ozk3.js +1 -0
  383. package/dist/web/assets/{requests-BCbaFiqV.js → requests-DmeUYik4.js} +1 -1
  384. package/dist/web/assets/reward-checks-DJJZYgf8.js +7 -0
  385. package/dist/web/assets/save-iEMNZoPe.js +1 -0
  386. package/dist/web/assets/schemas-Brv9Vmnk.js +64 -0
  387. package/dist/web/assets/settings-BC-bzgk6.js +21 -0
  388. package/dist/web/assets/settings-lists-C84qxFmP.js +5 -0
  389. package/dist/web/assets/square-BE_4JMR3.js +1 -0
  390. package/dist/web/assets/square-terminal-Djpzo2Qs.js +1 -0
  391. package/dist/web/assets/{submit-issue-command-wfngGS6Y.js → submit-issue-command-HfKzyxg5.js} +1 -1
  392. package/dist/web/assets/{toggleHighContrast-cl0cw2QK.js → toggleHighContrast-ClsXu39R.js} +1 -1
  393. package/dist/web/assets/training-DWfghwfZ.js +1 -0
  394. package/dist/web/assets/{training-model-data-CWnu1bz9.js → training-model-data-CIysl8wH.js} +4 -4
  395. package/dist/web/assets/{tsMode-DLEc0PYL.js → tsMode-nbmaMc-D.js} +1 -1
  396. package/dist/web/assets/upload-C6ug8RD-.js +1 -0
  397. package/dist/web/assets/{useAccountSettings-ByxjI9BG.js → useAccountSettings-Dr9h4Qz_.js} +1 -1
  398. package/dist/web/assets/{useAgentInventory-Df64T07n.js → useAgentInventory-ByCk2JAv.js} +1 -1
  399. package/dist/web/assets/useChatContextSelection-C0eMm2g6.js +1 -0
  400. package/dist/web/assets/{useLocalAgentSchedules-DNh_x9gQ.js → useLocalAgentSchedules-Do0y_leJ.js} +1 -1
  401. package/dist/web/assets/useQuery-D2MQ7e5U.js +1 -0
  402. package/dist/web/assets/wifi-off-Dr-CapyW.js +1 -0
  403. package/dist/web/assets/work-outputs-D_8TovAK.js +1 -0
  404. package/dist/web/assets/{workers-CnqrOtic.js → workers-DKvM2NdM.js} +1 -1
  405. package/dist/web/assets/x-Jx2jlP9u.js +1 -0
  406. package/dist/web/assets/{yaml-C9vtYV4w.js → yaml-C02vq4ar.js} +1 -1
  407. package/dist/web/index.html +1 -1
  408. package/docs/command-reference.md +100 -4
  409. package/package.json +1 -1
  410. package/dist/chunks/actions-command-VLKMHCMI.js +0 -2
  411. package/dist/chunks/app-server-evaluations-V6LRWDUF.js +0 -2
  412. package/dist/chunks/app-server-harness-services-6ZRLA3YD.js +0 -2
  413. package/dist/chunks/app-server-runtime-TH56EG2Z.js +0 -2
  414. package/dist/chunks/apps-MNT3KXIY.js +0 -2
  415. package/dist/chunks/chunk-2W22IXHB.js +0 -2
  416. package/dist/chunks/chunk-2ZNW6GUU.js +0 -2
  417. package/dist/chunks/chunk-3BJ7LPE3.js +0 -2
  418. package/dist/chunks/chunk-3MVKXAH7.js +0 -2
  419. package/dist/chunks/chunk-4MQHIFZL.js +0 -2
  420. package/dist/chunks/chunk-55Q64WWF.js +0 -2
  421. package/dist/chunks/chunk-5KJMFK65.js +0 -2
  422. package/dist/chunks/chunk-5WPMI6QX.js +0 -2
  423. package/dist/chunks/chunk-7PKTCMZ6.js +0 -2
  424. package/dist/chunks/chunk-ANG2YMMD.js +0 -2
  425. package/dist/chunks/chunk-BQVB2SPF.js +0 -10
  426. package/dist/chunks/chunk-DMO3UIS7.js +0 -6
  427. package/dist/chunks/chunk-FEQ7HNJR.js +0 -2
  428. package/dist/chunks/chunk-G4E3WGLM.js +0 -13
  429. package/dist/chunks/chunk-H5ML7735.js +0 -2
  430. package/dist/chunks/chunk-I3NYYOSS.js +0 -2
  431. package/dist/chunks/chunk-IOSBGCRT.js +0 -2
  432. package/dist/chunks/chunk-JBFPTEVE.js +0 -2
  433. package/dist/chunks/chunk-JKI53ED7.js +0 -161
  434. package/dist/chunks/chunk-JRGECNP3.js +0 -2
  435. package/dist/chunks/chunk-L4EJ5R3B.js +0 -23
  436. package/dist/chunks/chunk-LXZLLTYQ.js +0 -2
  437. package/dist/chunks/chunk-MHPCVQOE.js +0 -2
  438. package/dist/chunks/chunk-MVPKU72J.js +0 -4
  439. package/dist/chunks/chunk-OKEC2EIE.js +0 -2
  440. package/dist/chunks/chunk-OW3EOC5Q.js +0 -4
  441. package/dist/chunks/chunk-QCJY6FTC.js +0 -3
  442. package/dist/chunks/chunk-SBQ6KLXB.js +0 -33
  443. package/dist/chunks/chunk-TVDZXDQW.js +0 -2
  444. package/dist/chunks/chunk-V3KEG6MI.js +0 -2
  445. package/dist/chunks/chunk-VD2TQCMH.js +0 -2
  446. package/dist/chunks/chunk-WLZJOCLA.js +0 -10
  447. package/dist/chunks/chunk-Y3B6ZUE6.js +0 -22
  448. package/dist/chunks/chunk-YBKDEEEH.js +0 -2
  449. package/dist/chunks/chunk-ZWW227M3.js +0 -2
  450. package/dist/chunks/cli-TE7RP5H7.js +0 -2
  451. package/dist/chunks/command-NW6BGKOM.js +0 -13
  452. package/dist/chunks/connected-app-executor-7DYMZCD7.js +0 -2
  453. package/dist/chunks/connected-evidence-D7C45HYD.js +0 -2
  454. package/dist/chunks/core-commands-RXPXOYOP.js +0 -2
  455. package/dist/chunks/dataset-preparation-authoring-KWRTMKN6.js +0 -4
  456. package/dist/chunks/datasets-LBLEKLCS.js +0 -2
  457. package/dist/chunks/desktop-test-INJPZ5VP.js +0 -3
  458. package/dist/chunks/dist-J4KHAVO3.js +0 -2
  459. package/dist/chunks/evaluation-coordination-3ARLJAFH.js +0 -2
  460. package/dist/chunks/experiment-improvements-UB4C5CSP.js +0 -2
  461. package/dist/chunks/experiments-AHHKFJD6.js +0 -2
  462. package/dist/chunks/experiments-signal-MTR475QV.js +0 -2
  463. package/dist/chunks/host-profile-evaluation-tools-75EPCRSZ.js +0 -2
  464. package/dist/chunks/host-profile-external-dataset-YRKG2GL5.js +0 -2
  465. package/dist/chunks/hosted-app-server-composition-GPXH3BOG.js +0 -2
  466. package/dist/chunks/hosted-experiment-improvement-NZTPZTDH.js +0 -3
  467. package/dist/chunks/hosted-harness-runtime-3AJGEIFD.js +0 -2
  468. package/dist/chunks/hosted-profile-candidate-3CAT3XBI.js +0 -3
  469. package/dist/chunks/hosted-profile-compiler-RXU626Q6.js +0 -2
  470. package/dist/chunks/hosted-profile-evaluation-control-CBDRKJ5J.js +0 -2
  471. package/dist/chunks/hosted-profile-evaluation-inspection-CHYKDYUQ.js +0 -3
  472. package/dist/chunks/hosted-profile-evaluation-preparation-H5S7JZMD.js +0 -3
  473. package/dist/chunks/hosted-tasksets-AMGDDB2R.js +0 -2
  474. package/dist/chunks/human-review-DVHVJXBA.js +0 -2
  475. package/dist/chunks/javascript-isolate-process-source-ZPQKKLR4.js +0 -2
  476. package/dist/chunks/javascript-verifier-worker-source-F3LSGPOY.js +0 -2
  477. package/dist/chunks/learning-NJLTGZFQ.js +0 -2
  478. package/dist/chunks/local-harness-improvement-runtime-XEA73RGS.js +0 -2
  479. package/dist/chunks/local-harness-taskset-review-SW35G4DM.js +0 -2
  480. package/dist/chunks/opchat-LMKH3OWR.js +0 -3
  481. package/dist/chunks/opchat-bounded-chat-PPOWO7H4.js +0 -2
  482. package/dist/chunks/organizations-T6ZUSHNJ.js +0 -2
  483. package/dist/chunks/project-action-payload-2G57RL74.js +0 -2
  484. package/dist/chunks/project-agent-GBMVDJY3.js +0 -2
  485. package/dist/chunks/published-experiment-source-D3C2AWQD.js +0 -2
  486. package/dist/chunks/refiner-profile-service-PPGGNVOV.js +0 -2
  487. package/dist/chunks/sandbox-command-L5VQ2T6C.js +0 -2
  488. package/dist/chunks/saved-work-LAVTNKPT.js +0 -2
  489. package/dist/chunks/setup-TXEM2QSG.js +0 -2
  490. package/dist/chunks/src-HJHIBDFX.js +0 -424
  491. package/dist/chunks/standalone-experiment-turn-owner-KKYIGGPF.js +0 -2
  492. package/dist/chunks/store-chat-resources-ZWDYMDJF.js +0 -2
  493. package/dist/chunks/store-conversation-serving-WRT4N7N2.js +0 -2
  494. package/dist/chunks/store-evaluation-results-BEPR4LVD.js +0 -7
  495. package/dist/chunks/store-human-review-HJ3D7ZFA.js +0 -7
  496. package/dist/chunks/store-learned-preference-migration-validation-EXNRDHCO.js +0 -2
  497. package/dist/chunks/store-local-experiments-CBJA56X2.js +0 -97
  498. package/dist/chunks/store-model-batch-review-YIVD7T2T.js +0 -2
  499. package/dist/chunks/store-model-project-preparation-WWU5CJTV.js +0 -2
  500. package/dist/chunks/store-taskset-drafts-G3WFVN4M.js +0 -9
  501. package/dist/chunks/taskset-packages-NRRPON7B.js +0 -2
  502. package/dist/chunks/taskset-packages-RW4SFGDU.js +0 -2
  503. package/dist/chunks/tool-learning-O7QTTEDB.js +0 -2
  504. package/dist/chunks/training-XFM3OOPN.js +0 -2
  505. package/dist/chunks/training-XILDD5RG.js +0 -2
  506. package/dist/chunks/training-hosted-6BX2IASC.js +0 -2
  507. package/dist/chunks/training-hosted-checkpoint-evaluation-UXFW33QL.js +0 -2
  508. package/dist/chunks/training-hosted-report-UVGTPDOK.js +0 -2
  509. package/dist/chunks/training-hosted-serving-report-J4YOZLRP.js +0 -2
  510. package/dist/chunks/training-hosted-workers-6JTDCCWA.js +0 -2
  511. package/dist/chunks/training-model-start-E5MP3URL.js +0 -2
  512. package/dist/chunks/web-search-56QRZGPR.js +0 -2
  513. package/dist/web/assets/App-CNQi3RlI.js +0 -53
  514. package/dist/web/assets/AppTerminalPanel-DLz34eSs.js +0 -2
  515. package/dist/web/assets/AppsView-DkCMr67-.js +0 -1
  516. package/dist/web/assets/BrowserSidebar-BBaaanMS.js +0 -1
  517. package/dist/web/assets/ChatTimelineEntry-Ct59FKw1.js +0 -8
  518. package/dist/web/assets/CommunityView-BLTlSxyb.js +0 -1
  519. package/dist/web/assets/HostedModelLearningReview-DWF6WPao.js +0 -1
  520. package/dist/web/assets/HostedModelLearningSettings-BYl-2j7B.js +0 -1
  521. package/dist/web/assets/LabModelVersionDetailPage-CQz29DwD.js +0 -1
  522. package/dist/web/assets/LabsRoute-CE45yAXJ.css +0 -1
  523. package/dist/web/assets/LabsRoute-DJRgF1kQ.js +0 -101
  524. package/dist/web/assets/MainChatThread-gwmhe1Nw.js +0 -2
  525. package/dist/web/assets/MainPane-CqtgV9rU.js +0 -10
  526. package/dist/web/assets/NativeSetupTerminal-DrQldDsG.js +0 -2
  527. package/dist/web/assets/RightChatPanelStack-xW5rKbp0.js +0 -1
  528. package/dist/web/assets/RightSidebarHomePanel-BDmIxvIm.js +0 -1
  529. package/dist/web/assets/TeamChatView-BisSMAXy.js +0 -1
  530. package/dist/web/assets/TrainingRunLineage-B2WBOchk.js +0 -1
  531. package/dist/web/assets/WorkSidebarPanel-D3Ub_jVj.js +0 -1
  532. package/dist/web/assets/WorkspaceDiffPanel-CyTa8Cjs.js +0 -11
  533. package/dist/web/assets/WorkspaceEnvironmentMenu-CtZzxQ1e.js +0 -35
  534. package/dist/web/assets/api-client-Dgz-fOMl.js +0 -1
  535. package/dist/web/assets/bot-D-eTQib6.js +0 -1
  536. package/dist/web/assets/chat-resources-CTN4f6KC.js +0 -1
  537. package/dist/web/assets/chevron-down-75im8nFF.js +0 -1
  538. package/dist/web/assets/chevron-right-CpbCIUFo.js +0 -1
  539. package/dist/web/assets/chevron-up-BD8jg0bQ.js +0 -1
  540. package/dist/web/assets/chunk-GJRXJL6G-pJp1DyJd.js +0 -9
  541. package/dist/web/assets/chunk-H3JZ3P5T-B0SCoPw4.js +0 -2
  542. package/dist/web/assets/chunk-TLSP5JKG-DZmxtX-4.js +0 -1
  543. package/dist/web/assets/cloud-upload-4lP-5zmp.js +0 -1
  544. package/dist/web/assets/common-BMjyKlX-.js +0 -1
  545. package/dist/web/assets/contracts-BLiqJxBv.js +0 -1
  546. package/dist/web/assets/copy-DRnATDDY.js +0 -1
  547. package/dist/web/assets/create-pipeline-CyUZrbbO.js +0 -1
  548. package/dist/web/assets/createLucideIcon-CmkSm39S.js +0 -1
  549. package/dist/web/assets/external-link-D_nBEDFO.js +0 -1
  550. package/dist/web/assets/folder-open-tD5Lle1M.js +0 -1
  551. package/dist/web/assets/folder-plus-DlZ4hM48.js +0 -1
  552. package/dist/web/assets/git-commit-horizontal-g8KBhvfr.js +0 -1
  553. package/dist/web/assets/icons-B8_Rkg-l.js +0 -1
  554. package/dist/web/assets/image-CUZMnZYi.js +0 -1
  555. package/dist/web/assets/info-SmuBZiE5.js +0 -1
  556. package/dist/web/assets/intake-contracts-BW0Y0C2R.js +0 -1
  557. package/dist/web/assets/loader-circle-D_KVxLLz.js +0 -1
  558. package/dist/web/assets/maximize-2-B8HN3jsA.js +0 -1
  559. package/dist/web/assets/message-square-CrDvzn66.js +0 -1
  560. package/dist/web/assets/models-route-CWcJuOd0.js +0 -1
  561. package/dist/web/assets/monitor-CW-M_aaj.js +0 -1
  562. package/dist/web/assets/paperclip-DL449Io5.js +0 -1
  563. package/dist/web/assets/play-DYLqBrwg.js +0 -1
  564. package/dist/web/assets/plus-DXZIpQuY.js +0 -1
  565. package/dist/web/assets/presentation-CupIXaYv.js +0 -1
  566. package/dist/web/assets/refresh-cw-CzVf5_oo.js +0 -1
  567. package/dist/web/assets/reward-checks-Bcq9ETCA.js +0 -7
  568. package/dist/web/assets/save-DatjrYPV.js +0 -1
  569. package/dist/web/assets/schemas-lO3MoWQr.js +0 -64
  570. package/dist/web/assets/settings-D7C-Auyi.js +0 -21
  571. package/dist/web/assets/settings-lists-D2ol3uNK.js +0 -5
  572. package/dist/web/assets/square-BWB1nbZF.js +0 -1
  573. package/dist/web/assets/square-terminal-Buj-s-fz.js +0 -1
  574. package/dist/web/assets/training-DCdoHJ0Y.js +0 -2
  575. package/dist/web/assets/upload-DaFVH6R1.js +0 -1
  576. package/dist/web/assets/useQuery-yUz7Ui8g.js +0 -1
  577. package/dist/web/assets/wifi-off-CtNwnIJc.js +0 -1
  578. package/dist/web/assets/work-outputs-CK0nHe4g.js +0 -1
  579. package/dist/web/assets/x-Bhl-4Zlt.js +0 -1
  580. /package/dist/chunks/{chunk-SFR32TMJ.js → chunk-JXLDEYRW.js} +0 -0
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{E as m,c as I,f as H,v as d,w as r,x as j,y as s}from"./chunk-WGQ3FMRF.js";import{ga as p}from"./chunk-BU6MW65V.js";import{Bb as R,Eb as P,lb as L,va as S,wb as y}from"./chunk-ZY32SZ2P.js";import{n as b}from"./chunk-RCT3O3HQ.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as E}from"./chunk-FTQLQJQV.js";var u=e.object({source:e.enum(["local","github","openpond_git"]),repositoryId:e.string().trim().min(1),profileId:e.string().trim().min(1)}),N=e.object({ref:u,revision:e.string().nullable(),sourceHash:e.string()});var n=e.string().trim().min(1).max(200),o=e.string().regex(/^[a-f0-9]{64}$/),k=e.enum(["queued","running","cancelling","completed","failed","cancelled","interrupted"]),z=e.object({providerId:e.enum(["openpond","custom-openai-compatible","claude-code","codex"]),modelId:e.string().trim().min(1).max(500),configurationHash:o,maxOutputTokens:e.number().int().positive().max(262144),temperature:e.number().min(0).max(2).optional(),topP:e.number().positive().max(1).optional(),messages:e.array(e.object({role:e.enum(["system","user","assistant"]),content:e.string().max(262144)}).strict()).max(200)}).strict(),Y=e.object({configuration:s,package:p}).strict(),Z=e.object({configuration:s,expectedPackageHash:o.optional()}).strict(),ee=e.object({schemaVersion:e.literal("openpond.localExperimentDefinition.v1"),location:e.literal("local"),id:n,teamId:n,ownerActorId:n,revision:e.number().int().positive(),configuration:s,model:z,packageHash:o,graders:e.array(r).min(1).max(100),availableGraders:e.array(r).min(1).max(1e3),createdAt:e.iso.datetime(),updatedAt:e.iso.datetime(),contentHash:o}).strict(),te=e.object({operationId:n,definition:d}).strict(),ne=e.object({teamId:n,id:n}).strict(),oe=e.object({teamId:n,projectId:n.optional(),status:k.optional(),datasetHash:o.optional(),search:e.string().max(100).optional(),afterId:n.optional(),limit:e.number().int().min(1).max(100).default(30)}).strict(),f=e.object({schemaVersion:e.literal("openpond.localExperimentExecution.v1"),location:e.literal("local"),id:n,teamId:n,ownerActorId:n,operationId:n,definition:d,kind:e.enum(["target","scoring"]),executionHash:o,sourceExecution:e.object({id:n,executionHash:o}).strict().nullable(),packageHash:o,maximumCostUsd:e.number().finite().positive(),status:k,createdAt:e.iso.datetime(),completedAt:e.iso.datetime().nullable(),counts:e.object({pending:e.number().int().nonnegative(),running:e.number().int().nonnegative(),completed:e.number().int().nonnegative(),failed:e.number().int().nonnegative(),cancelled:e.number().int().nonnegative(),unknown:e.number().int().nonnegative()}).strict(),usage:e.object({knownCostUsd:e.number().finite().nonnegative(),costUsd:e.number().finite().nonnegative().nullable(),heldUsd:e.number().finite().nonnegative(),uncertainRequests:e.number().int().nonnegative()}).strict(),cleanupComplete:e.boolean(),error:e.string().max(2e3).nullable()}).strict(),v=f.omit({definition:!0});function g(t,i){t.kind==="scoring"!=(t.sourceExecution!==null)&&i.addIssue({code:"custom",message:"Only retained scoring passes name an original execution."}),["completed","failed","cancelled","interrupted"].includes(t.status)&&(!t.completedAt||t.counts.pending||t.counts.running)&&i.addIssue({code:"custom",message:"Terminal local execution requires complete population accounting."}),["completed","cancelled"].includes(t.status)&&!t.cleanupComplete&&i.addIssue({code:"custom",message:"Successful completion or cancellation requires confirmed local transport cleanup."}),t.usage.uncertainRequests>0&&t.usage.costUsd!==null&&i.addIssue({code:"custom",message:"Uncertain provider charges cannot claim a measured total."})}E(g,"validateLocalExecutionState");var ie=f.superRefine(g),c=v.superRefine(g),A=e.object({configuration:m,package:p}).strict(),U=e.object({configuration:m,expectedPackageHash:e.string().regex(/^[a-f0-9]{64}$/).optional()}).strict(),x=e.object({configuration:m,model:z,packageHash:e.string().regex(/^[a-f0-9]{64}$/),graders:e.array(r).min(1).max(100),availableGraders:e.array(r).min(1).max(1e3),retainedConfigurationHash:e.string().regex(/^[a-f0-9]{64}$/).optional(),configurationHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict().superRefine((t,i)=>{let{configurationHash:a,...h}=t;b(h)!==a&&i.addIssue({code:"custom",message:"Local configuration snapshot bytes changed."})}),{definition:ae,...O}=f.shape,l=e.object({...O,kind:e.literal("target"),...x.shape}).strict().superRefine((t,i)=>{let a={configuration:t.configuration,model:t.model,packageHash:t.packageHash,graders:t.graders,availableGraders:t.availableGraders,...t.retainedConfigurationHash?{retainedConfigurationHash:t.retainedConfigurationHash}:{},configurationHash:t.configurationHash};g(t,i),x.safeParse(a).success||i.addIssue({code:"custom",message:"Local Experiment configuration changed."}),(t.operationId!==t.configuration.operationId||t.teamId!==t.configuration.request.teamId||t.maximumCostUsd!==t.configuration.maximumCostUsd)&&i.addIssue({code:"custom",message:"Local Experiment differs from its sealed admission."})}),q=e.object({items:e.array(l).max(100),nextCursor:e.string().nullable()}).strict(),G=e.object({teamId:e.string().min(1).max(200),id:e.string().min(1).max(200),configurationHash:e.string().regex(/^[a-f0-9]{64}$/).optional()}).strict(),T=e.object({operationId:n,execution:e.object({id:n,executionHash:o}).strict(),graderPackage:p,graders:e.array(j).min(1).max(100),maximumCostUsd:e.number().finite().positive().max(1e4)}).strict(),re=T.omit({graderPackage:!0}),D=L,F=e.object({sessionId:n,turnId:n,source:S,profileRef:u,admissionHash:o,modelConfigurationHash:o,traceHash:o,runtimeEventRefs:e.array(n).max(1e4),startedAt:e.iso.datetime(),completedAt:e.iso.datetime(),outputHash:o,partialOutputAvailable:e.boolean()}).strict(),w=e.object({receiptId:n,taskId:n,seed:e.string(),status:e.enum(["pending","running","completed","failed","cancelled","unknown"]),input:e.record(e.string(),e.unknown()),policyVisibleContext:e.record(e.string(),e.unknown()),output:e.string().nullable(),messages:e.array(e.unknown()).max(4002),grade:H.nullable(),error:e.string().nullable(),native:D.optional(),profileNative:F.optional(),externalProcess:I.optional()}).strict(),ce=e.object({execution:e.union([l,c]),cases:e.array(w).max(1e4),contentHash:o}).strict(),$=e.object({items:e.array(e.object({sequence:e.number().int().positive(),type:e.string().min(1),payload:e.unknown()}).strict()).max(500),nextCursor:e.number().int().positive().nullable()}).strict(),se=e.object({location:e.literal("local"),execution:e.union([l,c]),case:w,trace:$}).strict(),me=e.object({items:e.array(c).max(100),nextCursor:n.nullable()}).strict(),pe=e.object({execution:c,graders:e.array(r).min(1).max(100),graderPackageHash:o}).strict(),C=e.object({execution:c,manifest:y,result:R}).strict().superRefine((t,i)=>{try{if(P(t),t.manifest.id!==t.execution.id||t.manifest.teamId!==t.execution.teamId||t.manifest.lineage?.execution.id!==(t.execution.sourceExecution?.id??t.execution.id)||t.manifest.lineage.execution.contentHash!==(t.execution.sourceExecution?.executionHash??t.execution.executionHash)||t.manifest.lineage.scoringPassId!==(t.execution.kind==="scoring"?t.execution.id:null)||t.manifest.maximumCostUsd!==t.execution.maximumCostUsd)throw new Error("Portable evidence differs from its retained local execution.")}catch(a){i.addIssue({code:"custom",message:a instanceof Error?a.message:"Local portable evidence verification failed."})}}),le=e.object({location:e.literal("local"),baseline:C,candidate:C}).strict();export{u as a,l as b,ce as c,le as d};
@@ -1,6 +1,6 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{F as Ie}from"./chunk-4TTXNVCE.js";import{e as He}from"./chunk-LZPCA6DH.js";import{a as Ee}from"./chunk-G4747MOW.js";import{a as B}from"./chunk-BL3CZWWD.js";import{a as je}from"./chunk-LE75SVEL.js";import{b as Re,c as ie,w as ne}from"./chunk-ZY32SZ2P.js";import{e as ve,i as Se,l as Pe,m as be}from"./chunk-OTDDXEQ6.js";import{l as v,m as fe,n as j}from"./chunk-RCT3O3HQ.js";import{a as c}from"./chunk-FTQLQJQV.js";import{promises as f}from"node:fs";import n from"node:path";import te from"node:path";import{constants as De,promises as D}from"node:fs";import R from"node:path";async function Fe(e){let t=await D.lstat(e);if(t.isSymbolicLink())throw new Error(`Profile source cannot be a symlink: ${e}`);if(t.isFile())return[R.basename(e)];if(!t.isDirectory())throw new Error(`Profile source is not a file or directory: ${e}`);return _(e)}c(Fe,"sourceFilesForImport");function xe(e){for(let t of["agent.ts","index.ts","agent/agent.ts","agent.yaml","agent.yml","agent.json"])if(e.includes(t))return t;return e[0]}c(xe,"selectAgentPrimaryFile");async function $e(e,t){let a=await D.lstat(e);if(!a.isFile()||a.isSymbolicLink())throw new Error(`Harness import source must be a regular non-symlink file: ${e}`);await D.mkdir(R.dirname(t),{recursive:!0}),await D.copyFile(e,t,De.COPYFILE_EXCL)}c($e,"copyRegularFile");function Z(e){let t=R.extname(e).toLowerCase();return[".md",".txt"].includes(t)?t===".md"?"text/markdown":"text/plain":[".json"].includes(t)?"application/json":[".yaml",".yml"].includes(t)?"application/yaml":[".ts",".tsx",".js",".mjs",".cjs"].includes(t)?"text/javascript":t===".py"?"text/x-python":"application/octet-stream"}c(Z,"mediaTypeForPath");async function ee(e,t){let a=R.resolve(e,...t.split("/")),o=R.relative(e,a);if(!o||o.startsWith("..")||R.isAbsolute(o))throw new Error(`Harness source path escapes its root: ${t}`);let s=await D.lstat(a);if(!s.isFile()||s.isSymbolicLink())throw new Error(`Harness source path must be a regular non-symlink file: ${t}`);let r=await D.realpath(a),w=R.relative(await D.realpath(e),r);if(w.startsWith("..")||R.isAbsolute(w))throw new Error(`Harness source path resolves outside its root: ${t}`);return a}c(ee,"resolveContainedRegularFile");async function _(e,t=e){let a=await D.readdir(t,{withFileTypes:!0}),o=[];for(let s of a){if(["node_modules",".git",".openpond"].includes(s.name)||s.name.startsWith(".env"))continue;let r=R.join(t,s.name);if(s.isSymbolicLink())throw new Error(`Harness source cannot contain symlinks: ${R.relative(e,r)}`);if(s.isDirectory())o.push(...await _(e,r));else if(s.isFile())o.push(R.relative(e,r).split(R.sep).join("/"));else throw new Error(`Harness source contains an unsupported entry: ${R.relative(e,r)}`)}return o.sort()}c(_,"listRegularFiles");function H(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||"harness"}c(H,"safeSegment");function Ae(e,t){let a=[];return{async copy(o,s){await $e(o,s);let r=te.relative(e,o),w=te.relative(t,s);r&&!r.startsWith("..")&&!te.isAbsolute(r)&&a.push({releasedPath:w.split(te.sep).join("/"),profileRelativePath:r.split(te.sep).join("/")})},add(o,s){a.push({releasedPath:o,profileRelativePath:s})},policy(o){return a.filter(s=>o.some(r=>r.path===s.releasedPath&&r.visibility==="policy"))}}}c(Ae,"createProfileSourceBindings");var Le=c(e=>e==="evals/catalog.json"||/^evals\/(definitions|suites|tasksets)\//.test(e)||/^workflows\/[^/]+\/evals\//.test(e),"isProfilePrivateEvaluationPath");import{execFile as _e}from"node:child_process";import{promises as L}from"node:fs";import G from"node:path";import{promisify as Ne}from"node:util";var ze=Ne(_e);async function nt(e){let t=G.join(e.runPath,"package.json"),a=await L.lstat(t).catch(()=>null);if(a&&(!a.isFile()||a.isSymbolicLink()))throw new Error("Released Profile Agent package manifest must be a regular file.");a||await L.writeFile(t,`{"type":"module"}
3
- `,{flag:"wx"});let o=await me(e.runPath);if(o){let r=o==="npm"?["ci","--omit=dev","--ignore-scripts","--no-audit","--no-fund"]:["install","--prod","--frozen-lockfile","--ignore-scripts","--config.node-linker=hoisted"];await(e.install??Je)(o,r,e.runPath)}let s=G.join(e.runPath,"node_modules","openpond-agent-sdk");if(!await L.lstat(s).catch(()=>null)){let r=JSON.parse(await L.readFile(t,"utf8"));if({...le(r.dependencies),...le(r.optionalDependencies)}["openpond-agent-sdk"])throw new Error("Released Profile Agent declared an SDK dependency that the locked installation did not provide.");let P=await Ie();await L.mkdir(G.dirname(s),{recursive:!0}),await L.symlink(P,s,"dir")}}c(nt,"prepareReleasedProfileActionDependencies");async function me(e){let t=G.join(e,"package.json"),a=await L.lstat(t).catch(()=>null);if(!a)return null;if(!a.isFile()||a.isSymbolicLink())throw new Error("Released Profile Agent package manifest must be a regular file.");let o=JSON.parse(await L.readFile(t,"utf8")),s={...le(o.dependencies),...le(o.optionalDependencies)};if(Object.keys(s).length){for(let[P,u]of Object.entries(s))if(/^(?:file:|link:|workspace:|git\+|https?:)/i.test(u))throw new Error(`Released Profile Agent dependency ${P} must use a portable registry version.`);let r=await We(G.join(e,"package-lock.json")),w=await We(G.join(e,"pnpm-lock.yaml"));if(r===w)throw new Error("Released Profile Agent with third-party dependencies requires exactly one npm or pnpm lockfile.");return r?"npm":"pnpm"}return null}c(me,"inspectReleasedProfileActionDependencies");function le(e){if(e===void 0)return{};if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Released Profile Agent dependencies must be a package map.");let t=Object.entries(e);if(t.some(([a,o])=>!a||typeof o!="string"||!o.trim()))throw new Error("Released Profile Agent dependencies must name portable versions.");return Object.fromEntries(t)}c(le,"dependencyMap");async function We(e){let t=await L.lstat(e).catch(()=>null);if(t&&(!t.isFile()||t.isSymbolicLink()))throw new Error("Released Profile Agent lockfile must be a regular file.");return!!t}c(We,"regularFile");async function Je(e,t,a){try{let o=process.platform==="win32"?`${e}.cmd`:e;await ze(o,t,{cwd:a,timeout:3e5,maxBuffer:1e6,...process.platform==="win32"?{shell:!0}:{}})}catch{throw new Error(`Released Profile Agent locked ${e} dependency installation failed.`)}}c(Je,"installLockedDependencies");var Te="harness.json";async function we(e,t,a,o,s){let r=n.resolve(a.sourcePath),w=[],P=Ae(r,e),u=P.copy,N=new Set((await _(r)).filter(Le)),E=new Set,y=c(i=>{let h=i.id;E.has(h)&&(h=`${h}-${j(i.path).slice(0,8)}`),E.add(h);let b={...i,id:h};return w.push(b),b},"addDeclaration");await f.mkdir(e,{recursive:!0});let ae=n.join(r,"instructions","system.md"),V=await f.lstat(ae).catch(i=>{if(i.code==="ENOENT")return null;throw i});if(V){if(!V.isFile()||V.isSymbolicLink())throw new Error("Profile instructions require an actual regular source file.");await u(ae,n.join(e,"instructions","system.md")),y({id:"instruction-system",kind:"instruction",path:"instructions/system.md",parentId:null,mediaType:"text/markdown",visibility:"policy",portability:"portable"})}for(let i of a.skills.filter(h=>h.enabled)){if(i.validationStatus!=="valid")throw new Error(`Cannot import invalid Profile Skill ${i.name}: ${i.validationMessages.join(" ")}`);let h=n.dirname(n.join(r,i.path)),b=`skills/${H(i.name)}/SKILL.md`;await u(n.join(h,"SKILL.md"),n.join(e,...b.split("/")));let T=y({id:`skill-${H(i.name)}`,kind:"skill",path:b,parentId:null,mediaType:"text/markdown",visibility:"policy",portability:"portable"});for(let p of i.resourceFiles){let O=`skills/${H(i.name)}/${p.split(n.sep).join("/")}`;await u(n.join(h,p),n.join(e,...O.split("/"))),y({id:`skill-resource-${H(i.name)}-${j(p).slice(0,12)}`,kind:"skill_resource",path:O,parentId:T.id,mediaType:Z(O),visibility:"policy",portability:"portable"})}}for(let i of a.agents.filter(h=>h.enabled)){let h=n.resolve(r,i.path),b=await f.realpath(h),T=await f.realpath(r),p=n.relative(T,b);if(p.startsWith("..")||n.isAbsolute(p))throw new Error("Profile Agent source escapes its admitted Profile root.");let O=await f.lstat(h),U=(await Fe(h)).filter(A=>{let C=O.isDirectory()?n.join(b,...A.split("/")):b;return!N.has(n.relative(T,C).split(n.sep).join("/"))});if(U.length===0)throw new Error(`Profile Agent ${i.id} has no source files.`);let Y=xe(U);for(let A of U){let C=`agents/${H(i.id)}/${A}`,Q=(await f.stat(h)).isDirectory()?n.join(h,...A.split("/")):h;await u(Q,n.join(e,...C.split("/"))),y({id:A===Y?`agent-${H(i.id)}`:`agent-asset-${H(i.id)}-${j(A).slice(0,12)}`,kind:A===Y?"agent":"asset",path:C,parentId:null,mediaType:Z(C),visibility:"policy",portability:"portable"})}await me(n.join(e,"agents",H(i.id)))}let X=new Set,se=new Set(a.agents.filter(i=>i.enabled).map(i=>i.id)),W=a.actionCatalog.filter(i=>i.agentId&&se.has(i.agentId)).map(i=>({id:i.id,agentId:H(i.agentId),sourceActionId:i.sourceActionId??i.id,inputSchema:typeof i.inputSchema=="object"&&i.inputSchema!==null?i.inputSchema:{type:"object",additionalProperties:!0}})),re=new Set(W.map(i=>i.id)),z=n.join(r,"workflows","catalog.json"),F=await f.lstat(z).catch(()=>null),l=(await _(r)).filter(i=>i.startsWith("workflows/")),S=l.some(i=>/^workflows\/[^/]+\/(PROMPT\.md|ACTION\.json)$/.test(i));if(S&&F)throw new Error("Authored Workflow packages and legacy workflows/catalog.json cannot coexist; migrate the catalog first.");if(F||S||W.length){if(F&&(!F.isFile()||F.isSymbolicLink()))throw new Error("Profile workflow catalog must be a regular file.");let i=S?He({files:new Map(await Promise.all(l.map(async p=>[p,await f.readFile(await ee(r,p),"utf8")]))),skillPaths:new Set(w.filter(p=>p.kind==="skill").map(p=>p.path)),actionIds:re}):null,h=i?Buffer.from(v(i.catalog)):F?await f.readFile(z):Buffer.from(v({schemaVersion:"openpond.profileWorkflows.v1",workflows:[]}));F&&P.add("workflows/catalog.json","workflows/catalog.json");let b=ie({catalog:JSON.parse(h.toString("utf8")),sourcePaths:new Set(w.filter(p=>p.kind==="skill").map(p=>p.path)),actionIds:new Set(W.map(p=>p.id))});for(let p of b.workflows)X.add(p.id);ue(b);let T="workflows/catalog.json";await f.mkdir(n.join(e,"workflows"),{recursive:!0}),await f.writeFile(n.join(e,"workflows","catalog.json"),h,{flag:"wx"});for(let p of i?.referencedPaths??[])await u(n.join(r,...p.split("/")),n.join(e,...p.split("/"))),y({id:`profile-workflow-source-${j(p).slice(0,16)}`,kind:"asset",path:p,parentId:null,mediaType:Z(p),visibility:"policy",portability:"portable"});y({id:"profile-workflows",kind:"workflow",path:T,parentId:null,mediaType:"application/json",visibility:"policy",portability:"portable"})}(F||S||W.length)&&(await f.writeFile(n.join(e,"workflows","actions.json"),v({schemaVersion:"openpond.profileWorkflowActions.v1",actions:W}),{flag:"wx"}),y({id:"profile-workflow-actions",kind:"asset",path:"workflows/actions.json",parentId:null,mediaType:"application/json",visibility:"policy",portability:"portable"}));let I=n.join(r,"evals","catalog.json"),J=await f.lstat(I).catch(()=>null),$=(await _(r)).filter(i=>/^workflows\/[^/]+\/evals\/[^/]+\.json$/.test(i)||/^evals\/(definitions|suites)\/[^/]+\.json$/.test(i));if(J&&$.length)throw new Error("Authored evaluation definitions and legacy evals/catalog.json cannot coexist; migrate the catalog first.");if(J||$.length){let[{ProfileEvaluationDefinitionSchema:i,ProfileEvaluationSuiteSchema:h,validateProfileEvaluationCatalog:b},{validateTasksetPackage:T}]=await Promise.all([import("./dist-J4KHAVO3.js"),import("./taskset-packages-RW4SFGDU.js")]);if(J&&(!J.isFile()||J.isSymbolicLink()))throw new Error("Profile evaluation catalog must be a regular file.");let p=[],O=[];for(let g of $){let x=JSON.parse(await f.readFile(await ee(r,g),"utf8"));if(g.startsWith("evals/suites/"))O.push(h.parse(x));else{let M=i.parse(x),K=/^workflows\/([^/]+)\/evals\//.exec(g)?.[1];if(K&&(M.target.kind!=="workflow"||M.target.workflowId!==K))throw new Error(`Profile evaluation ${M.id} must target its containing Workflow ${K}.`);p.push(M)}}let U=$.length?Buffer.from(v({schemaVersion:"openpond.profileEvaluations.v1",definitions:p.sort((g,x)=>g.id.localeCompare(x.id)),suites:O.sort((g,x)=>g.id.localeCompare(x.id))})):await f.readFile(I),{catalog:Y}=b({catalog:JSON.parse(U.toString("utf8")),workflowIds:X,skillPaths:new Set(w.filter(g=>g.kind==="skill").map(g=>g.path)),actionIds:re});await f.mkdir(n.join(e,"evals"),{recursive:!0}),await f.writeFile(n.join(e,"evals","catalog.json"),U,{flag:"wx"});for(let g of $)await u(n.join(r,...g.split("/")),n.join(e,...g.split("/"))),y({id:`profile-evaluation-source-${j(g).slice(0,16)}`,kind:"asset",path:g,parentId:null,mediaType:"application/json",visibility:"verifier",portability:"portable"});y({id:"profile-evaluations",kind:"asset",path:"evals/catalog.json",parentId:null,mediaType:"application/json",visibility:"verifier",portability:"portable"});let A=new Set(Y.definitions.map(g=>g.tasksetRelease.contentHash)),C=n.join(r,"evals","tasksets"),Q=await f.lstat(C).catch(()=>null);if(Q&&(!Q.isDirectory()||Q.isSymbolicLink()))throw new Error("Profile evaluation Taskset directory must be a regular directory.");for(let g of A){let x=n.join(C,`${g}.json`),M=await f.lstat(x).catch(()=>null);if(!M)throw new Error(`Profile evaluation Taskset package ${g} is missing.`);if(!M.isFile()||M.isSymbolicLink())throw new Error("Profile evaluation Taskset package must be a regular file.");let K=T(JSON.parse(await f.readFile(x,"utf8")));if(K.taskset.contentHash!==g||!Y.definitions.some(ye=>ye.tasksetRelease.contentHash===g&&ye.tasksetRelease.id===K.taskset.id))throw new Error("Profile evaluation Taskset package differs from its catalog reference.");let ke=`evals/tasksets/${g}.json`;await u(x,n.join(e,...ke.split("/"))),y({id:`profile-evaluation-taskset-${g.slice(0,16)}`,kind:"asset",path:ke,parentId:null,mediaType:"application/json",visibility:"verifier",portability:"portable"})}}let q=await Be(a,o),k=`dependency-lock/${q.name}`;await f.mkdir(n.join(e,"dependency-lock"),{recursive:!0}),q.sourcePath?await u(q.sourcePath,n.join(e,...k.split("/"))):await f.writeFile(n.join(e,...k.split("/")),v(q.generated),{flag:"wx"}),y({id:"dependency-lock",kind:"dependency_lock",path:k,parentId:null,mediaType:Z(k),visibility:"policy",portability:"portable"}),await f.writeFile(n.join(e,"program.json"),v({runtimeProtocol:"openpond.agent-runtime.v1"}),{flag:"wx"}),y({id:"agent-runtime-program",kind:"program",path:"program.json",parentId:null,mediaType:"application/json",visibility:"policy",portability:"portable"});let de=B.parse({schemaVersion:"openpond.harnessSourceManifest.v1",name:t,files:w,toolDeclarations:[],capabilityRequirements:[],lifecycle:{create:!0,reset:!0,step:!0,collect:!0,destroy:!0,resetScope:"attempt"},graderInterface:{visibleEvidence:["output","runtime_events","artifacts"],privilegedEvidence:["expected_output","private_verifier"],privateVerifierIsolation:!0},runtimeProtocol:"openpond.agent-runtime.v1",metadata:{importedFrom:"openpond.profile",profileId:a.activeProfile,...s?{profileRepositoryId:s}:{},profileGitHead:o??a.git?.head??null,profileSourceBindings:P.policy(w),profileInstructionSourcePath:"instructions/system.md",excludedEvalCount:a.evals.length,actionConversionPending:a.actionCatalog.length>0}});await f.writeFile(n.join(e,Te),v(de),{flag:"wx"}),await ce(e,t)}c(we,"writeImportedProfileSource");function ue(e){for(let t of e.workflows){let a=ne(t.inputSchema);if(!a.valid)throw new Error(`Profile workflow ${t.id} has an invalid input schema: ${a.issues[0]?.message??"schema mismatch"}`)}}c(ue,"assertProfileWorkflowInputSchemas");async function ce(e,t){let a=n.join(e,Te),o=B.parse(JSON.parse(await f.readFile(a,"utf8")));if(o.files.some(u=>u.kind==="instruction"))return;let s="instructions/system.md";await f.mkdir(n.join(e,"instructions"),{recursive:!0}),await f.writeFile(n.join(e,...s.split("/")),`# ${t}
2
+ import{a as Ee}from"./chunk-G4747MOW.js";import{F as ve}from"./chunk-OFJPOTES.js";import{a as B}from"./chunk-BL3CZWWD.js";import{a as Re}from"./chunk-LE75SVEL.js";import{e as Ie}from"./chunk-LZPCA6DH.js";import{b as He,c as ie,w as ne}from"./chunk-ZY32SZ2P.js";import{e as Se,i as Pe,l as be,m as je}from"./chunk-OTDDXEQ6.js";import{l as v,m as fe,n as j}from"./chunk-RCT3O3HQ.js";import{a as c}from"./chunk-FTQLQJQV.js";import{promises as f}from"node:fs";import n from"node:path";import te from"node:path";import{constants as De,promises as D}from"node:fs";import R from"node:path";async function Fe(e){let t=await D.lstat(e);if(t.isSymbolicLink())throw new Error(`Profile source cannot be a symlink: ${e}`);if(t.isFile())return[R.basename(e)];if(!t.isDirectory())throw new Error(`Profile source is not a file or directory: ${e}`);return _(e)}c(Fe,"sourceFilesForImport");function xe(e){for(let t of["agent.ts","index.ts","agent/agent.ts","agent.yaml","agent.yml","agent.json"])if(e.includes(t))return t;return e[0]}c(xe,"selectAgentPrimaryFile");async function $e(e,t){let a=await D.lstat(e);if(!a.isFile()||a.isSymbolicLink())throw new Error(`Harness import source must be a regular non-symlink file: ${e}`);await D.mkdir(R.dirname(t),{recursive:!0}),await D.copyFile(e,t,De.COPYFILE_EXCL)}c($e,"copyRegularFile");function Z(e){let t=R.extname(e).toLowerCase();return[".md",".txt"].includes(t)?t===".md"?"text/markdown":"text/plain":[".json"].includes(t)?"application/json":[".yaml",".yml"].includes(t)?"application/yaml":[".ts",".tsx",".js",".mjs",".cjs"].includes(t)?"text/javascript":t===".py"?"text/x-python":"application/octet-stream"}c(Z,"mediaTypeForPath");async function ee(e,t){let a=R.resolve(e,...t.split("/")),o=R.relative(e,a);if(!o||o.startsWith("..")||R.isAbsolute(o))throw new Error(`Harness source path escapes its root: ${t}`);let s=await D.lstat(a);if(!s.isFile()||s.isSymbolicLink())throw new Error(`Harness source path must be a regular non-symlink file: ${t}`);let r=await D.realpath(a),w=R.relative(await D.realpath(e),r);if(w.startsWith("..")||R.isAbsolute(w))throw new Error(`Harness source path resolves outside its root: ${t}`);return a}c(ee,"resolveContainedRegularFile");async function _(e,t=e){let a=await D.readdir(t,{withFileTypes:!0}),o=[];for(let s of a){if(["node_modules",".git",".openpond"].includes(s.name)||s.name.startsWith(".env"))continue;let r=R.join(t,s.name);if(s.isSymbolicLink())throw new Error(`Harness source cannot contain symlinks: ${R.relative(e,r)}`);if(s.isDirectory())o.push(...await _(e,r));else if(s.isFile())o.push(R.relative(e,r).split(R.sep).join("/"));else throw new Error(`Harness source contains an unsupported entry: ${R.relative(e,r)}`)}return o.sort()}c(_,"listRegularFiles");function H(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||"harness"}c(H,"safeSegment");function Ae(e,t){let a=[];return{async copy(o,s){await $e(o,s);let r=te.relative(e,o),w=te.relative(t,s);r&&!r.startsWith("..")&&!te.isAbsolute(r)&&a.push({releasedPath:w.split(te.sep).join("/"),profileRelativePath:r.split(te.sep).join("/")})},add(o,s){a.push({releasedPath:o,profileRelativePath:s})},policy(o){return a.filter(s=>o.some(r=>r.path===s.releasedPath&&r.visibility==="policy"))}}}c(Ae,"createProfileSourceBindings");var Le=c(e=>e==="evals/catalog.json"||/^evals\/(definitions|suites|tasksets)\//.test(e)||/^workflows\/[^/]+\/evals\//.test(e),"isProfilePrivateEvaluationPath");import{execFile as _e}from"node:child_process";import{promises as L}from"node:fs";import G from"node:path";import{promisify as Ne}from"node:util";var ze=Ne(_e);async function nt(e){let t=G.join(e.runPath,"package.json"),a=await L.lstat(t).catch(()=>null);if(a&&(!a.isFile()||a.isSymbolicLink()))throw new Error("Released Profile Agent package manifest must be a regular file.");a||await L.writeFile(t,`{"type":"module"}
3
+ `,{flag:"wx"});let o=await me(e.runPath);if(o){let r=o==="npm"?["ci","--omit=dev","--ignore-scripts","--no-audit","--no-fund"]:["install","--prod","--frozen-lockfile","--ignore-scripts","--config.node-linker=hoisted"];await(e.install??Je)(o,r,e.runPath)}let s=G.join(e.runPath,"node_modules","openpond-agent-sdk");if(!await L.lstat(s).catch(()=>null)){let r=JSON.parse(await L.readFile(t,"utf8"));if({...le(r.dependencies),...le(r.optionalDependencies)}["openpond-agent-sdk"])throw new Error("Released Profile Agent declared an SDK dependency that the locked installation did not provide.");let P=await ve();await L.mkdir(G.dirname(s),{recursive:!0}),await L.symlink(P,s,"dir")}}c(nt,"prepareReleasedProfileActionDependencies");async function me(e){let t=G.join(e,"package.json"),a=await L.lstat(t).catch(()=>null);if(!a)return null;if(!a.isFile()||a.isSymbolicLink())throw new Error("Released Profile Agent package manifest must be a regular file.");let o=JSON.parse(await L.readFile(t,"utf8")),s={...le(o.dependencies),...le(o.optionalDependencies)};if(Object.keys(s).length){for(let[P,u]of Object.entries(s))if(/^(?:file:|link:|workspace:|git\+|https?:)/i.test(u))throw new Error(`Released Profile Agent dependency ${P} must use a portable registry version.`);let r=await We(G.join(e,"package-lock.json")),w=await We(G.join(e,"pnpm-lock.yaml"));if(r===w)throw new Error("Released Profile Agent with third-party dependencies requires exactly one npm or pnpm lockfile.");return r?"npm":"pnpm"}return null}c(me,"inspectReleasedProfileActionDependencies");function le(e){if(e===void 0)return{};if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Released Profile Agent dependencies must be a package map.");let t=Object.entries(e);if(t.some(([a,o])=>!a||typeof o!="string"||!o.trim()))throw new Error("Released Profile Agent dependencies must name portable versions.");return Object.fromEntries(t)}c(le,"dependencyMap");async function We(e){let t=await L.lstat(e).catch(()=>null);if(t&&(!t.isFile()||t.isSymbolicLink()))throw new Error("Released Profile Agent lockfile must be a regular file.");return!!t}c(We,"regularFile");async function Je(e,t,a){try{let o=process.platform==="win32"?`${e}.cmd`:e;await ze(o,t,{cwd:a,timeout:3e5,maxBuffer:1e6,...process.platform==="win32"?{shell:!0}:{}})}catch{throw new Error(`Released Profile Agent locked ${e} dependency installation failed.`)}}c(Je,"installLockedDependencies");var Te="harness.json";async function we(e,t,a,o,s){let r=n.resolve(a.sourcePath),w=[],P=Ae(r,e),u=P.copy,N=new Set((await _(r)).filter(Le)),E=new Set,y=c(i=>{let h=i.id;E.has(h)&&(h=`${h}-${j(i.path).slice(0,8)}`),E.add(h);let b={...i,id:h};return w.push(b),b},"addDeclaration");await f.mkdir(e,{recursive:!0});let ae=n.join(r,"instructions","system.md"),V=await f.lstat(ae).catch(i=>{if(i.code==="ENOENT")return null;throw i});if(V){if(!V.isFile()||V.isSymbolicLink())throw new Error("Profile instructions require an actual regular source file.");await u(ae,n.join(e,"instructions","system.md")),y({id:"instruction-system",kind:"instruction",path:"instructions/system.md",parentId:null,mediaType:"text/markdown",visibility:"policy",portability:"portable"})}for(let i of a.skills.filter(h=>h.enabled)){if(i.validationStatus!=="valid")throw new Error(`Cannot import invalid Profile Skill ${i.name}: ${i.validationMessages.join(" ")}`);let h=n.dirname(n.join(r,i.path)),b=`skills/${H(i.name)}/SKILL.md`;await u(n.join(h,"SKILL.md"),n.join(e,...b.split("/")));let T=y({id:`skill-${H(i.name)}`,kind:"skill",path:b,parentId:null,mediaType:"text/markdown",visibility:"policy",portability:"portable"});for(let p of i.resourceFiles){let O=`skills/${H(i.name)}/${p.split(n.sep).join("/")}`;await u(n.join(h,p),n.join(e,...O.split("/"))),y({id:`skill-resource-${H(i.name)}-${j(p).slice(0,12)}`,kind:"skill_resource",path:O,parentId:T.id,mediaType:Z(O),visibility:"policy",portability:"portable"})}}for(let i of a.agents.filter(h=>h.enabled)){let h=n.resolve(r,i.path),b=await f.realpath(h),T=await f.realpath(r),p=n.relative(T,b);if(p.startsWith("..")||n.isAbsolute(p))throw new Error("Profile Agent source escapes its admitted Profile root.");let O=await f.lstat(h),U=(await Fe(h)).filter(A=>{let C=O.isDirectory()?n.join(b,...A.split("/")):b;return!N.has(n.relative(T,C).split(n.sep).join("/"))});if(U.length===0)throw new Error(`Profile Agent ${i.id} has no source files.`);let Y=xe(U);for(let A of U){let C=`agents/${H(i.id)}/${A}`,Q=(await f.stat(h)).isDirectory()?n.join(h,...A.split("/")):h;await u(Q,n.join(e,...C.split("/"))),y({id:A===Y?`agent-${H(i.id)}`:`agent-asset-${H(i.id)}-${j(A).slice(0,12)}`,kind:A===Y?"agent":"asset",path:C,parentId:null,mediaType:Z(C),visibility:"policy",portability:"portable"})}await me(n.join(e,"agents",H(i.id)))}let X=new Set,se=new Set(a.agents.filter(i=>i.enabled).map(i=>i.id)),W=a.actionCatalog.filter(i=>i.agentId&&se.has(i.agentId)).map(i=>({id:i.id,agentId:H(i.agentId),sourceActionId:i.sourceActionId??i.id,inputSchema:typeof i.inputSchema=="object"&&i.inputSchema!==null?i.inputSchema:{type:"object",additionalProperties:!0}})),re=new Set(W.map(i=>i.id)),z=n.join(r,"workflows","catalog.json"),F=await f.lstat(z).catch(()=>null),l=(await _(r)).filter(i=>i.startsWith("workflows/")),S=l.some(i=>/^workflows\/[^/]+\/(PROMPT\.md|ACTION\.json)$/.test(i));if(S&&F)throw new Error("Authored Workflow packages and legacy workflows/catalog.json cannot coexist; migrate the catalog first.");if(F||S||W.length){if(F&&(!F.isFile()||F.isSymbolicLink()))throw new Error("Profile workflow catalog must be a regular file.");let i=S?Ie({files:new Map(await Promise.all(l.map(async p=>[p,await f.readFile(await ee(r,p),"utf8")]))),skillPaths:new Set(w.filter(p=>p.kind==="skill").map(p=>p.path)),actionIds:re}):null,h=i?Buffer.from(v(i.catalog)):F?await f.readFile(z):Buffer.from(v({schemaVersion:"openpond.profileWorkflows.v1",workflows:[]}));F&&P.add("workflows/catalog.json","workflows/catalog.json");let b=ie({catalog:JSON.parse(h.toString("utf8")),sourcePaths:new Set(w.filter(p=>p.kind==="skill").map(p=>p.path)),actionIds:new Set(W.map(p=>p.id))});for(let p of b.workflows)X.add(p.id);ue(b);let T="workflows/catalog.json";await f.mkdir(n.join(e,"workflows"),{recursive:!0}),await f.writeFile(n.join(e,"workflows","catalog.json"),h,{flag:"wx"});for(let p of i?.referencedPaths??[])await u(n.join(r,...p.split("/")),n.join(e,...p.split("/"))),y({id:`profile-workflow-source-${j(p).slice(0,16)}`,kind:"asset",path:p,parentId:null,mediaType:Z(p),visibility:"policy",portability:"portable"});y({id:"profile-workflows",kind:"workflow",path:T,parentId:null,mediaType:"application/json",visibility:"policy",portability:"portable"})}(F||S||W.length)&&(await f.writeFile(n.join(e,"workflows","actions.json"),v({schemaVersion:"openpond.profileWorkflowActions.v1",actions:W}),{flag:"wx"}),y({id:"profile-workflow-actions",kind:"asset",path:"workflows/actions.json",parentId:null,mediaType:"application/json",visibility:"policy",portability:"portable"}));let I=n.join(r,"evals","catalog.json"),J=await f.lstat(I).catch(()=>null),$=(await _(r)).filter(i=>/^workflows\/[^/]+\/evals\/[^/]+\.json$/.test(i)||/^evals\/(definitions|suites)\/[^/]+\.json$/.test(i));if(J&&$.length)throw new Error("Authored evaluation definitions and legacy evals/catalog.json cannot coexist; migrate the catalog first.");if(J||$.length){let[{ProfileEvaluationDefinitionSchema:i,ProfileEvaluationSuiteSchema:h,validateProfileEvaluationCatalog:b},{validateTasksetPackage:T}]=await Promise.all([import("./dist-2MKJC6HN.js"),import("./taskset-packages-T6B6HYKZ.js")]);if(J&&(!J.isFile()||J.isSymbolicLink()))throw new Error("Profile evaluation catalog must be a regular file.");let p=[],O=[];for(let g of $){let x=JSON.parse(await f.readFile(await ee(r,g),"utf8"));if(g.startsWith("evals/suites/"))O.push(h.parse(x));else{let M=i.parse(x),K=/^workflows\/([^/]+)\/evals\//.exec(g)?.[1];if(K&&(M.target.kind!=="workflow"||M.target.workflowId!==K))throw new Error(`Profile evaluation ${M.id} must target its containing Workflow ${K}.`);p.push(M)}}let U=$.length?Buffer.from(v({schemaVersion:"openpond.profileEvaluations.v1",definitions:p.sort((g,x)=>g.id.localeCompare(x.id)),suites:O.sort((g,x)=>g.id.localeCompare(x.id))})):await f.readFile(I),{catalog:Y}=b({catalog:JSON.parse(U.toString("utf8")),workflowIds:X,skillPaths:new Set(w.filter(g=>g.kind==="skill").map(g=>g.path)),actionIds:re});await f.mkdir(n.join(e,"evals"),{recursive:!0}),await f.writeFile(n.join(e,"evals","catalog.json"),U,{flag:"wx"});for(let g of $)await u(n.join(r,...g.split("/")),n.join(e,...g.split("/"))),y({id:`profile-evaluation-source-${j(g).slice(0,16)}`,kind:"asset",path:g,parentId:null,mediaType:"application/json",visibility:"verifier",portability:"portable"});y({id:"profile-evaluations",kind:"asset",path:"evals/catalog.json",parentId:null,mediaType:"application/json",visibility:"verifier",portability:"portable"});let A=new Set(Y.definitions.map(g=>g.tasksetRelease.contentHash)),C=n.join(r,"evals","tasksets"),Q=await f.lstat(C).catch(()=>null);if(Q&&(!Q.isDirectory()||Q.isSymbolicLink()))throw new Error("Profile evaluation Taskset directory must be a regular directory.");for(let g of A){let x=n.join(C,`${g}.json`),M=await f.lstat(x).catch(()=>null);if(!M)throw new Error(`Profile evaluation Taskset package ${g} is missing.`);if(!M.isFile()||M.isSymbolicLink())throw new Error("Profile evaluation Taskset package must be a regular file.");let K=T(JSON.parse(await f.readFile(x,"utf8")));if(K.taskset.contentHash!==g||!Y.definitions.some(ye=>ye.tasksetRelease.contentHash===g&&ye.tasksetRelease.id===K.taskset.id))throw new Error("Profile evaluation Taskset package differs from its catalog reference.");let ke=`evals/tasksets/${g}.json`;await u(x,n.join(e,...ke.split("/"))),y({id:`profile-evaluation-taskset-${g.slice(0,16)}`,kind:"asset",path:ke,parentId:null,mediaType:"application/json",visibility:"verifier",portability:"portable"})}}let q=await Be(a,o),k=`dependency-lock/${q.name}`;await f.mkdir(n.join(e,"dependency-lock"),{recursive:!0}),q.sourcePath?await u(q.sourcePath,n.join(e,...k.split("/"))):await f.writeFile(n.join(e,...k.split("/")),v(q.generated),{flag:"wx"}),y({id:"dependency-lock",kind:"dependency_lock",path:k,parentId:null,mediaType:Z(k),visibility:"policy",portability:"portable"}),await f.writeFile(n.join(e,"program.json"),v({runtimeProtocol:"openpond.agent-runtime.v1"}),{flag:"wx"}),y({id:"agent-runtime-program",kind:"program",path:"program.json",parentId:null,mediaType:"application/json",visibility:"policy",portability:"portable"});let de=B.parse({schemaVersion:"openpond.harnessSourceManifest.v1",name:t,files:w,toolDeclarations:[],capabilityRequirements:[],lifecycle:{create:!0,reset:!0,step:!0,collect:!0,destroy:!0,resetScope:"attempt"},graderInterface:{visibleEvidence:["output","runtime_events","artifacts"],privilegedEvidence:["expected_output","private_verifier"],privateVerifierIsolation:!0},runtimeProtocol:"openpond.agent-runtime.v1",metadata:{importedFrom:"openpond.profile",profileId:a.activeProfile,...s?{profileRepositoryId:s}:{},profileGitHead:o??a.git?.head??null,profileSourceBindings:P.policy(w),profileInstructionSourcePath:"instructions/system.md",excludedEvalCount:a.evals.length,actionConversionPending:a.actionCatalog.length>0}});await f.writeFile(n.join(e,Te),v(de),{flag:"wx"}),await ce(e,t)}c(we,"writeImportedProfileSource");function ue(e){for(let t of e.workflows){let a=ne(t.inputSchema);if(!a.valid)throw new Error(`Profile workflow ${t.id} has an invalid input schema: ${a.issues[0]?.message??"schema mismatch"}`)}}c(ue,"assertProfileWorkflowInputSchemas");async function ce(e,t){let a=n.join(e,Te),o=B.parse(JSON.parse(await f.readFile(a,"utf8")));if(o.files.some(u=>u.kind==="instruction"))return;let s="instructions/system.md";await f.mkdir(n.join(e,"instructions"),{recursive:!0}),await f.writeFile(n.join(e,...s.split("/")),`# ${t}
4
4
 
5
5
  Keep reusable, provider-neutral execution guidance for this Harness here.
6
- `,{flag:"wx"});let w=new Set(o.files.map(u=>u.id)).has("instruction-system")?`instruction-system-${j(s).slice(0,8)}`:"instruction-system",P=B.parse({...o,name:t,files:[...o.files,{id:w,kind:"instruction",path:s,parentId:null,mediaType:"text/markdown",visibility:"policy",portability:"portable"}]});await f.writeFile(a,v(P),{flag:"w"})}c(ce,"ensureHarnessInstructionSurface");async function Be(e,t){let a=e.repoPath?n.resolve(e.repoPath):null;if(a)for(let o of["pnpm-lock.yaml","package-lock.json","yarn.lock"]){let s=n.join(a,o),r=await f.lstat(s).catch(()=>null);if(r?.isFile()&&!r.isSymbolicLink())return{name:o,sourcePath:s}}return{name:"profile-import.json",sourcePath:null,generated:{source:"openpond.profile",profileId:e.activeProfile,profileGitHead:t??e.git?.head??null,dependenciesResolved:!1}}}c(Be,"importedDependencyLock");import{randomUUID as ge}from"node:crypto";import{promises as d}from"node:fs";import m from"node:path";var oe="harness.json",Oe=25e7;function Ve(e,t){let a=`${H(t)}-${j(t).slice(0,16)}`,o=m.join(e,"library","harnesses","workspaces",a);return{root:o,source:m.join(o,"source")}}c(Ve,"localHarnessWorkspacePaths");async function xt(e){return pe({...e,initializeSource:c(t=>Ue(t,e.name),"initializeSource")})}c(xt,"createLocalHarnessWorkspace");async function $t(e){if(e.profile.mode!=="local"||!e.profile.sourcePath)throw new Error("Only a loaded local Profile with a source path can be imported.");return pe({...e,compilationWorkspaceId:e.repositoryId?Me(e.repositoryId,e.name):e.id,initializeSource:c(t=>we(t,e.name,e.profile,e.sourceRevision,e.repositoryId),"initializeSource")})}c($t,"importProfileIntoLocalHarnessWorkspace");function Me(e,t){return`profile-source-${j([e,t]).slice(0,24)}`}c(Me,"profileCompilationWorkspaceId");async function At(e){if(e.profile.mode!=="local"||!e.profile.sourcePath)throw new Error("Only a loaded Profile source can be compiled.");let t=m.join(e.storeDir,"library","harnesses","profile-previews");await d.mkdir(t,{recursive:!0});let a=m.join(t,ge());try{await we(a,e.name,e.profile,e.sourceRevision,e.repositoryId);let o=e.repositoryId?Me(e.repositoryId,e.name):e.workspaceId;return await he({workspaceId:o,sourceDir:a})}finally{await d.rm(a,{recursive:!0,force:!0})}}c(At,"compileProfileHarnessSource");async function Lt(e){let t=await he({workspaceId:e.id,sourceDir:e.sourceDir}),a=await e.store.getHarnessWorkspace(e.id);if(a){let o=a.currentChannel.release?await e.store.getHarnessReleaseRecord(a.currentChannel.release.contentHash):null;if(a.ownerScope.id!==e.ownerId||a.sourceRevision!==t.sourceRevision||o?.harnessRelease.contentHash!==t.harnessRelease.contentHash)throw new Error("Configured Harness source changed; use a new workspace ID for the new release.");return}await pe({...e,initializeSource:c(async o=>{await d.mkdir(o,{recursive:!0}),await d.writeFile(m.join(o,oe),v(t.manifest));for(let s of t.sourceFiles){let r=m.join(o,s.path);await d.mkdir(m.dirname(r),{recursive:!0}),await d.writeFile(r,s.bytes)}},"initializeSource")})}c(Lt,"importLocalHarnessWorkspaceSource");async function Wt(e){let t=await e.store.getHarnessReleaseRecord(e.sourceRelease.contentHash);if(!t||t.harnessRelease.id!==e.sourceRelease.id)throw new Error("Harness workspace fork source release is unavailable.");return pe({...e,initializeSource:c(async a=>{await d.cp(m.join(t.bundlePath,"source"),a,{recursive:!0,force:!1,errorOnExist:!0,verbatimSymlinks:!1}),await ce(a,e.name)},"initializeSource")})}c(Wt,"forkLocalHarnessWorkspaceFromRelease");async function pe(e){let t=e.now??(()=>new Date().toISOString()),a=Ve(e.storeDir,e.id),o=m.dirname(a.root);await d.mkdir(o,{recursive:!0});let s=m.join(o,`.${m.basename(a.root)}.creating-${ge()}`),r=m.join(s,"source");try{await e.initializeSource(r),await d.rename(s,a.root)}catch(w){throw await d.rm(s,{recursive:!0,force:!0}).catch(()=>{}),w}try{let w=await he({workspaceId:e.compilationWorkspaceId??e.id,sourceDir:a.source}),P=await qe({storeDir:e.storeDir,workspaceId:e.id,compiled:w,createdAt:t()}),u=t(),N=je.parse({schemaVersion:"openpond.harnessWorkspace.v1",id:e.id,ownerScope:e.originOwnerScope??{kind:"personal",id:e.ownerId},name:e.name,location:"local",sourceRevision:w.sourceRevision,revision:0,dirty:!1,currentChannel:{name:"personal",release:{id:w.harnessRelease.id,contentHash:w.harnessRelease.contentHash},revision:1},createdAt:u,updatedAt:u,metadata:{...e.originMetadata,sourceLayout:"openpond.harnessSourceManifest.v1",...e.selectionEligible===!1?{selectionEligible:!1}:{}}});return await e.store.createHarnessWorkspaceWithRelease({workspace:N,release:P})}catch(w){throw await d.rm(a.root,{recursive:!0,force:!0}).catch(()=>{}),w}}c(pe,"createLocalHarnessWorkspaceFromInitializer");async function he(e){let t=m.resolve(e.sourceDir),a=m.join(t,oe),o=B.parse(JSON.parse(await d.readFile(a,"utf8"))),s=new Set(o.files.map(l=>l.path)),r=(await _(t)).filter(l=>l!==oe),w=r.filter(l=>!s.has(l)),P=[...s].filter(l=>!r.includes(l));if(w.length||P.length)throw new Error(`Harness source manifest mismatch. Unlisted: ${w.join(", ")||"none"}; missing: ${P.join(", ")||"none"}.`);let u=[];for(let l of o.files){let S=await ee(t,l.path),I=await d.readFile(S);if(I.byteLength>Oe)throw new Error(`Harness source file ${l.path} exceeds ${Oe} bytes.`);u.push({path:l.path,bytes:I,asset:{id:l.id,path:l.path,contentHash:fe(I),sizeBytes:I.byteLength,mediaType:l.mediaType,visibility:l.visibility}})}let N=u.find(({path:l})=>l==="workflows/catalog.json");if(N){let l=o.files.find(k=>k.path===N.path);if(l?.kind!=="workflow"||l.visibility!=="policy")throw new Error("Profile workflow catalog requires a policy-visible workflow declaration.");let S=u.find(({path:k})=>k==="workflows/actions.json"),I=o.files.find(k=>k.path==="workflows/actions.json");if(!S||I?.visibility!=="policy")throw new Error("Profile workflow catalog requires a released action inventory.");let J=Re.parse(JSON.parse(new TextDecoder().decode(S.bytes))).actions,$=new Set;for(let k of J){if($.has(k.id))throw new Error(`Duplicate Profile workflow action ${k.id}.`);if($.add(k.id),!ne(k.inputSchema).valid)throw new Error(`Profile workflow action ${k.id} has an invalid input schema.`);if(!o.files.some(de=>de.path.startsWith(`agents/${k.agentId}/`)))throw new Error(`Profile workflow action ${k.id} lacks its Agent source.`)}let q=ie({catalog:JSON.parse(new TextDecoder().decode(N.bytes)),sourcePaths:new Set(o.files.filter(k=>k.kind==="skill").map(k=>k.path)),actionIds:$});ue(q)}let E=j({manifest:o,files:u.map(({path:l,asset:S})=>({path:l,contentHash:S.contentHash,sizeBytes:S.sizeBytes}))}),y=c(l=>u.filter(({path:S})=>o.files.find(I=>I.path===S)?.kind===l).map(({asset:S})=>S),"byKind"),ae=y("dependency_lock")[0],V=y("program")[0],X=o.files.filter(l=>l.portability==="local_only").map(l=>l.id),se=o.files.filter(l=>l.visibility==="host_private").map(l=>l.id),W=[...X.map(l=>`Asset ${l} is local-only.`),...se.map(l=>`Asset ${l} is host-private.`)],re={id:`harness-source-${E.slice(0,24)}`,contentHash:E},z=Pe({schemaVersion:"openpond.agentSnapshot.v2",id:`agent-snapshot-${j([E,o.toolDeclarations]).slice(0,24)}`,sourceRelease:re,instructions:y("instruction"),skills:y("skill"),agents:y("agent"),toolDeclarations:o.toolDeclarations,capabilityRequirements:o.capabilityRequirements,dependencyLock:ae,portability:{portable:W.length===0,blockers:W,localOnlyAssetRefs:X,hostPrivateAssetRefs:se},metadata:{workspaceId:e.workspaceId,sourceRevision:E,sourceLayout:o.schemaVersion}}),F=be({schemaVersion:"openpond.harnessRelease.v2",id:`harness-${j([z.contentHash,V.contentHash,o.lifecycle]).slice(0,24)}`,agentSnapshot:{id:z.id,contentHash:z.contentHash},program:V,tools:o.toolDeclarations,lifecycle:o.lifecycle,graderInterface:o.graderInterface,files:u.map(({asset:l})=>l),metadata:{runtimeProtocol:o.runtimeProtocol,sourceRevision:E,sourceLayout:o.schemaVersion,...o.metadata.importedFrom==="openpond.profile"?{profile:{id:o.metadata.profileId,sourceRevision:o.metadata.profileGitHead??E,...o.metadata.profileRepositoryId?{repositoryId:o.metadata.profileRepositoryId}:{}}}:{}}});return{manifest:o,sourceRevision:E,agentSnapshot:z,harnessRelease:F,sourceFiles:u}}c(he,"compileLocalHarnessSource");async function qe(e){let t=m.join(e.storeDir,"library","harnesses","releases"),a=m.join(t,e.compiled.harnessRelease.contentHash);await d.mkdir(t,{recursive:!0});let o=m.join(t,`.${e.compiled.harnessRelease.contentHash}.materializing-${ge()}`);try{await d.mkdir(m.join(o,"source"),{recursive:!0});for(let s of e.compiled.sourceFiles){let r=m.join(o,"source",...s.path.split("/"));await d.mkdir(m.dirname(r),{recursive:!0}),await d.writeFile(r,s.bytes,{flag:"wx"})}await d.writeFile(m.join(o,"source",oe),v(e.compiled.manifest),{flag:"wx"}),await d.writeFile(m.join(o,"agent-snapshot.json"),v(e.compiled.agentSnapshot),{flag:"wx"}),await d.writeFile(m.join(o,"harness-release.json"),v(e.compiled.harnessRelease),{flag:"wx"});try{await d.rename(o,a)}catch(s){if(s.code!=="EEXIST"&&s.code!=="ENOTEMPTY")throw s;await Ce(a,e.compiled),await d.rm(o,{recursive:!0,force:!0})}await Ce(a,e.compiled)}catch(s){throw await d.rm(o,{recursive:!0,force:!0}).catch(()=>{}),s}return Ee.parse({schemaVersion:"openpond.localHarnessReleaseRecord.v1",workspaceId:e.workspaceId,sourceRevision:e.compiled.sourceRevision,agentSnapshot:e.compiled.agentSnapshot,harnessRelease:e.compiled.harnessRelease,bundlePath:a,createdAt:e.createdAt})}c(qe,"materializeLocalHarnessRelease");async function Ue(e,t){let a=B.parse({schemaVersion:"openpond.harnessSourceManifest.v1",name:t,files:[{id:"dependency-lock",kind:"dependency_lock",path:"dependency-lock.json",parentId:null,mediaType:"application/json",visibility:"policy",portability:"portable"},{id:"agent-runtime-program",kind:"program",path:"program.json",parentId:null,mediaType:"application/json",visibility:"policy",portability:"portable"}],toolDeclarations:[],capabilityRequirements:[],lifecycle:{create:!0,reset:!0,step:!0,collect:!0,destroy:!0,resetScope:"attempt"},graderInterface:{visibleEvidence:["output","runtime_events","artifacts"],privilegedEvidence:["expected_output","private_verifier"],privateVerifierIsolation:!0},runtimeProtocol:"openpond.agent-runtime.v1",metadata:{}});await d.mkdir(e,{recursive:!0}),await d.writeFile(m.join(e,"dependency-lock.json"),v({dependencies:{}}),{flag:"wx"}),await d.writeFile(m.join(e,"program.json"),v({runtimeProtocol:"openpond.agent-runtime.v1"}),{flag:"wx"}),await d.writeFile(m.join(e,oe),v(a),{flag:"wx"}),await ce(e,t)}c(Ue,"writeDefaultHarnessSource");async function Ce(e,t){let a=ve.parse(JSON.parse(await d.readFile(m.join(e,"agent-snapshot.json"),"utf8"))),o=Se.parse(JSON.parse(await d.readFile(m.join(e,"harness-release.json"),"utf8")));if(a.contentHash!==t.agentSnapshot.contentHash||o.contentHash!==t.harnessRelease.contentHash)throw new Error("Materialized Harness release does not match the compiled immutable objects.");for(let s of t.sourceFiles){let r=await d.readFile(m.join(e,"source",...s.path.split("/")));if(fe(r)!==s.asset.contentHash)throw new Error(`Materialized Harness asset ${s.path} failed hash verification.`)}}c(Ce,"verifyMaterializedRelease");export{Z as a,ee as b,_ as c,H as d,Le as e,nt as f,Ve as g,xt as h,$t as i,At as j,Lt as k,Wt as l,he as m,qe as n};
6
+ `,{flag:"wx"});let w=new Set(o.files.map(u=>u.id)).has("instruction-system")?`instruction-system-${j(s).slice(0,8)}`:"instruction-system",P=B.parse({...o,name:t,files:[...o.files,{id:w,kind:"instruction",path:s,parentId:null,mediaType:"text/markdown",visibility:"policy",portability:"portable"}]});await f.writeFile(a,v(P),{flag:"w"})}c(ce,"ensureHarnessInstructionSurface");async function Be(e,t){let a=e.repoPath?n.resolve(e.repoPath):null;if(a)for(let o of["pnpm-lock.yaml","package-lock.json","yarn.lock"]){let s=n.join(a,o),r=await f.lstat(s).catch(()=>null);if(r?.isFile()&&!r.isSymbolicLink())return{name:o,sourcePath:s}}return{name:"profile-import.json",sourcePath:null,generated:{source:"openpond.profile",profileId:e.activeProfile,profileGitHead:t??e.git?.head??null,dependenciesResolved:!1}}}c(Be,"importedDependencyLock");import{randomUUID as ge}from"node:crypto";import{promises as d}from"node:fs";import m from"node:path";var oe="harness.json",Oe=25e7;function Ve(e,t){let a=`${H(t)}-${j(t).slice(0,16)}`,o=m.join(e,"library","harnesses","workspaces",a);return{root:o,source:m.join(o,"source")}}c(Ve,"localHarnessWorkspacePaths");async function xt(e){return pe({...e,initializeSource:c(t=>Ue(t,e.name),"initializeSource")})}c(xt,"createLocalHarnessWorkspace");async function $t(e){if(e.profile.mode!=="local"||!e.profile.sourcePath)throw new Error("Only a loaded local Profile with a source path can be imported.");return pe({...e,compilationWorkspaceId:e.repositoryId?Me(e.repositoryId,e.name):e.id,initializeSource:c(t=>we(t,e.name,e.profile,e.sourceRevision,e.repositoryId),"initializeSource")})}c($t,"importProfileIntoLocalHarnessWorkspace");function Me(e,t){return`profile-source-${j([e,t]).slice(0,24)}`}c(Me,"profileCompilationWorkspaceId");async function At(e){if(e.profile.mode!=="local"||!e.profile.sourcePath)throw new Error("Only a loaded Profile source can be compiled.");let t=m.join(e.storeDir,"library","harnesses","profile-previews");await d.mkdir(t,{recursive:!0});let a=m.join(t,ge());try{await we(a,e.name,e.profile,e.sourceRevision,e.repositoryId);let o=e.repositoryId?Me(e.repositoryId,e.name):e.workspaceId;return await he({workspaceId:o,sourceDir:a})}finally{await d.rm(a,{recursive:!0,force:!0})}}c(At,"compileProfileHarnessSource");async function Lt(e){let t=await he({workspaceId:e.id,sourceDir:e.sourceDir}),a=await e.store.getHarnessWorkspace(e.id);if(a){let o=a.currentChannel.release?await e.store.getHarnessReleaseRecord(a.currentChannel.release.contentHash):null;if(a.ownerScope.id!==e.ownerId||a.sourceRevision!==t.sourceRevision||o?.harnessRelease.contentHash!==t.harnessRelease.contentHash)throw new Error("Configured Harness source changed; use a new workspace ID for the new release.");return}await pe({...e,initializeSource:c(async o=>{await d.mkdir(o,{recursive:!0}),await d.writeFile(m.join(o,oe),v(t.manifest));for(let s of t.sourceFiles){let r=m.join(o,s.path);await d.mkdir(m.dirname(r),{recursive:!0}),await d.writeFile(r,s.bytes)}},"initializeSource")})}c(Lt,"importLocalHarnessWorkspaceSource");async function Wt(e){let t=await e.store.getHarnessReleaseRecord(e.sourceRelease.contentHash);if(!t||t.harnessRelease.id!==e.sourceRelease.id)throw new Error("Harness workspace fork source release is unavailable.");return pe({...e,initializeSource:c(async a=>{await d.cp(m.join(t.bundlePath,"source"),a,{recursive:!0,force:!1,errorOnExist:!0,verbatimSymlinks:!1}),await ce(a,e.name)},"initializeSource")})}c(Wt,"forkLocalHarnessWorkspaceFromRelease");async function pe(e){let t=e.now??(()=>new Date().toISOString()),a=Ve(e.storeDir,e.id),o=m.dirname(a.root);await d.mkdir(o,{recursive:!0});let s=m.join(o,`.${m.basename(a.root)}.creating-${ge()}`),r=m.join(s,"source");try{await e.initializeSource(r),await d.rename(s,a.root)}catch(w){throw await d.rm(s,{recursive:!0,force:!0}).catch(()=>{}),w}try{let w=await he({workspaceId:e.compilationWorkspaceId??e.id,sourceDir:a.source}),P=await qe({storeDir:e.storeDir,workspaceId:e.id,compiled:w,createdAt:t()}),u=t(),N=Re.parse({schemaVersion:"openpond.harnessWorkspace.v1",id:e.id,ownerScope:e.originOwnerScope??{kind:"personal",id:e.ownerId},name:e.name,location:"local",sourceRevision:w.sourceRevision,revision:0,dirty:!1,currentChannel:{name:"personal",release:{id:w.harnessRelease.id,contentHash:w.harnessRelease.contentHash},revision:1},createdAt:u,updatedAt:u,metadata:{...e.originMetadata,sourceLayout:"openpond.harnessSourceManifest.v1",...e.selectionEligible===!1?{selectionEligible:!1}:{}}});return await e.store.createHarnessWorkspaceWithRelease({workspace:N,release:P})}catch(w){throw await d.rm(a.root,{recursive:!0,force:!0}).catch(()=>{}),w}}c(pe,"createLocalHarnessWorkspaceFromInitializer");async function he(e){let t=m.resolve(e.sourceDir),a=m.join(t,oe),o=B.parse(JSON.parse(await d.readFile(a,"utf8"))),s=new Set(o.files.map(l=>l.path)),r=(await _(t)).filter(l=>l!==oe),w=r.filter(l=>!s.has(l)),P=[...s].filter(l=>!r.includes(l));if(w.length||P.length)throw new Error(`Harness source manifest mismatch. Unlisted: ${w.join(", ")||"none"}; missing: ${P.join(", ")||"none"}.`);let u=[];for(let l of o.files){let S=await ee(t,l.path),I=await d.readFile(S);if(I.byteLength>Oe)throw new Error(`Harness source file ${l.path} exceeds ${Oe} bytes.`);u.push({path:l.path,bytes:I,asset:{id:l.id,path:l.path,contentHash:fe(I),sizeBytes:I.byteLength,mediaType:l.mediaType,visibility:l.visibility}})}let N=u.find(({path:l})=>l==="workflows/catalog.json");if(N){let l=o.files.find(k=>k.path===N.path);if(l?.kind!=="workflow"||l.visibility!=="policy")throw new Error("Profile workflow catalog requires a policy-visible workflow declaration.");let S=u.find(({path:k})=>k==="workflows/actions.json"),I=o.files.find(k=>k.path==="workflows/actions.json");if(!S||I?.visibility!=="policy")throw new Error("Profile workflow catalog requires a released action inventory.");let J=He.parse(JSON.parse(new TextDecoder().decode(S.bytes))).actions,$=new Set;for(let k of J){if($.has(k.id))throw new Error(`Duplicate Profile workflow action ${k.id}.`);if($.add(k.id),!ne(k.inputSchema).valid)throw new Error(`Profile workflow action ${k.id} has an invalid input schema.`);if(!o.files.some(de=>de.path.startsWith(`agents/${k.agentId}/`)))throw new Error(`Profile workflow action ${k.id} lacks its Agent source.`)}let q=ie({catalog:JSON.parse(new TextDecoder().decode(N.bytes)),sourcePaths:new Set(o.files.filter(k=>k.kind==="skill").map(k=>k.path)),actionIds:$});ue(q)}let E=j({manifest:o,files:u.map(({path:l,asset:S})=>({path:l,contentHash:S.contentHash,sizeBytes:S.sizeBytes}))}),y=c(l=>u.filter(({path:S})=>o.files.find(I=>I.path===S)?.kind===l).map(({asset:S})=>S),"byKind"),ae=y("dependency_lock")[0],V=y("program")[0],X=o.files.filter(l=>l.portability==="local_only").map(l=>l.id),se=o.files.filter(l=>l.visibility==="host_private").map(l=>l.id),W=[...X.map(l=>`Asset ${l} is local-only.`),...se.map(l=>`Asset ${l} is host-private.`)],re={id:`harness-source-${E.slice(0,24)}`,contentHash:E},z=be({schemaVersion:"openpond.agentSnapshot.v2",id:`agent-snapshot-${j([E,o.toolDeclarations]).slice(0,24)}`,sourceRelease:re,instructions:y("instruction"),skills:y("skill"),agents:y("agent"),toolDeclarations:o.toolDeclarations,capabilityRequirements:o.capabilityRequirements,dependencyLock:ae,portability:{portable:W.length===0,blockers:W,localOnlyAssetRefs:X,hostPrivateAssetRefs:se},metadata:{workspaceId:e.workspaceId,sourceRevision:E,sourceLayout:o.schemaVersion}}),F=je({schemaVersion:"openpond.harnessRelease.v2",id:`harness-${j([z.contentHash,V.contentHash,o.lifecycle]).slice(0,24)}`,agentSnapshot:{id:z.id,contentHash:z.contentHash},program:V,tools:o.toolDeclarations,lifecycle:o.lifecycle,graderInterface:o.graderInterface,files:u.map(({asset:l})=>l),metadata:{runtimeProtocol:o.runtimeProtocol,sourceRevision:E,sourceLayout:o.schemaVersion,...o.metadata.importedFrom==="openpond.profile"?{profile:{id:o.metadata.profileId,sourceRevision:o.metadata.profileGitHead??E,...o.metadata.profileRepositoryId?{repositoryId:o.metadata.profileRepositoryId}:{}}}:{}}});return{manifest:o,sourceRevision:E,agentSnapshot:z,harnessRelease:F,sourceFiles:u}}c(he,"compileLocalHarnessSource");async function qe(e){let t=m.join(e.storeDir,"library","harnesses","releases"),a=m.join(t,e.compiled.harnessRelease.contentHash);await d.mkdir(t,{recursive:!0});let o=m.join(t,`.${e.compiled.harnessRelease.contentHash}.materializing-${ge()}`);try{await d.mkdir(m.join(o,"source"),{recursive:!0});for(let s of e.compiled.sourceFiles){let r=m.join(o,"source",...s.path.split("/"));await d.mkdir(m.dirname(r),{recursive:!0}),await d.writeFile(r,s.bytes,{flag:"wx"})}await d.writeFile(m.join(o,"source",oe),v(e.compiled.manifest),{flag:"wx"}),await d.writeFile(m.join(o,"agent-snapshot.json"),v(e.compiled.agentSnapshot),{flag:"wx"}),await d.writeFile(m.join(o,"harness-release.json"),v(e.compiled.harnessRelease),{flag:"wx"});try{await d.rename(o,a)}catch(s){if(s.code!=="EEXIST"&&s.code!=="ENOTEMPTY")throw s;await Ce(a,e.compiled),await d.rm(o,{recursive:!0,force:!0})}await Ce(a,e.compiled)}catch(s){throw await d.rm(o,{recursive:!0,force:!0}).catch(()=>{}),s}return Ee.parse({schemaVersion:"openpond.localHarnessReleaseRecord.v1",workspaceId:e.workspaceId,sourceRevision:e.compiled.sourceRevision,agentSnapshot:e.compiled.agentSnapshot,harnessRelease:e.compiled.harnessRelease,bundlePath:a,createdAt:e.createdAt})}c(qe,"materializeLocalHarnessRelease");async function Ue(e,t){let a=B.parse({schemaVersion:"openpond.harnessSourceManifest.v1",name:t,files:[{id:"dependency-lock",kind:"dependency_lock",path:"dependency-lock.json",parentId:null,mediaType:"application/json",visibility:"policy",portability:"portable"},{id:"agent-runtime-program",kind:"program",path:"program.json",parentId:null,mediaType:"application/json",visibility:"policy",portability:"portable"}],toolDeclarations:[],capabilityRequirements:[],lifecycle:{create:!0,reset:!0,step:!0,collect:!0,destroy:!0,resetScope:"attempt"},graderInterface:{visibleEvidence:["output","runtime_events","artifacts"],privilegedEvidence:["expected_output","private_verifier"],privateVerifierIsolation:!0},runtimeProtocol:"openpond.agent-runtime.v1",metadata:{}});await d.mkdir(e,{recursive:!0}),await d.writeFile(m.join(e,"dependency-lock.json"),v({dependencies:{}}),{flag:"wx"}),await d.writeFile(m.join(e,"program.json"),v({runtimeProtocol:"openpond.agent-runtime.v1"}),{flag:"wx"}),await d.writeFile(m.join(e,oe),v(a),{flag:"wx"}),await ce(e,t)}c(Ue,"writeDefaultHarnessSource");async function Ce(e,t){let a=Se.parse(JSON.parse(await d.readFile(m.join(e,"agent-snapshot.json"),"utf8"))),o=Pe.parse(JSON.parse(await d.readFile(m.join(e,"harness-release.json"),"utf8")));if(a.contentHash!==t.agentSnapshot.contentHash||o.contentHash!==t.harnessRelease.contentHash)throw new Error("Materialized Harness release does not match the compiled immutable objects.");for(let s of t.sourceFiles){let r=await d.readFile(m.join(e,"source",...s.path.split("/")));if(fe(r)!==s.asset.contentHash)throw new Error(`Materialized Harness asset ${s.path} failed hash verification.`)}}c(Ce,"verifyMaterializedRelease");export{Z as a,ee as b,_ as c,H as d,Le as e,nt as f,Ve as g,xt as h,$t as i,At as j,Lt as k,Wt as l,he as m,qe as n};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{B as T,k as c,l as i,o as f,t as S,w,z as x}from"./chunk-4PUOWSDE.js";import{Wa as R}from"./chunk-ZY32SZ2P.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as v}from"./chunk-FTQLQJQV.js";var p=e.string().trim().min(1).max(500),j=e.string().regex(/^[a-f0-9]{64}$/),y=e.object({id:p,revision:e.number().int().positive(),contentHash:j}).strict(),b=e.object({schemaVersion:e.literal("openpond.hostedTasksetSummary.v1"),id:p,teamId:p,release:y,name:e.string().min(1).max(500),description:e.string().max(2e4),taskCount:e.number().int().nonnegative(),buildIntent:e.string().min(1).max(100),methodHint:e.string().min(1).max(100).nullable(),packageBytes:e.number().int().nonnegative().nullable(),storedBytes:e.number().int().nonnegative().nullable(),createdAt:e.string().datetime({offset:!0})}).strict(),_=e.object({afterId:e.string().trim().min(1).max(2e3).optional(),limit:e.number().int().min(1).max(100).default(30),modelProjectId:p.optional(),projectId:p.optional(),search:e.string().trim().max(100).optional(),sort:e.enum(["id","name","updated"]).default("id")}).strict(),q=e.object({items:e.array(b).max(100),nextCursor:e.string().trim().min(1).max(2e3).nullable()}).strict(),B=e.object({code:e.string().min(1),message:e.string().min(1)}).strict(),l=class extends Error{static{v(this,"OpenPondTasksetCatalogError")}constructor(s,r,t){super(t),this.status=s,this.code=r,this.name="OpenPondTasksetCatalogError"}status;code},P=class{static{v(this,"OpenPondTasksetCatalogClient")}#e;constructor(s){if(!s.apiKey.trim()||!s.teamId.trim())throw new Error("Taskset API key and workspace are required.");let r=new URL(s.baseUrl);if(!["http:","https:"].includes(r.protocol)||r.username||r.password||r.search||r.hash)throw new Error("Taskset base URL must be an HTTP(S) endpoint without credentials, query, or fragment.");this.#e={...s,baseUrl:r.toString().replace(/\/+$/,"")}}async list(s={},r={}){let t=_.parse(s),a=new URLSearchParams({limit:String(t.limit)});t.afterId&&a.set("afterId",t.afterId),t.modelProjectId&&a.set("modelProjectId",t.modelProjectId),t.projectId&&a.set("projectId",t.projectId),t.search!==void 0&&a.set("search",t.search),a.set("sort",t.sort);let n=q.parse(await this.#t(`?${a}`,r.signal));if(n.items.length>t.limit||new Set(n.items.map(m=>m.id)).size!==n.items.length||n.items.some(m=>m.teamId!==this.#e.teamId))throw new l(502,"catalog_scope_mismatch","Taskset inventory did not match the requested workspace or page size.");return n}async get(s,r={}){let t=p.parse(s),a=b.parse(await this.#t(`/${encodeURIComponent(t)}`,r.signal));if(a.id!==t||a.teamId!==this.#e.teamId)throw new l(502,"catalog_identity_mismatch","Taskset metadata did not match the requested identity.");return a}async resolve(s,r={}){let t=y.parse(s),a=b.parse(await this.#t(`/releases/${encodeURIComponent(t.id)}/${t.revision}/${t.contentHash}`,r.signal));if(a.teamId!==this.#e.teamId||a.release.id!==t.id||a.release.revision!==t.revision||a.release.contentHash!==t.contentHash)throw new l(502,"catalog_release_mismatch","Taskset metadata did not match the requested immutable release.");return a}async#t(s,r){let t=await(this.#e.fetch??globalThis.fetch)(`${this.#e.baseUrl}/v1/taskset-catalog${s}`,{headers:{Authorization:`Bearer ${this.#e.apiKey}`,"X-OpenPond-Team-Id":this.#e.teamId,Accept:"application/json"},signal:r,redirect:"error"}),a=t.body?.getReader();if(!a)throw new l(t.status,"empty_response","Taskset catalog response was empty.");let n=new TextDecoder,m=0,g="";try{for(;;){let o=await a.read();if(o.done)break;if(m+=o.value.byteLength,m>4194304)throw new l(t.status,"response_too_large","Taskset catalog response exceeded 4 MiB.");g+=n.decode(o.value,{stream:!0})}g+=n.decode()}finally{await a.cancel(),a.releaseLock()}let I=JSON.parse(g);if(!t.ok){let o=B.safeParse(I);throw new l(t.status,o.success?o.data.code:"invalid_error_response",o.success?o.data.message:`Taskset catalog request failed (${t.status}).`)}return I}};var u=i.shape.id,V=e.object({schemaVersion:e.literal("openpond.modelBatchReviewInspection.v1"),packageHash:e.string().regex(/^[a-f0-9]{64}$/),definition:f,binding:R,evidence:e.array(w).min(1).max(1e4),decisions:e.array(T).min(1).max(1e4)}).strict(),k=e.object({schemaVersion:e.literal("openpond.modelBatchReviewRequest.v1"),operationId:u,modelId:u,expectedModelRevision:e.number().int().positive(),tasksetRef:i,rewardBindingRef:i.nullable(),definition:e.object({name:e.string().trim().min(1).max(500).optional(),instructions:e.string().trim().min(1).max(2e4).optional(),inputSchema:c.optional(),outputSchema:c.optional(),requiredOutputs:f.shape.requiredOutputs}).strict(),examples:e.array(e.object({evidence:i,input:c.optional(),expected:c.nullable().optional(),evaluatorContext:c.nullable().optional(),proposedTarget:c.nullable().optional()}).strict()).max(1e4)}).strict(),A=e.object({schemaVersion:e.literal("openpond.modelBatchReviewReceipt.v1"),operationId:u,modelId:u,source:S,evidence:e.array(w).min(1).max(1e4),proposals:e.array(x).max(1e4)}).strict();var d=i.shape.id,h=e.string().regex(/^[a-f0-9]{64}$/),F=e.object({schemaVersion:e.literal("openpond.datasetTrainingReviewRequest.v1"),teamId:d,operationId:d,dataset:i,packageHash:h,taskIds:e.array(d).min(1).max(1e4).nullable().default(null),purpose:e.enum(["supervised_training","reward_training"]),rewardBindingRef:i.nullable().default(null),definition:k.shape.definition.default({}),targetSource:e.enum(["none","expected_output","approved_parent"]).default("none"),shareWithWorkspace:e.literal(!0)}).strict().superRefine((s,r)=>{s.taskIds&&new Set(s.taskIds).size!==s.taskIds.length&&r.addIssue({code:"custom",path:["taskIds"],message:"Select each Dataset task once."}),s.purpose!=="supervised_training"&&s.targetSource!=="none"&&r.addIssue({code:"custom",path:["targetSource"],message:"Target proposals require a supervised review."})}),N=e.object({schemaVersion:e.literal("openpond.datasetTrainingReviewSource.v1"),dataset:i,packageHash:h,taskCount:e.number().int().nonnegative(),definition:k.shape.definition,rewardBinding:i.nullable(),hasParentTargets:e.boolean()}).strict(),C=e.object({schemaVersion:e.literal("openpond.datasetTrainingReviewReceipt.v1"),id:d,teamId:d,actorId:d,operationId:d,requestHash:h,dataset:i,packageHash:h,purpose:e.enum(["supervised_training","reward_training"]),shareWithWorkspace:e.literal(!0),source:i,definition:i,evidence:e.array(i).min(1).max(1e4),proposals:e.array(i.pick({id:!0,revision:!0})).max(1e4),createdAt:e.string().datetime({offset:!0})}).strict(),Q=C.extend({contentHash:h}).strict();export{y as a,P as b,V as c,k as d,A as e,F as f,N as g,C as h,Q as i};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{n as z,o as V,p as G,q}from"./chunk-7P5SH3CI.js";import{a as A,f as v,g as k,h as p,i as f}from"./chunk-3M53YXEI.js";import{a}from"./chunk-FTQLQJQV.js";import{Buffer as Y}from"node:buffer";import{readdirSync as H,readFileSync as Q,statSync as F}from"node:fs";import b from"node:path";var K=500,Z=8*1024*1024,W=8*1024*1024;async function me(e,t){if(!t.sandboxRuntime&&!t.runtimeId)return{sandbox:await X(e,await e.create(t.sandbox,{async:!0}))};let n=t.runtimeId?void 0:await e.createSandboxRuntime(t.sandboxRuntime),r=t.runtimeId??n.id,o=await e.createSandboxRuntimeSandbox(r,t.sandbox);return{sandbox:await X(e,o.sandbox),runtime:o.runtime??n}}a(me,"createSandboxFromPlan");async function X(e,t){if(t.state==="running"||t.state==="stopped")return t;if(t.state==="error")throw new Error(`sandbox create failed: ${t.id}
2
+ import{n as z,o as V,p as G,q}from"./chunk-JPUSTFZC.js";import{a as A,f as v,g as k,h as p,i as f}from"./chunk-3M53YXEI.js";import{a}from"./chunk-FTQLQJQV.js";import{Buffer as Y}from"node:buffer";import{readdirSync as H,readFileSync as Q,statSync as F}from"node:fs";import b from"node:path";var K=500,Z=8*1024*1024,W=8*1024*1024;async function me(e,t){if(!t.sandboxRuntime&&!t.runtimeId)return{sandbox:await X(e,await e.create(t.sandbox,{async:!0}))};let n=t.runtimeId?void 0:await e.createSandboxRuntime(t.sandboxRuntime),r=t.runtimeId??n.id,o=await e.createSandboxRuntimeSandbox(r,t.sandbox);return{sandbox:await X(e,o.sandbox),runtime:o.runtime??n}}a(me,"createSandboxFromPlan");async function X(e,t){if(t.state==="running"||t.state==="stopped")return t;if(t.state==="error")throw new Error(`sandbox create failed: ${t.id}
3
3
  ${t.logs.join(`
4
4
  `)}`);let n=12*6e4,r=3e3,o=Date.now()+n,i=t;for(;Date.now()<o;){if(await new Promise(s=>setTimeout(s,r)),i=await e.get(t.id),i.state==="running"||i.state==="stopped")return i;if(i.state==="error")throw new Error(`sandbox create failed: ${i.id}
5
5
  ${i.logs.join(`
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{Ca as b,ja as w,wa as y}from"./chunk-WLZJOCLA.js";import{i as f,n}from"./chunk-RCT3O3HQ.js";import{a as h}from"./chunk-FTQLQJQV.js";function I(r,a){if(!a)return null;let g=w(a),m=(r.environment.resources??[]).filter(o=>o.kind==="file"&&o.visibility==="policy_visible");if(!m.length)return null;let k=m.map(o=>{let l=g.files.filter(s=>s.asset.path===o.path&&s.asset.visibility==="policy");if(l.length!==1)throw new Error("Reviewed shared resource differs from the exact owner-local package.");let c=f.parse(l[0].asset),t=r.sourceRefs.find(s=>"sourceFileHashes"in s&&s.sourceFileHashes?.includes(c.contentHash)&&"originalFileNames"in s&&s.originalFileNames?.includes(c.path.split("/").at(-1))&&"mediaTypes"in s&&s.mediaTypes?.includes(c.mediaType));if(!t)throw new Error("Shared workflow files require existing source review of their exact bytes.");return{asset:c,sourceRefId:t.id}});return new Map(k.map(o=>[o.asset.id,o]))}h(I,"reviewedModelSharedResources");function O(r,a,g){if(r.profileId!==a.profileId||r.tasks.length!==a.tasks.length)throw new Error("Model Taskset review differs from its compiled task scope.");let m=new Map(a.sourceRefs.map(t=>[t.id,t])),k=I(a,g),o=r.tasks.map(t=>{let s=a.tasks.find(e=>e.id===t.id);if(!s)throw new Error("Model Taskset review is missing a compiled task.");if(n(t.input)!==n(s.input)||n(t.expectedOutput)!==n(s.expectedOutput)||n(t.policyVisibleContext)!==n(s.policyVisibleContext))throw new Error("Model Taskset review differs from its compiled task content.");let T=(t.assets??[]).map(e=>{let i=s.assets?.find(u=>u.id===e.id);if(!i){let u=k?.get(e.id),d=u?.asset,R=f.safeParse(e.metadata.portableAsset);if(!d||!R.success||n(R.data)!==n(d)||e.artifactRef!==d.path||e.stagingPath!==d.path||e.sha256!==d.contentHash||e.sizeBytes!==d.sizeBytes||e.mediaType!==d.mediaType||e.fileName!==d.path.split("/").at(-1)||e.split!==t.split)throw new Error("Model Taskset review differs from its compiled shared resource.");return{...e,sourceRefId:u.sourceRefId}}let p=f.safeParse(i?.metadata.portableAsset),P=i?.artifactRef===e.artifactRef||p.success&&p.data.path===e.artifactRef&&p.data.id===e.id&&p.data.contentHash===e.sha256&&p.data.sizeBytes===e.sizeBytes&&p.data.mediaType===e.mediaType&&p.data.visibility==="policy";if(!i||i.sha256!==e.sha256||i.sizeBytes!==e.sizeBytes||!P||i.mediaType!==e.mediaType||i.fileName!==e.fileName||i.split!==t.split||!s.sourceRefs.includes(i.sourceRefId)||!m.has(i.sourceRefId))throw new Error("Model Taskset review differs from its compiled input asset.");return{...e,sourceRefId:i.sourceRefId,...i.stagingPath===void 0?{}:{stagingPath:i.stagingPath}}});if((s.assets??[]).some(e=>!T.some(i=>i.id===e.id)))throw new Error("Model Taskset review lost an input asset.");return{...t,sourceRefs:[...new Set([...s.sourceRefs,...T.map(e=>e.sourceRefId)])],assets:T}}),l=r.metadata.rewardBinding,c=y.parse({...r,sourceRefs:a.sourceRefs,tasks:o,metadata:{...r.metadata,...Object.fromEntries(["trainingMethod","diagnosis","buildIntent"].filter(t=>a.metadata[t]!==void 0).map(t=>[t,a.metadata[t]]))},capabilities:{...r.capabilities,supportedSignals:a.capabilities.supportedSignals,compatibleMethods:a.capabilities.compatibleMethods},graderFixtures:a.graderFixtures,learningSignals:{...a.learningSignals,rewards:a.learningSignals.rewards.map(t=>l?{...t,artifactRef:l.id,rules:[{id:l.id,points:1,condition:"Execute the published Reward binding with its declared normalization, weights and required gates."}]}:t)}});return y.parse({...c,contentHash:b(c)})}h(O,"retainModelTasksetInputReview");export{O as a};
2
+ import{Ca as b,ja as w,wa as y}from"./chunk-BU6MW65V.js";import{i as f,n}from"./chunk-RCT3O3HQ.js";import{a as h}from"./chunk-FTQLQJQV.js";function I(r,a){if(!a)return null;let g=w(a),m=(r.environment.resources??[]).filter(o=>o.kind==="file"&&o.visibility==="policy_visible");if(!m.length)return null;let k=m.map(o=>{let l=g.files.filter(s=>s.asset.path===o.path&&s.asset.visibility==="policy");if(l.length!==1)throw new Error("Reviewed shared resource differs from the exact owner-local package.");let c=f.parse(l[0].asset),t=r.sourceRefs.find(s=>"sourceFileHashes"in s&&s.sourceFileHashes?.includes(c.contentHash)&&"originalFileNames"in s&&s.originalFileNames?.includes(c.path.split("/").at(-1))&&"mediaTypes"in s&&s.mediaTypes?.includes(c.mediaType));if(!t)throw new Error("Shared workflow files require existing source review of their exact bytes.");return{asset:c,sourceRefId:t.id}});return new Map(k.map(o=>[o.asset.id,o]))}h(I,"reviewedModelSharedResources");function O(r,a,g){if(r.profileId!==a.profileId||r.tasks.length!==a.tasks.length)throw new Error("Model Taskset review differs from its compiled task scope.");let m=new Map(a.sourceRefs.map(t=>[t.id,t])),k=I(a,g),o=r.tasks.map(t=>{let s=a.tasks.find(e=>e.id===t.id);if(!s)throw new Error("Model Taskset review is missing a compiled task.");if(n(t.input)!==n(s.input)||n(t.expectedOutput)!==n(s.expectedOutput)||n(t.policyVisibleContext)!==n(s.policyVisibleContext))throw new Error("Model Taskset review differs from its compiled task content.");let T=(t.assets??[]).map(e=>{let i=s.assets?.find(u=>u.id===e.id);if(!i){let u=k?.get(e.id),d=u?.asset,R=f.safeParse(e.metadata.portableAsset);if(!d||!R.success||n(R.data)!==n(d)||e.artifactRef!==d.path||e.stagingPath!==d.path||e.sha256!==d.contentHash||e.sizeBytes!==d.sizeBytes||e.mediaType!==d.mediaType||e.fileName!==d.path.split("/").at(-1)||e.split!==t.split)throw new Error("Model Taskset review differs from its compiled shared resource.");return{...e,sourceRefId:u.sourceRefId}}let p=f.safeParse(i?.metadata.portableAsset),P=i?.artifactRef===e.artifactRef||p.success&&p.data.path===e.artifactRef&&p.data.id===e.id&&p.data.contentHash===e.sha256&&p.data.sizeBytes===e.sizeBytes&&p.data.mediaType===e.mediaType&&p.data.visibility==="policy";if(!i||i.sha256!==e.sha256||i.sizeBytes!==e.sizeBytes||!P||i.mediaType!==e.mediaType||i.fileName!==e.fileName||i.split!==t.split||!s.sourceRefs.includes(i.sourceRefId)||!m.has(i.sourceRefId))throw new Error("Model Taskset review differs from its compiled input asset.");return{...e,sourceRefId:i.sourceRefId,...i.stagingPath===void 0?{}:{stagingPath:i.stagingPath}}});if((s.assets??[]).some(e=>!T.some(i=>i.id===e.id)))throw new Error("Model Taskset review lost an input asset.");return{...t,sourceRefs:[...new Set([...s.sourceRefs,...T.map(e=>e.sourceRefId)])],assets:T}}),l=r.metadata.rewardBinding,c=y.parse({...r,sourceRefs:a.sourceRefs,tasks:o,metadata:{...r.metadata,...Object.fromEntries(["trainingMethod","diagnosis","buildIntent"].filter(t=>a.metadata[t]!==void 0).map(t=>[t,a.metadata[t]]))},capabilities:{...r.capabilities,supportedSignals:a.capabilities.supportedSignals,compatibleMethods:a.capabilities.compatibleMethods},graderFixtures:a.graderFixtures,learningSignals:{...a.learningSignals,rewards:a.learningSignals.rewards.map(t=>l?{...t,artifactRef:l.id,rules:[{id:l.id,points:1,condition:"Execute the published Reward binding with its declared normalization, weights and required gates."}]}:t)}});return y.parse({...c,contentHash:b(c)})}h(O,"retainModelTasksetInputReview");export{O as a};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{b as g,d as $,e as O,f as C}from"./chunk-BQVB2SPF.js";import{a as w}from"./chunk-3M53YXEI.js";import{a as r}from"./chunk-FTQLQJQV.js";var L=Symbol("openpondCliOptionValues"),a=class extends Error{static{r(this,"CliUsageError")}exitCode=2;constructor(t){super(t),this.name="CliUsageError"}},K=new Set(["maxOutputBytes","timeoutSec"]);function k(n){let t=[...n],o="",i={},e={},u=[];for(;t.length>0;){let s=t.shift();if(s==="--"){u.push(...t);break}if(s.startsWith("--")){let f=s.indexOf("="),c=f>=0?s.slice(2,f):s.slice(2),p=N(c),d=f>=0?s.slice(f+1):P(t,p,o);h(i,e,p,d,o)}else _(s)?y(s,t,i,e):o?u.push(s):o=s}return Object.defineProperty(i,L,{value:e,enumerable:!1,configurable:!1,writable:!1}),V(o,i),{command:o,options:i,rest:u}}r(k,"parseArgs");function N(n){return n.replace(/-([a-z])/g,(t,o)=>o.toUpperCase())}r(N,"normalizeCliOptionKey");function _(n){return/^-[^-].*/.test(n)&&!S(n)}r(_,"isShortOptionToken");function y(n,t,o,i){let e=n.slice(1);if(!e)return;let u=e.indexOf("="),s=u>=0?e.slice(0,u):e,f=u>=0?e.slice(u+1):null;if(s.length!==1){for(let d of s){let m=g[d];if(!m)throw new a(`unknown short option -${d}`);if(C(m)!=="boolean")throw new a(`short option -${d} requires its own value`);h(o,i,m,"true")}return}let c=g[s];if(!c)throw new a(`unknown short option -${s}`);let p=f??P(t,c);h(o,i,c,p)}r(y,"parseShortOptionToken");function P(n,t,o){let i=I(t,o);if(i==="boolean")return n[0]&&x(n[0])?n.shift():"true";if(i){let e=n.shift();if(e===void 0||R(e)&&!S(e))throw e!==void 0&&n.unshift(e),new a(`${l(t)} must be ${b(i)}`);return e}return n[0]&&!n[0].startsWith("--")?n.shift():"true"}r(P,"readOptionValue");function h(n,t,o,i,e){T(o,i,e),n[o]=i,(t[o]??=[]).push(i)}r(h,"setParsedOption");function T(n,t,o){let i=I(n,o);if(i){if(i==="boolean"){if(!x(t))throw new a(`${l(n)} must be a boolean`);return}if(t.trim().length===0||t==="true")throw new a(`${l(n)} must be ${b(i)}`);if(i==="number"||i==="integer"){let e=Number(t);if(!Number.isFinite(e))throw new a(`${l(n)} must be ${b(i)}`);if(i==="integer"&&!Number.isInteger(e))throw new a(`${l(n)} must be an integer`);if(i==="integer"&&K.has(n)&&e<=0)throw new a(`${l(n)} must be a positive integer`);return}if(i==="json")try{w(t,l(n))}catch(e){throw new a(e instanceof Error?e.message:String(e))}}}r(T,"validateParsedOptionValue");function I(n,t){return t?O(t,n):C(n)}r(I,"typedOptionKind");function l(n){return n.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}r(l,"cliOptionLabel");function E(n){return n==="json"?"JSON value":n}r(E,"optionKindLabel");function b(n){let t=E(n);return/^[aeiou]/i.test(t)?`an ${t}`:`a ${t}`}r(b,"optionKindPhrase");function x(n){return/^(true|false|1|0|yes|no)$/i.test(n)}r(x,"isBooleanLiteral");function R(n){return n.startsWith("-")&&n!=="-"}r(R,"isOptionLike");function S(n){return/^-\d+(?:\.\d+)?$/.test(n)}r(S,"isNegativeNumber");function V(n,t){let o=n?$(n):null;for(let i of Object.keys(t))if(!O(n,i)){let e=l(i),u=o?` for ${o.name}`:"";throw new a(`unknown option --${e}${u}`)}}r(V,"validateCommandOptions");export{a,k as b};
2
+ import{b as g,d as $,e as O,f as C}from"./chunk-RBTDSI4L.js";import{a as w}from"./chunk-3M53YXEI.js";import{a as r}from"./chunk-FTQLQJQV.js";var L=Symbol("openpondCliOptionValues"),a=class extends Error{static{r(this,"CliUsageError")}exitCode=2;constructor(t){super(t),this.name="CliUsageError"}},K=new Set(["maxOutputBytes","timeoutSec"]);function k(n){let t=[...n],o="",i={},e={},u=[];for(;t.length>0;){let s=t.shift();if(s==="--"){u.push(...t);break}if(s.startsWith("--")){let f=s.indexOf("="),c=f>=0?s.slice(2,f):s.slice(2),p=N(c),d=f>=0?s.slice(f+1):P(t,p,o);h(i,e,p,d,o)}else _(s)?y(s,t,i,e):o?u.push(s):o=s}return Object.defineProperty(i,L,{value:e,enumerable:!1,configurable:!1,writable:!1}),V(o,i),{command:o,options:i,rest:u}}r(k,"parseArgs");function N(n){return n.replace(/-([a-z])/g,(t,o)=>o.toUpperCase())}r(N,"normalizeCliOptionKey");function _(n){return/^-[^-].*/.test(n)&&!S(n)}r(_,"isShortOptionToken");function y(n,t,o,i){let e=n.slice(1);if(!e)return;let u=e.indexOf("="),s=u>=0?e.slice(0,u):e,f=u>=0?e.slice(u+1):null;if(s.length!==1){for(let d of s){let m=g[d];if(!m)throw new a(`unknown short option -${d}`);if(C(m)!=="boolean")throw new a(`short option -${d} requires its own value`);h(o,i,m,"true")}return}let c=g[s];if(!c)throw new a(`unknown short option -${s}`);let p=f??P(t,c);h(o,i,c,p)}r(y,"parseShortOptionToken");function P(n,t,o){let i=I(t,o);if(i==="boolean")return n[0]&&x(n[0])?n.shift():"true";if(i){let e=n.shift();if(e===void 0||R(e)&&!S(e))throw e!==void 0&&n.unshift(e),new a(`${l(t)} must be ${b(i)}`);return e}return n[0]&&!n[0].startsWith("--")?n.shift():"true"}r(P,"readOptionValue");function h(n,t,o,i,e){T(o,i,e),n[o]=i,(t[o]??=[]).push(i)}r(h,"setParsedOption");function T(n,t,o){let i=I(n,o);if(i){if(i==="boolean"){if(!x(t))throw new a(`${l(n)} must be a boolean`);return}if(t.trim().length===0||t==="true")throw new a(`${l(n)} must be ${b(i)}`);if(i==="number"||i==="integer"){let e=Number(t);if(!Number.isFinite(e))throw new a(`${l(n)} must be ${b(i)}`);if(i==="integer"&&!Number.isInteger(e))throw new a(`${l(n)} must be an integer`);if(i==="integer"&&K.has(n)&&e<=0)throw new a(`${l(n)} must be a positive integer`);return}if(i==="json")try{w(t,l(n))}catch(e){throw new a(e instanceof Error?e.message:String(e))}}}r(T,"validateParsedOptionValue");function I(n,t){return t?O(t,n):C(n)}r(I,"typedOptionKind");function l(n){return n.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}r(l,"cliOptionLabel");function E(n){return n==="json"?"JSON value":n}r(E,"optionKindLabel");function b(n){let t=E(n);return/^[aeiou]/i.test(t)?`an ${t}`:`a ${t}`}r(b,"optionKindPhrase");function x(n){return/^(true|false|1|0|yes|no)$/i.test(n)}r(x,"isBooleanLiteral");function R(n){return n.startsWith("-")&&n!=="-"}r(R,"isOptionLike");function S(n){return/^-\d+(?:\.\d+)?$/.test(n)}r(S,"isNegativeNumber");function V(n,t){let o=n?$(n):null;for(let i of Object.keys(t))if(!O(n,i)){let e=l(i),u=o?` for ${o.name}`:"";throw new a(`unknown option --${e}${u}`)}}r(V,"validateCommandOptions");export{a,k as b};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{a as I}from"./chunk-P4QM63L3.js";import{v as P}from"./chunk-ZY32SZ2P.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as s}from"./chunk-FTQLQJQV.js";var se=2,le="application/vnd.openpond.training+json;version=2",x="application/vnd.openpond.model-project+json;version=2",ce=1048576,de=67108864,ue=8388608,b=524288,E=8388608,c=class extends Error{static{s(this,"OpenPondProtocolError")}code;constructor(t,n){super(n),this.name="OpenPondProtocolError",this.code=t}};function h(t){return JSON.stringify(w(t))}s(h,"canonicalJson");function B(t){return new TextEncoder().encode(h(t)).byteLength}s(B,"canonicalJsonByteLength");async function _(t){let n=new TextEncoder().encode(h(t)),o=await globalThis.crypto.subtle.digest("SHA-256",n);return Array.from(new Uint8Array(o),a=>a.toString(16).padStart(2,"0")).join("")}s(_,"canonicalSha256");function M(t,n,o){let a=B(t);if(a>n)throw new c("payload_too_large",`${o} is ${a} bytes; the maximum is ${n} bytes.`)}s(M,"assertCanonicalPayloadSize");function T(t,n,o){let a=new TextEncoder().encode(t).byteLength;if(a>n)throw new c("response_too_large",`${o} is ${a} bytes; the maximum is ${n} bytes.`);try{return JSON.parse(t)}catch{throw new c("invalid_json",`${o} was not valid JSON.`)}}s(T,"parseBoundedJson");async function C(t,n,o){let a=t.body?.getReader();if(!a)return T("",n,o);let r=new TextDecoder,l=0,m="";try{for(;;){let d=await a.read();if(d.done)break;if(l+=d.value.byteLength,l>n)throw new c("response_too_large",`${o} exceeds the maximum of ${n} bytes.`);m+=r.decode(d.value,{stream:!0})}return m+=r.decode(),T(m,n,o)}catch(d){try{await a.cancel()}catch{}throw d}finally{try{a.releaseLock()}catch{}}}s(C,"readBoundedJsonResponse");function w(t){if(t===null||typeof t=="string"||typeof t=="boolean")return t;if(typeof t=="number"){if(!Number.isFinite(t))throw new c("non_json_value","Canonical JSON cannot contain a non-finite number.");return Object.is(t,-0)?0:t}if(Array.isArray(t))return t.map(n=>w(n));if(typeof t=="object"){let n=Object.getPrototypeOf(t);if(n!==Object.prototype&&n!==null)throw new c("non_json_value","Canonical JSON accepts only plain objects.");let o=Object.create(null);for(let a of Object.keys(t).sort()){let r=t[a];if(r===void 0||typeof r=="function"||typeof r=="symbol")throw new c("non_json_value",`Canonical JSON cannot contain ${typeof r} at ${a}.`);o[a]=w(r)}return o}throw new c("non_json_value",`Canonical JSON cannot contain ${typeof t}.`)}s(w,"normalizeCanonicalJson");var g=e.string().trim().min(1).max(191),j=e.string().regex(/^[a-f0-9]{64}$/),L=e.string().min(1).max(191).regex(/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/),G=e.discriminatedUnion("mode",[e.object({mode:e.literal("automatic"),objective:e.enum(["balanced","fast","economical"]),gpuCount:e.union([e.literal(1),e.literal(2)]).optional()}).strict(),e.object({mode:e.literal("manual"),availabilityId:g,gpuType:e.string().trim().min(1).max(256),gpuCount:e.union([e.literal(1),e.literal(2)]).optional()}).strict()]),_e=e.object({estimateId:g,inputHash:j,requestHash:j,pricingVersion:g,expiresAt:e.string().datetime({offset:!0}),token:e.string().min(1).max(8192)}).strict(),$=e.object({teamId:g,modelId:e.string().trim().min(1).max(256),modelRevision:e.string().trim().min(1).max(256),tokenizerRevision:e.string().trim().min(1).max(256),chatTemplateHash:j,method:e.enum(["sft","grpo"]),loraRank:e.number().int().min(1).max(256),gpuCount:e.union([e.literal(1),e.literal(2)])}).strict(),V=e.object({query:$,requestHash:j,qualification:e.enum(["requires_preparation","unsupported"]),reason:e.enum(["model_not_supported","lora_rank_not_supported","gpu_count_not_qualified","provider_not_supported"]).nullable(),provider:e.object({accountScopeId:g,product:e.literal("POD"),cloud:e.literal("SECURE"),countryCodes:e.array(e.string().regex(/^[A-Z]{2}$/)).min(1).max(300),cudaVersions:e.array(e.string().regex(/^\d+\.\d+$/)).min(1).max(100),dataCenterId:g.nullable(),minimumDiskGb:e.number().int().positive(),priceBasis:e.literal("provider_catalog_per_gpu_rate_times_count")}).strict().nullable()}).strict(),z=e.object({schemaVersion:e.literal("openpond.trainingGpuCatalog.v1"),observedAt:e.string().datetime({offset:!0}),expiresAt:e.string().datetime({offset:!0}),workerImageDigest:e.string().regex(/^sha256:[a-f0-9]{64}$/),supportedLoraRanks:e.array(e.number().int().positive()),pricingBasis:e.enum(["accepted_compute_and_disk_hourly_before_credits","provider_catalog_compute_and_disk_before_credits"]),scope:V.optional(),offerings:e.array(e.object({availabilityId:g,gpuType:e.string().min(1).max(256),provider:L,region:e.string().min(1),dataCenterId:e.string().nullable(),gpuCount:e.number().int().positive(),gpuMemoryGb:e.number().positive(),stockStatus:e.enum(["High","Medium","Low"]),computeHourlyUsd:e.number().nonnegative(),diskHourlyUsd:e.number().nonnegative(),totalHourlyUsd:e.number().nonnegative()}).strict()).max(1e3)}).strict();async function Y(t,n){let o=z.parse(t);if(Date.parse(o.expiresAt)<=Date.parse(o.observedAt)||Date.parse(o.expiresAt)<=Date.now())throw new c("training_gpu_catalog_expired","Refresh GPU availability before reviewing this run.");if(!n){if(o.scope)throw new c("training_gpu_catalog_scope_mismatch","An overview read returned an unrequested workload.");return o}let a=o.scope;if(!a||o.pricingBasis!=="provider_catalog_compute_and_disk_before_credits"||h(a.query)!==h(n)||a.requestHash!==await _(n)||a.qualification==="unsupported"!=(a.reason!==null)||(a.qualification==="unsupported"?a.provider!==null||o.offerings.length>0:!a.provider)||new Set(o.offerings.map(r=>r.provider)).size>1||o.offerings.some(r=>r.gpuCount!==n.gpuCount||r.dataCenterId!==a.provider?.dataCenterId)||new Set(o.offerings.map(r=>r.availabilityId)).size!==o.offerings.length)throw new c("training_gpu_catalog_scope_mismatch","The GPU offers do not match this workspace and workload.");return o}s(Y,"parseAndVerifyTrainingGpuCatalog");function ye(t){return{async gpuCatalog(n){let o=n===void 0?void 0:$.parse(n),a=o?new URLSearchParams(Object.entries(o).map(([m,d])=>[m,String(d)])):null,r=await t(`/v1/training/gpu-catalog${a?`?${a}`:""}`),l=r&&typeof r=="object"&&"catalog"in r?r.catalog:r;return Y(l,o)}}}s(ye,"createTrainingGpuCatalogClient");var i=e.string().trim().min(1).max(500),p=e.string().regex(/^[a-f0-9]{64}$/),u=e.string().datetime({offset:!0}),f=e.object({id:i,contentHash:p}).strict(),R=f.extend({revision:e.number().int().positive()}).strict(),v=e.object({schemaVersion:e.literal("openpond.baseModelPreference.v1"),modelId:i,revision:e.string().trim().min(1).max(256).nullable(),tokenizerRevision:e.string().trim().min(1).max(256).nullable(),chatTemplateHash:e.string().trim().min(8).max(256).nullable(),modelAssetId:i.nullable(),source:e.enum(["managed","local","builtin"])}).strict(),H=e.enum(["sft","dpo","grpo","ppo","sdft","opd","opsd","sdpo"]),X=e.object({schemaVersion:e.string().regex(/^openpond\.[A-Za-z0-9]+Recipe\.v\d+$/),method:H,parameterization:e.enum(["lora","full"])}).catchall(e.unknown()),Z=e.object({profileProjectId:i,sourceRevision:e.string().regex(/^[a-f0-9]{40,64}$/),harnessRelease:f}).strict(),F=e.object({profileProjectId:i,sourceRevision:e.string().regex(/^[a-f0-9]{40,64}$/),catalogHash:p,definitionId:i,harnessRelease:f,tasksetRelease:f}).strict(),D=e.object({tasksetRef:R.nullable().default(null),evaluationTasksetRef:R.nullable().optional(),profileSource:Z.nullable().optional(),profileEvaluation:F.nullable().optional(),rewardBindingRef:R.nullable().optional(),tasksetRelease:f.nullable().default(null),harnessRelease:f.nullable().default(null),baseModel:v.nullable().default(null),method:H.nullable().default(null),destinationId:i.nullable().default(null),managedRolloutPlacement:e.enum(["local","remote"]).default("remote"),managedGpuPlacementObjective:e.enum(["fast","balanced","economical"]).default("balanced"),managedGpuSelection:G.optional(),continuationAdapterMode:e.enum(["residual_append","shared","sequential_merge"]).optional(),managedGpuRequirement:e.enum(["any","h100_hbm3"]).default("any"),runPreset:e.enum(["small","standard","custom","small_experiment"]).nullable().default(null),recipe:X.nullable().default(null),preferredMaximumSpendUsd:e.number().nonnegative().nullable().default(null),preferredRetentionDays:e.number().int().nonnegative().nullable().default(null)}).strict(),J=D,Q=e.object({schemaVersion:e.literal("openpond.hostedModelProjectLink.v1"),apiOrigin:e.string().url().refine(t=>new URL(t).origin===t,"Use a canonical API origin.").nullable().default(null),teamId:i,projectId:i,portableProjectId:i,revision:e.number().int().positive(),etag:p,syncedSourceRevision:e.number().int().positive(),syncedAt:u,tasksets:e.array(e.object({localTasksetId:i,localTasksetHash:p.nullable().default(null),releaseId:i,releaseRevision:e.number().int().positive(),releaseHash:p,packageHash:p.nullable().default(null),hostedTasksetId:i,syncedAt:u}).strict()).max(1e4).default([])}).strict(),K=e.object({localTasksetId:i,releaseId:i,releaseRevision:e.number().int().positive(),releaseHash:p,state:e.enum(["syncing","synced","sync_failed"]),hostedTasksetId:i.nullable().default(null),lastAttemptAt:u,syncedAt:u.nullable().default(null),lastError:e.string().trim().min(1).max(5e3).nullable().default(null)}).strict(),W=e.object({schemaVersion:e.literal("openpond.modelProject.v2"),id:i,profileId:i,revision:e.number().int().positive().default(1),name:e.string().trim().min(1).max(200),objective:e.string().trim().max(5e3).nullable(),defaultBaseModel:v.nullable(),defaultDestinationId:i.nullable(),trainingSetup:D,hosted:Q.nullable().default(null),tasksetSyncs:e.array(K).max(1e4).default([]),createdAt:u,updatedAt:u}).strict(),q=W.pick({id:!0,profileId:!0,name:!0,objective:!0,defaultBaseModel:!0,defaultDestinationId:!0,trainingSetup:!0}),ee=e.object({schemaVersion:e.literal("openpond.modelProjectSave.v1"),operationId:i,expectedRevision:e.number().int().nonnegative(),project:q,learning:I.optional()}).strict().superRefine((t,n)=>{t.learning&&t.expectedRevision!==0&&n.addIssue({code:"custom",path:["learning"],message:"Use learning settings to edit an existing Model's policy."})}),te=e.object({schemaVersion:e.literal("openpond.modelProjectConfigurationCheck.v1"),configurationHash:p,projectId:i,expectedRevision:e.number().int().nonnegative(),checkedAt:u,canSave:e.boolean(),deferred:e.array(e.enum(["base_model","taskset"])).max(2),findings:e.array(e.object({code:i,severity:e.enum(["error","warning"]),message:e.string().min(1).max(5e3),field:e.string().min(1).max(500).nullable()}).strict()).max(100)}).strict(),ne=e.object({id:i,name:e.string().min(1).max(500),available:e.boolean(),preference:v}).strict();async function Se(t){let n=S(t);return _({project:n.project,expectedRevision:n.expectedRevision,...n.learning?{learning:n.learning}:{}})}s(Se,"modelProjectConfigurationHash");function S(t){try{P(t,b)}catch{throw new U(400,{schemaVersion:"openpond.modelProjectApiError.v2",code:"model_configuration_json_invalid",message:"Model configuration must be bounded JSON data.",retryable:!1,requestId:null,details:{}})}return ee.parse(t)}s(S,"parseModelProjectSaveRequest");async function Pe(t,n,o){P(t,b);let a=q.parse(t);M(a,b,"Model configuration");let r=o?I.parse(o):void 0,l=await _({project:a,expectedRevision:n,...r?{learning:r}:{}});return S({schemaVersion:"openpond.modelProjectSave.v1",operationId:`model-save:${l}`,expectedRevision:n,project:a,...r?{learning:r}:{}})}s(Pe,"createModelProjectSaveRequest");var ae=e.object({schemaVersion:e.literal("openpond.hostedModelProjectSync.v2"),portableProjectId:i,name:e.string().trim().min(1).max(200),objective:e.string().trim().max(5e3).nullable(),defaultBaseModel:v.nullable(),defaultDestinationId:i.nullable(),trainingSetup:J,sourceRevision:e.number().int().positive(),sourceUpdatedAt:u,expectedEtag:p.nullable().default(null)}).strict(),y=e.object({id:i,teamId:i,portableProjectId:i,name:e.string().trim().min(1).max(200),objective:e.string().trim().max(5e3).nullable(),defaultBaseModel:v.nullable(),defaultDestinationId:i.nullable(),trainingSetup:J,sourceRevision:e.number().int().positive(),sourceUpdatedAt:u,revision:e.number().int().positive(),etag:p,createdAt:u,updatedAt:u}).strict(),re=e.object({kind:e.enum(["taskset_release","harness_release","dataset_release","evidence_set","model_version","reward_model_version","evaluation_receipt"]),ref:f,role:e.string().trim().min(1).max(200).nullable().default(null),updatedAt:u}).strict(),oe=e.object({project:y,resources:e.array(re).max(1e4),jobCount:e.number().int().nonnegative(),latestJobIds:e.array(i).max(100)}).strict(),ie=e.object({schemaVersion:e.literal("openpond.modelProjectApiError.v2"),code:e.string().trim().min(1).max(200),message:e.string().trim().min(1).max(5e3),retryable:e.boolean().default(!1),requestId:e.string().trim().min(1).max(500).nullable().default(null),details:e.record(e.string(),e.unknown()).default({})}).strict(),U=class extends Error{static{s(this,"OpenPondModelProjectApiError")}status;code;retryable;requestId;details;constructor(t,n){super(n.message),this.name="OpenPondModelProjectApiError",this.status=t,this.code=n.code,this.retryable=n.retryable,this.requestId=n.requestId,this.details=n.details}};function k(t){let n={};return new Headers(t).forEach((o,a)=>{n[a]=o}),n}s(k,"headersRecord");function Ie(t){let n=t.fetch??fetch,o=t.baseUrl.replace(/\/$/,"");async function a(r,l){let m=typeof t.headers=="function"?await t.headers():t.headers??{},d=await n(`${o}${r}`,{...l,headers:{accept:x,...l?.body?{"content-type":x}:{},...k(m),...k(l?.headers)}}),A=await C(d,E,"Model Project API response");if(!d.ok){let O=ie.safeParse(A);throw O.success?new U(d.status,O.data):new c("invalid_error_response",`Model Project request failed with HTTP ${d.status} and an invalid error envelope.`)}return A}return s(a,"request"),{async configurationCandidates(){return e.object({candidates:e.array(ne).max(1e3)}).strict().parse(await a("/v1/model-projects/configuration/candidates",{headers:{accept:"application/json"}})).candidates},async checkConfiguration(r){let l=S(r);return te.parse(await a("/v1/model-projects/configuration/check",{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(l)}))},async saveConfiguration(r){let l=S(r);return y.parse(await a("/v1/model-projects/configuration/save",{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(l)}))},async upsert(r){M(r,b,"Model Project sync");let l=ae.parse(r),m=await a(`/v1/model-projects/${encodeURIComponent(l.portableProjectId)}`,{method:"PUT",body:JSON.stringify(l)});return y.parse(N(m,"project"))},async list(){let r=await a("/v1/model-projects");return e.array(y).parse(N(r,"projects"))},async get(r){let l=await a(`/v1/model-projects/${encodeURIComponent(i.parse(r))}`);return oe.parse(l)}}}s(Ie,"createModelProjectsClient");function N(t,n){return!t||typeof t!="object"||Array.isArray(t)?t:n in t?t[n]:t}s(N,"unwrapObject");export{se as a,le as b,x as c,ce as d,de as e,ue as f,b as g,E as h,c as i,h as j,B as k,_ as l,M as m,T as n,C as o,G as p,_e as q,$ as r,V as s,z as t,Y as u,ye as v,f as w,R as x,v as y,H as z,X as A,Z as B,F as C,D,J as E,Q as F,K as G,W as H,q as I,ee as J,te as K,ne as L,Se as M,S as N,Pe as O,ae as P,y as Q,re as R,oe as S,ie as T,U,Ie as V};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as Ae}from"./chunk-GW766ZSO.js";import{B as O,a as Ce,b as Pe}from"./chunk-4TTXNVCE.js";import{b as be}from"./chunk-YU3C6U5V.js";import{d as H}from"./chunk-BJXPQIVD.js";import{a as re,b as ye,j as A}from"./chunk-6ESBAHWK.js";import{f as Ie}from"./chunk-VS3AMJEK.js";import{D as we}from"./chunk-2MEOUS24.js";import{n as $}from"./chunk-RCT3O3HQ.js";import{a as o}from"./chunk-FTQLQJQV.js";import{existsSync as z}from"node:fs";import{cp as xe,mkdir as Ee,readFile as Oe}from"node:fs/promises";import k from"node:path";import{existsSync as L}from"node:fs";import{readFile as K}from"node:fs/promises";import q from"node:path";async function F(e){await V(e.target);let t={},a=new Set([`${e.target.sourceRootRelativePath}/.openpond/agent-inspect.json`,`${e.target.sourceRootRelativePath}/.openpond/action-registry.json`,`${e.target.sourceRootRelativePath}/.openpond/eval-results.json`]),n=[{name:"inspect",command:"inspect",args:["--json"]},{name:"build",command:"build"},{name:"validate",command:"validate",args:["--json"]},{name:"eval",command:"eval",args:["--json"]},{name:"direct-run",command:"run",args:[e.target.defaultAction,"--json","--input",JSON.stringify({prompt:e.snapshot.objective,channel:"openpond_chat"})]}];for(let r of n){let s=await O({cwd:e.target.sourceRoot,command:r.command,args:r.args,...r.command==="eval"&&e.requireEvalPass===!1?{throwOnFailure:!1}:{}});if(s.code!==0&&!(r.command==="eval"&&e.requireEvalPass===!1))throw new Error(s.stderr.trim()||s.stdout.trim()||`${r.command} failed with exit code ${s.code??"unknown"}`);let i=lt(s.stdout),d=mt(i);d&&a.add(q.join(e.target.sourceRootRelativePath,d)),t[r.name]={summary:pt(r.name,i),traceArtifactRef:d,stdout:s.stdout.trim().slice(0,4e3),stderr:s.stderr.trim().slice(0,4e3)}}return await dt(e.target,e.requireEvalPass!==!1),{checkRefs:[...a],metadata:t}}o(F,"runLocalCreatePipelineChecks");async function V(e){if(!L(e.sourceRoot))throw new Error(`Codex did not create the expected agent source root: ${e.sourceRoot}`);let t=q.join(e.sourceRoot,"agent","agent.ts");if(!L(t))throw new Error(`Codex did not create the expected SDK agent source: ${t}`);let a=q.join(e.repoPath,"openpond-profile.json");if(!L(a))throw new Error(`Codex did not update the profile repo manifest: ${a}`);let n=q.join(e.sourcePath,"settings","profile.yaml");if(!L(n))throw new Error(`Codex did not update the profile manifest: ${n}`);let s=JSON.parse(await K(a,"utf8")).profiles?.[e.activeProfile];if(!s)throw new Error(`openpond-profile.json does not register profile ${e.activeProfile}.`);if(!s.enabledAgents?.includes(e.agentId))throw new Error(`openpond-profile.json does not enable generated agent ${e.agentId}.`);let i=await K(n,"utf8");if(!i.includes(`id: ${e.agentId}`)&&!i.includes(`id: "${e.agentId}"`))throw new Error(`settings/profile.yaml does not register generated agent ${e.agentId}.`);let d=e.agentId==="default"?["agent/agent.ts","agent"]:[`agents/${e.agentId}`];if(!d.some(u=>i.includes(u)))throw new Error(`settings/profile.yaml does not point ${e.agentId} at ${d[0]}.`)}o(V,"assertLocalCreateSourceLayout");async function dt(e,t=!0){let a=q.join(e.sourceRoot,".openpond","action-registry.json"),n=q.join(e.sourceRoot,".openpond","eval-results.json");if(!L(a))throw new Error(`Generated source did not produce an action registry: ${a}`);if(!L(n))throw new Error(`Generated source did not produce eval results: ${n}`);let r=JSON.parse(await K(a,"utf8")),s=Array.isArray(r.actions)?r.actions:[];if(!new Set(s.map(c=>typeof c.id=="string"?c.id:null).filter(c=>!!c)).has(e.defaultAction))throw new Error(`Generated action registry does not expose default action ${e.defaultAction}.`);let d=s.filter(c=>typeof c.id=="string"&&(!W(c.label)||!W(c.description)||typeof c.timeoutSeconds!="number"));if(d.length>0)throw new Error(`Generated action registry has actions missing labels, descriptions, or timeout policies: ${d.map(c=>c.id).join(", ")}`);let u=Ce({actionCatalog:s.filter(c=>typeof c.id=="string").map(c=>({id:c.id,name:W(c.name),setupRequirements:ut(c.setupRequirements)??[]})),actionId:e.defaultAction});if(u.blockingRequirements.length>0)throw new Error(`Generated default action ${e.defaultAction} has unresolved required setup and cannot be ready_local: ${u.blockingRequirements.map(Pe).join("; ")}. Mark built-in/local fixture requirements ready or optional when they are satisfied, or leave the pipeline blocked until the setup is configured.`);let m=JSON.parse(await K(n,"utf8"));if(typeof m.summary?.total!="number"||m.summary.total<1)throw new Error("Generated source must define at least one deterministic SDK eval.");if(t&&m.summary.failed!==0)throw new Error("Generated source evals did not all pass.")}o(dt,"assertGeneratedSdkArtifacts");function lt(e){let t=e.trim();if(!t.startsWith("{")&&!t.startsWith("["))return null;try{return JSON.parse(t)}catch{return null}}o(lt,"parseJsonOutput");function E(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}o(E,"asRecord");function ut(e){return Array.isArray(e)?e.filter(t=>!!E(t)):null}o(ut,"recordArray");function mt(e){let t=E(e),a=W(t?.traceArtifactRef);return a?.startsWith(".openpond/")?a:null}o(mt,"traceRefFromCommandResult");function pt(e,t){let a=E(t);return a?e==="inspect"?{actionCount:Array.isArray(a.actionCatalog)?a.actionCatalog.length:null,defaultAction:E(a.agent)?.defaultAction??null,projectName:E(a.project)?.name??null}:e==="validate"?{status:a.status??null,errors:E(a.summary)?.errors??null,warnings:E(a.summary)?.warnings??null}:e==="eval"?E(a.summary):e==="direct-run"?{hasResult:!!E(a.result),resultKeys:Object.keys(E(a.result)??{})}:null:null}o(pt,"summaryFromCommandResult");function W(e){return typeof e=="string"&&e.trim()?e.trim():null}o(W,"stringValue");var gt="Approved local Create plans require model-backed SDK source application; no source mutation was performed.",ft=1800*1e3,Te=".openpond-harness-source-application.json",ht=300*1e3,vt=2*1e3,Rt=5*1e3;async function He(e,t={}){if(!kt(e))return e;let a=t.now??(()=>new Date().toISOString()),n=e.adapter;if(n.kind!=="local")return e;if(!t.session||!t.turn||!t.ensureCodexRuntime||!t.appendRuntimeEvent||!t.setProviderTurnId)return Y(e,{now:a(),reason:gt,metadata:{reason:"model_backed_source_application_required",sourcePath:n.sourcePath??null,repoPath:n.repoPath??null,activeProfile:n.activeProfile??null,operation:e.operation,requestedAgentId:e.target.kind==="agent"?e.target.id:null}});let r;try{r=se(e)}catch(i){return Y(e,{now:a(),reason:i instanceof Error?i.message:String(i),metadata:{reason:"local_create_target_unresolved"}})}try{await ie({snapshot:e,session:t.session,turn:t.turn,target:r,ensureCodexRuntime:t.ensureCodexRuntime,appendRuntimeEvent:t.appendRuntimeEvent,setProviderTurnId:t.setProviderTurnId,model:t.model??we,codexReasoningEffort:t.codexReasoningEffort})}catch(i){return Y(e,{now:a(),reason:i instanceof Error?i.message:String(i),metadata:{reason:"model_backed_source_application_failed",target:r}})}let s=oe(e,{state:"running_checks",now:a(),blockedReason:null,sourceRefs:[r.sourceRootRelativePath,k.join(r.profileRelativePath,"settings","profile.yaml"),"openpond-profile.json"],metadata:{localCreatePipeline:{status:"running_checks",target:r}},candidates:[{id:Se(e.id),target:{kind:"agent",id:r.agentId,displayName:e.target.displayName,defaultActionKey:r.defaultAction},status:"checking",git:null,parentCandidateId:null,tasksetRef:e.tasksetRef,authoringModelRef:t.model??null,allowedPaths:e.plan?.sourcePlan.map(i=>i.path)??[],sourceRefs:[r.sourceRootRelativePath,k.join(r.profileRelativePath,"settings","profile.yaml"),"openpond-profile.json"],artifactRefs:[],checkRefs:[],evaluationReceiptRefs:[],createdAt:e.createdAt,updatedAt:a(),metadata:{sourceAuthority:e.adapter.sourceAuthority}}]});await t.onSnapshot?.(s);try{let i=await(t.runChecks??F)({snapshot:s,target:r}),d=a(),u=Se(e.id),m=`agent_eval_${e.id}`;return oe(s,{state:"ready_local",now:d,blockedReason:null,checkRefs:i.checkRefs,candidates:s.candidates.map(c=>c.id===u?{...c,status:"accepted",checkRefs:X(c.checkRefs,i.checkRefs),evaluationReceiptRefs:X(c.evaluationReceiptRefs,[m]),updatedAt:d}:c),evaluationReceipts:[...s.evaluationReceipts.filter(c=>c.id!==m),{id:m,candidateId:u,target:{kind:"agent",id:r.agentId,displayName:e.target.displayName,defaultActionKey:r.defaultAction},evaluatorKind:"agent_sdk",subject:"candidate",sourceCommit:e.adapter.kind==="local"?e.adapter.localHead:null,sourceBranch:null,tasksetId:e.tasksetRef?.id??null,tasksetHash:e.tasksetRef?.contentHash??null,taskAttemptRefs:i.checkRefs.filter(c=>c.includes("eval")),status:"passed",publishGate:"passed",summaryCounts:null,evalRefs:i.checkRefs.filter(c=>c.includes("eval")),artifactRefs:i.checkRefs,summary:wt(i.metadata),createdAt:d,metadata:i.metadata??{}}],metadata:{localCreatePipeline:{status:"ready_local",target:r,checks:i.metadata??{}}}})}catch(i){return Y(s,{now:a(),reason:i instanceof Error?i.message:String(i),metadata:{reason:"local_create_checks_failed",target:r}})}}o(He,"applyApprovedLocalCreateImproveRun");function kt(e){return e.state==="applying_source"&&e.plan?.status==="approved"&&e.adapter.kind==="local"&&e.target.kind==="agent"}o(kt,"shouldApplyLocalCreatePipeline");function oe(e,t){return A(e,{state:t.state,blockedReason:t.blockedReason===void 0?e.blockedReason:t.blockedReason,checkRefs:X(e.checkRefs,t.checkRefs??[]),sourceRefs:X(e.sourceRefs,t.sourceRefs??[]),candidates:t.candidates??e.candidates,evaluationReceipts:t.evaluationReceipts??e.evaluationReceipts,metadata:{...e.metadata,...t.metadata??{}},updatedAt:t.now})}o(oe,"transitionCreatePipeline");function Y(e,t){return oe(e,{state:"blocked",now:t.now,blockedReason:t.reason,metadata:{localCreatePipeline:{status:"blocked",...t.metadata}}})}o(Y,"blockLocalCreatePipeline");function X(e,t){return Array.from(new Set([...e,...t].filter(Boolean)))}o(X,"mergeRefs");function Se(e){return`agent_candidate_${e}`}o(Se,"agentCandidateId");function wt(e){let t=M(e?.eval),a=typeof t?.total=="number"?t.total:null;return a===null?"Agent SDK checks and deterministic Evals passed.":`${a} Agent SDK Eval${a===1?"":"s"} passed.`}o(wt,"checkSummary");function se(e){let t=e.adapter;if(t.kind!=="local")throw new Error("Create/Improve target must use the local adapter.");if(e.target.kind!=="agent")throw new Error("Local agent source application requires an Agent target.");let a=t.sourcePath?.trim(),n=t.repoPath?.trim();if(!a)throw new Error("Local Create approval is missing a profile source path.");if(!n)throw new Error("Local Create approval is missing a profile repo path.");let r=t.activeProfile?.trim()||"default",s=k.resolve(a),i=k.resolve(n),d=qe(e.target.id)??xt(e)??St(e.objective),u=Tt(Et(e.plan?.defaultChatAction.key)??"chat",d),m=e.operation==="improve"&&d==="default"?s:k.join(s,"agents",d);return{activeProfile:r,agentId:d,defaultAction:u,repoPath:i,sourcePath:s,workspaceRoot:i,profileRelativePath:je(k.relative(i,s)),sourceRoot:m,sourceRootRelativePath:je(k.relative(i,m))}}o(se,"resolveLocalCreatePipelineTarget");async function ie(e){if(!z(e.target.workspaceRoot))throw new Error(`Profile repo path does not exist: ${e.target.workspaceRoot}`);if(!z(e.target.sourcePath))throw new Error(`Profile source path does not exist: ${e.target.sourcePath}`);if(await Ct(e.snapshot,e.target)){await e.appendRuntimeEvent(H({sessionId:e.session.id,turnId:e.turn.id,name:"create_improve.updated",source:"server",appId:e.session.appId,status:"completed",output:`Applied prepared harness ${e.snapshot.operation==="improve"?"Improve":"Create"} source for ${e.target.agentId}; running local checks.`,data:{phase:"prepared_source_apply_completed",runId:e.snapshot.id,target:e.target}}));return}await e.appendRuntimeEvent(H({sessionId:e.session.id,turnId:e.turn.id,name:"create_improve.updated",source:"server",appId:e.session.appId,status:"started",output:`Applying approved ${e.snapshot.operation==="improve"?"Improve":"Create"} plan with Codex in ${e.target.sourceRootRelativePath}.`,data:{phase:"source_apply_started",runId:e.snapshot.id,target:e.target}}));let t={...e.session,provider:"codex",cwd:e.target.workspaceRoot,workspaceKind:"local_project",workspaceId:e.session.workspaceId??`openpond-profile:${e.target.activeProfile}`,workspaceName:e.session.workspaceName??`OpenPond profile ${e.target.activeProfile}`},a=e.session.provider==="codex"?e.model:null,n=await e.ensureCodexRuntime(t,{approvalPolicy:"never",sandbox:"workspace-write",model:a,codexPermissionMode:"auto-review",codexReasoningEffort:e.codexReasoningEffort}),r=await n.client.startTurn({threadId:n.threadId,prompt:At(e.snapshot,e.target),cwd:e.target.workspaceRoot,model:a,approvalPolicy:"never",sandbox:"workspace-write"});await e.setProviderTurnId(r.turnId);try{await n.client.waitForTurn(r.turnId,ft)}catch(s){if(!$e(s,r.turnId)&&!It(s))throw s;let i=$e(s,r.turnId)?"timed out":"exited cleanly before returning a turn completion";if(await e.appendRuntimeEvent(H({sessionId:e.session.id,turnId:e.turn.id,name:"create_improve.updated",source:"server",appId:e.session.appId,status:"started",output:`Codex source application ${i}; checking for completed generated source before blocking.`,data:{phase:"source_apply_recovery_started",runId:e.snapshot.id,providerTurnId:r.turnId,reason:i,target:e.target}})),!await yt(e.target))throw s;await e.appendRuntimeEvent(H({sessionId:e.session.id,turnId:e.turn.id,name:"create_improve.updated",source:"server",appId:e.session.appId,status:"completed",output:`Recovered completed ${e.snapshot.operation==="improve"?"Improve":"Create"} source after Codex source application ${i} for ${e.target.agentId}; running local checks.`,data:{phase:"source_apply_recovered",runId:e.snapshot.id,providerTurnId:r.turnId,reason:i,target:e.target}}))}await e.appendRuntimeEvent(H({sessionId:e.session.id,turnId:e.turn.id,name:"create_improve.updated",source:"provider",appId:e.session.appId,status:"completed",output:`Codex completed approved ${e.snapshot.operation==="improve"?"Improve":"Create"} source application for ${e.target.agentId}.`,data:{phase:"source_apply_completed",runId:e.snapshot.id,providerTurnId:r.turnId,target:e.target}}))}o(ie,"runModelBackedLocalCreateSourceApplication");async function Ct(e,t,a=process.env){if(!Ae(a))return!1;let n=k.join(t.workspaceRoot,Te);if(!z(n))return!1;let r=JSON.parse(await Oe(n,"utf8")),s=M(r);if(s?.schema!=="openpond.harnessPreparedSource.v1")throw new Error(`${Te} must use schema openpond.harnessPreparedSource.v1.`);let i=M(s.agents),d=M(i?.[t.agentId]),u=Pt(d?.[e.operation]);if(!u)return!1;let m=ne(t.workspaceRoot,u.source,"source");if(!z(m))throw new Error(`Prepared harness source does not exist: ${u.source}`);await Ee(t.sourceRoot,{recursive:!0}),await xe(m,t.sourceRoot,{recursive:!0,force:!0});for(let c of u.registrations??[]){let g=ne(t.workspaceRoot,c.source,"registration source"),l=ne(t.workspaceRoot,c.target,"registration target");if(!z(g))throw new Error(`Prepared harness registration source does not exist: ${c.source}`);await Ee(k.dirname(l),{recursive:!0}),await xe(g,l,{force:!0})}return!0}o(Ct,"applyPreparedHarnessSourceApplication");function Pt(e){let t=M(e);if(!t||typeof t.source!="string"||!t.source.trim())return null;if(t.registrations!==void 0&&!Array.isArray(t.registrations))throw new Error("Prepared harness source registrations must be an array.");let a=(t.registrations??[]).map(n=>{let r=M(n);if(!r||typeof r.source!="string"||!r.source.trim()||typeof r.target!="string"||!r.target.trim())throw new Error("Prepared harness source registrations require source and target paths.");return{source:r.source,target:r.target}});return{source:t.source,registrations:a}}o(Pt,"asHarnessPreparedSourceOperation");function ne(e,t,a){if(k.isAbsolute(t))throw new Error(`Prepared harness ${a} must be relative to the profile repo.`);let n=k.resolve(e),r=k.resolve(n,t);if(r!==n&&!r.startsWith(`${n}${k.sep}`))throw new Error(`Prepared harness ${a} must stay inside the profile repo.`);return r}o(ne,"resolveHarnessManifestPath");function $e(e,t){return(e instanceof Error?e.message:String(e))===`codex turn ${t} timed out`}o($e,"isCodexTurnTimeoutError");function It(e){return(e instanceof Error?e.message:String(e)).startsWith("codex app-server exited with code 0")}o(It,"isCodexAppServerCleanExitError");async function yt(e){let t=Date.now()+ht;for(;Date.now()<t;){if(await bt(e))return!0;await Le(vt)}return!1}o(yt,"waitForTimedOutSourceApplication");async function bt(e){try{await V(e);let t=await _e(e);await Le(Rt),await V(e);let a=await _e(e);return t===a}catch{return!1}}o(bt,"localCreateSourceLayoutIsStable");async function _e(e){let t=[k.join(e.sourceRoot,"agent","agent.ts"),k.join(e.sourceRoot,"package.json"),k.join(e.repoPath,"openpond-profile.json"),k.join(e.sourcePath,"settings","profile.yaml")];return(await Promise.all(t.map(async n=>{let r=await Oe(n,"utf8");return`${n}:${r.length}:${r}`}))).join(`
2
+ import{a as Ae}from"./chunk-GW766ZSO.js";import{B as O,a as Ce,b as Pe}from"./chunk-OFJPOTES.js";import{b as be}from"./chunk-YU3C6U5V.js";import{d as H}from"./chunk-U7D6Q744.js";import{a as re,b as ye,j as A}from"./chunk-6ESBAHWK.js";import{f as Ie}from"./chunk-JT5YQ52I.js";import{D as we}from"./chunk-2MEOUS24.js";import{n as $}from"./chunk-RCT3O3HQ.js";import{a as o}from"./chunk-FTQLQJQV.js";import{existsSync as z}from"node:fs";import{cp as xe,mkdir as Ee,readFile as Oe}from"node:fs/promises";import k from"node:path";import{existsSync as L}from"node:fs";import{readFile as K}from"node:fs/promises";import q from"node:path";async function F(e){await V(e.target);let t={},a=new Set([`${e.target.sourceRootRelativePath}/.openpond/agent-inspect.json`,`${e.target.sourceRootRelativePath}/.openpond/action-registry.json`,`${e.target.sourceRootRelativePath}/.openpond/eval-results.json`]),n=[{name:"inspect",command:"inspect",args:["--json"]},{name:"build",command:"build"},{name:"validate",command:"validate",args:["--json"]},{name:"eval",command:"eval",args:["--json"]},{name:"direct-run",command:"run",args:[e.target.defaultAction,"--json","--input",JSON.stringify({prompt:e.snapshot.objective,channel:"openpond_chat"})]}];for(let r of n){let s=await O({cwd:e.target.sourceRoot,command:r.command,args:r.args,...r.command==="eval"&&e.requireEvalPass===!1?{throwOnFailure:!1}:{}});if(s.code!==0&&!(r.command==="eval"&&e.requireEvalPass===!1))throw new Error(s.stderr.trim()||s.stdout.trim()||`${r.command} failed with exit code ${s.code??"unknown"}`);let i=lt(s.stdout),d=mt(i);d&&a.add(q.join(e.target.sourceRootRelativePath,d)),t[r.name]={summary:pt(r.name,i),traceArtifactRef:d,stdout:s.stdout.trim().slice(0,4e3),stderr:s.stderr.trim().slice(0,4e3)}}return await dt(e.target,e.requireEvalPass!==!1),{checkRefs:[...a],metadata:t}}o(F,"runLocalCreatePipelineChecks");async function V(e){if(!L(e.sourceRoot))throw new Error(`Codex did not create the expected agent source root: ${e.sourceRoot}`);let t=q.join(e.sourceRoot,"agent","agent.ts");if(!L(t))throw new Error(`Codex did not create the expected SDK agent source: ${t}`);let a=q.join(e.repoPath,"openpond-profile.json");if(!L(a))throw new Error(`Codex did not update the profile repo manifest: ${a}`);let n=q.join(e.sourcePath,"settings","profile.yaml");if(!L(n))throw new Error(`Codex did not update the profile manifest: ${n}`);let s=JSON.parse(await K(a,"utf8")).profiles?.[e.activeProfile];if(!s)throw new Error(`openpond-profile.json does not register profile ${e.activeProfile}.`);if(!s.enabledAgents?.includes(e.agentId))throw new Error(`openpond-profile.json does not enable generated agent ${e.agentId}.`);let i=await K(n,"utf8");if(!i.includes(`id: ${e.agentId}`)&&!i.includes(`id: "${e.agentId}"`))throw new Error(`settings/profile.yaml does not register generated agent ${e.agentId}.`);let d=e.agentId==="default"?["agent/agent.ts","agent"]:[`agents/${e.agentId}`];if(!d.some(u=>i.includes(u)))throw new Error(`settings/profile.yaml does not point ${e.agentId} at ${d[0]}.`)}o(V,"assertLocalCreateSourceLayout");async function dt(e,t=!0){let a=q.join(e.sourceRoot,".openpond","action-registry.json"),n=q.join(e.sourceRoot,".openpond","eval-results.json");if(!L(a))throw new Error(`Generated source did not produce an action registry: ${a}`);if(!L(n))throw new Error(`Generated source did not produce eval results: ${n}`);let r=JSON.parse(await K(a,"utf8")),s=Array.isArray(r.actions)?r.actions:[];if(!new Set(s.map(c=>typeof c.id=="string"?c.id:null).filter(c=>!!c)).has(e.defaultAction))throw new Error(`Generated action registry does not expose default action ${e.defaultAction}.`);let d=s.filter(c=>typeof c.id=="string"&&(!W(c.label)||!W(c.description)||typeof c.timeoutSeconds!="number"));if(d.length>0)throw new Error(`Generated action registry has actions missing labels, descriptions, or timeout policies: ${d.map(c=>c.id).join(", ")}`);let u=Ce({actionCatalog:s.filter(c=>typeof c.id=="string").map(c=>({id:c.id,name:W(c.name),setupRequirements:ut(c.setupRequirements)??[]})),actionId:e.defaultAction});if(u.blockingRequirements.length>0)throw new Error(`Generated default action ${e.defaultAction} has unresolved required setup and cannot be ready_local: ${u.blockingRequirements.map(Pe).join("; ")}. Mark built-in/local fixture requirements ready or optional when they are satisfied, or leave the pipeline blocked until the setup is configured.`);let m=JSON.parse(await K(n,"utf8"));if(typeof m.summary?.total!="number"||m.summary.total<1)throw new Error("Generated source must define at least one deterministic SDK eval.");if(t&&m.summary.failed!==0)throw new Error("Generated source evals did not all pass.")}o(dt,"assertGeneratedSdkArtifacts");function lt(e){let t=e.trim();if(!t.startsWith("{")&&!t.startsWith("["))return null;try{return JSON.parse(t)}catch{return null}}o(lt,"parseJsonOutput");function E(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}o(E,"asRecord");function ut(e){return Array.isArray(e)?e.filter(t=>!!E(t)):null}o(ut,"recordArray");function mt(e){let t=E(e),a=W(t?.traceArtifactRef);return a?.startsWith(".openpond/")?a:null}o(mt,"traceRefFromCommandResult");function pt(e,t){let a=E(t);return a?e==="inspect"?{actionCount:Array.isArray(a.actionCatalog)?a.actionCatalog.length:null,defaultAction:E(a.agent)?.defaultAction??null,projectName:E(a.project)?.name??null}:e==="validate"?{status:a.status??null,errors:E(a.summary)?.errors??null,warnings:E(a.summary)?.warnings??null}:e==="eval"?E(a.summary):e==="direct-run"?{hasResult:!!E(a.result),resultKeys:Object.keys(E(a.result)??{})}:null:null}o(pt,"summaryFromCommandResult");function W(e){return typeof e=="string"&&e.trim()?e.trim():null}o(W,"stringValue");var gt="Approved local Create plans require model-backed SDK source application; no source mutation was performed.",ft=1800*1e3,Te=".openpond-harness-source-application.json",ht=300*1e3,vt=2*1e3,Rt=5*1e3;async function He(e,t={}){if(!kt(e))return e;let a=t.now??(()=>new Date().toISOString()),n=e.adapter;if(n.kind!=="local")return e;if(!t.session||!t.turn||!t.ensureCodexRuntime||!t.appendRuntimeEvent||!t.setProviderTurnId)return Y(e,{now:a(),reason:gt,metadata:{reason:"model_backed_source_application_required",sourcePath:n.sourcePath??null,repoPath:n.repoPath??null,activeProfile:n.activeProfile??null,operation:e.operation,requestedAgentId:e.target.kind==="agent"?e.target.id:null}});let r;try{r=se(e)}catch(i){return Y(e,{now:a(),reason:i instanceof Error?i.message:String(i),metadata:{reason:"local_create_target_unresolved"}})}try{await ie({snapshot:e,session:t.session,turn:t.turn,target:r,ensureCodexRuntime:t.ensureCodexRuntime,appendRuntimeEvent:t.appendRuntimeEvent,setProviderTurnId:t.setProviderTurnId,model:t.model??we,codexReasoningEffort:t.codexReasoningEffort})}catch(i){return Y(e,{now:a(),reason:i instanceof Error?i.message:String(i),metadata:{reason:"model_backed_source_application_failed",target:r}})}let s=oe(e,{state:"running_checks",now:a(),blockedReason:null,sourceRefs:[r.sourceRootRelativePath,k.join(r.profileRelativePath,"settings","profile.yaml"),"openpond-profile.json"],metadata:{localCreatePipeline:{status:"running_checks",target:r}},candidates:[{id:Se(e.id),target:{kind:"agent",id:r.agentId,displayName:e.target.displayName,defaultActionKey:r.defaultAction},status:"checking",git:null,parentCandidateId:null,tasksetRef:e.tasksetRef,authoringModelRef:t.model??null,allowedPaths:e.plan?.sourcePlan.map(i=>i.path)??[],sourceRefs:[r.sourceRootRelativePath,k.join(r.profileRelativePath,"settings","profile.yaml"),"openpond-profile.json"],artifactRefs:[],checkRefs:[],evaluationReceiptRefs:[],createdAt:e.createdAt,updatedAt:a(),metadata:{sourceAuthority:e.adapter.sourceAuthority}}]});await t.onSnapshot?.(s);try{let i=await(t.runChecks??F)({snapshot:s,target:r}),d=a(),u=Se(e.id),m=`agent_eval_${e.id}`;return oe(s,{state:"ready_local",now:d,blockedReason:null,checkRefs:i.checkRefs,candidates:s.candidates.map(c=>c.id===u?{...c,status:"accepted",checkRefs:X(c.checkRefs,i.checkRefs),evaluationReceiptRefs:X(c.evaluationReceiptRefs,[m]),updatedAt:d}:c),evaluationReceipts:[...s.evaluationReceipts.filter(c=>c.id!==m),{id:m,candidateId:u,target:{kind:"agent",id:r.agentId,displayName:e.target.displayName,defaultActionKey:r.defaultAction},evaluatorKind:"agent_sdk",subject:"candidate",sourceCommit:e.adapter.kind==="local"?e.adapter.localHead:null,sourceBranch:null,tasksetId:e.tasksetRef?.id??null,tasksetHash:e.tasksetRef?.contentHash??null,taskAttemptRefs:i.checkRefs.filter(c=>c.includes("eval")),status:"passed",publishGate:"passed",summaryCounts:null,evalRefs:i.checkRefs.filter(c=>c.includes("eval")),artifactRefs:i.checkRefs,summary:wt(i.metadata),createdAt:d,metadata:i.metadata??{}}],metadata:{localCreatePipeline:{status:"ready_local",target:r,checks:i.metadata??{}}}})}catch(i){return Y(s,{now:a(),reason:i instanceof Error?i.message:String(i),metadata:{reason:"local_create_checks_failed",target:r}})}}o(He,"applyApprovedLocalCreateImproveRun");function kt(e){return e.state==="applying_source"&&e.plan?.status==="approved"&&e.adapter.kind==="local"&&e.target.kind==="agent"}o(kt,"shouldApplyLocalCreatePipeline");function oe(e,t){return A(e,{state:t.state,blockedReason:t.blockedReason===void 0?e.blockedReason:t.blockedReason,checkRefs:X(e.checkRefs,t.checkRefs??[]),sourceRefs:X(e.sourceRefs,t.sourceRefs??[]),candidates:t.candidates??e.candidates,evaluationReceipts:t.evaluationReceipts??e.evaluationReceipts,metadata:{...e.metadata,...t.metadata??{}},updatedAt:t.now})}o(oe,"transitionCreatePipeline");function Y(e,t){return oe(e,{state:"blocked",now:t.now,blockedReason:t.reason,metadata:{localCreatePipeline:{status:"blocked",...t.metadata}}})}o(Y,"blockLocalCreatePipeline");function X(e,t){return Array.from(new Set([...e,...t].filter(Boolean)))}o(X,"mergeRefs");function Se(e){return`agent_candidate_${e}`}o(Se,"agentCandidateId");function wt(e){let t=M(e?.eval),a=typeof t?.total=="number"?t.total:null;return a===null?"Agent SDK checks and deterministic Evals passed.":`${a} Agent SDK Eval${a===1?"":"s"} passed.`}o(wt,"checkSummary");function se(e){let t=e.adapter;if(t.kind!=="local")throw new Error("Create/Improve target must use the local adapter.");if(e.target.kind!=="agent")throw new Error("Local agent source application requires an Agent target.");let a=t.sourcePath?.trim(),n=t.repoPath?.trim();if(!a)throw new Error("Local Create approval is missing a profile source path.");if(!n)throw new Error("Local Create approval is missing a profile repo path.");let r=t.activeProfile?.trim()||"default",s=k.resolve(a),i=k.resolve(n),d=qe(e.target.id)??xt(e)??St(e.objective),u=Tt(Et(e.plan?.defaultChatAction.key)??"chat",d),m=e.operation==="improve"&&d==="default"?s:k.join(s,"agents",d);return{activeProfile:r,agentId:d,defaultAction:u,repoPath:i,sourcePath:s,workspaceRoot:i,profileRelativePath:je(k.relative(i,s)),sourceRoot:m,sourceRootRelativePath:je(k.relative(i,m))}}o(se,"resolveLocalCreatePipelineTarget");async function ie(e){if(!z(e.target.workspaceRoot))throw new Error(`Profile repo path does not exist: ${e.target.workspaceRoot}`);if(!z(e.target.sourcePath))throw new Error(`Profile source path does not exist: ${e.target.sourcePath}`);if(await Ct(e.snapshot,e.target)){await e.appendRuntimeEvent(H({sessionId:e.session.id,turnId:e.turn.id,name:"create_improve.updated",source:"server",appId:e.session.appId,status:"completed",output:`Applied prepared harness ${e.snapshot.operation==="improve"?"Improve":"Create"} source for ${e.target.agentId}; running local checks.`,data:{phase:"prepared_source_apply_completed",runId:e.snapshot.id,target:e.target}}));return}await e.appendRuntimeEvent(H({sessionId:e.session.id,turnId:e.turn.id,name:"create_improve.updated",source:"server",appId:e.session.appId,status:"started",output:`Applying approved ${e.snapshot.operation==="improve"?"Improve":"Create"} plan with Codex in ${e.target.sourceRootRelativePath}.`,data:{phase:"source_apply_started",runId:e.snapshot.id,target:e.target}}));let t={...e.session,provider:"codex",cwd:e.target.workspaceRoot,workspaceKind:"local_project",workspaceId:e.session.workspaceId??`openpond-profile:${e.target.activeProfile}`,workspaceName:e.session.workspaceName??`OpenPond profile ${e.target.activeProfile}`},a=e.session.provider==="codex"?e.model:null,n=await e.ensureCodexRuntime(t,{approvalPolicy:"never",sandbox:"workspace-write",model:a,codexPermissionMode:"auto-review",codexReasoningEffort:e.codexReasoningEffort}),r=await n.client.startTurn({threadId:n.threadId,prompt:At(e.snapshot,e.target),cwd:e.target.workspaceRoot,model:a,approvalPolicy:"never",sandbox:"workspace-write"});await e.setProviderTurnId(r.turnId);try{await n.client.waitForTurn(r.turnId,ft)}catch(s){if(!$e(s,r.turnId)&&!It(s))throw s;let i=$e(s,r.turnId)?"timed out":"exited cleanly before returning a turn completion";if(await e.appendRuntimeEvent(H({sessionId:e.session.id,turnId:e.turn.id,name:"create_improve.updated",source:"server",appId:e.session.appId,status:"started",output:`Codex source application ${i}; checking for completed generated source before blocking.`,data:{phase:"source_apply_recovery_started",runId:e.snapshot.id,providerTurnId:r.turnId,reason:i,target:e.target}})),!await yt(e.target))throw s;await e.appendRuntimeEvent(H({sessionId:e.session.id,turnId:e.turn.id,name:"create_improve.updated",source:"server",appId:e.session.appId,status:"completed",output:`Recovered completed ${e.snapshot.operation==="improve"?"Improve":"Create"} source after Codex source application ${i} for ${e.target.agentId}; running local checks.`,data:{phase:"source_apply_recovered",runId:e.snapshot.id,providerTurnId:r.turnId,reason:i,target:e.target}}))}await e.appendRuntimeEvent(H({sessionId:e.session.id,turnId:e.turn.id,name:"create_improve.updated",source:"provider",appId:e.session.appId,status:"completed",output:`Codex completed approved ${e.snapshot.operation==="improve"?"Improve":"Create"} source application for ${e.target.agentId}.`,data:{phase:"source_apply_completed",runId:e.snapshot.id,providerTurnId:r.turnId,target:e.target}}))}o(ie,"runModelBackedLocalCreateSourceApplication");async function Ct(e,t,a=process.env){if(!Ae(a))return!1;let n=k.join(t.workspaceRoot,Te);if(!z(n))return!1;let r=JSON.parse(await Oe(n,"utf8")),s=M(r);if(s?.schema!=="openpond.harnessPreparedSource.v1")throw new Error(`${Te} must use schema openpond.harnessPreparedSource.v1.`);let i=M(s.agents),d=M(i?.[t.agentId]),u=Pt(d?.[e.operation]);if(!u)return!1;let m=ne(t.workspaceRoot,u.source,"source");if(!z(m))throw new Error(`Prepared harness source does not exist: ${u.source}`);await Ee(t.sourceRoot,{recursive:!0}),await xe(m,t.sourceRoot,{recursive:!0,force:!0});for(let c of u.registrations??[]){let g=ne(t.workspaceRoot,c.source,"registration source"),l=ne(t.workspaceRoot,c.target,"registration target");if(!z(g))throw new Error(`Prepared harness registration source does not exist: ${c.source}`);await Ee(k.dirname(l),{recursive:!0}),await xe(g,l,{force:!0})}return!0}o(Ct,"applyPreparedHarnessSourceApplication");function Pt(e){let t=M(e);if(!t||typeof t.source!="string"||!t.source.trim())return null;if(t.registrations!==void 0&&!Array.isArray(t.registrations))throw new Error("Prepared harness source registrations must be an array.");let a=(t.registrations??[]).map(n=>{let r=M(n);if(!r||typeof r.source!="string"||!r.source.trim()||typeof r.target!="string"||!r.target.trim())throw new Error("Prepared harness source registrations require source and target paths.");return{source:r.source,target:r.target}});return{source:t.source,registrations:a}}o(Pt,"asHarnessPreparedSourceOperation");function ne(e,t,a){if(k.isAbsolute(t))throw new Error(`Prepared harness ${a} must be relative to the profile repo.`);let n=k.resolve(e),r=k.resolve(n,t);if(r!==n&&!r.startsWith(`${n}${k.sep}`))throw new Error(`Prepared harness ${a} must stay inside the profile repo.`);return r}o(ne,"resolveHarnessManifestPath");function $e(e,t){return(e instanceof Error?e.message:String(e))===`codex turn ${t} timed out`}o($e,"isCodexTurnTimeoutError");function It(e){return(e instanceof Error?e.message:String(e)).startsWith("codex app-server exited with code 0")}o(It,"isCodexAppServerCleanExitError");async function yt(e){let t=Date.now()+ht;for(;Date.now()<t;){if(await bt(e))return!0;await Le(vt)}return!1}o(yt,"waitForTimedOutSourceApplication");async function bt(e){try{await V(e);let t=await _e(e);await Le(Rt),await V(e);let a=await _e(e);return t===a}catch{return!1}}o(bt,"localCreateSourceLayoutIsStable");async function _e(e){let t=[k.join(e.sourceRoot,"agent","agent.ts"),k.join(e.sourceRoot,"package.json"),k.join(e.repoPath,"openpond-profile.json"),k.join(e.sourcePath,"settings","profile.yaml")];return(await Promise.all(t.map(async n=>{let r=await Oe(n,"utf8");return`${n}:${r.length}:${r}`}))).join(`
3
3
  ---
4
4
  `)}o(_e,"sourceLayoutFingerprint");function Le(e){return new Promise(t=>setTimeout(t,e))}o(Le,"sleep");function At(e,t){return[`Apply this already-approved OpenPond ${e.operation==="improve"?"Improve":"Create"} plan by editing the local profile repo source.`,"","This is the source-materialization step, not another plan review. Make the file changes, inspect the existing profile shape first, and leave the repo with a valid openpond-agent-sdk source project.","","Hard requirements:",`- Current working directory is the profile repo root: ${t.workspaceRoot}`,`- Active profile source path relative to cwd: ${t.profileRelativePath}`,`- Target agent id: ${t.agentId}`,`- Target generated source root: ${t.sourceRootRelativePath}`,`- Default action to expose: ${t.defaultAction}`,`- For a create request, create the new SDK project under ${t.profileRelativePath}/agents/<agent-id>; do not overwrite ${t.profileRelativePath}/agent/agent.ts or unrelated existing agents.`,"- For an edit request, only edit the approved target agent source and shared profile registration files required for that edit.",`- Update openpond-profile.json and ${t.profileRelativePath}/settings/profile.yaml so the generated agent is registered, enabled, and catalog-discoverable.`,"- The generated source must be an actual openpond-agent-sdk project with package.json, tsconfig.json when needed, agent/agent.ts, deterministic evals, and action metadata.","- Preserve the approved objective and any captured conversation context in source metadata, instructions, fixture comments, or eval intent so source readback can prove what was captured.","- Treat plan.metadata.actionShape as the approved public action-shape decision when actionShapeDecisionSource is request_metadata or another explicit planner source.","- If plan.metadata.actionShapeDecisionSource is default_chat_fallback, use the approved objective and captured context to choose the actual generated public actions: keep chat-only for conversational assistants, create direct actions for explicit repeatable runs/workflows/artifact transforms, and expose both when the user needs normal chat plus a repeatable catalog action.","- When refining a default fallback during source materialization, encode the chosen public actions in generated SDK action metadata and evals; do not use business-example hardcoding.","- Every public action must have a stable action id, label, description, input/output schema when useful, timeout policy, artifact policy, setup requirement metadata, and deterministic eval coverage.","- The default action must be invocable through the local profile setup gate after checks. Do not leave built-in openpond_chat or committed local fixture/artifact requirements as unresolved required setup; mark those rows ready/satisfied or optional when the generated source already provides them.","- If the approved objective names multiple capabilities or direct action ids, implement each requested public action instead of collapsing everything into a single chat-only action.","- If a capability writes an artifact, declare it in the action artifact policy and assert it from at least one eval.","- Package scripts must be portable from the generated source root; do not hardcode absolute machine-local paths to this repository or CLI.","- Do not hardcode secrets, API keys, provider tokens, or user credentials in source, evals, traces, fixtures, or comments.","- Use realistic deterministic fixture-backed behavior when external systems are unavailable. Declare setup requirements rather than pretending live integrations exist.","- Run or prepare the source so these commands can pass from the target source root: inspect, build, validate, eval, and run of the default action.","","Approved Create request and plan:",JSON.stringify({run:e,plan:e.plan,questions:e.questions,workflowCapture:e.workflowCapture},null,2)].join(`
5
5
  `)}o(At,"localCreatePipelinePrompt");function xt(e){for(let t of e.plan?.sourcePlan??[]){let a=/^agents\/([^/]+)/.exec(t.path),n=qe(a?.[1]);if(n)return n}return null}o(xt,"agentIdFromSourcePlan");function qe(e){let t=e?.trim();return t&&t.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||null}o(qe,"normalizeAgentId");function Et(e){return e?.trim()||null}o(Et,"normalizeActionId");function M(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}o(M,"asRecord");function Tt(e,t){let a=`${t}.`;return e.startsWith(a)?e.slice(a.length)||"chat":e}o(Tt,"sourceActionIdForAgent");function St(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64).replace(/-+$/g,"")||"generated-agent"}o(St,"slugFromObjective");function je(e){return e.replace(/\\/g,"/")||"."}o(je,"normalizeRelativePath");import de from"node:path";function Pa(e){let t=e.sources.length?e.sources.map(r=>({kind:"conversation",id:r.id,sourceHash:r.sourceHash,excerptRef:`training-source:${r.id}`})):[{kind:"manual_intent",id:`manual_intent_${$(e.objective).slice(0,24)}`,sourceHash:$({objective:e.objective}),excerptRef:null}],a={consent:{status:"granted",scope:e.sources.length?"selected_turns":"direct_intent",reviewedBy:"local_user",reviewedAt:e.timestamp},sources:t,reviewerIntent:e.objective},n=$(a);return re.parse({schemaVersion:"openpond.createImprove.evidenceSnapshot.v1",id:`evidence_snapshot_${n.slice(0,24)}`,contentHash:n,...a,createdAt:e.timestamp,metadata:{immutable:!0,sourceCount:t.length}})}o(Pa,"createEvidenceSnapshot");function Ia(e){let t={runId:e.run.id,candidateId:e.candidateId,tasksetId:e.run.tasksetRef?.id??null,tasksetRevision:e.run.tasksetRef?.revision??null,tasksetHash:e.run.tasksetRef?.contentHash??null,outcome:e.outcome,reason:e.reason,receiptRefs:e.receiptRefs},a=$(t);return re.parse({schemaVersion:"openpond.createImprove.evidenceSnapshot.v1",id:`evidence_outcome_${a.slice(0,24)}`,contentHash:a,consent:{status:"granted",scope:"direct_intent",reviewedBy:e.run.actor.id??"local_user",reviewedAt:e.timestamp},sources:[{kind:"artifact",id:`${e.outcome}:${e.run.id}:${e.candidateId}`,sourceHash:a,excerptRef:e.receiptRefs[0]??null}],reviewerIntent:e.reason,createdAt:e.timestamp,metadata:{immutable:!0,evidenceKind:"candidate_outcome",outcome:e.outcome,priorTasksetRevision:e.run.tasksetRef?.revision??null,recommendedNextTasksetRevision:e.run.tasksetRef?e.run.tasksetRef.revision+1:1,receiptRefs:e.receiptRefs}})}o(Ia,"createOutcomeEvidenceSnapshot");function ya(e){let t=e.proposal?$t(e.proposal):{kind:"model",rationale:["A reviewed training plan selected Model execution for this Taskset."],confidence:1};return ye.parse({schemaVersion:"openpond.createImprove.tasksetRef.v1",id:e.taskset.id,revision:e.taskset.revision,contentHash:e.taskset.contentHash,evidenceSnapshotIds:e.evidenceSnapshotIds,policyBoundary:e.taskset.policy,targetRecommendation:t,authoringSplitRefs:e.taskset.tasks.filter(a=>a.split==="train"||a.split==="validation").map(a=>a.id),privateSplitRefs:e.taskset.tasks.filter(a=>a.split==="test"||a.split==="frozen_eval").map(a=>a.id),approvedBy:"local_user",approvedAt:e.approvedAt,metadata:{immutable:!0,taskCreationProposalId:e.proposal?.id??null}})}o(ya,"createTasksetRef");function Me(e,t){if(e.id!==t.id||e.revision!==t.revision||e.contentHash!==t.contentHash)throw new Error(`Taskset lineage mismatch: the run approved ${e.id}@${e.revision} (${e.contentHash}), but execution resolved ${t.id}@${t.revision} (${t.contentHash}).`)}o(Me,"assertTasksetRefMatches");function $t(e){let t=_t(e);return{kind:t,rationale:e.diagnosis.rationale.length?e.diagnosis.rationale:[`${t} best matches the reviewed behavior boundary.`],confidence:e.diagnosis.confidence}}o($t,"recommendationForProposal");function _t(e){return e.diagnosis.trainingEligible?"model":e.diagnosis.intervention==="retrieval"?"configuration":"agent"}o(_t,"targetKindForProposal");async function Ge(e){let t=e.run.tasksetRef;if(!t)throw new Error("Agent Taskset execution requires an approved Taskset ref.");if(Me(t,e.taskset),e.taskset.environment.kind!=="agent")throw new Error(`Taskset ${e.taskset.id} is not an Agent-shaped Taskset.`);let a=new Set(t.privateSplitRefs),n=e.taskset.tasks.filter(c=>a.has(c.id));if(!n.length||n.length!==a.size)throw new Error("The approved Agent Taskset private split could not be resolved exactly.");let r={tasksetId:t.id,tasksetRevision:t.revision,tasksetHash:t.contentHash,taskRefs:n.map(c=>c.id),seed:0,timeoutMs:e.taskset.environment.defaultTimeoutMs,entrypoint:e.taskset.environment.entrypoint,evaluator:"openpond-agent-sdk-taskset.v1"},s=$(r),i=[],d=[],u=[];for(let c of n){let g=new Date().toISOString(),l=Date.now(),p=await(e.execute??O)({cwd:e.cwd,command:"run",args:[e.taskset.environment.entrypoint,"--json","--input",JSON.stringify({...c.input,channel:"manual"})],timeoutMs:e.taskset.environment.defaultTimeoutMs,throwOnFailure:!1}),x=p.code===0?jt(p.stdout):null,b=`agent_task_attempt_${$([e.run.id,e.subject,e.sourceCommit,t.contentHash,c.id,0]).slice(0,24)}`,f=Ot(x?.traceArtifactRef),P=Ie.parse({schemaVersion:"openpond.taskAttempt.v1",id:b,tasksetId:e.taskset.id,taskId:c.id,split:c.split,attempt:0,seed:0,modelRef:null,startedAt:g,completedAt:new Date().toISOString(),output:ce(x?.result),runtimeEventRefs:f?[f]:[],artifactRefs:f?[f]:[],privilegedOutcomeRef:c.privilegedContextRef,infrastructureError:p.code===0?null:p.stderr.trim().slice(0,1e4)||`Agent SDK action exited with code ${String(p.code)}.`,costUsd:0,latencyMs:Math.max(0,Date.now()-l),userInterventions:0,metadata:{executor:"openpond-agent-sdk",trustedTasksetExecution:!0,tasksetRevision:t.revision,tasksetHash:t.contentHash,sourceCommit:e.sourceCommit,subject:e.subject,executionContractHash:s}}),R=await e.gradeAttempt({tasksetId:e.taskset.id,taskId:c.id,attempt:P});d.push(P.id),i.push(R),f&&u.push(f)}let m=i.filter(c=>c.passed).length;return{taskAttemptRefs:d,gradeRefs:i.map(c=>c.id),taskRefs:n.map(c=>c.id),artifactRefs:[...new Set(u)],total:i.length,passed:m,failed:i.length-m,executionContractHash:s}}o(Ge,"executeAgentTasksetEvaluation");function jt(e){let t=e.trim();if(!t)return null;try{return ce(JSON.parse(t))}catch{let a=t.indexOf("{"),n=t.lastIndexOf("}");if(a<0||n<=a)return null;try{return ce(JSON.parse(t.slice(a,n+1)))}catch{return null}}}o(jt,"parseAgentRunPayload");function ce(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}o(ce,"recordValue");function Ot(e){return typeof e=="string"&&e.trim()?e.trim():null}o(Ot,"stringValue");async function le(e){let t=await(e.execute??O)({cwd:e.cwd,command:"eval",args:["--json"],throwOnFailure:!1}),a=qt(t.stdout),n=G(a.summary?.total)??0,r=G(a.summary?.passed)??0,s=G(a.summary?.failed)??Math.max(0,n-r),i=a.publishGate?.status==="passed"?"passed":"failed",d=Array.isArray(a.results)?a.results:[],u=d.map(R=>I(R.name)).filter(R=>!!R),m=new Set([de.posix.join(e.sourceRef,".openpond/eval-results.json")]);for(let R of d){let _=I(R.traceArtifactRef);_&&m.add(de.posix.join(e.sourceRef,Ne(_)));for(let J of De(R.artifacts))m.add(de.posix.join(e.sourceRef,Ne(J)))}let c=e.run.tasksetRef?await Ge({run:e.run,taskset:Ht(e.taskset),cwd:e.cwd,sourceCommit:e.sourceCommit,subject:e.subject,gradeAttempt:Lt(e.gradeAttempt),execute:e.execute}):null;for(let R of c?.artifactRefs??[])m.add(R);let g=n+(c?.total??0),l=r+(c?.passed??0),p=s+(c?.failed??0),x=[...new Set([...u,...c?.taskRefs??[]])],b=i==="passed"&&(c?.failed??0)===0?"passed":"failed",f=t.code===0&&p===0&&b==="passed"?"passed":"failed",P=e.timestamp??new Date().toISOString();return{id:`agent_eval_${e.run.id}_${e.subject}_${e.sourceCommit.slice(0,12)}`,candidateId:e.candidateId,target:e.run.target,evaluatorKind:"agent_sdk",subject:e.subject,sourceCommit:e.sourceCommit,sourceBranch:e.sourceBranch,tasksetId:e.run.tasksetRef?.id??null,tasksetHash:e.run.tasksetRef?.contentHash??null,taskAttemptRefs:c?.taskAttemptRefs??u,status:f,publishGate:b,summaryCounts:{total:g,passed:l,failed:p},evalRefs:x,artifactRefs:[...m],summary:`${e.subject==="active"?"Active":e.subject==="candidate"?"Candidate":"Post-release"} Agent SDK and Taskset Evals: ${l}/${g} passed${b==="failed"?"; publish gate failed":""}.`,createdAt:P,metadata:{schemaVersion:I(a.schemaVersion),schema:I(a.schema),project:{name:I(a.project?.name),version:I(a.project?.version)},source:{configPath:I(a.source?.configPath),configHash:I(a.source?.configHash)},publishGate:{total:G(a.publishGate?.total),passed:G(a.publishGate?.passed),failed:G(a.publishGate?.failed),blockingFailures:De(a.publishGate?.blockingFailures)},command:{code:t.code,timedOut:t.timedOut,stderr:t.stderr.trim().slice(0,4e3)},trustedTasksetExecution:!!c,tasksetRevision:e.run.tasksetRef?.revision??null,executionContractHash:c?.executionContractHash??null,gradeRefs:c?.gradeRefs??[],results:d.map(R=>({name:I(R.name),status:I(R.status),error:I(R.error),traceArtifactRef:I(R.traceArtifactRef)}))}}}o(le,"runNormalizedAgentEvaluation");function Ht(e){if(!e)throw new Error("The approved Agent Taskset could not be resolved for evaluation.");return e}o(Ht,"requireTaskset");function Lt(e){if(!e)throw new Error("Trusted Taskset grading is unavailable for Agent evaluation.");return e}o(Lt,"requireGradeAttempt");function qt(e){let t=e.trim();if(!t)throw new Error("Agent SDK Eval returned no JSON output.");try{return JSON.parse(t)}catch{let a=t.indexOf("{"),n=t.lastIndexOf("}");if(a>=0&&n>a)try{return JSON.parse(t.slice(a,n+1))}catch{}throw new Error("Agent SDK Eval returned invalid JSON output.")}}o(qt,"parseAgentEvalPayload");function Ne(e){return e.replace(/^\.\//,"").replaceAll("\\","/")}o(Ne,"normalizeRef");function I(e){return typeof e=="string"&&e.trim()?e.trim():null}o(I,"stringValue");function G(e){return typeof e=="number"&&Number.isFinite(e)?e:null}o(G,"numberValue");function De(e){return Array.isArray(e)?e.map(I).filter(t=>!!t):[]}o(De,"stringArray");import{existsSync as Z}from"node:fs";import{mkdir as Xe,realpath as Qe,rm as he,writeFile as Ft}from"node:fs/promises";import Ze from"node:os";import S from"node:path";import{existsSync as ue}from"node:fs";import{cp as Mt,lstat as Gt,mkdir as Be,rm as Nt,symlink as Dt,writeFile as Bt}from"node:fs/promises";import w from"node:path";function Ue(e,t){let a=C(t.profileRelativePath),n=[C(t.sourceRootRelativePath),w.posix.join(a,"evals"),w.posix.join(a,"settings"),w.posix.join(a,"package.json"),w.posix.join(a,"tsconfig.json"),w.posix.join(a,"openpond.lock"),w.posix.join(a,".gitignore"),"openpond-profile.json"],r=(e.plan?.sourcePlan??[]).flatMap(s=>{let i=C(s.path);return i?i==="."||i.startsWith(`${a}/`)?[i]:[w.posix.join(a,i),i]:[]});return[...new Set([...n,...r])]}o(Ue,"allowedAgentImprovementPaths");function Je(e,t){let a=C(e);return t.some(n=>a===n||a.startsWith(`${n}/`))}o(Je,"pathAllowed");function me(e){return C(e).split("/").some(a=>a==="node_modules"||a===".openpond"||a==="artifacts")}o(me,"isCandidateRuntimePath");function Fe(e){return e.split(/\r?\n/).map(t=>t.trimEnd()).filter(Boolean).map(t=>{let a=t.slice(3),n=a.split(" -> ");return C(n.at(-1)??a)})}o(Fe,"parseGitStatusPaths");async function pe(e,t,a){let n=await e("git",["diff","--name-only","-z",a,"--","."],t);return h(n,"Unable to inspect Agent candidate paths."),[...new Set(n.stdout.split("\0").map(C).filter(r=>r!=="."&&!me(r)))]}o(pe,"gitChangedPaths");async function ge(e){for(let t of e.paths){let a=await B(e.command,e.repoPath,["rev-parse",`${e.commit}:${t}`]),n=w.join(e.repoPath,...t.split("/"));if(!a){if(ue(n))return!1;continue}if(!ue(n))return!1;let r=await B(e.command,e.repoPath,["hash-object","--",t]);if(!r||r!==a)return!1}return!0}o(ge,"workingTreeMatchesCommit");async function ze(e,t){let a=new Set(["node_modules",w.posix.join(C(e.profileRelativePath),"node_modules"),w.posix.join(C(e.sourceRootRelativePath),"node_modules")]);for(let n of a){let r=w.join(e.repoPath,...n.split("/")),s=w.join(t,...n.split("/"));!await Jt(r)||ue(s)||(await Be(w.dirname(s),{recursive:!0}),await Dt(r,s,process.platform==="win32"?"junction":"dir"))}}o(ze,"linkCandidateDependencies");async function We(e){let t=await e.command("git",["diff","--binary","HEAD","--",".",":(exclude)**/tasksets/**"],e.repoPath);if(h(t,"Unable to capture active Profile changes."),t.stdout){let i=w.join(e.workspaceRoot,"active-profile.patch");await Bt(i,t.stdout,"utf8");let d=await e.command("git",["apply","--whitespace=nowarn",i],e.worktreePath);h(d,"Unable to apply active Profile changes to the candidate baseline."),await Nt(i,{force:!0})}let a=await e.command("git",["ls-files","--others","--exclude-standard","-z"],e.repoPath);h(a,"Unable to inspect untracked Profile source.");for(let i of a.stdout.split("\0").filter(Ut)){let d=w.join(e.repoPath,...i.split("/")),u=w.join(e.worktreePath,...i.split("/"));await Be(w.dirname(u),{recursive:!0}),await Mt(d,u,{recursive:!0,preserveTimestamps:!0})}let n=await e.command("git",["add","-A"],e.worktreePath);h(n,"Unable to stage the active Profile snapshot.");let r=await e.command("git",["diff","--cached","--quiet"],e.worktreePath);if(r.code===0)return;r.code!==1&&h(r,"Unable to inspect the active Profile snapshot.");let s=await e.command("git",["commit","-m","Snapshot active Profile before OpenPond improvement"],e.worktreePath,Q());h(s,"Unable to commit the active Profile snapshot.")}o(We,"snapshotActiveProfileChanges");function Ut(e){return e?!C(e).split("/").some(a=>a==="node_modules"||a===".openpond"||a==="artifacts"||a==="tasksets"):!1}o(Ut,"snapshotEligiblePath");function Q(){return{GIT_AUTHOR_NAME:process.env.GIT_AUTHOR_NAME||"OpenPond",GIT_AUTHOR_EMAIL:process.env.GIT_AUTHOR_EMAIL||"openpond@example.invalid",GIT_COMMITTER_NAME:process.env.GIT_COMMITTER_NAME||"OpenPond",GIT_COMMITTER_EMAIL:process.env.GIT_COMMITTER_EMAIL||"openpond@example.invalid"}}o(Q,"gitIdentityEnv");async function Jt(e){try{return(await Gt(e)).isDirectory()}catch{return!1}}o(Jt,"directoryExists");async function Ke(e,t,a){let n=await e("gh",["pr","list","--head",a,"--state","all","--json","number,url,state,mergedAt,mergeCommit,baseRefName,headRefName","--limit","20"],t);h(n,"Unable to inspect existing Agent improvement pull requests.");let r=JSON.parse(n.stdout);return Array.isArray(r)?r.filter(s=>!!(s&&typeof s=="object")):[]}o(Ke,"listPullRequestsForBranch");function fe(e,t=new Date().toISOString(),a=new Date().toISOString()){let n=typeof e.number=="number"?e.number:Number(e.number),r=typeof e.state=="string"?e.state.toLowerCase():"",i=N(e.mergedAt)||r==="merged"?"merged":r==="open"?"open":"closed",d=e.mergeCommit&&typeof e.mergeCommit=="object"?e.mergeCommit:null,u=N(d?.oid)??N(e.mergeCommit),m=N(e.url),c=N(e.baseRefName),g=N(e.headRefName);if(!Number.isInteger(n)||n<=0||!m||!c||!g)throw new Error("GitHub returned an incomplete pull request payload.");return{provider:"github",number:n,url:m,state:i,baseBranch:c,headBranch:g,mergeCommit:u,openedAt:t,updatedAt:a}}o(fe,"normalizePullRequest");function Ve(e,t){return`openpond/improve/${D(t)}/${D(e.id).slice(0,36)}`}o(Ve,"candidateBranch");function U(e){if(!e.worktreePath)throw new Error("Agent candidate worktree is unavailable.");return e.worktreePath}o(U,"requireWorktreePath");function Ye(e){let t=e.replace(/^git@github\.com:/i,"").replace(/^https?:\/\/github\.com\//i,"").replace(/\.git$/i,"").replace(/^\/+|\/+$/g,"");return/^[^/]+\/[^/]+$/.test(t)?t:null}o(Ye,"githubRepoFromRemote");function C(e){return e.replaceAll("\\","/").replace(/^\.\//,"").replace(/^\/+|\/+$/g,"")||"."}o(C,"normalizeRepoPath");function D(e){return e.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||"candidate"}o(D,"safePathSegment");async function y(e,t,a,n){let r=await e("git",a,t);h(r,n);let s=r.stdout.trim();if(!s)throw new Error(n);return s}o(y,"requiredGitText");async function B(e,t,a){let n=await e("git",a,t);return n.code===0&&n.stdout.trim()?n.stdout.trim():null}o(B,"optionalGitText");function h(e,t){if(e.code!==0)throw new Error(e.stderr.trim()||e.stdout.trim()||t)}o(h,"assertCommand");function N(e){return typeof e=="string"&&e.trim()?e.trim():null}o(N,"stringValue");function T(e,t,a,n={}){return be(e,t,a,n)}o(T,"defaultCommandRunner");function et(e,t){let a=U(t);if(!Z(a))throw new Error("The existing Agent candidate worktree is no longer available.");let n=C(e.profileRelativePath),r=C(e.sourceRootRelativePath);return{target:{...e,repoPath:a,workspaceRoot:a,sourcePath:S.join(a,...n.split("/")),sourceRoot:S.join(a,...r.split("/"))},git:t}}o(et,"restoreAgentImprovementWorkspace");async function tt(e){let t=e.command??T,a=await y(t,e.target.repoPath,["rev-parse","--show-toplevel"],"Profile source is not a Git repository."),[n,r]=await Promise.all([Qe(a),Qe(e.target.repoPath)]);if(n!==r)throw new Error("Profile repo path does not match the Git repository root.");let s=await t("git",["status","--porcelain=v1","-uall"],a);h(s,"Unable to inspect Profile Git status.");let[i,d,u]=await Promise.all([y(t,a,["rev-parse","HEAD"],"Profile Git repo has no HEAD commit."),y(t,a,["branch","--show-current"],"Profile Git repo must be on a branch."),B(t,a,["remote","get-url","origin"])]);if(e.run.adapter.kind==="local"&&e.run.adapter.localHead&&e.run.adapter.localHead!==i)throw new Error(`Profile source changed from ${e.run.adapter.localHead.slice(0,12)} to ${i.slice(0,12)}. Re-plan the improvement against the current source.`);let m=Ve(e.run,e.target.agentId),c=S.join(Ze.tmpdir(),"openpond-agent-improvements",D(S.basename(a)||"profile"),D(e.run.id)),g=S.join(c,"repo");await Xe(c,{recursive:!0});let l=await t("git",["show-ref","--verify","--quiet",`refs/heads/${m}`],a);if(Z(g)&&await B(t,g,["branch","--show-current"])!==m&&(await t("git",["worktree","remove","--force",g],a),await he(c,{recursive:!0,force:!0}),await Xe(c,{recursive:!0})),!Z(g)){let P=l.code===0?["worktree","add",g,m]:["worktree","add","-b",m,g,i],R=await t("git",P,a);h(R,"Unable to create the Agent candidate worktree.")}s.stdout.trim()&&await We({command:t,repoPath:a,worktreePath:g,workspaceRoot:c});let p=await y(t,g,["rev-parse","HEAD"],"Agent candidate worktree has no baseline commit.");if(await y(t,g,["rev-parse","HEAD"],"Agent candidate worktree has no HEAD commit.")!==p)throw new Error("Agent candidate baseline could not be resolved.");await ze(e.target,g);let b=C(e.target.profileRelativePath),f=C(e.target.sourceRootRelativePath);return{target:{...e.target,repoPath:g,workspaceRoot:g,sourcePath:S.join(g,...b.split("/")),sourceRoot:S.join(g,...f.split("/"))},git:{baseBranch:d,baseCommit:p,branch:m,headCommit:null,remoteName:"origin",remoteUrl:u,worktreePath:g,changedPaths:[],diffStat:null,pullRequest:null}}}o(tt,"prepareAgentImprovementWorkspace");async function at(e){let t=e.command??T,a=U(e.workspace.git),n=await t("git",["status","--porcelain=v1","-uall"],a);h(n,"Unable to inspect Agent candidate changes.");let r=Fe(n.stdout).filter(g=>!me(g));if(r.length===0)throw new Error("The Agent improvement produced no source changes.");let s=Ue(e.run,e.activeTarget),i=r.filter(g=>!Je(g,s));if(i.length>0)throw new Error(`Agent candidate changed paths outside the approved scope: ${i.join(", ")}`);let d=await t("git",["add","--",...r],a);h(d,"Unable to stage Agent candidate changes.");let u=await t("git",["commit","-m",`Improve ${e.run.target.displayName??e.activeTarget.agentId} via OpenPond`],a,Q());h(u,"Unable to commit Agent candidate changes.");let m=await y(t,a,["rev-parse","HEAD"],"Agent candidate commit was not created."),c=await B(t,a,["diff","--stat",`${e.workspace.git.baseCommit}..${m}`]);return{...e.workspace.git,headCommit:m,changedPaths:r,diffStat:c}}o(at,"commitAgentImprovementCandidate");async function Va(e){let t=e.command??T,a=U(e.git);if(!e.git.headCommit)throw new Error("Agent candidate has no commit to push.");if(!e.git.remoteUrl||!Ye(e.git.remoteUrl))throw new Error("Agent candidate is ready locally. Configure a GitHub origin remote before opening a pull request.");let n=await t("git",["push","--set-upstream",e.git.remoteName,e.git.branch],a);h(n,"Unable to push the Agent candidate branch.");let r=await Ke(t,a,e.git.branch);if(r.length>0)return fe(r[0],e.timestamp);let s=`Improve ${e.run.target.displayName??e.run.target.id??"Agent"}`,i=["## OpenPond Agent improvement","",e.run.objective,"","## Evaluation","",e.evaluationSummary,"",`Create/Improve run: \`${e.run.id}\``,`Base commit: \`${e.git.baseCommit}\``,`Candidate commit: \`${e.git.headCommit}\``].join(`
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{Tb as l}from"./chunk-QAFXQHHG.js";import{c as n,d as a,e as i,g as t}from"./chunk-RCT3O3HQ.js";import{A as e}from"./chunk-X2J2P5ZT.js";var k=e.enum(["trajectory","reward","demonstration","preference","correction","critique","targeted_feedback","grader_evidence","infrastructure_failure"]),c=e.object({datasetRelease:t,harnessRelease:t,evidenceSetRelease:t.nullable(),profileRelease:t.nullable(),model:e.object({source:e.string().trim().min(1).max(200),revision:e.string().trim().min(1).max(500),artifactHash:a.nullable()}).strict(),environmentHash:a,graderHash:a,toolContractHash:a,verificationReceiptHash:a.nullable()}).strict(),r=e.object({schemaVersion:e.literal("openpond.learningSignal.v1"),id:n,taskId:n.nullable(),episodeId:n.nullable(),policyVersion:e.number().int().nonnegative().nullable(),lineage:c,approved:e.boolean(),verifier:e.enum(["deterministic","model_judge","human","none"]),createdAt:i,contentHash:a,metadata:e.record(e.string(),e.unknown()).default({})}).strict(),m=r.extend({kind:e.literal("trajectory"),payload:e.object({traceRef:e.string().trim().min(1).max(2e3),traceHash:a,terminal:e.boolean(),failureClass:e.enum(["policy_failure","grader_failure","environment_failure","infrastructure_failure","timeout","cancelled"]).nullable(),optimizerSample:l.nullable().optional()}).strict()}).strict(),d=r.extend({kind:e.literal("reward"),payload:e.object({reward:e.number().finite(),components:e.record(e.string(),e.number().finite()),eligible:e.boolean(),graderEvidenceRefs:e.array(n).max(1e3)}).strict()}).strict(),g=r.extend({kind:e.literal("demonstration"),payload:e.object({prompt:e.string().max(5e5),response:e.string().max(1e6)}).strict()}).strict(),u=r.extend({kind:e.literal("preference"),payload:e.object({prompt:e.string().max(5e5),chosen:e.string().max(1e6),rejected:e.string().max(1e6),rationale:e.string().max(5e5).nullable()}).strict()}).strict(),p=r.extend({kind:e.literal("correction"),payload:e.object({original:e.string().max(1e6),corrected:e.string().max(1e6),rationale:e.string().max(5e5).nullable()}).strict()}).strict(),b=r.extend({kind:e.literal("critique"),payload:e.object({response:e.string().max(1e6),critique:e.string().max(5e5),severity:e.enum(["note","warning","error"])}).strict()}).strict(),f=r.extend({kind:e.literal("targeted_feedback"),payload:e.object({turnIndex:e.number().int().nonnegative(),target:e.enum(["reasoning","tool","answer","policy"]),feedback:e.string().max(5e5)}).strict()}).strict(),h=r.extend({kind:e.literal("grader_evidence"),payload:e.object({graderId:n,score:e.number().finite().nullable(),passed:e.boolean(),privilegedArtifactRefs:e.array(e.string().trim().min(1).max(2e3))}).strict()}).strict(),x=r.extend({kind:e.literal("infrastructure_failure"),approved:e.literal(!1),verifier:e.literal("none"),payload:e.object({code:n,phase:n,retryable:e.boolean(),rewardEligible:e.literal(!1)}).strict()}).strict(),o=e.discriminatedUnion("kind",[m,d,g,u,p,b,f,h,x]),H=e.object({schemaVersion:e.literal("openpond.learningSignalBatch.v1"),manifestId:n,manifestHash:a,sequence:e.number().int().nonnegative(),signals:e.array(o).min(1).max(1e5),contentHash:a}).strict();var S=e.object({id:n,turn:e.number().int().nonnegative(),kind:e.enum(["message","tool_call","terminal"]),name:n.nullable(),arguments:e.record(e.string(),e.unknown()),content:e.string().max(1e6).nullable(),contentHash:a}).strict(),_=e.object({actionId:n,turn:e.number().int().nonnegative(),terminal:e.boolean(),output:e.record(e.string(),e.unknown()),artifactRefs:e.array(e.string().trim().min(1).max(2e3)),contentHash:a}).strict(),v=e.object({sequence:e.number().int().nonnegative(),type:e.enum(["created","reset","action","observation","terminal","graded","feedback","failure","collected","destroyed"]),timestamp:i,payloadHash:a,metadata:e.record(e.string(),e.unknown()).default({})}).strict(),s=e.object({graderId:n,graderVersion:e.string().trim().min(1).max(200),score:e.number().finite().nullable(),passed:e.boolean(),rewardEligible:e.boolean(),failureClass:e.enum(["policy_failure","grader_failure","environment_failure","infrastructure_failure","timeout","cancelled"]).nullable(),feedback:e.array(e.string().max(5e5)),visibleEvidenceRefs:e.array(e.string().trim().min(1).max(2e3)),privilegedEvidenceRefs:e.array(e.string().trim().min(1).max(2e3)),contentHash:a}).strict(),A=e.object({schemaVersion:e.literal("openpond.harnessRunTrace.v1"),manifest:t,taskId:n,seed:e.string().trim().min(1).max(500),events:e.array(v).max(1e6),actions:e.array(S).max(1e5),observations:e.array(_).max(1e5),graderEvidence:e.array(s).max(1e4),learningSignals:e.array(o).max(1e5),terminal:e.boolean(),failureClass:s.shape.failureClass,artifactHash:a,contentHash:a}).strict();export{k as a};
2
+ import{Tb as l}from"./chunk-D6L6UNUQ.js";import{c as n,d as a,e as i,g as t}from"./chunk-RCT3O3HQ.js";import{A as e}from"./chunk-X2J2P5ZT.js";var k=e.enum(["trajectory","reward","demonstration","preference","correction","critique","targeted_feedback","grader_evidence","infrastructure_failure"]),c=e.object({datasetRelease:t,harnessRelease:t,evidenceSetRelease:t.nullable(),profileRelease:t.nullable(),model:e.object({source:e.string().trim().min(1).max(200),revision:e.string().trim().min(1).max(500),artifactHash:a.nullable()}).strict(),environmentHash:a,graderHash:a,toolContractHash:a,verificationReceiptHash:a.nullable()}).strict(),r=e.object({schemaVersion:e.literal("openpond.learningSignal.v1"),id:n,taskId:n.nullable(),episodeId:n.nullable(),policyVersion:e.number().int().nonnegative().nullable(),lineage:c,approved:e.boolean(),verifier:e.enum(["deterministic","model_judge","human","none"]),createdAt:i,contentHash:a,metadata:e.record(e.string(),e.unknown()).default({})}).strict(),m=r.extend({kind:e.literal("trajectory"),payload:e.object({traceRef:e.string().trim().min(1).max(2e3),traceHash:a,terminal:e.boolean(),failureClass:e.enum(["policy_failure","grader_failure","environment_failure","infrastructure_failure","timeout","cancelled"]).nullable(),optimizerSample:l.nullable().optional()}).strict()}).strict(),d=r.extend({kind:e.literal("reward"),payload:e.object({reward:e.number().finite(),components:e.record(e.string(),e.number().finite()),eligible:e.boolean(),graderEvidenceRefs:e.array(n).max(1e3)}).strict()}).strict(),g=r.extend({kind:e.literal("demonstration"),payload:e.object({prompt:e.string().max(5e5),response:e.string().max(1e6)}).strict()}).strict(),u=r.extend({kind:e.literal("preference"),payload:e.object({prompt:e.string().max(5e5),chosen:e.string().max(1e6),rejected:e.string().max(1e6),rationale:e.string().max(5e5).nullable()}).strict()}).strict(),p=r.extend({kind:e.literal("correction"),payload:e.object({original:e.string().max(1e6),corrected:e.string().max(1e6),rationale:e.string().max(5e5).nullable()}).strict()}).strict(),b=r.extend({kind:e.literal("critique"),payload:e.object({response:e.string().max(1e6),critique:e.string().max(5e5),severity:e.enum(["note","warning","error"])}).strict()}).strict(),f=r.extend({kind:e.literal("targeted_feedback"),payload:e.object({turnIndex:e.number().int().nonnegative(),target:e.enum(["reasoning","tool","answer","policy"]),feedback:e.string().max(5e5)}).strict()}).strict(),h=r.extend({kind:e.literal("grader_evidence"),payload:e.object({graderId:n,score:e.number().finite().nullable(),passed:e.boolean(),privilegedArtifactRefs:e.array(e.string().trim().min(1).max(2e3))}).strict()}).strict(),x=r.extend({kind:e.literal("infrastructure_failure"),approved:e.literal(!1),verifier:e.literal("none"),payload:e.object({code:n,phase:n,retryable:e.boolean(),rewardEligible:e.literal(!1)}).strict()}).strict(),o=e.discriminatedUnion("kind",[m,d,g,u,p,b,f,h,x]),H=e.object({schemaVersion:e.literal("openpond.learningSignalBatch.v1"),manifestId:n,manifestHash:a,sequence:e.number().int().nonnegative(),signals:e.array(o).min(1).max(1e5),contentHash:a}).strict();var S=e.object({id:n,turn:e.number().int().nonnegative(),kind:e.enum(["message","tool_call","terminal"]),name:n.nullable(),arguments:e.record(e.string(),e.unknown()),content:e.string().max(1e6).nullable(),contentHash:a}).strict(),_=e.object({actionId:n,turn:e.number().int().nonnegative(),terminal:e.boolean(),output:e.record(e.string(),e.unknown()),artifactRefs:e.array(e.string().trim().min(1).max(2e3)),contentHash:a}).strict(),v=e.object({sequence:e.number().int().nonnegative(),type:e.enum(["created","reset","action","observation","terminal","graded","feedback","failure","collected","destroyed"]),timestamp:i,payloadHash:a,metadata:e.record(e.string(),e.unknown()).default({})}).strict(),s=e.object({graderId:n,graderVersion:e.string().trim().min(1).max(200),score:e.number().finite().nullable(),passed:e.boolean(),rewardEligible:e.boolean(),failureClass:e.enum(["policy_failure","grader_failure","environment_failure","infrastructure_failure","timeout","cancelled"]).nullable(),feedback:e.array(e.string().max(5e5)),visibleEvidenceRefs:e.array(e.string().trim().min(1).max(2e3)),privilegedEvidenceRefs:e.array(e.string().trim().min(1).max(2e3)),contentHash:a}).strict(),A=e.object({schemaVersion:e.literal("openpond.harnessRunTrace.v1"),manifest:t,taskId:n,seed:e.string().trim().min(1).max(500),events:e.array(v).max(1e6),actions:e.array(S).max(1e5),observations:e.array(_).max(1e5),graderEvidence:e.array(s).max(1e4),learningSignals:e.array(o).max(1e5),terminal:e.boolean(),failureClass:s.shape.failureClass,artifactHash:a,contentHash:a}).strict();export{k as a};
@@ -1,3 +1,3 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{Ib as P,Lb as h,Mb as E}from"./chunk-QAFXQHHG.js";import{c as u,n as f}from"./chunk-RCT3O3HQ.js";import{A as d}from"./chunk-X2J2P5ZT.js";import{a as c}from"./chunk-FTQLQJQV.js";var S=d.object({id:u,runIds:d.array(u).min(2).max(100)}).strict();function j(r){return async s=>{let i=S.parse(s),l=await r.selectedProfile();if(!l)throw new Error("Select a Profile before comparing its evaluation runs.");let a=[];for(let e of i.runIds){let t=await r.store.getProfileEvaluationRun(e);if(!t||f(t.profileRef)!==f(l.ref))throw new Error(`Profile evaluation run ${e} is unavailable in the selected Profile.`);a.push({manifest:t.manifest,result:t.metric})}let o=await r.store.getProfileEvaluationComparison(i.id),n=P({id:i.id,members:a,createdAt:o?.createdAt??new Date().toISOString()});return r.store.saveProfileEvaluationComparison(l.ref,n)}}c(j,"createProfileEvaluationComparisonService");import{promises as m}from"node:fs";import v from"node:path";var y=d.object({id:u,evidenceKind:d.enum(["run","suite","comparison"]),evidenceId:u}).strict();function w(r){return v.join(r,"evals","reports")}c(w,"reportDirectory");async function R(r){let s=await m.lstat(r).catch(i=>{if(i.code==="ENOENT")return null;throw i});if(s&&(!s.isDirectory()||s.isSymbolicLink()))throw new Error("Profile evaluation report directory must be a regular directory.");s||await m.mkdir(r)}c(R,"ensureRegularDirectory");async function k(r){let s,i;if(r.evidenceKind==="run")s=[r.evidenceId],i="";else if(r.evidenceKind==="suite"){let o=await r.store.getProfileEvaluationSuiteRun(r.evidenceId);if(!o||o.profileId!==r.profileRef.profileId)throw new Error("Profile evaluation suite is unavailable.");s=o.members.map(n=>n.runManifest.id),i=o.contentHash}else{let o=await r.store.getProfileEvaluationComparison(r.evidenceId);if(!o)throw new Error("Profile evaluation comparison is unavailable.");s=o.members.map(n=>n.runManifest.id),i=o.contentHash}let l=await Promise.all(s.map(o=>r.store.getProfileEvaluationRun(o)));if(l.some(o=>!o||f(o.profileRef)!==f(r.profileRef)))throw new Error("Profile evaluation report is missing authorized run evidence.");let a=l;if(r.evidenceKind==="run"&&(i=a[0].contentHash),r.evidenceKind!=="run"){let o=r.evidenceKind==="suite"?(await r.store.getProfileEvaluationSuiteRun(r.evidenceId)).members.map(n=>n.runHash):(await r.store.getProfileEvaluationComparison(r.evidenceId)).members.map(n=>n.metricResultHash);for(let[n,e]of a.entries())if(r.evidenceKind==="suite"&&o[n]!==e.contentHash||r.evidenceKind==="comparison"&&o[n]!==e.metric.contentHash)throw new Error("Profile evaluation report evidence differs from retained member runs.")}return{runs:a,primary:{kind:r.evidenceKind,id:r.evidenceId,contentHash:i}}}c(k,"loadRuns");async function H(r){let s=y.parse(r.request),{runs:i,primary:l}=await k({store:r.store,profileRef:r.profileRef,evidenceKind:s.evidenceKind,evidenceId:s.evidenceId}),a=c(e=>[...new Map(e.map(t=>[f(t),t])).values()],"unique"),o=a(i.map(e=>f(e.manifest.metricPolicy))),n=i.map(e=>e.metric.value).filter(e=>e!==null);return h({schemaVersion:"openpond.profileEvaluationReport.v1",id:s.id,createdAt:new Date().toISOString(),testedSources:a(i.map(e=>({profileId:e.manifest.profileEvaluation.profileId,sourceRevision:e.manifest.profileEvaluation.sourceRevision,harnessRelease:e.manifest.profileEvaluation.harnessRelease}))),tasksetReleases:a(i.map(e=>e.manifest.tasksetRelease)),metricPolicyHashes:o,modelConfigurationHashes:a(i.map(e=>e.manifest.policy.kind==="model"?e.manifest.policy.configurationHash:f(e.manifest.policy))),evidence:[l,...i.filter(e=>l.kind!=="run"||e.manifest.id!==l.id).map(e=>({kind:"run",id:e.manifest.id,contentHash:e.contentHash}))],summary:{totalChecks:i.length,passedChecks:i.filter(e=>e.passed).length,failedChecks:i.filter(e=>!e.passed&&e.metric.value!==null).length,unscoredChecks:i.filter(e=>!e.passed&&e.metric.value===null).length,meanScore:o.length===1&&n.length===i.length?n.reduce((e,t)=>e+t,0)/n.length:null}})}c(H,"buildProfileEvaluationReport");function q(r){return{list:c(async()=>{let l=await r.selectedProfile();if(!l)return[];let a=w(l.sourcePath),o=await m.lstat(a).catch(t=>{if(t.code==="ENOENT")return null;throw t});if(!o)return[];if(!o.isDirectory()||o.isSymbolicLink())throw new Error("Profile evaluation report directory is unsafe.");let n=await m.readdir(a,{withFileTypes:!0});return(await Promise.all(n.filter(t=>t.name.endsWith(".json")).map(async t=>{if(!t.isFile()||t.isSymbolicLink())throw new Error("Profile evaluation report must be a regular file.");let p=E(JSON.parse(await m.readFile(v.join(a,t.name),"utf8")));if(`${p.id}.json`!==t.name||p.testedSources.some(g=>g.profileId!==l.ref.profileId))throw new Error("Profile evaluation report differs from its source location.");return p}))).sort((t,p)=>p.createdAt.localeCompare(t.createdAt))},"list"),save:c(async l=>{let a=await r.selectedProfile();if(!a?.gitBacked)throw new Error("Select a Git-backed Profile before saving an evaluation report.");let o=await H({store:r.store,profileRef:a.ref,request:l}),n=v.join(a.sourcePath,"evals");await R(n);let e=w(a.sourcePath);return await R(e),await m.writeFile(v.join(e,`${o.id}.json`),`${JSON.stringify(o,null,2)}
2
+ import{Ib as P,Lb as h,Mb as E}from"./chunk-D6L6UNUQ.js";import{c as u,n as f}from"./chunk-RCT3O3HQ.js";import{A as d}from"./chunk-X2J2P5ZT.js";import{a as c}from"./chunk-FTQLQJQV.js";var S=d.object({id:u,runIds:d.array(u).min(2).max(100)}).strict();function j(r){return async s=>{let i=S.parse(s),l=await r.selectedProfile();if(!l)throw new Error("Select a Profile before comparing its evaluation runs.");let a=[];for(let e of i.runIds){let t=await r.store.getProfileEvaluationRun(e);if(!t||f(t.profileRef)!==f(l.ref))throw new Error(`Profile evaluation run ${e} is unavailable in the selected Profile.`);a.push({manifest:t.manifest,result:t.metric})}let o=await r.store.getProfileEvaluationComparison(i.id),n=P({id:i.id,members:a,createdAt:o?.createdAt??new Date().toISOString()});return r.store.saveProfileEvaluationComparison(l.ref,n)}}c(j,"createProfileEvaluationComparisonService");import{promises as m}from"node:fs";import v from"node:path";var y=d.object({id:u,evidenceKind:d.enum(["run","suite","comparison"]),evidenceId:u}).strict();function w(r){return v.join(r,"evals","reports")}c(w,"reportDirectory");async function R(r){let s=await m.lstat(r).catch(i=>{if(i.code==="ENOENT")return null;throw i});if(s&&(!s.isDirectory()||s.isSymbolicLink()))throw new Error("Profile evaluation report directory must be a regular directory.");s||await m.mkdir(r)}c(R,"ensureRegularDirectory");async function k(r){let s,i;if(r.evidenceKind==="run")s=[r.evidenceId],i="";else if(r.evidenceKind==="suite"){let o=await r.store.getProfileEvaluationSuiteRun(r.evidenceId);if(!o||o.profileId!==r.profileRef.profileId)throw new Error("Profile evaluation suite is unavailable.");s=o.members.map(n=>n.runManifest.id),i=o.contentHash}else{let o=await r.store.getProfileEvaluationComparison(r.evidenceId);if(!o)throw new Error("Profile evaluation comparison is unavailable.");s=o.members.map(n=>n.runManifest.id),i=o.contentHash}let l=await Promise.all(s.map(o=>r.store.getProfileEvaluationRun(o)));if(l.some(o=>!o||f(o.profileRef)!==f(r.profileRef)))throw new Error("Profile evaluation report is missing authorized run evidence.");let a=l;if(r.evidenceKind==="run"&&(i=a[0].contentHash),r.evidenceKind!=="run"){let o=r.evidenceKind==="suite"?(await r.store.getProfileEvaluationSuiteRun(r.evidenceId)).members.map(n=>n.runHash):(await r.store.getProfileEvaluationComparison(r.evidenceId)).members.map(n=>n.metricResultHash);for(let[n,e]of a.entries())if(r.evidenceKind==="suite"&&o[n]!==e.contentHash||r.evidenceKind==="comparison"&&o[n]!==e.metric.contentHash)throw new Error("Profile evaluation report evidence differs from retained member runs.")}return{runs:a,primary:{kind:r.evidenceKind,id:r.evidenceId,contentHash:i}}}c(k,"loadRuns");async function H(r){let s=y.parse(r.request),{runs:i,primary:l}=await k({store:r.store,profileRef:r.profileRef,evidenceKind:s.evidenceKind,evidenceId:s.evidenceId}),a=c(e=>[...new Map(e.map(t=>[f(t),t])).values()],"unique"),o=a(i.map(e=>f(e.manifest.metricPolicy))),n=i.map(e=>e.metric.value).filter(e=>e!==null);return h({schemaVersion:"openpond.profileEvaluationReport.v1",id:s.id,createdAt:new Date().toISOString(),testedSources:a(i.map(e=>({profileId:e.manifest.profileEvaluation.profileId,sourceRevision:e.manifest.profileEvaluation.sourceRevision,harnessRelease:e.manifest.profileEvaluation.harnessRelease}))),tasksetReleases:a(i.map(e=>e.manifest.tasksetRelease)),metricPolicyHashes:o,modelConfigurationHashes:a(i.map(e=>e.manifest.policy.kind==="model"?e.manifest.policy.configurationHash:f(e.manifest.policy))),evidence:[l,...i.filter(e=>l.kind!=="run"||e.manifest.id!==l.id).map(e=>({kind:"run",id:e.manifest.id,contentHash:e.contentHash}))],summary:{totalChecks:i.length,passedChecks:i.filter(e=>e.passed).length,failedChecks:i.filter(e=>!e.passed&&e.metric.value!==null).length,unscoredChecks:i.filter(e=>!e.passed&&e.metric.value===null).length,meanScore:o.length===1&&n.length===i.length?n.reduce((e,t)=>e+t,0)/n.length:null}})}c(H,"buildProfileEvaluationReport");function q(r){return{list:c(async()=>{let l=await r.selectedProfile();if(!l)return[];let a=w(l.sourcePath),o=await m.lstat(a).catch(t=>{if(t.code==="ENOENT")return null;throw t});if(!o)return[];if(!o.isDirectory()||o.isSymbolicLink())throw new Error("Profile evaluation report directory is unsafe.");let n=await m.readdir(a,{withFileTypes:!0});return(await Promise.all(n.filter(t=>t.name.endsWith(".json")).map(async t=>{if(!t.isFile()||t.isSymbolicLink())throw new Error("Profile evaluation report must be a regular file.");let p=E(JSON.parse(await m.readFile(v.join(a,t.name),"utf8")));if(`${p.id}.json`!==t.name||p.testedSources.some(g=>g.profileId!==l.ref.profileId))throw new Error("Profile evaluation report differs from its source location.");return p}))).sort((t,p)=>p.createdAt.localeCompare(t.createdAt))},"list"),save:c(async l=>{let a=await r.selectedProfile();if(!a?.gitBacked)throw new Error("Select a Git-backed Profile before saving an evaluation report.");let o=await H({store:r.store,profileRef:a.ref,request:l}),n=v.join(a.sourcePath,"evals");await R(n);let e=w(a.sourcePath);return await R(e),await m.writeFile(v.join(e,`${o.id}.json`),`${JSON.stringify(o,null,2)}
3
3
  `,{flag:"wx"}),o},"save")}}c(q,"createProfileEvaluationReportService");export{j as a,H as b,q as c};
@@ -1,3 +1,3 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{j as l,n as c}from"./chunk-ZU3YBRXS.js";import{z as n}from"./chunk-4TTXNVCE.js";import{a as t}from"./chunk-FTQLQJQV.js";import{mkdir as f}from"node:fs/promises";import p from"node:path";import a from"node:path";function d(e,o){let i=a.resolve(e),r=a.resolve(o);return r===i||r.startsWith(`${i}${a.sep}`)}t(d,"isHostedProfileSourceWithinRepo");async function u(e){if(!p.isAbsolute(e.repoPath)||!p.isAbsolute(e.outputDir)||!/^[a-f0-9]{40,64}$/.test(e.sourceRevision)||!e.workspaceId.trim()||!e.repositoryId.trim()||!e.profileId.trim())throw new Error("Hosted Profile compile request is invalid.");let o=await n({repoPath:e.repoPath,profileId:e.profileId});if(o.error||o.mode!=="local"||o.activeProfile!==e.profileId||!o.sourcePath||!d(e.repoPath,o.sourcePath))throw new Error("Hosted Profile source is unavailable.");await f(e.outputDir,{recursive:!0});let i=await l({storeDir:e.outputDir,workspaceId:e.workspaceId,name:e.profileId,profile:o,sourceRevision:e.sourceRevision,repositoryId:e.repositoryId}),r=i.harnessRelease.metadata.profile;if(!r||typeof r!="object"||r.id!==e.profileId||r.sourceRevision!==e.sourceRevision||r.repositoryId!==e.repositoryId)throw new Error("Hosted Profile release provenance is invalid.");let s=await c({storeDir:e.outputDir,workspaceId:e.workspaceId,compiled:i,createdAt:new Date().toISOString()});return{workspaceId:e.workspaceId,sourceRevision:s.sourceRevision,harnessRelease:s.harnessRelease,agentSnapshot:s.agentSnapshot,bundlePath:s.bundlePath}}t(u,"compileHostedProfileRelease");async function H(e){if(e.length!==1||e[0].length>16e3||!/^[A-Za-z0-9_-]+$/.test(e[0]))throw new Error("Hosted Profile compile argument is invalid.");let o=JSON.parse(Buffer.from(e[0],"base64url").toString("utf8")),i=await u(o);process.stdout.write(`${JSON.stringify(i)}
3
- `)}t(H,"runHostedProfileCompilerCli");async function y(e){await(await import("./hosted-profile-evaluation-preparation-H5S7JZMD.js")).runHostedProfileEvaluationCli(e)}t(y,"runHostedProfileEvaluationCli");async function k(e){await(await import("./hosted-profile-evaluation-inspection-CHYKDYUQ.js")).runHostedProfileInspectionCli(e)}t(k,"runHostedProfileInspectionCli");export{u as a,H as b,y as c,k as d};
2
+ import{j as l,n as c}from"./chunk-DKOVZ6R2.js";import{z as n}from"./chunk-OFJPOTES.js";import{a as t}from"./chunk-FTQLQJQV.js";import{mkdir as f}from"node:fs/promises";import p from"node:path";import a from"node:path";function d(e,o){let i=a.resolve(e),r=a.resolve(o);return r===i||r.startsWith(`${i}${a.sep}`)}t(d,"isHostedProfileSourceWithinRepo");async function u(e){if(!p.isAbsolute(e.repoPath)||!p.isAbsolute(e.outputDir)||!/^[a-f0-9]{40,64}$/.test(e.sourceRevision)||!e.workspaceId.trim()||!e.repositoryId.trim()||!e.profileId.trim())throw new Error("Hosted Profile compile request is invalid.");let o=await n({repoPath:e.repoPath,profileId:e.profileId});if(o.error||o.mode!=="local"||o.activeProfile!==e.profileId||!o.sourcePath||!d(e.repoPath,o.sourcePath))throw new Error("Hosted Profile source is unavailable.");await f(e.outputDir,{recursive:!0});let i=await l({storeDir:e.outputDir,workspaceId:e.workspaceId,name:e.profileId,profile:o,sourceRevision:e.sourceRevision,repositoryId:e.repositoryId}),r=i.harnessRelease.metadata.profile;if(!r||typeof r!="object"||r.id!==e.profileId||r.sourceRevision!==e.sourceRevision||r.repositoryId!==e.repositoryId)throw new Error("Hosted Profile release provenance is invalid.");let s=await c({storeDir:e.outputDir,workspaceId:e.workspaceId,compiled:i,createdAt:new Date().toISOString()});return{workspaceId:e.workspaceId,sourceRevision:s.sourceRevision,harnessRelease:s.harnessRelease,agentSnapshot:s.agentSnapshot,bundlePath:s.bundlePath}}t(u,"compileHostedProfileRelease");async function H(e){if(e.length!==1||e[0].length>16e3||!/^[A-Za-z0-9_-]+$/.test(e[0]))throw new Error("Hosted Profile compile argument is invalid.");let o=JSON.parse(Buffer.from(e[0],"base64url").toString("utf8")),i=await u(o);process.stdout.write(`${JSON.stringify(i)}
3
+ `)}t(H,"runHostedProfileCompilerCli");async function y(e){await(await import("./hosted-profile-evaluation-preparation-LIJJZDHQ.js")).runHostedProfileEvaluationCli(e)}t(y,"runHostedProfileEvaluationCli");async function k(e){await(await import("./hosted-profile-evaluation-inspection-4F7OEF4T.js")).runHostedProfileInspectionCli(e)}t(k,"runHostedProfileInspectionCli");export{u as a,H as b,y as c,k as d};
@@ -1,3 +1,3 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as E,c as g}from"./chunk-4D3CICBG.js";import{g as v}from"./chunk-3MVKXAH7.js";import{v as C}from"./chunk-ZY32SZ2P.js";import{n as h}from"./chunk-RCT3O3HQ.js";import{A as p}from"./chunk-X2J2P5ZT.js";import{a as d}from"./chunk-FTQLQJQV.js";function _(n){let i=new Map;async function f(e){C(e,8388608);let o=v.parse(e);if(o.kind==="profile")return n.executeProfile(o.request);let s=h(o),l=i.get(o.id);if(l){if(l.hash!==s)throw new Error("Experiment case operation already owns different admitted inputs.");return l.result}if(i.size>=100)throw new Error("Experiment case execution capacity reached.");let c=new AbortController,a=x(o,c.signal);i.set(o.id,{hash:s,controller:c,result:a});try{return await a}finally{i.delete(o.id)}}d(f,"execute");async function x(e,o){let s=AbortSignal.any([o,AbortSignal.timeout(e.timeoutMs)]);if(s.throwIfAborted(),e.harness){if(!n.executeHarness||e.environment.kind!=="text")throw new Error("The selected standalone Harness has no compatible native Experiment adapter.");return n.executeHarness(e,s)}let l=await n.resolvePolicy(e);if(s.throwIfAborted(),e.environment.kind==="javascript"){let r=n.resolveEnvironment?await n.resolveEnvironment(e):g;return E({taskId:e.taskId,instructions:`${e.instructions}
2
+ import{a as E,c as g}from"./chunk-CO23RRN7.js";import{g as v}from"./chunk-RCQYEHHD.js";import{v as C}from"./chunk-ZY32SZ2P.js";import{n as h}from"./chunk-RCT3O3HQ.js";import{A as p}from"./chunk-X2J2P5ZT.js";import{a as d}from"./chunk-FTQLQJQV.js";function _(n){let i=new Map;async function f(e){C(e,8388608);let o=v.parse(e);if(o.kind==="profile")return n.executeProfile(o.request);let s=h(o),l=i.get(o.id);if(l){if(l.hash!==s)throw new Error("Experiment case operation already owns different admitted inputs.");return l.result}if(i.size>=100)throw new Error("Experiment case execution capacity reached.");let c=new AbortController,a=x(o,c.signal);i.set(o.id,{hash:s,controller:c,result:a});try{return await a}finally{i.delete(o.id)}}d(f,"execute");async function x(e,o){let s=AbortSignal.any([o,AbortSignal.timeout(e.timeoutMs)]);if(s.throwIfAborted(),e.harness){if(!n.executeHarness||e.environment.kind!=="text")throw new Error("The selected standalone Harness has no compatible native Experiment adapter.");return n.executeHarness(e,s)}let l=await n.resolvePolicy(e);if(s.throwIfAborted(),e.environment.kind==="javascript"){let r=n.resolveEnvironment?await n.resolveEnvironment(e):g;return E({taskId:e.taskId,instructions:`${e.instructions}
3
3
  ${JSON.stringify({policyVisibleContext:e.policyVisibleContext})}`,input:e.input,definition:e.environment.definition,asset:e.environment.asset,initialState:e.environment.initialState,seed:e.environment.seed,timeoutMs:e.timeoutMs,execute:r,policy:l,signal:s})}let c=[{role:"system",text:e.instructions},{role:"user",text:JSON.stringify({input:e.input,policyVisibleContext:e.policyVisibleContext})}],a=null,u=null,m="completed";try{let r=await l({messages:c,tools:[],signal:s});if(s.throwIfAborted(),r.toolCalls.length)throw new Error("Text cases do not support tool calls.");a=r.text,c.push({role:"assistant",text:r.text,toolCalls:[]})}catch(r){u=r instanceof Error?r.message:"Experiment policy failed.",m=o.aborted?"cancelled":s.aborted?"timed_out":"policy_failure"}let t={schemaVersion:"openpond.javascriptEnvironmentAttempt.v1",taskId:e.taskId,status:m,output:a,error:u,messages:c,collected:m==="completed",environmentCleanupComplete:!0,snapshot:null};return{...t,contentHash:h(t)}}return d(x,"run"),{execute:f,cancel(e){let o=i.get(e);return o?.controller.abort(new Error("experiment_case_cancelled")),{id:e,cancelled:!!o}},async close(){for(let e of i.values())e.controller.abort(new Error("experiment_runtime_closed"));await Promise.allSettled([...i.values()].map(e=>e.result))}}}d(_,"createExperimentCaseService");function A(n){let i=0,f=new Map;return async({messages:x,tools:e,signal:o})=>{let s=`experiment:${n.request.id}:${i++}`,l=0,c=x.map(t=>{if(t.role==="tool")return{role:"tool",tool_call_id:t.callId,name:t.name,content:JSON.stringify(t.observation)};if(t.role==="assistant"){let r=f.get(l++);return{role:"assistant",content:t.text,...r?{continuation:r}:{},...t.toolCalls.length?{tool_calls:t.toolCalls.map(y=>({id:y.id,type:"function",function:{name:y.name,arguments:JSON.stringify(y.arguments)}}))}:{}}}return{role:t.role,content:t.text}}),a="",u=[],m;for await(let t of n.stream({model:n.request.model.modelId,messages:[...n.request.model.messages,...c],tools:e.map(r=>({type:"function",function:{name:r.name,description:r.description,parameters:r.inputSchema}})),requestId:s,maxTokens:n.request.model.maxOutputTokens,temperature:n.request.model.temperature,topP:n.request.model.topP,signal:o})){if(o.throwIfAborted(),t.type==="text_delta"&&(a+=t.text,a.length>262144))throw new Error("Experiment policy response exceeded its retained-output limit.");if(t.type==="tool_call_delta"&&(u=t.toolCalls,u.length>200))throw new Error("Experiment policy response exceeded its tool-call limit.");t.type==="continuation"&&(m=t.continuation),t.type==="usage"&&await n.onUsage?.({requestId:s,usage:t.usage})}return m&&f.set(i-1,m),{text:a,toolCalls:u.map(t=>({id:p.string().min(1).parse(t.id),name:p.string().min(1).parse(t.function?.name),arguments:p.record(p.string(),p.unknown()).parse(JSON.parse(p.string().parse(t.function?.arguments)))}))}}}d(A,"createLocalExperimentPolicy");export{_ as a,A as b};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{E as u,F as h}from"./chunk-SH7POUVX.js";import{f as c}from"./chunk-UGOK7VTC.js";import{a as s}from"./chunk-FTQLQJQV.js";import{createHash as i}from"node:crypto";import{readFile as m}from"node:fs/promises";import y from"node:path";var U=".openpond/source-upload-cache.json",d="openpond.source-upload-cache.v1";async function E(e){try{let a=(await u(c(),"source-upload.v1",l(e)))?.payload;if(!a)return new Map;if(a.schema!==d||!a.entries)return new Map;let t=new Map;for(let[o,n]of Object.entries(a.entries))!f(n)||o!==p(n)||t.set(o,n);return t}catch{return new Map}}s(E,"readSourceUploadCache");async function b(e,r){let a=await m(e.absolutePath),t=i("sha256").update(a).digest("hex"),o=p({...e,sha256:t}),n=r.get(o);return n&&n.sha256===t&&i("sha256").update(Buffer.from(n.contentsBase64,"base64")).digest("hex")===t?{file:e,entry:{path:e.path,type:"file",contentsBase64:n.contentsBase64},sha256:n.sha256}:{file:e,entry:{path:e.path,type:"file",contentsBase64:a.toString("base64")},sha256:t}}s(b,"materializeSourceUploadFile");async function A(e,r){let a={};for(let t of r){let o={path:t.file.path,size:t.file.size,mtimeMs:t.file.mtimeMs,ctimeMs:t.file.ctimeMs,sha256:t.sha256,contentsBase64:t.entry.contentsBase64};a[p(o)]=o}await h(c(),"source-upload.v1",l(e),{schema:d,generatedAt:new Date().toISOString(),entries:a})}s(A,"writeSourceUploadCache");function p(e){return`${e.path}\0${e.sha256}`}s(p,"cacheKeyForFile");function f(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let r=e;return typeof r.path=="string"&&typeof r.size=="number"&&typeof r.mtimeMs=="number"&&typeof r.ctimeMs=="number"&&typeof r.sha256=="string"&&typeof r.contentsBase64=="string"}s(f,"isCacheEntry");function l(e){return i("sha256").update(y.resolve(e)).digest("hex")}s(l,"sourceScope");export{U as a,E as b,b as c,A as d};
2
+ import{E as u,F as h}from"./chunk-SV7ZBEK2.js";import{f as c}from"./chunk-UGOK7VTC.js";import{a as s}from"./chunk-FTQLQJQV.js";import{createHash as i}from"node:crypto";import{readFile as m}from"node:fs/promises";import y from"node:path";var U=".openpond/source-upload-cache.json",d="openpond.source-upload-cache.v1";async function E(e){try{let a=(await u(c(),"source-upload.v1",l(e)))?.payload;if(!a)return new Map;if(a.schema!==d||!a.entries)return new Map;let t=new Map;for(let[o,n]of Object.entries(a.entries))!f(n)||o!==p(n)||t.set(o,n);return t}catch{return new Map}}s(E,"readSourceUploadCache");async function b(e,r){let a=await m(e.absolutePath),t=i("sha256").update(a).digest("hex"),o=p({...e,sha256:t}),n=r.get(o);return n&&n.sha256===t&&i("sha256").update(Buffer.from(n.contentsBase64,"base64")).digest("hex")===t?{file:e,entry:{path:e.path,type:"file",contentsBase64:n.contentsBase64},sha256:n.sha256}:{file:e,entry:{path:e.path,type:"file",contentsBase64:a.toString("base64")},sha256:t}}s(b,"materializeSourceUploadFile");async function A(e,r){let a={};for(let t of r){let o={path:t.file.path,size:t.file.size,mtimeMs:t.file.mtimeMs,ctimeMs:t.file.ctimeMs,sha256:t.sha256,contentsBase64:t.entry.contentsBase64};a[p(o)]=o}await h(c(),"source-upload.v1",l(e),{schema:d,generatedAt:new Date().toISOString(),entries:a})}s(A,"writeSourceUploadCache");function p(e){return`${e.path}\0${e.sha256}`}s(p,"cacheKeyForFile");function f(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let r=e;return typeof r.path=="string"&&typeof r.size=="number"&&typeof r.mtimeMs=="number"&&typeof r.ctimeMs=="number"&&typeof r.sha256=="string"&&typeof r.contentsBase64=="string"}s(f,"isCacheEntry");function l(e){return i("sha256").update(y.resolve(e)).digest("hex")}s(l,"sourceScope");export{U as a,E as b,b as c,A as d};