openpond 0.2.63 → 0.2.64

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 (561) hide show
  1. package/dist/app-server.d.ts +76 -2
  2. package/dist/app-server.js +1 -1
  3. package/dist/chunks/account-context-TIJOM22A.js +12 -0
  4. package/dist/chunks/acp-G5GCLP44.js +2 -0
  5. package/dist/chunks/acp-agent-JM5THNMF.js +19 -0
  6. package/dist/chunks/actions-command-VLKMHCMI.js +2 -0
  7. package/dist/chunks/app-layer-DZHMJUBC.js +3 -0
  8. package/dist/chunks/app-server-connected-apps-IB6M35NS.js +2 -0
  9. package/dist/chunks/app-server-evaluations-V6LRWDUF.js +2 -0
  10. package/dist/chunks/app-server-harness-services-6ZRLA3YD.js +2 -0
  11. package/dist/chunks/app-server-runtime-6LCX46RF.js +2 -0
  12. package/dist/chunks/apps-7LPKIYRY.js +2 -0
  13. package/dist/chunks/{chunk-NZTCH6K5.js → chunk-2GJD23CM.js} +1 -1
  14. package/dist/chunks/{chunk-BKEDG3A4.js → chunk-2MEOUS24.js} +1 -1
  15. package/dist/chunks/{chunk-DUL6DXOI.js → chunk-2W22IXHB.js} +1 -1
  16. package/dist/chunks/{chunk-GGJUWIGR.js → chunk-36FNNR5N.js} +1 -1
  17. package/dist/chunks/chunk-3BJ7LPE3.js +2 -0
  18. package/dist/chunks/chunk-3MVKXAH7.js +2 -0
  19. package/dist/chunks/{chunk-UTNGEMW5.js → chunk-3WJQ4IGK.js} +1 -1
  20. package/dist/chunks/{chunk-G6OR5NB6.js → chunk-4D3CICBG.js} +1 -1
  21. package/dist/chunks/chunk-4DYWVGVS.js +2 -0
  22. package/dist/chunks/{chunk-KUPJNBWG.js → chunk-4JYTFEND.js} +1 -1
  23. package/dist/chunks/chunk-4MQHIFZL.js +2 -0
  24. package/dist/chunks/chunk-4TO743HO.js +4 -0
  25. package/dist/chunks/{chunk-B4RKHHF7.js → chunk-4TTXNVCE.js} +1 -1
  26. package/dist/chunks/{chunk-3YXYBYWK.js → chunk-4V73I4OL.js} +1 -1
  27. package/dist/chunks/chunk-55Q64WWF.js +2 -0
  28. package/dist/chunks/{chunk-F7QTIHXX.js → chunk-5AU5Y6KS.js} +1 -1
  29. package/dist/chunks/chunk-5HPZGLOL.js +2 -0
  30. package/dist/chunks/{chunk-LCSBCCYC.js → chunk-5JVJQA5H.js} +1 -1
  31. package/dist/chunks/chunk-5KJMFK65.js +2 -0
  32. package/dist/chunks/{chunk-BSPFY3Y5.js → chunk-5KWKSR4P.js} +1 -1
  33. package/dist/chunks/chunk-5WPMI6QX.js +2 -0
  34. package/dist/chunks/{chunk-SHJY5RLU.js → chunk-5Z3AU5CL.js} +1 -1
  35. package/dist/chunks/{chunk-DQI5TE6A.js → chunk-66HFW4OU.js} +1 -1
  36. package/dist/chunks/{chunk-NT7N6KLE.js → chunk-67HXM6AL.js} +1 -1
  37. package/dist/chunks/{chunk-J7ZTPXRQ.js → chunk-6C3CXME7.js} +1 -1
  38. package/dist/chunks/{chunk-PWK5Z5S3.js → chunk-6ESBAHWK.js} +1 -1
  39. package/dist/chunks/{chunk-XNOMIWEY.js → chunk-6I5AUTVO.js} +1 -1
  40. package/dist/chunks/{chunk-OG33QAG6.js → chunk-6S2MWJVD.js} +1 -1
  41. package/dist/chunks/{chunk-KCOTDUGW.js → chunk-6TRVEA3T.js} +1 -1
  42. package/dist/chunks/chunk-6ZTP6CUJ.js +2 -0
  43. package/dist/chunks/{chunk-4L6DU6Z2.js → chunk-7FBWUVX7.js} +1 -1
  44. package/dist/chunks/{chunk-GPL2Z65R.js → chunk-7P5SH3CI.js} +2 -2
  45. package/dist/chunks/chunk-7PKTCMZ6.js +2 -0
  46. package/dist/chunks/chunk-7XOUM6RK.js +2 -0
  47. package/dist/chunks/chunk-A77DLBR4.js +2 -0
  48. package/dist/chunks/chunk-AF3AVDPP.js +2 -0
  49. package/dist/chunks/{chunk-RV7PUSI2.js → chunk-AJXWJLZA.js} +1 -1
  50. package/dist/chunks/chunk-AMC4Z7G4.js +2 -0
  51. package/dist/chunks/chunk-ANG2YMMD.js +2 -0
  52. package/dist/chunks/{chunk-ZPTKR3GB.js → chunk-B32CW3NT.js} +1 -1
  53. package/dist/chunks/{chunk-Y766IN7Y.js → chunk-B666Z2NS.js} +1 -1
  54. package/dist/chunks/chunk-BJXPQIVD.js +2 -0
  55. package/dist/chunks/{chunk-WBUK73ST.js → chunk-BL3CZWWD.js} +1 -1
  56. package/dist/chunks/{chunk-XMHIQ3SK.js → chunk-BTJACFU3.js} +2 -2
  57. package/dist/chunks/{chunk-25XXZS3E.js → chunk-C5B3FMV3.js} +1 -1
  58. package/dist/chunks/chunk-CRDKBFRN.js +2 -0
  59. package/dist/chunks/chunk-CYQLXS2U.js +2 -0
  60. package/dist/chunks/{chunk-N4VHLJBZ.js → chunk-D7R2AAX2.js} +1 -1
  61. package/dist/chunks/{chunk-LSZJ5M3X.js → chunk-DAEUVT2I.js} +1 -1
  62. package/dist/chunks/{chunk-ELX7VRSU.js → chunk-DIDQHTAX.js} +1 -1
  63. package/dist/chunks/chunk-DMO3UIS7.js +6 -0
  64. package/dist/chunks/{chunk-4BJGUCHY.js → chunk-DRMOHADV.js} +1 -1
  65. package/dist/chunks/{chunk-FYYYECHE.js → chunk-DSJZS77R.js} +4 -4
  66. package/dist/chunks/{chunk-7HRLWPPZ.js → chunk-DXA2UHBE.js} +1 -1
  67. package/dist/chunks/{chunk-T6JN4PND.js → chunk-EBOTNBUS.js} +1 -1
  68. package/dist/chunks/chunk-ECOH24MC.js +9 -0
  69. package/dist/chunks/{chunk-6PKXJEJM.js → chunk-EICS777E.js} +1 -1
  70. package/dist/chunks/{chunk-4SZ3HKHU.js → chunk-EVQISX7M.js} +1 -1
  71. package/dist/chunks/{chunk-2HAWOMZK.js → chunk-EW7CD7OA.js} +1 -1
  72. package/dist/chunks/chunk-FEQ7HNJR.js +2 -0
  73. package/dist/chunks/{chunk-IWWXIUAQ.js → chunk-FHLSLOKH.js} +8 -8
  74. package/dist/chunks/{chunk-BU27SLZP.js → chunk-FS2VKOT7.js} +1 -1
  75. package/dist/chunks/{chunk-4FNCBA3Y.js → chunk-FUFI4THX.js} +1 -1
  76. package/dist/chunks/{chunk-W5W4IODW.js → chunk-FYWQWKVS.js} +1 -1
  77. package/dist/chunks/{chunk-IZ56L2ZK.js → chunk-G4747MOW.js} +1 -1
  78. package/dist/chunks/{chunk-J572ANHX.js → chunk-G4E3WGLM.js} +4 -4
  79. package/dist/chunks/{chunk-P7HRF4FM.js → chunk-GD3RCUDH.js} +1 -1
  80. package/dist/chunks/{chunk-HUCBKXTU.js → chunk-GDJ4X2ZN.js} +1 -1
  81. package/dist/chunks/{chunk-JHR3LF2F.js → chunk-GF55VEMR.js} +1 -1
  82. package/dist/chunks/{chunk-GXCUH2VV.js → chunk-GFAI2MCJ.js} +3 -3
  83. package/dist/chunks/{chunk-KOKX7PBS.js → chunk-GI7LTJV3.js} +1 -1
  84. package/dist/chunks/{chunk-TCOTXCV6.js → chunk-GIU3Z45P.js} +1 -1
  85. package/dist/chunks/chunk-GKLZQN6P.js +161 -0
  86. package/dist/chunks/{chunk-GXZCMO6S.js → chunk-GRLQHYAU.js} +2 -2
  87. package/dist/chunks/{chunk-M3SCON53.js → chunk-GUG2SWRZ.js} +1 -1
  88. package/dist/chunks/{chunk-JQRMDFF3.js → chunk-H42UW6IF.js} +1 -1
  89. package/dist/chunks/{chunk-EZRUWIP6.js → chunk-H5ML7735.js} +1 -1
  90. package/dist/chunks/{chunk-VNJAAYNQ.js → chunk-HIQPGYVH.js} +1 -1
  91. package/dist/chunks/{chunk-DLANLLKH.js → chunk-HNDAGZCF.js} +1 -1
  92. package/dist/chunks/{chunk-OE22TAXP.js → chunk-HNQPEOJD.js} +1 -1
  93. package/dist/chunks/chunk-HORMGT2Q.js +2 -0
  94. package/dist/chunks/{chunk-2V4LPUBH.js → chunk-HPTEJBP4.js} +1 -1
  95. package/dist/chunks/{chunk-R6VJDOQM.js → chunk-HQQJKWZY.js} +4 -4
  96. package/dist/chunks/{chunk-UWHIU24L.js → chunk-HVM2GUM3.js} +1 -1
  97. package/dist/chunks/{chunk-NEJLJ2XY.js → chunk-HX6GXMDK.js} +1 -1
  98. package/dist/chunks/chunk-I3NYYOSS.js +2 -0
  99. package/dist/chunks/{chunk-LV3CQ72P.js → chunk-I6VMRQF4.js} +1 -1
  100. package/dist/chunks/{chunk-QU4UE73E.js → chunk-IEVJLG3V.js} +1 -1
  101. package/dist/chunks/chunk-IOSBGCRT.js +2 -0
  102. package/dist/chunks/{chunk-SO42ZB5K.js → chunk-JBFPTEVE.js} +1 -1
  103. package/dist/chunks/{chunk-G32BO6M5.js → chunk-JD76ANPN.js} +1 -1
  104. package/dist/chunks/{chunk-ERJV5BMC.js → chunk-JFZ6USNQ.js} +1 -1
  105. package/dist/chunks/{chunk-UPWJSNL5.js → chunk-JLW5BQVO.js} +1 -1
  106. package/dist/chunks/chunk-JRGECNP3.js +2 -0
  107. package/dist/chunks/{chunk-DABBHWSF.js → chunk-KAWXVMHI.js} +1 -1
  108. package/dist/chunks/chunk-KGUPAPGR.js +2 -0
  109. package/dist/chunks/{chunk-AHOBCBVZ.js → chunk-KOKBDIGR.js} +1 -1
  110. package/dist/chunks/chunk-KTIBXRWQ.js +2 -0
  111. package/dist/chunks/chunk-L4EJ5R3B.js +23 -0
  112. package/dist/chunks/{chunk-SI5W5LBV.js → chunk-LARJARMS.js} +1 -1
  113. package/dist/chunks/{chunk-MPNJ2BB4.js → chunk-LE75SVEL.js} +1 -1
  114. package/dist/chunks/{chunk-ERT32RZA.js → chunk-LI3FTPAH.js} +5 -5
  115. package/dist/chunks/chunk-LK77GI6M.js +2 -0
  116. package/dist/chunks/chunk-LOIYNRBC.js +33 -0
  117. package/dist/chunks/{chunk-7WYL2IDD.js → chunk-LXZLLTYQ.js} +1 -1
  118. package/dist/chunks/{chunk-RZUCVF2Q.js → chunk-LYVHYT3L.js} +1 -1
  119. package/dist/chunks/{chunk-MWXW2CA6.js → chunk-LZPCA6DH.js} +1 -1
  120. package/dist/chunks/{chunk-GVARQXYI.js → chunk-M5QPL5NO.js} +1 -1
  121. package/dist/chunks/{chunk-WWQNMC7C.js → chunk-MCBRB5D6.js} +1 -1
  122. package/dist/chunks/chunk-MHPCVQOE.js +2 -0
  123. package/dist/chunks/chunk-MMJU6PZV.js +2 -0
  124. package/dist/chunks/chunk-MVPKU72J.js +4 -0
  125. package/dist/chunks/{chunk-AGVOGPAZ.js → chunk-MWS2NAHJ.js} +1 -1
  126. package/dist/chunks/{chunk-R6WMY6AH.js → chunk-NTM3KQ25.js} +1 -1
  127. package/dist/chunks/chunk-NXN7GJOH.js +2 -0
  128. package/dist/chunks/chunk-O6ZYDHEJ.js +3 -0
  129. package/dist/chunks/chunk-OKEC2EIE.js +2 -0
  130. package/dist/chunks/{chunk-KCV5VN4X.js → chunk-OKKNDQJF.js} +1 -1
  131. package/dist/chunks/{chunk-ZYVHOVKL.js → chunk-OPTJYDZN.js} +1 -1
  132. package/dist/chunks/{chunk-NJLULBTM.js → chunk-OTDDXEQ6.js} +1 -1
  133. package/dist/chunks/{chunk-RDSVU6F6.js → chunk-OTUS7NTQ.js} +1 -1
  134. package/dist/chunks/{chunk-UH4JSSRL.js → chunk-OTXGAKFH.js} +8 -8
  135. package/dist/chunks/chunk-OW3EOC5Q.js +4 -0
  136. package/dist/chunks/chunk-OXRVILDW.js +2 -0
  137. package/dist/chunks/{chunk-JEISPWWM.js → chunk-PWKJ5KLZ.js} +1 -1
  138. package/dist/chunks/{chunk-RFMME46Z.js → chunk-PYNW5OFA.js} +1 -1
  139. package/dist/chunks/{chunk-AKGCM53D.js → chunk-Q3WXB465.js} +1 -1
  140. package/dist/chunks/{chunk-KHTAAVC2.js → chunk-Q4AXZY2P.js} +1 -1
  141. package/dist/chunks/{chunk-QJ6KUVAR.js → chunk-QAEZNFAM.js} +1 -1
  142. package/dist/chunks/{chunk-ABF3W2MO.js → chunk-QAFXQHHG.js} +2 -2
  143. package/dist/chunks/chunk-QCJY6FTC.js +3 -0
  144. package/dist/chunks/{chunk-5MHYGMJG.js → chunk-QJJNHKLT.js} +1 -1
  145. package/dist/chunks/{chunk-ERL2M773.js → chunk-QYQZQVVN.js} +1 -1
  146. package/dist/chunks/{chunk-VVNV4NNW.js → chunk-RCT3O3HQ.js} +1 -1
  147. package/dist/chunks/{chunk-7R56WC7L.js → chunk-RHMULF56.js} +1 -1
  148. package/dist/chunks/chunk-RRWL5BHZ.js +2 -0
  149. package/dist/chunks/{chunk-RG3NH6YQ.js → chunk-S4WILIRA.js} +1 -1
  150. package/dist/chunks/{chunk-N33D7KCW.js → chunk-S6UCVXBC.js} +1 -1
  151. package/dist/chunks/{chunk-IHB5GTOJ.js → chunk-SAZTOGX6.js} +3 -3
  152. package/dist/chunks/{chunk-2EPR4HLF.js → chunk-SH7POUVX.js} +6 -6
  153. package/dist/chunks/chunk-SQX22LQT.js +10 -0
  154. package/dist/chunks/{chunk-NLYZ5K7U.js → chunk-SSJV3VX7.js} +1 -1
  155. package/dist/chunks/chunk-TBODQT4W.js +2 -0
  156. package/dist/chunks/chunk-TGULVWPV.js +2 -0
  157. package/dist/chunks/{chunk-HIYQPZ7C.js → chunk-TPOAAJKA.js} +1 -1
  158. package/dist/chunks/{chunk-42V4NV2F.js → chunk-TVDZXDQW.js} +1 -1
  159. package/dist/chunks/{chunk-FVRII5XO.js → chunk-U2BD545L.js} +1 -1
  160. package/dist/chunks/chunk-UK5LGSGT.js +2 -0
  161. package/dist/chunks/{chunk-HFJUXKT5.js → chunk-ULJZ7NUF.js} +1 -1
  162. package/dist/chunks/chunk-UN2LKLGV.js +2 -0
  163. package/dist/chunks/{chunk-4NXEYPPX.js → chunk-UOFDKMRU.js} +1 -1
  164. package/dist/chunks/{chunk-2ITZW2CN.js → chunk-UTIELP6F.js} +1 -1
  165. package/dist/chunks/{chunk-NWQL6FNF.js → chunk-V3KEG6MI.js} +1 -1
  166. package/dist/chunks/{chunk-BPZOABMC.js → chunk-V3S2B6WU.js} +2 -2
  167. package/dist/chunks/{chunk-ZG6353RM.js → chunk-VD2TQCMH.js} +1 -1
  168. package/dist/chunks/{chunk-4ZBOYWQ3.js → chunk-VS2LOUCT.js} +1 -1
  169. package/dist/chunks/{chunk-V7KR74NO.js → chunk-VS3AMJEK.js} +1 -1
  170. package/dist/chunks/{chunk-YCZZ62C2.js → chunk-W22KWKF6.js} +1 -1
  171. package/dist/chunks/chunk-W7NXFRHN.js +2 -0
  172. package/dist/chunks/{chunk-DTTFUANI.js → chunk-WBO6FQHR.js} +2 -2
  173. package/dist/chunks/{chunk-5ZBLCWEJ.js → chunk-WJSJXK2N.js} +1 -1
  174. package/dist/chunks/{chunk-C2LAEGOW.js → chunk-WKHGXLJD.js} +2 -2
  175. package/dist/chunks/{chunk-H6C4MAUN.js → chunk-WLQEONBF.js} +1 -1
  176. package/dist/chunks/chunk-WLZJOCLA.js +10 -0
  177. package/dist/chunks/chunk-WMBOXX7G.js +2 -0
  178. package/dist/chunks/{chunk-PF56N7ZY.js → chunk-X2J2P5ZT.js} +5 -5
  179. package/dist/chunks/{chunk-AH26AQN7.js → chunk-XHBMK6LC.js} +1 -1
  180. package/dist/chunks/{chunk-ZZHXQCNB.js → chunk-Y3B6ZUE6.js} +1 -1
  181. package/dist/chunks/{chunk-WP2L2NY2.js → chunk-YBKDEEEH.js} +1 -1
  182. package/dist/chunks/chunk-YRDPVTEI.js +3 -0
  183. package/dist/chunks/{chunk-JORRZ4BB.js → chunk-YU4JYWCA.js} +1 -1
  184. package/dist/chunks/{chunk-CZ5R4JXZ.js → chunk-Z2TOBS3P.js} +1 -1
  185. package/dist/chunks/chunk-ZFJWA4JK.js +1 -0
  186. package/dist/chunks/chunk-ZSZXA7WB.js +2 -0
  187. package/dist/chunks/{chunk-LK2K3SPM.js → chunk-ZU3YBRXS.js} +2 -2
  188. package/dist/chunks/{chunk-5FU5RLML.js → chunk-ZUT4EM64.js} +1 -1
  189. package/dist/chunks/chunk-ZWW227M3.js +2 -0
  190. package/dist/chunks/chunk-ZY32SZ2P.js +3 -0
  191. package/dist/chunks/cli-TE7RP5H7.js +2 -0
  192. package/dist/chunks/client-I5MYOJEJ.js +2 -0
  193. package/dist/chunks/command-NDHFZAKA.js +13 -0
  194. package/dist/chunks/configuration-command-HPMGH7WR.js +2 -0
  195. package/dist/chunks/connected-app-executor-7DYMZCD7.js +2 -0
  196. package/dist/chunks/connected-evidence-FNHTBUDG.js +2 -0
  197. package/dist/chunks/{connected-starting-assets-JONPTII6.js → connected-starting-assets-O4X6D6BG.js} +1 -1
  198. package/dist/chunks/connection-GDWPMHPC.js +2 -0
  199. package/dist/chunks/{continual-Z7MO2PF6.js → continual-HQCFY7GN.js} +3 -3
  200. package/dist/chunks/core-commands-LEFFBKR7.js +2 -0
  201. package/dist/chunks/dataset-preparation-authoring-KWRTMKN6.js +4 -0
  202. package/dist/chunks/datasets-BWHI23IB.js +2 -0
  203. package/dist/chunks/desktop-test-XROQ7K5H.js +3 -0
  204. package/dist/chunks/dist-GR56E3QK.js +2 -0
  205. package/dist/chunks/dist-J4KHAVO3.js +2 -0
  206. package/dist/chunks/dist-O7HXZUBW.js +2 -0
  207. package/dist/chunks/enclave-7VLABNIX.js +2 -0
  208. package/dist/chunks/evaluation-coordination-JTQIKHW6.js +2 -0
  209. package/dist/chunks/experiment-improvements-2TV2DA3K.js +2 -0
  210. package/dist/chunks/experiments-VOCZ4DW3.js +2 -0
  211. package/dist/chunks/experiments-VUJ4SEMG.js +2 -0
  212. package/dist/chunks/experiments-signal-TSTEBORD.js +2 -0
  213. package/dist/chunks/{extension-ZM6NI5O5.js → extension-UH34ZF7N.js} +1 -1
  214. package/dist/chunks/{help-7HXFWIKS.js → help-OPN36XRA.js} +1 -1
  215. package/dist/chunks/host-profile-evaluation-tools-75EPCRSZ.js +2 -0
  216. package/dist/chunks/host-profile-external-dataset-YRKG2GL5.js +2 -0
  217. package/dist/chunks/hosted-app-server-composition-7WZ4RIX2.js +2 -0
  218. package/dist/chunks/hosted-experiment-improvement-NZTPZTDH.js +3 -0
  219. package/dist/chunks/hosted-harness-runtime-3AJGEIFD.js +2 -0
  220. package/dist/chunks/hosted-profile-candidate-3CAT3XBI.js +3 -0
  221. package/dist/chunks/hosted-profile-compiler-RXU626Q6.js +2 -0
  222. package/dist/chunks/hosted-profile-evaluation-control-CBDRKJ5J.js +2 -0
  223. package/dist/chunks/hosted-profile-evaluation-inspection-CHYKDYUQ.js +3 -0
  224. package/dist/chunks/hosted-profile-evaluation-preparation-H5S7JZMD.js +3 -0
  225. package/dist/chunks/hosted-tasksets-AMGDDB2R.js +2 -0
  226. package/dist/chunks/human-review-NVKBEYG5.js +2 -0
  227. package/dist/chunks/{import-6SI4BEKS.js → import-P5DCYMQ6.js} +2 -2
  228. package/dist/chunks/learning-NJLTGZFQ.js +2 -0
  229. package/dist/chunks/learning-XTY5VOTK.js +2 -0
  230. package/dist/chunks/local-harness-improvement-runtime-XEA73RGS.js +2 -0
  231. package/dist/chunks/local-harness-taskset-review-SW35G4DM.js +2 -0
  232. package/dist/chunks/local-scope-X3737QXT.js +2 -0
  233. package/dist/chunks/model-projects-GHWCKDON.js +2 -0
  234. package/dist/chunks/opchat-ZJ5DO4RT.js +3 -0
  235. package/dist/chunks/opchat-bounded-chat-JVZ5LRH2.js +2 -0
  236. package/dist/chunks/organizations-UKXORVYS.js +2 -0
  237. package/dist/chunks/{profile-O5HL5DTQ.js → profile-XL5LABHR.js} +1 -1
  238. package/dist/chunks/profile-training-source-VIND2MM2.js +2 -0
  239. package/dist/chunks/project-action-payload-2G57RL74.js +2 -0
  240. package/dist/chunks/project-agent-CCGEMNR7.js +2 -0
  241. package/dist/chunks/published-experiment-source-D3C2AWQD.js +2 -0
  242. package/dist/chunks/refiner-profile-service-PPGGNVOV.js +2 -0
  243. package/dist/chunks/{runtime-XBA744HJ.js → runtime-VSOOPNYN.js} +2 -2
  244. package/dist/chunks/sandbox-command-L6BMKDGY.js +2 -0
  245. package/dist/chunks/{sandbox-template-27U3FQN7.js → sandbox-template-QL5ID5GJ.js} +1 -1
  246. package/dist/chunks/saved-work-LAVTNKPT.js +2 -0
  247. package/dist/chunks/send-turn-D3GTSSHI.js +2 -0
  248. package/dist/chunks/setup-HSRCZ3WR.js +2 -0
  249. package/dist/chunks/{src-PU7QTFO5.js → src-662QOKNP.js} +1 -1
  250. package/dist/chunks/{src-BLWX6DRG.js → src-KWOSLOBH.js} +117 -117
  251. package/dist/chunks/standalone-experiment-turn-owner-KKYIGGPF.js +2 -0
  252. package/dist/chunks/stdio-Z65UIX55.js +2 -0
  253. package/dist/chunks/store-chat-resources-ZWDYMDJF.js +2 -0
  254. package/dist/chunks/{store-continual-support-reviews-FOMYYS25.js → store-continual-support-reviews-7PDLGRWF.js} +1 -1
  255. package/dist/chunks/store-conversation-serving-WRT4N7N2.js +2 -0
  256. package/dist/chunks/{store-create-improve-3LQMIYAP.js → store-create-improve-G46KIUVT.js} +1 -1
  257. package/dist/chunks/{store-datasets-3KSX7RSO.js → store-datasets-O67F75BL.js} +1 -1
  258. package/dist/chunks/store-evaluation-results-BEPR4LVD.js +7 -0
  259. package/dist/chunks/{store-harness-memory-2L7ARBR4.js → store-harness-memory-4XEUITXE.js} +1 -1
  260. package/dist/chunks/{store-harness-refinement-candidates-3PHL3BUY.js → store-harness-refinement-candidates-LCN4NV23.js} +1 -1
  261. package/dist/chunks/store-harness-workspaces-PJJQ74G6.js +2 -0
  262. package/dist/chunks/store-human-review-HJ3D7ZFA.js +7 -0
  263. package/dist/chunks/store-learned-preference-migration-validation-EXNRDHCO.js +2 -0
  264. package/dist/chunks/store-learning-6P6IS7GH.js +2 -0
  265. package/dist/chunks/store-learning-credentials-EGJ2WTZI.js +2 -0
  266. package/dist/chunks/{store-local-experiments-QTVHJAEP.js → store-local-experiments-CBJA56X2.js} +1 -1
  267. package/dist/chunks/store-model-batch-review-YIVD7T2T.js +2 -0
  268. package/dist/chunks/{store-model-configuration-3SU73CMS.js → store-model-configuration-T6XJJDAB.js} +2 -2
  269. package/dist/chunks/store-model-project-preparation-WWU5CJTV.js +2 -0
  270. package/dist/chunks/{store-preference-comparison-DWV5XSMY.js → store-preference-comparison-XQFTLMGH.js} +1 -1
  271. package/dist/chunks/{store-schedules-2KUY4T6M.js → store-schedules-JPFVWL3Q.js} +1 -1
  272. package/dist/chunks/{store-sidebar-file-bookmarks-A4XCS7RM.js → store-sidebar-file-bookmarks-J3JEVAYR.js} +1 -1
  273. package/dist/chunks/{store-sidebar-preferences-V2PKRXUZ.js → store-sidebar-preferences-2JHTFXJK.js} +1 -1
  274. package/dist/chunks/{store-subagents-UGVEFA6M.js → store-subagents-PUBQVWSU.js} +1 -1
  275. package/dist/chunks/{store-task-inbox-QABI4ZAH.js → store-task-inbox-VVXZUJIO.js} +1 -1
  276. package/dist/chunks/{store-task-inventory-GEQIZELY.js → store-task-inventory-MQX44AI6.js} +1 -1
  277. package/dist/chunks/store-taskset-drafts-G3WFVN4M.js +9 -0
  278. package/dist/chunks/{store-training-CQV7PL3V.js → store-training-DUVIDYK5.js} +1 -1
  279. package/dist/chunks/{store-training-jobs-XKN6K66J.js → store-training-jobs-HHFH3V5O.js} +1 -1
  280. package/dist/chunks/{store-training-models-Q7DTTR4S.js → store-training-models-C7UUZDTO.js} +1 -1
  281. package/dist/chunks/{store-usage-XGAX7NLB.js → store-usage-6DMZM7WV.js} +1 -1
  282. package/dist/chunks/{store-work-evidence-VSLLZ6UF.js → store-work-evidence-77B36LRC.js} +1 -1
  283. package/dist/chunks/taskset-7FQCJ55X.js +2 -0
  284. package/dist/chunks/taskset-packages-NRRPON7B.js +2 -0
  285. package/dist/chunks/taskset-packages-RW4SFGDU.js +2 -0
  286. package/dist/chunks/{teams-bot-UTQAJA6H.js → teams-bot-LGV7UKX2.js} +1 -1
  287. package/dist/chunks/tool-learning-NGO7QHYK.js +2 -0
  288. package/dist/chunks/training-XFM3OOPN.js +2 -0
  289. package/dist/chunks/training-XILDD5RG.js +2 -0
  290. package/dist/chunks/training-error-LQKCOQDJ.js +2 -0
  291. package/dist/chunks/training-hardware-ESXRWUIK.js +3 -0
  292. package/dist/chunks/training-hosted-6BX2IASC.js +2 -0
  293. package/dist/chunks/training-hosted-checkpoint-evaluation-UXFW33QL.js +2 -0
  294. package/dist/chunks/training-hosted-learning-YN5VD3PW.js +2 -0
  295. package/dist/chunks/training-hosted-serving-N2MHWGZN.js +2 -0
  296. package/dist/chunks/training-hosted-serving-report-J4YOZLRP.js +2 -0
  297. package/dist/chunks/training-hosted-workers-6JTDCCWA.js +2 -0
  298. package/dist/chunks/training-model-start-E5MP3URL.js +2 -0
  299. package/dist/chunks/web-search-56QRZGPR.js +2 -0
  300. package/dist/chunks/workspaces-MCS2AQX6.js +2 -0
  301. package/dist/cli.js +1 -1
  302. package/dist/index.js +1 -1
  303. package/dist/sandbox-template/manifest.js +1 -1
  304. package/dist/skills/manifest.json +1 -1
  305. package/dist/web/assets/App-BZuSv1XM.js +53 -0
  306. package/dist/web/assets/{AppDialog-8Y0FYalT.js → AppDialog-BILEK4np.js} +1 -1
  307. package/dist/web/assets/AppTerminalPanel-BvxZ8bwD.js +2 -0
  308. package/dist/web/assets/{AppToastContext-BiQbbVxq.js → AppToastContext-C-FsCKXW.js} +1 -1
  309. package/dist/web/assets/{AppsView-Dtte4h6e.js → AppsView-BMaq5oxx.js} +1 -1
  310. package/dist/web/assets/{AttachmentTypeIcon-DgADV7dn.js → AttachmentTypeIcon-Bh7Ft_UL.js} +1 -1
  311. package/dist/web/assets/{BrowserSidebar-BUqDvEv9.js → BrowserSidebar-BG2MLJ9I.js} +1 -1
  312. package/dist/web/assets/{CartesianChart-J4ChOjvG.js → CartesianChart-CS6ES_XT.js} +1 -1
  313. package/dist/web/assets/ChatTimelineEntry-Dr5X_XyN.js +8 -0
  314. package/dist/web/assets/{ChatTimelineEntry-DztFb85D.css → ChatTimelineEntry-vs8RaEGD.css} +1 -1
  315. package/dist/web/assets/{CollaborationTabs-CFCpk2Ck.js → CollaborationTabs-CPJ2w67F.js} +1 -1
  316. package/dist/web/assets/{CommandMenu-EPPjB14H.js → CommandMenu-Fe1V7NJd.js} +1 -1
  317. package/dist/web/assets/{CommunityView-Okydjpqm.js → CommunityView-DHTcmOnI.js} +1 -1
  318. package/dist/web/assets/{ComposerAttachments-RXCiE88M.js → ComposerAttachments-Ck9VWD6o.js} +1 -1
  319. package/dist/web/assets/{ComposerCreateImproveStrip-CSngc8-V.js → ComposerCreateImproveStrip-yiXO7cf8.js} +1 -1
  320. package/dist/web/assets/{ConversationImportsSettings-DS73kyfj.js → ConversationImportsSettings-_VLzUnHQ.js} +1 -1
  321. package/dist/web/assets/{FilePagePreview-Qc4B0vue.js → FilePagePreview-BpcM1DfE.js} +2 -2
  322. package/dist/web/assets/{GetStartedView-DGFPQ1We.js → GetStartedView-BH-WJ-rW.js} +1 -1
  323. package/dist/web/assets/{GettingStartedDialog-DFBYQdHz.js → GettingStartedDialog-CdQfj7RA.js} +1 -1
  324. package/dist/web/assets/{HostedModelLearningReview-BDu3FlcU.js → HostedModelLearningReview-C3GsOlu9.js} +1 -1
  325. package/dist/web/assets/{HostedModelLearningSettings-CHaTHwC8.js → HostedModelLearningSettings-SSMst6dl.js} +1 -1
  326. package/dist/web/assets/{HtmlVisual-D9Mh7xds.js → HtmlVisual-CH0tb3fv.js} +1 -1
  327. package/dist/web/assets/{LabModelVersionDetailPage-DgY7lAu5.js → LabModelVersionDetailPage-J2t9yILv.js} +1 -1
  328. package/dist/web/assets/{LabSkillSidebar-BwtlThO7.js → LabSkillSidebar-DdDYvfj2.js} +1 -1
  329. package/dist/web/assets/LabsRoute-MJwIjSKg.js +101 -0
  330. package/dist/web/assets/MainChatThread-BcwtaTDZ.js +2 -0
  331. package/dist/web/assets/MainPane-DDO6diPt.js +10 -0
  332. package/dist/web/assets/NativeSetupTerminal-BPSUFpRm.js +2 -0
  333. package/dist/web/assets/{NativeSkillSidebar-BEJvt5_H.js → NativeSkillSidebar-DPYavzau.js} +1 -1
  334. package/dist/web/assets/{NewProjectDialog-CjrjgkTN.js → NewProjectDialog-BtmvE9Sp.js} +1 -1
  335. package/dist/web/assets/{OutputsPage-jzx93QQ3.js → OutputsPage-BMRY7RK2.js} +1 -1
  336. package/dist/web/assets/{PageChrome-C1M13qG2.js → PageChrome-5VRxH6Rp.js} +1 -1
  337. package/dist/web/assets/{ProjectsPage-DZrjlMp2.js → ProjectsPage-1LHqxOMo.js} +1 -1
  338. package/dist/web/assets/RightChatPanelStack-D_7KgExz.js +1 -0
  339. package/dist/web/assets/RightSidebarHomePanel-iznJwDMf.js +1 -0
  340. package/dist/web/assets/{ScheduledWorkPage-Cw1ja2GF.js → ScheduledWorkPage-Dtz4zJ0T.js} +1 -1
  341. package/dist/web/assets/{SettingsView-CckoIki3.js → SettingsView-BeDYNPcD.js} +3 -3
  342. package/dist/web/assets/{TasksetDraftEditorPrimitives-ByC8bDjp.js → TasksetDraftEditorPrimitives-CcvKO3YA.js} +1 -1
  343. package/dist/web/assets/{TeamChatView-OprnSKLF.js → TeamChatView-DaXxOkTe.js} +1 -1
  344. package/dist/web/assets/{TerminalOverlay-d7A2F9Lx.js → TerminalOverlay-CF8uB4qA.js} +1 -1
  345. package/dist/web/assets/{TrainingCreationPanel-Cyn6R6I6.js → TrainingCreationPanel-DmMO7x5T.js} +1 -1
  346. package/dist/web/assets/{TrainingDraftPanel-Mpb5e7t5.js → TrainingDraftPanel-DCHbXjSx.js} +1 -1
  347. package/dist/web/assets/{TrainingRunLineage-VcKz7dIR.js → TrainingRunLineage-CwisTWs_.js} +1 -1
  348. package/dist/web/assets/UsageSettingsSection-Drt7gwRb.js +7 -0
  349. package/dist/web/assets/WorkSidebarPanel-BrIIRtGW.js +1 -0
  350. package/dist/web/assets/WorkspaceDiffPanel-Dmbrg0-y.js +11 -0
  351. package/dist/web/assets/{WorkspaceEnvironmentMenu-C8y3537a.js → WorkspaceEnvironmentMenu-KEZm1gdb.js} +1 -1
  352. package/dist/web/assets/{WorkspaceFileLocation-LrEWj4UK.js → WorkspaceFileLocation-ChbOKrPO.js} +1 -1
  353. package/dist/web/assets/{WorkspaceGitDialogs-NRIMXnkS.js → WorkspaceGitDialogs-BS2JQKNQ.js} +1 -1
  354. package/dist/web/assets/{WorkspaceMonacoEditor-CvDGjKAL.js → WorkspaceMonacoEditor-CN1hE_C4.js} +3 -3
  355. package/dist/web/assets/{WorkspacePdfPreview-BZ0BbnHv.js → WorkspacePdfPreview-Clb4m0le.js} +2 -2
  356. package/dist/web/assets/{WorkspacePresentationPreview-DJrjrvT0.js → WorkspacePresentationPreview-CwQsdvAR.js} +1 -1
  357. package/dist/web/assets/app-models-Cz3yxq4x.js +1 -0
  358. package/dist/web/assets/{bot-6OhUEmkE.js → bot-BNFltD5O.js} +1 -1
  359. package/dist/web/assets/chat-resources-CTN4f6KC.js +1 -0
  360. package/dist/web/assets/{chevron-down-jmVA1BIf.js → chevron-down-BnnT0tnM.js} +1 -1
  361. package/dist/web/assets/chevron-right-C8K5PZj7.js +1 -0
  362. package/dist/web/assets/{chevron-up-CstyLXH3.js → chevron-up-BAnwJJN3.js} +1 -1
  363. package/dist/web/assets/chunk-GJRXJL6G-pJp1DyJd.js +9 -0
  364. package/dist/web/assets/chunk-TLSP5JKG-DZmxtX-4.js +1 -0
  365. package/dist/web/assets/{client-choice-storage-BdQ_YDuk.js → client-choice-storage-Iuzoszas.js} +1 -1
  366. package/dist/web/assets/{cloud-upload-Ck1ufAr8.js → cloud-upload-CdSXJ7ms.js} +1 -1
  367. package/dist/web/assets/{copy-CPkbMfXt.js → copy-CBFg6m0d.js} +1 -1
  368. package/dist/web/assets/{createLucideIcon-CXQny8HU.js → createLucideIcon-DF2VR6WA.js} +1 -1
  369. package/dist/web/assets/{cssMode-CYxYl_om.js → cssMode-BSQUZhUO.js} +1 -1
  370. package/dist/web/assets/{external-link-CDKOLG_v.js → external-link-Cql9bKdv.js} +1 -1
  371. package/dist/web/assets/{folder-open-CEtOb_lK.js → folder-open-BXdVB5J1.js} +1 -1
  372. package/dist/web/assets/{folder-plus-CVMYZs3e.js → folder-plus-Cma2HulC.js} +1 -1
  373. package/dist/web/assets/{git-commit-horizontal-DDyhPjxS.js → git-commit-horizontal-eF--16ps.js} +1 -1
  374. package/dist/web/assets/{htmlMode-DoY4V_j0.js → htmlMode-aLPlQtyU.js} +1 -1
  375. package/dist/web/assets/icons-c3vt7y6n.js +1 -0
  376. package/dist/web/assets/{image-B-PjDSwU.js → image-CqKPwnBn.js} +1 -1
  377. package/dist/web/assets/{index-D9WbJMSq.js → index-CM0IRu1U.js} +2 -2
  378. package/dist/web/assets/{info-CCnw-K3b.js → info-CqeYEqG0.js} +1 -1
  379. package/dist/web/assets/{jsonMode-CeOpZdPj.js → jsonMode-fu7bEcHB.js} +1 -1
  380. package/dist/web/assets/loader-circle-pxp89T5x.js +1 -0
  381. package/dist/web/assets/{lspLanguageFeatures-DAbgLCqZ.js → lspLanguageFeatures-DraXQA4w.js} +1 -1
  382. package/dist/web/assets/{maximize-2-BZX38cpr.js → maximize-2-yMp8X9ts.js} +1 -1
  383. package/dist/web/assets/{message-square-CvgSecgD.js → message-square-DbIMQqfj.js} +1 -1
  384. package/dist/web/assets/model-display-zPvC4L2B.js +1 -0
  385. package/dist/web/assets/models-route-CWcJuOd0.js +1 -0
  386. package/dist/web/assets/{monaco.contribution-cbDqt48m.js → monaco.contribution-BQhp1CJs.js} +2 -2
  387. package/dist/web/assets/{monaco.contribution-CF2JDhi4.js → monaco.contribution-Bd8EqYGR.js} +2 -2
  388. package/dist/web/assets/{monaco.contribution-m2ze2EsL.js → monaco.contribution-CYWKnVxQ.js} +2 -2
  389. package/dist/web/assets/{monaco.contribution-yeyow_-Q.js → monaco.contribution-CmbWO0tB.js} +2 -2
  390. package/dist/web/assets/{monitor-By0s4hxb.js → monitor-DFE2fTkT.js} +1 -1
  391. package/dist/web/assets/{paperclip-BJ2QgJLa.js → paperclip-D_qsKbVs.js} +1 -1
  392. package/dist/web/assets/{pdf-C4x-1jjP.js → pdf-DkQRsi4n.js} +1 -1
  393. package/dist/web/assets/play-BtlX2stU.js +1 -0
  394. package/dist/web/assets/plus-DbASL_gy.js +1 -0
  395. package/dist/web/assets/{presentation-I86G1Gd9.js → presentation-BN_kIBPL.js} +1 -1
  396. package/dist/web/assets/{python-CqFTPj8r.js → python-DB9pj5Hr.js} +1 -1
  397. package/dist/web/assets/{refresh-cw-Dga35Eay.js → refresh-cw-B27ohHfn.js} +1 -1
  398. package/dist/web/assets/{save-BLKjYtzR.js → save-D-rwjKop.js} +1 -1
  399. package/dist/web/assets/settings-lists-DgSaJQA4.js +5 -0
  400. package/dist/web/assets/square-C2caJ3NG.js +1 -0
  401. package/dist/web/assets/{square-terminal-B-n7vUex.js → square-terminal-CeoK51wH.js} +1 -1
  402. package/dist/web/assets/{submit-issue-command-B7Hrt2tU.js → submit-issue-command-DZNW7Evj.js} +1 -1
  403. package/dist/web/assets/{toggleHighContrast-BhmBE5XE.js → toggleHighContrast-Bs8L1gx0.js} +1 -1
  404. package/dist/web/assets/{training-QrdkRQZQ.js → training-DCdoHJ0Y.js} +2 -2
  405. package/dist/web/assets/{training-model-data-DB-jg6L_.js → training-model-data-wHvE7xL1.js} +1 -1
  406. package/dist/web/assets/{tsMode-BSWEII2p.js → tsMode-C7EqshxC.js} +1 -1
  407. package/dist/web/assets/{upload-C4MPhQn8.js → upload-BWgjC2Jf.js} +1 -1
  408. package/dist/web/assets/{useAccountSettings-9oqWdRLs.js → useAccountSettings-Dva1MpsJ.js} +1 -1
  409. package/dist/web/assets/{useAgentInventory-isO79ui9.js → useAgentInventory-CrjIOmvb.js} +1 -1
  410. package/dist/web/assets/{useLocalAgentSchedules-CZX6PxoK.js → useLocalAgentSchedules-P-UaUKMb.js} +1 -1
  411. package/dist/web/assets/{useQuery-BD0Uexmh.js → useQuery-Bn3KqR4r.js} +1 -1
  412. package/dist/web/assets/{wifi-off-Cloe0WuQ.js → wifi-off--mKrSPFc.js} +1 -1
  413. package/dist/web/assets/{workers-BXagz5eg.js → workers-p0Kn2KMK.js} +1 -1
  414. package/dist/web/assets/x-D9GTV9ke.js +1 -0
  415. package/dist/web/assets/{yaml-sBdvVbCc.js → yaml-BeIdC4tu.js} +1 -1
  416. package/dist/web/index.html +1 -1
  417. package/docs/command-reference.md +44 -2
  418. package/package.json +1 -1
  419. package/dist/chunks/acp-H3MJCPHX.js +0 -2
  420. package/dist/chunks/acp-agent-DWA7272M.js +0 -21
  421. package/dist/chunks/actions-command-IIYOO4LL.js +0 -2
  422. package/dist/chunks/app-layer-K7H2WJ56.js +0 -3
  423. package/dist/chunks/app-server-connected-apps-RM5E2VWF.js +0 -2
  424. package/dist/chunks/app-server-evaluations-XGMGS67X.js +0 -2
  425. package/dist/chunks/app-server-harness-services-BHD6S5II.js +0 -2
  426. package/dist/chunks/app-server-runtime-LFIL6F7D.js +0 -2
  427. package/dist/chunks/apps-QKAHJGQ4.js +0 -2
  428. package/dist/chunks/chunk-5EP2DZLJ.js +0 -2
  429. package/dist/chunks/chunk-6EBCS57F.js +0 -2
  430. package/dist/chunks/chunk-6RS4NAOY.js +0 -2
  431. package/dist/chunks/chunk-7O6Z3VOZ.js +0 -2
  432. package/dist/chunks/chunk-7YLXGILH.js +0 -2
  433. package/dist/chunks/chunk-7ZLXFKRI.js +0 -2
  434. package/dist/chunks/chunk-B5R53U74.js +0 -2
  435. package/dist/chunks/chunk-C2AXMKK4.js +0 -2
  436. package/dist/chunks/chunk-F6UQ6PPK.js +0 -2
  437. package/dist/chunks/chunk-GS6ZUSIN.js +0 -3
  438. package/dist/chunks/chunk-JSQRLLN6.js +0 -2
  439. package/dist/chunks/chunk-LAOLJDVB.js +0 -2
  440. package/dist/chunks/chunk-LKKMLBOH.js +0 -3
  441. package/dist/chunks/chunk-M3FLEZ4E.js +0 -4
  442. package/dist/chunks/chunk-MEGKXGW3.js +0 -2
  443. package/dist/chunks/chunk-MILEWROZ.js +0 -2
  444. package/dist/chunks/chunk-N42HT64M.js +0 -2
  445. package/dist/chunks/chunk-NG2L6D7G.js +0 -2
  446. package/dist/chunks/chunk-OSVGNONV.js +0 -2
  447. package/dist/chunks/chunk-OTUBJV6C.js +0 -6
  448. package/dist/chunks/chunk-PBTXLQAU.js +0 -2
  449. package/dist/chunks/chunk-PBZCXPPC.js +0 -10
  450. package/dist/chunks/chunk-SFKZITAG.js +0 -9
  451. package/dist/chunks/chunk-SXMR6E2W.js +0 -2
  452. package/dist/chunks/chunk-U2K7QJCG.js +0 -2
  453. package/dist/chunks/chunk-URNMC46H.js +0 -157
  454. package/dist/chunks/chunk-VHXDWAEH.js +0 -2
  455. package/dist/chunks/chunk-W2TICQ62.js +0 -2
  456. package/dist/chunks/chunk-WSOUMXH3.js +0 -24
  457. package/dist/chunks/chunk-XOB6FKQV.js +0 -2
  458. package/dist/chunks/chunk-YBNKGA5C.js +0 -2
  459. package/dist/chunks/chunk-YM4PSVFW.js +0 -4
  460. package/dist/chunks/chunk-YNQWJWIC.js +0 -10
  461. package/dist/chunks/chunk-Z3BWCFLV.js +0 -2
  462. package/dist/chunks/cli-PSXMIJTF.js +0 -2
  463. package/dist/chunks/configuration-command-XYKMXIWF.js +0 -2
  464. package/dist/chunks/connected-app-executor-6G2LA3PQ.js +0 -2
  465. package/dist/chunks/connected-evidence-IRXYN6YD.js +0 -2
  466. package/dist/chunks/connection-XMAAGMXJ.js +0 -2
  467. package/dist/chunks/core-commands-WWN7X3XC.js +0 -2
  468. package/dist/chunks/dataset-preparation-authoring-F3OZIQSP.js +0 -4
  469. package/dist/chunks/datasets-2PC2HP7N.js +0 -2
  470. package/dist/chunks/desktop-test-VU6AFAMO.js +0 -3
  471. package/dist/chunks/dist-47AYOIH6.js +0 -2
  472. package/dist/chunks/dist-HSC43RG4.js +0 -2
  473. package/dist/chunks/dist-MXBEBM4D.js +0 -2
  474. package/dist/chunks/enclave-VURYNILU.js +0 -2
  475. package/dist/chunks/evaluation-coordination-UOWZHHC5.js +0 -2
  476. package/dist/chunks/experiment-improvements-EB2CV5RA.js +0 -2
  477. package/dist/chunks/experiments-CLXGM3TZ.js +0 -2
  478. package/dist/chunks/experiments-SZQYR6MH.js +0 -2
  479. package/dist/chunks/experiments-signal-2KJCP25D.js +0 -2
  480. package/dist/chunks/host-profile-evaluation-tools-Y2LQ4WQN.js +0 -2
  481. package/dist/chunks/host-profile-external-dataset-FRIGXOO7.js +0 -2
  482. package/dist/chunks/hosted-app-server-composition-PGKQNDW6.js +0 -2
  483. package/dist/chunks/hosted-experiment-improvement-UXC542SZ.js +0 -3
  484. package/dist/chunks/hosted-harness-runtime-6PEI7F2U.js +0 -2
  485. package/dist/chunks/hosted-profile-candidate-HM44BIUX.js +0 -3
  486. package/dist/chunks/hosted-profile-compiler-UAZ4PHYE.js +0 -2
  487. package/dist/chunks/hosted-profile-evaluation-control-EUL57FAB.js +0 -2
  488. package/dist/chunks/hosted-profile-evaluation-inspection-7USY75Z4.js +0 -3
  489. package/dist/chunks/hosted-profile-evaluation-preparation-2LSMZQNA.js +0 -3
  490. package/dist/chunks/hosted-tasksets-WGXGXJ7E.js +0 -2
  491. package/dist/chunks/human-review-M26UKGJL.js +0 -2
  492. package/dist/chunks/learning-HM3NWOV5.js +0 -2
  493. package/dist/chunks/local-harness-improvement-runtime-QGWFWNSR.js +0 -2
  494. package/dist/chunks/local-harness-taskset-review-KS4WPMN6.js +0 -2
  495. package/dist/chunks/local-scope-62GWHDXS.js +0 -2
  496. package/dist/chunks/model-projects-YUAMBQTO.js +0 -2
  497. package/dist/chunks/opchat-AG4CWVY4.js +0 -3
  498. package/dist/chunks/opchat-bounded-chat-IQMP5IIO.js +0 -2
  499. package/dist/chunks/organizations-KDKX77XZ.js +0 -2
  500. package/dist/chunks/profile-training-source-3DXFM2XI.js +0 -2
  501. package/dist/chunks/project-action-payload-QA24HYGF.js +0 -2
  502. package/dist/chunks/project-agent-XBOOM5TS.js +0 -2
  503. package/dist/chunks/published-experiment-source-GZGN354O.js +0 -2
  504. package/dist/chunks/refiner-profile-service-BJMOYKTC.js +0 -2
  505. package/dist/chunks/sandbox-command-5ECGS7DG.js +0 -2
  506. package/dist/chunks/saved-work-KUNVTJ7O.js +0 -2
  507. package/dist/chunks/send-turn-FIPWOXWV.js +0 -2
  508. package/dist/chunks/standalone-experiment-turn-owner-XIE46VNH.js +0 -2
  509. package/dist/chunks/store-chat-resources-YOEJ2BI6.js +0 -2
  510. package/dist/chunks/store-conversation-serving-K324SQTO.js +0 -2
  511. package/dist/chunks/store-evaluation-results-LHCCNNE6.js +0 -7
  512. package/dist/chunks/store-harness-workspaces-ZHNCNWVI.js +0 -2
  513. package/dist/chunks/store-human-review-QJY3ZPPF.js +0 -7
  514. package/dist/chunks/store-learned-preference-migration-validation-X32SRBOM.js +0 -2
  515. package/dist/chunks/store-learning-DW3QLQXU.js +0 -2
  516. package/dist/chunks/store-learning-credentials-67QNTPA7.js +0 -2
  517. package/dist/chunks/store-model-batch-review-PBYQZJJJ.js +0 -2
  518. package/dist/chunks/store-model-project-preparation-TFCG2F2F.js +0 -2
  519. package/dist/chunks/store-taskset-drafts-GXABQR5G.js +0 -9
  520. package/dist/chunks/taskset-ARKJQKYQ.js +0 -2
  521. package/dist/chunks/taskset-packages-X4K65DTW.js +0 -2
  522. package/dist/chunks/taskset-packages-XK7FSD45.js +0 -2
  523. package/dist/chunks/training-3IWW4256.js +0 -2
  524. package/dist/chunks/training-RVIESURJ.js +0 -2
  525. package/dist/chunks/training-error-2EWDOQ4G.js +0 -2
  526. package/dist/chunks/training-hosted-PFJHYTEU.js +0 -2
  527. package/dist/chunks/training-hosted-checkpoint-evaluation-JJPP7KFW.js +0 -2
  528. package/dist/chunks/training-hosted-learning-Y7NHRY4V.js +0 -2
  529. package/dist/chunks/training-hosted-serving-QAV7ZGGV.js +0 -2
  530. package/dist/chunks/training-hosted-serving-report-OX4A5OKB.js +0 -2
  531. package/dist/chunks/training-hosted-workers-LST4ZUXN.js +0 -2
  532. package/dist/chunks/training-model-start-ROLS3E4V.js +0 -2
  533. package/dist/chunks/web-search-7FBUBZ66.js +0 -2
  534. package/dist/chunks/workspaces-G3CMY7ZA.js +0 -2
  535. package/dist/web/assets/App-DY2R8Z6r.js +0 -53
  536. package/dist/web/assets/AppTerminalPanel-YcnBD5DF.js +0 -2
  537. package/dist/web/assets/ChatTimelineEntry-DC93wlDa.js +0 -8
  538. package/dist/web/assets/LabsRoute-BV7ZJGEw.js +0 -101
  539. package/dist/web/assets/MainChatThread-pzHKd_YN.js +0 -2
  540. package/dist/web/assets/MainPane-6OlLiKKb.js +0 -10
  541. package/dist/web/assets/NativeSetupTerminal-CPDChcMi.js +0 -2
  542. package/dist/web/assets/RightChatPanelStack-BsxJg9sy.js +0 -1
  543. package/dist/web/assets/RightSidebarHomePanel-CCVQ9LMB.js +0 -1
  544. package/dist/web/assets/UsageSettingsSection-FhYymrfc.js +0 -7
  545. package/dist/web/assets/WorkSidebarPanel-u87uptH0.js +0 -1
  546. package/dist/web/assets/WorkspaceDiffPanel-B5rlW7bA.js +0 -11
  547. package/dist/web/assets/app-models-CUA9XB9U.js +0 -1
  548. package/dist/web/assets/chat-resources-CI8KFVO5.js +0 -1
  549. package/dist/web/assets/chevron-right-BYmDQ7ti.js +0 -1
  550. package/dist/web/assets/chunk-ONGOAEY6-C__DQmRT.js +0 -9
  551. package/dist/web/assets/chunk-SQBYHWZU-DumrB9SB.js +0 -1
  552. package/dist/web/assets/icons-D7jkCa2d.js +0 -1
  553. package/dist/web/assets/loader-circle-CPaJeTDy.js +0 -1
  554. package/dist/web/assets/models-route-Bl_TmMl6.js +0 -1
  555. package/dist/web/assets/play-D_SuGDBM.js +0 -1
  556. package/dist/web/assets/plus-yw95Iaj8.js +0 -1
  557. package/dist/web/assets/settings-lists-DMKA1lCN.js +0 -5
  558. package/dist/web/assets/square-BY5lG2Ol.js +0 -1
  559. package/dist/web/assets/x-Dqpel42h.js +0 -1
  560. /package/dist/chunks/{chunk-IDOGNIMV.js → chunk-7J2NMUTK.js} +0 -0
  561. /package/dist/chunks/{chunk-PCB65K4G.js → chunk-SFR32TMJ.js} +0 -0
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{a as p,b as v}from"./chunk-OXRVILDW.js";import"./chunk-KOKBDIGR.js";import"./chunk-7P5SH3CI.js";import"./chunk-TGULVWPV.js";import"./chunk-EW7CD7OA.js";import"./chunk-SQX22LQT.js";import"./chunk-XRKFTPHD.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{c as r}from"./chunk-3M53YXEI.js";import"./chunk-CRDKBFRN.js";import{s as d,t as s,u as h,v as w}from"./chunk-DMO3UIS7.js";import"./chunk-27JGS3KB.js";import"./chunk-BT5YNE5U.js";import"./chunk-3WJQ4IGK.js";import"./chunk-KTIBXRWQ.js";import"./chunk-L4EJ5R3B.js";import"./chunk-6ZTP6CUJ.js";import"./chunk-TBODQT4W.js";import"./chunk-YRDPVTEI.js";import"./chunk-JRGECNP3.js";import"./chunk-RRWL5BHZ.js";import"./chunk-NXN7GJOH.js";import"./chunk-5WPMI6QX.js";import"./chunk-W7NXFRHN.js";import"./chunk-5HPZGLOL.js";import"./chunk-GLUWATL5.js";import"./chunk-UN2LKLGV.js";import"./chunk-2LJCJOJ7.js";import"./chunk-AMC4Z7G4.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-JCLTFDVW.js";import"./chunk-I6VMRQF4.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-G4E3WGLM.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-SH7POUVX.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import"./chunk-UGOK7VTC.js";import{a as m}from"./chunk-FTQLQJQV.js";async function b(t,e,n){let[a,o]=n,i=r(e,"actor");if(!i||!a||n.length>2)throw new Error("Select --actor, --team and an evaluation command.");if(e.local!==!0&&e.local!=="true")throw new Error("These evaluation owners currently run through the authenticated native bridge. Select --local --server-url with its loopback origin.");let c={...await v(e),actorId:i,projectId:r(e,"project")||null},l=a==="request"?await p(e):a==="list"?t==="schedule"?{operation:a,...r(e,"cursor")?{cursor:r(e,"cursor")}:{},limit:Number(r(e,"limit")||50)}:{operation:a}:{operation:a,id:o};if((a==="request"||a==="list")&&o)throw new Error("This operation does not accept an additional resource id.");let u=AbortSignal.timeout(6e4),f=t==="schedule"?await new s(c).command(d.parse(l),u):await new w(c).command(h.parse(l),u);console.log(JSON.stringify(f,null,2))}m(b,"runEvaluationCoordinationCommand");export{b as runEvaluationCoordinationCommand};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{a as s,b as l}from"./chunk-OXRVILDW.js";import"./chunk-KOKBDIGR.js";import"./chunk-7P5SH3CI.js";import"./chunk-TGULVWPV.js";import"./chunk-EW7CD7OA.js";import"./chunk-SQX22LQT.js";import"./chunk-XRKFTPHD.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{c as e}from"./chunk-3M53YXEI.js";import"./chunk-CRDKBFRN.js";import{q as m,r as c}from"./chunk-DMO3UIS7.js";import"./chunk-27JGS3KB.js";import"./chunk-BT5YNE5U.js";import"./chunk-3WJQ4IGK.js";import"./chunk-KTIBXRWQ.js";import"./chunk-L4EJ5R3B.js";import"./chunk-6ZTP6CUJ.js";import"./chunk-TBODQT4W.js";import"./chunk-YRDPVTEI.js";import"./chunk-JRGECNP3.js";import"./chunk-RRWL5BHZ.js";import"./chunk-NXN7GJOH.js";import"./chunk-5WPMI6QX.js";import"./chunk-W7NXFRHN.js";import"./chunk-5HPZGLOL.js";import"./chunk-GLUWATL5.js";import"./chunk-UN2LKLGV.js";import"./chunk-2LJCJOJ7.js";import"./chunk-AMC4Z7G4.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-JCLTFDVW.js";import"./chunk-I6VMRQF4.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-G4E3WGLM.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-SH7POUVX.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import"./chunk-UGOK7VTC.js";import{a}from"./chunk-FTQLQJQV.js";async function f(t,i){let[r,o]=i,n=e(t,"actor");if(!n||!r||i.length>2)throw new Error("usage: improve <list|read|instructions|request> [id] --team <id> --actor <owner-id> [--input-file <path>] [--local --server-url <loopback-origin>]");let u=m.parse(r==="request"?await s(t):r==="list"?{operation:r,limit:Number(e(t,"limit")||30),...e(t,"cursor")?{cursor:e(t,"cursor")}:{}}:{operation:r,id:o});if(r==="request"&&o||r==="list"&&o)throw new Error("This operation does not accept a candidate id.");let d=new c({...await l(t),actorId:n});console.log(JSON.stringify(await d.command(u,AbortSignal.timeout(6e4)),null,2))}a(f,"runExperimentImprovementsCommand");export{f as runExperimentImprovementsCommand};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{Ab as v,Bb as w,Cb as x,Db as y,Eb as z,Fb as A,fb as a,gb as b,hb as c,ib as d,jb as e,kb as f,lb as g,mb as h,nb as i,ob as j,pb as k,qb as l,rb as m,sb as n,tb as o,ub as p,vb as q,wb as r,xb as s,yb as t,zb as u}from"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import"./chunk-FTQLQJQV.js";export{n as ExperimentCaseIdentitySchema,u as ExperimentCaseResultSchema,m as ExperimentEvaluatorSchema,s as ExperimentFeedbackSchema,q as ExperimentManifestContentSchema,r as ExperimentManifestSchema,v as ExperimentResultContentSchema,w as ExperimentResultSchema,l as ExperimentTargetSchema,t as ExperimentUsageSchema,h as NativeHarnessExperimentAttemptContentSchema,i as NativeHarnessExperimentAttemptSchema,g as NativeHarnessExperimentEvidenceSchema,b as STANDALONE_EXPERIMENT_MAX_POLICY_CALLS,d as STANDALONE_EXPERIMENT_READ_TOOLS,a as StandaloneHarnessExperimentSourceSchema,A as compareExperiments,x as createExperimentManifest,y as createExperimentResult,j as createNativeHarnessExperimentAttempt,o as experimentCaseKey,f as harnessExperimentReadToolDeclarations,c as harnessExperimentSourceRequiresProfile,p as humanProjectionViewId,e as standaloneHarnessExperimentTools,z as verifyExperimentEvidence,k as verifyNativeHarnessExperimentAttempt};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{a as W,b as C,d as Q}from"./chunk-TVDZXDQW.js";import{a as k,d as A}from"./chunk-KOKBDIGR.js";import"./chunk-7P5SH3CI.js";import{c as M}from"./chunk-TGULVWPV.js";import"./chunk-EW7CD7OA.js";import"./chunk-SQX22LQT.js";import"./chunk-XRKFTPHD.js";import{c as D,f as F}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{c as n,f as q}from"./chunk-3M53YXEI.js";import"./chunk-W45RKGM6.js";import"./chunk-W45RKGM6.js";import"./chunk-7PKTCMZ6.js";import"./chunk-LXZLLTYQ.js";import"./chunk-AF3AVDPP.js";import"./chunk-SFR32TMJ.js";import"./chunk-5KJMFK65.js";import{s as P}from"./chunk-Y3B6ZUE6.js";import"./chunk-OKEC2EIE.js";import{Sb as V}from"./chunk-WLZJOCLA.js";import"./chunk-HIQPGYVH.js";import"./chunk-ZWW227M3.js";import"./chunk-DXA2UHBE.js";import"./chunk-MTP3B2SU.js";import"./chunk-CRDKBFRN.js";import{n as K,o as G}from"./chunk-DMO3UIS7.js";import"./chunk-27JGS3KB.js";import"./chunk-BT5YNE5U.js";import{d as B}from"./chunk-3WJQ4IGK.js";import"./chunk-KTIBXRWQ.js";import"./chunk-L4EJ5R3B.js";import"./chunk-6ZTP6CUJ.js";import"./chunk-TBODQT4W.js";import"./chunk-YRDPVTEI.js";import{m as z,q as J}from"./chunk-JRGECNP3.js";import"./chunk-RRWL5BHZ.js";import"./chunk-NXN7GJOH.js";import"./chunk-5WPMI6QX.js";import"./chunk-W7NXFRHN.js";import"./chunk-5HPZGLOL.js";import{b as $}from"./chunk-GLUWATL5.js";import"./chunk-UN2LKLGV.js";import"./chunk-2LJCJOJ7.js";import"./chunk-AMC4Z7G4.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-JCLTFDVW.js";import"./chunk-I6VMRQF4.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-G4E3WGLM.js";import{Fb as U}from"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-SH7POUVX.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import{h as _,n as T}from"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import{A as e}from"./chunk-X2J2P5ZT.js";import"./chunk-UGOK7VTC.js";import{a as w}from"./chunk-FTQLQJQV.js";import{readFile as j,stat as O}from"node:fs/promises";var E=e.string().trim().min(1).max(500),X=e.string().regex(/^[a-f0-9]{64}$/),ne=e.object({schemaVersion:e.literal("openpond.experimentCaseInspection.v1"),teamId:E,executionId:E,manifestHash:X,receiptId:E,taskId:E,seed:e.string().min(1),input:e.record(e.string(),e.unknown()).nullable(),output:e.unknown().nullable(),error:e.string().nullable(),events:e.array(e.record(e.string(),e.unknown())).max(25),nextEventCursor:E.nullable(),eventCount:e.number().int().nonnegative()}).strict(),ie=ne.extend({contentHash:X}).strict(),L=class{constructor(s){this.options=s;let a=new URL(s.baseUrl);if(!["http:","https:"].includes(a.protocol)||a.username||a.password||a.search||a.hash||!s.apiKey.trim()||!s.teamId.trim())throw new Error("A clean API origin and workspace credentials are required.");this.baseUrl=a.toString().replace(/\/+$/,"")}options;static{w(this,"OpenPondExperimentInspectionClient")}baseUrl;async case(s,a,t={}){let c=new URLSearchParams(t.afterId?{afterId:E.parse(t.afterId)}:{}),h=await(this.options.fetch??fetch)(`${this.baseUrl}/v1/experiments/${encodeURIComponent(E.parse(s))}/cases/${encodeURIComponent(E.parse(a))}?${c}`,{signal:t.signal,redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"X-OpenPond-Team-Id":this.options.teamId,Accept:"application/json"}}),b=await h.json();if(!h.ok)throw new Error(e.object({message:e.string()}).parse(b).message);let d=ie.parse(b),{contentHash:i,...o}=d;if(T(o)!==i||d.teamId!==this.options.teamId||d.executionId!==s||d.receiptId!==a||t.manifestHash&&d.manifestHash!==t.manifestHash||d.events.length>d.eventCount)throw new Error("Case inspection differs from its requested workspace, execution or retained content.");return d}};import{readFile as me,stat as ae}from"node:fs/promises";var y=e.string().trim().min(1).max(240),oe=e.object({location:e.literal("local").default("local"),jobId:y,modelRunId:y,modelId:y,modelVersionId:y.nullable(),adapterArtifactLineageId:y.nullable(),owner:e.object({teamId:y,actorId:y}).strict(),taskset:_,state:e.enum(["prepared","running","succeeded","failed","cancelled"]),executionState:e.enum(["queued","starting","running","cancelling","cancelled","succeeded","failed","reconciling"]),updatedAt:e.iso.datetime()}).strict(),se=e.object({location:e.literal("cloud"),jobId:y,owner:e.object({teamId:y,actorId:y}).strict(),apiOrigin:e.url(),job:V,updatedAt:e.iso.datetime()}).strict().refine(r=>r.jobId===r.job.id&&r.owner.teamId===r.job.teamId&&r.updatedAt===r.job.updatedAt,"Hosted training attachment must match its canonical job."),Y=e.union([oe,se]);var u=e.string().trim().min(1).max(240),x=e.string().regex(/^[a-f0-9]{64}$/),ce=e.object({kind:e.enum(["structure","graders"]),revision:e.number().int().positive(),workspaceHash:x,status:e.enum(["passed","failed","unavailable"]),checkedAt:e.iso.datetime(),checked:e.number().int().nonnegative(),total:e.number().int().nonnegative(),issues:e.array(e.object({code:e.string(),message:e.string(),taskId:u.optional(),graderId:u.optional()})).max(1e4),scopes:e.array(e.object({graderId:u,checked:e.number().int().nonnegative(),total:e.number().int().nonnegative(),status:e.enum(["passed","failed","unavailable"])}).strict()).max(1e3).optional()}).strict(),le=e.object({apiOrigin:e.url(),actorId:u,teamId:u,datasetId:u,remoteRevision:e.number().int().nonnegative(),acknowledgedHash:x.nullable(),remoteHash:x.nullable(),pendingLocalHash:x.nullable(),paused:e.boolean(),status:e.enum(["pending","syncing","synced","retry","conflict","paused"]),error:e.string().nullable(),operationId:u.nullable(),pendingWorkspace:P.nullable(),beginVersionOperationId:u.nullable().optional(),publicationIntent:e.object({operationId:u,expectedRevision:e.number().int().positive(),workspaceHash:x,packageHash:x,localHash:x}).strict().nullable().optional()}).strict(),Pe=e.object({schemaVersion:e.literal("openpond.localDataset.v1"),ownerId:u,projectId:u.nullable(),workspace:P,checks:e.array(ce).max(2),packageHash:x.nullable(),sync:le.nullable()}).strict(),v=e.object({kind:e.enum(["dataset","grader","experiment"]),id:u,revision:e.number().int().positive(),name:e.string().max(500),state:e.string().max(100),datasetId:u.optional(),datasetRevision:e.number().int().positive().optional(),taskCount:e.number().int().nonnegative().optional(),graderCount:e.number().int().nonnegative().optional(),checkState:e.string().optional(),syncState:e.string().optional(),model:e.string().optional(),evaluationHash:x.optional(),graderId:u.optional(),graderType:e.string().optional(),description:e.string().optional(),location:e.enum(["local","cloud"]).optional(),scoreLabel:e.string().optional(),owner:e.object({teamId:u,actorId:u}).strict().optional(),contentHash:x.optional(),profileRef:W.optional(),score:e.number().nullable().optional(),costUsd:e.number().nonnegative().nullable().optional(),evaluatedCount:e.number().int().nonnegative().optional(),failedCount:e.number().int().nonnegative().optional(),qualityFailureCount:e.number().int().nonnegative().optional(),executionFailureCount:e.number().int().nonnegative().optional(),ungradedCount:e.number().int().nonnegative().optional(),rows:e.array(e.object({id:u,label:e.string(),detail:e.string(),score:e.number().nullable().optional()})).max(10)}).strict(),Z=e.object({id:u,ordinal:e.number().int().positive(),name:e.string().trim().min(1).max(500),dataset:v.nullable(),evaluationModel:e.string().min(1).max(500).optional(),executionLocation:e.enum(["local","cloud"]).optional(),graders:e.array(v),selectedGraderId:u.nullable(),runs:e.array(v),selectedRunId:u.nullable(),training:e.array(Y).optional(),selectedTrainingKey:e.string().max(4e3).nullable().optional(),selectedTrainingJobId:u.nullable().optional(),turnIds:e.array(u),operationId:u,createdAt:e.iso.datetime(),updatedAt:e.iso.datetime()}).strict(),de=Z.extend({ordinal:e.null()}),He=e.object({datasetFocus:de.optional(),scopes:e.array(Z),activeScopeId:u.nullable(),selectionVersion:e.number().int().nonnegative(),selectedAt:e.iso.datetime().nullable(),selectionOperations:e.record(e.string(),e.object({hash:x,version:e.number().int().nonnegative(),visualPublicationId:e.string().optional(),resource:v.optional()}).strict()).default({})}).strict();var Ne=e.object({action:e.enum(["schema","list","read","create","save","file","validate","check_graders","check_sources","package","import","inspect_source","import_source","upload","sync","pause_sync","disconnect_sync","related_chats","list_graders","read_grader","save_grader","test_grader","publish"]),id:u.optional(),operationId:u.optional(),expectedRevision:e.number().int().nonnegative().optional(),payload:e.record(e.string(),e.unknown()).default({})}).strict(),qe=e.object({contentHash:x,scope:e.string(),graders:e.unknown(),cases:e.array(e.object({id:u,taskId:u,seed:e.string(),status:e.string(),output:e.string().nullable(),error:e.string().nullable(),score:e.number().nullable()}).strict()).max(1e4)}).strict();function ee(r){let s=r&&typeof r=="object"?r:{},a=[s.summary,...Array.isArray(s.summaries)?s.summaries:[]].flatMap(t=>{let c=v.safeParse(t);return c.success?[c.data]:[]});if(a.length){for(let t of a)console.log(`${t.name} \xB7 ${t.state}`),console.log(`${t.id} \xB7 ${t.location??"local"} \xB7 Dataset ${t.datasetId} version ${t.datasetRevision} \xB7 ${t.model}`),console.log(`${t.scoreLabel??"Mean task score"}: ${t.score==null?"Unavailable":(t.score*100).toFixed(1)+"%"} \xB7 Graded: ${t.evaluatedCount??0}/${t.taskCount??0} \xB7 Cost: ${t.costUsd==null?"Unavailable":"$"+t.costUsd.toFixed(4)}`),console.log(`Quality failures: ${t.qualityFailureCount??0} \xB7 Execution failures: ${t.executionFailureCount??0} \xB7 Ungraded: ${t.ungradedCount??t.taskCount??0}`),t.rows.length&&console.table(t.rows.map(c=>({Task:c.label,Outcome:c.detail,Score:c.score==null?"Unavailable":(c.score*100).toFixed(1)+"%"}))),console.log(`Results: openpond experiments result ${t.id} --local`);Array.isArray(s.items)&&console.table(s.items.flatMap(t=>{let c=C.safeParse(t);return c.success?[{ID:c.data.id,Name:c.data.configuration.request.name,Model:c.data.model.modelId,Status:c.data.status}]:[]}));for(let t of Array.isArray(s.errors)?s.errors:[])console.log(`Admission failed: ${t.modelId} \xB7 ${t.message}`);return}if(Array.isArray(s.models)){console.table(s.models);return}if(Array.isArray(s.items)){console.table(s.items.flatMap(t=>{let c=C.safeParse(t);return c.success?[{ID:c.data.id,Name:c.data.configuration.request.name,Model:c.data.model.modelId,Status:c.data.status}]:[]}));return}console.log(JSON.stringify(r,null,2))}w(ee,"printLocalExperimentResult");import{readFile as ue,stat as pe}from"node:fs/promises";var H={"profile-catalog":"/v1/profile/evaluations","prepare-profile":"/v1/profile/evaluations/prepare","run-profile":"/v1/profile/evaluations/run","inspect-profile":"/v1/profile/evaluations/discover"};async function te(r,s){let a=s[0];if(!a||!Object.hasOwn(H,a))return!1;if(s.length!==1||r.team||r.revision||r.contentHash)throw new Error("Profile experiments accept one action and exact selection in --input-file; ownership is resolved by the running installation.");let t=new URL(n(r,"serverUrl")||process.env.OPENPOND_LOCAL_API_URL||k);if(t.protocol!=="http:"||!["localhost","127.0.0.1"].includes(t.hostname)||t.username||t.password||t.search||t.hash||t.pathname!=="/")throw new Error("Local Profile experiments require an HTTP loopback server origin.");let c=n(r,"inputFile"),h;if(c){let l=await pe(c);if(!l.isFile()||l.size>1048576)throw new Error("Profile selection input must be a file within one MiB.");let S=JSON.parse(await ue(c,"utf8"));if(!S||typeof S!="object"||Array.isArray(S))throw new Error("Profile selection input must be an object.");h=S}else if(a!=="profile-catalog")throw new Error(`${a} requires --input-file with the exact Profile or run selection.`);let b=a==="profile-catalog"&&h?H["inspect-profile"]:H[a],i=await(await A(t.origin,{maximumResponseBytes:32*1024*1024,timeoutMs:a==="run-profile"||a==="prepare-profile"?12e5:6e4}))(new URL(b,t),{method:h?"POST":"GET",...h?{headers:{"content-type":"application/json"},body:JSON.stringify({...h,...["prepare-profile","run-profile","inspect-profile"].includes(a)&&process.env.OPENPOND_CHAT_INVOCATION?{invocationToken:process.env.OPENPOND_CHAT_INVOCATION}:{}})}:{}}),o=await i.json();if(!i.ok){let l=o&&typeof o=="object"&&"error"in o?o.error:void 0;throw new Error(typeof l=="string"?l:`Local Profile experiment request failed (${i.status}).`)}return console.log(JSON.stringify(o,null,2)),!0}w(te,"runLocalProfileExperimentCommand");async function re(r,s){if(await te(r,s))return;let[a,t,c]=s,h=n(r,"team"),b=n(r,"receiptId");if(a==="case"&&(!t||s.length!==2||!b))throw new Error("Usage: experiments case <run-id> --local --receipt-id <retained-receipt-id> [--after-sequence <n>] [--limit <1..500>] --json. A task id is not a receipt id; find receiptId in experiments result <run-id> --local --json (independent runs: evidence.cases[].receiptId).");if(r.revision!==void 0)throw new Error("A local Experiment is one immutable run; read it by id rather than a saved configuration revision.");if(a!=="read"&&r.contentHash!==void 0)throw new Error("An exact configuration hash requires the local read action.");if(!a||s.length>(a==="compare"?3:2))throw new Error("Local Experiments require an action; use --server-url for an existing local server.");let d=n(r,"serverUrl")||process.env.OPENPOND_LOCAL_API_URL||k,i=new URL(d);if(i.protocol!=="http:"||!["localhost","127.0.0.1"].includes(i.hostname)||i.username||i.password||i.search||i.hash||i.pathname!=="/")throw new Error("Local Experiments require an HTTP loopback server origin.");let o=await A(i.origin,{timeoutMs:["prepare-harness","run"].includes(a)?12e5:6e4});async function l(f,g){let p=await o(new URL(h?"/v1/local-experiments":"/v1/chat-experiments",i),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({...h?{teamId:h}:{},...process.env.OPENPOND_CHAT_INVOCATION?{invocationToken:process.env.OPENPOND_CHAT_INVOCATION}:{},action:f,payload:g})}),I=await p.json();if(!p.ok)throw new Error(typeof I.error=="string"?I.error:`Local Experiment request failed (${p.status}).`);return I}w(l,"command");async function S(){let f=n(r,"inputFile");if(!f||!(await ae(f)).isFile()||(await ae(f)).size>67108864)throw new Error("Provide a bounded --input-file with exact local configuration and retained package bytes.");return JSON.parse(await me(f,"utf8"))}w(S,"input");let m;if(!h){if(a==="models")m=await l("models",{});else if(a==="run"||a==="run-cloud")m=await l(a.replaceAll("-","_"),await S());else if(a==="list"){let f=n(r,"afterId"),g=n(r,"limit");m=await l("list",{...f?{afterId:f}:{},...g?{limit:Number(g)}:{}})}else if(a==="compare"&&t&&c)m=await l("compare",{baselineId:t,candidateId:c});else if(a==="case"&&t&&b){let f=n(r,"afterSequence"),g=n(r,"limit");m=await l("case",{id:t,receiptId:b,...f?{afterSequence:Number(f)}:{},...g?{limit:Number(g)}:{}})}else if(t&&["read","status","cancel","result"].includes(a))m=await l(a,{id:t});else throw new Error("Independent local Experiments support models/run/list/read/status/cancel/result/compare/case. Workspace operations require --team.");q(r.json)?console.log(JSON.stringify(m,null,2)):ee(m);return}if(a==="prepare-harness"){if(t)throw new Error("Local Profile preparation accepts --input-file rather than an id.");m=await l("prepareHarness",await S())}else if(a==="run"){if(t)throw new Error("Local Run accepts reviewed configuration through --input-file rather than an id.");let f=await S();m=await l(f.package?"run":"runFromRelease",f)}else if(a==="list"){if(t)throw new Error("Local List does not accept an id.");let f=n(r,"status"),g=n(r,"limit"),p=n(r,"project"),I=n(r,"afterId"),R=n(r,"datasetHash"),N=n(r,"search");m=await l("list",{...f?{status:f}:{},...p?{projectId:p}:{},...R?{datasetHash:R}:{},...N?{search:N}:{},...I?{afterId:I}:{},...g?{limit:Number(g)}:{}})}else{if(!t)throw new Error(`${a} requires a local Experiment or scoring pass id.`);let f=n(r,"afterId"),g=n(r,"limit");if(a==="duplicate"){let p=n(r,"operationId");if(!p)throw new Error("Duplicate requires --operation-id for safe replay.");let I=C.parse(await l("read",{id:t})),R=J.parse({...I.configuration,operationId:p,request:{...I.configuration.request,operationId:p},sourceExperimentId:I.id});m=await l("runFromRelease",{configuration:R,expectedPackageHash:I.packageHash})}else if(a==="passes")m=await l("passes",{executionId:t,...f?{afterId:f}:{},...g?{limit:Number(g)}:{}});else if(a==="case"){let p=n(r,"afterSequence");m=await l("case",{id:t,receiptId:b,...p?{afterSequence:Number(p)}:{},...g?{limit:Number(g)}:{}})}else if(a==="score"){let p=await S();if(p.execution?.id!==t)throw new Error("Local scoring input belongs to a different retained execution.");m=await l("score",p)}else if(a==="compare"){if(!c)throw new Error("Local Compare requires baseline and candidate execution ids.");let p=Q.parse(await l("compare",{baselineId:t,candidateId:c}));m={...p,comparison:U(p.baseline,p.candidate)}}else if(a==="read"){let p=n(r,"contentHash");m=await l("read",{id:t,...p?{configurationHash:p}:{}})}else if(["status","cancel","result","pass"].includes(a))m=await l(a,{id:t});else if(a==="cancel-pass")m=await l("cancel",{id:t});else if(a==="pass-result")m=await l("result",{id:t});else throw new Error(`Local Experiment action is unavailable: ${a}`)}console.log(JSON.stringify(m,null,2))}w(re,"runLocalExperimentsCommand");async function lt(r,s){if(s[0]==="signal-plan"||s[0]==="signal-report")return(await import("./experiments-signal-TSTEBORD.js")).runExperimentsSignalCommand(r,s);if(r.local===!0||r.local==="true")return re(r,s);if(r.revision!==void 0||r.contentHash!==void 0)throw new Error("Experiments retain their immutable configuration on the run; definition revisions are not selectable.");let[a,t]=s,c=n(r,"team");if(!c||!a||s.length>(a==="compare"?3:2))throw new Error("usage: experiments <defaults|create-comparison|comparison-budget|prepare-harness|run|read|list|status|diagnostics|cancel|duplicate|score|passes|pass|cancel-pass|pass-result|result|compare|case> [id] [candidate-id] --team <id> [--input-file <path>] [--operation-id <id>]");let h=await B(),b={teamId:c,apiKey:await M(h,F(h)),baseUrl:D(r)??h.apiBaseUrl??$},d=new G(b),i;if(a==="defaults"){if(t)throw new Error("Defaults does not accept an id.");i=await d.defaults()}else if(a==="create-comparison"){let o=n(r,"inputFile");if(!o||t||(await O(o)).size>1048576)throw new Error("Create comparison requires a bounded input file with an id, fresh operationIds and optional maximumSpendUsd.");i=await d.createComparisonBudget(JSON.parse(await j(o,"utf8")))}else if(a==="comparison-budget"){if(!t)throw new Error("Comparison budget requires an id.");i=await d.comparisonBudget(t)}else if(a==="prepare-harness"){let o=n(r,"inputFile");if(!o||t||(await O(o)).size>1048576)throw new Error("Harness preparation requires a bounded --input-file with its released target, model and optional ceiling.");i=await d.prepareHarness(JSON.parse(await j(o,"utf8")))}else if(a==="run"){let o=n(r,"inputFile");if(!o||t)throw new Error("Run requires --input-file with the reviewed configuration and stable operationId.");if((await O(o)).size>1048576)throw new Error("Experiment input exceeds one MiB.");i=await d.run(JSON.parse(await j(o,"utf8")))}else if(a==="list"){if(t)throw new Error("List does not accept an Experiment id.");let o=n(r,"limit");i=await d.list(z.parse({projectId:n(r,"project")||void 0,datasetHash:n(r,"datasetHash")||void 0,search:n(r,"search")||void 0,status:n(r,"status")||void 0,afterId:n(r,"afterId")||void 0,...o?{limit:Number(o)}:{}}))}else{if(!t)throw new Error(`${a} requires an id.`);if(a==="read")i=await d.get(t);else if(a==="status")i=await d.get(t);else if(a==="diagnostics"){let o=await d.get(t),l=n(r,"afterSequence");i=await d.diagnostics(t,{manifestHash:o.manifest.contentHash,...l?{afterSequence:Number(l)}:{},afterCallId:n(r,"afterCallId")||void 0})}else if(a==="cancel")i=await d.cancel(t);else if(a==="duplicate"){let o=n(r,"operationId");if(!o)throw new Error("Duplicate requires a stable --operation-id for the new Experiment.");i=await d.duplicate(t,o)}else if(a==="score"){let o=n(r,"inputFile");if(!o||(await O(o)).size>1048576)throw new Error("Score requires --input-file containing an exact execution reference, grader releases and explicit ceiling, within one MiB.");let l=K.parse(JSON.parse(await j(o,"utf8")));if(l.execution.id!==t)throw new Error("Scoring input belongs to a different execution.");i=await d.score(l)}else if(a==="passes")i=await d.scoringPasses(t,{afterId:n(r,"afterId")||void 0});else if(a==="pass")i=await d.scoringPass(t);else if(a==="cancel-pass")i=await d.cancelScoringPass(t);else if(a==="pass-result")i=await d.scoringResult(t);else if(a==="result")i=await d.result(t);else if(a==="case"){let o=n(r,"receiptId");if(!o)throw new Error("Case inspection requires --receipt-id from the retained Experiment.");let l=await d.get(t);i=await new L(b).case(t,o,{manifestHash:l.manifest.contentHash,afterId:n(r,"afterId")||void 0})}else if(a==="compare"){if(!s[2])throw new Error("Compare requires a baseline and candidate execution id.");i=await d.compare(t,s[2])}else throw new Error(`Unknown Experiment action: ${a}`)}console.log(JSON.stringify(i,null,2))}w(lt,"runExperimentsCommand");export{lt as runExperimentsCommand};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{b as N,c as A}from"./chunk-TVDZXDQW.js";import"./chunk-I3NYYOSS.js";import"./chunk-7P5SH3CI.js";import"./chunk-TGULVWPV.js";import"./chunk-EW7CD7OA.js";import"./chunk-SQX22LQT.js";import"./chunk-XRKFTPHD.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{c as C}from"./chunk-3M53YXEI.js";import"./chunk-W45RKGM6.js";import"./chunk-7PKTCMZ6.js";import"./chunk-LXZLLTYQ.js";import"./chunk-SFR32TMJ.js";import"./chunk-5KJMFK65.js";import"./chunk-Y3B6ZUE6.js";import"./chunk-WLZJOCLA.js";import"./chunk-HIQPGYVH.js";import"./chunk-ZWW227M3.js";import"./chunk-DXA2UHBE.js";import"./chunk-MTP3B2SU.js";import"./chunk-CRDKBFRN.js";import"./chunk-DMO3UIS7.js";import"./chunk-27JGS3KB.js";import"./chunk-BT5YNE5U.js";import"./chunk-3WJQ4IGK.js";import"./chunk-KTIBXRWQ.js";import"./chunk-L4EJ5R3B.js";import"./chunk-6ZTP6CUJ.js";import"./chunk-TBODQT4W.js";import{O}from"./chunk-YRDPVTEI.js";import{p as F}from"./chunk-JRGECNP3.js";import"./chunk-RRWL5BHZ.js";import"./chunk-NXN7GJOH.js";import"./chunk-5WPMI6QX.js";import"./chunk-W7NXFRHN.js";import"./chunk-5HPZGLOL.js";import"./chunk-GLUWATL5.js";import"./chunk-UN2LKLGV.js";import"./chunk-2LJCJOJ7.js";import"./chunk-AMC4Z7G4.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-JCLTFDVW.js";import"./chunk-I6VMRQF4.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-G4E3WGLM.js";import{Ja as z,da as M}from"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-SH7POUVX.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import{n as i,o as _}from"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import{A as c}from"./chunk-X2J2P5ZT.js";import"./chunk-UGOK7VTC.js";import{a as x}from"./chunk-FTQLQJQV.js";import{readFile as $,stat as G}from"node:fs/promises";import{dirname as L,resolve as b}from"node:path";var H=c.string().regex(/^[a-f0-9]{64}$/),P=c.object({groupSize:c.number().int().min(2).max(100),minimumFamilies:c.number().int().min(2).max(1e3),minimumInformativeFamilies:c.number().int().min(2).max(1e3),minimumSpread:c.number().positive().max(1),minimumScoredFraction:c.number().positive().max(1)}).strict().refine(s=>s.minimumInformativeFamilies<=s.minimumFamilies,"Informative family requirement cannot exceed the minimum family population."),D=c.object({schemaVersion:c.literal("openpond.experimentSignalPlan.v1"),createdAt:c.iso.datetime(),preparation:F,packageHash:H,graders:c.array(M).min(1).max(100),tasks:c.array(c.object({id:c.string(),family:c.string(),taskHash:H,inputHash:H,contextHash:H}).strict()).min(1).max(1e4),thresholds:P}).strict(),j=D.extend({contentHash:H}).strict();function R(s){let n=j.parse(s),{contentHash:a,...p}=n;if(i(p)!==a)throw new Error("Signal plan content changed.");let{request:t,manifest:r,graders:m}=n.preparation;_(r,"Signal preparation manifest");let o=t.policy;if(o.kind!=="hosted_harness"||r.execution.kind!=="harness"||r.policy.kind!=="model"||r.runtimeTarget.placement!=="local"||r.gradingRole!=="evaluation"||i(r.profileEvaluation??null)!==i(o.source)||i(r.execution.harnessRelease)!==i(o.source.harnessRelease)||r.packageHash!==o.packageHash||r.policy.configurationHash!==o.modelConfigurationHash||r.policy.model.provider!=="openpond"||r.policy.model.model!==o.modelId||r.policy.model.revision!==null||r.policy.model.artifactHash!==(o.candidate?.contentHash??null)||r.policy.model.tokenizerRevision!==null||r.policy.model.chatTemplateHash!==null||r.tasksetRelease.id!==t.taskset.id||r.tasksetRelease.contentHash!==t.taskset.contentHash||i(r.population)!==i(t.population)||r.limits.maximumSpendUsd!==n.preparation.maximumCostUsd||r.metadata.profileRepositoryId!==void 0&&r.metadata.profileRepositoryId!==o.profileRepositoryId)throw new Error("Signal preparation differs from its native local source, package, model, budget or population.");for(let d of r.population){let g=o.source.externalDatasetBinding?[r.id,d.taskId,d.seed,d.fixtureId]:[r.id,d.taskId,d.seed];if(d.receiptId!==`evaluation-${i(g).slice(0,32)}`)throw new Error("Signal preparation receipt identity changed.")}if(t.policy.kind!=="hosted_harness"||t.policy.localRuntime||t.policy.packageHash!==n.packageHash)throw new Error("Signal plan requires the exact hosted-chat Harness package.");if(new Set(n.tasks.map(d=>d.id)).size!==n.tasks.length||new Set(m.map(d=>d.id)).size!==m.length||n.graders.length!==m.length)throw new Error("Signal plan contains duplicate or missing tasks/graders.");for(let[d,g]of n.graders.entries()){let f=m[d];if(f.id!==g.id||f.version!==g.version||f.contentHash!==i(g)||g.hardGate||!g.rewardEligible||g.weight<=0||g.taskIds||f.mappings?.length)throw new Error("Signal requires exact positive-weight reward graders, no hard gates, field mappings or task-specific grader subsets.")}let S=new Map;for(let d of t.population)S.set(d.taskId,(S.get(d.taskId)??0)+1);if(S.size!==n.tasks.length||n.tasks.some(d=>S.get(d.id)!==n.thresholds.groupSize))throw new Error("Every planned prompt must have exactly groupSize distinct seeded attempts.");if(new Set(n.tasks.map(d=>d.family)).size<n.thresholds.minimumFamilies)throw new Error("Signal population has too few independent source families.");return n}x(R,"verifySignalPlan");function T(s){let n=O(s.package),a=F.parse(s.preparation),p=new Set(a.request.population.map(o=>o.taskId)),t=n.taskset.tasks.filter(o=>p.has(o.id));if(t.length!==p.size||t.some(o=>o.split!=="train"))throw new Error("Signal probes require existing training tasks; validation/test/frozen holdouts cannot be reused.");if(a.request.taskset.id!==n.taskset.id||a.request.taskset.contentHash!==n.taskset.contentHash)throw new Error("Prepared taskset differs from the supplied package.");let r=a.graders.map(o=>{let S=n.taskset.graders.find(d=>d.id===o.id&&i(d)===o.contentHash);if(!S)throw new Error(`Selected grader is absent from the exact package: ${o.id}`);return S}),m=D.parse({schemaVersion:"openpond.experimentSignalPlan.v1",createdAt:s.createdAt??new Date().toISOString(),preparation:a,packageHash:n.contentHash,graders:r,tasks:t.map(o=>({id:o.id,family:o.clusterKey,taskHash:i(o),inputHash:i(o.input),contextHash:i(o.policyVisibleContext)})),thresholds:s.thresholds});return R({...m,contentHash:i(m)})}x(T,"createSignalPlan");function U(s){if(!s.length)return{count:0,min:null,max:null,mean:null,standardDeviation:null,spread:null};let n=s.reduce((a,p)=>a+p,0)/s.length;return{count:s.length,min:Math.min(...s),max:Math.max(...s),mean:n,standardDeviation:Math.sqrt(s.reduce((a,p)=>a+(p-n)**2,0)/s.length),spread:Math.max(...s)-Math.min(...s)}}x(U,"scoreDistribution");function V(s,n){let a=R(s),p=A.parse(n),t=N.parse(p.execution);if(i({execution:p.execution,cases:p.cases})!==p.contentHash)throw new Error("Signal result content changed.");if(t.packageHash!==a.packageHash||i(t.configuration.request)!==i(a.preparation.request)||i(t.graders)!==i(a.preparation.graders)||t.maximumCostUsd!==a.preparation.maximumCostUsd)throw new Error("Signal result differs from the frozen request, package, graders or budget.");if(Date.parse(t.createdAt)<Date.parse(a.createdAt))throw new Error("Signal plan must precede the execution.");let r=a.preparation.request.policy;if(r.kind!=="hosted_harness"||t.model.providerId!=="openpond"||t.model.modelId!==r.modelId||t.model.maxOutputTokens!==(r.maxOutputTokens??4096)||t.model.temperature!==(r.temperature??0)||t.model.topP!==(r.topP??1))throw new Error("Signal execution model or sampling differs from the frozen policy.");for(let e of["pending","running","completed","failed","cancelled","unknown"])if(t.counts[e]!==p.cases.filter(w=>w.status===e).length)throw new Error("Signal execution counts differ from its cases.");let m=new Map(a.preparation.request.population.map(e=>[e.receiptId,e]));if(p.cases.length!==m.size||new Set(p.cases.map(e=>e.receiptId)).size!==m.size)throw new Error("Signal result omits or duplicates planned attempts.");let o=new Map(a.tasks.map(e=>[e.id,e])),S=i(a.preparation.graders);for(let e of p.cases){let w=m.get(e.receiptId),k=o.get(e.taskId);if(!w||!k||w.taskId!==e.taskId||w.seed!==e.seed||i(e.input)!==k.inputHash||i(e.policyVisibleContext)!==k.contextHash)throw new Error("Signal case differs from its frozen prompt, context or seed.");if(e.status==="completed"&&(!e.profileNative||e.output===null||e.profileNative.modelConfigurationHash!==t.model.configurationHash||i(e.profileNative.source)!==i(r.source)||e.profileNative.outputHash!==i(e.output)))throw new Error("Signal case lacks matching native source, model or output evidence.");if(!e.grade)continue;if(e.grade.selectionHash!==S)throw new Error("Signal grade uses different selected graders.");if(e.grade.grades.some(u=>u.taskHash!==k.taskHash)||new Set(e.grade.grades.map(u=>u.evidenceHash)).size!==1)throw new Error("Signal criterion belongs to another prompt or inconsistent attempt evidence.");let y=e.grade.grades.flatMap(u=>u.components),E=z({graders:a.graders,components:y});for(let u of["score","passed","rewardEligible","gradingStatus","failureClass"])if(e.grade[u]!==E[u])throw new Error("Signal score differs from retained components and frozen weights.");for(let u of e.grade.grades){let l=a.graders.find(h=>h.id===u.components[0]?.graderId);if(u.graderSetHash!==i([l]))throw new Error("Signal criterion specification changed.");let I=z({graders:[l],components:u.components});for(let h of["score","passed","rewardEligible","gradingStatus","failureClass"])if(u[h]!==I[h])throw new Error("Signal criterion summary differs from its evidence.")}}let d=a.tasks.map(e=>{let w=p.cases.filter(l=>l.taskId===e.id),k=w.filter(l=>l.status==="completed"&&l.grade?.gradingStatus==="scored"&&l.grade.rewardEligible&&l.grade.score!==null),y=U(k.map(l=>l.grade.score)),E=k.length/w.length,u=a.graders.map(l=>({id:l.id,weight:l.weight,distribution:U(k.flatMap(I=>I.grade.grades.flatMap(h=>h.components).filter(h=>h.graderId===l.id&&h.rewardEligible&&h.score!==null).map(h=>h.score)))}));return{taskId:e.id,family:e.family,attempts:w.length,eligible:k.length,scoredFraction:E,combined:y,components:u,constant:y.spread!==null&&y.spread<=Number.EPSILON,uniqueOutputs:new Set(w.filter(l=>l.output!==null).map(l=>i(l.output))).size,informative:E>=a.thresholds.minimumScoredFraction&&(y.spread??0)>=a.thresholds.minimumSpread,outcomes:w.map(l=>({receiptId:l.receiptId,seed:l.seed,status:l.status,gradingStatus:l.grade?.gradingStatus??null,failureClass:l.grade?.failureClass??null,rewardEligible:l.grade?.rewardEligible??!1,score:l.grade?.score??null}))}}),g=[...new Set(d.filter(e=>e.informative).map(e=>e.family))],f=[];(t.status!=="completed"||!t.cleanupComplete)&&f.push("execution_or_local_cleanup_incomplete"),(t.usage.uncertainRequests||t.usage.costUsd===null||t.usage.heldUsd)&&f.push("cost_or_reservations_unsettled"),d.some(e=>e.scoredFraction<a.thresholds.minimumScoredFraction)&&f.push("insufficient_scored_coverage"),g.length<a.thresholds.minimumInformativeFamilies&&f.push("insufficient_within_prompt_signal");let q={schemaVersion:"openpond.experimentSignalReport.v1",planHash:a.contentHash,resultHash:p.contentHash,executionId:t.id,model:t.model,thresholds:a.thresholds,groups:d,informativeFamilies:g,usage:t.usage,cleanupComplete:t.cleanupComplete,blockers:f,signalObserved:f.length===0,trainingAuthorized:!1,runtimeParityVerified:!1,limitations:["Offline hashes bind supplied evidence; they do not authenticate it or prove source-family independence. Full grade evidence hashes require the retained trace/artifacts to independently reconstruct.","Local signal does not prove learner identity, GPU runtime/tokenizer parity, no-update behavior or provider deletion.","Review rates, private gold, fixture calibration, family exposure and the unchanged-parent noise control before training."]};return{...q,contentHash:i(q)}}x(V,"createSignalReport");async function v(s,n=64*1024*1024){if((await G(s)).size>n)throw new Error(`Signal input exceeds ${n} bytes: ${s}`);return JSON.parse(await $(s,"utf8"))}x(v,"readJson");async function pe(s,n){let a=C(s,"inputFile");if(!a||n.length!==1)throw new Error("usage: experiments <signal-plan|signal-report> --input-file <path>");let p=await v(a,1048576),t=L(b(a)),r;if(n[0]==="signal-plan"){let m=c.object({packageFile:c.string().min(1),preparationFile:c.string().min(1),thresholds:P}).strict().parse(p);r=T({package:await v(b(t,m.packageFile)),preparation:await v(b(t,m.preparationFile)),thresholds:m.thresholds})}else{let m=c.object({planFile:c.string().min(1),resultFile:c.string().min(1)}).strict().parse(p);r=V(await v(b(t,m.planFile)),await v(b(t,m.resultFile)))}console.log(JSON.stringify(r,null,2))}x(pe,"runExperimentsSignalCommand");export{pe as runExperimentsSignalCommand};
@@ -1,4 +1,4 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{f as z}from"./chunk-3M53YXEI.js";import{a as L,x as se}from"./chunk-T6JN4PND.js";import"./chunk-JEISPWWM.js";import"./chunk-BT5YNE5U.js";import"./chunk-UTNGEMW5.js";import"./chunk-6FA3GG5B.js";import{f as F}from"./chunk-2EPR4HLF.js";import"./chunk-BKEDG3A4.js";import"./chunk-OE22TAXP.js";import{f as ne,h as q,r as D,t as ie}from"./chunk-UGOK7VTC.js";import"./chunk-VVNV4NNW.js";import{A as c}from"./chunk-PF56N7ZY.js";import{a as r}from"./chunk-FTQLQJQV.js";var u=class extends Error{static{r(this,"GithubExtensionError")}code;status;constructor(t,i){super(t),this.name="GithubExtensionError",this.code=i.code,this.status=i.status??400}};import{createHash as de}from"node:crypto";import B from"node:path";var oe="HEAD",re=64,ae=512,ue=20*1024*1024,V=5*1024*1024,pe=8,Ge=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,le=/^[A-Za-z0-9_.-]+$/,ce=new Set(["agents","assets","references","scripts"]);function he(e={}){let t=e.fetch??fetch,i=e.githubToken?.trim()||process.env.GITHUB_TOKEN?.trim()||process.env.GH_TOKEN?.trim()||null;return{async resolve(n){let s=await Ie(n,t,i);return{preview:await Ae(s,t,i),files:ge(s)}},async download(n,s){await Me({resolution:n,fetchImpl:t,githubToken:i,writeFile:s})}}}r(he,"createGithubSourceClient");function k(e){let t=e.trim(),i="",n="";if(/^(?:https?:\/\/)?github\.com\//i.test(t)){let l=new URL(t.startsWith("http")?t:`https://${t}`);if(l.hostname.toLowerCase()!=="github.com")throw M(e);let a=l.pathname.replace(/^\/+|\/+$/g,"").split("/");if(a.length!==2)throw M(e);[i="",n=""]=a}else{let a=t.replace(/^github:/i,"").replace(/^\/+|\/+$/g,"").split("/");if(a.length!==2)throw M(e);[i="",n=""]=a}if(n=n.replace(/\.git$/i,""),!le.test(i)||!le.test(n))throw M(e);let s=i.toLowerCase(),o=n.toLowerCase();return{id:`github:${s}/${o}`,owner:s,repo:o,repositoryUrl:`https://github.com/${s}/${o}`}}r(k,"parseGithubExtensionSource");async function Ie(e,t,i){let n=k(e.source),s=e.ref?.trim()||oe,o=await K(t,i,`/repos/${n.owner}/${n.repo}`),l=s===oe?o.default_branch?.trim()||"main":s,a=await K(t,i,`/repos/${n.owner}/${n.repo}/commits/${encodeURIComponent(l)}`),w=a.sha?.trim(),b=a.commit?.tree?.sha?.trim();if(!w||!b)throw new u("GitHub returned an incomplete commit response.",{code:"github_invalid_commit",status:502});let P=await K(t,i,`/repos/${n.owner}/${n.repo}/git/trees/${b}?recursive=1`);if(P.truncated)throw new u("The GitHub repository tree is too large to install safely.",{code:"github_tree_truncated"});let S=(P.tree??[]).filter(je),x=Ce(S);if(x.length===0)throw new u("No skills found. Add SKILL.md at the repository root or use a standard agent skills directory.",{code:"extension_no_skills"});if(x.length>re)throw new u(`Extension contains more than ${re} skills.`,{code:"extension_too_many_skills"});He(x);let A=S.find(g=>g.type==="blob"&&/^readme(?:\.[^/]+)?$/i.test(g.path))??null;return{identity:n,requestedRef:s,resolvedCommit:w,tree:S,skillPackages:x,readme:A}}r(Ie,"resolveSource");async function Ae(e,t,i){let n=await we(e.skillPackages,pe,async a=>{let w=await Ne(e,a.entry,t,i);return Te(a,w)}),s=qe(n.map(a=>a.name));for(let a of n)s.has(a.name)&&(a.validationStatus="error",a.validationMessages=[...a.validationMessages,`Duplicate skill name: ${a.name}`]);let o=n.flatMap(a=>a.validationMessages.map(w=>`${a.relativePath}: ${w}`)),l=ge(e);return{...e.identity,source:"github",requestedRef:e.requestedRef,resolvedCommit:e.resolvedCommit,sourcePath:null,readmePath:e.readme?.path??null,packageHash:Ue(l),skills:n.sort((a,w)=>a.name.localeCompare(w.name)),validationStatus:o.length===0?"valid":"error",validationMessages:o}}r(Ae,"buildPreview");function Te(e,t){let i=L(t),n=e.root==="."?null:B.posix.basename(e.root),s=i.name??n??"invalid-skill",o=[...i.messages];Ge.test(s)||o.push("Skill name must be lowercase kebab-case."),n&&s!==n&&o.push(`Skill name must match its directory name (${n}).`);let l=e.files.filter(a=>a.path!==e.entry.path).map(a=>ze(e.root,a.path)).sort();return{name:s,description:i.description??"",relativePath:e.root==="."?"SKILL.md":`${e.root}/SKILL.md`,sourcePath:"",charCount:t.length,sourceHash:de("sha256").update(t).digest("hex"),resourceFiles:l,validationStatus:o.length===0?"valid":"error",validationMessages:[...new Set(o)]}}r(Te,"previewSkill");function Ce(e){let t=[],i=e.find(a=>a.type==="blob"&&a.path==="SKILL.md");i&&t.push({root:".",entry:i});let n=e.filter(a=>a.type==="blob"&&a.path.endsWith("/SKILL.md")),s=n.filter(a=>Le(a.path)),o=s.length>0?s:n,l=new Set(o.map(a=>B.posix.dirname(a.path)));for(let a of o){let w=B.posix.dirname(a.path);[...l].some(b=>b!==w&&w.startsWith(`${b}/`))||t.push({root:w,entry:a})}return t.map(({root:a,entry:w})=>{let b=e.filter(x=>{if(x.type!=="blob")return!1;if(a!==".")return x.path.startsWith(`${a}/`);if(x.path==="SKILL.md")return!0;let A=x.path.split("/",1)[0]??"";return ce.has(A)}),P=e.find(x=>x.type!=="blob"&&x.type!=="tree"&&(a==="."?x.path==="SKILL.md"||ce.has(x.path.split("/",1)[0]??""):x.path.startsWith(`${a}/`))),S=b.find(x=>x.mode==="120000");if(P||S)throw new u(`Skill package ${a} contains a symlink or submodule.`,{code:"extension_unsafe_entry"});return{root:a,entry:w,files:b}})}r(Ce,"discoverSkillPackages");function Le(e){let t=e.split("/");if(t.at(-1)!=="SKILL.md")return!1;let i=t.slice(0,-1);if(i.length<2)return!1;let n=i.lastIndexOf("skills");if(n<0||n>2)return!1;let s=i.slice(0,n),o=i.slice(n+1);if(o.length<1||o.length>2)return!1;if(n===0)return!0;let l=s[0]??"";return l.startsWith(".")||l==="agent"||l==="data"}r(Le,"isStandardAgentSkillsPath");function ge(e){let t=new Map;e.readme&&t.set(e.readme.path,e.readme);for(let i of e.skillPackages)for(let n of i.files)t.set(n.path,n);return[...t.values()].sort((i,n)=>i.path.localeCompare(n.path))}r(ge,"filesToDownload");async function Me(e){let t=0;await we(e.resolution.files,pe,async i=>{let n=await fe({owner:e.resolution.preview.owner,repo:e.resolution.preview.repo,commit:e.resolution.preview.resolvedCommit,file:i,fetchImpl:e.fetchImpl,githubToken:e.githubToken});if(t+=n.byteLength,t>ue)throw new u("Extension download exceeds the maximum allowed size.",{code:"extension_too_large"});await e.writeFile(i.path,n,i.mode==="100755")})}r(Me,"downloadFiles");async function Ne(e,t,i,n){let s=await fe({owner:e.identity.owner,repo:e.identity.repo,commit:e.resolvedCommit,file:t,fetchImpl:i,githubToken:n});return new TextDecoder("utf-8",{fatal:!0}).decode(s)}r(Ne,"downloadText");async function fe(e){let t=e.file.path.split("/").map(encodeURIComponent).join("/"),i=`https://raw.githubusercontent.com/${e.owner}/${e.repo}/${e.commit}/${t}`,n=await e.fetchImpl(i,{headers:me(e.githubToken,"application/vnd.github.raw"),redirect:"follow"});if(!n.ok)throw new u(`GitHub file download failed (${n.status}): ${e.file.path}`,{code:"github_download_failed",status:n.status});let s=Number(n.headers.get("content-length"));if(Number.isFinite(s)&&s>V)throw new u(`Extension file is too large: ${e.file.path}`,{code:"extension_file_too_large"});let o=new Uint8Array(await n.arrayBuffer());if(o.byteLength>V)throw new u(`Extension file is too large: ${e.file.path}`,{code:"extension_file_too_large"});return o}r(fe,"downloadBytes");async function K(e,t,i){let n=await e(`https://api.github.com${i}`,{headers:me(t,"application/vnd.github+json")});if(!n.ok){let s=await n.json().catch(()=>null),o=typeof s?.message=="string"?`: ${s.message}`:"";throw new u(`GitHub request failed (${n.status})${o}`,{code:n.status===404?"github_repository_not_found":"github_request_failed",status:n.status})}return await n.json()}r(K,"githubJson");function me(e,t){let i=new Headers({Accept:t,"User-Agent":"openpond-extension-installer","X-GitHub-Api-Version":"2022-11-28"});return e&&i.set("Authorization",`Bearer ${e}`),i}r(me,"githubHeaders");function He(e){let t=new Map;for(let n of e)for(let s of n.files)t.set(s.path,s);if(t.size>ae)throw new u(`Extension contains more than ${ae} skill files.`,{code:"extension_too_many_files"});let i=0;for(let n of t.values()){if((n.size??0)>V)throw new u(`Extension file is too large: ${n.path}`,{code:"extension_file_too_large"});i+=n.size??0}if(i>ue)throw new u("Extension exceeds the maximum allowed size.",{code:"extension_too_large"})}r(He,"validateDownloadLimits");function je(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.path=="string"&&!t.path.startsWith("/")&&!t.path.split("/").includes("..")&&typeof t.mode=="string"&&(t.type==="blob"||t.type==="tree"||t.type==="commit")&&typeof t.sha=="string"}r(je,"validTreeEntry");function Ue(e){let t=de("sha256");for(let i of e)t.update(`${i.path}\0${i.sha}\0${i.size??""}
2
+ import{f as z}from"./chunk-3M53YXEI.js";import{a as L,x as se}from"./chunk-EBOTNBUS.js";import"./chunk-PWKJ5KLZ.js";import"./chunk-BT5YNE5U.js";import"./chunk-3WJQ4IGK.js";import"./chunk-6FA3GG5B.js";import{f as F}from"./chunk-SH7POUVX.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import{A as c}from"./chunk-X2J2P5ZT.js";import{f as ne,h as q,r as D,t as ie}from"./chunk-UGOK7VTC.js";import{a as r}from"./chunk-FTQLQJQV.js";var u=class extends Error{static{r(this,"GithubExtensionError")}code;status;constructor(t,i){super(t),this.name="GithubExtensionError",this.code=i.code,this.status=i.status??400}};import{createHash as de}from"node:crypto";import B from"node:path";var oe="HEAD",re=64,ae=512,ue=20*1024*1024,V=5*1024*1024,pe=8,Ge=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,le=/^[A-Za-z0-9_.-]+$/,ce=new Set(["agents","assets","references","scripts"]);function he(e={}){let t=e.fetch??fetch,i=e.githubToken?.trim()||process.env.GITHUB_TOKEN?.trim()||process.env.GH_TOKEN?.trim()||null;return{async resolve(n){let s=await Ie(n,t,i);return{preview:await Ae(s,t,i),files:ge(s)}},async download(n,s){await Me({resolution:n,fetchImpl:t,githubToken:i,writeFile:s})}}}r(he,"createGithubSourceClient");function k(e){let t=e.trim(),i="",n="";if(/^(?:https?:\/\/)?github\.com\//i.test(t)){let l=new URL(t.startsWith("http")?t:`https://${t}`);if(l.hostname.toLowerCase()!=="github.com")throw M(e);let a=l.pathname.replace(/^\/+|\/+$/g,"").split("/");if(a.length!==2)throw M(e);[i="",n=""]=a}else{let a=t.replace(/^github:/i,"").replace(/^\/+|\/+$/g,"").split("/");if(a.length!==2)throw M(e);[i="",n=""]=a}if(n=n.replace(/\.git$/i,""),!le.test(i)||!le.test(n))throw M(e);let s=i.toLowerCase(),o=n.toLowerCase();return{id:`github:${s}/${o}`,owner:s,repo:o,repositoryUrl:`https://github.com/${s}/${o}`}}r(k,"parseGithubExtensionSource");async function Ie(e,t,i){let n=k(e.source),s=e.ref?.trim()||oe,o=await K(t,i,`/repos/${n.owner}/${n.repo}`),l=s===oe?o.default_branch?.trim()||"main":s,a=await K(t,i,`/repos/${n.owner}/${n.repo}/commits/${encodeURIComponent(l)}`),w=a.sha?.trim(),b=a.commit?.tree?.sha?.trim();if(!w||!b)throw new u("GitHub returned an incomplete commit response.",{code:"github_invalid_commit",status:502});let P=await K(t,i,`/repos/${n.owner}/${n.repo}/git/trees/${b}?recursive=1`);if(P.truncated)throw new u("The GitHub repository tree is too large to install safely.",{code:"github_tree_truncated"});let S=(P.tree??[]).filter(je),x=Ce(S);if(x.length===0)throw new u("No skills found. Add SKILL.md at the repository root or use a standard agent skills directory.",{code:"extension_no_skills"});if(x.length>re)throw new u(`Extension contains more than ${re} skills.`,{code:"extension_too_many_skills"});He(x);let A=S.find(g=>g.type==="blob"&&/^readme(?:\.[^/]+)?$/i.test(g.path))??null;return{identity:n,requestedRef:s,resolvedCommit:w,tree:S,skillPackages:x,readme:A}}r(Ie,"resolveSource");async function Ae(e,t,i){let n=await we(e.skillPackages,pe,async a=>{let w=await Ne(e,a.entry,t,i);return Te(a,w)}),s=qe(n.map(a=>a.name));for(let a of n)s.has(a.name)&&(a.validationStatus="error",a.validationMessages=[...a.validationMessages,`Duplicate skill name: ${a.name}`]);let o=n.flatMap(a=>a.validationMessages.map(w=>`${a.relativePath}: ${w}`)),l=ge(e);return{...e.identity,source:"github",requestedRef:e.requestedRef,resolvedCommit:e.resolvedCommit,sourcePath:null,readmePath:e.readme?.path??null,packageHash:Ue(l),skills:n.sort((a,w)=>a.name.localeCompare(w.name)),validationStatus:o.length===0?"valid":"error",validationMessages:o}}r(Ae,"buildPreview");function Te(e,t){let i=L(t),n=e.root==="."?null:B.posix.basename(e.root),s=i.name??n??"invalid-skill",o=[...i.messages];Ge.test(s)||o.push("Skill name must be lowercase kebab-case."),n&&s!==n&&o.push(`Skill name must match its directory name (${n}).`);let l=e.files.filter(a=>a.path!==e.entry.path).map(a=>ze(e.root,a.path)).sort();return{name:s,description:i.description??"",relativePath:e.root==="."?"SKILL.md":`${e.root}/SKILL.md`,sourcePath:"",charCount:t.length,sourceHash:de("sha256").update(t).digest("hex"),resourceFiles:l,validationStatus:o.length===0?"valid":"error",validationMessages:[...new Set(o)]}}r(Te,"previewSkill");function Ce(e){let t=[],i=e.find(a=>a.type==="blob"&&a.path==="SKILL.md");i&&t.push({root:".",entry:i});let n=e.filter(a=>a.type==="blob"&&a.path.endsWith("/SKILL.md")),s=n.filter(a=>Le(a.path)),o=s.length>0?s:n,l=new Set(o.map(a=>B.posix.dirname(a.path)));for(let a of o){let w=B.posix.dirname(a.path);[...l].some(b=>b!==w&&w.startsWith(`${b}/`))||t.push({root:w,entry:a})}return t.map(({root:a,entry:w})=>{let b=e.filter(x=>{if(x.type!=="blob")return!1;if(a!==".")return x.path.startsWith(`${a}/`);if(x.path==="SKILL.md")return!0;let A=x.path.split("/",1)[0]??"";return ce.has(A)}),P=e.find(x=>x.type!=="blob"&&x.type!=="tree"&&(a==="."?x.path==="SKILL.md"||ce.has(x.path.split("/",1)[0]??""):x.path.startsWith(`${a}/`))),S=b.find(x=>x.mode==="120000");if(P||S)throw new u(`Skill package ${a} contains a symlink or submodule.`,{code:"extension_unsafe_entry"});return{root:a,entry:w,files:b}})}r(Ce,"discoverSkillPackages");function Le(e){let t=e.split("/");if(t.at(-1)!=="SKILL.md")return!1;let i=t.slice(0,-1);if(i.length<2)return!1;let n=i.lastIndexOf("skills");if(n<0||n>2)return!1;let s=i.slice(0,n),o=i.slice(n+1);if(o.length<1||o.length>2)return!1;if(n===0)return!0;let l=s[0]??"";return l.startsWith(".")||l==="agent"||l==="data"}r(Le,"isStandardAgentSkillsPath");function ge(e){let t=new Map;e.readme&&t.set(e.readme.path,e.readme);for(let i of e.skillPackages)for(let n of i.files)t.set(n.path,n);return[...t.values()].sort((i,n)=>i.path.localeCompare(n.path))}r(ge,"filesToDownload");async function Me(e){let t=0;await we(e.resolution.files,pe,async i=>{let n=await fe({owner:e.resolution.preview.owner,repo:e.resolution.preview.repo,commit:e.resolution.preview.resolvedCommit,file:i,fetchImpl:e.fetchImpl,githubToken:e.githubToken});if(t+=n.byteLength,t>ue)throw new u("Extension download exceeds the maximum allowed size.",{code:"extension_too_large"});await e.writeFile(i.path,n,i.mode==="100755")})}r(Me,"downloadFiles");async function Ne(e,t,i,n){let s=await fe({owner:e.identity.owner,repo:e.identity.repo,commit:e.resolvedCommit,file:t,fetchImpl:i,githubToken:n});return new TextDecoder("utf-8",{fatal:!0}).decode(s)}r(Ne,"downloadText");async function fe(e){let t=e.file.path.split("/").map(encodeURIComponent).join("/"),i=`https://raw.githubusercontent.com/${e.owner}/${e.repo}/${e.commit}/${t}`,n=await e.fetchImpl(i,{headers:me(e.githubToken,"application/vnd.github.raw"),redirect:"follow"});if(!n.ok)throw new u(`GitHub file download failed (${n.status}): ${e.file.path}`,{code:"github_download_failed",status:n.status});let s=Number(n.headers.get("content-length"));if(Number.isFinite(s)&&s>V)throw new u(`Extension file is too large: ${e.file.path}`,{code:"extension_file_too_large"});let o=new Uint8Array(await n.arrayBuffer());if(o.byteLength>V)throw new u(`Extension file is too large: ${e.file.path}`,{code:"extension_file_too_large"});return o}r(fe,"downloadBytes");async function K(e,t,i){let n=await e(`https://api.github.com${i}`,{headers:me(t,"application/vnd.github+json")});if(!n.ok){let s=await n.json().catch(()=>null),o=typeof s?.message=="string"?`: ${s.message}`:"";throw new u(`GitHub request failed (${n.status})${o}`,{code:n.status===404?"github_repository_not_found":"github_request_failed",status:n.status})}return await n.json()}r(K,"githubJson");function me(e,t){let i=new Headers({Accept:t,"User-Agent":"openpond-extension-installer","X-GitHub-Api-Version":"2022-11-28"});return e&&i.set("Authorization",`Bearer ${e}`),i}r(me,"githubHeaders");function He(e){let t=new Map;for(let n of e)for(let s of n.files)t.set(s.path,s);if(t.size>ae)throw new u(`Extension contains more than ${ae} skill files.`,{code:"extension_too_many_files"});let i=0;for(let n of t.values()){if((n.size??0)>V)throw new u(`Extension file is too large: ${n.path}`,{code:"extension_file_too_large"});i+=n.size??0}if(i>ue)throw new u("Extension exceeds the maximum allowed size.",{code:"extension_too_large"})}r(He,"validateDownloadLimits");function je(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.path=="string"&&!t.path.startsWith("/")&&!t.path.split("/").includes("..")&&typeof t.mode=="string"&&(t.type==="blob"||t.type==="tree"||t.type==="commit")&&typeof t.sha=="string"}r(je,"validTreeEntry");function Ue(e){let t=de("sha256");for(let i of e)t.update(`${i.path}\0${i.sha}\0${i.size??""}
3
3
  `);return t.digest("hex")}r(Ue,"hashTree");function ze(e,t){return e==="."?t:t.slice(e.length+1)}r(ze,"relativeSkillPath");function qe(e){let t=new Set,i=new Set;for(let n of e)t.has(n)&&i.add(n),t.add(n);return i}r(qe,"duplicateValues");async function we(e,t,i){let n=new Array(e.length),s=0;async function o(){for(;s<e.length;){let l=s;s+=1,n[l]=await i(e[l])}}return r(o,"worker"),await Promise.all(Array.from({length:Math.min(t,e.length)},o)),n}r(we,"mapConcurrent");function M(e){return new u(`Invalid GitHub extension source: ${e}. Use owner/repo or https://github.com/owner/repo.`,{code:"github_invalid_source"})}r(M,"invalidSource");import{createHash as Fe,randomUUID as Pe}from"node:crypto";import{existsSync as _}from"node:fs";import{mkdir as W,readFile as De,rename as G,rm as I,stat as Ke,writeFile as ye}from"node:fs/promises";import m from"node:path";var H=1,Be=15e3;function ke(e={}){let t=m.resolve(e.home??e.rootPath??ne()),i=m.resolve(e.rootPath??m.join(t,"library","extensions")),n=q(t).database,s=he({fetch:e.fetch,githubToken:e.githubToken}),o=e.now??(()=>new Date);async function l(){try{let g=await O(t),d=await Promise.all(g.extensions.map(f=>X(i,f)));return Je(d,await R(e.reservedSkillNames)),{rootPath:i,registryPath:n,extensions:d.sort(Q),error:null}}catch(g){return{rootPath:i,registryPath:n,extensions:[],error:g instanceof Error?g.message:String(g)}}}r(l,"list");async function a(g){let d=await s.resolve(g),f=await O(t),p=f.extensions.find(h=>h.id===d.preview.id)??null;return T(d.preview,f.extensions.filter(h=>h.id!==p?.id),await R(e.reservedSkillNames)),d.preview}r(a,"preview");async function w(g){let d=k(g.source);return Y(i,d.id,async()=>{let f=await O(t);if(f.extensions.some(y=>y.id===d.id))throw new u(`${d.owner}/${d.repo} is already installed.`,{code:"extension_already_installed",status:409});let p=await s.resolve(g);Ee(p.preview),T(p.preview,f.extensions,await R(e.reservedSkillNames));let h=o().toISOString(),v=await xe({rootPath:i,resolution:p,installedAt:h,updatedAt:h,github:s});try{let y=await R(e.reservedSkillNames);return await J(t,o,E=>({...E,extensions:We(E,v,y)})),await ve(i,v.id),v}catch(y){throw await be(i,v.id),y}})}r(w,"add");async function b(g){let d=k(g.source);return Y(i,d.id,async()=>{let f=await O(t),p=N(f,d.id),h=await s.resolve({source:p.repositoryUrl,ref:g.ref?.trim()||p.requestedRef});if(Ee(h.preview),T(h.preview,f.extensions.filter(y=>y.id!==p.id),await R(e.reservedSkillNames)),p.resolvedCommit===h.preview.resolvedCommit&&p.packageHash===h.preview.packageHash&&p.requestedRef===h.preview.requestedRef)return X(i,p);let v=await xe({rootPath:i,resolution:h,installedAt:p.installedAt,updatedAt:o().toISOString(),github:s});try{let y=await R(e.reservedSkillNames);return await J(t,o,E=>({...E,extensions:Xe(E,v,y)})),await ve(i,v.id),v}catch(y){throw await be(i,v.id),y}})}r(b,"update");async function P(){let g=await l();if(g.error)throw new u(g.error,{code:"extension_registry_error"});let d={updated:[],unchanged:[],failed:[]};for(let f of g.extensions)try{let p=await b({source:f.repositoryUrl,ref:f.requestedRef});p.resolvedCommit===f.resolvedCommit&&p.packageHash===f.packageHash?d.unchanged.push(p):d.updated.push(p)}catch(p){d.failed.push({id:f.id,error:p instanceof Error?p.message:String(p)})}return d}r(P,"updateAll");async function S(g){let d=k(g),f=await O(t);return X(i,N(f,d.id))}r(S,"inspect");async function x(g){let d=k(g);return Y(i,d.id,async()=>{let f=await O(t),p=N(f,d.id),h=C(i,d.owner,d.repo),v=`${h}.${Pe()}.remove`;_(h)&&await G(h,v);try{return await J(t,o,y=>({...y,extensions:y.extensions.filter(E=>E.id!==p.id)})),await I(v,{recursive:!0,force:!0}),p}catch(y){throw _(v)&&!_(h)&&await G(v,h),y}})}r(x,"remove");async function A(g){let d=g.trim();if(!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(d))throw new u("Extension skill name must be lowercase kebab-case.",{code:"extension_skill_invalid_name"});let f=await l();if(f.error)throw new u(f.error,{code:"extension_registry_error"});let p=f.extensions.flatMap(te=>te.skills.filter(U=>U.name===d).map(U=>({extension:te,skill:U})));if(p.length===0)throw new u(`Extension skill not found: ${d}`,{code:"extension_skill_not_found",status:404});if(p.length>1)throw new u(`Extension skill name is ambiguous: ${d}`,{code:"extension_skill_conflict",status:409});let h=p[0];if(h.extension.validationStatus!=="valid"||h.skill.validationStatus!=="valid")throw new u(`Extension skill ${d} is not valid.`,{code:"extension_skill_invalid"});let v=Oe(h.extension.sourcePath,h.skill.relativePath),y=await De(v,"utf8"),E=Fe("sha256").update(y).digest("hex");if(E!==h.skill.sourceHash)throw new u(`Extension skill ${d} changed on disk. Update or reinstall its extension before using it.`,{code:"extension_skill_modified"});let $=L(y);if($.messages.length>0||$.name!==d||!$.description)throw new u(`Extension skill ${d} is not valid. ${$.messages.join(" ")}`.trim(),{code:"extension_skill_invalid"});return{name:d,description:$.description,body:$.body,path:h.skill.relativePath,sourcePath:h.extension.sourcePath,sourceHash:E,charCount:y.length,packagePath:m.dirname(v),resourceFiles:h.skill.resourceFiles}}return r(A,"readSkill"),{rootPath:i,registryPath:n,list:l,preview:a,add:w,update:b,updateAll:P,inspect:S,remove:x,readSkill:A}}r(ke,"createGithubExtensionManager");async function xe(e){let t=e.resolution.preview,i=C(e.rootPath,t.owner,t.repo),n=`${i}.${Pe()}.install`,s=Z(e.rootPath,t.id),o=m.join(n,"current");await I(n,{recursive:!0,force:!0}),await I(s,{recursive:!0,force:!0}),await W(o,{recursive:!0,mode:448});try{await e.github.download(e.resolution,async(a,w,b)=>{let P=Oe(o,a);await W(m.dirname(P),{recursive:!0,mode:448}),await ye(P,w,{mode:b?448:384})});let l=Ve(t,i,e.installedAt,e.updatedAt);return await ye(m.join(n,"extension.json"),`${JSON.stringify(l,null,2)}
4
4
  `,{mode:384}),await W(m.dirname(i),{recursive:!0,mode:448}),_(i)&&await G(i,s),await G(n,i),l}catch(l){throw await I(n,{recursive:!0,force:!0}),_(s)&&!_(i)&&await G(s,i),l}}r(xe,"materializeExtension");function Ve(e,t,i,n){let s=m.join(t,"current");return{...e,sourcePath:s,readmePath:e.readmePath?m.join(s,e.readmePath):null,installedAt:i,updatedAt:n,skills:e.skills.map(o=>({...o,sourcePath:m.join(s,o.relativePath)}))}}r(Ve,"installedExtension");async function ve(e,t){await I(Z(e,t),{recursive:!0,force:!0})}r(ve,"finalizeMaterialization");async function be(e,t){let i=k(t.replace(/^github:/,"")),n=C(e,i.owner,i.repo),s=Z(e,t);await I(n,{recursive:!0,force:!0}),_(s)&&await G(s,n)}r(be,"rollbackMaterialization");async function X(e,t){let i=C(e,t.owner,t.repo),n=m.join(i,"current"),s=(await Ke(m.join(i,"extension.json")).catch(()=>null))?.isFile()??!1,o=t.validationMessages.filter(l=>l!=="Installed files are missing.");return s||o.push("Installed files are missing."),{...t,sourcePath:n,readmePath:t.readmePath?m.join(n,m.basename(t.readmePath)):null,skills:t.skills.map(l=>({...l,sourcePath:m.join(n,l.relativePath)})),validationStatus:o.length===0?"valid":"error",validationMessages:o}}r(X,"hydrateExtension");function Ee(e){if(e.validationStatus!=="valid")throw new u(`Extension contains invalid skills: ${e.validationMessages.join(" ")}`,{code:"extension_invalid"})}r(Ee,"assertInstallable");function T(e,t,i){let n=new Map;for(let o of i)n.set(o,"a shipped OpenPond skill");for(let o of t)for(let l of o.skills)n.set(l.name,o.id);let s=e.skills.map(o=>({name:o.name,owner:n.get(o.name)})).filter(o=>!!o.owner);if(s.length!==0)throw new u(`Skill name conflict: ${s.map(o=>`${o.name} (${o.owner})`).join(", ")}.`,{code:"extension_skill_conflict",status:409})}r(T,"assertSkillNamesAvailable");function We(e,t,i){if(e.extensions.some(n=>n.id===t.id))throw new u(`${t.owner}/${t.repo} is already installed.`,{code:"extension_already_installed",status:409});return T(t,e.extensions,i),[...e.extensions,t].sort(Q)}r(We,"appendInstalledExtension");function Xe(e,t,i){return N(e,t.id),T(t,e.extensions.filter(n=>n.id!==t.id),i),e.extensions.map(n=>n.id===t.id?t:n).sort(Q)}r(Xe,"replaceInstalledExtension");function Je(e,t){let i=new Map;for(let n of t)i.set(n,"built-in");for(let n of e)for(let s of n.skills){let o=i.get(s.name);if(!o){i.set(s.name,n.id);continue}let l=`Skill name conflicts with ${o}: ${s.name}`;s.validationStatus="error",s.validationMessages=[...new Set([...s.validationMessages,l])],n.validationStatus="error",n.validationMessages=[...new Set([...n.validationMessages,l])]}}r(Je,"markInstalledSkillConflicts");async function R(e){let t=typeof e=="function"?await e():e??[];return[...new Set(t.map(i=>i.trim()).filter(Boolean))]}r(R,"reservedSkillNames");function N(e,t){let i=e.extensions.find(n=>n.id===t);if(i)return i;throw new u(`${t.replace(/^github:/,"")} is not installed.`,{code:"extension_not_installed",status:404})}r(N,"requireInstalled");async function O(e){let t=D(e,"extension_installations","registry")?.value;if(!t)return Ze();if(t.schemaVersion!==H||!Array.isArray(t.extensions)||!t.extensions.every(Se))throw new Error("Extension registry has an unsupported format.");return Ye(t)}r(O,"readRegistry");async function J(e,t,i){await F(m.join(q(e).runtime,"extension-registry"),async()=>{let n=D(e,"extension_installations","registry"),s=i(await O(e));ie(e,"extension_installations","registry",{...s,schemaVersion:H,updatedAt:t().toISOString()},n?.revision??null)})}r(J,"writeRegistry");function Ye(e){return{schemaVersion:H,updatedAt:typeof e?.updatedAt=="string"?e.updatedAt:null,extensions:Array.isArray(e?.extensions)?e.extensions.filter(Se):[]}}r(Ye,"normalizeRegistry");function Ze(){return{schemaVersion:H,updatedAt:null,extensions:[]}}r(Ze,"emptyRegistry");function Se(e){if(!e||typeof e!="object")return!1;let t=e;return t.source==="github"&&typeof t.id=="string"&&typeof t.owner=="string"&&typeof t.repo=="string"&&typeof t.repositoryUrl=="string"&&typeof t.requestedRef=="string"&&typeof t.resolvedCommit=="string"&&Array.isArray(t.skills)}r(Se,"isStoredExtension");function Oe(e,t){if(m.isAbsolute(t)||t.split(/[\\/]/).includes(".."))throw new u(`Unsafe extension path: ${t}`,{code:"extension_unsafe_path"});let i=m.resolve(e,...t.split("/")),n=`${m.resolve(e)}${m.sep}`;if(!i.startsWith(n))throw new u(`Unsafe extension path: ${t}`,{code:"extension_unsafe_path"});return i}r(Oe,"safeDestination");function C(e,t,i){return m.join(e,"github",t,i)}r(C,"extensionDirectory");function Z(e,t){let i=k(t.replace(/^github:/,""));return`${C(e,i.owner,i.repo)}.previous`}r(Z,"backupDirectory");async function Y(e,t,i){let n=t.replace(/[^a-z0-9.-]+/gi,"-");return F(m.join(e,".locks",n),i,Be)}r(Y,"withExtensionLock");function Q(e,t){return e.id.localeCompare(t.id)}r(Q,"extensionSort");var _e=["openpond-cli","openpond-desktop-harness","openpond-taskset-authoring","openpond-skill-authoring","openpond-agent-authoring","openpond-refiner-authoring"];var Qe=c.object({name:c.string(),description:c.string(),relativePath:c.string(),sourcePath:c.string(),charCount:c.number().int().nonnegative(),sourceHash:c.string(),resourceFiles:c.array(c.string()),validationStatus:c.enum(["valid","error"]),validationMessages:c.array(c.string())}),$e=c.object({id:c.string(),source:c.literal("github"),owner:c.string(),repo:c.string(),repositoryUrl:c.string().url(),requestedRef:c.string(),resolvedCommit:c.string(),sourcePath:c.string(),readmePath:c.string().nullable(),installedAt:c.string(),updatedAt:c.string(),packageHash:c.string(),skills:c.array(Qe),validationStatus:c.enum(["valid","error"]),validationMessages:c.array(c.string())}),bt=$e.omit({installedAt:!0,updatedAt:!0,sourcePath:!0}).extend({sourcePath:c.null()}),Et=c.object({rootPath:c.string(),registryPath:c.string(),extensions:c.array($e),error:c.string().nullable()}),Pt=c.object({source:c.string().trim().min(1),ref:c.string().trim().min(1).optional()});async function $t(e,t,i=ke({reservedSkillNames:r(async()=>{let n=await se();return[..._e,...n.skills.map(s=>s.name)]},"reservedSkillNames")})){let n=t[0]?.toLowerCase()||"list",s=z(e.json);if(n==="list"){let o=await i.list();if(o.error)throw new Error(o.error);et(o.extensions,s);return}if(n==="add"||n==="preview"){let l={source:j(t[1],n),ref:Re(e.ref)},a=n==="preview"?await i.preview(l):await i.add(l);ee(a,s,n==="preview"?"Preview":"Installed");return}if(n==="inspect"){ee(await i.inspect(j(t[1],n)),s,"Installed");return}if(n==="update"){if(z(e.all)){let a=await i.updateAll();if(s)console.log(JSON.stringify(a,null,2));else{console.log(`Updated ${a.updated.length}; unchanged ${a.unchanged.length}; failed ${a.failed.length}.`);for(let w of a.failed)console.log(`- ${w.id}: ${w.error}`)}a.failed.length>0&&(process.exitCode=1);return}let o=j(t[1],n),l=await i.update({source:o,ref:Re(e.ref)});ee(l,s,"Updated");return}if(n==="remove"){let o=await i.remove(j(t[1],n));console.log(s?JSON.stringify({removed:o},null,2):`Removed ${o.owner}/${o.repo} and ${o.skills.length} skill(s).`);return}throw new Error("usage: openpond extension <add|preview|list|inspect|update|remove> [owner/repo] [--ref <ref>] [--all] [--json]")}r($t,"runOpenPondExtensionCommand");function ee(e,t,i){if(t){console.log(JSON.stringify(e,null,2));return}console.log(`${i} ${e.owner}/${e.repo}@${e.resolvedCommit.slice(0,12)} (${e.requestedRef}).`);for(let n of e.skills){let s=n.resourceFiles.length>0?`, ${n.resourceFiles.length} resource(s)`:"";console.log(`- ${n.name}${s}: ${n.description}`)}}r(ee,"printExtension");function et(e,t){if(t){console.log(JSON.stringify({extensions:e},null,2));return}if(e.length===0){console.log("No third-party extensions installed.");return}console.log(`Third-party extensions (${e.length}):`);for(let i of e)console.log(`- ${i.owner}/${i.repo}@${i.resolvedCommit.slice(0,12)} \xB7 ${i.skills.length} skill(s) \xB7 ${i.validationStatus}`)}r(et,"printExtensionList");function j(e,t){let i=e?.trim();if(i)return i;throw new Error(`usage: openpond extension ${t} <owner/repo>`)}r(j,"requiredSource");function Re(e){return typeof e=="string"&&e.trim()?e.trim():void 0}r(Re,"optionText");export{$t as runOpenPondExtensionCommand};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as r,c as i,h as p}from"./chunk-SFKZITAG.js";import"./chunk-XRKFTPHD.js";import"./chunk-3M53YXEI.js";import{a as t}from"./chunk-FTQLQJQV.js";function d(){console.log(m())}t(d,"printHelp");function m(){let n=["OpenPond CLI","","Usage:"," openpond [--no-open] [--hostname HOST] [--port PORT]"," openpond <command> [options] [-- passthrough...]"," openpond --version","","Commands:"];for(let o of i()){let s=o.aliases?.length?` (aliases: ${o.aliases.join(", ")})`:"";n.push(` ${o.usage}${s}`);for(let e of o.usages??[])n.push(` ${e}`)}n.push("","Global options:");for(let[o,s]of Object.entries(r).sort(([e],[a])=>e.localeCompare(a))){let e=o.replace(/[A-Z]/g,a=>`-${a.toLowerCase()}`);n.push(s==="boolean"?` --${e}`:` --${e} <${s}>`)}return n.push("","Run `openpond <command> --help` for the selected command schema.","Arguments after `--` are passed through without option parsing."),n.join(`
2
+ import{a as r,c as i,h as p}from"./chunk-SQX22LQT.js";import"./chunk-XRKFTPHD.js";import"./chunk-3M53YXEI.js";import{a as t}from"./chunk-FTQLQJQV.js";function d(){console.log(m())}t(d,"printHelp");function m(){let n=["OpenPond CLI","","Usage:"," openpond [--no-open] [--hostname HOST] [--port PORT]"," openpond <command> [options] [-- passthrough...]"," openpond --version","","Commands:"];for(let o of i()){let s=o.aliases?.length?` (aliases: ${o.aliases.join(", ")})`:"";n.push(` ${o.usage}${s}`);for(let e of o.usages??[])n.push(` ${e}`)}n.push("","Global options:");for(let[o,s]of Object.entries(r).sort(([e],[a])=>e.localeCompare(a))){let e=o.replace(/[A-Z]/g,a=>`-${a.toLowerCase()}`);n.push(s==="boolean"?` --${e}`:` --${e} <${s}>`)}return n.push("","Run `openpond <command> --help` for the selected command schema.","Arguments after `--` are passed through without option parsing."),n.join(`
3
3
  `)}t(m,"formatCliHelp");function l(){return["# OpenPond CLI command reference","","<!-- Generated by `pnpm --dir apps/cli docs:commands`; do not edit by hand. -->","","Parsing, aliases, command help, and this reference use the same authoritative registry.","",...i().map(o=>`## ${o.name}
4
4
 
5
5
  \`\`\`text
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{b as a}from"./chunk-5KWKSR4P.js";import"./chunk-Q3WXB465.js";import"./chunk-5AU5Y6KS.js";import"./chunk-FEAKTSRS.js";import"./chunk-L3KS6MOV.js";import"./chunk-MVPKU72J.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-GD3RCUDH.js";import"./chunk-QCJY6FTC.js";import"./chunk-UTIELP6F.js";import"./chunk-6S2MWJVD.js";import"./chunk-FYWQWKVS.js";import"./chunk-6ESBAHWK.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-7J2NMUTK.js";import"./chunk-W45RKGM6.js";import"./chunk-W45RKGM6.js";import"./chunk-7PKTCMZ6.js";import"./chunk-LXZLLTYQ.js";import"./chunk-GI7LTJV3.js";import"./chunk-VS3AMJEK.js";import"./chunk-XGY4OQLC.js";import"./chunk-AF3AVDPP.js";import"./chunk-SFR32TMJ.js";import"./chunk-5KJMFK65.js";import"./chunk-Y3B6ZUE6.js";import"./chunk-WJSJXK2N.js";import"./chunk-OKEC2EIE.js";import"./chunk-WLZJOCLA.js";import"./chunk-HIQPGYVH.js";import"./chunk-ZWW227M3.js";import"./chunk-DXA2UHBE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-6FA3GG5B.js";import"./chunk-G4E3WGLM.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import"./chunk-FTQLQJQV.js";export{a as createHostProfileEvaluationTools};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{a,b}from"./chunk-UK5LGSGT.js";import"./chunk-TPOAAJKA.js";import"./chunk-ZU3YBRXS.js";import"./chunk-4TTXNVCE.js";import"./chunk-LZPCA6DH.js";import"./chunk-L3KS6MOV.js";import"./chunk-GUG2SWRZ.js";import"./chunk-G4747MOW.js";import"./chunk-KCJVFLBB.js";import"./chunk-BL3CZWWD.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-W45RKGM6.js";import"./chunk-7PKTCMZ6.js";import"./chunk-LXZLLTYQ.js";import"./chunk-XGY4OQLC.js";import"./chunk-SFR32TMJ.js";import"./chunk-5KJMFK65.js";import"./chunk-Y3B6ZUE6.js";import"./chunk-ULJZ7NUF.js";import"./chunk-OKEC2EIE.js";import"./chunk-WLZJOCLA.js";import"./chunk-HIQPGYVH.js";import"./chunk-ZWW227M3.js";import"./chunk-DXA2UHBE.js";import"./chunk-MTP3B2SU.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-6FA3GG5B.js";import"./chunk-G4E3WGLM.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-SH7POUVX.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import"./chunk-UGOK7VTC.js";import"./chunk-FTQLQJQV.js";export{b as createHostProfileExternalDataset,a as readHostProfileExternalDataset};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{b as lt,c as se,e as St}from"./chunk-U2BD545L.js";import{c as mt,d as pt,e as ft}from"./chunk-5Z3AU5CL.js";import{b as ct,p as dt,q as yt,r as Rt}from"./chunk-MHPCVQOE.js";import{a as ht,b as gt}from"./chunk-4JYTFEND.js";import{b as wt,c as vt}from"./chunk-55Q64WWF.js";import{b as ut}from"./chunk-IEVJLG3V.js";import"./chunk-S7A2OGL2.js";import{b as nt}from"./chunk-OW3EOC5Q.js";import"./chunk-EICS777E.js";import{a as ot,b as at}from"./chunk-5KWKSR4P.js";import"./chunk-Q3WXB465.js";import"./chunk-5AU5Y6KS.js";import"./chunk-FEAKTSRS.js";import{b as it}from"./chunk-UK5LGSGT.js";import"./chunk-TPOAAJKA.js";import{a as re,b as O,c as W}from"./chunk-GDJ4X2ZN.js";import{a as Pt}from"./chunk-B666Z2NS.js";import"./chunk-WLQEONBF.js";import"./chunk-YU4JYWCA.js";import"./chunk-3MVKXAH7.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import{a as te}from"./chunk-4MQHIFZL.js";import"./chunk-3BJ7LPE3.js";import"./chunk-W45RKGM6.js";import"./chunk-LARJARMS.js";import"./chunk-67HXM6AL.js";import"./chunk-ANG2YMMD.js";import"./chunk-6TRVEA3T.js";import"./chunk-FEQ7HNJR.js";import"./chunk-LYVHYT3L.js";import{d as Fe,e as We,j as Ge,k as Qe,na as Ye,oa as et,pa as tt,v as Je,w as ee,y as Ze}from"./chunk-GKLZQN6P.js";import{g as Xe}from"./chunk-EVQISX7M.js";import{a as Ue}from"./chunk-PYNW5OFA.js";import"./chunk-66HFW4OU.js";import"./chunk-RHMULF56.js";import"./chunk-VFH5C6D2.js";import"./chunk-AN525SPP.js";import"./chunk-WBO6FQHR.js";import"./chunk-H5ML7735.js";import"./chunk-SYUKES6H.js";import"./chunk-UOFDKMRU.js";import"./chunk-XHBMK6LC.js";import{$ as z,W as rt,Z as h,aa as st}from"./chunk-6I5AUTVO.js";import"./chunk-IZ6DLEVY.js";import"./chunk-QJJNHKLT.js";import{g as Ve,m as Le}from"./chunk-ZU3YBRXS.js";import"./chunk-7XOUM6RK.js";import"./chunk-VD2TQCMH.js";import"./chunk-N73MU2C3.js";import"./chunk-FAKDGLZQ.js";import{a as $e,b as Ke}from"./chunk-GW766ZSO.js";import{p as Ne}from"./chunk-MCBRB5D6.js";import"./chunk-JD76ANPN.js";import"./chunk-SSJV3VX7.js";import"./chunk-7KWD2I6W.js";import"./chunk-4TTXNVCE.js";import"./chunk-HNDAGZCF.js";import"./chunk-YU3C6U5V.js";import"./chunk-OPTJYDZN.js";import"./chunk-KVTBX2UP.js";import"./chunk-BJXPQIVD.js";import"./chunk-GFAI2MCJ.js";import"./chunk-DMFUEUAZ.js";import"./chunk-GF55VEMR.js";import"./chunk-LZPCA6DH.js";import"./chunk-L3KS6MOV.js";import{a as ge}from"./chunk-GUG2SWRZ.js";import{a as he}from"./chunk-G4747MOW.js";import"./chunk-KCJVFLBB.js";import{C as De,D as Me,M as ze,P as X,a as fe,g as qe,ja as je,v as F,w as Be,x as U}from"./chunk-MVPKU72J.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-GD3RCUDH.js";import"./chunk-QCJY6FTC.js";import"./chunk-UTIELP6F.js";import"./chunk-6S2MWJVD.js";import"./chunk-FYWQWKVS.js";import"./chunk-6ESBAHWK.js";import{b as xe}from"./chunk-4V73I4OL.js";import{a as ce,h as Te,n as ke,p as Ae}from"./chunk-LE75SVEL.js";import"./chunk-7J2NMUTK.js";import"./chunk-W45RKGM6.js";import"./chunk-W45RKGM6.js";import"./chunk-7PKTCMZ6.js";import"./chunk-LXZLLTYQ.js";import"./chunk-GI7LTJV3.js";import"./chunk-VS3AMJEK.js";import"./chunk-XGY4OQLC.js";import"./chunk-AF3AVDPP.js";import"./chunk-SFR32TMJ.js";import"./chunk-5KJMFK65.js";import"./chunk-Y3B6ZUE6.js";import"./chunk-4N4EH3RJ.js";import"./chunk-ULJZ7NUF.js";import"./chunk-WJSJXK2N.js";import"./chunk-LOIYNRBC.js";import"./chunk-CYQLXS2U.js";import{b as _e}from"./chunk-O6ZYDHEJ.js";import"./chunk-OKEC2EIE.js";import"./chunk-WLZJOCLA.js";import"./chunk-HIQPGYVH.js";import"./chunk-ZWW227M3.js";import"./chunk-DXA2UHBE.js";import"./chunk-MTP3B2SU.js";import"./chunk-UN2LKLGV.js";import"./chunk-2LJCJOJ7.js";import"./chunk-AMC4Z7G4.js";import"./chunk-LK77GI6M.js";import{c as Ie}from"./chunk-HVM2GUM3.js";import"./chunk-JCLTFDVW.js";import"./chunk-I6VMRQF4.js";import{Hb as Z,Ob as Y,f as pe,m as Oe}from"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-6FA3GG5B.js";import"./chunk-G4E3WGLM.js";import{Ka as de}from"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-SH7POUVX.js";import{V as me,X as Ce}from"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import{m as B,n as g,o as M}from"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import{A as n}from"./chunk-X2J2P5ZT.js";import"./chunk-UGOK7VTC.js";import{a as r}from"./chunk-FTQLQJQV.js";import{randomUUID as Vt}from"node:crypto";import{promises as _}from"node:fs";import I from"node:path";function Ht(l){let e=new Map,t=new Map;async function o(s,d){let m=(t.get(s)??Promise.resolve()).catch(()=>{}).then(d);t.set(s,m);try{return await m}finally{t.get(s)===m&&t.delete(s)}}r(o,"serial");let a=r((s,d=18e4)=>l.request(z.parse({contractVersion:h,requestId:Vt(),operation:"profile-evaluations/sandbox",params:s}),d),"request");async function c(s,d,m,f){let S=B(f),y=`${d}/${m}/${S}`,b=e.get(s.sessionId)??new Set;if(!b.has(y)){if(f.length>1e7)throw new Error("The public case file exceeds its admitted bound.");for(let P=0;P===0||P<f.length;P+=98304)s.signal.throwIfAborted(),await a({sessionId:s.sessionId,turnId:s.turnId,action:"upload",area:d,path:m,sha256:S,sizeBytes:f.length,offset:P,contentsBase64:f.subarray(P,P+98304).toString("base64")},3e5);b.add(y),e.set(s.sessionId,b)}}r(c,"upload");async function u(s,d=""){let m=[];for(let f of await _.readdir(I.join(s,d),{withFileTypes:!0})){let S=I.posix.join(d,f.name);if(f.isSymbolicLink()){let y=await _.realpath(I.join(s,S));if(!y.startsWith(`${await _.realpath(s)}${I.sep}`)||(await _.stat(y)).isDirectory())throw new Error("The public Agent runtime symlink escapes its file closure.");m.push(S);continue}if(f.isDirectory()?m.push(...await u(s,S)):f.isFile()&&m.push(S),m.length>8192)throw new Error("The public Agent runtime exceeds the file limit.")}return m}return r(u,"runtimeFiles"),{execute:r(s=>o(s.sessionId,async()=>{s.signal.throwIfAborted();for(let[f,S]of Object.entries(s.publicHashes)){let y=await _.realpath(I.join(s.sourceRoot,f)),b=await _.realpath(s.sourceRoot);if(!y.startsWith(`${b}${I.sep}`))throw new Error("The public case file escaped its source root.");let P=await _.readFile(y);if(B(P)!==S)throw new Error("The public case file changed before upload.");await c(s,"policy",f,P)}if(s.runtimeRoot)for(let f of await u(s.runtimeRoot))await c(s,"runtime",f,await _.readFile(I.join(s.runtimeRoot,f)));let d=I.relative(s.sourceRoot,s.cwd??s.sourceRoot);if(d.startsWith("..")||I.isAbsolute(d))throw new Error("The command cwd escaped the admitted case.");let m=n.object({code:n.number().int().nullable(),stdout:n.string().max(75e4),stderr:n.string().max(75e4),timedOut:n.boolean(),stdoutTruncated:n.boolean(),stderrTruncated:n.boolean()}).parse(await a({sessionId:s.sessionId,turnId:s.turnId,action:"exec",command:s.command,stdin:s.stdin,cwd:d.split(I.sep).join("/"),timeoutMs:s.timeoutMs},s.timeoutMs+15e3));return s.signal.throwIfAborted(),m}),"execute"),readOutput:r(s=>o(s.sessionId,async()=>{let d=ot(s.path),m=[],f=null,S=null;for(let b=0;f===null||b<f;b+=98304){s.signal.throwIfAborted();let P=n.object({sizeBytes:n.number().int().min(1).max(1e7),sha256:n.string().regex(/^[a-f0-9]{64}$/),contentsBase64:n.string().max(131072)}).parse(await a({sessionId:s.sessionId,turnId:s.turnId,action:"read",path:d,offset:b},6e4));f??=P.sizeBytes,S??=P.sha256;let p=Buffer.from(P.contentsBase64,"base64");if(P.sizeBytes!==f||P.sha256!==S||p.length!==Math.min(98304,f-b)||p.toString("base64")!==P.contentsBase64)throw new Error("The confined output changed during readback.");m.push(p)}let y=Buffer.concat(m);if(B(y)!==S)throw new Error("The confined output differs from its saved byte identity.");return s.signal.throwIfAborted(),{bytes:y,title:d.split("/").at(-1)}}),"readOutput"),settle:r((s,d)=>o(s,async()=>{try{await a({sessionId:s,turnId:d,action:"stop"},6e4)}finally{e.delete(s)}}),"settle")}}r(Ht,"createHostedProfileCommandOwner");import{randomUUID as Lt}from"node:crypto";var j=98304;function Et(l){let e=r((t,o)=>l.request(z.parse({contractVersion:h,requestId:Lt(),operation:t,params:o})),"request");return{persistence:{sourceTurnStartedAt:r(async()=>{throw new Error("The case owner must supply its actual turn start time.")},"sourceTurnStartedAt"),saveSandboxFile:r(async()=>{throw new Error("Isolated Profile outputs must be read by the confined case owner.")},"saveSandboxFile"),save:r(async({sessionId:t,turnId:o,identity:a,bytes:c})=>{let u=n.object({uploadId:n.string().min(1),maxChunkBytes:n.literal(j)}).parse(await e("output/begin",{sessionId:t,turnId:o,output:a}));for(let d=0;d<c.length;d+=j){let m=c.subarray(d,d+j);await e("output/chunk",{uploadId:u.uploadId,index:d/j,offset:d,sha256:B(m),contentsBase64:m.toString("base64")})}let{outputRef:s}=n.object({outputRef:je}).parse(await e("output/complete",{uploadId:u.uploadId}));if(s.location.kind!=="managed"||s.sha256!==a.sha256||s.sizeBytes!==c.length||s.sourceTaskId!==t||s.sourceTurnId!==o||s.id!==a.id||s.revision!==a.revision)throw new Error("The durable case output differs from its saved identity.");return{outputRef:s,artifact:{artifactRef:s.location.fileId,path:s.location.downloadPath,title:s.title,contentType:s.contentType,sizeBytes:s.sizeBytes}}},"save")},read:r(async(t,o)=>{if(t.location.kind!=="managed"||t.sizeBytes>1e7)throw new Error("Select a bounded managed case output.");let a=[];for(let u=0;u<t.sizeBytes;u+=j){o?.throwIfAborted();let s=n.object({offset:n.number().int(),contentsBase64:n.string().max(131072),sha256:n.string(),sizeBytes:n.number().int()}).parse(await e("output/readBytes",{sessionId:t.sourceTaskId,turnId:t.sourceTurnId,fileId:t.location.fileId,revision:t.revision,sha256:t.sha256,sizeBytes:t.sizeBytes,offset:u})),d=Buffer.from(s.contentsBase64,"base64");if(s.offset!==u||s.sha256!==t.sha256||s.sizeBytes!==t.sizeBytes||d.length!==Math.min(j,t.sizeBytes-u)||d.toString("base64")!==s.contentsBase64)throw new Error("The durable workbook byte range changed.");a.push(d)}o?.throwIfAborted();let c=Buffer.concat(a);if(B(c)!==t.sha256)throw new Error("The durable workbook differs from its sealed hash.");return c},"read")}}r(Et,"createHostedProfileArtifactOwner");import{randomUUID as Gt}from"node:crypto";var $t=n.object({createdAt:n.string().datetime(),id:n.string().min(1)}).strict(),Kt=n.object({entries:n.array(n.unknown()).max(100),nextBefore:$t.nullable()}).strict(),oe=class{constructor(e){this.client=e}client;static{r(this,"HostedProfileEvaluationStorage")}execute(e){return this.client.request({contractVersion:h,requestId:Gt(),operation:"profile-evaluations/execute",params:e})}async get(e,t,o){let a=await this.execute({action:"get",kind:e,id:t});if(a===null)return null;let c=o.parse(a);return M(c,`Hosted Profile evaluation ${e}`),c}async put(e,t,o,a,c){let u=o.parse(t);M(u,`Hosted Profile evaluation ${e}`);let s=o.parse(await this.execute({action:"put",kind:e,payload:u,profileKey:a,createdAt:c}));if(s.contentHash!==u.contentHash||g(s)!==g(u))throw new Error("Hosted Profile evaluation write returned different evidence.");return s}async page(e,t,o){let a=[],c=null;do{let u=Kt.parse(await this.execute({action:"page",kind:e,profileKey:g(F.parse(t)),before:c,limit:100}));if(u.nextBefore&&(u.entries.length===0||c&&(u.nextBefore.createdAt>c.createdAt||u.nextBefore.createdAt===c.createdAt&&u.nextBefore.id>=c.id)))throw new Error("Hosted Profile evaluation cursor did not advance.");for(let s of u.entries){let d=o.parse(s);M(d,`Hosted Profile evaluation ${e}`),a.push(d)}if(a.length>1e4)throw new Error("Hosted Profile evaluation history exceeds the bounded catalog limit.");c=u.nextBefore}while(c);return a}getProfileEvaluationGrade(e){return this.get("grade",e,de)}saveProfileEvaluationGrade(e){return this.put("grade",e,de,null,new Date().toISOString())}getProfileEvaluationReceipt(e){return this.get("receipt",e,pe)}saveProfileEvaluationReceipt(e){if(!Oe(e))throw new Error("Hosted Profile evaluation receipt is invalid.");return this.put("receipt",e,pe,null,e.completedAt)}getProfileEvaluationRun(e){return this.get("run",e,te)}saveProfileEvaluationRun(e){return this.put("run",e,te,g(F.parse(e.profileRef)),e.completedAt)}listProfileEvaluationRuns(e){return this.page("run",e,te)}getProfileEvaluationComparison(e){return this.get("comparison",e,Z)}saveProfileEvaluationComparison(e,t){return this.put("comparison",t,Z,g(F.parse(e)),t.createdAt)}listProfileEvaluationComparisons(e){return this.page("comparison",e,Z)}getProfileEvaluationSuiteRun(e){return this.get("suite",e,Y)}saveProfileEvaluationSuiteRun(e,t,o){if(g(t)!==o.catalogHash)throw new Error("Hosted Profile evaluation suite differs from its catalog.");return this.put("suite",o,Y,g(F.parse(e)),o.createdAt)}listProfileEvaluationSuiteRuns(e){return this.page("suite",e,Y)}};async function bt(l){let e=l.release;if(!e.hostExecution)throw new Error("Hosted evaluation requires explicit host execution attribution.");let t={hostConversationId:e.hostExecution.conversationId,hostTurnId:e.hostExecution.turnId},o={source:"openpond_git",profileId:e.profileId,repositoryId:e.repositoryId},a=r(async()=>({ref:o,sourceRevision:e.sourceRevision}),"selectedProfile"),c=r(()=>se(l.client,e),"selectedWorkflows"),u=new oe(l.client),s=r(async p=>{if(g(p)!==g(e.harnessRelease))throw new Error("Evaluation requires the admitted Profile release.");let H=await O(l.client,p);if(!H)throw new Error("Admitted evaluation Profile is unavailable.");return H},"loadRuntime"),d=r(async p=>{if(g(p.ref)!==g(o)||p.sourceRevision!==e.sourceRevision)throw new Error("Evaluation requires the admitted Profile source.");return ut({...p,runtime:await s(p.harnessRelease)})},"loadCatalog"),m=l.externalDataset?await it({value:l.externalDataset,release:(await s(e.harnessRelease)).release,sourceRevision:e.sourceRevision,client:l.client}):null,f=r(async(p,H,x)=>{if(H!==e.profileId)throw new Error("Evaluation Taskset Profile differs from its admitted source.");let E=await ct({definition:p,harnessRelease:x,runtime:await s(x)});if(!E)throw new Error("Evaluation Taskset is absent from the admitted Profile release.");return E},"loadTasksetPackage"),S=mt({resolveExternalDataset:m?.resolveExternalDataset,store:{runtimeEventsForTurn:r(p=>l.core.runtimeEventsForTurn(p),"runtimeEventsForTurn")},storeDir:l.storeDir,readManagedArtifact:l.readManagedArtifact,admitSession:l.admitSession,settleSession:l.settleSession,loadCatalog:d,loadTasksetPackage:f,selectedProfile:a,createSession:r(p=>{let H=ze.parse(p);return l.createSession({...H,metadata:{...H.metadata,...t}})},"createSession"),sendTurn:r((p,H)=>{let x=X.parse(H);return l.sendTurn(p,{...x,metadata:{...x.metadata,...t}})},"sendTurn"),interruptSessionTurn:l.interruptSessionTurn}),y=dt({resolveExternalDataset:m?.resolveExternalDataset,sourceCandidate:m?.sourceCandidate,privateGradingPreflight:r(p=>yt(p,!1),"privateGradingPreflight"),loadCatalog:d,selectedWorkflows:c,loadTasksetPackage:f,placement:"remote",boundedWorkComputeAvailable:!0,modelConfigurationHash:r(async(p,H)=>{if(p.providerId!=="openpond"||!H.hostModelConfigurationHash)throw new Error("Hosted evaluation requires a host-admitted model configuration receipt.");return H.hostModelConfigurationHash},"modelConfigurationHash")}),b=pt({resolveExternalDataset:m?.resolveExternalDataset,store:u,loadCatalog:d,loadTasksetPackage:f,selectedProfile:a,executeCase:S,privateGrading:r((p,H,x)=>Rt({manifest:p,packageValue:H,signal:x,executeSandboxVerifier:nt(l.client),authorize:r(async()=>{let E=p.profileEvaluation;if(!E||E.profileId!==e.profileId||E.sourceRevision!==e.sourceRevision)throw new Error("The hosted private grading source changed.");if(E.externalDatasetBinding){if(!m)throw new Error("The frozen Dataset owner is unavailable.");await m.authorize({bindingHash:E.externalDatasetBinding.contentHash,manifestHash:p.contentHash})}let D=await d({ref:o,sourceRevision:e.sourceRevision,harnessRelease:E.harnessRelease});if(!E.externalDatasetBinding&&D.catalogHash!==E.catalogHash)throw new Error("The hosted private grading catalog changed.")},"authorize")}),"privateGrading")}),P={getProfileEvaluationRun:u.getProfileEvaluationRun.bind(u),getProfileEvaluationReceipt:u.getProfileEvaluationReceipt.bind(u),getProfileEvaluationGrade:u.getProfileEvaluationGrade.bind(u),getSession:l.core.getSession.bind(l.core),getTurn:l.core.getTurn.bind(l.core),runtimeEventsForTurn:l.core.runtimeEventsForTurn.bind(l.core),listModelUsageRecords:l.core.listModelUsageRecords.bind(l.core)};return{prepareProfileEvaluationRun:y,executeProfileEvaluationCase:S,executeProfileEvaluationRun:b,runPreparedProfileEvaluation:r(async p=>b(await y(p,{requireExpectedManifestHash:!0})),"runPreparedProfileEvaluation"),runProfileEvaluationSuite:ft({store:u,loadCatalog:d,selectedWorkflows:c,prepareRun:y,executeRun:b}),compareProfileEvaluationRuns:ht({store:u,selectedProfile:a}),buildProfileEvaluationReport:r(p=>gt({store:u,profileRef:o,request:p}),"buildProfileEvaluationReport"),listProfileEvaluations:r(async p=>{if(p&&typeof p=="object"&&"runId"in p)return vt({store:P,profileRef:o,...wt.parse(p)});let[H,x,E,D]=await Promise.all([d({ref:o,sourceRevision:e.sourceRevision,harnessRelease:e.harnessRelease}),u.listProfileEvaluationRuns(o),u.listProfileEvaluationComparisons(o),u.listProfileEvaluationSuiteRuns(o)]);return{...H,runs:x,comparisons:E,suiteRuns:D}},"listProfileEvaluations")}}r(bt,"createHostedProfileEvaluationRuntime");import{mkdir as lr}from"node:fs/promises";import{randomUUID as Mt}from"node:crypto";import V from"node:path";import{randomUUID as Tt}from"node:crypto";var Qt=n.object({revision:n.number().int().nonnegative(),payload:n.record(n.string(),n.unknown()).nullable()}).strict(),Jt=n.object({entries:n.array(n.unknown()).max(100),nextAfterId:n.string().min(1).nullable()}).strict(),ae=class{constructor(e){this.client=e}client;static{r(this,"HostedHarnessStateStorage")}async getPreference(e,t){return Qt.parse(await this.client.request({contractVersion:h,requestId:Tt(),operation:"harness/state/read",params:{workspaceId:e,kind:t,afterId:null,limit:1}}))}async listCandidates(e){return(await this.readAll(e,"candidates")).map(t=>ke.parse(t))}async listCrossRunRequests(e){return(await this.readAll(e,"cross_run_requests")).map(t=>Ae.parse(t))}async readAll(e,t){let o=[],a=null;do{let c=Jt.parse(await this.client.request({contractVersion:h,requestId:Tt(),operation:"harness/state/read",params:{workspaceId:e,kind:t,afterId:a,limit:Math.min(100,1001-o.length)}}));if(c.nextAfterId&&(c.entries.length===0||c.nextAfterId===a))throw new Error("Hosted Harness state cursor did not advance.");if(o.push(...c.entries),o.length>1e3)throw new Error("Hosted Harness state exceeds 1,000 entries.");a=c.nextAfterId}while(a);return o}};import{randomUUID as Zt}from"node:crypto";import{cp as Yt,mkdir as Xt,rm as er}from"node:fs/promises";import tr from"node:path";var we=n.object({schemaVersion:n.literal("openpond.harnessMemoryEntry.v1"),id:n.string(),workspaceId:n.string(),key:n.string(),content:n.string(),tags:n.array(n.string()),revision:n.number().int().positive(),status:n.enum(["active","deleted"]),sourceRunId:n.string().nullable(),sourceProposal:n.object({id:n.string(),contentHash:n.string()}).nullable(),createdAt:n.string().datetime(),updatedAt:n.string().datetime(),contentHash:n.string().regex(/^[a-f0-9]{64}$/)}).strict(),rr=n.object({createdAt:n.string().datetime(),id:n.string()}).strict(),xt=n.object({entries:n.array(n.unknown()).max(100),nextBefore:rr.nullable()}).strict(),ve=n.object({workspace:ce,receipt:Te}).strict(),ne=class{constructor(e,t){this.client=e;this.storeDir=t;this.usage=new St(e),this.overlay=new re({request:r(async o=>o.operation==="harness/overlay/get"?this.request({action:"overlay_get",...o.params}):o.operation==="harness/overlay/freezeProposal"?this.request({action:"overlay_freeze",...o.params},o.requestId):e.request(o),"request")})}client;storeDir;static{r(this,"HostedHarnessReviewStorage")}harnessStoragePlacement="hosted";reviewSessionId=null;overlay;usage;request(e,t=Zt()){return this.client.request({contractVersion:h,requestId:t,operation:"harness/review/execute",params:e},e.action==="release_put"?6e4:15e3)}sessionId(){if(!this.reviewSessionId)throw new Error("Hosted review memory requires an admitted review session.");return this.reviewSessionId}async prepareReview(e){let t=await this.getSession(e.runRef);if(!t)throw new Error("Hosted review session is unavailable.");this.reviewSessionId=t.id;let o=await this.getHarnessRunOverlay(t.id);if(!o)throw new Error("Hosted review overlay is unavailable.");let a=await this.getHarnessWorkspace(o.workspace.workspaceId);if(!a?.currentChannel.release)throw new Error("Hosted review workspace release is unavailable.");let c=await this.getHarnessReleaseRecord(a.currentChannel.release.contentHash);if(!c||c.sourceRevision!==a.sourceRevision)throw new Error("Hosted review source binding changed.");let u=Ve(this.storeDir,a.id);await Xt(u.root,{recursive:!0,mode:448}),await er(u.source,{recursive:!0,force:!0}),await Yt(tr.join(c.bundlePath,"source"),u.source,{recursive:!0,force:!1,errorOnExist:!0});let s=await Le({workspaceId:a.id,sourceDir:u.source});if(s.sourceRevision!==a.sourceRevision||s.harnessRelease.contentHash!==c.harnessRelease.contentHash)throw new Error("Hosted review source cache differs from its immutable release.")}getHarnessWorkspace=r(async e=>ce.nullable().parse(await this.request({action:"workspace_get",workspaceId:e})),"getHarnessWorkspace");getHarnessReleaseRecord=r(async e=>he.nullable().parse(await this.request({action:"release_get",contentHash:e})),"getHarnessReleaseRecord");saveHarnessReleaseRecord=r(async e=>he.parse(await this.request({action:"release_put",record:e},`review-release:${e.harnessRelease.contentHash}`)),"saveHarnessReleaseRecord");getHarnessRunOverlay=r(e=>this.overlay.getHarnessRunOverlay(e),"getHarnessRunOverlay");createHarnessRunOverlay=r(e=>this.overlay.createHarnessRunOverlay(e),"createHarnessRunOverlay");freezeHarnessRunOverlayWithProposalAtomically=r(e=>this.overlay.freezeHarnessRunOverlayWithProposalAtomically(e),"freezeHarnessRunOverlayWithProposalAtomically");getHarnessBackgroundReviewSettings=r(async e=>n.object({enabled:n.boolean(),updatedAt:n.string().datetime().nullable()}).strict().parse(await this.request({action:"background_get",workspaceId:e})),"getHarnessBackgroundReviewSettings");getHarnessMemory=r(async(e,t)=>we.nullable().parse(await this.request({action:"memory_get",workspaceId:e,sessionId:this.sessionId(),key:t})),"getHarnessMemory");listHarnessMemories=r(async(e,t={})=>{let o=n.object({entries:n.array(we).max(20),nextBefore:n.object({updatedAt:n.string().datetime(),key:n.string()}).nullable()}),a=[],c=null;do{let u=o.parse(await this.request({action:"memory_page",workspaceId:e,sessionId:this.sessionId(),before:c,limit:20,includeDeleted:t.includeDeleted??!1}));if(a.push(...u.entries),u.nextBefore&&(!u.entries.length||g(u.nextBefore)===g(c)))throw new Error("Hosted memory cursor did not advance.");c=u.nextBefore}while(c&&a.length<1e3);if(c)throw new Error("Hosted review memory exceeds its bounded window.");return a},"listHarnessMemories");writeHarnessMemory=r(async e=>we.parse(await this.request({action:"memory_write",sessionId:this.sessionId(),input:e},`review-memory:${g(e)}`)),"writeHarnessMemory");saveHarnessImprovementArtifact=r(async(e,t,o)=>{let a={action:"artifact_put",workspaceId:e,kind:t,artifact:o},c=(await import("./dist-O7HXZUBW.js")).HarnessReviewStorageParamsSchema.parse(a);return ge[t].parse(await this.request(c,`review-artifact:${t}:${o.contentHash}`))},"saveHarnessImprovementArtifact");listHarnessImprovementArtifacts=r(async(e,t,o=100)=>{let a=[],c=null,u=Math.min(Math.max(1,Math.trunc(o)),1e3);do{let s=(await import("./dist-O7HXZUBW.js")).HarnessReviewStorageParamsSchema.parse({action:"artifact_page",workspaceId:e,kind:t,before:c,limit:Math.min(100,u-a.length)}),d=xt.parse(await this.request(s));if(a.push(...d.entries),d.nextBefore&&(!d.entries.length||g(d.nextBefore)===g(c)))throw new Error("Hosted artifact cursor did not advance.");c=d.nextBefore}while(c&&a.length<u);return a.map(s=>ge[t].parse(s))},"listHarnessImprovementArtifacts");listPendingHarnessRefinerTriggers=r(async()=>{let e=await import("./hosted-harness-runtime-3AJGEIFD.js").then(a=>a.loadHostedHarnessRuntime(this.client));if(!e)return[];let t=[],o=null;do{let a=xt.parse(await this.request({action:"pending_page",workspaceId:e.workspace.id,before:o,limit:100}));if(t.push(...a.entries.map(c=>({workspaceId:e.workspace.id,trigger:xe.parse(c)}))),a.nextBefore&&(!a.entries.length||g(a.nextBefore)===g(o)))throw new Error("Hosted pending-review cursor did not advance.");o=a.nextBefore}while(o&&t.length<1e3);if(o)throw new Error("Hosted pending reviews exceed the bounded recovery window.");return t},"listPendingHarnessRefinerTriggers");advanceHarnessWorkspaceAtomically=r(async e=>ve.parse(await this.client.request({contractVersion:h,requestId:e.receiptId,operation:"harness/workspace/transition",params:{action:"advance",...e}})),"advanceHarnessWorkspaceAtomically");advanceReviewedHarnessWorkspaceAtomically=r(async e=>ve.parse(await this.client.request({contractVersion:h,requestId:e.receiptId,operation:"harness/workspace/transition",params:{action:"reviewedAdvance",...e}})),"advanceReviewedHarnessWorkspaceAtomically");rollbackHarnessWorkspaceAtomically=r(async e=>ve.parse(await this.client.request({contractVersion:h,requestId:e.receiptId,operation:"harness/workspace/transition",params:{action:"rollback",...e}})),"rollbackHarnessWorkspaceAtomically");getSession=r(async e=>Be.nullable().parse(await this.request({action:"session_get",sessionId:e})),"getSession");getTurn=r(async e=>U.nullable().parse(await this.request({action:"turn_get",turnId:e})),"getTurn");updateTurn=r(async(e,t)=>{let o=await this.getTurn(e);if(!o)return null;let a=U.parse(t(o)),{harnessSnapshot:c,...u}=o,{harnessSnapshot:s,...d}=a;if(!s||g(u)!==g(d))throw new Error("Hosted review may only restore a missing Harness snapshot.");return U.parse(await this.request({action:"snapshot_restore",turnId:e,expectedHash:g(o),snapshot:s}))},"updateTurn");turnsForSession=r(async(e,t=1e3)=>{let o=n.object({entries:n.array(U).max(100),nextBefore:n.number().int().positive().nullable()}),a=[],c=null,u=Math.min(Math.max(1,Math.trunc(t)),1e3);do{let s=o.parse(await this.request({action:"turn_page",sessionId:e,before:c,limit:Math.min(100,u-a.length)}));if(a.push(...s.entries),s.nextBefore&&(!s.entries.length||c!==null&&s.nextBefore>=c))throw new Error("Hosted review turn cursor did not advance.");c=s.nextBefore}while(c&&a.length<u);return a.reverse()},"turnsForSession");runtimeEventsForTurn=r(async(e,t={})=>{let o=n.object({entries:n.array(fe).max(100),nextAfterSequence:n.number().int().positive().nullable()}),a=[],c=0,u=Math.min(t.limit??1e4,1e4);do{let s=o.parse(await this.request({action:"event_page",turnId:e,afterSequence:c,names:[...t.names??[]],limit:Math.min(100,u-a.length)}));if(a.push(...s.entries),!s.nextAfterSequence)return a;if(!s.entries.length||s.nextAfterSequence<=c)throw new Error("Hosted review event cursor did not advance.");c=s.nextAfterSequence}while(a.length<u);return a},"runtimeEventsForTurn");listModelUsageRecords=r(e=>this.usage.listModelUsageRecords(e),"listModelUsageRecords");async appendRuntimeEvent(e){return fe.parse(await this.request({action:"event_append",event:e},`review-event:${e.id}`))}async upsertModelUsageRecord(e){await this.request({action:"usage_put",record:e},`review-usage:${g(e)}`)}};import{randomUUID as sr}from"node:crypto";async function It(l,e){let t=Ie.parse(await l.request({contractVersion:h,requestId:sr(),operation:"refiner/execute",params:{action:{action:"active_release",workspaceId:e}}}));return M(t,"Hosted Refiner active release"),t}r(It,"loadHostedRefinerRelease");import{randomUUID as or}from"node:crypto";var ar=n.object({personalizationSoul:n.string().max(8e3).optional(),userInstructions:n.string().max(64e3).optional(),preferences:me.optional()}).strict(),nr=n.object({revision:n.number().int().positive(),settings:ar}).strict();async function ye(l){let e=await l.request({contractVersion:h,requestId:or(),operation:"settings/get",params:{}}),t=e===null?null:nr.parse(e);return{revision:t?.revision??null,personalizationSoul:t?.settings.personalizationSoul??Ce[0].content,userInstructions:t?.settings.userInstructions??"",preferences:t?.settings.preferences??me.parse({})}}r(ye,"loadHostedRuntimeSettings");import{randomUUID as kt}from"node:crypto";function At(l){async function e(t){let o=await W(l,t);if(!o)throw new Error("No hosted Harness is selected for this run.");return o.workspace.id}return r(e,"workspaceId"),[{name:"memory_search",description:"Search bounded active memory for this selected Harness or Profile. Returns keys, revisions and short excerpts.",parameters:{type:"object",additionalProperties:!1,properties:{query:{type:"string",minLength:1,maxLength:500},limit:{type:"integer",minimum:1,maximum:20}},required:["query"]},execute:r(async t=>{let o=t.args.query;if(typeof o!="string"||!o.trim()||o.length>500)throw new Error("Memory query is invalid.");let a=t.args.limit===void 0?8:t.args.limit;if(typeof a!="number"||!Number.isInteger(a)||a<1||a>20)throw new Error("Memory search limit is invalid.");let c=await l.request({contractVersion:h,requestId:kt(),operation:"harness/memory/search",params:{workspaceId:await e(t.session),query:o,limit:a}});return{toolCallId:t.callId,name:"memory_search",ok:!0,contentText:JSON.stringify(c),data:c}},"execute")},{name:"memory_inspect",description:"Read one exact active memory entry returned by memory_search.",parameters:{type:"object",additionalProperties:!1,properties:{key:{type:"string",minLength:1,maxLength:120}},required:["key"]},execute:r(async t=>{let o=t.args.key;if(typeof o!="string"||!/^[a-z0-9][a-z0-9-]{0,119}$/.test(o))throw new Error("Memory key is invalid.");let a=await l.request({contractVersion:h,requestId:kt(),operation:"harness/memory/get",params:{workspaceId:await e(t.session),key:o}});if(!a||typeof a!="object"||Array.isArray(a)||a.status!=="active")throw new Error(`Harness memory does not exist: ${o}.`);return{toolCallId:t.callId,name:"memory_inspect",ok:!0,contentText:JSON.stringify(a),data:a}},"execute")}]}r(At,"createHostedHarnessMemoryTools");import{randomUUID as Ct}from"node:crypto";function Ot(l){return[{name:"work_list_outputs",description:"List this conversation's published outputs from completed turns without starting sandbox compute. Use this before reading a previously saved file; returns exact file IDs and revisions. New workspace files are published after the current turn ends. Inspect those with workspace tools and finish the turn instead of polling this list.",parameters:{type:"object",additionalProperties:!1,properties:{}},execute:r(async e=>{let t=await l.request({contractVersion:h,requestId:Ct(),operation:"output/list",params:{}});return{toolCallId:e.callId,name:"work_list_outputs",ok:!0,contentText:JSON.stringify(t),data:t}},"execute")},{name:"work_read_output",description:"Read the actual saved text/Markdown or PDF text of a file returned by work_list_outputs, without starting sandbox compute. Prefer this for questions about saved outputs. Use workspace tools for edits, execution and unsaved files. PDF text extraction does not inspect images or page appearance.",parameters:{type:"object",additionalProperties:!1,properties:{fileId:{type:"string",minLength:1,maxLength:191},revision:{type:"integer",minimum:1},offset:{type:"integer",minimum:0,maximum:1e7},maxChars:{type:"integer",minimum:1,maximum:1e5},firstPage:{type:"integer",minimum:1,maximum:1e3},pageCount:{type:"integer",minimum:1,maximum:10}},required:["fileId","revision"]},execute:r(async e=>{let t=await l.request(z.parse({contractVersion:h,requestId:Ct(),operation:"output/read",params:e.args}),6e4);return{toolCallId:e.callId,name:"work_read_output",ok:!0,contentText:JSON.stringify(t),data:t}},"execute")}]}r(Ot,"createHostedWorkOutputTools");import{randomUUID as _t}from"node:crypto";function qt(l,e){return{allowedTools:e,authorizeTool:r(async t=>{let o=await l.request({contractVersion:h,requestId:_t(),operation:"embedding/authorize",params:{sessionId:t.session.id,turnId:t.turnId,name:t.name}});if(!o||typeof o!="object"||Array.isArray(o)||o.allowed!==!0)throw new Error("Hosted tool authorization denied.")},"authorizeTool")}}r(qt,"createHostedEmbeddingAdapter");function Bt(l){return async e=>{let t=rt.parse(e);return l.request({contractVersion:h,requestId:_t(),operation:"sandbox/request",params:{action:t}},e.type==="create"?3e5:e.type==="exec"?18e4:6e4)}}r(Bt,"createHostedSandboxRequest");var ir=["sandbox/request","embedding/authorize","output/begin","output/chunk","output/complete","output/saveSandboxFile","output/list","output/read","settings/get","harness/get","harness/overlay/get","harness/overlay/put","harness/memory/get","harness/memory/list","harness/memory/search","harness/memory/write","harness/state/read","task-inbox/execute","create-improve/execute","approval/get","approval/upsert","usage/getByRequestId","usage/upsert","usage/page","session/count","session/get","session/page","session/put","turn/count","turn/wakeCount","turn/get","turn/put","turn/latest","turn/page","thread/turnPage","event/append","events/page","events/latestAssistantText"];function Dt(l){if(ir.some(e=>!l.operations.includes(e)))throw new Error("Hosted Postgres runtime capabilities are incomplete.");if(l.maxRequestBytes<256e3||l.maxInFlight<32||l.maxPageSize<200)throw new Error("Hosted Postgres runtime transport limits are incompatible.")}r(Dt,"assertHostedWorkCapabilities");var v=r(async()=>{throw new Error("This hosted control is not available until its Postgres repository is activated.")},"unavailable"),ur=De(),cr=Me();async function _o(l){let e=l.runtimeStorage,t=l.hostStorageClient;if(e.kind!=="hosted_postgres"||!t||e.client!==t)throw new Error("Hosted storage selection mismatch.");if(l.embedding||l.sandboxRequest)throw new Error("Hosted Postgres tool and sandbox authority must come from the host transport.");if(!l.streamOpenPondHostedChatTurn)throw new Error("Hosted Postgres runtime requires a host-admitted model stream.");if(l.profileSource||l.harness)throw new Error("Hosted Postgres runtime accepts only host-admitted immutable sources.");if(l.services&&Object.values(l.services).some(i=>i!==!1&&i!==void 0))throw new Error("Hosted service adapters must be admitted by the Postgres composition.");let o=st.parse(await t.request({contractVersion:h,requestId:Mt(),operation:"capabilities",params:{}}));Dt(o);let a=qt(t,o.allowedTools),c=Bt(t),u=V.resolve(l.storeDir??process.cwd()),s=V.resolve(l.workspaceDir??process.cwd());await lr(s,{recursive:!0});let d=We({channel:"app-server",logDir:V.join(u,"logs"),metadata:{version:l.version??_e,runtimeVersion:Ne(),placement:"hosted_work"}}),m=e.core,f=new ne(t,u),S=e.admittedProfileRelease?await lt(t,e.admittedProfileRelease):{profile:cr,profileLibrary:ur},{appendRuntimeEvent:y,closeEventSubscribers:b,subscribeRuntimeEvents:P}=Ze({logger:d,assistantDeltaFlushMs:250,store:{appendRuntimeEvent:r(i=>["harness.refiner.queued","harness.refiner.started","harness.refiner.completed","harness.refiner.failed"].includes(i.name)?f.appendRuntimeEvent(i):m.appendRuntimeEvent(i),"appendRuntimeEvent"),runtimeEventPageRows:r(i=>m.runtimeEventPageRows(i),"runtimeEventPageRows")}}),p=ee({queueId:"turn-follow-up",logger:d}),H=ee({queueId:"subagent",logger:d}),x=Ke(l.streamOpenPondHostedChatTurn,{enabled:$e()}),E=ee({queueId:"harness-refiner",logger:d,concurrency:1}),D=Pt({store:f,storeDir:u,queue:E,streamOpenPondHostedChatTurn:x,appendRuntimeEvent:y,upsertModelUsageRecord:r(i=>f.upsertModelUsageRecord(i),"upsertModelUsageRecord"),prepareReview:r(i=>f.prepareReview(i),"prepareReview"),loadActiveRefinerRelease:r(async()=>{let i=await O(t);if(!i)throw new Error("Hosted review has no admitted Harness workspace.");return It(t,i.workspace.id)},"loadActiveRefinerRelease")}),Re=r(async()=>(await ye(t)).preferences,"preferences"),{createSession:ie,getSession:q,updateSession:L,completeTurn:zt,failTurn:jt,interruptTurn:Nt}=et({store:m,defaultSessionCwd:r(()=>s,"defaultSessionCwd"),appendRuntimeEvent:y,loadAppPreferences:Re,loadLastUsedProfile:r(async()=>S.profileLibrary.lastUsed,"loadLastUsedProfile")}),le=Je({workspaceDir:s,logger:d,getSession:q,updateSession:L,appendRuntimeEvent:y,sandboxRequest:c,sandboxCreationMode:"hosted_worker"}),G=Ge({appendRuntimeEvent:y,findLocalProject:r(async()=>null,"findLocalProject"),onRepositoryInstructionDiagnostic:r((i,w)=>d.warn("repository instruction file skipped",{diagnostic:i,sessionId:w.id}),"onRepositoryInstructionDiagnostic")}),Se=new re(t),$=new ae(t),Pe=Et(t),ue=Ht(t),K=e.admittedProfileRelease?.hostExecution?await O(t,e.admittedProfileRelease.harnessRelease):null;if(e.admittedProfileRelease?.hostExecution&&(!K||!o.operations.includes("output/readBytes")||!o.operations.includes("profile-evaluations/sandbox")||!o.operations.includes("profile-evaluations/grade")))throw new Error("Hosted evaluation requires its admitted release, managed artifact owner and private sandbox grader.");let Ft=Fe({deviceId:"hosted-evaluation",storeDir:u,runtimeEventsForSession:r(i=>m.runtimeEventsForSession(i),"runtimeEventsForSession"),managedPersistence:{...Pe.persistence,sourceTurnStartedAt:r(async(i,w)=>{let R=await m.getTurn(w);if(!R||R.sessionId!==i||!R.startedAt)throw new Error("The managed output has no actual started case turn.");return R.startedAt},"sourceTurnStartedAt")}}),k=K?at({readOutput:ue.readOutput,executeCommand:ue.execute,settleRemote:ue.settle,runtimeNode:"node",runtimeAgentRoot:"/workspace/runtime",storeDir:u,release:K.release,getSession:q,getTurn:r(i=>m.getTurn(i),"getTurn"),saveOutput:Ft.saveOwnedOutputBytes,recordOutput:r(async(i,w,R)=>{await y({id:Mt(),timestamp:new Date().toISOString(),name:"workspace_action_result",source:"server",sessionId:i,turnId:w,action:"work_output_save",status:"completed",data:R})},"recordOutput"),authorize:r(async()=>{let i=await O(t,e.admittedProfileRelease.harnessRelease);if(!i||i.release.harnessRelease.contentHash!==K.release.harnessRelease.contentHash)throw new Error("The hosted isolated evaluation source authority changed.")},"authorize")}):null,Ut=tt(a,async(i,w)=>{let R=await m.getTurn(i);if(!R)throw new Error("Embedded turn is unavailable.");let C=await q(R.sessionId),Q=C.metadata?.embeddingToolBindings,N=[...w].sort((J,Wt)=>J.name.localeCompare(Wt.name));if(Q!==void 0&&g(Q)!==g(N))throw new Error("Embedded tool bindings changed; start a new thread.");await L(C.id,{metadata:{...C.metadata,embeddingToolBindings:N}}),await m.updateTurn(i,J=>({...J,metadata:{...J.metadata,toolBindings:N}}))}),T=Ye({executionHost:"embedded",workInputsForSession:l.workInputsForSession,attachmentRootDir:V.join(u,"attachments"),isolatedProfileEvaluationForTurn:k?async i=>{if(i.metadata?.profileEvaluationRun===void 0)return!1;if(!k.ownsSession(i.id))throw new Error("The hosted evaluation has no actual isolated case owner.");return!0}:void 0,executeProfileEvaluationAction:k?.executeAction,resolveModelTools:r(async i=>{let w=k?.ownsSession(i.session.id)?await k.resolveTools(i):await Ut(i);return l.resolveModelTools?l.resolveModelTools({...i,tools:w}):w},"resolveModelTools"),hostedToolFlags:{toolMode:"native",nativeToolTransport:!0,nativeToolProviderDenylist:[],textToolFallback:!1},store:m,inboxStore:e.inbox,createSession:ie,getSession:q,updateSession:L,completeTurn:zt,failTurn:jt,interruptTurn:Nt,upsertApproval:r(i=>m.upsertApproval(i),"upsertApproval"),defaultSessionCwd:r(()=>s,"defaultSessionCwd"),findOpenPondApp:r(async i=>({id:i||qe(s),name:V.basename(s)||"Workspace",description:null,visibility:"private",sandbox:!0}),"findOpenPondApp"),resolveSessionWorkspaceCwd:r(async i=>i.cwd?.trim()||s,"resolveSessionWorkspaceCwd"),ensureCodexRuntime:r(async()=>{throw new Error("Codex process hosting is unavailable.")},"ensureCodexRuntime"),appendWorkspaceDiffEvent:le.appendWorkspaceDiffEvent,workspaceDiffBaseline:le.workspaceDiffBaseline,appendRuntimeEvent:y,executeWorkspaceTool:le.executeWorkspaceTool,executeOpenPondCommand:r(async()=>{throw new Error("Hosted commands require durable authorization.")},"executeOpenPondCommand"),loadOpenPondProfileState:r(async()=>S.profile,"loadOpenPondProfileState"),loadOpenPondProfileLibrary:r(async()=>S.profileLibrary,"loadOpenPondProfileLibrary"),readOpenPondProfileSkill:v,loadSelectedHarnessRuntime:r(i=>{if(i.currentProfile&&(!e.admittedProfileRelease||i.currentProfile.repositoryId!==e.admittedProfileRelease.repositoryId||i.currentProfile.profileId!==e.admittedProfileRelease.profileId))throw new Error("Hosted Profile session lacks admitted immutable source.");return W(t,i)},"loadSelectedHarnessRuntime"),ensureHarnessRunOverlay:r(i=>Se.ensureHarnessRunOverlay(i),"ensureHarnessRunOverlay"),processHarnessImprovementBoundary:D,harnessModelTools:[...At(t),...Ot(t)],loadBuiltInOpenPondSkills:r(async()=>[],"loadBuiltInOpenPondSkills"),readBuiltInOpenPondSkill:v,loadPersonalizationSoul:r(async()=>(await ye(t)).personalizationSoul,"loadPersonalizationSoul"),loadAppPreferences:Re,maybeCreateScaffoldForTurn:G.maybeCreateScaffoldForTurn,hostedSystemPrompt:G.hostedSystemPrompt,appendAssistantText:G.appendAssistantText,appendHostedContextUsage:G.appendHostedContextUsage,streamOpenPondHostedChatTurn:x,turnFollowUpQueue:p,subagentQueue:H,maxHostedWorkspaceToolRounds:Xe(l.maxHostedWorkspaceToolRounds),maxRepeatedInvalidToolRequests:3});await T.recoverPendingSubagentCompletions(),await T.recoverTaskInbox();let He=!1,Ee=r(async(i,w)=>{if(X.parse(w).attachments?.length&&!k?.ownsSession(i))throw new Error("Hosted attachments require managed-file admission.");let R=await q(i);if(R.currentProfile&&(!e.admittedProfileRelease||R.currentProfile.repositoryId!==e.admittedProfileRelease.repositoryId||R.currentProfile.profileId!==e.admittedProfileRelease.profileId))throw new Error("Hosted Profile session lacks admitted immutable source.");return He||(await D.reconcilePending(),await E.drain(),He=!0),T.sendTurn(i,w)},"sendTurn");if(l.profileExternalDataset&&!e.admittedProfileRelease?.hostExecution)throw new Error("External Dataset requires its admitted hosted evaluation.");let A=e.admittedProfileRelease?.hostExecution?await bt({client:t,core:m,release:e.admittedProfileRelease,storeDir:u,...l.profileExternalDataset?{externalDataset:l.profileExternalDataset}:{},readManagedArtifact:Pe.read,admitSession:k.admitSession,settleSession:k.settleSession,createSession:ie,sendTurn:Ee,interruptSessionTurn:T.interruptSessionTurn}):null,be=!1;return{...Ue({ports:Qe({bindHome:!1,placement:"hosted_work",connectedAppProviders:[],featureOverrides:{profileWorkflows:!!e.admittedProfileRelease,profileEvaluations:!!A,harnessProposalReview:!1,harnessEvaluationReview:!1,harnessEvaluationReviewAcceptance:!1,harnessEvaluationTasksetMaterialization:!1,harnessEvaluationBaseline:!1,harnessBackgroundReview:!1,harnessDiff:!1,harnessRollback:!1,harnessReview:!1,refinerProfiles:!1,immutableRefinerAdmission:!1},createSession:ie,getSession:q,turnsForSession:r(i=>m.turnsForSession(i,1e3),"turnsForSession"),runtimeEventsForSession:r(i=>m.runtimeEventsForSession(i,{excludeReasoningDeltas:!0}),"runtimeEventsForSession"),sendTurn:Ee,steerSessionTurn:T.steerSessionTurn,readTaskInbox:T.readTaskInbox,queueTaskInput:T.queueTaskInput,updateTaskInput:T.updateTaskInput,isSessionTurnActive:T.isSessionTurnActive,waitForSessionTurnSettlement:T.waitForSessionTurnSettlement,interruptSessionTurn:T.interruptSessionTurn,resolveApproval:r(async(i,w)=>{let R=await T.resolveCreateImproveApproval(i,w);if(R)return R;let C=await T.resolveSubagentPatchApplyApproval(i,w);if(C)return C;throw new Error(`Approval not found: ${i}`)},"resolveApproval"),listProfileWorkflows:e.admittedProfileRelease?()=>se(t,e.admittedProfileRelease):v,listProfileEvaluations:A?.listProfileEvaluations??v,loadProfileTrainingSource:v,prepareProfileEvaluationRun:A?.prepareProfileEvaluationRun??v,runPreparedProfileEvaluation:A?.runPreparedProfileEvaluation??v,runProfileEvaluationSuite:A?.runProfileEvaluationSuite??v,executeProfileEvaluationCase:A?.executeProfileEvaluationCase??v,executeProfileEvaluationRun:A?.executeProfileEvaluationRun??v,compareProfileEvaluationRuns:A?.compareProfileEvaluationRuns??v,buildProfileEvaluationReport:A?.buildProfileEvaluationReport??v,inspectHarness:r(async()=>{let i=await O(t);if(!i)return null;let w=i.workspace.id,[R,C,Q,N]=await Promise.all([$.getPreference(w,"workspace_settings"),$.getPreference(w,"evaluation_review_settings"),$.listCandidates(w),$.listCrossRunRequests(w)]);return{workspace:i.workspace,release:i.release,backgroundReview:R,evaluationReview:C,refinementCandidates:Q,crossRunRequests:N}},"inspectHarness"),reviewHarnessProposal:v,reviewHarness:v,acceptHarnessEvaluationReview:v,materializeHarnessEvaluationTaskset:v,runHarnessEvaluationBaseline:v,validateHarness:r(async()=>{let i=await O(t);return i?{valid:!0,workspaceId:i.workspace.id,harnessRelease:i.release.harnessRelease,agentSnapshot:i.release.agentSnapshot}:{valid:!1,reason:"No admitted hosted Harness release."}},"validateHarness"),updateHarnessBackgroundReview:v,diffHarness:v,rollbackHarness:v,inspectRefiner:v,updateRefiner:v,activateRefiner:v,rollbackRefiner:v,subscribeRuntimeEvents:P,observeRuntimeOperation:r(i=>d.info("agent runtime operation",i),"observeRuntimeOperation")}),close:r(async()=>{be||(be=!0,k?.close(),await T.close(),await Promise.all([p.drain(),H.drain(),E.drain()]),await b(),await d.flush())},"close")}),updateSession:L,storePath:"hosted-postgres",workspaceDir:s,pinSessionHarness:r(async i=>{let w=await W(t,await q(i));if(!w)return null;let R={id:w.release.harnessRelease.id,contentHash:w.release.harnessRelease.contentHash};return await Se.ensureHarnessRunOverlay({runId:i,workspace:w.workspace,harnessRelease:R,admittedAt:new Date().toISOString()}),R},"pinSessionHarness"),composition:["runtime_event_bus","session_store","hosted_provider","workspace_tools","command_approvals","harness","agent_runtime","jsonl_transport"]}}r(_o,"createHostedOwnedAppServer");export{_o as createHostedOwnedAppServer};
@@ -0,0 +1,3 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{a as xe,b as Ee,c as Te,d as Pe,e as Ae,f as Ce,h as B,i as je,j as ze}from"./chunk-FHLSLOKH.js";import{e as De,f as U}from"./chunk-B32CW3NT.js";import{A as He,v as ye,w as Re}from"./chunk-LI3FTPAH.js";import"./chunk-4D3CICBG.js";import{b as Se}from"./chunk-IEVJLG3V.js";import"./chunk-OW3EOC5Q.js";import{b as be,c as ke}from"./chunk-Q3WXB465.js";import"./chunk-FEAKTSRS.js";import{a as z}from"./chunk-TPOAAJKA.js";import"./chunk-WLQEONBF.js";import"./chunk-YU4JYWCA.js";import"./chunk-XVDFJ3ZF.js";import"./chunk-3MVKXAH7.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-67HXM6AL.js";import"./chunk-JLW5BQVO.js";import"./chunk-ANG2YMMD.js";import"./chunk-YBKDEEEH.js";import"./chunk-6TRVEA3T.js";import{a as ge,b as we}from"./chunk-FEQ7HNJR.js";import"./chunk-LYVHYT3L.js";import{a as Ie}from"./chunk-DSJZS77R.js";import"./chunk-2GJD23CM.js";import{b as ve,c as G}from"./chunk-EVQISX7M.js";import"./chunk-66HFW4OU.js";import"./chunk-AN525SPP.js";import"./chunk-H5ML7735.js";import"./chunk-SYUKES6H.js";import"./chunk-XHBMK6LC.js";import"./chunk-6I5AUTVO.js";import"./chunk-IZ6DLEVY.js";import"./chunk-QJJNHKLT.js";import{b as me,i as fe,m as D,n as he}from"./chunk-ZU3YBRXS.js";import"./chunk-DIDQHTAX.js";import"./chunk-Z2TOBS3P.js";import"./chunk-7PXZ4X4P.js";import"./chunk-MCBRB5D6.js";import"./chunk-7KWD2I6W.js";import{y as W}from"./chunk-4TTXNVCE.js";import"./chunk-HNDAGZCF.js";import"./chunk-YU3C6U5V.js";import"./chunk-KVTBX2UP.js";import"./chunk-BJXPQIVD.js";import"./chunk-QYQZQVVN.js";import"./chunk-GFAI2MCJ.js";import"./chunk-VS2LOUCT.js";import"./chunk-DMFUEUAZ.js";import"./chunk-GF55VEMR.js";import"./chunk-LZPCA6DH.js";import"./chunk-L3KS6MOV.js";import"./chunk-GUG2SWRZ.js";import"./chunk-G4747MOW.js";import"./chunk-KCJVFLBB.js";import{a as ce,ha as le,ia as ue,w as C,x as $}from"./chunk-MVPKU72J.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-GD3RCUDH.js";import{A as pe}from"./chunk-QCJY6FTC.js";import"./chunk-UTIELP6F.js";import{g as se,l as V,n as de}from"./chunk-6S2MWJVD.js";import"./chunk-FYWQWKVS.js";import"./chunk-6ESBAHWK.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-7J2NMUTK.js";import"./chunk-W45RKGM6.js";import"./chunk-W45RKGM6.js";import"./chunk-7PKTCMZ6.js";import"./chunk-LXZLLTYQ.js";import"./chunk-GI7LTJV3.js";import"./chunk-VS3AMJEK.js";import"./chunk-XGY4OQLC.js";import"./chunk-AF3AVDPP.js";import"./chunk-SFR32TMJ.js";import"./chunk-5KJMFK65.js";import"./chunk-Y3B6ZUE6.js";import"./chunk-4N4EH3RJ.js";import"./chunk-ULJZ7NUF.js";import"./chunk-WJSJXK2N.js";import"./chunk-O6ZYDHEJ.js";import"./chunk-OKEC2EIE.js";import{ga as ae,ja as ie}from"./chunk-WLZJOCLA.js";import"./chunk-HIQPGYVH.js";import"./chunk-ZWW227M3.js";import"./chunk-DXA2UHBE.js";import"./chunk-MTP3B2SU.js";import{c as re,d as oe,f as ne}from"./chunk-LK77GI6M.js";import{c as Y,g as ee}from"./chunk-HVM2GUM3.js";import"./chunk-JCLTFDVW.js";import"./chunk-I6VMRQF4.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-6FA3GG5B.js";import"./chunk-G4E3WGLM.js";import{Eb as M}from"./chunk-ZY32SZ2P.js";import{r as te}from"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-SH7POUVX.js";import"./chunk-2MEOUS24.js";import{f as X}from"./chunk-HNQPEOJD.js";import{m as J,n as R}from"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import{A as e}from"./chunk-X2J2P5ZT.js";import"./chunk-UGOK7VTC.js";import{a as i}from"./chunk-FTQLQJQV.js";import{promises as $e}from"node:fs";import Ue from"node:path";import Le from"node:http";var Q=e.object({socketPath:e.string().min(1).max(1e3),capability:e.string().regex(/^[a-f0-9]{64}$/),jobId:e.string().min(1),pinHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),Ne=e.object({jobId:e.string().min(1),pinHash:e.string().regex(/^[a-f0-9]{64}$/),requestId:e.string().min(1).max(500),model:X,reasoningEffort:e.enum(["off","low","medium","high","xhigh","max","none"]).nullable(),messages:e.array(e.unknown()).min(1).max(1e3),tools:e.array(e.unknown()).max(100),toolChoice:e.unknown(),maxOutputTokens:e.number().int().positive().max(131072),temperature:e.number().finite().optional(),topP:e.number().finite().optional(),seed:e.number().int().optional()}).strict(),Je=e.discriminatedUnion("kind",[e.object({kind:e.literal("chat_completions_reasoning"),reasoningContent:e.string()}).strict(),e.object({kind:e.literal("responses_reasoning_items"),items:e.array(e.record(e.string(),e.unknown()))}).strict()]),Ve=e.object({id:e.string().optional(),type:e.string(),function:e.object({name:e.string().optional(),arguments:e.string().optional()}).passthrough().optional()}).passthrough(),Ge=e.object({text:e.string().optional(),usage:e.unknown().optional(),costUsd:e.number().finite().nonnegative().optional(),continuation:Je.optional(),toolCalls:e.array(Ve).optional()}).strict();function qe(s,r){let t=Q.parse(s);async function n(u,v,I=r){I.throwIfAborted();let x=Buffer.from(JSON.stringify({action:u,jobId:t.jobId,pinHash:t.pinHash,value:v}));if(x.length>8*1024*1024)throw new Error("Hosted advanced request exceeds its private byte limit.");return new Promise((y,h)=>{let l=Le.request({socketPath:t.socketPath,path:"/",method:"POST",headers:{authorization:`Bearer ${t.capability}`,"content-type":"application/json","content-length":x.length},signal:I},H=>{let E=[],P=0;H.on("data",w=>{if(P+=w.length,P>8388608){H.destroy(new Error("Hosted advanced response exceeds its private byte limit."));return}E.push(w)}),H.on("error",h),H.on("end",()=>{try{let w=JSON.parse(Buffer.concat(E).toString("utf8"));if(H.statusCode!==200)throw new Error(typeof w?.error=="string"?w.error:"The actual hosted advanced owner refused this operation.");y(w)}catch(w){h(w)}})});l.on("error",h),l.end(x)})}i(n,"call");let d=i(async function*(u){let v=Ne.parse({jobId:t.jobId,pinHash:t.pinHash,requestId:u.requestId,model:u.model,reasoningEffort:u.reasoningEffort,messages:u.messages,tools:u.tools,toolChoice:u.toolChoice,maxOutputTokens:u.maxOutputTokens??4096,...u.temperature===void 0?{}:{temperature:u.temperature},...u.topP===void 0?{}:{topP:u.topP},...u.seed===void 0?{}:{seed:u.seed}}),I=e.object({deltas:e.array(Ge).max(1e5)}).strict().parse(await n("model",v,AbortSignal.any([r,u.signal])));for(let x of I.deltas)yield x},"stream");return{stream:d,text:i(async u=>{let v="";for await(let I of d({...u,reasoningEffort:u.reasoningEffort??null,tools:[],toolChoice:"none"}))I.text&&(v+=I.text),I.usage!==void 0&&u.onUsage?.(I.usage,I.costUsd);return v},"text"),authorize:i(async()=>{await n("authorize",{})},"authorize"),ceiling:i(async(u,v,I)=>e.object({configurationHash:e.string().regex(/^[a-f0-9]{64}$/),maximumChargeUsd:e.number().finite().positive()}).strict().parse(await n("ceiling",{modelId:u,pricing:v,maximumOutputTokens:I})),"ceiling"),compute:i((u,v=!1)=>n("compute",u,v?AbortSignal.timeout(6e4):r),"compute"),checkpoint:i(u=>n("checkpoint",u),"checkpoint")}}i(qe,"createHostedAdvancedModelBridge");import Qe from"node:path";var Me=e.string().regex(/^[a-f0-9]{64}$/),Ke=e.object({taskId:e.string().min(1),caseHash:Me,session:C,turn:$,events:e.array(ce).max(1e4),traceHash:Me,output:e.string().nullable()}).strict(),K=e.object({packageValue:ae,contexts:e.array(Ke).max(1e4)}).strict();async function _e(s){let r=V(s.pin),t=K.parse(s.privateSource),n=ie(t.packageValue),d=M(e.object({manifest:e.unknown(),result:e.unknown()}).parse(s.evidence));async function m(){if(await s.authorize(),r.actorId!==s.actor.actorId||r.teamId!==s.actor.teamId||r.profileRef.source!=="openpond_git"||r.profileRef.repositoryId!==s.source.repositoryId||r.profileRef.profileId!==s.source.profileId||r.sourceRevision!==s.source.sourceRevision)throw new Error("The actual hosted advanced source owner changed.")}if(i(m,"authorize"),await m(),d.manifest.teamId!==r.teamId||d.result.status!=="completed"||d.manifest.id!==r.evidence.id||d.result.contentHash!==r.evidence.contentHash||R(d.manifest.dataset)!==R(r.externalDatasetBinding.dataset))throw new Error("The exact completed hosted advanced evidence changed.");if(n.contentHash!==r.externalDatasetBinding.packageHash||n.contentHash!==r.adaptationDatasetBinding.packageHash||n.environment.contentHash!==r.environmentPolicy.environmentHash||n.environment.contract.networkPolicy!=="none")throw new Error("The hosted advanced environment/package is not the exact reviewed closed-network release.");if(n.taskset.tools.some(l=>l.name==="web_search"||l.name==="web_fetch"))throw new Error("Live external tools require their own qualified frozen-observation and budget owner.");if(n.verifierSet.graders.some(l=>l.kind==="human"||l.kind==="model_judge"&&l.calibrationStatus!=="passed"))throw new Error("Advanced hosted evaluation needs executable, qualified independent graders.");let u=r.adaptationTaskIds.map(l=>n.taskset.tasks.find(H=>H.id===l)),v=r.holdoutTaskIds.map(l=>n.taskset.tasks.find(H=>H.id===l)),I=new Set(u.map(l=>l?.clusterKey));if(u.some(l=>!l||l.split!==r.adaptationSplit)||v.some(l=>!l||l.split!==r.holdoutSplit||I.has(l.clusterKey)))throw new Error("Hosted adaptation/holdout membership or independent families changed.");let x=await s.store.getHarnessReleaseRecord(r.baselineRelease.contentHash);if(!x||x.harnessRelease.id!==r.baselineRelease.id||s.workspace.currentChannel.release?.contentHash!==r.baselineRelease.contentHash)throw new Error("The exact hosted source baseline is unavailable.");let y=await D({workspaceId:typeof x.agentSnapshot.metadata.workspaceId=="string"?x.agentSnapshot.metadata.workspaceId:x.workspaceId,sourceDir:Qe.join(x.bundlePath,"source")});if(z(y).protectedClosureHash!==r.privateClosureHash)throw new Error("The protected hosted Profile closure changed.");let h={packageValue:n,authorize:m};return{read:i(async l=>{if(V(l).contentHash!==r.contentHash)throw new Error("The actual hosted advanced admission changed.");return await m(),h},"read"),evidence:i(async()=>(await m(),d),"evidence"),authorize:i(async()=>m(),"authorize"),reviewContext:i(async(l,H)=>{await m();let E=t.contexts.filter(p=>p.taskId===H),P=d.result.cases.find(p=>p.identity.caseId===H);if(E.length!==1||!P||P.status!=="completed")throw new Error("The actual retained hosted review case is unavailable.");let w=E[0];if(w.caseHash!==R(P)||w.session.cloudTeamId!==r.teamId||w.turn.sessionId!==w.session.id||w.turn.status==="in_progress"||w.events.some(p=>p.sessionId!==w.session.id||p.turnId!==w.turn.id))throw new Error("The actual hosted review session/turn/trace binding changed.");return await m(),{...w,case:{output:w.output}}},"reviewContext")}}i(_e,"createHostedAdvancedRefinerSource");import{randomUUID as Ze}from"node:crypto";function Oe(s){async function r(n){let d=await s.store.getSession(n);if(!d||d.cloudTeamId!==s.teamId||d.metadata?.hostedAdvancedTurnId!==s.hostedTurnId||d.metadata?.parentModelRunId!==s.modelRunId)throw new Error("The actual hosted advanced case owner changed.");return d}i(r,"read");async function t(n,d,m){let u=await r(n),v=e.object({action:e.string()}).passthrough().parse(d).action;return ue.parse(await s.bridge.compute({session:u,payload:d,turnId:m??null},v==="sandbox_stop"||v==="sandbox_receipts"))}return i(t,"tool"),{createSession:i(async n=>{await s.bridge.authorize();let d=C.partial().parse(n),m=new Date().toISOString();if(d.metadata?.parentModelRunId!==s.modelRunId)throw new Error("The foreground case belongs to another actual advanced Run.");let u=C.parse({...d,id:`hosted-advanced-case-${Ze()}`,provider:"openpond",currentProfile:s.profileRef,cloudTeamId:s.teamId,cwd:null,codexThreadId:null,appId:null,appName:null,createdAt:m,updatedAt:m,status:"active",pinned:!1,archived:!1,order:0,hiddenFromDefaultSidebar:!0,title:d.title??"Advanced hosted evaluation case",metadata:{...d.metadata,source:"hosted-advanced-evaluation",hostedAdvancedTurnId:s.hostedTurnId,actorId:s.actorId,workspaceTarget:"hosted",benchmarkRuntime:"hosted_managed_work"}});return await s.store.insertSessionAtFront(u),await s.bridge.authorize(),u},"createSession"),getSession:r,runtimeEventsForSession:i(n=>s.store.runtimeEventsForSession(n),"runtimeEventsForSession"),executeWorkspaceTool:i((n,d,m)=>t(n,d,m?.turnId),"executeWorkspaceTool"),settleCostEvidence:i((n,d)=>t(n,{action:"sandbox_receipts",args:{}},d?.turnId),"settleCostEvidence")}}i(Oe,"createHostedAdvancedWorkRuntime");var Xe=e.string().regex(/^[a-f0-9]{64}$/),Be=e.object({version:e.string().min(1),source:e.string().min(1),effectiveAt:e.string().min(1),inputUsdPerMillionTokens:e.number().finite().nonnegative(),cachedInputUsdPerMillionTokens:e.number().finite().nonnegative(),outputUsdPerMillionTokens:e.number().finite().nonnegative()}).strict(),Z=e.object({operation:e.enum(["prepare_run","start","read","resume","cancel"]),request:de,configuration:e.object({id:e.string().min(1),profileId:e.string().min(1),etag:Xe}).strict(),refinerRelease:Y,privateSource:K,upstream:e.object({modelId:e.string().min(1),revision:e.string().min(1),pricing:Be}).strict(),judgeModels:e.array(e.object({modelId:e.string().min(1),revision:e.string().min(1),pricing:Be}).strict()).max(50),bridge:Q.optional(),hostedTurnId:e.string().min(1).optional()}).strict();async function Fe(s){let r=Z.parse(s.request),t=r.request.pin;if(r.request.model.providerId!=="openpond"||r.request.model.modelId!==r.upstream.modelId||r.configuration.id!==r.request.modelId||r.configuration.profileId!==t.profileRef.profileId||r.request.profileId!==t.profileRef.profileId||r.refinerRelease.id!==t.refinerRelease.id||r.refinerRelease.contentHash!==t.refinerRelease.contentHash)throw new Error("The actual hosted advanced configuration/model/Refiner admission changed.");let n=`advanced-refiner-${R([t.actorId,t.teamId,t.operationId,t.contentHash,r.request.model,[r.request.seed],1]).slice(0,40)}`;if((r.operation==="start"||r.operation==="resume")&&(!r.bridge||!r.hostedTurnId))throw new Error("The actual hosted advanced execution grant is unavailable.");let m=r.bridge?qe(r.bridge,s.signal):null;if(r.bridge&&(r.bridge.jobId!==n||r.bridge.pinHash!==t.contentHash))throw new Error("The hosted model bridge belongs to another actual Run.");let u=i(async()=>{s.signal.throwIfAborted(),await s.authorize(),m&&await m.authorize()},"authorize"),v=await _e({...s,pin:t,privateSource:r.privateSource,authorize:u}),I=ge(we(s.storeDir));await I.persistRelease(r.refinerRelease),await I.writeSource(ee(r.refinerRelease.profile)),I.binding()?.release.contentHash!==t.refinerRelease.contentHash&&await I.transition(r.refinerRelease,{operation:"activate",bindingChanged:!0,actor:s.actor.actorId,reason:"Pin the actual hosted evaluation fork to its admitted immutable Refiner release.",authoringSkillHash:null});let y=Re({storeDir:s.storeDir,authorize:i(async()=>u(),"authorize"),packageForPin:i(async()=>r.privateSource.packageValue,"packageForPin"),prepareModel:i(async(c,f,k)=>{if(!m)throw new Error("The actual hosted model ceiling owner is unavailable.");return m.ceiling(c,k,f)},"prepareModel")}),h=i(async function*(c){let f=ye(),k=[r.upstream,...r.judgeModels].find(q=>q.modelId===c.model.modelId);if(!m||!f||!k)throw new Error("The actual hosted model and durable shared budget are unavailable.");let{signal:T,...j}=c,O=c.maxOutputTokens??4096,L=await f.call(c.requestId,j,k.pricing,O,async()=>{let q=[],F=null;for await(let N of m.stream({...c,signal:AbortSignal.any([T,f.signal])}))q.push(N),N.costUsd!==void 0&&(F=(F??0)+N.costUsd);return{value:q,costUsd:F}});for(let q of L)yield q},"stream"),l=i(async c=>{let f="";for await(let k of h({...c,reasoningEffort:c.reasoningEffort??null,tools:[],toolChoice:"none"}))k.text&&(f+=k.text),k.usage!==void 0&&c.onUsage?.(k.usage,k.costUsd);return f},"text"),H=xe({store:s.store,storeDir:s.storeDir}),E=await H.projectSelected({profileId:t.profileRef.profileId,package:r.privateSource.packageValue,adaptationSplit:t.adaptationSplit,holdoutSplit:t.holdoutSplit}),P=i(async c=>{let f=C.partial().parse(c),k=new Date().toISOString(),T=C.parse({...f,id:`hosted-review-${R([n,f.metadata]).slice(0,40)}`,cloudTeamId:t.teamId,currentProfile:t.profileRef,appId:null,appName:null,cwd:null,codexThreadId:null,title:f.title??"Hosted Refiner review",provider:"openpond",createdAt:k,updatedAt:k,status:"active",pinned:!1,archived:!1,order:0,metadata:{...f.metadata,hostedAdvancedTurnId:r.hostedTurnId??null,actorId:t.actorId,source:"hosted-advanced-evaluation"}});return await s.store.insertSessionAtFront(T),T},"createSession"),w=m&&r.hostedTurnId?Oe({store:s.store,bridge:m,teamId:t.teamId,actorId:t.actorId,hostedTurnId:r.hostedTurnId,modelRunId:n,profileRef:t.profileRef}):void 0,p=He({store:s.store,storeDir:s.storeDir,modelJudge:Ee({store:s.store,modelText:l}),modelText:l,modelStream:h,workRuntime:w,resolveTasksetRelease:i(c=>H.releaseForTaskset(c),"resolveTasksetRelease")}),a={store:s.store,storeDir:s.storeDir,evaluation:p,benchmarkTasksets:H,loadProfileState:i(async()=>s.profile,"loadProfileState"),resolveEvaluationProject:i(async(c,f)=>{if(await u(),c!==r.configuration.id||f!==r.configuration.profileId)throw new Error("The actual hosted evaluation configuration changed.");return{id:c,profileId:f}},"resolveEvaluationProject"),resolveUpstreamModel:i(async()=>({providerId:"openpond",modelId:r.upstream.modelId,revision:r.upstream.revision,pricing:r.upstream.pricing}),"resolveUpstreamModel"),advancedBoundary:y,refinerStream:i(async function*(c){if(!c.requestId)throw new Error("A hosted Refiner call needs its actual retained ID.");yield*h({model:c.model,reasoningEffort:"low",messages:c.messages,tools:[],toolChoice:"none",requestId:c.requestId,maxOutputTokens:4096,signal:c.signal,hostedTokenPricing:c.pricing})},"refinerStream")},o=Te({...a,reviewQuality:Pe({source:v,boundary:y,benchmark:a,createSession:P})}),g={advancedEvaluation:t,selectedTaskset:{id:E.id,revision:E.revision,contentHash:E.contentHash},modelId:r.request.modelId,profileId:r.request.profileId,model:r.request.model,reasoningEffort:r.request.reasoningEffort,seeds:[r.request.seed],repetitions:1,maximumSpendUsd:t.maximumCostUsd},b,S=i(()=>{o.cancel(n)},"stop");s.signal.addEventListener("abort",S,{once:!0});try{if(r.operation==="prepare_run")return o.prepare(g);let c=await s.store.getModelRun(n);if(!c||c.evaluation?.benchmarkId!=="harness-refiner"||c.evaluation.advancedEvaluation?.contentHash!==t.contentHash)throw new Error("The original hosted advanced Run is unavailable.");if(r.operation==="read")return c;if(r.operation==="cancel")return o.cancel(n);if(m){let T=!1;b=setInterval(()=>{T||(T=!0,s.store.getModelRun(n).then(j=>j?m.checkpoint(j):void 0).catch(()=>S()).finally(()=>{T=!1}))},2e3)}r.operation==="start"?await o.start(g):await o.resume(n);let f=await o.wait(n);if(!f)throw new Error("The actual hosted advanced engine did not retain its Run.");let k=pe.parse(f);return m&&await m.checkpoint(k),k}finally{b&&clearInterval(b),s.signal.removeEventListener("abort",S),await o.close(),await y.close()}}i(Fe,"runHostedAdvancedRefinerOwner");import{promises as _}from"node:fs";import A from"node:path";var Ye=e.object({actor:e.object({actorId:e.string().min(1),teamId:e.string().min(1)}).strict(),storeDir:e.string().min(1),source:e.object({repoPath:e.string().min(1),repositoryId:e.string().min(1),profileId:e.string().min(1),sourceRevision:e.string().regex(/^[a-f0-9]{40,64}$/),filesHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),evidence:e.object({manifest:e.unknown(),result:e.unknown()}).strict(),operation:e.enum(["advanced","describe","command","queue","cancelQueued","bind","finish","beginTesting","cancelTesting","failTesting","comparison","beginAdoption","export","source","tool","toolCatalog"]),advanced:Z.optional(),command:se.optional(),candidateId:e.string().optional(),revision:e.number().int().positive().optional(),actualSession:C.optional(),actualTurn:$.optional(),recipe:e.unknown().optional(),baseline:e.object({manifest:e.unknown(),result:e.unknown()}).strict().optional(),candidate:e.object({manifest:e.unknown(),result:e.unknown()}).strict().optional(),humanProjection:oe.optional(),humanSelections:re.optional(),adoptionReadback:e.unknown().optional(),failure:e.object({message:e.string().max(2e3),cancelled:e.boolean()}).strict().optional(),tool:e.object({name:e.string(),args:e.record(e.string(),e.unknown()),callId:e.string()}).strict().optional(),agentRuntime:e.object({source:e.string(),cliRelativePath:e.string()}).strict().optional(),queued:e.object({sessionId:e.string(),turnId:e.string(),createdAt:e.string().datetime()}).strict().optional()}).strict();async function We(s,r=new AbortController().signal){r.throwIfAborted();let t=Ye.parse(s),{actor:n,source:d}=t;if(!A.isAbsolute(t.storeDir)||!A.isAbsolute(d.repoPath))throw new Error("Hosted candidate owner requires contained absolute private paths.");let m=M(t.evidence),u=[t.baseline,t.candidate].filter(l=>l!==void 0).map(l=>M(l));if(m.manifest.teamId!==n.teamId)throw new Error("Hosted candidate evidence belongs to another team.");if(await B(d.repoPath)!==d.filesHash)throw new Error("The admitted hosted Profile source bytes changed.");let v=`hosted-improve-source-${R([n,d.repositoryId,d.profileId,d.sourceRevision]).slice(0,40)}`,I=A.join(t.storeDir,"library","profile-experiment-origins",v);if(await _.mkdir(A.dirname(I),{recursive:!0,mode:448}),await _.stat(I).catch(()=>null)||await _.cp(d.repoPath,I,{recursive:!0,errorOnExist:!0,force:!1}),await B(I)!==d.filesHash)throw new Error("The private accepted Profile cache changed.");let x=await W(I,d.profileId);if(x.error||!x.sourcePath)throw new Error("The accepted hosted Profile does not compile.");let y=new Ie(t.storeDir),h;try{let l=await y.getHarnessWorkspace(v);l||(l=(await fe({store:y,storeDir:t.storeDir,id:v,ownerId:n.actorId,name:d.profileId,profile:x,sourceRevision:d.sourceRevision,repositoryId:d.repositoryId,selectionEligible:!1,originMetadata:{profileExperimentOrigin:{schemaVersion:"openpond.profileExperimentOrigin.v1",...n,sourceRevision:d.sourceRevision,sourcePath:I,sourceFilesHash:d.filesHash},hostedImprovementOwner:!0}})).workspace);let H={source:"openpond_git",repositoryId:d.repositoryId,profileId:d.profileId},E=i(async()=>{if(r.throwIfAborted(),await B(I)!==d.filesHash||await B(d.repoPath)!==d.filesHash)throw new Error("Accepted source changed during private candidate I/O.")},"authorizer");if(t.operation==="advanced"){if(!t.advanced)throw new Error("Missing actual hosted advanced owner command.");return Fe({store:y,storeDir:t.storeDir,actor:n,profile:x,workspace:l,source:d,evidence:m,request:t.advanced,authorize:E,signal:r})}let P=i(()=>{if(!t.adoptionReadback)throw new Error("Actual hosted Git owner has not returned its sealed adoption receipt.");return e.object({receipt:e.object({id:e.string(),contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),activeRelease:e.object({id:e.string(),contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),testedCandidateRelease:e.object({id:e.string(),contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),executableSourceHash:e.string().regex(/^[a-f0-9]{64}$/),protectedClosureHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict().parse(t.adoptionReadback)},"readback");h=Ae({store:y,storeDir:t.storeDir,projectHumanComparison:i(async()=>{if(await E(),!t.humanProjection)throw new Error("The current private Human comparison owner is unavailable.");return ne(t.humanProjection)},"projectHumanComparison"),authorizeOwner:i(async(a,o,g,b,S)=>{if(R(a)!==R(n)||R(g)!==R(H)||o.id!==v)throw new Error("Hosted candidate source owner changed.");if(S.requireCurrentBase&&(o.currentChannel.release?.contentHash!==l.currentChannel.release?.contentHash||d.sourceRevision!==o.metadata.profileExperimentOrigin.sourceRevision))throw new Error("Hosted candidate accepted revision changed.");await E()},"authorizeOwner"),loadEvidence:i(async(a,o)=>{if(R(a)!==R(n))throw new Error("Hosted candidate evidence actor changed.");let g=[m,...u].find(b=>b.manifest.id===o.id&&b.result.contentHash===o.contentHash&&b.manifest.teamId===n.teamId);if(!g)throw new Error("Hosted candidate exact retained evidence changed.");return await E(),g},"loadEvidence"),freezeProfile:i(async(a,o,g)=>{let b=await y.getHarnessReleaseRecord(o.baseRelease.contentHash);if(!b)throw new Error("Hosted source baseline is missing.");let S=await D({workspaceId:typeof b.agentSnapshot.metadata.workspaceId=="string"?b.agentSnapshot.metadata.workspaceId:b.workspaceId,sourceDir:A.join(b.bundlePath,"source")}),c=await D({workspaceId:typeof g.release.agentSnapshot.metadata.workspaceId=="string"?g.release.agentSnapshot.metadata.workspaceId:g.release.workspaceId,sourceDir:A.join(g.release.bundlePath,"source")});return je({store:y,storeDir:t.storeDir,state:o},async f=>{await De({...f,state:o,base:S,candidate:c});let k=await W(f.root,o.profileRef.profileId),T=await U({storeDir:t.storeDir,state:o,profile:k,sourceRevision:g.profileSourceRevision,base:S}),j=z(T);if(j.protectedClosureHash!==z(S).protectedClosureHash)throw new Error("Hosted source candidate changed protected evaluation closure.");let O=A.join(t.storeDir,"library","profile-candidate-archives",o.id,j.contentHash);await _.mkdir(A.dirname(O),{recursive:!0,mode:448}),await _.stat(O).catch(()=>null)||await _.cp(f.root,O,{recursive:!0,errorOnExist:!0,force:!1});let L=await W(O,o.profileRef.profileId);if((await U({storeDir:t.storeDir,state:o,profile:L,sourceRevision:g.profileSourceRevision,base:S})).harnessRelease.contentHash!==T.harnessRelease.contentHash)throw new Error("Hosted frozen Profile archive readback differs.");let F=await he({storeDir:t.storeDir,workspaceId:g.release.workspaceId,compiled:T,createdAt:g.release.createdAt});return await E(),{...g,release:F,executableIdentity:j}})},"freezeProfile"),adopt:i(async()=>P(),"adopt"),readAdoption:i(async()=>t.adoptionReadback?P():null,"readAdoption"),rollback:i(async()=>P(),"rollback")});let w=Ce({store:y,improvements:h,actorId:i(async()=>n.actorId,"actorId"),teamId:i(async()=>n.teamId,"teamId"),loadProfile:i(async a=>{if(R(a)!==R(H))throw new Error("Candidate requested another source owner.");return x},"loadProfile"),agentRuntime:t.agentRuntime,operationSignal:r,loadAgentRuntime:be({storeDir:t.storeDir,loadArchive:ke({storeDir:t.storeDir})})});if(t.operation==="describe"){await E();let a=l.currentChannel.release,o=a?await y.getHarnessReleaseRecord(a.contentHash):null;if(!a||!o||o.workspaceId!==l.id||o.harnessRelease.id!==a.id||o.harnessRelease.contentHash!==a.contentHash||l.ownerScope.kind!=="personal"||l.ownerScope.id!==n.actorId)throw new Error("Hosted source release is unavailable to its admitted owner.");let g=await D({workspaceId:typeof o.agentSnapshot.metadata.workspaceId=="string"?o.agentSnapshot.metadata.workspaceId:v,sourceDir:A.join(o.bundlePath,"source")});if(g.harnessRelease.contentHash!==o.harnessRelease.contentHash)throw new Error("Hosted source compiler readback changed.");let b=await Se({runtime:{release:o},ref:H,sourceRevision:d.sourceRevision,harnessRelease:a}),S=i(c=>{let f=g.sourceFiles.find(k=>k.path===c)?.bytes;return f?JSON.parse(Buffer.from(f).toString("utf8")):null},"readJson");return await E(),{workspaceId:v,ownerRevision:l.revision,profileRef:H,baseRelease:l.currentChannel.release,profileSourceRevision:d.sourceRevision,manifest:g.manifest,executable:z(g),catalogHash:b.catalogHash,workflows:S("workflows/catalog.json"),actions:S("workflows/actions.json")}}if(t.operation==="command"){let a=t.command;if(!a)throw new Error("Missing canonical Improve command.");if(a.operation==="start")return h.start(n,a.request);if(a.operation==="list")return h.list(n,a.limit,a.cursor);if(!("id"in a))throw new Error("Discover exact hosted source choices through the authenticated host.");let o=await h.read(n,a.id);if(a.operation==="read")return o;if(a.operation==="instructions"){let g=await h.partition(n,o.id),b=await me(g.sourceRoot,o.component.path),S=await _.readFile(b);if(S.length>25e4)throw new Error("Instruction editor size limit exceeded.");let c=S.toString("utf8");if(o.component.kind==="workflow"){let f=JSON.parse(c).workflows?.find(k=>k.id===o.component.workflowId);if(f?.invocation?.kind!=="instructions")throw new Error("Use Work to author this executable Workflow.");c=f.invocation.instructions}return{candidateId:o.id,candidateRevision:o.revision,path:o.component.path,text:c,textHash:J(c),contentHash:J(S)}}if(a.operation==="humanComparisonOptions")throw new Error("Read the actual paired sources through their current hosted Experiment owner.");if(!("revision"in a)||o.revision!==a.revision)throw new Error("Candidate revision changed.");if(a.operation==="edit")return h.edit(n,o.id,o.revision,a.expectedFileHash,a.text);if(a.operation==="mode")return h.setMode(n,o.id,o.revision,a.mode);if(a.operation==="freeze")return h.freeze(n,o.id,o.revision);if(a.operation==="useCandidate")return h.useCandidate(n,o.id,o.revision);if(a.operation==="rollback")return h.rollback(n,o.id,o.revision);if(a.operation==="discard")return h.discard(n,o.id,o.revision);throw new Error("Hosted Work/test lifecycle requires the actual host turn/run admission.")}if(!t.candidateId)throw new Error("Missing actual hosted candidate ID.");let p=await h.read(n,t.candidateId);if(t.operation==="beginAdoption")return h.beginAdoption(n,p.id,t.revision);if(t.operation==="export")return ze(y,p,"hosted_execution");if(t.operation==="source"){if(!p.frozen||p.status!=="frozen"&&p.status!=="testing"&&p.status!=="ready_for_review"&&p.status!=="adopting")throw new Error("Only the exact frozen source can enter hosted preparation.");let a=await y.getHarnessReleaseRecord(p.frozen.release.contentHash);if(!a||a.harnessRelease.id!==p.frozen.release.id)throw new Error("Frozen hosted source is unavailable.");let o=await D({workspaceId:typeof a.agentSnapshot.metadata.workspaceId=="string"?a.agentSnapshot.metadata.workspaceId:a.workspaceId,sourceDir:A.join(a.bundlePath,"source")}),g=z(o);if(o.harnessRelease.contentHash!==p.frozen.release.contentHash||g.contentHash!==p.frozen.executableSourceHash||g.protectedClosureHash!==p.frozen.protectedClosureHash)throw new Error("Frozen hosted executable changed.");let b=A.join(t.storeDir,"library","profile-candidate-archives",p.id,g.contentHash),S=await W(b,p.profileRef.profileId);if(S.error||!S.sourcePath)throw new Error("Frozen actual Profile archive is unavailable.");let c=await y.getHarnessReleaseRecord(p.baseRelease.contentHash);if(!c)throw new Error("Frozen baseline is unavailable.");let f=await D({workspaceId:typeof c.agentSnapshot.metadata.workspaceId=="string"?c.agentSnapshot.metadata.workspaceId:c.workspaceId,sourceDir:A.join(c.bundlePath,"source")}),k=await U({storeDir:t.storeDir,state:p,profile:S,sourceRevision:p.frozen.profileSourceRevision,base:f});if(k.harnessRelease.contentHash!==p.frozen.release.contentHash||z(k).contentHash!==g.contentHash)throw new Error("Actual frozen Profile archive differs from its compiled release.");return{state:p,profileSource:{repoPath:b,profileId:p.profileRef.profileId,sourceRevision:p.frozen.profileSourceRevision,repositoryId:p.profileRef.repositoryId,filesHash:await B(b)},sourcePackage:te({agentSnapshot:o.agentSnapshot,harnessRelease:o.harnessRelease,files:new Map(o.sourceFiles.map(T=>[T.path,T.bytes]))})}}if(t.operation==="comparison"){if(!t.baseline||!t.candidate)throw new Error("Missing actual hosted paired evidence.");return h.completeComparison(n,p.id,t.revision,M(t.baseline),M(t.candidate),t.humanSelections)}if(t.operation==="beginTesting")return h.beginTesting(n,p.id,t.revision,t.recipe);if(t.operation==="failTesting"){if(!t.failure)throw new Error("Missing actual hosted test failure.");return h.failTesting(n,p.id,t.revision,t.failure.message,t.failure.cancelled)}if(t.operation==="cancelTesting")return h.cancelTesting(n,p.id,t.revision);if(t.operation==="queue"){if(!t.queued)throw new Error("Missing actual hosted queue admission.");return h.queueAuthoringTurn(n,p.id,t.revision,t.queued.sessionId,t.queued.turnId,t.queued.createdAt)}if(t.operation==="cancelQueued")return h.cancelQueuedAuthoring(n,p.id,t.revision);if(t.operation==="bind"||t.operation==="finish"||t.operation==="tool"||t.operation==="toolCatalog"){if(!t.actualSession||!t.actualTurn||t.actualTurn.sessionId!==t.actualSession.id||t.actualSession.cloudTeamId!==n.teamId||R(t.actualSession.currentProfile)!==R(H))throw new Error("Actual hosted candidate Work binding changed.");let a=t.actualSession,o=t.actualTurn,g=await y.getSession(a.id);if(!g)await y.insertSessionAtFront(a);else if(R({...g,updatedAt:a.updatedAt,status:a.status})!==R(a))throw new Error("Retained hosted candidate session changed.");let b=await y.getTurn(o.id);if(!b)await y.insertTurn(o);else{if(b.sessionId!==o.sessionId||R(b.metadata.refinementCandidate)!==R(o.metadata.refinementCandidate)||b.prompt!==o.prompt)throw new Error("Actual hosted candidate turn identity changed.");await y.updateTurn(o.id,()=>o)}if(t.operation==="bind")return h.bindAuthoringTurn(n,p.id,t.revision,a.id,o.id);if(t.operation==="finish")return h.finishAuthoring(n,p.id,t.revision);if(t.operation==="toolCatalog")return await w.candidateAuthoringForTurn(a.id,o.id),[...G({loadProfileState:i(async()=>x,"loadProfileState"),resolveCandidateProfile:w.resolveCandidateProfile,executeCandidateAgentCommand:w.executeCandidateAgentCommand}),...ve(async()=>{throw new Error("Hosted file tools require a bound private call.")}),{name:"exec_command",description:"Run a bounded command confined to the selected public candidate component.",parameters:{type:"object",additionalProperties:!1,properties:{command:{type:"string",minLength:1,maxLength:2e4},cwd:{type:"string"}},required:["command"]}},{name:"view_image",description:"Inspect an image inside the candidate public source tree.",parameters:{type:"object",additionalProperties:!1,properties:{path:{type:"string"}},required:["path"]}}].map(({name:c,description:f,parameters:k})=>({name:c,description:f,parameters:k}));if(!t.tool)throw new Error("Missing candidate tool call.");await w.authorizeCandidateTool({sessionId:a.id,turnId:o.id,name:t.tool.name});let S={session:a,turnId:o.id,args:t.tool.args,callId:t.tool.callId,signal:r,workspaceDiffBaseline:null,turnPermissions:{approvalPolicy:"never",sandbox:"workspace-write",codexPermissionMode:"default"},provider:a.provider,model:o.modelRef?.modelId??a.modelRef?.modelId??"",mentionedApps:[],userPrompt:o.prompt,turnMetadata:o.metadata};if(t.tool.name==="get_profile"||t.tool.name.startsWith("agent_")||t.tool.name==="ask_user"){let c=G({loadProfileState:i(async()=>x,"loadProfileState"),resolveCandidateProfile:w.resolveCandidateProfile,executeCandidateAgentCommand:w.executeCandidateAgentCommand}).find(f=>f.name===t.tool.name);if(!c)throw new Error("Candidate authoring tool is unavailable.");return c.execute(S)}if(t.tool.name==="view_image")return w.executeCandidateImage(S);if(t.tool.name==="exec_command")return w.executeCandidateCommand(S,{session:a,turnId:o.id,command:e.string().min(1).max(2e4).parse(t.tool.args.command),cwd:typeof t.tool.args.cwd=="string"?t.tool.args.cwd:null,signal:S.signal,source:"model_tool"});if(["list_files","read_files","search_files","workspace_status","write_file","write_files","edit_file","delete_file"].includes(t.tool.name))return w.executeCandidateWorkspaceTool({session:a,turnId:o.id,request:le.parse({action:t.tool.name,args:t.tool.args,source:"chat_action"})});throw new Error("This hosted tool has no confined candidate transport.")}throw new Error("Unknown private hosted Improve operation.")}finally{await h?.close(),await y.close()}}i(We,"runHostedExperimentImprovementOwner");async function wr(s){if(s.length!==1||s[0].length>16e3||!/^[A-Za-z0-9_-]+$/.test(s[0]))throw new Error("Hosted Improve IPC argument is invalid.");let r=e.object({directory:e.string(),file:e.string().regex(/^[A-Za-z0-9_-]+\.json$/)}).strict().parse(JSON.parse(Buffer.from(s[0],"base64url").toString("utf8")));if(!Ue.isAbsolute(r.directory))throw new Error("Hosted Improve IPC requires an absolute private directory.");let t=Ue.join(r.directory,r.file),n=await $e.lstat(t);if(!n.isFile()||n.isSymbolicLink()||n.size>32*1024*1024)throw new Error("Hosted Improve private request exceeds its byte/type limit.");let d=new AbortController,m=i(()=>d.abort(new Error("The actual hosted owner stopped this private operation.")),"stop");process.once("SIGTERM",m),process.once("SIGINT",m);try{let u=await We(JSON.parse(await $e.readFile(t,"utf8")),d.signal),v=Buffer.from(JSON.stringify(u));if(v.length>32*1024*1024)throw new Error("Hosted Improve private response exceeds its byte limit.");process.stdout.write(`${v.toString("utf8")}
3
+ `)}finally{process.removeListener("SIGTERM",m),process.removeListener("SIGINT",m)}}i(wr,"runHostedExperimentImprovementCli");export{wr as runHostedExperimentImprovementCli};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{b as a,c as b}from"./chunk-GDJ4X2ZN.js";import"./chunk-XHBMK6LC.js";import"./chunk-6I5AUTVO.js";import"./chunk-QJJNHKLT.js";import"./chunk-ZU3YBRXS.js";import"./chunk-4TTXNVCE.js";import"./chunk-LZPCA6DH.js";import"./chunk-L3KS6MOV.js";import"./chunk-GUG2SWRZ.js";import"./chunk-G4747MOW.js";import"./chunk-KCJVFLBB.js";import"./chunk-MVPKU72J.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-GD3RCUDH.js";import"./chunk-QCJY6FTC.js";import"./chunk-UTIELP6F.js";import"./chunk-6S2MWJVD.js";import"./chunk-FYWQWKVS.js";import"./chunk-6ESBAHWK.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-7J2NMUTK.js";import"./chunk-W45RKGM6.js";import"./chunk-W45RKGM6.js";import"./chunk-7PKTCMZ6.js";import"./chunk-LXZLLTYQ.js";import"./chunk-GI7LTJV3.js";import"./chunk-VS3AMJEK.js";import"./chunk-XGY4OQLC.js";import"./chunk-AF3AVDPP.js";import"./chunk-SFR32TMJ.js";import"./chunk-5KJMFK65.js";import"./chunk-Y3B6ZUE6.js";import"./chunk-ULJZ7NUF.js";import"./chunk-WJSJXK2N.js";import"./chunk-OKEC2EIE.js";import"./chunk-WLZJOCLA.js";import"./chunk-HIQPGYVH.js";import"./chunk-ZWW227M3.js";import"./chunk-DXA2UHBE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-6FA3GG5B.js";import"./chunk-G4E3WGLM.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-SH7POUVX.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import"./chunk-UGOK7VTC.js";import"./chunk-FTQLQJQV.js";export{a as loadHostedHarnessRuntime,b as loadHostedHarnessRuntimeForSession};
@@ -0,0 +1,3 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{a,e as F}from"./chunk-B32CW3NT.js";import{a as h}from"./chunk-TPOAAJKA.js";import{a as D}from"./chunk-H5ML7735.js";import{j as I,m as M,n as O}from"./chunk-ZU3YBRXS.js";import{z as w}from"./chunk-4TTXNVCE.js";import"./chunk-LZPCA6DH.js";import"./chunk-L3KS6MOV.js";import"./chunk-GUG2SWRZ.js";import"./chunk-G4747MOW.js";import"./chunk-KCJVFLBB.js";import"./chunk-MVPKU72J.js";import"./chunk-OQPJ7FJF.js";import{a as A}from"./chunk-BL3CZWWD.js";import"./chunk-GD3RCUDH.js";import"./chunk-QCJY6FTC.js";import"./chunk-UTIELP6F.js";import"./chunk-6S2MWJVD.js";import"./chunk-FYWQWKVS.js";import"./chunk-6ESBAHWK.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-7J2NMUTK.js";import"./chunk-W45RKGM6.js";import"./chunk-W45RKGM6.js";import"./chunk-7PKTCMZ6.js";import"./chunk-LXZLLTYQ.js";import"./chunk-GI7LTJV3.js";import"./chunk-VS3AMJEK.js";import"./chunk-XGY4OQLC.js";import"./chunk-AF3AVDPP.js";import"./chunk-SFR32TMJ.js";import"./chunk-5KJMFK65.js";import"./chunk-Y3B6ZUE6.js";import"./chunk-ULJZ7NUF.js";import"./chunk-WJSJXK2N.js";import"./chunk-OKEC2EIE.js";import"./chunk-WLZJOCLA.js";import"./chunk-HIQPGYVH.js";import"./chunk-ZWW227M3.js";import"./chunk-DXA2UHBE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-6FA3GG5B.js";import"./chunk-G4E3WGLM.js";import"./chunk-ZY32SZ2P.js";import{u as R}from"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-SH7POUVX.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import{l as C,m as v}from"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import{A as c}from"./chunk-X2J2P5ZT.js";import"./chunk-UGOK7VTC.js";import{a as f}from"./chunk-FTQLQJQV.js";import{promises as m}from"node:fs";import n from"node:path";var $=c.object({action:c.enum(["stage","readback","rollback"]),repoPath:c.string(),outputDir:c.string(),exportFile:c.string(),commit:c.string().regex(/^[a-f0-9]{40}$/).optional(),expectedExecutableSourceHash:c.string().regex(/^[a-f0-9]{64}$/).optional()}).strict();async function z(l){let e=$.parse(l);if(!n.isAbsolute(e.repoPath)||!n.isAbsolute(e.outputDir)||!/^[a-zA-Z0-9_-]+\.json$/.test(e.exportFile))throw new Error("Hosted candidate private IPC is not contained.");let g=n.join(e.outputDir,e.exportFile),H=await m.lstat(g);if(!H.isFile()||H.isSymbolicLink()||H.size>8*1024*1024)throw new Error("Hosted candidate export exceeds its private IPC bound.");let t=D(JSON.parse(await m.readFile(g,"utf8"))),u=await w({repoPath:e.repoPath,profileId:t.profileRef.profileId});if(u.error||!u.sourcePath)throw new Error("Actual hosted Profile source is unavailable.");if(e.action!=="readback"){let o=!1;try{await a(e.repoPath,["symbolic-ref","-q","HEAD"]),o=!0}catch{}if(o||await a(e.repoPath,["rev-parse","HEAD"])!==(e.action==="rollback"?e.commit:t.expectedCommit)||await a(e.repoPath,["status","--porcelain","--untracked-files=all"]))throw new Error("Candidate staging requires a clean detached exact original source worktree.")}let x=f(async o=>I({storeDir:e.outputDir,workspaceId:t.compiler.workspaceId,name:t.compiler.name,profile:await w({repoPath:e.repoPath,profileId:t.profileRef.profileId}),sourceRevision:o,repositoryId:t.compiler.repositoryId}),"compile");if(e.action==="readback"){if(!e.commit||await a(e.repoPath,["rev-parse","HEAD"])!==e.commit)throw new Error("Hosted Profile readback is not the committed source.");let o=await x(e.commit),i=h(o);if(i.profileGitHead!==e.commit||i.contentHash!==(e.expectedExecutableSourceHash??t.executableSourceHash)||i.protectedClosureHash!==t.protectedClosureHash)throw new Error("Hosted active executable differs from the actual tested candidate.");let s=await O({storeDir:e.outputDir,workspaceId:t.compiler.workspaceId,compiled:o,createdAt:t.createdAt});return{commit:e.commit,activeRelease:{id:s.harnessRelease.id,contentHash:s.harnessRelease.contentHash},executableSourceHash:i.contentHash,protectedClosureHash:i.protectedClosureHash}}if(e.action==="rollback"){if(!e.commit)throw new Error("Rollback requires the exact accepted commit.");await a(e.repoPath,["-c","core.hooksPath=/dev/null","revert","--no-commit",e.commit])}let p=await x(t.expectedCommit);if(p.harnessRelease.contentHash!==t.baseRelease.contentHash||p.harnessRelease.id!==t.baseRelease.id)throw new Error("Hosted original source differs from the owner-attested baseline release.");if(e.action==="stage"){let o=Buffer.from(t.sourceManifest.base64,"base64");if(o.toString("base64")!==t.sourceManifest.base64||o.length!==t.sourceManifest.sizeBytes||v(o)!==t.sourceManifest.contentHash)throw new Error("Candidate source manifest byte identity differs.");let i=A.parse(JSON.parse(o.toString("utf8"))),s=n.join(e.outputDir,"candidate-source");await m.mkdir(s,{recursive:!0}),await m.writeFile(n.join(s,"harness.json"),C(i));let _=R(t.policySource),j=new Map(p.sourceFiles.filter(r=>r.asset.visibility!=="policy").map(r=>[r.path,r]));for(let r of i.files){let k=r.visibility==="policy"?_.get(r.path):j.get(r.path)?.bytes;if(!k)throw new Error("The hosted source cannot hydrate the exact protected candidate closure.");let y=n.join(s,r.path);if(n.relative(s,y).startsWith(".."))throw new Error("Candidate release path escapes private staging.");await m.mkdir(n.dirname(y),{recursive:!0}),await m.writeFile(y,k)}let P=await M({workspaceId:t.compiler.workspaceId,sourceDir:s}),S=h(P);if(P.harnessRelease.contentHash!==t.policySource.harnessRelease.contentHash||S.contentHash!==t.executableSourceHash||S.protectedClosureHash!==t.protectedClosureHash)throw new Error("Owner-attested candidate differs from independently compiled hosted source.");await F({source:u.sourcePath,state:{component:t.component},base:p,candidate:P,profile:u})}await a(e.repoPath,["add","--all"]),await a(e.repoPath,["-c","core.hooksPath=/dev/null","-c","commit.gpgSign=false","commit","-m",`${e.action==="rollback"?"Roll back":"Adopt"} owner-tested candidate ${t.candidateId}`],{GIT_AUTHOR_NAME:"OpenPond",GIT_AUTHOR_EMAIL:"profile-candidate@openpond.local",GIT_COMMITTER_NAME:"OpenPond",GIT_COMMITTER_EMAIL:"profile-candidate@openpond.local"});let E=await a(e.repoPath,["rev-parse","HEAD"]),T=await w({repoPath:e.repoPath,profileId:t.profileRef.profileId}),b=await I({storeDir:e.outputDir,workspaceId:t.compiler.workspaceId,name:t.compiler.name,profile:T,sourceRevision:E,repositoryId:t.compiler.repositoryId}),d=h(b);if(e.action==="stage"&&(d.contentHash!==t.executableSourceHash||d.protectedClosureHash!==t.protectedClosureHash)||e.action==="rollback"&&(d.contentHash!==h(p).contentHash||d.protectedClosureHash!==h(p).protectedClosureHash))throw new Error("Staged actual source differs from its exact tested executable graph.");return{commit:E,activeRelease:{id:b.harnessRelease.id,contentHash:b.harnessRelease.contentHash},executableSourceHash:d.contentHash,protectedClosureHash:d.protectedClosureHash}}f(z,"hostedProfileCandidate");async function Q(l){if(l.length!==1||l[0].length>16e3||!/^[a-zA-Z0-9_-]+$/.test(l[0]))throw new Error("Hosted candidate IPC argument is invalid.");process.stdout.write(`${JSON.stringify(await z(JSON.parse(Buffer.from(l[0],"base64url").toString("utf8"))))}
3
+ `)}f(Q,"runHostedProfileCandidateCli");export{z as hostedProfileCandidate,Q as runHostedProfileCandidateCli};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{a,b,c,d}from"./chunk-WKHGXLJD.js";import"./chunk-ZU3YBRXS.js";import"./chunk-4TTXNVCE.js";import"./chunk-LZPCA6DH.js";import"./chunk-L3KS6MOV.js";import"./chunk-GUG2SWRZ.js";import"./chunk-G4747MOW.js";import"./chunk-KCJVFLBB.js";import"./chunk-BL3CZWWD.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-XGY4OQLC.js";import"./chunk-ULJZ7NUF.js";import"./chunk-OKEC2EIE.js";import"./chunk-WLZJOCLA.js";import"./chunk-HIQPGYVH.js";import"./chunk-ZWW227M3.js";import"./chunk-DXA2UHBE.js";import"./chunk-MTP3B2SU.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-6FA3GG5B.js";import"./chunk-G4E3WGLM.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-SH7POUVX.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import"./chunk-UGOK7VTC.js";import"./chunk-FTQLQJQV.js";export{a as compileHostedProfileRelease,b as runHostedProfileCompilerCli,c as runHostedProfileEvaluationCli,d as runHostedProfileInspectionCli};
@@ -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 c}from"./chunk-4JYTFEND.js";import{a as l}from"./chunk-4MQHIFZL.js";import{v as f}from"./chunk-MVPKU72J.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-GD3RCUDH.js";import"./chunk-QCJY6FTC.js";import"./chunk-UTIELP6F.js";import"./chunk-6S2MWJVD.js";import"./chunk-FYWQWKVS.js";import"./chunk-6ESBAHWK.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-7J2NMUTK.js";import"./chunk-W45RKGM6.js";import"./chunk-W45RKGM6.js";import"./chunk-7PKTCMZ6.js";import"./chunk-LXZLLTYQ.js";import"./chunk-GI7LTJV3.js";import"./chunk-VS3AMJEK.js";import"./chunk-XGY4OQLC.js";import"./chunk-AF3AVDPP.js";import"./chunk-SFR32TMJ.js";import"./chunk-5KJMFK65.js";import"./chunk-Y3B6ZUE6.js";import"./chunk-WJSJXK2N.js";import"./chunk-OKEC2EIE.js";import"./chunk-WLZJOCLA.js";import"./chunk-HIQPGYVH.js";import"./chunk-ZWW227M3.js";import"./chunk-DXA2UHBE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import{Hb as s,Ob as u}from"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-6FA3GG5B.js";import"./chunk-G4E3WGLM.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import{o as t}from"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import{A as n}from"./chunk-X2J2P5ZT.js";import{a as i}from"./chunk-FTQLQJQV.js";var v=n.object({profileRef:f,sourceRevision:n.string().min(1),action:n.enum(["compare","report"]),request:n.unknown(),runs:n.array(l).max(1e4),comparisons:n.array(s).max(1e4),suiteRuns:n.array(u).max(1e4)}).strict();async function h(p){let o=v.parse(p);for(let e of[...o.runs,...o.comparisons,...o.suiteRuns])t(e,"Hosted evaluation evidence");let a={getProfileEvaluationRun:i(async e=>o.runs.find(r=>r.manifest.id===e)??null,"getProfileEvaluationRun"),getProfileEvaluationComparison:i(async e=>o.comparisons.find(r=>r.id===e)??null,"getProfileEvaluationComparison"),getProfileEvaluationSuiteRun:i(async e=>o.suiteRuns.find(r=>r.id===e)??null,"getProfileEvaluationSuiteRun"),saveProfileEvaluationComparison:i(async(e,r)=>r,"saveProfileEvaluationComparison")};return o.action==="compare"?m({store:a,selectedProfile:i(async()=>({ref:o.profileRef,sourceRevision:o.sourceRevision}),"selectedProfile")})(o.request):c({store:a,profileRef:o.profileRef,request:o.request})}i(h,"controlHostedProfileEvaluation");export{h as controlHostedProfileEvaluation};
@@ -0,0 +1,3 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{b as R,c as P}from"./chunk-55Q64WWF.js";import"./chunk-5AU5Y6KS.js";import{a as E}from"./chunk-4MQHIFZL.js";import{a as h,v,w as S,x as w}from"./chunk-MVPKU72J.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-GD3RCUDH.js";import"./chunk-QCJY6FTC.js";import"./chunk-UTIELP6F.js";import"./chunk-6S2MWJVD.js";import{b as y}from"./chunk-FYWQWKVS.js";import"./chunk-6ESBAHWK.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-7J2NMUTK.js";import"./chunk-W45RKGM6.js";import"./chunk-W45RKGM6.js";import"./chunk-7PKTCMZ6.js";import"./chunk-LXZLLTYQ.js";import"./chunk-GI7LTJV3.js";import"./chunk-VS3AMJEK.js";import"./chunk-XGY4OQLC.js";import"./chunk-AF3AVDPP.js";import"./chunk-SFR32TMJ.js";import"./chunk-5KJMFK65.js";import"./chunk-Y3B6ZUE6.js";import"./chunk-WJSJXK2N.js";import"./chunk-OKEC2EIE.js";import"./chunk-WLZJOCLA.js";import"./chunk-HIQPGYVH.js";import"./chunk-ZWW227M3.js";import"./chunk-DXA2UHBE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import{f as g}from"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-6FA3GG5B.js";import"./chunk-G4E3WGLM.js";import{Ka as m}from"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import{A as s}from"./chunk-X2J2P5ZT.js";import{a as n}from"./chunk-FTQLQJQV.js";var I=s.object({profileRef:v,inspection:R,run:E.nullable(),receipts:s.array(g).max(1e4),grades:s.array(m).max(1e4),sessions:s.array(S).max(1e4),turns:s.array(w).max(1e4),events:s.array(h).max(1e4),usage:s.array(y).max(1e4)}).strict();async function x(c){let t=I.parse(c),o=n((e,i)=>{let f=new Map;for(let p of e){let d=i(p);if(f.has(d))throw new Error("Hosted evaluation inspection has duplicate evidence identities.");f.set(d,p)}return f},"map"),r=o(t.receipts,e=>e.id),u=o(t.grades,e=>e.contentHash),l=o(t.sessions,e=>e.id),a=o(t.turns,e=>e.id);return P({profileRef:t.profileRef,...t.inspection,store:{getProfileEvaluationRun:n(async e=>t.run?.manifest.id===e?t.run:null,"getProfileEvaluationRun"),getProfileEvaluationReceipt:n(async e=>r.get(e)??null,"getProfileEvaluationReceipt"),getProfileEvaluationGrade:n(async e=>u.get(e)??null,"getProfileEvaluationGrade"),getSession:n(async e=>l.get(e)??null,"getSession"),getTurn:n(async e=>a.get(e)??null,"getTurn"),runtimeEventsForTurn:n(async e=>t.events.filter(i=>i.turnId===e),"runtimeEventsForTurn"),listModelUsageRecords:n(async e=>t.usage.filter(i=>(!e?.sessionId||i.sessionId===e.sessionId)&&(!e?.turnId||i.turnId===e.turnId)),"listModelUsageRecords")}})}n(x,"inspectHostedProfileEvaluation");async function B(c){if(c.length!==0)throw new Error("Hosted evaluation inspection uses bounded standard input.");let t=[],o=0;for await(let l of process.stdin){let a=Buffer.from(l);if(o+=a.length,o>32*1024*1024)throw new Error("Hosted evaluation inspection input is too large.");t.push(a)}let r=JSON.parse(Buffer.concat(t).toString("utf8")),u=r.action==="compare"||r.action==="report"?await(await import("./hosted-profile-evaluation-control-CBDRKJ5J.js")).controlHostedProfileEvaluation(r):await x(r);process.stdout.write(`${JSON.stringify(u)}
3
+ `)}n(B,"runHostedProfileInspectionCli");export{x as inspectHostedProfileEvaluation,B as runHostedProfileInspectionCli};
@@ -0,0 +1,3 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{a as V}from"./chunk-WKHGXLJD.js";import{b as x,p as j,q as D}from"./chunk-MHPCVQOE.js";import{b as E}from"./chunk-IEVJLG3V.js";import"./chunk-S7A2OGL2.js";import"./chunk-OW3EOC5Q.js";import"./chunk-EICS777E.js";import"./chunk-FEAKTSRS.js";import{a as I}from"./chunk-TPOAAJKA.js";import"./chunk-3MVKXAH7.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-3BJ7LPE3.js";import"./chunk-W45RKGM6.js";import"./chunk-LARJARMS.js";import"./chunk-67HXM6AL.js";import"./chunk-ANG2YMMD.js";import"./chunk-6TRVEA3T.js";import"./chunk-LYVHYT3L.js";import"./chunk-VFH5C6D2.js";import"./chunk-XHBMK6LC.js";import"./chunk-6I5AUTVO.js";import"./chunk-QJJNHKLT.js";import{m as C}from"./chunk-ZU3YBRXS.js";import"./chunk-VD2TQCMH.js";import"./chunk-4TTXNVCE.js";import"./chunk-LZPCA6DH.js";import"./chunk-L3KS6MOV.js";import"./chunk-GUG2SWRZ.js";import{a as b}from"./chunk-G4747MOW.js";import"./chunk-KCJVFLBB.js";import"./chunk-MVPKU72J.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-GD3RCUDH.js";import"./chunk-QCJY6FTC.js";import"./chunk-UTIELP6F.js";import"./chunk-6S2MWJVD.js";import"./chunk-FYWQWKVS.js";import"./chunk-6ESBAHWK.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-7J2NMUTK.js";import"./chunk-W45RKGM6.js";import"./chunk-W45RKGM6.js";import{j as m}from"./chunk-7PKTCMZ6.js";import"./chunk-LXZLLTYQ.js";import"./chunk-GI7LTJV3.js";import"./chunk-VS3AMJEK.js";import"./chunk-XGY4OQLC.js";import"./chunk-AF3AVDPP.js";import"./chunk-SFR32TMJ.js";import"./chunk-5KJMFK65.js";import"./chunk-Y3B6ZUE6.js";import"./chunk-ULJZ7NUF.js";import"./chunk-WJSJXK2N.js";import"./chunk-OKEC2EIE.js";import{ja as S}from"./chunk-WLZJOCLA.js";import"./chunk-HIQPGYVH.js";import"./chunk-ZWW227M3.js";import"./chunk-DXA2UHBE.js";import"./chunk-MTP3B2SU.js";import"./chunk-AMC4Z7G4.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-6FA3GG5B.js";import"./chunk-G4E3WGLM.js";import{f as y,i as H}from"./chunk-ZY32SZ2P.js";import{e as P,i as R}from"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-SH7POUVX.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import{n as d}from"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import{A as e}from"./chunk-X2J2P5ZT.js";import"./chunk-UGOK7VTC.js";import{a as s}from"./chunk-FTQLQJQV.js";import{readFile as h,realpath as z,lstat as T}from"node:fs/promises";import l from"node:path";var B=e.object({compile:e.object({repoPath:e.string(),profileId:e.string(),repositoryId:e.string(),sourceRevision:e.string(),workspaceId:e.string(),outputDir:e.string()}).strict(),externalDatasetPackage:e.string().regex(/^external-dataset-[a-f0-9-]+\.json$/).optional(),sourceCandidate:H.optional(),action:e.enum(["catalog","prepare"]),request:e.unknown().optional()}).strict();async function G(t){let o=await V(t.compile);if(t.sourceCandidate){let a=await C({workspaceId:typeof o.agentSnapshot.metadata.workspaceId=="string"?o.agentSnapshot.metadata.workspaceId:o.workspaceId,sourceDir:l.join(o.bundlePath,"source")});if(d(t.sourceCandidate.harnessRelease)!==d({id:o.harnessRelease.id,contentHash:o.harnessRelease.contentHash})||I(a).protectedClosureHash!==t.sourceCandidate.protectedClosureHash)throw new Error("Private candidate source differs from its actual frozen compiled release.")}let g={release:b.parse({schemaVersion:"openpond.localHarnessReleaseRecord.v1",workspaceId:o.workspaceId,sourceRevision:o.sourceRevision,agentSnapshot:P.parse(o.agentSnapshot),harnessRelease:R.parse(o.harnessRelease),bundlePath:o.bundlePath,createdAt:new Date().toISOString()})},p={source:"openpond_git",profileId:t.compile.profileId,repositoryId:t.compile.repositoryId},f=t.compile.sourceRevision,c={id:o.harnessRelease.id,contentHash:o.harnessRelease.contentHash},w=s(async a=>E({...a,runtime:g}),"loadCatalog"),q=await w({ref:p,sourceRevision:f,harnessRelease:c}),k=l.join(o.bundlePath,"source"),v=o.harnessRelease.files.some(a=>a.path==="workflows/catalog.json")?await(async()=>{let a=y({agentSnapshot:o.agentSnapshot,harnessRelease:o.harnessRelease,catalogBytes:await h(l.join(k,"workflows/catalog.json")),actionBytes:await h(l.join(k,"workflows/actions.json"))});return a.catalog.workflows.map(r=>({workflow:r,binding:{schemaVersion:"openpond.profileWorkflowBinding.v1",profileId:p.profileId,sourceRevision:f,harnessRelease:c,catalogHash:a.catalogHash,workflowId:r.id}}))})():[],A={profileRef:p,sourceRevision:f,harnessRelease:c,workflows:v};if(t.action==="catalog")return{...q,workflows:v};let u=t.externalDatasetPackage?await(async()=>{let a=await z(t.compile.outputDir),r=l.join(a,t.externalDatasetPackage),i=await T(r);if(!i.isFile()||i.isSymbolicLink()||i.size>32*1024*1024||await z(r)!==r)throw new Error("External Dataset cache is outside its bounded verifier storage.");let n=e.object({packageValue:e.unknown(),graders:e.array(e.object({id:e.string(),version:e.string(),contentHash:e.string(),feedbackKey:e.string(),release:e.object({id:e.string(),revision:e.union([e.string(),e.number()]),contentHash:e.string()}).strict().nullable()}).strict()).max(100)}).strict().parse(JSON.parse(await h(r,"utf8")));return{packageValue:S(n.packageValue),graders:n.graders}})():null;return j({privateGradingPreflight:s(a=>D(a,!1),"privateGradingPreflight"),sourceCandidate:t.sourceCandidate,resolveExternalDataset:u?async a=>{let r=m({binding:a,...u}),i=d(o.harnessRelease.files.filter(n=>n.visibility!=="policy").map(n=>({path:n.path,asset:n})));if(a.protectedProfileClosureHash!==i)throw new Error("The selected Profile's protected evaluator closure changed.");return{binding:a,packageValue:r,authorize:s(async()=>{m({binding:a,...u})},"authorize")}}:void 0,loadCatalog:w,selectedWorkflows:s(async()=>A,"selectedWorkflows"),placement:"remote",boundedWorkComputeAvailable:!0,loadTasksetPackage:s(async a=>{let r=await x({runtime:g,definition:a,harnessRelease:c});if(!r)throw new Error("Hosted evaluation Taskset is absent from its published Profile release.");return r},"loadTasksetPackage"),modelConfigurationHash:s(async(a,r)=>{if(a.providerId!=="openpond"||!r.hostModelConfigurationHash)throw new Error("Hosted evaluation preparation requires a trusted model configuration receipt.");return r.hostModelConfigurationHash},"modelConfigurationHash")})(t.request)}s(G,"prepareHostedProfileEvaluation");async function ae(t){if(t.length!==1||t[0].length>48e3||!/^[A-Za-z0-9_-]+$/.test(t[0]))throw new Error("Hosted Profile evaluation preparation argument is invalid.");let o=B.parse(JSON.parse(Buffer.from(t[0],"base64url").toString("utf8")));process.stdout.write(`${JSON.stringify(await G(o))}
3
+ `)}s(ae,"runHostedProfileEvaluationCli");export{G as prepareHostedProfileEvaluation,ae as runHostedProfileEvaluationCli};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{m as h}from"./chunk-WBO6FQHR.js";import"./chunk-H5ML7735.js";import"./chunk-SYUKES6H.js";import"./chunk-7XOUM6RK.js";import"./chunk-VD2TQCMH.js";import"./chunk-MCBRB5D6.js";import"./chunk-OQPJ7FJF.js";import"./chunk-6S2MWJVD.js";import"./chunk-7PKTCMZ6.js";import"./chunk-LXZLLTYQ.js";import"./chunk-5KJMFK65.js";import"./chunk-Y3B6ZUE6.js";import"./chunk-4N4EH3RJ.js";import"./chunk-ULJZ7NUF.js";import"./chunk-WJSJXK2N.js";import"./chunk-CYQLXS2U.js";import"./chunk-WLZJOCLA.js";import"./chunk-HIQPGYVH.js";import"./chunk-ZWW227M3.js";import"./chunk-DXA2UHBE.js";import"./chunk-MTP3B2SU.js";import"./chunk-UN2LKLGV.js";import"./chunk-2LJCJOJ7.js";import"./chunk-AMC4Z7G4.js";import"./chunk-LK77GI6M.js";import"./chunk-JCLTFDVW.js";import"./chunk-I6VMRQF4.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-6FA3GG5B.js";import"./chunk-G4E3WGLM.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-SH7POUVX.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import"./chunk-UGOK7VTC.js";import{a as r}from"./chunk-FTQLQJQV.js";import{createHash as p}from"node:crypto";import{setTimeout as b}from"node:timers/promises";async function T(e){if(e.signal.throwIfAborted(),!e.turnId.trim()||!e.callId.trim())throw new Error("Hosted Taskset actions require their originating turn and tool call.");let s=y(e.session.metadata?.hostConversationId),l=y(e.session.metadata?.hostSandboxId);if(e.session.workspaceKind!=="sandbox"||!l||e.session.workspaceId!==l||!s)throw new Error("Hosted Taskset actions require the bound Work workspace.");if(e.action==="answer_questions")throw new Error("Hosted Taskset authoring has no separate question queue. Revise with the complete buildSpecification.");if(e.action==="revise"&&!e.payload.buildSpecification)throw new Error("Hosted Taskset revisions require the complete buildSpecification.");let g=I(e.payload.sourceReferenceIds??e.payload.sourceIds),u=k({action:e.action,clientRequestId:w(e),creationId:e.payload.creationId,tasksetId:e.payload.tasksetId,objective:e.payload.objective,buildIntent:e.payload.buildIntent,buildSpecification:e.payload.buildSpecification,sourceReferenceIds:g,methodHint:e.payload.methodHint,approved:e.payload.approved,split:e.payload.split,taskLimit:e.payload.taskLimit,attemptsPerTask:e.payload.attemptsPerTask,maximumSpendUsd:e.payload.maximumSpendUsd,message:e.payload.message,answers:e.payload.answers}),f=e.request??h,n=["audit_graders","calibrate_judges","baseline","readiness"].includes(e.action),o=n?AbortSignal.any([e.signal,AbortSignal.timeout(900*1e3)]):e.signal,c=null;try{for(;;){o.throwIfAborted();let a=await f({path:"/hosted-tasksets/actions",method:"POST",body:u,signal:o,...n?{timeoutMs:3e4}:{}});o.throwIfAborted();let t=a.result;if(!n||!t||typeof t!="object"||Array.isArray(t)||!("schemaVersion"in t)||t.schemaVersion!=="openpond.hostedTasksetOperation.v1")return a;let m="status"in t?t.status:null,i="id"in t?t.id:null,d="retryAfterMs"in t?t.retryAfterMs:null;if(m!=="queued"&&m!=="running"||typeof i!="string"||!i||typeof d!="number"||!Number.isFinite(d)||d<1)throw new Error("Hosted Taskset check returned an invalid operation status.");if(c!==null&&c!==i)throw new Error("Hosted Taskset check operation identity changed while polling.");c=i,await b(Math.min(d,5e3),void 0,{signal:o})}}catch(a){throw n&&o.aborted&&(await f({path:"/hosted-tasksets/actions",method:"POST",body:{...u,cancelCheck:!0},timeoutMs:1e4,signal:AbortSignal.timeout(1e4)}).catch(()=>{}),o.throwIfAborted()),a}}r(T,"executeHostedTasksetAction");function w(e){let s=p("sha256").update(JSON.stringify([e.session.id,e.turnId,e.callId])).digest("hex").slice(0,32);return`${e.session.id}:${s}`.slice(0,191)}r(w,"actionRequestId");function k(e){return Object.fromEntries(Object.entries(e).filter(([,s])=>s!==void 0))}r(k,"compact");function y(e){return typeof e=="string"&&e.trim()?e.trim():null}r(y,"stringValue");function I(e){return Array.isArray(e)&&e.every(s=>typeof s=="string")?e:void 0}r(I,"stringArray");export{T as executeHostedTasksetAction};