openpond 0.2.62 → 0.2.63

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 (496) hide show
  1. package/README.md +2 -0
  2. package/dist/app-server.d.ts +1053 -63
  3. package/dist/app-server.js +1 -1
  4. package/dist/chunks/{acp-DYRBDJRU.js → acp-H3MJCPHX.js} +1 -1
  5. package/dist/chunks/{acp-agent-UTLP7C3I.js → acp-agent-DWA7272M.js} +1 -1
  6. package/dist/chunks/actions-command-IIYOO4LL.js +2 -0
  7. package/dist/chunks/{app-layer-N2H3RBEN.js → app-layer-K7H2WJ56.js} +1 -1
  8. package/dist/chunks/app-server-connected-apps-RM5E2VWF.js +2 -0
  9. package/dist/chunks/app-server-evaluations-XGMGS67X.js +2 -0
  10. package/dist/chunks/app-server-harness-services-BHD6S5II.js +2 -0
  11. package/dist/chunks/app-server-runtime-LFIL6F7D.js +2 -0
  12. package/dist/chunks/apps-QKAHJGQ4.js +2 -0
  13. package/dist/chunks/chunk-25XXZS3E.js +2 -0
  14. package/dist/chunks/chunk-27JGS3KB.js +12 -0
  15. package/dist/chunks/{chunk-7JBB4PXS.js → chunk-2HAWOMZK.js} +1 -1
  16. package/dist/chunks/chunk-2LJCJOJ7.js +2 -0
  17. package/dist/chunks/{chunk-CN5OXQ7A.js → chunk-3YXYBYWK.js} +1 -1
  18. package/dist/chunks/{chunk-GEKORCMN.js → chunk-42V4NV2F.js} +1 -1
  19. package/dist/chunks/{chunk-VAJSRUAB.js → chunk-4FNCBA3Y.js} +1 -1
  20. package/dist/chunks/{chunk-F7D4BMTO.js → chunk-4L6DU6Z2.js} +1 -1
  21. package/dist/chunks/{chunk-SZKFNKWO.js → chunk-4SZ3HKHU.js} +1 -1
  22. package/dist/chunks/chunk-5EP2DZLJ.js +2 -0
  23. package/dist/chunks/chunk-5FU5RLML.js +2 -0
  24. package/dist/chunks/{chunk-6SH4B7DV.js → chunk-5MHYGMJG.js} +1 -1
  25. package/dist/chunks/{chunk-MEK7DLX3.js → chunk-6EBCS57F.js} +1 -1
  26. package/dist/chunks/chunk-6RS4NAOY.js +2 -0
  27. package/dist/chunks/{chunk-NVHZRKXB.js → chunk-7HRLWPPZ.js} +1 -1
  28. package/dist/chunks/chunk-7O6Z3VOZ.js +2 -0
  29. package/dist/chunks/{chunk-P74RR2GB.js → chunk-7WYL2IDD.js} +1 -1
  30. package/dist/chunks/chunk-7YLXGILH.js +2 -0
  31. package/dist/chunks/chunk-7ZLXFKRI.js +2 -0
  32. package/dist/chunks/{chunk-NWOK6NLE.js → chunk-AH26AQN7.js} +1 -1
  33. package/dist/chunks/chunk-AHOBCBVZ.js +2 -0
  34. package/dist/chunks/chunk-B5R53U74.js +2 -0
  35. package/dist/chunks/{chunk-NKZNPTLA.js → chunk-BPZOABMC.js} +1 -1
  36. package/dist/chunks/{chunk-2IIBCCOK.js → chunk-BSPFY3Y5.js} +1 -1
  37. package/dist/chunks/{chunk-5OSM75X5.js → chunk-BU27SLZP.js} +2 -2
  38. package/dist/chunks/chunk-C2AXMKK4.js +2 -0
  39. package/dist/chunks/{chunk-AMO5DVKM.js → chunk-C2LAEGOW.js} +2 -2
  40. package/dist/chunks/{chunk-GNCEZ3UP.js → chunk-CZ5R4JXZ.js} +1 -1
  41. package/dist/chunks/{chunk-JIFUGA3U.js → chunk-DABBHWSF.js} +1 -1
  42. package/dist/chunks/{chunk-VK4TPZTA.js → chunk-DLANLLKH.js} +1 -1
  43. package/dist/chunks/{chunk-WGLVSGFA.js → chunk-DQI5TE6A.js} +2 -2
  44. package/dist/chunks/chunk-DTTFUANI.js +12 -0
  45. package/dist/chunks/{chunk-4TM75R7V.js → chunk-DUL6DXOI.js} +1 -1
  46. package/dist/chunks/{chunk-TGEGXTPR.js → chunk-ELX7VRSU.js} +1 -1
  47. package/dist/chunks/chunk-ERL2M773.js +3 -0
  48. package/dist/chunks/{chunk-4PZWGNX4.js → chunk-ERT32RZA.js} +4 -4
  49. package/dist/chunks/{chunk-RTJCELRR.js → chunk-EZRUWIP6.js} +1 -1
  50. package/dist/chunks/{chunk-LJDBR3RN.js → chunk-F6UQ6PPK.js} +1 -1
  51. package/dist/chunks/chunk-F7QTIHXX.js +2 -0
  52. package/dist/chunks/chunk-FAKDGLZQ.js +8 -0
  53. package/dist/chunks/{chunk-FFWOTZQM.js → chunk-FVRII5XO.js} +1 -1
  54. package/dist/chunks/{chunk-C7M2WBWZ.js → chunk-FYYYECHE.js} +51 -49
  55. package/dist/chunks/chunk-G32BO6M5.js +4 -0
  56. package/dist/chunks/{chunk-NBE74GLF.js → chunk-G6OR5NB6.js} +1 -1
  57. package/dist/chunks/{chunk-GQGLPKU4.js → chunk-GGJUWIGR.js} +1 -1
  58. package/dist/chunks/{chunk-VSQXDS6H.js → chunk-GPL2Z65R.js} +1 -1
  59. package/dist/chunks/{chunk-INO67SEN.js → chunk-GS6ZUSIN.js} +2 -2
  60. package/dist/chunks/{chunk-47AXSBPV.js → chunk-GVARQXYI.js} +1 -1
  61. package/dist/chunks/chunk-GXCUH2VV.js +17 -0
  62. package/dist/chunks/{chunk-OCC43RSJ.js → chunk-GXZCMO6S.js} +1 -1
  63. package/dist/chunks/{chunk-CLFYRN46.js → chunk-H6C4MAUN.js} +1 -1
  64. package/dist/chunks/{chunk-HBLN4OLY.js → chunk-HUCBKXTU.js} +1 -1
  65. package/dist/chunks/{chunk-M5IX6VUA.js → chunk-IHB5GTOJ.js} +2 -2
  66. package/dist/chunks/{chunk-J3B2GM4A.js → chunk-IWWXIUAQ.js} +1 -1
  67. package/dist/chunks/chunk-J572ANHX.js +13 -0
  68. package/dist/chunks/{chunk-AKZPMKWP.js → chunk-J7ZTPXRQ.js} +1 -1
  69. package/dist/chunks/{chunk-CJUVHE4U.js → chunk-JORRZ4BB.js} +1 -1
  70. package/dist/chunks/chunk-JSQRLLN6.js +2 -0
  71. package/dist/chunks/chunk-KCOTDUGW.js +2 -0
  72. package/dist/chunks/{chunk-NK4JKB7C.js → chunk-KHTAAVC2.js} +1 -1
  73. package/dist/chunks/{chunk-LRRBYIGH.js → chunk-LK2K3SPM.js} +2 -2
  74. package/dist/chunks/{chunk-557XSPVS.js → chunk-LKKMLBOH.js} +1 -1
  75. package/dist/chunks/{chunk-U456UP3N.js → chunk-LSZJ5M3X.js} +1 -1
  76. package/dist/chunks/chunk-M3FLEZ4E.js +4 -0
  77. package/dist/chunks/{chunk-Y2KPHVZK.js → chunk-M3SCON53.js} +1 -1
  78. package/dist/chunks/{chunk-VPDG2V2R.js → chunk-MEGKXGW3.js} +1 -1
  79. package/dist/chunks/chunk-MPNJ2BB4.js +2 -0
  80. package/dist/chunks/{chunk-4RZBGKT7.js → chunk-N33D7KCW.js} +1 -1
  81. package/dist/chunks/chunk-N42HT64M.js +2 -0
  82. package/dist/chunks/{chunk-SD64CLJX.js → chunk-N4VHLJBZ.js} +1 -1
  83. package/dist/chunks/chunk-NEJLJ2XY.js +2 -0
  84. package/dist/chunks/chunk-NG2L6D7G.js +2 -0
  85. package/dist/chunks/{chunk-GV3LFSMI.js → chunk-NLYZ5K7U.js} +1 -1
  86. package/dist/chunks/{chunk-F4TJ7WQV.js → chunk-NT7N6KLE.js} +1 -1
  87. package/dist/chunks/{chunk-PAE3PQEC.js → chunk-NZTCH6K5.js} +1 -1
  88. package/dist/chunks/{chunk-BEI4YULC.js → chunk-OG33QAG6.js} +1 -1
  89. package/dist/chunks/chunk-OTUBJV6C.js +6 -0
  90. package/dist/chunks/{chunk-RH43WLBX.js → chunk-PBTXLQAU.js} +1 -1
  91. package/dist/chunks/{chunk-3R4MSE2S.js → chunk-QJ6KUVAR.js} +1 -1
  92. package/dist/chunks/{chunk-7JXZNCBC.js → chunk-QU4UE73E.js} +1 -1
  93. package/dist/chunks/{chunk-WQMXEZVE.js → chunk-R6VJDOQM.js} +3 -3
  94. package/dist/chunks/{chunk-FUSCTBJI.js → chunk-R6WMY6AH.js} +1 -1
  95. package/dist/chunks/{chunk-EIX2V2KU.js → chunk-RDSVU6F6.js} +1 -1
  96. package/dist/chunks/{chunk-R4PDSOB4.js → chunk-RFMME46Z.js} +1 -1
  97. package/dist/chunks/{chunk-GW5SE3FM.js → chunk-RZUCVF2Q.js} +1 -1
  98. package/dist/chunks/{chunk-UC3FXTDL.js → chunk-SFKZITAG.js} +5 -5
  99. package/dist/chunks/{chunk-5A6ER3M2.js → chunk-SHJY5RLU.js} +1 -1
  100. package/dist/chunks/chunk-SI5W5LBV.js +2 -0
  101. package/dist/chunks/chunk-SO42ZB5K.js +2 -0
  102. package/dist/chunks/{chunk-2UDAKLJ4.js → chunk-TCOTXCV6.js} +1 -1
  103. package/dist/chunks/{chunk-QCSLEMZF.js → chunk-U2K7QJCG.js} +1 -1
  104. package/dist/chunks/{chunk-ISIXFK6U.js → chunk-UH4JSSRL.js} +28 -28
  105. package/dist/chunks/{chunk-X4ZT22SG.js → chunk-UPWJSNL5.js} +1 -1
  106. package/dist/chunks/chunk-URNMC46H.js +157 -0
  107. package/dist/chunks/{chunk-NLQ2UPN2.js → chunk-V7KR74NO.js} +1 -1
  108. package/dist/chunks/{chunk-HXZXDDKW.js → chunk-VHXDWAEH.js} +1 -1
  109. package/dist/chunks/{chunk-NE4ESZPT.js → chunk-W2TICQ62.js} +1 -1
  110. package/dist/chunks/chunk-WP2L2NY2.js +2 -0
  111. package/dist/chunks/chunk-WSOUMXH3.js +24 -0
  112. package/dist/chunks/chunk-WWQNMC7C.js +6 -0
  113. package/dist/chunks/chunk-XMHIQ3SK.js +5 -0
  114. package/dist/chunks/{chunk-5MTN6KXV.js → chunk-XNOMIWEY.js} +1 -1
  115. package/dist/chunks/{chunk-ZXT7V64X.js → chunk-XOB6FKQV.js} +1 -1
  116. package/dist/chunks/chunk-Y766IN7Y.js +2 -0
  117. package/dist/chunks/chunk-YCZZ62C2.js +2 -0
  118. package/dist/chunks/chunk-YM4PSVFW.js +4 -0
  119. package/dist/chunks/chunk-YNQWJWIC.js +10 -0
  120. package/dist/chunks/{chunk-GSWBNJGZ.js → chunk-Z3BWCFLV.js} +1 -1
  121. package/dist/chunks/{chunk-GOIKLFXK.js → chunk-ZG6353RM.js} +1 -1
  122. package/dist/chunks/{chunk-T6C5BNXK.js → chunk-ZPTKR3GB.js} +1 -1
  123. package/dist/chunks/{chunk-MNXNZDDW.js → chunk-ZYVHOVKL.js} +1 -1
  124. package/dist/chunks/chunk-ZZHXQCNB.js +22 -0
  125. package/dist/chunks/cli-PSXMIJTF.js +2 -0
  126. package/dist/chunks/{configuration-command-BU2RPG33.js → configuration-command-XYKMXIWF.js} +1 -1
  127. package/dist/chunks/connected-app-executor-6G2LA3PQ.js +2 -0
  128. package/dist/chunks/connected-evidence-IRXYN6YD.js +2 -0
  129. package/dist/chunks/{connected-starting-assets-V5QXRK5Q.js → connected-starting-assets-JONPTII6.js} +1 -1
  130. package/dist/chunks/{continual-FLW6DAJK.js → continual-Z7MO2PF6.js} +1 -1
  131. package/dist/chunks/core-commands-WWN7X3XC.js +2 -0
  132. package/dist/chunks/dataset-preparation-authoring-F3OZIQSP.js +4 -0
  133. package/dist/chunks/datasets-2PC2HP7N.js +2 -0
  134. package/dist/chunks/desktop-test-VU6AFAMO.js +3 -0
  135. package/dist/chunks/dist-47AYOIH6.js +2 -0
  136. package/dist/chunks/{dist-DCSLPBO2.js → dist-MXBEBM4D.js} +1 -1
  137. package/dist/chunks/evaluation-coordination-UOWZHHC5.js +2 -0
  138. package/dist/chunks/experiment-improvements-EB2CV5RA.js +2 -0
  139. package/dist/chunks/experiments-SZQYR6MH.js +2 -0
  140. package/dist/chunks/experiments-signal-2KJCP25D.js +2 -0
  141. package/dist/chunks/{help-PXUUREHZ.js → help-7HXFWIKS.js} +1 -1
  142. package/dist/chunks/host-profile-evaluation-tools-Y2LQ4WQN.js +2 -0
  143. package/dist/chunks/host-profile-external-dataset-FRIGXOO7.js +2 -0
  144. package/dist/chunks/hosted-app-server-composition-PGKQNDW6.js +2 -0
  145. package/dist/chunks/hosted-experiment-improvement-UXC542SZ.js +3 -0
  146. package/dist/chunks/hosted-harness-runtime-6PEI7F2U.js +2 -0
  147. package/dist/chunks/hosted-profile-candidate-HM44BIUX.js +3 -0
  148. package/dist/chunks/hosted-profile-compiler-UAZ4PHYE.js +2 -0
  149. package/dist/chunks/hosted-profile-evaluation-control-EUL57FAB.js +2 -0
  150. package/dist/chunks/hosted-profile-evaluation-inspection-7USY75Z4.js +3 -0
  151. package/dist/chunks/hosted-profile-evaluation-preparation-2LSMZQNA.js +3 -0
  152. package/dist/chunks/{hosted-tasksets-X2YCFYEJ.js → hosted-tasksets-WGXGXJ7E.js} +1 -1
  153. package/dist/chunks/human-review-M26UKGJL.js +2 -0
  154. package/dist/chunks/{import-JWZSZCE4.js → import-6SI4BEKS.js} +2 -2
  155. package/dist/chunks/learning-HM3NWOV5.js +2 -0
  156. package/dist/chunks/local-harness-improvement-runtime-QGWFWNSR.js +2 -0
  157. package/dist/chunks/local-harness-taskset-review-KS4WPMN6.js +2 -0
  158. package/dist/chunks/model-projects-YUAMBQTO.js +2 -0
  159. package/dist/chunks/opchat-AG4CWVY4.js +3 -0
  160. package/dist/chunks/opchat-bounded-chat-IQMP5IIO.js +2 -0
  161. package/dist/chunks/organizations-KDKX77XZ.js +2 -0
  162. package/dist/chunks/{profile-ELE2D7HU.js → profile-O5HL5DTQ.js} +1 -1
  163. package/dist/chunks/project-action-payload-QA24HYGF.js +2 -0
  164. package/dist/chunks/project-agent-XBOOM5TS.js +2 -0
  165. package/dist/chunks/published-experiment-source-GZGN354O.js +2 -0
  166. package/dist/chunks/refiner-profile-service-BJMOYKTC.js +2 -0
  167. package/dist/chunks/{runtime-776NUSE7.js → runtime-XBA744HJ.js} +2 -2
  168. package/dist/chunks/sandbox-command-5ECGS7DG.js +2 -0
  169. package/dist/chunks/{sandbox-template-WP6YCGBK.js → sandbox-template-27U3FQN7.js} +1 -1
  170. package/dist/chunks/saved-work-KUNVTJ7O.js +2 -0
  171. package/dist/chunks/{send-turn-RPB65PME.js → send-turn-FIPWOXWV.js} +1 -1
  172. package/dist/chunks/src-BLWX6DRG.js +424 -0
  173. package/dist/chunks/{src-2R4CMCJ5.js → src-PU7QTFO5.js} +1 -1
  174. package/dist/chunks/standalone-experiment-turn-owner-XIE46VNH.js +2 -0
  175. package/dist/chunks/store-chat-resources-YOEJ2BI6.js +2 -0
  176. package/dist/chunks/{store-continual-support-reviews-R62D2HD6.js → store-continual-support-reviews-FOMYYS25.js} +1 -1
  177. package/dist/chunks/{store-conversation-serving-25O7BAR2.js → store-conversation-serving-K324SQTO.js} +1 -1
  178. package/dist/chunks/{store-create-improve-T5E2GUKK.js → store-create-improve-3LQMIYAP.js} +1 -1
  179. package/dist/chunks/{store-datasets-5Y4U5L3R.js → store-datasets-3KSX7RSO.js} +1 -1
  180. package/dist/chunks/store-evaluation-results-LHCCNNE6.js +7 -0
  181. package/dist/chunks/{store-harness-evaluation-review-settings-I2R3HPO3.js → store-harness-evaluation-review-settings-AAN7KKJ5.js} +1 -1
  182. package/dist/chunks/{store-harness-refinement-candidates-SUT45FQX.js → store-harness-refinement-candidates-3PHL3BUY.js} +1 -1
  183. package/dist/chunks/store-harness-workspaces-ZHNCNWVI.js +2 -0
  184. package/dist/chunks/store-human-review-QJY3ZPPF.js +7 -0
  185. package/dist/chunks/store-learned-preference-migration-validation-X32SRBOM.js +2 -0
  186. package/dist/chunks/{store-learning-MFS4DGQR.js → store-learning-DW3QLQXU.js} +1 -1
  187. package/dist/chunks/{store-learning-credentials-BECWEG2Y.js → store-learning-credentials-67QNTPA7.js} +1 -1
  188. package/dist/chunks/{store-local-experiments-LOH4F4TF.js → store-local-experiments-QTVHJAEP.js} +1 -1
  189. package/dist/chunks/store-model-batch-review-PBYQZJJJ.js +2 -0
  190. package/dist/chunks/store-model-configuration-3SU73CMS.js +3 -0
  191. package/dist/chunks/store-model-project-preparation-TFCG2F2F.js +2 -0
  192. package/dist/chunks/store-ponder-history-WDLMXBIJ.js +2 -0
  193. package/dist/chunks/store-ponder-hosted-DX6E2BVW.js +4 -0
  194. package/dist/chunks/{store-preference-comparison-RNIFLJRW.js → store-preference-comparison-DWV5XSMY.js} +1 -1
  195. package/dist/chunks/{store-schedules-DVQ2PP4F.js → store-schedules-2KUY4T6M.js} +1 -1
  196. package/dist/chunks/{store-sidebar-file-bookmarks-LXWFFYCZ.js → store-sidebar-file-bookmarks-A4XCS7RM.js} +1 -1
  197. package/dist/chunks/{store-sidebar-preferences-4HH7LX6N.js → store-sidebar-preferences-V2PKRXUZ.js} +1 -1
  198. package/dist/chunks/{store-subagents-JLW4GD4Q.js → store-subagents-UGVEFA6M.js} +1 -1
  199. package/dist/chunks/store-task-inbox-QABI4ZAH.js +33 -0
  200. package/dist/chunks/{store-task-inventory-NJXRXFLC.js → store-task-inventory-GEQIZELY.js} +1 -1
  201. package/dist/chunks/store-taskset-drafts-GXABQR5G.js +9 -0
  202. package/dist/chunks/{store-training-VRLU6NFX.js → store-training-CQV7PL3V.js} +1 -1
  203. package/dist/chunks/{store-training-jobs-3ZHG4LGI.js → store-training-jobs-XKN6K66J.js} +18 -10
  204. package/dist/chunks/{store-training-models-KWQD5PRP.js → store-training-models-Q7DTTR4S.js} +1 -1
  205. package/dist/chunks/{store-usage-ZRS3ILF2.js → store-usage-XGAX7NLB.js} +1 -1
  206. package/dist/chunks/{taskset-QDMCQQDJ.js → taskset-ARKJQKYQ.js} +1 -1
  207. package/dist/chunks/taskset-packages-X4K65DTW.js +2 -0
  208. package/dist/chunks/taskset-packages-XK7FSD45.js +2 -0
  209. package/dist/chunks/{teams-bot-GF272RGC.js → teams-bot-UTQAJA6H.js} +1 -1
  210. package/dist/chunks/training-3IWW4256.js +2 -0
  211. package/dist/chunks/{training-DF5UEPY3.js → training-RVIESURJ.js} +1 -1
  212. package/dist/chunks/training-error-2EWDOQ4G.js +2 -0
  213. package/dist/chunks/training-hosted-PFJHYTEU.js +2 -0
  214. package/dist/chunks/training-hosted-checkpoint-evaluation-JJPP7KFW.js +2 -0
  215. package/dist/chunks/training-hosted-feedback-5B2KJGOT.js +2 -0
  216. package/dist/chunks/training-hosted-learning-Y7NHRY4V.js +2 -0
  217. package/dist/chunks/training-hosted-report-UVGTPDOK.js +2 -0
  218. package/dist/chunks/training-hosted-serving-report-OX4A5OKB.js +2 -0
  219. package/dist/chunks/training-hosted-workers-LST4ZUXN.js +2 -0
  220. package/dist/chunks/training-model-start-ROLS3E4V.js +2 -0
  221. package/dist/chunks/{web-search-5RUXYIOF.js → web-search-7FBUBZ66.js} +1 -1
  222. package/dist/chunks/{workspaces-JRY2IE7H.js → workspaces-G3CMY7ZA.js} +1 -1
  223. package/dist/cli.js +1 -1
  224. package/dist/index.js +1 -1
  225. package/dist/sandbox/url.d.ts +3 -1
  226. package/dist/skills/LICENSE +21 -0
  227. package/dist/skills/manifest.json +168 -0
  228. package/dist/skills/openpond-agent-authoring/SKILL.md +9 -3
  229. package/dist/skills/openpond-agent-authoring/references/profile-layout.md +1 -1
  230. package/dist/skills/openpond-agent-authoring/references/validation-and-repair.md +2 -2
  231. package/dist/skills/openpond-cli/SKILL.md +11 -7
  232. package/dist/skills/openpond-cli/references/experiments-and-training.md +1 -1
  233. package/dist/skills/openpond-refiner-authoring/SKILL.md +4 -0
  234. package/dist/skills/openpond-skill-authoring/SKILL.md +5 -1
  235. package/dist/web/assets/App-DY2R8Z6r.js +53 -0
  236. package/dist/web/assets/{AppDialog-BurL61qE.js → AppDialog-8Y0FYalT.js} +1 -1
  237. package/dist/web/assets/AppTerminalPanel-YcnBD5DF.js +2 -0
  238. package/dist/web/assets/{AppToastContext-DZLErwj0.js → AppToastContext-BiQbbVxq.js} +1 -1
  239. package/dist/web/assets/AppsView-Dtte4h6e.js +1 -0
  240. package/dist/web/assets/{AttachmentTypeIcon-CpMSfHCK.js → AttachmentTypeIcon-DgADV7dn.js} +1 -1
  241. package/dist/web/assets/BrowserSidebar-BUqDvEv9.js +1 -0
  242. package/dist/web/assets/{CartesianChart-CEbM980A.js → CartesianChart-J4ChOjvG.js} +1 -1
  243. package/dist/web/assets/ChatTimelineEntry-DC93wlDa.js +8 -0
  244. package/dist/web/assets/ChatTimelineEntry-DztFb85D.css +1 -0
  245. package/dist/web/assets/{CollaborationTabs-DrKJmJZK.js → CollaborationTabs-CFCpk2Ck.js} +1 -1
  246. package/dist/web/assets/CommandMenu-EPPjB14H.js +1 -0
  247. package/dist/web/assets/{CommunityView-BzpIq1lD.js → CommunityView-Okydjpqm.js} +1 -1
  248. package/dist/web/assets/ComposerAttachments-RXCiE88M.js +2 -0
  249. package/dist/web/assets/{ComposerCreateImproveStrip-ChplO9YP.js → ComposerCreateImproveStrip-CSngc8-V.js} +1 -1
  250. package/dist/web/assets/{ConversationImportsSettings-DRHgc7j_.js → ConversationImportsSettings-DS73kyfj.js} +1 -1
  251. package/dist/web/assets/FilePagePreview-Qc4B0vue.js +2 -0
  252. package/dist/web/assets/{GetStartedView-CaBk_mX6.js → GetStartedView-DGFPQ1We.js} +1 -1
  253. package/dist/web/assets/{GettingStartedDialog-JtFLyU3F.js → GettingStartedDialog-DFBYQdHz.js} +1 -1
  254. package/dist/web/assets/{HostedModelLearningReview-hhcjDifK.js → HostedModelLearningReview-BDu3FlcU.js} +1 -1
  255. package/dist/web/assets/{HostedModelLearningSettings-CY8198Y1.js → HostedModelLearningSettings-CHaTHwC8.js} +1 -1
  256. package/dist/web/assets/HtmlVisual-C7GlEVfH.css +1 -0
  257. package/dist/web/assets/HtmlVisual-D9Mh7xds.js +81 -0
  258. package/dist/web/assets/LabModelVersionDetailPage-DgY7lAu5.js +1 -0
  259. package/dist/web/assets/{LabSkillSidebar-HibUEEko.js → LabSkillSidebar-BwtlThO7.js} +1 -1
  260. package/dist/web/assets/LabsRoute-BV7ZJGEw.js +101 -0
  261. package/dist/web/assets/MainChatThread-pzHKd_YN.js +2 -0
  262. package/dist/web/assets/MainPane-6OlLiKKb.js +10 -0
  263. package/dist/web/assets/MainPane-Dje-hfUM.css +1 -0
  264. package/dist/web/assets/NativeSetupTerminal-CPDChcMi.js +2 -0
  265. package/dist/web/assets/NativeSkillSidebar-BEJvt5_H.js +1 -0
  266. package/dist/web/assets/{NewProjectDialog-t9Imnb__.js → NewProjectDialog-CjrjgkTN.js} +1 -1
  267. package/dist/web/assets/{OutputsPage-CeGq_F1S.js → OutputsPage-jzx93QQ3.js} +1 -1
  268. package/dist/web/assets/{PageChrome-VHME5V8j.js → PageChrome-C1M13qG2.js} +1 -1
  269. package/dist/web/assets/{ProjectsPage-2TMZoEPB.js → ProjectsPage-DZrjlMp2.js} +1 -1
  270. package/dist/web/assets/RightChatPanelStack-BsxJg9sy.js +1 -0
  271. package/dist/web/assets/RightSidebarHomePanel-CCVQ9LMB.js +1 -0
  272. package/dist/web/assets/ScheduledWorkPage-Cw1ja2GF.js +1 -0
  273. package/dist/web/assets/{SettingsView-Y8f98GSE.css → SettingsView-Cc0376pY.css} +1 -1
  274. package/dist/web/assets/SettingsView-CckoIki3.js +5 -0
  275. package/dist/web/assets/TasksetDraftEditorPrimitives-ByC8bDjp.js +1 -0
  276. package/dist/web/assets/TeamChatView-OprnSKLF.js +1 -0
  277. package/dist/web/assets/{TerminalOverlay-DlhRpi-X.js → TerminalOverlay-d7A2F9Lx.js} +2 -2
  278. package/dist/web/assets/TrainingCreationPanel-Cyn6R6I6.js +1 -0
  279. package/dist/web/assets/{TrainingDraftPanel-BhhZPPuY.js → TrainingDraftPanel-Mpb5e7t5.js} +1 -1
  280. package/dist/web/assets/TrainingRunLineage-PXzWR65d.css +1 -0
  281. package/dist/web/assets/TrainingRunLineage-VcKz7dIR.js +1 -0
  282. package/dist/web/assets/{UsageSettingsSection-DTZslBeW.js → UsageSettingsSection-FhYymrfc.js} +2 -2
  283. package/dist/web/assets/WorkSidebarPanel-u87uptH0.js +1 -0
  284. package/dist/web/assets/WorkspaceDiffPanel-B5rlW7bA.js +11 -0
  285. package/dist/web/assets/WorkspaceEnvironmentMenu-C8y3537a.js +35 -0
  286. package/dist/web/assets/{WorkspaceFileLocation-ChEeZffU.js → WorkspaceFileLocation-LrEWj4UK.js} +1 -1
  287. package/dist/web/assets/{WorkspaceGitDialogs-D_RUXhTi.js → WorkspaceGitDialogs-NRIMXnkS.js} +1 -1
  288. package/dist/web/assets/{WorkspaceMonacoEditor-BJxaiDrj.js → WorkspaceMonacoEditor-CvDGjKAL.js} +3 -3
  289. package/dist/web/assets/WorkspacePdfPreview-BZ0BbnHv.js +2 -0
  290. package/dist/web/assets/{WorkspacePresentationPreview-A28Poeca.js → WorkspacePresentationPreview-DJrjrvT0.js} +1 -1
  291. package/dist/web/assets/app-models-CUA9XB9U.js +1 -0
  292. package/dist/web/assets/bot-6OhUEmkE.js +1 -0
  293. package/dist/web/assets/browser-sidebar-links-ZyYiYBBd.js +1 -0
  294. package/dist/web/assets/chat-resources-CI8KFVO5.js +1 -0
  295. package/dist/web/assets/{chevron-down-dYn0pd4Q.js → chevron-down-jmVA1BIf.js} +1 -1
  296. package/dist/web/assets/chevron-right-BYmDQ7ti.js +1 -0
  297. package/dist/web/assets/chevron-up-CstyLXH3.js +1 -0
  298. package/dist/web/assets/{chunk-ZFYI4P6C-BmsNtSkR.js → chunk-ONGOAEY6-C__DQmRT.js} +5 -5
  299. package/dist/web/assets/{chunk-BYNVSWIQ-DWh9SmdB.js → chunk-SQBYHWZU-DumrB9SB.js} +1 -1
  300. package/dist/web/assets/{client-choice-storage-DTTLbrYt.js → client-choice-storage-BdQ_YDuk.js} +1 -1
  301. package/dist/web/assets/{cloud-upload-CRMPCFnq.js → cloud-upload-Ck1ufAr8.js} +1 -1
  302. package/dist/web/assets/contracts-BLiqJxBv.js +1 -0
  303. package/dist/web/assets/{copy-DR4ielPn.js → copy-CPkbMfXt.js} +1 -1
  304. package/dist/web/assets/{createLucideIcon-DmttVQ_a.js → createLucideIcon-CXQny8HU.js} +1 -1
  305. package/dist/web/assets/{cssMode-d-2GuNvW.js → cssMode-CYxYl_om.js} +1 -1
  306. package/dist/web/assets/{external-link-B4rPiZEp.js → external-link-CDKOLG_v.js} +1 -1
  307. package/dist/web/assets/{folder-open-BrIUcUk_.js → folder-open-CEtOb_lK.js} +1 -1
  308. package/dist/web/assets/{folder-plus-DwImGEt-.js → folder-plus-CVMYZs3e.js} +1 -1
  309. package/dist/web/assets/{git-commit-horizontal-Ds1mkrlW.js → git-commit-horizontal-DDyhPjxS.js} +1 -1
  310. package/dist/web/assets/{htmlMode-s15GR0Fn.js → htmlMode-DoY4V_j0.js} +1 -1
  311. package/dist/web/assets/icons-D7jkCa2d.js +1 -0
  312. package/dist/web/assets/{image-CY-sHbfQ.js → image-B-PjDSwU.js} +1 -1
  313. package/dist/web/assets/{index-DYrLeSyY.js → index-D9WbJMSq.js} +2 -2
  314. package/dist/web/assets/index-g7UqJhnX.css +1 -0
  315. package/dist/web/assets/{info-aSvM8YlJ.js → info-CCnw-K3b.js} +1 -1
  316. package/dist/web/assets/intake-contracts-BW0Y0C2R.js +1 -0
  317. package/dist/web/assets/{jsonMode-vos9H2hz.js → jsonMode-CeOpZdPj.js} +1 -1
  318. package/dist/web/assets/loader-circle-CPaJeTDy.js +1 -0
  319. package/dist/web/assets/{lspLanguageFeatures-pQmEaoMt.js → lspLanguageFeatures-DAbgLCqZ.js} +1 -1
  320. package/dist/web/assets/{maximize-2-DgF6ZVOM.js → maximize-2-BZX38cpr.js} +1 -1
  321. package/dist/web/assets/message-square-CvgSecgD.js +1 -0
  322. package/dist/web/assets/{monaco.contribution-BPwsKvRB.js → monaco.contribution-CF2JDhi4.js} +2 -2
  323. package/dist/web/assets/{monaco.contribution-CJlccVX3.js → monaco.contribution-cbDqt48m.js} +2 -2
  324. package/dist/web/assets/{monaco.contribution-BbMpa0_-.js → monaco.contribution-m2ze2EsL.js} +2 -2
  325. package/dist/web/assets/{monaco.contribution-pWurLXbm.js → monaco.contribution-yeyow_-Q.js} +2 -2
  326. package/dist/web/assets/{monitor-DlEV241C.js → monitor-By0s4hxb.js} +1 -1
  327. package/dist/web/assets/{paperclip-fnRZSIRc.js → paperclip-BJ2QgJLa.js} +1 -1
  328. package/dist/web/assets/{pdf-CT3zVKCE.js → pdf-C4x-1jjP.js} +1 -1
  329. package/dist/web/assets/pdf.worker.min-BrEVksTu.js +1 -0
  330. package/dist/web/assets/play-D_SuGDBM.js +1 -0
  331. package/dist/web/assets/plus-yw95Iaj8.js +1 -0
  332. package/dist/web/assets/{presentation-Bb8ecExR.js → presentation-I86G1Gd9.js} +1 -1
  333. package/dist/web/assets/{python-DXA1xp0A.js → python-CqFTPj8r.js} +1 -1
  334. package/dist/web/assets/{refresh-cw-B53QjxMO.js → refresh-cw-Dga35Eay.js} +1 -1
  335. package/dist/web/assets/requests-BCbaFiqV.js +1 -0
  336. package/dist/web/assets/{reward-checks-5AOStF27.js → reward-checks-Bcq9ETCA.js} +1 -1
  337. package/dist/web/assets/{save-V1Q4Fcqa.js → save-BLKjYtzR.js} +1 -1
  338. package/dist/web/assets/settings-D7C-Auyi.js +21 -0
  339. package/dist/web/assets/{settings-lists-CtH1A57b.js → settings-lists-DMKA1lCN.js} +5 -5
  340. package/dist/web/assets/square-BY5lG2Ol.js +1 -0
  341. package/dist/web/assets/{square-terminal-Dmgkm5zY.js → square-terminal-B-n7vUex.js} +1 -1
  342. package/dist/web/assets/submit-issue-command-B7Hrt2tU.js +3 -0
  343. package/dist/web/assets/{toggleHighContrast-B-BD2K2Q.js → toggleHighContrast-BhmBE5XE.js} +1 -1
  344. package/dist/web/assets/training-QrdkRQZQ.js +2 -0
  345. package/dist/web/assets/{training-model-data-14942K_Z.js → training-model-data-DB-jg6L_.js} +12 -12
  346. package/dist/web/assets/{tsMode-DdgIcxK3.js → tsMode-BSWEII2p.js} +1 -1
  347. package/dist/web/assets/{upload-82Y6RjLi.js → upload-C4MPhQn8.js} +1 -1
  348. package/dist/web/assets/{useAccountSettings-BgHXNpq_.js → useAccountSettings-9oqWdRLs.js} +1 -1
  349. package/dist/web/assets/useAgentInventory-isO79ui9.js +1 -0
  350. package/dist/web/assets/{useLocalAgentSchedules-CsKv22Hs.js → useLocalAgentSchedules-CZX6PxoK.js} +1 -1
  351. package/dist/web/assets/{useQuery-CPC2wsWm.js → useQuery-BD0Uexmh.js} +1 -1
  352. package/dist/web/assets/{wifi-off-DXOoDN9l.js → wifi-off-Cloe0WuQ.js} +1 -1
  353. package/dist/web/assets/{workers-Clf4hKt5.js → workers-BXagz5eg.js} +1 -1
  354. package/dist/web/assets/x-Dqpel42h.js +1 -0
  355. package/dist/web/assets/{yaml-I1tf8Uxx.js → yaml-sBdvVbCc.js} +1 -1
  356. package/dist/web/index.html +2 -2
  357. package/docs/command-reference.md +22 -4
  358. package/package.json +5 -2
  359. package/dist/chunks/actions-command-6LF4Z4WK.js +0 -2
  360. package/dist/chunks/app-server-connected-apps-3T546FE7.js +0 -2
  361. package/dist/chunks/app-server-evaluations-TXD747QA.js +0 -2
  362. package/dist/chunks/app-server-harness-services-BBCDV5P3.js +0 -2
  363. package/dist/chunks/app-server-runtime-VEJPDAFP.js +0 -2
  364. package/dist/chunks/apps-CTT2XYRR.js +0 -2
  365. package/dist/chunks/chunk-4M3YW3EQ.js +0 -13
  366. package/dist/chunks/chunk-4U2FNXQW.js +0 -2
  367. package/dist/chunks/chunk-547AUVKN.js +0 -2
  368. package/dist/chunks/chunk-557YG77L.js +0 -2
  369. package/dist/chunks/chunk-7KTARW23.js +0 -2
  370. package/dist/chunks/chunk-B42QQUZY.js +0 -2
  371. package/dist/chunks/chunk-EWOTDVDJ.js +0 -4
  372. package/dist/chunks/chunk-GAQLXFOT.js +0 -2
  373. package/dist/chunks/chunk-GLDYJM7O.js +0 -1
  374. package/dist/chunks/chunk-HKV7RX5E.js +0 -2
  375. package/dist/chunks/chunk-IWK3RTLR.js +0 -2
  376. package/dist/chunks/chunk-JX6OX6XE.js +0 -12
  377. package/dist/chunks/chunk-JY3YSI54.js +0 -2
  378. package/dist/chunks/chunk-LILXHGIA.js +0 -2
  379. package/dist/chunks/chunk-LJPO3TEL.js +0 -17
  380. package/dist/chunks/chunk-MNFW5WLD.js +0 -6
  381. package/dist/chunks/chunk-N5GPINVP.js +0 -2
  382. package/dist/chunks/chunk-N663LL27.js +0 -2
  383. package/dist/chunks/chunk-NOSBNHGC.js +0 -18
  384. package/dist/chunks/chunk-NR5VASQB.js +0 -2
  385. package/dist/chunks/chunk-O3MHHGC5.js +0 -151
  386. package/dist/chunks/chunk-OZ6LRNRE.js +0 -2
  387. package/dist/chunks/chunk-PGO4FRHU.js +0 -10
  388. package/dist/chunks/chunk-QAVQJZCM.js +0 -2
  389. package/dist/chunks/chunk-RBDUMASL.js +0 -2
  390. package/dist/chunks/chunk-TM4VEMNN.js +0 -2
  391. package/dist/chunks/chunk-TUCKED4T.js +0 -4
  392. package/dist/chunks/chunk-TVTFEGTU.js +0 -2
  393. package/dist/chunks/chunk-TW3SRBLU.js +0 -22
  394. package/dist/chunks/chunk-UT6F6AIB.js +0 -12
  395. package/dist/chunks/chunk-VE6ZIGUQ.js +0 -2
  396. package/dist/chunks/chunk-VI32G77S.js +0 -2
  397. package/dist/chunks/chunk-VWRTE64Y.js +0 -2
  398. package/dist/chunks/chunk-XSB3T4JZ.js +0 -5
  399. package/dist/chunks/chunk-XWDFXM3S.js +0 -2
  400. package/dist/chunks/chunk-ZQHPGEYT.js +0 -2
  401. package/dist/chunks/cli-GCSO2OAI.js +0 -2
  402. package/dist/chunks/connected-app-executor-UDE7U4KG.js +0 -2
  403. package/dist/chunks/connected-evidence-GXIY2L7C.js +0 -2
  404. package/dist/chunks/core-commands-NJ6TGND4.js +0 -2
  405. package/dist/chunks/dataset-preparation-authoring-IUXUQK3L.js +0 -4
  406. package/dist/chunks/datasets-AH56DKLZ.js +0 -2
  407. package/dist/chunks/desktop-test-PYUTEOWO.js +0 -3
  408. package/dist/chunks/dist-5267UT3V.js +0 -2
  409. package/dist/chunks/evaluation-coordination-3AUICOC5.js +0 -2
  410. package/dist/chunks/experiment-improvements-YS7GGPDW.js +0 -2
  411. package/dist/chunks/experiments-EJZK7FPT.js +0 -2
  412. package/dist/chunks/experiments-signal-NKUIJCIY.js +0 -2
  413. package/dist/chunks/host-profile-evaluation-tools-CTC5JQPD.js +0 -2
  414. package/dist/chunks/host-profile-external-dataset-GJWDY3YT.js +0 -2
  415. package/dist/chunks/hosted-app-server-composition-TLJSKMJT.js +0 -2
  416. package/dist/chunks/hosted-experiment-improvement-TIVXXRPG.js +0 -3
  417. package/dist/chunks/hosted-harness-runtime-SFLJEZFI.js +0 -2
  418. package/dist/chunks/hosted-profile-candidate-DKEMVIYG.js +0 -3
  419. package/dist/chunks/hosted-profile-compiler-V6YR6EHO.js +0 -2
  420. package/dist/chunks/hosted-profile-evaluation-control-ERCXAPZD.js +0 -2
  421. package/dist/chunks/hosted-profile-evaluation-inspection-Q3AIIIB6.js +0 -3
  422. package/dist/chunks/hosted-profile-evaluation-preparation-ELLGH44Z.js +0 -3
  423. package/dist/chunks/human-review-5WM6MSON.js +0 -2
  424. package/dist/chunks/learning-KVLTMRLD.js +0 -2
  425. package/dist/chunks/local-harness-improvement-runtime-IGIKM6GJ.js +0 -2
  426. package/dist/chunks/local-harness-taskset-review-DR2ZIDOH.js +0 -2
  427. package/dist/chunks/model-projects-H22KENI4.js +0 -2
  428. package/dist/chunks/opchat-3S6TSDZO.js +0 -3
  429. package/dist/chunks/opchat-bounded-chat-B7LPCD4U.js +0 -2
  430. package/dist/chunks/organizations-62YNTZTO.js +0 -2
  431. package/dist/chunks/project-action-payload-32F4X2BB.js +0 -2
  432. package/dist/chunks/project-agent-O4REKO6T.js +0 -2
  433. package/dist/chunks/published-experiment-source-DAOTJLIN.js +0 -2
  434. package/dist/chunks/refiner-profile-service-DYMZ7J3X.js +0 -2
  435. package/dist/chunks/sandbox-command-UQ26NDIX.js +0 -2
  436. package/dist/chunks/saved-work-PG52WCRQ.js +0 -2
  437. package/dist/chunks/src-AU6LG7E6.js +0 -421
  438. package/dist/chunks/standalone-experiment-turn-owner-SD3SUTKX.js +0 -2
  439. package/dist/chunks/store-chat-resources-T4LR7K25.js +0 -2
  440. package/dist/chunks/store-evaluation-results-WUVJWCFU.js +0 -7
  441. package/dist/chunks/store-harness-workspaces-IFEFY5CK.js +0 -2
  442. package/dist/chunks/store-human-review-ZQNLZRGG.js +0 -7
  443. package/dist/chunks/store-learned-preference-migration-validation-UH6MJQSH.js +0 -2
  444. package/dist/chunks/store-model-batch-review-QO4VVKWC.js +0 -2
  445. package/dist/chunks/store-model-configuration-C3HSOFD5.js +0 -3
  446. package/dist/chunks/store-model-project-preparation-RQ2YTC2Y.js +0 -2
  447. package/dist/chunks/store-task-inbox-DL5RYFPO.js +0 -33
  448. package/dist/chunks/store-taskset-drafts-UFGN4SGF.js +0 -9
  449. package/dist/chunks/taskset-packages-CBLJFWDQ.js +0 -2
  450. package/dist/chunks/training-error-L5V5IBX3.js +0 -2
  451. package/dist/chunks/training-hosted-I2NDBYGS.js +0 -2
  452. package/dist/chunks/training-hosted-report-4F25RZZ4.js +0 -2
  453. package/dist/chunks/training-hosted-workers-KI767T4Y.js +0 -2
  454. package/dist/skills/openpond-desktop-harness/SKILL.md +0 -113
  455. package/dist/skills/openpond-desktop-harness/agents/openai.yaml +0 -4
  456. package/dist/web/assets/App-DHJVXTI2.js +0 -54
  457. package/dist/web/assets/AppTerminalPanel-RjFlF-a4.js +0 -2
  458. package/dist/web/assets/AppsView-ttlr9ckQ.js +0 -1
  459. package/dist/web/assets/BrowserSidebar-Cp2l0kg0.js +0 -1
  460. package/dist/web/assets/ChatTimelineEntry-BITv20Ze.js +0 -1
  461. package/dist/web/assets/CommandMenu-6oj8FUr6.js +0 -1
  462. package/dist/web/assets/ComposerAttachments-6en7m_ov.js +0 -2
  463. package/dist/web/assets/FilePagePreview-CW4J_1u7.js +0 -2
  464. package/dist/web/assets/LabModelVersionDetailPage-f0tHT-Sn.js +0 -1
  465. package/dist/web/assets/LabsRoute-B61l1b8P.js +0 -101
  466. package/dist/web/assets/MainChatThread-egKi0gLk.js +0 -2
  467. package/dist/web/assets/MainPane-2dj6Dg4l.js +0 -95
  468. package/dist/web/assets/MainPane-BwHw3UYp.css +0 -1
  469. package/dist/web/assets/NativeSetupTerminal-CNHTByLo.js +0 -2
  470. package/dist/web/assets/NativeSkillSidebar-DCdMbSfe.js +0 -1
  471. package/dist/web/assets/RightChatPanelStack-B3mBViGC.js +0 -1
  472. package/dist/web/assets/RightSidebarHomePanel-CxDYSyyx.js +0 -1
  473. package/dist/web/assets/ScheduledWorkPage-Dh47iH11.js +0 -1
  474. package/dist/web/assets/SettingsView-D2bu3tK_.js +0 -5
  475. package/dist/web/assets/TeamChatView-CN17AsgA.js +0 -1
  476. package/dist/web/assets/TrainingCreationPanel-DJKzaNFj.js +0 -1
  477. package/dist/web/assets/TrainingMetricWorkbench-DBy8F1xp.js +0 -1
  478. package/dist/web/assets/WorkSidebarPanel-Ds-eTQLs.js +0 -1
  479. package/dist/web/assets/WorkspaceDiffPanel-D_iyg2D4.js +0 -11
  480. package/dist/web/assets/WorkspaceEnvironmentMenu-Fn-NlfMQ.js +0 -35
  481. package/dist/web/assets/app-models-BviS9b7U.js +0 -1
  482. package/dist/web/assets/browser-sidebar-links-ujSvTf5h.js +0 -1
  483. package/dist/web/assets/chat-resources-3SvnVeKv.js +0 -1
  484. package/dist/web/assets/chevron-right-sFx2xRvT.js +0 -1
  485. package/dist/web/assets/contracts-BHTOD1nd.js +0 -1
  486. package/dist/web/assets/icons-CK5-nxVC.js +0 -1
  487. package/dist/web/assets/index-Dezj4Z2p.css +0 -1
  488. package/dist/web/assets/loader-circle-cyf35w3i.js +0 -1
  489. package/dist/web/assets/play-wI_3FLr4.js +0 -1
  490. package/dist/web/assets/plus-DoJe4fLj.js +0 -1
  491. package/dist/web/assets/settings-BKmRueaw.js +0 -21
  492. package/dist/web/assets/square-BqSK-hv9.js +0 -1
  493. package/dist/web/assets/submit-issue-command-DRgUboVW.js +0 -3
  494. package/dist/web/assets/training-managed-adapter-BXNwgd3P.js +0 -1
  495. package/dist/web/assets/useAgentInventory-B-LNn3up.js +0 -1
  496. package/dist/web/assets/x-IPhrr4ju.js +0 -1
