openpond 0.2.63 → 0.2.64
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.
- package/dist/app-server.d.ts +76 -2
- package/dist/app-server.js +1 -1
- package/dist/chunks/account-context-TIJOM22A.js +12 -0
- package/dist/chunks/acp-G5GCLP44.js +2 -0
- package/dist/chunks/acp-agent-JM5THNMF.js +19 -0
- package/dist/chunks/actions-command-VLKMHCMI.js +2 -0
- package/dist/chunks/app-layer-DZHMJUBC.js +3 -0
- package/dist/chunks/app-server-connected-apps-IB6M35NS.js +2 -0
- package/dist/chunks/app-server-evaluations-V6LRWDUF.js +2 -0
- package/dist/chunks/app-server-harness-services-6ZRLA3YD.js +2 -0
- package/dist/chunks/app-server-runtime-6LCX46RF.js +2 -0
- package/dist/chunks/apps-7LPKIYRY.js +2 -0
- package/dist/chunks/{chunk-NZTCH6K5.js → chunk-2GJD23CM.js} +1 -1
- package/dist/chunks/{chunk-BKEDG3A4.js → chunk-2MEOUS24.js} +1 -1
- package/dist/chunks/{chunk-DUL6DXOI.js → chunk-2W22IXHB.js} +1 -1
- package/dist/chunks/{chunk-GGJUWIGR.js → chunk-36FNNR5N.js} +1 -1
- package/dist/chunks/chunk-3BJ7LPE3.js +2 -0
- package/dist/chunks/chunk-3MVKXAH7.js +2 -0
- package/dist/chunks/{chunk-UTNGEMW5.js → chunk-3WJQ4IGK.js} +1 -1
- package/dist/chunks/{chunk-G6OR5NB6.js → chunk-4D3CICBG.js} +1 -1
- package/dist/chunks/chunk-4DYWVGVS.js +2 -0
- package/dist/chunks/{chunk-KUPJNBWG.js → chunk-4JYTFEND.js} +1 -1
- package/dist/chunks/chunk-4MQHIFZL.js +2 -0
- package/dist/chunks/chunk-4TO743HO.js +4 -0
- package/dist/chunks/{chunk-B4RKHHF7.js → chunk-4TTXNVCE.js} +1 -1
- package/dist/chunks/{chunk-3YXYBYWK.js → chunk-4V73I4OL.js} +1 -1
- package/dist/chunks/chunk-55Q64WWF.js +2 -0
- package/dist/chunks/{chunk-F7QTIHXX.js → chunk-5AU5Y6KS.js} +1 -1
- package/dist/chunks/chunk-5HPZGLOL.js +2 -0
- package/dist/chunks/{chunk-LCSBCCYC.js → chunk-5JVJQA5H.js} +1 -1
- package/dist/chunks/chunk-5KJMFK65.js +2 -0
- package/dist/chunks/{chunk-BSPFY3Y5.js → chunk-5KWKSR4P.js} +1 -1
- package/dist/chunks/chunk-5WPMI6QX.js +2 -0
- package/dist/chunks/{chunk-SHJY5RLU.js → chunk-5Z3AU5CL.js} +1 -1
- package/dist/chunks/{chunk-DQI5TE6A.js → chunk-66HFW4OU.js} +1 -1
- package/dist/chunks/{chunk-NT7N6KLE.js → chunk-67HXM6AL.js} +1 -1
- package/dist/chunks/{chunk-J7ZTPXRQ.js → chunk-6C3CXME7.js} +1 -1
- package/dist/chunks/{chunk-PWK5Z5S3.js → chunk-6ESBAHWK.js} +1 -1
- package/dist/chunks/{chunk-XNOMIWEY.js → chunk-6I5AUTVO.js} +1 -1
- package/dist/chunks/{chunk-OG33QAG6.js → chunk-6S2MWJVD.js} +1 -1
- package/dist/chunks/{chunk-KCOTDUGW.js → chunk-6TRVEA3T.js} +1 -1
- package/dist/chunks/chunk-6ZTP6CUJ.js +2 -0
- package/dist/chunks/{chunk-4L6DU6Z2.js → chunk-7FBWUVX7.js} +1 -1
- package/dist/chunks/{chunk-GPL2Z65R.js → chunk-7P5SH3CI.js} +2 -2
- package/dist/chunks/chunk-7PKTCMZ6.js +2 -0
- package/dist/chunks/chunk-7XOUM6RK.js +2 -0
- package/dist/chunks/chunk-A77DLBR4.js +2 -0
- package/dist/chunks/chunk-AF3AVDPP.js +2 -0
- package/dist/chunks/{chunk-RV7PUSI2.js → chunk-AJXWJLZA.js} +1 -1
- package/dist/chunks/chunk-AMC4Z7G4.js +2 -0
- package/dist/chunks/chunk-ANG2YMMD.js +2 -0
- package/dist/chunks/{chunk-ZPTKR3GB.js → chunk-B32CW3NT.js} +1 -1
- package/dist/chunks/{chunk-Y766IN7Y.js → chunk-B666Z2NS.js} +1 -1
- package/dist/chunks/chunk-BJXPQIVD.js +2 -0
- package/dist/chunks/{chunk-WBUK73ST.js → chunk-BL3CZWWD.js} +1 -1
- package/dist/chunks/{chunk-XMHIQ3SK.js → chunk-BTJACFU3.js} +2 -2
- package/dist/chunks/{chunk-25XXZS3E.js → chunk-C5B3FMV3.js} +1 -1
- package/dist/chunks/chunk-CRDKBFRN.js +2 -0
- package/dist/chunks/chunk-CYQLXS2U.js +2 -0
- package/dist/chunks/{chunk-N4VHLJBZ.js → chunk-D7R2AAX2.js} +1 -1
- package/dist/chunks/{chunk-LSZJ5M3X.js → chunk-DAEUVT2I.js} +1 -1
- package/dist/chunks/{chunk-ELX7VRSU.js → chunk-DIDQHTAX.js} +1 -1
- package/dist/chunks/chunk-DMO3UIS7.js +6 -0
- package/dist/chunks/{chunk-4BJGUCHY.js → chunk-DRMOHADV.js} +1 -1
- package/dist/chunks/{chunk-FYYYECHE.js → chunk-DSJZS77R.js} +4 -4
- package/dist/chunks/{chunk-7HRLWPPZ.js → chunk-DXA2UHBE.js} +1 -1
- package/dist/chunks/{chunk-T6JN4PND.js → chunk-EBOTNBUS.js} +1 -1
- package/dist/chunks/chunk-ECOH24MC.js +9 -0
- package/dist/chunks/{chunk-6PKXJEJM.js → chunk-EICS777E.js} +1 -1
- package/dist/chunks/{chunk-4SZ3HKHU.js → chunk-EVQISX7M.js} +1 -1
- package/dist/chunks/{chunk-2HAWOMZK.js → chunk-EW7CD7OA.js} +1 -1
- package/dist/chunks/chunk-FEQ7HNJR.js +2 -0
- package/dist/chunks/{chunk-IWWXIUAQ.js → chunk-FHLSLOKH.js} +8 -8
- package/dist/chunks/{chunk-BU27SLZP.js → chunk-FS2VKOT7.js} +1 -1
- package/dist/chunks/{chunk-4FNCBA3Y.js → chunk-FUFI4THX.js} +1 -1
- package/dist/chunks/{chunk-W5W4IODW.js → chunk-FYWQWKVS.js} +1 -1
- package/dist/chunks/{chunk-IZ56L2ZK.js → chunk-G4747MOW.js} +1 -1
- package/dist/chunks/{chunk-J572ANHX.js → chunk-G4E3WGLM.js} +4 -4
- package/dist/chunks/{chunk-P7HRF4FM.js → chunk-GD3RCUDH.js} +1 -1
- package/dist/chunks/{chunk-HUCBKXTU.js → chunk-GDJ4X2ZN.js} +1 -1
- package/dist/chunks/{chunk-JHR3LF2F.js → chunk-GF55VEMR.js} +1 -1
- package/dist/chunks/{chunk-GXCUH2VV.js → chunk-GFAI2MCJ.js} +3 -3
- package/dist/chunks/{chunk-KOKX7PBS.js → chunk-GI7LTJV3.js} +1 -1
- package/dist/chunks/{chunk-TCOTXCV6.js → chunk-GIU3Z45P.js} +1 -1
- package/dist/chunks/chunk-GKLZQN6P.js +161 -0
- package/dist/chunks/{chunk-GXZCMO6S.js → chunk-GRLQHYAU.js} +2 -2
- package/dist/chunks/{chunk-M3SCON53.js → chunk-GUG2SWRZ.js} +1 -1
- package/dist/chunks/{chunk-JQRMDFF3.js → chunk-H42UW6IF.js} +1 -1
- package/dist/chunks/{chunk-EZRUWIP6.js → chunk-H5ML7735.js} +1 -1
- package/dist/chunks/{chunk-VNJAAYNQ.js → chunk-HIQPGYVH.js} +1 -1
- package/dist/chunks/{chunk-DLANLLKH.js → chunk-HNDAGZCF.js} +1 -1
- package/dist/chunks/{chunk-OE22TAXP.js → chunk-HNQPEOJD.js} +1 -1
- package/dist/chunks/chunk-HORMGT2Q.js +2 -0
- package/dist/chunks/{chunk-2V4LPUBH.js → chunk-HPTEJBP4.js} +1 -1
- package/dist/chunks/{chunk-R6VJDOQM.js → chunk-HQQJKWZY.js} +4 -4
- package/dist/chunks/{chunk-UWHIU24L.js → chunk-HVM2GUM3.js} +1 -1
- package/dist/chunks/{chunk-NEJLJ2XY.js → chunk-HX6GXMDK.js} +1 -1
- package/dist/chunks/chunk-I3NYYOSS.js +2 -0
- package/dist/chunks/{chunk-LV3CQ72P.js → chunk-I6VMRQF4.js} +1 -1
- package/dist/chunks/{chunk-QU4UE73E.js → chunk-IEVJLG3V.js} +1 -1
- package/dist/chunks/chunk-IOSBGCRT.js +2 -0
- package/dist/chunks/{chunk-SO42ZB5K.js → chunk-JBFPTEVE.js} +1 -1
- package/dist/chunks/{chunk-G32BO6M5.js → chunk-JD76ANPN.js} +1 -1
- package/dist/chunks/{chunk-ERJV5BMC.js → chunk-JFZ6USNQ.js} +1 -1
- package/dist/chunks/{chunk-UPWJSNL5.js → chunk-JLW5BQVO.js} +1 -1
- package/dist/chunks/chunk-JRGECNP3.js +2 -0
- package/dist/chunks/{chunk-DABBHWSF.js → chunk-KAWXVMHI.js} +1 -1
- package/dist/chunks/chunk-KGUPAPGR.js +2 -0
- package/dist/chunks/{chunk-AHOBCBVZ.js → chunk-KOKBDIGR.js} +1 -1
- package/dist/chunks/chunk-KTIBXRWQ.js +2 -0
- package/dist/chunks/chunk-L4EJ5R3B.js +23 -0
- package/dist/chunks/{chunk-SI5W5LBV.js → chunk-LARJARMS.js} +1 -1
- package/dist/chunks/{chunk-MPNJ2BB4.js → chunk-LE75SVEL.js} +1 -1
- package/dist/chunks/{chunk-ERT32RZA.js → chunk-LI3FTPAH.js} +5 -5
- package/dist/chunks/chunk-LK77GI6M.js +2 -0
- package/dist/chunks/chunk-LOIYNRBC.js +33 -0
- package/dist/chunks/{chunk-7WYL2IDD.js → chunk-LXZLLTYQ.js} +1 -1
- package/dist/chunks/{chunk-RZUCVF2Q.js → chunk-LYVHYT3L.js} +1 -1
- package/dist/chunks/{chunk-MWXW2CA6.js → chunk-LZPCA6DH.js} +1 -1
- package/dist/chunks/{chunk-GVARQXYI.js → chunk-M5QPL5NO.js} +1 -1
- package/dist/chunks/{chunk-WWQNMC7C.js → chunk-MCBRB5D6.js} +1 -1
- package/dist/chunks/chunk-MHPCVQOE.js +2 -0
- package/dist/chunks/chunk-MMJU6PZV.js +2 -0
- package/dist/chunks/chunk-MVPKU72J.js +4 -0
- package/dist/chunks/{chunk-AGVOGPAZ.js → chunk-MWS2NAHJ.js} +1 -1
- package/dist/chunks/{chunk-R6WMY6AH.js → chunk-NTM3KQ25.js} +1 -1
- package/dist/chunks/chunk-NXN7GJOH.js +2 -0
- package/dist/chunks/chunk-O6ZYDHEJ.js +3 -0
- package/dist/chunks/chunk-OKEC2EIE.js +2 -0
- package/dist/chunks/{chunk-KCV5VN4X.js → chunk-OKKNDQJF.js} +1 -1
- package/dist/chunks/{chunk-ZYVHOVKL.js → chunk-OPTJYDZN.js} +1 -1
- package/dist/chunks/{chunk-NJLULBTM.js → chunk-OTDDXEQ6.js} +1 -1
- package/dist/chunks/{chunk-RDSVU6F6.js → chunk-OTUS7NTQ.js} +1 -1
- package/dist/chunks/{chunk-UH4JSSRL.js → chunk-OTXGAKFH.js} +8 -8
- package/dist/chunks/chunk-OW3EOC5Q.js +4 -0
- package/dist/chunks/chunk-OXRVILDW.js +2 -0
- package/dist/chunks/{chunk-JEISPWWM.js → chunk-PWKJ5KLZ.js} +1 -1
- package/dist/chunks/{chunk-RFMME46Z.js → chunk-PYNW5OFA.js} +1 -1
- package/dist/chunks/{chunk-AKGCM53D.js → chunk-Q3WXB465.js} +1 -1
- package/dist/chunks/{chunk-KHTAAVC2.js → chunk-Q4AXZY2P.js} +1 -1
- package/dist/chunks/{chunk-QJ6KUVAR.js → chunk-QAEZNFAM.js} +1 -1
- package/dist/chunks/{chunk-ABF3W2MO.js → chunk-QAFXQHHG.js} +2 -2
- package/dist/chunks/chunk-QCJY6FTC.js +3 -0
- package/dist/chunks/{chunk-5MHYGMJG.js → chunk-QJJNHKLT.js} +1 -1
- package/dist/chunks/{chunk-ERL2M773.js → chunk-QYQZQVVN.js} +1 -1
- package/dist/chunks/{chunk-VVNV4NNW.js → chunk-RCT3O3HQ.js} +1 -1
- package/dist/chunks/{chunk-7R56WC7L.js → chunk-RHMULF56.js} +1 -1
- package/dist/chunks/chunk-RRWL5BHZ.js +2 -0
- package/dist/chunks/{chunk-RG3NH6YQ.js → chunk-S4WILIRA.js} +1 -1
- package/dist/chunks/{chunk-N33D7KCW.js → chunk-S6UCVXBC.js} +1 -1
- package/dist/chunks/{chunk-IHB5GTOJ.js → chunk-SAZTOGX6.js} +3 -3
- package/dist/chunks/{chunk-2EPR4HLF.js → chunk-SH7POUVX.js} +6 -6
- package/dist/chunks/chunk-SQX22LQT.js +10 -0
- package/dist/chunks/{chunk-NLYZ5K7U.js → chunk-SSJV3VX7.js} +1 -1
- package/dist/chunks/chunk-TBODQT4W.js +2 -0
- package/dist/chunks/chunk-TGULVWPV.js +2 -0
- package/dist/chunks/{chunk-HIYQPZ7C.js → chunk-TPOAAJKA.js} +1 -1
- package/dist/chunks/{chunk-42V4NV2F.js → chunk-TVDZXDQW.js} +1 -1
- package/dist/chunks/{chunk-FVRII5XO.js → chunk-U2BD545L.js} +1 -1
- package/dist/chunks/chunk-UK5LGSGT.js +2 -0
- package/dist/chunks/{chunk-HFJUXKT5.js → chunk-ULJZ7NUF.js} +1 -1
- package/dist/chunks/chunk-UN2LKLGV.js +2 -0
- package/dist/chunks/{chunk-4NXEYPPX.js → chunk-UOFDKMRU.js} +1 -1
- package/dist/chunks/{chunk-2ITZW2CN.js → chunk-UTIELP6F.js} +1 -1
- package/dist/chunks/{chunk-NWQL6FNF.js → chunk-V3KEG6MI.js} +1 -1
- package/dist/chunks/{chunk-BPZOABMC.js → chunk-V3S2B6WU.js} +2 -2
- package/dist/chunks/{chunk-ZG6353RM.js → chunk-VD2TQCMH.js} +1 -1
- package/dist/chunks/{chunk-4ZBOYWQ3.js → chunk-VS2LOUCT.js} +1 -1
- package/dist/chunks/{chunk-V7KR74NO.js → chunk-VS3AMJEK.js} +1 -1
- package/dist/chunks/{chunk-YCZZ62C2.js → chunk-W22KWKF6.js} +1 -1
- package/dist/chunks/chunk-W7NXFRHN.js +2 -0
- package/dist/chunks/{chunk-DTTFUANI.js → chunk-WBO6FQHR.js} +2 -2
- package/dist/chunks/{chunk-5ZBLCWEJ.js → chunk-WJSJXK2N.js} +1 -1
- package/dist/chunks/{chunk-C2LAEGOW.js → chunk-WKHGXLJD.js} +2 -2
- package/dist/chunks/{chunk-H6C4MAUN.js → chunk-WLQEONBF.js} +1 -1
- package/dist/chunks/chunk-WLZJOCLA.js +10 -0
- package/dist/chunks/chunk-WMBOXX7G.js +2 -0
- package/dist/chunks/{chunk-PF56N7ZY.js → chunk-X2J2P5ZT.js} +5 -5
- package/dist/chunks/{chunk-AH26AQN7.js → chunk-XHBMK6LC.js} +1 -1
- package/dist/chunks/{chunk-ZZHXQCNB.js → chunk-Y3B6ZUE6.js} +1 -1
- package/dist/chunks/{chunk-WP2L2NY2.js → chunk-YBKDEEEH.js} +1 -1
- package/dist/chunks/chunk-YRDPVTEI.js +3 -0
- package/dist/chunks/{chunk-JORRZ4BB.js → chunk-YU4JYWCA.js} +1 -1
- package/dist/chunks/{chunk-CZ5R4JXZ.js → chunk-Z2TOBS3P.js} +1 -1
- package/dist/chunks/chunk-ZFJWA4JK.js +1 -0
- package/dist/chunks/chunk-ZSZXA7WB.js +2 -0
- package/dist/chunks/{chunk-LK2K3SPM.js → chunk-ZU3YBRXS.js} +2 -2
- package/dist/chunks/{chunk-5FU5RLML.js → chunk-ZUT4EM64.js} +1 -1
- package/dist/chunks/chunk-ZWW227M3.js +2 -0
- package/dist/chunks/chunk-ZY32SZ2P.js +3 -0
- package/dist/chunks/cli-TE7RP5H7.js +2 -0
- package/dist/chunks/client-I5MYOJEJ.js +2 -0
- package/dist/chunks/command-NDHFZAKA.js +13 -0
- package/dist/chunks/configuration-command-HPMGH7WR.js +2 -0
- package/dist/chunks/connected-app-executor-7DYMZCD7.js +2 -0
- package/dist/chunks/connected-evidence-FNHTBUDG.js +2 -0
- package/dist/chunks/{connected-starting-assets-JONPTII6.js → connected-starting-assets-O4X6D6BG.js} +1 -1
- package/dist/chunks/connection-GDWPMHPC.js +2 -0
- package/dist/chunks/{continual-Z7MO2PF6.js → continual-HQCFY7GN.js} +3 -3
- package/dist/chunks/core-commands-LEFFBKR7.js +2 -0
- package/dist/chunks/dataset-preparation-authoring-KWRTMKN6.js +4 -0
- package/dist/chunks/datasets-BWHI23IB.js +2 -0
- package/dist/chunks/desktop-test-XROQ7K5H.js +3 -0
- package/dist/chunks/dist-GR56E3QK.js +2 -0
- package/dist/chunks/dist-J4KHAVO3.js +2 -0
- package/dist/chunks/dist-O7HXZUBW.js +2 -0
- package/dist/chunks/enclave-7VLABNIX.js +2 -0
- package/dist/chunks/evaluation-coordination-JTQIKHW6.js +2 -0
- package/dist/chunks/experiment-improvements-2TV2DA3K.js +2 -0
- package/dist/chunks/experiments-VOCZ4DW3.js +2 -0
- package/dist/chunks/experiments-VUJ4SEMG.js +2 -0
- package/dist/chunks/experiments-signal-TSTEBORD.js +2 -0
- package/dist/chunks/{extension-ZM6NI5O5.js → extension-UH34ZF7N.js} +1 -1
- package/dist/chunks/{help-7HXFWIKS.js → help-OPN36XRA.js} +1 -1
- package/dist/chunks/host-profile-evaluation-tools-75EPCRSZ.js +2 -0
- package/dist/chunks/host-profile-external-dataset-YRKG2GL5.js +2 -0
- package/dist/chunks/hosted-app-server-composition-7WZ4RIX2.js +2 -0
- package/dist/chunks/hosted-experiment-improvement-NZTPZTDH.js +3 -0
- package/dist/chunks/hosted-harness-runtime-3AJGEIFD.js +2 -0
- package/dist/chunks/hosted-profile-candidate-3CAT3XBI.js +3 -0
- package/dist/chunks/hosted-profile-compiler-RXU626Q6.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-control-CBDRKJ5J.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-inspection-CHYKDYUQ.js +3 -0
- package/dist/chunks/hosted-profile-evaluation-preparation-H5S7JZMD.js +3 -0
- package/dist/chunks/hosted-tasksets-AMGDDB2R.js +2 -0
- package/dist/chunks/human-review-NVKBEYG5.js +2 -0
- package/dist/chunks/{import-6SI4BEKS.js → import-P5DCYMQ6.js} +2 -2
- package/dist/chunks/learning-NJLTGZFQ.js +2 -0
- package/dist/chunks/learning-XTY5VOTK.js +2 -0
- package/dist/chunks/local-harness-improvement-runtime-XEA73RGS.js +2 -0
- package/dist/chunks/local-harness-taskset-review-SW35G4DM.js +2 -0
- package/dist/chunks/local-scope-X3737QXT.js +2 -0
- package/dist/chunks/model-projects-GHWCKDON.js +2 -0
- package/dist/chunks/opchat-ZJ5DO4RT.js +3 -0
- package/dist/chunks/opchat-bounded-chat-JVZ5LRH2.js +2 -0
- package/dist/chunks/organizations-UKXORVYS.js +2 -0
- package/dist/chunks/{profile-O5HL5DTQ.js → profile-XL5LABHR.js} +1 -1
- package/dist/chunks/profile-training-source-VIND2MM2.js +2 -0
- package/dist/chunks/project-action-payload-2G57RL74.js +2 -0
- package/dist/chunks/project-agent-CCGEMNR7.js +2 -0
- package/dist/chunks/published-experiment-source-D3C2AWQD.js +2 -0
- package/dist/chunks/refiner-profile-service-PPGGNVOV.js +2 -0
- package/dist/chunks/{runtime-XBA744HJ.js → runtime-VSOOPNYN.js} +2 -2
- package/dist/chunks/sandbox-command-L6BMKDGY.js +2 -0
- package/dist/chunks/{sandbox-template-27U3FQN7.js → sandbox-template-QL5ID5GJ.js} +1 -1
- package/dist/chunks/saved-work-LAVTNKPT.js +2 -0
- package/dist/chunks/send-turn-D3GTSSHI.js +2 -0
- package/dist/chunks/setup-HSRCZ3WR.js +2 -0
- package/dist/chunks/{src-PU7QTFO5.js → src-662QOKNP.js} +1 -1
- package/dist/chunks/{src-BLWX6DRG.js → src-KWOSLOBH.js} +117 -117
- package/dist/chunks/standalone-experiment-turn-owner-KKYIGGPF.js +2 -0
- package/dist/chunks/stdio-Z65UIX55.js +2 -0
- package/dist/chunks/store-chat-resources-ZWDYMDJF.js +2 -0
- package/dist/chunks/{store-continual-support-reviews-FOMYYS25.js → store-continual-support-reviews-7PDLGRWF.js} +1 -1
- package/dist/chunks/store-conversation-serving-WRT4N7N2.js +2 -0
- package/dist/chunks/{store-create-improve-3LQMIYAP.js → store-create-improve-G46KIUVT.js} +1 -1
- package/dist/chunks/{store-datasets-3KSX7RSO.js → store-datasets-O67F75BL.js} +1 -1
- package/dist/chunks/store-evaluation-results-BEPR4LVD.js +7 -0
- package/dist/chunks/{store-harness-memory-2L7ARBR4.js → store-harness-memory-4XEUITXE.js} +1 -1
- package/dist/chunks/{store-harness-refinement-candidates-3PHL3BUY.js → store-harness-refinement-candidates-LCN4NV23.js} +1 -1
- package/dist/chunks/store-harness-workspaces-PJJQ74G6.js +2 -0
- package/dist/chunks/store-human-review-HJ3D7ZFA.js +7 -0
- package/dist/chunks/store-learned-preference-migration-validation-EXNRDHCO.js +2 -0
- package/dist/chunks/store-learning-6P6IS7GH.js +2 -0
- package/dist/chunks/store-learning-credentials-EGJ2WTZI.js +2 -0
- package/dist/chunks/{store-local-experiments-QTVHJAEP.js → store-local-experiments-CBJA56X2.js} +1 -1
- package/dist/chunks/store-model-batch-review-YIVD7T2T.js +2 -0
- package/dist/chunks/{store-model-configuration-3SU73CMS.js → store-model-configuration-T6XJJDAB.js} +2 -2
- package/dist/chunks/store-model-project-preparation-WWU5CJTV.js +2 -0
- package/dist/chunks/{store-preference-comparison-DWV5XSMY.js → store-preference-comparison-XQFTLMGH.js} +1 -1
- package/dist/chunks/{store-schedules-2KUY4T6M.js → store-schedules-JPFVWL3Q.js} +1 -1
- package/dist/chunks/{store-sidebar-file-bookmarks-A4XCS7RM.js → store-sidebar-file-bookmarks-J3JEVAYR.js} +1 -1
- package/dist/chunks/{store-sidebar-preferences-V2PKRXUZ.js → store-sidebar-preferences-2JHTFXJK.js} +1 -1
- package/dist/chunks/{store-subagents-UGVEFA6M.js → store-subagents-PUBQVWSU.js} +1 -1
- package/dist/chunks/{store-task-inbox-QABI4ZAH.js → store-task-inbox-VVXZUJIO.js} +1 -1
- package/dist/chunks/{store-task-inventory-GEQIZELY.js → store-task-inventory-MQX44AI6.js} +1 -1
- package/dist/chunks/store-taskset-drafts-G3WFVN4M.js +9 -0
- package/dist/chunks/{store-training-CQV7PL3V.js → store-training-DUVIDYK5.js} +1 -1
- package/dist/chunks/{store-training-jobs-XKN6K66J.js → store-training-jobs-HHFH3V5O.js} +1 -1
- package/dist/chunks/{store-training-models-Q7DTTR4S.js → store-training-models-C7UUZDTO.js} +1 -1
- package/dist/chunks/{store-usage-XGAX7NLB.js → store-usage-6DMZM7WV.js} +1 -1
- package/dist/chunks/{store-work-evidence-VSLLZ6UF.js → store-work-evidence-77B36LRC.js} +1 -1
- package/dist/chunks/taskset-7FQCJ55X.js +2 -0
- package/dist/chunks/taskset-packages-NRRPON7B.js +2 -0
- package/dist/chunks/taskset-packages-RW4SFGDU.js +2 -0
- package/dist/chunks/{teams-bot-UTQAJA6H.js → teams-bot-LGV7UKX2.js} +1 -1
- package/dist/chunks/tool-learning-NGO7QHYK.js +2 -0
- package/dist/chunks/training-XFM3OOPN.js +2 -0
- package/dist/chunks/training-XILDD5RG.js +2 -0
- package/dist/chunks/training-error-LQKCOQDJ.js +2 -0
- package/dist/chunks/training-hardware-ESXRWUIK.js +3 -0
- package/dist/chunks/training-hosted-6BX2IASC.js +2 -0
- package/dist/chunks/training-hosted-checkpoint-evaluation-UXFW33QL.js +2 -0
- package/dist/chunks/training-hosted-learning-YN5VD3PW.js +2 -0
- package/dist/chunks/training-hosted-serving-N2MHWGZN.js +2 -0
- package/dist/chunks/training-hosted-serving-report-J4YOZLRP.js +2 -0
- package/dist/chunks/training-hosted-workers-6JTDCCWA.js +2 -0
- package/dist/chunks/training-model-start-E5MP3URL.js +2 -0
- package/dist/chunks/web-search-56QRZGPR.js +2 -0
- package/dist/chunks/workspaces-MCS2AQX6.js +2 -0
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/sandbox-template/manifest.js +1 -1
- package/dist/skills/manifest.json +1 -1
- package/dist/web/assets/App-BZuSv1XM.js +53 -0
- package/dist/web/assets/{AppDialog-8Y0FYalT.js → AppDialog-BILEK4np.js} +1 -1
- package/dist/web/assets/AppTerminalPanel-BvxZ8bwD.js +2 -0
- package/dist/web/assets/{AppToastContext-BiQbbVxq.js → AppToastContext-C-FsCKXW.js} +1 -1
- package/dist/web/assets/{AppsView-Dtte4h6e.js → AppsView-BMaq5oxx.js} +1 -1
- package/dist/web/assets/{AttachmentTypeIcon-DgADV7dn.js → AttachmentTypeIcon-Bh7Ft_UL.js} +1 -1
- package/dist/web/assets/{BrowserSidebar-BUqDvEv9.js → BrowserSidebar-BG2MLJ9I.js} +1 -1
- package/dist/web/assets/{CartesianChart-J4ChOjvG.js → CartesianChart-CS6ES_XT.js} +1 -1
- package/dist/web/assets/ChatTimelineEntry-Dr5X_XyN.js +8 -0
- package/dist/web/assets/{ChatTimelineEntry-DztFb85D.css → ChatTimelineEntry-vs8RaEGD.css} +1 -1
- package/dist/web/assets/{CollaborationTabs-CFCpk2Ck.js → CollaborationTabs-CPJ2w67F.js} +1 -1
- package/dist/web/assets/{CommandMenu-EPPjB14H.js → CommandMenu-Fe1V7NJd.js} +1 -1
- package/dist/web/assets/{CommunityView-Okydjpqm.js → CommunityView-DHTcmOnI.js} +1 -1
- package/dist/web/assets/{ComposerAttachments-RXCiE88M.js → ComposerAttachments-Ck9VWD6o.js} +1 -1
- package/dist/web/assets/{ComposerCreateImproveStrip-CSngc8-V.js → ComposerCreateImproveStrip-yiXO7cf8.js} +1 -1
- package/dist/web/assets/{ConversationImportsSettings-DS73kyfj.js → ConversationImportsSettings-_VLzUnHQ.js} +1 -1
- package/dist/web/assets/{FilePagePreview-Qc4B0vue.js → FilePagePreview-BpcM1DfE.js} +2 -2
- package/dist/web/assets/{GetStartedView-DGFPQ1We.js → GetStartedView-BH-WJ-rW.js} +1 -1
- package/dist/web/assets/{GettingStartedDialog-DFBYQdHz.js → GettingStartedDialog-CdQfj7RA.js} +1 -1
- package/dist/web/assets/{HostedModelLearningReview-BDu3FlcU.js → HostedModelLearningReview-C3GsOlu9.js} +1 -1
- package/dist/web/assets/{HostedModelLearningSettings-CHaTHwC8.js → HostedModelLearningSettings-SSMst6dl.js} +1 -1
- package/dist/web/assets/{HtmlVisual-D9Mh7xds.js → HtmlVisual-CH0tb3fv.js} +1 -1
- package/dist/web/assets/{LabModelVersionDetailPage-DgY7lAu5.js → LabModelVersionDetailPage-J2t9yILv.js} +1 -1
- package/dist/web/assets/{LabSkillSidebar-BwtlThO7.js → LabSkillSidebar-DdDYvfj2.js} +1 -1
- package/dist/web/assets/LabsRoute-MJwIjSKg.js +101 -0
- package/dist/web/assets/MainChatThread-BcwtaTDZ.js +2 -0
- package/dist/web/assets/MainPane-DDO6diPt.js +10 -0
- package/dist/web/assets/NativeSetupTerminal-BPSUFpRm.js +2 -0
- package/dist/web/assets/{NativeSkillSidebar-BEJvt5_H.js → NativeSkillSidebar-DPYavzau.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-CjrjgkTN.js → NewProjectDialog-BtmvE9Sp.js} +1 -1
- package/dist/web/assets/{OutputsPage-jzx93QQ3.js → OutputsPage-BMRY7RK2.js} +1 -1
- package/dist/web/assets/{PageChrome-C1M13qG2.js → PageChrome-5VRxH6Rp.js} +1 -1
- package/dist/web/assets/{ProjectsPage-DZrjlMp2.js → ProjectsPage-1LHqxOMo.js} +1 -1
- package/dist/web/assets/RightChatPanelStack-D_7KgExz.js +1 -0
- package/dist/web/assets/RightSidebarHomePanel-iznJwDMf.js +1 -0
- package/dist/web/assets/{ScheduledWorkPage-Cw1ja2GF.js → ScheduledWorkPage-Dtz4zJ0T.js} +1 -1
- package/dist/web/assets/{SettingsView-CckoIki3.js → SettingsView-BeDYNPcD.js} +3 -3
- package/dist/web/assets/{TasksetDraftEditorPrimitives-ByC8bDjp.js → TasksetDraftEditorPrimitives-CcvKO3YA.js} +1 -1
- package/dist/web/assets/{TeamChatView-OprnSKLF.js → TeamChatView-DaXxOkTe.js} +1 -1
- package/dist/web/assets/{TerminalOverlay-d7A2F9Lx.js → TerminalOverlay-CF8uB4qA.js} +1 -1
- package/dist/web/assets/{TrainingCreationPanel-Cyn6R6I6.js → TrainingCreationPanel-DmMO7x5T.js} +1 -1
- package/dist/web/assets/{TrainingDraftPanel-Mpb5e7t5.js → TrainingDraftPanel-DCHbXjSx.js} +1 -1
- package/dist/web/assets/{TrainingRunLineage-VcKz7dIR.js → TrainingRunLineage-CwisTWs_.js} +1 -1
- package/dist/web/assets/UsageSettingsSection-Drt7gwRb.js +7 -0
- package/dist/web/assets/WorkSidebarPanel-BrIIRtGW.js +1 -0
- package/dist/web/assets/WorkspaceDiffPanel-Dmbrg0-y.js +11 -0
- package/dist/web/assets/{WorkspaceEnvironmentMenu-C8y3537a.js → WorkspaceEnvironmentMenu-KEZm1gdb.js} +1 -1
- package/dist/web/assets/{WorkspaceFileLocation-LrEWj4UK.js → WorkspaceFileLocation-ChbOKrPO.js} +1 -1
- package/dist/web/assets/{WorkspaceGitDialogs-NRIMXnkS.js → WorkspaceGitDialogs-BS2JQKNQ.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-CvDGjKAL.js → WorkspaceMonacoEditor-CN1hE_C4.js} +3 -3
- package/dist/web/assets/{WorkspacePdfPreview-BZ0BbnHv.js → WorkspacePdfPreview-Clb4m0le.js} +2 -2
- package/dist/web/assets/{WorkspacePresentationPreview-DJrjrvT0.js → WorkspacePresentationPreview-CwQsdvAR.js} +1 -1
- package/dist/web/assets/app-models-Cz3yxq4x.js +1 -0
- package/dist/web/assets/{bot-6OhUEmkE.js → bot-BNFltD5O.js} +1 -1
- package/dist/web/assets/chat-resources-CTN4f6KC.js +1 -0
- package/dist/web/assets/{chevron-down-jmVA1BIf.js → chevron-down-BnnT0tnM.js} +1 -1
- package/dist/web/assets/chevron-right-C8K5PZj7.js +1 -0
- package/dist/web/assets/{chevron-up-CstyLXH3.js → chevron-up-BAnwJJN3.js} +1 -1
- package/dist/web/assets/chunk-GJRXJL6G-pJp1DyJd.js +9 -0
- package/dist/web/assets/chunk-TLSP5JKG-DZmxtX-4.js +1 -0
- package/dist/web/assets/{client-choice-storage-BdQ_YDuk.js → client-choice-storage-Iuzoszas.js} +1 -1
- package/dist/web/assets/{cloud-upload-Ck1ufAr8.js → cloud-upload-CdSXJ7ms.js} +1 -1
- package/dist/web/assets/{copy-CPkbMfXt.js → copy-CBFg6m0d.js} +1 -1
- package/dist/web/assets/{createLucideIcon-CXQny8HU.js → createLucideIcon-DF2VR6WA.js} +1 -1
- package/dist/web/assets/{cssMode-CYxYl_om.js → cssMode-BSQUZhUO.js} +1 -1
- package/dist/web/assets/{external-link-CDKOLG_v.js → external-link-Cql9bKdv.js} +1 -1
- package/dist/web/assets/{folder-open-CEtOb_lK.js → folder-open-BXdVB5J1.js} +1 -1
- package/dist/web/assets/{folder-plus-CVMYZs3e.js → folder-plus-Cma2HulC.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-DDyhPjxS.js → git-commit-horizontal-eF--16ps.js} +1 -1
- package/dist/web/assets/{htmlMode-DoY4V_j0.js → htmlMode-aLPlQtyU.js} +1 -1
- package/dist/web/assets/icons-c3vt7y6n.js +1 -0
- package/dist/web/assets/{image-B-PjDSwU.js → image-CqKPwnBn.js} +1 -1
- package/dist/web/assets/{index-D9WbJMSq.js → index-CM0IRu1U.js} +2 -2
- package/dist/web/assets/{info-CCnw-K3b.js → info-CqeYEqG0.js} +1 -1
- package/dist/web/assets/{jsonMode-CeOpZdPj.js → jsonMode-fu7bEcHB.js} +1 -1
- package/dist/web/assets/loader-circle-pxp89T5x.js +1 -0
- package/dist/web/assets/{lspLanguageFeatures-DAbgLCqZ.js → lspLanguageFeatures-DraXQA4w.js} +1 -1
- package/dist/web/assets/{maximize-2-BZX38cpr.js → maximize-2-yMp8X9ts.js} +1 -1
- package/dist/web/assets/{message-square-CvgSecgD.js → message-square-DbIMQqfj.js} +1 -1
- package/dist/web/assets/model-display-zPvC4L2B.js +1 -0
- package/dist/web/assets/models-route-CWcJuOd0.js +1 -0
- package/dist/web/assets/{monaco.contribution-cbDqt48m.js → monaco.contribution-BQhp1CJs.js} +2 -2
- package/dist/web/assets/{monaco.contribution-CF2JDhi4.js → monaco.contribution-Bd8EqYGR.js} +2 -2
- package/dist/web/assets/{monaco.contribution-m2ze2EsL.js → monaco.contribution-CYWKnVxQ.js} +2 -2
- package/dist/web/assets/{monaco.contribution-yeyow_-Q.js → monaco.contribution-CmbWO0tB.js} +2 -2
- package/dist/web/assets/{monitor-By0s4hxb.js → monitor-DFE2fTkT.js} +1 -1
- package/dist/web/assets/{paperclip-BJ2QgJLa.js → paperclip-D_qsKbVs.js} +1 -1
- package/dist/web/assets/{pdf-C4x-1jjP.js → pdf-DkQRsi4n.js} +1 -1
- package/dist/web/assets/play-BtlX2stU.js +1 -0
- package/dist/web/assets/plus-DbASL_gy.js +1 -0
- package/dist/web/assets/{presentation-I86G1Gd9.js → presentation-BN_kIBPL.js} +1 -1
- package/dist/web/assets/{python-CqFTPj8r.js → python-DB9pj5Hr.js} +1 -1
- package/dist/web/assets/{refresh-cw-Dga35Eay.js → refresh-cw-B27ohHfn.js} +1 -1
- package/dist/web/assets/{save-BLKjYtzR.js → save-D-rwjKop.js} +1 -1
- package/dist/web/assets/settings-lists-DgSaJQA4.js +5 -0
- package/dist/web/assets/square-C2caJ3NG.js +1 -0
- package/dist/web/assets/{square-terminal-B-n7vUex.js → square-terminal-CeoK51wH.js} +1 -1
- package/dist/web/assets/{submit-issue-command-B7Hrt2tU.js → submit-issue-command-DZNW7Evj.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-BhmBE5XE.js → toggleHighContrast-Bs8L1gx0.js} +1 -1
- package/dist/web/assets/{training-QrdkRQZQ.js → training-DCdoHJ0Y.js} +2 -2
- package/dist/web/assets/{training-model-data-DB-jg6L_.js → training-model-data-wHvE7xL1.js} +1 -1
- package/dist/web/assets/{tsMode-BSWEII2p.js → tsMode-C7EqshxC.js} +1 -1
- package/dist/web/assets/{upload-C4MPhQn8.js → upload-BWgjC2Jf.js} +1 -1
- package/dist/web/assets/{useAccountSettings-9oqWdRLs.js → useAccountSettings-Dva1MpsJ.js} +1 -1
- package/dist/web/assets/{useAgentInventory-isO79ui9.js → useAgentInventory-CrjIOmvb.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules-CZX6PxoK.js → useLocalAgentSchedules-P-UaUKMb.js} +1 -1
- package/dist/web/assets/{useQuery-BD0Uexmh.js → useQuery-Bn3KqR4r.js} +1 -1
- package/dist/web/assets/{wifi-off-Cloe0WuQ.js → wifi-off--mKrSPFc.js} +1 -1
- package/dist/web/assets/{workers-BXagz5eg.js → workers-p0Kn2KMK.js} +1 -1
- package/dist/web/assets/x-D9GTV9ke.js +1 -0
- package/dist/web/assets/{yaml-sBdvVbCc.js → yaml-BeIdC4tu.js} +1 -1
- package/dist/web/index.html +1 -1
- package/docs/command-reference.md +44 -2
- package/package.json +1 -1
- package/dist/chunks/acp-H3MJCPHX.js +0 -2
- package/dist/chunks/acp-agent-DWA7272M.js +0 -21
- package/dist/chunks/actions-command-IIYOO4LL.js +0 -2
- package/dist/chunks/app-layer-K7H2WJ56.js +0 -3
- package/dist/chunks/app-server-connected-apps-RM5E2VWF.js +0 -2
- package/dist/chunks/app-server-evaluations-XGMGS67X.js +0 -2
- package/dist/chunks/app-server-harness-services-BHD6S5II.js +0 -2
- package/dist/chunks/app-server-runtime-LFIL6F7D.js +0 -2
- package/dist/chunks/apps-QKAHJGQ4.js +0 -2
- package/dist/chunks/chunk-5EP2DZLJ.js +0 -2
- package/dist/chunks/chunk-6EBCS57F.js +0 -2
- package/dist/chunks/chunk-6RS4NAOY.js +0 -2
- package/dist/chunks/chunk-7O6Z3VOZ.js +0 -2
- package/dist/chunks/chunk-7YLXGILH.js +0 -2
- package/dist/chunks/chunk-7ZLXFKRI.js +0 -2
- package/dist/chunks/chunk-B5R53U74.js +0 -2
- package/dist/chunks/chunk-C2AXMKK4.js +0 -2
- package/dist/chunks/chunk-F6UQ6PPK.js +0 -2
- package/dist/chunks/chunk-GS6ZUSIN.js +0 -3
- package/dist/chunks/chunk-JSQRLLN6.js +0 -2
- package/dist/chunks/chunk-LAOLJDVB.js +0 -2
- package/dist/chunks/chunk-LKKMLBOH.js +0 -3
- package/dist/chunks/chunk-M3FLEZ4E.js +0 -4
- package/dist/chunks/chunk-MEGKXGW3.js +0 -2
- package/dist/chunks/chunk-MILEWROZ.js +0 -2
- package/dist/chunks/chunk-N42HT64M.js +0 -2
- package/dist/chunks/chunk-NG2L6D7G.js +0 -2
- package/dist/chunks/chunk-OSVGNONV.js +0 -2
- package/dist/chunks/chunk-OTUBJV6C.js +0 -6
- package/dist/chunks/chunk-PBTXLQAU.js +0 -2
- package/dist/chunks/chunk-PBZCXPPC.js +0 -10
- package/dist/chunks/chunk-SFKZITAG.js +0 -9
- package/dist/chunks/chunk-SXMR6E2W.js +0 -2
- package/dist/chunks/chunk-U2K7QJCG.js +0 -2
- package/dist/chunks/chunk-URNMC46H.js +0 -157
- package/dist/chunks/chunk-VHXDWAEH.js +0 -2
- package/dist/chunks/chunk-W2TICQ62.js +0 -2
- package/dist/chunks/chunk-WSOUMXH3.js +0 -24
- package/dist/chunks/chunk-XOB6FKQV.js +0 -2
- package/dist/chunks/chunk-YBNKGA5C.js +0 -2
- package/dist/chunks/chunk-YM4PSVFW.js +0 -4
- package/dist/chunks/chunk-YNQWJWIC.js +0 -10
- package/dist/chunks/chunk-Z3BWCFLV.js +0 -2
- package/dist/chunks/cli-PSXMIJTF.js +0 -2
- package/dist/chunks/configuration-command-XYKMXIWF.js +0 -2
- package/dist/chunks/connected-app-executor-6G2LA3PQ.js +0 -2
- package/dist/chunks/connected-evidence-IRXYN6YD.js +0 -2
- package/dist/chunks/connection-XMAAGMXJ.js +0 -2
- package/dist/chunks/core-commands-WWN7X3XC.js +0 -2
- package/dist/chunks/dataset-preparation-authoring-F3OZIQSP.js +0 -4
- package/dist/chunks/datasets-2PC2HP7N.js +0 -2
- package/dist/chunks/desktop-test-VU6AFAMO.js +0 -3
- package/dist/chunks/dist-47AYOIH6.js +0 -2
- package/dist/chunks/dist-HSC43RG4.js +0 -2
- package/dist/chunks/dist-MXBEBM4D.js +0 -2
- package/dist/chunks/enclave-VURYNILU.js +0 -2
- package/dist/chunks/evaluation-coordination-UOWZHHC5.js +0 -2
- package/dist/chunks/experiment-improvements-EB2CV5RA.js +0 -2
- package/dist/chunks/experiments-CLXGM3TZ.js +0 -2
- package/dist/chunks/experiments-SZQYR6MH.js +0 -2
- package/dist/chunks/experiments-signal-2KJCP25D.js +0 -2
- package/dist/chunks/host-profile-evaluation-tools-Y2LQ4WQN.js +0 -2
- package/dist/chunks/host-profile-external-dataset-FRIGXOO7.js +0 -2
- package/dist/chunks/hosted-app-server-composition-PGKQNDW6.js +0 -2
- package/dist/chunks/hosted-experiment-improvement-UXC542SZ.js +0 -3
- package/dist/chunks/hosted-harness-runtime-6PEI7F2U.js +0 -2
- package/dist/chunks/hosted-profile-candidate-HM44BIUX.js +0 -3
- package/dist/chunks/hosted-profile-compiler-UAZ4PHYE.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-control-EUL57FAB.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-inspection-7USY75Z4.js +0 -3
- package/dist/chunks/hosted-profile-evaluation-preparation-2LSMZQNA.js +0 -3
- package/dist/chunks/hosted-tasksets-WGXGXJ7E.js +0 -2
- package/dist/chunks/human-review-M26UKGJL.js +0 -2
- package/dist/chunks/learning-HM3NWOV5.js +0 -2
- package/dist/chunks/local-harness-improvement-runtime-QGWFWNSR.js +0 -2
- package/dist/chunks/local-harness-taskset-review-KS4WPMN6.js +0 -2
- package/dist/chunks/local-scope-62GWHDXS.js +0 -2
- package/dist/chunks/model-projects-YUAMBQTO.js +0 -2
- package/dist/chunks/opchat-AG4CWVY4.js +0 -3
- package/dist/chunks/opchat-bounded-chat-IQMP5IIO.js +0 -2
- package/dist/chunks/organizations-KDKX77XZ.js +0 -2
- package/dist/chunks/profile-training-source-3DXFM2XI.js +0 -2
- package/dist/chunks/project-action-payload-QA24HYGF.js +0 -2
- package/dist/chunks/project-agent-XBOOM5TS.js +0 -2
- package/dist/chunks/published-experiment-source-GZGN354O.js +0 -2
- package/dist/chunks/refiner-profile-service-BJMOYKTC.js +0 -2
- package/dist/chunks/sandbox-command-5ECGS7DG.js +0 -2
- package/dist/chunks/saved-work-KUNVTJ7O.js +0 -2
- package/dist/chunks/send-turn-FIPWOXWV.js +0 -2
- package/dist/chunks/standalone-experiment-turn-owner-XIE46VNH.js +0 -2
- package/dist/chunks/store-chat-resources-YOEJ2BI6.js +0 -2
- package/dist/chunks/store-conversation-serving-K324SQTO.js +0 -2
- package/dist/chunks/store-evaluation-results-LHCCNNE6.js +0 -7
- package/dist/chunks/store-harness-workspaces-ZHNCNWVI.js +0 -2
- package/dist/chunks/store-human-review-QJY3ZPPF.js +0 -7
- package/dist/chunks/store-learned-preference-migration-validation-X32SRBOM.js +0 -2
- package/dist/chunks/store-learning-DW3QLQXU.js +0 -2
- package/dist/chunks/store-learning-credentials-67QNTPA7.js +0 -2
- package/dist/chunks/store-model-batch-review-PBYQZJJJ.js +0 -2
- package/dist/chunks/store-model-project-preparation-TFCG2F2F.js +0 -2
- package/dist/chunks/store-taskset-drafts-GXABQR5G.js +0 -9
- package/dist/chunks/taskset-ARKJQKYQ.js +0 -2
- package/dist/chunks/taskset-packages-X4K65DTW.js +0 -2
- package/dist/chunks/taskset-packages-XK7FSD45.js +0 -2
- package/dist/chunks/training-3IWW4256.js +0 -2
- package/dist/chunks/training-RVIESURJ.js +0 -2
- package/dist/chunks/training-error-2EWDOQ4G.js +0 -2
- package/dist/chunks/training-hosted-PFJHYTEU.js +0 -2
- package/dist/chunks/training-hosted-checkpoint-evaluation-JJPP7KFW.js +0 -2
- package/dist/chunks/training-hosted-learning-Y7NHRY4V.js +0 -2
- package/dist/chunks/training-hosted-serving-QAV7ZGGV.js +0 -2
- package/dist/chunks/training-hosted-serving-report-OX4A5OKB.js +0 -2
- package/dist/chunks/training-hosted-workers-LST4ZUXN.js +0 -2
- package/dist/chunks/training-model-start-ROLS3E4V.js +0 -2
- package/dist/chunks/web-search-7FBUBZ66.js +0 -2
- package/dist/chunks/workspaces-G3CMY7ZA.js +0 -2
- package/dist/web/assets/App-DY2R8Z6r.js +0 -53
- package/dist/web/assets/AppTerminalPanel-YcnBD5DF.js +0 -2
- package/dist/web/assets/ChatTimelineEntry-DC93wlDa.js +0 -8
- package/dist/web/assets/LabsRoute-BV7ZJGEw.js +0 -101
- package/dist/web/assets/MainChatThread-pzHKd_YN.js +0 -2
- package/dist/web/assets/MainPane-6OlLiKKb.js +0 -10
- package/dist/web/assets/NativeSetupTerminal-CPDChcMi.js +0 -2
- package/dist/web/assets/RightChatPanelStack-BsxJg9sy.js +0 -1
- package/dist/web/assets/RightSidebarHomePanel-CCVQ9LMB.js +0 -1
- package/dist/web/assets/UsageSettingsSection-FhYymrfc.js +0 -7
- package/dist/web/assets/WorkSidebarPanel-u87uptH0.js +0 -1
- package/dist/web/assets/WorkspaceDiffPanel-B5rlW7bA.js +0 -11
- package/dist/web/assets/app-models-CUA9XB9U.js +0 -1
- package/dist/web/assets/chat-resources-CI8KFVO5.js +0 -1
- package/dist/web/assets/chevron-right-BYmDQ7ti.js +0 -1
- package/dist/web/assets/chunk-ONGOAEY6-C__DQmRT.js +0 -9
- package/dist/web/assets/chunk-SQBYHWZU-DumrB9SB.js +0 -1
- package/dist/web/assets/icons-D7jkCa2d.js +0 -1
- package/dist/web/assets/loader-circle-CPaJeTDy.js +0 -1
- package/dist/web/assets/models-route-Bl_TmMl6.js +0 -1
- package/dist/web/assets/play-D_SuGDBM.js +0 -1
- package/dist/web/assets/plus-yw95Iaj8.js +0 -1
- package/dist/web/assets/settings-lists-DMKA1lCN.js +0 -5
- package/dist/web/assets/square-BY5lG2Ol.js +0 -1
- package/dist/web/assets/x-Dqpel42h.js +0 -1
- /package/dist/chunks/{chunk-IDOGNIMV.js → chunk-7J2NMUTK.js} +0 -0
- /package/dist/chunks/{chunk-PCB65K4G.js → chunk-SFR32TMJ.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as k}from"./chunk-6FA3GG5B.js";import{A as e}from"./chunk-
|
|
2
|
+
import{a as k}from"./chunk-6FA3GG5B.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as r}from"./chunk-FTQLQJQV.js";var b=3e3,h=9999,l="openpond.yaml",ie="openpond-template-plan.json",M="openpond.sandboxTemplate.buildPlan.v1",C=["google","github","x"],S=new Set([22,2222,2375,2376,3108,5900,5901,6080,7818]),w=e.array(e.string().trim().min(1).max(1e3)).max(50),d=e.string().trim().min(1).max(4096).refine(N,{message:"path must be a relative workspace path"}),O=e.string().trim().min(1).max(500).refine(t=>!t.includes("\0")&&!/\s/.test(t),"image ref must be a single OCI reference"),D=e.string().trim().regex(/^sha256:[0-9a-f]{64}$/i),R=e.string().trim().min(1).max(500).refine(t=>t.startsWith("/")&&!t.includes("\0"),"workspaceRoot must be an absolute guest path"),$=e.object({ref:O,digest:D.optional(),registrySecretRef:e.string().trim().min(1).max(500).optional(),platform:e.literal("linux/amd64").optional(),workspaceRoot:R.optional()}).strict(),q=e.object({context:d.default("."),path:d.default("Dockerfile"),target:e.string().trim().min(1).max(191).optional(),buildArgs:e.record(e.string().max(191),e.string().max(500)).optional(),registrySecretRefs:e.array(e.string().trim().min(1).max(500)).max(10).optional(),platform:e.literal("linux/amd64").optional(),workspaceRoot:R.optional()}).strict(),L=e.object({base:e.string().trim().min(1).max(120).optional(),snapshot:e.string().trim().min(1).max(191).optional(),image:$.optional(),dockerfile:q.optional()}).strict().superRefine((t,a)=>{[t.base,t.snapshot,t.image,t.dockerfile].filter(Boolean).length!==1&&a.addIssue({code:e.ZodIssueCode.custom,message:"runtime must declare exactly one of base, snapshot, image, or dockerfile"})}),T=e.object({cpu:e.number().positive().max(8).optional(),memoryGb:e.number().positive().max(32).optional(),diskGb:e.number().positive().max(100).optional()}).strict(),V=e.object({provider:e.enum(C),scopes:e.array(e.string().trim().min(1).max(200)).max(100).default([]),capabilities:e.array(e.string().trim().min(1).max(200)).max(100).default([])}).strict(),z=e.object({models:e.array(e.string().trim().min(1).max(200)).max(100).default([]),scopes:e.array(e.string().trim().min(1).max(200)).max(100).default([])}).strict(),Z=e.object({opchat:z.optional()}).catchall(e.record(e.string(),e.unknown())).default({}),j=e.object({name:e.string().trim().regex(/^[A-Za-z_][A-Za-z0-9_-]*$/).max(63).optional(),mountPath:e.string().trim().min(1).max(256).optional(),storageGb:e.number().int().positive().max(100).optional(),deleteOnSandboxDelete:e.boolean().optional()}).strict(),E=e.object({port:e.number().int().min(b).max(h).refine(t=>!S.has(t),{message:"preview port is reserved"}),protocol:e.literal("http").default("http"),label:e.string().trim().min(1).max(80).optional(),access:e.enum(["private","public"]).default("private"),path:e.string().trim().min(1).max(512).refine(t=>t.startsWith("/"),{message:"preview path must start with /"}).default("/")}).strict(),_=e.object({command:e.string().trim().min(1).max(1e3),cwd:d.optional(),timeoutSeconds:e.number().int().positive().max(86400).optional(),requiresStart:e.boolean().default(!1),ports:e.array(E).max(20).default([]),artifactPaths:e.array(d).max(100).default([])}).strict(),I=_.extend({name:e.string().trim().min(1).max(80)}).strict(),F=e.object({name:e.string().trim().min(1).max(80).optional(),service:e.string().trim().min(1).max(80).optional(),port:e.number().int().min(b).max(h).refine(t=>!S.has(t),{message:"app MCP port is reserved"}),path:e.string().trim().min(1).max(512).refine(t=>t.startsWith("/"),{message:"app MCP path must start with /"}).default("/mcp")}).strict(),B=e.object({name:e.string().trim().min(1).max(80).optional(),port:e.number().int().min(b).max(h).refine(t=>!S.has(t),{message:"validation probe port is reserved"}),path:e.string().trim().min(1).max(512).refine(t=>t.startsWith("/"),{message:"validation probe path must start with /"}).default("/"),expectedStatus:e.number().int().min(100).max(599).default(200)}).strict(),W=e.record(e.string(),e.unknown()).refine(t=>t.type==="object","input schema must be a JSON schema object"),J=e.object({name:e.string().trim().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(191),required:e.boolean().default(!1),secret:e.boolean().default(!0),description:e.string().trim().max(500).optional()}).strict(),g=e.string().trim().min(1).max(120),G=e.object({name:e.string().trim().min(1).max(120),description:e.string().trim().max(500).optional(),cron:e.string().trim().min(1).max(500).optional(),rate:e.string().trim().min(1).max(500).optional(),once:g.optional(),scheduleType:e.enum(["rate","cron","once"]).optional(),scheduleExpression:e.string().trim().min(1).max(500).optional(),timezone:e.string().trim().min(1).max(100).optional(),enabled:e.boolean().default(!0),startAt:g.optional(),endAt:g.optional(),maxRuns:e.number().int().positive().nullable().optional(),runtimePolicy:e.enum(["run_and_stop","run_and_archive","run_and_delete","use_existing_running"]).default("run_and_stop"),action:e.string().trim().min(1).max(120).optional(),actionName:e.string().trim().min(1).max(120).optional(),command:e.string().trim().min(1).max(2e3).optional(),target:e.object({kind:e.enum(["start","action","service","command"]).optional(),name:e.string().trim().min(1).max(120).optional(),actionName:e.string().trim().min(1).max(120).optional(),command:e.string().trim().min(1).max(2e3).optional(),requiresStart:e.boolean().optional()}).strict().optional(),requiresStart:e.boolean().optional(),budget:e.object({maxUsd:e.string().trim().min(1).max(40).optional()}).strict().optional(),resources:T.optional(),quotas:e.record(e.string(),e.unknown()).optional(),lifecycle:e.record(e.string(),e.unknown()).optional(),retentionPolicy:e.record(e.string(),e.unknown()).optional(),env:e.array(e.object({name:e.string().trim().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(191),value:e.string().optional(),secretRef:e.string().optional()}).strict()).max(100).optional(),integrationLeases:e.array(e.record(e.string(),e.unknown())).max(20).optional(),metadata:e.record(e.string(),e.unknown()).optional()}).strict().superRefine((t,a)=>{[t.cron,t.rate,t.once,t.scheduleExpression].filter(m=>typeof m=="string"&&m.trim()).length!==1&&a.addIssue({code:e.ZodIssueCode.custom,path:["scheduleExpression"],message:"schedule must declare exactly one of cron, rate, once, or scheduleExpression"}),t.scheduleExpression&&!t.scheduleType&&a.addIssue({code:e.ZodIssueCode.custom,path:["scheduleType"],message:"scheduleType is required with scheduleExpression"});let i=t.command??t.target?.command??null,o=t.target?.name??null,s=t.actionName??t.action??t.target?.actionName??(t.target?.kind==="action"?o:null),c=t.target?.kind??(i?"command":"action");c==="action"&&!s&&a.addIssue({code:e.ZodIssueCode.custom,path:["action"],message:"schedule action target is required"}),c==="service"&&!o&&a.addIssue({code:e.ZodIssueCode.custom,path:["target","name"],message:"schedule service target name is required"}),c==="command"&&!i&&a.addIssue({code:e.ZodIssueCode.custom,path:["command"],message:"schedule command target is required"})}),v=e.object({schemaVersion:e.literal(1),name:e.string().trim().min(1).max(80).regex(/^[a-z0-9][a-z0-9-]*[a-z0-9]$/),version:e.string().trim().min(1).max(40),useCase:e.string().trim().min(1).max(80),description:e.string().trim().min(1).max(500),runtime:L,resources:T.optional(),setup:e.object({commands:w.default([])}).strict().default({commands:[]}),validation:e.object({commands:w.min(1),probes:e.array(B).max(20).default([])}).strict(),start:_,actions:e.array(I).max(20).default([]),services:e.array(I).max(20).default([]),schedules:e.array(G).max(20).default([]),mcp:e.object({endpoints:e.array(F).max(10).default([])}).strict().default({endpoints:[]}),volumes:e.array(j).max(5).default([]),integrations:e.object({requiredLeases:e.array(V).max(20).default([])}).strict().default({requiredLeases:[]}),permissions:Z,inputs:e.object({schema:W.default({type:"object"}),env:e.array(J).max(100).default([])}).strict().default({schema:{type:"object"},env:[]}),artifacts:e.object({paths:e.array(d).max(100).default([])}).strict().default({paths:[]}),network:e.object({egress:e.enum(["restricted","allow","block"]).default("restricted")}).strict().default({egress:"restricted"})}).strict().superRefine((t,a)=>{Q(t,a),y(a,t.volumes.flatMap(n=>n.name?[n.name]:[]),"volume names must be unique","volumes"),ee(t,a),te(t,a),ae(t,a),ne(t,a)}),me=e.object({path:e.string(),message:e.string(),code:e.string()});function K(t){let a;try{a=k.load(t)}catch(n){return{ok:!1,manifest:null,diagnostics:[{path:"$",code:"invalid_yaml",message:n instanceof Error?n.message:"Invalid YAML"}]}}return U(a)}r(K,"validateSandboxTemplateYaml");function U(t){if(!t||typeof t!="object"||Array.isArray(t))return{ok:!1,manifest:null,diagnostics:[{path:"$",code:"invalid_type",message:`${l} must be an object`}]};if(Object.prototype.hasOwnProperty.call(t,"databases"))return{ok:!1,manifest:null,diagnostics:[{path:"$.databases",code:"database_resources_removed",message:"managed database requests are unsupported for Firecracker sandbox templates; use a durable volume with SQLite or files instead"}]};let a=v.safeParse(t);return a.success?{ok:!0,manifest:a.data,diagnostics:[]}:{ok:!1,manifest:null,diagnostics:a.error.issues.map(n=>({path:H(n.path),code:n.code,message:n.message}))}}r(U,"validateSandboxTemplateManifest");function ce(t){let a=K(t);if(!a.ok)throw new Error(X(a.diagnostics));return a.manifest}r(ce,"parseSandboxTemplateYaml");function X(t){return t.map(a=>`${a.path}: ${a.message}`).join(`
|
|
3
3
|
`)}r(X,"formatSandboxTemplateDiagnostics");function pe(t){return v.parse(t)}r(pe,"defineSandboxTemplate");function de(t={}){return T.parse(t)}r(de,"sandboxTemplateResources");function le(t){return j.parse({...t,deleteOnSandboxDelete:t.deleteOnSandboxDelete??!1})}r(le,"sandboxTemplateDurableVolume");function ue(t,a={}){return E.parse({...a,port:t})}r(ue,"sandboxTemplatePreviewPort");function ge(t){let a=d.parse(t.targetPath),n=t.accept?.map(s=>s.trim()).filter(s=>s.length>0),i={targetPath:a,...n&&n.length>0?{accept:n}:{}},o={...t.title?.trim()?{title:t.title.trim()}:{},...t.description?.trim()?{description:t.description.trim()}:{},"x-openpond-upload":i};return t.multiple?{...o,"x-openpond-upload":{...i,multiple:!0},type:"array",items:{type:"string",format:"file"}}:{...o,type:"string",format:"file"}}r(ge,"sandboxTemplateFileInput");function A(t){return[{kind:"start",name:"start",...t.start,artifactPaths:f(t.start,t)},...t.actions.map(a=>({kind:"action",name:a.name,command:a.command,cwd:a.cwd,timeoutSeconds:a.timeoutSeconds,requiresStart:a.requiresStart,ports:a.ports,artifactPaths:f(a,t)})),...t.services.map(a=>({kind:"service",name:a.name,command:a.command,cwd:a.cwd,timeoutSeconds:a.timeoutSeconds,requiresStart:a.requiresStart,ports:a.ports,artifactPaths:f(a,t)}))]}r(A,"sandboxTemplateExecutableEntries");function Y(t){let a=A(t);return{template:{name:t.name,version:t.version,useCase:t.useCase,runtime:t.runtime},resources:t.resources??null,volumes:t.volumes,executables:a.map(n=>({kind:n.kind,name:n.name,command:n.command,cwd:n.cwd??null,timeoutSeconds:n.timeoutSeconds??null,requiresStart:n.requiresStart,ports:n.ports.map(i=>i.port),artifactPaths:n.artifactPaths})),ports:a.flatMap(n=>n.ports.map(i=>({executable:n.name,kind:n.kind,port:i.port,access:i.access,label:i.label??null}))),appMcpEndpoints:t.mcp.endpoints.map(n=>({name:n.name??null,service:n.service??null,port:n.port,path:n.path})),validation:{commands:t.validation.commands,probes:t.validation.probes},schedules:t.schedules}}r(Y,"sandboxTemplateBuildMetadata");function xe(t){return{kind:M,schemaVersion:1,manifestFile:t.manifestFile,projectRoot:t.projectRoot,manifest:t.manifest,metadata:Y(t.manifest),executables:A(t.manifest)}}r(xe,"sandboxTemplateBuildPlan");function fe(t){let a=t.name.trim()||"Sandbox Template",n=se(a),i=t.description?.trim()||`Local scaffold for ${a}.`;return{".gitignore":["node_modules","artifacts",".DS_Store",""].join(`
|
|
4
4
|
`),"README.md":[`# ${a}`,"","Local sandbox template scaffold.","","## Commands","","- `pnpm dev` starts the preview service on port 3000.","- `pnpm process` writes a sample artifact.",`- \`pnpm validate\` validates ${l}.`,""].join(`
|
|
5
5
|
`),"package.json":`${JSON.stringify({private:!0,type:"module",scripts:{dev:"node src/server.ts",process:"node scripts/process.ts",validate:`openpond sandbox-template validate --file ${l}`}},null,2)}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{b as h,g as T}from"./chunk-
|
|
2
|
+
import{b as h,g as T}from"./chunk-LYVHYT3L.js";import{f as u}from"./chunk-5KJMFK65.js";import{m}from"./chunk-RCT3O3HQ.js";import{a as l}from"./chunk-FTQLQJQV.js";import{cp as P,lstat as k,mkdir as $,mkdtemp as j,readFile as v,readdir as b,rename as x,rm as z}from"node:fs/promises";import c from"node:path";async function B(s,i,r,t={}){return L(c.join(s,"training","tasksets"),i,r,t)}l(B,"materializeImmutableTasksetPackage");async function L(s,i,r,t={}){if(!/^[a-z0-9][a-z0-9-]{1,239}$/.test(r))throw new Error("Taskset package identity is not a safe directory name.");await $(s,{recursive:!0});let e=await j(c.join(s,".starter-")),o=c.join(s,r);try{if(t.source){let n=await k(t.source.directory);if(!n.isDirectory()||n.isSymbolicLink())throw new Error("Taskset source must be a regular directory.");await y(t.source.directory);for(let d of await b(t.source.directory))await P(c.join(t.source.directory,d),c.join(e,d),{recursive:!0,force:!1,errorOnExist:!0});if(await y(e),await h(e)!==t.source.packageHash)throw new Error("Taskset draft files changed during publication. Refresh before publishing.")}await T(i.taskset,e,{generatedFiles:i.generatedFiles}),await t.verify?.(e);let a=(await y(e)).sort();try{await x(e,o)}catch(n){if(!["EEXIST","ENOTEMPTY"].includes(n.code??""))throw n;let d=await k(o);if(!d.isDirectory()||d.isSymbolicLink())throw new Error("Starter package destination is not a regular directory.");let S=await y(o);if(JSON.stringify(S.sort())!==JSON.stringify(a))throw new Error("Existing starter package has a different file inventory.");for(let w of a){let p=c.join(o,w),g=await k(p);if(!g.isFile()||g.isSymbolicLink()||!(await v(p)).equals(await v(c.join(e,w))))throw new Error("Existing starter package differs from the pinned creation attempt.")}}return o}finally{await z(e,{recursive:!0,force:!0})}}l(L,"materializeImmutableTasksetPackageAtRoot");async function y(s,i=""){let r=[];for(let t of await b(c.join(s,i),{withFileTypes:!0})){let e=c.join(i,t.name);if(t.isSymbolicLink())throw new Error("Starter packages cannot contain symbolic links.");if(t.isDirectory())r.push(...await y(s,e));else if(t.isFile())r.push(e);else throw new Error("Starter packages must contain regular files and directories.")}return r}l(y,"regularFiles");import{lstat as E,readFile as F}from"node:fs/promises";import f from"node:path";function I(s,i,r){let t=f.resolve(s),e=f.resolve(t,r.artifactRef);if(!e.startsWith(`${t}${f.sep}`))throw new Error(`Taskset asset ${r.id} escapes its package.`);if(i.metadata.portableFileInventory===void 0){if(!e.startsWith(`${f.join(t,"assets")}${f.sep}`))throw new Error(`Work asset ${r.id} must resolve inside the Taskset assets directory.`)}else{let a=u.parse(i.metadata.portableFileInventory).find(n=>n.asset.id===r.id&&n.sourcePath===r.artifactRef);if(!a||a.asset.visibility!=="policy"||a.asset.contentHash!==r.sha256||a.asset.sizeBytes!==r.sizeBytes||a.asset.mediaType!==r.mediaType)throw new Error(`Taskset asset ${r.id} differs from its declared policy inventory.`)}return e}l(I,"resolveTasksetPolicyAssetPath");async function J(s,i){let r=u.parse(i.metadata.portableFileInventory??[]);for(let t of r){let e=f.resolve(s,t.sourcePath);if(!e.startsWith(`${f.resolve(s)}${f.sep}`))throw new Error("Taskset inventory file escapes its package.");let o=await E(e);if(!o.isFile()||o.isSymbolicLink())throw new Error("Taskset inventory requires regular files.");let a=await F(e);if(a.length!==t.asset.sizeBytes||m(a)!==t.asset.contentHash)throw new Error(`Taskset file differs from its immutable inventory: ${t.asset.id}.`)}for(let t of i.tasks)for(let e of t.assets??[]){let o=I(s,i,e),a=await E(o);if(!a.isFile()||a.isSymbolicLink())throw new Error(`Taskset asset ${e.id} is not a regular file.`);let n=await F(o);if(n.byteLength!==e.sizeBytes||m(n)!==e.sha256)throw new Error(`Taskset asset ${e.id} does not match its immutable manifest.`)}}l(J,"verifyPublishedTasksetAssets");export{B as a,L as b,I as c,J as d};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{e as ut}from"./chunk-RRWL5BHZ.js";import{c as dt}from"./chunk-NXN7GJOH.js";import{a as A,b as $,c as be,d as p,e as b,f as ie,g as pt,l as xe}from"./chunk-5WPMI6QX.js";import{d as he,e as q,f as fe,g as d,h as y,j as u,k}from"./chunk-5HPZGLOL.js";import{f as ct,ob as mt,qb as ne}from"./chunk-QAFXQHHG.js";import{$b as rt,C as tt,E as nt,H as it,b as U,hc as ot,kc as st,o as Ze,s as et,tb as at}from"./chunk-G4E3WGLM.js";import{Ka as te,Na as Le,Ra as Qe,W as Be,Wa as Fe,Za as Ke,bb as We,fb as Xe,l as Ne,lb as Ye,oa as ee,va as ge}from"./chunk-ZY32SZ2P.js";import{t as $e,v as Ve}from"./chunk-OTDDXEQ6.js";import{g as ue,k as Je,n as w,o as le}from"./chunk-RCT3O3HQ.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as s}from"./chunk-FTQLQJQV.js";var lt=e.string().trim().min(1).max(240),an=e.string().trim().min(8).max(256),z=e.object({schemaVersion:e.literal("openpond.sftRecipe.v1"),method:e.literal("sft"),parameterization:e.literal("lora"),baseModel:e.object({id:lt,revision:e.string().trim().min(1).max(256),tokenizerRevision:e.string().trim().min(1).max(256),chatTemplateHash:an}),dataset:e.object({trainSplit:e.literal("train"),validationSplit:e.enum(["validation","frozen_eval"]),completionOnly:e.boolean(),maxSequenceLength:e.number().int().positive().max(32768),maxExamples:e.number().int().positive().max(1e5).default(1e3),selectionStrategy:e.literal("stable_hash_top_n").default("stable_hash_top_n"),selectionSeed:e.number().int().default(17)}),lora:e.object({rank:e.number().int().positive().max(256),alpha:e.number().positive().max(1024),dropout:e.number().min(0).max(1),targetModules:e.array(lt).min(1).max(100)}),optimizer:e.object({learningRate:e.number().positive(),epochs:e.number().positive().max(100),maxSteps:e.number().int().positive().max(1e6),batchSize:e.number().int().positive().max(1e4),gradientAccumulationSteps:e.number().int().positive().max(1e4),seed:e.number().int()}),resourceLimits:e.object({cpuThreads:e.number().int().positive().max(256),memoryBytes:e.number().int().positive(),wallTimeMs:e.number().int().positive()})}),rn=z.safeExtend({dataset:z.shape.dataset.safeExtend({completionOnly:e.literal(!0),maxSequenceLength:e.number().int().min(2).max(8192),maxExamples:e.number().int().min(1).max(1e3).default(1e3)}),lora:z.shape.lora.safeExtend({rank:e.number().int().min(1).max(64),dropout:e.number().min(0).lt(1),targetModules:e.array(e.enum(["q_proj","k_proj","v_proj","o_proj","gate_proj","up_proj","down_proj"])).min(1).max(7)}),optimizer:z.shape.optimizer.safeExtend({learningRate:e.number().positive().max(.001),epochs:e.number().positive().max(10),maxSteps:e.number().int().min(1).max(128),batchSize:e.number().int().min(1).max(32),gradientAccumulationSteps:e.number().int().min(1).max(32),seed:e.number().int().min(-(2**31)).max(2**31-1)}),resourceLimits:z.shape.resourceLimits.safeExtend({wallTimeMs:e.number().int().min(1e3).max(216e5)})}).superRefine((t,n)=>{t.optimizer.batchSize*t.optimizer.gradientAccumulationSteps>32&&n.addIssue({code:"custom",path:["optimizer"],message:"Managed SFT supports at most 32 accumulated examples."}),new Set(t.lora.targetModules).size!==t.lora.targetModules.length&&n.addIssue({code:"custom",path:["lora","targetModules"],message:"Adapter target modules must be unique."})});var C=e.string().trim().min(1).max(240),ye=p.extend({revision:e.number().int().positive()}).strict(),gt=ye.extend({teamId:C,jobId:C,plan:p,baseline:p,candidate:p,state:ot.shape.state,updatedAt:e.string().datetime()}).strict(),ht=e.object({schemaVersion:e.literal("openpond.trainingAcceptanceGroupPage.v1"),teamId:C,jobId:C,groups:e.array(gt).max(100),nextCursor:C.nullable()}).strict(),ft=e.object({cursor:C.optional(),limit:e.number().int().min(1).max(100).default(25)}).strict();function bt(t){let n=s(i=>(C.parse(i.teamId),`/v1/training/jobs/${encodeURIComponent(C.parse(i.jobId))}/acceptance-groups`),"route");return{async acceptanceGroups(i,a={}){let r=ft.parse(a),o=new URLSearchParams({limit:String(r.limit)});r.cursor&&o.set("cursor",r.cursor);let m=ht.parse(await t(`${n(i)}?${o}`));if(m.teamId!==i.teamId||m.jobId!==i.jobId||m.groups.length>r.limit||m.groups.some(c=>c.teamId!==i.teamId||c.jobId!==i.jobId||r.cursor&&c.id<=r.cursor)||new Set(m.groups.map(c=>c.id)).size!==m.groups.length||m.nextCursor!==null&&m.nextCursor!==m.groups.at(-1)?.id)throw new d("acceptance_group_scope_mismatch","Acceptance groups do not match the requested workspace, job or cursor.");return m},async acceptanceGroup(i,a,r){let o=r?ye.parse({id:r.id,revision:r.revision,contentHash:r.contentHash}):null;if(o&&o.id!==a)throw new d("acceptance_group_identity_mismatch","The retained group reference differs from the requested group.");let m=o?`?revision=${o.revision}`:"",c=st(await t(`${n(i)}/${encodeURIComponent(C.parse(a))}${m}`));if(c.manifest.teamId!==i.teamId||c.manifest.trainingJob.id!==i.jobId||c.manifest.id!==a||o&&(c.revision!==o.revision||c.contentHash!==o.contentHash))throw new d("acceptance_group_identity_mismatch","Acceptance evidence does not match the requested workspace, job or retained revision.");return c}}}s(bt,"createTrainingAcceptanceClient");var V=e.object({id:e.string().trim().min(1).max(240),revision:e.number().int().positive(),contentHash:e.string().regex(/^[a-f0-9]{64}$/),targetId:e.string().trim().min(1).max(240).nullable()}).strict(),xt=e.array(e.object({role:e.enum(["system","user","assistant"]),content:e.string().max(1e5)}).strict()).max(100).superRefine((t,n)=>{t.reduce((i,a)=>i+a.content.length,0)>1e5&&n.addIssue({code:"custom",message:"Evaluation prompt exceeds 100,000 characters."})});var N=e.string().regex(/^[a-f0-9]{64}$/),Se=e.object({providerId:e.literal("claude-code"),configurationHash:N,executableHash:N,version:e.string().regex(/^2\.\d+\.\d+$/),capabilityHash:N,maximumRequestCostUsd:e.number().finite().positive().max(1e4),requestTimeoutMs:e.number().int().min(1e3).max(3e5),maximumTurns:e.number().int().min(1).max(100),holdOpen:e.boolean()}).strict(),oi=e.object({id:e.string().min(1).max(200),receiptId:e.string().min(1).max(200),sessionId:e.uuid(),operationId:e.string().min(1).max(200),action:e.enum(["message","seal"]),text:e.string().max(262144).optional()}).strict().superRefine((t,n)=>{t.action==="message"&&!t.text?.trim()&&n.addIssue({code:"custom",message:"A human intervention requires a message."}),t.action==="seal"&&t.text!==void 0&&n.addIssue({code:"custom",message:"Sealing does not add a prompt."})}),si=e.object({provider:e.literal("claude-code"),sessionId:e.uuid(),requestId:e.string().min(1).max(200),modelId:e.string().min(1).max(500),runtime:Se,sourceHash:N,outputHash:N,traceHash:N,runtimeEventRefs:e.array(e.string().min(1).max(200)).min(1).max(2e4),eventCount:e.number().int().positive().max(2e4),startedAt:e.iso.datetime(),completedAt:e.iso.datetime(),cleanupComplete:e.literal(!0)}).strict().superRefine((t,n)=>{(t.runtimeEventRefs.length!==t.eventCount||new Set(t.runtimeEventRefs).size!==t.eventCount)&&n.addIssue({code:"custom",message:"Process event references must match the exact retained trace population."})});var ae=e.object({providerId:e.literal("codex"),configurationHash:e.string().regex(/^[a-f0-9]{64}$/),accountHash:e.string().regex(/^[a-f0-9]{64}$/),reasoningEffort:e.enum(["low","medium","high","xhigh"]),maximumRequestCostUsd:e.number().finite().positive().max(1e4),requestTimeoutMs:e.number().int().min(1e3).max(3e5)}).strict();var yt=e.object({schemaVersion:e.literal("openpond.experimentAttemptGrade.v1"),selectionHash:e.string().regex(/^[a-f0-9]{64}$/),grades:e.array(te).min(1).max(100),score:e.number().min(0).max(1).nullable(),passed:e.boolean(),rewardEligible:e.boolean(),gradingStatus:e.enum(["scored","pending","unscorable","not_configured"]),failureClass:Je.nullable(),contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict().superRefine((t,n)=>{let{contentHash:i,...a}=t;w(a)!==i&&n.addIssue({code:"custom",message:"Experiment grading integrity failed."});let r=t.grades.flatMap(o=>o.components);(r.length!==t.grades.length||new Set(r.map(o=>o.graderId)).size!==r.length)&&n.addIssue({code:"custom",message:"Each selected criterion requires exactly one distinct grader result."});for(let o of t.grades){let{contentHash:m,...c}=o;w(c)!==m&&n.addIssue({code:"custom",message:"A retained criterion changed."});for(let x of o.components){let{contentHash:R,...v}=x;w(v)!==R&&n.addIssue({code:"custom",message:"A retained grader result changed."})}}});var h=e.string().trim().min(1).max(200),G=e.string().regex(/^[a-f0-9]{64}$/),Te=e.discriminatedUnion("kind",[e.object({kind:e.literal("hosted_chat"),modelId:h,localRuntime:e.union([e.object({providerId:e.literal("custom-openai-compatible"),configurationHash:G,maximumRequestCostUsd:e.number().finite().positive().max(1e4),requestTimeoutMs:e.number().int().min(1e3).max(3e5)}).strict(),Se,ae]).optional(),candidate:e.object({artifactId:h,contentHash:G,preparationId:h,dispatchId:h,baseProfileId:h,workerImageDigest:e.string().regex(/^sha256:[a-f0-9]{64}$/)}).strict().optional(),harness:Xe.optional(),messages:xt.optional(),maxOutputTokens:e.number().int().min(1).max(1e6).default(1e5),temperature:e.number().min(0).max(2).default(0),topP:e.number().gt(0).max(1).default(1)}).strict(),e.object({kind:e.literal("fixture"),fixtureId:h}).strict()]),on=e.object({schemaVersion:e.literal("openpond.modelStarterAttemptRequest.v1"),operationId:h,teamId:h,modelProjectId:h.nullable(),project:V.optional(),taskset:b,taskId:h,environmentSeed:e.number().int().min(0).max(2147483647).default(0),policy:Te}).strict(),Pi=e.object({modelProjectId:h.nullable(),taskset:b,afterTaskId:h.optional(),limit:e.number().int().min(1).max(100).default(25)}).strict(),ki=e.object({modelProjectId:h.nullable(),taskset:b,available:e.boolean(),unavailableReason:e.string().max(1e3).nullable(),models:e.array(e.object({id:h,name:e.string().max(500),maximumOutputTokens:e.number().int().min(1).max(1e6).optional()}).strict()).max(200),tasks:e.array(e.object({id:h,split:Be,inputPreview:e.string().max(500),fixtures:e.array(e.object({id:h,label:e.string().max(200)}).strict()).max(1e3)}).strict()).max(100),nextCursor:h.nullable()}).strict(),re=e.object({schemaVersion:e.literal("openpond.modelStarterAttemptSummary.v1"),id:h,revision:e.number().int().positive(),request:on,status:e.enum(["queued","running","cancelling","completed","failed","cancelled"]),policySnapshot:e.object({modelId:h,provider:h,upstreamModelId:e.string().min(1).max(500),configurationHash:G}).strict().nullable(),createdAt:e.iso.datetime(),startedAt:e.iso.datetime().nullable(),completedAt:e.iso.datetime().nullable(),cleanupComplete:e.boolean(),resultAvailable:e.boolean(),score:e.number().min(0).max(1).nullable(),gradingStatus:e.enum(["not_started","pending","scored","unscorable","not_configured"]).default("not_started"),passed:e.boolean().nullable(),outputPreview:e.string().max(500).nullable(),error:e.object({code:h,message:e.string().max(2e3)}).strict().nullable()}).strict().superRefine((t,n)=>{t.request.policy.kind==="fixture"!=(t.policySnapshot===null)&&n.addIssue({code:"custom",path:["policySnapshot"],message:"Fixture execution must not claim a model identity."}),t.status==="completed"&&(!t.cleanupComplete||!t.resultAvailable||!t.completedAt)&&n.addIssue({code:"custom",message:"Completed attempts require retained results and confirmed cleanup."})}),_i=e.object({modelProjectId:h,afterId:h.optional(),limit:e.number().int().min(1).max(100).default(25)}).strict(),ji=e.object({items:e.array(re).max(100),nextCursor:h.nullable()}).strict(),Hi=e.object({schemaVersion:e.literal("openpond.modelStarterAttemptResult.v1"),attempt:re,output:e.string().max(1048576).nullable(),messages:e.array(e.record(e.string(),e.unknown())).max(4002),composition:Ke.nullable(),grade:te.nullable().optional(),experimentGrade:yt.nullable().optional(),environment:e.object({status:e.enum(["completed","budget_exhausted","cancelled","timed_out","policy_failure","environment_failure"]),collected:e.boolean(),definition:b,initialStateHash:G.nullable(),finalStateHash:G.nullable(),attemptHash:G}).strict(),native:Ye.optional(),providerRequestIds:e.array(h).max(1001),contentHash:G}).strict().superRefine((t,n)=>{let i=t.attempt.request.policy.kind==="hosted_chat"?t.attempt.request.policy.harness:void 0;!!i!=!!t.native&&n.addIssue({code:"custom",path:["native"],message:"Standalone Harness results require their exact native evidence."}),t.native&&(!i||w(i)!==w(t.native.source)||t.native.modelConfigurationHash!==t.attempt.policySnapshot?.configurationHash||t.environment.initialStateHash!==null||t.environment.finalStateHash!==null||t.environment.status==="completed"&&(!t.environment.collected||t.output===null||t.native.partialOutputAvailable||t.native.outputHash!==w(t.output)))&&n.addIssue({code:"custom",path:["native"],message:"Native evidence differs from the admitted source, model or output."}),t.experimentGrade&&((t.grade||t.composition)&&n.addIssue({code:"custom",message:"Selected Experiment grading cannot claim another grade population."}),(!["completed","failed"].includes(t.attempt.status)||!t.attempt.resultAvailable||t.attempt.score!==t.experimentGrade.score||t.attempt.gradingStatus!==t.experimentGrade.gradingStatus||t.attempt.passed!==(t.experimentGrade.score===null?null:t.experimentGrade.passed))&&n.addIssue({code:"custom",message:"Experiment grading differs from its retained attempt summary."})),t.grade&&(t.composition&&n.addIssue({code:"custom",path:["grade"],message:"An ordinary grade cannot also claim a Reward composition."}),(!["completed","failed"].includes(t.attempt.status)||!t.attempt.resultAvailable||t.attempt.score!==t.grade.score||t.attempt.gradingStatus!==t.grade.gradingStatus||t.attempt.passed!==(t.grade.score===null?null:t.grade.passed))&&n.addIssue({code:"custom",path:["grade"],message:"Ordinary grade differs from its terminal attempt summary."}))});var B=e.string().trim().min(1).max(240),ve=e.string().regex(/^[a-f0-9]{64}$/),Ie=e.object({maxOutputTokens:e.number().int().min(1).max(1e6).default(4096),temperature:e.number().min(0).max(2).default(0),topP:e.number().gt(0).max(1).default(1)}).strict();var M=e.object({kind:e.literal("hosted_harness"),modelId:B,maxOutputTokens:Ie.shape.maxOutputTokens.removeDefault().optional(),temperature:Ie.shape.temperature.removeDefault().optional(),topP:Ie.shape.topP.removeDefault().optional(),localRuntime:ae.optional(),candidate:e.object({artifactId:B,contentHash:ve,preparationId:B,dispatchId:B,baseProfileId:B,workerImageDigest:e.string().regex(/^sha256:[a-f0-9]{64}$/)}).strict().optional(),sourceCandidate:ge.shape.sourceCandidate,reasoningEffort:e.enum(["off","low","medium","high","xhigh","max"]).optional(),profileRepositoryId:B,source:ge,modelConfigurationHash:ve,packageHash:ve,externalDatasetBinding:ee.optional()}).strict().superRefine((t,n)=>{JSON.stringify(t.externalDatasetBinding??null)!==JSON.stringify(t.source.externalDatasetBinding??null)&&n.addIssue({code:"custom",message:"The policy and source must bind the same external Dataset recipe."}),JSON.stringify(t.sourceCandidate??null)!==JSON.stringify(t.source.sourceCandidate??null)&&n.addIssue({code:"custom",message:"The policy and prepared source must bind the same actual source candidate."})});var _=e.string().trim().min(1).max(200),St=e.string().regex(/^[a-f0-9]{64}$/),sn=e.discriminatedUnion("kind",[Te.options[0],e.object({kind:e.literal("fixture")}).strict(),M]),D=e.object({schemaVersion:e.literal("openpond.modelTasksetRunRequest.v1"),operationId:_,teamId:_,modelProjectId:_.nullable(),name:e.string().trim().min(1).max(200).optional(),project:V.optional(),taskset:b,policy:sn,population:e.array(mt).min(1).max(1e4)}).strict().superRefine((t,n)=>{new Set(t.population.map(i=>i.receiptId)).size!==t.population.length&&n.addIssue({code:"custom",path:["population"],message:"Run receipt identities must be unique."}),t.population.some(i=>i.fixtureId!==null!=(t.policy.kind==="fixture"))&&n.addIssue({code:"custom",path:["population"],message:"Only fixture runs require a fixture identity for every member."}),t.population.some(i=>!/^(0|[1-9][0-9]*)$/.test(i.seed)||Number(i.seed)>2147483647)&&n.addIssue({code:"custom",path:["population"],message:"Hosted environment seeds must be integers from 0 to 2147483647."}),t.policy.kind==="hosted_harness"&&t.modelProjectId!==null&&n.addIssue({code:"custom",path:["modelProjectId"],message:"A Harness target retains its released Profile binding separately from Model artifacts."}),t.policy.kind==="hosted_harness"&&new Set(t.population.map(i=>y([i.taskId,i.seed]))).size!==t.population.length&&n.addIssue({code:"custom",path:["population"],message:"Harness case identities must be unique for each task and seed."})}),Tt=e.object({schemaVersion:e.literal("openpond.modelTasksetRunSummary.v1"),id:_,revision:e.number().int().positive(),teamId:_,modelProjectId:_.nullable(),name:e.string().trim().min(1).max(200).optional(),project:V.optional(),operationId:_,taskset:b,policyKind:e.enum(["hosted_chat","fixture","hosted_harness"]),manifestHash:St,status:e.enum(["queued","running","cancelling","completed","failed","cancelled"]),totalCount:e.number().int().min(1).max(1e4),counts:e.object({pending:e.number().int().nonnegative(),running:e.number().int().nonnegative(),completed:e.number().int().nonnegative(),failed:e.number().int().nonnegative(),cancelled:e.number().int().nonnegative()}).strict(),createdAt:e.iso.datetime(),startedAt:e.iso.datetime().nullable(),completedAt:e.iso.datetime().nullable(),cleanupComplete:e.boolean(),resultAvailable:e.boolean(),score:e.number().min(0).max(1).nullable(),metricName:e.string().min(1).max(240),error:e.object({code:_,message:e.string().max(2e3)}).strict().nullable()}).strict().superRefine((t,n)=>{Object.values(t.counts).reduce((i,a)=>i+a,0)!==t.totalCount&&n.addIssue({code:"custom",path:["counts"],message:"Run counts must account for the complete population."}),t.status!=="completed"&&t.score!==null&&n.addIssue({code:"custom",path:["score"],message:"Only completed evaluations publish a metric value."}),["completed","failed","cancelled"].includes(t.status)&&(!t.completedAt||t.counts.pending||t.counts.running)&&n.addIssue({code:"custom",message:"Terminal runs require complete population accounting."}),t.status==="cancelled"&&!t.cleanupComplete&&n.addIssue({code:"custom",message:"Cancelled runs require confirmed cleanup."}),t.resultAvailable&&!["completed","failed","cancelled"].includes(t.status)&&n.addIssue({code:"custom",message:"Run results require terminal population accounting."}),t.status==="completed"&&(!t.cleanupComplete||!t.resultAvailable)&&n.addIssue({code:"custom",message:"Completed evaluations require retained results and confirmed cleanup."})}),vt=e.object({summary:Tt,request:D,manifest:ne,policySnapshot:re.shape.policySnapshot}).strict(),Ki=e.object({modelProjectId:_.optional(),projectId:V.shape.id.optional(),afterId:_.optional(),limit:e.number().int().min(1).max(100).default(25)}).strict(),Wi=e.object({items:e.array(Tt).max(100),nextCursor:_.nullable()}).strict(),Xi=e.object({schemaVersion:e.literal("openpond.modelTasksetRunResult.v1"),run:vt,receipts:e.array(ct).min(1).max(1e4),metric:Ne.nullable(),contentHash:St}).strict();function cn(t,n){le(n,"Taskset run manifest");let i=t.policy;if(i.kind!=="hosted_harness"||n.execution.kind!=="harness"||y(n.profileEvaluation)!==y(i.source)||y(n.execution.harnessRelease)!==y(i.source.harnessRelease)||n.metadata.profileRepositoryId!==i.profileRepositoryId||n.packageHash!==i.packageHash||n.policy.kind!=="model"||n.policy.model.provider!==(i.localRuntime?.providerId??"openpond")||n.policy.model.model!==i.modelId||n.policy.model.revision!==null||n.policy.model.artifactHash!==(i.candidate?.contentHash??null)||n.policy.model.tokenizerRevision!==null||n.policy.model.chatTemplateHash!==null||n.policy.configurationHash!==i.modelConfigurationHash||n.tasksetRelease.id!==t.taskset.id||n.tasksetRelease.contentHash!==t.taskset.contentHash||y(n.population)!==y(t.population)||n.population.some(a=>a.receiptId!==`evaluation-${w(n.profileEvaluation?.externalDatasetBinding?[n.id,a.taskId,a.seed,a.fixtureId]:[n.id,a.taskId,a.seed]).slice(0,32)}`))throw new Error("Harness evaluation differs from its admitted source, package or model configuration.")}s(cn,"verifyHarnessExperimentManifest");async function Yi(t){let n=vt.parse(t),{summary:i,request:a,manifest:r,policySnapshot:o}=n;if(le(r,"Taskset run manifest"),r.contentHash!==i.manifestHash||r.id!==i.id||r.createdAt!==i.createdAt||i.teamId!==a.teamId||i.modelProjectId!==a.modelProjectId||y(i.project??null)!==y(a.project??null)||y(r.metadata.project??null)!==y(a.project??null)||(i.name??null)!==(a.name??null)||i.operationId!==a.operationId||i.policyKind!==a.policy.kind||i.totalCount!==a.population.length||i.metricName!==r.metricPolicy.primaryMetric||y(i.taskset)!==y(a.taskset)||r.tasksetRelease.id!==a.taskset.id||r.tasksetRelease.contentHash!==a.taskset.contentHash||y(r.population)!==y(a.population))throw new Error("Evaluation run differs from its admitted request or manifest.");if(a.policy.kind==="fixture"){if(r.policy.kind!=="fixture"||o!==null)throw new Error("Fixture checks cannot claim a model identity.")}else if(a.policy.kind==="hosted_harness"){if(cn(a,r),o!==null)throw new Error("Harness evaluations retain the native host model configuration.")}else if(r.policy.kind!=="model"||!o||o.modelId!==a.policy.modelId||r.policy.model.provider!==o.provider||r.policy.model.model!==o.upstreamModelId||r.policy.model.revision!==null||r.policy.model.artifactHash!==(a.policy.candidate?.contentHash??null)||r.policy.model.tokenizerRevision!==null||r.policy.model.chatTemplateHash!==null||r.policy.configurationHash!==await u({policy:a.policy,snapshot:o}))throw new Error("Evaluation model differs from its admitted policy.");return n}s(Yi,"verifyModelTasksetRunDetails");var wt=e.string().min(1).max(200).refine(t=>!["__proto__","prototype","constructor"].includes(t),"Use an ordinary field name."),mn=e.array(wt).min(1).max(20),It=e.enum(["input","output","expectedOutput","evaluatorContext"]),pn=e.object({destination:It,path:mn,source:It,sourcePath:e.array(wt).max(20)}).strict(),Re=e.array(pn).max(100).superRefine((t,n)=>{for(let[i,a]of t.entries())t.slice(0,i).some(r=>r.destination===a.destination&&(Rt(r.path,a.path)||Rt(a.path,r.path)))&&n.addIssue({code:"custom",path:[i,"path"],message:"Mapped destination paths must not overlap."})});function Rt(t,n){return t.length<=n.length&&t.every((i,a)=>i===n[a])}s(Rt,"prefix");var T=e.string().trim().min(1).max(200),J=e.string().regex(/^[a-f0-9]{64}$/),we=e.object({id:T,revision:e.number().int().positive(),contentHash:J}).strict(),Pe=e.object({id:T,version:e.string().min(1).max(200),contentHash:J,name:e.string().trim().min(1).max(500).optional(),feedbackKey:Le,release:we.nullable(),mappings:Re.optional()}).strict(),ke=e.object({id:T,version:e.string().min(1).max(200),contentHash:J,mappings:Re}).strict(),da=e.object({operationId:T,id:T.optional(),expectedRevision:e.number().int().nonnegative(),request:D,maximumCostUsd:e.number().finite().positive().max(1e4),graders:e.array(ke).min(1).max(100).optional()}).strict().superRefine((t,n)=>{t.request.name||n.addIssue({code:"custom",path:["request","name"],message:"Name this Experiment before saving it."}),!!t.id!=t.expectedRevision>0&&n.addIssue({code:"custom",path:["expectedRevision"],message:"An update requires its saved definition revision."}),Math.round(t.maximumCostUsd*1e6)<1&&n.addIssue({code:"custom",path:["maximumCostUsd"],message:"The budget must be at least $0.000001."}),t.graders&&new Set(t.graders.map(i=>i.id)).size!==t.graders.length&&n.addIssue({code:"custom",path:["graders"],message:"Select each grader once."})}),dn=e.object({schemaVersion:e.literal("openpond.experimentDefinition.v1"),id:T,teamId:T,revision:e.number().int().positive(),request:D,maximumCostUsd:e.number().finite().positive().max(1e4),graders:e.array(Pe).min(1).max(100),createdAt:e.iso.datetime(),updatedAt:e.iso.datetime()}).strict(),ua=dn.extend({contentHash:J}),la=e.object({operationId:T,definition:we}).strict(),ga=e.object({projectId:T.optional(),datasetHash:J.optional(),search:e.string().trim().max(200).optional(),status:e.enum(["queued","running","cancelling","completed","failed","cancelled"]).optional(),afterId:T.optional(),limit:e.number().int().min(1).max(100).default(30)}).strict(),ha=e.object({definition:we.nullable(),configurationHash:J.optional(),admissionRequestHash:J.optional(),sourceExperimentId:T.optional(),maximumCostUsd:e.number().finite().positive().max(1e4),graders:e.array(Pe).min(1).max(100)}).strict().superRefine((t,n)=>{t.definition===null&&(!t.configurationHash||!t.admissionRequestHash)&&n.addIssue({code:"custom",path:["configurationHash"],message:"A flat Experiment requires its sealed configuration hash."})}),fa=e.object({operationId:T,profileRepositoryId:T,definitionId:T,modelId:T,localRuntime:M.shape.localRuntime,maxOutputTokens:M.shape.maxOutputTokens,temperature:M.shape.temperature,topP:M.shape.topP,reasoningEffort:e.enum(["off","low","medium","high","xhigh","max"]).optional(),maximumCostUsd:e.number().finite().positive().max(1e4),externalDatasetBinding:ee.optional(),sourceCandidate:M.shape.sourceCandidate}).strict(),ba=e.object({request:D,manifest:ne,maximumCostUsd:e.number().finite().positive().max(1e4),graders:e.array(Pe).min(1).max(100)}).strict();var Pt=e.string().trim().min(1).max(200),_e=e.object({operationId:Pt,request:D,maximumCostUsd:e.number().finite().positive().max(1e4),graders:e.array(ke).min(1).max(100).optional(),sourceExperimentId:Pt.optional()}).strict().superRefine((t,n)=>{t.request.name||n.addIssue({code:"custom",path:["request","name"],message:"Name this Experiment before starting it."}),t.operationId!==t.request.operationId&&n.addIssue({code:"custom",path:["request","operationId"],message:"Use one operation identity for this Experiment."}),Math.round(t.maximumCostUsd*1e6)<1&&n.addIssue({code:"custom",path:["maximumCostUsd"],message:"The spending cap must be at least $0.000001."}),t.graders&&new Set(t.graders.map(i=>i.id)).size!==t.graders.length&&n.addIssue({code:"custom",path:["graders"],message:"Select each grader once."})});var g=e.string().trim().min(1).max(200),H=e.string().regex(/^[a-f0-9]{64}$/),oe=e.object({id:g,contentHash:H}).strict(),Aa=e.object({available:e.boolean(),reason:e.string().max(1e3).nullable(),origin:U.nullable()}).strict(),kt=e.object({schemaVersion:e.literal("openpond.postTrainingAttachment.v1"),binding:e.object({kind:e.enum(["preparation","policy"]),id:g,revision:e.number().int().positive(),contentHash:H}).strict(),projectId:g.nullable(),automatic:e.boolean(),maximumSpendUsd:e.number().finite().positive().max(1e4),experiments:e.array(e.object({id:g,configuration:_e}).strict()).min(1).max(20),acceptancePlan:rt.nullable()}).strict().superRefine((t,n)=>{if(new Set(t.experiments.map(i=>i.id)).size!==t.experiments.length&&n.addIssue({code:"custom",message:"Attach each evaluation once."}),t.experiments.reduce((i,a)=>i+a.configuration.maximumCostUsd,0)>t.maximumSpendUsd+1e-9&&n.addIssue({code:"custom",message:"Attached evaluation budgets exceed the total approved budget."}),t.experiments.some(i=>(i.configuration.request.project?.id??null)!==t.projectId)&&n.addIssue({code:"custom",message:"Attached experiments must use the training Project."}),t.acceptancePlan){let i=new Set(t.acceptancePlan.checks.map(r=>r.id));t.acceptancePlan.checks.some(r=>!t.experiments.some(o=>o.id===r.id))&&n.addIssue({code:"custom",message:"Select the frozen Experiment for each acceptance check."}),t.acceptancePlan.maximumSpendUsd+t.experiments.filter(r=>!i.has(r.id)).reduce((r,o)=>r+o.configuration.maximumCostUsd,0)>t.maximumSpendUsd+1e-9&&n.addIssue({code:"custom",message:"Paired acceptance and diagnostic ceilings exceed the approved evaluation budget."})}});var un=e.object({baseline:oe,checks:e.array(e.object({id:g,sourceRunId:g,sourceManifestHash:H,targetConfigurationHash:H,executionHash:H,populationHash:H,evaluator:oe,feedbackKey:g,output:e.enum(["boolean","score"]),unit:e.string().min(1).max(80)}).strict()).min(1).max(100)}).strict(),ln=e.enum(["waiting_for_training","ready","preparing","queued","running","cleaning","completed","failed","blocked","cancelled","budget_exhausted"]),_t=e.object({schemaVersion:e.literal("openpond.postTrainingSummary.v1"),id:g,teamId:g,jobId:g,revision:e.number().int().positive(),planHash:H,automatic:e.boolean(),candidate:oe.nullable(),state:ln,total:e.number().int().positive(),completed:e.number().int().nonnegative(),failed:e.number().int().nonnegative(),requiredOutcome:e.enum(["none","pending","passed","failed","blocked"]),reason:e.string().max(500).nullable(),groupId:g.nullable(),experimentIds:e.array(g).max(20),updatedAt:e.iso.datetime()}).strict().superRefine((t,n)=>{t.completed+t.failed>t.total&&n.addIssue({code:"custom",message:"Evaluation totals are inconsistent."}),["preparing","queued","running","cleaning","completed"].includes(t.state)&&!t.candidate&&n.addIssue({code:"custom",message:"Evaluation execution requires the exact trained candidate."})}),gn=e.object({operationId:g,expectedRevision:e.number().int().positive(),planHash:H}).strict(),hn=e.object({operationId:g,attachment:kt}).strict(),fn=e.object({id:g,teamId:g,ownerUserId:g,attachment:kt,qualification:un.nullable(),contentHash:H,createdAt:e.iso.datetime()}).strict();function bn(t){let n=fn.parse(t);if(n.contentHash!==w({attachment:n.attachment,qualification:n.qualification}))throw new Error("The retained evaluation attachment or qualification changed.");return n}s(bn,"verifyPostTrainingPlan");function jt(t){let{request:n}=t,i={accept:"application/json","content-type":"application/json"},a=s(o=>`/v1/training/jobs/${encodeURIComponent(g.parse(o))}/post-training`,"path");async function r(o,m,c){if(o===null)return null;let x=_t.parse(o);if(x.teamId!==m||x.jobId!==c)throw new d("post_training_scope_mismatch","The evaluation summary belongs to another run or workspace.");return x}return s(r,"read"),{async attach(o,m){let c=hn.parse(m),x=bn(await n("/v1/training/post-training-plans",{method:"POST",headers:i,body:JSON.stringify(c)}));if(x.teamId!==o||await u(x.attachment)!==await u(c.attachment))throw new d("post_training_plan_mismatch","The retained attachment differs from the reviewed plan.");return x},async get(o,m){return r(await n(a(m),{headers:i}),o,m)},async control(o,m,c,x){let R=gn.parse(x),v=await r(await n(`${a(m)}/${c}`,{method:"POST",headers:i,body:JSON.stringify(R)}),o,m);if(!v||v.planHash!==R.planHash)throw new d("post_training_control_mismatch","Evaluation control did not retain the approved plan.");return v}}}s(jt,"createPostTrainingClient");var Ca=e.object({teamId:g,actorId:g,projectId:g.nullable(),configuration:xe,batches:e.array(tt).max(1e4),sources:e.array(et).max(1e4),definitions:e.array(Ze).max(1e4),experiments:e.array(e.object({id:g,name:e.string().max(500),configuration:_e,graders:e.array(e.object({feedbackKey:g,name:e.string().max(500),ref:oe}).strict()).max(100)}).strict()).max(1e4)}).strict(),qa=e.enum(["prepare","start","cancel","publish","attach"]),za=e.object({teamId:g,actorId:g,configuration:xe,policy:nt,inspection:at,iterations:e.array(e.object({iteration:it,evals:_t.nullable()}).strict()).max(100),nextCursor:g.nullable()}).strict(),Ma=e.object({id:g,expectedRevision:e.number().int().positive(),policyHash:H,operationId:g,action:e.enum(["pause","resume","reserve","cancel-iteration","retry-iteration"]),iterationId:g.optional(),iterationRevision:e.number().int().positive().optional()}).strict();var K=e.string().trim().min(1).max(191),se=e.string().regex(/^[a-f0-9]{64}$/),Ht=e.object({schemaVersion:e.literal("openpond.checkpointRecoveryResourceApproval.v1"),ownerUserId:K,teamId:K,sourceJobId:K,sourceJobVersion:e.number().int().positive(),sourceInputManifestSha256:se,checkpointId:K,adapterSha256:se,resumeSha256:se,idempotencyKey:e.string().trim().min(16).max(191),approvedAt:e.iso.datetime({offset:!0}),maximumSpendUsd:e.number().positive().finite().max(30).refine(t=>Number(t.toFixed(6))===t,"Recovery spend must use whole microdollars"),maximumGpuSeconds:e.number().int().positive().max(21600),maximumWallSeconds:e.number().int().positive().max(21600)}).strict(),W=Ht.extend({approvalHash:se}).strict().superRefine((t,n)=>{t.maximumGpuSeconds>t.maximumWallSeconds&&n.addIssue({code:"custom",path:["maximumGpuSeconds"],message:"Recovery GPU duration exceeds its wall"})});async function xn(t){let n=Ht.parse(t);return W.parse({...n,approvalHash:await u(n)})}s(xn,"createTrainingCheckpointRecoveryResourceApproval");var je=e.object({resourceApproval:W.optional(),mode:e.literal("evaluation_only").optional(),evaluationGpuType:e.enum(["NVIDIA A100 80GB PCIe","NVIDIA A100-SXM4-80GB","NVIDIA H100 80GB HBM3"]).optional(),expectedVersion:e.number().int().positive(),checkpointId:K,idempotencyKey:e.string().trim().min(16).max(191),maximumSpendUsd:e.number().positive().finite(),maximumWallSeconds:e.number().int().positive().max(21600)}).strict().superRefine((t,n)=>{t.evaluationGpuType&&t.mode!=="evaluation_only"&&n.addIssue({code:"custom",path:["evaluationGpuType"],message:"GPU substitution requires explicit evaluation-only recovery"});let i=t.resourceApproval;i&&(i.sourceJobVersion!==t.expectedVersion||i.checkpointId!==t.checkpointId||i.idempotencyKey!==t.idempotencyKey||i.maximumSpendUsd!==t.maximumSpendUsd||i.maximumWallSeconds!==t.maximumWallSeconds)&&n.addIssue({code:"custom",path:["resourceApproval"],message:"Recovery resource approval does not match its request"})});var X=e.object({mode:e.literal("reuse_only"),physicalWorkerId:e.string().trim().min(1).max(191),providerPodId:e.string().trim().min(1).max(191),workerImageDigest:e.string().regex(/^sha256:[a-f0-9]{64}$/),baseProfileSha256:e.string().regex(/^[a-f0-9]{64}$/),gpuType:e.string().trim().min(1).max(200),sourceJobId:e.string().trim().min(1).max(191),sourceInputManifestSha256:e.string().regex(/^[a-f0-9]{64}$/),ownerTeamId:e.string().trim().min(1).max(191),deadlineAt:e.string().datetime({offset:!0})}).strict();var S=e.string().trim().min(1).max(191),Y=e.string().regex(/^[a-f0-9]{64}$/),Ee=e.object({schemaVersion:e.literal("openpond.trainingPreparationRequest.v1"),teamId:S,operationId:S,projectId:S.nullable(),configuration:e.object({id:S,expectedRevision:e.number().int().positive(),expectedEtag:Y}).strict(),origin:U.optional(),batch:b,name:e.string().trim().min(1).max(191),maximumSpendUsd:e.number().finite().positive().max(1e6),gpuSelection:A.optional(),physicalPlacement:X.optional()}).strict(),Et=e.object({schemaVersion:e.literal("openpond.trainingPreparationPlan.v1"),id:S,creatorUserId:S,request:Ee,requestHash:Y,source:e.lazy(()=>Ce),submissionHash:Y,createdAt:e.string().datetime({offset:!0})}).strict(),At=Et.extend({contentHash:Y}).strict(),Ae=e.object({schemaVersion:e.literal("openpond.trainingPreparationReceipt.v1"),plan:At,revision:e.number().int().positive(),state:e.enum(["prepared","submitted","cancelled"]),jobId:S.nullable()}).strict().superRefine((t,n)=>{t.state==="submitted"!=!!t.jobId&&n.addIssue({code:"custom",path:["jobId"],message:"Only submitted preparations identify a job."})}),He=e.object({teamId:S,planHash:Y,expectedRevision:e.number().int().positive(),estimateReview:$.optional()}).strict(),Ct=e.object({projectId:S.optional(),state:e.enum(["prepared","submitted","cancelled"]).optional(),afterId:S.optional(),limit:e.number().int().min(1).max(100).default(25)}).strict(),qt=e.object({schemaVersion:e.literal("openpond.trainingPreparationPage.v1"),teamId:S,items:e.array(Ae).max(100),nextCursor:S.nullable()}).strict();async function zt(t){let n=Ae.parse(t),{contentHash:i,...a}=n.plan;if(await u(a)!==i||await u(a.request)!==a.requestHash||a.source.modelProject.id!==a.request.configuration.id||await u(a.source.origin??null)!==await u(a.request.origin??null))throw new d("training_preparation_mismatch","The prepared training inputs changed.");return n}s(zt,"parseAndVerifyTrainingPreparationReceipt");function Mt(t){async function n(i,a,r){let o=await zt(i);if(o.plan.request.teamId!==a||r&&o.plan.id!==r)throw new d("training_preparation_scope_mismatch","The training preparation belongs to a different workspace or request.");return o}return s(n,"read"),{async listPreparations(i,a={}){let r=S.parse(i),o=Ct.parse(a),m=new URLSearchParams;for(let[R,v]of Object.entries(o))m.set(R,String(v));let c=qt.parse(await t(`/v1/training/preparations?${m}`));if(c.teamId!==r||c.items.length>o.limit||new Set(c.items.map(R=>R.plan.id)).size!==c.items.length||c.nextCursor!==null&&(c.nextCursor!==c.items.at(-1)?.plan.id||c.nextCursor===o.afterId))throw new d("training_preparation_page_mismatch","The preparation page does not match its workspace or cursor.");let x=await Promise.all(c.items.map(async R=>{let v=await n(R,r);if(o.projectId&&v.plan.request.projectId!==o.projectId||o.state&&v.state!==o.state)throw new d("training_preparation_page_mismatch","A preparation does not match the requested Project or state.");return v}));return{...c,items:x}},async prepareRun(i){let a=Ee.parse(i),r=await n(await t("/v1/training/preparations",{method:"POST",body:JSON.stringify(a)}),a.teamId);if(r.plan.requestHash!==await u(a))throw new d("training_preparation_request_mismatch","The preparation does not match the requested run.");return r},async getPreparation(i,a){return n(await t(`/v1/training/preparations/${encodeURIComponent(S.parse(a))}`),S.parse(i),a)},async startPreparation(i,a){let r=He.parse(a),o=await n(await t(`/v1/training/preparations/${encodeURIComponent(S.parse(i))}/start`,{method:"POST",body:JSON.stringify(r)}),r.teamId,i);if(o.plan.contentHash!==r.planHash||o.state!=="submitted")throw new d("training_preparation_start_mismatch","The submitted run does not match the approved preparation.");return o},async cancelPreparation(i,a){let r=He.parse(a),o=await n(await t(`/v1/training/preparations/${encodeURIComponent(S.parse(i))}/cancel`,{method:"POST",body:JSON.stringify(r)}),r.teamId,i);if(o.plan.contentHash!==r.planHash||o.state!=="cancelled")throw new d("training_preparation_cancel_mismatch","The preparation cancellation could not be verified.");return o}}}s(Mt,"createTrainingPreparationClient");var I=e.string().trim().min(1).max(191),L=e.string().regex(/^[a-f0-9]{64}$/),qe=e.string().datetime({offset:!0}),P=e.number().finite().nonnegative(),Ot=e.discriminatedUnion("kind",[e.object({kind:e.literal("preparation"),id:I,planHash:L,expectedRevision:e.number().int().positive()}).strict(),e.object({kind:e.literal("configuration"),id:I,expectedRevision:e.number().int().positive(),expectedEtag:L,batch:b.nullable().default(null)}).strict(),e.object({kind:e.literal("submission"),submission:e.lazy(()=>ze)}).strict()]),Ut=e.object({schemaVersion:e.literal("openpond.trainingEstimateRequest.v1"),teamId:I,source:Ot,gpuSelection:A.optional()}).strict(),ce=e.object({low:P,high:P}).strict().refine(t=>t.high>=t.low,"Planning range must be ordered"),Gt=e.object({phase:e.enum(["startup","baseline_evaluation","rollouts","optimization","checkpointing","backbone_materialization","final_evaluation","publication","cleanup","retention"]),resource:e.enum(["gpu","cpu","judge","storage","network"]),expectedUsd:P.nullable(),expectedSeconds:P.nullable(),planningRangeUsd:ce.nullable(),evidence:e.enum(["measured","configured_rate","unavailable"]),reason:e.string().trim().min(1).max(1e3).nullable()}).strict();function Dt(t){return t.kind==="submission"?{kind:t.kind,id:t.submission.idempotencyKey,contentHash:t.submission.contentHash,revision:null}:t.kind==="preparation"?{kind:t.kind,id:t.id,contentHash:t.planHash,revision:t.expectedRevision}:{kind:t.kind,id:t.id,contentHash:t.expectedEtag,revision:t.expectedRevision}}s(Dt,"trainingEstimateSourceIdentity");var Jt=e.object({schemaVersion:e.literal("openpond.trainingEstimate.v1"),id:I,teamId:I,requestHash:L,inputHash:L,source:e.object({kind:e.enum(["preparation","configuration","submission"]),id:I,contentHash:L,revision:e.number().int().positive().nullable()}).strict(),status:e.enum(["available","partial","insufficient_evidence"]),currency:e.literal("USD"),createdAt:qe,expiresAt:qe,estimatorVersion:I,runtimeVersion:I,pricing:e.object({version:I,quoteExpiresAt:qe.nullable()}).strict(),gpu:e.object({requested:A,resolved:e.object({availabilityId:I,gpuType:e.string().min(1).max(256),gpuCount:e.union([e.literal(1),e.literal(2)])}).strict().nullable(),customerHourlyUsd:P.nullable(),availability:e.enum(["available","limited","unavailable","unknown"])}).strict(),configuration:e.object({modelId:I,modelRevision:e.string().min(1).max(256),method:I,loraRank:e.number().int().positive().nullable(),adapterMode:e.enum(["residual_append","shared","sequential_merge"]).nullable(),groups:e.number().int().nonnegative().nullable(),rolloutConcurrency:e.number().int().positive().nullable(),maxOutputTokens:e.number().int().positive().nullable(),trainingRows:e.number().int().nonnegative().nullable(),evaluationRows:e.number().int().nonnegative().nullable(),retentionDays:e.number().int().positive().nullable(),approvedMaximumUsd:P.nullable()}).strict(),cost:e.object({expectedUsd:P.nullable(),planningRangeUsd:ce.nullable(),knownMinimumUsd:P,recommendedMaximumUsd:P.nullable(),minimumCleanupReserveUsd:P.nullable(),components:e.array(Gt).max(50)}).strict(),executionSeconds:e.object({expected:P.nullable(),planningRange:ce.nullable()}).strict(),queueWaitSeconds:e.object({expected:P,planningRange:ce.nullable()}).strict().nullable(),calibration:e.object({version:I,cohortHash:L,completedSamples:e.number().int().nonnegative(),partialSamples:e.number().int().nonnegative(),scope:e.enum(["workspace","authorized_aggregate"])}).strict(),assumptions:e.array(e.string().trim().min(1).max(1e3)).max(50),unknowns:e.array(e.string().trim().min(1).max(1e3)).max(50),review:$}).strict().superRefine((t,n)=>{(t.review.estimateId!==t.id||t.review.inputHash!==t.inputHash||t.review.requestHash!==t.requestHash||t.review.pricingVersion!==t.pricing.version||t.review.expiresAt!==t.expiresAt)&&n.addIssue({code:"custom",path:["review"],message:"Estimate review identity differs from the estimate"}),Date.parse(t.expiresAt)<=Date.parse(t.createdAt)&&n.addIssue({code:"custom",path:["expiresAt"],message:"Estimate must expire after its creation"}),t.status==="available"&&(t.cost.expectedUsd===null||t.executionSeconds.expected===null||t.unknowns.length>0)&&n.addIssue({code:"custom",path:["status"],message:"An available estimate requires complete cost and duration coverage"}),t.gpu.requested.mode==="manual"&&t.gpu.resolved&&(t.gpu.requested.availabilityId!==t.gpu.resolved.availabilityId||t.gpu.requested.gpuType!==t.gpu.resolved.gpuType)&&n.addIssue({code:"custom",path:["gpu"],message:"An explicit GPU offering cannot be substituted"}),t.gpu.resolved&&t.gpu.resolved.gpuCount!==(t.gpu.requested.gpuCount??1)&&n.addIssue({code:"custom",path:["gpu","resolved","gpuCount"],message:"The resolved GPU count must match the requested count"})});function $t(t){return{async estimate(n){let i=Ut.parse(n);i.source.kind==="submission"&&await me(i.source.submission);let a=Jt.parse(await t("/v1/training/estimates",{method:"POST",body:JSON.stringify(i)}));if(a.teamId!==i.teamId||a.requestHash!==await u(i)||await u(a.source)!==await u(Dt(i.source))||i.gpuSelection&&await u(a.gpu.requested)!==await u(i.gpuSelection))throw new d("training_estimate_scope_mismatch","The estimate does not match the requested workspace and exact configuration.");return a}}}s($t,"createTrainingEstimateClient");var pe=e.string().datetime({offset:!0}),Me=e.object({ticketId:e.string().trim().min(1).max(191),ticketNumber:e.number().int().positive().max(Number.MAX_SAFE_INTEGER),label:e.literal("Waiting for resources"),position:e.number().int().positive().nullable(),positionScope:e.literal("compatible_fair_queue"),enqueuedAt:pe,asOf:pe,estimate:e.object({revision:e.number().int().nonnegative(),estimatedStartAt:pe,expiresAt:pe,evidence:e.enum(["observed_capacity","measured_bootstrap","scheduled_release"])}).strict().nullable()}).strict().superRefine((t,n)=>{t.estimate&&Date.parse(t.estimate.expiresAt)<=Date.parse(t.asOf)&&n.addIssue({code:"custom",path:["estimate"],message:"An expired queue forecast must be returned as unavailable"})});var Nt=e.object({schemaVersion:e.literal("openpond.trainingHarnessSourcePublication.v1"),harnessRelease:ue,sourcePackageHash:e.string().regex(/^[a-f0-9]{64}$/),sizeBytes:e.number().int().positive().max(67108864)}).strict();function Bt(t){let n=s(i=>{let a=ue.parse(i);return`/v1/training/harness-sources/${encodeURIComponent(a.id)}/${a.contentHash}`},"route");return{async publishHarnessSource(i){k(i,67108864,"Training Harness source");let a=Vt(i),r=a.agentSnapshot.portability;if(!r.portable||r.blockers.length||r.localOnlyAssetRefs.length||r.hostPrivateAssetRefs.length||a.schemaVersion==="openpond.harnessSourcePackage.v1"&&a.harnessRelease.files.some(m=>m.visibility!=="policy"))throw new Error("Hosted training Harness publication requires portable, policy-visible source.");let o=Nt.parse(await t(n({id:a.harnessRelease.id,contentHash:a.harnessRelease.contentHash}),{method:"PUT",body:JSON.stringify(a)}));if(o.harnessRelease.id!==a.harnessRelease.id||o.harnessRelease.contentHash!==a.harnessRelease.contentHash||o.sourcePackageHash!==a.contentHash)throw new Error("Published Harness source differs from the selected immutable package.");return o},async getHarnessSource(i){let a=await t(n(i),void 0,67108864);return k(a,67108864,"Training Harness source"),Vt(a,i)}}}s(Bt,"createTrainingHarnessSourceClient");function Vt(t,n){return typeof t=="object"&&t!==null&&Reflect.get(t,"schemaVersion")==="openpond.harnessPolicySourcePackage.v1"?$e(t,n):Ve(t,n)}s(Vt,"validateSource");var O=e.string().trim().min(1).max(500),yn=e.string().regex(/^[a-f0-9]{64}$/),de=e.object({schemaVersion:e.literal("openpond.trainingCandidateDecisionRequest.v1"),teamId:O,jobId:O,artifact:p,evaluation:p,executionReceipt:p,decision:e.enum(["accepted","rejected"]),reason:e.string().trim().min(1).max(5e3),idempotencyKey:O,expectedDecision:p.nullable()}).strict(),Lt=e.object({schemaVersion:e.literal("openpond.trainingCandidateDecision.v1"),id:O,request:de,revision:e.number().int().positive(),actor:e.object({userId:O,kind:e.enum(["user","api_key","agent_delegate"]),id:O}).strict(),decidedAt:e.string().datetime({offset:!0}),contentHash:yn}).strict().superRefine((t,n)=>{t.revision===1!=(t.request.expectedDecision===null)&&n.addIssue({code:"custom",path:["revision"],message:"A first decision has no predecessor; later decisions must reference the prior decision."}),t.request.expectedDecision?.id===t.id&&n.addIssue({code:"custom",path:["request","expectedDecision"],message:"A decision cannot supersede itself."})});async function Qt(t){let{contentHash:n,...i}=t;return u(i)}s(Qt,"trainingCandidateDecisionHash");async function Oe(t,n){k(t,32768,"Training candidate decision");let i=Lt.parse(t);if(i.contentHash!==await Qt(i))throw new d("content_hash_mismatch","Training candidate decision content hash does not match.");if(i.request.teamId!==n.teamId||i.request.jobId!==n.jobId||i.request.artifact.id!==n.artifact.id||i.request.artifact.contentHash!==n.artifact.contentHash)throw new d("candidate_decision_identity_mismatch","Training candidate decision belongs to a different team, Job or artifact.");if(n.request&&await u(i.request)!==await u(de.parse(n.request)))throw new d("candidate_decision_request_mismatch","Training candidate decision does not match the submitted review.");return i}s(Oe,"parseAndVerifyTrainingCandidateDecision");function Ft(t){function n(i){return`/v1/training/jobs/${encodeURIComponent(O.parse(i.jobId))}/candidates/${encodeURIComponent(p.parse(i.artifact).id)}/decision`}return s(n,"route"),{async candidateDecision(i,a={}){O.parse(i.teamId);let r=a.decision?p.parse(a.decision):void 0,o=r?`?decisionId=${encodeURIComponent(r.id)}`:"",m=e.object({decision:e.unknown().nullable()}).strict().parse(await t(`${n(i)}${o}`));if(m.decision===null&&!r)return null;let c=await Oe(m.decision,i);if(r&&(c.id!==r.id||c.contentHash!==r.contentHash))throw new d("candidate_decision_identity_mismatch","Training candidate decision does not match the requested history entry.");return c},async recordCandidateDecision(i){let a=de.parse(i),r=await t(n(a),{method:"POST",body:JSON.stringify(a)});return Oe(r,{...a,request:a})}}}s(Ft,"createTrainingCandidateDecisionClient");var Q=e.string().trim().min(1).max(500),Z=e.string().regex(/^[a-f0-9]{64}$/),Kt=e.object({taskId:Q,taskSha256:Z,resultSha256:Z,input:e.object({instruction:e.string().max(1e6),context:e.record(e.string(),e.unknown())}).strict(),output:e.string().max(1e6),outputSha256:Z,score:e.number().finite().min(0).max(1),evidence:e.object({kind:e.enum(["worker_command","hosted_trace","local_trace"]),id:Q}).strict()}).strict(),Wt=e.object({schemaVersion:e.literal("openpond.trainingEvaluationTaskPage.v1"),jobId:Q,teamId:Q,evaluation:p,kind:e.enum(["baseline","candidate"]),policyVersion:e.number().int().nonnegative(),taskset:b,panelSha256:Z,offset:e.number().int().nonnegative(),total:e.number().int().min(1).max(1e4),tasks:e.array(Kt).min(1).max(100),nextCursor:e.string().regex(/^[1-9]\d*$/).nullable(),contentHash:Z}).strict().superRefine((t,n)=>{let i=t.offset+t.tasks.length,a=i<t.total?String(i):null;(i>t.total||t.nextCursor!==a)&&n.addIssue({code:"custom",path:["nextCursor"],message:"Evaluation pagination must cover consecutive task positions."}),new Set(t.tasks.map(r=>r.taskId)).size!==t.tasks.length&&n.addIssue({code:"custom",path:["tasks"],message:"Evaluation task identities must be unique."})});async function Xt(t){let{contentHash:n,...i}=t;return u(i)}s(Xt,"trainingEvaluationTaskPageHash");async function Ue(t,n){k(t,8388608,"Training evaluation task page");let i=Wt.parse(t),a=p.parse(n.evaluation);if(i.jobId!==Q.parse(n.jobId)||i.evaluation.id!==a.id||i.evaluation.contentHash!==a.contentHash||i.offset!==(n.offset??0)||n.teamId!==void 0&&i.teamId!==Q.parse(n.teamId))throw new d("evaluation_page_identity_mismatch","Evaluation results differ from the requested Job, evaluation, or page.");if(await Xt(i)!==i.contentHash)throw new d("evaluation_page_hash_mismatch","Evaluation task page content hash did not match.");for(let r of i.tasks)if(await u(r.output)!==r.outputSha256)throw new d("evaluation_output_hash_mismatch","A retained evaluation output hash did not match.");return i}s(Ue,"parseAndVerifyTrainingEvaluationTaskPage");var Sn=e.array(e.object({id:e.string().trim().min(1)}).catchall(e.unknown())).min(1).max(1e3),Tn=e.object({binding:Fe,rewards:e.array(Qe).min(1).max(100)}).strict();async function vn(t){let n=t.rewardExecution?Tn.parse(t.rewardExecution):null,i=Sn.parse(n?We(n.binding,n.rewards):t.graders);if(new Set(i.map(r=>r.id)).size!==i.length)throw new Error("Training grader identities must be unique.");let a=await u({schemaVersion:"openpond.trainingGraderSet.v1",graders:i});return{kind:"deterministic",grader:{id:`training-graders-${a.slice(0,32)}`,contentHash:a},composer:n?{id:n.binding.id,contentHash:n.binding.contentHash}:null}}s(vn,"deterministicTrainingRewardSource");var In="evaluation-source.json",Ge=e.object({id:e.string().trim().min(1),clusterKey:e.string().trim().min(1),split:e.enum(["train","validation","frozen_eval"])}).passthrough(),Yt=e.object({schemaVersion:e.literal("openpond.trainingEvaluationSource.v1"),taskset:b,tasks:e.array(Ge).min(1).max(1e4),assets:e.array(e.object({path:e.string().trim().min(1).max(2e3),sha256:e.string().regex(/^[a-f0-9]{64}$/),sizeBytes:e.number().int().nonnegative(),encoding:e.literal("base64"),content:e.string().max(32*1024*1024)}).strict()).max(1e4)}).strict().superRefine((t,n)=>{let i=new Set;t.tasks.forEach((a,r)=>{a.split==="train"&&n.addIssue({code:"custom",path:["tasks",r,"split"],message:"Evaluation sources require held-out tasks."}),i.has(a.id)&&n.addIssue({code:"custom",path:["tasks",r,"id"],message:"Evaluation task identities must be unique."}),i.add(a.id)})});function Rn(t,n){let i=e.array(Ge).min(1).max(1e4).parse(t),a=e.array(Ge).min(1).max(1e4).parse(n),r=new Set,o=new Set;for(let c of i){if(c.split!=="train")throw new Error("The training population contains a held-out task.");if(r.has(c.id))throw new Error("Training task identities must be unique.");r.add(c.id),o.add(c.clusterKey)}let m=new Set;for(let c of a){if(c.split==="train")throw new Error("The evaluation population contains a training task.");if(m.has(c.id))throw new Error("Evaluation task identities must be unique.");if(r.has(c.id)||o.has(c.clusterKey))throw new Error("Training and evaluation tasks or families overlap.");m.add(c.id)}}s(Rn,"assertTrainingEvaluationIsolation");async function wn(t){let n=Yt.parse(t),i=await u(n);return{taskset:n.taskset,dataset:{id:`training-evaluation-${i.slice(0,32)}`,contentHash:i}}}s(wn,"trainingEvaluationSourceRef");var l=e.string().trim().min(1).max(500),f=e.string().regex(/^[a-f0-9]{64}$/),j=e.string().datetime({offset:!0}),Pn=e.object({schemaVersion:e.literal("openpond.trainingInputArtifactUpload.v2"),kind:e.enum(["portable_training_bundle","reward_model_dataset"]),idempotencyKey:e.string().trim().min(1).max(500),sourceManifest:p,payload:e.unknown(),contentHash:f}).strict(),kn=e.object({schemaVersion:e.literal("openpond.trainingInputArtifact.v2"),kind:e.enum(["portable_training_bundle","reward_model_dataset"]),sourceManifest:p,artifactRef:e.string().trim().min(1).max(2e3),contentHash:f,sizeBytes:e.number().int().positive(),createdAt:j}).strict();async function _n(t){let{contentHash:n,...i}=t;return u(i)}s(_n,"trainingInputArtifactUploadHash");async function jn(t){k(t,67108864,"Training input artifact");let n=Pn.parse(t),i=await _n(n);if(n.contentHash!==i)throw new d("content_hash_mismatch",`Training input artifact contentHash ${n.contentHash} does not match ${i}.`);return n}s(jn,"parseAndVerifyTrainingInputArtifactUpload");var en=e.enum(["reward_model_train","policy_optimize"]),Hn=e.enum(["queued","admitting","provisioning","running","stopping","cancelling","succeeded","failed","cancelled"]),En=e.object({id:l,version:e.string().trim().min(1).max(200).nullable().default(null),required:e.boolean().default(!0)}).strict(),Ce=e.object({origin:U.optional(),modelProject:e.object({id:l,portableProjectId:l,revision:e.number().int().positive(),contentHash:f}).strict(),harnessRunManifest:p,harnessRelease:p,taskset:b,tasksetRelease:p,evaluation:e.object({taskset:b,dataset:p}).strict().nullable().optional(),dataset:p,evidenceSets:e.array(p).max(1e4)}).strict(),An=e.object({kind:e.literal("reward_model_train"),baseModel:ie,preferenceDatasetRelease:p,processorRelease:p,recipe:e.object({schemaVersion:e.literal("openpond.rewardModelRecipe.v1"),method:e.literal("reward_model"),parameterization:e.literal("lora_with_scalar_head")}).catchall(e.unknown())}).strict(),Cn=e.object({kind:e.literal("deterministic"),grader:p,composer:p.nullable().default(null)}).strict(),qn=e.object({kind:e.literal("learned_reward"),rewardModelVersion:p,qualificationReport:p.nullable().default(null),evaluationReferences:e.array(p).max(1e3).default([]),scorerArtifact:e.object({artifactRef:e.string().trim().min(1).max(2e3),contentHash:f,executionReceipt:p}).strict(),processorRelease:p,rewardComposerRelease:p}).strict(),tn=ie.extend({revision:e.string().regex(/^[a-f0-9]{40,64}$/),tokenizerRevision:e.string().regex(/^[a-f0-9]{40,64}$/),chatTemplateHash:f}).strict(),zn=e.object({kind:e.literal("policy_optimize"),executionMode:e.literal("qualification").optional(),baseModel:ie,recipe:pt,rewardSource:e.discriminatedUnion("kind",[Cn,qn]),resumeFrom:p.nullable().default(null)}).strict().superRefine((t,n)=>{if(t.recipe.method!=="sft")return;let i=z.safeParse(t.recipe);if(!i.success){n.addIssue({code:"custom",path:["recipe"],message:"The SFT recipe is incomplete or invalid."});return}(t.executionMode||t.resumeFrom||"continuation"in t.recipe)&&n.addIssue({code:"custom",message:"Initial managed SFT requires a fresh supervised run without rollout qualification or continuation."}),(i.data.baseModel.id!==t.baseModel.modelId||i.data.baseModel.revision!==t.baseModel.revision||i.data.baseModel.tokenizerRevision!==t.baseModel.tokenizerRevision||i.data.baseModel.chatTemplateHash!==t.baseModel.chatTemplateHash)&&n.addIssue({code:"custom",path:["baseModel"],message:"The SFT recipe must pin the exact submitted base and tokenizer."})}),Mn=e.discriminatedUnion("kind",[An,zn]),On=e.object({approvalHash:f,approvedAt:j,exportApproved:e.boolean(),maximumSpendUsd:e.number().nonnegative(),retentionDays:e.number().int().nonnegative().nullable(),region:e.string().trim().min(1).max(200).nullable().default(null)}).strict(),ze=e.object({schemaVersion:e.literal("openpond.trainingJobSubmission.v2"),idempotencyKey:e.string().trim().min(1).max(500),name:e.string().trim().min(1).max(200),source:Ce,job:Mn,requestedCapabilities:e.array(En).max(1e3),placementObjective:e.enum(["fast","balanced","economical"]),gpuSelection:A.optional(),physicalPlacement:X.optional(),budget:e.object({maximumSpendUsd:e.number().nonnegative(),maximumWallSeconds:e.number().int().positive()}).strict(),approval:On,contentHash:f}).strict().superRefine((t,n)=>{let i=(t.gpuSelection?.gpuCount??1)===2,a=t.requestedCapabilities.some(r=>r.id==="managed_rl.policy.data_parallel"&&r.version==="1"&&r.required);if(i!==a&&n.addIssue({code:"custom",path:["requestedCapabilities"],message:"Two-GPU training must require managed_rl.policy.data_parallel@1 and bind gpuSelection.gpuCount to 2."}),i&&(t.job.kind!=="policy_optimize"||t.job.executionMode||t.job.recipe.method!=="grpo"||t.physicalPlacement)&&n.addIssue({code:"custom",path:["gpuSelection"],message:"Two-GPU execution requires exclusive GRPO policy training."}),t.physicalPlacement&&(t.job.kind!=="policy_optimize"||t.job.resumeFrom||t.job.executionMode||t.job.recipe.continuation!==void 0)&&n.addIssue({code:"custom",path:["physicalPlacement"],message:"Reuse-only placement requires fresh-base policy training without continuation."}),t.job.kind==="policy_optimize"&&t.job.executionMode==="qualification"){let r=t.job;tn.safeParse(r.baseModel).success||n.addIssue({code:"custom",path:["job","baseModel"],message:"Qualification requires immutable model and tokenizer revisions and a SHA-256 chat-template pin."}),(r.resumeFrom||r.recipe.continuation!==void 0||r.rewardSource.kind!=="deterministic"||r.recipe.method!=="grpo")&&n.addIssue({code:"custom",path:["job"],message:"Qualification requires the original GRPO learner, deterministic reward, and no resume or continuation."}),t.requestedCapabilities.some(o=>o.required&&o.id==="managed_rl.policy.qualification"&&o.version==="1")||n.addIssue({code:"custom",path:["requestedCapabilities"],message:"Qualification must require managed_rl.policy.qualification@1."})}t.approval.maximumSpendUsd!==t.budget.maximumSpendUsd&&n.addIssue({code:"custom",path:["approval","maximumSpendUsd"],message:"Approved spend must equal the immutable Job budget."})});async function Un(t){let{contentHash:n,...i}=t;return u(i)}s(Un,"trainingJobSubmissionHash");async function me(t){k(t,1048576,"Training Job submission");let n=ze.parse(t),i=await Un(n);if(n.contentHash!==i)throw new d("content_hash_mismatch",`Training Job contentHash ${n.contentHash} does not match ${i}.`);return n}s(me,"parseAndVerifyTrainingJobSubmission");var Gn=e.object({resourceApproval:W.optional(),mode:e.literal("evaluation_only").optional(),trainingWorkloadComplete:e.boolean().optional(),sourceJobId:l,checkpointId:l,policyVersion:e.number().int().positive(),completedGroups:e.number().int().positive(),optimizerMode:e.literal("continue")}).strict(),F=e.object({schemaVersion:e.literal("openpond.trainingJob.v2"),id:l,teamId:l,kind:en,executionMode:e.literal("qualification").optional(),recovery:Gn.optional(),modelProjectId:l,portableProjectId:l,sourceProjectRevision:e.number().int().positive(),submissionHash:f,state:Hn,queue:Me.optional(),phase:e.string().trim().min(1).max(200),version:e.number().int().nonnegative(),progress:e.number().min(0).max(1),rolloutProgress:e.object({groupsCompleted:e.number().int().nonnegative(),groupsTarget:e.number().int().nonnegative(),optimizerUpdatesApplied:e.number().int().nonnegative(),optimizerUpdatesSkipped:e.number().int().nonnegative()}).strict(),accruedSpendUsd:e.number().nonnegative(),terminalReason:e.string().trim().min(1).max(5e3).nullable(),createdAt:j,updatedAt:j,completedAt:j.nullable()}).strict(),Dn=e.object({schemaVersion:e.literal("openpond.trainingJobPage.v2"),jobs:e.array(F).max(1e3),nextCursor:e.string().trim().min(1).max(2e3).nullable()}).strict(),Jn=e.object({schemaVersion:e.literal("openpond.trainingJobEvent.v2"),id:l,jobId:l,sequence:e.number().int().nonnegative(),type:l,phase:e.string().trim().min(1).max(200),message:e.string().trim().min(1).max(5e3).nullable(),data:e.record(e.string(),e.unknown()).default({}),createdAt:j}).strict(),$n=e.object({schemaVersion:e.literal("openpond.trainingJobLog.v2"),jobId:l,sequence:e.number().int().nonnegative(),level:e.enum(["debug","info","warning","error"]),message:e.string().max(2e4),createdAt:j}).strict(),Zt=e.object({expectedVersion:e.number().int().nonnegative()}).strict(),Vn=e.object({schemaVersion:e.literal("openpond.trainingJobOutput.v2"),id:l,jobId:l,kind:e.enum(["checkpoint","adapter","scorer","metrics","evaluation","trace","receipt"]),artifactRef:e.string().trim().min(1).max(2e3),contentHash:f,sizeBytes:e.number().int().nonnegative(),metadata:e.record(e.string(),e.unknown()).default({}),createdAt:j}).strict(),nn=e.object({schemaVersion:e.literal("openpond.trainingQualificationEvidence.v1"),baseModel:tn,group:p,rolloutReceipts:e.array(p).min(1).max(1e3),rewardEvidenceHash:f,groupsCompleted:e.literal(1),optimizerUpdatesApplied:e.literal(0),optimizerUpdatesSkipped:e.literal(0),trainingStepsCreated:e.literal(0),checkpointsCreated:e.literal(0),artifactsCreated:e.literal(0)}).strict().superRefine((t,n)=>{new Set(t.rolloutReceipts.map(i=>i.id)).size!==t.rolloutReceipts.length&&n.addIssue({code:"custom",path:["rolloutReceipts"],message:"Qualification rollout receipt identities must be unique."})}),De=e.object({schemaVersion:e.literal("openpond.trainingExecutionReceipt.v2"),id:l,teamId:l,jobId:l,submissionHash:f,manifestHash:f,recipeHash:f,capabilityHash:f,runtimeRelease:p,inputs:e.array(p).max(1e4),outputs:e.array(p).max(1e4),spendUsd:e.number().nonnegative(),durationSeconds:e.number().nonnegative(),cleanupComplete:e.boolean(),qualification:nn.optional(),issuer:l,issuedAt:j,signature:e.string().trim().min(1).max(1e4).nullable()}).strict();async function Nn(t){return u(De.parse(t))}s(Nn,"trainingExecutionReceiptHash");async function po(t,n){let i=De.parse(t),a=l.parse(n.id),r=f.parse(n.contentHash),o=await Nn(i);if(i.id!==a||o!==r)throw new d("execution_receipt_mismatch","The execution receipt identity or canonical content hash did not match.");if(n.teamId!==void 0&&i.teamId!==l.parse(n.teamId))throw new d("execution_receipt_team_mismatch","The execution receipt belongs to a different team.");if(n.jobId!==void 0&&i.jobId!==l.parse(n.jobId))throw new d("execution_receipt_job_mismatch","The execution receipt belongs to a different Training Job.");if((n.requireCleanup??!0)&&!i.cleanupComplete)throw new d("execution_cleanup_incomplete","The execution receipt does not attest complete terminal cleanup.");if(n.qualificationSubmission){let m=await me(n.qualificationSubmission);if(m.job.kind!=="policy_optimize"||m.job.executionMode!=="qualification")throw new d("qualification_submission_required","Expected an immutable qualification submission.");await Bn(i,{submissionHash:m.contentHash,baseModel:m.job.baseModel,outputs:n.outputs})}return i}s(po,"parseAndVerifyTrainingExecutionReceipt");async function Bn(t,n){let i=nn.parse(t.qualification);if(t.submissionHash!==n.submissionHash||!t.cleanupComplete)throw new d("qualification_receipt_mismatch","Qualification must attest the expected submission and complete cleanup.");if(n.baseModel&&await u(i.baseModel)!==await u(n.baseModel))throw new d("qualification_learner_mismatch","Qualification used a different original learner or tokenizer.");if(n.outputs?.some(a=>["checkpoint","adapter","scorer"].includes(a.kind)))throw new d("qualification_updated_artifact","Qualification must not publish trained artifacts or checkpoints.")}s(Bn,"assertTrainingQualificationReceipt");var Ln=e.object({schemaVersion:e.literal("openpond.trainingJobOutputs.v2"),outputs:e.array(Vn).max(1e4),receipt:De.nullable()}).strict(),Qn=e.object({workerImageDigest:e.string().regex(/^sha256:[a-f0-9]{64}$/),envelopeRank:e.number().int().positive().max(256),supportedRanks:e.array(e.number().int().positive().max(256)).max(256),qualification:e.object({evidenceRef:e.string().min(1),evidenceSha256:f}).strict().nullable(),continuation:e.object({sharedRequiresSameRank:e.literal(!0),mergedRequiresSameRank:e.literal(!0),residualAppendRequiresFreeCapacity:e.literal(!0),stageOptimizer:e.literal("reset"),interruptedRecoveryOptimizer:e.literal("restore")}).strict()}).strict().superRefine((t,n)=>{(new Set(t.supportedRanks).size!==t.supportedRanks.length||t.supportedRanks.some(i=>i>t.envelopeRank))&&n.addIssue({code:"custom",path:["supportedRanks"],message:"Supported ranks must be unique and fit the physical adapter envelope."}),t.supportedRanks.length&&!t.qualification&&n.addIssue({code:"custom",path:["qualification"],message:"Advertised ranks require immutable image qualification evidence."})});function uo(t,n,i){return t.supportedRanks.includes(n)?i?i.mode==="residual_append"?i.parentEnabledRank+n<=t.envelopeRank:i.parentEnabledRank===n:!0:!1}s(uo,"supportsTrainingPolicyLoraRank");var Fn=e.object({schemaVersion:e.literal("openpond.trainingCapabilities.v2"),capabilityHash:f,jobKinds:e.array(en),methods:e.array(e.string().trim().min(1).max(200)),executionModes:e.array(e.enum(["training","qualification"])).optional(),policyLora:Qn.optional(),policyDataParallel:e.object({capability:e.literal("managed_rl.policy.data_parallel"),version:e.literal("1"),gpuCount:e.literal(2),worldSize:e.literal(2),backend:e.literal("nccl"),allocationMode:e.literal("exclusive"),workerImageDigest:e.string().regex(/^sha256:[a-f0-9]{64}$/)}).strict().optional(),structuredOutputs:e.object({capability:e.literal("work.structured-output.v1"),harnessRuntimeHash:f,workHarnessHash:f,schemaHash:f,artifactHash:f,invalidDataRejected:e.literal(!0),invalidBytesRejected:e.literal(!0)}).strict().optional(),placements:e.array(e.enum(["local","remote","colocated","provider_native"])),controls:e.object({cancel:e.boolean(),stopAfterGroup:e.boolean(),resumeFromCheckpoint:e.boolean()}).strict(),estimates:e.object({schemaVersion:e.literal("openpond.trainingEstimate.v1")}).strict().optional(),limits:e.object({maximumSpendUsd:e.number().nonnegative(),maximumWallSeconds:e.number().int().positive(),maximumArtifactBytes:e.number().int().positive()}).strict(),checkedAt:j,expiresAt:j}).strict();function lo(t){let n=dt(t);return{postTraining:jt({request:n}),...Mt(n),...$t(n),...bt(n),...ut(n),...Bt(n),...Ft(n),async capabilities(){return Fn.parse(E(await n("/v1/training/capabilities"),"capabilities"))},async gpuCatalog(){return be.parse(E(await n("/v1/training/gpu-catalog"),"catalog"))},async stageArtifact(i){let a=await jn(i);return kn.parse(E(await n("/v1/training/artifacts",{method:"POST",body:JSON.stringify(a)}),"artifact"))},async createJob(i){let a=await me(i);return F.parse(E(await n("/v1/training/jobs",{method:"POST",body:JSON.stringify(a)}),"job"))},async listJobs(i={}){let a=new URLSearchParams;i.modelProjectId&&a.set("modelProjectId",l.parse(i.modelProjectId)),i.cursor&&a.set("cursor",e.string().trim().min(1).max(2e3).parse(i.cursor)),i.limit!==void 0&&a.set("limit",String(e.number().int().min(1).max(1e3).parse(i.limit)));let r=a.size>0?`?${a.toString()}`:"";return Dn.parse(await n(`/v1/training/jobs${r}`))},async getJob(i){return F.parse(E(await n(`/v1/training/jobs/${encodeURIComponent(l.parse(i))}`),"job"))},async cancelJob(i,a){let r=Zt.parse({expectedVersion:a});return F.parse(E(await n(`/v1/training/jobs/${encodeURIComponent(l.parse(i))}/cancel`,{method:"POST",body:JSON.stringify(r)}),"job"))},async stopAfterGroup(i,a){let r=Zt.parse({expectedVersion:a});return F.parse(E(await n(`/v1/training/jobs/${encodeURIComponent(l.parse(i))}/stop-after-group`,{method:"POST",body:JSON.stringify(r)}),"job"))},async recoverCheckpoint(i,a){let r=je.parse(a);if(r.resourceApproval){let{approvalHash:o,...m}=r.resourceApproval;if(m.sourceJobId!==i||await u(m)!==o)throw new d("content_hash_mismatch","Recovery resource approval does not bind this source request.")}return F.parse(E(await n(`/v1/training/jobs/${encodeURIComponent(l.parse(i))}/recover`,{method:"POST",body:JSON.stringify(r)}),"job"))},async events(i){return e.array(Jn).parse(E(await n(`/v1/training/jobs/${encodeURIComponent(l.parse(i))}/events`),"events"))},async outputs(i){return Ln.parse(await n(`/v1/training/jobs/${encodeURIComponent(l.parse(i))}/outputs`))},async evaluationTasks(i,a,r={}){let o=l.parse(i),m=p.parse(a),c=new URLSearchParams,x=r.cursor===void 0?void 0:e.string().regex(/^[1-9]\d*$/).parse(r.cursor),R=x===void 0?0:e.number().int().min(1).max(9999).parse(Number(x));x!==void 0&&c.set("cursor",x),r.limit!==void 0&&c.set("limit",String(e.number().int().min(1).max(100).parse(r.limit)));let v=c.size?`?${c.toString()}`:"";return Ue(await n(`/v1/training/jobs/${encodeURIComponent(o)}/evaluations/${encodeURIComponent(m.id)}/tasks${v}`),{jobId:o,evaluation:m,offset:R})},async logs(i){return e.array($n).max(1e5).parse(E(await n(`/v1/training/jobs/${encodeURIComponent(l.parse(i))}/logs`),"logs"))}}}s(lo,"createTrainingClient");function E(t,n){return!t||typeof t!="object"||Array.isArray(t)?t:n in t?t[n]:t}s(E,"unwrapObject");export{z as a,rn as b,ye as c,gt as d,ht as e,ft as f,D as g,vt as h,cn as i,Yi as j,Re as k,Pe as l,ga as m,ha as n,fa as o,ba as p,_e as q,W as r,xn as s,je as t,X as u,Ee as v,Et as w,At as x,Ae as y,He as z,Ct as A,qt as B,zt as C,Ot as D,Ut as E,Gt as F,Dt as G,Jt as H,Me as I,Nt as J,de as K,Lt as L,Qt as M,Oe as N,Kt as O,Wt as P,Xt as Q,Ue as R,vn as S,In as T,Yt as U,Rn as V,wn as W,Pn as X,kn as Y,_n as Z,jn as _,en as $,Hn as aa,En as ba,Ce as ca,An as da,tn as ea,zn as fa,Mn as ga,On as ha,ze as ia,Un as ja,me as ka,Gn as la,F as ma,Dn as na,Jn as oa,$n as pa,Zt as qa,Vn as ra,nn as sa,De as ta,Nn as ua,po as va,Bn as wa,Ln as xa,Qn as ya,uo as za,Fn as Aa,lo as Ba};
|
|
@@ -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-
|
|
2
|
+
import{h as a}from"./chunk-3MVKXAH7.js";import{Xb as d,_b as p}from"./chunk-MVPKU72J.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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{a as y,b as M,c as x,d as J,e as D,f as G,g as W,h as Y}from"./chunk-4DYWVGVS.js";import{a as F,b as K}from"./chunk-4TO743HO.js";import{I as A,K as N,L as v,O as k,P as U,R as S,S as j,U as b,W as B,X as m,a as V,b as P,h as g,k as O,m as $,o as H,s as z}from"./chunk-A77DLBR4.js";import{B as T,C as L,D as I,v as q}from"./chunk-LOIYNRBC.js";import{A as w}from"./chunk-X2J2P5ZT.js";import{a as h}from"./chunk-FTQLQJQV.js";var C=class{static{h(this,"ExperimentalServerTasks")}constructor(e){this._server=e}requestStream(e,t,o){return this._server.requestStream(e,t,o)}createMessageStream(e,t){let o=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!o?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let s=e.messages[e.messages.length-1],i=Array.isArray(s.content)?s.content:[s.content],n=i.some(a=>a.type==="tool_result"),r=e.messages.length>1?e.messages[e.messages.length-2]:void 0,c=r?Array.isArray(r.content)?r.content:[r.content]:[],l=c.some(a=>a.type==="tool_use");if(n){if(i.some(a=>a.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!l)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(l){let a=new Set(c.filter(p=>p.type==="tool_use").map(p=>p.id)),u=new Set(i.filter(p=>p.type==="tool_result").map(p=>p.toolUseId));if(a.size!==u.size||![...a].every(p=>u.has(p)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},S,t)}elicitInputStream(e,t){let o=this._server.getClientCapabilities(),s=e.mode??"form";switch(s){case"url":{if(!o?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case"form":{if(!o?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}let i=s==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:i},b,t)}async getTask(e,t){return this._server.getTask({taskId:e},t)}async getTaskResult(e,t,o){return this._server.getTaskResult({taskId:e},t,o)}async listTasks(e,t){return this._server.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._server.cancelTask({taskId:e},t)}};var E=class extends J{static{h(this,"Server")}constructor(e,t){super(t),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(k.options.map((o,s)=>[o,s])),this.isMessageIgnored=(o,s)=>{let i=this._loggingLevels.get(s);return i?this.LOG_LEVEL_SEVERITY.get(o)<this.LOG_LEVEL_SEVERITY.get(i):!1},this._capabilities=t?.capabilities??{},this._instructions=t?.instructions,this._jsonSchemaValidator=t?.jsonSchemaValidator??new G,this.setRequestHandler($,o=>this._oninitialize(o)),this.setNotificationHandler(H,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(U,async(o,s)=>{let i=s.sessionId||s.requestInfo?.headers["mcp-session-id"]||void 0,{level:n}=o.params,r=k.safeParse(n);return r.success&&this._loggingLevels.set(i,r.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new C(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=D(this._capabilities,e)}setRequestHandler(e,t){let s=M(e)?.method;if(!s)throw new Error("Schema is missing a method literal");let i=x(s);if(typeof i!="string")throw new Error("Schema method literal must be a string");if(i==="tools/call"){let r=h(async(c,l)=>{let a=y(v,c);if(!a.success){let d=a.error instanceof Error?a.error.message:String(a.error);throw new m(g.InvalidParams,`Invalid tools/call request: ${d}`)}let{params:u}=a.data,p=await Promise.resolve(t(c,l));if(u.task){let d=y(z,p);if(!d.success){let X=d.error instanceof Error?d.error.message:String(d.error);throw new m(g.InvalidParams,`Invalid task creation result: ${X}`)}return d.data}let _=y(N,p);if(!_.success){let d=_.error instanceof Error?_.error.message:String(_.error);throw new m(g.InvalidParams,`Invalid tools/call result: ${d}`)}return _.data},"wrappedHandler");return super.setRequestHandler(e,r)}return super.setRequestHandler(e,t)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){Y(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&W(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let t=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:P.includes(t)?t:V,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},O)}async createMessage(e,t){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let o=e.messages[e.messages.length-1],s=Array.isArray(o.content)?o.content:[o.content],i=s.some(l=>l.type==="tool_result"),n=e.messages.length>1?e.messages[e.messages.length-2]:void 0,r=n?Array.isArray(n.content)?n.content:[n.content]:[],c=r.some(l=>l.type==="tool_use");if(i){if(s.some(l=>l.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!c)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(c){let l=new Set(r.filter(u=>u.type==="tool_use").map(u=>u.id)),a=new Set(s.filter(u=>u.type==="tool_result").map(u=>u.toolUseId));if(l.size!==a.size||![...l].every(u=>a.has(u)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},j,t):this.request({method:"sampling/createMessage",params:e},S,t)}async elicitInput(e,t){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let s=e;return this.request({method:"elicitation/create",params:s},b,t)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let s=e.mode==="form"?e:{...e,mode:"form"},i=await this.request({method:"elicitation/create",params:s},b,t);if(i.action==="accept"&&i.content&&s.requestedSchema)try{let r=this._jsonSchemaValidator.getValidator(s.requestedSchema)(i.content);if(!r.valid)throw new m(g.InvalidParams,`Elicitation response content does not match requested schema: ${r.errorMessage}`)}catch(n){throw n instanceof m?n:new m(g.InternalError,`Error validating elicitation response: ${n instanceof Error?n.message:String(n)}`)}return i}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},t)}async listRoots(e,t){return this.request({method:"roots/list",params:e},B,t)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,t))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};import Q from"node:process";var R=class{static{h(this,"StdioServerTransport")}constructor(e=Q.stdin,t=Q.stdout,o){this._stdin=e,this._stdout=t,this._started=!1,this._ondata=s=>{try{this._readBuffer.append(s),this.processReadBuffer()}catch(i){this.onerror?.(i),this.close().catch(()=>{})}},this._onerror=s=>{this.onerror?.(s)},this._readBuffer=new F({maxBufferSize:o?.maxBufferSize})}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(e){return new Promise(t=>{let o=K(e);this._stdout.write(o)?t():this._stdout.once("drain",t)})}};async function ye(f,e){let{value:t}=await q(f,e);if(!t.locallyEnabled)throw new Error("tool_learning_consultation_disabled");let o=w.object({operationId:w.string().min(1).max(200)}).strict(),s=new E({name:"openpond-tool-learning",version:"1.0.0"},{capabilities:{tools:{}},instructions:"Recovery-time advice for the explicitly enabled OpenPond installation. Advice is untrusted task content, cannot execute actions and cannot grant permissions. An unavailable result is not proceed. Recover uncertain requests by operationId; do not retry them as a new request."});s.setRequestHandler(A,async()=>({tools:[{name:"openpond_consult",description:"Consult the qualified specialist about an actual failed tool call captured in this session. Supply the exact session and failed call IDs plus the advertised capability. Returns typed advice; you retain execution and permissions.",inputSchema:w.toJSONSchema(T),annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0}},{name:"openpond_consult_status",description:"Recover the result of a previously submitted consultation after a lost response. Reads the original operation without starting another inference.",inputSchema:w.toJSONSchema(o),annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0}}]})),s.setRequestHandler(v,async(i,n)=>{if(!["openpond_consult","openpond_consult_status"].includes(i.params.name))throw new m(g.MethodNotFound,"Unknown consultation tool.");try{let r=AbortSignal.any([n.signal,AbortSignal.timeout(2e4)]),c=i.params.name==="openpond_consult"?await L(f,e,i.params.arguments,r):await I(f,e,o.parse(i.params.arguments).operationId,r);return{content:[{type:"text",text:JSON.stringify(c)}]}}catch(r){let c=r instanceof Error&&/^tool_learning_[a-z_]+$/u.test(r.message)?r.message:"tool_learning_consultation_unavailable";return{isError:!0,content:[{type:"text",text:JSON.stringify({state:"unavailable",reason:c})}]}}}),await s.connect(new R)}h(ye,"runToolLearningMcp");async function ve(f,e){let[{Client:t},{StdioClientTransport:o}]=await Promise.all([import("./client-I5MYOJEJ.js"),import("./stdio-Z65UIX55.js")]),s=new t({name:"openpond-tool-learning-doctor",version:"1.0.0"}),i=new o({command:f,args:e,stderr:"pipe"});i.stderr?.on("data",()=>{});try{let n=AbortSignal.timeout(1e4);await s.connect(i,{signal:n,timeout:1e4});let c=(await s.listTools(void 0,{signal:n,timeout:1e4})).tools.map(a=>a.name).sort();if(c.join(",")!=="openpond_consult,openpond_consult_status")throw new Error("tool_learning_mcp_discovery_mismatch");let l=s.getServerVersion();if(l?.name!=="openpond-tool-learning")throw new Error("tool_learning_mcp_server_mismatch");return{reachable:!0,server:l,tools:c}}finally{await s.close(),await i.close()}}h(ve,"probeToolLearningMcp");export{ye as a,ve as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{c as H}from"./chunk-BSHAIAXY.js";import{c as u,f as E,g as M,h as S}from"./chunk-3M53YXEI.js";import{q as N,t as O,u as U}from"./chunk-NG2L6D7G.js";import{f as L,h as _}from"./chunk-UGOK7VTC.js";import{a as l}from"./chunk-FTQLQJQV.js";import{readFile as x}from"node:fs/promises";import{request as J}from"node:http";import{randomUUID as V}from"node:crypto";import{createInterface as z}from"node:readline/promises";var F="http://127.0.0.1:17874",Y=128*1024*1024,W=new Set(["cancelled","completed","failed","succeeded"]);async function we(e,n,r={}){let t=n[0];if(t==="estimate"){await(await import("./training-hosted-PFJHYTEU.js")).runHostedTrainingCommand(e,["hosted-estimate-model",...n.slice(1)]);return}if(t==="start"&&u(e,"teamId")){await(await import("./training-hosted-PFJHYTEU.js")).runHostedTrainingCommand(e,["hosted-start-model",...n.slice(1)]);return}if(t?.startsWith("hosted-")){await(await import("./training-hosted-PFJHYTEU.js")).runHostedTrainingCommand(e,n);return}let o=n[1];if(!t||!["start","status","watch","logs","cancel","resume","artifacts","benchmark","create-project","prepare-project","pull-project","projects","inspect-project"].includes(t)||!o&&t!=="projects")throw new Error("usage: training <projects|inspect-project|create-project|prepare-project|pull-project|start|status|watch|logs|cancel|resume|artifacts|benchmark> [identifier]");if(n.length>2)throw new Error(`training ${t} accepts exactly one identifier`);if(t==="projects"&&o)throw new Error("training projects does not accept an identifier; use inspect-project <id>.");let s=t==="pull-project"?u(e,"profile"):null;if(t==="pull-project"&&!s)throw new Error("training pull-project requires --profile <local-profile-id>.");let a=H(e)??process.env.OPENPOND_LOCAL_API_URL?.replace(/\/$/,"")??F;if(["pull-project","projects","inspect-project","prepare-project"].includes(t)){let c=new URL(a);if(c.protocol!=="http:"||!["127.0.0.1","localhost","[::1]"].includes(c.hostname)||c.username||c.password||c.search||c.hash||c.pathname!=="/")throw new Error(`training ${t} uses the local app's HTTP loopback API; the app resolves its signed-in hosted account.`)}let i=new q({baseUrl:a,request:r.request??await K(a,{maximumResponseBytes:Y,timeoutMs:t==="pull-project"?3e5:6e4})}),d=E(e.json);if(t==="projects"||t==="inspect-project"){b(await i.inspectProjects(t==="inspect-project"?o:void 0,u(e,"profile")??void 0),d);return}if(!o)throw new Error(`training ${t} requires an identifier.`);if(t==="pull-project"){let c=u(e,"snapshotFile"),g=c?await x(c):null;if(g&&g.byteLength>64*1024*1024)throw new Error("Model pull snapshot exceeds 64 MiB.");let P=g?JSON.parse(g.toString("utf8")):void 0;b(await i.pullHostedProject(o,s,P),d);return}if(t==="create-project"){let c=await Z({client:i,options:e,tasksetId:o});b(c,d);return}if(t==="prepare-project"){await(await import("./training-project-preparation-XWGRY5ME.js")).runProjectPreparation(i,o,e);return}if(t==="benchmark"){await Q({client:i,modelId:o,options:e,json:d,sleep:r.sleep});return}if(t==="resume"){let c=await i.modelRun(o,"resume","POST");b(c,d),await A({client:i,runId:o,json:d,intervalMs:S(e.intervalMs,"interval-ms")??2e3,sleep:r.sleep});return}if(t==="start"){await re({client:i,dependencies:r,json:d,modelRunId:o,options:e});return}if(t==="watch"){await A({client:i,runId:o,json:d,intervalMs:S(e.intervalMs,"interval-ms")??2e3,sleep:r.sleep});return}let w=t==="status"?"status":t==="logs"?"logs":t==="artifacts"?"artifacts":"cancel",y=await i.modelRun(o,w,t==="cancel"?"POST":"GET");b(y,d)}l(we,"runTrainingCommand");async function K(e,n={}){let r=new URL(e);if(r.protocol!=="http:"||!["127.0.0.1","localhost","[::1]"].includes(r.hostname))return fetch;let t=(await x(_(L()).token,"utf8")).trim();if(!t)throw new Error("OpenPond local capability token is empty.");let o=n.maximumResponseBytes??8388608,s=n.timeoutMs??6e4;if(!Number.isSafeInteger(s)||s<1||s>864e5)throw new Error("Local request timeout must be between one millisecond and one day.");return(async(a,i={})=>{let d=a instanceof Request?new URL(a.url):new URL(String(a));if(d.origin!==r.origin||d.username||d.password)throw new Error("Local capability requests must remain on the selected server origin.");let w=new Headers(i.headers);w.set("authorization",`Bearer ${t}`);let y={};w.forEach((g,P)=>{y[P]=g});let c=i.signal?AbortSignal.any([i.signal,AbortSignal.timeout(s)]):AbortSignal.timeout(s);return new Promise((g,P)=>{let R=!1,h=J(d,{method:i.method??"GET",headers:y},m=>{let T=[],v=0;m.on("data",f=>{if(v+=f.byteLength,v>o){m.destroy(new Error(`Local response exceeds ${o} bytes.`));return}T.push(f)}),m.once("error",k),m.once("end",()=>{if(R)return;R=!0;let f=new Headers;for(let[j,I]of Object.entries(m.headers))if(Array.isArray(I))for(let G of I)f.append(j,G);else I!==void 0&&f.set(j,I);g(new Response(new Uint8Array(Buffer.concat(T)),{status:m.statusCode??500,statusText:m.statusMessage,headers:f}))})}),k=l(m=>{R||(R=!0,P(m))},"rejectOnce");if(h.once("error",k),c){let m=l(()=>h.destroy(c.reason instanceof Error?c.reason:new Error("Training API request aborted.")),"abort");c.aborted?m():c.addEventListener("abort",m,{once:!0})}if(i.body!==void 0&&i.body!==null){if(typeof i.body!="string"&&!(i.body instanceof Uint8Array)){h.destroy(new Error("Local Training API supports string or byte request bodies."));return}h.write(i.body)}h.end()})})}l(K,"createLocalAuthenticatedRequest");var q=class{static{l(this,"TrainingApiClient")}baseUrl;request;constructor(n){this.baseUrl=n.baseUrl.replace(/\/$/,""),this.request=n.request??fetch}async modelRun(n,r,t,o){let s=await this.json(`/v1/training/model-runs/${encodeURIComponent(n)}/${r}`,t,o);return await this.attachTraining({modelRunId:n}),s}prepareModelProject(n,r){return this.json(`/v1/training/model-projects/${encodeURIComponent(n)}/training/prepare`,"POST",r)}async startModelProject(n,r){let t=await this.json(`/v1/training/model-projects/${encodeURIComponent(n)}/training/start`,"POST",r),o=t&&typeof t=="object"&&"job"in t?t.job:null;return o&&typeof o=="object"&&"id"in o&&typeof o.id=="string"&&await this.attachTraining({jobId:o.id}),t}async attachTraining(n){let r=process.env.OPENPOND_CHAT_INVOCATION;if(r)try{await this.json("/v1/chat-experiments","POST",{action:"attach_training",payload:n,invocationToken:r})}catch(t){console.error(`Training operation succeeded, but chat attachment failed: ${t instanceof Error?t.message:String(t)}. Inspect the saved job to retry attachment; do not submit it again.`)}}trainingState(n){let r=n?`?profileId=${encodeURIComponent(n)}`:"";return this.json(`/v1/training${r}`,"GET")}inspectProjects(n,r){let t=r?`?profileId=${encodeURIComponent(r)}`:"";return this.json(`/v1/training/model-projects${n?`/${encodeURIComponent(n)}`:""}${t}`,"GET")}pullHostedProject(n,r,t){return this.json(`/v1/training/hosted-model-projects/${encodeURIComponent(n)}/pull`,"POST",{profileId:r,...t!==void 0?{snapshot:t}:{}})}startHarnessRefinerBenchmark(n,r){return this.json(`/v1/training/models/${encodeURIComponent(n)}/harness-refiner-benchmark`,"POST",r)}importTasksetDraftPackage(n){return this.json("/v1/training/taskset-drafts/import","POST",n)}publishTasksetDraft(n,r){return this.json(`/v1/training/taskset-drafts/${encodeURIComponent(n)}/publish`,"POST",r?{modelId:r}:{})}tasksetReadiness(n){return this.json("/v1/training/readiness","POST",{tasksetId:n})}deleteTasksetDraft(n){return this.json(`/v1/training/taskset-drafts/${encodeURIComponent(n)}`,"DELETE")}saveModelProject(n){return this.json("/v1/training/models","PUT",n)}prepareLocalModelProject(n,r){return this.json(`/v1/training/model-project-preparations/${r?"apply":"prepare"}`,"POST",n)}async json(n,r,t){let o=await this.request(`${this.baseUrl}${n}`,{method:r,headers:t===void 0?{Accept:"application/json"}:{Accept:"application/json","Content-Type":"application/json"},body:t===void 0?void 0:JSON.stringify(t)}),s=await o.text(),a=null;if(s)try{a=JSON.parse(s)}catch{a=s}if(!o.ok){let i=a&&typeof a=="object"&&"error"in a&&typeof a.error=="string"?a.error:`${o.status} ${o.statusText}`.trim();throw new Error(`Training API request failed: ${i}`)}return a}};async function Q(e){let n=await e.client.trainingState(u(e.options,"profile")),r=X(n,e.modelId),t=u(e.options,"provider")||"openpond",o=u(e.options,"model")||"openpond-chat",s=u(e.options,"reasoningEffort")||"high",a=M(e.options.maxSpend,"max-spend")??10;if(a<=0)throw new Error("max-spend must be greater than zero");if(E(e.options.detach))throw new Error("Harness Refiner benchmark runs must be watched to terminal state.");let i=await e.client.startHarnessRefinerBenchmark(e.modelId,{profileId:r.profileId,model:{providerId:t,modelId:o},reasoningEffort:s==="none"?"none":s,maximumSpendUsd:a});b(i,e.json);let d=p(i,"id");if(!d)throw new Error("Benchmark start did not return a Model Run id.");await A({client:e.client,runId:d,json:e.json,intervalMs:S(e.options.intervalMs,"interval-ms")??2e3,sleep:e.sleep})}l(Q,"startHarnessRefinerBenchmark");function X(e,n){if(!e||typeof e!="object"||!("modelProjects"in e))throw new Error("Training state did not include Models.");let t=(Array.isArray(e.modelProjects)?e.modelProjects:[]).find(s=>s&&typeof s=="object"&&"id"in s&&s.id===n),o=t&&typeof t=="object"?p(t,"profileId"):null;if(!o)throw new Error(`Model ${n} was not found.`);return{profileId:o}}l(X,"modelProject");function p(e,n){if(!e||typeof e!="object"||!(n in e))return null;let r=e[n];return typeof r=="string"&&r?r:null}l(p,"objectString");async function Z(e){let n=u(e.options,"recipe");if(!n)throw new Error("training create-project requires --recipe <versioned-recipe.json>");let r=await te(n,"Training recipe"),t=u(e.options,"profile"),o=await e.client.trainingState(t),s=ne(o,"tasksets",e.tasksetId,"Taskset"),a=t||p(s,"profileId");if(!a)throw new Error(`The Taskset has no Profile id (received ${typeof s.profileId}: ${String(s.profileId)}).`);let i=p(s,"profileId");if(i!==a)throw new Error(`Taskset ${e.tasksetId} belongs to Profile ${i??"unknown"}, not ${a}.`);let d=u(e.options,"projectId")||`model_${V()}`,w=t?o:await e.client.trainingState(a),c=D(w,"modelProjects").find(j=>p(j,"id")===d),g=C(e.options,"rolloutPlacement",["local","remote"],"local"),P=C(e.options,"gpuPlacementObjective",["fast","balanced","economical"],"balanced"),R=C(e.options,"runPreset",["small","standard","custom","small_experiment"],"custom"),h=M(e.options.maxSpend,"max-spend")??null;if(h!==null&&h<0)throw new Error("max-spend must be non-negative");let k=S(e.options.retentionDays,"retention-days")??null;if(k!==null&&k<0)throw new Error("retention-days must be non-negative");let m=p(s,"contentHash"),T=B(s,"revision");if(!m||!T||T<1)throw new Error("The Taskset does not have an immutable published revision.");let v=p(r,"method");if(!v)throw new Error("Training recipe must declare its method.");let f=ee(r);if(c){let j=$(c,"trainingSetup"),I=$(j,"tasksetRef");if(p(I,"id")!==e.tasksetId||p(c,"profileId")!==a)throw new Error(`Model Project ${d} already exists for a different Profile or Taskset.`);if($(j,"baseModel"))throw new Error(`Model Project ${d} already exists.`);return e.client.saveModelProject(await U(O.parse({...O.strip().parse(c),defaultBaseModel:f,trainingSetup:{...j,baseModel:f,recipe:r}}),B(c,"revision")??1))}return e.client.saveModelProject(await U(O.parse({id:d,profileId:a,name:u(e.options,"name")||p(s,"name")||"Managed Model",objective:u(e.options,"objective")||p(s,"objective"),defaultBaseModel:f,defaultDestinationId:u(e.options,"destination")||"openpond_managed",trainingSetup:{tasksetRef:{id:e.tasksetId,revision:T,contentHash:m},tasksetRelease:null,harnessRelease:null,baseModel:f,method:v,destinationId:u(e.options,"destination")||"openpond_managed",managedRolloutPlacement:g,managedGpuPlacementObjective:P,managedGpuRequirement:"any",runPreset:R,recipe:r,preferredMaximumSpendUsd:h,preferredRetentionDays:k}}),0))}l(Z,"createManagedModelProject");function ee(e){let n=$(e,"baseModel"),r=p(n,"id"),t=p(n,"revision"),o=p(n,"tokenizerRevision"),s=p(n,"chatTemplateHash");if(!r||!t||!o||!s)throw new Error("Managed GRPO recipe must pin baseModel id, revision, tokenizerRevision, and chatTemplateHash.");return N.parse({schemaVersion:"openpond.baseModelPreference.v1",modelId:r,revision:t,tokenizerRevision:o,chatTemplateHash:s,modelAssetId:null,source:"managed"})}l(ee,"managedBasePreferenceFromRecipe");function ne(e,n,r,t){let o=D(e,n).find(s=>p(s,"id")===r);if(!o)throw new Error(`${t} ${r} was not found.`);return o}l(ne,"trainingStateRecord");function D(e,n){if(!e||typeof e!="object"||!(n in e))return[];let r=e[n];return Array.isArray(r)?r.filter(t=>!!t&&typeof t=="object"&&!Array.isArray(t)):[]}l(D,"trainingStateRecords");function B(e,n){if(!e||typeof e!="object"||!(n in e))return null;let r=e[n];return typeof r=="number"&&Number.isFinite(r)?r:null}l(B,"objectNumber");function $(e,n){if(!e||typeof e!="object"||!(n in e))return null;let r=e[n];return r&&typeof r=="object"&&!Array.isArray(r)?r:null}l($,"objectRecord");function C(e,n,r,t){let o=u(e,n)||t;if(!r.includes(o))throw new Error(`${n} must be one of ${r.join(", ")}`);return o}l(C,"enumOption");async function te(e,n){let r;try{r=JSON.parse(await x(e,"utf8"))}catch(t){throw new Error(`Could not read ${n} ${e}: ${t instanceof Error?t.message:String(t)}`)}if(!r||typeof r!="object"||Array.isArray(r))throw new Error(`${n} must be a JSON object.`);return r}l(te,"readJsonObject");async function re(e){let n=M(e.options.maxSpend,"max-spend")??null;if(n!==null&&n<0)throw new Error("max-spend must be non-negative");let r=S(e.options.retentionDays,"retention-days")??null;if(r!==null&&r<=0)throw new Error("retention-days must be a positive integer");let t=u(e.options,"manifest"),o=t?await oe(t):void 0,s=u(e.options,"comparisonSeriesEntry")||null,a={maximumSpendUsd:n,retentionDays:r},i=await e.client.prepareModelProject(e.modelRunId,a);if(e.json||(console.log("Preparation:"),console.log(JSON.stringify(i,null,2))),!(E(e.options.yes)||await se(e.dependencies.confirm)))throw new Error("Training start cancelled.");let w=await e.client.startModelProject(e.modelRunId,{...a,exportApproved:E(e.options.exportApproved),manifest:o,comparisonSeriesEntryId:s});if(b(w,e.json),E(e.options.detach))return;let y=ie(w)??e.modelRunId;await A({client:e.client,runId:y,json:e.json,intervalMs:2e3,sleep:e.dependencies.sleep})}l(re,"startTraining");async function A(e){if(e.intervalMs<250)throw new Error("interval-ms must be at least 250");let n=e.sleep??(t=>new Promise(o=>setTimeout(o,t))),r="";for(;;){let t=await e.client.modelRun(e.runId,"status","GET"),o=JSON.stringify(t);if((e.json||o!==r)&&(b(t,e.json),r=o),W.has(ae(t)))return;await n(e.intervalMs)}}l(A,"watchTraining");async function oe(e){let n;try{n=JSON.parse(await x(e,"utf8"))}catch(r){throw new Error(`Could not read Harness Run Manifest ${e}: ${r instanceof Error?r.message:String(r)}`)}if(!n||typeof n!="object"||Array.isArray(n))throw new Error("Harness Run Manifest must be a JSON object.");return n}l(oe,"readManifest");async function se(e){let n="Start this exact prepared training run? Downloads, provisioning, or spend may begin.";if(e)return e(n);if(!process.stdin.isTTY||!process.stdout.isTTY)throw new Error("training start requires --yes when standard input is not interactive");let r=z({input:process.stdin,output:process.stdout});try{let t=await r.question(`${n} [y/N] `);return t.trim().toLowerCase()==="y"||t.trim().toLowerCase()==="yes"}finally{r.close()}}l(se,"confirmStart");function ie(e){if(!e||typeof e!="object")return null;let n="job"in e?e.job:null;return!n||typeof n!="object"||!("id"in n)?null:typeof n.id=="string"?n.id:null}l(ie,"readRunId");function ae(e){return!e||typeof e!="object"?"":"state"in e&&typeof e.state=="string"?e.state:"status"in e&&typeof e.status=="string"?e.status:""}l(ae,"readStatus");function b(e,n){if(n){console.log(JSON.stringify(e));return}console.log(JSON.stringify(e,null,2))}l(b,"printResult");export{F as a,Y as b,we as c,K as d,q as e};
|
|
2
|
+
import{c as N}from"./chunk-BSHAIAXY.js";import{c as u,f as E,g as M,h as S}from"./chunk-3M53YXEI.js";import{f as H,i as O,j as U}from"./chunk-5WPMI6QX.js";import{f as L,h as _}from"./chunk-UGOK7VTC.js";import{a as l}from"./chunk-FTQLQJQV.js";import{readFile as x}from"node:fs/promises";import{request as J}from"node:http";import{randomUUID as V}from"node:crypto";import{createInterface as z}from"node:readline/promises";var F="http://127.0.0.1:17874",Y=128*1024*1024,W=new Set(["cancelled","completed","failed","succeeded"]);async function we(e,n,r={}){let t=n[0];if(t==="estimate"){await(await import("./training-hosted-6BX2IASC.js")).runHostedTrainingCommand(e,["hosted-estimate-model",...n.slice(1)]);return}if(t==="start"&&u(e,"teamId")){await(await import("./training-hosted-6BX2IASC.js")).runHostedTrainingCommand(e,["hosted-start-model",...n.slice(1)]);return}if(t?.startsWith("hosted-")){await(await import("./training-hosted-6BX2IASC.js")).runHostedTrainingCommand(e,n);return}let o=n[1];if(!t||!["start","status","watch","logs","cancel","resume","artifacts","benchmark","create-project","prepare-project","pull-project","projects","inspect-project"].includes(t)||!o&&t!=="projects")throw new Error("usage: training <projects|inspect-project|create-project|prepare-project|pull-project|start|status|watch|logs|cancel|resume|artifacts|benchmark> [identifier]");if(n.length>2)throw new Error(`training ${t} accepts exactly one identifier`);if(t==="projects"&&o)throw new Error("training projects does not accept an identifier; use inspect-project <id>.");let s=t==="pull-project"?u(e,"profile"):null;if(t==="pull-project"&&!s)throw new Error("training pull-project requires --profile <local-profile-id>.");let a=N(e)??process.env.OPENPOND_LOCAL_API_URL?.replace(/\/$/,"")??F;if(["pull-project","projects","inspect-project","prepare-project"].includes(t)){let c=new URL(a);if(c.protocol!=="http:"||!["127.0.0.1","localhost","[::1]"].includes(c.hostname)||c.username||c.password||c.search||c.hash||c.pathname!=="/")throw new Error(`training ${t} uses the local app's HTTP loopback API; the app resolves its signed-in hosted account.`)}let i=new q({baseUrl:a,request:r.request??await K(a,{maximumResponseBytes:Y,timeoutMs:t==="pull-project"?3e5:6e4})}),d=E(e.json);if(t==="projects"||t==="inspect-project"){b(await i.inspectProjects(t==="inspect-project"?o:void 0,u(e,"profile")??void 0),d);return}if(!o)throw new Error(`training ${t} requires an identifier.`);if(t==="pull-project"){let c=u(e,"snapshotFile"),g=c?await x(c):null;if(g&&g.byteLength>64*1024*1024)throw new Error("Model pull snapshot exceeds 64 MiB.");let P=g?JSON.parse(g.toString("utf8")):void 0;b(await i.pullHostedProject(o,s,P),d);return}if(t==="create-project"){let c=await Z({client:i,options:e,tasksetId:o});b(c,d);return}if(t==="prepare-project"){await(await import("./training-project-preparation-XWGRY5ME.js")).runProjectPreparation(i,o,e);return}if(t==="benchmark"){await Q({client:i,modelId:o,options:e,json:d,sleep:r.sleep});return}if(t==="resume"){let c=await i.modelRun(o,"resume","POST");b(c,d),await A({client:i,runId:o,json:d,intervalMs:S(e.intervalMs,"interval-ms")??2e3,sleep:r.sleep});return}if(t==="start"){await re({client:i,dependencies:r,json:d,modelRunId:o,options:e});return}if(t==="watch"){await A({client:i,runId:o,json:d,intervalMs:S(e.intervalMs,"interval-ms")??2e3,sleep:r.sleep});return}let w=t==="status"?"status":t==="logs"?"logs":t==="artifacts"?"artifacts":"cancel",y=await i.modelRun(o,w,t==="cancel"?"POST":"GET");b(y,d)}l(we,"runTrainingCommand");async function K(e,n={}){let r=new URL(e);if(r.protocol!=="http:"||!["127.0.0.1","localhost","[::1]"].includes(r.hostname))return fetch;let t=(await x(_(L()).token,"utf8")).trim();if(!t)throw new Error("OpenPond local capability token is empty.");let o=n.maximumResponseBytes??8388608,s=n.timeoutMs??6e4;if(!Number.isSafeInteger(s)||s<1||s>864e5)throw new Error("Local request timeout must be between one millisecond and one day.");return(async(a,i={})=>{let d=a instanceof Request?new URL(a.url):new URL(String(a));if(d.origin!==r.origin||d.username||d.password)throw new Error("Local capability requests must remain on the selected server origin.");let w=new Headers(i.headers);w.set("authorization",`Bearer ${t}`);let y={};w.forEach((g,P)=>{y[P]=g});let c=i.signal?AbortSignal.any([i.signal,AbortSignal.timeout(s)]):AbortSignal.timeout(s);return new Promise((g,P)=>{let R=!1,h=J(d,{method:i.method??"GET",headers:y},m=>{let T=[],v=0;m.on("data",f=>{if(v+=f.byteLength,v>o){m.destroy(new Error(`Local response exceeds ${o} bytes.`));return}T.push(f)}),m.once("error",k),m.once("end",()=>{if(R)return;R=!0;let f=new Headers;for(let[j,I]of Object.entries(m.headers))if(Array.isArray(I))for(let G of I)f.append(j,G);else I!==void 0&&f.set(j,I);g(new Response(new Uint8Array(Buffer.concat(T)),{status:m.statusCode??500,statusText:m.statusMessage,headers:f}))})}),k=l(m=>{R||(R=!0,P(m))},"rejectOnce");if(h.once("error",k),c){let m=l(()=>h.destroy(c.reason instanceof Error?c.reason:new Error("Training API request aborted.")),"abort");c.aborted?m():c.addEventListener("abort",m,{once:!0})}if(i.body!==void 0&&i.body!==null){if(typeof i.body!="string"&&!(i.body instanceof Uint8Array)){h.destroy(new Error("Local Training API supports string or byte request bodies."));return}h.write(i.body)}h.end()})})}l(K,"createLocalAuthenticatedRequest");var q=class{static{l(this,"TrainingApiClient")}baseUrl;request;constructor(n){this.baseUrl=n.baseUrl.replace(/\/$/,""),this.request=n.request??fetch}async modelRun(n,r,t,o){let s=await this.json(`/v1/training/model-runs/${encodeURIComponent(n)}/${r}`,t,o);return await this.attachTraining({modelRunId:n}),s}prepareModelProject(n,r){return this.json(`/v1/training/model-projects/${encodeURIComponent(n)}/training/prepare`,"POST",r)}async startModelProject(n,r){let t=await this.json(`/v1/training/model-projects/${encodeURIComponent(n)}/training/start`,"POST",r),o=t&&typeof t=="object"&&"job"in t?t.job:null;return o&&typeof o=="object"&&"id"in o&&typeof o.id=="string"&&await this.attachTraining({jobId:o.id}),t}async attachTraining(n){let r=process.env.OPENPOND_CHAT_INVOCATION;if(r)try{await this.json("/v1/chat-experiments","POST",{action:"attach_training",payload:n,invocationToken:r})}catch(t){console.error(`Training operation succeeded, but chat attachment failed: ${t instanceof Error?t.message:String(t)}. Inspect the saved job to retry attachment; do not submit it again.`)}}trainingState(n){let r=n?`?profileId=${encodeURIComponent(n)}`:"";return this.json(`/v1/training${r}`,"GET")}inspectProjects(n,r){let t=r?`?profileId=${encodeURIComponent(r)}`:"";return this.json(`/v1/training/model-projects${n?`/${encodeURIComponent(n)}`:""}${t}`,"GET")}pullHostedProject(n,r,t){return this.json(`/v1/training/hosted-model-projects/${encodeURIComponent(n)}/pull`,"POST",{profileId:r,...t!==void 0?{snapshot:t}:{}})}startHarnessRefinerBenchmark(n,r){return this.json(`/v1/training/models/${encodeURIComponent(n)}/harness-refiner-benchmark`,"POST",r)}importTasksetDraftPackage(n){return this.json("/v1/training/taskset-drafts/import","POST",n)}publishTasksetDraft(n,r){return this.json(`/v1/training/taskset-drafts/${encodeURIComponent(n)}/publish`,"POST",r?{modelId:r}:{})}tasksetReadiness(n){return this.json("/v1/training/readiness","POST",{tasksetId:n})}deleteTasksetDraft(n){return this.json(`/v1/training/taskset-drafts/${encodeURIComponent(n)}`,"DELETE")}saveModelProject(n){return this.json("/v1/training/models","PUT",n)}prepareLocalModelProject(n,r){return this.json(`/v1/training/model-project-preparations/${r?"apply":"prepare"}`,"POST",n)}async json(n,r,t){let o=await this.request(`${this.baseUrl}${n}`,{method:r,headers:t===void 0?{Accept:"application/json"}:{Accept:"application/json","Content-Type":"application/json"},body:t===void 0?void 0:JSON.stringify(t)}),s=await o.text(),a=null;if(s)try{a=JSON.parse(s)}catch{a=s}if(!o.ok){let i=a&&typeof a=="object"&&"error"in a&&typeof a.error=="string"?a.error:`${o.status} ${o.statusText}`.trim();throw new Error(`Training API request failed: ${i}`)}return a}};async function Q(e){let n=await e.client.trainingState(u(e.options,"profile")),r=X(n,e.modelId),t=u(e.options,"provider")||"openpond",o=u(e.options,"model")||"openpond-chat",s=u(e.options,"reasoningEffort")||"high",a=M(e.options.maxSpend,"max-spend")??10;if(a<=0)throw new Error("max-spend must be greater than zero");if(E(e.options.detach))throw new Error("Harness Refiner benchmark runs must be watched to terminal state.");let i=await e.client.startHarnessRefinerBenchmark(e.modelId,{profileId:r.profileId,model:{providerId:t,modelId:o},reasoningEffort:s==="none"?"none":s,maximumSpendUsd:a});b(i,e.json);let d=p(i,"id");if(!d)throw new Error("Benchmark start did not return a Model Run id.");await A({client:e.client,runId:d,json:e.json,intervalMs:S(e.options.intervalMs,"interval-ms")??2e3,sleep:e.sleep})}l(Q,"startHarnessRefinerBenchmark");function X(e,n){if(!e||typeof e!="object"||!("modelProjects"in e))throw new Error("Training state did not include Models.");let t=(Array.isArray(e.modelProjects)?e.modelProjects:[]).find(s=>s&&typeof s=="object"&&"id"in s&&s.id===n),o=t&&typeof t=="object"?p(t,"profileId"):null;if(!o)throw new Error(`Model ${n} was not found.`);return{profileId:o}}l(X,"modelProject");function p(e,n){if(!e||typeof e!="object"||!(n in e))return null;let r=e[n];return typeof r=="string"&&r?r:null}l(p,"objectString");async function Z(e){let n=u(e.options,"recipe");if(!n)throw new Error("training create-project requires --recipe <versioned-recipe.json>");let r=await te(n,"Training recipe"),t=u(e.options,"profile"),o=await e.client.trainingState(t),s=ne(o,"tasksets",e.tasksetId,"Taskset"),a=t||p(s,"profileId");if(!a)throw new Error(`The Taskset has no Profile id (received ${typeof s.profileId}: ${String(s.profileId)}).`);let i=p(s,"profileId");if(i!==a)throw new Error(`Taskset ${e.tasksetId} belongs to Profile ${i??"unknown"}, not ${a}.`);let d=u(e.options,"projectId")||`model_${V()}`,w=t?o:await e.client.trainingState(a),c=D(w,"modelProjects").find(j=>p(j,"id")===d),g=C(e.options,"rolloutPlacement",["local","remote"],"local"),P=C(e.options,"gpuPlacementObjective",["fast","balanced","economical"],"balanced"),R=C(e.options,"runPreset",["small","standard","custom","small_experiment"],"custom"),h=M(e.options.maxSpend,"max-spend")??null;if(h!==null&&h<0)throw new Error("max-spend must be non-negative");let k=S(e.options.retentionDays,"retention-days")??null;if(k!==null&&k<0)throw new Error("retention-days must be non-negative");let m=p(s,"contentHash"),T=B(s,"revision");if(!m||!T||T<1)throw new Error("The Taskset does not have an immutable published revision.");let v=p(r,"method");if(!v)throw new Error("Training recipe must declare its method.");let f=ee(r);if(c){let j=$(c,"trainingSetup"),I=$(j,"tasksetRef");if(p(I,"id")!==e.tasksetId||p(c,"profileId")!==a)throw new Error(`Model Project ${d} already exists for a different Profile or Taskset.`);if($(j,"baseModel"))throw new Error(`Model Project ${d} already exists.`);return e.client.saveModelProject(await U(O.parse({...O.strip().parse(c),defaultBaseModel:f,trainingSetup:{...j,baseModel:f,recipe:r}}),B(c,"revision")??1))}return e.client.saveModelProject(await U(O.parse({id:d,profileId:a,name:u(e.options,"name")||p(s,"name")||"Managed Model",objective:u(e.options,"objective")||p(s,"objective"),defaultBaseModel:f,defaultDestinationId:u(e.options,"destination")||"openpond_managed",trainingSetup:{tasksetRef:{id:e.tasksetId,revision:T,contentHash:m},tasksetRelease:null,harnessRelease:null,baseModel:f,method:v,destinationId:u(e.options,"destination")||"openpond_managed",managedRolloutPlacement:g,managedGpuPlacementObjective:P,managedGpuRequirement:"any",runPreset:R,recipe:r,preferredMaximumSpendUsd:h,preferredRetentionDays:k}}),0))}l(Z,"createManagedModelProject");function ee(e){let n=$(e,"baseModel"),r=p(n,"id"),t=p(n,"revision"),o=p(n,"tokenizerRevision"),s=p(n,"chatTemplateHash");if(!r||!t||!o||!s)throw new Error("Managed GRPO recipe must pin baseModel id, revision, tokenizerRevision, and chatTemplateHash.");return H.parse({schemaVersion:"openpond.baseModelPreference.v1",modelId:r,revision:t,tokenizerRevision:o,chatTemplateHash:s,modelAssetId:null,source:"managed"})}l(ee,"managedBasePreferenceFromRecipe");function ne(e,n,r,t){let o=D(e,n).find(s=>p(s,"id")===r);if(!o)throw new Error(`${t} ${r} was not found.`);return o}l(ne,"trainingStateRecord");function D(e,n){if(!e||typeof e!="object"||!(n in e))return[];let r=e[n];return Array.isArray(r)?r.filter(t=>!!t&&typeof t=="object"&&!Array.isArray(t)):[]}l(D,"trainingStateRecords");function B(e,n){if(!e||typeof e!="object"||!(n in e))return null;let r=e[n];return typeof r=="number"&&Number.isFinite(r)?r:null}l(B,"objectNumber");function $(e,n){if(!e||typeof e!="object"||!(n in e))return null;let r=e[n];return r&&typeof r=="object"&&!Array.isArray(r)?r:null}l($,"objectRecord");function C(e,n,r,t){let o=u(e,n)||t;if(!r.includes(o))throw new Error(`${n} must be one of ${r.join(", ")}`);return o}l(C,"enumOption");async function te(e,n){let r;try{r=JSON.parse(await x(e,"utf8"))}catch(t){throw new Error(`Could not read ${n} ${e}: ${t instanceof Error?t.message:String(t)}`)}if(!r||typeof r!="object"||Array.isArray(r))throw new Error(`${n} must be a JSON object.`);return r}l(te,"readJsonObject");async function re(e){let n=M(e.options.maxSpend,"max-spend")??null;if(n!==null&&n<0)throw new Error("max-spend must be non-negative");let r=S(e.options.retentionDays,"retention-days")??null;if(r!==null&&r<=0)throw new Error("retention-days must be a positive integer");let t=u(e.options,"manifest"),o=t?await oe(t):void 0,s=u(e.options,"comparisonSeriesEntry")||null,a={maximumSpendUsd:n,retentionDays:r},i=await e.client.prepareModelProject(e.modelRunId,a);if(e.json||(console.log("Preparation:"),console.log(JSON.stringify(i,null,2))),!(E(e.options.yes)||await se(e.dependencies.confirm)))throw new Error("Training start cancelled.");let w=await e.client.startModelProject(e.modelRunId,{...a,exportApproved:E(e.options.exportApproved),manifest:o,comparisonSeriesEntryId:s});if(b(w,e.json),E(e.options.detach))return;let y=ie(w)??e.modelRunId;await A({client:e.client,runId:y,json:e.json,intervalMs:2e3,sleep:e.dependencies.sleep})}l(re,"startTraining");async function A(e){if(e.intervalMs<250)throw new Error("interval-ms must be at least 250");let n=e.sleep??(t=>new Promise(o=>setTimeout(o,t))),r="";for(;;){let t=await e.client.modelRun(e.runId,"status","GET"),o=JSON.stringify(t);if((e.json||o!==r)&&(b(t,e.json),r=o),W.has(ae(t)))return;await n(e.intervalMs)}}l(A,"watchTraining");async function oe(e){let n;try{n=JSON.parse(await x(e,"utf8"))}catch(r){throw new Error(`Could not read Harness Run Manifest ${e}: ${r instanceof Error?r.message:String(r)}`)}if(!n||typeof n!="object"||Array.isArray(n))throw new Error("Harness Run Manifest must be a JSON object.");return n}l(oe,"readManifest");async function se(e){let n="Start this exact prepared training run? Downloads, provisioning, or spend may begin.";if(e)return e(n);if(!process.stdin.isTTY||!process.stdout.isTTY)throw new Error("training start requires --yes when standard input is not interactive");let r=z({input:process.stdin,output:process.stdout});try{let t=await r.question(`${n} [y/N] `);return t.trim().toLowerCase()==="y"||t.trim().toLowerCase()==="yes"}finally{r.close()}}l(se,"confirmStart");function ie(e){if(!e||typeof e!="object")return null;let n="job"in e?e.job:null;return!n||typeof n!="object"||!("id"in n)?null:typeof n.id=="string"?n.id:null}l(ie,"readRunId");function ae(e){return!e||typeof e!="object"?"":"state"in e&&typeof e.state=="string"?e.state:"status"in e&&typeof e.status=="string"?e.status:""}l(ae,"readStatus");function b(e,n){if(n){console.log(JSON.stringify(e));return}console.log(JSON.stringify(e,null,2))}l(b,"printResult");export{F as a,Y as b,we as c,K as d,q as e};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{a as i}from"./chunk-FTQLQJQV.js";var d=class extends Error{constructor(n,r){super(`API request timed out after ${n}ms: ${r}`);this.timeoutMs=n;this.requestUrl=r;this.name="ApiTimeoutError"}timeoutMs;requestUrl;static{i(this,"ApiTimeoutError")}code="OPENPOND_API_TIMEOUT"},l=class extends Error{constructor(n,r){super(`API response exceeded ${n} bytes: ${r}`);this.maximumBytes=n;this.requestUrl=r;this.name="ApiResponseTooLargeError"}maximumBytes;requestUrl;static{i(this,"ApiResponseTooLargeError")}code="OPENPOND_API_RESPONSE_TOO_LARGE"},E=class extends Error{constructor(n,r,o,c=null){let s=c||r;super(`${o} failed: ${n}${s?` ${s}`:""}`);this.status=n;this.apiMessage=c;this.name="OpenPondApiError",this.code=r||"OPENPOND_API_ERROR"}status;apiMessage;static{i(this,"OpenPondApiError")}code};async function O(t,e,n,r={}){let{timeoutMs:o=3e4,maxResponseBytes:c=8388608,explicitBearerAuth:s=!1,...a}=r,y=`${t}${n}`,u=new Headers(a.headers);u.set("Content-Type","application/json");let p=s?void 0:process.env.OPENPOND_API_KEY,A=e?.trim()||"",x=!s&&A.startsWith("opk_"),T=p||(x?A:null);T&&!u.has("openpond-api-key")&&u.set("openpond-api-key",T),e?u.set("Authorization",x?`ApiKey ${A}`:`Bearer ${e}`):p&&!u.has("Authorization")&&u.set("Authorization",`ApiKey ${p}`);let m=new AbortController,h=new d(o,y),f=o>0?setTimeout(()=>m.abort(h),o):null;f?.unref?.();let _=w(a.signal,m.signal,o),b=i(()=>{f&&clearTimeout(f)},"cleanup");try{let g=await fetch(y,{...a,headers:u,signal:_});return P(g,{cleanup:b,maximumBytes:c,requestUrl:y,timeoutController:m,timeoutError:h})}catch(g){throw b(),m.signal.aborted?h:g}}i(O,"apiFetch");async function R(t,e){let n;try{let r=await t.text();n=r?JSON.parse(r):{}}catch(r){if(r instanceof d||r instanceof l)throw r;n={}}if(!t.ok){let r=typeof n.error=="string"?n.error:null,o=typeof n.message=="string"?n.message:null;throw new E(t.status,r,e,o)}return n}i(R,"readApiJson");function P(t,e){if(!t.body)return e.cleanup(),t;let n=Number(t.headers.get("content-length"));if(e.maximumBytes>0&&Number.isFinite(n)&&n>e.maximumBytes)throw e.cleanup(),t.body.cancel(),new l(e.maximumBytes,e.requestUrl);let r=t.body.getReader(),o=0,c=new ReadableStream({async pull(s){try{let a=await r.read();if(a.done){e.cleanup(),s.close();return}if(o+=a.value.byteLength,e.maximumBytes>0&&o>e.maximumBytes){e.cleanup(),await r.cancel(),s.error(new l(e.maximumBytes,e.requestUrl));return}s.enqueue(a.value)}catch(a){e.cleanup(),s.error(e.timeoutController.signal.aborted?e.timeoutError:a)}},async cancel(s){e.cleanup(),await r.cancel(s)}});return new Response(c,{headers:t.headers,status:t.status,statusText:t.statusText})}i(P,"boundedResponse");function w(t,e,n){return n<=0?t??void 0:t?AbortSignal.any([t,e]):e}i(w,"composedSignal");export{O as a,R as b};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{A as je,C as K,D as J,E as z,G as Me,N as _e,O,P as L,S as re,U as Fe,W as oe,X as I,Y as Ce,Z as U,_ as B,a as Z,b as ue,c as ee,h as ae,i as Se,j as xe,k as De,l as Pe,p as Ie,r as Ae,s as V,t as C,y as Ee,z as He}from"./chunk-YRDPVTEI.js";import{d as Re}from"./chunk-I6VMRQF4.js";import{V as be,X as ye}from"./chunk-QAFXQHHG.js";import{K as H,L as se,M as F,P as we,o as Te}from"./chunk-G4E3WGLM.js";import{ga as te,v as he}from"./chunk-ZY32SZ2P.js";import{i as Q,l as _,m as q,n as i}from"./chunk-RCT3O3HQ.js";import{A as m}from"./chunk-X2J2P5ZT.js";import{a as d}from"./chunk-FTQLQJQV.js";var Ye=new Set(["taskset.json","capabilities.json","data/tasks.jsonl","tasks/tasks.jsonl","graders/graders.json","fixtures/grader-fixtures.json","metrics/policy.json","assets/manifest.json","environment/contract.json","environment/taskset.ts","rubrics/preference-review.md","comparisons/policy.json"]);function ne(t){return Ye.has(C.parse(t))}d(ne,"isManagedTasksetDraftFilePath");function Be(t){let e=O(t.source),s=O(t.edited),o=t.preparation;if(o.authoringGraph!=="bound"||!e.modelResources||e.learningResources||s.modelResources||s.learningResources)throw new Error("Bound task editing requires its source Reward and an ordinary edited workspace.");if(e.contentHash!==o.sourcePackageHash||!se(H(e.taskset),o.sourceTasksetRef))throw new Error("Bound draft differs from its retained source package.");let n=d(g=>g.taskset.graders.map(x=>x.kind==="custom_verifier"?{...x,exportName:x.exportName??"verify"}:x),"normalizedGraders");if(i(n(e))!==i(n(s)))throw new Error("Edit the saved Reward in Rewards before changing this Taskset's graders.");let c=e.modelResources,T=new Map(c.assets.map(g=>[g.id,g])),a=J(s),k=J(e),p=d(g=>{let{id:x,revision:me,contentHash:fe,metadata:pe,...Xe}=g,{javascriptEnvironment:lt,...ve}=pe;return{...Xe,metadata:{...ve,resources:ve.resources??[]}}},"environmentContent"),u=d(g=>{if(!g)return null;let{id:x,revision:me,contentHash:fe,...pe}=g.execution.javascript;return pe},"javascriptContent"),R=i(p(e.environment))===i(p(s.environment))&&i(u(k))===i(u(a)),D=R?e.environment:s.environment,h=R?k:a,y=new Set([...c.assets.map(g=>g.id),...s.taskset.tasks.flatMap(g=>g.privilegedContextRef?[g.privilegedContextRef]:[]),...[s.environment.actionSchemaRef,s.environment.observationSchemaRef,s.environment.stateSchemaRef].flatMap(g=>g?[g.id]:[]),...a?.assets.map(g=>g.id)??[]]),j=new Set([...y,...s.taskset.tasks.flatMap(g=>[...g.artifactRefs.map(x=>x.id),...(g.requiredOutputs??[]).flatMap(x=>x.schemaRef?[x.schemaRef.id]:[])])]),A=Qe(e,s,j);for(let g of y){let x=A.find(fe=>fe.asset.id===g);if(!x)throw new Error(`Bound Taskset asset is missing: ${g}.`);let me=new TextDecoder("utf-8",{fatal:!0}).decode(K(x));T.set(g,we.parse(F({schemaVersion:"openpond.learningTextAsset.v1",id:g,revision:1,asset:x.asset,text:me})))}let S=_e(s),{contentHash:$,...w}=c.taskDefinition,{policy:W,environment:ce,environmentRelease:N,tools:r,capabilities:l,verifierSetRelease:v}=s.taskset,f=Te.parse(F({...w,instructions:S,execution:{policy:W,environment:ce,environmentRelease:N,tools:r,capabilities:l,verifierSetRelease:v}})),{contentHash:b,...P}=s.taskset,M=te.parse(F({...P,tasks:s.taskset.tasks.map(g=>c.instructionMode==="per_task"?g:{...g,policyVisibleContext:{...g.policyVisibleContext,instructions:S}})})),E=Pe({owner:o.lineage.owner,source:{...c,taskset:e.taskset,executionResources:{environment:e.environment,verifierSet:e.verifierSet}},rewardBinding:c.rewardBinding,rewards:c.rewards,assets:[...T.values()],edits:{taskset:M,taskDefinition:f,executionResources:{environment:D,verifierSet:s.verifierSet},...h?{execution:h.execution}:{}}}),G=xe.parse(E.taskset.metadata.modelTasksetDerivation);if(E.taskset.id!==o.tasksetId||E.taskset.revision!==o.tasksetRevision||i({...G,schemaVersion:o.lineage.schemaVersion})!==i(o.lineage))throw new Error("Bound draft differs from its retained ownership lineage.");let{taskset:de,executionResources:le,...Je}=E;return L({schemaVersion:"openpond.tasksetPackage.v1",taskset:de,...le,modelResources:Je,files:A})}d(Be,"publishBoundModelTasksetDraftPackage");function Qe(t,e,s){let o=e.files,n=new Map(t.files.map(a=>[a.asset.id,{file:a,assetHash:i(a.asset)}])),c=d(a=>{let k=n.get(a.asset.id);return k!==void 0&&k.file.base64===a.base64&&k.assetHash===i(a.asset)},"isSourceFile"),T=t.files.filter(a=>ne(a.asset.path)).map(a=>{let k=`source-artifact-${i({packageHash:t.contentHash,assetId:a.asset.id})}`;return{original:a,asset:{...a.asset,id:k,path:`source-artifacts/${t.contentHash}/${i(a.asset.path)}/${a.asset.path.split("/").at(-1)}`}}});for(let{original:a,asset:k}of T){let p=T.filter(h=>i({...h.original.asset,id:a.asset.id})===i(a.asset)),R=e.files.find(h=>h.asset.id===k.id)??p.flatMap(h=>e.files.filter(y=>i(y.asset)===i(h.asset)))[0];if(!R||R.base64!==a.base64||!p.some(h=>i(h.asset)===i(R.asset)))throw new Error(`Retained Taskset source artifact differs from its original bytes: ${a.asset.id}.`);let D=o.filter(h=>h.asset.path===a.asset.path||h.asset.id===a.asset.id);if(D.some(h=>h.asset.path!==a.asset.path||h.asset.id!==a.asset.id&&h.asset.id!==`taskset-file-${i(a.asset.path)}`&&!c(h)))throw new Error(`Retained Taskset source artifact conflicts with an authored file: ${a.asset.id}.`);o=[...o.filter(h=>h.asset.id!==k.id&&h.asset.id!==a.asset.id&&(!D.includes(h)||c(h))),a]}for(let a of t.files.filter(k=>!o.some(p=>p.asset.id===k.asset.id))){if(a.asset.path==="environment/execution.json"){let u=ae.safeParse(JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(K(a))));if(u.success&&i(z(u.data))===i(a))continue}let k=o.filter(u=>u.asset.path===a.asset.path),p=d(u=>i({...u.asset,id:a.asset.id})===i(a.asset)&&u.base64===a.base64,"sameEnvelope");if(s.has(a.asset.id)||!k.length||k.some(u=>!p(u)))throw new Error(`Retained Taskset source alias differs from its original bytes: ${a.asset.id}.`);o=[...o,a]}return o}d(Qe,"retainSourceFileIdentities");function Ct(t){let e=Ae.parse(t.request),s=Ie.parse(t.owner),o=O(t.source);if(o.learningResources)throw new Error("Reviewed Tasksets require their reviewed authoring workflow.");if(o.contentHash!==e.sourcePackageHash)throw new Error("Taskset draft source package changed.");if(o.modelResources){let k=De({owner:s,source:{...o.modelResources,taskset:o.taskset,executionResources:{environment:o.environment,verifierSet:o.verifierSet}},rewardBinding:o.modelResources.rewardBinding,rewards:o.modelResources.rewards,assets:o.modelResources.assets}),p=k.taskset.metadata.modelTasksetDerivation;return V.parse({schemaVersion:"openpond.modelTasksetDraftPreparation.v1",draftId:`model-taskset-draft-${i({owner:s,operationId:e.operationId})}`,requestHash:i(e),sourcePackageHash:o.contentHash,sourceTasksetRef:H(o.taskset),tasksetId:k.taskset.id,tasksetRevision:k.taskset.revision,lineage:{...p,schemaVersion:"openpond.modelTasksetAuthoring.v1"},authoringGraph:"bound"})}let n=He(o.taskset),c=n&&i(n.owner)===i(s),T=c?n.root:H(o.taskset),a={schemaVersion:"openpond.modelTasksetAuthoring.v1",owner:s,root:T,parent:H(o.taskset)};return V.parse({schemaVersion:"openpond.modelTasksetDraftPreparation.v1",draftId:`model-taskset-draft-${i({owner:s,operationId:e.operationId})}`,requestHash:i(e),sourcePackageHash:o.contentHash,sourceTasksetRef:H(o.taskset),tasksetId:Ee(a),tasksetRevision:c?o.taskset.revision+1:1,lineage:a})}d(Ct,"prepareModelTasksetDraft");function $e(t){let e=V.parse(t.preparation);if(!se(e.sourceTasksetRef,e.lineage.parent))throw new Error("Taskset draft preparation differs from its source lineage.");if(e.authoringGraph==="bound"){if(!t.source)throw new Error("Bound Taskset authoring requires its retained source package.");return Be({preparation:e,source:t.source,edited:t.edited})}let s=Ze(t.edited),{contentHash:o,...n}=s.verifierSet,c=ye({...n,id:`${e.tasksetId}-verifiers`,revision:e.tasksetRevision,calibrationReceiptRefs:[],metadata:{sourceVerifierSet:H(s.verifierSet)}}),{contentHash:T,...a}=s.taskset,k=te.parse(F({...a,id:e.tasksetId,revision:e.tasksetRevision,verifierSetRelease:{id:c.id,contentHash:c.contentHash},metadata:{modelTasksetAuthoring:e.lineage,...s.taskset.metadata.environmentResources===void 0?{}:{environmentResources:s.taskset.metadata.environmentResources},...s.taskset.metadata.ordinaryAuthoring===void 0?{}:{ordinaryAuthoring:s.taskset.metadata.ordinaryAuthoring}}})),p=J(s),u=p?[...s.files.filter(R=>R.asset.id!==Se(s.taskset)),z({...p.execution,verifierSet:c})]:s.files;return L({schemaVersion:"openpond.tasksetPackage.v1",taskset:k,environment:s.environment,verifierSet:c,files:u})}d($e,"publishModelTasksetDraftPackage");function Ze(t){let e=O(t);if(e.modelResources||e.learningResources)throw new Error("This Taskset requires its bound or reviewed authoring workflow.");return e}d(Ze,"requireOrdinaryPackage");function qe(t,e,s,o){if(t.environment.entrypoint!=="openpond.javascript-environment.v1")return{taskset:t,inventory:s,generatedFiles:[]};let n="environment/execution.json",c=e.get(n);if(!c||c.length>524288)throw new Error("Authored tool environment requires its bounded private execution declaration.");let T=ae.parse(JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(c))),a=d(S=>{if(!S)return null;let $=s.find(w=>w.asset.id===S.id&&w.asset.path===S.path);if(!$)throw new Error(`Authored environment dependency is missing: ${S.id}.`);return $.asset},"repin"),{contentHash:k,...p}=T.javascript,u=Re.parse(F({...p,id:`javascript-${t.id}`,revision:t.revision,module:a(T.javascript.module)}));if(i(u.tools)!==i(t.environment.metadata.portableTools)||i(u.tools.map(S=>S.name))!==i(t.environment.toolNames))throw new Error("Authored environment tools differ from the Taskset's declared tools.");let R=be({schemaVersion:"openpond.environmentRelease.v1",id:`environment-${t.id}`,revision:t.revision,contract:Fe(t),actionSchemaRef:a(T.environment.actionSchemaRef),observationSchemaRef:a(T.environment.observationSchemaRef),stateSchemaRef:a(T.environment.stateSchemaRef),artifactCollection:T.environment.artifactCollection,adapterConformanceHashes:{},metadata:{javascriptEnvironment:H(u),resources:t.environment.resources??[]}}),D=I.parse({...t,environment:{...t.environment,metadata:{...t.environment.metadata,portableExecutionResources:{environment:R}}}}),h=re({taskset:D,adapterId:o}),y=z({javascript:u,environment:R,verifierSet:h.verifierSetRelease}),j=[...s.filter(S=>S.sourcePath!==n),{asset:y.asset,sourcePath:n}],A=I.parse({...D,metadata:{...D.metadata,portableFileInventory:j}});return{taskset:I.parse({...A,contentHash:U(A)}),inventory:j,generatedFiles:[{path:n,role:"environment",content:new TextDecoder().decode(K(y))}]}}d(qe,"prepareAuthoredToolEnvironment");var ie=m.array(m.object({asset:Q,sourcePath:m.string().min(1)}).strict()).max(1e4),et=new Set(["taskset.json","capabilities.json","data/tasks.jsonl","graders/graders.json","fixtures/grader-fixtures.json","environment/taskset.ts"]);function We(t){return et.has(t)}d(We,"isGeneratedTasksetPublicationFilePath");function Ve(t,e,s,o=je){let n=I.parse(t);for(let r of n.tasks)for(let l of r.requiredOutputs??[])if(Z(l.metadata)&&l.submissionMode!=="structured_json")throw new Error("Sampling schema requires a structured output.");if(n.metadata.taskDefinition!==void 0||n.metadata.rewardBinding!==void 0){for(let r of n.tasks)for(let l of oe(r).requiredOutputs??[]){let v=Z(l.metadata);if(!v)continue;let f=oe(r).artifactRefs.find(G=>G.id===v.schemaRef.id);if(!f||i(f)!==i(v.schemaRef)||!l.schemaRef)throw new Error("Sampling schema must match an ordinary declared policy artifact.");let b=d((G,de)=>r.assets?.find(le=>le.id===G)?.artifactRef??de,"sourcePath"),P=e.get(b(l.schemaRef.id,l.schemaRef.path)),M=e.get(b(f.id,f.path));if(!P||!M)throw new Error("Sampling schema source bytes are missing.");let E=ee(P,l.schemaRef.contentHash);ue(E,v,M)}return{taskset:n,generatedFiles:[]}}let c=new Map,T=0;for(let[r,l]of e){if(C.parse(r),T+=l.byteLength,c.size>=1e4||T>o*3/4)throw new Error("Taskset source exceeds the package byte limit.");c.set(r,l.slice())}let a=n.metrics?.customAggregator,k=a?c.get(a.module):void 0;if(a&&!k)throw new Error("Declared Taskset metric module is missing.");let p=a&&k?{...n.metrics,customAggregator:{...a,contentHash:q(k)}}:n.metrics,u=new Map,R=new Set,D=[],h=d((r,l,v,f)=>{let b=c.get(l);if(!b)throw new Error(`Declared Taskset file is missing: ${l}.`);return{id:r,path:l,contentHash:q(b),sizeBytes:b.byteLength,mediaType:v,visibility:f}},"ref"),y=d((r,l=r.path)=>{let v=u.get(r.id);if(v&&i(v)!==i({asset:r,sourcePath:l}))throw new Error(`Conflicting Taskset file identity: ${r.id}.`);let f=c.get(l);if(!f||f.length!==r.sizeBytes||q(f)!==r.contentHash)throw new Error(`Taskset file differs from its declared bytes: ${r.id}.`);u.set(r.id,{asset:r,sourcePath:l}),R.add(l)},"add");for(let r of n.tasks){let l={};for(let f of r.requiredOutputs??[])if(f.submissionMode==="structured_json"){if(!f.schemaRef||f.mediaType!=="application/json")throw new Error("Structured outputs require a JSON schemaRef and application/json.");let b=r.metadata.portableTaskRecord?.requiredOutputs?.find(E=>E.path===f.path)?.schemaRef,P=b?.id===f.schemaRef?b.path:f.schemaRef,M=h(f.schemaRef,P,"application/schema+json","policy");if(b&&b.id===f.schemaRef&&b.visibility!=="policy")throw new Error("Structured output schema must be policy-visible.");ee(c.get(P),M.contentHash),l[f.schemaRef]=M}Object.keys(l).length&&(r.metadata={...r.metadata,outputSchemaRefs:l});let v=oe(r);for(let f of v.artifactRefs)y(f,r.assets?.find(b=>b.id===f.id)?.artifactRef??f.path);for(let f of v.requiredOutputs??[])f.schemaRef&&y(f.schemaRef);for(let f of v.requiredOutputs??[]){let b=Z(f.metadata);if(!b)continue;let P=u.get(b.schemaRef.id);if(!P||i(P.asset)!==i(b.schemaRef)||!v.artifactRefs.some(E=>E.id===b.schemaRef.id)||!f.schemaRef)throw new Error("Sampling schema must match an ordinary declared policy artifact.");let M=ee(c.get(u.get(f.schemaRef.id).sourcePath),f.schemaRef.contentHash);ue(M,b,c.get(P.sourcePath))}}for(let r of n.environment.resources??[])y(h(r.id,r.path,r.mediaType??"application/octet-stream",r.visibility==="policy_visible"?"policy":"host_private"));let j=n.graders.map(r=>{if(r.kind==="custom_verifier"){let l=h(`verifier-${r.id}`,r.module,"application/javascript","host_private"),v=Q.safeParse(r.metadata.portableVerifierRef);return v.success&&v.data.contentHash===l.contentHash&&v.data.sizeBytes===l.sizeBytes&&(l=v.data),y(l,r.module),{...r,metadata:{...r.metadata,portableVerifierRef:l}}}if(r.kind==="human"||r.kind==="model_judge"){let l=new TextEncoder().encode(r.rubric),v=`graders/rubric-${q(l)}.md`;c.set(v,l);let f=h(`rubric-${r.id}`,v,"text/markdown","verifier"),b=Q.safeParse(r.metadata.portableRubricRef);if(b.success&&b.data.contentHash===f.contentHash&&b.data.sizeBytes===f.sizeBytes){if(b.data.visibility==="policy")throw new Error("A grader rubric cannot become policy-visible.");f=b.data}return y(f,v),D.push({path:v,role:"verifier",content:r.rubric}),{...r,metadata:{...r.metadata,portableRubricRef:f}}}return r});a&&![...u.values()].some(r=>r.asset.path===a.module&&r.sourcePath===a.module&&r.asset.visibility!=="policy")&&y(h(`metric-${i(a.module)}`,a.module,"application/javascript","host_private"));let A=ie.parse(n.metadata.portableFileInventory??[]);for(let r of[...c.keys()].sort())if(!R.has(r)){let l=A.find(v=>v.sourcePath===r&&!u.has(v.asset.id));y(l?{...h(l.asset.id,r,l.asset.mediaType,l.asset.visibility),path:l.asset.path}:h(`taskset-file-${i(r)}`,r,"application/octet-stream","host_private"),r)}let{importedPackageHash:S,derivedPortableMetadata:$,...w}=n.metadata,W={...n.environment.metadata};if(W.portableExecutionResources!==void 0){let r=m.object({environment:m.unknown(),verifierSet:m.unknown().optional()}).parse(W.portableExecutionResources);W.portableExecutionResources={environment:r.environment}}let ce=I.parse({...n,graders:j,metrics:p,environment:{...n.environment,metadata:W},metadata:{...w,...S===void 0?{}:{sourceImportedPackageHash:S},portableFileInventory:ie.parse([...u.values()].sort((r,l)=>r.asset.id.localeCompare(l.asset.id)))}}),N=qe(ce,c,[...u.values()],s);return{taskset:I.parse({...N.taskset,contentHash:U(N.taskset)}),generatedFiles:[...D,...N.generatedFiles]}}d(Ve,"prepareAuthoredTasksetSource");var X=class extends Error{static{d(this,"TasksetDraftPublishError")}issues;constructor(e){super(e.map(s=>s.message).join(`
|
|
3
|
+
`)),this.name="TasksetDraftPublishError",this.issues=e}};function ds(t){let e=t.now??new Date().toISOString(),s=t.id?.trim()||`taskset-draft-${globalThis.crypto.randomUUID()}`;return B.parse({schemaVersion:"openpond.tasksetDraft.v1",id:s,revision:1,profileId:t.profileId,modelScope:t.modelScope??null,name:t.name?.trim()??"",objective:"",purpose:"general",benchmark:null,preferenceComparison:null,status:"draft",sourceRefs:[],datasetArtifact:null,policy:{policyVisibleFields:["input"],privilegedFields:["expectedOutput"],hiddenGraderRefs:[],connectedAppScopes:[]},environment:{protocolVersion:"openpond.taskEnvironment.v1",kind:"chat",entrypoint:"openpond-chat-v1",stateful:!1,deterministicSeeds:!0,toolNames:[],lifecycle:["create","reset","step","grade","cleanup"],defaultTimeoutMs:12e4,networkPolicy:"none",resources:[],metadata:{}},output:{mode:"text",jsonSchema:null,renderer:null},capabilities:{schemaVersion:"openpond.tasksetCapabilities.v1",taskKind:"chat",supportedSignals:["demonstration","preference","correction","feedback","reward","label"],compatibleMethods:["none"],rewardKinds:["none"],requiresTools:!1,requiresState:!1,requiresPrivilegedGrading:!0,environmentPlacements:["local","remote","colocated"],exportable:!0,portabilityBlockers:[]},metrics:{schemaVersion:"openpond.tasksetMetricPolicy.v1",primaryMetric:"score",aggregation:"mean_score",missingReward:"zero",customAggregator:null},review:{enabled:!1,candidateCount:2,minimumSamples:100,allowTies:!0,allowRejectAll:!0,rubric:"",criteria:[]},tasks:[],graders:[],graderFixtures:[],learningSignals:{demonstrations:[],preferences:[],corrections:[],feedback:[],rewards:[],labels:[]},publishedTasksetRef:null,createdAt:e,updatedAt:e,metadata:{}})}d(ds,"createTasksetDraft");function ze(t){let e=[];t.name.trim()||e.push({code:"name_missing",message:"Name is required.",path:"name"}),t.objective.trim()||e.push({code:"objective_missing",message:"Objective is required.",path:"objective"}),!t.datasetArtifact&&t.tasks.length===0&&e.push({code:"tasks_missing",message:"Add at least one task or Dataset artifact.",path:"tasks"});let s=new Set(t.sourceRefs.map(o=>o.id));for(let o of t.tasks)for(let n of o.sourceRefs)s.has(n)||e.push({code:"task_source_missing",message:`Task ${o.id} references missing source ${n}.`,path:`tasks.${o.id}.sourceRefs`});return e}d(ze,"draftPublishIssues");function Oe(t){let e=B.parse(t.draft),s=t.now??new Date().toISOString(),o=ze(e);if(o.length)throw new X(o);let n=e.modelScope?.source;if(n&&t.tasksetId&&t.tasksetId!==n.tasksetId)throw new Error("Taskset draft publication differs from its prepared identity.");let c=n?.tasksetId||t.tasksetId?.trim()||e.publishedTasksetRef?.id||e.id.replace(/-draft$/,""),T=n?.tasksetRevision??(e.publishedTasksetRef?.id===c?e.publishedTasksetRef.revision+1:1),a=e.sourceRefs.length?e.sourceRefs:[tt(e,c,s)],k=a[0].id,p=e.tasks.map(w=>Me.parse({...w,sourceRefs:w.sourceRefs.length?w.sourceRefs:[k],metadata:{exampleOrigin:"expert_authored",...w.metadata}})),u=e.capabilities.compatibleMethods.find(w=>w!=="none"&&w!=="retrieval")??null,R=st(e),D=e.graders.filter(w=>w.rewardEligible&&w.weight>0&&w.kind!=="human"),h=u===null&&R==="verifiable_reward"&&D.length>0,y=u??(h?"grpo":null),j=I.parse({schemaVersion:"openpond.taskset.v1",id:c,revision:T,profileId:e.profileId,profileRelease:null,createImproveRunId:null,name:e.name,objective:e.objective,purpose:e.purpose,benchmark:e.benchmark,preferenceComparison:e.preferenceComparison,status:"needs_review",sourceRefs:a,datasetArtifact:e.datasetArtifact??null,policy:e.policy,environment:e.environment,capabilities:h?{...e.capabilities,compatibleMethods:["grpo"],rewardKinds:[...new Set(D.map(w=>w.kind==="model_judge"?"model_judge":"deterministic"))]}:e.capabilities,metrics:e.metrics,tasks:p,graders:e.graders,graderFixtures:e.graderFixtures,learningSignals:e.learningSignals,authoringProvenance:{schemaVersion:"openpond.taskAuthoringProvenance.v1",model:null,modelConfig:{},skillHash:i("openpond-taskset-draft-authoring-v1"),promptTemplateVersion:"taskset-draft-v1",buildIntent:R,buildSpecification:null,evidenceHashes:a.map(w=>w.sourceHash),tasksetSdkVersion:"draft-v1",sourceCommit:null,repairHistory:[],createdAt:s},readiness:null,contentHash:"00000000",createdAt:T===1?e.createdAt:s,updatedAt:s,metadata:{...e.metadata,...n?{modelTasksetAuthoring:n.lineage}:{},tasksetReviewPolicy:e.review,tasksetOutputContract:e.output,...t.sourcePackageHash?{sourcePackageHash:t.sourcePackageHash}:{},...y?{trainingMethod:y}:{},diagnosis:{schemaVersion:"openpond.capabilityDiagnosis.v1",summary:e.objective,stableBehavior:[e.objective],changingKnowledge:[],requiredContext:[],requiredTools:e.environment.toolNames,intervention:y==="dpo"?"preference":y==="grpo"||y==="ppo"?"grpo_rft":y==="sft"?"sft":"no_training",trainingEligible:y!==null,rationale:y?[`The author selected ${y.toUpperCase()} compatibility.`]:["The Taskset is currently configured for evaluation only."],confidence:1}}}),A=I.parse({...j,contentHash:U(j)}),$=Ce(A,{purpose:"publication"}).issues.filter(w=>w.severity==="error");if($.length)throw new X($.map(w=>({code:w.code,message:w.message,path:w.path})));return A}d(Oe,"publishTasksetDraft");function tt(t,e,s){let o=i({draftId:t.id,draftRevision:t.revision,tasks:t.tasks});return{schemaVersion:"openpond.generatedDatasetSource.v1",kind:"generated",id:`source-${e}`,profileId:t.profileId,title:`${t.name} manual authoring`,sourceHash:o,occurredAt:s,licensingStatus:"approved",secretScanStatus:"passed",piiScanStatus:"passed",generatorId:"openpond-taskset-draft",generatorVersion:"1",seed:0,generatorHash:o,metadata:{draftId:t.id,draftRevision:t.revision}}}d(tt,"generatedDraftSource");function st(t){return t.metadata.buildIntent==="discovery"||!t.graders.length&&!t.learningSignals.preferences.length&&!t.learningSignals.rewards.length&&!t.learningSignals.labels.length?"discovery":t.learningSignals.preferences.length?"preferences":t.learningSignals.rewards.length?"verifiable_reward":t.learningSignals.labels.length?"rubric":!t.capabilities.compatibleMethods.some(e=>e!=="none"&&e!=="retrieval")&&t.graders.some(e=>e.rewardEligible&&e.weight>0&&e.kind!=="human")?"verifiable_reward":"demonstrations"}d(st,"buildIntentForDraft");function Rs(t){let e=[];t.output.renderer&&e.push({relativePath:t.output.renderer.module,source:`export async function ${t.output.renderer.exportName}(output: unknown) {
|
|
4
|
+
// Return artifact paths or bytes derived from the model's structured output.
|
|
5
|
+
return output;
|
|
6
|
+
}
|
|
7
|
+
`});for(let s of t.graders)s.kind==="custom_verifier"&&e.push({relativePath:s.module,source:`export async function ${s.exportName}(input: { output: unknown; task: unknown }) {
|
|
8
|
+
return { passed: false, score: 0, feedback: "Implement this verifier." };
|
|
9
|
+
}
|
|
10
|
+
`});t.metrics.customAggregator&&e.push({relativePath:t.metrics.customAggregator.module,source:`export function ${t.metrics.customAggregator.exportName}(scores: number[]) {
|
|
11
|
+
return scores.length ? scores.reduce((sum, score) => sum + score, 0) / scores.length : 0;
|
|
12
|
+
}
|
|
13
|
+
`});for(let s of e)C.parse(s.relativePath);return e}d(Rs,"configuredTasksetDraftFiles");function Le(t){let e=B.parse(t);return new Map([["taskset.json",_(e)],["tasks/tasks.jsonl",rt(e.tasks)],["graders/graders.json",_(e.graders)],["fixtures/grader-fixtures.json",_(e.graderFixtures)],["metrics/policy.json",_(e.metrics)],["assets/manifest.json",_(e.tasks.flatMap(s=>s.assets??[]))],["environment/contract.json",_(e.environment)],["rubrics/preference-review.md",at(e)],["comparisons/policy.json",_(e.review)]])}d(Le,"renderTasksetDraftManifests");function at(t){let e=t.review.criteria.length?`
|
|
14
|
+
|
|
15
|
+
## Criteria
|
|
16
|
+
|
|
17
|
+
${t.review.criteria.map(s=>`- **${s.label}** (${s.weight}): ${s.description}`).join(`
|
|
18
|
+
`)}`:"";return`# Preference review rubric
|
|
19
|
+
|
|
20
|
+
${t.review.rubric}${e}
|
|
21
|
+
`}d(at,"rubricMarkdown");function rt(t){return t.length?`${t.map(e=>JSON.stringify(e)).join(`
|
|
22
|
+
`)}
|
|
23
|
+
`:""}d(rt,"jsonLines");var Ue=64*1024*1024,Ne=m.string().regex(/^[a-f0-9]{64}$/),Ge=m.object({path:C,contentHash:Ne,sizeBytes:m.number().int().nonnegative(),base64:m.string()}).strict(),Ke=m.object({schemaVersion:m.literal("openpond.tasksetDraftWorkspace.v1"),draft:B,files:m.array(Ge).max(1e4)}).strict(),ot=Ke.extend({contentHash:Ne}).strict();function Cs(t,e=Ue){he(t,e);let s=Ke.parse(t);return s.files.sort((o,n)=>o.path<n.path?-1:o.path>n.path?1:0),ke({...s,contentHash:i(s)},e)}d(Cs,"createTasksetDraftWorkspace");function ke(t,e=Ue){he(t,e);let s=ot.parse(t),{contentHash:o,...n}=s;if(i(n)!==o)throw new Error("Taskset draft workspace differs from its retained bytes.");let c=null,T=new Set;for(let a of s.files){if(ne(a.path))throw new Error("Managed Taskset files are represented by the draft document.");if(c!==null&&c>=a.path)throw new Error("Taskset draft file paths must be unique and sorted.");let k=a.path.split("/");for(let p=1;p<k.length;p++)if(T.has(k.slice(0,p).join("/")))throw new Error("A Taskset draft file occupies another file's directory.");ge(a),T.add(a.path),c=a.path}return s}d(ke,"validateTasksetDraftWorkspace");function ge(t){let e=Ge.parse(t),s;try{s=atob(e.base64)}catch{throw new Error("Taskset draft file contains invalid base64.")}if(btoa(s)!==e.base64)throw new Error("Taskset draft file contains noncanonical base64.");let o=new Uint8Array(s.length);for(let n=0;n<s.length;n++)o[n]=s.charCodeAt(n);if(o.byteLength!==e.sizeBytes||q(o)!==e.contentHash)throw new Error("Taskset draft file differs from its retained bytes.");return o}d(ge,"decodeTasksetDraftWorkspaceFile");function nt(t){let e=ke(t.workspace,t.maximumBytes),s=t.preparation===null?null:V.parse(t.preparation);if(s?e.draft.id!==s.draftId||e.draft.modelScope?.modelId!==s.lineage.owner.modelId||e.draft.profileId!==s.lineage.owner.scopeId||i(e.draft.modelScope?.source??null)!==i(s):e.draft.modelScope?.source!==void 0)throw new Error("Taskset draft differs from its retained source preparation.");let o=Oe({draft:e.draft,now:e.draft.updatedAt,sourcePackageHash:t.sourceWorkspaceHash??e.contentHash}),n=new Map(e.files.map(p=>[p.path,ge(p)]));for(let[p,u]of Le(e.draft))We(p)||n.set(p,new TextEncoder().encode(u));let c=Ve(o,n,t.adapterId,t.maximumBytes);for(let p of c.generatedFiles)n.set(p.path,new TextEncoder().encode(p.content));let T=re({taskset:c.taskset,adapterId:t.adapterId}),a=ie.parse(c.taskset.metadata.portableFileInventory),k=L({schemaVersion:"openpond.tasksetPackage.v1",taskset:T.tasksetRelease,environment:T.environmentRelease,verifierSet:T.verifierSetRelease,files:a.map(p=>{let u=n.get(p.sourcePath);if(!u)throw new Error(`Captured Taskset file is missing: ${p.sourcePath}.`);return{asset:p.asset,base64:Buffer.from(u).toString("base64")}})},t.maximumBytes);return s?$e({preparation:s,edited:k,source:t.source}):k}d(nt,"compileTasksetDraftWorkspace");function Ks(t){if(!t.workspace.draft.modelScope)throw new Error("Taskset draft requires a Model owner.");return nt(t)}d(Ks,"compileModelTasksetDraftWorkspace");var Y=m.string().trim().min(1).max(500),it=m.string().regex(/^[a-f0-9]{64}$/),ct=m.object({id:Y,revision:m.number().int().positive(),contentHash:it}).strict(),dt=m.object({schemaVersion:m.literal("openpond.hostedTasksetSummary.v1"),id:Y,teamId:Y,release:ct,name:m.string().min(1).max(500),description:m.string().max(2e4),taskCount:m.number().int().nonnegative(),buildIntent:m.string().min(1).max(100),methodHint:m.string().min(1).max(100).nullable(),packageBytes:m.number().int().nonnegative().nullable(),storedBytes:m.number().int().nonnegative().nullable(),createdAt:m.string().datetime({offset:!0})}).strict(),Qs=m.object({afterId:m.string().trim().min(1).max(2e3).optional(),limit:m.number().int().min(1).max(100).default(30),modelProjectId:Y.optional(),projectId:Y.optional(),search:m.string().trim().max(100).optional(),sort:m.enum(["id","name","updated"]).default("id")}).strict(),Zs=m.object({items:m.array(dt).max(100),nextCursor:m.string().trim().min(1).max(2e3).nullable()}).strict(),ea=m.object({code:m.string().min(1),message:m.string().min(1)}).strict();export{ds as a,ne as b,Rs as c,ot as d,Cs as e,ke as f,ge as g,ct as h,Ct as i,$e as j,ie as k,We as l,Ve as m,nt as n,Ks as o};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{t as l}from"./chunk-
|
|
2
|
+
import{t as l}from"./chunk-Y3B6ZUE6.js";import{a as f}from"./chunk-FTQLQJQV.js";function d(e,s){let{tasks:r,paths:i,policyPaths:c}=p(e.draft,s),o=e.draft.metadata.portableFileInventory,n=e.files.filter(a=>!c.has(a.path)||i.has(a.path)),t=new Set(n.map(a=>a.path));return l({schemaVersion:e.schemaVersion,files:n,draft:{...e.draft,tasks:r,metadata:{...e.draft.metadata,...Array.isArray(o)?{portableFileInventory:o.filter(a=>t.has(a.sourcePath))}:{},localDatasetTaskIds:s}}},Number.POSITIVE_INFINITY)}f(d,"projectLocalDatasetWorkspace");function p(e,s){let r=new Set(s);if(!r.size||r.size!==s.length||s.some(t=>!e.tasks.some(a=>a.id===t)))throw new Error("Select distinct existing local Dataset tasks.");for(let t of e.graderFixtures)r.add(t.taskId);let i=e.tasks.filter(t=>r.has(t.id)),c=new Set(i.flatMap(t=>(t.assets??[]).map(a=>a.artifactRef)));for(let t of e.environment.resources??[])t.kind==="file"&&c.add(t.path);let o=e.metadata.portableFileInventory,n=new Set;if(Array.isArray(o))for(let t of o)t.asset?.visibility==="policy"&&n.add(t.sourcePath);return{tasks:i,paths:c,policyPaths:n}}f(p,"localDatasetProjectionPaths");export{d as a,p as b};
|