openpond 0.2.69 → 0.2.71

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 (397) hide show
  1. package/dist/api/client-context.d.ts +4 -0
  2. package/dist/app-server.js +1 -1
  3. package/dist/chunks/{account-context-V3KLSNKS.js → account-context-LEZDNYMR.js} +1 -1
  4. package/dist/chunks/{acp-ER6CUXG2.js → acp-VWPJ2EL4.js} +1 -1
  5. package/dist/chunks/{acp-agent-AYJ5RPVF.js → acp-agent-OZHZMQ6R.js} +1 -1
  6. package/dist/chunks/{actions-command-BBUS3HDK.js → actions-command-AXGXBU75.js} +1 -1
  7. package/dist/chunks/{app-layer-JCEWGUDH.js → app-layer-OHPIYEOJ.js} +1 -1
  8. package/dist/chunks/{app-server-connected-apps-ILXBFD3S.js → app-server-connected-apps-NH4667QJ.js} +1 -1
  9. package/dist/chunks/{app-server-evaluations-RRLYWLPK.js → app-server-evaluations-Y5UEF2Y7.js} +1 -1
  10. package/dist/chunks/{app-server-harness-services-XXM336NU.js → app-server-harness-services-GUHAIIPS.js} +1 -1
  11. package/dist/chunks/app-server-runtime-CH5STRJP.js +2 -0
  12. package/dist/chunks/apps-DNLT6P4J.js +2 -0
  13. package/dist/chunks/{chunk-MOXIGLN2.js → chunk-23YW5PAQ.js} +1 -1
  14. package/dist/chunks/{chunk-ZDEIVUUI.js → chunk-27OJ2OLP.js} +1 -1
  15. package/dist/chunks/{chunk-RY46UPBO.js → chunk-2ACX7IW5.js} +1 -1
  16. package/dist/chunks/{chunk-NSSZ2ZIU.js → chunk-2EAZB2MW.js} +1 -1
  17. package/dist/chunks/{chunk-DRLP7GIU.js → chunk-2GEZ3ZY7.js} +1 -1
  18. package/dist/chunks/{chunk-PAYFJHPO.js → chunk-2PVW2XFF.js} +1 -1
  19. package/dist/chunks/{chunk-Y2WNZWT2.js → chunk-2Q6FTL4C.js} +1 -1
  20. package/dist/chunks/{chunk-KP2MYTP5.js → chunk-2QHB5P2K.js} +1 -1
  21. package/dist/chunks/{chunk-FNGZ4UDZ.js → chunk-33UVQ7DU.js} +1 -1
  22. package/dist/chunks/{chunk-M4ZHFDRJ.js → chunk-3JVZ7OCQ.js} +1 -1
  23. package/dist/chunks/{chunk-4BUM6JEC.js → chunk-3JYPUOK4.js} +1 -1
  24. package/dist/chunks/{chunk-DXJC3QW7.js → chunk-3VT2PPKW.js} +1 -1
  25. package/dist/chunks/{chunk-Z33RVGP6.js → chunk-5LKEVB2P.js} +1 -1
  26. package/dist/chunks/{chunk-P4QM63L3.js → chunk-5ZBDHIIE.js} +1 -1
  27. package/dist/chunks/{chunk-WD4KAKEX.js → chunk-64EDQ7UV.js} +1 -1
  28. package/dist/chunks/{chunk-UMAVVMXL.js → chunk-6BTX66SV.js} +1 -1
  29. package/dist/chunks/{chunk-KU4TPDPH.js → chunk-6LAGMWJE.js} +1 -1
  30. package/dist/chunks/{chunk-65FJWWXG.js → chunk-6YR5IYHH.js} +1 -1
  31. package/dist/chunks/{chunk-AUO5DCEU.js → chunk-73COPJ32.js} +1 -1
  32. package/dist/chunks/{chunk-KDER7R45.js → chunk-7PDF2UX2.js} +1 -1
  33. package/dist/chunks/{chunk-SO4GMSNP.js → chunk-7SOHV5BH.js} +1 -1
  34. package/dist/chunks/{chunk-XOPHFUUY.js → chunk-ASMQTMQB.js} +1 -1
  35. package/dist/chunks/{chunk-ESYPMD7Q.js → chunk-AT3ZYNX4.js} +1 -1
  36. package/dist/chunks/{chunk-NMMHXYDJ.js → chunk-AVEHWUML.js} +1 -1
  37. package/dist/chunks/{chunk-M4A7G4S5.js → chunk-B7SCVTE6.js} +1 -1
  38. package/dist/chunks/{chunk-7EQLW2KM.js → chunk-BLNEHU62.js} +1 -1
  39. package/dist/chunks/{chunk-DKOVZ6R2.js → chunk-BQNU4HZW.js} +1 -1
  40. package/dist/chunks/{chunk-UANH7U3Y.js → chunk-BTEBZYK3.js} +1 -1
  41. package/dist/chunks/{chunk-BU6MW65V.js → chunk-BYVE4TMU.js} +1 -1
  42. package/dist/chunks/{chunk-PNPV2LDE.js → chunk-BZS2PA4O.js} +1 -1
  43. package/dist/chunks/{chunk-AFYYIJ6K.js → chunk-C7NQPICU.js} +1 -1
  44. package/dist/chunks/{chunk-K7KBFM2T.js → chunk-CBD554GZ.js} +1 -1
  45. package/dist/chunks/{chunk-GYYJ47GX.js → chunk-CWE2N3JI.js} +1 -1
  46. package/dist/chunks/{chunk-ZYLLPRPU.js → chunk-CX4T7I47.js} +1 -1
  47. package/dist/chunks/{chunk-AQUZCWM3.js → chunk-D2V2Y3FB.js} +1 -1
  48. package/dist/chunks/chunk-DFZTRMTL.js +2 -0
  49. package/dist/chunks/{chunk-2PXKSAG6.js → chunk-DLOJG7LP.js} +1 -1
  50. package/dist/chunks/{chunk-5G7BQAUA.js → chunk-DNNWMOMG.js} +1 -1
  51. package/dist/chunks/{chunk-M5X7XKXY.js → chunk-DNRC6TPJ.js} +7 -7
  52. package/dist/chunks/{chunk-HKVFU3B3.js → chunk-DUR32LJG.js} +1 -1
  53. package/dist/chunks/{chunk-XT4CSKHM.js → chunk-E57PUTV2.js} +1 -1
  54. package/dist/chunks/{chunk-4N4EH3RJ.js → chunk-EJOV6Z6F.js} +1 -1
  55. package/dist/chunks/{chunk-OUJ63LMU.js → chunk-ER2VONWQ.js} +1 -1
  56. package/dist/chunks/{chunk-PSY6IRJE.js → chunk-ESOIZG2G.js} +4 -4
  57. package/dist/chunks/{chunk-WNXUSELC.js → chunk-EXAJ2B4I.js} +1 -1
  58. package/dist/chunks/{chunk-CCZ276IA.js → chunk-F2EUZG2W.js} +1 -1
  59. package/dist/chunks/{chunk-VJR2GNRY.js → chunk-FVMTQSVW.js} +1 -1
  60. package/dist/chunks/{chunk-YI6ME6PU.js → chunk-GG6PM7TB.js} +1 -1
  61. package/dist/chunks/{chunk-DDOIPTOM.js → chunk-GMA365GI.js} +1 -1
  62. package/dist/chunks/{chunk-JVMSN7LH.js → chunk-GR4MJJCE.js} +1 -1
  63. package/dist/chunks/{chunk-TB5P3FWM.js → chunk-GUWNSMGH.js} +1 -1
  64. package/dist/chunks/{chunk-AYOMVI7J.js → chunk-HIMG7S5E.js} +1 -1
  65. package/dist/chunks/{chunk-2LJCJOJ7.js → chunk-HLJJAOI2.js} +1 -1
  66. package/dist/chunks/{chunk-AFH462DO.js → chunk-HT6ILPD6.js} +1 -1
  67. package/dist/chunks/{chunk-3Z4VM2LF.js → chunk-HUMNLSCV.js} +1 -1
  68. package/dist/chunks/{chunk-NZDLL6JN.js → chunk-HYUTDZ3N.js} +1 -1
  69. package/dist/chunks/{chunk-XYZV3FKD.js → chunk-I6KTJ3GH.js} +1 -1
  70. package/dist/chunks/{chunk-WZ35ICTE.js → chunk-IFMWAOBR.js} +1 -1
  71. package/dist/chunks/{chunk-R2FYCJL6.js → chunk-IJJ7FYZE.js} +1 -1
  72. package/dist/chunks/{chunk-XHACK2KR.js → chunk-IUYGQO2K.js} +1 -1
  73. package/dist/chunks/{chunk-55YD4UTW.js → chunk-IV2HEX3I.js} +1 -1
  74. package/dist/chunks/chunk-J7X72QUY.js +2 -0
  75. package/dist/chunks/{chunk-U7X5ZLAL.js → chunk-JCHLDNCX.js} +1 -1
  76. package/dist/chunks/chunk-JF7WWLNW.js +2 -0
  77. package/dist/chunks/{chunk-7PKDJHT6.js → chunk-JH4RACOB.js} +1 -1
  78. package/dist/chunks/{chunk-65WRWLUD.js → chunk-JVEIK4RH.js} +1 -1
  79. package/dist/chunks/{chunk-Z5CQXPIS.js → chunk-K3WM4NEC.js} +1 -1
  80. package/dist/chunks/{chunk-EGP6DF34.js → chunk-KASHK2U5.js} +2 -2
  81. package/dist/chunks/{chunk-JEMECEQH.js → chunk-KHDCMVEJ.js} +1 -1
  82. package/dist/chunks/{chunk-BDZDWHBJ.js → chunk-KURL76NW.js} +1 -1
  83. package/dist/chunks/{chunk-7OFD6TFD.js → chunk-LMLGEOKV.js} +1 -1
  84. package/dist/chunks/{chunk-QUNQM2E3.js → chunk-MPEK4ZNY.js} +1 -1
  85. package/dist/chunks/chunk-MZKCW6CB.js +2 -0
  86. package/dist/chunks/{chunk-SDHG6CKU.js → chunk-NDNSLCPE.js} +1 -1
  87. package/dist/chunks/chunk-NK2L5HA2.js +2 -0
  88. package/dist/chunks/{chunk-WCNPGKST.js → chunk-O4YHISU2.js} +1 -1
  89. package/dist/chunks/{chunk-RCQYEHHD.js → chunk-O5ZOW474.js} +1 -1
  90. package/dist/chunks/{chunk-IIT66347.js → chunk-OEAKX5TS.js} +1 -1
  91. package/dist/chunks/{chunk-LSKMALD6.js → chunk-OFV26C2U.js} +2 -2
  92. package/dist/chunks/{chunk-IO5DZUKL.js → chunk-OI4DAZ4U.js} +1 -1
  93. package/dist/chunks/{chunk-Q73RKX7I.js → chunk-OIIE5GUK.js} +1 -1
  94. package/dist/chunks/{chunk-R6I623SZ.js → chunk-OKPV6MBX.js} +6 -6
  95. package/dist/chunks/{chunk-N5EAVX4G.js → chunk-OOKHHOIU.js} +1 -1
  96. package/dist/chunks/{chunk-MIFVX5PK.js → chunk-OQ4RWCYI.js} +1 -1
  97. package/dist/chunks/{chunk-RCRZXHAI.js → chunk-OTG77H7U.js} +1 -1
  98. package/dist/chunks/{chunk-7OKZCJHS.js → chunk-OXRN2257.js} +1 -1
  99. package/dist/chunks/{chunk-4KNPCJR4.js → chunk-PJJSQ4ZI.js} +1 -1
  100. package/dist/chunks/{chunk-7RSQOC5M.js → chunk-PXQZOVSV.js} +2 -2
  101. package/dist/chunks/chunk-QKGNAYSC.js +2 -0
  102. package/dist/chunks/{chunk-R4EEGWXB.js → chunk-QN4CFJQC.js} +1 -1
  103. package/dist/chunks/{chunk-V24VHT76.js → chunk-REGKOCDO.js} +1 -1
  104. package/dist/chunks/chunk-RJY4EI46.js +2 -0
  105. package/dist/chunks/{chunk-E2JB5OCO.js → chunk-RP4DPUN2.js} +1 -1
  106. package/dist/chunks/{chunk-QLGP2OAQ.js → chunk-SNBFWBJI.js} +1 -1
  107. package/dist/chunks/{chunk-G4FRBT7G.js → chunk-SRJTQS2D.js} +3 -3
  108. package/dist/chunks/{chunk-XY7HFXLH.js → chunk-SVLVIYH2.js} +1 -1
  109. package/dist/chunks/{chunk-NW6WGGSL.js → chunk-TCTBCAI6.js} +1 -1
  110. package/dist/chunks/{chunk-7NCM6GBN.js → chunk-TOWY6Y23.js} +1 -1
  111. package/dist/chunks/{chunk-VWWKWYSQ.js → chunk-TWLPZHH7.js} +1 -1
  112. package/dist/chunks/{chunk-Y4I6CFZJ.js → chunk-UGDBMRCT.js} +1 -1
  113. package/dist/chunks/{chunk-JQOVC35K.js → chunk-UKTPX2EE.js} +1 -1
  114. package/dist/chunks/{chunk-CO23RRN7.js → chunk-UMRQKE3W.js} +1 -1
  115. package/dist/chunks/{chunk-B66QCXH2.js → chunk-USKCFST5.js} +1 -1
  116. package/dist/chunks/{chunk-3A2Y7UK3.js → chunk-USTDWGR4.js} +1 -1
  117. package/dist/chunks/{chunk-EWDDDHJN.js → chunk-UZNRH6I3.js} +1 -1
  118. package/dist/chunks/{chunk-CIZI6Z7D.js → chunk-VMW23TIZ.js} +1 -1
  119. package/dist/chunks/{chunk-22RLEU3Q.js → chunk-VND53FAU.js} +1 -1
  120. package/dist/chunks/{chunk-4G3GTEVS.js → chunk-VSQPWLAG.js} +1 -1
  121. package/dist/chunks/{chunk-KCLMA2IH.js → chunk-VV4K5YPD.js} +1 -1
  122. package/dist/chunks/{chunk-7RJOCGQ6.js → chunk-WAUFXZ5B.js} +1 -1
  123. package/dist/chunks/{chunk-HG2YFMVU.js → chunk-WXG3G2O6.js} +1 -1
  124. package/dist/chunks/{chunk-PACLKDTN.js → chunk-XBAB3HMA.js} +1 -1
  125. package/dist/chunks/chunk-XJU47QS2.js +2 -0
  126. package/dist/chunks/{chunk-WGQ3FMRF.js → chunk-XKDOPNQ5.js} +1 -1
  127. package/dist/chunks/{chunk-EYTTZ5H4.js → chunk-XLZMSD5K.js} +1 -1
  128. package/dist/chunks/{chunk-Q7FBVLLB.js → chunk-XNPTLJ5Z.js} +1 -1
  129. package/dist/chunks/{chunk-ZIQJDTQB.js → chunk-XTT3K3TR.js} +1 -1
  130. package/dist/chunks/{chunk-Q7P34B2O.js → chunk-YFHQRDNQ.js} +1 -1
  131. package/dist/chunks/{chunk-UGFSAG4U.js → chunk-YG3HITOU.js} +1 -1
  132. package/dist/chunks/{chunk-DWF3FCY4.js → chunk-Z5R4OSGC.js} +1 -1
  133. package/dist/chunks/{chunk-JT5YQ52I.js → chunk-Z6HWSTEP.js} +1 -1
  134. package/dist/chunks/{chunk-4PUOWSDE.js → chunk-ZEOYNUHL.js} +1 -1
  135. package/dist/chunks/{chunk-2TGHZXJE.js → chunk-ZG3DBXQG.js} +1 -1
  136. package/dist/chunks/{chunk-4KTGYHCE.js → chunk-ZMRP2A7K.js} +1 -1
  137. package/dist/chunks/cli-5JARGJOD.js +2 -0
  138. package/dist/chunks/{command-LNOVZQSK.js → command-AI3SMEAH.js} +11 -11
  139. package/dist/chunks/{configuration-command-C3QBDFND.js → configuration-command-NPA46ZOT.js} +1 -1
  140. package/dist/chunks/connected-app-executor-DLC23O43.js +2 -0
  141. package/dist/chunks/connected-evidence-TVORI55Q.js +2 -0
  142. package/dist/chunks/{connected-starting-assets-5LAJ7CZY.js → connected-starting-assets-WGGBWH4K.js} +1 -1
  143. package/dist/chunks/{continual-FVOLGGOE.js → continual-UHQI2EQD.js} +1 -1
  144. package/dist/chunks/core-commands-QNZUBKOC.js +2 -0
  145. package/dist/chunks/{dataset-preparation-authoring-UUYFWWCT.js → dataset-preparation-authoring-OBMJLGA4.js} +1 -1
  146. package/dist/chunks/datasets-USJLJOEQ.js +2 -0
  147. package/dist/chunks/desktop-test-IYHAOR47.js +3 -0
  148. package/dist/chunks/{dist-2MKJC6HN.js → dist-C5XFRP53.js} +1 -1
  149. package/dist/chunks/evaluation-coordination-UJENK4WQ.js +2 -0
  150. package/dist/chunks/experiment-improvements-6GJMKIER.js +2 -0
  151. package/dist/chunks/experiments-FZHILSC6.js +2 -0
  152. package/dist/chunks/experiments-signal-E32CWBS4.js +2 -0
  153. package/dist/chunks/{help-PLQJOP4P.js → help-32DLAPJR.js} +1 -1
  154. package/dist/chunks/host-profile-evaluation-tools-QAV2UGSB.js +2 -0
  155. package/dist/chunks/{host-profile-external-dataset-KSEPXY2S.js → host-profile-external-dataset-C6ZPMTX6.js} +1 -1
  156. package/dist/chunks/{hosted-app-server-composition-GZES7QXJ.js → hosted-app-server-composition-5DVBKNV3.js} +1 -1
  157. package/dist/chunks/{hosted-experiment-improvement-VG2WE7XZ.js → hosted-experiment-improvement-YQ24C54D.js} +1 -1
  158. package/dist/chunks/hosted-harness-runtime-KLIORGWV.js +2 -0
  159. package/dist/chunks/{hosted-profile-candidate-PTGQLPZO.js → hosted-profile-candidate-RCWFLOVJ.js} +1 -1
  160. package/dist/chunks/{hosted-profile-compiler-FS5R6CHJ.js → hosted-profile-compiler-UDG4BCEW.js} +1 -1
  161. package/dist/chunks/{hosted-profile-evaluation-control-UUEZEMXU.js → hosted-profile-evaluation-control-4R3L4FTK.js} +1 -1
  162. package/dist/chunks/{hosted-profile-evaluation-inspection-4F7OEF4T.js → hosted-profile-evaluation-inspection-NA4SSY7N.js} +1 -1
  163. package/dist/chunks/{hosted-profile-evaluation-preparation-LIJJZDHQ.js → hosted-profile-evaluation-preparation-B4BW6JTB.js} +1 -1
  164. package/dist/chunks/{hosted-tasksets-V24IBVJX.js → hosted-tasksets-IUK3VWSL.js} +1 -1
  165. package/dist/chunks/human-review-D6QCZLYN.js +2 -0
  166. package/dist/chunks/{import-SI24Z7EF.js → import-UCG75PN5.js} +1 -1
  167. package/dist/chunks/{learning-Y3UKNUGE.js → learning-3XDYMYBE.js} +1 -1
  168. package/dist/chunks/learning-OR4CYV4B.js +2 -0
  169. package/dist/chunks/local-harness-improvement-runtime-GZBMBZB2.js +2 -0
  170. package/dist/chunks/local-harness-taskset-review-YVP2ZQJG.js +2 -0
  171. package/dist/chunks/{model-projects-6YWVD2TS.js → model-projects-POZRHXTF.js} +1 -1
  172. package/dist/chunks/opchat-APJUUTT7.js +3 -0
  173. package/dist/chunks/opchat-bounded-chat-PBUSUAY2.js +2 -0
  174. package/dist/chunks/organizations-WK6EZ6L3.js +2 -0
  175. package/dist/chunks/{profile-TD5U3INY.js → profile-BQMS7ALQ.js} +1 -1
  176. package/dist/chunks/project-action-payload-CGV77JSA.js +2 -0
  177. package/dist/chunks/project-agent-XVFYTEUQ.js +2 -0
  178. package/dist/chunks/{published-experiment-source-SDXUVPE7.js → published-experiment-source-2CYFIRBL.js} +1 -1
  179. package/dist/chunks/{refiner-profile-service-56VYLZQJ.js → refiner-profile-service-OLJHA4DI.js} +1 -1
  180. package/dist/chunks/{runtime-Q7JUJO4D.js → runtime-32KYSVZR.js} +1 -1
  181. package/dist/chunks/sandbox-command-OY3VZXGG.js +2 -0
  182. package/dist/chunks/{sandbox-template-GOY7QQUY.js → sandbox-template-YOOSJ4FK.js} +1 -1
  183. package/dist/chunks/saved-work-L4KNWLZB.js +2 -0
  184. package/dist/chunks/setup-EU6CMRXQ.js +2 -0
  185. package/dist/chunks/{src-C3ZUESMK.js → src-3DJR7OAH.js} +1 -1
  186. package/dist/chunks/{src-MT4B43TD.js → src-HYOTHMRX.js} +111 -113
  187. package/dist/chunks/{standalone-experiment-turn-owner-TW5MTWIO.js → standalone-experiment-turn-owner-UYPA6XHW.js} +1 -1
  188. package/dist/chunks/{store-chat-resources-IRHBW2EC.js → store-chat-resources-HISLEZZM.js} +1 -1
  189. package/dist/chunks/{store-continual-support-reviews-3KK42L4I.js → store-continual-support-reviews-ORWHS57V.js} +1 -1
  190. package/dist/chunks/{store-conversation-serving-IVURK52V.js → store-conversation-serving-5UGYKEGJ.js} +1 -1
  191. package/dist/chunks/{store-create-improve-UTCLBXF2.js → store-create-improve-APLPTVYQ.js} +1 -1
  192. package/dist/chunks/{store-datasets-4AQOVAQY.js → store-datasets-HDW6IYBL.js} +1 -1
  193. package/dist/chunks/{store-evaluation-results-PK2P3IMH.js → store-evaluation-results-KB2UDCF3.js} +1 -1
  194. package/dist/chunks/{store-harness-workspaces-YEXB4IRV.js → store-harness-workspaces-TKX5PZWP.js} +1 -1
  195. package/dist/chunks/{store-human-review-O4BVHP25.js → store-human-review-IURNTX3C.js} +1 -1
  196. package/dist/chunks/{store-learned-preference-migration-validation-44SVX6YB.js → store-learned-preference-migration-validation-TH2LKQWV.js} +1 -1
  197. package/dist/chunks/{store-learning-SIUQIY5C.js → store-learning-WLUW2PWE.js} +1 -1
  198. package/dist/chunks/{store-learning-credentials-BUHR7SN6.js → store-learning-credentials-FDKCEDHK.js} +1 -1
  199. package/dist/chunks/{store-local-experiments-BHVTKPPE.js → store-local-experiments-M4V5RLHJ.js} +1 -1
  200. package/dist/chunks/{store-model-batch-review-RVAYUVK2.js → store-model-batch-review-DDZLWVTG.js} +1 -1
  201. package/dist/chunks/{store-model-configuration-6L3OYXF4.js → store-model-configuration-ATOFA5OH.js} +1 -1
  202. package/dist/chunks/{store-model-project-preparation-AAEKCF6V.js → store-model-project-preparation-ZRSCQEQR.js} +1 -1
  203. package/dist/chunks/{store-modification-recordings-LCPK6K2T.js → store-modification-recordings-YJIDUPVJ.js} +1 -1
  204. package/dist/chunks/{store-preference-comparison-5YVIQNVB.js → store-preference-comparison-JKURBESE.js} +1 -1
  205. package/dist/chunks/{store-task-inbox-L6IQTY26.js → store-task-inbox-L53OT6ZC.js} +1 -1
  206. package/dist/chunks/{store-task-inventory-QWS2C656.js → store-task-inventory-R2JJGAHW.js} +1 -1
  207. package/dist/chunks/{store-taskset-drafts-FRFL6ITK.js → store-taskset-drafts-FPNJPFPO.js} +1 -1
  208. package/dist/chunks/{store-training-FYXZU2FE.js → store-training-DIBW7OMP.js} +1 -1
  209. package/dist/chunks/{store-training-jobs-3N3VKPIY.js → store-training-jobs-K7I4SXWW.js} +1 -1
  210. package/dist/chunks/{store-training-models-VOFVGPZR.js → store-training-models-LCSB37YY.js} +1 -1
  211. package/dist/chunks/{taskset-UDDLFYKV.js → taskset-XI5SJBJL.js} +1 -1
  212. package/dist/chunks/{taskset-packages-WMG5DUBN.js → taskset-packages-FUQWNTSB.js} +1 -1
  213. package/dist/chunks/{taskset-packages-T6B6HYKZ.js → taskset-packages-GM6IUOTY.js} +1 -1
  214. package/dist/chunks/{teams-bot-YCUTDDDC.js → teams-bot-CYC5TR64.js} +1 -1
  215. package/dist/chunks/{tool-learning-ZQ6NSJ5K.js → tool-learning-52QZIJIR.js} +1 -1
  216. package/dist/chunks/{training-5UMT45UL.js → training-GDLLLXSV.js} +1 -1
  217. package/dist/chunks/training-RL7UUBER.js +2 -0
  218. package/dist/chunks/training-UJ62NOJJ.js +2 -0
  219. package/dist/chunks/training-hardware-MR4FUC4U.js +3 -0
  220. package/dist/chunks/training-hosted-V5CHG3M3.js +2 -0
  221. package/dist/chunks/{training-hosted-alphaedit-HSMRDJTD.js → training-hosted-alphaedit-R5PVATV4.js} +1 -1
  222. package/dist/chunks/{training-hosted-decision-7JALOU6O.js → training-hosted-decision-WNK5DE3M.js} +1 -1
  223. package/dist/chunks/{training-hosted-engram-SXO75MFG.js → training-hosted-engram-ZQDOKXAV.js} +1 -1
  224. package/dist/chunks/{training-hosted-learning-E2N32YU5.js → training-hosted-learning-UEBGSSNC.js} +1 -1
  225. package/dist/chunks/{training-hosted-modification-comparison-TXFDJFTG.js → training-hosted-modification-comparison-KKI5CKOH.js} +1 -1
  226. package/dist/chunks/{training-hosted-neuron-training-J42WK4EH.js → training-hosted-neuron-training-CFWEDRSR.js} +1 -1
  227. package/dist/chunks/{training-hosted-serving-report-BAEABGJH.js → training-hosted-serving-report-N4NF5AVW.js} +1 -1
  228. package/dist/chunks/{training-hosted-steering-T556BUBG.js → training-hosted-steering-4MDUQ2YV.js} +1 -1
  229. package/dist/chunks/{training-model-start-P3PXDWNT.js → training-model-start-NOA6TYQK.js} +1 -1
  230. package/dist/chunks/{web-search-ZEKJHZW4.js → web-search-FTVNZ7PH.js} +1 -1
  231. package/dist/cli.js +2 -2
  232. package/dist/index.js +1 -1
  233. package/dist/skills/manifest.json +3 -3
  234. package/dist/skills/openpond-cli/references/experiments-and-training.md +19 -0
  235. package/dist/web/assets/App-L7RV4D0A.js +54 -0
  236. package/dist/web/assets/{AppDialog-CxjDHVk9.js → AppDialog-B2V84J7f.js} +1 -1
  237. package/dist/web/assets/{AppTerminalPanel-CKJIVpKa.js → AppTerminalPanel-DfYpUDKT.js} +2 -2
  238. package/dist/web/assets/{AppToastContext-EpiT1dHs.js → AppToastContext-DuiPouLz.js} +1 -1
  239. package/dist/web/assets/{AppsView-BsMyPX_3.js → AppsView-B20RHDCy.js} +1 -1
  240. package/dist/web/assets/{AttachmentTypeIcon-BXvZy5gB.js → AttachmentTypeIcon-l-GRNxaz.js} +1 -1
  241. package/dist/web/assets/{BrowserSidebar-BIIV4aq4.js → BrowserSidebar-Ce0ToS2O.js} +1 -1
  242. package/dist/web/assets/{CartesianChart-brqLBqnF.js → CartesianChart-CtfMRAfp.js} +1 -1
  243. package/dist/web/assets/{ChatTimelineEntry-CwZbn16X.js → ChatTimelineEntry-DzcucW20.js} +1 -1
  244. package/dist/web/assets/{CollaborationTabs-BU4uc4tZ.js → CollaborationTabs-BpmKjNAC.js} +1 -1
  245. package/dist/web/assets/{CommandMenu-DkWpXR55.js → CommandMenu-JXsoxijv.js} +1 -1
  246. package/dist/web/assets/{CommunityView-CsSxJZGn.js → CommunityView-ggdn8pcH.js} +1 -1
  247. package/dist/web/assets/{ComposerAttachments-BdJGCYzI.js → ComposerAttachments-BMmALUs_.js} +1 -1
  248. package/dist/web/assets/{ComposerCreateImproveStrip-CWy0j1vv.js → ComposerCreateImproveStrip-DcM1bkfu.js} +1 -1
  249. package/dist/web/assets/{ConversationImportsSettings-DCmiakbZ.js → ConversationImportsSettings-BKNeARHI.js} +1 -1
  250. package/dist/web/assets/{DatasetReviewImport-DEnF_pGu.js → DatasetReviewImport-DyFOE0Q0.js} +1 -1
  251. package/dist/web/assets/{ExperimentTrainingDataWorkspace-WhwQ0QBi.js → ExperimentTrainingDataWorkspace-CfOyoMrq.js} +2 -2
  252. package/dist/web/assets/{FilePagePreview-BRhhz99q.js → FilePagePreview-B7bWObJN.js} +2 -2
  253. package/dist/web/assets/{GetStartedView-CLVD-qEi.js → GetStartedView-BYbFl93M.js} +1 -1
  254. package/dist/web/assets/{GettingStartedDialog-CMxaAMg-.js → GettingStartedDialog-UgreDozV.js} +1 -1
  255. package/dist/web/assets/{HostedModelLearningReview-Cn-j-rDo.js → HostedModelLearningReview-C_kng2U_.js} +1 -1
  256. package/dist/web/assets/HostedModelLearningSettings-aesD_ifF.js +1 -0
  257. package/dist/web/assets/{HtmlVisual-D5y2WG9L.js → HtmlVisual-nvl1x-jh.js} +1 -1
  258. package/dist/web/assets/{LabModelVersionDetailPage-BxRmYD6h.js → LabModelVersionDetailPage-DrdoNvI-.js} +1 -1
  259. package/dist/web/assets/{LabModelWorkspace-u2Ulm_z4.js → LabModelWorkspace-CHlhzG3q.js} +1 -1
  260. package/dist/web/assets/{LabSkillSidebar-C7IceJTJ.js → LabSkillSidebar-CqHeZzoj.js} +1 -1
  261. package/dist/web/assets/{LabsRoute-CbztQaEf.js → LabsRoute-DzEbPpMK.js} +4 -4
  262. package/dist/web/assets/{LearningBatchesPage-CJqgZNvM.js → LearningBatchesPage-A2dFQW2j.js} +1 -1
  263. package/dist/web/assets/{MainChatThread-DNMfrrRq.js → MainChatThread-BSvKu4e5.js} +2 -2
  264. package/dist/web/assets/{MainPane-CQQxSDPS.js → MainPane-DiWIAxMj.js} +6 -6
  265. package/dist/web/assets/{ModelProjectPageHeader-Dge19aE1.js → ModelProjectPageHeader-lu6iRXHK.js} +1 -1
  266. package/dist/web/assets/{NativeSetupTerminal-D4JnbpyD.js → NativeSetupTerminal-kZ-nFPE8.js} +2 -2
  267. package/dist/web/assets/{NativeSkillSidebar-Jzx1BeKV.js → NativeSkillSidebar-DkkD1uH2.js} +1 -1
  268. package/dist/web/assets/{NewProjectDialog-DcnGzEd9.js → NewProjectDialog-Dg8dMEpc.js} +1 -1
  269. package/dist/web/assets/{OutputsPage-Cmk15Vt_.js → OutputsPage-Dz190U9t.js} +1 -1
  270. package/dist/web/assets/{PageChrome-Cz_fCqtn.js → PageChrome-Bncv-ps0.js} +1 -1
  271. package/dist/web/assets/{ProjectsPage-BZ3Eo3Mz.js → ProjectsPage-DVkYvLtd.js} +1 -1
  272. package/dist/web/assets/{RightChatPanelStack-C6H2vU9N.js → RightChatPanelStack-CP4leenI.js} +1 -1
  273. package/dist/web/assets/RightSidebarHomePanel-C0etQXpt.js +1 -0
  274. package/dist/web/assets/{ScheduledWorkPage-CAkSwM0T.js → ScheduledWorkPage-DI0mgt82.js} +1 -1
  275. package/dist/web/assets/{SettingsView-DvQXGw3_.js → SettingsView-cCtkr089.js} +3 -3
  276. package/dist/web/assets/{TasksetDraftEditorPrimitives-JuU1k8vr.js → TasksetDraftEditorPrimitives-DCQTuswJ.js} +1 -1
  277. package/dist/web/assets/{TeamChatView-DmHjr8W9.js → TeamChatView-BBEomfQ7.js} +1 -1
  278. package/dist/web/assets/{TerminalOverlay-DlaM9d8F.js → TerminalOverlay-Dj5NUDMp.js} +1 -1
  279. package/dist/web/assets/{TrainingCreationPanel-ClpylNsr.js → TrainingCreationPanel-Ds4PLfsd.js} +1 -1
  280. package/dist/web/assets/{TrainingDraftPanel-6tH2xSDj.js → TrainingDraftPanel-BAuh_BF3.js} +1 -1
  281. package/dist/web/assets/{UsageSettingsSection-CzDqxOYM.js → UsageSettingsSection-DbzeatcW.js} +1 -1
  282. package/dist/web/assets/WorkSidebarPanel-BaNuXoZc.js +1 -0
  283. package/dist/web/assets/{WorkspaceDiffPanel-B4e0lyF7.js → WorkspaceDiffPanel-xk-ve1MO.js} +3 -3
  284. package/dist/web/assets/{WorkspaceEnvironmentMenu-D01ZkZZF.js → WorkspaceEnvironmentMenu-D8GSuoYz.js} +1 -1
  285. package/dist/web/assets/{WorkspaceFileLocation-C5s_njZb.js → WorkspaceFileLocation-Dl8M2ZKN.js} +1 -1
  286. package/dist/web/assets/{WorkspaceGitDialogs-DjPZ6KIh.js → WorkspaceGitDialogs-9BhLjYx4.js} +1 -1
  287. package/dist/web/assets/{WorkspaceMonacoEditor-CC4sfOiU.js → WorkspaceMonacoEditor-DYPuC7pj.js} +3 -3
  288. package/dist/web/assets/{WorkspacePdfPreview-vszQqFa4.js → WorkspacePdfPreview-B7BI9tLR.js} +2 -2
  289. package/dist/web/assets/{WorkspacePresentationPreview-DQTvhaRD.js → WorkspacePresentationPreview-sP7JUT7m.js} +1 -1
  290. package/dist/web/assets/{bot-Doyx3T4j.js → bot-D7M8ZtE6.js} +1 -1
  291. package/dist/web/assets/{chat-resources-Beh5lB36.js → chat-resources-DhKAnljP.js} +1 -1
  292. package/dist/web/assets/chevron-down-BAEcJitl.js +1 -0
  293. package/dist/web/assets/chevron-right-3G9s2cQ9.js +1 -0
  294. package/dist/web/assets/chevron-up-DTYF52H1.js +1 -0
  295. package/dist/web/assets/{chunk-C3TS766N-ppRhs95p.js → chunk-C3TS766N-DENE60SE.js} +1 -1
  296. package/dist/web/assets/{client-choice-storage-DitqKiIT.js → client-choice-storage-DYZsrVr9.js} +1 -1
  297. package/dist/web/assets/{client-DwZ92xtu.js → client-gy7zrd7a.js} +1 -1
  298. package/dist/web/assets/{cloud-upload-HdzNTgr2.js → cloud-upload-De-XSMUr.js} +1 -1
  299. package/dist/web/assets/{copy-DTQhoBNg.js → copy-DEK20zbZ.js} +1 -1
  300. package/dist/web/assets/{cssMode-BRTtfXxU.js → cssMode-Dau-Fhqf.js} +1 -1
  301. package/dist/web/assets/{external-link-H1629UU6.js → external-link-DwDry0Fb.js} +1 -1
  302. package/dist/web/assets/{folder-open-CAGdWOrr.js → folder-open-DOb4AjV6.js} +1 -1
  303. package/dist/web/assets/{folder-plus-C14cs2mE.js → folder-plus-BAouDaXv.js} +1 -1
  304. package/dist/web/assets/{git-commit-horizontal-DFUfuVvF.js → git-commit-horizontal-DZbHXcai.js} +1 -1
  305. package/dist/web/assets/{htmlMode-BVaCcL76.js → htmlMode-DlNEe6hu.js} +1 -1
  306. package/dist/web/assets/{icons-Bk2b68aC.js → icons-OQhKVrDc.js} +1 -1
  307. package/dist/web/assets/{image-0DPVY6Ev.js → image-BkYJDChH.js} +1 -1
  308. package/dist/web/assets/{index-B6XX_0h3.js → index-M_h2Ok4V.js} +2 -2
  309. package/dist/web/assets/{info-C8b_tafZ.js → info-Mj5lp4Ic.js} +1 -1
  310. package/dist/web/assets/{jsonMode-BCKKQmmV.js → jsonMode-CyOEyonV.js} +1 -1
  311. package/dist/web/assets/loader-circle-DXVtGvuV.js +1 -0
  312. package/dist/web/assets/{lspLanguageFeatures-DozmNUOx.js → lspLanguageFeatures-DAYPzatg.js} +1 -1
  313. package/dist/web/assets/{maximize-2-CByk9-zN.js → maximize-2-BwFXSX6b.js} +1 -1
  314. package/dist/web/assets/{message-square-C889vRqm.js → message-square-C2nqfNLn.js} +1 -1
  315. package/dist/web/assets/{monaco.contribution-BITdsRbn.js → monaco.contribution-BZcNCJER.js} +2 -2
  316. package/dist/web/assets/{monaco.contribution-DxAV1oS5.js → monaco.contribution-BZkfRhss.js} +2 -2
  317. package/dist/web/assets/{monaco.contribution-BqA-XZ44.js → monaco.contribution-D7_X8TXe.js} +2 -2
  318. package/dist/web/assets/{monaco.contribution-B9q6qbbo.js → monaco.contribution-KyLdVay7.js} +2 -2
  319. package/dist/web/assets/{monitor-BtxlcLuI.js → monitor-B0Qj5Wea.js} +1 -1
  320. package/dist/web/assets/{paperclip-BeIdaspf.js → paperclip-CmrRruxi.js} +1 -1
  321. package/dist/web/assets/{pdf-perlzwEB.js → pdf-BM-9_48p.js} +1 -1
  322. package/dist/web/assets/play-CkACZ6Zo.js +1 -0
  323. package/dist/web/assets/plus-CB258e62.js +1 -0
  324. package/dist/web/assets/{presentation-0bzvu6_u.js → presentation-BYxhoSIo.js} +1 -1
  325. package/dist/web/assets/{python-B9hOnkOI.js → python-B3Mj03I5.js} +1 -1
  326. package/dist/web/assets/{refresh-cw-D61-Ozk3.js → refresh-cw-CwEmO71D.js} +1 -1
  327. package/dist/web/assets/{save-iEMNZoPe.js → save-S--FOuce.js} +1 -1
  328. package/dist/web/assets/{settings-lists-C84qxFmP.js → settings-lists-ChqDppMP.js} +1 -1
  329. package/dist/web/assets/square-BmPfHjGU.js +1 -0
  330. package/dist/web/assets/{square-terminal-Djpzo2Qs.js → square-terminal-CawpQtCi.js} +1 -1
  331. package/dist/web/assets/{submit-issue-command-HfKzyxg5.js → submit-issue-command-CFitxxmO.js} +1 -1
  332. package/dist/web/assets/{toggleHighContrast-ClsXu39R.js → toggleHighContrast-D-cMCvXx.js} +1 -1
  333. package/dist/web/assets/training-CzbWtx75.js +1 -0
  334. package/dist/web/assets/{training-model-data-CIysl8wH.js → training-model-data-G-D64935.js} +1 -1
  335. package/dist/web/assets/{tsMode-nbmaMc-D.js → tsMode-9kzS1ijG.js} +1 -1
  336. package/dist/web/assets/{upload-C6ug8RD-.js → upload-CtYsSYrM.js} +1 -1
  337. package/dist/web/assets/{useAccountSettings-Dr9h4Qz_.js → useAccountSettings-DYYa6puz.js} +1 -1
  338. package/dist/web/assets/{useAgentInventory-ByCk2JAv.js → useAgentInventory-c5B_Tszj.js} +1 -1
  339. package/dist/web/assets/{useChatContextSelection-C0eMm2g6.js → useChatContextSelection-DOISZpTz.js} +1 -1
  340. package/dist/web/assets/{useLocalAgentSchedules-Do0y_leJ.js → useLocalAgentSchedules-QJ8RsMKm.js} +1 -1
  341. package/dist/web/assets/{useQuery-D2MQ7e5U.js → useQuery-DuTGOe2b.js} +1 -1
  342. package/dist/web/assets/{wifi-off-Dr-CapyW.js → wifi-off-BOfP4Vmg.js} +1 -1
  343. package/dist/web/assets/{workers-DKvM2NdM.js → workers-BwGpyrdj.js} +1 -1
  344. package/dist/web/assets/x-5_iy6IDd.js +1 -0
  345. package/dist/web/assets/{yaml-C02vq4ar.js → yaml-BU4IWV_7.js} +1 -1
  346. package/dist/web/index.html +1 -1
  347. package/docs/command-reference.md +1 -0
  348. package/package.json +1 -1
  349. package/dist/chunks/app-server-runtime-43MCH5SY.js +0 -2
  350. package/dist/chunks/apps-VNFGMQFG.js +0 -2
  351. package/dist/chunks/chunk-6D3FI2XT.js +0 -2
  352. package/dist/chunks/chunk-APKXXAUF.js +0 -2
  353. package/dist/chunks/chunk-JCLTFDVW.js +0 -2
  354. package/dist/chunks/chunk-KTIBXRWQ.js +0 -2
  355. package/dist/chunks/chunk-VEBW7NKD.js +0 -2
  356. package/dist/chunks/chunk-YDZBX4XQ.js +0 -2
  357. package/dist/chunks/cli-R7TAP6Z2.js +0 -2
  358. package/dist/chunks/connected-app-executor-LAEAQUJS.js +0 -2
  359. package/dist/chunks/connected-evidence-VKY6O2JW.js +0 -2
  360. package/dist/chunks/core-commands-5TNBVR72.js +0 -2
  361. package/dist/chunks/datasets-BIDZJYDC.js +0 -2
  362. package/dist/chunks/desktop-test-BY2MS3UL.js +0 -3
  363. package/dist/chunks/evaluation-coordination-FXB4DXZA.js +0 -2
  364. package/dist/chunks/experiment-improvements-JPDLKZXD.js +0 -2
  365. package/dist/chunks/experiments-IEN7RXLX.js +0 -2
  366. package/dist/chunks/experiments-signal-L32D36NH.js +0 -2
  367. package/dist/chunks/host-profile-evaluation-tools-UF4ATIUF.js +0 -2
  368. package/dist/chunks/hosted-harness-runtime-MMTLCL23.js +0 -2
  369. package/dist/chunks/human-review-6V6EMNVN.js +0 -2
  370. package/dist/chunks/learning-LAXMGWSQ.js +0 -2
  371. package/dist/chunks/local-harness-improvement-runtime-3YJQRYXC.js +0 -2
  372. package/dist/chunks/local-harness-taskset-review-XQHQ6JCR.js +0 -2
  373. package/dist/chunks/opchat-SV67HVMX.js +0 -3
  374. package/dist/chunks/opchat-bounded-chat-KLMIYSZZ.js +0 -2
  375. package/dist/chunks/organizations-OZZFX7RG.js +0 -2
  376. package/dist/chunks/project-action-payload-TK6G4VMC.js +0 -2
  377. package/dist/chunks/project-agent-FFXPNXCO.js +0 -2
  378. package/dist/chunks/sandbox-command-4BCUDAED.js +0 -2
  379. package/dist/chunks/saved-work-M6PUHKCC.js +0 -2
  380. package/dist/chunks/setup-RMZ2BHLM.js +0 -2
  381. package/dist/chunks/training-5NT2YB2L.js +0 -2
  382. package/dist/chunks/training-UY6KRG4M.js +0 -2
  383. package/dist/chunks/training-hardware-UWQCRDMV.js +0 -3
  384. package/dist/chunks/training-hosted-CKSDRVL6.js +0 -2
  385. package/dist/web/assets/App-CCuh99JW.js +0 -54
  386. package/dist/web/assets/HostedModelLearningSettings-VNBvf38S.js +0 -1
  387. package/dist/web/assets/RightSidebarHomePanel-BfMMVkM1.js +0 -1
  388. package/dist/web/assets/WorkSidebarPanel-CY-AHZ4-.js +0 -1
  389. package/dist/web/assets/chevron-down-DX1hzujj.js +0 -1
  390. package/dist/web/assets/chevron-right-DHN0y3KC.js +0 -1
  391. package/dist/web/assets/chevron-up-_QrW88NF.js +0 -1
  392. package/dist/web/assets/loader-circle-y-SSPwpk.js +0 -1
  393. package/dist/web/assets/play-CHXXdkuO.js +0 -1
  394. package/dist/web/assets/plus-DFFWjhPw.js +0 -1
  395. package/dist/web/assets/square-BE_4JMR3.js +0 -1
  396. package/dist/web/assets/training-DWfghwfZ.js +0 -1
  397. package/dist/web/assets/x-Jx2jlP9u.js +0 -1
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{Ga as E,_ as m,aa as T,ja as p}from"./chunk-BU6MW65V.js";import{da as y}from"./chunk-4PUOWSDE.js";import{n as w}from"./chunk-RCT3O3HQ.js";import{a as k}from"./chunk-FTQLQJQV.js";import{constants as u}from"node:fs";import{link as O,lstat as F,mkdir as h,mkdtemp as P,open as N,readFile as x,readdir as B,rename as A,rm as v,writeFile as I}from"node:fs/promises";import i from"node:path";async function M(r,a){let s=a.metadata.importedPackageHash;if(s===void 0)return;if(typeof s!="string"||!r)throw new Error("Imported batch requires its package storage directory.");let t=await S(r,s);if(!t.learningResources||t.taskset.id!==a.id||t.taskset.revision!==a.revision||w(y(t.taskset))!==w(a.metadata.learning))throw new Error("Imported batch differs from its pinned package.");return t}k(M,"readImportedLearningTasksetPackage");async function J(r,a,s=m){let t=p(a,s),o=i.join(r,"training","portable-packages");await h(o,{recursive:!0});let d=i.join(o,`${t.contentHash}.json`),c=await P(i.join(o,".package-"));try{let n=i.join(c,"package.json");await I(n,JSON.stringify(t),{flag:"wx",mode:384});try{await O(n,d)}catch(e){if(e.code!=="EEXIST")throw e;await S(r,t.contentHash,s)}}finally{await v(c,{recursive:!0,force:!0})}}k(J,"cacheTasksetPackage");async function S(r,a,s=m){if(!/^[a-f0-9]{64}$/.test(a))throw new Error("Invalid Taskset package cache identity.");let t=i.join(r,"training","portable-packages",`${a}.json`),o=await N(t,u.O_RDONLY|u.O_NOFOLLOW|u.O_NONBLOCK);try{let d=await o.stat();if(!d.isFile()||d.size>s)throw new Error("Taskset package cache must be a bounded regular file.");let c=Buffer.alloc(d.size),n=0;for(;n<c.length;){let f=await o.read(c,n,c.length-n,n);if(!f.bytesRead)throw new Error("Taskset package cache changed during read.");n+=f.bytesRead}if((await o.read(Buffer.alloc(1),0,1,n)).bytesRead)throw new Error("Taskset package cache changed during read.");let e=p(JSON.parse(c.toString("utf8")),s);if(e.contentHash!==a)throw new Error("Cached Taskset package differs from its saved receipt.");return e}finally{await o.close()}}k(S,"readCachedTasksetPackage");async function $(r){let a=p(r.package),s=E(r.taskset.profileId,a.contentHash);if(r.taskset.environment.metadata.runtimeSourceTasksetId!==s)throw new Error("Imported Taskset directory differs from its package identity.");let t=new Map,o=k((e,f)=>{if(i.isAbsolute(e)||e.includes("\\")||e.split("/").some(l=>!l||l==="."||l===".."))throw new Error("Taskset package file requires a safe relative path.");let g=t.get(e);if(g&&!Buffer.from(g).equals(Buffer.from(f)))throw new Error(`Taskset package files collide at ${e}.`);t.set(e,f)},"add");for(let e of a.files)o(e.asset.path,T(e));for(let e of r.generatedFiles)o(e.path,Buffer.from(e.content,"utf8"));o("taskset.json",Buffer.from(JSON.stringify(r.taskset),"utf8"));let d=i.join(r.home,"training","tasksets");await h(d,{recursive:!0});let c=await P(i.join(d,".package-import-")),n=i.join(d,s);try{for(let[e,f]of t)await h(i.dirname(i.join(c,e)),{recursive:!0}),await I(i.join(c,e),f,{flag:"wx",mode:384});try{await A(c,n)}catch(e){if(!["EEXIST","ENOTEMPTY"].includes(e.code??""))throw e;let f=await F(n);if(!f.isDirectory()||f.isSymbolicLink())throw new Error("Imported Taskset destination must be a regular directory.");let g=await j(n);if(JSON.stringify(g.sort())!==JSON.stringify([...t.keys()].sort()))throw new Error("Imported Taskset file inventory changed.");for(let[l,b]of t)if(!(await x(i.join(n,l))).equals(Buffer.from(b)))throw new Error("Imported Taskset files differ from the pinned package.")}await J(r.home,a)}finally{await v(c,{recursive:!0,force:!0})}}k($,"materializeImportedTasksetPackage");async function j(r,a=""){let s=[];for(let t of await B(i.join(r,a),{withFileTypes:!0})){let o=i.posix.join(a,t.name);if(t.isSymbolicLink())throw new Error("Imported Taskset directories cannot contain symbolic links.");if(t.isDirectory())s.push(...await j(r,o));else if(t.isFile())s.push(o);else throw new Error("Imported Taskset packages require regular files.")}return s}k(j,"regularFiles");export{M as a,J as b,S as c,$ as d};
2
+ import{Ga as E,_ as m,aa as T,ja as p}from"./chunk-BYVE4TMU.js";import{da as y}from"./chunk-ZEOYNUHL.js";import{n as w}from"./chunk-RCT3O3HQ.js";import{a as k}from"./chunk-FTQLQJQV.js";import{constants as u}from"node:fs";import{link as O,lstat as F,mkdir as h,mkdtemp as P,open as N,readFile as x,readdir as B,rename as A,rm as v,writeFile as I}from"node:fs/promises";import i from"node:path";async function M(r,a){let s=a.metadata.importedPackageHash;if(s===void 0)return;if(typeof s!="string"||!r)throw new Error("Imported batch requires its package storage directory.");let t=await S(r,s);if(!t.learningResources||t.taskset.id!==a.id||t.taskset.revision!==a.revision||w(y(t.taskset))!==w(a.metadata.learning))throw new Error("Imported batch differs from its pinned package.");return t}k(M,"readImportedLearningTasksetPackage");async function J(r,a,s=m){let t=p(a,s),o=i.join(r,"training","portable-packages");await h(o,{recursive:!0});let d=i.join(o,`${t.contentHash}.json`),c=await P(i.join(o,".package-"));try{let n=i.join(c,"package.json");await I(n,JSON.stringify(t),{flag:"wx",mode:384});try{await O(n,d)}catch(e){if(e.code!=="EEXIST")throw e;await S(r,t.contentHash,s)}}finally{await v(c,{recursive:!0,force:!0})}}k(J,"cacheTasksetPackage");async function S(r,a,s=m){if(!/^[a-f0-9]{64}$/.test(a))throw new Error("Invalid Taskset package cache identity.");let t=i.join(r,"training","portable-packages",`${a}.json`),o=await N(t,u.O_RDONLY|u.O_NOFOLLOW|u.O_NONBLOCK);try{let d=await o.stat();if(!d.isFile()||d.size>s)throw new Error("Taskset package cache must be a bounded regular file.");let c=Buffer.alloc(d.size),n=0;for(;n<c.length;){let f=await o.read(c,n,c.length-n,n);if(!f.bytesRead)throw new Error("Taskset package cache changed during read.");n+=f.bytesRead}if((await o.read(Buffer.alloc(1),0,1,n)).bytesRead)throw new Error("Taskset package cache changed during read.");let e=p(JSON.parse(c.toString("utf8")),s);if(e.contentHash!==a)throw new Error("Cached Taskset package differs from its saved receipt.");return e}finally{await o.close()}}k(S,"readCachedTasksetPackage");async function $(r){let a=p(r.package),s=E(r.taskset.profileId,a.contentHash);if(r.taskset.environment.metadata.runtimeSourceTasksetId!==s)throw new Error("Imported Taskset directory differs from its package identity.");let t=new Map,o=k((e,f)=>{if(i.isAbsolute(e)||e.includes("\\")||e.split("/").some(l=>!l||l==="."||l===".."))throw new Error("Taskset package file requires a safe relative path.");let g=t.get(e);if(g&&!Buffer.from(g).equals(Buffer.from(f)))throw new Error(`Taskset package files collide at ${e}.`);t.set(e,f)},"add");for(let e of a.files)o(e.asset.path,T(e));for(let e of r.generatedFiles)o(e.path,Buffer.from(e.content,"utf8"));o("taskset.json",Buffer.from(JSON.stringify(r.taskset),"utf8"));let d=i.join(r.home,"training","tasksets");await h(d,{recursive:!0});let c=await P(i.join(d,".package-import-")),n=i.join(d,s);try{for(let[e,f]of t)await h(i.dirname(i.join(c,e)),{recursive:!0}),await I(i.join(c,e),f,{flag:"wx",mode:384});try{await A(c,n)}catch(e){if(!["EEXIST","ENOTEMPTY"].includes(e.code??""))throw e;let f=await F(n);if(!f.isDirectory()||f.isSymbolicLink())throw new Error("Imported Taskset destination must be a regular directory.");let g=await j(n);if(JSON.stringify(g.sort())!==JSON.stringify([...t.keys()].sort()))throw new Error("Imported Taskset file inventory changed.");for(let[l,b]of t)if(!(await x(i.join(n,l))).equals(Buffer.from(b)))throw new Error("Imported Taskset files differ from the pinned package.")}await J(r.home,a)}finally{await v(c,{recursive:!0,force:!0})}}k($,"materializeImportedTasksetPackage");async function j(r,a=""){let s=[];for(let t of await B(i.join(r,a),{withFileTypes:!0})){let o=i.posix.join(a,t.name);if(t.isSymbolicLink())throw new Error("Imported Taskset directories cannot contain symbolic links.");if(t.isDirectory())s.push(...await j(r,o));else if(t.isFile())s.push(o);else throw new Error("Imported Taskset packages require regular files.")}return s}k(j,"regularFiles");export{M as a,J as b,S as c,$ as d};
@@ -1,4 +1,4 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as q}from"./chunk-FEAKTSRS.js";import{a as J,b as S}from"./chunk-RCQYEHHD.js";import{$ as j,Z as $}from"./chunk-6I5AUTVO.js";import{aa as _,ja as H}from"./chunk-BU6MW65V.js";import{D as N}from"./chunk-D6L6UNUQ.js";import{v as I}from"./chunk-ZY32SZ2P.js";import{n as k}from"./chunk-RCT3O3HQ.js";import{A as g}from"./chunk-X2J2P5ZT.js";import{a as o}from"./chunk-FTQLQJQV.js";import{randomUUID as O,createHash as W}from"node:crypto";import{mkdtemp as F,mkdir as G,writeFile as A,rm as U}from"node:fs/promises";import D from"node:os";import h from"node:path";var w=g.object({score:g.number().finite().min(0).max(1).nullable(),passed:g.boolean(),feedback:g.string().max(2e4),evidenceRefs:g.array(g.string().max(240)).max(1e3).default([])}).strict().refine(e=>e.score!==null||!e.passed,{message:"Unscorable verifiers cannot pass.",path:["passed"]});function L(e){if(e==="sandbox_process")throw new Error("verifier_sandbox_process_required")}o(L,"assertIsolatedVerifierRuntime");var ue=o(async e=>{let r=H(e.packageValue);if(e.grader.runtime!=="sandbox_process")throw new Error("Select the sandbox process runtime for a local file grader.");if(!r.taskset.graders.some(s=>k(s)===k(e.grader)))throw new Error("The private grader differs from its package.");if(!r.taskset.tasks.some(s=>k(s)===k(e.task)))throw new Error("The private case differs from its package.");await e.authorize(),e.signal?.throwIfAborted();let t=await F(h.join(D.tmpdir(),"profile-private-grade-")),c=O();try{let s=new Map;for(let a of r.files.filter(f=>f.asset.visibility!=="policy")){let f=a.asset.path;if(h.isAbsolute(f)||f.split(/[\\/]/).some(n=>!n||n==="."||n===".."))throw new Error("Private grader asset path invalid.");let l=s.get(f);if(l){if(l.contentHash!==a.asset.contentHash||l.sizeBytes!==a.asset.sizeBytes)throw new Error("Private grader assets declare conflicting bytes at the same path.");continue}s.set(f,{contentHash:a.asset.contentHash,sizeBytes:a.asset.sizeBytes});let x=h.join(t,"package",f);await G(h.dirname(x),{recursive:!0,mode:448}),await A(x,_(a),{mode:256})}await A(h.join(t,"request.json"),JSON.stringify({task:e.task,attempt:e.evidence,input:e.task.input,output:e.evidence.output,artifacts:"artifacts"in e.evidence?e.evidence.artifacts:[],expectedOutput:e.task.expectedOutput}),{mode:256});let i=`import fs from 'node:fs/promises'; const module=await import(${JSON.stringify("./package/"+e.grader.verifierRef.path)}); const result=await module[${JSON.stringify(e.grader.exportName??"verify")}](JSON.parse(await fs.readFile('request.json','utf8'))); console.log(JSON.stringify(result));`;await A(h.join(t,"runner.mjs"),i,{mode:256});let m=await q({authorize:o(async()=>(await e.authorize(),e.signal?.throwIfAborted(),{candidateId:c,candidateRevision:1,ownerId:c,sessionId:c,turnId:c,sourceRoot:t,writablePaths:[]}),"authorize")})({candidateId:c,sessionId:c,turnId:c,expectedRevision:1,command:"/runtime/node --max-old-space-size=512 runner.mjs",timeoutMs:e.grader.timeoutMs,maxOutputBytes:7e4,signal:e.signal});if(await e.authorize(),e.signal?.throwIfAborted(),m.code!==0||m.timedOut||m.stdoutTruncated||m.stderrTruncated)throw new Error("Private grading sandbox did not complete.");return w.parse(JSON.parse(m.stdout))}finally{await U(t,{recursive:!0,force:!0})}},"executeLocalProfileVerifier");function pe(e){return async r=>{if(!r.manifest)throw new Error("The hosted grader requires its admitted manifest.");await r.authorize(),r.signal?.throwIfAborted();let t="artifacts"in r.evidence&&Array.isArray(r.evidence.artifacts)?r.evidence.artifacts.map(({reference:a,title:f,contentType:l})=>({reference:a,title:f,contentType:l})):[],c="caseOwner"in r.evidence?r.evidence.caseOwner:null;if(!c?.sessionId||!c.turnId)throw new Error("The private grader has no sealed case owner.");let s=Buffer.from(JSON.stringify({manifest:r.manifest,packageValue:r.packageValue,graderId:r.grader.id,taskId:r.task.id,evidence:{...r.evidence,artifacts:t}}));if(s.length>2e7)throw new Error("The private grading package exceeds its transport limit.");let i={callId:O(),sessionId:c.sessionId,turnId:c.turnId,sha256:W("sha256").update(s).digest("hex"),sizeBytes:s.length,timeoutMs:r.grader.timeoutMs},d=o((a,f=12e4)=>e.request(j.parse({contractVersion:$,requestId:O(),operation:"profile-evaluations/grade",params:a}),f),"request");for(let a=0;a<s.length;a+=98304)await r.authorize(),r.signal?.throwIfAborted(),await d({...i,action:"upload",offset:a,contentsBase64:s.subarray(a,a+98304).toString("base64")});let m=await d({...i,action:"execute"},r.grader.timeoutMs+12e4);return await r.authorize(),r.signal?.throwIfAborted(),w.parse(m)}}o(pe,"createHostedProfileVerifier");import{Worker as K}from"node:worker_threads";async function b(e){e.signal?.throwIfAborted(),S(e);let{javascriptVerifierWorkerSource:r}=await import("./javascript-verifier-worker-source-LGRP74W4.js");e.signal?.throwIfAborted();let t=e.signal,c={source:e.source,exportName:e.exportName,value:e.value,timeoutMs:e.timeoutMs,maxResultBytes:e.maxResultBytes,deterministic:e.deterministic===!0,errorPrefix:e.errorPrefix},s=o(i=>new Error(`${e.errorPrefix}_${i}`),"error");return new Promise((i,d)=>{let m=new K(r,{eval:!0,workerData:c,execArgv:[],env:{},resourceLimits:{maxOldGenerationSizeMb:64,maxYoungGenerationSizeMb:16,stackSizeMb:4}}),a=!1,f=o(n=>{a||(a=!0,clearTimeout(x),t?.removeEventListener("abort",l),m.terminate().then(()=>{"error"in n?d(n.error):i(n.result)},d))},"finish"),l=o(()=>f({error:t?.reason instanceof Error?t.reason:s("cancelled")}),"cancel"),x=setTimeout(()=>f({error:s("timeout")}),e.timeoutMs);t?.addEventListener("abort",l,{once:!0}),m.once("error",n=>f({error:n})),m.once("exit",()=>{a||f({error:s("worker_exited_without_result")})}),m.once("message",n=>{try{if(!n||typeof n!="object"||!("ok"in n))throw s("worker_invalid_response");if(n.ok!==!0)throw new Error("error"in n&&typeof n.error=="string"?n.error:`${e.errorPrefix}_execution_failed`);if(!("result"in n))throw s("worker_invalid_response");I(n.result,e.maxResultBytes),f({result:n.result})}catch(y){f({error:y instanceof Error?y:s("worker_invalid_response")})}}),t?.aborted&&l()})}o(b,"executeJavaScriptIsolateInWorker");import{spawn as Y}from"node:child_process";var B=class extends Error{static{o(this,"JavaScriptVerifierHostTimeoutError")}timeoutMs;elapsedMs;constructor(r,t){super("verifier_timeout"),this.timeoutMs=r,this.elapsedMs=t,this.name="JavaScriptVerifierHostTimeoutError"}};async function be(e){e.signal?.throwIfAborted(),S(e);let{javascriptIsolateProcessSource:r}=await import("./javascript-isolate-process-source-YAT3GPW4.js");e.signal?.throwIfAborted();let{signal:t,stripTypeScript:c,...s}=e,i=o(m=>new Error(`${e.errorPrefix}_${m}`),"error"),d=`globalThis.__openpondIsolateInput = JSON.parse(${JSON.stringify(JSON.stringify(s))});
2
+ import{a as q}from"./chunk-FEAKTSRS.js";import{a as J,b as S}from"./chunk-O5ZOW474.js";import{$ as j,Z as $}from"./chunk-6I5AUTVO.js";import{aa as _,ja as H}from"./chunk-BYVE4TMU.js";import{D as N}from"./chunk-D6L6UNUQ.js";import{v as I}from"./chunk-ZY32SZ2P.js";import{n as k}from"./chunk-RCT3O3HQ.js";import{A as g}from"./chunk-X2J2P5ZT.js";import{a as o}from"./chunk-FTQLQJQV.js";import{randomUUID as O,createHash as W}from"node:crypto";import{mkdtemp as F,mkdir as G,writeFile as A,rm as U}from"node:fs/promises";import D from"node:os";import h from"node:path";var w=g.object({score:g.number().finite().min(0).max(1).nullable(),passed:g.boolean(),feedback:g.string().max(2e4),evidenceRefs:g.array(g.string().max(240)).max(1e3).default([])}).strict().refine(e=>e.score!==null||!e.passed,{message:"Unscorable verifiers cannot pass.",path:["passed"]});function L(e){if(e==="sandbox_process")throw new Error("verifier_sandbox_process_required")}o(L,"assertIsolatedVerifierRuntime");var ue=o(async e=>{let r=H(e.packageValue);if(e.grader.runtime!=="sandbox_process")throw new Error("Select the sandbox process runtime for a local file grader.");if(!r.taskset.graders.some(s=>k(s)===k(e.grader)))throw new Error("The private grader differs from its package.");if(!r.taskset.tasks.some(s=>k(s)===k(e.task)))throw new Error("The private case differs from its package.");await e.authorize(),e.signal?.throwIfAborted();let t=await F(h.join(D.tmpdir(),"profile-private-grade-")),c=O();try{let s=new Map;for(let a of r.files.filter(f=>f.asset.visibility!=="policy")){let f=a.asset.path;if(h.isAbsolute(f)||f.split(/[\\/]/).some(n=>!n||n==="."||n===".."))throw new Error("Private grader asset path invalid.");let l=s.get(f);if(l){if(l.contentHash!==a.asset.contentHash||l.sizeBytes!==a.asset.sizeBytes)throw new Error("Private grader assets declare conflicting bytes at the same path.");continue}s.set(f,{contentHash:a.asset.contentHash,sizeBytes:a.asset.sizeBytes});let x=h.join(t,"package",f);await G(h.dirname(x),{recursive:!0,mode:448}),await A(x,_(a),{mode:256})}await A(h.join(t,"request.json"),JSON.stringify({task:e.task,attempt:e.evidence,input:e.task.input,output:e.evidence.output,artifacts:"artifacts"in e.evidence?e.evidence.artifacts:[],expectedOutput:e.task.expectedOutput}),{mode:256});let i=`import fs from 'node:fs/promises'; const module=await import(${JSON.stringify("./package/"+e.grader.verifierRef.path)}); const result=await module[${JSON.stringify(e.grader.exportName??"verify")}](JSON.parse(await fs.readFile('request.json','utf8'))); console.log(JSON.stringify(result));`;await A(h.join(t,"runner.mjs"),i,{mode:256});let m=await q({authorize:o(async()=>(await e.authorize(),e.signal?.throwIfAborted(),{candidateId:c,candidateRevision:1,ownerId:c,sessionId:c,turnId:c,sourceRoot:t,writablePaths:[]}),"authorize")})({candidateId:c,sessionId:c,turnId:c,expectedRevision:1,command:"/runtime/node --max-old-space-size=512 runner.mjs",timeoutMs:e.grader.timeoutMs,maxOutputBytes:7e4,signal:e.signal});if(await e.authorize(),e.signal?.throwIfAborted(),m.code!==0||m.timedOut||m.stdoutTruncated||m.stderrTruncated)throw new Error("Private grading sandbox did not complete.");return w.parse(JSON.parse(m.stdout))}finally{await U(t,{recursive:!0,force:!0})}},"executeLocalProfileVerifier");function pe(e){return async r=>{if(!r.manifest)throw new Error("The hosted grader requires its admitted manifest.");await r.authorize(),r.signal?.throwIfAborted();let t="artifacts"in r.evidence&&Array.isArray(r.evidence.artifacts)?r.evidence.artifacts.map(({reference:a,title:f,contentType:l})=>({reference:a,title:f,contentType:l})):[],c="caseOwner"in r.evidence?r.evidence.caseOwner:null;if(!c?.sessionId||!c.turnId)throw new Error("The private grader has no sealed case owner.");let s=Buffer.from(JSON.stringify({manifest:r.manifest,packageValue:r.packageValue,graderId:r.grader.id,taskId:r.task.id,evidence:{...r.evidence,artifacts:t}}));if(s.length>2e7)throw new Error("The private grading package exceeds its transport limit.");let i={callId:O(),sessionId:c.sessionId,turnId:c.turnId,sha256:W("sha256").update(s).digest("hex"),sizeBytes:s.length,timeoutMs:r.grader.timeoutMs},d=o((a,f=12e4)=>e.request(j.parse({contractVersion:$,requestId:O(),operation:"profile-evaluations/grade",params:a}),f),"request");for(let a=0;a<s.length;a+=98304)await r.authorize(),r.signal?.throwIfAborted(),await d({...i,action:"upload",offset:a,contentsBase64:s.subarray(a,a+98304).toString("base64")});let m=await d({...i,action:"execute"},r.grader.timeoutMs+12e4);return await r.authorize(),r.signal?.throwIfAborted(),w.parse(m)}}o(pe,"createHostedProfileVerifier");import{Worker as K}from"node:worker_threads";async function b(e){e.signal?.throwIfAborted(),S(e);let{javascriptVerifierWorkerSource:r}=await import("./javascript-verifier-worker-source-LGRP74W4.js");e.signal?.throwIfAborted();let t=e.signal,c={source:e.source,exportName:e.exportName,value:e.value,timeoutMs:e.timeoutMs,maxResultBytes:e.maxResultBytes,deterministic:e.deterministic===!0,errorPrefix:e.errorPrefix},s=o(i=>new Error(`${e.errorPrefix}_${i}`),"error");return new Promise((i,d)=>{let m=new K(r,{eval:!0,workerData:c,execArgv:[],env:{},resourceLimits:{maxOldGenerationSizeMb:64,maxYoungGenerationSizeMb:16,stackSizeMb:4}}),a=!1,f=o(n=>{a||(a=!0,clearTimeout(x),t?.removeEventListener("abort",l),m.terminate().then(()=>{"error"in n?d(n.error):i(n.result)},d))},"finish"),l=o(()=>f({error:t?.reason instanceof Error?t.reason:s("cancelled")}),"cancel"),x=setTimeout(()=>f({error:s("timeout")}),e.timeoutMs);t?.addEventListener("abort",l,{once:!0}),m.once("error",n=>f({error:n})),m.once("exit",()=>{a||f({error:s("worker_exited_without_result")})}),m.once("message",n=>{try{if(!n||typeof n!="object"||!("ok"in n))throw s("worker_invalid_response");if(n.ok!==!0)throw new Error("error"in n&&typeof n.error=="string"?n.error:`${e.errorPrefix}_execution_failed`);if(!("result"in n))throw s("worker_invalid_response");I(n.result,e.maxResultBytes),f({result:n.result})}catch(y){f({error:y instanceof Error?y:s("worker_invalid_response")})}}),t?.aborted&&l()})}o(b,"executeJavaScriptIsolateInWorker");import{spawn as Y}from"node:child_process";var B=class extends Error{static{o(this,"JavaScriptVerifierHostTimeoutError")}timeoutMs;elapsedMs;constructor(r,t){super("verifier_timeout"),this.timeoutMs=r,this.elapsedMs=t,this.name="JavaScriptVerifierHostTimeoutError"}};async function be(e){e.signal?.throwIfAborted(),S(e);let{javascriptIsolateProcessSource:r}=await import("./javascript-isolate-process-source-YAT3GPW4.js");e.signal?.throwIfAborted();let{signal:t,stripTypeScript:c,...s}=e,i=o(m=>new Error(`${e.errorPrefix}_${m}`),"error"),d=`globalThis.__openpondIsolateInput = JSON.parse(${JSON.stringify(JSON.stringify(s))});
3
3
  ${c?`globalThis.__openpondIsolateInput.source = require("node:module").stripTypeScriptTypes(globalThis.__openpondIsolateInput.source, { mode: "strip" });
4
4
  `:""}${r}`;return new Promise((m,a)=>{let f=performance.now(),l=Y("node",["--max-old-space-size=64","--input-type=commonjs","-"],{stdio:["pipe","pipe","pipe","ipc"],env:{PATH:process.env.PATH},windowsHide:!0}),x,n="",y=0,M=0,v=o(u=>{x??=u,l.kill("SIGKILL")},"stop"),T=o(()=>v(t?.reason instanceof Error?t.reason:i("cancelled")),"cancel"),P=e.errorPrefix==="verifier",R=!P,V=o(()=>v(e.errorPrefix==="candidate"?new J("candidate_timeout"):e.errorPrefix==="verifier"?new B(e.timeoutMs,performance.now()-f):i("timeout")),"timedOut"),E=setTimeout(V,P?3e4:e.timeoutMs);l.on("message",u=>{if(!P||R||!u||typeof u!="object"||!("type"in u)||u.type!=="execution_ready"){v(i("process_invalid_startup_message"));return}R=!0,clearTimeout(E),E=setTimeout(V,e.timeoutMs)}),t?.addEventListener("abort",T,{once:!0}),l.stdout.setEncoding("utf8"),l.stdout.on("data",u=>{y+=Buffer.byteLength(u),y>e.maxResultBytes+65536?v(i("process_response_too_large")):n+=u}),l.stderr.on("data",u=>{M+=u.byteLength,M>65536&&v(i("process_stderr_too_large"))}),l.once("error",u=>{x??=u}),l.stdin.on("error",u=>v(u)),l.once("close",u=>{if(clearTimeout(E),t?.removeEventListener("abort",T),x){a(x);return}try{if(u!==0)throw i("process_exited_without_result");if(!R)throw i("process_exited_before_ready");let p=JSON.parse(n);if(!p||typeof p!="object"||!("ok"in p))throw i("process_invalid_response");if(p.ok!==!0){let z="error"in p&&typeof p.error=="string"?p.error:`${e.errorPrefix}_execution_failed`;throw"executionError"in p&&p.executionError===!0?new J(z):new Error(z)}if(!("result"in p))throw i("process_invalid_response");I(p.result,e.maxResultBytes),m(p.result)}catch(p){a(p instanceof Error?p:i("process_invalid_response"))}}),l.stdin.end(d),t?.aborted&&T()})}o(be,"executeJavaScriptIsolateInProcess");async function Je(e){return L(e.runtime),w.parse(await b({...e,exportName:e.exportName??"verify",maxResultBytes:65536,errorPrefix:"verifier"}))}o(Je,"executeJavaScriptVerifierInWorker");function Ne(e){return N(e,C)}o(Ne,"aggregateTasksetEvaluationInWorker");var C=o(async({source:e,module:r,exportName:t,scores:c,timeoutMs:s,signal:i})=>{let d=/\.[cm]?ts$/.test(r)?(await import("node:module")).stripTypeScriptTypes(e,{mode:"strip"}):e;return b({source:d,exportName:t,value:c,timeoutMs:s,signal:i,maxResultBytes:1024,deterministic:!0,errorPrefix:"metric"})},"executeMetric");var He=C;import Q from"node:path";function We(e,r){let t=g.array(g.string().min(1).max(240)).max(16).parse(r.metadata.artifactAssetIds??[]);if(new Set(t).size!==t.length)throw new Error("An artifact fixture contains duplicate assets.");let c=0;return t.map(s=>{let i=e.files.filter(a=>a.asset.id===s),d=i[0];if(i.length!==1||!d||d.asset.visibility!=="host_private")throw new Error("Artifact fixtures require a unique private package asset.");let m=_(d);if((c+=m.length)>2e7)throw new Error("Artifact fixtures exceed their aggregate byte limit.");return{reference:{id:`fixture/${r.id}/${d.asset.path}`,contentHash:d.asset.contentHash,mediaType:d.asset.mediaType,sizeBytes:d.asset.sizeBytes},title:Q.posix.basename(d.asset.path),contentType:d.asset.mediaType,base64:Buffer.from(m).toString("base64")}})}o(We,"localGraderFixtureArtifacts");export{ue as a,pe as b,b as c,be as d,Je as e,We as f,Ne as g,He as h};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{c as _}from"./chunk-RFQD6B44.js";import{V as y,W as C,X as N,Y as D,Z as k,_ as K,e as L,f as U,i as M,t as $}from"./chunk-JEMECEQH.js";import{b as O}from"./chunk-7EQLW2KM.js";import{d as I}from"./chunk-RPM4FDRX.js";import{e as B,f as T,g as A}from"./chunk-BSHAIAXY.js";import{f as w}from"./chunk-3M53YXEI.js";import{b as v}from"./chunk-GLUWATL5.js";import{a as o}from"./chunk-FTQLQJQV.js";function ce(e){if(e.repoUrl)return e.repoUrl;if(e.gitHost&&e.gitOwner&&e.gitRepo)return`https://${e.gitHost}/${e.gitOwner}/${e.gitRepo}.git`;throw new Error("repoUrl missing from API response")}o(ce,"resolveRepoUrl");function le(e,t){let n=new URL(e),r=encodeURIComponent(t);return`${n.protocol}//x-access-token:${r}@${n.host}${n.pathname}`}o(le,"formatTokenizedRepoUrl");function fe(e){let t=new URL(e);return`${t.protocol}//x-access-token:$OPENPOND_API_KEY@${t.host}${t.pathname}`}o(fe,"formatTokenizedRepoUrlForPrint");function me(e){return e.replace(/x-access-token:[^@]+@/g,"x-access-token:***@")}o(me,"redactToken");function pe(e){let t=process.env.OPENPOND_BASE_URL;if(t)try{let n=new URL(t).hostname,r=new URL(e).hostname;n&&r&&n!==r&&(console.warn(`warning: repo host (${r}) does not match OPENPOND_BASE_URL (${n})`),console.warn("warning: verify your git host configuration matches OPENPOND_BASE_URL."))}catch{}}o(pe,"warnOnRepoHostMismatch");function W(e){let t=e.split("/").filter(Boolean);if(t.length!==2)throw new Error("expected <handle>/<repo>");return{handle:t[0],repo:t[1]}}o(W,"parseHandleRepo");function S(e){return(e||"").trim().toLowerCase()}o(S,"normalizeRepoName");async function ee(e){if(!e.forceRefresh){let n=await C({apiBase:e.apiBase,apiKey:e.apiKey,ttlMs:y});if(n)return n}let t=await M(e.apiBase,e.apiKey);return await N({apiBase:e.apiBase,apiKey:e.apiKey,apps:t}),t}o(ee,"fetchAppsWithCache");async function Re(e){if(!e.forceRefresh){let r=await D({apiBase:e.apiBase,apiKey:e.apiKey,ttlMs:y});if(r)return r}let t=await $(e.apiBase,e.apiKey),n=Array.isArray(t.tools)?t.tools:[];return await k({apiBase:e.apiBase,apiKey:e.apiKey,tools:n}),n}o(Re,"fetchToolsWithCache");async function Pe(e,t,n){let{handle:r,repo:s}=W(n),i=await ee({apiBase:e,apiKey:t}),a=S(s),d=i.find(u=>u.handle&&u.handle!==r?!1:[u.repo,u.gitRepo,u.id].map(S).includes(a));if(!d)throw new Error(`app not found for ${r}/${s}`);return{app:d,handle:r,repo:s}}o(Pe,"resolveAppTarget");async function Ee(e){let t=e.intervalMs??5e3,n=e.timeoutMs??240*1e3,r=new Set,s=Date.now();for(;Date.now()-s<n;){let a=(await L(e.baseUrl,e.apiKey,e.deploymentId)).filter(u=>!r.has(u.id));for(let u of a)r.add(u.id);for(let u of a)console.log(`${e.prefix}${u.message}`);let d=await U(e.baseUrl,e.apiKey,e.deploymentId);if(d.status==="failed"){console.log(`${e.prefix}deployment failed`);return}if(d.status==="running"||d.status==="deployed"){console.log(`${e.prefix}deployment complete`);return}await new Promise(u=>setTimeout(u,t))}console.log(`${e.prefix}deployment still in progress`)}o(Ee,"pollDeploymentLogs");import{stdin as q,stdout as H}from"node:process";import{createInterface as F}from"node:readline/promises";async function z(){let e=[];for await(let t of process.stdin)e.push(Buffer.isBuffer(t)?t:Buffer.from(String(t)));return Buffer.concat(e).toString("utf8").replace(/\r?\n$/,"")}o(z,"readAllStdin");function V(e){return new Promise((t,n)=>{let r=process.stdin,s=process.stderr,i="",a=r.isRaw;function d(){r.off("data",u),r.setRawMode&&r.setRawMode(a),r.pause(),s.write(`
2
+ import{c as _}from"./chunk-RFQD6B44.js";import{V as y,W as C,X as N,Y as D,Z as k,_ as K,e as L,f as U,i as M,t as $}from"./chunk-KHDCMVEJ.js";import{b as O}from"./chunk-BLNEHU62.js";import{d as I}from"./chunk-RPM4FDRX.js";import{e as B,f as T,g as A}from"./chunk-BSHAIAXY.js";import{f as w}from"./chunk-3M53YXEI.js";import{b as v}from"./chunk-GLUWATL5.js";import{a as o}from"./chunk-FTQLQJQV.js";function ce(e){if(e.repoUrl)return e.repoUrl;if(e.gitHost&&e.gitOwner&&e.gitRepo)return`https://${e.gitHost}/${e.gitOwner}/${e.gitRepo}.git`;throw new Error("repoUrl missing from API response")}o(ce,"resolveRepoUrl");function le(e,t){let n=new URL(e),r=encodeURIComponent(t);return`${n.protocol}//x-access-token:${r}@${n.host}${n.pathname}`}o(le,"formatTokenizedRepoUrl");function fe(e){let t=new URL(e);return`${t.protocol}//x-access-token:$OPENPOND_API_KEY@${t.host}${t.pathname}`}o(fe,"formatTokenizedRepoUrlForPrint");function me(e){return e.replace(/x-access-token:[^@]+@/g,"x-access-token:***@")}o(me,"redactToken");function pe(e){let t=process.env.OPENPOND_BASE_URL;if(t)try{let n=new URL(t).hostname,r=new URL(e).hostname;n&&r&&n!==r&&(console.warn(`warning: repo host (${r}) does not match OPENPOND_BASE_URL (${n})`),console.warn("warning: verify your git host configuration matches OPENPOND_BASE_URL."))}catch{}}o(pe,"warnOnRepoHostMismatch");function W(e){let t=e.split("/").filter(Boolean);if(t.length!==2)throw new Error("expected <handle>/<repo>");return{handle:t[0],repo:t[1]}}o(W,"parseHandleRepo");function S(e){return(e||"").trim().toLowerCase()}o(S,"normalizeRepoName");async function ee(e){if(!e.forceRefresh){let n=await C({apiBase:e.apiBase,apiKey:e.apiKey,ttlMs:y});if(n)return n}let t=await M(e.apiBase,e.apiKey);return await N({apiBase:e.apiBase,apiKey:e.apiKey,apps:t}),t}o(ee,"fetchAppsWithCache");async function Re(e){if(!e.forceRefresh){let r=await D({apiBase:e.apiBase,apiKey:e.apiKey,ttlMs:y});if(r)return r}let t=await $(e.apiBase,e.apiKey),n=Array.isArray(t.tools)?t.tools:[];return await k({apiBase:e.apiBase,apiKey:e.apiKey,tools:n}),n}o(Re,"fetchToolsWithCache");async function Pe(e,t,n){let{handle:r,repo:s}=W(n),i=await ee({apiBase:e,apiKey:t}),a=S(s),d=i.find(u=>u.handle&&u.handle!==r?!1:[u.repo,u.gitRepo,u.id].map(S).includes(a));if(!d)throw new Error(`app not found for ${r}/${s}`);return{app:d,handle:r,repo:s}}o(Pe,"resolveAppTarget");async function Ee(e){let t=e.intervalMs??5e3,n=e.timeoutMs??240*1e3,r=new Set,s=Date.now();for(;Date.now()-s<n;){let a=(await L(e.baseUrl,e.apiKey,e.deploymentId)).filter(u=>!r.has(u.id));for(let u of a)r.add(u.id);for(let u of a)console.log(`${e.prefix}${u.message}`);let d=await U(e.baseUrl,e.apiKey,e.deploymentId);if(d.status==="failed"){console.log(`${e.prefix}deployment failed`);return}if(d.status==="running"||d.status==="deployed"){console.log(`${e.prefix}deployment complete`);return}await new Promise(u=>setTimeout(u,t))}console.log(`${e.prefix}deployment still in progress`)}o(Ee,"pollDeploymentLogs");import{stdin as q,stdout as H}from"node:process";import{createInterface as F}from"node:readline/promises";async function z(){let e=[];for await(let t of process.stdin)e.push(Buffer.isBuffer(t)?t:Buffer.from(String(t)));return Buffer.concat(e).toString("utf8").replace(/\r?\n$/,"")}o(z,"readAllStdin");function V(e){return new Promise((t,n)=>{let r=process.stdin,s=process.stderr,i="",a=r.isRaw;function d(){r.off("data",u),r.setRawMode&&r.setRawMode(a),r.pause(),s.write(`
3
3
  `)}o(d,"cleanup");function u(m){let f=Buffer.isBuffer(m)?m:Buffer.from(m);for(let c of f){if(c===3){d(),n(new Error("secret prompt cancelled"));return}if(c===13||c===10){d(),t(i);return}if(c===127||c===8){i.length>0&&(i=i.slice(0,-1),s.write("\b \b"));continue}i+=Buffer.from([c]).toString("utf8"),s.write("*")}}o(u,"onData"),s.write(e),r.resume(),r.setRawMode&&r.setRawMode(!0),r.on("data",u)})}o(V,"readMaskedLine");async function Ae(e,t=!1){let n=F({input:q,output:H});try{let r=t?"[Y/n]":"[y/N]",s=(await n.question(`${e} ${r} `)).trim().toLowerCase();return s?s==="y"||s==="yes":t}finally{n.close()}}o(Ae,"promptConfirm");async function Ie(e){let t=F({input:q,output:H});try{return(await t.question(`Local path (default: ${e}): `)).trim()||e}finally{t.close()}}o(Ie,"promptForPath");var X=["readonly","attempt","feature","rollout","replay","template_build","scheduled_run","patch_only","hotfix","multi_feature_batch"],j=["none","manual","auto_after_checks"],G=[...K];function te(e,t){return(process.env.OPENPOND_SANDBOX_BASE_URL||process.env.OPENPOND_API_URL||e.apiBaseUrl||A(process.env.OPENPOND_BASE_URL||e.baseUrl)||v).replace(/\/$/,"")}o(te,"resolveSandboxBaseUrl");async function We(e){let t=await ne(e),n=T(t),r=await _(t,n),s=B(e)||process.env.OPENPOND_SANDBOX_API_URL?.trim()||null,i=te(t,e);return O(s?{apiKey:r,sandboxApiUrl:s}:{apiKey:r,baseUrl:i})}o(We,"resolveSandboxClient");async function ne(e){return I()}o(ne,"loadSandboxConfig");function qe(e){if(e===void 0)return;if(typeof e!="string"||!e.trim())throw new Error("workflow-mode must be a non-empty value");let t=e.trim();if(!X.includes(t))throw new Error(`workflow-mode must be one of ${X.join(", ")}`);return t}o(qe,"parseSandboxWorkflowModeOption");function He(e){if(e===void 0)return;if(typeof e!="string"||!e.trim())throw new Error("runtime-promotion-policy must be a non-empty value");let t=e.trim();if(!j.includes(t))throw new Error(`runtime-promotion-policy must be one of ${j.join(", ")}`);return t}o(He,"parseSandboxRuntimePromotionPolicyOption");function Fe(e){if(typeof e!="string"||!e.trim())return;let t=e.trim();if(!G.includes(t))throw new Error(`runtime-profile-id must be one of ${G.join(", ")}`);return t}o(Fe,"parseSandboxRuntimeProfileIdOption");function re(e){let t=Y(e.envRef,"env-ref").map(({name:i,value:a})=>({name:i,secretRef:a})),n=Y(e.envLiteral,"env-literal").map(({name:i,value:a})=>{if(oe(i)&&!w(e.allowPlainSecretEnv))throw new Error(`refusing plaintext value for secret-like env ${i}; create a sandbox secret and pass --env-ref ${i}=openpond://secret/...`);return{name:i,value:a}}),r=[...t,...n],s=new Set;for(let i of r){if(s.has(i.name))throw new Error(`duplicate sandbox env var: ${i.name}`);s.add(i.name)}return r}o(re,"parseSandboxEnvOptions");function ze(e,t){let n=re(t),r=new Set(n.map(a=>a.name)),s=new Map(n.map(a=>[a.name,a]));for(let a of e.inputs.env)if(s.get(a.name)?.value!==void 0&&a.secret!==!1)throw new Error(`sandbox template env ${a.name} requires a secret ref. Pass --env-ref ${a.name}=openpond://secret/...`);let i=e.inputs.env.filter(a=>a.required&&!r.has(a.name)).map(a=>a.name);if(i.length>0)throw new Error(`missing required sandbox template env refs: ${i.join(", ")}. Pass --env-ref NAME=openpond://secret/...`);return n}o(ze,"parseSandboxTemplateEnvOptions");function Y(e,t){return typeof e!="string"?[]:e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>{let r=n.indexOf("=");if(r<=0)throw new Error(`${t} entries must use NAME=value`);let s=n.slice(0,r).trim(),i=n.slice(r+1).trim();if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(s))throw new Error(`${t} has invalid env name: ${s}`);if(!i)throw new Error(`${t} value is required for ${s}`);return{name:s,value:i}})}o(Y,"parseSandboxEnvAssignments");function oe(e){return/(?:SECRET|TOKEN|KEY|PASSWORD|PASSWD|PRIVATE|CREDENTIAL|DATABASE_URL|DSN)/i.test(e)}o(oe,"isSecretLikeEnvName");async function Ve(e,t){if(typeof e.value=="string"||typeof e.secretValue=="string")throw new Error("sandbox secret values must be provided with --stdin or the masked prompt");if(w(e.stdin)){let s=await z();if(!s)throw new Error(`${t} read no secret value from stdin`);return s}if(!process.stdin.isTTY)throw new Error(`${t} requires --stdin when not running in a TTY`);let r=await V(`${t}: `);if(!r)throw new Error(`${t} cannot be empty`);return r}o(Ve,"readSandboxSecretValue");function Xe(e){return{id:e.id,teamId:e.teamId,name:e.name,scope:e.scope,status:e.status,secretRef:e.secretRef,currentVersion:e.currentVersion,updatedAt:e.updatedAt,lastUsedAt:e.lastUsedAt,attachedDestinations:e.attachments?.length??0}}o(Xe,"summarizeSandboxSecret");import{Buffer as b}from"node:buffer";import{spawn as Q}from"node:child_process";var ie=600*1e3,se=2*1024*1024;function R(e,t=[],n={}){return n.inherit&&n.terminateWhenStdoutIncludes!==void 0?Promise.reject(new Error("terminateWhenStdoutIncludes requires captured stdout")):n.terminateWhenStdoutIncludes===""?Promise.reject(new Error("terminateWhenStdoutIncludes must not be empty")):new Promise((r,s)=>{let i=Q(e,t,{cwd:n.cwd,env:n.env?{...process.env,...n.env}:void 0,shell:n.shell,detached:n.detached??process.platform!=="win32",stdio:n.inherit?"inherit":[n.stdin===void 0?"ignore":"pipe","pipe","pipe"]}),a=new h(J(n)),d=new h(J(n)),u=!1,m=n.timeoutMs??ie,f,c,x=null,g=!1,P=o(()=>{f&&clearTimeout(f),c&&clearTimeout(c)},"clearTimers"),E=o(l=>{x!==null||g||(x=l,u=l==="timeout",f&&(clearTimeout(f),f=void 0),Z(i.pid,"SIGTERM"),c=setTimeout(()=>{i.exitCode===null&&i.signalCode===null&&Z(i.pid,"SIGKILL")},5e3))},"requestTermination");m>0&&(f=setTimeout(()=>{E("timeout")},m)),n.inherit||(i.stdout?.on("data",l=>{a.append(l);let p=n.terminateWhenStdoutIncludes;p!==void 0&&a.text().includes(p)&&E("output")}),i.stderr?.on("data",l=>{d.append(l)})),i.on("error",l=>{P(),g=!0,s(l)}),i.on("close",(l,p)=>{g||(g=!0,P(),r({code:l,signal:p,terminationReason:x??(p?"signal":"exit"),stdout:a.text(),stderr:d.text(),timedOut:u,stdoutTruncated:a.truncated,stderrTruncated:d.truncated}))}),n.stdin!==void 0&&i.stdin?.end(n.stdin)})}o(R,"runProcessCommand");var h=class{static{o(this,"BoundedOutput")}#t=[];#n;#e=0;truncated=!1;constructor(t){this.#n=t}append(t){let n=b.isBuffer(t)?t:b.from(t),r=this.#n-this.#e;if(r<=0){n.byteLength>0&&(this.truncated=!0);return}if(n.byteLength<=r){this.#t.push(n),this.#e+=n.byteLength;return}this.#t.push(n.subarray(0,r)),this.#e+=r,this.truncated=!0}text(){let t=b.concat(this.#t,this.#e).toString("utf8");return this.truncated?`${t}
4
4
  [truncated after ${this.#n} bytes]
5
5
  `:t}};function J(e){let t=e.maxOutputBytes??se;return Math.max(0,Math.floor(t))}o(J,"maxOutputBytes");function Z(e,t){if(e){if(process.platform==="win32"){let n=["/PID",String(e),"/T"];t==="SIGKILL"&&n.push("/F"),Q("taskkill",n,{stdio:"ignore",windowsHide:!0}).unref();return}try{process.kill(-e,t)}catch(n){if(n.code!=="ESRCH")throw n}}}o(Z,"terminateProcessTree");async function ae(e,t,n={}){return R(e,t,{cwd:n.cwd,inherit:n.inherit,timeoutMs:n.timeoutMs,maxOutputBytes:n.maxOutputBytes,terminateWhenStdoutIncludes:n.terminateWhenStdoutIncludes})}o(ae,"runCommand");async function rt(e,t={}){let n=t.timeoutSeconds===void 0?void 0:t.timeoutSeconds*1e3;return R(e,[],{cwd:t.cwd,env:t.env,shell:!0,inherit:t.inherit,timeoutMs:n,maxOutputBytes:t.maxOutputBytes})}o(rt,"runShellCommand");async function ot(e,t){let n=await ae("git",["remote","get-url",t],{cwd:e});if(n.code!==0)return null;let r=n.stdout.trim();return r.length>0?r:null}o(ot,"getGitRemoteUrl");export{ce as a,le as b,fe as c,me as d,pe as e,S as f,ee as g,Re as h,Pe as i,Ee as j,Ae as k,Ie as l,We as m,qe as n,He as o,Fe as p,re as q,ze as r,Ve as s,Xe as t,R as u,ae as v,rt as w,ot as x};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{tc as a,wc as u,xc as h}from"./chunk-4PUOWSDE.js";import{Ra as l}from"./chunk-ZY32SZ2P.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as p}from"./chunk-FTQLQJQV.js";var o=e.string().trim().min(1).max(240),S=e.object({projectId:o.optional(),search:e.string().max(300).optional(),kind:e.string().max(100).optional(),sort:e.enum(["name","type","version","projects","datasets","runs"]).optional(),direction:e.enum(["asc","desc"]).optional(),after:e.string().max(3e3).optional(),limit:e.number().int().min(1).max(100).default(30)}).strict(),v=e.object({teamId:o,items:e.array(e.object({reward:l,projects:e.number().int().nonnegative(),datasets:e.number().int().nonnegative(),runs:e.number().int().nonnegative()}).strict()).max(100),nextCursor:e.string().nullable()}).strict(),b=e.object({teamId:o,id:o,items:e.array(l).max(100),nextRevision:e.number().int().positive().nullable()}).strict(),g=e.object({section:e.enum(["projects","datasets","runs"]),after:o.optional(),limit:e.number().int().min(1).max(100).default(25)}).strict(),I=e.object({teamId:o,id:o,section:g.shape.section,items:e.array(e.union([e.object({id:o,name:e.string(),graderRevisions:e.array(e.number().int().positive()),archived:e.boolean()}).strict(),e.object({id:o,name:e.string(),revision:e.number().int().positive(),graderRevisions:e.array(e.number().int().positive())}).strict(),e.object({id:o,name:e.string(),status:e.string()}).strict()])).max(100),nextCursor:o.nullable()}).strict(),V=class{static{p(this,"OpenPondGraderInspectionClient")}constructor(n){this.options=n;let i=new URL(n.baseUrl);if(!["http:","https:"].includes(i.protocol)||i.username||i.password||i.search||i.hash||!n.apiKey.trim()||!n.teamId.trim())throw new Error("A clean API origin and workspace credentials are required.");this.baseUrl=i.toString().replace(/\/+$/,"")}options;baseUrl;async catalog(n={},i){let c=S.parse(n),t=v.parse(await this.read("",c,i));if(t.teamId!==this.options.teamId||t.items.length>c.limit||new Set(t.items.map(r=>r.reward.id)).size!==t.items.length)throw new Error("Grader catalog differs from its requested workspace or bounds.");return t}async versions(n,i={},c){let t=e.object({beforeRevision:e.number().int().positive().optional(),limit:e.number().int().min(1).max(100).default(25)}).strict().parse(i),r=b.parse(await this.read(`/${encodeURIComponent(o.parse(n))}/versions`,t,c));if(r.teamId!==this.options.teamId||r.id!==n||r.items.length>t.limit||r.items.some((d,m)=>d.id!==n||t.beforeRevision&&d.revision>=t.beforeRevision||m>0&&d.revision>=r.items[m-1].revision))throw new Error("Grader versions differ from their requested identity or revision order.");return r}async usage(n,i,c){let t=g.parse(i),r=I.parse(await this.read(`/${encodeURIComponent(o.parse(n))}/usage`,t,c));if(r.teamId!==this.options.teamId||r.id!==n||r.section!==t.section||r.items.length>t.limit)throw new Error("Grader usage differs from its requested workspace, identity or bounds.");return r}async read(n,i,c){let t=new URLSearchParams(Object.entries(i).filter(([,m])=>m!==void 0).map(([m,f])=>[m,String(f)])),r=await(this.options.fetch??fetch)(`${this.baseUrl}/v1/learning/read/graders${n}?${t}`,{signal:c,redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"X-OpenPond-Team-Id":this.options.teamId,Accept:"application/json"}}),d=await r.json();if(!r.ok)throw new Error(e.object({error:e.string()}).parse(d).error);return d}};var s=e.string().trim().min(1).max(500),w=e.object({id:s,contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),N=e.object({teamId:s,modelId:s,runId:s.optional(),from:e.string().datetime().optional(),to:e.string().datetime().optional()}).strict(),F=e.discriminatedUnion("action",[e.object({action:e.literal("declare_verification"),teamId:s,operationId:s,plan:e.object({modelId:a.shape.modelId,classification:a.shape.classification,feedback:a.shape.feedback,evidence:a.shape.evidence,trainingJobId:a.shape.trainingJobId,checkpoint:a.shape.checkpoint,artifact:a.shape.artifact,taskset:a.shape.taskset,checks:a.shape.checks,baselineOperationId:a.shape.baselineOperationId,candidateOperationId:a.shape.candidateOperationId,criterion:a.shape.criterion}).strict()}).strict(),e.object({action:e.literal("link_live_opportunity"),teamId:s,operationId:s,correction:w,inferenceRequestId:s,grade:e.object({id:s,revision:e.number().int().positive()}).strict(),checkIds:e.array(s).min(1).max(1e3)}).strict()]),Q=e.object({summary:h.nullable(),observations:e.array(u).max(1e3)}).strict();export{S as a,g as b,V as c};
2
+ import{tc as a,wc as u,xc as h}from"./chunk-ZEOYNUHL.js";import{Ra as l}from"./chunk-ZY32SZ2P.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as p}from"./chunk-FTQLQJQV.js";var o=e.string().trim().min(1).max(240),S=e.object({projectId:o.optional(),search:e.string().max(300).optional(),kind:e.string().max(100).optional(),sort:e.enum(["name","type","version","projects","datasets","runs"]).optional(),direction:e.enum(["asc","desc"]).optional(),after:e.string().max(3e3).optional(),limit:e.number().int().min(1).max(100).default(30)}).strict(),v=e.object({teamId:o,items:e.array(e.object({reward:l,projects:e.number().int().nonnegative(),datasets:e.number().int().nonnegative(),runs:e.number().int().nonnegative()}).strict()).max(100),nextCursor:e.string().nullable()}).strict(),b=e.object({teamId:o,id:o,items:e.array(l).max(100),nextRevision:e.number().int().positive().nullable()}).strict(),g=e.object({section:e.enum(["projects","datasets","runs"]),after:o.optional(),limit:e.number().int().min(1).max(100).default(25)}).strict(),w=e.object({teamId:o,id:o,section:g.shape.section,items:e.array(e.union([e.object({id:o,name:e.string(),graderRevisions:e.array(e.number().int().positive()),archived:e.boolean()}).strict(),e.object({id:o,name:e.string(),revision:e.number().int().positive(),graderRevisions:e.array(e.number().int().positive())}).strict(),e.object({id:o,name:e.string(),status:e.string()}).strict()])).max(100),nextCursor:o.nullable()}).strict(),V=class{static{p(this,"OpenPondGraderInspectionClient")}constructor(n){this.options=n;let i=new URL(n.baseUrl);if(!["http:","https:"].includes(i.protocol)||i.username||i.password||i.search||i.hash||!n.apiKey.trim()||!n.teamId.trim())throw new Error("A clean API origin and workspace credentials are required.");this.baseUrl=i.toString().replace(/\/+$/,"")}options;baseUrl;async catalog(n={},i){let c=S.parse(n),t=v.parse(await this.read("",c,i));if(t.teamId!==this.options.teamId||t.items.length>c.limit||new Set(t.items.map(r=>r.reward.id)).size!==t.items.length)throw new Error("Grader catalog differs from its requested workspace or bounds.");return t}async versions(n,i={},c){let t=e.object({beforeRevision:e.number().int().positive().optional(),limit:e.number().int().min(1).max(100).default(25)}).strict().parse(i),r=b.parse(await this.read(`/${encodeURIComponent(o.parse(n))}/versions`,t,c));if(r.teamId!==this.options.teamId||r.id!==n||r.items.length>t.limit||r.items.some((d,m)=>d.id!==n||t.beforeRevision&&d.revision>=t.beforeRevision||m>0&&d.revision>=r.items[m-1].revision))throw new Error("Grader versions differ from their requested identity or revision order.");return r}async usage(n,i,c){let t=g.parse(i),r=w.parse(await this.read(`/${encodeURIComponent(o.parse(n))}/usage`,t,c));if(r.teamId!==this.options.teamId||r.id!==n||r.section!==t.section||r.items.length>t.limit)throw new Error("Grader usage differs from its requested workspace, identity or bounds.");return r}async read(n,i,c){let t=new URLSearchParams(Object.entries(i).filter(([,m])=>m!==void 0).map(([m,f])=>[m,String(f)])),r=await(this.options.fetch??fetch)(`${this.baseUrl}/v1/learning/read/graders${n}?${t}`,{signal:c,redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"X-OpenPond-Team-Id":this.options.teamId,Accept:"application/json"}}),d=await r.json();if(!r.ok)throw new Error(e.object({error:e.string()}).parse(d).error);return d}};var s=e.string().trim().min(1).max(500),I=e.object({id:s,contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),F=e.object({teamId:s,modelId:s,runId:s.optional(),from:e.string().datetime().optional(),to:e.string().datetime().optional()}).strict(),N=e.discriminatedUnion("action",[e.object({action:e.literal("declare_verification"),teamId:s,operationId:s,plan:e.object({modelId:a.shape.modelId,classification:a.shape.classification,feedback:a.shape.feedback,evidence:a.shape.evidence,trainingJobId:a.shape.trainingJobId,checkpoint:a.shape.checkpoint,artifact:a.shape.artifact,taskset:a.shape.taskset,checks:a.shape.checks,baselineOperationId:a.shape.baselineOperationId,candidateOperationId:a.shape.candidateOperationId,criterion:a.shape.criterion}).strict()}).strict(),e.object({action:e.literal("link_live_opportunity"),teamId:s,operationId:s,correction:I,inferenceRequestId:s,grade:e.object({id:s,revision:e.number().int().positive()}).strict(),checkIds:e.array(s).min(1).max(1e3)}).strict()]),Q=e.object({summary:h.nullable(),observations:e.array(u).max(1e3)}).strict();export{S as a,g as b,V as c};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as bt,c as at}from"./chunk-GF55VEMR.js";import{I as At,L as ne,b as Y,fa as st,ob as Pt,pb as Rt,qb as oe,ub as re,vb as se,xb as ae}from"./chunk-HG2YFMVU.js";import{S as mt,T as ee,U as vt,e as qt}from"./chunk-SV7ZBEK2.js";import{I as te}from"./chunk-2MEOUS24.js";import{e as Zt,f as Qt}from"./chunk-HNQPEOJD.js";import{A as y}from"./chunk-X2J2P5ZT.js";import{a as s}from"./chunk-FTQLQJQV.js";var Ko=y.object({id:y.string(),location:y.literal("local"),sessionId:y.string().nullable(),modelRef:Qt.nullable(),revision:y.number().int().positive(),remoteAccessEnabled:y.literal(!1),hostedSandboxesEnabled:y.boolean(),hostedActivation:y.literal("inactive")}),Vo=y.object({sessionId:y.string(),coordinatorId:y.string(),coordinatorSessionId:y.string(),owner:y.enum(["ponder","user"]),revision:y.number().int().positive(),assignment:y.string(),creationKey:y.string(),createdAt:y.string(),updatedAt:y.string()}),Jo="You are Pal (Ponder Assisted Learning), the user's persistent desktop coordinator. Delegate bounded assignments to real local agents through openpond_start_agent. Use the exact inputId returned by delegation or follow-up when waiting for completion. Inspect real transcripts/results before synthesizing. Never claim acceptance means completion. Workers are persistent sessions. A user-controlled worker remains observable but you must not send it instructions until the user explicitly returns control. Never launch paid compute, deploy, or expand access without user authority. Local history stays on this desktop. Hosted capabilities are unavailable unless explicitly enabled and authorized. Discover configured models and projects before selecting a worker; do not invent provider availability or paths. Native workers own their context and compaction.";var kt="This native agent is controlled by its parent conversation. You can inspect its transcript; send further instructions through the parent conversation.";function qo(t){if(t.metadata?.nativeWorker===!0&&t.metadata.nativeWorkerCanResume===!1)throw new Error(kt)}s(qo,"assertNativeWorkerDirectInput");import{promises as Ht}from"node:fs";import{createHash as rn}from"node:crypto";import Dt from"node:path";import en from"node:os";import ie from"node:path";function Mt(t){let e=t.trim();return e.startsWith("# AGENTS.md instructions for ")||e.startsWith("<environment_context>")||e.startsWith("<summary>")||e.startsWith("<user_info>")||/^<external_codex_apps_open_page>[\s\S]*<\/external_codex_apps_open_page>$/.test(e)}s(Mt,"isCodexInjectedUserMessage");function pt(t){let e=t.trim(),n=/^<(goal_context|turn_aborted)>\s*([\s\S]*?)\s*<\/\1>$/.exec(e);if(n){let o=n[1];return{kind:o,text:n[2]?.trim()||Et(o)}}return e==="<turn_aborted>"?{kind:"turn_aborted",text:Et("turn_aborted")}:e==="<goal_context>"?{kind:"goal_context",text:Et("goal_context")}:null}s(pt,"codexControlMessage");function Z(t,e){return t.length<=e?t:`${t.slice(0,e)}
2
+ import{a as bt,c as at}from"./chunk-GF55VEMR.js";import{I as At,L as ne,b as Y,fa as st,ob as Pt,pb as Rt,qb as oe,ub as re,vb as se,xb as ae}from"./chunk-WXG3G2O6.js";import{S as mt,T as ee,U as vt,e as qt}from"./chunk-SV7ZBEK2.js";import{I as te}from"./chunk-2MEOUS24.js";import{e as Zt,f as Qt}from"./chunk-HNQPEOJD.js";import{A as y}from"./chunk-X2J2P5ZT.js";import{a as s}from"./chunk-FTQLQJQV.js";var Ko=y.object({id:y.string(),location:y.literal("local"),sessionId:y.string().nullable(),modelRef:Qt.nullable(),revision:y.number().int().positive(),remoteAccessEnabled:y.literal(!1),hostedSandboxesEnabled:y.boolean(),hostedActivation:y.literal("inactive")}),Vo=y.object({sessionId:y.string(),coordinatorId:y.string(),coordinatorSessionId:y.string(),owner:y.enum(["ponder","user"]),revision:y.number().int().positive(),assignment:y.string(),creationKey:y.string(),createdAt:y.string(),updatedAt:y.string()}),Jo="You are Pal (Ponder Assisted Learning), the user's persistent desktop coordinator. Delegate bounded assignments to real local agents through openpond_start_agent. Use the exact inputId returned by delegation or follow-up when waiting for completion. Inspect real transcripts/results before synthesizing. Never claim acceptance means completion. Workers are persistent sessions. A user-controlled worker remains observable but you must not send it instructions until the user explicitly returns control. Never launch paid compute, deploy, or expand access without user authority. Local history stays on this desktop. Hosted capabilities are unavailable unless explicitly enabled and authorized. Discover configured models and projects before selecting a worker; do not invent provider availability or paths. Native workers own their context and compaction.";var kt="This native agent is controlled by its parent conversation. You can inspect its transcript; send further instructions through the parent conversation.";function qo(t){if(t.metadata?.nativeWorker===!0&&t.metadata.nativeWorkerCanResume===!1)throw new Error(kt)}s(qo,"assertNativeWorkerDirectInput");import{promises as Ht}from"node:fs";import{createHash as rn}from"node:crypto";import Dt from"node:path";import en from"node:os";import ie from"node:path";function Mt(t){let e=t.trim();return e.startsWith("# AGENTS.md instructions for ")||e.startsWith("<environment_context>")||e.startsWith("<summary>")||e.startsWith("<user_info>")||/^<external_codex_apps_open_page>[\s\S]*<\/external_codex_apps_open_page>$/.test(e)}s(Mt,"isCodexInjectedUserMessage");function pt(t){let e=t.trim(),n=/^<(goal_context|turn_aborted)>\s*([\s\S]*?)\s*<\/\1>$/.exec(e);if(n){let o=n[1];return{kind:o,text:n[2]?.trim()||Et(o)}}return e==="<turn_aborted>"?{kind:"turn_aborted",text:Et("turn_aborted")}:e==="<goal_context>"?{kind:"goal_context",text:Et("goal_context")}:null}s(pt,"codexControlMessage");function Z(t,e){return t.length<=e?t:`${t.slice(0,e)}
3
3
 
4
4
  [truncated ${t.length-e} characters from Codex history]`}s(Z,"truncateText");function it(t){return t.replace(/\s+/g," ").trim()}s(it,"normalizeTitleText");function de(t){if(!t.trim())return null;try{return JSON.parse(t)}catch{return null}}s(de,"parseMaybeJson");function tt(t){if(!t.trim())return null;try{return JSON.parse(t)}catch{return null}}s(tt,"parseJson");function _(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}s(_,"asRecord");function l(t){return typeof t=="string"&&t.trim()?t.trim():null}s(l,"stringValue");function j(t){return typeof t=="number"&&Number.isFinite(t)?t:null}s(j,"numberValue");function ce(t){let e=new Map;if(!t)return e;for(let[n,o]of Object.entries(t))typeof o=="string"&&o.trim()&&e.set(n,o.trim());return e}s(ce,"stringMap");function k(t){return t.replace(/[^a-zA-Z0-9_-]+/g,"_").slice(0,96)||"item"}s(k,"safeId");function Nt(t){let e=0;for(let n of t)typeof n=="number"&&n>e&&(e=n);return e}s(Nt,"latestMillis");function et(t){let e=Nt(t.map(E));return new Date(e||Date.now()).toISOString()}s(et,"latestIso");function E(t){if(!t)return 0;let e=Date.parse(t);return Number.isFinite(e)?e:0}s(E,"millisFromIso");function J(t){if(typeof t!="string"||!t.trim())return null;let e=t.trim().replace(/(\.\d{3})\d+(Z)$/i,"$1$2"),n=Date.parse(e);return Number.isFinite(n)?new Date(n).toISOString():null}s(J,"isoTimestamp");function le(t){if(t===null)return null;let e=t*1e3;return Number.isFinite(e)?new Date(e).toISOString():null}s(le,"isoFromEpochSeconds");function ue(t){let e=/rollout-(\d{4}-\d{2}-\d{2})T(\d{2})-(\d{2})-(\d{2})-/.exec(ie.basename(t));return e?J(`${e[1]}T${e[2]}:${e[3]}:${e[4]}.000Z`):null}s(ue,"isoFromFileName");function nt(){return process.env.CODEX_HOME?.trim()||ie.join(en.homedir(),".codex")}s(nt,"codexHomePath");function Et(t){return t==="turn_aborted"?"The previous turn was interrupted.":"Goal context updated."}s(Et,"defaultCodexControlText");import{createReadStream as nn}from"node:fs";import{createInterface as on}from"node:readline";async function Q(t,e){let n=nn(t,{encoding:"utf8"}),o=on({input:n,crlfDelay:1/0});for await(let r of o){if(!r.trim())continue;let a=tt(r);a&&e(a)}}s(Q,"readJsonlRecords");function $t(t,e=!1){let n=new Map;async function o(r){let a=await Ht.stat(r),i=e?rn("sha256").update(await Ht.readFile(r)).digest("hex"):"";return`${a.dev}:${a.ino}:${a.size}:${a.mtimeMs}:${a.ctimeMs}:${i}`}return s(o,"signature"),async r=>{let a;try{a=await o(r)}catch{return n.delete(r),t(r)}let i=n.get(r);if(i?.signature===a)return i.value;let d=t(r).then(async c=>(await o(r).catch(()=>null)!==a&&n.get(r)?.value===d&&n.delete(r),c)).catch(c=>{throw n.get(r)?.value===d&&n.delete(r),c});return n.set(r,{signature:a,value:d}),n.size>4&&n.delete(n.keys().next().value),d}}s($t,"cachedFileReader");var sn=$t(cn),an=$t(ln,!0),dn=$t(un,!0),me=s(t=>sn(Dt.join(t,"history.jsonl")),"readPromptHistory"),pe=s(t=>an(Dt.join(t,"session_index.jsonl")),"readSessionIndex"),ge=s(t=>dn(Dt.join(t,".codex-global-state.json")),"readGlobalState");async function cn(t){let e=new Map;return await Q(t,n=>{let o=_(n),r=l(o?.session_id),a=l(o?.text)??"",i=le(j(o?.ts));if(!r||!/\S/.test(a)||!i)return;let d=e.get(r)??{firstPrompt:null,latestPrompt:null,firstAt:null,latestAt:null};(!d.firstAt||E(i)<E(d.firstAt))&&(d.firstAt=i,d.firstPrompt=it(a).slice(0,160)),(!d.latestAt||E(i)>E(d.latestAt))&&(d.latestAt=i),e.set(r,d)}).catch(()=>{}),e}s(cn,"parsePromptHistory");async function ln(t){let e=new Map;return await Q(t,n=>{let o=_(n),r=l(o?.id);r&&e.set(r,{id:r,threadName:it(l(o?.thread_name)??"")||null,updatedAt:J(l(o?.updated_at))})}).catch(()=>{}),e}s(ln,"parseSessionIndex");async function un(t){let e;try{e=JSON.parse(await Ht.readFile(t,"utf8"))}catch{e=null}let n=_(e);return{workspaceRootHints:ce(_(n?.["thread-workspace-root-hints"]))}}s(un,"parseGlobalState");import{createReadStream as On,existsSync as Pe,mkdirSync as Fn,promises as Ln,readFileSync as jn,statSync as Gt,writeFileSync as Bn}from"node:fs";import xt from"node:os";import M from"node:path";import{createInterface as zn}from"node:readline";import{promises as gt}from"node:fs";import O from"node:path";var mn=12e4,pn=15*1024*1024,dt=2*1024*1024,fe=new Map([[".gif","image/gif"],[".jpeg","image/jpeg"],[".jpg","image/jpeg"],[".png","image/png"],[".webp","image/webp"]]),gn=new Set(fe.values()),fn=new Set(["application/javascript","application/json","application/ld+json","application/sql","application/toml","application/typescript","application/x-httpd-php","application/x-javascript","application/x-sh","application/x-yaml","application/xml","application/yaml"]),hn=new Set([".c",".cc",".cpp",".css",".csv",".go",".h",".html",".java",".js",".json",".jsx",".log",".md",".mdx",".php",".py",".rb",".rs",".sh",".sql",".toml",".ts",".tsx",".txt",".xml",".yaml",".yml"]);async function _r(t){let e=t.attachments??[];if(e.length===0)return[];let n=O.join(t.attachmentRootDir,A(t.sessionId),A(t.turnId)),o=new Set,r=[];for(let[a,i]of e.entries()){let c={...he(i),...i.text?{text:i.text}:{}};if(i.contentsBase64){await gt.mkdir(n,{recursive:!0});let m=_n(i.relativePath||i.name,o,a+1),u=O.join(n,m);await gt.mkdir(O.dirname(u),{recursive:!0});let f=Buffer.from(i.contentsBase64,"base64"),p=await mt(t.storageHome,{owner:{domain:"chat_attachment",id:JSON.stringify([t.sessionId,t.turnId,m])},displayName:i.name,mediaType:i.mediaType,bytes:f});await qt(u,f),c.localPath=p.path,c.storageName=m}r.push(c)}return r}s(_r,"materializeChatAttachments");function Tr(t,e){let n=new Map(e?.materialized.map(o=>[o.id,o])??[]);return(t??[]).map(o=>{let r=he(o),a=n.get(o.id),i=K(o.mediaType,a?.storageName??o.name);return e&&r.kind==="image"&&a?.localPath&&a.storageName&&i?{...r,imagePreview:{sessionId:e.sessionId,turnId:e.turnId,attachmentId:o.id,storageName:a.storageName,contentType:i}}:e&&a?.localPath&&a.storageName&&o.sizeBytes<=dt&&ct(o.mediaType,a.storageName)?{...r,filePreview:{sessionId:e.sessionId,turnId:e.turnId,attachmentId:o.id,storageName:a.storageName,contentType:o.mediaType}}:r})}s(Tr,"chatAttachmentSummaries");function Cr(t){if(!t||t.length===0)return"";let e=["<attachments>",`The user attached ${t.length} file${t.length===1?"":"s"} with this message.`],n=mn;for(let[o,r]of t.entries()){let a=r.localPath?` Saved locally at: ${r.localPath}`:"";e.push(`${o+1}. ${r.name} (${r.mediaType}, ${Tn(r.sizeBytes)}, ${r.kind}).${a}`);let i=r.text?.trim();if(i&&n>0){let d=i.length>n?`${i.slice(0,Math.max(0,n-34))}
5
5
  [attachment text truncated]`:i;e.push("Text content:"),e.push("~~~text"),e.push(d),e.push("~~~"),n-=d.length}}return e.push("</attachments>"),e.join(`
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{Ea as p,Wk as m,pl as u,rl as g}from"./chunk-6D3FI2XT.js";import{c as a,f as c,h}from"./chunk-3M53YXEI.js";import{a as l}from"./chunk-FTQLQJQV.js";var b=new Set(["hosted-saved-model-serving","hosted-control-steering-serving","hosted-import-calibration","hosted-calibration","hosted-calibrations","hosted-archive-calibration"]);async function S(w){let{action:r,target:s,teamId:t,options:i,client:o,readInput:n}=w;if(r==="hosted-calibration"){if(!s)throw new Error("Supply the original calibration ID.");return o.getNeuronCalibration(t,s)}if(r==="hosted-calibrations"){if(s)throw new Error("Use filters to list calibration history.");return o.listNeuronCalibrations(t,{projectId:a(i,"projectId")||void 0,modelHash:a(i,"modelHash")||void 0,archived:c(i.archived),cursor:a(i,"cursor")||void 0,limit:h(i.limit,"--limit")})}if(r==="hosted-saved-model-serving"){let e=p.parse(await n());return o.savedModelServing(e.modelProjectId,{teamId:t,versionHash:e.versionHash})}if(r==="hosted-control-steering-serving"){let e=m.parse(await n());if(e.request.teamId!==t)throw new Error("Use the Model's original workspace.");if(e.request.action==="activate"&&!c(i.yes))throw new Error("Activating billed serving capacity requires --yes.");return o.controlSteeringModelServing(e.modelProjectId,e.request)}if(r==="hosted-import-calibration"){let e=u.parse(await n());if(e.teamId!==t)throw new Error("Use the calibration's original workspace.");return o.importNeuronCalibration(e)}if(r==="hosted-archive-calibration"){let e=await n();if(!e||typeof e!="object"||!("id"in e)||typeof e.id!="string"||!("request"in e))throw new Error("Supply the calibration ID and original archive request.");let d=g.parse(e.request);if(d.teamId!==t)throw new Error("Use the calibration's original workspace.");return o.archiveNeuronCalibration(e.id,d)}throw new Error("Unsupported steering command.")}l(S,"runHostedSteeringCommand");export{b as a,S as b};
2
+ import{Bl as g,Ea as p,el as m,zl as u}from"./chunk-XJU47QS2.js";import{c as a,f as c,h}from"./chunk-3M53YXEI.js";import{a as l}from"./chunk-FTQLQJQV.js";var b=new Set(["hosted-saved-model-serving","hosted-control-steering-serving","hosted-import-calibration","hosted-calibration","hosted-calibrations","hosted-archive-calibration"]);async function S(w){let{action:r,target:s,teamId:t,options:i,client:o,readInput:n}=w;if(r==="hosted-calibration"){if(!s)throw new Error("Supply the original calibration ID.");return o.getNeuronCalibration(t,s)}if(r==="hosted-calibrations"){if(s)throw new Error("Use filters to list calibration history.");return o.listNeuronCalibrations(t,{projectId:a(i,"projectId")||void 0,modelHash:a(i,"modelHash")||void 0,archived:c(i.archived),cursor:a(i,"cursor")||void 0,limit:h(i.limit,"--limit")})}if(r==="hosted-saved-model-serving"){let e=p.parse(await n());return o.savedModelServing(e.modelProjectId,{teamId:t,versionHash:e.versionHash})}if(r==="hosted-control-steering-serving"){let e=m.parse(await n());if(e.request.teamId!==t)throw new Error("Use the Model's original workspace.");if(e.request.action==="activate"&&!c(i.yes))throw new Error("Activating billed serving capacity requires --yes.");return o.controlSteeringModelServing(e.modelProjectId,e.request)}if(r==="hosted-import-calibration"){let e=u.parse(await n());if(e.teamId!==t)throw new Error("Use the calibration's original workspace.");return o.importNeuronCalibration(e)}if(r==="hosted-archive-calibration"){let e=await n();if(!e||typeof e!="object"||!("id"in e)||typeof e.id!="string"||!("request"in e))throw new Error("Supply the calibration ID and original archive request.");let d=g.parse(e.request);if(d.teamId!==t)throw new Error("Use the calibration's original workspace.");return o.archiveNeuronCalibration(e.id,d)}throw new Error("Unsupported steering command.")}l(S,"runHostedSteeringCommand");export{b as a,S as b};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as H,g as O,h as M,i as q,j as V,k as F,l as W,m as G,n as K,p as B}from"./chunk-U7X5ZLAL.js";import{w as z}from"./chunk-WGQ3FMRF.js";import{s as D}from"./chunk-YI6ME6PU.js";import{a as x}from"./chunk-DRLP7GIU.js";import{E as C}from"./chunk-BU6MW65V.js";import{m as I}from"./chunk-HIQPGYVH.js";import{W as $,ea as A}from"./chunk-ZY32SZ2P.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as k}from"./chunk-FTQLQJQV.js";var Q=e.enum(["create","save","publish","begin_version"]),ee=e.object({operationId:e.string().trim().min(1).max(240),kind:Q,requestHash:e.string().regex(/^[a-f0-9]{64}$/),receipt:q,base:q.nullable()}).strict().superRefine((t,a)=>{let{receipt:r,base:s,kind:i}=t;(s&&(s.teamId!==r.teamId||s.datasetId!==r.datasetId||s.revision+1!==r.revision)||!s&&r.revision!==1)&&a.addIssue({code:"custom",message:"Operation recovery history identity/revision mismatch."}),s&&((s.ownerScope??"workspace")!==(r.ownerScope??"workspace")||s.originProjectId!==r.originProjectId||s.workspace.draft.createdAt!==r.workspace.draft.createdAt)&&a.addIssue({code:"custom",message:"Operation recovery cannot change Dataset ownership or origin."});let n=s?r.workspace.draft.status==="published"?"publish":s.workspace.draft.status==="published"?"begin_version":"save":"create";i!==n&&a.addIssue({code:"custom",message:"Operation recovery kind differs from its retained lifecycle."})}),o=e.string().trim().min(1).max(240),u=e.string().regex(/^[a-f0-9]{64}$/),b=e.iso.datetime(),d=e.number().int().nonnegative(),l=e.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),te=e.object({id:o,projectId:o,maximumMicroUsd:l.positive(),maximumSandboxSeconds:d.max(10800)}).strict(),ae=e.object({schemaVersion:e.literal("openpond.datasetPreparationGrant.v1"),id:o,teamId:o,ownerUserId:o,projectId:o,maximumMicroUsd:l,maximumSandboxSeconds:d,settledMicroUsd:l,heldMicroUsd:l,sandboxSeconds:d,heldSandboxSeconds:d,unresolvedCalls:d,cleanupPending:d,createdAt:b,updatedAt:b}).strict(),T=e.enum(["coding_change","debugging","code_explanation","structured_text","artifact_work"]),J=e.enum(["inventory","preview","reconstruction","grader_authoring","qualification","release"]),se=e.enum(["draft","running","pausing","paused","needs_attention","preview_ready","ready","releasing","completed","insufficient_data","budget_exhausted","cancelling","cancelled","failed"]),re=e.object({projectId:o,from:b,to:b,importCutoff:b,connections:e.array(o).min(1).max(50),excludedSessions:e.array(e.object({connectionId:o,sourceKeyHash:u,nativeRevisionHash:u,reason:e.enum(["source_read_failed","native_session_not_ready"]),explanation:e.string().trim().min(1).max(2e3)}).strict()).max(1e4).default([])}).strict().superRefine((t,a)=>{Date.parse(t.from)>=Date.parse(t.to)&&a.addIssue({code:"custom",message:"Source event-time window must be nonempty."}),new Set(t.connections).size!==t.connections.length&&a.addIssue({code:"custom",message:"Source connections must be unique."}),t.excludedSessions.some(r=>!t.connections.includes(r.connectionId))&&a.addIssue({code:"custom",message:"Excluded sessions must belong to selected source connections."}),new Set(t.excludedSessions.map(r=>JSON.stringify([r.connectionId,r.sourceKeyHash]))).size!==t.excludedSessions.length&&a.addIssue({code:"custom",message:"Source session exclusions must be unique."})}),X=e.object({source:re,taskClasses:e.array(T).min(1).max(5),limits:e.object({maximumConversations:e.number().int().min(1).max(1e4),maximumCandidates:e.number().int().min(1).max(1e4),acceptedTarget:e.number().int().min(1).max(1e4),maximumRepairsPerCandidate:e.number().int().min(0).max(5),maximumEvidenceBytesPerConversation:e.number().int().min(1024).max(2e6)}).strict(),researcher:e.object({modelId:o,maximumOutputTokens:e.number().int().min(1).max(32768)}).strict(),adjudicator:e.object({modelId:o,maximumOutputTokens:e.number().int().min(1).max(32768)}).strict(),grading:e.discriminatedUnion("mode",[e.object({mode:e.literal("auto")}).strict(),e.object({mode:e.literal("existing_only")}).strict(),e.object({mode:e.literal("manual"),releases:e.array(x).min(1).max(100)}).strict()]),budget:e.object({grantId:o,maximumMicroUsd:l.positive(),previewMaximumMicroUsd:l,qualificationMaximumMicroUsdPerCandidate:l,maximumSandboxSeconds:d.max(10800)}).strict(),finish:e.enum(["stop_ready","create_private_version"]),execution:e.enum(["preview_only","prepare"]),allowPartialVersion:e.boolean(),population:e.literal("development")}).strict().superRefine((t,a)=>{t.limits.acceptedTarget>t.limits.maximumCandidates&&a.addIssue({code:"custom",message:"Accepted target exceeds candidate scan limit."}),t.budget.previewMaximumMicroUsd>t.budget.maximumMicroUsd&&a.addIssue({code:"custom",message:"Preview allowance exceeds the shared preparation ceiling."}),new Set(t.taskClasses).size!==t.taskClasses.length&&a.addIssue({code:"custom",message:"Task classes must be unique."})}),ie=e.object({operationId:o,expectedDatasetRevision:e.number().int().positive(),policy:X}).strict(),ne=e.discriminatedUnion("action",[e.object({action:e.enum(["start","pause","resume","cancel","release"]),operationId:o,expectedRevision:e.number().int().positive()}).strict(),e.object({action:e.literal("resolve"),operationId:o,expectedRevision:e.number().int().positive(),candidateId:o,decision:e.enum(["retry","exclude"]),reason:e.string().trim().min(1).max(5e3)}).strict()]),oe=e.object({conversations:d,importedTurns:d,selectedTurns:d,queuedSnapshots:d.nullable(),failedSessions:d.nullable(),skippedSessions:d.nullable(),lastAdmissionAt:b.nullable(),complete:e.boolean(),sourceComplete:e.boolean().default(!1),excludedSessions:d.default(0),reasons:e.array(e.object({code:o,message:e.string().trim().min(1).max(2e3)}).strict()).max(100),sourceInventoryHash:u}).strict(),de=e.object({maximumMicroUsd:l,settledMicroUsd:l,heldMicroUsd:l,unresolvedCalls:d,sandboxSeconds:d,cleanupPending:d,complete:e.boolean()}).strict(),ce=e.object({sampleConversations:d,sampleTurns:d,candidateCount:d,modelId:o,modelConfigurationHash:u,callReceiptIds:e.array(o).max(2e3),inputTokens:d.nullable(),outputTokens:d.nullable(),classes:e.array(e.object({taskClass:T,candidates:d,assessment:e.enum(["executable","calibrated_judge","unsupported"]),requirements:e.array(e.string().trim().min(1).max(5e3)).max(20)}).strict()).max(5),exclusions:e.array(e.object({code:o,count:d,reason:e.string().trim().min(1).max(5e3)}).strict()).max(100),estimates:e.array(e.object({stage:J,minimumMicroUsd:l,maximumMicroUsd:l,assumptions:e.array(e.string().trim().min(1).max(2e3)).min(1).max(20)}).strict().refine(t=>t.minimumMicroUsd<=t.maximumMicroUsd,"Estimate range is reversed.")).max(6),createdAt:b}).strict(),U=e.object({schemaVersion:e.literal("openpond.datasetPreparationRun.v1"),id:o,operationId:o,teamId:o,ownerUserId:o,datasetId:o,datasetRevision:e.number().int().positive(),revision:e.number().int().positive(),requestHash:u,policy:X,status:se,stage:J,coverage:oe.nullable(),preview:ce.nullable(),counts:e.object({scannedConversations:d,scannedTurns:d,candidates:d,reconstructed:d,qualifying:d,qualified:d,excluded:d,needsAttention:d}).strict(),accounting:de,publication:e.object({datasetId:o,workspaceRevision:e.number().int().positive(),release:x}).strict().nullable(),error:e.object({code:o,message:e.string().trim().min(1).max(5e3)}).strict().nullable(),createdAt:b,updatedAt:b}).strict().superRefine((t,a)=>{t.accounting.maximumMicroUsd!==t.policy.budget.maximumMicroUsd&&a.addIssue({code:"custom",message:"Accounting authority differs from the saved preparation policy."}),t.counts.qualified+t.counts.excluded+t.counts.needsAttention>t.counts.candidates&&a.addIssue({code:"custom",message:"Preparation outcomes exceed the candidate population."}),t.status==="preview_ready"&&(t.policy.execution!=="preview_only"||t.stage!=="preview"||!t.preview||!t.coverage?.complete||!t.accounting.complete)&&a.addIssue({code:"custom",message:"Preview readiness requires a preview-only policy, reconciled source coverage and settled preview calls."}),["ready","releasing","completed"].includes(t.status)&&(t.counts.qualified===0||!t.policy.allowPartialVersion&&t.counts.qualified<t.policy.limits.acceptedTarget)&&a.addIssue({code:"custom",message:"Preparation cannot report readiness below its accepted target."}),["ready","releasing","completed"].includes(t.status)&&(t.policy.execution!=="prepare"||!t.preview||!t.coverage?.complete||!t.accounting.complete)&&a.addIssue({code:"custom",message:"Dataset readiness requires full preparation authority, reconciled source coverage, preview and final accounting."}),t.status==="completed"&&(!t.publication||!t.accounting.complete)&&a.addIssue({code:"custom",message:"Completed preparation requires publication and reconciled accounting."}),t.status==="cancelled"&&(!t.accounting.complete||t.accounting.cleanupPending>0)&&a.addIssue({code:"custom",message:"Cancellation requires settled resource obligations."})}),me=e.object({teamId:o,datasetId:o,runs:e.array(U).max(50),nextCursor:o.nullable()}).strict(),P=e.object({source:H,startSequence:d,endSequence:d,role:e.enum(["requirement","initial_context","outcome","correction","verification"])}).strict().superRefine((t,a)=>{t.endSequence<t.startSequence&&a.addIssue({code:"custom",message:"Evidence span must be ordered."})}),pe=e.object({schemaVersion:e.literal("openpond.preparedTaskProvenance.v1"),candidateId:o,preparationId:o,familyKey:o,sourceSpans:e.array(P).min(1).max(200),firstAvailableAt:b,initialInputHash:u,initialEnvironmentHash:u,initialAssetsHash:u.nullable(),sourceScopeHash:u}).strict().superRefine((t,a)=>{t.sourceSpans.some(s=>s.role==="requirement")||a.addIssue({code:"custom",message:"A reconstructed task needs a source requirement."});let r=new Set;for(let s of t.sourceSpans){t.sourceSpans.some(n=>n!==s&&n.source.id===s.source.id&&n.source.snapshotHash===s.source.snapshotHash&&n.role!==s.role&&s.startSequence<=n.endSequence&&n.startSequence<=s.endSequence)&&a.addIssue({code:"custom",message:"Evidence offsets cannot have conflicting roles."});let i=JSON.stringify([s.source,s.startSequence,s.endSequence]);r.has(i)&&a.addIssue({code:"custom",message:"Evidence span is duplicated or crosses public/private roles."}),r.add(i)}}),ue=e.object({schemaVersion:e.literal("openpond.preparedTaskQualification.v1"),id:o,candidateId:o,preparationId:o,taskHash:u,environmentHash:u,packageHash:u,graderBindings:e.array(e.object({id:o,version:o,contentHash:u,origin:e.enum(["reused","adapted","authored"])}).strict()).min(1).max(100),checks:e.array(e.object({id:o,label:e.enum(["positive","incorrect","incomplete","adversarial","clean_reset"]),executionReceiptId:o,expectedPassed:e.boolean(),observedPassed:e.boolean().nullable(),infrastructureError:o.nullable()}).strict()).min(5).max(500),independentEvidenceRefs:e.array(o).min(1).max(100),judgeCalibration:e.enum(["not_applicable","passed","failed","pending"]),cleanup:e.enum(["completed","pending"]),passed:e.boolean(),createdAt:b}).strict().superRefine((t,a)=>{if(!t.passed)return;let r=new Set(t.checks.map(s=>s.label));["positive","incorrect","incomplete","adversarial","clean_reset"].some(s=>!r.has(s))&&a.addIssue({code:"custom",message:"Qualified tasks require positive, negative, adversarial and clean-reset evidence."}),(t.cleanup!=="completed"||["pending","failed"].includes(t.judgeCalibration)||t.checks.some(s=>s.infrastructureError!==null||s.observedPassed!==s.expectedPassed))&&a.addIssue({code:"custom",message:"Failed, uncalibrated or uncleared checks cannot qualify a task."}),t.checks.some(s=>s.expectedPassed!==["positive","clean_reset"].includes(s.label))&&a.addIssue({code:"custom",message:"Qualification witnesses must pass positives/resets and reject incorrect, incomplete and adversarial outputs."})}),le=e.object({id:o,runId:o,revision:e.number().int().positive(),taskClass:T,status:e.enum(["discovered","reconstructing","authoring","qualifying","qualified","excluded","needs_attention"]),objective:e.string().trim().min(1).max(2e4),provenance:pe.nullable(),qualification:ue.nullable(),reason:e.object({code:o,message:e.string().trim().min(1).max(5e3)}).strict().nullable(),attempts:d.max(6)}).strict().superRefine((t,a)=>{t.status==="qualified"&&(!t.provenance||!t.qualification?.passed)&&a.addIssue({code:"custom",message:"Candidate admission requires reconstruction and qualification receipts."}),t.provenance&&(t.provenance.candidateId!==t.id||t.provenance.preparationId!==t.runId)&&a.addIssue({code:"custom",message:"Candidate provenance identity mismatch."}),t.qualification&&(t.qualification.candidateId!==t.id||t.qualification.preparationId!==t.runId)&&a.addIssue({code:"custom",message:"Candidate qualification identity mismatch."})}),p=e.string().trim().min(1).max(240),he=e.object({teamId:p,datasetId:p,runId:p,candidates:e.array(le).max(50),nextCursor:p.nullable()}).strict(),L=class extends Error{static{k(this,"DatasetPreparationRequestError")}constructor(t,a,r){super(r),this.status=t,this.code=a,this.name="DatasetPreparationRequestError"}status;code},fe=class{static{k(this,"OpenPondDatasetPreparationClient")}constructor(t){this.options=t;let a=new URL(t.baseUrl);if(!["http:","https:"].includes(a.protocol)||a.username||a.password||a.search||a.hash||!t.apiKey.trim()||!t.teamId.trim())throw new Error("A clean API origin and workspace credentials are required.");this.baseUrl=a.toString().replace(/\/+$/,"")}options;baseUrl;async create(t,a,r){let s=ie.parse(a),i=this.readRun(await this.request(t,"","POST",s,r),t);if(i.operationId!==s.operationId||i.requestHash!==I(s)||i.datasetRevision!==s.expectedDatasetRevision)throw new Error("Preparation creation receipt differs from the saved intent.");return i}async createGrant(t,a,r){let s=te.parse(a),i=this.readGrant(await this.request(t,"/grants","POST",s,r));if(i.id!==s.id||i.projectId!==s.projectId||i.maximumMicroUsd!==s.maximumMicroUsd||i.maximumSandboxSeconds!==s.maximumSandboxSeconds)throw new Error("Preparation grant receipt differs from the saved limits.");return i}async getGrant(t,a,r){let s=this.readGrant(await this.request(t,`/grants/${encodeURIComponent(p.parse(a))}`,"GET",void 0,r));if(s.id!==a)throw new Error("Preparation grant identity mismatch.");return s}readGrant(t){let a=ae.parse(t);if(a.teamId!==this.options.teamId)throw new Error("Preparation grant workspace mismatch.");return a}async get(t,a,r){return this.readRun(await this.request(t,`/${encodeURIComponent(p.parse(a))}`,"GET",void 0,r),t,a)}async list(t,a={}){let r=new URLSearchParams(a.cursor?{cursor:p.parse(a.cursor)}:{}),s=me.parse(await this.request(t,`?${r}`,"GET",void 0,a.signal));if(s.teamId!==this.options.teamId||s.datasetId!==t||s.runs.some(i=>i.teamId!==s.teamId||i.datasetId!==t)||new Set(s.runs.map(i=>i.id)).size!==s.runs.length)throw new Error("Preparation list scope/identity mismatch.");return s}async command(t,a,r,s){let i=ne.parse(r),n=this.readRun(await this.request(t,`/${encodeURIComponent(p.parse(a))}/commands`,"POST",i,s),t,a);if(n.revision<i.expectedRevision+1)throw new Error("Preparation command did not advance the expected revision.");return n}async operationResult(t,a,r){let s=await this.request(t,`/operations/${encodeURIComponent(p.parse(a))}`,"GET",void 0,r);if(s===null)return null;let i=e.object({operationId:p,requestHash:e.string().regex(/^[a-f0-9]{64}$/),run:U}).strict().parse(s);if(i.operationId!==a)throw new Error("Preparation operation recovery identity mismatch.");return this.readRun(i.run,t),i}async candidates(t,a,r={}){let s=new URLSearchParams(r.cursor?{cursor:p.parse(r.cursor)}:{}),i=he.parse(await this.request(t,`/${encodeURIComponent(p.parse(a))}/candidates?${s}`,"GET",void 0,r.signal));if(i.teamId!==this.options.teamId||i.datasetId!==t||i.runId!==a||i.candidates.some(n=>n.runId!==a)||new Set(i.candidates.map(n=>n.id)).size!==i.candidates.length)throw new Error("Preparation candidate page scope/identity mismatch.");return i}readRun(t,a,r){let s=U.parse(t);if(s.teamId!==this.options.teamId||s.datasetId!==a||r&&s.id!==r)throw new Error("Preparation run scope/identity mismatch.");return s}async request(t,a,r,s,i){let n=await(this.options.fetch??fetch)(`${this.baseUrl}/v1/dataset-workspaces/${encodeURIComponent(p.parse(t))}/preparations${a}`,{method:r,signal:i,redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"X-OpenPond-Team-Id":this.options.teamId,"Content-Type":"application/json"},...s===void 0?{}:{body:JSON.stringify(s)}});if(!n.body)throw n.ok?new Error("Preparation response is empty."):new L(n.status,"dataset_preparation_request_failed",`Dataset preparation request failed (${n.status}).`);let m=n.body.getReader(),h=[],v=0;try{for(;;){let g=await m.read();if(g.done)break;if(v+=g.value.byteLength,v>(n.ok?8*1024*1024:64*1024))throw new Error("Preparation response exceeds its bounded page.");h.push(g.value)}}finally{await m.cancel()}let y=new Uint8Array(v),c=0;for(let g of h)y.set(g,c),c+=g.length;let f=new TextDecoder("utf-8",{fatal:!0}).decode(y);if(!n.ok){let g=null;try{g=JSON.parse(f)}catch{}let w=e.object({code:e.string().max(240),message:e.string().max(5e3)}).safeParse(g);throw new L(n.status,w.success?w.data.code:"dataset_preparation_request_failed",w.success?w.data.message:`Dataset preparation request failed (${n.status}).`)}return JSON.parse(f)}},Me=class{static{k(this,"OpenPondDatasetWorkspaceClient")}constructor(t){this.options=t;let a=new URL(t.baseUrl);if(!["http:","https:"].includes(a.protocol)||a.username||a.password||a.search||a.hash||!t.apiKey.trim()||!t.teamId.trim())throw new Error("A clean API origin and workspace credentials are required.");this.baseUrl=a.toString().replace(/\/+$/,""),this.preparations=new fe(t)}options;baseUrl;preparations;async list(t={}){let{signal:a,...r}=t,s=O.parse(r),i=new URLSearchParams(Object.entries(s).filter(([,m])=>m!==void 0).map(([m,h])=>[m,String(h)])),n=G.parse(await this.request(`?${i}`,"GET",void 0,a));if(n.teamId!==this.options.teamId||n.datasets.length>s.limit||new Set(n.datasets.map(m=>m.id)).size!==n.datasets.length)throw new Error("Dataset list workspace/page mismatch.");return n}async get(t,a){return this.readback(await this.request(`/${encodeURIComponent(t)}`,"GET",void 0,a),t)}async operationResult(t,a){let r=Q.parse(a.kind),s=new URLSearchParams({kind:r,...a.datasetId?{datasetId:a.datasetId}:{}}),i=await this.request(`/operations/${encodeURIComponent(t)}?${s}`,"GET",void 0,a.signal,132*1024*1024);if(i===null)return null;let n=ee.parse(i);if(this.readback(n.receipt,n.receipt.datasetId),n.base&&this.readback(n.base,n.receipt.datasetId),n.operationId!==t||n.kind!==r||a.datasetId&&n.receipt.datasetId!==a.datasetId||a.requestHash&&n.requestHash!==a.requestHash)throw new Error("Dataset operation recovery identity/request mismatch.");return n}async beginVersion(t,a,r){let s=F.parse(a),i=this.readback(await this.request(`/${encodeURIComponent(t)}/begin-version`,"POST",s,r),t);if(i.revision!==s.expectedRevision+1||i.workspace.draft.status!=="draft"||!i.publication||!i.workspace.draft.publishedTasksetRef)throw new Error("Editable version receipt mismatch.");return i}async versions(t,a={}){let r=new URLSearchParams(a.beforeRevision===void 0?{}:{beforeRevision:String(a.beforeRevision)}),s=W.parse(await this.request(`/${encodeURIComponent(t)}/versions?${r}`,"GET",void 0,a.signal));if(s.teamId!==this.options.teamId||s.datasetId!==t||s.items.some((i,n)=>n>0&&i.workspaceRevision>=s.items[n-1].workspaceRevision||a.beforeRevision!==void 0&&i.workspaceRevision>=a.beforeRevision))throw new Error("Dataset version history scope/order mismatch.");return s}async version(t,a,r){let s=this.readback(await this.request(`/${encodeURIComponent(t)}/versions/${a}`,"GET",void 0,r),t);if(s.revision!==a||s.workspace.draft.status!=="published")throw new Error("Dataset immutable version mismatch.");return s}async save(t,a){let r=M.parse(t),s=D(r.workspace);if(s.draft.profileId!==this.options.teamId||s.draft.revision!==r.expectedRevision+1)throw new Error("Dataset write scope or revision mismatch.");let i=this.readback(await this.request(`/${encodeURIComponent(s.draft.id)}`,"PUT",r,a),s.draft.id);if(r.originProjectId&&i.originProjectId!==r.originProjectId)throw new Error("Dataset origin Project mismatch.");if(r.ownerScope&&i.ownerScope!==r.ownerScope)throw new Error("Dataset owner scope mismatch.");if(i.workspace.contentHash!==s.contentHash)throw new Error("Dataset write receipt differs from the saved bytes.");return i}async validate(t,a,r){let s=K.parse(await this.request(`/${encodeURIComponent(t)}/validate`,"POST",{expectedRevision:a},r));if(s.teamId!==this.options.teamId||s.datasetId!==t||s.revision!==a)throw new Error("Dataset validation receipt mismatch.");return s}async publish(t,a,r){let s=V.parse(a),i=this.readback(await this.request(`/${encodeURIComponent(t)}/publish`,"POST",s,r),t);if(i.revision!==s.expectedRevision+1||i.workspace.draft.status!=="published"||i.publication?.packageHash!==s.packageHash)throw new Error("Dataset publication receipt mismatch.");return i}readback(t,a){let r=q.parse(t);if(D(r.workspace),r.datasetId!==a||r.teamId!==this.options.teamId)throw new Error("Dataset identity mismatch.");return r}async request(t,a,r,s,i){let n=await(this.options.fetch??fetch)(`${this.baseUrl}/v1/dataset-workspaces${t}`,{method:a,signal:s,redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"X-OpenPond-Team-Id":this.options.teamId,"Content-Type":"application/json"},...r===void 0?{}:{body:JSON.stringify(r)}});if(!n.ok)throw new Error(`Dataset request failed (${n.status}).`);if(i!==void 0){if(!n.body)throw new Error("Dataset response is empty.");let m=n.body.getReader(),h=[],v=0;try{for(;;){let f=await m.read();if(f.done)break;if(v+=f.value.byteLength,v>i)throw new Error("Dataset recovery exceeds its bounded response.");h.push(f.value)}}finally{await m.cancel()}let y=new Uint8Array(v),c=0;for(let f of h)y.set(f,c),c+=f.length;return JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(y))}return n.json()}},E=e.string().trim().min(1).max(500),ge=e.string().regex(/^[a-f0-9]{64}$/),Y=e.object({release:x,afterId:E.optional(),limit:e.number().int().min(1).max(1e4).default(100),view:e.enum(["ids","policy"]).default("ids")}).strict().superRefine((t,a)=>{t.view==="policy"&&t.limit>100&&a.addIssue({code:"custom",path:["limit"],message:"Policy previews are bounded to 100 tasks."})}),Z=e.object({id:A.shape.id,split:$}).strict(),we=Z.extend({input:e.record(e.string(),e.unknown()),policyVisibleContext:e.record(e.string(),e.unknown()),artifacts:e.array(e.object({id:E,path:e.string(),mediaType:e.string(),sizeBytes:e.number().int().nonnegative()}).strict()).max(1e3)}).strict(),be=e.object({schemaVersion:e.literal("openpond.datasetPopulationPage.v1"),teamId:E,release:x,view:Y.shape.view,taskCount:e.number().int().nonnegative(),items:e.array(e.union([Z,we])).max(1e4),graders:e.array(z).max(1e3),nextCursor:E.nullable(),contentHash:ge}).strict().superRefine((t,a)=>{t.view==="policy"&&t.items.length>100&&a.addIssue({code:"custom",message:"Policy preview exceeded its task bound."}),t.items.some(r=>"input"in r!=(t.view==="policy"))&&a.addIssue({code:"custom",message:"Dataset task view differs from the requested projection."})}),We=class{static{k(this,"OpenPondDatasetPopulationClient")}constructor(t){this.options=t;let a=new URL(t.baseUrl);if(!["http:","https:"].includes(a.protocol)||a.username||a.password||a.search||a.hash||!t.apiKey.trim()||!t.teamId.trim())throw new Error("A clean API origin and workspace credentials are required.");this.baseUrl=a.toString().replace(/\/+$/,"")}options;baseUrl;async read(t,a){let r=Y.parse(t),s=new URLSearchParams({releaseId:r.release.id,revision:String(r.release.revision),contentHash:r.release.contentHash,limit:String(r.limit),view:r.view});r.afterId&&s.set("afterId",r.afterId);let i=await(this.options.fetch??fetch)(`${this.baseUrl}/v1/dataset-workspaces/population?${s}`,{signal:a,redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"X-OpenPond-Team-Id":this.options.teamId,Accept:"application/json"}}),n=i.body?.getReader();if(!n)throw new Error("Dataset population response was empty.");let m=0,h="",v=new TextDecoder;try{for(;;){let w=await n.read();if(w.done)break;if(m+=w.value.byteLength,m>4194304)throw new Error("Dataset population response exceeded 4 MiB. Request fewer tasks.");h+=v.decode(w.value,{stream:!0})}h+=v.decode()}finally{await n.cancel(),n.releaseLock()}let y=JSON.parse(h);if(!i.ok)throw new Error(e.object({message:e.string()}).passthrough().parse(y).message);let c=be.parse(y),{contentHash:f,...g}=c;if(c.teamId!==this.options.teamId||I(c.release)!==I(r.release)||c.view!==r.view||c.items.length>r.limit||I(g)!==f||c.items.some((w,_)=>r.afterId!==void 0&&w.id<=r.afterId||_>0&&w.id<=c.items[_-1].id)||c.nextCursor!==null&&c.nextCursor!==c.items.at(-1)?.id)throw new Error("Dataset population identity, hash, order or bounds mismatch.");return c}},N=e.string().trim().min(1).max(240),S=e.string().trim().min(1).max(5e3),ve=e.object({taskClass:T,objective:e.string().trim().min(1).max(2e4),sourceSpans:e.array(P).min(1).max(200),firstAvailableAt:e.iso.datetime(),reconstruction:e.object({kind:e.enum(["text_only","pinned_repository","pinned_artifact","unsupported"]),requiredAssets:e.array(e.object({reference:S,evidence:P}).strict()).max(100),missingEvidence:e.array(S).max(20)}).strict(),assessment:e.object({kind:e.enum(["executable","calibrated_judge","unsupported"]),requirements:e.array(e.object({criterion:S,evidence:P}).strict()).min(1).max(20),limitations:e.array(S).max(20)}).strict()}).strict().superRefine((t,a)=>{t.sourceSpans.some(r=>r.role==="requirement")||a.addIssue({code:"custom",message:"A research candidate requires independently retained user requirements."}),t.assessment.requirements.some(r=>r.evidence.role!=="requirement")&&a.addIssue({code:"custom",message:"Assessment criteria must cite user requirements, not historical answers."})}),Ke=e.object({schemaVersion:e.literal("openpond.datasetPreparationResearchDecision.v1"),sourceId:N,snapshotHash:e.string().regex(/^[a-f0-9]{64}$/),candidates:e.array(ve).max(100),exclusions:e.array(e.object({code:N,reason:S,sourceSpans:e.array(P).max(200)}).strict()).max(100),contextSummary:e.string().max(2e4)}).strict(),ye=e.string().regex(/^[a-f0-9]{64}$/);var Le=e.object({schemaVersion:e.literal("openpond.preparedRepositoryStartingState.v1"),dependencyClosureQualified:e.literal(!1),assets:e.array(B.extend({receiptId:e.string().regex(/^starting-assets-[a-f0-9]{40}$/),receiptHash:ye,source:H}).strict()).min(1).max(100)}).strict().superRefine((t,a)=>{new Set(t.assets.map(r=>r.path)).size!==t.assets.length&&a.addIssue({code:"custom",message:"Starting paths must be distinct."}),t.assets.some(r=>r.commitHash!==t.assets[0].commitHash||I(r.source)!==I(t.assets[0].source))&&a.addIssue({code:"custom",message:"Starting assets must belong to one original task boundary and commit."})});var R=e.string().trim().min(1).max(240),j=e.string().trim().min(1).max(2e4),Ie=e.object({id:R,label:e.enum(["positive","incorrect","incomplete","adversarial"]),output:e.record(e.string(),e.unknown()),artifacts:e.array(e.object({path:C.shape.path,mediaType:C.shape.mediaType,base64:e.string().max(8*1024*1024)}).strict()).max(100)}).strict().superRefine((t,a)=>{new Set(t.artifacts.map(r=>r.path)).size!==t.artifacts.length&&a.addIssue({code:"custom",message:"Qualification artifacts must have distinct paths."})}),Qe=e.object({schemaVersion:e.literal("openpond.preparedQualificationPlan.v1"),requirementRefs:e.array(R).min(1).max(100),supported:e.boolean(),limitations:e.array(j).max(20),independentVerifier:e.object({runtime:e.enum(["isolated_javascript","sandbox_process"]),source:e.string().trim().min(1).max(2e5),exportName:e.literal("verify"),timeoutMs:e.number().int().min(1).max(6e4)}).strict().nullable(),witnesses:e.array(Ie).max(20)}).strict().superRefine((t,a)=>{(new Set(t.requirementRefs).size!==t.requirementRefs.length||new Set(t.witnesses.map(r=>r.id)).size!==t.witnesses.length)&&a.addIssue({code:"custom",message:"Qualification evidence identities must be distinct."}),t.supported&&(!t.independentVerifier||t.limitations.length||["positive","incorrect","incomplete","adversarial"].some(r=>!t.witnesses.some(s=>s.label===r)))&&a.addIssue({code:"custom",message:"Supported qualification needs a complete verifier and witness population without unresolved evidence gaps."})}),Je=e.object({schemaVersion:e.literal("openpond.preparedWitnessAdjudication.v1"),witnesses:e.array(e.object({id:R,failureMode:e.enum(["none","incorrect","incomplete","adversarial","unverifiable"]),requirements:e.array(e.object({reference:R,status:e.enum(["satisfied","violated","unverifiable"]),reason:j}).strict()).min(1).max(100)}).strict()).min(4).max(20)}).strict(),Xe=e.object({schemaVersion:e.literal("openpond.preparedCheckerAudit.v1"),requirements:e.array(e.object({reference:R,adequatelyChecked:e.boolean(),oracleAdequatelyChecked:e.boolean(),reason:j}).strict()).min(1).max(100),executionIsolationPassed:e.boolean(),futureEvidenceLeak:e.boolean(),unresolvedLimitations:e.array(j).max(20),passed:e.boolean()}).strict();export{Me as a,Y as b,be as c,We as d};
2
+ import{a as H,g as O,h as M,i as q,j as V,k as F,l as W,m as G,n as K,p as B}from"./chunk-JCHLDNCX.js";import{w as z}from"./chunk-XKDOPNQ5.js";import{s as D}from"./chunk-GG6PM7TB.js";import{a as x}from"./chunk-2GEZ3ZY7.js";import{E as C}from"./chunk-BYVE4TMU.js";import{m as I}from"./chunk-HIQPGYVH.js";import{W as $,ea as A}from"./chunk-ZY32SZ2P.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as k}from"./chunk-FTQLQJQV.js";var Q=e.enum(["create","save","publish","begin_version"]),ee=e.object({operationId:e.string().trim().min(1).max(240),kind:Q,requestHash:e.string().regex(/^[a-f0-9]{64}$/),receipt:q,base:q.nullable()}).strict().superRefine((t,a)=>{let{receipt:r,base:s,kind:i}=t;(s&&(s.teamId!==r.teamId||s.datasetId!==r.datasetId||s.revision+1!==r.revision)||!s&&r.revision!==1)&&a.addIssue({code:"custom",message:"Operation recovery history identity/revision mismatch."}),s&&((s.ownerScope??"workspace")!==(r.ownerScope??"workspace")||s.originProjectId!==r.originProjectId||s.workspace.draft.createdAt!==r.workspace.draft.createdAt)&&a.addIssue({code:"custom",message:"Operation recovery cannot change Dataset ownership or origin."});let n=s?r.workspace.draft.status==="published"?"publish":s.workspace.draft.status==="published"?"begin_version":"save":"create";i!==n&&a.addIssue({code:"custom",message:"Operation recovery kind differs from its retained lifecycle."})}),o=e.string().trim().min(1).max(240),u=e.string().regex(/^[a-f0-9]{64}$/),b=e.iso.datetime(),d=e.number().int().nonnegative(),l=e.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),te=e.object({id:o,projectId:o,maximumMicroUsd:l.positive(),maximumSandboxSeconds:d.max(10800)}).strict(),ae=e.object({schemaVersion:e.literal("openpond.datasetPreparationGrant.v1"),id:o,teamId:o,ownerUserId:o,projectId:o,maximumMicroUsd:l,maximumSandboxSeconds:d,settledMicroUsd:l,heldMicroUsd:l,sandboxSeconds:d,heldSandboxSeconds:d,unresolvedCalls:d,cleanupPending:d,createdAt:b,updatedAt:b}).strict(),T=e.enum(["coding_change","debugging","code_explanation","structured_text","artifact_work"]),J=e.enum(["inventory","preview","reconstruction","grader_authoring","qualification","release"]),se=e.enum(["draft","running","pausing","paused","needs_attention","preview_ready","ready","releasing","completed","insufficient_data","budget_exhausted","cancelling","cancelled","failed"]),re=e.object({projectId:o,from:b,to:b,importCutoff:b,connections:e.array(o).min(1).max(50),excludedSessions:e.array(e.object({connectionId:o,sourceKeyHash:u,nativeRevisionHash:u,reason:e.enum(["source_read_failed","native_session_not_ready"]),explanation:e.string().trim().min(1).max(2e3)}).strict()).max(1e4).default([])}).strict().superRefine((t,a)=>{Date.parse(t.from)>=Date.parse(t.to)&&a.addIssue({code:"custom",message:"Source event-time window must be nonempty."}),new Set(t.connections).size!==t.connections.length&&a.addIssue({code:"custom",message:"Source connections must be unique."}),t.excludedSessions.some(r=>!t.connections.includes(r.connectionId))&&a.addIssue({code:"custom",message:"Excluded sessions must belong to selected source connections."}),new Set(t.excludedSessions.map(r=>JSON.stringify([r.connectionId,r.sourceKeyHash]))).size!==t.excludedSessions.length&&a.addIssue({code:"custom",message:"Source session exclusions must be unique."})}),X=e.object({source:re,taskClasses:e.array(T).min(1).max(5),limits:e.object({maximumConversations:e.number().int().min(1).max(1e4),maximumCandidates:e.number().int().min(1).max(1e4),acceptedTarget:e.number().int().min(1).max(1e4),maximumRepairsPerCandidate:e.number().int().min(0).max(5),maximumEvidenceBytesPerConversation:e.number().int().min(1024).max(2e6)}).strict(),researcher:e.object({modelId:o,maximumOutputTokens:e.number().int().min(1).max(32768)}).strict(),adjudicator:e.object({modelId:o,maximumOutputTokens:e.number().int().min(1).max(32768)}).strict(),grading:e.discriminatedUnion("mode",[e.object({mode:e.literal("auto")}).strict(),e.object({mode:e.literal("existing_only")}).strict(),e.object({mode:e.literal("manual"),releases:e.array(x).min(1).max(100)}).strict()]),budget:e.object({grantId:o,maximumMicroUsd:l.positive(),previewMaximumMicroUsd:l,qualificationMaximumMicroUsdPerCandidate:l,maximumSandboxSeconds:d.max(10800)}).strict(),finish:e.enum(["stop_ready","create_private_version"]),execution:e.enum(["preview_only","prepare"]),allowPartialVersion:e.boolean(),population:e.literal("development")}).strict().superRefine((t,a)=>{t.limits.acceptedTarget>t.limits.maximumCandidates&&a.addIssue({code:"custom",message:"Accepted target exceeds candidate scan limit."}),t.budget.previewMaximumMicroUsd>t.budget.maximumMicroUsd&&a.addIssue({code:"custom",message:"Preview allowance exceeds the shared preparation ceiling."}),new Set(t.taskClasses).size!==t.taskClasses.length&&a.addIssue({code:"custom",message:"Task classes must be unique."})}),ie=e.object({operationId:o,expectedDatasetRevision:e.number().int().positive(),policy:X}).strict(),ne=e.discriminatedUnion("action",[e.object({action:e.enum(["start","pause","resume","cancel","release"]),operationId:o,expectedRevision:e.number().int().positive()}).strict(),e.object({action:e.literal("resolve"),operationId:o,expectedRevision:e.number().int().positive(),candidateId:o,decision:e.enum(["retry","exclude"]),reason:e.string().trim().min(1).max(5e3)}).strict()]),oe=e.object({conversations:d,importedTurns:d,selectedTurns:d,queuedSnapshots:d.nullable(),failedSessions:d.nullable(),skippedSessions:d.nullable(),lastAdmissionAt:b.nullable(),complete:e.boolean(),sourceComplete:e.boolean().default(!1),excludedSessions:d.default(0),reasons:e.array(e.object({code:o,message:e.string().trim().min(1).max(2e3)}).strict()).max(100),sourceInventoryHash:u}).strict(),de=e.object({maximumMicroUsd:l,settledMicroUsd:l,heldMicroUsd:l,unresolvedCalls:d,sandboxSeconds:d,cleanupPending:d,complete:e.boolean()}).strict(),ce=e.object({sampleConversations:d,sampleTurns:d,candidateCount:d,modelId:o,modelConfigurationHash:u,callReceiptIds:e.array(o).max(2e3),inputTokens:d.nullable(),outputTokens:d.nullable(),classes:e.array(e.object({taskClass:T,candidates:d,assessment:e.enum(["executable","calibrated_judge","unsupported"]),requirements:e.array(e.string().trim().min(1).max(5e3)).max(20)}).strict()).max(5),exclusions:e.array(e.object({code:o,count:d,reason:e.string().trim().min(1).max(5e3)}).strict()).max(100),estimates:e.array(e.object({stage:J,minimumMicroUsd:l,maximumMicroUsd:l,assumptions:e.array(e.string().trim().min(1).max(2e3)).min(1).max(20)}).strict().refine(t=>t.minimumMicroUsd<=t.maximumMicroUsd,"Estimate range is reversed.")).max(6),createdAt:b}).strict(),U=e.object({schemaVersion:e.literal("openpond.datasetPreparationRun.v1"),id:o,operationId:o,teamId:o,ownerUserId:o,datasetId:o,datasetRevision:e.number().int().positive(),revision:e.number().int().positive(),requestHash:u,policy:X,status:se,stage:J,coverage:oe.nullable(),preview:ce.nullable(),counts:e.object({scannedConversations:d,scannedTurns:d,candidates:d,reconstructed:d,qualifying:d,qualified:d,excluded:d,needsAttention:d}).strict(),accounting:de,publication:e.object({datasetId:o,workspaceRevision:e.number().int().positive(),release:x}).strict().nullable(),error:e.object({code:o,message:e.string().trim().min(1).max(5e3)}).strict().nullable(),createdAt:b,updatedAt:b}).strict().superRefine((t,a)=>{t.accounting.maximumMicroUsd!==t.policy.budget.maximumMicroUsd&&a.addIssue({code:"custom",message:"Accounting authority differs from the saved preparation policy."}),t.counts.qualified+t.counts.excluded+t.counts.needsAttention>t.counts.candidates&&a.addIssue({code:"custom",message:"Preparation outcomes exceed the candidate population."}),t.status==="preview_ready"&&(t.policy.execution!=="preview_only"||t.stage!=="preview"||!t.preview||!t.coverage?.complete||!t.accounting.complete)&&a.addIssue({code:"custom",message:"Preview readiness requires a preview-only policy, reconciled source coverage and settled preview calls."}),["ready","releasing","completed"].includes(t.status)&&(t.counts.qualified===0||!t.policy.allowPartialVersion&&t.counts.qualified<t.policy.limits.acceptedTarget)&&a.addIssue({code:"custom",message:"Preparation cannot report readiness below its accepted target."}),["ready","releasing","completed"].includes(t.status)&&(t.policy.execution!=="prepare"||!t.preview||!t.coverage?.complete||!t.accounting.complete)&&a.addIssue({code:"custom",message:"Dataset readiness requires full preparation authority, reconciled source coverage, preview and final accounting."}),t.status==="completed"&&(!t.publication||!t.accounting.complete)&&a.addIssue({code:"custom",message:"Completed preparation requires publication and reconciled accounting."}),t.status==="cancelled"&&(!t.accounting.complete||t.accounting.cleanupPending>0)&&a.addIssue({code:"custom",message:"Cancellation requires settled resource obligations."})}),me=e.object({teamId:o,datasetId:o,runs:e.array(U).max(50),nextCursor:o.nullable()}).strict(),P=e.object({source:H,startSequence:d,endSequence:d,role:e.enum(["requirement","initial_context","outcome","correction","verification"])}).strict().superRefine((t,a)=>{t.endSequence<t.startSequence&&a.addIssue({code:"custom",message:"Evidence span must be ordered."})}),pe=e.object({schemaVersion:e.literal("openpond.preparedTaskProvenance.v1"),candidateId:o,preparationId:o,familyKey:o,sourceSpans:e.array(P).min(1).max(200),firstAvailableAt:b,initialInputHash:u,initialEnvironmentHash:u,initialAssetsHash:u.nullable(),sourceScopeHash:u}).strict().superRefine((t,a)=>{t.sourceSpans.some(s=>s.role==="requirement")||a.addIssue({code:"custom",message:"A reconstructed task needs a source requirement."});let r=new Set;for(let s of t.sourceSpans){t.sourceSpans.some(n=>n!==s&&n.source.id===s.source.id&&n.source.snapshotHash===s.source.snapshotHash&&n.role!==s.role&&s.startSequence<=n.endSequence&&n.startSequence<=s.endSequence)&&a.addIssue({code:"custom",message:"Evidence offsets cannot have conflicting roles."});let i=JSON.stringify([s.source,s.startSequence,s.endSequence]);r.has(i)&&a.addIssue({code:"custom",message:"Evidence span is duplicated or crosses public/private roles."}),r.add(i)}}),ue=e.object({schemaVersion:e.literal("openpond.preparedTaskQualification.v1"),id:o,candidateId:o,preparationId:o,taskHash:u,environmentHash:u,packageHash:u,graderBindings:e.array(e.object({id:o,version:o,contentHash:u,origin:e.enum(["reused","adapted","authored"])}).strict()).min(1).max(100),checks:e.array(e.object({id:o,label:e.enum(["positive","incorrect","incomplete","adversarial","clean_reset"]),executionReceiptId:o,expectedPassed:e.boolean(),observedPassed:e.boolean().nullable(),infrastructureError:o.nullable()}).strict()).min(5).max(500),independentEvidenceRefs:e.array(o).min(1).max(100),judgeCalibration:e.enum(["not_applicable","passed","failed","pending"]),cleanup:e.enum(["completed","pending"]),passed:e.boolean(),createdAt:b}).strict().superRefine((t,a)=>{if(!t.passed)return;let r=new Set(t.checks.map(s=>s.label));["positive","incorrect","incomplete","adversarial","clean_reset"].some(s=>!r.has(s))&&a.addIssue({code:"custom",message:"Qualified tasks require positive, negative, adversarial and clean-reset evidence."}),(t.cleanup!=="completed"||["pending","failed"].includes(t.judgeCalibration)||t.checks.some(s=>s.infrastructureError!==null||s.observedPassed!==s.expectedPassed))&&a.addIssue({code:"custom",message:"Failed, uncalibrated or uncleared checks cannot qualify a task."}),t.checks.some(s=>s.expectedPassed!==["positive","clean_reset"].includes(s.label))&&a.addIssue({code:"custom",message:"Qualification witnesses must pass positives/resets and reject incorrect, incomplete and adversarial outputs."})}),le=e.object({id:o,runId:o,revision:e.number().int().positive(),taskClass:T,status:e.enum(["discovered","reconstructing","authoring","qualifying","qualified","excluded","needs_attention"]),objective:e.string().trim().min(1).max(2e4),provenance:pe.nullable(),qualification:ue.nullable(),reason:e.object({code:o,message:e.string().trim().min(1).max(5e3)}).strict().nullable(),attempts:d.max(6)}).strict().superRefine((t,a)=>{t.status==="qualified"&&(!t.provenance||!t.qualification?.passed)&&a.addIssue({code:"custom",message:"Candidate admission requires reconstruction and qualification receipts."}),t.provenance&&(t.provenance.candidateId!==t.id||t.provenance.preparationId!==t.runId)&&a.addIssue({code:"custom",message:"Candidate provenance identity mismatch."}),t.qualification&&(t.qualification.candidateId!==t.id||t.qualification.preparationId!==t.runId)&&a.addIssue({code:"custom",message:"Candidate qualification identity mismatch."})}),p=e.string().trim().min(1).max(240),he=e.object({teamId:p,datasetId:p,runId:p,candidates:e.array(le).max(50),nextCursor:p.nullable()}).strict(),L=class extends Error{static{k(this,"DatasetPreparationRequestError")}constructor(t,a,r){super(r),this.status=t,this.code=a,this.name="DatasetPreparationRequestError"}status;code},fe=class{static{k(this,"OpenPondDatasetPreparationClient")}constructor(t){this.options=t;let a=new URL(t.baseUrl);if(!["http:","https:"].includes(a.protocol)||a.username||a.password||a.search||a.hash||!t.apiKey.trim()||!t.teamId.trim())throw new Error("A clean API origin and workspace credentials are required.");this.baseUrl=a.toString().replace(/\/+$/,"")}options;baseUrl;async create(t,a,r){let s=ie.parse(a),i=this.readRun(await this.request(t,"","POST",s,r),t);if(i.operationId!==s.operationId||i.requestHash!==I(s)||i.datasetRevision!==s.expectedDatasetRevision)throw new Error("Preparation creation receipt differs from the saved intent.");return i}async createGrant(t,a,r){let s=te.parse(a),i=this.readGrant(await this.request(t,"/grants","POST",s,r));if(i.id!==s.id||i.projectId!==s.projectId||i.maximumMicroUsd!==s.maximumMicroUsd||i.maximumSandboxSeconds!==s.maximumSandboxSeconds)throw new Error("Preparation grant receipt differs from the saved limits.");return i}async getGrant(t,a,r){let s=this.readGrant(await this.request(t,`/grants/${encodeURIComponent(p.parse(a))}`,"GET",void 0,r));if(s.id!==a)throw new Error("Preparation grant identity mismatch.");return s}readGrant(t){let a=ae.parse(t);if(a.teamId!==this.options.teamId)throw new Error("Preparation grant workspace mismatch.");return a}async get(t,a,r){return this.readRun(await this.request(t,`/${encodeURIComponent(p.parse(a))}`,"GET",void 0,r),t,a)}async list(t,a={}){let r=new URLSearchParams(a.cursor?{cursor:p.parse(a.cursor)}:{}),s=me.parse(await this.request(t,`?${r}`,"GET",void 0,a.signal));if(s.teamId!==this.options.teamId||s.datasetId!==t||s.runs.some(i=>i.teamId!==s.teamId||i.datasetId!==t)||new Set(s.runs.map(i=>i.id)).size!==s.runs.length)throw new Error("Preparation list scope/identity mismatch.");return s}async command(t,a,r,s){let i=ne.parse(r),n=this.readRun(await this.request(t,`/${encodeURIComponent(p.parse(a))}/commands`,"POST",i,s),t,a);if(n.revision<i.expectedRevision+1)throw new Error("Preparation command did not advance the expected revision.");return n}async operationResult(t,a,r){let s=await this.request(t,`/operations/${encodeURIComponent(p.parse(a))}`,"GET",void 0,r);if(s===null)return null;let i=e.object({operationId:p,requestHash:e.string().regex(/^[a-f0-9]{64}$/),run:U}).strict().parse(s);if(i.operationId!==a)throw new Error("Preparation operation recovery identity mismatch.");return this.readRun(i.run,t),i}async candidates(t,a,r={}){let s=new URLSearchParams(r.cursor?{cursor:p.parse(r.cursor)}:{}),i=he.parse(await this.request(t,`/${encodeURIComponent(p.parse(a))}/candidates?${s}`,"GET",void 0,r.signal));if(i.teamId!==this.options.teamId||i.datasetId!==t||i.runId!==a||i.candidates.some(n=>n.runId!==a)||new Set(i.candidates.map(n=>n.id)).size!==i.candidates.length)throw new Error("Preparation candidate page scope/identity mismatch.");return i}readRun(t,a,r){let s=U.parse(t);if(s.teamId!==this.options.teamId||s.datasetId!==a||r&&s.id!==r)throw new Error("Preparation run scope/identity mismatch.");return s}async request(t,a,r,s,i){let n=await(this.options.fetch??fetch)(`${this.baseUrl}/v1/dataset-workspaces/${encodeURIComponent(p.parse(t))}/preparations${a}`,{method:r,signal:i,redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"X-OpenPond-Team-Id":this.options.teamId,"Content-Type":"application/json"},...s===void 0?{}:{body:JSON.stringify(s)}});if(!n.body)throw n.ok?new Error("Preparation response is empty."):new L(n.status,"dataset_preparation_request_failed",`Dataset preparation request failed (${n.status}).`);let m=n.body.getReader(),h=[],v=0;try{for(;;){let g=await m.read();if(g.done)break;if(v+=g.value.byteLength,v>(n.ok?8*1024*1024:64*1024))throw new Error("Preparation response exceeds its bounded page.");h.push(g.value)}}finally{await m.cancel()}let y=new Uint8Array(v),c=0;for(let g of h)y.set(g,c),c+=g.length;let f=new TextDecoder("utf-8",{fatal:!0}).decode(y);if(!n.ok){let g=null;try{g=JSON.parse(f)}catch{}let w=e.object({code:e.string().max(240),message:e.string().max(5e3)}).safeParse(g);throw new L(n.status,w.success?w.data.code:"dataset_preparation_request_failed",w.success?w.data.message:`Dataset preparation request failed (${n.status}).`)}return JSON.parse(f)}},Me=class{static{k(this,"OpenPondDatasetWorkspaceClient")}constructor(t){this.options=t;let a=new URL(t.baseUrl);if(!["http:","https:"].includes(a.protocol)||a.username||a.password||a.search||a.hash||!t.apiKey.trim()||!t.teamId.trim())throw new Error("A clean API origin and workspace credentials are required.");this.baseUrl=a.toString().replace(/\/+$/,""),this.preparations=new fe(t)}options;baseUrl;preparations;async list(t={}){let{signal:a,...r}=t,s=O.parse(r),i=new URLSearchParams(Object.entries(s).filter(([,m])=>m!==void 0).map(([m,h])=>[m,String(h)])),n=G.parse(await this.request(`?${i}`,"GET",void 0,a));if(n.teamId!==this.options.teamId||n.datasets.length>s.limit||new Set(n.datasets.map(m=>m.id)).size!==n.datasets.length)throw new Error("Dataset list workspace/page mismatch.");return n}async get(t,a){return this.readback(await this.request(`/${encodeURIComponent(t)}`,"GET",void 0,a),t)}async operationResult(t,a){let r=Q.parse(a.kind),s=new URLSearchParams({kind:r,...a.datasetId?{datasetId:a.datasetId}:{}}),i=await this.request(`/operations/${encodeURIComponent(t)}?${s}`,"GET",void 0,a.signal,132*1024*1024);if(i===null)return null;let n=ee.parse(i);if(this.readback(n.receipt,n.receipt.datasetId),n.base&&this.readback(n.base,n.receipt.datasetId),n.operationId!==t||n.kind!==r||a.datasetId&&n.receipt.datasetId!==a.datasetId||a.requestHash&&n.requestHash!==a.requestHash)throw new Error("Dataset operation recovery identity/request mismatch.");return n}async beginVersion(t,a,r){let s=F.parse(a),i=this.readback(await this.request(`/${encodeURIComponent(t)}/begin-version`,"POST",s,r),t);if(i.revision!==s.expectedRevision+1||i.workspace.draft.status!=="draft"||!i.publication||!i.workspace.draft.publishedTasksetRef)throw new Error("Editable version receipt mismatch.");return i}async versions(t,a={}){let r=new URLSearchParams(a.beforeRevision===void 0?{}:{beforeRevision:String(a.beforeRevision)}),s=W.parse(await this.request(`/${encodeURIComponent(t)}/versions?${r}`,"GET",void 0,a.signal));if(s.teamId!==this.options.teamId||s.datasetId!==t||s.items.some((i,n)=>n>0&&i.workspaceRevision>=s.items[n-1].workspaceRevision||a.beforeRevision!==void 0&&i.workspaceRevision>=a.beforeRevision))throw new Error("Dataset version history scope/order mismatch.");return s}async version(t,a,r){let s=this.readback(await this.request(`/${encodeURIComponent(t)}/versions/${a}`,"GET",void 0,r),t);if(s.revision!==a||s.workspace.draft.status!=="published")throw new Error("Dataset immutable version mismatch.");return s}async save(t,a){let r=M.parse(t),s=D(r.workspace);if(s.draft.profileId!==this.options.teamId||s.draft.revision!==r.expectedRevision+1)throw new Error("Dataset write scope or revision mismatch.");let i=this.readback(await this.request(`/${encodeURIComponent(s.draft.id)}`,"PUT",r,a),s.draft.id);if(r.originProjectId&&i.originProjectId!==r.originProjectId)throw new Error("Dataset origin Project mismatch.");if(r.ownerScope&&i.ownerScope!==r.ownerScope)throw new Error("Dataset owner scope mismatch.");if(i.workspace.contentHash!==s.contentHash)throw new Error("Dataset write receipt differs from the saved bytes.");return i}async validate(t,a,r){let s=K.parse(await this.request(`/${encodeURIComponent(t)}/validate`,"POST",{expectedRevision:a},r));if(s.teamId!==this.options.teamId||s.datasetId!==t||s.revision!==a)throw new Error("Dataset validation receipt mismatch.");return s}async publish(t,a,r){let s=V.parse(a),i=this.readback(await this.request(`/${encodeURIComponent(t)}/publish`,"POST",s,r),t);if(i.revision!==s.expectedRevision+1||i.workspace.draft.status!=="published"||i.publication?.packageHash!==s.packageHash)throw new Error("Dataset publication receipt mismatch.");return i}readback(t,a){let r=q.parse(t);if(D(r.workspace),r.datasetId!==a||r.teamId!==this.options.teamId)throw new Error("Dataset identity mismatch.");return r}async request(t,a,r,s,i){let n=await(this.options.fetch??fetch)(`${this.baseUrl}/v1/dataset-workspaces${t}`,{method:a,signal:s,redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"X-OpenPond-Team-Id":this.options.teamId,"Content-Type":"application/json"},...r===void 0?{}:{body:JSON.stringify(r)}});if(!n.ok)throw new Error(`Dataset request failed (${n.status}).`);if(i!==void 0){if(!n.body)throw new Error("Dataset response is empty.");let m=n.body.getReader(),h=[],v=0;try{for(;;){let f=await m.read();if(f.done)break;if(v+=f.value.byteLength,v>i)throw new Error("Dataset recovery exceeds its bounded response.");h.push(f.value)}}finally{await m.cancel()}let y=new Uint8Array(v),c=0;for(let f of h)y.set(f,c),c+=f.length;return JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(y))}return n.json()}},E=e.string().trim().min(1).max(500),ge=e.string().regex(/^[a-f0-9]{64}$/),Y=e.object({release:x,afterId:E.optional(),limit:e.number().int().min(1).max(1e4).default(100),view:e.enum(["ids","policy"]).default("ids")}).strict().superRefine((t,a)=>{t.view==="policy"&&t.limit>100&&a.addIssue({code:"custom",path:["limit"],message:"Policy previews are bounded to 100 tasks."})}),Z=e.object({id:A.shape.id,split:$}).strict(),we=Z.extend({input:e.record(e.string(),e.unknown()),policyVisibleContext:e.record(e.string(),e.unknown()),artifacts:e.array(e.object({id:E,path:e.string(),mediaType:e.string(),sizeBytes:e.number().int().nonnegative()}).strict()).max(1e3)}).strict(),be=e.object({schemaVersion:e.literal("openpond.datasetPopulationPage.v1"),teamId:E,release:x,view:Y.shape.view,taskCount:e.number().int().nonnegative(),items:e.array(e.union([Z,we])).max(1e4),graders:e.array(z).max(1e3),nextCursor:E.nullable(),contentHash:ge}).strict().superRefine((t,a)=>{t.view==="policy"&&t.items.length>100&&a.addIssue({code:"custom",message:"Policy preview exceeded its task bound."}),t.items.some(r=>"input"in r!=(t.view==="policy"))&&a.addIssue({code:"custom",message:"Dataset task view differs from the requested projection."})}),We=class{static{k(this,"OpenPondDatasetPopulationClient")}constructor(t){this.options=t;let a=new URL(t.baseUrl);if(!["http:","https:"].includes(a.protocol)||a.username||a.password||a.search||a.hash||!t.apiKey.trim()||!t.teamId.trim())throw new Error("A clean API origin and workspace credentials are required.");this.baseUrl=a.toString().replace(/\/+$/,"")}options;baseUrl;async read(t,a){let r=Y.parse(t),s=new URLSearchParams({releaseId:r.release.id,revision:String(r.release.revision),contentHash:r.release.contentHash,limit:String(r.limit),view:r.view});r.afterId&&s.set("afterId",r.afterId);let i=await(this.options.fetch??fetch)(`${this.baseUrl}/v1/dataset-workspaces/population?${s}`,{signal:a,redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"X-OpenPond-Team-Id":this.options.teamId,Accept:"application/json"}}),n=i.body?.getReader();if(!n)throw new Error("Dataset population response was empty.");let m=0,h="",v=new TextDecoder;try{for(;;){let w=await n.read();if(w.done)break;if(m+=w.value.byteLength,m>4194304)throw new Error("Dataset population response exceeded 4 MiB. Request fewer tasks.");h+=v.decode(w.value,{stream:!0})}h+=v.decode()}finally{await n.cancel(),n.releaseLock()}let y=JSON.parse(h);if(!i.ok)throw new Error(e.object({message:e.string()}).passthrough().parse(y).message);let c=be.parse(y),{contentHash:f,...g}=c;if(c.teamId!==this.options.teamId||I(c.release)!==I(r.release)||c.view!==r.view||c.items.length>r.limit||I(g)!==f||c.items.some((w,_)=>r.afterId!==void 0&&w.id<=r.afterId||_>0&&w.id<=c.items[_-1].id)||c.nextCursor!==null&&c.nextCursor!==c.items.at(-1)?.id)throw new Error("Dataset population identity, hash, order or bounds mismatch.");return c}},N=e.string().trim().min(1).max(240),S=e.string().trim().min(1).max(5e3),ve=e.object({taskClass:T,objective:e.string().trim().min(1).max(2e4),sourceSpans:e.array(P).min(1).max(200),firstAvailableAt:e.iso.datetime(),reconstruction:e.object({kind:e.enum(["text_only","pinned_repository","pinned_artifact","unsupported"]),requiredAssets:e.array(e.object({reference:S,evidence:P}).strict()).max(100),missingEvidence:e.array(S).max(20)}).strict(),assessment:e.object({kind:e.enum(["executable","calibrated_judge","unsupported"]),requirements:e.array(e.object({criterion:S,evidence:P}).strict()).min(1).max(20),limitations:e.array(S).max(20)}).strict()}).strict().superRefine((t,a)=>{t.sourceSpans.some(r=>r.role==="requirement")||a.addIssue({code:"custom",message:"A research candidate requires independently retained user requirements."}),t.assessment.requirements.some(r=>r.evidence.role!=="requirement")&&a.addIssue({code:"custom",message:"Assessment criteria must cite user requirements, not historical answers."})}),Ke=e.object({schemaVersion:e.literal("openpond.datasetPreparationResearchDecision.v1"),sourceId:N,snapshotHash:e.string().regex(/^[a-f0-9]{64}$/),candidates:e.array(ve).max(100),exclusions:e.array(e.object({code:N,reason:S,sourceSpans:e.array(P).max(200)}).strict()).max(100),contextSummary:e.string().max(2e4)}).strict(),ye=e.string().regex(/^[a-f0-9]{64}$/);var Le=e.object({schemaVersion:e.literal("openpond.preparedRepositoryStartingState.v1"),dependencyClosureQualified:e.literal(!1),assets:e.array(B.extend({receiptId:e.string().regex(/^starting-assets-[a-f0-9]{40}$/),receiptHash:ye,source:H}).strict()).min(1).max(100)}).strict().superRefine((t,a)=>{new Set(t.assets.map(r=>r.path)).size!==t.assets.length&&a.addIssue({code:"custom",message:"Starting paths must be distinct."}),t.assets.some(r=>r.commitHash!==t.assets[0].commitHash||I(r.source)!==I(t.assets[0].source))&&a.addIssue({code:"custom",message:"Starting assets must belong to one original task boundary and commit."})});var R=e.string().trim().min(1).max(240),j=e.string().trim().min(1).max(2e4),Ie=e.object({id:R,label:e.enum(["positive","incorrect","incomplete","adversarial"]),output:e.record(e.string(),e.unknown()),artifacts:e.array(e.object({path:C.shape.path,mediaType:C.shape.mediaType,base64:e.string().max(8*1024*1024)}).strict()).max(100)}).strict().superRefine((t,a)=>{new Set(t.artifacts.map(r=>r.path)).size!==t.artifacts.length&&a.addIssue({code:"custom",message:"Qualification artifacts must have distinct paths."})}),Qe=e.object({schemaVersion:e.literal("openpond.preparedQualificationPlan.v1"),requirementRefs:e.array(R).min(1).max(100),supported:e.boolean(),limitations:e.array(j).max(20),independentVerifier:e.object({runtime:e.enum(["isolated_javascript","sandbox_process"]),source:e.string().trim().min(1).max(2e5),exportName:e.literal("verify"),timeoutMs:e.number().int().min(1).max(6e4)}).strict().nullable(),witnesses:e.array(Ie).max(20)}).strict().superRefine((t,a)=>{(new Set(t.requirementRefs).size!==t.requirementRefs.length||new Set(t.witnesses.map(r=>r.id)).size!==t.witnesses.length)&&a.addIssue({code:"custom",message:"Qualification evidence identities must be distinct."}),t.supported&&(!t.independentVerifier||t.limitations.length||["positive","incorrect","incomplete","adversarial"].some(r=>!t.witnesses.some(s=>s.label===r)))&&a.addIssue({code:"custom",message:"Supported qualification needs a complete verifier and witness population without unresolved evidence gaps."})}),Je=e.object({schemaVersion:e.literal("openpond.preparedWitnessAdjudication.v1"),witnesses:e.array(e.object({id:R,failureMode:e.enum(["none","incorrect","incomplete","adversarial","unverifiable"]),requirements:e.array(e.object({reference:R,status:e.enum(["satisfied","violated","unverifiable"]),reason:j}).strict()).min(1).max(100)}).strict()).min(4).max(20)}).strict(),Xe=e.object({schemaVersion:e.literal("openpond.preparedCheckerAudit.v1"),requirements:e.array(e.object({reference:R,adequatelyChecked:e.boolean(),oracleAdequatelyChecked:e.boolean(),reason:j}).strict()).min(1).max(100),executionIsolationPassed:e.boolean(),futureEvidenceLeak:e.boolean(),unresolvedLimitations:e.array(j).max(20),passed:e.boolean()}).strict();export{Me as a,Y as b,be as c,We as d};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{i as u,j as N}from"./chunk-AFYYIJ6K.js";import{f as V,t as K,v as R}from"./chunk-D6L6UNUQ.js";import{Ka as k,Na as G,W as U,Za as $,fb as B,l as O,lb as F,oa as I,va as j}from"./chunk-ZY32SZ2P.js";import{k as D,n as p,o as H}from"./chunk-RCT3O3HQ.js";import{h as s,j as z}from"./chunk-5HPZGLOL.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as l}from"./chunk-FTQLQJQV.js";var y=e.object({id:e.string().trim().min(1).max(240),revision:e.number().int().positive(),contentHash:e.string().regex(/^[a-f0-9]{64}$/),targetId:e.string().trim().min(1).max(240).nullable()}).strict(),L=e.array(e.object({role:e.enum(["system","user","assistant"]),content:e.string().max(1e5)}).strict()).max(100).superRefine((t,n)=>{t.reduce((o,a)=>o+a.content.length,0)>1e5&&n.addIssue({code:"custom",message:"Evaluation prompt exceeds 100,000 characters."})});var b=e.string().regex(/^[a-f0-9]{64}$/),C=e.object({providerId:e.literal("claude-code"),configurationHash:b,executableHash:b,version:e.string().regex(/^2\.\d+\.\d+$/),capabilityHash:b,maximumRequestCostUsd:e.number().finite().positive().max(1e4),requestTimeoutMs:e.number().int().min(1e3).max(3e5),maximumTurns:e.number().int().min(1).max(100),holdOpen:e.boolean()}).strict(),ge=e.object({id:e.string().min(1).max(200),receiptId:e.string().min(1).max(200),sessionId:e.uuid(),operationId:e.string().min(1).max(200),action:e.enum(["message","seal"]),text:e.string().max(262144).optional()}).strict().superRefine((t,n)=>{t.action==="message"&&!t.text?.trim()&&n.addIssue({code:"custom",message:"A human intervention requires a message."}),t.action==="seal"&&t.text!==void 0&&n.addIssue({code:"custom",message:"Sealing does not add a prompt."})}),xe=e.object({provider:e.literal("claude-code"),sessionId:e.uuid(),requestId:e.string().min(1).max(200),modelId:e.string().min(1).max(500),runtime:C,sourceHash:b,outputHash:b,traceHash:b,runtimeEventRefs:e.array(e.string().min(1).max(200)).min(1).max(2e4),eventCount:e.number().int().positive().max(2e4),startedAt:e.iso.datetime(),completedAt:e.iso.datetime(),cleanupComplete:e.literal(!0)}).strict().superRefine((t,n)=>{(t.runtimeEventRefs.length!==t.eventCount||new Set(t.runtimeEventRefs).size!==t.eventCount)&&n.addIssue({code:"custom",message:"Process event references must match the exact retained trace population."})});var E=e.object({providerId:e.literal("codex"),configurationHash:e.string().regex(/^[a-f0-9]{64}$/),accountHash:e.string().regex(/^[a-f0-9]{64}$/),reasoningEffort:e.enum(["low","medium","high","xhigh"]),maximumRequestCostUsd:e.number().finite().positive().max(1e4),requestTimeoutMs:e.number().int().min(1e3).max(3e5)}).strict();var J=e.object({schemaVersion:e.literal("openpond.experimentAttemptGrade.v1"),selectionHash:e.string().regex(/^[a-f0-9]{64}$/),grades:e.array(k).min(1).max(100),score:e.number().min(0).max(1).nullable(),passed:e.boolean(),rewardEligible:e.boolean(),gradingStatus:e.enum(["scored","pending","unscorable","not_configured"]),failureClass:D.nullable(),contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict().superRefine((t,n)=>{let{contentHash:o,...a}=t;p(a)!==o&&n.addIssue({code:"custom",message:"Experiment grading integrity failed."});let i=t.grades.flatMap(c=>c.components);(i.length!==t.grades.length||new Set(i.map(c=>c.graderId)).size!==i.length)&&n.addIssue({code:"custom",message:"Each selected criterion requires exactly one distinct grader result."});for(let c of t.grades){let{contentHash:ne,...oe}=c;p(oe)!==ne&&n.addIssue({code:"custom",message:"A retained criterion changed."});for(let ae of c.components){let{contentHash:ie,...re}=ae;p(re)!==ie&&n.addIssue({code:"custom",message:"A retained grader result changed."})}}});var r=e.string().trim().min(1).max(200),h=e.string().regex(/^[a-f0-9]{64}$/),P=e.discriminatedUnion("kind",[e.object({kind:e.literal("hosted_chat"),modelId:r,localRuntime:e.union([e.object({providerId:e.literal("custom-openai-compatible"),configurationHash:h,maximumRequestCostUsd:e.number().finite().positive().max(1e4),requestTimeoutMs:e.number().int().min(1e3).max(3e5)}).strict(),C,E]).optional(),candidate:e.object({artifactId:r,contentHash:h,preparationId:r,dispatchId:r,baseProfileId:r,workerImageDigest:e.string().regex(/^sha256:[a-f0-9]{64}$/)}).strict().optional(),harness:B.optional(),messages:L.optional(),maxOutputTokens:e.number().int().min(1).max(1e6).default(1e5),temperature:e.number().min(0).max(2).default(0),topP:e.number().gt(0).max(1).default(1)}).strict(),e.object({kind:e.literal("fixture"),fixtureId:r}).strict()]),se=e.object({schemaVersion:e.literal("openpond.modelStarterAttemptRequest.v1"),operationId:r,teamId:r,modelProjectId:r.nullable(),project:y.optional(),taskset:u,taskId:r,environmentSeed:e.number().int().min(0).max(2147483647).default(0),policy:P}).strict(),ze=e.object({modelProjectId:r.nullable(),taskset:u,afterTaskId:r.optional(),limit:e.number().int().min(1).max(100).default(25)}).strict(),De=e.object({modelProjectId:r.nullable(),taskset:u,available:e.boolean(),unavailableReason:e.string().max(1e3).nullable(),models:e.array(e.object({id:r,name:e.string().max(500),maximumOutputTokens:e.number().int().min(1).max(1e6).optional(),baseModel:N.nullable().optional()}).strict()).max(200),tasks:e.array(e.object({id:r,split:U,inputPreview:e.string().max(500),fixtures:e.array(e.object({id:r,label:e.string().max(200)}).strict()).max(1e3)}).strict()).max(100),nextCursor:r.nullable()}).strict(),w=e.object({schemaVersion:e.literal("openpond.modelStarterAttemptSummary.v1"),id:r,revision:e.number().int().positive(),request:se,status:e.enum(["queued","running","cancelling","completed","failed","cancelled"]),policySnapshot:e.object({modelId:r,provider:r,upstreamModelId:e.string().min(1).max(500),configurationHash:h}).strict().nullable(),createdAt:e.iso.datetime(),startedAt:e.iso.datetime().nullable(),completedAt:e.iso.datetime().nullable(),cleanupComplete:e.boolean(),resultAvailable:e.boolean(),score:e.number().min(0).max(1).nullable(),gradingStatus:e.enum(["not_started","pending","scored","unscorable","not_configured"]).default("not_started"),passed:e.boolean().nullable(),outputPreview:e.string().max(500).nullable(),error:e.object({code:r,message:e.string().max(2e3)}).strict().nullable()}).strict().superRefine((t,n)=>{t.request.policy.kind==="fixture"!=(t.policySnapshot===null)&&n.addIssue({code:"custom",path:["policySnapshot"],message:"Fixture execution must not claim a model identity."}),t.status==="completed"&&(!t.cleanupComplete||!t.resultAvailable||!t.completedAt)&&n.addIssue({code:"custom",message:"Completed attempts require retained results and confirmed cleanup."})}),Oe=e.object({modelProjectId:r,afterId:r.optional(),limit:e.number().int().min(1).max(100).default(25)}).strict(),Ue=e.object({items:e.array(w).max(100),nextCursor:r.nullable()}).strict(),Ge=e.object({schemaVersion:e.literal("openpond.modelStarterAttemptResult.v1"),attempt:w,output:e.string().max(1048576).nullable(),messages:e.array(e.record(e.string(),e.unknown())).max(4002),composition:$.nullable(),grade:k.nullable().optional(),experimentGrade:J.nullable().optional(),environment:e.object({status:e.enum(["completed","budget_exhausted","cancelled","timed_out","policy_failure","environment_failure"]),collected:e.boolean(),definition:u,initialStateHash:h.nullable(),finalStateHash:h.nullable(),attemptHash:h}).strict(),native:F.optional(),providerRequestIds:e.array(r).max(1001),contentHash:h}).strict().superRefine((t,n)=>{let o=t.attempt.request.policy.kind==="hosted_chat"?t.attempt.request.policy.harness:void 0;!!o!=!!t.native&&n.addIssue({code:"custom",path:["native"],message:"Standalone Harness results require their exact native evidence."}),t.native&&(!o||p(o)!==p(t.native.source)||t.native.modelConfigurationHash!==t.attempt.policySnapshot?.configurationHash||t.environment.initialStateHash!==null||t.environment.finalStateHash!==null||t.environment.status==="completed"&&(!t.environment.collected||t.output===null||t.native.partialOutputAvailable||t.native.outputHash!==p(t.output)))&&n.addIssue({code:"custom",path:["native"],message:"Native evidence differs from the admitted source, model or output."}),t.experimentGrade&&((t.grade||t.composition)&&n.addIssue({code:"custom",message:"Selected Experiment grading cannot claim another grade population."}),(!["completed","failed"].includes(t.attempt.status)||!t.attempt.resultAvailable||t.attempt.score!==t.experimentGrade.score||t.attempt.gradingStatus!==t.experimentGrade.gradingStatus||t.attempt.passed!==(t.experimentGrade.score===null?null:t.experimentGrade.passed))&&n.addIssue({code:"custom",message:"Experiment grading differs from its retained attempt summary."})),t.grade&&(t.composition&&n.addIssue({code:"custom",path:["grade"],message:"An ordinary grade cannot also claim a Reward composition."}),(!["completed","failed"].includes(t.attempt.status)||!t.attempt.resultAvailable||t.attempt.score!==t.grade.score||t.attempt.gradingStatus!==t.grade.gradingStatus||t.attempt.passed!==(t.grade.score===null?null:t.grade.passed))&&n.addIssue({code:"custom",path:["grade"],message:"Ordinary grade differs from its terminal attempt summary."}))});var S=e.string().trim().min(1).max(240),A=e.string().regex(/^[a-f0-9]{64}$/),T=e.object({maxOutputTokens:e.number().int().min(1).max(1e6).default(4096),temperature:e.number().min(0).max(2).default(0),topP:e.number().gt(0).max(1).default(1)}).strict();var f=e.object({kind:e.literal("hosted_harness"),modelId:S,maxOutputTokens:T.shape.maxOutputTokens.removeDefault().optional(),temperature:T.shape.temperature.removeDefault().optional(),topP:T.shape.topP.removeDefault().optional(),localRuntime:E.optional(),candidate:e.object({artifactId:S,contentHash:A,preparationId:S,dispatchId:S,baseProfileId:S,workerImageDigest:e.string().regex(/^sha256:[a-f0-9]{64}$/)}).strict().optional(),sourceCandidate:j.shape.sourceCandidate,reasoningEffort:e.enum(["off","low","medium","high","xhigh","max"]).optional(),profileRepositoryId:S,source:j,modelConfigurationHash:A,packageHash:A,externalDatasetBinding:I.optional()}).strict().superRefine((t,n)=>{JSON.stringify(t.externalDatasetBinding??null)!==JSON.stringify(t.source.externalDatasetBinding??null)&&n.addIssue({code:"custom",message:"The policy and source must bind the same external Dataset recipe."}),JSON.stringify(t.sourceCandidate??null)!==JSON.stringify(t.source.sourceCandidate??null)&&n.addIssue({code:"custom",message:"The policy and prepared source must bind the same actual source candidate."})});var d=e.string().trim().min(1).max(200),Q=e.string().regex(/^[a-f0-9]{64}$/),me=e.discriminatedUnion("kind",[P.options[0],e.object({kind:e.literal("fixture")}).strict(),f]),g=e.object({schemaVersion:e.literal("openpond.modelTasksetRunRequest.v1"),operationId:d,teamId:d,modelProjectId:d.nullable(),name:e.string().trim().min(1).max(200).optional(),project:y.optional(),taskset:u,policy:me,population:e.array(K).min(1).max(1e4)}).strict().superRefine((t,n)=>{new Set(t.population.map(o=>o.receiptId)).size!==t.population.length&&n.addIssue({code:"custom",path:["population"],message:"Run receipt identities must be unique."}),t.population.some(o=>o.fixtureId!==null!=(t.policy.kind==="fixture"))&&n.addIssue({code:"custom",path:["population"],message:"Only fixture runs require a fixture identity for every member."}),t.population.some(o=>!/^(0|[1-9][0-9]*)$/.test(o.seed)||Number(o.seed)>2147483647)&&n.addIssue({code:"custom",path:["population"],message:"Hosted environment seeds must be integers from 0 to 2147483647."}),t.policy.kind==="hosted_harness"&&t.modelProjectId!==null&&n.addIssue({code:"custom",path:["modelProjectId"],message:"A Harness target retains its released Profile binding separately from Model artifacts."}),t.policy.kind==="hosted_harness"&&new Set(t.population.map(o=>s([o.taskId,o.seed]))).size!==t.population.length&&n.addIssue({code:"custom",path:["population"],message:"Harness case identities must be unique for each task and seed."})}),X=e.object({schemaVersion:e.literal("openpond.modelTasksetRunSummary.v1"),id:d,revision:e.number().int().positive(),teamId:d,modelProjectId:d.nullable(),name:e.string().trim().min(1).max(200).optional(),project:y.optional(),operationId:d,taskset:u,policyKind:e.enum(["hosted_chat","fixture","hosted_harness"]),manifestHash:Q,status:e.enum(["queued","running","cancelling","completed","failed","cancelled"]),totalCount:e.number().int().min(1).max(1e4),counts:e.object({pending:e.number().int().nonnegative(),running:e.number().int().nonnegative(),completed:e.number().int().nonnegative(),failed:e.number().int().nonnegative(),cancelled:e.number().int().nonnegative()}).strict(),createdAt:e.iso.datetime(),startedAt:e.iso.datetime().nullable(),completedAt:e.iso.datetime().nullable(),cleanupComplete:e.boolean(),resultAvailable:e.boolean(),score:e.number().min(0).max(1).nullable(),metricName:e.string().min(1).max(240),error:e.object({code:d,message:e.string().max(2e3)}).strict().nullable()}).strict().superRefine((t,n)=>{Object.values(t.counts).reduce((o,a)=>o+a,0)!==t.totalCount&&n.addIssue({code:"custom",path:["counts"],message:"Run counts must account for the complete population."}),t.status!=="completed"&&t.score!==null&&n.addIssue({code:"custom",path:["score"],message:"Only completed evaluations publish a metric value."}),["completed","failed","cancelled"].includes(t.status)&&(!t.completedAt||t.counts.pending||t.counts.running)&&n.addIssue({code:"custom",message:"Terminal runs require complete population accounting."}),t.status==="cancelled"&&!t.cleanupComplete&&n.addIssue({code:"custom",message:"Cancelled runs require confirmed cleanup."}),t.resultAvailable&&!["completed","failed","cancelled"].includes(t.status)&&n.addIssue({code:"custom",message:"Run results require terminal population accounting."}),t.status==="completed"&&(!t.cleanupComplete||!t.resultAvailable)&&n.addIssue({code:"custom",message:"Completed evaluations require retained results and confirmed cleanup."})}),W=e.object({summary:X,request:g,manifest:R,policySnapshot:w.shape.policySnapshot}).strict(),it=e.object({modelProjectId:d.optional(),projectId:y.shape.id.optional(),afterId:d.optional(),limit:e.number().int().min(1).max(100).default(25)}).strict(),rt=e.object({items:e.array(X).max(100),nextCursor:d.nullable()}).strict(),st=e.object({schemaVersion:e.literal("openpond.modelTasksetRunResult.v1"),run:W,receipts:e.array(V).min(1).max(1e4),metric:O.nullable(),contentHash:Q}).strict();function ce(t,n){H(n,"Taskset run manifest");let o=t.policy;if(o.kind!=="hosted_harness"||n.execution.kind!=="harness"||s(n.profileEvaluation)!==s(o.source)||s(n.execution.harnessRelease)!==s(o.source.harnessRelease)||n.metadata.profileRepositoryId!==o.profileRepositoryId||n.packageHash!==o.packageHash||n.policy.kind!=="model"||n.policy.model.provider!==(o.localRuntime?.providerId??"openpond")||n.policy.model.model!==o.modelId||n.policy.model.revision!==null||n.policy.model.artifactHash!==(o.candidate?.contentHash??null)||n.policy.model.tokenizerRevision!==null||n.policy.model.chatTemplateHash!==null||n.policy.configurationHash!==o.modelConfigurationHash||n.tasksetRelease.id!==t.taskset.id||n.tasksetRelease.contentHash!==t.taskset.contentHash||s(n.population)!==s(t.population)||n.population.some(a=>a.receiptId!==`evaluation-${p(n.profileEvaluation?.externalDatasetBinding?[n.id,a.taskId,a.seed,a.fixtureId]:[n.id,a.taskId,a.seed]).slice(0,32)}`))throw new Error("Harness evaluation differs from its admitted source, package or model configuration.")}l(ce,"verifyHarnessExperimentManifest");async function mt(t){let n=W.parse(t),{summary:o,request:a,manifest:i,policySnapshot:c}=n;if(H(i,"Taskset run manifest"),i.contentHash!==o.manifestHash||i.id!==o.id||i.createdAt!==o.createdAt||o.teamId!==a.teamId||o.modelProjectId!==a.modelProjectId||s(o.project??null)!==s(a.project??null)||s(i.metadata.project??null)!==s(a.project??null)||(o.name??null)!==(a.name??null)||o.operationId!==a.operationId||o.policyKind!==a.policy.kind||o.totalCount!==a.population.length||o.metricName!==i.metricPolicy.primaryMetric||s(o.taskset)!==s(a.taskset)||i.tasksetRelease.id!==a.taskset.id||i.tasksetRelease.contentHash!==a.taskset.contentHash||s(i.population)!==s(a.population))throw new Error("Evaluation run differs from its admitted request or manifest.");if(a.policy.kind==="fixture"){if(i.policy.kind!=="fixture"||c!==null)throw new Error("Fixture checks cannot claim a model identity.")}else if(a.policy.kind==="hosted_harness"){if(ce(a,i),c!==null)throw new Error("Harness evaluations retain the native host model configuration.")}else if(i.policy.kind!=="model"||!c||c.modelId!==a.policy.modelId||i.policy.model.provider!==c.provider||i.policy.model.model!==c.upstreamModelId||i.policy.model.revision!==null||i.policy.model.artifactHash!==(a.policy.candidate?.contentHash??null)||i.policy.model.tokenizerRevision!==null||i.policy.model.chatTemplateHash!==null||i.policy.configurationHash!==await z({policy:a.policy,snapshot:c}))throw new Error("Evaluation model differs from its admitted policy.");return n}l(mt,"verifyModelTasksetRunDetails");var ee=e.string().min(1).max(200).refine(t=>!["__proto__","prototype","constructor"].includes(t),"Use an ordinary field name."),de=e.array(ee).min(1).max(20),Y=e.enum(["input","output","expectedOutput","evaluatorContext"]),pe=e.object({destination:Y,path:de,source:Y,sourcePath:e.array(ee).max(20)}).strict(),_=e.array(pe).max(100).superRefine((t,n)=>{for(let[o,a]of t.entries())t.slice(0,o).some(i=>i.destination===a.destination&&(Z(i.path,a.path)||Z(a.path,i.path)))&&n.addIssue({code:"custom",path:[o,"path"],message:"Mapped destination paths must not overlap."})});function Z(t,n){return t.length<=n.length&&t.every((o,a)=>o===n[a])}l(Z,"prefix");var m=e.string().trim().min(1).max(200),x=e.string().regex(/^[a-f0-9]{64}$/),M=e.object({id:m,revision:e.number().int().positive(),contentHash:x}).strict(),v=e.object({id:m,version:e.string().min(1).max(200),contentHash:x,name:e.string().trim().min(1).max(500).optional(),feedbackKey:G,release:M.nullable(),mappings:_.optional()}).strict(),q=e.object({id:m,version:e.string().min(1).max(200),contentHash:x,mappings:_}).strict(),It=e.object({operationId:m,id:m.optional(),expectedRevision:e.number().int().nonnegative(),request:g,maximumCostUsd:e.number().finite().positive().max(1e4),graders:e.array(q).min(1).max(100).optional()}).strict().superRefine((t,n)=>{t.request.name||n.addIssue({code:"custom",path:["request","name"],message:"Name this Experiment before saving it."}),!!t.id!=t.expectedRevision>0&&n.addIssue({code:"custom",path:["expectedRevision"],message:"An update requires its saved definition revision."}),Math.round(t.maximumCostUsd*1e6)<1&&n.addIssue({code:"custom",path:["maximumCostUsd"],message:"The budget must be at least $0.000001."}),t.graders&&new Set(t.graders.map(o=>o.id)).size!==t.graders.length&&n.addIssue({code:"custom",path:["graders"],message:"Select each grader once."})}),le=e.object({schemaVersion:e.literal("openpond.experimentDefinition.v1"),id:m,teamId:m,revision:e.number().int().positive(),request:g,maximumCostUsd:e.number().finite().positive().max(1e4),graders:e.array(v).min(1).max(100),createdAt:e.iso.datetime(),updatedAt:e.iso.datetime()}).strict(),kt=le.extend({contentHash:x}),Rt=e.object({operationId:m,definition:M}).strict(),Et=e.object({projectId:m.optional(),datasetHash:x.optional(),search:e.string().trim().max(200).optional(),status:e.enum(["queued","running","cancelling","completed","failed","cancelled"]).optional(),afterId:m.optional(),limit:e.number().int().min(1).max(100).default(30)}).strict(),wt=e.object({definition:M.nullable(),configurationHash:x.optional(),admissionRequestHash:x.optional(),sourceExperimentId:m.optional(),maximumCostUsd:e.number().finite().positive().max(1e4),graders:e.array(v).min(1).max(100)}).strict().superRefine((t,n)=>{t.definition===null&&(!t.configurationHash||!t.admissionRequestHash)&&n.addIssue({code:"custom",path:["configurationHash"],message:"A flat Experiment requires its sealed configuration hash."})}),Ht=e.object({operationId:m,profileRepositoryId:m,definitionId:m,modelId:m,localRuntime:f.shape.localRuntime,maxOutputTokens:f.shape.maxOutputTokens,temperature:f.shape.temperature,topP:f.shape.topP,reasoningEffort:e.enum(["off","low","medium","high","xhigh","max"]).optional(),maximumCostUsd:e.number().finite().positive().max(1e4),externalDatasetBinding:I.optional(),sourceCandidate:f.shape.sourceCandidate}).strict(),jt=e.object({request:g,manifest:R,maximumCostUsd:e.number().finite().positive().max(1e4),graders:e.array(v).min(1).max(100)}).strict();var te=e.string().trim().min(1).max(200),Mt=e.object({operationId:te,request:g,maximumCostUsd:e.number().finite().positive().max(1e4),graders:e.array(q).min(1).max(100).optional(),sourceExperimentId:te.optional()}).strict().superRefine((t,n)=>{t.request.name||n.addIssue({code:"custom",path:["request","name"],message:"Name this Experiment before starting it."}),t.operationId!==t.request.operationId&&n.addIssue({code:"custom",path:["request","operationId"],message:"Use one operation identity for this Experiment."}),Math.round(t.maximumCostUsd*1e6)<1&&n.addIssue({code:"custom",path:["maximumCostUsd"],message:"The spending cap must be at least $0.000001."}),t.graders&&new Set(t.graders.map(o=>o.id)).size!==t.graders.length&&n.addIssue({code:"custom",path:["graders"],message:"Select each grader once."})});export{y as a,L as b,P as c,f as d,g as e,W as f,ce as g,mt as h,_ as i,v as j,q as k,kt as l,Et as m,wt as n,Ht as o,jt as p,Mt as q};
2
+ import{j as u,k as N}from"./chunk-C7NQPICU.js";import{f as V,t as K,v as R}from"./chunk-D6L6UNUQ.js";import{Ka as k,Na as G,W as U,Za as $,fb as B,l as O,lb as F,oa as I,va as j}from"./chunk-ZY32SZ2P.js";import{k as D,n as p,o as H}from"./chunk-RCT3O3HQ.js";import{h as s,j as z}from"./chunk-5HPZGLOL.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as l}from"./chunk-FTQLQJQV.js";var y=e.object({id:e.string().trim().min(1).max(240),revision:e.number().int().positive(),contentHash:e.string().regex(/^[a-f0-9]{64}$/),targetId:e.string().trim().min(1).max(240).nullable()}).strict(),L=e.array(e.object({role:e.enum(["system","user","assistant"]),content:e.string().max(1e5)}).strict()).max(100).superRefine((t,n)=>{t.reduce((o,a)=>o+a.content.length,0)>1e5&&n.addIssue({code:"custom",message:"Evaluation prompt exceeds 100,000 characters."})});var b=e.string().regex(/^[a-f0-9]{64}$/),C=e.object({providerId:e.literal("claude-code"),configurationHash:b,executableHash:b,version:e.string().regex(/^2\.\d+\.\d+$/),capabilityHash:b,maximumRequestCostUsd:e.number().finite().positive().max(1e4),requestTimeoutMs:e.number().int().min(1e3).max(3e5),maximumTurns:e.number().int().min(1).max(100),holdOpen:e.boolean()}).strict(),ge=e.object({id:e.string().min(1).max(200),receiptId:e.string().min(1).max(200),sessionId:e.uuid(),operationId:e.string().min(1).max(200),action:e.enum(["message","seal"]),text:e.string().max(262144).optional()}).strict().superRefine((t,n)=>{t.action==="message"&&!t.text?.trim()&&n.addIssue({code:"custom",message:"A human intervention requires a message."}),t.action==="seal"&&t.text!==void 0&&n.addIssue({code:"custom",message:"Sealing does not add a prompt."})}),xe=e.object({provider:e.literal("claude-code"),sessionId:e.uuid(),requestId:e.string().min(1).max(200),modelId:e.string().min(1).max(500),runtime:C,sourceHash:b,outputHash:b,traceHash:b,runtimeEventRefs:e.array(e.string().min(1).max(200)).min(1).max(2e4),eventCount:e.number().int().positive().max(2e4),startedAt:e.iso.datetime(),completedAt:e.iso.datetime(),cleanupComplete:e.literal(!0)}).strict().superRefine((t,n)=>{(t.runtimeEventRefs.length!==t.eventCount||new Set(t.runtimeEventRefs).size!==t.eventCount)&&n.addIssue({code:"custom",message:"Process event references must match the exact retained trace population."})});var E=e.object({providerId:e.literal("codex"),configurationHash:e.string().regex(/^[a-f0-9]{64}$/),accountHash:e.string().regex(/^[a-f0-9]{64}$/),reasoningEffort:e.enum(["low","medium","high","xhigh"]),maximumRequestCostUsd:e.number().finite().positive().max(1e4),requestTimeoutMs:e.number().int().min(1e3).max(3e5)}).strict();var J=e.object({schemaVersion:e.literal("openpond.experimentAttemptGrade.v1"),selectionHash:e.string().regex(/^[a-f0-9]{64}$/),grades:e.array(k).min(1).max(100),score:e.number().min(0).max(1).nullable(),passed:e.boolean(),rewardEligible:e.boolean(),gradingStatus:e.enum(["scored","pending","unscorable","not_configured"]),failureClass:D.nullable(),contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict().superRefine((t,n)=>{let{contentHash:o,...a}=t;p(a)!==o&&n.addIssue({code:"custom",message:"Experiment grading integrity failed."});let i=t.grades.flatMap(c=>c.components);(i.length!==t.grades.length||new Set(i.map(c=>c.graderId)).size!==i.length)&&n.addIssue({code:"custom",message:"Each selected criterion requires exactly one distinct grader result."});for(let c of t.grades){let{contentHash:ne,...oe}=c;p(oe)!==ne&&n.addIssue({code:"custom",message:"A retained criterion changed."});for(let ae of c.components){let{contentHash:ie,...re}=ae;p(re)!==ie&&n.addIssue({code:"custom",message:"A retained grader result changed."})}}});var r=e.string().trim().min(1).max(200),h=e.string().regex(/^[a-f0-9]{64}$/),P=e.discriminatedUnion("kind",[e.object({kind:e.literal("hosted_chat"),modelId:r,localRuntime:e.union([e.object({providerId:e.literal("custom-openai-compatible"),configurationHash:h,maximumRequestCostUsd:e.number().finite().positive().max(1e4),requestTimeoutMs:e.number().int().min(1e3).max(3e5)}).strict(),C,E]).optional(),candidate:e.object({artifactId:r,contentHash:h,preparationId:r,dispatchId:r,baseProfileId:r,workerImageDigest:e.string().regex(/^sha256:[a-f0-9]{64}$/)}).strict().optional(),harness:B.optional(),messages:L.optional(),maxOutputTokens:e.number().int().min(1).max(1e6).default(1e5),temperature:e.number().min(0).max(2).default(0),topP:e.number().gt(0).max(1).default(1)}).strict(),e.object({kind:e.literal("fixture"),fixtureId:r}).strict()]),se=e.object({schemaVersion:e.literal("openpond.modelStarterAttemptRequest.v1"),operationId:r,teamId:r,modelProjectId:r.nullable(),project:y.optional(),taskset:u,taskId:r,environmentSeed:e.number().int().min(0).max(2147483647).default(0),policy:P}).strict(),ze=e.object({modelProjectId:r.nullable(),taskset:u,afterTaskId:r.optional(),limit:e.number().int().min(1).max(100).default(25)}).strict(),De=e.object({modelProjectId:r.nullable(),taskset:u,available:e.boolean(),unavailableReason:e.string().max(1e3).nullable(),models:e.array(e.object({id:r,name:e.string().max(500),maximumOutputTokens:e.number().int().min(1).max(1e6).optional(),baseModel:N.nullable().optional()}).strict()).max(200),tasks:e.array(e.object({id:r,split:U,inputPreview:e.string().max(500),fixtures:e.array(e.object({id:r,label:e.string().max(200)}).strict()).max(1e3)}).strict()).max(100),nextCursor:r.nullable()}).strict(),w=e.object({schemaVersion:e.literal("openpond.modelStarterAttemptSummary.v1"),id:r,revision:e.number().int().positive(),request:se,status:e.enum(["queued","running","cancelling","completed","failed","cancelled"]),policySnapshot:e.object({modelId:r,provider:r,upstreamModelId:e.string().min(1).max(500),configurationHash:h}).strict().nullable(),createdAt:e.iso.datetime(),startedAt:e.iso.datetime().nullable(),completedAt:e.iso.datetime().nullable(),cleanupComplete:e.boolean(),resultAvailable:e.boolean(),score:e.number().min(0).max(1).nullable(),gradingStatus:e.enum(["not_started","pending","scored","unscorable","not_configured"]).default("not_started"),passed:e.boolean().nullable(),outputPreview:e.string().max(500).nullable(),error:e.object({code:r,message:e.string().max(2e3)}).strict().nullable()}).strict().superRefine((t,n)=>{t.request.policy.kind==="fixture"!=(t.policySnapshot===null)&&n.addIssue({code:"custom",path:["policySnapshot"],message:"Fixture execution must not claim a model identity."}),t.status==="completed"&&(!t.cleanupComplete||!t.resultAvailable||!t.completedAt)&&n.addIssue({code:"custom",message:"Completed attempts require retained results and confirmed cleanup."})}),Oe=e.object({modelProjectId:r,afterId:r.optional(),limit:e.number().int().min(1).max(100).default(25)}).strict(),Ue=e.object({items:e.array(w).max(100),nextCursor:r.nullable()}).strict(),Ge=e.object({schemaVersion:e.literal("openpond.modelStarterAttemptResult.v1"),attempt:w,output:e.string().max(1048576).nullable(),messages:e.array(e.record(e.string(),e.unknown())).max(4002),composition:$.nullable(),grade:k.nullable().optional(),experimentGrade:J.nullable().optional(),environment:e.object({status:e.enum(["completed","budget_exhausted","cancelled","timed_out","policy_failure","environment_failure"]),collected:e.boolean(),definition:u,initialStateHash:h.nullable(),finalStateHash:h.nullable(),attemptHash:h}).strict(),native:F.optional(),providerRequestIds:e.array(r).max(1001),contentHash:h}).strict().superRefine((t,n)=>{let o=t.attempt.request.policy.kind==="hosted_chat"?t.attempt.request.policy.harness:void 0;!!o!=!!t.native&&n.addIssue({code:"custom",path:["native"],message:"Standalone Harness results require their exact native evidence."}),t.native&&(!o||p(o)!==p(t.native.source)||t.native.modelConfigurationHash!==t.attempt.policySnapshot?.configurationHash||t.environment.initialStateHash!==null||t.environment.finalStateHash!==null||t.environment.status==="completed"&&(!t.environment.collected||t.output===null||t.native.partialOutputAvailable||t.native.outputHash!==p(t.output)))&&n.addIssue({code:"custom",path:["native"],message:"Native evidence differs from the admitted source, model or output."}),t.experimentGrade&&((t.grade||t.composition)&&n.addIssue({code:"custom",message:"Selected Experiment grading cannot claim another grade population."}),(!["completed","failed"].includes(t.attempt.status)||!t.attempt.resultAvailable||t.attempt.score!==t.experimentGrade.score||t.attempt.gradingStatus!==t.experimentGrade.gradingStatus||t.attempt.passed!==(t.experimentGrade.score===null?null:t.experimentGrade.passed))&&n.addIssue({code:"custom",message:"Experiment grading differs from its retained attempt summary."})),t.grade&&(t.composition&&n.addIssue({code:"custom",path:["grade"],message:"An ordinary grade cannot also claim a Reward composition."}),(!["completed","failed"].includes(t.attempt.status)||!t.attempt.resultAvailable||t.attempt.score!==t.grade.score||t.attempt.gradingStatus!==t.grade.gradingStatus||t.attempt.passed!==(t.grade.score===null?null:t.grade.passed))&&n.addIssue({code:"custom",path:["grade"],message:"Ordinary grade differs from its terminal attempt summary."}))});var S=e.string().trim().min(1).max(240),A=e.string().regex(/^[a-f0-9]{64}$/),T=e.object({maxOutputTokens:e.number().int().min(1).max(1e6).default(4096),temperature:e.number().min(0).max(2).default(0),topP:e.number().gt(0).max(1).default(1)}).strict();var f=e.object({kind:e.literal("hosted_harness"),modelId:S,maxOutputTokens:T.shape.maxOutputTokens.removeDefault().optional(),temperature:T.shape.temperature.removeDefault().optional(),topP:T.shape.topP.removeDefault().optional(),localRuntime:E.optional(),candidate:e.object({artifactId:S,contentHash:A,preparationId:S,dispatchId:S,baseProfileId:S,workerImageDigest:e.string().regex(/^sha256:[a-f0-9]{64}$/)}).strict().optional(),sourceCandidate:j.shape.sourceCandidate,reasoningEffort:e.enum(["off","low","medium","high","xhigh","max"]).optional(),profileRepositoryId:S,source:j,modelConfigurationHash:A,packageHash:A,externalDatasetBinding:I.optional()}).strict().superRefine((t,n)=>{JSON.stringify(t.externalDatasetBinding??null)!==JSON.stringify(t.source.externalDatasetBinding??null)&&n.addIssue({code:"custom",message:"The policy and source must bind the same external Dataset recipe."}),JSON.stringify(t.sourceCandidate??null)!==JSON.stringify(t.source.sourceCandidate??null)&&n.addIssue({code:"custom",message:"The policy and prepared source must bind the same actual source candidate."})});var d=e.string().trim().min(1).max(200),Q=e.string().regex(/^[a-f0-9]{64}$/),me=e.discriminatedUnion("kind",[P.options[0],e.object({kind:e.literal("fixture")}).strict(),f]),g=e.object({schemaVersion:e.literal("openpond.modelTasksetRunRequest.v1"),operationId:d,teamId:d,modelProjectId:d.nullable(),name:e.string().trim().min(1).max(200).optional(),project:y.optional(),taskset:u,policy:me,population:e.array(K).min(1).max(1e4)}).strict().superRefine((t,n)=>{new Set(t.population.map(o=>o.receiptId)).size!==t.population.length&&n.addIssue({code:"custom",path:["population"],message:"Run receipt identities must be unique."}),t.population.some(o=>o.fixtureId!==null!=(t.policy.kind==="fixture"))&&n.addIssue({code:"custom",path:["population"],message:"Only fixture runs require a fixture identity for every member."}),t.population.some(o=>!/^(0|[1-9][0-9]*)$/.test(o.seed)||Number(o.seed)>2147483647)&&n.addIssue({code:"custom",path:["population"],message:"Hosted environment seeds must be integers from 0 to 2147483647."}),t.policy.kind==="hosted_harness"&&t.modelProjectId!==null&&n.addIssue({code:"custom",path:["modelProjectId"],message:"A Harness target retains its released Profile binding separately from Model artifacts."}),t.policy.kind==="hosted_harness"&&new Set(t.population.map(o=>s([o.taskId,o.seed]))).size!==t.population.length&&n.addIssue({code:"custom",path:["population"],message:"Harness case identities must be unique for each task and seed."})}),X=e.object({schemaVersion:e.literal("openpond.modelTasksetRunSummary.v1"),id:d,revision:e.number().int().positive(),teamId:d,modelProjectId:d.nullable(),name:e.string().trim().min(1).max(200).optional(),project:y.optional(),operationId:d,taskset:u,policyKind:e.enum(["hosted_chat","fixture","hosted_harness"]),manifestHash:Q,status:e.enum(["queued","running","cancelling","completed","failed","cancelled"]),totalCount:e.number().int().min(1).max(1e4),counts:e.object({pending:e.number().int().nonnegative(),running:e.number().int().nonnegative(),completed:e.number().int().nonnegative(),failed:e.number().int().nonnegative(),cancelled:e.number().int().nonnegative()}).strict(),createdAt:e.iso.datetime(),startedAt:e.iso.datetime().nullable(),completedAt:e.iso.datetime().nullable(),cleanupComplete:e.boolean(),resultAvailable:e.boolean(),score:e.number().min(0).max(1).nullable(),metricName:e.string().min(1).max(240),error:e.object({code:d,message:e.string().max(2e3)}).strict().nullable()}).strict().superRefine((t,n)=>{Object.values(t.counts).reduce((o,a)=>o+a,0)!==t.totalCount&&n.addIssue({code:"custom",path:["counts"],message:"Run counts must account for the complete population."}),t.status!=="completed"&&t.score!==null&&n.addIssue({code:"custom",path:["score"],message:"Only completed evaluations publish a metric value."}),["completed","failed","cancelled"].includes(t.status)&&(!t.completedAt||t.counts.pending||t.counts.running)&&n.addIssue({code:"custom",message:"Terminal runs require complete population accounting."}),t.status==="cancelled"&&!t.cleanupComplete&&n.addIssue({code:"custom",message:"Cancelled runs require confirmed cleanup."}),t.resultAvailable&&!["completed","failed","cancelled"].includes(t.status)&&n.addIssue({code:"custom",message:"Run results require terminal population accounting."}),t.status==="completed"&&(!t.cleanupComplete||!t.resultAvailable)&&n.addIssue({code:"custom",message:"Completed evaluations require retained results and confirmed cleanup."})}),W=e.object({summary:X,request:g,manifest:R,policySnapshot:w.shape.policySnapshot}).strict(),it=e.object({modelProjectId:d.optional(),projectId:y.shape.id.optional(),afterId:d.optional(),limit:e.number().int().min(1).max(100).default(25)}).strict(),rt=e.object({items:e.array(X).max(100),nextCursor:d.nullable()}).strict(),st=e.object({schemaVersion:e.literal("openpond.modelTasksetRunResult.v1"),run:W,receipts:e.array(V).min(1).max(1e4),metric:O.nullable(),contentHash:Q}).strict();function ce(t,n){H(n,"Taskset run manifest");let o=t.policy;if(o.kind!=="hosted_harness"||n.execution.kind!=="harness"||s(n.profileEvaluation)!==s(o.source)||s(n.execution.harnessRelease)!==s(o.source.harnessRelease)||n.metadata.profileRepositoryId!==o.profileRepositoryId||n.packageHash!==o.packageHash||n.policy.kind!=="model"||n.policy.model.provider!==(o.localRuntime?.providerId??"openpond")||n.policy.model.model!==o.modelId||n.policy.model.revision!==null||n.policy.model.artifactHash!==(o.candidate?.contentHash??null)||n.policy.model.tokenizerRevision!==null||n.policy.model.chatTemplateHash!==null||n.policy.configurationHash!==o.modelConfigurationHash||n.tasksetRelease.id!==t.taskset.id||n.tasksetRelease.contentHash!==t.taskset.contentHash||s(n.population)!==s(t.population)||n.population.some(a=>a.receiptId!==`evaluation-${p(n.profileEvaluation?.externalDatasetBinding?[n.id,a.taskId,a.seed,a.fixtureId]:[n.id,a.taskId,a.seed]).slice(0,32)}`))throw new Error("Harness evaluation differs from its admitted source, package or model configuration.")}l(ce,"verifyHarnessExperimentManifest");async function mt(t){let n=W.parse(t),{summary:o,request:a,manifest:i,policySnapshot:c}=n;if(H(i,"Taskset run manifest"),i.contentHash!==o.manifestHash||i.id!==o.id||i.createdAt!==o.createdAt||o.teamId!==a.teamId||o.modelProjectId!==a.modelProjectId||s(o.project??null)!==s(a.project??null)||s(i.metadata.project??null)!==s(a.project??null)||(o.name??null)!==(a.name??null)||o.operationId!==a.operationId||o.policyKind!==a.policy.kind||o.totalCount!==a.population.length||o.metricName!==i.metricPolicy.primaryMetric||s(o.taskset)!==s(a.taskset)||i.tasksetRelease.id!==a.taskset.id||i.tasksetRelease.contentHash!==a.taskset.contentHash||s(i.population)!==s(a.population))throw new Error("Evaluation run differs from its admitted request or manifest.");if(a.policy.kind==="fixture"){if(i.policy.kind!=="fixture"||c!==null)throw new Error("Fixture checks cannot claim a model identity.")}else if(a.policy.kind==="hosted_harness"){if(ce(a,i),c!==null)throw new Error("Harness evaluations retain the native host model configuration.")}else if(i.policy.kind!=="model"||!c||c.modelId!==a.policy.modelId||i.policy.model.provider!==c.provider||i.policy.model.model!==c.upstreamModelId||i.policy.model.revision!==null||i.policy.model.artifactHash!==(a.policy.candidate?.contentHash??null)||i.policy.model.tokenizerRevision!==null||i.policy.model.chatTemplateHash!==null||i.policy.configurationHash!==await z({policy:a.policy,snapshot:c}))throw new Error("Evaluation model differs from its admitted policy.");return n}l(mt,"verifyModelTasksetRunDetails");var ee=e.string().min(1).max(200).refine(t=>!["__proto__","prototype","constructor"].includes(t),"Use an ordinary field name."),de=e.array(ee).min(1).max(20),Y=e.enum(["input","output","expectedOutput","evaluatorContext"]),pe=e.object({destination:Y,path:de,source:Y,sourcePath:e.array(ee).max(20)}).strict(),_=e.array(pe).max(100).superRefine((t,n)=>{for(let[o,a]of t.entries())t.slice(0,o).some(i=>i.destination===a.destination&&(Z(i.path,a.path)||Z(a.path,i.path)))&&n.addIssue({code:"custom",path:[o,"path"],message:"Mapped destination paths must not overlap."})});function Z(t,n){return t.length<=n.length&&t.every((o,a)=>o===n[a])}l(Z,"prefix");var m=e.string().trim().min(1).max(200),x=e.string().regex(/^[a-f0-9]{64}$/),M=e.object({id:m,revision:e.number().int().positive(),contentHash:x}).strict(),v=e.object({id:m,version:e.string().min(1).max(200),contentHash:x,name:e.string().trim().min(1).max(500).optional(),feedbackKey:G,release:M.nullable(),mappings:_.optional()}).strict(),q=e.object({id:m,version:e.string().min(1).max(200),contentHash:x,mappings:_}).strict(),It=e.object({operationId:m,id:m.optional(),expectedRevision:e.number().int().nonnegative(),request:g,maximumCostUsd:e.number().finite().positive().max(1e4),graders:e.array(q).min(1).max(100).optional()}).strict().superRefine((t,n)=>{t.request.name||n.addIssue({code:"custom",path:["request","name"],message:"Name this Experiment before saving it."}),!!t.id!=t.expectedRevision>0&&n.addIssue({code:"custom",path:["expectedRevision"],message:"An update requires its saved definition revision."}),Math.round(t.maximumCostUsd*1e6)<1&&n.addIssue({code:"custom",path:["maximumCostUsd"],message:"The budget must be at least $0.000001."}),t.graders&&new Set(t.graders.map(o=>o.id)).size!==t.graders.length&&n.addIssue({code:"custom",path:["graders"],message:"Select each grader once."})}),le=e.object({schemaVersion:e.literal("openpond.experimentDefinition.v1"),id:m,teamId:m,revision:e.number().int().positive(),request:g,maximumCostUsd:e.number().finite().positive().max(1e4),graders:e.array(v).min(1).max(100),createdAt:e.iso.datetime(),updatedAt:e.iso.datetime()}).strict(),kt=le.extend({contentHash:x}),Rt=e.object({operationId:m,definition:M}).strict(),Et=e.object({projectId:m.optional(),datasetHash:x.optional(),search:e.string().trim().max(200).optional(),status:e.enum(["queued","running","cancelling","completed","failed","cancelled"]).optional(),afterId:m.optional(),limit:e.number().int().min(1).max(100).default(30)}).strict(),wt=e.object({definition:M.nullable(),configurationHash:x.optional(),admissionRequestHash:x.optional(),sourceExperimentId:m.optional(),maximumCostUsd:e.number().finite().positive().max(1e4),graders:e.array(v).min(1).max(100)}).strict().superRefine((t,n)=>{t.definition===null&&(!t.configurationHash||!t.admissionRequestHash)&&n.addIssue({code:"custom",path:["configurationHash"],message:"A flat Experiment requires its sealed configuration hash."})}),Ht=e.object({operationId:m,profileRepositoryId:m,definitionId:m,modelId:m,localRuntime:f.shape.localRuntime,maxOutputTokens:f.shape.maxOutputTokens,temperature:f.shape.temperature,topP:f.shape.topP,reasoningEffort:e.enum(["off","low","medium","high","xhigh","max"]).optional(),maximumCostUsd:e.number().finite().positive().max(1e4),externalDatasetBinding:I.optional(),sourceCandidate:f.shape.sourceCandidate}).strict(),jt=e.object({request:g,manifest:R,maximumCostUsd:e.number().finite().positive().max(1e4),graders:e.array(v).min(1).max(100)}).strict();var te=e.string().trim().min(1).max(200),Mt=e.object({operationId:te,request:g,maximumCostUsd:e.number().finite().positive().max(1e4),graders:e.array(q).min(1).max(100).optional(),sourceExperimentId:te.optional()}).strict().superRefine((t,n)=>{t.request.name||n.addIssue({code:"custom",path:["request","name"],message:"Name this Experiment before starting it."}),t.operationId!==t.request.operationId&&n.addIssue({code:"custom",path:["request","operationId"],message:"Use one operation identity for this Experiment."}),Math.round(t.maximumCostUsd*1e6)<1&&n.addIssue({code:"custom",path:["maximumCostUsd"],message:"The spending cap must be at least $0.000001."}),t.graders&&new Set(t.graders.map(o=>o.id)).size!==t.graders.length&&n.addIssue({code:"custom",path:["graders"],message:"Select each grader once."})});export{y as a,L as b,P as c,f as d,g as e,W as f,ce as g,mt as h,_ as i,v as j,q as k,kt as l,Et as m,wt as n,Ht as o,jt as p,Mt as q};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{a as t}from"./chunk-FTQLQJQV.js";import{AsyncLocalStorage as r}from"node:async_hooks";var n=new r;function c(e,i){return n.run(e,i)}t(c,"withApiClientIdentity");function u(){return n.getStore()}t(u,"apiClientIdentity");export{c as a,u as b};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{q as b}from"./chunk-YI6ME6PU.js";import{a as l}from"./chunk-DRLP7GIU.js";import{m as h}from"./chunk-HIQPGYVH.js";import{a as I,f as u}from"./chunk-AMC4Z7G4.js";import{j as m,k as f,m as v}from"./chunk-I6VMRQF4.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as g}from"./chunk-FTQLQJQV.js";var t=e.string().trim().min(1).max(500),n=e.string().regex(/^[a-f0-9]{64}$/),P=e.object({teamId:t,ownerUserId:t}).strict(),S=e.object({id:t,snapshotHash:n,boundaryId:t,boundaryRevisionHash:n}).strict(),E=e.object({sourceId:t,source:f,sessionId:t,snapshotHash:n,title:e.string().max(500),projectId:t.nullable(),capturedAt:e.string().datetime(),boundaries:e.array(v.omit({start:!0,end:!0})).max(m.boundaries)}).strict(),T=e.object({operationId:t,conversationId:t.optional(),cursor:t.optional(),limit:e.number().int().min(1).max(50).default(20)}).strict(),x=e.object({hash:n,parts:e.number().int().min(1).max(1500)}).strict(),U=x.extend({index:e.number().int().nonnegative().max(1499),base64:e.string().max(35e4)}).strict(),q=e.object({path:e.string().min(1).max(500),encoding:e.enum(["utf8","zstd"]),base64:e.string()}).strict(),w=e.object({upload:x,source:e.enum(["codex","claude_code","hermes","openclaw","opencode","grok_build","pi","oh_my_pi"]),branchLeafId:t.optional(),acquisition:e.object({machineId:t,sourceInstanceId:t}).strict().optional(),destination:e.discriminatedUnion("kind",[e.object({kind:e.literal("existing"),projectId:t}).strict(),e.object({kind:e.literal("new"),name:e.string().trim().min(1).max(200)}).strict()])}).strict(),V=w.extend({operationId:t,previewHash:n,selection:e.array(e.object({sessionHash:n,boundaryIds:e.array(t).min(1).max(m.boundaries)}).strict()).min(1).max(m.sessions)}).strict(),y=e.object({from:e.string().datetime(),to:e.string().datetime(),projectId:t.optional()}).strict(),_=e.object({teamId:t,range:y,activity:e.object({conversations:e.number().int().nonnegative(),turns:e.number().int().nonnegative(),chatTurns:e.number().int().nonnegative(),workTurns:e.number().int().nonnegative()}).strict(),accounting:e.object({contextSnapshots:e.number().int().nonnegative()}).strict(),usage:I}).strict(),r=e.string().trim().min(1).max(240),c=e.string().regex(/^[a-f0-9]{64}$/),L=e.object({cursor:e.string().trim().min(1).max(2e3).optional(),projectId:r.optional(),search:e.string().trim().max(100).optional(),sort:e.enum(["id","name","updated"]).default("id"),limit:e.number().int().min(1).max(100).default(100)}).strict(),B=e.object({operationId:r,expectedRevision:e.number().int().nonnegative(),originProjectId:r.optional(),workspace:b,ownerScope:e.enum(["workspace","personal"]).optional()}).strict().superRefine((a,s)=>{a.workspace.draft.modelScope!==null&&s.addIssue({code:"custom",message:"Independent datasets cannot carry Model-owned draft preparation."}),a.workspace.draft.status!=="draft"&&s.addIssue({code:"custom",message:"Only draft workspaces can be saved."})}),j=e.object({schemaVersion:e.literal("openpond.datasetWorkspaceReceipt.v1"),teamId:r,datasetId:r,revision:e.number().int().positive(),originProjectId:r.optional(),workspace:b,ownerScope:e.enum(["workspace","personal"]).optional(),publication:e.object({tasksetId:r,release:l,packageHash:c}).strict().nullable()}).strict().superRefine((a,s)=>{(a.workspace.draft.id!==a.datasetId||a.workspace.draft.profileId!==a.teamId||a.workspace.draft.revision!==a.revision||a.workspace.draft.modelScope!==null)&&s.addIssue({code:"custom",message:"Dataset workspace scope/revision mismatch."})}),N=e.object({operationId:r,expectedRevision:e.number().int().positive(),workspaceHash:c,packageHash:c}).strict(),O=e.object({operationId:r,expectedRevision:e.number().int().positive()}).strict(),Q=e.object({teamId:r,datasetId:r,items:e.array(e.object({workspaceRevision:e.number().int().positive(),publication:j.shape.publication.unwrap(),publishedAt:e.iso.datetime()}).strict()).max(25),nextBeforeRevision:e.number().int().positive().nullable()}).strict(),F=e.object({teamId:r,datasets:e.array(e.object({id:r,revision:e.number().int().positive(),originProjectId:r.optional(),name:e.string(),status:e.enum(["draft","published"]),ownerScope:e.enum(["workspace","personal"]).optional(),taskCount:e.number().int().nonnegative().optional(),publication:j.shape.publication,updatedAt:e.string().datetime()}).strict()).max(100),nextCursor:e.string().trim().min(1).max(2e3).nullable()}).strict(),M=e.object({teamId:r,datasetId:r,revision:e.number().int().positive(),workspaceHash:c,packageHash:c,release:l}).strict(),i=e.string().trim().min(1).max(240),o=e.string().regex(/^[a-f0-9]{64}$/),K=e.object({operationId:i,source:S,proofs:e.array(u).min(1).max(100)}).strict().superRefine((a,s)=>{new Set(a.proofs.map(d=>d.path)).size!==a.proofs.length&&s.addIssue({code:"custom",message:"Select each starting path once."}),new TextEncoder().encode(JSON.stringify(a)).byteLength>15*1024*1024&&s.addIssue({code:"custom",message:"Starting assets exceed the retained upload allowance."})}),C=e.object({path:u.shape.path,commitHash:e.string().regex(/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/),gitObjectHash:e.string().regex(/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/),mode:e.enum(["100644","100755"]),sizeBytes:e.number().int().nonnegative().max(2*1024*1024),sha256:o}).strict(),H=e.object({schemaVersion:e.literal("openpond.connectedStartingAssetsReceipt.v1"),id:i,operationId:i,teamId:i,ownerUserId:i,projectId:i,requestHash:o,source:S,inputHash:o,observationHash:o,assets:e.array(C).min(1).max(100),selectedPathsUnmodified:e.literal(!0),dependencyClosureQualified:e.literal(!1),createdAt:e.iso.datetime(),receiptHash:o}).strict();function X(a){let s=H.parse(a),{receiptHash:d,...k}=s;if(h(k)!==d||s.id!==`starting-assets-${h(s.operationId).slice(0,40)}`||new Set(s.assets.map(p=>p.path)).size!==s.assets.length||s.assets.some(p=>p.commitHash!==s.assets[0].commitHash))throw new Error("Connected starting assets receipt identity differs from its retained evidence.");return s}g(X,"verifyConnectedStartingAssetsReceipt");export{S as a,E as b,T as c,U as d,w as e,V as f,L as g,B as h,j as i,N as j,O as k,Q as l,F as m,M as n,K as o,C as p,X as q};
2
+ import{q as b}from"./chunk-GG6PM7TB.js";import{a as l}from"./chunk-2GEZ3ZY7.js";import{m as h}from"./chunk-HIQPGYVH.js";import{a as I,f as u}from"./chunk-AMC4Z7G4.js";import{j as m,k as f,m as v}from"./chunk-I6VMRQF4.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as g}from"./chunk-FTQLQJQV.js";var t=e.string().trim().min(1).max(500),n=e.string().regex(/^[a-f0-9]{64}$/),P=e.object({teamId:t,ownerUserId:t}).strict(),S=e.object({id:t,snapshotHash:n,boundaryId:t,boundaryRevisionHash:n}).strict(),E=e.object({sourceId:t,source:f,sessionId:t,snapshotHash:n,title:e.string().max(500),projectId:t.nullable(),capturedAt:e.string().datetime(),boundaries:e.array(v.omit({start:!0,end:!0})).max(m.boundaries)}).strict(),T=e.object({operationId:t,conversationId:t.optional(),cursor:t.optional(),limit:e.number().int().min(1).max(50).default(20)}).strict(),x=e.object({hash:n,parts:e.number().int().min(1).max(1500)}).strict(),U=x.extend({index:e.number().int().nonnegative().max(1499),base64:e.string().max(35e4)}).strict(),q=e.object({path:e.string().min(1).max(500),encoding:e.enum(["utf8","zstd"]),base64:e.string()}).strict(),w=e.object({upload:x,source:e.enum(["codex","claude_code","hermes","openclaw","opencode","grok_build","pi","oh_my_pi"]),branchLeafId:t.optional(),acquisition:e.object({machineId:t,sourceInstanceId:t}).strict().optional(),destination:e.discriminatedUnion("kind",[e.object({kind:e.literal("existing"),projectId:t}).strict(),e.object({kind:e.literal("new"),name:e.string().trim().min(1).max(200)}).strict()])}).strict(),V=w.extend({operationId:t,previewHash:n,selection:e.array(e.object({sessionHash:n,boundaryIds:e.array(t).min(1).max(m.boundaries)}).strict()).min(1).max(m.sessions)}).strict(),y=e.object({from:e.string().datetime(),to:e.string().datetime(),projectId:t.optional()}).strict(),_=e.object({teamId:t,range:y,activity:e.object({conversations:e.number().int().nonnegative(),turns:e.number().int().nonnegative(),chatTurns:e.number().int().nonnegative(),workTurns:e.number().int().nonnegative()}).strict(),accounting:e.object({contextSnapshots:e.number().int().nonnegative()}).strict(),usage:I}).strict(),r=e.string().trim().min(1).max(240),c=e.string().regex(/^[a-f0-9]{64}$/),L=e.object({cursor:e.string().trim().min(1).max(2e3).optional(),projectId:r.optional(),search:e.string().trim().max(100).optional(),sort:e.enum(["id","name","updated"]).default("id"),limit:e.number().int().min(1).max(100).default(100)}).strict(),B=e.object({operationId:r,expectedRevision:e.number().int().nonnegative(),originProjectId:r.optional(),workspace:b,ownerScope:e.enum(["workspace","personal"]).optional()}).strict().superRefine((a,s)=>{a.workspace.draft.modelScope!==null&&s.addIssue({code:"custom",message:"Independent datasets cannot carry Model-owned draft preparation."}),a.workspace.draft.status!=="draft"&&s.addIssue({code:"custom",message:"Only draft workspaces can be saved."})}),j=e.object({schemaVersion:e.literal("openpond.datasetWorkspaceReceipt.v1"),teamId:r,datasetId:r,revision:e.number().int().positive(),originProjectId:r.optional(),workspace:b,ownerScope:e.enum(["workspace","personal"]).optional(),publication:e.object({tasksetId:r,release:l,packageHash:c}).strict().nullable()}).strict().superRefine((a,s)=>{(a.workspace.draft.id!==a.datasetId||a.workspace.draft.profileId!==a.teamId||a.workspace.draft.revision!==a.revision||a.workspace.draft.modelScope!==null)&&s.addIssue({code:"custom",message:"Dataset workspace scope/revision mismatch."})}),N=e.object({operationId:r,expectedRevision:e.number().int().positive(),workspaceHash:c,packageHash:c}).strict(),O=e.object({operationId:r,expectedRevision:e.number().int().positive()}).strict(),Q=e.object({teamId:r,datasetId:r,items:e.array(e.object({workspaceRevision:e.number().int().positive(),publication:j.shape.publication.unwrap(),publishedAt:e.iso.datetime()}).strict()).max(25),nextBeforeRevision:e.number().int().positive().nullable()}).strict(),F=e.object({teamId:r,datasets:e.array(e.object({id:r,revision:e.number().int().positive(),originProjectId:r.optional(),name:e.string(),status:e.enum(["draft","published"]),ownerScope:e.enum(["workspace","personal"]).optional(),taskCount:e.number().int().nonnegative().optional(),publication:j.shape.publication,updatedAt:e.string().datetime()}).strict()).max(100),nextCursor:e.string().trim().min(1).max(2e3).nullable()}).strict(),M=e.object({teamId:r,datasetId:r,revision:e.number().int().positive(),workspaceHash:c,packageHash:c,release:l}).strict(),i=e.string().trim().min(1).max(240),o=e.string().regex(/^[a-f0-9]{64}$/),K=e.object({operationId:i,source:S,proofs:e.array(u).min(1).max(100)}).strict().superRefine((a,s)=>{new Set(a.proofs.map(d=>d.path)).size!==a.proofs.length&&s.addIssue({code:"custom",message:"Select each starting path once."}),new TextEncoder().encode(JSON.stringify(a)).byteLength>15*1024*1024&&s.addIssue({code:"custom",message:"Starting assets exceed the retained upload allowance."})}),C=e.object({path:u.shape.path,commitHash:e.string().regex(/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/),gitObjectHash:e.string().regex(/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/),mode:e.enum(["100644","100755"]),sizeBytes:e.number().int().nonnegative().max(2*1024*1024),sha256:o}).strict(),H=e.object({schemaVersion:e.literal("openpond.connectedStartingAssetsReceipt.v1"),id:i,operationId:i,teamId:i,ownerUserId:i,projectId:i,requestHash:o,source:S,inputHash:o,observationHash:o,assets:e.array(C).min(1).max(100),selectedPathsUnmodified:e.literal(!0),dependencyClosureQualified:e.literal(!1),createdAt:e.iso.datetime(),receiptHash:o}).strict();function X(a){let s=H.parse(a),{receiptHash:d,...k}=s;if(h(k)!==d||s.id!==`starting-assets-${h(s.operationId).slice(0,40)}`||new Set(s.assets.map(p=>p.path)).size!==s.assets.length||s.assets.some(p=>p.commitHash!==s.assets[0].commitHash))throw new Error("Connected starting assets receipt identity differs from its retained evidence.");return s}g(X,"verifyConnectedStartingAssetsReceipt");export{S as a,E as b,T as c,U as d,w as e,V as f,L as g,B as h,j as i,N as j,O as k,Q as l,F as m,M as n,K as o,C as p,X as q};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{a as o}from"./chunk-FTQLQJQV.js";var c=o((e,n)=>{let s=new Headers(e instanceof Request?e.headers:void 0);return new Headers(n?.headers).forEach((t,d)=>s.set(d,t)),s.set("x-openpond-client","openpond-cli"),fetch(e,{...n,headers:s})},"hostedCliFetch");export{c as a};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as k}from"./chunk-65WRWLUD.js";import{a as S}from"./chunk-VFH5C6D2.js";import{a as u,d}from"./chunk-EYTTZ5H4.js";import{i as R,j as h}from"./chunk-DKOVZ6R2.js";import{f as m,g}from"./chunk-ZY32SZ2P.js";import{n as P}from"./chunk-RCT3O3HQ.js";import{a}from"./chunk-FTQLQJQV.js";async function H(e){if(!e.repositoryId.trim())throw new Error("Explicit Profile source requires a repository ID.");let o=await h(e),n=await e.store.getHarnessWorkspace(e.workspaceId);if(n){let s=n.currentChannel.release;if(n.ownerScope.kind!=="personal"||n.ownerScope.id!==e.ownerId||n.sourceRevision!==o.sourceRevision||s?.id!==o.harnessRelease.id||s.contentHash!==o.harnessRelease.contentHash)throw new Error("Explicit Profile source changed under its accepted revision.");let i=await e.store.getHarnessReleaseRecord(s.contentHash);if(!i)throw new Error("Explicit Profile source release is missing after restore.");return i}let r=await R({...e,id:e.workspaceId,selectionEligible:!1});if(r.release.harnessRelease.contentHash!==o.harnessRelease.contentHash||r.workspace.sourceRevision!==o.sourceRevision)throw new Error("Explicit Profile source changed during import.");return r.release}a(H,"ensureExplicitProfileHarnessSource");import{promises as w}from"node:fs";import c from"node:path";var y=new WeakMap;async function N(e){let{profile:o,ref:n}=e;if(o.mode!=="local"||!o.sourcePath||o.error||o.activeProfile!==n.profileId||!o.git?.head||o.git.dirty)throw new Error("Select a clean, committed Profile before loading its workflows.");let r=`${S}${P({ref:n,sourceRevision:o.git.head}).slice(0,24)}`,s=y.get(e.store);s||(s=new Map,y.set(e.store,s));let i=s.get(r);if(i)return i;let t=I({...e,workspaceId:r});s.set(r,t);try{return await t}finally{s.delete(r)}}a(N,"ensureLocalProfileWorkflows");async function I(e){let o=e.profile.git.head,n=await H({store:e.store,storeDir:e.storeDir,workspaceId:e.workspaceId,ownerId:u,name:e.profile.activeProfile,profile:e.profile,sourceRevision:o,repositoryId:e.ref.repositoryId}),r=await W({store:e.store,release:n,ref:e.ref,sourceRevision:o});if(e.reloadProfile){let s=await e.reloadProfile();if(s.git?.head!==o||s.git.dirty)throw new Error("Profile source changed during workflow loading; retry from its committed revision.")}return r}a(I,"loadProfileWorkflows");async function W(e){let o={id:e.release.harnessRelease.id,contentHash:e.release.harnessRelease.contentHash};if(!e.release.harnessRelease.files.some(t=>t.path==="workflows/catalog.json"))return{profileRef:e.ref,sourceRevision:e.sourceRevision,harnessRelease:o,workflows:[]};let{runtime:n,catalog:r,catalogHash:s}=await p(e.store,o),i=n.release.harnessRelease.metadata.profile;if(!i||typeof i!="object"||i.id!==e.ref.profileId||i.sourceRevision!==e.sourceRevision)throw new Error("Selected Profile workflow release differs from its accepted source.");return{profileRef:e.ref,sourceRevision:e.sourceRevision,harnessRelease:o,workflows:r.workflows.map(t=>({workflow:t,binding:{schemaVersion:"openpond.profileWorkflowBinding.v1",profileId:e.ref.profileId,sourceRevision:e.sourceRevision,harnessRelease:o,catalogHash:s,workflowId:t.id}}))}}a(W,"profileWorkflowsForRelease");async function T(e,o){if(o.profileComponentBinding){if(o.profileWorkflowBinding||o.currentProfile?.profileId!==o.profileComponentBinding.profileId)throw new Error("Profile component binding differs from the session Profile reference.");return E({store:e,binding:o.profileComponentBinding})}if(!o.profileWorkflowBinding)return k(e,o.id);if(o.currentProfile?.profileId!==o.profileWorkflowBinding.profileId)throw new Error("Profile workflow binding differs from the session Profile reference.");let{runtime:n,workflow:r,action:s}=await b({store:e,binding:o.profileWorkflowBinding});return{...n,workflow:r,...s?{workflowAction:s}:{}}}a(T,"loadLocalHarnessRuntimeForSession");async function E(e){let{binding:o,store:n}=e,r=await d(n,o.harnessRelease);if(!r)throw new Error("The bound Profile component Harness release is unavailable.");let s=r.release.harnessRelease.metadata.profile;if(!s||typeof s!="object"||s.id!==o.profileId||s.sourceRevision!==o.sourceRevision)throw new Error("Profile component binding differs from its released source.");let i=o.target;if(i.kind==="profile")return r;if(i.kind==="skill"){if(!r.release.agentSnapshot?.skills.some(v=>v.path===i.skillPath)||!r.release.bundlePath)throw new Error("Bound Profile Skill is unavailable in its released source.");let f=await w.readFile(c.join(r.release.bundlePath,"source",i.skillPath),"utf8");return{...r,instructionContext:[r.instructionContext,`Released Profile Skill (${i.skillPath}):
2
+ import{a as k}from"./chunk-JVEIK4RH.js";import{a as S}from"./chunk-VFH5C6D2.js";import{a as u,d}from"./chunk-XLZMSD5K.js";import{i as R,j as h}from"./chunk-BQNU4HZW.js";import{f as m,g}from"./chunk-ZY32SZ2P.js";import{n as P}from"./chunk-RCT3O3HQ.js";import{a}from"./chunk-FTQLQJQV.js";async function H(e){if(!e.repositoryId.trim())throw new Error("Explicit Profile source requires a repository ID.");let o=await h(e),n=await e.store.getHarnessWorkspace(e.workspaceId);if(n){let s=n.currentChannel.release;if(n.ownerScope.kind!=="personal"||n.ownerScope.id!==e.ownerId||n.sourceRevision!==o.sourceRevision||s?.id!==o.harnessRelease.id||s.contentHash!==o.harnessRelease.contentHash)throw new Error("Explicit Profile source changed under its accepted revision.");let i=await e.store.getHarnessReleaseRecord(s.contentHash);if(!i)throw new Error("Explicit Profile source release is missing after restore.");return i}let r=await R({...e,id:e.workspaceId,selectionEligible:!1});if(r.release.harnessRelease.contentHash!==o.harnessRelease.contentHash||r.workspace.sourceRevision!==o.sourceRevision)throw new Error("Explicit Profile source changed during import.");return r.release}a(H,"ensureExplicitProfileHarnessSource");import{promises as w}from"node:fs";import c from"node:path";var y=new WeakMap;async function N(e){let{profile:o,ref:n}=e;if(o.mode!=="local"||!o.sourcePath||o.error||o.activeProfile!==n.profileId||!o.git?.head||o.git.dirty)throw new Error("Select a clean, committed Profile before loading its workflows.");let r=`${S}${P({ref:n,sourceRevision:o.git.head}).slice(0,24)}`,s=y.get(e.store);s||(s=new Map,y.set(e.store,s));let i=s.get(r);if(i)return i;let t=I({...e,workspaceId:r});s.set(r,t);try{return await t}finally{s.delete(r)}}a(N,"ensureLocalProfileWorkflows");async function I(e){let o=e.profile.git.head,n=await H({store:e.store,storeDir:e.storeDir,workspaceId:e.workspaceId,ownerId:u,name:e.profile.activeProfile,profile:e.profile,sourceRevision:o,repositoryId:e.ref.repositoryId}),r=await W({store:e.store,release:n,ref:e.ref,sourceRevision:o});if(e.reloadProfile){let s=await e.reloadProfile();if(s.git?.head!==o||s.git.dirty)throw new Error("Profile source changed during workflow loading; retry from its committed revision.")}return r}a(I,"loadProfileWorkflows");async function W(e){let o={id:e.release.harnessRelease.id,contentHash:e.release.harnessRelease.contentHash};if(!e.release.harnessRelease.files.some(t=>t.path==="workflows/catalog.json"))return{profileRef:e.ref,sourceRevision:e.sourceRevision,harnessRelease:o,workflows:[]};let{runtime:n,catalog:r,catalogHash:s}=await p(e.store,o),i=n.release.harnessRelease.metadata.profile;if(!i||typeof i!="object"||i.id!==e.ref.profileId||i.sourceRevision!==e.sourceRevision)throw new Error("Selected Profile workflow release differs from its accepted source.");return{profileRef:e.ref,sourceRevision:e.sourceRevision,harnessRelease:o,workflows:r.workflows.map(t=>({workflow:t,binding:{schemaVersion:"openpond.profileWorkflowBinding.v1",profileId:e.ref.profileId,sourceRevision:e.sourceRevision,harnessRelease:o,catalogHash:s,workflowId:t.id}}))}}a(W,"profileWorkflowsForRelease");async function T(e,o){if(o.profileComponentBinding){if(o.profileWorkflowBinding||o.currentProfile?.profileId!==o.profileComponentBinding.profileId)throw new Error("Profile component binding differs from the session Profile reference.");return E({store:e,binding:o.profileComponentBinding})}if(!o.profileWorkflowBinding)return k(e,o.id);if(o.currentProfile?.profileId!==o.profileWorkflowBinding.profileId)throw new Error("Profile workflow binding differs from the session Profile reference.");let{runtime:n,workflow:r,action:s}=await b({store:e,binding:o.profileWorkflowBinding});return{...n,workflow:r,...s?{workflowAction:s}:{}}}a(T,"loadLocalHarnessRuntimeForSession");async function E(e){let{binding:o,store:n}=e,r=await d(n,o.harnessRelease);if(!r)throw new Error("The bound Profile component Harness release is unavailable.");let s=r.release.harnessRelease.metadata.profile;if(!s||typeof s!="object"||s.id!==o.profileId||s.sourceRevision!==o.sourceRevision)throw new Error("Profile component binding differs from its released source.");let i=o.target;if(i.kind==="profile")return r;if(i.kind==="skill"){if(!r.release.agentSnapshot?.skills.some(v=>v.path===i.skillPath)||!r.release.bundlePath)throw new Error("Bound Profile Skill is unavailable in its released source.");let f=await w.readFile(c.join(r.release.bundlePath,"source",i.skillPath),"utf8");return{...r,instructionContext:[r.instructionContext,`Released Profile Skill (${i.skillPath}):
3
3
  ${f}`].join(`
4
4
 
5
5
  `)}}let l=(await p(n,o.harnessRelease)).actions.find(f=>f.id===i.actionId);if(!l)throw new Error("Bound Profile Agent action is unavailable in its released source.");return{...r,workflowAction:l}}a(E,"loadLocalProfileComponentRuntime");async function b(e){let{runtime:o,catalog:n,catalogHash:r,actions:s}=await p(e.store,e.binding.harnessRelease),i=g({binding:e.binding,harnessRelease:o.release.harnessRelease,catalog:n,catalogHash:r}),t=i.invocation.kind==="agent_action"?i.invocation.actionId:null,l=t?s.find(f=>f.id===t):void 0;if(t&&!l)throw new Error(`Bound Profile action ${t} is missing from its release.`);return{runtime:o,workflow:i,...l?{action:l}:{}}}a(b,"loadLocalProfileWorkflowRuntime");async function p(e,o){let n=await d(e,o);if(!n)throw new Error("The bound Profile workflow Harness release is unavailable.");let r=c.join(n.release.bundlePath,"source"),[s,i]=await Promise.all([w.readFile(c.join(r,"workflows","catalog.json")),w.readFile(c.join(r,"workflows","actions.json"))]),{catalog:t,catalogHash:l,actions:f}=m({agentSnapshot:n.release.agentSnapshot,harnessRelease:n.release.harnessRelease,catalogBytes:s,actionBytes:i});return{runtime:n,catalog:t,catalogHash:l,actions:f}}a(p,"loadLocalProfileWorkflowCatalog");export{H as a,N as b,W as c,T as d};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{d as c,e as i}from"./chunk-EYTTZ5H4.js";import{j as l}from"./chunk-LE75SVEL.js";import{n as o}from"./chunk-RCT3O3HQ.js";import{a as n}from"./chunk-FTQLQJQV.js";async function u(e,s){let a=await e.getHarnessRunOverlay(s);if(!a)return c(e);let t=await e.getHarnessWorkspace(a.workspace.workspaceId),r=await e.getHarnessReleaseRecord(a.baseHarnessRelease.contentHash);if(!t||!r||r.harnessRelease.id!==a.baseHarnessRelease.id)throw new Error("Durable Agent run overlay references an unavailable Harness release.");return i({workspace:t,release:r})}n(u,"loadLocalHarnessRuntimeForAgentRun");async function m(e){let s=await e.store.getHarnessRunOverlay(e.runId);if(s){if(s.workspace.workspaceId!==e.workspace.id||s.baseHarnessRelease.id!==e.harnessRelease.id||s.baseHarnessRelease.contentHash!==e.harnessRelease.contentHash)throw new Error("The durable Agent run is already bound to a different Harness release; start a fresh run or explicitly rebase its overlay.");return s}let a=l({schemaVersion:"openpond.harnessRunOverlay.v1",id:`overlay-${o({runId:e.runId,harnessRelease:e.harnessRelease}).slice(0,24)}`,runId:e.runId,baseHarnessRelease:e.harnessRelease,workspace:{workspaceId:e.workspace.id,revision:e.workspace.revision,sourceRevision:e.workspace.sourceRevision,channelRevision:e.workspace.currentChannel.revision},revision:0,status:"active",edits:[],createdAt:e.admittedAt,updatedAt:e.admittedAt,metadata:{}});return e.store.createHarnessRunOverlay(a)}n(m,"ensureLocalHarnessRunOverlay");export{u as a,m as b};
2
+ import{d as c,e as i}from"./chunk-XLZMSD5K.js";import{j as l}from"./chunk-LE75SVEL.js";import{n as o}from"./chunk-RCT3O3HQ.js";import{a as n}from"./chunk-FTQLQJQV.js";async function u(e,s){let a=await e.getHarnessRunOverlay(s);if(!a)return c(e);let t=await e.getHarnessWorkspace(a.workspace.workspaceId),r=await e.getHarnessReleaseRecord(a.baseHarnessRelease.contentHash);if(!t||!r||r.harnessRelease.id!==a.baseHarnessRelease.id)throw new Error("Durable Agent run overlay references an unavailable Harness release.");return i({workspace:t,release:r})}n(u,"loadLocalHarnessRuntimeForAgentRun");async function m(e){let s=await e.store.getHarnessRunOverlay(e.runId);if(s){if(s.workspace.workspaceId!==e.workspace.id||s.baseHarnessRelease.id!==e.harnessRelease.id||s.baseHarnessRelease.contentHash!==e.harnessRelease.contentHash)throw new Error("The durable Agent run is already bound to a different Harness release; start a fresh run or explicitly rebase its overlay.");return s}let a=l({schemaVersion:"openpond.harnessRunOverlay.v1",id:`overlay-${o({runId:e.runId,harnessRelease:e.harnessRelease}).slice(0,24)}`,runId:e.runId,baseHarnessRelease:e.harnessRelease,workspace:{workspaceId:e.workspace.id,revision:e.workspace.revision,sourceRevision:e.workspace.sourceRevision,channelRevision:e.workspace.currentChannel.revision},revision:0,status:"active",edits:[],createdAt:e.admittedAt,updatedAt:e.admittedAt,metadata:{}});return e.store.createHarnessRunOverlay(a)}n(m,"ensureLocalHarnessRunOverlay");export{u as a,m as b};