@@ -1,12 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{b as Ne}from"./chunk-SYUKES6H.js";import{a as N,b as W,c as Te,d as ze,e as U,f as ie,i as de,o as Le,q as ce}from"./chunk-GOIKLFXK.js";import{a as ue}from"./chunk-MNFW5WLD.js";import{k as ae,m as se,n as je}from"./chunk-OQPJ7FJF.js";import{c as _e}from"./chunk-P74RR2GB.js";import{Za as L}from"./chunk-PGO4FRHU.js";import{f as G,m as f,n as $e}from"./chunk-VNJAAYNQ.js";import{a as re,b as oe}from"./chunk-5ZBLCWEJ.js";import{a as Oe}from"./chunk-XWDFXM3S.js";import{b as Ce,c as Pe,f as Ee}from"./chunk-YBNKGA5C.js";import{e as K,f as Re}from"./chunk-LV3CQ72P.js";import{b as z}from"./chunk-JCLTFDVW.js";import{k as Ue}from"./chunk-4M3YW3EQ.js";import{Ba as Ae,Hb as qe,Na as ke}from"./chunk-PBZCXPPC.js";import{A as o}from"./chunk-PF56N7ZY.js";import{a as d}from"./chunk-FTQLQJQV.js";var jt=3e4,_t=8*1024*1024,Bn={timeoutMs:900*1e3,maxResponseBytes:64*1024*1024},Be=class extends Error{static{d(this,"ApiTimeoutError")}timeoutMs;requestUrl;code="OPENPOND_API_TIMEOUT";constructor(t,e){super(`API request timed out after ${t}ms: ${e}`),this.timeoutMs=t,this.requestUrl=e,this.name="ApiTimeoutError"}},pe=class extends Error{static{d(this,"ApiResponseTooLargeError")}maximumBytes;requestUrl;code="OPENPOND_API_RESPONSE_TOO_LARGE";constructor(t,e){super(`API response exceeded ${t} bytes: ${e}`),this.maximumBytes=t,this.requestUrl=e,this.name="ApiResponseTooLargeError"}},He=class extends Error{static{d(this,"OpenPondApiError")}status;apiMessage;code;constructor(t,e,n,r=null){let a=r||e;super(`${n} failed: ${t}${a?` ${a}`:""}`),this.status=t,this.apiMessage=r,this.name="OpenPondApiError",this.code=e||"OPENPOND_API_ERROR"}};async function X(t,e,n,r={}){let{timeoutMs:a=jt,maxResponseBytes:s=_t,explicitBearerAuth:i=!1,...u}=r,c=`${t}${n}`,p=new Headers(u.headers);p.set("Content-Type","application/json");let b=i?void 0:process.env.OPENPOND_API_KEY,l=e?.trim()||"",g=!i&&l.startsWith("opk_"),P=b||(g?l:null);P&&!p.has("openpond-api-key")&&p.set("openpond-api-key",P),e?p.set("Authorization",g?`ApiKey ${l}`:`Bearer ${e}`):b&&!p.has("Authorization")&&p.set("Authorization",`ApiKey ${b}`);let T=new AbortController,q=new Be(a,c),j=a>0?setTimeout(()=>T.abort(q),a):null;j?.unref?.();let ne=zt(u.signal,T.signal,a),J=d(()=>{j&&clearTimeout(j)},"cleanup");try{let R=await fetch(c,{...u,headers:p,signal:ne});return Tt(R,{cleanup:J,maximumBytes:s,requestUrl:c,timeoutController:T,timeoutError:q})}catch(R){throw J(),T.signal.aborted?q:R}}d(X,"apiFetch");async function me(t,e){let n;try{let r=await t.text();n=r?JSON.parse(r):{}}catch(r){if(r instanceof Be||r instanceof pe)throw r;n={}}if(!t.ok){let r=typeof n.error=="string"?n.error:null,a=typeof n.message=="string"?n.message:null;throw new He(t.status,r,e,a)}return n}d(me,"readApiJson");function Tt(t,e){if(!t.body)return e.cleanup(),t;let n=Number(t.headers.get("content-length"));if(e.maximumBytes>0&&Number.isFinite(n)&&n>e.maximumBytes)throw e.cleanup(),t.body.cancel(),new pe(e.maximumBytes,e.requestUrl);let r=t.body.getReader(),a=0,s=new ReadableStream({async pull(i){try{let u=await r.read();if(u.done){e.cleanup(),i.close();return}if(a+=u.value.byteLength,e.maximumBytes>0&&a>e.maximumBytes){e.cleanup(),await r.cancel(),i.error(new pe(e.maximumBytes,e.requestUrl));return}i.enqueue(u.value)}catch(u){e.cleanup(),i.error(e.timeoutController.signal.aborted?e.timeoutError:u)}},async cancel(i){e.cleanup(),await r.cancel(i)}});return new Response(s,{headers:t.headers,status:t.status,statusText:t.statusText})}d(Tt,"boundedResponse");function zt(t,e,n){return n<=0?t??void 0:t?AbortSignal.any([t,e]):e}d(zt,"composedSignal");var C=o.string().min(1).max(200),_=o.string().regex(/^[a-f0-9]{64}$/),le=o.object({operationId:C,name:o.string().trim().min(1).max(500),projectId:C,dataset:G.extend({revision:o.number().int().positive()}).strict(),caseIds:o.array(C).min(1).max(1e4)}).strict().superRefine((t,e)=>{new Set(t.caseIds).size!==t.caseIds.length&&e.addIssue({code:"custom",message:"Select each case once."})}),Lt=N.extend({inputHash:_,outputHash:_.nullable(),task:Ae,taskHash:_}).strict(),Nt=o.object({schemaVersion:o.literal("openpond.connectedRecordedExecution.v1"),id:C,teamId:C,ownerUserId:C,request:le,manifest:qe,sources:o.array(Lt).min(1).max(1e4),contentHash:_}).strict();function Fe(t){let e=Nt.parse(t),{contentHash:n,...r}=e,{contentHash:a,...s}=e.manifest;if(f(r)!==n||f(s)!==a||e.manifest.teamId!==e.teamId||e.manifest.id!==e.id||e.manifest.operationId!==e.request.operationId||f(e.manifest.dataset)!==f(e.request.dataset)||e.sources.length!==e.request.caseIds.length||e.sources.length!==e.manifest.population.length||e.sources.some((i,u)=>i.taskHash!==f(i.task)||i.task.id!==e.request.caseIds[u]||i.boundaryId!==i.task.id||e.manifest.population[u]?.caseId!==i.boundaryId))throw new Error("Recorded execution identity or population integrity failed.");return e}d(Fe,"verifyConnectedRecordedExecution");var Bt=o.object({projectId:C.optional(),cursor:C.optional(),limit:o.number().int().min(1).max(50).default(20)}).strict(),Ht=o.object({id:C,teamId:C,ownerUserId:C,projectId:C,name:o.string().min(1).max(500),dataset:le.shape.dataset,manifestHash:_,contentHash:_,caseCount:o.number().int().min(1).max(1e4),createdAt:o.string().datetime()}).strict(),Ft=o.object({teamId:C,items:o.array(Ht).max(50),nextCursor:C.nullable()}).strict(),Mt=o.object({datasetId:o.string().trim().min(1).max(240),expectedRevision:o.number().int().positive(),operationId:o.string().trim().min(1).max(240),graders:o.array(ke).min(1).max(100).optional()}).strict().superRefine((t,e)=>{t.graders&&new Set(t.graders.map(n=>n.id)).size!==t.graders.length&&e.addIssue({code:"custom",path:["graders"],message:"Choose one exact revision of each grader."})}),B=o.string().min(1).max(500),k=o.number().int().nonnegative(),Dt=o.object({teamId:B,ownerUserId:B,projectId:B.nullable(),status:o.enum(["active","paused","archived"]),revision:k,state:o.enum(["collecting","pending","attention","paused","archived"]),lastReconciledAt:o.string().datetime().nullable(),lastCapturedAt:o.string().datetime().nullable(),historyDays:o.number().int().positive(),sources:k,tasks:k,datasets:o.array(o.object({datasetId:B,projection:o.enum(["turn","conversation"]),revision:k}).strict()).max(2),latestBatch:o.object({operationId:B,updatedAt:o.string().datetime(),scanned:k,captured:k,unchanged:k,pending:k,failed:k,excluded:k,paused:k,hasMore:o.boolean()}).strict().nullable()}).strict(),h=o.string().min(1).max(500),E=o.string().regex(/^[a-f0-9]{64}$/),Me=o.object({teamId:h,projectId:h.nullable(),status:o.enum(["active","paused","archived"]),revision:o.number().int().nonnegative()}).strict(),Jt=o.object({teamId:h,operationId:h,projectId:h.nullable(),outcomes:o.array(o.object({conversationId:h,state:o.enum(["captured","unchanged","pending","paused","excluded","failed"]),sourceId:h.optional(),snapshotHash:E.optional(),reason:o.string().optional()}).strict()).max(50),nextCursor:h.nullable()}).strict(),Kt=o.object({teamId:h,ref:N,origin:W.shape.source,sessionId:h,projectId:h,capturedAt:o.string().datetime(),unmappedEvidence:o.object({count:o.number().int().nonnegative().max(1e5),contentHash:E}).strict(),evidence:o.object({input:o.array(K),observed:o.array(K),answer:o.json(),boundary:Re}).strict()}).strict(),Gt=o.object({teamId:h,sourceId:h,snapshotHash:E,contentHash:E,count:o.number().int().nonnegative(),offset:o.number().int().nonnegative(),events:o.array(K).max(50),nextOffset:o.number().int().nonnegative().nullable()}).strict(),Wt=o.object({teamId:h,source:U.shape.source,sourceHash:E,previewHash:E,destination:U.shape.destination,issues:o.array(o.object({file:o.string(),message:o.string()}).strict()).max(100),sessions:o.array(o.object({sessionHash:E,sessionId:h,origin:W.shape.source,exporterVersion:o.string().nullable(),eventCount:o.number().int().nonnegative(),boundaries:o.array(o.object({id:h,projection:o.enum(["turn","conversation"]),answer:o.boolean(),process:o.enum(["retained","partial","absent"]),terminal:o.enum(["completed","failed","cancelled","unknown"])}).strict()).max(5001),warnings:o.array(o.string()).max(100),sample:o.array(o.object({role:o.enum(["user","assistant","system","tool"]).nullable(),text:o.string().max(4e3)}).strict()).max(3)}).strict()).max(1e3)}).strict(),De=o.object({teamId:h,operationId:h,requestHash:E,previewHash:E,projectId:h.optional(),state:o.enum(["admitting","publishing","completed","failed"]),outcomes:o.array(o.object({sessionHash:E,sourceId:h,status:o.enum(["imported","already_present"]),datasets:o.array(o.object({datasetId:h,revision:o.number().int().positive(),changed:o.boolean()}).strict()).max(2)}).strict()).max(1e3),error:o.string().optional()}).strict(),Je=class extends Error{static{d(this,"ConnectedEvidenceError")}constructor(t,e,n){super(n),this.status=t,this.code=e,this.name="ConnectedEvidenceError"}status;code},or=class{static{d(this,"ConnectedEvidenceClient")}constructor(t){this.options=t;let e=new URL(t.baseUrl);if(!["http:","https:"].includes(e.protocol)||e.username||e.password||e.search||e.hash||!t.apiKey.trim()||!t.teamId.trim())throw new Error("A clean API origin and workspace credentials are required.");this.baseUrl=e.toString().replace(/\/+$/,"")}options;baseUrl;async capture(t,e){let n=Te.parse(t),r=Jt.parse(await this.request("/capture","POST",n,e));if(this.scope(r.teamId),r.operationId!==n.operationId||r.outcomes.length>n.limit||n.conversationId&&r.outcomes.some(a=>a.conversationId!==n.conversationId))throw new Error("Capture receipt differs from its requested source or operation.");return r}async retainStartingAssets(t,e){let n=Le.parse(t),r=ce(await this.request("/starting-assets","POST",n,e));if(this.scope(r.teamId),r.operationId!==n.operationId||r.requestHash!==f(n)||f(r.source)!==f(n.source)||r.assets.length!==n.proofs.length||r.assets.some((a,s)=>a.path!==n.proofs[s].path))throw new Error("Starting assets differ from the exact source, operation or selected paths.");return r}async startingAssets(t,e){let n=ce(await this.request(`/starting-assets/${encodeURIComponent(h.parse(t))}`,"GET",void 0,e));if(this.scope(n.teamId),n.id!==t)throw new Error("Starting assets identity mismatch.");return n}async list(t={},e){let n=o.object({projectId:h.optional(),cursor:h.optional(),limit:o.number().int().min(1).max(50).default(20)}).strict().parse(t),r=new URLSearchParams(Object.entries(n).filter(([,s])=>s!==void 0).map(([s,i])=>[s,String(i)])),a=o.object({teamId:h,items:o.array(W).max(50),nextCursor:h.nullable()}).strict().parse(await this.request(`?${r}`,"GET",void 0,e));if(this.scope(a.teamId),a.items.length>n.limit||new Set(a.items.map(s=>s.sourceId)).size!==a.items.length||a.nextCursor!==null&&a.nextCursor===n.cursor||n.projectId&&a.items.some(s=>s.projectId!==n.projectId))throw new Error("Connected source page differs from its requested scope.");return a}async read(t,e){let n=N.parse(t),r=Kt.parse(await this.request(`/${encodeURIComponent(n.id)}/cases/${encodeURIComponent(n.boundaryId)}?snapshotHash=${n.snapshotHash}&revisionHash=${n.boundaryRevisionHash}`,"GET",void 0,e));if(this.scope(r.teamId),f(r.ref)!==f(n)||r.evidence.boundary.id!==n.boundaryId||r.evidence.boundary.revisionHash!==n.boundaryRevisionHash||f(r.evidence.input)!==r.evidence.boundary.inputHash||f(r.evidence.observed)!==n.boundaryRevisionHash||r.evidence.boundary.outputHash!==null&&f(r.evidence.answer)!==r.evidence.boundary.outputHash)throw new Error("Connected case readback differs from its exact snapshot or cutoff.");return r}async setCollection(t,e){let n=Me.parse(await this.request("/collection","PUT",o.object({paused:o.boolean()}).strict().parse({paused:t}),e));return this.scope(n.teamId),n}async collection(t){let e=Me.parse(await this.request("/collection","GET",void 0,t));return this.scope(e.teamId),e}async collectionStatus(t){let e=Dt.parse(await this.request("/collection/status","GET",void 0,t));return this.scope(e.teamId),e}async unmappedEvents(t,e){let n=o.object({id:h,snapshotHash:E,contentHash:E,offset:o.number().int().nonnegative().default(0),limit:o.number().int().min(1).max(50).default(20)}).strict().parse(t),r=Gt.parse(await this.request(`/${encodeURIComponent(n.id)}/unmapped-events?snapshotHash=${n.snapshotHash}&offset=${n.offset}&limit=${n.limit}`,"GET",void 0,e));if(this.scope(r.teamId),r.sourceId!==n.id||r.snapshotHash!==n.snapshotHash||r.contentHash!==n.contentHash||r.offset!==n.offset||r.events.length>n.limit||r.events.some((a,s)=>a.sequence!==n.offset+s)||r.nextOffset!==null&&r.nextOffset!==n.offset+r.events.length)throw new Error("Unmapped source event page differs from its pinned snapshot.");return r}async homeSummary(t,e){let n=o.object({from:o.string().datetime(),to:o.string().datetime(),projectId:h.optional()}).strict(),r=n.parse(t),a=new URLSearchParams(Object.entries(r)),s=o.object({teamId:h,range:n,activity:o.object({conversations:o.number().int().nonnegative(),turns:o.number().int().nonnegative(),chatTurns:o.number().int().nonnegative(),workTurns:o.number().int().nonnegative()}).strict(),accounting:o.object({contextSnapshots:o.number().int().nonnegative()}).strict(),usage:Ee}).strict().parse(await this.request(`/summary?${a}`,"GET",void 0,e));if(this.scope(s.teamId),f(s.range)!==f(r)||s.activity.chatTurns+s.activity.workTurns!==s.activity.turns)throw new Error("Activity summary differs from its requested range.");for(let i of[s.usage.days,s.usage.modes,s.usage.models]){if(new Set(i.map(u=>u.key)).size!==i.length)throw new Error("Duplicate usage summary group.");for(let u of Object.keys(s.usage.total))if(i.reduce((c,p)=>c+p[u],0)!==s.usage.total[u])throw new Error("Usage totals differ from their displayed groups.")}return s}async uploadPart(t,e){let n=ze.parse(t),r=o.object({teamId:h,hash:E,parts:o.number().int(),index:o.number().int()}).strict().parse(await this.request("/imports/upload","POST",n,e));if(this.scope(r.teamId),r.hash!==n.hash||r.parts!==n.parts||r.index!==n.index)throw new Error("Upload receipt differs from its part identity.");return r}async preview(t,e){let n=U.parse(t),r=Wt.parse(await this.request("/imports/preview","POST",n,e));if(this.scope(r.teamId),r.source!==n.source||f(r.destination)!==f(n.destination)||r.sessions.some(a=>a.origin!==n.source)||new Set(r.sessions.map(a=>a.sessionHash)).size!==r.sessions.length)throw new Error("Import preview differs from its source or destination.");return r}async commit(t,e){let n=ie.parse(t),r=De.parse(await this.request("/imports/commit","POST",n,e));if(this.scope(r.teamId),r.operationId!==n.operationId||r.previewHash!==n.previewHash||r.requestHash!==f(n)||r.outcomes.some(a=>!n.selection.some(s=>s.sessionHash===a.sessionHash))||r.state==="completed"&&r.outcomes.length!==n.selection.length)throw new Error("Import receipt differs from its exact selection or operation.");return r}async readImport(t,e){let n=h.parse(t),r=De.parse(await this.request(`/imports/${encodeURIComponent(n)}`,"GET",void 0,e));if(this.scope(r.teamId),r.operationId!==n)throw new Error("Import identity mismatch.");return r}async prepareRecorded(t,e){let n=le.parse(t),r=Fe(await this.request("/recorded-executions","POST",n,e));if(this.scope(r.teamId),f(r.request)!==f(n))throw new Error("Recorded admission differs from its selected Dataset/cases.");return r}async listRecordedExecutions(t={},e){let n=Bt.parse(t),r=new URLSearchParams(Object.entries(n).filter(([,s])=>s!==void 0).map(([s,i])=>[s,String(i)])),a=Ft.parse(await this.request(`/recorded-executions?${r}`,"GET",void 0,e));if(this.scope(a.teamId),a.items.length>n.limit||a.items.some((s,i)=>s.teamId!==a.teamId||n.projectId&&s.projectId!==n.projectId||n.cursor&&s.id<=n.cursor||i>0&&s.id<=a.items[i-1].id)||a.items.some(s=>s.ownerUserId!==a.items[0]?.ownerUserId)||a.nextCursor!==null&&(n.cursor!==void 0&&a.nextCursor<=n.cursor||a.items.length>0&&a.nextCursor<a.items.at(-1).id))throw new Error("Recorded execution page differs from its requested scope or cursor.");return a}async recordedExecution(t,e){let n=Fe(await this.request(`/recorded-executions/${encodeURIComponent(h.parse(t))}`,"GET",void 0,e));if(this.scope(n.teamId),n.id!==t)throw new Error("Recorded execution identity mismatch.");return n}async publishDataset(t,e){let n=Mt.parse(t),r=de.parse(await this.request("/datasets/publish","POST",n,e));this.scope(r.teamId);let a=r.workspace.draft.metadata.connectedPublication;if(r.datasetId!==n.datasetId||!r.publication||!a||typeof a!="object"||!("requestHash"in a)||a.requestHash!==f(n))throw new Error("Published Dataset identity or original selection mismatch.");return r}async createSelection(t,e){let n=o.object({operationId:h.max(240),projectId:h.max(240),name:o.string().trim().min(1).max(200),cases:o.array(N).min(1).max(500)}).strict().parse(t),r=de.parse(await this.request("/datasets/selection","POST",n,e));if(this.scope(r.teamId),r.originProjectId!==n.projectId||r.workspace.draft.tasks.length!==n.cases.length||r.workspace.draft.tasks.some((a,s)=>f(a.input&&typeof a.input=="object"&&!Array.isArray(a.input)?a.input.connectedEvidenceRef:null)!==f(n.cases[s])))throw new Error("Selected Dataset differs from its exact source population.");return r}scope(t){if(t!==this.options.teamId)throw new Error("Connected evidence workspace mismatch.")}async request(t,e,n,r){let{response:a,value:s}=await _e(this.options.fetch??fetch,`${this.baseUrl}/v1/connected-evidence${t}`,{method:e,signal:r,redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"X-OpenPond-Team-Id":this.options.teamId,"Content-Type":"application/json",Accept:"application/json"},...n===void 0?{}:{body:JSON.stringify(n)}},(i,u,c)=>new Je(i,u,c));if(!a.ok){let i=o.object({code:o.string(),message:o.string()}).safeParse(s);throw new Je(a.status,i.success?i.data.code:"connected_request_failed",i.success?i.data.message:"Connected evidence request failed.")}return s}},I=o.string().trim().min(1).max(240),ir=o.object({id:I,expectedRevision:o.number().int().positive(),manifest:Ce}).strict().refine(t=>t.id===t.manifest.connectionId&&t.expectedRevision===t.manifest.connectionRevision,"Collector coverage scope differs from its connection."),dr=o.object({id:I,cutoff:o.iso.datetime().optional()}).strict(),cr=o.object({schemaVersion:o.literal("openpond.connectedSyncCoverageReceipt.v1"),id:I,teamId:I,ownerUserId:I,connectionId:I,connectionRevision:o.number().int().positive(),receivedAt:o.iso.datetime(),summary:Pe}).strict(),ur=o.object({id:I,source:U.shape.source,machineId:I,sourceInstanceId:I,sourceLabel:o.string().trim().min(1).max(200),sourceRoot:o.string().min(1).max(2e3),destination:U.shape.destination,since:o.string().datetime().nullable(),keepSyncing:o.boolean(),expectedRevision:o.number().int().nonnegative()}).strict(),pr=o.object({id:I,expectedRevision:o.number().int().positive(),action:o.enum(["pause","resume","disconnect"])}).strict(),mr=o.object({id:I,operationId:I,expectedRevision:o.number().int().positive()}).strict(),lr=o.object({id:I,expectedRevision:o.number().int().positive(),pendingOperations:o.number().int().min(0).max(1e4),error:o.string().max(500).nullable(),completedSyncRevision:o.number().int().nonnegative().default(0)}).strict(),hr=o.object({teamId:I,id:I,revision:o.number().int().positive(),source:U.shape.source,sourceLabel:o.string(),sourceRoot:o.string(),taskDatasetId:I.nullable(),conversationDatasetId:I.nullable(),machineId:I,sourceInstanceId:I,projectId:I,datasetIds:o.array(I).max(2),since:o.string().datetime().nullable(),keepSyncing:o.boolean(),state:o.enum(["active","paused","disconnected"]),health:o.enum(["online","offline"]),lastHeartbeatAt:o.string().datetime().nullable(),lastAdmissionAt:o.string().datetime().nullable(),pendingOperations:o.number().int().nonnegative(),admittedTasks:o.number().int().nonnegative(),error:o.string().nullable(),requestedSyncRevision:o.number().int().nonnegative().default(0),completedSyncRevision:o.number().int().nonnegative().default(0),syncRequestedAt:o.string().datetime().nullable().default(null),syncCompletedAt:o.string().datetime().nullable().default(null)}).strict().refine(t=>t.completedSyncRevision<=t.requestedSyncRevision&&t.requestedSyncRevision<=t.revision,"Invalid sync acknowledgement generation."),fr=o.object({connectionId:I,expectedRevision:o.number().int().positive(),request:ie}).strict();function vr(t){let e=d(r=>`/v1/training/candidate-evaluations/${encodeURIComponent(r)}`,"path");function n(r,a,s){let i=Yt.parse(r);if(i.teamId!==a||s&&i.id!==s)throw new Error("The preparation belongs to another workspace or candidate operation.");return i}return d(n,"read"),{async options(r,a={}){let s=new URLSearchParams({teamId:r,...a}),i=Vt.parse(await t(`/v1/training/candidates?${s}`));if(i.teamId!==r)throw new Error("The candidate catalog belongs to another workspace.");return i},async save(r){let a=Ge.parse(r),s=n(await t(`/v1/training/candidate-evaluations?teamId=${encodeURIComponent(a.teamId)}`,{method:"POST",body:JSON.stringify(a)}),a.teamId);if(s.requestHash!==f(a))throw new Error("The saved preparation differs from the selected candidate or frozen evaluation.");return s},async get(r,a){return n(await t(`${e(a)}?teamId=${encodeURIComponent(r)}`),r,a)},async control(r,a,s,i){let u=Zt.parse(i),c=n(await t(`${e(a)}/${s}?teamId=${encodeURIComponent(r)}`,{method:"POST",body:JSON.stringify(u)}),r,a);if(c.requestHash!==u.requestHash)throw new Error("The command returned a different frozen evaluation.");return c}}}d(vr,"createCandidateEvaluationClient");var S=o.string().trim().min(1).max(200),he=o.string().regex(/^[a-f0-9]{64}$/),Ke=o.object({id:S,contentHash:he}).strict(),Xt=o.object({artifact:Ke,trainingJobId:S,configurationId:S,baseProfileId:S,ready:o.boolean(),reason:o.string().max(1e3).nullable()}).strict(),Vt=o.object({teamId:S,ownerUserId:S,items:o.array(Xt).max(100),nextCursor:S.nullable()}).strict(),Ge=o.object({teamId:S,operationId:S,artifact:Ke,configuration:L}).strict().superRefine((t,e)=>{(t.configuration.request.teamId!==t.teamId||t.configuration.request.policy.kind==="fixture"||t.configuration.request.policy.candidate)&&e.addIssue({code:"custom",message:"Choose one exact model-backed evaluation before preparing the trained version."})}),Yt=o.object({schemaVersion:o.literal("openpond.candidateEvaluationPreparation.v1"),teamId:S,ownerUserId:S,id:S,revision:o.number().int().positive(),requestHash:he,request:Ge,trainingJobId:S,dispatchId:S,lastOperationId:S.nullable(),runtime:o.object({poolId:S,endpointId:S.nullable(),baseProfileId:S,workerImageDigest:o.string().regex(/^sha256:[a-f0-9]{64}$/),modelId:S.nullable()}).strict().nullable(),state:o.enum(["configured","preparing","ready","dispatching","submitted","cleaning","completed","failed","cancelled"]),experimentId:S.nullable(),authorizedAt:o.iso.datetime().nullable(),cancelledAt:o.iso.datetime().nullable(),reason:o.string().max(1e3).nullable(),createdAt:o.iso.datetime(),updatedAt:o.iso.datetime()}).strict().superRefine((t,e)=>{(t.requestHash!==f(t.request)||!t.runtime&&["ready","dispatching","submitted","completed"].includes(t.state))&&e.addIssue({code:"custom",message:"The exact candidate preparation request or runtime changed."})}),Zt=o.object({operationId:S,expectedRevision:o.number().int().positive(),requestHash:he}).strict();var x=o.string().trim().min(1).max(200),H=o.string().regex(/^[a-f0-9]{64}$/),F=o.string().datetime(),We=o.object({operationId:x,id:x.optional(),expectedRevision:o.number().int().nonnegative(),teamId:x,projectId:x.nullable(),enabled:o.boolean(),configuration:L,cadence:o.discriminatedUnion("kind",[o.object({kind:o.literal("interval"),seconds:o.number().int().min(60).max(31536e3)}).strict(),o.object({kind:o.literal("nightly"),calendar:Ue}).strict()]),maximumTotalSpendUsd:o.number().finite().positive().max(1e4),maximumAttempts:o.number().int().min(1).max(20)}).strict().superRefine((t,e)=>{(t.configuration.request.teamId!==t.teamId||(t.configuration.request.project?.id??null)!==t.projectId)&&e.addIssue({code:"custom",message:"The scheduled Experiment must retain its actual workspace and Project."}),t.configuration.maximumCostUsd>t.maximumTotalSpendUsd&&e.addIssue({code:"custom",message:"The run ceiling exceeds the approved cumulative schedule ceiling."})}),Qt=o.object({id:x,scheduledAt:F,coalescedThroughAt:F,coalescedCount:o.number().int().nonnegative(),configurationHash:H,operationId:x,state:o.enum(["reserved","dispatching","running","cleaning","completed","failed","cancelled","uncertain"]),executionId:x.nullable(),attempt:o.number().int().positive(),maximumCostUsd:o.number().finite().positive(),actualSpendUsd:o.number().finite().nonnegative().nullable(),cleanupComplete:o.boolean(),error:o.string().max(4e3).nullable()}).strict(),en=o.object({schemaVersion:o.literal("openpond.experimentEvaluationSchedule.v1"),id:x,revision:o.number().int().positive(),actorId:x,teamId:x,projectId:x.nullable(),operationId:x,requestHash:H,configuration:L,configurationHash:H,cadence:We.shape.cadence,state:o.enum(["scheduled","disabled","blocked"]),nextRunAt:F.nullable(),maximumTotalSpendUsd:o.number().finite().positive(),maximumAttempts:o.number().int().positive(),lastEvaluatedConfigurationHash:H.nullable(),newerUnevaluatedRelease:G.nullable(),fires:o.array(Qt).max(1e4),reason:o.string().max(4e3).nullable(),createdAt:F,updatedAt:F,contentHash:H}).strict();function tn(t){let{operationId:e,request:n,...r}=t,{operationId:a,...s}=n;return f({...r,request:s})}d(tn,"scheduledExperimentHash");function nn(t){let e=en.parse(t);if($e(e,"Scheduled Experiment"),e.configurationHash!==tn(e.configuration)||e.configuration.request.teamId!==e.teamId||(e.configuration.request.project?.id??null)!==e.projectId)throw new Error("Scheduled Experiment immutable authority differs from its recipe.");return e}d(nn,"verifyExperimentEvaluationSchedule");function qr(t){return nn({...t,contentHash:f(t)})}d(qr,"sealExperimentEvaluationSchedule");var rn=o.object({teamId:x,id:x,operationId:x,expectedRevision:o.number().int().positive(),action:o.enum(["cancel_active","retry_active","pause"])}).strict(),Ur=o.discriminatedUnion("operation",[o.object({operation:o.literal("publish"),request:We}).strict(),o.object({operation:o.literal("control"),request:rn}).strict(),o.object({operation:o.literal("read"),id:x}).strict(),o.object({operation:o.literal("list"),cursor:x.optional(),limit:o.number().int().min(1).max(100).default(50)}).strict()]);function on(t){return{list:d((e={})=>t.listSandboxRuntimes(e),"list"),create:d(e=>t.createSandboxRuntime(e),"create"),handle:d((e,n=null)=>t.sandboxRuntime(e,n),"handle"),get:d(e=>t.getSandboxRuntime(e),"get"),createSandbox:d((e,n={},r={})=>t.createSandboxRuntimeSandbox(e,n,r),"createSandbox"),updateStatus:d((e,n)=>t.updateSandboxRuntimeStatus(e,n),"updateStatus"),events:d(e=>t.listSandboxRuntimeEvents(e),"events"),event:d((e,n)=>t.emitSandboxRuntimeEvent(e,n),"event"),checkpoint:d((e,n={})=>t.checkpointSandboxRuntime(e,n),"checkpoint"),promote:d((e,n,r={})=>t.promoteSandboxRuntime(e,n,r),"promote"),preserveSource:d((e,n={},r={})=>t.preserveSandboxRuntimeSource(e,n,r),"preserveSource")}}d(on,"createSandboxRuntimeNamespace");function an(t){return{list:d((e={})=>t.list(e),"list"),create:d(e=>t.create(e),"create"),get:d(e=>t.get(e),"get"),pricing:d(()=>t.pricing(),"pricing"),costs:d((e={})=>t.costs(e),"costs")}}d(an,"createSandboxNamespace");function sn(t){return{list:d(e=>t.listProjects(e),"list"),upsert:d(e=>t.upsertProject(e),"upsert"),upsertGitRemote:d(e=>t.upsertProjectGitRemote(e),"upsertGitRemote"),get:d((e,n)=>t.getProject(e,n),"get"),update:d((e,n)=>t.updateProject(e,n),"update"),sync:d((e,n)=>t.syncProject(e,n),"sync"),ensureGitRemote:d((e,n)=>t.ensureProjectGitRemote(e,n),"ensureGitRemote"),getGitRemote:d((e,n)=>t.ensureProjectGitRemote(e,n),"getGitRemote"),git:d((e,n)=>t.ensureProjectGitRemote(e,n),"git"),uploadSource:d((e,n)=>t.uploadProjectSource(e,n),"uploadSource"),archive:d((e,n)=>t.archiveProject(e,n),"archive")}}d(sn,"createSandboxProjectNamespace");function dn(t){return{get:d(e=>t.getHostedProfile(e),"get"),status:d(e=>t.getHostedProfile(e),"status"),ensureHosted:d(e=>t.ensureHostedProfile(e),"ensureHosted"),push:d(e=>t.pushHostedProfile(e),"push")}}d(dn,"createSandboxProfileNamespace");function cn(t){return{list:d(e=>t.listAgents(e),"list"),upsert:d(e=>t.upsertAgent(e),"upsert"),get:d((e,n)=>t.getAgent(e,n),"get"),update:d((e,n)=>t.updateAgent(e,n),"update"),archive:d((e,n)=>t.archiveAgent(e,n),"archive"),run:d((e,n)=>t.runAgent(e,n),"run"),sourceDeployPlan:d((e,n)=>t.getAgentSourceDeployPlan(e,n),"sourceDeployPlan"),manifestSnapshots:d((e,n)=>t.listAgentManifestSnapshots(e,n),"manifestSnapshots"),requestSourceChecks:d((e,n)=>t.requestAgentSourceChecks(e,n),"requestSourceChecks"),configureSourceSetup:d((e,n)=>t.configureAgentSourceSetup(e,n),"configureSourceSetup"),publishSource:d((e,n)=>t.publishAgentSource(e,n),"publishSource")}}d(cn,"createSandboxAgentNamespace");function un(t,e,n=null){let r=d(async(c={},p={})=>{let b=await t.getSandboxRuntime(e);return b.sandboxId?t.get(b.sandboxId):t.createSandboxRuntimeSandbox(e,c,p).then(l=>l.sandbox)},"currentSandbox"),a=d(async(c={},p={})=>{let b=await t.getSandboxRuntime(e);if(!b.sandboxId)return t.createSandboxRuntimeSandbox(e,c,p).then(g=>g.sandbox);let l=await t.get(b.sandboxId);return l.state==="stopped"?t.start(l.id,p).then(g=>g.sandbox):l.state==="archived"?t.restore(l.id).then(g=>g.sandbox):l.state==="deleted"||l.state==="error"?t.createSandboxRuntimeSandbox(e,c,p).then(g=>g.sandbox):l},"resume");return{id:e,initial:n,get:d(()=>t.getSandboxRuntime(e),"get"),sandbox:r,resume:a,createSandbox:d((c={},p={})=>t.createSandboxRuntimeSandbox(e,c,p),"createSandbox"),status:d(async c=>{if(typeof c!="string")return t.updateSandboxRuntimeStatus(e,c);let p=await t.getSandboxRuntime(e);return t.updateSandboxRuntimeStatus(e,{status:c,expectedVersion:p.version})},"status"),events:d(()=>t.listSandboxRuntimeEvents(e),"events"),event:d(c=>t.emitSandboxRuntimeEvent(e,c),"event"),recordCommit:d((c,p={})=>t.emitSandboxRuntimeEvent(e,{...p,type:p.type??"git.commit",commitSha:c}),"recordCommit"),checkpointHint:d((c={})=>t.emitSandboxRuntimeEvent(e,{type:"workflow.checkpoint_hint",summary:c.summary??c.reason??"Workflow checkpoint hint",payload:{...c.payload,reason:c.reason??null},artifactRefs:c.artifactRefs,lifecycleHint:{kind:"checkpoint",reason:c.reason??null}}),"checkpointHint"),waitForUser:d(async(c={})=>{await t.emitSandboxRuntimeEvent(e,{type:"workflow.waiting_for_user",summary:c.summary??c.reason??"Waiting for user",payload:{...c.payload,reason:c.reason??null},lifecycleHint:{kind:"waiting_for_user",reason:c.reason??null}});let p=await t.getSandboxRuntime(e);return p.status==="waiting_for_user"?p:t.updateSandboxRuntimeStatus(e,{status:"waiting_for_user",expectedVersion:p.version,summary:c.summary??c.reason,metadata:{workflowWaitForUserReason:c.reason??null}})},"waitForUser"),keepAlive:d((c={})=>{let p=pn(c);return t.emitSandboxRuntimeEvent(e,{type:"workflow.keepalive",summary:c.summary??c.reason??"Workflow keepalive",payload:{...c.payload,reason:c.reason??null,keepaliveUntil:p},lifecycleHint:{kind:"keepalive",reason:c.reason??null,keepaliveUntil:p}})},"keepAlive"),checkpoint:d(c=>t.checkpointSandboxRuntime(e,c),"checkpoint"),files:{write:d(async(c,p)=>t.uploadFile((await a()).id,c,p),"write"),read:d(async c=>t.downloadFile((await a()).id,c),"read"),readResponse:d(async c=>t.downloadFileResponse((await a()).id,c),"readResponse"),list:d(async(c={})=>t.listFiles((await a()).id,c),"list"),delete:d(async(c,p={})=>t.deleteFile((await a()).id,c,p),"delete"),search:d(async c=>t.searchFiles((await a()).id,c),"search"),stat:d(async c=>t.statFile((await a()).id,c),"stat"),mkdir:d(async c=>t.mkdir((await a()).id,c),"mkdir"),move:d(async c=>t.moveFile((await a()).id,c),"move")},commands:{run:d(async c=>t.exec((await a()).id,typeof c=="string"?{command:c}:c),"run")},ports:{expose:d(async c=>t.openPort((await a()).id,typeof c=="number"?{port:c}:c),"expose")},promote:d((c,p={})=>t.promoteSandboxRuntime(e,c,p),"promote"),preserveSource:d((c={},p={})=>t.preserveSandboxRuntimeSource(e,c,p),"preserveSource"),archive:d(async c=>{let p=c??(await t.getSandboxRuntime(e)).version;return t.updateSandboxRuntimeStatus(e,{status:"archived",expectedVersion:p})},"archive")}}d(un,"createSandboxRuntimeHandle");function pn(t){if(t?.until instanceof Date)return t.until.toISOString();if(typeof t?.until=="string"&&t.until.trim())return new Date(t.until).toISOString();let e=typeof t?.seconds=="number"&&Number.isFinite(t.seconds)?Math.max(1,Math.trunc(t.seconds)):60;return new Date(Date.now()+e*1e3).toISOString()}d(pn,"runtimeKeepaliveUntilIso");async function mn(t,e={}){let n=`openpond-code-smoke-${Date.now()}`,r=`openpond-code-exec-ok:${n}`,a=`openpond-code-preview-ok:${n}`,s=`openpond-code-file-ok:${n}`,i=4173,u=null,c=null,p=!1,b=!1;try{let l=await Ve(t,await t.create({repo:e.repo??"https://github.com/octocat/Hello-World",resources:{cpu:e.cpu??1,memoryGb:e.memoryGb??1,diskGb:e.diskGb??8},budget:{maxUsd:e.budgetUsd??"0.05"},quotas:{maxSpendUsd:e.budgetUsd??"0.05",maxDurationSeconds:600,idleTimeoutSeconds:600,maxOpenPorts:2},metadata:{runId:n,source:"openpond-code-sandbox-smoke"}},{async:!0}));u=l.id;let g=e.expectedMppMode;if(g&&l.reservation.mpp?.mode!==g)throw new Error(`expected ${g} reservation, got ${l.reservation.mpp?.mode??"none"}`);if(!g&&!l.reservation.mpp?.mode)throw new Error("expected sandbox reservation MPP metadata");let P=await t.exec(l.id,{command:[`printf '${r}\\n'`,"test -f README && printf 'repo-clone-ok\\n'","cat > server.cjs <<'EOF'","const { createServer } = require('node:http');",`createServer((_request, response) => response.end('${a}')).listen(${i}, '0.0.0.0');`,"EOF","nohup node server.cjs > server.log 2>&1 & sleep 1"].join(`
3
- `),timeoutSeconds:120});if(P.command.status!=="succeeded")throw new Error(`expected command success, got ${P.command.status}`);if(!P.command.output.includes(r))throw new Error("expected exec marker");if(await t.uploadFile(l.id,"openpond-code-smoke.txt",s),await t.downloadFile(l.id,"openpond-code-smoke.txt")!==s)throw new Error("expected file roundtrip marker");let q=null;if(e.snapshot||e.fork){let R=await t.createSnapshot(l.id,{async:!0,name:`openpond-code-smoke-${n}`,replay:{entrypoints:[{command:"cat openpond-code-smoke.txt",name:"default"}],retention:{class:"pinned"},safety:{cleanup:"delete",idleTimeoutSeconds:600,internetEgress:"block",maxDurationSeconds:600,maxSpendUsd:e.budgetUsd??"0.05",publicPreview:!1},validation:{commands:[{command:"test -f openpond-code-smoke.txt"}]}}}),A=R.snapshot??(await fn(t,l.id,R.snapshotJob?.snapshotId)).snapshot;if(q=A.id,A.state!=="ready")throw new Error(`expected ready snapshot, got ${A.state}`)}if(e.fork){if(!q)throw new Error("expected snapshot id before fork");let R=await Ve(t,(await t.forkSnapshot(q,{budget:{maxUsd:e.budgetUsd??"0.05"},metadata:{source:"openpond-code-sandbox-smoke-fork",templateSnapshotId:q}},{async:!0})).sandbox);c=R.id;let A=await t.exec(R.id,{command:"cat openpond-code-smoke.txt",timeoutSeconds:120});if(A.command.status!=="succeeded")throw new Error(`expected fork command success, got ${A.command.status}`);if(!A.command.output.includes(s))throw new Error("expected fork snapshot marker");e.keep||(await fe(t,R.id),b=!0)}let j=null;if(e.preview!==!1){let R=await t.openPort(l.id,{label:"openpond-code-smoke",port:i}),A=await fetch(R.preview.url);j=A.status;let $t=await A.text();if(A.status!==200)throw new Error(`expected preview HTTP 200, got ${A.status}`);if(!$t.includes(a))throw new Error("expected preview marker")}let{sandbox:ne,receipts:J}=await ln(t,l.id);return e.keep||(await fe(t,l.id),p=!0),{deleted:p,execOutput:P.command.output.trim(),fileRoundtrip:!0,forkSandboxId:c,previewStatus:j,receiptRefs:J.map(R=>R.mpp.receiptRef??null),reservationRef:l.reservation.mpp?.reservationRef??null,runId:n,sandboxId:l.id,snapshotId:q,state:ne.state}}finally{c&&!e.keep&&!b&&await Xe(t,c),u&&!e.keep&&!p&&await Xe(t,u)}}d(mn,"runSandboxSmoke");async function ln(t,e){try{await t.stop(e)}catch{await t.stop(e,{async:!0})}let n=await Ze(t,e,new Set(["stopped","deleted"]),"stop"),r=await hn(t,e);if(r.length===0)throw new Error("expected receipt readback");return{sandbox:n,receipts:r}}d(ln,"stopSandboxForSmoke");async function fe(t,e){try{let n=await t.delete(e);if(n.state==="deleted")return n;await t.delete(e,{async:!0})}catch{await t.delete(e,{async:!0})}return Ze(t,e,new Set(["deleted"]),"delete")}d(fe,"deleteSandboxForSmoke");async function Xe(t,e){try{await fe(t,e)}catch{await t.delete(e,{async:!0}).catch(()=>{})}}d(Xe,"cleanupSandboxBestEffort");async function Ze(t,e,n,r){let i=Date.now()+3e5,u=await t.get(e);for(;Date.now()<i;){if(n.has(u.state))return u;if(u.state==="error")throw new Error(`sandbox ${r} failed: ${e}`);await V(3e3),u=await t.get(e)}throw new Error(`sandbox ${r} did not reach ${[...n].join("/")} before timeout: ${e} (${u.state})`)}d(Ze,"waitForSandboxState");async function hn(t,e){let a=Date.now()+12e4,s=await t.receipts(e);for(;Date.now()<a;){if(s.length>0)return s;await V(3e3),s=await t.receipts(e)}return s}d(hn,"waitForReceipts");async function Ve(t,e){if(e.state==="running"||e.state==="stopped")return e;if(e.state==="error")throw new Error(`sandbox create failed: ${e.id}
4
- ${e.logs.join(`
5
- `)}`);let n=12*6e4,r=3e3,a=Date.now()+n,s=e;for(;Date.now()<a;){if(await V(r),s=await t.get(e.id),s.state==="running"||s.state==="stopped")return s;if(s.state==="error")throw new Error(`sandbox create failed: ${s.id}
6
- ${s.logs.join(`
7
- `)}`)}throw new Error(`sandbox create did not reach running state before timeout: ${s.id} (${s.state})`)}d(Ve,"waitForCreateReady");async function fn(t,e,n){if(!n)throw new Error("snapshot job did not return snapshot id");let r=12*6e4,a=3e3,s=Date.now()+r,i=await t.get(e);for(;Date.now()<s;){let u=i.snapshots?.find(p=>p.id===n);if(u?.state==="ready")return{sandbox:i,snapshot:u};let c=i.snapshotJobs?.find(p=>p.snapshotId===n);if(c?.status==="failed")throw new Error(`snapshot job failed: ${c.error??n}`);await V(a),i=await t.get(e)}throw new Error(`snapshot did not reach ready state before timeout: ${n}`)}d(fn,"waitForSnapshotReady");function V(t){return new Promise(e=>setTimeout(e,t))}d(V,"sleep");function M(t={}){return t.async||t.respondAsync?{Prefer:"respond-async"}:void 0}d(M,"asyncRequestHeaders");var yn="https://openpond.ai",Qe="https://api.openpond.ai";async function Ye(t){let e=await X(t.sandboxApiUrl,t.apiKey,t.path,{timeoutMs:0,maxResponseBytes:0});if(!e.body)return;let n=e.body.getReader(),r=new TextDecoder,a="";try{for(;;){let{done:s,value:i}=await n.read();if(s)break;a+=r.decode(i,{stream:!0});let u=a.indexOf(`
8
-
9
- `);for(;u!==-1;){let c=a.slice(0,u);a=a.slice(u+2);let p=bn(c);p&&process.stdout.write(p),u=a.indexOf(`
10
-
11
- `)}}}finally{n.releaseLock()}}d(Ye,"streamSandboxEventOutput");function gn(t){return typeof t=="string"?{dataBase64:Buffer.from(t,"utf-8").toString("base64")}:t instanceof Uint8Array?{dataBase64:Buffer.from(t).toString("base64")}:t}d(gn,"normalizePtyInput");function bn(t){if(!t.includes("event: output"))return null;let e=t.split(/\r?\n/).filter(n=>n.startsWith("data: ")).map(n=>n.slice(6));if(e.length===0)return null;try{let n=JSON.parse(e.join(`
12
- `));return typeof n.output=="string"?n.output:null}catch{return null}}d(bn,"parseProcessOutputEvent");function O(t){let e=t.trim().replace(/\/$/,"");if(!e)throw new Error("sandbox API URL must be non-empty");let n=new URL(e),r=n.pathname.replace(/\/$/,"");return r.endsWith("/v1/sandboxes")||r.endsWith("/api/sandboxes")?`${n.origin}${r}`:r.endsWith("/v1")?`${n.origin}${r}/sandboxes`:Sn(n.hostname)?`${n.origin}${r}/v1/sandboxes`:n.origin===yn?`${Qe}/v1/sandboxes`:`${n.origin}${r}/api/sandboxes`}d(O,"normalizeSandboxApiUrl");function In(t){let e="/sandboxes";if(!t.endsWith(e))throw new Error("sandbox API URL must end with /sandboxes");return t.slice(0,-e.length)}d(In,"apiRootUrlFromSandboxApiUrl");function Sn(t){return t==="api.openpond.ai"||t==="staging-api.openpond.ai"||t.startsWith("api")&&t.endsWith(".openpond.ai")}d(Sn,"isOpenPondHostedApiHost");var wn=class{static{d(this,"OpenPondSandboxInstanceClient")}apiKey;apiRootUrl;sandboxApiUrl;customEndpoint;constructor(t){this.apiKey=t.apiKey,this.customEndpoint=t.customEndpoint??!1,this.sandboxApiUrl=O(t.sandboxApiUrl??t.baseUrl??Qe),this.apiRootUrl=In(this.sandboxApiUrl)}create(t,e={}){return this.request("",{method:"POST",...this.customEndpoint?{timeoutMs:18e4}:{},headers:M(e),body:JSON.stringify(t)}).then(n=>n.sandbox)}get(t){return this.request(`/${encodeURIComponent(t)}`).then(e=>e.sandbox)}exec(t,e){return this.request(`/${encodeURIComponent(t)}/exec`,{method:"POST",body:JSON.stringify(e)})}startProcess(t,e){return this.request(`/${encodeURIComponent(t)}/processes`,{method:"POST",body:JSON.stringify(e)})}listProcesses(t){return this.request(`/${encodeURIComponent(t)}/processes`)}getProcess(t,e,n={}){let r=new URLSearchParams;return n.since!==void 0&&r.set("since",String(Math.max(0,n.since))),this.request(`/${encodeURIComponent(t)}/processes/${encodeURIComponent(e)}${r.size>0?`?${r.toString()}`:""}`)}stopProcess(t,e){return this.request(`/${encodeURIComponent(t)}/processes/${encodeURIComponent(e)}`,{method:"DELETE"})}async streamProcessOutput(t,e,n={}){let r=new URLSearchParams;n.since!==void 0&&r.set("since",String(Math.max(0,n.since))),await Ye({sandboxApiUrl:this.sandboxApiUrl,apiKey:this.apiKey,path:`/${encodeURIComponent(t)}/processes/${encodeURIComponent(e)}/stream${r.size>0?`?${r.toString()}`:""}`})}startPty(t,e={}){return this.request(`/${encodeURIComponent(t)}/pty`,{method:"POST",body:JSON.stringify(e)})}listPtys(t){return this.request(`/${encodeURIComponent(t)}/pty`)}getPty(t,e,n={}){let r=new URLSearchParams;return n.since!==void 0&&r.set("since",String(Math.max(0,n.since))),this.request(`/${encodeURIComponent(t)}/pty/${encodeURIComponent(e)}${r.size>0?`?${r.toString()}`:""}`)}writePtyInput(t,e,n){return this.request(`/${encodeURIComponent(t)}/pty/${encodeURIComponent(e)}/input`,{method:"POST",body:JSON.stringify(gn(n))})}stopPty(t,e){return this.request(`/${encodeURIComponent(t)}/pty/${encodeURIComponent(e)}`,{method:"DELETE"})}async streamPtyOutput(t,e,n={}){let r=new URLSearchParams;n.since!==void 0&&r.set("since",String(Math.max(0,n.since))),await Ye({sandboxApiUrl:this.sandboxApiUrl,apiKey:this.apiKey,path:`/${encodeURIComponent(t)}/pty/${encodeURIComponent(e)}/stream${r.size>0?`?${r.toString()}`:""}`})}uploadFile(t,e,n){return this.uploadFileBase64(t,e,Buffer.from(n,"utf-8").toString("base64"))}uploadFileBase64(t,e,n){return this.request(`/${encodeURIComponent(t)}/files`,{method:"POST",body:JSON.stringify({path:e,contentsBase64:n})})}async downloadFile(t,e){let n=await this.downloadFileResponse(t,e);return Buffer.from(n.file.contentsBase64,"base64").toString("utf-8")}downloadFileResponse(t,e){let n=typeof e=="string"?{path:e}:e,r=new URLSearchParams({path:n.path});return n.offsetBytes!==void 0&&r.set("offsetBytes",String(n.offsetBytes)),n.maxBytes!==void 0&&r.set("maxBytes",String(n.maxBytes)),this.request(`/${encodeURIComponent(t)}/files?${r.toString()}`)}listFiles(t,e={}){let n=new URLSearchParams({list:"1"});return e.path&&n.set("path",e.path),e.recursive!==void 0&&n.set("recursive",String(e.recursive)),e.maxEntries!==void 0&&n.set("maxEntries",String(e.maxEntries)),this.request(`/${encodeURIComponent(t)}/files?${n.toString()}`)}deleteFile(t,e,n={}){let r=new URLSearchParams({path:e});return n.recursive!==void 0&&r.set("recursive",String(n.recursive)),this.request(`/${encodeURIComponent(t)}/files?${r.toString()}`,{method:"DELETE"})}statFile(t,e){let n=new URLSearchParams({stat:"1",path:e});return this.request(`/${encodeURIComponent(t)}/files?${n.toString()}`)}mkdir(t,e){let n=typeof e=="string"?{path:e}:e,r=new URLSearchParams({path:n.path});return n.recursive!==void 0&&r.set("recursive",String(n.recursive)),this.request(`/${encodeURIComponent(t)}/files?${r.toString()}`,{method:"PUT"})}moveFile(t,e){let n=new URLSearchParams({fromPath:e.fromPath,toPath:e.toPath});return e.overwrite!==void 0&&n.set("overwrite",String(e.overwrite)),this.request(`/${encodeURIComponent(t)}/files?${n.toString()}`,{method:"PATCH"})}searchFiles(t,e){let n=new URLSearchParams({search:"1",query:e.query});return e.path&&n.set("path",e.path),e.maxResults!==void 0&&n.set("maxResults",String(e.maxResults)),this.request(`/${encodeURIComponent(t)}/files?${n.toString()}`)}openPort(t,e){return this.request(`/${encodeURIComponent(t)}/ports`,{method:"POST",body:JSON.stringify(e)})}createSnapshot(t,e){return this.request(`/${encodeURIComponent(t)}/snapshots`,{method:"POST",body:JSON.stringify(e)})}updateSnapshot(t,e,n){return this.request(`/${encodeURIComponent(t)}/snapshots/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(n)})}validateSnapshot(t,e,n={}){return this.request(`/${encodeURIComponent(t)}/snapshots/${encodeURIComponent(e)}/validate`,{method:"POST",body:JSON.stringify(n)})}publishSnapshot(t,e){return this.request(`/${encodeURIComponent(t)}/snapshots/${encodeURIComponent(e)}/publish`,{method:"POST"})}fork(t,e={}){return this.request(`/${encodeURIComponent(t)}/fork`,{method:"POST",body:JSON.stringify(e)})}stop(t,e={}){let n=new URLSearchParams;return e.failOnUnpreservedChanges&&n.set("failOnUnpreservedChanges","true"),this.request(`/${encodeURIComponent(t)}/stop${n.size>0?`?${n.toString()}`:""}`,{method:"POST",headers:M(e)})}start(t,e={}){return this.request(`/${encodeURIComponent(t)}/start`,{method:"POST",headers:M(e)})}restore(t){return this.request(`/${encodeURIComponent(t)}/restore`,{method:"POST"})}delete(t,e={}){let n=new URLSearchParams;return e.failOnUnpreservedChanges&&n.set("failOnUnpreservedChanges","true"),this.request(`/${encodeURIComponent(t)}${n.size>0?`?${n.toString()}`:""}`,{method:"DELETE",headers:M(e)}).then(r=>r.sandbox)}receipts(t){return this.request(`/${encodeURIComponent(t)}/receipts`).then(e=>e.receipts)}logs(t){return this.request(`/${encodeURIComponent(t)}/logs`).then(e=>e.logs)}gitStatus(t){return this.request(`/${encodeURIComponent(t)}/git/status`)}gitDiff(t,e={}){return this.request(`/${encodeURIComponent(t)}/git/diff`,{method:"POST",body:JSON.stringify(e)})}gitExportPatch(t,e={}){return this.request(`/${encodeURIComponent(t)}/git/export-patch`,{method:"POST",body:JSON.stringify(e)})}gitBranch(t,e){return this.request(`/${encodeURIComponent(t)}/git/branch`,{method:"POST",body:JSON.stringify(e)})}gitCommit(t,e){return this.request(`/${encodeURIComponent(t)}/git/commit`,{method:"POST",body:JSON.stringify(e)})}gitPull(t,e={}){return this.request(`/${encodeURIComponent(t)}/git/pull`,{method:"POST",body:JSON.stringify(e)})}gitPush(t,e={}){return this.request(`/${encodeURIComponent(t)}/git/push`,{method:"POST",body:JSON.stringify(e)})}billing(t){return this.request(`/${encodeURIComponent(t)}/billing`)}pricing(){return this.request("/pricing")}costs(t={}){let e=new URLSearchParams;return t.teamId&&e.set("teamId",t.teamId),t.projectId&&e.set("projectId",t.projectId),t.agentId&&e.set("agentId",t.agentId),this.request(`/costs${e.size>0?`?${e.toString()}`:""}`)}integrationLeases(t){return this.request(`/${encodeURIComponent(t)}/integrations`)}attachIntegrationConnection(t,e){return this.request(`/${encodeURIComponent(t)}/integrations`,{method:"POST",body:JSON.stringify(e)})}removeIntegrationLease(t,e){return this.request(`/${encodeURIComponent(t)}/integrations`,{method:"DELETE",body:JSON.stringify({leaseId:e})})}async request(t,e={}){let n=await X(this.sandboxApiUrl,this.apiKey,t,this.customEndpoint?{...e,explicitBearerAuth:!0,redirect:"error"}:e);return me(n,"Sandbox request")}async requestApiRoot(t,e={}){let n=await X(this.apiRootUrl,this.apiKey,t,this.customEndpoint?{...e,explicitBearerAuth:!0,redirect:"error"}:e);return me(n,"OpenPond API request")}},xn=class extends wn{static{d(this,"OpenPondSandboxClient")}runtimes=on(this);sandboxes=an(this);profile=dn(this);projects=sn(this);agents=cn(this);list(t={}){let e=new URLSearchParams;return t.teamId&&e.set("teamId",t.teamId),t.projectId&&e.set("projectId",t.projectId),t.agentId&&e.set("agentId",t.agentId),this.request(e.size>0?`?${e.toString()}`:"").then(n=>n.sandboxes)}listSecrets(t={}){let e=new URLSearchParams;return t.teamId&&e.set("teamId",t.teamId),this.requestApiRoot(`/sandbox-secrets${e.size>0?`?${e.toString()}`:""}`).then(n=>n.secrets)}getSecret(t,e={}){let n=new URLSearchParams;return e.teamId&&n.set("teamId",e.teamId),this.requestApiRoot(`/sandbox-secrets/${encodeURIComponent(t)}${n.size>0?`?${n.toString()}`:""}`).then(r=>r.secret)}createSecret(t){return this.requestApiRoot("/sandbox-secrets",{method:"POST",body:JSON.stringify(t)}).then(e=>e.secret)}rotateSecret(t,e){let n=new URLSearchParams;e.teamId&&n.set("teamId",e.teamId);let{teamId:r,...a}=e;return this.requestApiRoot(`/sandbox-secrets/${encodeURIComponent(t)}/rotate${n.size>0?`?${n.toString()}`:""}`,{method:"POST",body:JSON.stringify(a)}).then(s=>s.secret)}attachSecret(t,e){let n=new URLSearchParams;e.teamId&&n.set("teamId",e.teamId);let{teamId:r,...a}=e;return this.requestApiRoot(`/sandbox-secrets/${encodeURIComponent(t)}/attach${n.size>0?`?${n.toString()}`:""}`,{method:"POST",body:JSON.stringify(a)}).then(s=>s.secret)}revokeSecret(t,e={}){let n=new URLSearchParams;return e.teamId&&n.set("teamId",e.teamId),this.requestApiRoot(`/sandbox-secrets/${encodeURIComponent(t)}/revoke${n.size>0?`?${n.toString()}`:""}`,{method:"POST"}).then(r=>r.secret)}deleteSecret(t,e={}){let n=new URLSearchParams;return e.teamId&&n.set("teamId",e.teamId),this.requestApiRoot(`/sandbox-secrets/${encodeURIComponent(t)}${n.size>0?`?${n.toString()}`:""}`,{method:"DELETE"}).then(r=>r.secret)}snapshotCatalog(t={}){let e=new URLSearchParams;return t.teamId&&e.set("teamId",t.teamId),t.projectId&&e.set("projectId",t.projectId),t.agentId&&e.set("agentId",t.agentId),t.q&&e.set("q",t.q),t.kind&&e.set("kind",t.kind),t.replayState&&e.set("replayState",t.replayState),t.visibility&&e.set("visibility",t.visibility),t.tag&&e.set("tag",t.tag),t.useCase&&e.set("useCase",t.useCase),t.limit&&e.set("limit",String(t.limit)),this.request(`/catalog/snapshots${e.size>0?`?${e.toString()}`:""}`)}listSandboxRuntimes(t={}){let e=new URLSearchParams;return t.teamId&&e.set("teamId",t.teamId),t.projectId&&e.set("projectId",t.projectId),t.agentId&&e.set("agentId",t.agentId),this.requestApiRoot(`/runtimes${e.size>0?`?${e.toString()}`:""}`).then(n=>n.runtimes)}listProjects(t){let e=new URLSearchParams({teamId:t.teamId});return this.requestApiRoot(`/projects?${e.toString()}`).then(n=>n.projects)}upsertProject(t){let e=new URLSearchParams({teamId:t.teamId});return this.requestApiRoot(`/projects?${e.toString()}`,{method:"POST",body:JSON.stringify(t)}).then(n=>n.project)}getHostedProfile(t){let e=new URLSearchParams({teamId:t.teamId});return this.requestApiRoot(`/profile?${e.toString()}`).then(n=>n.profile)}ensureHostedProfile(t){let e=new URLSearchParams({teamId:t.teamId});return this.requestApiRoot(`/profile/ensure?${e.toString()}`,{method:"POST"}).then(n=>{if(!n.profile)throw new Error("hosted_profile_missing");return n.profile})}pushHostedProfile(t){let e=new URLSearchParams({teamId:t.teamId}),{teamId:n,...r}=t;return this.requestApiRoot(`/profile/push?${e.toString()}`,{method:"POST",body:JSON.stringify(r)})}async upsertProjectGitRemote(t){let e=await this.upsertProject(t);return this.ensureProjectGitRemote(e.id,{teamId:t.teamId})}getProject(t,e){let n=new URLSearchParams({teamId:e.teamId});return this.requestApiRoot(`/projects/${encodeURIComponent(t)}?${n.toString()}`).then(r=>r.project)}syncProject(t,e){let n=new URLSearchParams({teamId:e.teamId});return this.requestApiRoot(`/projects/${encodeURIComponent(t)}/sync?${n.toString()}`,{method:"POST"}).then(r=>r.project)}ensureProjectGitRemote(t,e){let n=new URLSearchParams({teamId:e.teamId});return this.requestApiRoot(`/projects/${encodeURIComponent(t)}/git?${n.toString()}`,{method:"POST"})}uploadProjectSource(t,e){let n=new URLSearchParams({teamId:e.teamId}),{teamId:r,...a}=e;return this.requestApiRoot(`/projects/${encodeURIComponent(t)}/source?${n.toString()}`,{method:"POST",body:JSON.stringify(a)}).then(s=>s.project)}updateProject(t,e){let n=new URLSearchParams({teamId:e.teamId}),{teamId:r,...a}=e;return this.requestApiRoot(`/projects/${encodeURIComponent(t)}?${n.toString()}`,{method:"PATCH",body:JSON.stringify(a)}).then(s=>s.project)}archiveProject(t,e){let n=new URLSearchParams({teamId:e.teamId});return this.requestApiRoot(`/projects/${encodeURIComponent(t)}?${n.toString()}`,{method:"DELETE"}).then(r=>r.project)}listAgents(t){let e=new URLSearchParams({teamId:t.teamId});return this.requestApiRoot(`/agents?${e.toString()}`).then(n=>n.agents)}upsertAgent(t){let e=new URLSearchParams({teamId:t.teamId});return this.requestApiRoot(`/agents?${e.toString()}`,{method:"POST",body:JSON.stringify(t)}).then(n=>n.agent)}getAgent(t,e){let n=new URLSearchParams({teamId:e.teamId});return this.requestApiRoot(`/agents/${encodeURIComponent(t)}?${n.toString()}`).then(r=>r.agent)}archiveAgent(t,e){let n=new URLSearchParams({teamId:e.teamId});return this.requestApiRoot(`/agents/${encodeURIComponent(t)}?${n.toString()}`,{method:"DELETE"}).then(r=>r.agent)}updateAgent(t,e){let n=new URLSearchParams({teamId:e.teamId}),{teamId:r,...a}=e;return this.requestApiRoot(`/agents/${encodeURIComponent(t)}?${n.toString()}`,{method:"PATCH",body:JSON.stringify(a)}).then(s=>s.agent)}runAgent(t,e){let n=new URLSearchParams({teamId:e.teamId}),{teamId:r,...a}=e;return this.requestApiRoot(`/agents/${encodeURIComponent(t)}/run?${n.toString()}`,{method:"POST",headers:{Prefer:"respond-async"},body:JSON.stringify(a)})}getAgentSourceDeployPlan(t,e){let n=new URLSearchParams({teamId:e.teamId});return this.requestApiRoot(`/agents/${encodeURIComponent(t)}/source/deploy-plan?${n.toString()}`).then(r=>r.deployPlan)}listAgentManifestSnapshots(t,e){let n=new URLSearchParams({teamId:e.teamId});return e.limit!==void 0&&n.set("limit",String(e.limit)),this.requestApiRoot(`/agents/${encodeURIComponent(t)}/source/manifest-snapshots?${n.toString()}`).then(r=>r.manifestSnapshots)}requestAgentSourceChecks(t,e){let n=new URLSearchParams({teamId:e.teamId}),{teamId:r,...a}=e;return this.requestApiRoot(`/agents/${encodeURIComponent(t)}/source/checks?${n.toString()}`,{method:"POST",body:JSON.stringify(a),timeoutMs:900*1e3})}configureAgentSourceSetup(t,e){let n=new URLSearchParams({teamId:e.teamId}),{teamId:r,...a}=e;return this.requestApiRoot(`/agents/${encodeURIComponent(t)}/source/setup?${n.toString()}`,{method:"POST",body:JSON.stringify(a)})}publishAgentSource(t,e){let n=new URLSearchParams({teamId:e.teamId}),{teamId:r,...a}=e;return this.requestApiRoot(`/agents/${encodeURIComponent(t)}/source/publish?${n.toString()}`,{method:"POST",body:JSON.stringify(a)})}getMicrosoftTeamsBotOverview(t){let e=new URLSearchParams({teamId:t.teamId});return this.requestApiRoot(`/teams/bot/overview?${e.toString()}`)}bindMicrosoftTeamsBotConversation(t){return this.requestApiRoot("/teams/bot/bindings",{method:"POST",body:JSON.stringify(t)})}rebindMicrosoftTeamsBotConversation(t,e){return this.requestApiRoot(`/teams/bot/bindings/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(e)})}unlinkMicrosoftTeamsBotConversation(t){return this.requestApiRoot(`/teams/bot/bindings/${encodeURIComponent(t.bindingId)}`,{method:"DELETE",body:JSON.stringify({teamId:t.teamId})})}sendMicrosoftTeamsBotDiagnostic(t){return this.requestApiRoot("/teams/bot/diagnostics",{method:"POST",body:JSON.stringify(t)})}sendMicrosoftTeamsBotDiagnosticRun(t){return this.requestApiRoot("/teams/bot/diagnostics/run",{method:"POST",body:JSON.stringify(t)})}createSandboxRuntime(t){return this.requestApiRoot("/runtimes",{method:"POST",body:JSON.stringify(t)}).then(e=>e.runtime)}sandboxRuntime(t,e=null){return un(this,t,e)}getSandboxRuntime(t){return this.requestApiRoot(`/runtimes/${encodeURIComponent(t)}`).then(e=>e.runtime)}createSandboxRuntimeSandbox(t,e={},n={}){return this.requestApiRoot(`/runtimes/${encodeURIComponent(t)}/sandbox`,{method:"POST",headers:M(n),body:JSON.stringify(e)})}updateSandboxRuntimeStatus(t,e){return this.requestApiRoot(`/runtimes/${encodeURIComponent(t)}/status`,{method:"PATCH",body:JSON.stringify(e)}).then(n=>n.runtime)}listSandboxRuntimeEvents(t){return this.requestApiRoot(`/runtimes/${encodeURIComponent(t)}/events`)}emitSandboxRuntimeEvent(t,e){return this.requestApiRoot(`/runtimes/${encodeURIComponent(t)}/events`,{method:"POST",body:JSON.stringify(e)})}checkpointSandboxRuntime(t,e){return this.requestApiRoot(`/runtimes/${encodeURIComponent(t)}/checkpoints`,{method:"POST",body:JSON.stringify(e)}).then(n=>n.runtime)}promoteSandboxRuntime(t,e,n={}){let r=new URLSearchParams;return n.teamId&&r.set("teamId",n.teamId),this.requestApiRoot(`/runtimes/${encodeURIComponent(t)}/promote${r.size>0?`?${r.toString()}`:""}`,{method:"POST",body:JSON.stringify(e)})}preserveSandboxRuntimeSource(t,e={},n={}){let r=new URLSearchParams;return n.teamId&&r.set("teamId",n.teamId),this.requestApiRoot(`/runtimes/${encodeURIComponent(t)}/preserve-source${r.size>0?`?${r.toString()}`:""}`,{method:"POST",body:JSON.stringify(e)})}forkSnapshot(t,e={},n={}){let r=new URLSearchParams;e.teamId&&r.set("teamId",e.teamId),e.projectId&&r.set("projectId",e.projectId),n.async&&r.set("async","1");let{teamId:a,projectId:s,...i}=e;return this.request(`/catalog/snapshots/${encodeURIComponent(t)}/fork${r.size>0?`?${r.toString()}`:""}`,{method:"POST",headers:n.async?{Prefer:"respond-async"}:void 0,body:JSON.stringify({...i,snapshotId:t})})}templates(t={}){let e=new URLSearchParams;return t.teamId&&e.set("teamId",t.teamId),t.projectId&&e.set("projectId",t.projectId),t.q&&e.set("q",t.q),t.name&&e.set("name",t.name),t.version&&e.set("version",t.version),t.visibility&&e.set("visibility",t.visibility),t.tag&&e.set("tag",t.tag),t.useCase&&e.set("useCase",t.useCase),t.limit&&e.set("limit",String(t.limit)),this.request(`/templates${e.size>0?`?${e.toString()}`:""}`)}publishedSnapshots(t={}){let e=new URLSearchParams;return t.teamId&&e.set("teamId",t.teamId),t.projectId&&e.set("projectId",t.projectId),t.q&&e.set("q",t.q),t.name&&e.set("name",t.name),t.version&&e.set("version",t.version),t.visibility&&e.set("visibility",t.visibility),t.tag&&e.set("tag",t.tag),t.useCase&&e.set("useCase",t.useCase),t.limit&&e.set("limit",String(t.limit)),this.request(`/published-snapshots${e.size>0?`?${e.toString()}`:""}`).then(n=>{let r=n.publishedSnapshots??n.templates;return{...n,templates:r,publishedSnapshots:r}})}launchTemplate(t){let e=new URLSearchParams;t.teamId&&e.set("teamId",t.teamId),t.projectId&&e.set("projectId",t.projectId);let{teamId:n,projectId:r,...a}=t;return this.request(`/templates/launch${e.size>0?`?${e.toString()}`:""}`,{method:"POST",body:JSON.stringify(a)})}runPublishedSnapshot(t){let e=new URLSearchParams;t.teamId&&e.set("teamId",t.teamId),t.projectId&&e.set("projectId",t.projectId);let{teamId:n,projectId:r,...a}=t;return this.request(`/published-snapshots/launch${e.size>0?`?${e.toString()}`:""}`,{method:"POST",body:JSON.stringify(a)}).then(s=>{let i=s.publishedSnapshot??s.template;return{...s,template:i,publishedSnapshot:i}})}listSchedules(t={}){let e=new URLSearchParams;return t.teamId&&e.set("teamId",t.teamId),t.projectId&&e.set("projectId",t.projectId),t.sourceSandboxId&&e.set("sourceSandboxId",t.sourceSandboxId),this.request(`/schedules${e.size>0?`?${e.toString()}`:""}`)}createSchedule(t){let e=new URLSearchParams;t.projectId&&e.set("projectId",t.projectId);let{projectId:n,...r}=t;return this.request(`/schedules${e.size>0?`?${e.toString()}`:""}`,{method:"POST",body:JSON.stringify(r)})}getSchedule(t){return this.request(`/schedules/${encodeURIComponent(t)}`)}updateSchedule(t,e){return this.request(`/schedules/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(e)})}deleteSchedule(t){return this.request(`/schedules/${encodeURIComponent(t)}`,{method:"DELETE"})}listScheduleRuns(t,e={}){let n=new URLSearchParams;return e.limit!==void 0&&n.set("limit",String(e.limit)),this.request(`/schedules/${encodeURIComponent(t)}/runs${n.size>0?`?${n.toString()}`:""}`)}runScheduleNow(t,e={}){return this.request(`/schedules/${encodeURIComponent(t)}/run`,{method:"POST",body:JSON.stringify(e)})}listTemplateBuilds(t){let e=new URLSearchParams({teamId:t.teamId});return this.requestApiRoot(`/sandbox-template-builds?${e.toString()}`).then(n=>n.builds)}createTemplateBuild(t){return this.requestApiRoot("/sandbox-template-builds",{method:"POST",body:JSON.stringify(t)}).then(e=>e.build)}getTemplateBuild(t){return this.requestApiRoot(`/sandbox-template-builds/${encodeURIComponent(t)}`).then(e=>e.build)}getTemplateBuildLogs(t){return this.requestApiRoot(`/sandbox-template-builds/${encodeURIComponent(t)}/logs`)}cancelTemplateBuild(t){return this.requestApiRoot(`/sandbox-template-builds/${encodeURIComponent(t)}/cancel`,{method:"POST"}).then(e=>e.build)}listPublishedSnapshotBuilds(t){let e=new URLSearchParams({teamId:t.teamId});return this.requestApiRoot(`/published-snapshot-builds?${e.toString()}`).then(n=>n.builds)}createPublishedSnapshotBuild(t){return this.requestApiRoot("/published-snapshot-builds",{method:"POST",body:JSON.stringify(t)}).then(e=>e.build)}getPublishedSnapshotBuild(t){return this.requestApiRoot(`/published-snapshot-builds/${encodeURIComponent(t)}`).then(e=>e.build)}getPublishedSnapshotBuildLogs(t){return this.requestApiRoot(`/published-snapshot-builds/${encodeURIComponent(t)}/logs`)}cancelPublishedSnapshotBuild(t){return this.requestApiRoot(`/published-snapshot-builds/${encodeURIComponent(t)}/cancel`,{method:"POST"}).then(e=>e.build)}listOrganizations(){return this.requestApiRoot("/organizations").then(t=>t.organizations??t.teams??[])}createOrganization(t){return this.requestApiRoot("/organizations",{method:"POST",body:JSON.stringify(t)}).then(e=>e.organization)}getOrganization(t){return this.requestApiRoot(`/organizations/${encodeURIComponent(t)}`).then(e=>e.organization)}updateOrganization(t,e){return this.requestApiRoot(`/organizations/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(e)}).then(n=>n.organization)}listOrganizationMembers(t){return this.requestApiRoot(`/organizations/${encodeURIComponent(t)}/members`).then(e=>e.members)}upsertOrganizationMember(t,e){return this.requestApiRoot(`/organizations/${encodeURIComponent(t)}/members`,{method:"POST",body:JSON.stringify(e)}).then(n=>n.member)}getOrganizationMcpServer(t){return this.requestApiRoot(`/organizations/${encodeURIComponent(t)}/mcp-server`).then(e=>e.mcpServer)}generateOrganizationMcpServer(t,e={}){return this.requestApiRoot(`/organizations/${encodeURIComponent(t)}/mcp-server`,{method:"POST",body:JSON.stringify(e)}).then(n=>n.mcpServer)}rotateOrganizationMcpServer(t){return this.requestApiRoot(`/organizations/${encodeURIComponent(t)}/mcp-server/rotate`,{method:"POST"}).then(e=>e.mcpServer)}disableOrganizationMcpServer(t){return this.requestApiRoot(`/organizations/${encodeURIComponent(t)}/mcp-server/disable`,{method:"POST"}).then(e=>e.mcpServer)}enableOrganizationMcpServer(t){return this.requestApiRoot(`/organizations/${encodeURIComponent(t)}/mcp-server/enable`,{method:"POST"}).then(e=>e.mcpServer)}startReplay(t){let e=new URLSearchParams;t.teamId&&e.set("teamId",t.teamId),t.projectId&&e.set("projectId",t.projectId);let{teamId:n,projectId:r,...a}=t;return this.requestApiRoot(`/sandbox-replays${e.size>0?`?${e.toString()}`:""}`,{method:"POST",body:JSON.stringify(a)})}listReplays(t={}){let e=new URLSearchParams;return t.teamId&&e.set("teamId",t.teamId),t.projectId&&e.set("projectId",t.projectId),this.requestApiRoot(`/sandbox-replays${e.size>0?`?${e.toString()}`:""}`)}getReplay(t,e={}){let n=new URLSearchParams;return e.teamId&&n.set("teamId",e.teamId),e.projectId&&n.set("projectId",e.projectId),this.requestApiRoot(`/sandbox-replays/${encodeURIComponent(t)}${n.size>0?`?${n.toString()}`:""}`)}getReplayLogs(t,e={}){let n=new URLSearchParams;return e.teamId&&n.set("teamId",e.teamId),e.projectId&&n.set("projectId",e.projectId),this.requestApiRoot(`/sandbox-replays/${encodeURIComponent(t)}/logs${n.size>0?`?${n.toString()}`:""}`)}getReplayArtifacts(t,e={}){let n=new URLSearchParams;return e.teamId&&n.set("teamId",e.teamId),e.projectId&&n.set("projectId",e.projectId),this.requestApiRoot(`/sandbox-replays/${encodeURIComponent(t)}/artifacts${n.size>0?`?${n.toString()}`:""}`)}cancelReplay(t,e={}){let n=new URLSearchParams;return e.teamId&&n.set("teamId",e.teamId),e.projectId&&n.set("projectId",e.projectId),this.requestApiRoot(`/sandbox-replays/${encodeURIComponent(t)}/cancel${n.size>0?`?${n.toString()}`:""}`,{method:"POST"})}integrationConnections(t={}){let e=new URLSearchParams;return t.teamId&&e.set("teamId",t.teamId),t.projectId&&e.set("projectId",t.projectId),t.agentId&&e.set("agentId",t.agentId),t.status&&e.set("status",t.status),this.requestApiRoot(`/integrations/connections${e.size>0?`?${e.toString()}`:""}`)}mcpServerConfig(){return{name:"openpond-sandboxes",transport:"streamable-http",url:`${this.sandboxApiUrl}/mcp`,headers:{"openpond-api-key":this.apiKey}}}smoke(t={}){return mn(this,t)}};function Y(t){return new xn(t)}d(Y,"createOpenPondSandboxClient");var Tr=o.object({choices:o.array(o.object({message:o.object({content:o.string().nullable().optional(),tool_calls:o.array(o.object({id:o.string().min(1),type:o.literal("function"),function:o.object({name:o.string().min(1),arguments:o.string()})})).optional()})})).min(1)});var zr=100*1024*1024;var Lr=Object.freeze({".avif":"image/avif",".csv":"text/csv",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".gif":"image/gif",".html":"text/html",".jpeg":"image/jpeg",".jpg":"image/jpeg",".json":"application/json",".m4a":"audio/mp4",".md":"text/markdown",".mov":"video/quicktime",".mp3":"audio/mpeg",".mp4":"video/mp4",".pdf":"application/pdf",".png":"image/png",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".svg":"image/svg+xml",".tsv":"text/tab-separated-values",".txt":"text/plain",".wav":"audio/wav",".webm":"video/webm",".webp":"image/webp",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});function $(t){let e=t?.trim();return e?e.replace(/\/$/,""):null}d($,"normalizeOptionalUrl");function m(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}d(m,"asRecord");var et=["workspacePurpose","purpose"];function tt(t){if(!t||typeof t!="object"||Array.isArray(t))return;let e={...t};for(let n of et)delete e[n];return e}d(tt,"sanitizeCreateMetadata");function vn(t){if(!t||typeof t!="object"||Array.isArray(t))return;let e={...t};for(let r of et)delete e[r];let n=tt(e.metadata);return n?e.metadata=n:delete e.metadata,e}d(vn,"sanitizeSandboxRuntimeInput");function Z(t){let e=m(t);if(e.sandboxRuntime)throw new Error("Sandbox runtime settings must use /v1/runtimes before materializing a sandbox.");let n={};typeof e.repo=="string"&&e.repo.trim()&&(n.repo=e.repo.trim()),typeof e.teamId=="string"&&e.teamId.trim()&&(n.teamId=e.teamId.trim()),typeof e.projectId=="string"&&e.projectId.trim()&&(n.projectId=e.projectId.trim()),typeof e.agentId=="string"&&e.agentId.trim()&&(n.agentId=e.agentId.trim()),typeof e.command=="string"&&e.command.trim()&&(n.command=e.command.trim()),typeof e.runtimeProfileId=="string"&&e.runtimeProfileId.trim()&&(n.runtimeProfileId=e.runtimeProfileId.trim()),e.workloadSource&&typeof e.workloadSource=="object"&&!Array.isArray(e.workloadSource)&&(n.workloadSource=e.workloadSource),e.sourceArchive&&typeof e.sourceArchive=="object"&&!Array.isArray(e.sourceArchive)&&(n.sourceArchive=e.sourceArchive),(e.visibility==="private"||e.visibility==="team")&&(n.visibility=e.visibility),e.resources&&typeof e.resources=="object"&&!Array.isArray(e.resources)&&(n.resources=e.resources),e.budget&&typeof e.budget=="object"&&!Array.isArray(e.budget)&&(n.budget=e.budget),"env"in e&&(n.env=xe(e.env)),e.networkPolicy&&typeof e.networkPolicy=="object"&&!Array.isArray(e.networkPolicy)&&(n.networkPolicy=e.networkPolicy),e.quotas&&typeof e.quotas=="object"&&!Array.isArray(e.quotas)&&(n.quotas=e.quotas),Array.isArray(e.volumes)&&(n.volumes=e.volumes),"integrationLeases"in e&&(n.integrationLeases=ot(e.integrationLeases)),Array.isArray(e.integrationConnectionLeases)&&(n.integrationConnectionLeases=e.integrationConnectionLeases);let r=tt(e.metadata);return r&&(n.metadata=r),n}d(Z,"normalizeCreateInput");function ge(t){let e=m(t),n=vn(e)??{},r={};return typeof n.teamId=="string"&&n.teamId.trim()&&(r.teamId=n.teamId.trim()),typeof n.projectId=="string"&&n.projectId.trim()&&(r.projectId=n.projectId.trim()),typeof n.agentId=="string"&&n.agentId.trim()&&(r.agentId=n.agentId.trim()),typeof n.workflowMode=="string"&&n.workflowMode.trim()?r.workflowMode=n.workflowMode.trim():typeof n.mode=="string"&&n.mode.trim()&&(r.workflowMode=n.mode.trim()),typeof n.baseBranch=="string"&&n.baseBranch.trim()&&(r.baseBranch=n.baseBranch.trim()),typeof n.baseSha=="string"&&n.baseSha.trim()&&(r.baseSha=n.baseSha.trim()),typeof n.sandboxId=="string"&&n.sandboxId.trim()&&(r.sandboxId=n.sandboxId.trim()),typeof n.rootfsSnapshotId=="string"&&n.rootfsSnapshotId.trim()&&(r.rootfsSnapshotId=n.rootfsSnapshotId.trim()),typeof n.dependencySnapshotId=="string"&&n.dependencySnapshotId.trim()&&(r.dependencySnapshotId=n.dependencySnapshotId.trim()),typeof n.runtimeProfileId=="string"&&n.runtimeProfileId.trim()&&(r.runtimeProfileId=n.runtimeProfileId.trim()),typeof n.promotionPolicy=="string"&&n.promotionPolicy.trim()&&(r.promotionPolicy=n.promotionPolicy.trim()),n.metadata&&typeof n.metadata=="object"&&!Array.isArray(n.metadata)&&(r.metadata=n.metadata),r}d(ge,"normalizeSandboxRuntimeCreateInput");function Q(t){return Z(t)}d(Q,"normalizeSandboxRuntimeSandboxCreateInput");function nt(t){return m(t)}d(nt,"normalizeSnapshotCreateInput");function y(t){let e=m(t),n=typeof e.teamId=="string"?e.teamId.trim():"",r=typeof e.projectId=="string"?e.projectId.trim():"",a=typeof e.agentId=="string"?e.agentId.trim():"";return{...n?{teamId:n}:{},...r?{projectId:r}:{},...a?{agentId:a}:{}}}d(y,"normalizeSandboxListInput");function rt(t){let e=m(t),n=typeof e.teamId=="string"?e.teamId.trim():"",r=typeof e.projectId=="string"?e.projectId.trim():"",{teamId:a,projectId:s,appId:i,...u}=e,c=u;return n&&(c.teamId=n),r&&(c.projectId=r),c}d(rt,"normalizeReplayStartInput");function be(t){if(t==="active"||t==="revoked"||t==="error"||t==="all")return t}d(be,"normalizeIntegrationStatusFilter");function Ie(t){let e=m(t),n=typeof e.connectionId=="string"?e.connectionId.trim():"";if(!n)throw new Error("Sandbox integration connection is required.");let r=st(e.capabilities);if(r.length===0)throw new Error("Sandbox integration capabilities are required.");at(e.provider,r);let a=it(e.scopes,"Sandbox integration scopes"),s=dt(e.expiresAt),i=En(e.ttlSeconds),u=ct(e.resourcePolicy);return{connectionId:n,capabilities:r,...a.length>0?{scopes:a}:{},...u?{resourcePolicy:u}:{},...s?{expiresAt:s}:{},...i!==void 0?{ttlSeconds:i}:{},...typeof e.required=="boolean"?{required:e.required}:{}}}d(Ie,"normalizeIntegrationAttachInput");function ot(t){if(t==null)return[];if(!Array.isArray(t))throw new Error("Sandbox integration leases must be an array.");return t.map(e=>Rn(e))}d(ot,"normalizeIntegrationLeaseRefsForRuntime");function Rn(t){let e=m(t),n=typeof e.leaseId=="string"?e.leaseId.trim():"";if(!n)throw new Error("Sandbox integration leaseId is required.");if("connectionId"in e)throw new Error("Sandbox integration leases must use leaseId/proxy refs, not connection ids.");Pn(e);let r=Cn(e.provider),a=st(e.capabilities);if(a.length===0)throw new Error("Sandbox integration lease capabilities are required.");at(r,a);let s=it(e.scopes,"Sandbox integration lease scopes"),i=ct(e.resourcePolicy),u=dt(e.expiresAt),c=typeof e.proxyUrl=="string"?e.proxyUrl.trim():"";return{leaseId:n,provider:r,capabilities:a,...s.length>0?{scopes:s}:{},...i?{resourcePolicy:i}:{},...u?{expiresAt:u}:{},...c?{proxyUrl:c}:{},...typeof e.required=="boolean"?{required:e.required}:{}}}d(Rn,"normalizeIntegrationLeaseRefForRuntime");function Cn(t){if(typeof t!="string")throw new Error("Sandbox integration lease provider is required.");let e=se(t);if(!e)throw new Error(`Sandbox integration provider is not supported: ${t}`);if(!ae(e)?.leasePolicy.leaseable)throw new Error(`Sandbox integration provider is not leaseable: ${e}`);return e}d(Cn,"normalizeLeaseableIntegrationProvider");function Pn(t){for(let e of Object.keys(t))if(ut(e))throw new Error("Sandbox integration leases must not include secrets or credentials.")}d(Pn,"assertNoSensitiveIntegrationLeaseKeys");function at(t,e){if(t==null||t==="")return;if(typeof t!="string")throw new Error("Sandbox integration provider must be a string.");let n=se(t);if(!n)throw new Error(`Sandbox integration provider is not supported: ${t}`);let r=ae(n);if(!r?.leasePolicy.leaseable)throw new Error(`Sandbox integration provider is not leaseable: ${n}`);let a=new Set(r.leasePolicy.allowedCapabilityIds),s=e.filter(i=>!a.has(i));if(s.length>0)throw new Error(`Sandbox integration capabilities are not allowed for ${n}: ${s.join(", ")}`)}d(at,"validateIntegrationCapabilitiesForProvider");function Se(t){let e=m(t),n=typeof e.leaseId=="string"?e.leaseId.trim():"";if(!n)throw new Error("Sandbox integration lease is required.");return n}d(Se,"normalizeIntegrationLeaseId");function st(t){return Array.isArray(t)?t.map(e=>typeof e=="string"?e.trim():"").filter(Boolean):[]}d(st,"normalizeStringArray");function it(t,e){if(t==null)return[];if(!Array.isArray(t))throw new Error(`${e} must be an array of strings.`);return t.map(n=>{if(typeof n!="string")throw new Error(`${e} must contain only strings.`);let r=n.trim();if(!r)throw new Error(`${e} must not contain empty values.`);return r})}d(it,"normalizeOptionalStringArray");function En(t){if(t==null||t==="")return;let e=Number(t);if(!Number.isFinite(e)||e<=0)throw new Error("Sandbox integration ttlSeconds must be a positive number.");return Math.max(1,Math.floor(e))}d(En,"normalizeIntegrationTtlSeconds");function dt(t){if(t==null||t==="")return;if(typeof t!="string")throw new Error("Sandbox integration expiresAt must be an ISO timestamp string.");let e=t.trim();if(!e)return;let n=Date.parse(e);if(!Number.isFinite(n))throw new Error("Sandbox integration expiresAt must be a valid ISO timestamp.");return e}d(dt,"normalizeIntegrationExpiresAt");function ct(t){if(t==null)return;if(typeof t!="object"||Array.isArray(t))throw new Error("Sandbox integration resourcePolicy must be an object.");if(ye(t,[]),JSON.stringify(t).length>16*1024)throw new Error("Sandbox integration resourcePolicy is too large.");return t}d(ct,"normalizeIntegrationResourcePolicy");function ye(t,e){if(!(!t||typeof t!="object")){if(e.length>8)throw new Error("Sandbox integration resourcePolicy is too deeply nested.");if(Array.isArray(t)){for(let n of t)ye(n,e);return}for(let[n,r]of Object.entries(t)){if(ut(n))throw new Error("Sandbox integration resourcePolicy must not include secrets or credentials.");ye(r,[...e,n])}}}d(ye,"assertNoSensitiveResourcePolicyKeys");function ut(t){let e=t.toLowerCase().replace(/[^a-z0-9]/g,"");return e.includes("accesstoken")||e.includes("refreshtoken")||e.includes("idtoken")||e.includes("oauth")||e.includes("bearer")||e.includes("authorization")||e.includes("cookie")||e.includes("secret")||e.includes("password")||e.includes("credential")}d(ut,"isSensitivePolicyKey");function pt(t){let e=m(t),n=typeof e.command=="string"?e.command.trim():"";if(!n)throw new Error("Sandbox command is required.");let r=typeof e.timeoutSeconds=="number"&&Number.isFinite(e.timeoutSeconds)?Math.max(1,Math.floor(e.timeoutSeconds)):void 0,a=Ne(n);return r?{command:a,timeoutSeconds:r}:{command:a}}d(pt,"normalizeExecInput");function mt(t){let e=m(t),n=typeof e.command=="string"?e.command.trim():"";if(!n)throw new Error("Sandbox process command is required.");let r=typeof e.timeoutSeconds=="number"&&Number.isFinite(e.timeoutSeconds)?Math.max(1,Math.floor(e.timeoutSeconds)):void 0;return r?{command:n,timeoutSeconds:r}:{command:n}}d(mt,"normalizeProcessStartInput");function lt(t){let e=m(t),n=Number(e.since);return Number.isFinite(n)?{since:Math.max(0,Math.floor(n))}:{}}d(lt,"normalizeProcessCursorInput");function ht(t){let e=m(t),n=typeof e.port=="number"?e.port:Number(e.port);if(!Number.isInteger(n)||n<re||n>oe)throw new Error(`Sandbox preview port must be between ${re} and ${oe}.`);let r=typeof e.label=="string"&&e.label.trim()?e.label.trim():void 0,a=e.access==="public"||e.access==="private"?e.access:void 0,s=e.autoStart===!0,i=typeof e.customDomain=="string"&&e.customDomain.trim()?e.customDomain.trim():void 0,u={port:n,...r?{label:r}:{},...a?{access:a}:{},...s?{autoStart:s}:{},...i?{customDomain:i}:{}};return e.cors&&typeof e.cors=="object"&&!Array.isArray(e.cors)&&(u.cors=e.cors),e.headerPolicy&&typeof e.headerPolicy=="object"&&!Array.isArray(e.headerPolicy)&&(u.headerPolicy=e.headerPolicy),e.authPolicy&&typeof e.authPolicy=="object"&&!Array.isArray(e.authPolicy)&&(u.authPolicy=e.authPolicy),u}d(ht,"normalizeOpenPortInput");function ft(t){let e=m(t),n={};if(e.template&&typeof e.template=="object"&&!Array.isArray(e.template)){let r=m(e.template),a={};typeof r.description=="string"?a.description=r.description.trim():r.description===null&&(a.description=null),Array.isArray(r.tags)&&(a.tags=r.tags.map(s=>typeof s=="string"?s.trim():"").filter(Boolean).slice(0,20)),(r.visibility==="private"||r.visibility==="team")&&(a.visibility=r.visibility),typeof r.useCase=="string"?a.useCase=r.useCase.trim():r.useCase===null&&(a.useCase=null),Object.keys(a).length>0&&(n.template=a)}if(e.retention&&typeof e.retention=="object"&&!Array.isArray(e.retention)){let r=m(e.retention),a={};(r.class==="ephemeral"||r.class==="cached"||r.class==="pinned")&&(a.class=r.class),r.ttlSeconds===null?a.ttlSeconds=null:typeof r.ttlSeconds=="number"&&Number.isFinite(r.ttlSeconds)&&(a.ttlSeconds=Math.max(1,Math.floor(r.ttlSeconds))),Object.keys(a).length>0&&(n.retention=a)}if(!n.template&&!n.retention)throw new Error("Snapshot update requires template or retention changes.");return n}d(ft,"normalizeSnapshotUpdateInput");function yt(t){let e=m(t),n=typeof e.cleanup=="string"?e.cleanup.trim():"";return n==="delete"||n==="stop"||n==="archive"?{cleanup:n}:{}}d(yt,"normalizeSnapshotValidateInput");function we(t){let e=m(t),n={};return typeof e.snapshotId=="string"&&e.snapshotId.trim()&&(n.snapshotId=e.snapshotId.trim()),(e.visibility==="private"||e.visibility==="team")&&(n.visibility=e.visibility),e.resources&&typeof e.resources=="object"&&!Array.isArray(e.resources)&&(n.resources=e.resources),e.budget&&typeof e.budget=="object"&&!Array.isArray(e.budget)&&(n.budget=e.budget),e.networkPolicy&&typeof e.networkPolicy=="object"&&!Array.isArray(e.networkPolicy)&&(n.networkPolicy=e.networkPolicy),e.quotas&&typeof e.quotas=="object"&&!Array.isArray(e.quotas)&&(n.quotas=e.quotas),Array.isArray(e.volumes)&&(n.volumes=e.volumes),"integrationLeases"in e&&(n.integrationLeases=ot(e.integrationLeases)),"env"in e&&(n.env=xe(e.env)),e.metadata&&typeof e.metadata=="object"&&!Array.isArray(e.metadata)&&(n.metadata=e.metadata),n}d(we,"normalizeForkInput");function xe(t){if(t==null)return[];if(!Array.isArray(t))throw new Error("Sandbox env must be an array.");return t.map(e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Sandbox env entries must be objects.");let n=e;if("value"in n)throw new Error("Sandbox env entries must use secretRef, not inline values.");let r=typeof n.name=="string"?n.name.trim():"",a=typeof n.secretRef=="string"?n.secretRef.trim():"";if(!r||!a)throw new Error("Sandbox env entries require name and secretRef.");return{name:r,secretRef:a}})}d(xe,"normalizeSandboxEnvRefsForApp");function gt(t){let e=m(t),n=typeof e.teamId=="string"?e.teamId.trim():"",r=typeof e.projectId=="string"?e.projectId.trim():"",a=typeof e.snapshotId=="string"?e.snapshotId.trim():"",s=typeof e.templateName=="string"?e.templateName.trim():"",i=typeof e.version=="string"?e.version.trim():"",u=typeof e.useCase=="string"?e.useCase.trim():"";if(!a&&!s&&!u)throw new Error("Sandbox template launch requires snapshotId, templateName, or useCase.");return{...we(t),...n?{teamId:n}:{},...r?{projectId:r}:{},...a?{snapshotId:a}:{},...s?{templateName:s}:{},...i?{version:i}:{},...u?{useCase:u}:{}}}d(gt,"normalizeTemplateLaunchInput");function bt(t){let e=m(t),n=typeof e.path=="string"?e.path.trim():"",r=Number(e.maxEntries);return{...n?{path:n}:{},...typeof e.recursive=="boolean"?{recursive:e.recursive}:{},...Number.isFinite(r)?{maxEntries:r}:{}}}d(bt,"normalizeListFilesInput");function It(t){let e=m(t),n=typeof e.query=="string"?e.query.trim():"";if(!n)throw new Error("Sandbox file search query is required.");let r=typeof e.path=="string"?e.path.trim():"",a=Number(e.maxResults);return{query:n,...r?{path:r}:{},...Number.isFinite(a)?{maxResults:a}:{}}}d(It,"normalizeSearchFilesInput");function D(t){let e=m(t),n=typeof e.path=="string"?e.path.trim():"";if(!n)throw new Error("Sandbox file path is required.");return{path:n,recursive:typeof e.recursive=="boolean"?e.recursive:void 0}}d(D,"normalizeDeleteFileInput");function St(t){let e=D(t),n=m(t),r=Number(n.offsetBytes),a=Number(n.maxBytes);return{path:e.path,...Number.isFinite(r)?{offsetBytes:r}:{},...Number.isFinite(a)?{maxBytes:a}:{}}}d(St,"normalizeDownloadFileInput");function wt(t){let e=m(t),n=typeof e.path=="string"?e.path.trim():"",r=typeof e.contents=="string"?e.contents:"",a=typeof e.contentsBase64=="string"?e.contentsBase64.trim():"";if(!n)throw new Error("Sandbox file path is required.");if(!r&&!a)throw new Error("Sandbox file contents are required.");return{path:n,contents:r,contentsBase64:a}}d(wt,"normalizeUploadFileInput");function xt(t){let e=m(t),n=typeof e.fromPath=="string"?e.fromPath.trim():"",r=typeof e.toPath=="string"?e.toPath.trim():"";if(!n||!r)throw new Error("Sandbox file source and target paths are required.");return{fromPath:n,toPath:r,overwrite:typeof e.overwrite=="boolean"?e.overwrite:void 0}}d(xt,"normalizeMoveFileInput");function vt(t){let e=m(t),n=typeof e.branch=="string"?e.branch.trim():"",r=typeof e.startPoint=="string"?e.startPoint.trim():"";if(!n)throw new Error("Sandbox git branch name is required.");return{branch:n,create:e.create===!0,...r?{startPoint:r}:{}}}d(vt,"normalizeGitBranchInput");function Rt(t){let e=m(t),n=typeof e.message=="string"?e.message.trim():"",r=e.all===!0,a=Array.isArray(e.paths)?e.paths.filter(s=>typeof s=="string"&&s.trim()!==""):[];if(!n)throw new Error("Sandbox git commit message is required.");if(!r&&a.length===0)throw new Error("Sandbox git commit requires all=true or at least one path.");return{message:n,...r?{all:!0}:{paths:a.map(s=>s.trim())}}}d(Rt,"normalizeGitCommitInput");function Ct(t){let e=m(t),n=typeof e.remote=="string"?e.remote.trim():"",r=typeof e.branch=="string"?e.branch.trim():"",a=e.rebase===!0,s=typeof e.ffOnly=="boolean"?e.ffOnly:void 0;if(a&&s)throw new Error("Sandbox git pull cannot use rebase and ff-only together.");return{...n?{remote:n}:{},...r?{branch:r}:{},...a?{rebase:a}:{},...typeof s=="boolean"?{ffOnly:s}:{}}}d(Ct,"normalizeGitPullInput");function Pt(t){let e=m(t),n=typeof e.remote=="string"?e.remote.trim():"",r=typeof e.branch=="string"?e.branch.trim():"";return{...n?{remote:n}:{},...r?{branch:r}:{},...e.setUpstream===!0?{setUpstream:!0}:{},...e.forceWithLease===!0?{forceWithLease:!0}:{}}}d(Pt,"normalizeGitPushInput");function An(t,e){let n=t.token?.trim();if(!n||t.accountState.state!=="signed_in"||!t.accountState.activeProfile)throw new Error("A signed-in OpenPond account is required.");let r=Oe(t.apiBaseUrl),a=/\/api\/sandboxes\/?$/.test(r)?r.replace(/\/api\/sandboxes\/?$/,"/v1"):r.replace(/\/sandboxes\/?$/,"");return{audience:new URL(a).origin,async request(s){let i=n.startsWith("opk_"),u=await z(a,n,s.path,{method:s.method??"GET",signal:s.signal,explicitBearerAuth:!i,headers:{...i?{"openpond-api-key":n}:{},...s.idempotencyKey?{"idempotency-key":s.idempotencyKey}:{},...e?{"X-OpenPond-Team-Id":e}:{}},...s.body?{body:JSON.stringify(s.body)}:{},...s.timeoutMs!==void 0?{timeoutMs:s.timeoutMs}:{}}),c=await u.json().catch(()=>({}));if(!u.ok)throw new Error(typeof c.error=="string"?c.error:`OpenPond API request failed with status ${u.status}`);return c}}}d(An,"createCapturedOpenPondPublicApiClient");async function oo(){return(await te()).client}d(oo,"resolveOpenPondSandboxClient");var kn="https://api.openpond.ai";async function ao(t){let{client:e,context:n,apiKey:r,sandboxApiUrl:a}=await te(),s=Ln(n,a);if(t.type==="list")return{sandboxes:await e.list(y(t.payload)),account:s};if(t.type==="snapshot_catalog"){let i=m(t.payload),u=typeof i.teamId=="string"?i.teamId.trim():"",c=typeof i.projectId=="string"?i.projectId.trim():"",p=typeof i.agentId=="string"?i.agentId.trim():"",b=typeof i.q=="string"?i.q.trim():"",l=typeof i.tag=="string"?i.tag.trim():"",g=typeof i.useCase=="string"?i.useCase.trim():"",P=i.replayState==="draft"||i.replayState==="validated"||i.replayState==="published"?i.replayState:void 0;return{...await e.snapshotCatalog({...u?{teamId:u}:{},...c?{projectId:c}:{},...p?{agentId:p}:{},...b?{q:b}:{},...l?{tag:l}:{},...g?{useCase:g}:{},...P?{replayState:P}:{}}),account:s}}if(t.type==="snapshot_create")return{...await e.createSnapshot(t.sandboxId,nt(t.payload)),account:s};if(t.type==="template_catalog"){let i=m(t.payload),u=typeof i.teamId=="string"?i.teamId.trim():"",c=typeof i.projectId=="string"?i.projectId.trim():"",p=typeof i.q=="string"?i.q.trim():"",b=typeof i.name=="string"?i.name.trim():"",l=typeof i.version=="string"?i.version.trim():"",g=typeof i.tag=="string"?i.tag.trim():"",P=typeof i.useCase=="string"?i.useCase.trim():"";return{...await e.templates({...u?{teamId:u}:{},...c?{projectId:c}:{},...p?{q:p}:{},...b?{name:b}:{},...l?{version:l}:{},...g?{tag:g}:{},...P?{useCase:P}:{}}),account:s}}if(t.type==="integration_connections"){let i=m(t.payload),u=typeof i.teamId=="string"?i.teamId.trim():"",c=typeof i.projectId=="string"?i.projectId.trim():"",p=typeof i.agentId=="string"?i.agentId.trim():"",b=be(i.status),l={...c?{projectId:c}:{},...p?{agentId:p}:{},status:b??"all"};return{...u?await e.integrationConnections({teamId:u,...l}):await ve(e,l),account:s}}if(t.type==="connected_app_status"){let i=m(t.payload),u=typeof i.teamId=="string"?i.teamId.trim():"",c=typeof i.projectId=="string"?i.projectId.trim():"",p=typeof i.agentId=="string"?i.agentId.trim():"",b=be(i.status)??"all",l={...c?{projectId:c}:{},...p?{agentId:p}:{},status:b},g=u?await e.integrationConnections({teamId:u,...l}):await ve(e,l);return{teamId:g.teamId,apps:je({connections:g.connections}),account:s}}if(t.type==="sandbox_runtime_list")return{runtimes:await e.listSandboxRuntimes(y(t.payload)),account:s};if(t.type==="sandbox_runtime_get")return{runtime:await e.getSandboxRuntime(t.runtimeId),account:s};if(t.type==="sandbox_runtime_create")return{runtime:await e.createSandboxRuntime(ge(t.payload)),account:s};if(t.type==="sandbox_runtime_sandbox_create")return{...await e.createSandboxRuntimeSandbox(t.runtimeId,Q(t.payload),{respondAsync:!0}),account:s};if(t.type==="sandbox_runtime_resume"){let i=await e.sandboxRuntime(t.runtimeId).resume(Q(t.payload),{respondAsync:!0});return{runtime:await e.getSandboxRuntime(t.runtimeId),sandbox:i,account:s}}if(t.type==="sandbox_runtime_preserve_source"){let i=m(t.payload);return{...await e.preserveSandboxRuntimeSource(t.runtimeId,{...typeof i.sandboxId=="string"&&i.sandboxId.trim()?{sandboxId:i.sandboxId.trim()}:{},...typeof i.message=="string"&&i.message.trim()?{message:i.message.trim()}:{},...i.source==="profile"?{source:"profile"}:{}},y(t.payload)),account:s}}if(t.type==="sandbox_runtime_promote"){let i=m(t.payload);return{...await e.promoteSandboxRuntime(t.runtimeId,{expectedTargetSha:typeof i.expectedTargetSha=="string"?i.expectedTargetSha.trim():"",...i.validationState==="pending"||i.validationState==="passed"?{validationState:i.validationState}:{},...typeof i.summary=="string"&&i.summary.trim()?{summary:i.summary.trim()}:{}},y(t.payload)),account:s}}if(t.type==="project_list")return{...await w({apiKey:r,sandboxApiUrl:a,path:v("/projects",y(t.payload))}),account:s};if(t.type==="profile_get")return{...await w({apiKey:r,sandboxApiUrl:a,path:v("/profile",y(t.payload))}),account:s};if(t.type==="profile_ensure")return{...await w({apiKey:r,sandboxApiUrl:a,path:v("/profile/ensure",y(t.payload)),method:"POST"}),account:s};if(t.type==="profile_push"){let i=m(t.payload),{teamId:u,...c}=i;return{...await w({apiKey:r,sandboxApiUrl:a,path:v("/profile/push",y(i)),method:"POST",body:c}),account:s}}if(t.type==="project_upsert")return{...await w({apiKey:r,sandboxApiUrl:a,path:v("/projects",y(t.payload)),method:"POST",body:m(t.payload)}),account:s};if(t.type==="project_get")return{...await w({apiKey:r,sandboxApiUrl:a,path:v(`/projects/${encodeURIComponent(t.projectId)}`,y(t.payload))}),account:s};if(t.type==="project_workspace")return{...await w({apiKey:r,sandboxApiUrl:a,path:v(`/projects/${encodeURIComponent(t.projectId)}/workspace`,y(t.payload))}),account:s};if(t.type==="project_git")return{...await w({apiKey:r,sandboxApiUrl:a,path:v(`/projects/${encodeURIComponent(t.projectId)}/git`,y(t.payload)),method:"POST"}),account:s};if(t.type==="project_sync")return{...await w({apiKey:r,sandboxApiUrl:a,path:v(`/projects/${encodeURIComponent(t.projectId)}/sync`,y(t.payload)),method:"POST"}),account:s};if(t.type==="project_source_upload"){let i=m(t.payload),{teamId:u,...c}=i;return{...await w({apiKey:r,sandboxApiUrl:a,path:v(`/projects/${encodeURIComponent(t.projectId)}/source`,y(i)),method:"POST",body:c}),account:s}}if(t.type==="project_archive")return{...await w({apiKey:r,sandboxApiUrl:a,path:v(`/projects/${encodeURIComponent(t.projectId)}`,y(t.payload)),method:"DELETE"}),account:s};if(t.type==="agent_list")return{...await w({apiKey:r,sandboxApiUrl:a,path:v("/agents",y(t.payload))}),account:s};if(t.type==="agent_upsert")return{...await w({apiKey:r,sandboxApiUrl:a,path:v("/agents",y(t.payload)),method:"POST",body:m(t.payload)}),account:s};if(t.type==="agent_run")return{...await w({apiKey:r,sandboxApiUrl:a,path:v(`/agents/${encodeURIComponent(t.agentId)}/run`,y(t.payload)),method:"POST",body:m(t.payload)}),account:s};if(t.type==="agent_source_deploy_plan")return{...await w({apiKey:r,sandboxApiUrl:a,path:v(`/agents/${encodeURIComponent(t.agentId)}/source/deploy-plan`,y(t.payload))}),account:s};if(t.type==="agent_source_checks"){let i=m(t.payload),{teamId:u,...c}=i;return{...await w({apiKey:r,sandboxApiUrl:a,path:v(`/agents/${encodeURIComponent(t.agentId)}/source/checks`,y(i)),method:"POST",body:c,timeoutMs:900*1e3}),account:s}}if(t.type==="agent_source_publish"){let i=m(t.payload),{teamId:u,...c}=i;return{...await w({apiKey:r,sandboxApiUrl:a,path:v(`/agents/${encodeURIComponent(t.agentId)}/source/publish`,y(i)),method:"POST",body:c}),account:s}}if(t.type==="create")return{sandbox:await e.create(Z(t.payload)),account:s};if(t.type==="get")return{sandbox:await e.get(t.sandboxId),account:s};if(t.type==="start")return{...await e.start(t.sandboxId,{respondAsync:!0}),account:s};if(t.type==="delete"){let i=await Et(e,t.sandboxId,{failOnUnpreservedChanges:t.failOnUnpreservedChanges}),u=await e.delete(t.sandboxId,i).catch(c=>kt("delete",e,t.sandboxId,c));return At("delete",u),{sandbox:u,account:s}}if(t.type==="exec")return{...await e.exec(t.sandboxId,pt(t.payload)),account:s};if(t.type==="action_run")return{...await zn({apiKey:r,sandboxApiUrl:a,path:`/sandboxes/${encodeURIComponent(t.sandboxId)}/actions/${encodeURIComponent(t.actionName)}/run`,method:"POST",body:m(t.payload)}),account:s};if(t.type==="open_port")return{...await e.openPort(t.sandboxId,ht(t.payload)),account:s};if(t.type==="snapshot_update")return{...await e.updateSnapshot(t.sandboxId,t.snapshotId,ft(t.payload)),account:s};if(t.type==="snapshot_validate")return{...await e.validateSnapshot(t.sandboxId,t.snapshotId,yt(t.payload)),account:s};if(t.type==="snapshot_publish")return{...await e.publishSnapshot(t.sandboxId,t.snapshotId),account:s};if(t.type==="replays")return{...await e.listReplays(y(t.payload)),account:s};if(t.type==="replay_start")return{...await e.startReplay(rt(t.payload)),account:s};if(t.type==="replay_get")return{...await e.getReplay(t.replayId,y(t.payload)),account:s};if(t.type==="replay_logs")return{...await e.getReplayLogs(t.replayId,y(t.payload)),account:s};if(t.type==="replay_artifacts")return{...await e.getReplayArtifacts(t.replayId,y(t.payload)),account:s};if(t.type==="replay_cancel")return{...await e.cancelReplay(t.replayId,y(t.payload)),account:s};if(t.type==="schedule_create")return{...await e.createSchedule(m(t.payload)),account:s};if(t.type==="template_launch")return{...await e.launchTemplate(gt(t.payload)),account:s};if(t.type==="fork")return{...await e.fork(t.sandboxId,we(t.payload)),account:s};if(t.type==="stop"){let i=await Et(e,t.sandboxId,{failOnUnpreservedChanges:t.failOnUnpreservedChanges}),u=await e.stop(t.sandboxId,i).catch(c=>kt("stop",e,t.sandboxId,c));return At("stop",u.sandbox),{...u,account:s}}if(t.type==="receipts")return{receipts:await e.receipts(t.sandboxId),account:s};if(t.type==="logs")return{logs:await e.logs(t.sandboxId),account:s};if(t.type==="integration_leases")return{...await e.integrationLeases(t.sandboxId),account:s};if(t.type==="integration_attach")return{...await e.attachIntegrationConnection(t.sandboxId,Ie(t.payload)),account:s};if(t.type==="integration_remove")return{...await e.removeIntegrationLease(t.sandboxId,Se(t.payload)),account:s};if(t.type==="process_start")return{...await e.startProcess(t.sandboxId,mt(t.payload)),account:s};if(t.type==="process_get")return{...await e.getProcess(t.sandboxId,t.processId,lt(t.payload)),account:s};if(t.type==="upload_file"){let i=wt(t.payload);return{...i.contentsBase64?await e.uploadFileBase64(t.sandboxId,i.path,i.contentsBase64):await e.uploadFile(t.sandboxId,i.path,i.contents),account:s}}if(t.type==="download_file"){let i=St(t.payload);return{...await e.downloadFileResponse(t.sandboxId,i),account:s}}if(t.type==="list_files")return{...await e.listFiles(t.sandboxId,bt(t.payload)),account:s};if(t.type==="search_files")return{...await e.searchFiles(t.sandboxId,It(t.payload)),account:s};if(t.type==="delete_file"){let i=D(t.payload);return{...await e.deleteFile(t.sandboxId,i.path,{recursive:i.recursive}),account:s}}if(t.type==="stat_file"){let i=D(t.payload);return{...await e.statFile(t.sandboxId,i.path),account:s}}if(t.type==="mkdir"){let i=D(t.payload);return{...await e.mkdir(t.sandboxId,{path:i.path,recursive:i.recursive}),account:s}}if(t.type==="move_file"){let i=xt(t.payload);return{...await e.moveFile(t.sandboxId,i),account:s}}if(t.type==="git_status")return{...await e.gitStatus(t.sandboxId),account:s};if(t.type==="git_diff"){let i=m(t.payload),u=typeof i.baseRef=="string"?i.baseRef.trim():"";return{...await e.gitDiff(t.sandboxId,{...u?{baseRef:u}:{}}),account:s}}if(t.type==="git_export_patch"){let i=m(t.payload),u=typeof i.baseRef=="string"?i.baseRef.trim():"";return{...await e.gitExportPatch(t.sandboxId,{...u?{baseRef:u}:{}}),account:s}}if(t.type==="git_branch")return{...await e.gitBranch(t.sandboxId,vt(t.payload)),account:s};if(t.type==="git_commit")return{...await e.gitCommit(t.sandboxId,Rt(t.payload)),account:s};if(t.type==="git_pull")return{...await e.gitPull(t.sandboxId,Ct(t.payload)),account:s};if(t.type==="git_push")return{...await e.gitPush(t.sandboxId,Pt(t.payload)),account:s};throw new Error(`Unsupported sandbox action: ${t.type}`)}d(ao,"sandboxRequestPayload");async function so(t={}){let{client:e}=await te();return t.teamId?e.integrationConnections(t):ve(e,{...t.projectId?{projectId:t.projectId}:{},...t.agentId?{agentId:t.agentId}:{},status:t.status??"all"})}d(so,"listSandboxIntegrationConnections");async function Et(t,e,n={}){let r=await t.get(e).then(a=>!qt(a)).catch(()=>!0);return{failOnUnpreservedChanges:n.failOnUnpreservedChanges,...r?{respondAsync:!0}:{}}}d(Et,"sandboxLifecycleRequestOptions");function qt(t){return t.reservation.status==="reserved"&&(t.state==="creating"||Ut.has(t.state))}d(qt,"sandboxLifecycleRequiresSynchronousAccounting");function At(t,e){if(Ut.has(e.state)&&e.reservation.status==="reserved")throw new Error(`Sandbox ${t} reached ${e.state}, but reservation ${e.reservation.id} is still reserved. Cleanup accounting has not settled; retry status before treating cleanup as complete.`)}d(At,"assertTerminalSandboxLifecycleSettled");async function kt(t,e,n,r){let a=await e.get(n).catch(()=>null);if(a&&qt(a)){let s=r instanceof Error?r.message:String(r);throw new Error(`Sandbox ${t} failed while sandbox ${n} is still creating with active reservation ${a.reservation.id}. Cleanup accounting has not settled; retry status before treating cleanup as complete. Original error: ${s}`)}throw r instanceof Error?r:new Error(String(r))}d(kt,"throwSandboxLifecycleRequestFailure");var Ut=new Set(["stopped","archived","deleted","error"]);async function ve(t,e){let n=await t.listOrganizations().catch(()=>{throw new Error("Connected app status is unavailable because organizations could not be loaded.")}),r=jn(n),a=$n(n)||null;if(r.length===0)return{teamId:a,connections:[]};let s=await Promise.all(r.map(u=>t.integrationConnections({teamId:u,...e.projectId?{projectId:e.projectId}:{},...e.agentId?{agentId:e.agentId}:{},status:e.status}).catch(()=>null))),i=On(s);return{teamId:qn(i)??a??i.find(u=>u.teamId.trim())?.teamId.trim()??null,connections:Un(i)}}d(ve,"resolveImplicitConnectedAppStatusConnections");function qn(t){for(let e of t){if((e.connections?.length??0)===0)continue;let n=e.teamId?.trim();if(n)return n}return null}d(qn,"connectedAppStatusTeamIdWithConnections");function Un(t){let e=[],n=new Set;for(let r of t)for(let a of r.connections??[]){let s=a.id.trim()||[a.teamId,a.provider,a.providerAccountId].join(":");n.has(s)||(n.add(s),e.push(a))}return e}d(Un,"mergeConnectedAppStatusConnectionResults");function On(t){let e=t.filter(a=>a!==null),n=t.length-e.length,r=e.reduce((a,s)=>a+(s.connections?.length??0),0);if(n>0&&r===0)throw new Error("Connected app status is unavailable because one or more team integration connection lookups could not be loaded.");return e}d(On,"successfulConnectedAppStatusConnectionResults");function $n(t){let e=t.filter(n=>Ot(n)==="active");return ee(e.find(n=>n.role==="owner"))??ee(e.find(n=>n.role==="admin"))??ee(e[0])??""}d($n,"selectImplicitConnectedAppStatusTeamId");function jn(t){let e=[],n=new Set;for(let r of t){if(Ot(r)!=="active")continue;let a=ee(r);!a||n.has(a)||(n.add(a),e.push(a))}return e}d(jn,"implicitConnectedAppStatusTeamIds");function ee(t){if(!t)return null;let e=t.id;return(typeof t.teamId=="string"?t.teamId:typeof e=="string"?e:"").trim()||null}d(ee,"organizationTeamId");function Ot(t){return typeof t.status=="string"?t.status:"active"}d(Ot,"organizationStatus");async function te(){let t=$(process.env.OPENPOND_SANDBOX_API_URL),e=process.env.OPENPOND_SANDBOX_API_KEY?.trim();if(e&&t)return{client:Y({apiKey:e,sandboxApiUrl:t}),context:await ue().catch(()=>null),apiKey:e,sandboxApiUrl:O(t)};let n=await ue(),r=n.token?.trim();if(!r)throw new Error("OpenPond account API key is required to manage sandboxes.");if(t)return{client:Y({apiKey:r,sandboxApiUrl:t}),context:n,apiKey:r,sandboxApiUrl:O(t)};let a=Nn(n);return{client:Y({apiKey:r,baseUrl:a}),context:n,apiKey:r,sandboxApiUrl:O(a)}}d(te,"resolveSandboxClient");function _n(t){return O(t).replace(/\/sandboxes\/?$/,"")}d(_n,"sandboxApiRootUrl");function Tn(t){let e=O(t);return/\/api\/sandboxes\/?$/.test(e)?e.replace(/\/api\/sandboxes\/?$/,"/v1"):e.replace(/\/sandboxes\/?$/,"")}d(Tn,"sandboxPublicApiRootUrl");function v(t,e){let n=new URLSearchParams;return e.teamId&&n.set("teamId",e.teamId),e.projectId&&n.set("projectId",e.projectId),e.agentId&&n.set("agentId",e.agentId),`${t}${n.size>0?`?${n.toString()}`:""}`}d(v,"sandboxScopedCollectionPath");async function zn(t){let e=await z(_n(t.sandboxApiUrl),t.apiKey,t.path,{method:t.method??"GET",...t.body?{body:JSON.stringify(t.body)}:{}}),n=await e.json().catch(()=>({}));if(!e.ok){let r=typeof n.error=="string"?n.error:`Sandbox API request failed with status ${e.status}`;throw new Error(r)}return n}d(zn,"requestSandboxApiRoot");async function w(t){let e=await z(Tn(t.sandboxApiUrl),t.apiKey,t.path,{method:t.method??"GET",signal:t.signal,headers:{...t.idempotencyKey?{"idempotency-key":t.idempotencyKey}:{},...t.teamId?{"X-OpenPond-Team-Id":t.teamId}:{}},...t.body?{body:JSON.stringify(t.body)}:{},...t.timeoutMs!==void 0?{timeoutMs:t.timeoutMs}:{}}),n=await e.json().catch(()=>({}));if(!e.ok){let r=typeof n.error=="string"?n.error:`Sandbox API request failed with status ${e.status}`;throw new Error(r)}return n}d(w,"requestSandboxPublicApiRoot");async function io(t){let{apiKey:e,sandboxApiUrl:n}=await te();return w({apiKey:e,sandboxApiUrl:n,...t})}d(io,"requestOpenPondPublicApi");function Ln(t,e){if(!t)return{label:"Sandbox API",handle:null,baseUrl:null,sandboxApiUrl:e,state:"signed_out"};let n=t.accountState;return{label:n.label,handle:n.activeProfile?.handle??t.account?.handle??null,baseUrl:n.baseUrl??t.account?.baseUrl??null,sandboxApiUrl:e,state:n.state}}d(Ln,"sandboxAccountSummary");function Nn(t){return $(process.env.OPENPOND_SANDBOX_BASE_URL)??$(process.env.OPENPOND_API_URL)??$(t.apiBaseUrl)??$(t.account?.baseUrl)??$(t.config.baseUrl)??kn}d(Nn,"resolveSandboxBaseUrl");export{or as a,vr as b,We as c,tn as d,nn as e,qr as f,rn as g,Ur as h,An as i,oo as j,ao as k,so as l,io as m};
@@ -1,2 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as H,g as O,h as M,i as q,j as V,k as F,l as W,m as G,n as K,p as B}from"./chunk-GOIKLFXK.js";import{a as x,u as D}from"./chunk-TW3SRBLU.js";import{C,Sa as z}from"./chunk-PGO4FRHU.js";import{m as I}from"./chunk-VNJAAYNQ.js";import{Ba as A,ra as $}from"./chunk-PBZCXPPC.js";import{A as e}from"./chunk-PF56N7ZY.js";import{a as k}from"./chunk-FTQLQJQV.js";var Q=e.enum(["create","save","publish","begin_version"]),ee=e.object({operationId:e.string().trim().min(1).max(240),kind:Q,requestHash:e.string().regex(/^[a-f0-9]{64}$/),receipt:q,base:q.nullable()}).strict().superRefine((t,a)=>{let{receipt:r,base:s,kind:i}=t;(s&&(s.teamId!==r.teamId||s.datasetId!==r.datasetId||s.revision+1!==r.revision)||!s&&r.revision!==1)&&a.addIssue({code:"custom",message:"Operation recovery history identity/revision mismatch."}),s&&((s.ownerScope??"workspace")!==(r.ownerScope??"workspace")||s.originProjectId!==r.originProjectId||s.workspace.draft.createdAt!==r.workspace.draft.createdAt)&&a.addIssue({code:"custom",message:"Operation recovery cannot change Dataset ownership or origin."});let n=s?r.workspace.draft.status==="published"?"publish":s.workspace.draft.status==="published"?"begin_version":"save":"create";i!==n&&a.addIssue({code:"custom",message:"Operation recovery kind differs from its retained lifecycle."})}),o=e.string().trim().min(1).max(240),u=e.string().regex(/^[a-f0-9]{64}$/),b=e.iso.datetime(),d=e.number().int().nonnegative(),l=e.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),te=e.object({id:o,projectId:o,maximumMicroUsd:l.positive(),maximumSandboxSeconds:d.max(10800)}).strict(),ae=e.object({schemaVersion:e.literal("openpond.datasetPreparationGrant.v1"),id:o,teamId:o,ownerUserId:o,projectId:o,maximumMicroUsd:l,maximumSandboxSeconds:d,settledMicroUsd:l,heldMicroUsd:l,sandboxSeconds:d,heldSandboxSeconds:d,unresolvedCalls:d,cleanupPending:d,createdAt:b,updatedAt:b}).strict(),T=e.enum(["coding_change","debugging","code_explanation","structured_text","artifact_work"]),J=e.enum(["inventory","preview","reconstruction","grader_authoring","qualification","release"]),se=e.enum(["draft","running","pausing","paused","needs_attention","preview_ready","ready","releasing","completed","insufficient_data","budget_exhausted","cancelling","cancelled","failed"]),re=e.object({projectId:o,from:b,to:b,importCutoff:b,connections:e.array(o).min(1).max(50),excludedSessions:e.array(e.object({connectionId:o,sourceKeyHash:u,nativeRevisionHash:u,reason:e.enum(["source_read_failed","native_session_not_ready"]),explanation:e.string().trim().min(1).max(2e3)}).strict()).max(1e4).default([])}).strict().superRefine((t,a)=>{Date.parse(t.from)>=Date.parse(t.to)&&a.addIssue({code:"custom",message:"Source event-time window must be nonempty."}),new Set(t.connections).size!==t.connections.length&&a.addIssue({code:"custom",message:"Source connections must be unique."}),t.excludedSessions.some(r=>!t.connections.includes(r.connectionId))&&a.addIssue({code:"custom",message:"Excluded sessions must belong to selected source connections."}),new Set(t.excludedSessions.map(r=>JSON.stringify([r.connectionId,r.sourceKeyHash]))).size!==t.excludedSessions.length&&a.addIssue({code:"custom",message:"Source session exclusions must be unique."})}),X=e.object({source:re,taskClasses:e.array(T).min(1).max(5),limits:e.object({maximumConversations:e.number().int().min(1).max(1e4),maximumCandidates:e.number().int().min(1).max(1e4),acceptedTarget:e.number().int().min(1).max(1e4),maximumRepairsPerCandidate:e.number().int().min(0).max(5),maximumEvidenceBytesPerConversation:e.number().int().min(1024).max(2e6)}).strict(),researcher:e.object({modelId:o,maximumOutputTokens:e.number().int().min(1).max(32768)}).strict(),adjudicator:e.object({modelId:o,maximumOutputTokens:e.number().int().min(1).max(32768)}).strict(),grading:e.discriminatedUnion("mode",[e.object({mode:e.literal("auto")}).strict(),e.object({mode:e.literal("existing_only")}).strict(),e.object({mode:e.literal("manual"),releases:e.array(x).min(1).max(100)}).strict()]),budget:e.object({grantId:o,maximumMicroUsd:l.positive(),previewMaximumMicroUsd:l,qualificationMaximumMicroUsdPerCandidate:l,maximumSandboxSeconds:d.max(10800)}).strict(),finish:e.enum(["stop_ready","create_private_version"]),execution:e.enum(["preview_only","prepare"]),allowPartialVersion:e.boolean(),population:e.literal("development")}).strict().superRefine((t,a)=>{t.limits.acceptedTarget>t.limits.maximumCandidates&&a.addIssue({code:"custom",message:"Accepted target exceeds candidate scan limit."}),t.budget.previewMaximumMicroUsd>t.budget.maximumMicroUsd&&a.addIssue({code:"custom",message:"Preview allowance exceeds the shared preparation ceiling."}),new Set(t.taskClasses).size!==t.taskClasses.length&&a.addIssue({code:"custom",message:"Task classes must be unique."})}),ie=e.object({operationId:o,expectedDatasetRevision:e.number().int().positive(),policy:X}).strict(),ne=e.discriminatedUnion("action",[e.object({action:e.enum(["start","pause","resume","cancel","release"]),operationId:o,expectedRevision:e.number().int().positive()}).strict(),e.object({action:e.literal("resolve"),operationId:o,expectedRevision:e.number().int().positive(),candidateId:o,decision:e.enum(["retry","exclude"]),reason:e.string().trim().min(1).max(5e3)}).strict()]),oe=e.object({conversations:d,importedTurns:d,selectedTurns:d,queuedSnapshots:d.nullable(),failedSessions:d.nullable(),skippedSessions:d.nullable(),lastAdmissionAt:b.nullable(),complete:e.boolean(),sourceComplete:e.boolean().default(!1),excludedSessions:d.default(0),reasons:e.array(e.object({code:o,message:e.string().trim().min(1).max(2e3)}).strict()).max(100),sourceInventoryHash:u}).strict(),de=e.object({maximumMicroUsd:l,settledMicroUsd:l,heldMicroUsd:l,unresolvedCalls:d,sandboxSeconds:d,cleanupPending:d,complete:e.boolean()}).strict(),ce=e.object({sampleConversations:d,sampleTurns:d,candidateCount:d,modelId:o,modelConfigurationHash:u,callReceiptIds:e.array(o).max(2e3),inputTokens:d.nullable(),outputTokens:d.nullable(),classes:e.array(e.object({taskClass:T,candidates:d,assessment:e.enum(["executable","calibrated_judge","unsupported"]),requirements:e.array(e.string().trim().min(1).max(5e3)).max(20)}).strict()).max(5),exclusions:e.array(e.object({code:o,count:d,reason:e.string().trim().min(1).max(5e3)}).strict()).max(100),estimates:e.array(e.object({stage:J,minimumMicroUsd:l,maximumMicroUsd:l,assumptions:e.array(e.string().trim().min(1).max(2e3)).min(1).max(20)}).strict().refine(t=>t.minimumMicroUsd<=t.maximumMicroUsd,"Estimate range is reversed.")).max(6),createdAt:b}).strict(),U=e.object({schemaVersion:e.literal("openpond.datasetPreparationRun.v1"),id:o,operationId:o,teamId:o,ownerUserId:o,datasetId:o,datasetRevision:e.number().int().positive(),revision:e.number().int().positive(),requestHash:u,policy:X,status:se,stage:J,coverage:oe.nullable(),preview:ce.nullable(),counts:e.object({scannedConversations:d,scannedTurns:d,candidates:d,reconstructed:d,qualifying:d,qualified:d,excluded:d,needsAttention:d}).strict(),accounting:de,publication:e.object({datasetId:o,workspaceRevision:e.number().int().positive(),release:x}).strict().nullable(),error:e.object({code:o,message:e.string().trim().min(1).max(5e3)}).strict().nullable(),createdAt:b,updatedAt:b}).strict().superRefine((t,a)=>{t.accounting.maximumMicroUsd!==t.policy.budget.maximumMicroUsd&&a.addIssue({code:"custom",message:"Accounting authority differs from the saved preparation policy."}),t.counts.qualified+t.counts.excluded+t.counts.needsAttention>t.counts.candidates&&a.addIssue({code:"custom",message:"Preparation outcomes exceed the candidate population."}),t.status==="preview_ready"&&(t.policy.execution!=="preview_only"||t.stage!=="preview"||!t.preview||!t.coverage?.complete||!t.accounting.complete)&&a.addIssue({code:"custom",message:"Preview readiness requires a preview-only policy, reconciled source coverage and settled preview calls."}),["ready","releasing","completed"].includes(t.status)&&(t.counts.qualified===0||!t.policy.allowPartialVersion&&t.counts.qualified<t.policy.limits.acceptedTarget)&&a.addIssue({code:"custom",message:"Preparation cannot report readiness below its accepted target."}),["ready","releasing","completed"].includes(t.status)&&(t.policy.execution!=="prepare"||!t.preview||!t.coverage?.complete||!t.accounting.complete)&&a.addIssue({code:"custom",message:"Dataset readiness requires full preparation authority, reconciled source coverage, preview and final accounting."}),t.status==="completed"&&(!t.publication||!t.accounting.complete)&&a.addIssue({code:"custom",message:"Completed preparation requires publication and reconciled accounting."}),t.status==="cancelled"&&(!t.accounting.complete||t.accounting.cleanupPending>0)&&a.addIssue({code:"custom",message:"Cancellation requires settled resource obligations."})}),me=e.object({teamId:o,datasetId:o,runs:e.array(U).max(50),nextCursor:o.nullable()}).strict(),P=e.object({source:H,startSequence:d,endSequence:d,role:e.enum(["requirement","initial_context","outcome","correction","verification"])}).strict().superRefine((t,a)=>{t.endSequence<t.startSequence&&a.addIssue({code:"custom",message:"Evidence span must be ordered."})}),pe=e.object({schemaVersion:e.literal("openpond.preparedTaskProvenance.v1"),candidateId:o,preparationId:o,familyKey:o,sourceSpans:e.array(P).min(1).max(200),firstAvailableAt:b,initialInputHash:u,initialEnvironmentHash:u,initialAssetsHash:u.nullable(),sourceScopeHash:u}).strict().superRefine((t,a)=>{t.sourceSpans.some(s=>s.role==="requirement")||a.addIssue({code:"custom",message:"A reconstructed task needs a source requirement."});let r=new Set;for(let s of t.sourceSpans){t.sourceSpans.some(n=>n!==s&&n.source.id===s.source.id&&n.source.snapshotHash===s.source.snapshotHash&&n.role!==s.role&&s.startSequence<=n.endSequence&&n.startSequence<=s.endSequence)&&a.addIssue({code:"custom",message:"Evidence offsets cannot have conflicting roles."});let i=JSON.stringify([s.source,s.startSequence,s.endSequence]);r.has(i)&&a.addIssue({code:"custom",message:"Evidence span is duplicated or crosses public/private roles."}),r.add(i)}}),ue=e.object({schemaVersion:e.literal("openpond.preparedTaskQualification.v1"),id:o,candidateId:o,preparationId:o,taskHash:u,environmentHash:u,packageHash:u,graderBindings:e.array(e.object({id:o,version:o,contentHash:u,origin:e.enum(["reused","adapted","authored"])}).strict()).min(1).max(100),checks:e.array(e.object({id:o,label:e.enum(["positive","incorrect","incomplete","adversarial","clean_reset"]),executionReceiptId:o,expectedPassed:e.boolean(),observedPassed:e.boolean().nullable(),infrastructureError:o.nullable()}).strict()).min(5).max(500),independentEvidenceRefs:e.array(o).min(1).max(100),judgeCalibration:e.enum(["not_applicable","passed","failed","pending"]),cleanup:e.enum(["completed","pending"]),passed:e.boolean(),createdAt:b}).strict().superRefine((t,a)=>{if(!t.passed)return;let r=new Set(t.checks.map(s=>s.label));["positive","incorrect","incomplete","adversarial","clean_reset"].some(s=>!r.has(s))&&a.addIssue({code:"custom",message:"Qualified tasks require positive, negative, adversarial and clean-reset evidence."}),(t.cleanup!=="completed"||["pending","failed"].includes(t.judgeCalibration)||t.checks.some(s=>s.infrastructureError!==null||s.observedPassed!==s.expectedPassed))&&a.addIssue({code:"custom",message:"Failed, uncalibrated or uncleared checks cannot qualify a task."}),t.checks.some(s=>s.expectedPassed!==["positive","clean_reset"].includes(s.label))&&a.addIssue({code:"custom",message:"Qualification witnesses must pass positives/resets and reject incorrect, incomplete and adversarial outputs."})}),le=e.object({id:o,runId:o,revision:e.number().int().positive(),taskClass:T,status:e.enum(["discovered","reconstructing","authoring","qualifying","qualified","excluded","needs_attention"]),objective:e.string().trim().min(1).max(2e4),provenance:pe.nullable(),qualification:ue.nullable(),reason:e.object({code:o,message:e.string().trim().min(1).max(5e3)}).strict().nullable(),attempts:d.max(6)}).strict().superRefine((t,a)=>{t.status==="qualified"&&(!t.provenance||!t.qualification?.passed)&&a.addIssue({code:"custom",message:"Candidate admission requires reconstruction and qualification receipts."}),t.provenance&&(t.provenance.candidateId!==t.id||t.provenance.preparationId!==t.runId)&&a.addIssue({code:"custom",message:"Candidate provenance identity mismatch."}),t.qualification&&(t.qualification.candidateId!==t.id||t.qualification.preparationId!==t.runId)&&a.addIssue({code:"custom",message:"Candidate qualification identity mismatch."})}),p=e.string().trim().min(1).max(240),he=e.object({teamId:p,datasetId:p,runId:p,candidates:e.array(le).max(50),nextCursor:p.nullable()}).strict(),L=class extends Error{static{k(this,"DatasetPreparationRequestError")}constructor(t,a,r){super(r),this.status=t,this.code=a,this.name="DatasetPreparationRequestError"}status;code},fe=class{static{k(this,"OpenPondDatasetPreparationClient")}constructor(t){this.options=t;let a=new URL(t.baseUrl);if(!["http:","https:"].includes(a.protocol)||a.username||a.password||a.search||a.hash||!t.apiKey.trim()||!t.teamId.trim())throw new Error("A clean API origin and workspace credentials are required.");this.baseUrl=a.toString().replace(/\/+$/,"")}options;baseUrl;async create(t,a,r){let s=ie.parse(a),i=this.readRun(await this.request(t,"","POST",s,r),t);if(i.operationId!==s.operationId||i.requestHash!==I(s)||i.datasetRevision!==s.expectedDatasetRevision)throw new Error("Preparation creation receipt differs from the saved intent.");return i}async createGrant(t,a,r){let s=te.parse(a),i=this.readGrant(await this.request(t,"/grants","POST",s,r));if(i.id!==s.id||i.projectId!==s.projectId||i.maximumMicroUsd!==s.maximumMicroUsd||i.maximumSandboxSeconds!==s.maximumSandboxSeconds)throw new Error("Preparation grant receipt differs from the saved limits.");return i}async getGrant(t,a,r){let s=this.readGrant(await this.request(t,`/grants/${encodeURIComponent(p.parse(a))}`,"GET",void 0,r));if(s.id!==a)throw new Error("Preparation grant identity mismatch.");return s}readGrant(t){let a=ae.parse(t);if(a.teamId!==this.options.teamId)throw new Error("Preparation grant workspace mismatch.");return a}async get(t,a,r){return this.readRun(await this.request(t,`/${encodeURIComponent(p.parse(a))}`,"GET",void 0,r),t,a)}async list(t,a={}){let r=new URLSearchParams(a.cursor?{cursor:p.parse(a.cursor)}:{}),s=me.parse(await this.request(t,`?${r}`,"GET",void 0,a.signal));if(s.teamId!==this.options.teamId||s.datasetId!==t||s.runs.some(i=>i.teamId!==s.teamId||i.datasetId!==t)||new Set(s.runs.map(i=>i.id)).size!==s.runs.length)throw new Error("Preparation list scope/identity mismatch.");return s}async command(t,a,r,s){let i=ne.parse(r),n=this.readRun(await this.request(t,`/${encodeURIComponent(p.parse(a))}/commands`,"POST",i,s),t,a);if(n.revision<i.expectedRevision+1)throw new Error("Preparation command did not advance the expected revision.");return n}async operationResult(t,a,r){let s=await this.request(t,`/operations/${encodeURIComponent(p.parse(a))}`,"GET",void 0,r);if(s===null)return null;let i=e.object({operationId:p,requestHash:e.string().regex(/^[a-f0-9]{64}$/),run:U}).strict().parse(s);if(i.operationId!==a)throw new Error("Preparation operation recovery identity mismatch.");return this.readRun(i.run,t),i}async candidates(t,a,r={}){let s=new URLSearchParams(r.cursor?{cursor:p.parse(r.cursor)}:{}),i=he.parse(await this.request(t,`/${encodeURIComponent(p.parse(a))}/candidates?${s}`,"GET",void 0,r.signal));if(i.teamId!==this.options.teamId||i.datasetId!==t||i.runId!==a||i.candidates.some(n=>n.runId!==a)||new Set(i.candidates.map(n=>n.id)).size!==i.candidates.length)throw new Error("Preparation candidate page scope/identity mismatch.");return i}readRun(t,a,r){let s=U.parse(t);if(s.teamId!==this.options.teamId||s.datasetId!==a||r&&s.id!==r)throw new Error("Preparation run scope/identity mismatch.");return s}async request(t,a,r,s,i){let n=await(this.options.fetch??fetch)(`${this.baseUrl}/v1/dataset-workspaces/${encodeURIComponent(p.parse(t))}/preparations${a}`,{method:r,signal:i,redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"X-OpenPond-Team-Id":this.options.teamId,"Content-Type":"application/json"},...s===void 0?{}:{body:JSON.stringify(s)}});if(!n.body)throw n.ok?new Error("Preparation response is empty."):new L(n.status,"dataset_preparation_request_failed",`Dataset preparation request failed (${n.status}).`);let m=n.body.getReader(),h=[],v=0;try{for(;;){let g=await m.read();if(g.done)break;if(v+=g.value.byteLength,v>(n.ok?8*1024*1024:64*1024))throw new Error("Preparation response exceeds its bounded page.");h.push(g.value)}}finally{await m.cancel()}let y=new Uint8Array(v),c=0;for(let g of h)y.set(g,c),c+=g.length;let f=new TextDecoder("utf-8",{fatal:!0}).decode(y);if(!n.ok){let g=null;try{g=JSON.parse(f)}catch{}let w=e.object({code:e.string().max(240),message:e.string().max(5e3)}).safeParse(g);throw new L(n.status,w.success?w.data.code:"dataset_preparation_request_failed",w.success?w.data.message:`Dataset preparation request failed (${n.status}).`)}return JSON.parse(f)}},Me=class{static{k(this,"OpenPondDatasetWorkspaceClient")}constructor(t){this.options=t;let a=new URL(t.baseUrl);if(!["http:","https:"].includes(a.protocol)||a.username||a.password||a.search||a.hash||!t.apiKey.trim()||!t.teamId.trim())throw new Error("A clean API origin and workspace credentials are required.");this.baseUrl=a.toString().replace(/\/+$/,""),this.preparations=new fe(t)}options;baseUrl;preparations;async list(t={}){let{signal:a,...r}=t,s=O.parse(r),i=new URLSearchParams(Object.entries(s).filter(([,m])=>m!==void 0).map(([m,h])=>[m,String(h)])),n=G.parse(await this.request(`?${i}`,"GET",void 0,a));if(n.teamId!==this.options.teamId||n.datasets.length>s.limit||new Set(n.datasets.map(m=>m.id)).size!==n.datasets.length)throw new Error("Dataset list workspace/page mismatch.");return n}async get(t,a){return this.readback(await this.request(`/${encodeURIComponent(t)}`,"GET",void 0,a),t)}async operationResult(t,a){let r=Q.parse(a.kind),s=new URLSearchParams({kind:r,...a.datasetId?{datasetId:a.datasetId}:{}}),i=await this.request(`/operations/${encodeURIComponent(t)}?${s}`,"GET",void 0,a.signal,132*1024*1024);if(i===null)return null;let n=ee.parse(i);if(this.readback(n.receipt,n.receipt.datasetId),n.base&&this.readback(n.base,n.receipt.datasetId),n.operationId!==t||n.kind!==r||a.datasetId&&n.receipt.datasetId!==a.datasetId||a.requestHash&&n.requestHash!==a.requestHash)throw new Error("Dataset operation recovery identity/request mismatch.");return n}async beginVersion(t,a,r){let s=F.parse(a),i=this.readback(await this.request(`/${encodeURIComponent(t)}/begin-version`,"POST",s,r),t);if(i.revision!==s.expectedRevision+1||i.workspace.draft.status!=="draft"||!i.publication||!i.workspace.draft.publishedTasksetRef)throw new Error("Editable version receipt mismatch.");return i}async versions(t,a={}){let r=new URLSearchParams(a.beforeRevision===void 0?{}:{beforeRevision:String(a.beforeRevision)}),s=W.parse(await this.request(`/${encodeURIComponent(t)}/versions?${r}`,"GET",void 0,a.signal));if(s.teamId!==this.options.teamId||s.datasetId!==t||s.items.some((i,n)=>n>0&&i.workspaceRevision>=s.items[n-1].workspaceRevision||a.beforeRevision!==void 0&&i.workspaceRevision>=a.beforeRevision))throw new Error("Dataset version history scope/order mismatch.");return s}async version(t,a,r){let s=this.readback(await this.request(`/${encodeURIComponent(t)}/versions/${a}`,"GET",void 0,r),t);if(s.revision!==a||s.workspace.draft.status!=="published")throw new Error("Dataset immutable version mismatch.");return s}async save(t,a){let r=M.parse(t),s=D(r.workspace);if(s.draft.profileId!==this.options.teamId||s.draft.revision!==r.expectedRevision+1)throw new Error("Dataset write scope or revision mismatch.");let i=this.readback(await this.request(`/${encodeURIComponent(s.draft.id)}`,"PUT",r,a),s.draft.id);if(r.originProjectId&&i.originProjectId!==r.originProjectId)throw new Error("Dataset origin Project mismatch.");if(r.ownerScope&&i.ownerScope!==r.ownerScope)throw new Error("Dataset owner scope mismatch.");if(i.workspace.contentHash!==s.contentHash)throw new Error("Dataset write receipt differs from the saved bytes.");return i}async validate(t,a,r){let s=K.parse(await this.request(`/${encodeURIComponent(t)}/validate`,"POST",{expectedRevision:a},r));if(s.teamId!==this.options.teamId||s.datasetId!==t||s.revision!==a)throw new Error("Dataset validation receipt mismatch.");return s}async publish(t,a,r){let s=V.parse(a),i=this.readback(await this.request(`/${encodeURIComponent(t)}/publish`,"POST",s,r),t);if(i.revision!==s.expectedRevision+1||i.workspace.draft.status!=="published"||i.publication?.packageHash!==s.packageHash)throw new Error("Dataset publication receipt mismatch.");return i}readback(t,a){let r=q.parse(t);if(D(r.workspace),r.datasetId!==a||r.teamId!==this.options.teamId)throw new Error("Dataset identity mismatch.");return r}async request(t,a,r,s,i){let n=await(this.options.fetch??fetch)(`${this.baseUrl}/v1/dataset-workspaces${t}`,{method:a,signal:s,redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"X-OpenPond-Team-Id":this.options.teamId,"Content-Type":"application/json"},...r===void 0?{}:{body:JSON.stringify(r)}});if(!n.ok)throw new Error(`Dataset request failed (${n.status}).`);if(i!==void 0){if(!n.body)throw new Error("Dataset response is empty.");let m=n.body.getReader(),h=[],v=0;try{for(;;){let f=await m.read();if(f.done)break;if(v+=f.value.byteLength,v>i)throw new Error("Dataset recovery exceeds its bounded response.");h.push(f.value)}}finally{await m.cancel()}let y=new Uint8Array(v),c=0;for(let f of h)y.set(f,c),c+=f.length;return JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(y))}return n.json()}},E=e.string().trim().min(1).max(500),ge=e.string().regex(/^[a-f0-9]{64}$/),Y=e.object({release:x,afterId:E.optional(),limit:e.number().int().min(1).max(1e4).default(100),view:e.enum(["ids","policy"]).default("ids")}).strict().superRefine((t,a)=>{t.view==="policy"&&t.limit>100&&a.addIssue({code:"custom",path:["limit"],message:"Policy previews are bounded to 100 tasks."})}),Z=e.object({id:A.shape.id,split:$}).strict(),we=Z.extend({input:e.record(e.string(),e.unknown()),policyVisibleContext:e.record(e.string(),e.unknown()),artifacts:e.array(e.object({id:E,path:e.string(),mediaType:e.string(),sizeBytes:e.number().int().nonnegative()}).strict()).max(1e3)}).strict(),be=e.object({schemaVersion:e.literal("openpond.datasetPopulationPage.v1"),teamId:E,release:x,view:Y.shape.view,taskCount:e.number().int().nonnegative(),items:e.array(e.union([Z,we])).max(1e4),graders:e.array(z).max(1e3),nextCursor:E.nullable(),contentHash:ge}).strict().superRefine((t,a)=>{t.view==="policy"&&t.items.length>100&&a.addIssue({code:"custom",message:"Policy preview exceeded its task bound."}),t.items.some(r=>"input"in r!=(t.view==="policy"))&&a.addIssue({code:"custom",message:"Dataset task view differs from the requested projection."})}),We=class{static{k(this,"OpenPondDatasetPopulationClient")}constructor(t){this.options=t;let a=new URL(t.baseUrl);if(!["http:","https:"].includes(a.protocol)||a.username||a.password||a.search||a.hash||!t.apiKey.trim()||!t.teamId.trim())throw new Error("A clean API origin and workspace credentials are required.");this.baseUrl=a.toString().replace(/\/+$/,"")}options;baseUrl;async read(t,a){let r=Y.parse(t),s=new URLSearchParams({releaseId:r.release.id,revision:String(r.release.revision),contentHash:r.release.contentHash,limit:String(r.limit),view:r.view});r.afterId&&s.set("afterId",r.afterId);let i=await(this.options.fetch??fetch)(`${this.baseUrl}/v1/dataset-workspaces/population?${s}`,{signal:a,redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"X-OpenPond-Team-Id":this.options.teamId,Accept:"application/json"}}),n=i.body?.getReader();if(!n)throw new Error("Dataset population response was empty.");let m=0,h="",v=new TextDecoder;try{for(;;){let w=await n.read();if(w.done)break;if(m+=w.value.byteLength,m>4194304)throw new Error("Dataset population response exceeded 4 MiB. Request fewer tasks.");h+=v.decode(w.value,{stream:!0})}h+=v.decode()}finally{await n.cancel(),n.releaseLock()}let y=JSON.parse(h);if(!i.ok)throw new Error(e.object({message:e.string()}).passthrough().parse(y).message);let c=be.parse(y),{contentHash:f,...g}=c;if(c.teamId!==this.options.teamId||I(c.release)!==I(r.release)||c.view!==r.view||c.items.length>r.limit||I(g)!==f||c.items.some((w,_)=>r.afterId!==void 0&&w.id<=r.afterId||_>0&&w.id<=c.items[_-1].id)||c.nextCursor!==null&&c.nextCursor!==c.items.at(-1)?.id)throw new Error("Dataset population identity, hash, order or bounds mismatch.");return c}},N=e.string().trim().min(1).max(240),S=e.string().trim().min(1).max(5e3),ve=e.object({taskClass:T,objective:e.string().trim().min(1).max(2e4),sourceSpans:e.array(P).min(1).max(200),firstAvailableAt:e.iso.datetime(),reconstruction:e.object({kind:e.enum(["text_only","pinned_repository","pinned_artifact","unsupported"]),requiredAssets:e.array(e.object({reference:S,evidence:P}).strict()).max(100),missingEvidence:e.array(S).max(20)}).strict(),assessment:e.object({kind:e.enum(["executable","calibrated_judge","unsupported"]),requirements:e.array(e.object({criterion:S,evidence:P}).strict()).min(1).max(20),limitations:e.array(S).max(20)}).strict()}).strict().superRefine((t,a)=>{t.sourceSpans.some(r=>r.role==="requirement")||a.addIssue({code:"custom",message:"A research candidate requires independently retained user requirements."}),t.assessment.requirements.some(r=>r.evidence.role!=="requirement")&&a.addIssue({code:"custom",message:"Assessment criteria must cite user requirements, not historical answers."})}),Ke=e.object({schemaVersion:e.literal("openpond.datasetPreparationResearchDecision.v1"),sourceId:N,snapshotHash:e.string().regex(/^[a-f0-9]{64}$/),candidates:e.array(ve).max(100),exclusions:e.array(e.object({code:N,reason:S,sourceSpans:e.array(P).max(200)}).strict()).max(100),contextSummary:e.string().max(2e4)}).strict(),ye=e.string().regex(/^[a-f0-9]{64}$/);var Le=e.object({schemaVersion:e.literal("openpond.preparedRepositoryStartingState.v1"),dependencyClosureQualified:e.literal(!1),assets:e.array(B.extend({receiptId:e.string().regex(/^starting-assets-[a-f0-9]{40}$/),receiptHash:ye,source:H}).strict()).min(1).max(100)}).strict().superRefine((t,a)=>{new Set(t.assets.map(r=>r.path)).size!==t.assets.length&&a.addIssue({code:"custom",message:"Starting paths must be distinct."}),t.assets.some(r=>r.commitHash!==t.assets[0].commitHash||I(r.source)!==I(t.assets[0].source))&&a.addIssue({code:"custom",message:"Starting assets must belong to one original task boundary and commit."})});var R=e.string().trim().min(1).max(240),j=e.string().trim().min(1).max(2e4),Ie=e.object({id:R,label:e.enum(["positive","incorrect","incomplete","adversarial"]),output:e.record(e.string(),e.unknown()),artifacts:e.array(e.object({path:C.shape.path,mediaType:C.shape.mediaType,base64:e.string().max(8*1024*1024)}).strict()).max(100)}).strict().superRefine((t,a)=>{new Set(t.artifacts.map(r=>r.path)).size!==t.artifacts.length&&a.addIssue({code:"custom",message:"Qualification artifacts must have distinct paths."})}),Qe=e.object({schemaVersion:e.literal("openpond.preparedQualificationPlan.v1"),requirementRefs:e.array(R).min(1).max(100),supported:e.boolean(),limitations:e.array(j).max(20),independentVerifier:e.object({runtime:e.enum(["isolated_javascript","sandbox_process"]),source:e.string().trim().min(1).max(2e5),exportName:e.literal("verify"),timeoutMs:e.number().int().min(1).max(6e4)}).strict().nullable(),witnesses:e.array(Ie).max(20)}).strict().superRefine((t,a)=>{(new Set(t.requirementRefs).size!==t.requirementRefs.length||new Set(t.witnesses.map(r=>r.id)).size!==t.witnesses.length)&&a.addIssue({code:"custom",message:"Qualification evidence identities must be distinct."}),t.supported&&(!t.independentVerifier||t.limitations.length||["positive","incorrect","incomplete","adversarial"].some(r=>!t.witnesses.some(s=>s.label===r)))&&a.addIssue({code:"custom",message:"Supported qualification needs a complete verifier and witness population without unresolved evidence gaps."})}),Je=e.object({schemaVersion:e.literal("openpond.preparedWitnessAdjudication.v1"),witnesses:e.array(e.object({id:R,failureMode:e.enum(["none","incorrect","incomplete","adversarial","unverifiable"]),requirements:e.array(e.object({reference:R,status:e.enum(["satisfied","violated","unverifiable"]),reason:j}).strict()).min(1).max(100)}).strict()).min(4).max(20)}).strict(),Xe=e.object({schemaVersion:e.literal("openpond.preparedCheckerAudit.v1"),requirements:e.array(e.object({reference:R,adequatelyChecked:e.boolean(),oracleAdequatelyChecked:e.boolean(),reason:j}).strict()).min(1).max(100),executionIsolationPassed:e.boolean(),futureEvidenceLeak:e.boolean(),unresolvedLimitations:e.array(j).max(20),passed:e.boolean()}).strict();export{Me as a,Y as b,be as c,We as d};
@@ -1,2 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{k as v,t as x}from"./chunk-LJPO3TEL.js";import{a as l,c as j}from"./chunk-JHR3LF2F.js";import{Ea as y,Fb as E,G as P,b as g,za as p}from"./chunk-TUCKED4T.js";import{w}from"./chunk-JY3YSI54.js";import{m as f}from"./chunk-5ZBLCWEJ.js";import{s as S}from"./chunk-UGOK7VTC.js";import{A as s}from"./chunk-PF56N7ZY.js";import{a as n}from"./chunk-FTQLQJQV.js";function z(e){if(e.kind==="command"||e.kind==="file_change")return!0;if(e.kind!=="permissions")return!1;try{let o=JSON.parse(e.detail);return!o.questions&&Array.isArray(o.options)&&o.options.some(r=>r.kind==="allow_once")&&o.options.some(r=>r.kind==="reject_once")}catch{return!1}}n(z,"remoteApprovalSupported");import{createHash as A}from"node:crypto";import{realpath as R,stat as O}from"node:fs/promises";var k=n(e=>A("sha256").update(g("POST","/local/ponder-project",e)).digest("hex"),"hash"),_=s.object({projectId:s.string().min(1).max(200),name:s.string().min(1).max(300),cwd:s.string().min(1).max(8192),sourceFolders:s.array(s.object({path:s.string().min(1).max(8192),realpath:s.string().min(1).max(8192)}).strict()).min(1).max(1e3),configurationHash:s.string().regex(/^[a-f0-9]{64}$/),revision:s.string().regex(/^[a-f0-9]{64}$/)}).strict();function X(e){let o=Object.values(S(e,"saved_local_projects"));if(o.length>p)throw new Error("ponder_desktop_project_sharing_limit_exceeded");return o.map(r=>f.parse(r.value))}n(X,"readPonderLocalProjects");async function Y(e){if(e.hiddenFromDefaultSidebar)throw new Error("ponder_desktop_project_unavailable");let o=[...new Set([...e.sourceFolders??[e.path],e.path,...e.repoPath?[e.repoPath]:[]])];if(!o.length||o.length>1e3)throw new Error("ponder_desktop_project_folder_limit_exceeded");let r=await R(e.workspacePath);if(!(await O(r)).isDirectory())throw new Error("ponder_desktop_project_unavailable");let t=[];for(let c of o){let i=await R(c);if(!(await O(i)).isDirectory())throw new Error("ponder_desktop_project_unavailable");t.push({path:c,realpath:i})}let a={projectId:e.id,name:e.name,cwd:r,sourceFolders:t,configurationHash:k({id:e.id,name:e.name,path:e.path,workspacePath:e.workspacePath,repoPath:e.repoPath,sourceFolders:e.sourceFolders??null,hiddenFromDefaultSidebar:e.hiddenFromDefaultSidebar??!1})};return _.parse({...a,revision:k(a)})}n(Y,"capturePonderProjectSnapshot");import{createHash as D}from"node:crypto";var I=E,m=s.object({revision:s.number().int().positive(),owner:l,authority:I,project:_,shared:s.boolean(),updatedAt:s.string().datetime()}).strict(),b=m.omit({revision:!0}),h=n(e=>D("sha256").update(JSON.stringify(l.parse(e))).digest("hex"),"ownerKey");function N(e,o,r){let t=l.parse(o),a=I.parse(r),c=e.get("SELECT payload FROM ponder_desktop_authority WHERE id = 1"),i=c?y.parse(JSON.parse(c.payload)):null;if(!i||i.state!=="attached"||Date.parse(i.leaseExpiresAt)<=Date.now()||i.authorizationRevision!==a.authorizationRevision||!Object.entries(a.scope).every(([d,u])=>i.scope[d]===u)||i.scope.installationId!==t.installationId||i.scope.profileId!==t.profileId||i.scope.ownerUserId!==t.ownerUserId||i.scope.teamId!==t.teamId)throw new Error("ponder_desktop_project_authority_changed")}n(N,"assertAuthority");function ne(e,o){let r=b.parse(o);N(e,r.owner,r.authority);let t=h(r.owner),a=e.get("SELECT payload FROM ponder_project_sharing WHERE owner_key = ? AND project_id = ?",[t,r.project.projectId]);if(!a&&(e.get("SELECT count(*) AS count FROM ponder_project_sharing WHERE owner_key = ?",[t])?.count??0)>=p)throw new Error("ponder_desktop_project_sharing_limit_exceeded");let c=a?m.parse(JSON.parse(a.payload)):null,i=c&&c.shared===r.shared&&c.project.revision===r.project.revision&&c.authority.authorizationRevision===r.authority.authorizationRevision&&Object.entries(r.authority.scope).every(([u,L])=>c.authority.scope[u]===L),d=m.parse({...r,revision:c?c.revision+(i?0:1):1});return e.run("INSERT INTO ponder_project_sharing (owner_key, project_id, payload) VALUES (?, ?, ?) ON CONFLICT(owner_key, project_id) DO UPDATE SET payload = excluded.payload",[t,r.project.projectId,JSON.stringify(d)]),d}n(ne,"setPonderProjectSharing");function ae(e,o){let r=e.all("SELECT payload FROM ponder_project_sharing WHERE owner_key = ? ORDER BY project_id LIMIT ?",[h(o),p+1]);if(r.length>p)throw new Error("ponder_desktop_project_sharing_limit_exceeded");return r.map(t=>{let a=m.parse(JSON.parse(t.payload));if(h(a.owner)!==h(o))throw new Error("ponder_desktop_project_owner_changed");return a})}n(ae,"readPonderProjectSharing");function ie(e,o){return e.shared&&e.authority.authorizationRevision===o.authorizationRevision&&Object.entries(o.scope).every(([r,t])=>e.authority.scope[r]===t)}n(ie,"projectSharingMatchesAuthority");import{createHash as F}from"node:crypto";function ue(e,o,r){let t=F("sha256").update(JSON.stringify({ownership:x(e,o),paused:r.paused,activeTurnId:r.activeTurnId})).digest("hex");return Number.parseInt(t.slice(0,13),16)}n(ue,"remoteCommandTargetRevision");function le(e,o){let r=e.get("SELECT turn_id,paused,lease_until FROM task_inbox_turns WHERE session_id=?",[o]),t=r&&r.lease_until>Date.now()&&e.get("SELECT status FROM turns WHERE id=?",[r.turn_id])?.status==="in_progress";return{paused:!!r?.paused,activeTurnId:t?r.turn_id:null}}n(le,"readRemoteCommandTargetState");function he(e,o){if(o.payload.resume!==!0)return;if(o.action!=="follow_up")throw new Error("remote_resume_action_invalid");let r=e.get("SELECT turn_id,paused,lease_until FROM task_inbox_turns WHERE session_id=?",[o.localSessionId]),t=e.get("SELECT id,status FROM turns WHERE session_id=? ORDER BY sort_index DESC LIMIT 1",[o.localSessionId]);if(!o.expectedTurnId||t?.id!==o.expectedTurnId||r?.turn_id!==o.expectedTurnId||!r.paused||r.lease_until>Date.now()||!["completed","failed","interrupted"].includes(t.status))throw new Error("remote_resume_target_changed");e.run("UPDATE task_inbox_turns SET paused=0 WHERE session_id=?",[o.localSessionId])}n(he,"resumeRemoteTaskInput");import{createHash as M}from"node:crypto";function T(e){return w.parse({provider:e.provider,cwd:e.cwd,localProjectId:e.localProjectId,workspaceId:e.workspaceId,workspaceKind:e.workspaceKind,workspaceName:e.workspaceName,...e.modelRef?{modelRef:e.modelRef}:{},currentProfile:e.currentProfile,experience:e.experience,profileWorkflowBinding:e.profileWorkflowBinding,profileComponentBinding:e.profileComponentBinding,openPondCommandAccessMode:e.openPondCommandAccessMode})}n(T,"remoteStarterPayload");function q(e){return Number.parseInt(M("sha256").update(P({payload:T(e),owner:e.metadata?.ponderLocalOwner})).digest("hex").slice(0,13),16)}n(q,"remoteStarterRevision");function H(e,o){let r=new Map;for(let t of e){if(!j(t,o)||!t.localProjectId||!t.cwd||t.archived||t.status==="closed"||t.systemKind||t.hiddenFromDefaultSidebar||t.metadata?.nativeHistoryProjection||!v(t.provider)||["sandbox","sandbox_template","sandbox_app"].includes(t.workspaceKind??""))continue;try{T(t)}catch{continue}let a=`starter:${t.id}`;r.set(a,{source:t,target:{id:a,projectId:t.localProjectId,projectLabel:t.workspaceName??"Local project",title:`New ${t.provider} task in ${t.workspaceName??"local project"}`,revision:q(t)}})}return r}n(H,"captureRemoteStarters");function Pe(e){return async o=>{let r=await e.current();if(!r)throw new Error("remote_account_unavailable");let t=[];for(let c of await e.store.sessionShells()){let i=await e.store.getSession(c.id);i&&t.push(i)}let a=H(t,r.owner).get(o.localStarterId);if(!a||a.target.revision!==o.expectedRevision||a.target.projectId!==o.payload.projectId||a.target.revision!==o.payload.starterRevision)throw new Error("remote_starter_changed");return a.source}}n(Pe,"createRemoteStarterResolver");var C=class extends Error{constructor(r,t=409){super(r);this.status=t;this.name="LocalManagedMessageError"}status;static{n(this,"LocalManagedMessageError")}};export{ue as a,le as b,he as c,T as d,q as e,H as f,Pe as g,z as h,C as i,X as j,Y as k,ne as l,ae as m,ie as n};
@@ -1,2 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{b}from"./chunk-GAQLXFOT.js";import{t as M}from"./chunk-TUCKED4T.js";import{Qb as x,m as T,v as A}from"./chunk-ABF3W2MO.js";import{n as c,o as S}from"./chunk-VVNV4NNW.js";import{A as I}from"./chunk-PF56N7ZY.js";import{a as R}from"./chunk-FTQLQJQV.js";function j(e,a,i){if(a==="agent_action"){let n=e.find(u=>u.name==="workspace_action_result"&&u.action==="profile_workflow_action")?.output;if(typeof n!="string")throw new Error("Profile Agent action evaluation did not produce a released action result.");return n}if(i==="completed"){let n=[...e].reverse().find(s=>s.name==="turn.completed"),r=n?.data?.providerResponse,o=n?.data;if(!r&&o?.turn?.status==="completed"){let s=[...e].reverse().find(t=>P(t)!==null);if(!s)throw new Error("Native Profile evaluation has no retained final answer.");let d=P(s);return e.filter(t=>P(t)===d).map(t=>t.output??"").join("")}if(typeof r?.requestId!="string"||!r.requestId||typeof r.contentHash!="string")throw new Error("Profile evaluation has no retained final provider response.");let p=e.filter(s=>s.name==="assistant.delta"&&s.data?.providerRequestId===r.requestId).map(s=>s.output??"").join("");if(c(p)!==r.contentHash)throw new Error("Profile evaluation final provider response differs from its retained trace.");return b(e)??p}return e.filter(n=>n.name==="assistant.delta"&&typeof n.output=="string").map(n=>n.output??"").join("")}R(j,"profileEvaluationOutput");function P(e){let a=e.data;return e.name==="assistant.delta"&&a?.provider==="codex"&&a.phase==="final_answer"&&typeof a.itemId=="string"?a.itemId:null}R(P,"nativeFinalAnswerItemId");async function _(e){let{store:a,manifest:i,receipt:n}=e;if(!n.metadata.retainedEvidenceRef)return null;let u=x.parse(n.metadata.retainedEvidenceRef),[r,o]=await Promise.all([a.getSession(u.sessionId),a.getTurn(u.turnId)]),p=r?.metadata?.profileEvaluationRun,s=i.profileEvaluation;if(!r||!o||o.sessionId!==r.id||!s||!r.currentProfile||c(r.currentProfile)!==c(e.profileRef)||c(p)!==c({id:i.id,contentHash:i.contentHash})||r.metadata?.taskId!==n.taskId||r.metadata?.seed!==n.seed||!o.completedAt||o.completedAt!==n.completedAt||o.startedAt!==n.startedAt||!o.harnessSnapshot||o.harnessSnapshot.harnessRelease.id!==s.harnessRelease.id||o.harnessSnapshot.harnessRelease.contentHash!==s.harnessRelease.contentHash||i.policy.kind!=="model"||!o.modelRef||o.modelRef.providerId!==i.policy.model.provider||o.modelRef.modelId!==i.policy.model.model)throw new Error("Retained Profile policy turn differs from its admitted case.");let d=await a.runtimeEventsForTurn(o.id);if(d.some(v=>v.turnId!==o.id)||c(d)!==n.traceHash)throw new Error("Retained Profile policy trace differs from its immutable receipt.");let t=j(d,s.target.kind,o.status);if(n.outputHash!==null&&c({text:t})!==n.outputHash)throw new Error("Retained Profile output differs from its immutable receipt.");let m=n.artifactRefs.flatMap(v=>{let y=d.filter(l=>(l.action==="work_output_save"||l.action==="sandbox_save_output")&&l.status==="completed").flatMap(l=>{let C=l.data&&typeof l.data=="object"?l.data:{},k=M.safeParse(C.outputRef);return k.success?[k.data]:[]}).filter(l=>l.sourceTaskId===r.id&&l.sourceTurnId===o.id&&`${r.id}/${l.id}/${l.revision}/${l.title}`===v.id&&l.sha256===v.contentHash&&l.sizeBytes===v.sizeBytes&&l.contentType===v.mediaType);if(y.length!==1)throw new Error("The case output has no unique sealed saved-file identity.");let h=y[0];if(h.location.kind!=="managed")return[];let H=`/api/work/outputs/${encodeURIComponent(h.location.fileId)}`;if(h.location.downloadPath!==H)throw new Error("The saved output has no canonical managed download route.");return[{id:h.id,title:h.title,revision:h.revision,contentType:h.contentType,sizeBytes:h.sizeBytes,sha256:h.sha256,downloadPath:H}]}),f=await a.listModelUsageRecords({sessionId:r.id,turnId:o.id,limit:1e4}),E=e.eventAfterId?d.findIndex(v=>v.id===e.eventAfterId):-1;if(e.eventAfterId&&E<0)throw new Error("Profile trace cursor is unavailable in this case.");let g=E+1,q=Math.max(1,Math.min(250,e.eventLimit??100)),w=d.slice(g,g+q);return{ref:u,prompt:o.prompt,output:n.outputHash===null?null:{text:t},partialOutput:n.outputHash===null&&t?{text:t}:null,error:o.error,events:w,eventCount:d.length,nextEventCursor:g+w.length<d.length?w.at(-1).id:null,files:m,usage:f,usageCoverage:f.length===1e4?"partial":"complete"}}R(_,"readProfileEvaluationPolicyEvidence");var W=I.object({runId:I.string().trim().min(1).max(240),receiptId:I.string().trim().min(1).max(500).optional(),eventAfterId:I.string().trim().min(1).max(500).optional(),eventLimit:I.number().int().min(1).max(250).optional(),manifest:A.optional()}).strict().refine(e=>e.receiptId||!e.eventAfterId&&!e.eventLimit,"Select a case before requesting its trace page.").refine(e=>!e.manifest||e.receiptId,"Interrupted-run inspection requires one exact case.");async function D(e){let a=await e.store.getProfileEvaluationRun(e.runId);if(a&&c(a.profileRef)!==c(e.profileRef))throw new Error("Profile evaluation run is unavailable in the selected Profile.");let i=a?.manifest??e.manifest;if(!i||!a&&!e.receiptId)throw new Error("Profile evaluation run is unavailable in the selected Profile.");if(a){if(e.manifest&&e.manifest.contentHash!==a.manifest.contentHash)throw new Error("Profile evaluation run differs from its pinned manifest.")}else if(S(i,"Interrupted Profile evaluation manifest"),i.id!==e.runId||i.profileEvaluation?.profileId!==e.profileRef.profileId||e.profileRef.source==="openpond_git"&&i.metadata.profileRepositoryId!==e.profileRef.repositoryId)throw new Error("Profile evaluation run is unavailable in the selected Profile.");let n=i.population.map((r,o)=>({member:r,index:o})).filter(({member:r})=>!e.receiptId||r.receiptId===e.receiptId);if(e.receiptId&&n.length!==1)throw new Error("Profile evaluation case is unavailable in the selected run.");let u=await Promise.all(n.map(async({member:r,index:o})=>{let p=a?null:await e.store.getProfileEvaluationReceipt(r.receiptId),s=a?.receiptRefs[o]??(p?{id:p.id,contentHash:p.contentHash}:null),d=a?.gradeRefs[o]??p?.graderEvidenceRefs[0];if(!s||!d)throw new Error("Profile evaluation run has incomplete case evidence.");let[t,m]=await Promise.all([e.store.getProfileEvaluationReceipt(s.id),e.store.getProfileEvaluationGrade(d.contentHash)]);if(!t||!a&&!T(t)||t.contentHash!==s.contentHash||t.id!==r.receiptId||t.taskId!==r.taskId||t.seed!==r.seed||t.runManifest.id!==i.id||t.runManifest.contentHash!==i.contentHash||!m||m.contentHash!==d.contentHash||!t.graderEvidenceRefs.some(f=>f.id===d.id&&f.contentHash===d.contentHash))throw new Error("Profile evaluation case evidence differs from its retained run.");return{taskId:r.taskId,seed:r.seed,receiptId:t.id,receiptHash:t.contentHash,traceHash:t.traceHash,outputHash:t.outputHash,score:m.score,passed:m.passed,gradingStatus:m.gradingStatus,failureClass:m.failureClass,artifactCount:t.artifactRefs.length,latencyMs:t.latencyMs,costUsd:t.costUsd,terminal:t.terminal,feedback:m.components.map(f=>({graderId:f.graderId,graderVersion:f.graderVersion,score:f.score,passed:f.passed,feedback:f.feedback})),...e.receiptId?{receipt:t,evidence:await _({store:e.store,profileRef:e.profileRef,manifest:i,receipt:t,eventAfterId:e.eventAfterId,eventLimit:e.eventLimit})}:{}}}));return{runId:i.id,sourceRevision:i.profileEvaluation?.sourceRevision??null,cases:u}}R(D,"inspectProfileEvaluationRun");export{j as a,W as b,D as c};
@@ -1,5 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as _e}from"./chunk-LILXHGIA.js";import{k as Se}from"./chunk-N5GPINVP.js";import{A as Re,B as Te}from"./chunk-TW3SRBLU.js";import{J as me,L as ge,M as X,Nb as we,Ob as Z,P as Y,Q as se,Qb as ne,R as ke,S as he,ia as ve,ta as E,za as G}from"./chunk-PGO4FRHU.js";import{D as K,K as J,i as g,n as C,t as ue,x as F}from"./chunk-TVTFEGTU.js";import{$ as fe,N as T,O as I,P as Q,Q as q,d as W,ib as U}from"./chunk-4M3YW3EQ.js";import{Da as $,Ma as ce,Ra as ae,Xa as le,Ya as pe}from"./chunk-PBZCXPPC.js";import{i as de,n as j}from"./chunk-VVNV4NNW.js";import{a as m}from"./chunk-FTQLQJQV.js";import{createHash as xe}from"node:crypto";function w(e,t,s,i){let a=U[s].parse(i),r=e.get("SELECT payload FROM learning_revisions WHERE scope = ? AND kind = ? AND id = ? AND revision = ?",[t,s,a.id,a.revision]);if(r){if(g(JSON.parse(r.payload))!==g(a))throw new Error(`Starter dependency conflicts with an existing revision: ${a.id}.`);return}e.run("INSERT INTO learning_revisions (scope, kind, id, revision, payload) VALUES (?, ?, ?, ?, ?)",[t,s,a.id,a.revision,JSON.stringify(a)]),e.run(`INSERT INTO learning_resources (scope, kind, id, revision) VALUES (?, ?, ?, ?)
3
- ON CONFLICT (scope, kind, id) DO UPDATE SET revision = excluded.revision
4
- WHERE learning_resources.revision < excluded.revision`,[t,s,a.id,a.revision])}m(w,"importStarterReleaseInTransaction");function Pe(e,t,s){function i(o,c){let l=e.get("SELECT payload FROM learning_revisions WHERE scope = ? AND kind = ? AND id = ? AND revision = ?",[t,o,c.id,c.revision]);l||H(404,"model_reward_unavailable",`The exact ${o} resource is unavailable in this Profile.`);let d=U[o].parse(JSON.parse(l.payload));return q(d),c.contentHash&&d.contentHash!==c.contentHash&&H(409,"model_reward_changed","The selected resource does not match its immutable content hash."),d}m(i,"read");let a=i("binding",s),r=[...new Map(a.sources.map(o=>[g(o.reward),i("reward",o.reward)])).values()],n=new Map;for(let o of r){let c=o.implementation;for(let l of[...o.assets,..."verifierRef"in c?[c.verifierRef]:[],..."rubricRef"in c?[c.rubricRef]:[],..."inputContract"in c?[c.inputContract]:[]])n.has(l.id)||n.set(l.id,i("asset",{id:l.id,revision:1})),W(n.get(l.id),l)}return{rewardBinding:a,rewards:r,assets:[...n.values()]}}m(Pe,"readSelectedModelReward");function ee(e,t,s,i){let a=C.parse(t.metadata.rewardBinding),r=m((p,u)=>{let B=e.get("SELECT payload FROM learning_revisions WHERE scope = ? AND kind = ? AND id = ? AND revision = ?",[t.profileId,p,u.id,u.revision]);B||H(404,"model_reward_unavailable",`The exact ${p} resource is unavailable in this Profile.`);let h=U[p].parse(JSON.parse(B.payload));return q(h),u.contentHash&&h.contentHash!==u.contentHash&&H(409,"model_reward_changed","The selected resource does not match its immutable content hash."),h},"read"),n=r("definition",C.parse(t.metadata.taskDefinition));(g(t.policy)!==g(n.execution.policy)||g(t.environment.metadata.portableEnvironment)!==g(n.execution.environment)||g(t.environment.metadata.portableTools)!==g(n.execution.tools))&&H(409,"model_taskset_context_changed","Taskset context differs from its immutable task definition.");let o=r("binding",a),c=[...new Map(o.sources.map(p=>[g(p.reward),r("reward",p.reward)])).values()];t.metadata.rewardExecution!==void 0&&g(t.metadata.rewardExecution)!==g({binding:o,rewards:c})&&H(409,"model_taskset_rewards_changed","Taskset embedded Rewards differ from their immutable binding.");let l=r("binding",s),d=[...new Map(l.sources.map(p=>[g(p.reward),r("reward",p.reward)])).values()],k=new Map((i?.modelResources?.assets??[]).map(p=>[p.id,p])),v=m(p=>{k.has(p)||k.set(p,r("asset",{id:p,revision:1}))},"addAsset");for(let p of[...c,...d]){let u=p.implementation;for(let B of[...p.assets,..."verifierRef"in u?[u.verifierRef]:[],..."rubricRef"in u?[u.rubricRef]:[],..."inputContract"in u?[u.inputContract]:[]])v(B.id)}let R,S=ke.shape.executionResources.parse(t.environment.metadata.portableExecutionResources);if(n.execution.environment.entrypoint==="openpond.javascript-environment.v1"){let p=r("asset",{id:ge(n.execution),revision:1});R=me.parse(JSON.parse(W(p,p.asset)));for(let u of[R.javascript.module,R.environment.actionSchemaRef,R.environment.observationSchemaRef,R.environment.stateSchemaRef])u&&v(u.id)}for(let p of t.tasks)p.privilegedContextRef&&v(p.privilegedContextRef);g(t.graders)!==g(Z(o,c,[...k.values()]))&&H(409,"model_taskset_graders_changed","Taskset graders differ from their immutable Reward binding.");let N=$.parse(Q({schemaVersion:"openpond.tasksetRelease.v2",id:t.id,revision:t.revision,...n.execution,graders:pe(o,c),...t.metrics?{metrics:t.metrics}:{},tasks:t.tasks.map(p=>{let u=we(p);return p.requiredOutputs===void 0&&p.metadata.portableTaskRecord===void 0&&delete u.requiredOutputs,u}),metadata:t.metadata.derivedPortableMetadata??{localSource:T(t),starter:{taskDefinition:T(n),rewardBinding:a}}}));return{sourcePackage:i?{...i.modelResources,taskset:i.taskset,executionResources:{environment:i.environment,verifierSet:i.verifierSet}}:{taskset:N,taskDefinition:n,rewardBinding:o,rewards:c,assets:[...k.values()],...S?{executionResources:S}:{},...R?{execution:R}:{}},selectedBinding:l,selectedRewards:d,assets:k}}m(ee,"readModelTasksetSource");function H(e,t,s){throw new J(e,{schemaVersion:"openpond.modelProjectApiError.v2",code:t,message:s,retryable:!1,requestId:null,details:{}})}m(H,"fail");function ie(e,t){if(e.profileId!==t.profileId||e.tasks.length!==t.tasks.length)throw new Error("Model Taskset review differs from its compiled task scope.");let s=new Map(t.sourceRefs.map(n=>[n.id,n])),i=e.tasks.map(n=>{let o=t.tasks.find(l=>l.id===n.id);if(!o)throw new Error("Model Taskset review is missing a compiled task.");if(j(n.input)!==j(o.input)||j(n.expectedOutput)!==j(o.expectedOutput)||j(n.policyVisibleContext)!==j(o.policyVisibleContext))throw new Error("Model Taskset review differs from its compiled task content.");let c=(n.assets??[]).map(l=>{let d=o.assets?.find(R=>R.id===l.id),k=de.safeParse(d?.metadata.portableAsset),v=d?.artifactRef===l.artifactRef||k.success&&k.data.path===l.artifactRef&&k.data.id===l.id&&k.data.contentHash===l.sha256&&k.data.sizeBytes===l.sizeBytes&&k.data.mediaType===l.mediaType&&k.data.visibility==="policy";if(!d||d.sha256!==l.sha256||d.sizeBytes!==l.sizeBytes||!v||d.mediaType!==l.mediaType||d.fileName!==l.fileName||d.split!==n.split||!o.sourceRefs.includes(d.sourceRefId)||!s.has(d.sourceRefId))throw new Error("Model Taskset review differs from its compiled input asset.");return{...l,sourceRefId:d.sourceRefId,...d.stagingPath===void 0?{}:{stagingPath:d.stagingPath}}});if(c.length!==(o.assets?.length??0))throw new Error("Model Taskset review lost an input asset.");return{...n,sourceRefs:o.sourceRefs,assets:c}}),a=e.metadata.rewardBinding,r=E.parse({...e,sourceRefs:t.sourceRefs,tasks:i,metadata:{...e.metadata,...Object.fromEntries(["trainingMethod","diagnosis","buildIntent"].filter(n=>t.metadata[n]!==void 0).map(n=>[n,t.metadata[n]]))},capabilities:{...e.capabilities,supportedSignals:t.capabilities.supportedSignals,compatibleMethods:t.capabilities.compatibleMethods},graderFixtures:t.graderFixtures,learningSignals:{...t.learningSignals,rewards:t.learningSignals.rewards.map(n=>a?{...n,artifactRef:a.id,rules:[{id:a.id,points:1,condition:"Execute the published Reward binding with its declared normalization, weights and required gates."}]}:n)}});return E.parse({...r,contentHash:G(r)})}m(ie,"retainModelTasksetInputReview");function re(e){if(e?.metadata.learning===void 0)return null;let t=fe.parse(e.metadata.learning);return q(t.definition),le(t.binding,t.rewards),I(t.definition.rewardBinding,T(t.binding))||b(409,"model_batch_binding_changed","Reviewed task definition and Reward binding do not match."),t.binding}m(re,"reviewedTasksetRewardBinding");function ut(e,t,s=!0,i){let a=K(t),{project:r}=a,n=e.get("SELECT payload FROM model_projects WHERE id = ?",[r.id]),o=n?F.parse(JSON.parse(n.payload)):null;o&&o.profileId!==r.profileId&&b(404,"model_not_found","Model is not available in this Profile."),(o?.revision??0)!==a.expectedRevision&&b(409,"model_revision_conflict","Model changed since it was opened. Refresh before saving.");let c=r.trainingSetup.tasksetRef;if(!c||!r.trainingSetup.rewardBindingRef)return null;let l=e.get("SELECT payload FROM taskset_revisions WHERE taskset_id = ? AND revision = ?",[c.id,c.revision]),d=l?E.parse(JSON.parse(l.payload)):null;(!d||d.profileId!==r.profileId)&&b(404,"model_taskset_not_found","The selected Taskset revision is not available in this Profile."),(d.contentHash!==c.contentHash||G(d)!==d.contentHash)&&b(409,"model_taskset_changed","The selected Taskset does not match its immutable content hash.");let k=re(d);if(k)return I(T(k),r.trainingSetup.rewardBindingRef)||b(422,"model_batch_reward_review_required","Changing a reviewed batch's Reward requires regrading and a new reviewed batch."),null;let v=d.metadata.rewardBinding===void 0?null:C.parse(d.metadata.rewardBinding);if(v&&I(v,r.trainingSetup.rewardBindingRef))return null;if(!v&&i&&!i.modelResources&&!i.learningResources){let f=Pe(e,r.profileId,r.trainingSetup.rewardBindingRef),_=Se({owner:{scopeId:r.profileId,modelId:r.id},source:i,...f}),O=Ee(e,a,s),P=ne({package:_,profileId:r.profileId,name:d.name,createdAt:O.created_at});P.taskset=ie(P.taskset,d);let D={..._.modelResources,taskset:_.taskset,executionResources:{environment:_.environment,verifierSet:_.verifierSet}};return{taskset:P.taskset,generatedFiles:P.generatedFiles,directoryId:String(P.taskset.environment.metadata.runtimeSourceTasksetId),source:d,sourcePackage:null,derived:D,imported:P}}v||b(422,"model_taskset_derivation_unavailable","This Taskset needs an authored task definition and Reward binding before its Reward can be changed.");let{sourcePackage:R,selectedBinding:S,selectedRewards:N,assets:x}=ee(e,d,r.trainingSetup.rewardBindingRef,i),p=se.safeParse(R.taskset.metadata.modelTasksetDerivation),B=o?.hosted?.apiOrigin&&o.hosted.tasksets.some(f=>{if(!p.success||f.localTasksetId!==d.id||!f.packageHash||!f.localTasksetHash)return!1;let _=e.get("SELECT payload FROM taskset_revisions WHERE taskset_id = ? AND content_hash = ? AND profile_id = ?",[d.id,f.localTasksetHash,r.profileId]),O=_?E.parse(JSON.parse(_.payload)):null;if(!O||O.contentHash!==f.localTasksetHash)return!1;let P=e.get("SELECT payload FROM learning_revisions WHERE scope = ? AND kind = 'package' AND id = ? AND revision = ?",[r.profileId,f.releaseId,f.releaseRevision]),D=P?$.parse(JSON.parse(P.payload)):null,M=se.safeParse(D?.metadata.modelTasksetDerivation);return D?.contentHash===f.releaseHash&&M.success&&g(M.data.owner)===g(p.data.owner)&&I(M.data.root,p.data.root)})&&p.success&&p.data.owner.modelId===r.id?p.data.owner:{scopeId:r.profileId,modelId:r.id},h=he({owner:B,source:R,rewardBinding:S,rewards:N,assets:[...x.values()]}),z=Ee(e,a,s);if(i){let f=new Map(i.files.map(L=>[L.asset.id,L]));for(let L of h.assets)f.set(L.id,{asset:L.asset,base64:Buffer.from(L.text).toString("base64")});let{taskset:_,executionResources:O,...P}=h;if(!O)throw new Error("Derived imported package is missing execution resources.");let D=ve({schemaVersion:"openpond.tasksetPackage.v1",taskset:_,...O,modelResources:P,files:[...f.values()]}),M=ne({package:D,profileId:r.profileId,name:d.name,createdAt:z.created_at});return M.taskset=ie(M.taskset,d),{taskset:M.taskset,generatedFiles:M.generatedFiles,directoryId:String(M.taskset.environment.metadata.runtimeSourceTasksetId),source:d,sourcePackage:R,derived:h,imported:M}}let oe=`${h.taskset.id}-r${h.taskset.revision}-${Q({packageHash:h.taskset.contentHash,preparedAt:z.created_at}).contentHash}`,A=Re(d,z.created_at),Ie=new Map(h.taskset.tasks.map(f=>[f.id,f])),te=[];for(let f of h.taskset.graders)if(f.kind==="custom_verifier"){let _=f.verifierRef.path;te.some(O=>O.path===_)||te.push({path:_,role:"verifier",content:W(x.get(f.verifierRef.id),f.verifierRef)})}let V=Te({tasksetId:h.taskset.id,now:z.created_at,sourcePackageHash:h.taskset.contentHash,draft:{...A,policy:h.taskset.policy,tasks:A.tasks.map(f=>({...f,metadata:{...f.metadata,portableTaskRecord:Ie.get(f.id)}})),environment:{...A.environment,metadata:{...A.environment.metadata,runtimeSourceTasksetId:oe,portableExecutionResources:h.executionResources}},graders:Z(S,N,[...x.values()]),learningSignals:{...A.learningSignals,rewards:A.learningSignals.rewards.map(f=>({...f,rules:[{id:S.id,points:1,condition:"Execute the published Reward binding with its declared normalization, weights and required gates."}],artifactRef:S.id,metadata:{...f.metadata,rewardBinding:T(S)}}))},metadata:{...A.metadata,portableCapabilities:h.taskset.capabilities,taskDefinition:T(h.taskDefinition),rewardBinding:T(S),rewardExecution:{binding:S,rewards:N},derivedPortableMetadata:h.taskset.metadata,modelTasksetDerivation:h.taskset.metadata.modelTasksetDerivation}}});if(V.metrics=h.taskset.metrics,V.contentHash=G(V),V.revision!==h.taskset.revision)throw new Error("Derived local and portable Taskset revisions differ.");return{taskset:V,generatedFiles:te,directoryId:oe,source:d,sourcePackage:R,derived:h}}m(ut,"prepareModelTasksetSave");function ye(e,t,s){let i=t.project.profileId;for(let o of[s.sourcePackage,s.derived]){if(!o)continue;for(let l of o.assets)w(e,i,"asset",l);for(let l of o.rewards)w(e,i,"reward",l);w(e,i,"binding",o.rewardBinding),w(e,i,"package",o.taskset),w(e,i,"definition",o.taskDefinition);let c=o.executionResources??o.execution;c&&w(e,i,"asset",Y(c)),o.execution&&w(e,i,"asset",X(o.execution))}let a=s.taskset;e.get("SELECT content_hash FROM taskset_revisions WHERE taskset_id = ? AND revision = ?",[a.id,a.revision])&&b(409,"model_taskset_revision_conflict","The derived Taskset revision was already published. Refresh before saving.");let n=JSON.stringify(a);e.run("INSERT INTO tasksets (id, profile_id, status, payload, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?) ON CONFLICT(id) DO UPDATE SET status = excluded.status, payload = excluded.payload, updated_at = excluded.updated_at",[a.id,i,a.status,n,a.createdAt,a.updatedAt]),e.run("INSERT INTO taskset_revisions (taskset_id, revision, content_hash, profile_id, status, payload, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?)",[a.id,a.revision,a.contentHash,i,a.status,n,a.createdAt,a.updatedAt]),e.run("UPDATE model_project_taskset_preparations SET state = 'committed' WHERE profile_id = ? AND operation_id = ?",[i,t.operationId])}m(ye,"commitPreparedModelTaskset");function Ee(e,t,s){let i=xe("sha256").update(g(t)).digest("hex"),a=t.project.profileId;s&&e.run("INSERT OR IGNORE INTO model_project_taskset_preparations (profile_id, operation_id, request_hash, created_at, state) VALUES (?, ?, ?, ?, 'preparing')",[a,t.operationId,i,new Date().toISOString()]);let r=e.get("SELECT request_hash, created_at FROM model_project_taskset_preparations WHERE profile_id = ? AND operation_id = ?",[a,t.operationId])??{request_hash:i,created_at:new Date().toISOString()};return r.request_hash!==i&&b(409,"model_operation_conflict","This save operation was already used with different Model configuration."),r}m(Ee,"recordModelTasksetPreparation");function b(e,t,s){throw new J(e,{schemaVersion:"openpond.modelProjectApiError.v2",code:t,message:s,retryable:!1,requestId:null,details:{}})}m(b,"fail");import{createHash as Me}from"node:crypto";function Oe(e,t){let s=K(t),i=e.get("SELECT request_hash, payload FROM model_project_save_operations WHERE profile_id = ? AND operation_id = ?",[s.project.profileId,s.operationId]);if(!i)return null;let a=Me("sha256").update(g(s)).digest("hex");return i.request_hash!==a&&y(409,"model_operation_conflict","This save operation was already used with different Model configuration."),F.parse(JSON.parse(i.payload))}m(Oe,"findModelProjectSave");function Et(e,t,s,i){e.exec("BEGIN IMMEDIATE");try{let a=be(e,t,s,i);return e.exec("COMMIT"),a}catch(a){throw e.exec("ROLLBACK"),a}}m(Et,"commitModelProjectSave");function be(e,t,s,i){let a=K(t);a.learning&&y(422,"model_learning_hosted_required","Create this Model in a hosted workspace to enable continual learning.");let r=Me("sha256").update(g(a)).digest("hex"),{project:n,operationId:o,expectedRevision:c}=a,l=Oe(e,a);if(l)return l;let d=e.get("SELECT payload FROM model_projects WHERE id = ?",[n.id]),k=d?F.parse(JSON.parse(d.payload)):null;k&&k.profileId!==n.profileId&&y(404,"model_not_found","Model is not available in this Profile."),(k?.revision??0)!==c&&y(409,"model_revision_conflict","Model changed since it was opened. Refresh before saving.");let v=Ne(e,a),R=re(v);R||Ae(e,a);let S=R?T(R):v?.metadata.rewardBinding===void 0?null:C.parse(v.metadata.rewardBinding);v&&n.trainingSetup.rewardBindingRef&&(!S||!I(S,n.trainingSetup.rewardBindingRef))&&!s&&y(409,"model_taskset_preparation_required","Changing this Reward requires publishing its model-owned Taskset revision."),s&&((!n.trainingSetup.tasksetRef||!I(n.trainingSetup.tasksetRef,T(s.source))||!n.trainingSetup.rewardBindingRef||!I(n.trainingSetup.rewardBindingRef,T(s.derived.rewardBinding)))&&y(409,"model_taskset_preparation_changed","The prepared Taskset differs from the selected configuration."),ye(e,a,s));let N=new Date().toISOString(),x=ue.parse({...n.trainingSetup,baseModel:n.trainingSetup.baseModel??n.defaultBaseModel,method:n.trainingSetup.method??(v?.authoringProvenance.buildIntent==="verifiable_reward"?"grpo":v?.authoringProvenance.buildIntent==="demonstrations"?"sft":null),...S?{rewardBindingRef:S}:{},...s?{rewardBindingRef:T(s.derived.rewardBinding),tasksetRef:T(s.taskset),tasksetRelease:null,recipe:null,...n.trainingSetup.evaluationTasksetRef&&I(n.trainingSetup.evaluationTasksetRef,T(s.source))?{evaluationTasksetRef:T(s.taskset)}:{}}:{}}),p=s?.derived??i??(v&&!R&&x.rewardBindingRef&&v.metadata.taskDefinition!==void 0&&v.metadata.rewardBinding!==void 0?ee(e,v,x.rewardBindingRef).sourcePackage:void 0),u=F.parse({...k,...n,trainingSetup:p?_e({setup:x,package:p}):x,schemaVersion:"openpond.modelProject.v2",revision:c+1,hosted:k?.hosted??null,tasksetSyncs:k?.tasksetSyncs??[],createdAt:k?.createdAt??N,updatedAt:N});return e.run(`INSERT INTO model_projects (id, profile_id, payload, created_at, updated_at) VALUES (?, ?, ?, ?, ?)
5
- ON CONFLICT(id) DO UPDATE SET payload = excluded.payload, updated_at = excluded.updated_at`,[u.id,u.profileId,JSON.stringify(u),u.createdAt,u.updatedAt]),e.run("INSERT INTO model_project_save_operations (profile_id, operation_id, request_hash, payload) VALUES (?, ?, ?, ?)",[u.profileId,o,r,JSON.stringify(u)]),u}m(be,"saveModelProjectInTransaction");function Ne(e,t){let s=t.project.trainingSetup.tasksetRef;if(!s){t.project.trainingSetup.tasksetRelease&&y(400,"model_taskset_required","Choose the Taskset corresponding to this release.");return}let i=e.get("SELECT payload FROM taskset_revisions WHERE taskset_id = ? AND revision = ?",[s.id,s.revision]),a=i?E.parse(JSON.parse(i.payload)):null;return(!a||a.profileId!==t.project.profileId)&&y(404,"model_taskset_not_found","The selected Taskset revision is not available in this Profile."),a.contentHash!==s.contentHash&&y(409,"model_taskset_changed","The selected Taskset does not match its immutable content hash."),a}m(Ne,"assertTaskset");function Ae(e,t){let s=t.project.trainingSetup.rewardBindingRef;if(!s)return;function i(r,n){let o=e.get("SELECT payload FROM learning_revisions WHERE scope = ? AND kind = ? AND id = ? AND revision = ?",[t.project.profileId,r,n.id,n.revision]);o||y(404,"model_reward_unavailable","The exact Reward configuration is unavailable in this Profile.");let c=(r==="binding"?ae:ce).parse(JSON.parse(o.payload));return c.contentHash!==n.contentHash&&y(409,"model_reward_changed","The selected Reward does not match its immutable content hash."),q(c),c}m(i,"read");let a=ae.parse(i("binding",s));for(let r of a.sources)i("reward",r.reward)}m(Ae,"assertReward");function y(e,t,s){throw new J(e,{schemaVersion:"openpond.modelProjectApiError.v2",code:t,message:s,retryable:!1,requestId:null,details:{}})}m(y,"fail");function Nt(e,t){let{taskset:s,package:i}=t,a=s.profileId,r=e.get("SELECT payload FROM taskset_revisions WHERE taskset_id = ? AND revision = ?",[s.id,s.revision]);if(r&&g(E.parse(JSON.parse(r.payload)))!==g(s))throw new Error("Imported Taskset revision conflicts with an existing immutable local revision.");let n=e.get("SELECT payload FROM tasksets WHERE id = ?",[s.id]),o=n?E.parse(JSON.parse(n.payload)):null;if(o&&o.profileId!==a)throw new Error("Imported Taskset belongs to another Profile.");w(e,a,"package",i.taskset);let c=i.modelResources;if(c){w(e,a,"definition",c.taskDefinition),w(e,a,"binding",c.rewardBinding);for(let d of c.rewards)w(e,a,"reward",d);for(let d of c.assets)w(e,a,"asset",d);w(e,a,"asset",Y({environment:i.environment,verifierSet:i.verifierSet})),c.execution&&w(e,a,"asset",X(c.execution))}let l=JSON.stringify(s);r||e.run("INSERT INTO taskset_revisions (taskset_id, revision, content_hash, profile_id, status, payload, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?)",[s.id,s.revision,s.contentHash,a,s.status,l,s.createdAt,s.updatedAt]),(!o||o.revision<s.revision)&&e.run("INSERT INTO tasksets (id, profile_id, status, payload, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?) ON CONFLICT(id) DO UPDATE SET status = excluded.status, payload = excluded.payload, updated_at = excluded.updated_at",[s.id,a,s.status,l,s.createdAt,s.updatedAt])}m(Nt,"importTasksetPackageInTransaction");export{w as a,ie as b,ut as c,Oe as d,Et as e,be as f,Nt as g};
@@ -1,2 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{d as t,e as s}from"./chunk-JCLTFDVW.js";import{a as e}from"./chunk-FTQLQJQV.js";function p(n){let r=n.trim().replace(/\/$/,"");if(!r)throw new Error("sandbox API URL must be non-empty");let i=new URL(r),o=i.pathname.replace(/\/$/,"");return o.endsWith("/v1/sandboxes")||o.endsWith("/api/sandboxes")?`${i.origin}${o}`:o.endsWith("/v1")?`${i.origin}${o}/sandboxes`:a(i.hostname)?`${i.origin}${o}/v1/sandboxes`:i.origin===t?`${s}/v1/sandboxes`:`${i.origin}${o}/api/sandboxes`}e(p,"normalizeSandboxApiUrl");function u(n){let r="/sandboxes";if(!n.endsWith(r))throw new Error("sandbox API URL must end with /sandboxes");return n.slice(0,-r.length)}e(u,"apiRootUrlFromSandboxApiUrl");function a(n){return n==="api.openpond.ai"||n==="staging-api.openpond.ai"||n.startsWith("api")&&n.endsWith(".openpond.ai")}e(a,"isOpenPondHostedApiHost");export{p as a,u as b};
@@ -1,2 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{Rb as E,Y as m,_ as T,ha as p}from"./chunk-PGO4FRHU.js";import{ba as y}from"./chunk-4M3YW3EQ.js";import{n as w}from"./chunk-VVNV4NNW.js";import{a as k}from"./chunk-FTQLQJQV.js";import{constants as u}from"node:fs";import{link as O,lstat as F,mkdir as h,mkdtemp as P,open as N,readFile as x,readdir as B,rename as A,rm as v,writeFile as I}from"node:fs/promises";import i from"node:path";async function M(r,a){let s=a.metadata.importedPackageHash;if(s===void 0)return;if(typeof s!="string"||!r)throw new Error("Imported batch requires its package storage directory.");let t=await S(r,s);if(!t.learningResources||t.taskset.id!==a.id||t.taskset.revision!==a.revision||w(y(t.taskset))!==w(a.metadata.learning))throw new Error("Imported batch differs from its pinned package.");return t}k(M,"readImportedLearningTasksetPackage");async function J(r,a,s=m){let t=p(a,s),o=i.join(r,"training","portable-packages");await h(o,{recursive:!0});let d=i.join(o,`${t.contentHash}.json`),c=await P(i.join(o,".package-"));try{let n=i.join(c,"package.json");await I(n,JSON.stringify(t),{flag:"wx",mode:384});try{await O(n,d)}catch(e){if(e.code!=="EEXIST")throw e;await S(r,t.contentHash,s)}}finally{await v(c,{recursive:!0,force:!0})}}k(J,"cacheTasksetPackage");async function S(r,a,s=m){if(!/^[a-f0-9]{64}$/.test(a))throw new Error("Invalid Taskset package cache identity.");let t=i.join(r,"training","portable-packages",`${a}.json`),o=await N(t,u.O_RDONLY|u.O_NOFOLLOW|u.O_NONBLOCK);try{let d=await o.stat();if(!d.isFile()||d.size>s)throw new Error("Taskset package cache must be a bounded regular file.");let c=Buffer.alloc(d.size),n=0;for(;n<c.length;){let f=await o.read(c,n,c.length-n,n);if(!f.bytesRead)throw new Error("Taskset package cache changed during read.");n+=f.bytesRead}if((await o.read(Buffer.alloc(1),0,1,n)).bytesRead)throw new Error("Taskset package cache changed during read.");let e=p(JSON.parse(c.toString("utf8")),s);if(e.contentHash!==a)throw new Error("Cached Taskset package differs from its saved receipt.");return e}finally{await o.close()}}k(S,"readCachedTasksetPackage");async function $(r){let a=p(r.package),s=E(r.taskset.profileId,a.contentHash);if(r.taskset.environment.metadata.runtimeSourceTasksetId!==s)throw new Error("Imported Taskset directory differs from its package identity.");let t=new Map,o=k((e,f)=>{if(i.isAbsolute(e)||e.includes("\\")||e.split("/").some(l=>!l||l==="."||l===".."))throw new Error("Taskset package file requires a safe relative path.");let g=t.get(e);if(g&&!Buffer.from(g).equals(Buffer.from(f)))throw new Error(`Taskset package files collide at ${e}.`);t.set(e,f)},"add");for(let e of a.files)o(e.asset.path,T(e));for(let e of r.generatedFiles)o(e.path,Buffer.from(e.content,"utf8"));o("taskset.json",Buffer.from(JSON.stringify(r.taskset),"utf8"));let d=i.join(r.home,"training","tasksets");await h(d,{recursive:!0});let c=await P(i.join(d,".package-import-")),n=i.join(d,s);try{for(let[e,f]of t)await h(i.dirname(i.join(c,e)),{recursive:!0}),await I(i.join(c,e),f,{flag:"wx",mode:384});try{await A(c,n)}catch(e){if(!["EEXIST","ENOTEMPTY"].includes(e.code??""))throw e;let f=await F(n);if(!f.isDirectory()||f.isSymbolicLink())throw new Error("Imported Taskset destination must be a regular directory.");let g=await j(n);if(JSON.stringify(g.sort())!==JSON.stringify([...t.keys()].sort()))throw new Error("Imported Taskset file inventory changed.");for(let[l,b]of t)if(!(await x(i.join(n,l))).equals(Buffer.from(b)))throw new Error("Imported Taskset files differ from the pinned package.")}await J(r.home,a)}finally{await v(c,{recursive:!0,force:!0})}}k($,"materializeImportedTasksetPackage");async function j(r,a=""){let s=[];for(let t of await B(i.join(r,a),{withFileTypes:!0})){let o=i.posix.join(a,t.name);if(t.isSymbolicLink())throw new Error("Imported Taskset directories cannot contain symbolic links.");if(t.isDirectory())s.push(...await j(r,o));else if(t.isFile())s.push(o);else throw new Error("Imported Taskset packages require regular files.")}return s}k(j,"regularFiles");export{M as a,J as b,S as c,$ as d};
@@ -1,2 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{i as a,j as b,k as c}from"./chunk-M5IX6VUA.js";import"./chunk-FFWOTZQM.js";import"./chunk-ZXT7V64X.js";import"./chunk-HIYQPZ7C.js";import"./chunk-HBLN4OLY.js";import"./chunk-2V4LPUBH.js";import"./chunk-R4PDSOB4.js";import"./chunk-NWOK6NLE.js";import"./chunk-5MTN6KXV.js";import"./chunk-6SH4B7DV.js";import"./chunk-LRRBYIGH.js";import"./chunk-Y2KPHVZK.js";import"./chunk-IZ56L2ZK.js";import"./chunk-MNFW5WLD.js";import"./chunk-B4RKHHF7.js";import"./chunk-557XSPVS.js";import"./chunk-KCJVFLBB.js";import"./chunk-TUCKED4T.js";import"./chunk-OQPJ7FJF.js";import"./chunk-WBUK73ST.js";import"./chunk-P7HRF4FM.js";import"./chunk-INO67SEN.js";import"./chunk-2ITZW2CN.js";import"./chunk-BEI4YULC.js";import"./chunk-CN5OXQ7A.js";import"./chunk-NR5VASQB.js";import"./chunk-JY3YSI54.js";import"./chunk-W5W4IODW.js";import"./chunk-OZ6LRNRE.js";import"./chunk-PWK5Z5S3.js";import"./chunk-W45RKGM6.js";import"./chunk-W45RKGM6.js";import"./chunk-RH43WLBX.js";import"./chunk-P74RR2GB.js";import"./chunk-MWXW2CA6.js";import"./chunk-L3KS6MOV.js";import"./chunk-KOKX7PBS.js";import"./chunk-NLQ2UPN2.js";import"./chunk-XGY4OQLC.js";import"./chunk-547AUVKN.js";import"./chunk-IWK3RTLR.js";import"./chunk-IDOGNIMV.js";import"./chunk-PCB65K4G.js";import"./chunk-N5GPINVP.js";import"./chunk-TW3SRBLU.js";import"./chunk-PGO4FRHU.js";import"./chunk-VNJAAYNQ.js";import"./chunk-TVTFEGTU.js";import"./chunk-NVHZRKXB.js";import"./chunk-MTP3B2SU.js";import"./chunk-4N4EH3RJ.js";import"./chunk-HFJUXKT5.js";import"./chunk-5ZBLCWEJ.js";import"./chunk-LAOLJDVB.js";import"./chunk-UWHIU24L.js";import"./chunk-LV3CQ72P.js";import"./chunk-JCLTFDVW.js";import"./chunk-ABF3W2MO.js";import"./chunk-RV7PUSI2.js";import"./chunk-KCV5VN4X.js";import"./chunk-6FA3GG5B.js";import"./chunk-2EPR4HLF.js";import"./chunk-BKEDG3A4.js";import"./chunk-OE22TAXP.js";import"./chunk-UGOK7VTC.js";import"./chunk-4M3YW3EQ.js";import"./chunk-PBZCXPPC.js";import"./chunk-NJLULBTM.js";import"./chunk-VVNV4NNW.js";import"./chunk-PF56N7ZY.js";import"./chunk-FTQLQJQV.js";export{a as resolveWebLaunchMessages,c as runOpenPondAppServerCli,b as runOpenPondServerCli};
@@ -1,2 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a,b,c}from"./chunk-VAJSRUAB.js";import"./chunk-MNFW5WLD.js";import"./chunk-TUCKED4T.js";import"./chunk-OQPJ7FJF.js";import"./chunk-WBUK73ST.js";import"./chunk-P7HRF4FM.js";import"./chunk-INO67SEN.js";import"./chunk-2ITZW2CN.js";import"./chunk-BEI4YULC.js";import"./chunk-CN5OXQ7A.js";import"./chunk-NR5VASQB.js";import"./chunk-JY3YSI54.js";import"./chunk-W5W4IODW.js";import"./chunk-OZ6LRNRE.js";import"./chunk-PWK5Z5S3.js";import"./chunk-W45RKGM6.js";import"./chunk-W45RKGM6.js";import"./chunk-RH43WLBX.js";import"./chunk-P74RR2GB.js";import"./chunk-KOKX7PBS.js";import"./chunk-NLQ2UPN2.js";import"./chunk-XGY4OQLC.js";import"./chunk-547AUVKN.js";import"./chunk-IWK3RTLR.js";import"./chunk-IDOGNIMV.js";import"./chunk-PCB65K4G.js";import"./chunk-N5GPINVP.js";import"./chunk-TW3SRBLU.js";import"./chunk-PGO4FRHU.js";import"./chunk-VNJAAYNQ.js";import"./chunk-TVTFEGTU.js";import"./chunk-NVHZRKXB.js";import"./chunk-MTP3B2SU.js";import"./chunk-4N4EH3RJ.js";import"./chunk-HFJUXKT5.js";import"./chunk-5ZBLCWEJ.js";import"./chunk-JX6OX6XE.js";import"./chunk-XWDFXM3S.js";import"./chunk-LAOLJDVB.js";import"./chunk-UWHIU24L.js";import"./chunk-LV3CQ72P.js";import"./chunk-JCLTFDVW.js";import"./chunk-ABF3W2MO.js";import"./chunk-RV7PUSI2.js";import"./chunk-KCV5VN4X.js";import"./chunk-6FA3GG5B.js";import"./chunk-2EPR4HLF.js";import"./chunk-BKEDG3A4.js";import"./chunk-OE22TAXP.js";import"./chunk-UGOK7VTC.js";import"./chunk-4M3YW3EQ.js";import"./chunk-PBZCXPPC.js";import"./chunk-NJLULBTM.js";import"./chunk-VVNV4NNW.js";import"./chunk-PF56N7ZY.js";import"./chunk-FTQLQJQV.js";export{a as DEFAULT_CONNECTED_APP_TOOL_PATH,b as createCloudConnectedAppToolExecutor,c as resolveCloudConnectedAppToolTarget};
@@ -1,2 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as p,b as u}from"./chunk-HXZXDDKW.js";import"./chunk-4U2FNXQW.js";import"./chunk-VSQXDS6H.js";import"./chunk-SXMR6E2W.js";import"./chunk-7JBB4PXS.js";import"./chunk-UC3FXTDL.js";import"./chunk-XRKFTPHD.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{c}from"./chunk-3M53YXEI.js";import"./chunk-MILEWROZ.js";import{p as w}from"./chunk-NOSBNHGC.js";import"./chunk-JX6OX6XE.js";import"./chunk-BT5YNE5U.js";import"./chunk-UTNGEMW5.js";import"./chunk-QCSLEMZF.js";import"./chunk-B42QQUZY.js";import"./chunk-7KTARW23.js";import"./chunk-GLUWATL5.js";import"./chunk-OSVGNONV.js";import"./chunk-XWDFXM3S.js";import"./chunk-YBNKGA5C.js";import"./chunk-LAOLJDVB.js";import"./chunk-UWHIU24L.js";import"./chunk-LV3CQ72P.js";import"./chunk-JCLTFDVW.js";import"./chunk-ABF3W2MO.js";import"./chunk-RV7PUSI2.js";import"./chunk-KCV5VN4X.js";import"./chunk-2EPR4HLF.js";import"./chunk-BKEDG3A4.js";import"./chunk-OE22TAXP.js";import"./chunk-UGOK7VTC.js";import"./chunk-4M3YW3EQ.js";import"./chunk-PBZCXPPC.js";import"./chunk-NJLULBTM.js";import"./chunk-VVNV4NNW.js";import{A as l}from"./chunk-PF56N7ZY.js";import{a as n}from"./chunk-FTQLQJQV.js";async function g(r,d){let[o,s]=d;if(!o||d.length>2)throw new Error("usage: connected-evidence <list|collection|recorded-list|recorded|import-receipt|capture-assets|retain-assets|starting-assets|summary|case|unmapped|capture|selection|publish|prepare-recorded|upload-part|preview|commit|set-collection> [id] --team <id> [--input-file <path>]");if(c(r,"project")&&!["list","recorded-list"].includes(o))throw new Error("--project filters list commands; other operations retain their exact Project in --input-file.");if(r.local===!0||r.local==="true")throw new Error("Connected evidence is retained by its hosted source owner; select --api-base-url for that owner.");if(s&&!["recorded","import-receipt","starting-assets"].includes(o))throw new Error("This operation does not accept a resource id.");let a=new w(await u(r)),t=AbortSignal.timeout(6e4),m={...c(r,"project")?{projectId:c(r,"project")}:{},...c(r,"cursor")?{cursor:c(r,"cursor")}:{},limit:Number(c(r,"limit")||20)},i=n(async()=>p(r),"input"),e;switch(o){case"list":e=await a.list(m,t);break;case"recorded-list":e=await a.listRecordedExecutions(m,t);break;case"collection":e=await a.collection(t);break;case"recorded":if(!s)throw new Error("Select a recorded execution id.");e=await a.recordedExecution(s,t);break;case"import-receipt":if(!s)throw new Error("Select the original import operation id.");e=await a.readImport(s,t);break;case"retain-assets":e=await a.retainStartingAssets(await p(r,15*1024*1024),t);break;case"capture-assets":e=await(await import("./connected-starting-assets-V5QXRK5Q.js")).captureConnectedStartingAssets(r,a,t);break;case"starting-assets":if(!s)throw new Error("Select a retained starting assets id.");e=await a.startingAssets(s,t);break;case"summary":e=await a.homeSummary(await i(),t);break;case"case":e=await a.read(await i(),t);break;case"unmapped":e=await a.unmappedEvents(await i(),t);break;case"capture":e=await a.capture(await i(),t);break;case"selection":e=await a.createSelection(await i(),t);break;case"publish":e=await a.publishDataset(await i(),t);break;case"prepare-recorded":e=await a.prepareRecorded(await i(),t);break;case"upload-part":e=await a.uploadPart(await i(),t);break;case"preview":e=await a.preview(await i(),t);break;case"commit":e=await a.commit(await i(),t);break;case"set-collection":e=await a.setCollection(l.object({paused:l.boolean()}).strict().parse(await i()).paused,t);break;default:throw new Error("Unknown connected evidence operation.")}console.log(JSON.stringify(e,null,2))}n(g,"runConnectedEvidenceCommand");export{g as runConnectedEvidenceCommand};
@@ -1,2 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p}from"./chunk-4TM75R7V.js";import"./chunk-VSQXDS6H.js";import"./chunk-SXMR6E2W.js";import"./chunk-7JBB4PXS.js";import"./chunk-UC3FXTDL.js";import"./chunk-XRKFTPHD.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import"./chunk-3M53YXEI.js";import"./chunk-MILEWROZ.js";import"./chunk-NOSBNHGC.js";import"./chunk-JX6OX6XE.js";import"./chunk-BT5YNE5U.js";import"./chunk-UTNGEMW5.js";import"./chunk-QCSLEMZF.js";import"./chunk-B42QQUZY.js";import"./chunk-7KTARW23.js";import"./chunk-GLUWATL5.js";import"./chunk-OSVGNONV.js";import"./chunk-XWDFXM3S.js";import"./chunk-YBNKGA5C.js";import"./chunk-LAOLJDVB.js";import"./chunk-UWHIU24L.js";import"./chunk-LV3CQ72P.js";import"./chunk-JCLTFDVW.js";import"./chunk-ABF3W2MO.js";import"./chunk-RV7PUSI2.js";import"./chunk-KCV5VN4X.js";import"./chunk-2EPR4HLF.js";import"./chunk-BKEDG3A4.js";import"./chunk-OE22TAXP.js";import"./chunk-UGOK7VTC.js";import"./chunk-4M3YW3EQ.js";import"./chunk-PBZCXPPC.js";import"./chunk-NJLULBTM.js";import"./chunk-VVNV4NNW.js";import"./chunk-PF56N7ZY.js";import"./chunk-FTQLQJQV.js";export{m as resolveGitBranch,f as runAccount,j as runBacktestRun,p as runCheckUpdate,k as runDeployWatch,g as runHealth,d as runLogin,o as runOpentool,e as runProfiles,l as runRepoCreate,n as runRepoPush,b as runTemplateBranches,a as runTemplateStatus,c as runTemplateUpdate,h as runToolList,i as runToolRun};
@@ -1,4 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as w,b}from"./chunk-2UDAKLJ4.js";import{a as m}from"./chunk-SD64CLJX.js";import"./chunk-TUCKED4T.js";import"./chunk-OQPJ7FJF.js";import"./chunk-WBUK73ST.js";import"./chunk-P7HRF4FM.js";import"./chunk-INO67SEN.js";import"./chunk-2ITZW2CN.js";import"./chunk-BEI4YULC.js";import"./chunk-CN5OXQ7A.js";import"./chunk-NR5VASQB.js";import"./chunk-JY3YSI54.js";import"./chunk-W5W4IODW.js";import"./chunk-OZ6LRNRE.js";import"./chunk-PWK5Z5S3.js";import"./chunk-W45RKGM6.js";import"./chunk-W45RKGM6.js";import"./chunk-RH43WLBX.js";import"./chunk-P74RR2GB.js";import"./chunk-KOKX7PBS.js";import"./chunk-NLQ2UPN2.js";import"./chunk-XGY4OQLC.js";import{c as h}from"./chunk-547AUVKN.js";import"./chunk-IWK3RTLR.js";import"./chunk-IDOGNIMV.js";import"./chunk-PCB65K4G.js";import"./chunk-N5GPINVP.js";import"./chunk-TW3SRBLU.js";import"./chunk-PGO4FRHU.js";import"./chunk-VNJAAYNQ.js";import"./chunk-TVTFEGTU.js";import"./chunk-NVHZRKXB.js";import"./chunk-MTP3B2SU.js";import"./chunk-5ZBLCWEJ.js";import"./chunk-LAOLJDVB.js";import"./chunk-UWHIU24L.js";import"./chunk-LV3CQ72P.js";import"./chunk-ABF3W2MO.js";import"./chunk-RV7PUSI2.js";import"./chunk-KCV5VN4X.js";import"./chunk-6FA3GG5B.js";import"./chunk-BKEDG3A4.js";import"./chunk-OE22TAXP.js";import"./chunk-4M3YW3EQ.js";import"./chunk-PBZCXPPC.js";import"./chunk-NJLULBTM.js";import"./chunk-VVNV4NNW.js";import"./chunk-PF56N7ZY.js";import{a as f}from"./chunk-FTQLQJQV.js";import{constants as g}from"node:fs";import{open as y,realpath as D}from"node:fs/promises";import k from"node:path";async function x(i){if(i.length!==1||!k.isAbsolute(i[0]))throw new Error("Dataset preparation requires one absolute private request-file path.");let o=i[0];if(await D(o)!==o)throw new Error("Dataset preparation request path must not contain symbolic links.");let s=await y(o,g.O_RDONLY|g.O_NOFOLLOW),n=4*1024*1024,l;try{let r=await s.stat();if(!r.isFile()||r.size>n||(r.mode&63)!==0||process.getuid&&r.uid!==process.getuid())throw new Error("Dataset preparation request is not a bounded private file.");let a=Buffer.alloc(n+1),e=0;for(;e<a.length;){let d=await s.read(a,e,a.length-e,e);if(d.bytesRead===0)break;e+=d.bytesRead}if(e>n)throw new Error("Dataset preparation request changed beyond its byte limit.");l=a.subarray(0,e)}finally{await s.close()}let t=h.parse(JSON.parse(new TextDecoder("utf8",{fatal:!0}).decode(l))),c=await m(),p;try{p=t.action==="messages"?{messages:w({id:t.id,evidence:t.evidence,skillText:c.bundle,buildIntent:"verifiable_reward",buildSpecification:t.buildSpecification,methodHint:"grpo",instruction:t.instruction,currentProposal:t.currentProposal}),skillHash:c.contentHash}:{proposal:b(t.content,t.evidence),skillHash:c.contentHash}}catch(r){if(t.action!=="validate")throw r;process.stdout.write(`${JSON.stringify({error:{code:"dataset_preparation_authoring_proposal_invalid"}})}
3
- `),process.exitCode=2;return}let u=JSON.stringify(p);if(Buffer.byteLength(u)>4*1024*1024)throw new Error("Dataset preparation authoring response exceeds its byte limit.");process.stdout.write(`${u}
4
- `)}f(x,"runDatasetPreparationAuthoringCli");export{x as runDatasetPreparationAuthoringCli};