openpond 0.2.70 → 0.2.71

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 (349) hide show
  1. package/dist/app-server.js +1 -1
  2. package/dist/chunks/{acp-QTA6IU6W.js → acp-VWPJ2EL4.js} +1 -1
  3. package/dist/chunks/{acp-agent-N77HPAYQ.js → acp-agent-OZHZMQ6R.js} +1 -1
  4. package/dist/chunks/{actions-command-BZQCUDMD.js → actions-command-AXGXBU75.js} +1 -1
  5. package/dist/chunks/{app-layer-YQQNLIXA.js → app-layer-OHPIYEOJ.js} +1 -1
  6. package/dist/chunks/{app-server-evaluations-RRLYWLPK.js → app-server-evaluations-Y5UEF2Y7.js} +1 -1
  7. package/dist/chunks/{app-server-harness-services-XXM336NU.js → app-server-harness-services-GUHAIIPS.js} +1 -1
  8. package/dist/chunks/{app-server-runtime-B7AMBGQZ.js → app-server-runtime-CH5STRJP.js} +1 -1
  9. package/dist/chunks/{apps-WG7WY5CB.js → apps-DNLT6P4J.js} +1 -1
  10. package/dist/chunks/{chunk-MOXIGLN2.js → chunk-23YW5PAQ.js} +1 -1
  11. package/dist/chunks/{chunk-ZDEIVUUI.js → chunk-27OJ2OLP.js} +1 -1
  12. package/dist/chunks/{chunk-NSSZ2ZIU.js → chunk-2EAZB2MW.js} +1 -1
  13. package/dist/chunks/{chunk-DRLP7GIU.js → chunk-2GEZ3ZY7.js} +1 -1
  14. package/dist/chunks/{chunk-PAYFJHPO.js → chunk-2PVW2XFF.js} +1 -1
  15. package/dist/chunks/{chunk-Y2WNZWT2.js → chunk-2Q6FTL4C.js} +1 -1
  16. package/dist/chunks/{chunk-KP2MYTP5.js → chunk-2QHB5P2K.js} +1 -1
  17. package/dist/chunks/{chunk-FNGZ4UDZ.js → chunk-33UVQ7DU.js} +1 -1
  18. package/dist/chunks/{chunk-M4ZHFDRJ.js → chunk-3JVZ7OCQ.js} +1 -1
  19. package/dist/chunks/{chunk-4BUM6JEC.js → chunk-3JYPUOK4.js} +1 -1
  20. package/dist/chunks/{chunk-DXJC3QW7.js → chunk-3VT2PPKW.js} +1 -1
  21. package/dist/chunks/{chunk-Z33RVGP6.js → chunk-5LKEVB2P.js} +1 -1
  22. package/dist/chunks/{chunk-P4QM63L3.js → chunk-5ZBDHIIE.js} +1 -1
  23. package/dist/chunks/{chunk-WD4KAKEX.js → chunk-64EDQ7UV.js} +1 -1
  24. package/dist/chunks/{chunk-OL3L3U36.js → chunk-6BTX66SV.js} +1 -1
  25. package/dist/chunks/{chunk-KU4TPDPH.js → chunk-6LAGMWJE.js} +1 -1
  26. package/dist/chunks/{chunk-65FJWWXG.js → chunk-6YR5IYHH.js} +1 -1
  27. package/dist/chunks/{chunk-AUO5DCEU.js → chunk-73COPJ32.js} +1 -1
  28. package/dist/chunks/{chunk-KDER7R45.js → chunk-7PDF2UX2.js} +1 -1
  29. package/dist/chunks/{chunk-SO4GMSNP.js → chunk-7SOHV5BH.js} +1 -1
  30. package/dist/chunks/{chunk-XOPHFUUY.js → chunk-ASMQTMQB.js} +1 -1
  31. package/dist/chunks/{chunk-ESYPMD7Q.js → chunk-AT3ZYNX4.js} +1 -1
  32. package/dist/chunks/{chunk-NMMHXYDJ.js → chunk-AVEHWUML.js} +1 -1
  33. package/dist/chunks/{chunk-M4A7G4S5.js → chunk-B7SCVTE6.js} +1 -1
  34. package/dist/chunks/{chunk-DKOVZ6R2.js → chunk-BQNU4HZW.js} +1 -1
  35. package/dist/chunks/{chunk-UANH7U3Y.js → chunk-BTEBZYK3.js} +1 -1
  36. package/dist/chunks/{chunk-BU6MW65V.js → chunk-BYVE4TMU.js} +1 -1
  37. package/dist/chunks/{chunk-PNPV2LDE.js → chunk-BZS2PA4O.js} +1 -1
  38. package/dist/chunks/{chunk-AFYYIJ6K.js → chunk-C7NQPICU.js} +1 -1
  39. package/dist/chunks/{chunk-K7KBFM2T.js → chunk-CBD554GZ.js} +1 -1
  40. package/dist/chunks/{chunk-GYYJ47GX.js → chunk-CWE2N3JI.js} +1 -1
  41. package/dist/chunks/{chunk-ZYLLPRPU.js → chunk-CX4T7I47.js} +1 -1
  42. package/dist/chunks/{chunk-AQUZCWM3.js → chunk-D2V2Y3FB.js} +1 -1
  43. package/dist/chunks/{chunk-2PXKSAG6.js → chunk-DLOJG7LP.js} +1 -1
  44. package/dist/chunks/{chunk-5G7BQAUA.js → chunk-DNNWMOMG.js} +1 -1
  45. package/dist/chunks/{chunk-BGMAWETL.js → chunk-DNRC6TPJ.js} +1 -1
  46. package/dist/chunks/{chunk-5FSPDSAO.js → chunk-DUR32LJG.js} +1 -1
  47. package/dist/chunks/{chunk-JZKTBYNB.js → chunk-E57PUTV2.js} +1 -1
  48. package/dist/chunks/{chunk-OUJ63LMU.js → chunk-ER2VONWQ.js} +1 -1
  49. package/dist/chunks/{chunk-TAXCMCYZ.js → chunk-ESOIZG2G.js} +4 -4
  50. package/dist/chunks/{chunk-CCZ276IA.js → chunk-F2EUZG2W.js} +1 -1
  51. package/dist/chunks/{chunk-VJR2GNRY.js → chunk-FVMTQSVW.js} +1 -1
  52. package/dist/chunks/{chunk-YI6ME6PU.js → chunk-GG6PM7TB.js} +1 -1
  53. package/dist/chunks/{chunk-DDOIPTOM.js → chunk-GMA365GI.js} +1 -1
  54. package/dist/chunks/{chunk-JVMSN7LH.js → chunk-GR4MJJCE.js} +1 -1
  55. package/dist/chunks/{chunk-FHDH4OUA.js → chunk-GUWNSMGH.js} +1 -1
  56. package/dist/chunks/{chunk-AFH462DO.js → chunk-HT6ILPD6.js} +1 -1
  57. package/dist/chunks/{chunk-3Z4VM2LF.js → chunk-HUMNLSCV.js} +1 -1
  58. package/dist/chunks/{chunk-XYZV3FKD.js → chunk-I6KTJ3GH.js} +1 -1
  59. package/dist/chunks/{chunk-WZ35ICTE.js → chunk-IFMWAOBR.js} +1 -1
  60. package/dist/chunks/{chunk-R2FYCJL6.js → chunk-IJJ7FYZE.js} +1 -1
  61. package/dist/chunks/{chunk-XHACK2KR.js → chunk-IUYGQO2K.js} +1 -1
  62. package/dist/chunks/{chunk-55YD4UTW.js → chunk-IV2HEX3I.js} +1 -1
  63. package/dist/chunks/{chunk-U7X5ZLAL.js → chunk-JCHLDNCX.js} +1 -1
  64. package/dist/chunks/{chunk-7PKDJHT6.js → chunk-JH4RACOB.js} +1 -1
  65. package/dist/chunks/{chunk-65WRWLUD.js → chunk-JVEIK4RH.js} +1 -1
  66. package/dist/chunks/{chunk-PPF6EBTQ.js → chunk-K3WM4NEC.js} +1 -1
  67. package/dist/chunks/{chunk-EGP6DF34.js → chunk-KASHK2U5.js} +2 -2
  68. package/dist/chunks/{chunk-7OFD6TFD.js → chunk-LMLGEOKV.js} +1 -1
  69. package/dist/chunks/{chunk-QUNQM2E3.js → chunk-MPEK4ZNY.js} +1 -1
  70. package/dist/chunks/{chunk-SDHG6CKU.js → chunk-NDNSLCPE.js} +1 -1
  71. package/dist/chunks/chunk-NK2L5HA2.js +2 -0
  72. package/dist/chunks/{chunk-WCNPGKST.js → chunk-O4YHISU2.js} +1 -1
  73. package/dist/chunks/{chunk-RCQYEHHD.js → chunk-O5ZOW474.js} +1 -1
  74. package/dist/chunks/{chunk-OXQ2WFIH.js → chunk-OEAKX5TS.js} +1 -1
  75. package/dist/chunks/{chunk-54755JYM.js → chunk-OFV26C2U.js} +2 -2
  76. package/dist/chunks/{chunk-IO5DZUKL.js → chunk-OI4DAZ4U.js} +1 -1
  77. package/dist/chunks/{chunk-Q73RKX7I.js → chunk-OIIE5GUK.js} +1 -1
  78. package/dist/chunks/{chunk-CUB6PWAJ.js → chunk-OKPV6MBX.js} +6 -6
  79. package/dist/chunks/{chunk-N5EAVX4G.js → chunk-OOKHHOIU.js} +1 -1
  80. package/dist/chunks/{chunk-MIFVX5PK.js → chunk-OQ4RWCYI.js} +1 -1
  81. package/dist/chunks/{chunk-EWH64WRR.js → chunk-OTG77H7U.js} +1 -1
  82. package/dist/chunks/{chunk-7OKZCJHS.js → chunk-OXRN2257.js} +1 -1
  83. package/dist/chunks/{chunk-JVNKSU27.js → chunk-PJJSQ4ZI.js} +1 -1
  84. package/dist/chunks/{chunk-7TM25J6S.js → chunk-PXQZOVSV.js} +2 -2
  85. package/dist/chunks/{chunk-YAA7F5LI.js → chunk-QKGNAYSC.js} +1 -1
  86. package/dist/chunks/{chunk-67U7PAMU.js → chunk-QN4CFJQC.js} +1 -1
  87. package/dist/chunks/{chunk-HES4VP3D.js → chunk-RJY4EI46.js} +1 -1
  88. package/dist/chunks/{chunk-E2JB5OCO.js → chunk-RP4DPUN2.js} +1 -1
  89. package/dist/chunks/{chunk-QLGP2OAQ.js → chunk-SNBFWBJI.js} +1 -1
  90. package/dist/chunks/{chunk-ZK3ET5EP.js → chunk-SRJTQS2D.js} +3 -3
  91. package/dist/chunks/{chunk-XY7HFXLH.js → chunk-SVLVIYH2.js} +1 -1
  92. package/dist/chunks/{chunk-7NCM6GBN.js → chunk-TOWY6Y23.js} +1 -1
  93. package/dist/chunks/{chunk-VWWKWYSQ.js → chunk-TWLPZHH7.js} +1 -1
  94. package/dist/chunks/{chunk-Y4I6CFZJ.js → chunk-UGDBMRCT.js} +1 -1
  95. package/dist/chunks/{chunk-JQOVC35K.js → chunk-UKTPX2EE.js} +1 -1
  96. package/dist/chunks/{chunk-CO23RRN7.js → chunk-UMRQKE3W.js} +1 -1
  97. package/dist/chunks/{chunk-B66QCXH2.js → chunk-USKCFST5.js} +1 -1
  98. package/dist/chunks/{chunk-3A2Y7UK3.js → chunk-USTDWGR4.js} +1 -1
  99. package/dist/chunks/{chunk-CIZI6Z7D.js → chunk-VMW23TIZ.js} +1 -1
  100. package/dist/chunks/{chunk-Y4E5AAI7.js → chunk-VND53FAU.js} +1 -1
  101. package/dist/chunks/{chunk-4G3GTEVS.js → chunk-VSQPWLAG.js} +1 -1
  102. package/dist/chunks/{chunk-KCLMA2IH.js → chunk-VV4K5YPD.js} +1 -1
  103. package/dist/chunks/{chunk-7RJOCGQ6.js → chunk-WAUFXZ5B.js} +1 -1
  104. package/dist/chunks/{chunk-HG2YFMVU.js → chunk-WXG3G2O6.js} +1 -1
  105. package/dist/chunks/{chunk-PACLKDTN.js → chunk-XBAB3HMA.js} +1 -1
  106. package/dist/chunks/chunk-XJU47QS2.js +2 -0
  107. package/dist/chunks/{chunk-WGQ3FMRF.js → chunk-XKDOPNQ5.js} +1 -1
  108. package/dist/chunks/{chunk-EYTTZ5H4.js → chunk-XLZMSD5K.js} +1 -1
  109. package/dist/chunks/{chunk-Q7FBVLLB.js → chunk-XNPTLJ5Z.js} +1 -1
  110. package/dist/chunks/{chunk-ZIQJDTQB.js → chunk-XTT3K3TR.js} +1 -1
  111. package/dist/chunks/{chunk-Q7P34B2O.js → chunk-YFHQRDNQ.js} +1 -1
  112. package/dist/chunks/{chunk-UGFSAG4U.js → chunk-YG3HITOU.js} +1 -1
  113. package/dist/chunks/{chunk-DWF3FCY4.js → chunk-Z5R4OSGC.js} +1 -1
  114. package/dist/chunks/{chunk-JT5YQ52I.js → chunk-Z6HWSTEP.js} +1 -1
  115. package/dist/chunks/{chunk-4PUOWSDE.js → chunk-ZEOYNUHL.js} +1 -1
  116. package/dist/chunks/{chunk-6C6ZCYTL.js → chunk-ZG3DBXQG.js} +1 -1
  117. package/dist/chunks/{chunk-4KTGYHCE.js → chunk-ZMRP2A7K.js} +1 -1
  118. package/dist/chunks/cli-5JARGJOD.js +2 -0
  119. package/dist/chunks/{command-5AXJMFYC.js → command-AI3SMEAH.js} +3 -3
  120. package/dist/chunks/{configuration-command-5LUNWPOL.js → configuration-command-NPA46ZOT.js} +1 -1
  121. package/dist/chunks/{connected-app-executor-DHXZE4X3.js → connected-app-executor-DLC23O43.js} +1 -1
  122. package/dist/chunks/{connected-evidence-NWMPICKJ.js → connected-evidence-TVORI55Q.js} +1 -1
  123. package/dist/chunks/{connected-starting-assets-NRVXIKQ2.js → connected-starting-assets-WGGBWH4K.js} +1 -1
  124. package/dist/chunks/{continual-UCKQ2QLH.js → continual-UHQI2EQD.js} +1 -1
  125. package/dist/chunks/{core-commands-ZPBX35M2.js → core-commands-QNZUBKOC.js} +1 -1
  126. package/dist/chunks/{dataset-preparation-authoring-UUYFWWCT.js → dataset-preparation-authoring-OBMJLGA4.js} +1 -1
  127. package/dist/chunks/{datasets-6K3ZANIV.js → datasets-USJLJOEQ.js} +1 -1
  128. package/dist/chunks/{desktop-test-57INNJ76.js → desktop-test-IYHAOR47.js} +1 -1
  129. package/dist/chunks/{dist-2MKJC6HN.js → dist-C5XFRP53.js} +1 -1
  130. package/dist/chunks/{evaluation-coordination-B7CN4R2D.js → evaluation-coordination-UJENK4WQ.js} +1 -1
  131. package/dist/chunks/{experiment-improvements-G357VLDB.js → experiment-improvements-6GJMKIER.js} +1 -1
  132. package/dist/chunks/{experiments-BHQO26LJ.js → experiments-FZHILSC6.js} +1 -1
  133. package/dist/chunks/{experiments-signal-BI6NKETB.js → experiments-signal-E32CWBS4.js} +1 -1
  134. package/dist/chunks/{help-UQN5RUPA.js → help-32DLAPJR.js} +1 -1
  135. package/dist/chunks/host-profile-evaluation-tools-QAV2UGSB.js +2 -0
  136. package/dist/chunks/{host-profile-external-dataset-KSEPXY2S.js → host-profile-external-dataset-C6ZPMTX6.js} +1 -1
  137. package/dist/chunks/{hosted-app-server-composition-WDDO6F23.js → hosted-app-server-composition-5DVBKNV3.js} +1 -1
  138. package/dist/chunks/{hosted-experiment-improvement-VVYXQ65K.js → hosted-experiment-improvement-YQ24C54D.js} +1 -1
  139. package/dist/chunks/hosted-harness-runtime-KLIORGWV.js +2 -0
  140. package/dist/chunks/{hosted-profile-candidate-PTGQLPZO.js → hosted-profile-candidate-RCWFLOVJ.js} +1 -1
  141. package/dist/chunks/{hosted-profile-compiler-FS5R6CHJ.js → hosted-profile-compiler-UDG4BCEW.js} +1 -1
  142. package/dist/chunks/{hosted-profile-evaluation-control-UUEZEMXU.js → hosted-profile-evaluation-control-4R3L4FTK.js} +1 -1
  143. package/dist/chunks/{hosted-profile-evaluation-inspection-4F7OEF4T.js → hosted-profile-evaluation-inspection-NA4SSY7N.js} +1 -1
  144. package/dist/chunks/{hosted-profile-evaluation-preparation-LIJJZDHQ.js → hosted-profile-evaluation-preparation-B4BW6JTB.js} +1 -1
  145. package/dist/chunks/{hosted-tasksets-KCLNMPG5.js → hosted-tasksets-IUK3VWSL.js} +1 -1
  146. package/dist/chunks/{human-review-PX6DBIFT.js → human-review-D6QCZLYN.js} +1 -1
  147. package/dist/chunks/{import-2HEYPHPW.js → import-UCG75PN5.js} +1 -1
  148. package/dist/chunks/{learning-Y3UKNUGE.js → learning-3XDYMYBE.js} +1 -1
  149. package/dist/chunks/{learning-LSXBL5DB.js → learning-OR4CYV4B.js} +1 -1
  150. package/dist/chunks/local-harness-improvement-runtime-GZBMBZB2.js +2 -0
  151. package/dist/chunks/local-harness-taskset-review-YVP2ZQJG.js +2 -0
  152. package/dist/chunks/{model-projects-6YWVD2TS.js → model-projects-POZRHXTF.js} +1 -1
  153. package/dist/chunks/{opchat-66BCRKEZ.js → opchat-APJUUTT7.js} +1 -1
  154. package/dist/chunks/{opchat-bounded-chat-KQWXZVFN.js → opchat-bounded-chat-PBUSUAY2.js} +1 -1
  155. package/dist/chunks/{organizations-IOYWDOCC.js → organizations-WK6EZ6L3.js} +1 -1
  156. package/dist/chunks/{profile-YH6G3ZTD.js → profile-BQMS7ALQ.js} +1 -1
  157. package/dist/chunks/{project-action-payload-53OH6WDH.js → project-action-payload-CGV77JSA.js} +1 -1
  158. package/dist/chunks/{project-agent-RYVMKW2F.js → project-agent-XVFYTEUQ.js} +1 -1
  159. package/dist/chunks/{published-experiment-source-SDXUVPE7.js → published-experiment-source-2CYFIRBL.js} +1 -1
  160. package/dist/chunks/{refiner-profile-service-56VYLZQJ.js → refiner-profile-service-OLJHA4DI.js} +1 -1
  161. package/dist/chunks/{runtime-ISLJIGWC.js → runtime-32KYSVZR.js} +1 -1
  162. package/dist/chunks/{sandbox-command-DI45NRTV.js → sandbox-command-OY3VZXGG.js} +1 -1
  163. package/dist/chunks/{sandbox-template-T42MDUSR.js → sandbox-template-YOOSJ4FK.js} +1 -1
  164. package/dist/chunks/saved-work-L4KNWLZB.js +2 -0
  165. package/dist/chunks/{setup-D6TY2GWV.js → setup-EU6CMRXQ.js} +1 -1
  166. package/dist/chunks/{src-LF5X4RNQ.js → src-3DJR7OAH.js} +1 -1
  167. package/dist/chunks/{src-7RN7BF4W.js → src-HYOTHMRX.js} +111 -113
  168. package/dist/chunks/{standalone-experiment-turn-owner-TW5MTWIO.js → standalone-experiment-turn-owner-UYPA6XHW.js} +1 -1
  169. package/dist/chunks/{store-chat-resources-IRHBW2EC.js → store-chat-resources-HISLEZZM.js} +1 -1
  170. package/dist/chunks/{store-continual-support-reviews-3KK42L4I.js → store-continual-support-reviews-ORWHS57V.js} +1 -1
  171. package/dist/chunks/{store-conversation-serving-IVURK52V.js → store-conversation-serving-5UGYKEGJ.js} +1 -1
  172. package/dist/chunks/{store-create-improve-UTCLBXF2.js → store-create-improve-APLPTVYQ.js} +1 -1
  173. package/dist/chunks/{store-datasets-4AQOVAQY.js → store-datasets-HDW6IYBL.js} +1 -1
  174. package/dist/chunks/{store-evaluation-results-PK2P3IMH.js → store-evaluation-results-KB2UDCF3.js} +1 -1
  175. package/dist/chunks/{store-harness-workspaces-YEXB4IRV.js → store-harness-workspaces-TKX5PZWP.js} +1 -1
  176. package/dist/chunks/{store-human-review-O4BVHP25.js → store-human-review-IURNTX3C.js} +1 -1
  177. package/dist/chunks/{store-learned-preference-migration-validation-44SVX6YB.js → store-learned-preference-migration-validation-TH2LKQWV.js} +1 -1
  178. package/dist/chunks/{store-learning-SIUQIY5C.js → store-learning-WLUW2PWE.js} +1 -1
  179. package/dist/chunks/{store-learning-credentials-BUHR7SN6.js → store-learning-credentials-FDKCEDHK.js} +1 -1
  180. package/dist/chunks/{store-local-experiments-BHVTKPPE.js → store-local-experiments-M4V5RLHJ.js} +1 -1
  181. package/dist/chunks/{store-model-batch-review-RVAYUVK2.js → store-model-batch-review-DDZLWVTG.js} +1 -1
  182. package/dist/chunks/{store-model-configuration-AYFGMC5D.js → store-model-configuration-ATOFA5OH.js} +1 -1
  183. package/dist/chunks/{store-model-project-preparation-5DEIS7TB.js → store-model-project-preparation-ZRSCQEQR.js} +1 -1
  184. package/dist/chunks/{store-modification-recordings-LCPK6K2T.js → store-modification-recordings-YJIDUPVJ.js} +1 -1
  185. package/dist/chunks/{store-preference-comparison-5YVIQNVB.js → store-preference-comparison-JKURBESE.js} +1 -1
  186. package/dist/chunks/{store-task-inbox-L6IQTY26.js → store-task-inbox-L53OT6ZC.js} +1 -1
  187. package/dist/chunks/{store-task-inventory-QWS2C656.js → store-task-inventory-R2JJGAHW.js} +1 -1
  188. package/dist/chunks/{store-taskset-drafts-EAOOY6CR.js → store-taskset-drafts-FPNJPFPO.js} +1 -1
  189. package/dist/chunks/{store-training-FYXZU2FE.js → store-training-DIBW7OMP.js} +1 -1
  190. package/dist/chunks/{store-training-jobs-3N3VKPIY.js → store-training-jobs-K7I4SXWW.js} +1 -1
  191. package/dist/chunks/{store-training-models-VOFVGPZR.js → store-training-models-LCSB37YY.js} +1 -1
  192. package/dist/chunks/{taskset-HNDIGYQG.js → taskset-XI5SJBJL.js} +1 -1
  193. package/dist/chunks/{taskset-packages-WMG5DUBN.js → taskset-packages-FUQWNTSB.js} +1 -1
  194. package/dist/chunks/{taskset-packages-T6B6HYKZ.js → taskset-packages-GM6IUOTY.js} +1 -1
  195. package/dist/chunks/{teams-bot-Z5CZLWE4.js → teams-bot-CYC5TR64.js} +1 -1
  196. package/dist/chunks/{tool-learning-ZQ6NSJ5K.js → tool-learning-52QZIJIR.js} +1 -1
  197. package/dist/chunks/{training-JTYQA7GA.js → training-GDLLLXSV.js} +1 -1
  198. package/dist/chunks/training-RL7UUBER.js +2 -0
  199. package/dist/chunks/training-UJ62NOJJ.js +2 -0
  200. package/dist/chunks/{training-hosted-36SZFS4U.js → training-hosted-V5CHG3M3.js} +1 -1
  201. package/dist/chunks/{training-hosted-alphaedit-HSMRDJTD.js → training-hosted-alphaedit-R5PVATV4.js} +1 -1
  202. package/dist/chunks/{training-hosted-decision-7JALOU6O.js → training-hosted-decision-WNK5DE3M.js} +1 -1
  203. package/dist/chunks/{training-hosted-engram-SXO75MFG.js → training-hosted-engram-ZQDOKXAV.js} +1 -1
  204. package/dist/chunks/{training-hosted-learning-E2N32YU5.js → training-hosted-learning-UEBGSSNC.js} +1 -1
  205. package/dist/chunks/{training-hosted-modification-comparison-TXFDJFTG.js → training-hosted-modification-comparison-KKI5CKOH.js} +1 -1
  206. package/dist/chunks/{training-hosted-neuron-training-J42WK4EH.js → training-hosted-neuron-training-CFWEDRSR.js} +1 -1
  207. package/dist/chunks/{training-hosted-serving-report-BAEABGJH.js → training-hosted-serving-report-N4NF5AVW.js} +1 -1
  208. package/dist/chunks/{training-hosted-steering-T556BUBG.js → training-hosted-steering-4MDUQ2YV.js} +1 -1
  209. package/dist/chunks/{training-model-start-P3PXDWNT.js → training-model-start-NOA6TYQK.js} +1 -1
  210. package/dist/cli.js +1 -1
  211. package/dist/index.js +1 -1
  212. package/dist/skills/manifest.json +3 -3
  213. package/dist/skills/openpond-cli/references/experiments-and-training.md +19 -0
  214. package/dist/web/assets/App-L7RV4D0A.js +54 -0
  215. package/dist/web/assets/{AppDialog-x1HU1uLv.js → AppDialog-B2V84J7f.js} +1 -1
  216. package/dist/web/assets/{AppTerminalPanel-CNIKmqKc.js → AppTerminalPanel-DfYpUDKT.js} +2 -2
  217. package/dist/web/assets/{AppToastContext-DNWd43HS.js → AppToastContext-DuiPouLz.js} +1 -1
  218. package/dist/web/assets/{AppsView-BvOD83Z1.js → AppsView-B20RHDCy.js} +1 -1
  219. package/dist/web/assets/{AttachmentTypeIcon-BLdDr3JZ.js → AttachmentTypeIcon-l-GRNxaz.js} +1 -1
  220. package/dist/web/assets/{BrowserSidebar-Ar0FlFKg.js → BrowserSidebar-Ce0ToS2O.js} +1 -1
  221. package/dist/web/assets/{CartesianChart-tS7f1HZv.js → CartesianChart-CtfMRAfp.js} +1 -1
  222. package/dist/web/assets/{ChatTimelineEntry-z7_kur3h.js → ChatTimelineEntry-DzcucW20.js} +1 -1
  223. package/dist/web/assets/{CollaborationTabs-CaiFEKrv.js → CollaborationTabs-BpmKjNAC.js} +1 -1
  224. package/dist/web/assets/{CommandMenu-BpubEqaA.js → CommandMenu-JXsoxijv.js} +1 -1
  225. package/dist/web/assets/{CommunityView-TGR4s99l.js → CommunityView-ggdn8pcH.js} +1 -1
  226. package/dist/web/assets/{ComposerAttachments-DPWCjKXz.js → ComposerAttachments-BMmALUs_.js} +1 -1
  227. package/dist/web/assets/{ComposerCreateImproveStrip-Drji01_6.js → ComposerCreateImproveStrip-DcM1bkfu.js} +1 -1
  228. package/dist/web/assets/{ConversationImportsSettings-B_oW0cz7.js → ConversationImportsSettings-BKNeARHI.js} +1 -1
  229. package/dist/web/assets/{DatasetReviewImport-Dr3unJSY.js → DatasetReviewImport-DyFOE0Q0.js} +1 -1
  230. package/dist/web/assets/{ExperimentTrainingDataWorkspace-DObvpJAw.js → ExperimentTrainingDataWorkspace-CfOyoMrq.js} +2 -2
  231. package/dist/web/assets/{FilePagePreview-9kkXbARN.js → FilePagePreview-B7bWObJN.js} +2 -2
  232. package/dist/web/assets/{GetStartedView-Dv2b_SlH.js → GetStartedView-BYbFl93M.js} +1 -1
  233. package/dist/web/assets/{GettingStartedDialog-sPaPMc61.js → GettingStartedDialog-UgreDozV.js} +1 -1
  234. package/dist/web/assets/{HostedModelLearningReview-BlwhGxS6.js → HostedModelLearningReview-C_kng2U_.js} +1 -1
  235. package/dist/web/assets/{HostedModelLearningSettings-B5ahk3je.js → HostedModelLearningSettings-aesD_ifF.js} +1 -1
  236. package/dist/web/assets/{HtmlVisual-rGsClq0p.js → HtmlVisual-nvl1x-jh.js} +1 -1
  237. package/dist/web/assets/{LabModelVersionDetailPage-Da7AwZWV.js → LabModelVersionDetailPage-DrdoNvI-.js} +1 -1
  238. package/dist/web/assets/{LabModelWorkspace-DTeYViWH.js → LabModelWorkspace-CHlhzG3q.js} +1 -1
  239. package/dist/web/assets/{LabSkillSidebar-BieHbNl6.js → LabSkillSidebar-CqHeZzoj.js} +1 -1
  240. package/dist/web/assets/{LabsRoute-D3XqPB0-.js → LabsRoute-DzEbPpMK.js} +4 -4
  241. package/dist/web/assets/{LearningBatchesPage-CCBuf2u4.js → LearningBatchesPage-A2dFQW2j.js} +1 -1
  242. package/dist/web/assets/{MainChatThread-B6BQJfcq.js → MainChatThread-BSvKu4e5.js} +2 -2
  243. package/dist/web/assets/{MainPane-D3fQou29.js → MainPane-DiWIAxMj.js} +6 -6
  244. package/dist/web/assets/{ModelProjectPageHeader-BZn9Lu_J.js → ModelProjectPageHeader-lu6iRXHK.js} +1 -1
  245. package/dist/web/assets/{NativeSetupTerminal-Bglqab_g.js → NativeSetupTerminal-kZ-nFPE8.js} +2 -2
  246. package/dist/web/assets/{NativeSkillSidebar-pUGRdnV_.js → NativeSkillSidebar-DkkD1uH2.js} +1 -1
  247. package/dist/web/assets/{NewProjectDialog-BpHN38MA.js → NewProjectDialog-Dg8dMEpc.js} +1 -1
  248. package/dist/web/assets/{OutputsPage-LunDCQ6w.js → OutputsPage-Dz190U9t.js} +1 -1
  249. package/dist/web/assets/{PageChrome-DThEcWAx.js → PageChrome-Bncv-ps0.js} +1 -1
  250. package/dist/web/assets/{ProjectsPage-vct_TQgL.js → ProjectsPage-DVkYvLtd.js} +1 -1
  251. package/dist/web/assets/{RightChatPanelStack-CgFK7DY0.js → RightChatPanelStack-CP4leenI.js} +1 -1
  252. package/dist/web/assets/RightSidebarHomePanel-C0etQXpt.js +1 -0
  253. package/dist/web/assets/{ScheduledWorkPage-mmaZfybl.js → ScheduledWorkPage-DI0mgt82.js} +1 -1
  254. package/dist/web/assets/{SettingsView-CJfeRsWR.js → SettingsView-cCtkr089.js} +3 -3
  255. package/dist/web/assets/{TasksetDraftEditorPrimitives-CuimAfkv.js → TasksetDraftEditorPrimitives-DCQTuswJ.js} +1 -1
  256. package/dist/web/assets/{TeamChatView-BcK0lF1b.js → TeamChatView-BBEomfQ7.js} +1 -1
  257. package/dist/web/assets/{TerminalOverlay-0pzEvy-C.js → TerminalOverlay-Dj5NUDMp.js} +1 -1
  258. package/dist/web/assets/{TrainingCreationPanel-CcyzFz7l.js → TrainingCreationPanel-Ds4PLfsd.js} +1 -1
  259. package/dist/web/assets/{TrainingDraftPanel-DSLZXdLz.js → TrainingDraftPanel-BAuh_BF3.js} +1 -1
  260. package/dist/web/assets/{UsageSettingsSection-BT9pcnCn.js → UsageSettingsSection-DbzeatcW.js} +1 -1
  261. package/dist/web/assets/WorkSidebarPanel-BaNuXoZc.js +1 -0
  262. package/dist/web/assets/{WorkspaceDiffPanel-Bbz5qrVA.js → WorkspaceDiffPanel-xk-ve1MO.js} +3 -3
  263. package/dist/web/assets/{WorkspaceEnvironmentMenu-6hXpvMTl.js → WorkspaceEnvironmentMenu-D8GSuoYz.js} +1 -1
  264. package/dist/web/assets/{WorkspaceFileLocation-BijVemBl.js → WorkspaceFileLocation-Dl8M2ZKN.js} +1 -1
  265. package/dist/web/assets/{WorkspaceGitDialogs-BOO0E5i9.js → WorkspaceGitDialogs-9BhLjYx4.js} +1 -1
  266. package/dist/web/assets/{WorkspaceMonacoEditor-B_YzK7Do.js → WorkspaceMonacoEditor-DYPuC7pj.js} +3 -3
  267. package/dist/web/assets/{WorkspacePdfPreview-CFti1fvu.js → WorkspacePdfPreview-B7BI9tLR.js} +2 -2
  268. package/dist/web/assets/{WorkspacePresentationPreview-DPAhNaV6.js → WorkspacePresentationPreview-sP7JUT7m.js} +1 -1
  269. package/dist/web/assets/{bot-BE2rL_qv.js → bot-D7M8ZtE6.js} +1 -1
  270. package/dist/web/assets/{chat-resources-Beh5lB36.js → chat-resources-DhKAnljP.js} +1 -1
  271. package/dist/web/assets/chevron-down-BAEcJitl.js +1 -0
  272. package/dist/web/assets/chevron-right-3G9s2cQ9.js +1 -0
  273. package/dist/web/assets/chevron-up-DTYF52H1.js +1 -0
  274. package/dist/web/assets/{chunk-C3TS766N-j1MK0e3c.js → chunk-C3TS766N-DENE60SE.js} +1 -1
  275. package/dist/web/assets/{client-choice-storage-CQ0CNkzG.js → client-choice-storage-DYZsrVr9.js} +1 -1
  276. package/dist/web/assets/{client-BnJhN-14.js → client-gy7zrd7a.js} +1 -1
  277. package/dist/web/assets/{cloud-upload-DFjZE4O4.js → cloud-upload-De-XSMUr.js} +1 -1
  278. package/dist/web/assets/{copy-CGrLUtw5.js → copy-DEK20zbZ.js} +1 -1
  279. package/dist/web/assets/{cssMode-DvRw2fUx.js → cssMode-Dau-Fhqf.js} +1 -1
  280. package/dist/web/assets/{external-link-3ZnEFUXd.js → external-link-DwDry0Fb.js} +1 -1
  281. package/dist/web/assets/{folder-open-i9n8450i.js → folder-open-DOb4AjV6.js} +1 -1
  282. package/dist/web/assets/{folder-plus-cu8Md_ej.js → folder-plus-BAouDaXv.js} +1 -1
  283. package/dist/web/assets/{git-commit-horizontal-CwckmC09.js → git-commit-horizontal-DZbHXcai.js} +1 -1
  284. package/dist/web/assets/{htmlMode-8VF4Ovtw.js → htmlMode-DlNEe6hu.js} +1 -1
  285. package/dist/web/assets/{icons-4yRSxBZj.js → icons-OQhKVrDc.js} +1 -1
  286. package/dist/web/assets/{image-D-umhyyK.js → image-BkYJDChH.js} +1 -1
  287. package/dist/web/assets/{index-DiVhx1GM.js → index-M_h2Ok4V.js} +2 -2
  288. package/dist/web/assets/{info-Dq2RsPDJ.js → info-Mj5lp4Ic.js} +1 -1
  289. package/dist/web/assets/{jsonMode-CvCYQHkB.js → jsonMode-CyOEyonV.js} +1 -1
  290. package/dist/web/assets/loader-circle-DXVtGvuV.js +1 -0
  291. package/dist/web/assets/{lspLanguageFeatures-CjufNNFF.js → lspLanguageFeatures-DAYPzatg.js} +1 -1
  292. package/dist/web/assets/{maximize-2-CKY8dua6.js → maximize-2-BwFXSX6b.js} +1 -1
  293. package/dist/web/assets/{message-square-CVDgKlKX.js → message-square-C2nqfNLn.js} +1 -1
  294. package/dist/web/assets/{monaco.contribution-BYAgjZbj.js → monaco.contribution-BZcNCJER.js} +2 -2
  295. package/dist/web/assets/{monaco.contribution-BYY3-y9l.js → monaco.contribution-BZkfRhss.js} +2 -2
  296. package/dist/web/assets/{monaco.contribution-Bh0CKj9i.js → monaco.contribution-D7_X8TXe.js} +2 -2
  297. package/dist/web/assets/{monaco.contribution-PjJ1258q.js → monaco.contribution-KyLdVay7.js} +2 -2
  298. package/dist/web/assets/{monitor-UYe42gew.js → monitor-B0Qj5Wea.js} +1 -1
  299. package/dist/web/assets/{paperclip-DrlSVUoz.js → paperclip-CmrRruxi.js} +1 -1
  300. package/dist/web/assets/{pdf-BMhday2W.js → pdf-BM-9_48p.js} +1 -1
  301. package/dist/web/assets/play-CkACZ6Zo.js +1 -0
  302. package/dist/web/assets/plus-CB258e62.js +1 -0
  303. package/dist/web/assets/{presentation-DcZKqH7w.js → presentation-BYxhoSIo.js} +1 -1
  304. package/dist/web/assets/{python-CiA01i07.js → python-B3Mj03I5.js} +1 -1
  305. package/dist/web/assets/{refresh-cw-00D-GDnF.js → refresh-cw-CwEmO71D.js} +1 -1
  306. package/dist/web/assets/{save-CXe7bqR7.js → save-S--FOuce.js} +1 -1
  307. package/dist/web/assets/{settings-lists-B5J40WM6.js → settings-lists-ChqDppMP.js} +1 -1
  308. package/dist/web/assets/square-BmPfHjGU.js +1 -0
  309. package/dist/web/assets/{square-terminal-DxC7TTds.js → square-terminal-CawpQtCi.js} +1 -1
  310. package/dist/web/assets/{submit-issue-command-Dq3TqJLV.js → submit-issue-command-CFitxxmO.js} +1 -1
  311. package/dist/web/assets/{toggleHighContrast-BH3Jckfo.js → toggleHighContrast-D-cMCvXx.js} +1 -1
  312. package/dist/web/assets/training-CzbWtx75.js +1 -0
  313. package/dist/web/assets/{training-model-data-B6IZ3x-t.js → training-model-data-G-D64935.js} +1 -1
  314. package/dist/web/assets/{tsMode-DXkj4bqC.js → tsMode-9kzS1ijG.js} +1 -1
  315. package/dist/web/assets/{upload-B3KRHVHl.js → upload-CtYsSYrM.js} +1 -1
  316. package/dist/web/assets/{useAccountSettings-BGRkTRrp.js → useAccountSettings-DYYa6puz.js} +1 -1
  317. package/dist/web/assets/{useAgentInventory-D_1AlAZJ.js → useAgentInventory-c5B_Tszj.js} +1 -1
  318. package/dist/web/assets/{useChatContextSelection-hoMSuUSE.js → useChatContextSelection-DOISZpTz.js} +1 -1
  319. package/dist/web/assets/{useLocalAgentSchedules-DxTER7Ow.js → useLocalAgentSchedules-QJ8RsMKm.js} +1 -1
  320. package/dist/web/assets/{useQuery-DkPec_9x.js → useQuery-DuTGOe2b.js} +1 -1
  321. package/dist/web/assets/{wifi-off-CMzpvbWl.js → wifi-off-BOfP4Vmg.js} +1 -1
  322. package/dist/web/assets/{workers-ziY_bTv2.js → workers-BwGpyrdj.js} +1 -1
  323. package/dist/web/assets/x-5_iy6IDd.js +1 -0
  324. package/dist/web/assets/{yaml-mSvqVSko.js → yaml-BU4IWV_7.js} +1 -1
  325. package/dist/web/index.html +1 -1
  326. package/docs/command-reference.md +1 -0
  327. package/package.json +1 -1
  328. package/dist/chunks/chunk-6D3FI2XT.js +0 -2
  329. package/dist/chunks/chunk-VEBW7NKD.js +0 -2
  330. package/dist/chunks/cli-ALEEFAJ7.js +0 -2
  331. package/dist/chunks/host-profile-evaluation-tools-UF4ATIUF.js +0 -2
  332. package/dist/chunks/hosted-harness-runtime-MMTLCL23.js +0 -2
  333. package/dist/chunks/local-harness-improvement-runtime-3YJQRYXC.js +0 -2
  334. package/dist/chunks/local-harness-taskset-review-E5GN5LTR.js +0 -2
  335. package/dist/chunks/saved-work-54I5ZJTC.js +0 -2
  336. package/dist/chunks/training-5NT2YB2L.js +0 -2
  337. package/dist/chunks/training-UY6KRG4M.js +0 -2
  338. package/dist/web/assets/App-CXhxya9x.js +0 -54
  339. package/dist/web/assets/RightSidebarHomePanel-BJmzUcmy.js +0 -1
  340. package/dist/web/assets/WorkSidebarPanel-CP-nHAsJ.js +0 -1
  341. package/dist/web/assets/chevron-down-Bn8yph2O.js +0 -1
  342. package/dist/web/assets/chevron-right-BU-jUmb2.js +0 -1
  343. package/dist/web/assets/chevron-up-DacwuDJZ.js +0 -1
  344. package/dist/web/assets/loader-circle-DBl6qqtR.js +0 -1
  345. package/dist/web/assets/play-DIqZnaNf.js +0 -1
  346. package/dist/web/assets/plus-CFNxAPMK.js +0 -1
  347. package/dist/web/assets/square-DJEaBefe.js +0 -1
  348. package/dist/web/assets/training-DWfghwfZ.js +0 -1
  349. package/dist/web/assets/x-omjwMPbJ.js +0 -1
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{l as c,m as d}from"./chunk-ZK3ET5EP.js";import"./chunk-TAXCMCYZ.js";import"./chunk-PKJHN666.js";import"./chunk-Z33RVGP6.js";import"./chunk-7PKDJHT6.js";import"./chunk-65WRWLUD.js";import"./chunk-54755JYM.js";import"./chunk-B66QCXH2.js";import{b}from"./chunk-PYNW5OFA.js";import"./chunk-MOXIGLN2.js";import"./chunk-RHMULF56.js";import"./chunk-VFH5C6D2.js";import"./chunk-UOFDKMRU.js";import"./chunk-AN525SPP.js";import"./chunk-IZ6DLEVY.js";import"./chunk-BGMAWETL.js";import"./chunk-65FJWWXG.js";import"./chunk-SYUKES6H.js";import"./chunk-EYTTZ5H4.js";import"./chunk-XY7HFXLH.js";import{e as a}from"./chunk-6I5AUTVO.js";import"./chunk-DKOVZ6R2.js";import"./chunk-N5EAVX4G.js";import"./chunk-U7X5ZLAL.js";import"./chunk-7PXZ4X4P.js";import"./chunk-N73MU2C3.js";import"./chunk-SO4GMSNP.js";import"./chunk-NMMHXYDJ.js";import"./chunk-QLGP2OAQ.js";import"./chunk-WZ35ICTE.js";import"./chunk-VS2LOUCT.js";import"./chunk-DMFUEUAZ.js";import"./chunk-AFKFN25T.js";import"./chunk-G4747MOW.js";import"./chunk-GF55VEMR.js";import"./chunk-FAKDGLZQ.js";import"./chunk-KCJVFLBB.js";import"./chunk-GW766ZSO.js";import"./chunk-VJYOKU3C.js";import"./chunk-SSJV3VX7.js";import"./chunk-7KWD2I6W.js";import"./chunk-2ACX7IW5.js";import"./chunk-OFJPOTES.js";import"./chunk-PLROXHG2.js";import"./chunk-YU3C6U5V.js";import"./chunk-PHZZBXDO.js";import"./chunk-KVTBX2UP.js";import"./chunk-U7D6Q744.js";import"./chunk-HG2YFMVU.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import"./chunk-7OKZCJHS.js";import"./chunk-UTIELP6F.js";import"./chunk-7NCM6GBN.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-6ESBAHWK.js";import"./chunk-LZPCA6DH.js";import"./chunk-L3KS6MOV.js";import"./chunk-7J2NMUTK.js";import"./chunk-VEBW7NKD.js";import"./chunk-W45RKGM6.js";import"./chunk-AUO5DCEU.js";import"./chunk-Y4I6CFZJ.js";import"./chunk-4BUM6JEC.js";import"./chunk-UGFSAG4U.js";import"./chunk-SSHE6B7Z.js";import"./chunk-JFXINDOQ.js";import"./chunk-EDYCSW22.js";import"./chunk-JT5YQ52I.js";import"./chunk-XGY4OQLC.js";import"./chunk-PAYFJHPO.js";import"./chunk-WD4KAKEX.js";import"./chunk-2PXKSAG6.js";import"./chunk-ULTV6INR.js";import"./chunk-WGQ3FMRF.js";import"./chunk-JXLDEYRW.js";import"./chunk-JVMSN7LH.js";import"./chunk-YI6ME6PU.js";import"./chunk-DRLP7GIU.js";import"./chunk-BU6MW65V.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import"./chunk-DXJC3QW7.js";import"./chunk-P4QM63L3.js";import"./chunk-MTP3B2SU.js";import"./chunk-UN2LKLGV.js";import"./chunk-HLJJAOI2.js";import"./chunk-AMC4Z7G4.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-4PUOWSDE.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-EJOV6Z6F.js";import"./chunk-GY7YSD6J.js";import"./chunk-KUE46HTH.js";import"./chunk-MZKCW6CB.js";import"./chunk-6FA3GG5B.js";import"./chunk-SV7ZBEK2.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-UGOK7VTC.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import"./chunk-FTQLQJQV.js";export{a as AGENT_PROTOCOL_VERSION,c as APP_SERVER_COMPOSITION,d as createOpenPondAppServer,b as runAppServerJsonl};
2
+ import{l as c,m as d}from"./chunk-SRJTQS2D.js";import"./chunk-ESOIZG2G.js";import"./chunk-PKJHN666.js";import"./chunk-5LKEVB2P.js";import"./chunk-JH4RACOB.js";import"./chunk-JVEIK4RH.js";import"./chunk-OFV26C2U.js";import"./chunk-USKCFST5.js";import{b}from"./chunk-PYNW5OFA.js";import"./chunk-23YW5PAQ.js";import"./chunk-RHMULF56.js";import"./chunk-VFH5C6D2.js";import"./chunk-UOFDKMRU.js";import"./chunk-AN525SPP.js";import"./chunk-IZ6DLEVY.js";import"./chunk-DNRC6TPJ.js";import"./chunk-6YR5IYHH.js";import"./chunk-SYUKES6H.js";import"./chunk-XLZMSD5K.js";import"./chunk-SVLVIYH2.js";import{e as a}from"./chunk-6I5AUTVO.js";import"./chunk-BQNU4HZW.js";import"./chunk-OOKHHOIU.js";import"./chunk-JCHLDNCX.js";import"./chunk-7PXZ4X4P.js";import"./chunk-N73MU2C3.js";import"./chunk-7SOHV5BH.js";import"./chunk-AVEHWUML.js";import"./chunk-SNBFWBJI.js";import"./chunk-IFMWAOBR.js";import"./chunk-VS2LOUCT.js";import"./chunk-DMFUEUAZ.js";import"./chunk-AFKFN25T.js";import"./chunk-G4747MOW.js";import"./chunk-GF55VEMR.js";import"./chunk-FAKDGLZQ.js";import"./chunk-KCJVFLBB.js";import"./chunk-GW766ZSO.js";import"./chunk-VJYOKU3C.js";import"./chunk-SSJV3VX7.js";import"./chunk-7KWD2I6W.js";import"./chunk-2ACX7IW5.js";import"./chunk-OFJPOTES.js";import"./chunk-PLROXHG2.js";import"./chunk-YU3C6U5V.js";import"./chunk-PHZZBXDO.js";import"./chunk-KVTBX2UP.js";import"./chunk-U7D6Q744.js";import"./chunk-WXG3G2O6.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import"./chunk-OXRN2257.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-6ESBAHWK.js";import"./chunk-LZPCA6DH.js";import"./chunk-L3KS6MOV.js";import"./chunk-7J2NMUTK.js";import"./chunk-NK2L5HA2.js";import"./chunk-W45RKGM6.js";import"./chunk-73COPJ32.js";import"./chunk-UGDBMRCT.js";import"./chunk-3JYPUOK4.js";import"./chunk-YG3HITOU.js";import"./chunk-SSHE6B7Z.js";import"./chunk-JFXINDOQ.js";import"./chunk-EDYCSW22.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-64EDQ7UV.js";import"./chunk-DLOJG7LP.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-JXLDEYRW.js";import"./chunk-GR4MJJCE.js";import"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-UN2LKLGV.js";import"./chunk-HLJJAOI2.js";import"./chunk-AMC4Z7G4.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-EJOV6Z6F.js";import"./chunk-GY7YSD6J.js";import"./chunk-KUE46HTH.js";import"./chunk-MZKCW6CB.js";import"./chunk-6FA3GG5B.js";import"./chunk-SV7ZBEK2.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-UGOK7VTC.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import"./chunk-FTQLQJQV.js";export{a as AGENT_PROTOCOL_VERSION,c as APP_SERVER_COMPOSITION,d as createOpenPondAppServer,b as runAppServerJsonl};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{f as $,g as J,h as L,i as v,j as q}from"./chunk-HYUTDZ3N.js";import{c as y}from"./chunk-RFQD6B44.js";import"./chunk-Y4E5AAI7.js";import"./chunk-CUB6PWAJ.js";import"./chunk-XRKFTPHD.js";import{b as H,c as Q}from"./chunk-22UARBPW.js";import{I as C,J as G,K as k,N as W,P as M,R as z,S as F,b as D,l as K,q as V,r as _}from"./chunk-KHDCMVEJ.js";import"./chunk-PPF6EBTQ.js";import"./chunk-BLNEHU62.js";import"./chunk-BT5YNE5U.js";import{d as m}from"./chunk-RPM4FDRX.js";import"./chunk-DFZTRMTL.js";import"./chunk-KP2MYTP5.js";import"./chunk-PNPV2LDE.js";import"./chunk-4G3GTEVS.js";import"./chunk-KU4TPDPH.js";import"./chunk-55YD4UTW.js";import"./chunk-AFYYIJ6K.js";import"./chunk-J256AEEE.js";import"./chunk-J7X72QUY.js";import"./chunk-UN2LKLGV.js";import"./chunk-HLJJAOI2.js";import"./chunk-AMC4Z7G4.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-4PUOWSDE.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import{f,h as g}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{a as S,f as w,j as T,k as j}from"./chunk-3M53YXEI.js";import"./chunk-GLUWATL5.js";import"./chunk-MZKCW6CB.js";import"./chunk-SV7ZBEK2.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-UGOK7VTC.js";import"./chunk-TBODQT4W.js";import"./chunk-5HPZGLOL.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as p}from"./chunk-FTQLQJQV.js";async function ie(){let e=await m(),s=f(e),t=await y(e,s),n=g(e),r=await L({apiBase:n,apiKey:t});console.log(JSON.stringify(r,null,2))}p(ie,"runAppsTools");async function se(e){let s=await m(),t=f(s),n=g(s),r=await y(s,t),i=typeof e.handle=="string"?String(e.handle):void 0,o=i?$(i):null,c=e.refresh!==void 0?w(e.refresh):void 0,l=await J({apiBase:n,apiKey:r,forceRefresh:c}),u=o?l.filter(a=>$(a.handle||a.gitOwner)===o):l;if(u.length===0){console.log("no apps found");return}if(w(e.json)){console.log(JSON.stringify({apps:u},null,2));return}for(let a of u){let d=a.handle||a.gitOwner||"unknown",h=a.repo||a.gitRepo||a.id,B=a.latestDeployment?.status||"no-deploy",R=a.latestDeployment?.gitBranch||a.defaultBranch||"-",I=a.codeVisibility||"unknown",E=a.sandbox?"yes":"no";console.log(`${d}/${h} ${B} ${R} code=${I} sandbox=${E} ${a.id}`)}}p(se,"runAppsList");async function oe(e,s){let t=typeof e.visibility=="string"?e.visibility.trim():typeof e.codeVisibility=="string"?e.codeVisibility.trim():"";if(t!=="public"&&t!=="private")throw new Error("usage: apps code-visibility <handle>/<repo> --visibility public|private");let n=await m(),r=f(n),i=g(n),o=await y(n,r),{app:c,handle:l,repo:u}=await v(i,o,s),a=await K(i,o,c.id,t);console.log(`${l}/${u} code_visibility=${a.app?.codeVisibility??t} app_id=${c.id}`)}p(oe,"runAppsCodeVisibility");async function ae(e){let s=await m(),t=f(s),n=await y(s,t),r=g(s),i=typeof e.appId=="string"?String(e.appId):void 0,o=await G(r,n,{appId:i});console.log(JSON.stringify(o,null,2))}p(ae,"runAppsPerformance");async function ce(e,s){let t=await m(),n=f(t),r=g(t),i=await y(t,n),{app:o}=await v(r,i,s),c=await k(r,i,o.id);console.log(JSON.stringify(c,null,2))}p(ce,"runAppsSummary");async function le(e,s,t,n){let r=(typeof e.prompt=="string"?e.prompt:null)||n.join(" ");if(!r.trim())throw new Error("usage: apps assistant <plan|performance> <handle>/<repo> --prompt <text>");let i=await m(),o=f(i),c=g(i),l=await y(i,o),{app:u}=await v(c,l,t),a=await W(c,l,{appId:u.id,mode:s,prompt:r.trim()});console.log(JSON.stringify(a,null,2))}p(le,"runAppsAssistant");async function de(e,s){let t=await m(),n=f(t),r=await y(t,n),i=g(t),o=(typeof e.prompt=="string"?e.prompt:null)||s.join(" ");if(!o.trim())throw new Error("usage: apps agent create --prompt <text> [--team-id <id>]");let c=typeof e.templateRepoUrl=="string"?e.templateRepoUrl:void 0,l=typeof e.templateBranch=="string"?e.templateBranch:void 0,u=typeof e.templateLocalPath=="string"?e.templateLocalPath:void 0,a=typeof e.teamId=="string"&&e.teamId.trim()?e.teamId.trim():void 0;if(u&&String(u).trim().length>0)throw new Error("templateLocalPath is not supported; use templateRepoUrl");let d=typeof e.env=="string"?S(e.env,"env"):void 0;if(d){if(typeof d!="object"||Array.isArray(d))throw new Error("env must be a JSON object");for(let[b,A]of Object.entries(d))if(typeof A!="string")throw new Error(`env value for ${b} must be a string`)}let h=c||l||d?{templateRepoUrl:c,templateBranch:l,envVars:d}:void 0,B=typeof e.deployEnvironment=="string"?e.deployEnvironment==="preview"?"preview":"production":void 0,R=e.deployDisabled!==void 0?w(e.deployDisabled):void 0,I=e.streamDeployLogs!==void 0?w(e.streamDeployLogs):!0,E=await C(i,r,{prompt:o.trim(),...a?{teamId:a}:{},...h?{template:h}:{},...B?{deployEnvironment:B}:{},...R!==void 0?{deployDisabled:R}:{},streamDeployLogs:I});if(!E.ok){let b=await E.text().catch(()=>"");throw new Error(`agent create failed: ${E.status} ${b}`)}let N=null,O=null,P=null;await H(E,{onConversationId:p(b=>{N=b},"onConversationId"),onItems:p(b=>{for(let A of b){let U=Q(A);U&&console.log(U);let x=A;!O&&typeof x.appId=="string"&&(O=x.appId),!P&&typeof x.deploymentId=="string"&&(P=x.deploymentId)}},"onItems")}),N&&console.log(`conversation_id: ${N}`),O&&console.log(`app_id: ${O}`),P&&console.log(`deployment_id: ${P}`);try{await J({apiBase:i,apiKey:r,forceRefresh:!0}),await L({apiBase:i,apiKey:r,forceRefresh:!0})}catch(b){console.warn("cache refresh failed",b)}}p(de,"runAppsAgentCreate");async function pe(e,s,t,n){let r=await m(),i=f(r),o=await y(r,i),c=g(r),l=typeof e.method=="string"?String(e.method).toUpperCase():void 0,u=l&&["GET","POST","PUT","DELETE"].includes(l)?l:void 0;if(l&&!u)throw new Error("method must be GET, POST, PUT, or DELETE");let a=typeof e.body=="string"?S(String(e.body),"body"):void 0,d=typeof e.headers=="string"?S(String(e.headers),"headers"):void 0,h=typeof e.scheduleId=="string"?String(e.scheduleId):void 0,B=w(e.notifyEmail),R=w(e.summary)||w(e.withSummary),I=await M(c,o,{appId:s,deploymentId:t,toolName:n,scheduleId:h,method:u,body:a,headers:d,notifyEmail:B||void 0});if(console.log(JSON.stringify(I,null,2)),R&&I.ok){let E=await k(c,o,s);console.log(JSON.stringify({summary:E},null,2))}}p(pe,"runAppsToolsExecute");async function ue(e,s){let t=typeof e.env=="string"?e.env:typeof e.vars=="string"?e.vars:typeof e.envVars=="string"?e.envVars:null;if(!t)throw new Error("usage: apps env set <handle>/<repo> --env <json>");let n=S(t,"env");if(!n||typeof n!="object"||Array.isArray(n))throw new Error("env must be a JSON object");let r={};for(let[d,h]of Object.entries(n)){if(typeof h!="string")throw new Error(`env value for ${d} must be a string`);if(!d.startsWith("OPENTOOL_PUBLIC_"))throw new Error("only OPENTOOL_PUBLIC_ env vars can be set");r[d]=h}let i=await m(),o=f(i),c=g(i),l=await y(i,o),{app:u}=await v(c,l,s),a=await V(c,l,u.id,{envVars:r});console.log(JSON.stringify(a,null,2))}p(ue,"runAppsEnvSet");async function fe(e,s){let t=await m(),n=f(t),r=g(t),i=await y(t,n),{app:o}=await v(r,i,s),c=await _(r,i,o.id);console.log(JSON.stringify(c,null,2))}p(fe,"runAppsEnvGet");async function ge(e,s){let t=await m(),n=f(t),r=g(t),i=await y(t,n),{app:o,handle:c,repo:l}=await v(r,i,s),u=typeof e.env=="string"?e.env:typeof e.environment=="string"?e.environment:void 0,a=j(u),d=await D(r,i,o.id,{environment:a});console.log(JSON.stringify(d,null,2)),(w(e.watch)||w(e.wait)||w(e.follow))&&await q({baseUrl:r,apiKey:i,deploymentId:d.deploymentId,prefix:`[${c}/${l}] `,intervalMs:e.interval?Number(e.interval):void 0,timeoutMs:e.timeout?Number(e.timeout):void 0})}p(ge,"runAppsDeploy");function X(e){let s={};if(typeof e.params=="string"){let n=S(String(e.params),"params");if(!n||typeof n!="object"||Array.isArray(n))throw new Error("params must be a JSON object");for(let[r,i]of Object.entries(n))i!==void 0&&(s[r]=typeof i=="string"?i:JSON.stringify(i))}let t=p((n,r)=>{r===void 0||r===""||(s[n]=r)},"addParam");if(t("source",typeof e.source=="string"?e.source.trim():void 0),t("symbol",typeof e.symbol=="string"?e.symbol.trim():void 0),t("cursor",typeof e.cursor=="string"?e.cursor.trim():void 0),t("status",typeof e.status=="string"?e.status.trim():void 0),t("backtestRunId",typeof e.runId=="string"?e.runId.trim():typeof e.backtestRunId=="string"?e.backtestRunId.trim():void 0),t("since",T(e.since,"since")),t("until",T(e.until,"until")),typeof e.limit=="string"&&e.limit.trim().length>0){let n=Number.parseInt(e.limit,10);if(!Number.isFinite(n))throw new Error("limit must be a number");t("limit",String(n))}return Object.keys(s).length?s:void 0}p(X,"resolveBacktestEventsParams");async function me(e,s){let t=await m(),n=f(t),r=await y(t,n),i=g(t),{app:o}=await v(i,r,s),c={...X(e)??{},appId:o.id},l=await z(i,r,{method:"GET",query:c});console.log(JSON.stringify(l,null,2))}p(me,"runBacktestEvents");async function ye(e,s){let t=typeof e.runId=="string"?e.runId.trim():typeof e.backtestRunId=="string"?e.backtestRunId.trim():"";if(!t)throw new Error("usage: backtest get <handle>/<repo> --run-id <id>");let n=await m(),r=f(n),i=await y(n,r),o=g(n),{app:c}=await v(o,i,s),l=await F(o,i,{appId:c.id,runId:t});console.log(JSON.stringify(l,null,2))}p(ye,"runBacktestGet");export{X as resolveBacktestEventsParams,de as runAppsAgentCreate,le as runAppsAssistant,oe as runAppsCodeVisibility,ge as runAppsDeploy,fe as runAppsEnvGet,ue as runAppsEnvSet,se as runAppsList,ae as runAppsPerformance,ce as runAppsSummary,ie as runAppsTools,pe as runAppsToolsExecute,me as runBacktestEvents,ye as runBacktestGet};
2
+ import{f as $,g as J,h as L,i as v,j as q}from"./chunk-HYUTDZ3N.js";import{c as y}from"./chunk-RFQD6B44.js";import"./chunk-VND53FAU.js";import"./chunk-OKPV6MBX.js";import"./chunk-XRKFTPHD.js";import{b as H,c as Q}from"./chunk-22UARBPW.js";import{I as C,J as G,K as k,N as W,P as M,R as z,S as F,b as D,l as K,q as V,r as _}from"./chunk-KHDCMVEJ.js";import"./chunk-K3WM4NEC.js";import"./chunk-BLNEHU62.js";import"./chunk-BT5YNE5U.js";import{d as m}from"./chunk-RPM4FDRX.js";import"./chunk-DFZTRMTL.js";import"./chunk-2QHB5P2K.js";import"./chunk-BZS2PA4O.js";import"./chunk-VSQPWLAG.js";import"./chunk-6LAGMWJE.js";import"./chunk-IV2HEX3I.js";import"./chunk-C7NQPICU.js";import"./chunk-J256AEEE.js";import"./chunk-J7X72QUY.js";import"./chunk-UN2LKLGV.js";import"./chunk-HLJJAOI2.js";import"./chunk-AMC4Z7G4.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import{f,h as g}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{a as S,f as w,j as T,k as j}from"./chunk-3M53YXEI.js";import"./chunk-GLUWATL5.js";import"./chunk-MZKCW6CB.js";import"./chunk-SV7ZBEK2.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-UGOK7VTC.js";import"./chunk-TBODQT4W.js";import"./chunk-5HPZGLOL.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as p}from"./chunk-FTQLQJQV.js";async function ie(){let e=await m(),s=f(e),t=await y(e,s),n=g(e),r=await L({apiBase:n,apiKey:t});console.log(JSON.stringify(r,null,2))}p(ie,"runAppsTools");async function se(e){let s=await m(),t=f(s),n=g(s),r=await y(s,t),i=typeof e.handle=="string"?String(e.handle):void 0,o=i?$(i):null,c=e.refresh!==void 0?w(e.refresh):void 0,l=await J({apiBase:n,apiKey:r,forceRefresh:c}),u=o?l.filter(a=>$(a.handle||a.gitOwner)===o):l;if(u.length===0){console.log("no apps found");return}if(w(e.json)){console.log(JSON.stringify({apps:u},null,2));return}for(let a of u){let d=a.handle||a.gitOwner||"unknown",h=a.repo||a.gitRepo||a.id,B=a.latestDeployment?.status||"no-deploy",R=a.latestDeployment?.gitBranch||a.defaultBranch||"-",I=a.codeVisibility||"unknown",E=a.sandbox?"yes":"no";console.log(`${d}/${h} ${B} ${R} code=${I} sandbox=${E} ${a.id}`)}}p(se,"runAppsList");async function oe(e,s){let t=typeof e.visibility=="string"?e.visibility.trim():typeof e.codeVisibility=="string"?e.codeVisibility.trim():"";if(t!=="public"&&t!=="private")throw new Error("usage: apps code-visibility <handle>/<repo> --visibility public|private");let n=await m(),r=f(n),i=g(n),o=await y(n,r),{app:c,handle:l,repo:u}=await v(i,o,s),a=await K(i,o,c.id,t);console.log(`${l}/${u} code_visibility=${a.app?.codeVisibility??t} app_id=${c.id}`)}p(oe,"runAppsCodeVisibility");async function ae(e){let s=await m(),t=f(s),n=await y(s,t),r=g(s),i=typeof e.appId=="string"?String(e.appId):void 0,o=await G(r,n,{appId:i});console.log(JSON.stringify(o,null,2))}p(ae,"runAppsPerformance");async function ce(e,s){let t=await m(),n=f(t),r=g(t),i=await y(t,n),{app:o}=await v(r,i,s),c=await k(r,i,o.id);console.log(JSON.stringify(c,null,2))}p(ce,"runAppsSummary");async function le(e,s,t,n){let r=(typeof e.prompt=="string"?e.prompt:null)||n.join(" ");if(!r.trim())throw new Error("usage: apps assistant <plan|performance> <handle>/<repo> --prompt <text>");let i=await m(),o=f(i),c=g(i),l=await y(i,o),{app:u}=await v(c,l,t),a=await W(c,l,{appId:u.id,mode:s,prompt:r.trim()});console.log(JSON.stringify(a,null,2))}p(le,"runAppsAssistant");async function de(e,s){let t=await m(),n=f(t),r=await y(t,n),i=g(t),o=(typeof e.prompt=="string"?e.prompt:null)||s.join(" ");if(!o.trim())throw new Error("usage: apps agent create --prompt <text> [--team-id <id>]");let c=typeof e.templateRepoUrl=="string"?e.templateRepoUrl:void 0,l=typeof e.templateBranch=="string"?e.templateBranch:void 0,u=typeof e.templateLocalPath=="string"?e.templateLocalPath:void 0,a=typeof e.teamId=="string"&&e.teamId.trim()?e.teamId.trim():void 0;if(u&&String(u).trim().length>0)throw new Error("templateLocalPath is not supported; use templateRepoUrl");let d=typeof e.env=="string"?S(e.env,"env"):void 0;if(d){if(typeof d!="object"||Array.isArray(d))throw new Error("env must be a JSON object");for(let[b,A]of Object.entries(d))if(typeof A!="string")throw new Error(`env value for ${b} must be a string`)}let h=c||l||d?{templateRepoUrl:c,templateBranch:l,envVars:d}:void 0,B=typeof e.deployEnvironment=="string"?e.deployEnvironment==="preview"?"preview":"production":void 0,R=e.deployDisabled!==void 0?w(e.deployDisabled):void 0,I=e.streamDeployLogs!==void 0?w(e.streamDeployLogs):!0,E=await C(i,r,{prompt:o.trim(),...a?{teamId:a}:{},...h?{template:h}:{},...B?{deployEnvironment:B}:{},...R!==void 0?{deployDisabled:R}:{},streamDeployLogs:I});if(!E.ok){let b=await E.text().catch(()=>"");throw new Error(`agent create failed: ${E.status} ${b}`)}let N=null,O=null,P=null;await H(E,{onConversationId:p(b=>{N=b},"onConversationId"),onItems:p(b=>{for(let A of b){let U=Q(A);U&&console.log(U);let x=A;!O&&typeof x.appId=="string"&&(O=x.appId),!P&&typeof x.deploymentId=="string"&&(P=x.deploymentId)}},"onItems")}),N&&console.log(`conversation_id: ${N}`),O&&console.log(`app_id: ${O}`),P&&console.log(`deployment_id: ${P}`);try{await J({apiBase:i,apiKey:r,forceRefresh:!0}),await L({apiBase:i,apiKey:r,forceRefresh:!0})}catch(b){console.warn("cache refresh failed",b)}}p(de,"runAppsAgentCreate");async function pe(e,s,t,n){let r=await m(),i=f(r),o=await y(r,i),c=g(r),l=typeof e.method=="string"?String(e.method).toUpperCase():void 0,u=l&&["GET","POST","PUT","DELETE"].includes(l)?l:void 0;if(l&&!u)throw new Error("method must be GET, POST, PUT, or DELETE");let a=typeof e.body=="string"?S(String(e.body),"body"):void 0,d=typeof e.headers=="string"?S(String(e.headers),"headers"):void 0,h=typeof e.scheduleId=="string"?String(e.scheduleId):void 0,B=w(e.notifyEmail),R=w(e.summary)||w(e.withSummary),I=await M(c,o,{appId:s,deploymentId:t,toolName:n,scheduleId:h,method:u,body:a,headers:d,notifyEmail:B||void 0});if(console.log(JSON.stringify(I,null,2)),R&&I.ok){let E=await k(c,o,s);console.log(JSON.stringify({summary:E},null,2))}}p(pe,"runAppsToolsExecute");async function ue(e,s){let t=typeof e.env=="string"?e.env:typeof e.vars=="string"?e.vars:typeof e.envVars=="string"?e.envVars:null;if(!t)throw new Error("usage: apps env set <handle>/<repo> --env <json>");let n=S(t,"env");if(!n||typeof n!="object"||Array.isArray(n))throw new Error("env must be a JSON object");let r={};for(let[d,h]of Object.entries(n)){if(typeof h!="string")throw new Error(`env value for ${d} must be a string`);if(!d.startsWith("OPENTOOL_PUBLIC_"))throw new Error("only OPENTOOL_PUBLIC_ env vars can be set");r[d]=h}let i=await m(),o=f(i),c=g(i),l=await y(i,o),{app:u}=await v(c,l,s),a=await V(c,l,u.id,{envVars:r});console.log(JSON.stringify(a,null,2))}p(ue,"runAppsEnvSet");async function fe(e,s){let t=await m(),n=f(t),r=g(t),i=await y(t,n),{app:o}=await v(r,i,s),c=await _(r,i,o.id);console.log(JSON.stringify(c,null,2))}p(fe,"runAppsEnvGet");async function ge(e,s){let t=await m(),n=f(t),r=g(t),i=await y(t,n),{app:o,handle:c,repo:l}=await v(r,i,s),u=typeof e.env=="string"?e.env:typeof e.environment=="string"?e.environment:void 0,a=j(u),d=await D(r,i,o.id,{environment:a});console.log(JSON.stringify(d,null,2)),(w(e.watch)||w(e.wait)||w(e.follow))&&await q({baseUrl:r,apiKey:i,deploymentId:d.deploymentId,prefix:`[${c}/${l}] `,intervalMs:e.interval?Number(e.interval):void 0,timeoutMs:e.timeout?Number(e.timeout):void 0})}p(ge,"runAppsDeploy");function X(e){let s={};if(typeof e.params=="string"){let n=S(String(e.params),"params");if(!n||typeof n!="object"||Array.isArray(n))throw new Error("params must be a JSON object");for(let[r,i]of Object.entries(n))i!==void 0&&(s[r]=typeof i=="string"?i:JSON.stringify(i))}let t=p((n,r)=>{r===void 0||r===""||(s[n]=r)},"addParam");if(t("source",typeof e.source=="string"?e.source.trim():void 0),t("symbol",typeof e.symbol=="string"?e.symbol.trim():void 0),t("cursor",typeof e.cursor=="string"?e.cursor.trim():void 0),t("status",typeof e.status=="string"?e.status.trim():void 0),t("backtestRunId",typeof e.runId=="string"?e.runId.trim():typeof e.backtestRunId=="string"?e.backtestRunId.trim():void 0),t("since",T(e.since,"since")),t("until",T(e.until,"until")),typeof e.limit=="string"&&e.limit.trim().length>0){let n=Number.parseInt(e.limit,10);if(!Number.isFinite(n))throw new Error("limit must be a number");t("limit",String(n))}return Object.keys(s).length?s:void 0}p(X,"resolveBacktestEventsParams");async function me(e,s){let t=await m(),n=f(t),r=await y(t,n),i=g(t),{app:o}=await v(i,r,s),c={...X(e)??{},appId:o.id},l=await z(i,r,{method:"GET",query:c});console.log(JSON.stringify(l,null,2))}p(me,"runBacktestEvents");async function ye(e,s){let t=typeof e.runId=="string"?e.runId.trim():typeof e.backtestRunId=="string"?e.backtestRunId.trim():"";if(!t)throw new Error("usage: backtest get <handle>/<repo> --run-id <id>");let n=await m(),r=f(n),i=await y(n,r),o=g(n),{app:c}=await v(o,i,s),l=await F(o,i,{appId:c.id,runId:t});console.log(JSON.stringify(l,null,2))}p(ye,"runBacktestGet");export{X as resolveBacktestEventsParams,de as runAppsAgentCreate,le as runAppsAssistant,oe as runAppsCodeVisibility,ge as runAppsDeploy,fe as runAppsEnvGet,ue as runAppsEnvSet,se as runAppsList,ae as runAppsPerformance,ce as runAppsSummary,ie as runAppsTools,pe as runAppsToolsExecute,me as runBacktestEvents,ye as runBacktestGet};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as pt}from"./chunk-IZ6DLEVY.js";import{a as ut}from"./chunk-SYUKES6H.js";import{b as se,m as mt,s as ft,t as ie,y as gt,z as ae}from"./chunk-YU3C6U5V.js";import{a as A,b as L}from"./chunk-KVTBX2UP.js";import{a as dt,d as Te}from"./chunk-U7D6Q744.js";import{$ as it,Ea as ct,ha as at,pa as Ie}from"./chunk-HG2YFMVU.js";import{e as st}from"./chunk-OQPJ7FJF.js";import{P as oe,R as lt}from"./chunk-7OKZCJHS.js";import{I as _e}from"./chunk-2MEOUS24.js";import{a as i,c as Re,e as Pn}from"./chunk-FTQLQJQV.js";var kt=Re((as,yt)=>{"use strict";var Cn=["||","&&",";;","|&","<(","<<<",">>",">&","<&","&",";","(",")","|","<",">"],ht=/[\n\r\u2028\u2029]/,En=/[\s#!"$&'():;<=>@\\^`|]/g;yt.exports=i(function(t){return t.map(function(n){if(n==="")return"''";if(n&&typeof n=="object"){if("op"in n&&n.op==="glob"){if(typeof n.pattern!="string")throw new TypeError("glob token requires a string `pattern`");if(ht.test(n.pattern))throw new TypeError("glob `pattern` must not contain line terminators");return n.pattern.replace(En,"\\$&")}if("op"in n&&typeof n.op=="string"){if(Cn.indexOf(n.op)<0)throw new TypeError("invalid `op` value: "+JSON.stringify(n.op));return n.op.replace(/[\s\S]/g,"\\$&")}if("comment"in n&&typeof n.comment=="string"){if(ht.test(n.comment))throw new TypeError("`comment` must not contain line terminators");return"#"+n.comment}throw new TypeError("unrecognized object token shape")}return/["\s\\]/.test(n)&&!/'/.test(n)?"'"+n.replace(/(['])/g,"\\$1")+"'":/["'\s]/.test(n)?'"'+n.replace(/(["\\$`!])/g,"\\$1")+'"':String(n).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g,"$1\\$2")}).join(" ")},"quote")});var Tt=Re((ls,It)=>{"use strict";var _t="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",wt=new RegExp("^"+_t+"$"),bt="|&;()<> \\t",Mn="'([^']*?)'",Wn='"((\\\\"|[^"])*?)"',On=/^#$/,xt="'",Rt='"',ce="$",D="",qn=4294967296;for(ve=0;ve<4;ve++)D+=(qn*Math.random()).toString(16);var ve,jn=new RegExp("^"+D);function Bn(e,t){for(var n=t.lastIndex,r=[],o;o=t.exec(e);)r[r.length]=o,t.lastIndex===o.index&&(t.lastIndex+=1);return t.lastIndex=n,r}i(Bn,"matchAll");function $n(e,t,n){var r=typeof e=="function"?e(n):e[n];return typeof r>"u"&&n!=""?r="":typeof r>"u"&&(r="$"),typeof r=="object"?t+D+JSON.stringify(r)+D:t+r}i($n,"getVar");function Nn(e,t,n){n||(n={});var r=n.escape||"\\",o=n.splitUnquoted===!0?`
2
+ import{a as pt}from"./chunk-IZ6DLEVY.js";import{a as ut}from"./chunk-SYUKES6H.js";import{b as se,m as mt,s as ft,t as ie,y as gt,z as ae}from"./chunk-YU3C6U5V.js";import{a as A,b as L}from"./chunk-KVTBX2UP.js";import{a as dt,d as Te}from"./chunk-U7D6Q744.js";import{$ as it,Ea as ct,ha as at,pa as Ie}from"./chunk-WXG3G2O6.js";import{e as st}from"./chunk-OQPJ7FJF.js";import{P as oe,R as lt}from"./chunk-OXRN2257.js";import{I as _e}from"./chunk-2MEOUS24.js";import{a as i,c as Re,e as Pn}from"./chunk-FTQLQJQV.js";var kt=Re((as,yt)=>{"use strict";var Cn=["||","&&",";;","|&","<(","<<<",">>",">&","<&","&",";","(",")","|","<",">"],ht=/[\n\r\u2028\u2029]/,En=/[\s#!"$&'():;<=>@\\^`|]/g;yt.exports=i(function(t){return t.map(function(n){if(n==="")return"''";if(n&&typeof n=="object"){if("op"in n&&n.op==="glob"){if(typeof n.pattern!="string")throw new TypeError("glob token requires a string `pattern`");if(ht.test(n.pattern))throw new TypeError("glob `pattern` must not contain line terminators");return n.pattern.replace(En,"\\$&")}if("op"in n&&typeof n.op=="string"){if(Cn.indexOf(n.op)<0)throw new TypeError("invalid `op` value: "+JSON.stringify(n.op));return n.op.replace(/[\s\S]/g,"\\$&")}if("comment"in n&&typeof n.comment=="string"){if(ht.test(n.comment))throw new TypeError("`comment` must not contain line terminators");return"#"+n.comment}throw new TypeError("unrecognized object token shape")}return/["\s\\]/.test(n)&&!/'/.test(n)?"'"+n.replace(/(['])/g,"\\$1")+"'":/["'\s]/.test(n)?'"'+n.replace(/(["\\$`!])/g,"\\$1")+'"':String(n).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g,"$1\\$2")}).join(" ")},"quote")});var Tt=Re((ls,It)=>{"use strict";var _t="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",wt=new RegExp("^"+_t+"$"),bt="|&;()<> \\t",Mn="'([^']*?)'",Wn='"((\\\\"|[^"])*?)"',On=/^#$/,xt="'",Rt='"',ce="$",D="",qn=4294967296;for(ve=0;ve<4;ve++)D+=(qn*Math.random()).toString(16);var ve,jn=new RegExp("^"+D);function Bn(e,t){for(var n=t.lastIndex,r=[],o;o=t.exec(e);)r[r.length]=o,t.lastIndex===o.index&&(t.lastIndex+=1);return t.lastIndex=n,r}i(Bn,"matchAll");function $n(e,t,n){var r=typeof e=="function"?e(n):e[n];return typeof r>"u"&&n!=""?r="":typeof r>"u"&&(r="$"),typeof r=="object"?t+D+JSON.stringify(r)+D:t+r}i($n,"getVar");function Nn(e,t,n){n||(n={});var r=n.escape||"\\",o=n.splitUnquoted===!0?`
3
3
  `:typeof n.splitUnquoted=="string"?n.splitUnquoted:"",s="(\\"+r+`['"`+bt+`]|[^\\s'"`+bt+"])+",a=new RegExp(["("+_t+")","("+s+"|"+Wn+"|"+Mn+")+"].join("|"),"g"),d=Bn(e,a);if(d.length===0)return[];t||(t={});var c=!1;return d.map(function(l){var u=l[0];if(!u||c)return;if(wt.test(u))return{op:u};var p=!1,f=!1,m="",h=[],N=!1,R=null,V=!1,k;function tt(){k+=1;var I,X,be=u.charAt(k);if(be==="{"){if(k+=1,u.charAt(k)==="}")throw new Error("Bad substitution: "+u.slice(k-2,k+1));var re=1;for(I=k;re>0&&I<u.length;)u.charAt(I)==="{"&&u.charAt(I-1)==="$"?re+=1:u.charAt(I)==="}"&&(re-=1),I+=1;if(re!==0)throw new Error("Bad substitution: "+u.slice(k));I-=1,X=u.slice(k,I),k=I}else if(/[*@#?$!_-]/.test(be))X=be,k+=1;else{var xe=u.slice(k);I=xe.match(/[^\w\d_]/),I?(X=xe.slice(0,I.index),k+=I.index-1):(X=xe,k=u.length)}return $n(t,"",X)}i(tt,"parseEnvVar");function nt(){if(R!==null){if(R===0)m!==""&&(h[h.length]=m,m="");else{h[h.length]=m,m="";for(var I=1;I<R;I+=1)h[h.length]=""}R=null}}for(i(nt,"flushRun"),k=0;k<u.length;k++){var w=u.charAt(k);if(o&&w!==ce&&nt(),V=V||!p&&(w==="*"||w==="?"),f)m+=w,f=!1;else if(p)w===p?p=!1:p==xt?m+=w:w===r?(k+=1,w=u.charAt(k),w===Rt||w===r||w===ce?m+=w:m+=r+w):w===ce?m+=tt():m+=w;else if(w===Rt||w===xt)p=w,N=!0;else{if(wt.test(w))return{op:u};if(On.test(w)){c=!0;var rt={comment:e.slice(l.index+k+1)};return m.length?[m,rt]:[rt]}else if(w===r)f=!0;else if(w===ce){var ke=tt();if(!o)m+=ke;else for(var we=0;we<ke.length;we+=1){var W=ke.charAt(we);o.indexOf(W)<0?(nt(),m+=W):R===null?R=W===" "||W===" "||W===`
4
4
  `?0:1:W!==" "&&W!==" "&&W!==`
5
5
  `&&(R+=1)}}else m+=w}}if(V)return{op:"glob",pattern:m};if(o){if(R!==null&&R>0){h[h.length]=m,m="";for(var ot=1;ot<R;ot+=1)h[h.length]=""}return(m!==""||N&&h.length===0)&&(h[h.length]=m),h}return m}).reduce(function(l,u){return typeof u>"u"||[].concat(u).forEach(function(p){l[l.length]=p}),l},[])}i(Nn,"parseInternal");It.exports=i(function(t,n,r){var o=Nn(t,n,r);return typeof n!="function"?o:o.reduce(function(s,a){if(typeof a=="object")return s[s.length]=a,s;var d=a.split(RegExp("("+D+".*?"+D+")","g"));return d.length===1?(s[s.length]=d[0],s):(d.filter(Boolean).forEach(function(c){s[s.length]=jn.test(c)?JSON.parse(c.split(D)[1]):c}),s)},[])},"parse")});var vt=Re(Se=>{"use strict";Se.quote=kt();Se.parse=Tt()});var Mt=Pn(vt(),1);import{spawn as Ln}from"node:child_process";import{randomUUID as Dn}from"node:crypto";import Z from"node:path";import{mkdir as Fn}from"node:fs/promises";var Un=120,zn=3600,ue=6e4,St=2e4,Jn="Select a project to use this.";function Rs(e){let{upsertApproval:t,appendRuntimeEvent:n}=e,r=new Map,o=new Set;async function s(c){let l=c.command.trim();if(!l)return de(l,null,"Command is empty.",Pt(c.timeoutSeconds));let u=Pt(c.timeoutSeconds),p=A({session:c.session}),f=Yn({requestedCwd:c.cwd,session:c.session}),m=!f&&!c.session.workspaceKind&&!c.session.systemKind&&e.managedChatCwd;m&&(f=Z.join(m,c.session.id.replace(/[^a-zA-Z0-9_-]/g,"_")),await Fn(f,{recursive:!0}));let h=!!(c.cwd?.trim()&&Z.isAbsolute(c.cwd.trim()));if(p.target==="sandbox"||!f||p.target!=="local"&&!h&&!m)return de(l,f,Jn,u);let N=c.session.openPondCommandAccessMode??_e;if(N==="disabled")return de(l,f,"Command access is disabled for this chat.",u);let R=Hn(l);if(N==="ask"&&!o.has(At(c.session.id,R))){let k=await d({command:l,cwd:f,family:R,input:c,timeoutSeconds:u});if(k==="acceptForSession"&&o.add(At(c.session.id,R)),k!=="accept"&&k!=="acceptForSession")return de(l,f,k==="cancel"?"Command was cancelled.":"Command was not approved.",u)}let V=e.executionEnvironment?await e.executionEnvironment(c):{};return Zn({command:l,cwd:f,timeoutSeconds:u,signal:c.signal,env:V})}i(s,"executeCommand");async function a(c,l){let u=r.get(c);if(!u)return null;let p=it.parse(l);r.delete(c);let f=er(p.decision),m={...u.approval,status:f};return await t(m),await n(Te({sessionId:m.sessionId,turnId:m.turnId??void 0,name:"approval.resolved",source:"server",action:"command",status:f==="accepted"||f==="accepted_for_session"?"completed":"failed",output:m.title,data:{approvalId:c,status:f,decision:p.decision,family:u.family}})),u.resolve(p.decision),m}i(a,"resolveApproval");async function d(c){let l={id:`approval_${Dn()}`,sessionId:c.input.session.id,turnId:c.input.turnId??null,providerRequestId:c.input.providerRequestId??c.input.turnId??c.input.session.id,kind:"command",title:c.command,detail:JSON.stringify({command:c.command,cwd:c.cwd,timeoutSeconds:c.timeoutSeconds,source:c.input.source,mode:c.input.session.openPondCommandAccessMode??_e,risk:Xn(c.command),sessionApprovalFamily:{key:c.family.key,label:c.family.label,broad:c.family.broad,reason:c.family.reason}},null,2),status:"pending",createdAt:dt()},u,p=new Promise(f=>{u=f});r.set(l.id,{approval:l,family:c.family,resolve:u});try{await t(l),await n(Te({sessionId:c.input.session.id,turnId:c.input.turnId??void 0,name:"approval.requested",source:"server",action:"command",appId:c.input.session.appId,status:"pending",output:l.title,data:l}))}catch(f){throw r.delete(l.id),f}return p}return i(d,"requestCommandApproval"),{executeCommand:s,resolveApproval:a}}i(Rs,"createOpenPondCommandAccessService");function Wt(e){return JSON.stringify({ok:e.ok,action:"exec_command",output:Qn(e),data:{command:e.command,cwd:e.cwd,exitCode:e.exitCode,stdout:Et(e.stdout),stderr:Et(e.stderr),timedOut:e.timedOut,timeoutSeconds:e.timeoutSeconds,truncated:e.truncated,blockedReason:e.blockedReason}},null,2)}i(Wt,"commandResultForModel");function Hn(e){let t=Kn(e);if(!t)return le(e,"Could not safely parse shell command.");let n=Gn(t);if(n===-1)return le(e,"Could not find command executable.");if(Vn(t))return le(e,"Shell operators require exact-command session approval.");let r=t[n],o=t[n+1]??null;return r==="pwd"?Y("pwd","pwd","Allowlisted read-only command."):r==="ls"?Y("ls","ls","Allowlisted directory listing command."):r==="git"&&o==="status"?Y("git status","git status","Allowlisted git status family."):r==="docker"&&o==="system"?Y("docker system","docker system","Allowlisted Docker system inspection family."):r==="bun"&&o==="run"?Y("bun run","bun run","Allowlisted Bun script execution family."):le(e,"Command is not in the broad session-approval allowlist.")}i(Hn,"classifyCommandFamily");function Kn(e){try{let t=(0,Mt.parse)(e),n=[];for(let r of t){if(typeof r=="string"){n.push(r);continue}if(!r||typeof r!="object")return null;let o=r.op;if(typeof o=="string"){n.push(o);continue}return null}return n}catch{return null}}i(Kn,"safeShellTokens");function Gn(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(!/^[A-Za-z_][A-Za-z0-9_]*=.*/.test(n))return t}return-1}i(Gn,"firstCommandTokenIndex");function Vn(e){return e.some(t=>/^(?:\||&&|\|\||;|&|<|>|\(|\)|\{|\})$/.test(t))}i(Vn,"hasUnsafeShellSyntax");function Y(e,t,n){return{key:e,label:t,broad:!0,reason:n}}i(Y,"broadFamily");function le(e,t){return{key:`exact:${e}`,label:e,broad:!1,reason:t}}i(le,"exactCommandFamily");function At(e,t){return`${e}:${t.key}`}i(At,"sessionFamilyKey");function Xn(e){let t=e.toLowerCase();return/\b(?:sudo|rm\s+-rf|mkfs|dd\s+if=|docker\s+(?:volume\s+rm|system\s+prune|container\s+rm)|kill(?:all)?)\b/.test(t)?"danger":/\b(?:npm|pnpm|yarn|bun)\s+(?:install|add|remove)|\bgit\s+(?:commit|push|reset|checkout|merge|rebase)|[>|]|\b(?:mv|cp|rm|touch|mkdir|docker\s+(?:run|build|compose))\b/.test(t)?"write":"read"}i(Xn,"commandRiskLabel");function Yn(e){let t=e.requestedCwd?.trim();return t?Z.isAbsolute(t)?Z.resolve(t):e.session.cwd?Z.resolve(e.session.cwd,t):null:e.session.cwd?.trim()||null}i(Yn,"resolveCommandCwd");function Pt(e){return Number.isFinite(e??NaN)?Math.max(1,Math.min(Math.floor(e),zn)):Un}i(Pt,"normalizedTimeout");function de(e,t,n,r){return{ok:!1,command:e,cwd:t,exitCode:null,stdout:"",stderr:n,timedOut:!1,timeoutSeconds:r,truncated:!1,blockedReason:n}}i(de,"blockedCommandResult");function Zn(e){return new Promise(t=>{let n=!1,r=!1,o="",s="",a=!1,d=null,c=ut(e.command),l=Ln(c.command,{cwd:e.cwd,shell:c.shell,env:{...process.env,PATH:pt(),...e.env},stdio:["ignore","pipe","pipe"],detached:process.platform!=="win32"}),u=i(h=>{n||(n=!0,clearTimeout(m),d&&clearTimeout(d),e.signal?.removeEventListener("abort",f),t(h))},"finish"),p=i((h,N)=>{let R=N.toString("utf8");h==="stdout"?o=Ae(o,R):s=Ae(s,R),o.length+s.length>=ue&&(a=!0)},"appendOutput"),f=i(()=>{Pe(l,"SIGTERM"),u({ok:!1,command:e.command,cwd:e.cwd,exitCode:null,stdout:o,stderr:s||"Command was interrupted.",timedOut:!1,timeoutSeconds:e.timeoutSeconds,truncated:a,blockedReason:"Command was interrupted."}),Ct(l)},"abort"),m=setTimeout(()=>{r=!0,Pe(l,"SIGTERM"),d=Ct(l)},e.timeoutSeconds*1e3);e.signal?.addEventListener("abort",f,{once:!0}),l.stdout?.on("data",h=>p("stdout",h)),l.stderr?.on("data",h=>p("stderr",h)),l.on("error",h=>{u({ok:!1,command:e.command,cwd:e.cwd,exitCode:null,stdout:o,stderr:h.message,timedOut:r,timeoutSeconds:e.timeoutSeconds,truncated:a,blockedReason:null})}),l.on("close",h=>{u({ok:!r&&(h??1)===0,command:e.command,cwd:e.cwd,exitCode:r?null:h??1,stdout:o,stderr:r?Ae(s,`
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{e as H,j as R}from"./chunk-DKOVZ6R2.js";import{v as I,z as C}from"./chunk-OFJPOTES.js";import{m as k,n as b}from"./chunk-RCT3O3HQ.js";import{a as h}from"./chunk-FTQLQJQV.js";import{promises as s}from"node:fs";import n from"node:path";import{execFile as O}from"node:child_process";import{promisify as A}from"node:util";var T=A(O);async function v(e,i,a={}){return(await T("git",["-C",e,...i],{encoding:"utf8",timeout:3e4,maxBuffer:8388608,env:{...process.env,...a}})).stdout.trim()}h(v,"candidateGit");async function j(e,i=I,a=!1){if(e.profileRef.source!=="local"&&!a)throw new Error("This Git adapter requires the actual installed local Profile owner; hosted adoption needs its published-source owner.");let r=await i(e.profileRef);if(r.error||r.mode!=="local"||r.activeProfile!==e.profileRef.profileId||!r.repoPath||!r.sourcePath)throw new Error("The original Profile owner is unavailable.");let l=await s.realpath(r.repoPath),p=await s.realpath(r.sourcePath),f=n.relative(l,p);if(f.startsWith("..")||n.isAbsolute(f))throw new Error("Profile source escapes its actual Git owner.");return{profile:r,repo:l,source:p,sourceRelative:f}}h(j,"originalCandidateProfile");async function ce(e,i,a=!0){if(!/^[a-f0-9]{40}$/.test(i)||await v(e,["rev-parse","HEAD"])!==i)throw new Error("The original Profile Git revision changed.");if(a&&await v(e,["status","--porcelain","--untracked-files=all"]))throw new Error("Commit or reconcile changes in the original Profile before this operation.")}h(ce,"assertCandidateGitHead");async function me(e,i){let a=await j(e.state,e.loadProfile,e.allowRemoteSnapshot),r=n.join(e.storeDir,"library","harnesses","profile-candidate-staging");await s.mkdir(r,{recursive:!0,mode:448});let l=await s.mkdtemp(n.join(r,"source-"));await s.rmdir(l),await v(a.repo,["worktree","add","--detach",l,e.commit]);try{let p=await C({repoPath:l,profileId:e.state.profileRef.profileId});if(p.error||!p.sourcePath)throw new Error("The staged original Profile cannot be loaded.");return await i({root:l,profile:p,repo:a.repo,source:p.sourcePath})}finally{await v(a.repo,["worktree","remove","--force",l]).catch(()=>{}),await s.rm(l,{recursive:!0,force:!0})}}h(me,"withCandidateProfileWorktree");function y(e){if(!e||n.isAbsolute(e)||e.includes("\\")||e.split("/").some(i=>!i||i==="."||i===".."))throw new Error("Original Profile patch path is not contained.");return e}h(y,"portable");async function pe(e){let i=e.base.manifest.metadata.profileSourceBindings;if(!Array.isArray(i))throw new Error("The original release needs compiler source bindings before candidate adoption.");let a=e.state.component.path,r=e.state.component,l=new Map(i.map(t=>{if(!t||typeof t!="object"||typeof t.releasedPath!="string"||typeof t.profileRelativePath!="string")throw new Error("Original Profile source binding is invalid.");return[y(t.releasedPath),y(t.profileRelativePath)]})),p=r.kind==="instruction"&&a==="instructions/system.md"&&e.base.manifest.metadata.profileInstructionSourcePath==="instructions/system.md"&&!l.has(a),f=l.get(a)??(p?"instructions/system.md":void 0),S=r.kind==="workflow"?`workflows/${r.workflowId}/`:r.kind==="agent"?a.split("/").slice(0,2).join("/")+"/":n.posix.dirname(a)+"/",w=f?n.posix.dirname(f)+"/":null;if(r.kind==="workflow"&&!f&&(w=S),r.kind==="agent"){let t=e.profile.agents.find(o=>a.startsWith(`agents/${o.id}/`));if(!t)throw new Error("The selected Agent original source is unavailable.");let c=y(t.path);w=((await s.lstat(n.join(e.source,c))).isDirectory()?c:n.posix.dirname(c))+"/"}let E=new Map(e.base.sourceFiles.map(t=>[t.path,t])),x=new Map(e.candidate.sourceFiles.map(t=>[t.path,t])),g=new Map;for(let t of new Set([...E.keys(),...x.keys()])){let c=E.get(t),m=x.get(t);if(c?.asset.contentHash===m?.asset.contentHash)continue;if(c&&c.asset.visibility!=="policy"||m&&m.asset.visibility!=="policy")throw new Error("A candidate cannot change protected Profile source.");let o=l.get(t)??(p&&t===a?f:void 0);if(!o&&t.startsWith(S)&&w&&(o=w+t.slice(S.length)),!o&&t==="workflows/catalog.json"&&[...l.keys()].some(P=>/^workflows\/[^/]+\/(PROMPT\.md|ACTION\.json)$/.test(P))||!o&&t==="dependency-lock/profile-import.json")continue;if(!o)throw new Error(`The selected component has no original Profile source mapping: ${t}`);if(o=y(o),o!==f&&!(r.kind!=="instruction"&&w&&o.startsWith(w)))throw new Error("Candidate patch changes a different original Profile component.");if(H(o))throw new Error("Candidate patch crosses the protected Profile evaluation closure.");let u=g.get(o),d=m?.bytes??null;if(u&&(u.before!==(c?.asset.contentHash??null)||b(u.bytes===null?null:Array.from(u.bytes))!==b(d===null?null:Array.from(d))))throw new Error("Public component aliases disagree on the original source edit.");g.set(o,{before:p&&t===a?null:c?.asset.contentHash??null,bytes:d})}for(let[t,c]of g){let m=n.join(e.source,...t.split("/")),o=n.dirname(m);for(;!await s.stat(o).catch(()=>null);)o=n.dirname(o);let u=n.relative(await s.realpath(e.source),await s.realpath(o));if(u.startsWith("..")||n.isAbsolute(u))throw new Error("Candidate patch escapes the staged Profile source.");let d=await s.lstat(m).catch(()=>null);if(d?.isSymbolicLink()||d&&!d.isFile())throw new Error("Original source patch needs a regular file.");let P=d?await s.readFile(m):null;if((P?k(P):null)!==c.before)throw new Error("Original source bytes differ from the exact candidate baseline.");c.bytes===null?await s.rm(m):(await s.mkdir(n.dirname(m),{recursive:!0}),await s.writeFile(m,c.bytes,{mode:d?.mode??384}))}return[...g.keys()]}h(pe,"applyCandidateProfileSource");function fe(e){let i=e.base.manifest.metadata.profileRepositoryId;return R({storeDir:e.storeDir,workspaceId:e.state.ownerWorkspaceId,name:e.base.manifest.name,profile:e.profile,sourceRevision:e.sourceRevision,...typeof i=="string"?{repositoryId:i}:{}})}h(fe,"compileOriginalCandidateProfile");export{v as a,j as b,ce as c,me as d,pe as e,fe as f};
2
+ import{e as H,j as R}from"./chunk-BQNU4HZW.js";import{v as I,z as C}from"./chunk-OFJPOTES.js";import{m as k,n as b}from"./chunk-RCT3O3HQ.js";import{a as h}from"./chunk-FTQLQJQV.js";import{promises as s}from"node:fs";import n from"node:path";import{execFile as O}from"node:child_process";import{promisify as A}from"node:util";var T=A(O);async function v(e,i,a={}){return(await T("git",["-C",e,...i],{encoding:"utf8",timeout:3e4,maxBuffer:8388608,env:{...process.env,...a}})).stdout.trim()}h(v,"candidateGit");async function j(e,i=I,a=!1){if(e.profileRef.source!=="local"&&!a)throw new Error("This Git adapter requires the actual installed local Profile owner; hosted adoption needs its published-source owner.");let r=await i(e.profileRef);if(r.error||r.mode!=="local"||r.activeProfile!==e.profileRef.profileId||!r.repoPath||!r.sourcePath)throw new Error("The original Profile owner is unavailable.");let l=await s.realpath(r.repoPath),p=await s.realpath(r.sourcePath),f=n.relative(l,p);if(f.startsWith("..")||n.isAbsolute(f))throw new Error("Profile source escapes its actual Git owner.");return{profile:r,repo:l,source:p,sourceRelative:f}}h(j,"originalCandidateProfile");async function ce(e,i,a=!0){if(!/^[a-f0-9]{40}$/.test(i)||await v(e,["rev-parse","HEAD"])!==i)throw new Error("The original Profile Git revision changed.");if(a&&await v(e,["status","--porcelain","--untracked-files=all"]))throw new Error("Commit or reconcile changes in the original Profile before this operation.")}h(ce,"assertCandidateGitHead");async function me(e,i){let a=await j(e.state,e.loadProfile,e.allowRemoteSnapshot),r=n.join(e.storeDir,"library","harnesses","profile-candidate-staging");await s.mkdir(r,{recursive:!0,mode:448});let l=await s.mkdtemp(n.join(r,"source-"));await s.rmdir(l),await v(a.repo,["worktree","add","--detach",l,e.commit]);try{let p=await C({repoPath:l,profileId:e.state.profileRef.profileId});if(p.error||!p.sourcePath)throw new Error("The staged original Profile cannot be loaded.");return await i({root:l,profile:p,repo:a.repo,source:p.sourcePath})}finally{await v(a.repo,["worktree","remove","--force",l]).catch(()=>{}),await s.rm(l,{recursive:!0,force:!0})}}h(me,"withCandidateProfileWorktree");function y(e){if(!e||n.isAbsolute(e)||e.includes("\\")||e.split("/").some(i=>!i||i==="."||i===".."))throw new Error("Original Profile patch path is not contained.");return e}h(y,"portable");async function pe(e){let i=e.base.manifest.metadata.profileSourceBindings;if(!Array.isArray(i))throw new Error("The original release needs compiler source bindings before candidate adoption.");let a=e.state.component.path,r=e.state.component,l=new Map(i.map(t=>{if(!t||typeof t!="object"||typeof t.releasedPath!="string"||typeof t.profileRelativePath!="string")throw new Error("Original Profile source binding is invalid.");return[y(t.releasedPath),y(t.profileRelativePath)]})),p=r.kind==="instruction"&&a==="instructions/system.md"&&e.base.manifest.metadata.profileInstructionSourcePath==="instructions/system.md"&&!l.has(a),f=l.get(a)??(p?"instructions/system.md":void 0),S=r.kind==="workflow"?`workflows/${r.workflowId}/`:r.kind==="agent"?a.split("/").slice(0,2).join("/")+"/":n.posix.dirname(a)+"/",w=f?n.posix.dirname(f)+"/":null;if(r.kind==="workflow"&&!f&&(w=S),r.kind==="agent"){let t=e.profile.agents.find(o=>a.startsWith(`agents/${o.id}/`));if(!t)throw new Error("The selected Agent original source is unavailable.");let c=y(t.path);w=((await s.lstat(n.join(e.source,c))).isDirectory()?c:n.posix.dirname(c))+"/"}let E=new Map(e.base.sourceFiles.map(t=>[t.path,t])),x=new Map(e.candidate.sourceFiles.map(t=>[t.path,t])),g=new Map;for(let t of new Set([...E.keys(),...x.keys()])){let c=E.get(t),m=x.get(t);if(c?.asset.contentHash===m?.asset.contentHash)continue;if(c&&c.asset.visibility!=="policy"||m&&m.asset.visibility!=="policy")throw new Error("A candidate cannot change protected Profile source.");let o=l.get(t)??(p&&t===a?f:void 0);if(!o&&t.startsWith(S)&&w&&(o=w+t.slice(S.length)),!o&&t==="workflows/catalog.json"&&[...l.keys()].some(P=>/^workflows\/[^/]+\/(PROMPT\.md|ACTION\.json)$/.test(P))||!o&&t==="dependency-lock/profile-import.json")continue;if(!o)throw new Error(`The selected component has no original Profile source mapping: ${t}`);if(o=y(o),o!==f&&!(r.kind!=="instruction"&&w&&o.startsWith(w)))throw new Error("Candidate patch changes a different original Profile component.");if(H(o))throw new Error("Candidate patch crosses the protected Profile evaluation closure.");let u=g.get(o),d=m?.bytes??null;if(u&&(u.before!==(c?.asset.contentHash??null)||b(u.bytes===null?null:Array.from(u.bytes))!==b(d===null?null:Array.from(d))))throw new Error("Public component aliases disagree on the original source edit.");g.set(o,{before:p&&t===a?null:c?.asset.contentHash??null,bytes:d})}for(let[t,c]of g){let m=n.join(e.source,...t.split("/")),o=n.dirname(m);for(;!await s.stat(o).catch(()=>null);)o=n.dirname(o);let u=n.relative(await s.realpath(e.source),await s.realpath(o));if(u.startsWith("..")||n.isAbsolute(u))throw new Error("Candidate patch escapes the staged Profile source.");let d=await s.lstat(m).catch(()=>null);if(d?.isSymbolicLink()||d&&!d.isFile())throw new Error("Original source patch needs a regular file.");let P=d?await s.readFile(m):null;if((P?k(P):null)!==c.before)throw new Error("Original source bytes differ from the exact candidate baseline.");c.bytes===null?await s.rm(m):(await s.mkdir(n.dirname(m),{recursive:!0}),await s.writeFile(m,c.bytes,{mode:d?.mode??384}))}return[...g.keys()]}h(pe,"applyCandidateProfileSource");function fe(e){let i=e.base.manifest.metadata.profileRepositoryId;return R({storeDir:e.storeDir,workspaceId:e.state.ownerWorkspaceId,name:e.base.manifest.name,profile:e.profile,sourceRevision:e.sourceRevision,...typeof i=="string"?{repositoryId:i}:{}})}h(fe,"compileOriginalCandidateProfile");export{v as a,j as b,ce as c,me as d,pe as e,fe as f};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{i as m}from"./chunk-AFYYIJ6K.js";import{j as l}from"./chunk-5HPZGLOL.js";import{A as t}from"./chunk-X2J2P5ZT.js";import{a as o}from"./chunk-FTQLQJQV.js";var v="evaluation-source.json",u=t.object({id:t.string().trim().min(1),clusterKey:t.string().trim().min(1),split:t.enum(["train","validation","frozen_eval"])}).passthrough(),h=t.object({schemaVersion:t.literal("openpond.trainingEvaluationSource.v1"),taskset:m,tasks:t.array(u).min(1).max(1e4),assets:t.array(t.object({path:t.string().trim().min(1).max(2e3),sha256:t.string().regex(/^[a-f0-9]{64}$/),sizeBytes:t.number().int().nonnegative(),encoding:t.literal("base64"),content:t.string().max(32*1024*1024)}).strict()).max(1e4)}).strict().superRefine((s,n)=>{let i=new Set;s.tasks.forEach((r,e)=>{r.split==="train"&&n.addIssue({code:"custom",path:["tasks",e,"split"],message:"Evaluation sources require held-out tasks."}),i.has(r.id)&&n.addIssue({code:"custom",path:["tasks",e,"id"],message:"Evaluation task identities must be unique."}),i.add(r.id)})});function k(s,n){let i=t.array(u).min(1).max(1e4).parse(s),r=t.array(u).min(1).max(1e4).parse(n),e=new Set,c=new Set;for(let a of i){if(a.split!=="train")throw new Error("The training population contains a held-out task.");if(e.has(a.id))throw new Error("Training task identities must be unique.");e.add(a.id),c.add(a.clusterKey)}let d=new Set;for(let a of r){if(a.split==="train")throw new Error("The evaluation population contains a training task.");if(d.has(a.id))throw new Error("Evaluation task identities must be unique.");if(e.has(a.id)||c.has(a.clusterKey))throw new Error("Training and evaluation tasks or families overlap.");d.add(a.id)}}o(k,"assertTrainingEvaluationIsolation");async function w(s){let n=h.parse(s),i=await l(n);return{taskset:n.taskset,dataset:{id:`training-evaluation-${i.slice(0,32)}`,contentHash:i}}}o(w,"trainingEvaluationSourceRef");export{v as a,h as b,k as c,w as d};
2
+ import{j as m}from"./chunk-C7NQPICU.js";import{j as l}from"./chunk-5HPZGLOL.js";import{A as t}from"./chunk-X2J2P5ZT.js";import{a as o}from"./chunk-FTQLQJQV.js";var v="evaluation-source.json",u=t.object({id:t.string().trim().min(1),clusterKey:t.string().trim().min(1),split:t.enum(["train","validation","frozen_eval"])}).passthrough(),h=t.object({schemaVersion:t.literal("openpond.trainingEvaluationSource.v1"),taskset:m,tasks:t.array(u).min(1).max(1e4),assets:t.array(t.object({path:t.string().trim().min(1).max(2e3),sha256:t.string().regex(/^[a-f0-9]{64}$/),sizeBytes:t.number().int().nonnegative(),encoding:t.literal("base64"),content:t.string().max(32*1024*1024)}).strict()).max(1e4)}).strict().superRefine((s,n)=>{let i=new Set;s.tasks.forEach((r,e)=>{r.split==="train"&&n.addIssue({code:"custom",path:["tasks",e,"split"],message:"Evaluation sources require held-out tasks."}),i.has(r.id)&&n.addIssue({code:"custom",path:["tasks",e,"id"],message:"Evaluation task identities must be unique."}),i.add(r.id)})});function k(s,n){let i=t.array(u).min(1).max(1e4).parse(s),r=t.array(u).min(1).max(1e4).parse(n),e=new Set,c=new Set;for(let a of i){if(a.split!=="train")throw new Error("The training population contains a held-out task.");if(e.has(a.id))throw new Error("Training task identities must be unique.");e.add(a.id),c.add(a.clusterKey)}let d=new Set;for(let a of r){if(a.split==="train")throw new Error("The evaluation population contains a training task.");if(d.has(a.id))throw new Error("Evaluation task identities must be unique.");if(e.has(a.id)||c.has(a.clusterKey))throw new Error("Training and evaluation tasks or families overlap.");d.add(a.id)}}o(k,"assertTrainingEvaluationIsolation");async function w(s){let n=h.parse(s),i=await l(n);return{taskset:n.taskset,dataset:{id:`training-evaluation-${i.slice(0,32)}`,contentHash:i}}}o(w,"trainingEvaluationSourceRef");export{v as a,h as b,k as c,w as d};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{B as T,k as c,l as i,o as f,t as S,w,z as x}from"./chunk-4PUOWSDE.js";import{Wa as R}from"./chunk-ZY32SZ2P.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as v}from"./chunk-FTQLQJQV.js";var p=e.string().trim().min(1).max(500),j=e.string().regex(/^[a-f0-9]{64}$/),y=e.object({id:p,revision:e.number().int().positive(),contentHash:j}).strict(),b=e.object({schemaVersion:e.literal("openpond.hostedTasksetSummary.v1"),id:p,teamId:p,release:y,name:e.string().min(1).max(500),description:e.string().max(2e4),taskCount:e.number().int().nonnegative(),buildIntent:e.string().min(1).max(100),methodHint:e.string().min(1).max(100).nullable(),packageBytes:e.number().int().nonnegative().nullable(),storedBytes:e.number().int().nonnegative().nullable(),createdAt:e.string().datetime({offset:!0})}).strict(),_=e.object({afterId:e.string().trim().min(1).max(2e3).optional(),limit:e.number().int().min(1).max(100).default(30),modelProjectId:p.optional(),projectId:p.optional(),search:e.string().trim().max(100).optional(),sort:e.enum(["id","name","updated"]).default("id")}).strict(),q=e.object({items:e.array(b).max(100),nextCursor:e.string().trim().min(1).max(2e3).nullable()}).strict(),B=e.object({code:e.string().min(1),message:e.string().min(1)}).strict(),l=class extends Error{static{v(this,"OpenPondTasksetCatalogError")}constructor(s,r,t){super(t),this.status=s,this.code=r,this.name="OpenPondTasksetCatalogError"}status;code},P=class{static{v(this,"OpenPondTasksetCatalogClient")}#e;constructor(s){if(!s.apiKey.trim()||!s.teamId.trim())throw new Error("Taskset API key and workspace are required.");let r=new URL(s.baseUrl);if(!["http:","https:"].includes(r.protocol)||r.username||r.password||r.search||r.hash)throw new Error("Taskset base URL must be an HTTP(S) endpoint without credentials, query, or fragment.");this.#e={...s,baseUrl:r.toString().replace(/\/+$/,"")}}async list(s={},r={}){let t=_.parse(s),a=new URLSearchParams({limit:String(t.limit)});t.afterId&&a.set("afterId",t.afterId),t.modelProjectId&&a.set("modelProjectId",t.modelProjectId),t.projectId&&a.set("projectId",t.projectId),t.search!==void 0&&a.set("search",t.search),a.set("sort",t.sort);let n=q.parse(await this.#t(`?${a}`,r.signal));if(n.items.length>t.limit||new Set(n.items.map(m=>m.id)).size!==n.items.length||n.items.some(m=>m.teamId!==this.#e.teamId))throw new l(502,"catalog_scope_mismatch","Taskset inventory did not match the requested workspace or page size.");return n}async get(s,r={}){let t=p.parse(s),a=b.parse(await this.#t(`/${encodeURIComponent(t)}`,r.signal));if(a.id!==t||a.teamId!==this.#e.teamId)throw new l(502,"catalog_identity_mismatch","Taskset metadata did not match the requested identity.");return a}async resolve(s,r={}){let t=y.parse(s),a=b.parse(await this.#t(`/releases/${encodeURIComponent(t.id)}/${t.revision}/${t.contentHash}`,r.signal));if(a.teamId!==this.#e.teamId||a.release.id!==t.id||a.release.revision!==t.revision||a.release.contentHash!==t.contentHash)throw new l(502,"catalog_release_mismatch","Taskset metadata did not match the requested immutable release.");return a}async#t(s,r){let t=await(this.#e.fetch??globalThis.fetch)(`${this.#e.baseUrl}/v1/taskset-catalog${s}`,{headers:{Authorization:`Bearer ${this.#e.apiKey}`,"X-OpenPond-Team-Id":this.#e.teamId,Accept:"application/json"},signal:r,redirect:"error"}),a=t.body?.getReader();if(!a)throw new l(t.status,"empty_response","Taskset catalog response was empty.");let n=new TextDecoder,m=0,g="";try{for(;;){let o=await a.read();if(o.done)break;if(m+=o.value.byteLength,m>4194304)throw new l(t.status,"response_too_large","Taskset catalog response exceeded 4 MiB.");g+=n.decode(o.value,{stream:!0})}g+=n.decode()}finally{await a.cancel(),a.releaseLock()}let I=JSON.parse(g);if(!t.ok){let o=B.safeParse(I);throw new l(t.status,o.success?o.data.code:"invalid_error_response",o.success?o.data.message:`Taskset catalog request failed (${t.status}).`)}return I}};var u=i.shape.id,V=e.object({schemaVersion:e.literal("openpond.modelBatchReviewInspection.v1"),packageHash:e.string().regex(/^[a-f0-9]{64}$/),definition:f,binding:R,evidence:e.array(w).min(1).max(1e4),decisions:e.array(T).min(1).max(1e4)}).strict(),k=e.object({schemaVersion:e.literal("openpond.modelBatchReviewRequest.v1"),operationId:u,modelId:u,expectedModelRevision:e.number().int().positive(),tasksetRef:i,rewardBindingRef:i.nullable(),definition:e.object({name:e.string().trim().min(1).max(500).optional(),instructions:e.string().trim().min(1).max(2e4).optional(),inputSchema:c.optional(),outputSchema:c.optional(),requiredOutputs:f.shape.requiredOutputs}).strict(),examples:e.array(e.object({evidence:i,input:c.optional(),expected:c.nullable().optional(),evaluatorContext:c.nullable().optional(),proposedTarget:c.nullable().optional()}).strict()).max(1e4)}).strict(),A=e.object({schemaVersion:e.literal("openpond.modelBatchReviewReceipt.v1"),operationId:u,modelId:u,source:S,evidence:e.array(w).min(1).max(1e4),proposals:e.array(x).max(1e4)}).strict();var d=i.shape.id,h=e.string().regex(/^[a-f0-9]{64}$/),F=e.object({schemaVersion:e.literal("openpond.datasetTrainingReviewRequest.v1"),teamId:d,operationId:d,dataset:i,packageHash:h,taskIds:e.array(d).min(1).max(1e4).nullable().default(null),purpose:e.enum(["supervised_training","reward_training"]),rewardBindingRef:i.nullable().default(null),definition:k.shape.definition.default({}),targetSource:e.enum(["none","expected_output","approved_parent"]).default("none"),shareWithWorkspace:e.literal(!0)}).strict().superRefine((s,r)=>{s.taskIds&&new Set(s.taskIds).size!==s.taskIds.length&&r.addIssue({code:"custom",path:["taskIds"],message:"Select each Dataset task once."}),s.purpose!=="supervised_training"&&s.targetSource!=="none"&&r.addIssue({code:"custom",path:["targetSource"],message:"Target proposals require a supervised review."})}),N=e.object({schemaVersion:e.literal("openpond.datasetTrainingReviewSource.v1"),dataset:i,packageHash:h,taskCount:e.number().int().nonnegative(),definition:k.shape.definition,rewardBinding:i.nullable(),hasParentTargets:e.boolean()}).strict(),C=e.object({schemaVersion:e.literal("openpond.datasetTrainingReviewReceipt.v1"),id:d,teamId:d,actorId:d,operationId:d,requestHash:h,dataset:i,packageHash:h,purpose:e.enum(["supervised_training","reward_training"]),shareWithWorkspace:e.literal(!0),source:i,definition:i,evidence:e.array(i).min(1).max(1e4),proposals:e.array(i.pick({id:!0,revision:!0})).max(1e4),createdAt:e.string().datetime({offset:!0})}).strict(),Q=C.extend({contentHash:h}).strict();export{y as a,P as b,V as c,k as d,A as e,F as f,N as g,C as h,Q as i};
2
+ import{B as T,k as c,l as i,o as f,t as S,w,z as x}from"./chunk-ZEOYNUHL.js";import{Wa as R}from"./chunk-ZY32SZ2P.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as v}from"./chunk-FTQLQJQV.js";var p=e.string().trim().min(1).max(500),j=e.string().regex(/^[a-f0-9]{64}$/),y=e.object({id:p,revision:e.number().int().positive(),contentHash:j}).strict(),b=e.object({schemaVersion:e.literal("openpond.hostedTasksetSummary.v1"),id:p,teamId:p,release:y,name:e.string().min(1).max(500),description:e.string().max(2e4),taskCount:e.number().int().nonnegative(),buildIntent:e.string().min(1).max(100),methodHint:e.string().min(1).max(100).nullable(),packageBytes:e.number().int().nonnegative().nullable(),storedBytes:e.number().int().nonnegative().nullable(),createdAt:e.string().datetime({offset:!0})}).strict(),_=e.object({afterId:e.string().trim().min(1).max(2e3).optional(),limit:e.number().int().min(1).max(100).default(30),modelProjectId:p.optional(),projectId:p.optional(),search:e.string().trim().max(100).optional(),sort:e.enum(["id","name","updated"]).default("id")}).strict(),q=e.object({items:e.array(b).max(100),nextCursor:e.string().trim().min(1).max(2e3).nullable()}).strict(),B=e.object({code:e.string().min(1),message:e.string().min(1)}).strict(),l=class extends Error{static{v(this,"OpenPondTasksetCatalogError")}constructor(s,r,t){super(t),this.status=s,this.code=r,this.name="OpenPondTasksetCatalogError"}status;code},P=class{static{v(this,"OpenPondTasksetCatalogClient")}#e;constructor(s){if(!s.apiKey.trim()||!s.teamId.trim())throw new Error("Taskset API key and workspace are required.");let r=new URL(s.baseUrl);if(!["http:","https:"].includes(r.protocol)||r.username||r.password||r.search||r.hash)throw new Error("Taskset base URL must be an HTTP(S) endpoint without credentials, query, or fragment.");this.#e={...s,baseUrl:r.toString().replace(/\/+$/,"")}}async list(s={},r={}){let t=_.parse(s),a=new URLSearchParams({limit:String(t.limit)});t.afterId&&a.set("afterId",t.afterId),t.modelProjectId&&a.set("modelProjectId",t.modelProjectId),t.projectId&&a.set("projectId",t.projectId),t.search!==void 0&&a.set("search",t.search),a.set("sort",t.sort);let n=q.parse(await this.#t(`?${a}`,r.signal));if(n.items.length>t.limit||new Set(n.items.map(m=>m.id)).size!==n.items.length||n.items.some(m=>m.teamId!==this.#e.teamId))throw new l(502,"catalog_scope_mismatch","Taskset inventory did not match the requested workspace or page size.");return n}async get(s,r={}){let t=p.parse(s),a=b.parse(await this.#t(`/${encodeURIComponent(t)}`,r.signal));if(a.id!==t||a.teamId!==this.#e.teamId)throw new l(502,"catalog_identity_mismatch","Taskset metadata did not match the requested identity.");return a}async resolve(s,r={}){let t=y.parse(s),a=b.parse(await this.#t(`/releases/${encodeURIComponent(t.id)}/${t.revision}/${t.contentHash}`,r.signal));if(a.teamId!==this.#e.teamId||a.release.id!==t.id||a.release.revision!==t.revision||a.release.contentHash!==t.contentHash)throw new l(502,"catalog_release_mismatch","Taskset metadata did not match the requested immutable release.");return a}async#t(s,r){let t=await(this.#e.fetch??globalThis.fetch)(`${this.#e.baseUrl}/v1/taskset-catalog${s}`,{headers:{Authorization:`Bearer ${this.#e.apiKey}`,"X-OpenPond-Team-Id":this.#e.teamId,Accept:"application/json"},signal:r,redirect:"error"}),a=t.body?.getReader();if(!a)throw new l(t.status,"empty_response","Taskset catalog response was empty.");let n=new TextDecoder,m=0,g="";try{for(;;){let o=await a.read();if(o.done)break;if(m+=o.value.byteLength,m>4194304)throw new l(t.status,"response_too_large","Taskset catalog response exceeded 4 MiB.");g+=n.decode(o.value,{stream:!0})}g+=n.decode()}finally{await a.cancel(),a.releaseLock()}let I=JSON.parse(g);if(!t.ok){let o=B.safeParse(I);throw new l(t.status,o.success?o.data.code:"invalid_error_response",o.success?o.data.message:`Taskset catalog request failed (${t.status}).`)}return I}};var u=i.shape.id,V=e.object({schemaVersion:e.literal("openpond.modelBatchReviewInspection.v1"),packageHash:e.string().regex(/^[a-f0-9]{64}$/),definition:f,binding:R,evidence:e.array(w).min(1).max(1e4),decisions:e.array(T).min(1).max(1e4)}).strict(),k=e.object({schemaVersion:e.literal("openpond.modelBatchReviewRequest.v1"),operationId:u,modelId:u,expectedModelRevision:e.number().int().positive(),tasksetRef:i,rewardBindingRef:i.nullable(),definition:e.object({name:e.string().trim().min(1).max(500).optional(),instructions:e.string().trim().min(1).max(2e4).optional(),inputSchema:c.optional(),outputSchema:c.optional(),requiredOutputs:f.shape.requiredOutputs}).strict(),examples:e.array(e.object({evidence:i,input:c.optional(),expected:c.nullable().optional(),evaluatorContext:c.nullable().optional(),proposedTarget:c.nullable().optional()}).strict()).max(1e4)}).strict(),A=e.object({schemaVersion:e.literal("openpond.modelBatchReviewReceipt.v1"),operationId:u,modelId:u,source:S,evidence:e.array(w).min(1).max(1e4),proposals:e.array(x).max(1e4)}).strict();var d=i.shape.id,h=e.string().regex(/^[a-f0-9]{64}$/),F=e.object({schemaVersion:e.literal("openpond.datasetTrainingReviewRequest.v1"),teamId:d,operationId:d,dataset:i,packageHash:h,taskIds:e.array(d).min(1).max(1e4).nullable().default(null),purpose:e.enum(["supervised_training","reward_training"]),rewardBindingRef:i.nullable().default(null),definition:k.shape.definition.default({}),targetSource:e.enum(["none","expected_output","approved_parent"]).default("none"),shareWithWorkspace:e.literal(!0)}).strict().superRefine((s,r)=>{s.taskIds&&new Set(s.taskIds).size!==s.taskIds.length&&r.addIssue({code:"custom",path:["taskIds"],message:"Select each Dataset task once."}),s.purpose!=="supervised_training"&&s.targetSource!=="none"&&r.addIssue({code:"custom",path:["targetSource"],message:"Target proposals require a supervised review."})}),N=e.object({schemaVersion:e.literal("openpond.datasetTrainingReviewSource.v1"),dataset:i,packageHash:h,taskCount:e.number().int().nonnegative(),definition:k.shape.definition,rewardBinding:i.nullable(),hasParentTargets:e.boolean()}).strict(),C=e.object({schemaVersion:e.literal("openpond.datasetTrainingReviewReceipt.v1"),id:d,teamId:d,actorId:d,operationId:d,requestHash:h,dataset:i,packageHash:h,purpose:e.enum(["supervised_training","reward_training"]),shareWithWorkspace:e.literal(!0),source:i,definition:i,evidence:e.array(i).min(1).max(1e4),proposals:e.array(i.pick({id:!0,revision:!0})).max(1e4),createdAt:e.string().datetime({offset:!0})}).strict(),Q=C.extend({contentHash:h}).strict();export{y as a,P as b,V as c,k as d,A as e,F as f,N as g,C as h,Q as i};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{A as h,C as I,D as f,G as u,H as S,I as k,f as R,h as y,ma as w,oa as n,qa as P,ra as g,sa as T,ua as v}from"./chunk-BU6MW65V.js";import{l as p}from"./chunk-4PUOWSDE.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as l}from"./chunk-FTQLQJQV.js";var c=e.string().trim().min(1).max(240),o=e.string().trim().min(1).max(5e3),E=e.enum(["no_training","prompting","retrieval","sft","preference","grpo_rft","sdft_opsd","sdpo","agentic_rl"]),C=e.object({id:c,taskIndex:e.number().int().nonnegative(),label:k,output:e.record(e.string(),e.unknown()),infrastructureError:e.string().trim().min(1).max(1e4).nullable(),expectedPassed:e.boolean(),expectedRewardEligible:e.boolean(),metadata:e.record(e.string(),e.unknown()).default({})}),j=e.object({schemaVersion:e.literal("openpond.capabilityDiagnosis.v1"),summary:e.string().trim().min(1).max(1e4),stableBehavior:e.array(o).max(100).default([]),changingKnowledge:e.array(o).max(100).default([]),requiredContext:e.array(o).max(100).default([]),requiredTools:e.array(c).max(100).default([]),intervention:E,trainingEligible:e.boolean(),rationale:e.array(o).min(1).max(100),confidence:e.number().min(0).max(1)}),F=e.object({id:c,sourceId:c,sourceTurnId:c.nullable(),split:h,origin:e.enum(["extracted","corrected","synthetic","expert_authored"]),inputPrompt:e.string().trim().min(1).max(1e5),expectedOutputText:e.string().trim().min(1).max(2e5).nullable(),rationale:o}),D=e.object({schemaVersion:e.literal("openpond.taskDesignProposal.v1"),id:c,name:e.string().trim().min(1).max(500),objective:e.string().trim().min(1).max(2e4),diagnosis:j.default({schemaVersion:"openpond.capabilityDiagnosis.v1",summary:"Reproduce the selected approved behavior.",stableBehavior:[],changingKnowledge:[],requiredContext:[],requiredTools:[],intervention:"sft",trainingEligible:!0,rationale:["The selected examples were supplied as demonstrations."],confidence:.5}),taskKind:u.shape.taskKind,sourceIds:e.array(c).min(1).max(1e5),assumptions:e.array(o).max(1e3),successCriteria:e.array(o).min(1).max(1e3),proposedGraders:e.array(S).max(1e3).default([]),graderFixtures:e.array(C).max(1e5).default([]),generatedFiles:e.array(g).max(1e3).default([]),proposedExamples:e.array(F).max(1e5).default([]),proposedMethod:v.shape.recommendedMethod,trainingPath:T.nullable().default(null),policy:f,warnings:e.array(e.string().trim().min(1)).default([]),createdAt:e.string().trim().min(1)});var q=e.string().min(1).max(240),_=e.string().regex(/^[a-f0-9]{64}$/),H=e.array(e.object({source:I,excerpts:e.array(e.object({role:e.enum(["user","assistant"]),text:e.string().max(2e5),turnId:q}).strict()).max(200)}).strict()).min(1).max(20),Ht=e.discriminatedUnion("action",[e.object({action:e.literal("messages"),id:q,evidence:H,instruction:e.string().max(2*1024*1024),buildSpecification:P,currentProposal:D.nullable().default(null)}).strict(),e.object({action:e.literal("validate"),evidence:H,content:e.string().max(2*1024*1024)}).strict()]),qt=e.object({messages:e.array(e.object({role:e.enum(["system","user"]),content:e.string()}).strict()).min(1).max(20),skillHash:_}).strict(),_t=e.object({proposal:D,skillHash:_}).strict(),r=n.shape.id,s=e.number().int().positive(),d=e.string().regex(/^[a-f0-9]{64}$/),m={teamId:r,modelId:r},At=e.object({schemaVersion:e.literal("openpond.tasksetDraftCreate.v1"),operationId:r,modelId:r,expectedModelRevision:s,name:n.shape.name}).strict(),Lt=e.object({schemaVersion:e.literal("openpond.tasksetDraftSourceDescriptor.v1"),...m,expectedModelRevision:s,sourcePackageHash:d}).strict(),Ut=e.object({schemaVersion:e.literal("openpond.tasksetDraftReadback.v1"),...m,draft:n,workspaceHash:d,projectEtag:d}).strict().refine(t=>t.draft.profileId===t.teamId&&t.draft.modelScope?.modelId===t.modelId,"The hosted draft must belong to its declared workspace and Model."),A=e.object({id:r,revision:s,name:n.shape.name,status:w,updatedAt:n.shape.updatedAt,sourceTasksetRef:p.nullable()}).strict(),Ot=e.object({schemaVersion:e.literal("openpond.tasksetDraftList.v1"),...m,drafts:e.array(A).max(100),nextCursor:e.string().min(1).max(2e3).nullable()}).strict(),Gt=e.object({expectedDraftRevision:s,draft:n}).strict(),Vt=e.object({expectedDraftRevision:s,expectedModelRevision:s}).strict(),L=e.object({expectedDraftRevision:s,expectedWorkspaceHash:d}).strict(),Bt=e.object({schemaVersion:e.literal("openpond.tasksetDraftValidation.v1"),...m,draftId:r,draftRevision:s,workspaceHash:d,valid:e.boolean(),issues:e.array(e.object({code:e.string().min(1),severity:e.enum(["warning","error"]),message:e.string(),path:e.string().nullable()}).strict()),packageHash:d.nullable(),tasksetRef:p.nullable()}).strict().refine(t=>t.valid?t.packageHash!==null&&t.tasksetRef!==null&&t.issues.every(a=>a.severity!=="error"):t.packageHash===null&&t.tasksetRef===null&&t.issues.some(a=>a.severity==="error"),"Validation must retain either a compiled package or publication errors."),zt=L.extend({operationId:r,expectedPackageHash:d,expectedTasksetRef:p}).strict(),Kt=e.object({schemaVersion:e.literal("openpond.tasksetDraftFileList.v1"),...m,draftId:r,draftRevision:s,files:e.array(R).max(10020)}).strict(),Wt=e.object({schemaVersion:e.literal("openpond.tasksetDraftFileReadback.v1"),...m,draftId:r,draftRevision:s,file:y}).strict(),Nt=e.object({schemaVersion:e.literal("openpond.tasksetDraftDeletion.v1"),...m,draftId:r,revision:s,deleted:e.literal(!0)}).strict(),Xt=n.shape.id,Yt=e.number().int().positive();var i=e.string().trim().min(1).max(500),Zt=e.object({projectId:i.optional(),tasksetId:i.optional(),draftId:i.optional(),taskId:i.optional(),query:e.string().trim().max(1e3).default(""),split:e.enum(["train","validation","test","frozen_eval"]).optional(),after:e.string().min(1).max(2e3).optional(),limit:e.number().int().min(1).max(100).default(30)}).strict(),U=e.object({id:i,method:e.enum(["code","judge","human"]),required:e.boolean()}),O=e.object({tasksetId:i,tasksetName:e.string(),tasksetRevision:e.number().int().positive(),tasksetHash:e.string(),taskId:i,ordinal:e.number().int().nonnegative(),title:e.string(),description:e.string(),split:e.string(),scoring:e.array(U),configuration:e.enum(["configured","needs_reward","needs_checks"]),draftId:i.nullable().default(null),modelId:i.nullable().default(null)}),ea=e.object({items:e.array(O).max(100),nextCursor:e.string().nullable()});function ta(t,a){let $=[t.instruction,t.prompt,t.request,t.question,t.message].find(b=>typeof b=="string"&&b.trim().length>0),M=typeof t.title=="string"?t.title.trim():"",x=$?.trim()??"";return{title:(M||x||a).slice(0,180),description:x.slice(0,2e3)}}l(ta,"describeTaskInput");function aa(t){return t.map(a=>({id:a.id,method:a.kind==="model_judge"?"judge":a.kind==="human"?"human":"code",required:a.hardGate}))}l(aa,"summarizeTaskScoring");function sa(t){return t.some(a=>a.kind!=="human")?t.some(a=>a.kind==="model_judge"&&a.calibrationStatus!=="passed")?"needs_checks":"configured":"needs_reward"}l(sa,"taskConfiguration");export{E as a,D as b,Ht as c,Zt as d,O as e,ea as f,ta as g,aa as h,sa as i};
2
+ import{A as h,C as I,D as f,G as u,H as S,I as k,f as R,h as y,ma as w,oa as n,qa as P,ra as g,sa as T,ua as v}from"./chunk-BYVE4TMU.js";import{l as p}from"./chunk-ZEOYNUHL.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as l}from"./chunk-FTQLQJQV.js";var c=e.string().trim().min(1).max(240),o=e.string().trim().min(1).max(5e3),E=e.enum(["no_training","prompting","retrieval","sft","preference","grpo_rft","sdft_opsd","sdpo","agentic_rl"]),C=e.object({id:c,taskIndex:e.number().int().nonnegative(),label:k,output:e.record(e.string(),e.unknown()),infrastructureError:e.string().trim().min(1).max(1e4).nullable(),expectedPassed:e.boolean(),expectedRewardEligible:e.boolean(),metadata:e.record(e.string(),e.unknown()).default({})}),j=e.object({schemaVersion:e.literal("openpond.capabilityDiagnosis.v1"),summary:e.string().trim().min(1).max(1e4),stableBehavior:e.array(o).max(100).default([]),changingKnowledge:e.array(o).max(100).default([]),requiredContext:e.array(o).max(100).default([]),requiredTools:e.array(c).max(100).default([]),intervention:E,trainingEligible:e.boolean(),rationale:e.array(o).min(1).max(100),confidence:e.number().min(0).max(1)}),F=e.object({id:c,sourceId:c,sourceTurnId:c.nullable(),split:h,origin:e.enum(["extracted","corrected","synthetic","expert_authored"]),inputPrompt:e.string().trim().min(1).max(1e5),expectedOutputText:e.string().trim().min(1).max(2e5).nullable(),rationale:o}),D=e.object({schemaVersion:e.literal("openpond.taskDesignProposal.v1"),id:c,name:e.string().trim().min(1).max(500),objective:e.string().trim().min(1).max(2e4),diagnosis:j.default({schemaVersion:"openpond.capabilityDiagnosis.v1",summary:"Reproduce the selected approved behavior.",stableBehavior:[],changingKnowledge:[],requiredContext:[],requiredTools:[],intervention:"sft",trainingEligible:!0,rationale:["The selected examples were supplied as demonstrations."],confidence:.5}),taskKind:u.shape.taskKind,sourceIds:e.array(c).min(1).max(1e5),assumptions:e.array(o).max(1e3),successCriteria:e.array(o).min(1).max(1e3),proposedGraders:e.array(S).max(1e3).default([]),graderFixtures:e.array(C).max(1e5).default([]),generatedFiles:e.array(g).max(1e3).default([]),proposedExamples:e.array(F).max(1e5).default([]),proposedMethod:v.shape.recommendedMethod,trainingPath:T.nullable().default(null),policy:f,warnings:e.array(e.string().trim().min(1)).default([]),createdAt:e.string().trim().min(1)});var q=e.string().min(1).max(240),_=e.string().regex(/^[a-f0-9]{64}$/),H=e.array(e.object({source:I,excerpts:e.array(e.object({role:e.enum(["user","assistant"]),text:e.string().max(2e5),turnId:q}).strict()).max(200)}).strict()).min(1).max(20),Ht=e.discriminatedUnion("action",[e.object({action:e.literal("messages"),id:q,evidence:H,instruction:e.string().max(2*1024*1024),buildSpecification:P,currentProposal:D.nullable().default(null)}).strict(),e.object({action:e.literal("validate"),evidence:H,content:e.string().max(2*1024*1024)}).strict()]),qt=e.object({messages:e.array(e.object({role:e.enum(["system","user"]),content:e.string()}).strict()).min(1).max(20),skillHash:_}).strict(),_t=e.object({proposal:D,skillHash:_}).strict(),r=n.shape.id,s=e.number().int().positive(),d=e.string().regex(/^[a-f0-9]{64}$/),m={teamId:r,modelId:r},At=e.object({schemaVersion:e.literal("openpond.tasksetDraftCreate.v1"),operationId:r,modelId:r,expectedModelRevision:s,name:n.shape.name}).strict(),Lt=e.object({schemaVersion:e.literal("openpond.tasksetDraftSourceDescriptor.v1"),...m,expectedModelRevision:s,sourcePackageHash:d}).strict(),Ut=e.object({schemaVersion:e.literal("openpond.tasksetDraftReadback.v1"),...m,draft:n,workspaceHash:d,projectEtag:d}).strict().refine(t=>t.draft.profileId===t.teamId&&t.draft.modelScope?.modelId===t.modelId,"The hosted draft must belong to its declared workspace and Model."),A=e.object({id:r,revision:s,name:n.shape.name,status:w,updatedAt:n.shape.updatedAt,sourceTasksetRef:p.nullable()}).strict(),Ot=e.object({schemaVersion:e.literal("openpond.tasksetDraftList.v1"),...m,drafts:e.array(A).max(100),nextCursor:e.string().min(1).max(2e3).nullable()}).strict(),Gt=e.object({expectedDraftRevision:s,draft:n}).strict(),Vt=e.object({expectedDraftRevision:s,expectedModelRevision:s}).strict(),L=e.object({expectedDraftRevision:s,expectedWorkspaceHash:d}).strict(),Bt=e.object({schemaVersion:e.literal("openpond.tasksetDraftValidation.v1"),...m,draftId:r,draftRevision:s,workspaceHash:d,valid:e.boolean(),issues:e.array(e.object({code:e.string().min(1),severity:e.enum(["warning","error"]),message:e.string(),path:e.string().nullable()}).strict()),packageHash:d.nullable(),tasksetRef:p.nullable()}).strict().refine(t=>t.valid?t.packageHash!==null&&t.tasksetRef!==null&&t.issues.every(a=>a.severity!=="error"):t.packageHash===null&&t.tasksetRef===null&&t.issues.some(a=>a.severity==="error"),"Validation must retain either a compiled package or publication errors."),zt=L.extend({operationId:r,expectedPackageHash:d,expectedTasksetRef:p}).strict(),Kt=e.object({schemaVersion:e.literal("openpond.tasksetDraftFileList.v1"),...m,draftId:r,draftRevision:s,files:e.array(R).max(10020)}).strict(),Wt=e.object({schemaVersion:e.literal("openpond.tasksetDraftFileReadback.v1"),...m,draftId:r,draftRevision:s,file:y}).strict(),Nt=e.object({schemaVersion:e.literal("openpond.tasksetDraftDeletion.v1"),...m,draftId:r,revision:s,deleted:e.literal(!0)}).strict(),Xt=n.shape.id,Yt=e.number().int().positive();var i=e.string().trim().min(1).max(500),Zt=e.object({projectId:i.optional(),tasksetId:i.optional(),draftId:i.optional(),taskId:i.optional(),query:e.string().trim().max(1e3).default(""),split:e.enum(["train","validation","test","frozen_eval"]).optional(),after:e.string().min(1).max(2e3).optional(),limit:e.number().int().min(1).max(100).default(30)}).strict(),U=e.object({id:i,method:e.enum(["code","judge","human"]),required:e.boolean()}),O=e.object({tasksetId:i,tasksetName:e.string(),tasksetRevision:e.number().int().positive(),tasksetHash:e.string(),taskId:i,ordinal:e.number().int().nonnegative(),title:e.string(),description:e.string(),split:e.string(),scoring:e.array(U),configuration:e.enum(["configured","needs_reward","needs_checks"]),draftId:i.nullable().default(null),modelId:i.nullable().default(null)}),ea=e.object({items:e.array(O).max(100),nextCursor:e.string().nullable()});function ta(t,a){let $=[t.instruction,t.prompt,t.request,t.question,t.message].find(b=>typeof b=="string"&&b.trim().length>0),M=typeof t.title=="string"?t.title.trim():"",x=$?.trim()??"";return{title:(M||x||a).slice(0,180),description:x.slice(0,2e3)}}l(ta,"describeTaskInput");function aa(t){return t.map(a=>({id:a.id,method:a.kind==="model_judge"?"judge":a.kind==="human"?"human":"code",required:a.hardGate}))}l(aa,"summarizeTaskScoring");function sa(t){return t.some(a=>a.kind!=="human")?t.some(a=>a.kind==="model_judge"&&a.calibrationStatus!=="passed")?"needs_checks":"configured":"needs_reward"}l(sa,"taskConfiguration");export{E as a,D as b,Ht as c,Zt as d,O as e,ea as f,ta as g,aa as h,sa as i};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{wa as n}from"./chunk-BU6MW65V.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-BYVE4TMU.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{a as b,c as p,d as S,e as _,f as O,g as x}from"./chunk-PNPV2LDE.js";import{Ab as y,Cb as f,Db as w,Eb as c,Fb as R,Gb as q,M as m,mb as g,wb as L}from"./chunk-4PUOWSDE.js";import{v as h}from"./chunk-ZY32SZ2P.js";import{a}from"./chunk-TBODQT4W.js";import{A as i}from"./chunk-X2J2P5ZT.js";import{a as l}from"./chunk-FTQLQJQV.js";var C=i.object({batchId:i.string().trim().min(1).max(500),modelProjectId:i.string().trim().min(1).max(500)}).strict(),k=i.object({batchId:i.string().min(1),projectId:i.string().min(1),tasksetId:i.string().min(1),releaseId:i.string().min(1),revision:i.number().int().positive(),contentHash:i.string().regex(/^[a-f0-9]{64}$/)}).strict(),P=class{static{l(this,"OpenPondLearningClient")}#e;constructor(e){if(!e.apiKey.trim()||!e.scope.trim())throw new Error("Learning API key and scope are required.");let t=new URL(e.baseUrl);if(!["http:","https:"].includes(t.protocol)||t.username||t.password||t.search||t.hash)throw new Error("Learning base URL must be an HTTP(S) endpoint without credentials, query, or fragment.");this.#e={...e,baseUrl:t.toString().replace(/\/+$/,"")}}async command(e,t={}){f(e);let s=w.parse({scope:this.#e.scope,command:e}),n=q.parse(await this.#t("commands",s,t));if(n.operationId!==e.operationId)throw new a(502,"operation_identity_mismatch","Learning response did not match the submitted operation.",null);return n}submitExample(e,t={}){return this.command({action:"submit_example",operationId:e.idempotencyKey,example:e},t)}submitFeedback(e,t={}){return this.command({action:"submit_feedback",operationId:e.idempotencyKey,feedback:e},t)}async get(e,t,s,n={}){let r=c.parse({action:"get",scope:this.#e.scope,kind:e,id:t,...s===void 0?{}:{revision:s}});return g[e].parse(await this.#t("read",r,n))}async inspectEvidence(e,t={}){let s=c.parse({action:"inspect_evidence",scope:this.#e.scope,evidence:e}),n=R.parse(await this.#t("read",s,t));if(!m(n.evidence,e))throw new a(502,"evidence_identity_mismatch","Inspection did not match the requested evidence release.",null);return n}async inspectTaskQueue(e=null,t={}){let s=c.parse({action:"inspect_task_queue",scope:this.#e.scope,modelProjectId:e}),n=y.parse(await this.#t("read",s,t));if(n.modelProjectId!==e)throw new a(502,"model_identity_mismatch","Task queue did not match the requested Model.",null);return n}async inspectPolicy(e,t={}){let s=c.parse({action:"inspect_policy",scope:this.#e.scope,policy:e}),n=L.parse(await this.#t("read",s,t));if(!m(n.policy,e))throw new a(502,"policy_identity_mismatch","Inspection did not match the requested policy release.",null);return n}async createSourceCredential(e,t={}){let s=p.parse({...e,action:"create",scope:this.#e.scope}),n=S.parse(await this.#t("credentials",s,t));if(this.#n(n.credential,e.sourceId),n.apiKey!==e.apiKey||!e.apiKey.startsWith(`${n.credential.keyPrefix}_`))throw new a(502,"credential_identity_mismatch","Credential response did not match the prepared credential.",null);return n}async listSourceCredentials(e,t={},s={}){let n=p.parse({...t,action:"list",scope:this.#e.scope,sourceId:e}),r=_.parse(await this.#t("credentials",n,s));if(r.items.length>(t.limit??30))throw new a(502,"credential_page_invalid","Credential response exceeded the requested page size.",null);for(let o of r.items)this.#n(o,e);return r}async revokeSourceCredential(e,t,s={}){let n=p.parse({action:"revoke",scope:this.#e.scope,sourceId:e,id:t}),r=b.parse(await this.#t("credentials",n,s));if(this.#n(r,e),r.id!==t||r.revokedAt===null)throw new a(502,"credential_revocation_mismatch","Credential revocation did not match the requested credential.",null);return r}async sourceConfiguration(e,t={}){let s=O.parse({scope:this.#e.scope,sourceId:e}),n=x.parse(await this.#t("source-config",s,t));if(n.scope!==this.#e.scope||n.source.id!==e)throw new a(502,"source_identity_mismatch","Source configuration did not match the requested source.",null);return n}#n(e,t){if(e.scope!==this.#e.scope||e.sourceId!==t)throw new a(502,"credential_scope_mismatch","Credential response did not match the requested source.",null)}async list(e,t={},s={}){let n=c.parse({action:"list",scope:this.#e.scope,kind:e,...t});return i.object({items:i.array(g[e]).max(100),nextCursor:i.string().nullable()}).strict().parse(await this.#t("read",n,s))}async publishBatch(e,t={}){let s=C.parse(e),n=k.parse(await this.#t("publish-batch",{...s,scope:this.#e.scope},t));if(n.batchId!==s.batchId)throw new a(502,"batch_identity_mismatch","Published batch response did not match the requested batch.",null);return n}async#t(e,t,s){h(t,16777216);let n=await(this.#e.fetch??globalThis.fetch)(`${this.#e.baseUrl}/v1/learning/${e}`,{method:"POST",headers:{Authorization:`Bearer ${this.#e.apiKey}`,"Content-Type":"application/json",Accept:"application/json","X-OpenPond-Team-Id":this.#e.scope},body:JSON.stringify(t),signal:s.signal,redirect:"error"}),r=await I(n);if(!n.ok){let o=i.object({code:i.string().optional(),error:i.string().optional()}).passthrough().safeParse(r);throw new a(n.status,o.success?o.data.code??"learning_request_failed":"learning_request_failed",o.success?o.data.error??`Learning request failed (${n.status}).`:`Learning request failed (${n.status}).`,r)}return r}};async function I(u){let t=u.body?.getReader();if(!t)throw new a(u.status,"empty_response","Learning response was empty.",null);let s=new TextDecoder,n=0,r="";try{for(;;){let d=await t.read();if(d.done)break;if(n+=d.value.byteLength,n>16777216)throw new a(u.status,"response_too_large","Learning response exceeded 16 MiB; request a smaller page.",null);r+=s.decode(d.value,{stream:!0})}r+=s.decode();let o=JSON.parse(r);return h(o,16777216),o}finally{await t.cancel(),t.releaseLock()}}l(I,"readBoundedLearningResponse");export{C as a,P as b,I as c};
2
+ import{a as b,c as p,d as S,e as _,f as O,g as x}from"./chunk-BZS2PA4O.js";import{Ab as y,Cb as f,Db as w,Eb as c,Fb as R,Gb as q,M as m,mb as g,wb as L}from"./chunk-ZEOYNUHL.js";import{v as h}from"./chunk-ZY32SZ2P.js";import{a}from"./chunk-TBODQT4W.js";import{A as i}from"./chunk-X2J2P5ZT.js";import{a as l}from"./chunk-FTQLQJQV.js";var C=i.object({batchId:i.string().trim().min(1).max(500),modelProjectId:i.string().trim().min(1).max(500)}).strict(),k=i.object({batchId:i.string().min(1),projectId:i.string().min(1),tasksetId:i.string().min(1),releaseId:i.string().min(1),revision:i.number().int().positive(),contentHash:i.string().regex(/^[a-f0-9]{64}$/)}).strict(),P=class{static{l(this,"OpenPondLearningClient")}#e;constructor(e){if(!e.apiKey.trim()||!e.scope.trim())throw new Error("Learning API key and scope are required.");let t=new URL(e.baseUrl);if(!["http:","https:"].includes(t.protocol)||t.username||t.password||t.search||t.hash)throw new Error("Learning base URL must be an HTTP(S) endpoint without credentials, query, or fragment.");this.#e={...e,baseUrl:t.toString().replace(/\/+$/,"")}}async command(e,t={}){f(e);let s=w.parse({scope:this.#e.scope,command:e}),n=q.parse(await this.#t("commands",s,t));if(n.operationId!==e.operationId)throw new a(502,"operation_identity_mismatch","Learning response did not match the submitted operation.",null);return n}submitExample(e,t={}){return this.command({action:"submit_example",operationId:e.idempotencyKey,example:e},t)}submitFeedback(e,t={}){return this.command({action:"submit_feedback",operationId:e.idempotencyKey,feedback:e},t)}async get(e,t,s,n={}){let r=c.parse({action:"get",scope:this.#e.scope,kind:e,id:t,...s===void 0?{}:{revision:s}});return g[e].parse(await this.#t("read",r,n))}async inspectEvidence(e,t={}){let s=c.parse({action:"inspect_evidence",scope:this.#e.scope,evidence:e}),n=R.parse(await this.#t("read",s,t));if(!m(n.evidence,e))throw new a(502,"evidence_identity_mismatch","Inspection did not match the requested evidence release.",null);return n}async inspectTaskQueue(e=null,t={}){let s=c.parse({action:"inspect_task_queue",scope:this.#e.scope,modelProjectId:e}),n=y.parse(await this.#t("read",s,t));if(n.modelProjectId!==e)throw new a(502,"model_identity_mismatch","Task queue did not match the requested Model.",null);return n}async inspectPolicy(e,t={}){let s=c.parse({action:"inspect_policy",scope:this.#e.scope,policy:e}),n=L.parse(await this.#t("read",s,t));if(!m(n.policy,e))throw new a(502,"policy_identity_mismatch","Inspection did not match the requested policy release.",null);return n}async createSourceCredential(e,t={}){let s=p.parse({...e,action:"create",scope:this.#e.scope}),n=S.parse(await this.#t("credentials",s,t));if(this.#n(n.credential,e.sourceId),n.apiKey!==e.apiKey||!e.apiKey.startsWith(`${n.credential.keyPrefix}_`))throw new a(502,"credential_identity_mismatch","Credential response did not match the prepared credential.",null);return n}async listSourceCredentials(e,t={},s={}){let n=p.parse({...t,action:"list",scope:this.#e.scope,sourceId:e}),r=_.parse(await this.#t("credentials",n,s));if(r.items.length>(t.limit??30))throw new a(502,"credential_page_invalid","Credential response exceeded the requested page size.",null);for(let o of r.items)this.#n(o,e);return r}async revokeSourceCredential(e,t,s={}){let n=p.parse({action:"revoke",scope:this.#e.scope,sourceId:e,id:t}),r=b.parse(await this.#t("credentials",n,s));if(this.#n(r,e),r.id!==t||r.revokedAt===null)throw new a(502,"credential_revocation_mismatch","Credential revocation did not match the requested credential.",null);return r}async sourceConfiguration(e,t={}){let s=O.parse({scope:this.#e.scope,sourceId:e}),n=x.parse(await this.#t("source-config",s,t));if(n.scope!==this.#e.scope||n.source.id!==e)throw new a(502,"source_identity_mismatch","Source configuration did not match the requested source.",null);return n}#n(e,t){if(e.scope!==this.#e.scope||e.sourceId!==t)throw new a(502,"credential_scope_mismatch","Credential response did not match the requested source.",null)}async list(e,t={},s={}){let n=c.parse({action:"list",scope:this.#e.scope,kind:e,...t});return i.object({items:i.array(g[e]).max(100),nextCursor:i.string().nullable()}).strict().parse(await this.#t("read",n,s))}async publishBatch(e,t={}){let s=C.parse(e),n=k.parse(await this.#t("publish-batch",{...s,scope:this.#e.scope},t));if(n.batchId!==s.batchId)throw new a(502,"batch_identity_mismatch","Published batch response did not match the requested batch.",null);return n}async#t(e,t,s){h(t,16777216);let n=await(this.#e.fetch??globalThis.fetch)(`${this.#e.baseUrl}/v1/learning/${e}`,{method:"POST",headers:{Authorization:`Bearer ${this.#e.apiKey}`,"Content-Type":"application/json",Accept:"application/json","X-OpenPond-Team-Id":this.#e.scope},body:JSON.stringify(t),signal:s.signal,redirect:"error"}),r=await I(n);if(!n.ok){let o=i.object({code:i.string().optional(),error:i.string().optional()}).passthrough().safeParse(r);throw new a(n.status,o.success?o.data.code??"learning_request_failed":"learning_request_failed",o.success?o.data.error??`Learning request failed (${n.status}).`:`Learning request failed (${n.status}).`,r)}return r}};async function I(u){let t=u.body?.getReader();if(!t)throw new a(u.status,"empty_response","Learning response was empty.",null);let s=new TextDecoder,n=0,r="";try{for(;;){let d=await t.read();if(d.done)break;if(n+=d.value.byteLength,n>16777216)throw new a(u.status,"response_too_large","Learning response exceeded 16 MiB; request a smaller page.",null);r+=s.decode(d.value,{stream:!0})}r+=s.decode();let o=JSON.parse(r);return h(o,16777216),o}finally{await t.cancel(),t.releaseLock()}}l(I,"readBoundedLearningResponse");export{C as a,P as b,I as c};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{b as f}from"./chunk-ZYLLPRPU.js";import{Z as c}from"./chunk-6I5AUTVO.js";import{C as w,D as I,z as g}from"./chunk-HG2YFMVU.js";import{b as m}from"./chunk-FYWQWKVS.js";import{f as R}from"./chunk-ZY32SZ2P.js";import{A as r}from"./chunk-X2J2P5ZT.js";import{a as d}from"./chunk-FTQLQJQV.js";import n from"node:path";import{readFile as y}from"node:fs/promises";var A=r.object({profileId:r.string().min(1),sourceRevision:r.string().min(1),repositoryId:r.string().min(1),harnessRelease:r.object({id:r.string().min(1),contentHash:r.string().regex(/^[a-f0-9]{64}$/)}).strict(),hostExecution:r.object({conversationId:r.string().min(1),turnId:r.string().min(1)}).strict().optional(),workspaceId:r.string().min(1),assetsPath:r.string().min(1).refine(n.isAbsolute)}).strict();async function _(p,e){let t=A.parse(e),s=await f(p,t.harnessRelease);if(!s||n.resolve(s.release.bundlePath)!==n.resolve(t.assetsPath))throw new Error("Hosted Profile release changed after admission.");let o=s.release.harnessRelease.metadata.profile;if(!o||typeof o!="object"||o.id!==t.profileId||o.sourceRevision!==t.sourceRevision||o.repositoryId!==void 0&&o.repositoryId!==t.repositoryId)throw new Error("Hosted Profile provenance differs from admitted release.");return{profile:I(),profileLibrary:w()}}d(_,"loadHostedProfileStateAndLibrary");async function B(p,e){let t=A.parse(e),s=await f(p,t.harnessRelease);if(!s||n.resolve(s.release.bundlePath)!==n.resolve(t.assetsPath))throw new Error("Hosted Profile workflow release is unavailable.");let o=s.release.harnessRelease.metadata.profile;if(o?.id!==t.profileId||o.sourceRevision!==t.sourceRevision||o.repositoryId!==void 0&&o.repositoryId!==t.repositoryId)throw new Error("Hosted Profile workflow provenance changed.");let a=t.harnessRelease,l={source:"openpond_git",repositoryId:t.repositoryId,profileId:t.profileId};if(!s.release.harnessRelease.files.some(u=>u.path==="workflows/catalog.json"))return{profileRef:l,sourceRevision:t.sourceRevision,harnessRelease:a,workflows:[]};let i=n.join(s.release.bundlePath,"source","workflows"),v=R({agentSnapshot:s.release.agentSnapshot,harnessRelease:s.release.harnessRelease,catalogBytes:await y(n.join(i,"catalog.json")),actionBytes:await y(n.join(i,"actions.json"))});return{profileRef:l,sourceRevision:t.sourceRevision,harnessRelease:a,workflows:v.catalog.workflows.map(u=>({workflow:u,binding:{schemaVersion:"openpond.profileWorkflowBinding.v1",profileId:t.profileId,sourceRevision:t.sourceRevision,harnessRelease:a,catalogHash:v.catalogHash,workflowId:u.id}}))}}d(B,"listHostedProfileWorkflows");import{createHash as U,randomUUID as h}from"node:crypto";var b=r.object({approval:g,revision:r.number().int().positive()}).strict(),P=r.object({record:m}).strict(),x=r.object({startedAt:r.string().min(1),requestOrdinal:r.number().int().nonnegative(),id:r.string().min(1)}).strict(),k=r.object({records:r.array(m).max(200),nextBefore:x.nullable()}).strict(),H=1e4,S=class{constructor(e){this.client=e}client;static{d(this,"HostedApprovalStorage")}async readApproval(e){let t=await this.client.request({contractVersion:c,requestId:h(),operation:"approval/get",params:{approvalId:e}});return t===null?null:b.parse(t)}async getApproval(e){return(await this.readApproval(e))?.approval??null}async putApproval(e){let t=g.parse(e.approval);if(!e.requestId.trim())throw new Error("Approval mutation requires a stable request ID.");return b.parse(await this.client.request({contractVersion:c,requestId:e.requestId,operation:"approval/upsert",params:{approval:t,expectedRevision:e.expectedRevision}}))}},M=class{constructor(e){this.client=e}client;static{d(this,"HostedModelUsageStorage")}async upsertModelUsageRecord(e){let t=m.parse(e),s=U("sha256").update(JSON.stringify(t)).digest("hex"),o=await this.client.request({contractVersion:c,requestId:`usage:${s}`,operation:"usage/upsert",params:{record:t}}),a=P.parse(o).record;if(a.requestId!==t.requestId)throw new Error("Host usage upsert changed request identity.");return a}async getModelUsageRecordByRequestId(e){let t=await this.client.request({contractVersion:c,requestId:h(),operation:"usage/getByRequestId",params:{requestId:e}});return t===null?null:P.parse(t).record}async listModelUsageRecords(e={}){let t=e.limit===void 0||e.limit>=H,s=e.limit===void 0?H:Math.max(1,Math.min(1e4,Math.trunc(e.limit))),o={...e.sessionId?{sessionId:e.sessionId}:{},...e.turnId?{turnId:e.turnId}:{},...e.provider?{provider:e.provider}:{},...e.model?{model:e.model}:{},...e.startedAtFrom?{startedAtFrom:e.startedAtFrom}:{},...e.startedAtTo?{startedAtTo:e.startedAtTo}:{},...e.visibility&&e.visibility!=="all"?{visibility:e.visibility}:{},...e.status&&e.status!=="all"?{status:e.status}:{}},a=[],l=null;for(;a.length<s+(t?1:0);){let i=k.parse(await this.client.request({contractVersion:c,requestId:h(),operation:"usage/page",params:{query:o,before:l,limit:Math.min(200,s+(t?1:0)-a.length)}}));if(a.push(...i.records),a.length>s)throw new Error(`Hosted usage query exceeds ${s} rows; narrow its filters or use a streamed aggregation.`);if(i.nextBefore===null)break;if(i.records.length===0||JSON.stringify(i.nextBefore)===JSON.stringify(l))throw new Error("Host usage cursor did not advance.");l=i.nextBefore}return a}async listModelUsageRecordsComplete(e={}){return this.listModelUsageRecords(e)}};export{A as a,_ as b,B as c,S as d,M as e};
2
+ import{b as f}from"./chunk-CX4T7I47.js";import{Z as c}from"./chunk-6I5AUTVO.js";import{C as w,D as I,z as g}from"./chunk-WXG3G2O6.js";import{b as m}from"./chunk-FYWQWKVS.js";import{f as R}from"./chunk-ZY32SZ2P.js";import{A as r}from"./chunk-X2J2P5ZT.js";import{a as d}from"./chunk-FTQLQJQV.js";import n from"node:path";import{readFile as y}from"node:fs/promises";var A=r.object({profileId:r.string().min(1),sourceRevision:r.string().min(1),repositoryId:r.string().min(1),harnessRelease:r.object({id:r.string().min(1),contentHash:r.string().regex(/^[a-f0-9]{64}$/)}).strict(),hostExecution:r.object({conversationId:r.string().min(1),turnId:r.string().min(1)}).strict().optional(),workspaceId:r.string().min(1),assetsPath:r.string().min(1).refine(n.isAbsolute)}).strict();async function _(p,e){let t=A.parse(e),s=await f(p,t.harnessRelease);if(!s||n.resolve(s.release.bundlePath)!==n.resolve(t.assetsPath))throw new Error("Hosted Profile release changed after admission.");let o=s.release.harnessRelease.metadata.profile;if(!o||typeof o!="object"||o.id!==t.profileId||o.sourceRevision!==t.sourceRevision||o.repositoryId!==void 0&&o.repositoryId!==t.repositoryId)throw new Error("Hosted Profile provenance differs from admitted release.");return{profile:I(),profileLibrary:w()}}d(_,"loadHostedProfileStateAndLibrary");async function B(p,e){let t=A.parse(e),s=await f(p,t.harnessRelease);if(!s||n.resolve(s.release.bundlePath)!==n.resolve(t.assetsPath))throw new Error("Hosted Profile workflow release is unavailable.");let o=s.release.harnessRelease.metadata.profile;if(o?.id!==t.profileId||o.sourceRevision!==t.sourceRevision||o.repositoryId!==void 0&&o.repositoryId!==t.repositoryId)throw new Error("Hosted Profile workflow provenance changed.");let a=t.harnessRelease,l={source:"openpond_git",repositoryId:t.repositoryId,profileId:t.profileId};if(!s.release.harnessRelease.files.some(u=>u.path==="workflows/catalog.json"))return{profileRef:l,sourceRevision:t.sourceRevision,harnessRelease:a,workflows:[]};let i=n.join(s.release.bundlePath,"source","workflows"),v=R({agentSnapshot:s.release.agentSnapshot,harnessRelease:s.release.harnessRelease,catalogBytes:await y(n.join(i,"catalog.json")),actionBytes:await y(n.join(i,"actions.json"))});return{profileRef:l,sourceRevision:t.sourceRevision,harnessRelease:a,workflows:v.catalog.workflows.map(u=>({workflow:u,binding:{schemaVersion:"openpond.profileWorkflowBinding.v1",profileId:t.profileId,sourceRevision:t.sourceRevision,harnessRelease:a,catalogHash:v.catalogHash,workflowId:u.id}}))}}d(B,"listHostedProfileWorkflows");import{createHash as U,randomUUID as h}from"node:crypto";var b=r.object({approval:g,revision:r.number().int().positive()}).strict(),P=r.object({record:m}).strict(),x=r.object({startedAt:r.string().min(1),requestOrdinal:r.number().int().nonnegative(),id:r.string().min(1)}).strict(),k=r.object({records:r.array(m).max(200),nextBefore:x.nullable()}).strict(),H=1e4,S=class{constructor(e){this.client=e}client;static{d(this,"HostedApprovalStorage")}async readApproval(e){let t=await this.client.request({contractVersion:c,requestId:h(),operation:"approval/get",params:{approvalId:e}});return t===null?null:b.parse(t)}async getApproval(e){return(await this.readApproval(e))?.approval??null}async putApproval(e){let t=g.parse(e.approval);if(!e.requestId.trim())throw new Error("Approval mutation requires a stable request ID.");return b.parse(await this.client.request({contractVersion:c,requestId:e.requestId,operation:"approval/upsert",params:{approval:t,expectedRevision:e.expectedRevision}}))}},M=class{constructor(e){this.client=e}client;static{d(this,"HostedModelUsageStorage")}async upsertModelUsageRecord(e){let t=m.parse(e),s=U("sha256").update(JSON.stringify(t)).digest("hex"),o=await this.client.request({contractVersion:c,requestId:`usage:${s}`,operation:"usage/upsert",params:{record:t}}),a=P.parse(o).record;if(a.requestId!==t.requestId)throw new Error("Host usage upsert changed request identity.");return a}async getModelUsageRecordByRequestId(e){let t=await this.client.request({contractVersion:c,requestId:h(),operation:"usage/getByRequestId",params:{requestId:e}});return t===null?null:P.parse(t).record}async listModelUsageRecords(e={}){let t=e.limit===void 0||e.limit>=H,s=e.limit===void 0?H:Math.max(1,Math.min(1e4,Math.trunc(e.limit))),o={...e.sessionId?{sessionId:e.sessionId}:{},...e.turnId?{turnId:e.turnId}:{},...e.provider?{provider:e.provider}:{},...e.model?{model:e.model}:{},...e.startedAtFrom?{startedAtFrom:e.startedAtFrom}:{},...e.startedAtTo?{startedAtTo:e.startedAtTo}:{},...e.visibility&&e.visibility!=="all"?{visibility:e.visibility}:{},...e.status&&e.status!=="all"?{status:e.status}:{}},a=[],l=null;for(;a.length<s+(t?1:0);){let i=k.parse(await this.client.request({contractVersion:c,requestId:h(),operation:"usage/page",params:{query:o,before:l,limit:Math.min(200,s+(t?1:0)-a.length)}}));if(a.push(...i.records),a.length>s)throw new Error(`Hosted usage query exceeds ${s} rows; narrow its filters or use a streamed aggregation.`);if(i.nextBefore===null)break;if(i.records.length===0||JSON.stringify(i.nextBefore)===JSON.stringify(l))throw new Error("Host usage cursor did not advance.");l=i.nextBefore}return a}async listModelUsageRecordsComplete(e={}){return this.listModelUsageRecords(e)}};export{A as a,_ as b,B as c,S as d,M as e};
@@ -1,4 +1,4 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{h as a}from"./chunk-RCQYEHHD.js";import{Xb as d,_b as p}from"./chunk-HG2YFMVU.js";import{a as o}from"./chunk-FTQLQJQV.js";function g(n,e,t,i){let s=n.get(`SELECT payload,package_payload FROM local_experiment_definitions WHERE team_id=? AND id=? ${i===void 0?"ORDER BY revision DESC LIMIT 1":"AND revision=?"}`,i===void 0?[e,t]:[e,t,i]);if(!s)throw new a("local_definition_not_found","Local Experiment definition is unavailable in this workspace.",404);return{definition:d.parse(JSON.parse(s.payload)),package:JSON.parse(s.package_payload)}}o(g,"localDefinition");function _(n,e,t){let i=n.get("SELECT payload FROM local_experiment_executions WHERE team_id=? AND id=?",[e,t]);if(!i)throw new a("local_execution_not_found","Local Experiment execution is unavailable in this workspace.",404);return p.parse(JSON.parse(i.payload))}o(_,"localExecution");function f(n,e,t){return n.all("SELECT receipt_id,status,admission,result,error FROM local_experiment_cases WHERE team_id=? AND execution_id=? ORDER BY ordinal",[e,t]).map(i=>({receiptId:i.receipt_id,status:i.status,admission:JSON.parse(i.admission),result:i.result?JSON.parse(i.result):null,error:i.error}))}o(f,"localCases");function L(n,e,t,i={}){let s=_(n,e,t),c={pending:0,running:0,completed:0,failed:0,cancelled:0,unknown:0};for(let u of n.all("SELECT status,COUNT(*) AS count FROM local_experiment_cases WHERE team_id=? AND execution_id=? GROUP BY status",[e,t]))c[u.status]=u.count;let r=n.get(`SELECT COALESCE(SUM(CASE WHEN status='settled' THEN cost_usd ELSE 0 END),0) AS spent,
2
+ import{h as a}from"./chunk-O5ZOW474.js";import{Xb as d,_b as p}from"./chunk-WXG3G2O6.js";import{a as o}from"./chunk-FTQLQJQV.js";function g(n,e,t,i){let s=n.get(`SELECT payload,package_payload FROM local_experiment_definitions WHERE team_id=? AND id=? ${i===void 0?"ORDER BY revision DESC LIMIT 1":"AND revision=?"}`,i===void 0?[e,t]:[e,t,i]);if(!s)throw new a("local_definition_not_found","Local Experiment definition is unavailable in this workspace.",404);return{definition:d.parse(JSON.parse(s.payload)),package:JSON.parse(s.package_payload)}}o(g,"localDefinition");function _(n,e,t){let i=n.get("SELECT payload FROM local_experiment_executions WHERE team_id=? AND id=?",[e,t]);if(!i)throw new a("local_execution_not_found","Local Experiment execution is unavailable in this workspace.",404);return p.parse(JSON.parse(i.payload))}o(_,"localExecution");function f(n,e,t){return n.all("SELECT receipt_id,status,admission,result,error FROM local_experiment_cases WHERE team_id=? AND execution_id=? ORDER BY ordinal",[e,t]).map(i=>({receiptId:i.receipt_id,status:i.status,admission:JSON.parse(i.admission),result:i.result?JSON.parse(i.result):null,error:i.error}))}o(f,"localCases");function L(n,e,t,i={}){let s=_(n,e,t),c={pending:0,running:0,completed:0,failed:0,cancelled:0,unknown:0};for(let u of n.all("SELECT status,COUNT(*) AS count FROM local_experiment_cases WHERE team_id=? AND execution_id=? GROUP BY status",[e,t]))c[u.status]=u.count;let r=n.get(`SELECT COALESCE(SUM(CASE WHEN status='settled' THEN cost_usd ELSE 0 END),0) AS spent,
3
3
  COALESCE(SUM(CASE WHEN status IN ('reserved','dispatched','unknown') THEN maximum_usd ELSE 0 END),0) AS held,
4
4
  COALESCE(SUM(CASE WHEN status IN ('dispatched','unknown') THEN 1 ELSE 0 END),0) AS uncertain FROM local_experiment_charges WHERE team_id=? AND execution_id=?`,[e,t]),l=p.parse({...s,...i,counts:c,usage:{knownCostUsd:r.spent,costUsd:r.uncertain?null:r.spent,heldUsd:r.held,uncertainRequests:r.uncertain}});return n.run("UPDATE local_experiment_executions SET payload=? WHERE team_id=? AND id=?",[JSON.stringify(l),e,t]),l}o(L,"refreshLocalExecution");function O(n,e,t,i,s,c){let r=n.get("SELECT kind,intent_hash,receipt FROM local_experiment_operations WHERE team_id=? AND operation_id=?",[e,t]);if(r){if(r.kind!==i||r.intent_hash!==s)throw new a("local_operation_conflict","This operation already owns different immutable inputs.");return JSON.parse(r.receipt)}let l=c();return n.run("INSERT INTO local_experiment_operations(team_id,operation_id,kind,intent_hash,receipt) VALUES(?,?,?,?,?)",[e,t,i,s,JSON.stringify(l)]),l}o(O,"localOperation");function w(n,e,t){n.run("INSERT INTO local_experiment_definitions(team_id,id,revision,content_hash,project_id,payload,package_payload) VALUES(?,?,?,?,?,?,?)",[e.teamId,e.id,e.revision,e.contentHash,e.configuration.request.project?.id??null,JSON.stringify(e),JSON.stringify(t)])}o(w,"writeLocalDefinition");var E=15e3;function T(n,e,t){let i=n.get("SELECT owner_id,pid,lease_until FROM local_experiment_owner WHERE singleton=1");if(i&&i.owner_id!==e&&S(i.pid))throw new a("local_runtime_already_owned","Another live local server owns Experiment execution in this installation.");n.run("INSERT INTO local_experiment_owner(singleton,owner_id,pid,lease_until) VALUES(1,?,?,?) ON CONFLICT(singleton) DO UPDATE SET owner_id=excluded.owner_id,pid=excluded.pid,lease_until=excluded.lease_until",[e,t,Date.now()+E])}o(T,"claimLocalExperimentOwner");function m(n,e){let t=n.get("SELECT owner_id,pid FROM local_experiment_owner WHERE singleton=1");if(!t||t.owner_id!==e||t.pid!==process.pid)throw new a("local_runtime_lease_lost","This process no longer owns local Experiment execution.")}o(m,"requireLocalRuntimeOwner");function R(n,e){m(n,e),n.run("UPDATE local_experiment_owner SET lease_until=? WHERE singleton=1 AND owner_id=?",[Date.now()+E,e])}o(R,"renewLocalExperimentOwner");function S(n){if(!Number.isSafeInteger(n)||n<=0)return!0;try{return process.kill(n,0),!0}catch(e){return!(e instanceof Error&&"code"in e&&e.code==="ESRCH")}}o(S,"alive");export{g as a,_ as b,f as c,L as d,O as e,w as f,T as g,m as h,R as i};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{b as oe}from"./chunk-UGFSAG4U.js";import{b as be}from"./chunk-SSHE6B7Z.js";import{f as J}from"./chunk-WD4KAKEX.js";import{m as L}from"./chunk-HIQPGYVH.js";import{o as ye}from"./chunk-DXJC3QW7.js";import{l as W}from"./chunk-4PUOWSDE.js";import{v as B}from"./chunk-ZY32SZ2P.js";import{I as Ee,K as Te}from"./chunk-SV7ZBEK2.js";import{c as M,d as z,e as Ie,n as y}from"./chunk-RCT3O3HQ.js";import{f as ve}from"./chunk-UGOK7VTC.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as u}from"./chunk-FTQLQJQV.js";var c=Object.freeze({eventBytes:65536,actionBytes:16384,resultBytes:8192,stateBytes:8192,eventsPerAppend:32,eventsPerEpisode:256,episodeBytes:2097152,assetBytes:1048576,assetsPerEpisode:16,queueBytes:52428800,queueEvents:5e3,queueAgeSeconds:86400,capabilities:32,consultationRounds:3,consultationBytes:65536,manifestSeconds:300}),s=M,g=z,w=Ie,K=e.enum(["codex","claude_code","opencode","openpond"]),h=e.object({id:M,contentHash:z}).strict(),C=e.object({teamId:M,projectId:M}).strict();function T(n,t){return e.preprocess((o,i)=>{try{B(o,t)}catch{return i.addIssue({code:"custom",message:"Tool learning data exceeds its JSON boundary."}),e.NEVER}return o},n)}u(T,"boundedToolLearningSchema");function x(n){return e.string().max(n).refine(t=>new TextEncoder().encode(t).byteLength<=n,"Tool learning text exceeds its UTF-8 byte limit.")}u(x,"toolLearningText");var ze=T(e.record(e.string().min(1).max(120),e.union([x(2e3),e.number().finite(),e.boolean(),e.null()])).refine(n=>Object.keys(n).length<=32,"Use at most 32 explicit state fields."),c.stateBytes),j=e.object({application:e.string().trim().min(1).max(200),version:e.string().trim().min(1).max(200),state:ze,fingerprint:z}).strict(),Y=e.object({id:M,contentHash:z,mediaType:e.enum(["text/plain","application/json","text/x-python","text/x-diff"]),sizeBytes:e.number().int().nonnegative().max(c.assetBytes),purpose:e.enum(["action","result","state","verification"])}).strict(),Le=e.object({policyRevision:e.number().int().positive(),policyHash:z,redactedFields:e.number().int().nonnegative().max(1e4),omittedFields:e.number().int().nonnegative().max(1e4),truncated:e.boolean()}).strict();function E(n,t=c.eventBytes){return B(n,t),y(n)}u(E,"toolLearningContentHash");var Q=x(c.actionBytes),xe=e.string().min(1).max(1e3).refine(n=>!n.startsWith("/")&&!n.includes("\\")&&!/^[A-Za-z]:/u.test(n)&&n.split("/").every(t=>t!==""&&t!=="."&&t!==".."),"Use a workspace-relative artifact path."),P=T(e.discriminatedUnion("kind",[e.object({kind:e.literal("python"),code:Q}).strict(),e.object({kind:e.literal("shell"),command:Q,shell:e.string().min(1).max(120)}).strict(),e.object({kind:e.literal("tool_arguments"),arguments:e.record(e.string().min(1).max(200),e.json())}).strict(),e.object({kind:e.literal("edit"),patch:Q,baseFiles:e.array(e.object({path:xe,contentHash:g.nullable()}).strict()).min(1).max(32)}).strict()]),c.actionBytes),yt=e.discriminatedUnion("kind",[e.object({kind:e.literal("replacement"),expectedActionHash:g,environmentFingerprint:g,action:P}).strict(),e.object({kind:e.literal("patch"),expectedActionHash:g,environmentFingerprint:g,files:e.array(e.object({path:xe,expectedContentHash:g,patch:Q}).strict()).min(1).max(16)}).strict()]);var Ve=e.object({intent:x(2e3),tool:e.object({name:e.string().min(1).max(200),version:e.string().max(200).nullable(),server:e.string().max(200).nullable()}).strict(),action:P,actionHash:g,environment:j,contextAssets:e.array(Y).max(c.assetsPerEpisode),selection:e.discriminatedUnion("kind",[e.object({kind:e.literal("eligible_attempt")}).strict(),e.object({kind:e.literal("unchanged_control"),numerator:e.number().int().positive(),denominator:e.number().int().positive(),policyHash:g}).strict()])}).strict().superRefine((n,t)=>{E(n.action)!==n.actionHash&&t.addIssue({code:"custom",path:["actionHash"],message:"Action bytes differ from their hash."}),n.selection.kind==="unchanged_control"&&n.selection.numerator>n.selection.denominator&&t.addIssue({code:"custom",path:["selection"],message:"Sampling probability cannot exceed one."})}),Ke=e.enum(["validation_failure","execution_failure","process_failure","timeout","cancelled","infrastructure_failure","authorization_denied","outcome_failure","unknown_failure"]),ie={attempt:h,actionHash:g,execution:e.enum(["not_executed","executed","unknown"]),sideEffects:e.enum(["none","possible","observed","unknown"]),resultExcerpt:x(c.resultBytes),resultHash:g.nullable(),assets:e.array(Y).max(c.assetsPerEpisode)},$e=e.discriminatedUnion("outcome",[e.object({...ie,outcome:e.literal("succeeded"),exitCode:e.literal(0).nullable()}).strict(),e.object({...ie,outcome:e.literal("failed"),classification:Ke,errorCode:e.string().min(1).max(200),message:x(2e3),exitCode:e.number().int().min(-255).max(255).nullable()}).strict(),e.object({...ie,outcome:e.literal("incomplete"),reason:e.enum(["completion_not_observed","observer_restarted","transport_interrupted","coverage_gap"])}).strict()]).superRefine((n,t)=>{n.execution==="not_executed"&&n.sideEffects!=="none"&&t.addIssue({code:"custom",path:["sideEffects"],message:"An unexecuted action cannot claim tool effects."}),n.outcome==="succeeded"&&n.execution!=="executed"&&t.addIssue({code:"custom",path:["execution"],message:"Successful execution requires an observed execution."}),n.outcome==="failed"&&(n.classification==="validation_failure"&&n.execution!=="not_executed"&&t.addIssue({code:"custom",path:["execution"],message:"Pre-execution validation failure must be unexecuted."}),n.classification==="process_failure"&&(n.execution!=="executed"||n.exitCode===null||n.exitCode===0)&&t.addIssue({code:"custom",path:["exitCode"],message:"Process failure requires a nonzero observed exit."}))}),Xe=e.object({failedAttempt:h,failedObservation:h,replacementAttempt:h,goalId:s,basis:e.enum(["explicit_relation","artifact_lineage","unverified"]),attributionEvidence:e.array(h).max(16)}).strict().superRefine((n,t)=>{n.failedAttempt.id===n.replacementAttempt.id&&t.addIssue({code:"custom",message:"A recovery must reference a different attempt."}),n.basis!=="unverified"&&n.attributionEvidence.length===0&&t.addIssue({code:"custom",path:["attributionEvidence"],message:"Recovery attribution needs retained evidence."})}),Ge=e.object({attempt:h,actionHash:g,outcome:e.enum(["passed","failed","unknown"]),verifierRelease:h.nullable(),verifierReceipt:h.nullable(),environmentFingerprint:g,resetStateHash:g.nullable(),outputArtifacts:e.array(Y).max(c.assetsPerEpisode),reason:x(2e3)}).strict().superRefine((n,t)=>{n.outcome!=="unknown"&&(!n.verifierRelease||!n.verifierReceipt)&&t.addIssue({code:"custom",message:"A verification outcome requires an exact verifier and execution receipt."})}),$=e.object({schemaVersion:e.literal("openpond.toolEpisodeEvent.v1"),operationId:s,installationId:s,episodeId:s,eventId:s,sessionId:s,parentSessionId:s.nullable(),turnId:s.nullable(),callId:s,occurredAt:w,sequence:e.number().int().nonnegative(),adapterVersion:e.string().min(1).max(200),sanitization:Le,contentHash:g}).strict(),R=T(e.discriminatedUnion("eventKind",[$.extend({eventKind:e.literal("attempt"),payload:Ve}).strict(),$.extend({eventKind:e.literal("observation"),payload:$e}).strict(),$.extend({eventKind:e.literal("recovery_link"),payload:Xe}).strict(),$.extend({eventKind:e.literal("verification"),payload:Ge}).strict(),$.extend({eventKind:e.literal("lineage"),payload:e.object({relation:e.enum(["fork","split","reopen"]),parentEpisode:h,parentSessionId:s,reason:x(1e3)}).strict()}).strict()]).superRefine((n,t)=>{let{contentHash:o,...i}=n;E(i)!==o&&t.addIssue({code:"custom",path:["contentHash"],message:"Episode event content hash mismatch."})}),c.eventBytes);function ae(n){let t=E(n);if(!n||typeof n!="object"||Array.isArray(n)||Object.hasOwn(n,"contentHash"))throw new Error("tool_episode_unsigned_envelope_required");return R.parse({...n,contentHash:t})}u(ae,"sealToolEpisodeEvent");var Se=T(e.object({schemaVersion:e.literal("openpond.toolEpisodeAppend.v1"),operationId:s,installationId:s,events:e.array(R).min(1).max(c.eventsPerAppend)}).strict().superRefine((n,t)=>{n.events.some(o=>o.installationId!==n.installationId)&&t.addIssue({code:"custom",path:["events"],message:"Append events must belong to the exact installation."}),new Set(n.events.map(o=>o.eventId)).size!==n.events.length&&t.addIssue({code:"custom",path:["events"],message:"Append event IDs must be unique."})}),c.eventBytes*c.eventsPerAppend),Re=e.object({schemaVersion:e.literal("openpond.toolEpisodeAppendReceipt.v1"),operationId:s,requestHash:g,installationId:s,teamId:s,projectId:s,receivedAt:w,events:e.array(e.object({eventId:s,contentHash:g,state:e.enum(["retained","already_retained","privacy_rejected"]),receiptId:s,reason:e.string().max(200).nullable()}).strict()).min(1).max(c.eventsPerAppend),learningEnrollment:e.literal(!1)}).strict();var V=e.object({revision:e.number().int().positive(),permittedTools:e.array(e.string().min(1).max(200)).min(1).max(100),workspaceRootHashes:e.array(g).min(1).max(32),permittedFields:e.array(e.enum(["action","intent","state","result_excerpt","artifact_reference"])).min(1).max(5),unchangedControls:e.object({numerator:e.number().int().nonnegative(),denominator:e.number().int().positive()}).strict(),maximumEventBytes:e.number().int().positive().max(c.eventBytes),maximumEpisodeBytes:e.number().int().positive().max(c.episodeBytes),maximumEpisodeEvents:e.number().int().positive().max(c.eventsPerEpisode),maximumQueueBytes:e.number().int().positive().max(c.queueBytes),maximumQueueEvents:e.number().int().positive().max(c.queueEvents),maximumQueueAgeSeconds:e.number().int().positive().max(c.queueAgeSeconds),rawRetentionDays:e.number().int().min(1).max(30),purposes:e.array(e.enum(["capture","consultation"])).min(1).max(2),modelUpdates:e.literal("requires_separate_review"),variantGeneration:e.literal("disabled")}).strict().superRefine((n,t)=>{n.unchangedControls.numerator>n.unchangedControls.denominator&&t.addIssue({code:"custom",path:["unchangedControls"],message:"Sampling probability cannot exceed one."});for(let o of["permittedTools","workspaceRootHashes","permittedFields","purposes"])new Set(n[o]).size!==n[o].length&&t.addIssue({code:"custom",path:[o],message:"Policy entries must be unique."});(n.maximumEpisodeBytes<n.maximumEventBytes||n.maximumQueueBytes<n.maximumEventBytes)&&t.addIssue({code:"custom",message:"Episode and queue capacities must fit one permitted event."})}),We=e.object({receipt:h.nullable(),start:e.enum(["observed","documented","unsupported","unqualified"]),resume:e.enum(["observed","documented","unsupported","unqualified"]),compaction:e.enum(["observed","documented","unsupported","unqualified"]),executionFailure:e.enum(["observed","documented","unsupported","unqualified"]),processFailure:e.enum(["observed","documented","unsupported","unqualified"]),validationFailure:e.enum(["observed","documented","unsupported","unqualified"]),nestedCalls:e.enum(["observed","documented","unsupported","unqualified"]),contextRefresh:e.enum(["session_start","start_resume","start_resume_compaction","revision_aware_turn","unqualified"]),gaps:e.array(e.string().min(1).max(500)).max(32)}).strict().superRefine((n,t)=>{Object.values(n).includes("observed")&&!n.receipt&&t.addIssue({code:"custom",path:["receipt"],message:"Observed coverage requires a qualification receipt."})}),we=T(e.object({schemaVersion:e.literal("openpond.toolLearningRegistration.v1"),operationId:s,installationId:s,projectId:s,machineSourceId:s,client:K,clientVersion:e.string().min(1).max(200),adapterRelease:h,collectionPolicy:V}).strict(),c.eventBytes),H=e.object({schemaVersion:e.literal("openpond.toolLearningInstallation.v1"),id:s,revision:e.number().int().positive(),scope:C,ownerUserId:s,machineSourceId:s,client:K,clientVersion:e.string().min(1).max(200),adapterRelease:h,state:e.enum(["pending_client_trust","enabled","disabled","revoked"]),collectionPolicy:V,collectionPolicyHash:g,coverage:We,credential:e.object({id:s,expiresAt:w,revokedAt:w.nullable(),capabilities:e.array(e.enum(["episode_append","manifest_read","consultation_submit","consultation_read"])).min(1).max(4)}).strict().nullable(),createdAt:w,updatedAt:w}).strict(),Ne=e.object({operationId:s,expectedRevision:e.number().int().positive(),state:e.enum(["enabled","disabled","revoked"])}).strict(),Ct=e.object({schemaVersion:e.literal("openpond.toolEpisodeOrigin.v1"),installationId:s,projectId:s,ownerUserId:s,episode:h,event:h,appendReceipt:h,purpose:e.literal("private_dataset_evidence"),trainingConsent:e.literal("not_granted")}).strict();import{DatabaseSync as Qe}from"node:sqlite";import{chmodSync as Ce,closeSync as Ze,existsSync as je,lstatSync as ce,mkdirSync as et,openSync as tt}from"node:fs";import{join as He}from"node:path";var Z=e.object({id:s,application:e.string().min(1).max(200),versions:e.array(e.string().min(1).max(200)).min(1).max(32),tools:e.array(e.string().min(1).max(200)).min(1).max(32),mode:e.literal("recovery"),routingInstruction:x(2e3),qualification:e.discriminatedUnion("kind",[e.object({kind:e.literal("integration"),receipt:h}).strict(),e.object({kind:e.literal("learned"),receipt:h,trainingRun:h,adapter:h,evaluation:h,activation:h}).strict()])}).strict(),Je=e.object({schemaVersion:e.literal("openpond.toolLearningManifest.v1"),installationId:s,scope:C,revision:e.number().int().positive(),contentHash:g,issuedAt:w,expiresAt:w,modelRelease:h,responseSchema:e.literal("openpond.toolLearningDecision.v1"),capabilities:e.array(Z).max(c.capabilities)}).strict().superRefine((n,t)=>{let{contentHash:o,...i}=n;E(i)!==o&&t.addIssue({code:"custom",path:["contentHash"],message:"Manifest content hash mismatch."});let a=Date.parse(n.expiresAt)-Date.parse(n.issuedAt);(a<=0||a>c.manifestSeconds*1e3)&&t.addIssue({code:"custom",path:["expiresAt"],message:"Manifest expiry exceeds the supported lifetime."}),new Set(n.capabilities.map(l=>l.id)).size!==n.capabilities.length&&t.addIssue({code:"custom",path:["capabilities"],message:"Capability IDs must be unique."})}),Oe=T(Je,c.consultationBytes),O=T(e.object({schemaVersion:e.literal("openpond.toolLearningConsultation.v1"),operationId:s,installationId:s,scope:C,sessionId:s,callId:s,capabilityId:s,manifestHash:g,modelRelease:h,mode:e.literal("recovery"),intent:x(2e3),action:P,actionHash:g,environment:j,contextHash:g,failure:e.object({message:x(c.resultBytes),observation:h}).strict(),round:e.number().int().min(1).max(c.consultationRounds)}).strict().superRefine((n,t)=>{E(n.action)!==n.actionHash&&t.addIssue({code:"custom",path:["actionHash"],message:"Consultation action hash mismatch."}),E({intent:n.intent,environment:n.environment,failure:n.failure})!==n.contextHash&&t.addIssue({code:"custom",path:["contextHash"],message:"Consultation context hash mismatch."})}),c.consultationBytes),se=e.discriminatedUnion("decision",[e.object({decision:e.literal("proceed")}).strict(),e.object({decision:e.literal("revise"),issues:e.array(e.object({category:e.string().min(1).max(120),feedback:x(2e3)}).strict()).min(1).max(8)}).strict(),e.object({decision:e.literal("needs_context"),missing:e.array(e.object({field:e.string().min(1).max(120),reason:x(500)}).strict()).min(1).max(8)}).strict()]),Ae={operationId:s,installationId:s,capabilityId:s,manifestHash:g,modelRelease:h,actionHash:g,contextHash:g},Ye=T(e.discriminatedUnion("state",[e.object({schemaVersion:e.literal("openpond.toolLearningDecision.v1"),...Ae,state:e.literal("completed"),decision:se,usageReceipt:h,completedAt:w}).strict(),e.object({schemaVersion:e.literal("openpond.toolLearningDecision.v1"),...Ae,state:e.literal("unavailable"),reason:e.enum(["disabled","revoked","expired_manifest","unsupported_scope","budget_exhausted","timeout","invalid_output","cancelled","dispatch_uncertain"]),usageReceipt:h.nullable()}).strict()]),c.consultationBytes);function re(n,t){let o=O.parse(n),i=Ye.parse(t);for(let a of["operationId","installationId","capabilityId","manifestHash","actionHash","contextHash"])if(o[a]!==i[a])throw new Error(`tool_learning_consultation_${a}_mismatch`);if(o.modelRelease.id!==i.modelRelease.id||o.modelRelease.contentHash!==i.modelRelease.contentHash)throw new Error("tool_learning_consultation_model_mismatch");return i}u(re,"assertToolLearningConsultationResponse");function le(n,t){let o=R.parse(n),i=V.parse(t);if(!i.purposes.includes("capture"))throw new Error("tool_learning_capture_not_enabled");if(o.sanitization.policyRevision!==i.revision||o.sanitization.policyHash!==E(i))throw new Error("tool_learning_capture_policy_changed");if(new TextEncoder().encode(JSON.stringify(o)).byteLength>i.maximumEventBytes)throw new Error("tool_learning_event_policy_limit");let a=u(l=>i.permittedFields.includes(l),"permits");if(o.eventKind==="attempt"){if(!i.permittedTools.includes(o.payload.tool.name))throw new Error("tool_learning_tool_outside_collection_policy");if(!a("action")||!a("intent")&&o.payload.intent!==""||!a("state")&&Object.keys(o.payload.environment.state).length>0||!a("artifact_reference")&&o.payload.contextAssets.length>0)throw new Error("tool_learning_attempt_field_outside_collection_policy")}if(o.eventKind==="observation"&&(!a("result_excerpt")&&(o.payload.resultExcerpt!==""||o.payload.outcome==="failed"&&o.payload.message!=="")||!a("artifact_reference")&&o.payload.assets.length>0))throw new Error("tool_learning_result_field_outside_collection_policy");if(o.eventKind==="verification"&&(!a("result_excerpt")&&o.payload.reason!==""||!a("artifact_reference")&&o.payload.outputArtifacts.length>0))throw new Error("tool_learning_verification_field_outside_collection_policy");if(o.eventKind==="lineage"&&!a("intent")&&o.payload.reason!=="")throw new Error("tool_learning_lineage_field_outside_collection_policy")}u(le,"assertToolEpisodeCapturePolicy");var de=e.object({schemaVersion:e.literal("openpond.localToolLearningInstallation.v1"),id:s,teamId:s,projectId:s,client:K,workspaceRoot:e.string().min(1).max(4e3),enabled:e.boolean(),policy:V,createdAt:e.iso.datetime({offset:!0})}).strict(),X=class{static{u(this,"ToolLearningLocalStore")}db;constructor(n){let t=He(n,"tool-learning");if(je(t)&&ce(t).isSymbolicLink())throw new Error("tool_learning_directory_symlink_forbidden");et(t,{recursive:!0,mode:448}),Ce(t,448);let o=He(t,"queue.sqlite");if(je(o)){if(!ce(o).isFile()||ce(o).isSymbolicLink())throw new Error("tool_learning_queue_file_invalid")}else Ze(tt(o,"wx",384));Ce(o,384),this.db=new Qe(o),this.db.exec("PRAGMA busy_timeout = 3000; PRAGMA journal_mode = WAL; PRAGMA synchronous = FULL;"),this.db.exec(`
2
+ import{b as oe}from"./chunk-YG3HITOU.js";import{b as be}from"./chunk-SSHE6B7Z.js";import{f as J}from"./chunk-64EDQ7UV.js";import{m as L}from"./chunk-HIQPGYVH.js";import{o as ye}from"./chunk-3VT2PPKW.js";import{l as W}from"./chunk-ZEOYNUHL.js";import{v as B}from"./chunk-ZY32SZ2P.js";import{I as Ee,K as Te}from"./chunk-SV7ZBEK2.js";import{c as M,d as z,e as Ie,n as y}from"./chunk-RCT3O3HQ.js";import{f as ve}from"./chunk-UGOK7VTC.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as u}from"./chunk-FTQLQJQV.js";var c=Object.freeze({eventBytes:65536,actionBytes:16384,resultBytes:8192,stateBytes:8192,eventsPerAppend:32,eventsPerEpisode:256,episodeBytes:2097152,assetBytes:1048576,assetsPerEpisode:16,queueBytes:52428800,queueEvents:5e3,queueAgeSeconds:86400,capabilities:32,consultationRounds:3,consultationBytes:65536,manifestSeconds:300}),s=M,g=z,w=Ie,K=e.enum(["codex","claude_code","opencode","openpond"]),h=e.object({id:M,contentHash:z}).strict(),C=e.object({teamId:M,projectId:M}).strict();function T(n,t){return e.preprocess((o,i)=>{try{B(o,t)}catch{return i.addIssue({code:"custom",message:"Tool learning data exceeds its JSON boundary."}),e.NEVER}return o},n)}u(T,"boundedToolLearningSchema");function x(n){return e.string().max(n).refine(t=>new TextEncoder().encode(t).byteLength<=n,"Tool learning text exceeds its UTF-8 byte limit.")}u(x,"toolLearningText");var ze=T(e.record(e.string().min(1).max(120),e.union([x(2e3),e.number().finite(),e.boolean(),e.null()])).refine(n=>Object.keys(n).length<=32,"Use at most 32 explicit state fields."),c.stateBytes),j=e.object({application:e.string().trim().min(1).max(200),version:e.string().trim().min(1).max(200),state:ze,fingerprint:z}).strict(),Y=e.object({id:M,contentHash:z,mediaType:e.enum(["text/plain","application/json","text/x-python","text/x-diff"]),sizeBytes:e.number().int().nonnegative().max(c.assetBytes),purpose:e.enum(["action","result","state","verification"])}).strict(),Le=e.object({policyRevision:e.number().int().positive(),policyHash:z,redactedFields:e.number().int().nonnegative().max(1e4),omittedFields:e.number().int().nonnegative().max(1e4),truncated:e.boolean()}).strict();function E(n,t=c.eventBytes){return B(n,t),y(n)}u(E,"toolLearningContentHash");var Q=x(c.actionBytes),xe=e.string().min(1).max(1e3).refine(n=>!n.startsWith("/")&&!n.includes("\\")&&!/^[A-Za-z]:/u.test(n)&&n.split("/").every(t=>t!==""&&t!=="."&&t!==".."),"Use a workspace-relative artifact path."),P=T(e.discriminatedUnion("kind",[e.object({kind:e.literal("python"),code:Q}).strict(),e.object({kind:e.literal("shell"),command:Q,shell:e.string().min(1).max(120)}).strict(),e.object({kind:e.literal("tool_arguments"),arguments:e.record(e.string().min(1).max(200),e.json())}).strict(),e.object({kind:e.literal("edit"),patch:Q,baseFiles:e.array(e.object({path:xe,contentHash:g.nullable()}).strict()).min(1).max(32)}).strict()]),c.actionBytes),yt=e.discriminatedUnion("kind",[e.object({kind:e.literal("replacement"),expectedActionHash:g,environmentFingerprint:g,action:P}).strict(),e.object({kind:e.literal("patch"),expectedActionHash:g,environmentFingerprint:g,files:e.array(e.object({path:xe,expectedContentHash:g,patch:Q}).strict()).min(1).max(16)}).strict()]);var Ve=e.object({intent:x(2e3),tool:e.object({name:e.string().min(1).max(200),version:e.string().max(200).nullable(),server:e.string().max(200).nullable()}).strict(),action:P,actionHash:g,environment:j,contextAssets:e.array(Y).max(c.assetsPerEpisode),selection:e.discriminatedUnion("kind",[e.object({kind:e.literal("eligible_attempt")}).strict(),e.object({kind:e.literal("unchanged_control"),numerator:e.number().int().positive(),denominator:e.number().int().positive(),policyHash:g}).strict()])}).strict().superRefine((n,t)=>{E(n.action)!==n.actionHash&&t.addIssue({code:"custom",path:["actionHash"],message:"Action bytes differ from their hash."}),n.selection.kind==="unchanged_control"&&n.selection.numerator>n.selection.denominator&&t.addIssue({code:"custom",path:["selection"],message:"Sampling probability cannot exceed one."})}),Ke=e.enum(["validation_failure","execution_failure","process_failure","timeout","cancelled","infrastructure_failure","authorization_denied","outcome_failure","unknown_failure"]),ie={attempt:h,actionHash:g,execution:e.enum(["not_executed","executed","unknown"]),sideEffects:e.enum(["none","possible","observed","unknown"]),resultExcerpt:x(c.resultBytes),resultHash:g.nullable(),assets:e.array(Y).max(c.assetsPerEpisode)},$e=e.discriminatedUnion("outcome",[e.object({...ie,outcome:e.literal("succeeded"),exitCode:e.literal(0).nullable()}).strict(),e.object({...ie,outcome:e.literal("failed"),classification:Ke,errorCode:e.string().min(1).max(200),message:x(2e3),exitCode:e.number().int().min(-255).max(255).nullable()}).strict(),e.object({...ie,outcome:e.literal("incomplete"),reason:e.enum(["completion_not_observed","observer_restarted","transport_interrupted","coverage_gap"])}).strict()]).superRefine((n,t)=>{n.execution==="not_executed"&&n.sideEffects!=="none"&&t.addIssue({code:"custom",path:["sideEffects"],message:"An unexecuted action cannot claim tool effects."}),n.outcome==="succeeded"&&n.execution!=="executed"&&t.addIssue({code:"custom",path:["execution"],message:"Successful execution requires an observed execution."}),n.outcome==="failed"&&(n.classification==="validation_failure"&&n.execution!=="not_executed"&&t.addIssue({code:"custom",path:["execution"],message:"Pre-execution validation failure must be unexecuted."}),n.classification==="process_failure"&&(n.execution!=="executed"||n.exitCode===null||n.exitCode===0)&&t.addIssue({code:"custom",path:["exitCode"],message:"Process failure requires a nonzero observed exit."}))}),Xe=e.object({failedAttempt:h,failedObservation:h,replacementAttempt:h,goalId:s,basis:e.enum(["explicit_relation","artifact_lineage","unverified"]),attributionEvidence:e.array(h).max(16)}).strict().superRefine((n,t)=>{n.failedAttempt.id===n.replacementAttempt.id&&t.addIssue({code:"custom",message:"A recovery must reference a different attempt."}),n.basis!=="unverified"&&n.attributionEvidence.length===0&&t.addIssue({code:"custom",path:["attributionEvidence"],message:"Recovery attribution needs retained evidence."})}),Ge=e.object({attempt:h,actionHash:g,outcome:e.enum(["passed","failed","unknown"]),verifierRelease:h.nullable(),verifierReceipt:h.nullable(),environmentFingerprint:g,resetStateHash:g.nullable(),outputArtifacts:e.array(Y).max(c.assetsPerEpisode),reason:x(2e3)}).strict().superRefine((n,t)=>{n.outcome!=="unknown"&&(!n.verifierRelease||!n.verifierReceipt)&&t.addIssue({code:"custom",message:"A verification outcome requires an exact verifier and execution receipt."})}),$=e.object({schemaVersion:e.literal("openpond.toolEpisodeEvent.v1"),operationId:s,installationId:s,episodeId:s,eventId:s,sessionId:s,parentSessionId:s.nullable(),turnId:s.nullable(),callId:s,occurredAt:w,sequence:e.number().int().nonnegative(),adapterVersion:e.string().min(1).max(200),sanitization:Le,contentHash:g}).strict(),R=T(e.discriminatedUnion("eventKind",[$.extend({eventKind:e.literal("attempt"),payload:Ve}).strict(),$.extend({eventKind:e.literal("observation"),payload:$e}).strict(),$.extend({eventKind:e.literal("recovery_link"),payload:Xe}).strict(),$.extend({eventKind:e.literal("verification"),payload:Ge}).strict(),$.extend({eventKind:e.literal("lineage"),payload:e.object({relation:e.enum(["fork","split","reopen"]),parentEpisode:h,parentSessionId:s,reason:x(1e3)}).strict()}).strict()]).superRefine((n,t)=>{let{contentHash:o,...i}=n;E(i)!==o&&t.addIssue({code:"custom",path:["contentHash"],message:"Episode event content hash mismatch."})}),c.eventBytes);function ae(n){let t=E(n);if(!n||typeof n!="object"||Array.isArray(n)||Object.hasOwn(n,"contentHash"))throw new Error("tool_episode_unsigned_envelope_required");return R.parse({...n,contentHash:t})}u(ae,"sealToolEpisodeEvent");var Se=T(e.object({schemaVersion:e.literal("openpond.toolEpisodeAppend.v1"),operationId:s,installationId:s,events:e.array(R).min(1).max(c.eventsPerAppend)}).strict().superRefine((n,t)=>{n.events.some(o=>o.installationId!==n.installationId)&&t.addIssue({code:"custom",path:["events"],message:"Append events must belong to the exact installation."}),new Set(n.events.map(o=>o.eventId)).size!==n.events.length&&t.addIssue({code:"custom",path:["events"],message:"Append event IDs must be unique."})}),c.eventBytes*c.eventsPerAppend),Re=e.object({schemaVersion:e.literal("openpond.toolEpisodeAppendReceipt.v1"),operationId:s,requestHash:g,installationId:s,teamId:s,projectId:s,receivedAt:w,events:e.array(e.object({eventId:s,contentHash:g,state:e.enum(["retained","already_retained","privacy_rejected"]),receiptId:s,reason:e.string().max(200).nullable()}).strict()).min(1).max(c.eventsPerAppend),learningEnrollment:e.literal(!1)}).strict();var V=e.object({revision:e.number().int().positive(),permittedTools:e.array(e.string().min(1).max(200)).min(1).max(100),workspaceRootHashes:e.array(g).min(1).max(32),permittedFields:e.array(e.enum(["action","intent","state","result_excerpt","artifact_reference"])).min(1).max(5),unchangedControls:e.object({numerator:e.number().int().nonnegative(),denominator:e.number().int().positive()}).strict(),maximumEventBytes:e.number().int().positive().max(c.eventBytes),maximumEpisodeBytes:e.number().int().positive().max(c.episodeBytes),maximumEpisodeEvents:e.number().int().positive().max(c.eventsPerEpisode),maximumQueueBytes:e.number().int().positive().max(c.queueBytes),maximumQueueEvents:e.number().int().positive().max(c.queueEvents),maximumQueueAgeSeconds:e.number().int().positive().max(c.queueAgeSeconds),rawRetentionDays:e.number().int().min(1).max(30),purposes:e.array(e.enum(["capture","consultation"])).min(1).max(2),modelUpdates:e.literal("requires_separate_review"),variantGeneration:e.literal("disabled")}).strict().superRefine((n,t)=>{n.unchangedControls.numerator>n.unchangedControls.denominator&&t.addIssue({code:"custom",path:["unchangedControls"],message:"Sampling probability cannot exceed one."});for(let o of["permittedTools","workspaceRootHashes","permittedFields","purposes"])new Set(n[o]).size!==n[o].length&&t.addIssue({code:"custom",path:[o],message:"Policy entries must be unique."});(n.maximumEpisodeBytes<n.maximumEventBytes||n.maximumQueueBytes<n.maximumEventBytes)&&t.addIssue({code:"custom",message:"Episode and queue capacities must fit one permitted event."})}),We=e.object({receipt:h.nullable(),start:e.enum(["observed","documented","unsupported","unqualified"]),resume:e.enum(["observed","documented","unsupported","unqualified"]),compaction:e.enum(["observed","documented","unsupported","unqualified"]),executionFailure:e.enum(["observed","documented","unsupported","unqualified"]),processFailure:e.enum(["observed","documented","unsupported","unqualified"]),validationFailure:e.enum(["observed","documented","unsupported","unqualified"]),nestedCalls:e.enum(["observed","documented","unsupported","unqualified"]),contextRefresh:e.enum(["session_start","start_resume","start_resume_compaction","revision_aware_turn","unqualified"]),gaps:e.array(e.string().min(1).max(500)).max(32)}).strict().superRefine((n,t)=>{Object.values(n).includes("observed")&&!n.receipt&&t.addIssue({code:"custom",path:["receipt"],message:"Observed coverage requires a qualification receipt."})}),we=T(e.object({schemaVersion:e.literal("openpond.toolLearningRegistration.v1"),operationId:s,installationId:s,projectId:s,machineSourceId:s,client:K,clientVersion:e.string().min(1).max(200),adapterRelease:h,collectionPolicy:V}).strict(),c.eventBytes),H=e.object({schemaVersion:e.literal("openpond.toolLearningInstallation.v1"),id:s,revision:e.number().int().positive(),scope:C,ownerUserId:s,machineSourceId:s,client:K,clientVersion:e.string().min(1).max(200),adapterRelease:h,state:e.enum(["pending_client_trust","enabled","disabled","revoked"]),collectionPolicy:V,collectionPolicyHash:g,coverage:We,credential:e.object({id:s,expiresAt:w,revokedAt:w.nullable(),capabilities:e.array(e.enum(["episode_append","manifest_read","consultation_submit","consultation_read"])).min(1).max(4)}).strict().nullable(),createdAt:w,updatedAt:w}).strict(),Ne=e.object({operationId:s,expectedRevision:e.number().int().positive(),state:e.enum(["enabled","disabled","revoked"])}).strict(),Ct=e.object({schemaVersion:e.literal("openpond.toolEpisodeOrigin.v1"),installationId:s,projectId:s,ownerUserId:s,episode:h,event:h,appendReceipt:h,purpose:e.literal("private_dataset_evidence"),trainingConsent:e.literal("not_granted")}).strict();import{DatabaseSync as Qe}from"node:sqlite";import{chmodSync as Ce,closeSync as Ze,existsSync as je,lstatSync as ce,mkdirSync as et,openSync as tt}from"node:fs";import{join as He}from"node:path";var Z=e.object({id:s,application:e.string().min(1).max(200),versions:e.array(e.string().min(1).max(200)).min(1).max(32),tools:e.array(e.string().min(1).max(200)).min(1).max(32),mode:e.literal("recovery"),routingInstruction:x(2e3),qualification:e.discriminatedUnion("kind",[e.object({kind:e.literal("integration"),receipt:h}).strict(),e.object({kind:e.literal("learned"),receipt:h,trainingRun:h,adapter:h,evaluation:h,activation:h}).strict()])}).strict(),Je=e.object({schemaVersion:e.literal("openpond.toolLearningManifest.v1"),installationId:s,scope:C,revision:e.number().int().positive(),contentHash:g,issuedAt:w,expiresAt:w,modelRelease:h,responseSchema:e.literal("openpond.toolLearningDecision.v1"),capabilities:e.array(Z).max(c.capabilities)}).strict().superRefine((n,t)=>{let{contentHash:o,...i}=n;E(i)!==o&&t.addIssue({code:"custom",path:["contentHash"],message:"Manifest content hash mismatch."});let a=Date.parse(n.expiresAt)-Date.parse(n.issuedAt);(a<=0||a>c.manifestSeconds*1e3)&&t.addIssue({code:"custom",path:["expiresAt"],message:"Manifest expiry exceeds the supported lifetime."}),new Set(n.capabilities.map(l=>l.id)).size!==n.capabilities.length&&t.addIssue({code:"custom",path:["capabilities"],message:"Capability IDs must be unique."})}),Oe=T(Je,c.consultationBytes),O=T(e.object({schemaVersion:e.literal("openpond.toolLearningConsultation.v1"),operationId:s,installationId:s,scope:C,sessionId:s,callId:s,capabilityId:s,manifestHash:g,modelRelease:h,mode:e.literal("recovery"),intent:x(2e3),action:P,actionHash:g,environment:j,contextHash:g,failure:e.object({message:x(c.resultBytes),observation:h}).strict(),round:e.number().int().min(1).max(c.consultationRounds)}).strict().superRefine((n,t)=>{E(n.action)!==n.actionHash&&t.addIssue({code:"custom",path:["actionHash"],message:"Consultation action hash mismatch."}),E({intent:n.intent,environment:n.environment,failure:n.failure})!==n.contextHash&&t.addIssue({code:"custom",path:["contextHash"],message:"Consultation context hash mismatch."})}),c.consultationBytes),se=e.discriminatedUnion("decision",[e.object({decision:e.literal("proceed")}).strict(),e.object({decision:e.literal("revise"),issues:e.array(e.object({category:e.string().min(1).max(120),feedback:x(2e3)}).strict()).min(1).max(8)}).strict(),e.object({decision:e.literal("needs_context"),missing:e.array(e.object({field:e.string().min(1).max(120),reason:x(500)}).strict()).min(1).max(8)}).strict()]),Ae={operationId:s,installationId:s,capabilityId:s,manifestHash:g,modelRelease:h,actionHash:g,contextHash:g},Ye=T(e.discriminatedUnion("state",[e.object({schemaVersion:e.literal("openpond.toolLearningDecision.v1"),...Ae,state:e.literal("completed"),decision:se,usageReceipt:h,completedAt:w}).strict(),e.object({schemaVersion:e.literal("openpond.toolLearningDecision.v1"),...Ae,state:e.literal("unavailable"),reason:e.enum(["disabled","revoked","expired_manifest","unsupported_scope","budget_exhausted","timeout","invalid_output","cancelled","dispatch_uncertain"]),usageReceipt:h.nullable()}).strict()]),c.consultationBytes);function re(n,t){let o=O.parse(n),i=Ye.parse(t);for(let a of["operationId","installationId","capabilityId","manifestHash","actionHash","contextHash"])if(o[a]!==i[a])throw new Error(`tool_learning_consultation_${a}_mismatch`);if(o.modelRelease.id!==i.modelRelease.id||o.modelRelease.contentHash!==i.modelRelease.contentHash)throw new Error("tool_learning_consultation_model_mismatch");return i}u(re,"assertToolLearningConsultationResponse");function le(n,t){let o=R.parse(n),i=V.parse(t);if(!i.purposes.includes("capture"))throw new Error("tool_learning_capture_not_enabled");if(o.sanitization.policyRevision!==i.revision||o.sanitization.policyHash!==E(i))throw new Error("tool_learning_capture_policy_changed");if(new TextEncoder().encode(JSON.stringify(o)).byteLength>i.maximumEventBytes)throw new Error("tool_learning_event_policy_limit");let a=u(l=>i.permittedFields.includes(l),"permits");if(o.eventKind==="attempt"){if(!i.permittedTools.includes(o.payload.tool.name))throw new Error("tool_learning_tool_outside_collection_policy");if(!a("action")||!a("intent")&&o.payload.intent!==""||!a("state")&&Object.keys(o.payload.environment.state).length>0||!a("artifact_reference")&&o.payload.contextAssets.length>0)throw new Error("tool_learning_attempt_field_outside_collection_policy")}if(o.eventKind==="observation"&&(!a("result_excerpt")&&(o.payload.resultExcerpt!==""||o.payload.outcome==="failed"&&o.payload.message!=="")||!a("artifact_reference")&&o.payload.assets.length>0))throw new Error("tool_learning_result_field_outside_collection_policy");if(o.eventKind==="verification"&&(!a("result_excerpt")&&o.payload.reason!==""||!a("artifact_reference")&&o.payload.outputArtifacts.length>0))throw new Error("tool_learning_verification_field_outside_collection_policy");if(o.eventKind==="lineage"&&!a("intent")&&o.payload.reason!=="")throw new Error("tool_learning_lineage_field_outside_collection_policy")}u(le,"assertToolEpisodeCapturePolicy");var de=e.object({schemaVersion:e.literal("openpond.localToolLearningInstallation.v1"),id:s,teamId:s,projectId:s,client:K,workspaceRoot:e.string().min(1).max(4e3),enabled:e.boolean(),policy:V,createdAt:e.iso.datetime({offset:!0})}).strict(),X=class{static{u(this,"ToolLearningLocalStore")}db;constructor(n){let t=He(n,"tool-learning");if(je(t)&&ce(t).isSymbolicLink())throw new Error("tool_learning_directory_symlink_forbidden");et(t,{recursive:!0,mode:448}),Ce(t,448);let o=He(t,"queue.sqlite");if(je(o)){if(!ce(o).isFile()||ce(o).isSymbolicLink())throw new Error("tool_learning_queue_file_invalid")}else Ze(tt(o,"wx",384));Ce(o,384),this.db=new Qe(o),this.db.exec("PRAGMA busy_timeout = 3000; PRAGMA journal_mode = WAL; PRAGMA synchronous = FULL;"),this.db.exec(`
3
3
  CREATE TABLE IF NOT EXISTS installations (id TEXT PRIMARY KEY, payload TEXT NOT NULL);
4
4
  CREATE TABLE IF NOT EXISTS events (
5
5
  id TEXT PRIMARY KEY, installation_id TEXT NOT NULL, episode_id TEXT NOT NULL,
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as I}from"./chunk-P4QM63L3.js";import{v as P}from"./chunk-ZY32SZ2P.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as s}from"./chunk-FTQLQJQV.js";var se=2,le="application/vnd.openpond.training+json;version=2",x="application/vnd.openpond.model-project+json;version=2",ce=1048576,de=67108864,ue=8388608,b=524288,E=8388608,c=class extends Error{static{s(this,"OpenPondProtocolError")}code;constructor(t,n){super(n),this.name="OpenPondProtocolError",this.code=t}};function h(t){return JSON.stringify(w(t))}s(h,"canonicalJson");function B(t){return new TextEncoder().encode(h(t)).byteLength}s(B,"canonicalJsonByteLength");async function _(t){let n=new TextEncoder().encode(h(t)),o=await globalThis.crypto.subtle.digest("SHA-256",n);return Array.from(new Uint8Array(o),a=>a.toString(16).padStart(2,"0")).join("")}s(_,"canonicalSha256");function M(t,n,o){let a=B(t);if(a>n)throw new c("payload_too_large",`${o} is ${a} bytes; the maximum is ${n} bytes.`)}s(M,"assertCanonicalPayloadSize");function T(t,n,o){let a=new TextEncoder().encode(t).byteLength;if(a>n)throw new c("response_too_large",`${o} is ${a} bytes; the maximum is ${n} bytes.`);try{return JSON.parse(t)}catch{throw new c("invalid_json",`${o} was not valid JSON.`)}}s(T,"parseBoundedJson");async function C(t,n,o){let a=t.body?.getReader();if(!a)return T("",n,o);let r=new TextDecoder,l=0,m="";try{for(;;){let d=await a.read();if(d.done)break;if(l+=d.value.byteLength,l>n)throw new c("response_too_large",`${o} exceeds the maximum of ${n} bytes.`);m+=r.decode(d.value,{stream:!0})}return m+=r.decode(),T(m,n,o)}catch(d){try{await a.cancel()}catch{}throw d}finally{try{a.releaseLock()}catch{}}}s(C,"readBoundedJsonResponse");function w(t){if(t===null||typeof t=="string"||typeof t=="boolean")return t;if(typeof t=="number"){if(!Number.isFinite(t))throw new c("non_json_value","Canonical JSON cannot contain a non-finite number.");return Object.is(t,-0)?0:t}if(Array.isArray(t))return t.map(n=>w(n));if(typeof t=="object"){let n=Object.getPrototypeOf(t);if(n!==Object.prototype&&n!==null)throw new c("non_json_value","Canonical JSON accepts only plain objects.");let o=Object.create(null);for(let a of Object.keys(t).sort()){let r=t[a];if(r===void 0||typeof r=="function"||typeof r=="symbol")throw new c("non_json_value",`Canonical JSON cannot contain ${typeof r} at ${a}.`);o[a]=w(r)}return o}throw new c("non_json_value",`Canonical JSON cannot contain ${typeof t}.`)}s(w,"normalizeCanonicalJson");var g=e.string().trim().min(1).max(191),j=e.string().regex(/^[a-f0-9]{64}$/),L=e.string().min(1).max(191).regex(/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/),G=e.discriminatedUnion("mode",[e.object({mode:e.literal("automatic"),objective:e.enum(["balanced","fast","economical"]),gpuCount:e.union([e.literal(1),e.literal(2)]).optional()}).strict(),e.object({mode:e.literal("manual"),availabilityId:g,gpuType:e.string().trim().min(1).max(256),gpuCount:e.union([e.literal(1),e.literal(2)]).optional()}).strict()]),_e=e.object({estimateId:g,inputHash:j,requestHash:j,pricingVersion:g,expiresAt:e.string().datetime({offset:!0}),token:e.string().min(1).max(8192)}).strict(),$=e.object({teamId:g,modelId:e.string().trim().min(1).max(256),modelRevision:e.string().trim().min(1).max(256),tokenizerRevision:e.string().trim().min(1).max(256),chatTemplateHash:j,method:e.enum(["sft","grpo"]),loraRank:e.number().int().min(1).max(256),gpuCount:e.union([e.literal(1),e.literal(2)])}).strict(),V=e.object({query:$,requestHash:j,qualification:e.enum(["requires_preparation","unsupported"]),reason:e.enum(["model_not_supported","lora_rank_not_supported","gpu_count_not_qualified","provider_not_supported"]).nullable(),provider:e.object({accountScopeId:g,product:e.literal("POD"),cloud:e.literal("SECURE"),countryCodes:e.array(e.string().regex(/^[A-Z]{2}$/)).min(1).max(300),cudaVersions:e.array(e.string().regex(/^\d+\.\d+$/)).min(1).max(100),dataCenterId:g.nullable(),minimumDiskGb:e.number().int().positive(),priceBasis:e.literal("provider_catalog_per_gpu_rate_times_count")}).strict().nullable()}).strict(),z=e.object({schemaVersion:e.literal("openpond.trainingGpuCatalog.v1"),observedAt:e.string().datetime({offset:!0}),expiresAt:e.string().datetime({offset:!0}),workerImageDigest:e.string().regex(/^sha256:[a-f0-9]{64}$/),supportedLoraRanks:e.array(e.number().int().positive()),pricingBasis:e.enum(["accepted_compute_and_disk_hourly_before_credits","provider_catalog_compute_and_disk_before_credits"]),scope:V.optional(),offerings:e.array(e.object({availabilityId:g,gpuType:e.string().min(1).max(256),provider:L,region:e.string().min(1),dataCenterId:e.string().nullable(),gpuCount:e.number().int().positive(),gpuMemoryGb:e.number().positive(),stockStatus:e.enum(["High","Medium","Low"]),computeHourlyUsd:e.number().nonnegative(),diskHourlyUsd:e.number().nonnegative(),totalHourlyUsd:e.number().nonnegative()}).strict()).max(1e3)}).strict();async function Y(t,n){let o=z.parse(t);if(Date.parse(o.expiresAt)<=Date.parse(o.observedAt)||Date.parse(o.expiresAt)<=Date.now())throw new c("training_gpu_catalog_expired","Refresh GPU availability before reviewing this run.");if(!n){if(o.scope)throw new c("training_gpu_catalog_scope_mismatch","An overview read returned an unrequested workload.");return o}let a=o.scope;if(!a||o.pricingBasis!=="provider_catalog_compute_and_disk_before_credits"||h(a.query)!==h(n)||a.requestHash!==await _(n)||a.qualification==="unsupported"!=(a.reason!==null)||(a.qualification==="unsupported"?a.provider!==null||o.offerings.length>0:!a.provider)||new Set(o.offerings.map(r=>r.provider)).size>1||o.offerings.some(r=>r.gpuCount!==n.gpuCount||r.dataCenterId!==a.provider?.dataCenterId)||new Set(o.offerings.map(r=>r.availabilityId)).size!==o.offerings.length)throw new c("training_gpu_catalog_scope_mismatch","The GPU offers do not match this workspace and workload.");return o}s(Y,"parseAndVerifyTrainingGpuCatalog");function ye(t){return{async gpuCatalog(n){let o=n===void 0?void 0:$.parse(n),a=o?new URLSearchParams(Object.entries(o).map(([m,d])=>[m,String(d)])):null,r=await t(`/v1/training/gpu-catalog${a?`?${a}`:""}`),l=r&&typeof r=="object"&&"catalog"in r?r.catalog:r;return Y(l,o)}}}s(ye,"createTrainingGpuCatalogClient");var i=e.string().trim().min(1).max(500),p=e.string().regex(/^[a-f0-9]{64}$/),u=e.string().datetime({offset:!0}),f=e.object({id:i,contentHash:p}).strict(),R=f.extend({revision:e.number().int().positive()}).strict(),v=e.object({schemaVersion:e.literal("openpond.baseModelPreference.v1"),modelId:i,revision:e.string().trim().min(1).max(256).nullable(),tokenizerRevision:e.string().trim().min(1).max(256).nullable(),chatTemplateHash:e.string().trim().min(8).max(256).nullable(),modelAssetId:i.nullable(),source:e.enum(["managed","local","builtin"])}).strict(),H=e.enum(["sft","dpo","grpo","ppo","sdft","opd","opsd","sdpo"]),X=e.object({schemaVersion:e.string().regex(/^openpond\.[A-Za-z0-9]+Recipe\.v\d+$/),method:H,parameterization:e.enum(["lora","full"])}).catchall(e.unknown()),Z=e.object({profileProjectId:i,sourceRevision:e.string().regex(/^[a-f0-9]{40,64}$/),harnessRelease:f}).strict(),F=e.object({profileProjectId:i,sourceRevision:e.string().regex(/^[a-f0-9]{40,64}$/),catalogHash:p,definitionId:i,harnessRelease:f,tasksetRelease:f}).strict(),D=e.object({tasksetRef:R.nullable().default(null),evaluationTasksetRef:R.nullable().optional(),profileSource:Z.nullable().optional(),profileEvaluation:F.nullable().optional(),rewardBindingRef:R.nullable().optional(),tasksetRelease:f.nullable().default(null),harnessRelease:f.nullable().default(null),baseModel:v.nullable().default(null),method:H.nullable().default(null),destinationId:i.nullable().default(null),managedRolloutPlacement:e.enum(["local","remote"]).default("remote"),managedGpuPlacementObjective:e.enum(["fast","balanced","economical"]).default("balanced"),managedGpuSelection:G.optional(),continuationAdapterMode:e.enum(["residual_append","shared","sequential_merge"]).optional(),managedGpuRequirement:e.enum(["any","h100_hbm3"]).default("any"),runPreset:e.enum(["small","standard","custom","small_experiment"]).nullable().default(null),recipe:X.nullable().default(null),preferredMaximumSpendUsd:e.number().nonnegative().nullable().default(null),preferredRetentionDays:e.number().int().nonnegative().nullable().default(null)}).strict(),J=D,Q=e.object({schemaVersion:e.literal("openpond.hostedModelProjectLink.v1"),apiOrigin:e.string().url().refine(t=>new URL(t).origin===t,"Use a canonical API origin.").nullable().default(null),teamId:i,projectId:i,portableProjectId:i,revision:e.number().int().positive(),etag:p,syncedSourceRevision:e.number().int().positive(),syncedAt:u,tasksets:e.array(e.object({localTasksetId:i,localTasksetHash:p.nullable().default(null),releaseId:i,releaseRevision:e.number().int().positive(),releaseHash:p,packageHash:p.nullable().default(null),hostedTasksetId:i,syncedAt:u}).strict()).max(1e4).default([])}).strict(),K=e.object({localTasksetId:i,releaseId:i,releaseRevision:e.number().int().positive(),releaseHash:p,state:e.enum(["syncing","synced","sync_failed"]),hostedTasksetId:i.nullable().default(null),lastAttemptAt:u,syncedAt:u.nullable().default(null),lastError:e.string().trim().min(1).max(5e3).nullable().default(null)}).strict(),W=e.object({schemaVersion:e.literal("openpond.modelProject.v2"),id:i,profileId:i,revision:e.number().int().positive().default(1),name:e.string().trim().min(1).max(200),objective:e.string().trim().max(5e3).nullable(),defaultBaseModel:v.nullable(),defaultDestinationId:i.nullable(),trainingSetup:D,hosted:Q.nullable().default(null),tasksetSyncs:e.array(K).max(1e4).default([]),createdAt:u,updatedAt:u}).strict(),q=W.pick({id:!0,profileId:!0,name:!0,objective:!0,defaultBaseModel:!0,defaultDestinationId:!0,trainingSetup:!0}),ee=e.object({schemaVersion:e.literal("openpond.modelProjectSave.v1"),operationId:i,expectedRevision:e.number().int().nonnegative(),project:q,learning:I.optional()}).strict().superRefine((t,n)=>{t.learning&&t.expectedRevision!==0&&n.addIssue({code:"custom",path:["learning"],message:"Use learning settings to edit an existing Model's policy."})}),te=e.object({schemaVersion:e.literal("openpond.modelProjectConfigurationCheck.v1"),configurationHash:p,projectId:i,expectedRevision:e.number().int().nonnegative(),checkedAt:u,canSave:e.boolean(),deferred:e.array(e.enum(["base_model","taskset"])).max(2),findings:e.array(e.object({code:i,severity:e.enum(["error","warning"]),message:e.string().min(1).max(5e3),field:e.string().min(1).max(500).nullable()}).strict()).max(100)}).strict(),ne=e.object({id:i,name:e.string().min(1).max(500),available:e.boolean(),preference:v}).strict();async function Se(t){let n=S(t);return _({project:n.project,expectedRevision:n.expectedRevision,...n.learning?{learning:n.learning}:{}})}s(Se,"modelProjectConfigurationHash");function S(t){try{P(t,b)}catch{throw new U(400,{schemaVersion:"openpond.modelProjectApiError.v2",code:"model_configuration_json_invalid",message:"Model configuration must be bounded JSON data.",retryable:!1,requestId:null,details:{}})}return ee.parse(t)}s(S,"parseModelProjectSaveRequest");async function Pe(t,n,o){P(t,b);let a=q.parse(t);M(a,b,"Model configuration");let r=o?I.parse(o):void 0,l=await _({project:a,expectedRevision:n,...r?{learning:r}:{}});return S({schemaVersion:"openpond.modelProjectSave.v1",operationId:`model-save:${l}`,expectedRevision:n,project:a,...r?{learning:r}:{}})}s(Pe,"createModelProjectSaveRequest");var ae=e.object({schemaVersion:e.literal("openpond.hostedModelProjectSync.v2"),portableProjectId:i,name:e.string().trim().min(1).max(200),objective:e.string().trim().max(5e3).nullable(),defaultBaseModel:v.nullable(),defaultDestinationId:i.nullable(),trainingSetup:J,sourceRevision:e.number().int().positive(),sourceUpdatedAt:u,expectedEtag:p.nullable().default(null)}).strict(),y=e.object({id:i,teamId:i,portableProjectId:i,name:e.string().trim().min(1).max(200),objective:e.string().trim().max(5e3).nullable(),defaultBaseModel:v.nullable(),defaultDestinationId:i.nullable(),trainingSetup:J,sourceRevision:e.number().int().positive(),sourceUpdatedAt:u,revision:e.number().int().positive(),etag:p,createdAt:u,updatedAt:u}).strict(),re=e.object({kind:e.enum(["taskset_release","harness_release","dataset_release","evidence_set","model_version","reward_model_version","evaluation_receipt"]),ref:f,role:e.string().trim().min(1).max(200).nullable().default(null),updatedAt:u}).strict(),oe=e.object({project:y,resources:e.array(re).max(1e4),jobCount:e.number().int().nonnegative(),latestJobIds:e.array(i).max(100)}).strict(),ie=e.object({schemaVersion:e.literal("openpond.modelProjectApiError.v2"),code:e.string().trim().min(1).max(200),message:e.string().trim().min(1).max(5e3),retryable:e.boolean().default(!1),requestId:e.string().trim().min(1).max(500).nullable().default(null),details:e.record(e.string(),e.unknown()).default({})}).strict(),U=class extends Error{static{s(this,"OpenPondModelProjectApiError")}status;code;retryable;requestId;details;constructor(t,n){super(n.message),this.name="OpenPondModelProjectApiError",this.status=t,this.code=n.code,this.retryable=n.retryable,this.requestId=n.requestId,this.details=n.details}};function k(t){let n={};return new Headers(t).forEach((o,a)=>{n[a]=o}),n}s(k,"headersRecord");function Ie(t){let n=t.fetch??fetch,o=t.baseUrl.replace(/\/$/,"");async function a(r,l){let m=typeof t.headers=="function"?await t.headers():t.headers??{},d=await n(`${o}${r}`,{...l,headers:{accept:x,...l?.body?{"content-type":x}:{},...k(m),...k(l?.headers)}}),A=await C(d,E,"Model Project API response");if(!d.ok){let O=ie.safeParse(A);throw O.success?new U(d.status,O.data):new c("invalid_error_response",`Model Project request failed with HTTP ${d.status} and an invalid error envelope.`)}return A}return s(a,"request"),{async configurationCandidates(){return e.object({candidates:e.array(ne).max(1e3)}).strict().parse(await a("/v1/model-projects/configuration/candidates",{headers:{accept:"application/json"}})).candidates},async checkConfiguration(r){let l=S(r);return te.parse(await a("/v1/model-projects/configuration/check",{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(l)}))},async saveConfiguration(r){let l=S(r);return y.parse(await a("/v1/model-projects/configuration/save",{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(l)}))},async upsert(r){M(r,b,"Model Project sync");let l=ae.parse(r),m=await a(`/v1/model-projects/${encodeURIComponent(l.portableProjectId)}`,{method:"PUT",body:JSON.stringify(l)});return y.parse(N(m,"project"))},async list(){let r=await a("/v1/model-projects");return e.array(y).parse(N(r,"projects"))},async get(r){let l=await a(`/v1/model-projects/${encodeURIComponent(i.parse(r))}`);return oe.parse(l)}}}s(Ie,"createModelProjectsClient");function N(t,n){return!t||typeof t!="object"||Array.isArray(t)?t:n in t?t[n]:t}s(N,"unwrapObject");export{se as a,le as b,x as c,ce as d,de as e,ue as f,b as g,E as h,c as i,h as j,B as k,_ as l,M as m,T as n,C as o,G as p,_e as q,$ as r,V as s,z as t,Y as u,ye as v,f as w,R as x,v as y,H as z,X as A,Z as B,F as C,D,J as E,Q as F,K as G,W as H,q as I,ee as J,te as K,ne as L,Se as M,S as N,Pe as O,ae as P,y as Q,re as R,oe as S,ie as T,U,Ie as V};
2
+ import{a as I}from"./chunk-5ZBDHIIE.js";import{v as P}from"./chunk-ZY32SZ2P.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as s}from"./chunk-FTQLQJQV.js";var se=2,le="application/vnd.openpond.training+json;version=2",x="application/vnd.openpond.model-project+json;version=2",ce=1048576,de=67108864,ue=8388608,b=524288,E=8388608,c=class extends Error{static{s(this,"OpenPondProtocolError")}code;constructor(t,n){super(n),this.name="OpenPondProtocolError",this.code=t}};function h(t){return JSON.stringify(w(t))}s(h,"canonicalJson");function B(t){return new TextEncoder().encode(h(t)).byteLength}s(B,"canonicalJsonByteLength");async function _(t){let n=new TextEncoder().encode(h(t)),o=await globalThis.crypto.subtle.digest("SHA-256",n);return Array.from(new Uint8Array(o),a=>a.toString(16).padStart(2,"0")).join("")}s(_,"canonicalSha256");function M(t,n,o){let a=B(t);if(a>n)throw new c("payload_too_large",`${o} is ${a} bytes; the maximum is ${n} bytes.`)}s(M,"assertCanonicalPayloadSize");function T(t,n,o){let a=new TextEncoder().encode(t).byteLength;if(a>n)throw new c("response_too_large",`${o} is ${a} bytes; the maximum is ${n} bytes.`);try{return JSON.parse(t)}catch{throw new c("invalid_json",`${o} was not valid JSON.`)}}s(T,"parseBoundedJson");async function C(t,n,o){let a=t.body?.getReader();if(!a)return T("",n,o);let r=new TextDecoder,l=0,m="";try{for(;;){let d=await a.read();if(d.done)break;if(l+=d.value.byteLength,l>n)throw new c("response_too_large",`${o} exceeds the maximum of ${n} bytes.`);m+=r.decode(d.value,{stream:!0})}return m+=r.decode(),T(m,n,o)}catch(d){try{await a.cancel()}catch{}throw d}finally{try{a.releaseLock()}catch{}}}s(C,"readBoundedJsonResponse");function w(t){if(t===null||typeof t=="string"||typeof t=="boolean")return t;if(typeof t=="number"){if(!Number.isFinite(t))throw new c("non_json_value","Canonical JSON cannot contain a non-finite number.");return Object.is(t,-0)?0:t}if(Array.isArray(t))return t.map(n=>w(n));if(typeof t=="object"){let n=Object.getPrototypeOf(t);if(n!==Object.prototype&&n!==null)throw new c("non_json_value","Canonical JSON accepts only plain objects.");let o=Object.create(null);for(let a of Object.keys(t).sort()){let r=t[a];if(r===void 0||typeof r=="function"||typeof r=="symbol")throw new c("non_json_value",`Canonical JSON cannot contain ${typeof r} at ${a}.`);o[a]=w(r)}return o}throw new c("non_json_value",`Canonical JSON cannot contain ${typeof t}.`)}s(w,"normalizeCanonicalJson");var g=e.string().trim().min(1).max(191),j=e.string().regex(/^[a-f0-9]{64}$/),L=e.string().min(1).max(191).regex(/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/),G=e.discriminatedUnion("mode",[e.object({mode:e.literal("automatic"),objective:e.enum(["balanced","fast","economical"]),gpuCount:e.union([e.literal(1),e.literal(2)]).optional()}).strict(),e.object({mode:e.literal("manual"),availabilityId:g,gpuType:e.string().trim().min(1).max(256),gpuCount:e.union([e.literal(1),e.literal(2)]).optional()}).strict()]),_e=e.object({estimateId:g,inputHash:j,requestHash:j,pricingVersion:g,expiresAt:e.string().datetime({offset:!0}),token:e.string().min(1).max(8192)}).strict(),$=e.object({teamId:g,modelId:e.string().trim().min(1).max(256),modelRevision:e.string().trim().min(1).max(256),tokenizerRevision:e.string().trim().min(1).max(256),chatTemplateHash:j,method:e.enum(["sft","grpo"]),loraRank:e.number().int().min(1).max(256),gpuCount:e.union([e.literal(1),e.literal(2)])}).strict(),V=e.object({query:$,requestHash:j,qualification:e.enum(["requires_preparation","unsupported"]),reason:e.enum(["model_not_supported","lora_rank_not_supported","gpu_count_not_qualified","provider_not_supported"]).nullable(),provider:e.object({accountScopeId:g,product:e.literal("POD"),cloud:e.literal("SECURE"),countryCodes:e.array(e.string().regex(/^[A-Z]{2}$/)).min(1).max(300),cudaVersions:e.array(e.string().regex(/^\d+\.\d+$/)).min(1).max(100),dataCenterId:g.nullable(),minimumDiskGb:e.number().int().positive(),priceBasis:e.literal("provider_catalog_per_gpu_rate_times_count")}).strict().nullable()}).strict(),z=e.object({schemaVersion:e.literal("openpond.trainingGpuCatalog.v1"),observedAt:e.string().datetime({offset:!0}),expiresAt:e.string().datetime({offset:!0}),workerImageDigest:e.string().regex(/^sha256:[a-f0-9]{64}$/),supportedLoraRanks:e.array(e.number().int().positive()),pricingBasis:e.enum(["accepted_compute_and_disk_hourly_before_credits","provider_catalog_compute_and_disk_before_credits"]),scope:V.optional(),offerings:e.array(e.object({availabilityId:g,gpuType:e.string().min(1).max(256),provider:L,region:e.string().min(1),dataCenterId:e.string().nullable(),gpuCount:e.number().int().positive(),gpuMemoryGb:e.number().positive(),stockStatus:e.enum(["High","Medium","Low"]),computeHourlyUsd:e.number().nonnegative(),diskHourlyUsd:e.number().nonnegative(),totalHourlyUsd:e.number().nonnegative()}).strict()).max(1e3)}).strict();async function Y(t,n){let o=z.parse(t);if(Date.parse(o.expiresAt)<=Date.parse(o.observedAt)||Date.parse(o.expiresAt)<=Date.now())throw new c("training_gpu_catalog_expired","Refresh GPU availability before reviewing this run.");if(!n){if(o.scope)throw new c("training_gpu_catalog_scope_mismatch","An overview read returned an unrequested workload.");return o}let a=o.scope;if(!a||o.pricingBasis!=="provider_catalog_compute_and_disk_before_credits"||h(a.query)!==h(n)||a.requestHash!==await _(n)||a.qualification==="unsupported"!=(a.reason!==null)||(a.qualification==="unsupported"?a.provider!==null||o.offerings.length>0:!a.provider)||new Set(o.offerings.map(r=>r.provider)).size>1||o.offerings.some(r=>r.gpuCount!==n.gpuCount||r.dataCenterId!==a.provider?.dataCenterId)||new Set(o.offerings.map(r=>r.availabilityId)).size!==o.offerings.length)throw new c("training_gpu_catalog_scope_mismatch","The GPU offers do not match this workspace and workload.");return o}s(Y,"parseAndVerifyTrainingGpuCatalog");function ye(t){return{async gpuCatalog(n){let o=n===void 0?void 0:$.parse(n),a=o?new URLSearchParams(Object.entries(o).map(([m,d])=>[m,String(d)])):null,r=await t(`/v1/training/gpu-catalog${a?`?${a}`:""}`),l=r&&typeof r=="object"&&"catalog"in r?r.catalog:r;return Y(l,o)}}}s(ye,"createTrainingGpuCatalogClient");var i=e.string().trim().min(1).max(500),p=e.string().regex(/^[a-f0-9]{64}$/),u=e.string().datetime({offset:!0}),f=e.object({id:i,contentHash:p}).strict(),R=f.extend({revision:e.number().int().positive()}).strict(),v=e.object({schemaVersion:e.literal("openpond.baseModelPreference.v1"),modelId:i,revision:e.string().trim().min(1).max(256).nullable(),tokenizerRevision:e.string().trim().min(1).max(256).nullable(),chatTemplateHash:e.string().trim().min(8).max(256).nullable(),modelAssetId:i.nullable(),source:e.enum(["managed","local","builtin"])}).strict(),H=e.enum(["sft","dpo","grpo","ppo","sdft","opd","opsd","sdpo"]),X=e.object({schemaVersion:e.string().regex(/^openpond\.[A-Za-z0-9]+Recipe\.v\d+$/),method:H,parameterization:e.enum(["lora","full"])}).catchall(e.unknown()),Z=e.object({profileProjectId:i,sourceRevision:e.string().regex(/^[a-f0-9]{40,64}$/),harnessRelease:f}).strict(),F=e.object({profileProjectId:i,sourceRevision:e.string().regex(/^[a-f0-9]{40,64}$/),catalogHash:p,definitionId:i,harnessRelease:f,tasksetRelease:f}).strict(),D=e.object({tasksetRef:R.nullable().default(null),evaluationTasksetRef:R.nullable().optional(),profileSource:Z.nullable().optional(),profileEvaluation:F.nullable().optional(),rewardBindingRef:R.nullable().optional(),tasksetRelease:f.nullable().default(null),harnessRelease:f.nullable().default(null),baseModel:v.nullable().default(null),method:H.nullable().default(null),destinationId:i.nullable().default(null),managedRolloutPlacement:e.enum(["local","remote"]).default("remote"),managedGpuPlacementObjective:e.enum(["fast","balanced","economical"]).default("balanced"),managedGpuSelection:G.optional(),continuationAdapterMode:e.enum(["residual_append","shared","sequential_merge"]).optional(),managedGpuRequirement:e.enum(["any","h100_hbm3"]).default("any"),runPreset:e.enum(["small","standard","custom","small_experiment"]).nullable().default(null),recipe:X.nullable().default(null),preferredMaximumSpendUsd:e.number().nonnegative().nullable().default(null),preferredRetentionDays:e.number().int().nonnegative().nullable().default(null)}).strict(),J=D,Q=e.object({schemaVersion:e.literal("openpond.hostedModelProjectLink.v1"),apiOrigin:e.string().url().refine(t=>new URL(t).origin===t,"Use a canonical API origin.").nullable().default(null),teamId:i,projectId:i,portableProjectId:i,revision:e.number().int().positive(),etag:p,syncedSourceRevision:e.number().int().positive(),syncedAt:u,tasksets:e.array(e.object({localTasksetId:i,localTasksetHash:p.nullable().default(null),releaseId:i,releaseRevision:e.number().int().positive(),releaseHash:p,packageHash:p.nullable().default(null),hostedTasksetId:i,syncedAt:u}).strict()).max(1e4).default([])}).strict(),K=e.object({localTasksetId:i,releaseId:i,releaseRevision:e.number().int().positive(),releaseHash:p,state:e.enum(["syncing","synced","sync_failed"]),hostedTasksetId:i.nullable().default(null),lastAttemptAt:u,syncedAt:u.nullable().default(null),lastError:e.string().trim().min(1).max(5e3).nullable().default(null)}).strict(),W=e.object({schemaVersion:e.literal("openpond.modelProject.v2"),id:i,profileId:i,revision:e.number().int().positive().default(1),name:e.string().trim().min(1).max(200),objective:e.string().trim().max(5e3).nullable(),defaultBaseModel:v.nullable(),defaultDestinationId:i.nullable(),trainingSetup:D,hosted:Q.nullable().default(null),tasksetSyncs:e.array(K).max(1e4).default([]),createdAt:u,updatedAt:u}).strict(),q=W.pick({id:!0,profileId:!0,name:!0,objective:!0,defaultBaseModel:!0,defaultDestinationId:!0,trainingSetup:!0}),ee=e.object({schemaVersion:e.literal("openpond.modelProjectSave.v1"),operationId:i,expectedRevision:e.number().int().nonnegative(),project:q,learning:I.optional()}).strict().superRefine((t,n)=>{t.learning&&t.expectedRevision!==0&&n.addIssue({code:"custom",path:["learning"],message:"Use learning settings to edit an existing Model's policy."})}),te=e.object({schemaVersion:e.literal("openpond.modelProjectConfigurationCheck.v1"),configurationHash:p,projectId:i,expectedRevision:e.number().int().nonnegative(),checkedAt:u,canSave:e.boolean(),deferred:e.array(e.enum(["base_model","taskset"])).max(2),findings:e.array(e.object({code:i,severity:e.enum(["error","warning"]),message:e.string().min(1).max(5e3),field:e.string().min(1).max(500).nullable()}).strict()).max(100)}).strict(),ne=e.object({id:i,name:e.string().min(1).max(500),available:e.boolean(),preference:v}).strict();async function Se(t){let n=S(t);return _({project:n.project,expectedRevision:n.expectedRevision,...n.learning?{learning:n.learning}:{}})}s(Se,"modelProjectConfigurationHash");function S(t){try{P(t,b)}catch{throw new U(400,{schemaVersion:"openpond.modelProjectApiError.v2",code:"model_configuration_json_invalid",message:"Model configuration must be bounded JSON data.",retryable:!1,requestId:null,details:{}})}return ee.parse(t)}s(S,"parseModelProjectSaveRequest");async function Pe(t,n,o){P(t,b);let a=q.parse(t);M(a,b,"Model configuration");let r=o?I.parse(o):void 0,l=await _({project:a,expectedRevision:n,...r?{learning:r}:{}});return S({schemaVersion:"openpond.modelProjectSave.v1",operationId:`model-save:${l}`,expectedRevision:n,project:a,...r?{learning:r}:{}})}s(Pe,"createModelProjectSaveRequest");var ae=e.object({schemaVersion:e.literal("openpond.hostedModelProjectSync.v2"),portableProjectId:i,name:e.string().trim().min(1).max(200),objective:e.string().trim().max(5e3).nullable(),defaultBaseModel:v.nullable(),defaultDestinationId:i.nullable(),trainingSetup:J,sourceRevision:e.number().int().positive(),sourceUpdatedAt:u,expectedEtag:p.nullable().default(null)}).strict(),y=e.object({id:i,teamId:i,portableProjectId:i,name:e.string().trim().min(1).max(200),objective:e.string().trim().max(5e3).nullable(),defaultBaseModel:v.nullable(),defaultDestinationId:i.nullable(),trainingSetup:J,sourceRevision:e.number().int().positive(),sourceUpdatedAt:u,revision:e.number().int().positive(),etag:p,createdAt:u,updatedAt:u}).strict(),re=e.object({kind:e.enum(["taskset_release","harness_release","dataset_release","evidence_set","model_version","reward_model_version","evaluation_receipt"]),ref:f,role:e.string().trim().min(1).max(200).nullable().default(null),updatedAt:u}).strict(),oe=e.object({project:y,resources:e.array(re).max(1e4),jobCount:e.number().int().nonnegative(),latestJobIds:e.array(i).max(100)}).strict(),ie=e.object({schemaVersion:e.literal("openpond.modelProjectApiError.v2"),code:e.string().trim().min(1).max(200),message:e.string().trim().min(1).max(5e3),retryable:e.boolean().default(!1),requestId:e.string().trim().min(1).max(500).nullable().default(null),details:e.record(e.string(),e.unknown()).default({})}).strict(),U=class extends Error{static{s(this,"OpenPondModelProjectApiError")}status;code;retryable;requestId;details;constructor(t,n){super(n.message),this.name="OpenPondModelProjectApiError",this.status=t,this.code=n.code,this.retryable=n.retryable,this.requestId=n.requestId,this.details=n.details}};function k(t){let n={};return new Headers(t).forEach((o,a)=>{n[a]=o}),n}s(k,"headersRecord");function Ie(t){let n=t.fetch??fetch,o=t.baseUrl.replace(/\/$/,"");async function a(r,l){let m=typeof t.headers=="function"?await t.headers():t.headers??{},d=await n(`${o}${r}`,{...l,headers:{accept:x,...l?.body?{"content-type":x}:{},...k(m),...k(l?.headers)}}),A=await C(d,E,"Model Project API response");if(!d.ok){let O=ie.safeParse(A);throw O.success?new U(d.status,O.data):new c("invalid_error_response",`Model Project request failed with HTTP ${d.status} and an invalid error envelope.`)}return A}return s(a,"request"),{async configurationCandidates(){return e.object({candidates:e.array(ne).max(1e3)}).strict().parse(await a("/v1/model-projects/configuration/candidates",{headers:{accept:"application/json"}})).candidates},async checkConfiguration(r){let l=S(r);return te.parse(await a("/v1/model-projects/configuration/check",{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(l)}))},async saveConfiguration(r){let l=S(r);return y.parse(await a("/v1/model-projects/configuration/save",{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(l)}))},async upsert(r){M(r,b,"Model Project sync");let l=ae.parse(r),m=await a(`/v1/model-projects/${encodeURIComponent(l.portableProjectId)}`,{method:"PUT",body:JSON.stringify(l)});return y.parse(N(m,"project"))},async list(){let r=await a("/v1/model-projects");return e.array(y).parse(N(r,"projects"))},async get(r){let l=await a(`/v1/model-projects/${encodeURIComponent(i.parse(r))}`);return oe.parse(l)}}}s(Ie,"createModelProjectsClient");function N(t,n){return!t||typeof t!="object"||Array.isArray(t)?t:n in t?t[n]:t}s(N,"unwrapObject");export{se as a,le as b,x as c,ce as d,de as e,ue as f,b as g,E as h,c as i,h as j,B as k,_ as l,M as m,T as n,C as o,G as p,_e as q,$ as r,V as s,z as t,Y as u,ye as v,f as w,R as x,v as y,H as z,X as A,Z as B,F as C,D,J as E,Q as F,K as G,W as H,q as I,ee as J,te as K,ne as L,Se as M,S as N,Pe as O,ae as P,y as Q,re as R,oe as S,ie as T,U,Ie as V};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{F as d}from"./chunk-HG2YFMVU.js";import{a as n}from"./chunk-FTQLQJQV.js";import{access as m,readFile as g}from"node:fs/promises";import{createHash as h}from"node:crypto";import o from"node:path";import{fileURLToPath as w}from"node:url";var i="openpond-taskset-authoring",f="artifact.json",u=o.dirname(w(import.meta.url));async function P(e=process.cwd()){return(await p(e)).bundle}n(P,"loadTasksetAuthoringSkillBundle");async function p(e=process.cwd()){let s=await k(e),t=JSON.parse(await g(o.join(s,f),"utf8"));if(t.schemaVersion!==1||t.skillName!==i||!t.artifactVersion||!t.bundle||!/^[a-f0-9]{64}$/.test(t.contentHash))throw new Error("Bundled Taskset Authoring artifact is invalid.");let{contentHash:r,...a}=t;if(h("sha256").update(JSON.stringify(a)).digest("hex")!==r)throw new Error("Bundled Taskset Authoring artifact hash does not match.");for(let l of t.files)if(h("sha256").update(l.contents).digest("hex")!==l.sha256)throw new Error(`Bundled Taskset Authoring file hash does not match: ${l.path}`);return t}n(p,"loadTasksetAuthoringSkillArtifact");async function S(e=process.cwd()){let s=await k(e),t=await p(e),r=t.bundle,a=d.find(c=>c.name===i);if(!a)throw new Error("Taskset Authoring skill metadata is missing.");return{...a,path:o.join(s,"SKILL.md"),sourcePath:s,charCount:r.length,sourceHash:t.contentHash,validationMessages:[...a.validationMessages],resourceFiles:[...a.resourceFiles]}}n(S,"loadTasksetAuthoringProfileSkill");async function O(e=process.cwd()){let s=await S(e),t=await P(e);return{name:s.name,description:s.description,body:t,path:s.path,sourceHash:s.sourceHash,charCount:s.charCount,packagePath:s.sourcePath,resourceFiles:s.resourceFiles}}n(O,"readTasksetAuthoringProfileSkill");async function k(e=process.cwd(),s=process.execPath){let t=[process.env.OPENPOND_TASKSET_AUTHORING_SKILL_ROOT,o.resolve(e,"apps","cli","skills",i),o.resolve(e,"dist","skills",i),o.resolve(o.dirname(s),"skills",i),o.resolve(u,"skills",i),o.resolve(u,"..","skills",i)].filter(r=>!!r);for(let r of t)if(await m(o.join(r,f)).then(()=>!0,()=>!1))return r;throw new Error(`Bundled Taskset Authoring skill was not found. Checked: ${t.join(", ")}`)}n(k,"resolveTasksetAuthoringSkillRoot");export{p as a,S as b,O as c};
2
+ import{F as d}from"./chunk-WXG3G2O6.js";import{a as n}from"./chunk-FTQLQJQV.js";import{access as m,readFile as g}from"node:fs/promises";import{createHash as h}from"node:crypto";import o from"node:path";import{fileURLToPath as w}from"node:url";var i="openpond-taskset-authoring",f="artifact.json",u=o.dirname(w(import.meta.url));async function P(e=process.cwd()){return(await p(e)).bundle}n(P,"loadTasksetAuthoringSkillBundle");async function p(e=process.cwd()){let s=await k(e),t=JSON.parse(await g(o.join(s,f),"utf8"));if(t.schemaVersion!==1||t.skillName!==i||!t.artifactVersion||!t.bundle||!/^[a-f0-9]{64}$/.test(t.contentHash))throw new Error("Bundled Taskset Authoring artifact is invalid.");let{contentHash:r,...a}=t;if(h("sha256").update(JSON.stringify(a)).digest("hex")!==r)throw new Error("Bundled Taskset Authoring artifact hash does not match.");for(let l of t.files)if(h("sha256").update(l.contents).digest("hex")!==l.sha256)throw new Error(`Bundled Taskset Authoring file hash does not match: ${l.path}`);return t}n(p,"loadTasksetAuthoringSkillArtifact");async function S(e=process.cwd()){let s=await k(e),t=await p(e),r=t.bundle,a=d.find(c=>c.name===i);if(!a)throw new Error("Taskset Authoring skill metadata is missing.");return{...a,path:o.join(s,"SKILL.md"),sourcePath:s,charCount:r.length,sourceHash:t.contentHash,validationMessages:[...a.validationMessages],resourceFiles:[...a.resourceFiles]}}n(S,"loadTasksetAuthoringProfileSkill");async function O(e=process.cwd()){let s=await S(e),t=await P(e);return{name:s.name,description:s.description,body:t,path:s.path,sourceHash:s.sourceHash,charCount:s.charCount,packagePath:s.sourcePath,resourceFiles:s.resourceFiles}}n(O,"readTasksetAuthoringProfileSkill");async function k(e=process.cwd(),s=process.execPath){let t=[process.env.OPENPOND_TASKSET_AUTHORING_SKILL_ROOT,o.resolve(e,"apps","cli","skills",i),o.resolve(e,"dist","skills",i),o.resolve(o.dirname(s),"skills",i),o.resolve(u,"skills",i),o.resolve(u,"..","skills",i)].filter(r=>!!r);for(let r of t)if(await m(o.join(r,f)).then(()=>!0,()=>!1))return r;throw new Error(`Bundled Taskset Authoring skill was not found. Checked: ${t.join(", ")}`)}n(k,"resolveTasksetAuthoringSkillRoot");export{p as a,S as b,O as c};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{h as i}from"./chunk-4PUOWSDE.js";import{A as e}from"./chunk-X2J2P5ZT.js";var t=i.extend({mode:e.enum(["nightly","approved_count"]),minimumTasks:e.number().int().min(1).max(1e4),maximumSpendUsd:e.number().positive().max(1e5),maximumDailySpendUsd:e.number().positive().max(1e6)}).strict().superRefine((m,a)=>{m.maximumDailySpendUsd<m.maximumSpendUsd&&a.addIssue({code:"custom",path:["maximumDailySpendUsd"],message:"The daily budget must cover one update."})});export{t as a};
2
+ import{h as i}from"./chunk-ZEOYNUHL.js";import{A as e}from"./chunk-X2J2P5ZT.js";var t=i.extend({mode:e.enum(["nightly","approved_count"]),minimumTasks:e.number().int().min(1).max(1e4),maximumSpendUsd:e.number().positive().max(1e5),maximumDailySpendUsd:e.number().positive().max(1e6)}).strict().superRefine((m,a)=>{m.maximumDailySpendUsd<m.maximumSpendUsd&&a.addIssue({code:"custom",path:["maximumDailySpendUsd"],message:"The daily budget must cover one update."})});export{t as a};