openpond 0.2.63 → 0.2.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (561) hide show
  1. package/dist/app-server.d.ts +76 -2
  2. package/dist/app-server.js +1 -1
  3. package/dist/chunks/account-context-TIJOM22A.js +12 -0
  4. package/dist/chunks/acp-PHMBLRCV.js +2 -0
  5. package/dist/chunks/acp-agent-A7GK2VSH.js +19 -0
  6. package/dist/chunks/actions-command-VLKMHCMI.js +2 -0
  7. package/dist/chunks/app-layer-J66CQ2QN.js +3 -0
  8. package/dist/chunks/app-server-connected-apps-IB6M35NS.js +2 -0
  9. package/dist/chunks/app-server-evaluations-V6LRWDUF.js +2 -0
  10. package/dist/chunks/app-server-harness-services-6ZRLA3YD.js +2 -0
  11. package/dist/chunks/app-server-runtime-OMR2VE6L.js +2 -0
  12. package/dist/chunks/apps-IHUFERZO.js +2 -0
  13. package/dist/chunks/{chunk-NZTCH6K5.js → chunk-2GJD23CM.js} +1 -1
  14. package/dist/chunks/{chunk-BKEDG3A4.js → chunk-2MEOUS24.js} +1 -1
  15. package/dist/chunks/{chunk-DUL6DXOI.js → chunk-2W22IXHB.js} +1 -1
  16. package/dist/chunks/{chunk-GGJUWIGR.js → chunk-36FNNR5N.js} +1 -1
  17. package/dist/chunks/chunk-3BJ7LPE3.js +2 -0
  18. package/dist/chunks/chunk-3MVKXAH7.js +2 -0
  19. package/dist/chunks/{chunk-UTNGEMW5.js → chunk-3WJQ4IGK.js} +1 -1
  20. package/dist/chunks/{chunk-G6OR5NB6.js → chunk-4D3CICBG.js} +1 -1
  21. package/dist/chunks/chunk-4DYWVGVS.js +2 -0
  22. package/dist/chunks/{chunk-KUPJNBWG.js → chunk-4JYTFEND.js} +1 -1
  23. package/dist/chunks/chunk-4MQHIFZL.js +2 -0
  24. package/dist/chunks/chunk-4TO743HO.js +4 -0
  25. package/dist/chunks/{chunk-B4RKHHF7.js → chunk-4TTXNVCE.js} +1 -1
  26. package/dist/chunks/{chunk-3YXYBYWK.js → chunk-4V73I4OL.js} +1 -1
  27. package/dist/chunks/chunk-55Q64WWF.js +2 -0
  28. package/dist/chunks/{chunk-F7QTIHXX.js → chunk-5AU5Y6KS.js} +1 -1
  29. package/dist/chunks/chunk-5HPZGLOL.js +2 -0
  30. package/dist/chunks/{chunk-LCSBCCYC.js → chunk-5JVJQA5H.js} +1 -1
  31. package/dist/chunks/chunk-5KJMFK65.js +2 -0
  32. package/dist/chunks/{chunk-BSPFY3Y5.js → chunk-5KWKSR4P.js} +1 -1
  33. package/dist/chunks/chunk-5WPMI6QX.js +2 -0
  34. package/dist/chunks/{chunk-SHJY5RLU.js → chunk-5Z3AU5CL.js} +1 -1
  35. package/dist/chunks/{chunk-DQI5TE6A.js → chunk-66HFW4OU.js} +1 -1
  36. package/dist/chunks/{chunk-NT7N6KLE.js → chunk-67HXM6AL.js} +1 -1
  37. package/dist/chunks/{chunk-J7ZTPXRQ.js → chunk-6C3CXME7.js} +1 -1
  38. package/dist/chunks/{chunk-PWK5Z5S3.js → chunk-6ESBAHWK.js} +1 -1
  39. package/dist/chunks/{chunk-XNOMIWEY.js → chunk-6I5AUTVO.js} +1 -1
  40. package/dist/chunks/{chunk-OG33QAG6.js → chunk-6S2MWJVD.js} +1 -1
  41. package/dist/chunks/{chunk-KCOTDUGW.js → chunk-6TRVEA3T.js} +1 -1
  42. package/dist/chunks/chunk-6ZTP6CUJ.js +2 -0
  43. package/dist/chunks/{chunk-4L6DU6Z2.js → chunk-7FBWUVX7.js} +1 -1
  44. package/dist/chunks/{chunk-GPL2Z65R.js → chunk-7P5SH3CI.js} +2 -2
  45. package/dist/chunks/chunk-7PKTCMZ6.js +2 -0
  46. package/dist/chunks/chunk-7XOUM6RK.js +2 -0
  47. package/dist/chunks/chunk-A77DLBR4.js +2 -0
  48. package/dist/chunks/chunk-AF3AVDPP.js +2 -0
  49. package/dist/chunks/{chunk-RV7PUSI2.js → chunk-AJXWJLZA.js} +1 -1
  50. package/dist/chunks/chunk-AMC4Z7G4.js +2 -0
  51. package/dist/chunks/chunk-ANG2YMMD.js +2 -0
  52. package/dist/chunks/{chunk-ZPTKR3GB.js → chunk-B32CW3NT.js} +1 -1
  53. package/dist/chunks/{chunk-Y766IN7Y.js → chunk-B666Z2NS.js} +1 -1
  54. package/dist/chunks/chunk-BJXPQIVD.js +2 -0
  55. package/dist/chunks/{chunk-WBUK73ST.js → chunk-BL3CZWWD.js} +1 -1
  56. package/dist/chunks/{chunk-XMHIQ3SK.js → chunk-BTJACFU3.js} +2 -2
  57. package/dist/chunks/{chunk-25XXZS3E.js → chunk-C5B3FMV3.js} +1 -1
  58. package/dist/chunks/chunk-CRDKBFRN.js +2 -0
  59. package/dist/chunks/chunk-CYQLXS2U.js +2 -0
  60. package/dist/chunks/{chunk-N4VHLJBZ.js → chunk-D7R2AAX2.js} +1 -1
  61. package/dist/chunks/{chunk-LSZJ5M3X.js → chunk-DAEUVT2I.js} +1 -1
  62. package/dist/chunks/{chunk-ELX7VRSU.js → chunk-DIDQHTAX.js} +1 -1
  63. package/dist/chunks/chunk-DMO3UIS7.js +6 -0
  64. package/dist/chunks/{chunk-4BJGUCHY.js → chunk-DRMOHADV.js} +1 -1
  65. package/dist/chunks/{chunk-FYYYECHE.js → chunk-DSJZS77R.js} +4 -4
  66. package/dist/chunks/{chunk-7HRLWPPZ.js → chunk-DXA2UHBE.js} +1 -1
  67. package/dist/chunks/chunk-E2S2EMYQ.js +10 -0
  68. package/dist/chunks/{chunk-T6JN4PND.js → chunk-EBOTNBUS.js} +1 -1
  69. package/dist/chunks/chunk-ECOH24MC.js +9 -0
  70. package/dist/chunks/{chunk-6PKXJEJM.js → chunk-EICS777E.js} +1 -1
  71. package/dist/chunks/{chunk-4SZ3HKHU.js → chunk-EVQISX7M.js} +1 -1
  72. package/dist/chunks/chunk-FEQ7HNJR.js +2 -0
  73. package/dist/chunks/{chunk-2HAWOMZK.js → chunk-FGOTSCSE.js} +1 -1
  74. package/dist/chunks/{chunk-IWWXIUAQ.js → chunk-FHLSLOKH.js} +8 -8
  75. package/dist/chunks/{chunk-BU27SLZP.js → chunk-FS2VKOT7.js} +1 -1
  76. package/dist/chunks/{chunk-4FNCBA3Y.js → chunk-FUFI4THX.js} +1 -1
  77. package/dist/chunks/{chunk-W5W4IODW.js → chunk-FYWQWKVS.js} +1 -1
  78. package/dist/chunks/{chunk-IZ56L2ZK.js → chunk-G4747MOW.js} +1 -1
  79. package/dist/chunks/{chunk-J572ANHX.js → chunk-G4E3WGLM.js} +4 -4
  80. package/dist/chunks/{chunk-P7HRF4FM.js → chunk-GD3RCUDH.js} +1 -1
  81. package/dist/chunks/{chunk-HUCBKXTU.js → chunk-GDJ4X2ZN.js} +1 -1
  82. package/dist/chunks/{chunk-JHR3LF2F.js → chunk-GF55VEMR.js} +1 -1
  83. package/dist/chunks/{chunk-GXCUH2VV.js → chunk-GFAI2MCJ.js} +3 -3
  84. package/dist/chunks/{chunk-KOKX7PBS.js → chunk-GI7LTJV3.js} +1 -1
  85. package/dist/chunks/{chunk-TCOTXCV6.js → chunk-GIU3Z45P.js} +1 -1
  86. package/dist/chunks/{chunk-GXZCMO6S.js → chunk-GRLQHYAU.js} +2 -2
  87. package/dist/chunks/{chunk-M3SCON53.js → chunk-GUG2SWRZ.js} +1 -1
  88. package/dist/chunks/{chunk-JQRMDFF3.js → chunk-H42UW6IF.js} +1 -1
  89. package/dist/chunks/{chunk-EZRUWIP6.js → chunk-H5ML7735.js} +1 -1
  90. package/dist/chunks/{chunk-VNJAAYNQ.js → chunk-HIQPGYVH.js} +1 -1
  91. package/dist/chunks/{chunk-DLANLLKH.js → chunk-HNDAGZCF.js} +1 -1
  92. package/dist/chunks/{chunk-OE22TAXP.js → chunk-HNQPEOJD.js} +1 -1
  93. package/dist/chunks/chunk-HORMGT2Q.js +2 -0
  94. package/dist/chunks/{chunk-2V4LPUBH.js → chunk-HPTEJBP4.js} +1 -1
  95. package/dist/chunks/{chunk-UWHIU24L.js → chunk-HVM2GUM3.js} +1 -1
  96. package/dist/chunks/{chunk-NEJLJ2XY.js → chunk-HX6GXMDK.js} +1 -1
  97. package/dist/chunks/chunk-I3NYYOSS.js +2 -0
  98. package/dist/chunks/{chunk-LV3CQ72P.js → chunk-I6VMRQF4.js} +1 -1
  99. package/dist/chunks/{chunk-QU4UE73E.js → chunk-IEVJLG3V.js} +1 -1
  100. package/dist/chunks/chunk-IOSBGCRT.js +2 -0
  101. package/dist/chunks/{chunk-SO42ZB5K.js → chunk-JBFPTEVE.js} +1 -1
  102. package/dist/chunks/{chunk-G32BO6M5.js → chunk-JD76ANPN.js} +1 -1
  103. package/dist/chunks/{chunk-ERJV5BMC.js → chunk-JFZ6USNQ.js} +1 -1
  104. package/dist/chunks/{chunk-UPWJSNL5.js → chunk-JLW5BQVO.js} +1 -1
  105. package/dist/chunks/chunk-JRGECNP3.js +2 -0
  106. package/dist/chunks/{chunk-DABBHWSF.js → chunk-KAWXVMHI.js} +1 -1
  107. package/dist/chunks/chunk-KGUPAPGR.js +2 -0
  108. package/dist/chunks/{chunk-AHOBCBVZ.js → chunk-KOKBDIGR.js} +1 -1
  109. package/dist/chunks/chunk-KTIBXRWQ.js +2 -0
  110. package/dist/chunks/chunk-L4EJ5R3B.js +23 -0
  111. package/dist/chunks/{chunk-SI5W5LBV.js → chunk-LARJARMS.js} +1 -1
  112. package/dist/chunks/{chunk-MPNJ2BB4.js → chunk-LE75SVEL.js} +1 -1
  113. package/dist/chunks/{chunk-ERT32RZA.js → chunk-LI3FTPAH.js} +5 -5
  114. package/dist/chunks/chunk-LK77GI6M.js +2 -0
  115. package/dist/chunks/chunk-LOIYNRBC.js +33 -0
  116. package/dist/chunks/{chunk-7WYL2IDD.js → chunk-LXZLLTYQ.js} +1 -1
  117. package/dist/chunks/{chunk-RZUCVF2Q.js → chunk-LYVHYT3L.js} +1 -1
  118. package/dist/chunks/{chunk-MWXW2CA6.js → chunk-LZPCA6DH.js} +1 -1
  119. package/dist/chunks/{chunk-GVARQXYI.js → chunk-M5QPL5NO.js} +1 -1
  120. package/dist/chunks/{chunk-WWQNMC7C.js → chunk-MCBRB5D6.js} +1 -1
  121. package/dist/chunks/chunk-MHPCVQOE.js +2 -0
  122. package/dist/chunks/chunk-MMJU6PZV.js +2 -0
  123. package/dist/chunks/chunk-MVPKU72J.js +4 -0
  124. package/dist/chunks/{chunk-AGVOGPAZ.js → chunk-MWS2NAHJ.js} +1 -1
  125. package/dist/chunks/{chunk-R6VJDOQM.js → chunk-N2AV7PHV.js} +4 -4
  126. package/dist/chunks/{chunk-R6WMY6AH.js → chunk-NTM3KQ25.js} +1 -1
  127. package/dist/chunks/chunk-NXN7GJOH.js +2 -0
  128. package/dist/chunks/chunk-O6ZYDHEJ.js +3 -0
  129. package/dist/chunks/chunk-OKEC2EIE.js +2 -0
  130. package/dist/chunks/{chunk-KCV5VN4X.js → chunk-OKKNDQJF.js} +1 -1
  131. package/dist/chunks/{chunk-ZYVHOVKL.js → chunk-OPTJYDZN.js} +1 -1
  132. package/dist/chunks/{chunk-NJLULBTM.js → chunk-OTDDXEQ6.js} +1 -1
  133. package/dist/chunks/{chunk-RDSVU6F6.js → chunk-OTUS7NTQ.js} +1 -1
  134. package/dist/chunks/{chunk-UH4JSSRL.js → chunk-OTXGAKFH.js} +8 -8
  135. package/dist/chunks/chunk-OW3EOC5Q.js +4 -0
  136. package/dist/chunks/chunk-OXRVILDW.js +2 -0
  137. package/dist/chunks/{chunk-JEISPWWM.js → chunk-PWKJ5KLZ.js} +1 -1
  138. package/dist/chunks/{chunk-RFMME46Z.js → chunk-PYNW5OFA.js} +1 -1
  139. package/dist/chunks/{chunk-AKGCM53D.js → chunk-Q3WXB465.js} +1 -1
  140. package/dist/chunks/{chunk-KHTAAVC2.js → chunk-Q4AXZY2P.js} +1 -1
  141. package/dist/chunks/{chunk-QJ6KUVAR.js → chunk-QAEZNFAM.js} +1 -1
  142. package/dist/chunks/{chunk-ABF3W2MO.js → chunk-QAFXQHHG.js} +2 -2
  143. package/dist/chunks/chunk-QCJY6FTC.js +3 -0
  144. package/dist/chunks/{chunk-5MHYGMJG.js → chunk-QJJNHKLT.js} +1 -1
  145. package/dist/chunks/{chunk-ERL2M773.js → chunk-QYQZQVVN.js} +1 -1
  146. package/dist/chunks/{chunk-VVNV4NNW.js → chunk-RCT3O3HQ.js} +1 -1
  147. package/dist/chunks/{chunk-7R56WC7L.js → chunk-RHMULF56.js} +1 -1
  148. package/dist/chunks/chunk-RRWL5BHZ.js +2 -0
  149. package/dist/chunks/{chunk-RG3NH6YQ.js → chunk-S4WILIRA.js} +1 -1
  150. package/dist/chunks/{chunk-N33D7KCW.js → chunk-S6UCVXBC.js} +1 -1
  151. package/dist/chunks/{chunk-IHB5GTOJ.js → chunk-SAZTOGX6.js} +3 -3
  152. package/dist/chunks/{chunk-2EPR4HLF.js → chunk-SH7POUVX.js} +6 -6
  153. package/dist/chunks/{chunk-NLYZ5K7U.js → chunk-SSJV3VX7.js} +1 -1
  154. package/dist/chunks/chunk-TBODQT4W.js +2 -0
  155. package/dist/chunks/chunk-TGULVWPV.js +2 -0
  156. package/dist/chunks/{chunk-HIYQPZ7C.js → chunk-TPOAAJKA.js} +1 -1
  157. package/dist/chunks/{chunk-42V4NV2F.js → chunk-TVDZXDQW.js} +1 -1
  158. package/dist/chunks/{chunk-FVRII5XO.js → chunk-U2BD545L.js} +1 -1
  159. package/dist/chunks/chunk-UK5LGSGT.js +2 -0
  160. package/dist/chunks/{chunk-HFJUXKT5.js → chunk-ULJZ7NUF.js} +1 -1
  161. package/dist/chunks/chunk-UM6EQOT2.js +161 -0
  162. package/dist/chunks/chunk-UN2LKLGV.js +2 -0
  163. package/dist/chunks/{chunk-4NXEYPPX.js → chunk-UOFDKMRU.js} +1 -1
  164. package/dist/chunks/{chunk-2ITZW2CN.js → chunk-UTIELP6F.js} +1 -1
  165. package/dist/chunks/{chunk-NWQL6FNF.js → chunk-V3KEG6MI.js} +1 -1
  166. package/dist/chunks/{chunk-BPZOABMC.js → chunk-V3S2B6WU.js} +2 -2
  167. package/dist/chunks/{chunk-ZG6353RM.js → chunk-VD2TQCMH.js} +1 -1
  168. package/dist/chunks/{chunk-4ZBOYWQ3.js → chunk-VS2LOUCT.js} +1 -1
  169. package/dist/chunks/{chunk-V7KR74NO.js → chunk-VS3AMJEK.js} +1 -1
  170. package/dist/chunks/{chunk-YCZZ62C2.js → chunk-W22KWKF6.js} +1 -1
  171. package/dist/chunks/chunk-W7NXFRHN.js +2 -0
  172. package/dist/chunks/{chunk-DTTFUANI.js → chunk-WBO6FQHR.js} +2 -2
  173. package/dist/chunks/{chunk-5ZBLCWEJ.js → chunk-WJSJXK2N.js} +1 -1
  174. package/dist/chunks/{chunk-C2LAEGOW.js → chunk-WKHGXLJD.js} +2 -2
  175. package/dist/chunks/{chunk-H6C4MAUN.js → chunk-WLQEONBF.js} +1 -1
  176. package/dist/chunks/chunk-WLZJOCLA.js +10 -0
  177. package/dist/chunks/chunk-WMBOXX7G.js +2 -0
  178. package/dist/chunks/{chunk-PF56N7ZY.js → chunk-X2J2P5ZT.js} +5 -5
  179. package/dist/chunks/{chunk-AH26AQN7.js → chunk-XHBMK6LC.js} +1 -1
  180. package/dist/chunks/{chunk-ZZHXQCNB.js → chunk-Y3B6ZUE6.js} +1 -1
  181. package/dist/chunks/{chunk-WP2L2NY2.js → chunk-YBKDEEEH.js} +1 -1
  182. package/dist/chunks/chunk-YRDPVTEI.js +3 -0
  183. package/dist/chunks/{chunk-JORRZ4BB.js → chunk-YU4JYWCA.js} +1 -1
  184. package/dist/chunks/{chunk-CZ5R4JXZ.js → chunk-Z2TOBS3P.js} +1 -1
  185. package/dist/chunks/chunk-ZFJWA4JK.js +1 -0
  186. package/dist/chunks/chunk-ZSZXA7WB.js +2 -0
  187. package/dist/chunks/{chunk-LK2K3SPM.js → chunk-ZU3YBRXS.js} +2 -2
  188. package/dist/chunks/{chunk-5FU5RLML.js → chunk-ZUT4EM64.js} +1 -1
  189. package/dist/chunks/chunk-ZWW227M3.js +2 -0
  190. package/dist/chunks/chunk-ZY32SZ2P.js +3 -0
  191. package/dist/chunks/cli-TE7RP5H7.js +2 -0
  192. package/dist/chunks/client-I5MYOJEJ.js +2 -0
  193. package/dist/chunks/command-NDHFZAKA.js +13 -0
  194. package/dist/chunks/configuration-command-465ODYTC.js +2 -0
  195. package/dist/chunks/connected-app-executor-7DYMZCD7.js +2 -0
  196. package/dist/chunks/connected-evidence-XPAZQRFQ.js +2 -0
  197. package/dist/chunks/{connected-starting-assets-JONPTII6.js → connected-starting-assets-2YX3QVDB.js} +1 -1
  198. package/dist/chunks/connection-GDWPMHPC.js +2 -0
  199. package/dist/chunks/{continual-Z7MO2PF6.js → continual-HQCFY7GN.js} +3 -3
  200. package/dist/chunks/core-commands-PJOGRBHJ.js +2 -0
  201. package/dist/chunks/dataset-preparation-authoring-KWRTMKN6.js +4 -0
  202. package/dist/chunks/datasets-OTE2I4VT.js +2 -0
  203. package/dist/chunks/desktop-test-Q6REQJ7K.js +3 -0
  204. package/dist/chunks/dist-GR56E3QK.js +2 -0
  205. package/dist/chunks/dist-J4KHAVO3.js +2 -0
  206. package/dist/chunks/dist-O7HXZUBW.js +2 -0
  207. package/dist/chunks/enclave-7VLABNIX.js +2 -0
  208. package/dist/chunks/evaluation-coordination-KRCY2H4C.js +2 -0
  209. package/dist/chunks/experiment-improvements-7MI2VYBR.js +2 -0
  210. package/dist/chunks/experiments-CNUQKJZE.js +2 -0
  211. package/dist/chunks/experiments-VOCZ4DW3.js +2 -0
  212. package/dist/chunks/experiments-signal-4N344D4Y.js +2 -0
  213. package/dist/chunks/{extension-ZM6NI5O5.js → extension-UH34ZF7N.js} +1 -1
  214. package/dist/chunks/{help-7HXFWIKS.js → help-ZUKVY6RO.js} +1 -1
  215. package/dist/chunks/host-profile-evaluation-tools-75EPCRSZ.js +2 -0
  216. package/dist/chunks/host-profile-external-dataset-YRKG2GL5.js +2 -0
  217. package/dist/chunks/hosted-app-server-composition-DWSU6ASL.js +2 -0
  218. package/dist/chunks/hosted-experiment-improvement-NZTPZTDH.js +3 -0
  219. package/dist/chunks/hosted-harness-runtime-3AJGEIFD.js +2 -0
  220. package/dist/chunks/hosted-profile-candidate-3CAT3XBI.js +3 -0
  221. package/dist/chunks/hosted-profile-compiler-RXU626Q6.js +2 -0
  222. package/dist/chunks/hosted-profile-evaluation-control-CBDRKJ5J.js +2 -0
  223. package/dist/chunks/hosted-profile-evaluation-inspection-CHYKDYUQ.js +3 -0
  224. package/dist/chunks/hosted-profile-evaluation-preparation-H5S7JZMD.js +3 -0
  225. package/dist/chunks/hosted-tasksets-AMGDDB2R.js +2 -0
  226. package/dist/chunks/human-review-HOBGC6RC.js +2 -0
  227. package/dist/chunks/{import-6SI4BEKS.js → import-Q3YRFVY7.js} +2 -2
  228. package/dist/chunks/learning-NJLTGZFQ.js +2 -0
  229. package/dist/chunks/learning-XTY5VOTK.js +2 -0
  230. package/dist/chunks/local-harness-improvement-runtime-XEA73RGS.js +2 -0
  231. package/dist/chunks/local-harness-taskset-review-SW35G4DM.js +2 -0
  232. package/dist/chunks/local-scope-X3737QXT.js +2 -0
  233. package/dist/chunks/model-projects-GHWCKDON.js +2 -0
  234. package/dist/chunks/opchat-2LLDIWEJ.js +3 -0
  235. package/dist/chunks/opchat-bounded-chat-FLDS36LU.js +2 -0
  236. package/dist/chunks/organizations-VIFSOY6P.js +2 -0
  237. package/dist/chunks/{profile-O5HL5DTQ.js → profile-KIHMW2WB.js} +1 -1
  238. package/dist/chunks/profile-training-source-VIND2MM2.js +2 -0
  239. package/dist/chunks/project-action-payload-2G57RL74.js +2 -0
  240. package/dist/chunks/project-agent-TJLQNMLA.js +2 -0
  241. package/dist/chunks/published-experiment-source-D3C2AWQD.js +2 -0
  242. package/dist/chunks/refiner-profile-service-PPGGNVOV.js +2 -0
  243. package/dist/chunks/{runtime-XBA744HJ.js → runtime-VSOOPNYN.js} +2 -2
  244. package/dist/chunks/sandbox-command-CQO6BEMQ.js +2 -0
  245. package/dist/chunks/{sandbox-template-27U3FQN7.js → sandbox-template-MU33IILL.js} +1 -1
  246. package/dist/chunks/saved-work-LAVTNKPT.js +2 -0
  247. package/dist/chunks/send-turn-D3GTSSHI.js +2 -0
  248. package/dist/chunks/setup-HSRCZ3WR.js +2 -0
  249. package/dist/chunks/{src-PU7QTFO5.js → src-662QOKNP.js} +1 -1
  250. package/dist/chunks/{src-BLWX6DRG.js → src-CHQVWHV7.js} +117 -117
  251. package/dist/chunks/standalone-experiment-turn-owner-KKYIGGPF.js +2 -0
  252. package/dist/chunks/stdio-Z65UIX55.js +2 -0
  253. package/dist/chunks/store-chat-resources-ZWDYMDJF.js +2 -0
  254. package/dist/chunks/{store-continual-support-reviews-FOMYYS25.js → store-continual-support-reviews-7PDLGRWF.js} +1 -1
  255. package/dist/chunks/store-conversation-serving-WRT4N7N2.js +2 -0
  256. package/dist/chunks/{store-create-improve-3LQMIYAP.js → store-create-improve-G46KIUVT.js} +1 -1
  257. package/dist/chunks/{store-datasets-3KSX7RSO.js → store-datasets-O67F75BL.js} +1 -1
  258. package/dist/chunks/store-evaluation-results-BEPR4LVD.js +7 -0
  259. package/dist/chunks/{store-harness-memory-2L7ARBR4.js → store-harness-memory-4XEUITXE.js} +1 -1
  260. package/dist/chunks/{store-harness-refinement-candidates-3PHL3BUY.js → store-harness-refinement-candidates-LCN4NV23.js} +1 -1
  261. package/dist/chunks/store-harness-workspaces-PJJQ74G6.js +2 -0
  262. package/dist/chunks/store-human-review-HJ3D7ZFA.js +7 -0
  263. package/dist/chunks/store-learned-preference-migration-validation-EXNRDHCO.js +2 -0
  264. package/dist/chunks/store-learning-6P6IS7GH.js +2 -0
  265. package/dist/chunks/store-learning-credentials-EGJ2WTZI.js +2 -0
  266. package/dist/chunks/{store-local-experiments-QTVHJAEP.js → store-local-experiments-CBJA56X2.js} +1 -1
  267. package/dist/chunks/store-model-batch-review-YIVD7T2T.js +2 -0
  268. package/dist/chunks/{store-model-configuration-3SU73CMS.js → store-model-configuration-T6XJJDAB.js} +2 -2
  269. package/dist/chunks/store-model-project-preparation-WWU5CJTV.js +2 -0
  270. package/dist/chunks/{store-preference-comparison-DWV5XSMY.js → store-preference-comparison-XQFTLMGH.js} +1 -1
  271. package/dist/chunks/{store-schedules-2KUY4T6M.js → store-schedules-JPFVWL3Q.js} +1 -1
  272. package/dist/chunks/{store-sidebar-file-bookmarks-A4XCS7RM.js → store-sidebar-file-bookmarks-J3JEVAYR.js} +1 -1
  273. package/dist/chunks/{store-sidebar-preferences-V2PKRXUZ.js → store-sidebar-preferences-2JHTFXJK.js} +1 -1
  274. package/dist/chunks/{store-subagents-UGVEFA6M.js → store-subagents-PUBQVWSU.js} +1 -1
  275. package/dist/chunks/{store-task-inbox-QABI4ZAH.js → store-task-inbox-VVXZUJIO.js} +1 -1
  276. package/dist/chunks/{store-task-inventory-GEQIZELY.js → store-task-inventory-MQX44AI6.js} +1 -1
  277. package/dist/chunks/store-taskset-drafts-G3WFVN4M.js +9 -0
  278. package/dist/chunks/{store-training-CQV7PL3V.js → store-training-DUVIDYK5.js} +1 -1
  279. package/dist/chunks/{store-training-jobs-XKN6K66J.js → store-training-jobs-HHFH3V5O.js} +1 -1
  280. package/dist/chunks/{store-training-models-Q7DTTR4S.js → store-training-models-C7UUZDTO.js} +1 -1
  281. package/dist/chunks/{store-usage-XGAX7NLB.js → store-usage-6DMZM7WV.js} +1 -1
  282. package/dist/chunks/{store-work-evidence-VSLLZ6UF.js → store-work-evidence-77B36LRC.js} +1 -1
  283. package/dist/chunks/taskset-7FQCJ55X.js +2 -0
  284. package/dist/chunks/taskset-packages-NRRPON7B.js +2 -0
  285. package/dist/chunks/taskset-packages-RW4SFGDU.js +2 -0
  286. package/dist/chunks/{teams-bot-UTQAJA6H.js → teams-bot-D3LWA4S5.js} +1 -1
  287. package/dist/chunks/tool-learning-NGO7QHYK.js +2 -0
  288. package/dist/chunks/training-XFM3OOPN.js +2 -0
  289. package/dist/chunks/training-XILDD5RG.js +2 -0
  290. package/dist/chunks/training-error-LQKCOQDJ.js +2 -0
  291. package/dist/chunks/training-hardware-ESXRWUIK.js +3 -0
  292. package/dist/chunks/training-hosted-6BX2IASC.js +2 -0
  293. package/dist/chunks/training-hosted-checkpoint-evaluation-UXFW33QL.js +2 -0
  294. package/dist/chunks/training-hosted-learning-YN5VD3PW.js +2 -0
  295. package/dist/chunks/training-hosted-serving-N2MHWGZN.js +2 -0
  296. package/dist/chunks/training-hosted-serving-report-J4YOZLRP.js +2 -0
  297. package/dist/chunks/training-hosted-workers-6JTDCCWA.js +2 -0
  298. package/dist/chunks/training-model-start-E5MP3URL.js +2 -0
  299. package/dist/chunks/web-search-56QRZGPR.js +2 -0
  300. package/dist/chunks/workspaces-MCS2AQX6.js +2 -0
  301. package/dist/cli.js +1 -1
  302. package/dist/index.js +1 -1
  303. package/dist/sandbox-template/manifest.js +1 -1
  304. package/dist/skills/manifest.json +1 -1
  305. package/dist/web/assets/App-BZuSv1XM.js +53 -0
  306. package/dist/web/assets/{AppDialog-8Y0FYalT.js → AppDialog-BILEK4np.js} +1 -1
  307. package/dist/web/assets/AppTerminalPanel-BvxZ8bwD.js +2 -0
  308. package/dist/web/assets/{AppToastContext-BiQbbVxq.js → AppToastContext-C-FsCKXW.js} +1 -1
  309. package/dist/web/assets/{AppsView-Dtte4h6e.js → AppsView-BMaq5oxx.js} +1 -1
  310. package/dist/web/assets/{AttachmentTypeIcon-DgADV7dn.js → AttachmentTypeIcon-Bh7Ft_UL.js} +1 -1
  311. package/dist/web/assets/{BrowserSidebar-BUqDvEv9.js → BrowserSidebar-BG2MLJ9I.js} +1 -1
  312. package/dist/web/assets/{CartesianChart-J4ChOjvG.js → CartesianChart-CS6ES_XT.js} +1 -1
  313. package/dist/web/assets/ChatTimelineEntry-Dr5X_XyN.js +8 -0
  314. package/dist/web/assets/{ChatTimelineEntry-DztFb85D.css → ChatTimelineEntry-vs8RaEGD.css} +1 -1
  315. package/dist/web/assets/{CollaborationTabs-CFCpk2Ck.js → CollaborationTabs-CPJ2w67F.js} +1 -1
  316. package/dist/web/assets/{CommandMenu-EPPjB14H.js → CommandMenu-Fe1V7NJd.js} +1 -1
  317. package/dist/web/assets/{CommunityView-Okydjpqm.js → CommunityView-DHTcmOnI.js} +1 -1
  318. package/dist/web/assets/{ComposerAttachments-RXCiE88M.js → ComposerAttachments-Ck9VWD6o.js} +1 -1
  319. package/dist/web/assets/{ComposerCreateImproveStrip-CSngc8-V.js → ComposerCreateImproveStrip-yiXO7cf8.js} +1 -1
  320. package/dist/web/assets/{ConversationImportsSettings-DS73kyfj.js → ConversationImportsSettings-_VLzUnHQ.js} +1 -1
  321. package/dist/web/assets/{FilePagePreview-Qc4B0vue.js → FilePagePreview-BpcM1DfE.js} +2 -2
  322. package/dist/web/assets/{GetStartedView-DGFPQ1We.js → GetStartedView-BH-WJ-rW.js} +1 -1
  323. package/dist/web/assets/{GettingStartedDialog-DFBYQdHz.js → GettingStartedDialog-CdQfj7RA.js} +1 -1
  324. package/dist/web/assets/{HostedModelLearningReview-BDu3FlcU.js → HostedModelLearningReview-C3GsOlu9.js} +1 -1
  325. package/dist/web/assets/{HostedModelLearningSettings-CHaTHwC8.js → HostedModelLearningSettings-SSMst6dl.js} +1 -1
  326. package/dist/web/assets/{HtmlVisual-D9Mh7xds.js → HtmlVisual-CH0tb3fv.js} +1 -1
  327. package/dist/web/assets/{LabModelVersionDetailPage-DgY7lAu5.js → LabModelVersionDetailPage-J2t9yILv.js} +1 -1
  328. package/dist/web/assets/{LabSkillSidebar-BwtlThO7.js → LabSkillSidebar-DdDYvfj2.js} +1 -1
  329. package/dist/web/assets/LabsRoute-MJwIjSKg.js +101 -0
  330. package/dist/web/assets/MainChatThread-BcwtaTDZ.js +2 -0
  331. package/dist/web/assets/MainPane-DDO6diPt.js +10 -0
  332. package/dist/web/assets/NativeSetupTerminal-BPSUFpRm.js +2 -0
  333. package/dist/web/assets/{NativeSkillSidebar-BEJvt5_H.js → NativeSkillSidebar-DPYavzau.js} +1 -1
  334. package/dist/web/assets/{NewProjectDialog-CjrjgkTN.js → NewProjectDialog-BtmvE9Sp.js} +1 -1
  335. package/dist/web/assets/{OutputsPage-jzx93QQ3.js → OutputsPage-BMRY7RK2.js} +1 -1
  336. package/dist/web/assets/{PageChrome-C1M13qG2.js → PageChrome-5VRxH6Rp.js} +1 -1
  337. package/dist/web/assets/{ProjectsPage-DZrjlMp2.js → ProjectsPage-1LHqxOMo.js} +1 -1
  338. package/dist/web/assets/RightChatPanelStack-D_7KgExz.js +1 -0
  339. package/dist/web/assets/RightSidebarHomePanel-iznJwDMf.js +1 -0
  340. package/dist/web/assets/{ScheduledWorkPage-Cw1ja2GF.js → ScheduledWorkPage-Dtz4zJ0T.js} +1 -1
  341. package/dist/web/assets/{SettingsView-CckoIki3.js → SettingsView-BeDYNPcD.js} +3 -3
  342. package/dist/web/assets/{TasksetDraftEditorPrimitives-ByC8bDjp.js → TasksetDraftEditorPrimitives-CcvKO3YA.js} +1 -1
  343. package/dist/web/assets/{TeamChatView-OprnSKLF.js → TeamChatView-DaXxOkTe.js} +1 -1
  344. package/dist/web/assets/{TerminalOverlay-d7A2F9Lx.js → TerminalOverlay-CF8uB4qA.js} +1 -1
  345. package/dist/web/assets/{TrainingCreationPanel-Cyn6R6I6.js → TrainingCreationPanel-DmMO7x5T.js} +1 -1
  346. package/dist/web/assets/{TrainingDraftPanel-Mpb5e7t5.js → TrainingDraftPanel-DCHbXjSx.js} +1 -1
  347. package/dist/web/assets/{TrainingRunLineage-VcKz7dIR.js → TrainingRunLineage-CwisTWs_.js} +1 -1
  348. package/dist/web/assets/UsageSettingsSection-Drt7gwRb.js +7 -0
  349. package/dist/web/assets/WorkSidebarPanel-BrIIRtGW.js +1 -0
  350. package/dist/web/assets/WorkspaceDiffPanel-Dmbrg0-y.js +11 -0
  351. package/dist/web/assets/{WorkspaceEnvironmentMenu-C8y3537a.js → WorkspaceEnvironmentMenu-KEZm1gdb.js} +1 -1
  352. package/dist/web/assets/{WorkspaceFileLocation-LrEWj4UK.js → WorkspaceFileLocation-ChbOKrPO.js} +1 -1
  353. package/dist/web/assets/{WorkspaceGitDialogs-NRIMXnkS.js → WorkspaceGitDialogs-BS2JQKNQ.js} +1 -1
  354. package/dist/web/assets/{WorkspaceMonacoEditor-CvDGjKAL.js → WorkspaceMonacoEditor-CN1hE_C4.js} +3 -3
  355. package/dist/web/assets/{WorkspacePdfPreview-BZ0BbnHv.js → WorkspacePdfPreview-Clb4m0le.js} +2 -2
  356. package/dist/web/assets/{WorkspacePresentationPreview-DJrjrvT0.js → WorkspacePresentationPreview-CwQsdvAR.js} +1 -1
  357. package/dist/web/assets/app-models-Cz3yxq4x.js +1 -0
  358. package/dist/web/assets/{bot-6OhUEmkE.js → bot-BNFltD5O.js} +1 -1
  359. package/dist/web/assets/chat-resources-CTN4f6KC.js +1 -0
  360. package/dist/web/assets/{chevron-down-jmVA1BIf.js → chevron-down-BnnT0tnM.js} +1 -1
  361. package/dist/web/assets/chevron-right-C8K5PZj7.js +1 -0
  362. package/dist/web/assets/{chevron-up-CstyLXH3.js → chevron-up-BAnwJJN3.js} +1 -1
  363. package/dist/web/assets/chunk-GJRXJL6G-pJp1DyJd.js +9 -0
  364. package/dist/web/assets/chunk-TLSP5JKG-DZmxtX-4.js +1 -0
  365. package/dist/web/assets/{client-choice-storage-BdQ_YDuk.js → client-choice-storage-Iuzoszas.js} +1 -1
  366. package/dist/web/assets/{cloud-upload-Ck1ufAr8.js → cloud-upload-CdSXJ7ms.js} +1 -1
  367. package/dist/web/assets/{copy-CPkbMfXt.js → copy-CBFg6m0d.js} +1 -1
  368. package/dist/web/assets/{createLucideIcon-CXQny8HU.js → createLucideIcon-DF2VR6WA.js} +1 -1
  369. package/dist/web/assets/{cssMode-CYxYl_om.js → cssMode-BSQUZhUO.js} +1 -1
  370. package/dist/web/assets/{external-link-CDKOLG_v.js → external-link-Cql9bKdv.js} +1 -1
  371. package/dist/web/assets/{folder-open-CEtOb_lK.js → folder-open-BXdVB5J1.js} +1 -1
  372. package/dist/web/assets/{folder-plus-CVMYZs3e.js → folder-plus-Cma2HulC.js} +1 -1
  373. package/dist/web/assets/{git-commit-horizontal-DDyhPjxS.js → git-commit-horizontal-eF--16ps.js} +1 -1
  374. package/dist/web/assets/{htmlMode-DoY4V_j0.js → htmlMode-aLPlQtyU.js} +1 -1
  375. package/dist/web/assets/icons-c3vt7y6n.js +1 -0
  376. package/dist/web/assets/{image-B-PjDSwU.js → image-CqKPwnBn.js} +1 -1
  377. package/dist/web/assets/{index-D9WbJMSq.js → index-CM0IRu1U.js} +2 -2
  378. package/dist/web/assets/{info-CCnw-K3b.js → info-CqeYEqG0.js} +1 -1
  379. package/dist/web/assets/{jsonMode-CeOpZdPj.js → jsonMode-fu7bEcHB.js} +1 -1
  380. package/dist/web/assets/loader-circle-pxp89T5x.js +1 -0
  381. package/dist/web/assets/{lspLanguageFeatures-DAbgLCqZ.js → lspLanguageFeatures-DraXQA4w.js} +1 -1
  382. package/dist/web/assets/{maximize-2-BZX38cpr.js → maximize-2-yMp8X9ts.js} +1 -1
  383. package/dist/web/assets/{message-square-CvgSecgD.js → message-square-DbIMQqfj.js} +1 -1
  384. package/dist/web/assets/model-display-zPvC4L2B.js +1 -0
  385. package/dist/web/assets/models-route-CWcJuOd0.js +1 -0
  386. package/dist/web/assets/{monaco.contribution-cbDqt48m.js → monaco.contribution-BQhp1CJs.js} +2 -2
  387. package/dist/web/assets/{monaco.contribution-CF2JDhi4.js → monaco.contribution-Bd8EqYGR.js} +2 -2
  388. package/dist/web/assets/{monaco.contribution-m2ze2EsL.js → monaco.contribution-CYWKnVxQ.js} +2 -2
  389. package/dist/web/assets/{monaco.contribution-yeyow_-Q.js → monaco.contribution-CmbWO0tB.js} +2 -2
  390. package/dist/web/assets/{monitor-By0s4hxb.js → monitor-DFE2fTkT.js} +1 -1
  391. package/dist/web/assets/{paperclip-BJ2QgJLa.js → paperclip-D_qsKbVs.js} +1 -1
  392. package/dist/web/assets/{pdf-C4x-1jjP.js → pdf-DkQRsi4n.js} +1 -1
  393. package/dist/web/assets/play-BtlX2stU.js +1 -0
  394. package/dist/web/assets/plus-DbASL_gy.js +1 -0
  395. package/dist/web/assets/{presentation-I86G1Gd9.js → presentation-BN_kIBPL.js} +1 -1
  396. package/dist/web/assets/{python-CqFTPj8r.js → python-DB9pj5Hr.js} +1 -1
  397. package/dist/web/assets/{refresh-cw-Dga35Eay.js → refresh-cw-B27ohHfn.js} +1 -1
  398. package/dist/web/assets/{save-BLKjYtzR.js → save-D-rwjKop.js} +1 -1
  399. package/dist/web/assets/settings-lists-DgSaJQA4.js +5 -0
  400. package/dist/web/assets/square-C2caJ3NG.js +1 -0
  401. package/dist/web/assets/{square-terminal-B-n7vUex.js → square-terminal-CeoK51wH.js} +1 -1
  402. package/dist/web/assets/{submit-issue-command-B7Hrt2tU.js → submit-issue-command-DZNW7Evj.js} +1 -1
  403. package/dist/web/assets/{toggleHighContrast-BhmBE5XE.js → toggleHighContrast-Bs8L1gx0.js} +1 -1
  404. package/dist/web/assets/{training-QrdkRQZQ.js → training-DCdoHJ0Y.js} +2 -2
  405. package/dist/web/assets/{training-model-data-DB-jg6L_.js → training-model-data-wHvE7xL1.js} +1 -1
  406. package/dist/web/assets/{tsMode-BSWEII2p.js → tsMode-C7EqshxC.js} +1 -1
  407. package/dist/web/assets/{upload-C4MPhQn8.js → upload-BWgjC2Jf.js} +1 -1
  408. package/dist/web/assets/{useAccountSettings-9oqWdRLs.js → useAccountSettings-Dva1MpsJ.js} +1 -1
  409. package/dist/web/assets/{useAgentInventory-isO79ui9.js → useAgentInventory-CrjIOmvb.js} +1 -1
  410. package/dist/web/assets/{useLocalAgentSchedules-CZX6PxoK.js → useLocalAgentSchedules-P-UaUKMb.js} +1 -1
  411. package/dist/web/assets/{useQuery-BD0Uexmh.js → useQuery-Bn3KqR4r.js} +1 -1
  412. package/dist/web/assets/{wifi-off-Cloe0WuQ.js → wifi-off--mKrSPFc.js} +1 -1
  413. package/dist/web/assets/{workers-BXagz5eg.js → workers-p0Kn2KMK.js} +1 -1
  414. package/dist/web/assets/x-D9GTV9ke.js +1 -0
  415. package/dist/web/assets/{yaml-sBdvVbCc.js → yaml-BeIdC4tu.js} +1 -1
  416. package/dist/web/index.html +1 -1
  417. package/docs/command-reference.md +44 -2
  418. package/package.json +1 -1
  419. package/dist/chunks/acp-H3MJCPHX.js +0 -2
  420. package/dist/chunks/acp-agent-DWA7272M.js +0 -21
  421. package/dist/chunks/actions-command-IIYOO4LL.js +0 -2
  422. package/dist/chunks/app-layer-K7H2WJ56.js +0 -3
  423. package/dist/chunks/app-server-connected-apps-RM5E2VWF.js +0 -2
  424. package/dist/chunks/app-server-evaluations-XGMGS67X.js +0 -2
  425. package/dist/chunks/app-server-harness-services-BHD6S5II.js +0 -2
  426. package/dist/chunks/app-server-runtime-LFIL6F7D.js +0 -2
  427. package/dist/chunks/apps-QKAHJGQ4.js +0 -2
  428. package/dist/chunks/chunk-5EP2DZLJ.js +0 -2
  429. package/dist/chunks/chunk-6EBCS57F.js +0 -2
  430. package/dist/chunks/chunk-6RS4NAOY.js +0 -2
  431. package/dist/chunks/chunk-7O6Z3VOZ.js +0 -2
  432. package/dist/chunks/chunk-7YLXGILH.js +0 -2
  433. package/dist/chunks/chunk-7ZLXFKRI.js +0 -2
  434. package/dist/chunks/chunk-B5R53U74.js +0 -2
  435. package/dist/chunks/chunk-C2AXMKK4.js +0 -2
  436. package/dist/chunks/chunk-F6UQ6PPK.js +0 -2
  437. package/dist/chunks/chunk-GS6ZUSIN.js +0 -3
  438. package/dist/chunks/chunk-JSQRLLN6.js +0 -2
  439. package/dist/chunks/chunk-LAOLJDVB.js +0 -2
  440. package/dist/chunks/chunk-LKKMLBOH.js +0 -3
  441. package/dist/chunks/chunk-M3FLEZ4E.js +0 -4
  442. package/dist/chunks/chunk-MEGKXGW3.js +0 -2
  443. package/dist/chunks/chunk-MILEWROZ.js +0 -2
  444. package/dist/chunks/chunk-N42HT64M.js +0 -2
  445. package/dist/chunks/chunk-NG2L6D7G.js +0 -2
  446. package/dist/chunks/chunk-OSVGNONV.js +0 -2
  447. package/dist/chunks/chunk-OTUBJV6C.js +0 -6
  448. package/dist/chunks/chunk-PBTXLQAU.js +0 -2
  449. package/dist/chunks/chunk-PBZCXPPC.js +0 -10
  450. package/dist/chunks/chunk-SFKZITAG.js +0 -9
  451. package/dist/chunks/chunk-SXMR6E2W.js +0 -2
  452. package/dist/chunks/chunk-U2K7QJCG.js +0 -2
  453. package/dist/chunks/chunk-URNMC46H.js +0 -157
  454. package/dist/chunks/chunk-VHXDWAEH.js +0 -2
  455. package/dist/chunks/chunk-W2TICQ62.js +0 -2
  456. package/dist/chunks/chunk-WSOUMXH3.js +0 -24
  457. package/dist/chunks/chunk-XOB6FKQV.js +0 -2
  458. package/dist/chunks/chunk-YBNKGA5C.js +0 -2
  459. package/dist/chunks/chunk-YM4PSVFW.js +0 -4
  460. package/dist/chunks/chunk-YNQWJWIC.js +0 -10
  461. package/dist/chunks/chunk-Z3BWCFLV.js +0 -2
  462. package/dist/chunks/cli-PSXMIJTF.js +0 -2
  463. package/dist/chunks/configuration-command-XYKMXIWF.js +0 -2
  464. package/dist/chunks/connected-app-executor-6G2LA3PQ.js +0 -2
  465. package/dist/chunks/connected-evidence-IRXYN6YD.js +0 -2
  466. package/dist/chunks/connection-XMAAGMXJ.js +0 -2
  467. package/dist/chunks/core-commands-WWN7X3XC.js +0 -2
  468. package/dist/chunks/dataset-preparation-authoring-F3OZIQSP.js +0 -4
  469. package/dist/chunks/datasets-2PC2HP7N.js +0 -2
  470. package/dist/chunks/desktop-test-VU6AFAMO.js +0 -3
  471. package/dist/chunks/dist-47AYOIH6.js +0 -2
  472. package/dist/chunks/dist-HSC43RG4.js +0 -2
  473. package/dist/chunks/dist-MXBEBM4D.js +0 -2
  474. package/dist/chunks/enclave-VURYNILU.js +0 -2
  475. package/dist/chunks/evaluation-coordination-UOWZHHC5.js +0 -2
  476. package/dist/chunks/experiment-improvements-EB2CV5RA.js +0 -2
  477. package/dist/chunks/experiments-CLXGM3TZ.js +0 -2
  478. package/dist/chunks/experiments-SZQYR6MH.js +0 -2
  479. package/dist/chunks/experiments-signal-2KJCP25D.js +0 -2
  480. package/dist/chunks/host-profile-evaluation-tools-Y2LQ4WQN.js +0 -2
  481. package/dist/chunks/host-profile-external-dataset-FRIGXOO7.js +0 -2
  482. package/dist/chunks/hosted-app-server-composition-PGKQNDW6.js +0 -2
  483. package/dist/chunks/hosted-experiment-improvement-UXC542SZ.js +0 -3
  484. package/dist/chunks/hosted-harness-runtime-6PEI7F2U.js +0 -2
  485. package/dist/chunks/hosted-profile-candidate-HM44BIUX.js +0 -3
  486. package/dist/chunks/hosted-profile-compiler-UAZ4PHYE.js +0 -2
  487. package/dist/chunks/hosted-profile-evaluation-control-EUL57FAB.js +0 -2
  488. package/dist/chunks/hosted-profile-evaluation-inspection-7USY75Z4.js +0 -3
  489. package/dist/chunks/hosted-profile-evaluation-preparation-2LSMZQNA.js +0 -3
  490. package/dist/chunks/hosted-tasksets-WGXGXJ7E.js +0 -2
  491. package/dist/chunks/human-review-M26UKGJL.js +0 -2
  492. package/dist/chunks/learning-HM3NWOV5.js +0 -2
  493. package/dist/chunks/local-harness-improvement-runtime-QGWFWNSR.js +0 -2
  494. package/dist/chunks/local-harness-taskset-review-KS4WPMN6.js +0 -2
  495. package/dist/chunks/local-scope-62GWHDXS.js +0 -2
  496. package/dist/chunks/model-projects-YUAMBQTO.js +0 -2
  497. package/dist/chunks/opchat-AG4CWVY4.js +0 -3
  498. package/dist/chunks/opchat-bounded-chat-IQMP5IIO.js +0 -2
  499. package/dist/chunks/organizations-KDKX77XZ.js +0 -2
  500. package/dist/chunks/profile-training-source-3DXFM2XI.js +0 -2
  501. package/dist/chunks/project-action-payload-QA24HYGF.js +0 -2
  502. package/dist/chunks/project-agent-XBOOM5TS.js +0 -2
  503. package/dist/chunks/published-experiment-source-GZGN354O.js +0 -2
  504. package/dist/chunks/refiner-profile-service-BJMOYKTC.js +0 -2
  505. package/dist/chunks/sandbox-command-5ECGS7DG.js +0 -2
  506. package/dist/chunks/saved-work-KUNVTJ7O.js +0 -2
  507. package/dist/chunks/send-turn-FIPWOXWV.js +0 -2
  508. package/dist/chunks/standalone-experiment-turn-owner-XIE46VNH.js +0 -2
  509. package/dist/chunks/store-chat-resources-YOEJ2BI6.js +0 -2
  510. package/dist/chunks/store-conversation-serving-K324SQTO.js +0 -2
  511. package/dist/chunks/store-evaluation-results-LHCCNNE6.js +0 -7
  512. package/dist/chunks/store-harness-workspaces-ZHNCNWVI.js +0 -2
  513. package/dist/chunks/store-human-review-QJY3ZPPF.js +0 -7
  514. package/dist/chunks/store-learned-preference-migration-validation-X32SRBOM.js +0 -2
  515. package/dist/chunks/store-learning-DW3QLQXU.js +0 -2
  516. package/dist/chunks/store-learning-credentials-67QNTPA7.js +0 -2
  517. package/dist/chunks/store-model-batch-review-PBYQZJJJ.js +0 -2
  518. package/dist/chunks/store-model-project-preparation-TFCG2F2F.js +0 -2
  519. package/dist/chunks/store-taskset-drafts-GXABQR5G.js +0 -9
  520. package/dist/chunks/taskset-ARKJQKYQ.js +0 -2
  521. package/dist/chunks/taskset-packages-X4K65DTW.js +0 -2
  522. package/dist/chunks/taskset-packages-XK7FSD45.js +0 -2
  523. package/dist/chunks/training-3IWW4256.js +0 -2
  524. package/dist/chunks/training-RVIESURJ.js +0 -2
  525. package/dist/chunks/training-error-2EWDOQ4G.js +0 -2
  526. package/dist/chunks/training-hosted-PFJHYTEU.js +0 -2
  527. package/dist/chunks/training-hosted-checkpoint-evaluation-JJPP7KFW.js +0 -2
  528. package/dist/chunks/training-hosted-learning-Y7NHRY4V.js +0 -2
  529. package/dist/chunks/training-hosted-serving-QAV7ZGGV.js +0 -2
  530. package/dist/chunks/training-hosted-serving-report-OX4A5OKB.js +0 -2
  531. package/dist/chunks/training-hosted-workers-LST4ZUXN.js +0 -2
  532. package/dist/chunks/training-model-start-ROLS3E4V.js +0 -2
  533. package/dist/chunks/web-search-7FBUBZ66.js +0 -2
  534. package/dist/chunks/workspaces-G3CMY7ZA.js +0 -2
  535. package/dist/web/assets/App-DY2R8Z6r.js +0 -53
  536. package/dist/web/assets/AppTerminalPanel-YcnBD5DF.js +0 -2
  537. package/dist/web/assets/ChatTimelineEntry-DC93wlDa.js +0 -8
  538. package/dist/web/assets/LabsRoute-BV7ZJGEw.js +0 -101
  539. package/dist/web/assets/MainChatThread-pzHKd_YN.js +0 -2
  540. package/dist/web/assets/MainPane-6OlLiKKb.js +0 -10
  541. package/dist/web/assets/NativeSetupTerminal-CPDChcMi.js +0 -2
  542. package/dist/web/assets/RightChatPanelStack-BsxJg9sy.js +0 -1
  543. package/dist/web/assets/RightSidebarHomePanel-CCVQ9LMB.js +0 -1
  544. package/dist/web/assets/UsageSettingsSection-FhYymrfc.js +0 -7
  545. package/dist/web/assets/WorkSidebarPanel-u87uptH0.js +0 -1
  546. package/dist/web/assets/WorkspaceDiffPanel-B5rlW7bA.js +0 -11
  547. package/dist/web/assets/app-models-CUA9XB9U.js +0 -1
  548. package/dist/web/assets/chat-resources-CI8KFVO5.js +0 -1
  549. package/dist/web/assets/chevron-right-BYmDQ7ti.js +0 -1
  550. package/dist/web/assets/chunk-ONGOAEY6-C__DQmRT.js +0 -9
  551. package/dist/web/assets/chunk-SQBYHWZU-DumrB9SB.js +0 -1
  552. package/dist/web/assets/icons-D7jkCa2d.js +0 -1
  553. package/dist/web/assets/loader-circle-CPaJeTDy.js +0 -1
  554. package/dist/web/assets/models-route-Bl_TmMl6.js +0 -1
  555. package/dist/web/assets/play-D_SuGDBM.js +0 -1
  556. package/dist/web/assets/plus-yw95Iaj8.js +0 -1
  557. package/dist/web/assets/settings-lists-DMKA1lCN.js +0 -5
  558. package/dist/web/assets/square-BY5lG2Ol.js +0 -1
  559. package/dist/web/assets/x-Dqpel42h.js +0 -1
  560. /package/dist/chunks/{chunk-IDOGNIMV.js → chunk-7J2NMUTK.js} +0 -0
  561. /package/dist/chunks/{chunk-PCB65K4G.js → chunk-SFR32TMJ.js} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as Ne,d as qe,e as De}from"./chunk-FVRII5XO.js";import{a as te}from"./chunk-XOB6FKQV.js";import{b as xe,c as Ee,h as Ue}from"./chunk-2V4LPUBH.js";import{b as ee}from"./chunk-RFMME46Z.js";import{Z as b,ba as Me}from"./chunk-XNOMIWEY.js";import{j as Ae,p as Oe,r as _e,s as He}from"./chunk-WWQNMC7C.js";import{a as Q,b as ke,h as Ce}from"./chunk-LKKMLBOH.js";import{Lb as H,Pb as W,Qb as Pe,a as $,w as F,x as N}from"./chunk-M3FLEZ4E.js";import{h as _,i as Te}from"./chunk-PWK5Z5S3.js";import{X as he,Y as ve,_ as Z,b as le,ba as we,c as ue,ea as be,fa as V,ja as Se,la as ye,ma as Re,p as ce,r as pe,s as de,t as me,u as ge,w as fe}from"./chunk-2EPR4HLF.js";import{z as M}from"./chunk-BKEDG3A4.js";import{c as ie,d as B,f as ae,h as U}from"./chunk-UGOK7VTC.js";import{v as Ie}from"./chunk-NJLULBTM.js";import{A as o}from"./chunk-PF56N7ZY.js";import{a as l}from"./chunk-FTQLQJQV.js";import{promises as ne}from"node:fs";import mt from"node:os";import gt from"node:path";import{createServer as ft}from"node:http";import{randomBytes as ht}from"node:crypto";var it=o.discriminatedUnion("op",[o.strictObject({op:o.literal("set"),path:o.array(o.string().min(1)).min(1),value:o.unknown()}),o.strictObject({op:o.literal("unset"),path:o.array(o.string().min(1)).min(1)})]),at=o.discriminatedUnion("action",[o.strictObject({action:o.literal("patch"),expectedRevision:o.string(),operations:o.array(it).max(100)}),o.strictObject({action:o.literal("replace"),expectedRevision:o.string(),text:o.string().max(1048576)}),o.strictObject({action:o.literal("validate"),text:o.string().max(1048576)}),o.strictObject({action:o.literal("restore"),expectedRevision:o.string(),revision:o.string()}),o.strictObject({action:o.literal("trust"),root:o.string(),accountId:o.string(),trusted:o.boolean()}),o.strictObject({action:o.literal("client-state"),owner:o.string(),patch:Se,importOnly:o.boolean().optional()})]);function Be(n,e){let t=null;async function r(i,a){let c=U(n).config,p=null,u=null,m=null;try{p=await ue(c),m=await V(n,{projectRoot:i,accountId:a}),i||(t=m)}catch(I){u=B(I,c)}let w=m??(i?null:t);return{path:c,text:p,rawRevision:le(p),issue:u,effective:w,usingLastValid:!m&&!!w,applies:"next_turn",recoverableRevisions:await pe(n),clientState:u?null:await ye(n)}}l(r,"status");async function s(i){let a=at.parse(i);if(a.action==="validate")return{valid:!0,document:ce(a.text,U(n).config)};if(a.action==="client-state")return Re(n,a.owner,a.patch,a.importOnly);let c=l(async()=>{a.action==="patch"&&await fe(n,a.expectedRevision,a.operations),a.action==="replace"&&await de(n,a.expectedRevision,a.text),a.action==="restore"&&await me(n,a.revision,a.expectedRevision),a.action==="trust"&&await be(n,a.root,a.accountId,a.trusted)},"mutation");return e?await e(c):await c(),r()}return l(s,"mutate"),{status:r,mutate:s,schema:ge}}l(Be,"createConfigurationPayloads");import{Buffer as Fe}from"node:buffer";var G={"Access-Control-Allow-Headers":"authorization, content-type, x-openpond-team-id, idempotency-key","Access-Control-Allow-Methods":"GET, POST, PUT, PATCH, DELETE, OPTIONS"},lt=25*1024*1024,j=class extends Error{constructor(t,r,s){super(s);this.status=t;this.code=r;this.name="HttpBodyError"}status;code;static{l(this,"HttpBodyError")}};function Le(n,e,t={}){for(let[s,i]of Object.entries(G))e.setHeader(s,i);let r=$e(n.headers.origin);return r?(e.setHeader("Vary",dt(e.getHeader("Vary"))),ut(r,t)?(e.setHeader("Access-Control-Allow-Origin",r),{allowed:!0,origin:r}):{allowed:!1,origin:r}):{allowed:!0,origin:null}}l(Le,"applyCorsHeaders");function ut(n,e={}){if(n==="null")return!0;let t=je(n);return t?pt(t)?!0:new Set((e.allowedOrigins??[]).map(s=>s?je(s):null).filter(s=>!!s)).has(t):!1}l(ut,"isAllowedCorsOrigin");function x(n,e,t){n.writeHead(e,{"Content-Type":"application/json",...G}),n.end(JSON.stringify(t))}l(x,"sendJson");function Yt(n,e,t){n.writeHead(e,{"Content-Type":"text/plain; charset=utf-8",...G}),n.end(t)}l(Yt,"sendText");function Xt(n,e,t,r){n.writeHead(e,{"Content-Type":r,"Content-Length":String(t.byteLength),"Cache-Control":"no-store","X-Content-Type-Options":"nosniff",...G}),n.end(t)}l(Xt,"sendBinary");async function re(n,e={}){let t=e.maxBytes??lt,r=$e(n.headers["content-type"]),s=[],i=0;for await(let c of n){let p=Fe.from(c);if(i+=p.byteLength,i>t)throw new j(413,"request_body_too_large",`JSON request body exceeds ${t} bytes.`);s.push(p)}let a=Fe.concat(s).toString("utf8").trim();if(!a)return{};if(!ct(r))throw new j(415,"unsupported_media_type","JSON request body requires Content-Type: application/json.");try{return JSON.parse(a)}catch{throw new j(400,"invalid_json","Request body is not valid JSON.")}}l(re,"readJson");function Ve(n,e,t){let r=n.headers.authorization;return(typeof r=="string"&&r.startsWith("Bearer ")?r.slice(7):null)===t}l(Ve,"hasAuth");function $e(n){return Array.isArray(n)?n[0]??null:n??null}l($e,"headerValue");function ct(n){if(!n)return!1;let e=n.split(";")[0]?.trim().toLowerCase();return e==="application/json"||!!e?.endsWith("+json")}l(ct,"isJsonContentType");function je(n){try{let e=new URL(n);return e.protocol!=="http:"&&e.protocol!=="https:"?null:e.origin}catch{return null}}l(je,"normalizeOrigin");function pt(n){let e=new URL(n);return e.hostname==="localhost"||e.hostname==="127.0.0.1"||e.hostname==="::1"||e.hostname==="[::1]"}l(pt,"isLoopbackOrigin");function dt(n){let t=(Array.isArray(n)?n.join(", "):n?String(n):"").split(",").map(r=>r.trim()).filter(Boolean);return t.some(r=>r.toLowerCase()==="origin")||t.push("Origin"),t.join(", ")}l(dt,"appendVaryOrigin");function We(n){return`<!doctype html><html lang="en"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>OpenPond recovery</title>
2
+ import{a as Ne,d as qe,e as De}from"./chunk-U2BD545L.js";import{a as te}from"./chunk-UK5LGSGT.js";import{b as Ee,c as ke,h as Ue}from"./chunk-HPTEJBP4.js";import{b as ee}from"./chunk-PYNW5OFA.js";import{Z as b,ba as Me}from"./chunk-6I5AUTVO.js";import{j as Ae,p as Oe,r as _e,s as He}from"./chunk-MCBRB5D6.js";import{e as Ce}from"./chunk-BJXPQIVD.js";import{Mb as H,Qb as W,Rb as xe,a as $,w as F,x as N}from"./chunk-MVPKU72J.js";import{h as _,i as Pe}from"./chunk-6ESBAHWK.js";import{a as Q,b as Te}from"./chunk-O6ZYDHEJ.js";import{v as ie}from"./chunk-OTDDXEQ6.js";import{X as ve,Y as we,_ as Z,b as ue,ba as be,c as ce,ea as Se,fa as V,ja as ye,la as Re,ma as Ie,p as pe,r as de,s as me,t as ge,u as fe,w as he}from"./chunk-SH7POUVX.js";import{z as M}from"./chunk-2MEOUS24.js";import{A as o}from"./chunk-X2J2P5ZT.js";import{c as ae,d as B,f as le,h as U}from"./chunk-UGOK7VTC.js";import{a as l}from"./chunk-FTQLQJQV.js";import{promises as ne}from"node:fs";import mt from"node:os";import gt from"node:path";import{createServer as ft}from"node:http";import{randomBytes as ht}from"node:crypto";var it=o.discriminatedUnion("op",[o.strictObject({op:o.literal("set"),path:o.array(o.string().min(1)).min(1),value:o.unknown()}),o.strictObject({op:o.literal("unset"),path:o.array(o.string().min(1)).min(1)})]),at=o.discriminatedUnion("action",[o.strictObject({action:o.literal("patch"),expectedRevision:o.string(),operations:o.array(it).max(100)}),o.strictObject({action:o.literal("replace"),expectedRevision:o.string(),text:o.string().max(1048576)}),o.strictObject({action:o.literal("validate"),text:o.string().max(1048576)}),o.strictObject({action:o.literal("restore"),expectedRevision:o.string(),revision:o.string()}),o.strictObject({action:o.literal("trust"),root:o.string(),accountId:o.string(),trusted:o.boolean()}),o.strictObject({action:o.literal("client-state"),owner:o.string(),patch:ye,importOnly:o.boolean().optional()})]);function Be(n,e){let t=null;async function r(i,a){let c=U(n).config,p=null,u=null,m=null;try{p=await ce(c),m=await V(n,{projectRoot:i,accountId:a}),i||(t=m)}catch(I){u=B(I,c)}let w=m??(i?null:t);return{path:c,text:p,rawRevision:ue(p),issue:u,effective:w,usingLastValid:!m&&!!w,applies:"next_turn",recoverableRevisions:await de(n),clientState:u?null:await Re(n)}}l(r,"status");async function s(i){let a=at.parse(i);if(a.action==="validate")return{valid:!0,document:pe(a.text,U(n).config)};if(a.action==="client-state")return Ie(n,a.owner,a.patch,a.importOnly);let c=l(async()=>{a.action==="patch"&&await he(n,a.expectedRevision,a.operations),a.action==="replace"&&await me(n,a.expectedRevision,a.text),a.action==="restore"&&await ge(n,a.revision,a.expectedRevision),a.action==="trust"&&await Se(n,a.root,a.accountId,a.trusted)},"mutation");return e?await e(c):await c(),r()}return l(s,"mutate"),{status:r,mutate:s,schema:fe}}l(Be,"createConfigurationPayloads");import{Buffer as Fe}from"node:buffer";var G={"Access-Control-Allow-Headers":"authorization, content-type, x-openpond-team-id, idempotency-key","Access-Control-Allow-Methods":"GET, POST, PUT, PATCH, DELETE, OPTIONS"},lt=25*1024*1024,j=class extends Error{constructor(t,r,s){super(s);this.status=t;this.code=r;this.name="HttpBodyError"}status;code;static{l(this,"HttpBodyError")}};function Le(n,e,t={}){for(let[s,i]of Object.entries(G))e.setHeader(s,i);let r=$e(n.headers.origin);return r?(e.setHeader("Vary",dt(e.getHeader("Vary"))),ut(r,t)?(e.setHeader("Access-Control-Allow-Origin",r),{allowed:!0,origin:r}):{allowed:!1,origin:r}):{allowed:!0,origin:null}}l(Le,"applyCorsHeaders");function ut(n,e={}){if(n==="null")return!0;let t=je(n);return t?pt(t)?!0:new Set((e.allowedOrigins??[]).map(s=>s?je(s):null).filter(s=>!!s)).has(t):!1}l(ut,"isAllowedCorsOrigin");function x(n,e,t){n.writeHead(e,{"Content-Type":"application/json",...G}),n.end(JSON.stringify(t))}l(x,"sendJson");function Yt(n,e,t){n.writeHead(e,{"Content-Type":"text/plain; charset=utf-8",...G}),n.end(t)}l(Yt,"sendText");function Xt(n,e,t,r){n.writeHead(e,{"Content-Type":r,"Content-Length":String(t.byteLength),"Cache-Control":"no-store","X-Content-Type-Options":"nosniff",...G}),n.end(t)}l(Xt,"sendBinary");async function re(n,e={}){let t=e.maxBytes??lt,r=$e(n.headers["content-type"]),s=[],i=0;for await(let c of n){let p=Fe.from(c);if(i+=p.byteLength,i>t)throw new j(413,"request_body_too_large",`JSON request body exceeds ${t} bytes.`);s.push(p)}let a=Fe.concat(s).toString("utf8").trim();if(!a)return{};if(!ct(r))throw new j(415,"unsupported_media_type","JSON request body requires Content-Type: application/json.");try{return JSON.parse(a)}catch{throw new j(400,"invalid_json","Request body is not valid JSON.")}}l(re,"readJson");function Ve(n,e,t){let r=n.headers.authorization;return(typeof r=="string"&&r.startsWith("Bearer ")?r.slice(7):null)===t}l(Ve,"hasAuth");function $e(n){return Array.isArray(n)?n[0]??null:n??null}l($e,"headerValue");function ct(n){if(!n)return!1;let e=n.split(";")[0]?.trim().toLowerCase();return e==="application/json"||!!e?.endsWith("+json")}l(ct,"isJsonContentType");function je(n){try{let e=new URL(n);return e.protocol!=="http:"&&e.protocol!=="https:"?null:e.origin}catch{return null}}l(je,"normalizeOrigin");function pt(n){let e=new URL(n);return e.hostname==="localhost"||e.hostname==="127.0.0.1"||e.hostname==="::1"||e.hostname==="[::1]"}l(pt,"isLoopbackOrigin");function dt(n){let t=(Array.isArray(n)?n.join(", "):n?String(n):"").split(",").map(r=>r.trim()).filter(Boolean);return t.some(r=>r.toLowerCase()==="origin")||t.push("Origin"),t.join(", ")}l(dt,"appendVaryOrigin");function We(n){return`<!doctype html><html lang="en"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>OpenPond recovery</title>
3
3
  <style nonce="${n}">body{font:16px system-ui;background:#171819;color:#eee;max-width:850px;margin:6vh auto;padding:24px}textarea{box-sizing:border-box;width:100%;min-height:280px;background:#222;color:#eee;padding:14px;border:1px solid #777;border-radius:8px;font:14px monospace}button,input,select{font:inherit;margin:6px;padding:8px}pre{white-space:pre-wrap}code{overflow-wrap:anywhere}button{cursor:pointer}p{line-height:1.5}</style>
4
4
  <h1>OpenPond needs a storage repair</h1><p id="issue" role="alert">Loading recovery details\u2026</p><p><code id="file"></code></p>
5
5
  <p id="action"></p><p>Migration backups and the source installation remain available. Execution services are stopped while recovery is open.</p>
@@ -20,7 +20,7 @@ for(const [id,action] of [['preview','preview'],['migrate','migrate'],['restart'
20
20
  el('diagnostics').onclick=()=>{if(!state)return;const blob=new Blob([JSON.stringify({issue:state.issue,migration:state.migration,config:{path:state.config.path,rawRevision:state.config.rawRevision,issue:state.config.issue}},null,2)],{type:'application/json'});const a=document.createElement('a');a.href=URL.createObjectURL(blob);a.download='openpond-recovery-diagnostics.json';a.click();URL.revokeObjectURL(a.href)};
21
21
  el('retry').onclick=async()=>{try{await request('/v1/recovery',{action:'retry'});message('Starting OpenPond\u2026');const timer=setInterval(async()=>{try{const h=await(await fetch('/health')).json();if(!h.recovery){clearInterval(timer);const next=new URLSearchParams(location.hash.slice(1)).get('returnTo');if(next){const u=new URL(next);if(['localhost','127.0.0.1','[::1]'].includes(u.hostname)){location.replace(u.toString());return}}location.reload();}}catch{}},500)}catch(e){message(e)}};
22
22
  (async()=>{const params=new URLSearchParams(location.hash.slice(1));token=params.get('openpondToken')||'';if(!token&&window.openpond?.getConnection)token=(await window.openpond.getConnection()).token;if(!token){message('Open the authenticated recovery URL from the launcher.');return}await load()})().catch(message);
23
- </script></html>`}l(We,"startupRecoveryPage");var vt=o.strictObject({action:o.enum(["preview","migrate","restart","retry"]),sourceAppHome:o.string().optional(),sourceConfig:o.string().optional(),resolutions:he.optional()});function Ge(n){return n instanceof ie&&/^(PRIVATE_STORAGE_|UNSAFE_STORAGE_|INVALID_CONFIG|CONFIG_|MIGRATION_|SOURCE_CHANGED_|CREDENTIAL_|UNSUPPORTED_STORAGE_|INVALID_MIGRATION_|INVALID_ACCOUNT_|MISSING_INSTRUCTION_|INVALID_PROFILE_|DATABASE_RECOVERY_)/.test(n.issue.code)}l(Ge,"isRecoverableStartupError");async function Je(n,e,t){let r=/^(UNSUPPORTED_STORAGE_|INVALID_MIGRATION_|UNSAFE_STORAGE_|PRIVATE_STORAGE_)/.test(t.issue.code),s=r?await ne.mkdtemp(gt.join(mt.tmpdir(),"openpond-recovery-")):n;return xe(s,async()=>{let{token:i,tokenFile:a}=await Ue(s),c=Be(n),p=t.issue,u,m=new Promise(f=>{u=f}),w=ft((f,h)=>{(async()=>{let S=new URL(f.url??"/","http://127.0.0.1");if(!Le(f,h).allowed){x(h,403,{error:"Origin not allowed"});return}if(f.method==="OPTIONS"){x(h,204,{});return}if(f.method==="GET"&&S.pathname==="/health"){x(h,200,{ok:!0,server:"openpond-app-server",version:ke,recovery:!0});return}if(f.method==="GET"&&S.pathname==="/"){let v=ht(18).toString("base64");h.writeHead(200,{"Content-Type":"text/html; charset=utf-8","Cache-Control":"no-store","Content-Security-Policy":`default-src 'none'; script-src 'nonce-${v}'; style-src 'nonce-${v}'; connect-src 'self'; base-uri 'none'; frame-ancestors 'none'`}),h.end(We(v));return}if(!Ve(f,S,i)){x(h,401,{error:"Unauthorized"});return}let P=!r;if(f.method==="GET"&&S.pathname==="/v1/recovery"){x(h,200,{issue:p,configEditable:P,config:r?{path:U(n).config,text:null,rawRevision:"unavailable",issue:p,recoverableRevisions:[]}:await c.status(),migration:await ve(n).catch(v=>({issue:B(v,n)}))});return}if(f.method==="POST"&&S.pathname==="/v1/configuration"&&P){x(h,200,await c.mutate(await re(f)));return}if(f.method==="POST"&&S.pathname==="/v1/recovery"){let v=vt.parse(await re(f));if(r&&v.action!=="retry"&&v.action!=="preview")throw t;if(v.action==="restart"){x(h,200,await we(n));return}if(v.action==="preview"||v.action==="migrate"){x(h,200,await Z(n,{sourceAppHome:v.sourceAppHome,sourceConfig:v.sourceConfig,resolutions:v.resolutions,dryRun:v.action==="preview"}));return}await Z(n),await V(n),x(h,200,{ready:!0}),u();return}x(h,503,{error:`${p.message} ${p.action}`,issue:p,recovery:!0})})().catch(S=>{p=B(S,n),x(h,422,{error:`${p.message} ${p.action}`,issue:p})})});await new Promise((f,h)=>{w.once("error",h),w.listen(e,"127.0.0.1",()=>{w.off("error",h),f()})});let I=w.address().port,C=`http://127.0.0.1:${I}`;return await Ee(s,C,"startup-recovery"),{url:C,port:I,token:i,tokenFile:a,storePath:U(n).database,repaired:m,close:l(async()=>{w.closeIdleConnections(),await new Promise((f,h)=>w.close(S=>S?h(S):f())),r&&await ne.rm(s,{recursive:!0,force:!0})},"close")}}).catch(async i=>{throw r&&await ne.rm(s,{recursive:!0,force:!0}),i})}l(Je,"startRecoveryServer");import{createHash as Ut}from"node:crypto";import{createHash as wt,randomUUID as ze}from"node:crypto";var bt=o.object({updatedAt:o.string(),id:o.string().min(1)}).strict(),St=o.object({entries:o.array(_).max(200),nextBefore:bt.nullable()}).strict(),yt=o.object({run:_,replayed:o.boolean()}).strict(),J=class{constructor(e){this.client=e}client;static{l(this,"HostedCreateImproveStorage")}async getCreateImproveRun(e){let t=await this.client.request({contractVersion:b,requestId:ze(),operation:"create-improve/execute",params:{action:"get",runId:e}});return t===null?null:_.parse(t)}async listCreateImproveRuns(e={}){let t=Math.max(1,Math.min(1e3,Math.trunc(e.limit??250))),r=Array.isArray(e.state)?[...e.state]:e.state?[e.state]:[],s=[],i=null;for(;s.length<t;){let a=St.parse(await this.client.request({contractVersion:b,requestId:ze(),operation:"create-improve/execute",params:{action:"page",query:{profileId:e.profileId??null,targetKind:e.targetKind??null,targetId:e.targetId??null,state:r},before:i,limit:Math.min(50,t-s.length)}}));if(e.conversationId&&a.entries.some(c=>c.scope.conversationId!==e.conversationId))throw new Error("Hosted Create/Improve page crossed its conversation scope.");if(s.push(...a.entries),!a.nextBefore)break;if(a.entries.length===0||i&&(a.nextBefore.updatedAt>i.updatedAt||a.nextBefore.updatedAt===i.updatedAt&&a.nextBefore.id>=i.id))throw new Error("Hosted Create/Improve cursor did not advance.");i=a.nextBefore}return s}async upsertCreateImproveRun(e){let t=_.parse(e),r=`create-improve:${wt("sha256").update(JSON.stringify(t)).digest("hex")}`,s=await this.client.request({contractVersion:b,requestId:r,operation:"create-improve/execute",params:{action:"put",run:t}});return _.parse(o.object({run:o.unknown()}).strict().parse(s).run)}async mutateCreateImproveRun(e,t){let r=Te.parse(e),s=await this.getCreateImproveRun(r.runId);if(!s)throw new Error(`Create/Improve run not found: ${r.runId}`);if(s.appliedActionIds.includes(r.actionId))return{run:s,replayed:!0};if(s.revision!==r.expectedRevision)throw new Error(`Create/Improve run changed from revision ${r.expectedRevision} to ${s.revision}. Refresh and try again.`);let i=_.parse(t(s));if(i.id!==s.id||i.revision!==s.revision+1||!i.appliedActionIds.includes(r.actionId))throw new Error("Create/Improve mutation must preserve identity, advance one revision and record its action.");return yt.parse(await this.client.request({contractVersion:b,requestId:r.actionId,operation:"create-improve/execute",params:{action:"mutate",mutation:r,next:i}}))}};import{randomUUID as It}from"node:crypto";async function L(n,e){let t=n;for(;;)try{return await e(t)}catch(r){if(!Rt(r)||t<=1)throw r;t=Math.max(1,Math.floor(t/2))}}l(L,"hostedBoundedPage");function Rt(n){return n instanceof Error?n.message==="Host storage response is too large."||n.message==="Host storage request failed: host_storage_response_too_large":!1}l(Rt,"isOversizeResponse");var Tt=o.object({entries:o.array(o.object({sequence:o.number().int().positive(),event:$})).max(200),totalMatchingEvents:o.number().int().nonnegative(),remainingMatchingEvents:o.number().int().nonnegative()}).strict(),z=class{constructor(e){this.client=e}client;static{l(this,"HostedRuntimeEventStorage")}async runtimeEventsForSession(e,t={}){let r=t.limit==null?1e4:Math.max(0,Math.trunc(t.limit));if(r===0)return[];let s=Math.min(r,1e4),i=[],a=Math.max(0,t.afterSequence??0),c=0,p=t.names?new Set(t.names):null;for(;i.length<=s;){let u=await this.runtimeEventPageRows({sessionId:e,afterSequence:a,beforeSequence:null,limit:Math.min(200,s+1-i.length),excludeReasoningDeltas:t.excludeReasoningDeltas});for(let m of u.entries){if(m.sequence<=a)throw new Error("Host event cursor did not advance.");if(a=m.sequence,c+=1,c>1e4)throw new Error("Hosted runtime event scan exceeds 10,000 rows; use a narrower query.");(!p||p.has(m.event.name))&&i.push(m.event)}if(u.entries.length===0||u.remainingMatchingEvents<=u.entries.length)break}if(i.length>s||t.limit==null&&r===1e4&&i.length===s)throw new Error("Hosted runtime event read exceeds 10,000 rows; use a bounded cursor query.");return i}async persistedRuntimeEventsForSession(e,t={}){return this.runtimeEventsForSession(e,t)}async appendRuntimeEvent(e){let t=$.parse(e),r=await this.client.request({contractVersion:b,requestId:t.id,operation:"event/append",params:{event:t}});return o.object({event:$}).strict().parse(r).event}async runtimeEventPageRows(e){let t=Math.max(1,Math.min(1e3,Math.trunc(e.limit))),r=Math.max(0,Math.trunc(e.afterSequence)),s=e.beforeSequence,i=[],a=0,c=0;for(;i.length<t;){let p=Math.min(200,t-i.length),u=await L(p,async m=>Tt.parse(await this.client.request({contractVersion:b,requestId:`event-page:${It()}`,operation:"events/page",params:{sessionId:e.sessionId,afterSequence:r,beforeSequence:s,limit:m,...e.excludeReasoningDeltas?{excludeReasoningDeltas:!0}:{}}})));if(i.length===0&&(a=u.totalMatchingEvents,c=u.remainingMatchingEvents),i=s===null?[...i,...u.entries]:[...u.entries,...i],u.entries.length===0||u.remainingMatchingEvents<=u.entries.length)break;if(s===null){let m=u.entries.at(-1).sequence;if(m<=r)throw new Error("Host event cursor did not advance.");r=m}else{let m=u.entries[0].sequence;if(m>=s)throw new Error("Host event cursor did not advance.");s=m}}return{entries:i,totalMatchingEvents:a,remainingMatchingEvents:c}}};import{randomUUID as T}from"node:crypto";var Ke=o.object({revision:o.number().int().min(1),session:F}).strict(),Ye=o.object({revision:o.number().int().min(1),turn:N}).strict(),Pt=o.object({sessions:o.array(F).max(200),nextAfterId:o.string().min(1).nullable()}).strict(),xt=o.object({turns:o.array(N).max(200),nextBeforeSortIndex:o.number().int().nonnegative().nullable()}).strict(),K=class{constructor(e){this.client=e}client;static{l(this,"HostedSessionStorage")}async count(){let e=await this.client.request({contractVersion:b,requestId:T(),operation:"session/count",params:{}});return o.object({count:o.number().int().nonnegative()}).strict().parse(e).count}async get(e){let t=await this.client.request({contractVersion:b,requestId:T(),operation:"session/get",params:{sessionId:e}});return t===null?null:Ke.parse(t)}async sessionCount(){return this.count()}async sessionShells(){let e=[],t=null;do{let r=await L(Math.min(10,1001-e.length),async s=>Pt.parse(await this.client.request({contractVersion:b,requestId:T(),operation:"session/page",params:{afterId:t,limit:s}})));if(e.push(...r.sessions),e.length>1e3)throw new Error("Hosted session list exceeds 1,000 rows; use a scoped page query.");if(r.nextAfterId!==null&&(r.sessions.length===0||t!==null&&r.nextAfterId<=t))throw new Error("Host session cursor did not advance.");t=r.nextAfterId}while(t!==null);return e}async getSession(e){return(await this.get(e))?.session??null}async insertSessionAtFront(e){await this.put({session:e,expectedRevision:null,requestId:T()})}async updateSession(e,t){let r=await this.get(e);if(!r)return null;let s=F.parse(t(r.session));if(s.id!==e)throw new Error("A session update cannot change its identity.");return(await this.put({session:s,expectedRevision:r.revision,requestId:T()})).session}async put(e){let t=F.parse(e.session);return Ke.parse(await this.client.request({contractVersion:b,requestId:e.requestId,operation:"session/put",params:{sessionId:t.id,expectedRevision:e.expectedRevision,session:t}}))}async readTurn(e){let t=await this.client.request({contractVersion:b,requestId:T(),operation:"turn/get",params:{turnId:e}});return t===null?null:Ye.parse(t)}async getTurn(e){return(await this.readTurn(e))?.turn??null}async turnsForSession(e,t=50){let r=Math.max(1,Math.min(1e3,Math.trunc(t))),s=[],i=null;for(;s.length<r;){let a=await L(Math.min(200,r-s.length),async c=>xt.parse(await this.client.request({contractVersion:b,requestId:T(),operation:"turn/page",params:{sessionId:e,beforeSortIndex:i,limit:c}})));if(s.push(...a.turns),a.nextBeforeSortIndex===null)break;if(i!==null&&a.nextBeforeSortIndex>=i)throw new Error("Host turn cursor did not advance.");i=a.nextBeforeSortIndex}return s}async countTurnsForSession(e){let t=await this.client.request({contractVersion:b,requestId:T(),operation:"turn/count",params:{sessionId:e}});return o.object({count:o.number().int().nonnegative()}).strict().parse(t).count}async hasSubagentParentWakeTurn(e,t){return await this.wakeCount(e,"messageId",t)>0}async countSubagentParentWakeTurns(e,t){return this.wakeCount(e,"fromRunId",t)}async latestAssistantTextForSession(e){let t=await this.client.request({contractVersion:b,requestId:T(),operation:"events/latestAssistantText",params:{sessionId:e}});return o.object({text:o.string().nullable()}).strict().parse(t).text}async wakeCount(e,t,r){let s=await this.client.request({contractVersion:b,requestId:T(),operation:"turn/wakeCount",params:{sessionId:e,key:t,value:r}});return o.object({count:o.number().int().nonnegative()}).strict().parse(s).count}async latestTurnForSession(e,t){let r=await this.client.request({contractVersion:b,requestId:T(),operation:"turn/latest",params:{sessionId:e,status:t??null}});return r===null?null:N.parse(r)}async latestPersistedTurnForSession(e,t){return this.latestTurnForSession(e,t)}async insertTurn(e){await this.putTurn({turn:e,expectedRevision:null,requestId:T()})}async updateTurn(e,t){let r=await this.readTurn(e);if(!r)return null;let s=N.parse(t(r.turn));if(s.id!==e||s.sessionId!==r.turn.sessionId)throw new Error("A turn update cannot change its identity.");return(await this.putTurn({turn:s,expectedRevision:r.revision,requestId:T()})).turn}async putTurn(e){let t=N.parse(e.turn);return Ye.parse(await this.client.request({contractVersion:b,requestId:e.requestId,operation:"turn/put",params:{sessionId:t.sessionId,turnId:t.id,expectedRevision:e.expectedRevision,turn:t}}))}};import{createHash as Et,randomUUID as kt}from"node:crypto";var k=o.object({ok:o.literal(!0)}).strict(),Y=o.array(H),Ct=o.array(o.string()),At=o.object({turnId:o.string(),run:M}).strict(),Ot=o.object({inputs:o.array(H).max(10),hasMore:o.boolean()}).strict(),_t=o.object({items:o.array(W).max(10),hasMore:o.boolean()}).strict(),Ht=o.object({items:o.array(o.string()).max(200),hasMore:o.boolean()}).strict();function X(n,e){return`inbox:${n}:${Et("sha256").update(JSON.stringify(e)).digest("hex")}`}l(X,"retryKey");function Xe(n){if(n.senderKind==="ponder"||n.payload.ponderDesktop!==void 0)throw new Error("A desktop Pal operation must be admitted on its originating local installation.");return{...n,senderKind:n.senderKind}}l(Xe,"hostedInput");var q=class{constructor(e){this.client=e}client;static{l(this,"HostedTaskInboxStorage")}async call(e,t,r=kt()){let s=await this.client.request({contractVersion:b,requestId:r,operation:"task-inbox/execute",params:e});return t.parse(s)}async inputPages(e,t=Number.MAX_SAFE_INTEGER){let r=[],s=0;for(;r.length<t;){let i=await this.call(e(s),Ot);for(let a of i.inputs){if(a.sequence<=s)throw new Error("Host task input cursor did not advance.");if(s=a.sequence,r.push(a),r.length>=t)break}if(!i.hasMore)return r;if(i.inputs.length===0)throw new Error("Host task input page made no progress.")}return r}async recoverTaskInboxOwners(e){return this.call({action:"recoverTaskInboxOwners",ownerId:e},o.array(o.object({sessionId:o.string(),turnId:o.string()}).strict()))}async hasTaskCompletion(e){return this.call({action:"hasTaskCompletion",turnId:e},o.boolean())}async taskInboxSnapshot(e){let t=await this.call({action:"taskInboxSnapshot",sessionId:e},Pe),[r,s]=await Promise.all([this.inputPages(i=>({action:"taskInboxSnapshotInputs",sessionId:e,afterSequence:i})),this.taskWaitsForSession(e)]);return{...t,inputs:r,waits:s}}async declareTaskWork(e,t,r,s){await this.call({action:"declareTaskWork",sessionId:e,turnId:t,ownerId:r,areas:s},k)}async taskWorkAreas(e){return this.call({action:"taskWorkAreas",sessionId:e},Ct)}async admitTaskInput(e){return this.call({action:"admitTaskInput",input:Xe(e)},H)}async admitTaskInputs(e){return this.call({action:"admitTaskInputs",inputs:e.map(Xe)},Y)}async rejectTaskInput(e,t){await this.call({action:"rejectTaskInput",id:e,error:t},k)}async getTaskInput(e){return this.call({action:"getTaskInput",id:e},H.nullable())}async taskInputsForSession(e,t={}){let r=Math.max(1,Math.min(500,t.limit??128)),s=[],i=t.afterSequence??0;for(;s.length<r;){let a=Math.min(10,r-s.length),c=await this.call({action:"taskInputsForSession",sessionId:e,query:{afterSequence:i,pendingOnly:t.pendingOnly,limit:a}},Y);if(!c.length)break;for(let p of c){if(p.sequence<=i)throw new Error("Host task input cursor did not advance.");i=p.sequence,s.push(p)}if(c.length<a)break}return s}async mutateTaskInput(e,t,r){return this.call({action:"mutateTaskInput",sessionId:e,inputId:t,change:r},H,X("mutate",{sessionId:e,inputId:t,change:r}))}async openTaskInboxTurn(e,t,r){await this.call({action:"openTaskInboxTurn",sessionId:e,turnId:t,ownerId:r},k,X("open",{sessionId:e,turnId:t,ownerId:r}))}async renewTaskInboxTurn(e,t,r){await this.call({action:"renewTaskInboxTurn",sessionId:e,turnId:t,ownerId:r},k)}async pendingTaskInputs(e,t){return this.inputPages(r=>({action:"pendingTaskInputs",sessionId:e,turnId:t,afterSequence:r}))}async taskAssignmentInputs(e){return this.inputPages(t=>({action:"taskAssignmentInputs",turnId:e,afterSequence:t}))}async pauseTaskInboxTurn(e,t,r){await this.call({action:"pauseTaskInboxTurn",sessionId:e,turnId:t,ownerId:r},k)}async includeTaskInputs(e,t,r,s){return this.call({action:"includeTaskInputs",sessionId:e,turnId:t,ownerId:r,requestId:s},Y,X("include",{sessionId:e,turnId:t,ownerId:r,requestId:s}))}async settleTaskInputRequest(e,t){await this.call({action:"settleTaskInputRequest",requestId:e,outcome:t},k)}async sealTaskInboxTurn(e,t,r){return this.call({action:"sealTaskInboxTurn",sessionId:e,turnId:t,ownerId:r},o.boolean())}async sealNativeTaskInboxTurn(e,t,r){return this.call({action:"sealNativeTaskInboxTurn",sessionId:e,turnId:t,ownerId:r},Y)}async closeTaskInboxTurn(e,t,r,s){await this.call({action:"closeTaskInboxTurn",sessionId:e,turnId:t,ownerId:r,outcome:s},k)}async taskInboxPaused(e){return this.call({action:"taskInboxPaused",sessionId:e},o.boolean())}async reserveTaskFollowup(e,t,r){return this.call({action:"reserveTaskFollowup",sessionId:e,turnId:t,ownerId:r},H.nullable(),X("reserve",{sessionId:e,turnId:t,ownerId:r}))}async taskInboxWakeTargets(){let e=[],t="";for(;;){let r=await this.call({action:"taskInboxWakeTargets",afterSessionId:t},Ht);for(let s of r.items){if(s<=t)throw new Error("Host task wake cursor did not advance.");t=s,e.push(s)}if(!r.hasMore)return e;if(!r.items.length)throw new Error("Host task wake page made no progress.")}}async createTaskWait(e){return this.call({action:"createTaskWait",value:e},W)}async settleTaskWait(e,t){return this.call({action:"settleTaskWait",id:e,state:t},W)}async taskWaitsForSession(e){let t=[],r="";for(;;){let s=await this.call({action:"taskWaitsForSession",sessionId:e,afterId:r},_t);for(let i of s.items){if(i.id<=r)throw new Error("Host task wait cursor did not advance.");r=i.id,t.push(i)}if(!s.hasMore)return t;if(!s.items.length)throw new Error("Host task wait page made no progress.")}}async commitSubagentCompletion(e,t){await this.call({action:"commitSubagentCompletion",value:e,turnId:t},k)}async pendingTaskCompletions(e=""){let t=[],r=e;for(;t.length<100;){let s=await this.call({action:"pendingTaskCompletions",afterTurnId:r},o.array(At).max(10));for(let i of s){if(i.turnId<=r)throw new Error("Host task completion cursor did not advance.");r=i.turnId,t.push(i)}if(s.length<10)break}return t}async settleTaskCompletion(e,t){await this.call({action:"settleTaskCompletion",turnId:e,inputId:t},k)}async upsertSubagentRun(e){return this.call({action:"upsertSubagentRun",value:M.parse(e)},M)}async getSubagentRun(e){return this.call({action:"getSubagentRun",id:e},M.nullable())}async listSubagentRuns(e={}){let r=[],s="",i=e.status?Array.isArray(e.status)?[...e.status]:[e.status]:null;for(;;){let a=await this.call({action:"listSubagentRuns",query:{parentSessionId:e.parentSessionId,childSessionId:e.childSessionId,status:i,afterId:s,limit:10}},o.array(M).max(10));for(let c of a){if(c.id<=s)throw new Error("Host subagent run cursor did not advance.");if(s=c.id,r.push(c),r.length>1e3)throw new Error("Hosted subagent run list exceeds 1,000 rows; use a narrower session or status query.")}if(a.length<10)break}return r.sort((a,c)=>(c.updatedAt??c.createdAt).localeCompare(a.updatedAt??a.createdAt)),e.limit===void 0?r:r.slice(0,Math.max(1,Math.min(1e3,e.limit)))}async listActiveSubagentRuns(e={}){return this.listSubagentRuns({...e,status:e.status??["queued","running","needs_resume"]})}};var se=class extends q{static{l(this,"HostedTurnRepository")}sessions;events;approvals;usage;createImprove;constructor(e){super(e),this.sessions=new K(e),this.events=new z(e),this.approvals=new qe(e),this.usage=new De(e),this.createImprove=new J(e)}sessionShells(){return this.sessions.sessionShells()}sessionCount(){return this.sessions.sessionCount()}getSession(e){return this.sessions.getSession(e)}insertSessionAtFront(e){return this.sessions.insertSessionAtFront(e)}updateSession(e,t){return this.sessions.updateSession(e,t)}getTurn(e){return this.sessions.getTurn(e)}insertTurn(e){return this.sessions.insertTurn(e)}updateTurn(e,t){return this.sessions.updateTurn(e,t)}latestTurnForSession(e,t){return this.sessions.latestTurnForSession(e,t)}latestPersistedTurnForSession(e,t){return this.sessions.latestPersistedTurnForSession(e,t)}turnsForSession(e,t){return this.sessions.turnsForSession(e,t)}countTurnsForSession(e){return this.sessions.countTurnsForSession(e)}hasSubagentParentWakeTurn(e,t){return this.sessions.hasSubagentParentWakeTurn(e,t)}countSubagentParentWakeTurns(e,t){return this.sessions.countSubagentParentWakeTurns(e,t)}latestAssistantTextForSession(e){return this.sessions.latestAssistantTextForSession(e)}appendRuntimeEvent(e){return this.events.appendRuntimeEvent(e)}runtimeEventsForSession(e,t){return this.events.runtimeEventsForSession(e,t)}persistedRuntimeEventsForSession(e,t){return this.events.persistedRuntimeEventsForSession(e,t)}async runtimeEventsForTurn(e,t){let r=await this.getTurn(e);if(!r)return[];let s=(await this.events.runtimeEventsForSession(r.sessionId)).filter(i=>i.turnId===e&&(!t?.names||t.names.includes(i.name)));return t?.limit==null?s:s.slice(0,Math.max(0,t.limit))}runtimeEventPageRows(e){return this.events.runtimeEventPageRows(e)}getApproval(e){return this.approvals.getApproval(e)}async upsertApproval(e){let t=await this.approvals.readApproval(e.id);t&&JSON.stringify(t.approval)===JSON.stringify(e)||await this.approvals.putApproval({approval:e,expectedRevision:t?.revision??null,requestId:`approval:${Ut("sha256").update(JSON.stringify({approval:e,revision:t?.revision??null})).digest("hex")}`})}upsertModelUsageRecord(e){return this.usage.upsertModelUsageRecord(e)}listModelUsageRecords(e){return this.usage.listModelUsageRecords(e)}getCreateImproveRun(e){return this.createImprove.getCreateImproveRun(e)}listCreateImproveRuns(e){return this.createImprove.listCreateImproveRuns(e)}upsertCreateImproveRun(e){return this.createImprove.upsertCreateImproveRun(e)}mutateCreateImproveRun(e,t){return this.createImprove.mutateCreateImproveRun(e,t)}};function Ze(n){return new se(n)}l(Ze,"createHostedRuntimeCoreStorage");function oe(n=process.env){let e=n.OPENPOND_API_KEY?.trim(),t=n.OPENPOND_OPCHAT_API_URL?.trim(),r=n.OPENPOND_HOSTED_MODEL_ID?.trim();if(!e||!t||!r)throw new Error("Hosted model stream requires a host credential, API URL, and admitted model.");let s=new URL(t);if(s.protocol!=="https:"||s.username||s.password||s.search||s.hash)throw new Error("Hosted model stream API URL is invalid.");return l(async function*(a){if(a.model!==r)throw new Error("Hosted model selection changed outside host admission.");yield*Ae({...a,apiBaseUrl:s.toString(),token:e,model:r})},"streamHostedModel")}l(oe,"createHostedModelStreamFromEnvironment");import{existsSync as Mt}from"node:fs";import{lstat as Nt,readFile as qt,realpath as Dt}from"node:fs/promises";import y from"node:path";import{fileURLToPath as Bt}from"node:url";var Qe=y.dirname(Bt(import.meta.url));function R(n,e,t){let r=n[e+1];if(!r||r.startsWith("--"))throw new Error(`${t} requires a value.`);return r}l(R,"requireValue");function et(n,e){let t=Number.parseInt(n,10);if(!Number.isFinite(t)||t<0||t>65535)throw new Error(`${e} must be a port from 0 to 65535.`);return t}l(et,"parsePort");function nt(n){let e="serve",t=Q,r=17874,s=null,i=!1,a=!1,c=null,p,u=!1,m,w,I,C=null,f=null,h=null,S=null,P,v="sqlite_bundle",A=0,E=n[0];if(E&&!E.startsWith("-")){if(E==="serve"||E==="server")e="serve";else if(E==="app-server")e="app-server";else if(E==="web")e="web";else{if(E==="help")return{mode:e,host:t,port:r,webRoot:s,openBrowser:i,printAccessUrl:a,storeDir:c,runtimeStorage:v,help:!0};throw new Error(`Unknown command: ${E}`)}A=1}for(let g=A;g<n.length;g+=1){let d=n[g];if(d==="--help"||d==="-h")return{mode:e,host:t,port:r,webRoot:s,openBrowser:i,printAccessUrl:a,storeDir:c,runtimeStorage:v,help:!0};if(d==="--listen"){let O=Ce(R(n,g,d));t=O.host,r=et(String(O.port),d),g+=1}else if(d==="--hostname"||d==="--host")t=R(n,g,d),g+=1;else if(d==="--port")r=et(R(n,g,d),d),g+=1;else if(d==="--web-root")s=y.resolve(R(n,g,d)),g+=1;else if(d==="--source-browser-state")I=y.resolve(R(n,g,d)),g+=1;else{if(d==="--store-dir")throw new Error("--store-dir has been replaced by --home. Use --home <directory> or OPENPOND_HOME.");if(d==="--home")c=y.resolve(R(n,g,d)),g+=1;else if(d==="--hosted-cache-home")p=y.resolve(R(n,g,d)),g+=1;else if(d==="--experiment-owner")u=!0;else if(d==="--experiment-harness-package"){if(m)throw new Error("Duplicate Experiment Harness source package.");m=y.resolve(R(n,g,d)),g+=1}else if(d==="--runtime-storage"){if(R(n,g,d)!=="hosted-postgres")throw new Error("Unsupported app-server runtime storage.");v="hosted_postgres",g+=1}else if(d==="--profile-external-dataset-package"){if(w)throw new Error("Duplicate private external Dataset package.");w=y.resolve(R(n,g,d)),g+=1}else if(d==="--profile-source-root")C=y.resolve(R(n,g,d)),g+=1;else if(d==="--profile-repository-id")f=R(n,g,d),g+=1;else if(d==="--profile-id")h=R(n,g,d),g+=1;else if(d==="--profile-revision")S=R(n,g,d),g+=1;else if(d==="--hosted-profile-release"){if(P)throw new Error("Duplicate hosted Profile release descriptor.");let O=R(n,g,d);if(O.length>16e3||!/^[A-Za-z0-9_-]+$/.test(O))throw new Error("Invalid hosted Profile release descriptor.");try{P=Ne.parse(JSON.parse(Buffer.from(O,"base64url").toString("utf8")))}catch{throw new Error("Invalid hosted Profile release descriptor.")}g+=1}else if(d==="--open-browser")i=!0;else if(d==="--print-access-url")a=!0;else throw new Error(`Unknown option: ${d}`)}}if(i&&a)throw new Error("--open-browser and --print-access-url cannot be used together.");if(e!=="web"&&(i||a))throw new Error("Browser options are only available in web mode.");let D=[C,f,h,S].filter(Boolean).length;if(D&&(D!==4||e!=="app-server"))throw new Error("Profile source flags require app-server mode and --profile-source-root, --profile-repository-id, --profile-id, and --profile-revision together.");if(v==="hosted_postgres"&&(e!=="app-server"||c||D))throw new Error("Hosted Postgres app-server cannot use --home or local Profile source flags.");if(P&&v!=="hosted_postgres")throw new Error("Hosted Profile release requires hosted Postgres app-server mode.");if(p&&v!=="hosted_postgres")throw new Error("Hosted cache home requires hosted Postgres mode.");if(u&&(e!=="app-server"||v!=="sqlite_bundle"||D||!c))throw new Error("Experiment owner mode requires an isolated app-server home without Profile selection.");if(m&&(!u||y.dirname(m)!==c))throw new Error("Experiment Harness source must be provisioned directly inside its isolated owner home.");return{mode:e,host:t,port:r,webRoot:s,openBrowser:i,printAccessUrl:a,storeDir:c,runtimeStorage:v,sourceBrowserState:I,...w?{profileExternalDatasetPackage:w}:{},...D?{profileSource:{repoPath:C,repositoryId:f,profileId:h,sourceRevision:S}}:{},...P?{admittedProfileRelease:P}:{},...p?{hostedCacheHome:p}:{},...u?{experimentOwner:!0}:{},...m?{experimentHarnessPackage:m}:{},help:!1}}l(nt,"parseCliArgs");function Ft(){return[process.env.OPENPOND_WEB_ROOT,y.resolve(process.cwd(),"apps/web/dist"),y.resolve(Qe,"../../web/dist"),y.resolve(process.cwd(),"web"),y.resolve(Qe,"../web")].filter(n=>!!n)}l(Ft,"defaultWebRootCandidates");function jt(n){let e=n?[n]:Ft();for(let t of e){let r=y.resolve(t);if(Mt(y.join(r,"index.html")))return r}return null}l(jt,"resolveWebRoot");function Lt(n){let e=n==="0.0.0.0"||n==="::"?"127.0.0.1":n;return e.includes(":")&&!e.startsWith("[")?`[${e}]`:e}l(Lt,"formatHostForUrl");function Vt(n){return`http://${Lt(n.status.host)}:${n.status.port}`}l(Vt,"browserBaseUrl");function $t(n,e){let t=new URL(n),r=new URLSearchParams;return r.set("openpondServerUrl",n),r.set("openpondToken",e),t.hash=r.toString(),t.toString()}l($t,"tokenizedWebUrl");async function tt(n,e=He){let t=$t(n.baseUrl,n.token);if(n.printAccessUrl)return{stdout:[`OpenPond access URL: ${t}`],stderr:[]};if(!n.openBrowser)return{stdout:[`OpenPond web UI: ${n.baseUrl}`],stderr:[]};let r=await e(t);return r.opened?{stdout:[`Opened OpenPond in your browser: ${n.baseUrl}`],stderr:[]}:{stdout:[`OpenPond access URL: ${t}`],stderr:[`Could not open the system browser: ${r.error}`]}}l(tt,"resolveWebLaunchMessages");function st(){console.log(`Usage:
23
+ </script></html>`}l(We,"startupRecoveryPage");var vt=o.strictObject({action:o.enum(["preview","migrate","restart","retry"]),sourceAppHome:o.string().optional(),sourceConfig:o.string().optional(),resolutions:ve.optional()});function Ge(n){return n instanceof ae&&/^(PRIVATE_STORAGE_|UNSAFE_STORAGE_|INVALID_CONFIG|CONFIG_|MIGRATION_|SOURCE_CHANGED_|CREDENTIAL_|UNSUPPORTED_STORAGE_|INVALID_MIGRATION_|INVALID_ACCOUNT_|MISSING_INSTRUCTION_|INVALID_PROFILE_|DATABASE_RECOVERY_)/.test(n.issue.code)}l(Ge,"isRecoverableStartupError");async function Je(n,e,t){let r=/^(UNSUPPORTED_STORAGE_|INVALID_MIGRATION_|UNSAFE_STORAGE_|PRIVATE_STORAGE_)/.test(t.issue.code),s=r?await ne.mkdtemp(gt.join(mt.tmpdir(),"openpond-recovery-")):n;return Ee(s,async()=>{let{token:i,tokenFile:a}=await Ue(s),c=Be(n),p=t.issue,u,m=new Promise(f=>{u=f}),w=ft((f,h)=>{(async()=>{let S=new URL(f.url??"/","http://127.0.0.1");if(!Le(f,h).allowed){x(h,403,{error:"Origin not allowed"});return}if(f.method==="OPTIONS"){x(h,204,{});return}if(f.method==="GET"&&S.pathname==="/health"){x(h,200,{ok:!0,server:"openpond-app-server",version:Te,recovery:!0});return}if(f.method==="GET"&&S.pathname==="/"){let v=ht(18).toString("base64");h.writeHead(200,{"Content-Type":"text/html; charset=utf-8","Cache-Control":"no-store","Content-Security-Policy":`default-src 'none'; script-src 'nonce-${v}'; style-src 'nonce-${v}'; connect-src 'self'; base-uri 'none'; frame-ancestors 'none'`}),h.end(We(v));return}if(!Ve(f,S,i)){x(h,401,{error:"Unauthorized"});return}let P=!r;if(f.method==="GET"&&S.pathname==="/v1/recovery"){x(h,200,{issue:p,configEditable:P,config:r?{path:U(n).config,text:null,rawRevision:"unavailable",issue:p,recoverableRevisions:[]}:await c.status(),migration:await we(n).catch(v=>({issue:B(v,n)}))});return}if(f.method==="POST"&&S.pathname==="/v1/configuration"&&P){x(h,200,await c.mutate(await re(f)));return}if(f.method==="POST"&&S.pathname==="/v1/recovery"){let v=vt.parse(await re(f));if(r&&v.action!=="retry"&&v.action!=="preview")throw t;if(v.action==="restart"){x(h,200,await be(n));return}if(v.action==="preview"||v.action==="migrate"){x(h,200,await Z(n,{sourceAppHome:v.sourceAppHome,sourceConfig:v.sourceConfig,resolutions:v.resolutions,dryRun:v.action==="preview"}));return}await Z(n),await V(n),x(h,200,{ready:!0}),u();return}x(h,503,{error:`${p.message} ${p.action}`,issue:p,recovery:!0})})().catch(S=>{p=B(S,n),x(h,422,{error:`${p.message} ${p.action}`,issue:p})})});await new Promise((f,h)=>{w.once("error",h),w.listen(e,"127.0.0.1",()=>{w.off("error",h),f()})});let I=w.address().port,C=`http://127.0.0.1:${I}`;return await ke(s,C,"startup-recovery"),{url:C,port:I,token:i,tokenFile:a,storePath:U(n).database,repaired:m,close:l(async()=>{w.closeIdleConnections(),await new Promise((f,h)=>w.close(S=>S?h(S):f())),r&&await ne.rm(s,{recursive:!0,force:!0})},"close")}}).catch(async i=>{throw r&&await ne.rm(s,{recursive:!0,force:!0}),i})}l(Je,"startRecoveryServer");import{createHash as Ut}from"node:crypto";import{createHash as wt,randomUUID as ze}from"node:crypto";var bt=o.object({updatedAt:o.string(),id:o.string().min(1)}).strict(),St=o.object({entries:o.array(_).max(200),nextBefore:bt.nullable()}).strict(),yt=o.object({run:_,replayed:o.boolean()}).strict(),J=class{constructor(e){this.client=e}client;static{l(this,"HostedCreateImproveStorage")}async getCreateImproveRun(e){let t=await this.client.request({contractVersion:b,requestId:ze(),operation:"create-improve/execute",params:{action:"get",runId:e}});return t===null?null:_.parse(t)}async listCreateImproveRuns(e={}){let t=Math.max(1,Math.min(1e3,Math.trunc(e.limit??250))),r=Array.isArray(e.state)?[...e.state]:e.state?[e.state]:[],s=[],i=null;for(;s.length<t;){let a=St.parse(await this.client.request({contractVersion:b,requestId:ze(),operation:"create-improve/execute",params:{action:"page",query:{profileId:e.profileId??null,targetKind:e.targetKind??null,targetId:e.targetId??null,state:r},before:i,limit:Math.min(50,t-s.length)}}));if(e.conversationId&&a.entries.some(c=>c.scope.conversationId!==e.conversationId))throw new Error("Hosted Create/Improve page crossed its conversation scope.");if(s.push(...a.entries),!a.nextBefore)break;if(a.entries.length===0||i&&(a.nextBefore.updatedAt>i.updatedAt||a.nextBefore.updatedAt===i.updatedAt&&a.nextBefore.id>=i.id))throw new Error("Hosted Create/Improve cursor did not advance.");i=a.nextBefore}return s}async upsertCreateImproveRun(e){let t=_.parse(e),r=`create-improve:${wt("sha256").update(JSON.stringify(t)).digest("hex")}`,s=await this.client.request({contractVersion:b,requestId:r,operation:"create-improve/execute",params:{action:"put",run:t}});return _.parse(o.object({run:o.unknown()}).strict().parse(s).run)}async mutateCreateImproveRun(e,t){let r=Pe.parse(e),s=await this.getCreateImproveRun(r.runId);if(!s)throw new Error(`Create/Improve run not found: ${r.runId}`);if(s.appliedActionIds.includes(r.actionId))return{run:s,replayed:!0};if(s.revision!==r.expectedRevision)throw new Error(`Create/Improve run changed from revision ${r.expectedRevision} to ${s.revision}. Refresh and try again.`);let i=_.parse(t(s));if(i.id!==s.id||i.revision!==s.revision+1||!i.appliedActionIds.includes(r.actionId))throw new Error("Create/Improve mutation must preserve identity, advance one revision and record its action.");return yt.parse(await this.client.request({contractVersion:b,requestId:r.actionId,operation:"create-improve/execute",params:{action:"mutate",mutation:r,next:i}}))}};import{randomUUID as It}from"node:crypto";async function L(n,e){let t=n;for(;;)try{return await e(t)}catch(r){if(!Rt(r)||t<=1)throw r;t=Math.max(1,Math.floor(t/2))}}l(L,"hostedBoundedPage");function Rt(n){return n instanceof Error?n.message==="Host storage response is too large."||n.message==="Host storage request failed: host_storage_response_too_large":!1}l(Rt,"isOversizeResponse");var Tt=o.object({entries:o.array(o.object({sequence:o.number().int().positive(),event:$})).max(200),totalMatchingEvents:o.number().int().nonnegative(),remainingMatchingEvents:o.number().int().nonnegative()}).strict(),z=class{constructor(e){this.client=e}client;static{l(this,"HostedRuntimeEventStorage")}async runtimeEventsForSession(e,t={}){let r=t.limit==null?1e4:Math.max(0,Math.trunc(t.limit));if(r===0)return[];let s=Math.min(r,1e4),i=[],a=Math.max(0,t.afterSequence??0),c=0,p=t.names?new Set(t.names):null;for(;i.length<=s;){let u=await this.runtimeEventPageRows({sessionId:e,afterSequence:a,beforeSequence:null,limit:Math.min(200,s+1-i.length),excludeReasoningDeltas:t.excludeReasoningDeltas});for(let m of u.entries){if(m.sequence<=a)throw new Error("Host event cursor did not advance.");if(a=m.sequence,c+=1,c>1e4)throw new Error("Hosted runtime event scan exceeds 10,000 rows; use a narrower query.");(!p||p.has(m.event.name))&&i.push(m.event)}if(u.entries.length===0||u.remainingMatchingEvents<=u.entries.length)break}if(i.length>s||t.limit==null&&r===1e4&&i.length===s)throw new Error("Hosted runtime event read exceeds 10,000 rows; use a bounded cursor query.");return i}async persistedRuntimeEventsForSession(e,t={}){return this.runtimeEventsForSession(e,t)}async appendRuntimeEvent(e){let t=$.parse(e),r=await this.client.request({contractVersion:b,requestId:t.id,operation:"event/append",params:{event:t}});return o.object({event:$}).strict().parse(r).event}async runtimeEventPageRows(e){let t=Math.max(1,Math.min(1e3,Math.trunc(e.limit))),r=Math.max(0,Math.trunc(e.afterSequence)),s=e.beforeSequence,i=[],a=0,c=0;for(;i.length<t;){let p=Math.min(200,t-i.length),u=await L(p,async m=>Tt.parse(await this.client.request({contractVersion:b,requestId:`event-page:${It()}`,operation:"events/page",params:{sessionId:e.sessionId,afterSequence:r,beforeSequence:s,limit:m,...e.excludeReasoningDeltas?{excludeReasoningDeltas:!0}:{}}})));if(i.length===0&&(a=u.totalMatchingEvents,c=u.remainingMatchingEvents),i=s===null?[...i,...u.entries]:[...u.entries,...i],u.entries.length===0||u.remainingMatchingEvents<=u.entries.length)break;if(s===null){let m=u.entries.at(-1).sequence;if(m<=r)throw new Error("Host event cursor did not advance.");r=m}else{let m=u.entries[0].sequence;if(m>=s)throw new Error("Host event cursor did not advance.");s=m}}return{entries:i,totalMatchingEvents:a,remainingMatchingEvents:c}}};import{randomUUID as T}from"node:crypto";var Ke=o.object({revision:o.number().int().min(1),session:F}).strict(),Ye=o.object({revision:o.number().int().min(1),turn:N}).strict(),Pt=o.object({sessions:o.array(F).max(200),nextAfterId:o.string().min(1).nullable()}).strict(),xt=o.object({turns:o.array(N).max(200),nextBeforeSortIndex:o.number().int().nonnegative().nullable()}).strict(),K=class{constructor(e){this.client=e}client;static{l(this,"HostedSessionStorage")}async count(){let e=await this.client.request({contractVersion:b,requestId:T(),operation:"session/count",params:{}});return o.object({count:o.number().int().nonnegative()}).strict().parse(e).count}async get(e){let t=await this.client.request({contractVersion:b,requestId:T(),operation:"session/get",params:{sessionId:e}});return t===null?null:Ke.parse(t)}async sessionCount(){return this.count()}async sessionShells(){let e=[],t=null;do{let r=await L(Math.min(10,1001-e.length),async s=>Pt.parse(await this.client.request({contractVersion:b,requestId:T(),operation:"session/page",params:{afterId:t,limit:s}})));if(e.push(...r.sessions),e.length>1e3)throw new Error("Hosted session list exceeds 1,000 rows; use a scoped page query.");if(r.nextAfterId!==null&&(r.sessions.length===0||t!==null&&r.nextAfterId<=t))throw new Error("Host session cursor did not advance.");t=r.nextAfterId}while(t!==null);return e}async getSession(e){return(await this.get(e))?.session??null}async insertSessionAtFront(e){await this.put({session:e,expectedRevision:null,requestId:T()})}async updateSession(e,t){let r=await this.get(e);if(!r)return null;let s=F.parse(t(r.session));if(s.id!==e)throw new Error("A session update cannot change its identity.");return(await this.put({session:s,expectedRevision:r.revision,requestId:T()})).session}async put(e){let t=F.parse(e.session);return Ke.parse(await this.client.request({contractVersion:b,requestId:e.requestId,operation:"session/put",params:{sessionId:t.id,expectedRevision:e.expectedRevision,session:t}}))}async readTurn(e){let t=await this.client.request({contractVersion:b,requestId:T(),operation:"turn/get",params:{turnId:e}});return t===null?null:Ye.parse(t)}async getTurn(e){return(await this.readTurn(e))?.turn??null}async turnsForSession(e,t=50){let r=Math.max(1,Math.min(1e3,Math.trunc(t))),s=[],i=null;for(;s.length<r;){let a=await L(Math.min(200,r-s.length),async c=>xt.parse(await this.client.request({contractVersion:b,requestId:T(),operation:"turn/page",params:{sessionId:e,beforeSortIndex:i,limit:c}})));if(s.push(...a.turns),a.nextBeforeSortIndex===null)break;if(i!==null&&a.nextBeforeSortIndex>=i)throw new Error("Host turn cursor did not advance.");i=a.nextBeforeSortIndex}return s}async countTurnsForSession(e){let t=await this.client.request({contractVersion:b,requestId:T(),operation:"turn/count",params:{sessionId:e}});return o.object({count:o.number().int().nonnegative()}).strict().parse(t).count}async hasSubagentParentWakeTurn(e,t){return await this.wakeCount(e,"messageId",t)>0}async countSubagentParentWakeTurns(e,t){return this.wakeCount(e,"fromRunId",t)}async latestAssistantTextForSession(e){let t=await this.client.request({contractVersion:b,requestId:T(),operation:"events/latestAssistantText",params:{sessionId:e}});return o.object({text:o.string().nullable()}).strict().parse(t).text}async wakeCount(e,t,r){let s=await this.client.request({contractVersion:b,requestId:T(),operation:"turn/wakeCount",params:{sessionId:e,key:t,value:r}});return o.object({count:o.number().int().nonnegative()}).strict().parse(s).count}async latestTurnForSession(e,t){let r=await this.client.request({contractVersion:b,requestId:T(),operation:"turn/latest",params:{sessionId:e,status:t??null}});return r===null?null:N.parse(r)}async latestPersistedTurnForSession(e,t){return this.latestTurnForSession(e,t)}async insertTurn(e){await this.putTurn({turn:e,expectedRevision:null,requestId:T()})}async updateTurn(e,t){let r=await this.readTurn(e);if(!r)return null;let s=N.parse(t(r.turn));if(s.id!==e||s.sessionId!==r.turn.sessionId)throw new Error("A turn update cannot change its identity.");return(await this.putTurn({turn:s,expectedRevision:r.revision,requestId:T()})).turn}async putTurn(e){let t=N.parse(e.turn);return Ye.parse(await this.client.request({contractVersion:b,requestId:e.requestId,operation:"turn/put",params:{sessionId:t.sessionId,turnId:t.id,expectedRevision:e.expectedRevision,turn:t}}))}};import{createHash as Et,randomUUID as kt}from"node:crypto";var k=o.object({ok:o.literal(!0)}).strict(),Y=o.array(H),Ct=o.array(o.string()),At=o.object({turnId:o.string(),run:M}).strict(),Ot=o.object({inputs:o.array(H).max(10),hasMore:o.boolean()}).strict(),_t=o.object({items:o.array(W).max(10),hasMore:o.boolean()}).strict(),Ht=o.object({items:o.array(o.string()).max(200),hasMore:o.boolean()}).strict();function X(n,e){return`inbox:${n}:${Et("sha256").update(JSON.stringify(e)).digest("hex")}`}l(X,"retryKey");function Xe(n){if(n.senderKind==="ponder"||n.payload.ponderDesktop!==void 0)throw new Error("A desktop Pal operation must be admitted on its originating local installation.");return{...n,senderKind:n.senderKind}}l(Xe,"hostedInput");var q=class{constructor(e){this.client=e}client;static{l(this,"HostedTaskInboxStorage")}async call(e,t,r=kt()){let s=await this.client.request({contractVersion:b,requestId:r,operation:"task-inbox/execute",params:e});return t.parse(s)}async inputPages(e,t=Number.MAX_SAFE_INTEGER){let r=[],s=0;for(;r.length<t;){let i=await this.call(e(s),Ot);for(let a of i.inputs){if(a.sequence<=s)throw new Error("Host task input cursor did not advance.");if(s=a.sequence,r.push(a),r.length>=t)break}if(!i.hasMore)return r;if(i.inputs.length===0)throw new Error("Host task input page made no progress.")}return r}async recoverTaskInboxOwners(e){return this.call({action:"recoverTaskInboxOwners",ownerId:e},o.array(o.object({sessionId:o.string(),turnId:o.string()}).strict()))}async hasTaskCompletion(e){return this.call({action:"hasTaskCompletion",turnId:e},o.boolean())}async taskInboxSnapshot(e){let t=await this.call({action:"taskInboxSnapshot",sessionId:e},xe),[r,s]=await Promise.all([this.inputPages(i=>({action:"taskInboxSnapshotInputs",sessionId:e,afterSequence:i})),this.taskWaitsForSession(e)]);return{...t,inputs:r,waits:s}}async declareTaskWork(e,t,r,s){await this.call({action:"declareTaskWork",sessionId:e,turnId:t,ownerId:r,areas:s},k)}async taskWorkAreas(e){return this.call({action:"taskWorkAreas",sessionId:e},Ct)}async admitTaskInput(e){return this.call({action:"admitTaskInput",input:Xe(e)},H)}async admitTaskInputs(e){return this.call({action:"admitTaskInputs",inputs:e.map(Xe)},Y)}async rejectTaskInput(e,t){await this.call({action:"rejectTaskInput",id:e,error:t},k)}async getTaskInput(e){return this.call({action:"getTaskInput",id:e},H.nullable())}async taskInputsForSession(e,t={}){let r=Math.max(1,Math.min(500,t.limit??128)),s=[],i=t.afterSequence??0;for(;s.length<r;){let a=Math.min(10,r-s.length),c=await this.call({action:"taskInputsForSession",sessionId:e,query:{afterSequence:i,pendingOnly:t.pendingOnly,limit:a}},Y);if(!c.length)break;for(let p of c){if(p.sequence<=i)throw new Error("Host task input cursor did not advance.");i=p.sequence,s.push(p)}if(c.length<a)break}return s}async mutateTaskInput(e,t,r){return this.call({action:"mutateTaskInput",sessionId:e,inputId:t,change:r},H,X("mutate",{sessionId:e,inputId:t,change:r}))}async openTaskInboxTurn(e,t,r){await this.call({action:"openTaskInboxTurn",sessionId:e,turnId:t,ownerId:r},k,X("open",{sessionId:e,turnId:t,ownerId:r}))}async renewTaskInboxTurn(e,t,r){await this.call({action:"renewTaskInboxTurn",sessionId:e,turnId:t,ownerId:r},k)}async pendingTaskInputs(e,t){return this.inputPages(r=>({action:"pendingTaskInputs",sessionId:e,turnId:t,afterSequence:r}))}async taskAssignmentInputs(e){return this.inputPages(t=>({action:"taskAssignmentInputs",turnId:e,afterSequence:t}))}async pauseTaskInboxTurn(e,t,r){await this.call({action:"pauseTaskInboxTurn",sessionId:e,turnId:t,ownerId:r},k)}async includeTaskInputs(e,t,r,s){return this.call({action:"includeTaskInputs",sessionId:e,turnId:t,ownerId:r,requestId:s},Y,X("include",{sessionId:e,turnId:t,ownerId:r,requestId:s}))}async settleTaskInputRequest(e,t){await this.call({action:"settleTaskInputRequest",requestId:e,outcome:t},k)}async sealTaskInboxTurn(e,t,r){return this.call({action:"sealTaskInboxTurn",sessionId:e,turnId:t,ownerId:r},o.boolean())}async sealNativeTaskInboxTurn(e,t,r){return this.call({action:"sealNativeTaskInboxTurn",sessionId:e,turnId:t,ownerId:r},Y)}async closeTaskInboxTurn(e,t,r,s){await this.call({action:"closeTaskInboxTurn",sessionId:e,turnId:t,ownerId:r,outcome:s},k)}async taskInboxPaused(e){return this.call({action:"taskInboxPaused",sessionId:e},o.boolean())}async reserveTaskFollowup(e,t,r){return this.call({action:"reserveTaskFollowup",sessionId:e,turnId:t,ownerId:r},H.nullable(),X("reserve",{sessionId:e,turnId:t,ownerId:r}))}async taskInboxWakeTargets(){let e=[],t="";for(;;){let r=await this.call({action:"taskInboxWakeTargets",afterSessionId:t},Ht);for(let s of r.items){if(s<=t)throw new Error("Host task wake cursor did not advance.");t=s,e.push(s)}if(!r.hasMore)return e;if(!r.items.length)throw new Error("Host task wake page made no progress.")}}async createTaskWait(e){return this.call({action:"createTaskWait",value:e},W)}async settleTaskWait(e,t){return this.call({action:"settleTaskWait",id:e,state:t},W)}async taskWaitsForSession(e){let t=[],r="";for(;;){let s=await this.call({action:"taskWaitsForSession",sessionId:e,afterId:r},_t);for(let i of s.items){if(i.id<=r)throw new Error("Host task wait cursor did not advance.");r=i.id,t.push(i)}if(!s.hasMore)return t;if(!s.items.length)throw new Error("Host task wait page made no progress.")}}async commitSubagentCompletion(e,t){await this.call({action:"commitSubagentCompletion",value:e,turnId:t},k)}async pendingTaskCompletions(e=""){let t=[],r=e;for(;t.length<100;){let s=await this.call({action:"pendingTaskCompletions",afterTurnId:r},o.array(At).max(10));for(let i of s){if(i.turnId<=r)throw new Error("Host task completion cursor did not advance.");r=i.turnId,t.push(i)}if(s.length<10)break}return t}async settleTaskCompletion(e,t){await this.call({action:"settleTaskCompletion",turnId:e,inputId:t},k)}async upsertSubagentRun(e){return this.call({action:"upsertSubagentRun",value:M.parse(e)},M)}async getSubagentRun(e){return this.call({action:"getSubagentRun",id:e},M.nullable())}async listSubagentRuns(e={}){let r=[],s="",i=e.status?Array.isArray(e.status)?[...e.status]:[e.status]:null;for(;;){let a=await this.call({action:"listSubagentRuns",query:{parentSessionId:e.parentSessionId,childSessionId:e.childSessionId,status:i,afterId:s,limit:10}},o.array(M).max(10));for(let c of a){if(c.id<=s)throw new Error("Host subagent run cursor did not advance.");if(s=c.id,r.push(c),r.length>1e3)throw new Error("Hosted subagent run list exceeds 1,000 rows; use a narrower session or status query.")}if(a.length<10)break}return r.sort((a,c)=>(c.updatedAt??c.createdAt).localeCompare(a.updatedAt??a.createdAt)),e.limit===void 0?r:r.slice(0,Math.max(1,Math.min(1e3,e.limit)))}async listActiveSubagentRuns(e={}){return this.listSubagentRuns({...e,status:e.status??["queued","running","needs_resume"]})}};var se=class extends q{static{l(this,"HostedTurnRepository")}sessions;events;approvals;usage;createImprove;constructor(e){super(e),this.sessions=new K(e),this.events=new z(e),this.approvals=new qe(e),this.usage=new De(e),this.createImprove=new J(e)}sessionShells(){return this.sessions.sessionShells()}sessionCount(){return this.sessions.sessionCount()}getSession(e){return this.sessions.getSession(e)}insertSessionAtFront(e){return this.sessions.insertSessionAtFront(e)}updateSession(e,t){return this.sessions.updateSession(e,t)}getTurn(e){return this.sessions.getTurn(e)}insertTurn(e){return this.sessions.insertTurn(e)}updateTurn(e,t){return this.sessions.updateTurn(e,t)}latestTurnForSession(e,t){return this.sessions.latestTurnForSession(e,t)}latestPersistedTurnForSession(e,t){return this.sessions.latestPersistedTurnForSession(e,t)}turnsForSession(e,t){return this.sessions.turnsForSession(e,t)}countTurnsForSession(e){return this.sessions.countTurnsForSession(e)}hasSubagentParentWakeTurn(e,t){return this.sessions.hasSubagentParentWakeTurn(e,t)}countSubagentParentWakeTurns(e,t){return this.sessions.countSubagentParentWakeTurns(e,t)}latestAssistantTextForSession(e){return this.sessions.latestAssistantTextForSession(e)}appendRuntimeEvent(e){return this.events.appendRuntimeEvent(e)}runtimeEventsForSession(e,t){return this.events.runtimeEventsForSession(e,t)}persistedRuntimeEventsForSession(e,t){return this.events.persistedRuntimeEventsForSession(e,t)}async runtimeEventsForTurn(e,t){let r=await this.getTurn(e);if(!r)return[];let s=(await this.events.runtimeEventsForSession(r.sessionId)).filter(i=>i.turnId===e&&(!t?.names||t.names.includes(i.name)));return t?.limit==null?s:s.slice(0,Math.max(0,t.limit))}runtimeEventPageRows(e){return this.events.runtimeEventPageRows(e)}getApproval(e){return this.approvals.getApproval(e)}async upsertApproval(e){let t=await this.approvals.readApproval(e.id);t&&JSON.stringify(t.approval)===JSON.stringify(e)||await this.approvals.putApproval({approval:e,expectedRevision:t?.revision??null,requestId:`approval:${Ut("sha256").update(JSON.stringify({approval:e,revision:t?.revision??null})).digest("hex")}`})}upsertModelUsageRecord(e){return this.usage.upsertModelUsageRecord(e)}listModelUsageRecords(e){return this.usage.listModelUsageRecords(e)}getCreateImproveRun(e){return this.createImprove.getCreateImproveRun(e)}listCreateImproveRuns(e){return this.createImprove.listCreateImproveRuns(e)}upsertCreateImproveRun(e){return this.createImprove.upsertCreateImproveRun(e)}mutateCreateImproveRun(e,t){return this.createImprove.mutateCreateImproveRun(e,t)}};function Ze(n){return new se(n)}l(Ze,"createHostedRuntimeCoreStorage");function oe(n=process.env){let e=n.OPENPOND_API_KEY?.trim(),t=n.OPENPOND_OPCHAT_API_URL?.trim(),r=n.OPENPOND_HOSTED_MODEL_ID?.trim();if(!e||!t||!r)throw new Error("Hosted model stream requires a host credential, API URL, and admitted model.");let s=new URL(t);if(s.protocol!=="https:"||s.username||s.password||s.search||s.hash)throw new Error("Hosted model stream API URL is invalid.");return l(async function*(a){if(a.model!==r)throw new Error("Hosted model selection changed outside host admission.");yield*Ae({...a,apiBaseUrl:s.toString(),token:e,model:r})},"streamHostedModel")}l(oe,"createHostedModelStreamFromEnvironment");import{existsSync as Mt}from"node:fs";import{lstat as Nt,readFile as qt,realpath as Dt}from"node:fs/promises";import y from"node:path";import{fileURLToPath as Bt}from"node:url";var Qe=y.dirname(Bt(import.meta.url));function R(n,e,t){let r=n[e+1];if(!r||r.startsWith("--"))throw new Error(`${t} requires a value.`);return r}l(R,"requireValue");function et(n,e){let t=Number.parseInt(n,10);if(!Number.isFinite(t)||t<0||t>65535)throw new Error(`${e} must be a port from 0 to 65535.`);return t}l(et,"parsePort");function nt(n){let e="serve",t=Q,r=17874,s=null,i=!1,a=!1,c=null,p,u=!1,m,w,I,C=null,f=null,h=null,S=null,P,v="sqlite_bundle",A=0,E=n[0];if(E&&!E.startsWith("-")){if(E==="serve"||E==="server")e="serve";else if(E==="app-server")e="app-server";else if(E==="web")e="web";else{if(E==="help")return{mode:e,host:t,port:r,webRoot:s,openBrowser:i,printAccessUrl:a,storeDir:c,runtimeStorage:v,help:!0};throw new Error(`Unknown command: ${E}`)}A=1}for(let g=A;g<n.length;g+=1){let d=n[g];if(d==="--help"||d==="-h")return{mode:e,host:t,port:r,webRoot:s,openBrowser:i,printAccessUrl:a,storeDir:c,runtimeStorage:v,help:!0};if(d==="--listen"){let O=Ce(R(n,g,d));t=O.host,r=et(String(O.port),d),g+=1}else if(d==="--hostname"||d==="--host")t=R(n,g,d),g+=1;else if(d==="--port")r=et(R(n,g,d),d),g+=1;else if(d==="--web-root")s=y.resolve(R(n,g,d)),g+=1;else if(d==="--source-browser-state")I=y.resolve(R(n,g,d)),g+=1;else{if(d==="--store-dir")throw new Error("--store-dir has been replaced by --home. Use --home <directory> or OPENPOND_HOME.");if(d==="--home")c=y.resolve(R(n,g,d)),g+=1;else if(d==="--hosted-cache-home")p=y.resolve(R(n,g,d)),g+=1;else if(d==="--experiment-owner")u=!0;else if(d==="--experiment-harness-package"){if(m)throw new Error("Duplicate Experiment Harness source package.");m=y.resolve(R(n,g,d)),g+=1}else if(d==="--runtime-storage"){if(R(n,g,d)!=="hosted-postgres")throw new Error("Unsupported app-server runtime storage.");v="hosted_postgres",g+=1}else if(d==="--profile-external-dataset-package"){if(w)throw new Error("Duplicate private external Dataset package.");w=y.resolve(R(n,g,d)),g+=1}else if(d==="--profile-source-root")C=y.resolve(R(n,g,d)),g+=1;else if(d==="--profile-repository-id")f=R(n,g,d),g+=1;else if(d==="--profile-id")h=R(n,g,d),g+=1;else if(d==="--profile-revision")S=R(n,g,d),g+=1;else if(d==="--hosted-profile-release"){if(P)throw new Error("Duplicate hosted Profile release descriptor.");let O=R(n,g,d);if(O.length>16e3||!/^[A-Za-z0-9_-]+$/.test(O))throw new Error("Invalid hosted Profile release descriptor.");try{P=Ne.parse(JSON.parse(Buffer.from(O,"base64url").toString("utf8")))}catch{throw new Error("Invalid hosted Profile release descriptor.")}g+=1}else if(d==="--open-browser")i=!0;else if(d==="--print-access-url")a=!0;else throw new Error(`Unknown option: ${d}`)}}if(i&&a)throw new Error("--open-browser and --print-access-url cannot be used together.");if(e!=="web"&&(i||a))throw new Error("Browser options are only available in web mode.");let D=[C,f,h,S].filter(Boolean).length;if(D&&(D!==4||e!=="app-server"))throw new Error("Profile source flags require app-server mode and --profile-source-root, --profile-repository-id, --profile-id, and --profile-revision together.");if(v==="hosted_postgres"&&(e!=="app-server"||c||D))throw new Error("Hosted Postgres app-server cannot use --home or local Profile source flags.");if(P&&v!=="hosted_postgres")throw new Error("Hosted Profile release requires hosted Postgres app-server mode.");if(p&&v!=="hosted_postgres")throw new Error("Hosted cache home requires hosted Postgres mode.");if(u&&(e!=="app-server"||v!=="sqlite_bundle"||D||!c))throw new Error("Experiment owner mode requires an isolated app-server home without Profile selection.");if(m&&(!u||y.dirname(m)!==c))throw new Error("Experiment Harness source must be provisioned directly inside its isolated owner home.");return{mode:e,host:t,port:r,webRoot:s,openBrowser:i,printAccessUrl:a,storeDir:c,runtimeStorage:v,sourceBrowserState:I,...w?{profileExternalDatasetPackage:w}:{},...D?{profileSource:{repoPath:C,repositoryId:f,profileId:h,sourceRevision:S}}:{},...P?{admittedProfileRelease:P}:{},...p?{hostedCacheHome:p}:{},...u?{experimentOwner:!0}:{},...m?{experimentHarnessPackage:m}:{},help:!1}}l(nt,"parseCliArgs");function Ft(){return[process.env.OPENPOND_WEB_ROOT,y.resolve(process.cwd(),"apps/web/dist"),y.resolve(Qe,"../../web/dist"),y.resolve(process.cwd(),"web"),y.resolve(Qe,"../web")].filter(n=>!!n)}l(Ft,"defaultWebRootCandidates");function jt(n){let e=n?[n]:Ft();for(let t of e){let r=y.resolve(t);if(Mt(y.join(r,"index.html")))return r}return null}l(jt,"resolveWebRoot");function Lt(n){let e=n==="0.0.0.0"||n==="::"?"127.0.0.1":n;return e.includes(":")&&!e.startsWith("[")?`[${e}]`:e}l(Lt,"formatHostForUrl");function Vt(n){return`http://${Lt(n.status.host)}:${n.status.port}`}l(Vt,"browserBaseUrl");function $t(n,e){let t=new URL(n),r=new URLSearchParams;return r.set("openpondServerUrl",n),r.set("openpondToken",e),t.hash=r.toString(),t.toString()}l($t,"tokenizedWebUrl");async function tt(n,e=He){let t=$t(n.baseUrl,n.token);if(n.printAccessUrl)return{stdout:[`OpenPond access URL: ${t}`],stderr:[]};if(!n.openBrowser)return{stdout:[`OpenPond web UI: ${n.baseUrl}`],stderr:[]};let r=await e(t);return r.opened?{stdout:[`Opened OpenPond in your browser: ${n.baseUrl}`],stderr:[]}:{stdout:[`OpenPond access URL: ${t}`],stderr:[`Could not open the system browser: ${r.error}`]}}l(tt,"resolveWebLaunchMessages");function st(){console.log(`Usage:
24
24
  openpond-app-server serve [--hostname HOST] [--port PORT]
25
25
  openpond-app-server app-server [--home DIR]
26
26
  openpond-app-server web [--hostname HOST] [--port PORT] [--web-root DIR]
@@ -39,4 +39,4 @@ Options:
39
39
  --profile-revision REV Accepted immutable source revision
40
40
  --open-browser Open the authenticated web URL in the system browser
41
41
  --print-access-url Print the authenticated URL instead of opening it
42
- `)}l(st,"printHelp");async function yn(n){let e=nt(process.argv.slice(2));if(e.help){st();return}let t=e.mode==="web"?jt(e.webRoot):null;if(e.mode==="web"&&!t)throw new Error("Could not find a built OpenPond web UI. Run `pnpm build:web` or pass --web-root.");if(e.mode==="app-server"){await ot(n.createOpenPondAppServer,e.storeDir,e.profileSource,e.runtimeStorage,e.admittedProfileRelease,e.hostedCacheHome,e.experimentOwner,e.experimentHarnessPackage,e.profileExternalDatasetPackage);return}e.storeDir&&(process.env.OPENPOND_HOME=e.storeDir);let r,s=e.port;for(;;)try{r=await n.createOpenPondServer({host:e.host,port:s,webRoot:t,sourceBrowserState:e.sourceBrowserState,...e.storeDir?{storeDir:e.storeDir}:{},httpEnabled:!0,onStorageProgress:l(p=>console.log(`${_e}${JSON.stringify(p)}`),"onStorageProgress")});break}catch(p){if(!Ge(p))throw p;let u=await Je(ae({home:e.storeDir??void 0}),s,p);s=u.port,console.log(`OPENPOND_APP_SERVER_READY ${JSON.stringify({mode:"recovery",url:u.url,tokenFile:u.tokenFile,storePath:u.storePath})}`),console.error(`${p.issue.code}: ${p.issue.message} ${p.issue.action}`);let m=await tt({baseUrl:u.url,openBrowser:e.openBrowser,printAccessUrl:e.printAccessUrl,token:u.token});for(let I of m.stdout)console.log(I);for(let I of m.stderr)console.error(I);let w=l(()=>{u.close().finally(()=>process.exit(0))},"close");process.once("SIGINT",w),process.once("SIGTERM",w);try{await u.repaired}finally{process.off("SIGINT",w),process.off("SIGTERM",w),await u.close()}}let i=e.mode==="web"?Vt(r):null;if(console.log(`OPENPOND_APP_SERVER_READY ${JSON.stringify({mode:e.mode,url:r.url,webUrl:null,webRoot:t,tokenFile:r.tokenFile,storePath:r.storePath,runtime:Oe()})}`),i){let p=await tt({baseUrl:i,openBrowser:e.openBrowser,printAccessUrl:e.printAccessUrl,token:r.token});for(let u of p.stderr)console.error(u);for(let u of p.stdout)console.log(u)}else console.log(`OpenPond API server: ${r.url}`);let a=!1,c=l(async()=>{a||(a=!0,await r.close(),process.exit(0))},"shutdown");process.on("SIGINT",()=>{c()}),process.on("SIGTERM",()=>{c()}),await new Promise(()=>{})}l(yn,"runOpenPondServerCli");async function Rn(n){let e=process.argv.slice(2),t=nt(!e[0]||e[0].startsWith("-")?["app-server",...e]:e);if(t.help){st();return}if(t.mode!=="app-server")throw new Error("The app-server entrypoint only accepts the app-server command.");await ot(n,t.storeDir,t.profileSource,t.runtimeStorage,t.admittedProfileRelease,t.hostedCacheHome,t.experimentOwner,t.experimentHarnessPackage,t.profileExternalDatasetPackage)}l(Rn,"runOpenPondAppServerCli");async function ot(n,e,t,r="sqlite_bundle",s,i,a=!1,c,p){let u=new Me;if(r==="hosted_postgres"){if(e||t)throw new Error("Hosted Postgres app-server cannot use local storage sources.");let f=p?await(i&&s?.hostExecution&&!a?te(p,i):Promise.reject(new Error("External Dataset requires its private hosted evaluation owner."))):void 0;await ee({appServer:l(()=>n({...i?{storeDir:i}:{},hostStorageClient:u,...f?{profileExternalDataset:f}:{},runtimeStorage:{kind:"hosted_postgres",client:u,core:Ze(u),inbox:new q(u),...s?{admittedProfileRelease:s}:{}},streamOpenPondHostedChatTurn:oe()}),"appServer"),readable:process.stdin,writable:process.stdout,hostStorageClient:u});return}e&&(process.env.OPENPOND_HOME=e);let m;if(c){if(!a||!e||y.dirname(c)!==e||await Dt(c)!==c)throw new Error("Experiment Harness source escaped its isolated owner home.");let f=await Nt(c);if(!f.isFile()||f.size>67108864)throw new Error("Experiment Harness source package is not a bounded regular file.");m={ownerId:"host-experiment-case",sourcePackage:Ie(JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(await qt(c))))}}let w=p?await(e&&t&&!a?te(p,e):Promise.reject(new Error("External Dataset bootstrap requires a private explicit Profile owner."))):void 0,I=w?oe():void 0,C=await n({...e?{storeDir:e}:{},...t?{profileSource:t}:{},...w?{profileExternalDataset:w,profileExternalDatasetClient:u,streamOpenPondHostedChatTurn:l(async function*(f){let h=l(async()=>{await u.request({contractVersion:1,requestId:crypto.randomUUID(),operation:"profile.externalDataset.authorize",params:{bindingHash:w.binding.contentHash}})},"fence");await h();let S=new AbortController,P=!1,v=setInterval(()=>{P||S.signal.aborted||(P=!0,h().catch(A=>S.abort(A)).finally(()=>{P=!1}))},2e3);try{let A=AbortSignal.any([...f.signal?[f.signal]:[],S.signal]);A.throwIfAborted();for await(let E of I({...f,signal:A}))await h(),A.throwIfAborted(),yield E}finally{clearInterval(v),S.abort()}},"streamOpenPondHostedChatTurn"),services:{webSearch:!1,scheduling:!1,connectedApps:!1,tasksets:!1,projectActions:!1,profileActions:!1,backgroundReview:!1}}:{},...m?{experimentHarnessSource:m}:{},...a?{experimentPolicyClient:u,services:{webSearch:!1,scheduling:!1,connectedApps:!1,tasksets:!1,projectActions:!1,profileActions:!1,backgroundReview:!1}}:{},hostStorageClient:u});await ee({appServer:C,readable:process.stdin,writable:process.stdout,hostStorageClient:u})}l(ot,"runAgentServer");export{Be as a,j as b,Le as c,x as d,Yt as e,Xt as f,re as g,Ve as h,tt as i,yn as j,Rn as k};
42
+ `)}l(st,"printHelp");async function yn(n){let e=nt(process.argv.slice(2));if(e.help){st();return}let t=e.mode==="web"?jt(e.webRoot):null;if(e.mode==="web"&&!t)throw new Error("Could not find a built OpenPond web UI. Run `pnpm build:web` or pass --web-root.");if(e.mode==="app-server"){await ot(n.createOpenPondAppServer,e.storeDir,e.profileSource,e.runtimeStorage,e.admittedProfileRelease,e.hostedCacheHome,e.experimentOwner,e.experimentHarnessPackage,e.profileExternalDatasetPackage);return}e.storeDir&&(process.env.OPENPOND_HOME=e.storeDir);let r,s=e.port;for(;;)try{r=await n.createOpenPondServer({host:e.host,port:s,webRoot:t,sourceBrowserState:e.sourceBrowserState,...e.storeDir?{storeDir:e.storeDir}:{},httpEnabled:!0,onStorageProgress:l(p=>console.log(`${_e}${JSON.stringify(p)}`),"onStorageProgress")});break}catch(p){if(!Ge(p))throw p;let u=await Je(le({home:e.storeDir??void 0}),s,p);s=u.port,console.log(`OPENPOND_APP_SERVER_READY ${JSON.stringify({mode:"recovery",url:u.url,tokenFile:u.tokenFile,storePath:u.storePath})}`),console.error(`${p.issue.code}: ${p.issue.message} ${p.issue.action}`);let m=await tt({baseUrl:u.url,openBrowser:e.openBrowser,printAccessUrl:e.printAccessUrl,token:u.token});for(let I of m.stdout)console.log(I);for(let I of m.stderr)console.error(I);let w=l(()=>{u.close().finally(()=>process.exit(0))},"close");process.once("SIGINT",w),process.once("SIGTERM",w);try{await u.repaired}finally{process.off("SIGINT",w),process.off("SIGTERM",w),await u.close()}}let i=e.mode==="web"?Vt(r):null;if(console.log(`OPENPOND_APP_SERVER_READY ${JSON.stringify({mode:e.mode,url:r.url,webUrl:null,webRoot:t,tokenFile:r.tokenFile,storePath:r.storePath,runtime:Oe()})}`),i){let p=await tt({baseUrl:i,openBrowser:e.openBrowser,printAccessUrl:e.printAccessUrl,token:r.token});for(let u of p.stderr)console.error(u);for(let u of p.stdout)console.log(u)}else console.log(`OpenPond API server: ${r.url}`);let a=!1,c=l(async()=>{a||(a=!0,await r.close(),process.exit(0))},"shutdown");process.on("SIGINT",()=>{c()}),process.on("SIGTERM",()=>{c()}),await new Promise(()=>{})}l(yn,"runOpenPondServerCli");async function Rn(n){let e=process.argv.slice(2),t=nt(!e[0]||e[0].startsWith("-")?["app-server",...e]:e);if(t.help){st();return}if(t.mode!=="app-server")throw new Error("The app-server entrypoint only accepts the app-server command.");await ot(n,t.storeDir,t.profileSource,t.runtimeStorage,t.admittedProfileRelease,t.hostedCacheHome,t.experimentOwner,t.experimentHarnessPackage,t.profileExternalDatasetPackage)}l(Rn,"runOpenPondAppServerCli");async function ot(n,e,t,r="sqlite_bundle",s,i,a=!1,c,p){let u=new Me;if(r==="hosted_postgres"){if(e||t)throw new Error("Hosted Postgres app-server cannot use local storage sources.");let f=p?await(i&&s?.hostExecution&&!a?te(p,i):Promise.reject(new Error("External Dataset requires its private hosted evaluation owner."))):void 0;await ee({appServer:l(()=>n({...i?{storeDir:i}:{},hostStorageClient:u,...f?{profileExternalDataset:f}:{},runtimeStorage:{kind:"hosted_postgres",client:u,core:Ze(u),inbox:new q(u),...s?{admittedProfileRelease:s}:{}},streamOpenPondHostedChatTurn:oe()}),"appServer"),readable:process.stdin,writable:process.stdout,hostStorageClient:u});return}e&&(process.env.OPENPOND_HOME=e);let m;if(c){if(!a||!e||y.dirname(c)!==e||await Dt(c)!==c)throw new Error("Experiment Harness source escaped its isolated owner home.");let f=await Nt(c);if(!f.isFile()||f.size>67108864)throw new Error("Experiment Harness source package is not a bounded regular file.");m={ownerId:"host-experiment-case",sourcePackage:ie(JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(await qt(c))))}}let w=p?await(e&&t&&!a?te(p,e):Promise.reject(new Error("External Dataset bootstrap requires a private explicit Profile owner."))):void 0,I=w?oe():void 0,C=await n({...e?{storeDir:e}:{},...t?{profileSource:t}:{},...w?{profileExternalDataset:w,profileExternalDatasetClient:u,streamOpenPondHostedChatTurn:l(async function*(f){let h=l(async()=>{await u.request({contractVersion:1,requestId:crypto.randomUUID(),operation:"profile.externalDataset.authorize",params:{bindingHash:w.binding.contentHash}})},"fence");await h();let S=new AbortController,P=!1,v=setInterval(()=>{P||S.signal.aborted||(P=!0,h().catch(A=>S.abort(A)).finally(()=>{P=!1}))},2e3);try{let A=AbortSignal.any([...f.signal?[f.signal]:[],S.signal]);A.throwIfAborted();for await(let E of I({...f,signal:A}))await h(),A.throwIfAborted(),yield E}finally{clearInterval(v),S.abort()}},"streamOpenPondHostedChatTurn"),services:{webSearch:!1,scheduling:!1,connectedApps:!1,tasksets:!1,projectActions:!1,profileActions:!1,backgroundReview:!1}}:{},...m?{experimentHarnessSource:m}:{},...a?{experimentPolicyClient:u,services:{webSearch:!1,scheduling:!1,connectedApps:!1,tasksets:!1,projectActions:!1,profileActions:!1,backgroundReview:!1}}:{},hostStorageClient:u});await ee({appServer:C,readable:process.stdin,writable:process.stdout,hostStorageClient:u})}l(ot,"runAgentServer");export{Be as a,j as b,Le as c,x as d,Yt as e,Xt as f,re as g,Ve as h,tt as i,yn as j,Rn as k};