openpond 0.2.70 → 0.2.72

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 (361) hide show
  1. package/dist/app-server.js +1 -1
  2. package/dist/chunks/{acp-QTA6IU6W.js → acp-7A2UPCG5.js} +1 -1
  3. package/dist/chunks/{acp-agent-N77HPAYQ.js → acp-agent-AGALGR6V.js} +1 -1
  4. package/dist/chunks/{actions-command-BZQCUDMD.js → actions-command-AXGXBU75.js} +1 -1
  5. package/dist/chunks/{app-layer-YQQNLIXA.js → app-layer-DUCNCJ2X.js} +1 -1
  6. package/dist/chunks/{app-server-evaluations-RRLYWLPK.js → app-server-evaluations-SNWXULKD.js} +1 -1
  7. package/dist/chunks/{app-server-harness-services-XXM336NU.js → app-server-harness-services-YNMGMKPK.js} +1 -1
  8. package/dist/chunks/app-server-runtime-BKJ7L6JZ.js +2 -0
  9. package/dist/chunks/{apps-WG7WY5CB.js → apps-2OWE23BH.js} +1 -1
  10. package/dist/chunks/{chunk-ZDEIVUUI.js → chunk-27OJ2OLP.js} +1 -1
  11. package/dist/chunks/{chunk-NSSZ2ZIU.js → chunk-2EAZB2MW.js} +1 -1
  12. package/dist/chunks/{chunk-DRLP7GIU.js → chunk-2GEZ3ZY7.js} +1 -1
  13. package/dist/chunks/{chunk-PAYFJHPO.js → chunk-2PVW2XFF.js} +1 -1
  14. package/dist/chunks/chunk-2Q2AWPP2.js +2 -0
  15. package/dist/chunks/{chunk-Y2WNZWT2.js → chunk-2Q6FTL4C.js} +1 -1
  16. package/dist/chunks/{chunk-KP2MYTP5.js → chunk-2QHB5P2K.js} +1 -1
  17. package/dist/chunks/{chunk-HG2YFMVU.js → chunk-2THZ6GZY.js} +1 -1
  18. package/dist/chunks/{chunk-DXJC3QW7.js → chunk-3VT2PPKW.js} +1 -1
  19. package/dist/chunks/{chunk-4BUM6JEC.js → chunk-4JKWCLTQ.js} +1 -1
  20. package/dist/chunks/{chunk-AQUZCWM3.js → chunk-5TPJ5ECJ.js} +1 -1
  21. package/dist/chunks/{chunk-RCQYEHHD.js → chunk-5TTQCT3G.js} +1 -1
  22. package/dist/chunks/{chunk-NMMHXYDJ.js → chunk-5WFKBZCU.js} +1 -1
  23. package/dist/chunks/{chunk-P4QM63L3.js → chunk-5ZBDHIIE.js} +1 -1
  24. package/dist/chunks/{chunk-WD4KAKEX.js → chunk-64EDQ7UV.js} +1 -1
  25. package/dist/chunks/{chunk-KU4TPDPH.js → chunk-6LAGMWJE.js} +1 -1
  26. package/dist/chunks/{chunk-VJYOKU3C.js → chunk-6OD2FKUS.js} +1 -1
  27. package/dist/chunks/{chunk-65FJWWXG.js → chunk-6YR5IYHH.js} +1 -1
  28. package/dist/chunks/{chunk-AUO5DCEU.js → chunk-73COPJ32.js} +1 -1
  29. package/dist/chunks/{chunk-SSHE6B7Z.js → chunk-AITV76GO.js} +1 -1
  30. package/dist/chunks/{chunk-PLROXHG2.js → chunk-ATI52WMB.js} +1 -1
  31. package/dist/chunks/chunk-AWD72O3G.js +2 -0
  32. package/dist/chunks/{chunk-DKOVZ6R2.js → chunk-BQNU4HZW.js} +1 -1
  33. package/dist/chunks/{chunk-UANH7U3Y.js → chunk-BTEBZYK3.js} +1 -1
  34. package/dist/chunks/{chunk-3Z4VM2LF.js → chunk-BUMCJHQP.js} +1 -1
  35. package/dist/chunks/{chunk-BU6MW65V.js → chunk-BYVE4TMU.js} +1 -1
  36. package/dist/chunks/{chunk-PNPV2LDE.js → chunk-BZS2PA4O.js} +1 -1
  37. package/dist/chunks/{chunk-AFYYIJ6K.js → chunk-C7NQPICU.js} +1 -1
  38. package/dist/chunks/{chunk-EWH64WRR.js → chunk-CAYKEJJY.js} +1 -1
  39. package/dist/chunks/{chunk-K7KBFM2T.js → chunk-CBD554GZ.js} +1 -1
  40. package/dist/chunks/{chunk-7RJOCGQ6.js → chunk-CHRED2FK.js} +1 -1
  41. package/dist/chunks/{chunk-3A2Y7UK3.js → chunk-CQRA5TXF.js} +1 -1
  42. package/dist/chunks/{chunk-GYYJ47GX.js → chunk-CWE2N3JI.js} +1 -1
  43. package/dist/chunks/{chunk-ZYLLPRPU.js → chunk-CX4T7I47.js} +1 -1
  44. package/dist/chunks/{chunk-TAXCMCYZ.js → chunk-CX4U32VO.js} +4 -4
  45. package/dist/chunks/{chunk-7TM25J6S.js → chunk-DFSQ5HZ7.js} +2 -2
  46. package/dist/chunks/{chunk-2PXKSAG6.js → chunk-DLOJG7LP.js} +1 -1
  47. package/dist/chunks/{chunk-BGMAWETL.js → chunk-DNRC6TPJ.js} +1 -1
  48. package/dist/chunks/{chunk-5FSPDSAO.js → chunk-DUR32LJG.js} +1 -1
  49. package/dist/chunks/{chunk-FHDH4OUA.js → chunk-EHMA5XS7.js} +1 -1
  50. package/dist/chunks/{chunk-Z33RVGP6.js → chunk-ENY24ZBB.js} +1 -1
  51. package/dist/chunks/{chunk-JVNKSU27.js → chunk-F3IEAU7O.js} +1 -1
  52. package/dist/chunks/{chunk-M4A7G4S5.js → chunk-FOAM3YZQ.js} +1 -1
  53. package/dist/chunks/{chunk-VJR2GNRY.js → chunk-FVMTQSVW.js} +1 -1
  54. package/dist/chunks/{chunk-YI6ME6PU.js → chunk-GG6PM7TB.js} +1 -1
  55. package/dist/chunks/{chunk-DDOIPTOM.js → chunk-GMA365GI.js} +1 -1
  56. package/dist/chunks/{chunk-KCLMA2IH.js → chunk-GPGXBKXU.js} +1 -1
  57. package/dist/chunks/{chunk-JVMSN7LH.js → chunk-GR4MJJCE.js} +1 -1
  58. package/dist/chunks/{chunk-7OFD6TFD.js → chunk-HA762QYM.js} +1 -1
  59. package/dist/chunks/{chunk-Q7FBVLLB.js → chunk-HBGTHOOB.js} +1 -1
  60. package/dist/chunks/{chunk-AFH462DO.js → chunk-HT6ILPD6.js} +1 -1
  61. package/dist/chunks/{chunk-XYZV3FKD.js → chunk-I6KTJ3GH.js} +1 -1
  62. package/dist/chunks/{chunk-OUJ63LMU.js → chunk-IA6CTX7A.js} +1 -1
  63. package/dist/chunks/{chunk-XHACK2KR.js → chunk-IUYGQO2K.js} +1 -1
  64. package/dist/chunks/{chunk-55YD4UTW.js → chunk-IV2HEX3I.js} +1 -1
  65. package/dist/chunks/{chunk-MOXIGLN2.js → chunk-JALL5NPH.js} +1 -1
  66. package/dist/chunks/{chunk-U7X5ZLAL.js → chunk-JCHLDNCX.js} +1 -1
  67. package/dist/chunks/{chunk-7PKDJHT6.js → chunk-JH4RACOB.js} +1 -1
  68. package/dist/chunks/{chunk-MIFVX5PK.js → chunk-JSDGOQ5U.js} +1 -1
  69. package/dist/chunks/{chunk-65WRWLUD.js → chunk-JVEIK4RH.js} +1 -1
  70. package/dist/chunks/{chunk-PPF6EBTQ.js → chunk-K3WM4NEC.js} +1 -1
  71. package/dist/chunks/{chunk-CCZ276IA.js → chunk-KOIXRLZZ.js} +1 -1
  72. package/dist/chunks/{chunk-6C6ZCYTL.js → chunk-KRJZ5CW3.js} +1 -1
  73. package/dist/chunks/{chunk-CUB6PWAJ.js → chunk-KTQWWCP2.js} +6 -6
  74. package/dist/chunks/{chunk-Y4E5AAI7.js → chunk-KUEVP7WM.js} +1 -1
  75. package/dist/chunks/{chunk-U7D6Q744.js → chunk-L5L3H6CI.js} +1 -1
  76. package/dist/chunks/{chunk-VWWKWYSQ.js → chunk-LHTRQAPZ.js} +1 -1
  77. package/dist/chunks/{chunk-QLGP2OAQ.js → chunk-MLLMLXKG.js} +1 -1
  78. package/dist/chunks/{chunk-QUNQM2E3.js → chunk-MPEK4ZNY.js} +1 -1
  79. package/dist/chunks/{chunk-EGP6DF34.js → chunk-MPXOPL7R.js} +2 -2
  80. package/dist/chunks/{chunk-PHZZBXDO.js → chunk-MQMMJKOZ.js} +1 -1
  81. package/dist/chunks/{chunk-B66QCXH2.js → chunk-MWPMYCYB.js} +1 -1
  82. package/dist/chunks/{chunk-5G7BQAUA.js → chunk-N5FT6PTI.js} +1 -1
  83. package/dist/chunks/{chunk-SDHG6CKU.js → chunk-NDNSLCPE.js} +1 -1
  84. package/dist/chunks/{chunk-WCNPGKST.js → chunk-O4YHISU2.js} +1 -1
  85. package/dist/chunks/{chunk-IO5DZUKL.js → chunk-OI4DAZ4U.js} +1 -1
  86. package/dist/chunks/{chunk-Q73RKX7I.js → chunk-OIIE5GUK.js} +1 -1
  87. package/dist/chunks/{chunk-N5EAVX4G.js → chunk-OOKHHOIU.js} +1 -1
  88. package/dist/chunks/{chunk-7OKZCJHS.js → chunk-OXRN2257.js} +1 -1
  89. package/dist/chunks/{chunk-HES4VP3D.js → chunk-PYPXP5R3.js} +1 -1
  90. package/dist/chunks/{chunk-ZK3ET5EP.js → chunk-QKBMXL4D.js} +3 -3
  91. package/dist/chunks/{chunk-YAA7F5LI.js → chunk-QKGNAYSC.js} +1 -1
  92. package/dist/chunks/{chunk-KDER7R45.js → chunk-RIFWD5XM.js} +1 -1
  93. package/dist/chunks/{chunk-WZ35ICTE.js → chunk-RWBP2H4M.js} +1 -1
  94. package/dist/chunks/{chunk-SO4GMSNP.js → chunk-S5ACNR5Y.js} +1 -1
  95. package/dist/chunks/{chunk-M4ZHFDRJ.js → chunk-SRK4WX7D.js} +1 -1
  96. package/dist/chunks/{chunk-XY7HFXLH.js → chunk-SVLVIYH2.js} +1 -1
  97. package/dist/chunks/{chunk-FNGZ4UDZ.js → chunk-T6ML5SCD.js} +1 -1
  98. package/dist/chunks/{chunk-CO23RRN7.js → chunk-TD5YYA5Z.js} +1 -1
  99. package/dist/chunks/{chunk-7NCM6GBN.js → chunk-TOWY6Y23.js} +1 -1
  100. package/dist/chunks/{chunk-OXQ2WFIH.js → chunk-TR5UC5AF.js} +1 -1
  101. package/dist/chunks/{chunk-JQOVC35K.js → chunk-UCPD526R.js} +1 -1
  102. package/dist/chunks/{chunk-Y4I6CFZJ.js → chunk-UGDBMRCT.js} +1 -1
  103. package/dist/chunks/{chunk-E2JB5OCO.js → chunk-UZE3C2SF.js} +1 -1
  104. package/dist/chunks/{chunk-PACLKDTN.js → chunk-V4VM2R6D.js} +1 -1
  105. package/dist/chunks/{chunk-XOPHFUUY.js → chunk-VMBWCIGG.js} +1 -1
  106. package/dist/chunks/{chunk-CIZI6Z7D.js → chunk-VMW23TIZ.js} +1 -1
  107. package/dist/chunks/{chunk-4G3GTEVS.js → chunk-VSQPWLAG.js} +1 -1
  108. package/dist/chunks/{chunk-54755JYM.js → chunk-VXFGSFIE.js} +2 -2
  109. package/dist/chunks/{chunk-R2FYCJL6.js → chunk-W4JBPYGW.js} +1 -1
  110. package/dist/chunks/{chunk-JZKTBYNB.js → chunk-WMJEQK4G.js} +1 -1
  111. package/dist/chunks/{chunk-ESYPMD7Q.js → chunk-X2MJFTLS.js} +1 -1
  112. package/dist/chunks/{chunk-67U7PAMU.js → chunk-X7ZMUWJO.js} +1 -1
  113. package/dist/chunks/{chunk-WGQ3FMRF.js → chunk-XKDOPNQ5.js} +1 -1
  114. package/dist/chunks/{chunk-EYTTZ5H4.js → chunk-XLZMSD5K.js} +1 -1
  115. package/dist/chunks/{chunk-ZIQJDTQB.js → chunk-XTT3K3TR.js} +1 -1
  116. package/dist/chunks/{chunk-Q7P34B2O.js → chunk-YFHQRDNQ.js} +1 -1
  117. package/dist/chunks/{chunk-UGFSAG4U.js → chunk-YG3HITOU.js} +1 -1
  118. package/dist/chunks/{chunk-DWF3FCY4.js → chunk-Z5R4OSGC.js} +1 -1
  119. package/dist/chunks/{chunk-JT5YQ52I.js → chunk-Z6HWSTEP.js} +1 -1
  120. package/dist/chunks/{chunk-4PUOWSDE.js → chunk-ZEOYNUHL.js} +1 -1
  121. package/dist/chunks/{chunk-4KTGYHCE.js → chunk-ZMRP2A7K.js} +1 -1
  122. package/dist/chunks/{chunk-OL3L3U36.js → chunk-ZSWATWK2.js} +1 -1
  123. package/dist/chunks/cli-KXU5DNVV.js +2 -0
  124. package/dist/chunks/{command-5AXJMFYC.js → command-X35I53H3.js} +3 -3
  125. package/dist/chunks/{configuration-command-5LUNWPOL.js → configuration-command-VJUK34UQ.js} +1 -1
  126. package/dist/chunks/{connected-app-executor-DHXZE4X3.js → connected-app-executor-JBFJF2H5.js} +1 -1
  127. package/dist/chunks/{connected-evidence-NWMPICKJ.js → connected-evidence-CQ533AML.js} +1 -1
  128. package/dist/chunks/{connected-starting-assets-NRVXIKQ2.js → connected-starting-assets-RL5X6LZ7.js} +1 -1
  129. package/dist/chunks/{continual-UCKQ2QLH.js → continual-PHGIZFF6.js} +1 -1
  130. package/dist/chunks/{core-commands-ZPBX35M2.js → core-commands-5DYMDWXY.js} +1 -1
  131. package/dist/chunks/{dataset-preparation-authoring-UUYFWWCT.js → dataset-preparation-authoring-UDSX33YK.js} +1 -1
  132. package/dist/chunks/{datasets-6K3ZANIV.js → datasets-BW4JFUUU.js} +1 -1
  133. package/dist/chunks/{desktop-test-57INNJ76.js → desktop-test-RIG4CB2Z.js} +1 -1
  134. package/dist/chunks/{dist-2MKJC6HN.js → dist-C5XFRP53.js} +1 -1
  135. package/dist/chunks/{evaluation-coordination-B7CN4R2D.js → evaluation-coordination-6QJ6XTUX.js} +1 -1
  136. package/dist/chunks/{experiment-improvements-G357VLDB.js → experiment-improvements-2XF63AQ4.js} +1 -1
  137. package/dist/chunks/{experiments-BHQO26LJ.js → experiments-3S2BVNK6.js} +1 -1
  138. package/dist/chunks/{experiments-signal-BI6NKETB.js → experiments-signal-IRBHGGW5.js} +1 -1
  139. package/dist/chunks/{help-UQN5RUPA.js → help-Q2VMJVTR.js} +1 -1
  140. package/dist/chunks/host-profile-evaluation-tools-5LZQHA32.js +2 -0
  141. package/dist/chunks/{host-profile-external-dataset-KSEPXY2S.js → host-profile-external-dataset-C6ZPMTX6.js} +1 -1
  142. package/dist/chunks/{hosted-app-server-composition-WDDO6F23.js → hosted-app-server-composition-AYZM2HY6.js} +1 -1
  143. package/dist/chunks/{hosted-experiment-improvement-VVYXQ65K.js → hosted-experiment-improvement-SMZJYRJ7.js} +1 -1
  144. package/dist/chunks/hosted-harness-runtime-QWIFAITG.js +2 -0
  145. package/dist/chunks/{hosted-profile-candidate-PTGQLPZO.js → hosted-profile-candidate-WOMWAE5N.js} +1 -1
  146. package/dist/chunks/{hosted-profile-compiler-FS5R6CHJ.js → hosted-profile-compiler-NZ2BXN32.js} +1 -1
  147. package/dist/chunks/{hosted-profile-evaluation-control-UUEZEMXU.js → hosted-profile-evaluation-control-3ECFFM7E.js} +1 -1
  148. package/dist/chunks/{hosted-profile-evaluation-inspection-4F7OEF4T.js → hosted-profile-evaluation-inspection-TM7RKONG.js} +1 -1
  149. package/dist/chunks/{hosted-profile-evaluation-preparation-LIJJZDHQ.js → hosted-profile-evaluation-preparation-2MZIRT75.js} +1 -1
  150. package/dist/chunks/{hosted-tasksets-KCLNMPG5.js → hosted-tasksets-IUK3VWSL.js} +1 -1
  151. package/dist/chunks/{human-review-PX6DBIFT.js → human-review-PG4WWVWV.js} +1 -1
  152. package/dist/chunks/{import-2HEYPHPW.js → import-FAZAVZBF.js} +1 -1
  153. package/dist/chunks/{learning-Y3UKNUGE.js → learning-3XDYMYBE.js} +1 -1
  154. package/dist/chunks/{learning-LSXBL5DB.js → learning-OR4CYV4B.js} +1 -1
  155. package/dist/chunks/local-harness-improvement-runtime-OYLTKMJU.js +2 -0
  156. package/dist/chunks/local-harness-taskset-review-I7YU4RZI.js +2 -0
  157. package/dist/chunks/{model-projects-6YWVD2TS.js → model-projects-POZRHXTF.js} +1 -1
  158. package/dist/chunks/{opchat-66BCRKEZ.js → opchat-TCZA6373.js} +1 -1
  159. package/dist/chunks/{opchat-bounded-chat-KQWXZVFN.js → opchat-bounded-chat-GMYDXLWB.js} +1 -1
  160. package/dist/chunks/{organizations-IOYWDOCC.js → organizations-PYKGA2P2.js} +1 -1
  161. package/dist/chunks/{profile-YH6G3ZTD.js → profile-GYYI555I.js} +1 -1
  162. package/dist/chunks/project-action-payload-FE6M2OXJ.js +2 -0
  163. package/dist/chunks/{project-agent-RYVMKW2F.js → project-agent-4ISJFMJD.js} +1 -1
  164. package/dist/chunks/{published-experiment-source-SDXUVPE7.js → published-experiment-source-E2YAJCLM.js} +1 -1
  165. package/dist/chunks/{refiner-profile-service-56VYLZQJ.js → refiner-profile-service-LKGXD5WJ.js} +1 -1
  166. package/dist/chunks/{runtime-ISLJIGWC.js → runtime-UDLOZD4Y.js} +2 -2
  167. package/dist/chunks/{sandbox-command-DI45NRTV.js → sandbox-command-4J6DAY7T.js} +1 -1
  168. package/dist/chunks/{sandbox-template-T42MDUSR.js → sandbox-template-TSXWJMWG.js} +1 -1
  169. package/dist/chunks/saved-work-QTEBKVUB.js +2 -0
  170. package/dist/chunks/{send-turn-YLY3YNEQ.js → send-turn-4MH4WMLW.js} +1 -1
  171. package/dist/chunks/{setup-D6TY2GWV.js → setup-IVT2FQSE.js} +1 -1
  172. package/dist/chunks/{src-7RN7BF4W.js → src-DC7N2H7A.js} +111 -113
  173. package/dist/chunks/{src-LF5X4RNQ.js → src-TOSQX36I.js} +1 -1
  174. package/dist/chunks/{standalone-experiment-turn-owner-TW5MTWIO.js → standalone-experiment-turn-owner-UYPA6XHW.js} +1 -1
  175. package/dist/chunks/{store-chat-resources-IRHBW2EC.js → store-chat-resources-QLXKKYYC.js} +1 -1
  176. package/dist/chunks/{store-continual-support-reviews-3KK42L4I.js → store-continual-support-reviews-4F2BOG3H.js} +1 -1
  177. package/dist/chunks/{store-conversation-serving-IVURK52V.js → store-conversation-serving-EUD47W6X.js} +1 -1
  178. package/dist/chunks/{store-create-improve-UTCLBXF2.js → store-create-improve-QUOTNNIM.js} +1 -1
  179. package/dist/chunks/{store-datasets-4AQOVAQY.js → store-datasets-ZUC7CNVO.js} +1 -1
  180. package/dist/chunks/{store-evaluation-results-PK2P3IMH.js → store-evaluation-results-LHHPHESK.js} +1 -1
  181. package/dist/chunks/{store-harness-workspaces-YEXB4IRV.js → store-harness-workspaces-TKX5PZWP.js} +1 -1
  182. package/dist/chunks/{store-human-review-O4BVHP25.js → store-human-review-7WZWRJ6X.js} +1 -1
  183. package/dist/chunks/{store-learned-preference-migration-validation-44SVX6YB.js → store-learned-preference-migration-validation-MVNKBR4X.js} +1 -1
  184. package/dist/chunks/{store-learning-SIUQIY5C.js → store-learning-WLUW2PWE.js} +1 -1
  185. package/dist/chunks/{store-learning-credentials-BUHR7SN6.js → store-learning-credentials-FDKCEDHK.js} +1 -1
  186. package/dist/chunks/{store-local-experiments-BHVTKPPE.js → store-local-experiments-HB53QFLL.js} +1 -1
  187. package/dist/chunks/{store-model-batch-review-RVAYUVK2.js → store-model-batch-review-O3I6GIAA.js} +1 -1
  188. package/dist/chunks/{store-model-configuration-AYFGMC5D.js → store-model-configuration-CDIGNU6Q.js} +1 -1
  189. package/dist/chunks/{store-model-project-preparation-5DEIS7TB.js → store-model-project-preparation-QMQ2HMJV.js} +1 -1
  190. package/dist/chunks/{store-modification-recordings-LCPK6K2T.js → store-modification-recordings-W4VEZKKQ.js} +1 -1
  191. package/dist/chunks/{store-preference-comparison-5YVIQNVB.js → store-preference-comparison-JKURBESE.js} +1 -1
  192. package/dist/chunks/{store-sidebar-file-bookmarks-WLMYDA4E.js → store-sidebar-file-bookmarks-KAEDHVVF.js} +1 -1
  193. package/dist/chunks/{store-sidebar-preferences-AFMYIDWT.js → store-sidebar-preferences-QPBLTHY6.js} +1 -1
  194. package/dist/chunks/{store-subagents-KFPVSTRO.js → store-subagents-ZELQP3MX.js} +1 -1
  195. package/dist/chunks/{store-task-inbox-L6IQTY26.js → store-task-inbox-4ZDQR2E7.js} +1 -1
  196. package/dist/chunks/{store-task-inventory-QWS2C656.js → store-task-inventory-CTIJDLYE.js} +1 -1
  197. package/dist/chunks/{store-taskset-drafts-EAOOY6CR.js → store-taskset-drafts-FRPBYLTW.js} +1 -1
  198. package/dist/chunks/{store-training-FYXZU2FE.js → store-training-WQAYUT7B.js} +1 -1
  199. package/dist/chunks/{store-training-jobs-3N3VKPIY.js → store-training-jobs-O5EHGTH7.js} +1 -1
  200. package/dist/chunks/{store-training-models-VOFVGPZR.js → store-training-models-YSZMC66T.js} +1 -1
  201. package/dist/chunks/{taskset-HNDIGYQG.js → taskset-OVYM4QMS.js} +1 -1
  202. package/dist/chunks/{taskset-packages-WMG5DUBN.js → taskset-packages-FUQWNTSB.js} +1 -1
  203. package/dist/chunks/{taskset-packages-T6B6HYKZ.js → taskset-packages-GM6IUOTY.js} +1 -1
  204. package/dist/chunks/{teams-bot-Z5CZLWE4.js → teams-bot-U2M3ORWR.js} +1 -1
  205. package/dist/chunks/{tool-learning-ZQ6NSJ5K.js → tool-learning-NXVR4YPA.js} +1 -1
  206. package/dist/chunks/{training-JTYQA7GA.js → training-EQ7G5FDY.js} +1 -1
  207. package/dist/chunks/training-LQUAL4Y4.js +2 -0
  208. package/dist/chunks/training-PEZYJ2SN.js +2 -0
  209. package/dist/chunks/{training-hosted-36SZFS4U.js → training-hosted-XKSUTMLQ.js} +1 -1
  210. package/dist/chunks/{training-hosted-alphaedit-HSMRDJTD.js → training-hosted-alphaedit-VCOEYLKK.js} +1 -1
  211. package/dist/chunks/{training-hosted-decision-7JALOU6O.js → training-hosted-decision-IKWWXA56.js} +1 -1
  212. package/dist/chunks/{training-hosted-engram-SXO75MFG.js → training-hosted-engram-3TOPPVSW.js} +1 -1
  213. package/dist/chunks/{training-hosted-learning-E2N32YU5.js → training-hosted-learning-UEBGSSNC.js} +1 -1
  214. package/dist/chunks/{training-hosted-modification-comparison-TXFDJFTG.js → training-hosted-modification-comparison-C6S4JFHW.js} +1 -1
  215. package/dist/chunks/{training-hosted-neuron-training-J42WK4EH.js → training-hosted-neuron-training-EP2U4PHG.js} +1 -1
  216. package/dist/chunks/{training-hosted-serving-report-BAEABGJH.js → training-hosted-serving-report-KJMRZJLQ.js} +1 -1
  217. package/dist/chunks/{training-hosted-steering-T556BUBG.js → training-hosted-steering-I27DV6A2.js} +1 -1
  218. package/dist/chunks/{training-model-start-P3PXDWNT.js → training-model-start-NWXNGRDC.js} +1 -1
  219. package/dist/chunks/{workspaces-EK62ANTB.js → workspaces-FVQYJPOS.js} +1 -1
  220. package/dist/cli.js +1 -1
  221. package/dist/index.js +1 -1
  222. package/dist/skills/manifest.json +3 -3
  223. package/dist/skills/openpond-cli/references/experiments-and-training.md +19 -0
  224. package/dist/web/assets/App-QM6Y2Eod.js +54 -0
  225. package/dist/web/assets/{AppDialog-x1HU1uLv.js → AppDialog-C8um481a.js} +1 -1
  226. package/dist/web/assets/{AppTerminalPanel-CNIKmqKc.js → AppTerminalPanel-OwNr-bp6.js} +2 -2
  227. package/dist/web/assets/{AppToastContext-DNWd43HS.js → AppToastContext-BQ4iRFif.js} +1 -1
  228. package/dist/web/assets/{AppsView-BvOD83Z1.js → AppsView-mk8m_Cra.js} +1 -1
  229. package/dist/web/assets/{AttachmentTypeIcon-BLdDr3JZ.js → AttachmentTypeIcon-SITPqTtF.js} +1 -1
  230. package/dist/web/assets/{BrowserSidebar-Ar0FlFKg.js → BrowserSidebar-BghdIKTB.js} +1 -1
  231. package/dist/web/assets/{CartesianChart-tS7f1HZv.js → CartesianChart-BdRx7q_O.js} +1 -1
  232. package/dist/web/assets/{ChatTimelineEntry-z7_kur3h.js → ChatTimelineEntry-BBOnAzJB.js} +1 -1
  233. package/dist/web/assets/{CollaborationTabs-CaiFEKrv.js → CollaborationTabs-Beja-9s5.js} +1 -1
  234. package/dist/web/assets/{CommandMenu-BpubEqaA.js → CommandMenu-CQtrSUpu.js} +1 -1
  235. package/dist/web/assets/{CommunityView-TGR4s99l.js → CommunityView-LPTAakS-.js} +1 -1
  236. package/dist/web/assets/{ComposerAttachments-DPWCjKXz.js → ComposerAttachments-DI-Gr7Zw.js} +1 -1
  237. package/dist/web/assets/{ComposerCreateImproveStrip-Drji01_6.js → ComposerCreateImproveStrip-CY5Uw1yc.js} +1 -1
  238. package/dist/web/assets/{ConversationImportsSettings-B_oW0cz7.js → ConversationImportsSettings-DFwhKERw.js} +1 -1
  239. package/dist/web/assets/{DatasetReviewImport-Dr3unJSY.js → DatasetReviewImport-C9xraQk7.js} +1 -1
  240. package/dist/web/assets/{ExperimentTrainingDataWorkspace-DObvpJAw.js → ExperimentTrainingDataWorkspace-Cx58S6R_.js} +2 -2
  241. package/dist/web/assets/{FilePagePreview-9kkXbARN.js → FilePagePreview-dlbmR8s8.js} +2 -2
  242. package/dist/web/assets/{GetStartedView-Dv2b_SlH.js → GetStartedView-BkTV_shK.js} +1 -1
  243. package/dist/web/assets/{GettingStartedDialog-sPaPMc61.js → GettingStartedDialog-DulDLYnr.js} +1 -1
  244. package/dist/web/assets/{HostedModelLearningReview-BlwhGxS6.js → HostedModelLearningReview--fXJEOfI.js} +1 -1
  245. package/dist/web/assets/{HostedModelLearningSettings-B5ahk3je.js → HostedModelLearningSettings-BEb7B_PC.js} +1 -1
  246. package/dist/web/assets/{HtmlVisual-rGsClq0p.js → HtmlVisual-BS61T2qR.js} +1 -1
  247. package/dist/web/assets/{LabModelVersionDetailPage-Da7AwZWV.js → LabModelVersionDetailPage-CmzUIDbR.js} +1 -1
  248. package/dist/web/assets/{LabModelWorkspace-DTeYViWH.js → LabModelWorkspace-DoAnQKWk.js} +1 -1
  249. package/dist/web/assets/{LabSkillSidebar-BieHbNl6.js → LabSkillSidebar-DJTm7ZQs.js} +1 -1
  250. package/dist/web/assets/{LabsRoute-D3XqPB0-.js → LabsRoute-DNtBot4a.js} +4 -4
  251. package/dist/web/assets/{LearningBatchesPage-CCBuf2u4.js → LearningBatchesPage-C_oQjciE.js} +1 -1
  252. package/dist/web/assets/{MainChatThread-B6BQJfcq.js → MainChatThread-D9e-to8e.js} +2 -2
  253. package/dist/web/assets/{MainPane-D3fQou29.js → MainPane-mWeD0M-f.js} +6 -6
  254. package/dist/web/assets/{ModelProjectPageHeader-BZn9Lu_J.js → ModelProjectPageHeader-BecKU_2p.js} +1 -1
  255. package/dist/web/assets/{NativeSetupTerminal-Bglqab_g.js → NativeSetupTerminal-DO0DN4fH.js} +2 -2
  256. package/dist/web/assets/{NativeSkillSidebar-pUGRdnV_.js → NativeSkillSidebar-jnxgQASC.js} +1 -1
  257. package/dist/web/assets/{NewProjectDialog-BpHN38MA.js → NewProjectDialog-ByHR4vMf.js} +1 -1
  258. package/dist/web/assets/{OutputsPage-LunDCQ6w.js → OutputsPage-DZY4BUCy.js} +1 -1
  259. package/dist/web/assets/{PageChrome-DThEcWAx.js → PageChrome-DjPuwWsn.js} +1 -1
  260. package/dist/web/assets/{ProjectsPage-vct_TQgL.js → ProjectsPage-DKbwhIM4.js} +1 -1
  261. package/dist/web/assets/{RightChatPanelStack-CgFK7DY0.js → RightChatPanelStack-BARH0XuL.js} +1 -1
  262. package/dist/web/assets/RightSidebarHomePanel-qKL8dZrN.js +1 -0
  263. package/dist/web/assets/{ScheduledWorkPage-mmaZfybl.js → ScheduledWorkPage-CElrmRz9.js} +1 -1
  264. package/dist/web/assets/{SettingsView-CJfeRsWR.js → SettingsView-CsFSjE9s.js} +3 -3
  265. package/dist/web/assets/{TasksetDraftEditorPrimitives-CuimAfkv.js → TasksetDraftEditorPrimitives-DJoYkvWq.js} +1 -1
  266. package/dist/web/assets/{TeamChatView-BcK0lF1b.js → TeamChatView-D9Y4e98Y.js} +1 -1
  267. package/dist/web/assets/{TerminalOverlay-0pzEvy-C.js → TerminalOverlay-CUO8yZjy.js} +1 -1
  268. package/dist/web/assets/{TrainingCreationPanel-CcyzFz7l.js → TrainingCreationPanel-_mnLQ1HA.js} +1 -1
  269. package/dist/web/assets/{TrainingDraftPanel-DSLZXdLz.js → TrainingDraftPanel-CCqQTHo5.js} +1 -1
  270. package/dist/web/assets/{UsageSettingsSection-BT9pcnCn.js → UsageSettingsSection-CdWq5oYC.js} +1 -1
  271. package/dist/web/assets/WorkSidebarPanel-DRXaK-E6.js +1 -0
  272. package/dist/web/assets/{WorkspaceDiffPanel-Bbz5qrVA.js → WorkspaceDiffPanel-CdHr8bX6.js} +3 -3
  273. package/dist/web/assets/{WorkspaceEnvironmentMenu-6hXpvMTl.js → WorkspaceEnvironmentMenu-BnUh4dg9.js} +1 -1
  274. package/dist/web/assets/{WorkspaceFileLocation-BijVemBl.js → WorkspaceFileLocation-VzrSq_Ki.js} +1 -1
  275. package/dist/web/assets/{WorkspaceGitDialogs-BOO0E5i9.js → WorkspaceGitDialogs-nwvQOm9r.js} +1 -1
  276. package/dist/web/assets/{WorkspaceMonacoEditor-B_YzK7Do.js → WorkspaceMonacoEditor-m3bCIpZe.js} +3 -3
  277. package/dist/web/assets/{WorkspacePdfPreview-CFti1fvu.js → WorkspacePdfPreview-u6Iv0qr0.js} +2 -2
  278. package/dist/web/assets/{WorkspacePresentationPreview-DPAhNaV6.js → WorkspacePresentationPreview-CjvTjhUO.js} +1 -1
  279. package/dist/web/assets/{bot-BE2rL_qv.js → bot-DiDSZBLn.js} +1 -1
  280. package/dist/web/assets/{chat-resources-Beh5lB36.js → chat-resources-CmBtWC5V.js} +1 -1
  281. package/dist/web/assets/chevron-down-CqxKXYPf.js +1 -0
  282. package/dist/web/assets/chevron-right-ClP6ukIq.js +1 -0
  283. package/dist/web/assets/chevron-up-DY7wpdJ1.js +1 -0
  284. package/dist/web/assets/{chunk-C3TS766N-j1MK0e3c.js → chunk-C3TS766N-DSA4vs-Y.js} +1 -1
  285. package/dist/web/assets/{client-BnJhN-14.js → client-_uDCFdg5.js} +1 -1
  286. package/dist/web/assets/{client-choice-storage-CQ0CNkzG.js → client-choice-storage-CRKZpilL.js} +1 -1
  287. package/dist/web/assets/{cloud-upload-DFjZE4O4.js → cloud-upload-CWamjPts.js} +1 -1
  288. package/dist/web/assets/{copy-CGrLUtw5.js → copy-B56YjDkW.js} +1 -1
  289. package/dist/web/assets/{cssMode-DvRw2fUx.js → cssMode-BuC9qQvo.js} +1 -1
  290. package/dist/web/assets/{external-link-3ZnEFUXd.js → external-link-BSn21e-y.js} +1 -1
  291. package/dist/web/assets/{folder-open-i9n8450i.js → folder-open-CaJGWSr2.js} +1 -1
  292. package/dist/web/assets/{folder-plus-cu8Md_ej.js → folder-plus-eTUep-az.js} +1 -1
  293. package/dist/web/assets/{git-commit-horizontal-CwckmC09.js → git-commit-horizontal-Buk_hy6T.js} +1 -1
  294. package/dist/web/assets/{htmlMode-8VF4Ovtw.js → htmlMode-D7kF2kDL.js} +1 -1
  295. package/dist/web/assets/{icons-4yRSxBZj.js → icons-B4B5eUyR.js} +1 -1
  296. package/dist/web/assets/{image-D-umhyyK.js → image--4h1aK2l.js} +1 -1
  297. package/dist/web/assets/{index-DiVhx1GM.js → index-CCaTs7xt.js} +2 -2
  298. package/dist/web/assets/{info-Dq2RsPDJ.js → info-DjMTH4sJ.js} +1 -1
  299. package/dist/web/assets/{jsonMode-CvCYQHkB.js → jsonMode-BVX_7KjE.js} +1 -1
  300. package/dist/web/assets/loader-circle-DNHvEoaP.js +1 -0
  301. package/dist/web/assets/{lspLanguageFeatures-CjufNNFF.js → lspLanguageFeatures-RBOb-3wX.js} +1 -1
  302. package/dist/web/assets/{maximize-2-CKY8dua6.js → maximize-2-Cjg-f1xT.js} +1 -1
  303. package/dist/web/assets/{message-square-CVDgKlKX.js → message-square-oIMQDMc3.js} +1 -1
  304. package/dist/web/assets/{monaco.contribution-BYAgjZbj.js → monaco.contribution-CIbGU5-C.js} +2 -2
  305. package/dist/web/assets/{monaco.contribution-PjJ1258q.js → monaco.contribution-CIwt2mTE.js} +2 -2
  306. package/dist/web/assets/{monaco.contribution-BYY3-y9l.js → monaco.contribution-Dd1cPdSS.js} +2 -2
  307. package/dist/web/assets/{monaco.contribution-Bh0CKj9i.js → monaco.contribution-KRLNg324.js} +2 -2
  308. package/dist/web/assets/{monitor-UYe42gew.js → monitor-BWaitd6I.js} +1 -1
  309. package/dist/web/assets/{paperclip-DrlSVUoz.js → paperclip-FYK6OySO.js} +1 -1
  310. package/dist/web/assets/{pdf-BMhday2W.js → pdf-DbwlsqZP.js} +1 -1
  311. package/dist/web/assets/play-DieChKfF.js +1 -0
  312. package/dist/web/assets/plus-DkfcQyma.js +1 -0
  313. package/dist/web/assets/{presentation-DcZKqH7w.js → presentation-B6MaAPC7.js} +1 -1
  314. package/dist/web/assets/{python-CiA01i07.js → python-DRYJxjiM.js} +1 -1
  315. package/dist/web/assets/{refresh-cw-00D-GDnF.js → refresh-cw-DOVpqCfJ.js} +1 -1
  316. package/dist/web/assets/{save-CXe7bqR7.js → save-BuyyyR4Q.js} +1 -1
  317. package/dist/web/assets/{settings-lists-B5J40WM6.js → settings-lists-BeAdxSjx.js} +1 -1
  318. package/dist/web/assets/square-D0YnIVh6.js +1 -0
  319. package/dist/web/assets/{square-terminal-DxC7TTds.js → square-terminal-DTOIZy6_.js} +1 -1
  320. package/dist/web/assets/{submit-issue-command-Dq3TqJLV.js → submit-issue-command-V--K9lVQ.js} +1 -1
  321. package/dist/web/assets/{toggleHighContrast-BH3Jckfo.js → toggleHighContrast-nNzCoE0h.js} +1 -1
  322. package/dist/web/assets/training-DZgfVcI-.js +1 -0
  323. package/dist/web/assets/{training-model-data-B6IZ3x-t.js → training-model-data-CWoTokkb.js} +1 -1
  324. package/dist/web/assets/{tsMode-DXkj4bqC.js → tsMode-BfVi5_FZ.js} +1 -1
  325. package/dist/web/assets/{upload-B3KRHVHl.js → upload-C2MnlWjj.js} +1 -1
  326. package/dist/web/assets/{useAccountSettings-BGRkTRrp.js → useAccountSettings-QwRbZIKu.js} +1 -1
  327. package/dist/web/assets/{useAgentInventory-D_1AlAZJ.js → useAgentInventory-B7xEgMCA.js} +1 -1
  328. package/dist/web/assets/{useChatContextSelection-hoMSuUSE.js → useChatContextSelection-O6wo4EqD.js} +1 -1
  329. package/dist/web/assets/{useLocalAgentSchedules-DxTER7Ow.js → useLocalAgentSchedules-DpHnOGoV.js} +1 -1
  330. package/dist/web/assets/{useQuery-DkPec_9x.js → useQuery-CvZ8bzdW.js} +1 -1
  331. package/dist/web/assets/{wifi-off-CMzpvbWl.js → wifi-off-B8d12Alh.js} +1 -1
  332. package/dist/web/assets/{workers-ziY_bTv2.js → workers-sIVKxb8c.js} +1 -1
  333. package/dist/web/assets/x-BvVvVB-j.js +1 -0
  334. package/dist/web/assets/{yaml-mSvqVSko.js → yaml-8-aLM3zj.js} +1 -1
  335. package/dist/web/index.html +1 -1
  336. package/docs/command-reference.md +1 -0
  337. package/package.json +1 -1
  338. package/dist/chunks/app-server-runtime-B7AMBGQZ.js +0 -2
  339. package/dist/chunks/chunk-6D3FI2XT.js +0 -2
  340. package/dist/chunks/chunk-VEBW7NKD.js +0 -2
  341. package/dist/chunks/cli-ALEEFAJ7.js +0 -2
  342. package/dist/chunks/host-profile-evaluation-tools-UF4ATIUF.js +0 -2
  343. package/dist/chunks/hosted-harness-runtime-MMTLCL23.js +0 -2
  344. package/dist/chunks/local-harness-improvement-runtime-3YJQRYXC.js +0 -2
  345. package/dist/chunks/local-harness-taskset-review-E5GN5LTR.js +0 -2
  346. package/dist/chunks/project-action-payload-53OH6WDH.js +0 -2
  347. package/dist/chunks/saved-work-54I5ZJTC.js +0 -2
  348. package/dist/chunks/training-5NT2YB2L.js +0 -2
  349. package/dist/chunks/training-UY6KRG4M.js +0 -2
  350. package/dist/web/assets/App-CXhxya9x.js +0 -54
  351. package/dist/web/assets/RightSidebarHomePanel-BJmzUcmy.js +0 -1
  352. package/dist/web/assets/WorkSidebarPanel-CP-nHAsJ.js +0 -1
  353. package/dist/web/assets/chevron-down-Bn8yph2O.js +0 -1
  354. package/dist/web/assets/chevron-right-BU-jUmb2.js +0 -1
  355. package/dist/web/assets/chevron-up-DacwuDJZ.js +0 -1
  356. package/dist/web/assets/loader-circle-DBl6qqtR.js +0 -1
  357. package/dist/web/assets/play-DIqZnaNf.js +0 -1
  358. package/dist/web/assets/plus-CFNxAPMK.js +0 -1
  359. package/dist/web/assets/square-DJEaBefe.js +0 -1
  360. package/dist/web/assets/training-DWfghwfZ.js +0 -1
  361. package/dist/web/assets/x-omjwMPbJ.js +0 -1
