openpond 0.2.62 → 0.2.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (496) hide show
  1. package/README.md +2 -0
  2. package/dist/app-server.d.ts +1053 -63
  3. package/dist/app-server.js +1 -1
  4. package/dist/chunks/{acp-DYRBDJRU.js → acp-H3MJCPHX.js} +1 -1
  5. package/dist/chunks/{acp-agent-UTLP7C3I.js → acp-agent-DWA7272M.js} +1 -1
  6. package/dist/chunks/actions-command-IIYOO4LL.js +2 -0
  7. package/dist/chunks/{app-layer-N2H3RBEN.js → app-layer-K7H2WJ56.js} +1 -1
  8. package/dist/chunks/app-server-connected-apps-RM5E2VWF.js +2 -0
  9. package/dist/chunks/app-server-evaluations-XGMGS67X.js +2 -0
  10. package/dist/chunks/app-server-harness-services-BHD6S5II.js +2 -0
  11. package/dist/chunks/app-server-runtime-LFIL6F7D.js +2 -0
  12. package/dist/chunks/apps-QKAHJGQ4.js +2 -0
  13. package/dist/chunks/chunk-25XXZS3E.js +2 -0
  14. package/dist/chunks/chunk-27JGS3KB.js +12 -0
  15. package/dist/chunks/{chunk-7JBB4PXS.js → chunk-2HAWOMZK.js} +1 -1
  16. package/dist/chunks/chunk-2LJCJOJ7.js +2 -0
  17. package/dist/chunks/{chunk-CN5OXQ7A.js → chunk-3YXYBYWK.js} +1 -1
  18. package/dist/chunks/{chunk-GEKORCMN.js → chunk-42V4NV2F.js} +1 -1
  19. package/dist/chunks/{chunk-VAJSRUAB.js → chunk-4FNCBA3Y.js} +1 -1
  20. package/dist/chunks/{chunk-F7D4BMTO.js → chunk-4L6DU6Z2.js} +1 -1
  21. package/dist/chunks/{chunk-SZKFNKWO.js → chunk-4SZ3HKHU.js} +1 -1
  22. package/dist/chunks/chunk-5EP2DZLJ.js +2 -0
  23. package/dist/chunks/chunk-5FU5RLML.js +2 -0
  24. package/dist/chunks/{chunk-6SH4B7DV.js → chunk-5MHYGMJG.js} +1 -1
  25. package/dist/chunks/{chunk-MEK7DLX3.js → chunk-6EBCS57F.js} +1 -1
  26. package/dist/chunks/chunk-6RS4NAOY.js +2 -0
  27. package/dist/chunks/{chunk-NVHZRKXB.js → chunk-7HRLWPPZ.js} +1 -1
  28. package/dist/chunks/chunk-7O6Z3VOZ.js +2 -0
  29. package/dist/chunks/{chunk-P74RR2GB.js → chunk-7WYL2IDD.js} +1 -1
  30. package/dist/chunks/chunk-7YLXGILH.js +2 -0
  31. package/dist/chunks/chunk-7ZLXFKRI.js +2 -0
  32. package/dist/chunks/{chunk-NWOK6NLE.js → chunk-AH26AQN7.js} +1 -1
  33. package/dist/chunks/chunk-AHOBCBVZ.js +2 -0
  34. package/dist/chunks/chunk-B5R53U74.js +2 -0
  35. package/dist/chunks/{chunk-NKZNPTLA.js → chunk-BPZOABMC.js} +1 -1
  36. package/dist/chunks/{chunk-2IIBCCOK.js → chunk-BSPFY3Y5.js} +1 -1
  37. package/dist/chunks/{chunk-5OSM75X5.js → chunk-BU27SLZP.js} +2 -2
  38. package/dist/chunks/chunk-C2AXMKK4.js +2 -0
  39. package/dist/chunks/{chunk-AMO5DVKM.js → chunk-C2LAEGOW.js} +2 -2
  40. package/dist/chunks/{chunk-GNCEZ3UP.js → chunk-CZ5R4JXZ.js} +1 -1
  41. package/dist/chunks/{chunk-JIFUGA3U.js → chunk-DABBHWSF.js} +1 -1
  42. package/dist/chunks/{chunk-VK4TPZTA.js → chunk-DLANLLKH.js} +1 -1
  43. package/dist/chunks/{chunk-WGLVSGFA.js → chunk-DQI5TE6A.js} +2 -2
  44. package/dist/chunks/chunk-DTTFUANI.js +12 -0
  45. package/dist/chunks/{chunk-4TM75R7V.js → chunk-DUL6DXOI.js} +1 -1
  46. package/dist/chunks/{chunk-TGEGXTPR.js → chunk-ELX7VRSU.js} +1 -1
  47. package/dist/chunks/chunk-ERL2M773.js +3 -0
  48. package/dist/chunks/{chunk-4PZWGNX4.js → chunk-ERT32RZA.js} +4 -4
  49. package/dist/chunks/{chunk-RTJCELRR.js → chunk-EZRUWIP6.js} +1 -1
  50. package/dist/chunks/{chunk-LJDBR3RN.js → chunk-F6UQ6PPK.js} +1 -1
  51. package/dist/chunks/chunk-F7QTIHXX.js +2 -0
  52. package/dist/chunks/chunk-FAKDGLZQ.js +8 -0
  53. package/dist/chunks/{chunk-FFWOTZQM.js → chunk-FVRII5XO.js} +1 -1
  54. package/dist/chunks/{chunk-C7M2WBWZ.js → chunk-FYYYECHE.js} +51 -49
  55. package/dist/chunks/chunk-G32BO6M5.js +4 -0
  56. package/dist/chunks/{chunk-NBE74GLF.js → chunk-G6OR5NB6.js} +1 -1
  57. package/dist/chunks/{chunk-GQGLPKU4.js → chunk-GGJUWIGR.js} +1 -1
  58. package/dist/chunks/{chunk-VSQXDS6H.js → chunk-GPL2Z65R.js} +1 -1
  59. package/dist/chunks/{chunk-INO67SEN.js → chunk-GS6ZUSIN.js} +2 -2
  60. package/dist/chunks/{chunk-47AXSBPV.js → chunk-GVARQXYI.js} +1 -1
  61. package/dist/chunks/chunk-GXCUH2VV.js +17 -0
  62. package/dist/chunks/{chunk-OCC43RSJ.js → chunk-GXZCMO6S.js} +1 -1
  63. package/dist/chunks/{chunk-CLFYRN46.js → chunk-H6C4MAUN.js} +1 -1
  64. package/dist/chunks/{chunk-HBLN4OLY.js → chunk-HUCBKXTU.js} +1 -1
  65. package/dist/chunks/{chunk-M5IX6VUA.js → chunk-IHB5GTOJ.js} +2 -2
  66. package/dist/chunks/{chunk-J3B2GM4A.js → chunk-IWWXIUAQ.js} +1 -1
  67. package/dist/chunks/chunk-J572ANHX.js +13 -0
  68. package/dist/chunks/{chunk-AKZPMKWP.js → chunk-J7ZTPXRQ.js} +1 -1
  69. package/dist/chunks/{chunk-CJUVHE4U.js → chunk-JORRZ4BB.js} +1 -1
  70. package/dist/chunks/chunk-JSQRLLN6.js +2 -0
  71. package/dist/chunks/chunk-KCOTDUGW.js +2 -0
  72. package/dist/chunks/{chunk-NK4JKB7C.js → chunk-KHTAAVC2.js} +1 -1
  73. package/dist/chunks/{chunk-LRRBYIGH.js → chunk-LK2K3SPM.js} +2 -2
  74. package/dist/chunks/{chunk-557XSPVS.js → chunk-LKKMLBOH.js} +1 -1
  75. package/dist/chunks/{chunk-U456UP3N.js → chunk-LSZJ5M3X.js} +1 -1
  76. package/dist/chunks/chunk-M3FLEZ4E.js +4 -0
  77. package/dist/chunks/{chunk-Y2KPHVZK.js → chunk-M3SCON53.js} +1 -1
  78. package/dist/chunks/{chunk-VPDG2V2R.js → chunk-MEGKXGW3.js} +1 -1
  79. package/dist/chunks/chunk-MPNJ2BB4.js +2 -0
  80. package/dist/chunks/{chunk-4RZBGKT7.js → chunk-N33D7KCW.js} +1 -1
  81. package/dist/chunks/chunk-N42HT64M.js +2 -0
  82. package/dist/chunks/{chunk-SD64CLJX.js → chunk-N4VHLJBZ.js} +1 -1
  83. package/dist/chunks/chunk-NEJLJ2XY.js +2 -0
  84. package/dist/chunks/chunk-NG2L6D7G.js +2 -0
  85. package/dist/chunks/{chunk-GV3LFSMI.js → chunk-NLYZ5K7U.js} +1 -1
  86. package/dist/chunks/{chunk-F4TJ7WQV.js → chunk-NT7N6KLE.js} +1 -1
  87. package/dist/chunks/{chunk-PAE3PQEC.js → chunk-NZTCH6K5.js} +1 -1
  88. package/dist/chunks/{chunk-BEI4YULC.js → chunk-OG33QAG6.js} +1 -1
  89. package/dist/chunks/chunk-OTUBJV6C.js +6 -0
  90. package/dist/chunks/{chunk-RH43WLBX.js → chunk-PBTXLQAU.js} +1 -1
  91. package/dist/chunks/{chunk-3R4MSE2S.js → chunk-QJ6KUVAR.js} +1 -1
  92. package/dist/chunks/{chunk-7JXZNCBC.js → chunk-QU4UE73E.js} +1 -1
  93. package/dist/chunks/{chunk-WQMXEZVE.js → chunk-R6VJDOQM.js} +3 -3
  94. package/dist/chunks/{chunk-FUSCTBJI.js → chunk-R6WMY6AH.js} +1 -1
  95. package/dist/chunks/{chunk-EIX2V2KU.js → chunk-RDSVU6F6.js} +1 -1
  96. package/dist/chunks/{chunk-R4PDSOB4.js → chunk-RFMME46Z.js} +1 -1
  97. package/dist/chunks/{chunk-GW5SE3FM.js → chunk-RZUCVF2Q.js} +1 -1
  98. package/dist/chunks/{chunk-UC3FXTDL.js → chunk-SFKZITAG.js} +5 -5
  99. package/dist/chunks/{chunk-5A6ER3M2.js → chunk-SHJY5RLU.js} +1 -1
  100. package/dist/chunks/chunk-SI5W5LBV.js +2 -0
  101. package/dist/chunks/chunk-SO42ZB5K.js +2 -0
  102. package/dist/chunks/{chunk-2UDAKLJ4.js → chunk-TCOTXCV6.js} +1 -1
  103. package/dist/chunks/{chunk-QCSLEMZF.js → chunk-U2K7QJCG.js} +1 -1
  104. package/dist/chunks/{chunk-ISIXFK6U.js → chunk-UH4JSSRL.js} +28 -28
  105. package/dist/chunks/{chunk-X4ZT22SG.js → chunk-UPWJSNL5.js} +1 -1
  106. package/dist/chunks/chunk-URNMC46H.js +157 -0
  107. package/dist/chunks/{chunk-NLQ2UPN2.js → chunk-V7KR74NO.js} +1 -1
  108. package/dist/chunks/{chunk-HXZXDDKW.js → chunk-VHXDWAEH.js} +1 -1
  109. package/dist/chunks/{chunk-NE4ESZPT.js → chunk-W2TICQ62.js} +1 -1
  110. package/dist/chunks/chunk-WP2L2NY2.js +2 -0
  111. package/dist/chunks/chunk-WSOUMXH3.js +24 -0
  112. package/dist/chunks/chunk-WWQNMC7C.js +6 -0
  113. package/dist/chunks/chunk-XMHIQ3SK.js +5 -0
  114. package/dist/chunks/{chunk-5MTN6KXV.js → chunk-XNOMIWEY.js} +1 -1
  115. package/dist/chunks/{chunk-ZXT7V64X.js → chunk-XOB6FKQV.js} +1 -1
  116. package/dist/chunks/chunk-Y766IN7Y.js +2 -0
  117. package/dist/chunks/chunk-YCZZ62C2.js +2 -0
  118. package/dist/chunks/chunk-YM4PSVFW.js +4 -0
  119. package/dist/chunks/chunk-YNQWJWIC.js +10 -0
  120. package/dist/chunks/{chunk-GSWBNJGZ.js → chunk-Z3BWCFLV.js} +1 -1
  121. package/dist/chunks/{chunk-GOIKLFXK.js → chunk-ZG6353RM.js} +1 -1
  122. package/dist/chunks/{chunk-T6C5BNXK.js → chunk-ZPTKR3GB.js} +1 -1
  123. package/dist/chunks/{chunk-MNXNZDDW.js → chunk-ZYVHOVKL.js} +1 -1
  124. package/dist/chunks/chunk-ZZHXQCNB.js +22 -0
  125. package/dist/chunks/cli-PSXMIJTF.js +2 -0
  126. package/dist/chunks/{configuration-command-BU2RPG33.js → configuration-command-XYKMXIWF.js} +1 -1
  127. package/dist/chunks/connected-app-executor-6G2LA3PQ.js +2 -0
  128. package/dist/chunks/connected-evidence-IRXYN6YD.js +2 -0
  129. package/dist/chunks/{connected-starting-assets-V5QXRK5Q.js → connected-starting-assets-JONPTII6.js} +1 -1
  130. package/dist/chunks/{continual-FLW6DAJK.js → continual-Z7MO2PF6.js} +1 -1
  131. package/dist/chunks/core-commands-WWN7X3XC.js +2 -0
  132. package/dist/chunks/dataset-preparation-authoring-F3OZIQSP.js +4 -0
  133. package/dist/chunks/datasets-2PC2HP7N.js +2 -0
  134. package/dist/chunks/desktop-test-VU6AFAMO.js +3 -0
  135. package/dist/chunks/dist-47AYOIH6.js +2 -0
  136. package/dist/chunks/{dist-DCSLPBO2.js → dist-MXBEBM4D.js} +1 -1
  137. package/dist/chunks/evaluation-coordination-UOWZHHC5.js +2 -0
  138. package/dist/chunks/experiment-improvements-EB2CV5RA.js +2 -0
  139. package/dist/chunks/experiments-SZQYR6MH.js +2 -0
  140. package/dist/chunks/experiments-signal-2KJCP25D.js +2 -0
  141. package/dist/chunks/{help-PXUUREHZ.js → help-7HXFWIKS.js} +1 -1
  142. package/dist/chunks/host-profile-evaluation-tools-Y2LQ4WQN.js +2 -0
  143. package/dist/chunks/host-profile-external-dataset-FRIGXOO7.js +2 -0
  144. package/dist/chunks/hosted-app-server-composition-PGKQNDW6.js +2 -0
  145. package/dist/chunks/hosted-experiment-improvement-UXC542SZ.js +3 -0
  146. package/dist/chunks/hosted-harness-runtime-6PEI7F2U.js +2 -0
  147. package/dist/chunks/hosted-profile-candidate-HM44BIUX.js +3 -0
  148. package/dist/chunks/hosted-profile-compiler-UAZ4PHYE.js +2 -0
  149. package/dist/chunks/hosted-profile-evaluation-control-EUL57FAB.js +2 -0
  150. package/dist/chunks/hosted-profile-evaluation-inspection-7USY75Z4.js +3 -0
  151. package/dist/chunks/hosted-profile-evaluation-preparation-2LSMZQNA.js +3 -0
  152. package/dist/chunks/{hosted-tasksets-X2YCFYEJ.js → hosted-tasksets-WGXGXJ7E.js} +1 -1
  153. package/dist/chunks/human-review-M26UKGJL.js +2 -0
  154. package/dist/chunks/{import-JWZSZCE4.js → import-6SI4BEKS.js} +2 -2
  155. package/dist/chunks/learning-HM3NWOV5.js +2 -0
  156. package/dist/chunks/local-harness-improvement-runtime-QGWFWNSR.js +2 -0
  157. package/dist/chunks/local-harness-taskset-review-KS4WPMN6.js +2 -0
  158. package/dist/chunks/model-projects-YUAMBQTO.js +2 -0
  159. package/dist/chunks/opchat-AG4CWVY4.js +3 -0
  160. package/dist/chunks/opchat-bounded-chat-IQMP5IIO.js +2 -0
  161. package/dist/chunks/organizations-KDKX77XZ.js +2 -0
  162. package/dist/chunks/{profile-ELE2D7HU.js → profile-O5HL5DTQ.js} +1 -1
  163. package/dist/chunks/project-action-payload-QA24HYGF.js +2 -0
  164. package/dist/chunks/project-agent-XBOOM5TS.js +2 -0
  165. package/dist/chunks/published-experiment-source-GZGN354O.js +2 -0
  166. package/dist/chunks/refiner-profile-service-BJMOYKTC.js +2 -0
  167. package/dist/chunks/{runtime-776NUSE7.js → runtime-XBA744HJ.js} +2 -2
  168. package/dist/chunks/sandbox-command-5ECGS7DG.js +2 -0
  169. package/dist/chunks/{sandbox-template-WP6YCGBK.js → sandbox-template-27U3FQN7.js} +1 -1
  170. package/dist/chunks/saved-work-KUNVTJ7O.js +2 -0
  171. package/dist/chunks/{send-turn-RPB65PME.js → send-turn-FIPWOXWV.js} +1 -1
  172. package/dist/chunks/src-BLWX6DRG.js +424 -0
  173. package/dist/chunks/{src-2R4CMCJ5.js → src-PU7QTFO5.js} +1 -1
  174. package/dist/chunks/standalone-experiment-turn-owner-XIE46VNH.js +2 -0
  175. package/dist/chunks/store-chat-resources-YOEJ2BI6.js +2 -0
  176. package/dist/chunks/{store-continual-support-reviews-R62D2HD6.js → store-continual-support-reviews-FOMYYS25.js} +1 -1
  177. package/dist/chunks/{store-conversation-serving-25O7BAR2.js → store-conversation-serving-K324SQTO.js} +1 -1
  178. package/dist/chunks/{store-create-improve-T5E2GUKK.js → store-create-improve-3LQMIYAP.js} +1 -1
  179. package/dist/chunks/{store-datasets-5Y4U5L3R.js → store-datasets-3KSX7RSO.js} +1 -1
  180. package/dist/chunks/store-evaluation-results-LHCCNNE6.js +7 -0
  181. package/dist/chunks/{store-harness-evaluation-review-settings-I2R3HPO3.js → store-harness-evaluation-review-settings-AAN7KKJ5.js} +1 -1
  182. package/dist/chunks/{store-harness-refinement-candidates-SUT45FQX.js → store-harness-refinement-candidates-3PHL3BUY.js} +1 -1
  183. package/dist/chunks/store-harness-workspaces-ZHNCNWVI.js +2 -0
  184. package/dist/chunks/store-human-review-QJY3ZPPF.js +7 -0
  185. package/dist/chunks/store-learned-preference-migration-validation-X32SRBOM.js +2 -0
  186. package/dist/chunks/{store-learning-MFS4DGQR.js → store-learning-DW3QLQXU.js} +1 -1
  187. package/dist/chunks/{store-learning-credentials-BECWEG2Y.js → store-learning-credentials-67QNTPA7.js} +1 -1
  188. package/dist/chunks/{store-local-experiments-LOH4F4TF.js → store-local-experiments-QTVHJAEP.js} +1 -1
  189. package/dist/chunks/store-model-batch-review-PBYQZJJJ.js +2 -0
  190. package/dist/chunks/store-model-configuration-3SU73CMS.js +3 -0
  191. package/dist/chunks/store-model-project-preparation-TFCG2F2F.js +2 -0
  192. package/dist/chunks/store-ponder-history-WDLMXBIJ.js +2 -0
  193. package/dist/chunks/store-ponder-hosted-DX6E2BVW.js +4 -0
  194. package/dist/chunks/{store-preference-comparison-RNIFLJRW.js → store-preference-comparison-DWV5XSMY.js} +1 -1
  195. package/dist/chunks/{store-schedules-DVQ2PP4F.js → store-schedules-2KUY4T6M.js} +1 -1
  196. package/dist/chunks/{store-sidebar-file-bookmarks-LXWFFYCZ.js → store-sidebar-file-bookmarks-A4XCS7RM.js} +1 -1
  197. package/dist/chunks/{store-sidebar-preferences-4HH7LX6N.js → store-sidebar-preferences-V2PKRXUZ.js} +1 -1
  198. package/dist/chunks/{store-subagents-JLW4GD4Q.js → store-subagents-UGVEFA6M.js} +1 -1
  199. package/dist/chunks/store-task-inbox-QABI4ZAH.js +33 -0
  200. package/dist/chunks/{store-task-inventory-NJXRXFLC.js → store-task-inventory-GEQIZELY.js} +1 -1
  201. package/dist/chunks/store-taskset-drafts-GXABQR5G.js +9 -0
  202. package/dist/chunks/{store-training-VRLU6NFX.js → store-training-CQV7PL3V.js} +1 -1
  203. package/dist/chunks/{store-training-jobs-3ZHG4LGI.js → store-training-jobs-XKN6K66J.js} +18 -10
  204. package/dist/chunks/{store-training-models-KWQD5PRP.js → store-training-models-Q7DTTR4S.js} +1 -1
  205. package/dist/chunks/{store-usage-ZRS3ILF2.js → store-usage-XGAX7NLB.js} +1 -1
  206. package/dist/chunks/{taskset-QDMCQQDJ.js → taskset-ARKJQKYQ.js} +1 -1
  207. package/dist/chunks/taskset-packages-X4K65DTW.js +2 -0
  208. package/dist/chunks/taskset-packages-XK7FSD45.js +2 -0
  209. package/dist/chunks/{teams-bot-GF272RGC.js → teams-bot-UTQAJA6H.js} +1 -1
  210. package/dist/chunks/training-3IWW4256.js +2 -0
  211. package/dist/chunks/{training-DF5UEPY3.js → training-RVIESURJ.js} +1 -1
  212. package/dist/chunks/training-error-2EWDOQ4G.js +2 -0
  213. package/dist/chunks/training-hosted-PFJHYTEU.js +2 -0
  214. package/dist/chunks/training-hosted-checkpoint-evaluation-JJPP7KFW.js +2 -0
  215. package/dist/chunks/training-hosted-feedback-5B2KJGOT.js +2 -0
  216. package/dist/chunks/training-hosted-learning-Y7NHRY4V.js +2 -0
  217. package/dist/chunks/training-hosted-report-UVGTPDOK.js +2 -0
  218. package/dist/chunks/training-hosted-serving-report-OX4A5OKB.js +2 -0
  219. package/dist/chunks/training-hosted-workers-LST4ZUXN.js +2 -0
  220. package/dist/chunks/training-model-start-ROLS3E4V.js +2 -0
  221. package/dist/chunks/{web-search-5RUXYIOF.js → web-search-7FBUBZ66.js} +1 -1
  222. package/dist/chunks/{workspaces-JRY2IE7H.js → workspaces-G3CMY7ZA.js} +1 -1
  223. package/dist/cli.js +1 -1
  224. package/dist/index.js +1 -1
  225. package/dist/sandbox/url.d.ts +3 -1
  226. package/dist/skills/LICENSE +21 -0
  227. package/dist/skills/manifest.json +168 -0
  228. package/dist/skills/openpond-agent-authoring/SKILL.md +9 -3
  229. package/dist/skills/openpond-agent-authoring/references/profile-layout.md +1 -1
  230. package/dist/skills/openpond-agent-authoring/references/validation-and-repair.md +2 -2
  231. package/dist/skills/openpond-cli/SKILL.md +11 -7
  232. package/dist/skills/openpond-cli/references/experiments-and-training.md +1 -1
  233. package/dist/skills/openpond-refiner-authoring/SKILL.md +4 -0
  234. package/dist/skills/openpond-skill-authoring/SKILL.md +5 -1
  235. package/dist/web/assets/App-DY2R8Z6r.js +53 -0
  236. package/dist/web/assets/{AppDialog-BurL61qE.js → AppDialog-8Y0FYalT.js} +1 -1
  237. package/dist/web/assets/AppTerminalPanel-YcnBD5DF.js +2 -0
  238. package/dist/web/assets/{AppToastContext-DZLErwj0.js → AppToastContext-BiQbbVxq.js} +1 -1
  239. package/dist/web/assets/AppsView-Dtte4h6e.js +1 -0
  240. package/dist/web/assets/{AttachmentTypeIcon-CpMSfHCK.js → AttachmentTypeIcon-DgADV7dn.js} +1 -1
  241. package/dist/web/assets/BrowserSidebar-BUqDvEv9.js +1 -0
  242. package/dist/web/assets/{CartesianChart-CEbM980A.js → CartesianChart-J4ChOjvG.js} +1 -1
  243. package/dist/web/assets/ChatTimelineEntry-DC93wlDa.js +8 -0
  244. package/dist/web/assets/ChatTimelineEntry-DztFb85D.css +1 -0
  245. package/dist/web/assets/{CollaborationTabs-DrKJmJZK.js → CollaborationTabs-CFCpk2Ck.js} +1 -1
  246. package/dist/web/assets/CommandMenu-EPPjB14H.js +1 -0
  247. package/dist/web/assets/{CommunityView-BzpIq1lD.js → CommunityView-Okydjpqm.js} +1 -1
  248. package/dist/web/assets/ComposerAttachments-RXCiE88M.js +2 -0
  249. package/dist/web/assets/{ComposerCreateImproveStrip-ChplO9YP.js → ComposerCreateImproveStrip-CSngc8-V.js} +1 -1
  250. package/dist/web/assets/{ConversationImportsSettings-DRHgc7j_.js → ConversationImportsSettings-DS73kyfj.js} +1 -1
  251. package/dist/web/assets/FilePagePreview-Qc4B0vue.js +2 -0
  252. package/dist/web/assets/{GetStartedView-CaBk_mX6.js → GetStartedView-DGFPQ1We.js} +1 -1
  253. package/dist/web/assets/{GettingStartedDialog-JtFLyU3F.js → GettingStartedDialog-DFBYQdHz.js} +1 -1
  254. package/dist/web/assets/{HostedModelLearningReview-hhcjDifK.js → HostedModelLearningReview-BDu3FlcU.js} +1 -1
  255. package/dist/web/assets/{HostedModelLearningSettings-CY8198Y1.js → HostedModelLearningSettings-CHaTHwC8.js} +1 -1
  256. package/dist/web/assets/HtmlVisual-C7GlEVfH.css +1 -0
  257. package/dist/web/assets/HtmlVisual-D9Mh7xds.js +81 -0
  258. package/dist/web/assets/LabModelVersionDetailPage-DgY7lAu5.js +1 -0
  259. package/dist/web/assets/{LabSkillSidebar-HibUEEko.js → LabSkillSidebar-BwtlThO7.js} +1 -1
  260. package/dist/web/assets/LabsRoute-BV7ZJGEw.js +101 -0
  261. package/dist/web/assets/MainChatThread-pzHKd_YN.js +2 -0
  262. package/dist/web/assets/MainPane-6OlLiKKb.js +10 -0
  263. package/dist/web/assets/MainPane-Dje-hfUM.css +1 -0
  264. package/dist/web/assets/NativeSetupTerminal-CPDChcMi.js +2 -0
  265. package/dist/web/assets/NativeSkillSidebar-BEJvt5_H.js +1 -0
  266. package/dist/web/assets/{NewProjectDialog-t9Imnb__.js → NewProjectDialog-CjrjgkTN.js} +1 -1
  267. package/dist/web/assets/{OutputsPage-CeGq_F1S.js → OutputsPage-jzx93QQ3.js} +1 -1
  268. package/dist/web/assets/{PageChrome-VHME5V8j.js → PageChrome-C1M13qG2.js} +1 -1
  269. package/dist/web/assets/{ProjectsPage-2TMZoEPB.js → ProjectsPage-DZrjlMp2.js} +1 -1
  270. package/dist/web/assets/RightChatPanelStack-BsxJg9sy.js +1 -0
  271. package/dist/web/assets/RightSidebarHomePanel-CCVQ9LMB.js +1 -0
  272. package/dist/web/assets/ScheduledWorkPage-Cw1ja2GF.js +1 -0
  273. package/dist/web/assets/{SettingsView-Y8f98GSE.css → SettingsView-Cc0376pY.css} +1 -1
  274. package/dist/web/assets/SettingsView-CckoIki3.js +5 -0
  275. package/dist/web/assets/TasksetDraftEditorPrimitives-ByC8bDjp.js +1 -0
  276. package/dist/web/assets/TeamChatView-OprnSKLF.js +1 -0
  277. package/dist/web/assets/{TerminalOverlay-DlhRpi-X.js → TerminalOverlay-d7A2F9Lx.js} +2 -2
  278. package/dist/web/assets/TrainingCreationPanel-Cyn6R6I6.js +1 -0
  279. package/dist/web/assets/{TrainingDraftPanel-BhhZPPuY.js → TrainingDraftPanel-Mpb5e7t5.js} +1 -1
  280. package/dist/web/assets/TrainingRunLineage-PXzWR65d.css +1 -0
  281. package/dist/web/assets/TrainingRunLineage-VcKz7dIR.js +1 -0
  282. package/dist/web/assets/{UsageSettingsSection-DTZslBeW.js → UsageSettingsSection-FhYymrfc.js} +2 -2
  283. package/dist/web/assets/WorkSidebarPanel-u87uptH0.js +1 -0
  284. package/dist/web/assets/WorkspaceDiffPanel-B5rlW7bA.js +11 -0
  285. package/dist/web/assets/WorkspaceEnvironmentMenu-C8y3537a.js +35 -0
  286. package/dist/web/assets/{WorkspaceFileLocation-ChEeZffU.js → WorkspaceFileLocation-LrEWj4UK.js} +1 -1
  287. package/dist/web/assets/{WorkspaceGitDialogs-D_RUXhTi.js → WorkspaceGitDialogs-NRIMXnkS.js} +1 -1
  288. package/dist/web/assets/{WorkspaceMonacoEditor-BJxaiDrj.js → WorkspaceMonacoEditor-CvDGjKAL.js} +3 -3
  289. package/dist/web/assets/WorkspacePdfPreview-BZ0BbnHv.js +2 -0
  290. package/dist/web/assets/{WorkspacePresentationPreview-A28Poeca.js → WorkspacePresentationPreview-DJrjrvT0.js} +1 -1
  291. package/dist/web/assets/app-models-CUA9XB9U.js +1 -0
  292. package/dist/web/assets/bot-6OhUEmkE.js +1 -0
  293. package/dist/web/assets/browser-sidebar-links-ZyYiYBBd.js +1 -0
  294. package/dist/web/assets/chat-resources-CI8KFVO5.js +1 -0
  295. package/dist/web/assets/{chevron-down-dYn0pd4Q.js → chevron-down-jmVA1BIf.js} +1 -1
  296. package/dist/web/assets/chevron-right-BYmDQ7ti.js +1 -0
  297. package/dist/web/assets/chevron-up-CstyLXH3.js +1 -0
  298. package/dist/web/assets/{chunk-ZFYI4P6C-BmsNtSkR.js → chunk-ONGOAEY6-C__DQmRT.js} +5 -5
  299. package/dist/web/assets/{chunk-BYNVSWIQ-DWh9SmdB.js → chunk-SQBYHWZU-DumrB9SB.js} +1 -1
  300. package/dist/web/assets/{client-choice-storage-DTTLbrYt.js → client-choice-storage-BdQ_YDuk.js} +1 -1
  301. package/dist/web/assets/{cloud-upload-CRMPCFnq.js → cloud-upload-Ck1ufAr8.js} +1 -1
  302. package/dist/web/assets/contracts-BLiqJxBv.js +1 -0
  303. package/dist/web/assets/{copy-DR4ielPn.js → copy-CPkbMfXt.js} +1 -1
  304. package/dist/web/assets/{createLucideIcon-DmttVQ_a.js → createLucideIcon-CXQny8HU.js} +1 -1
  305. package/dist/web/assets/{cssMode-d-2GuNvW.js → cssMode-CYxYl_om.js} +1 -1
  306. package/dist/web/assets/{external-link-B4rPiZEp.js → external-link-CDKOLG_v.js} +1 -1
  307. package/dist/web/assets/{folder-open-BrIUcUk_.js → folder-open-CEtOb_lK.js} +1 -1
  308. package/dist/web/assets/{folder-plus-DwImGEt-.js → folder-plus-CVMYZs3e.js} +1 -1
  309. package/dist/web/assets/{git-commit-horizontal-Ds1mkrlW.js → git-commit-horizontal-DDyhPjxS.js} +1 -1
  310. package/dist/web/assets/{htmlMode-s15GR0Fn.js → htmlMode-DoY4V_j0.js} +1 -1
  311. package/dist/web/assets/icons-D7jkCa2d.js +1 -0
  312. package/dist/web/assets/{image-CY-sHbfQ.js → image-B-PjDSwU.js} +1 -1
  313. package/dist/web/assets/{index-DYrLeSyY.js → index-D9WbJMSq.js} +2 -2
  314. package/dist/web/assets/index-g7UqJhnX.css +1 -0
  315. package/dist/web/assets/{info-aSvM8YlJ.js → info-CCnw-K3b.js} +1 -1
  316. package/dist/web/assets/intake-contracts-BW0Y0C2R.js +1 -0
  317. package/dist/web/assets/{jsonMode-vos9H2hz.js → jsonMode-CeOpZdPj.js} +1 -1
  318. package/dist/web/assets/loader-circle-CPaJeTDy.js +1 -0
  319. package/dist/web/assets/{lspLanguageFeatures-pQmEaoMt.js → lspLanguageFeatures-DAbgLCqZ.js} +1 -1
  320. package/dist/web/assets/{maximize-2-DgF6ZVOM.js → maximize-2-BZX38cpr.js} +1 -1
  321. package/dist/web/assets/message-square-CvgSecgD.js +1 -0
  322. package/dist/web/assets/{monaco.contribution-BPwsKvRB.js → monaco.contribution-CF2JDhi4.js} +2 -2
  323. package/dist/web/assets/{monaco.contribution-CJlccVX3.js → monaco.contribution-cbDqt48m.js} +2 -2
  324. package/dist/web/assets/{monaco.contribution-BbMpa0_-.js → monaco.contribution-m2ze2EsL.js} +2 -2
  325. package/dist/web/assets/{monaco.contribution-pWurLXbm.js → monaco.contribution-yeyow_-Q.js} +2 -2
  326. package/dist/web/assets/{monitor-DlEV241C.js → monitor-By0s4hxb.js} +1 -1
  327. package/dist/web/assets/{paperclip-fnRZSIRc.js → paperclip-BJ2QgJLa.js} +1 -1
  328. package/dist/web/assets/{pdf-CT3zVKCE.js → pdf-C4x-1jjP.js} +1 -1
  329. package/dist/web/assets/pdf.worker.min-BrEVksTu.js +1 -0
  330. package/dist/web/assets/play-D_SuGDBM.js +1 -0
  331. package/dist/web/assets/plus-yw95Iaj8.js +1 -0
  332. package/dist/web/assets/{presentation-Bb8ecExR.js → presentation-I86G1Gd9.js} +1 -1
  333. package/dist/web/assets/{python-DXA1xp0A.js → python-CqFTPj8r.js} +1 -1
  334. package/dist/web/assets/{refresh-cw-B53QjxMO.js → refresh-cw-Dga35Eay.js} +1 -1
  335. package/dist/web/assets/requests-BCbaFiqV.js +1 -0
  336. package/dist/web/assets/{reward-checks-5AOStF27.js → reward-checks-Bcq9ETCA.js} +1 -1
  337. package/dist/web/assets/{save-V1Q4Fcqa.js → save-BLKjYtzR.js} +1 -1
  338. package/dist/web/assets/settings-D7C-Auyi.js +21 -0
  339. package/dist/web/assets/{settings-lists-CtH1A57b.js → settings-lists-DMKA1lCN.js} +5 -5
  340. package/dist/web/assets/square-BY5lG2Ol.js +1 -0
  341. package/dist/web/assets/{square-terminal-Dmgkm5zY.js → square-terminal-B-n7vUex.js} +1 -1
  342. package/dist/web/assets/submit-issue-command-B7Hrt2tU.js +3 -0
  343. package/dist/web/assets/{toggleHighContrast-B-BD2K2Q.js → toggleHighContrast-BhmBE5XE.js} +1 -1
  344. package/dist/web/assets/training-QrdkRQZQ.js +2 -0
  345. package/dist/web/assets/{training-model-data-14942K_Z.js → training-model-data-DB-jg6L_.js} +12 -12
  346. package/dist/web/assets/{tsMode-DdgIcxK3.js → tsMode-BSWEII2p.js} +1 -1
  347. package/dist/web/assets/{upload-82Y6RjLi.js → upload-C4MPhQn8.js} +1 -1
  348. package/dist/web/assets/{useAccountSettings-BgHXNpq_.js → useAccountSettings-9oqWdRLs.js} +1 -1
  349. package/dist/web/assets/useAgentInventory-isO79ui9.js +1 -0
  350. package/dist/web/assets/{useLocalAgentSchedules-CsKv22Hs.js → useLocalAgentSchedules-CZX6PxoK.js} +1 -1
  351. package/dist/web/assets/{useQuery-CPC2wsWm.js → useQuery-BD0Uexmh.js} +1 -1
  352. package/dist/web/assets/{wifi-off-DXOoDN9l.js → wifi-off-Cloe0WuQ.js} +1 -1
  353. package/dist/web/assets/{workers-Clf4hKt5.js → workers-BXagz5eg.js} +1 -1
  354. package/dist/web/assets/x-Dqpel42h.js +1 -0
  355. package/dist/web/assets/{yaml-I1tf8Uxx.js → yaml-sBdvVbCc.js} +1 -1
  356. package/dist/web/index.html +2 -2
  357. package/docs/command-reference.md +22 -4
  358. package/package.json +5 -2
  359. package/dist/chunks/actions-command-6LF4Z4WK.js +0 -2
  360. package/dist/chunks/app-server-connected-apps-3T546FE7.js +0 -2
  361. package/dist/chunks/app-server-evaluations-TXD747QA.js +0 -2
  362. package/dist/chunks/app-server-harness-services-BBCDV5P3.js +0 -2
  363. package/dist/chunks/app-server-runtime-VEJPDAFP.js +0 -2
  364. package/dist/chunks/apps-CTT2XYRR.js +0 -2
  365. package/dist/chunks/chunk-4M3YW3EQ.js +0 -13
  366. package/dist/chunks/chunk-4U2FNXQW.js +0 -2
  367. package/dist/chunks/chunk-547AUVKN.js +0 -2
  368. package/dist/chunks/chunk-557YG77L.js +0 -2
  369. package/dist/chunks/chunk-7KTARW23.js +0 -2
  370. package/dist/chunks/chunk-B42QQUZY.js +0 -2
  371. package/dist/chunks/chunk-EWOTDVDJ.js +0 -4
  372. package/dist/chunks/chunk-GAQLXFOT.js +0 -2
  373. package/dist/chunks/chunk-GLDYJM7O.js +0 -1
  374. package/dist/chunks/chunk-HKV7RX5E.js +0 -2
  375. package/dist/chunks/chunk-IWK3RTLR.js +0 -2
  376. package/dist/chunks/chunk-JX6OX6XE.js +0 -12
  377. package/dist/chunks/chunk-JY3YSI54.js +0 -2
  378. package/dist/chunks/chunk-LILXHGIA.js +0 -2
  379. package/dist/chunks/chunk-LJPO3TEL.js +0 -17
  380. package/dist/chunks/chunk-MNFW5WLD.js +0 -6
  381. package/dist/chunks/chunk-N5GPINVP.js +0 -2
  382. package/dist/chunks/chunk-N663LL27.js +0 -2
  383. package/dist/chunks/chunk-NOSBNHGC.js +0 -18
  384. package/dist/chunks/chunk-NR5VASQB.js +0 -2
  385. package/dist/chunks/chunk-O3MHHGC5.js +0 -151
  386. package/dist/chunks/chunk-OZ6LRNRE.js +0 -2
  387. package/dist/chunks/chunk-PGO4FRHU.js +0 -10
  388. package/dist/chunks/chunk-QAVQJZCM.js +0 -2
  389. package/dist/chunks/chunk-RBDUMASL.js +0 -2
  390. package/dist/chunks/chunk-TM4VEMNN.js +0 -2
  391. package/dist/chunks/chunk-TUCKED4T.js +0 -4
  392. package/dist/chunks/chunk-TVTFEGTU.js +0 -2
  393. package/dist/chunks/chunk-TW3SRBLU.js +0 -22
  394. package/dist/chunks/chunk-UT6F6AIB.js +0 -12
  395. package/dist/chunks/chunk-VE6ZIGUQ.js +0 -2
  396. package/dist/chunks/chunk-VI32G77S.js +0 -2
  397. package/dist/chunks/chunk-VWRTE64Y.js +0 -2
  398. package/dist/chunks/chunk-XSB3T4JZ.js +0 -5
  399. package/dist/chunks/chunk-XWDFXM3S.js +0 -2
  400. package/dist/chunks/chunk-ZQHPGEYT.js +0 -2
  401. package/dist/chunks/cli-GCSO2OAI.js +0 -2
  402. package/dist/chunks/connected-app-executor-UDE7U4KG.js +0 -2
  403. package/dist/chunks/connected-evidence-GXIY2L7C.js +0 -2
  404. package/dist/chunks/core-commands-NJ6TGND4.js +0 -2
  405. package/dist/chunks/dataset-preparation-authoring-IUXUQK3L.js +0 -4
  406. package/dist/chunks/datasets-AH56DKLZ.js +0 -2
  407. package/dist/chunks/desktop-test-PYUTEOWO.js +0 -3
  408. package/dist/chunks/dist-5267UT3V.js +0 -2
  409. package/dist/chunks/evaluation-coordination-3AUICOC5.js +0 -2
  410. package/dist/chunks/experiment-improvements-YS7GGPDW.js +0 -2
  411. package/dist/chunks/experiments-EJZK7FPT.js +0 -2
  412. package/dist/chunks/experiments-signal-NKUIJCIY.js +0 -2
  413. package/dist/chunks/host-profile-evaluation-tools-CTC5JQPD.js +0 -2
  414. package/dist/chunks/host-profile-external-dataset-GJWDY3YT.js +0 -2
  415. package/dist/chunks/hosted-app-server-composition-TLJSKMJT.js +0 -2
  416. package/dist/chunks/hosted-experiment-improvement-TIVXXRPG.js +0 -3
  417. package/dist/chunks/hosted-harness-runtime-SFLJEZFI.js +0 -2
  418. package/dist/chunks/hosted-profile-candidate-DKEMVIYG.js +0 -3
  419. package/dist/chunks/hosted-profile-compiler-V6YR6EHO.js +0 -2
  420. package/dist/chunks/hosted-profile-evaluation-control-ERCXAPZD.js +0 -2
  421. package/dist/chunks/hosted-profile-evaluation-inspection-Q3AIIIB6.js +0 -3
  422. package/dist/chunks/hosted-profile-evaluation-preparation-ELLGH44Z.js +0 -3
  423. package/dist/chunks/human-review-5WM6MSON.js +0 -2
  424. package/dist/chunks/learning-KVLTMRLD.js +0 -2
  425. package/dist/chunks/local-harness-improvement-runtime-IGIKM6GJ.js +0 -2
  426. package/dist/chunks/local-harness-taskset-review-DR2ZIDOH.js +0 -2
  427. package/dist/chunks/model-projects-H22KENI4.js +0 -2
  428. package/dist/chunks/opchat-3S6TSDZO.js +0 -3
  429. package/dist/chunks/opchat-bounded-chat-B7LPCD4U.js +0 -2
  430. package/dist/chunks/organizations-62YNTZTO.js +0 -2
  431. package/dist/chunks/project-action-payload-32F4X2BB.js +0 -2
  432. package/dist/chunks/project-agent-O4REKO6T.js +0 -2
  433. package/dist/chunks/published-experiment-source-DAOTJLIN.js +0 -2
  434. package/dist/chunks/refiner-profile-service-DYMZ7J3X.js +0 -2
  435. package/dist/chunks/sandbox-command-UQ26NDIX.js +0 -2
  436. package/dist/chunks/saved-work-PG52WCRQ.js +0 -2
  437. package/dist/chunks/src-AU6LG7E6.js +0 -421
  438. package/dist/chunks/standalone-experiment-turn-owner-SD3SUTKX.js +0 -2
  439. package/dist/chunks/store-chat-resources-T4LR7K25.js +0 -2
  440. package/dist/chunks/store-evaluation-results-WUVJWCFU.js +0 -7
  441. package/dist/chunks/store-harness-workspaces-IFEFY5CK.js +0 -2
  442. package/dist/chunks/store-human-review-ZQNLZRGG.js +0 -7
  443. package/dist/chunks/store-learned-preference-migration-validation-UH6MJQSH.js +0 -2
  444. package/dist/chunks/store-model-batch-review-QO4VVKWC.js +0 -2
  445. package/dist/chunks/store-model-configuration-C3HSOFD5.js +0 -3
  446. package/dist/chunks/store-model-project-preparation-RQ2YTC2Y.js +0 -2
  447. package/dist/chunks/store-task-inbox-DL5RYFPO.js +0 -33
  448. package/dist/chunks/store-taskset-drafts-UFGN4SGF.js +0 -9
  449. package/dist/chunks/taskset-packages-CBLJFWDQ.js +0 -2
  450. package/dist/chunks/training-error-L5V5IBX3.js +0 -2
  451. package/dist/chunks/training-hosted-I2NDBYGS.js +0 -2
  452. package/dist/chunks/training-hosted-report-4F25RZZ4.js +0 -2
  453. package/dist/chunks/training-hosted-workers-KI767T4Y.js +0 -2
  454. package/dist/skills/openpond-desktop-harness/SKILL.md +0 -113
  455. package/dist/skills/openpond-desktop-harness/agents/openai.yaml +0 -4
  456. package/dist/web/assets/App-DHJVXTI2.js +0 -54
  457. package/dist/web/assets/AppTerminalPanel-RjFlF-a4.js +0 -2
  458. package/dist/web/assets/AppsView-ttlr9ckQ.js +0 -1
  459. package/dist/web/assets/BrowserSidebar-Cp2l0kg0.js +0 -1
  460. package/dist/web/assets/ChatTimelineEntry-BITv20Ze.js +0 -1
  461. package/dist/web/assets/CommandMenu-6oj8FUr6.js +0 -1
  462. package/dist/web/assets/ComposerAttachments-6en7m_ov.js +0 -2
  463. package/dist/web/assets/FilePagePreview-CW4J_1u7.js +0 -2
  464. package/dist/web/assets/LabModelVersionDetailPage-f0tHT-Sn.js +0 -1
  465. package/dist/web/assets/LabsRoute-B61l1b8P.js +0 -101
  466. package/dist/web/assets/MainChatThread-egKi0gLk.js +0 -2
  467. package/dist/web/assets/MainPane-2dj6Dg4l.js +0 -95
  468. package/dist/web/assets/MainPane-BwHw3UYp.css +0 -1
  469. package/dist/web/assets/NativeSetupTerminal-CNHTByLo.js +0 -2
  470. package/dist/web/assets/NativeSkillSidebar-DCdMbSfe.js +0 -1
  471. package/dist/web/assets/RightChatPanelStack-B3mBViGC.js +0 -1
  472. package/dist/web/assets/RightSidebarHomePanel-CxDYSyyx.js +0 -1
  473. package/dist/web/assets/ScheduledWorkPage-Dh47iH11.js +0 -1
  474. package/dist/web/assets/SettingsView-D2bu3tK_.js +0 -5
  475. package/dist/web/assets/TeamChatView-CN17AsgA.js +0 -1
  476. package/dist/web/assets/TrainingCreationPanel-DJKzaNFj.js +0 -1
  477. package/dist/web/assets/TrainingMetricWorkbench-DBy8F1xp.js +0 -1
  478. package/dist/web/assets/WorkSidebarPanel-Ds-eTQLs.js +0 -1
  479. package/dist/web/assets/WorkspaceDiffPanel-D_iyg2D4.js +0 -11
  480. package/dist/web/assets/WorkspaceEnvironmentMenu-Fn-NlfMQ.js +0 -35
  481. package/dist/web/assets/app-models-BviS9b7U.js +0 -1
  482. package/dist/web/assets/browser-sidebar-links-ujSvTf5h.js +0 -1
  483. package/dist/web/assets/chat-resources-3SvnVeKv.js +0 -1
  484. package/dist/web/assets/chevron-right-sFx2xRvT.js +0 -1
  485. package/dist/web/assets/contracts-BHTOD1nd.js +0 -1
  486. package/dist/web/assets/icons-CK5-nxVC.js +0 -1
  487. package/dist/web/assets/index-Dezj4Z2p.css +0 -1
  488. package/dist/web/assets/loader-circle-cyf35w3i.js +0 -1
  489. package/dist/web/assets/play-wI_3FLr4.js +0 -1
  490. package/dist/web/assets/plus-DoJe4fLj.js +0 -1
  491. package/dist/web/assets/settings-BKmRueaw.js +0 -21
  492. package/dist/web/assets/square-BqSK-hv9.js +0 -1
  493. package/dist/web/assets/submit-issue-command-DRgUboVW.js +0 -3
  494. package/dist/web/assets/training-managed-adapter-BXNwgd3P.js +0 -1
  495. package/dist/web/assets/useAgentInventory-B-LNn3up.js +0 -1
  496. package/dist/web/assets/x-IPhrr4ju.js +0 -1
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{b as R,c as p,d as m}from"./chunk-4BJGUCHY.js";import{a as v}from"./chunk-SXMR6E2W.js";import"./chunk-XWPC3AN4.js";import{f as b}from"./chunk-3M53YXEI.js";import"./chunk-MTP3B2SU.js";import{w as O}from"./chunk-OTUBJV6C.js";import"./chunk-27JGS3KB.js";import{d as P}from"./chunk-UTNGEMW5.js";import"./chunk-U2K7QJCG.js";import"./chunk-WSOUMXH3.js";import"./chunk-N42HT64M.js";import"./chunk-NG2L6D7G.js";import"./chunk-GLUWATL5.js";import"./chunk-OSVGNONV.js";import"./chunk-2LJCJOJ7.js";import"./chunk-YBNKGA5C.js";import"./chunk-LAOLJDVB.js";import"./chunk-UWHIU24L.js";import"./chunk-JCLTFDVW.js";import"./chunk-LV3CQ72P.js";import"./chunk-ABF3W2MO.js";import"./chunk-RV7PUSI2.js";import"./chunk-KCV5VN4X.js";import"./chunk-2EPR4HLF.js";import"./chunk-BKEDG3A4.js";import"./chunk-OE22TAXP.js";import"./chunk-UGOK7VTC.js";import"./chunk-J572ANHX.js";import"./chunk-PBZCXPPC.js";import"./chunk-NJLULBTM.js";import"./chunk-VVNV4NNW.js";import"./chunk-PF56N7ZY.js";import{a as c}from"./chunk-FTQLQJQV.js";import{promises as $,watch as C}from"node:fs";import y from"node:path";import{execFile as J}from"node:child_process";import{promisify as k}from"node:util";var K=k(J);async function G(t,n){let e=n[0]??"check",o=y.resolve(i(t,"cwd")??process.cwd()),l=i(t,"sourceDirectory"),u=i(t,"outputDirectory"),d=b(t.json);if(e==="check"||e==="build"){let r=await p({projectRoot:o,sourceDirectory:l,outputDirectory:u});if(d){console.log(JSON.stringify({status:"passed",actionCount:r.registry.actions.length,registry:r.registry,manifest:r.manifest,outputDirectory:r.outputDirectory},null,2));return}console.log(`${e==="check"?"Validated":"Built"} ${r.registry.actions.length} Project Action${r.registry.actions.length===1?"":"s"}.`),console.log(`Registry: ${r.registryPath}`),console.log(`Bundle: ${r.bundlePath}`);return}if(e==="run"){let r=n[1];if(!r)throw new Error("usage: openpond actions run <action-id> [--input JSON|--input-file PATH]");let a=await m({projectRoot:o,sourceDirectory:l,outputDirectory:u,build:"always"}).run({actionId:r,input:await I(t,o),timeoutMs:A(t,"timeoutMs")});console.log(JSON.stringify(a,null,2));return}if(e==="dev"){let r=n[1]??null;await _({projectRoot:o,sourceDirectory:l,outputDirectory:u,actionId:r,options:t,json:d});return}if(e==="publish"){let r=j(t,"projectId"),s=j(t,"teamId"),a=i(t,"apiKey"),w=process.env.OPENPOND_API_KEY?.trim()||null,g=a||w?null:await P({account:i(t,"account")}),h=a??w??(g?v(g):null);if(!h)throw new Error("OpenPond API key is required. Select a saved OpenPond account, set OPENPOND_API_KEY, or pass --api-key.");let N=await p({projectRoot:o,sourceDirectory:l,outputDirectory:u}),E=i(t,"sourceCommitSha")??await D(o,["rev-parse","HEAD"]),S=i(t,"sourceRef")??await D(o,["rev-parse","--abbrev-ref","HEAD"]),f=await O({apiKey:h,baseUrl:i(t,"baseUrl")??(process.env.OPENPOND_API_URL?.trim()||g?.apiBaseUrl)}).actions.publish({projectId:r,teamId:s,sourceRef:S,sourceCommitSha:E,build:N});console.log(d?JSON.stringify({release:f},null,2):`Published Project Actions release ${f.id} from ${f.sourceCommitSha}.`);return}throw new Error("usage: openpond actions <check|build|run|dev|publish> [action-id]")}c(G,"runProjectActionsCommand");async function _(t){let n=!1,e=!1,o=c(async()=>{if(n){e=!0;return}n=!0;try{let r=m({projectRoot:t.projectRoot,sourceDirectory:t.sourceDirectory,outputDirectory:t.outputDirectory,build:"always"});if(t.actionId){let s=await r.run({actionId:t.actionId,input:await I(t.options,t.projectRoot),timeoutMs:A(t.options,"timeoutMs")});console.log(JSON.stringify(s,null,2))}else{let s=await r.build(),a={status:"ready",actionCount:s.registry.actions.length,bundleHash:s.manifest.bundleHash};console.log(t.json?JSON.stringify(a):`Ready with ${a.actionCount} Project Action${a.actionCount===1?"":"s"}.`)}}catch(r){console.error(r instanceof Error?r.message:String(r))}finally{n=!1,e&&(e=!1,await o())}},"execute");await o();let l=await R(t.projectRoot),u=y.resolve(t.projectRoot,t.sourceDirectory??l.sourceDirectory??"openpond/actions");console.log(`Watching ${u}`);let d=C(u,{recursive:!0},()=>{setTimeout(()=>{o()},50)});await new Promise(r=>{let s=c(()=>{d.close(),r()},"stop");process.once("SIGINT",s),process.once("SIGTERM",s)})}c(_,"runDev");async function I(t,n){let e=i(t,"input"),o=i(t,"inputFile");if(e&&o)throw new Error("Use either --input or --input-file, not both.");return e?JSON.parse(e):o?JSON.parse(await $.readFile(y.resolve(n,o),"utf8")):{}}c(I,"actionInput");function i(t,n){let e=t[n];return typeof e=="string"&&e.trim()?e.trim():void 0}c(i,"stringOption");function j(t,n){let e=i(t,n);if(!e)throw new Error(`--${n.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`)} is required.`);return e}c(j,"requiredOption");async function D(t,n){let{stdout:e}=await K("git",n,{cwd:t}),o=e.trim();if(!o)throw new Error(`git ${n.join(" ")} returned no value.`);return o}c(D,"gitValue");function A(t,n){let e=i(t,n);if(e===void 0)return;let o=Number(e);if(!Number.isInteger(o)||o<=0)throw new Error(`--${n} must be a positive integer.`);return o}c(A,"integerOption");export{G as runProjectActionsCommand};
@@ -1,3 +1,3 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{u as m}from"./chunk-VSQXDS6H.js";import"./chunk-SXMR6E2W.js";import{a as l}from"./chunk-7JBB4PXS.js";import"./chunk-UC3FXTDL.js";import"./chunk-XRKFTPHD.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import"./chunk-3M53YXEI.js";import"./chunk-MILEWROZ.js";import"./chunk-NOSBNHGC.js";import"./chunk-JX6OX6XE.js";import"./chunk-BT5YNE5U.js";import"./chunk-UTNGEMW5.js";import"./chunk-QCSLEMZF.js";import"./chunk-B42QQUZY.js";import"./chunk-7KTARW23.js";import"./chunk-GLUWATL5.js";import"./chunk-OSVGNONV.js";import"./chunk-XWDFXM3S.js";import"./chunk-YBNKGA5C.js";import"./chunk-LAOLJDVB.js";import"./chunk-UWHIU24L.js";import"./chunk-LV3CQ72P.js";import"./chunk-JCLTFDVW.js";import"./chunk-ABF3W2MO.js";import"./chunk-RV7PUSI2.js";import"./chunk-KCV5VN4X.js";import"./chunk-2EPR4HLF.js";import"./chunk-BKEDG3A4.js";import"./chunk-OE22TAXP.js";import"./chunk-UGOK7VTC.js";import"./chunk-4M3YW3EQ.js";import"./chunk-PBZCXPPC.js";import"./chunk-NJLULBTM.js";import"./chunk-VVNV4NNW.js";import"./chunk-PF56N7ZY.js";import{a as i}from"./chunk-FTQLQJQV.js";import{existsSync as c}from"node:fs";import{createRequire as v}from"node:module";import s from"node:path";import{fileURLToPath as E}from"node:url";var p="24.18.0";function N(e=process.versions.node){let r=/^(\d+)\.(\d+)\.(\d+)/.exec(e),n=r?Number(r[1]):Number.NaN,o=r?Number(r[2]):Number.NaN;return n===24&&o>=18?null:[`OpenPond TUI requires Node.js ${p} or newer in the Node 24 release line; detected Node.js ${e}.`,`Switch Node versions and retry (with nvm: \`nvm install ${p} && nvm use ${p}\`).`].join(`
2
+ import{u as m}from"./chunk-GPL2Z65R.js";import"./chunk-SXMR6E2W.js";import{a as l}from"./chunk-2HAWOMZK.js";import"./chunk-SFKZITAG.js";import"./chunk-XRKFTPHD.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import"./chunk-3M53YXEI.js";import"./chunk-MILEWROZ.js";import"./chunk-OTUBJV6C.js";import"./chunk-27JGS3KB.js";import"./chunk-BT5YNE5U.js";import"./chunk-UTNGEMW5.js";import"./chunk-U2K7QJCG.js";import"./chunk-WSOUMXH3.js";import"./chunk-N42HT64M.js";import"./chunk-NG2L6D7G.js";import"./chunk-GLUWATL5.js";import"./chunk-OSVGNONV.js";import"./chunk-2LJCJOJ7.js";import"./chunk-YBNKGA5C.js";import"./chunk-LAOLJDVB.js";import"./chunk-UWHIU24L.js";import"./chunk-JCLTFDVW.js";import"./chunk-LV3CQ72P.js";import"./chunk-ABF3W2MO.js";import"./chunk-RV7PUSI2.js";import"./chunk-KCV5VN4X.js";import"./chunk-2EPR4HLF.js";import"./chunk-BKEDG3A4.js";import"./chunk-OE22TAXP.js";import"./chunk-UGOK7VTC.js";import"./chunk-J572ANHX.js";import"./chunk-PBZCXPPC.js";import"./chunk-NJLULBTM.js";import"./chunk-VVNV4NNW.js";import"./chunk-PF56N7ZY.js";import{a as i}from"./chunk-FTQLQJQV.js";import{existsSync as c}from"node:fs";import{createRequire as v}from"node:module";import s from"node:path";import{fileURLToPath as E}from"node:url";var p="24.18.0";function N(e=process.versions.node){let r=/^(\d+)\.(\d+)\.(\d+)/.exec(e),n=r?Number(r[1]):Number.NaN,o=r?Number(r[2]):Number.NaN;return n===24&&o>=18?null:[`OpenPond TUI requires Node.js ${p} or newer in the Node 24 release line; detected Node.js ${e}.`,`Switch Node versions and retry (with nvm: \`nvm install ${p} && nvm use ${p}\`).`].join(`
3
3
  `)}i(N,"openPondTuiNodeRuntimeMessage");var u=s.dirname(E(import.meta.url)),O=class extends Error{constructor(n,o){super(n);this.exitCode=o;this.name="OpenPondChildProcessExitError"}exitCode;static{i(this,"OpenPondChildProcessExitError")}};async function F(e,r,n){let o=f(e==="app-server"?"app-server":"server"),t=[...o.args,e,...P(r),...n];e==="web"&&t.push(r.noOpen===!0||r.noOpen==="true"?"--print-access-url":"--open-browser");let a=e==="web"&&typeof r.webRoot!="string"?C():null;a&&t.push("--web-root",a),await w(o.runner,t,e==="app-server"?process.cwd():o.cwd)}i(F,"runOpenPondServerCommand");async function q(e,r){b(e);let n=N();if(n)throw new l(n);let o=f("terminal"),t=f("server"),a=[...o.args,"chat",...P(R(e)),...r];await w(o.runner,a,process.cwd(),{OPENPOND_SERVER_RUNNER:t.runner,OPENPOND_SERVER_ARGS:JSON.stringify(t.args),OPENPOND_SERVER_CWD:t.cwd})}i(q,"runOpenPondTerminalCommand");function h(){if(process.env.OPENPOND_FORCE_EMBEDDED_COMPANIONS==="1")return null;let e=[s.resolve(u,"../../../.."),s.resolve(u,"../../.."),process.cwd()];for(let r of e)if(c(s.join(r,"apps","server"))&&c(s.join(r,"apps","terminal")))return r;return null}i(h,"findWorkspaceRoot");function f(e){let r=h();if(r){let t=e==="app-server"?s.join(r,"apps","server","src","app-server-entry.ts"):s.join(r,"apps",e,"src","index.ts");if(c(t)){let d=v(s.join(r,"package.json"));return{runner:process.execPath,args:[d.resolve("tsx/cli"),t],cwd:r}}let a=e==="app-server"?s.join(r,"apps","server","dist","app-server-entry.js"):s.join(r,"apps",e,"dist","index.js");if(c(a))return{runner:process.execPath,args:[a],cwd:r}}let n=_(),o=e==="app-server"?"__app-server":e==="server"?"__server":"__terminal";if(n)return{runner:process.execPath,args:[n,o],cwd:s.dirname(s.dirname(n))};if(D())return{runner:process.execPath,args:[o],cwd:process.cwd()};throw new Error(`Could not find the installed OpenPond ${e} companion.`)}i(f,"resolveAppEntrypoint");function _(){for(let e of[s.resolve(u,"../cli.js"),s.resolve(u,"../../dist/cli.js")])if(c(e))return e;return null}i(_,"installedCliEntrypoint");function C(){if(!1){let n=s.join(s.dirname(process.execPath),"web");return c(s.join(n,"index.html"))?n:null}let e=_();if(!e)return null;let r=s.join(s.dirname(e),"web");return c(s.join(r,"index.html"))?r:null}i(C,"packagedWebRoot");function D(){if(!1)return!0;let e=process.argv[1];return!!(e&&s.resolve(e)===s.resolve(process.execPath))}i(D,"isCompiledExecutable");function P(e){let r=new Set(["account","handle","baseUrl","noOpen","tui","home"]),n=[];for(let[o,t]of Object.entries(e)){if(r.has(o))continue;let a=`--${o.replace(/[A-Z]/g,d=>`-${d.toLowerCase()}`)}`;if(t===!0||t==="true")n.push(a);else{if(t===!1||t==="false")continue;n.push(a,t)}}return n}i(P,"forwardedOptions");function R(e){let r=process.cwd(),n={...e};return typeof e.cwd=="string"&&e.cwd.trim().length>0&&(n.cwd=s.resolve(r,e.cwd)),typeof e.messageFile=="string"&&e.messageFile.trim().length>0&&(n.messageFile=s.resolve(r,e.messageFile)),n}i(R,"normalizeTerminalPaths");function b(e){if(typeof e.approvalPolicy=="string"&&!["on-request","never","on-failure","untrusted"].includes(e.approvalPolicy))throw new l("approval-policy must be on-request, never, on-failure, or untrusted");if(typeof e.sandbox=="string"&&!["read-only","workspace-write","danger-full-access"].includes(e.sandbox))throw new l("sandbox must be read-only, workspace-write, or danger-full-access")}i(b,"validateTerminalForwardingOptions");async function w(e,r,n,o){let t=await m(e,r,{cwd:n,detached:!1,env:o,inherit:!0,timeoutMs:0});if(t.code!==0||t.signal){let a=t.signal?`signal ${t.signal}`:`code ${t.code??"unknown"}`;throw new O(`${s.basename(e)} exited with ${a}`,t.code??1)}}i(w,"runChild");export{O as OpenPondChildProcessExitError,F as runOpenPondServerCommand,q as runOpenPondTerminalCommand};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{a as u}from"./chunk-WWQNMC7C.js";import"./chunk-4N4EH3RJ.js";import"./chunk-HFJUXKT5.js";import"./chunk-5ZBLCWEJ.js";import{b as m}from"./chunk-27JGS3KB.js";import{a as d}from"./chunk-2LJCJOJ7.js";import"./chunk-JCLTFDVW.js";import"./chunk-6FA3GG5B.js";import"./chunk-2EPR4HLF.js";import"./chunk-BKEDG3A4.js";import"./chunk-OE22TAXP.js";import"./chunk-UGOK7VTC.js";import"./chunk-VVNV4NNW.js";import"./chunk-PF56N7ZY.js";import{a as i}from"./chunk-FTQLQJQV.js";async function x(o){let n=await u(),e=process.env.OPENPOND_SANDBOX_API_KEY?.trim()||process.env.OPENPOND_API_KEY?.trim()||n.token?.trim();if(!e)throw new Error("OpenPond account API key is required to resolve connected apps.");let t=process.env.OPENPOND_SANDBOX_API_URL?.trim(),s=m({apiKey:e,...t?{sandboxApiUrl:d(t,{apiBaseUrl:t})}:{baseUrl:n.apiBaseUrl}}),l=o.status??"active";if(o.teamId?.trim())return s.integrationConnections({teamId:o.teamId.trim(),status:l});let p=await s.listOrganizations(),a=I(p);if(a.length===0)return{teamId:null,connections:[]};let c=(await Promise.all(a.map(r=>s.integrationConnections({teamId:r,status:l}).catch(()=>null)))).filter(r=>!!r);return{teamId:c.find(r=>r.connections.length>0)?.teamId??c[0]?.teamId??a[0]??null,connections:f(c)}}i(x,"listAppServerIntegrationConnections");function I(o){return Array.from(new Set(o.flatMap(n=>{if(typeof n.status=="string"&&n.status!=="active")return[];let e=n.id,t=typeof n.teamId=="string"?n.teamId:typeof e=="string"?e:"";return t.trim()?[t.trim()]:[]})))}i(I,"activeTeamIds");function f(o){let n=new Map;for(let e of o)for(let t of e.connections)n.set(t.id,t);return[...n.values()]}i(f,"mergeConnections");export{x as listAppServerIntegrationConnections};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{a as Y,b as Z}from"./chunk-GVARQXYI.js";import"./chunk-G6OR5NB6.js";import{c as G,d as B,e as V}from"./chunk-SHJY5RLU.js";import{a as $,b as U}from"./chunk-KUPJNBWG.js";import{b as F,c as K}from"./chunk-7YLXGILH.js";import{a as C,p as z,q as Q,r as X}from"./chunk-C2AXMKK4.js";import{a as P}from"./chunk-QU4UE73E.js";import"./chunk-S7A2OGL2.js";import"./chunk-YM4PSVFW.js";import"./chunk-6PKXJEJM.js";import"./chunk-F7QTIHXX.js";import"./chunk-FEAKTSRS.js";import"./chunk-HIYQPZ7C.js";import"./chunk-F6UQ6PPK.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-NT7N6KLE.js";import"./chunk-B5R53U74.js";import"./chunk-W45RKGM6.js";import"./chunk-6EBCS57F.js";import"./chunk-KCOTDUGW.js";import"./chunk-SI5W5LBV.js";import"./chunk-RZUCVF2Q.js";import{b as L}from"./chunk-R6WMY6AH.js";import"./chunk-NZTCH6K5.js";import"./chunk-7R56WC7L.js";import"./chunk-VFH5C6D2.js";import{a as W}from"./chunk-4NXEYPPX.js";import"./chunk-AH26AQN7.js";import"./chunk-5MHYGMJG.js";import{Z as R}from"./chunk-XNOMIWEY.js";import"./chunk-LK2K3SPM.js";import"./chunk-ZG6353RM.js";import{s as k,u as J}from"./chunk-B4RKHHF7.js";import"./chunk-M3FLEZ4E.js";import"./chunk-OQPJ7FJF.js";import"./chunk-WBUK73ST.js";import"./chunk-P7HRF4FM.js";import"./chunk-GS6ZUSIN.js";import"./chunk-2ITZW2CN.js";import"./chunk-OG33QAG6.js";import"./chunk-W5W4IODW.js";import"./chunk-PWK5Z5S3.js";import"./chunk-W45RKGM6.js";import"./chunk-MWXW2CA6.js";import"./chunk-L3KS6MOV.js";import"./chunk-M3SCON53.js";import"./chunk-IZ56L2ZK.js";import"./chunk-KCJVFLBB.js";import"./chunk-3YXYBYWK.js";import"./chunk-MPNJ2BB4.js";import"./chunk-KOKX7PBS.js";import"./chunk-V7KR74NO.js";import"./chunk-XGY4OQLC.js";import"./chunk-7O6Z3VOZ.js";import"./chunk-5EP2DZLJ.js";import"./chunk-IDOGNIMV.js";import"./chunk-W45RKGM6.js";import"./chunk-PBTXLQAU.js";import"./chunk-7WYL2IDD.js";import"./chunk-HFJUXKT5.js";import"./chunk-5ZBLCWEJ.js";import"./chunk-PCB65K4G.js";import"./chunk-6RS4NAOY.js";import"./chunk-ZZHXQCNB.js";import"./chunk-YNQWJWIC.js";import"./chunk-VNJAAYNQ.js";import"./chunk-7ZLXFKRI.js";import"./chunk-7HRLWPPZ.js";import"./chunk-MTP3B2SU.js";import"./chunk-YBNKGA5C.js";import"./chunk-LAOLJDVB.js";import"./chunk-UWHIU24L.js";import{p as N}from"./chunk-LV3CQ72P.js";import"./chunk-ABF3W2MO.js";import"./chunk-RV7PUSI2.js";import"./chunk-KCV5VN4X.js";import"./chunk-6FA3GG5B.js";import"./chunk-2EPR4HLF.js";import"./chunk-BKEDG3A4.js";import"./chunk-OE22TAXP.js";import"./chunk-UGOK7VTC.js";import{d as j}from"./chunk-J572ANHX.js";import{x as M}from"./chunk-PBZCXPPC.js";import"./chunk-NJLULBTM.js";import{n as S}from"./chunk-VVNV4NNW.js";import{A as s}from"./chunk-PF56N7ZY.js";import{a as r}from"./chunk-FTQLQJQV.js";import{createHash as le}from"node:crypto";function q(v,o){if(o.environment.kind!=="javascript")throw new Error("experiment_environment_required");let{definition:t,asset:d}=o.environment,l=j(d,t.module),p=le("sha256").update(o.id).digest("hex"),x=0;return async a=>{if(a.signal?.throwIfAborted(),a.source!==l)throw new Error("experiment_environment_source_mismatch");let c=a.value.action,n=t.executionServices?.filter(y=>y.operation===a.operation&&(a.operation!=="step"||y.toolName===c?.name))??[];if(S(a.executionServices??[])!==S(n))throw new Error("experiment_environment_services_mismatch");let u=x++,h=await v.request({contractVersion:R,requestId:`environment-${p}-${u}`,operation:"experiment/environment",params:{caseId:o.id,admissionHash:o.admissionHash,definitionHash:t.contentHash,ordinal:u,operation:a.operation,value:a.value,timeoutMs:a.timeoutMs}},3e5);return a.signal?.throwIfAborted(),M(h,1572864),N.parse(h)}}r(q,"createHostExperimentEnvironment");import{createHash as pe}from"node:crypto";var ce=s.object({text:s.string().max(262144),toolCalls:s.array(s.object({id:s.string().min(1).max(200),name:s.string().min(1).max(64),arguments:s.record(s.string(),s.unknown())}).strict()).max(200)}).strict();function H(v,o){let t=0;return async({messages:d,tools:l,signal:p})=>{p.throwIfAborted();let x=t++,a=await v.request({contractVersion:R,requestId:`experiment-${pe("sha256").update(o.id).digest("hex")}-${x}`,operation:"experiment/policy",params:{caseId:o.id,admissionHash:o.admissionHash,ordinal:x,messages:d.map(c=>({...c})),tools:l.map(c=>({...c}))}},Math.min(o.timeoutMs,3e5));return p.throwIfAborted(),ce.parse(a)}}r(H,"createHostExperimentPolicy");function ee(v,o,t){let d=H(v,o);return async function*(l){let p=o.model;if(!l.signal||l.model!==p.modelId||l.maxTokens!==p.maxOutputTokens||l.temperature!==p.temperature||l.topP!==p.topP)throw new Error("Native Experiment policy request differs from its admitted model configuration.");let x=l.messages.map(n=>{if(n.images?.length||n.continuation)throw new Error("The owner policy capability does not admit multimodal or caller-supplied continuation inputs.");if(n.role==="tool")return{role:"tool",callId:s.string().min(1).max(200).parse(n.tool_call_id),name:s.string().min(1).max(64).parse(n.name),observation:ue(n.content??"")};if(n.role==="assistant")return{role:"assistant",text:n.content??"",toolCalls:(n.tool_calls??[]).map(u=>({id:s.string().min(1).max(200).parse(u.id),name:s.string().min(1).max(64).parse(u.function?.name),arguments:s.record(s.string(),s.unknown()).parse(JSON.parse(s.string().parse(u.function?.arguments)))}))};if(n.role!=="user"&&n.role!=="system")throw new Error("Native Experiment message role is not admitted.");return{role:n.role,text:n.content??""}}),a=(l.tools??[]).map(n=>{if(n.type!=="function"||!n.function)throw new Error("Native Experiment requires declared function tools.");let u=t.find(h=>h.name===n.function.name);if(!u||S(n.function.parameters)!==u.inputSchemaHash)throw new Error("Native Experiment requested an undeclared or changed tool.");return u});if(a.length!==t.length||new Set(a.map(n=>n.name)).size!==a.length)throw new Error("Native Experiment changed its admitted tool inventory.");let c=await d({messages:x,tools:a,signal:l.signal});l.signal.throwIfAborted(),c.text&&(yield{type:"text_delta",text:c.text,raw:null}),c.toolCalls.length&&(yield{type:"tool_call_delta",toolCalls:c.toolCalls.map(n=>({id:n.id,type:"function",function:{name:n.name,arguments:JSON.stringify(n.arguments)}})),raw:null}),yield{type:"finish",finishReason:c.toolCalls.length?"tool_calls":"stop",raw:null}}}r(ee,"createHostExperimentNativeStream");function ue(v){try{let o=JSON.parse(v);return o&&typeof o=="object"&&!Array.isArray(o)?o:{output:o}}catch{return{output:v}}}r(ue,"observation");function Qe(v){let{options:o,store:t,storeDir:d,explicitProfileRelease:l,externalDataset:p,isolatedProfileTools:x,selectedEvaluationProfile:a,listProfileWorkflows:c,createSessionWithAutoTitle:n,turnRunner:u,streamOpenPondHostedChatTurn:h,publishedExperimentSource:y,standaloneExperimentOwner:D}=v,w=new AbortController,oe=G({resolveExternalDataset:p?.resolveExternalDataset,admitSession:x?.admitSession,settleSession:x?.settleSession,loadCatalog:r(e=>P({...e,store:t}),"loadCatalog"),loadTasksetPackage:r((e,i,m)=>C({store:t,storeDir:d,definition:e,profileId:i,harnessRelease:m}),"loadTasksetPackage"),store:t,storeDir:d,selectedProfile:a,createSession:n,sendTurn:r((e,i,m)=>u.sendTurn(e,i,void 0,void 0,m),"sendTurn"),interruptSessionTurn:u.interruptSessionTurn}),T=r((e,i)=>oe(e,i?AbortSignal.any([i,w.signal]):w.signal),"executeProfileEvaluationCase"),I=z({privateGradingPreflight:r(e=>Q(e,!1),"privateGradingPreflight"),resolveExternalDataset:p?.resolveExternalDataset,sourceCandidate:p?.sourceCandidate,loadCatalog:r(e=>P({...e,store:t}),"loadCatalog"),selectedWorkflows:c,loadTasksetPackage:r((e,i,m)=>C({store:t,storeDir:d,definition:e,profileId:i,harnessRelease:m}),"loadTasksetPackage"),modelConfigurationHash:r(async(e,i)=>{if(!o.profileSource||e.providerId!=="openpond"||!i.hostModelConfigurationHash)throw new Error("Hosted Profile evaluation requires an explicit source and trusted OpenPond model configuration receipt.");return i.hostModelConfigurationHash},"modelConfigurationHash"),placement:"remote"}),te=B({loadTasksetPackage:r((e,i,m)=>C({store:t,storeDir:d,definition:e,profileId:i,harnessRelease:m}),"loadTasksetPackage"),privateGrading:r(async(e,i,m)=>X({manifest:e,packageValue:i,signal:m,authorize:r(async()=>{let f=await a(),E=e.profileEvaluation;if(!f||!E||f.ref.profileId!==E.profileId||f.sourceRevision!==E.sourceRevision)throw new Error("The current private Profile source changed.");p&&await p.authorize({bindingHash:E.externalDatasetBinding.contentHash,manifestHash:e.contentHash});let O=await P({ref:f.ref,sourceRevision:f.sourceRevision,harnessRelease:E.harnessRelease,store:t});if(!E.externalDatasetBinding&&O.catalogHash!==E.catalogHash)throw new Error("The current private evaluation catalog changed.")},"authorize")}),"privateGrading"),resolveExternalDataset:p?.resolveExternalDataset,loadCatalog:r(e=>P({...e,store:t}),"loadCatalog"),store:t,selectedProfile:a,executeCase:T}),A=r((e,i)=>te(e,i?AbortSignal.any([i,w.signal]):w.signal),"executeProfileEvaluationRun"),re=V({loadCatalog:r(e=>P({...e,store:t}),"loadCatalog"),store:t,selectedWorkflows:c,prepareRun:I,executeRun:A}),b=Y({...y&&o.experimentPolicyClient?{executeHarness:r(async(e,i)=>{if(!e.harness||!D)throw new Error("Standalone Experiment source owner is unavailable.");return(await D.execute({executionId:e.id,request:e,source:e.harness,stream:ee(o.experimentPolicyClient,e,W(y.release)),signal:i,maxOutputBytes:262144})).attempt},"executeHarness")}:{},...o.experimentPolicyClient?{resolveEnvironment:r(async e=>q(o.experimentPolicyClient,e),"resolveEnvironment")}:{},resolvePolicy:r(async e=>o.experimentPolicyClient?H(o.experimentPolicyClient,e):Z({request:e,stream:h}),"resolvePolicy"),executeProfile:r(e=>{if(o.experimentPolicyClient)throw new Error("A model-case owner cannot execute a Profile.");return T(e)},"executeProfile")});return{listProfileEvaluations:r(async e=>{if(e&&typeof e=="object"&&!Array.isArray(e)&&"runId"in e){let _=F.parse(e),g=await a();if(!g)throw new Error("Select a Profile before inspecting an evaluation run.");return K({store:t,profileRef:g.ref,..._})}if(o.profileSource&&l){let _=await P({store:t,ref:{source:"openpond_git",repositoryId:o.profileSource.repositoryId,profileId:o.profileSource.profileId},sourceRevision:o.profileSource.sourceRevision,harnessRelease:{id:l.harnessRelease.id,contentHash:l.harnessRelease.contentHash}}),[g,ae,se]=await Promise.all([t.listProfileEvaluationRuns({source:"openpond_git",repositoryId:o.profileSource.repositoryId,profileId:o.profileSource.profileId}),t.listProfileEvaluationComparisons({source:"openpond_git",repositoryId:o.profileSource.repositoryId,profileId:o.profileSource.profileId}),t.listProfileEvaluationSuiteRuns({source:"openpond_git",repositoryId:o.profileSource.repositoryId,profileId:o.profileSource.profileId})]);return{..._,runs:g,comparisons:ae,suiteRuns:se}}let[i,m]=await Promise.all([J(),k()]);if(!i.lastUsed)throw new Error("Select a Profile before loading its evaluations.");let f=await L({store:t,storeDir:d,ref:i.lastUsed,profile:m,reloadProfile:k}),E=await P({store:t,ref:f.profileRef,sourceRevision:f.sourceRevision,harnessRelease:f.harnessRelease}),[O,ne,ie]=await Promise.all([t.listProfileEvaluationRuns(f.profileRef),t.listProfileEvaluationComparisons(f.profileRef),t.listProfileEvaluationSuiteRuns(f.profileRef)]);return{...E,runs:O,comparisons:ne,suiteRuns:ie}},"listProfileEvaluations"),executeProfileEvaluationCase:T,executeExperimentCase:b.execute,cancelExperimentCase:r(e=>Promise.resolve(b.cancel(s.object({id:s.string().min(1)}).strict().parse(e).id)),"cancelExperimentCase"),executeProfileEvaluationRun:A,prepareProfileEvaluationRun:I,runPreparedProfileEvaluation:r(async e=>A(await I(e,{requireExpectedManifestHash:!0})),"runPreparedProfileEvaluation"),runProfileEvaluationSuite:re,compareProfileEvaluationRuns:$({store:t,selectedProfile:a}),buildProfileEvaluationReport:r(async e=>{let i=await a();if(!i)throw new Error("Select a Profile before building an evaluation report.");return U({store:t,profileRef:i.ref,request:e})},"buildProfileEvaluationReport"),async close(){w.abort(new Error("Evaluation runtime closed")),await b.close()}}}r(Qe,"createAppServerEvaluations");export{Qe as createAppServerEvaluations};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{a as H,c as m,d as k}from"./chunk-BU27SLZP.js";import"./chunk-JORRZ4BB.js";import{d,f as p,g as f,h as w}from"./chunk-W2TICQ62.js";import"./chunk-NZTCH6K5.js";import"./chunk-AN525SPP.js";import"./chunk-IZ6DLEVY.js";import{c as R}from"./chunk-AH26AQN7.js";import"./chunk-5MHYGMJG.js";import"./chunk-LK2K3SPM.js";import"./chunk-B4RKHHF7.js";import"./chunk-DLANLLKH.js";import"./chunk-YU3C6U5V.js";import"./chunk-LKKMLBOH.js";import"./chunk-M3FLEZ4E.js";import"./chunk-OQPJ7FJF.js";import"./chunk-WBUK73ST.js";import"./chunk-P7HRF4FM.js";import"./chunk-GS6ZUSIN.js";import"./chunk-2ITZW2CN.js";import"./chunk-OG33QAG6.js";import"./chunk-W5W4IODW.js";import"./chunk-PWK5Z5S3.js";import"./chunk-W45RKGM6.js";import"./chunk-MWXW2CA6.js";import"./chunk-L3KS6MOV.js";import"./chunk-M3SCON53.js";import"./chunk-IZ56L2ZK.js";import"./chunk-KCJVFLBB.js";import"./chunk-3YXYBYWK.js";import"./chunk-MPNJ2BB4.js";import"./chunk-KOKX7PBS.js";import"./chunk-V7KR74NO.js";import"./chunk-XGY4OQLC.js";import"./chunk-7O6Z3VOZ.js";import"./chunk-5EP2DZLJ.js";import"./chunk-IDOGNIMV.js";import"./chunk-W45RKGM6.js";import"./chunk-PBTXLQAU.js";import"./chunk-7WYL2IDD.js";import"./chunk-HFJUXKT5.js";import"./chunk-5ZBLCWEJ.js";import"./chunk-PCB65K4G.js";import"./chunk-6RS4NAOY.js";import"./chunk-ZZHXQCNB.js";import"./chunk-YNQWJWIC.js";import"./chunk-VNJAAYNQ.js";import"./chunk-7ZLXFKRI.js";import"./chunk-7HRLWPPZ.js";import"./chunk-MTP3B2SU.js";import"./chunk-LAOLJDVB.js";import"./chunk-UWHIU24L.js";import"./chunk-LV3CQ72P.js";import"./chunk-ABF3W2MO.js";import"./chunk-RV7PUSI2.js";import"./chunk-KCV5VN4X.js";import"./chunk-6FA3GG5B.js";import"./chunk-2EPR4HLF.js";import"./chunk-BKEDG3A4.js";import"./chunk-OE22TAXP.js";import"./chunk-UGOK7VTC.js";import"./chunk-J572ANHX.js";import"./chunk-PBZCXPPC.js";import"./chunk-NJLULBTM.js";import"./chunk-VVNV4NNW.js";import"./chunk-PF56N7ZY.js";import{a as t}from"./chunk-FTQLQJQV.js";function b(i){let{store:n,storeDir:s,backgroundReview:r,harnessEvaluationEnabled:o,harnessTasksetReview:c}=i,v=new AbortController,u=t(e=>{let g=e.signal?AbortSignal.any([e.signal,v.signal]):v.signal;return i.harnessEvaluationReviewStream({...e,signal:g})},"harnessEvaluationReviewStream"),l=m({store:n,storeDir:s,evaluationReviewStream:u});return{inspectHarness:t(()=>k(n),"inspectHarness"),reviewHarnessProposal:a(r,"Harness review",l.reviewHarnessProposalPayload),reviewHarness:a(o,"Harness evaluation",e=>H({store:n,request:e,stream:u,continuation:{storeDir:s,stream:u}})),acceptHarnessEvaluationReview:a(o,"Tasksets",e=>c.acceptEvaluationReview(e)),materializeHarnessEvaluationTaskset:a(o,"Tasksets",e=>c.materializeEvaluationTaskset(e)),runHarnessEvaluationBaseline:a(o,"Tasksets",e=>c.runEvaluationBaseline(e)),validateHarness:t(async()=>{let e=await R(n);return e?{valid:!0,workspaceId:e.workspaceId,harnessRelease:e.harnessRelease,agentSnapshot:e.agentSnapshot}:{valid:!1,reason:"No app-server Harness release is selected."}},"validateHarness"),updateHarnessBackgroundReview:a(r,"Background review",l.updateHarnessBackgroundReviewPayload),diffHarness:l.harnessDiffPayload,rollbackHarness:l.rollbackHarnessPayload,inspectRefiner:a(r,"Refiner",()=>d(s)),updateRefiner:a(r,"Refiner",e=>p(s,e)),activateRefiner:a(r,"Refiner",e=>f(s,e)),rollbackRefiner:a(r,"Refiner",e=>w(s,e)),async close(){v.abort(new Error("Harness runtime closed"))}}}t(b,"createAppServerHarnessServices");function a(i,n,s){return async(...r)=>{if(!i)throw new Error(`${n} is disabled in this app-server deployment.`);return s(...r)}}t(a,"guardService");export{b as createAppServerHarnessServices};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{l as c,m as d}from"./chunk-R6VJDOQM.js";import"./chunk-FYYYECHE.js";import"./chunk-2V4LPUBH.js";import"./chunk-N4VHLJBZ.js";import"./chunk-R6WMY6AH.js";import"./chunk-NZTCH6K5.js";import"./chunk-URNMC46H.js";import"./chunk-4SZ3HKHU.js";import{b}from"./chunk-RFMME46Z.js";import"./chunk-DQI5TE6A.js";import"./chunk-7R56WC7L.js";import"./chunk-VFH5C6D2.js";import"./chunk-AN525SPP.js";import"./chunk-IZ6DLEVY.js";import"./chunk-DTTFUANI.js";import"./chunk-EZRUWIP6.js";import"./chunk-SYUKES6H.js";import"./chunk-4NXEYPPX.js";import"./chunk-AH26AQN7.js";import"./chunk-5MHYGMJG.js";import{e as a}from"./chunk-XNOMIWEY.js";import"./chunk-LK2K3SPM.js";import"./chunk-MEGKXGW3.js";import"./chunk-ZG6353RM.js";import"./chunk-7PXZ4X4P.js";import"./chunk-N73MU2C3.js";import"./chunk-ELX7VRSU.js";import"./chunk-CZ5R4JXZ.js";import"./chunk-FAKDGLZQ.js";import"./chunk-GW766ZSO.js";import"./chunk-G32BO6M5.js";import"./chunk-NLYZ5K7U.js";import"./chunk-7KWD2I6W.js";import"./chunk-WWQNMC7C.js";import"./chunk-B4RKHHF7.js";import"./chunk-DLANLLKH.js";import"./chunk-YU3C6U5V.js";import"./chunk-ZYVHOVKL.js";import"./chunk-KVTBX2UP.js";import"./chunk-LKKMLBOH.js";import"./chunk-ERL2M773.js";import"./chunk-GXCUH2VV.js";import"./chunk-4ZBOYWQ3.js";import"./chunk-DMFUEUAZ.js";import"./chunk-JHR3LF2F.js";import"./chunk-M3FLEZ4E.js";import"./chunk-OQPJ7FJF.js";import"./chunk-WBUK73ST.js";import"./chunk-P7HRF4FM.js";import"./chunk-GS6ZUSIN.js";import"./chunk-2ITZW2CN.js";import"./chunk-OG33QAG6.js";import"./chunk-W5W4IODW.js";import"./chunk-PWK5Z5S3.js";import"./chunk-W45RKGM6.js";import"./chunk-MWXW2CA6.js";import"./chunk-L3KS6MOV.js";import"./chunk-M3SCON53.js";import"./chunk-IZ56L2ZK.js";import"./chunk-KCJVFLBB.js";import"./chunk-3YXYBYWK.js";import"./chunk-MPNJ2BB4.js";import"./chunk-KOKX7PBS.js";import"./chunk-V7KR74NO.js";import"./chunk-XGY4OQLC.js";import"./chunk-7O6Z3VOZ.js";import"./chunk-5EP2DZLJ.js";import"./chunk-IDOGNIMV.js";import"./chunk-W45RKGM6.js";import"./chunk-PBTXLQAU.js";import"./chunk-7WYL2IDD.js";import"./chunk-4N4EH3RJ.js";import"./chunk-HFJUXKT5.js";import"./chunk-5ZBLCWEJ.js";import"./chunk-JFXINDOQ.js";import"./chunk-PCB65K4G.js";import"./chunk-6RS4NAOY.js";import"./chunk-ZZHXQCNB.js";import"./chunk-YNQWJWIC.js";import"./chunk-VNJAAYNQ.js";import"./chunk-7ZLXFKRI.js";import"./chunk-7HRLWPPZ.js";import"./chunk-MTP3B2SU.js";import"./chunk-OSVGNONV.js";import"./chunk-2LJCJOJ7.js";import"./chunk-YBNKGA5C.js";import"./chunk-LAOLJDVB.js";import"./chunk-UWHIU24L.js";import"./chunk-JCLTFDVW.js";import"./chunk-LV3CQ72P.js";import"./chunk-ABF3W2MO.js";import"./chunk-RV7PUSI2.js";import"./chunk-KCV5VN4X.js";import"./chunk-6FA3GG5B.js";import"./chunk-2EPR4HLF.js";import"./chunk-BKEDG3A4.js";import"./chunk-OE22TAXP.js";import"./chunk-UGOK7VTC.js";import"./chunk-J572ANHX.js";import"./chunk-PBZCXPPC.js";import"./chunk-NJLULBTM.js";import"./chunk-VVNV4NNW.js";import"./chunk-PF56N7ZY.js";import"./chunk-FTQLQJQV.js";export{a as AGENT_PROTOCOL_VERSION,c as APP_SERVER_COMPOSITION,d as createOpenPondAppServer,b as runAppServerJsonl};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{f as $,g as J,h as L,i as v,j as q}from"./chunk-GPL2Z65R.js";import{c as g}from"./chunk-SXMR6E2W.js";import"./chunk-2HAWOMZK.js";import"./chunk-SFKZITAG.js";import"./chunk-XRKFTPHD.js";import{f as m,h as y}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{a as S,f as w,j as T,k as j}from"./chunk-3M53YXEI.js";import{b as H,c as Q}from"./chunk-22UARBPW.js";import{J as C,K as G,L as k,O as W,Q as M,S as z,T as F,c as D,m as K,r as V,s as _}from"./chunk-MILEWROZ.js";import"./chunk-OTUBJV6C.js";import"./chunk-27JGS3KB.js";import"./chunk-BT5YNE5U.js";import{d as f}from"./chunk-UTNGEMW5.js";import"./chunk-U2K7QJCG.js";import"./chunk-WSOUMXH3.js";import"./chunk-N42HT64M.js";import"./chunk-NG2L6D7G.js";import"./chunk-GLUWATL5.js";import"./chunk-OSVGNONV.js";import"./chunk-2LJCJOJ7.js";import"./chunk-YBNKGA5C.js";import"./chunk-LAOLJDVB.js";import"./chunk-UWHIU24L.js";import"./chunk-JCLTFDVW.js";import"./chunk-LV3CQ72P.js";import"./chunk-ABF3W2MO.js";import"./chunk-RV7PUSI2.js";import"./chunk-KCV5VN4X.js";import"./chunk-2EPR4HLF.js";import"./chunk-BKEDG3A4.js";import"./chunk-OE22TAXP.js";import"./chunk-UGOK7VTC.js";import"./chunk-J572ANHX.js";import"./chunk-PBZCXPPC.js";import"./chunk-NJLULBTM.js";import"./chunk-VVNV4NNW.js";import"./chunk-PF56N7ZY.js";import{a as p}from"./chunk-FTQLQJQV.js";async function ie(){let e=await f(),s=m(e),t=await g(e,s),n=y(e),r=await L({apiBase:n,apiKey:t});console.log(JSON.stringify(r,null,2))}p(ie,"runAppsTools");async function se(e){let s=await f(),t=m(s),n=y(s),r=await g(s,t),i=typeof e.handle=="string"?String(e.handle):void 0,o=i?$(i):null,c=e.refresh!==void 0?w(e.refresh):void 0,l=await J({apiBase:n,apiKey:r,forceRefresh:c}),u=o?l.filter(a=>$(a.handle||a.gitOwner)===o):l;if(u.length===0){console.log("no apps found");return}if(w(e.json)){console.log(JSON.stringify({apps:u},null,2));return}for(let a of u){let d=a.handle||a.gitOwner||"unknown",h=a.repo||a.gitRepo||a.id,B=a.latestDeployment?.status||"no-deploy",R=a.latestDeployment?.gitBranch||a.defaultBranch||"-",I=a.codeVisibility||"unknown",E=a.sandbox?"yes":"no";console.log(`${d}/${h} ${B} ${R} code=${I} sandbox=${E} ${a.id}`)}}p(se,"runAppsList");async function oe(e,s){let t=typeof e.visibility=="string"?e.visibility.trim():typeof e.codeVisibility=="string"?e.codeVisibility.trim():"";if(t!=="public"&&t!=="private")throw new Error("usage: apps code-visibility <handle>/<repo> --visibility public|private");let n=await f(),r=m(n),i=y(n),o=await g(n,r),{app:c,handle:l,repo:u}=await v(i,o,s),a=await K(i,o,c.id,t);console.log(`${l}/${u} code_visibility=${a.app?.codeVisibility??t} app_id=${c.id}`)}p(oe,"runAppsCodeVisibility");async function ae(e){let s=await f(),t=m(s),n=await g(s,t),r=y(s),i=typeof e.appId=="string"?String(e.appId):void 0,o=await G(r,n,{appId:i});console.log(JSON.stringify(o,null,2))}p(ae,"runAppsPerformance");async function ce(e,s){let t=await f(),n=m(t),r=y(t),i=await g(t,n),{app:o}=await v(r,i,s),c=await k(r,i,o.id);console.log(JSON.stringify(c,null,2))}p(ce,"runAppsSummary");async function le(e,s,t,n){let r=(typeof e.prompt=="string"?e.prompt:null)||n.join(" ");if(!r.trim())throw new Error("usage: apps assistant <plan|performance> <handle>/<repo> --prompt <text>");let i=await f(),o=m(i),c=y(i),l=await g(i,o),{app:u}=await v(c,l,t),a=await W(c,l,{appId:u.id,mode:s,prompt:r.trim()});console.log(JSON.stringify(a,null,2))}p(le,"runAppsAssistant");async function de(e,s){let t=await f(),n=m(t),r=await g(t,n),i=y(t),o=(typeof e.prompt=="string"?e.prompt:null)||s.join(" ");if(!o.trim())throw new Error("usage: apps agent create --prompt <text> [--team-id <id>]");let c=typeof e.templateRepoUrl=="string"?e.templateRepoUrl:void 0,l=typeof e.templateBranch=="string"?e.templateBranch:void 0,u=typeof e.templateLocalPath=="string"?e.templateLocalPath:void 0,a=typeof e.teamId=="string"&&e.teamId.trim()?e.teamId.trim():void 0;if(u&&String(u).trim().length>0)throw new Error("templateLocalPath is not supported; use templateRepoUrl");let d=typeof e.env=="string"?S(e.env,"env"):void 0;if(d){if(typeof d!="object"||Array.isArray(d))throw new Error("env must be a JSON object");for(let[b,A]of Object.entries(d))if(typeof A!="string")throw new Error(`env value for ${b} must be a string`)}let h=c||l||d?{templateRepoUrl:c,templateBranch:l,envVars:d}:void 0,B=typeof e.deployEnvironment=="string"?e.deployEnvironment==="preview"?"preview":"production":void 0,R=e.deployDisabled!==void 0?w(e.deployDisabled):void 0,I=e.streamDeployLogs!==void 0?w(e.streamDeployLogs):!0,E=await C(i,r,{prompt:o.trim(),...a?{teamId:a}:{},...h?{template:h}:{},...B?{deployEnvironment:B}:{},...R!==void 0?{deployDisabled:R}:{},streamDeployLogs:I});if(!E.ok){let b=await E.text().catch(()=>"");throw new Error(`agent create failed: ${E.status} ${b}`)}let N=null,O=null,P=null;await H(E,{onConversationId:p(b=>{N=b},"onConversationId"),onItems:p(b=>{for(let A of b){let U=Q(A);U&&console.log(U);let x=A;!O&&typeof x.appId=="string"&&(O=x.appId),!P&&typeof x.deploymentId=="string"&&(P=x.deploymentId)}},"onItems")}),N&&console.log(`conversation_id: ${N}`),O&&console.log(`app_id: ${O}`),P&&console.log(`deployment_id: ${P}`);try{await J({apiBase:i,apiKey:r,forceRefresh:!0}),await L({apiBase:i,apiKey:r,forceRefresh:!0})}catch(b){console.warn("cache refresh failed",b)}}p(de,"runAppsAgentCreate");async function pe(e,s,t,n){let r=await f(),i=m(r),o=await g(r,i),c=y(r),l=typeof e.method=="string"?String(e.method).toUpperCase():void 0,u=l&&["GET","POST","PUT","DELETE"].includes(l)?l:void 0;if(l&&!u)throw new Error("method must be GET, POST, PUT, or DELETE");let a=typeof e.body=="string"?S(String(e.body),"body"):void 0,d=typeof e.headers=="string"?S(String(e.headers),"headers"):void 0,h=typeof e.scheduleId=="string"?String(e.scheduleId):void 0,B=w(e.notifyEmail),R=w(e.summary)||w(e.withSummary),I=await M(c,o,{appId:s,deploymentId:t,toolName:n,scheduleId:h,method:u,body:a,headers:d,notifyEmail:B||void 0});if(console.log(JSON.stringify(I,null,2)),R&&I.ok){let E=await k(c,o,s);console.log(JSON.stringify({summary:E},null,2))}}p(pe,"runAppsToolsExecute");async function ue(e,s){let t=typeof e.env=="string"?e.env:typeof e.vars=="string"?e.vars:typeof e.envVars=="string"?e.envVars:null;if(!t)throw new Error("usage: apps env set <handle>/<repo> --env <json>");let n=S(t,"env");if(!n||typeof n!="object"||Array.isArray(n))throw new Error("env must be a JSON object");let r={};for(let[d,h]of Object.entries(n)){if(typeof h!="string")throw new Error(`env value for ${d} must be a string`);if(!d.startsWith("OPENTOOL_PUBLIC_"))throw new Error("only OPENTOOL_PUBLIC_ env vars can be set");r[d]=h}let i=await f(),o=m(i),c=y(i),l=await g(i,o),{app:u}=await v(c,l,s),a=await V(c,l,u.id,{envVars:r});console.log(JSON.stringify(a,null,2))}p(ue,"runAppsEnvSet");async function fe(e,s){let t=await f(),n=m(t),r=y(t),i=await g(t,n),{app:o}=await v(r,i,s),c=await _(r,i,o.id);console.log(JSON.stringify(c,null,2))}p(fe,"runAppsEnvGet");async function ge(e,s){let t=await f(),n=m(t),r=y(t),i=await g(t,n),{app:o,handle:c,repo:l}=await v(r,i,s),u=typeof e.env=="string"?e.env:typeof e.environment=="string"?e.environment:void 0,a=j(u),d=await D(r,i,o.id,{environment:a});console.log(JSON.stringify(d,null,2)),(w(e.watch)||w(e.wait)||w(e.follow))&&await q({baseUrl:r,apiKey:i,deploymentId:d.deploymentId,prefix:`[${c}/${l}] `,intervalMs:e.interval?Number(e.interval):void 0,timeoutMs:e.timeout?Number(e.timeout):void 0})}p(ge,"runAppsDeploy");function X(e){let s={};if(typeof e.params=="string"){let n=S(String(e.params),"params");if(!n||typeof n!="object"||Array.isArray(n))throw new Error("params must be a JSON object");for(let[r,i]of Object.entries(n))i!==void 0&&(s[r]=typeof i=="string"?i:JSON.stringify(i))}let t=p((n,r)=>{r===void 0||r===""||(s[n]=r)},"addParam");if(t("source",typeof e.source=="string"?e.source.trim():void 0),t("symbol",typeof e.symbol=="string"?e.symbol.trim():void 0),t("cursor",typeof e.cursor=="string"?e.cursor.trim():void 0),t("status",typeof e.status=="string"?e.status.trim():void 0),t("backtestRunId",typeof e.runId=="string"?e.runId.trim():typeof e.backtestRunId=="string"?e.backtestRunId.trim():void 0),t("since",T(e.since,"since")),t("until",T(e.until,"until")),typeof e.limit=="string"&&e.limit.trim().length>0){let n=Number.parseInt(e.limit,10);if(!Number.isFinite(n))throw new Error("limit must be a number");t("limit",String(n))}return Object.keys(s).length?s:void 0}p(X,"resolveBacktestEventsParams");async function me(e,s){let t=await f(),n=m(t),r=await g(t,n),i=y(t),{app:o}=await v(i,r,s),c={...X(e)??{},appId:o.id},l=await z(i,r,{method:"GET",query:c});console.log(JSON.stringify(l,null,2))}p(me,"runBacktestEvents");async function ye(e,s){let t=typeof e.runId=="string"?e.runId.trim():typeof e.backtestRunId=="string"?e.backtestRunId.trim():"";if(!t)throw new Error("usage: backtest get <handle>/<repo> --run-id <id>");let n=await f(),r=m(n),i=await g(n,r),o=y(n),{app:c}=await v(o,i,s),l=await F(o,i,{appId:c.id,runId:t});console.log(JSON.stringify(l,null,2))}p(ye,"runBacktestGet");export{X as resolveBacktestEventsParams,de as runAppsAgentCreate,le as runAppsAssistant,oe as runAppsCodeVisibility,ge as runAppsDeploy,fe as runAppsEnvGet,ue as runAppsEnvSet,se as runAppsList,ae as runAppsPerformance,ce as runAppsSummary,ie as runAppsTools,pe as runAppsToolsExecute,me as runBacktestEvents,ye as runBacktestGet};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{E as x,n as v}from"./chunk-GXCUH2VV.js";import{a as l,c as j}from"./chunk-JHR3LF2F.js";import{L as w,b as g,ob as p,tb as y,va as P,wc as E}from"./chunk-M3FLEZ4E.js";import{m as f}from"./chunk-5ZBLCWEJ.js";import{s as S}from"./chunk-UGOK7VTC.js";import{A as s}from"./chunk-PF56N7ZY.js";import{a as n}from"./chunk-FTQLQJQV.js";function z(e){if(e.kind==="command"||e.kind==="file_change")return!0;if(e.kind!=="permissions")return!1;try{let o=JSON.parse(e.detail);return!o.questions&&Array.isArray(o.options)&&o.options.some(r=>r.kind==="allow_once")&&o.options.some(r=>r.kind==="reject_once")}catch{return!1}}n(z,"remoteApprovalSupported");import{createHash as A}from"node:crypto";import{realpath as R,stat as O}from"node:fs/promises";var k=n(e=>A("sha256").update(g("POST","/local/ponder-project",e)).digest("hex"),"hash"),_=s.object({projectId:s.string().min(1).max(200),name:s.string().min(1).max(300),cwd:s.string().min(1).max(8192),sourceFolders:s.array(s.object({path:s.string().min(1).max(8192),realpath:s.string().min(1).max(8192)}).strict()).min(1).max(1e3),configurationHash:s.string().regex(/^[a-f0-9]{64}$/),revision:s.string().regex(/^[a-f0-9]{64}$/)}).strict();function X(e){let o=Object.values(S(e,"saved_local_projects"));if(o.length>p)throw new Error("ponder_desktop_project_sharing_limit_exceeded");return o.map(r=>f.parse(r.value))}n(X,"readPonderLocalProjects");async function Y(e){if(e.hiddenFromDefaultSidebar)throw new Error("ponder_desktop_project_unavailable");let o=[...new Set([...e.sourceFolders??[e.path],e.path,...e.repoPath?[e.repoPath]:[]])];if(!o.length||o.length>1e3)throw new Error("ponder_desktop_project_folder_limit_exceeded");let r=await R(e.workspacePath);if(!(await O(r)).isDirectory())throw new Error("ponder_desktop_project_unavailable");let t=[];for(let c of o){let i=await R(c);if(!(await O(i)).isDirectory())throw new Error("ponder_desktop_project_unavailable");t.push({path:c,realpath:i})}let a={projectId:e.id,name:e.name,cwd:r,sourceFolders:t,configurationHash:k({id:e.id,name:e.name,path:e.path,workspacePath:e.workspacePath,repoPath:e.repoPath,sourceFolders:e.sourceFolders??null,hiddenFromDefaultSidebar:e.hiddenFromDefaultSidebar??!1})};return _.parse({...a,revision:k(a)})}n(Y,"capturePonderProjectSnapshot");import{createHash as D}from"node:crypto";var I=E,m=s.object({revision:s.number().int().positive(),owner:l,authority:I,project:_,shared:s.boolean(),updatedAt:s.string().datetime()}).strict(),b=m.omit({revision:!0}),h=n(e=>D("sha256").update(JSON.stringify(l.parse(e))).digest("hex"),"ownerKey");function N(e,o,r){let t=l.parse(o),a=I.parse(r),c=e.get("SELECT payload FROM ponder_desktop_authority WHERE id = 1"),i=c?y.parse(JSON.parse(c.payload)):null;if(!i||i.state!=="attached"||Date.parse(i.leaseExpiresAt)<=Date.now()||i.authorizationRevision!==a.authorizationRevision||!Object.entries(a.scope).every(([d,u])=>i.scope[d]===u)||i.scope.installationId!==t.installationId||i.scope.profileId!==t.profileId||i.scope.ownerUserId!==t.ownerUserId||i.scope.teamId!==t.teamId)throw new Error("ponder_desktop_project_authority_changed")}n(N,"assertAuthority");function ne(e,o){let r=b.parse(o);N(e,r.owner,r.authority);let t=h(r.owner),a=e.get("SELECT payload FROM ponder_project_sharing WHERE owner_key = ? AND project_id = ?",[t,r.project.projectId]);if(!a&&(e.get("SELECT count(*) AS count FROM ponder_project_sharing WHERE owner_key = ?",[t])?.count??0)>=p)throw new Error("ponder_desktop_project_sharing_limit_exceeded");let c=a?m.parse(JSON.parse(a.payload)):null,i=c&&c.shared===r.shared&&c.project.revision===r.project.revision&&c.authority.authorizationRevision===r.authority.authorizationRevision&&Object.entries(r.authority.scope).every(([u,L])=>c.authority.scope[u]===L),d=m.parse({...r,revision:c?c.revision+(i?0:1):1});return e.run("INSERT INTO ponder_project_sharing (owner_key, project_id, payload) VALUES (?, ?, ?) ON CONFLICT(owner_key, project_id) DO UPDATE SET payload = excluded.payload",[t,r.project.projectId,JSON.stringify(d)]),d}n(ne,"setPonderProjectSharing");function ae(e,o){let r=e.all("SELECT payload FROM ponder_project_sharing WHERE owner_key = ? ORDER BY project_id LIMIT ?",[h(o),p+1]);if(r.length>p)throw new Error("ponder_desktop_project_sharing_limit_exceeded");return r.map(t=>{let a=m.parse(JSON.parse(t.payload));if(h(a.owner)!==h(o))throw new Error("ponder_desktop_project_owner_changed");return a})}n(ae,"readPonderProjectSharing");function ie(e,o){return e.shared&&e.authority.authorizationRevision===o.authorizationRevision&&Object.entries(o.scope).every(([r,t])=>e.authority.scope[r]===t)}n(ie,"projectSharingMatchesAuthority");import{createHash as F}from"node:crypto";function ue(e,o,r){let t=F("sha256").update(JSON.stringify({ownership:x(e,o),paused:r.paused,activeTurnId:r.activeTurnId})).digest("hex");return Number.parseInt(t.slice(0,13),16)}n(ue,"remoteCommandTargetRevision");function le(e,o){let r=e.get("SELECT turn_id,paused,lease_until FROM task_inbox_turns WHERE session_id=?",[o]),t=r&&r.lease_until>Date.now()&&e.get("SELECT status FROM turns WHERE id=?",[r.turn_id])?.status==="in_progress";return{paused:!!r?.paused,activeTurnId:t?r.turn_id:null}}n(le,"readRemoteCommandTargetState");function he(e,o){if(o.payload.resume!==!0)return;if(o.action!=="follow_up")throw new Error("remote_resume_action_invalid");let r=e.get("SELECT turn_id,paused,lease_until FROM task_inbox_turns WHERE session_id=?",[o.localSessionId]),t=e.get("SELECT id,status FROM turns WHERE session_id=? ORDER BY sort_index DESC LIMIT 1",[o.localSessionId]);if(!o.expectedTurnId||t?.id!==o.expectedTurnId||r?.turn_id!==o.expectedTurnId||!r.paused||r.lease_until>Date.now()||!["completed","failed","interrupted"].includes(t.status))throw new Error("remote_resume_target_changed");e.run("UPDATE task_inbox_turns SET paused=0 WHERE session_id=?",[o.localSessionId])}n(he,"resumeRemoteTaskInput");import{createHash as M}from"node:crypto";function T(e){return w.parse({provider:e.provider,cwd:e.cwd,localProjectId:e.localProjectId,workspaceId:e.workspaceId,workspaceKind:e.workspaceKind,workspaceName:e.workspaceName,...e.modelRef?{modelRef:e.modelRef}:{},currentProfile:e.currentProfile,experience:e.experience,profileWorkflowBinding:e.profileWorkflowBinding,profileComponentBinding:e.profileComponentBinding,openPondCommandAccessMode:e.openPondCommandAccessMode})}n(T,"remoteStarterPayload");function q(e){return Number.parseInt(M("sha256").update(P({payload:T(e),owner:e.metadata?.ponderLocalOwner})).digest("hex").slice(0,13),16)}n(q,"remoteStarterRevision");function H(e,o){let r=new Map;for(let t of e){if(!j(t,o)||!t.localProjectId||!t.cwd||t.archived||t.status==="closed"||t.systemKind||t.hiddenFromDefaultSidebar||t.metadata?.nativeHistoryProjection||!v(t.provider)||["sandbox","sandbox_template","sandbox_app"].includes(t.workspaceKind??""))continue;try{T(t)}catch{continue}let a=`starter:${t.id}`;r.set(a,{source:t,target:{id:a,projectId:t.localProjectId,projectLabel:t.workspaceName??"Local project",title:`New ${t.provider} task in ${t.workspaceName??"local project"}`,revision:q(t)}})}return r}n(H,"captureRemoteStarters");function Pe(e){return async o=>{let r=await e.current();if(!r)throw new Error("remote_account_unavailable");let t=[];for(let c of await e.store.sessionShells()){let i=await e.store.getSession(c.id);i&&t.push(i)}let a=H(t,r.owner).get(o.localStarterId);if(!a||a.target.revision!==o.expectedRevision||a.target.projectId!==o.payload.projectId||a.target.revision!==o.payload.starterRevision)throw new Error("remote_starter_changed");return a.source}}n(Pe,"createRemoteStarterResolver");var C=class extends Error{constructor(r,t=409){super(r);this.status=t;this.name="LocalManagedMessageError"}status;static{n(this,"LocalManagedMessageError")}};export{ue as a,le as b,he as c,T as d,q as e,H as f,Pe as g,z as h,C as i,X as j,Y as k,ne as l,ae as m,ie as n};
