openpond 0.2.65 → 0.2.67

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 (375) hide show
  1. package/dist/app-server.d.ts +23 -0
  2. package/dist/app-server.js +1 -1
  3. package/dist/chunks/{acp-PHMBLRCV.js → acp-NASAJV5E.js} +1 -1
  4. package/dist/chunks/{acp-agent-A7GK2VSH.js → acp-agent-C3CRF6DT.js} +1 -1
  5. package/dist/chunks/{actions-command-VLKMHCMI.js → actions-command-BYPLSGZL.js} +1 -1
  6. package/dist/chunks/{app-layer-J66CQ2QN.js → app-layer-XIEZ6ALX.js} +1 -1
  7. package/dist/chunks/{app-server-evaluations-V6LRWDUF.js → app-server-evaluations-5YZUFXQ2.js} +1 -1
  8. package/dist/chunks/{app-server-harness-services-6ZRLA3YD.js → app-server-harness-services-N5F5QVZI.js} +1 -1
  9. package/dist/chunks/{app-server-runtime-OMR2VE6L.js → app-server-runtime-HJ2N57DL.js} +1 -1
  10. package/dist/chunks/{apps-IHUFERZO.js → apps-WJTW64NW.js} +1 -1
  11. package/dist/chunks/{chunk-ZWW227M3.js → chunk-263WS3TB.js} +1 -1
  12. package/dist/chunks/{chunk-HX6GXMDK.js → chunk-26ID6A5C.js} +1 -1
  13. package/dist/chunks/{chunk-DSJZS77R.js → chunk-2RSGVLZT.js} +4 -4
  14. package/dist/chunks/{chunk-L4EJ5R3B.js → chunk-2UZHLO2V.js} +1 -1
  15. package/dist/chunks/{chunk-QYQZQVVN.js → chunk-375PADDM.js} +1 -1
  16. package/dist/chunks/{chunk-FUFI4THX.js → chunk-43QYVOYA.js} +1 -1
  17. package/dist/chunks/{chunk-H5ML7735.js → chunk-46RMTR2Z.js} +1 -1
  18. package/dist/chunks/{chunk-Z2TOBS3P.js → chunk-4B7EGNYX.js} +1 -1
  19. package/dist/chunks/{chunk-2GJD23CM.js → chunk-4EZI4KCT.js} +1 -1
  20. package/dist/chunks/{chunk-DMO3UIS7.js → chunk-4JJ4RYIB.js} +1 -1
  21. package/dist/chunks/{chunk-UM6EQOT2.js → chunk-4NN5OLKW.js} +2 -2
  22. package/dist/chunks/{chunk-66HFW4OU.js → chunk-4VZJQRQI.js} +1 -1
  23. package/dist/chunks/{chunk-7PKTCMZ6.js → chunk-543QHE3D.js} +1 -1
  24. package/dist/chunks/{chunk-TVDZXDQW.js → chunk-5QOFUGYQ.js} +1 -1
  25. package/dist/chunks/{chunk-6S2MWJVD.js → chunk-5TPYBXWM.js} +1 -1
  26. package/dist/chunks/{chunk-WLZJOCLA.js → chunk-5ZNE43XC.js} +1 -1
  27. package/dist/chunks/{chunk-KOKBDIGR.js → chunk-6HQUIKC5.js} +1 -1
  28. package/dist/chunks/{chunk-3BJ7LPE3.js → chunk-6IS5OLI5.js} +1 -1
  29. package/dist/chunks/{chunk-VS3AMJEK.js → chunk-6LFTQBXP.js} +1 -1
  30. package/dist/chunks/{chunk-VD2TQCMH.js → chunk-7HAGSE7L.js} +1 -1
  31. package/dist/chunks/{chunk-NTM3KQ25.js → chunk-ADOCQA4D.js} +1 -1
  32. package/dist/chunks/{chunk-4D3CICBG.js → chunk-ATFV2NA4.js} +1 -1
  33. package/dist/chunks/{chunk-YU4JYWCA.js → chunk-AXO6OHJB.js} +1 -1
  34. package/dist/chunks/{chunk-5KJMFK65.js → chunk-AXYAEWWA.js} +1 -1
  35. package/dist/chunks/{chunk-Q4AXZY2P.js → chunk-B2K5WQZE.js} +1 -1
  36. package/dist/chunks/{chunk-ANG2YMMD.js → chunk-B7XJBP4U.js} +1 -1
  37. package/dist/chunks/{chunk-E2S2EMYQ.js → chunk-BBIA24GD.js} +6 -6
  38. package/dist/chunks/{chunk-CYQLXS2U.js → chunk-BUZ7CBJC.js} +1 -1
  39. package/dist/chunks/{chunk-MVPKU72J.js → chunk-CJDGLPNX.js} +1 -1
  40. package/dist/chunks/{chunk-ZU3YBRXS.js → chunk-CSU7RDA5.js} +1 -1
  41. package/dist/chunks/{chunk-JLW5BQVO.js → chunk-CWAQOFLP.js} +1 -1
  42. package/dist/chunks/{chunk-WKHGXLJD.js → chunk-CX7HKSQ4.js} +2 -2
  43. package/dist/chunks/{chunk-M5QPL5NO.js → chunk-D5OFN47Z.js} +1 -1
  44. package/dist/chunks/{chunk-QCJY6FTC.js → chunk-FCXDPVGJ.js} +1 -1
  45. package/dist/chunks/{chunk-FEQ7HNJR.js → chunk-FE2ENE3U.js} +1 -1
  46. package/dist/chunks/{chunk-6TRVEA3T.js → chunk-FVK4W27G.js} +1 -1
  47. package/dist/chunks/{chunk-7FBWUVX7.js → chunk-GC6RJBRZ.js} +1 -1
  48. package/dist/chunks/{chunk-5Z3AU5CL.js → chunk-H2XG5N7D.js} +1 -1
  49. package/dist/chunks/chunk-H6EUFJJK.js +2 -0
  50. package/dist/chunks/{chunk-V3S2B6WU.js → chunk-IDILAYCW.js} +1 -1
  51. package/dist/chunks/{chunk-KGUPAPGR.js → chunk-IF5A3XWP.js} +1 -1
  52. package/dist/chunks/chunk-IHAEZ73V.js +2 -0
  53. package/dist/chunks/{chunk-GDJ4X2ZN.js → chunk-IR2Y2VQY.js} +1 -1
  54. package/dist/chunks/{chunk-WBO6FQHR.js → chunk-IXZ5ZGIL.js} +1 -1
  55. package/dist/chunks/{chunk-67HXM6AL.js → chunk-K3LS5SK7.js} +1 -1
  56. package/dist/chunks/{chunk-4MQHIFZL.js → chunk-K6DB5QWG.js} +1 -1
  57. package/dist/chunks/{chunk-QJJNHKLT.js → chunk-KQD36SBJ.js} +1 -1
  58. package/dist/chunks/{chunk-LXZLLTYQ.js → chunk-LI56PPCN.js} +1 -1
  59. package/dist/chunks/{chunk-KAWXVMHI.js → chunk-MX7KV5DA.js} +1 -1
  60. package/dist/chunks/{chunk-LARJARMS.js → chunk-N54CPLVD.js} +1 -1
  61. package/dist/chunks/{chunk-JRGECNP3.js → chunk-OE2OOWEQ.js} +1 -1
  62. package/dist/chunks/{chunk-B32CW3NT.js → chunk-OY4B7Y3T.js} +1 -1
  63. package/dist/chunks/chunk-OYIFH2OM.js +2 -0
  64. package/dist/chunks/{chunk-C5B3FMV3.js → chunk-P6NQYXN6.js} +1 -1
  65. package/dist/chunks/{chunk-D7R2AAX2.js → chunk-QFL2VQKX.js} +1 -1
  66. package/dist/chunks/{chunk-Y3B6ZUE6.js → chunk-QOUOU7FE.js} +1 -1
  67. package/dist/chunks/{chunk-GIU3Z45P.js → chunk-QQLS5FB7.js} +1 -1
  68. package/dist/chunks/chunk-R5GRESW3.js +2 -0
  69. package/dist/chunks/{chunk-6ZTP6CUJ.js → chunk-R6MMWEH4.js} +1 -1
  70. package/dist/chunks/{chunk-XHBMK6LC.js → chunk-R6VI7MX5.js} +1 -1
  71. package/dist/chunks/{chunk-GFAI2MCJ.js → chunk-RS526BG7.js} +1 -1
  72. package/dist/chunks/{chunk-EVQISX7M.js → chunk-RWRKUO5D.js} +1 -1
  73. package/dist/chunks/{chunk-DXA2UHBE.js → chunk-SD2XDZQW.js} +1 -1
  74. package/dist/chunks/{chunk-S6UCVXBC.js → chunk-SODAOLAP.js} +1 -1
  75. package/dist/chunks/{chunk-UK5LGSGT.js → chunk-SVNEPXU3.js} +1 -1
  76. package/dist/chunks/{chunk-5WPMI6QX.js → chunk-TERKCK4I.js} +1 -1
  77. package/dist/chunks/{chunk-OKEC2EIE.js → chunk-TS5HNRZB.js} +1 -1
  78. package/dist/chunks/{chunk-5KWKSR4P.js → chunk-TSQ2I6XV.js} +1 -1
  79. package/dist/chunks/{chunk-YRDPVTEI.js → chunk-TV2LE2BD.js} +1 -1
  80. package/dist/chunks/chunk-U3MVH2YT.js +2 -0
  81. package/dist/chunks/{chunk-FS2VKOT7.js → chunk-UBTP3QWI.js} +1 -1
  82. package/dist/chunks/{chunk-7XOUM6RK.js → chunk-UKSSFB4Q.js} +1 -1
  83. package/dist/chunks/{chunk-W7NXFRHN.js → chunk-UNE52L3Y.js} +1 -1
  84. package/dist/chunks/{chunk-ZUT4EM64.js → chunk-UXO33ST5.js} +1 -1
  85. package/dist/chunks/{chunk-FHLSLOKH.js → chunk-V3ILZQER.js} +1 -1
  86. package/dist/chunks/chunk-V3T2OJBZ.js +33 -0
  87. package/dist/chunks/{chunk-QAEZNFAM.js → chunk-V5AOM5MZ.js} +1 -1
  88. package/dist/chunks/{chunk-LI3FTPAH.js → chunk-VEXJV5H5.js} +1 -1
  89. package/dist/chunks/{chunk-AF3AVDPP.js → chunk-VPAEFG7X.js} +1 -1
  90. package/dist/chunks/{chunk-FGOTSCSE.js → chunk-W3ZILZUL.js} +1 -1
  91. package/dist/chunks/{chunk-U2BD545L.js → chunk-WD6ANOLL.js} +1 -1
  92. package/dist/chunks/{chunk-OTUS7NTQ.js → chunk-WDKZMXIU.js} +1 -1
  93. package/dist/chunks/chunk-WGISITX6.js +4 -0
  94. package/dist/chunks/{chunk-55Q64WWF.js → chunk-XD4ZIQZ2.js} +1 -1
  95. package/dist/chunks/{chunk-W22KWKF6.js → chunk-XDFXKRTI.js} +1 -1
  96. package/dist/chunks/{chunk-GRLQHYAU.js → chunk-XEU4J4GJ.js} +1 -1
  97. package/dist/chunks/{chunk-IEVJLG3V.js → chunk-XGJG2ZKE.js} +1 -1
  98. package/dist/chunks/chunk-XHU4BZQY.js +13 -0
  99. package/dist/chunks/{chunk-DIDQHTAX.js → chunk-XKZ4PFMQ.js} +1 -1
  100. package/dist/chunks/{chunk-B666Z2NS.js → chunk-XT5WUQGT.js} +1 -1
  101. package/dist/chunks/{chunk-N2AV7PHV.js → chunk-YKTJPCYZ.js} +3 -3
  102. package/dist/chunks/{chunk-5AU5Y6KS.js → chunk-YMCF5GR2.js} +1 -1
  103. package/dist/chunks/{chunk-LYVHYT3L.js → chunk-YONDU5TN.js} +1 -1
  104. package/dist/chunks/{chunk-BTJACFU3.js → chunk-YQBL5P6R.js} +1 -1
  105. package/dist/chunks/{chunk-SAZTOGX6.js → chunk-YR5URT73.js} +1 -1
  106. package/dist/chunks/{chunk-OXRVILDW.js → chunk-ZVMQLIRA.js} +1 -1
  107. package/dist/chunks/{chunk-MHPCVQOE.js → chunk-ZWEY66RT.js} +1 -1
  108. package/dist/chunks/cli-HV32F7HD.js +2 -0
  109. package/dist/chunks/command-NWOZXU57.js +58 -0
  110. package/dist/chunks/{configuration-command-465ODYTC.js → configuration-command-ZEIBQKB3.js} +1 -1
  111. package/dist/chunks/{connected-app-executor-7DYMZCD7.js → connected-app-executor-DFHWNMRM.js} +1 -1
  112. package/dist/chunks/{connected-evidence-XPAZQRFQ.js → connected-evidence-WOM6N5HO.js} +1 -1
  113. package/dist/chunks/{connected-starting-assets-2YX3QVDB.js → connected-starting-assets-66Y46ZPM.js} +1 -1
  114. package/dist/chunks/{continual-HQCFY7GN.js → continual-TNPTWTKK.js} +1 -1
  115. package/dist/chunks/{core-commands-PJOGRBHJ.js → core-commands-GWRHH53F.js} +1 -1
  116. package/dist/chunks/{dataset-preparation-authoring-KWRTMKN6.js → dataset-preparation-authoring-WJ2XEUO7.js} +1 -1
  117. package/dist/chunks/{datasets-OTE2I4VT.js → datasets-XIMF54QN.js} +1 -1
  118. package/dist/chunks/{desktop-test-Q6REQJ7K.js → desktop-test-HF42V2EP.js} +1 -1
  119. package/dist/chunks/dist-T6ES2TSM.js +2 -0
  120. package/dist/chunks/{evaluation-coordination-KRCY2H4C.js → evaluation-coordination-WZT6FDMS.js} +1 -1
  121. package/dist/chunks/{experiment-improvements-7MI2VYBR.js → experiment-improvements-H35VS6XZ.js} +1 -1
  122. package/dist/chunks/{experiments-CNUQKJZE.js → experiments-F54C32EE.js} +1 -1
  123. package/dist/chunks/{experiments-signal-4N344D4Y.js → experiments-signal-ONIGTGYR.js} +1 -1
  124. package/dist/chunks/{help-ZUKVY6RO.js → help-O53DTZGN.js} +1 -1
  125. package/dist/chunks/host-profile-evaluation-tools-LMCJ3MDJ.js +2 -0
  126. package/dist/chunks/{host-profile-external-dataset-YRKG2GL5.js → host-profile-external-dataset-4HOXANWK.js} +1 -1
  127. package/dist/chunks/{hosted-app-server-composition-DWSU6ASL.js → hosted-app-server-composition-Y64A2A2B.js} +1 -1
  128. package/dist/chunks/{hosted-experiment-improvement-NZTPZTDH.js → hosted-experiment-improvement-B2V2WIUI.js} +1 -1
  129. package/dist/chunks/hosted-harness-runtime-C7I4KSDK.js +2 -0
  130. package/dist/chunks/{hosted-profile-candidate-3CAT3XBI.js → hosted-profile-candidate-CXPVEEYQ.js} +1 -1
  131. package/dist/chunks/{hosted-profile-compiler-RXU626Q6.js → hosted-profile-compiler-FGCI2VRW.js} +1 -1
  132. package/dist/chunks/{hosted-profile-evaluation-control-CBDRKJ5J.js → hosted-profile-evaluation-control-INNUYMBD.js} +1 -1
  133. package/dist/chunks/{hosted-profile-evaluation-inspection-CHYKDYUQ.js → hosted-profile-evaluation-inspection-UPTBRYMS.js} +1 -1
  134. package/dist/chunks/{hosted-profile-evaluation-preparation-H5S7JZMD.js → hosted-profile-evaluation-preparation-TIQSVKLQ.js} +1 -1
  135. package/dist/chunks/{hosted-tasksets-AMGDDB2R.js → hosted-tasksets-7VMYOTIO.js} +1 -1
  136. package/dist/chunks/{human-review-HOBGC6RC.js → human-review-7XC77NQP.js} +1 -1
  137. package/dist/chunks/{import-Q3YRFVY7.js → import-OBAKUJPM.js} +1 -1
  138. package/dist/chunks/javascript-isolate-process-source-YAT3GPW4.js +2 -0
  139. package/dist/chunks/javascript-verifier-worker-source-LGRP74W4.js +2 -0
  140. package/dist/chunks/learning-3XDGIYUL.js +2 -0
  141. package/dist/chunks/{learning-XTY5VOTK.js → learning-CRR6NRPN.js} +1 -1
  142. package/dist/chunks/{local-harness-improvement-runtime-XEA73RGS.js → local-harness-improvement-runtime-UIKQSAMM.js} +1 -1
  143. package/dist/chunks/{local-harness-taskset-review-SW35G4DM.js → local-harness-taskset-review-6KJN3EQL.js} +1 -1
  144. package/dist/chunks/{model-projects-GHWCKDON.js → model-projects-HP4DELCP.js} +1 -1
  145. package/dist/chunks/{opchat-2LLDIWEJ.js → opchat-NWYWWIA7.js} +1 -1
  146. package/dist/chunks/{opchat-bounded-chat-FLDS36LU.js → opchat-bounded-chat-ICURZM6R.js} +1 -1
  147. package/dist/chunks/{organizations-VIFSOY6P.js → organizations-7DBQGCCV.js} +1 -1
  148. package/dist/chunks/{profile-KIHMW2WB.js → profile-3WZJ65CT.js} +1 -1
  149. package/dist/chunks/{project-action-payload-2G57RL74.js → project-action-payload-7DRABTHY.js} +1 -1
  150. package/dist/chunks/{project-agent-TJLQNMLA.js → project-agent-AXJOWXRU.js} +1 -1
  151. package/dist/chunks/{published-experiment-source-D3C2AWQD.js → published-experiment-source-YBBPLNF2.js} +1 -1
  152. package/dist/chunks/{refiner-profile-service-PPGGNVOV.js → refiner-profile-service-ATEFPF5O.js} +1 -1
  153. package/dist/chunks/{runtime-VSOOPNYN.js → runtime-XP4DEGR3.js} +1 -1
  154. package/dist/chunks/{sandbox-command-CQO6BEMQ.js → sandbox-command-CF2PJCFX.js} +1 -1
  155. package/dist/chunks/{sandbox-template-MU33IILL.js → sandbox-template-YFMHEMUQ.js} +1 -1
  156. package/dist/chunks/{saved-work-LAVTNKPT.js → saved-work-3OAVRBH3.js} +1 -1
  157. package/dist/chunks/setup-RHIMFI2Y.js +2 -0
  158. package/dist/chunks/{src-662QOKNP.js → src-GQPWOPYA.js} +1 -1
  159. package/dist/chunks/{src-CHQVWHV7.js → src-V236S6MV.js} +112 -112
  160. package/dist/chunks/{standalone-experiment-turn-owner-KKYIGGPF.js → standalone-experiment-turn-owner-CDRMGLWW.js} +1 -1
  161. package/dist/chunks/{store-chat-resources-ZWDYMDJF.js → store-chat-resources-P4EKCLSY.js} +1 -1
  162. package/dist/chunks/{store-continual-support-reviews-7PDLGRWF.js → store-continual-support-reviews-VVRQO2JK.js} +1 -1
  163. package/dist/chunks/{store-conversation-serving-WRT4N7N2.js → store-conversation-serving-YFEZYQD3.js} +1 -1
  164. package/dist/chunks/{store-create-improve-G46KIUVT.js → store-create-improve-2XI36AET.js} +1 -1
  165. package/dist/chunks/{store-datasets-O67F75BL.js → store-datasets-UFY422NG.js} +1 -1
  166. package/dist/chunks/{store-evaluation-results-BEPR4LVD.js → store-evaluation-results-VBH4R2U7.js} +1 -1
  167. package/dist/chunks/{store-harness-workspaces-PJJQ74G6.js → store-harness-workspaces-SGUEYDO2.js} +1 -1
  168. package/dist/chunks/{store-human-review-HJ3D7ZFA.js → store-human-review-RFCVZ3HP.js} +1 -1
  169. package/dist/chunks/{store-learned-preference-migration-validation-EXNRDHCO.js → store-learned-preference-migration-validation-FNBGGZU6.js} +1 -1
  170. package/dist/chunks/{store-learning-6P6IS7GH.js → store-learning-BFOT4QVT.js} +1 -1
  171. package/dist/chunks/{store-learning-credentials-EGJ2WTZI.js → store-learning-credentials-DYTMWQTC.js} +1 -1
  172. package/dist/chunks/{store-local-experiments-CBJA56X2.js → store-local-experiments-XPXGYXNM.js} +1 -1
  173. package/dist/chunks/{store-model-batch-review-YIVD7T2T.js → store-model-batch-review-J2L5JQV2.js} +1 -1
  174. package/dist/chunks/{store-model-configuration-T6XJJDAB.js → store-model-configuration-NJFWSYSA.js} +1 -1
  175. package/dist/chunks/{store-model-project-preparation-WWU5CJTV.js → store-model-project-preparation-OCLIFKI2.js} +1 -1
  176. package/dist/chunks/{store-preference-comparison-XQFTLMGH.js → store-preference-comparison-MZAYONCK.js} +1 -1
  177. package/dist/chunks/{store-task-inbox-VVXZUJIO.js → store-task-inbox-3BREANOX.js} +1 -1
  178. package/dist/chunks/{store-task-inventory-MQX44AI6.js → store-task-inventory-5HRZCDUT.js} +1 -1
  179. package/dist/chunks/{store-taskset-drafts-G3WFVN4M.js → store-taskset-drafts-BNKUVHPA.js} +1 -1
  180. package/dist/chunks/{store-training-DUVIDYK5.js → store-training-S3FXWLT6.js} +1 -1
  181. package/dist/chunks/{store-training-jobs-HHFH3V5O.js → store-training-jobs-2LCXPA7G.js} +1 -1
  182. package/dist/chunks/{store-training-models-C7UUZDTO.js → store-training-models-7AMKS7ZW.js} +1 -1
  183. package/dist/chunks/{taskset-7FQCJ55X.js → taskset-PLKWRT4X.js} +1 -1
  184. package/dist/chunks/{taskset-packages-NRRPON7B.js → taskset-packages-SXBLYHSP.js} +1 -1
  185. package/dist/chunks/{taskset-packages-RW4SFGDU.js → taskset-packages-V5T4V7YN.js} +1 -1
  186. package/dist/chunks/{teams-bot-D3LWA4S5.js → teams-bot-VQXUA7U4.js} +1 -1
  187. package/dist/chunks/{tool-learning-NGO7QHYK.js → tool-learning-47XQKELE.js} +1 -1
  188. package/dist/chunks/{training-XFM3OOPN.js → training-7VQNCOGH.js} +1 -1
  189. package/dist/chunks/{training-XILDD5RG.js → training-VKLPNCMC.js} +1 -1
  190. package/dist/chunks/{training-hosted-6BX2IASC.js → training-hosted-NNE6BP6S.js} +1 -1
  191. package/dist/chunks/training-hosted-checkpoint-evaluation-2X7RSOLC.js +2 -0
  192. package/dist/chunks/{training-hosted-learning-YN5VD3PW.js → training-hosted-learning-WQ2IP5FP.js} +1 -1
  193. package/dist/chunks/training-hosted-report-T633TNJG.js +2 -0
  194. package/dist/chunks/training-hosted-serving-report-VZ4SMLMG.js +2 -0
  195. package/dist/chunks/training-hosted-workers-Y2PO5IOA.js +2 -0
  196. package/dist/chunks/{training-model-start-E5MP3URL.js → training-model-start-G7YDZ7ZG.js} +1 -1
  197. package/dist/cli.js +1 -1
  198. package/dist/index.js +1 -1
  199. package/dist/skills/manifest.json +1 -1
  200. package/dist/web/assets/App-DmEA-Lia.js +53 -0
  201. package/dist/web/assets/{AppDialog-BILEK4np.js → AppDialog-BvskhHE9.js} +1 -1
  202. package/dist/web/assets/AppTerminalPanel-ScQKJV4z.js +2 -0
  203. package/dist/web/assets/{AppToastContext-C-FsCKXW.js → AppToastContext-D2788RqX.js} +1 -1
  204. package/dist/web/assets/AppsView-B1uNg9IQ.js +1 -0
  205. package/dist/web/assets/{AppsView-DNHWzJb2.css → AppsView-D3vVesNd.css} +1 -1
  206. package/dist/web/assets/{AttachmentTypeIcon-Bh7Ft_UL.js → AttachmentTypeIcon-DVluUHuc.js} +1 -1
  207. package/dist/web/assets/{BrowserSidebar-BG2MLJ9I.js → BrowserSidebar-DfVQoJHn.js} +1 -1
  208. package/dist/web/assets/{CartesianChart-CS6ES_XT.js → CartesianChart-DdBZ69lI.js} +1 -1
  209. package/dist/web/assets/{ChatTimelineEntry-Dr5X_XyN.js → ChatTimelineEntry-Bbc6HRks.js} +1 -1
  210. package/dist/web/assets/{CollaborationTabs-CPJ2w67F.js → CollaborationTabs-ba6WupeJ.js} +1 -1
  211. package/dist/web/assets/{CommandMenu-Fe1V7NJd.js → CommandMenu-D7wTaEgl.js} +1 -1
  212. package/dist/web/assets/{CommunityView-DHTcmOnI.js → CommunityView-mO58f2B0.js} +1 -1
  213. package/dist/web/assets/{ComposerAttachments-Ck9VWD6o.js → ComposerAttachments-aO90qXYz.js} +1 -1
  214. package/dist/web/assets/{ComposerCreateImproveStrip-yiXO7cf8.js → ComposerCreateImproveStrip-BPUJBSyS.js} +1 -1
  215. package/dist/web/assets/{ConversationImportsSettings-_VLzUnHQ.js → ConversationImportsSettings-Bo836wKJ.js} +1 -1
  216. package/dist/web/assets/{FilePagePreview-BpcM1DfE.js → FilePagePreview-C6wIp6uX.js} +2 -2
  217. package/dist/web/assets/{GetStartedView-BH-WJ-rW.js → GetStartedView-CxMv8q-h.js} +1 -1
  218. package/dist/web/assets/{GettingStartedDialog-CdQfj7RA.js → GettingStartedDialog-CEb0cS-o.js} +1 -1
  219. package/dist/web/assets/{HostedModelLearningReview-C3GsOlu9.js → HostedModelLearningReview-BQIS7hkd.js} +1 -1
  220. package/dist/web/assets/HostedModelLearningSettings-BQ-YeFMT.js +1 -0
  221. package/dist/web/assets/{HtmlVisual-CH0tb3fv.js → HtmlVisual-CCuUkYT8.js} +1 -1
  222. package/dist/web/assets/{LabModelVersionDetailPage-J2t9yILv.js → LabModelVersionDetailPage-BkHeVbAx.js} +1 -1
  223. package/dist/web/assets/{LabSkillSidebar-DdDYvfj2.js → LabSkillSidebar-CFROlATQ.js} +1 -1
  224. package/dist/web/assets/LabsRoute-YA9YckKj.js +101 -0
  225. package/dist/web/assets/MainChatThread-DpyPgGKW.js +2 -0
  226. package/dist/web/assets/{MainPane-Dje-hfUM.css → MainPane-BOWkynGB.css} +1 -1
  227. package/dist/web/assets/MainPane-WOeodByM.js +10 -0
  228. package/dist/web/assets/NativeSetupTerminal-fmG2c65K.js +2 -0
  229. package/dist/web/assets/{NativeSkillSidebar-DPYavzau.js → NativeSkillSidebar-MAJWS4mL.js} +1 -1
  230. package/dist/web/assets/{NewProjectDialog-BtmvE9Sp.js → NewProjectDialog-MQiUBVx3.js} +1 -1
  231. package/dist/web/assets/{OutputsPage-BMRY7RK2.js → OutputsPage-DpF-aRTu.js} +1 -1
  232. package/dist/web/assets/{PageChrome-5VRxH6Rp.js → PageChrome-8gH2hyDb.js} +1 -1
  233. package/dist/web/assets/{ProjectsPage-1LHqxOMo.js → ProjectsPage-BQ98oGyu.js} +1 -1
  234. package/dist/web/assets/{RightChatPanelStack-D_7KgExz.js → RightChatPanelStack-Bs7A4dLs.js} +1 -1
  235. package/dist/web/assets/RightSidebarHomePanel-C-D4kba2.js +1 -0
  236. package/dist/web/assets/{ScheduledWorkPage-Dtz4zJ0T.js → ScheduledWorkPage-CGCqZz_H.js} +1 -1
  237. package/dist/web/assets/{SettingsView-BeDYNPcD.js → SettingsView-CqpMFLxy.js} +3 -3
  238. package/dist/web/assets/{TasksetDraftEditorPrimitives-CcvKO3YA.js → TasksetDraftEditorPrimitives-DJvIvzBb.js} +1 -1
  239. package/dist/web/assets/{TeamChatView-DaXxOkTe.js → TeamChatView-DjmIaLO1.js} +1 -1
  240. package/dist/web/assets/{TerminalOverlay-CF8uB4qA.js → TerminalOverlay-D--M876l.js} +1 -1
  241. package/dist/web/assets/{TrainingCreationPanel-DmMO7x5T.js → TrainingCreationPanel-DDUoHQHU.js} +1 -1
  242. package/dist/web/assets/{TrainingDraftPanel-DCHbXjSx.js → TrainingDraftPanel-CwLXn3Z7.js} +1 -1
  243. package/dist/web/assets/{TrainingRunLineage-CwisTWs_.js → TrainingRunLineage-CtYe1KGX.js} +1 -1
  244. package/dist/web/assets/{UsageSettingsSection-Drt7gwRb.js → UsageSettingsSection-CGwPregx.js} +1 -1
  245. package/dist/web/assets/WorkSidebarPanel-C6wWuo7U.js +1 -0
  246. package/dist/web/assets/{WorkspaceDiffPanel-Dmbrg0-y.js → WorkspaceDiffPanel-JDOUmrC-.js} +3 -3
  247. package/dist/web/assets/{WorkspaceEnvironmentMenu-KEZm1gdb.js → WorkspaceEnvironmentMenu-sfL5LZeB.js} +1 -1
  248. package/dist/web/assets/{WorkspaceFileLocation-ChbOKrPO.js → WorkspaceFileLocation-D-ctFM4d.js} +1 -1
  249. package/dist/web/assets/{WorkspaceGitDialogs-BS2JQKNQ.js → WorkspaceGitDialogs-CQ28j3R7.js} +1 -1
  250. package/dist/web/assets/{WorkspaceMonacoEditor-CN1hE_C4.js → WorkspaceMonacoEditor-BrZs6-EW.js} +3 -3
  251. package/dist/web/assets/{WorkspacePdfPreview-Clb4m0le.js → WorkspacePdfPreview-CU6PSjjN.js} +2 -2
  252. package/dist/web/assets/{WorkspacePresentationPreview-CwQsdvAR.js → WorkspacePresentationPreview-IjXVXpIy.js} +1 -1
  253. package/dist/web/assets/{app-models-Cz3yxq4x.js → app-models-CKXrDTEU.js} +1 -1
  254. package/dist/web/assets/{bot-BNFltD5O.js → bot-Cd761lRF.js} +1 -1
  255. package/dist/web/assets/{browser-sidebar-links-ZyYiYBBd.js → browser-sidebar-links-D9v2cyJa.js} +1 -1
  256. package/dist/web/assets/chat-resources-BUDXdoG0.js +1 -0
  257. package/dist/web/assets/{chevron-down-BnnT0tnM.js → chevron-down-DEbd6Ek-.js} +1 -1
  258. package/dist/web/assets/chevron-right-DLYNg_Oq.js +1 -0
  259. package/dist/web/assets/{chevron-up-BAnwJJN3.js → chevron-up-DFJJccDl.js} +1 -1
  260. package/dist/web/assets/chunk-GHPCQXG5-DKDBSd8H.js +9 -0
  261. package/dist/web/assets/chunk-GJRXJL6G-luaxRTYI.js +1 -0
  262. package/dist/web/assets/chunk-H3JZ3P5T-CzpTARDY.js +2 -0
  263. package/dist/web/assets/chunk-JDQVAG3R-C0-rh1aR.js +1 -0
  264. package/dist/web/assets/chunk-TLSP5JKG-BrrVo5rJ.js +1 -0
  265. package/dist/web/assets/chunk-XMVSQIK4-BBU7r_NH.js +1 -0
  266. package/dist/web/assets/client-BNjO4Xi8.js +1 -0
  267. package/dist/web/assets/{client-choice-storage-Iuzoszas.js → client-choice-storage-DUWsS4X0.js} +1 -1
  268. package/dist/web/assets/{cloud-upload-CdSXJ7ms.js → cloud-upload-CoM1FGeB.js} +1 -1
  269. package/dist/web/assets/{common-BMjyKlX-.js → common-CFsO2ppZ.js} +1 -1
  270. package/dist/web/assets/{copy-CBFg6m0d.js → copy-BGOhV6Pk.js} +1 -1
  271. package/dist/web/assets/{create-pipeline-CyUZrbbO.js → create-pipeline-DRR0Qeec.js} +1 -1
  272. package/dist/web/assets/{createLucideIcon-DF2VR6WA.js → createLucideIcon-Bv-_eGcE.js} +1 -1
  273. package/dist/web/assets/{cssMode-BSQUZhUO.js → cssMode-SclUkqPt.js} +1 -1
  274. package/dist/web/assets/{external-link-Cql9bKdv.js → external-link-CVXsNeO3.js} +1 -1
  275. package/dist/web/assets/{folder-open-BXdVB5J1.js → folder-open-MnOmh19D.js} +1 -1
  276. package/dist/web/assets/{folder-plus-Cma2HulC.js → folder-plus-BRddLBtO.js} +1 -1
  277. package/dist/web/assets/{git-commit-horizontal-eF--16ps.js → git-commit-horizontal-Bm4rkXug.js} +1 -1
  278. package/dist/web/assets/{htmlMode-aLPlQtyU.js → htmlMode-X3mQtOeh.js} +1 -1
  279. package/dist/web/assets/icons-CZxmQtZs.js +1 -0
  280. package/dist/web/assets/{image-CqKPwnBn.js → image-BViGUAiq.js} +1 -1
  281. package/dist/web/assets/{index-CM0IRu1U.js → index-LXNhSUEL.js} +2 -2
  282. package/dist/web/assets/{info-CqeYEqG0.js → info-DYPIbKKD.js} +1 -1
  283. package/dist/web/assets/intake-contracts-wCkD2ErR.js +1 -0
  284. package/dist/web/assets/{jsonMode-fu7bEcHB.js → jsonMode-BoKiIdHd.js} +1 -1
  285. package/dist/web/assets/loader-circle-JFgFNsP5.js +1 -0
  286. package/dist/web/assets/{lspLanguageFeatures-DraXQA4w.js → lspLanguageFeatures-CO2mzpy1.js} +1 -1
  287. package/dist/web/assets/{maximize-2-yMp8X9ts.js → maximize-2-DXZCQO0b.js} +1 -1
  288. package/dist/web/assets/{message-square-DbIMQqfj.js → message-square-cOCAL8J1.js} +1 -1
  289. package/dist/web/assets/{monaco.contribution-BQhp1CJs.js → monaco.contribution-C7CAQIKF.js} +2 -2
  290. package/dist/web/assets/{monaco.contribution-Bd8EqYGR.js → monaco.contribution-CVe3mWSY.js} +2 -2
  291. package/dist/web/assets/{monaco.contribution-CYWKnVxQ.js → monaco.contribution-hrusiaZi.js} +2 -2
  292. package/dist/web/assets/{monaco.contribution-CmbWO0tB.js → monaco.contribution-wacA5FjV.js} +2 -2
  293. package/dist/web/assets/{monitor-DFE2fTkT.js → monitor-B35XSAvn.js} +1 -1
  294. package/dist/web/assets/{paperclip-D_qsKbVs.js → paperclip-CKgDxioG.js} +1 -1
  295. package/dist/web/assets/{pdf-DkQRsi4n.js → pdf-Ct3M2mVw.js} +1 -1
  296. package/dist/web/assets/play-DzqLr7fM.js +1 -0
  297. package/dist/web/assets/plus-Ddp1vXnw.js +1 -0
  298. package/dist/web/assets/{ponder-desktop-Dm7tOkKo.js → ponder-desktop-D-zB6X4L.js} +1 -1
  299. package/dist/web/assets/{presentation-BN_kIBPL.js → presentation-B0S9v7ib.js} +1 -1
  300. package/dist/web/assets/{profile-ref-DSNkG6Ol.js → profile-ref-CCxrOCio.js} +1 -1
  301. package/dist/web/assets/{python-DB9pj5Hr.js → python-C0-pUUAU.js} +1 -1
  302. package/dist/web/assets/{refresh-cw-B27ohHfn.js → refresh-cw-D45mW-vs.js} +1 -1
  303. package/dist/web/assets/{requests-BCbaFiqV.js → requests-DjSt-duM.js} +1 -1
  304. package/dist/web/assets/{reward-checks-Bcq9ETCA.js → reward-checks-D139zwha.js} +2 -2
  305. package/dist/web/assets/{save-D-rwjKop.js → save-Gu4R_82E.js} +1 -1
  306. package/dist/web/assets/schemas-C9IwV7NS.js +64 -0
  307. package/dist/web/assets/{settings-D7C-Auyi.js → settings-DdonLCIN.js} +1 -1
  308. package/dist/web/assets/settings-lists-CFHFtO0D.js +5 -0
  309. package/dist/web/assets/square-Dqduqyyu.js +1 -0
  310. package/dist/web/assets/{square-terminal-CeoK51wH.js → square-terminal-DS3zwi6X.js} +1 -1
  311. package/dist/web/assets/{submit-issue-command-DZNW7Evj.js → submit-issue-command-Gk3RKrY-.js} +1 -1
  312. package/dist/web/assets/{toggleHighContrast-Bs8L1gx0.js → toggleHighContrast-BnYUBgZB.js} +1 -1
  313. package/dist/web/assets/training-QBuGBGJd.js +2 -0
  314. package/dist/web/assets/{training-model-data-wHvE7xL1.js → training-model-data-CxR3xpmK.js} +1 -1
  315. package/dist/web/assets/{tsMode-C7EqshxC.js → tsMode-BVNyOY8h.js} +1 -1
  316. package/dist/web/assets/{upload-BWgjC2Jf.js → upload-ABSJxuUM.js} +1 -1
  317. package/dist/web/assets/{useAccountSettings-Dva1MpsJ.js → useAccountSettings-4_XfwJQi.js} +1 -1
  318. package/dist/web/assets/{useAgentInventory-CrjIOmvb.js → useAgentInventory-CVuamyT3.js} +1 -1
  319. package/dist/web/assets/{useLocalAgentSchedules-P-UaUKMb.js → useLocalAgentSchedules-CmwN4ohy.js} +1 -1
  320. package/dist/web/assets/{useQuery-Bn3KqR4r.js → useQuery-CCjwL8VI.js} +1 -1
  321. package/dist/web/assets/{wifi-off--mKrSPFc.js → wifi-off-DGJH7Pke.js} +1 -1
  322. package/dist/web/assets/{work-outputs-CK0nHe4g.js → work-outputs-CnbRtTLg.js} +1 -1
  323. package/dist/web/assets/{workers-p0Kn2KMK.js → workers-CjtQ2aBD.js} +1 -1
  324. package/dist/web/assets/x-B-_zJVOZ.js +1 -0
  325. package/dist/web/assets/{yaml-BeIdC4tu.js → yaml-N1KUjBZ8.js} +1 -1
  326. package/dist/web/index.html +1 -1
  327. package/docs/command-reference.md +7 -1
  328. package/package.json +1 -1
  329. package/dist/chunks/chunk-3MVKXAH7.js +0 -2
  330. package/dist/chunks/chunk-G4E3WGLM.js +0 -13
  331. package/dist/chunks/chunk-I3NYYOSS.js +0 -2
  332. package/dist/chunks/chunk-JBFPTEVE.js +0 -2
  333. package/dist/chunks/chunk-LOIYNRBC.js +0 -33
  334. package/dist/chunks/chunk-MMJU6PZV.js +0 -2
  335. package/dist/chunks/chunk-OW3EOC5Q.js +0 -4
  336. package/dist/chunks/chunk-YBKDEEEH.js +0 -2
  337. package/dist/chunks/cli-TE7RP5H7.js +0 -2
  338. package/dist/chunks/command-NDHFZAKA.js +0 -13
  339. package/dist/chunks/dist-J4KHAVO3.js +0 -2
  340. package/dist/chunks/host-profile-evaluation-tools-75EPCRSZ.js +0 -2
  341. package/dist/chunks/hosted-harness-runtime-3AJGEIFD.js +0 -2
  342. package/dist/chunks/javascript-isolate-process-source-ZPQKKLR4.js +0 -2
  343. package/dist/chunks/javascript-verifier-worker-source-F3LSGPOY.js +0 -2
  344. package/dist/chunks/learning-NJLTGZFQ.js +0 -2
  345. package/dist/chunks/setup-HSRCZ3WR.js +0 -2
  346. package/dist/chunks/training-hosted-checkpoint-evaluation-UXFW33QL.js +0 -2
  347. package/dist/chunks/training-hosted-report-UVGTPDOK.js +0 -2
  348. package/dist/chunks/training-hosted-serving-report-J4YOZLRP.js +0 -2
  349. package/dist/chunks/training-hosted-workers-6JTDCCWA.js +0 -2
  350. package/dist/web/assets/App-BZuSv1XM.js +0 -53
  351. package/dist/web/assets/AppTerminalPanel-BvxZ8bwD.js +0 -2
  352. package/dist/web/assets/AppsView-BMaq5oxx.js +0 -1
  353. package/dist/web/assets/HostedModelLearningSettings-SSMst6dl.js +0 -1
  354. package/dist/web/assets/LabsRoute-MJwIjSKg.js +0 -101
  355. package/dist/web/assets/MainChatThread-BcwtaTDZ.js +0 -2
  356. package/dist/web/assets/MainPane-DDO6diPt.js +0 -10
  357. package/dist/web/assets/NativeSetupTerminal-BPSUFpRm.js +0 -2
  358. package/dist/web/assets/RightSidebarHomePanel-iznJwDMf.js +0 -1
  359. package/dist/web/assets/WorkSidebarPanel-BrIIRtGW.js +0 -1
  360. package/dist/web/assets/chat-resources-CTN4f6KC.js +0 -1
  361. package/dist/web/assets/chevron-right-C8K5PZj7.js +0 -1
  362. package/dist/web/assets/chunk-GJRXJL6G-pJp1DyJd.js +0 -9
  363. package/dist/web/assets/chunk-H3JZ3P5T-B0SCoPw4.js +0 -2
  364. package/dist/web/assets/chunk-TLSP5JKG-DZmxtX-4.js +0 -1
  365. package/dist/web/assets/contracts-BLiqJxBv.js +0 -1
  366. package/dist/web/assets/icons-c3vt7y6n.js +0 -1
  367. package/dist/web/assets/intake-contracts-BW0Y0C2R.js +0 -1
  368. package/dist/web/assets/loader-circle-pxp89T5x.js +0 -1
  369. package/dist/web/assets/play-BtlX2stU.js +0 -1
  370. package/dist/web/assets/plus-DbASL_gy.js +0 -1
  371. package/dist/web/assets/schemas-lO3MoWQr.js +0 -64
  372. package/dist/web/assets/settings-lists-DgSaJQA4.js +0 -5
  373. package/dist/web/assets/square-C2caJ3NG.js +0 -1
  374. package/dist/web/assets/training-DCdoHJ0Y.js +0 -2
  375. package/dist/web/assets/x-D9GTV9ke.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,c as m,d as k}from"./chunk-FS2VKOT7.js";import"./chunk-YU4JYWCA.js";import{d,f as p,g as f,h as w}from"./chunk-FEQ7HNJR.js";import"./chunk-2GJD23CM.js";import"./chunk-AN525SPP.js";import{c as R}from"./chunk-XHBMK6LC.js";import"./chunk-IZ6DLEVY.js";import"./chunk-QJJNHKLT.js";import"./chunk-ZU3YBRXS.js";import"./chunk-4TTXNVCE.js";import"./chunk-HNDAGZCF.js";import"./chunk-YU3C6U5V.js";import"./chunk-BJXPQIVD.js";import"./chunk-LZPCA6DH.js";import"./chunk-L3KS6MOV.js";import"./chunk-GUG2SWRZ.js";import"./chunk-G4747MOW.js";import"./chunk-KCJVFLBB.js";import"./chunk-MVPKU72J.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-GD3RCUDH.js";import"./chunk-QCJY6FTC.js";import"./chunk-UTIELP6F.js";import"./chunk-6S2MWJVD.js";import"./chunk-FYWQWKVS.js";import"./chunk-6ESBAHWK.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-7J2NMUTK.js";import"./chunk-W45RKGM6.js";import"./chunk-W45RKGM6.js";import"./chunk-7PKTCMZ6.js";import"./chunk-LXZLLTYQ.js";import"./chunk-GI7LTJV3.js";import"./chunk-VS3AMJEK.js";import"./chunk-XGY4OQLC.js";import"./chunk-AF3AVDPP.js";import"./chunk-SFR32TMJ.js";import"./chunk-5KJMFK65.js";import"./chunk-Y3B6ZUE6.js";import"./chunk-ULJZ7NUF.js";import"./chunk-WJSJXK2N.js";import"./chunk-O6ZYDHEJ.js";import"./chunk-OKEC2EIE.js";import"./chunk-WLZJOCLA.js";import"./chunk-HIQPGYVH.js";import"./chunk-ZWW227M3.js";import"./chunk-DXA2UHBE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-6FA3GG5B.js";import"./chunk-G4E3WGLM.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-SH7POUVX.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import"./chunk-UGOK7VTC.js";import{a as t}from"./chunk-FTQLQJQV.js";function b(i){let{store:n,storeDir:s,backgroundReview:r,harnessEvaluationEnabled:o,harnessTasksetReview:c}=i,v=new AbortController,u=t(e=>{let g=e.signal?AbortSignal.any([e.signal,v.signal]):v.signal;return i.harnessEvaluationReviewStream({...e,signal:g})},"harnessEvaluationReviewStream"),l=m({store:n,storeDir:s,evaluationReviewStream:u});return{inspectHarness:t(()=>k(n),"inspectHarness"),reviewHarnessProposal:a(r,"Harness review",l.reviewHarnessProposalPayload),reviewHarness:a(o,"Harness evaluation",e=>H({store:n,request:e,stream:u,continuation:{storeDir:s,stream:u}})),acceptHarnessEvaluationReview:a(o,"Tasksets",e=>c.acceptEvaluationReview(e)),materializeHarnessEvaluationTaskset:a(o,"Tasksets",e=>c.materializeEvaluationTaskset(e)),runHarnessEvaluationBaseline:a(o,"Tasksets",e=>c.runEvaluationBaseline(e)),validateHarness:t(async()=>{let e=await R(n);return e?{valid:!0,workspaceId:e.workspaceId,harnessRelease:e.harnessRelease,agentSnapshot:e.agentSnapshot}:{valid:!1,reason:"No app-server Harness release is selected."}},"validateHarness"),updateHarnessBackgroundReview:a(r,"Background review",l.updateHarnessBackgroundReviewPayload),diffHarness:l.harnessDiffPayload,rollbackHarness:l.rollbackHarnessPayload,inspectRefiner:a(r,"Refiner",()=>d(s)),updateRefiner:a(r,"Refiner",e=>p(s,e)),activateRefiner:a(r,"Refiner",e=>f(s,e)),rollbackRefiner:a(r,"Refiner",e=>w(s,e)),async close(){v.abort(new Error("Harness runtime closed"))}}}t(b,"createAppServerHarnessServices");function a(i,n,s){return async(...r)=>{if(!i)throw new Error(`${n} is disabled in this app-server deployment.`);return s(...r)}}t(a,"guardService");export{b as createAppServerHarnessServices};