@@ -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};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as pt}from"./chunk-IZ6DLEVY.js";import{a as ut}from"./chunk-SYUKES6H.js";import{b as se,m as mt,s as ft,t as ie,y as gt,z as ae}from"./chunk-YU3C6U5V.js";import{a as A,b as L}from"./chunk-KVTBX2UP.js";import{a as dt,d as Te}from"./chunk-U7D6Q744.js";import{$ as it,Ea as ct,ha as at,pa as Ie}from"./chunk-HG2YFMVU.js";import{e as st}from"./chunk-OQPJ7FJF.js";import{P as oe,R as lt}from"./chunk-7OKZCJHS.js";import{I as _e}from"./chunk-2MEOUS24.js";import{a as i,c as Re,e as Pn}from"./chunk-FTQLQJQV.js";var kt=Re((as,yt)=>{"use strict";var Cn=["||","&&",";;","|&","<(","<<<",">>",">&","<&","&",";","(",")","|","<",">"],ht=/[\n\r\u2028\u2029]/,En=/[\s#!"$&'():;<=>@\\^`|]/g;yt.exports=i(function(t){return t.map(function(n){if(n==="")return"''";if(n&&typeof n=="object"){if("op"in n&&n.op==="glob"){if(typeof n.pattern!="string")throw new TypeError("glob token requires a string `pattern`");if(ht.test(n.pattern))throw new TypeError("glob `pattern` must not contain line terminators");return n.pattern.replace(En,"\\$&")}if("op"in n&&typeof n.op=="string"){if(Cn.indexOf(n.op)<0)throw new TypeError("invalid `op` value: "+JSON.stringify(n.op));return n.op.replace(/[\s\S]/g,"\\$&")}if("comment"in n&&typeof n.comment=="string"){if(ht.test(n.comment))throw new TypeError("`comment` must not contain line terminators");return"#"+n.comment}throw new TypeError("unrecognized object token shape")}return/["\s\\]/.test(n)&&!/'/.test(n)?"'"+n.replace(/(['])/g,"\\$1")+"'":/["'\s]/.test(n)?'"'+n.replace(/(["\\$`!])/g,"\\$1")+'"':String(n).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g,"$1\\$2")}).join(" ")},"quote")});var Tt=Re((ls,It)=>{"use strict";var _t="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",wt=new RegExp("^"+_t+"$"),bt="|&;()<> \\t",Mn="'([^']*?)'",Wn='"((\\\\"|[^"])*?)"',On=/^#$/,xt="'",Rt='"',ce="$",D="",qn=4294967296;for(ve=0;ve<4;ve++)D+=(qn*Math.random()).toString(16);var ve,jn=new RegExp("^"+D);function Bn(e,t){for(var n=t.lastIndex,r=[],o;o=t.exec(e);)r[r.length]=o,t.lastIndex===o.index&&(t.lastIndex+=1);return t.lastIndex=n,r}i(Bn,"matchAll");function $n(e,t,n){var r=typeof e=="function"?e(n):e[n];return typeof r>"u"&&n!=""?r="":typeof r>"u"&&(r="$"),typeof r=="object"?t+D+JSON.stringify(r)+D:t+r}i($n,"getVar");function Nn(e,t,n){n||(n={});var r=n.escape||"\\",o=n.splitUnquoted===!0?`
2
+ import{a as pt}from"./chunk-IZ6DLEVY.js";import{a as ut}from"./chunk-SYUKES6H.js";import{b as se,m as mt,s as ft,t as ie,y as gt,z as ae}from"./chunk-YU3C6U5V.js";import{a as A,b as L}from"./chunk-KVTBX2UP.js";import{a as dt,d as Te}from"./chunk-L5L3H6CI.js";import{$ as it,Ea as ct,ha as at,pa as Ie}from"./chunk-2THZ6GZY.js";import{e as st}from"./chunk-OQPJ7FJF.js";import{P as oe,R as lt}from"./chunk-OXRN2257.js";import{I as _e}from"./chunk-2MEOUS24.js";import{a as i,c as Re,e as Pn}from"./chunk-FTQLQJQV.js";var kt=Re((as,yt)=>{"use strict";var Cn=["||","&&",";;","|&","<(","<<<",">>",">&","<&","&",";","(",")","|","<",">"],ht=/[\n\r\u2028\u2029]/,En=/[\s#!"$&'():;<=>@\\^`|]/g;yt.exports=i(function(t){return t.map(function(n){if(n==="")return"''";if(n&&typeof n=="object"){if("op"in n&&n.op==="glob"){if(typeof n.pattern!="string")throw new TypeError("glob token requires a string `pattern`");if(ht.test(n.pattern))throw new TypeError("glob `pattern` must not contain line terminators");return n.pattern.replace(En,"\\$&")}if("op"in n&&typeof n.op=="string"){if(Cn.indexOf(n.op)<0)throw new TypeError("invalid `op` value: "+JSON.stringify(n.op));return n.op.replace(/[\s\S]/g,"\\$&")}if("comment"in n&&typeof n.comment=="string"){if(ht.test(n.comment))throw new TypeError("`comment` must not contain line terminators");return"#"+n.comment}throw new TypeError("unrecognized object token shape")}return/["\s\\]/.test(n)&&!/'/.test(n)?"'"+n.replace(/(['])/g,"\\$1")+"'":/["'\s]/.test(n)?'"'+n.replace(/(["\\$`!])/g,"\\$1")+'"':String(n).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g,"$1\\$2")}).join(" ")},"quote")});var Tt=Re((ls,It)=>{"use strict";var _t="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",wt=new RegExp("^"+_t+"$"),bt="|&;()<> \\t",Mn="'([^']*?)'",Wn='"((\\\\"|[^"])*?)"',On=/^#$/,xt="'",Rt='"',ce="$",D="",qn=4294967296;for(ve=0;ve<4;ve++)D+=(qn*Math.random()).toString(16);var ve,jn=new RegExp("^"+D);function Bn(e,t){for(var n=t.lastIndex,r=[],o;o=t.exec(e);)r[r.length]=o,t.lastIndex===o.index&&(t.lastIndex+=1);return t.lastIndex=n,r}i(Bn,"matchAll");function $n(e,t,n){var r=typeof e=="function"?e(n):e[n];return typeof r>"u"&&n!=""?r="":typeof r>"u"&&(r="$"),typeof r=="object"?t+D+JSON.stringify(r)+D:t+r}i($n,"getVar");function Nn(e,t,n){n||(n={});var r=n.escape||"\\",o=n.splitUnquoted===!0?`
3
3
  `:typeof n.splitUnquoted=="string"?n.splitUnquoted:"",s="(\\"+r+`['"`+bt+`]|[^\\s'"`+bt+"])+",a=new RegExp(["("+_t+")","("+s+"|"+Wn+"|"+Mn+")+"].join("|"),"g"),d=Bn(e,a);if(d.length===0)return[];t||(t={});var c=!1;return d.map(function(l){var u=l[0];if(!u||c)return;if(wt.test(u))return{op:u};var p=!1,f=!1,m="",h=[],N=!1,R=null,V=!1,k;function tt(){k+=1;var I,X,be=u.charAt(k);if(be==="{"){if(k+=1,u.charAt(k)==="}")throw new Error("Bad substitution: "+u.slice(k-2,k+1));var re=1;for(I=k;re>0&&I<u.length;)u.charAt(I)==="{"&&u.charAt(I-1)==="$"?re+=1:u.charAt(I)==="}"&&(re-=1),I+=1;if(re!==0)throw new Error("Bad substitution: "+u.slice(k));I-=1,X=u.slice(k,I),k=I}else if(/[*@#?$!_-]/.test(be))X=be,k+=1;else{var xe=u.slice(k);I=xe.match(/[^\w\d_]/),I?(X=xe.slice(0,I.index),k+=I.index-1):(X=xe,k=u.length)}return $n(t,"",X)}i(tt,"parseEnvVar");function nt(){if(R!==null){if(R===0)m!==""&&(h[h.length]=m,m="");else{h[h.length]=m,m="";for(var I=1;I<R;I+=1)h[h.length]=""}R=null}}for(i(nt,"flushRun"),k=0;k<u.length;k++){var w=u.charAt(k);if(o&&w!==ce&&nt(),V=V||!p&&(w==="*"||w==="?"),f)m+=w,f=!1;else if(p)w===p?p=!1:p==xt?m+=w:w===r?(k+=1,w=u.charAt(k),w===Rt||w===r||w===ce?m+=w:m+=r+w):w===ce?m+=tt():m+=w;else if(w===Rt||w===xt)p=w,N=!0;else{if(wt.test(w))return{op:u};if(On.test(w)){c=!0;var rt={comment:e.slice(l.index+k+1)};return m.length?[m,rt]:[rt]}else if(w===r)f=!0;else if(w===ce){var ke=tt();if(!o)m+=ke;else for(var we=0;we<ke.length;we+=1){var W=ke.charAt(we);o.indexOf(W)<0?(nt(),m+=W):R===null?R=W===" "||W===" "||W===`
4
4
  `?0:1:W!==" "&&W!==" "&&W!==`
5
5
  `&&(R+=1)}}else m+=w}}if(V)return{op:"glob",pattern:m};if(o){if(R!==null&&R>0){h[h.length]=m,m="";for(var ot=1;ot<R;ot+=1)h[h.length]=""}return(m!==""||N&&h.length===0)&&(h[h.length]=m),h}return m}).reduce(function(l,u){return typeof u>"u"||[].concat(u).forEach(function(p){l[l.length]=p}),l},[])}i(Nn,"parseInternal");It.exports=i(function(t,n,r){var o=Nn(t,n,r);return typeof n!="function"?o:o.reduce(function(s,a){if(typeof a=="object")return s[s.length]=a,s;var d=a.split(RegExp("("+D+".*?"+D+")","g"));return d.length===1?(s[s.length]=d[0],s):(d.filter(Boolean).forEach(function(c){s[s.length]=jn.test(c)?JSON.parse(c.split(D)[1]):c}),s)},[])},"parse")});var vt=Re(Se=>{"use strict";Se.quote=kt();Se.parse=Tt()});var Mt=Pn(vt(),1);import{spawn as Ln}from"node:child_process";import{randomUUID as Dn}from"node:crypto";import Z from"node:path";import{mkdir as Fn}from"node:fs/promises";var Un=120,zn=3600,ue=6e4,St=2e4,Jn="Select a project to use this.";function Rs(e){let{upsertApproval:t,appendRuntimeEvent:n}=e,r=new Map,o=new Set;async function s(c){let l=c.command.trim();if(!l)return de(l,null,"Command is empty.",Pt(c.timeoutSeconds));let u=Pt(c.timeoutSeconds),p=A({session:c.session}),f=Yn({requestedCwd:c.cwd,session:c.session}),m=!f&&!c.session.workspaceKind&&!c.session.systemKind&&e.managedChatCwd;m&&(f=Z.join(m,c.session.id.replace(/[^a-zA-Z0-9_-]/g,"_")),await Fn(f,{recursive:!0}));let h=!!(c.cwd?.trim()&&Z.isAbsolute(c.cwd.trim()));if(p.target==="sandbox"||!f||p.target!=="local"&&!h&&!m)return de(l,f,Jn,u);let N=c.session.openPondCommandAccessMode??_e;if(N==="disabled")return de(l,f,"Command access is disabled for this chat.",u);let R=Hn(l);if(N==="ask"&&!o.has(At(c.session.id,R))){let k=await d({command:l,cwd:f,family:R,input:c,timeoutSeconds:u});if(k==="acceptForSession"&&o.add(At(c.session.id,R)),k!=="accept"&&k!=="acceptForSession")return de(l,f,k==="cancel"?"Command was cancelled.":"Command was not approved.",u)}let V=e.executionEnvironment?await e.executionEnvironment(c):{};return Zn({command:l,cwd:f,timeoutSeconds:u,signal:c.signal,env:V})}i(s,"executeCommand");async function a(c,l){let u=r.get(c);if(!u)return null;let p=it.parse(l);r.delete(c);let f=er(p.decision),m={...u.approval,status:f};return await t(m),await n(Te({sessionId:m.sessionId,turnId:m.turnId??void 0,name:"approval.resolved",source:"server",action:"command",status:f==="accepted"||f==="accepted_for_session"?"completed":"failed",output:m.title,data:{approvalId:c,status:f,decision:p.decision,family:u.family}})),u.resolve(p.decision),m}i(a,"resolveApproval");async function d(c){let l={id:`approval_${Dn()}`,sessionId:c.input.session.id,turnId:c.input.turnId??null,providerRequestId:c.input.providerRequestId??c.input.turnId??c.input.session.id,kind:"command",title:c.command,detail:JSON.stringify({command:c.command,cwd:c.cwd,timeoutSeconds:c.timeoutSeconds,source:c.input.source,mode:c.input.session.openPondCommandAccessMode??_e,risk:Xn(c.command),sessionApprovalFamily:{key:c.family.key,label:c.family.label,broad:c.family.broad,reason:c.family.reason}},null,2),status:"pending",createdAt:dt()},u,p=new Promise(f=>{u=f});r.set(l.id,{approval:l,family:c.family,resolve:u});try{await t(l),await n(Te({sessionId:c.input.session.id,turnId:c.input.turnId??void 0,name:"approval.requested",source:"server",action:"command",appId:c.input.session.appId,status:"pending",output:l.title,data:l}))}catch(f){throw r.delete(l.id),f}return p}return i(d,"requestCommandApproval"),{executeCommand:s,resolveApproval:a}}i(Rs,"createOpenPondCommandAccessService");function Wt(e){return JSON.stringify({ok:e.ok,action:"exec_command",output:Qn(e),data:{command:e.command,cwd:e.cwd,exitCode:e.exitCode,stdout:Et(e.stdout),stderr:Et(e.stderr),timedOut:e.timedOut,timeoutSeconds:e.timeoutSeconds,truncated:e.truncated,blockedReason:e.blockedReason}},null,2)}i(Wt,"commandResultForModel");function Hn(e){let t=Kn(e);if(!t)return le(e,"Could not safely parse shell command.");let n=Gn(t);if(n===-1)return le(e,"Could not find command executable.");if(Vn(t))return le(e,"Shell operators require exact-command session approval.");let r=t[n],o=t[n+1]??null;return r==="pwd"?Y("pwd","pwd","Allowlisted read-only command."):r==="ls"?Y("ls","ls","Allowlisted directory listing command."):r==="git"&&o==="status"?Y("git status","git status","Allowlisted git status family."):r==="docker"&&o==="system"?Y("docker system","docker system","Allowlisted Docker system inspection family."):r==="bun"&&o==="run"?Y("bun run","bun run","Allowlisted Bun script execution family."):le(e,"Command is not in the broad session-approval allowlist.")}i(Hn,"classifyCommandFamily");function Kn(e){try{let t=(0,Mt.parse)(e),n=[];for(let r of t){if(typeof r=="string"){n.push(r);continue}if(!r||typeof r!="object")return null;let o=r.op;if(typeof o=="string"){n.push(o);continue}return null}return n}catch{return null}}i(Kn,"safeShellTokens");function Gn(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(!/^[A-Za-z_][A-Za-z0-9_]*=.*/.test(n))return t}return-1}i(Gn,"firstCommandTokenIndex");function Vn(e){return e.some(t=>/^(?:\||&&|\|\||;|&|<|>|\(|\)|\{|\})$/.test(t))}i(Vn,"hasUnsafeShellSyntax");function Y(e,t,n){return{key:e,label:t,broad:!0,reason:n}}i(Y,"broadFamily");function le(e,t){return{key:`exact:${e}`,label:e,broad:!1,reason:t}}i(le,"exactCommandFamily");function At(e,t){return`${e}:${t.key}`}i(At,"sessionFamilyKey");function Xn(e){let t=e.toLowerCase();return/\b(?:sudo|rm\s+-rf|mkfs|dd\s+if=|docker\s+(?:volume\s+rm|system\s+prune|container\s+rm)|kill(?:all)?)\b/.test(t)?"danger":/\b(?:npm|pnpm|yarn|bun)\s+(?:install|add|remove)|\bgit\s+(?:commit|push|reset|checkout|merge|rebase)|[>|]|\b(?:mv|cp|rm|touch|mkdir|docker\s+(?:run|build|compose))\b/.test(t)?"write":"read"}i(Xn,"commandRiskLabel");function Yn(e){let t=e.requestedCwd?.trim();return t?Z.isAbsolute(t)?Z.resolve(t):e.session.cwd?Z.resolve(e.session.cwd,t):null:e.session.cwd?.trim()||null}i(Yn,"resolveCommandCwd");function Pt(e){return Number.isFinite(e??NaN)?Math.max(1,Math.min(Math.floor(e),zn)):Un}i(Pt,"normalizedTimeout");function de(e,t,n,r){return{ok:!1,command:e,cwd:t,exitCode:null,stdout:"",stderr:n,timedOut:!1,timeoutSeconds:r,truncated:!1,blockedReason:n}}i(de,"blockedCommandResult");function Zn(e){return new Promise(t=>{let n=!1,r=!1,o="",s="",a=!1,d=null,c=ut(e.command),l=Ln(c.command,{cwd:e.cwd,shell:c.shell,env:{...process.env,PATH:pt(),...e.env},stdio:["ignore","pipe","pipe"],detached:process.platform!=="win32"}),u=i(h=>{n||(n=!0,clearTimeout(m),d&&clearTimeout(d),e.signal?.removeEventListener("abort",f),t(h))},"finish"),p=i((h,N)=>{let R=N.toString("utf8");h==="stdout"?o=Ae(o,R):s=Ae(s,R),o.length+s.length>=ue&&(a=!0)},"appendOutput"),f=i(()=>{Pe(l,"SIGTERM"),u({ok:!1,command:e.command,cwd:e.cwd,exitCode:null,stdout:o,stderr:s||"Command was interrupted.",timedOut:!1,timeoutSeconds:e.timeoutSeconds,truncated:a,blockedReason:"Command was interrupted."}),Ct(l)},"abort"),m=setTimeout(()=>{r=!0,Pe(l,"SIGTERM"),d=Ct(l)},e.timeoutSeconds*1e3);e.signal?.addEventListener("abort",f,{once:!0}),l.stdout?.on("data",h=>p("stdout",h)),l.stderr?.on("data",h=>p("stderr",h)),l.on("error",h=>{u({ok:!1,command:e.command,cwd:e.cwd,exitCode:null,stdout:o,stderr:h.message,timedOut:r,timeoutSeconds:e.timeoutSeconds,truncated:a,blockedReason:null})}),l.on("close",h=>{u({ok:!r&&(h??1)===0,command:e.command,cwd:e.cwd,exitCode:r?null:h??1,stdout:o,stderr:r?Ae(s,`
@@ -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};
@@ -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{a as b}from"./chunk-WLQEONBF.js";import{b as P}from"./chunk-3A2Y7UK3.js";import{f as _}from"./chunk-VJYOKU3C.js";import{d as h}from"./chunk-U7D6Q744.js";import{x}from"./chunk-HG2YFMVU.js";import{h as T}from"./chunk-4V73I4OL.js";import{h as E,j as I,k as y}from"./chunk-HVM2GUM3.js";import{F as w}from"./chunk-2MEOUS24.js";import{a as l}from"./chunk-FTQLQJQV.js";function L(e){let a=e.result.proposal,d=a?.edits.find(t=>t.target!=="harness.json")??a?.edits[0]??null,c=e.result.outcome.metadata.routed===!0,n=a?e.result.applyReceipt?.decision==="applied"?"applied":"retained":c?"routed":"no_action",r=a?.baseHarnessRelease??e.trigger.harnessRelease,o=n==="applied"?e.result.advanceReceipt?.nextRelease??r:null;return{schemaVersion:"openpond.localHarnessRefinerActivityDisplay.v1",visibility:C(e.session)?"always":"material_only",state:"completed",workspaceId:e.result.workspace.id,result:n,decision:a?"propose":c?"route":"no_action",route:a?.route??g(e.result.outcome.metadata.route),operation:d?.operation??null,target:d?.target??null,summary:d?.summary??g(e.result.outcome.metadata.summary)??U(n,a?.route??g(e.result.outcome.metadata.route)),expectedOutcome:a?.expectedOutcome??g(e.result.outcome.metadata.expectedOutcome),reason:e.result.outcome.reason,evidenceBasis:B(e.result),critiqueStatus:a?"passed":"not_applicable",validationStatus:W(e.result),validationReceipts:e.result.validations.map(t=>({id:t.id,contentHash:t.contentHash,status:t.status,summary:t.summary})),edits:a?.edits.map(t=>({id:t.id,operation:t.operation,target:t.target,summary:t.summary,content:t.content}))??[],trigger:{id:e.trigger.id,contentHash:e.trigger.contentHash},outcome:{id:e.result.outcome.id,contentHash:e.result.outcome.contentHash},proposal:a?{id:a.id,contentHash:a.contentHash}:null,applyReceipt:e.result.applyReceipt?{id:e.result.applyReceipt.id,contentHash:e.result.applyReceipt.contentHash}:null,advanceReceipt:e.result.advanceReceipt?{id:e.result.advanceReceipt.id,contentHash:e.result.advanceReceipt.contentHash}:null,inputHarness:r,outputHarness:o}}l(L,"localHarnessRefinerActivityDisplay");function B(e){let a=e.proposal?.metadata.evidenceBasis??e.outcome.metadata.evidenceBasis,d=E.safeParse(a);return d.success?d.data:null}l(B,"evidenceBasisFromResult");function W(e){if(!e.proposal)return"not_applicable";let a=new Map(e.validations.map(c=>[c.validationId,c])),d=e.proposal.validationPlan.filter(c=>c.required);return d.some(c=>!a.has(c.id))?"pending":d.every(c=>a.get(c.id)?.status==="passed")?"passed":"failed"}l(W,"proposalValidationStatus");function C(e){return e.metadata?.automatedTasksetWorkAttempt===!0||typeof e.metadata?.tasksetId=="string"||typeof e.metadata?.benchmarkRuntime=="string"}l(C,"isEvaluationSession");function g(e){return typeof e=="string"&&e.trim()?e.trim():null}l(g,"stringMetadata");function U(e,a){return e==="no_action"?"No reusable change":e==="routed"?a?`${k(a)} issue routed`:"Issue routed":e==="applied"?a?`${k(a)} change`:"Harness change":a?`${k(a)} change`:"Harness change"}l(U,"resultSummary");function k(e){return e.length>0?`${e[0].toUpperCase()}${e.slice(1)}`:e}l(k,"titleCase");function G(e){let a=new Set,d=l((async function(n){if(q(n.session))return;let r=await b({store:e.store,...n});if(!r)return;let o=r.trigger;if(o.decision==="route_deterministically"&&o.deterministicRoute){let t=T({schemaVersion:"openpond.improvementRouteDecision.v1",id:`route-${o.contentHash.slice(0,24)}`,trigger:{id:o.id,contentHash:o.contentHash},route:o.deterministicRoute,authority:"runtime_service",automatic:!0,reason:o.reason,createdAt:o.createdAt,metadata:{}});await e.store.saveHarnessImprovementArtifact(n.turn.harnessSnapshot.workspaceId,"route_decision",t);return}o.decision==="queue_refiner"&&await c(n,o,!1)}),"processLocalHarnessImprovementBoundary");async function c(n,r,o){if(r.decision!=="queue_refiner")throw new Error("Only queued Harness Refiner triggers can be enqueued.");if(a.has(r.contentHash))return;a.add(r.contentHash);let t=Date.now();try{await e.appendRuntimeEvent(h({sessionId:n.session.id,turnId:n.turn.id,name:"harness.refiner.queued",source:"server",appId:n.session.appId,status:"pending",output:r.reason,data:{triggerId:r.id,timeoutMs:I,maxOutputTokens:y,execution:"public_package",recoveredAfterRestart:o,activity:{schemaVersion:"openpond.localHarnessRefinerActivityDisplay.v1",visibility:D(n.session),state:"running",summary:"Reviewing this Work for a reusable improvement"}}}))}catch(f){throw a.delete(r.contentHash),f}e.queue.enqueue({label:"Refine the Local Harness from a recovered execution detour",metadata:{key:r.contentHash,sessionId:n.session.id,turnId:n.turn.id,triggerId:r.id,recoveredAfterRestart:o}},async()=>{let f=0,p=Date.now(),u=null,i=null;try{await e.appendRuntimeEvent(h({sessionId:n.session.id,turnId:n.turn.id,name:"harness.refiner.started",source:"server",appId:n.session.appId,status:"started",data:{triggerId:r.id,queueWaitMs:Math.max(0,p-t),timeoutMs:I,maxOutputTokens:y,execution:"public_package",recoveredAfterRestart:o,activity:{schemaVersion:"openpond.localHarnessRefinerActivityDisplay.v1",visibility:D(n.session),state:"running",summary:"Reviewing this Work for a reusable improvement"}}})),await e.prepareReview?.(r);let s=await P({store:e.store,storeDir:e.storeDir,loadActiveRefinerRelease:e.loadActiveRefinerRelease,trigger:r,signal:new AbortController().signal,stream:l(async function*({messages:O,signal:S}){u===null&&(u=Date.now());let M=f++,A=`harness-refiner:${r.id}:${M}`,v=await _({session:n.session,turn:n.turn,provider:"openpond",model:w,requestId:A,requestOrdinal:M,requestKind:"harness_refiner",upsert:e.upsertModelUsageRecord});try{for await(let m of e.streamOpenPondHostedChatTurn({model:w,messages:O,requestId:A,reasoningEffort:"low",maxTokens:y,signal:S}))m.type==="text_delta"&&m.text?(v.observeDelta({text:m.text}),yield{text:m.text}):m.type==="reasoning_delta"&&m.text?v.observeDelta({reasoningText:m.text}):m.type==="usage"&&v.observeDelta({usage:m.usage});await v.complete(),i=Date.now()}catch(m){throw i=Date.now(),await v.fail(m,S.aborted?"interrupted":"failed"),m}},"stream")}),R=Date.now(),H=L({session:n.session,trigger:r,result:s});await e.appendRuntimeEvent(h({sessionId:n.session.id,turnId:n.turn.id,name:"harness.refiner.completed",source:"server",appId:n.session.appId,status:"completed",output:s.outcome.reason,data:{recoveredAfterRestart:o,trigger:{id:r.id,contentHash:r.contentHash},outcome:{id:s.outcome.id,contentHash:s.outcome.contentHash,decision:s.outcome.decision,routed:s.outcome.metadata.routed===!0,route:typeof s.outcome.metadata.route=="string"?s.outcome.metadata.route:null},proposal:s.proposal?{id:s.proposal.id,contentHash:s.proposal.contentHash}:null,workspaceAdvance:s.advanceReceipt?.decision??null,activity:H,timing:{queueWaitMs:Math.max(0,p-t),modelDurationMs:u===null||i===null?null:Math.max(0,i-u),materializationDurationMs:i===null?null:Math.max(0,R-i),totalJobDurationMs:Math.max(0,R-p)}}}))}catch(s){let R=Date.now();throw await e.appendRuntimeEvent(h({sessionId:n.session.id,turnId:n.turn.id,name:"harness.refiner.failed",source:"server",appId:n.session.appId,status:"failed",output:s instanceof Error?s.message:String(s),data:{triggerId:r.id,recoveredAfterRestart:o,activity:{schemaVersion:"openpond.localHarnessRefinerActivityDisplay.v1",visibility:D(n.session),state:"failed",summary:"Refiner review failed",reason:s instanceof Error?s.message:String(s)},timing:{queueWaitMs:Math.max(0,p-t),modelDurationMs:u===null||i===null?null:Math.max(0,i-u),totalJobDurationMs:Math.max(0,R-p)}}})).catch(()=>{}),s}finally{a.delete(r.contentHash)}})}return l(c,"enqueueTrigger"),d.reconcilePending=async()=>{let n=await e.store.listPendingHarnessRefinerTriggers(),r=0;for(let{workspaceId:o,trigger:t}of n){let[f,p]=await Promise.all([e.store.getSession(t.runRef),e.store.getTurn(t.turnId)]);if(!f||!p||p.sessionId!==f.id)throw new Error(`Pending Harness Refiner trigger ${t.id} references an unavailable session or turn.`);if(q(f))continue;let u=p;if(!u.harnessSnapshot){let[i,s]=await Promise.all([e.store.getHarnessWorkspace(o),e.store.getHarnessRunOverlay(t.runRef)]),R=!!(i&&s&&t.overlay&&s.id===t.overlay.id&&s.revision===t.overlay.revision&&s.contentHash===t.overlay.contentHash&&s.workspace.workspaceId===o&&s.workspace.revision===i.revision&&s.workspace.sourceRevision===i.sourceRevision&&s.workspace.channelRevision===i.currentChannel.revision&&s.baseHarnessRelease.id===t.harnessRelease.id&&s.baseHarnessRelease.contentHash===t.harnessRelease.contentHash);if(!i||!s||!t.overlay||!R)throw new Error(`Pending Harness Refiner trigger ${t.id} cannot reconstruct its missing Harness snapshot.`);u=await e.store.updateTurn(u.id,H=>x.parse({...H,harnessSnapshot:{schemaVersion:"openpond.harnessTurnSnapshot.v1",workspaceId:o,workspaceRevision:s.workspace.revision,sourceRevision:s.workspace.sourceRevision,channelName:i.currentChannel.name,channelRevision:s.workspace.channelRevision,harnessRelease:t.harnessRelease,overlay:t.overlay}}))??u}if(u.harnessSnapshot?.workspaceId!==o)throw new Error(`Pending Harness Refiner trigger ${t.id} no longer matches its Harness workspace.`);await c({session:f,turn:u},t,!0),r+=1}return r},d}l(G,"createLocalHarnessImprovementRuntime");function q(e){return e.metadata?.source==="experiment-improvement"&&typeof e.metadata.refinementCandidate=="object"?!0:e.metadata?.automatedTasksetWorkAttempt===!0&&typeof e.metadata.parentModelRunId=="string"&&e.metadata.parentModelRunId.trim().length>0}l(q,"parentModelRunOwnsRefinement");function D(e){return e.metadata?.automatedTasksetWorkAttempt===!0||typeof e.metadata?.tasksetId=="string"||typeof e.metadata?.benchmarkRuntime=="string"?"always":"material_only"}l(D,"refinerActivityVisibility");export{G as a};
2
+ import{a as b}from"./chunk-WLQEONBF.js";import{b as P}from"./chunk-CQRA5TXF.js";import{f as _}from"./chunk-6OD2FKUS.js";import{d as h}from"./chunk-L5L3H6CI.js";import{x}from"./chunk-2THZ6GZY.js";import{h as T}from"./chunk-4V73I4OL.js";import{h as E,j as I,k as y}from"./chunk-HVM2GUM3.js";import{F as w}from"./chunk-2MEOUS24.js";import{a as l}from"./chunk-FTQLQJQV.js";function L(e){let a=e.result.proposal,d=a?.edits.find(t=>t.target!=="harness.json")??a?.edits[0]??null,c=e.result.outcome.metadata.routed===!0,n=a?e.result.applyReceipt?.decision==="applied"?"applied":"retained":c?"routed":"no_action",r=a?.baseHarnessRelease??e.trigger.harnessRelease,o=n==="applied"?e.result.advanceReceipt?.nextRelease??r:null;return{schemaVersion:"openpond.localHarnessRefinerActivityDisplay.v1",visibility:C(e.session)?"always":"material_only",state:"completed",workspaceId:e.result.workspace.id,result:n,decision:a?"propose":c?"route":"no_action",route:a?.route??g(e.result.outcome.metadata.route),operation:d?.operation??null,target:d?.target??null,summary:d?.summary??g(e.result.outcome.metadata.summary)??U(n,a?.route??g(e.result.outcome.metadata.route)),expectedOutcome:a?.expectedOutcome??g(e.result.outcome.metadata.expectedOutcome),reason:e.result.outcome.reason,evidenceBasis:B(e.result),critiqueStatus:a?"passed":"not_applicable",validationStatus:W(e.result),validationReceipts:e.result.validations.map(t=>({id:t.id,contentHash:t.contentHash,status:t.status,summary:t.summary})),edits:a?.edits.map(t=>({id:t.id,operation:t.operation,target:t.target,summary:t.summary,content:t.content}))??[],trigger:{id:e.trigger.id,contentHash:e.trigger.contentHash},outcome:{id:e.result.outcome.id,contentHash:e.result.outcome.contentHash},proposal:a?{id:a.id,contentHash:a.contentHash}:null,applyReceipt:e.result.applyReceipt?{id:e.result.applyReceipt.id,contentHash:e.result.applyReceipt.contentHash}:null,advanceReceipt:e.result.advanceReceipt?{id:e.result.advanceReceipt.id,contentHash:e.result.advanceReceipt.contentHash}:null,inputHarness:r,outputHarness:o}}l(L,"localHarnessRefinerActivityDisplay");function B(e){let a=e.proposal?.metadata.evidenceBasis??e.outcome.metadata.evidenceBasis,d=E.safeParse(a);return d.success?d.data:null}l(B,"evidenceBasisFromResult");function W(e){if(!e.proposal)return"not_applicable";let a=new Map(e.validations.map(c=>[c.validationId,c])),d=e.proposal.validationPlan.filter(c=>c.required);return d.some(c=>!a.has(c.id))?"pending":d.every(c=>a.get(c.id)?.status==="passed")?"passed":"failed"}l(W,"proposalValidationStatus");function C(e){return e.metadata?.automatedTasksetWorkAttempt===!0||typeof e.metadata?.tasksetId=="string"||typeof e.metadata?.benchmarkRuntime=="string"}l(C,"isEvaluationSession");function g(e){return typeof e=="string"&&e.trim()?e.trim():null}l(g,"stringMetadata");function U(e,a){return e==="no_action"?"No reusable change":e==="routed"?a?`${k(a)} issue routed`:"Issue routed":e==="applied"?a?`${k(a)} change`:"Harness change":a?`${k(a)} change`:"Harness change"}l(U,"resultSummary");function k(e){return e.length>0?`${e[0].toUpperCase()}${e.slice(1)}`:e}l(k,"titleCase");function G(e){let a=new Set,d=l((async function(n){if(q(n.session))return;let r=await b({store:e.store,...n});if(!r)return;let o=r.trigger;if(o.decision==="route_deterministically"&&o.deterministicRoute){let t=T({schemaVersion:"openpond.improvementRouteDecision.v1",id:`route-${o.contentHash.slice(0,24)}`,trigger:{id:o.id,contentHash:o.contentHash},route:o.deterministicRoute,authority:"runtime_service",automatic:!0,reason:o.reason,createdAt:o.createdAt,metadata:{}});await e.store.saveHarnessImprovementArtifact(n.turn.harnessSnapshot.workspaceId,"route_decision",t);return}o.decision==="queue_refiner"&&await c(n,o,!1)}),"processLocalHarnessImprovementBoundary");async function c(n,r,o){if(r.decision!=="queue_refiner")throw new Error("Only queued Harness Refiner triggers can be enqueued.");if(a.has(r.contentHash))return;a.add(r.contentHash);let t=Date.now();try{await e.appendRuntimeEvent(h({sessionId:n.session.id,turnId:n.turn.id,name:"harness.refiner.queued",source:"server",appId:n.session.appId,status:"pending",output:r.reason,data:{triggerId:r.id,timeoutMs:I,maxOutputTokens:y,execution:"public_package",recoveredAfterRestart:o,activity:{schemaVersion:"openpond.localHarnessRefinerActivityDisplay.v1",visibility:D(n.session),state:"running",summary:"Reviewing this Work for a reusable improvement"}}}))}catch(f){throw a.delete(r.contentHash),f}e.queue.enqueue({label:"Refine the Local Harness from a recovered execution detour",metadata:{key:r.contentHash,sessionId:n.session.id,turnId:n.turn.id,triggerId:r.id,recoveredAfterRestart:o}},async()=>{let f=0,p=Date.now(),u=null,i=null;try{await e.appendRuntimeEvent(h({sessionId:n.session.id,turnId:n.turn.id,name:"harness.refiner.started",source:"server",appId:n.session.appId,status:"started",data:{triggerId:r.id,queueWaitMs:Math.max(0,p-t),timeoutMs:I,maxOutputTokens:y,execution:"public_package",recoveredAfterRestart:o,activity:{schemaVersion:"openpond.localHarnessRefinerActivityDisplay.v1",visibility:D(n.session),state:"running",summary:"Reviewing this Work for a reusable improvement"}}})),await e.prepareReview?.(r);let s=await P({store:e.store,storeDir:e.storeDir,loadActiveRefinerRelease:e.loadActiveRefinerRelease,trigger:r,signal:new AbortController().signal,stream:l(async function*({messages:O,signal:S}){u===null&&(u=Date.now());let M=f++,A=`harness-refiner:${r.id}:${M}`,v=await _({session:n.session,turn:n.turn,provider:"openpond",model:w,requestId:A,requestOrdinal:M,requestKind:"harness_refiner",upsert:e.upsertModelUsageRecord});try{for await(let m of e.streamOpenPondHostedChatTurn({model:w,messages:O,requestId:A,reasoningEffort:"low",maxTokens:y,signal:S}))m.type==="text_delta"&&m.text?(v.observeDelta({text:m.text}),yield{text:m.text}):m.type==="reasoning_delta"&&m.text?v.observeDelta({reasoningText:m.text}):m.type==="usage"&&v.observeDelta({usage:m.usage});await v.complete(),i=Date.now()}catch(m){throw i=Date.now(),await v.fail(m,S.aborted?"interrupted":"failed"),m}},"stream")}),R=Date.now(),H=L({session:n.session,trigger:r,result:s});await e.appendRuntimeEvent(h({sessionId:n.session.id,turnId:n.turn.id,name:"harness.refiner.completed",source:"server",appId:n.session.appId,status:"completed",output:s.outcome.reason,data:{recoveredAfterRestart:o,trigger:{id:r.id,contentHash:r.contentHash},outcome:{id:s.outcome.id,contentHash:s.outcome.contentHash,decision:s.outcome.decision,routed:s.outcome.metadata.routed===!0,route:typeof s.outcome.metadata.route=="string"?s.outcome.metadata.route:null},proposal:s.proposal?{id:s.proposal.id,contentHash:s.proposal.contentHash}:null,workspaceAdvance:s.advanceReceipt?.decision??null,activity:H,timing:{queueWaitMs:Math.max(0,p-t),modelDurationMs:u===null||i===null?null:Math.max(0,i-u),materializationDurationMs:i===null?null:Math.max(0,R-i),totalJobDurationMs:Math.max(0,R-p)}}}))}catch(s){let R=Date.now();throw await e.appendRuntimeEvent(h({sessionId:n.session.id,turnId:n.turn.id,name:"harness.refiner.failed",source:"server",appId:n.session.appId,status:"failed",output:s instanceof Error?s.message:String(s),data:{triggerId:r.id,recoveredAfterRestart:o,activity:{schemaVersion:"openpond.localHarnessRefinerActivityDisplay.v1",visibility:D(n.session),state:"failed",summary:"Refiner review failed",reason:s instanceof Error?s.message:String(s)},timing:{queueWaitMs:Math.max(0,p-t),modelDurationMs:u===null||i===null?null:Math.max(0,i-u),totalJobDurationMs:Math.max(0,R-p)}}})).catch(()=>{}),s}finally{a.delete(r.contentHash)}})}return l(c,"enqueueTrigger"),d.reconcilePending=async()=>{let n=await e.store.listPendingHarnessRefinerTriggers(),r=0;for(let{workspaceId:o,trigger:t}of n){let[f,p]=await Promise.all([e.store.getSession(t.runRef),e.store.getTurn(t.turnId)]);if(!f||!p||p.sessionId!==f.id)throw new Error(`Pending Harness Refiner trigger ${t.id} references an unavailable session or turn.`);if(q(f))continue;let u=p;if(!u.harnessSnapshot){let[i,s]=await Promise.all([e.store.getHarnessWorkspace(o),e.store.getHarnessRunOverlay(t.runRef)]),R=!!(i&&s&&t.overlay&&s.id===t.overlay.id&&s.revision===t.overlay.revision&&s.contentHash===t.overlay.contentHash&&s.workspace.workspaceId===o&&s.workspace.revision===i.revision&&s.workspace.sourceRevision===i.sourceRevision&&s.workspace.channelRevision===i.currentChannel.revision&&s.baseHarnessRelease.id===t.harnessRelease.id&&s.baseHarnessRelease.contentHash===t.harnessRelease.contentHash);if(!i||!s||!t.overlay||!R)throw new Error(`Pending Harness Refiner trigger ${t.id} cannot reconstruct its missing Harness snapshot.`);u=await e.store.updateTurn(u.id,H=>x.parse({...H,harnessSnapshot:{schemaVersion:"openpond.harnessTurnSnapshot.v1",workspaceId:o,workspaceRevision:s.workspace.revision,sourceRevision:s.workspace.sourceRevision,channelName:i.currentChannel.name,channelRevision:s.workspace.channelRevision,harnessRelease:t.harnessRelease,overlay:t.overlay}}))??u}if(u.harnessSnapshot?.workspaceId!==o)throw new Error(`Pending Harness Refiner trigger ${t.id} no longer matches its Harness workspace.`);await c({session:f,turn:u},t,!0),r+=1}return r},d}l(G,"createLocalHarnessImprovementRuntime");function q(e){return e.metadata?.source==="experiment-improvement"&&typeof e.metadata.refinementCandidate=="object"?!0:e.metadata?.automatedTasksetWorkAttempt===!0&&typeof e.metadata.parentModelRunId=="string"&&e.metadata.parentModelRunId.trim().length>0}l(q,"parentModelRunOwnsRefinement");function D(e){return e.metadata?.automatedTasksetWorkAttempt===!0||typeof e.metadata?.tasksetId=="string"||typeof e.metadata?.benchmarkRuntime=="string"?"always":"material_only"}l(D,"refinerActivityVisibility");export{G as a};
@@ -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};