openpond 0.2.58 → 0.2.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (389) hide show
  1. package/README.md +27 -0
  2. package/dist/app-server.d.ts +8 -1
  3. package/dist/app-server.js +1 -1
  4. package/dist/chunks/acp-ARBNMIPT.js +2 -0
  5. package/dist/chunks/acp-agent-53COYDHB.js +21 -0
  6. package/dist/chunks/{actions-command-QU4H53OG.js → actions-command-6YSZ7EJS.js} +1 -1
  7. package/dist/chunks/{app-layer-NSTE5HIT.js → app-layer-TVG7KTW6.js} +1 -1
  8. package/dist/chunks/{app-server-connected-apps-JHGWLBXT.js → app-server-connected-apps-K62M6LCT.js} +1 -1
  9. package/dist/chunks/{app-server-evaluations-K52NAQLP.js → app-server-evaluations-RM6WXX3H.js} +1 -1
  10. package/dist/chunks/app-server-harness-services-RLKMWOQ4.js +2 -0
  11. package/dist/chunks/app-server-runtime-OKMEHNEU.js +2 -0
  12. package/dist/chunks/apps-YWZL2H34.js +2 -0
  13. package/dist/chunks/{chunk-DARVPBZ4.js → chunk-23P2O7PH.js} +1 -1
  14. package/dist/chunks/{chunk-PF5R6CMP.js → chunk-2GICDASL.js} +1 -1
  15. package/dist/chunks/{chunk-6MI4KKWF.js → chunk-2ITZW2CN.js} +1 -1
  16. package/dist/chunks/chunk-2MMCZHKL.js +2 -0
  17. package/dist/chunks/{chunk-ABD5M2D2.js → chunk-2PAJCXFC.js} +1 -1
  18. package/dist/chunks/chunk-2RNCXDJC.js +5 -0
  19. package/dist/chunks/{chunk-APB2STJK.js → chunk-2SUMZ73C.js} +1 -1
  20. package/dist/chunks/{chunk-YOQRYNLP.js → chunk-3CWRTKHY.js} +1 -1
  21. package/dist/chunks/{chunk-TRQQNFMO.js → chunk-44LWH5U6.js} +1 -1
  22. package/dist/chunks/{chunk-HPBQ4VTW.js → chunk-52KIORRX.js} +1 -1
  23. package/dist/chunks/{chunk-NHQ36THU.js → chunk-5RHYSQZ5.js} +1 -1
  24. package/dist/chunks/{chunk-3QIB5FXI.js → chunk-5ZBLCWEJ.js} +1 -1
  25. package/dist/chunks/{chunk-FTEOCCPB.js → chunk-637UACKH.js} +1 -1
  26. package/dist/chunks/chunk-655DQ6AX.js +145 -0
  27. package/dist/chunks/{chunk-N4FFQPLR.js → chunk-6GWOVHIG.js} +1 -1
  28. package/dist/chunks/chunk-6HQB3MQO.js +2 -0
  29. package/dist/chunks/{chunk-UKMA4R6X.js → chunk-7LZISGTA.js} +2 -2
  30. package/dist/chunks/{chunk-A6USMRWK.js → chunk-7RC5WPVT.js} +1 -1
  31. package/dist/chunks/{chunk-H6IW2R22.js → chunk-7YTHEMWI.js} +1 -1
  32. package/dist/chunks/{chunk-PCSIOUHF.js → chunk-A3L74U3W.js} +1 -1
  33. package/dist/chunks/{chunk-25MBPJVY.js → chunk-A66CSUBJ.js} +1 -1
  34. package/dist/chunks/{chunk-OUVIWDL2.js → chunk-AGVOGPAZ.js} +1 -1
  35. package/dist/chunks/{chunk-M4JWQSV7.js → chunk-AW5Q6NXT.js} +1 -1
  36. package/dist/chunks/{chunk-RWWE5OXU.js → chunk-B46HZ3MX.js} +1 -1
  37. package/dist/chunks/{chunk-KGNCKIFP.js → chunk-BIPQCJ5V.js} +1 -1
  38. package/dist/chunks/{chunk-HCYX6RHP.js → chunk-BIQ33JV5.js} +1 -1
  39. package/dist/chunks/{chunk-JFXWI3EN.js → chunk-BK63OQRW.js} +1 -1
  40. package/dist/chunks/{chunk-2D4Y3HNW.js → chunk-CFSIU6CW.js} +1 -1
  41. package/dist/chunks/{chunk-EIEZHFIW.js → chunk-D3RRUWNN.js} +1 -1
  42. package/dist/chunks/{chunk-X4OSOOSU.js → chunk-D4UX2O45.js} +1 -1
  43. package/dist/chunks/{chunk-GJ2ZJFDD.js → chunk-DG4TYVPF.js} +1 -1
  44. package/dist/chunks/{chunk-QIKWJ2AA.js → chunk-DGIEXZJV.js} +1 -1
  45. package/dist/chunks/{chunk-PRGBLQVH.js → chunk-DIGX56JY.js} +1 -1
  46. package/dist/chunks/{chunk-JYKRR7E5.js → chunk-DISNCX6R.js} +1 -1
  47. package/dist/chunks/{chunk-773TH7FN.js → chunk-DK7IKI7O.js} +1 -1
  48. package/dist/chunks/{chunk-74IIXVAE.js → chunk-DX7YEUNQ.js} +1 -1
  49. package/dist/chunks/{chunk-523TE4BI.js → chunk-E63VWAQA.js} +1 -1
  50. package/dist/chunks/{chunk-5MCNZCVQ.js → chunk-EL454L26.js} +1 -1
  51. package/dist/chunks/{chunk-OS3LO5J3.js → chunk-ENSB6ZTM.js} +1 -1
  52. package/dist/chunks/{chunk-EAPFMACH.js → chunk-ERJV5BMC.js} +1 -1
  53. package/dist/chunks/{chunk-RNIAFXMB.js → chunk-EXJGCNRS.js} +1 -1
  54. package/dist/chunks/chunk-F5KCCDQM.js +2 -0
  55. package/dist/chunks/chunk-FSQWAANK.js +3 -0
  56. package/dist/chunks/{chunk-Z54O534A.js → chunk-G5B3PB5X.js} +1 -1
  57. package/dist/chunks/{chunk-4D7HWVWD.js → chunk-GAWGIJQG.js} +1 -1
  58. package/dist/chunks/{chunk-IIZ4CWBX.js → chunk-GGGF5NHJ.js} +1 -1
  59. package/dist/chunks/{chunk-APB4O67E.js → chunk-GOYBYYPQ.js} +1 -1
  60. package/dist/chunks/{chunk-XDQMGUWL.js → chunk-H3BSIAQO.js} +1 -1
  61. package/dist/chunks/{chunk-EYPCBBMS.js → chunk-HCEJAOIF.js} +1 -1
  62. package/dist/chunks/{chunk-OPNRWESL.js → chunk-IFQCOSU6.js} +1 -1
  63. package/dist/chunks/chunk-IJHZBHEK.js +9 -0
  64. package/dist/chunks/{chunk-RAXOSUSW.js → chunk-ISFIDCIH.js} +1 -1
  65. package/dist/chunks/{chunk-OLLLZVHF.js → chunk-ITKTILKI.js} +1 -1
  66. package/dist/chunks/{chunk-D74JEERO.js → chunk-IUBARBGI.js} +1 -1
  67. package/dist/chunks/{chunk-O72BSKSO.js → chunk-J24I74EM.js} +1 -1
  68. package/dist/chunks/{chunk-H4QHIHMK.js → chunk-J7QGHA7G.js} +3 -3
  69. package/dist/chunks/chunk-JFXINDOQ.js +3 -0
  70. package/dist/chunks/{chunk-HIOKCIL7.js → chunk-JGWINTT5.js} +1 -1
  71. package/dist/chunks/{chunk-Q2QL6UWN.js → chunk-JHEFWB6O.js} +1 -1
  72. package/dist/chunks/{chunk-QNG27G3T.js → chunk-JHMS2WXM.js} +2 -2
  73. package/dist/chunks/{chunk-PSGGOZFM.js → chunk-JHR3LF2F.js} +1 -1
  74. package/dist/chunks/{chunk-JE7RJZOA.js → chunk-KGLJU66U.js} +3 -3
  75. package/dist/chunks/{chunk-XEOEKFG6.js → chunk-KJFRCVQC.js} +1 -1
  76. package/dist/chunks/chunk-KNO355LC.js +2 -0
  77. package/dist/chunks/{chunk-ZGTOK7ZK.js → chunk-LD7PGREF.js} +2 -2
  78. package/dist/chunks/{chunk-I7AQMAQI.js → chunk-LHA7RQBA.js} +6 -6
  79. package/dist/chunks/{chunk-6QSSIT62.js → chunk-LO3O45IX.js} +1 -1
  80. package/dist/chunks/{chunk-G3RXYI2L.js → chunk-M2SKXY5C.js} +2 -2
  81. package/dist/chunks/{chunk-2IHO4GDJ.js → chunk-M3ZQDPRS.js} +1 -1
  82. package/dist/chunks/{chunk-JDEEWOD7.js → chunk-M4ZF44H5.js} +1 -1
  83. package/dist/chunks/{chunk-Y4OWBBDD.js → chunk-M55H7KVR.js} +1 -1
  84. package/dist/chunks/{chunk-JAJ46T5X.js → chunk-MGKMIRYG.js} +1 -1
  85. package/dist/chunks/{chunk-4EQA2M7K.js → chunk-MJGU2JJ2.js} +2 -2
  86. package/dist/chunks/{chunk-65PL62KH.js → chunk-MS37ISA4.js} +2 -2
  87. package/dist/chunks/{chunk-NH6UUX5S.js → chunk-NCKXI2VB.js} +11 -11
  88. package/dist/chunks/chunk-NHUUCNAD.js +2 -0
  89. package/dist/chunks/{chunk-O6ULLQJ6.js → chunk-O3VP46SE.js} +1 -1
  90. package/dist/chunks/chunk-O4FBOUNX.js +2 -0
  91. package/dist/chunks/chunk-O6IFVTZT.js +9 -0
  92. package/dist/chunks/{chunk-5IPFI25K.js → chunk-O7B44IYN.js} +1 -1
  93. package/dist/chunks/{chunk-DMVD2RFZ.js → chunk-OGMDEA3Y.js} +1 -1
  94. package/dist/chunks/{chunk-BLXEAZCQ.js → chunk-OKBIWRHC.js} +1 -1
  95. package/dist/chunks/{chunk-FFRFSDBM.js → chunk-ON2RNOCG.js} +1 -1
  96. package/dist/chunks/{chunk-LQQNBVEB.js → chunk-ONDCV5QC.js} +1 -1
  97. package/dist/chunks/{chunk-UCPGRPWY.js → chunk-OQ4VGCRG.js} +1 -1
  98. package/dist/chunks/{chunk-YNH3NMPF.js → chunk-OWK7HU5I.js} +1 -1
  99. package/dist/chunks/{chunk-DBK66CJP.js → chunk-OY5HC2P6.js} +1 -1
  100. package/dist/chunks/{chunk-T5AACNJI.js → chunk-P7HRF4FM.js} +1 -1
  101. package/dist/chunks/{chunk-7ED24PP6.js → chunk-PCNLC5H3.js} +1 -1
  102. package/dist/chunks/{chunk-ES2ISFJC.js → chunk-PF56N7ZY.js} +1 -1
  103. package/dist/chunks/{chunk-VVCKLCF3.js → chunk-PKALOVHC.js} +2 -2
  104. package/dist/chunks/{chunk-ZCHXGRRU.js → chunk-PR5TYTY4.js} +1 -1
  105. package/dist/chunks/{chunk-Q4TBTRIG.js → chunk-PWK5Z5S3.js} +1 -1
  106. package/dist/chunks/chunk-PXS4SVQG.js +16 -0
  107. package/dist/chunks/{chunk-AY64VY4E.js → chunk-QGOPYQW3.js} +1 -1
  108. package/dist/chunks/{chunk-7E6T7GP5.js → chunk-R7YEURUQ.js} +1 -1
  109. package/dist/chunks/{chunk-ACYFMLWG.js → chunk-RCA6NGVA.js} +2 -2
  110. package/dist/chunks/{chunk-DUURYZOI.js → chunk-RG3NH6YQ.js} +1 -1
  111. package/dist/chunks/{chunk-7SC46OFC.js → chunk-RJIUOLWY.js} +1 -1
  112. package/dist/chunks/{chunk-F4KOGISR.js → chunk-RXE3FYMJ.js} +1 -1
  113. package/dist/chunks/chunk-RYGWCN2R.js +2 -0
  114. package/dist/chunks/{chunk-VYLGI3IH.js → chunk-SFNCAPCJ.js} +1 -1
  115. package/dist/chunks/{chunk-Z4Z5UOZM.js → chunk-SG6JZ7HD.js} +1 -1
  116. package/dist/chunks/{chunk-XX6SMFDY.js → chunk-SKRNWRKV.js} +5 -5
  117. package/dist/chunks/{chunk-ZRDGQDZL.js → chunk-SLZH4Z6C.js} +1 -1
  118. package/dist/chunks/{chunk-WN3V6KDN.js → chunk-SPDSSMFD.js} +1 -1
  119. package/dist/chunks/chunk-STWRTNRK.js +2 -0
  120. package/dist/chunks/{chunk-HZEIRHEB.js → chunk-T5J7HIHR.js} +1 -1
  121. package/dist/chunks/{chunk-ROGF26KV.js → chunk-TBUAQWFS.js} +1 -1
  122. package/dist/chunks/{chunk-ZUJ3XUCP.js → chunk-TEPRCBDV.js} +1 -1
  123. package/dist/chunks/{chunk-HDGTHRY7.js → chunk-TOFMA2L5.js} +2 -2
  124. package/dist/chunks/{chunk-QOGJAQDO.js → chunk-UFHLLSCE.js} +1 -1
  125. package/dist/chunks/{chunk-TTVS6JMC.js → chunk-UJKQLO6B.js} +2 -2
  126. package/dist/chunks/{chunk-OQKJGTTO.js → chunk-UZQNFTLR.js} +1 -1
  127. package/dist/chunks/{chunk-F74GBN6K.js → chunk-V2HMWCT6.js} +1 -1
  128. package/dist/chunks/{chunk-6ZFPQYHG.js → chunk-V4KT5FCJ.js} +1 -1
  129. package/dist/chunks/{chunk-TVQAPBLZ.js → chunk-VHSX3JPX.js} +1 -1
  130. package/dist/chunks/{chunk-SDXFLO7J.js → chunk-W2SXOGTQ.js} +1 -1
  131. package/dist/chunks/{chunk-FUOEIDMA.js → chunk-WDEO44UN.js} +1 -1
  132. package/dist/chunks/{chunk-4NESNOK5.js → chunk-WEHBK3MC.js} +1 -1
  133. package/dist/chunks/{chunk-4EPSHPZL.js → chunk-WGX7WY4N.js} +1 -1
  134. package/dist/chunks/{chunk-NC27T4AB.js → chunk-WHREO7A2.js} +1 -1
  135. package/dist/chunks/{chunk-RNQF63ZR.js → chunk-WS2ZZBAQ.js} +4 -4
  136. package/dist/chunks/{chunk-DIO5CB6U.js → chunk-WYZWDMMF.js} +1 -1
  137. package/dist/chunks/{chunk-MQULU465.js → chunk-XO3H32KX.js} +1 -1
  138. package/dist/chunks/{chunk-EIRYMSEG.js → chunk-XQBIHPPX.js} +1 -1
  139. package/dist/chunks/chunk-XRKFTPHD.js +2 -0
  140. package/dist/chunks/{chunk-B7RFL4N2.js → chunk-XSCIOQYE.js} +1 -1
  141. package/dist/chunks/{chunk-TJ6GVTYB.js → chunk-XTWEWYK7.js} +9 -9
  142. package/dist/chunks/{chunk-JUHZ5S3R.js → chunk-Y3GIM6WK.js} +1 -1
  143. package/dist/chunks/{chunk-74ZXXBGN.js → chunk-Y54RKLOI.js} +1 -1
  144. package/dist/chunks/{chunk-SWUEFLOH.js → chunk-Y777GISF.js} +1 -1
  145. package/dist/chunks/{chunk-EKM2D7JU.js → chunk-YDU3S6UT.js} +1 -1
  146. package/dist/chunks/{chunk-UGL7WF3W.js → chunk-YOZIZYSC.js} +1 -1
  147. package/dist/chunks/{chunk-OSIO7PLX.js → chunk-YQKOB56U.js} +1 -1
  148. package/dist/chunks/chunk-YVNDDNMK.js +3 -0
  149. package/dist/chunks/chunk-ZAZKJJOT.js +86 -0
  150. package/dist/chunks/{chunk-QL4OIPEZ.js → chunk-ZR7LIMJS.js} +2 -2
  151. package/dist/chunks/{chunk-L3KCP52O.js → chunk-ZTJOOY2F.js} +1 -1
  152. package/dist/chunks/{chunk-GPVCOEUH.js → chunk-ZTVXRZ6D.js} +1 -1
  153. package/dist/chunks/cli-CNYNXKGQ.js +2 -0
  154. package/dist/chunks/configuration-command-5K7EE2J5.js +2 -0
  155. package/dist/chunks/connected-app-executor-E25XCNAS.js +2 -0
  156. package/dist/chunks/connected-evidence-QNSO5BTF.js +2 -0
  157. package/dist/chunks/connection-Y2KCMBYD.js +2 -0
  158. package/dist/chunks/{continual-6CQAMTTR.js → continual-SOO3QBNQ.js} +1 -1
  159. package/dist/chunks/core-commands-ZTWPYAFQ.js +2 -0
  160. package/dist/chunks/datasets-XPUMWGOC.js +2 -0
  161. package/dist/chunks/desktop-test-HVSW4JHY.js +3 -0
  162. package/dist/chunks/dist-4N6AHWNN.js +2 -0
  163. package/dist/chunks/{dist-OMGUJYPD.js → dist-N6R6VNFD.js} +1 -1
  164. package/dist/chunks/{dist-VYC5VMQB.js → dist-QN7WKZ2D.js} +1 -1
  165. package/dist/chunks/{enclave-QS4BUNDU.js → enclave-VURYNILU.js} +1 -1
  166. package/dist/chunks/evaluation-coordination-AOTFPVMS.js +2 -0
  167. package/dist/chunks/experiment-improvements-75CN3VI7.js +2 -0
  168. package/dist/chunks/experiments-AGAHM2AK.js +2 -0
  169. package/dist/chunks/{experiments-VFQGE4HC.js → experiments-DYSHYBGB.js} +1 -1
  170. package/dist/chunks/{extension-XKXXOP5N.js → extension-UT4CSDJF.js} +1 -1
  171. package/dist/chunks/help-KU52CFMW.js +8 -0
  172. package/dist/chunks/host-profile-evaluation-tools-LZDMQCMT.js +2 -0
  173. package/dist/chunks/host-profile-external-dataset-VK3NJHMC.js +2 -0
  174. package/dist/chunks/hosted-app-server-composition-P7V7K7CG.js +2 -0
  175. package/dist/chunks/{hosted-experiment-improvement-HVMDGS75.js → hosted-experiment-improvement-P433KDX2.js} +1 -1
  176. package/dist/chunks/hosted-harness-runtime-Y4DONWPC.js +2 -0
  177. package/dist/chunks/{hosted-profile-candidate-EXNN6MVN.js → hosted-profile-candidate-72MMPN6U.js} +1 -1
  178. package/dist/chunks/hosted-profile-compiler-RXHLK224.js +2 -0
  179. package/dist/chunks/hosted-profile-evaluation-control-LS4DCSDO.js +2 -0
  180. package/dist/chunks/{hosted-profile-evaluation-inspection-ZUANDYZ6.js → hosted-profile-evaluation-inspection-3Q6EHO66.js} +1 -1
  181. package/dist/chunks/{hosted-profile-evaluation-preparation-ORVZ6MBD.js → hosted-profile-evaluation-preparation-ZD27HNLF.js} +1 -1
  182. package/dist/chunks/{hosted-tasksets-ANAE2PIW.js → hosted-tasksets-V2PQZJN4.js} +1 -1
  183. package/dist/chunks/human-review-4FJFINQX.js +2 -0
  184. package/dist/chunks/import-GBHSLA3G.js +3 -0
  185. package/dist/chunks/{learning-ACEVFL5M.js → learning-U3FZL5YB.js} +1 -1
  186. package/dist/chunks/local-harness-improvement-runtime-UP2P7UT4.js +2 -0
  187. package/dist/chunks/local-harness-taskset-review-ZNOKSPJJ.js +2 -0
  188. package/dist/chunks/{local-scope-HVF2GZ5W.js → local-scope-62GWHDXS.js} +1 -1
  189. package/dist/chunks/{model-projects-QPO22JPA.js → model-projects-LQ4C6R3X.js} +1 -1
  190. package/dist/chunks/opchat-Q4PIWPYW.js +3 -0
  191. package/dist/chunks/organizations-TEH6HBQ3.js +2 -0
  192. package/dist/chunks/{profile-TFZMUEDR.js → profile-SWPVCGTR.js} +1 -1
  193. package/dist/chunks/{profile-training-source-6GOT7AHM.js → profile-training-source-J73ZLNSC.js} +1 -1
  194. package/dist/chunks/project-action-payload-OU3ZPHW7.js +2 -0
  195. package/dist/chunks/project-agent-J7ILCRBS.js +2 -0
  196. package/dist/chunks/{published-experiment-source-HVP5IGRH.js → published-experiment-source-HVHKSYDL.js} +1 -1
  197. package/dist/chunks/refiner-profile-service-E7YU4E3N.js +2 -0
  198. package/dist/chunks/{runtime-A7OZXM43.js → runtime-LIPHPKKJ.js} +2 -2
  199. package/dist/chunks/sandbox-command-G6KID3OP.js +2 -0
  200. package/dist/chunks/{sandbox-template-C4V6T36U.js → sandbox-template-MZTMAUFS.js} +1 -1
  201. package/dist/chunks/saved-work-LOUWLF37.js +2 -0
  202. package/dist/chunks/{send-turn-XTAIS2JN.js → send-turn-UEUEGY5W.js} +1 -1
  203. package/dist/chunks/{src-R36AGJY7.js → src-7WMZOWZZ.js} +107 -100
  204. package/dist/chunks/{src-DZL5T2MT.js → src-MVAK6D6Y.js} +1 -1
  205. package/dist/chunks/standalone-experiment-turn-owner-YRKEOEJ2.js +2 -0
  206. package/dist/chunks/{store-continual-support-reviews-LJPNG4SP.js → store-continual-support-reviews-FJLLNKCY.js} +1 -1
  207. package/dist/chunks/{store-conversation-serving-KPC62UEY.js → store-conversation-serving-4KWR4IZY.js} +1 -1
  208. package/dist/chunks/{store-create-improve-SW5FTBTL.js → store-create-improve-JWBJZRAU.js} +1 -1
  209. package/dist/chunks/{store-datasets-WMA7AJKN.js → store-datasets-4N2M6Y3K.js} +2 -2
  210. package/dist/chunks/{store-evaluation-results-ZO6R653G.js → store-evaluation-results-OBM4623U.js} +1 -1
  211. package/dist/chunks/{store-harness-memory-VINCZ4GK.js → store-harness-memory-4HUEMRCD.js} +1 -1
  212. package/dist/chunks/{store-harness-refinement-candidates-EA5KFQPH.js → store-harness-refinement-candidates-NMRWMN23.js} +1 -1
  213. package/dist/chunks/store-harness-workspaces-BGONIQDY.js +2 -0
  214. package/dist/chunks/{store-human-review-7QQ7ZQ6P.js → store-human-review-J75SIZAL.js} +1 -1
  215. package/dist/chunks/store-learned-preference-migration-validation-VLASM4CT.js +2 -0
  216. package/dist/chunks/store-learning-TUCQFBLT.js +2 -0
  217. package/dist/chunks/{store-learning-credentials-WZQJ4HPJ.js → store-learning-credentials-S4RF57NV.js} +1 -1
  218. package/dist/chunks/{store-local-experiments-SAULQSBN.js → store-local-experiments-LULRLTII.js} +5 -5
  219. package/dist/chunks/{store-model-batch-review-VKLDYGH3.js → store-model-batch-review-SVL4MT6D.js} +1 -1
  220. package/dist/chunks/{store-model-configuration-BYRJUR3C.js → store-model-configuration-ZHDSM3XM.js} +2 -2
  221. package/dist/chunks/{store-preference-comparison-LV32MHVL.js → store-preference-comparison-YMMCKXS5.js} +1 -1
  222. package/dist/chunks/{store-schedules-VGTEQVKH.js → store-schedules-6Z4QS3NU.js} +1 -1
  223. package/dist/chunks/{store-sidebar-file-bookmarks-VB5GTLFY.js → store-sidebar-file-bookmarks-MX6EP6OB.js} +2 -2
  224. package/dist/chunks/{store-sidebar-preferences-GWIOG2NH.js → store-sidebar-preferences-VYREPW26.js} +1 -1
  225. package/dist/chunks/{store-subagents-T7R2Z6TB.js → store-subagents-WGBCRALX.js} +1 -1
  226. package/dist/chunks/{store-task-inbox-QPE44OSS.js → store-task-inbox-43BNZSB7.js} +6 -6
  227. package/dist/chunks/{store-task-inventory-I3RDRI52.js → store-task-inventory-AEW4POAJ.js} +2 -2
  228. package/dist/chunks/{store-taskset-drafts-2IULRV2W.js → store-taskset-drafts-DKFO2CYB.js} +1 -1
  229. package/dist/chunks/{store-training-B2TW2MLA.js → store-training-6PFFR6ST.js} +1 -1
  230. package/dist/chunks/{store-training-jobs-VBNG23RL.js → store-training-jobs-ANDEBQ67.js} +2 -2
  231. package/dist/chunks/{store-training-models-OMV5FIC4.js → store-training-models-OOI4ZJPX.js} +2 -2
  232. package/dist/chunks/{store-usage-IE2U2FD3.js → store-usage-U72RNW64.js} +1 -1
  233. package/dist/chunks/{store-work-evidence-QQDKM5AQ.js → store-work-evidence-NY5OBATB.js} +1 -1
  234. package/dist/chunks/{taskset-EQRFQBYM.js → taskset-SL3YOXW7.js} +1 -1
  235. package/dist/chunks/{taskset-packages-XC6HEE3K.js → taskset-packages-3PCEYYDA.js} +1 -1
  236. package/dist/chunks/{teams-bot-EAPGPTHZ.js → teams-bot-IDEF3BMI.js} +1 -1
  237. package/dist/chunks/{training-UF6RPI4T.js → training-57ISIC7U.js} +1 -1
  238. package/dist/chunks/web-search-222Y63QW.js +2 -0
  239. package/dist/chunks/{workspaces-EKKE5NAC.js → workspaces-5DF4H5EX.js} +1 -1
  240. package/dist/cli.js +1 -1
  241. package/dist/index.js +1 -1
  242. package/dist/sandbox-template/manifest.js +1 -1
  243. package/dist/web/assets/{App-CaRMZoxo.css → App-DbYvV_W6.css} +1 -1
  244. package/dist/web/assets/App-nzE7JU_O.js +154 -0
  245. package/dist/web/assets/{AppDialog-t2Fx5tK3.js → AppDialog-VtNvqbDm.js} +1 -1
  246. package/dist/web/assets/{AppTerminalPanel-Dj1Y32oI.js → AppTerminalPanel-BMfKdrrN.js} +2 -2
  247. package/dist/web/assets/AppsView-CdWyrDEb.js +1 -0
  248. package/dist/web/assets/{BrowserSidebar-jhWi4rVm.js → BrowserSidebar-CtOIciOa.js} +1 -1
  249. package/dist/web/assets/{CartesianChart-C1DIx0Ia.js → CartesianChart-u1lvLM30.js} +1 -1
  250. package/dist/web/assets/{CollaborationTabs-Bdr-HmOL.js → CollaborationTabs-CaBfDYRW.js} +1 -1
  251. package/dist/web/assets/{CommandMenu-Ux2yOHAc.js → CommandMenu-CFW3WJ11.js} +1 -1
  252. package/dist/web/assets/{CommunityView-DPEeVKFn.js → CommunityView-D2EjaeuH.js} +1 -1
  253. package/dist/web/assets/ComposerCreateImproveStrip-6wYSJdzv.js +1 -0
  254. package/dist/web/assets/ConversationImportsSettings-BJ4QhF7p.js +1 -0
  255. package/dist/web/assets/ConversationImportsSettings-PfUa8V7X.css +1 -0
  256. package/dist/web/assets/{GetStartedView-CFHP0AaI.js → GetStartedView-DBcOwIJn.js} +1 -1
  257. package/dist/web/assets/{HostedModelLearningReview-D8BGTPVN.js → HostedModelLearningReview-BNpK6_W9.js} +1 -1
  258. package/dist/web/assets/{HostedModelLearningSettings-JS1S7vNO.js → HostedModelLearningSettings-SrsdeeoA.js} +1 -1
  259. package/dist/web/assets/{LabModelVersionDetailPage-Dx5Q3xV2.js → LabModelVersionDetailPage-Cd6bRHt9.js} +1 -1
  260. package/dist/web/assets/LabSkillSidebar-CQfvel4w.js +1 -0
  261. package/dist/web/assets/{LabsRoute-CyYF8-dw.js → LabsRoute-sXLJt1KR.js} +4 -4
  262. package/dist/web/assets/MainChatThread-dlDDK2JM.js +2 -0
  263. package/dist/web/assets/MainPane-DCz38-qy.js +65 -0
  264. package/dist/web/assets/{MarkdownText-BR4V6lNO.js → MarkdownText-Drjq6-JM.js} +1 -1
  265. package/dist/web/assets/{NativeSkillSidebar-DU9IEgIO.js → NativeSkillSidebar-jncZijt-.js} +1 -1
  266. package/dist/web/assets/{NewExperienceSwitcher-mIy6FzCj.js → NewExperienceSwitcher-DXKzoMaM.js} +1 -1
  267. package/dist/web/assets/{NewProjectDialog-RfTZTHxl.js → NewProjectDialog-DIyjAxJG.js} +1 -1
  268. package/dist/web/assets/OutputsPage-Dy1cNr3n.js +1 -0
  269. package/dist/web/assets/{ProjectsPage-CE6QUB-b.js → ProjectsPage-D2EeybIv.js} +1 -1
  270. package/dist/web/assets/RightChatPanelStack-4wUL-W9_.js +1 -0
  271. package/dist/web/assets/{RightSidebarHomePanel-CK0rP3WT.js → RightSidebarHomePanel-Bd_AHUp8.js} +1 -1
  272. package/dist/web/assets/{ScheduledWorkPage-vOrYv8pp.js → ScheduledWorkPage-BJkSzwz2.js} +1 -1
  273. package/dist/web/assets/{SettingsView-DCKVrfjj.js → SettingsView-BhcP72KH.js} +4 -4
  274. package/dist/web/assets/SettingsView-DjjnCnlb.css +1 -0
  275. package/dist/web/assets/{TeamChatView-Bwrjr-vk.js → TeamChatView-CR0fdicZ.js} +2 -2
  276. package/dist/web/assets/{TerminalOverlay-DhPoKZAq.js → TerminalOverlay-DGrZRZ_3.js} +10 -10
  277. package/dist/web/assets/TrainingCreationPanel-BsTG7aFS.js +1 -0
  278. package/dist/web/assets/{TrainingDraftPanel-C9cRX5qf.js → TrainingDraftPanel-ByErrht7.js} +1 -1
  279. package/dist/web/assets/{UsageSettingsSection-CrdcSGeW.js → UsageSettingsSection-DeYTJbcM.js} +1 -1
  280. package/dist/web/assets/{WorkSidebarPanel-DSSikNFQ.js → WorkSidebarPanel-DcNvEEoy.js} +1 -1
  281. package/dist/web/assets/{WorkspaceDiffPanel-BAFo0CPN.js → WorkspaceDiffPanel-CdPRcYWN.js} +3 -3
  282. package/dist/web/assets/{WorkspaceEnvironmentMenu-BVHAhwnJ.js → WorkspaceEnvironmentMenu-xUYg-iGn.js} +18 -18
  283. package/dist/web/assets/{WorkspaceGitDialogs-CwVoiDQ2.js → WorkspaceGitDialogs-CBViLL3S.js} +1 -1
  284. package/dist/web/assets/{WorkspaceMonacoEditor-TxLyhzNp.js → WorkspaceMonacoEditor-frxie2_S.js} +3 -3
  285. package/dist/web/assets/agent-connections-D7ao-vbU.js +1 -0
  286. package/dist/web/assets/{arrow-up-right-C9aE8Mfz.js → arrow-up-right-DCWPxdbD.js} +1 -1
  287. package/dist/web/assets/{chunk-P3BRSSRD-DUGfuKA8.js → chunk-P3BRSSRD-B5JXa0Nh.js} +1 -1
  288. package/dist/web/assets/{clipboard-Dk158Qp4.js → clipboard-B-GnMVLp.js} +1 -1
  289. package/dist/web/assets/{cloud-upload-k9eqBsHr.js → cloud-upload-DpaGFZ9J.js} +1 -1
  290. package/dist/web/assets/{cssMode-CO35ARZp.js → cssMode-DJHE7R3W.js} +1 -1
  291. package/dist/web/assets/{folder-open-sYgceW_f.js → folder-open-B-DFLDFH.js} +1 -1
  292. package/dist/web/assets/{folder-plus-CS0R49m9.js → folder-plus-CPXxPvSH.js} +1 -1
  293. package/dist/web/assets/{git-commit-horizontal-DrGxH2h4.js → git-commit-horizontal-DCTzcivA.js} +1 -1
  294. package/dist/web/assets/{htmlMode-REMmzdfq.js → htmlMode-DxZVBAYd.js} +1 -1
  295. package/dist/web/assets/index-BojtIRzO.css +1 -0
  296. package/dist/web/assets/{index-C8aCGagb.js → index-Di1MU6Xr.js} +2 -2
  297. package/dist/web/assets/{info-DLdbiUrh.js → info-BMxsR_bn.js} +1 -1
  298. package/dist/web/assets/{jsonMode-KEdMfkIf.js → jsonMode-CzWoMkpp.js} +1 -1
  299. package/dist/web/assets/{lspLanguageFeatures-5KZwEoxW.js → lspLanguageFeatures-15K7ND6Q.js} +1 -1
  300. package/dist/web/assets/{minimize-2-CqcI4zcM.js → minimize-2-DwUgqXoR.js} +1 -1
  301. package/dist/web/assets/{monaco.contribution-Cly9Wt7L.js → monaco.contribution-BBLKjER5.js} +2 -2
  302. package/dist/web/assets/{monaco.contribution-omszXBEj.js → monaco.contribution-DBjvSu8p.js} +2 -2
  303. package/dist/web/assets/{monaco.contribution-DO10L0zW.js → monaco.contribution-DUWvjhIG.js} +2 -2
  304. package/dist/web/assets/{monaco.contribution-BJGj65F9.js → monaco.contribution-w0zfkYLX.js} +2 -2
  305. package/dist/web/assets/{monitor-BFVCcbxp.js → monitor-Ihu5LVYx.js} +1 -1
  306. package/dist/web/assets/{play-C469pVZq.js → play-D_YGCdxU.js} +1 -1
  307. package/dist/web/assets/{python-Dw0YcVy9.js → python-Q4OuoXYc.js} +1 -1
  308. package/dist/web/assets/{save-CtSjPydi.js → save-DJYUOhtD.js} +1 -1
  309. package/dist/web/assets/{square-BuImvLhT.js → square-DXtoCBNw.js} +1 -1
  310. package/dist/web/assets/{toggleHighContrast-DjCO9lIP.js → toggleHighContrast-CaNeuWVE.js} +1 -1
  311. package/dist/web/assets/{tsMode-BAOnxKd6.js → tsMode-CJnQ2wmM.js} +1 -1
  312. package/dist/web/assets/{upload-2JkFZo3h.js → upload-fCP3_OEO.js} +1 -1
  313. package/dist/web/assets/{useLocalAgentSchedules-BNqAisfS.js → useLocalAgentSchedules-BFoH_gwZ.js} +1 -1
  314. package/dist/web/assets/useProviderSettings-2eysgqiA.js +5 -0
  315. package/dist/web/assets/{useProviderSettings-CmL_BaxP.css → useProviderSettings-Cktvzinz.css} +1 -1
  316. package/dist/web/assets/{useSessionTurnCache-BHU2-Jmz.js → useSessionTurnCache-DLF5SPD-.js} +1 -1
  317. package/dist/web/assets/{wifi-off-CpOAH62M.js → wifi-off-DZoiFrRz.js} +1 -1
  318. package/dist/web/assets/{workers-0QvlA2T5.js → workers-D5nr74M-.js} +1 -1
  319. package/dist/web/assets/{yaml-BK3qxo7D.js → yaml-CwsoTJmk.js} +1 -1
  320. package/dist/web/index.html +2 -2
  321. package/docs/command-reference.md +22 -3
  322. package/docs/conversation-imports.md +57 -0
  323. package/package.json +1 -1
  324. package/dist/chunks/app-server-harness-services-QMUOEYOA.js +0 -2
  325. package/dist/chunks/app-server-runtime-ISGGLQHU.js +0 -2
  326. package/dist/chunks/apps-BKTOR4F7.js +0 -2
  327. package/dist/chunks/chunk-3VUATFZD.js +0 -2
  328. package/dist/chunks/chunk-3Z47M3YY.js +0 -2
  329. package/dist/chunks/chunk-6UDGARFC.js +0 -143
  330. package/dist/chunks/chunk-FV2R5RUN.js +0 -3
  331. package/dist/chunks/chunk-HY3GOBFJ.js +0 -58
  332. package/dist/chunks/chunk-I3HZKJB3.js +0 -2
  333. package/dist/chunks/chunk-I3VVWNUW.js +0 -5
  334. package/dist/chunks/chunk-KG325WTN.js +0 -2
  335. package/dist/chunks/chunk-Q5LEXXJG.js +0 -16
  336. package/dist/chunks/chunk-QDC4OW3S.js +0 -2
  337. package/dist/chunks/chunk-SDAUS5PY.js +0 -2
  338. package/dist/chunks/chunk-VRIEKBBH.js +0 -9
  339. package/dist/chunks/chunk-WJ43MJ3F.js +0 -2
  340. package/dist/chunks/chunk-X2HIHF2I.js +0 -2
  341. package/dist/chunks/chunk-YBT2NB32.js +0 -2
  342. package/dist/chunks/chunk-ZTNHW2K7.js +0 -10
  343. package/dist/chunks/cli-XZENDZ7Z.js +0 -2
  344. package/dist/chunks/configuration-command-6C5UO7GE.js +0 -2
  345. package/dist/chunks/connected-app-executor-LQNIU5NR.js +0 -2
  346. package/dist/chunks/connected-evidence-GH2ATNEX.js +0 -2
  347. package/dist/chunks/connection-HTF6CC7M.js +0 -2
  348. package/dist/chunks/core-commands-A2DGGIPS.js +0 -2
  349. package/dist/chunks/datasets-7BNMVJOY.js +0 -2
  350. package/dist/chunks/desktop-test-3CUHVLXV.js +0 -3
  351. package/dist/chunks/dist-ZVJPJLXR.js +0 -2
  352. package/dist/chunks/evaluation-coordination-XEF5L7KZ.js +0 -2
  353. package/dist/chunks/experiment-improvements-KRX2DP27.js +0 -2
  354. package/dist/chunks/experiments-DFGQYA4O.js +0 -2
  355. package/dist/chunks/help-S7THC6IE.js +0 -8
  356. package/dist/chunks/host-profile-evaluation-tools-JOFBL5OF.js +0 -2
  357. package/dist/chunks/host-profile-external-dataset-K3ICDHIP.js +0 -2
  358. package/dist/chunks/hosted-app-server-composition-T5IWGOTA.js +0 -2
  359. package/dist/chunks/hosted-harness-runtime-YCKB6NBI.js +0 -2
  360. package/dist/chunks/hosted-profile-compiler-IYLLHCRY.js +0 -2
  361. package/dist/chunks/hosted-profile-evaluation-control-TJVER3NW.js +0 -2
  362. package/dist/chunks/human-review-WR777ODH.js +0 -2
  363. package/dist/chunks/import-MLZUHITH.js +0 -4
  364. package/dist/chunks/local-harness-improvement-runtime-QRFGPFRM.js +0 -2
  365. package/dist/chunks/local-harness-taskset-review-HR7KLY4B.js +0 -2
  366. package/dist/chunks/opchat-T4QTNEIY.js +0 -3
  367. package/dist/chunks/organizations-75L5DZDV.js +0 -2
  368. package/dist/chunks/project-action-payload-JDS6OQAW.js +0 -2
  369. package/dist/chunks/project-agent-6RRO233B.js +0 -2
  370. package/dist/chunks/refiner-profile-service-FDTQKY33.js +0 -2
  371. package/dist/chunks/sandbox-command-IU5XFTJP.js +0 -2
  372. package/dist/chunks/saved-work-SHEEDZ6Z.js +0 -2
  373. package/dist/chunks/standalone-experiment-turn-owner-JCY5LL5R.js +0 -2
  374. package/dist/chunks/store-harness-workspaces-XUM4Z66X.js +0 -2
  375. package/dist/chunks/store-learned-preference-migration-validation-NADPXOTG.js +0 -2
  376. package/dist/chunks/store-learning-WLG6KFIO.js +0 -2
  377. package/dist/chunks/web-search-CZ3NCLPY.js +0 -2
  378. package/dist/web/assets/App-s-CJswyt.js +0 -154
  379. package/dist/web/assets/AppsView-BYE5EBDJ.js +0 -1
  380. package/dist/web/assets/ComposerCreateImproveStrip-CEgh4OtN.js +0 -1
  381. package/dist/web/assets/LabSkillSidebar-BxffN-pN.js +0 -1
  382. package/dist/web/assets/MainChatThread-DZpcFRFl.js +0 -2
  383. package/dist/web/assets/MainPane-5DTtwVCk.js +0 -65
  384. package/dist/web/assets/OutputsPage-Cr1Spf7S.js +0 -1
  385. package/dist/web/assets/RightChatPanelStack-T6VRWuHo.js +0 -1
  386. package/dist/web/assets/SettingsView-Dulr_xlq.css +0 -1
  387. package/dist/web/assets/TrainingCreationPanel-BXHfohNm.js +0 -1
  388. package/dist/web/assets/index-3iPNbbER.css +0 -1
  389. package/dist/web/assets/useProviderSettings-C4L4wDoh.js +0 -5
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as u}from"./chunk-UKMA4R6X.js";import"./chunk-BFKYRQMA.js";import"./chunk-6QSSIT62.js";import"./chunk-3QIB5FXI.js";import{b as m}from"./chunk-FWIPHEVA.js";import{a as l}from"./chunk-ZZWAQBA2.js";import"./chunk-YR5ID2SS.js";import"./chunk-I7AQMAQI.js";import"./chunk-Z4Z5UOZM.js";import"./chunk-6FA3GG5B.js";import"./chunk-FFRFSDBM.js";import"./chunk-KGNCKIFP.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import{a as i}from"./chunk-FTQLQJQV.js";async function x(o){let n=await u(),e=process.env.OPENPOND_SANDBOX_API_KEY?.trim()||process.env.OPENPOND_API_KEY?.trim()||n.token?.trim();if(!e)throw new Error("OpenPond account API key is required to resolve connected apps.");let t=process.env.OPENPOND_SANDBOX_API_URL?.trim(),s=m({apiKey:e,...t?{sandboxApiUrl:l(t)}:{baseUrl:n.apiBaseUrl}}),d=o.status??"active";if(o.teamId?.trim())return s.integrationConnections({teamId:o.teamId.trim(),status:d});let p=await s.listOrganizations(),a=I(p);if(a.length===0)return{teamId:null,connections:[]};let c=(await Promise.all(a.map(r=>s.integrationConnections({teamId:r,status:d}).catch(()=>null)))).filter(r=>!!r);return{teamId:c.find(r=>r.connections.length>0)?.teamId??c[0]?.teamId??a[0]??null,connections:f(c)}}i(x,"listAppServerIntegrationConnections");function I(o){return Array.from(new Set(o.flatMap(n=>{if(typeof n.status=="string"&&n.status!=="active")return[];let e=n.id,t=typeof n.teamId=="string"?n.teamId:typeof e=="string"?e:"";return t.trim()?[t.trim()]:[]})))}i(I,"activeTeamIds");function f(o){let n=new Map;for(let e of o)for(let t of e.connections)n.set(t.id,t);return[...n.values()]}i(f,"mergeConnections");export{x as listAppServerIntegrationConnections};
2
+ import{a as u}from"./chunk-7LZISGTA.js";import"./chunk-BFKYRQMA.js";import"./chunk-LO3O45IX.js";import"./chunk-5ZBLCWEJ.js";import{b as m}from"./chunk-FWIPHEVA.js";import{a as l}from"./chunk-ZZWAQBA2.js";import"./chunk-YR5ID2SS.js";import"./chunk-6FA3GG5B.js";import"./chunk-LHA7RQBA.js";import"./chunk-SG6JZ7HD.js";import"./chunk-ON2RNOCG.js";import"./chunk-H7IWJN7L.js";import"./chunk-BIPQCJ5V.js";import"./chunk-PF56N7ZY.js";import{a as i}from"./chunk-FTQLQJQV.js";async function x(o){let n=await u(),e=process.env.OPENPOND_SANDBOX_API_KEY?.trim()||process.env.OPENPOND_API_KEY?.trim()||n.token?.trim();if(!e)throw new Error("OpenPond account API key is required to resolve connected apps.");let t=process.env.OPENPOND_SANDBOX_API_URL?.trim(),s=m({apiKey:e,...t?{sandboxApiUrl:l(t)}:{baseUrl:n.apiBaseUrl}}),d=o.status??"active";if(o.teamId?.trim())return s.integrationConnections({teamId:o.teamId.trim(),status:d});let p=await s.listOrganizations(),a=I(p);if(a.length===0)return{teamId:null,connections:[]};let c=(await Promise.all(a.map(r=>s.integrationConnections({teamId:r,status:d}).catch(()=>null)))).filter(r=>!!r);return{teamId:c.find(r=>r.connections.length>0)?.teamId??c[0]?.teamId??a[0]??null,connections:f(c)}}i(x,"listAppServerIntegrationConnections");function I(o){return Array.from(new Set(o.flatMap(n=>{if(typeof n.status=="string"&&n.status!=="active")return[];let e=n.id,t=typeof n.teamId=="string"?n.teamId:typeof e=="string"?e:"";return t.trim()?[t.trim()]:[]})))}i(I,"activeTeamIds");function f(o){let n=new Map;for(let e of o)for(let t of e.connections)n.set(t.id,t);return[...n.values()]}i(f,"mergeConnections");export{x as listAppServerIntegrationConnections};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as Y,b as Z}from"./chunk-IIZ4CWBX.js";import{c as K,d as Q,e as X}from"./chunk-I3VVWNUW.js";import"./chunk-HDGTHRY7.js";import"./chunk-YNH3NMPF.js";import{c as L,d as W,e as C,h as z}from"./chunk-3Z47M3YY.js";import{a as P}from"./chunk-ABD5M2D2.js";import"./chunk-TRQQNFMO.js";import"./chunk-FEAKTSRS.js";import"./chunk-F74GBN6K.js";import"./chunk-SDAUS5PY.js";import"./chunk-I2NXNMRZ.js";import"./chunk-O72BSKSO.js";import{a as V,b as $}from"./chunk-OPNRWESL.js";import{b as G,c as B}from"./chunk-7SC46OFC.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-DBK66CJP.js";import{c as U}from"./chunk-D74JEERO.js";import{a as F}from"./chunk-UCPGRPWY.js";import"./chunk-773TH7FN.js";import"./chunk-FUOEIDMA.js";import"./chunk-NHQ36THU.js";import{I as R}from"./chunk-VRIEKBBH.js";import"./chunk-QNG27G3T.js";import{s as k,u as J}from"./chunk-EIRYMSEG.js";import"./chunk-QL4OIPEZ.js";import"./chunk-OQPJ7FJF.js";import"./chunk-WJ43MJ3F.js";import"./chunk-Q4TBTRIG.js";import"./chunk-T5AACNJI.js";import"./chunk-QOGJAQDO.js";import"./chunk-EYPCBBMS.js";import"./chunk-DIO5CB6U.js";import"./chunk-7ED24PP6.js";import"./chunk-RNIAFXMB.js";import"./chunk-2IHO4GDJ.js";import"./chunk-KCJVFLBB.js";import"./chunk-N4FFQPLR.js";import"./chunk-AY64VY4E.js";import"./chunk-GJ2ZJFDD.js";import"./chunk-6QSSIT62.js";import"./chunk-3QIB5FXI.js";import"./chunk-6MI4KKWF.js";import"./chunk-DDMZSZFL.js";import"./chunk-W45RKGM6.js";import"./chunk-3VUATFZD.js";import"./chunk-4EPSHPZL.js";import"./chunk-H6IW2R22.js";import"./chunk-L3KS6MOV.js";import"./chunk-MQULU465.js";import"./chunk-PRGBLQVH.js";import"./chunk-7E6T7GP5.js";import"./chunk-DZUAT3TP.js";import"./chunk-XDQMGUWL.js";import"./chunk-FTEOCCPB.js";import"./chunk-25MBPJVY.js";import"./chunk-WN3V6KDN.js";import"./chunk-523TE4BI.js";import"./chunk-ZCHXGRRU.js";import"./chunk-YBT2NB32.js";import"./chunk-74ZXXBGN.js";import{n as N}from"./chunk-APB2STJK.js";import"./chunk-I7AQMAQI.js";import"./chunk-Z4Z5UOZM.js";import"./chunk-6FA3GG5B.js";import"./chunk-Y4OWBBDD.js";import"./chunk-6ZFPQYHG.js";import"./chunk-JFXWI3EN.js";import"./chunk-FFRFSDBM.js";import{d as j}from"./chunk-VYLGI3IH.js";import{l as M}from"./chunk-ACYFMLWG.js";import"./chunk-TVQAPBLZ.js";import{m as S}from"./chunk-KGNCKIFP.js";import{b as s}from"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import{a as r}from"./chunk-FTQLQJQV.js";import{createHash as le}from"node:crypto";function q(d,o){if(o.environment.kind!=="javascript")throw new Error("experiment_environment_required");let{definition:t,asset:f}=o.environment,l=j(f,t.module),p=le("sha256").update(o.id).digest("hex"),x=0;return async i=>{if(i.signal?.throwIfAborted(),i.source!==l)throw new Error("experiment_environment_source_mismatch");let c=i.value.action,n=t.executionServices?.filter(y=>y.operation===i.operation&&(i.operation!=="step"||y.toolName===c?.name))??[];if(S(i.executionServices??[])!==S(n))throw new Error("experiment_environment_services_mismatch");let m=x++,h=await d.request({contractVersion:R,requestId:`environment-${p}-${m}`,operation:"experiment/environment",params:{caseId:o.id,admissionHash:o.admissionHash,definitionHash:t.contentHash,ordinal:m,operation:i.operation,value:i.value,timeoutMs:i.timeoutMs}},3e5);return i.signal?.throwIfAborted(),M(h,1572864),N.parse(h)}}r(q,"createHostExperimentEnvironment");import{createHash as pe}from"node:crypto";var ce=s.object({text:s.string().max(262144),toolCalls:s.array(s.object({id:s.string().min(1).max(200),name:s.string().min(1).max(64),arguments:s.record(s.string(),s.unknown())}).strict()).max(200)}).strict();function H(d,o){let t=0;return async({messages:f,tools:l,signal:p})=>{p.throwIfAborted();let x=t++,i=await d.request({contractVersion:R,requestId:`experiment-${pe("sha256").update(o.id).digest("hex")}-${x}`,operation:"experiment/policy",params:{caseId:o.id,admissionHash:o.admissionHash,ordinal:x,messages:f.map(c=>({...c})),tools:l.map(c=>({...c}))}},Math.min(o.timeoutMs,3e5));return p.throwIfAborted(),ce.parse(i)}}r(H,"createHostExperimentPolicy");function ee(d,o,t){let f=H(d,o);return async function*(l){let p=o.model;if(!l.signal||l.model!==p.modelId||l.maxTokens!==p.maxOutputTokens||l.temperature!==p.temperature||l.topP!==p.topP)throw new Error("Native Experiment policy request differs from its admitted model configuration.");let x=l.messages.map(n=>{if(n.images?.length||n.continuation)throw new Error("The owner policy capability does not admit multimodal or caller-supplied continuation inputs.");if(n.role==="tool")return{role:"tool",callId:s.string().min(1).max(200).parse(n.tool_call_id),name:s.string().min(1).max(64).parse(n.name),observation:me(n.content??"")};if(n.role==="assistant")return{role:"assistant",text:n.content??"",toolCalls:(n.tool_calls??[]).map(m=>({id:s.string().min(1).max(200).parse(m.id),name:s.string().min(1).max(64).parse(m.function?.name),arguments:s.record(s.string(),s.unknown()).parse(JSON.parse(s.string().parse(m.function?.arguments)))}))};if(n.role!=="user"&&n.role!=="system")throw new Error("Native Experiment message role is not admitted.");return{role:n.role,text:n.content??""}}),i=(l.tools??[]).map(n=>{if(n.type!=="function"||!n.function)throw new Error("Native Experiment requires declared function tools.");let m=t.find(h=>h.name===n.function.name);if(!m||S(n.function.parameters)!==m.inputSchemaHash)throw new Error("Native Experiment requested an undeclared or changed tool.");return m});if(i.length!==t.length||new Set(i.map(n=>n.name)).size!==i.length)throw new Error("Native Experiment changed its admitted tool inventory.");let c=await f({messages:x,tools:i,signal:l.signal});l.signal.throwIfAborted(),c.text&&(yield{type:"text_delta",text:c.text,raw:null}),c.toolCalls.length&&(yield{type:"tool_call_delta",toolCalls:c.toolCalls.map(n=>({id:n.id,type:"function",function:{name:n.name,arguments:JSON.stringify(n.arguments)}})),raw:null}),yield{type:"finish",finishReason:c.toolCalls.length?"tool_calls":"stop",raw:null}}}r(ee,"createHostExperimentNativeStream");function me(d){try{let o=JSON.parse(d);return o&&typeof o=="object"&&!Array.isArray(o)?o:{output:o}}catch{return{output:d}}}r(me,"observation");function Qe(d){let{options:o,store:t,storeDir:f,explicitProfileRelease:l,externalDataset:p,isolatedProfileTools:x,selectedEvaluationProfile:i,listProfileWorkflows:c,createSessionWithAutoTitle:n,turnRunner:m,streamOpenPondHostedChatTurn:h,publishedExperimentSource:y,standaloneExperimentOwner:D}=d,w=new AbortController,oe=K({resolveExternalDataset:p?.resolveExternalDataset,admitSession:x?.admitSession,settleSession:x?.settleSession,loadCatalog:r(e=>P({...e,store:t}),"loadCatalog"),loadTasksetPackage:r((e,a,v)=>C({store:t,storeDir:f,definition:e,profileId:a,harnessRelease:v}),"loadTasksetPackage"),store:t,storeDir:f,selectedProfile:i,createSession:n,sendTurn:m.sendTurn,interruptSessionTurn:m.interruptSessionTurn}),T=r((e,a)=>oe(e,a?AbortSignal.any([a,w.signal]):w.signal),"executeProfileEvaluationCase"),I=z({privateGradingPreflight:r(e=>L(e,!1),"privateGradingPreflight"),resolveExternalDataset:p?.resolveExternalDataset,sourceCandidate:p?.sourceCandidate,loadCatalog:r(e=>P({...e,store:t}),"loadCatalog"),selectedWorkflows:c,loadTasksetPackage:r((e,a,v)=>C({store:t,storeDir:f,definition:e,profileId:a,harnessRelease:v}),"loadTasksetPackage"),modelConfigurationHash:r(async(e,a)=>{if(!o.profileSource||e.providerId!=="openpond"||!a.hostModelConfigurationHash)throw new Error("Hosted Profile evaluation requires an explicit source and trusted OpenPond model configuration receipt.");return a.hostModelConfigurationHash},"modelConfigurationHash"),placement:"remote"}),te=Q({loadTasksetPackage:r((e,a,v)=>C({store:t,storeDir:f,definition:e,profileId:a,harnessRelease:v}),"loadTasksetPackage"),privateGrading:r(async(e,a,v)=>W({manifest:e,packageValue:a,signal:v,authorize:r(async()=>{let u=await i(),E=e.profileEvaluation;if(!u||!E||u.ref.profileId!==E.profileId||u.sourceRevision!==E.sourceRevision)throw new Error("The current private Profile source changed.");p&&await p.authorize({bindingHash:E.externalDatasetBinding.contentHash,manifestHash:e.contentHash});let O=await P({ref:u.ref,sourceRevision:u.sourceRevision,harnessRelease:E.harnessRelease,store:t});if(!E.externalDatasetBinding&&O.catalogHash!==E.catalogHash)throw new Error("The current private evaluation catalog changed.")},"authorize")}),"privateGrading"),resolveExternalDataset:p?.resolveExternalDataset,loadCatalog:r(e=>P({...e,store:t}),"loadCatalog"),store:t,selectedProfile:i,executeCase:T}),A=r((e,a)=>te(e,a?AbortSignal.any([a,w.signal]):w.signal),"executeProfileEvaluationRun"),re=X({loadCatalog:r(e=>P({...e,store:t}),"loadCatalog"),store:t,selectedWorkflows:c,prepareRun:I,executeRun:A}),b=Y({...y&&o.experimentPolicyClient?{executeHarness:r(async(e,a)=>{if(!e.harness||!D)throw new Error("Standalone Experiment source owner is unavailable.");return(await D.execute({executionId:e.id,request:e,source:e.harness,stream:ee(o.experimentPolicyClient,e,F(y.release)),signal:a,maxOutputBytes:262144})).attempt},"executeHarness")}:{},...o.experimentPolicyClient?{resolveEnvironment:r(async e=>q(o.experimentPolicyClient,e),"resolveEnvironment")}:{},resolvePolicy:r(async e=>o.experimentPolicyClient?H(o.experimentPolicyClient,e):Z({request:e,stream:h}),"resolvePolicy"),executeProfile:r(e=>{if(o.experimentPolicyClient)throw new Error("A model-case owner cannot execute a Profile.");return T(e)},"executeProfile")});return{listProfileEvaluations:r(async e=>{if(e&&typeof e=="object"&&!Array.isArray(e)&&"runId"in e){let _=G.parse(e),g=await i();if(!g)throw new Error("Select a Profile before inspecting an evaluation run.");return B({store:t,profileRef:g.ref,..._})}if(o.profileSource&&l){let _=await P({store:t,ref:{source:"openpond_git",repositoryId:o.profileSource.repositoryId,profileId:o.profileSource.profileId},sourceRevision:o.profileSource.sourceRevision,harnessRelease:{id:l.harnessRelease.id,contentHash:l.harnessRelease.contentHash}}),[g,ae,se]=await Promise.all([t.listProfileEvaluationRuns({source:"openpond_git",repositoryId:o.profileSource.repositoryId,profileId:o.profileSource.profileId}),t.listProfileEvaluationComparisons({source:"openpond_git",repositoryId:o.profileSource.repositoryId,profileId:o.profileSource.profileId}),t.listProfileEvaluationSuiteRuns({source:"openpond_git",repositoryId:o.profileSource.repositoryId,profileId:o.profileSource.profileId})]);return{..._,runs:g,comparisons:ae,suiteRuns:se}}let[a,v]=await Promise.all([J(),k()]);if(!a.lastUsed)throw new Error("Select a Profile before loading its evaluations.");let u=await U({store:t,storeDir:f,ref:a.lastUsed,profile:v,reloadProfile:k}),E=await P({store:t,ref:u.profileRef,sourceRevision:u.sourceRevision,harnessRelease:u.harnessRelease}),[O,ne,ie]=await Promise.all([t.listProfileEvaluationRuns(u.profileRef),t.listProfileEvaluationComparisons(u.profileRef),t.listProfileEvaluationSuiteRuns(u.profileRef)]);return{...E,runs:O,comparisons:ne,suiteRuns:ie}},"listProfileEvaluations"),executeProfileEvaluationCase:T,executeExperimentCase:b.execute,cancelExperimentCase:r(e=>Promise.resolve(b.cancel(s.object({id:s.string().min(1)}).strict().parse(e).id)),"cancelExperimentCase"),executeProfileEvaluationRun:A,prepareProfileEvaluationRun:I,runPreparedProfileEvaluation:r(async e=>A(await I(e,{requireExpectedManifestHash:!0})),"runPreparedProfileEvaluation"),runProfileEvaluationSuite:re,compareProfileEvaluationRuns:V({store:t,selectedProfile:i}),buildProfileEvaluationReport:r(async e=>{let a=await i();if(!a)throw new Error("Select a Profile before building an evaluation report.");return $({store:t,profileRef:a.ref,request:e})},"buildProfileEvaluationReport"),async close(){w.abort(new Error("Evaluation runtime closed")),await b.close()}}}r(Qe,"createAppServerEvaluations");export{Qe as createAppServerEvaluations};
2
+ import{a as Y,b as Z}from"./chunk-GGGF5NHJ.js";import"./chunk-TOFMA2L5.js";import{c as G,d as B,e as V}from"./chunk-2RNCXDJC.js";import{c as C,f as z,g as Q,h as X}from"./chunk-NHUUCNAD.js";import{a as $,b as U}from"./chunk-IFQCOSU6.js";import{b as F,c as K}from"./chunk-RJIUOLWY.js";import{a as P}from"./chunk-2PAJCXFC.js";import"./chunk-44LWH5U6.js";import"./chunk-FEAKTSRS.js";import"./chunk-OWK7HU5I.js";import"./chunk-V2HMWCT6.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-6HQB3MQO.js";import"./chunk-I2NXNMRZ.js";import"./chunk-J24I74EM.js";import"./chunk-OY5HC2P6.js";import{c as L}from"./chunk-IUBARBGI.js";import"./chunk-DK7IKI7O.js";import{a as W}from"./chunk-OQ4VGCRG.js";import"./chunk-WDEO44UN.js";import"./chunk-5RHYSQZ5.js";import"./chunk-JHMS2WXM.js";import{Y as R}from"./chunk-IJHZBHEK.js";import"./chunk-EXJGCNRS.js";import"./chunk-M3ZQDPRS.js";import"./chunk-KCJVFLBB.js";import{s as k,u as J}from"./chunk-XQBIHPPX.js";import"./chunk-LO3O45IX.js";import"./chunk-ZR7LIMJS.js";import"./chunk-OQPJ7FJF.js";import"./chunk-PCNLC5H3.js";import"./chunk-P7HRF4FM.js";import"./chunk-UFHLLSCE.js";import"./chunk-2ITZW2CN.js";import"./chunk-HCEJAOIF.js";import"./chunk-6GWOVHIG.js";import"./chunk-QGOPYQW3.js";import"./chunk-O4FBOUNX.js";import"./chunk-5ZBLCWEJ.js";import"./chunk-WYZWDMMF.js";import"./chunk-DG4TYVPF.js";import"./chunk-PWK5Z5S3.js";import"./chunk-DDMZSZFL.js";import"./chunk-W45RKGM6.js";import"./chunk-2MMCZHKL.js";import"./chunk-WGX7WY4N.js";import"./chunk-7YTHEMWI.js";import"./chunk-L3KS6MOV.js";import"./chunk-XO3H32KX.js";import"./chunk-DIGX56JY.js";import"./chunk-R7YEURUQ.js";import"./chunk-DZUAT3TP.js";import"./chunk-H3BSIAQO.js";import"./chunk-637UACKH.js";import"./chunk-A66CSUBJ.js";import"./chunk-SPDSSMFD.js";import"./chunk-E63VWAQA.js";import"./chunk-PR5TYTY4.js";import"./chunk-KNO355LC.js";import"./chunk-Y54RKLOI.js";import{n as N}from"./chunk-2SUMZ73C.js";import"./chunk-M55H7KVR.js";import"./chunk-BK63OQRW.js";import"./chunk-V4KT5FCJ.js";import"./chunk-6FA3GG5B.js";import"./chunk-LHA7RQBA.js";import"./chunk-SG6JZ7HD.js";import"./chunk-ON2RNOCG.js";import"./chunk-H7IWJN7L.js";import{d as j}from"./chunk-SFNCAPCJ.js";import{l as M}from"./chunk-RCA6NGVA.js";import"./chunk-VHSX3JPX.js";import{m as S}from"./chunk-BIPQCJ5V.js";import{A as s}from"./chunk-PF56N7ZY.js";import{a as r}from"./chunk-FTQLQJQV.js";import{createHash as le}from"node:crypto";function q(d,o){if(o.environment.kind!=="javascript")throw new Error("experiment_environment_required");let{definition:t,asset:f}=o.environment,l=j(f,t.module),p=le("sha256").update(o.id).digest("hex"),x=0;return async i=>{if(i.signal?.throwIfAborted(),i.source!==l)throw new Error("experiment_environment_source_mismatch");let c=i.value.action,n=t.executionServices?.filter(y=>y.operation===i.operation&&(i.operation!=="step"||y.toolName===c?.name))??[];if(S(i.executionServices??[])!==S(n))throw new Error("experiment_environment_services_mismatch");let m=x++,h=await d.request({contractVersion:R,requestId:`environment-${p}-${m}`,operation:"experiment/environment",params:{caseId:o.id,admissionHash:o.admissionHash,definitionHash:t.contentHash,ordinal:m,operation:i.operation,value:i.value,timeoutMs:i.timeoutMs}},3e5);return i.signal?.throwIfAborted(),M(h,1572864),N.parse(h)}}r(q,"createHostExperimentEnvironment");import{createHash as pe}from"node:crypto";var ce=s.object({text:s.string().max(262144),toolCalls:s.array(s.object({id:s.string().min(1).max(200),name:s.string().min(1).max(64),arguments:s.record(s.string(),s.unknown())}).strict()).max(200)}).strict();function H(d,o){let t=0;return async({messages:f,tools:l,signal:p})=>{p.throwIfAborted();let x=t++,i=await d.request({contractVersion:R,requestId:`experiment-${pe("sha256").update(o.id).digest("hex")}-${x}`,operation:"experiment/policy",params:{caseId:o.id,admissionHash:o.admissionHash,ordinal:x,messages:f.map(c=>({...c})),tools:l.map(c=>({...c}))}},Math.min(o.timeoutMs,3e5));return p.throwIfAborted(),ce.parse(i)}}r(H,"createHostExperimentPolicy");function ee(d,o,t){let f=H(d,o);return async function*(l){let p=o.model;if(!l.signal||l.model!==p.modelId||l.maxTokens!==p.maxOutputTokens||l.temperature!==p.temperature||l.topP!==p.topP)throw new Error("Native Experiment policy request differs from its admitted model configuration.");let x=l.messages.map(n=>{if(n.images?.length||n.continuation)throw new Error("The owner policy capability does not admit multimodal or caller-supplied continuation inputs.");if(n.role==="tool")return{role:"tool",callId:s.string().min(1).max(200).parse(n.tool_call_id),name:s.string().min(1).max(64).parse(n.name),observation:me(n.content??"")};if(n.role==="assistant")return{role:"assistant",text:n.content??"",toolCalls:(n.tool_calls??[]).map(m=>({id:s.string().min(1).max(200).parse(m.id),name:s.string().min(1).max(64).parse(m.function?.name),arguments:s.record(s.string(),s.unknown()).parse(JSON.parse(s.string().parse(m.function?.arguments)))}))};if(n.role!=="user"&&n.role!=="system")throw new Error("Native Experiment message role is not admitted.");return{role:n.role,text:n.content??""}}),i=(l.tools??[]).map(n=>{if(n.type!=="function"||!n.function)throw new Error("Native Experiment requires declared function tools.");let m=t.find(h=>h.name===n.function.name);if(!m||S(n.function.parameters)!==m.inputSchemaHash)throw new Error("Native Experiment requested an undeclared or changed tool.");return m});if(i.length!==t.length||new Set(i.map(n=>n.name)).size!==i.length)throw new Error("Native Experiment changed its admitted tool inventory.");let c=await f({messages:x,tools:i,signal:l.signal});l.signal.throwIfAborted(),c.text&&(yield{type:"text_delta",text:c.text,raw:null}),c.toolCalls.length&&(yield{type:"tool_call_delta",toolCalls:c.toolCalls.map(n=>({id:n.id,type:"function",function:{name:n.name,arguments:JSON.stringify(n.arguments)}})),raw:null}),yield{type:"finish",finishReason:c.toolCalls.length?"tool_calls":"stop",raw:null}}}r(ee,"createHostExperimentNativeStream");function me(d){try{let o=JSON.parse(d);return o&&typeof o=="object"&&!Array.isArray(o)?o:{output:o}}catch{return{output:d}}}r(me,"observation");function Qe(d){let{options:o,store:t,storeDir:f,explicitProfileRelease:l,externalDataset:p,isolatedProfileTools:x,selectedEvaluationProfile:i,listProfileWorkflows:c,createSessionWithAutoTitle:n,turnRunner:m,streamOpenPondHostedChatTurn:h,publishedExperimentSource:y,standaloneExperimentOwner:D}=d,w=new AbortController,oe=G({resolveExternalDataset:p?.resolveExternalDataset,admitSession:x?.admitSession,settleSession:x?.settleSession,loadCatalog:r(e=>P({...e,store:t}),"loadCatalog"),loadTasksetPackage:r((e,a,v)=>C({store:t,storeDir:f,definition:e,profileId:a,harnessRelease:v}),"loadTasksetPackage"),store:t,storeDir:f,selectedProfile:i,createSession:n,sendTurn:m.sendTurn,interruptSessionTurn:m.interruptSessionTurn}),T=r((e,a)=>oe(e,a?AbortSignal.any([a,w.signal]):w.signal),"executeProfileEvaluationCase"),I=z({privateGradingPreflight:r(e=>Q(e,!1),"privateGradingPreflight"),resolveExternalDataset:p?.resolveExternalDataset,sourceCandidate:p?.sourceCandidate,loadCatalog:r(e=>P({...e,store:t}),"loadCatalog"),selectedWorkflows:c,loadTasksetPackage:r((e,a,v)=>C({store:t,storeDir:f,definition:e,profileId:a,harnessRelease:v}),"loadTasksetPackage"),modelConfigurationHash:r(async(e,a)=>{if(!o.profileSource||e.providerId!=="openpond"||!a.hostModelConfigurationHash)throw new Error("Hosted Profile evaluation requires an explicit source and trusted OpenPond model configuration receipt.");return a.hostModelConfigurationHash},"modelConfigurationHash"),placement:"remote"}),te=B({loadTasksetPackage:r((e,a,v)=>C({store:t,storeDir:f,definition:e,profileId:a,harnessRelease:v}),"loadTasksetPackage"),privateGrading:r(async(e,a,v)=>X({manifest:e,packageValue:a,signal:v,authorize:r(async()=>{let u=await i(),E=e.profileEvaluation;if(!u||!E||u.ref.profileId!==E.profileId||u.sourceRevision!==E.sourceRevision)throw new Error("The current private Profile source changed.");p&&await p.authorize({bindingHash:E.externalDatasetBinding.contentHash,manifestHash:e.contentHash});let O=await P({ref:u.ref,sourceRevision:u.sourceRevision,harnessRelease:E.harnessRelease,store:t});if(!E.externalDatasetBinding&&O.catalogHash!==E.catalogHash)throw new Error("The current private evaluation catalog changed.")},"authorize")}),"privateGrading"),resolveExternalDataset:p?.resolveExternalDataset,loadCatalog:r(e=>P({...e,store:t}),"loadCatalog"),store:t,selectedProfile:i,executeCase:T}),A=r((e,a)=>te(e,a?AbortSignal.any([a,w.signal]):w.signal),"executeProfileEvaluationRun"),re=V({loadCatalog:r(e=>P({...e,store:t}),"loadCatalog"),store:t,selectedWorkflows:c,prepareRun:I,executeRun:A}),b=Y({...y&&o.experimentPolicyClient?{executeHarness:r(async(e,a)=>{if(!e.harness||!D)throw new Error("Standalone Experiment source owner is unavailable.");return(await D.execute({executionId:e.id,request:e,source:e.harness,stream:ee(o.experimentPolicyClient,e,W(y.release)),signal:a,maxOutputBytes:262144})).attempt},"executeHarness")}:{},...o.experimentPolicyClient?{resolveEnvironment:r(async e=>q(o.experimentPolicyClient,e),"resolveEnvironment")}:{},resolvePolicy:r(async e=>o.experimentPolicyClient?H(o.experimentPolicyClient,e):Z({request:e,stream:h}),"resolvePolicy"),executeProfile:r(e=>{if(o.experimentPolicyClient)throw new Error("A model-case owner cannot execute a Profile.");return T(e)},"executeProfile")});return{listProfileEvaluations:r(async e=>{if(e&&typeof e=="object"&&!Array.isArray(e)&&"runId"in e){let _=F.parse(e),g=await i();if(!g)throw new Error("Select a Profile before inspecting an evaluation run.");return K({store:t,profileRef:g.ref,..._})}if(o.profileSource&&l){let _=await P({store:t,ref:{source:"openpond_git",repositoryId:o.profileSource.repositoryId,profileId:o.profileSource.profileId},sourceRevision:o.profileSource.sourceRevision,harnessRelease:{id:l.harnessRelease.id,contentHash:l.harnessRelease.contentHash}}),[g,ae,se]=await Promise.all([t.listProfileEvaluationRuns({source:"openpond_git",repositoryId:o.profileSource.repositoryId,profileId:o.profileSource.profileId}),t.listProfileEvaluationComparisons({source:"openpond_git",repositoryId:o.profileSource.repositoryId,profileId:o.profileSource.profileId}),t.listProfileEvaluationSuiteRuns({source:"openpond_git",repositoryId:o.profileSource.repositoryId,profileId:o.profileSource.profileId})]);return{..._,runs:g,comparisons:ae,suiteRuns:se}}let[a,v]=await Promise.all([J(),k()]);if(!a.lastUsed)throw new Error("Select a Profile before loading its evaluations.");let u=await L({store:t,storeDir:f,ref:a.lastUsed,profile:v,reloadProfile:k}),E=await P({store:t,ref:u.profileRef,sourceRevision:u.sourceRevision,harnessRelease:u.harnessRelease}),[O,ne,ie]=await Promise.all([t.listProfileEvaluationRuns(u.profileRef),t.listProfileEvaluationComparisons(u.profileRef),t.listProfileEvaluationSuiteRuns(u.profileRef)]);return{...E,runs:O,comparisons:ne,suiteRuns:ie}},"listProfileEvaluations"),executeProfileEvaluationCase:T,executeExperimentCase:b.execute,cancelExperimentCase:r(e=>Promise.resolve(b.cancel(s.object({id:s.string().min(1)}).strict().parse(e).id)),"cancelExperimentCase"),executeProfileEvaluationRun:A,prepareProfileEvaluationRun:I,runPreparedProfileEvaluation:r(async e=>A(await I(e,{requireExpectedManifestHash:!0})),"runPreparedProfileEvaluation"),runProfileEvaluationSuite:re,compareProfileEvaluationRuns:$({store:t,selectedProfile:i}),buildProfileEvaluationReport:r(async e=>{let a=await i();if(!a)throw new Error("Select a Profile before building an evaluation report.");return U({store:t,profileRef:a.ref,request:e})},"buildProfileEvaluationReport"),async close(){w.abort(new Error("Evaluation runtime closed")),await b.close()}}}r(Qe,"createAppServerEvaluations");export{Qe as createAppServerEvaluations};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{a as H,c as m,d as k}from"./chunk-KGLJU66U.js";import"./chunk-MS37ISA4.js";import{d,f as p,g as f,h as w}from"./chunk-STWRTNRK.js";import"./chunk-DK7IKI7O.js";import"./chunk-AN525SPP.js";import{c as R}from"./chunk-WDEO44UN.js";import"./chunk-IZ6DLEVY.js";import"./chunk-5RHYSQZ5.js";import"./chunk-JHMS2WXM.js";import"./chunk-EXJGCNRS.js";import"./chunk-M3ZQDPRS.js";import"./chunk-KCJVFLBB.js";import"./chunk-XQBIHPPX.js";import"./chunk-LO3O45IX.js";import"./chunk-LD7PGREF.js";import"./chunk-XW6HGSIT.js";import"./chunk-FSQWAANK.js";import"./chunk-ZR7LIMJS.js";import"./chunk-OQPJ7FJF.js";import"./chunk-PCNLC5H3.js";import"./chunk-P7HRF4FM.js";import"./chunk-UFHLLSCE.js";import"./chunk-2ITZW2CN.js";import"./chunk-HCEJAOIF.js";import"./chunk-6GWOVHIG.js";import"./chunk-QGOPYQW3.js";import"./chunk-O4FBOUNX.js";import"./chunk-5ZBLCWEJ.js";import"./chunk-WYZWDMMF.js";import"./chunk-DG4TYVPF.js";import"./chunk-PWK5Z5S3.js";import"./chunk-DDMZSZFL.js";import"./chunk-W45RKGM6.js";import"./chunk-2MMCZHKL.js";import"./chunk-WGX7WY4N.js";import"./chunk-7YTHEMWI.js";import"./chunk-L3KS6MOV.js";import"./chunk-XO3H32KX.js";import"./chunk-DIGX56JY.js";import"./chunk-R7YEURUQ.js";import"./chunk-DZUAT3TP.js";import"./chunk-H3BSIAQO.js";import"./chunk-637UACKH.js";import"./chunk-A66CSUBJ.js";import"./chunk-SPDSSMFD.js";import"./chunk-E63VWAQA.js";import"./chunk-PR5TYTY4.js";import"./chunk-KNO355LC.js";import"./chunk-Y54RKLOI.js";import"./chunk-2SUMZ73C.js";import"./chunk-M55H7KVR.js";import"./chunk-BK63OQRW.js";import"./chunk-V4KT5FCJ.js";import"./chunk-6FA3GG5B.js";import"./chunk-LHA7RQBA.js";import"./chunk-SG6JZ7HD.js";import"./chunk-ON2RNOCG.js";import"./chunk-H7IWJN7L.js";import"./chunk-SFNCAPCJ.js";import"./chunk-RCA6NGVA.js";import"./chunk-VHSX3JPX.js";import"./chunk-BIPQCJ5V.js";import"./chunk-PF56N7ZY.js";import{a as t}from"./chunk-FTQLQJQV.js";function b(i){let{store:n,storeDir:s,backgroundReview:r,harnessEvaluationEnabled:o,harnessTasksetReview:c}=i,v=new AbortController,u=t(e=>{let g=e.signal?AbortSignal.any([e.signal,v.signal]):v.signal;return i.harnessEvaluationReviewStream({...e,signal:g})},"harnessEvaluationReviewStream"),l=m({store:n,storeDir:s,evaluationReviewStream:u});return{inspectHarness:t(()=>k(n),"inspectHarness"),reviewHarnessProposal:a(r,"Harness review",l.reviewHarnessProposalPayload),reviewHarness:a(o,"Harness evaluation",e=>H({store:n,request:e,stream:u,continuation:{storeDir:s,stream:u}})),acceptHarnessEvaluationReview:a(o,"Tasksets",e=>c.acceptEvaluationReview(e)),materializeHarnessEvaluationTaskset:a(o,"Tasksets",e=>c.materializeEvaluationTaskset(e)),runHarnessEvaluationBaseline:a(o,"Tasksets",e=>c.runEvaluationBaseline(e)),validateHarness:t(async()=>{let e=await R(n);return e?{valid:!0,workspaceId:e.workspaceId,harnessRelease:e.harnessRelease,agentSnapshot:e.agentSnapshot}:{valid:!1,reason:"No app-server Harness release is selected."}},"validateHarness"),updateHarnessBackgroundReview:a(r,"Background review",l.updateHarnessBackgroundReviewPayload),diffHarness:l.harnessDiffPayload,rollbackHarness:l.rollbackHarnessPayload,inspectRefiner:a(r,"Refiner",()=>d(s)),updateRefiner:a(r,"Refiner",e=>p(s,e)),activateRefiner:a(r,"Refiner",e=>f(s,e)),rollbackRefiner:a(r,"Refiner",e=>w(s,e)),async close(){v.abort(new Error("Harness runtime closed"))}}}t(b,"createAppServerHarnessServices");function a(i,n,s){return async(...r)=>{if(!i)throw new Error(`${n} is disabled in this app-server deployment.`);return s(...r)}}t(a,"guardService");export{b as createAppServerHarnessServices};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{k as c,l as d}from"./chunk-O6IFVTZT.js";import"./chunk-M4ZF44H5.js";import"./chunk-SKRNWRKV.js";import"./chunk-IUBARBGI.js";import"./chunk-DK7IKI7O.js";import"./chunk-GOYBYYPQ.js";import"./chunk-655DQ6AX.js";import{b}from"./chunk-WEHBK3MC.js";import"./chunk-B46HZ3MX.js";import"./chunk-OQ4VGCRG.js";import"./chunk-WS2ZZBAQ.js";import"./chunk-AN525SPP.js";import"./chunk-OKBIWRHC.js";import"./chunk-JGWINTT5.js";import"./chunk-SYUKES6H.js";import"./chunk-WDEO44UN.js";import"./chunk-IZ6DLEVY.js";import"./chunk-5RHYSQZ5.js";import"./chunk-JHMS2WXM.js";import{e as a}from"./chunk-IJHZBHEK.js";import"./chunk-ZTVXRZ6D.js";import"./chunk-7PXZ4X4P.js";import"./chunk-N73MU2C3.js";import"./chunk-ITKTILKI.js";import"./chunk-UJKQLO6B.js";import"./chunk-YOZIZYSC.js";import"./chunk-DMFUEUAZ.js";import"./chunk-EXJGCNRS.js";import"./chunk-M3ZQDPRS.js";import"./chunk-KCJVFLBB.js";import"./chunk-JHR3LF2F.js";import"./chunk-GW766ZSO.js";import"./chunk-7RC5WPVT.js";import"./chunk-A3L74U3W.js";import"./chunk-7KWD2I6W.js";import"./chunk-XQBIHPPX.js";import"./chunk-7LZISGTA.js";import"./chunk-BFKYRQMA.js";import"./chunk-LO3O45IX.js";import"./chunk-LD7PGREF.js";import"./chunk-XW6HGSIT.js";import"./chunk-UZQNFTLR.js";import"./chunk-KVTBX2UP.js";import"./chunk-FSQWAANK.js";import"./chunk-ZR7LIMJS.js";import"./chunk-OQPJ7FJF.js";import"./chunk-PCNLC5H3.js";import"./chunk-P7HRF4FM.js";import"./chunk-UFHLLSCE.js";import"./chunk-2ITZW2CN.js";import"./chunk-HCEJAOIF.js";import"./chunk-6GWOVHIG.js";import"./chunk-QGOPYQW3.js";import"./chunk-O4FBOUNX.js";import"./chunk-5ZBLCWEJ.js";import"./chunk-WYZWDMMF.js";import"./chunk-DG4TYVPF.js";import"./chunk-PWK5Z5S3.js";import"./chunk-DDMZSZFL.js";import"./chunk-W45RKGM6.js";import"./chunk-2MMCZHKL.js";import"./chunk-WGX7WY4N.js";import"./chunk-7YTHEMWI.js";import"./chunk-L3KS6MOV.js";import"./chunk-JFXINDOQ.js";import"./chunk-XO3H32KX.js";import"./chunk-DIGX56JY.js";import"./chunk-R7YEURUQ.js";import"./chunk-DZUAT3TP.js";import"./chunk-H3BSIAQO.js";import"./chunk-637UACKH.js";import"./chunk-A66CSUBJ.js";import"./chunk-SPDSSMFD.js";import"./chunk-E63VWAQA.js";import"./chunk-PR5TYTY4.js";import"./chunk-RYGWCN2R.js";import"./chunk-ZZWAQBA2.js";import"./chunk-YR5ID2SS.js";import"./chunk-KNO355LC.js";import"./chunk-Y54RKLOI.js";import"./chunk-2SUMZ73C.js";import"./chunk-M55H7KVR.js";import"./chunk-BK63OQRW.js";import"./chunk-V4KT5FCJ.js";import"./chunk-6FA3GG5B.js";import"./chunk-LHA7RQBA.js";import"./chunk-SG6JZ7HD.js";import"./chunk-ON2RNOCG.js";import"./chunk-H7IWJN7L.js";import"./chunk-SFNCAPCJ.js";import"./chunk-RCA6NGVA.js";import"./chunk-VHSX3JPX.js";import"./chunk-BIPQCJ5V.js";import"./chunk-PF56N7ZY.js";import"./chunk-FTQLQJQV.js";export{a as AGENT_PROTOCOL_VERSION,c as APP_SERVER_COMPOSITION,d as createOpenPondAppServer,b as runAppServerJsonl};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{f as $,g as J,h as L,i as v,j as q}from"./chunk-ISFIDCIH.js";import{c as g}from"./chunk-23P2O7PH.js";import"./chunk-AW5Q6NXT.js";import"./chunk-YVNDDNMK.js";import"./chunk-XRKFTPHD.js";import{f as m,h as y}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{a as S,f as w,j as T,k as j}from"./chunk-3M53YXEI.js";import{b as H,c as Q}from"./chunk-22UARBPW.js";import{J as C,K as G,L as k,O as W,Q as M,S as z,T as F,c as D,m as K,r as V,s as _}from"./chunk-EL454L26.js";import"./chunk-BT5YNE5U.js";import"./chunk-PXS4SVQG.js";import"./chunk-FWIPHEVA.js";import{d as f}from"./chunk-ENSB6ZTM.js";import"./chunk-GLUWATL5.js";import"./chunk-RYGWCN2R.js";import"./chunk-ZZWAQBA2.js";import"./chunk-YR5ID2SS.js";import"./chunk-KNO355LC.js";import"./chunk-Y54RKLOI.js";import"./chunk-2SUMZ73C.js";import"./chunk-M55H7KVR.js";import"./chunk-BK63OQRW.js";import"./chunk-V4KT5FCJ.js";import"./chunk-LHA7RQBA.js";import"./chunk-SG6JZ7HD.js";import"./chunk-ON2RNOCG.js";import"./chunk-H7IWJN7L.js";import"./chunk-SFNCAPCJ.js";import"./chunk-RCA6NGVA.js";import"./chunk-VHSX3JPX.js";import"./chunk-BIPQCJ5V.js";import"./chunk-PF56N7ZY.js";import{a as p}from"./chunk-FTQLQJQV.js";async function ie(){let e=await f(),s=m(e),t=await g(e,s),n=y(e),r=await L({apiBase:n,apiKey:t});console.log(JSON.stringify(r,null,2))}p(ie,"runAppsTools");async function se(e){let s=await f(),t=m(s),n=y(s),r=await g(s,t),i=typeof e.handle=="string"?String(e.handle):void 0,o=i?$(i):null,c=e.refresh!==void 0?w(e.refresh):void 0,l=await J({apiBase:n,apiKey:r,forceRefresh:c}),u=o?l.filter(a=>$(a.handle||a.gitOwner)===o):l;if(u.length===0){console.log("no apps found");return}if(w(e.json)){console.log(JSON.stringify({apps:u},null,2));return}for(let a of u){let d=a.handle||a.gitOwner||"unknown",h=a.repo||a.gitRepo||a.id,B=a.latestDeployment?.status||"no-deploy",R=a.latestDeployment?.gitBranch||a.defaultBranch||"-",I=a.codeVisibility||"unknown",E=a.sandbox?"yes":"no";console.log(`${d}/${h} ${B} ${R} code=${I} sandbox=${E} ${a.id}`)}}p(se,"runAppsList");async function oe(e,s){let t=typeof e.visibility=="string"?e.visibility.trim():typeof e.codeVisibility=="string"?e.codeVisibility.trim():"";if(t!=="public"&&t!=="private")throw new Error("usage: apps code-visibility <handle>/<repo> --visibility public|private");let n=await f(),r=m(n),i=y(n),o=await g(n,r),{app:c,handle:l,repo:u}=await v(i,o,s),a=await K(i,o,c.id,t);console.log(`${l}/${u} code_visibility=${a.app?.codeVisibility??t} app_id=${c.id}`)}p(oe,"runAppsCodeVisibility");async function ae(e){let s=await f(),t=m(s),n=await g(s,t),r=y(s),i=typeof e.appId=="string"?String(e.appId):void 0,o=await G(r,n,{appId:i});console.log(JSON.stringify(o,null,2))}p(ae,"runAppsPerformance");async function ce(e,s){let t=await f(),n=m(t),r=y(t),i=await g(t,n),{app:o}=await v(r,i,s),c=await k(r,i,o.id);console.log(JSON.stringify(c,null,2))}p(ce,"runAppsSummary");async function le(e,s,t,n){let r=(typeof e.prompt=="string"?e.prompt:null)||n.join(" ");if(!r.trim())throw new Error("usage: apps assistant <plan|performance> <handle>/<repo> --prompt <text>");let i=await f(),o=m(i),c=y(i),l=await g(i,o),{app:u}=await v(c,l,t),a=await W(c,l,{appId:u.id,mode:s,prompt:r.trim()});console.log(JSON.stringify(a,null,2))}p(le,"runAppsAssistant");async function de(e,s){let t=await f(),n=m(t),r=await g(t,n),i=y(t),o=(typeof e.prompt=="string"?e.prompt:null)||s.join(" ");if(!o.trim())throw new Error("usage: apps agent create --prompt <text> [--team-id <id>]");let c=typeof e.templateRepoUrl=="string"?e.templateRepoUrl:void 0,l=typeof e.templateBranch=="string"?e.templateBranch:void 0,u=typeof e.templateLocalPath=="string"?e.templateLocalPath:void 0,a=typeof e.teamId=="string"&&e.teamId.trim()?e.teamId.trim():void 0;if(u&&String(u).trim().length>0)throw new Error("templateLocalPath is not supported; use templateRepoUrl");let d=typeof e.env=="string"?S(e.env,"env"):void 0;if(d){if(typeof d!="object"||Array.isArray(d))throw new Error("env must be a JSON object");for(let[b,A]of Object.entries(d))if(typeof A!="string")throw new Error(`env value for ${b} must be a string`)}let h=c||l||d?{templateRepoUrl:c,templateBranch:l,envVars:d}:void 0,B=typeof e.deployEnvironment=="string"?e.deployEnvironment==="preview"?"preview":"production":void 0,R=e.deployDisabled!==void 0?w(e.deployDisabled):void 0,I=e.streamDeployLogs!==void 0?w(e.streamDeployLogs):!0,E=await C(i,r,{prompt:o.trim(),...a?{teamId:a}:{},...h?{template:h}:{},...B?{deployEnvironment:B}:{},...R!==void 0?{deployDisabled:R}:{},streamDeployLogs:I});if(!E.ok){let b=await E.text().catch(()=>"");throw new Error(`agent create failed: ${E.status} ${b}`)}let N=null,O=null,P=null;await H(E,{onConversationId:p(b=>{N=b},"onConversationId"),onItems:p(b=>{for(let A of b){let U=Q(A);U&&console.log(U);let x=A;!O&&typeof x.appId=="string"&&(O=x.appId),!P&&typeof x.deploymentId=="string"&&(P=x.deploymentId)}},"onItems")}),N&&console.log(`conversation_id: ${N}`),O&&console.log(`app_id: ${O}`),P&&console.log(`deployment_id: ${P}`);try{await J({apiBase:i,apiKey:r,forceRefresh:!0}),await L({apiBase:i,apiKey:r,forceRefresh:!0})}catch(b){console.warn("cache refresh failed",b)}}p(de,"runAppsAgentCreate");async function pe(e,s,t,n){let r=await f(),i=m(r),o=await g(r,i),c=y(r),l=typeof e.method=="string"?String(e.method).toUpperCase():void 0,u=l&&["GET","POST","PUT","DELETE"].includes(l)?l:void 0;if(l&&!u)throw new Error("method must be GET, POST, PUT, or DELETE");let a=typeof e.body=="string"?S(String(e.body),"body"):void 0,d=typeof e.headers=="string"?S(String(e.headers),"headers"):void 0,h=typeof e.scheduleId=="string"?String(e.scheduleId):void 0,B=w(e.notifyEmail),R=w(e.summary)||w(e.withSummary),I=await M(c,o,{appId:s,deploymentId:t,toolName:n,scheduleId:h,method:u,body:a,headers:d,notifyEmail:B||void 0});if(console.log(JSON.stringify(I,null,2)),R&&I.ok){let E=await k(c,o,s);console.log(JSON.stringify({summary:E},null,2))}}p(pe,"runAppsToolsExecute");async function ue(e,s){let t=typeof e.env=="string"?e.env:typeof e.vars=="string"?e.vars:typeof e.envVars=="string"?e.envVars:null;if(!t)throw new Error("usage: apps env set <handle>/<repo> --env <json>");let n=S(t,"env");if(!n||typeof n!="object"||Array.isArray(n))throw new Error("env must be a JSON object");let r={};for(let[d,h]of Object.entries(n)){if(typeof h!="string")throw new Error(`env value for ${d} must be a string`);if(!d.startsWith("OPENTOOL_PUBLIC_"))throw new Error("only OPENTOOL_PUBLIC_ env vars can be set");r[d]=h}let i=await f(),o=m(i),c=y(i),l=await g(i,o),{app:u}=await v(c,l,s),a=await V(c,l,u.id,{envVars:r});console.log(JSON.stringify(a,null,2))}p(ue,"runAppsEnvSet");async function fe(e,s){let t=await f(),n=m(t),r=y(t),i=await g(t,n),{app:o}=await v(r,i,s),c=await _(r,i,o.id);console.log(JSON.stringify(c,null,2))}p(fe,"runAppsEnvGet");async function ge(e,s){let t=await f(),n=m(t),r=y(t),i=await g(t,n),{app:o,handle:c,repo:l}=await v(r,i,s),u=typeof e.env=="string"?e.env:typeof e.environment=="string"?e.environment:void 0,a=j(u),d=await D(r,i,o.id,{environment:a});console.log(JSON.stringify(d,null,2)),(w(e.watch)||w(e.wait)||w(e.follow))&&await q({baseUrl:r,apiKey:i,deploymentId:d.deploymentId,prefix:`[${c}/${l}] `,intervalMs:e.interval?Number(e.interval):void 0,timeoutMs:e.timeout?Number(e.timeout):void 0})}p(ge,"runAppsDeploy");function X(e){let s={};if(typeof e.params=="string"){let n=S(String(e.params),"params");if(!n||typeof n!="object"||Array.isArray(n))throw new Error("params must be a JSON object");for(let[r,i]of Object.entries(n))i!==void 0&&(s[r]=typeof i=="string"?i:JSON.stringify(i))}let t=p((n,r)=>{r===void 0||r===""||(s[n]=r)},"addParam");if(t("source",typeof e.source=="string"?e.source.trim():void 0),t("symbol",typeof e.symbol=="string"?e.symbol.trim():void 0),t("cursor",typeof e.cursor=="string"?e.cursor.trim():void 0),t("status",typeof e.status=="string"?e.status.trim():void 0),t("backtestRunId",typeof e.runId=="string"?e.runId.trim():typeof e.backtestRunId=="string"?e.backtestRunId.trim():void 0),t("since",T(e.since,"since")),t("until",T(e.until,"until")),typeof e.limit=="string"&&e.limit.trim().length>0){let n=Number.parseInt(e.limit,10);if(!Number.isFinite(n))throw new Error("limit must be a number");t("limit",String(n))}return Object.keys(s).length?s:void 0}p(X,"resolveBacktestEventsParams");async function me(e,s){let t=await f(),n=m(t),r=await g(t,n),i=y(t),{app:o}=await v(i,r,s),c={...X(e)??{},appId:o.id},l=await z(i,r,{method:"GET",query:c});console.log(JSON.stringify(l,null,2))}p(me,"runBacktestEvents");async function ye(e,s){let t=typeof e.runId=="string"?e.runId.trim():typeof e.backtestRunId=="string"?e.backtestRunId.trim():"";if(!t)throw new Error("usage: backtest get <handle>/<repo> --run-id <id>");let n=await f(),r=m(n),i=await g(n,r),o=y(n),{app:c}=await v(o,i,s),l=await F(o,i,{appId:c.id,runId:t});console.log(JSON.stringify(l,null,2))}p(ye,"runBacktestGet");export{X as resolveBacktestEventsParams,de as runAppsAgentCreate,le as runAppsAssistant,oe as runAppsCodeVisibility,ge as runAppsDeploy,fe as runAppsEnvGet,ue as runAppsEnvSet,se as runAppsList,ae as runAppsPerformance,ce as runAppsSummary,ie as runAppsTools,pe as runAppsToolsExecute,me as runBacktestEvents,ye as runBacktestGet};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{i}from"./chunk-OS3LO5J3.js";import{a as s}from"./chunk-GLUWATL5.js";import{a as n}from"./chunk-FTQLQJQV.js";import{stdin as a,stdout as c}from"node:process";import{createInterface as l}from"node:readline/promises";var p=`${s}/console/services/identity-access/api-keys`;function u(e){let t=process.env.OPENPOND_API_KEY?.trim();if(t)return t;let r=e.apiKey?.trim();if(r)return r;let o=e.token?.trim();return o&&o.startsWith("opk_")?o:null}n(u,"resolveApiKey");async function P(){if(!a.isTTY||!c.isTTY)throw new Error("OpenPond API key is required in non-interactive mode. Set OPENPOND_API_KEY or run `openpond login` in a terminal.");console.log("Open the OpenPond UI to create an API key:"),console.log(p);let e=l({input:a,output:c});try{let t=(await e.question("Paste your OpenPond API key: ")).trim();if(!t)throw new Error("API key is required");return t.startsWith("opk_")||console.log("warning: API keys usually start with opk_."),t}finally{e.close()}}n(P,"promptForApiKey");async function A(e,t){let r=u(e);if(r)return r;let o=await P();return await i({apiKey:o,baseUrl:t,activeProfile:e.activeProfile}),console.log("Saved account credentials to the encrypted OpenPond credential store."),o}n(A,"ensureApiKey");export{u as a,P as b,A as c};
2
+ import{i}from"./chunk-ENSB6ZTM.js";import{a as s}from"./chunk-GLUWATL5.js";import{a as n}from"./chunk-FTQLQJQV.js";import{stdin as a,stdout as c}from"node:process";import{createInterface as l}from"node:readline/promises";var p=`${s}/console/services/identity-access/api-keys`;function u(e){let t=process.env.OPENPOND_API_KEY?.trim();if(t)return t;let r=e.apiKey?.trim();if(r)return r;let o=e.token?.trim();return o&&o.startsWith("opk_")?o:null}n(u,"resolveApiKey");async function P(){if(!a.isTTY||!c.isTTY)throw new Error("OpenPond API key is required in non-interactive mode. Set OPENPOND_API_KEY or run `openpond login` in a terminal.");console.log("Open the OpenPond UI to create an API key:"),console.log(p);let e=l({input:a,output:c});try{let t=(await e.question("Paste your OpenPond API key: ")).trim();if(!t)throw new Error("API key is required");return t.startsWith("opk_")||console.log("warning: API keys usually start with opk_."),t}finally{e.close()}}n(P,"promptForApiKey");async function A(e,t){let r=u(e);if(r)return r;let o=await P();return await i({apiKey:o,baseUrl:t,activeProfile:e.activeProfile}),console.log("Saved account credentials to the encrypted OpenPond credential store."),o}n(A,"ensureApiKey");export{u as a,P as b,A as c};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{l as k}from"./chunk-KGNCKIFP.js";import{a as s}from"./chunk-FTQLQJQV.js";var N=String.raw`
2
+ import{l as k}from"./chunk-BIPQCJ5V.js";import{a as s}from"./chunk-FTQLQJQV.js";var N=String.raw`
3
3
  const fs=require('node:fs'),p=require('node:path'),crypto=require('node:crypto');