2
+ import{a as H,c as m,d as k}from"./chunk-UBTP3QWI.js";import"./chunk-AXO6OHJB.js";import{d,f as p,g as f,h as w}from"./chunk-FE2ENE3U.js";import"./chunk-4EZI4KCT.js";import"./chunk-AN525SPP.js";import{c as R}from"./chunk-R6VI7MX5.js";import"./chunk-IZ6DLEVY.js";import"./chunk-KQD36SBJ.js";import"./chunk-CSU7RDA5.js";import"./chunk-4TTXNVCE.js";import"./chunk-HNDAGZCF.js";import"./chunk-YU3C6U5V.js";import"./chunk-BJXPQIVD.js";import"./chunk-LZPCA6DH.js";import"./chunk-L3KS6MOV.js";import"./chunk-GUG2SWRZ.js";import"./chunk-G4747MOW.js";import"./chunk-KCJVFLBB.js";import"./chunk-CJDGLPNX.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-GD3RCUDH.js";import"./chunk-FCXDPVGJ.js";import"./chunk-UTIELP6F.js";import"./chunk-5TPYBXWM.js";import"./chunk-FYWQWKVS.js";import"./chunk-6ESBAHWK.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-7J2NMUTK.js";import"./chunk-W45RKGM6.js";import"./chunk-W45RKGM6.js";import"./chunk-543QHE3D.js";import"./chunk-LI56PPCN.js";import"./chunk-GI7LTJV3.js";import"./chunk-6LFTQBXP.js";import"./chunk-XGY4OQLC.js";import"./chunk-VPAEFG7X.js";import"./chunk-SFR32TMJ.js";import"./chunk-AXYAEWWA.js";import"./chunk-QOUOU7FE.js";import"./chunk-ULJZ7NUF.js";import"./chunk-WJSJXK2N.js";import"./chunk-O6ZYDHEJ.js";import"./chunk-TS5HNRZB.js";import"./chunk-5ZNE43XC.js";import"./chunk-HIQPGYVH.js";import"./chunk-263WS3TB.js";import"./chunk-SD2XDZQW.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-6FA3GG5B.js";import"./chunk-XHU4BZQY.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-SH7POUVX.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import"./chunk-UGOK7VTC.js";import{a as t}from"./chunk-FTQLQJQV.js";function b(i){let{store:n,storeDir:s,backgroundReview:r,harnessEvaluationEnabled:o,harnessTasksetReview:c}=i,v=new AbortController,u=t(e=>{let g=e.signal?AbortSignal.any([e.signal,v.signal]):v.signal;return i.harnessEvaluationReviewStream({...e,signal:g})},"harnessEvaluationReviewStream"),l=m({store:n,storeDir:s,evaluationReviewStream:u});return{inspectHarness:t(()=>k(n),"inspectHarness"),reviewHarnessProposal:a(r,"Harness review",l.reviewHarnessProposalPayload),reviewHarness:a(o,"Harness evaluation",e=>H({store:n,request:e,stream:u,continuation:{storeDir:s,stream:u}})),acceptHarnessEvaluationReview:a(o,"Tasksets",e=>c.acceptEvaluationReview(e)),materializeHarnessEvaluationTaskset:a(o,"Tasksets",e=>c.materializeEvaluationTaskset(e)),runHarnessEvaluationBaseline:a(o,"Tasksets",e=>c.runEvaluationBaseline(e)),validateHarness:t(async()=>{let e=await R(n);return e?{valid:!0,workspaceId:e.workspaceId,harnessRelease:e.harnessRelease,agentSnapshot:e.agentSnapshot}:{valid:!1,reason:"No app-server Harness release is selected."}},"validateHarness"),updateHarnessBackgroundReview:a(r,"Background review",l.updateHarnessBackgroundReviewPayload),diffHarness:l.harnessDiffPayload,rollbackHarness:l.rollbackHarnessPayload,inspectRefiner:a(r,"Refiner",()=>d(s)),updateRefiner:a(r,"Refiner",e=>p(s,e)),activateRefiner:a(r,"Refiner",e=>f(s,e)),rollbackRefiner:a(r,"Refiner",e=>w(s,e)),async close(){v.abort(new Error("Harness runtime closed"))}}}t(b,"createAppServerHarnessServices");function a(i,n,s){return async(...r)=>{if(!i)throw new Error(`${n} is disabled in this app-server deployment.`);return s(...r)}}t(a,"guardService");export{b as createAppServerHarnessServices};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{l as c,m as d}from"./chunk-N2AV7PHV.js";import"./chunk-DSJZS77R.js";import"./chunk-HPTEJBP4.js";import"./chunk-D7R2AAX2.js";import"./chunk-NTM3KQ25.js";import"./chunk-2GJD23CM.js";import"./chunk-UM6EQOT2.js";import"./chunk-EVQISX7M.js";import{b}from"./chunk-PYNW5OFA.js";import"./chunk-66HFW4OU.js";import"./chunk-RHMULF56.js";import"./chunk-VFH5C6D2.js";import"./chunk-AN525SPP.js";import"./chunk-WBO6FQHR.js";import"./chunk-H5ML7735.js";import"./chunk-SYUKES6H.js";import"./chunk-UOFDKMRU.js";import"./chunk-XHBMK6LC.js";import{e as a}from"./chunk-6I5AUTVO.js";import"./chunk-IZ6DLEVY.js";import"./chunk-QJJNHKLT.js";import"./chunk-ZU3YBRXS.js";import"./chunk-7XOUM6RK.js";import"./chunk-VD2TQCMH.js";import"./chunk-N73MU2C3.js";import"./chunk-DIDQHTAX.js";import"./chunk-Z2TOBS3P.js";import"./chunk-7PXZ4X4P.js";import"./chunk-FAKDGLZQ.js";import"./chunk-GW766ZSO.js";import"./chunk-MCBRB5D6.js";import"./chunk-JD76ANPN.js";import"./chunk-SSJV3VX7.js";import"./chunk-7KWD2I6W.js";import"./chunk-4TTXNVCE.js";import"./chunk-HNDAGZCF.js";import"./chunk-YU3C6U5V.js";import"./chunk-OPTJYDZN.js";import"./chunk-KVTBX2UP.js";import"./chunk-BJXPQIVD.js";import"./chunk-QYQZQVVN.js";import"./chunk-GFAI2MCJ.js";import"./chunk-VS2LOUCT.js";import"./chunk-DMFUEUAZ.js";import"./chunk-GF55VEMR.js";import"./chunk-LZPCA6DH.js";import"./chunk-L3KS6MOV.js";import"./chunk-GUG2SWRZ.js";import"./chunk-G4747MOW.js";import"./chunk-KCJVFLBB.js";import"./chunk-MVPKU72J.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-GD3RCUDH.js";import"./chunk-QCJY6FTC.js";import"./chunk-UTIELP6F.js";import"./chunk-6S2MWJVD.js";import"./chunk-FYWQWKVS.js";import"./chunk-6ESBAHWK.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-7J2NMUTK.js";import"./chunk-W45RKGM6.js";import"./chunk-W45RKGM6.js";import"./chunk-7PKTCMZ6.js";import"./chunk-LXZLLTYQ.js";import"./chunk-GI7LTJV3.js";import"./chunk-VS3AMJEK.js";import"./chunk-XGY4OQLC.js";import"./chunk-AF3AVDPP.js";import"./chunk-JFXINDOQ.js";import"./chunk-SFR32TMJ.js";import"./chunk-5KJMFK65.js";import"./chunk-Y3B6ZUE6.js";import"./chunk-4N4EH3RJ.js";import"./chunk-ULJZ7NUF.js";import"./chunk-WJSJXK2N.js";import"./chunk-LOIYNRBC.js";import"./chunk-CYQLXS2U.js";import"./chunk-O6ZYDHEJ.js";import"./chunk-OKEC2EIE.js";import"./chunk-WLZJOCLA.js";import"./chunk-HIQPGYVH.js";import"./chunk-ZWW227M3.js";import"./chunk-DXA2UHBE.js";import"./chunk-MTP3B2SU.js";import"./chunk-UN2LKLGV.js";import"./chunk-2LJCJOJ7.js";import"./chunk-AMC4Z7G4.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-JCLTFDVW.js";import"./chunk-I6VMRQF4.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-6FA3GG5B.js";import"./chunk-G4E3WGLM.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-SH7POUVX.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import"./chunk-UGOK7VTC.js";import"./chunk-FTQLQJQV.js";export{a as AGENT_PROTOCOL_VERSION,c as APP_SERVER_COMPOSITION,d as createOpenPondAppServer,b as runAppServerJsonl};
2
+ import{l as c,m as d}from"./chunk-YKTJPCYZ.js";import"./chunk-2RSGVLZT.js";import"./chunk-HPTEJBP4.js";import"./chunk-QFL2VQKX.js";import"./chunk-ADOCQA4D.js";import"./chunk-4EZI4KCT.js";import"./chunk-4NN5OLKW.js";import"./chunk-RWRKUO5D.js";import{b}from"./chunk-PYNW5OFA.js";import"./chunk-4VZJQRQI.js";import"./chunk-RHMULF56.js";import"./chunk-VFH5C6D2.js";import"./chunk-AN525SPP.js";import"./chunk-IXZ5ZGIL.js";import"./chunk-46RMTR2Z.js";import"./chunk-SYUKES6H.js";import"./chunk-UOFDKMRU.js";import"./chunk-R6VI7MX5.js";import{e as a}from"./chunk-6I5AUTVO.js";import"./chunk-IZ6DLEVY.js";import"./chunk-KQD36SBJ.js";import"./chunk-CSU7RDA5.js";import"./chunk-UKSSFB4Q.js";import"./chunk-7HAGSE7L.js";import"./chunk-N73MU2C3.js";import"./chunk-XKZ4PFMQ.js";import"./chunk-4B7EGNYX.js";import"./chunk-7PXZ4X4P.js";import"./chunk-FAKDGLZQ.js";import"./chunk-GW766ZSO.js";import"./chunk-MCBRB5D6.js";import"./chunk-JD76ANPN.js";import"./chunk-SSJV3VX7.js";import"./chunk-7KWD2I6W.js";import"./chunk-4TTXNVCE.js";import"./chunk-HNDAGZCF.js";import"./chunk-YU3C6U5V.js";import"./chunk-OPTJYDZN.js";import"./chunk-KVTBX2UP.js";import"./chunk-BJXPQIVD.js";import"./chunk-375PADDM.js";import"./chunk-RS526BG7.js";import"./chunk-VS2LOUCT.js";import"./chunk-DMFUEUAZ.js";import"./chunk-GF55VEMR.js";import"./chunk-LZPCA6DH.js";import"./chunk-L3KS6MOV.js";import"./chunk-GUG2SWRZ.js";import"./chunk-G4747MOW.js";import"./chunk-KCJVFLBB.js";import"./chunk-CJDGLPNX.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-GD3RCUDH.js";import"./chunk-FCXDPVGJ.js";import"./chunk-UTIELP6F.js";import"./chunk-5TPYBXWM.js";import"./chunk-FYWQWKVS.js";import"./chunk-6ESBAHWK.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-7J2NMUTK.js";import"./chunk-W45RKGM6.js";import"./chunk-W45RKGM6.js";import"./chunk-543QHE3D.js";import"./chunk-LI56PPCN.js";import"./chunk-GI7LTJV3.js";import"./chunk-6LFTQBXP.js";import"./chunk-XGY4OQLC.js";import"./chunk-VPAEFG7X.js";import"./chunk-JFXINDOQ.js";import"./chunk-SFR32TMJ.js";import"./chunk-AXYAEWWA.js";import"./chunk-QOUOU7FE.js";import"./chunk-4N4EH3RJ.js";import"./chunk-ULJZ7NUF.js";import"./chunk-WJSJXK2N.js";import"./chunk-V3T2OJBZ.js";import"./chunk-BUZ7CBJC.js";import"./chunk-O6ZYDHEJ.js";import"./chunk-TS5HNRZB.js";import"./chunk-5ZNE43XC.js";import"./chunk-HIQPGYVH.js";import"./chunk-263WS3TB.js";import"./chunk-SD2XDZQW.js";import"./chunk-MTP3B2SU.js";import"./chunk-UN2LKLGV.js";import"./chunk-2LJCJOJ7.js";import"./chunk-AMC4Z7G4.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-JCLTFDVW.js";import"./chunk-I6VMRQF4.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-6FA3GG5B.js";import"./chunk-XHU4BZQY.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-SH7POUVX.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import"./chunk-UGOK7VTC.js";import"./chunk-FTQLQJQV.js";export{a as AGENT_PROTOCOL_VERSION,c as APP_SERVER_COMPOSITION,d as createOpenPondAppServer,b as runAppServerJsonl};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{f as $,g as J,h as L,i as v,j as q}from"./chunk-7P5SH3CI.js";import{c as y}from"./chunk-TGULVWPV.js";import"./chunk-FGOTSCSE.js";import"./chunk-E2S2EMYQ.js";import"./chunk-XRKFTPHD.js";import{f,h as g}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{a as S,f as w,j as T,k as j}from"./chunk-3M53YXEI.js";import{b as H,c as Q}from"./chunk-22UARBPW.js";import{I as C,J as G,K as k,N as W,P as M,R as z,S as F,b as D,l as K,q as V,r as _}from"./chunk-CRDKBFRN.js";import"./chunk-DMO3UIS7.js";import"./chunk-27JGS3KB.js";import"./chunk-BT5YNE5U.js";import{d as m}from"./chunk-3WJQ4IGK.js";import"./chunk-KTIBXRWQ.js";import"./chunk-L4EJ5R3B.js";import"./chunk-6ZTP6CUJ.js";import"./chunk-TBODQT4W.js";import"./chunk-YRDPVTEI.js";import"./chunk-JRGECNP3.js";import"./chunk-RRWL5BHZ.js";import"./chunk-NXN7GJOH.js";import"./chunk-5WPMI6QX.js";import"./chunk-W7NXFRHN.js";import"./chunk-5HPZGLOL.js";import"./chunk-GLUWATL5.js";import"./chunk-UN2LKLGV.js";import"./chunk-2LJCJOJ7.js";import"./chunk-AMC4Z7G4.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-JCLTFDVW.js";import"./chunk-I6VMRQF4.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-G4E3WGLM.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-SH7POUVX.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import"./chunk-UGOK7VTC.js";import{a as p}from"./chunk-FTQLQJQV.js";async function ie(){let e=await m(),s=f(e),t=await y(e,s),n=g(e),r=await L({apiBase:n,apiKey:t});console.log(JSON.stringify(r,null,2))}p(ie,"runAppsTools");async function se(e){let s=await m(),t=f(s),n=g(s),r=await y(s,t),i=typeof e.handle=="string"?String(e.handle):void 0,o=i?$(i):null,c=e.refresh!==void 0?w(e.refresh):void 0,l=await J({apiBase:n,apiKey:r,forceRefresh:c}),u=o?l.filter(a=>$(a.handle||a.gitOwner)===o):l;if(u.length===0){console.log("no apps found");return}if(w(e.json)){console.log(JSON.stringify({apps:u},null,2));return}for(let a of u){let d=a.handle||a.gitOwner||"unknown",h=a.repo||a.gitRepo||a.id,B=a.latestDeployment?.status||"no-deploy",R=a.latestDeployment?.gitBranch||a.defaultBranch||"-",I=a.codeVisibility||"unknown",E=a.sandbox?"yes":"no";console.log(`${d}/${h} ${B} ${R} code=${I} sandbox=${E} ${a.id}`)}}p(se,"runAppsList");async function oe(e,s){let t=typeof e.visibility=="string"?e.visibility.trim():typeof e.codeVisibility=="string"?e.codeVisibility.trim():"";if(t!=="public"&&t!=="private")throw new Error("usage: apps code-visibility <handle>/<repo> --visibility public|private");let n=await m(),r=f(n),i=g(n),o=await y(n,r),{app:c,handle:l,repo:u}=await v(i,o,s),a=await K(i,o,c.id,t);console.log(`${l}/${u} code_visibility=${a.app?.codeVisibility??t} app_id=${c.id}`)}p(oe,"runAppsCodeVisibility");async function ae(e){let s=await m(),t=f(s),n=await y(s,t),r=g(s),i=typeof e.appId=="string"?String(e.appId):void 0,o=await G(r,n,{appId:i});console.log(JSON.stringify(o,null,2))}p(ae,"runAppsPerformance");async function ce(e,s){let t=await m(),n=f(t),r=g(t),i=await y(t,n),{app:o}=await v(r,i,s),c=await k(r,i,o.id);console.log(JSON.stringify(c,null,2))}p(ce,"runAppsSummary");async function le(e,s,t,n){let r=(typeof e.prompt=="string"?e.prompt:null)||n.join(" ");if(!r.trim())throw new Error("usage: apps assistant <plan|performance> <handle>/<repo> --prompt <text>");let i=await m(),o=f(i),c=g(i),l=await y(i,o),{app:u}=await v(c,l,t),a=await W(c,l,{appId:u.id,mode:s,prompt:r.trim()});console.log(JSON.stringify(a,null,2))}p(le,"runAppsAssistant");async function de(e,s){let t=await m(),n=f(t),r=await y(t,n),i=g(t),o=(typeof e.prompt=="string"?e.prompt:null)||s.join(" ");if(!o.trim())throw new Error("usage: apps agent create --prompt <text> [--team-id <id>]");let c=typeof e.templateRepoUrl=="string"?e.templateRepoUrl:void 0,l=typeof e.templateBranch=="string"?e.templateBranch:void 0,u=typeof e.templateLocalPath=="string"?e.templateLocalPath:void 0,a=typeof e.teamId=="string"&&e.teamId.trim()?e.teamId.trim():void 0;if(u&&String(u).trim().length>0)throw new Error("templateLocalPath is not supported; use templateRepoUrl");let d=typeof e.env=="string"?S(e.env,"env"):void 0;if(d){if(typeof d!="object"||Array.isArray(d))throw new Error("env must be a JSON object");for(let[b,A]of Object.entries(d))if(typeof A!="string")throw new Error(`env value for ${b} must be a string`)}let h=c||l||d?{templateRepoUrl:c,templateBranch:l,envVars:d}:void 0,B=typeof e.deployEnvironment=="string"?e.deployEnvironment==="preview"?"preview":"production":void 0,R=e.deployDisabled!==void 0?w(e.deployDisabled):void 0,I=e.streamDeployLogs!==void 0?w(e.streamDeployLogs):!0,E=await C(i,r,{prompt:o.trim(),...a?{teamId:a}:{},...h?{template:h}:{},...B?{deployEnvironment:B}:{},...R!==void 0?{deployDisabled:R}:{},streamDeployLogs:I});if(!E.ok){let b=await E.text().catch(()=>"");throw new Error(`agent create failed: ${E.status} ${b}`)}let N=null,O=null,P=null;await H(E,{onConversationId:p(b=>{N=b},"onConversationId"),onItems:p(b=>{for(let A of b){let U=Q(A);U&&console.log(U);let x=A;!O&&typeof x.appId=="string"&&(O=x.appId),!P&&typeof x.deploymentId=="string"&&(P=x.deploymentId)}},"onItems")}),N&&console.log(`conversation_id: ${N}`),O&&console.log(`app_id: ${O}`),P&&console.log(`deployment_id: ${P}`);try{await J({apiBase:i,apiKey:r,forceRefresh:!0}),await L({apiBase:i,apiKey:r,forceRefresh:!0})}catch(b){console.warn("cache refresh failed",b)}}p(de,"runAppsAgentCreate");async function pe(e,s,t,n){let r=await m(),i=f(r),o=await y(r,i),c=g(r),l=typeof e.method=="string"?String(e.method).toUpperCase():void 0,u=l&&["GET","POST","PUT","DELETE"].includes(l)?l:void 0;if(l&&!u)throw new Error("method must be GET, POST, PUT, or DELETE");let a=typeof e.body=="string"?S(String(e.body),"body"):void 0,d=typeof e.headers=="string"?S(String(e.headers),"headers"):void 0,h=typeof e.scheduleId=="string"?String(e.scheduleId):void 0,B=w(e.notifyEmail),R=w(e.summary)||w(e.withSummary),I=await M(c,o,{appId:s,deploymentId:t,toolName:n,scheduleId:h,method:u,body:a,headers:d,notifyEmail:B||void 0});if(console.log(JSON.stringify(I,null,2)),R&&I.ok){let E=await k(c,o,s);console.log(JSON.stringify({summary:E},null,2))}}p(pe,"runAppsToolsExecute");async function ue(e,s){let t=typeof e.env=="string"?e.env:typeof e.vars=="string"?e.vars:typeof e.envVars=="string"?e.envVars:null;if(!t)throw new Error("usage: apps env set <handle>/<repo> --env <json>");let n=S(t,"env");if(!n||typeof n!="object"||Array.isArray(n))throw new Error("env must be a JSON object");let r={};for(let[d,h]of Object.entries(n)){if(typeof h!="string")throw new Error(`env value for ${d} must be a string`);if(!d.startsWith("OPENTOOL_PUBLIC_"))throw new Error("only OPENTOOL_PUBLIC_ env vars can be set");r[d]=h}let i=await m(),o=f(i),c=g(i),l=await y(i,o),{app:u}=await v(c,l,s),a=await V(c,l,u.id,{envVars:r});console.log(JSON.stringify(a,null,2))}p(ue,"runAppsEnvSet");async function fe(e,s){let t=await m(),n=f(t),r=g(t),i=await y(t,n),{app:o}=await v(r,i,s),c=await _(r,i,o.id);console.log(JSON.stringify(c,null,2))}p(fe,"runAppsEnvGet");async function ge(e,s){let t=await m(),n=f(t),r=g(t),i=await y(t,n),{app:o,handle:c,repo:l}=await v(r,i,s),u=typeof e.env=="string"?e.env:typeof e.environment=="string"?e.environment:void 0,a=j(u),d=await D(r,i,o.id,{environment:a});console.log(JSON.stringify(d,null,2)),(w(e.watch)||w(e.wait)||w(e.follow))&&await q({baseUrl:r,apiKey:i,deploymentId:d.deploymentId,prefix:`[${c}/${l}] `,intervalMs:e.interval?Number(e.interval):void 0,timeoutMs:e.timeout?Number(e.timeout):void 0})}p(ge,"runAppsDeploy");function X(e){let s={};if(typeof e.params=="string"){let n=S(String(e.params),"params");if(!n||typeof n!="object"||Array.isArray(n))throw new Error("params must be a JSON object");for(let[r,i]of Object.entries(n))i!==void 0&&(s[r]=typeof i=="string"?i:JSON.stringify(i))}let t=p((n,r)=>{r===void 0||r===""||(s[n]=r)},"addParam");if(t("source",typeof e.source=="string"?e.source.trim():void 0),t("symbol",typeof e.symbol=="string"?e.symbol.trim():void 0),t("cursor",typeof e.cursor=="string"?e.cursor.trim():void 0),t("status",typeof e.status=="string"?e.status.trim():void 0),t("backtestRunId",typeof e.runId=="string"?e.runId.trim():typeof e.backtestRunId=="string"?e.backtestRunId.trim():void 0),t("since",T(e.since,"since")),t("until",T(e.until,"until")),typeof e.limit=="string"&&e.limit.trim().length>0){let n=Number.parseInt(e.limit,10);if(!Number.isFinite(n))throw new Error("limit must be a number");t("limit",String(n))}return Object.keys(s).length?s:void 0}p(X,"resolveBacktestEventsParams");async function me(e,s){let t=await m(),n=f(t),r=await y(t,n),i=g(t),{app:o}=await v(i,r,s),c={...X(e)??{},appId:o.id},l=await z(i,r,{method:"GET",query:c});console.log(JSON.stringify(l,null,2))}p(me,"runBacktestEvents");async function ye(e,s){let t=typeof e.runId=="string"?e.runId.trim():typeof e.backtestRunId=="string"?e.backtestRunId.trim():"";if(!t)throw new Error("usage: backtest get <handle>/<repo> --run-id <id>");let n=await m(),r=f(n),i=await y(n,r),o=g(n),{app:c}=await v(o,i,s),l=await F(o,i,{appId:c.id,runId:t});console.log(JSON.stringify(l,null,2))}p(ye,"runBacktestGet");export{X as resolveBacktestEventsParams,de as runAppsAgentCreate,le as runAppsAssistant,oe as runAppsCodeVisibility,ge as runAppsDeploy,fe as runAppsEnvGet,ue as runAppsEnvSet,se as runAppsList,ae as runAppsPerformance,ce as runAppsSummary,ie as runAppsTools,pe as runAppsToolsExecute,me as runBacktestEvents,ye as runBacktestGet};
2
+ import{f as $,g as J,h as L,i as v,j as q}from"./chunk-7P5SH3CI.js";import{c as y}from"./chunk-TGULVWPV.js";import"./chunk-W3ZILZUL.js";import"./chunk-BBIA24GD.js";import"./chunk-XRKFTPHD.js";import{f,h as g}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{a as S,f as w,j as T,k as j}from"./chunk-3M53YXEI.js";import{b as H,c as Q}from"./chunk-22UARBPW.js";import{I as C,J as G,K as k,N as W,P as M,R as z,S as F,b as D,l as K,q as V,r as _}from"./chunk-CRDKBFRN.js";import"./chunk-4JJ4RYIB.js";import"./chunk-27JGS3KB.js";import"./chunk-BT5YNE5U.js";import{d as m}from"./chunk-3WJQ4IGK.js";import"./chunk-KTIBXRWQ.js";import"./chunk-2UZHLO2V.js";import"./chunk-R6MMWEH4.js";import"./chunk-TBODQT4W.js";import"./chunk-TV2LE2BD.js";import"./chunk-OE2OOWEQ.js";import"./chunk-RRWL5BHZ.js";import"./chunk-NXN7GJOH.js";import"./chunk-TERKCK4I.js";import"./chunk-UNE52L3Y.js";import"./chunk-5HPZGLOL.js";import"./chunk-GLUWATL5.js";import"./chunk-UN2LKLGV.js";import"./chunk-2LJCJOJ7.js";import"./chunk-AMC4Z7G4.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-JCLTFDVW.js";import"./chunk-I6VMRQF4.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-XHU4BZQY.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-SH7POUVX.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import"./chunk-UGOK7VTC.js";import{a as p}from"./chunk-FTQLQJQV.js";async function ie(){let e=await m(),s=f(e),t=await y(e,s),n=g(e),r=await L({apiBase:n,apiKey:t});console.log(JSON.stringify(r,null,2))}p(ie,"runAppsTools");async function se(e){let s=await m(),t=f(s),n=g(s),r=await y(s,t),i=typeof e.handle=="string"?String(e.handle):void 0,o=i?$(i):null,c=e.refresh!==void 0?w(e.refresh):void 0,l=await J({apiBase:n,apiKey:r,forceRefresh:c}),u=o?l.filter(a=>$(a.handle||a.gitOwner)===o):l;if(u.length===0){console.log("no apps found");return}if(w(e.json)){console.log(JSON.stringify({apps:u},null,2));return}for(let a of u){let d=a.handle||a.gitOwner||"unknown",h=a.repo||a.gitRepo||a.id,B=a.latestDeployment?.status||"no-deploy",R=a.latestDeployment?.gitBranch||a.defaultBranch||"-",I=a.codeVisibility||"unknown",E=a.sandbox?"yes":"no";console.log(`${d}/${h} ${B} ${R} code=${I} sandbox=${E} ${a.id}`)}}p(se,"runAppsList");async function oe(e,s){let t=typeof e.visibility=="string"?e.visibility.trim():typeof e.codeVisibility=="string"?e.codeVisibility.trim():"";if(t!=="public"&&t!=="private")throw new Error("usage: apps code-visibility <handle>/<repo> --visibility public|private");let n=await m(),r=f(n),i=g(n),o=await y(n,r),{app:c,handle:l,repo:u}=await v(i,o,s),a=await K(i,o,c.id,t);console.log(`${l}/${u} code_visibility=${a.app?.codeVisibility??t} app_id=${c.id}`)}p(oe,"runAppsCodeVisibility");async function ae(e){let s=await m(),t=f(s),n=await y(s,t),r=g(s),i=typeof e.appId=="string"?String(e.appId):void 0,o=await G(r,n,{appId:i});console.log(JSON.stringify(o,null,2))}p(ae,"runAppsPerformance");async function ce(e,s){let t=await m(),n=f(t),r=g(t),i=await y(t,n),{app:o}=await v(r,i,s),c=await k(r,i,o.id);console.log(JSON.stringify(c,null,2))}p(ce,"runAppsSummary");async function le(e,s,t,n){let r=(typeof e.prompt=="string"?e.prompt:null)||n.join(" ");if(!r.trim())throw new Error("usage: apps assistant <plan|performance> <handle>/<repo> --prompt <text>");let i=await m(),o=f(i),c=g(i),l=await y(i,o),{app:u}=await v(c,l,t),a=await W(c,l,{appId:u.id,mode:s,prompt:r.trim()});console.log(JSON.stringify(a,null,2))}p(le,"runAppsAssistant");async function de(e,s){let t=await m(),n=f(t),r=await y(t,n),i=g(t),o=(typeof e.prompt=="string"?e.prompt:null)||s.join(" ");if(!o.trim())throw new Error("usage: apps agent create --prompt <text> [--team-id <id>]");let c=typeof e.templateRepoUrl=="string"?e.templateRepoUrl:void 0,l=typeof e.templateBranch=="string"?e.templateBranch:void 0,u=typeof e.templateLocalPath=="string"?e.templateLocalPath:void 0,a=typeof e.teamId=="string"&&e.teamId.trim()?e.teamId.trim():void 0;if(u&&String(u).trim().length>0)throw new Error("templateLocalPath is not supported; use templateRepoUrl");let d=typeof e.env=="string"?S(e.env,"env"):void 0;if(d){if(typeof d!="object"||Array.isArray(d))throw new Error("env must be a JSON object");for(let[b,A]of Object.entries(d))if(typeof A!="string")throw new Error(`env value for ${b} must be a string`)}let h=c||l||d?{templateRepoUrl:c,templateBranch:l,envVars:d}:void 0,B=typeof e.deployEnvironment=="string"?e.deployEnvironment==="preview"?"preview":"production":void 0,R=e.deployDisabled!==void 0?w(e.deployDisabled):void 0,I=e.streamDeployLogs!==void 0?w(e.streamDeployLogs):!0,E=await C(i,r,{prompt:o.trim(),...a?{teamId:a}:{},...h?{template:h}:{},...B?{deployEnvironment:B}:{},...R!==void 0?{deployDisabled:R}:{},streamDeployLogs:I});if(!E.ok){let b=await E.text().catch(()=>"");throw new Error(`agent create failed: ${E.status} ${b}`)}let N=null,O=null,P=null;await H(E,{onConversationId:p(b=>{N=b},"onConversationId"),onItems:p(b=>{for(let A of b){let U=Q(A);U&&console.log(U);let x=A;!O&&typeof x.appId=="string"&&(O=x.appId),!P&&typeof x.deploymentId=="string"&&(P=x.deploymentId)}},"onItems")}),N&&console.log(`conversation_id: ${N}`),O&&console.log(`app_id: ${O}`),P&&console.log(`deployment_id: ${P}`);try{await J({apiBase:i,apiKey:r,forceRefresh:!0}),await L({apiBase:i,apiKey:r,forceRefresh:!0})}catch(b){console.warn("cache refresh failed",b)}}p(de,"runAppsAgentCreate");async function pe(e,s,t,n){let r=await m(),i=f(r),o=await y(r,i),c=g(r),l=typeof e.method=="string"?String(e.method).toUpperCase():void 0,u=l&&["GET","POST","PUT","DELETE"].includes(l)?l:void 0;if(l&&!u)throw new Error("method must be GET, POST, PUT, or DELETE");let a=typeof e.body=="string"?S(String(e.body),"body"):void 0,d=typeof e.headers=="string"?S(String(e.headers),"headers"):void 0,h=typeof e.scheduleId=="string"?String(e.scheduleId):void 0,B=w(e.notifyEmail),R=w(e.summary)||w(e.withSummary),I=await M(c,o,{appId:s,deploymentId:t,toolName:n,scheduleId:h,method:u,body:a,headers:d,notifyEmail:B||void 0});if(console.log(JSON.stringify(I,null,2)),R&&I.ok){let E=await k(c,o,s);console.log(JSON.stringify({summary:E},null,2))}}p(pe,"runAppsToolsExecute");async function ue(e,s){let t=typeof e.env=="string"?e.env:typeof e.vars=="string"?e.vars:typeof e.envVars=="string"?e.envVars:null;if(!t)throw new Error("usage: apps env set <handle>/<repo> --env <json>");let n=S(t,"env");if(!n||typeof n!="object"||Array.isArray(n))throw new Error("env must be a JSON object");let r={};for(let[d,h]of Object.entries(n)){if(typeof h!="string")throw new Error(`env value for ${d} must be a string`);if(!d.startsWith("OPENTOOL_PUBLIC_"))throw new Error("only OPENTOOL_PUBLIC_ env vars can be set");r[d]=h}let i=await m(),o=f(i),c=g(i),l=await y(i,o),{app:u}=await v(c,l,s),a=await V(c,l,u.id,{envVars:r});console.log(JSON.stringify(a,null,2))}p(ue,"runAppsEnvSet");async function fe(e,s){let t=await m(),n=f(t),r=g(t),i=await y(t,n),{app:o}=await v(r,i,s),c=await _(r,i,o.id);console.log(JSON.stringify(c,null,2))}p(fe,"runAppsEnvGet");async function ge(e,s){let t=await m(),n=f(t),r=g(t),i=await y(t,n),{app:o,handle:c,repo:l}=await v(r,i,s),u=typeof e.env=="string"?e.env:typeof e.environment=="string"?e.environment:void 0,a=j(u),d=await D(r,i,o.id,{environment:a});console.log(JSON.stringify(d,null,2)),(w(e.watch)||w(e.wait)||w(e.follow))&&await q({baseUrl:r,apiKey:i,deploymentId:d.deploymentId,prefix:`[${c}/${l}] `,intervalMs:e.interval?Number(e.interval):void 0,timeoutMs:e.timeout?Number(e.timeout):void 0})}p(ge,"runAppsDeploy");function X(e){let s={};if(typeof e.params=="string"){let n=S(String(e.params),"params");if(!n||typeof n!="object"||Array.isArray(n))throw new Error("params must be a JSON object");for(let[r,i]of Object.entries(n))i!==void 0&&(s[r]=typeof i=="string"?i:JSON.stringify(i))}let t=p((n,r)=>{r===void 0||r===""||(s[n]=r)},"addParam");if(t("source",typeof e.source=="string"?e.source.trim():void 0),t("symbol",typeof e.symbol=="string"?e.symbol.trim():void 0),t("cursor",typeof e.cursor=="string"?e.cursor.trim():void 0),t("status",typeof e.status=="string"?e.status.trim():void 0),t("backtestRunId",typeof e.runId=="string"?e.runId.trim():typeof e.backtestRunId=="string"?e.backtestRunId.trim():void 0),t("since",T(e.since,"since")),t("until",T(e.until,"until")),typeof e.limit=="string"&&e.limit.trim().length>0){let n=Number.parseInt(e.limit,10);if(!Number.isFinite(n))throw new Error("limit must be a number");t("limit",String(n))}return Object.keys(s).length?s:void 0}p(X,"resolveBacktestEventsParams");async function me(e,s){let t=await m(),n=f(t),r=await y(t,n),i=g(t),{app:o}=await v(i,r,s),c={...X(e)??{},appId:o.id},l=await z(i,r,{method:"GET",query:c});console.log(JSON.stringify(l,null,2))}p(me,"runBacktestEvents");async function ye(e,s){let t=typeof e.runId=="string"?e.runId.trim():typeof e.backtestRunId=="string"?e.backtestRunId.trim():"";if(!t)throw new Error("usage: backtest get <handle>/<repo> --run-id <id>");let n=await m(),r=f(n),i=await y(n,r),o=g(n),{app:c}=await v(o,i,s),l=await F(o,i,{appId:c.id,runId:t});console.log(JSON.stringify(l,null,2))}p(ye,"runBacktestGet");export{X as resolveBacktestEventsParams,de as runAppsAgentCreate,le as runAppsAssistant,oe as runAppsCodeVisibility,ge as runAppsDeploy,fe as runAppsEnvGet,ue as runAppsEnvSet,se as runAppsList,ae as runAppsPerformance,ce as runAppsSummary,ie as runAppsTools,pe as runAppsToolsExecute,me as runBacktestEvents,ye as runBacktestGet};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as S}from"./chunk-DXA2UHBE.js";import{v as y}from"./chunk-ZY32SZ2P.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as s}from"./chunk-FTQLQJQV.js";var ne="application/vnd.openpond.training+json;version=2",_="application/vnd.openpond.model-project+json;version=2",ae=1048576,oe=67108864,re=8388608,b=524288,x=8388608,u=class extends Error{static{s(this,"OpenPondProtocolError")}code;constructor(t,n){super(n),this.name="OpenPondProtocolError",this.code=t}};function A(t){return JSON.stringify(P(t))}s(A,"canonicalJson");function L(t){return new TextEncoder().encode(A(t)).byteLength}s(L,"canonicalJsonByteLength");async function I(t){let n=new TextEncoder().encode(A(t)),i=await globalThis.crypto.subtle.digest("SHA-256",n);return Array.from(new Uint8Array(i),o=>o.toString(16).padStart(2,"0")).join("")}s(I,"canonicalSha256");function M(t,n,i){let o=L(t);if(o>n)throw new u("payload_too_large",`${i} is ${o} bytes; the maximum is ${n} bytes.`)}s(M,"assertCanonicalPayloadSize");function w(t,n,i){let o=new TextEncoder().encode(t).byteLength;if(o>n)throw new u("response_too_large",`${i} is ${o} bytes; the maximum is ${n} bytes.`);try{return JSON.parse(t)}catch{throw new u("invalid_json",`${i} was not valid JSON.`)}}s(w,"parseBoundedJson");async function T(t,n,i){let o=t.body?.getReader();if(!o)return w("",n,i);let r=new TextDecoder,l=0,p="";try{for(;;){let d=await o.read();if(d.done)break;if(l+=d.value.byteLength,l>n)throw new u("response_too_large",`${i} exceeds the maximum of ${n} bytes.`);p+=r.decode(d.value,{stream:!0})}return p+=r.decode(),w(p,n,i)}catch(d){try{await o.cancel()}catch{}throw d}finally{try{o.releaseLock()}catch{}}}s(T,"readBoundedJsonResponse");function P(t){if(t===null||typeof t=="string"||typeof t=="boolean")return t;if(typeof t=="number"){if(!Number.isFinite(t))throw new u("non_json_value","Canonical JSON cannot contain a non-finite number.");return Object.is(t,-0)?0:t}if(Array.isArray(t))return t.map(n=>P(n));if(typeof t=="object"){let n=Object.getPrototypeOf(t);if(n!==Object.prototype&&n!==null)throw new u("non_json_value","Canonical JSON accepts only plain objects.");let i=Object.create(null);for(let o of Object.keys(t).sort()){let r=t[o];if(r===void 0||typeof r=="function"||typeof r=="symbol")throw new u("non_json_value",`Canonical JSON cannot contain ${typeof r} at ${o}.`);i[o]=P(r)}return i}throw new u("non_json_value",`Canonical JSON cannot contain ${typeof t}.`)}s(P,"normalizeCanonicalJson");var g=e.string().trim().min(1).max(191),k=e.string().regex(/^[a-f0-9]{64}$/),U=e.discriminatedUnion("mode",[e.object({mode:e.literal("automatic"),objective:e.enum(["balanced","fast","economical"]),gpuCount:e.union([e.literal(1),e.literal(2)]).optional()}).strict(),e.object({mode:e.literal("manual"),availabilityId:g,gpuType:e.string().trim().min(1).max(256),gpuCount:e.union([e.literal(1),e.literal(2)]).optional()}).strict()]),pe=e.object({estimateId:g,inputHash:k,requestHash:k,pricingVersion:g,expiresAt:e.string().datetime({offset:!0}),token:e.string().min(1).max(8192)}).strict(),fe=e.object({schemaVersion:e.literal("openpond.trainingGpuCatalog.v1"),observedAt:e.string().datetime({offset:!0}),expiresAt:e.string().datetime({offset:!0}),workerImageDigest:e.string().regex(/^sha256:[a-f0-9]{64}$/),supportedLoraRanks:e.array(e.number().int().positive()),pricingBasis:e.literal("accepted_compute_and_disk_hourly_before_credits"),offerings:e.array(e.object({availabilityId:g,gpuType:e.string().min(1).max(256),provider:g,region:e.string().min(1),dataCenterId:e.string().nullable(),gpuCount:e.number().int().positive(),gpuMemoryGb:e.number().positive(),stockStatus:e.enum(["High","Medium","Low"]),computeHourlyUsd:e.number().nonnegative(),diskHourlyUsd:e.number().nonnegative(),totalHourlyUsd:e.number().nonnegative()}).strict()).max(1e3)}).strict(),a=e.string().trim().min(1).max(500),m=e.string().regex(/^[a-f0-9]{64}$/),c=e.string().datetime({offset:!0}),f=e.object({id:a,contentHash:m}).strict(),R=f.extend({revision:e.number().int().positive()}).strict(),h=e.object({schemaVersion:e.literal("openpond.baseModelPreference.v1"),modelId:a,revision:e.string().trim().min(1).max(256).nullable(),tokenizerRevision:e.string().trim().min(1).max(256).nullable(),chatTemplateHash:e.string().trim().min(8).max(256).nullable(),modelAssetId:a.nullable(),source:e.enum(["managed","local","builtin"])}).strict(),J=e.enum(["sft","dpo","grpo","ppo","sdft","opd","opsd","sdpo"]),q=e.object({schemaVersion:e.string().regex(/^openpond\.[A-Za-z0-9]+Recipe\.v\d+$/),method:J,parameterization:e.enum(["lora","full"])}).catchall(e.unknown()),V=e.object({profileProjectId:a,sourceRevision:e.string().regex(/^[a-f0-9]{40,64}$/),harnessRelease:f}).strict(),G=e.object({profileProjectId:a,sourceRevision:e.string().regex(/^[a-f0-9]{40,64}$/),catalogHash:m,definitionId:a,harnessRelease:f,tasksetRelease:f}).strict(),H=e.object({tasksetRef:R.nullable().default(null),evaluationTasksetRef:R.nullable().optional(),profileSource:V.nullable().optional(),profileEvaluation:G.nullable().optional(),rewardBindingRef:R.nullable().optional(),tasksetRelease:f.nullable().default(null),harnessRelease:f.nullable().default(null),baseModel:h.nullable().default(null),method:J.nullable().default(null),destinationId:a.nullable().default(null),managedRolloutPlacement:e.enum(["local","remote"]).default("remote"),managedGpuPlacementObjective:e.enum(["fast","balanced","economical"]).default("balanced"),managedGpuSelection:U.optional(),continuationAdapterMode:e.enum(["residual_append","shared","sequential_merge"]).optional(),managedGpuRequirement:e.enum(["any","h100_hbm3"]).default("any"),runPreset:e.enum(["small","standard","custom","small_experiment"]).nullable().default(null),recipe:q.nullable().default(null),preferredMaximumSpendUsd:e.number().nonnegative().nullable().default(null),preferredRetentionDays:e.number().int().nonnegative().nullable().default(null)}).strict(),$=H,Y=e.object({schemaVersion:e.literal("openpond.hostedModelProjectLink.v1"),apiOrigin:e.string().url().refine(t=>new URL(t).origin===t,"Use a canonical API origin.").nullable().default(null),teamId:a,projectId:a,portableProjectId:a,revision:e.number().int().positive(),etag:m,syncedSourceRevision:e.number().int().positive(),syncedAt:c,tasksets:e.array(e.object({localTasksetId:a,localTasksetHash:m.nullable().default(null),releaseId:a,releaseRevision:e.number().int().positive(),releaseHash:m,packageHash:m.nullable().default(null),hostedTasksetId:a,syncedAt:c}).strict()).max(1e4).default([])}).strict(),z=e.object({localTasksetId:a,releaseId:a,releaseRevision:e.number().int().positive(),releaseHash:m,state:e.enum(["syncing","synced","sync_failed"]),hostedTasksetId:a.nullable().default(null),lastAttemptAt:c,syncedAt:c.nullable().default(null),lastError:e.string().trim().min(1).max(5e3).nullable().default(null)}).strict(),X=e.object({schemaVersion:e.literal("openpond.modelProject.v2"),id:a,profileId:a,revision:e.number().int().positive().default(1),name:e.string().trim().min(1).max(200),objective:e.string().trim().max(5e3).nullable(),defaultBaseModel:h.nullable(),defaultDestinationId:a.nullable(),trainingSetup:H,hosted:Y.nullable().default(null),tasksetSyncs:e.array(z).max(1e4).default([]),createdAt:c,updatedAt:c}).strict(),D=X.pick({id:!0,profileId:!0,name:!0,objective:!0,defaultBaseModel:!0,defaultDestinationId:!0,trainingSetup:!0}),F=e.object({schemaVersion:e.literal("openpond.modelProjectSave.v1"),operationId:a,expectedRevision:e.number().int().nonnegative(),project:D,learning:S.optional()}).strict().superRefine((t,n)=>{t.learning&&t.expectedRevision!==0&&n.addIssue({code:"custom",path:["learning"],message:"Use learning settings to edit an existing Model's policy."})}),Z=e.object({schemaVersion:e.literal("openpond.modelProjectConfigurationCheck.v1"),configurationHash:m,projectId:a,expectedRevision:e.number().int().nonnegative(),checkedAt:c,canSave:e.boolean(),deferred:e.array(e.enum(["base_model","taskset"])).max(2),findings:e.array(e.object({code:a,severity:e.enum(["error","warning"]),message:e.string().min(1).max(5e3),field:e.string().min(1).max(500).nullable()}).strict()).max(100)}).strict(),K=e.object({id:a,name:e.string().min(1).max(500),available:e.boolean(),preference:h}).strict();async function ge(t){let n=j(t);return I({project:n.project,expectedRevision:n.expectedRevision,...n.learning?{learning:n.learning}:{}})}s(ge,"modelProjectConfigurationHash");function j(t){try{y(t,b)}catch{throw new B(400,{schemaVersion:"openpond.modelProjectApiError.v2",code:"model_configuration_json_invalid",message:"Model configuration must be bounded JSON data.",retryable:!1,requestId:null,details:{}})}return F.parse(t)}s(j,"parseModelProjectSaveRequest");async function he(t,n,i){y(t,b);let o=D.parse(t);M(o,b,"Model configuration");let r=i?S.parse(i):void 0,l=await I({project:o,expectedRevision:n,...r?{learning:r}:{}});return j({schemaVersion:"openpond.modelProjectSave.v1",operationId:`model-save:${l}`,expectedRevision:n,project:o,...r?{learning:r}:{}})}s(he,"createModelProjectSaveRequest");var Q=e.object({schemaVersion:e.literal("openpond.hostedModelProjectSync.v2"),portableProjectId:a,name:e.string().trim().min(1).max(200),objective:e.string().trim().max(5e3).nullable(),defaultBaseModel:h.nullable(),defaultDestinationId:a.nullable(),trainingSetup:$,sourceRevision:e.number().int().positive(),sourceUpdatedAt:c,expectedEtag:m.nullable().default(null)}).strict(),v=e.object({id:a,teamId:a,portableProjectId:a,name:e.string().trim().min(1).max(200),objective:e.string().trim().max(5e3).nullable(),defaultBaseModel:h.nullable(),defaultDestinationId:a.nullable(),trainingSetup:$,sourceRevision:e.number().int().positive(),sourceUpdatedAt:c,revision:e.number().int().positive(),etag:m,createdAt:c,updatedAt:c}).strict(),W=e.object({kind:e.enum(["taskset_release","harness_release","dataset_release","evidence_set","model_version","reward_model_version","evaluation_receipt"]),ref:f,role:e.string().trim().min(1).max(200).nullable().default(null),updatedAt:c}).strict(),ee=e.object({project:v,resources:e.array(W).max(1e4),jobCount:e.number().int().nonnegative(),latestJobIds:e.array(a).max(100)}).strict(),te=e.object({schemaVersion:e.literal("openpond.modelProjectApiError.v2"),code:e.string().trim().min(1).max(200),message:e.string().trim().min(1).max(5e3),retryable:e.boolean().default(!1),requestId:e.string().trim().min(1).max(500).nullable().default(null),details:e.record(e.string(),e.unknown()).default({})}).strict(),B=class extends Error{static{s(this,"OpenPondModelProjectApiError")}status;code;retryable;requestId;details;constructor(t,n){super(n.message),this.name="OpenPondModelProjectApiError",this.status=t,this.code=n.code,this.retryable=n.retryable,this.requestId=n.requestId,this.details=n.details}};function N(t){let n={};return new Headers(t).forEach((i,o)=>{n[o]=i}),n}s(N,"headersRecord");function ve(t){let n=t.fetch??fetch,i=t.baseUrl.replace(/\/$/,"");async function o(r,l){let p=typeof t.headers=="function"?await t.headers():t.headers??{},d=await n(`${i}${r}`,{...l,headers:{accept:_,...l?.body?{"content-type":_}:{},...N(p),...N(l?.headers)}}),O=await T(d,x,"Model Project API response");if(!d.ok){let E=te.safeParse(O);throw E.success?new B(d.status,E.data):new u("invalid_error_response",`Model Project request failed with HTTP ${d.status} and an invalid error envelope.`)}return O}return s(o,"request"),{async configurationCandidates(){return e.object({candidates:e.array(K).max(1e3)}).strict().parse(await o("/v1/model-projects/configuration/candidates",{headers:{accept:"application/json"}})).candidates},async checkConfiguration(r){let l=j(r);return Z.parse(await o("/v1/model-projects/configuration/check",{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(l)}))},async saveConfiguration(r){let l=j(r);return v.parse(await o("/v1/model-projects/configuration/save",{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(l)}))},async upsert(r){M(r,b,"Model Project sync");let l=Q.parse(r),p=await o(`/v1/model-projects/${encodeURIComponent(l.portableProjectId)}`,{method:"PUT",body:JSON.stringify(l)});return v.parse(C(p,"project"))},async list(){let r=await o("/v1/model-projects");return e.array(v).parse(C(r,"projects"))},async get(r){let l=await o(`/v1/model-projects/${encodeURIComponent(a.parse(r))}`);return ee.parse(l)}}}s(ve,"createModelProjectsClient");function C(t,n){return!t||typeof t!="object"||Array.isArray(t)?t:n in t?t[n]:t}s(C,"unwrapObject");export{ne as a,_ as b,ae as c,oe as d,re as e,b as f,x as g,u as h,A as i,I as j,M as k,T as l,U as m,pe as n,fe as o,f as p,R as q,h as r,J as s,q as t,V as u,G as v,H as w,$ as x,Y as y,z,X as A,D as B,F as C,Z as D,K as E,ge as F,j as G,he as H,Q as I,v as J,W as K,ee as L,te as M,B as N,ve as O};
2
+ import{a as S}from"./chunk-SD2XDZQW.js";import{v as y}from"./chunk-ZY32SZ2P.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as s}from"./chunk-FTQLQJQV.js";var ne="application/vnd.openpond.training+json;version=2",_="application/vnd.openpond.model-project+json;version=2",ae=1048576,oe=67108864,re=8388608,b=524288,x=8388608,u=class extends Error{static{s(this,"OpenPondProtocolError")}code;constructor(t,n){super(n),this.name="OpenPondProtocolError",this.code=t}};function A(t){return JSON.stringify(P(t))}s(A,"canonicalJson");function L(t){return new TextEncoder().encode(A(t)).byteLength}s(L,"canonicalJsonByteLength");async function I(t){let n=new TextEncoder().encode(A(t)),i=await globalThis.crypto.subtle.digest("SHA-256",n);return Array.from(new Uint8Array(i),o=>o.toString(16).padStart(2,"0")).join("")}s(I,"canonicalSha256");function M(t,n,i){let o=L(t);if(o>n)throw new u("payload_too_large",`${i} is ${o} bytes; the maximum is ${n} bytes.`)}s(M,"assertCanonicalPayloadSize");function w(t,n,i){let o=new TextEncoder().encode(t).byteLength;if(o>n)throw new u("response_too_large",`${i} is ${o} bytes; the maximum is ${n} bytes.`);try{return JSON.parse(t)}catch{throw new u("invalid_json",`${i} was not valid JSON.`)}}s(w,"parseBoundedJson");async function T(t,n,i){let o=t.body?.getReader();if(!o)return w("",n,i);let r=new TextDecoder,l=0,p="";try{for(;;){let d=await o.read();if(d.done)break;if(l+=d.value.byteLength,l>n)throw new u("response_too_large",`${i} exceeds the maximum of ${n} bytes.`);p+=r.decode(d.value,{stream:!0})}return p+=r.decode(),w(p,n,i)}catch(d){try{await o.cancel()}catch{}throw d}finally{try{o.releaseLock()}catch{}}}s(T,"readBoundedJsonResponse");function P(t){if(t===null||typeof t=="string"||typeof t=="boolean")return t;if(typeof t=="number"){if(!Number.isFinite(t))throw new u("non_json_value","Canonical JSON cannot contain a non-finite number.");return Object.is(t,-0)?0:t}if(Array.isArray(t))return t.map(n=>P(n));if(typeof t=="object"){let n=Object.getPrototypeOf(t);if(n!==Object.prototype&&n!==null)throw new u("non_json_value","Canonical JSON accepts only plain objects.");let i=Object.create(null);for(let o of Object.keys(t).sort()){let r=t[o];if(r===void 0||typeof r=="function"||typeof r=="symbol")throw new u("non_json_value",`Canonical JSON cannot contain ${typeof r} at ${o}.`);i[o]=P(r)}return i}throw new u("non_json_value",`Canonical JSON cannot contain ${typeof t}.`)}s(P,"normalizeCanonicalJson");var g=e.string().trim().min(1).max(191),k=e.string().regex(/^[a-f0-9]{64}$/),U=e.discriminatedUnion("mode",[e.object({mode:e.literal("automatic"),objective:e.enum(["balanced","fast","economical"]),gpuCount:e.union([e.literal(1),e.literal(2)]).optional()}).strict(),e.object({mode:e.literal("manual"),availabilityId:g,gpuType:e.string().trim().min(1).max(256),gpuCount:e.union([e.literal(1),e.literal(2)]).optional()}).strict()]),pe=e.object({estimateId:g,inputHash:k,requestHash:k,pricingVersion:g,expiresAt:e.string().datetime({offset:!0}),token:e.string().min(1).max(8192)}).strict(),fe=e.object({schemaVersion:e.literal("openpond.trainingGpuCatalog.v1"),observedAt:e.string().datetime({offset:!0}),expiresAt:e.string().datetime({offset:!0}),workerImageDigest:e.string().regex(/^sha256:[a-f0-9]{64}$/),supportedLoraRanks:e.array(e.number().int().positive()),pricingBasis:e.literal("accepted_compute_and_disk_hourly_before_credits"),offerings:e.array(e.object({availabilityId:g,gpuType:e.string().min(1).max(256),provider:g,region:e.string().min(1),dataCenterId:e.string().nullable(),gpuCount:e.number().int().positive(),gpuMemoryGb:e.number().positive(),stockStatus:e.enum(["High","Medium","Low"]),computeHourlyUsd:e.number().nonnegative(),diskHourlyUsd:e.number().nonnegative(),totalHourlyUsd:e.number().nonnegative()}).strict()).max(1e3)}).strict(),a=e.string().trim().min(1).max(500),m=e.string().regex(/^[a-f0-9]{64}$/),c=e.string().datetime({offset:!0}),f=e.object({id:a,contentHash:m}).strict(),R=f.extend({revision:e.number().int().positive()}).strict(),h=e.object({schemaVersion:e.literal("openpond.baseModelPreference.v1"),modelId:a,revision:e.string().trim().min(1).max(256).nullable(),tokenizerRevision:e.string().trim().min(1).max(256).nullable(),chatTemplateHash:e.string().trim().min(8).max(256).nullable(),modelAssetId:a.nullable(),source:e.enum(["managed","local","builtin"])}).strict(),J=e.enum(["sft","dpo","grpo","ppo","sdft","opd","opsd","sdpo"]),q=e.object({schemaVersion:e.string().regex(/^openpond\.[A-Za-z0-9]+Recipe\.v\d+$/),method:J,parameterization:e.enum(["lora","full"])}).catchall(e.unknown()),V=e.object({profileProjectId:a,sourceRevision:e.string().regex(/^[a-f0-9]{40,64}$/),harnessRelease:f}).strict(),G=e.object({profileProjectId:a,sourceRevision:e.string().regex(/^[a-f0-9]{40,64}$/),catalogHash:m,definitionId:a,harnessRelease:f,tasksetRelease:f}).strict(),H=e.object({tasksetRef:R.nullable().default(null),evaluationTasksetRef:R.nullable().optional(),profileSource:V.nullable().optional(),profileEvaluation:G.nullable().optional(),rewardBindingRef:R.nullable().optional(),tasksetRelease:f.nullable().default(null),harnessRelease:f.nullable().default(null),baseModel:h.nullable().default(null),method:J.nullable().default(null),destinationId:a.nullable().default(null),managedRolloutPlacement:e.enum(["local","remote"]).default("remote"),managedGpuPlacementObjective:e.enum(["fast","balanced","economical"]).default("balanced"),managedGpuSelection:U.optional(),continuationAdapterMode:e.enum(["residual_append","shared","sequential_merge"]).optional(),managedGpuRequirement:e.enum(["any","h100_hbm3"]).default("any"),runPreset:e.enum(["small","standard","custom","small_experiment"]).nullable().default(null),recipe:q.nullable().default(null),preferredMaximumSpendUsd:e.number().nonnegative().nullable().default(null),preferredRetentionDays:e.number().int().nonnegative().nullable().default(null)}).strict(),$=H,Y=e.object({schemaVersion:e.literal("openpond.hostedModelProjectLink.v1"),apiOrigin:e.string().url().refine(t=>new URL(t).origin===t,"Use a canonical API origin.").nullable().default(null),teamId:a,projectId:a,portableProjectId:a,revision:e.number().int().positive(),etag:m,syncedSourceRevision:e.number().int().positive(),syncedAt:c,tasksets:e.array(e.object({localTasksetId:a,localTasksetHash:m.nullable().default(null),releaseId:a,releaseRevision:e.number().int().positive(),releaseHash:m,packageHash:m.nullable().default(null),hostedTasksetId:a,syncedAt:c}).strict()).max(1e4).default([])}).strict(),z=e.object({localTasksetId:a,releaseId:a,releaseRevision:e.number().int().positive(),releaseHash:m,state:e.enum(["syncing","synced","sync_failed"]),hostedTasksetId:a.nullable().default(null),lastAttemptAt:c,syncedAt:c.nullable().default(null),lastError:e.string().trim().min(1).max(5e3).nullable().default(null)}).strict(),X=e.object({schemaVersion:e.literal("openpond.modelProject.v2"),id:a,profileId:a,revision:e.number().int().positive().default(1),name:e.string().trim().min(1).max(200),objective:e.string().trim().max(5e3).nullable(),defaultBaseModel:h.nullable(),defaultDestinationId:a.nullable(),trainingSetup:H,hosted:Y.nullable().default(null),tasksetSyncs:e.array(z).max(1e4).default([]),createdAt:c,updatedAt:c}).strict(),D=X.pick({id:!0,profileId:!0,name:!0,objective:!0,defaultBaseModel:!0,defaultDestinationId:!0,trainingSetup:!0}),F=e.object({schemaVersion:e.literal("openpond.modelProjectSave.v1"),operationId:a,expectedRevision:e.number().int().nonnegative(),project:D,learning:S.optional()}).strict().superRefine((t,n)=>{t.learning&&t.expectedRevision!==0&&n.addIssue({code:"custom",path:["learning"],message:"Use learning settings to edit an existing Model's policy."})}),Z=e.object({schemaVersion:e.literal("openpond.modelProjectConfigurationCheck.v1"),configurationHash:m,projectId:a,expectedRevision:e.number().int().nonnegative(),checkedAt:c,canSave:e.boolean(),deferred:e.array(e.enum(["base_model","taskset"])).max(2),findings:e.array(e.object({code:a,severity:e.enum(["error","warning"]),message:e.string().min(1).max(5e3),field:e.string().min(1).max(500).nullable()}).strict()).max(100)}).strict(),K=e.object({id:a,name:e.string().min(1).max(500),available:e.boolean(),preference:h}).strict();async function ge(t){let n=j(t);return I({project:n.project,expectedRevision:n.expectedRevision,...n.learning?{learning:n.learning}:{}})}s(ge,"modelProjectConfigurationHash");function j(t){try{y(t,b)}catch{throw new B(400,{schemaVersion:"openpond.modelProjectApiError.v2",code:"model_configuration_json_invalid",message:"Model configuration must be bounded JSON data.",retryable:!1,requestId:null,details:{}})}return F.parse(t)}s(j,"parseModelProjectSaveRequest");async function he(t,n,i){y(t,b);let o=D.parse(t);M(o,b,"Model configuration");let r=i?S.parse(i):void 0,l=await I({project:o,expectedRevision:n,...r?{learning:r}:{}});return j({schemaVersion:"openpond.modelProjectSave.v1",operationId:`model-save:${l}`,expectedRevision:n,project:o,...r?{learning:r}:{}})}s(he,"createModelProjectSaveRequest");var Q=e.object({schemaVersion:e.literal("openpond.hostedModelProjectSync.v2"),portableProjectId:a,name:e.string().trim().min(1).max(200),objective:e.string().trim().max(5e3).nullable(),defaultBaseModel:h.nullable(),defaultDestinationId:a.nullable(),trainingSetup:$,sourceRevision:e.number().int().positive(),sourceUpdatedAt:c,expectedEtag:m.nullable().default(null)}).strict(),v=e.object({id:a,teamId:a,portableProjectId:a,name:e.string().trim().min(1).max(200),objective:e.string().trim().max(5e3).nullable(),defaultBaseModel:h.nullable(),defaultDestinationId:a.nullable(),trainingSetup:$,sourceRevision:e.number().int().positive(),sourceUpdatedAt:c,revision:e.number().int().positive(),etag:m,createdAt:c,updatedAt:c}).strict(),W=e.object({kind:e.enum(["taskset_release","harness_release","dataset_release","evidence_set","model_version","reward_model_version","evaluation_receipt"]),ref:f,role:e.string().trim().min(1).max(200).nullable().default(null),updatedAt:c}).strict(),ee=e.object({project:v,resources:e.array(W).max(1e4),jobCount:e.number().int().nonnegative(),latestJobIds:e.array(a).max(100)}).strict(),te=e.object({schemaVersion:e.literal("openpond.modelProjectApiError.v2"),code:e.string().trim().min(1).max(200),message:e.string().trim().min(1).max(5e3),retryable:e.boolean().default(!1),requestId:e.string().trim().min(1).max(500).nullable().default(null),details:e.record(e.string(),e.unknown()).default({})}).strict(),B=class extends Error{static{s(this,"OpenPondModelProjectApiError")}status;code;retryable;requestId;details;constructor(t,n){super(n.message),this.name="OpenPondModelProjectApiError",this.status=t,this.code=n.code,this.retryable=n.retryable,this.requestId=n.requestId,this.details=n.details}};function N(t){let n={};return new Headers(t).forEach((i,o)=>{n[o]=i}),n}s(N,"headersRecord");function ve(t){let n=t.fetch??fetch,i=t.baseUrl.replace(/\/$/,"");async function o(r,l){let p=typeof t.headers=="function"?await t.headers():t.headers??{},d=await n(`${i}${r}`,{...l,headers:{accept:_,...l?.body?{"content-type":_}:{},...N(p),...N(l?.headers)}}),O=await T(d,x,"Model Project API response");if(!d.ok){let E=te.safeParse(O);throw E.success?new B(d.status,E.data):new u("invalid_error_response",`Model Project request failed with HTTP ${d.status} and an invalid error envelope.`)}return O}return s(o,"request"),{async configurationCandidates(){return e.object({candidates:e.array(K).max(1e3)}).strict().parse(await o("/v1/model-projects/configuration/candidates",{headers:{accept:"application/json"}})).candidates},async checkConfiguration(r){let l=j(r);return Z.parse(await o("/v1/model-projects/configuration/check",{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(l)}))},async saveConfiguration(r){let l=j(r);return v.parse(await o("/v1/model-projects/configuration/save",{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(l)}))},async upsert(r){M(r,b,"Model Project sync");let l=Q.parse(r),p=await o(`/v1/model-projects/${encodeURIComponent(l.portableProjectId)}`,{method:"PUT",body:JSON.stringify(l)});return v.parse(C(p,"project"))},async list(){let r=await o("/v1/model-projects");return e.array(v).parse(C(r,"projects"))},async get(r){let l=await o(`/v1/model-projects/${encodeURIComponent(a.parse(r))}`);return ee.parse(l)}}}s(ve,"createModelProjectsClient");function C(t,n){return!t||typeof t!="object"||Array.isArray(t)?t:n in t?t[n]:t}s(C,"unwrapObject");export{ne as a,_ as b,ae as c,oe as d,re as e,b as f,x as g,u as h,A as i,I as j,M as k,T as l,U as m,pe as n,fe as o,f as p,R as q,h as r,J as s,q as t,V as u,G as v,H as w,$ as x,Y as y,z,X as A,D as B,F as C,Z as D,K as E,ge as F,j as G,he as H,Q as I,v as J,W as K,ee as L,te as M,B as N,ve as O};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{m as r}from"./chunk-WBO6FQHR.js";import{Da as s,Ea as a,Fa as d}from"./chunk-MVPKU72J.js";import{a as n}from"./chunk-FTQLQJQV.js";async function u(){return{...s.parse(await r({path:"/saved-work"})),webBaseUrl:i()}}n(u,"listHostedSavedWork");async function m(e){let t=a.parse(e);return r({path:"/saved-work",method:"POST",body:t})}n(m,"createHostedSavedWork");async function h(e,t){let o=d.parse(t);return r({path:`/saved-work/schedules/${encodeURIComponent(e)}`,method:"PATCH",body:o})}n(h,"updateHostedSavedWork");async function k(e){return r({path:`/saved-work/schedules/${encodeURIComponent(e)}`,method:"DELETE"})}n(k,"deleteHostedSavedWork");async function P(e,t){return r({path:`/saved-work/schedules/${encodeURIComponent(e)}/run`,method:"POST",body:{clientRequestId:t}})}n(P,"runHostedSavedWork");function i(e=process.env){let t=e.OPENPOND_HOSTED_WEB_URL?.trim()||e.OPENPOND_SANDBOX_BASE_URL?.trim()||e.OPENPOND_API_URL?.trim()||e.OPENPOND_SANDBOX_API_URL?.trim()||"https://api.openpond.ai",o=new URL(t);return o.hostname==="api.openpond.ai"||o.hostname.endsWith(".api.openpond.ai")?"https://openpond.ai":(o.pathname="",o.search="",o.hash="",o.origin)}n(i,"hostedWebBaseUrl");export{u as a,m as b,h as c,k as d,P as e,i as f};
2
+ import{m as r}from"./chunk-IXZ5ZGIL.js";import{Da as s,Ea as a,Fa as d}from"./chunk-CJDGLPNX.js";import{a as n}from"./chunk-FTQLQJQV.js";async function u(){return{...s.parse(await r({path:"/saved-work"})),webBaseUrl:i()}}n(u,"listHostedSavedWork");async function m(e){let t=a.parse(e);return r({path:"/saved-work",method:"POST",body:t})}n(m,"createHostedSavedWork");async function h(e,t){let o=d.parse(t);return r({path:`/saved-work/schedules/${encodeURIComponent(e)}`,method:"PATCH",body:o})}n(h,"updateHostedSavedWork");async function k(e){return r({path:`/saved-work/schedules/${encodeURIComponent(e)}`,method:"DELETE"})}n(k,"deleteHostedSavedWork");async function P(e,t){return r({path:`/saved-work/schedules/${encodeURIComponent(e)}/run`,method:"POST",body:{clientRequestId:t}})}n(P,"runHostedSavedWork");function i(e=process.env){let t=e.OPENPOND_HOSTED_WEB_URL?.trim()||e.OPENPOND_SANDBOX_BASE_URL?.trim()||e.OPENPOND_API_URL?.trim()||e.OPENPOND_SANDBOX_API_URL?.trim()||"https://api.openpond.ai",o=new URL(t);return o.hostname==="api.openpond.ai"||o.hostname.endsWith(".api.openpond.ai")?"https://openpond.ai":(o.pathname="",o.search="",o.hash="",o.origin)}n(i,"hostedWebBaseUrl");export{u as a,m as b,h as c,k as d,P as e,i as f};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as _e,f as le}from"./chunk-DIDQHTAX.js";import{a as v,b as de,c as K,d as Ee}from"./chunk-Z2TOBS3P.js";import{a as U}from"./chunk-7PXZ4X4P.js";import{a as h}from"./chunk-BJXPQIVD.js";import{a as j,c as ne,d as oe}from"./chunk-QYQZQVVN.js";import{E as k,G as ie,P as re}from"./chunk-GFAI2MCJ.js";import{k as Te,l as S,m as P,n as q}from"./chunk-VS2LOUCT.js";import{a as te}from"./chunk-DMFUEUAZ.js";import{a as ae,c as se}from"./chunk-GF55VEMR.js";import{w as ee}from"./chunk-MVPKU72J.js";import{E as $,F as z,G as Z,c as Q,d as Y,e as J,f as V}from"./chunk-SH7POUVX.js";import{c as W,m as B}from"./chunk-UGOK7VTC.js";import{a as r}from"./chunk-FTQLQJQV.js";function Ne(t,e){e.assertCurrent?.();let a=ae.parse(e.owner),s=t.get("SELECT payload FROM sessions WHERE id = ?",[e.sessionId]);if(!s)throw new Error("ponder_desktop_attach_session_unavailable");let i=ee.parse(JSON.parse(s.payload));if(se(i,a))return i;if(!ie(i))throw new Error("ponder_desktop_attach_session_not_eligible");let n=t.get("SELECT id FROM turns WHERE session_id = ? ORDER BY sort_index DESC LIMIT 1",[i.id]);if(k(i,n?.id??null)!==e.expectedRevision)throw new Error("ponder_desktop_attach_session_changed");let o={...i,updatedAt:new Date().toISOString(),metadata:{...i.metadata,ponderLocalOwner:a}};return t.run("UPDATE sessions SET payload = ?, updated_at = ? WHERE id = ?",[JSON.stringify(o),o.updatedAt,i.id]),o}r(Ne,"attachLocalSessionOwner");function ce(t){let e=new Map;for(let a of t){let s=Date.parse(a.startedAt);if(!Number.isFinite(s))continue;let i=e.get(a.sessionId)??{completedRuntimeMs:0,runningSinceMs:null},n=a.completedAt?Date.parse(a.completedAt):Number.NaN;Number.isFinite(n)?i.completedRuntimeMs+=Math.max(0,n-s):a.status==="in_progress"&&(i.runningSinceMs===null||s<i.runningSinceMs)&&(i.runningSinceMs=s),e.set(a.sessionId,i)}return new Map([...e].map(([a,s])=>[a,{runtimeSeconds:Math.max(0,Math.floor(s.completedRuntimeMs/1e3)),runtimeRunningSince:s.runningSinceMs===null?null:new Date(s.runningSinceMs).toISOString()}]))}r(ce,"sessionRuntimeSummaries");function y(t,e){return{...t,runtimeSeconds:e?.runtimeSeconds??0,runtimeRunningSince:e?.runtimeRunningSince??null}}r(y,"sessionWithRuntimeSummary");var tt=new Set(["turn.started","turn.completed","turn.failed","turn.interrupted","approval.requested","approval.resolved","task.input","task.wait"]);function ue(t,e){if(!tt.has(e.name)||e.sessionId!==t.id)return t;let a=Date.parse(e.timestamp),s=Date.parse(typeof t.metadata?.sidebarActivityAt=="string"?t.metadata.sidebarActivityAt:t.createdAt);return!Number.isFinite(a)||a<=(Number.isFinite(s)?s:0)?t:{...t,metadata:{...t.metadata,sidebarActivityAt:e.timestamp}}}r(ue,"sessionWithSidebarActivity");import{promises as Je}from"node:fs";import b from"node:path";var pe=`
2
+ import{a as _e,f as le}from"./chunk-XKZ4PFMQ.js";import{a as v,b as de,c as K,d as Ee}from"./chunk-4B7EGNYX.js";import{a as U}from"./chunk-7PXZ4X4P.js";import{a as h}from"./chunk-BJXPQIVD.js";import{a as j,c as ne,d as oe}from"./chunk-375PADDM.js";import{E as k,G as ie,P as re}from"./chunk-RS526BG7.js";import{k as Te,l as S,m as P,n as q}from"./chunk-VS2LOUCT.js";import{a as te}from"./chunk-DMFUEUAZ.js";import{a as ae,c as se}from"./chunk-GF55VEMR.js";import{w as ee}from"./chunk-CJDGLPNX.js";import{E as $,F as z,G as Z,c as Q,d as Y,e as J,f as V}from"./chunk-SH7POUVX.js";import{c as W,m as B}from"./chunk-UGOK7VTC.js";import{a as r}from"./chunk-FTQLQJQV.js";function Ne(t,e){e.assertCurrent?.();let a=ae.parse(e.owner),s=t.get("SELECT payload FROM sessions WHERE id = ?",[e.sessionId]);if(!s)throw new Error("ponder_desktop_attach_session_unavailable");let i=ee.parse(JSON.parse(s.payload));if(se(i,a))return i;if(!ie(i))throw new Error("ponder_desktop_attach_session_not_eligible");let n=t.get("SELECT id FROM turns WHERE session_id = ? ORDER BY sort_index DESC LIMIT 1",[i.id]);if(k(i,n?.id??null)!==e.expectedRevision)throw new Error("ponder_desktop_attach_session_changed");let o={...i,updatedAt:new Date().toISOString(),metadata:{...i.metadata,ponderLocalOwner:a}};return t.run("UPDATE sessions SET payload = ?, updated_at = ? WHERE id = ?",[JSON.stringify(o),o.updatedAt,i.id]),o}r(Ne,"attachLocalSessionOwner");function ce(t){let e=new Map;for(let a of t){let s=Date.parse(a.startedAt);if(!Number.isFinite(s))continue;let i=e.get(a.sessionId)??{completedRuntimeMs:0,runningSinceMs:null},n=a.completedAt?Date.parse(a.completedAt):Number.NaN;Number.isFinite(n)?i.completedRuntimeMs+=Math.max(0,n-s):a.status==="in_progress"&&(i.runningSinceMs===null||s<i.runningSinceMs)&&(i.runningSinceMs=s),e.set(a.sessionId,i)}return new Map([...e].map(([a,s])=>[a,{runtimeSeconds:Math.max(0,Math.floor(s.completedRuntimeMs/1e3)),runtimeRunningSince:s.runningSinceMs===null?null:new Date(s.runningSinceMs).toISOString()}]))}r(ce,"sessionRuntimeSummaries");function y(t,e){return{...t,runtimeSeconds:e?.runtimeSeconds??0,runtimeRunningSince:e?.runtimeRunningSince??null}}r(y,"sessionWithRuntimeSummary");var tt=new Set(["turn.started","turn.completed","turn.failed","turn.interrupted","approval.requested","approval.resolved","task.input","task.wait"]);function ue(t,e){if(!tt.has(e.name)||e.sessionId!==t.id)return t;let a=Date.parse(e.timestamp),s=Date.parse(typeof t.metadata?.sidebarActivityAt=="string"?t.metadata.sidebarActivityAt:t.createdAt);return!Number.isFinite(a)||a<=(Number.isFinite(s)?s:0)?t:{...t,metadata:{...t.metadata,sidebarActivityAt:e.timestamp}}}r(ue,"sessionWithSidebarActivity");import{promises as Je}from"node:fs";import b from"node:path";var pe=`
3
3
  CREATE TABLE IF NOT EXISTS sessions (
4
4
  id TEXT PRIMARY KEY,
5
5
  sort_index INTEGER NOT NULL,
@@ -1163,11 +1163,11 @@ import{a as _e,f as le}from"./chunk-DIDQHTAX.js";import{a as v,b as de,c as K,d
1163
1163
  CREATE INDEX model_runs_profile_updated_idx ON model_runs(profile_id, updated_at DESC);
1164
1164
  CREATE INDEX model_runs_model_updated_idx ON model_runs(model_id, updated_at DESC);
1165
1165
  CREATE INDEX model_runs_taskset_updated_idx ON model_runs(taskset_id, updated_at DESC);
1166
- `)}r(be,"allowModelRunsWithoutVersion");var H={tasksetRef:null,harnessRelease:null,tasksetRelease:null,baseModel:null,method:null,destinationId:null,managedRolloutPlacement:"remote",runPreset:null,recipe:null,preferredMaximumSpendUsd:null,preferredRetentionDays:null};async function xe(t){let e="model_run_drafts",a=await t.all("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",[e]),s=new Map;if(a.length>0){let n=await t.all(`SELECT payload, updated_at FROM ${e} ORDER BY updated_at DESC`);for(let o of n){let d=JSON.parse(o.payload),T=typeof d.modelId=="string"?d.modelId:null;T&&!s.has(T)&&s.set(T,d)}}let i=await t.all("SELECT payload, updated_at FROM model_projects ORDER BY updated_at ASC");for(let n of i){let{ModelProjectSchema:o}=await import("./model-projects-GHWCKDON.js"),{sanitizeUnverifiableLearnedPreferenceBindings:d}=await import("./store-learned-preference-migration-validation-EXNRDHCO.js"),T=JSON.parse(n.payload),E=String(T.id),_=s.get(E),u=it(T.trainingSetup)?T.trainingSetup:H,p=_&&typeof _.updatedAt=="string"?_.updatedAt:null,L=!!(_&&p&&p>=n.updated_at),O=L&&_?{...H,...u,tasksetRef:_.tasksetRef??u.tasksetRef??null,harnessRelease:_.harnessRelease??u.harnessRelease??null,tasksetRelease:_.tasksetRelease??u.tasksetRelease??null,baseModel:_.baseModel??u.baseModel??null,method:_.method??u.method??null,destinationId:_.destinationId??u.destinationId??null,managedRolloutPlacement:_.managedRolloutPlacement??u.managedRolloutPlacement??"remote",runPreset:_.runPreset??u.runPreset??null,recipe:_.recipe??u.recipe??null}:{...H,...u},N=d(O).value,m=typeof T.revision=="number"&&Number.isInteger(T.revision)?T.revision:1,l=L&&p?p:String(T.updatedAt??n.updated_at),A=o.parse({...T,schemaVersion:"openpond.modelProject.v2",revision:m+1,trainingSetup:N,hosted:T.hosted??null,tasksetSyncs:T.tasksetSyncs??[],updatedAt:l});await t.run("UPDATE model_projects SET payload = ?, updated_at = ? WHERE id = ?",[JSON.stringify(A),A.updatedAt,A.id])}await t.exec(`
1166
+ `)}r(be,"allowModelRunsWithoutVersion");var H={tasksetRef:null,harnessRelease:null,tasksetRelease:null,baseModel:null,method:null,destinationId:null,managedRolloutPlacement:"remote",runPreset:null,recipe:null,preferredMaximumSpendUsd:null,preferredRetentionDays:null};async function xe(t){let e="model_run_drafts",a=await t.all("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",[e]),s=new Map;if(a.length>0){let n=await t.all(`SELECT payload, updated_at FROM ${e} ORDER BY updated_at DESC`);for(let o of n){let d=JSON.parse(o.payload),T=typeof d.modelId=="string"?d.modelId:null;T&&!s.has(T)&&s.set(T,d)}}let i=await t.all("SELECT payload, updated_at FROM model_projects ORDER BY updated_at ASC");for(let n of i){let{ModelProjectSchema:o}=await import("./model-projects-HP4DELCP.js"),{sanitizeUnverifiableLearnedPreferenceBindings:d}=await import("./store-learned-preference-migration-validation-FNBGGZU6.js"),T=JSON.parse(n.payload),E=String(T.id),_=s.get(E),u=it(T.trainingSetup)?T.trainingSetup:H,p=_&&typeof _.updatedAt=="string"?_.updatedAt:null,L=!!(_&&p&&p>=n.updated_at),O=L&&_?{...H,...u,tasksetRef:_.tasksetRef??u.tasksetRef??null,harnessRelease:_.harnessRelease??u.harnessRelease??null,tasksetRelease:_.tasksetRelease??u.tasksetRelease??null,baseModel:_.baseModel??u.baseModel??null,method:_.method??u.method??null,destinationId:_.destinationId??u.destinationId??null,managedRolloutPlacement:_.managedRolloutPlacement??u.managedRolloutPlacement??"remote",runPreset:_.runPreset??u.runPreset??null,recipe:_.recipe??u.recipe??null}:{...H,...u},N=d(O).value,m=typeof T.revision=="number"&&Number.isInteger(T.revision)?T.revision:1,l=L&&p?p:String(T.updatedAt??n.updated_at),A=o.parse({...T,schemaVersion:"openpond.modelProject.v2",revision:m+1,trainingSetup:N,hosted:T.hosted??null,tasksetSyncs:T.tasksetSyncs??[],updatedAt:l});await t.run("UPDATE model_projects SET payload = ?, updated_at = ? WHERE id = ?",[JSON.stringify(A),A.updatedAt,A.id])}await t.exec(`
1167
1167
  DROP INDEX IF EXISTS model_run_drafts_profile_updated_idx;
1168
1168
  DROP INDEX IF EXISTS model_run_drafts_model_idx;
1169
1169
  DROP TABLE IF EXISTS model_run_drafts;
1170
- `)}r(xe,"consolidateModelProjectTrainingSetup");async function Fe(t){for(let e of["model_projects","model_runs","training_plans"]){if((await t.all("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",[e])).length===0)continue;let s=await t.all(`SELECT id, payload FROM ${e} WHERE payload LIKE '%learnedPreference%'`);for(let i of s){let{sanitizeUnverifiableLearnedPreferenceBindings:n}=await import("./store-learned-preference-migration-validation-EXNRDHCO.js"),o=n(JSON.parse(i.payload));o.changed&&await t.run(`UPDATE ${e} SET payload = ? WHERE id = ?`,[JSON.stringify(o.value),i.id])}}}r(Fe,"repairUnverifiableLearnedPreferenceBindings");function it(t){return!!(t&&typeof t=="object"&&!Array.isArray(t))}r(it,"isRecord");async function Me(t){await t.exec(`
1170
+ `)}r(xe,"consolidateModelProjectTrainingSetup");async function Fe(t){for(let e of["model_projects","model_runs","training_plans"]){if((await t.all("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",[e])).length===0)continue;let s=await t.all(`SELECT id, payload FROM ${e} WHERE payload LIKE '%learnedPreference%'`);for(let i of s){let{sanitizeUnverifiableLearnedPreferenceBindings:n}=await import("./store-learned-preference-migration-validation-FNBGGZU6.js"),o=n(JSON.parse(i.payload));o.changed&&await t.run(`UPDATE ${e} SET payload = ? WHERE id = ?`,[JSON.stringify(o.value),i.id])}}}r(Fe,"repairUnverifiableLearnedPreferenceBindings");function it(t){return!!(t&&typeof t=="object"&&!Array.isArray(t))}r(it,"isRecord");async function Me(t){await t.exec(`
1171
1171
  CREATE TABLE IF NOT EXISTS model_versions (
1172
1172
  id TEXT PRIMARY KEY,
1173
1173
  model_id TEXT NOT NULL,
@@ -1870,4 +1870,4 @@ CREATE TABLE IF NOT EXISTS model_project_taskset_preparations (
1870
1870
  session_id = excluded.session_id,
1871
1871
  status = excluded.status,
1872
1872
  payload = excluded.payload,
1873
- updated_at = excluded.updated_at`,[e.id,e.sessionId,e.status,n,JSON.stringify(e),h()]),await this.upsertApprovalProjection(e,n),await this.rebuildThreadDetailProjectionForSession(e.sessionId),i&&i!==e.sessionId&&await this.rebuildThreadDetailProjectionForSession(i),s===-1?this.data.approvals.push(e):this.data.approvals[s]=e});this.writeQueue=a.catch(()=>{}),await a}async getCacheEntry(e,a){return await this.ready,$(this.home,e,a,{allowStale:!0})}async getCacheEntriesByType(e){return await this.ready,Z(this.home,e)}async setCacheEntry(e,a,s,i=null){return await this.ready,z(this.home,e,a,s,{error:i})}async setCacheError(e,a,s,i){let n=await this.getCacheEntry(e,a);await this.setCacheEntry(e,a,n?.payload??s,i)}async mutate(e){await this.ready;let a={sessions:[],turns:[],events:[],approvals:[]},s=this.writeQueue.then(async()=>{let i=await K({allPayloadRows:r((n,o)=>this.all(n,o),"allPayloadRows")});e(i),await Ee(i,{exec:r(n=>this.exec(n),"exec"),run:r((n,o)=>this.run(n,o),"run")}),this.data={sessions:i.sessions,turns:i.turns,approvals:i.approvals},this.runtimeSummaryCache=null,await this.rebuildReadModels(),a=structuredClone(i)});return this.writeQueue=s.catch(()=>{}),await s,a}async appendRuntimeEvent(e){await this.ready;let a=this.writeQueue.then(async()=>{let s=te(e);await this.exec("BEGIN IMMEDIATE");try{let i=await this.insertRuntimeEventRecord(s),n=this.data.sessions.findIndex(T=>T.id===i.sessionId),o=this.data.sessions[n],d=o?ue(o,i):null;return d&&d!==o&&(await this.run("UPDATE sessions SET payload = ? WHERE id = ?",[JSON.stringify(d),d.id]),await this.upsertSessionShellProjection(d,n)),await this.exec("COMMIT"),d&&d!==o&&(this.data.sessions[n]=d),i}catch(i){throw await this.exec("ROLLBACK").catch(()=>{}),i}});return this.writeQueue=a.then(()=>{},()=>{}),await a}async insertRuntimeEventRecord(e){let a=await this.nextEventSequence(),s=a-1,i={...e,sequence:a};return await this.run("INSERT INTO events (id, session_id, turn_id, name, timestamp, sequence, sort_index, payload) VALUES (?, ?, ?, ?, ?, ?, ?, ?)",[e.id,e.sessionId??null,e.turnId??null,e.name,e.timestamp,a,s,JSON.stringify(i)]),e.sessionId&&await this.updateThreadDetailProjectionForEvent(i,a),i}async runtimeEventContext(e,a){await this.ready,await this.writeQueue;let s=a?await this.turnByProviderTurnId(a):await this.latestTurnForSession(e,"in_progress");return{appId:(await this.getSession(e))?.appId,turnId:s?.id}}};import{AsyncLocalStorage as lt}from"node:async_hooks";var M=class{static{r(this,"StoreDomainLifecycle")}closing=!1;admission=new lt;pending=new Set;run(e){let a=this.admission.getStore();if(this.closing&&!a?.active)return Promise.reject(new Error("SQLite store is closing"));let s={active:!0},i=Promise.resolve().then(()=>this.admission.run(s,e)).finally(()=>{s.active=!1});return this.pending.add(i),i.then(()=>this.pending.delete(i),()=>this.pending.delete(i)),i}async close(){for(this.closing=!0;this.pending.size;)await Promise.allSettled([...this.pending])}};function c(t,e){let a,s=r(()=>a??=e(),"get"),i=r(n=>t.run(async()=>n(await s())),"call");return{call:i,methods(n,...o){return Object.fromEntries(n.map(d=>[d,(...T)=>i(E=>E[d].apply(E,T))]))}}}r(c,"lazyStoreDomain");function $e(t,e){let a=c(e,()=>import("./store-task-inbox-VVXZUJIO.js").then(l=>new l.SqliteTaskInboxStore(t))),s=c(e,()=>import("./store-harness-workspaces-PJJQ74G6.js").then(l=>new l.SqliteHarnessWorkspaceStore(t))),i=c(e,()=>import("./store-harness-refinement-candidates-LCN4NV23.js").then(l=>new l.SqliteHarnessRefinementCandidateStore(t))),n=c(e,()=>import("./store-harness-evaluation-review-settings-AAN7KKJ5.js").then(l=>new l.SqliteHarnessEvaluationReviewSettingsStore(t))),o=c(e,()=>import("./store-harness-memory-4XEUITXE.js").then(l=>new l.SqliteHarnessMemoryStore(t))),d=c(e,()=>import("./store-sidebar-file-bookmarks-J3JEVAYR.js").then(l=>new l.SqliteSidebarFileBookmarkStore(t))),T=c(e,()=>import("./store-work-evidence-77B36LRC.js").then(l=>new l.SqliteWorkEvidenceStore(t))),E=c(e,()=>import("./store-chat-workflows-S72HZXQR.js").then(l=>new l.SqliteChatWorkflowStore(t))),_=c(e,()=>import("./store-conversation-serving-WRT4N7N2.js").then(l=>new l.SqliteConversationServingStore(t))),u=c(e,()=>import("./store-schedules-JPFVWL3Q.js").then(l=>new l.SqliteScheduleStore(t))),p=c(e,()=>import("./store-subagents-PUBQVWSU.js").then(l=>new l.SqliteSubagentStore(t))),L=c(e,()=>import("./store-usage-6DMZM7WV.js").then(l=>new l.SqliteUsageStore(t))),O=c(e,()=>import("./store-sidebar-preferences-2JHTFXJK.js").then(l=>new l.SqliteSidebarPreferenceStore(t))),N=c(e,()=>import("./store-ponder-hosted-DX6E2BVW.js").then(l=>new l.SqlitePonderHostedStore(t))),m=c(e,()=>import("./store-ponder-history-WDLMXBIJ.js").then(l=>new l.SqlitePonderHistoryStore(t)));return{...N.methods(["reserveHostedPonderInput","saveHostedPonderInput","hostedPonderConnection","configureHostedPonderConnection","hostedPonderJobs","reserveHostedPonderJob","saveHostedPonderJob"]),...m.methods(["readPonderHistory","savePonderHistory","admitPonderHistoryRequest","getPonderHistoryRequest","pendingPonderHistorySessions","latestPonderHistoryRequest"]),...u.methods(["listLocalAgentSchedules","listDueLocalAgentSchedules","getLocalAgentSchedule","upsertLocalAgentSchedule","deleteLocalAgentSchedulesNotIn","patchLocalAgentSchedule","insertLocalAgentScheduleRun","getLocalAgentScheduleRun","listLocalAgentScheduleRuns","patchLocalAgentScheduleRun"]),...p.methods(["getPersistedSubagentRun","upsertPersistedSubagentRun","upsertSubagentRun","recordRetainedWorkspaceExpiryWarning","getSubagentRun","listSubagentRuns","listActiveSubagentRuns","listSubagentRunScopes","listStaleSubagentRuns","appendSubagentMessage","listSubagentMessages"]),...L.methods(["upsertModelUsageRecord","getModelUsageRecordByRequestId","listModelUsageRecords","latestContextUsageForTurn"]),...O.methods(["getSidebarAppPreferences","patchSidebarAppPreference","reorderSidebarApps"]),...a.methods(["assertLocalPonderInput","localPonderState","saveLocalPonderState","localPonderAgents","registerLocalPonderAgent","initializeRemoteDeviceStore","setRemoteDeviceAuthority","getRemoteDeviceReceipt","getRemoteDeviceCancellation","cancelRemoteDeviceCommand","saveRemoteDeviceReceipt","admitRemoteDeviceStop","admitRemoteDeviceApproval","admitPonderDesktopInspection","getPonderDesktopInspection","setPonderProjectSharing","readPonderProjectSharing","getPonderDesktopReservationResume","admitPonderDesktopObservation","getPonderDesktopObservation","getPonderDesktopResult","commitPonderDesktopResult","setPonderDesktopAuthority","clearPonderDesktopAuthority","admitPonderDesktopStop","getPonderDesktopStop","settlePonderDesktopStop","recoverTaskInboxOwners","hasTaskCompletion","taskInboxSnapshot","declareTaskWork","taskWorkAreas","admitTaskInput","admitTaskInputs","rejectTaskInput","getTaskInput","taskInputsForSession","mutateTaskInput","openTaskInboxTurn","renewTaskInboxTurn","pendingTaskInputs","taskAssignmentInputs","pauseTaskInboxTurn","includeTaskInputs","settleTaskInputRequest","sealTaskInboxTurn","sealNativeTaskInboxTurn","closeTaskInboxTurn","taskInboxPaused","reserveTaskFollowup","taskInboxWakeTargets","createTaskWait","settleTaskWait","taskWaitsForSession","commitSubagentCompletion","pendingTaskCompletions","settleTaskCompletion"]),...s.methods(["createHarnessWorkspace","createHarnessWorkspaceWithRelease","getHarnessWorkspace","listHarnessWorkspaces","selectHarnessWorkspace","getSelectedHarnessWorkspace","updateHarnessWorkspaceSourceRevisionAtomically","saveHarnessReleaseRecord","getHarnessReleaseRecord","listHarnessReleaseRecords","saveHarnessImprovementArtifact","listHarnessImprovementArtifacts","listPendingHarnessRefinerTriggers","createHarnessRunOverlay","getHarnessRunOverlay","appendHarnessRunOverlayEditsAtomically","freezeHarnessRunOverlayAtomically","abandonHarnessRunOverlayAtomically","restoreHarnessRunOverlayAtomically","freezeHarnessRunOverlayWithProposalAtomically","advanceHarnessWorkspaceAtomically","rollbackHarnessWorkspaceAtomically","advanceReviewedHarnessWorkspaceAtomically","listHarnessAdvanceReceipts"]),...i.methods(["listHarnessRefinementCandidates","getHarnessRefinementCandidateByFingerprint","saveHarnessRefinementCandidateTransition","saveHarnessCrossRunRefinementRequestIfAbsent"]),...n.methods(["getHarnessBackgroundReviewSettings","setHarnessBackgroundReviewSettings","getHarnessEvaluationReviewSettings","setHarnessEvaluationReviewSettings"]),...o.methods(["listHarnessMemories","getHarnessMemory","writeHarnessMemory"]),...d.methods(["listSidebarFileBookmarks","patchSidebarFileBookmark"]),...T.methods(["saveWorkEvidenceProjection","getWorkEvidenceProjectionBySourceRevision","getWorkEvidenceProjection","listWorkEvidenceProjections","saveWorkFeedback","getWorkFeedback","listWorkFeedbackForEvidence"]),...E.methods(["listChatWorkflows","listDueChatWorkflows","getChatWorkflow","upsertChatWorkflow","patchChatWorkflow","deleteChatWorkflow","insertChatWorkflowRun","listChatWorkflowRuns","patchChatWorkflowRun"]),..._.methods(["listConversationServingGrants","listConversationServingExecutions","saveConversationServingGrant","saveConversationServingExecution"])}}r($e,"runtimeStoreMethods");function ze(t,e){let a=c(e,()=>import("./store-chat-resources-ZWDYMDJF.js").then(N=>new N.SqliteChatResourceStore(t))),s=c(e,()=>import("./store-training-DUVIDYK5.js").then(N=>new N.SqliteTrainingStore(t))),i=c(e,()=>import("./store-training-jobs-HHFH3V5O.js").then(N=>new N.SqliteTrainingJobsStore(t))),n=c(e,()=>import("./store-training-models-C7UUZDTO.js").then(N=>new N.SqliteTrainingModelStore(t))),o=c(e,()=>import("./store-model-configuration-T6XJJDAB.js").then(N=>new N.SqliteModelConfigurationStore(t))),d=c(e,()=>import("./store-model-project-preparation-WWU5CJTV.js").then(N=>new N.SqliteModelProjectPreparationStore(t))),T=c(e,()=>import("./store-model-batch-review-YIVD7T2T.js").then(N=>new N.SqliteModelBatchReviewStore(t))),E=c(e,()=>import("./store-task-inventory-MQX44AI6.js").then(N=>new N.SqliteTaskInventoryStore(t))),_=c(e,()=>import("./store-taskset-drafts-G3WFVN4M.js").then(N=>new N.SqliteTasksetDraftStore(t))),u=c(e,()=>import("./store-datasets-O67F75BL.js").then(N=>new N.SqliteDatasetStore(t))),p=c(e,()=>import("./store-continual-support-reviews-7PDLGRWF.js").then(N=>new N.SqliteContinualBenchReviewStore(t))),L=c(e,()=>import("./store-create-improve-G46KIUVT.js").then(N=>new N.SqliteCreateImproveStore(t))),O=c(e,()=>import("./store-training-overview-KTWOOLJS.js").then(N=>new N.SqliteTrainingOverviewStore(t)));return{...d.methods(["prepareLocalModelProject","applyLocalModelProjectPreparation"]),...O.methods(["readTrainingActivityState","readTrainingNavigation"]),...a.methods(["listChatHostedExperiments","readChatHostedExperiment","retainChatHostedExperiment","localResourceOwnerId","readLocalDataset","readLocalDatasetByWorkspaceHash","readLocalDatasetListing","readLocalDatasetProjection","listLocalDatasets","listLocalDatasetListings","recoverLocalDatasetOperation","saveLocalDataset","updateLocalDatasetMetadata","linkChatResource","chatResourceLinks","readChatExperimentGroup","prepareChatExperimentGroup"]),...s.methods(["trainingChatSearchSignatures","openPondTrainingChatSearchEvidence","syncTrainingChatSearchDocuments","upsertTrainingChatSearchDocument","searchTrainingChats","listTrainingSources","getTrainingSource","getTrainingSourceForSession","upsertTrainingSource","deleteTrainingSource","listTaskCreationSnapshots","getTaskCreationSnapshot","upsertTaskCreationSnapshot","getTaskCreationTranscript","getTaskDesignProposal","listTasksets","listTasksetRevisions","getTaskset","getTasksetRevision","getTasksetByHash","upsertTaskset","deleteTasksetData","listTaskCandidates","getTaskCandidate","findTaskCandidateByFingerprint","upsertTaskCandidate","saveTaskAttempt","listTaskAttempts","saveTaskAttemptArtifact","listTaskAttemptArtifacts","saveGradeResult","deleteGradeResultsForAttempt","listGradeResultsForTaskset","saveGraderAuditReport","listGraderAuditReports","saveReadinessReport","getReadinessReport","saveTaskMinerConfig","getTaskMinerConfig","saveTaskMinerRun","getTaskMinerRun","listTaskMinerRuns"]),...i.methods(["saveModelProject","getModelProject","listModelProjects","saveTrainingPlan","listTrainingPlans","getTrainingPlan","saveTrainingBundle","getTrainingBundle","listTrainingBundles","findTrainingBundleByPlanAndHash","saveTrainingJob","saveTrainingApproval","getTrainingApproval","getTrainingJob","readTrainingExecutionActivity","listTrainingJobs","saveTrainingJobEvent","saveHostedTrainingJobEvent","listTrainingJobEvents","saveTrainingArtifact","listTrainingArtifacts","getTrainingArtifact","saveModelArtifactLineage","updateModelArtifactLineageServing","updateModelArtifactLineageReview","listModelArtifactLineage","getModelArtifactLineage"]),...n.methods(["saveModelCurrencySnapshot","getModelCurrencySnapshot","listModelCurrencySnapshots","saveModelComparisonSeries","getModelComparisonSeries","listModelComparisonSeries","saveModelComparisonSeriesEntry","getModelComparisonSeriesEntry","listModelComparisonSeriesEntries","commitModelComparisonSeriesMutation","compareAndSwapModelComparisonSeriesEntry","saveRewardModelVersion","getRewardModelVersion","listRewardModelVersions","saveRewardModelRun","getRewardModelRun","listRewardModelRuns","saveModelVersion","getModelVersion","listModelVersions","saveModelRun","getModelRun","listModelRuns","saveRolloutTrajectoryReceipt","getRolloutTrajectoryReceiptByProviderId","listRolloutTrajectoryReceipts","saveModelBinding","replaceActiveModelBinding","getModelBinding","getActiveModelBinding","listModelBindings"]),...o.methods(["pendingModelPackagePush","prepareModelPackagePush","completeModelPackagePush","rejectModelPackagePush","findModelProjectConfigurationSave","saveModelProjectConfiguration","previewModelProjectTasksetSave","findModelStarterCreation","saveModelStarterCreation","prepareModelStarterCreation","saveModelProjectHosting"]),...T.methods(["findModelBatchReview","beginModelBatchReview"]),...E.methods(["taskInventorySources","taskInventorySourceIndexed","appendTaskInventoryRows","finishTaskInventorySource","readTaskInventoryPage","readTaskInventoryTask"]),..._.methods(["initializeModelTasksetDraft","saveTasksetDraft","importTasksetDraftPackage","materializePublishedTasksetPackage","finalizeTasksetDraftPublication","getTasksetDraft","listTasksetDrafts","readHumanPublishedTasksetDraft","getTasksetDraftWorkspace","deleteTasksetDraft","tasksetDraftFiles","saveTasksetDraftFile"]),...u.methods(["listDatasetCatalogTasksets","listExternalDatasetSources","getExternalDatasetSource","upsertExternalDatasetSource","listDatasetImportJobs","listAllDatasetImportJobs","getDatasetImportJob","upsertDatasetImportJob","listDatasetArtifactRegistryEntries","getDatasetArtifactRegistryEntry","getDatasetArtifactForTaskset","upsertDatasetArtifactRegistryEntry"]),...p.methods(["saveContinualLearningDailyBatch","getContinualLearningDailyBatch","listContinualLearningDailyBatches","saveContinualBenchIssueReview","getContinualBenchIssueReview","listContinualBenchIssueReviews"]),...L.methods(["getCreateImproveRun","listCreateImproveRuns","upsertCreateImproveRun","mutateCreateImproveRun"])}}r(ze,"trainingStoreMethods");function Ze(t,e){let a=c(e,()=>import("./store-learning-6P6IS7GH.js").then(T=>new T.SqliteLearningStore(t))),s=c(e,()=>import("./store-learning-credentials-EGJ2WTZI.js").then(T=>new T.SqliteLearningCredentialStore(t))),i=c(e,()=>import("./store-human-review-HJ3D7ZFA.js").then(T=>new T.SqliteHumanReviewStore(t))),n=c(e,()=>import("./store-local-experiments-CBJA56X2.js").then(T=>new T.SqliteLocalExperimentStore(t))),o=c(e,()=>import("./store-evaluation-results-BEPR4LVD.js").then(T=>new T.SqliteEvaluationResultStore(t))),d=c(e,()=>import("./store-preference-comparison-XQFTLMGH.js").then(T=>new T.SqlitePreferenceComparisonStore(t)));return{...a.methods(["listLearningScopes"]),...s.methods(["createLearningSourceCredential","findLearningSourceCredential","listLearningSourceCredentials","revokeLearningSourceCredential"]),...i.methods(["humanLiveControl","humanLiveControlReceipt","rememberHumanLocalPublication","forgetHumanLocalPublication","humanLocalPublications"]),...n.methods(["prepareEvaluationOperation","retainEvaluationOperation","readPendingEvaluationOperation","pendingEvaluationOperations","acknowledgeEvaluationOperation","claimLocalExperimentOwner","renewLocalExperimentOwner","releaseLocalExperimentOwner","saveLocalExperiment","readLocalExperiment","recoverLocalExperimentOperation","listLocalExperiments","listLocalExecutionHistory","startLocalExperiment","admitLocalExperimentRun","findLocalExperimentRunOperation","readLocalExperimentRecord","readLocalExperimentSnapshot","readExecutionActivity","listLocalExperimentRecords","readLocalExecution","readLocalExecutionCharges","appendLocalExperimentEvent","localExperimentTrace","localExperimentDiagnosticTrace","startLocalScoringPass","readLocalScoringSelection","localJudgeBudgetTransaction","listLocalExecutions","listLocalScoringPasses","admitLocalCase","settleLocalCase","cancelLocalExecution","finishLocalExecution","recoverLocalExperiments","reserveLocalCharge","markLocalChargeDispatched","settleLocalCharge"]),...o.methods(["saveProfileEvaluationGrade","getProfileEvaluationGrade","saveProfileEvaluationReceipt","getProfileEvaluationReceipt","saveProfileEvaluationRun","getProfileEvaluationRun","listProfileEvaluationRuns","saveProfileEvaluationComparison","getProfileEvaluationComparison","listProfileEvaluationComparisons","saveProfileEvaluationSuiteRun","getProfileEvaluationSuiteRun","listProfileEvaluationSuiteRuns","saveBenchmarkRun","listBenchmarkRuns","saveBenchmarkComparison","listBenchmarkComparisons","saveEvaluationResult","getEvaluationResult","listEvaluationResults"]),...d.methods(["savePreferenceComparisonRelease","getPreferenceComparisonRelease","listPreferenceComparisonReleases","revokePreferenceComparisonRelease","savePreferenceComparisonAssignment","getPreferenceComparisonAssignment","listPreferenceComparisonAssignments","claimPreferenceComparisonAssignment","claimNextPreferenceComparisonAssignment","markPreferenceComparisonUnreviewable","savePreferenceComparisonSubmission","getPreferenceComparisonSubmission","listPreferenceComparisonSubmissions","savePreferenceComparisonCalibration","listPreferenceComparisonCalibrations"]),learningRepository(){return{transaction:r((T,E)=>a.call(_=>_.learningRepository().transaction(T,E)),"transaction")}},humanReviewRepository(){return{transaction:r((T,E)=>i.call(_=>_.humanReviewRepository().transaction(T,E)),"transaction")}},humanReviewLocalEvidence(...T){return i.call(E=>Promise.resolve(E.humanReviewLocalEvidence(...T)))}}}r(Ze,"evaluationStoreMethods");var et=class extends F{static{r(this,"SqliteStore")}domains=new M;closing;constructor(e,a={}){super(e,a);let s=this.domainContext();Object.assign(this,$e(s,this.domains),ze(s,this.domains),Ze(s,this.domains))}close(){return this.closing??=this.domains.close().then(()=>super.close())}};export{et as a};
1873
+ updated_at = excluded.updated_at`,[e.id,e.sessionId,e.status,n,JSON.stringify(e),h()]),await this.upsertApprovalProjection(e,n),await this.rebuildThreadDetailProjectionForSession(e.sessionId),i&&i!==e.sessionId&&await this.rebuildThreadDetailProjectionForSession(i),s===-1?this.data.approvals.push(e):this.data.approvals[s]=e});this.writeQueue=a.catch(()=>{}),await a}async getCacheEntry(e,a){return await this.ready,$(this.home,e,a,{allowStale:!0})}async getCacheEntriesByType(e){return await this.ready,Z(this.home,e)}async setCacheEntry(e,a,s,i=null){return await this.ready,z(this.home,e,a,s,{error:i})}async setCacheError(e,a,s,i){let n=await this.getCacheEntry(e,a);await this.setCacheEntry(e,a,n?.payload??s,i)}async mutate(e){await this.ready;let a={sessions:[],turns:[],events:[],approvals:[]},s=this.writeQueue.then(async()=>{let i=await K({allPayloadRows:r((n,o)=>this.all(n,o),"allPayloadRows")});e(i),await Ee(i,{exec:r(n=>this.exec(n),"exec"),run:r((n,o)=>this.run(n,o),"run")}),this.data={sessions:i.sessions,turns:i.turns,approvals:i.approvals},this.runtimeSummaryCache=null,await this.rebuildReadModels(),a=structuredClone(i)});return this.writeQueue=s.catch(()=>{}),await s,a}async appendRuntimeEvent(e){await this.ready;let a=this.writeQueue.then(async()=>{let s=te(e);await this.exec("BEGIN IMMEDIATE");try{let i=await this.insertRuntimeEventRecord(s),n=this.data.sessions.findIndex(T=>T.id===i.sessionId),o=this.data.sessions[n],d=o?ue(o,i):null;return d&&d!==o&&(await this.run("UPDATE sessions SET payload = ? WHERE id = ?",[JSON.stringify(d),d.id]),await this.upsertSessionShellProjection(d,n)),await this.exec("COMMIT"),d&&d!==o&&(this.data.sessions[n]=d),i}catch(i){throw await this.exec("ROLLBACK").catch(()=>{}),i}});return this.writeQueue=a.then(()=>{},()=>{}),await a}async insertRuntimeEventRecord(e){let a=await this.nextEventSequence(),s=a-1,i={...e,sequence:a};return await this.run("INSERT INTO events (id, session_id, turn_id, name, timestamp, sequence, sort_index, payload) VALUES (?, ?, ?, ?, ?, ?, ?, ?)",[e.id,e.sessionId??null,e.turnId??null,e.name,e.timestamp,a,s,JSON.stringify(i)]),e.sessionId&&await this.updateThreadDetailProjectionForEvent(i,a),i}async runtimeEventContext(e,a){await this.ready,await this.writeQueue;let s=a?await this.turnByProviderTurnId(a):await this.latestTurnForSession(e,"in_progress");return{appId:(await this.getSession(e))?.appId,turnId:s?.id}}};import{AsyncLocalStorage as lt}from"node:async_hooks";var M=class{static{r(this,"StoreDomainLifecycle")}closing=!1;admission=new lt;pending=new Set;run(e){let a=this.admission.getStore();if(this.closing&&!a?.active)return Promise.reject(new Error("SQLite store is closing"));let s={active:!0},i=Promise.resolve().then(()=>this.admission.run(s,e)).finally(()=>{s.active=!1});return this.pending.add(i),i.then(()=>this.pending.delete(i),()=>this.pending.delete(i)),i}async close(){for(this.closing=!0;this.pending.size;)await Promise.allSettled([...this.pending])}};function c(t,e){let a,s=r(()=>a??=e(),"get"),i=r(n=>t.run(async()=>n(await s())),"call");return{call:i,methods(n,...o){return Object.fromEntries(n.map(d=>[d,(...T)=>i(E=>E[d].apply(E,T))]))}}}r(c,"lazyStoreDomain");function $e(t,e){let a=c(e,()=>import("./store-task-inbox-3BREANOX.js").then(l=>new l.SqliteTaskInboxStore(t))),s=c(e,()=>import("./store-harness-workspaces-SGUEYDO2.js").then(l=>new l.SqliteHarnessWorkspaceStore(t))),i=c(e,()=>import("./store-harness-refinement-candidates-LCN4NV23.js").then(l=>new l.SqliteHarnessRefinementCandidateStore(t))),n=c(e,()=>import("./store-harness-evaluation-review-settings-AAN7KKJ5.js").then(l=>new l.SqliteHarnessEvaluationReviewSettingsStore(t))),o=c(e,()=>import("./store-harness-memory-4XEUITXE.js").then(l=>new l.SqliteHarnessMemoryStore(t))),d=c(e,()=>import("./store-sidebar-file-bookmarks-J3JEVAYR.js").then(l=>new l.SqliteSidebarFileBookmarkStore(t))),T=c(e,()=>import("./store-work-evidence-77B36LRC.js").then(l=>new l.SqliteWorkEvidenceStore(t))),E=c(e,()=>import("./store-chat-workflows-S72HZXQR.js").then(l=>new l.SqliteChatWorkflowStore(t))),_=c(e,()=>import("./store-conversation-serving-YFEZYQD3.js").then(l=>new l.SqliteConversationServingStore(t))),u=c(e,()=>import("./store-schedules-JPFVWL3Q.js").then(l=>new l.SqliteScheduleStore(t))),p=c(e,()=>import("./store-subagents-PUBQVWSU.js").then(l=>new l.SqliteSubagentStore(t))),L=c(e,()=>import("./store-usage-6DMZM7WV.js").then(l=>new l.SqliteUsageStore(t))),O=c(e,()=>import("./store-sidebar-preferences-2JHTFXJK.js").then(l=>new l.SqliteSidebarPreferenceStore(t))),N=c(e,()=>import("./store-ponder-hosted-DX6E2BVW.js").then(l=>new l.SqlitePonderHostedStore(t))),m=c(e,()=>import("./store-ponder-history-WDLMXBIJ.js").then(l=>new l.SqlitePonderHistoryStore(t)));return{...N.methods(["reserveHostedPonderInput","saveHostedPonderInput","hostedPonderConnection","configureHostedPonderConnection","hostedPonderJobs","reserveHostedPonderJob","saveHostedPonderJob"]),...m.methods(["readPonderHistory","savePonderHistory","admitPonderHistoryRequest","getPonderHistoryRequest","pendingPonderHistorySessions","latestPonderHistoryRequest"]),...u.methods(["listLocalAgentSchedules","listDueLocalAgentSchedules","getLocalAgentSchedule","upsertLocalAgentSchedule","deleteLocalAgentSchedulesNotIn","patchLocalAgentSchedule","insertLocalAgentScheduleRun","getLocalAgentScheduleRun","listLocalAgentScheduleRuns","patchLocalAgentScheduleRun"]),...p.methods(["getPersistedSubagentRun","upsertPersistedSubagentRun","upsertSubagentRun","recordRetainedWorkspaceExpiryWarning","getSubagentRun","listSubagentRuns","listActiveSubagentRuns","listSubagentRunScopes","listStaleSubagentRuns","appendSubagentMessage","listSubagentMessages"]),...L.methods(["upsertModelUsageRecord","getModelUsageRecordByRequestId","listModelUsageRecords","latestContextUsageForTurn"]),...O.methods(["getSidebarAppPreferences","patchSidebarAppPreference","reorderSidebarApps"]),...a.methods(["assertLocalPonderInput","localPonderState","saveLocalPonderState","localPonderAgents","registerLocalPonderAgent","initializeRemoteDeviceStore","setRemoteDeviceAuthority","getRemoteDeviceReceipt","getRemoteDeviceCancellation","cancelRemoteDeviceCommand","saveRemoteDeviceReceipt","admitRemoteDeviceStop","admitRemoteDeviceApproval","admitPonderDesktopInspection","getPonderDesktopInspection","setPonderProjectSharing","readPonderProjectSharing","getPonderDesktopReservationResume","admitPonderDesktopObservation","getPonderDesktopObservation","getPonderDesktopResult","commitPonderDesktopResult","setPonderDesktopAuthority","clearPonderDesktopAuthority","admitPonderDesktopStop","getPonderDesktopStop","settlePonderDesktopStop","recoverTaskInboxOwners","hasTaskCompletion","taskInboxSnapshot","declareTaskWork","taskWorkAreas","admitTaskInput","admitTaskInputs","rejectTaskInput","getTaskInput","taskInputsForSession","mutateTaskInput","openTaskInboxTurn","renewTaskInboxTurn","pendingTaskInputs","taskAssignmentInputs","pauseTaskInboxTurn","includeTaskInputs","settleTaskInputRequest","sealTaskInboxTurn","sealNativeTaskInboxTurn","closeTaskInboxTurn","taskInboxPaused","reserveTaskFollowup","taskInboxWakeTargets","createTaskWait","settleTaskWait","taskWaitsForSession","commitSubagentCompletion","pendingTaskCompletions","settleTaskCompletion"]),...s.methods(["createHarnessWorkspace","createHarnessWorkspaceWithRelease","getHarnessWorkspace","listHarnessWorkspaces","selectHarnessWorkspace","getSelectedHarnessWorkspace","updateHarnessWorkspaceSourceRevisionAtomically","saveHarnessReleaseRecord","getHarnessReleaseRecord","listHarnessReleaseRecords","saveHarnessImprovementArtifact","listHarnessImprovementArtifacts","listPendingHarnessRefinerTriggers","createHarnessRunOverlay","getHarnessRunOverlay","appendHarnessRunOverlayEditsAtomically","freezeHarnessRunOverlayAtomically","abandonHarnessRunOverlayAtomically","restoreHarnessRunOverlayAtomically","freezeHarnessRunOverlayWithProposalAtomically","advanceHarnessWorkspaceAtomically","rollbackHarnessWorkspaceAtomically","advanceReviewedHarnessWorkspaceAtomically","listHarnessAdvanceReceipts"]),...i.methods(["listHarnessRefinementCandidates","getHarnessRefinementCandidateByFingerprint","saveHarnessRefinementCandidateTransition","saveHarnessCrossRunRefinementRequestIfAbsent"]),...n.methods(["getHarnessBackgroundReviewSettings","setHarnessBackgroundReviewSettings","getHarnessEvaluationReviewSettings","setHarnessEvaluationReviewSettings"]),...o.methods(["listHarnessMemories","getHarnessMemory","writeHarnessMemory"]),...d.methods(["listSidebarFileBookmarks","patchSidebarFileBookmark"]),...T.methods(["saveWorkEvidenceProjection","getWorkEvidenceProjectionBySourceRevision","getWorkEvidenceProjection","listWorkEvidenceProjections","saveWorkFeedback","getWorkFeedback","listWorkFeedbackForEvidence"]),...E.methods(["listChatWorkflows","listDueChatWorkflows","getChatWorkflow","upsertChatWorkflow","patchChatWorkflow","deleteChatWorkflow","insertChatWorkflowRun","listChatWorkflowRuns","patchChatWorkflowRun"]),..._.methods(["listConversationServingGrants","listConversationServingExecutions","saveConversationServingGrant","saveConversationServingExecution"])}}r($e,"runtimeStoreMethods");function ze(t,e){let a=c(e,()=>import("./store-chat-resources-P4EKCLSY.js").then(N=>new N.SqliteChatResourceStore(t))),s=c(e,()=>import("./store-training-S3FXWLT6.js").then(N=>new N.SqliteTrainingStore(t))),i=c(e,()=>import("./store-training-jobs-2LCXPA7G.js").then(N=>new N.SqliteTrainingJobsStore(t))),n=c(e,()=>import("./store-training-models-7AMKS7ZW.js").then(N=>new N.SqliteTrainingModelStore(t))),o=c(e,()=>import("./store-model-configuration-NJFWSYSA.js").then(N=>new N.SqliteModelConfigurationStore(t))),d=c(e,()=>import("./store-model-project-preparation-OCLIFKI2.js").then(N=>new N.SqliteModelProjectPreparationStore(t))),T=c(e,()=>import("./store-model-batch-review-J2L5JQV2.js").then(N=>new N.SqliteModelBatchReviewStore(t))),E=c(e,()=>import("./store-task-inventory-5HRZCDUT.js").then(N=>new N.SqliteTaskInventoryStore(t))),_=c(e,()=>import("./store-taskset-drafts-BNKUVHPA.js").then(N=>new N.SqliteTasksetDraftStore(t))),u=c(e,()=>import("./store-datasets-UFY422NG.js").then(N=>new N.SqliteDatasetStore(t))),p=c(e,()=>import("./store-continual-support-reviews-VVRQO2JK.js").then(N=>new N.SqliteContinualBenchReviewStore(t))),L=c(e,()=>import("./store-create-improve-2XI36AET.js").then(N=>new N.SqliteCreateImproveStore(t))),O=c(e,()=>import("./store-training-overview-KTWOOLJS.js").then(N=>new N.SqliteTrainingOverviewStore(t)));return{...d.methods(["prepareLocalModelProject","applyLocalModelProjectPreparation"]),...O.methods(["readTrainingActivityState","readTrainingNavigation"]),...a.methods(["listChatHostedExperiments","readChatHostedExperiment","retainChatHostedExperiment","localResourceOwnerId","readLocalDataset","readLocalDatasetByWorkspaceHash","readLocalDatasetListing","readLocalDatasetProjection","listLocalDatasets","listLocalDatasetListings","recoverLocalDatasetOperation","saveLocalDataset","updateLocalDatasetMetadata","linkChatResource","chatResourceLinks","readChatExperimentGroup","prepareChatExperimentGroup"]),...s.methods(["trainingChatSearchSignatures","openPondTrainingChatSearchEvidence","syncTrainingChatSearchDocuments","upsertTrainingChatSearchDocument","searchTrainingChats","listTrainingSources","getTrainingSource","getTrainingSourceForSession","upsertTrainingSource","deleteTrainingSource","listTaskCreationSnapshots","getTaskCreationSnapshot","upsertTaskCreationSnapshot","getTaskCreationTranscript","getTaskDesignProposal","listTasksets","listTasksetRevisions","getTaskset","getTasksetRevision","getTasksetByHash","upsertTaskset","deleteTasksetData","listTaskCandidates","getTaskCandidate","findTaskCandidateByFingerprint","upsertTaskCandidate","saveTaskAttempt","listTaskAttempts","saveTaskAttemptArtifact","listTaskAttemptArtifacts","saveGradeResult","deleteGradeResultsForAttempt","listGradeResultsForTaskset","saveGraderAuditReport","listGraderAuditReports","saveReadinessReport","getReadinessReport","saveTaskMinerConfig","getTaskMinerConfig","saveTaskMinerRun","getTaskMinerRun","listTaskMinerRuns"]),...i.methods(["saveModelProject","getModelProject","listModelProjects","saveTrainingPlan","listTrainingPlans","getTrainingPlan","saveTrainingBundle","getTrainingBundle","listTrainingBundles","findTrainingBundleByPlanAndHash","saveTrainingJob","saveTrainingApproval","getTrainingApproval","getTrainingJob","readTrainingExecutionActivity","listTrainingJobs","saveTrainingJobEvent","saveHostedTrainingJobEvent","listTrainingJobEvents","saveTrainingArtifact","listTrainingArtifacts","getTrainingArtifact","saveModelArtifactLineage","updateModelArtifactLineageServing","updateModelArtifactLineageReview","listModelArtifactLineage","getModelArtifactLineage"]),...n.methods(["saveModelCurrencySnapshot","getModelCurrencySnapshot","listModelCurrencySnapshots","saveModelComparisonSeries","getModelComparisonSeries","listModelComparisonSeries","saveModelComparisonSeriesEntry","getModelComparisonSeriesEntry","listModelComparisonSeriesEntries","commitModelComparisonSeriesMutation","compareAndSwapModelComparisonSeriesEntry","saveRewardModelVersion","getRewardModelVersion","listRewardModelVersions","saveRewardModelRun","getRewardModelRun","listRewardModelRuns","saveModelVersion","getModelVersion","listModelVersions","saveModelRun","getModelRun","listModelRuns","saveRolloutTrajectoryReceipt","getRolloutTrajectoryReceiptByProviderId","listRolloutTrajectoryReceipts","saveModelBinding","replaceActiveModelBinding","getModelBinding","getActiveModelBinding","listModelBindings"]),...o.methods(["pendingModelPackagePush","prepareModelPackagePush","completeModelPackagePush","rejectModelPackagePush","findModelProjectConfigurationSave","saveModelProjectConfiguration","previewModelProjectTasksetSave","findModelStarterCreation","saveModelStarterCreation","prepareModelStarterCreation","saveModelProjectHosting"]),...T.methods(["findModelBatchReview","beginModelBatchReview"]),...E.methods(["taskInventorySources","taskInventorySourceIndexed","appendTaskInventoryRows","finishTaskInventorySource","readTaskInventoryPage","readTaskInventoryTask"]),..._.methods(["initializeModelTasksetDraft","saveTasksetDraft","importTasksetDraftPackage","materializePublishedTasksetPackage","finalizeTasksetDraftPublication","getTasksetDraft","listTasksetDrafts","readHumanPublishedTasksetDraft","getTasksetDraftWorkspace","deleteTasksetDraft","tasksetDraftFiles","saveTasksetDraftFile"]),...u.methods(["listDatasetCatalogTasksets","listExternalDatasetSources","getExternalDatasetSource","upsertExternalDatasetSource","listDatasetImportJobs","listAllDatasetImportJobs","getDatasetImportJob","upsertDatasetImportJob","listDatasetArtifactRegistryEntries","getDatasetArtifactRegistryEntry","getDatasetArtifactForTaskset","upsertDatasetArtifactRegistryEntry"]),...p.methods(["saveContinualLearningDailyBatch","getContinualLearningDailyBatch","listContinualLearningDailyBatches","saveContinualBenchIssueReview","getContinualBenchIssueReview","listContinualBenchIssueReviews"]),...L.methods(["getCreateImproveRun","listCreateImproveRuns","upsertCreateImproveRun","mutateCreateImproveRun"])}}r(ze,"trainingStoreMethods");function Ze(t,e){let a=c(e,()=>import("./store-learning-BFOT4QVT.js").then(T=>new T.SqliteLearningStore(t))),s=c(e,()=>import("./store-learning-credentials-DYTMWQTC.js").then(T=>new T.SqliteLearningCredentialStore(t))),i=c(e,()=>import("./store-human-review-RFCVZ3HP.js").then(T=>new T.SqliteHumanReviewStore(t))),n=c(e,()=>import("./store-local-experiments-XPXGYXNM.js").then(T=>new T.SqliteLocalExperimentStore(t))),o=c(e,()=>import("./store-evaluation-results-VBH4R2U7.js").then(T=>new T.SqliteEvaluationResultStore(t))),d=c(e,()=>import("./store-preference-comparison-MZAYONCK.js").then(T=>new T.SqlitePreferenceComparisonStore(t)));return{...a.methods(["listLearningScopes"]),...s.methods(["createLearningSourceCredential","findLearningSourceCredential","listLearningSourceCredentials","revokeLearningSourceCredential"]),...i.methods(["humanLiveControl","humanLiveControlReceipt","rememberHumanLocalPublication","forgetHumanLocalPublication","humanLocalPublications"]),...n.methods(["prepareEvaluationOperation","retainEvaluationOperation","readPendingEvaluationOperation","pendingEvaluationOperations","acknowledgeEvaluationOperation","claimLocalExperimentOwner","renewLocalExperimentOwner","releaseLocalExperimentOwner","saveLocalExperiment","readLocalExperiment","recoverLocalExperimentOperation","listLocalExperiments","listLocalExecutionHistory","startLocalExperiment","admitLocalExperimentRun","findLocalExperimentRunOperation","readLocalExperimentRecord","readLocalExperimentSnapshot","readExecutionActivity","listLocalExperimentRecords","readLocalExecution","readLocalExecutionCharges","appendLocalExperimentEvent","localExperimentTrace","localExperimentDiagnosticTrace","startLocalScoringPass","readLocalScoringSelection","localJudgeBudgetTransaction","listLocalExecutions","listLocalScoringPasses","admitLocalCase","settleLocalCase","cancelLocalExecution","finishLocalExecution","recoverLocalExperiments","reserveLocalCharge","markLocalChargeDispatched","settleLocalCharge"]),...o.methods(["saveProfileEvaluationGrade","getProfileEvaluationGrade","saveProfileEvaluationReceipt","getProfileEvaluationReceipt","saveProfileEvaluationRun","getProfileEvaluationRun","listProfileEvaluationRuns","saveProfileEvaluationComparison","getProfileEvaluationComparison","listProfileEvaluationComparisons","saveProfileEvaluationSuiteRun","getProfileEvaluationSuiteRun","listProfileEvaluationSuiteRuns","saveBenchmarkRun","listBenchmarkRuns","saveBenchmarkComparison","listBenchmarkComparisons","saveEvaluationResult","getEvaluationResult","listEvaluationResults"]),...d.methods(["savePreferenceComparisonRelease","getPreferenceComparisonRelease","listPreferenceComparisonReleases","revokePreferenceComparisonRelease","savePreferenceComparisonAssignment","getPreferenceComparisonAssignment","listPreferenceComparisonAssignments","claimPreferenceComparisonAssignment","claimNextPreferenceComparisonAssignment","markPreferenceComparisonUnreviewable","savePreferenceComparisonSubmission","getPreferenceComparisonSubmission","listPreferenceComparisonSubmissions","savePreferenceComparisonCalibration","listPreferenceComparisonCalibrations"]),learningRepository(){return{transaction:r((T,E)=>a.call(_=>_.learningRepository().transaction(T,E)),"transaction")}},humanReviewRepository(){return{transaction:r((T,E)=>i.call(_=>_.humanReviewRepository().transaction(T,E)),"transaction")}},humanReviewLocalEvidence(...T){return i.call(E=>Promise.resolve(E.humanReviewLocalEvidence(...T)))}}}r(Ze,"evaluationStoreMethods");var et=class extends F{static{r(this,"SqliteStore")}domains=new M;closing;constructor(e,a={}){super(e,a);let s=this.domainContext();Object.assign(this,$e(s,this.domains),ze(s,this.domains),Ze(s,this.domains))}close(){return this.closing??=this.domains.close().then(()=>super.close())}};export{et as a};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{A as je,C as K,D as J,E as z,G as Me,N as _e,O,P as L,S as re,U as Fe,W as oe,X as I,Y as Ce,Z as U,_ as B,a as Z,b as ue,c as ee,h as ae,i as Se,j as xe,k as De,l as Pe,p as Ie,r as Ae,s as V,t as C,y as Ee,z as He}from"./chunk-YRDPVTEI.js";import{d as Re}from"./chunk-I6VMRQF4.js";import{V as be,X as ye}from"./chunk-QAFXQHHG.js";import{K as H,L as se,M as F,P as we,o as Te}from"./chunk-G4E3WGLM.js";import{ga as te,v as he}from"./chunk-ZY32SZ2P.js";import{i as Q,l as _,m as q,n as i}from"./chunk-RCT3O3HQ.js";import{A as m}from"./chunk-X2J2P5ZT.js";import{a as d}from"./chunk-FTQLQJQV.js";var Ye=new Set(["taskset.json","capabilities.json","data/tasks.jsonl","tasks/tasks.jsonl","graders/graders.json","fixtures/grader-fixtures.json","metrics/policy.json","assets/manifest.json","environment/contract.json","environment/taskset.ts","rubrics/preference-review.md","comparisons/policy.json"]);function ne(t){return Ye.has(C.parse(t))}d(ne,"isManagedTasksetDraftFilePath");function Be(t){let e=O(t.source),s=O(t.edited),o=t.preparation;if(o.authoringGraph!=="bound"||!e.modelResources||e.learningResources||s.modelResources||s.learningResources)throw new Error("Bound task editing requires its source Reward and an ordinary edited workspace.");if(e.contentHash!==o.sourcePackageHash||!se(H(e.taskset),o.sourceTasksetRef))throw new Error("Bound draft differs from its retained source package.");let n=d(g=>g.taskset.graders.map(x=>x.kind==="custom_verifier"?{...x,exportName:x.exportName??"verify"}:x),"normalizedGraders");if(i(n(e))!==i(n(s)))throw new Error("Edit the saved Reward in Rewards before changing this Taskset's graders.");let c=e.modelResources,T=new Map(c.assets.map(g=>[g.id,g])),a=J(s),k=J(e),p=d(g=>{let{id:x,revision:me,contentHash:fe,metadata:pe,...Xe}=g,{javascriptEnvironment:lt,...ve}=pe;return{...Xe,metadata:{...ve,resources:ve.resources??[]}}},"environmentContent"),u=d(g=>{if(!g)return null;let{id:x,revision:me,contentHash:fe,...pe}=g.execution.javascript;return pe},"javascriptContent"),R=i(p(e.environment))===i(p(s.environment))&&i(u(k))===i(u(a)),D=R?e.environment:s.environment,h=R?k:a,y=new Set([...c.assets.map(g=>g.id),...s.taskset.tasks.flatMap(g=>g.privilegedContextRef?[g.privilegedContextRef]:[]),...[s.environment.actionSchemaRef,s.environment.observationSchemaRef,s.environment.stateSchemaRef].flatMap(g=>g?[g.id]:[]),...a?.assets.map(g=>g.id)??[]]),j=new Set([...y,...s.taskset.tasks.flatMap(g=>[...g.artifactRefs.map(x=>x.id),...(g.requiredOutputs??[]).flatMap(x=>x.schemaRef?[x.schemaRef.id]:[])])]),A=Qe(e,s,j);for(let g of y){let x=A.find(fe=>fe.asset.id===g);if(!x)throw new Error(`Bound Taskset asset is missing: ${g}.`);let me=new TextDecoder("utf-8",{fatal:!0}).decode(K(x));T.set(g,we.parse(F({schemaVersion:"openpond.learningTextAsset.v1",id:g,revision:1,asset:x.asset,text:me})))}let S=_e(s),{contentHash:$,...w}=c.taskDefinition,{policy:W,environment:ce,environmentRelease:N,tools:r,capabilities:l,verifierSetRelease:v}=s.taskset,f=Te.parse(F({...w,instructions:S,execution:{policy:W,environment:ce,environmentRelease:N,tools:r,capabilities:l,verifierSetRelease:v}})),{contentHash:b,...P}=s.taskset,M=te.parse(F({...P,tasks:s.taskset.tasks.map(g=>c.instructionMode==="per_task"?g:{...g,policyVisibleContext:{...g.policyVisibleContext,instructions:S}})})),E=Pe({owner:o.lineage.owner,source:{...c,taskset:e.taskset,executionResources:{environment:e.environment,verifierSet:e.verifierSet}},rewardBinding:c.rewardBinding,rewards:c.rewards,assets:[...T.values()],edits:{taskset:M,taskDefinition:f,executionResources:{environment:D,verifierSet:s.verifierSet},...h?{execution:h.execution}:{}}}),G=xe.parse(E.taskset.metadata.modelTasksetDerivation);if(E.taskset.id!==o.tasksetId||E.taskset.revision!==o.tasksetRevision||i({...G,schemaVersion:o.lineage.schemaVersion})!==i(o.lineage))throw new Error("Bound draft differs from its retained ownership lineage.");let{taskset:de,executionResources:le,...Je}=E;return L({schemaVersion:"openpond.tasksetPackage.v1",taskset:de,...le,modelResources:Je,files:A})}d(Be,"publishBoundModelTasksetDraftPackage");function Qe(t,e,s){let o=e.files,n=new Map(t.files.map(a=>[a.asset.id,{file:a,assetHash:i(a.asset)}])),c=d(a=>{let k=n.get(a.asset.id);return k!==void 0&&k.file.base64===a.base64&&k.assetHash===i(a.asset)},"isSourceFile"),T=t.files.filter(a=>ne(a.asset.path)).map(a=>{let k=`source-artifact-${i({packageHash:t.contentHash,assetId:a.asset.id})}`;return{original:a,asset:{...a.asset,id:k,path:`source-artifacts/${t.contentHash}/${i(a.asset.path)}/${a.asset.path.split("/").at(-1)}`}}});for(let{original:a,asset:k}of T){let p=T.filter(h=>i({...h.original.asset,id:a.asset.id})===i(a.asset)),R=e.files.find(h=>h.asset.id===k.id)??p.flatMap(h=>e.files.filter(y=>i(y.asset)===i(h.asset)))[0];if(!R||R.base64!==a.base64||!p.some(h=>i(h.asset)===i(R.asset)))throw new Error(`Retained Taskset source artifact differs from its original bytes: ${a.asset.id}.`);let D=o.filter(h=>h.asset.path===a.asset.path||h.asset.id===a.asset.id);if(D.some(h=>h.asset.path!==a.asset.path||h.asset.id!==a.asset.id&&h.asset.id!==`taskset-file-${i(a.asset.path)}`&&!c(h)))throw new Error(`Retained Taskset source artifact conflicts with an authored file: ${a.asset.id}.`);o=[...o.filter(h=>h.asset.id!==k.id&&h.asset.id!==a.asset.id&&(!D.includes(h)||c(h))),a]}for(let a of t.files.filter(k=>!o.some(p=>p.asset.id===k.asset.id))){if(a.asset.path==="environment/execution.json"){let u=ae.safeParse(JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(K(a))));if(u.success&&i(z(u.data))===i(a))continue}let k=o.filter(u=>u.asset.path===a.asset.path),p=d(u=>i({...u.asset,id:a.asset.id})===i(a.asset)&&u.base64===a.base64,"sameEnvelope");if(s.has(a.asset.id)||!k.length||k.some(u=>!p(u)))throw new Error(`Retained Taskset source alias differs from its original bytes: ${a.asset.id}.`);o=[...o,a]}return o}d(Qe,"retainSourceFileIdentities");function Ct(t){let e=Ae.parse(t.request),s=Ie.parse(t.owner),o=O(t.source);if(o.learningResources)throw new Error("Reviewed Tasksets require their reviewed authoring workflow.");if(o.contentHash!==e.sourcePackageHash)throw new Error("Taskset draft source package changed.");if(o.modelResources){let k=De({owner:s,source:{...o.modelResources,taskset:o.taskset,executionResources:{environment:o.environment,verifierSet:o.verifierSet}},rewardBinding:o.modelResources.rewardBinding,rewards:o.modelResources.rewards,assets:o.modelResources.assets}),p=k.taskset.metadata.modelTasksetDerivation;return V.parse({schemaVersion:"openpond.modelTasksetDraftPreparation.v1",draftId:`model-taskset-draft-${i({owner:s,operationId:e.operationId})}`,requestHash:i(e),sourcePackageHash:o.contentHash,sourceTasksetRef:H(o.taskset),tasksetId:k.taskset.id,tasksetRevision:k.taskset.revision,lineage:{...p,schemaVersion:"openpond.modelTasksetAuthoring.v1"},authoringGraph:"bound"})}let n=He(o.taskset),c=n&&i(n.owner)===i(s),T=c?n.root:H(o.taskset),a={schemaVersion:"openpond.modelTasksetAuthoring.v1",owner:s,root:T,parent:H(o.taskset)};return V.parse({schemaVersion:"openpond.modelTasksetDraftPreparation.v1",draftId:`model-taskset-draft-${i({owner:s,operationId:e.operationId})}`,requestHash:i(e),sourcePackageHash:o.contentHash,sourceTasksetRef:H(o.taskset),tasksetId:Ee(a),tasksetRevision:c?o.taskset.revision+1:1,lineage:a})}d(Ct,"prepareModelTasksetDraft");function $e(t){let e=V.parse(t.preparation);if(!se(e.sourceTasksetRef,e.lineage.parent))throw new Error("Taskset draft preparation differs from its source lineage.");if(e.authoringGraph==="bound"){if(!t.source)throw new Error("Bound Taskset authoring requires its retained source package.");return Be({preparation:e,source:t.source,edited:t.edited})}let s=Ze(t.edited),{contentHash:o,...n}=s.verifierSet,c=ye({...n,id:`${e.tasksetId}-verifiers`,revision:e.tasksetRevision,calibrationReceiptRefs:[],metadata:{sourceVerifierSet:H(s.verifierSet)}}),{contentHash:T,...a}=s.taskset,k=te.parse(F({...a,id:e.tasksetId,revision:e.tasksetRevision,verifierSetRelease:{id:c.id,contentHash:c.contentHash},metadata:{modelTasksetAuthoring:e.lineage,...s.taskset.metadata.environmentResources===void 0?{}:{environmentResources:s.taskset.metadata.environmentResources},...s.taskset.metadata.ordinaryAuthoring===void 0?{}:{ordinaryAuthoring:s.taskset.metadata.ordinaryAuthoring}}})),p=J(s),u=p?[...s.files.filter(R=>R.asset.id!==Se(s.taskset)),z({...p.execution,verifierSet:c})]:s.files;return L({schemaVersion:"openpond.tasksetPackage.v1",taskset:k,environment:s.environment,verifierSet:c,files:u})}d($e,"publishModelTasksetDraftPackage");function Ze(t){let e=O(t);if(e.modelResources||e.learningResources)throw new Error("This Taskset requires its bound or reviewed authoring workflow.");return e}d(Ze,"requireOrdinaryPackage");function qe(t,e,s,o){if(t.environment.entrypoint!=="openpond.javascript-environment.v1")return{taskset:t,inventory:s,generatedFiles:[]};let n="environment/execution.json",c=e.get(n);if(!c||c.length>524288)throw new Error("Authored tool environment requires its bounded private execution declaration.");let T=ae.parse(JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(c))),a=d(S=>{if(!S)return null;let $=s.find(w=>w.asset.id===S.id&&w.asset.path===S.path);if(!$)throw new Error(`Authored environment dependency is missing: ${S.id}.`);return $.asset},"repin"),{contentHash:k,...p}=T.javascript,u=Re.parse(F({...p,id:`javascript-${t.id}`,revision:t.revision,module:a(T.javascript.module)}));if(i(u.tools)!==i(t.environment.metadata.portableTools)||i(u.tools.map(S=>S.name))!==i(t.environment.toolNames))throw new Error("Authored environment tools differ from the Taskset's declared tools.");let R=be({schemaVersion:"openpond.environmentRelease.v1",id:`environment-${t.id}`,revision:t.revision,contract:Fe(t),actionSchemaRef:a(T.environment.actionSchemaRef),observationSchemaRef:a(T.environment.observationSchemaRef),stateSchemaRef:a(T.environment.stateSchemaRef),artifactCollection:T.environment.artifactCollection,adapterConformanceHashes:{},metadata:{javascriptEnvironment:H(u),resources:t.environment.resources??[]}}),D=I.parse({...t,environment:{...t.environment,metadata:{...t.environment.metadata,portableExecutionResources:{environment:R}}}}),h=re({taskset:D,adapterId:o}),y=z({javascript:u,environment:R,verifierSet:h.verifierSetRelease}),j=[...s.filter(S=>S.sourcePath!==n),{asset:y.asset,sourcePath:n}],A=I.parse({...D,metadata:{...D.metadata,portableFileInventory:j}});return{taskset:I.parse({...A,contentHash:U(A)}),inventory:j,generatedFiles:[{path:n,role:"environment",content:new TextDecoder().decode(K(y))}]}}d(qe,"prepareAuthoredToolEnvironment");var ie=m.array(m.object({asset:Q,sourcePath:m.string().min(1)}).strict()).max(1e4),et=new Set(["taskset.json","capabilities.json","data/tasks.jsonl","graders/graders.json","fixtures/grader-fixtures.json","environment/taskset.ts"]);function We(t){return et.has(t)}d(We,"isGeneratedTasksetPublicationFilePath");function Ve(t,e,s,o=je){let n=I.parse(t);for(let r of n.tasks)for(let l of r.requiredOutputs??[])if(Z(l.metadata)&&l.submissionMode!=="structured_json")throw new Error("Sampling schema requires a structured output.");if(n.metadata.taskDefinition!==void 0||n.metadata.rewardBinding!==void 0){for(let r of n.tasks)for(let l of oe(r).requiredOutputs??[]){let v=Z(l.metadata);if(!v)continue;let f=oe(r).artifactRefs.find(G=>G.id===v.schemaRef.id);if(!f||i(f)!==i(v.schemaRef)||!l.schemaRef)throw new Error("Sampling schema must match an ordinary declared policy artifact.");let b=d((G,de)=>r.assets?.find(le=>le.id===G)?.artifactRef??de,"sourcePath"),P=e.get(b(l.schemaRef.id,l.schemaRef.path)),M=e.get(b(f.id,f.path));if(!P||!M)throw new Error("Sampling schema source bytes are missing.");let E=ee(P,l.schemaRef.contentHash);ue(E,v,M)}return{taskset:n,generatedFiles:[]}}let c=new Map,T=0;for(let[r,l]of e){if(C.parse(r),T+=l.byteLength,c.size>=1e4||T>o*3/4)throw new Error("Taskset source exceeds the package byte limit.");c.set(r,l.slice())}let a=n.metrics?.customAggregator,k=a?c.get(a.module):void 0;if(a&&!k)throw new Error("Declared Taskset metric module is missing.");let p=a&&k?{...n.metrics,customAggregator:{...a,contentHash:q(k)}}:n.metrics,u=new Map,R=new Set,D=[],h=d((r,l,v,f)=>{let b=c.get(l);if(!b)throw new Error(`Declared Taskset file is missing: ${l}.`);return{id:r,path:l,contentHash:q(b),sizeBytes:b.byteLength,mediaType:v,visibility:f}},"ref"),y=d((r,l=r.path)=>{let v=u.get(r.id);if(v&&i(v)!==i({asset:r,sourcePath:l}))throw new Error(`Conflicting Taskset file identity: ${r.id}.`);let f=c.get(l);if(!f||f.length!==r.sizeBytes||q(f)!==r.contentHash)throw new Error(`Taskset file differs from its declared bytes: ${r.id}.`);u.set(r.id,{asset:r,sourcePath:l}),R.add(l)},"add");for(let r of n.tasks){let l={};for(let f of r.requiredOutputs??[])if(f.submissionMode==="structured_json"){if(!f.schemaRef||f.mediaType!=="application/json")throw new Error("Structured outputs require a JSON schemaRef and application/json.");let b=r.metadata.portableTaskRecord?.requiredOutputs?.find(E=>E.path===f.path)?.schemaRef,P=b?.id===f.schemaRef?b.path:f.schemaRef,M=h(f.schemaRef,P,"application/schema+json","policy");if(b&&b.id===f.schemaRef&&b.visibility!=="policy")throw new Error("Structured output schema must be policy-visible.");ee(c.get(P),M.contentHash),l[f.schemaRef]=M}Object.keys(l).length&&(r.metadata={...r.metadata,outputSchemaRefs:l});let v=oe(r);for(let f of v.artifactRefs)y(f,r.assets?.find(b=>b.id===f.id)?.artifactRef??f.path);for(let f of v.requiredOutputs??[])f.schemaRef&&y(f.schemaRef);for(let f of v.requiredOutputs??[]){let b=Z(f.metadata);if(!b)continue;let P=u.get(b.schemaRef.id);if(!P||i(P.asset)!==i(b.schemaRef)||!v.artifactRefs.some(E=>E.id===b.schemaRef.id)||!f.schemaRef)throw new Error("Sampling schema must match an ordinary declared policy artifact.");let M=ee(c.get(u.get(f.schemaRef.id).sourcePath),f.schemaRef.contentHash);ue(M,b,c.get(P.sourcePath))}}for(let r of n.environment.resources??[])y(h(r.id,r.path,r.mediaType??"application/octet-stream",r.visibility==="policy_visible"?"policy":"host_private"));let j=n.graders.map(r=>{if(r.kind==="custom_verifier"){let l=h(`verifier-${r.id}`,r.module,"application/javascript","host_private"),v=Q.safeParse(r.metadata.portableVerifierRef);return v.success&&v.data.contentHash===l.contentHash&&v.data.sizeBytes===l.sizeBytes&&(l=v.data),y(l,r.module),{...r,metadata:{...r.metadata,portableVerifierRef:l}}}if(r.kind==="human"||r.kind==="model_judge"){let l=new TextEncoder().encode(r.rubric),v=`graders/rubric-${q(l)}.md`;c.set(v,l);let f=h(`rubric-${r.id}`,v,"text/markdown","verifier"),b=Q.safeParse(r.metadata.portableRubricRef);if(b.success&&b.data.contentHash===f.contentHash&&b.data.sizeBytes===f.sizeBytes){if(b.data.visibility==="policy")throw new Error("A grader rubric cannot become policy-visible.");f=b.data}return y(f,v),D.push({path:v,role:"verifier",content:r.rubric}),{...r,metadata:{...r.metadata,portableRubricRef:f}}}return r});a&&![...u.values()].some(r=>r.asset.path===a.module&&r.sourcePath===a.module&&r.asset.visibility!=="policy")&&y(h(`metric-${i(a.module)}`,a.module,"application/javascript","host_private"));let A=ie.parse(n.metadata.portableFileInventory??[]);for(let r of[...c.keys()].sort())if(!R.has(r)){let l=A.find(v=>v.sourcePath===r&&!u.has(v.asset.id));y(l?{...h(l.asset.id,r,l.asset.mediaType,l.asset.visibility),path:l.asset.path}:h(`taskset-file-${i(r)}`,r,"application/octet-stream","host_private"),r)}let{importedPackageHash:S,derivedPortableMetadata:$,...w}=n.metadata,W={...n.environment.metadata};if(W.portableExecutionResources!==void 0){let r=m.object({environment:m.unknown(),verifierSet:m.unknown().optional()}).parse(W.portableExecutionResources);W.portableExecutionResources={environment:r.environment}}let ce=I.parse({...n,graders:j,metrics:p,environment:{...n.environment,metadata:W},metadata:{...w,...S===void 0?{}:{sourceImportedPackageHash:S},portableFileInventory:ie.parse([...u.values()].sort((r,l)=>r.asset.id.localeCompare(l.asset.id)))}}),N=qe(ce,c,[...u.values()],s);return{taskset:I.parse({...N.taskset,contentHash:U(N.taskset)}),generatedFiles:[...D,...N.generatedFiles]}}d(Ve,"prepareAuthoredTasksetSource");var X=class extends Error{static{d(this,"TasksetDraftPublishError")}issues;constructor(e){super(e.map(s=>s.message).join(`
2
+ import{A as je,C as K,D as J,E as z,G as Me,N as _e,O,P as L,S as re,U as Fe,W as oe,X as I,Y as Ce,Z as U,_ as B,a as Z,b as ue,c as ee,h as ae,i as Se,j as xe,k as De,l as Pe,p as Ie,r as Ae,s as V,t as C,y as Ee,z as He}from"./chunk-TV2LE2BD.js";import{d as Re}from"./chunk-I6VMRQF4.js";import{V as be,X as ye}from"./chunk-QAFXQHHG.js";import{K as H,L as se,M as F,P as we,o as Te}from"./chunk-XHU4BZQY.js";import{ga as te,v as he}from"./chunk-ZY32SZ2P.js";import{i as Q,l as _,m as q,n as i}from"./chunk-RCT3O3HQ.js";import{A as m}from"./chunk-X2J2P5ZT.js";import{a as d}from"./chunk-FTQLQJQV.js";var Ye=new Set(["taskset.json","capabilities.json","data/tasks.jsonl","tasks/tasks.jsonl","graders/graders.json","fixtures/grader-fixtures.json","metrics/policy.json","assets/manifest.json","environment/contract.json","environment/taskset.ts","rubrics/preference-review.md","comparisons/policy.json"]);function ne(t){return Ye.has(C.parse(t))}d(ne,"isManagedTasksetDraftFilePath");function Be(t){let e=O(t.source),s=O(t.edited),o=t.preparation;if(o.authoringGraph!=="bound"||!e.modelResources||e.learningResources||s.modelResources||s.learningResources)throw new Error("Bound task editing requires its source Reward and an ordinary edited workspace.");if(e.contentHash!==o.sourcePackageHash||!se(H(e.taskset),o.sourceTasksetRef))throw new Error("Bound draft differs from its retained source package.");let n=d(g=>g.taskset.graders.map(x=>x.kind==="custom_verifier"?{...x,exportName:x.exportName??"verify"}:x),"normalizedGraders");if(i(n(e))!==i(n(s)))throw new Error("Edit the saved Reward in Rewards before changing this Taskset's graders.");let c=e.modelResources,T=new Map(c.assets.map(g=>[g.id,g])),a=J(s),k=J(e),p=d(g=>{let{id:x,revision:me,contentHash:fe,metadata:pe,...Xe}=g,{javascriptEnvironment:lt,...ve}=pe;return{...Xe,metadata:{...ve,resources:ve.resources??[]}}},"environmentContent"),u=d(g=>{if(!g)return null;let{id:x,revision:me,contentHash:fe,...pe}=g.execution.javascript;return pe},"javascriptContent"),R=i(p(e.environment))===i(p(s.environment))&&i(u(k))===i(u(a)),D=R?e.environment:s.environment,h=R?k:a,y=new Set([...c.assets.map(g=>g.id),...s.taskset.tasks.flatMap(g=>g.privilegedContextRef?[g.privilegedContextRef]:[]),...[s.environment.actionSchemaRef,s.environment.observationSchemaRef,s.environment.stateSchemaRef].flatMap(g=>g?[g.id]:[]),...a?.assets.map(g=>g.id)??[]]),j=new Set([...y,...s.taskset.tasks.flatMap(g=>[...g.artifactRefs.map(x=>x.id),...(g.requiredOutputs??[]).flatMap(x=>x.schemaRef?[x.schemaRef.id]:[])])]),A=Qe(e,s,j);for(let g of y){let x=A.find(fe=>fe.asset.id===g);if(!x)throw new Error(`Bound Taskset asset is missing: ${g}.`);let me=new TextDecoder("utf-8",{fatal:!0}).decode(K(x));T.set(g,we.parse(F({schemaVersion:"openpond.learningTextAsset.v1",id:g,revision:1,asset:x.asset,text:me})))}let S=_e(s),{contentHash:$,...w}=c.taskDefinition,{policy:W,environment:ce,environmentRelease:N,tools:r,capabilities:l,verifierSetRelease:v}=s.taskset,f=Te.parse(F({...w,instructions:S,execution:{policy:W,environment:ce,environmentRelease:N,tools:r,capabilities:l,verifierSetRelease:v}})),{contentHash:b,...P}=s.taskset,M=te.parse(F({...P,tasks:s.taskset.tasks.map(g=>c.instructionMode==="per_task"?g:{...g,policyVisibleContext:{...g.policyVisibleContext,instructions:S}})})),E=Pe({owner:o.lineage.owner,source:{...c,taskset:e.taskset,executionResources:{environment:e.environment,verifierSet:e.verifierSet}},rewardBinding:c.rewardBinding,rewards:c.rewards,assets:[...T.values()],edits:{taskset:M,taskDefinition:f,executionResources:{environment:D,verifierSet:s.verifierSet},...h?{execution:h.execution}:{}}}),G=xe.parse(E.taskset.metadata.modelTasksetDerivation);if(E.taskset.id!==o.tasksetId||E.taskset.revision!==o.tasksetRevision||i({...G,schemaVersion:o.lineage.schemaVersion})!==i(o.lineage))throw new Error("Bound draft differs from its retained ownership lineage.");let{taskset:de,executionResources:le,...Je}=E;return L({schemaVersion:"openpond.tasksetPackage.v1",taskset:de,...le,modelResources:Je,files:A})}d(Be,"publishBoundModelTasksetDraftPackage");function Qe(t,e,s){let o=e.files,n=new Map(t.files.map(a=>[a.asset.id,{file:a,assetHash:i(a.asset)}])),c=d(a=>{let k=n.get(a.asset.id);return k!==void 0&&k.file.base64===a.base64&&k.assetHash===i(a.asset)},"isSourceFile"),T=t.files.filter(a=>ne(a.asset.path)).map(a=>{let k=`source-artifact-${i({packageHash:t.contentHash,assetId:a.asset.id})}`;return{original:a,asset:{...a.asset,id:k,path:`source-artifacts/${t.contentHash}/${i(a.asset.path)}/${a.asset.path.split("/").at(-1)}`}}});for(let{original:a,asset:k}of T){let p=T.filter(h=>i({...h.original.asset,id:a.asset.id})===i(a.asset)),R=e.files.find(h=>h.asset.id===k.id)??p.flatMap(h=>e.files.filter(y=>i(y.asset)===i(h.asset)))[0];if(!R||R.base64!==a.base64||!p.some(h=>i(h.asset)===i(R.asset)))throw new Error(`Retained Taskset source artifact differs from its original bytes: ${a.asset.id}.`);let D=o.filter(h=>h.asset.path===a.asset.path||h.asset.id===a.asset.id);if(D.some(h=>h.asset.path!==a.asset.path||h.asset.id!==a.asset.id&&h.asset.id!==`taskset-file-${i(a.asset.path)}`&&!c(h)))throw new Error(`Retained Taskset source artifact conflicts with an authored file: ${a.asset.id}.`);o=[...o.filter(h=>h.asset.id!==k.id&&h.asset.id!==a.asset.id&&(!D.includes(h)||c(h))),a]}for(let a of t.files.filter(k=>!o.some(p=>p.asset.id===k.asset.id))){if(a.asset.path==="environment/execution.json"){let u=ae.safeParse(JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(K(a))));if(u.success&&i(z(u.data))===i(a))continue}let k=o.filter(u=>u.asset.path===a.asset.path),p=d(u=>i({...u.asset,id:a.asset.id})===i(a.asset)&&u.base64===a.base64,"sameEnvelope");if(s.has(a.asset.id)||!k.length||k.some(u=>!p(u)))throw new Error(`Retained Taskset source alias differs from its original bytes: ${a.asset.id}.`);o=[...o,a]}return o}d(Qe,"retainSourceFileIdentities");function Ct(t){let e=Ae.parse(t.request),s=Ie.parse(t.owner),o=O(t.source);if(o.learningResources)throw new Error("Reviewed Tasksets require their reviewed authoring workflow.");if(o.contentHash!==e.sourcePackageHash)throw new Error("Taskset draft source package changed.");if(o.modelResources){let k=De({owner:s,source:{...o.modelResources,taskset:o.taskset,executionResources:{environment:o.environment,verifierSet:o.verifierSet}},rewardBinding:o.modelResources.rewardBinding,rewards:o.modelResources.rewards,assets:o.modelResources.assets}),p=k.taskset.metadata.modelTasksetDerivation;return V.parse({schemaVersion:"openpond.modelTasksetDraftPreparation.v1",draftId:`model-taskset-draft-${i({owner:s,operationId:e.operationId})}`,requestHash:i(e),sourcePackageHash:o.contentHash,sourceTasksetRef:H(o.taskset),tasksetId:k.taskset.id,tasksetRevision:k.taskset.revision,lineage:{...p,schemaVersion:"openpond.modelTasksetAuthoring.v1"},authoringGraph:"bound"})}let n=He(o.taskset),c=n&&i(n.owner)===i(s),T=c?n.root:H(o.taskset),a={schemaVersion:"openpond.modelTasksetAuthoring.v1",owner:s,root:T,parent:H(o.taskset)};return V.parse({schemaVersion:"openpond.modelTasksetDraftPreparation.v1",draftId:`model-taskset-draft-${i({owner:s,operationId:e.operationId})}`,requestHash:i(e),sourcePackageHash:o.contentHash,sourceTasksetRef:H(o.taskset),tasksetId:Ee(a),tasksetRevision:c?o.taskset.revision+1:1,lineage:a})}d(Ct,"prepareModelTasksetDraft");function $e(t){let e=V.parse(t.preparation);if(!se(e.sourceTasksetRef,e.lineage.parent))throw new Error("Taskset draft preparation differs from its source lineage.");if(e.authoringGraph==="bound"){if(!t.source)throw new Error("Bound Taskset authoring requires its retained source package.");return Be({preparation:e,source:t.source,edited:t.edited})}let s=Ze(t.edited),{contentHash:o,...n}=s.verifierSet,c=ye({...n,id:`${e.tasksetId}-verifiers`,revision:e.tasksetRevision,calibrationReceiptRefs:[],metadata:{sourceVerifierSet:H(s.verifierSet)}}),{contentHash:T,...a}=s.taskset,k=te.parse(F({...a,id:e.tasksetId,revision:e.tasksetRevision,verifierSetRelease:{id:c.id,contentHash:c.contentHash},metadata:{modelTasksetAuthoring:e.lineage,...s.taskset.metadata.environmentResources===void 0?{}:{environmentResources:s.taskset.metadata.environmentResources},...s.taskset.metadata.ordinaryAuthoring===void 0?{}:{ordinaryAuthoring:s.taskset.metadata.ordinaryAuthoring}}})),p=J(s),u=p?[...s.files.filter(R=>R.asset.id!==Se(s.taskset)),z({...p.execution,verifierSet:c})]:s.files;return L({schemaVersion:"openpond.tasksetPackage.v1",taskset:k,environment:s.environment,verifierSet:c,files:u})}d($e,"publishModelTasksetDraftPackage");function Ze(t){let e=O(t);if(e.modelResources||e.learningResources)throw new Error("This Taskset requires its bound or reviewed authoring workflow.");return e}d(Ze,"requireOrdinaryPackage");function qe(t,e,s,o){if(t.environment.entrypoint!=="openpond.javascript-environment.v1")return{taskset:t,inventory:s,generatedFiles:[]};let n="environment/execution.json",c=e.get(n);if(!c||c.length>524288)throw new Error("Authored tool environment requires its bounded private execution declaration.");let T=ae.parse(JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(c))),a=d(S=>{if(!S)return null;let $=s.find(w=>w.asset.id===S.id&&w.asset.path===S.path);if(!$)throw new Error(`Authored environment dependency is missing: ${S.id}.`);return $.asset},"repin"),{contentHash:k,...p}=T.javascript,u=Re.parse(F({...p,id:`javascript-${t.id}`,revision:t.revision,module:a(T.javascript.module)}));if(i(u.tools)!==i(t.environment.metadata.portableTools)||i(u.tools.map(S=>S.name))!==i(t.environment.toolNames))throw new Error("Authored environment tools differ from the Taskset's declared tools.");let R=be({schemaVersion:"openpond.environmentRelease.v1",id:`environment-${t.id}`,revision:t.revision,contract:Fe(t),actionSchemaRef:a(T.environment.actionSchemaRef),observationSchemaRef:a(T.environment.observationSchemaRef),stateSchemaRef:a(T.environment.stateSchemaRef),artifactCollection:T.environment.artifactCollection,adapterConformanceHashes:{},metadata:{javascriptEnvironment:H(u),resources:t.environment.resources??[]}}),D=I.parse({...t,environment:{...t.environment,metadata:{...t.environment.metadata,portableExecutionResources:{environment:R}}}}),h=re({taskset:D,adapterId:o}),y=z({javascript:u,environment:R,verifierSet:h.verifierSetRelease}),j=[...s.filter(S=>S.sourcePath!==n),{asset:y.asset,sourcePath:n}],A=I.parse({...D,metadata:{...D.metadata,portableFileInventory:j}});return{taskset:I.parse({...A,contentHash:U(A)}),inventory:j,generatedFiles:[{path:n,role:"environment",content:new TextDecoder().decode(K(y))}]}}d(qe,"prepareAuthoredToolEnvironment");var ie=m.array(m.object({asset:Q,sourcePath:m.string().min(1)}).strict()).max(1e4),et=new Set(["taskset.json","capabilities.json","data/tasks.jsonl","graders/graders.json","fixtures/grader-fixtures.json","environment/taskset.ts"]);function We(t){return et.has(t)}d(We,"isGeneratedTasksetPublicationFilePath");function Ve(t,e,s,o=je){let n=I.parse(t);for(let r of n.tasks)for(let l of r.requiredOutputs??[])if(Z(l.metadata)&&l.submissionMode!=="structured_json")throw new Error("Sampling schema requires a structured output.");if(n.metadata.taskDefinition!==void 0||n.metadata.rewardBinding!==void 0){for(let r of n.tasks)for(let l of oe(r).requiredOutputs??[]){let v=Z(l.metadata);if(!v)continue;let f=oe(r).artifactRefs.find(G=>G.id===v.schemaRef.id);if(!f||i(f)!==i(v.schemaRef)||!l.schemaRef)throw new Error("Sampling schema must match an ordinary declared policy artifact.");let b=d((G,de)=>r.assets?.find(le=>le.id===G)?.artifactRef??de,"sourcePath"),P=e.get(b(l.schemaRef.id,l.schemaRef.path)),M=e.get(b(f.id,f.path));if(!P||!M)throw new Error("Sampling schema source bytes are missing.");let E=ee(P,l.schemaRef.contentHash);ue(E,v,M)}return{taskset:n,generatedFiles:[]}}let c=new Map,T=0;for(let[r,l]of e){if(C.parse(r),T+=l.byteLength,c.size>=1e4||T>o*3/4)throw new Error("Taskset source exceeds the package byte limit.");c.set(r,l.slice())}let a=n.metrics?.customAggregator,k=a?c.get(a.module):void 0;if(a&&!k)throw new Error("Declared Taskset metric module is missing.");let p=a&&k?{...n.metrics,customAggregator:{...a,contentHash:q(k)}}:n.metrics,u=new Map,R=new Set,D=[],h=d((r,l,v,f)=>{let b=c.get(l);if(!b)throw new Error(`Declared Taskset file is missing: ${l}.`);return{id:r,path:l,contentHash:q(b),sizeBytes:b.byteLength,mediaType:v,visibility:f}},"ref"),y=d((r,l=r.path)=>{let v=u.get(r.id);if(v&&i(v)!==i({asset:r,sourcePath:l}))throw new Error(`Conflicting Taskset file identity: ${r.id}.`);let f=c.get(l);if(!f||f.length!==r.sizeBytes||q(f)!==r.contentHash)throw new Error(`Taskset file differs from its declared bytes: ${r.id}.`);u.set(r.id,{asset:r,sourcePath:l}),R.add(l)},"add");for(let r of n.tasks){let l={};for(let f of r.requiredOutputs??[])if(f.submissionMode==="structured_json"){if(!f.schemaRef||f.mediaType!=="application/json")throw new Error("Structured outputs require a JSON schemaRef and application/json.");let b=r.metadata.portableTaskRecord?.requiredOutputs?.find(E=>E.path===f.path)?.schemaRef,P=b?.id===f.schemaRef?b.path:f.schemaRef,M=h(f.schemaRef,P,"application/schema+json","policy");if(b&&b.id===f.schemaRef&&b.visibility!=="policy")throw new Error("Structured output schema must be policy-visible.");ee(c.get(P),M.contentHash),l[f.schemaRef]=M}Object.keys(l).length&&(r.metadata={...r.metadata,outputSchemaRefs:l});let v=oe(r);for(let f of v.artifactRefs)y(f,r.assets?.find(b=>b.id===f.id)?.artifactRef??f.path);for(let f of v.requiredOutputs??[])f.schemaRef&&y(f.schemaRef);for(let f of v.requiredOutputs??[]){let b=Z(f.metadata);if(!b)continue;let P=u.get(b.schemaRef.id);if(!P||i(P.asset)!==i(b.schemaRef)||!v.artifactRefs.some(E=>E.id===b.schemaRef.id)||!f.schemaRef)throw new Error("Sampling schema must match an ordinary declared policy artifact.");let M=ee(c.get(u.get(f.schemaRef.id).sourcePath),f.schemaRef.contentHash);ue(M,b,c.get(P.sourcePath))}}for(let r of n.environment.resources??[])y(h(r.id,r.path,r.mediaType??"application/octet-stream",r.visibility==="policy_visible"?"policy":"host_private"));let j=n.graders.map(r=>{if(r.kind==="custom_verifier"){let l=h(`verifier-${r.id}`,r.module,"application/javascript","host_private"),v=Q.safeParse(r.metadata.portableVerifierRef);return v.success&&v.data.contentHash===l.contentHash&&v.data.sizeBytes===l.sizeBytes&&(l=v.data),y(l,r.module),{...r,metadata:{...r.metadata,portableVerifierRef:l}}}if(r.kind==="human"||r.kind==="model_judge"){let l=new TextEncoder().encode(r.rubric),v=`graders/rubric-${q(l)}.md`;c.set(v,l);let f=h(`rubric-${r.id}`,v,"text/markdown","verifier"),b=Q.safeParse(r.metadata.portableRubricRef);if(b.success&&b.data.contentHash===f.contentHash&&b.data.sizeBytes===f.sizeBytes){if(b.data.visibility==="policy")throw new Error("A grader rubric cannot become policy-visible.");f=b.data}return y(f,v),D.push({path:v,role:"verifier",content:r.rubric}),{...r,metadata:{...r.metadata,portableRubricRef:f}}}return r});a&&![...u.values()].some(r=>r.asset.path===a.module&&r.sourcePath===a.module&&r.asset.visibility!=="policy")&&y(h(`metric-${i(a.module)}`,a.module,"application/javascript","host_private"));let A=ie.parse(n.metadata.portableFileInventory??[]);for(let r of[...c.keys()].sort())if(!R.has(r)){let l=A.find(v=>v.sourcePath===r&&!u.has(v.asset.id));y(l?{...h(l.asset.id,r,l.asset.mediaType,l.asset.visibility),path:l.asset.path}:h(`taskset-file-${i(r)}`,r,"application/octet-stream","host_private"),r)}let{importedPackageHash:S,derivedPortableMetadata:$,...w}=n.metadata,W={...n.environment.metadata};if(W.portableExecutionResources!==void 0){let r=m.object({environment:m.unknown(),verifierSet:m.unknown().optional()}).parse(W.portableExecutionResources);W.portableExecutionResources={environment:r.environment}}let ce=I.parse({...n,graders:j,metrics:p,environment:{...n.environment,metadata:W},metadata:{...w,...S===void 0?{}:{sourceImportedPackageHash:S},portableFileInventory:ie.parse([...u.values()].sort((r,l)=>r.asset.id.localeCompare(l.asset.id)))}}),N=qe(ce,c,[...u.values()],s);return{taskset:I.parse({...N.taskset,contentHash:U(N.taskset)}),generatedFiles:[...D,...N.generatedFiles]}}d(Ve,"prepareAuthoredTasksetSource");var X=class extends Error{static{d(this,"TasksetDraftPublishError")}issues;constructor(e){super(e.map(s=>s.message).join(`
3
3
  `)),this.name="TasksetDraftPublishError",this.issues=e}};function ds(t){let e=t.now??new Date().toISOString(),s=t.id?.trim()||`taskset-draft-${globalThis.crypto.randomUUID()}`;return B.parse({schemaVersion:"openpond.tasksetDraft.v1",id:s,revision:1,profileId:t.profileId,modelScope:t.modelScope??null,name:t.name?.trim()??"",objective:"",purpose:"general",benchmark:null,preferenceComparison:null,status:"draft",sourceRefs:[],datasetArtifact:null,policy:{policyVisibleFields:["input"],privilegedFields:["expectedOutput"],hiddenGraderRefs:[],connectedAppScopes:[]},environment:{protocolVersion:"openpond.taskEnvironment.v1",kind:"chat",entrypoint:"openpond-chat-v1",stateful:!1,deterministicSeeds:!0,toolNames:[],lifecycle:["create","reset","step","grade","cleanup"],defaultTimeoutMs:12e4,networkPolicy:"none",resources:[],metadata:{}},output:{mode:"text",jsonSchema:null,renderer:null},capabilities:{schemaVersion:"openpond.tasksetCapabilities.v1",taskKind:"chat",supportedSignals:["demonstration","preference","correction","feedback","reward","label"],compatibleMethods:["none"],rewardKinds:["none"],requiresTools:!1,requiresState:!1,requiresPrivilegedGrading:!0,environmentPlacements:["local","remote","colocated"],exportable:!0,portabilityBlockers:[]},metrics:{schemaVersion:"openpond.tasksetMetricPolicy.v1",primaryMetric:"score",aggregation:"mean_score",missingReward:"zero",customAggregator:null},review:{enabled:!1,candidateCount:2,minimumSamples:100,allowTies:!0,allowRejectAll:!0,rubric:"",criteria:[]},tasks:[],graders:[],graderFixtures:[],learningSignals:{demonstrations:[],preferences:[],corrections:[],feedback:[],rewards:[],labels:[]},publishedTasksetRef:null,createdAt:e,updatedAt:e,metadata:{}})}d(ds,"createTasksetDraft");function ze(t){let e=[];t.name.trim()||e.push({code:"name_missing",message:"Name is required.",path:"name"}),t.objective.trim()||e.push({code:"objective_missing",message:"Objective is required.",path:"objective"}),!t.datasetArtifact&&t.tasks.length===0&&e.push({code:"tasks_missing",message:"Add at least one task or Dataset artifact.",path:"tasks"});let s=new Set(t.sourceRefs.map(o=>o.id));for(let o of t.tasks)for(let n of o.sourceRefs)s.has(n)||e.push({code:"task_source_missing",message:`Task ${o.id} references missing source ${n}.`,path:`tasks.${o.id}.sourceRefs`});return e}d(ze,"draftPublishIssues");function Oe(t){let e=B.parse(t.draft),s=t.now??new Date().toISOString(),o=ze(e);if(o.length)throw new X(o);let n=e.modelScope?.source;if(n&&t.tasksetId&&t.tasksetId!==n.tasksetId)throw new Error("Taskset draft publication differs from its prepared identity.");let c=n?.tasksetId||t.tasksetId?.trim()||e.publishedTasksetRef?.id||e.id.replace(/-draft$/,""),T=n?.tasksetRevision??(e.publishedTasksetRef?.id===c?e.publishedTasksetRef.revision+1:1),a=e.sourceRefs.length?e.sourceRefs:[tt(e,c,s)],k=a[0].id,p=e.tasks.map(w=>Me.parse({...w,sourceRefs:w.sourceRefs.length?w.sourceRefs:[k],metadata:{exampleOrigin:"expert_authored",...w.metadata}})),u=e.capabilities.compatibleMethods.find(w=>w!=="none"&&w!=="retrieval")??null,R=st(e),D=e.graders.filter(w=>w.rewardEligible&&w.weight>0&&w.kind!=="human"),h=u===null&&R==="verifiable_reward"&&D.length>0,y=u??(h?"grpo":null),j=I.parse({schemaVersion:"openpond.taskset.v1",id:c,revision:T,profileId:e.profileId,profileRelease:null,createImproveRunId:null,name:e.name,objective:e.objective,purpose:e.purpose,benchmark:e.benchmark,preferenceComparison:e.preferenceComparison,status:"needs_review",sourceRefs:a,datasetArtifact:e.datasetArtifact??null,policy:e.policy,environment:e.environment,capabilities:h?{...e.capabilities,compatibleMethods:["grpo"],rewardKinds:[...new Set(D.map(w=>w.kind==="model_judge"?"model_judge":"deterministic"))]}:e.capabilities,metrics:e.metrics,tasks:p,graders:e.graders,graderFixtures:e.graderFixtures,learningSignals:e.learningSignals,authoringProvenance:{schemaVersion:"openpond.taskAuthoringProvenance.v1",model:null,modelConfig:{},skillHash:i("openpond-taskset-draft-authoring-v1"),promptTemplateVersion:"taskset-draft-v1",buildIntent:R,buildSpecification:null,evidenceHashes:a.map(w=>w.sourceHash),tasksetSdkVersion:"draft-v1",sourceCommit:null,repairHistory:[],createdAt:s},readiness:null,contentHash:"00000000",createdAt:T===1?e.createdAt:s,updatedAt:s,metadata:{...e.metadata,...n?{modelTasksetAuthoring:n.lineage}:{},tasksetReviewPolicy:e.review,tasksetOutputContract:e.output,...t.sourcePackageHash?{sourcePackageHash:t.sourcePackageHash}:{},...y?{trainingMethod:y}:{},diagnosis:{schemaVersion:"openpond.capabilityDiagnosis.v1",summary:e.objective,stableBehavior:[e.objective],changingKnowledge:[],requiredContext:[],requiredTools:e.environment.toolNames,intervention:y==="dpo"?"preference":y==="grpo"||y==="ppo"?"grpo_rft":y==="sft"?"sft":"no_training",trainingEligible:y!==null,rationale:y?[`The author selected ${y.toUpperCase()} compatibility.`]:["The Taskset is currently configured for evaluation only."],confidence:1}}}),A=I.parse({...j,contentHash:U(j)}),$=Ce(A,{purpose:"publication"}).issues.filter(w=>w.severity==="error");if($.length)throw new X($.map(w=>({code:w.code,message:w.message,path:w.path})));return A}d(Oe,"publishTasksetDraft");function tt(t,e,s){let o=i({draftId:t.id,draftRevision:t.revision,tasks:t.tasks});return{schemaVersion:"openpond.generatedDatasetSource.v1",kind:"generated",id:`source-${e}`,profileId:t.profileId,title:`${t.name} manual authoring`,sourceHash:o,occurredAt:s,licensingStatus:"approved",secretScanStatus:"passed",piiScanStatus:"passed",generatorId:"openpond-taskset-draft",generatorVersion:"1",seed:0,generatorHash:o,metadata:{draftId:t.id,draftRevision:t.revision}}}d(tt,"generatedDraftSource");function st(t){return t.metadata.buildIntent==="discovery"||!t.graders.length&&!t.learningSignals.preferences.length&&!t.learningSignals.rewards.length&&!t.learningSignals.labels.length?"discovery":t.learningSignals.preferences.length?"preferences":t.learningSignals.rewards.length?"verifiable_reward":t.learningSignals.labels.length?"rubric":!t.capabilities.compatibleMethods.some(e=>e!=="none"&&e!=="retrieval")&&t.graders.some(e=>e.rewardEligible&&e.weight>0&&e.kind!=="human")?"verifiable_reward":"demonstrations"}d(st,"buildIntentForDraft");function Rs(t){let e=[];t.output.renderer&&e.push({relativePath:t.output.renderer.module,source:`export async function ${t.output.renderer.exportName}(output: unknown) {
4
4
  // Return artifact paths or bytes derived from the model's structured output.
5
5
  return output;
@@ -1,3 +1,3 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as E,b as _}from"./chunk-GFAI2MCJ.js";import{a as p}from"./chunk-FTQLQJQV.js";var g=`CREATE TABLE IF NOT EXISTS local_ponder_state (id INTEGER PRIMARY KEY CHECK(id=1),payload TEXT NOT NULL);
2
+ import{a as E,b as _}from"./chunk-RS526BG7.js";import{a as p}from"./chunk-FTQLQJQV.js";var g=`CREATE TABLE IF NOT EXISTS local_ponder_state (id INTEGER PRIMARY KEY CHECK(id=1),payload TEXT NOT NULL);
3
3
  CREATE TABLE IF NOT EXISTS local_ponder_agents (session_id TEXT PRIMARY KEY,coordinator_id TEXT NOT NULL,creation_key TEXT NOT NULL UNIQUE,payload TEXT NOT NULL);`;function u(o,n){if(!o.get("SELECT name FROM sqlite_master WHERE type='table' AND name='local_ponder_agents'"))return null;let e=o.get("SELECT payload FROM local_ponder_agents WHERE session_id=?",[n]);return e?_.parse(JSON.parse(e.payload)):null}p(u,"readLocalPonderRelationship");function y(o,n){let e=u(o,n.sessionId);if(!e||e.coordinatorSessionId!==n.senderSessionId)return;let s=n.payload.localPonderControlRevision;if(e.owner!=="ponder"||s!==e.revision)throw new Error("local_ponder_control_changed")}p(y,"assertLocalPonderAdmission");function O(o,n,e,s){let t=u(o,n);if(!t)throw new Error("local_ponder_agent_not_found");if(t.revision!==s)throw new Error("local_ponder_control_changed");let i=o.get("SELECT payload FROM sessions WHERE id=?",[n]);if(!i)throw new Error("local_ponder_agent_not_found");let d=JSON.parse(i.payload),r={...t,owner:e,revision:t.revision+(t.owner===e?0:1),updatedAt:new Date().toISOString()},a={...d,hiddenFromDefaultSidebar:e!=="user",updatedAt:r.updatedAt};if(o.run("UPDATE local_ponder_agents SET payload=? WHERE session_id=?",[JSON.stringify(r),n]),o.run("UPDATE sessions SET payload=?,updated_at=? WHERE id=?",[JSON.stringify(a),a.updatedAt,n]),t.owner!==e){let S=o.all("SELECT id,payload FROM task_inputs WHERE session_id=? AND state='pending'",[n]);for(let l of S){let c=JSON.parse(l.payload);c.senderSessionId===t.coordinatorSessionId&&o.run("UPDATE task_inputs SET state='rejected',payload=? WHERE id=?",[JSON.stringify({...c,state:"rejected",error:"local_ponder_control_changed",updatedAt:r.updatedAt}),l.id])}}return{relationship:r,session:a}}p(O,"changeLocalPonderControl");function R(o,n,e){let s=o.get("SELECT payload FROM local_ponder_state WHERE id=1");if(!s)throw new Error("local_ponder_unavailable");let t=E.parse(JSON.parse(s.payload));if(t.revision!==e||!t.sessionId)throw new Error("local_ponder_configuration_changed");let i=o.get("SELECT payload FROM sessions WHERE id=?",[t.sessionId]);if(!i)throw new Error("local_ponder_unavailable");let d=JSON.parse(i.payload);if(d.status==="active"||o.get("SELECT id FROM turns WHERE session_id=? AND status='in_progress' LIMIT 1",[d.id]))throw new Error("local_ponder_model_change_requires_idle");let r={...d,provider:n.providerId,modelRef:n,updatedAt:new Date().toISOString()},a={...t,modelRef:n,revision:t.revision+1};return o.run("UPDATE sessions SET payload=?,updated_at=? WHERE id=?",[JSON.stringify(r),r.updatedAt,r.id]),o.run("UPDATE local_ponder_state SET payload=? WHERE id=1",[JSON.stringify(a)]),{coordinator:a,session:r}}p(R,"changeLocalPonderModel");export{g as a,y as b,O as c,R 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 P}from"./chunk-MCBRB5D6.js";import{f as O}from"./chunk-MVPKU72J.js";import{b as A}from"./chunk-OQPJ7FJF.js";import{a as m}from"./chunk-2LJCJOJ7.js";import{b as d,e as f}from"./chunk-JCLTFDVW.js";import{a as n}from"./chunk-FTQLQJQV.js";async function N(t,e,r,s={}){let o=await(s.apiFetch??d)(t,e,s.path??A,{method:"POST",signal:s.signal,body:JSON.stringify(r)}),i=await o.json().catch(()=>({})),c=o.status!==404&&o.status!==405&&o.status!==501;return o.ok?{ok:typeof i.ok=="boolean"?i.ok:!0,status:o.status,endpointAvailable:c,output:g(i),data:E(i)}:{ok:!1,status:o.status,endpointAvailable:c,output:g(i)??(c?`Connected app tool call failed with status ${o.status}.`:`Connected app tool-call endpoint is not available (${o.status}).`),data:E(i)}}n(N,"executeConnectedAppToolCall");function g(t){return typeof t.output=="string"&&t.output.trim()?t.output.trim():typeof t.message=="string"&&t.message.trim()?t.message.trim():typeof t.error=="string"&&t.error.trim()?t.error.trim():null}n(g,"responsePayloadMessage");function E(t){return"data"in t?t.data:"result"in t?t.result:null}n(E,"responsePayloadData");var h=A;function z(t={}){let e=t.env??process.env,r=t.apiFetch??d,s=t.loadAccountContext??P;return async(o,i)=>{if(I(e.OPENPOND_CONNECTED_APP_TOOL_EXECUTOR))return l(o.provider,"Cloud connected app execution is disabled.");let c=D(o),C=O.safeParse(c);if(!C.success)return l(o.provider,L(C.error));let u;try{u=await v({env:e,loadAccountContext:s})}catch(a){return l(o.provider,T(a))}try{let a=await N(u.apiBaseUrl,u.apiKey,C.data,{path:u.path,signal:i?.signal,apiFetch:r});return a.endpointAvailable?{ok:a.ok,output:a.output,data:a.data}:l(o.provider,`Cloud connected app connector endpoint is not available (${a.status}).`)}catch(a){if(a instanceof Error&&a.name==="AbortError")throw a;return l(o.provider,`Cloud connected app connector request failed: ${T(a)}`)}}}n(z,"createCloudConnectedAppToolExecutor");async function v(t={}){let e=t.env??process.env,r=y(e.OPENPOND_CONNECTED_APP_TOOL_PATH),s=e.OPENPOND_CONNECTED_APP_API_KEY?.trim()||e.OPENPOND_SANDBOX_API_KEY?.trim()||e.OPENPOND_API_KEY?.trim();if(s)return{apiBaseUrl:_(e,null),apiKey:s,path:r};let i=await(t.loadAccountContext??P)(),c=i.token?.trim();if(!c)throw new Error("OpenPond account API key is required for connected app connector execution.");return{apiBaseUrl:_(e,i.apiBaseUrl),apiKey:c,path:r}}n(v,"resolveCloudConnectedAppToolTarget");function _(t,e){return p(t.OPENPOND_CONNECTED_APP_API_URL)??U(t.OPENPOND_SANDBOX_API_URL)??p(t.OPENPOND_SANDBOX_BASE_URL)??p(t.OPENPOND_API_URL)??p(e)??f}n(_,"resolveCloudConnectedAppApiBaseUrl");function D(t){return{provider:t.provider,operation:t.operation,toolName:t.toolName,sessionId:t.sessionId,turnId:t.turnId,toolCallId:t.toolCallId,userPrompt:t.userPrompt,connectionIds:t.connectionIds,capabilityIds:t.capabilityIds,args:t.args}}n(D,"cloudConnectedAppToolPayload");function U(t){let e=x(t);return e?p(m(e,{apiBaseUrl:e})):null}n(U,"apiBaseUrlFromSandboxApiUrl");function p(t){let e=x(t);if(!e)return null;try{let r=new URL(e);return r.pathname=b(r.pathname),r.search="",r.hash="",r.toString().replace(/\/$/,"")}catch{return e.replace(/\/v1\/sandboxes\/?$/i,"").replace(/\/api\/sandboxes\/?$/i,"").replace(/\/sandboxes\/?$/i,"").replace(/\/v1\/?$/i,"").replace(/\/+$/,"")}}n(p,"normalizeApiBaseUrl");function b(t){let e=t.replace(/\/+$/,"");return e=e.replace(/\/v1\/sandboxes$/i,"").replace(/\/api\/sandboxes$/i,"").replace(/\/sandboxes$/i,"").replace(/\/v1$/i,""),e||"/"}n(b,"normalizeApiBasePath");function x(t){let e=t?.trim();return e?e.replace(/\/+$/,""):null}n(x,"normalizeOptionalUrl");function y(t){let e=t?.trim()||h;return e.startsWith("/")?e:`/${e}`}n(y,"normalizeToolPath");function l(t,e){return{ok:!1,output:`${e} No ${t} provider API call was made.`}}n(l,"connectorUnavailable");function I(t){let e=t?.trim().toLowerCase();return e==="0"||e==="false"||e==="off"||e==="disabled"}n(I,"isDisabled");function L(t){return t.issues?.[0]?.message??"Connected app tool call request is invalid."}n(L,"connectedAppToolCallValidationMessage");function T(t){return t instanceof Error?t.message:"Unknown error"}n(T,"errorMessage");export{h as a,z as b,v as c};
2
+ import{a as P}from"./chunk-MCBRB5D6.js";import{f as O}from"./chunk-CJDGLPNX.js";import{b as A}from"./chunk-OQPJ7FJF.js";import{a as m}from"./chunk-2LJCJOJ7.js";import{b as d,e as f}from"./chunk-JCLTFDVW.js";import{a as n}from"./chunk-FTQLQJQV.js";async function N(t,e,r,s={}){let o=await(s.apiFetch??d)(t,e,s.path??A,{method:"POST",signal:s.signal,body:JSON.stringify(r)}),i=await o.json().catch(()=>({})),c=o.status!==404&&o.status!==405&&o.status!==501;return o.ok?{ok:typeof i.ok=="boolean"?i.ok:!0,status:o.status,endpointAvailable:c,output:g(i),data:E(i)}:{ok:!1,status:o.status,endpointAvailable:c,output:g(i)??(c?`Connected app tool call failed with status ${o.status}.`:`Connected app tool-call endpoint is not available (${o.status}).`),data:E(i)}}n(N,"executeConnectedAppToolCall");function g(t){return typeof t.output=="string"&&t.output.trim()?t.output.trim():typeof t.message=="string"&&t.message.trim()?t.message.trim():typeof t.error=="string"&&t.error.trim()?t.error.trim():null}n(g,"responsePayloadMessage");function E(t){return"data"in t?t.data:"result"in t?t.result:null}n(E,"responsePayloadData");var h=A;function z(t={}){let e=t.env??process.env,r=t.apiFetch??d,s=t.loadAccountContext??P;return async(o,i)=>{if(I(e.OPENPOND_CONNECTED_APP_TOOL_EXECUTOR))return l(o.provider,"Cloud connected app execution is disabled.");let c=D(o),C=O.safeParse(c);if(!C.success)return l(o.provider,L(C.error));let u;try{u=await v({env:e,loadAccountContext:s})}catch(a){return l(o.provider,T(a))}try{let a=await N(u.apiBaseUrl,u.apiKey,C.data,{path:u.path,signal:i?.signal,apiFetch:r});return a.endpointAvailable?{ok:a.ok,output:a.output,data:a.data}:l(o.provider,`Cloud connected app connector endpoint is not available (${a.status}).`)}catch(a){if(a instanceof Error&&a.name==="AbortError")throw a;return l(o.provider,`Cloud connected app connector request failed: ${T(a)}`)}}}n(z,"createCloudConnectedAppToolExecutor");async function v(t={}){let e=t.env??process.env,r=y(e.OPENPOND_CONNECTED_APP_TOOL_PATH),s=e.OPENPOND_CONNECTED_APP_API_KEY?.trim()||e.OPENPOND_SANDBOX_API_KEY?.trim()||e.OPENPOND_API_KEY?.trim();if(s)return{apiBaseUrl:_(e,null),apiKey:s,path:r};let i=await(t.loadAccountContext??P)(),c=i.token?.trim();if(!c)throw new Error("OpenPond account API key is required for connected app connector execution.");return{apiBaseUrl:_(e,i.apiBaseUrl),apiKey:c,path:r}}n(v,"resolveCloudConnectedAppToolTarget");function _(t,e){return p(t.OPENPOND_CONNECTED_APP_API_URL)??U(t.OPENPOND_SANDBOX_API_URL)??p(t.OPENPOND_SANDBOX_BASE_URL)??p(t.OPENPOND_API_URL)??p(e)??f}n(_,"resolveCloudConnectedAppApiBaseUrl");function D(t){return{provider:t.provider,operation:t.operation,toolName:t.toolName,sessionId:t.sessionId,turnId:t.turnId,toolCallId:t.toolCallId,userPrompt:t.userPrompt,connectionIds:t.connectionIds,capabilityIds:t.capabilityIds,args:t.args}}n(D,"cloudConnectedAppToolPayload");function U(t){let e=x(t);return e?p(m(e,{apiBaseUrl:e})):null}n(U,"apiBaseUrlFromSandboxApiUrl");function p(t){let e=x(t);if(!e)return null;try{let r=new URL(e);return r.pathname=b(r.pathname),r.search="",r.hash="",r.toString().replace(/\/$/,"")}catch{return e.replace(/\/v1\/sandboxes\/?$/i,"").replace(/\/api\/sandboxes\/?$/i,"").replace(/\/sandboxes\/?$/i,"").replace(/\/v1\/?$/i,"").replace(/\/+$/,"")}}n(p,"normalizeApiBaseUrl");function b(t){let e=t.replace(/\/+$/,"");return e=e.replace(/\/v1\/sandboxes$/i,"").replace(/\/api\/sandboxes$/i,"").replace(/\/sandboxes$/i,"").replace(/\/v1$/i,""),e||"/"}n(b,"normalizeApiBasePath");function x(t){let e=t?.trim();return e?e.replace(/\/+$/,""):null}n(x,"normalizeOptionalUrl");function y(t){let e=t?.trim()||h;return e.startsWith("/")?e:`/${e}`}n(y,"normalizeToolPath");function l(t,e){return{ok:!1,output:`${e} No ${t} provider API call was made.`}}n(l,"connectorUnavailable");function I(t){let e=t?.trim().toLowerCase();return e==="0"||e==="false"||e==="off"||e==="disabled"}n(I,"isDisabled");function L(t){return t.issues?.[0]?.message??"Connected app tool call request is invalid."}n(L,"connectedAppToolCallValidationMessage");function T(t){return t instanceof Error?t.message:"Unknown error"}n(T,"errorMessage");export{h as a,z as b,v as c};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as H,b as y,c as C,e as E,g as S,h as P,i as j}from"./chunk-6S2MWJVD.js";import{c as I}from"./chunk-LXZLLTYQ.js";import{Ja as w,La as b}from"./chunk-WLZJOCLA.js";import{f as h,l as v,m as l}from"./chunk-HIQPGYVH.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as f}from"./chunk-FTQLQJQV.js";var a=e.string().min(1).max(240),d=e.string().regex(/^[a-f0-9]{64}$/),g=e.string().regex(/^[a-f0-9]{40}$/),x=e.object({schemaVersion:e.literal("openpond.hostedProfileCandidateExport.v1"),actorId:a,teamId:a,candidateId:a,candidateRevision:e.number().int().positive(),projectId:a.nullable(),profileRef:e.object({source:e.literal("openpond_git"),repositoryId:a,profileId:a}).strict(),expectedCommit:g,component:y.shape.component,baseRelease:h,frozenHash:d,executableSourceHash:d,protectedClosureHash:d,compiler:e.object({workspaceId:a,name:e.string().max(500),repositoryId:a}).strict(),sourceManifest:e.object({base64:e.string().max(28e5),contentHash:d,sizeBytes:e.number().int().positive().max(2e6)}).strict(),policySource:w,qualification:e.object({kind:e.enum(["owner_attested_local","hosted_execution"]),ownerActorId:a,teamId:a,originalEvidence:h,baseline:h,candidate:h,comparisonHash:d,recipe:H}).strict(),createdAt:e.string().datetime(),contentHash:d}).strict();function J(n){let o=x.parse(n),{contentHash:t,...c}=o;if(l(c)!==t||o.qualification.ownerActorId!==o.actorId||o.qualification.teamId!==o.teamId||o.qualification.recipe.externalDatasetBinding.profileId!==o.profileRef.profileId||o.qualification.recipe.externalDatasetBinding.protectedProfileClosureHash!==o.protectedClosureHash)throw new Error("Hosted candidate owner attestation identity differs.");return b(o.policySource),o}f(J,"verifyHostedProfileCandidateExport");var O=e.object({schemaVersion:e.literal("openpond.hostedProfileCandidateAdoption.v1"),id:a,operationId:a,actorId:a,teamId:a,candidateId:a,exportHash:d,executionOrigin:e.enum(["owner_attested_local","hosted_execution"]),qualification:x.shape.qualification,testedCandidateRelease:h,activeRelease:h,expectedCommit:g,committedProfileGit:g,executableSourceHash:d,protectedClosureHash:d,createdAt:e.string().datetime(),contentHash:d}).strict();function R(n){let o=O.parse(n),{contentHash:t,...c}=o;if(l(c)!==t||o.executionOrigin!==o.qualification.kind||o.qualification.ownerActorId!==o.actorId||o.qualification.teamId!==o.teamId)throw new Error("Hosted candidate receipt integrity differs.");return o}f(R,"verifyHostedProfileCandidateReceipt");var T=e.discriminatedUnion("operation",[e.object({operation:e.literal("adopt"),operationId:a,export:x}).strict(),e.object({operation:e.enum(["read","rollback"]),operationId:a,adoptionOperationId:a,profileRepositoryId:a}).strict()]),K=class{static{f(this,"ExperimentImprovementClient")}constructor(n){this.options=n;let o=new URL(n.baseUrl);if(!["http:","https:"].includes(o.protocol)||o.username||o.password||o.hash||o.search||!n.apiKey.trim()||!n.teamId.trim()||!n.actorId.trim())throw new Error("Select the authenticated Improve owner and API origin.");this.origin=o.toString().replace(/\/+$/,"")}options;origin;async hostedCandidate(n,o){let t=T.parse(n);if(t.operation==="adopt"&&(t.export.actorId!==this.options.actorId||t.export.teamId!==this.options.teamId))throw new Error("The hosted candidate export belongs to a different owner.");let{response:c,value:p}=await I(this.options.fetch??fetch,`${this.origin}/v1/profile-candidate-adoptions`,{method:"POST",redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"Content-Type":"application/json","X-OpenPond-Team-Id":this.options.teamId},body:JSON.stringify({teamId:this.options.teamId,command:t}),signal:o},(m,u,r)=>Object.assign(new Error(r),{status:m,code:u}));if(!c.ok){let m=e.object({code:e.string(),message:e.string().optional(),error:e.string().optional()}).passthrough().safeParse(p);throw Object.assign(new Error(m.success?m.data.message??m.data.error??m.data.code:"Hosted candidate operation failed."),{status:c.status,code:m.success?m.data.code:void 0})}let i=R(p);if(i.actorId!==this.options.actorId||i.teamId!==this.options.teamId||i.operationId!==t.operationId||t.operation==="adopt"&&(i.exportHash!==t.export.contentHash||i.candidateId!==t.export.candidateId||i.testedCandidateRelease.contentHash!==t.export.policySource.harnessRelease.contentHash))throw new Error("Hosted candidate readback differs from the exact owner request.");return i}async command(n,o){let t=S.parse(n),{response:c,value:p}=await I(this.options.fetch??fetch,`${this.origin}/v1/experiment-improvements`,{method:"POST",redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"Content-Type":"application/json","X-OpenPond-Team-Id":this.options.teamId},body:JSON.stringify({teamId:this.options.teamId,request:t}),signal:o},(r,s,q)=>Object.assign(new Error(q),{status:r,code:s}));if(!c.ok){let r=e.object({error:e.string(),code:e.string().optional()}).passthrough().safeParse(p);throw Object.assign(new Error(r.success?r.data.error:"The Improve operation failed."),{status:c.status,code:r.success?r.data.code:void 0})}if(t.operation==="options"){let r=P.parse(p);if(r.teamId!==this.options.teamId||l(r.evidence)!==l(t.evidence))throw new Error("The Improve choices changed their exact originating evidence.");return r}if(t.operation==="humanComparisonOptions"){let r=j(p);if(r.candidateId!==t.id||r.actorId!==this.options.actorId||r.teamId!==this.options.teamId)throw new Error("Human discovery belongs to another owner or candidate.");return r}if(t.operation==="instructions"){let r=e.object({candidateId:e.string(),candidateRevision:e.number().int().positive(),path:e.string(),text:e.string().max(25e4),textHash:e.string().regex(/^[a-f0-9]{64}$/),contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict().parse(p);if(r.candidateId!==t.id||v(r.text)!==r.textHash)throw new Error("The candidate instructions belong to a different revision.");return r}let i=t.operation==="list"?E.parse(p):null;if(t.operation==="list"&&i&&(i.states.length>t.limit||i.states.some((r,s)=>t.cursor&&r.id<=t.cursor||s>0&&r.id<=i.states[s-1].id)||i.nextCursor&&(t.cursor&&i.nextCursor<=t.cursor||i.states.some(r=>r.id>i.nextCursor))))throw new Error("The retained candidate page changed its scan boundary.");let u=(i?i.states:[p]).map(r=>{let s=C(r);if(s.actorId!==this.options.actorId||s.teamId!==this.options.teamId||"id"in t&&s.id!==t.id)throw new Error("The Improve response belongs to a different owner or candidate.");if(t.operation==="start"&&s.requestHash!==l(t.request))throw new Error("The Improve request identity changed.");return s});return i?{states:u,nextCursor:i.nextCursor}:u[0]}};export{J as a,K as b};
2
+ import{a as H,b as y,c as C,e as E,g as S,h as P,i as j}from"./chunk-5TPYBXWM.js";import{c as I}from"./chunk-LI56PPCN.js";import{Ja as w,La as b}from"./chunk-5ZNE43XC.js";import{f as h,l as v,m as l}from"./chunk-HIQPGYVH.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as f}from"./chunk-FTQLQJQV.js";var a=e.string().min(1).max(240),d=e.string().regex(/^[a-f0-9]{64}$/),g=e.string().regex(/^[a-f0-9]{40}$/),x=e.object({schemaVersion:e.literal("openpond.hostedProfileCandidateExport.v1"),actorId:a,teamId:a,candidateId:a,candidateRevision:e.number().int().positive(),projectId:a.nullable(),profileRef:e.object({source:e.literal("openpond_git"),repositoryId:a,profileId:a}).strict(),expectedCommit:g,component:y.shape.component,baseRelease:h,frozenHash:d,executableSourceHash:d,protectedClosureHash:d,compiler:e.object({workspaceId:a,name:e.string().max(500),repositoryId:a}).strict(),sourceManifest:e.object({base64:e.string().max(28e5),contentHash:d,sizeBytes:e.number().int().positive().max(2e6)}).strict(),policySource:w,qualification:e.object({kind:e.enum(["owner_attested_local","hosted_execution"]),ownerActorId:a,teamId:a,originalEvidence:h,baseline:h,candidate:h,comparisonHash:d,recipe:H}).strict(),createdAt:e.string().datetime(),contentHash:d}).strict();function J(n){let o=x.parse(n),{contentHash:t,...c}=o;if(l(c)!==t||o.qualification.ownerActorId!==o.actorId||o.qualification.teamId!==o.teamId||o.qualification.recipe.externalDatasetBinding.profileId!==o.profileRef.profileId||o.qualification.recipe.externalDatasetBinding.protectedProfileClosureHash!==o.protectedClosureHash)throw new Error("Hosted candidate owner attestation identity differs.");return b(o.policySource),o}f(J,"verifyHostedProfileCandidateExport");var O=e.object({schemaVersion:e.literal("openpond.hostedProfileCandidateAdoption.v1"),id:a,operationId:a,actorId:a,teamId:a,candidateId:a,exportHash:d,executionOrigin:e.enum(["owner_attested_local","hosted_execution"]),qualification:x.shape.qualification,testedCandidateRelease:h,activeRelease:h,expectedCommit:g,committedProfileGit:g,executableSourceHash:d,protectedClosureHash:d,createdAt:e.string().datetime(),contentHash:d}).strict();function R(n){let o=O.parse(n),{contentHash:t,...c}=o;if(l(c)!==t||o.executionOrigin!==o.qualification.kind||o.qualification.ownerActorId!==o.actorId||o.qualification.teamId!==o.teamId)throw new Error("Hosted candidate receipt integrity differs.");return o}f(R,"verifyHostedProfileCandidateReceipt");var T=e.discriminatedUnion("operation",[e.object({operation:e.literal("adopt"),operationId:a,export:x}).strict(),e.object({operation:e.enum(["read","rollback"]),operationId:a,adoptionOperationId:a,profileRepositoryId:a}).strict()]),K=class{static{f(this,"ExperimentImprovementClient")}constructor(n){this.options=n;let o=new URL(n.baseUrl);if(!["http:","https:"].includes(o.protocol)||o.username||o.password||o.hash||o.search||!n.apiKey.trim()||!n.teamId.trim()||!n.actorId.trim())throw new Error("Select the authenticated Improve owner and API origin.");this.origin=o.toString().replace(/\/+$/,"")}options;origin;async hostedCandidate(n,o){let t=T.parse(n);if(t.operation==="adopt"&&(t.export.actorId!==this.options.actorId||t.export.teamId!==this.options.teamId))throw new Error("The hosted candidate export belongs to a different owner.");let{response:c,value:p}=await I(this.options.fetch??fetch,`${this.origin}/v1/profile-candidate-adoptions`,{method:"POST",redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"Content-Type":"application/json","X-OpenPond-Team-Id":this.options.teamId},body:JSON.stringify({teamId:this.options.teamId,command:t}),signal:o},(m,u,r)=>Object.assign(new Error(r),{status:m,code:u}));if(!c.ok){let m=e.object({code:e.string(),message:e.string().optional(),error:e.string().optional()}).passthrough().safeParse(p);throw Object.assign(new Error(m.success?m.data.message??m.data.error??m.data.code:"Hosted candidate operation failed."),{status:c.status,code:m.success?m.data.code:void 0})}let i=R(p);if(i.actorId!==this.options.actorId||i.teamId!==this.options.teamId||i.operationId!==t.operationId||t.operation==="adopt"&&(i.exportHash!==t.export.contentHash||i.candidateId!==t.export.candidateId||i.testedCandidateRelease.contentHash!==t.export.policySource.harnessRelease.contentHash))throw new Error("Hosted candidate readback differs from the exact owner request.");return i}async command(n,o){let t=S.parse(n),{response:c,value:p}=await I(this.options.fetch??fetch,`${this.origin}/v1/experiment-improvements`,{method:"POST",redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"Content-Type":"application/json","X-OpenPond-Team-Id":this.options.teamId},body:JSON.stringify({teamId:this.options.teamId,request:t}),signal:o},(r,s,q)=>Object.assign(new Error(q),{status:r,code:s}));if(!c.ok){let r=e.object({error:e.string(),code:e.string().optional()}).passthrough().safeParse(p);throw Object.assign(new Error(r.success?r.data.error:"The Improve operation failed."),{status:c.status,code:r.success?r.data.code:void 0})}if(t.operation==="options"){let r=P.parse(p);if(r.teamId!==this.options.teamId||l(r.evidence)!==l(t.evidence))throw new Error("The Improve choices changed their exact originating evidence.");return r}if(t.operation==="humanComparisonOptions"){let r=j(p);if(r.candidateId!==t.id||r.actorId!==this.options.actorId||r.teamId!==this.options.teamId)throw new Error("Human discovery belongs to another owner or candidate.");return r}if(t.operation==="instructions"){let r=e.object({candidateId:e.string(),candidateRevision:e.number().int().positive(),path:e.string(),text:e.string().max(25e4),textHash:e.string().regex(/^[a-f0-9]{64}$/),contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict().parse(p);if(r.candidateId!==t.id||v(r.text)!==r.textHash)throw new Error("The candidate instructions belong to a different revision.");return r}let i=t.operation==="list"?E.parse(p):null;if(t.operation==="list"&&i&&(i.states.length>t.limit||i.states.some((r,s)=>t.cursor&&r.id<=t.cursor||s>0&&r.id<=i.states[s-1].id)||i.nextCursor&&(t.cursor&&i.nextCursor<=t.cursor||i.states.some(r=>r.id>i.nextCursor))))throw new Error("The retained candidate page changed its scan boundary.");let u=(i?i.states:[p]).map(r=>{let s=C(r);if(s.actorId!==this.options.actorId||s.teamId!==this.options.teamId||"id"in t&&s.id!==t.id)throw new Error("The Improve response belongs to a different owner or candidate.");if(t.operation==="start"&&s.requestHash!==l(t.request))throw new Error("The Improve request identity changed.");return s});return i?{states:u,nextCursor:i.nextCursor}:u[0]}};export{J as a,K as b};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as c}from"./chunk-BJXPQIVD.js";import{a as m}from"./chunk-DMFUEUAZ.js";import{t as p}from"./chunk-MVPKU72J.js";import{I as i,L as d}from"./chunk-2MEOUS24.js";import{a as n}from"./chunk-FTQLQJQV.js";async function r(e,o){return(await e.allPayloadRows(`SELECT payload FROM ${o} ORDER BY sort_index ASC`)).map(t=>JSON.parse(t.payload))}n(r,"readStorePayloads");function S(e){let o=e,a=d.safeParse(o.openPondCommandAccessMode);return{...o,experience:l(o),openPondCommandAccessMode:a.success?a.data:i,currentProfile:o.currentProfile??null}}n(S,"normalizeSessionPayload");function l(e){let o=p.safeParse(e.experience);return o.success?o.data:!!(e.provider==="codex"||e.codexThreadId||e.systemKind||e.parentSessionId||e.subagentRunId||e.appId||e.workspaceKind||e.workspaceId||e.localProjectId||e.cloudProjectId)?"development":"chat"}n(l,"storedSessionExperience");async function E(e){return{sessions:(await r(e,"sessions")).map(S),turns:await r(e,"turns"),approvals:await r(e,"approvals")}}n(E,"readStoreMetadata");async function T(e){return{...await E(e),events:(await r(e,"events")).map(m)}}n(T,"readStoreData");async function D(e,o){let a=c();await o.exec("BEGIN IMMEDIATE");try{await o.exec("DELETE FROM approvals; DELETE FROM events; DELETE FROM turns; DELETE FROM sessions;");for(let[t,s]of e.sessions.entries())await o.run("INSERT INTO sessions (id, sort_index, payload, updated_at) VALUES (?, ?, ?, ?)",[s.id,t,JSON.stringify(s),s.updatedAt]);for(let[t,s]of e.turns.entries())await o.run("INSERT INTO turns (id, session_id, provider_turn_id, status, sort_index, payload, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?)",[s.id,s.sessionId,s.providerTurnId,s.status,t,JSON.stringify(s),s.completedAt??s.startedAt]);for(let[t,s]of e.events.entries()){let u=t+1;await o.run("INSERT INTO events (id, session_id, turn_id, name, timestamp, sequence, sort_index, payload) VALUES (?, ?, ?, ?, ?, ?, ?, ?)",[s.id,s.sessionId??null,s.turnId??null,s.name,s.timestamp,u,t,JSON.stringify(s)])}for(let[t,s]of e.approvals.entries())await o.run("INSERT INTO approvals (id, session_id, status, sort_index, payload, updated_at) VALUES (?, ?, ?, ?, ?, ?)",[s.id,s.sessionId,s.status,t,JSON.stringify(s),a]);await o.exec("COMMIT")}catch(t){throw await o.exec("ROLLBACK"),t}}n(D,"persistStoreData");export{S as a,E as b,T as c,D as d};
2
+ import{a as c}from"./chunk-BJXPQIVD.js";import{a as m}from"./chunk-DMFUEUAZ.js";import{t as p}from"./chunk-CJDGLPNX.js";import{I as i,L as d}from"./chunk-2MEOUS24.js";import{a as n}from"./chunk-FTQLQJQV.js";async function r(e,o){return(await e.allPayloadRows(`SELECT payload FROM ${o} ORDER BY sort_index ASC`)).map(t=>JSON.parse(t.payload))}n(r,"readStorePayloads");function S(e){let o=e,a=d.safeParse(o.openPondCommandAccessMode);return{...o,experience:l(o),openPondCommandAccessMode:a.success?a.data:i,currentProfile:o.currentProfile??null}}n(S,"normalizeSessionPayload");function l(e){let o=p.safeParse(e.experience);return o.success?o.data:!!(e.provider==="codex"||e.codexThreadId||e.systemKind||e.parentSessionId||e.subagentRunId||e.appId||e.workspaceKind||e.workspaceId||e.localProjectId||e.cloudProjectId)?"development":"chat"}n(l,"storedSessionExperience");async function E(e){return{sessions:(await r(e,"sessions")).map(S),turns:await r(e,"turns"),approvals:await r(e,"approvals")}}n(E,"readStoreMetadata");async function T(e){return{...await E(e),events:(await r(e,"events")).map(m)}}n(T,"readStoreData");async function D(e,o){let a=c();await o.exec("BEGIN IMMEDIATE");try{await o.exec("DELETE FROM approvals; DELETE FROM events; DELETE FROM turns; DELETE FROM sessions;");for(let[t,s]of e.sessions.entries())await o.run("INSERT INTO sessions (id, sort_index, payload, updated_at) VALUES (?, ?, ?, ?)",[s.id,t,JSON.stringify(s),s.updatedAt]);for(let[t,s]of e.turns.entries())await o.run("INSERT INTO turns (id, session_id, provider_turn_id, status, sort_index, payload, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?)",[s.id,s.sessionId,s.providerTurnId,s.status,t,JSON.stringify(s),s.completedAt??s.startedAt]);for(let[t,s]of e.events.entries()){let u=t+1;await o.run("INSERT INTO events (id, session_id, turn_id, name, timestamp, sequence, sort_index, payload) VALUES (?, ?, ?, ?, ?, ?, ?, ?)",[s.id,s.sessionId??null,s.turnId??null,s.name,s.timestamp,u,t,JSON.stringify(s)])}for(let[t,s]of e.approvals.entries())await o.run("INSERT INTO approvals (id, session_id, status, sort_index, payload, updated_at) VALUES (?, ?, ?, ?, ?, ?)",[s.id,s.sessionId,s.status,t,JSON.stringify(s),a]);await o.exec("COMMIT")}catch(t){throw await o.exec("ROLLBACK"),t}}n(D,"persistStoreData");export{S as a,E as b,T as c,D as d};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{d as c,e as i}from"./chunk-XHBMK6LC.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-R6VI7MX5.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};