@@ -0,0 +1,12 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{a as $,b as C}from"./chunk-2LJCJOJ7.js";import{b as y,c as w,e as O}from"./chunk-JCLTFDVW.js";import{a as n}from"./chunk-FTQLQJQV.js";function v(r){return{list:n((e={})=>r.listSandboxRuntimes(e),"list"),create:n(e=>r.createSandboxRuntime(e),"create"),handle:n((e,t=null)=>r.sandboxRuntime(e,t),"handle"),get:n(e=>r.getSandboxRuntime(e),"get"),createSandbox:n((e,t={},o={})=>r.createSandboxRuntimeSandbox(e,t,o),"createSandbox"),updateStatus:n((e,t)=>r.updateSandboxRuntimeStatus(e,t),"updateStatus"),events:n(e=>r.listSandboxRuntimeEvents(e),"events"),event:n((e,t)=>r.emitSandboxRuntimeEvent(e,t),"event"),checkpoint:n((e,t={})=>r.checkpointSandboxRuntime(e,t),"checkpoint"),promote:n((e,t,o={})=>r.promoteSandboxRuntime(e,t,o),"promote"),preserveSource:n((e,t={},o={})=>r.preserveSandboxRuntimeSource(e,t,o),"preserveSource")}}n(v,"createSandboxRuntimeNamespace");function A(r){return{list:n((e={})=>r.list(e),"list"),create:n(e=>r.create(e),"create"),get:n(e=>r.get(e),"get"),pricing:n(()=>r.pricing(),"pricing"),costs:n((e={})=>r.costs(e),"costs")}}n(A,"createSandboxNamespace");function j(r){return{list:n(e=>r.listProjects(e),"list"),upsert:n(e=>r.upsertProject(e),"upsert"),upsertGitRemote:n(e=>r.upsertProjectGitRemote(e),"upsertGitRemote"),get:n((e,t)=>r.getProject(e,t),"get"),update:n((e,t)=>r.updateProject(e,t),"update"),sync:n((e,t)=>r.syncProject(e,t),"sync"),ensureGitRemote:n((e,t)=>r.ensureProjectGitRemote(e,t),"ensureGitRemote"),getGitRemote:n((e,t)=>r.ensureProjectGitRemote(e,t),"getGitRemote"),git:n((e,t)=>r.ensureProjectGitRemote(e,t),"git"),uploadSource:n((e,t)=>r.uploadProjectSource(e,t),"uploadSource"),archive:n((e,t)=>r.archiveProject(e,t),"archive")}}n(j,"createSandboxProjectNamespace");function T(r){return{get:n(e=>r.getHostedProfile(e),"get"),status:n(e=>r.getHostedProfile(e),"status"),ensureHosted:n(e=>r.ensureHostedProfile(e),"ensureHosted"),push:n(e=>r.pushHostedProfile(e),"push")}}n(T,"createSandboxProfileNamespace");function k(r){return{list:n(e=>r.listAgents(e),"list"),upsert:n(e=>r.upsertAgent(e),"upsert"),get:n((e,t)=>r.getAgent(e,t),"get"),update:n((e,t)=>r.updateAgent(e,t),"update"),archive:n((e,t)=>r.archiveAgent(e,t),"archive"),run:n((e,t)=>r.runAgent(e,t),"run"),sourceDeployPlan:n((e,t)=>r.getAgentSourceDeployPlan(e,t),"sourceDeployPlan"),manifestSnapshots:n((e,t)=>r.listAgentManifestSnapshots(e,t),"manifestSnapshots"),requestSourceChecks:n((e,t)=>r.requestAgentSourceChecks(e,t),"requestSourceChecks"),configureSourceSetup:n((e,t)=>r.configureAgentSourceSetup(e,t),"configureSourceSetup"),publishSource:n((e,t)=>r.publishAgentSource(e,t),"publishSource")}}n(k,"createSandboxAgentNamespace");function E(r,e,t=null){let o=n(async(a={},d={})=>{let f=await r.getSandboxRuntime(e);return f.sandboxId?r.get(f.sandboxId):r.createSandboxRuntimeSandbox(e,a,d).then(m=>m.sandbox)},"currentSandbox"),s=n(async(a={},d={})=>{let f=await r.getSandboxRuntime(e);if(!f.sandboxId)return r.createSandboxRuntimeSandbox(e,a,d).then(h=>h.sandbox);let m=await r.get(f.sandboxId);return m.state==="stopped"?r.start(m.id,d).then(h=>h.sandbox):m.state==="archived"?r.restore(m.id).then(h=>h.sandbox):m.state==="deleted"||m.state==="error"?r.createSandboxRuntimeSandbox(e,a,d).then(h=>h.sandbox):m},"resume");return{id:e,initial:t,get:n(()=>r.getSandboxRuntime(e),"get"),sandbox:o,resume:s,createSandbox:n((a={},d={})=>r.createSandboxRuntimeSandbox(e,a,d),"createSandbox"),status:n(async a=>{if(typeof a!="string")return r.updateSandboxRuntimeStatus(e,a);let d=await r.getSandboxRuntime(e);return r.updateSandboxRuntimeStatus(e,{status:a,expectedVersion:d.version})},"status"),events:n(()=>r.listSandboxRuntimeEvents(e),"events"),event:n(a=>r.emitSandboxRuntimeEvent(e,a),"event"),recordCommit:n((a,d={})=>r.emitSandboxRuntimeEvent(e,{...d,type:d.type??"git.commit",commitSha:a}),"recordCommit"),checkpointHint:n((a={})=>r.emitSandboxRuntimeEvent(e,{type:"workflow.checkpoint_hint",summary:a.summary??a.reason??"Workflow checkpoint hint",payload:{...a.payload,reason:a.reason??null},artifactRefs:a.artifactRefs,lifecycleHint:{kind:"checkpoint",reason:a.reason??null}}),"checkpointHint"),waitForUser:n(async(a={})=>{await r.emitSandboxRuntimeEvent(e,{type:"workflow.waiting_for_user",summary:a.summary??a.reason??"Waiting for user",payload:{...a.payload,reason:a.reason??null},lifecycleHint:{kind:"waiting_for_user",reason:a.reason??null}});let d=await r.getSandboxRuntime(e);return d.status==="waiting_for_user"?d:r.updateSandboxRuntimeStatus(e,{status:"waiting_for_user",expectedVersion:d.version,summary:a.summary??a.reason,metadata:{workflowWaitForUserReason:a.reason??null}})},"waitForUser"),keepAlive:n((a={})=>{let d=D(a);return r.emitSandboxRuntimeEvent(e,{type:"workflow.keepalive",summary:a.summary??a.reason??"Workflow keepalive",payload:{...a.payload,reason:a.reason??null,keepaliveUntil:d},lifecycleHint:{kind:"keepalive",reason:a.reason??null,keepaliveUntil:d}})},"keepAlive"),checkpoint:n(a=>r.checkpointSandboxRuntime(e,a),"checkpoint"),files:{write:n(async(a,d)=>r.uploadFile((await s()).id,a,d),"write"),read:n(async a=>r.downloadFile((await s()).id,a),"read"),readResponse:n(async a=>r.downloadFileResponse((await s()).id,a),"readResponse"),list:n(async(a={})=>r.listFiles((await s()).id,a),"list"),delete:n(async(a,d={})=>r.deleteFile((await s()).id,a,d),"delete"),search:n(async a=>r.searchFiles((await s()).id,a),"search"),stat:n(async a=>r.statFile((await s()).id,a),"stat"),mkdir:n(async a=>r.mkdir((await s()).id,a),"mkdir"),move:n(async a=>r.moveFile((await s()).id,a),"move")},commands:{run:n(async a=>r.exec((await s()).id,typeof a=="string"?{command:a}:a),"run")},ports:{expose:n(async a=>r.openPort((await s()).id,typeof a=="number"?{port:a}:a),"expose")},promote:n((a,d={})=>r.promoteSandboxRuntime(e,a,d),"promote"),preserveSource:n((a={},d={})=>r.preserveSandboxRuntimeSource(e,a,d),"preserveSource"),archive:n(async a=>{let d=a??(await r.getSandboxRuntime(e)).version;return r.updateSandboxRuntimeStatus(e,{status:"archived",expectedVersion:d})},"archive")}}n(E,"createSandboxRuntimeHandle");function D(r){if(r?.until instanceof Date)return r.until.toISOString();if(typeof r?.until=="string"&&r.until.trim())return new Date(r.until).toISOString();let e=typeof r?.seconds=="number"&&Number.isFinite(r.seconds)?Math.max(1,Math.trunc(r.seconds)):60;return new Date(Date.now()+e*1e3).toISOString()}n(D,"runtimeKeepaliveUntilIso");async function z(r,e={}){let t=`openpond-code-smoke-${Date.now()}`,o=`openpond-code-exec-ok:${t}`,s=`openpond-code-preview-ok:${t}`,i=`openpond-code-file-ok:${t}`,c=4173,u=null,a=null,d=!1,f=!1;try{let m=await N(r,await r.create({repo:e.repo??"https://github.com/octocat/Hello-World",resources:{cpu:e.cpu??1,memoryGb:e.memoryGb??1,diskGb:e.diskGb??8},budget:{maxUsd:e.budgetUsd??"0.05"},quotas:{maxSpendUsd:e.budgetUsd??"0.05",maxDurationSeconds:600,idleTimeoutSeconds:600,maxOpenPorts:2},metadata:{runId:t,source:"openpond-code-sandbox-smoke"}},{async:!0}));u=m.id;let h=e.expectedMppMode;if(h&&m.reservation.mpp?.mode!==h)throw new Error(`expected ${h} reservation, got ${m.reservation.mpp?.mode??"none"}`);if(!h&&!m.reservation.mpp?.mode)throw new Error("expected sandbox reservation MPP metadata");let R=await r.exec(m.id,{command:[`printf '${o}\\n'`,"test -f README && printf 'repo-clone-ok\\n'","cat > server.cjs <<'EOF'","const { createServer } = require('node:http');",`createServer((_request, response) => response.end('${s}')).listen(${c}, '0.0.0.0');`,"EOF","nohup node server.cjs > server.log 2>&1 & sleep 1"].join(`
3
+ `),timeoutSeconds:120});if(R.command.status!=="succeeded")throw new Error(`expected command success, got ${R.command.status}`);if(!R.command.output.includes(o))throw new Error("expected exec marker");if(await r.uploadFile(m.id,"openpond-code-smoke.txt",i),await r.downloadFile(m.id,"openpond-code-smoke.txt")!==i)throw new Error("expected file roundtrip marker");let g=null;if(e.snapshot||e.fork){let S=await r.createSnapshot(m.id,{async:!0,name:`openpond-code-smoke-${t}`,replay:{entrypoints:[{command:"cat openpond-code-smoke.txt",name:"default"}],retention:{class:"pinned"},safety:{cleanup:"delete",idleTimeoutSeconds:600,internetEgress:"block",maxDurationSeconds:600,maxSpendUsd:e.budgetUsd??"0.05",publicPreview:!1},validation:{commands:[{command:"test -f openpond-code-smoke.txt"}]}}}),p=S.snapshot??(await K(r,m.id,S.snapshotJob?.snapshotId)).snapshot;if(g=p.id,p.state!=="ready")throw new Error(`expected ready snapshot, got ${p.state}`)}if(e.fork){if(!g)throw new Error("expected snapshot id before fork");let S=await N(r,(await r.forkSnapshot(g,{budget:{maxUsd:e.budgetUsd??"0.05"},metadata:{source:"openpond-code-sandbox-smoke-fork",templateSnapshotId:g}},{async:!0})).sandbox);a=S.id;let p=await r.exec(S.id,{command:"cat openpond-code-smoke.txt",timeoutSeconds:120});if(p.command.status!=="succeeded")throw new Error(`expected fork command success, got ${p.command.status}`);if(!p.command.output.includes(i))throw new Error("expected fork snapshot marker");e.keep||(await q(r,S.id),f=!0)}let x=null;if(e.preview!==!1){let S=await r.openPort(m.id,{label:"openpond-code-smoke",port:c}),p=await fetch(S.preview.url);x=p.status;let F=await p.text();if(p.status!==200)throw new Error(`expected preview HTTP 200, got ${p.status}`);if(!F.includes(s))throw new Error("expected preview marker")}let{sandbox:M,receipts:B}=await H(r,m.id);return e.keep||(await q(r,m.id),d=!0),{deleted:d,execOutput:R.command.output.trim(),fileRoundtrip:!0,forkSandboxId:a,previewStatus:x,receiptRefs:B.map(S=>S.mpp.receiptRef??null),reservationRef:m.reservation.mpp?.reservationRef??null,runId:t,sandboxId:m.id,snapshotId:g,state:M.state}}finally{a&&!e.keep&&!f&&await L(r,a),u&&!e.keep&&!d&&await L(r,u)}}n(z,"runSandboxSmoke");async function H(r,e){try{await r.stop(e)}catch{await r.stop(e,{async:!0})}let t=await J(r,e,new Set(["stopped","deleted"]),"stop"),o=await G(r,e);if(o.length===0)throw new Error("expected receipt readback");return{sandbox:t,receipts:o}}n(H,"stopSandboxForSmoke");async function q(r,e){try{let t=await r.delete(e);if(t.state==="deleted")return t;await r.delete(e,{async:!0})}catch{await r.delete(e,{async:!0})}return J(r,e,new Set(["deleted"]),"delete")}n(q,"deleteSandboxForSmoke");async function L(r,e){try{await q(r,e)}catch{await r.delete(e,{async:!0}).catch(()=>{})}}n(L,"cleanupSandboxBestEffort");async function J(r,e,t,o){let c=Date.now()+3e5,u=await r.get(e);for(;Date.now()<c;){if(t.has(u.state))return u;if(u.state==="error")throw new Error(`sandbox ${o} failed: ${e}`);await I(3e3),u=await r.get(e)}throw new Error(`sandbox ${o} did not reach ${[...t].join("/")} before timeout: ${e} (${u.state})`)}n(J,"waitForSandboxState");async function G(r,e){let s=Date.now()+12e4,i=await r.receipts(e);for(;Date.now()<s;){if(i.length>0)return i;await I(3e3),i=await r.receipts(e)}return i}n(G,"waitForReceipts");async function N(r,e){if(e.state==="running"||e.state==="stopped")return e;if(e.state==="error")throw new Error(`sandbox create failed: ${e.id}
4
+ ${e.logs.join(`
5
+ `)}`);let t=12*6e4,o=3e3,s=Date.now()+t,i=e;for(;Date.now()<s;){if(await I(o),i=await r.get(e.id),i.state==="running"||i.state==="stopped")return i;if(i.state==="error")throw new Error(`sandbox create failed: ${i.id}
6
+ ${i.logs.join(`
7
+ `)}`)}throw new Error(`sandbox create did not reach running state before timeout: ${i.id} (${i.state})`)}n(N,"waitForCreateReady");async function K(r,e,t){if(!t)throw new Error("snapshot job did not return snapshot id");let o=12*6e4,s=3e3,i=Date.now()+o,c=await r.get(e);for(;Date.now()<i;){let u=c.snapshots?.find(d=>d.id===t);if(u?.state==="ready")return{sandbox:c,snapshot:u};let a=c.snapshotJobs?.find(d=>d.snapshotId===t);if(a?.status==="failed")throw new Error(`snapshot job failed: ${a.error??t}`);await I(s),c=await r.get(e)}throw new Error(`snapshot did not reach ready state before timeout: ${t}`)}n(K,"waitForSnapshotReady");function I(r){return new Promise(e=>setTimeout(e,r))}n(I,"sleep");function l(r={}){return r.async||r.respondAsync?{Prefer:"respond-async"}:void 0}n(l,"asyncRequestHeaders");async function P(r){let e=await y(r.sandboxApiUrl,r.apiKey,r.path,{timeoutMs:0,maxResponseBytes:0});if(!e.body)return;let t=e.body.getReader(),o=new TextDecoder,s="";try{for(;;){let{done:i,value:c}=await t.read();if(i)break;s+=o.decode(c,{stream:!0});let u=s.indexOf(`
8
+
9
+ `);for(;u!==-1;){let a=s.slice(0,u);s=s.slice(u+2);let d=W(a);d&&process.stdout.write(d),u=s.indexOf(`
10
+
11
+ `)}}}finally{t.releaseLock()}}n(P,"streamSandboxEventOutput");function _(r){return typeof r=="string"?{dataBase64:Buffer.from(r,"utf-8").toString("base64")}:r instanceof Uint8Array?{dataBase64:Buffer.from(r).toString("base64")}:r}n(_,"normalizePtyInput");function W(r){if(!r.includes("event: output"))return null;let e=r.split(/\r?\n/).filter(t=>t.startsWith("data: ")).map(t=>t.slice(6));if(e.length===0)return null;try{let t=JSON.parse(e.join(`
12
+ `));return typeof t.output=="string"?t.output:null}catch{return null}}n(W,"parseProcessOutputEvent");var b=class{static{n(this,"OpenPondSandboxInstanceClient")}apiKey;apiRootUrl;sandboxApiUrl;customEndpoint;constructor(e){this.apiKey=e.apiKey,this.customEndpoint=e.customEndpoint??!1;let t=e.sandboxApiUrl??e.baseUrl??O;this.sandboxApiUrl=$(t,{apiBaseUrl:this.customEndpoint?void 0:t}),this.apiRootUrl=C(this.sandboxApiUrl)}create(e,t={}){return this.request("",{method:"POST",...this.customEndpoint?{timeoutMs:18e4}:{},headers:l(t),body:JSON.stringify(e)}).then(o=>o.sandbox)}get(e){return this.request(`/${encodeURIComponent(e)}`).then(t=>t.sandbox)}exec(e,t){return this.request(`/${encodeURIComponent(e)}/exec`,{method:"POST",body:JSON.stringify(t)})}startProcess(e,t){return this.request(`/${encodeURIComponent(e)}/processes`,{method:"POST",body:JSON.stringify(t)})}listProcesses(e){return this.request(`/${encodeURIComponent(e)}/processes`)}getProcess(e,t,o={}){let s=new URLSearchParams;return o.since!==void 0&&s.set("since",String(Math.max(0,o.since))),this.request(`/${encodeURIComponent(e)}/processes/${encodeURIComponent(t)}${s.size>0?`?${s.toString()}`:""}`)}stopProcess(e,t){return this.request(`/${encodeURIComponent(e)}/processes/${encodeURIComponent(t)}`,{method:"DELETE"})}async streamProcessOutput(e,t,o={}){let s=new URLSearchParams;o.since!==void 0&&s.set("since",String(Math.max(0,o.since))),await P({sandboxApiUrl:this.sandboxApiUrl,apiKey:this.apiKey,path:`/${encodeURIComponent(e)}/processes/${encodeURIComponent(t)}/stream${s.size>0?`?${s.toString()}`:""}`})}startPty(e,t={}){return this.request(`/${encodeURIComponent(e)}/pty`,{method:"POST",body:JSON.stringify(t)})}listPtys(e){return this.request(`/${encodeURIComponent(e)}/pty`)}getPty(e,t,o={}){let s=new URLSearchParams;return o.since!==void 0&&s.set("since",String(Math.max(0,o.since))),this.request(`/${encodeURIComponent(e)}/pty/${encodeURIComponent(t)}${s.size>0?`?${s.toString()}`:""}`)}writePtyInput(e,t,o){return this.request(`/${encodeURIComponent(e)}/pty/${encodeURIComponent(t)}/input`,{method:"POST",body:JSON.stringify(_(o))})}stopPty(e,t){return this.request(`/${encodeURIComponent(e)}/pty/${encodeURIComponent(t)}`,{method:"DELETE"})}async streamPtyOutput(e,t,o={}){let s=new URLSearchParams;o.since!==void 0&&s.set("since",String(Math.max(0,o.since))),await P({sandboxApiUrl:this.sandboxApiUrl,apiKey:this.apiKey,path:`/${encodeURIComponent(e)}/pty/${encodeURIComponent(t)}/stream${s.size>0?`?${s.toString()}`:""}`})}uploadFile(e,t,o){return this.uploadFileBase64(e,t,Buffer.from(o,"utf-8").toString("base64"))}uploadFileBase64(e,t,o){return this.request(`/${encodeURIComponent(e)}/files`,{method:"POST",body:JSON.stringify({path:t,contentsBase64:o})})}async downloadFile(e,t){let o=await this.downloadFileResponse(e,t);return Buffer.from(o.file.contentsBase64,"base64").toString("utf-8")}downloadFileResponse(e,t){let o=typeof t=="string"?{path:t}:t,s=new URLSearchParams({path:o.path});return o.offsetBytes!==void 0&&s.set("offsetBytes",String(o.offsetBytes)),o.maxBytes!==void 0&&s.set("maxBytes",String(o.maxBytes)),this.request(`/${encodeURIComponent(e)}/files?${s.toString()}`)}listFiles(e,t={}){let o=new URLSearchParams({list:"1"});return t.path&&o.set("path",t.path),t.recursive!==void 0&&o.set("recursive",String(t.recursive)),t.maxEntries!==void 0&&o.set("maxEntries",String(t.maxEntries)),this.request(`/${encodeURIComponent(e)}/files?${o.toString()}`)}deleteFile(e,t,o={}){let s=new URLSearchParams({path:t});return o.recursive!==void 0&&s.set("recursive",String(o.recursive)),this.request(`/${encodeURIComponent(e)}/files?${s.toString()}`,{method:"DELETE"})}statFile(e,t){let o=new URLSearchParams({stat:"1",path:t});return this.request(`/${encodeURIComponent(e)}/files?${o.toString()}`)}mkdir(e,t){let o=typeof t=="string"?{path:t}:t,s=new URLSearchParams({path:o.path});return o.recursive!==void 0&&s.set("recursive",String(o.recursive)),this.request(`/${encodeURIComponent(e)}/files?${s.toString()}`,{method:"PUT"})}moveFile(e,t){let o=new URLSearchParams({fromPath:t.fromPath,toPath:t.toPath});return t.overwrite!==void 0&&o.set("overwrite",String(t.overwrite)),this.request(`/${encodeURIComponent(e)}/files?${o.toString()}`,{method:"PATCH"})}searchFiles(e,t){let o=new URLSearchParams({search:"1",query:t.query});return t.path&&o.set("path",t.path),t.maxResults!==void 0&&o.set("maxResults",String(t.maxResults)),this.request(`/${encodeURIComponent(e)}/files?${o.toString()}`)}openPort(e,t){return this.request(`/${encodeURIComponent(e)}/ports`,{method:"POST",body:JSON.stringify(t)})}createSnapshot(e,t){return this.request(`/${encodeURIComponent(e)}/snapshots`,{method:"POST",body:JSON.stringify(t)})}updateSnapshot(e,t,o){return this.request(`/${encodeURIComponent(e)}/snapshots/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(o)})}validateSnapshot(e,t,o={}){return this.request(`/${encodeURIComponent(e)}/snapshots/${encodeURIComponent(t)}/validate`,{method:"POST",body:JSON.stringify(o)})}publishSnapshot(e,t){return this.request(`/${encodeURIComponent(e)}/snapshots/${encodeURIComponent(t)}/publish`,{method:"POST"})}fork(e,t={}){return this.request(`/${encodeURIComponent(e)}/fork`,{method:"POST",body:JSON.stringify(t)})}stop(e,t={}){let o=new URLSearchParams;return t.failOnUnpreservedChanges&&o.set("failOnUnpreservedChanges","true"),this.request(`/${encodeURIComponent(e)}/stop${o.size>0?`?${o.toString()}`:""}`,{method:"POST",headers:l(t)})}start(e,t={}){return this.request(`/${encodeURIComponent(e)}/start`,{method:"POST",headers:l(t)})}restore(e){return this.request(`/${encodeURIComponent(e)}/restore`,{method:"POST"})}delete(e,t={}){let o=new URLSearchParams;return t.failOnUnpreservedChanges&&o.set("failOnUnpreservedChanges","true"),this.request(`/${encodeURIComponent(e)}${o.size>0?`?${o.toString()}`:""}`,{method:"DELETE",headers:l(t)}).then(s=>s.sandbox)}receipts(e){return this.request(`/${encodeURIComponent(e)}/receipts`).then(t=>t.receipts)}logs(e){return this.request(`/${encodeURIComponent(e)}/logs`).then(t=>t.logs)}gitStatus(e){return this.request(`/${encodeURIComponent(e)}/git/status`)}gitDiff(e,t={}){return this.request(`/${encodeURIComponent(e)}/git/diff`,{method:"POST",body:JSON.stringify(t)})}gitExportPatch(e,t={}){return this.request(`/${encodeURIComponent(e)}/git/export-patch`,{method:"POST",body:JSON.stringify(t)})}gitBranch(e,t){return this.request(`/${encodeURIComponent(e)}/git/branch`,{method:"POST",body:JSON.stringify(t)})}gitCommit(e,t){return this.request(`/${encodeURIComponent(e)}/git/commit`,{method:"POST",body:JSON.stringify(t)})}gitPull(e,t={}){return this.request(`/${encodeURIComponent(e)}/git/pull`,{method:"POST",body:JSON.stringify(t)})}gitPush(e,t={}){return this.request(`/${encodeURIComponent(e)}/git/push`,{method:"POST",body:JSON.stringify(t)})}billing(e){return this.request(`/${encodeURIComponent(e)}/billing`)}pricing(){return this.request("/pricing")}costs(e={}){let t=new URLSearchParams;return e.teamId&&t.set("teamId",e.teamId),e.projectId&&t.set("projectId",e.projectId),e.agentId&&t.set("agentId",e.agentId),this.request(`/costs${t.size>0?`?${t.toString()}`:""}`)}integrationLeases(e){return this.request(`/${encodeURIComponent(e)}/integrations`)}attachIntegrationConnection(e,t){return this.request(`/${encodeURIComponent(e)}/integrations`,{method:"POST",body:JSON.stringify(t)})}removeIntegrationLease(e,t){return this.request(`/${encodeURIComponent(e)}/integrations`,{method:"DELETE",body:JSON.stringify({leaseId:t})})}async request(e,t={}){let o=await y(this.sandboxApiUrl,this.apiKey,e,this.customEndpoint?{...t,explicitBearerAuth:!0,redirect:"error"}:t);return w(o,"Sandbox request")}async requestApiRoot(e,t={}){let o=await y(this.apiRootUrl,this.apiKey,e,this.customEndpoint?{...t,explicitBearerAuth:!0,redirect:"error"}:t);return w(o,"OpenPond API request")}};var U=class extends b{static{n(this,"OpenPondSandboxClient")}runtimes=v(this);sandboxes=A(this);profile=T(this);projects=j(this);agents=k(this);list(e={}){let t=new URLSearchParams;return e.teamId&&t.set("teamId",e.teamId),e.projectId&&t.set("projectId",e.projectId),e.agentId&&t.set("agentId",e.agentId),this.request(t.size>0?`?${t.toString()}`:"").then(o=>o.sandboxes)}listSecrets(e={}){let t=new URLSearchParams;return e.teamId&&t.set("teamId",e.teamId),this.requestApiRoot(`/sandbox-secrets${t.size>0?`?${t.toString()}`:""}`).then(o=>o.secrets)}getSecret(e,t={}){let o=new URLSearchParams;return t.teamId&&o.set("teamId",t.teamId),this.requestApiRoot(`/sandbox-secrets/${encodeURIComponent(e)}${o.size>0?`?${o.toString()}`:""}`).then(s=>s.secret)}createSecret(e){return this.requestApiRoot("/sandbox-secrets",{method:"POST",body:JSON.stringify(e)}).then(t=>t.secret)}rotateSecret(e,t){let o=new URLSearchParams;t.teamId&&o.set("teamId",t.teamId);let{teamId:s,...i}=t;return this.requestApiRoot(`/sandbox-secrets/${encodeURIComponent(e)}/rotate${o.size>0?`?${o.toString()}`:""}`,{method:"POST",body:JSON.stringify(i)}).then(c=>c.secret)}attachSecret(e,t){let o=new URLSearchParams;t.teamId&&o.set("teamId",t.teamId);let{teamId:s,...i}=t;return this.requestApiRoot(`/sandbox-secrets/${encodeURIComponent(e)}/attach${o.size>0?`?${o.toString()}`:""}`,{method:"POST",body:JSON.stringify(i)}).then(c=>c.secret)}revokeSecret(e,t={}){let o=new URLSearchParams;return t.teamId&&o.set("teamId",t.teamId),this.requestApiRoot(`/sandbox-secrets/${encodeURIComponent(e)}/revoke${o.size>0?`?${o.toString()}`:""}`,{method:"POST"}).then(s=>s.secret)}deleteSecret(e,t={}){let o=new URLSearchParams;return t.teamId&&o.set("teamId",t.teamId),this.requestApiRoot(`/sandbox-secrets/${encodeURIComponent(e)}${o.size>0?`?${o.toString()}`:""}`,{method:"DELETE"}).then(s=>s.secret)}snapshotCatalog(e={}){let t=new URLSearchParams;return e.teamId&&t.set("teamId",e.teamId),e.projectId&&t.set("projectId",e.projectId),e.agentId&&t.set("agentId",e.agentId),e.q&&t.set("q",e.q),e.kind&&t.set("kind",e.kind),e.replayState&&t.set("replayState",e.replayState),e.visibility&&t.set("visibility",e.visibility),e.tag&&t.set("tag",e.tag),e.useCase&&t.set("useCase",e.useCase),e.limit&&t.set("limit",String(e.limit)),this.request(`/catalog/snapshots${t.size>0?`?${t.toString()}`:""}`)}listSandboxRuntimes(e={}){let t=new URLSearchParams;return e.teamId&&t.set("teamId",e.teamId),e.projectId&&t.set("projectId",e.projectId),e.agentId&&t.set("agentId",e.agentId),this.requestApiRoot(`/runtimes${t.size>0?`?${t.toString()}`:""}`).then(o=>o.runtimes)}listProjects(e){let t=new URLSearchParams({teamId:e.teamId});return this.requestApiRoot(`/projects?${t.toString()}`).then(o=>o.projects)}upsertProject(e){let t=new URLSearchParams({teamId:e.teamId});return this.requestApiRoot(`/projects?${t.toString()}`,{method:"POST",body:JSON.stringify(e)}).then(o=>o.project)}getHostedProfile(e){let t=new URLSearchParams({teamId:e.teamId});return this.requestApiRoot(`/profile?${t.toString()}`).then(o=>o.profile)}ensureHostedProfile(e){let t=new URLSearchParams({teamId:e.teamId});return this.requestApiRoot(`/profile/ensure?${t.toString()}`,{method:"POST"}).then(o=>{if(!o.profile)throw new Error("hosted_profile_missing");return o.profile})}pushHostedProfile(e){let t=new URLSearchParams({teamId:e.teamId}),{teamId:o,...s}=e;return this.requestApiRoot(`/profile/push?${t.toString()}`,{method:"POST",body:JSON.stringify(s)})}async upsertProjectGitRemote(e){let t=await this.upsertProject(e);return this.ensureProjectGitRemote(t.id,{teamId:e.teamId})}getProject(e,t){let o=new URLSearchParams({teamId:t.teamId});return this.requestApiRoot(`/projects/${encodeURIComponent(e)}?${o.toString()}`).then(s=>s.project)}syncProject(e,t){let o=new URLSearchParams({teamId:t.teamId});return this.requestApiRoot(`/projects/${encodeURIComponent(e)}/sync?${o.toString()}`,{method:"POST"}).then(s=>s.project)}ensureProjectGitRemote(e,t){let o=new URLSearchParams({teamId:t.teamId});return this.requestApiRoot(`/projects/${encodeURIComponent(e)}/git?${o.toString()}`,{method:"POST"})}uploadProjectSource(e,t){let o=new URLSearchParams({teamId:t.teamId}),{teamId:s,...i}=t;return this.requestApiRoot(`/projects/${encodeURIComponent(e)}/source?${o.toString()}`,{method:"POST",body:JSON.stringify(i)}).then(c=>c.project)}updateProject(e,t){let o=new URLSearchParams({teamId:t.teamId}),{teamId:s,...i}=t;return this.requestApiRoot(`/projects/${encodeURIComponent(e)}?${o.toString()}`,{method:"PATCH",body:JSON.stringify(i)}).then(c=>c.project)}archiveProject(e,t){let o=new URLSearchParams({teamId:t.teamId});return this.requestApiRoot(`/projects/${encodeURIComponent(e)}?${o.toString()}`,{method:"DELETE"}).then(s=>s.project)}listAgents(e){let t=new URLSearchParams({teamId:e.teamId});return this.requestApiRoot(`/agents?${t.toString()}`).then(o=>o.agents)}upsertAgent(e){let t=new URLSearchParams({teamId:e.teamId});return this.requestApiRoot(`/agents?${t.toString()}`,{method:"POST",body:JSON.stringify(e)}).then(o=>o.agent)}getAgent(e,t){let o=new URLSearchParams({teamId:t.teamId});return this.requestApiRoot(`/agents/${encodeURIComponent(e)}?${o.toString()}`).then(s=>s.agent)}archiveAgent(e,t){let o=new URLSearchParams({teamId:t.teamId});return this.requestApiRoot(`/agents/${encodeURIComponent(e)}?${o.toString()}`,{method:"DELETE"}).then(s=>s.agent)}updateAgent(e,t){let o=new URLSearchParams({teamId:t.teamId}),{teamId:s,...i}=t;return this.requestApiRoot(`/agents/${encodeURIComponent(e)}?${o.toString()}`,{method:"PATCH",body:JSON.stringify(i)}).then(c=>c.agent)}runAgent(e,t){let o=new URLSearchParams({teamId:t.teamId}),{teamId:s,...i}=t;return this.requestApiRoot(`/agents/${encodeURIComponent(e)}/run?${o.toString()}`,{method:"POST",headers:{Prefer:"respond-async"},body:JSON.stringify(i)})}getAgentSourceDeployPlan(e,t){let o=new URLSearchParams({teamId:t.teamId});return this.requestApiRoot(`/agents/${encodeURIComponent(e)}/source/deploy-plan?${o.toString()}`).then(s=>s.deployPlan)}listAgentManifestSnapshots(e,t){let o=new URLSearchParams({teamId:t.teamId});return t.limit!==void 0&&o.set("limit",String(t.limit)),this.requestApiRoot(`/agents/${encodeURIComponent(e)}/source/manifest-snapshots?${o.toString()}`).then(s=>s.manifestSnapshots)}requestAgentSourceChecks(e,t){let o=new URLSearchParams({teamId:t.teamId}),{teamId:s,...i}=t;return this.requestApiRoot(`/agents/${encodeURIComponent(e)}/source/checks?${o.toString()}`,{method:"POST",body:JSON.stringify(i),timeoutMs:900*1e3})}configureAgentSourceSetup(e,t){let o=new URLSearchParams({teamId:t.teamId}),{teamId:s,...i}=t;return this.requestApiRoot(`/agents/${encodeURIComponent(e)}/source/setup?${o.toString()}`,{method:"POST",body:JSON.stringify(i)})}publishAgentSource(e,t){let o=new URLSearchParams({teamId:t.teamId}),{teamId:s,...i}=t;return this.requestApiRoot(`/agents/${encodeURIComponent(e)}/source/publish?${o.toString()}`,{method:"POST",body:JSON.stringify(i)})}getMicrosoftTeamsBotOverview(e){let t=new URLSearchParams({teamId:e.teamId});return this.requestApiRoot(`/teams/bot/overview?${t.toString()}`)}bindMicrosoftTeamsBotConversation(e){return this.requestApiRoot("/teams/bot/bindings",{method:"POST",body:JSON.stringify(e)})}rebindMicrosoftTeamsBotConversation(e,t){return this.requestApiRoot(`/teams/bot/bindings/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)})}unlinkMicrosoftTeamsBotConversation(e){return this.requestApiRoot(`/teams/bot/bindings/${encodeURIComponent(e.bindingId)}`,{method:"DELETE",body:JSON.stringify({teamId:e.teamId})})}sendMicrosoftTeamsBotDiagnostic(e){return this.requestApiRoot("/teams/bot/diagnostics",{method:"POST",body:JSON.stringify(e)})}sendMicrosoftTeamsBotDiagnosticRun(e){return this.requestApiRoot("/teams/bot/diagnostics/run",{method:"POST",body:JSON.stringify(e)})}createSandboxRuntime(e){return this.requestApiRoot("/runtimes",{method:"POST",body:JSON.stringify(e)}).then(t=>t.runtime)}sandboxRuntime(e,t=null){return E(this,e,t)}getSandboxRuntime(e){return this.requestApiRoot(`/runtimes/${encodeURIComponent(e)}`).then(t=>t.runtime)}createSandboxRuntimeSandbox(e,t={},o={}){return this.requestApiRoot(`/runtimes/${encodeURIComponent(e)}/sandbox`,{method:"POST",headers:l(o),body:JSON.stringify(t)})}updateSandboxRuntimeStatus(e,t){return this.requestApiRoot(`/runtimes/${encodeURIComponent(e)}/status`,{method:"PATCH",body:JSON.stringify(t)}).then(o=>o.runtime)}listSandboxRuntimeEvents(e){return this.requestApiRoot(`/runtimes/${encodeURIComponent(e)}/events`)}emitSandboxRuntimeEvent(e,t){return this.requestApiRoot(`/runtimes/${encodeURIComponent(e)}/events`,{method:"POST",body:JSON.stringify(t)})}checkpointSandboxRuntime(e,t){return this.requestApiRoot(`/runtimes/${encodeURIComponent(e)}/checkpoints`,{method:"POST",body:JSON.stringify(t)}).then(o=>o.runtime)}promoteSandboxRuntime(e,t,o={}){let s=new URLSearchParams;return o.teamId&&s.set("teamId",o.teamId),this.requestApiRoot(`/runtimes/${encodeURIComponent(e)}/promote${s.size>0?`?${s.toString()}`:""}`,{method:"POST",body:JSON.stringify(t)})}preserveSandboxRuntimeSource(e,t={},o={}){let s=new URLSearchParams;return o.teamId&&s.set("teamId",o.teamId),this.requestApiRoot(`/runtimes/${encodeURIComponent(e)}/preserve-source${s.size>0?`?${s.toString()}`:""}`,{method:"POST",body:JSON.stringify(t)})}forkSnapshot(e,t={},o={}){let s=new URLSearchParams;t.teamId&&s.set("teamId",t.teamId),t.projectId&&s.set("projectId",t.projectId),o.async&&s.set("async","1");let{teamId:i,projectId:c,...u}=t;return this.request(`/catalog/snapshots/${encodeURIComponent(e)}/fork${s.size>0?`?${s.toString()}`:""}`,{method:"POST",headers:o.async?{Prefer:"respond-async"}:void 0,body:JSON.stringify({...u,snapshotId:e})})}templates(e={}){let t=new URLSearchParams;return e.teamId&&t.set("teamId",e.teamId),e.projectId&&t.set("projectId",e.projectId),e.q&&t.set("q",e.q),e.name&&t.set("name",e.name),e.version&&t.set("version",e.version),e.visibility&&t.set("visibility",e.visibility),e.tag&&t.set("tag",e.tag),e.useCase&&t.set("useCase",e.useCase),e.limit&&t.set("limit",String(e.limit)),this.request(`/templates${t.size>0?`?${t.toString()}`:""}`)}publishedSnapshots(e={}){let t=new URLSearchParams;return e.teamId&&t.set("teamId",e.teamId),e.projectId&&t.set("projectId",e.projectId),e.q&&t.set("q",e.q),e.name&&t.set("name",e.name),e.version&&t.set("version",e.version),e.visibility&&t.set("visibility",e.visibility),e.tag&&t.set("tag",e.tag),e.useCase&&t.set("useCase",e.useCase),e.limit&&t.set("limit",String(e.limit)),this.request(`/published-snapshots${t.size>0?`?${t.toString()}`:""}`).then(o=>{let s=o.publishedSnapshots??o.templates;return{...o,templates:s,publishedSnapshots:s}})}launchTemplate(e){let t=new URLSearchParams;e.teamId&&t.set("teamId",e.teamId),e.projectId&&t.set("projectId",e.projectId);let{teamId:o,projectId:s,...i}=e;return this.request(`/templates/launch${t.size>0?`?${t.toString()}`:""}`,{method:"POST",body:JSON.stringify(i)})}runPublishedSnapshot(e){let t=new URLSearchParams;e.teamId&&t.set("teamId",e.teamId),e.projectId&&t.set("projectId",e.projectId);let{teamId:o,projectId:s,...i}=e;return this.request(`/published-snapshots/launch${t.size>0?`?${t.toString()}`:""}`,{method:"POST",body:JSON.stringify(i)}).then(c=>{let u=c.publishedSnapshot??c.template;return{...c,template:u,publishedSnapshot:u}})}listSchedules(e={}){let t=new URLSearchParams;return e.teamId&&t.set("teamId",e.teamId),e.projectId&&t.set("projectId",e.projectId),e.sourceSandboxId&&t.set("sourceSandboxId",e.sourceSandboxId),this.request(`/schedules${t.size>0?`?${t.toString()}`:""}`)}createSchedule(e){let t=new URLSearchParams;e.projectId&&t.set("projectId",e.projectId);let{projectId:o,...s}=e;return this.request(`/schedules${t.size>0?`?${t.toString()}`:""}`,{method:"POST",body:JSON.stringify(s)})}getSchedule(e){return this.request(`/schedules/${encodeURIComponent(e)}`)}updateSchedule(e,t){return this.request(`/schedules/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)})}deleteSchedule(e){return this.request(`/schedules/${encodeURIComponent(e)}`,{method:"DELETE"})}listScheduleRuns(e,t={}){let o=new URLSearchParams;return t.limit!==void 0&&o.set("limit",String(t.limit)),this.request(`/schedules/${encodeURIComponent(e)}/runs${o.size>0?`?${o.toString()}`:""}`)}runScheduleNow(e,t={}){return this.request(`/schedules/${encodeURIComponent(e)}/run`,{method:"POST",body:JSON.stringify(t)})}listTemplateBuilds(e){let t=new URLSearchParams({teamId:e.teamId});return this.requestApiRoot(`/sandbox-template-builds?${t.toString()}`).then(o=>o.builds)}createTemplateBuild(e){return this.requestApiRoot("/sandbox-template-builds",{method:"POST",body:JSON.stringify(e)}).then(t=>t.build)}getTemplateBuild(e){return this.requestApiRoot(`/sandbox-template-builds/${encodeURIComponent(e)}`).then(t=>t.build)}getTemplateBuildLogs(e){return this.requestApiRoot(`/sandbox-template-builds/${encodeURIComponent(e)}/logs`)}cancelTemplateBuild(e){return this.requestApiRoot(`/sandbox-template-builds/${encodeURIComponent(e)}/cancel`,{method:"POST"}).then(t=>t.build)}listPublishedSnapshotBuilds(e){let t=new URLSearchParams({teamId:e.teamId});return this.requestApiRoot(`/published-snapshot-builds?${t.toString()}`).then(o=>o.builds)}createPublishedSnapshotBuild(e){return this.requestApiRoot("/published-snapshot-builds",{method:"POST",body:JSON.stringify(e)}).then(t=>t.build)}getPublishedSnapshotBuild(e){return this.requestApiRoot(`/published-snapshot-builds/${encodeURIComponent(e)}`).then(t=>t.build)}getPublishedSnapshotBuildLogs(e){return this.requestApiRoot(`/published-snapshot-builds/${encodeURIComponent(e)}/logs`)}cancelPublishedSnapshotBuild(e){return this.requestApiRoot(`/published-snapshot-builds/${encodeURIComponent(e)}/cancel`,{method:"POST"}).then(t=>t.build)}listOrganizations(){return this.requestApiRoot("/organizations").then(e=>e.organizations??e.teams??[])}createOrganization(e){return this.requestApiRoot("/organizations",{method:"POST",body:JSON.stringify(e)}).then(t=>t.organization)}getOrganization(e){return this.requestApiRoot(`/organizations/${encodeURIComponent(e)}`).then(t=>t.organization)}updateOrganization(e,t){return this.requestApiRoot(`/organizations/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)}).then(o=>o.organization)}listOrganizationMembers(e){return this.requestApiRoot(`/organizations/${encodeURIComponent(e)}/members`).then(t=>t.members)}upsertOrganizationMember(e,t){return this.requestApiRoot(`/organizations/${encodeURIComponent(e)}/members`,{method:"POST",body:JSON.stringify(t)}).then(o=>o.member)}getOrganizationMcpServer(e){return this.requestApiRoot(`/organizations/${encodeURIComponent(e)}/mcp-server`).then(t=>t.mcpServer)}generateOrganizationMcpServer(e,t={}){return this.requestApiRoot(`/organizations/${encodeURIComponent(e)}/mcp-server`,{method:"POST",body:JSON.stringify(t)}).then(o=>o.mcpServer)}rotateOrganizationMcpServer(e){return this.requestApiRoot(`/organizations/${encodeURIComponent(e)}/mcp-server/rotate`,{method:"POST"}).then(t=>t.mcpServer)}disableOrganizationMcpServer(e){return this.requestApiRoot(`/organizations/${encodeURIComponent(e)}/mcp-server/disable`,{method:"POST"}).then(t=>t.mcpServer)}enableOrganizationMcpServer(e){return this.requestApiRoot(`/organizations/${encodeURIComponent(e)}/mcp-server/enable`,{method:"POST"}).then(t=>t.mcpServer)}startReplay(e){let t=new URLSearchParams;e.teamId&&t.set("teamId",e.teamId),e.projectId&&t.set("projectId",e.projectId);let{teamId:o,projectId:s,...i}=e;return this.requestApiRoot(`/sandbox-replays${t.size>0?`?${t.toString()}`:""}`,{method:"POST",body:JSON.stringify(i)})}listReplays(e={}){let t=new URLSearchParams;return e.teamId&&t.set("teamId",e.teamId),e.projectId&&t.set("projectId",e.projectId),this.requestApiRoot(`/sandbox-replays${t.size>0?`?${t.toString()}`:""}`)}getReplay(e,t={}){let o=new URLSearchParams;return t.teamId&&o.set("teamId",t.teamId),t.projectId&&o.set("projectId",t.projectId),this.requestApiRoot(`/sandbox-replays/${encodeURIComponent(e)}${o.size>0?`?${o.toString()}`:""}`)}getReplayLogs(e,t={}){let o=new URLSearchParams;return t.teamId&&o.set("teamId",t.teamId),t.projectId&&o.set("projectId",t.projectId),this.requestApiRoot(`/sandbox-replays/${encodeURIComponent(e)}/logs${o.size>0?`?${o.toString()}`:""}`)}getReplayArtifacts(e,t={}){let o=new URLSearchParams;return t.teamId&&o.set("teamId",t.teamId),t.projectId&&o.set("projectId",t.projectId),this.requestApiRoot(`/sandbox-replays/${encodeURIComponent(e)}/artifacts${o.size>0?`?${o.toString()}`:""}`)}cancelReplay(e,t={}){let o=new URLSearchParams;return t.teamId&&o.set("teamId",t.teamId),t.projectId&&o.set("projectId",t.projectId),this.requestApiRoot(`/sandbox-replays/${encodeURIComponent(e)}/cancel${o.size>0?`?${o.toString()}`:""}`,{method:"POST"})}integrationConnections(e={}){let t=new URLSearchParams;return e.teamId&&t.set("teamId",e.teamId),e.projectId&&t.set("projectId",e.projectId),e.agentId&&t.set("agentId",e.agentId),e.status&&t.set("status",e.status),this.requestApiRoot(`/integrations/connections${t.size>0?`?${t.toString()}`:""}`)}mcpServerConfig(){return{name:"openpond-sandboxes",transport:"streamable-http",url:`${this.sandboxApiUrl}/mcp`,headers:{"openpond-api-key":this.apiKey}}}smoke(e={}){return z(this,e)}};function Re(r){return new U(r)}n(Re,"createOpenPondSandboxClient");export{U as a,Re as b};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{b as g,d as $,e as O,f as C}from"./chunk-UC3FXTDL.js";import{a as w}from"./chunk-3M53YXEI.js";import{a as r}from"./chunk-FTQLQJQV.js";var L=Symbol("openpondCliOptionValues"),a=class extends Error{static{r(this,"CliUsageError")}exitCode=2;constructor(t){super(t),this.name="CliUsageError"}},K=new Set(["maxOutputBytes","timeoutSec"]);function k(n){let t=[...n],o="",i={},e={},u=[];for(;t.length>0;){let s=t.shift();if(s==="--"){u.push(...t);break}if(s.startsWith("--")){let f=s.indexOf("="),c=f>=0?s.slice(2,f):s.slice(2),p=N(c),d=f>=0?s.slice(f+1):P(t,p,o);h(i,e,p,d,o)}else _(s)?y(s,t,i,e):o?u.push(s):o=s}return Object.defineProperty(i,L,{value:e,enumerable:!1,configurable:!1,writable:!1}),V(o,i),{command:o,options:i,rest:u}}r(k,"parseArgs");function N(n){return n.replace(/-([a-z])/g,(t,o)=>o.toUpperCase())}r(N,"normalizeCliOptionKey");function _(n){return/^-[^-].*/.test(n)&&!S(n)}r(_,"isShortOptionToken");function y(n,t,o,i){let e=n.slice(1);if(!e)return;let u=e.indexOf("="),s=u>=0?e.slice(0,u):e,f=u>=0?e.slice(u+1):null;if(s.length!==1){for(let d of s){let m=g[d];if(!m)throw new a(`unknown short option -${d}`);if(C(m)!=="boolean")throw new a(`short option -${d} requires its own value`);h(o,i,m,"true")}return}let c=g[s];if(!c)throw new a(`unknown short option -${s}`);let p=f??P(t,c);h(o,i,c,p)}r(y,"parseShortOptionToken");function P(n,t,o){let i=I(t,o);if(i==="boolean")return n[0]&&x(n[0])?n.shift():"true";if(i){let e=n.shift();if(e===void 0||R(e)&&!S(e))throw e!==void 0&&n.unshift(e),new a(`${l(t)} must be ${b(i)}`);return e}return n[0]&&!n[0].startsWith("--")?n.shift():"true"}r(P,"readOptionValue");function h(n,t,o,i,e){T(o,i,e),n[o]=i,(t[o]??=[]).push(i)}r(h,"setParsedOption");function T(n,t,o){let i=I(n,o);if(i){if(i==="boolean"){if(!x(t))throw new a(`${l(n)} must be a boolean`);return}if(t.trim().length===0||t==="true")throw new a(`${l(n)} must be ${b(i)}`);if(i==="number"||i==="integer"){let e=Number(t);if(!Number.isFinite(e))throw new a(`${l(n)} must be ${b(i)}`);if(i==="integer"&&!Number.isInteger(e))throw new a(`${l(n)} must be an integer`);if(i==="integer"&&K.has(n)&&e<=0)throw new a(`${l(n)} must be a positive integer`);return}if(i==="json")try{w(t,l(n))}catch(e){throw new a(e instanceof Error?e.message:String(e))}}}r(T,"validateParsedOptionValue");function I(n,t){return t?O(t,n):C(n)}r(I,"typedOptionKind");function l(n){return n.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}r(l,"cliOptionLabel");function E(n){return n==="json"?"JSON value":n}r(E,"optionKindLabel");function b(n){let t=E(n);return/^[aeiou]/i.test(t)?`an ${t}`:`a ${t}`}r(b,"optionKindPhrase");function x(n){return/^(true|false|1|0|yes|no)$/i.test(n)}r(x,"isBooleanLiteral");function R(n){return n.startsWith("-")&&n!=="-"}r(R,"isOptionLike");function S(n){return/^-\d+(?:\.\d+)?$/.test(n)}r(S,"isNegativeNumber");function V(n,t){let o=n?$(n):null;for(let i of Object.keys(t))if(!O(n,i)){let e=l(i),u=o?` for ${o.name}`:"";throw new a(`unknown option --${e}${u}`)}}r(V,"validateCommandOptions");export{a,k as b};
2
+ import{b as g,d as $,e as O,f as C}from"./chunk-SFKZITAG.js";import{a as w}from"./chunk-3M53YXEI.js";import{a as r}from"./chunk-FTQLQJQV.js";var L=Symbol("openpondCliOptionValues"),a=class extends Error{static{r(this,"CliUsageError")}exitCode=2;constructor(t){super(t),this.name="CliUsageError"}},K=new Set(["maxOutputBytes","timeoutSec"]);function k(n){let t=[...n],o="",i={},e={},u=[];for(;t.length>0;){let s=t.shift();if(s==="--"){u.push(...t);break}if(s.startsWith("--")){let f=s.indexOf("="),c=f>=0?s.slice(2,f):s.slice(2),p=N(c),d=f>=0?s.slice(f+1):P(t,p,o);h(i,e,p,d,o)}else _(s)?y(s,t,i,e):o?u.push(s):o=s}return Object.defineProperty(i,L,{value:e,enumerable:!1,configurable:!1,writable:!1}),V(o,i),{command:o,options:i,rest:u}}r(k,"parseArgs");function N(n){return n.replace(/-([a-z])/g,(t,o)=>o.toUpperCase())}r(N,"normalizeCliOptionKey");function _(n){return/^-[^-].*/.test(n)&&!S(n)}r(_,"isShortOptionToken");function y(n,t,o,i){let e=n.slice(1);if(!e)return;let u=e.indexOf("="),s=u>=0?e.slice(0,u):e,f=u>=0?e.slice(u+1):null;if(s.length!==1){for(let d of s){let m=g[d];if(!m)throw new a(`unknown short option -${d}`);if(C(m)!=="boolean")throw new a(`short option -${d} requires its own value`);h(o,i,m,"true")}return}let c=g[s];if(!c)throw new a(`unknown short option -${s}`);let p=f??P(t,c);h(o,i,c,p)}r(y,"parseShortOptionToken");function P(n,t,o){let i=I(t,o);if(i==="boolean")return n[0]&&x(n[0])?n.shift():"true";if(i){let e=n.shift();if(e===void 0||R(e)&&!S(e))throw e!==void 0&&n.unshift(e),new a(`${l(t)} must be ${b(i)}`);return e}return n[0]&&!n[0].startsWith("--")?n.shift():"true"}r(P,"readOptionValue");function h(n,t,o,i,e){T(o,i,e),n[o]=i,(t[o]??=[]).push(i)}r(h,"setParsedOption");function T(n,t,o){let i=I(n,o);if(i){if(i==="boolean"){if(!x(t))throw new a(`${l(n)} must be a boolean`);return}if(t.trim().length===0||t==="true")throw new a(`${l(n)} must be ${b(i)}`);if(i==="number"||i==="integer"){let e=Number(t);if(!Number.isFinite(e))throw new a(`${l(n)} must be ${b(i)}`);if(i==="integer"&&!Number.isInteger(e))throw new a(`${l(n)} must be an integer`);if(i==="integer"&&K.has(n)&&e<=0)throw new a(`${l(n)} must be a positive integer`);return}if(i==="json")try{w(t,l(n))}catch(e){throw new a(e instanceof Error?e.message:String(e))}}}r(T,"validateParsedOptionValue");function I(n,t){return t?O(t,n):C(n)}r(I,"typedOptionKind");function l(n){return n.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}r(l,"cliOptionLabel");function E(n){return n==="json"?"JSON value":n}r(E,"optionKindLabel");function b(n){let t=E(n);return/^[aeiou]/i.test(t)?`an ${t}`:`a ${t}`}r(b,"optionKindPhrase");function x(n){return/^(true|false|1|0|yes|no)$/i.test(n)}r(x,"isBooleanLiteral");function R(n){return n.startsWith("-")&&n!=="-"}r(R,"isOptionLike");function S(n){return/^-\d+(?:\.\d+)?$/.test(n)}r(S,"isNegativeNumber");function V(n,t){let o=n?$(n):null;for(let i of Object.keys(t))if(!O(n,i)){let e=l(i),u=o?` for ${o.name}`:"";throw new a(`unknown option --${e}${u}`)}}r(V,"validateCommandOptions");export{a,k as b};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{d as a,e as s}from"./chunk-JCLTFDVW.js";import{a as o}from"./chunk-FTQLQJQV.js";function p(e,i={}){let t=e.trim().replace(/\/$/,"");if(!t)throw new Error("sandbox API URL must be non-empty");let n=new URL(t),r=n.pathname.replace(/\/$/,"");if(r.endsWith("/v1/sandboxes")||r.endsWith("/api/sandboxes"))return`${n.origin}${r}`;if(r.endsWith("/v1"))return`${n.origin}${r}/sandboxes`;if(n.origin===a)return`${s}/v1/sandboxes`;let d=i.apiBaseUrl?new URL(i.apiBaseUrl).origin:s;return n.origin===d?`${n.origin}${r}/v1/sandboxes`:`${n.origin}${r}/api/sandboxes`}o(p,"normalizeSandboxApiUrl");function u(e){let i="/sandboxes";if(!e.endsWith(i))throw new Error("sandbox API URL must end with /sandboxes");return e.slice(0,-i.length)}o(u,"apiRootUrlFromSandboxApiUrl");export{p as a,u as b};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as p,b as g,c as R,f as k,g as S,m as d}from"./chunk-OZ6LRNRE.js";import{c,d as u,e as m,g as l,n as H}from"./chunk-VVNV4NNW.js";import{A as t}from"./chunk-PF56N7ZY.js";import{a as i}from"./chunk-FTQLQJQV.js";var C=t.string().trim().min(1).max(1e5),x=t.record(t.string(),t.unknown()).default({}),$=t.enum(["completed_tool_batch","before_model_step","turn_completed","turn_paused"]),_=t.object({kind:$,eventSequence:t.number().int().nonnegative(),occurredAt:m}).strict(),A=t.object({id:c,sequence:t.number().int().nonnegative().nullable(),contentHash:u}).strict(),j=t.enum(["tool_failure","retry","recovery","validation","user_turn","reusable_success","completion_detour"]),D=t.enum(["open","recovered","terminal"]),U=t.object({name:t.string().trim().min(1).max(500),invocationKey:u}).strict(),O=t.object({schemaVersion:t.literal("openpond.improvementObservation.v1"),id:c,runRef:c,turnId:c,harnessRelease:l,overlay:R.nullable(),eventRefs:t.array(A).min(1).max(100),kind:j,state:D,tool:U.nullable(),deterministicClass:t.string().trim().min(1).max(500).nullable(),summary:C,createdAt:m,metadata:x}).strict().superRefine((e,n)=>{new Set(e.eventRefs.map(a=>a.id)).size!==e.eventRefs.length&&n.addIssue({code:"custom",message:"observation event refs must be unique",path:["eventRefs"]}),["tool_failure","retry","recovery","completion_detour"].includes(e.kind)&&e.tool===null&&n.addIssue({code:"custom",message:`${e.kind} observations require a tool identity`,path:["tool"]})}),M=O.extend({contentHash:u}).strict(),B=t.object({schemaVersion:t.literal("openpond.refinementTriggerPolicy.v1"),maxEstimatedCostUsd:t.number().finite().nonnegative(),cooldownMs:t.number().int().nonnegative(),maxPendingPlans:t.number().int().min(1).max(100),maxEvidenceEvents:t.number().int().min(1).max(1e3),maxProposalEdits:t.number().int().min(1).max(1e3),maxProposalBytes:t.number().int().min(1).max(1e7)}).strict(),K=t.enum(["no_action","route_deterministically","queue_refiner"]),W=t.object({schemaVersion:t.literal("openpond.refinementTriggerDecision.v1"),id:c,runRef:c,turnId:c,harnessRelease:l,overlay:R.nullable(),observations:t.array(l).max(100),decision:K,deterministicRoute:g.nullable(),suggestedRoutes:t.array(g).max(8),reason:C,deduplicationKey:u,policy:B,estimatedMaxCostUsd:t.number().finite().nonnegative(),pendingPlanCount:t.number().int().nonnegative(),boundary:_,cooldownUntil:m.nullable(),createdAt:m,metadata:x}).strict().superRefine((e,n)=>{e.estimatedMaxCostUsd>e.policy.maxEstimatedCostUsd&&n.addIssue({code:"custom",message:"estimated Refiner cost exceeds the trigger policy budget",path:["estimatedMaxCostUsd"]}),e.pendingPlanCount>e.policy.maxPendingPlans&&n.addIssue({code:"custom",message:"pending plan count exceeds the trigger policy limit",path:["pendingPlanCount"]}),e.observations.length>e.policy.maxEvidenceEvents&&n.addIssue({code:"custom",message:"trigger observations exceed the evidence budget",path:["observations"]}),e.decision==="route_deterministically"&&e.deterministicRoute===null&&n.addIssue({code:"custom",message:"deterministic decisions require a route",path:["deterministicRoute"]}),e.decision!=="route_deterministically"&&e.deterministicRoute!==null&&n.addIssue({code:"custom",message:"only deterministic decisions may declare a deterministic route",path:["deterministicRoute"]}),e.decision==="no_action"&&e.suggestedRoutes.length>0&&n.addIssue({code:"custom",message:"no-action decisions cannot suggest routes",path:["suggestedRoutes"]}),e.decision!=="no_action"&&e.observations.length===0&&n.addIssue({code:"custom",message:"actionable trigger decisions require observations",path:["observations"]})}),z=W.extend({contentHash:u}).strict(),F=t.enum(["runtime_service","refiner_model","human_review","evaluation_system","training_system"]),q=t.object({schemaVersion:t.literal("openpond.improvementRouteDecision.v1"),id:c,trigger:l,route:g,authority:F,automatic:t.boolean(),reason:C,createdAt:m,metadata:x}).strict().superRefine((e,n)=>{e.automatic&&["human_review","evaluation_system","training_system"].includes(e.authority)&&n.addIssue({code:"custom",message:`${e.authority} routes cannot be marked automatic`,path:["automatic"]}),e.route==="training"&&e.automatic&&e.authority!=="training_system"&&n.addIssue({code:"custom",message:"automatic training routes require training-system authority",path:["authority"]})}),L=q.extend({contentHash:u}).strict(),E=t.object({schemaVersion:t.literal("openpond.harnessRefinerOutcome.v1"),id:c,trigger:l,decision:t.enum(["no_action","proposed"]),proposal:l.nullable(),reason:C,evidenceRefs:t.array(l).max(100),estimatedCostUsd:t.number().finite().nonnegative(),createdAt:m,metadata:x}).strict().superRefine((e,n)=>{e.decision==="proposed"!=(e.proposal!==null)&&n.addIssue({code:"custom",message:"proposed Refiner outcomes require a proposal; no-action outcomes cannot include one",path:["proposal"]})}),N=E.extend({contentHash:u}).strict(),G=t.enum(["applied","retained","declined","conflict","rolled_back"]),T=t.object({schemaVersion:t.literal("openpond.improvementApplyReceipt.v1"),id:c,proposal:l,beforeOverlay:R,afterOverlay:R.nullable(),decision:G,boundary:_,validationRefs:t.array(l).max(100),outcomeEvidenceRefs:t.array(A).max(1e3),rollbackOf:l.nullable(),createdAt:m,metadata:x}).strict().superRefine((e,n)=>{e.decision==="applied"!=(e.afterOverlay!==null)&&n.addIssue({code:"custom",message:"applied receipts require an after-overlay; other decisions cannot include one",path:["afterOverlay"]}),e.decision==="rolled_back"!=(e.rollbackOf!==null)&&n.addIssue({code:"custom",message:"only rollback receipts require rollbackOf",path:["rollbackOf"]})}),J=T.extend({contentHash:u}).strict();function b(e){let n=e.contentSchema.parse(e.content);return e.resultSchema.parse({...n,contentHash:H(n)})}i(b,"createHashedContract");function te(e){return b({content:e,contentSchema:O,resultSchema:M})}i(te,"createImprovementObservation");function ae(e){return b({content:e,contentSchema:W,resultSchema:z})}i(ae,"createRefinementTriggerDecision");function oe(e){return b({content:e,contentSchema:q,resultSchema:L})}i(oe,"createImprovementRouteDecision");function re(e){return b({content:e,contentSchema:E,resultSchema:N})}i(re,"createHarnessRefinerOutcome");function se(e){return b({content:e,contentSchema:T,resultSchema:J})}i(se,"createImprovementApplyReceipt");var Q=new Set(["text_instruction","memory","dependency_selection"]),X=new Set(["runtime","memory","prompt","skill"]);function Y(e){let n=p.parse(e.workspace),a=k.parse(e.proposal);if(n.ownerScope.kind!=="personal")return{eligible:!1,reason:"Team workspaces require explicit promotion authority."};if(a.requestedScope!=="personal")return{eligible:!1,reason:`${a.requestedScope} changes require explicit promotion authority.`};if(a.risk!=="low")return{eligible:!1,reason:`${a.risk} risk changes require review.`};if(!X.has(a.route))return{eligible:!1,reason:`${a.route} changes cannot auto-advance.`};if(a.edits.some(r=>r.operation==="delete"))return{eligible:!1,reason:"Delete edits require review."};let o=typeof a.metadata.generatedManifestEditId=="string"?a.metadata.generatedManifestEditId:null,s=a.edits.filter(r=>!(r.target.replaceAll("\\","/").toLowerCase()==="harness.json"&&r.id===o&&r.operation==="update"&&["prompt","skill"].includes(a.route))).map(r=>r.target.replaceAll("\\","/").toLowerCase()).filter(r=>r==="harness.json"||r==="program.json"||r.startsWith("agents/")||/\.(?:[cm]?[jt]sx?|py|sh|bash|zsh|fish|ps1|exe|dll|so|dylib)$/.test(r));if(s.length>0)return{eligible:!1,reason:`Executable or structural targets require review: ${[...new Set(s)].join(", ")}.`};let v=a.effects.filter(r=>!Q.has(r));return v.length>0?{eligible:!1,reason:`Effects require review: ${[...new Set(v)].join(", ")}.`}:{eligible:!0}}i(Y,"classifyHarnessAutoAdvanceAuthority");function de(e){let n=p.parse(e.workspace),a=k.parse(e.proposal),o=e.validations.map(y=>S.parse(y)),s={id:a.id,contentHash:a.contentHash},v=o.map(y=>({id:y.id,contentHash:y.contentHash})),r={schemaVersion:"openpond.harnessAdvanceReceipt.v1",id:e.receiptId,workspaceId:n.id,ownerScope:n.ownerScope,proposal:s,expectedWorkspaceRevision:a.expectedWorkspace.revision,observedWorkspaceRevision:n.revision,previousChannelRevision:n.currentChannel.revision,previousRelease:n.currentChannel.release,validationReceipts:v,rollbackOf:null,createdAt:e.now,metadata:{}},f=V(n,a);if(f)return{workspace:n,receipt:d({...r,nextChannelRevision:n.currentChannel.revision,nextRelease:null,decision:"conflict",reason:f})};let h=P(a,o);if(h)return{workspace:n,receipt:d({...r,nextChannelRevision:n.currentChannel.revision,nextRelease:null,decision:"retained",reason:h})};let w=Y({workspace:n,proposal:a});if(!w.eligible)return{workspace:n,receipt:d({...r,nextChannelRevision:n.currentChannel.revision,nextRelease:null,decision:"retained",reason:w.reason})};if(n.currentChannel.release?.id===e.nextRelease.id&&n.currentChannel.release.contentHash===e.nextRelease.contentHash)return{workspace:n,receipt:d({...r,nextChannelRevision:n.currentChannel.revision,nextRelease:null,decision:"retained",reason:"The candidate release is already current."})};let I=p.parse({...n,sourceRevision:e.nextSourceRevision,revision:n.revision+1,dirty:!1,currentChannel:{...n.currentChannel,release:e.nextRelease,revision:n.currentChannel.revision+1},updatedAt:e.now});return{workspace:I,receipt:d({...r,nextChannelRevision:I.currentChannel.revision,nextRelease:e.nextRelease,decision:"advanced",reason:"Validated low-risk Personal proposal advanced atomically."})}}i(de,"advanceHarnessWorkspace");function ue(e){let n=p.parse(e.workspace),a=n.revision!==e.expectedWorkspaceRevision||n.currentChannel.revision!==e.expectedChannelRevision,o={schemaVersion:"openpond.harnessAdvanceReceipt.v1",id:e.receiptId,workspaceId:n.id,ownerScope:n.ownerScope,proposal:null,expectedWorkspaceRevision:e.expectedWorkspaceRevision,observedWorkspaceRevision:n.revision,previousChannelRevision:n.currentChannel.revision,previousRelease:n.currentChannel.release,validationReceipts:[],createdAt:e.now,metadata:{}};if(a)return{workspace:n,receipt:d({...o,nextChannelRevision:n.currentChannel.revision,nextRelease:null,decision:"conflict",reason:"Workspace or current-channel revision changed before rollback.",rollbackOf:null})};let s=p.parse({...n,sourceRevision:e.targetSourceRevision,revision:n.revision+1,dirty:!1,currentChannel:{...n.currentChannel,release:e.targetRelease,revision:n.currentChannel.revision+1},updatedAt:e.now});return{workspace:s,receipt:d({...o,nextChannelRevision:s.currentChannel.revision,nextRelease:e.targetRelease,decision:"rolled_back",reason:"Current channel rolled back atomically to an immutable release.",rollbackOf:e.rollbackOf})}}i(ue,"rollbackHarnessWorkspace");function me(e){let n=p.parse(e.workspace),a=k.parse(e.proposal),o=e.validations.map(h=>S.parse(h)),s={schemaVersion:"openpond.harnessAdvanceReceipt.v1",id:e.receiptId,workspaceId:n.id,ownerScope:n.ownerScope,proposal:{id:a.id,contentHash:a.contentHash},expectedWorkspaceRevision:a.expectedWorkspace.revision,observedWorkspaceRevision:n.revision,previousChannelRevision:n.currentChannel.revision,previousRelease:n.currentChannel.release,validationReceipts:o.map(h=>({id:h.id,contentHash:h.contentHash})),rollbackOf:null,createdAt:e.now,metadata:{authority:"human_review",reviewer:e.reviewer}},v=V(n,a);if(v)return{workspace:n,receipt:d({...s,nextChannelRevision:n.currentChannel.revision,nextRelease:null,decision:"conflict",reason:v})};let r=P(a,o);if(r)return{workspace:n,receipt:d({...s,nextChannelRevision:n.currentChannel.revision,nextRelease:null,decision:"retained",reason:r})};let f=p.parse({...n,sourceRevision:e.nextSourceRevision,revision:n.revision+1,dirty:!1,currentChannel:{...n.currentChannel,release:e.nextRelease,revision:n.currentChannel.revision+1},updatedAt:e.now});return{workspace:f,receipt:d({...s,nextChannelRevision:f.currentChannel.revision,nextRelease:e.nextRelease,decision:"advanced",reason:`Validated proposal approved by ${e.reviewer} and advanced atomically.`})}}i(me,"advanceReviewedHarnessWorkspace");function V(e,n){if(n.expectedWorkspace.workspaceId!==e.id)return"Proposal targets a different Harness workspace.";if(n.expectedWorkspace.revision!==e.revision)return"Harness workspace revision changed before advancement.";if(n.expectedWorkspace.sourceRevision!==e.sourceRevision)return"Harness source revision changed before advancement.";if(n.expectedWorkspace.channelRevision!==e.currentChannel.revision)return"Harness current-channel revision changed before advancement.";let a=e.currentChannel.release;return a===null||a.id!==n.baseHarnessRelease.id||a.contentHash!==n.baseHarnessRelease.contentHash?"Proposal base Harness release is not current.":null}i(V,"workspaceConflictReason");function P(e,n){let a=new Map;for(let o of n){if(o.proposal.id!==e.id||o.proposal.contentHash!==e.contentHash)return`Validation ${o.id} is bound to a different proposal.`;a.set(o.validationId,o)}for(let o of e.validationPlan){if(!o.required)continue;let s=a.get(o.id);if(!s)return`Required validation ${o.id} is missing.`;if(s.kind!==o.kind)return`Validation ${o.id} has kind ${s.kind}; expected ${o.kind}.`;if(s.status!=="passed")return`Required validation ${o.id} did not pass (${s.status}).`}return null}i(P,"failedValidationReason");export{M as a,z as b,L as c,N as d,J as e,te as f,ae as g,oe as h,re as i,se as j,Y as k,de as l,ue as m,me as n};
2
+ import{a as p,b as g,c as R,f as k,g as S,m as d}from"./chunk-MPNJ2BB4.js";import{c,d as u,e as m,g as l,n as H}from"./chunk-VVNV4NNW.js";import{A as t}from"./chunk-PF56N7ZY.js";import{a as i}from"./chunk-FTQLQJQV.js";var C=t.string().trim().min(1).max(1e5),x=t.record(t.string(),t.unknown()).default({}),$=t.enum(["completed_tool_batch","before_model_step","turn_completed","turn_paused"]),_=t.object({kind:$,eventSequence:t.number().int().nonnegative(),occurredAt:m}).strict(),A=t.object({id:c,sequence:t.number().int().nonnegative().nullable(),contentHash:u}).strict(),j=t.enum(["tool_failure","retry","recovery","validation","user_turn","reusable_success","completion_detour"]),D=t.enum(["open","recovered","terminal"]),U=t.object({name:t.string().trim().min(1).max(500),invocationKey:u}).strict(),O=t.object({schemaVersion:t.literal("openpond.improvementObservation.v1"),id:c,runRef:c,turnId:c,harnessRelease:l,overlay:R.nullable(),eventRefs:t.array(A).min(1).max(100),kind:j,state:D,tool:U.nullable(),deterministicClass:t.string().trim().min(1).max(500).nullable(),summary:C,createdAt:m,metadata:x}).strict().superRefine((e,n)=>{new Set(e.eventRefs.map(a=>a.id)).size!==e.eventRefs.length&&n.addIssue({code:"custom",message:"observation event refs must be unique",path:["eventRefs"]}),["tool_failure","retry","recovery","completion_detour"].includes(e.kind)&&e.tool===null&&n.addIssue({code:"custom",message:`${e.kind} observations require a tool identity`,path:["tool"]})}),M=O.extend({contentHash:u}).strict(),B=t.object({schemaVersion:t.literal("openpond.refinementTriggerPolicy.v1"),maxEstimatedCostUsd:t.number().finite().nonnegative(),cooldownMs:t.number().int().nonnegative(),maxPendingPlans:t.number().int().min(1).max(100),maxEvidenceEvents:t.number().int().min(1).max(1e3),maxProposalEdits:t.number().int().min(1).max(1e3),maxProposalBytes:t.number().int().min(1).max(1e7)}).strict(),K=t.enum(["no_action","route_deterministically","queue_refiner"]),W=t.object({schemaVersion:t.literal("openpond.refinementTriggerDecision.v1"),id:c,runRef:c,turnId:c,harnessRelease:l,overlay:R.nullable(),observations:t.array(l).max(100),decision:K,deterministicRoute:g.nullable(),suggestedRoutes:t.array(g).max(8),reason:C,deduplicationKey:u,policy:B,estimatedMaxCostUsd:t.number().finite().nonnegative(),pendingPlanCount:t.number().int().nonnegative(),boundary:_,cooldownUntil:m.nullable(),createdAt:m,metadata:x}).strict().superRefine((e,n)=>{e.estimatedMaxCostUsd>e.policy.maxEstimatedCostUsd&&n.addIssue({code:"custom",message:"estimated Refiner cost exceeds the trigger policy budget",path:["estimatedMaxCostUsd"]}),e.pendingPlanCount>e.policy.maxPendingPlans&&n.addIssue({code:"custom",message:"pending plan count exceeds the trigger policy limit",path:["pendingPlanCount"]}),e.observations.length>e.policy.maxEvidenceEvents&&n.addIssue({code:"custom",message:"trigger observations exceed the evidence budget",path:["observations"]}),e.decision==="route_deterministically"&&e.deterministicRoute===null&&n.addIssue({code:"custom",message:"deterministic decisions require a route",path:["deterministicRoute"]}),e.decision!=="route_deterministically"&&e.deterministicRoute!==null&&n.addIssue({code:"custom",message:"only deterministic decisions may declare a deterministic route",path:["deterministicRoute"]}),e.decision==="no_action"&&e.suggestedRoutes.length>0&&n.addIssue({code:"custom",message:"no-action decisions cannot suggest routes",path:["suggestedRoutes"]}),e.decision!=="no_action"&&e.observations.length===0&&n.addIssue({code:"custom",message:"actionable trigger decisions require observations",path:["observations"]})}),z=W.extend({contentHash:u}).strict(),F=t.enum(["runtime_service","refiner_model","human_review","evaluation_system","training_system"]),q=t.object({schemaVersion:t.literal("openpond.improvementRouteDecision.v1"),id:c,trigger:l,route:g,authority:F,automatic:t.boolean(),reason:C,createdAt:m,metadata:x}).strict().superRefine((e,n)=>{e.automatic&&["human_review","evaluation_system","training_system"].includes(e.authority)&&n.addIssue({code:"custom",message:`${e.authority} routes cannot be marked automatic`,path:["automatic"]}),e.route==="training"&&e.automatic&&e.authority!=="training_system"&&n.addIssue({code:"custom",message:"automatic training routes require training-system authority",path:["authority"]})}),L=q.extend({contentHash:u}).strict(),E=t.object({schemaVersion:t.literal("openpond.harnessRefinerOutcome.v1"),id:c,trigger:l,decision:t.enum(["no_action","proposed"]),proposal:l.nullable(),reason:C,evidenceRefs:t.array(l).max(100),estimatedCostUsd:t.number().finite().nonnegative(),createdAt:m,metadata:x}).strict().superRefine((e,n)=>{e.decision==="proposed"!=(e.proposal!==null)&&n.addIssue({code:"custom",message:"proposed Refiner outcomes require a proposal; no-action outcomes cannot include one",path:["proposal"]})}),N=E.extend({contentHash:u}).strict(),G=t.enum(["applied","retained","declined","conflict","rolled_back"]),T=t.object({schemaVersion:t.literal("openpond.improvementApplyReceipt.v1"),id:c,proposal:l,beforeOverlay:R,afterOverlay:R.nullable(),decision:G,boundary:_,validationRefs:t.array(l).max(100),outcomeEvidenceRefs:t.array(A).max(1e3),rollbackOf:l.nullable(),createdAt:m,metadata:x}).strict().superRefine((e,n)=>{e.decision==="applied"!=(e.afterOverlay!==null)&&n.addIssue({code:"custom",message:"applied receipts require an after-overlay; other decisions cannot include one",path:["afterOverlay"]}),e.decision==="rolled_back"!=(e.rollbackOf!==null)&&n.addIssue({code:"custom",message:"only rollback receipts require rollbackOf",path:["rollbackOf"]})}),J=T.extend({contentHash:u}).strict();function b(e){let n=e.contentSchema.parse(e.content);return e.resultSchema.parse({...n,contentHash:H(n)})}i(b,"createHashedContract");function te(e){return b({content:e,contentSchema:O,resultSchema:M})}i(te,"createImprovementObservation");function ae(e){return b({content:e,contentSchema:W,resultSchema:z})}i(ae,"createRefinementTriggerDecision");function oe(e){return b({content:e,contentSchema:q,resultSchema:L})}i(oe,"createImprovementRouteDecision");function re(e){return b({content:e,contentSchema:E,resultSchema:N})}i(re,"createHarnessRefinerOutcome");function se(e){return b({content:e,contentSchema:T,resultSchema:J})}i(se,"createImprovementApplyReceipt");var Q=new Set(["text_instruction","memory","dependency_selection"]),X=new Set(["runtime","memory","prompt","skill"]);function Y(e){let n=p.parse(e.workspace),a=k.parse(e.proposal);if(n.ownerScope.kind!=="personal")return{eligible:!1,reason:"Team workspaces require explicit promotion authority."};if(a.requestedScope!=="personal")return{eligible:!1,reason:`${a.requestedScope} changes require explicit promotion authority.`};if(a.risk!=="low")return{eligible:!1,reason:`${a.risk} risk changes require review.`};if(!X.has(a.route))return{eligible:!1,reason:`${a.route} changes cannot auto-advance.`};if(a.edits.some(r=>r.operation==="delete"))return{eligible:!1,reason:"Delete edits require review."};let o=typeof a.metadata.generatedManifestEditId=="string"?a.metadata.generatedManifestEditId:null,s=a.edits.filter(r=>!(r.target.replaceAll("\\","/").toLowerCase()==="harness.json"&&r.id===o&&r.operation==="update"&&["prompt","skill"].includes(a.route))).map(r=>r.target.replaceAll("\\","/").toLowerCase()).filter(r=>r==="harness.json"||r==="program.json"||r.startsWith("agents/")||/\.(?:[cm]?[jt]sx?|py|sh|bash|zsh|fish|ps1|exe|dll|so|dylib)$/.test(r));if(s.length>0)return{eligible:!1,reason:`Executable or structural targets require review: ${[...new Set(s)].join(", ")}.`};let v=a.effects.filter(r=>!Q.has(r));return v.length>0?{eligible:!1,reason:`Effects require review: ${[...new Set(v)].join(", ")}.`}:{eligible:!0}}i(Y,"classifyHarnessAutoAdvanceAuthority");function de(e){let n=p.parse(e.workspace),a=k.parse(e.proposal),o=e.validations.map(y=>S.parse(y)),s={id:a.id,contentHash:a.contentHash},v=o.map(y=>({id:y.id,contentHash:y.contentHash})),r={schemaVersion:"openpond.harnessAdvanceReceipt.v1",id:e.receiptId,workspaceId:n.id,ownerScope:n.ownerScope,proposal:s,expectedWorkspaceRevision:a.expectedWorkspace.revision,observedWorkspaceRevision:n.revision,previousChannelRevision:n.currentChannel.revision,previousRelease:n.currentChannel.release,validationReceipts:v,rollbackOf:null,createdAt:e.now,metadata:{}},f=V(n,a);if(f)return{workspace:n,receipt:d({...r,nextChannelRevision:n.currentChannel.revision,nextRelease:null,decision:"conflict",reason:f})};let h=P(a,o);if(h)return{workspace:n,receipt:d({...r,nextChannelRevision:n.currentChannel.revision,nextRelease:null,decision:"retained",reason:h})};let w=Y({workspace:n,proposal:a});if(!w.eligible)return{workspace:n,receipt:d({...r,nextChannelRevision:n.currentChannel.revision,nextRelease:null,decision:"retained",reason:w.reason})};if(n.currentChannel.release?.id===e.nextRelease.id&&n.currentChannel.release.contentHash===e.nextRelease.contentHash)return{workspace:n,receipt:d({...r,nextChannelRevision:n.currentChannel.revision,nextRelease:null,decision:"retained",reason:"The candidate release is already current."})};let I=p.parse({...n,sourceRevision:e.nextSourceRevision,revision:n.revision+1,dirty:!1,currentChannel:{...n.currentChannel,release:e.nextRelease,revision:n.currentChannel.revision+1},updatedAt:e.now});return{workspace:I,receipt:d({...r,nextChannelRevision:I.currentChannel.revision,nextRelease:e.nextRelease,decision:"advanced",reason:"Validated low-risk Personal proposal advanced atomically."})}}i(de,"advanceHarnessWorkspace");function ue(e){let n=p.parse(e.workspace),a=n.revision!==e.expectedWorkspaceRevision||n.currentChannel.revision!==e.expectedChannelRevision,o={schemaVersion:"openpond.harnessAdvanceReceipt.v1",id:e.receiptId,workspaceId:n.id,ownerScope:n.ownerScope,proposal:null,expectedWorkspaceRevision:e.expectedWorkspaceRevision,observedWorkspaceRevision:n.revision,previousChannelRevision:n.currentChannel.revision,previousRelease:n.currentChannel.release,validationReceipts:[],createdAt:e.now,metadata:{}};if(a)return{workspace:n,receipt:d({...o,nextChannelRevision:n.currentChannel.revision,nextRelease:null,decision:"conflict",reason:"Workspace or current-channel revision changed before rollback.",rollbackOf:null})};let s=p.parse({...n,sourceRevision:e.targetSourceRevision,revision:n.revision+1,dirty:!1,currentChannel:{...n.currentChannel,release:e.targetRelease,revision:n.currentChannel.revision+1},updatedAt:e.now});return{workspace:s,receipt:d({...o,nextChannelRevision:s.currentChannel.revision,nextRelease:e.targetRelease,decision:"rolled_back",reason:"Current channel rolled back atomically to an immutable release.",rollbackOf:e.rollbackOf})}}i(ue,"rollbackHarnessWorkspace");function me(e){let n=p.parse(e.workspace),a=k.parse(e.proposal),o=e.validations.map(h=>S.parse(h)),s={schemaVersion:"openpond.harnessAdvanceReceipt.v1",id:e.receiptId,workspaceId:n.id,ownerScope:n.ownerScope,proposal:{id:a.id,contentHash:a.contentHash},expectedWorkspaceRevision:a.expectedWorkspace.revision,observedWorkspaceRevision:n.revision,previousChannelRevision:n.currentChannel.revision,previousRelease:n.currentChannel.release,validationReceipts:o.map(h=>({id:h.id,contentHash:h.contentHash})),rollbackOf:null,createdAt:e.now,metadata:{authority:"human_review",reviewer:e.reviewer}},v=V(n,a);if(v)return{workspace:n,receipt:d({...s,nextChannelRevision:n.currentChannel.revision,nextRelease:null,decision:"conflict",reason:v})};let r=P(a,o);if(r)return{workspace:n,receipt:d({...s,nextChannelRevision:n.currentChannel.revision,nextRelease:null,decision:"retained",reason:r})};let f=p.parse({...n,sourceRevision:e.nextSourceRevision,revision:n.revision+1,dirty:!1,currentChannel:{...n.currentChannel,release:e.nextRelease,revision:n.currentChannel.revision+1},updatedAt:e.now});return{workspace:f,receipt:d({...s,nextChannelRevision:f.currentChannel.revision,nextRelease:e.nextRelease,decision:"advanced",reason:`Validated proposal approved by ${e.reviewer} and advanced atomically.`})}}i(me,"advanceReviewedHarnessWorkspace");function V(e,n){if(n.expectedWorkspace.workspaceId!==e.id)return"Proposal targets a different Harness workspace.";if(n.expectedWorkspace.revision!==e.revision)return"Harness workspace revision changed before advancement.";if(n.expectedWorkspace.sourceRevision!==e.sourceRevision)return"Harness source revision changed before advancement.";if(n.expectedWorkspace.channelRevision!==e.currentChannel.revision)return"Harness current-channel revision changed before advancement.";let a=e.currentChannel.release;return a===null||a.id!==n.baseHarnessRelease.id||a.contentHash!==n.baseHarnessRelease.contentHash?"Proposal base Harness release is not current.":null}i(V,"workspaceConflictReason");function P(e,n){let a=new Map;for(let o of n){if(o.proposal.id!==e.id||o.proposal.contentHash!==e.contentHash)return`Validation ${o.id} is bound to a different proposal.`;a.set(o.validationId,o)}for(let o of e.validationPlan){if(!o.required)continue;let s=a.get(o.id);if(!s)return`Required validation ${o.id} is missing.`;if(s.kind!==o.kind)return`Validation ${o.id} has kind ${s.kind}; expected ${o.kind}.`;if(s.status!=="passed")return`Required validation ${o.id} did not pass (${s.status}).`}return null}i(P,"failedValidationReason");export{M as a,z as b,L as c,N as d,J as e,te as f,ae as g,oe as h,re as i,se as j,Y as k,de as l,ue as m,me as n};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{Ca as I,Da as H,Ra as d,Sa as r,Ta as j,Ua as m,Za as p,ea as s}from"./chunk-PGO4FRHU.js";import{Hb as y,Mb as R,Pb as P,lb as S,wb as L}from"./chunk-PBZCXPPC.js";import{n as b}from"./chunk-VVNV4NNW.js";import{A as e}from"./chunk-PF56N7ZY.js";import{a as E}from"./chunk-FTQLQJQV.js";var u=e.object({source:e.enum(["local","github","openpond_git"]),repositoryId:e.string().trim().min(1),profileId:e.string().trim().min(1)}),N=e.object({ref:u,revision:e.string().nullable(),sourceHash:e.string()});var n=e.string().trim().min(1).max(200),o=e.string().regex(/^[a-f0-9]{64}$/),k=e.enum(["queued","running","cancelling","completed","failed","cancelled","interrupted"]),z=e.object({providerId:e.enum(["openpond","custom-openai-compatible","claude-code","codex"]),modelId:e.string().trim().min(1).max(500),configurationHash:o,maxOutputTokens:e.number().int().positive().max(262144),temperature:e.number().min(0).max(2).optional(),topP:e.number().positive().max(1).optional(),messages:e.array(e.object({role:e.enum(["system","user","assistant"]),content:e.string().max(262144)}).strict()).max(200)}).strict(),Y=e.object({configuration:m,package:s}).strict(),Z=e.object({configuration:m,expectedPackageHash:o.optional()}).strict(),ee=e.object({schemaVersion:e.literal("openpond.localExperimentDefinition.v1"),location:e.literal("local"),id:n,teamId:n,ownerActorId:n,revision:e.number().int().positive(),configuration:m,model:z,packageHash:o,graders:e.array(r).min(1).max(100),availableGraders:e.array(r).min(1).max(1e3),createdAt:e.iso.datetime(),updatedAt:e.iso.datetime(),contentHash:o}).strict(),te=e.object({operationId:n,definition:d}).strict(),ne=e.object({teamId:n,id:n}).strict(),oe=e.object({teamId:n,projectId:n.optional(),status:k.optional(),datasetHash:o.optional(),search:e.string().max(100).optional(),afterId:n.optional(),limit:e.number().int().min(1).max(100).default(30)}).strict(),f=e.object({schemaVersion:e.literal("openpond.localExperimentExecution.v1"),location:e.literal("local"),id:n,teamId:n,ownerActorId:n,operationId:n,definition:d,kind:e.enum(["target","scoring"]),executionHash:o,sourceExecution:e.object({id:n,executionHash:o}).strict().nullable(),packageHash:o,maximumCostUsd:e.number().finite().positive(),status:k,createdAt:e.iso.datetime(),completedAt:e.iso.datetime().nullable(),counts:e.object({pending:e.number().int().nonnegative(),running:e.number().int().nonnegative(),completed:e.number().int().nonnegative(),failed:e.number().int().nonnegative(),cancelled:e.number().int().nonnegative(),unknown:e.number().int().nonnegative()}).strict(),usage:e.object({knownCostUsd:e.number().finite().nonnegative(),costUsd:e.number().finite().nonnegative().nullable(),heldUsd:e.number().finite().nonnegative(),uncertainRequests:e.number().int().nonnegative()}).strict(),cleanupComplete:e.boolean(),error:e.string().max(2e3).nullable()}).strict(),v=f.omit({definition:!0});function g(t,i){t.kind==="scoring"!=(t.sourceExecution!==null)&&i.addIssue({code:"custom",message:"Only retained scoring passes name an original execution."}),["completed","failed","cancelled","interrupted"].includes(t.status)&&(!t.completedAt||t.counts.pending||t.counts.running)&&i.addIssue({code:"custom",message:"Terminal local execution requires complete population accounting."}),["completed","cancelled"].includes(t.status)&&!t.cleanupComplete&&i.addIssue({code:"custom",message:"Successful completion or cancellation requires confirmed local transport cleanup."}),t.usage.uncertainRequests>0&&t.usage.costUsd!==null&&i.addIssue({code:"custom",message:"Uncertain provider charges cannot claim a measured total."})}E(g,"validateLocalExecutionState");var ie=f.superRefine(g),c=v.superRefine(g),A=e.object({configuration:p,package:s}).strict(),U=e.object({configuration:p,expectedPackageHash:e.string().regex(/^[a-f0-9]{64}$/).optional()}).strict(),x=e.object({configuration:p,model:z,packageHash:e.string().regex(/^[a-f0-9]{64}$/),graders:e.array(r).min(1).max(100),availableGraders:e.array(r).min(1).max(1e3),retainedConfigurationHash:e.string().regex(/^[a-f0-9]{64}$/).optional(),configurationHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict().superRefine((t,i)=>{let{configurationHash:a,...h}=t;b(h)!==a&&i.addIssue({code:"custom",message:"Local configuration snapshot bytes changed."})}),{definition:ae,...O}=f.shape,l=e.object({...O,kind:e.literal("target"),...x.shape}).strict().superRefine((t,i)=>{let a={configuration:t.configuration,model:t.model,packageHash:t.packageHash,graders:t.graders,availableGraders:t.availableGraders,...t.retainedConfigurationHash?{retainedConfigurationHash:t.retainedConfigurationHash}:{},configurationHash:t.configurationHash};g(t,i),x.safeParse(a).success||i.addIssue({code:"custom",message:"Local Experiment configuration changed."}),(t.operationId!==t.configuration.operationId||t.teamId!==t.configuration.request.teamId||t.maximumCostUsd!==t.configuration.maximumCostUsd)&&i.addIssue({code:"custom",message:"Local Experiment differs from its sealed admission."})}),q=e.object({items:e.array(l).max(100),nextCursor:e.string().nullable()}).strict(),G=e.object({teamId:e.string().min(1).max(200),id:e.string().min(1).max(200),configurationHash:e.string().regex(/^[a-f0-9]{64}$/).optional()}).strict(),T=e.object({operationId:n,execution:e.object({id:n,executionHash:o}).strict(),graderPackage:s,graders:e.array(j).min(1).max(100),maximumCostUsd:e.number().finite().positive().max(1e4)}).strict(),re=T.omit({graderPackage:!0}),D=L,F=e.object({sessionId:n,turnId:n,source:S,profileRef:u,admissionHash:o,modelConfigurationHash:o,traceHash:o,runtimeEventRefs:e.array(n).max(1e4),startedAt:e.iso.datetime(),completedAt:e.iso.datetime(),outputHash:o,partialOutputAvailable:e.boolean()}).strict(),w=e.object({receiptId:n,taskId:n,seed:e.string(),status:e.enum(["pending","running","completed","failed","cancelled","unknown"]),input:e.record(e.string(),e.unknown()),policyVisibleContext:e.record(e.string(),e.unknown()),output:e.string().nullable(),messages:e.array(e.unknown()).max(4002),grade:H.nullable(),error:e.string().nullable(),native:D.optional(),profileNative:F.optional(),externalProcess:I.optional()}).strict(),ce=e.object({execution:e.union([l,c]),cases:e.array(w).max(1e4),contentHash:o}).strict(),$=e.object({items:e.array(e.object({sequence:e.number().int().positive(),type:e.string().min(1),payload:e.unknown()}).strict()).max(500),nextCursor:e.number().int().positive().nullable()}).strict(),se=e.object({location:e.literal("local"),execution:e.union([l,c]),case:w,trace:$}).strict(),me=e.object({items:e.array(c).max(100),nextCursor:n.nullable()}).strict(),pe=e.object({execution:c,graders:e.array(r).min(1).max(100),graderPackageHash:o}).strict(),C=e.object({execution:c,manifest:y,result:R}).strict().superRefine((t,i)=>{try{if(P(t),t.manifest.id!==t.execution.id||t.manifest.teamId!==t.execution.teamId||t.manifest.lineage?.execution.id!==(t.execution.sourceExecution?.id??t.execution.id)||t.manifest.lineage.execution.contentHash!==(t.execution.sourceExecution?.executionHash??t.execution.executionHash)||t.manifest.lineage.scoringPassId!==(t.execution.kind==="scoring"?t.execution.id:null)||t.manifest.maximumCostUsd!==t.execution.maximumCostUsd)throw new Error("Portable evidence differs from its retained local execution.")}catch(a){i.addIssue({code:"custom",message:a instanceof Error?a.message:"Local portable evidence verification failed."})}}),le=e.object({location:e.literal("local"),baseline:C,candidate:C}).strict();export{u as a,l as b,ce as c,le as d};
2
+ import{Fa as I,Ga as H,Ua as d,Va as r,Wa as j,Xa as m,ab as p,ga as s}from"./chunk-YNQWJWIC.js";import{Hb as y,Mb as R,Pb as P,lb as S,wb as L}from"./chunk-PBZCXPPC.js";import{n as b}from"./chunk-VVNV4NNW.js";import{A as e}from"./chunk-PF56N7ZY.js";import{a as E}from"./chunk-FTQLQJQV.js";var u=e.object({source:e.enum(["local","github","openpond_git"]),repositoryId:e.string().trim().min(1),profileId:e.string().trim().min(1)}),N=e.object({ref:u,revision:e.string().nullable(),sourceHash:e.string()});var n=e.string().trim().min(1).max(200),o=e.string().regex(/^[a-f0-9]{64}$/),k=e.enum(["queued","running","cancelling","completed","failed","cancelled","interrupted"]),z=e.object({providerId:e.enum(["openpond","custom-openai-compatible","claude-code","codex"]),modelId:e.string().trim().min(1).max(500),configurationHash:o,maxOutputTokens:e.number().int().positive().max(262144),temperature:e.number().min(0).max(2).optional(),topP:e.number().positive().max(1).optional(),messages:e.array(e.object({role:e.enum(["system","user","assistant"]),content:e.string().max(262144)}).strict()).max(200)}).strict(),Y=e.object({configuration:m,package:s}).strict(),Z=e.object({configuration:m,expectedPackageHash:o.optional()}).strict(),ee=e.object({schemaVersion:e.literal("openpond.localExperimentDefinition.v1"),location:e.literal("local"),id:n,teamId:n,ownerActorId:n,revision:e.number().int().positive(),configuration:m,model:z,packageHash:o,graders:e.array(r).min(1).max(100),availableGraders:e.array(r).min(1).max(1e3),createdAt:e.iso.datetime(),updatedAt:e.iso.datetime(),contentHash:o}).strict(),te=e.object({operationId:n,definition:d}).strict(),ne=e.object({teamId:n,id:n}).strict(),oe=e.object({teamId:n,projectId:n.optional(),status:k.optional(),datasetHash:o.optional(),search:e.string().max(100).optional(),afterId:n.optional(),limit:e.number().int().min(1).max(100).default(30)}).strict(),f=e.object({schemaVersion:e.literal("openpond.localExperimentExecution.v1"),location:e.literal("local"),id:n,teamId:n,ownerActorId:n,operationId:n,definition:d,kind:e.enum(["target","scoring"]),executionHash:o,sourceExecution:e.object({id:n,executionHash:o}).strict().nullable(),packageHash:o,maximumCostUsd:e.number().finite().positive(),status:k,createdAt:e.iso.datetime(),completedAt:e.iso.datetime().nullable(),counts:e.object({pending:e.number().int().nonnegative(),running:e.number().int().nonnegative(),completed:e.number().int().nonnegative(),failed:e.number().int().nonnegative(),cancelled:e.number().int().nonnegative(),unknown:e.number().int().nonnegative()}).strict(),usage:e.object({knownCostUsd:e.number().finite().nonnegative(),costUsd:e.number().finite().nonnegative().nullable(),heldUsd:e.number().finite().nonnegative(),uncertainRequests:e.number().int().nonnegative()}).strict(),cleanupComplete:e.boolean(),error:e.string().max(2e3).nullable()}).strict(),v=f.omit({definition:!0});function g(t,i){t.kind==="scoring"!=(t.sourceExecution!==null)&&i.addIssue({code:"custom",message:"Only retained scoring passes name an original execution."}),["completed","failed","cancelled","interrupted"].includes(t.status)&&(!t.completedAt||t.counts.pending||t.counts.running)&&i.addIssue({code:"custom",message:"Terminal local execution requires complete population accounting."}),["completed","cancelled"].includes(t.status)&&!t.cleanupComplete&&i.addIssue({code:"custom",message:"Successful completion or cancellation requires confirmed local transport cleanup."}),t.usage.uncertainRequests>0&&t.usage.costUsd!==null&&i.addIssue({code:"custom",message:"Uncertain provider charges cannot claim a measured total."})}E(g,"validateLocalExecutionState");var ie=f.superRefine(g),c=v.superRefine(g),A=e.object({configuration:p,package:s}).strict(),U=e.object({configuration:p,expectedPackageHash:e.string().regex(/^[a-f0-9]{64}$/).optional()}).strict(),x=e.object({configuration:p,model:z,packageHash:e.string().regex(/^[a-f0-9]{64}$/),graders:e.array(r).min(1).max(100),availableGraders:e.array(r).min(1).max(1e3),retainedConfigurationHash:e.string().regex(/^[a-f0-9]{64}$/).optional(),configurationHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict().superRefine((t,i)=>{let{configurationHash:a,...h}=t;b(h)!==a&&i.addIssue({code:"custom",message:"Local configuration snapshot bytes changed."})}),{definition:ae,...O}=f.shape,l=e.object({...O,kind:e.literal("target"),...x.shape}).strict().superRefine((t,i)=>{let a={configuration:t.configuration,model:t.model,packageHash:t.packageHash,graders:t.graders,availableGraders:t.availableGraders,...t.retainedConfigurationHash?{retainedConfigurationHash:t.retainedConfigurationHash}:{},configurationHash:t.configurationHash};g(t,i),x.safeParse(a).success||i.addIssue({code:"custom",message:"Local Experiment configuration changed."}),(t.operationId!==t.configuration.operationId||t.teamId!==t.configuration.request.teamId||t.maximumCostUsd!==t.configuration.maximumCostUsd)&&i.addIssue({code:"custom",message:"Local Experiment differs from its sealed admission."})}),q=e.object({items:e.array(l).max(100),nextCursor:e.string().nullable()}).strict(),G=e.object({teamId:e.string().min(1).max(200),id:e.string().min(1).max(200),configurationHash:e.string().regex(/^[a-f0-9]{64}$/).optional()}).strict(),T=e.object({operationId:n,execution:e.object({id:n,executionHash:o}).strict(),graderPackage:s,graders:e.array(j).min(1).max(100),maximumCostUsd:e.number().finite().positive().max(1e4)}).strict(),re=T.omit({graderPackage:!0}),D=L,F=e.object({sessionId:n,turnId:n,source:S,profileRef:u,admissionHash:o,modelConfigurationHash:o,traceHash:o,runtimeEventRefs:e.array(n).max(1e4),startedAt:e.iso.datetime(),completedAt:e.iso.datetime(),outputHash:o,partialOutputAvailable:e.boolean()}).strict(),w=e.object({receiptId:n,taskId:n,seed:e.string(),status:e.enum(["pending","running","completed","failed","cancelled","unknown"]),input:e.record(e.string(),e.unknown()),policyVisibleContext:e.record(e.string(),e.unknown()),output:e.string().nullable(),messages:e.array(e.unknown()).max(4002),grade:H.nullable(),error:e.string().nullable(),native:D.optional(),profileNative:F.optional(),externalProcess:I.optional()}).strict(),ce=e.object({execution:e.union([l,c]),cases:e.array(w).max(1e4),contentHash:o}).strict(),$=e.object({items:e.array(e.object({sequence:e.number().int().positive(),type:e.string().min(1),payload:e.unknown()}).strict()).max(500),nextCursor:e.number().int().positive().nullable()}).strict(),se=e.object({location:e.literal("local"),execution:e.union([l,c]),case:w,trace:$}).strict(),me=e.object({items:e.array(c).max(100),nextCursor:n.nullable()}).strict(),pe=e.object({execution:c,graders:e.array(r).min(1).max(100),graderPackageHash:o}).strict(),C=e.object({execution:c,manifest:y,result:R}).strict().superRefine((t,i)=>{try{if(P(t),t.manifest.id!==t.execution.id||t.manifest.teamId!==t.execution.teamId||t.manifest.lineage?.execution.id!==(t.execution.sourceExecution?.id??t.execution.id)||t.manifest.lineage.execution.contentHash!==(t.execution.sourceExecution?.executionHash??t.execution.executionHash)||t.manifest.lineage.scoringPassId!==(t.execution.kind==="scoring"?t.execution.id:null)||t.manifest.maximumCostUsd!==t.execution.maximumCostUsd)throw new Error("Portable evidence differs from its retained local execution.")}catch(a){i.addIssue({code:"custom",message:a instanceof Error?a.message:"Local portable evidence verification failed."})}}),le=e.object({location:e.literal("local"),baseline:C,candidate:C}).strict();export{u as a,l as b,ce as c,le as d};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as P}from"./chunk-MNFW5WLD.js";import{f as O}from"./chunk-TUCKED4T.js";import{b as A}from"./chunk-OQPJ7FJF.js";import{a as m}from"./chunk-XWDFXM3S.js";import{b as d,e as f}from"./chunk-JCLTFDVW.js";import{a as n}from"./chunk-FTQLQJQV.js";async function N(t,e,r,s={}){let o=await(s.apiFetch??d)(t,e,s.path??A,{method:"POST",signal:s.signal,body:JSON.stringify(r)}),i=await o.json().catch(()=>({})),c=o.status!==404&&o.status!==405&&o.status!==501;return o.ok?{ok:typeof i.ok=="boolean"?i.ok:!0,status:o.status,endpointAvailable:c,output:g(i),data:E(i)}:{ok:!1,status:o.status,endpointAvailable:c,output:g(i)??(c?`Connected app tool call failed with status ${o.status}.`:`Connected app tool-call endpoint is not available (${o.status}).`),data:E(i)}}n(N,"executeConnectedAppToolCall");function g(t){return typeof t.output=="string"&&t.output.trim()?t.output.trim():typeof t.message=="string"&&t.message.trim()?t.message.trim():typeof t.error=="string"&&t.error.trim()?t.error.trim():null}n(g,"responsePayloadMessage");function E(t){return"data"in t?t.data:"result"in t?t.result:null}n(E,"responsePayloadData");var h=A;function z(t={}){let e=t.env??process.env,r=t.apiFetch??d,s=t.loadAccountContext??P;return async(o,i)=>{if(U(e.OPENPOND_CONNECTED_APP_TOOL_EXECUTOR))return l(o.provider,"Cloud connected app execution is disabled.");let c=D(o),C=O.safeParse(c);if(!C.success)return l(o.provider,L(C.error));let u;try{u=await v({env:e,loadAccountContext:s})}catch(a){return l(o.provider,T(a))}try{let a=await N(u.apiBaseUrl,u.apiKey,C.data,{path:u.path,signal:i?.signal,apiFetch:r});return a.endpointAvailable?{ok:a.ok,output:a.output,data:a.data}:l(o.provider,`Cloud connected app connector endpoint is not available (${a.status}).`)}catch(a){if(a instanceof Error&&a.name==="AbortError")throw a;return l(o.provider,`Cloud connected app connector request failed: ${T(a)}`)}}}n(z,"createCloudConnectedAppToolExecutor");async function v(t={}){let e=t.env??process.env,r=I(e.OPENPOND_CONNECTED_APP_TOOL_PATH),s=e.OPENPOND_CONNECTED_APP_API_KEY?.trim()||e.OPENPOND_SANDBOX_API_KEY?.trim()||e.OPENPOND_API_KEY?.trim();if(s)return{apiBaseUrl:_(e,null),apiKey:s,path:r};let i=await(t.loadAccountContext??P)(),c=i.token?.trim();if(!c)throw new Error("OpenPond account API key is required for connected app connector execution.");return{apiBaseUrl:_(e,i.apiBaseUrl),apiKey:c,path:r}}n(v,"resolveCloudConnectedAppToolTarget");function _(t,e){return p(t.OPENPOND_CONNECTED_APP_API_URL)??b(t.OPENPOND_SANDBOX_API_URL)??p(t.OPENPOND_SANDBOX_BASE_URL)??p(t.OPENPOND_API_URL)??p(e)??f}n(_,"resolveCloudConnectedAppApiBaseUrl");function D(t){return{provider:t.provider,operation:t.operation,toolName:t.toolName,sessionId:t.sessionId,turnId:t.turnId,toolCallId:t.toolCallId,userPrompt:t.userPrompt,connectionIds:t.connectionIds,capabilityIds:t.capabilityIds,args:t.args}}n(D,"cloudConnectedAppToolPayload");function b(t){let e=x(t);return e?p(m(e)):null}n(b,"apiBaseUrlFromSandboxApiUrl");function p(t){let e=x(t);if(!e)return null;try{let r=new URL(e);return r.pathname=y(r.pathname),r.search="",r.hash="",r.toString().replace(/\/$/,"")}catch{return e.replace(/\/v1\/sandboxes\/?$/i,"").replace(/\/api\/sandboxes\/?$/i,"").replace(/\/sandboxes\/?$/i,"").replace(/\/v1\/?$/i,"").replace(/\/+$/,"")}}n(p,"normalizeApiBaseUrl");function y(t){let e=t.replace(/\/+$/,"");return e=e.replace(/\/v1\/sandboxes$/i,"").replace(/\/api\/sandboxes$/i,"").replace(/\/sandboxes$/i,"").replace(/\/v1$/i,""),e||"/"}n(y,"normalizeApiBasePath");function x(t){let e=t?.trim();return e?e.replace(/\/+$/,""):null}n(x,"normalizeOptionalUrl");function I(t){let e=t?.trim()||h;return e.startsWith("/")?e:`/${e}`}n(I,"normalizeToolPath");function l(t,e){return{ok:!1,output:`${e} No ${t} provider API call was made.`}}n(l,"connectorUnavailable");function U(t){let e=t?.trim().toLowerCase();return e==="0"||e==="false"||e==="off"||e==="disabled"}n(U,"isDisabled");function L(t){return t.issues?.[0]?.message??"Connected app tool call request is invalid."}n(L,"connectedAppToolCallValidationMessage");function T(t){return t instanceof Error?t.message:"Unknown error"}n(T,"errorMessage");export{h as a,z as b,v as c};
2
+ import{a as P}from"./chunk-WWQNMC7C.js";import{f as O}from"./chunk-M3FLEZ4E.js";import{b as A}from"./chunk-OQPJ7FJF.js";import{a as m}from"./chunk-2LJCJOJ7.js";import{b as d,e as f}from"./chunk-JCLTFDVW.js";import{a as n}from"./chunk-FTQLQJQV.js";async function N(t,e,r,s={}){let o=await(s.apiFetch??d)(t,e,s.path??A,{method:"POST",signal:s.signal,body:JSON.stringify(r)}),i=await o.json().catch(()=>({})),c=o.status!==404&&o.status!==405&&o.status!==501;return o.ok?{ok:typeof i.ok=="boolean"?i.ok:!0,status:o.status,endpointAvailable:c,output:g(i),data:E(i)}:{ok:!1,status:o.status,endpointAvailable:c,output:g(i)??(c?`Connected app tool call failed with status ${o.status}.`:`Connected app tool-call endpoint is not available (${o.status}).`),data:E(i)}}n(N,"executeConnectedAppToolCall");function g(t){return typeof t.output=="string"&&t.output.trim()?t.output.trim():typeof t.message=="string"&&t.message.trim()?t.message.trim():typeof t.error=="string"&&t.error.trim()?t.error.trim():null}n(g,"responsePayloadMessage");function E(t){return"data"in t?t.data:"result"in t?t.result:null}n(E,"responsePayloadData");var h=A;function z(t={}){let e=t.env??process.env,r=t.apiFetch??d,s=t.loadAccountContext??P;return async(o,i)=>{if(I(e.OPENPOND_CONNECTED_APP_TOOL_EXECUTOR))return l(o.provider,"Cloud connected app execution is disabled.");let c=D(o),C=O.safeParse(c);if(!C.success)return l(o.provider,L(C.error));let u;try{u=await v({env:e,loadAccountContext:s})}catch(a){return l(o.provider,T(a))}try{let a=await N(u.apiBaseUrl,u.apiKey,C.data,{path:u.path,signal:i?.signal,apiFetch:r});return a.endpointAvailable?{ok:a.ok,output:a.output,data:a.data}:l(o.provider,`Cloud connected app connector endpoint is not available (${a.status}).`)}catch(a){if(a instanceof Error&&a.name==="AbortError")throw a;return l(o.provider,`Cloud connected app connector request failed: ${T(a)}`)}}}n(z,"createCloudConnectedAppToolExecutor");async function v(t={}){let e=t.env??process.env,r=y(e.OPENPOND_CONNECTED_APP_TOOL_PATH),s=e.OPENPOND_CONNECTED_APP_API_KEY?.trim()||e.OPENPOND_SANDBOX_API_KEY?.trim()||e.OPENPOND_API_KEY?.trim();if(s)return{apiBaseUrl:_(e,null),apiKey:s,path:r};let i=await(t.loadAccountContext??P)(),c=i.token?.trim();if(!c)throw new Error("OpenPond account API key is required for connected app connector execution.");return{apiBaseUrl:_(e,i.apiBaseUrl),apiKey:c,path:r}}n(v,"resolveCloudConnectedAppToolTarget");function _(t,e){return p(t.OPENPOND_CONNECTED_APP_API_URL)??U(t.OPENPOND_SANDBOX_API_URL)??p(t.OPENPOND_SANDBOX_BASE_URL)??p(t.OPENPOND_API_URL)??p(e)??f}n(_,"resolveCloudConnectedAppApiBaseUrl");function D(t){return{provider:t.provider,operation:t.operation,toolName:t.toolName,sessionId:t.sessionId,turnId:t.turnId,toolCallId:t.toolCallId,userPrompt:t.userPrompt,connectionIds:t.connectionIds,capabilityIds:t.capabilityIds,args:t.args}}n(D,"cloudConnectedAppToolPayload");function U(t){let e=x(t);return e?p(m(e,{apiBaseUrl:e})):null}n(U,"apiBaseUrlFromSandboxApiUrl");function p(t){let e=x(t);if(!e)return null;try{let r=new URL(e);return r.pathname=b(r.pathname),r.search="",r.hash="",r.toString().replace(/\/$/,"")}catch{return e.replace(/\/v1\/sandboxes\/?$/i,"").replace(/\/api\/sandboxes\/?$/i,"").replace(/\/sandboxes\/?$/i,"").replace(/\/v1\/?$/i,"").replace(/\/+$/,"")}}n(p,"normalizeApiBaseUrl");function b(t){let e=t.replace(/\/+$/,"");return e=e.replace(/\/v1\/sandboxes$/i,"").replace(/\/api\/sandboxes$/i,"").replace(/\/sandboxes$/i,"").replace(/\/v1$/i,""),e||"/"}n(b,"normalizeApiBasePath");function x(t){let e=t?.trim();return e?e.replace(/\/+$/,""):null}n(x,"normalizeOptionalUrl");function y(t){let e=t?.trim()||h;return e.startsWith("/")?e:`/${e}`}n(y,"normalizeToolPath");function l(t,e){return{ok:!1,output:`${e} No ${t} provider API call was made.`}}n(l,"connectorUnavailable");function I(t){let e=t?.trim().toLowerCase();return e==="0"||e==="false"||e==="off"||e==="disabled"}n(I,"isDisabled");function L(t){return t.issues?.[0]?.message??"Connected app tool call request is invalid."}n(L,"connectedAppToolCallValidationMessage");function T(t){return t instanceof Error?t.message:"Unknown error"}n(T,"errorMessage");export{h as a,z as b,v as c};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{ta as n}from"./chunk-PGO4FRHU.js";import{a}from"./chunk-FTQLQJQV.js";function l(i,e,s){i.exec("BEGIN IMMEDIATE");try{let o=i.get("SELECT content_hash, profile_id FROM taskset_revisions WHERE taskset_id = ? AND revision = ?",[e.id,e.revision]);if(o&&o.content_hash!==e.contentHash)throw new Error(`Taskset ${e.id}@${e.revision} is immutable and already has another content hash.`);let t=i.get("SELECT payload FROM tasksets WHERE id = ?",[e.id]),d=t?n.parse(JSON.parse(t.payload)):null;if(o&&o.profile_id!==e.profileId||d&&d.profileId!==e.profileId)throw new Error(`Taskset ${e.id} belongs to another Profile.`);let r=JSON.stringify(e);i.run(`INSERT INTO taskset_revisions (taskset_id, revision, content_hash, profile_id, status, payload, created_at, updated_at)
2
+ import{wa as n}from"./chunk-YNQWJWIC.js";import{a}from"./chunk-FTQLQJQV.js";function l(i,e,s){i.exec("BEGIN IMMEDIATE");try{let o=i.get("SELECT content_hash, profile_id FROM taskset_revisions WHERE taskset_id = ? AND revision = ?",[e.id,e.revision]);if(o&&o.content_hash!==e.contentHash)throw new Error(`Taskset ${e.id}@${e.revision} is immutable and already has another content hash.`);let t=i.get("SELECT payload FROM tasksets WHERE id = ?",[e.id]),d=t?n.parse(JSON.parse(t.payload)):null;if(o&&o.profile_id!==e.profileId||d&&d.profileId!==e.profileId)throw new Error(`Taskset ${e.id} belongs to another Profile.`);let r=JSON.stringify(e);i.run(`INSERT INTO taskset_revisions (taskset_id, revision, content_hash, profile_id, status, payload, created_at, updated_at)
3
3
  VALUES (?, ?, ?, ?, ?, ?, ?, ?)
4
4
  ON CONFLICT(taskset_id, revision) DO UPDATE SET status = excluded.status, payload = excluded.payload, updated_at = excluded.updated_at`,[e.id,e.revision,e.contentHash,e.profileId,e.status,r,e.createdAt,e.updatedAt]),(!d||d.revision<=e.revision)&&i.run(`INSERT INTO tasksets (id, profile_id, status, payload, created_at, updated_at)
5
5
  VALUES (?, ?, ?, ?, ?, ?)
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{C as x}from"./chunk-WGLVSGFA.js";import{B as I}from"./chunk-B4RKHHF7.js";import{p as T}from"./chunk-YU3C6U5V.js";import{a as A}from"./chunk-KVTBX2UP.js";import{a}from"./chunk-FTQLQJQV.js";function G(e){let n=e.trim().replace(/^```(?:json)?\s*/i,"").replace(/```\s*$/,"");try{let t=JSON.parse(n);return typeof t.score!="number"||typeof t.passed!="boolean"?null:{score:Math.max(0,Math.min(1,t.score)),passed:t.passed,feedback:typeof t.feedback=="string"?t.feedback.slice(0,2e4):"Model judge completed.",evidenceRefs:[]}}catch{return null}}a(G,"parseModelJudgeResult");function X(e){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return Math.floor(e);let n=process.env.OPENPOND_HOSTED_WORKSPACE_TOOL_ROUNDS?.trim();if(!n)return 64;if(/^(unlimited|infinite|infinity)$/i.test(n))return Number.POSITIVE_INFINITY;let t=Number.parseInt(n,10);return Number.isFinite(t)&&t>0?t:64}a(X,"resolveMaxHostedWorkspaceToolRounds");function Y(e,n,t){let o=Date.now()-6e4;for(let r=e.length-1;r>=0;r-=1){let i=e[r],s=Date.parse(i.timestamp);if(Number.isFinite(s)&&s<o)return null;if(i.sessionId!==n||i.name!=="session.compaction.completed")continue;let d=i.data&&typeof i.data=="object"?i.data:null;if(d?.provider==="codex"&&d.codexThreadId===t)return i}return null}a(Y,"findRecentCodexCompactionCompleted");function Q(e){return e==="agent"||e==="skill"||e==="extension"||e==="model"||e==="configuration"?e:null}a(Q,"createImproveTargetKind");function V(e){if(!e)return;let n=Number(e);return Number.isFinite(n)&&n>0?Math.trunc(n):void 0}a(V,"createImproveLimit");var ne=new Set(["ask_user","get_profile","agent_inspect","agent_build","agent_validate","agent_eval","agent_run","agent_traces","agent_check","exec_command","view_image","list_files","read_files","search_files","write_file","write_files","edit_file","delete_file","workspace_status"]);function re(e){let n={type:"string"},t={type:"string",minLength:1};return[["list_files",{},[]],["workspace_status",{},[]],["read_files",{paths:{type:"array",items:t,minItems:1,maxItems:30}},["paths"]],["search_files",{query:{type:"string",minLength:1,maxLength:2e3}},["query"]],["write_file",{path:t,content:n},["path","content"]],["write_files",{files:{type:"object",additionalProperties:n,maxProperties:30}},["files"]],["edit_file",{path:t,oldText:{type:"string",minLength:1},newText:n,replaceAll:{type:"boolean"}},["path","oldText","newText"]],["delete_file",{path:t},["path"]]].map(([r,i,s])=>({name:r,description:`${r.replaceAll("_"," ")} in the isolated selected candidate component. Paths are relative to its public source tree.`,parameters:{type:"object",additionalProperties:!1,properties:i,required:s},execute:a(async d=>{let c=await e(d.session.id,{action:r,args:d.args,source:"chat_action"},{turnId:d.turnId,workspaceDiffBaseline:d.workspaceDiffBaseline});return x(d.callId,r,c)},"execute")}))}a(re,"candidateFileToolDefinitions");import{realpath as C}from"node:fs/promises";import p from"node:path";function ce(e){let n=[O()];if(!e.loadProfileState)return n;let t=a(async(r,i)=>{if(i&&(i.turnMetadata?.source==="experiment-improvement"||i.turnMetadata?.refinementCandidate!==void 0||i.session.metadata?.source==="experiment-improvement"||i.session.metadata?.refinementCandidate!==void 0)){if(!e.resolveCandidateProfile)throw new Error("Candidate authoring requires an admitted isolated Profile resolver.");let s=await e.resolveCandidateProfile(i);return S(s),s}return e.loadProfileState(r,i)},"loadProfileState"),o=a(async r=>{if(r.context.turnMetadata?.source==="experiment-improvement"||r.context.turnMetadata?.refinementCandidate!==void 0||r.context.session.metadata?.source==="experiment-improvement"||r.context.session.metadata?.refinementCandidate!==void 0){if(!e.executeCandidateAgentCommand)throw new Error("Candidate Agent commands require filesystem-confined execution.");return e.executeCandidateAgentCommand(r)}return I({...r,throwOnFailure:!1})},"runCommand");return n.push(E(t),u(t,o,"agent_inspect","inspect"),u(t,o,"agent_build","build"),u(t,o,"agent_validate","validate"),u(t,o,"agent_eval","eval"),D(t,o),u(t,o,"agent_traces","traces"),L(t,o)),n}a(ce,"createAuthoringModelToolDefinitions");function O(){return{name:"ask_user",description:"Ask one blocking user question when the answer materially changes the requested work and cannot be inferred safely. This call ends the current model turn after persisting the question; do not batch it with mutations.",parameters:{type:"object",additionalProperties:!1,properties:{question:{type:"string",minLength:1,maxLength:2e3},reason:{type:"string",minLength:1,maxLength:1e3},options:{type:"array",minItems:2,maxItems:5,items:{type:"object",additionalProperties:!1,properties:{id:{type:"string",minLength:1,maxLength:80},label:{type:"string",minLength:1,maxLength:160},description:{type:"string",minLength:1,maxLength:500}},required:["id","label"]}},allowFreeform:{type:"boolean"}},required:["question"]},execute:a(async e=>{let n=m(e.args,"question"),t=R(e.args,"reason"),o=q(e.args,"options").map(i=>g(i)).filter(i=>!!i).map(i=>({id:m(i,"id"),label:m(i,"label"),description:R(i,"description")})),r={questionId:`question_${e.turnId}_${e.callId}`,question:n,reason:t,options:o,allowFreeform:e.args.allowFreeform!==!1,status:"awaiting_user_input",nextStep:"end_turn"};return{...l(e.callId,"ask_user",!0,n,r),turnControl:"await_user_input"}},"execute")}}a(O,"askUserDefinition");function E(e){return{name:"get_profile",description:"Return the exact OpenPond Profile selected for this chat turn, including bounded local path, Skill, Agent, action, and Git context. Call before Profile authoring. This tool does not change the selected Profile or grant filesystem permission.",parameters:{type:"object",additionalProperties:!1,properties:{}},execute:a(async n=>{let t=h(n),o=await e(t,n),r=N(o,n.turnMetadata,t);return l(n.callId,"get_profile",!o.error,o.error??"Resolved selected Profile.",r)},"execute")}}a(E,"getProfileDefinition");function u(e,n,t,o){return{name:t,description:j(t),parameters:M(),execute:a(async r=>{let i=await f(e,r),s=await v(n,r,o,i.cwd);return l(r.callId,t,s.code===0&&!s.timedOut,s.code===0&&!s.timedOut?`${t} passed for ${i.agentId}.`:`${t} failed for ${i.agentId}.`,{agentId:i.agentId,cwd:i.cwd,command:o,...P(s)})},"execute")}}a(u,"agentCommandDefinition");function D(e,n){return{name:"agent_run",description:"Run one declared action on an exact enabled Profile Agent with typed JSON input. Use for behavioral proof, not as the default validation gate.",parameters:{type:"object",additionalProperties:!1,properties:{agentId:{type:"string",minLength:1},action:{type:"string",minLength:1},input:{type:"object",additionalProperties:!0}},required:["agentId","action"]},execute:a(async t=>{let o=await f(e,t),r=m(t.args,"action"),i=g(t.args,"input")??{},s=await n({context:t,command:"run",args:[r,"--json","--input",JSON.stringify(i),"--cwd",o.cwd],cwd:o.cwd,timeoutMs:12e4,maxOutputBytes:25e4});return l(t.callId,"agent_run",s.code===0&&!s.timedOut,s.code===0&&!s.timedOut?`Action ${r} passed for ${o.agentId}.`:`Action ${r} failed for ${o.agentId}.`,{agentId:o.agentId,cwd:o.cwd,action:r,input:i,...P(s)})},"execute")}}a(D,"agentRunDefinition");function L(e,n){return{name:"agent_check",description:"Run the mandatory Agent authoring gate\u2014inspect, build, validate, and eval\u2014in order for one exact Profile Agent. Stops on the first failure and returns bounded per-step receipts.",parameters:M(),execute:a(async t=>{let o=await f(e,t),r=[];for(let s of["inspect","build","validate","eval"]){let d=await v(n,t,s,o.cwd),c=P(d);if(r.push({command:s,receipt:c}),d.code!==0||d.timedOut)return l(t.callId,"agent_check",!1,`agent_check stopped at ${s} for ${o.agentId}.`,{agentId:o.agentId,cwd:o.cwd,passed:!1,failedStep:s,steps:r})}let i=await e(h(t),t);return l(t.callId,"agent_check",!0,`agent_check passed for ${o.agentId}.`,{agentId:o.agentId,cwd:o.cwd,passed:!0,failedStep:null,steps:r,profileRefresh:{activeProfile:i.activeProfile,agentIds:i.agents.map(s=>s.id).slice(0,200),actionIds:i.actionCatalog.map(s=>s.id).slice(0,500)}})},"execute")}}a(L,"agentCheckDefinition");async function f(e,n){let t=m(n.args,"agentId"),o=await e(h(n),n);S(o);let r=g(n.turnMetadata,"authoringIntent");if(r?.artifact==="agent"&&r.operation==="improve"&&typeof r.targetAgentId=="string"&&r.targetAgentId!==t)throw new Error(`Agent improve is bound to ${r.targetAgentId}; ${t} is not authorized.`);if(!o.agents.find(k=>k.id===t)?.enabled)throw new Error(`Enabled Profile Agent not found: ${t}`);let s=t==="default"?o.sourcePath:p.resolve(o.sourcePath,"agents",t),d=await C(o.sourcePath),c=await C(s).catch(()=>null);if(!c)throw new Error(`Profile Agent source does not exist: ${t}`);if(!F(d,c))throw new Error(`Profile Agent source escapes the selected Profile: ${t}`);return{profile:o,agentId:t,cwd:c}}a(f,"resolveAgentTarget");async function v(e,n,t,o){return e({context:n,command:t,args:t==="inspect"||t==="validate"||t==="eval"||t==="traces"?["--json"]:[],cwd:o,timeoutMs:t==="eval"?18e4:12e4,maxOutputBytes:25e4})}a(v,"executeAgentCommand");function S(e){if(e.error)throw new Error(e.error);if(e.mode!=="local"||!e.repoPath||!e.sourcePath)throw new Error("The selected OpenPond Profile is not locally editable.")}a(S,"assertEditableProfile");function N(e,n,t){let o=e.git?.files.slice(0,200).map(r=>r.path)??[];return{mode:e.mode,editable:e.mode==="local"&&!!(e.repoPath&&e.sourcePath)&&!e.error,blockedReason:e.error??(e.mode==="local"&&e.repoPath&&e.sourcePath?null:"The selected Profile is not locally editable."),ref:t,activeProfile:e.activeProfile,repoPath:e.repoPath,sourcePath:e.sourcePath,manifestPath:e.manifestPath,profileConfigPath:e.sourcePath?p.join(e.sourcePath,"settings","profile.yaml"):null,authoring:g(n,"authoringIntent"),skills:e.skills.slice(0,200).map(r=>({name:r.name,description:r.description,path:r.path,sourcePath:r.sourcePath,enabled:r.enabled,validationStatus:r.validationStatus})),agents:e.agents.slice(0,200).map(r=>{let i=e.actionCatalog.filter(s=>s.agentId===r.id).slice(0,100);return{id:r.id,name:r.name,path:r.path,sourcePath:e.sourcePath?r.id==="default"?e.sourcePath:p.resolve(e.sourcePath,"agents",r.id):r.path,enabled:r.enabled,defaultAction:i.find(s=>s.sourceActionId==="chat"||s.id===`${r.id}.chat`)?.id??i[0]?.id??null,actionNames:i.map(s=>s.id)}}),git:e.git?{branch:e.git.branch,head:e.git.head,dirty:e.git.dirty,changedPaths:o,truncated:e.git.files.length>o.length}:null}}a(N,"profileProjection");function h(e){let n=g(e.turnMetadata,"selectedProfileRef");return n&&(n.source==="local"||n.source==="github"||n.source==="openpond_git")&&typeof n.repositoryId=="string"&&n.repositoryId.trim()&&typeof n.profileId=="string"&&n.profileId.trim()?{source:n.source,repositoryId:n.repositoryId,profileId:n.profileId}:e.session.currentProfile??null}a(h,"selectedProfileRef");function M(){return{type:"object",additionalProperties:!1,properties:{agentId:{type:"string",minLength:1,description:"Exact enabled Agent ID from get_profile."}},required:["agentId"]}}a(M,"agentTargetParameters");function j(e){return`Run OpenPond Agent SDK ${e.replace(/^agent_/,"")} for one exact enabled Agent beneath the selected Profile and return a bounded structured receipt.`}a(j,"agentToolDescription");function P(e){return{code:e.code,timedOut:e.timedOut,stdout:$(e.stdout),stderr:e.stderr,stdoutTruncated:e.stdoutTruncated,stderrTruncated:e.stderrTruncated}}a(P,"commandReceipt");function $(e){let n=e.trim();if(!n)return"";try{return JSON.parse(n)}catch{return n}}a($,"parseJsonOrText");function l(e,n,t,o,r){return{toolCallId:e,name:n,ok:t,contentText:JSON.stringify({ok:t,action:n,output:o,data:r},null,2),data:r}}a(l,"modelResult");function m(e,n){let t=e[n];if(typeof t!="string"||!t.trim())throw new Error(`${n} is required`);return t.trim()}a(m,"stringArg");function R(e,n){let t=e[n];return typeof t=="string"&&t.trim()?t.trim():null}a(R,"optionalStringArg");function q(e,n){let t=e[n];return Array.isArray(t)?t:[]}a(q,"arrayArg");function g(e,n){let t=n&&e&&typeof e=="object"&&!Array.isArray(e)?e[n]:e;return t&&typeof t=="object"&&!Array.isArray(t)?t:null}a(g,"recordArg");function F(e,n){let t=p.relative(e,n);return t===""||!t.startsWith("..")&&!p.isAbsolute(t)}a(F,"isWithin");import{execFile as B}from"node:child_process";import y from"node:path";var b=12,_=8,w=" .:-=+*#%@";function he(e={}){return{name:"view_image",description:"Inspect a real local PNG, JPEG, GIF, WebP, or AVIF file. Reads the image bytes directly and returns dimensions plus a coarse pixel/color map; it also creates an actual image preview in the chat UI. Use this instead of opening file:// URLs or browser snapshots, which cannot inspect local image pixels. For many video frames, build one contact sheet and inspect that rather than reading frames one by one.",parameters:{type:"object",additionalProperties:!1,properties:{path:{type:"string",minLength:1,description:"Absolute image path, or a path relative to the selected local project."}},required:["path"]},enabled:a(n=>n.provider==="codex"||n.session.provider==="codex"||n.session.openPondCommandAccessMode==="disabled"?!1:A({session:n.session}).target!=="sandbox","enabled"),execute:a(async n=>{if(n.turnMetadata?.source==="experiment-improvement"||n.turnMetadata?.refinementCandidate!==void 0||n.session.metadata?.source==="experiment-improvement"||n.session.metadata?.refinementCandidate!==void 0){if(!e.executeCandidateImage)throw new Error("Candidate image inspection requires its confined filesystem executor.");return e.executeCandidateImage(n)}let t=K(n.args.path,"path"),o=y.isAbsolute(t)?y.resolve(t):n.session.cwd?y.resolve(n.session.cwd,t):"";if(!o)throw new Error("A relative image path requires a selected local project.");let r=await T(o);if(!r)throw new Error(`Local image was not found or is not a supported image: ${o}`);let i=await U(r.path,n.signal);return{toolCallId:n.callId,name:"view_image",ok:!0,contentText:JSON.stringify({ok:!0,action:"view_image",output:`Read actual image pixels from ${r.path}.`,data:{path:r.path,contentType:r.contentType,sizeBytes:r.sizeBytes,...i,note:"The luminance and color maps are deterministic pixel samples, not a semantic vision caption."}},null,2),data:{openpondImagePreviewPath:r.path,path:r.path,contentType:r.contentType,sizeBytes:r.sizeBytes,...i}}},"execute")}}a(he,"createLocalImageModelToolDefinition");async function U(e,n,t=z){let o=await t("identify",["-format","%m %w %h",e],n),r=/^(\S+)\s+(\d+)\s+(\d+)/.exec(o.trim());if(!r)throw new Error("Image metadata could not be decoded.");let i=await t("convert",[e,"-resize",`${b}x${_}!`,"-depth","8","txt:-"],n),s=W(i);return{format:r[1],width:Number.parseInt(r[2],10),height:Number.parseInt(r[3],10),luminanceMap:s.map(d=>d.map(J).join("")),colorMap:s.map(d=>d.map(c=>`#${c.map(H).join("")}`))}}a(U,"inspectImagePixels");function W(e){let n=Array.from({length:_},()=>Array.from({length:b},()=>[0,0,0]));for(let t of e.split(/\r?\n/)){let o=/^(\d+),(\d+):\s*\(\s*(\d+),\s*(\d+),\s*(\d+)/.exec(t);if(!o)continue;let r=Number.parseInt(o[1],10),i=Number.parseInt(o[2],10);r>=b||i>=_||(n[i][r]=[Number.parseInt(o[3],10),Number.parseInt(o[4],10),Number.parseInt(o[5],10)])}return n}a(W,"sampledPixelRows");function J([e,n,t]){let o=.2126*e+.7152*n+.0722*t;return w[Math.min(w.length-1,Math.round(o/255*(w.length-1)))]}a(J,"luminanceCharacter");function H(e){return Math.max(0,Math.min(255,e)).toString(16).padStart(2,"0")}a(H,"hexByte");function z(e,n,t){return new Promise((o,r)=>{B(e,n,{encoding:"utf8",maxBuffer:256*1024,signal:t},(i,s)=>{if(i){r(new Error(`${e} could not inspect the image: ${i.message}`));return}o(s)})})}a(z,"runImageCommand");function K(e,n){if(typeof e!="string"||!e.trim())throw new Error(`${n} is required.`);return e.trim()}a(K,"stringArg");export{ne as a,re as b,ce as c,he as d,U as e,G as f,X as g,Y as h,Q as i,V as j};
2
+ import{v as x}from"./chunk-DQI5TE6A.js";import{B as I}from"./chunk-B4RKHHF7.js";import{p as T}from"./chunk-YU3C6U5V.js";import{a as A}from"./chunk-KVTBX2UP.js";import{a}from"./chunk-FTQLQJQV.js";function G(e){let n=e.trim().replace(/^```(?:json)?\s*/i,"").replace(/```\s*$/,"");try{let t=JSON.parse(n);return typeof t.score!="number"||typeof t.passed!="boolean"?null:{score:Math.max(0,Math.min(1,t.score)),passed:t.passed,feedback:typeof t.feedback=="string"?t.feedback.slice(0,2e4):"Model judge completed.",evidenceRefs:[]}}catch{return null}}a(G,"parseModelJudgeResult");function X(e){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return Math.floor(e);let n=process.env.OPENPOND_HOSTED_WORKSPACE_TOOL_ROUNDS?.trim();if(!n)return 64;if(/^(unlimited|infinite|infinity)$/i.test(n))return Number.POSITIVE_INFINITY;let t=Number.parseInt(n,10);return Number.isFinite(t)&&t>0?t:64}a(X,"resolveMaxHostedWorkspaceToolRounds");function Y(e,n,t){let o=Date.now()-6e4;for(let r=e.length-1;r>=0;r-=1){let i=e[r],s=Date.parse(i.timestamp);if(Number.isFinite(s)&&s<o)return null;if(i.sessionId!==n||i.name!=="session.compaction.completed")continue;let d=i.data&&typeof i.data=="object"?i.data:null;if(d?.provider==="codex"&&d.codexThreadId===t)return i}return null}a(Y,"findRecentCodexCompactionCompleted");function Q(e){return e==="agent"||e==="skill"||e==="extension"||e==="model"||e==="configuration"?e:null}a(Q,"createImproveTargetKind");function V(e){if(!e)return;let n=Number(e);return Number.isFinite(n)&&n>0?Math.trunc(n):void 0}a(V,"createImproveLimit");var ne=new Set(["ask_user","get_profile","agent_inspect","agent_build","agent_validate","agent_eval","agent_run","agent_traces","agent_check","exec_command","view_image","list_files","read_files","search_files","write_file","write_files","edit_file","delete_file","workspace_status"]);function re(e){let n={type:"string"},t={type:"string",minLength:1};return[["list_files",{},[]],["workspace_status",{},[]],["read_files",{paths:{type:"array",items:t,minItems:1,maxItems:30}},["paths"]],["search_files",{query:{type:"string",minLength:1,maxLength:2e3}},["query"]],["write_file",{path:t,content:n},["path","content"]],["write_files",{files:{type:"object",additionalProperties:n,maxProperties:30}},["files"]],["edit_file",{path:t,oldText:{type:"string",minLength:1},newText:n,replaceAll:{type:"boolean"}},["path","oldText","newText"]],["delete_file",{path:t},["path"]]].map(([r,i,s])=>({name:r,description:`${r.replaceAll("_"," ")} in the isolated selected candidate component. Paths are relative to its public source tree.`,parameters:{type:"object",additionalProperties:!1,properties:i,required:s},execute:a(async d=>{let c=await e(d.session.id,{action:r,args:d.args,source:"chat_action"},{turnId:d.turnId,workspaceDiffBaseline:d.workspaceDiffBaseline});return x(d.callId,r,c)},"execute")}))}a(re,"candidateFileToolDefinitions");import{realpath as C}from"node:fs/promises";import p from"node:path";function ce(e){let n=[O()];if(!e.loadProfileState)return n;let t=a(async(r,i)=>{if(i&&(i.turnMetadata?.source==="experiment-improvement"||i.turnMetadata?.refinementCandidate!==void 0||i.session.metadata?.source==="experiment-improvement"||i.session.metadata?.refinementCandidate!==void 0)){if(!e.resolveCandidateProfile)throw new Error("Candidate authoring requires an admitted isolated Profile resolver.");let s=await e.resolveCandidateProfile(i);return S(s),s}return e.loadProfileState(r,i)},"loadProfileState"),o=a(async r=>{if(r.context.turnMetadata?.source==="experiment-improvement"||r.context.turnMetadata?.refinementCandidate!==void 0||r.context.session.metadata?.source==="experiment-improvement"||r.context.session.metadata?.refinementCandidate!==void 0){if(!e.executeCandidateAgentCommand)throw new Error("Candidate Agent commands require filesystem-confined execution.");return e.executeCandidateAgentCommand(r)}return I({...r,throwOnFailure:!1})},"runCommand");return n.push(E(t),u(t,o,"agent_inspect","inspect"),u(t,o,"agent_build","build"),u(t,o,"agent_validate","validate"),u(t,o,"agent_eval","eval"),D(t,o),u(t,o,"agent_traces","traces"),L(t,o)),n}a(ce,"createAuthoringModelToolDefinitions");function O(){return{name:"ask_user",description:"Ask one blocking user question when the answer materially changes the requested work and cannot be inferred safely. This call ends the current model turn after persisting the question; do not batch it with mutations.",parameters:{type:"object",additionalProperties:!1,properties:{question:{type:"string",minLength:1,maxLength:2e3},reason:{type:"string",minLength:1,maxLength:1e3},options:{type:"array",minItems:2,maxItems:5,items:{type:"object",additionalProperties:!1,properties:{id:{type:"string",minLength:1,maxLength:80},label:{type:"string",minLength:1,maxLength:160},description:{type:"string",minLength:1,maxLength:500}},required:["id","label"]}},allowFreeform:{type:"boolean"}},required:["question"]},execute:a(async e=>{let n=m(e.args,"question"),t=R(e.args,"reason"),o=q(e.args,"options").map(i=>g(i)).filter(i=>!!i).map(i=>({id:m(i,"id"),label:m(i,"label"),description:R(i,"description")})),r={questionId:`question_${e.turnId}_${e.callId}`,question:n,reason:t,options:o,allowFreeform:e.args.allowFreeform!==!1,status:"awaiting_user_input",nextStep:"end_turn"};return{...l(e.callId,"ask_user",!0,n,r),turnControl:"await_user_input"}},"execute")}}a(O,"askUserDefinition");function E(e){return{name:"get_profile",description:"Return the exact OpenPond Profile selected for this chat turn, including bounded local path, Skill, Agent, action, and Git context. Call before Profile authoring. This tool does not change the selected Profile or grant filesystem permission.",parameters:{type:"object",additionalProperties:!1,properties:{}},execute:a(async n=>{let t=h(n),o=await e(t,n),r=N(o,n.turnMetadata,t);return l(n.callId,"get_profile",!o.error,o.error??"Resolved selected Profile.",r)},"execute")}}a(E,"getProfileDefinition");function u(e,n,t,o){return{name:t,description:j(t),parameters:M(),execute:a(async r=>{let i=await f(e,r),s=await v(n,r,o,i.cwd);return l(r.callId,t,s.code===0&&!s.timedOut,s.code===0&&!s.timedOut?`${t} passed for ${i.agentId}.`:`${t} failed for ${i.agentId}.`,{agentId:i.agentId,cwd:i.cwd,command:o,...P(s)})},"execute")}}a(u,"agentCommandDefinition");function D(e,n){return{name:"agent_run",description:"Run one declared action on an exact enabled Profile Agent with typed JSON input. Use for behavioral proof, not as the default validation gate.",parameters:{type:"object",additionalProperties:!1,properties:{agentId:{type:"string",minLength:1},action:{type:"string",minLength:1},input:{type:"object",additionalProperties:!0}},required:["agentId","action"]},execute:a(async t=>{let o=await f(e,t),r=m(t.args,"action"),i=g(t.args,"input")??{},s=await n({context:t,command:"run",args:[r,"--json","--input",JSON.stringify(i),"--cwd",o.cwd],cwd:o.cwd,timeoutMs:12e4,maxOutputBytes:25e4});return l(t.callId,"agent_run",s.code===0&&!s.timedOut,s.code===0&&!s.timedOut?`Action ${r} passed for ${o.agentId}.`:`Action ${r} failed for ${o.agentId}.`,{agentId:o.agentId,cwd:o.cwd,action:r,input:i,...P(s)})},"execute")}}a(D,"agentRunDefinition");function L(e,n){return{name:"agent_check",description:"Run the mandatory Agent authoring gate\u2014inspect, build, validate, and eval\u2014in order for one exact Profile Agent. Stops on the first failure and returns bounded per-step receipts.",parameters:M(),execute:a(async t=>{let o=await f(e,t),r=[];for(let s of["inspect","build","validate","eval"]){let d=await v(n,t,s,o.cwd),c=P(d);if(r.push({command:s,receipt:c}),d.code!==0||d.timedOut)return l(t.callId,"agent_check",!1,`agent_check stopped at ${s} for ${o.agentId}.`,{agentId:o.agentId,cwd:o.cwd,passed:!1,failedStep:s,steps:r})}let i=await e(h(t),t);return l(t.callId,"agent_check",!0,`agent_check passed for ${o.agentId}.`,{agentId:o.agentId,cwd:o.cwd,passed:!0,failedStep:null,steps:r,profileRefresh:{activeProfile:i.activeProfile,agentIds:i.agents.map(s=>s.id).slice(0,200),actionIds:i.actionCatalog.map(s=>s.id).slice(0,500)}})},"execute")}}a(L,"agentCheckDefinition");async function f(e,n){let t=m(n.args,"agentId"),o=await e(h(n),n);S(o);let r=g(n.turnMetadata,"authoringIntent");if(r?.artifact==="agent"&&r.operation==="improve"&&typeof r.targetAgentId=="string"&&r.targetAgentId!==t)throw new Error(`Agent improve is bound to ${r.targetAgentId}; ${t} is not authorized.`);if(!o.agents.find(k=>k.id===t)?.enabled)throw new Error(`Enabled Profile Agent not found: ${t}`);let s=t==="default"?o.sourcePath:p.resolve(o.sourcePath,"agents",t),d=await C(o.sourcePath),c=await C(s).catch(()=>null);if(!c)throw new Error(`Profile Agent source does not exist: ${t}`);if(!F(d,c))throw new Error(`Profile Agent source escapes the selected Profile: ${t}`);return{profile:o,agentId:t,cwd:c}}a(f,"resolveAgentTarget");async function v(e,n,t,o){return e({context:n,command:t,args:t==="inspect"||t==="validate"||t==="eval"||t==="traces"?["--json"]:[],cwd:o,timeoutMs:t==="eval"?18e4:12e4,maxOutputBytes:25e4})}a(v,"executeAgentCommand");function S(e){if(e.error)throw new Error(e.error);if(e.mode!=="local"||!e.repoPath||!e.sourcePath)throw new Error("The selected OpenPond Profile is not locally editable.")}a(S,"assertEditableProfile");function N(e,n,t){let o=e.git?.files.slice(0,200).map(r=>r.path)??[];return{mode:e.mode,editable:e.mode==="local"&&!!(e.repoPath&&e.sourcePath)&&!e.error,blockedReason:e.error??(e.mode==="local"&&e.repoPath&&e.sourcePath?null:"The selected Profile is not locally editable."),ref:t,activeProfile:e.activeProfile,repoPath:e.repoPath,sourcePath:e.sourcePath,manifestPath:e.manifestPath,profileConfigPath:e.sourcePath?p.join(e.sourcePath,"settings","profile.yaml"):null,authoring:g(n,"authoringIntent"),skills:e.skills.slice(0,200).map(r=>({name:r.name,description:r.description,path:r.path,sourcePath:r.sourcePath,enabled:r.enabled,validationStatus:r.validationStatus})),agents:e.agents.slice(0,200).map(r=>{let i=e.actionCatalog.filter(s=>s.agentId===r.id).slice(0,100);return{id:r.id,name:r.name,path:r.path,sourcePath:e.sourcePath?r.id==="default"?e.sourcePath:p.resolve(e.sourcePath,"agents",r.id):r.path,enabled:r.enabled,defaultAction:i.find(s=>s.sourceActionId==="chat"||s.id===`${r.id}.chat`)?.id??i[0]?.id??null,actionNames:i.map(s=>s.id)}}),git:e.git?{branch:e.git.branch,head:e.git.head,dirty:e.git.dirty,changedPaths:o,truncated:e.git.files.length>o.length}:null}}a(N,"profileProjection");function h(e){let n=g(e.turnMetadata,"selectedProfileRef");return n&&(n.source==="local"||n.source==="github"||n.source==="openpond_git")&&typeof n.repositoryId=="string"&&n.repositoryId.trim()&&typeof n.profileId=="string"&&n.profileId.trim()?{source:n.source,repositoryId:n.repositoryId,profileId:n.profileId}:e.session.currentProfile??null}a(h,"selectedProfileRef");function M(){return{type:"object",additionalProperties:!1,properties:{agentId:{type:"string",minLength:1,description:"Exact enabled Agent ID from get_profile."}},required:["agentId"]}}a(M,"agentTargetParameters");function j(e){return`Run OpenPond Agent SDK ${e.replace(/^agent_/,"")} for one exact enabled Agent beneath the selected Profile and return a bounded structured receipt.`}a(j,"agentToolDescription");function P(e){return{code:e.code,timedOut:e.timedOut,stdout:$(e.stdout),stderr:e.stderr,stdoutTruncated:e.stdoutTruncated,stderrTruncated:e.stderrTruncated}}a(P,"commandReceipt");function $(e){let n=e.trim();if(!n)return"";try{return JSON.parse(n)}catch{return n}}a($,"parseJsonOrText");function l(e,n,t,o,r){return{toolCallId:e,name:n,ok:t,contentText:JSON.stringify({ok:t,action:n,output:o,data:r},null,2),data:r}}a(l,"modelResult");function m(e,n){let t=e[n];if(typeof t!="string"||!t.trim())throw new Error(`${n} is required`);return t.trim()}a(m,"stringArg");function R(e,n){let t=e[n];return typeof t=="string"&&t.trim()?t.trim():null}a(R,"optionalStringArg");function q(e,n){let t=e[n];return Array.isArray(t)?t:[]}a(q,"arrayArg");function g(e,n){let t=n&&e&&typeof e=="object"&&!Array.isArray(e)?e[n]:e;return t&&typeof t=="object"&&!Array.isArray(t)?t:null}a(g,"recordArg");function F(e,n){let t=p.relative(e,n);return t===""||!t.startsWith("..")&&!p.isAbsolute(t)}a(F,"isWithin");import{execFile as B}from"node:child_process";import y from"node:path";var b=12,_=8,w=" .:-=+*#%@";function he(e={}){return{name:"view_image",description:"Inspect a real local PNG, JPEG, GIF, WebP, or AVIF file. Reads the image bytes directly and returns dimensions plus a coarse pixel/color map; it also creates an actual image preview in the chat UI. Use this instead of opening file:// URLs or browser snapshots, which cannot inspect local image pixels. For many video frames, build one contact sheet and inspect that rather than reading frames one by one.",parameters:{type:"object",additionalProperties:!1,properties:{path:{type:"string",minLength:1,description:"Absolute image path, or a path relative to the selected local project."}},required:["path"]},enabled:a(n=>n.provider==="codex"||n.session.provider==="codex"||n.session.openPondCommandAccessMode==="disabled"?!1:A({session:n.session}).target!=="sandbox","enabled"),execute:a(async n=>{if(n.turnMetadata?.source==="experiment-improvement"||n.turnMetadata?.refinementCandidate!==void 0||n.session.metadata?.source==="experiment-improvement"||n.session.metadata?.refinementCandidate!==void 0){if(!e.executeCandidateImage)throw new Error("Candidate image inspection requires its confined filesystem executor.");return e.executeCandidateImage(n)}let t=K(n.args.path,"path"),o=y.isAbsolute(t)?y.resolve(t):n.session.cwd?y.resolve(n.session.cwd,t):"";if(!o)throw new Error("A relative image path requires a selected local project.");let r=await T(o);if(!r)throw new Error(`Local image was not found or is not a supported image: ${o}`);let i=await U(r.path,n.signal);return{toolCallId:n.callId,name:"view_image",ok:!0,contentText:JSON.stringify({ok:!0,action:"view_image",output:`Read actual image pixels from ${r.path}.`,data:{path:r.path,contentType:r.contentType,sizeBytes:r.sizeBytes,...i,note:"The luminance and color maps are deterministic pixel samples, not a semantic vision caption."}},null,2),data:{openpondImagePreviewPath:r.path,path:r.path,contentType:r.contentType,sizeBytes:r.sizeBytes,...i}}},"execute")}}a(he,"createLocalImageModelToolDefinition");async function U(e,n,t=z){let o=await t("identify",["-format","%m %w %h",e],n),r=/^(\S+)\s+(\d+)\s+(\d+)/.exec(o.trim());if(!r)throw new Error("Image metadata could not be decoded.");let i=await t("convert",[e,"-resize",`${b}x${_}!`,"-depth","8","txt:-"],n),s=W(i);return{format:r[1],width:Number.parseInt(r[2],10),height:Number.parseInt(r[3],10),luminanceMap:s.map(d=>d.map(J).join("")),colorMap:s.map(d=>d.map(c=>`#${c.map(H).join("")}`))}}a(U,"inspectImagePixels");function W(e){let n=Array.from({length:_},()=>Array.from({length:b},()=>[0,0,0]));for(let t of e.split(/\r?\n/)){let o=/^(\d+),(\d+):\s*\(\s*(\d+),\s*(\d+),\s*(\d+)/.exec(t);if(!o)continue;let r=Number.parseInt(o[1],10),i=Number.parseInt(o[2],10);r>=b||i>=_||(n[i][r]=[Number.parseInt(o[3],10),Number.parseInt(o[4],10),Number.parseInt(o[5],10)])}return n}a(W,"sampledPixelRows");function J([e,n,t]){let o=.2126*e+.7152*n+.0722*t;return w[Math.min(w.length-1,Math.round(o/255*(w.length-1)))]}a(J,"luminanceCharacter");function H(e){return Math.max(0,Math.min(255,e)).toString(16).padStart(2,"0")}a(H,"hexByte");function z(e,n,t){return new Promise((o,r)=>{B(e,n,{encoding:"utf8",maxBuffer:256*1024,signal:t},(i,s)=>{if(i){r(new Error(`${e} could not inspect the image: ${i.message}`));return}o(s)})})}a(z,"runImageCommand");function K(e,n){if(typeof e!="string"||!e.trim())throw new Error(`${n} is required.`);return e.trim()}a(K,"stringArg");export{ne as a,re as b,ce as c,he as d,U as e,G as f,X as g,Y as h,Q as i,V as j};