4
4
  const q=JSON.parse(fs.readFileSync(0,'utf8')),root='/workspace/work',action=q.action,args=q.args||{};
5
5
  function file(value,write=false){if(typeof value!=='string'||!value||p.isAbsolute(value)||value.includes('\\')||value.split('/').some(x=>!x||x==='.'||x==='..'))throw Error('Use a contained candidate relative path.');const target=p.resolve(root,value);if(write&&!q.writablePaths.some(x=>value===x||value.startsWith(x+'/')))throw Error('The file is outside the selected component.');let nearest=target;while(!fs.existsSync(nearest))nearest=p.dirname(nearest);const real=fs.realpathSync(nearest);if(real!==root&&!real.startsWith(root+'/'))throw Error('Candidate symlink escapes the public source tree.');if(fs.existsSync(target)&&!fs.lstatSync(target).isFile())throw Error('Select a regular source file.');return target;}
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{b as e}from"./chunk-ES2ISFJC.js";var i=e.string().trim().min(1).max(240),o=e.string().regex(/^[a-f0-9]{64}$/),l=e.string().datetime({offset:!0}),s=e.object({id:i,contentHash:o}).strict(),b=s.extend({revision:e.number().int().positive()}).strict(),u=e.object({providerId:i,modelId:e.string().trim().min(1).max(300)}).strict(),d=e.enum(["correction","sibling_verification","cumulative_known","development","retained","frozen_final","training_eligible"]),h=e.object({taskId:i,taskContentHash:o,panelRole:d,passLabel:i.nullable(),optimizerEligible:e.boolean(),criticalInvariantIds:e.array(i).max(100).default([])}).strict().superRefine((n,t)=>{n.optimizerEligible!==(n.panelRole==="correction")&&t.addIssue({code:"custom",path:["optimizerEligible"],message:"Only correction cases may be optimizer eligible."})}),y=e.object({schemaVersion:e.literal("openpond.continualBenchIssuePacket.v1"),id:i,revision:e.number().int().positive(),contentHash:o,familyId:i,familyLabel:e.string().trim().min(1).max(500),severity:e.enum(["low","medium","high","critical"]),cases:e.array(h).min(2).max(1e4),duplicateEvidence:s,leakageEvidence:s,priorExposureEvidence:s,observedAt:l,reviewedAt:l,queuedAt:l.nullable(),runAt:l.nullable(),createdBy:i,createdAt:l}).strict().superRefine((n,t)=>{n.cases.some(a=>a.panelRole==="correction")||t.addIssue({code:"custom",path:["cases"],message:"An issue packet requires a correction case."}),n.cases.some(a=>a.panelRole==="sibling_verification")||t.addIssue({code:"custom",path:["cases"],message:"An issue packet requires a sibling-verification case."}),new Set(n.cases.map(a=>a.taskId)).size!==n.cases.length&&t.addIssue({code:"custom",path:["cases"],message:"Issue-packet task ids must be unique."})}),v=e.object({id:i,role:d,passLabel:i.nullable(),taskset:b,familyIds:e.array(i).min(1).max(1e5),taskCount:e.number().int().positive().max(1e6),sealedAt:l}).strict().superRefine((n,t)=>{let a=n.role==="correction"||n.role==="sibling_verification"||n.role==="cumulative_known";a!==(n.passLabel!==null)&&t.addIssue({code:"custom",path:["passLabel"],message:a?"This panel role requires a pass label.":"This panel role is series-wide and cannot carry a pass label."})}),m=e.discriminatedUnion("kind",[e.object({kind:e.literal("base_model"),id:i,revision:e.string().trim().min(1).max(500),contentHash:o}).strict(),e.object({kind:e.literal("model_version"),id:i,contentHash:o}).strict(),e.object({kind:e.literal("external_reference"),id:i,model:u,providerRevision:e.string().trim().min(1).max(500),contentHash:o}).strict()]),g=e.object({scheduleEntryId:i,ordinal:e.number().int().nonnegative(),label:i,role:e.enum(["seed","daily_residual","rank_candidate","weekly_rollup","full_refresh"]),parentRule:e.enum(["base_model","previous_release","seed_release","accepted_daily_head","accepted_seed"]),trainableRank:e.number().int().positive().max(1024),correctionPanelIds:e.array(i).min(1).max(1e3),optimizerGroupsPerTask:e.number().int().positive().max(1e3),trajectoriesPerGroup:e.number().int().min(4).max(1e3)}).strict(),f=e.object({revision:e.number().int().positive(),requireAllAttemptsTerminal:e.literal(!0),criticalCorrectionPassRate:e.number().min(0).max(1),siblingPassRate:e.number().min(0).max(1),behavioralRetentionRate:e.number().min(0).max(1),maximumRetainedRegressionPoints:e.number().min(0).max(100),blockCriticalPriorRegression:e.boolean(),authorizedClaims:e.array(e.enum(["systems_complete","correction_absorbed","issue_generalized","continually_current","frontier_pareto_result"])).min(1).max(5)}).strict(),R=e.object({schemaVersion:e.literal("openpond.continualBenchmarkProtocol.v1"),id:i,revision:e.number().int().positive(),contentHash:o,ownerId:i,createdAt:l,sealedAt:l,creationReceipt:s,predecessorSeries:e.object({id:i,revision:e.number().int().positive(),contentHash:o}).strict().nullable(),scenarioPack:s,issueFamilyLedger:s,issuePacketRelease:s,panels:e.array(v).min(6).max(1e4),grader:s,judge:e.object({release:s,rubricRelease:s,calibrationRelease:s,model:u}).strict().nullable(),policies:e.object({base:m,master:m.nullable(),externalReferences:e.array(m).min(1).max(20)}).strict(),invariants:e.object({systemPromptHash:o,toolSchema:s,application:s,harness:s,runtime:s,workerImage:s,autoRefiner:e.object({enabled:e.boolean(),release:s.nullable()}).strict()}).strict(),schedule:e.array(g).min(1).max(1e3),evaluation:e.object({seeds:e.array(e.number().int()).min(3).max(100),repetitions:e.number().int().min(3).max(20),powerRule:s,pairedBootstrapSamples:e.number().int().min(1e3).max(1e6),confidenceLevel:e.literal(.95)}).strict(),resources:e.object({maximumTrainingGpuSeconds:e.number().int().positive(),maximumEvaluationGpuSeconds:e.number().int().positive(),maximumProviderSpendUsd:e.number().positive(),maximumTotalSpendUsd:e.number().positive(),maximumConcurrentGroups:e.number().int().positive().max(1e3)}).strict(),currencyThresholds:f}).strict().superRefine((n,t)=>{let a=n.panels.map(r=>r.id);new Set(a).size!==a.length&&t.addIssue({code:"custom",path:["panels"],message:"Protocol panel ids must be unique."});for(let r of["development","retained","frozen_final","training_eligible"])n.panels.filter(c=>c.role===r).length!==1&&t.addIssue({code:"custom",path:["panels"],message:`A protocol requires exactly one ${r} panel.`});[...n.schedule].sort((r,c)=>r.ordinal-c.ordinal).some((r,c)=>r.ordinal!==c)&&t.addIssue({code:"custom",path:["schedule"],message:"Protocol schedule ordinals must be contiguous from zero."});let p=new Set(a);n.schedule.some(r=>r.correctionPanelIds.some(c=>!p.has(c)))&&t.addIssue({code:"custom",path:["schedule"],message:"Every scheduled correction panel must belong to the protocol."})});export{d as a,y as b,R as c};
2
+ import{A as e}from"./chunk-PF56N7ZY.js";var i=e.string().trim().min(1).max(240),o=e.string().regex(/^[a-f0-9]{64}$/),l=e.string().datetime({offset:!0}),s=e.object({id:i,contentHash:o}).strict(),b=s.extend({revision:e.number().int().positive()}).strict(),u=e.object({providerId:i,modelId:e.string().trim().min(1).max(300)}).strict(),d=e.enum(["correction","sibling_verification","cumulative_known","development","retained","frozen_final","training_eligible"]),h=e.object({taskId:i,taskContentHash:o,panelRole:d,passLabel:i.nullable(),optimizerEligible:e.boolean(),criticalInvariantIds:e.array(i).max(100).default([])}).strict().superRefine((n,t)=>{n.optimizerEligible!==(n.panelRole==="correction")&&t.addIssue({code:"custom",path:["optimizerEligible"],message:"Only correction cases may be optimizer eligible."})}),y=e.object({schemaVersion:e.literal("openpond.continualBenchIssuePacket.v1"),id:i,revision:e.number().int().positive(),contentHash:o,familyId:i,familyLabel:e.string().trim().min(1).max(500),severity:e.enum(["low","medium","high","critical"]),cases:e.array(h).min(2).max(1e4),duplicateEvidence:s,leakageEvidence:s,priorExposureEvidence:s,observedAt:l,reviewedAt:l,queuedAt:l.nullable(),runAt:l.nullable(),createdBy:i,createdAt:l}).strict().superRefine((n,t)=>{n.cases.some(a=>a.panelRole==="correction")||t.addIssue({code:"custom",path:["cases"],message:"An issue packet requires a correction case."}),n.cases.some(a=>a.panelRole==="sibling_verification")||t.addIssue({code:"custom",path:["cases"],message:"An issue packet requires a sibling-verification case."}),new Set(n.cases.map(a=>a.taskId)).size!==n.cases.length&&t.addIssue({code:"custom",path:["cases"],message:"Issue-packet task ids must be unique."})}),v=e.object({id:i,role:d,passLabel:i.nullable(),taskset:b,familyIds:e.array(i).min(1).max(1e5),taskCount:e.number().int().positive().max(1e6),sealedAt:l}).strict().superRefine((n,t)=>{let a=n.role==="correction"||n.role==="sibling_verification"||n.role==="cumulative_known";a!==(n.passLabel!==null)&&t.addIssue({code:"custom",path:["passLabel"],message:a?"This panel role requires a pass label.":"This panel role is series-wide and cannot carry a pass label."})}),m=e.discriminatedUnion("kind",[e.object({kind:e.literal("base_model"),id:i,revision:e.string().trim().min(1).max(500),contentHash:o}).strict(),e.object({kind:e.literal("model_version"),id:i,contentHash:o}).strict(),e.object({kind:e.literal("external_reference"),id:i,model:u,providerRevision:e.string().trim().min(1).max(500),contentHash:o}).strict()]),g=e.object({scheduleEntryId:i,ordinal:e.number().int().nonnegative(),label:i,role:e.enum(["seed","daily_residual","rank_candidate","weekly_rollup","full_refresh"]),parentRule:e.enum(["base_model","previous_release","seed_release","accepted_daily_head","accepted_seed"]),trainableRank:e.number().int().positive().max(1024),correctionPanelIds:e.array(i).min(1).max(1e3),optimizerGroupsPerTask:e.number().int().positive().max(1e3),trajectoriesPerGroup:e.number().int().min(4).max(1e3)}).strict(),f=e.object({revision:e.number().int().positive(),requireAllAttemptsTerminal:e.literal(!0),criticalCorrectionPassRate:e.number().min(0).max(1),siblingPassRate:e.number().min(0).max(1),behavioralRetentionRate:e.number().min(0).max(1),maximumRetainedRegressionPoints:e.number().min(0).max(100),blockCriticalPriorRegression:e.boolean(),authorizedClaims:e.array(e.enum(["systems_complete","correction_absorbed","issue_generalized","continually_current","frontier_pareto_result"])).min(1).max(5)}).strict(),R=e.object({schemaVersion:e.literal("openpond.continualBenchmarkProtocol.v1"),id:i,revision:e.number().int().positive(),contentHash:o,ownerId:i,createdAt:l,sealedAt:l,creationReceipt:s,predecessorSeries:e.object({id:i,revision:e.number().int().positive(),contentHash:o}).strict().nullable(),scenarioPack:s,issueFamilyLedger:s,issuePacketRelease:s,panels:e.array(v).min(6).max(1e4),grader:s,judge:e.object({release:s,rubricRelease:s,calibrationRelease:s,model:u}).strict().nullable(),policies:e.object({base:m,master:m.nullable(),externalReferences:e.array(m).min(1).max(20)}).strict(),invariants:e.object({systemPromptHash:o,toolSchema:s,application:s,harness:s,runtime:s,workerImage:s,autoRefiner:e.object({enabled:e.boolean(),release:s.nullable()}).strict()}).strict(),schedule:e.array(g).min(1).max(1e3),evaluation:e.object({seeds:e.array(e.number().int()).min(3).max(100),repetitions:e.number().int().min(3).max(20),powerRule:s,pairedBootstrapSamples:e.number().int().min(1e3).max(1e6),confidenceLevel:e.literal(.95)}).strict(),resources:e.object({maximumTrainingGpuSeconds:e.number().int().positive(),maximumEvaluationGpuSeconds:e.number().int().positive(),maximumProviderSpendUsd:e.number().positive(),maximumTotalSpendUsd:e.number().positive(),maximumConcurrentGroups:e.number().int().positive().max(1e3)}).strict(),currencyThresholds:f}).strict().superRefine((n,t)=>{let a=n.panels.map(r=>r.id);new Set(a).size!==a.length&&t.addIssue({code:"custom",path:["panels"],message:"Protocol panel ids must be unique."});for(let r of["development","retained","frozen_final","training_eligible"])n.panels.filter(c=>c.role===r).length!==1&&t.addIssue({code:"custom",path:["panels"],message:`A protocol requires exactly one ${r} panel.`});[...n.schedule].sort((r,c)=>r.ordinal-c.ordinal).some((r,c)=>r.ordinal!==c)&&t.addIssue({code:"custom",path:["schedule"],message:"Protocol schedule ordinals must be contiguous from zero."});let p=new Set(a);n.schedule.some(r=>r.correctionPanelIds.some(c=>!p.has(c)))&&t.addIssue({code:"custom",path:["schedule"],message:"Every scheduled correction panel must belong to the protocol."})});export{d as a,y as b,R as c};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{a as M,b as w,c as A}from"./chunk-WGX7WY4N.js";import{Ea as q,Fa as P,Ia as T,Ja as $,La as j,Oa as O,Ra as D,Sa as K,Ta as z,Ua as G,Va as _,la as H}from"./chunk-A66CSUBJ.js";import{e as x,l as d}from"./chunk-SPDSSMFD.js";import{Hb as R,Kb as k,Ob as U,v as C}from"./chunk-M55H7KVR.js";import{M as I,Nb as h,Ob as S,db as v,gb as E,hb as y,ob as b}from"./chunk-RCA6NGVA.js";import{A as s}from"./chunk-PF56N7ZY.js";import{a as p}from"./chunk-FTQLQJQV.js";var B=s.string().regex(/^[a-f0-9]{64}$/),L=s.object({request:q,maximumCostUsd:s.number().finite().positive().max(1e4),graders:s.array(O).min(1).max(100),admissionRequestHash:B.optional(),sourceExperimentId:s.string().trim().min(1).max(200).optional()}).strict(),X=L.extend({configurationHash:B}).strict(),F=P.extend({configuration:X}).strict();function g(t){return t.policy.kind==="hosted_harness"?{...t,population:t.population.map(({receiptId:e,...r})=>r)}:t}p(g,"experimentConfigurationRequest");function V(t){let e=L.parse(t);return d({...e,request:g(e.request)})}p(V,"experimentRunConfigurationHash");async function Q(t){let e=F.parse(t),{configuration:r,...a}=e,n=await $(a),{configurationHash:o,...i}=r;if(o!==V(i)||d(g(r.request))!==d(g(n.request))||r.maximumCostUsd!==n.manifest.limits.maximumSpendUsd)throw new Error("Experiment configuration differs from its retained run.");if(n.manifest.metadata.experimentDefinition===null){let c=K.parse({definition:null,configurationHash:r.configurationHash,maximumCostUsd:r.maximumCostUsd,graders:r.graders,...r.admissionRequestHash?{admissionRequestHash:r.admissionRequestHash}:{},...r.sourceExperimentId?{sourceExperimentId:r.sourceExperimentId}:{}});if(n.manifest.metadata.experimentConfigurationHash!==d(c))throw new Error("Experiment configuration differs from its admitted manifest.")}return{...n,configuration:r}}p(Q,"verifyExperimentRunDetails");var W=s.object({teamId:s.string().trim().min(1).max(240),items:s.array(s.object({name:s.string().trim().min(1).max(500),source:b,ready:s.boolean(),reason:s.string().min(1).max(2e3).nullable()}).strict()).max(8),nextCursor:s.string().min(1).max(8192).nullable()}).strict(),m=s.string().trim().min(1).max(200),Y=class extends Error{static{p(this,"OpenPondExperimentError")}constructor(t,e,r){super(r),this.status=t,this.code=e,this.name="OpenPondExperimentError"}status;code},xe=class{static{p(this,"OpenPondExperimentsClient")}constructor(t){this.options=t;let e=new URL(t.baseUrl);if(!["http:","https:"].includes(e.protocol)||e.username||e.password||e.search||e.hash||!t.apiKey.trim()||!t.teamId.trim())throw new Error("A clean API origin and workspace credentials are required.");this.baseUrl=e.toString().replace(/\/+$/,"")}options;baseUrl;async defaults(t){return s.object({maximumSpendUsd:s.number().finite().min(1e-6).max(1e4),maximumComparisonSpendUsd:s.number().finite().min(1e-6).max(1e4),initialOutputTokens:s.number().int().positive()}).strict().parse(await this.request("/defaults","GET",void 0,t))}async createComparisonBudget(t,e){let r=s.object({id:m,operationIds:s.array(m).min(1).max(100),maximumSpendUsd:s.number().finite().min(1e-6).max(1e4).optional()}).strict().parse(t),a=this.comparisonBudgetResult(await this.request("/comparison-budgets","POST",r,e),r.id);if(d(a.operations.map(n=>n.operationId).sort())!==d([...r.operationIds].sort())||r.maximumSpendUsd!==void 0&&a.maximumSpendUsd!==r.maximumSpendUsd)throw new Error("Comparison admission differs from its requested operations or ceiling.");return a}async comparisonBudget(t,e){return this.comparisonBudgetResult(await this.request(`/comparison-budgets/${encodeURIComponent(m.parse(t))}`,"GET",void 0,e),t)}comparisonBudgetResult(t,e){let r=s.object({id:m,teamId:m,maximumSpendUsd:s.number().finite().positive(),settledUsd:s.number().finite().nonnegative(),reservedUsd:s.number().finite().nonnegative(),remainingUsd:s.number().finite().nonnegative(),operations:s.array(s.object({operationId:m,runId:m.nullable()}).strict()).min(1).max(100)}).strict().parse(t);if(r.id!==e||r.teamId!==this.options.teamId)throw new Error("Comparison budget scope mismatch.");return r}async harnessSources(t={}){let e=t.cursor===void 0?void 0:s.string().min(1).max(8192).parse(t.cursor),r=new URLSearchParams(e?{cursor:e}:{}),a=W.parse(await this.request(`/harness-sources?${r}`,"GET",void 0,t.signal));if(a.teamId!==this.options.teamId||new Set(a.items.map(n=>d(n.source))).size!==a.items.length||a.nextCursor!==null&&a.nextCursor===e||a.items.some(n=>n.ready!==(n.reason===null)))throw new Error("Harness catalog differs from its workspace, readiness or continuation.");return a}async prepareHarness(t,e){let r=z.parse({...t,maximumCostUsd:t.maximumCostUsd??(await this.defaults(e)).maximumSpendUsd}),a=G.parse(await this.request("/harness-setup","POST",r,e));T(a.request,a.manifest);let n=a.request.policy;if(a.request.teamId!==this.options.teamId||a.request.operationId!==r.operationId||n.kind!=="hosted_harness"||n.profileRepositoryId!==r.profileRepositoryId||n.source.definitionId!==r.definitionId||n.modelId!==r.modelId||n.reasoningEffort!==r.reasoningEffort||a.maximumCostUsd!==r.maximumCostUsd||a.manifest.limits.maximumSpendUsd!==r.maximumCostUsd)throw new Error("Harness preparation differs from its requested scope or configuration.");return a}async run(t,e){let r=_.parse({...t,maximumCostUsd:t.maximumCostUsd??(await this.defaults(e)).maximumSpendUsd});if(r.request.teamId!==this.options.teamId)throw new Error("Experiment workspace mismatch.");let a=await this.details(await this.request("","POST",{...r,maximumCostUsd:t.maximumCostUsd},e));if(t.maximumCostUsd===void 0&&(r.maximumCostUsd=a.configuration.maximumCostUsd),d(g(a.request))!==d(g(r.request))||a.configuration.maximumCostUsd!==r.maximumCostUsd||a.configuration.sourceExperimentId!==r.sourceExperimentId||a.configuration.admissionRequestHash!==d(r))throw new Error("Experiment admission differs from its submitted configuration.");if(r.graders&&d(r.graders)!==d(a.configuration.graders.map(n=>({id:n.id,version:n.version,contentHash:n.contentHash,mappings:n.mappings??[]}))))throw new Error("Experiment admission differs from its selected graders or mappings.");return a}async get(t,e={}){return this.details(await this.request(`/${encodeURIComponent(m.parse(t))}`,"GET",void 0,e.signal),t)}async list(t={},e){let r=D.parse(t),a=new URLSearchParams(Object.entries(r).filter(([,i])=>i!==void 0).map(([i,c])=>[i,String(c)])),n=s.object({items:s.array(s.unknown()).max(100),nextCursor:m.nullable()}).strict().parse(await this.request(`?${a}`,"GET",void 0,e)),o=await Promise.all(n.items.map(i=>this.details(i)));if(o.length>r.limit||new Set(o.map(i=>i.summary.id)).size!==o.length||n.nextCursor!==null&&n.nextCursor!==o.at(-1)?.summary.id||o.some(i=>r.projectId&&i.request.project?.id!==r.projectId||r.datasetHash&&i.request.taskset.contentHash!==r.datasetHash||r.status&&i.summary.status!==r.status))throw new Error("Experiment page differs from its selected scope.");return{items:o,nextCursor:n.nextCursor}}async result(t,e){let r=s.object({executionId:m,passId:m.nullable(),manifest:s.unknown(),result:s.unknown()}).strict().parse(await this.request(`/${encodeURIComponent(m.parse(t))}/result`,"GET",void 0,e)),a=h(r);if(r.executionId!==t||a.manifest.teamId!==this.options.teamId||a.manifest.lineage?.execution.id!==t||a.manifest.lineage.scoringPassId!==r.passId)throw new Error("Experiment result identity mismatch.");return{...a,executionId:t,passId:r.passId}}async cancel(t,e){return this.details(await this.request(`/${encodeURIComponent(m.parse(t))}/cancel`,"POST",{},e),t)}async duplicate(t,e,r){let a=await this.details(await this.request(`/${encodeURIComponent(m.parse(t))}/duplicate`,"POST",{operationId:m.parse(e)},r));if(a.request.operationId!==e||a.configuration.sourceExperimentId!==t||a.summary.id===t)throw new Error("Duplicate Experiment admission differs from its source or operation.");return a}async score(t,e){let r=M.parse(t),a=this.pass(await this.request(`/${encodeURIComponent(r.execution.id)}/scoring-passes`,"POST",r,e));if(d(a.request)!==d(r))throw new Error("Scoring admission differs from its submitted inputs.");return a}async scoringPass(t,e){return this.pass(await this.request(`/scoring-passes/${encodeURIComponent(m.parse(t))}`,"GET",void 0,e),t)}async scoringPasses(t,e={}){let r=new URLSearchParams(e.afterId?{afterId:m.parse(e.afterId)}:{});e.executionKind&&r.set("executionKind",s.literal("recorded_evidence").parse(e.executionKind));let a=s.object({items:s.array(s.unknown()).max(30),nextCursor:m.nullable()}).strict().parse(await this.request(`/${encodeURIComponent(m.parse(t))}/scoring-passes?${r}`,"GET",void 0,e.signal)),n=a.items.map(o=>this.pass(o));if(n.some(o=>o.request.execution.id!==t||o.request.executionKind!==e.executionKind)||new Set(n.map(o=>o.id)).size!==n.length)throw new Error("Scoring pass page differs from its execution ownership.");return{items:n,nextCursor:a.nextCursor}}async cancelScoringPass(t,e){return this.pass(await this.request(`/scoring-passes/${encodeURIComponent(m.parse(t))}/cancel`,"POST",{},e),t)}async scoringResult(t,e){let r=s.object({executionId:m,passId:m,manifest:s.unknown(),result:s.unknown()}).strict().parse(await this.request(`/scoring-passes/${encodeURIComponent(m.parse(t))}/result`,"GET",void 0,e)),a=h(r);if(r.passId!==t||a.manifest.teamId!==this.options.teamId||a.manifest.id!==t||a.manifest.lineage?.execution.id!==r.executionId||a.manifest.lineage.scoringPassId!==t)throw new Error("Scoring result identity mismatch.");return{...a,executionId:r.executionId,passId:t}}async compare(t,e,r){let a=p(i=>i.startsWith("score_")?this.scoringResult(i,r):this.result(i,r),"read"),[n,o]=await Promise.all([a(t),a(e)]);return{baseline:n,candidate:o,comparison:S(n,o)}}async details(t,e){let r=await Q(t);if(r.summary.teamId!==this.options.teamId||e&&r.summary.id!==e)throw new Error("Experiment identity mismatch.");return r}pass(t,e){let r=w(t);if(r.teamId!==this.options.teamId||e&&r.id!==e)throw new Error("Scoring pass identity mismatch.");return r}async request(t,e,r,a){let n=await(this.options.fetch??fetch)(`${this.baseUrl}/v1/experiments${t}`,{method:e,signal:a,redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"X-OpenPond-Team-Id":this.options.teamId,"Content-Type":"application/json",Accept:"application/json"},...r===void 0?{}:{body:JSON.stringify(r)}}),o=await n.json();if(!n.ok){let i=s.object({code:s.string(),message:s.string()}).safeParse(o);throw new Y(n.status,i.success?i.data.code:"experiment_request_failed",i.success?i.data.message:"Experiment request failed.")}return o}},l=s.string().trim().min(1).max(500),J=s.string().regex(/^[a-f0-9]{64}$/),Z=s.object({schemaVersion:s.literal("openpond.experimentCaseInspection.v1"),teamId:l,executionId:l,manifestHash:J,receiptId:l,taskId:l,seed:s.string().min(1),input:s.record(s.string(),s.unknown()).nullable(),output:s.unknown().nullable(),error:s.string().nullable(),events:s.array(s.record(s.string(),s.unknown())).max(25),nextEventCursor:l.nullable(),eventCount:s.number().int().nonnegative()}).strict(),ee=Z.extend({contentHash:J}).strict(),Ie=class{static{p(this,"OpenPondExperimentInspectionClient")}constructor(t){this.options=t;let e=new URL(t.baseUrl);if(!["http:","https:"].includes(e.protocol)||e.username||e.password||e.search||e.hash||!t.apiKey.trim()||!t.teamId.trim())throw new Error("A clean API origin and workspace credentials are required.");this.baseUrl=e.toString().replace(/\/+$/,"")}options;baseUrl;async case(t,e,r={}){let a=new URLSearchParams(r.afterId?{afterId:l.parse(r.afterId)}:{}),n=await(this.options.fetch??fetch)(`${this.baseUrl}/v1/experiments/${encodeURIComponent(l.parse(t))}/cases/${encodeURIComponent(l.parse(e))}?${a}`,{signal:r.signal,redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"X-OpenPond-Team-Id":this.options.teamId,Accept:"application/json"}}),o=await n.json();if(!n.ok)throw new Error(s.object({message:s.string()}).parse(o).message);let i=ee.parse(o),{contentHash:c,...u}=i;if(d(u)!==c||i.teamId!==this.options.teamId||i.executionId!==t||i.receiptId!==e||r.manifestHash&&i.manifestHash!==r.manifestHash||i.events.length>i.eventCount)throw new Error("Case inspection differs from its requested workspace, execution or retained content.");return i}};function te(t){return JSON.stringify(t.release?["reward",t.release.id,t.release.revision,t.release.contentHash,t.feedbackKey]:["dataset",t.id,t.version,t.contentHash,t.feedbackKey])}p(te,"datasetGraderIdentity");function re(t){let e=new Map;for(let r of t){let a=te(r),n=e.get(a);n?n.aliases.push(r):e.set(a,{key:a,grader:r,aliases:[r]})}return[...e.values()]}p(re,"groupDatasetGraders");function ve(t){let e=re(t),r=new Map;for(let a of e){let n=r.get(a.grader.feedbackKey);if(n&&n!==a.key)throw new Error(`Different selected grader releases use feedback key "${a.grader.feedbackKey}". Select one, or publish graders with distinct feedback keys.`);r.set(a.grader.feedbackKey,a.key);let o=JSON.stringify(a.grader.mappings??[]);if(a.aliases.some(i=>JSON.stringify(i.mappings??[])!==o))throw new Error(`Aliases of grader "${a.grader.feedbackKey}" have different field mappings. Select one alias and review its mappings.`)}return e.map(a=>a.grader)}p(ve,"canonicalDatasetGraderSelection");function Se(t){let e=v(t.binding),r=H(t.packageValue),a=r.taskset;if(a.id!==e.dataset.id||a.revision!==e.dataset.revision||a.contentHash!==e.dataset.contentHash||r.contentHash!==e.packageHash||d(a.environment)!==e.environmentHash||d(r.files.filter(n=>n.asset.visibility!=="policy").map(n=>n.asset))!==e.privateDatasetClosureHash)throw new Error("The selected Dataset package, environment or protected closure changed.");if(e.population.length>500)throw new Error("Select at most 500 exact Dataset cases before starting this bounded Profile evaluation.");for(let n of e.population){let o=a.tasks.find(i=>i.id===n.taskId);if(!o||o.split!==e.split)throw new Error("The selected ordered population is outside its exact Dataset split.");if(n.fixtureId!==null)throw new Error("This recorded cutoff needs an admitted replay fixture before executing the Profile target.")}if(e.gradingSource){if(!t.actualGrading)throw new Error("The actual selected scoring owner is required for this recipe.");let n=w(t.actualGrading.pass),o=h(s.object({manifest:s.unknown(),result:s.unknown()}).strict().parse(t.actualGrading.evidence));if(n.status!=="completed"||n.id!==e.gradingSource.pass.id||n.contentHash!==e.gradingSource.pass.contentHash||o.manifest.id!==e.gradingSource.evidence.id||o.result.contentHash!==e.gradingSource.evidence.contentHash||o.manifest.lineage?.scoringPassId!==n.id||d(o.manifest.dataset)!==d(e.dataset)||d(o.manifest.evaluators)!==d(e.evaluators)||d(e.fieldMappings)!==d(n.graders.map(u=>({graderId:u.id,fields:u.mappings??[]}))))throw new Error("The selected scoring owner changed its exact Dataset, measurements or mappings.");let i=o.manifest.population,c=e.recordedOrigin?e.recordedOrigin.members.map(u=>({caseId:u.caseId,seed:u.seed,fixtureId:u.fixtureId})):e.population.map(u=>({caseId:u.taskId,seed:u.seed,fixtureId:u.fixtureId}));if(i.length!==c.length||i.some((u,N)=>d(u)!==d(c[N])))throw new Error("The selected scoring population differs from the exact ordered original cases and cutoffs.")}else{if(e.fieldMappings.some(i=>!a.graders.some(c=>c.id===i.graderId)))throw new Error("The field mappings name a grader outside the selected release.");for(let i of e.fieldMappings)j.parse(i.fields);let n=e.evaluators.map(i=>{let c=t.graders.find(u=>u.feedbackKey===i.feedbackKey&&d(u.release??{id:u.id,revision:u.version,contentHash:u.contentHash})===d(i.release));if(!c)throw new Error("Select an exact released Dataset grader for this external recipe.");return c});if(e.fieldMappings.some(i=>!n.some(c=>c.id===i.graderId)))throw new Error("Field mappings refer to an unselected grader.");let o=n.map(i=>({release:i.release??{id:i.id,revision:i.version,contentHash:i.contentHash},feedbackKey:i.feedbackKey,configurationHash:d({graderHash:i.contentHash,mappings:e.fieldMappings.find(c=>c.graderId===i.id)?.fields??[]}),output:"score",categories:[]}));if(d(o)!==d(e.evaluators))throw new Error("The external recipe's graders or mappings differ from the current exact released grading settings.");for(let i of t.graders)if(!a.graders.some(c=>c.id===i.id&&c.version===i.version&&d(c)===i.contentHash))throw new Error("External grader pins differ from the actual Dataset implementation.")}for(let n of t.graders)if(!a.graders.some(o=>o.id===n.id&&o.version===n.version&&d(o)===n.contentHash))throw new Error("Dataset-native grader pins differ from their actual implementation.");return r}p(Se,"verifyExternalDatasetPackage");var f=s.string().trim().min(1).max(240),se=s.object({profileRef:s.object({source:s.enum(["local","github","openpond_git"]),repositoryId:f,profileId:f}).strict(),sourceRevision:s.string().min(1).max(500),harnessRelease:x,catalogHash:s.string().regex(/^[a-f0-9]{64}$/).nullable(),definitions:s.array(E).max(1e3),suites:s.array(y).max(100),runs:s.array(s.object({profileRef:s.object({source:s.enum(["local","github","openpond_git"]),repositoryId:f,profileId:f}).strict(),manifest:C,metric:I,gradeRefs:s.array(x),receiptRefs:s.array(x),passRate:s.number().min(0).max(1),passed:s.boolean(),completedAt:s.iso.datetime(),contentHash:s.string().regex(/^[a-f0-9]{64}$/)}).strict()).max(1e3),comparisons:s.array(R).max(1e3),suiteRuns:s.array(U).max(1e3),reports:s.array(k).max(1e3)}).strict(),ae=s.object({teamId:f,profileRepositoryId:f,trainingProjectId:f.optional()}).strict(),ke=class{static{p(this,"OpenPondProfileEvaluationDiscoveryClient")}constructor(t){this.options=t;let e=new URL(t.baseUrl);if(!["http:","https:"].includes(e.protocol)||e.username||e.password||e.search||e.hash||!t.apiKey.trim()||!t.teamId.trim())throw new Error("Profile discovery requires a scoped HTTP endpoint and owner credential.")}options;async read(t,e){let r=ae.parse({...t,teamId:this.options.teamId}),{response:a,value:n}=await A(this.options.fetch??fetch,`${this.options.baseUrl.replace(/\/$/,"")}/v1/profile-evaluation-discovery`,{method:"POST",redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"X-OpenPond-Team-Id":this.options.teamId,"Content-Type":"application/json"},body:JSON.stringify(r),signal:e},(i,c,u)=>new Error(u));if(!a.ok)throw new Error("The released Profile evaluation owner is unavailable to this account and workspace.");let o=se.parse(n);if(o.profileRef.repositoryId!==r.profileRepositoryId)throw new Error("Profile discovery returned another source owner.");return o}};export{Y as a,xe as b,Ie as c,ve as d,Se as e,ke as f};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{d as c}from"./chunk-FUOEIDMA.js";import{cb as f}from"./chunk-ACYFMLWG.js";import{a as n}from"./chunk-FTQLQJQV.js";import{promises as v}from"node:fs";import u from"node:path";async function j(e){let s=await c(e.store,e.harnessRelease);if(!s)throw new Error("Profile evaluation Harness release is unavailable.");return w({...e,runtime:s})}n(j,"profileEvaluationsForRelease");async function w(e){let s=e.runtime,o=s.release.harnessRelease;if(o.id!==e.harnessRelease.id||o.contentHash!==e.harnessRelease.contentHash)throw new Error("Profile evaluation runtime differs from its requested release.");let r=o.metadata.profile;if(!r||typeof r!="object"||r.id!==e.ref.profileId||r.sourceRevision!==e.sourceRevision)throw new Error("Profile evaluation release differs from its accepted source.");let i={profileRef:e.ref,sourceRevision:e.sourceRevision,harnessRelease:e.harnessRelease};if(!o.files.some(a=>a.path==="evals/catalog.json"))return{...i,catalogHash:null,definitions:[],suites:[]};let d=u.join(s.release.bundlePath,"source"),t=n(async a=>o.files.some(g=>g.path===a)?v.readFile(u.join(d,...a.split("/"))):void 0,"read"),[R,p,m]=await Promise.all([t("evals/catalog.json"),t("workflows/catalog.json"),t("workflows/actions.json")]),{catalog:l,catalogHash:h}=f({agentSnapshot:s.release.agentSnapshot,harnessRelease:o,catalogBytes:R,workflowBytes:p,actionBytes:m});return{...i,catalogHash:h,definitions:l.definitions,suites:l.suites}}n(w,"profileEvaluationsForRuntime");export{j as a,w as b};
2
+ import{d as c}from"./chunk-WDEO44UN.js";import{nb as f}from"./chunk-RCA6NGVA.js";import{a as n}from"./chunk-FTQLQJQV.js";import{promises as v}from"node:fs";import u from"node:path";async function j(e){let s=await c(e.store,e.harnessRelease);if(!s)throw new Error("Profile evaluation Harness release is unavailable.");return w({...e,runtime:s})}n(j,"profileEvaluationsForRelease");async function w(e){let s=e.runtime,o=s.release.harnessRelease;if(o.id!==e.harnessRelease.id||o.contentHash!==e.harnessRelease.contentHash)throw new Error("Profile evaluation runtime differs from its requested release.");let r=o.metadata.profile;if(!r||typeof r!="object"||r.id!==e.ref.profileId||r.sourceRevision!==e.sourceRevision)throw new Error("Profile evaluation release differs from its accepted source.");let i={profileRef:e.ref,sourceRevision:e.sourceRevision,harnessRelease:e.harnessRelease};if(!o.files.some(a=>a.path==="evals/catalog.json"))return{...i,catalogHash:null,definitions:[],suites:[]};let d=u.join(s.release.bundlePath,"source"),t=n(async a=>o.files.some(g=>g.path===a)?v.readFile(u.join(d,...a.split("/"))):void 0,"read"),[R,p,m]=await Promise.all([t("evals/catalog.json"),t("workflows/catalog.json"),t("workflows/actions.json")]),{catalog:l,catalogHash:h}=f({agentSnapshot:s.release.agentSnapshot,harnessRelease:o,catalogBytes:R,workflowBytes:p,actionBytes:m});return{...i,catalogHash:h,definitions:l.definitions,suites:l.suites}}n(w,"profileEvaluationsForRuntime");export{j as a,w as b};
@@ -0,0 +1,5 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{e as B}from"./chunk-NHUUCNAD.js";import{a as G}from"./chunk-RJIUOLWY.js";import{t as M,x as N}from"./chunk-ZR7LIMJS.js";import{o as O,s as z,u as V}from"./chunk-O4FBOUNX.js";import{ca as q}from"./chunk-A66CSUBJ.js";import{Pb as F,Rb as L,v as C,z as A}from"./chunk-M55H7KVR.js";import{f as T}from"./chunk-ON2RNOCG.js";import{Ba as x,Ea as j,d as H,e as b}from"./chunk-RCA6NGVA.js";import{b as I,c as S,d as D,i as $,l as W,m as c}from"./chunk-BIPQCJ5V.js";import{A as P}from"./chunk-PF56N7ZY.js";import{a as h}from"./chunk-FTQLQJQV.js";import U from"node:path";import{constants as J}from"node:fs";import{open as ee,realpath as Y}from"node:fs/promises";async function K(e){let r=e.attempt.profileNative,p=P.array($).max(16).parse(e.attempt.artifactRefs??[]);if(!p.length)return[];if(!r||!e.storeDir)throw new Error("The actual retained artifact owner is unavailable.");await e.authorize();let t=await e.events(r.turnId);if(c(t)!==r.traceHash||t.some(l=>l.sessionId!==r.sessionId||l.turnId!==r.turnId))throw new Error("The saved artifacts differ from their actual retained case trace.");let o=[],n=0;for(let l of p){let f=t.filter(u=>(u.action==="work_output_save"||u.action==="sandbox_save_output")&&u.status==="completed").flatMap(u=>{let E=P.object({outputRef:M}).passthrough().safeParse(u.data);return E.success?[E.data.outputRef]:[]}).filter(u=>`${r.sessionId}/${u.id}/${u.revision}/${u.title}`===l.id&&u.sourceTaskId===r.sessionId&&u.sourceTurnId===r.turnId&&u.sha256===l.contentHash&&u.sizeBytes===l.sizeBytes&&u.contentType===l.mediaType);if(f.length!==1)throw new Error("The selected artifact has no unique actual saved output.");let a=f[0];if(a.location.kind!=="local"&&(a.location.kind!=="managed"||!e.readManaged)||a.sizeBytes>N)throw new Error("The retained artifact has no supported local byte owner.");if((n+=a.sizeBytes)>2e7)throw new Error("The retained artifacts exceed their aggregate grading byte limit.");await e.authorize(),e.signal?.throwIfAborted();let i;if(a.location.kind==="managed")i=await e.readManaged(a,e.signal);else if(a.location.kind==="local"){let u=await Y(U.join(e.storeDir,"work","outputs")),E=await Y(a.location.path);if(!E.startsWith(`${u}${U.sep}`))throw new Error("The artifact escaped canonical output storage.");let v=await ee(E,J.O_RDONLY|J.O_NOFOLLOW);try{let w=await v.stat();if(!w.isFile()||w.size!==a.sizeBytes)throw new Error("The artifact bytes changed.");i=await v.readFile()}finally{await v.close()}}else throw new Error("The saved artifact has no admitted byte owner.");if(i.length!==a.sizeBytes||W(i)!==a.sha256)throw new Error("The artifact bytes differ from their sealed receipt.");await e.authorize(),o.push({reference:l,title:a.title,contentType:a.contentType,base64:i.toString("base64"),...a.contentType.startsWith("text/")||a.contentType==="application/json"?{text:new TextDecoder("utf8",{fatal:!0}).decode(i)}:{}})}return await e.authorize(),o}h(K,"readLocalProfileArtifacts");import te from"node:path";async function X(e,r){if(e.limits.maximumSpendUsd===null)return;let p=process.env.OPENPOND_API_KEY?.trim(),t=process.env.OPENPOND_OPCHAT_API_URL?.trim();if(!p||!t)throw new Error("Profile evaluation requires an admitted hosted spend ceiling.");let o=new URL(`${t.replace(/\/+$/,"")}/experiment-budget`);if(o.protocol!=="https:"||o.username||o.password||o.search||o.hash)throw new Error("Profile evaluation spend authority URL is invalid.");o.searchParams.set("runId",e.id),o.searchParams.set("manifestHash",e.contentHash);let n=await fetch(o,{headers:{Authorization:`Bearer ${p}`},signal:r});if(!n.ok)throw new Error("The exact Profile evaluation spend ceiling is unavailable.");let l=P.object({runId:P.string(),manifestHash:P.string(),maximumCostUsd:P.number().positive()}).strict().parse(await n.json());if(l.runId!==e.id||l.manifestHash!==e.contentHash||l.maximumCostUsd!==e.limits.maximumSpendUsd)throw new Error("Profile evaluation spend authority differs from its admitted manifest.")}h(X,"assertProfileEvaluationSpendAuthority");async function Q(e){e.signal?.throwIfAborted();let r,p,t=h(()=>{},"rejectCancellation"),o=new Promise((a,i)=>{t=i}),n=h((a,i)=>{p||(p=new Error(a),e.onInterrupt?.(i),e.interrupt?(r=e.interrupt(a),r.catch(()=>{})):t(p))},"cancel"),l=h(()=>n("Profile evaluation run cancelled.","cancelled"),"aborted"),f=setTimeout(()=>n(`Profile evaluation case exceeded its ${e.timeoutMs}ms timeout.`,"timed_out"),e.timeoutMs);e.signal?.addEventListener("abort",l,{once:!0});try{e.signal?.aborted&&l();let a=await Promise.race([e.send(),o]);if(r){let i=await r;if(i.status==="in_progress"||!i.completedAt)throw new Error("Profile evaluation cleanup remains unconfirmed.")}if(a.status==="in_progress"||!a.completedAt)throw new Error("Workflow evaluation turn did not settle.");return a}catch(a){if(r){let i=await r;if(i.status==="in_progress"||!i.completedAt)throw new Error("Profile evaluation cleanup remains unconfirmed.",{cause:a})}throw a}finally{clearTimeout(f),e.signal?.removeEventListener("abort",l)}}h(Q,"awaitProfileEvaluationTurn");function Z(e){let r=e.manifest.profileEvaluation,p=e.manifest.policy;if(!r||p.kind!=="model"||e.manifest.execution.kind!=="harness")throw new Error("Profile evaluation requires a released source and model policy.");if(r.profileId!==e.profileRef.profileId||r.profileId!==e.binding.profileId||r.sourceRevision!==e.binding.sourceRevision||r.harnessRelease.id!==e.binding.harnessRelease.id||r.harnessRelease.contentHash!==e.binding.harnessRelease.contentHash||(e.binding.schemaVersion==="openpond.profileWorkflowBinding.v1"?r.target.kind!=="workflow"||r.target.workflowId!==e.binding.workflowId:r.target.kind==="workflow"||c(r.target)!==c(e.binding.target)))throw new Error("Profile evaluation binding differs from its admitted source.");if(p.model.provider!==e.modelRef.providerId||p.model.model!==e.modelRef.modelId||p.configurationHash!==e.modelConfigurationHash)throw new Error("Workflow evaluation model differs from its admitted configuration.");return async t=>{if(c(t.source)!==c(r))throw new Error("Workflow evaluation case differs from its admitted Profile source.");t.signal?.throwIfAborted(),await(e.assertSpendAuthority??X)(e.manifest,t.signal);let o=!!(e.attachments?.length||e.requiredOutputs?.length),n=await e.createSession({...o?{experience:"work"}:{},provider:e.modelRef.providerId,modelRef:e.modelRef,currentProfile:e.profileRef,...e.binding.schemaVersion==="openpond.profileWorkflowBinding.v1"?{profileWorkflowBinding:e.binding}:{profileComponentBinding:e.binding},hiddenFromDefaultSidebar:!0,metadata:{profileEvaluationRun:{id:e.manifest.id,contentHash:e.manifest.contentHash},taskId:t.task.id,seed:t.seed,...o&&e.profileRef.source==="local"?{workspaceTarget:"local"}:{},...e.ownedSessionMetadata}}),l=[...o?["This is an evaluation run. Complete the requested task using its public inputs. Save each required output with work_save_output, then send your final response to finish the case. Saving a file alone does not finish the case. Private grading runs after your final response; do not wait for grader feedback."]:[],typeof t.task.input=="string"?t.task.input:JSON.stringify(t.task.input),...Object.keys(t.task.policyVisibleContext).length?[`Policy-visible task context:
3
+ ${JSON.stringify(t.task.policyVisibleContext)}`]:[]].join(`
4
+
5
+ `)||" ";await e.admitSession?.(n);try{let f=!1,a=await Q({signal:t.signal,timeoutMs:e.manifest.limits.timeoutMs,onInterrupt:h(s=>{f=s==="timed_out",e.onInterrupt?.(s)},"onInterrupt"),...e.interruptSessionTurn?{interrupt:h(s=>e.interruptSessionTurn(n.id,s),"interrupt")}:{},send:h(()=>e.sendTurn(n.id,{prompt:l,...e.binding.schemaVersion==="openpond.profileWorkflowBinding.v1"?{workflowInput:{}}:e.binding.target.kind==="agent_action"?{workflowInput:t.task.input}:{},modelRef:e.modelRef,approvalPolicy:"on-request",...o?{sandbox:"workspace-write",codexPermissionMode:"default"}:{},...e.attachments?.length?{attachments:e.attachments}:{}}),"send")});if(a.status==="in_progress"||!a.completedAt)throw new Error("Workflow evaluation turn did not settle.");if(await e.validateTerminalTurn?.(n,a),!a.harnessSnapshot||a.harnessSnapshot.harnessRelease.id!==r.harnessRelease.id||a.harnessSnapshot.harnessRelease.contentHash!==r.harnessRelease.contentHash)throw new Error("Workflow evaluation turn executed a different Harness release.");if(!a.modelRef||c(a.modelRef)!==c(e.modelRef))throw new Error("Workflow evaluation turn executed a different model.");let i=await e.runtimeEventsForTurn(a.id),u=i.filter(s=>s.name==="workspace_action_result"&&(s.action==="sandbox_save_output"||s.action==="work_output_save")&&s.status==="completed"&&s.turnId===a.id).flatMap(s=>_(s.data)).filter(s=>s.sourceTaskId===n.id&&s.sourceTurnId===a.id&&s.location.kind!=="external"),v=(e.requiredOutputs??[]).flatMap(s=>{let k=[...u].reverse().find(y=>y.title===s.path&&y.contentType===s.mediaType&&(s.maxBytes===null||y.sizeBytes<=s.maxBytes));return k?[k]:[]}).map(s=>({id:`${n.id}/${s.id}/${s.revision}/${s.title}`,contentHash:s.sha256,mediaType:s.contentType,sizeBytes:s.sizeBytes})),w=-1;for(let s=i.length-1;s>=0;s-=1)if(i[s]?.name.endsWith(".delta")){w=s;break}let g=i.flatMap((s,k)=>s.name.endsWith(".delta")&&k!==w?[]:[s.id]);if(g.length+v.length>1e4)throw new Error("Profile evaluation produced more than 10,000 substantive evidence references.");let R=G(i,r.target.kind,a.status),d=Math.min(e.manifest.limits.maxOutputBytes,e.maximumOutputBytes??e.manifest.limits.maxOutputBytes);if(!Number.isSafeInteger(d)||d<1)throw new Error("Profile evaluation requires a positive bounded output limit.");let m=Buffer.byteLength(R,"utf8")>d;if(m&&!e.retainOutputLimitEvidence)throw new Error(`Profile evaluation case exceeded its ${d}-byte output limit.`);return m&&e.onOutputLimit?.(c(R)),{evidence:{output:{text:m?"":R},runtimeEventRefs:g,artifactRefs:v.map(s=>s.id),...m?{infrastructureError:`Profile evaluation case exceeded its ${d}-byte output limit.`}:a.status!=="completed"?{infrastructureError:a.error??`Workflow evaluation turn ${a.status}.`}:{}},traceHash:c(i),retainedEvidenceRef:{sessionId:n.id,turnId:a.id},artifactRefs:v,startedAt:a.startedAt,completedAt:a.completedAt,latencyMs:Math.max(0,Date.parse(a.completedAt)-Date.parse(a.startedAt)),costUsd:null,terminal:a.status==="completed"&&!m,failureClass:a.status==="completed"&&!m?null:a.status==="interrupted"?f?"timeout":"cancelled":"infrastructure_failure"}}finally{await e.settleSession?.(n.id)}}}h(Z,"createProfileWorkflowEvaluationExecutor");function _(e,r=0){if(e==null||r>8)return[];let p=M.safeParse(e);return p.success?[p.data]:Array.isArray(e)?e.flatMap(t=>_(t,r+1)):typeof e!="object"?[]:Object.values(e).flatMap(t=>_(t,r+1))}h(_,"findFileOutputs");var ae=P.object({manifest:C,taskset:x,profileRef:O,binding:P.union([H,b]),modelRef:T,modelConfigurationHash:S,taskId:I,seed:P.string().trim().min(1).max(500)}).strict();function Be(e){return async(r,p)=>{let t=ae.parse(r),o=await e.selectedProfile();if(!o||c(o.ref)!==c(t.profileRef)||o.sourceRevision!==t.binding.sourceRevision)throw new Error("Evaluation Profile differs from the app-server's authorized selection.");let n=await e.loadCatalog({ref:o.ref,sourceRevision:o.sourceRevision,harnessRelease:t.binding.harnessRelease}),l=t.manifest.profileEvaluation,f=await B({manifest:t.manifest,taskset:t.taskset,selected:{profileRef:o.ref,sourceRevision:o.sourceRevision,harnessRelease:t.binding.harnessRelease},loadCatalog:e.loadCatalog,resolveExternalDataset:e.resolveExternalDataset}),a=f?.definition??n.definitions.find(d=>d.id===l?.definitionId);if(A(t.manifest,t.taskset,f?.catalog??{schemaVersion:"openpond.profileEvaluations.v1",definitions:n.definitions,suites:n.suites}),!l||!a||(f?c(f.catalog):n.catalogHash)!==l.catalogHash||c(a)!==l.definitionHash||c(a.target)!==c(l.target)||a.tasksetRelease.id!==t.manifest.tasksetRelease.id||a.tasksetRelease.contentHash!==t.manifest.tasksetRelease.contentHash||!a.taskIds.includes(t.taskId)||!a.seeds.includes(t.seed)||t.manifest.population.filter(d=>d.taskId===t.taskId&&d.seed===t.seed).length!==1)throw new Error("Evaluation case differs from its released definition or admitted population.");let i=t.taskset.tasks.find(d=>d.id===t.taskId),u=j(i);if(u.artifactRefs.length!==i.artifactRefs.length||u.artifactRefs.length>z.maxAttachments)throw new Error("Evaluation case has an unauthorized task attachment.");if(u.artifactRefs.length&&!e.storeDir)throw new Error("Evaluation case attachment storage is unavailable.");let E=f?.packageValue??(u.artifactRefs.length||i.requiredOutputs?.length?await e.loadTasksetPackage(a,o.ref.profileId,t.binding.harnessRelease):null);if(E&&(E.contentHash!==t.manifest.packageHash||E.taskset.contentHash!==t.taskset.contentHash))throw new Error("Evaluation case Taskset differs from its frozen package or admitted manifest.");let v=u.artifactRefs.map(d=>{if(d.mediaType!=="application/pdf"||d.sizeBytes>z.maxAttachmentBytes)throw new Error(`Evaluation case attachment ${d.id} is not an admitted PDF.`);let m=E?.files.find(s=>s.asset.id===d.id);if(!m||c(m.asset)!==c(d))throw new Error(`Evaluation case attachment ${d.id} differs from its frozen Taskset file.`);return q(m),V.parse({id:d.id,name:te.basename(d.path),kind:"file",mediaType:d.mediaType,sizeBytes:d.sizeBytes,contentsBase64:m.base64})}),w=Z({manifest:t.manifest,profileRef:o.ref,binding:t.binding,modelRef:t.modelRef,modelConfigurationHash:t.modelConfigurationHash,createSession:e.createSession,sendTurn:e.sendTurn,...e.admitSession?{admitSession:h(d=>e.admitSession(d,t.manifest,t.taskId,t.seed,v),"admitSession")}:{},...e.settleSession?{settleSession:e.settleSession}:{},interruptSessionTurn:e.interruptSessionTurn,runtimeEventsForTurn:h(d=>e.store.runtimeEventsForTurn(d),"runtimeEventsForTurn"),attachments:v,requiredOutputs:i.requiredOutputs??[]});f&&await f.authorize(),p?.throwIfAborted();let g=await w({task:u,seed:t.seed,source:l,...p?{signal:p}:{}}),R=await K({storeDir:e.storeDir,readManaged:e.readManagedArtifact,attempt:{artifactRefs:g.artifactRefs,profileNative:g.retainedEvidenceRef?.sessionId&&g.retainedEvidenceRef.turnId?{sessionId:g.retainedEvidenceRef.sessionId,turnId:g.retainedEvidenceRef.turnId,traceHash:g.traceHash}:null},events:h(d=>e.store.runtimeEventsForTurn(d),"events"),signal:p,authorize:h(async()=>{p?.throwIfAborted();let d=await e.selectedProfile();if(!d||c(d)!==c(o))throw new Error("The current artifact Profile authority changed.");f&&await f.authorize()},"authorize")});return{...g,evidence:{...g.evidence,artifacts:R,caseOwner:{...g.retainedEvidenceRef,traceHash:g.traceHash}}}}}h(Be,"createProfileEvaluationCaseService");var oe=P.object({manifest:C,taskset:x,profileRef:O,binding:P.union([H,b]),modelRef:T,modelConfigurationHash:S}).strict();function Le(e){let r=new Map,p=h(async(t,o)=>{let n=await e.selectedProfile();if(!n||c(n.ref)!==c(t.profileRef)||n.sourceRevision!==t.binding.sourceRevision)throw new Error("Evaluation Profile differs from the app-server's authorized selection.");let l=await e.loadCatalog({ref:n.ref,sourceRevision:n.sourceRevision,harnessRelease:t.binding.harnessRelease}),f=await B({manifest:t.manifest,taskset:t.taskset,selected:{profileRef:n.ref,sourceRevision:n.sourceRevision,harnessRelease:t.binding.harnessRelease},loadCatalog:e.loadCatalog,resolveExternalDataset:e.resolveExternalDataset}),a=f?.catalog??{schemaVersion:"openpond.profileEvaluations.v1",definitions:l.definitions,suites:l.suites};if(A(t.manifest,t.taskset,a),!e.privateGrading&&(t.taskset.graders.some(m=>m.kind==="model_judge"||m.kind==="custom_verifier")||t.taskset.metrics?.aggregation==="custom"))throw new Error("Profile evaluation cannot run this Taskset's model judge, custom verifier, or custom metric in the current app-server runtime.");let i=t.manifest.profileEvaluation,u=t.manifest.policy;if(i.profileId!==n.ref.profileId||i.sourceRevision!==t.binding.sourceRevision||i.harnessRelease.id!==t.binding.harnessRelease.id||i.harnessRelease.contentHash!==t.binding.harnessRelease.contentHash||(t.binding.schemaVersion==="openpond.profileWorkflowBinding.v1"?i.target.kind!=="workflow"||i.target.workflowId!==t.binding.workflowId:i.target.kind==="workflow"||c(i.target)!==c(t.binding.target))||u.kind!=="model"||u.model.provider!==t.modelRef.providerId||u.model.model!==t.modelRef.modelId||u.configurationHash!==t.modelConfigurationHash)throw new Error("Evaluation request differs from its admitted Profile workflow or model configuration.");let E=a.definitions.find(m=>m.id===i.definitionId),v=e.privateGrading?f?.packageValue??await(e.loadTasksetPackage?e.loadTasksetPackage(E,n.ref.profileId,i.harnessRelease):Promise.reject(new Error("The current private Taskset owner is unavailable."))):null,w=v?await e.privateGrading?.(t.manifest,v,o):void 0;await w?.authorize();let g=await e.store.getProfileEvaluationRun(t.manifest.id);if(g){if(g.manifest.contentHash!==t.manifest.contentHash||c(g.profileRef)!==c(n.ref))throw new Error(`Profile evaluation run ${t.manifest.id} already exists with another manifest.`);return g}f&&await f.authorize(),o?.throwIfAborted();let R=await L({manifest:t.manifest,taskset:t.taskset,catalog:a,...w?{customVerifier:w.customVerifier,modelJudge:w.modelJudge,metricSource:w.metricSource,metricExecutor:w.metricExecutor}:{},execute:h(({task:m,seed:s,signal:k})=>e.executeCase({...t,taskId:m.id,seed:s},k),"execute"),...o?{signal:o}:{},saveGrade:h(async m=>(await e.store.saveProfileEvaluationGrade(m),{id:m.contentHash,contentHash:m.contentHash,mediaType:"application/json",sizeBytes:null}),"saveGrade"),saveReceipt:h(async m=>{await e.store.saveProfileEvaluationReceipt(m)},"saveReceipt"),loadCompletedMember:h(async({receiptId:m})=>{let s=await e.store.getProfileEvaluationReceipt(m);if(!s)return null;let k=s.graderEvidenceRefs[0],y=k&&await e.store.getProfileEvaluationGrade(k.contentHash);if(!y)throw new Error(`Retained Profile evaluation receipt ${m} is missing its grade.`);return{receipt:s,grade:y}},"loadCompletedMember")});await w?.authorize(),f&&await f.authorize();let d={profileRef:n.ref,manifest:t.manifest,metric:R.metric,gradeRefs:R.grades.map(m=>({id:m.contentHash,contentHash:m.contentHash})),receiptRefs:R.receipts.map(m=>({id:m.id,contentHash:m.contentHash})),passRate:R.passRate,passed:R.passed,completedAt:new Date().toISOString()};return e.store.saveProfileEvaluationRun({...d,contentHash:c(d)})},"run");return(t,o)=>{let n=oe.parse(t),l=r.get(n.manifest.id);if(l){if(l.manifestHash!==n.manifest.contentHash)throw new Error(`Profile evaluation run ${n.manifest.id} is already running with another manifest.`);return l.promise}let f=p(n,o);return r.set(n.manifest.id,{manifestHash:n.manifest.contentHash,promise:f}),f.finally(()=>{r.get(n.manifest.id)?.promise===f&&r.delete(n.manifest.id)}).catch(()=>{}),f}}h(Le,"createProfileEvaluationRunService");var ie=P.object({id:I,suiteId:I,createdAt:D,modelRef:T,hostModelConfigurationHash:S.optional()}).strict();function Je(e){let r=new Map,p=h(async t=>{let o=await e.selectedWorkflows(),n=await e.loadCatalog({ref:o.profileRef,sourceRevision:o.sourceRevision,harnessRelease:o.harnessRelease}),l={schemaVersion:"openpond.profileEvaluations.v1",definitions:n.definitions,suites:n.suites},f=l.suites.find(v=>v.id===t.suiteId);if(!f)throw new Error(`Profile evaluation suite ${t.suiteId} is absent from the selected release.`);let a=[];for(let v of f.definitionIds)a.push(await e.prepareRun({id:`suite-${c([t.id,v]).slice(0,32)}`,createdAt:t.createdAt,definitionId:v,modelRef:t.modelRef,...t.hostModelConfigurationHash?{hostModelConfigurationHash:t.hostModelConfigurationHash}:{}}));let i=await e.store.getProfileEvaluationSuiteRun(t.id);if(i){if(i.suiteId!==f.id||i.catalogHash!==c(l)||i.profileId!==o.profileRef.profileId||i.sourceRevision!==o.sourceRevision||i.harnessRelease.id!==o.harnessRelease.id||i.harnessRelease.contentHash!==o.harnessRelease.contentHash||i.createdAt!==t.createdAt)throw new Error(`Profile evaluation suite run ${t.id} already exists with another request.`);for(let[v,w]of i.members.entries()){let g=await e.store.getProfileEvaluationRun(w.runManifest.id);if(!g||g.contentHash!==w.runHash||g.manifest.contentHash!==w.runManifest.contentHash||g.manifest.contentHash!==a[v]?.manifest.contentHash)throw new Error("Retained Profile evaluation suite is missing member evidence.");let R=g.manifest.policy;if(R.kind!=="model"||R.model.provider!==t.modelRef.providerId||R.model.model!==t.modelRef.modelId)throw new Error(`Profile evaluation suite run ${t.id} already exists with another model.`)}return i}let u=[];for(let[v,w]of f.definitionIds.entries()){let g=a[v],R=await e.executeRun(g);u.push({definitionId:w,manifest:R.manifest,runHash:R.contentHash,passed:R.passed,score:R.metric.value})}let E=F({id:t.id,suiteId:f.id,catalog:l,members:u,createdAt:t.createdAt,completedAt:new Date().toISOString()});return e.store.saveProfileEvaluationSuiteRun(o.profileRef,l,E)},"run");return t=>{let o=ie.parse(t),n=c(o),l=r.get(o.id);if(l){if(l.requestHash!==n)throw new Error(`Profile evaluation suite run ${o.id} is already running with another request.`);return l.promise}let f=p(o);return r.set(o.id,{requestHash:n,promise:f}),f.finally(()=>{r.get(o.id)?.promise===f&&r.delete(o.id)}).catch(()=>{}),f}}h(Je,"createProfileEvaluationSuiteService");export{K as a,Z as b,Be as c,Le as d,Je as e};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{l,m as _}from"./chunk-ACYFMLWG.js";import{a as g}from"./chunk-TVQAPBLZ.js";import{h as b,m as f}from"./chunk-KGNCKIFP.js";import{b as e}from"./chunk-ES2ISFJC.js";import{a as c}from"./chunk-FTQLQJQV.js";var I="openpond.connectedEvidence.v1",q="connected-evidence-1",d={files:100,sourceBytes:32*1024*1024,decodedBytes:64*1024*1024,lineBytes:64*1024*1024,events:1e5,sessions:1e3,boundaries:5e3,evaluatorBytes:2*1024*1024},s=e.string().min(1).max(500),u=e.string().regex(/^[a-f0-9]{64}$/),j=e.string().datetime().nullable(),p=e.number().int().nonnegative().nullable(),C=e.enum(["native_chat","native_work","codex","claude_code","hermes","openclaw","opencode","grok_build","pi","oh_my_pi"]),R=e.object({invocationId:s,inputTokens:p,outputTokens:p,cachedInputTokens:p,totalTokens:p,provenance:e.enum(["billed_invocation","reported_invocation","reported_cumulative"])}).strict(),S=e.object({id:s,sequence:e.number().int().nonnegative(),occurredAt:j,kind:e.enum(["message","tool_call","tool_result","compaction","artifact","terminal","usage","unknown"]),role:e.enum(["user","assistant","system","tool"]).nullable(),callId:s.nullable(),parentId:s.nullable(),content:e.json(),usage:R.nullable()}).strict(),T=e.object({id:s,familyKey:s,projection:e.enum(["turn","conversation"]),requestEventId:s,start:e.number().int().nonnegative(),end:e.number().int().positive(),inputHash:u,outputHash:u.nullable(),revisionHash:u,terminal:e.enum(["completed","failed","cancelled","unknown"]),coverage:e.object({answer:e.boolean(),context:e.enum(["retained","compacted","unknown"]),process:e.enum(["retained","partial","absent"]),artifacts:e.enum(["retained","references_only","absent"]),replay:e.literal("unavailable"),gaps:e.array(e.string().max(500)).max(100)}).strict()}).strict(),A=e.object({schemaVersion:e.literal(I),normalizerVersion:e.literal(q),origin:C,sessionId:s,branchId:s.nullable(),parentSessionId:s.nullable(),exporterVersion:e.string().max(200).nullable(),acquisition:e.object({machineId:s,sourceInstanceId:s}).strict().optional(),sourceFiles:e.array(e.object({path:s,contentHash:u,sizeBytes:e.number().int().nonnegative()}).strict()).max(d.files),events:e.array(S).max(d.events),unmappedEvents:e.array(S).max(d.events),boundaries:e.array(T).max(d.boundaries),warnings:e.array(e.string().max(500)).max(100),contentHash:u}).strict();function O(t){return t.kind!=="message"||t.role!=="assistant"||t.content===null?!1:typeof t.content=="string"?t.content.trim().length>0:Array.isArray(t.content)?t.content.length>0:typeof t.content!="object"||!("text"in t.content)||typeof t.content.text=="string"&&t.content.text.trim().length>0}c(O,"hasRecordedConnectedAnswer");var B=e.string().regex(/^(0|-?[1-9][0-9]*)$/).max(20).refine(t=>{if(t.length>20||!/^(0|-?[1-9][0-9]*)$/.test(t))return!1;let n=BigInt(t);return n>=-(1n<<63n)&&n<1n<<63n},"SQL integers must fit signed 64-bit storage."),y=e.union([e.null(),e.string().max(262144),e.number().finite(),e.object({integer:B}).strict(),e.object({blobBase64:e.string().max(349528).regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/)}).strict()]),v=e.string().min(1).max(128).refine(t=>!t.includes("\0")),k=e.object({tables:e.array(e.object({name:v,columns:e.array(e.object({name:v,type:e.enum(["INTEGER","REAL","TEXT","BLOB"])}).strict()).min(1).max(128),rows:e.array(e.array(y).max(128)).max(4096)}).strict()).max(64)}).strict().superRefine((t,n)=>{let r=new Set;for(let[o,a]of t.tables.entries()){let i=a.name.toLowerCase();(r.has(i)||i.startsWith("sqlite_"))&&n.addIssue({code:"custom",path:["tables",o,"name"],message:"Table names must be unique and outside SQLite's reserved namespace."}),r.add(i),new Set(a.columns.map(m=>m.name.toLowerCase())).size!==a.columns.length&&n.addIssue({code:"custom",path:["tables",o,"columns"],message:"Column names must be unique."}),a.rows.some(m=>m.length!==a.columns.length)&&n.addIssue({code:"custom",path:["tables",o,"rows"],message:"Each row must match the declared columns."})}}),h=e.object({schemaVersion:e.literal("openpond.sqlExecution.v1"),snapshot:k,sql:e.string().min(1).max(65536).refine(t=>!t.includes("\0")),maxRows:e.number().int().min(1).max(4096),maxResultBytes:e.number().int().min(256).max(262144)}).strict(),L=e.discriminatedUnion("status",[e.object({status:e.literal("completed"),columns:e.array(e.string()).max(128),rows:e.array(e.array(y).max(128)).max(4096)}).strict(),e.object({status:e.literal("rejected"),code:e.enum(["invalid_query","multiple_statements","result_too_large","memory_limit"])}).strict()]);function $(t){l(t,1048576);let n=h.parse(t);if(new TextEncoder().encode(n.sql).byteLength>65536)throw new Error("sql_source_too_large");return n}c($,"assertSqlExecutionRequest");var x=e.object({scope:e.enum(["input","initialState","state","arguments"]),path:e.array(e.string().min(1).max(256)).max(16)}).strict(),E={id:e.string().min(1).max(128),operation:e.enum(["step","collect"]),toolName:e.string().min(1).max(500).optional(),timeoutMs:e.number().int().min(1).max(2e4)},w=e.discriminatedUnion("kind",[e.object({...E,kind:e.literal("sqlite.v1"),sql:x,snapshot:x,maxRows:h.shape.maxRows,maxResultBytes:h.shape.maxResultBytes}).strict(),e.object({...E,kind:e.literal("javascript.v1"),source:x,cases:x,exportName:e.string().regex(/^[A-Za-z_$][A-Za-z0-9_$]*$/).max(128),maxCases:e.number().int().min(1).max(32),maxResultBytes:e.number().int().min(256).max(262144)}).strict()]).superRefine((t,n)=>{t.operation==="step"!=(t.toolName!==void 0)&&n.addIssue({code:"custom",path:["toolName"],message:"Only step services require a declared tool name."}),t.operation==="collect"&&(t.kind==="sqlite.v1"?[t.sql,t.snapshot]:[t.source,t.cases]).some(o=>o.scope==="arguments")&&n.addIssue({code:"custom",message:"Collection has no tool arguments."})});var N=e.object({schemaVersion:e.literal("openpond.javascriptEnvironment.v1"),id:e.string().trim().min(1).max(500),revision:e.number().int().positive(),module:b.refine(t=>t.visibility==="host_private","Environment code belongs to the execution owner."),tools:e.array(g).min(1).max(200),maxSteps:e.number().int().min(1).max(1e3),maxStateBytes:e.number().int().min(1).max(1048576),maxObservationBytes:e.number().int().min(1).max(262144),operationTimeoutMs:e.number().int().min(1).max(3e4),executionServices:e.array(w).min(1).max(16).optional()}).strict().superRefine((t,n)=>{new Set(t.tools.map(o=>o.name)).size!==t.tools.length&&n.addIssue({code:"custom",path:["tools"],message:"Environment tool names must be unique."}),t.tools.forEach((o,a)=>{_(o.inputSchema).valid||n.addIssue({code:"custom",path:["tools",a,"inputSchema"],message:"Environment tools require a supported JSON schema."}),o.inputSchemaHash!==f(o.inputSchema)&&n.addIssue({code:"custom",path:["tools",a,"inputSchemaHash"],message:"Tool schema identity differs from its declared schema."})});let r=t.executionServices??[];new Set(r.map(o=>o.id)).size!==r.length&&n.addIssue({code:"custom",path:["executionServices"],message:"Execution service identities must be unique."}),r.forEach((o,a)=>{let i=t.tools.find(m=>m.name===o.toolName);o.operation==="step"&&!i&&n.addIssue({code:"custom",path:["executionServices",a,"toolName"],message:"Execution services must target a declared tool."}),o.timeoutMs>=Math.min(t.operationTimeoutMs,i?.timeoutMs??t.operationTimeoutMs)&&n.addIssue({code:"custom",path:["executionServices",a,"timeoutMs"],message:"Service budgets must leave time for the authored controller."})})}),H=N.safeExtend({contentHash:e.string().regex(/^[a-f0-9]{64}$/)}),Y=e.enum(["create","reset","step","collect","destroy"]),ee=e.object({state:e.record(e.string(),e.unknown()),observation:e.record(e.string(),e.unknown())}).strict();function te(t){l(t,4194304);let n=H.parse(t),{contentHash:r,...o}=n;if(f(o)!==r)throw new Error("environment_definition_hash_mismatch");return structuredClone(n)}c(te,"assertJavaScriptEnvironmentDefinition");export{I as a,q as b,d as c,C as d,S as e,T as f,A as g,O as h,L as i,$ as j,w as k,H as l,Y as m,ee as n,te as o};
2
+ import{l,m as _}from"./chunk-RCA6NGVA.js";import{a as g}from"./chunk-VHSX3JPX.js";import{h as b,m as f}from"./chunk-BIPQCJ5V.js";import{A as e}from"./chunk-PF56N7ZY.js";import{a as c}from"./chunk-FTQLQJQV.js";var I="openpond.connectedEvidence.v1",q="connected-evidence-1",d={files:100,sourceBytes:32*1024*1024,decodedBytes:64*1024*1024,lineBytes:64*1024*1024,events:1e5,sessions:1e3,boundaries:5e3,evaluatorBytes:2*1024*1024},s=e.string().min(1).max(500),u=e.string().regex(/^[a-f0-9]{64}$/),j=e.string().datetime().nullable(),p=e.number().int().nonnegative().nullable(),C=e.enum(["native_chat","native_work","codex","claude_code","hermes","openclaw","opencode","grok_build","pi","oh_my_pi"]),R=e.object({invocationId:s,inputTokens:p,outputTokens:p,cachedInputTokens:p,totalTokens:p,provenance:e.enum(["billed_invocation","reported_invocation","reported_cumulative"])}).strict(),S=e.object({id:s,sequence:e.number().int().nonnegative(),occurredAt:j,kind:e.enum(["message","tool_call","tool_result","compaction","artifact","terminal","usage","unknown"]),role:e.enum(["user","assistant","system","tool"]).nullable(),callId:s.nullable(),parentId:s.nullable(),content:e.json(),usage:R.nullable()}).strict(),T=e.object({id:s,familyKey:s,projection:e.enum(["turn","conversation"]),requestEventId:s,start:e.number().int().nonnegative(),end:e.number().int().positive(),inputHash:u,outputHash:u.nullable(),revisionHash:u,terminal:e.enum(["completed","failed","cancelled","unknown"]),coverage:e.object({answer:e.boolean(),context:e.enum(["retained","compacted","unknown"]),process:e.enum(["retained","partial","absent"]),artifacts:e.enum(["retained","references_only","absent"]),replay:e.literal("unavailable"),gaps:e.array(e.string().max(500)).max(100)}).strict()}).strict(),A=e.object({schemaVersion:e.literal(I),normalizerVersion:e.literal(q),origin:C,sessionId:s,branchId:s.nullable(),parentSessionId:s.nullable(),exporterVersion:e.string().max(200).nullable(),acquisition:e.object({machineId:s,sourceInstanceId:s}).strict().optional(),sourceFiles:e.array(e.object({path:s,contentHash:u,sizeBytes:e.number().int().nonnegative()}).strict()).max(d.files),events:e.array(S).max(d.events),unmappedEvents:e.array(S).max(d.events),boundaries:e.array(T).max(d.boundaries),warnings:e.array(e.string().max(500)).max(100),contentHash:u}).strict();function O(t){return t.kind!=="message"||t.role!=="assistant"||t.content===null?!1:typeof t.content=="string"?t.content.trim().length>0:Array.isArray(t.content)?t.content.length>0:typeof t.content!="object"||!("text"in t.content)||typeof t.content.text=="string"&&t.content.text.trim().length>0}c(O,"hasRecordedConnectedAnswer");var B=e.string().regex(/^(0|-?[1-9][0-9]*)$/).max(20).refine(t=>{if(t.length>20||!/^(0|-?[1-9][0-9]*)$/.test(t))return!1;let n=BigInt(t);return n>=-(1n<<63n)&&n<1n<<63n},"SQL integers must fit signed 64-bit storage."),y=e.union([e.null(),e.string().max(262144),e.number().finite(),e.object({integer:B}).strict(),e.object({blobBase64:e.string().max(349528).regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/)}).strict()]),v=e.string().min(1).max(128).refine(t=>!t.includes("\0")),k=e.object({tables:e.array(e.object({name:v,columns:e.array(e.object({name:v,type:e.enum(["INTEGER","REAL","TEXT","BLOB"])}).strict()).min(1).max(128),rows:e.array(e.array(y).max(128)).max(4096)}).strict()).max(64)}).strict().superRefine((t,n)=>{let r=new Set;for(let[o,a]of t.tables.entries()){let i=a.name.toLowerCase();(r.has(i)||i.startsWith("sqlite_"))&&n.addIssue({code:"custom",path:["tables",o,"name"],message:"Table names must be unique and outside SQLite's reserved namespace."}),r.add(i),new Set(a.columns.map(m=>m.name.toLowerCase())).size!==a.columns.length&&n.addIssue({code:"custom",path:["tables",o,"columns"],message:"Column names must be unique."}),a.rows.some(m=>m.length!==a.columns.length)&&n.addIssue({code:"custom",path:["tables",o,"rows"],message:"Each row must match the declared columns."})}}),h=e.object({schemaVersion:e.literal("openpond.sqlExecution.v1"),snapshot:k,sql:e.string().min(1).max(65536).refine(t=>!t.includes("\0")),maxRows:e.number().int().min(1).max(4096),maxResultBytes:e.number().int().min(256).max(262144)}).strict(),L=e.discriminatedUnion("status",[e.object({status:e.literal("completed"),columns:e.array(e.string()).max(128),rows:e.array(e.array(y).max(128)).max(4096)}).strict(),e.object({status:e.literal("rejected"),code:e.enum(["invalid_query","multiple_statements","result_too_large","memory_limit"])}).strict()]);function $(t){l(t,1048576);let n=h.parse(t);if(new TextEncoder().encode(n.sql).byteLength>65536)throw new Error("sql_source_too_large");return n}c($,"assertSqlExecutionRequest");var x=e.object({scope:e.enum(["input","initialState","state","arguments"]),path:e.array(e.string().min(1).max(256)).max(16)}).strict(),E={id:e.string().min(1).max(128),operation:e.enum(["step","collect"]),toolName:e.string().min(1).max(500).optional(),timeoutMs:e.number().int().min(1).max(2e4)},w=e.discriminatedUnion("kind",[e.object({...E,kind:e.literal("sqlite.v1"),sql:x,snapshot:x,maxRows:h.shape.maxRows,maxResultBytes:h.shape.maxResultBytes}).strict(),e.object({...E,kind:e.literal("javascript.v1"),source:x,cases:x,exportName:e.string().regex(/^[A-Za-z_$][A-Za-z0-9_$]*$/).max(128),maxCases:e.number().int().min(1).max(32),maxResultBytes:e.number().int().min(256).max(262144)}).strict()]).superRefine((t,n)=>{t.operation==="step"!=(t.toolName!==void 0)&&n.addIssue({code:"custom",path:["toolName"],message:"Only step services require a declared tool name."}),t.operation==="collect"&&(t.kind==="sqlite.v1"?[t.sql,t.snapshot]:[t.source,t.cases]).some(o=>o.scope==="arguments")&&n.addIssue({code:"custom",message:"Collection has no tool arguments."})});var N=e.object({schemaVersion:e.literal("openpond.javascriptEnvironment.v1"),id:e.string().trim().min(1).max(500),revision:e.number().int().positive(),module:b.refine(t=>t.visibility==="host_private","Environment code belongs to the execution owner."),tools:e.array(g).min(1).max(200),maxSteps:e.number().int().min(1).max(1e3),maxStateBytes:e.number().int().min(1).max(1048576),maxObservationBytes:e.number().int().min(1).max(262144),operationTimeoutMs:e.number().int().min(1).max(3e4),executionServices:e.array(w).min(1).max(16).optional()}).strict().superRefine((t,n)=>{new Set(t.tools.map(o=>o.name)).size!==t.tools.length&&n.addIssue({code:"custom",path:["tools"],message:"Environment tool names must be unique."}),t.tools.forEach((o,a)=>{_(o.inputSchema).valid||n.addIssue({code:"custom",path:["tools",a,"inputSchema"],message:"Environment tools require a supported JSON schema."}),o.inputSchemaHash!==f(o.inputSchema)&&n.addIssue({code:"custom",path:["tools",a,"inputSchemaHash"],message:"Tool schema identity differs from its declared schema."})});let r=t.executionServices??[];new Set(r.map(o=>o.id)).size!==r.length&&n.addIssue({code:"custom",path:["executionServices"],message:"Execution service identities must be unique."}),r.forEach((o,a)=>{let i=t.tools.find(m=>m.name===o.toolName);o.operation==="step"&&!i&&n.addIssue({code:"custom",path:["executionServices",a,"toolName"],message:"Execution services must target a declared tool."}),o.timeoutMs>=Math.min(t.operationTimeoutMs,i?.timeoutMs??t.operationTimeoutMs)&&n.addIssue({code:"custom",path:["executionServices",a,"timeoutMs"],message:"Service budgets must leave time for the authored controller."})})}),H=N.safeExtend({contentHash:e.string().regex(/^[a-f0-9]{64}$/)}),Y=e.enum(["create","reset","step","collect","destroy"]),ee=e.object({state:e.record(e.string(),e.unknown()),observation:e.record(e.string(),e.unknown())}).strict();function te(t){l(t,4194304);let n=H.parse(t),{contentHash:r,...o}=n;if(f(o)!==r)throw new Error("environment_definition_hash_mismatch");return structuredClone(n)}c(te,"assertJavaScriptEnvironmentDefinition");export{I as a,q as b,d as c,C as d,S as e,T as f,A as g,O as h,L as i,$ as j,w as k,H as l,Y as m,ee as n,te as o};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{pa as t}from"./chunk-QOGJAQDO.js";import{b as e}from"./chunk-ES2ISFJC.js";var n=e.string().trim().min(1).max(240),a=e.object({id:n,revision:e.number().int().positive(),ownerInstanceId:n,teamId:n,profileId:n,projectId:n,hostedModelId:n,role:t,roleTargetId:n,expectedBindingId:n,policyId:n.nullable(),authorizedConfigurationHash:e.string().length(64).nullable(),enabled:e.boolean(),updatedAt:e.string().datetime()}).strict(),o=e.object({id:n,grantId:n,revision:e.number().int().positive(),jobId:n,artifactHash:e.string().length(64),priorBindingId:n,bindingId:n.nullable(),restoredBindingId:n.nullable(),status:e.enum(["prepared","binding","canary","active","superseded","rolling_back","rolled_back","failed"]),leaseId:n,canarySeconds:e.number().int().min(30).max(600),activatedAt:e.string().datetime().nullable(),failure:e.string().max(2e3).nullable(),createdAt:e.string().datetime(),updatedAt:e.string().datetime()}).strict();export{a,o as b};
2
+ import{pa as t}from"./chunk-UFHLLSCE.js";import{A as e}from"./chunk-PF56N7ZY.js";var n=e.string().trim().min(1).max(240),a=e.object({id:n,revision:e.number().int().positive(),ownerInstanceId:n,teamId:n,profileId:n,projectId:n,hostedModelId:n,role:t,roleTargetId:n,expectedBindingId:n,policyId:n.nullable(),authorizedConfigurationHash:e.string().length(64).nullable(),enabled:e.boolean(),updatedAt:e.string().datetime()}).strict(),o=e.object({id:n,grantId:n,revision:e.number().int().positive(),jobId:n,artifactHash:e.string().length(64),priorBindingId:n,bindingId:n.nullable(),restoredBindingId:n.nullable(),status:e.enum(["prepared","binding","canary","active","superseded","rolling_back","rolled_back","failed"]),leaseId:n,canarySeconds:e.number().int().min(30).max(600),activatedAt:e.string().datetime().nullable(),failure:e.string().max(2e3).nullable(),createdAt:e.string().datetime(),updatedAt:e.string().datetime()}).strict();export{a,o as b};
@@ -1,4 +1,4 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as S,c as y}from"./chunk-F74GBN6K.js";import{D as h}from"./chunk-Y4OWBBDD.js";import{l as w}from"./chunk-ACYFMLWG.js";import{b as p}from"./chunk-ES2ISFJC.js";import{a as t}from"./chunk-FTQLQJQV.js";var T=p.object({score:p.number().finite().min(0).max(1).nullable(),passed:p.boolean(),feedback:p.string().max(2e4),evidenceRefs:p.array(p.string().max(240)).max(1e3).default([])}).strict().refine(e=>e.score!==null||!e.passed,{message:"Unscorable verifiers cannot pass.",path:["passed"]});function P(e){if(e==="sandbox_process")throw new Error("verifier_sandbox_process_required")}t(P,"assertIsolatedVerifierRuntime");import{Worker as R}from"node:worker_threads";async function g(e){e.signal?.throwIfAborted(),y(e);let{javascriptVerifierWorkerSource:d}=await import("./javascript-verifier-worker-source-F3LSGPOY.js");e.signal?.throwIfAborted();let a=e.signal,x={source:e.source,exportName:e.exportName,value:e.value,timeoutMs:e.timeoutMs,maxResultBytes:e.maxResultBytes,deterministic:e.deterministic===!0,errorPrefix:e.errorPrefix},c=t(i=>new Error(`${e.errorPrefix}_${i}`),"error");return new Promise((i,f)=>{let l=new R(d,{eval:!0,workerData:x,execArgv:[],env:{},resourceLimits:{maxOldGenerationSizeMb:64,maxYoungGenerationSizeMb:16,stackSizeMb:4}}),m=!1,o=t(r=>{m||(m=!0,clearTimeout(I),a?.removeEventListener("abort",u),l.terminate().then(()=>{"error"in r?f(r.error):i(r.result)},f))},"finish"),u=t(()=>o({error:a?.reason instanceof Error?a.reason:c("cancelled")}),"cancel"),I=setTimeout(()=>o({error:c("timeout")}),e.timeoutMs);a?.addEventListener("abort",u,{once:!0}),l.once("error",r=>o({error:r})),l.once("exit",()=>{m||o({error:c("worker_exited_without_result")})}),l.once("message",r=>{try{if(!r||typeof r!="object"||!("ok"in r))throw c("worker_invalid_response");if(r.ok!==!0)throw new Error("error"in r&&typeof r.error=="string"?r.error:`${e.errorPrefix}_execution_failed`);if(!("result"in r))throw c("worker_invalid_response");w(r.result,e.maxResultBytes),o({result:r.result})}catch(_){o({error:_ instanceof Error?_:c("worker_invalid_response")})}}),a?.aborted&&u()})}t(g,"executeJavaScriptIsolateInWorker");import{spawn as B}from"node:child_process";async function H(e){e.signal?.throwIfAborted(),y(e);let{javascriptIsolateProcessSource:d}=await import("./javascript-isolate-process-source-ZPQKKLR4.js");e.signal?.throwIfAborted();let{signal:a,stripTypeScript:x,...c}=e,i=t(l=>new Error(`${e.errorPrefix}_${l}`),"error"),f=`globalThis.__openpondIsolateInput = JSON.parse(${JSON.stringify(JSON.stringify(c))});
2
+ import{a as S,c as y}from"./chunk-V2HMWCT6.js";import{D as h}from"./chunk-M55H7KVR.js";import{l as w}from"./chunk-RCA6NGVA.js";import{A as p}from"./chunk-PF56N7ZY.js";import{a as t}from"./chunk-FTQLQJQV.js";var T=p.object({score:p.number().finite().min(0).max(1).nullable(),passed:p.boolean(),feedback:p.string().max(2e4),evidenceRefs:p.array(p.string().max(240)).max(1e3).default([])}).strict().refine(e=>e.score!==null||!e.passed,{message:"Unscorable verifiers cannot pass.",path:["passed"]});function P(e){if(e==="sandbox_process")throw new Error("verifier_sandbox_process_required")}t(P,"assertIsolatedVerifierRuntime");import{Worker as R}from"node:worker_threads";async function g(e){e.signal?.throwIfAborted(),y(e);let{javascriptVerifierWorkerSource:d}=await import("./javascript-verifier-worker-source-F3LSGPOY.js");e.signal?.throwIfAborted();let a=e.signal,x={source:e.source,exportName:e.exportName,value:e.value,timeoutMs:e.timeoutMs,maxResultBytes:e.maxResultBytes,deterministic:e.deterministic===!0,errorPrefix:e.errorPrefix},c=t(i=>new Error(`${e.errorPrefix}_${i}`),"error");return new Promise((i,f)=>{let l=new R(d,{eval:!0,workerData:x,execArgv:[],env:{},resourceLimits:{maxOldGenerationSizeMb:64,maxYoungGenerationSizeMb:16,stackSizeMb:4}}),m=!1,o=t(r=>{m||(m=!0,clearTimeout(I),a?.removeEventListener("abort",u),l.terminate().then(()=>{"error"in r?f(r.error):i(r.result)},f))},"finish"),u=t(()=>o({error:a?.reason instanceof Error?a.reason:c("cancelled")}),"cancel"),I=setTimeout(()=>o({error:c("timeout")}),e.timeoutMs);a?.addEventListener("abort",u,{once:!0}),l.once("error",r=>o({error:r})),l.once("exit",()=>{m||o({error:c("worker_exited_without_result")})}),l.once("message",r=>{try{if(!r||typeof r!="object"||!("ok"in r))throw c("worker_invalid_response");if(r.ok!==!0)throw new Error("error"in r&&typeof r.error=="string"?r.error:`${e.errorPrefix}_execution_failed`);if(!("result"in r))throw c("worker_invalid_response");w(r.result,e.maxResultBytes),o({result:r.result})}catch(_){o({error:_ instanceof Error?_:c("worker_invalid_response")})}}),a?.aborted&&u()})}t(g,"executeJavaScriptIsolateInWorker");import{spawn as B}from"node:child_process";async function H(e){e.signal?.throwIfAborted(),y(e);let{javascriptIsolateProcessSource:d}=await import("./javascript-isolate-process-source-ZPQKKLR4.js");e.signal?.throwIfAborted();let{signal:a,stripTypeScript:x,...c}=e,i=t(l=>new Error(`${e.errorPrefix}_${l}`),"error"),f=`globalThis.__openpondIsolateInput = JSON.parse(${JSON.stringify(JSON.stringify(c))});
3
3
  ${x?`globalThis.__openpondIsolateInput.source = require("node:module").stripTypeScriptTypes(globalThis.__openpondIsolateInput.source, { mode: "strip" });
4
4
  `:""}${d}`;return new Promise((l,m)=>{let o=B("node",["--max-old-space-size=64","--input-type=commonjs","-"],{stdio:["pipe","pipe","pipe"],env:{PATH:process.env.PATH},windowsHide:!0}),u,I="",r=0,_=0,v=t(n=>{u??=n,o.kill("SIGKILL")},"stop"),k=t(()=>v(a?.reason instanceof Error?a.reason:i("cancelled")),"cancel"),J=setTimeout(()=>v(e.errorPrefix==="candidate"?new S("candidate_timeout"):i("timeout")),e.timeoutMs);a?.addEventListener("abort",k,{once:!0}),o.stdout.setEncoding("utf8"),o.stdout.on("data",n=>{r+=Buffer.byteLength(n),r>e.maxResultBytes+65536?v(i("process_response_too_large")):I+=n}),o.stderr.on("data",n=>{_+=n.byteLength,_>65536&&v(i("process_stderr_too_large"))}),o.once("error",n=>{u??=n}),o.stdin.on("error",n=>v(n)),o.once("close",n=>{if(clearTimeout(J),a?.removeEventListener("abort",k),u){m(u);return}try{if(n!==0)throw i("process_exited_without_result");let s=JSON.parse(I);if(!s||typeof s!="object"||!("ok"in s))throw i("process_invalid_response");if(s.ok!==!0){let b="error"in s&&typeof s.error=="string"?s.error:`${e.errorPrefix}_execution_failed`;throw"executionError"in s&&s.executionError===!0?new S(b):new Error(b)}if(!("result"in s))throw i("process_invalid_response");w(s.result,e.maxResultBytes),l(s.result)}catch(s){m(s instanceof Error?s:i("process_invalid_response"))}}),o.stdin.end(f),a?.aborted&&k()})}t(H,"executeJavaScriptIsolateInProcess");async function Y(e){return P(e.runtime),T.parse(await g({...e,exportName:e.exportName??"verify",maxResultBytes:65536,errorPrefix:"verifier"}))}t(Y,"executeJavaScriptVerifierInWorker");function re(e){return h(e,E)}t(re,"aggregateTasksetEvaluationInWorker");var E=t(async({source:e,module:d,exportName:a,scores:x,timeoutMs:c,signal:i})=>{let f=/\.[cm]?ts$/.test(d)?(await import("node:module")).stripTypeScriptTypes(e,{mode:"strip"}):e;return g({source:f,exportName:a,value:x,timeoutMs:c,signal:i,maxResultBytes:1024,deterministic:!0,errorPrefix:"metric"})},"executeMetric");var te=E;export{T as a,g as b,H as c,Y as d,re as e,te as f};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{v as r}from"./chunk-BLXEAZCQ.js";import{N as s,O as a,P as d}from"./chunk-QL4OIPEZ.js";import{a as n}from"./chunk-FTQLQJQV.js";async function u(){return{...s.parse(await r({path:"/saved-work"})),webBaseUrl:i()}}n(u,"listHostedSavedWork");async function m(e){let t=a.parse(e);return r({path:"/saved-work",method:"POST",body:t})}n(m,"createHostedSavedWork");async function h(e,t){let o=d.parse(t);return r({path:`/saved-work/schedules/${encodeURIComponent(e)}`,method:"PATCH",body:o})}n(h,"updateHostedSavedWork");async function k(e){return r({path:`/saved-work/schedules/${encodeURIComponent(e)}`,method:"DELETE"})}n(k,"deleteHostedSavedWork");async function P(e,t){return r({path:`/saved-work/schedules/${encodeURIComponent(e)}/run`,method:"POST",body:{clientRequestId:t}})}n(P,"runHostedSavedWork");function i(e=process.env){let t=e.OPENPOND_HOSTED_WEB_URL?.trim()||e.OPENPOND_SANDBOX_BASE_URL?.trim()||e.OPENPOND_API_URL?.trim()||e.OPENPOND_SANDBOX_API_URL?.trim()||"https://api.openpond.ai",o=new URL(t);return o.hostname==="api.openpond.ai"||o.hostname.endsWith(".api.openpond.ai")?"https://openpond.ai":(o.pathname="",o.search="",o.hash="",o.origin)}n(i,"hostedWebBaseUrl");export{u as a,m as b,h as c,k as d,P as e,i as f};
2
+ import{v as r}from"./chunk-OKBIWRHC.js";import{N as s,O as a,P as d}from"./chunk-ZR7LIMJS.js";import{a as n}from"./chunk-FTQLQJQV.js";async function u(){return{...s.parse(await r({path:"/saved-work"})),webBaseUrl:i()}}n(u,"listHostedSavedWork");async function m(e){let t=a.parse(e);return r({path:"/saved-work",method:"POST",body:t})}n(m,"createHostedSavedWork");async function h(e,t){let o=d.parse(t);return r({path:`/saved-work/schedules/${encodeURIComponent(e)}`,method:"PATCH",body:o})}n(h,"updateHostedSavedWork");async function k(e){return r({path:`/saved-work/schedules/${encodeURIComponent(e)}`,method:"DELETE"})}n(k,"deleteHostedSavedWork");async function P(e,t){return r({path:`/saved-work/schedules/${encodeURIComponent(e)}/run`,method:"POST",body:{clientRequestId:t}})}n(P,"runHostedSavedWork");function i(e=process.env){let t=e.OPENPOND_HOSTED_WEB_URL?.trim()||e.OPENPOND_SANDBOX_BASE_URL?.trim()||e.OPENPOND_API_URL?.trim()||e.OPENPOND_SANDBOX_API_URL?.trim()||"https://api.openpond.ai",o=new URL(t);return o.hostname==="api.openpond.ai"||o.hostname.endsWith(".api.openpond.ai")?"https://openpond.ai":(o.pathname="",o.search="",o.hash="",o.origin)}n(i,"hostedWebBaseUrl");export{u as a,m as b,h as c,k as d,P as e,i as f};
@@ -1,3 +1,3 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{g as E,m as g,n as j}from"./chunk-QNG27G3T.js";import{k as P}from"./chunk-N4FFQPLR.js";import{e as A,f as x,g as D,l as I}from"./chunk-GJ2ZJFDD.js";import{b as W}from"./chunk-L3KS6MOV.js";import{m as $}from"./chunk-KGNCKIFP.js";import{a as v}from"./chunk-FTQLQJQV.js";import{randomUUID as H}from"node:crypto";import{promises as p}from"node:fs";import{stripTypeScriptTypes as M}from"node:module";import m from"node:path";async function Q(e){let r=A.parse(e.overlay),t=x.parse(e.proposal),o=e.validations.map(h=>D.parse(h));if((t.route==="agent"?t.edits.filter(h=>h.target!=="harness.json"&&h.operation!=="delete"):[]).length>0){let h=t.validationPlan.find(n=>n.kind==="component_activation"&&n.required);if(!h)throw new Error("Desktop Work Agent proposals require component-activation validation before review.");if(o.find(n=>n.validationId===h.id)?.status==="passed")throw new Error("Desktop Work cannot accept a passed Agent activation receipt until an Agent source executor exists.")}if(t.overlay.id!==r.id||t.overlay.revision!==r.revision||t.overlay.contentHash!==r.contentHash)throw new Error("Refiner proposal is not bound to the supplied run overlay.");if(r.status!=="frozen")throw new Error("Only a frozen run overlay can advance a Harness workspace.");let i=await e.store.getHarnessWorkspace(t.expectedWorkspace.workspaceId);if(!i)throw new Error(`Harness workspace ${t.expectedWorkspace.workspaceId} does not exist.`);if(i.location!==e.store.harnessStoragePlacement)throw new Error("Refiner workspace does not match the admitted storage placement.");let s=E(e.storeDir,i.id),l=await g({workspaceId:i.id,sourceDir:s.source});if(l.sourceRevision!==i.sourceRevision)throw new Error(`Harness source is ${l.sourceRevision}; workspace expects ${i.sourceRevision}. Record or revert the source change before refinement.`);let w=m.join(s.root,`.source-candidate-${H()}`);await p.cp(s.source,w,{recursive:!0,force:!1,errorOnExist:!0,verbatimSymlinks:!1});try{await V(w,t);let h=await g({workspaceId:i.id,sourceDir:w}),f=(e.now??(()=>new Date().toISOString()))(),n=await j({storeDir:e.storeDir,workspaceId:i.id,compiled:h,createdAt:f});await e.store.saveHarnessReleaseRecord(n),await e.store.saveHarnessImprovementArtifact(i.id,"run_overlay",r),await e.store.saveHarnessImprovementArtifact(i.id,"proposal",t);for(let a of o)await e.store.saveHarnessImprovementArtifact(i.id,"targeted_validation",a);if(!P({workspace:i,proposal:t}).eligible&&!e.reviewAuthority)return e.store.advanceHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:i.id,proposal:t,validations:o,nextRelease:{id:n.harnessRelease.id,contentHash:n.harnessRelease.contentHash},nextSourceRevision:n.sourceRevision,now:f});let u=m.join(s.root,`.source-backup-${H()}`),c=m.join(s.root,"source-swap.json");await _(c,{schemaVersion:"openpond.localHarnessSourceSwap.v1",workspaceId:i.id,expectedWorkspaceRevision:i.revision,previousSourceRevision:i.sourceRevision,nextSourceRevision:n.sourceRevision,backupSource:u,candidateSource:w,createdAt:f}),await p.rename(s.source,u),await p.rename(w,s.source);try{let a=e.reviewAuthority?await e.store.advanceReviewedHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:i.id,proposal:t,validations:o,nextRelease:{id:n.harnessRelease.id,contentHash:n.harnessRelease.contentHash},nextSourceRevision:n.sourceRevision,reviewer:e.reviewAuthority.reviewer,now:f}):await e.store.advanceHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:i.id,proposal:t,validations:o,nextRelease:{id:n.harnessRelease.id,contentHash:n.harnessRelease.contentHash},nextSourceRevision:n.sourceRevision,now:f});return a.receipt.decision!=="advanced"?await b(s.source,u):await p.rm(u,{recursive:!0,force:!0}),await p.rm(c,{force:!0}),a}catch(a){throw await b(s.source,u).catch(()=>{}),await p.rm(c,{force:!0}).catch(()=>{}),a}}finally{await p.rm(w,{recursive:!0,force:!0}).catch(()=>{})}}v(Q,"applyLocalHarnessRefinerProposal");async function X(e){let r=await e.store.getHarnessWorkspace(e.workspaceId);if(!r||r.location!==e.store.harnessStoragePlacement)throw new Error(`Local Harness workspace ${e.workspaceId} does not exist.`);if(r.currentChannel.release?.id!==e.rollbackOf.id||r.currentChannel.release.contentHash!==e.rollbackOf.contentHash)throw new Error("Harness rollback source is no longer the current release.");let t=await e.store.getHarnessReleaseRecord(e.targetRelease.contentHash);if(!t||t.workspaceId!==r.id||t.harnessRelease.id!==e.targetRelease.id)throw new Error("Harness rollback target is unavailable in this workspace.");let o=E(e.storeDir,r.id);if((await g({workspaceId:r.id,sourceDir:o.source})).sourceRevision!==r.sourceRevision)throw new Error("Harness source changed before rollback.");let i=m.join(o.root,`.source-rollback-${H()}`);await p.cp(m.join(t.bundlePath,"source"),i,{recursive:!0,force:!1,errorOnExist:!0,verbatimSymlinks:!1});try{if((await g({workspaceId:r.id,sourceDir:i})).sourceRevision!==t.sourceRevision)throw new Error("Harness rollback bundle does not reproduce its registered source revision.");let l=(e.now??(()=>new Date().toISOString()))(),w=m.join(o.root,`.source-backup-${H()}`),h=m.join(o.root,"source-swap.json");await _(h,{schemaVersion:"openpond.localHarnessSourceSwap.v1",workspaceId:r.id,expectedWorkspaceRevision:r.revision,previousSourceRevision:r.sourceRevision,nextSourceRevision:t.sourceRevision,backupSource:w,candidateSource:i,createdAt:l}),await p.rename(o.source,w),await p.rename(i,o.source);try{let f=await e.store.rollbackHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:r.id,expectedWorkspaceRevision:r.revision,expectedChannelRevision:r.currentChannel.revision,targetRelease:e.targetRelease,targetSourceRevision:t.sourceRevision,rollbackOf:e.rollbackOf,now:l});return f.receipt.decision!=="rolled_back"?await b(o.source,w):await p.rm(w,{recursive:!0,force:!0}),await p.rm(h,{force:!0}),f}catch(f){throw await b(o.source,w).catch(()=>{}),await p.rm(h,{force:!0}).catch(()=>{}),f}}finally{await p.rm(i,{recursive:!0,force:!0}).catch(()=>{})}}v(X,"rollbackLocalHarnessWorkspaceRelease");async function Y(e){let r=x.parse(e.proposal);if(r.expectedWorkspace.workspaceId!==e.workspace.id)throw new Error("Refiner proposal targets a different Harness workspace.");if(r.route==="memory")return q({proposal:r,now:e.now});let t=E(e.storeDir,e.workspace.id),o=await g({workspaceId:e.workspace.id,sourceDir:t.source});if(o.sourceRevision!==r.expectedWorkspace.sourceRevision)throw new Error("Refiner proposal source revision no longer matches the Local Harness workspace.");let d=m.join(t.root,`.validation-candidate-${H()}`);await p.cp(t.source,d,{recursive:!0,force:!1,errorOnExist:!0,verbatimSymlinks:!1});let i=(e.now??(()=>new Date().toISOString()))();try{await V(d,r);let s=await g({workspaceId:e.workspace.id,sourceDir:d}),l=new Map(s.manifest.files.map(n=>[n.path,n])),w=new Map(r.edits.map(n=>[n.target,n])),h=O(o),f=O(s);return Promise.all(r.validationPlan.map(async n=>{let y="passed",u="The candidate Harness source compiles and preserves its manifest contract.";try{if(n.kind==="observed_recovery"){let c=r.evidence.filter(a=>a.kind==="recovery");if(c.length===0)throw new Error("Observed-recovery validation requires recorded recovery evidence.");u=`Validated ${c.length} immutable recovery evidence reference(s) before candidate advancement.`}else if(n.kind==="prompt"){let c=r.edits.filter(a=>a.route==="prompt"&&a.target!=="harness.json");if(c.length===0)throw new Error("Prompt validation requires an instruction-file edit.");for(let a of c){let k=l.get(a.target);if(a.operation==="delete"){if(k)throw new Error(`Deleted instruction ${a.target} remains declared.`)}else if(k?.kind!=="instruction")throw new Error(`Instruction ${a.target} is not declared in the candidate Harness.`);if(a.content!==null&&/\b(?:api[_-]?key|access[_-]?token|password|secret)\s*[:=]/i.test(a.content))throw new Error(`Instruction ${a.target} appears to contain credential material.`)}u=`Validated ${c.length} textual instruction edit(s) and compiled candidate ${s.harnessRelease.id}.`}else if(n.kind==="skill"){let c=r.edits.filter(a=>a.route==="skill"&&a.target!=="harness.json");if(c.length===0)throw new Error("Skill validation requires a declared Skill-file edit.");for(let a of c){let k=l.get(a.target);if(a.operation==="delete"){if(k)throw new Error(`Deleted Skill ${a.target} remains declared.`);continue}if(k?.kind!=="skill")throw new Error(`Skill ${a.target} is not declared in the candidate Harness.`);let S=w.get(a.target)?.content;if(!S)throw new Error(`Skill edit ${a.target} has no content.`);let R=W(S);if(!R.name||!R.description||R.messages.length>0)throw new Error(`Skill ${a.target} is invalid: ${R.messages.join(" ")}`)}u=`Validated ${c.length} Skill edit(s), Skill frontmatter, and compiled candidate ${s.harnessRelease.id}.`}else if(n.kind==="dependency"){let c=s.manifest.files.find(a=>a.kind==="dependency_lock");if(!c)throw new Error("Candidate Harness has no dependency lock.");JSON.parse(await p.readFile(T(d,c.path),"utf8")),u=`Validated dependency lock ${c.path} and compiled candidate ${s.harnessRelease.id}.`}else if(n.kind==="schema")x.parse(r),u=`Validated proposal, manifest, and candidate release schemas for ${s.harnessRelease.id}.`;else if(n.kind==="package"){let c=r.edits.filter(a=>a.route==="agent"&&a.operation!=="delete"&&a.target!=="harness.json");for(let a of c){if(!a.content)throw new Error(`Agent edit ${a.target} has no source.`);M(a.content,{mode:"transform",sourceUrl:a.target,sourceMap:!1})}u=c.length>0?`Syntax-checked ${c.length} Agent source edit(s) and compiled candidate ${s.harnessRelease.id}.`:`Compiled candidate package ${s.harnessRelease.id} and preserved the Harness source manifest contract.`}else if(n.kind==="component_activation"){let c=r.edits.filter(a=>a.target!=="harness.json");if(c.length===0)throw new Error("Component activation requires a concrete Harness component edit.");if(r.route==="agent"){if(c.filter(k=>k.operation!=="delete").length>0)throw new Error("Desktop Work does not compile or execute released Agent source; use an active instruction or standalone Skill, or add an Agent executor before release.");u=`Confirmed ${c.length} deleted Agent component(s) were inactive in Desktop Work.`}else{if(!["prompt","skill"].includes(r.route))throw new Error(`Desktop Work has no activation policy for ${r.route} proposals.`);let a=r.route==="prompt"?"instruction":"skill";for(let k of c){let S=f.components.find(R=>R.path===k.target&&R.kind===a);if(k.operation==="delete"?S:!S)throw new Error(`${a} ${k.target} is not reflected in the candidate Desktop Work runtime surface.`)}if(h.contentHash===f.contentHash)throw new Error("The candidate does not change the effective Desktop Work runtime surface.");u=`Activated ${c.length} ${a} edit(s) in the candidate Desktop Work runtime surface.`}}else n.kind==="business_formula"?(y="blocked",u="Business or financial logic is retained for review until an approved deterministic fixture supplies inputs and expected outputs."):n.kind==="targeted_evaluation"?(y="blocked",u="This sensitive change requires an explicit authority-preserving targeted Evaluation before release."):n.kind==="file_render"?(y="blocked",u="File-render validation requires an exact produced artifact reference; no artifact was attached to this Harness-source proposal."):(y="blocked",u=`Local targeted validation does not yet own ${n.kind}; it requires its dedicated validator.`)}catch(c){y="failed",u=c instanceof Error?c.message:String(c)}return I({schemaVersion:"openpond.harnessTargetedValidationReceipt.v1",id:`validation-${r.id}-${n.id}`,proposal:{id:r.id,contentHash:r.contentHash},validationId:n.id,kind:n.kind,status:y,summary:u,evidenceRefs:r.evidence,createdAt:i,metadata:{candidateHarnessRelease:{id:s.harnessRelease.id,contentHash:s.harnessRelease.contentHash},sourceRevision:s.sourceRevision,...n.kind==="component_activation"?{targetRuntime:"desktop_work",beforeEffectiveRuntimeHash:h.contentHash,afterEffectiveRuntimeHash:f.contentHash,activatedComponentRefs:f.components,inactiveAgentRefs:f.inactiveAgents}:{}}})}))}catch(s){let l=s instanceof Error?s.message:String(s);return r.validationPlan.map(w=>I({schemaVersion:"openpond.harnessTargetedValidationReceipt.v1",id:`validation-${r.id}-${w.id}`,proposal:{id:r.id,contentHash:r.contentHash},validationId:w.id,kind:w.kind,status:"failed",summary:l,evidenceRefs:r.evidence,createdAt:i,metadata:{}}))}finally{await p.rm(d,{recursive:!0,force:!0}).catch(()=>{})}}v(Y,"validateLocalHarnessRefinerProposal");function O(e){let r=[...e.agentSnapshot.instructions.map(o=>({kind:"instruction",path:o.path,contentHash:o.contentHash})),...e.agentSnapshot.skills.map(o=>({kind:"skill",path:o.path,contentHash:o.contentHash}))].sort((o,d)=>o.path.localeCompare(d.path)),t=e.agentSnapshot.agents.map(o=>({path:o.path,contentHash:o.contentHash})).sort((o,d)=>o.path.localeCompare(d.path));return{contentHash:$({schemaVersion:"openpond.desktopWorkHarnessSurface.v1",components:r}),components:r,inactiveAgents:t}}v(O,"desktopWorkRuntimeSurface");function q(e){let r=(e.now??(()=>new Date().toISOString()))(),t=e.proposal.edits.find(o=>o.route==="memory");return e.proposal.validationPlan.map(o=>{let d="passed",i="Memory candidate is bounded, scoped, and contains no obvious credential material.";try{if(o.kind==="observed_recovery"){if(!e.proposal.evidence.some(s=>s.kind==="recovery"))throw new Error("Observed-recovery validation requires recorded recovery evidence.");i="Memory proposal is grounded in immutable recovery evidence."}else if(o.kind==="memory"){if(!t||!/^memory\/[a-z0-9][a-z0-9-]{0,119}$/.test(t.target))throw new Error("Memory proposal requires one safe memory/<slug> target.");let s=e.proposal.metadata.expectedMemory;if(!s||typeof s!="object"||Array.isArray(s))throw new Error("Memory proposal requires an expected revision snapshot.");let l=s;if(l.key!==C(t.target))throw new Error("Memory proposal expected revision targets a different key.");if(l.revision!==null&&(!Number.isInteger(l.revision)||Number(l.revision)<1))throw new Error("Memory proposal expected revision is invalid.");if(l.contentHash!==null&&typeof l.contentHash!="string")throw new Error("Memory proposal expected content hash is invalid.");if(l.status!==null&&l.status!=="active"&&l.status!=="deleted")throw new Error("Memory proposal expected status is invalid.");if(l.revision===null&&(l.contentHash!==null||l.status!==null))throw new Error("New memory snapshot must not claim existing content or status.");if(l.revision!==null&&(typeof l.contentHash!="string"||l.status===null))throw new Error("Existing memory snapshot requires its content hash and status.");if(t.operation==="delete"&&l.status!=="active")throw new Error("Memory deletion requires an active expected revision.");if(t.operation!=="delete"){if(!t.content?.trim()||t.content.length>24e3)throw new Error("Memory content must contain 1-24,000 characters.");if(/\b(?:api[_-]?key|access[_-]?token|password|secret)\s*[:=]/i.test(t.content))throw new Error("Memory content appears to contain credential material.")}}else d="blocked",i=`Memory validation cannot satisfy ${o.kind}.`}catch(s){d="failed",i=s instanceof Error?s.message:String(s)}return I({schemaVersion:"openpond.harnessTargetedValidationReceipt.v1",id:`validation-${e.proposal.id}-${o.id}`,proposal:{id:e.proposal.id,contentHash:e.proposal.contentHash},validationId:o.id,kind:o.kind,status:d,summary:i,evidenceRefs:e.proposal.evidence,createdAt:r,metadata:{externalState:"harness_memory"}})})}v(q,"validateMemoryProposal");function C(e){let r=e.replaceAll("\\","/"),t=/^memory\/([a-z0-9][a-z0-9-]{0,119})$/.exec(r);if(!t)throw new Error(`Invalid Harness memory target: ${e}.`);return t[1]}v(C,"memoryKeyFromTarget");async function Z(e){let r=await e.store.getHarnessWorkspace(e.workspaceId);if(!r)throw new Error(`Harness workspace ${e.workspaceId} does not exist.`);let t=E(e.storeDir,r.id),o=m.join(t.root,"source-swap.json"),d=await p.readFile(o,"utf8").then(JSON.parse).catch(l=>{if(l.code==="ENOENT")return null;throw l});if(!d)return"none";let i=await g({workspaceId:r.id,sourceDir:t.source});if(r.sourceRevision===d.nextSourceRevision&&i.sourceRevision===d.nextSourceRevision)return await p.rm(d.backupSource,{recursive:!0,force:!0}),await p.rm(o,{force:!0}),"completed";let s=await g({workspaceId:r.id,sourceDir:d.backupSource});if(r.sourceRevision===d.previousSourceRevision&&s.sourceRevision===d.previousSourceRevision)return await b(t.source,d.backupSource),await p.rm(o,{force:!0}),"restored";throw new Error("Harness source-swap recovery cannot reconcile filesystem and workspace revisions.")}v(Z,"recoverLocalHarnessSourceSwap");async function V(e,r){for(let t of r.edits){let o=T(e,t.target);if(t.operation==="delete"){await p.rm(o,{force:!1});continue}if(t.content===null)throw new Error(`Refiner edit ${t.id} has no content.`);if(t.operation==="create")await p.mkdir(m.dirname(o),{recursive:!0}),await p.writeFile(o,t.content,{flag:"wx"});else{let d=await p.lstat(o);if(!d.isFile()||d.isSymbolicLink())throw new Error(`Refiner update target must be a regular file: ${t.target}`);await p.writeFile(o,t.content,{flag:"w"})}}}v(V,"applyOverlayEdits");function T(e,r){let t=m.resolve(e),o=m.resolve(t,...r.replaceAll("\\","/").split("/")),d=m.relative(t,o);if(!d||d.startsWith("..")||m.isAbsolute(d))throw new Error(`Refiner edit target escapes the Harness source: ${r}`);return o}v(T,"containedPath");async function _(e,r){let t=`${e}.${H()}.tmp`;await p.writeFile(t,`${JSON.stringify(r,null,2)}
2
+ import{g as E,m as g,n as j}from"./chunk-JHMS2WXM.js";import{k as P}from"./chunk-6GWOVHIG.js";import{e as A,f as x,g as D,l as I}from"./chunk-DG4TYVPF.js";import{b as W}from"./chunk-L3KS6MOV.js";import{m as $}from"./chunk-BIPQCJ5V.js";import{a as v}from"./chunk-FTQLQJQV.js";import{randomUUID as H}from"node:crypto";import{promises as p}from"node:fs";import{stripTypeScriptTypes as M}from"node:module";import m from"node:path";async function Q(e){let r=A.parse(e.overlay),t=x.parse(e.proposal),o=e.validations.map(h=>D.parse(h));if((t.route==="agent"?t.edits.filter(h=>h.target!=="harness.json"&&h.operation!=="delete"):[]).length>0){let h=t.validationPlan.find(n=>n.kind==="component_activation"&&n.required);if(!h)throw new Error("Desktop Work Agent proposals require component-activation validation before review.");if(o.find(n=>n.validationId===h.id)?.status==="passed")throw new Error("Desktop Work cannot accept a passed Agent activation receipt until an Agent source executor exists.")}if(t.overlay.id!==r.id||t.overlay.revision!==r.revision||t.overlay.contentHash!==r.contentHash)throw new Error("Refiner proposal is not bound to the supplied run overlay.");if(r.status!=="frozen")throw new Error("Only a frozen run overlay can advance a Harness workspace.");let i=await e.store.getHarnessWorkspace(t.expectedWorkspace.workspaceId);if(!i)throw new Error(`Harness workspace ${t.expectedWorkspace.workspaceId} does not exist.`);if(i.location!==e.store.harnessStoragePlacement)throw new Error("Refiner workspace does not match the admitted storage placement.");let s=E(e.storeDir,i.id),l=await g({workspaceId:i.id,sourceDir:s.source});if(l.sourceRevision!==i.sourceRevision)throw new Error(`Harness source is ${l.sourceRevision}; workspace expects ${i.sourceRevision}. Record or revert the source change before refinement.`);let w=m.join(s.root,`.source-candidate-${H()}`);await p.cp(s.source,w,{recursive:!0,force:!1,errorOnExist:!0,verbatimSymlinks:!1});try{await V(w,t);let h=await g({workspaceId:i.id,sourceDir:w}),f=(e.now??(()=>new Date().toISOString()))(),n=await j({storeDir:e.storeDir,workspaceId:i.id,compiled:h,createdAt:f});await e.store.saveHarnessReleaseRecord(n),await e.store.saveHarnessImprovementArtifact(i.id,"run_overlay",r),await e.store.saveHarnessImprovementArtifact(i.id,"proposal",t);for(let a of o)await e.store.saveHarnessImprovementArtifact(i.id,"targeted_validation",a);if(!P({workspace:i,proposal:t}).eligible&&!e.reviewAuthority)return e.store.advanceHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:i.id,proposal:t,validations:o,nextRelease:{id:n.harnessRelease.id,contentHash:n.harnessRelease.contentHash},nextSourceRevision:n.sourceRevision,now:f});let u=m.join(s.root,`.source-backup-${H()}`),c=m.join(s.root,"source-swap.json");await _(c,{schemaVersion:"openpond.localHarnessSourceSwap.v1",workspaceId:i.id,expectedWorkspaceRevision:i.revision,previousSourceRevision:i.sourceRevision,nextSourceRevision:n.sourceRevision,backupSource:u,candidateSource:w,createdAt:f}),await p.rename(s.source,u),await p.rename(w,s.source);try{let a=e.reviewAuthority?await e.store.advanceReviewedHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:i.id,proposal:t,validations:o,nextRelease:{id:n.harnessRelease.id,contentHash:n.harnessRelease.contentHash},nextSourceRevision:n.sourceRevision,reviewer:e.reviewAuthority.reviewer,now:f}):await e.store.advanceHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:i.id,proposal:t,validations:o,nextRelease:{id:n.harnessRelease.id,contentHash:n.harnessRelease.contentHash},nextSourceRevision:n.sourceRevision,now:f});return a.receipt.decision!=="advanced"?await b(s.source,u):await p.rm(u,{recursive:!0,force:!0}),await p.rm(c,{force:!0}),a}catch(a){throw await b(s.source,u).catch(()=>{}),await p.rm(c,{force:!0}).catch(()=>{}),a}}finally{await p.rm(w,{recursive:!0,force:!0}).catch(()=>{})}}v(Q,"applyLocalHarnessRefinerProposal");async function X(e){let r=await e.store.getHarnessWorkspace(e.workspaceId);if(!r||r.location!==e.store.harnessStoragePlacement)throw new Error(`Local Harness workspace ${e.workspaceId} does not exist.`);if(r.currentChannel.release?.id!==e.rollbackOf.id||r.currentChannel.release.contentHash!==e.rollbackOf.contentHash)throw new Error("Harness rollback source is no longer the current release.");let t=await e.store.getHarnessReleaseRecord(e.targetRelease.contentHash);if(!t||t.workspaceId!==r.id||t.harnessRelease.id!==e.targetRelease.id)throw new Error("Harness rollback target is unavailable in this workspace.");let o=E(e.storeDir,r.id);if((await g({workspaceId:r.id,sourceDir:o.source})).sourceRevision!==r.sourceRevision)throw new Error("Harness source changed before rollback.");let i=m.join(o.root,`.source-rollback-${H()}`);await p.cp(m.join(t.bundlePath,"source"),i,{recursive:!0,force:!1,errorOnExist:!0,verbatimSymlinks:!1});try{if((await g({workspaceId:r.id,sourceDir:i})).sourceRevision!==t.sourceRevision)throw new Error("Harness rollback bundle does not reproduce its registered source revision.");let l=(e.now??(()=>new Date().toISOString()))(),w=m.join(o.root,`.source-backup-${H()}`),h=m.join(o.root,"source-swap.json");await _(h,{schemaVersion:"openpond.localHarnessSourceSwap.v1",workspaceId:r.id,expectedWorkspaceRevision:r.revision,previousSourceRevision:r.sourceRevision,nextSourceRevision:t.sourceRevision,backupSource:w,candidateSource:i,createdAt:l}),await p.rename(o.source,w),await p.rename(i,o.source);try{let f=await e.store.rollbackHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:r.id,expectedWorkspaceRevision:r.revision,expectedChannelRevision:r.currentChannel.revision,targetRelease:e.targetRelease,targetSourceRevision:t.sourceRevision,rollbackOf:e.rollbackOf,now:l});return f.receipt.decision!=="rolled_back"?await b(o.source,w):await p.rm(w,{recursive:!0,force:!0}),await p.rm(h,{force:!0}),f}catch(f){throw await b(o.source,w).catch(()=>{}),await p.rm(h,{force:!0}).catch(()=>{}),f}}finally{await p.rm(i,{recursive:!0,force:!0}).catch(()=>{})}}v(X,"rollbackLocalHarnessWorkspaceRelease");async function Y(e){let r=x.parse(e.proposal);if(r.expectedWorkspace.workspaceId!==e.workspace.id)throw new Error("Refiner proposal targets a different Harness workspace.");if(r.route==="memory")return q({proposal:r,now:e.now});let t=E(e.storeDir,e.workspace.id),o=await g({workspaceId:e.workspace.id,sourceDir:t.source});if(o.sourceRevision!==r.expectedWorkspace.sourceRevision)throw new Error("Refiner proposal source revision no longer matches the Local Harness workspace.");let d=m.join(t.root,`.validation-candidate-${H()}`);await p.cp(t.source,d,{recursive:!0,force:!1,errorOnExist:!0,verbatimSymlinks:!1});let i=(e.now??(()=>new Date().toISOString()))();try{await V(d,r);let s=await g({workspaceId:e.workspace.id,sourceDir:d}),l=new Map(s.manifest.files.map(n=>[n.path,n])),w=new Map(r.edits.map(n=>[n.target,n])),h=O(o),f=O(s);return Promise.all(r.validationPlan.map(async n=>{let y="passed",u="The candidate Harness source compiles and preserves its manifest contract.";try{if(n.kind==="observed_recovery"){let c=r.evidence.filter(a=>a.kind==="recovery");if(c.length===0)throw new Error("Observed-recovery validation requires recorded recovery evidence.");u=`Validated ${c.length} immutable recovery evidence reference(s) before candidate advancement.`}else if(n.kind==="prompt"){let c=r.edits.filter(a=>a.route==="prompt"&&a.target!=="harness.json");if(c.length===0)throw new Error("Prompt validation requires an instruction-file edit.");for(let a of c){let k=l.get(a.target);if(a.operation==="delete"){if(k)throw new Error(`Deleted instruction ${a.target} remains declared.`)}else if(k?.kind!=="instruction")throw new Error(`Instruction ${a.target} is not declared in the candidate Harness.`);if(a.content!==null&&/\b(?:api[_-]?key|access[_-]?token|password|secret)\s*[:=]/i.test(a.content))throw new Error(`Instruction ${a.target} appears to contain credential material.`)}u=`Validated ${c.length} textual instruction edit(s) and compiled candidate ${s.harnessRelease.id}.`}else if(n.kind==="skill"){let c=r.edits.filter(a=>a.route==="skill"&&a.target!=="harness.json");if(c.length===0)throw new Error("Skill validation requires a declared Skill-file edit.");for(let a of c){let k=l.get(a.target);if(a.operation==="delete"){if(k)throw new Error(`Deleted Skill ${a.target} remains declared.`);continue}if(k?.kind!=="skill")throw new Error(`Skill ${a.target} is not declared in the candidate Harness.`);let S=w.get(a.target)?.content;if(!S)throw new Error(`Skill edit ${a.target} has no content.`);let R=W(S);if(!R.name||!R.description||R.messages.length>0)throw new Error(`Skill ${a.target} is invalid: ${R.messages.join(" ")}`)}u=`Validated ${c.length} Skill edit(s), Skill frontmatter, and compiled candidate ${s.harnessRelease.id}.`}else if(n.kind==="dependency"){let c=s.manifest.files.find(a=>a.kind==="dependency_lock");if(!c)throw new Error("Candidate Harness has no dependency lock.");JSON.parse(await p.readFile(T(d,c.path),"utf8")),u=`Validated dependency lock ${c.path} and compiled candidate ${s.harnessRelease.id}.`}else if(n.kind==="schema")x.parse(r),u=`Validated proposal, manifest, and candidate release schemas for ${s.harnessRelease.id}.`;else if(n.kind==="package"){let c=r.edits.filter(a=>a.route==="agent"&&a.operation!=="delete"&&a.target!=="harness.json");for(let a of c){if(!a.content)throw new Error(`Agent edit ${a.target} has no source.`);M(a.content,{mode:"transform",sourceUrl:a.target,sourceMap:!1})}u=c.length>0?`Syntax-checked ${c.length} Agent source edit(s) and compiled candidate ${s.harnessRelease.id}.`:`Compiled candidate package ${s.harnessRelease.id} and preserved the Harness source manifest contract.`}else if(n.kind==="component_activation"){let c=r.edits.filter(a=>a.target!=="harness.json");if(c.length===0)throw new Error("Component activation requires a concrete Harness component edit.");if(r.route==="agent"){if(c.filter(k=>k.operation!=="delete").length>0)throw new Error("Desktop Work does not compile or execute released Agent source; use an active instruction or standalone Skill, or add an Agent executor before release.");u=`Confirmed ${c.length} deleted Agent component(s) were inactive in Desktop Work.`}else{if(!["prompt","skill"].includes(r.route))throw new Error(`Desktop Work has no activation policy for ${r.route} proposals.`);let a=r.route==="prompt"?"instruction":"skill";for(let k of c){let S=f.components.find(R=>R.path===k.target&&R.kind===a);if(k.operation==="delete"?S:!S)throw new Error(`${a} ${k.target} is not reflected in the candidate Desktop Work runtime surface.`)}if(h.contentHash===f.contentHash)throw new Error("The candidate does not change the effective Desktop Work runtime surface.");u=`Activated ${c.length} ${a} edit(s) in the candidate Desktop Work runtime surface.`}}else n.kind==="business_formula"?(y="blocked",u="Business or financial logic is retained for review until an approved deterministic fixture supplies inputs and expected outputs."):n.kind==="targeted_evaluation"?(y="blocked",u="This sensitive change requires an explicit authority-preserving targeted Evaluation before release."):n.kind==="file_render"?(y="blocked",u="File-render validation requires an exact produced artifact reference; no artifact was attached to this Harness-source proposal."):(y="blocked",u=`Local targeted validation does not yet own ${n.kind}; it requires its dedicated validator.`)}catch(c){y="failed",u=c instanceof Error?c.message:String(c)}return I({schemaVersion:"openpond.harnessTargetedValidationReceipt.v1",id:`validation-${r.id}-${n.id}`,proposal:{id:r.id,contentHash:r.contentHash},validationId:n.id,kind:n.kind,status:y,summary:u,evidenceRefs:r.evidence,createdAt:i,metadata:{candidateHarnessRelease:{id:s.harnessRelease.id,contentHash:s.harnessRelease.contentHash},sourceRevision:s.sourceRevision,...n.kind==="component_activation"?{targetRuntime:"desktop_work",beforeEffectiveRuntimeHash:h.contentHash,afterEffectiveRuntimeHash:f.contentHash,activatedComponentRefs:f.components,inactiveAgentRefs:f.inactiveAgents}:{}}})}))}catch(s){let l=s instanceof Error?s.message:String(s);return r.validationPlan.map(w=>I({schemaVersion:"openpond.harnessTargetedValidationReceipt.v1",id:`validation-${r.id}-${w.id}`,proposal:{id:r.id,contentHash:r.contentHash},validationId:w.id,kind:w.kind,status:"failed",summary:l,evidenceRefs:r.evidence,createdAt:i,metadata:{}}))}finally{await p.rm(d,{recursive:!0,force:!0}).catch(()=>{})}}v(Y,"validateLocalHarnessRefinerProposal");function O(e){let r=[...e.agentSnapshot.instructions.map(o=>({kind:"instruction",path:o.path,contentHash:o.contentHash})),...e.agentSnapshot.skills.map(o=>({kind:"skill",path:o.path,contentHash:o.contentHash}))].sort((o,d)=>o.path.localeCompare(d.path)),t=e.agentSnapshot.agents.map(o=>({path:o.path,contentHash:o.contentHash})).sort((o,d)=>o.path.localeCompare(d.path));return{contentHash:$({schemaVersion:"openpond.desktopWorkHarnessSurface.v1",components:r}),components:r,inactiveAgents:t}}v(O,"desktopWorkRuntimeSurface");function q(e){let r=(e.now??(()=>new Date().toISOString()))(),t=e.proposal.edits.find(o=>o.route==="memory");return e.proposal.validationPlan.map(o=>{let d="passed",i="Memory candidate is bounded, scoped, and contains no obvious credential material.";try{if(o.kind==="observed_recovery"){if(!e.proposal.evidence.some(s=>s.kind==="recovery"))throw new Error("Observed-recovery validation requires recorded recovery evidence.");i="Memory proposal is grounded in immutable recovery evidence."}else if(o.kind==="memory"){if(!t||!/^memory\/[a-z0-9][a-z0-9-]{0,119}$/.test(t.target))throw new Error("Memory proposal requires one safe memory/<slug> target.");let s=e.proposal.metadata.expectedMemory;if(!s||typeof s!="object"||Array.isArray(s))throw new Error("Memory proposal requires an expected revision snapshot.");let l=s;if(l.key!==C(t.target))throw new Error("Memory proposal expected revision targets a different key.");if(l.revision!==null&&(!Number.isInteger(l.revision)||Number(l.revision)<1))throw new Error("Memory proposal expected revision is invalid.");if(l.contentHash!==null&&typeof l.contentHash!="string")throw new Error("Memory proposal expected content hash is invalid.");if(l.status!==null&&l.status!=="active"&&l.status!=="deleted")throw new Error("Memory proposal expected status is invalid.");if(l.revision===null&&(l.contentHash!==null||l.status!==null))throw new Error("New memory snapshot must not claim existing content or status.");if(l.revision!==null&&(typeof l.contentHash!="string"||l.status===null))throw new Error("Existing memory snapshot requires its content hash and status.");if(t.operation==="delete"&&l.status!=="active")throw new Error("Memory deletion requires an active expected revision.");if(t.operation!=="delete"){if(!t.content?.trim()||t.content.length>24e3)throw new Error("Memory content must contain 1-24,000 characters.");if(/\b(?:api[_-]?key|access[_-]?token|password|secret)\s*[:=]/i.test(t.content))throw new Error("Memory content appears to contain credential material.")}}else d="blocked",i=`Memory validation cannot satisfy ${o.kind}.`}catch(s){d="failed",i=s instanceof Error?s.message:String(s)}return I({schemaVersion:"openpond.harnessTargetedValidationReceipt.v1",id:`validation-${e.proposal.id}-${o.id}`,proposal:{id:e.proposal.id,contentHash:e.proposal.contentHash},validationId:o.id,kind:o.kind,status:d,summary:i,evidenceRefs:e.proposal.evidence,createdAt:r,metadata:{externalState:"harness_memory"}})})}v(q,"validateMemoryProposal");function C(e){let r=e.replaceAll("\\","/"),t=/^memory\/([a-z0-9][a-z0-9-]{0,119})$/.exec(r);if(!t)throw new Error(`Invalid Harness memory target: ${e}.`);return t[1]}v(C,"memoryKeyFromTarget");async function Z(e){let r=await e.store.getHarnessWorkspace(e.workspaceId);if(!r)throw new Error(`Harness workspace ${e.workspaceId} does not exist.`);let t=E(e.storeDir,r.id),o=m.join(t.root,"source-swap.json"),d=await p.readFile(o,"utf8").then(JSON.parse).catch(l=>{if(l.code==="ENOENT")return null;throw l});if(!d)return"none";let i=await g({workspaceId:r.id,sourceDir:t.source});if(r.sourceRevision===d.nextSourceRevision&&i.sourceRevision===d.nextSourceRevision)return await p.rm(d.backupSource,{recursive:!0,force:!0}),await p.rm(o,{force:!0}),"completed";let s=await g({workspaceId:r.id,sourceDir:d.backupSource});if(r.sourceRevision===d.previousSourceRevision&&s.sourceRevision===d.previousSourceRevision)return await b(t.source,d.backupSource),await p.rm(o,{force:!0}),"restored";throw new Error("Harness source-swap recovery cannot reconcile filesystem and workspace revisions.")}v(Z,"recoverLocalHarnessSourceSwap");async function V(e,r){for(let t of r.edits){let o=T(e,t.target);if(t.operation==="delete"){await p.rm(o,{force:!1});continue}if(t.content===null)throw new Error(`Refiner edit ${t.id} has no content.`);if(t.operation==="create")await p.mkdir(m.dirname(o),{recursive:!0}),await p.writeFile(o,t.content,{flag:"wx"});else{let d=await p.lstat(o);if(!d.isFile()||d.isSymbolicLink())throw new Error(`Refiner update target must be a regular file: ${t.target}`);await p.writeFile(o,t.content,{flag:"w"})}}}v(V,"applyOverlayEdits");function T(e,r){let t=m.resolve(e),o=m.resolve(t,...r.replaceAll("\\","/").split("/")),d=m.relative(t,o);if(!d||d.startsWith("..")||m.isAbsolute(d))throw new Error(`Refiner edit target escapes the Harness source: ${r}`);return o}v(T,"containedPath");async function _(e,r){let t=`${e}.${H()}.tmp`;await p.writeFile(t,`${JSON.stringify(r,null,2)}
3
3
  `,{flag:"wx"}),await p.rename(t,e)}v(_,"writeSwapJournal");async function b(e,r){await p.rm(e,{recursive:!0,force:!0}),await p.rename(r,e)}v(b,"restoreSource");export{Q as a,X as b,Y as c,Z as d};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as _}from"./chunk-6FA3GG5B.js";import{b as e}from"./chunk-ES2ISFJC.js";import{a as i}from"./chunk-FTQLQJQV.js";var u=3e3,g=9999,p="openpond.yaml",C="openpond-template-plan.json",w="openpond.sandboxTemplate.buildPlan.v1",q=["google","github","x"],P=new Set([22,2222,2375,2376,3108,5900,5901,6080,7818]),E=e.array(e.string().trim().min(1).max(1e3)).max(50),d=e.string().trim().min(1).max(4096).refine(D,{message:"path must be a relative workspace path"}),$=e.string().trim().min(1).max(500).refine(t=>!t.includes("\0")&&!/\s/.test(t),"image ref must be a single OCI reference"),F=e.string().trim().regex(/^sha256:[0-9a-f]{64}$/i),k=e.string().trim().min(1).max(500).refine(t=>t.startsWith("/")&&!t.includes("\0"),"workspaceRoot must be an absolute guest path"),B=e.object({ref:$,digest:F.optional(),registrySecretRef:e.string().trim().min(1).max(500).optional(),platform:e.literal("linux/amd64").optional(),workspaceRoot:k.optional()}).strict(),Z=e.object({context:d.default("."),path:d.default("Dockerfile"),target:e.string().trim().min(1).max(191).optional(),buildArgs:e.record(e.string().max(191),e.string().max(500)).optional(),registrySecretRefs:e.array(e.string().trim().min(1).max(500)).max(10).optional(),platform:e.literal("linux/amd64").optional(),workspaceRoot:k.optional()}).strict(),V=e.object({base:e.string().trim().min(1).max(120).optional(),snapshot:e.string().trim().min(1).max(191).optional(),image:B.optional(),dockerfile:Z.optional()}).strict().superRefine((t,a)=>{[t.base,t.snapshot,t.image,t.dockerfile].filter(Boolean).length!==1&&a.addIssue({code:e.ZodIssueCode.custom,message:"runtime must declare exactly one of base, snapshot, image, or dockerfile"})}),N=e.object({cpu:e.number().positive().max(8).optional(),memoryGb:e.number().positive().max(32).optional(),diskGb:e.number().positive().max(100).optional()}).strict(),z=e.object({provider:e.enum(q),scopes:e.array(e.string().trim().min(1).max(200)).max(100).default([]),capabilities:e.array(e.string().trim().min(1).max(200)).max(100).default([])}).strict(),U=e.object({models:e.array(e.string().trim().min(1).max(200)).max(100).default([]),scopes:e.array(e.string().trim().min(1).max(200)).max(100).default([])}).strict(),W=e.object({opchat:U.optional()}).catchall(e.record(e.string(),e.unknown())).default({}),X=e.object({name:e.string().trim().regex(/^[A-Za-z_][A-Za-z0-9_-]*$/).max(63).optional(),mountPath:e.string().trim().min(1).max(256).optional(),storageGb:e.number().int().positive().max(100).optional(),deleteOnSandboxDelete:e.boolean().optional()}).strict(),J=e.object({port:e.number().int().min(u).max(g).refine(t=>!P.has(t),{message:"preview port is reserved"}),protocol:e.literal("http").default("http"),label:e.string().trim().min(1).max(80).optional(),access:e.enum(["private","public"]).default("private"),path:e.string().trim().min(1).max(512).refine(t=>t.startsWith("/"),{message:"preview path must start with /"}).default("/")}).strict(),R=e.object({command:e.string().trim().min(1).max(1e3),cwd:d.optional(),timeoutSeconds:e.number().int().positive().max(86400).optional(),requiresStart:e.boolean().default(!1),ports:e.array(J).max(20).default([]),artifactPaths:e.array(d).max(100).default([])}).strict(),I=R.extend({name:e.string().trim().min(1).max(80)}).strict(),H=e.object({name:e.string().trim().min(1).max(80).optional(),service:e.string().trim().min(1).max(80).optional(),port:e.number().int().min(u).max(g).refine(t=>!P.has(t),{message:"app MCP port is reserved"}),path:e.string().trim().min(1).max(512).refine(t=>t.startsWith("/"),{message:"app MCP path must start with /"}).default("/mcp")}).strict(),Y=e.object({name:e.string().trim().min(1).max(80).optional(),port:e.number().int().min(u).max(g).refine(t=>!P.has(t),{message:"validation probe port is reserved"}),path:e.string().trim().min(1).max(512).refine(t=>t.startsWith("/"),{message:"validation probe path must start with /"}).default("/"),expectedStatus:e.number().int().min(100).max(599).default(200)}).strict(),G=e.record(e.string(),e.unknown()).refine(t=>t.type==="object","input schema must be a JSON schema object"),K=e.object({name:e.string().trim().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(191),required:e.boolean().default(!1),secret:e.boolean().default(!0),description:e.string().trim().max(500).optional()}).strict(),h=e.string().trim().min(1).max(120),Q=e.object({name:e.string().trim().min(1).max(120),description:e.string().trim().max(500).optional(),cron:e.string().trim().min(1).max(500).optional(),rate:e.string().trim().min(1).max(500).optional(),once:h.optional(),scheduleType:e.enum(["rate","cron","once"]).optional(),scheduleExpression:e.string().trim().min(1).max(500).optional(),timezone:e.string().trim().min(1).max(100).optional(),enabled:e.boolean().default(!0),startAt:h.optional(),endAt:h.optional(),maxRuns:e.number().int().positive().nullable().optional(),runtimePolicy:e.enum(["run_and_stop","run_and_archive","run_and_delete","use_existing_running"]).default("run_and_stop"),action:e.string().trim().min(1).max(120).optional(),actionName:e.string().trim().min(1).max(120).optional(),command:e.string().trim().min(1).max(2e3).optional(),target:e.object({kind:e.enum(["start","action","service","command"]).optional(),name:e.string().trim().min(1).max(120).optional(),actionName:e.string().trim().min(1).max(120).optional(),command:e.string().trim().min(1).max(2e3).optional(),requiresStart:e.boolean().optional()}).strict().optional(),requiresStart:e.boolean().optional(),budget:e.object({maxUsd:e.string().trim().min(1).max(40).optional()}).strict().optional(),resources:N.optional(),quotas:e.record(e.string(),e.unknown()).optional(),lifecycle:e.record(e.string(),e.unknown()).optional(),retentionPolicy:e.record(e.string(),e.unknown()).optional(),env:e.array(e.object({name:e.string().trim().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(191),value:e.string().optional(),secretRef:e.string().optional()}).strict()).max(100).optional(),integrationLeases:e.array(e.record(e.string(),e.unknown())).max(20).optional(),metadata:e.record(e.string(),e.unknown()).optional()}).strict().superRefine((t,a)=>{[t.cron,t.rate,t.once,t.scheduleExpression].filter(l=>typeof l=="string"&&l.trim()).length!==1&&a.addIssue({code:e.ZodIssueCode.custom,path:["scheduleExpression"],message:"schedule must declare exactly one of cron, rate, once, or scheduleExpression"}),t.scheduleExpression&&!t.scheduleType&&a.addIssue({code:e.ZodIssueCode.custom,path:["scheduleType"],message:"scheduleType is required with scheduleExpression"});let r=t.command??t.target?.command??null,o=t.target?.name??null,s=t.actionName??t.action??t.target?.actionName??(t.target?.kind==="action"?o:null),m=t.target?.kind??(r?"command":"action");m==="action"&&!s&&a.addIssue({code:e.ZodIssueCode.custom,path:["action"],message:"schedule action target is required"}),m==="service"&&!o&&a.addIssue({code:e.ZodIssueCode.custom,path:["target","name"],message:"schedule service target name is required"}),m==="command"&&!r&&a.addIssue({code:e.ZodIssueCode.custom,path:["command"],message:"schedule command target is required"})}),b=e.object({schemaVersion:e.literal(1),name:e.string().trim().min(1).max(80).regex(/^[a-z0-9][a-z0-9-]*[a-z0-9]$/),version:e.string().trim().min(1).max(40),useCase:e.string().trim().min(1).max(80),description:e.string().trim().min(1).max(500),runtime:V,resources:N.optional(),setup:e.object({commands:E.default([])}).strict().default({commands:[]}),validation:e.object({commands:E.min(1),probes:e.array(Y).max(20).default([])}).strict(),start:R,actions:e.array(I).max(20).default([]),services:e.array(I).max(20).default([]),schedules:e.array(Q).max(20).default([]),mcp:e.object({endpoints:e.array(H).max(10).default([])}).strict().default({endpoints:[]}),volumes:e.array(X).max(5).default([]),integrations:e.object({requiredLeases:e.array(z).max(20).default([])}).strict().default({requiredLeases:[]}),permissions:W,inputs:e.object({schema:G.default({type:"object"}),env:e.array(K).max(100).default([])}).strict().default({schema:{type:"object"},env:[]}),artifacts:e.object({paths:e.array(d).max(100).default([])}).strict().default({paths:[]}),network:e.object({egress:e.enum(["restricted","allow","block"]).default("restricted")}).strict().default({egress:"restricted"})}).strict().superRefine((t,a)=>{se(t,a),j(a,t.volumes.flatMap(n=>n.name?[n.name]:[]),"volume names must be unique","volumes"),re(t,a),ie(t,a),le(t,a),me(t,a)}),y=e.object({path:e.string(),message:e.string(),code:e.string()});function ee(t){let a;try{a=_.load(t)}catch(n){return{ok:!1,manifest:null,diagnostics:[{path:"$",code:"invalid_yaml",message:n instanceof Error?n.message:"Invalid YAML"}]}}return M(a)}i(ee,"validateSandboxTemplateYaml");function M(t){if(!t||typeof t!="object"||Array.isArray(t))return{ok:!1,manifest:null,diagnostics:[{path:"$",code:"invalid_type",message:`${p} must be an object`}]};if(Object.prototype.hasOwnProperty.call(t,"databases"))return{ok:!1,manifest:null,diagnostics:[{path:"$.databases",code:"database_resources_removed",message:"managed database requests are unsupported for Firecracker sandbox templates; use a durable volume with SQLite or files instead"}]};let a=b.safeParse(t);return a.success?{ok:!0,manifest:a.data,diagnostics:[]}:{ok:!1,manifest:null,diagnostics:a.error.issues.map(n=>({path:oe(n.path),code:n.code,message:n.message}))}}i(M,"validateSandboxTemplateManifest");function te(t){return t.map(a=>`${a.path}: ${a.message}`).join(`
2
+ import{a as _}from"./chunk-6FA3GG5B.js";import{A as e}from"./chunk-PF56N7ZY.js";import{a as i}from"./chunk-FTQLQJQV.js";var u=3e3,g=9999,p="openpond.yaml",C="openpond-template-plan.json",w="openpond.sandboxTemplate.buildPlan.v1",q=["google","github","x"],P=new Set([22,2222,2375,2376,3108,5900,5901,6080,7818]),E=e.array(e.string().trim().min(1).max(1e3)).max(50),d=e.string().trim().min(1).max(4096).refine(D,{message:"path must be a relative workspace path"}),$=e.string().trim().min(1).max(500).refine(t=>!t.includes("\0")&&!/\s/.test(t),"image ref must be a single OCI reference"),F=e.string().trim().regex(/^sha256:[0-9a-f]{64}$/i),k=e.string().trim().min(1).max(500).refine(t=>t.startsWith("/")&&!t.includes("\0"),"workspaceRoot must be an absolute guest path"),B=e.object({ref:$,digest:F.optional(),registrySecretRef:e.string().trim().min(1).max(500).optional(),platform:e.literal("linux/amd64").optional(),workspaceRoot:k.optional()}).strict(),Z=e.object({context:d.default("."),path:d.default("Dockerfile"),target:e.string().trim().min(1).max(191).optional(),buildArgs:e.record(e.string().max(191),e.string().max(500)).optional(),registrySecretRefs:e.array(e.string().trim().min(1).max(500)).max(10).optional(),platform:e.literal("linux/amd64").optional(),workspaceRoot:k.optional()}).strict(),V=e.object({base:e.string().trim().min(1).max(120).optional(),snapshot:e.string().trim().min(1).max(191).optional(),image:B.optional(),dockerfile:Z.optional()}).strict().superRefine((t,a)=>{[t.base,t.snapshot,t.image,t.dockerfile].filter(Boolean).length!==1&&a.addIssue({code:e.ZodIssueCode.custom,message:"runtime must declare exactly one of base, snapshot, image, or dockerfile"})}),N=e.object({cpu:e.number().positive().max(8).optional(),memoryGb:e.number().positive().max(32).optional(),diskGb:e.number().positive().max(100).optional()}).strict(),z=e.object({provider:e.enum(q),scopes:e.array(e.string().trim().min(1).max(200)).max(100).default([]),capabilities:e.array(e.string().trim().min(1).max(200)).max(100).default([])}).strict(),U=e.object({models:e.array(e.string().trim().min(1).max(200)).max(100).default([]),scopes:e.array(e.string().trim().min(1).max(200)).max(100).default([])}).strict(),W=e.object({opchat:U.optional()}).catchall(e.record(e.string(),e.unknown())).default({}),X=e.object({name:e.string().trim().regex(/^[A-Za-z_][A-Za-z0-9_-]*$/).max(63).optional(),mountPath:e.string().trim().min(1).max(256).optional(),storageGb:e.number().int().positive().max(100).optional(),deleteOnSandboxDelete:e.boolean().optional()}).strict(),J=e.object({port:e.number().int().min(u).max(g).refine(t=>!P.has(t),{message:"preview port is reserved"}),protocol:e.literal("http").default("http"),label:e.string().trim().min(1).max(80).optional(),access:e.enum(["private","public"]).default("private"),path:e.string().trim().min(1).max(512).refine(t=>t.startsWith("/"),{message:"preview path must start with /"}).default("/")}).strict(),R=e.object({command:e.string().trim().min(1).max(1e3),cwd:d.optional(),timeoutSeconds:e.number().int().positive().max(86400).optional(),requiresStart:e.boolean().default(!1),ports:e.array(J).max(20).default([]),artifactPaths:e.array(d).max(100).default([])}).strict(),I=R.extend({name:e.string().trim().min(1).max(80)}).strict(),H=e.object({name:e.string().trim().min(1).max(80).optional(),service:e.string().trim().min(1).max(80).optional(),port:e.number().int().min(u).max(g).refine(t=>!P.has(t),{message:"app MCP port is reserved"}),path:e.string().trim().min(1).max(512).refine(t=>t.startsWith("/"),{message:"app MCP path must start with /"}).default("/mcp")}).strict(),Y=e.object({name:e.string().trim().min(1).max(80).optional(),port:e.number().int().min(u).max(g).refine(t=>!P.has(t),{message:"validation probe port is reserved"}),path:e.string().trim().min(1).max(512).refine(t=>t.startsWith("/"),{message:"validation probe path must start with /"}).default("/"),expectedStatus:e.number().int().min(100).max(599).default(200)}).strict(),G=e.record(e.string(),e.unknown()).refine(t=>t.type==="object","input schema must be a JSON schema object"),K=e.object({name:e.string().trim().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(191),required:e.boolean().default(!1),secret:e.boolean().default(!0),description:e.string().trim().max(500).optional()}).strict(),h=e.string().trim().min(1).max(120),Q=e.object({name:e.string().trim().min(1).max(120),description:e.string().trim().max(500).optional(),cron:e.string().trim().min(1).max(500).optional(),rate:e.string().trim().min(1).max(500).optional(),once:h.optional(),scheduleType:e.enum(["rate","cron","once"]).optional(),scheduleExpression:e.string().trim().min(1).max(500).optional(),timezone:e.string().trim().min(1).max(100).optional(),enabled:e.boolean().default(!0),startAt:h.optional(),endAt:h.optional(),maxRuns:e.number().int().positive().nullable().optional(),runtimePolicy:e.enum(["run_and_stop","run_and_archive","run_and_delete","use_existing_running"]).default("run_and_stop"),action:e.string().trim().min(1).max(120).optional(),actionName:e.string().trim().min(1).max(120).optional(),command:e.string().trim().min(1).max(2e3).optional(),target:e.object({kind:e.enum(["start","action","service","command"]).optional(),name:e.string().trim().min(1).max(120).optional(),actionName:e.string().trim().min(1).max(120).optional(),command:e.string().trim().min(1).max(2e3).optional(),requiresStart:e.boolean().optional()}).strict().optional(),requiresStart:e.boolean().optional(),budget:e.object({maxUsd:e.string().trim().min(1).max(40).optional()}).strict().optional(),resources:N.optional(),quotas:e.record(e.string(),e.unknown()).optional(),lifecycle:e.record(e.string(),e.unknown()).optional(),retentionPolicy:e.record(e.string(),e.unknown()).optional(),env:e.array(e.object({name:e.string().trim().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(191),value:e.string().optional(),secretRef:e.string().optional()}).strict()).max(100).optional(),integrationLeases:e.array(e.record(e.string(),e.unknown())).max(20).optional(),metadata:e.record(e.string(),e.unknown()).optional()}).strict().superRefine((t,a)=>{[t.cron,t.rate,t.once,t.scheduleExpression].filter(l=>typeof l=="string"&&l.trim()).length!==1&&a.addIssue({code:e.ZodIssueCode.custom,path:["scheduleExpression"],message:"schedule must declare exactly one of cron, rate, once, or scheduleExpression"}),t.scheduleExpression&&!t.scheduleType&&a.addIssue({code:e.ZodIssueCode.custom,path:["scheduleType"],message:"scheduleType is required with scheduleExpression"});let r=t.command??t.target?.command??null,o=t.target?.name??null,s=t.actionName??t.action??t.target?.actionName??(t.target?.kind==="action"?o:null),m=t.target?.kind??(r?"command":"action");m==="action"&&!s&&a.addIssue({code:e.ZodIssueCode.custom,path:["action"],message:"schedule action target is required"}),m==="service"&&!o&&a.addIssue({code:e.ZodIssueCode.custom,path:["target","name"],message:"schedule service target name is required"}),m==="command"&&!r&&a.addIssue({code:e.ZodIssueCode.custom,path:["command"],message:"schedule command target is required"})}),b=e.object({schemaVersion:e.literal(1),name:e.string().trim().min(1).max(80).regex(/^[a-z0-9][a-z0-9-]*[a-z0-9]$/),version:e.string().trim().min(1).max(40),useCase:e.string().trim().min(1).max(80),description:e.string().trim().min(1).max(500),runtime:V,resources:N.optional(),setup:e.object({commands:E.default([])}).strict().default({commands:[]}),validation:e.object({commands:E.min(1),probes:e.array(Y).max(20).default([])}).strict(),start:R,actions:e.array(I).max(20).default([]),services:e.array(I).max(20).default([]),schedules:e.array(Q).max(20).default([]),mcp:e.object({endpoints:e.array(H).max(10).default([])}).strict().default({endpoints:[]}),volumes:e.array(X).max(5).default([]),integrations:e.object({requiredLeases:e.array(z).max(20).default([])}).strict().default({requiredLeases:[]}),permissions:W,inputs:e.object({schema:G.default({type:"object"}),env:e.array(K).max(100).default([])}).strict().default({schema:{type:"object"},env:[]}),artifacts:e.object({paths:e.array(d).max(100).default([])}).strict().default({paths:[]}),network:e.object({egress:e.enum(["restricted","allow","block"]).default("restricted")}).strict().default({egress:"restricted"})}).strict().superRefine((t,a)=>{se(t,a),j(a,t.volumes.flatMap(n=>n.name?[n.name]:[]),"volume names must be unique","volumes"),re(t,a),ie(t,a),le(t,a),me(t,a)}),y=e.object({path:e.string(),message:e.string(),code:e.string()});function ee(t){let a;try{a=_.load(t)}catch(n){return{ok:!1,manifest:null,diagnostics:[{path:"$",code:"invalid_yaml",message:n instanceof Error?n.message:"Invalid YAML"}]}}return M(a)}i(ee,"validateSandboxTemplateYaml");function M(t){if(!t||typeof t!="object"||Array.isArray(t))return{ok:!1,manifest:null,diagnostics:[{path:"$",code:"invalid_type",message:`${p} must be an object`}]};if(Object.prototype.hasOwnProperty.call(t,"databases"))return{ok:!1,manifest:null,diagnostics:[{path:"$.databases",code:"database_resources_removed",message:"managed database requests are unsupported for Firecracker sandbox templates; use a durable volume with SQLite or files instead"}]};let a=b.safeParse(t);return a.success?{ok:!0,manifest:a.data,diagnostics:[]}:{ok:!1,manifest:null,diagnostics:a.error.issues.map(n=>({path:oe(n.path),code:n.code,message:n.message}))}}i(M,"validateSandboxTemplateManifest");function te(t){return t.map(a=>`${a.path}: ${a.message}`).join(`
3
3
  `)}i(te,"formatSandboxTemplateDiagnostics");function v(t){return[{kind:"start",name:"start",...t.start,artifactPaths:S(t.start,t)},...t.actions.map(a=>({kind:"action",name:a.name,command:a.command,cwd:a.cwd,timeoutSeconds:a.timeoutSeconds,requiresStart:a.requiresStart,ports:a.ports,artifactPaths:S(a,t)})),...t.services.map(a=>({kind:"service",name:a.name,command:a.command,cwd:a.cwd,timeoutSeconds:a.timeoutSeconds,requiresStart:a.requiresStart,ports:a.ports,artifactPaths:S(a,t)}))]}i(v,"sandboxTemplateExecutableEntries");function O(t){let a=v(t);return{template:{name:t.name,version:t.version,useCase:t.useCase,runtime:t.runtime},resources:t.resources??null,volumes:t.volumes,executables:a.map(n=>({kind:n.kind,name:n.name,command:n.command,cwd:n.cwd??null,timeoutSeconds:n.timeoutSeconds??null,requiresStart:n.requiresStart,ports:n.ports.map(r=>r.port),artifactPaths:n.artifactPaths})),ports:a.flatMap(n=>n.ports.map(r=>({executable:n.name,kind:n.kind,port:r.port,access:r.access,label:r.label??null}))),appMcpEndpoints:t.mcp.endpoints.map(n=>({name:n.name??null,service:n.service??null,port:n.port,path:n.path})),validation:{commands:t.validation.commands,probes:t.validation.probes},schedules:t.schedules}}i(O,"sandboxTemplateBuildMetadata");function ae(t){return{kind:w,schemaVersion:1,manifestFile:t.manifestFile,projectRoot:t.projectRoot,manifest:t.manifest,metadata:O(t.manifest),executables:v(t.manifest)}}i(ae,"sandboxTemplateBuildPlan");function ne(t){let a=t.name.trim()||"Sandbox Template",n=ce(a),r=t.description?.trim()||`Local scaffold for ${a}.`;return{".gitignore":["node_modules","artifacts",".DS_Store",""].join(`
4
4
  `),"README.md":[`# ${a}`,"","Local sandbox template scaffold.","","## Commands","","- `pnpm dev` starts the preview service on port 3000.","- `pnpm process` writes a sample artifact.",`- \`pnpm validate\` validates ${p}.`,""].join(`
5
5
  `),"package.json":`${JSON.stringify({private:!0,type:"module",scripts:{dev:"node src/server.ts",process:"node scripts/process.ts",validate:`openpond sandbox-template validate --file ${p}`}},null,2)}