openpond 0.2.70 → 0.2.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app-server.js +1 -1
- package/dist/chunks/{acp-QTA6IU6W.js → acp-VWPJ2EL4.js} +1 -1
- package/dist/chunks/{acp-agent-N77HPAYQ.js → acp-agent-OZHZMQ6R.js} +1 -1
- package/dist/chunks/{actions-command-BZQCUDMD.js → actions-command-AXGXBU75.js} +1 -1
- package/dist/chunks/{app-layer-YQQNLIXA.js → app-layer-OHPIYEOJ.js} +1 -1
- package/dist/chunks/{app-server-evaluations-RRLYWLPK.js → app-server-evaluations-Y5UEF2Y7.js} +1 -1
- package/dist/chunks/{app-server-harness-services-XXM336NU.js → app-server-harness-services-GUHAIIPS.js} +1 -1
- package/dist/chunks/{app-server-runtime-B7AMBGQZ.js → app-server-runtime-CH5STRJP.js} +1 -1
- package/dist/chunks/{apps-WG7WY5CB.js → apps-DNLT6P4J.js} +1 -1
- package/dist/chunks/{chunk-MOXIGLN2.js → chunk-23YW5PAQ.js} +1 -1
- package/dist/chunks/{chunk-ZDEIVUUI.js → chunk-27OJ2OLP.js} +1 -1
- package/dist/chunks/{chunk-NSSZ2ZIU.js → chunk-2EAZB2MW.js} +1 -1
- package/dist/chunks/{chunk-DRLP7GIU.js → chunk-2GEZ3ZY7.js} +1 -1
- package/dist/chunks/{chunk-PAYFJHPO.js → chunk-2PVW2XFF.js} +1 -1
- package/dist/chunks/{chunk-Y2WNZWT2.js → chunk-2Q6FTL4C.js} +1 -1
- package/dist/chunks/{chunk-KP2MYTP5.js → chunk-2QHB5P2K.js} +1 -1
- package/dist/chunks/{chunk-FNGZ4UDZ.js → chunk-33UVQ7DU.js} +1 -1
- package/dist/chunks/{chunk-M4ZHFDRJ.js → chunk-3JVZ7OCQ.js} +1 -1
- package/dist/chunks/{chunk-4BUM6JEC.js → chunk-3JYPUOK4.js} +1 -1
- package/dist/chunks/{chunk-DXJC3QW7.js → chunk-3VT2PPKW.js} +1 -1
- package/dist/chunks/{chunk-Z33RVGP6.js → chunk-5LKEVB2P.js} +1 -1
- package/dist/chunks/{chunk-P4QM63L3.js → chunk-5ZBDHIIE.js} +1 -1
- package/dist/chunks/{chunk-WD4KAKEX.js → chunk-64EDQ7UV.js} +1 -1
- package/dist/chunks/{chunk-OL3L3U36.js → chunk-6BTX66SV.js} +1 -1
- package/dist/chunks/{chunk-KU4TPDPH.js → chunk-6LAGMWJE.js} +1 -1
- package/dist/chunks/{chunk-65FJWWXG.js → chunk-6YR5IYHH.js} +1 -1
- package/dist/chunks/{chunk-AUO5DCEU.js → chunk-73COPJ32.js} +1 -1
- package/dist/chunks/{chunk-KDER7R45.js → chunk-7PDF2UX2.js} +1 -1
- package/dist/chunks/{chunk-SO4GMSNP.js → chunk-7SOHV5BH.js} +1 -1
- package/dist/chunks/{chunk-XOPHFUUY.js → chunk-ASMQTMQB.js} +1 -1
- package/dist/chunks/{chunk-ESYPMD7Q.js → chunk-AT3ZYNX4.js} +1 -1
- package/dist/chunks/{chunk-NMMHXYDJ.js → chunk-AVEHWUML.js} +1 -1
- package/dist/chunks/{chunk-M4A7G4S5.js → chunk-B7SCVTE6.js} +1 -1
- package/dist/chunks/{chunk-DKOVZ6R2.js → chunk-BQNU4HZW.js} +1 -1
- package/dist/chunks/{chunk-UANH7U3Y.js → chunk-BTEBZYK3.js} +1 -1
- package/dist/chunks/{chunk-BU6MW65V.js → chunk-BYVE4TMU.js} +1 -1
- package/dist/chunks/{chunk-PNPV2LDE.js → chunk-BZS2PA4O.js} +1 -1
- package/dist/chunks/{chunk-AFYYIJ6K.js → chunk-C7NQPICU.js} +1 -1
- package/dist/chunks/{chunk-K7KBFM2T.js → chunk-CBD554GZ.js} +1 -1
- package/dist/chunks/{chunk-GYYJ47GX.js → chunk-CWE2N3JI.js} +1 -1
- package/dist/chunks/{chunk-ZYLLPRPU.js → chunk-CX4T7I47.js} +1 -1
- package/dist/chunks/{chunk-AQUZCWM3.js → chunk-D2V2Y3FB.js} +1 -1
- package/dist/chunks/{chunk-2PXKSAG6.js → chunk-DLOJG7LP.js} +1 -1
- package/dist/chunks/{chunk-5G7BQAUA.js → chunk-DNNWMOMG.js} +1 -1
- package/dist/chunks/{chunk-BGMAWETL.js → chunk-DNRC6TPJ.js} +1 -1
- package/dist/chunks/{chunk-5FSPDSAO.js → chunk-DUR32LJG.js} +1 -1
- package/dist/chunks/{chunk-JZKTBYNB.js → chunk-E57PUTV2.js} +1 -1
- package/dist/chunks/{chunk-OUJ63LMU.js → chunk-ER2VONWQ.js} +1 -1
- package/dist/chunks/{chunk-TAXCMCYZ.js → chunk-ESOIZG2G.js} +4 -4
- package/dist/chunks/{chunk-CCZ276IA.js → chunk-F2EUZG2W.js} +1 -1
- package/dist/chunks/{chunk-VJR2GNRY.js → chunk-FVMTQSVW.js} +1 -1
- package/dist/chunks/{chunk-YI6ME6PU.js → chunk-GG6PM7TB.js} +1 -1
- package/dist/chunks/{chunk-DDOIPTOM.js → chunk-GMA365GI.js} +1 -1
- package/dist/chunks/{chunk-JVMSN7LH.js → chunk-GR4MJJCE.js} +1 -1
- package/dist/chunks/{chunk-FHDH4OUA.js → chunk-GUWNSMGH.js} +1 -1
- package/dist/chunks/{chunk-AFH462DO.js → chunk-HT6ILPD6.js} +1 -1
- package/dist/chunks/{chunk-3Z4VM2LF.js → chunk-HUMNLSCV.js} +1 -1
- package/dist/chunks/{chunk-XYZV3FKD.js → chunk-I6KTJ3GH.js} +1 -1
- package/dist/chunks/{chunk-WZ35ICTE.js → chunk-IFMWAOBR.js} +1 -1
- package/dist/chunks/{chunk-R2FYCJL6.js → chunk-IJJ7FYZE.js} +1 -1
- package/dist/chunks/{chunk-XHACK2KR.js → chunk-IUYGQO2K.js} +1 -1
- package/dist/chunks/{chunk-55YD4UTW.js → chunk-IV2HEX3I.js} +1 -1
- package/dist/chunks/{chunk-U7X5ZLAL.js → chunk-JCHLDNCX.js} +1 -1
- package/dist/chunks/{chunk-7PKDJHT6.js → chunk-JH4RACOB.js} +1 -1
- package/dist/chunks/{chunk-65WRWLUD.js → chunk-JVEIK4RH.js} +1 -1
- package/dist/chunks/{chunk-PPF6EBTQ.js → chunk-K3WM4NEC.js} +1 -1
- package/dist/chunks/{chunk-EGP6DF34.js → chunk-KASHK2U5.js} +2 -2
- package/dist/chunks/{chunk-7OFD6TFD.js → chunk-LMLGEOKV.js} +1 -1
- package/dist/chunks/{chunk-QUNQM2E3.js → chunk-MPEK4ZNY.js} +1 -1
- package/dist/chunks/{chunk-SDHG6CKU.js → chunk-NDNSLCPE.js} +1 -1
- package/dist/chunks/chunk-NK2L5HA2.js +2 -0
- package/dist/chunks/{chunk-WCNPGKST.js → chunk-O4YHISU2.js} +1 -1
- package/dist/chunks/{chunk-RCQYEHHD.js → chunk-O5ZOW474.js} +1 -1
- package/dist/chunks/{chunk-OXQ2WFIH.js → chunk-OEAKX5TS.js} +1 -1
- package/dist/chunks/{chunk-54755JYM.js → chunk-OFV26C2U.js} +2 -2
- package/dist/chunks/{chunk-IO5DZUKL.js → chunk-OI4DAZ4U.js} +1 -1
- package/dist/chunks/{chunk-Q73RKX7I.js → chunk-OIIE5GUK.js} +1 -1
- package/dist/chunks/{chunk-CUB6PWAJ.js → chunk-OKPV6MBX.js} +6 -6
- package/dist/chunks/{chunk-N5EAVX4G.js → chunk-OOKHHOIU.js} +1 -1
- package/dist/chunks/{chunk-MIFVX5PK.js → chunk-OQ4RWCYI.js} +1 -1
- package/dist/chunks/{chunk-EWH64WRR.js → chunk-OTG77H7U.js} +1 -1
- package/dist/chunks/{chunk-7OKZCJHS.js → chunk-OXRN2257.js} +1 -1
- package/dist/chunks/{chunk-JVNKSU27.js → chunk-PJJSQ4ZI.js} +1 -1
- package/dist/chunks/{chunk-7TM25J6S.js → chunk-PXQZOVSV.js} +2 -2
- package/dist/chunks/{chunk-YAA7F5LI.js → chunk-QKGNAYSC.js} +1 -1
- package/dist/chunks/{chunk-67U7PAMU.js → chunk-QN4CFJQC.js} +1 -1
- package/dist/chunks/{chunk-HES4VP3D.js → chunk-RJY4EI46.js} +1 -1
- package/dist/chunks/{chunk-E2JB5OCO.js → chunk-RP4DPUN2.js} +1 -1
- package/dist/chunks/{chunk-QLGP2OAQ.js → chunk-SNBFWBJI.js} +1 -1
- package/dist/chunks/{chunk-ZK3ET5EP.js → chunk-SRJTQS2D.js} +3 -3
- package/dist/chunks/{chunk-XY7HFXLH.js → chunk-SVLVIYH2.js} +1 -1
- package/dist/chunks/{chunk-7NCM6GBN.js → chunk-TOWY6Y23.js} +1 -1
- package/dist/chunks/{chunk-VWWKWYSQ.js → chunk-TWLPZHH7.js} +1 -1
- package/dist/chunks/{chunk-Y4I6CFZJ.js → chunk-UGDBMRCT.js} +1 -1
- package/dist/chunks/{chunk-JQOVC35K.js → chunk-UKTPX2EE.js} +1 -1
- package/dist/chunks/{chunk-CO23RRN7.js → chunk-UMRQKE3W.js} +1 -1
- package/dist/chunks/{chunk-B66QCXH2.js → chunk-USKCFST5.js} +1 -1
- package/dist/chunks/{chunk-3A2Y7UK3.js → chunk-USTDWGR4.js} +1 -1
- package/dist/chunks/{chunk-CIZI6Z7D.js → chunk-VMW23TIZ.js} +1 -1
- package/dist/chunks/{chunk-Y4E5AAI7.js → chunk-VND53FAU.js} +1 -1
- package/dist/chunks/{chunk-4G3GTEVS.js → chunk-VSQPWLAG.js} +1 -1
- package/dist/chunks/{chunk-KCLMA2IH.js → chunk-VV4K5YPD.js} +1 -1
- package/dist/chunks/{chunk-7RJOCGQ6.js → chunk-WAUFXZ5B.js} +1 -1
- package/dist/chunks/{chunk-HG2YFMVU.js → chunk-WXG3G2O6.js} +1 -1
- package/dist/chunks/{chunk-PACLKDTN.js → chunk-XBAB3HMA.js} +1 -1
- package/dist/chunks/chunk-XJU47QS2.js +2 -0
- package/dist/chunks/{chunk-WGQ3FMRF.js → chunk-XKDOPNQ5.js} +1 -1
- package/dist/chunks/{chunk-EYTTZ5H4.js → chunk-XLZMSD5K.js} +1 -1
- package/dist/chunks/{chunk-Q7FBVLLB.js → chunk-XNPTLJ5Z.js} +1 -1
- package/dist/chunks/{chunk-ZIQJDTQB.js → chunk-XTT3K3TR.js} +1 -1
- package/dist/chunks/{chunk-Q7P34B2O.js → chunk-YFHQRDNQ.js} +1 -1
- package/dist/chunks/{chunk-UGFSAG4U.js → chunk-YG3HITOU.js} +1 -1
- package/dist/chunks/{chunk-DWF3FCY4.js → chunk-Z5R4OSGC.js} +1 -1
- package/dist/chunks/{chunk-JT5YQ52I.js → chunk-Z6HWSTEP.js} +1 -1
- package/dist/chunks/{chunk-4PUOWSDE.js → chunk-ZEOYNUHL.js} +1 -1
- package/dist/chunks/{chunk-6C6ZCYTL.js → chunk-ZG3DBXQG.js} +1 -1
- package/dist/chunks/{chunk-4KTGYHCE.js → chunk-ZMRP2A7K.js} +1 -1
- package/dist/chunks/cli-5JARGJOD.js +2 -0
- package/dist/chunks/{command-5AXJMFYC.js → command-AI3SMEAH.js} +3 -3
- package/dist/chunks/{configuration-command-5LUNWPOL.js → configuration-command-NPA46ZOT.js} +1 -1
- package/dist/chunks/{connected-app-executor-DHXZE4X3.js → connected-app-executor-DLC23O43.js} +1 -1
- package/dist/chunks/{connected-evidence-NWMPICKJ.js → connected-evidence-TVORI55Q.js} +1 -1
- package/dist/chunks/{connected-starting-assets-NRVXIKQ2.js → connected-starting-assets-WGGBWH4K.js} +1 -1
- package/dist/chunks/{continual-UCKQ2QLH.js → continual-UHQI2EQD.js} +1 -1
- package/dist/chunks/{core-commands-ZPBX35M2.js → core-commands-QNZUBKOC.js} +1 -1
- package/dist/chunks/{dataset-preparation-authoring-UUYFWWCT.js → dataset-preparation-authoring-OBMJLGA4.js} +1 -1
- package/dist/chunks/{datasets-6K3ZANIV.js → datasets-USJLJOEQ.js} +1 -1
- package/dist/chunks/{desktop-test-57INNJ76.js → desktop-test-IYHAOR47.js} +1 -1
- package/dist/chunks/{dist-2MKJC6HN.js → dist-C5XFRP53.js} +1 -1
- package/dist/chunks/{evaluation-coordination-B7CN4R2D.js → evaluation-coordination-UJENK4WQ.js} +1 -1
- package/dist/chunks/{experiment-improvements-G357VLDB.js → experiment-improvements-6GJMKIER.js} +1 -1
- package/dist/chunks/{experiments-BHQO26LJ.js → experiments-FZHILSC6.js} +1 -1
- package/dist/chunks/{experiments-signal-BI6NKETB.js → experiments-signal-E32CWBS4.js} +1 -1
- package/dist/chunks/{help-UQN5RUPA.js → help-32DLAPJR.js} +1 -1
- package/dist/chunks/host-profile-evaluation-tools-QAV2UGSB.js +2 -0
- package/dist/chunks/{host-profile-external-dataset-KSEPXY2S.js → host-profile-external-dataset-C6ZPMTX6.js} +1 -1
- package/dist/chunks/{hosted-app-server-composition-WDDO6F23.js → hosted-app-server-composition-5DVBKNV3.js} +1 -1
- package/dist/chunks/{hosted-experiment-improvement-VVYXQ65K.js → hosted-experiment-improvement-YQ24C54D.js} +1 -1
- package/dist/chunks/hosted-harness-runtime-KLIORGWV.js +2 -0
- package/dist/chunks/{hosted-profile-candidate-PTGQLPZO.js → hosted-profile-candidate-RCWFLOVJ.js} +1 -1
- package/dist/chunks/{hosted-profile-compiler-FS5R6CHJ.js → hosted-profile-compiler-UDG4BCEW.js} +1 -1
- package/dist/chunks/{hosted-profile-evaluation-control-UUEZEMXU.js → hosted-profile-evaluation-control-4R3L4FTK.js} +1 -1
- package/dist/chunks/{hosted-profile-evaluation-inspection-4F7OEF4T.js → hosted-profile-evaluation-inspection-NA4SSY7N.js} +1 -1
- package/dist/chunks/{hosted-profile-evaluation-preparation-LIJJZDHQ.js → hosted-profile-evaluation-preparation-B4BW6JTB.js} +1 -1
- package/dist/chunks/{hosted-tasksets-KCLNMPG5.js → hosted-tasksets-IUK3VWSL.js} +1 -1
- package/dist/chunks/{human-review-PX6DBIFT.js → human-review-D6QCZLYN.js} +1 -1
- package/dist/chunks/{import-2HEYPHPW.js → import-UCG75PN5.js} +1 -1
- package/dist/chunks/{learning-Y3UKNUGE.js → learning-3XDYMYBE.js} +1 -1
- package/dist/chunks/{learning-LSXBL5DB.js → learning-OR4CYV4B.js} +1 -1
- package/dist/chunks/local-harness-improvement-runtime-GZBMBZB2.js +2 -0
- package/dist/chunks/local-harness-taskset-review-YVP2ZQJG.js +2 -0
- package/dist/chunks/{model-projects-6YWVD2TS.js → model-projects-POZRHXTF.js} +1 -1
- package/dist/chunks/{opchat-66BCRKEZ.js → opchat-APJUUTT7.js} +1 -1
- package/dist/chunks/{opchat-bounded-chat-KQWXZVFN.js → opchat-bounded-chat-PBUSUAY2.js} +1 -1
- package/dist/chunks/{organizations-IOYWDOCC.js → organizations-WK6EZ6L3.js} +1 -1
- package/dist/chunks/{profile-YH6G3ZTD.js → profile-BQMS7ALQ.js} +1 -1
- package/dist/chunks/{project-action-payload-53OH6WDH.js → project-action-payload-CGV77JSA.js} +1 -1
- package/dist/chunks/{project-agent-RYVMKW2F.js → project-agent-XVFYTEUQ.js} +1 -1
- package/dist/chunks/{published-experiment-source-SDXUVPE7.js → published-experiment-source-2CYFIRBL.js} +1 -1
- package/dist/chunks/{refiner-profile-service-56VYLZQJ.js → refiner-profile-service-OLJHA4DI.js} +1 -1
- package/dist/chunks/{runtime-ISLJIGWC.js → runtime-32KYSVZR.js} +1 -1
- package/dist/chunks/{sandbox-command-DI45NRTV.js → sandbox-command-OY3VZXGG.js} +1 -1
- package/dist/chunks/{sandbox-template-T42MDUSR.js → sandbox-template-YOOSJ4FK.js} +1 -1
- package/dist/chunks/saved-work-L4KNWLZB.js +2 -0
- package/dist/chunks/{setup-D6TY2GWV.js → setup-EU6CMRXQ.js} +1 -1
- package/dist/chunks/{src-LF5X4RNQ.js → src-3DJR7OAH.js} +1 -1
- package/dist/chunks/{src-7RN7BF4W.js → src-HYOTHMRX.js} +111 -113
- package/dist/chunks/{standalone-experiment-turn-owner-TW5MTWIO.js → standalone-experiment-turn-owner-UYPA6XHW.js} +1 -1
- package/dist/chunks/{store-chat-resources-IRHBW2EC.js → store-chat-resources-HISLEZZM.js} +1 -1
- package/dist/chunks/{store-continual-support-reviews-3KK42L4I.js → store-continual-support-reviews-ORWHS57V.js} +1 -1
- package/dist/chunks/{store-conversation-serving-IVURK52V.js → store-conversation-serving-5UGYKEGJ.js} +1 -1
- package/dist/chunks/{store-create-improve-UTCLBXF2.js → store-create-improve-APLPTVYQ.js} +1 -1
- package/dist/chunks/{store-datasets-4AQOVAQY.js → store-datasets-HDW6IYBL.js} +1 -1
- package/dist/chunks/{store-evaluation-results-PK2P3IMH.js → store-evaluation-results-KB2UDCF3.js} +1 -1
- package/dist/chunks/{store-harness-workspaces-YEXB4IRV.js → store-harness-workspaces-TKX5PZWP.js} +1 -1
- package/dist/chunks/{store-human-review-O4BVHP25.js → store-human-review-IURNTX3C.js} +1 -1
- package/dist/chunks/{store-learned-preference-migration-validation-44SVX6YB.js → store-learned-preference-migration-validation-TH2LKQWV.js} +1 -1
- package/dist/chunks/{store-learning-SIUQIY5C.js → store-learning-WLUW2PWE.js} +1 -1
- package/dist/chunks/{store-learning-credentials-BUHR7SN6.js → store-learning-credentials-FDKCEDHK.js} +1 -1
- package/dist/chunks/{store-local-experiments-BHVTKPPE.js → store-local-experiments-M4V5RLHJ.js} +1 -1
- package/dist/chunks/{store-model-batch-review-RVAYUVK2.js → store-model-batch-review-DDZLWVTG.js} +1 -1
- package/dist/chunks/{store-model-configuration-AYFGMC5D.js → store-model-configuration-ATOFA5OH.js} +1 -1
- package/dist/chunks/{store-model-project-preparation-5DEIS7TB.js → store-model-project-preparation-ZRSCQEQR.js} +1 -1
- package/dist/chunks/{store-modification-recordings-LCPK6K2T.js → store-modification-recordings-YJIDUPVJ.js} +1 -1
- package/dist/chunks/{store-preference-comparison-5YVIQNVB.js → store-preference-comparison-JKURBESE.js} +1 -1
- package/dist/chunks/{store-task-inbox-L6IQTY26.js → store-task-inbox-L53OT6ZC.js} +1 -1
- package/dist/chunks/{store-task-inventory-QWS2C656.js → store-task-inventory-R2JJGAHW.js} +1 -1
- package/dist/chunks/{store-taskset-drafts-EAOOY6CR.js → store-taskset-drafts-FPNJPFPO.js} +1 -1
- package/dist/chunks/{store-training-FYXZU2FE.js → store-training-DIBW7OMP.js} +1 -1
- package/dist/chunks/{store-training-jobs-3N3VKPIY.js → store-training-jobs-K7I4SXWW.js} +1 -1
- package/dist/chunks/{store-training-models-VOFVGPZR.js → store-training-models-LCSB37YY.js} +1 -1
- package/dist/chunks/{taskset-HNDIGYQG.js → taskset-XI5SJBJL.js} +1 -1
- package/dist/chunks/{taskset-packages-WMG5DUBN.js → taskset-packages-FUQWNTSB.js} +1 -1
- package/dist/chunks/{taskset-packages-T6B6HYKZ.js → taskset-packages-GM6IUOTY.js} +1 -1
- package/dist/chunks/{teams-bot-Z5CZLWE4.js → teams-bot-CYC5TR64.js} +1 -1
- package/dist/chunks/{tool-learning-ZQ6NSJ5K.js → tool-learning-52QZIJIR.js} +1 -1
- package/dist/chunks/{training-JTYQA7GA.js → training-GDLLLXSV.js} +1 -1
- package/dist/chunks/training-RL7UUBER.js +2 -0
- package/dist/chunks/training-UJ62NOJJ.js +2 -0
- package/dist/chunks/{training-hosted-36SZFS4U.js → training-hosted-V5CHG3M3.js} +1 -1
- package/dist/chunks/{training-hosted-alphaedit-HSMRDJTD.js → training-hosted-alphaedit-R5PVATV4.js} +1 -1
- package/dist/chunks/{training-hosted-decision-7JALOU6O.js → training-hosted-decision-WNK5DE3M.js} +1 -1
- package/dist/chunks/{training-hosted-engram-SXO75MFG.js → training-hosted-engram-ZQDOKXAV.js} +1 -1
- package/dist/chunks/{training-hosted-learning-E2N32YU5.js → training-hosted-learning-UEBGSSNC.js} +1 -1
- package/dist/chunks/{training-hosted-modification-comparison-TXFDJFTG.js → training-hosted-modification-comparison-KKI5CKOH.js} +1 -1
- package/dist/chunks/{training-hosted-neuron-training-J42WK4EH.js → training-hosted-neuron-training-CFWEDRSR.js} +1 -1
- package/dist/chunks/{training-hosted-serving-report-BAEABGJH.js → training-hosted-serving-report-N4NF5AVW.js} +1 -1
- package/dist/chunks/{training-hosted-steering-T556BUBG.js → training-hosted-steering-4MDUQ2YV.js} +1 -1
- package/dist/chunks/{training-model-start-P3PXDWNT.js → training-model-start-NOA6TYQK.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/skills/manifest.json +3 -3
- package/dist/skills/openpond-cli/references/experiments-and-training.md +19 -0
- package/dist/web/assets/App-L7RV4D0A.js +54 -0
- package/dist/web/assets/{AppDialog-x1HU1uLv.js → AppDialog-B2V84J7f.js} +1 -1
- package/dist/web/assets/{AppTerminalPanel-CNIKmqKc.js → AppTerminalPanel-DfYpUDKT.js} +2 -2
- package/dist/web/assets/{AppToastContext-DNWd43HS.js → AppToastContext-DuiPouLz.js} +1 -1
- package/dist/web/assets/{AppsView-BvOD83Z1.js → AppsView-B20RHDCy.js} +1 -1
- package/dist/web/assets/{AttachmentTypeIcon-BLdDr3JZ.js → AttachmentTypeIcon-l-GRNxaz.js} +1 -1
- package/dist/web/assets/{BrowserSidebar-Ar0FlFKg.js → BrowserSidebar-Ce0ToS2O.js} +1 -1
- package/dist/web/assets/{CartesianChart-tS7f1HZv.js → CartesianChart-CtfMRAfp.js} +1 -1
- package/dist/web/assets/{ChatTimelineEntry-z7_kur3h.js → ChatTimelineEntry-DzcucW20.js} +1 -1
- package/dist/web/assets/{CollaborationTabs-CaiFEKrv.js → CollaborationTabs-BpmKjNAC.js} +1 -1
- package/dist/web/assets/{CommandMenu-BpubEqaA.js → CommandMenu-JXsoxijv.js} +1 -1
- package/dist/web/assets/{CommunityView-TGR4s99l.js → CommunityView-ggdn8pcH.js} +1 -1
- package/dist/web/assets/{ComposerAttachments-DPWCjKXz.js → ComposerAttachments-BMmALUs_.js} +1 -1
- package/dist/web/assets/{ComposerCreateImproveStrip-Drji01_6.js → ComposerCreateImproveStrip-DcM1bkfu.js} +1 -1
- package/dist/web/assets/{ConversationImportsSettings-B_oW0cz7.js → ConversationImportsSettings-BKNeARHI.js} +1 -1
- package/dist/web/assets/{DatasetReviewImport-Dr3unJSY.js → DatasetReviewImport-DyFOE0Q0.js} +1 -1
- package/dist/web/assets/{ExperimentTrainingDataWorkspace-DObvpJAw.js → ExperimentTrainingDataWorkspace-CfOyoMrq.js} +2 -2
- package/dist/web/assets/{FilePagePreview-9kkXbARN.js → FilePagePreview-B7bWObJN.js} +2 -2
- package/dist/web/assets/{GetStartedView-Dv2b_SlH.js → GetStartedView-BYbFl93M.js} +1 -1
- package/dist/web/assets/{GettingStartedDialog-sPaPMc61.js → GettingStartedDialog-UgreDozV.js} +1 -1
- package/dist/web/assets/{HostedModelLearningReview-BlwhGxS6.js → HostedModelLearningReview-C_kng2U_.js} +1 -1
- package/dist/web/assets/{HostedModelLearningSettings-B5ahk3je.js → HostedModelLearningSettings-aesD_ifF.js} +1 -1
- package/dist/web/assets/{HtmlVisual-rGsClq0p.js → HtmlVisual-nvl1x-jh.js} +1 -1
- package/dist/web/assets/{LabModelVersionDetailPage-Da7AwZWV.js → LabModelVersionDetailPage-DrdoNvI-.js} +1 -1
- package/dist/web/assets/{LabModelWorkspace-DTeYViWH.js → LabModelWorkspace-CHlhzG3q.js} +1 -1
- package/dist/web/assets/{LabSkillSidebar-BieHbNl6.js → LabSkillSidebar-CqHeZzoj.js} +1 -1
- package/dist/web/assets/{LabsRoute-D3XqPB0-.js → LabsRoute-DzEbPpMK.js} +4 -4
- package/dist/web/assets/{LearningBatchesPage-CCBuf2u4.js → LearningBatchesPage-A2dFQW2j.js} +1 -1
- package/dist/web/assets/{MainChatThread-B6BQJfcq.js → MainChatThread-BSvKu4e5.js} +2 -2
- package/dist/web/assets/{MainPane-D3fQou29.js → MainPane-DiWIAxMj.js} +6 -6
- package/dist/web/assets/{ModelProjectPageHeader-BZn9Lu_J.js → ModelProjectPageHeader-lu6iRXHK.js} +1 -1
- package/dist/web/assets/{NativeSetupTerminal-Bglqab_g.js → NativeSetupTerminal-kZ-nFPE8.js} +2 -2
- package/dist/web/assets/{NativeSkillSidebar-pUGRdnV_.js → NativeSkillSidebar-DkkD1uH2.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-BpHN38MA.js → NewProjectDialog-Dg8dMEpc.js} +1 -1
- package/dist/web/assets/{OutputsPage-LunDCQ6w.js → OutputsPage-Dz190U9t.js} +1 -1
- package/dist/web/assets/{PageChrome-DThEcWAx.js → PageChrome-Bncv-ps0.js} +1 -1
- package/dist/web/assets/{ProjectsPage-vct_TQgL.js → ProjectsPage-DVkYvLtd.js} +1 -1
- package/dist/web/assets/{RightChatPanelStack-CgFK7DY0.js → RightChatPanelStack-CP4leenI.js} +1 -1
- package/dist/web/assets/RightSidebarHomePanel-C0etQXpt.js +1 -0
- package/dist/web/assets/{ScheduledWorkPage-mmaZfybl.js → ScheduledWorkPage-DI0mgt82.js} +1 -1
- package/dist/web/assets/{SettingsView-CJfeRsWR.js → SettingsView-cCtkr089.js} +3 -3
- package/dist/web/assets/{TasksetDraftEditorPrimitives-CuimAfkv.js → TasksetDraftEditorPrimitives-DCQTuswJ.js} +1 -1
- package/dist/web/assets/{TeamChatView-BcK0lF1b.js → TeamChatView-BBEomfQ7.js} +1 -1
- package/dist/web/assets/{TerminalOverlay-0pzEvy-C.js → TerminalOverlay-Dj5NUDMp.js} +1 -1
- package/dist/web/assets/{TrainingCreationPanel-CcyzFz7l.js → TrainingCreationPanel-Ds4PLfsd.js} +1 -1
- package/dist/web/assets/{TrainingDraftPanel-DSLZXdLz.js → TrainingDraftPanel-BAuh_BF3.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-BT9pcnCn.js → UsageSettingsSection-DbzeatcW.js} +1 -1
- package/dist/web/assets/WorkSidebarPanel-BaNuXoZc.js +1 -0
- package/dist/web/assets/{WorkspaceDiffPanel-Bbz5qrVA.js → WorkspaceDiffPanel-xk-ve1MO.js} +3 -3
- package/dist/web/assets/{WorkspaceEnvironmentMenu-6hXpvMTl.js → WorkspaceEnvironmentMenu-D8GSuoYz.js} +1 -1
- package/dist/web/assets/{WorkspaceFileLocation-BijVemBl.js → WorkspaceFileLocation-Dl8M2ZKN.js} +1 -1
- package/dist/web/assets/{WorkspaceGitDialogs-BOO0E5i9.js → WorkspaceGitDialogs-9BhLjYx4.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-B_YzK7Do.js → WorkspaceMonacoEditor-DYPuC7pj.js} +3 -3
- package/dist/web/assets/{WorkspacePdfPreview-CFti1fvu.js → WorkspacePdfPreview-B7BI9tLR.js} +2 -2
- package/dist/web/assets/{WorkspacePresentationPreview-DPAhNaV6.js → WorkspacePresentationPreview-sP7JUT7m.js} +1 -1
- package/dist/web/assets/{bot-BE2rL_qv.js → bot-D7M8ZtE6.js} +1 -1
- package/dist/web/assets/{chat-resources-Beh5lB36.js → chat-resources-DhKAnljP.js} +1 -1
- package/dist/web/assets/chevron-down-BAEcJitl.js +1 -0
- package/dist/web/assets/chevron-right-3G9s2cQ9.js +1 -0
- package/dist/web/assets/chevron-up-DTYF52H1.js +1 -0
- package/dist/web/assets/{chunk-C3TS766N-j1MK0e3c.js → chunk-C3TS766N-DENE60SE.js} +1 -1
- package/dist/web/assets/{client-choice-storage-CQ0CNkzG.js → client-choice-storage-DYZsrVr9.js} +1 -1
- package/dist/web/assets/{client-BnJhN-14.js → client-gy7zrd7a.js} +1 -1
- package/dist/web/assets/{cloud-upload-DFjZE4O4.js → cloud-upload-De-XSMUr.js} +1 -1
- package/dist/web/assets/{copy-CGrLUtw5.js → copy-DEK20zbZ.js} +1 -1
- package/dist/web/assets/{cssMode-DvRw2fUx.js → cssMode-Dau-Fhqf.js} +1 -1
- package/dist/web/assets/{external-link-3ZnEFUXd.js → external-link-DwDry0Fb.js} +1 -1
- package/dist/web/assets/{folder-open-i9n8450i.js → folder-open-DOb4AjV6.js} +1 -1
- package/dist/web/assets/{folder-plus-cu8Md_ej.js → folder-plus-BAouDaXv.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-CwckmC09.js → git-commit-horizontal-DZbHXcai.js} +1 -1
- package/dist/web/assets/{htmlMode-8VF4Ovtw.js → htmlMode-DlNEe6hu.js} +1 -1
- package/dist/web/assets/{icons-4yRSxBZj.js → icons-OQhKVrDc.js} +1 -1
- package/dist/web/assets/{image-D-umhyyK.js → image-BkYJDChH.js} +1 -1
- package/dist/web/assets/{index-DiVhx1GM.js → index-M_h2Ok4V.js} +2 -2
- package/dist/web/assets/{info-Dq2RsPDJ.js → info-Mj5lp4Ic.js} +1 -1
- package/dist/web/assets/{jsonMode-CvCYQHkB.js → jsonMode-CyOEyonV.js} +1 -1
- package/dist/web/assets/loader-circle-DXVtGvuV.js +1 -0
- package/dist/web/assets/{lspLanguageFeatures-CjufNNFF.js → lspLanguageFeatures-DAYPzatg.js} +1 -1
- package/dist/web/assets/{maximize-2-CKY8dua6.js → maximize-2-BwFXSX6b.js} +1 -1
- package/dist/web/assets/{message-square-CVDgKlKX.js → message-square-C2nqfNLn.js} +1 -1
- package/dist/web/assets/{monaco.contribution-BYAgjZbj.js → monaco.contribution-BZcNCJER.js} +2 -2
- package/dist/web/assets/{monaco.contribution-BYY3-y9l.js → monaco.contribution-BZkfRhss.js} +2 -2
- package/dist/web/assets/{monaco.contribution-Bh0CKj9i.js → monaco.contribution-D7_X8TXe.js} +2 -2
- package/dist/web/assets/{monaco.contribution-PjJ1258q.js → monaco.contribution-KyLdVay7.js} +2 -2
- package/dist/web/assets/{monitor-UYe42gew.js → monitor-B0Qj5Wea.js} +1 -1
- package/dist/web/assets/{paperclip-DrlSVUoz.js → paperclip-CmrRruxi.js} +1 -1
- package/dist/web/assets/{pdf-BMhday2W.js → pdf-BM-9_48p.js} +1 -1
- package/dist/web/assets/play-CkACZ6Zo.js +1 -0
- package/dist/web/assets/plus-CB258e62.js +1 -0
- package/dist/web/assets/{presentation-DcZKqH7w.js → presentation-BYxhoSIo.js} +1 -1
- package/dist/web/assets/{python-CiA01i07.js → python-B3Mj03I5.js} +1 -1
- package/dist/web/assets/{refresh-cw-00D-GDnF.js → refresh-cw-CwEmO71D.js} +1 -1
- package/dist/web/assets/{save-CXe7bqR7.js → save-S--FOuce.js} +1 -1
- package/dist/web/assets/{settings-lists-B5J40WM6.js → settings-lists-ChqDppMP.js} +1 -1
- package/dist/web/assets/square-BmPfHjGU.js +1 -0
- package/dist/web/assets/{square-terminal-DxC7TTds.js → square-terminal-CawpQtCi.js} +1 -1
- package/dist/web/assets/{submit-issue-command-Dq3TqJLV.js → submit-issue-command-CFitxxmO.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-BH3Jckfo.js → toggleHighContrast-D-cMCvXx.js} +1 -1
- package/dist/web/assets/training-CzbWtx75.js +1 -0
- package/dist/web/assets/{training-model-data-B6IZ3x-t.js → training-model-data-G-D64935.js} +1 -1
- package/dist/web/assets/{tsMode-DXkj4bqC.js → tsMode-9kzS1ijG.js} +1 -1
- package/dist/web/assets/{upload-B3KRHVHl.js → upload-CtYsSYrM.js} +1 -1
- package/dist/web/assets/{useAccountSettings-BGRkTRrp.js → useAccountSettings-DYYa6puz.js} +1 -1
- package/dist/web/assets/{useAgentInventory-D_1AlAZJ.js → useAgentInventory-c5B_Tszj.js} +1 -1
- package/dist/web/assets/{useChatContextSelection-hoMSuUSE.js → useChatContextSelection-DOISZpTz.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules-DxTER7Ow.js → useLocalAgentSchedules-QJ8RsMKm.js} +1 -1
- package/dist/web/assets/{useQuery-DkPec_9x.js → useQuery-DuTGOe2b.js} +1 -1
- package/dist/web/assets/{wifi-off-CMzpvbWl.js → wifi-off-BOfP4Vmg.js} +1 -1
- package/dist/web/assets/{workers-ziY_bTv2.js → workers-BwGpyrdj.js} +1 -1
- package/dist/web/assets/x-5_iy6IDd.js +1 -0
- package/dist/web/assets/{yaml-mSvqVSko.js → yaml-BU4IWV_7.js} +1 -1
- package/dist/web/index.html +1 -1
- package/docs/command-reference.md +1 -0
- package/package.json +1 -1
- package/dist/chunks/chunk-6D3FI2XT.js +0 -2
- package/dist/chunks/chunk-VEBW7NKD.js +0 -2
- package/dist/chunks/cli-ALEEFAJ7.js +0 -2
- package/dist/chunks/host-profile-evaluation-tools-UF4ATIUF.js +0 -2
- package/dist/chunks/hosted-harness-runtime-MMTLCL23.js +0 -2
- package/dist/chunks/local-harness-improvement-runtime-3YJQRYXC.js +0 -2
- package/dist/chunks/local-harness-taskset-review-E5GN5LTR.js +0 -2
- package/dist/chunks/saved-work-54I5ZJTC.js +0 -2
- package/dist/chunks/training-5NT2YB2L.js +0 -2
- package/dist/chunks/training-UY6KRG4M.js +0 -2
- package/dist/web/assets/App-CXhxya9x.js +0 -54
- package/dist/web/assets/RightSidebarHomePanel-BJmzUcmy.js +0 -1
- package/dist/web/assets/WorkSidebarPanel-CP-nHAsJ.js +0 -1
- package/dist/web/assets/chevron-down-Bn8yph2O.js +0 -1
- package/dist/web/assets/chevron-right-BU-jUmb2.js +0 -1
- package/dist/web/assets/chevron-up-DacwuDJZ.js +0 -1
- package/dist/web/assets/loader-circle-DBl6qqtR.js +0 -1
- package/dist/web/assets/play-DIqZnaNf.js +0 -1
- package/dist/web/assets/plus-CFNxAPMK.js +0 -1
- package/dist/web/assets/square-DJEaBefe.js +0 -1
- package/dist/web/assets/training-DWfghwfZ.js +0 -1
- package/dist/web/assets/x-omjwMPbJ.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{b as h,g as T}from"./chunk-
|
|
2
|
+
import{b as h,g as T}from"./chunk-VMW23TIZ.js";import{c as u}from"./chunk-GR4MJJCE.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};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{e as S}from"./chunk-
|
|
2
|
+
import{e as S}from"./chunk-XLZMSD5K.js";import{Z as h}from"./chunk-6I5AUTVO.js";import{a as A}from"./chunk-G4747MOW.js";import{a as b,e as H,f as w,j as f}from"./chunk-LE75SVEL.js";import{f as O,g as k}from"./chunk-ZY32SZ2P.js";import{e as I,i as P}from"./chunk-OTDDXEQ6.js";import{n as g}from"./chunk-RCT3O3HQ.js";import{A as c}from"./chunk-X2J2P5ZT.js";import{a as u}from"./chunk-FTQLQJQV.js";import{randomUUID as T}from"node:crypto";import{readFile as v}from"node:fs/promises";import p from"node:path";import{randomUUID as $}from"node:crypto";var y=c.object({revision:c.number().int().nonnegative(),overlay:H}).strict(),z=y.extend({proposal:w}).strict(),m=class{constructor(e){this.client=e}client;static{u(this,"HostedHarnessOverlayStorage")}async getHarnessRunOverlay(e){let s=await this.client.request({contractVersion:h,requestId:$(),operation:"harness/overlay/get",params:{runId:e}});return s===null?null:y.parse(s).overlay}async putHarnessRunOverlay(e){let s=H.parse(e.overlay);if(!e.requestId.trim()||s.revision!==(e.expectedRevision===null?0:e.expectedRevision+1))throw new Error("Hosted Harness overlay mutation requires a stable request and next revision.");let r=y.parse(await this.client.request({contractVersion:h,requestId:e.requestId,operation:"harness/overlay/put",params:{runId:s.runId,expectedRevision:e.expectedRevision,overlay:s}}));if(r.revision!==s.revision||r.overlay.contentHash!==s.contentHash)throw new Error("Host Harness overlay response changed committed identity.");return r.overlay}async createHarnessRunOverlay(e){if(e.revision!==0||e.status!=="active")throw new Error("A new Harness run overlay must be active at revision 0.");return this.putHarnessRunOverlay({overlay:e,expectedRevision:null,requestId:`harness-overlay:${e.runId}:${e.contentHash}`})}async ensureHarnessRunOverlay(e){let s=await this.getHarnessRunOverlay(e.runId);if(s){if(s.workspace.workspaceId!==e.workspace.id||s.baseHarnessRelease.id!==e.harnessRelease.id||s.baseHarnessRelease.contentHash!==e.harnessRelease.contentHash)throw new Error("The durable Agent run is already bound to another Harness release.");return s}let r=f({schemaVersion:"openpond.harnessRunOverlay.v1",id:`overlay-${g({runId:e.runId,harnessRelease:e.harnessRelease}).slice(0,24)}`,runId:e.runId,baseHarnessRelease:e.harnessRelease,workspace:{workspaceId:e.workspace.id,revision:e.workspace.revision,sourceRevision:e.workspace.sourceRevision,channelRevision:e.workspace.currentChannel.revision},revision:0,status:"active",edits:[],createdAt:e.admittedAt,updatedAt:e.admittedAt,metadata:{}});return this.createHarnessRunOverlay(r)}async appendHarnessRunOverlayEditsAtomically(e){return this.transition(e,"append")}async freezeHarnessRunOverlayAtomically(e){return this.transition({...e,edits:[]},"freeze")}async abandonHarnessRunOverlayAtomically(e){return this.transition({...e,edits:[]},"abandon")}async freezeHarnessRunOverlayWithProposalAtomically(e){let s=await this.getHarnessRunOverlay(e.runId);if(!s||s.revision!==e.expectedRevision||s.status!=="active")throw new Error("Hosted Harness overlay revision or status changed.");let r=new Set(s.edits.map(i=>i.id));for(let i of e.edits){if(r.has(i.id))throw new Error(`Harness overlay edit id already exists: ${i.id}.`);r.add(i.id)}let{contentHash:l,...n}=s,t=f({...n,revision:s.revision+1,status:"frozen",edits:[...s.edits,...e.edits],updatedAt:e.updatedAt}),d=w.parse(e.buildProposal(t)),a=z.parse(await this.client.request({contractVersion:h,requestId:`harness-proposal:${t.runId}:${d.contentHash}`,operation:"harness/overlay/freezeProposal",params:{runId:t.runId,expectedRevision:s.revision,overlay:t,proposal:d}}));if(a.overlay.contentHash!==t.contentHash||a.proposal.contentHash!==d.contentHash)throw new Error("Host Harness proposal response changed committed identity.");return{overlay:a.overlay,proposal:a.proposal}}async transition(e,s){let r=await this.getHarnessRunOverlay(e.runId);if(!r||r.revision!==e.expectedRevision||r.status==="abandoned"||s!=="abandon"&&r.status!=="active")throw new Error("Hosted Harness overlay revision or status changed.");if(s==="append"&&e.edits.length===0)throw new Error("Harness overlay append requires edits.");let l=new Set(r.edits.map(a=>a.id));for(let a of e.edits){if(l.has(a.id))throw new Error(`Harness overlay edit id already exists: ${a.id}.`);l.add(a.id)}let{contentHash:n,...t}=r,d=f({...t,revision:r.revision+1,status:s==="append"?"active":s==="freeze"?"frozen":"abandoned",edits:[...r.edits,...e.edits],updatedAt:e.updatedAt});return this.putHarnessRunOverlay({overlay:d,expectedRevision:r.revision,requestId:`harness-overlay:${d.runId}:${d.contentHash}`})}};var N=c.object({workspace:b,release:c.object({id:c.string().min(1),contentHash:c.string().regex(/^[a-f0-9]{64}$/),sourceRevision:c.string().min(1),assetsPath:c.string().min(1)}).strict()}).strict();async function C(o,e=null){let s=await o.request({contractVersion:h,requestId:T(),operation:"harness/get",params:{reference:e}});if(s===null)return null;let r=N.parse(s);if(!p.isAbsolute(r.release.assetsPath))throw new Error("Hosted Harness assets path must be absolute.");let[l,n]=await Promise.all([v(p.join(r.release.assetsPath,"agent-snapshot.json"),"utf8"),v(p.join(r.release.assetsPath,"harness-release.json"),"utf8")]),t=A.parse({schemaVersion:"openpond.localHarnessReleaseRecord.v1",workspaceId:r.workspace.id,sourceRevision:r.release.sourceRevision,agentSnapshot:I.parse(JSON.parse(l)),harnessRelease:P.parse(JSON.parse(n)),bundlePath:r.release.assetsPath,createdAt:new Date().toISOString()});if(t.harnessRelease.id!==r.release.id||t.harnessRelease.contentHash!==r.release.contentHash||(e!==null?e.id!==r.release.id||e.contentHash!==r.release.contentHash:r.workspace.currentChannel.release?.contentHash!==r.release.contentHash))throw new Error("Hosted Harness release differs from its bound workspace.");return S({workspace:r.workspace,release:t})}u(C,"loadHostedHarnessRuntime");async function se(o,e){let s=e.profileComponentBinding,r=e.profileWorkflowBinding;if(s){if(r||e.currentProfile?.profileId!==s.profileId)throw new Error("Profile component binding differs from the session Profile reference.");let n=await x(o,s.harnessRelease);if(E(n,s.profileId,s.sourceRevision,e.currentProfile?.repositoryId),s.target.kind==="profile")return n;if(s.target.kind==="skill"){let i=s.target.skillPath;if(!n.release.agentSnapshot.skills.some(j=>j.path===i))throw new Error("Bound Profile Skill is unavailable in its released source.");let R=await v(p.join(n.release.bundlePath,"source",i),"utf8");return{...n,instructionContext:[n.instructionContext,`Released Profile Skill (${i}):
|
|
3
3
|
${R}`].join(`
|
|
4
4
|
|
|
5
5
|
`)}}let t=await q(n),d=s.target.actionId,a=t.actions.find(i=>i.id===d);if(!a)throw new Error("Bound Profile Agent action is unavailable in its released source.");return{...n,workflowAction:a}}if(r){if(e.currentProfile?.profileId!==r.profileId)throw new Error("Profile workflow binding differs from the session Profile reference.");let n=await x(o,r.harnessRelease);E(n,r.profileId,r.sourceRevision,e.currentProfile?.repositoryId);let t=await q(n),d=k({binding:r,harnessRelease:n.release.harnessRelease,catalog:t.catalog,catalogHash:t.catalogHash}),a=d.invocation.kind==="agent_action"?d.invocation.actionId:null,i=a?t.actions.find(R=>R.id===a):void 0;if(a&&!i)throw new Error(`Bound Profile action ${a} is missing from its release.`);return{...n,workflow:d,...i?{workflowAction:i}:{}}}let l=await new m(o).getHarnessRunOverlay(e.id);return C(o,l?.baseHarnessRelease??null)}u(se,"loadHostedHarnessRuntimeForSession");async function x(o,e){let s=await C(o,e);if(!s)throw new Error("The bound Profile Harness release is unavailable.");return s}u(x,"requireRelease");function E(o,e,s,r){let l=o.release.harnessRelease.metadata.profile;if(!l||typeof l!="object"||l.id!==e||l.sourceRevision!==s||l.repositoryId!==void 0&&l.repositoryId!==r)throw new Error("Bound Profile source differs from its released Harness source.")}u(E,"assertProfileProvenance");async function q(o){let e=p.join(o.release.bundlePath,"source"),[s,r]=await Promise.all([v(p.join(e,"workflows","catalog.json")),v(p.join(e,"workflows","actions.json"))]);return O({agentSnapshot:o.release.agentSnapshot,harnessRelease:o.release.harnessRelease,catalogBytes:s,actionBytes:r})}u(q,"loadHostedProfileCatalog");export{m as a,C as b,se as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{Ab as _,Bb as E,zb as F}from"./chunk-
|
|
2
|
+
import{Ab as _,Bb as E,zb as F}from"./chunk-WXG3G2O6.js";import{a as L,b as j,c as H,d as w,e as b,f as S,g as y,l as k}from"./chunk-HVM2GUM3.js";import{e as x,f as R}from"./chunk-SV7ZBEK2.js";import{l as O,n as T}from"./chunk-RCT3O3HQ.js";import{h as g,p as A,r as C,s as N}from"./chunk-UGOK7VTC.js";import{a as r}from"./chunk-FTQLQJQV.js";import{promises as z}from"node:fs";import d from"node:path";import{randomUUID as J}from"node:crypto";import{promises as v}from"node:fs";import U from"node:path";function u(e){return{binding:r(()=>{let i=C(e.home,"refiner_bindings","active");return i?w.parse(i.value):null},"binding"),releases:r(async()=>{let i=(await v.readdir(e.releases)).filter(n=>n.endsWith(".json"));return Promise.all(i.map(async n=>H.parse(JSON.parse(await v.readFile(U.join(e.releases,n),"utf8")))))},"releases"),transitions:r(()=>Object.values(N(e.home,"refiner_transitions")).map(i=>b.parse(i.value)),"transitions"),release:r(async i=>{let n=H.parse(JSON.parse(await v.readFile(U.join(e.releases,`${i.contentHash}.json`),"utf8")));if(n.id!==i.id||n.contentHash!==i.contentHash)throw new Error("Refiner release reference does not match immutable release content.");return n},"release"),persistRelease:r(async i=>V(e.releases+`/${i.contentHash}.json`,O(i),!0),"persistRelease"),writeSource:r(async i=>V(e.source,i),"writeSource"),transition:r(async(i,n)=>{A(e.home,t=>{t.exec("BEGIN IMMEDIATE");try{let a=t.prepare("SELECT payload FROM refiner_bindings WHERE id = 'active'").get(),o=a?w.parse(JSON.parse(a.payload)):null,s=new Date().toISOString(),l={id:i.id,contentHash:i.contentHash},c={schemaVersion:"openpond.refinerTransitionReceipt.v1",id:`refiner-transition-${J()}`,operation:n.operation,bindingChanged:n.bindingChanged,previousRelease:o?.release??null,nextRelease:l,actor:n.actor,reason:n.reason,authoringSkillHash:n.authoringSkillHash,validation:{valid:!0,messages:[]},createdAt:s},p=b.parse({...c,contentHash:T(c)});if(t.prepare("INSERT INTO refiner_transitions VALUES (?, ?, 1)").run(p.contentHash,JSON.stringify(p)),n.bindingChanged){let m=w.parse({schemaVersion:"openpond.refinerBinding.v1",channel:"active",revision:(o?.revision??-1)+1,release:l,updatedAt:s});t.prepare("INSERT INTO refiner_bindings VALUES ('active', ?, 1) ON CONFLICT(id) DO UPDATE SET payload=excluded.payload, revision=revision+1").run(JSON.stringify(m))}t.exec("COMMIT")}catch(a){throw t.exec("ROLLBACK"),a}})},"transition")}}r(u,"createLocalRefinerProfileRepository");async function V(e,i,n=!1){await R(e,async()=>{if(n){let t=await v.readFile(e,"utf8").catch(()=>null);if(t!==null){if(t!==i)throw new Error("Immutable Refiner release bytes changed.");return}}await x(e,i)})}r(V,"atomicWrite");var B="OpenPond Refiner Core: evidence admission, privacy, ownership, validation, and immutable activation boundaries.";function P(e){let i=d.join(e,"library","refiners");return{home:e,root:i,source:d.join(i,"source","openpond.review.json"),releases:d.join(i,"releases")}}r(P,"refinerProfilePaths");function Re(e){let i=r(()=>f(e),"inspect"),n=r(o=>M(e,o),"update"),t=r(o=>q(e,o),"activate"),a=r(o=>G(e,o),"rollback");return{refinerHistoryPayload:i,updateRefinerProfilePayload:n,activateRefinerReleasePayload:t,rollbackRefinerReleasePayload:a,inspectRefiner:i,updateRefiner:n,activateRefiner:t,rollbackRefiner:a}}r(Re,"createRefinerProfileRoutePayloads");async function f(e){let i=P(e),n=u(i),t=n.binding();if(!t)throw new Error("Active Refiner binding is unavailable.");let a=(await n.releases()).sort((l,c)=>c.createdAt.localeCompare(l.createdAt)),o=a.find(l=>l.id===t.release.id&&l.contentHash===t.release.contentHash);if(!o)throw new Error("Active Refiner release is unavailable.");let s=n.transitions().sort((l,c)=>c.createdAt.localeCompare(l.createdAt));return F.parse({rootPath:i.root,sourcePath:i.source,binding:t,currentRelease:o,releases:a,transitions:s})}r(f,"inspectRefinerProfile");async function ue(e){return(await f(e)).currentRelease}r(ue,"loadActiveRefinerRelease");async function M(e,i){return R(d.join(g(e).runtime,"refiner-edit"),()=>W(e,i))}r(M,"updateRefinerProfile");async function W(e,i){let n=_.parse(i),t=P(e),a=u(t);await I(t);let o=L.parse(n.profile),s=S({profile:o,coreVersion:k,corePrompt:B}),c=(await a.releases()).find(m=>m.composedPromptHash===s.composedPromptHash&&m.profileHash===s.profileHash)??s;await a.persistRelease(c),await a.writeSource(y(o));let p=a.binding();if(!p)throw new Error("Active Refiner binding is unavailable.");return n.activate&&p.release.contentHash===c.contentHash||!n.activate&&a.transitions().some(h=>!h.bindingChanged&&h.nextRelease.contentHash===c.contentHash&&h.actor===n.actor&&h.reason===n.reason&&h.authoringSkillHash===n.authoringSkillHash)||await a.transition(c,{operation:"update",bindingChanged:n.activate,actor:n.actor,reason:n.reason,authoringSkillHash:n.authoringSkillHash}),f(e)}r(W,"updateRefinerProfileUnlocked");async function q(e,i){return R(d.join(g(e).runtime,"refiner-edit"),()=>$(e,i))}r(q,"activateRefinerRelease");async function $(e,i){let n=E.parse(i),t=P(e),a=u(t);await I(t);let o=await a.release(n.release),s=a.binding();if(!s)throw new Error("Active Refiner binding is unavailable.");return s.release.contentHash===o.contentHash||(await a.transition(o,{operation:"activate",bindingChanged:!0,actor:n.actor,reason:n.reason,authoringSkillHash:null}),await a.writeSource(y(o.profile))),f(e)}r($,"activateRefinerReleaseUnlocked");async function G(e,i){return R(d.join(g(e).runtime,"refiner-edit"),()=>K(e,i))}r(G,"rollbackRefinerRelease");async function K(e,i){let n=E.parse(i),t=P(e),a=u(t);await I(t);let o=await a.release(n.release),s=a.binding();if(!s)throw new Error("Active Refiner binding is unavailable.");return s.release.contentHash===o.contentHash||(await a.transition(o,{operation:"rollback",bindingChanged:!0,actor:n.actor,reason:n.reason,authoringSkillHash:null}),await a.writeSource(y(o.profile))),f(e)}r(K,"rollbackRefinerReleaseUnlocked");async function Y(e){await R(d.join(g(e).runtime,"refiner-initialize"),()=>Q(P(e)))}r(Y,"initializeRefinerProfile");async function I(e){await Y(e.home)}r(I,"ensureInitialized");async function Q(e){let i=u(e);if(await Promise.all([z.mkdir(d.dirname(e.source),{recursive:!0,mode:448}),z.mkdir(e.releases,{recursive:!0,mode:448})]),i.binding())return;let n=S({profile:j,coreVersion:k,corePrompt:B});await i.persistRelease(n),await i.writeSource(y(n.profile)),await i.transition(n,{operation:"initialize",bindingChanged:!0,actor:"openpond",reason:"Initialize the default Refiner Review Profile.",authoringSkillHash:null})}r(Q,"initialize");export{u as a,P as b,Re as c,f as d,ue as e,M as f,q as g,G as h,Y as i};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{E as U}from"./chunk-WGQ3FMRF.js";import{m as X}from"./chunk-HIQPGYVH.js";import{A as te,Q as M,d as Y,e as Z,i as p,l as h,m as q,p as ee,w as c,x as T,y as R}from"./chunk-DXJC3QW7.js";import{D as F,F as Q,I as L,b as _,dc as K,o as N,t as D,wb as W}from"./chunk-4PUOWSDE.js";import{Ra as O,Wa as G,bb as $}from"./chunk-ZY32SZ2P.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as m}from"./chunk-FTQLQJQV.js";var ie=e.string().trim().min(1).max(240),ue=e.string().trim().min(8).max(256),y=e.object({schemaVersion:e.literal("openpond.sftRecipe.v1"),method:e.literal("sft"),parameterization:e.literal("lora"),baseModel:e.object({id:ie,revision:e.string().trim().min(1).max(256),tokenizerRevision:e.string().trim().min(1).max(256),chatTemplateHash:ue}),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(ie).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()})}),Ze=y.safeExtend({dataset:y.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:y.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:y.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:y.shape.resourceLimits.safeExtend({wallTimeMs:e.number().int().min(1e3).max(216e5)})}).superRefine((t,i)=>{t.optimizer.batchSize*t.optimizer.gradientAccumulationSteps>32&&i.addIssue({code:"custom",path:["optimizer"],message:"Managed SFT supports at most 32 accumulated examples."}),new Set(t.lora.targetModules).size!==t.lora.targetModules.length&&i.addIssue({code:"custom",path:["lora","targetModules"],message:"Adapter target modules must be unique."})});var pe=e.string().regex(/^[a-f0-9]{64}$/),z=e.string().regex(/^(0|[1-9]\d*)(\.\d{1,6})?$/).max(24),ae=m(t=>{let[i,a=""]=z.parse(t).split(".");return BigInt(i)*1000000n+BigInt(a.padEnd(6,"0"))},"micros"),ne=e.object({schemaVersion:e.literal("openpond.computeAppliedPrice.v1"),version:e.string().min(1).max(500),service:e.enum(["managed_rl","model_modification","model_serving","sandbox"]),profileHash:pe,currency:e.literal("USD"),unit:e.literal("resource_hour"),hourlyUsd:z.refine(t=>{if(!z.safeParse(t).success)return!1;let i=ae(t);return i>0n&&i<=BigInt(Number.MAX_SAFE_INTEGER)})}).strict(),rt=e.object({schemaVersion:e.literal("openpond.modificationPrice.v1"),appliedPrice:ne.extend({service:e.literal("model_modification")}),billingBoundary:e.literal("active_allocation_until_verified_cleanup"),startupBillable:e.literal(!0),postCompletionIdleBillable:e.literal(!1),minimumBillableSeconds:e.literal(0),warmReuseSeconds:e.literal(300)}).strict();function ge(t){if(t==null||t.trim()==="")return null;let i=ae(t);if(i<=0n||i>1000000000000n)throw new p("managed_modification_cap_invalid","Choose a positive spending limit of at most 1,000,000 USD, or use available credits.");return`${i/1000000n}.${(i%1000000n).toString().padStart(6,"0")}`}m(ge,"canonicalComputeSpendCap");function ot(t){if(t.maximumSpendUsd!==ge(t.maximumSpendUsd)||t.maximumSpendUsd===null&&!t.computePrice||t.computePrice&&t.computePrice.appliedPrice.profileHash!==t.runtimeHash)throw new p("managed_modification_price_mismatch","Retain the exact reviewed rate, runtime and optional spending limit.")}m(ot,"assertManagedModificationPricing");async function st(t,i){return t.computePrice?i.approvedPriceHash===await h(t.computePrice):i.approvedPriceHash===void 0}m(st,"managedModificationPriceApprovalMatches");var I=e.string().min(1).max(500),w=e.string().regex(/^[a-f0-9]{64}$/),E=ne.extend({service:e.literal("managed_rl")}),re=e.string().regex(/^(0|[1-9]\d*)\.\d{6}$/).max(24).refine(t=>{if(!/^(0|[1-9]\d*)\.\d{6}$/.test(t)||t.length>24)return!1;let i=BigInt(t.replace(".",""));return i>0n&&i<=BigInt(Number.MAX_SAFE_INTEGER)}).nullable(),he=e.array(e.object({profileHash:w,price:E,resources:e.object({cpu:e.number().positive(),memoryGb:e.number().positive(),diskGb:e.number().nonnegative()}).strict()}).strict()).max(32),S=e.string().regex(/^(0|[1-9]\d*)\.\d{6}$/).max(24).refine(t=>/^(0|[1-9]\d*)\.\d{6}$/.test(t)&&t.length<=24&&BigInt(t.replace(".",""))<=BigInt(Number.MAX_SAFE_INTEGER)),be=e.object({billing:e.literal("existing_retail_child_captures"),acceptedPricingHashes:e.array(w).max(64),prices:e.array(e.object({modelId:I,displayName:I,acceptedPricingHash:w,inputUsdPerMillionTokens:S,cachedInputUsdPerMillionTokens:S,outputUsdPerMillionTokens:S,cacheWriteUsdPerMillionTokens:S.nullable(),cacheWriteOneHourUsdPerMillionTokens:S.nullable(),longContextThresholdTokens:e.number().int().positive().nullable(),longContext:e.object({inputUsdPerMillionTokens:S,cachedInputUsdPerMillionTokens:S,outputUsdPerMillionTokens:S,cacheWriteUsdPerMillionTokens:S.nullable()}).strict().nullable()}).strict()).max(64)}).strict(),fe=e.tuple([e.object({mode:e.literal("prepaid_only"),availability:e.literal("available"),reason:e.null()}).strict(),e.object({mode:e.literal("actual_usage"),availability:e.enum(["unavailable","requires_preparation"]),reason:e.string().min(1).max(500).nullable()}).strict()]),mt=e.object({schemaVersion:e.literal("openpond.trainingUsageFundingRequest.v1"),billingMode:e.literal("actual_usage"),customerCapUsd:re}).strict(),ve=e.object({schemaVersion:e.literal("openpond.trainingUsageQuote.v1"),teamId:I,actorUserId:I,preparationId:I,submissionHash:w,workerImageDigest:e.string().regex(/^sha256:[a-f0-9]{64}$/),customerCapUsd:re,maximumWallSeconds:e.number().int().positive(),retentionDays:e.number().int().nonnegative(),gpu:E,guests:he,judges:be,storage:e.object({price:E,storageClass:e.literal("STANDARD"),quantityBasis:e.literal("gib_milliseconds"),onCreditExhaustion:e.literal("retain_objects_and_stop_new_storage")}).strict(),gpuBillingBoundary:e.literal("active_allocation_until_verified_cleanup"),storageBillingBoundary:e.literal("accepted_retention_window"),startupBillable:e.literal(!0),postCompletionIdleBillable:e.literal(!1),minimumBillableSeconds:e.literal(0),issuedAt:e.iso.datetime(),expiresAt:e.iso.datetime()}).strict(),Se=ve.extend({contentHash:w,signature:I}).strict();async function lt(t,i){let a=Se.parse(t),{contentHash:l,signature:n,...s}=a;if(l!==await h(s)||a.teamId!==i.teamId||a.actorUserId!==i.actorUserId||a.preparationId!==i.preparationId||a.submissionHash!==i.submissionHash||a.customerCapUsd!==i.customerCapUsd||Date.parse(a.expiresAt)<=Date.parse(a.issuedAt)||new Set(a.guests.map(o=>o.profileHash)).size!==a.guests.length||a.guests.some(o=>o.profileHash!==o.price.profileHash)||new Set(a.judges.acceptedPricingHashes).size!==a.judges.acceptedPricingHashes.length||new Set(a.judges.prices.map(o=>o.acceptedPricingHash)).size!==a.judges.prices.length||a.judges.prices.length!==a.judges.acceptedPricingHashes.length||a.judges.prices.some(o=>!a.judges.acceptedPricingHashes.includes(o.acceptedPricingHash)))throw new p("training_usage_quote_mismatch","Training prices differ from the reviewed preparation, actor or spending limit.");return a}m(lt,"verifyTrainingUsageQuote");var j=e.string().trim().min(1).max(191),H=e.string().regex(/^[a-f0-9]{64}$/),oe=e.object({schemaVersion:e.literal("openpond.checkpointRecoveryResourceApproval.v1"),ownerUserId:j,teamId:j,sourceJobId:j,sourceJobVersion:e.number().int().positive(),sourceInputManifestSha256:H,checkpointId:j,adapterSha256:H,resumeSha256:H,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(),B=oe.extend({approvalHash:H}).strict().superRefine((t,i)=>{t.maximumGpuSeconds>t.maximumWallSeconds&&i.addIssue({code:"custom",path:["maximumGpuSeconds"],message:"Recovery GPU duration exceeds its wall"})});async function ut(t){let i=oe.parse(t);return B.parse({...i,approvalHash:await h(i)})}m(ut,"createTrainingCheckpointRecoveryResourceApproval");var pt=e.object({resourceApproval:B.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:j,idempotencyKey:e.string().trim().min(16).max(191),maximumSpendUsd:e.number().positive().finite(),maximumWallSeconds:e.number().int().positive().max(21600)}).strict().superRefine((t,i)=>{t.evaluationGpuType&&t.mode!=="evaluation_only"&&i.addIssue({code:"custom",path:["evaluationGpuType"],message:"GPU substitution requires explicit evaluation-only recovery"});let a=t.resourceApproval;a&&(a.sourceJobVersion!==t.expectedVersion||a.checkpointId!==t.checkpointId||a.idempotencyKey!==t.idempotencyKey||a.maximumSpendUsd!==t.maximumSpendUsd||a.maximumWallSeconds!==t.maximumWallSeconds)&&i.addIssue({code:"custom",path:["resourceApproval"],message:"Recovery resource approval does not match its request"})}),xe=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(),k=e.string().datetime({offset:!0}),ye=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:k,asOf:k,estimate:e.object({revision:e.number().int().nonnegative(),estimatedStartAt:k,expiresAt:k,evidence:e.enum(["observed_capacity","measured_bootstrap","scheduled_release"])}).strict().nullable()}).strict().superRefine((t,i)=>{t.estimate&&Date.parse(t.estimate.expiresAt)<=Date.parse(t.asOf)&&i.addIssue({code:"custom",path:["estimate"],message:"An expired queue forecast must be returned as unavailable"})}),x=e.string().regex(/^(0|[1-9]\d*)\.\d{6}$/).max(24).refine(t=>/^(0|[1-9]\d*)\.\d{6}$/.test(t)&&t.length<=24&&BigInt(t.replace(".",""))<=BigInt(Number.MAX_SAFE_INTEGER)),Ie=e.object({schemaVersion:e.literal("openpond.trainingUsageSnapshot.v1"),asOf:e.iso.datetime(),customerCapUsd:x.nullable(),chargedUsd:x,committedUsd:x,outstandingUsd:x,remainingCapUsd:x.nullable(),availableCreditUsd:x,complete:e.boolean(),components:e.array(e.object({component:e.enum(["gpu","guest","storage","judge"]),chargedUsd:x,committedUsd:x,outstandingUsd:x,openOwners:e.number().int().nonnegative()}).strict()).length(4).refine(t=>t.every((i,a)=>i.component===["gpu","guest","storage","judge"][a]))}).strict(),d=e.string().trim().min(1).max(500),u=e.string().regex(/^[a-f0-9]{64}$/),b=e.string().datetime({offset:!0}),_e=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:c,payload:e.unknown(),contentHash:u}).strict(),St=e.object({schemaVersion:e.literal("openpond.trainingInputArtifact.v2"),kind:e.enum(["portable_training_bundle","reward_model_dataset"]),sourceManifest:c,artifactRef:e.string().trim().min(1).max(2e3),contentHash:u,sizeBytes:e.number().int().positive(),createdAt:b}).strict();async function je(t){let{contentHash:i,...a}=t;return h(a)}m(je,"trainingInputArtifactUploadHash");async function xt(t){q(t,Z,"Training input artifact");let i=_e.parse(t),a=await je(i);if(i.contentHash!==a)throw new p("content_hash_mismatch",`Training input artifact contentHash ${i.contentHash} does not match ${a}.`);return i}m(xt,"parseAndVerifyTrainingInputArtifactUpload");var se=e.enum(["reward_model_train","policy_optimize"]),we=e.enum(["queued","admitting","provisioning","running","stopping","cancelling","succeeded","failed","cancelled"]),Te=e.object({id:d,version:e.string().trim().min(1).max(200).nullable().default(null),required:e.boolean().default(!0)}).strict(),Re=e.object({origin:_.optional(),modelProject:e.object({id:d,portableProjectId:d,revision:e.number().int().positive(),contentHash:u}).strict(),harnessRunManifest:c,harnessRelease:c,taskset:T,tasksetRelease:c,evaluation:e.object({taskset:T,dataset:c}).strict().nullable().optional(),dataset:c,evidenceSets:e.array(c).max(1e4)}).strict(),ke=e.object({kind:e.literal("reward_model_train"),baseModel:R,preferenceDatasetRelease:c,processorRelease:c,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(),He=e.object({kind:e.literal("deterministic"),grader:c,composer:c.nullable().default(null)}).strict(),Pe=e.object({kind:e.literal("learned_reward"),rewardModelVersion:c,qualificationReport:c.nullable().default(null),evaluationReferences:e.array(c).max(1e3).default([]),scorerArtifact:e.object({artifactRef:e.string().trim().min(1).max(2e3),contentHash:u,executionReceipt:c}).strict(),processorRelease:c,rewardComposerRelease:c}).strict(),ce=R.extend({revision:e.string().regex(/^[a-f0-9]{40,64}$/),tokenizerRevision:e.string().regex(/^[a-f0-9]{40,64}$/),chatTemplateHash:u}).strict(),Ae=e.object({kind:e.literal("policy_optimize"),executionMode:e.literal("qualification").optional(),baseModel:R,recipe:te,rewardSource:e.discriminatedUnion("kind",[He,Pe]),resumeFrom:c.nullable().default(null)}).strict().superRefine((t,i)=>{if(t.recipe.method!=="sft")return;let a=y.safeParse(t.recipe);if(!a.success){i.addIssue({code:"custom",path:["recipe"],message:"The SFT recipe is incomplete or invalid."});return}(t.executionMode||t.resumeFrom||"continuation"in t.recipe)&&i.addIssue({code:"custom",message:"Initial managed SFT requires a fresh supervised run without rollout qualification or continuation."}),(a.data.baseModel.id!==t.baseModel.modelId||a.data.baseModel.revision!==t.baseModel.revision||a.data.baseModel.tokenizerRevision!==t.baseModel.tokenizerRevision||a.data.baseModel.chatTemplateHash!==t.baseModel.chatTemplateHash)&&i.addIssue({code:"custom",path:["baseModel"],message:"The SFT recipe must pin the exact submitted base and tokenizer."})}),qe=e.discriminatedUnion("kind",[ke,Ae]),Me=e.object({approvalHash:u,approvedAt:b,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(),Ue=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:Re,job:qe,requestedCapabilities:e.array(Te).max(1e3),placementObjective:e.enum(["fast","balanced","economical"]),gpuSelection:ee.optional(),physicalPlacement:xe.optional(),budget:e.object({maximumSpendUsd:e.number().nonnegative(),maximumWallSeconds:e.number().int().positive()}).strict(),approval:Me,contentHash:u}).strict().superRefine((t,i)=>{let a=(t.gpuSelection?.gpuCount??1)===2,l=t.requestedCapabilities.some(n=>n.id==="managed_rl.policy.data_parallel"&&n.version==="1"&&n.required);if(a!==l&&i.addIssue({code:"custom",path:["requestedCapabilities"],message:"Two-GPU training must require managed_rl.policy.data_parallel@1 and bind gpuSelection.gpuCount to 2."}),a&&(t.job.kind!=="policy_optimize"||t.job.executionMode||t.job.recipe.method!=="grpo"||t.physicalPlacement)&&i.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)&&i.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 n=t.job;ce.safeParse(n.baseModel).success||i.addIssue({code:"custom",path:["job","baseModel"],message:"Qualification requires immutable model and tokenizer revisions and a SHA-256 chat-template pin."}),(n.resumeFrom||n.recipe.continuation!==void 0||n.rewardSource.kind!=="deterministic"||n.recipe.method!=="grpo")&&i.addIssue({code:"custom",path:["job"],message:"Qualification requires the original GRPO learner, deterministic reward, and no resume or continuation."}),t.requestedCapabilities.some(s=>s.required&&s.id==="managed_rl.policy.qualification"&&s.version==="1")||i.addIssue({code:"custom",path:["requestedCapabilities"],message:"Qualification must require managed_rl.policy.qualification@1."})}t.approval.maximumSpendUsd!==t.budget.maximumSpendUsd&&i.addIssue({code:"custom",path:["approval","maximumSpendUsd"],message:"Approved spend must equal the immutable Job budget."})});async function ze(t){let{contentHash:i,...a}=t;return h(a)}m(ze,"trainingJobSubmissionHash");async function Ee(t){q(t,Y,"Training Job submission");let i=Ue.parse(t),a=await ze(i);if(i.contentHash!==a)throw new p("content_hash_mismatch",`Training Job contentHash ${i.contentHash} does not match ${a}.`);return i}m(Ee,"parseAndVerifyTrainingJobSubmission");var Ce=e.object({resourceApproval:B.optional(),mode:e.literal("evaluation_only").optional(),trainingWorkloadComplete:e.boolean().optional(),sourceJobId:d,checkpointId:d,policyVersion:e.number().int().positive(),completedGroups:e.number().int().positive(),optimizerMode:e.literal("continue")}).strict(),Be=e.object({schemaVersion:e.literal("openpond.trainingJob.v2"),id:d,teamId:d,kind:se,executionMode:e.literal("qualification").optional(),recovery:Ce.optional(),modelProjectId:d,portableProjectId:d,sourceProjectRevision:e.number().int().positive(),submissionHash:u,state:we,queue:ye.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(),usage:Ie.optional(),terminalReason:e.string().trim().min(1).max(5e3).nullable(),createdAt:b,updatedAt:b,completedAt:b.nullable()}).strict(),yt=e.object({schemaVersion:e.literal("openpond.trainingJobPage.v2"),jobs:e.array(Be).max(1e3),nextCursor:e.string().trim().min(1).max(2e3).nullable()}).strict(),It=e.object({schemaVersion:e.literal("openpond.trainingJobEvent.v2"),id:d,jobId:d,sequence:e.number().int().nonnegative(),type:d,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:b}).strict(),_t=e.object({schemaVersion:e.literal("openpond.trainingJobLog.v2"),jobId:d,sequence:e.number().int().nonnegative(),level:e.enum(["debug","info","warning","error"]),message:e.string().max(2e4),createdAt:b}).strict(),jt=e.object({expectedVersion:e.number().int().nonnegative()}).strict(),Ve=e.object({schemaVersion:e.literal("openpond.trainingJobOutput.v2"),id:d,jobId:d,kind:e.enum(["checkpoint","adapter","scorer","metrics","evaluation","trace","receipt"]),artifactRef:e.string().trim().min(1).max(2e3),contentHash:u,sizeBytes:e.number().int().nonnegative(),metadata:e.record(e.string(),e.unknown()).default({}),createdAt:b}).strict(),me=e.object({schemaVersion:e.literal("openpond.trainingQualificationEvidence.v1"),baseModel:ce,group:c,rolloutReceipts:e.array(c).min(1).max(1e3),rewardEvidenceHash:u,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,i)=>{new Set(t.rolloutReceipts.map(a=>a.id)).size!==t.rolloutReceipts.length&&i.addIssue({code:"custom",path:["rolloutReceipts"],message:"Qualification rollout receipt identities must be unique."})}),V=e.object({schemaVersion:e.literal("openpond.trainingExecutionReceipt.v2"),id:d,teamId:d,jobId:d,submissionHash:u,manifestHash:u,recipeHash:u,capabilityHash:u,runtimeRelease:c,inputs:e.array(c).max(1e4),outputs:e.array(c).max(1e4),spendUsd:e.number().nonnegative(),durationSeconds:e.number().nonnegative(),cleanupComplete:e.boolean(),qualification:me.optional(),issuer:d,issuedAt:b,signature:e.string().trim().min(1).max(1e4).nullable()}).strict();async function Je(t){return h(V.parse(t))}m(Je,"trainingExecutionReceiptHash");async function wt(t,i){let a=V.parse(t),l=d.parse(i.id),n=u.parse(i.contentHash),s=await Je(a);if(a.id!==l||s!==n)throw new p("execution_receipt_mismatch","The execution receipt identity or canonical content hash did not match.");if(i.teamId!==void 0&&a.teamId!==d.parse(i.teamId))throw new p("execution_receipt_team_mismatch","The execution receipt belongs to a different team.");if(i.jobId!==void 0&&a.jobId!==d.parse(i.jobId))throw new p("execution_receipt_job_mismatch","The execution receipt belongs to a different Training Job.");if((i.requireCleanup??!0)&&!a.cleanupComplete)throw new p("execution_cleanup_incomplete","The execution receipt does not attest complete terminal cleanup.");if(i.qualificationSubmission){let o=await Ee(i.qualificationSubmission);if(o.job.kind!=="policy_optimize"||o.job.executionMode!=="qualification")throw new p("qualification_submission_required","Expected an immutable qualification submission.");await Oe(a,{submissionHash:o.contentHash,baseModel:o.job.baseModel,outputs:i.outputs})}return a}m(wt,"parseAndVerifyTrainingExecutionReceipt");async function Oe(t,i){let a=me.parse(t.qualification);if(t.submissionHash!==i.submissionHash||!t.cleanupComplete)throw new p("qualification_receipt_mismatch","Qualification must attest the expected submission and complete cleanup.");if(i.baseModel&&await h(a.baseModel)!==await h(i.baseModel))throw new p("qualification_learner_mismatch","Qualification used a different original learner or tokenizer.");if(i.outputs?.some(l=>["checkpoint","adapter","scorer"].includes(l.kind)))throw new p("qualification_updated_artifact","Qualification must not publish trained artifacts or checkpoints.")}m(Oe,"assertTrainingQualificationReceipt");var Tt=e.object({schemaVersion:e.literal("openpond.trainingJobOutputs.v2"),outputs:e.array(Ve).max(1e4),receipt:V.nullable()}).strict(),Ge=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:u}).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,i)=>{(new Set(t.supportedRanks).size!==t.supportedRanks.length||t.supportedRanks.some(a=>a>t.envelopeRank))&&i.addIssue({code:"custom",path:["supportedRanks"],message:"Supported ranks must be unique and fit the physical adapter envelope."}),t.supportedRanks.length&&!t.qualification&&i.addIssue({code:"custom",path:["qualification"],message:"Advertised ranks require immutable image qualification evidence."})});function Rt(t,i,a){return t.supportedRanks.includes(i)?a?a.mode==="residual_append"?a.parentEnabledRank+i<=t.envelopeRank:a.parentEnabledRank===i:!0:!1}m(Rt,"supportsTrainingPolicyLoraRank");var kt=e.object({schemaVersion:e.literal("openpond.trainingCapabilities.v2"),capabilityHash:u,jobKinds:e.array(se),methods:e.array(e.string().trim().min(1).max(200)),billingModes:fe.optional(),executionModes:e.array(e.enum(["training","qualification"])).optional(),policyLora:Ge.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:u,workHarnessHash:u,schemaHash:u,artifactHash:u,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:b,expiresAt:b}).strict(),$e=e.array(e.object({id:e.string().trim().min(1)}).catchall(e.unknown())).min(1).max(1e3),Ne=e.object({binding:G,rewards:e.array(O).min(1).max(100)}).strict();async function At(t){let i=t.rewardExecution?Ne.parse(t.rewardExecution):null,a=$e.parse(i?$(i.binding,i.rewards):t.graders);if(new Set(a.map(n=>n.id)).size!==a.length)throw new Error("Training grader identities must be unique.");let l=await h({schemaVersion:"openpond.trainingGraderSet.v1",graders:a});return{kind:"deterministic",grader:{id:`training-graders-${l.slice(0,32)}`,contentHash:l},composer:i?{id:i.binding.id,contentHash:i.binding.contentHash}:null}}m(At,"deterministicTrainingRewardSource");var Mt="evaluation-source.json",C=e.object({id:e.string().trim().min(1),clusterKey:e.string().trim().min(1),split:e.enum(["train","validation","frozen_eval"])}).passthrough(),De=e.object({schemaVersion:e.literal("openpond.trainingEvaluationSource.v1"),taskset:T,tasks:e.array(C).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,i)=>{let a=new Set;t.tasks.forEach((l,n)=>{l.split==="train"&&i.addIssue({code:"custom",path:["tasks",n,"split"],message:"Evaluation sources require held-out tasks."}),a.has(l.id)&&i.addIssue({code:"custom",path:["tasks",n,"id"],message:"Evaluation task identities must be unique."}),a.add(l.id)})});function Ut(t,i){let a=e.array(C).min(1).max(1e4).parse(t),l=e.array(C).min(1).max(1e4).parse(i),n=new Set,s=new Set;for(let g of a){if(g.split!=="train")throw new Error("The training population contains a held-out task.");if(n.has(g.id))throw new Error("Training task identities must be unique.");n.add(g.id),s.add(g.clusterKey)}let o=new Set;for(let g of l){if(g.split==="train")throw new Error("The evaluation population contains a training task.");if(o.has(g.id))throw new Error("Evaluation task identities must be unique.");if(n.has(g.id)||s.has(g.clusterKey))throw new Error("Training and evaluation tasks or families overlap.");o.add(g.id)}}m(Ut,"assertTrainingEvaluationIsolation");async function zt(t){let i=De.parse(t),a=await h(i);return{taskset:i.taskset,dataset:{id:`training-evaluation-${a.slice(0,32)}`,contentHash:a}}}m(zt,"trainingEvaluationSourceRef");var r=e.string().trim().min(1).max(200),f=e.string().regex(/^[a-f0-9]{64}$/),P=e.object({id:r,contentHash:f}).strict(),Qt=e.object({available:e.boolean(),reason:e.string().max(1e3).nullable(),origin:_.nullable()}).strict(),le=e.object({schemaVersion:e.literal("openpond.postTrainingAttachment.v1"),binding:e.object({kind:e.enum(["preparation","policy"]),id:r,revision:e.number().int().positive(),contentHash:f}).strict(),projectId:r.nullable(),automatic:e.boolean(),maximumSpendUsd:e.number().finite().positive().max(1e4),experiments:e.array(e.object({id:r,configuration:U}).strict()).min(1).max(20),acceptancePlan:K.nullable()}).strict().superRefine((t,i)=>{if(new Set(t.experiments.map(a=>a.id)).size!==t.experiments.length&&i.addIssue({code:"custom",message:"Attach each evaluation once."}),t.experiments.reduce((a,l)=>a+l.configuration.maximumCostUsd,0)>t.maximumSpendUsd+1e-9&&i.addIssue({code:"custom",message:"Attached evaluation budgets exceed the total approved budget."}),t.experiments.some(a=>(a.configuration.request.project?.id??null)!==t.projectId)&&i.addIssue({code:"custom",message:"Attached experiments must use the training Project."}),t.acceptancePlan){let a=new Set(t.acceptancePlan.checks.map(n=>n.id));t.acceptancePlan.checks.some(n=>!t.experiments.some(s=>s.id===n.id))&&i.addIssue({code:"custom",message:"Select the frozen Experiment for each acceptance check."}),t.acceptancePlan.maximumSpendUsd+t.experiments.filter(n=>!a.has(n.id)).reduce((n,s)=>n+s.configuration.maximumCostUsd,0)>t.maximumSpendUsd+1e-9&&i.addIssue({code:"custom",message:"Paired acceptance and diagnostic ceilings exceed the approved evaluation budget."})}});var Fe=e.object({baseline:P,checks:e.array(e.object({id:r,sourceRunId:r,sourceManifestHash:f,targetConfigurationHash:f,executionHash:f,populationHash:f,evaluator:P,feedbackKey:r,output:e.enum(["boolean","score"]),unit:e.string().min(1).max(80)}).strict()).min(1).max(100)}).strict(),Qe=e.enum(["waiting_for_training","ready","preparing","queued","running","cleaning","completed","failed","blocked","cancelled","budget_exhausted"]),de=e.object({schemaVersion:e.literal("openpond.postTrainingSummary.v1"),id:r,teamId:r,jobId:r,revision:e.number().int().positive(),planHash:f,automatic:e.boolean(),candidate:P.nullable(),state:Qe,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:r.nullable(),experimentIds:e.array(r).max(20),updatedAt:e.iso.datetime()}).strict().superRefine((t,i)=>{t.completed+t.failed>t.total&&i.addIssue({code:"custom",message:"Evaluation totals are inconsistent."}),["preparing","queued","running","cleaning","completed"].includes(t.state)&&!t.candidate&&i.addIssue({code:"custom",message:"Evaluation execution requires the exact trained candidate."})}),Le=e.object({operationId:r,expectedRevision:e.number().int().positive(),planHash:f}).strict(),We=e.object({operationId:r,attachment:le}).strict(),Ke=e.object({id:r,teamId:r,ownerUserId:r,attachment:le,qualification:Fe.nullable(),contentHash:f,createdAt:e.iso.datetime()}).strict();function Xe(t){let i=Ke.parse(t);if(i.contentHash!==X({attachment:i.attachment,qualification:i.qualification}))throw new Error("The retained evaluation attachment or qualification changed.");return i}m(Xe,"verifyPostTrainingPlan");function Lt(t){let{request:i}=t,a={accept:"application/json","content-type":"application/json"},l=m(s=>`/v1/training/jobs/${encodeURIComponent(r.parse(s))}/post-training`,"path");async function n(s,o,g){if(s===null)return null;let v=de.parse(s);if(v.teamId!==o||v.jobId!==g)throw new p("post_training_scope_mismatch","The evaluation summary belongs to another run or workspace.");return v}return m(n,"read"),{async attach(s,o){let g=We.parse(o),v=Xe(await i("/v1/training/post-training-plans",{method:"POST",headers:a,body:JSON.stringify(g)}));if(v.teamId!==s||await h(v.attachment)!==await h(g.attachment))throw new p("post_training_plan_mismatch","The retained attachment differs from the reviewed plan.");return v},async get(s,o){return n(await i(l(o),{headers:a}),s,o)},async control(s,o,g,v){let J=Le.parse(v),A=await n(await i(`${l(o)}/${g}`,{method:"POST",headers:a,body:JSON.stringify(J)}),s,o);if(!A||A.planHash!==J.planHash)throw new p("post_training_control_mismatch","Evaluation control did not retain the approved plan.");return A}}}m(Lt,"createPostTrainingClient");var Wt=e.object({teamId:r,actorId:r,projectId:r.nullable(),configuration:M,batches:e.array(F).max(1e4),sources:e.array(D).max(1e4),definitions:e.array(N).max(1e4),experiments:e.array(e.object({id:r,name:e.string().max(500),configuration:U,graders:e.array(e.object({feedbackKey:r,name:e.string().max(500),ref:P}).strict()).max(100)}).strict()).max(1e4)}).strict(),Kt=e.enum(["hardware-catalog","gpu-catalog","modification-capabilities","estimate","funding","funding-handoff","list-drafts","get-draft","save-draft","archive-draft","prepare","prepare-draft","review-dataset","start","cancel","publish","attach"]),Xt=e.object({teamId:r,actorId:r,configuration:M,policy:Q,inspection:W,iterations:e.array(e.object({iteration:L,evals:de.nullable()}).strict()).max(100),nextCursor:r.nullable()}).strict(),Yt=e.object({id:r,expectedRevision:e.number().int().positive(),policyHash:f,operationId:r,action:e.enum(["pause","resume","reserve","cancel-iteration","retry-iteration"]),iterationId:r.optional(),iterationRevision:e.number().int().positive().optional()}).strict();export{y as a,Ze as b,ne as c,rt as d,ge as e,ot as f,st as g,fe as h,mt as i,ve as j,Se as k,lt as l,B as m,ut as n,pt as o,xe as p,ye as q,Ie as r,_e as s,St as t,je as u,xt as v,se as w,we as x,Te as y,Re as z,ke as A,ce as B,Ae as C,qe as D,Me as E,Ue as F,ze as G,Ee as H,Ce as I,Be as J,yt as K,It as L,_t as M,jt as N,Ve as O,me as P,V as Q,Je as R,wt as S,Oe as T,Tt as U,Ge as V,Rt as W,kt as X,At as Y,Mt as Z,De as _,Ut as $,zt as aa,Qt as ba,le as ca,de as da,Le as ea,We as fa,Xe as ga,Lt as ha,Wt as ia,Kt as ja,Xt as ka,Yt as la};
|
|
2
|
+
import{E as U}from"./chunk-XKDOPNQ5.js";import{m as X}from"./chunk-HIQPGYVH.js";import{A as te,Q as M,d as Y,e as Z,i as p,l as h,m as q,p as ee,w as c,x as T,y as R}from"./chunk-3VT2PPKW.js";import{D as F,F as Q,I as L,b as _,dc as K,o as N,t as D,wb as W}from"./chunk-ZEOYNUHL.js";import{Ra as O,Wa as G,bb as $}from"./chunk-ZY32SZ2P.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as m}from"./chunk-FTQLQJQV.js";var ie=e.string().trim().min(1).max(240),ue=e.string().trim().min(8).max(256),y=e.object({schemaVersion:e.literal("openpond.sftRecipe.v1"),method:e.literal("sft"),parameterization:e.literal("lora"),baseModel:e.object({id:ie,revision:e.string().trim().min(1).max(256),tokenizerRevision:e.string().trim().min(1).max(256),chatTemplateHash:ue}),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(ie).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()})}),Ze=y.safeExtend({dataset:y.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:y.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:y.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:y.shape.resourceLimits.safeExtend({wallTimeMs:e.number().int().min(1e3).max(216e5)})}).superRefine((t,i)=>{t.optimizer.batchSize*t.optimizer.gradientAccumulationSteps>32&&i.addIssue({code:"custom",path:["optimizer"],message:"Managed SFT supports at most 32 accumulated examples."}),new Set(t.lora.targetModules).size!==t.lora.targetModules.length&&i.addIssue({code:"custom",path:["lora","targetModules"],message:"Adapter target modules must be unique."})});var pe=e.string().regex(/^[a-f0-9]{64}$/),z=e.string().regex(/^(0|[1-9]\d*)(\.\d{1,6})?$/).max(24),ae=m(t=>{let[i,a=""]=z.parse(t).split(".");return BigInt(i)*1000000n+BigInt(a.padEnd(6,"0"))},"micros"),ne=e.object({schemaVersion:e.literal("openpond.computeAppliedPrice.v1"),version:e.string().min(1).max(500),service:e.enum(["managed_rl","model_modification","model_serving","sandbox"]),profileHash:pe,currency:e.literal("USD"),unit:e.literal("resource_hour"),hourlyUsd:z.refine(t=>{if(!z.safeParse(t).success)return!1;let i=ae(t);return i>0n&&i<=BigInt(Number.MAX_SAFE_INTEGER)})}).strict(),rt=e.object({schemaVersion:e.literal("openpond.modificationPrice.v1"),appliedPrice:ne.extend({service:e.literal("model_modification")}),billingBoundary:e.literal("active_allocation_until_verified_cleanup"),startupBillable:e.literal(!0),postCompletionIdleBillable:e.literal(!1),minimumBillableSeconds:e.literal(0),warmReuseSeconds:e.literal(300)}).strict();function ge(t){if(t==null||t.trim()==="")return null;let i=ae(t);if(i<=0n||i>1000000000000n)throw new p("managed_modification_cap_invalid","Choose a positive spending limit of at most 1,000,000 USD, or use available credits.");return`${i/1000000n}.${(i%1000000n).toString().padStart(6,"0")}`}m(ge,"canonicalComputeSpendCap");function ot(t){if(t.maximumSpendUsd!==ge(t.maximumSpendUsd)||t.maximumSpendUsd===null&&!t.computePrice||t.computePrice&&t.computePrice.appliedPrice.profileHash!==t.runtimeHash)throw new p("managed_modification_price_mismatch","Retain the exact reviewed rate, runtime and optional spending limit.")}m(ot,"assertManagedModificationPricing");async function st(t,i){return t.computePrice?i.approvedPriceHash===await h(t.computePrice):i.approvedPriceHash===void 0}m(st,"managedModificationPriceApprovalMatches");var I=e.string().min(1).max(500),w=e.string().regex(/^[a-f0-9]{64}$/),E=ne.extend({service:e.literal("managed_rl")}),re=e.string().regex(/^(0|[1-9]\d*)\.\d{6}$/).max(24).refine(t=>{if(!/^(0|[1-9]\d*)\.\d{6}$/.test(t)||t.length>24)return!1;let i=BigInt(t.replace(".",""));return i>0n&&i<=BigInt(Number.MAX_SAFE_INTEGER)}).nullable(),he=e.array(e.object({profileHash:w,price:E,resources:e.object({cpu:e.number().positive(),memoryGb:e.number().positive(),diskGb:e.number().nonnegative()}).strict()}).strict()).max(32),S=e.string().regex(/^(0|[1-9]\d*)\.\d{6}$/).max(24).refine(t=>/^(0|[1-9]\d*)\.\d{6}$/.test(t)&&t.length<=24&&BigInt(t.replace(".",""))<=BigInt(Number.MAX_SAFE_INTEGER)),be=e.object({billing:e.literal("existing_retail_child_captures"),acceptedPricingHashes:e.array(w).max(64),prices:e.array(e.object({modelId:I,displayName:I,acceptedPricingHash:w,inputUsdPerMillionTokens:S,cachedInputUsdPerMillionTokens:S,outputUsdPerMillionTokens:S,cacheWriteUsdPerMillionTokens:S.nullable(),cacheWriteOneHourUsdPerMillionTokens:S.nullable(),longContextThresholdTokens:e.number().int().positive().nullable(),longContext:e.object({inputUsdPerMillionTokens:S,cachedInputUsdPerMillionTokens:S,outputUsdPerMillionTokens:S,cacheWriteUsdPerMillionTokens:S.nullable()}).strict().nullable()}).strict()).max(64)}).strict(),fe=e.tuple([e.object({mode:e.literal("prepaid_only"),availability:e.literal("available"),reason:e.null()}).strict(),e.object({mode:e.literal("actual_usage"),availability:e.enum(["unavailable","requires_preparation"]),reason:e.string().min(1).max(500).nullable()}).strict()]),mt=e.object({schemaVersion:e.literal("openpond.trainingUsageFundingRequest.v1"),billingMode:e.literal("actual_usage"),customerCapUsd:re}).strict(),ve=e.object({schemaVersion:e.literal("openpond.trainingUsageQuote.v1"),teamId:I,actorUserId:I,preparationId:I,submissionHash:w,workerImageDigest:e.string().regex(/^sha256:[a-f0-9]{64}$/),customerCapUsd:re,maximumWallSeconds:e.number().int().positive(),retentionDays:e.number().int().nonnegative(),gpu:E,guests:he,judges:be,storage:e.object({price:E,storageClass:e.literal("STANDARD"),quantityBasis:e.literal("gib_milliseconds"),onCreditExhaustion:e.literal("retain_objects_and_stop_new_storage")}).strict(),gpuBillingBoundary:e.literal("active_allocation_until_verified_cleanup"),storageBillingBoundary:e.literal("accepted_retention_window"),startupBillable:e.literal(!0),postCompletionIdleBillable:e.literal(!1),minimumBillableSeconds:e.literal(0),issuedAt:e.iso.datetime(),expiresAt:e.iso.datetime()}).strict(),Se=ve.extend({contentHash:w,signature:I}).strict();async function lt(t,i){let a=Se.parse(t),{contentHash:l,signature:n,...s}=a;if(l!==await h(s)||a.teamId!==i.teamId||a.actorUserId!==i.actorUserId||a.preparationId!==i.preparationId||a.submissionHash!==i.submissionHash||a.customerCapUsd!==i.customerCapUsd||Date.parse(a.expiresAt)<=Date.parse(a.issuedAt)||new Set(a.guests.map(o=>o.profileHash)).size!==a.guests.length||a.guests.some(o=>o.profileHash!==o.price.profileHash)||new Set(a.judges.acceptedPricingHashes).size!==a.judges.acceptedPricingHashes.length||new Set(a.judges.prices.map(o=>o.acceptedPricingHash)).size!==a.judges.prices.length||a.judges.prices.length!==a.judges.acceptedPricingHashes.length||a.judges.prices.some(o=>!a.judges.acceptedPricingHashes.includes(o.acceptedPricingHash)))throw new p("training_usage_quote_mismatch","Training prices differ from the reviewed preparation, actor or spending limit.");return a}m(lt,"verifyTrainingUsageQuote");var j=e.string().trim().min(1).max(191),H=e.string().regex(/^[a-f0-9]{64}$/),oe=e.object({schemaVersion:e.literal("openpond.checkpointRecoveryResourceApproval.v1"),ownerUserId:j,teamId:j,sourceJobId:j,sourceJobVersion:e.number().int().positive(),sourceInputManifestSha256:H,checkpointId:j,adapterSha256:H,resumeSha256:H,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(),B=oe.extend({approvalHash:H}).strict().superRefine((t,i)=>{t.maximumGpuSeconds>t.maximumWallSeconds&&i.addIssue({code:"custom",path:["maximumGpuSeconds"],message:"Recovery GPU duration exceeds its wall"})});async function ut(t){let i=oe.parse(t);return B.parse({...i,approvalHash:await h(i)})}m(ut,"createTrainingCheckpointRecoveryResourceApproval");var pt=e.object({resourceApproval:B.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:j,idempotencyKey:e.string().trim().min(16).max(191),maximumSpendUsd:e.number().positive().finite(),maximumWallSeconds:e.number().int().positive().max(21600)}).strict().superRefine((t,i)=>{t.evaluationGpuType&&t.mode!=="evaluation_only"&&i.addIssue({code:"custom",path:["evaluationGpuType"],message:"GPU substitution requires explicit evaluation-only recovery"});let a=t.resourceApproval;a&&(a.sourceJobVersion!==t.expectedVersion||a.checkpointId!==t.checkpointId||a.idempotencyKey!==t.idempotencyKey||a.maximumSpendUsd!==t.maximumSpendUsd||a.maximumWallSeconds!==t.maximumWallSeconds)&&i.addIssue({code:"custom",path:["resourceApproval"],message:"Recovery resource approval does not match its request"})}),xe=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(),k=e.string().datetime({offset:!0}),ye=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:k,asOf:k,estimate:e.object({revision:e.number().int().nonnegative(),estimatedStartAt:k,expiresAt:k,evidence:e.enum(["observed_capacity","measured_bootstrap","scheduled_release"])}).strict().nullable()}).strict().superRefine((t,i)=>{t.estimate&&Date.parse(t.estimate.expiresAt)<=Date.parse(t.asOf)&&i.addIssue({code:"custom",path:["estimate"],message:"An expired queue forecast must be returned as unavailable"})}),x=e.string().regex(/^(0|[1-9]\d*)\.\d{6}$/).max(24).refine(t=>/^(0|[1-9]\d*)\.\d{6}$/.test(t)&&t.length<=24&&BigInt(t.replace(".",""))<=BigInt(Number.MAX_SAFE_INTEGER)),Ie=e.object({schemaVersion:e.literal("openpond.trainingUsageSnapshot.v1"),asOf:e.iso.datetime(),customerCapUsd:x.nullable(),chargedUsd:x,committedUsd:x,outstandingUsd:x,remainingCapUsd:x.nullable(),availableCreditUsd:x,complete:e.boolean(),components:e.array(e.object({component:e.enum(["gpu","guest","storage","judge"]),chargedUsd:x,committedUsd:x,outstandingUsd:x,openOwners:e.number().int().nonnegative()}).strict()).length(4).refine(t=>t.every((i,a)=>i.component===["gpu","guest","storage","judge"][a]))}).strict(),d=e.string().trim().min(1).max(500),u=e.string().regex(/^[a-f0-9]{64}$/),b=e.string().datetime({offset:!0}),_e=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:c,payload:e.unknown(),contentHash:u}).strict(),St=e.object({schemaVersion:e.literal("openpond.trainingInputArtifact.v2"),kind:e.enum(["portable_training_bundle","reward_model_dataset"]),sourceManifest:c,artifactRef:e.string().trim().min(1).max(2e3),contentHash:u,sizeBytes:e.number().int().positive(),createdAt:b}).strict();async function je(t){let{contentHash:i,...a}=t;return h(a)}m(je,"trainingInputArtifactUploadHash");async function xt(t){q(t,Z,"Training input artifact");let i=_e.parse(t),a=await je(i);if(i.contentHash!==a)throw new p("content_hash_mismatch",`Training input artifact contentHash ${i.contentHash} does not match ${a}.`);return i}m(xt,"parseAndVerifyTrainingInputArtifactUpload");var se=e.enum(["reward_model_train","policy_optimize"]),we=e.enum(["queued","admitting","provisioning","running","stopping","cancelling","succeeded","failed","cancelled"]),Te=e.object({id:d,version:e.string().trim().min(1).max(200).nullable().default(null),required:e.boolean().default(!0)}).strict(),Re=e.object({origin:_.optional(),modelProject:e.object({id:d,portableProjectId:d,revision:e.number().int().positive(),contentHash:u}).strict(),harnessRunManifest:c,harnessRelease:c,taskset:T,tasksetRelease:c,evaluation:e.object({taskset:T,dataset:c}).strict().nullable().optional(),dataset:c,evidenceSets:e.array(c).max(1e4)}).strict(),ke=e.object({kind:e.literal("reward_model_train"),baseModel:R,preferenceDatasetRelease:c,processorRelease:c,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(),He=e.object({kind:e.literal("deterministic"),grader:c,composer:c.nullable().default(null)}).strict(),Pe=e.object({kind:e.literal("learned_reward"),rewardModelVersion:c,qualificationReport:c.nullable().default(null),evaluationReferences:e.array(c).max(1e3).default([]),scorerArtifact:e.object({artifactRef:e.string().trim().min(1).max(2e3),contentHash:u,executionReceipt:c}).strict(),processorRelease:c,rewardComposerRelease:c}).strict(),ce=R.extend({revision:e.string().regex(/^[a-f0-9]{40,64}$/),tokenizerRevision:e.string().regex(/^[a-f0-9]{40,64}$/),chatTemplateHash:u}).strict(),Ae=e.object({kind:e.literal("policy_optimize"),executionMode:e.literal("qualification").optional(),baseModel:R,recipe:te,rewardSource:e.discriminatedUnion("kind",[He,Pe]),resumeFrom:c.nullable().default(null)}).strict().superRefine((t,i)=>{if(t.recipe.method!=="sft")return;let a=y.safeParse(t.recipe);if(!a.success){i.addIssue({code:"custom",path:["recipe"],message:"The SFT recipe is incomplete or invalid."});return}(t.executionMode||t.resumeFrom||"continuation"in t.recipe)&&i.addIssue({code:"custom",message:"Initial managed SFT requires a fresh supervised run without rollout qualification or continuation."}),(a.data.baseModel.id!==t.baseModel.modelId||a.data.baseModel.revision!==t.baseModel.revision||a.data.baseModel.tokenizerRevision!==t.baseModel.tokenizerRevision||a.data.baseModel.chatTemplateHash!==t.baseModel.chatTemplateHash)&&i.addIssue({code:"custom",path:["baseModel"],message:"The SFT recipe must pin the exact submitted base and tokenizer."})}),qe=e.discriminatedUnion("kind",[ke,Ae]),Me=e.object({approvalHash:u,approvedAt:b,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(),Ue=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:Re,job:qe,requestedCapabilities:e.array(Te).max(1e3),placementObjective:e.enum(["fast","balanced","economical"]),gpuSelection:ee.optional(),physicalPlacement:xe.optional(),budget:e.object({maximumSpendUsd:e.number().nonnegative(),maximumWallSeconds:e.number().int().positive()}).strict(),approval:Me,contentHash:u}).strict().superRefine((t,i)=>{let a=(t.gpuSelection?.gpuCount??1)===2,l=t.requestedCapabilities.some(n=>n.id==="managed_rl.policy.data_parallel"&&n.version==="1"&&n.required);if(a!==l&&i.addIssue({code:"custom",path:["requestedCapabilities"],message:"Two-GPU training must require managed_rl.policy.data_parallel@1 and bind gpuSelection.gpuCount to 2."}),a&&(t.job.kind!=="policy_optimize"||t.job.executionMode||t.job.recipe.method!=="grpo"||t.physicalPlacement)&&i.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)&&i.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 n=t.job;ce.safeParse(n.baseModel).success||i.addIssue({code:"custom",path:["job","baseModel"],message:"Qualification requires immutable model and tokenizer revisions and a SHA-256 chat-template pin."}),(n.resumeFrom||n.recipe.continuation!==void 0||n.rewardSource.kind!=="deterministic"||n.recipe.method!=="grpo")&&i.addIssue({code:"custom",path:["job"],message:"Qualification requires the original GRPO learner, deterministic reward, and no resume or continuation."}),t.requestedCapabilities.some(s=>s.required&&s.id==="managed_rl.policy.qualification"&&s.version==="1")||i.addIssue({code:"custom",path:["requestedCapabilities"],message:"Qualification must require managed_rl.policy.qualification@1."})}t.approval.maximumSpendUsd!==t.budget.maximumSpendUsd&&i.addIssue({code:"custom",path:["approval","maximumSpendUsd"],message:"Approved spend must equal the immutable Job budget."})});async function ze(t){let{contentHash:i,...a}=t;return h(a)}m(ze,"trainingJobSubmissionHash");async function Ee(t){q(t,Y,"Training Job submission");let i=Ue.parse(t),a=await ze(i);if(i.contentHash!==a)throw new p("content_hash_mismatch",`Training Job contentHash ${i.contentHash} does not match ${a}.`);return i}m(Ee,"parseAndVerifyTrainingJobSubmission");var Ce=e.object({resourceApproval:B.optional(),mode:e.literal("evaluation_only").optional(),trainingWorkloadComplete:e.boolean().optional(),sourceJobId:d,checkpointId:d,policyVersion:e.number().int().positive(),completedGroups:e.number().int().positive(),optimizerMode:e.literal("continue")}).strict(),Be=e.object({schemaVersion:e.literal("openpond.trainingJob.v2"),id:d,teamId:d,kind:se,executionMode:e.literal("qualification").optional(),recovery:Ce.optional(),modelProjectId:d,portableProjectId:d,sourceProjectRevision:e.number().int().positive(),submissionHash:u,state:we,queue:ye.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(),usage:Ie.optional(),terminalReason:e.string().trim().min(1).max(5e3).nullable(),createdAt:b,updatedAt:b,completedAt:b.nullable()}).strict(),yt=e.object({schemaVersion:e.literal("openpond.trainingJobPage.v2"),jobs:e.array(Be).max(1e3),nextCursor:e.string().trim().min(1).max(2e3).nullable()}).strict(),It=e.object({schemaVersion:e.literal("openpond.trainingJobEvent.v2"),id:d,jobId:d,sequence:e.number().int().nonnegative(),type:d,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:b}).strict(),_t=e.object({schemaVersion:e.literal("openpond.trainingJobLog.v2"),jobId:d,sequence:e.number().int().nonnegative(),level:e.enum(["debug","info","warning","error"]),message:e.string().max(2e4),createdAt:b}).strict(),jt=e.object({expectedVersion:e.number().int().nonnegative()}).strict(),Ve=e.object({schemaVersion:e.literal("openpond.trainingJobOutput.v2"),id:d,jobId:d,kind:e.enum(["checkpoint","adapter","scorer","metrics","evaluation","trace","receipt"]),artifactRef:e.string().trim().min(1).max(2e3),contentHash:u,sizeBytes:e.number().int().nonnegative(),metadata:e.record(e.string(),e.unknown()).default({}),createdAt:b}).strict(),me=e.object({schemaVersion:e.literal("openpond.trainingQualificationEvidence.v1"),baseModel:ce,group:c,rolloutReceipts:e.array(c).min(1).max(1e3),rewardEvidenceHash:u,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,i)=>{new Set(t.rolloutReceipts.map(a=>a.id)).size!==t.rolloutReceipts.length&&i.addIssue({code:"custom",path:["rolloutReceipts"],message:"Qualification rollout receipt identities must be unique."})}),V=e.object({schemaVersion:e.literal("openpond.trainingExecutionReceipt.v2"),id:d,teamId:d,jobId:d,submissionHash:u,manifestHash:u,recipeHash:u,capabilityHash:u,runtimeRelease:c,inputs:e.array(c).max(1e4),outputs:e.array(c).max(1e4),spendUsd:e.number().nonnegative(),durationSeconds:e.number().nonnegative(),cleanupComplete:e.boolean(),qualification:me.optional(),issuer:d,issuedAt:b,signature:e.string().trim().min(1).max(1e4).nullable()}).strict();async function Je(t){return h(V.parse(t))}m(Je,"trainingExecutionReceiptHash");async function wt(t,i){let a=V.parse(t),l=d.parse(i.id),n=u.parse(i.contentHash),s=await Je(a);if(a.id!==l||s!==n)throw new p("execution_receipt_mismatch","The execution receipt identity or canonical content hash did not match.");if(i.teamId!==void 0&&a.teamId!==d.parse(i.teamId))throw new p("execution_receipt_team_mismatch","The execution receipt belongs to a different team.");if(i.jobId!==void 0&&a.jobId!==d.parse(i.jobId))throw new p("execution_receipt_job_mismatch","The execution receipt belongs to a different Training Job.");if((i.requireCleanup??!0)&&!a.cleanupComplete)throw new p("execution_cleanup_incomplete","The execution receipt does not attest complete terminal cleanup.");if(i.qualificationSubmission){let o=await Ee(i.qualificationSubmission);if(o.job.kind!=="policy_optimize"||o.job.executionMode!=="qualification")throw new p("qualification_submission_required","Expected an immutable qualification submission.");await Oe(a,{submissionHash:o.contentHash,baseModel:o.job.baseModel,outputs:i.outputs})}return a}m(wt,"parseAndVerifyTrainingExecutionReceipt");async function Oe(t,i){let a=me.parse(t.qualification);if(t.submissionHash!==i.submissionHash||!t.cleanupComplete)throw new p("qualification_receipt_mismatch","Qualification must attest the expected submission and complete cleanup.");if(i.baseModel&&await h(a.baseModel)!==await h(i.baseModel))throw new p("qualification_learner_mismatch","Qualification used a different original learner or tokenizer.");if(i.outputs?.some(l=>["checkpoint","adapter","scorer"].includes(l.kind)))throw new p("qualification_updated_artifact","Qualification must not publish trained artifacts or checkpoints.")}m(Oe,"assertTrainingQualificationReceipt");var Tt=e.object({schemaVersion:e.literal("openpond.trainingJobOutputs.v2"),outputs:e.array(Ve).max(1e4),receipt:V.nullable()}).strict(),Ge=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:u}).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,i)=>{(new Set(t.supportedRanks).size!==t.supportedRanks.length||t.supportedRanks.some(a=>a>t.envelopeRank))&&i.addIssue({code:"custom",path:["supportedRanks"],message:"Supported ranks must be unique and fit the physical adapter envelope."}),t.supportedRanks.length&&!t.qualification&&i.addIssue({code:"custom",path:["qualification"],message:"Advertised ranks require immutable image qualification evidence."})});function Rt(t,i,a){return t.supportedRanks.includes(i)?a?a.mode==="residual_append"?a.parentEnabledRank+i<=t.envelopeRank:a.parentEnabledRank===i:!0:!1}m(Rt,"supportsTrainingPolicyLoraRank");var kt=e.object({schemaVersion:e.literal("openpond.trainingCapabilities.v2"),capabilityHash:u,jobKinds:e.array(se),methods:e.array(e.string().trim().min(1).max(200)),billingModes:fe.optional(),executionModes:e.array(e.enum(["training","qualification"])).optional(),policyLora:Ge.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:u,workHarnessHash:u,schemaHash:u,artifactHash:u,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:b,expiresAt:b}).strict(),$e=e.array(e.object({id:e.string().trim().min(1)}).catchall(e.unknown())).min(1).max(1e3),Ne=e.object({binding:G,rewards:e.array(O).min(1).max(100)}).strict();async function At(t){let i=t.rewardExecution?Ne.parse(t.rewardExecution):null,a=$e.parse(i?$(i.binding,i.rewards):t.graders);if(new Set(a.map(n=>n.id)).size!==a.length)throw new Error("Training grader identities must be unique.");let l=await h({schemaVersion:"openpond.trainingGraderSet.v1",graders:a});return{kind:"deterministic",grader:{id:`training-graders-${l.slice(0,32)}`,contentHash:l},composer:i?{id:i.binding.id,contentHash:i.binding.contentHash}:null}}m(At,"deterministicTrainingRewardSource");var Mt="evaluation-source.json",C=e.object({id:e.string().trim().min(1),clusterKey:e.string().trim().min(1),split:e.enum(["train","validation","frozen_eval"])}).passthrough(),De=e.object({schemaVersion:e.literal("openpond.trainingEvaluationSource.v1"),taskset:T,tasks:e.array(C).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,i)=>{let a=new Set;t.tasks.forEach((l,n)=>{l.split==="train"&&i.addIssue({code:"custom",path:["tasks",n,"split"],message:"Evaluation sources require held-out tasks."}),a.has(l.id)&&i.addIssue({code:"custom",path:["tasks",n,"id"],message:"Evaluation task identities must be unique."}),a.add(l.id)})});function Ut(t,i){let a=e.array(C).min(1).max(1e4).parse(t),l=e.array(C).min(1).max(1e4).parse(i),n=new Set,s=new Set;for(let g of a){if(g.split!=="train")throw new Error("The training population contains a held-out task.");if(n.has(g.id))throw new Error("Training task identities must be unique.");n.add(g.id),s.add(g.clusterKey)}let o=new Set;for(let g of l){if(g.split==="train")throw new Error("The evaluation population contains a training task.");if(o.has(g.id))throw new Error("Evaluation task identities must be unique.");if(n.has(g.id)||s.has(g.clusterKey))throw new Error("Training and evaluation tasks or families overlap.");o.add(g.id)}}m(Ut,"assertTrainingEvaluationIsolation");async function zt(t){let i=De.parse(t),a=await h(i);return{taskset:i.taskset,dataset:{id:`training-evaluation-${a.slice(0,32)}`,contentHash:a}}}m(zt,"trainingEvaluationSourceRef");var r=e.string().trim().min(1).max(200),f=e.string().regex(/^[a-f0-9]{64}$/),P=e.object({id:r,contentHash:f}).strict(),Qt=e.object({available:e.boolean(),reason:e.string().max(1e3).nullable(),origin:_.nullable()}).strict(),le=e.object({schemaVersion:e.literal("openpond.postTrainingAttachment.v1"),binding:e.object({kind:e.enum(["preparation","policy"]),id:r,revision:e.number().int().positive(),contentHash:f}).strict(),projectId:r.nullable(),automatic:e.boolean(),maximumSpendUsd:e.number().finite().positive().max(1e4),experiments:e.array(e.object({id:r,configuration:U}).strict()).min(1).max(20),acceptancePlan:K.nullable()}).strict().superRefine((t,i)=>{if(new Set(t.experiments.map(a=>a.id)).size!==t.experiments.length&&i.addIssue({code:"custom",message:"Attach each evaluation once."}),t.experiments.reduce((a,l)=>a+l.configuration.maximumCostUsd,0)>t.maximumSpendUsd+1e-9&&i.addIssue({code:"custom",message:"Attached evaluation budgets exceed the total approved budget."}),t.experiments.some(a=>(a.configuration.request.project?.id??null)!==t.projectId)&&i.addIssue({code:"custom",message:"Attached experiments must use the training Project."}),t.acceptancePlan){let a=new Set(t.acceptancePlan.checks.map(n=>n.id));t.acceptancePlan.checks.some(n=>!t.experiments.some(s=>s.id===n.id))&&i.addIssue({code:"custom",message:"Select the frozen Experiment for each acceptance check."}),t.acceptancePlan.maximumSpendUsd+t.experiments.filter(n=>!a.has(n.id)).reduce((n,s)=>n+s.configuration.maximumCostUsd,0)>t.maximumSpendUsd+1e-9&&i.addIssue({code:"custom",message:"Paired acceptance and diagnostic ceilings exceed the approved evaluation budget."})}});var Fe=e.object({baseline:P,checks:e.array(e.object({id:r,sourceRunId:r,sourceManifestHash:f,targetConfigurationHash:f,executionHash:f,populationHash:f,evaluator:P,feedbackKey:r,output:e.enum(["boolean","score"]),unit:e.string().min(1).max(80)}).strict()).min(1).max(100)}).strict(),Qe=e.enum(["waiting_for_training","ready","preparing","queued","running","cleaning","completed","failed","blocked","cancelled","budget_exhausted"]),de=e.object({schemaVersion:e.literal("openpond.postTrainingSummary.v1"),id:r,teamId:r,jobId:r,revision:e.number().int().positive(),planHash:f,automatic:e.boolean(),candidate:P.nullable(),state:Qe,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:r.nullable(),experimentIds:e.array(r).max(20),updatedAt:e.iso.datetime()}).strict().superRefine((t,i)=>{t.completed+t.failed>t.total&&i.addIssue({code:"custom",message:"Evaluation totals are inconsistent."}),["preparing","queued","running","cleaning","completed"].includes(t.state)&&!t.candidate&&i.addIssue({code:"custom",message:"Evaluation execution requires the exact trained candidate."})}),Le=e.object({operationId:r,expectedRevision:e.number().int().positive(),planHash:f}).strict(),We=e.object({operationId:r,attachment:le}).strict(),Ke=e.object({id:r,teamId:r,ownerUserId:r,attachment:le,qualification:Fe.nullable(),contentHash:f,createdAt:e.iso.datetime()}).strict();function Xe(t){let i=Ke.parse(t);if(i.contentHash!==X({attachment:i.attachment,qualification:i.qualification}))throw new Error("The retained evaluation attachment or qualification changed.");return i}m(Xe,"verifyPostTrainingPlan");function Lt(t){let{request:i}=t,a={accept:"application/json","content-type":"application/json"},l=m(s=>`/v1/training/jobs/${encodeURIComponent(r.parse(s))}/post-training`,"path");async function n(s,o,g){if(s===null)return null;let v=de.parse(s);if(v.teamId!==o||v.jobId!==g)throw new p("post_training_scope_mismatch","The evaluation summary belongs to another run or workspace.");return v}return m(n,"read"),{async attach(s,o){let g=We.parse(o),v=Xe(await i("/v1/training/post-training-plans",{method:"POST",headers:a,body:JSON.stringify(g)}));if(v.teamId!==s||await h(v.attachment)!==await h(g.attachment))throw new p("post_training_plan_mismatch","The retained attachment differs from the reviewed plan.");return v},async get(s,o){return n(await i(l(o),{headers:a}),s,o)},async control(s,o,g,v){let J=Le.parse(v),A=await n(await i(`${l(o)}/${g}`,{method:"POST",headers:a,body:JSON.stringify(J)}),s,o);if(!A||A.planHash!==J.planHash)throw new p("post_training_control_mismatch","Evaluation control did not retain the approved plan.");return A}}}m(Lt,"createPostTrainingClient");var Wt=e.object({teamId:r,actorId:r,projectId:r.nullable(),configuration:M,batches:e.array(F).max(1e4),sources:e.array(D).max(1e4),definitions:e.array(N).max(1e4),experiments:e.array(e.object({id:r,name:e.string().max(500),configuration:U,graders:e.array(e.object({feedbackKey:r,name:e.string().max(500),ref:P}).strict()).max(100)}).strict()).max(1e4)}).strict(),Kt=e.enum(["hardware-catalog","gpu-catalog","modification-capabilities","estimate","funding","funding-handoff","list-drafts","get-draft","save-draft","archive-draft","prepare","prepare-draft","save-experiment-learning","review-dataset","start","cancel","publish","attach"]),Xt=e.object({teamId:r,actorId:r,configuration:M,policy:Q,inspection:W,iterations:e.array(e.object({iteration:L,evals:de.nullable()}).strict()).max(100),nextCursor:r.nullable()}).strict(),Yt=e.object({id:r,expectedRevision:e.number().int().positive(),policyHash:f,operationId:r,action:e.enum(["pause","resume","reserve","cancel-iteration","retry-iteration"]),iterationId:r.optional(),iterationRevision:e.number().int().positive().optional()}).strict();export{y as a,Ze as b,ne as c,rt as d,ge as e,ot as f,st as g,fe as h,mt as i,ve as j,Se as k,lt as l,B as m,ut as n,pt as o,xe as p,ye as q,Ie as r,_e as s,St as t,je as u,xt as v,se as w,we as x,Te as y,Re as z,ke as A,ce as B,Ae as C,qe as D,Me as E,Ue as F,ze as G,Ee as H,Ce as I,Be as J,yt as K,It as L,_t as M,jt as N,Ve as O,me as P,V as Q,Je as R,wt as S,Oe as T,Tt as U,Ge as V,Rt as W,kt as X,At as Y,Mt as Z,De as _,Ut as $,zt as aa,Qt as ba,le as ca,de as da,Le as ea,We as fa,Xe as ga,Lt as ha,Wt as ia,Kt as ja,Xt as ka,Yt as la};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{
|
|
2
|
+
import{Ei as T,Je as p,aj as E,fe as g,gi as l,ji as h,ki as m,li as w,ri as f}from"./chunk-XJU47QS2.js";import{c as a,f as u,h as d}from"./chunk-3M53YXEI.js";import{a as c}from"./chunk-FTQLQJQV.js";var I=new Set(["hosted-neuron-training-capability","hosted-compile-neuron-training","hosted-prepare-neuron-training","hosted-start-neuron-training","hosted-cancel-neuron-training","hosted-neuron-training-execution","hosted-neuron-training-executions","hosted-save-neuron-training-model","hosted-control-neuron-training-serving","hosted-neuron-training-serving"]);async function M(S){let{action:e,target:s,teamId:r,options:t,client:i,readInput:x}=S;if(e==="hosted-neuron-training-execution"){if(!s)throw new Error("Supply the original NeuronTraining execution ID.");return i.getNeuronTrainingExecution(r,s)}if(e==="hosted-neuron-training-executions"){if(s)throw new Error("List NeuronTraining executions using filters.");let n=f.parse(Object.fromEntries(Object.entries({id:a(t,"id")||void 0,projectId:a(t,"projectId")||void 0,phase:a(t,"phase")||void 0,cursor:a(t,"cursor")||void 0,limit:d(t.limit,"--limit")}).filter(([,N])=>N!==void 0)));return i.listNeuronTrainingExecutions(r,n)}let o=await x();if(e==="hosted-neuron-training-serving"){let n=T.parse(o);return i.neuronTrainingModelServing(n.modelProjectId,{teamId:r,versionHash:n.versionHash})}if(e==="hosted-control-neuron-training-serving"){let n=E.parse(o);if(n.request.teamId!==r)throw new Error("Use the Model's original workspace.");if(n.request.action==="activate"&&!u(t.yes))throw new Error("Activating billed serving capacity requires --yes.");return i.controlNeuronTrainingModelServing(n.modelProjectId,n.request)}if(e==="hosted-neuron-training-capability"){let n=g.parse(o);if(n.teamId!==r)throw new Error("Use this input's original workspace.");return i.neuronTrainingExecutionCapability(n)}if(e==="hosted-compile-neuron-training"){let n=l.parse(o);if(n.teamId!==r)throw new Error("Use this input's original workspace.");return i.compileNeuronTrainingExecution(n)}if(e==="hosted-prepare-neuron-training"){let n=h.parse(o);if(n.teamId!==r)throw new Error("Use this input's original workspace.");return i.prepareNeuronTrainingExecution(n)}if(e==="hosted-start-neuron-training"){let n=m.parse(o);if(n.teamId!==r)throw new Error("Use this execution's original workspace.");if(!u(t.yes))throw new Error("Starting paid selective neuron training execution requires --yes.");return i.startNeuronTrainingExecution(n)}if(e==="hosted-cancel-neuron-training"){let n=w.parse(o);if(n.teamId!==r)throw new Error("Use this execution's original workspace.");return i.cancelNeuronTrainingExecution(n)}if(e==="hosted-save-neuron-training-model"){let n=p.parse(o);if(n.teamId!==r)throw new Error("Use this result's original workspace.");return i.saveNeuronTrainingResultModel(n)}throw new Error("Unsupported NeuronTraining command.")}c(M,"runHostedNeuronTrainingCommand");export{I as a,M as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{b as Ne}from"./chunk-SYUKES6H.js";import{a as B,b as G,c as ze,d as Le,e as q,f as ie,i as de,o as Be,q as ce}from"./chunk-U7X5ZLAL.js";import{a as ue}from"./chunk-2ACX7IW5.js";import{k as ae,m as se,n as Pe}from"./chunk-OQPJ7FJF.js";import{c as Te}from"./chunk-Y4I6CFZJ.js";import{E as L}from"./chunk-WGQ3FMRF.js";import{f as K,m as f,n as _e}from"./chunk-HIQPGYVH.js";import{a as Ce}from"./chunk-HLJJAOI2.js";import{a as Oe,c as $e,d as je}from"./chunk-AMC4Z7G4.js";import{l as J,m as qe}from"./chunk-I6VMRQF4.js";import{h as Ue}from"./chunk-4PUOWSDE.js";import{Sa as Ae,ea as Ee,wb as ke}from"./chunk-ZY32SZ2P.js";import{a as re,b as oe}from"./chunk-KUE46HTH.js";import{b as z}from"./chunk-MZKCW6CB.js";import{A as a}from"./chunk-X2J2P5ZT.js";import{a as d}from"./chunk-FTQLQJQV.js";function jt(t,e){let n=t.token?.trim();if(!n||t.accountState.state!=="signed_in"||!t.accountState.activeProfile)throw new Error("A signed-in OpenPond account is required.");let r=Ce(t.apiBaseUrl,{apiBaseUrl:t.apiBaseUrl}),o=/\/api\/sandboxes\/?$/.test(r)?r.replace(/\/api\/sandboxes\/?$/,"/v1"):r.replace(/\/sandboxes\/?$/,"");return{audience:new URL(o).origin,async request(s){let i=n.startsWith("opk_"),u=await z(o,n,s.path,{method:s.method??"GET",signal:s.signal,explicitBearerAuth:!i,headers:{...i?{"openpond-api-key":n}:{},...s.idempotencyKey?{"idempotency-key":s.idempotencyKey}:{},...e?{"X-OpenPond-Team-Id":e}:{}},...s.body?{body:JSON.stringify(s.body)}:{},...s.timeoutMs!==void 0?{timeoutMs:s.timeoutMs}:{}}),c=await u.json().catch(()=>({}));if(!u.ok)throw new Error(typeof c.error=="string"?c.error:`OpenPond API request failed with status ${u.status}`);return c}}}d(jt,"createCapturedOpenPondPublicApiClient");import{AsyncLocalStorage as _t}from"node:async_hooks";var Tt=new _t;function zt(){return Tt.getStore()}d(zt,"apiClientIdentity");var Lt=3e4,Bt=8*1024*1024,Gn={timeoutMs:900*1e3,maxResponseBytes:64*1024*1024},Fe=class extends Error{static{d(this,"ApiTimeoutError")}timeoutMs;requestUrl;code="OPENPOND_API_TIMEOUT";constructor(t,e){super(`API request timed out after ${t}ms: ${e}`),this.timeoutMs=t,this.requestUrl=e,this.name="ApiTimeoutError"}},pe=class extends Error{static{d(this,"ApiResponseTooLargeError")}maximumBytes;requestUrl;code="OPENPOND_API_RESPONSE_TOO_LARGE";constructor(t,e){super(`API response exceeded ${t} bytes: ${e}`),this.maximumBytes=t,this.requestUrl=e,this.name="ApiResponseTooLargeError"}},He=class extends Error{static{d(this,"OpenPondApiError")}status;apiMessage;code;constructor(t,e,n,r=null){let o=r||e;super(`${n} failed: ${t}${o?` ${o}`:""}`),this.status=t,this.apiMessage=r,this.name="OpenPondApiError",this.code=e||"OPENPOND_API_ERROR"}};async function W(t,e,n,r={}){let{timeoutMs:o=Lt,maxResponseBytes:s=Bt,explicitBearerAuth:i=!1,...u}=r,c=`${t}${n}`,p=new Headers(u.headers),I=zt();I&&!i&&p.set("x-openpond-client",I),p.set("Content-Type","application/json");let l=i?void 0:process.env.OPENPOND_API_KEY,g=e?.trim()||"",P=!i&&g.startsWith("opk_"),te=l||(P?g:null);te&&!p.has("openpond-api-key")&&p.set("openpond-api-key",te),e?p.set("Authorization",P?`ApiKey ${g}`:`Bearer ${e}`):l&&!p.has("Authorization")&&p.set("Authorization",`ApiKey ${l}`);let U=new AbortController,j=new Fe(o,c),T=o>0?setTimeout(()=>U.abort(j),o):null;T?.unref?.();let ne=Ft(u.signal,U.signal,o),A=d(()=>{T&&clearTimeout(T)},"cleanup");try{let R=await fetch(c,{...u,headers:p,signal:ne});return Nt(R,{cleanup:A,maximumBytes:s,requestUrl:c,timeoutController:U,timeoutError:j})}catch(R){throw A(),U.signal.aborted?j:R}}d(W,"apiFetch");async function me(t,e){let n;try{let r=await t.text();n=r?JSON.parse(r):{}}catch(r){if(r instanceof Fe||r instanceof pe)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 He(t.status,r,e,o)}return n}d(me,"readApiJson");function Nt(t,e){if(!t.body)return e.cleanup(),t;let n=Number(t.headers.get("content-length"));if(e.maximumBytes>0&&Number.isFinite(n)&&n>e.maximumBytes)throw e.cleanup(),t.body.cancel(),new pe(e.maximumBytes,e.requestUrl);let r=t.body.getReader(),o=0,s=new ReadableStream({async pull(i){try{let u=await r.read();if(u.done){e.cleanup(),i.close();return}if(o+=u.value.byteLength,e.maximumBytes>0&&o>e.maximumBytes){e.cleanup(),await r.cancel(),i.error(new pe(e.maximumBytes,e.requestUrl));return}i.enqueue(u.value)}catch(u){e.cleanup(),i.error(e.timeoutController.signal.aborted?e.timeoutError:u)}},async cancel(i){e.cleanup(),await r.cancel(i)}});return new Response(s,{headers:t.headers,status:t.status,statusText:t.statusText})}d(Nt,"boundedResponse");function Ft(t,e,n){return n<=0?t??void 0:t?AbortSignal.any([t,e]):e}d(Ft,"composedSignal");var C=a.string().min(1).max(200),_=a.string().regex(/^[a-f0-9]{64}$/),le=a.object({operationId:C,name:a.string().trim().min(1).max(500),projectId:C,dataset:K.extend({revision:a.number().int().positive()}).strict(),caseIds:a.array(C).min(1).max(1e4)}).strict().superRefine((t,e)=>{new Set(t.caseIds).size!==t.caseIds.length&&e.addIssue({code:"custom",message:"Select each case once."})}),Ht=B.extend({inputHash:_,outputHash:_.nullable(),task:Ee,taskHash:_}).strict(),Mt=a.object({schemaVersion:a.literal("openpond.connectedRecordedExecution.v1"),id:C,teamId:C,ownerUserId:C,request:le,manifest:ke,sources:a.array(Ht).min(1).max(1e4),contentHash:_}).strict();function Me(t){let e=Mt.parse(t),{contentHash:n,...r}=e,{contentHash:o,...s}=e.manifest;if(f(r)!==n||f(s)!==o||e.manifest.teamId!==e.teamId||e.manifest.id!==e.id||e.manifest.operationId!==e.request.operationId||f(e.manifest.dataset)!==f(e.request.dataset)||e.sources.length!==e.request.caseIds.length||e.sources.length!==e.manifest.population.length||e.sources.some((i,u)=>i.taskHash!==f(i.task)||i.task.id!==e.request.caseIds[u]||i.boundaryId!==i.task.id||e.manifest.population[u]?.caseId!==i.boundaryId))throw new Error("Recorded execution identity or population integrity failed.");return e}d(Me,"verifyConnectedRecordedExecution");var Dt=a.object({projectId:C.optional(),cursor:C.optional(),limit:a.number().int().min(1).max(50).default(20)}).strict(),Jt=a.object({id:C,teamId:C,ownerUserId:C,projectId:C,name:a.string().min(1).max(500),dataset:le.shape.dataset,manifestHash:_,contentHash:_,caseCount:a.number().int().min(1).max(1e4),createdAt:a.string().datetime()}).strict(),Kt=a.object({teamId:C,items:a.array(Jt).max(50),nextCursor:C.nullable()}).strict(),Gt=a.object({datasetId:a.string().trim().min(1).max(240),expectedRevision:a.number().int().positive(),operationId:a.string().trim().min(1).max(240),graders:a.array(Ae).min(1).max(100).optional()}).strict().superRefine((t,e)=>{t.graders&&new Set(t.graders.map(n=>n.id)).size!==t.graders.length&&e.addIssue({code:"custom",path:["graders"],message:"Choose one exact revision of each grader."})}),N=a.string().min(1).max(500),k=a.number().int().nonnegative(),Wt=a.object({teamId:N,ownerUserId:N,projectId:N.nullable(),status:a.enum(["active","paused","archived"]),revision:k,state:a.enum(["collecting","pending","attention","paused","archived"]),lastReconciledAt:a.string().datetime().nullable(),lastCapturedAt:a.string().datetime().nullable(),historyDays:a.number().int().positive(),sources:k,tasks:k,datasets:a.array(a.object({datasetId:N,projection:a.enum(["turn","conversation"]),revision:k}).strict()).max(2),latestBatch:a.object({operationId:N,updatedAt:a.string().datetime(),scanned:k,captured:k,unchanged:k,pending:k,failed:k,excluded:k,paused:k,hasMore:a.boolean()}).strict().nullable()}).strict(),h=a.string().min(1).max(500),E=a.string().regex(/^[a-f0-9]{64}$/),De=a.object({teamId:h,projectId:h.nullable(),status:a.enum(["active","paused","archived"]),revision:a.number().int().nonnegative()}).strict(),Xt=a.object({teamId:h,operationId:h,projectId:h.nullable(),outcomes:a.array(a.object({conversationId:h,state:a.enum(["captured","unchanged","pending","paused","excluded","failed"]),sourceId:h.optional(),snapshotHash:E.optional(),reason:a.string().optional()}).strict()).max(50),nextCursor:h.nullable()}).strict(),Vt=a.object({teamId:h,ref:B,origin:G.shape.source,sessionId:h,projectId:h,capturedAt:a.string().datetime(),unmappedEvidence:a.object({count:a.number().int().nonnegative().max(1e5),contentHash:E}).strict(),evidence:a.object({input:a.array(J),observed:a.array(J),answer:a.json(),boundary:qe}).strict()}).strict(),Yt=a.object({teamId:h,sourceId:h,snapshotHash:E,contentHash:E,count:a.number().int().nonnegative(),offset:a.number().int().nonnegative(),events:a.array(J).max(50),nextOffset:a.number().int().nonnegative().nullable()}).strict(),Zt=a.object({teamId:h,source:q.shape.source,sourceHash:E,previewHash:E,destination:q.shape.destination,issues:a.array(a.object({file:a.string(),message:a.string()}).strict()).max(100),sessions:a.array(a.object({sessionHash:E,sessionId:h,origin:G.shape.source,exporterVersion:a.string().nullable(),eventCount:a.number().int().nonnegative(),boundaries:a.array(a.object({id:h,projection:a.enum(["turn","conversation"]),answer:a.boolean(),process:a.enum(["retained","partial","absent"]),terminal:a.enum(["completed","failed","cancelled","unknown"])}).strict()).max(5001),warnings:a.array(a.string()).max(100),sample:a.array(a.object({role:a.enum(["user","assistant","system","tool"]).nullable(),text:a.string().max(4e3)}).strict()).max(3)}).strict()).max(1e3)}).strict(),Je=a.object({teamId:h,operationId:h,requestHash:E,previewHash:E,projectId:h.optional(),state:a.enum(["admitting","publishing","completed","failed"]),outcomes:a.array(a.object({sessionHash:E,sourceId:h,status:a.enum(["imported","already_present"]),datasets:a.array(a.object({datasetId:h,revision:a.number().int().positive(),changed:a.boolean()}).strict()).max(2)}).strict()).max(1e3),error:a.string().optional()}).strict(),Ke=class extends Error{static{d(this,"ConnectedEvidenceError")}constructor(t,e,n){super(n),this.status=t,this.code=e,this.name="ConnectedEvidenceError"}status;code},pr=class{static{d(this,"ConnectedEvidenceClient")}constructor(t){this.options=t;let e=new URL(t.baseUrl);if(!["http:","https:"].includes(e.protocol)||e.username||e.password||e.search||e.hash||!t.apiKey.trim()||!t.teamId.trim())throw new Error("A clean API origin and workspace credentials are required.");this.baseUrl=e.toString().replace(/\/+$/,"")}options;baseUrl;async capture(t,e){let n=ze.parse(t),r=Xt.parse(await this.request("/capture","POST",n,e));if(this.scope(r.teamId),r.operationId!==n.operationId||r.outcomes.length>n.limit||n.conversationId&&r.outcomes.some(o=>o.conversationId!==n.conversationId))throw new Error("Capture receipt differs from its requested source or operation.");return r}async retainStartingAssets(t,e){let n=Be.parse(t),r=ce(await this.request("/starting-assets","POST",n,e));if(this.scope(r.teamId),r.operationId!==n.operationId||r.requestHash!==f(n)||f(r.source)!==f(n.source)||r.assets.length!==n.proofs.length||r.assets.some((o,s)=>o.path!==n.proofs[s].path))throw new Error("Starting assets differ from the exact source, operation or selected paths.");return r}async startingAssets(t,e){let n=ce(await this.request(`/starting-assets/${encodeURIComponent(h.parse(t))}`,"GET",void 0,e));if(this.scope(n.teamId),n.id!==t)throw new Error("Starting assets identity mismatch.");return n}async list(t={},e){let n=a.object({projectId:h.optional(),cursor:h.optional(),limit:a.number().int().min(1).max(50).default(20)}).strict().parse(t),r=new URLSearchParams(Object.entries(n).filter(([,s])=>s!==void 0).map(([s,i])=>[s,String(i)])),o=a.object({teamId:h,items:a.array(G).max(50),nextCursor:h.nullable()}).strict().parse(await this.request(`?${r}`,"GET",void 0,e));if(this.scope(o.teamId),o.items.length>n.limit||new Set(o.items.map(s=>s.sourceId)).size!==o.items.length||o.nextCursor!==null&&o.nextCursor===n.cursor||n.projectId&&o.items.some(s=>s.projectId!==n.projectId))throw new Error("Connected source page differs from its requested scope.");return o}async read(t,e){let n=B.parse(t),r=Vt.parse(await this.request(`/${encodeURIComponent(n.id)}/cases/${encodeURIComponent(n.boundaryId)}?snapshotHash=${n.snapshotHash}&revisionHash=${n.boundaryRevisionHash}`,"GET",void 0,e));if(this.scope(r.teamId),f(r.ref)!==f(n)||r.evidence.boundary.id!==n.boundaryId||r.evidence.boundary.revisionHash!==n.boundaryRevisionHash||f(r.evidence.input)!==r.evidence.boundary.inputHash||f(r.evidence.observed)!==n.boundaryRevisionHash||r.evidence.boundary.outputHash!==null&&f(r.evidence.answer)!==r.evidence.boundary.outputHash)throw new Error("Connected case readback differs from its exact snapshot or cutoff.");return r}async setCollection(t,e){let n=De.parse(await this.request("/collection","PUT",a.object({paused:a.boolean()}).strict().parse({paused:t}),e));return this.scope(n.teamId),n}async collection(t){let e=De.parse(await this.request("/collection","GET",void 0,t));return this.scope(e.teamId),e}async collectionStatus(t){let e=Wt.parse(await this.request("/collection/status","GET",void 0,t));return this.scope(e.teamId),e}async unmappedEvents(t,e){let n=a.object({id:h,snapshotHash:E,contentHash:E,offset:a.number().int().nonnegative().default(0),limit:a.number().int().min(1).max(50).default(20)}).strict().parse(t),r=Yt.parse(await this.request(`/${encodeURIComponent(n.id)}/unmapped-events?snapshotHash=${n.snapshotHash}&offset=${n.offset}&limit=${n.limit}`,"GET",void 0,e));if(this.scope(r.teamId),r.sourceId!==n.id||r.snapshotHash!==n.snapshotHash||r.contentHash!==n.contentHash||r.offset!==n.offset||r.events.length>n.limit||r.events.some((o,s)=>o.sequence!==n.offset+s)||r.nextOffset!==null&&r.nextOffset!==n.offset+r.events.length)throw new Error("Unmapped source event page differs from its pinned snapshot.");return r}async homeSummary(t,e){let n=a.object({from:a.string().datetime(),to:a.string().datetime(),projectId:h.optional()}).strict(),r=n.parse(t),o=new URLSearchParams(Object.entries(r)),s=a.object({teamId:h,range:n,activity:a.object({conversations:a.number().int().nonnegative(),turns:a.number().int().nonnegative(),chatTurns:a.number().int().nonnegative(),workTurns:a.number().int().nonnegative()}).strict(),accounting:a.object({contextSnapshots:a.number().int().nonnegative()}).strict(),usage:Oe}).strict().parse(await this.request(`/summary?${o}`,"GET",void 0,e));if(this.scope(s.teamId),f(s.range)!==f(r)||s.activity.chatTurns+s.activity.workTurns!==s.activity.turns)throw new Error("Activity summary differs from its requested range.");for(let i of[s.usage.days,s.usage.modes,s.usage.models]){if(new Set(i.map(u=>u.key)).size!==i.length)throw new Error("Duplicate usage summary group.");for(let u of Object.keys(s.usage.total))if(i.reduce((c,p)=>c+p[u],0)!==s.usage.total[u])throw new Error("Usage totals differ from their displayed groups.")}return s}async uploadPart(t,e){let n=Le.parse(t),r=a.object({teamId:h,hash:E,parts:a.number().int(),index:a.number().int()}).strict().parse(await this.request("/imports/upload","POST",n,e));if(this.scope(r.teamId),r.hash!==n.hash||r.parts!==n.parts||r.index!==n.index)throw new Error("Upload receipt differs from its part identity.");return r}async preview(t,e){let n=q.parse(t),r=Zt.parse(await this.request("/imports/preview","POST",n,e));if(this.scope(r.teamId),r.source!==n.source||f(r.destination)!==f(n.destination)||r.sessions.some(o=>o.origin!==n.source)||new Set(r.sessions.map(o=>o.sessionHash)).size!==r.sessions.length)throw new Error("Import preview differs from its source or destination.");return r}async commit(t,e){let n=ie.parse(t),r=Je.parse(await this.request("/imports/commit","POST",n,e));if(this.scope(r.teamId),r.operationId!==n.operationId||r.previewHash!==n.previewHash||r.requestHash!==f(n)||r.outcomes.some(o=>!n.selection.some(s=>s.sessionHash===o.sessionHash))||r.state==="completed"&&r.outcomes.length!==n.selection.length)throw new Error("Import receipt differs from its exact selection or operation.");return r}async readImport(t,e){let n=h.parse(t),r=Je.parse(await this.request(`/imports/${encodeURIComponent(n)}`,"GET",void 0,e));if(this.scope(r.teamId),r.operationId!==n)throw new Error("Import identity mismatch.");return r}async prepareRecorded(t,e){let n=le.parse(t),r=Me(await this.request("/recorded-executions","POST",n,e));if(this.scope(r.teamId),f(r.request)!==f(n))throw new Error("Recorded admission differs from its selected Dataset/cases.");return r}async listRecordedExecutions(t={},e){let n=Dt.parse(t),r=new URLSearchParams(Object.entries(n).filter(([,s])=>s!==void 0).map(([s,i])=>[s,String(i)])),o=Kt.parse(await this.request(`/recorded-executions?${r}`,"GET",void 0,e));if(this.scope(o.teamId),o.items.length>n.limit||o.items.some((s,i)=>s.teamId!==o.teamId||n.projectId&&s.projectId!==n.projectId||n.cursor&&s.id<=n.cursor||i>0&&s.id<=o.items[i-1].id)||o.items.some(s=>s.ownerUserId!==o.items[0]?.ownerUserId)||o.nextCursor!==null&&(n.cursor!==void 0&&o.nextCursor<=n.cursor||o.items.length>0&&o.nextCursor<o.items.at(-1).id))throw new Error("Recorded execution page differs from its requested scope or cursor.");return o}async recordedExecution(t,e){let n=Me(await this.request(`/recorded-executions/${encodeURIComponent(h.parse(t))}`,"GET",void 0,e));if(this.scope(n.teamId),n.id!==t)throw new Error("Recorded execution identity mismatch.");return n}async publishDataset(t,e){let n=Gt.parse(t),r=de.parse(await this.request("/datasets/publish","POST",n,e));this.scope(r.teamId);let o=r.workspace.draft.metadata.connectedPublication;if(r.datasetId!==n.datasetId||!r.publication||!o||typeof o!="object"||!("requestHash"in o)||o.requestHash!==f(n))throw new Error("Published Dataset identity or original selection mismatch.");return r}async createSelection(t,e){let n=a.object({operationId:h.max(240),projectId:h.max(240),name:a.string().trim().min(1).max(200),cases:a.array(B).min(1).max(500)}).strict().parse(t),r=de.parse(await this.request("/datasets/selection","POST",n,e));if(this.scope(r.teamId),r.originProjectId!==n.projectId||r.workspace.draft.tasks.length!==n.cases.length||r.workspace.draft.tasks.some((o,s)=>f(o.input&&typeof o.input=="object"&&!Array.isArray(o.input)?o.input.connectedEvidenceRef:null)!==f(n.cases[s])))throw new Error("Selected Dataset differs from its exact source population.");return r}scope(t){if(t!==this.options.teamId)throw new Error("Connected evidence workspace mismatch.")}async request(t,e,n,r){let{response:o,value:s}=await Te(this.options.fetch??fetch,`${this.baseUrl}/v1/connected-evidence${t}`,{method:e,signal:r,redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"X-OpenPond-Team-Id":this.options.teamId,"Content-Type":"application/json",Accept:"application/json"},...n===void 0?{}:{body:JSON.stringify(n)}},(i,u,c)=>new Ke(i,u,c));if(!o.ok){let i=a.object({code:a.string(),message:a.string()}).safeParse(s);throw new Ke(o.status,i.success?i.data.code:"connected_request_failed",i.success?i.data.message:"Connected evidence request failed.")}return s}},b=a.string().trim().min(1).max(240),hr=a.object({id:b,expectedRevision:a.number().int().positive(),manifest:$e}).strict().refine(t=>t.id===t.manifest.connectionId&&t.expectedRevision===t.manifest.connectionRevision,"Collector coverage scope differs from its connection."),fr=a.object({id:b,cutoff:a.iso.datetime().optional()}).strict(),yr=a.object({schemaVersion:a.literal("openpond.connectedSyncCoverageReceipt.v1"),id:b,teamId:b,ownerUserId:b,connectionId:b,connectionRevision:a.number().int().positive(),receivedAt:a.iso.datetime(),summary:je}).strict(),gr=a.object({id:b,source:q.shape.source,machineId:b,sourceInstanceId:b,sourceLabel:a.string().trim().min(1).max(200),sourceRoot:a.string().min(1).max(2e3),destination:q.shape.destination,since:a.string().datetime().nullable(),keepSyncing:a.boolean(),expectedRevision:a.number().int().nonnegative()}).strict(),br=a.object({id:b,expectedRevision:a.number().int().positive(),action:a.enum(["pause","resume","disconnect"])}).strict(),Ir=a.object({id:b,operationId:b,expectedRevision:a.number().int().positive()}).strict(),Sr=a.object({id:b,expectedRevision:a.number().int().positive(),pendingOperations:a.number().int().min(0).max(1e4),error:a.string().max(500).nullable(),completedSyncRevision:a.number().int().nonnegative().default(0)}).strict(),wr=a.object({teamId:b,id:b,revision:a.number().int().positive(),source:q.shape.source,sourceLabel:a.string(),sourceRoot:a.string(),taskDatasetId:b.nullable(),conversationDatasetId:b.nullable(),machineId:b,sourceInstanceId:b,projectId:b,datasetIds:a.array(b).max(2),since:a.string().datetime().nullable(),keepSyncing:a.boolean(),state:a.enum(["active","paused","disconnected"]),health:a.enum(["online","offline"]),lastHeartbeatAt:a.string().datetime().nullable(),lastAdmissionAt:a.string().datetime().nullable(),pendingOperations:a.number().int().nonnegative(),admittedTasks:a.number().int().nonnegative(),error:a.string().nullable(),requestedSyncRevision:a.number().int().nonnegative().default(0),completedSyncRevision:a.number().int().nonnegative().default(0),syncRequestedAt:a.string().datetime().nullable().default(null),syncCompletedAt:a.string().datetime().nullable().default(null)}).strict().refine(t=>t.completedSyncRevision<=t.requestedSyncRevision&&t.requestedSyncRevision<=t.revision,"Invalid sync acknowledgement generation."),xr=a.object({connectionId:b,expectedRevision:a.number().int().positive(),request:ie}).strict();function Ur(t){let e=d(r=>`/v1/training/candidate-evaluations/${encodeURIComponent(r)}`,"path");function n(r,o,s){let i=tn.parse(r);if(i.teamId!==o||s&&i.id!==s)throw new Error("The preparation belongs to another workspace or candidate operation.");return i}return d(n,"read"),{async options(r,o={}){let s=new URLSearchParams({teamId:r,...o}),i=en.parse(await t(`/v1/training/candidates?${s}`));if(i.teamId!==r)throw new Error("The candidate catalog belongs to another workspace.");return i},async save(r){let o=We.parse(r),s=n(await t(`/v1/training/candidate-evaluations?teamId=${encodeURIComponent(o.teamId)}`,{method:"POST",body:JSON.stringify(o)}),o.teamId);if(s.requestHash!==f(o))throw new Error("The saved preparation differs from the selected candidate or frozen evaluation.");return s},async get(r,o){return n(await t(`${e(o)}?teamId=${encodeURIComponent(r)}`),r,o)},async control(r,o,s,i){let u=nn.parse(i),c=n(await t(`${e(o)}/${s}?teamId=${encodeURIComponent(r)}`,{method:"POST",body:JSON.stringify(u)}),r,o);if(c.requestHash!==u.requestHash)throw new Error("The command returned a different frozen evaluation.");return c}}}d(Ur,"createCandidateEvaluationClient");var S=a.string().trim().min(1).max(200),he=a.string().regex(/^[a-f0-9]{64}$/),Ge=a.object({id:S,contentHash:he}).strict(),Qt=a.object({artifact:Ge,trainingJobId:S,configurationId:S,baseProfileId:S,ready:a.boolean(),reason:a.string().max(1e3).nullable()}).strict(),en=a.object({teamId:S,ownerUserId:S,items:a.array(Qt).max(100),nextCursor:S.nullable()}).strict(),We=a.object({teamId:S,operationId:S,artifact:Ge,configuration:L}).strict().superRefine((t,e)=>{(t.configuration.request.teamId!==t.teamId||t.configuration.request.policy.kind==="fixture"||t.configuration.request.policy.candidate)&&e.addIssue({code:"custom",message:"Choose one exact model-backed evaluation before preparing the trained version."})}),tn=a.object({schemaVersion:a.literal("openpond.candidateEvaluationPreparation.v1"),teamId:S,ownerUserId:S,id:S,revision:a.number().int().positive(),requestHash:he,request:We,trainingJobId:S,dispatchId:S,lastOperationId:S.nullable(),runtime:a.object({poolId:S,endpointId:S.nullable(),baseProfileId:S,workerImageDigest:a.string().regex(/^sha256:[a-f0-9]{64}$/),modelId:S.nullable()}).strict().nullable(),state:a.enum(["configured","preparing","ready","dispatching","submitted","cleaning","completed","failed","cancelled"]),experimentId:S.nullable(),authorizedAt:a.iso.datetime().nullable(),cancelledAt:a.iso.datetime().nullable(),reason:a.string().max(1e3).nullable(),createdAt:a.iso.datetime(),updatedAt:a.iso.datetime()}).strict().superRefine((t,e)=>{(t.requestHash!==f(t.request)||!t.runtime&&["ready","dispatching","submitted","completed"].includes(t.state))&&e.addIssue({code:"custom",message:"The exact candidate preparation request or runtime changed."})}),nn=a.object({operationId:S,expectedRevision:a.number().int().positive(),requestHash:he}).strict();var x=a.string().trim().min(1).max(200),F=a.string().regex(/^[a-f0-9]{64}$/),H=a.string().datetime(),Xe=a.object({operationId:x,id:x.optional(),expectedRevision:a.number().int().nonnegative(),teamId:x,projectId:x.nullable(),enabled:a.boolean(),configuration:L,cadence:a.discriminatedUnion("kind",[a.object({kind:a.literal("interval"),seconds:a.number().int().min(60).max(31536e3)}).strict(),a.object({kind:a.literal("nightly"),calendar:Ue}).strict()]),maximumTotalSpendUsd:a.number().finite().positive().max(1e4),maximumAttempts:a.number().int().min(1).max(20)}).strict().superRefine((t,e)=>{(t.configuration.request.teamId!==t.teamId||(t.configuration.request.project?.id??null)!==t.projectId)&&e.addIssue({code:"custom",message:"The scheduled Experiment must retain its actual workspace and Project."}),t.configuration.maximumCostUsd>t.maximumTotalSpendUsd&&e.addIssue({code:"custom",message:"The run ceiling exceeds the approved cumulative schedule ceiling."})}),rn=a.object({id:x,scheduledAt:H,coalescedThroughAt:H,coalescedCount:a.number().int().nonnegative(),configurationHash:F,operationId:x,state:a.enum(["reserved","dispatching","running","cleaning","completed","failed","cancelled","uncertain"]),executionId:x.nullable(),attempt:a.number().int().positive(),maximumCostUsd:a.number().finite().positive(),actualSpendUsd:a.number().finite().nonnegative().nullable(),cleanupComplete:a.boolean(),error:a.string().max(4e3).nullable()}).strict(),on=a.object({schemaVersion:a.literal("openpond.experimentEvaluationSchedule.v1"),id:x,revision:a.number().int().positive(),actorId:x,teamId:x,projectId:x.nullable(),operationId:x,requestHash:F,configuration:L,configurationHash:F,cadence:Xe.shape.cadence,state:a.enum(["scheduled","disabled","blocked"]),nextRunAt:H.nullable(),maximumTotalSpendUsd:a.number().finite().positive(),maximumAttempts:a.number().int().positive(),lastEvaluatedConfigurationHash:F.nullable(),newerUnevaluatedRelease:K.nullable(),fires:a.array(rn).max(1e4),reason:a.string().max(4e3).nullable(),createdAt:H,updatedAt:H,contentHash:F}).strict();function an(t){let{operationId:e,request:n,...r}=t,{operationId:o,...s}=n;return f({...r,request:s})}d(an,"scheduledExperimentHash");function sn(t){let e=on.parse(t);if(_e(e,"Scheduled Experiment"),e.configurationHash!==an(e.configuration)||e.configuration.request.teamId!==e.teamId||(e.configuration.request.project?.id??null)!==e.projectId)throw new Error("Scheduled Experiment immutable authority differs from its recipe.");return e}d(sn,"verifyExperimentEvaluationSchedule");function zr(t){return sn({...t,contentHash:f(t)})}d(zr,"sealExperimentEvaluationSchedule");var dn=a.object({teamId:x,id:x,operationId:x,expectedRevision:a.number().int().positive(),action:a.enum(["cancel_active","retry_active","pause"])}).strict(),Lr=a.discriminatedUnion("operation",[a.object({operation:a.literal("publish"),request:Xe}).strict(),a.object({operation:a.literal("control"),request:dn}).strict(),a.object({operation:a.literal("read"),id:x}).strict(),a.object({operation:a.literal("list"),cursor:x.optional(),limit:a.number().int().min(1).max(100).default(50)}).strict()]);function cn(t){return{list:d((e={})=>t.listSandboxRuntimes(e),"list"),create:d(e=>t.createSandboxRuntime(e),"create"),handle:d((e,n=null)=>t.sandboxRuntime(e,n),"handle"),get:d(e=>t.getSandboxRuntime(e),"get"),createSandbox:d((e,n={},r={})=>t.createSandboxRuntimeSandbox(e,n,r),"createSandbox"),updateStatus:d((e,n)=>t.updateSandboxRuntimeStatus(e,n),"updateStatus"),events:d(e=>t.listSandboxRuntimeEvents(e),"events"),event:d((e,n)=>t.emitSandboxRuntimeEvent(e,n),"event"),checkpoint:d((e,n={})=>t.checkpointSandboxRuntime(e,n),"checkpoint"),promote:d((e,n,r={})=>t.promoteSandboxRuntime(e,n,r),"promote"),preserveSource:d((e,n={},r={})=>t.preserveSandboxRuntimeSource(e,n,r),"preserveSource")}}d(cn,"createSandboxRuntimeNamespace");function un(t){return{list:d((e={})=>t.list(e),"list"),create:d(e=>t.create(e),"create"),get:d(e=>t.get(e),"get"),pricing:d(()=>t.pricing(),"pricing"),costs:d((e={})=>t.costs(e),"costs")}}d(un,"createSandboxNamespace");function pn(t){return{list:d(e=>t.listProjects(e),"list"),upsert:d(e=>t.upsertProject(e),"upsert"),upsertGitRemote:d(e=>t.upsertProjectGitRemote(e),"upsertGitRemote"),get:d((e,n)=>t.getProject(e,n),"get"),update:d((e,n)=>t.updateProject(e,n),"update"),sync:d((e,n)=>t.syncProject(e,n),"sync"),ensureGitRemote:d((e,n)=>t.ensureProjectGitRemote(e,n),"ensureGitRemote"),getGitRemote:d((e,n)=>t.ensureProjectGitRemote(e,n),"getGitRemote"),git:d((e,n)=>t.ensureProjectGitRemote(e,n),"git"),uploadSource:d((e,n)=>t.uploadProjectSource(e,n),"uploadSource"),archive:d((e,n)=>t.archiveProject(e,n),"archive")}}d(pn,"createSandboxProjectNamespace");function mn(t){return{get:d(e=>t.getHostedProfile(e),"get"),status:d(e=>t.getHostedProfile(e),"status"),ensureHosted:d(e=>t.ensureHostedProfile(e),"ensureHosted"),push:d(e=>t.pushHostedProfile(e),"push")}}d(mn,"createSandboxProfileNamespace");function ln(t){return{list:d(e=>t.listAgents(e),"list"),upsert:d(e=>t.upsertAgent(e),"upsert"),get:d((e,n)=>t.getAgent(e,n),"get"),update:d((e,n)=>t.updateAgent(e,n),"update"),archive:d((e,n)=>t.archiveAgent(e,n),"archive"),run:d((e,n)=>t.runAgent(e,n),"run"),sourceDeployPlan:d((e,n)=>t.getAgentSourceDeployPlan(e,n),"sourceDeployPlan"),manifestSnapshots:d((e,n)=>t.listAgentManifestSnapshots(e,n),"manifestSnapshots"),requestSourceChecks:d((e,n)=>t.requestAgentSourceChecks(e,n),"requestSourceChecks"),configureSourceSetup:d((e,n)=>t.configureAgentSourceSetup(e,n),"configureSourceSetup"),publishSource:d((e,n)=>t.publishAgentSource(e,n),"publishSource")}}d(ln,"createSandboxAgentNamespace");function hn(t,e,n=null){let r=d(async(c={},p={})=>{let I=await t.getSandboxRuntime(e);return I.sandboxId?t.get(I.sandboxId):t.createSandboxRuntimeSandbox(e,c,p).then(l=>l.sandbox)},"currentSandbox"),o=d(async(c={},p={})=>{let I=await t.getSandboxRuntime(e);if(!I.sandboxId)return t.createSandboxRuntimeSandbox(e,c,p).then(g=>g.sandbox);let l=await t.get(I.sandboxId);return l.state==="stopped"?t.start(l.id,p).then(g=>g.sandbox):l.state==="archived"?t.restore(l.id).then(g=>g.sandbox):l.state==="deleted"||l.state==="error"?t.createSandboxRuntimeSandbox(e,c,p).then(g=>g.sandbox):l},"resume");return{id:e,initial:n,get:d(()=>t.getSandboxRuntime(e),"get"),sandbox:r,resume:o,createSandbox:d((c={},p={})=>t.createSandboxRuntimeSandbox(e,c,p),"createSandbox"),status:d(async c=>{if(typeof c!="string")return t.updateSandboxRuntimeStatus(e,c);let p=await t.getSandboxRuntime(e);return t.updateSandboxRuntimeStatus(e,{status:c,expectedVersion:p.version})},"status"),events:d(()=>t.listSandboxRuntimeEvents(e),"events"),event:d(c=>t.emitSandboxRuntimeEvent(e,c),"event"),recordCommit:d((c,p={})=>t.emitSandboxRuntimeEvent(e,{...p,type:p.type??"git.commit",commitSha:c}),"recordCommit"),checkpointHint:d((c={})=>t.emitSandboxRuntimeEvent(e,{type:"workflow.checkpoint_hint",summary:c.summary??c.reason??"Workflow checkpoint hint",payload:{...c.payload,reason:c.reason??null},artifactRefs:c.artifactRefs,lifecycleHint:{kind:"checkpoint",reason:c.reason??null}}),"checkpointHint"),waitForUser:d(async(c={})=>{await t.emitSandboxRuntimeEvent(e,{type:"workflow.waiting_for_user",summary:c.summary??c.reason??"Waiting for user",payload:{...c.payload,reason:c.reason??null},lifecycleHint:{kind:"waiting_for_user",reason:c.reason??null}});let p=await t.getSandboxRuntime(e);return p.status==="waiting_for_user"?p:t.updateSandboxRuntimeStatus(e,{status:"waiting_for_user",expectedVersion:p.version,summary:c.summary??c.reason,metadata:{workflowWaitForUserReason:c.reason??null}})},"waitForUser"),keepAlive:d((c={})=>{let p=fn(c);return t.emitSandboxRuntimeEvent(e,{type:"workflow.keepalive",summary:c.summary??c.reason??"Workflow keepalive",payload:{...c.payload,reason:c.reason??null,keepaliveUntil:p},lifecycleHint:{kind:"keepalive",reason:c.reason??null,keepaliveUntil:p}})},"keepAlive"),checkpoint:d(c=>t.checkpointSandboxRuntime(e,c),"checkpoint"),files:{write:d(async(c,p)=>t.uploadFile((await o()).id,c,p),"write"),read:d(async c=>t.downloadFile((await o()).id,c),"read"),readResponse:d(async c=>t.downloadFileResponse((await o()).id,c),"readResponse"),list:d(async(c={})=>t.listFiles((await o()).id,c),"list"),delete:d(async(c,p={})=>t.deleteFile((await o()).id,c,p),"delete"),search:d(async c=>t.searchFiles((await o()).id,c),"search"),stat:d(async c=>t.statFile((await o()).id,c),"stat"),mkdir:d(async c=>t.mkdir((await o()).id,c),"mkdir"),move:d(async c=>t.moveFile((await o()).id,c),"move")},commands:{run:d(async c=>t.exec((await o()).id,typeof c=="string"?{command:c}:c),"run")},ports:{expose:d(async c=>t.openPort((await o()).id,typeof c=="number"?{port:c}:c),"expose")},promote:d((c,p={})=>t.promoteSandboxRuntime(e,c,p),"promote"),preserveSource:d((c={},p={})=>t.preserveSandboxRuntimeSource(e,c,p),"preserveSource"),archive:d(async c=>{let p=c??(await t.getSandboxRuntime(e)).version;return t.updateSandboxRuntimeStatus(e,{status:"archived",expectedVersion:p})},"archive")}}d(hn,"createSandboxRuntimeHandle");function fn(t){if(t?.until instanceof Date)return t.until.toISOString();if(typeof t?.until=="string"&&t.until.trim())return new Date(t.until).toISOString();let e=typeof t?.seconds=="number"&&Number.isFinite(t.seconds)?Math.max(1,Math.trunc(t.seconds)):60;return new Date(Date.now()+e*1e3).toISOString()}d(fn,"runtimeKeepaliveUntilIso");async function yn(t,e={}){let n=`openpond-code-smoke-${Date.now()}`,r=`openpond-code-exec-ok:${n}`,o=`openpond-code-preview-ok:${n}`,s=`openpond-code-file-ok:${n}`,i=4173,u=null,c=null,p=!1,I=!1;try{let l=await Ye(t,await t.create({repo:e.repo??"https://github.com/octocat/Hello-World",resources:{cpu:e.cpu??1,memoryGb:e.memoryGb??1,diskGb:e.diskGb??8},budget:{maxUsd:e.budgetUsd??"0.05"},quotas:{maxSpendUsd:e.budgetUsd??"0.05",maxDurationSeconds:600,idleTimeoutSeconds:600,maxOpenPorts:2},metadata:{runId:n,source:"openpond-code-sandbox-smoke"}},{async:!0}));u=l.id;let g=e.expectedMppMode;if(g&&l.reservation.mpp?.mode!==g)throw new Error(`expected ${g} reservation, got ${l.reservation.mpp?.mode??"none"}`);if(!g&&!l.reservation.mpp?.mode)throw new Error("expected sandbox reservation MPP metadata");let P=await t.exec(l.id,{command:[`printf '${r}\\n'`,"test -f README && printf 'repo-clone-ok\\n'","cat > server.cjs <<'EOF'","const { createServer } = require('node:http');",`createServer((_request, response) => response.end('${o}')).listen(${i}, '0.0.0.0');`,"EOF","nohup node server.cjs > server.log 2>&1 & sleep 1"].join(`
|
|
2
|
+
import{b as Ne}from"./chunk-SYUKES6H.js";import{a as B,b as G,c as ze,d as Le,e as q,f as ie,i as de,o as Be,q as ce}from"./chunk-JCHLDNCX.js";import{a as ue}from"./chunk-2ACX7IW5.js";import{k as ae,m as se,n as Pe}from"./chunk-OQPJ7FJF.js";import{c as Te}from"./chunk-UGDBMRCT.js";import{E as L}from"./chunk-XKDOPNQ5.js";import{f as K,m as f,n as _e}from"./chunk-HIQPGYVH.js";import{a as Ce}from"./chunk-HLJJAOI2.js";import{a as Oe,c as $e,d as je}from"./chunk-AMC4Z7G4.js";import{l as J,m as qe}from"./chunk-I6VMRQF4.js";import{h as Ue}from"./chunk-ZEOYNUHL.js";import{Sa as Ae,ea as Ee,wb as ke}from"./chunk-ZY32SZ2P.js";import{a as re,b as oe}from"./chunk-KUE46HTH.js";import{b as z}from"./chunk-MZKCW6CB.js";import{A as a}from"./chunk-X2J2P5ZT.js";import{a as d}from"./chunk-FTQLQJQV.js";function jt(t,e){let n=t.token?.trim();if(!n||t.accountState.state!=="signed_in"||!t.accountState.activeProfile)throw new Error("A signed-in OpenPond account is required.");let r=Ce(t.apiBaseUrl,{apiBaseUrl:t.apiBaseUrl}),o=/\/api\/sandboxes\/?$/.test(r)?r.replace(/\/api\/sandboxes\/?$/,"/v1"):r.replace(/\/sandboxes\/?$/,"");return{audience:new URL(o).origin,async request(s){let i=n.startsWith("opk_"),u=await z(o,n,s.path,{method:s.method??"GET",signal:s.signal,explicitBearerAuth:!i,headers:{...i?{"openpond-api-key":n}:{},...s.idempotencyKey?{"idempotency-key":s.idempotencyKey}:{},...e?{"X-OpenPond-Team-Id":e}:{}},...s.body?{body:JSON.stringify(s.body)}:{},...s.timeoutMs!==void 0?{timeoutMs:s.timeoutMs}:{}}),c=await u.json().catch(()=>({}));if(!u.ok)throw new Error(typeof c.error=="string"?c.error:`OpenPond API request failed with status ${u.status}`);return c}}}d(jt,"createCapturedOpenPondPublicApiClient");import{AsyncLocalStorage as _t}from"node:async_hooks";var Tt=new _t;function zt(){return Tt.getStore()}d(zt,"apiClientIdentity");var Lt=3e4,Bt=8*1024*1024,Gn={timeoutMs:900*1e3,maxResponseBytes:64*1024*1024},Fe=class extends Error{static{d(this,"ApiTimeoutError")}timeoutMs;requestUrl;code="OPENPOND_API_TIMEOUT";constructor(t,e){super(`API request timed out after ${t}ms: ${e}`),this.timeoutMs=t,this.requestUrl=e,this.name="ApiTimeoutError"}},pe=class extends Error{static{d(this,"ApiResponseTooLargeError")}maximumBytes;requestUrl;code="OPENPOND_API_RESPONSE_TOO_LARGE";constructor(t,e){super(`API response exceeded ${t} bytes: ${e}`),this.maximumBytes=t,this.requestUrl=e,this.name="ApiResponseTooLargeError"}},He=class extends Error{static{d(this,"OpenPondApiError")}status;apiMessage;code;constructor(t,e,n,r=null){let o=r||e;super(`${n} failed: ${t}${o?` ${o}`:""}`),this.status=t,this.apiMessage=r,this.name="OpenPondApiError",this.code=e||"OPENPOND_API_ERROR"}};async function W(t,e,n,r={}){let{timeoutMs:o=Lt,maxResponseBytes:s=Bt,explicitBearerAuth:i=!1,...u}=r,c=`${t}${n}`,p=new Headers(u.headers),I=zt();I&&!i&&p.set("x-openpond-client",I),p.set("Content-Type","application/json");let l=i?void 0:process.env.OPENPOND_API_KEY,g=e?.trim()||"",P=!i&&g.startsWith("opk_"),te=l||(P?g:null);te&&!p.has("openpond-api-key")&&p.set("openpond-api-key",te),e?p.set("Authorization",P?`ApiKey ${g}`:`Bearer ${e}`):l&&!p.has("Authorization")&&p.set("Authorization",`ApiKey ${l}`);let U=new AbortController,j=new Fe(o,c),T=o>0?setTimeout(()=>U.abort(j),o):null;T?.unref?.();let ne=Ft(u.signal,U.signal,o),A=d(()=>{T&&clearTimeout(T)},"cleanup");try{let R=await fetch(c,{...u,headers:p,signal:ne});return Nt(R,{cleanup:A,maximumBytes:s,requestUrl:c,timeoutController:U,timeoutError:j})}catch(R){throw A(),U.signal.aborted?j:R}}d(W,"apiFetch");async function me(t,e){let n;try{let r=await t.text();n=r?JSON.parse(r):{}}catch(r){if(r instanceof Fe||r instanceof pe)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 He(t.status,r,e,o)}return n}d(me,"readApiJson");function Nt(t,e){if(!t.body)return e.cleanup(),t;let n=Number(t.headers.get("content-length"));if(e.maximumBytes>0&&Number.isFinite(n)&&n>e.maximumBytes)throw e.cleanup(),t.body.cancel(),new pe(e.maximumBytes,e.requestUrl);let r=t.body.getReader(),o=0,s=new ReadableStream({async pull(i){try{let u=await r.read();if(u.done){e.cleanup(),i.close();return}if(o+=u.value.byteLength,e.maximumBytes>0&&o>e.maximumBytes){e.cleanup(),await r.cancel(),i.error(new pe(e.maximumBytes,e.requestUrl));return}i.enqueue(u.value)}catch(u){e.cleanup(),i.error(e.timeoutController.signal.aborted?e.timeoutError:u)}},async cancel(i){e.cleanup(),await r.cancel(i)}});return new Response(s,{headers:t.headers,status:t.status,statusText:t.statusText})}d(Nt,"boundedResponse");function Ft(t,e,n){return n<=0?t??void 0:t?AbortSignal.any([t,e]):e}d(Ft,"composedSignal");var C=a.string().min(1).max(200),_=a.string().regex(/^[a-f0-9]{64}$/),le=a.object({operationId:C,name:a.string().trim().min(1).max(500),projectId:C,dataset:K.extend({revision:a.number().int().positive()}).strict(),caseIds:a.array(C).min(1).max(1e4)}).strict().superRefine((t,e)=>{new Set(t.caseIds).size!==t.caseIds.length&&e.addIssue({code:"custom",message:"Select each case once."})}),Ht=B.extend({inputHash:_,outputHash:_.nullable(),task:Ee,taskHash:_}).strict(),Mt=a.object({schemaVersion:a.literal("openpond.connectedRecordedExecution.v1"),id:C,teamId:C,ownerUserId:C,request:le,manifest:ke,sources:a.array(Ht).min(1).max(1e4),contentHash:_}).strict();function Me(t){let e=Mt.parse(t),{contentHash:n,...r}=e,{contentHash:o,...s}=e.manifest;if(f(r)!==n||f(s)!==o||e.manifest.teamId!==e.teamId||e.manifest.id!==e.id||e.manifest.operationId!==e.request.operationId||f(e.manifest.dataset)!==f(e.request.dataset)||e.sources.length!==e.request.caseIds.length||e.sources.length!==e.manifest.population.length||e.sources.some((i,u)=>i.taskHash!==f(i.task)||i.task.id!==e.request.caseIds[u]||i.boundaryId!==i.task.id||e.manifest.population[u]?.caseId!==i.boundaryId))throw new Error("Recorded execution identity or population integrity failed.");return e}d(Me,"verifyConnectedRecordedExecution");var Dt=a.object({projectId:C.optional(),cursor:C.optional(),limit:a.number().int().min(1).max(50).default(20)}).strict(),Jt=a.object({id:C,teamId:C,ownerUserId:C,projectId:C,name:a.string().min(1).max(500),dataset:le.shape.dataset,manifestHash:_,contentHash:_,caseCount:a.number().int().min(1).max(1e4),createdAt:a.string().datetime()}).strict(),Kt=a.object({teamId:C,items:a.array(Jt).max(50),nextCursor:C.nullable()}).strict(),Gt=a.object({datasetId:a.string().trim().min(1).max(240),expectedRevision:a.number().int().positive(),operationId:a.string().trim().min(1).max(240),graders:a.array(Ae).min(1).max(100).optional()}).strict().superRefine((t,e)=>{t.graders&&new Set(t.graders.map(n=>n.id)).size!==t.graders.length&&e.addIssue({code:"custom",path:["graders"],message:"Choose one exact revision of each grader."})}),N=a.string().min(1).max(500),k=a.number().int().nonnegative(),Wt=a.object({teamId:N,ownerUserId:N,projectId:N.nullable(),status:a.enum(["active","paused","archived"]),revision:k,state:a.enum(["collecting","pending","attention","paused","archived"]),lastReconciledAt:a.string().datetime().nullable(),lastCapturedAt:a.string().datetime().nullable(),historyDays:a.number().int().positive(),sources:k,tasks:k,datasets:a.array(a.object({datasetId:N,projection:a.enum(["turn","conversation"]),revision:k}).strict()).max(2),latestBatch:a.object({operationId:N,updatedAt:a.string().datetime(),scanned:k,captured:k,unchanged:k,pending:k,failed:k,excluded:k,paused:k,hasMore:a.boolean()}).strict().nullable()}).strict(),h=a.string().min(1).max(500),E=a.string().regex(/^[a-f0-9]{64}$/),De=a.object({teamId:h,projectId:h.nullable(),status:a.enum(["active","paused","archived"]),revision:a.number().int().nonnegative()}).strict(),Xt=a.object({teamId:h,operationId:h,projectId:h.nullable(),outcomes:a.array(a.object({conversationId:h,state:a.enum(["captured","unchanged","pending","paused","excluded","failed"]),sourceId:h.optional(),snapshotHash:E.optional(),reason:a.string().optional()}).strict()).max(50),nextCursor:h.nullable()}).strict(),Vt=a.object({teamId:h,ref:B,origin:G.shape.source,sessionId:h,projectId:h,capturedAt:a.string().datetime(),unmappedEvidence:a.object({count:a.number().int().nonnegative().max(1e5),contentHash:E}).strict(),evidence:a.object({input:a.array(J),observed:a.array(J),answer:a.json(),boundary:qe}).strict()}).strict(),Yt=a.object({teamId:h,sourceId:h,snapshotHash:E,contentHash:E,count:a.number().int().nonnegative(),offset:a.number().int().nonnegative(),events:a.array(J).max(50),nextOffset:a.number().int().nonnegative().nullable()}).strict(),Zt=a.object({teamId:h,source:q.shape.source,sourceHash:E,previewHash:E,destination:q.shape.destination,issues:a.array(a.object({file:a.string(),message:a.string()}).strict()).max(100),sessions:a.array(a.object({sessionHash:E,sessionId:h,origin:G.shape.source,exporterVersion:a.string().nullable(),eventCount:a.number().int().nonnegative(),boundaries:a.array(a.object({id:h,projection:a.enum(["turn","conversation"]),answer:a.boolean(),process:a.enum(["retained","partial","absent"]),terminal:a.enum(["completed","failed","cancelled","unknown"])}).strict()).max(5001),warnings:a.array(a.string()).max(100),sample:a.array(a.object({role:a.enum(["user","assistant","system","tool"]).nullable(),text:a.string().max(4e3)}).strict()).max(3)}).strict()).max(1e3)}).strict(),Je=a.object({teamId:h,operationId:h,requestHash:E,previewHash:E,projectId:h.optional(),state:a.enum(["admitting","publishing","completed","failed"]),outcomes:a.array(a.object({sessionHash:E,sourceId:h,status:a.enum(["imported","already_present"]),datasets:a.array(a.object({datasetId:h,revision:a.number().int().positive(),changed:a.boolean()}).strict()).max(2)}).strict()).max(1e3),error:a.string().optional()}).strict(),Ke=class extends Error{static{d(this,"ConnectedEvidenceError")}constructor(t,e,n){super(n),this.status=t,this.code=e,this.name="ConnectedEvidenceError"}status;code},pr=class{static{d(this,"ConnectedEvidenceClient")}constructor(t){this.options=t;let e=new URL(t.baseUrl);if(!["http:","https:"].includes(e.protocol)||e.username||e.password||e.search||e.hash||!t.apiKey.trim()||!t.teamId.trim())throw new Error("A clean API origin and workspace credentials are required.");this.baseUrl=e.toString().replace(/\/+$/,"")}options;baseUrl;async capture(t,e){let n=ze.parse(t),r=Xt.parse(await this.request("/capture","POST",n,e));if(this.scope(r.teamId),r.operationId!==n.operationId||r.outcomes.length>n.limit||n.conversationId&&r.outcomes.some(o=>o.conversationId!==n.conversationId))throw new Error("Capture receipt differs from its requested source or operation.");return r}async retainStartingAssets(t,e){let n=Be.parse(t),r=ce(await this.request("/starting-assets","POST",n,e));if(this.scope(r.teamId),r.operationId!==n.operationId||r.requestHash!==f(n)||f(r.source)!==f(n.source)||r.assets.length!==n.proofs.length||r.assets.some((o,s)=>o.path!==n.proofs[s].path))throw new Error("Starting assets differ from the exact source, operation or selected paths.");return r}async startingAssets(t,e){let n=ce(await this.request(`/starting-assets/${encodeURIComponent(h.parse(t))}`,"GET",void 0,e));if(this.scope(n.teamId),n.id!==t)throw new Error("Starting assets identity mismatch.");return n}async list(t={},e){let n=a.object({projectId:h.optional(),cursor:h.optional(),limit:a.number().int().min(1).max(50).default(20)}).strict().parse(t),r=new URLSearchParams(Object.entries(n).filter(([,s])=>s!==void 0).map(([s,i])=>[s,String(i)])),o=a.object({teamId:h,items:a.array(G).max(50),nextCursor:h.nullable()}).strict().parse(await this.request(`?${r}`,"GET",void 0,e));if(this.scope(o.teamId),o.items.length>n.limit||new Set(o.items.map(s=>s.sourceId)).size!==o.items.length||o.nextCursor!==null&&o.nextCursor===n.cursor||n.projectId&&o.items.some(s=>s.projectId!==n.projectId))throw new Error("Connected source page differs from its requested scope.");return o}async read(t,e){let n=B.parse(t),r=Vt.parse(await this.request(`/${encodeURIComponent(n.id)}/cases/${encodeURIComponent(n.boundaryId)}?snapshotHash=${n.snapshotHash}&revisionHash=${n.boundaryRevisionHash}`,"GET",void 0,e));if(this.scope(r.teamId),f(r.ref)!==f(n)||r.evidence.boundary.id!==n.boundaryId||r.evidence.boundary.revisionHash!==n.boundaryRevisionHash||f(r.evidence.input)!==r.evidence.boundary.inputHash||f(r.evidence.observed)!==n.boundaryRevisionHash||r.evidence.boundary.outputHash!==null&&f(r.evidence.answer)!==r.evidence.boundary.outputHash)throw new Error("Connected case readback differs from its exact snapshot or cutoff.");return r}async setCollection(t,e){let n=De.parse(await this.request("/collection","PUT",a.object({paused:a.boolean()}).strict().parse({paused:t}),e));return this.scope(n.teamId),n}async collection(t){let e=De.parse(await this.request("/collection","GET",void 0,t));return this.scope(e.teamId),e}async collectionStatus(t){let e=Wt.parse(await this.request("/collection/status","GET",void 0,t));return this.scope(e.teamId),e}async unmappedEvents(t,e){let n=a.object({id:h,snapshotHash:E,contentHash:E,offset:a.number().int().nonnegative().default(0),limit:a.number().int().min(1).max(50).default(20)}).strict().parse(t),r=Yt.parse(await this.request(`/${encodeURIComponent(n.id)}/unmapped-events?snapshotHash=${n.snapshotHash}&offset=${n.offset}&limit=${n.limit}`,"GET",void 0,e));if(this.scope(r.teamId),r.sourceId!==n.id||r.snapshotHash!==n.snapshotHash||r.contentHash!==n.contentHash||r.offset!==n.offset||r.events.length>n.limit||r.events.some((o,s)=>o.sequence!==n.offset+s)||r.nextOffset!==null&&r.nextOffset!==n.offset+r.events.length)throw new Error("Unmapped source event page differs from its pinned snapshot.");return r}async homeSummary(t,e){let n=a.object({from:a.string().datetime(),to:a.string().datetime(),projectId:h.optional()}).strict(),r=n.parse(t),o=new URLSearchParams(Object.entries(r)),s=a.object({teamId:h,range:n,activity:a.object({conversations:a.number().int().nonnegative(),turns:a.number().int().nonnegative(),chatTurns:a.number().int().nonnegative(),workTurns:a.number().int().nonnegative()}).strict(),accounting:a.object({contextSnapshots:a.number().int().nonnegative()}).strict(),usage:Oe}).strict().parse(await this.request(`/summary?${o}`,"GET",void 0,e));if(this.scope(s.teamId),f(s.range)!==f(r)||s.activity.chatTurns+s.activity.workTurns!==s.activity.turns)throw new Error("Activity summary differs from its requested range.");for(let i of[s.usage.days,s.usage.modes,s.usage.models]){if(new Set(i.map(u=>u.key)).size!==i.length)throw new Error("Duplicate usage summary group.");for(let u of Object.keys(s.usage.total))if(i.reduce((c,p)=>c+p[u],0)!==s.usage.total[u])throw new Error("Usage totals differ from their displayed groups.")}return s}async uploadPart(t,e){let n=Le.parse(t),r=a.object({teamId:h,hash:E,parts:a.number().int(),index:a.number().int()}).strict().parse(await this.request("/imports/upload","POST",n,e));if(this.scope(r.teamId),r.hash!==n.hash||r.parts!==n.parts||r.index!==n.index)throw new Error("Upload receipt differs from its part identity.");return r}async preview(t,e){let n=q.parse(t),r=Zt.parse(await this.request("/imports/preview","POST",n,e));if(this.scope(r.teamId),r.source!==n.source||f(r.destination)!==f(n.destination)||r.sessions.some(o=>o.origin!==n.source)||new Set(r.sessions.map(o=>o.sessionHash)).size!==r.sessions.length)throw new Error("Import preview differs from its source or destination.");return r}async commit(t,e){let n=ie.parse(t),r=Je.parse(await this.request("/imports/commit","POST",n,e));if(this.scope(r.teamId),r.operationId!==n.operationId||r.previewHash!==n.previewHash||r.requestHash!==f(n)||r.outcomes.some(o=>!n.selection.some(s=>s.sessionHash===o.sessionHash))||r.state==="completed"&&r.outcomes.length!==n.selection.length)throw new Error("Import receipt differs from its exact selection or operation.");return r}async readImport(t,e){let n=h.parse(t),r=Je.parse(await this.request(`/imports/${encodeURIComponent(n)}`,"GET",void 0,e));if(this.scope(r.teamId),r.operationId!==n)throw new Error("Import identity mismatch.");return r}async prepareRecorded(t,e){let n=le.parse(t),r=Me(await this.request("/recorded-executions","POST",n,e));if(this.scope(r.teamId),f(r.request)!==f(n))throw new Error("Recorded admission differs from its selected Dataset/cases.");return r}async listRecordedExecutions(t={},e){let n=Dt.parse(t),r=new URLSearchParams(Object.entries(n).filter(([,s])=>s!==void 0).map(([s,i])=>[s,String(i)])),o=Kt.parse(await this.request(`/recorded-executions?${r}`,"GET",void 0,e));if(this.scope(o.teamId),o.items.length>n.limit||o.items.some((s,i)=>s.teamId!==o.teamId||n.projectId&&s.projectId!==n.projectId||n.cursor&&s.id<=n.cursor||i>0&&s.id<=o.items[i-1].id)||o.items.some(s=>s.ownerUserId!==o.items[0]?.ownerUserId)||o.nextCursor!==null&&(n.cursor!==void 0&&o.nextCursor<=n.cursor||o.items.length>0&&o.nextCursor<o.items.at(-1).id))throw new Error("Recorded execution page differs from its requested scope or cursor.");return o}async recordedExecution(t,e){let n=Me(await this.request(`/recorded-executions/${encodeURIComponent(h.parse(t))}`,"GET",void 0,e));if(this.scope(n.teamId),n.id!==t)throw new Error("Recorded execution identity mismatch.");return n}async publishDataset(t,e){let n=Gt.parse(t),r=de.parse(await this.request("/datasets/publish","POST",n,e));this.scope(r.teamId);let o=r.workspace.draft.metadata.connectedPublication;if(r.datasetId!==n.datasetId||!r.publication||!o||typeof o!="object"||!("requestHash"in o)||o.requestHash!==f(n))throw new Error("Published Dataset identity or original selection mismatch.");return r}async createSelection(t,e){let n=a.object({operationId:h.max(240),projectId:h.max(240),name:a.string().trim().min(1).max(200),cases:a.array(B).min(1).max(500)}).strict().parse(t),r=de.parse(await this.request("/datasets/selection","POST",n,e));if(this.scope(r.teamId),r.originProjectId!==n.projectId||r.workspace.draft.tasks.length!==n.cases.length||r.workspace.draft.tasks.some((o,s)=>f(o.input&&typeof o.input=="object"&&!Array.isArray(o.input)?o.input.connectedEvidenceRef:null)!==f(n.cases[s])))throw new Error("Selected Dataset differs from its exact source population.");return r}scope(t){if(t!==this.options.teamId)throw new Error("Connected evidence workspace mismatch.")}async request(t,e,n,r){let{response:o,value:s}=await Te(this.options.fetch??fetch,`${this.baseUrl}/v1/connected-evidence${t}`,{method:e,signal:r,redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"X-OpenPond-Team-Id":this.options.teamId,"Content-Type":"application/json",Accept:"application/json"},...n===void 0?{}:{body:JSON.stringify(n)}},(i,u,c)=>new Ke(i,u,c));if(!o.ok){let i=a.object({code:a.string(),message:a.string()}).safeParse(s);throw new Ke(o.status,i.success?i.data.code:"connected_request_failed",i.success?i.data.message:"Connected evidence request failed.")}return s}},b=a.string().trim().min(1).max(240),hr=a.object({id:b,expectedRevision:a.number().int().positive(),manifest:$e}).strict().refine(t=>t.id===t.manifest.connectionId&&t.expectedRevision===t.manifest.connectionRevision,"Collector coverage scope differs from its connection."),fr=a.object({id:b,cutoff:a.iso.datetime().optional()}).strict(),yr=a.object({schemaVersion:a.literal("openpond.connectedSyncCoverageReceipt.v1"),id:b,teamId:b,ownerUserId:b,connectionId:b,connectionRevision:a.number().int().positive(),receivedAt:a.iso.datetime(),summary:je}).strict(),gr=a.object({id:b,source:q.shape.source,machineId:b,sourceInstanceId:b,sourceLabel:a.string().trim().min(1).max(200),sourceRoot:a.string().min(1).max(2e3),destination:q.shape.destination,since:a.string().datetime().nullable(),keepSyncing:a.boolean(),expectedRevision:a.number().int().nonnegative()}).strict(),br=a.object({id:b,expectedRevision:a.number().int().positive(),action:a.enum(["pause","resume","disconnect"])}).strict(),Ir=a.object({id:b,operationId:b,expectedRevision:a.number().int().positive()}).strict(),Sr=a.object({id:b,expectedRevision:a.number().int().positive(),pendingOperations:a.number().int().min(0).max(1e4),error:a.string().max(500).nullable(),completedSyncRevision:a.number().int().nonnegative().default(0)}).strict(),wr=a.object({teamId:b,id:b,revision:a.number().int().positive(),source:q.shape.source,sourceLabel:a.string(),sourceRoot:a.string(),taskDatasetId:b.nullable(),conversationDatasetId:b.nullable(),machineId:b,sourceInstanceId:b,projectId:b,datasetIds:a.array(b).max(2),since:a.string().datetime().nullable(),keepSyncing:a.boolean(),state:a.enum(["active","paused","disconnected"]),health:a.enum(["online","offline"]),lastHeartbeatAt:a.string().datetime().nullable(),lastAdmissionAt:a.string().datetime().nullable(),pendingOperations:a.number().int().nonnegative(),admittedTasks:a.number().int().nonnegative(),error:a.string().nullable(),requestedSyncRevision:a.number().int().nonnegative().default(0),completedSyncRevision:a.number().int().nonnegative().default(0),syncRequestedAt:a.string().datetime().nullable().default(null),syncCompletedAt:a.string().datetime().nullable().default(null)}).strict().refine(t=>t.completedSyncRevision<=t.requestedSyncRevision&&t.requestedSyncRevision<=t.revision,"Invalid sync acknowledgement generation."),xr=a.object({connectionId:b,expectedRevision:a.number().int().positive(),request:ie}).strict();function Ur(t){let e=d(r=>`/v1/training/candidate-evaluations/${encodeURIComponent(r)}`,"path");function n(r,o,s){let i=tn.parse(r);if(i.teamId!==o||s&&i.id!==s)throw new Error("The preparation belongs to another workspace or candidate operation.");return i}return d(n,"read"),{async options(r,o={}){let s=new URLSearchParams({teamId:r,...o}),i=en.parse(await t(`/v1/training/candidates?${s}`));if(i.teamId!==r)throw new Error("The candidate catalog belongs to another workspace.");return i},async save(r){let o=We.parse(r),s=n(await t(`/v1/training/candidate-evaluations?teamId=${encodeURIComponent(o.teamId)}`,{method:"POST",body:JSON.stringify(o)}),o.teamId);if(s.requestHash!==f(o))throw new Error("The saved preparation differs from the selected candidate or frozen evaluation.");return s},async get(r,o){return n(await t(`${e(o)}?teamId=${encodeURIComponent(r)}`),r,o)},async control(r,o,s,i){let u=nn.parse(i),c=n(await t(`${e(o)}/${s}?teamId=${encodeURIComponent(r)}`,{method:"POST",body:JSON.stringify(u)}),r,o);if(c.requestHash!==u.requestHash)throw new Error("The command returned a different frozen evaluation.");return c}}}d(Ur,"createCandidateEvaluationClient");var S=a.string().trim().min(1).max(200),he=a.string().regex(/^[a-f0-9]{64}$/),Ge=a.object({id:S,contentHash:he}).strict(),Qt=a.object({artifact:Ge,trainingJobId:S,configurationId:S,baseProfileId:S,ready:a.boolean(),reason:a.string().max(1e3).nullable()}).strict(),en=a.object({teamId:S,ownerUserId:S,items:a.array(Qt).max(100),nextCursor:S.nullable()}).strict(),We=a.object({teamId:S,operationId:S,artifact:Ge,configuration:L}).strict().superRefine((t,e)=>{(t.configuration.request.teamId!==t.teamId||t.configuration.request.policy.kind==="fixture"||t.configuration.request.policy.candidate)&&e.addIssue({code:"custom",message:"Choose one exact model-backed evaluation before preparing the trained version."})}),tn=a.object({schemaVersion:a.literal("openpond.candidateEvaluationPreparation.v1"),teamId:S,ownerUserId:S,id:S,revision:a.number().int().positive(),requestHash:he,request:We,trainingJobId:S,dispatchId:S,lastOperationId:S.nullable(),runtime:a.object({poolId:S,endpointId:S.nullable(),baseProfileId:S,workerImageDigest:a.string().regex(/^sha256:[a-f0-9]{64}$/),modelId:S.nullable()}).strict().nullable(),state:a.enum(["configured","preparing","ready","dispatching","submitted","cleaning","completed","failed","cancelled"]),experimentId:S.nullable(),authorizedAt:a.iso.datetime().nullable(),cancelledAt:a.iso.datetime().nullable(),reason:a.string().max(1e3).nullable(),createdAt:a.iso.datetime(),updatedAt:a.iso.datetime()}).strict().superRefine((t,e)=>{(t.requestHash!==f(t.request)||!t.runtime&&["ready","dispatching","submitted","completed"].includes(t.state))&&e.addIssue({code:"custom",message:"The exact candidate preparation request or runtime changed."})}),nn=a.object({operationId:S,expectedRevision:a.number().int().positive(),requestHash:he}).strict();var x=a.string().trim().min(1).max(200),F=a.string().regex(/^[a-f0-9]{64}$/),H=a.string().datetime(),Xe=a.object({operationId:x,id:x.optional(),expectedRevision:a.number().int().nonnegative(),teamId:x,projectId:x.nullable(),enabled:a.boolean(),configuration:L,cadence:a.discriminatedUnion("kind",[a.object({kind:a.literal("interval"),seconds:a.number().int().min(60).max(31536e3)}).strict(),a.object({kind:a.literal("nightly"),calendar:Ue}).strict()]),maximumTotalSpendUsd:a.number().finite().positive().max(1e4),maximumAttempts:a.number().int().min(1).max(20)}).strict().superRefine((t,e)=>{(t.configuration.request.teamId!==t.teamId||(t.configuration.request.project?.id??null)!==t.projectId)&&e.addIssue({code:"custom",message:"The scheduled Experiment must retain its actual workspace and Project."}),t.configuration.maximumCostUsd>t.maximumTotalSpendUsd&&e.addIssue({code:"custom",message:"The run ceiling exceeds the approved cumulative schedule ceiling."})}),rn=a.object({id:x,scheduledAt:H,coalescedThroughAt:H,coalescedCount:a.number().int().nonnegative(),configurationHash:F,operationId:x,state:a.enum(["reserved","dispatching","running","cleaning","completed","failed","cancelled","uncertain"]),executionId:x.nullable(),attempt:a.number().int().positive(),maximumCostUsd:a.number().finite().positive(),actualSpendUsd:a.number().finite().nonnegative().nullable(),cleanupComplete:a.boolean(),error:a.string().max(4e3).nullable()}).strict(),on=a.object({schemaVersion:a.literal("openpond.experimentEvaluationSchedule.v1"),id:x,revision:a.number().int().positive(),actorId:x,teamId:x,projectId:x.nullable(),operationId:x,requestHash:F,configuration:L,configurationHash:F,cadence:Xe.shape.cadence,state:a.enum(["scheduled","disabled","blocked"]),nextRunAt:H.nullable(),maximumTotalSpendUsd:a.number().finite().positive(),maximumAttempts:a.number().int().positive(),lastEvaluatedConfigurationHash:F.nullable(),newerUnevaluatedRelease:K.nullable(),fires:a.array(rn).max(1e4),reason:a.string().max(4e3).nullable(),createdAt:H,updatedAt:H,contentHash:F}).strict();function an(t){let{operationId:e,request:n,...r}=t,{operationId:o,...s}=n;return f({...r,request:s})}d(an,"scheduledExperimentHash");function sn(t){let e=on.parse(t);if(_e(e,"Scheduled Experiment"),e.configurationHash!==an(e.configuration)||e.configuration.request.teamId!==e.teamId||(e.configuration.request.project?.id??null)!==e.projectId)throw new Error("Scheduled Experiment immutable authority differs from its recipe.");return e}d(sn,"verifyExperimentEvaluationSchedule");function zr(t){return sn({...t,contentHash:f(t)})}d(zr,"sealExperimentEvaluationSchedule");var dn=a.object({teamId:x,id:x,operationId:x,expectedRevision:a.number().int().positive(),action:a.enum(["cancel_active","retry_active","pause"])}).strict(),Lr=a.discriminatedUnion("operation",[a.object({operation:a.literal("publish"),request:Xe}).strict(),a.object({operation:a.literal("control"),request:dn}).strict(),a.object({operation:a.literal("read"),id:x}).strict(),a.object({operation:a.literal("list"),cursor:x.optional(),limit:a.number().int().min(1).max(100).default(50)}).strict()]);function cn(t){return{list:d((e={})=>t.listSandboxRuntimes(e),"list"),create:d(e=>t.createSandboxRuntime(e),"create"),handle:d((e,n=null)=>t.sandboxRuntime(e,n),"handle"),get:d(e=>t.getSandboxRuntime(e),"get"),createSandbox:d((e,n={},r={})=>t.createSandboxRuntimeSandbox(e,n,r),"createSandbox"),updateStatus:d((e,n)=>t.updateSandboxRuntimeStatus(e,n),"updateStatus"),events:d(e=>t.listSandboxRuntimeEvents(e),"events"),event:d((e,n)=>t.emitSandboxRuntimeEvent(e,n),"event"),checkpoint:d((e,n={})=>t.checkpointSandboxRuntime(e,n),"checkpoint"),promote:d((e,n,r={})=>t.promoteSandboxRuntime(e,n,r),"promote"),preserveSource:d((e,n={},r={})=>t.preserveSandboxRuntimeSource(e,n,r),"preserveSource")}}d(cn,"createSandboxRuntimeNamespace");function un(t){return{list:d((e={})=>t.list(e),"list"),create:d(e=>t.create(e),"create"),get:d(e=>t.get(e),"get"),pricing:d(()=>t.pricing(),"pricing"),costs:d((e={})=>t.costs(e),"costs")}}d(un,"createSandboxNamespace");function pn(t){return{list:d(e=>t.listProjects(e),"list"),upsert:d(e=>t.upsertProject(e),"upsert"),upsertGitRemote:d(e=>t.upsertProjectGitRemote(e),"upsertGitRemote"),get:d((e,n)=>t.getProject(e,n),"get"),update:d((e,n)=>t.updateProject(e,n),"update"),sync:d((e,n)=>t.syncProject(e,n),"sync"),ensureGitRemote:d((e,n)=>t.ensureProjectGitRemote(e,n),"ensureGitRemote"),getGitRemote:d((e,n)=>t.ensureProjectGitRemote(e,n),"getGitRemote"),git:d((e,n)=>t.ensureProjectGitRemote(e,n),"git"),uploadSource:d((e,n)=>t.uploadProjectSource(e,n),"uploadSource"),archive:d((e,n)=>t.archiveProject(e,n),"archive")}}d(pn,"createSandboxProjectNamespace");function mn(t){return{get:d(e=>t.getHostedProfile(e),"get"),status:d(e=>t.getHostedProfile(e),"status"),ensureHosted:d(e=>t.ensureHostedProfile(e),"ensureHosted"),push:d(e=>t.pushHostedProfile(e),"push")}}d(mn,"createSandboxProfileNamespace");function ln(t){return{list:d(e=>t.listAgents(e),"list"),upsert:d(e=>t.upsertAgent(e),"upsert"),get:d((e,n)=>t.getAgent(e,n),"get"),update:d((e,n)=>t.updateAgent(e,n),"update"),archive:d((e,n)=>t.archiveAgent(e,n),"archive"),run:d((e,n)=>t.runAgent(e,n),"run"),sourceDeployPlan:d((e,n)=>t.getAgentSourceDeployPlan(e,n),"sourceDeployPlan"),manifestSnapshots:d((e,n)=>t.listAgentManifestSnapshots(e,n),"manifestSnapshots"),requestSourceChecks:d((e,n)=>t.requestAgentSourceChecks(e,n),"requestSourceChecks"),configureSourceSetup:d((e,n)=>t.configureAgentSourceSetup(e,n),"configureSourceSetup"),publishSource:d((e,n)=>t.publishAgentSource(e,n),"publishSource")}}d(ln,"createSandboxAgentNamespace");function hn(t,e,n=null){let r=d(async(c={},p={})=>{let I=await t.getSandboxRuntime(e);return I.sandboxId?t.get(I.sandboxId):t.createSandboxRuntimeSandbox(e,c,p).then(l=>l.sandbox)},"currentSandbox"),o=d(async(c={},p={})=>{let I=await t.getSandboxRuntime(e);if(!I.sandboxId)return t.createSandboxRuntimeSandbox(e,c,p).then(g=>g.sandbox);let l=await t.get(I.sandboxId);return l.state==="stopped"?t.start(l.id,p).then(g=>g.sandbox):l.state==="archived"?t.restore(l.id).then(g=>g.sandbox):l.state==="deleted"||l.state==="error"?t.createSandboxRuntimeSandbox(e,c,p).then(g=>g.sandbox):l},"resume");return{id:e,initial:n,get:d(()=>t.getSandboxRuntime(e),"get"),sandbox:r,resume:o,createSandbox:d((c={},p={})=>t.createSandboxRuntimeSandbox(e,c,p),"createSandbox"),status:d(async c=>{if(typeof c!="string")return t.updateSandboxRuntimeStatus(e,c);let p=await t.getSandboxRuntime(e);return t.updateSandboxRuntimeStatus(e,{status:c,expectedVersion:p.version})},"status"),events:d(()=>t.listSandboxRuntimeEvents(e),"events"),event:d(c=>t.emitSandboxRuntimeEvent(e,c),"event"),recordCommit:d((c,p={})=>t.emitSandboxRuntimeEvent(e,{...p,type:p.type??"git.commit",commitSha:c}),"recordCommit"),checkpointHint:d((c={})=>t.emitSandboxRuntimeEvent(e,{type:"workflow.checkpoint_hint",summary:c.summary??c.reason??"Workflow checkpoint hint",payload:{...c.payload,reason:c.reason??null},artifactRefs:c.artifactRefs,lifecycleHint:{kind:"checkpoint",reason:c.reason??null}}),"checkpointHint"),waitForUser:d(async(c={})=>{await t.emitSandboxRuntimeEvent(e,{type:"workflow.waiting_for_user",summary:c.summary??c.reason??"Waiting for user",payload:{...c.payload,reason:c.reason??null},lifecycleHint:{kind:"waiting_for_user",reason:c.reason??null}});let p=await t.getSandboxRuntime(e);return p.status==="waiting_for_user"?p:t.updateSandboxRuntimeStatus(e,{status:"waiting_for_user",expectedVersion:p.version,summary:c.summary??c.reason,metadata:{workflowWaitForUserReason:c.reason??null}})},"waitForUser"),keepAlive:d((c={})=>{let p=fn(c);return t.emitSandboxRuntimeEvent(e,{type:"workflow.keepalive",summary:c.summary??c.reason??"Workflow keepalive",payload:{...c.payload,reason:c.reason??null,keepaliveUntil:p},lifecycleHint:{kind:"keepalive",reason:c.reason??null,keepaliveUntil:p}})},"keepAlive"),checkpoint:d(c=>t.checkpointSandboxRuntime(e,c),"checkpoint"),files:{write:d(async(c,p)=>t.uploadFile((await o()).id,c,p),"write"),read:d(async c=>t.downloadFile((await o()).id,c),"read"),readResponse:d(async c=>t.downloadFileResponse((await o()).id,c),"readResponse"),list:d(async(c={})=>t.listFiles((await o()).id,c),"list"),delete:d(async(c,p={})=>t.deleteFile((await o()).id,c,p),"delete"),search:d(async c=>t.searchFiles((await o()).id,c),"search"),stat:d(async c=>t.statFile((await o()).id,c),"stat"),mkdir:d(async c=>t.mkdir((await o()).id,c),"mkdir"),move:d(async c=>t.moveFile((await o()).id,c),"move")},commands:{run:d(async c=>t.exec((await o()).id,typeof c=="string"?{command:c}:c),"run")},ports:{expose:d(async c=>t.openPort((await o()).id,typeof c=="number"?{port:c}:c),"expose")},promote:d((c,p={})=>t.promoteSandboxRuntime(e,c,p),"promote"),preserveSource:d((c={},p={})=>t.preserveSandboxRuntimeSource(e,c,p),"preserveSource"),archive:d(async c=>{let p=c??(await t.getSandboxRuntime(e)).version;return t.updateSandboxRuntimeStatus(e,{status:"archived",expectedVersion:p})},"archive")}}d(hn,"createSandboxRuntimeHandle");function fn(t){if(t?.until instanceof Date)return t.until.toISOString();if(typeof t?.until=="string"&&t.until.trim())return new Date(t.until).toISOString();let e=typeof t?.seconds=="number"&&Number.isFinite(t.seconds)?Math.max(1,Math.trunc(t.seconds)):60;return new Date(Date.now()+e*1e3).toISOString()}d(fn,"runtimeKeepaliveUntilIso");async function yn(t,e={}){let n=`openpond-code-smoke-${Date.now()}`,r=`openpond-code-exec-ok:${n}`,o=`openpond-code-preview-ok:${n}`,s=`openpond-code-file-ok:${n}`,i=4173,u=null,c=null,p=!1,I=!1;try{let l=await Ye(t,await t.create({repo:e.repo??"https://github.com/octocat/Hello-World",resources:{cpu:e.cpu??1,memoryGb:e.memoryGb??1,diskGb:e.diskGb??8},budget:{maxUsd:e.budgetUsd??"0.05"},quotas:{maxSpendUsd:e.budgetUsd??"0.05",maxDurationSeconds:600,idleTimeoutSeconds:600,maxOpenPorts:2},metadata:{runId:n,source:"openpond-code-sandbox-smoke"}},{async:!0}));u=l.id;let g=e.expectedMppMode;if(g&&l.reservation.mpp?.mode!==g)throw new Error(`expected ${g} reservation, got ${l.reservation.mpp?.mode??"none"}`);if(!g&&!l.reservation.mpp?.mode)throw new Error("expected sandbox reservation MPP metadata");let P=await t.exec(l.id,{command:[`printf '${r}\\n'`,"test -f README && printf 'repo-clone-ok\\n'","cat > server.cjs <<'EOF'","const { createServer } = require('node:http');",`createServer((_request, response) => response.end('${o}')).listen(${i}, '0.0.0.0');`,"EOF","nohup node server.cjs > server.log 2>&1 & sleep 1"].join(`
|
|
3
3
|
`),timeoutSeconds:120});if(P.command.status!=="succeeded")throw new Error(`expected command success, got ${P.command.status}`);if(!P.command.output.includes(r))throw new Error("expected exec marker");if(await t.uploadFile(l.id,"openpond-code-smoke.txt",s),await t.downloadFile(l.id,"openpond-code-smoke.txt")!==s)throw new Error("expected file roundtrip marker");let U=null;if(e.snapshot||e.fork){let A=await t.createSnapshot(l.id,{async:!0,name:`openpond-code-smoke-${n}`,replay:{entrypoints:[{command:"cat openpond-code-smoke.txt",name:"default"}],retention:{class:"pinned"},safety:{cleanup:"delete",idleTimeoutSeconds:600,internetEgress:"block",maxDurationSeconds:600,maxSpendUsd:e.budgetUsd??"0.05",publicPreview:!1},validation:{commands:[{command:"test -f openpond-code-smoke.txt"}]}}}),{snapshot:R}=await In(t,l.id,A.snapshotJob.snapshotId);if(U=R.id,R.state!=="ready")throw new Error(`expected ready snapshot, got ${R.state}`)}if(e.fork){if(!U)throw new Error("expected snapshot id before fork");let A=await Ye(t,(await t.forkSnapshot(U,{budget:{maxUsd:e.budgetUsd??"0.05"},metadata:{source:"openpond-code-sandbox-smoke-fork",templateSnapshotId:U}},{async:!0})).sandbox);c=A.id;let R=await t.exec(A.id,{command:"cat openpond-code-smoke.txt",timeoutSeconds:120});if(R.command.status!=="succeeded")throw new Error(`expected fork command success, got ${R.command.status}`);if(!R.command.output.includes(s))throw new Error("expected fork snapshot marker");e.keep||(await fe(t,A.id),I=!0)}let j=null;if(e.preview!==!1){let A=await t.openPort(l.id,{label:"openpond-code-smoke",port:i}),R=await fetch(A.preview.url);j=R.status;let $t=await R.text();if(R.status!==200)throw new Error(`expected preview HTTP 200, got ${R.status}`);if(!$t.includes(o))throw new Error("expected preview marker")}let{sandbox:T,receipts:ne}=await gn(t,l.id);return e.keep||(await fe(t,l.id),p=!0),{deleted:p,execOutput:P.command.output.trim(),fileRoundtrip:!0,forkSandboxId:c,previewStatus:j,receiptRefs:ne.map(A=>A.mpp.receiptRef??null),reservationRef:l.reservation.mpp?.reservationRef??null,runId:n,sandboxId:l.id,snapshotId:U,state:T.state}}finally{c&&!e.keep&&!I&&await Ve(t,c),u&&!e.keep&&!p&&await Ve(t,u)}}d(yn,"runSandboxSmoke");async function gn(t,e){try{await t.stop(e)}catch{await t.stop(e,{async:!0})}let n=await Qe(t,e,new Set(["stopped","deleted"]),"stop"),r=await bn(t,e);if(r.length===0)throw new Error("expected receipt readback");return{sandbox:n,receipts:r}}d(gn,"stopSandboxForSmoke");async function fe(t,e){try{let n=await t.delete(e);if(n.state==="deleted")return n;await t.delete(e,{async:!0})}catch{await t.delete(e,{async:!0})}return Qe(t,e,new Set(["deleted"]),"delete")}d(fe,"deleteSandboxForSmoke");async function Ve(t,e){try{await fe(t,e)}catch{await t.delete(e,{async:!0}).catch(()=>{})}}d(Ve,"cleanupSandboxBestEffort");async function Qe(t,e,n,r){let i=Date.now()+3e5,u=await t.get(e);for(;Date.now()<i;){if(n.has(u.state))return u;if(u.state==="error")throw new Error(`sandbox ${r} failed: ${e}`);await X(3e3),u=await t.get(e)}throw new Error(`sandbox ${r} did not reach ${[...n].join("/")} before timeout: ${e} (${u.state})`)}d(Qe,"waitForSandboxState");async function bn(t,e){let o=Date.now()+12e4,s=await t.receipts(e);for(;Date.now()<o;){if(s.length>0)return s;await X(3e3),s=await t.receipts(e)}return s}d(bn,"waitForReceipts");async function Ye(t,e){if(e.state==="running"||e.state==="stopped")return e;if(e.state==="error")throw new Error(`sandbox create failed: ${e.id}
|
|
4
4
|
${e.logs.join(`
|
|
5
5
|
`)}`);let n=12*6e4,r=3e3,o=Date.now()+n,s=e;for(;Date.now()<o;){if(await X(r),s=await t.get(e.id),s.state==="running"||s.state==="stopped")return s;if(s.state==="error")throw new Error(`sandbox create failed: ${s.id}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as ne}from"./chunk-
|
|
2
|
+
import{a as ne}from"./chunk-Z5R4OSGC.js";import{a as we}from"./chunk-QKGNAYSC.js";import{h as Te}from"./chunk-GR4MJJCE.js";import{y as he,z as Re}from"./chunk-GG6PM7TB.js";import{Ca as ae,Da as X,Fa as se,L as fe,Ma as ve,N as ue,O as z,R as Q,S as te,T as me,U as ge,ka as ke,wa as A}from"./chunk-BYVE4TMU.js";import{D as pe,H as F,N as U,U as J,j as u,x as q}from"./chunk-3VT2PPKW.js";import{L as R,M,N as $,O as b,S as V,ba as le,mb as W}from"./chunk-ZEOYNUHL.js";import{Ra as oe,Wa as ee,ab as de,bb as ce,ga as G}from"./chunk-ZY32SZ2P.js";import{a as g}from"./chunk-FTQLQJQV.js";import{createHash as Me}from"node:crypto";function w(e,s,a,n){let t=W[a].parse(n),r=e.get("SELECT payload FROM learning_revisions WHERE scope = ? AND kind = ? AND id = ? AND revision = ?",[s,a,t.id,t.revision]);if(r){if(u(JSON.parse(r.payload))!==u(t))throw new Error(`Starter dependency conflicts with an existing revision: ${t.id}.`);return}e.run("INSERT INTO learning_revisions (scope, kind, id, revision, payload) VALUES (?, ?, ?, ?, ?)",[s,a,t.id,t.revision,JSON.stringify(t)]),e.run(`INSERT INTO learning_resources (scope, kind, id, revision) VALUES (?, ?, ?, ?)
|
|
3
3
|
ON CONFLICT (scope, kind, id) DO UPDATE SET revision = excluded.revision
|
|
4
4
|
WHERE learning_resources.revision < excluded.revision`,[s,a,t.id,t.revision])}g(w,"importStarterReleaseInTransaction");function Se(e,s,a){function n(o,d){let k=e.get("SELECT payload FROM learning_revisions WHERE scope = ? AND kind = ? AND id = ? AND revision = ?",[s,o,d.id,d.revision]);k||D(404,"model_reward_unavailable",`The exact ${o} resource is unavailable in this Profile.`);let l=W[o].parse(JSON.parse(k.payload));return b(l),d.contentHash&&l.contentHash!==d.contentHash&&D(409,"model_reward_changed","The selected resource does not match its immutable content hash."),l}g(n,"read");let t=n("binding",a),r=[...new Map(t.sources.map(o=>[u(o.reward),n("reward",o.reward)])).values()],i=new Map;for(let o of r){let d=o.implementation;for(let k of[...o.assets,..."verifierRef"in d?[d.verifierRef]:[],..."rubricRef"in d?[d.rubricRef]:[],..."inputContract"in d?[d.inputContract]:[]])i.has(k.id)||i.set(k.id,n("asset",{id:k.id,revision:1})),V(i.get(k.id),k)}return{rewardBinding:t,rewards:r,assets:[...i.values()]}}g(Se,"readSelectedModelReward");function Y(e,s,a,n){let t=q.parse(s.metadata.rewardBinding),r=g((c,f)=>{let H=e.get("SELECT payload FROM learning_revisions WHERE scope = ? AND kind = ? AND id = ? AND revision = ?",[s.profileId,c,f.id,f.revision]);H||D(404,"model_reward_unavailable",`The exact ${c} resource is unavailable in this Profile.`);let m=W[c].parse(JSON.parse(H.payload));return b(m),f.contentHash&&m.contentHash!==f.contentHash&&D(409,"model_reward_changed","The selected resource does not match its immutable content hash."),m},"read"),i=r("definition",q.parse(s.metadata.taskDefinition));(u(s.policy)!==u(i.execution.policy)||u(s.environment.metadata.portableEnvironment)!==u(i.execution.environment)||u(s.environment.metadata.portableTools)!==u(i.execution.tools))&&D(409,"model_taskset_context_changed","Taskset context differs from its immutable task definition.");let o=r("binding",t),d=[...new Map(o.sources.map(c=>[u(c.reward),r("reward",c.reward)])).values()];s.metadata.rewardExecution!==void 0&&u(s.metadata.rewardExecution)!==u({binding:o,rewards:d})&&D(409,"model_taskset_rewards_changed","Taskset embedded Rewards differ from their immutable binding.");let k=r("binding",a),l=[...new Map(k.sources.map(c=>[u(c.reward),r("reward",c.reward)])).values()],T=new Map((n?.modelResources?.assets??[]).map(c=>[c.id,c])),v=g(c=>{T.has(c)||T.set(c,r("asset",{id:c,revision:1}))},"addAsset");for(let c of[...d,...l]){let f=c.implementation;for(let H of[...c.assets,..."verifierRef"in f?[f.verifierRef]:[],..."rubricRef"in f?[f.rubricRef]:[],..."inputContract"in f?[f.inputContract]:[]])v(H.id)}let h,S=me.shape.executionResources.parse(s.environment.metadata.portableExecutionResources);if(i.execution.environment.entrypoint==="openpond.javascript-environment.v1"){let c=r("asset",{id:ue(i.execution),revision:1});h=fe.parse(JSON.parse(V(c,c.asset)));for(let f of[h.javascript.module,h.environment.actionSchemaRef,h.environment.observationSchemaRef,h.environment.stateSchemaRef])f&&v(f.id)}for(let c of s.tasks)c.privilegedContextRef&&v(c.privilegedContextRef);u(s.graders)!==u(X(o,d,[...T.values()]))&&D(409,"model_taskset_graders_changed","Taskset graders differ from their immutable Reward binding.");let N=G.parse($({schemaVersion:"openpond.tasksetRelease.v2",id:s.id,revision:s.revision,...i.execution,graders:ce(o,d),...s.metrics?{metrics:s.metrics}:{},tasks:s.tasks.map(c=>{let f=ve(c);return c.requiredOutputs===void 0&&c.metadata.portableTaskRecord===void 0&&delete f.requiredOutputs,f}),metadata:s.metadata.derivedPortableMetadata??{localSource:R(s),starter:{taskDefinition:R(i),rewardBinding:t}}}));return{sourcePackage:n?{...n.modelResources,taskset:n.taskset,executionResources:{environment:n.environment,verifierSet:n.verifierSet}}:{taskset:N,taskDefinition:i,rewardBinding:o,rewards:d,assets:[...T.values()],...S?{executionResources:S}:{},...h?{execution:h}:{}},selectedBinding:k,selectedRewards:l,assets:T}}g(Y,"readModelTasksetSource");function D(e,s,a){throw new J(e,{schemaVersion:"openpond.modelProjectApiError.v2",code:s,message:a,retryable:!1,requestId:null,details:{}})}g(D,"fail");function re(e){if(e?.metadata.learning===void 0)return null;let s=le.parse(e.metadata.learning);return b(s.definition),de(s.binding,s.rewards),M(s.definition.rewardBinding,R(s.binding))||x(409,"model_batch_binding_changed","Reviewed task definition and Reward binding do not match."),s.binding}g(re,"reviewedTasksetRewardBinding");function it(e,s,a=!0,n){let t=U(s),{project:r}=t,i=e.get("SELECT payload FROM model_projects WHERE id = ?",[r.id]),o=i?F.parse(JSON.parse(i.payload)):null;o&&o.profileId!==r.profileId&&x(404,"model_not_found","Model is not available in this Profile."),(o?.revision??0)!==t.expectedRevision&&x(409,"model_revision_conflict","Model changed since it was opened. Refresh before saving.");let d=r.trainingSetup.tasksetRef;if(!d||!r.trainingSetup.rewardBindingRef)return null;let k=e.get("SELECT payload FROM taskset_revisions WHERE taskset_id = ? AND revision = ?",[d.id,d.revision]),l=k?A.parse(JSON.parse(k.payload)):null;(!l||l.profileId!==r.profileId)&&x(404,"model_taskset_not_found","The selected Taskset revision is not available in this Profile."),(l.contentHash!==d.contentHash||ae(l)!==l.contentHash)&&x(409,"model_taskset_changed","The selected Taskset does not match its immutable content hash.");let T=re(l);if(T)return M(R(T),r.trainingSetup.rewardBindingRef)||x(422,"model_batch_reward_review_required","Changing a reviewed batch's Reward requires regrading and a new reviewed batch."),null;let v=l.metadata.rewardBinding===void 0?null:q.parse(l.metadata.rewardBinding);if(v&&M(v,r.trainingSetup.rewardBindingRef))return null;if(!v&&n&&!n.modelResources&&!n.learningResources){let p=Se(e,r.profileId,r.trainingSetup.rewardBindingRef),_=Te({owner:{scopeId:r.profileId,modelId:r.id},source:n,...p}),O=_e(e,t,a),P=se({package:_,profileId:r.profileId,name:l.name,createdAt:O.created_at});P.taskset=ne(P.taskset,l);let L={..._.modelResources,taskset:_.taskset,executionResources:{environment:_.environment,verifierSet:_.verifierSet}};return{taskset:P.taskset,generatedFiles:P.generatedFiles,directoryId:String(P.taskset.environment.metadata.runtimeSourceTasksetId),source:l,sourcePackage:null,derived:L,imported:P}}v||x(422,"model_taskset_derivation_unavailable","This Taskset needs an authored task definition and Reward binding before its Reward can be changed.");let{sourcePackage:h,selectedBinding:S,selectedRewards:N,assets:I}=Y(e,l,r.trainingSetup.rewardBindingRef,n),c=te.safeParse(h.taskset.metadata.modelTasksetDerivation),H=o?.hosted?.apiOrigin&&o.hosted.tasksets.some(p=>{if(!c.success||p.localTasksetId!==l.id||!p.packageHash||!p.localTasksetHash)return!1;let _=e.get("SELECT payload FROM taskset_revisions WHERE taskset_id = ? AND content_hash = ? AND profile_id = ?",[l.id,p.localTasksetHash,r.profileId]),O=_?A.parse(JSON.parse(_.payload)):null;if(!O||O.contentHash!==p.localTasksetHash)return!1;let P=e.get("SELECT payload FROM learning_revisions WHERE scope = ? AND kind = 'package' AND id = ? AND revision = ?",[r.profileId,p.releaseId,p.releaseRevision]),L=P?G.parse(JSON.parse(P.payload)):null,y=te.safeParse(L?.metadata.modelTasksetDerivation);return L?.contentHash===p.releaseHash&&y.success&&u(y.data.owner)===u(c.data.owner)&&M(y.data.root,c.data.root)})&&c.success&&c.data.owner.modelId===r.id?c.data.owner:{scopeId:r.profileId,modelId:r.id},m=ge({owner:H,source:h,rewardBinding:S,rewards:N,assets:[...I.values()]}),K=_e(e,t,a);if(n){let p=new Map(n.files.map(B=>[B.asset.id,B]));for(let B of m.assets)p.set(B.id,{asset:B.asset,base64:Buffer.from(B.text).toString("base64")});let{taskset:_,executionResources:O,...P}=m;if(!O)throw new Error("Derived imported package is missing execution resources.");let L=ke({schemaVersion:"openpond.tasksetPackage.v1",taskset:_,...O,modelResources:P,files:[...p.values()]}),y=se({package:L,profileId:r.profileId,name:l.name,createdAt:K.created_at});return y.taskset=ne(y.taskset,l),{taskset:y.taskset,generatedFiles:y.generatedFiles,directoryId:String(y.taskset.environment.metadata.runtimeSourceTasksetId),source:l,sourcePackage:h,derived:m,imported:y}}let ie=`${m.taskset.id}-r${m.taskset.revision}-${$({packageHash:m.taskset.contentHash,preparedAt:K.created_at}).contentHash}`,j=he(l,K.created_at),ye=new Map(m.taskset.tasks.map(p=>[p.id,p])),Z=[];for(let p of m.taskset.graders)if(p.kind==="custom_verifier"){let _=p.verifierRef.path;Z.some(O=>O.path===_)||Z.push({path:_,role:"verifier",content:V(I.get(p.verifierRef.id),p.verifierRef)})}let C=Re({tasksetId:m.taskset.id,now:K.created_at,sourcePackageHash:m.taskset.contentHash,draft:{...j,policy:m.taskset.policy,tasks:j.tasks.map(p=>({...p,metadata:{...p.metadata,portableTaskRecord:ye.get(p.id)}})),environment:{...j.environment,metadata:{...j.environment.metadata,runtimeSourceTasksetId:ie,portableExecutionResources:m.executionResources}},graders:X(S,N,[...I.values()]),learningSignals:{...j.learningSignals,rewards:j.learningSignals.rewards.map(p=>({...p,rules:[{id:S.id,points:1,condition:"Execute the published Reward binding with its declared normalization, weights and required gates."}],artifactRef:S.id,metadata:{...p.metadata,rewardBinding:R(S)}}))},metadata:{...j.metadata,portableCapabilities:m.taskset.capabilities,taskDefinition:R(m.taskDefinition),rewardBinding:R(S),rewardExecution:{binding:S,rewards:N},derivedPortableMetadata:m.taskset.metadata,modelTasksetDerivation:m.taskset.metadata.modelTasksetDerivation}}});if(C.metrics=m.taskset.metrics,m.taskset.metadata.tasksetOutputContract===void 0?delete C.metadata.tasksetOutputContract:C.metadata.tasksetOutputContract=m.taskset.metadata.tasksetOutputContract,C.contentHash=ae(C),C.revision!==m.taskset.revision)throw new Error("Derived local and portable Taskset revisions differ.");return{taskset:C,generatedFiles:Z,directoryId:ie,source:l,sourcePackage:h,derived:m}}g(it,"prepareModelTasksetSave");function Pe(e,s,a){let n=s.project.profileId;for(let o of[a.sourcePackage,a.derived]){if(!o)continue;for(let k of o.assets)w(e,n,"asset",k);for(let k of o.rewards)w(e,n,"reward",k);w(e,n,"binding",o.rewardBinding),w(e,n,"package",o.taskset),w(e,n,"definition",o.taskDefinition);let d=o.executionResources??o.execution;d&&w(e,n,"asset",Q(d)),o.execution&&w(e,n,"asset",z(o.execution))}let t=a.taskset;e.get("SELECT content_hash FROM taskset_revisions WHERE taskset_id = ? AND revision = ?",[t.id,t.revision])&&x(409,"model_taskset_revision_conflict","The derived Taskset revision was already published. Refresh before saving.");let i=JSON.stringify(t);e.run("INSERT INTO tasksets (id, profile_id, status, payload, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?) ON CONFLICT(id) DO UPDATE SET status = excluded.status, payload = excluded.payload, updated_at = excluded.updated_at",[t.id,n,t.status,i,t.createdAt,t.updatedAt]),e.run("INSERT INTO taskset_revisions (taskset_id, revision, content_hash, profile_id, status, payload, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?)",[t.id,t.revision,t.contentHash,n,t.status,i,t.createdAt,t.updatedAt]),e.run("UPDATE model_project_taskset_preparations SET state = 'committed' WHERE profile_id = ? AND operation_id = ?",[n,s.operationId])}g(Pe,"commitPreparedModelTaskset");function _e(e,s,a){let n=Me("sha256").update(u(s)).digest("hex"),t=s.project.profileId;a&&e.run("INSERT OR IGNORE INTO model_project_taskset_preparations (profile_id, operation_id, request_hash, created_at, state) VALUES (?, ?, ?, ?, 'preparing')",[t,s.operationId,n,new Date().toISOString()]);let r=e.get("SELECT request_hash, created_at FROM model_project_taskset_preparations WHERE profile_id = ? AND operation_id = ?",[t,s.operationId])??{request_hash:n,created_at:new Date().toISOString()};return r.request_hash!==n&&x(409,"model_operation_conflict","This save operation was already used with different Model configuration."),r}g(_e,"recordModelTasksetPreparation");function x(e,s,a){throw new J(e,{schemaVersion:"openpond.modelProjectApiError.v2",code:s,message:a,retryable:!1,requestId:null,details:{}})}g(x,"fail");import{createHash as Ee}from"node:crypto";function Ie(e,s){let a=U(s),n=e.get("SELECT request_hash, payload FROM model_project_save_operations WHERE profile_id = ? AND operation_id = ?",[a.project.profileId,a.operationId]);if(!n)return null;let t=Ee("sha256").update(u(a)).digest("hex");return n.request_hash!==t&&E(409,"model_operation_conflict","This save operation was already used with different Model configuration."),F.parse(JSON.parse(n.payload))}g(Ie,"findModelProjectSave");function ht(e,s,a,n){e.exec("BEGIN IMMEDIATE");try{let t=Oe(e,s,a,n);return e.exec("COMMIT"),t}catch(t){throw e.exec("ROLLBACK"),t}}g(ht,"commitModelProjectSave");function Oe(e,s,a,n){let t=U(s);t.learning&&E(422,"model_learning_hosted_required","Create this Model in a hosted workspace to enable continual learning.");let r=Ee("sha256").update(u(t)).digest("hex"),{project:i,operationId:o,expectedRevision:d}=t,k=Ie(e,t);if(k)return k;let l=e.get("SELECT payload FROM model_projects WHERE id = ?",[i.id]),T=l?F.parse(JSON.parse(l.payload)):null;T&&T.profileId!==i.profileId&&E(404,"model_not_found","Model is not available in this Profile."),(T?.revision??0)!==d&&E(409,"model_revision_conflict","Model changed since it was opened. Refresh before saving.");let v=xe(e,t),h=re(v);h||Ne(e,t);let S=h?R(h):v?.metadata.rewardBinding===void 0?null:q.parse(v.metadata.rewardBinding);v&&i.trainingSetup.rewardBindingRef&&(!S||!M(S,i.trainingSetup.rewardBindingRef))&&!a&&E(409,"model_taskset_preparation_required","Changing this Reward requires publishing its model-owned Taskset revision."),a&&((!i.trainingSetup.tasksetRef||!M(i.trainingSetup.tasksetRef,R(a.source))||!i.trainingSetup.rewardBindingRef||!M(i.trainingSetup.rewardBindingRef,R(a.derived.rewardBinding)))&&E(409,"model_taskset_preparation_changed","The prepared Taskset differs from the selected configuration."),Pe(e,t,a));let N=new Date().toISOString(),I=pe.parse({...i.trainingSetup,baseModel:i.trainingSetup.baseModel??i.defaultBaseModel,method:i.trainingSetup.method??(v?.authoringProvenance.buildIntent==="verifiable_reward"?"grpo":v?.authoringProvenance.buildIntent==="demonstrations"?"sft":null),...S?{rewardBindingRef:S}:{},...a?{rewardBindingRef:R(a.derived.rewardBinding),tasksetRef:R(a.taskset),tasksetRelease:null,recipe:null,...i.trainingSetup.evaluationTasksetRef&&M(i.trainingSetup.evaluationTasksetRef,R(a.source))?{evaluationTasksetRef:R(a.taskset)}:{}}:{}}),c=a?.derived??n??(v&&!h&&I.rewardBindingRef&&v.metadata.taskDefinition!==void 0&&v.metadata.rewardBinding!==void 0?Y(e,v,I.rewardBindingRef).sourcePackage:void 0),f=F.parse({...T,...i,trainingSetup:c?we({setup:I,package:c}):I,schemaVersion:"openpond.modelProject.v2",revision:d+1,hosted:T?.hosted??null,tasksetSyncs:T?.tasksetSyncs??[],createdAt:T?.createdAt??N,updatedAt:N});return e.run(`INSERT INTO model_projects (id, profile_id, payload, created_at, updated_at) VALUES (?, ?, ?, ?, ?)
|
|
5
5
|
ON CONFLICT(id) DO UPDATE SET payload = excluded.payload, updated_at = excluded.updated_at`,[f.id,f.profileId,JSON.stringify(f),f.createdAt,f.updatedAt]),e.run("INSERT INTO model_project_save_operations (profile_id, operation_id, request_hash, payload) VALUES (?, ?, ?, ?)",[f.profileId,o,r,JSON.stringify(f)]),f}g(Oe,"saveModelProjectInTransaction");function xe(e,s){let a=s.project.trainingSetup.tasksetRef;if(!a){s.project.trainingSetup.tasksetRelease&&E(400,"model_taskset_required","Choose the Taskset corresponding to this release.");return}let n=e.get("SELECT payload FROM taskset_revisions WHERE taskset_id = ? AND revision = ?",[a.id,a.revision]),t=n?A.parse(JSON.parse(n.payload)):null;return(!t||t.profileId!==s.project.profileId)&&E(404,"model_taskset_not_found","The selected Taskset revision is not available in this Profile."),t.contentHash!==a.contentHash&&E(409,"model_taskset_changed","The selected Taskset does not match its immutable content hash."),t}g(xe,"assertTaskset");function Ne(e,s){let a=s.project.trainingSetup.rewardBindingRef;if(!a)return;function n(r,i){let o=e.get("SELECT payload FROM learning_revisions WHERE scope = ? AND kind = ? AND id = ? AND revision = ?",[s.project.profileId,r,i.id,i.revision]);o||E(404,"model_reward_unavailable","The exact Reward configuration is unavailable in this Profile.");let d=(r==="binding"?ee:oe).parse(JSON.parse(o.payload));return d.contentHash!==i.contentHash&&E(409,"model_reward_changed","The selected Reward does not match its immutable content hash."),b(d),d}g(n,"read");let t=ee.parse(n("binding",a));for(let r of t.sources)n("reward",r.reward)}g(Ne,"assertReward");function E(e,s,a){throw new J(e,{schemaVersion:"openpond.modelProjectApiError.v2",code:s,message:a,retryable:!1,requestId:null,details:{}})}g(E,"fail");function Et(e,s){let{taskset:a,package:n}=s,t=a.profileId,r=e.get("SELECT payload FROM taskset_revisions WHERE taskset_id = ? AND revision = ?",[a.id,a.revision]);if(r&&u(A.parse(JSON.parse(r.payload)))!==u(a))throw new Error("Imported Taskset revision conflicts with an existing immutable local revision.");let i=e.get("SELECT payload FROM tasksets WHERE id = ?",[a.id]),o=i?A.parse(JSON.parse(i.payload)):null;if(o&&o.profileId!==t)throw new Error("Imported Taskset belongs to another Profile.");w(e,t,"package",n.taskset);let d=n.modelResources;if(d){w(e,t,"definition",d.taskDefinition),w(e,t,"binding",d.rewardBinding);for(let l of d.rewards)w(e,t,"reward",l);for(let l of d.assets)w(e,t,"asset",l);w(e,t,"asset",Q({environment:n.environment,verifierSet:n.verifierSet})),d.execution&&w(e,t,"asset",z(d.execution))}let k=JSON.stringify(a);r||e.run("INSERT INTO taskset_revisions (taskset_id, revision, content_hash, profile_id, status, payload, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?)",[a.id,a.revision,a.contentHash,t,a.status,k,a.createdAt,a.updatedAt]),(!o||o.revision<a.revision)&&e.run("INSERT INTO tasksets (id, profile_id, status, payload, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?) ON CONFLICT(id) DO UPDATE SET status = excluded.status, payload = excluded.payload, updated_at = excluded.updated_at",[a.id,t,a.status,k,a.createdAt,a.updatedAt])}g(Et,"importTasksetPackageInTransaction");export{w as a,it as b,Ie as c,ht as d,Oe as e,Et as f};
|
|
@@ -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-RFQD6B44.js";import{a as u,d as f}from"./chunk-
|
|
2
|
+
import{c as h}from"./chunk-RFQD6B44.js";import{a as u,d as f}from"./chunk-QN4CFJQC.js";import{d as w}from"./chunk-RPM4FDRX.js";import{c as l,f as c}from"./chunk-BSHAIAXY.js";import{c as a}from"./chunk-3M53YXEI.js";import{b as s}from"./chunk-GLUWATL5.js";import{a as i}from"./chunk-FTQLQJQV.js";import{readFile as p,stat as m}from"node:fs/promises";async function v(r,t=1048576){let o=a(r,"inputFile");if(!o)throw new Error("Provide --input-file with the exact reviewed request.");let e=await m(o);if(!e.isFile()||e.size>t)throw new Error(`The request must be a regular JSON file of at most ${t} bytes.`);let n=await p(o);if(n.byteLength>t)throw new Error("The request file grew beyond its byte allowance.");return JSON.parse(n.toString("utf8"))}i(v,"readEvaluationCommandInput");async function E(r){let t=a(r,"team");if(!t)throw new Error("Select --team for the evaluation owner.");if(r.local===!0||r.local==="true"){let e=new URL(a(r,"serverUrl")||u);if(e.protocol!=="http:"||!["localhost","127.0.0.1","[::1]"].includes(e.hostname)||e.username||e.password||e.search||e.hash||e.pathname!=="/")throw new Error("Local evaluation commands require an HTTP loopback server origin.");return{teamId:t,baseUrl:e.origin,apiKey:"local-capability",fetch:await f(e.origin)}}let o=await w();return{teamId:t,apiKey:await h(o,c(o)),baseUrl:l(r)??o.apiBaseUrl??s}}i(E,"evaluationCommandAccess");export{v as a,E as b};
|