openpond 0.2.67 → 0.2.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app-server.d.ts +668 -1
- package/dist/app-server.js +1 -1
- package/dist/chunks/{account-context-TIJOM22A.js → account-context-MWB6HN6I.js} +1 -1
- package/dist/chunks/{acp-NASAJV5E.js → acp-2OIXATRY.js} +1 -1
- package/dist/chunks/{acp-agent-C3CRF6DT.js → acp-agent-PAGX2B47.js} +1 -1
- package/dist/chunks/actions-command-2VE6YI4W.js +2 -0
- package/dist/chunks/{app-layer-XIEZ6ALX.js → app-layer-YNEUEOEP.js} +1 -1
- package/dist/chunks/{app-server-connected-apps-IB6M35NS.js → app-server-connected-apps-TZOAUOYR.js} +1 -1
- package/dist/chunks/app-server-evaluations-RRLYWLPK.js +2 -0
- package/dist/chunks/app-server-harness-services-XXM336NU.js +2 -0
- package/dist/chunks/app-server-runtime-GBX65JJ7.js +2 -0
- package/dist/chunks/apps-RSFEJOQN.js +2 -0
- package/dist/chunks/chunk-2PXKSAG6.js +2 -0
- package/dist/chunks/{chunk-XEU4J4GJ.js → chunk-2TGHZXJE.js} +2 -2
- package/dist/chunks/{chunk-AXO6OHJB.js → chunk-3A2Y7UK3.js} +1 -1
- package/dist/chunks/chunk-3Z4VM2LF.js +4 -0
- package/dist/chunks/{chunk-V3T2OJBZ.js → chunk-4BUM6JEC.js} +2 -2
- package/dist/chunks/chunk-4G3GTEVS.js +23 -0
- package/dist/chunks/{chunk-43QYVOYA.js → chunk-4KNPCJR4.js} +1 -1
- package/dist/chunks/chunk-4KTGYHCE.js +2 -0
- package/dist/chunks/chunk-4PUOWSDE.js +13 -0
- package/dist/chunks/chunk-55YD4UTW.js +2 -0
- package/dist/chunks/chunk-5G7BQAUA.js +2 -0
- package/dist/chunks/chunk-65FJWWXG.js +2 -0
- package/dist/chunks/{chunk-4EZI4KCT.js → chunk-65WRWLUD.js} +1 -1
- package/dist/chunks/chunk-6D3FI2XT.js +2 -0
- package/dist/chunks/chunk-73TW6BKK.js +6 -0
- package/dist/chunks/{chunk-5TPYBXWM.js → chunk-7NCM6GBN.js} +1 -1
- package/dist/chunks/chunk-7OFD6TFD.js +2 -0
- package/dist/chunks/chunk-7OKZCJHS.js +3 -0
- package/dist/chunks/{chunk-ADOCQA4D.js → chunk-7PKDJHT6.js} +1 -1
- package/dist/chunks/chunk-7RJOCGQ6.js +2 -0
- package/dist/chunks/{chunk-YR5URT73.js → chunk-7RSQOC5M.js} +3 -3
- package/dist/chunks/{chunk-FVK4W27G.js → chunk-AFH462DO.js} +1 -1
- package/dist/chunks/{chunk-GUG2SWRZ.js → chunk-AFKFN25T.js} +1 -1
- package/dist/chunks/chunk-AFYYIJ6K.js +2 -0
- package/dist/chunks/{chunk-U3MVH2YT.js → chunk-APKXXAUF.js} +1 -1
- package/dist/chunks/chunk-AQUZCWM3.js +2 -0
- package/dist/chunks/chunk-AUO5DCEU.js +2 -0
- package/dist/chunks/chunk-AYOMVI7J.js +2 -0
- package/dist/chunks/{chunk-RWRKUO5D.js → chunk-B66QCXH2.js} +1 -1
- package/dist/chunks/{chunk-SODAOLAP.js → chunk-BHKXPWFB.js} +1 -1
- package/dist/chunks/chunk-BU6MW65V.js +10 -0
- package/dist/chunks/{chunk-P6NQYXN6.js → chunk-CCZ276IA.js} +1 -1
- package/dist/chunks/{chunk-YONDU5TN.js → chunk-CIZI6Z7D.js} +1 -1
- package/dist/chunks/{chunk-ATFV2NA4.js → chunk-CO23RRN7.js} +1 -1
- package/dist/chunks/{chunk-QAFXQHHG.js → chunk-D6L6UNUQ.js} +2 -2
- package/dist/chunks/chunk-DDOIPTOM.js +2 -0
- package/dist/chunks/{chunk-CSU7RDA5.js → chunk-DKOVZ6R2.js} +3 -3
- package/dist/chunks/chunk-DRLP7GIU.js +2 -0
- package/dist/chunks/{chunk-DAEUVT2I.js → chunk-DRTHKWHK.js} +1 -1
- package/dist/chunks/{chunk-XDFXKRTI.js → chunk-DWF3FCY4.js} +1 -1
- package/dist/chunks/{chunk-W3ZILZUL.js → chunk-DWM5G7BU.js} +1 -1
- package/dist/chunks/chunk-DXJC3QW7.js +2 -0
- package/dist/chunks/{chunk-IDILAYCW.js → chunk-E2JB5OCO.js} +1 -1
- package/dist/chunks/{chunk-GI7LTJV3.js → chunk-EDYCSW22.js} +1 -1
- package/dist/chunks/{chunk-4JYTFEND.js → chunk-EFP75UEX.js} +1 -1
- package/dist/chunks/{chunk-CX7HKSQ4.js → chunk-EGP6DF34.js} +2 -2
- package/dist/chunks/{chunk-D5OFN47Z.js → chunk-ESYPMD7Q.js} +1 -1
- package/dist/chunks/{chunk-PWKJ5KLZ.js → chunk-EXYSD45J.js} +1 -1
- package/dist/chunks/{chunk-R6VI7MX5.js → chunk-EYTTZ5H4.js} +1 -1
- package/dist/chunks/chunk-FKUWCJ73.js +161 -0
- package/dist/chunks/{chunk-WD6ANOLL.js → chunk-FNGZ4UDZ.js} +1 -1
- package/dist/chunks/{chunk-JFZ6USNQ.js → chunk-G7X73SBG.js} +1 -1
- package/dist/chunks/{chunk-36FNNR5N.js → chunk-GEYZVOGD.js} +1 -1
- package/dist/chunks/{chunk-ULJZ7NUF.js → chunk-GY7YSD6J.js} +1 -1
- package/dist/chunks/{chunk-CWAQOFLP.js → chunk-GYYJ47GX.js} +1 -1
- package/dist/chunks/chunk-HG2YFMVU.js +4 -0
- package/dist/chunks/{chunk-YQBL5P6R.js → chunk-HKVFU3B3.js} +1 -1
- package/dist/chunks/{chunk-VEXJV5H5.js → chunk-IIT66347.js} +4 -4
- package/dist/chunks/{chunk-B2K5WQZE.js → chunk-IO5DZUKL.js} +1 -1
- package/dist/chunks/chunk-J256AEEE.js +2 -0
- package/dist/chunks/{chunk-CRDKBFRN.js → chunk-JEMECEQH.js} +1 -1
- package/dist/chunks/{chunk-7P5SH3CI.js → chunk-JPUSTFZC.js} +1 -1
- package/dist/chunks/{chunk-YMCF5GR2.js → chunk-JQOVC35K.js} +1 -1
- package/dist/chunks/{chunk-6LFTQBXP.js → chunk-JT5YQ52I.js} +1 -1
- package/dist/chunks/chunk-JVMSN7LH.js +2 -0
- package/dist/chunks/{chunk-HORMGT2Q.js → chunk-JXYJQT5Q.js} +1 -1
- package/dist/chunks/{chunk-WDKZMXIU.js → chunk-K7KBFM2T.js} +1 -1
- package/dist/chunks/{chunk-UBTP3QWI.js → chunk-KCLMA2IH.js} +1 -1
- package/dist/chunks/chunk-KDER7R45.js +2 -0
- package/dist/chunks/{chunk-IXZ5ZGIL.js → chunk-KOC3YJEU.js} +2 -2
- package/dist/chunks/{chunk-R6MMWEH4.js → chunk-KP2MYTP5.js} +1 -1
- package/dist/chunks/{chunk-TV2LE2BD.js → chunk-KU4TPDPH.js} +2 -2
- package/dist/chunks/{chunk-WJSJXK2N.js → chunk-KUE46HTH.js} +1 -1
- package/dist/chunks/chunk-LVXL7T5O.js +2 -0
- package/dist/chunks/{chunk-TSQ2I6XV.js → chunk-M4A7G4S5.js} +2 -2
- package/dist/chunks/{chunk-MX7KV5DA.js → chunk-M4ZHFDRJ.js} +1 -1
- package/dist/chunks/{chunk-26ID6A5C.js → chunk-MEJLWNRS.js} +1 -1
- package/dist/chunks/{chunk-XT5WUQGT.js → chunk-MIFVX5PK.js} +1 -1
- package/dist/chunks/{chunk-4VZJQRQI.js → chunk-MOXIGLN2.js} +1 -1
- package/dist/chunks/{chunk-UKSSFB4Q.js → chunk-N5EAVX4G.js} +1 -1
- package/dist/chunks/{chunk-4B7EGNYX.js → chunk-NMMHXYDJ.js} +1 -1
- package/dist/chunks/{chunk-EBOTNBUS.js → chunk-NRYC4NH6.js} +1 -1
- package/dist/chunks/chunk-NSSZ2ZIU.js +2 -0
- package/dist/chunks/{chunk-4TTXNVCE.js → chunk-OFJPOTES.js} +1 -1
- package/dist/chunks/chunk-OIH2LPIT.js +2 -0
- package/dist/chunks/chunk-OUJ63LMU.js +2 -0
- package/dist/chunks/{chunk-SD2XDZQW.js → chunk-P4QM63L3.js} +1 -1
- package/dist/chunks/chunk-PACLKDTN.js +2 -0
- package/dist/chunks/{chunk-VPAEFG7X.js → chunk-PAYFJHPO.js} +1 -1
- package/dist/chunks/{chunk-OPTJYDZN.js → chunk-PHZZBXDO.js} +1 -1
- package/dist/chunks/{chunk-HPTEJBP4.js → chunk-PKJHN666.js} +1 -1
- package/dist/chunks/{chunk-HNDAGZCF.js → chunk-PLROXHG2.js} +1 -1
- package/dist/chunks/{chunk-UNE52L3Y.js → chunk-PNPV2LDE.js} +1 -1
- package/dist/chunks/{chunk-2RSGVLZT.js → chunk-PSY6IRJE.js} +8 -8
- package/dist/chunks/{chunk-SVNEPXU3.js → chunk-Q73RKX7I.js} +1 -1
- package/dist/chunks/{chunk-IF5A3XWP.js → chunk-Q7FBVLLB.js} +1 -1
- package/dist/chunks/{chunk-V5AOM5MZ.js → chunk-Q7P34B2O.js} +1 -1
- package/dist/chunks/{chunk-375PADDM.js → chunk-QLGP2OAQ.js} +1 -1
- package/dist/chunks/{chunk-QQLS5FB7.js → chunk-QUNQM2E3.js} +1 -1
- package/dist/chunks/chunk-R2FYCJL6.js +2 -0
- package/dist/chunks/{chunk-6HQUIKC5.js → chunk-R4EEGWXB.js} +1 -1
- package/dist/chunks/chunk-RBTDSI4L.js +11 -0
- package/dist/chunks/chunk-RCQYEHHD.js +2 -0
- package/dist/chunks/{chunk-TGULVWPV.js → chunk-RFQD6B44.js} +1 -1
- package/dist/chunks/{chunk-3WJQ4IGK.js → chunk-RPM4FDRX.js} +1 -1
- package/dist/chunks/{chunk-MCBRB5D6.js → chunk-RY46UPBO.js} +4 -4
- package/dist/chunks/{chunk-K3LS5SK7.js → chunk-SDHG6CKU.js} +1 -1
- package/dist/chunks/{chunk-XKZ4PFMQ.js → chunk-SO4GMSNP.js} +1 -1
- package/dist/chunks/{chunk-O6ZYDHEJ.js → chunk-SSHE6B7Z.js} +1 -1
- package/dist/chunks/{chunk-SH7POUVX.js → chunk-SV7ZBEK2.js} +6 -6
- package/dist/chunks/{chunk-BJXPQIVD.js → chunk-U7D6Q744.js} +1 -1
- package/dist/chunks/chunk-U7X5ZLAL.js +2 -0
- package/dist/chunks/{chunk-N54CPLVD.js → chunk-UANH7U3Y.js} +1 -1
- package/dist/chunks/{chunk-BUZ7CBJC.js → chunk-UGFSAG4U.js} +1 -1
- package/dist/chunks/chunk-ULTV6INR.js +2 -0
- package/dist/chunks/{chunk-V3ILZQER.js → chunk-UMAVVMXL.js} +7 -7
- package/dist/chunks/chunk-V24VHT76.js +2 -0
- package/dist/chunks/chunk-VEBW7NKD.js +2 -0
- package/dist/chunks/chunk-VJR2GNRY.js +2 -0
- package/dist/chunks/{chunk-JD76ANPN.js → chunk-VJYOKU3C.js} +1 -1
- package/dist/chunks/{chunk-H2XG5N7D.js → chunk-VWWKWYSQ.js} +1 -1
- package/dist/chunks/chunk-WCNPGKST.js +2 -0
- package/dist/chunks/chunk-WD4KAKEX.js +2 -0
- package/dist/chunks/chunk-WGQ3FMRF.js +2 -0
- package/dist/chunks/{chunk-6C3CXME7.js → chunk-WNXUSELC.js} +1 -1
- package/dist/chunks/{chunk-RS526BG7.js → chunk-WZ35ICTE.js} +3 -3
- package/dist/chunks/chunk-XHACK2KR.js +2 -0
- package/dist/chunks/chunk-XOPHFUUY.js +2 -0
- package/dist/chunks/{chunk-YKTJPCYZ.js → chunk-XQAUHXL4.js} +4 -4
- package/dist/chunks/{chunk-ZVMQLIRA.js → chunk-XT4CSKHM.js} +1 -1
- package/dist/chunks/{chunk-KQD36SBJ.js → chunk-XY7HFXLH.js} +1 -1
- package/dist/chunks/{chunk-UXO33ST5.js → chunk-XYZV3FKD.js} +1 -1
- package/dist/chunks/{chunk-GC6RJBRZ.js → chunk-Y2WNZWT2.js} +1 -1
- package/dist/chunks/chunk-Y4I6CFZJ.js +2 -0
- package/dist/chunks/chunk-YDZBX4XQ.js +2 -0
- package/dist/chunks/chunk-YI6ME6PU.js +22 -0
- package/dist/chunks/{chunk-H42UW6IF.js → chunk-YXMYK5P7.js} +1 -1
- package/dist/chunks/{chunk-QFL2VQKX.js → chunk-Z33RVGP6.js} +1 -1
- package/dist/chunks/{chunk-OY4B7Y3T.js → chunk-ZDEIVUUI.js} +1 -1
- package/dist/chunks/{chunk-XGJG2ZKE.js → chunk-ZIQJDTQB.js} +1 -1
- package/dist/chunks/{chunk-IR2Y2VQY.js → chunk-ZYLLPRPU.js} +1 -1
- package/dist/chunks/cli-R7TAP6Z2.js +2 -0
- package/dist/chunks/{command-NWOZXU57.js → command-LNOVZQSK.js} +3 -3
- package/dist/chunks/{configuration-command-ZEIBQKB3.js → configuration-command-CNITTZRP.js} +1 -1
- package/dist/chunks/connected-app-executor-FGWCLOJO.js +2 -0
- package/dist/chunks/connected-evidence-5VZBYNWN.js +2 -0
- package/dist/chunks/{connected-starting-assets-66Y46ZPM.js → connected-starting-assets-KWOFEIE4.js} +1 -1
- package/dist/chunks/{connection-GDWPMHPC.js → connection-VMBXW5PD.js} +1 -1
- package/dist/chunks/{continual-TNPTWTKK.js → continual-FVOLGGOE.js} +1 -1
- package/dist/chunks/core-commands-BPYXVT7O.js +2 -0
- package/dist/chunks/dataset-preparation-authoring-UUYFWWCT.js +4 -0
- package/dist/chunks/datasets-E5TXSVIY.js +2 -0
- package/dist/chunks/desktop-test-FX7DTY4N.js +3 -0
- package/dist/chunks/dist-2MKJC6HN.js +2 -0
- package/dist/chunks/{dist-GR56E3QK.js → dist-DKE7RJZN.js} +1 -1
- package/dist/chunks/evaluation-coordination-KUTZEEPB.js +2 -0
- package/dist/chunks/experiment-improvements-PQNR5YHN.js +2 -0
- package/dist/chunks/experiments-Z4BJWT3Y.js +2 -0
- package/dist/chunks/experiments-signal-3GCLKUWZ.js +2 -0
- package/dist/chunks/{extension-UH34ZF7N.js → extension-3EKIT6BB.js} +1 -1
- package/dist/chunks/{help-O53DTZGN.js → help-K6YLZ3KL.js} +1 -1
- package/dist/chunks/host-profile-evaluation-tools-UF4ATIUF.js +2 -0
- package/dist/chunks/host-profile-external-dataset-KSEPXY2S.js +2 -0
- package/dist/chunks/hosted-app-server-composition-LA3BZ4SE.js +2 -0
- package/dist/chunks/hosted-experiment-improvement-VG2WE7XZ.js +3 -0
- package/dist/chunks/hosted-harness-runtime-MMTLCL23.js +2 -0
- package/dist/chunks/hosted-profile-candidate-PTGQLPZO.js +3 -0
- package/dist/chunks/hosted-profile-compiler-FS5R6CHJ.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-control-UUEZEMXU.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-inspection-4F7OEF4T.js +3 -0
- package/dist/chunks/hosted-profile-evaluation-preparation-LIJJZDHQ.js +3 -0
- package/dist/chunks/hosted-tasksets-NXVF4AQA.js +2 -0
- package/dist/chunks/human-review-2ZOB7CJZ.js +2 -0
- package/dist/chunks/{import-OBAKUJPM.js → import-YHYKZ6JN.js} +2 -2
- package/dist/chunks/{learning-CRR6NRPN.js → learning-LAXMGWSQ.js} +1 -1
- package/dist/chunks/learning-Y3UKNUGE.js +2 -0
- package/dist/chunks/local-harness-improvement-runtime-3YJQRYXC.js +2 -0
- package/dist/chunks/local-harness-taskset-review-XQHQ6JCR.js +2 -0
- package/dist/chunks/{model-projects-HP4DELCP.js → model-projects-6YWVD2TS.js} +1 -1
- package/dist/chunks/opchat-XXI2ZM53.js +3 -0
- package/dist/chunks/opchat-bounded-chat-3MZGCRLY.js +2 -0
- package/dist/chunks/organizations-W7HI2JA4.js +2 -0
- package/dist/chunks/{profile-3WZJ65CT.js → profile-P2SJPBOJ.js} +1 -1
- package/dist/chunks/project-action-payload-LTIQBX77.js +2 -0
- package/dist/chunks/project-agent-XRIXMXQK.js +2 -0
- package/dist/chunks/published-experiment-source-SDXUVPE7.js +2 -0
- package/dist/chunks/refiner-profile-service-56VYLZQJ.js +2 -0
- package/dist/chunks/{runtime-XP4DEGR3.js → runtime-Q7JUJO4D.js} +2 -2
- package/dist/chunks/sandbox-command-HVA5FJU4.js +2 -0
- package/dist/chunks/{sandbox-template-YFMHEMUQ.js → sandbox-template-U536EEWY.js} +1 -1
- package/dist/chunks/saved-work-KSIQPXC2.js +2 -0
- package/dist/chunks/{send-turn-D3GTSSHI.js → send-turn-YLY3YNEQ.js} +1 -1
- package/dist/chunks/setup-RMZ2BHLM.js +2 -0
- package/dist/chunks/{src-GQPWOPYA.js → src-C3ZUESMK.js} +1 -1
- package/dist/chunks/src-SGQYVBNQ.js +424 -0
- package/dist/chunks/standalone-experiment-turn-owner-TW5MTWIO.js +2 -0
- package/dist/chunks/store-chat-resources-IRHBW2EC.js +2 -0
- package/dist/chunks/{store-continual-support-reviews-VVRQO2JK.js → store-continual-support-reviews-3KK42L4I.js} +1 -1
- package/dist/chunks/store-conversation-serving-IVURK52V.js +2 -0
- package/dist/chunks/{store-create-improve-2XI36AET.js → store-create-improve-UTCLBXF2.js} +1 -1
- package/dist/chunks/{store-datasets-UFY422NG.js → store-datasets-4AQOVAQY.js} +1 -1
- package/dist/chunks/store-evaluation-results-PK2P3IMH.js +7 -0
- package/dist/chunks/{store-harness-workspaces-SGUEYDO2.js → store-harness-workspaces-YEXB4IRV.js} +1 -1
- package/dist/chunks/store-human-review-O4BVHP25.js +7 -0
- package/dist/chunks/store-learned-preference-migration-validation-44SVX6YB.js +2 -0
- package/dist/chunks/{store-learning-BFOT4QVT.js → store-learning-SIUQIY5C.js} +1 -1
- package/dist/chunks/{store-learning-credentials-DYTMWQTC.js → store-learning-credentials-BUHR7SN6.js} +1 -1
- package/dist/chunks/store-local-experiments-BHVTKPPE.js +97 -0
- package/dist/chunks/store-model-batch-review-RVAYUVK2.js +2 -0
- package/dist/chunks/{store-model-configuration-NJFWSYSA.js → store-model-configuration-6L3OYXF4.js} +1 -1
- package/dist/chunks/store-model-project-preparation-AAEKCF6V.js +2 -0
- package/dist/chunks/store-modification-recordings-LCPK6K2T.js +9 -0
- package/dist/chunks/{store-preference-comparison-MZAYONCK.js → store-preference-comparison-5YVIQNVB.js} +1 -1
- package/dist/chunks/{store-sidebar-file-bookmarks-J3JEVAYR.js → store-sidebar-file-bookmarks-WLMYDA4E.js} +1 -1
- package/dist/chunks/{store-sidebar-preferences-2JHTFXJK.js → store-sidebar-preferences-AFMYIDWT.js} +1 -1
- package/dist/chunks/{store-subagents-PUBQVWSU.js → store-subagents-KFPVSTRO.js} +1 -1
- package/dist/chunks/{store-task-inbox-3BREANOX.js → store-task-inbox-L6IQTY26.js} +1 -1
- package/dist/chunks/{store-task-inventory-5HRZCDUT.js → store-task-inventory-QWS2C656.js} +1 -1
- package/dist/chunks/store-taskset-drafts-FRFL6ITK.js +9 -0
- package/dist/chunks/{store-training-S3FXWLT6.js → store-training-FYXZU2FE.js} +1 -1
- package/dist/chunks/{store-training-jobs-2LCXPA7G.js → store-training-jobs-3N3VKPIY.js} +1 -1
- package/dist/chunks/{store-training-models-7AMKS7ZW.js → store-training-models-VOFVGPZR.js} +1 -1
- package/dist/chunks/{taskset-PLKWRT4X.js → taskset-UDDLFYKV.js} +1 -1
- package/dist/chunks/taskset-catalog-RZYEBCRQ.js +2 -0
- package/dist/chunks/taskset-packages-T6B6HYKZ.js +2 -0
- package/dist/chunks/taskset-packages-WMG5DUBN.js +2 -0
- package/dist/chunks/{teams-bot-VQXUA7U4.js → teams-bot-MPWL2PP4.js} +1 -1
- package/dist/chunks/tool-learning-ZQ6NSJ5K.js +2 -0
- package/dist/chunks/training-5NT2YB2L.js +2 -0
- package/dist/chunks/training-5UMT45UL.js +2 -0
- package/dist/chunks/training-UY6KRG4M.js +2 -0
- package/dist/chunks/{training-error-LQKCOQDJ.js → training-error-WF463UNZ.js} +1 -1
- package/dist/chunks/{training-hardware-ESXRWUIK.js → training-hardware-UWQCRDMV.js} +1 -1
- package/dist/chunks/training-hosted-CKSDRVL6.js +2 -0
- package/dist/chunks/training-hosted-alphaedit-HSMRDJTD.js +2 -0
- package/dist/chunks/training-hosted-decision-7JALOU6O.js +2 -0
- package/dist/chunks/training-hosted-engram-SXO75MFG.js +2 -0
- package/dist/chunks/{training-hosted-learning-WQ2IP5FP.js → training-hosted-learning-E2N32YU5.js} +1 -1
- package/dist/chunks/training-hosted-modification-comparison-TXFDJFTG.js +2 -0
- package/dist/chunks/training-hosted-neuron-training-J42WK4EH.js +2 -0
- package/dist/chunks/training-hosted-serving-report-BAEABGJH.js +2 -0
- package/dist/chunks/training-hosted-steering-T556BUBG.js +2 -0
- package/dist/chunks/training-model-start-P3PXDWNT.js +2 -0
- package/dist/chunks/web-search-ZEKJHZW4.js +2 -0
- package/dist/chunks/{workspaces-MCS2AQX6.js → workspaces-EK62ANTB.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/sandbox/types/billing.d.ts +87 -6
- package/dist/sandbox/types/io.d.ts +3 -0
- package/dist/sandbox-template/manifest.js +1 -1
- package/dist/skills/manifest.json +3 -3
- package/dist/skills/openpond-cli/references/experiments-and-training.md +461 -1
- package/dist/web/assets/App-CCuh99JW.js +54 -0
- package/dist/web/assets/{AppDialog-BvskhHE9.js → AppDialog-CxjDHVk9.js} +1 -1
- package/dist/web/assets/AppTerminalPanel-CKJIVpKa.js +2 -0
- package/dist/web/assets/{AppToastContext-D2788RqX.js → AppToastContext-EpiT1dHs.js} +1 -1
- package/dist/web/assets/AppsView-BsMyPX_3.js +1 -0
- package/dist/web/assets/{AttachmentTypeIcon-DVluUHuc.js → AttachmentTypeIcon-BXvZy5gB.js} +1 -1
- package/dist/web/assets/BrowserSidebar-BIIV4aq4.js +1 -0
- package/dist/web/assets/{CartesianChart-DdBZ69lI.js → CartesianChart-brqLBqnF.js} +1 -1
- package/dist/web/assets/ChatTimelineEntry-CwZbn16X.js +8 -0
- package/dist/web/assets/{CollaborationTabs-ba6WupeJ.js → CollaborationTabs-BU4uc4tZ.js} +1 -1
- package/dist/web/assets/{CommandMenu-D7wTaEgl.js → CommandMenu-DkWpXR55.js} +1 -1
- package/dist/web/assets/CommunityView-CsSxJZGn.js +1 -0
- package/dist/web/assets/{ComposerAttachments-aO90qXYz.js → ComposerAttachments-BdJGCYzI.js} +1 -1
- package/dist/web/assets/{ComposerCreateImproveStrip-BPUJBSyS.js → ComposerCreateImproveStrip-CWy0j1vv.js} +1 -1
- package/dist/web/assets/{ConversationImportsSettings-Bo836wKJ.js → ConversationImportsSettings-DCmiakbZ.js} +1 -1
- package/dist/web/assets/DatasetReviewImport-DEnF_pGu.js +1 -0
- package/dist/web/assets/ExperimentTrainingDataWorkspace-WhwQ0QBi.js +2 -0
- package/dist/web/assets/{FilePagePreview-C6wIp6uX.js → FilePagePreview-BRhhz99q.js} +2 -2
- package/dist/web/assets/{GetStartedView-CxMv8q-h.js → GetStartedView-CLVD-qEi.js} +1 -1
- package/dist/web/assets/{GettingStartedDialog-CEb0cS-o.js → GettingStartedDialog-CMxaAMg-.js} +1 -1
- package/dist/web/assets/HostedModelLearningReview-Cn-j-rDo.js +1 -0
- package/dist/web/assets/HostedModelLearningSettings-VNBvf38S.js +1 -0
- package/dist/web/assets/{HtmlVisual-CCuUkYT8.js → HtmlVisual-D5y2WG9L.js} +10 -10
- package/dist/web/assets/LabModelVersionDetailPage-BxRmYD6h.js +1 -0
- package/dist/web/assets/{TrainingRunLineage-PXzWR65d.css → LabModelWorkspace-DOrgCk9Z.css} +1 -1
- package/dist/web/assets/LabModelWorkspace-u2Ulm_z4.js +1 -0
- package/dist/web/assets/{LabSkillSidebar-CFROlATQ.js → LabSkillSidebar-C7IceJTJ.js} +1 -1
- package/dist/web/assets/LabsRoute-C9Y0GU34.css +1 -0
- package/dist/web/assets/LabsRoute-CbztQaEf.js +74 -0
- package/dist/web/assets/LearningBatchesPage-B1NZTBSv.css +1 -0
- package/dist/web/assets/LearningBatchesPage-CJqgZNvM.js +26 -0
- package/dist/web/assets/MainChatThread-DNMfrrRq.js +2 -0
- package/dist/web/assets/{MainPane-BOWkynGB.css → MainPane-BZlNLfTM.css} +1 -1
- package/dist/web/assets/MainPane-CQQxSDPS.js +13 -0
- package/dist/web/assets/ModelProjectPageHeader-Dge19aE1.js +1 -0
- package/dist/web/assets/NativeSetupTerminal-D4JnbpyD.js +2 -0
- package/dist/web/assets/{NativeSkillSidebar-MAJWS4mL.js → NativeSkillSidebar-Jzx1BeKV.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-MQiUBVx3.js → NewProjectDialog-DcnGzEd9.js} +1 -1
- package/dist/web/assets/{OutputsPage-DpF-aRTu.js → OutputsPage-Cmk15Vt_.js} +1 -1
- package/dist/web/assets/{PageChrome-8gH2hyDb.js → PageChrome-Cz_fCqtn.js} +1 -1
- package/dist/web/assets/{ProjectsPage-BQ98oGyu.js → ProjectsPage-BZ3Eo3Mz.js} +1 -1
- package/dist/web/assets/RightChatPanelStack-C6H2vU9N.js +1 -0
- package/dist/web/assets/RightSidebarHomePanel-BfMMVkM1.js +1 -0
- package/dist/web/assets/{ScheduledWorkPage-CGCqZz_H.js → ScheduledWorkPage-CAkSwM0T.js} +1 -1
- package/dist/web/assets/{SettingsView-CqpMFLxy.js → SettingsView-DvQXGw3_.js} +3 -3
- package/dist/web/assets/{TasksetDraftEditorPrimitives-DJvIvzBb.js → TasksetDraftEditorPrimitives-JuU1k8vr.js} +1 -1
- package/dist/web/assets/TeamChatView-DmHjr8W9.js +1 -0
- package/dist/web/assets/{TerminalOverlay-D--M876l.js → TerminalOverlay-DlaM9d8F.js} +1 -1
- package/dist/web/assets/{TrainingCreationPanel-DDUoHQHU.js → TrainingCreationPanel-ClpylNsr.js} +1 -1
- package/dist/web/assets/{TrainingDraftPanel-CwLXn3Z7.js → TrainingDraftPanel-6tH2xSDj.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-CGwPregx.js → UsageSettingsSection-CzDqxOYM.js} +2 -2
- package/dist/web/assets/WorkSidebarPanel-CY-AHZ4-.js +1 -0
- package/dist/web/assets/WorkspaceDiffPanel-B4e0lyF7.js +11 -0
- package/dist/web/assets/WorkspaceEnvironmentMenu-D01ZkZZF.js +35 -0
- package/dist/web/assets/{WorkspaceFileLocation-D-ctFM4d.js → WorkspaceFileLocation-C5s_njZb.js} +1 -1
- package/dist/web/assets/{WorkspaceGitDialogs-CQ28j3R7.js → WorkspaceGitDialogs-DjPZ6KIh.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-BrZs6-EW.js → WorkspaceMonacoEditor-CC4sfOiU.js} +3 -3
- package/dist/web/assets/{WorkspacePdfPreview-CU6PSjjN.js → WorkspacePdfPreview-vszQqFa4.js} +2 -2
- package/dist/web/assets/{WorkspacePresentationPreview-IjXVXpIy.js → WorkspacePresentationPreview-DQTvhaRD.js} +1 -1
- package/dist/web/assets/api-client-DJRVOFzS.js +1 -0
- package/dist/web/assets/{app-models-CKXrDTEU.js → app-models-BUdzQbXo.js} +1 -1
- package/dist/web/assets/bot-Doyx3T4j.js +1 -0
- package/dist/web/assets/{browser-sidebar-links-D9v2cyJa.js → browser-sidebar-links-PVPCrsDJ.js} +1 -1
- package/dist/web/assets/chat-resources-Beh5lB36.js +1 -0
- package/dist/web/assets/chevron-down-DX1hzujj.js +1 -0
- package/dist/web/assets/chevron-right-DHN0y3KC.js +1 -0
- package/dist/web/assets/chevron-up-_QrW88NF.js +1 -0
- package/dist/web/assets/{chunk-TLSP5JKG-BrrVo5rJ.js → chunk-3BYFS4RO-ztZjcMmt.js} +1 -1
- package/dist/web/assets/chunk-AG6UJ3DI-D9KZjTYP.js +1 -0
- package/dist/web/assets/chunk-C3TS766N-ppRhs95p.js +1 -0
- package/dist/web/assets/chunk-GCUWJUUM-Dy6oUNJ6.js +9 -0
- package/dist/web/assets/chunk-GS5HEE4M-C0RLeIsy.js +1 -0
- package/dist/web/assets/{chunk-H3JZ3P5T-CzpTARDY.js → chunk-H3JZ3P5T-DolwEJXo.js} +2 -2
- package/dist/web/assets/chunk-Q4RGCEOI-Cr-dg4Nk.js +1 -0
- package/dist/web/assets/client-DwZ92xtu.js +1 -0
- package/dist/web/assets/{client-choice-storage-DUWsS4X0.js → client-choice-storage-DitqKiIT.js} +1 -1
- package/dist/web/assets/cloud-upload-HdzNTgr2.js +1 -0
- package/dist/web/assets/common-BWVSBnpX.js +1 -0
- package/dist/web/assets/copy-DTQhoBNg.js +1 -0
- package/dist/web/assets/create-pipeline-DsZzNkt9.js +1 -0
- package/dist/web/assets/{cssMode-SclUkqPt.js → cssMode-BRTtfXxU.js} +1 -1
- package/dist/web/assets/dataset-workspaces-BTPi71mz.js +1 -0
- package/dist/web/assets/external-link-H1629UU6.js +1 -0
- package/dist/web/assets/folder-open-CAGdWOrr.js +1 -0
- package/dist/web/assets/folder-plus-C14cs2mE.js +1 -0
- package/dist/web/assets/git-commit-horizontal-DFUfuVvF.js +1 -0
- package/dist/web/assets/{htmlMode-X3mQtOeh.js → htmlMode-BVaCcL76.js} +1 -1
- package/dist/web/assets/icons-Bk2b68aC.js +1 -0
- package/dist/web/assets/image-0DPVY6Ev.js +1 -0
- package/dist/web/assets/{index-LXNhSUEL.js → index-B6XX_0h3.js} +2 -2
- package/dist/web/assets/info-C8b_tafZ.js +1 -0
- package/dist/web/assets/{intake-contracts-wCkD2ErR.js → intake-contracts-B8JZKYwb.js} +1 -1
- package/dist/web/assets/{jsonMode-BoKiIdHd.js → jsonMode-BCKKQmmV.js} +1 -1
- package/dist/web/assets/loader-circle-y-SSPwpk.js +1 -0
- package/dist/web/assets/{lspLanguageFeatures-CO2mzpy1.js → lspLanguageFeatures-DozmNUOx.js} +1 -1
- package/dist/web/assets/maximize-2-CByk9-zN.js +1 -0
- package/dist/web/assets/message-square-C889vRqm.js +1 -0
- package/dist/web/assets/{monaco.contribution-wacA5FjV.js → monaco.contribution-B9q6qbbo.js} +2 -2
- package/dist/web/assets/{monaco.contribution-CVe3mWSY.js → monaco.contribution-BITdsRbn.js} +2 -2
- package/dist/web/assets/{monaco.contribution-hrusiaZi.js → monaco.contribution-BqA-XZ44.js} +2 -2
- package/dist/web/assets/{monaco.contribution-C7CAQIKF.js → monaco.contribution-DxAV1oS5.js} +2 -2
- package/dist/web/assets/monitor-BtxlcLuI.js +1 -0
- package/dist/web/assets/paperclip-BeIdaspf.js +1 -0
- package/dist/web/assets/{pdf-Ct3M2mVw.js → pdf-perlzwEB.js} +1 -1
- package/dist/web/assets/play-CHXXdkuO.js +1 -0
- package/dist/web/assets/plus-DFFWjhPw.js +1 -0
- package/dist/web/assets/{ponder-desktop-D-zB6X4L.js → ponder-desktop-Ca-9KggQ.js} +1 -1
- package/dist/web/assets/presentation-0bzvu6_u.js +1 -0
- package/dist/web/assets/{profile-ref-CCxrOCio.js → profile-ref-D8lxL7dW.js} +1 -1
- package/dist/web/assets/{python-C0-pUUAU.js → python-B9hOnkOI.js} +1 -1
- package/dist/web/assets/refresh-cw-D61-Ozk3.js +1 -0
- package/dist/web/assets/{requests-DjSt-duM.js → requests-DmeUYik4.js} +1 -1
- package/dist/web/assets/reward-checks-DJJZYgf8.js +7 -0
- package/dist/web/assets/save-iEMNZoPe.js +1 -0
- package/dist/web/assets/schemas-Brv9Vmnk.js +64 -0
- package/dist/web/assets/settings-BC-bzgk6.js +21 -0
- package/dist/web/assets/settings-lists-C84qxFmP.js +5 -0
- package/dist/web/assets/square-BE_4JMR3.js +1 -0
- package/dist/web/assets/square-terminal-Djpzo2Qs.js +1 -0
- package/dist/web/assets/{submit-issue-command-Gk3RKrY-.js → submit-issue-command-HfKzyxg5.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-BnYUBgZB.js → toggleHighContrast-ClsXu39R.js} +1 -1
- package/dist/web/assets/training-DWfghwfZ.js +1 -0
- package/dist/web/assets/{training-model-data-CxR3xpmK.js → training-model-data-CIysl8wH.js} +4 -4
- package/dist/web/assets/{tsMode-BVNyOY8h.js → tsMode-nbmaMc-D.js} +1 -1
- package/dist/web/assets/upload-C6ug8RD-.js +1 -0
- package/dist/web/assets/{useAccountSettings-4_XfwJQi.js → useAccountSettings-Dr9h4Qz_.js} +1 -1
- package/dist/web/assets/{useAgentInventory-CVuamyT3.js → useAgentInventory-ByCk2JAv.js} +1 -1
- package/dist/web/assets/useChatContextSelection-C0eMm2g6.js +1 -0
- package/dist/web/assets/{useLocalAgentSchedules-CmwN4ohy.js → useLocalAgentSchedules-Do0y_leJ.js} +1 -1
- package/dist/web/assets/useQuery-D2MQ7e5U.js +1 -0
- package/dist/web/assets/wifi-off-Dr-CapyW.js +1 -0
- package/dist/web/assets/work-outputs-D_8TovAK.js +1 -0
- package/dist/web/assets/{workers-CjtQ2aBD.js → workers-DKvM2NdM.js} +1 -1
- package/dist/web/assets/x-Jx2jlP9u.js +1 -0
- package/dist/web/assets/{yaml-N1KUjBZ8.js → yaml-C02vq4ar.js} +1 -1
- package/dist/web/index.html +1 -1
- package/docs/command-reference.md +93 -3
- package/package.json +1 -1
- package/dist/chunks/actions-command-BYPLSGZL.js +0 -2
- package/dist/chunks/app-server-evaluations-5YZUFXQ2.js +0 -2
- package/dist/chunks/app-server-harness-services-N5F5QVZI.js +0 -2
- package/dist/chunks/app-server-runtime-HJ2N57DL.js +0 -2
- package/dist/chunks/apps-WJTW64NW.js +0 -2
- package/dist/chunks/chunk-263WS3TB.js +0 -2
- package/dist/chunks/chunk-2UZHLO2V.js +0 -23
- package/dist/chunks/chunk-2W22IXHB.js +0 -2
- package/dist/chunks/chunk-46RMTR2Z.js +0 -2
- package/dist/chunks/chunk-4JJ4RYIB.js +0 -6
- package/dist/chunks/chunk-4NN5OLKW.js +0 -161
- package/dist/chunks/chunk-543QHE3D.js +0 -2
- package/dist/chunks/chunk-5QOFUGYQ.js +0 -2
- package/dist/chunks/chunk-5ZNE43XC.js +0 -10
- package/dist/chunks/chunk-6IS5OLI5.js +0 -2
- package/dist/chunks/chunk-7HAGSE7L.js +0 -2
- package/dist/chunks/chunk-AXYAEWWA.js +0 -2
- package/dist/chunks/chunk-B7XJBP4U.js +0 -2
- package/dist/chunks/chunk-BBIA24GD.js +0 -10
- package/dist/chunks/chunk-CJDGLPNX.js +0 -4
- package/dist/chunks/chunk-FCXDPVGJ.js +0 -3
- package/dist/chunks/chunk-FE2ENE3U.js +0 -2
- package/dist/chunks/chunk-H6EUFJJK.js +0 -2
- package/dist/chunks/chunk-IOSBGCRT.js +0 -2
- package/dist/chunks/chunk-K6DB5QWG.js +0 -2
- package/dist/chunks/chunk-LI56PPCN.js +0 -2
- package/dist/chunks/chunk-OE2OOWEQ.js +0 -2
- package/dist/chunks/chunk-OYIFH2OM.js +0 -2
- package/dist/chunks/chunk-QOUOU7FE.js +0 -22
- package/dist/chunks/chunk-R5GRESW3.js +0 -2
- package/dist/chunks/chunk-TERKCK4I.js +0 -2
- package/dist/chunks/chunk-TS5HNRZB.js +0 -2
- package/dist/chunks/chunk-V3KEG6MI.js +0 -2
- package/dist/chunks/chunk-WGISITX6.js +0 -4
- package/dist/chunks/chunk-XD4ZIQZ2.js +0 -2
- package/dist/chunks/chunk-XHU4BZQY.js +0 -13
- package/dist/chunks/chunk-ZWEY66RT.js +0 -2
- package/dist/chunks/cli-HV32F7HD.js +0 -2
- package/dist/chunks/connected-app-executor-DFHWNMRM.js +0 -2
- package/dist/chunks/connected-evidence-WOM6N5HO.js +0 -2
- package/dist/chunks/core-commands-GWRHH53F.js +0 -2
- package/dist/chunks/dataset-preparation-authoring-WJ2XEUO7.js +0 -4
- package/dist/chunks/datasets-XIMF54QN.js +0 -2
- package/dist/chunks/desktop-test-HF42V2EP.js +0 -3
- package/dist/chunks/dist-T6ES2TSM.js +0 -2
- package/dist/chunks/evaluation-coordination-WZT6FDMS.js +0 -2
- package/dist/chunks/experiment-improvements-H35VS6XZ.js +0 -2
- package/dist/chunks/experiments-F54C32EE.js +0 -2
- package/dist/chunks/experiments-signal-ONIGTGYR.js +0 -2
- package/dist/chunks/host-profile-evaluation-tools-LMCJ3MDJ.js +0 -2
- package/dist/chunks/host-profile-external-dataset-4HOXANWK.js +0 -2
- package/dist/chunks/hosted-app-server-composition-Y64A2A2B.js +0 -2
- package/dist/chunks/hosted-experiment-improvement-B2V2WIUI.js +0 -3
- package/dist/chunks/hosted-harness-runtime-C7I4KSDK.js +0 -2
- package/dist/chunks/hosted-profile-candidate-CXPVEEYQ.js +0 -3
- package/dist/chunks/hosted-profile-compiler-FGCI2VRW.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-control-INNUYMBD.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-inspection-UPTBRYMS.js +0 -3
- package/dist/chunks/hosted-profile-evaluation-preparation-TIQSVKLQ.js +0 -3
- package/dist/chunks/hosted-tasksets-7VMYOTIO.js +0 -2
- package/dist/chunks/human-review-7XC77NQP.js +0 -2
- package/dist/chunks/learning-3XDGIYUL.js +0 -2
- package/dist/chunks/local-harness-improvement-runtime-UIKQSAMM.js +0 -2
- package/dist/chunks/local-harness-taskset-review-6KJN3EQL.js +0 -2
- package/dist/chunks/opchat-NWYWWIA7.js +0 -3
- package/dist/chunks/opchat-bounded-chat-ICURZM6R.js +0 -2
- package/dist/chunks/organizations-7DBQGCCV.js +0 -2
- package/dist/chunks/project-action-payload-7DRABTHY.js +0 -2
- package/dist/chunks/project-agent-AXJOWXRU.js +0 -2
- package/dist/chunks/published-experiment-source-YBBPLNF2.js +0 -2
- package/dist/chunks/refiner-profile-service-ATEFPF5O.js +0 -2
- package/dist/chunks/sandbox-command-CF2PJCFX.js +0 -2
- package/dist/chunks/saved-work-3OAVRBH3.js +0 -2
- package/dist/chunks/setup-RHIMFI2Y.js +0 -2
- package/dist/chunks/src-V236S6MV.js +0 -424
- package/dist/chunks/standalone-experiment-turn-owner-CDRMGLWW.js +0 -2
- package/dist/chunks/store-chat-resources-P4EKCLSY.js +0 -2
- package/dist/chunks/store-conversation-serving-YFEZYQD3.js +0 -2
- package/dist/chunks/store-evaluation-results-VBH4R2U7.js +0 -7
- package/dist/chunks/store-human-review-RFCVZ3HP.js +0 -7
- package/dist/chunks/store-learned-preference-migration-validation-FNBGGZU6.js +0 -2
- package/dist/chunks/store-local-experiments-XPXGYXNM.js +0 -97
- package/dist/chunks/store-model-batch-review-J2L5JQV2.js +0 -2
- package/dist/chunks/store-model-project-preparation-OCLIFKI2.js +0 -2
- package/dist/chunks/store-taskset-drafts-BNKUVHPA.js +0 -9
- package/dist/chunks/taskset-packages-SXBLYHSP.js +0 -2
- package/dist/chunks/taskset-packages-V5T4V7YN.js +0 -2
- package/dist/chunks/tool-learning-47XQKELE.js +0 -2
- package/dist/chunks/training-7VQNCOGH.js +0 -2
- package/dist/chunks/training-VKLPNCMC.js +0 -2
- package/dist/chunks/training-hosted-NNE6BP6S.js +0 -2
- package/dist/chunks/training-hosted-serving-report-VZ4SMLMG.js +0 -2
- package/dist/chunks/training-model-start-G7YDZ7ZG.js +0 -2
- package/dist/chunks/web-search-56QRZGPR.js +0 -2
- package/dist/web/assets/App-DmEA-Lia.js +0 -53
- package/dist/web/assets/AppTerminalPanel-ScQKJV4z.js +0 -2
- package/dist/web/assets/AppsView-B1uNg9IQ.js +0 -1
- package/dist/web/assets/BrowserSidebar-DfVQoJHn.js +0 -1
- package/dist/web/assets/ChatTimelineEntry-Bbc6HRks.js +0 -8
- package/dist/web/assets/CommunityView-mO58f2B0.js +0 -1
- package/dist/web/assets/HostedModelLearningReview-BQIS7hkd.js +0 -1
- package/dist/web/assets/HostedModelLearningSettings-BQ-YeFMT.js +0 -1
- package/dist/web/assets/LabModelVersionDetailPage-BkHeVbAx.js +0 -1
- package/dist/web/assets/LabsRoute-CE45yAXJ.css +0 -1
- package/dist/web/assets/LabsRoute-YA9YckKj.js +0 -101
- package/dist/web/assets/MainChatThread-DpyPgGKW.js +0 -2
- package/dist/web/assets/MainPane-WOeodByM.js +0 -10
- package/dist/web/assets/NativeSetupTerminal-fmG2c65K.js +0 -2
- package/dist/web/assets/RightChatPanelStack-Bs7A4dLs.js +0 -1
- package/dist/web/assets/RightSidebarHomePanel-C-D4kba2.js +0 -1
- package/dist/web/assets/TeamChatView-DjmIaLO1.js +0 -1
- package/dist/web/assets/TrainingRunLineage-CtYe1KGX.js +0 -1
- package/dist/web/assets/WorkSidebarPanel-C6wWuo7U.js +0 -1
- package/dist/web/assets/WorkspaceDiffPanel-JDOUmrC-.js +0 -11
- package/dist/web/assets/WorkspaceEnvironmentMenu-sfL5LZeB.js +0 -35
- package/dist/web/assets/api-client-Dgz-fOMl.js +0 -1
- package/dist/web/assets/bot-Cd761lRF.js +0 -1
- package/dist/web/assets/chat-resources-BUDXdoG0.js +0 -1
- package/dist/web/assets/chevron-down-DEbd6Ek-.js +0 -1
- package/dist/web/assets/chevron-right-DLYNg_Oq.js +0 -1
- package/dist/web/assets/chevron-up-DFJJccDl.js +0 -1
- package/dist/web/assets/chunk-GHPCQXG5-DKDBSd8H.js +0 -9
- package/dist/web/assets/chunk-GJRXJL6G-luaxRTYI.js +0 -1
- package/dist/web/assets/chunk-JDQVAG3R-C0-rh1aR.js +0 -1
- package/dist/web/assets/chunk-XMVSQIK4-BBU7r_NH.js +0 -1
- package/dist/web/assets/client-BNjO4Xi8.js +0 -1
- package/dist/web/assets/cloud-upload-CoM1FGeB.js +0 -1
- package/dist/web/assets/common-CFsO2ppZ.js +0 -1
- package/dist/web/assets/copy-BGOhV6Pk.js +0 -1
- package/dist/web/assets/create-pipeline-DRR0Qeec.js +0 -1
- package/dist/web/assets/createLucideIcon-Bv-_eGcE.js +0 -1
- package/dist/web/assets/external-link-CVXsNeO3.js +0 -1
- package/dist/web/assets/folder-open-MnOmh19D.js +0 -1
- package/dist/web/assets/folder-plus-BRddLBtO.js +0 -1
- package/dist/web/assets/git-commit-horizontal-Bm4rkXug.js +0 -1
- package/dist/web/assets/icons-CZxmQtZs.js +0 -1
- package/dist/web/assets/image-BViGUAiq.js +0 -1
- package/dist/web/assets/info-DYPIbKKD.js +0 -1
- package/dist/web/assets/loader-circle-JFgFNsP5.js +0 -1
- package/dist/web/assets/maximize-2-DXZCQO0b.js +0 -1
- package/dist/web/assets/message-square-cOCAL8J1.js +0 -1
- package/dist/web/assets/models-route-CWcJuOd0.js +0 -1
- package/dist/web/assets/monitor-B35XSAvn.js +0 -1
- package/dist/web/assets/paperclip-CKgDxioG.js +0 -1
- package/dist/web/assets/play-DzqLr7fM.js +0 -1
- package/dist/web/assets/plus-Ddp1vXnw.js +0 -1
- package/dist/web/assets/presentation-B0S9v7ib.js +0 -1
- package/dist/web/assets/refresh-cw-D45mW-vs.js +0 -1
- package/dist/web/assets/reward-checks-D139zwha.js +0 -7
- package/dist/web/assets/save-Gu4R_82E.js +0 -1
- package/dist/web/assets/schemas-C9IwV7NS.js +0 -64
- package/dist/web/assets/settings-DdonLCIN.js +0 -21
- package/dist/web/assets/settings-lists-CFHFtO0D.js +0 -5
- package/dist/web/assets/square-Dqduqyyu.js +0 -1
- package/dist/web/assets/square-terminal-DS3zwi6X.js +0 -1
- package/dist/web/assets/training-QBuGBGJd.js +0 -2
- package/dist/web/assets/upload-ABSJxuUM.js +0 -1
- package/dist/web/assets/useQuery-CCjwL8VI.js +0 -1
- package/dist/web/assets/wifi-off-DGJH7Pke.js +0 -1
- package/dist/web/assets/work-outputs-CnbRtTLg.js +0 -1
- package/dist/web/assets/x-B-_zJVOZ.js +0 -1
- /package/dist/chunks/{chunk-SFR32TMJ.js → chunk-JXLDEYRW.js} +0 -0
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{b as a}from"./chunk-V5AOM5MZ.js";import"./chunk-EICS777E.js";import"./chunk-4EZI4KCT.js";import"./chunk-UOFDKMRU.js";import"./chunk-R6VI7MX5.js";import"./chunk-KQD36SBJ.js";import"./chunk-CSU7RDA5.js";import"./chunk-4TTXNVCE.js";import"./chunk-LZPCA6DH.js";import"./chunk-L3KS6MOV.js";import"./chunk-GUG2SWRZ.js";import"./chunk-G4747MOW.js";import"./chunk-KCJVFLBB.js";import"./chunk-BL3CZWWD.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-XGY4OQLC.js";import"./chunk-ULJZ7NUF.js";import"./chunk-TS5HNRZB.js";import"./chunk-5ZNE43XC.js";import"./chunk-HIQPGYVH.js";import"./chunk-263WS3TB.js";import"./chunk-SD2XDZQW.js";import"./chunk-MTP3B2SU.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-6FA3GG5B.js";import"./chunk-XHU4BZQY.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-SH7POUVX.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import"./chunk-UGOK7VTC.js";import"./chunk-FTQLQJQV.js";export{a as createStandaloneExperimentTurnOwner};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as O,b as D}from"./chunk-N54CPLVD.js";import{b as _,c as R,d as l,e as d}from"./chunk-XKZ4PFMQ.js";import{a as L}from"./chunk-KCJVFLBB.js";import{mc as c,nc as w}from"./chunk-CJDGLPNX.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-GD3RCUDH.js";import"./chunk-FCXDPVGJ.js";import"./chunk-UTIELP6F.js";import"./chunk-5TPYBXWM.js";import"./chunk-FYWQWKVS.js";import"./chunk-6ESBAHWK.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-7J2NMUTK.js";import"./chunk-W45RKGM6.js";import"./chunk-W45RKGM6.js";import"./chunk-543QHE3D.js";import"./chunk-LI56PPCN.js";import"./chunk-GI7LTJV3.js";import"./chunk-6LFTQBXP.js";import"./chunk-XGY4OQLC.js";import"./chunk-VPAEFG7X.js";import"./chunk-SFR32TMJ.js";import"./chunk-AXYAEWWA.js";import{r as m,u as f}from"./chunk-QOUOU7FE.js";import"./chunk-WJSJXK2N.js";import"./chunk-TS5HNRZB.js";import"./chunk-5ZNE43XC.js";import"./chunk-HIQPGYVH.js";import"./chunk-263WS3TB.js";import"./chunk-SD2XDZQW.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-6FA3GG5B.js";import"./chunk-XHU4BZQY.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import{n as y}from"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as g}from"./chunk-FTQLQJQV.js";import{randomUUID as H}from"node:crypto";var E=c.omit({workspace:!0}).extend({workspace:c.shape.workspace.omit({files:!0})}),k=class extends L{static{g(this,"SqliteChatResourceStore")}datasetListings=new Map;datasetListingDataVersion=null;async listChatHostedExperiments(){return await this.ready,await this.writeQueue,this.database.all("SELECT payload FROM chat_hosted_experiments ORDER BY id",[]).map(e=>JSON.parse(e.payload))}async readChatHostedExperiment(e){await this.ready,await this.writeQueue;let a=this.database.get("SELECT payload FROM chat_hosted_experiments WHERE id=?",[e]);return a?JSON.parse(a.payload):null}async retainChatHostedExperiment(e,a,s,t){await this.ready;let r=this.writeQueue.then(()=>{let i=this.database.get("SELECT owner_hash,configuration_hash FROM chat_hosted_experiments WHERE id=?",[e]);if(i&&(i.owner_hash!==a||i.configuration_hash!==s))throw new Error("The retained hosted Experiment changed owner or configuration.");this.database.run("INSERT INTO chat_hosted_experiments(id,owner_hash,configuration_hash,payload) VALUES(?,?,?,?) ON CONFLICT(id) DO UPDATE SET payload=excluded.payload",[e,a,s,JSON.stringify(t)])});return this.writeQueue=r.then(()=>{},()=>{}),r}async readChatExperimentGroup(e,a){await this.ready,await this.writeQueue;let s=this.database.get("SELECT request_hash,payload FROM chat_experiment_groups WHERE operation_id=?",[e]);if(!s)return null;if(a&&s.request_hash!==a)throw new Error("Experiment operation ID was reused with different inputs.");return JSON.parse(s.payload)}async prepareChatExperimentGroup(e,a,s){await this.ready;let t=this.writeQueue.then(()=>{this.database.run("INSERT OR IGNORE INTO chat_experiment_groups(operation_id,request_hash,payload) VALUES(?,?,?)",[e,a,JSON.stringify(s)]);let r=this.database.get("SELECT request_hash,payload FROM chat_experiment_groups WHERE operation_id=?",[e]);if(r.request_hash!==a)throw new Error("Experiment operation ID was reused with different inputs.");return JSON.parse(r.payload)});return this.writeQueue=t.then(()=>{},()=>{}),t}async localResourceOwnerId(){await this.ready;let e=this.writeQueue.then(()=>(this.database.run("INSERT OR IGNORE INTO local_resource_owner(singleton,id) VALUES(1,?)",[`local-owner-${H()}`]),this.database.get("SELECT id FROM local_resource_owner WHERE singleton=1",[]).id));return this.writeQueue=e.then(()=>{},()=>{}),e}async readLocalDataset(e,a){await this.ready,await this.writeQueue;let s=this.database.get(a===void 0?"SELECT r.payload FROM local_dataset_workspaces w JOIN local_dataset_records r ON r.record_hash=w.record_hash WHERE w.id=?":"SELECT r.payload FROM local_dataset_versions w JOIN local_dataset_records r ON r.record_hash=w.record_hash WHERE w.id=? AND w.revision=?",a===void 0?[e]:[e,a]);return s?d(this.database,s.payload):null}async readLocalDatasetByWorkspaceHash(e,a){await this.ready,await this.writeQueue;let s=this.database.get("SELECT r.payload FROM local_dataset_versions w JOIN local_dataset_records r ON r.record_hash=w.record_hash WHERE w.id=? AND json_extract(r.payload,'$.workspace.contentHash')=?",[e,a]);return s?d(this.database,s.payload):null}async listLocalDatasets(e=!1){if(e){let a=(await this.listLocalDatasetListings()).filter(t=>t.sync);return(await Promise.all(a.map(t=>this.readLocalDataset(t.workspace.draft.id)))).filter(t=>t!==null)}return await this.ready,await this.writeQueue,this.database.all("SELECT r.payload FROM local_dataset_workspaces w JOIN local_dataset_records r ON r.record_hash=w.record_hash ORDER BY w.updated_at DESC",[]).map(a=>d(this.database,a.payload))}async listLocalDatasetListings(){await this.ready,await this.writeQueue;let e=this.database.get("PRAGMA data_version",[]).data_version;this.datasetListingDataVersion!==e&&this.datasetListings.clear(),this.datasetListingDataVersion=e;let a=this.database.all("SELECT id,revision,updated_at FROM local_dataset_workspaces ORDER BY updated_at DESC",[]),s=new Set(a.map(t=>t.id));for(let t of this.datasetListings.keys())s.has(t)||this.datasetListings.delete(t);return a.map(t=>{let r=`${t.revision}:${t.updated_at}`,i=this.datasetListings.get(t.id);if(i?.stamp===r)return structuredClone(i.value);let o=this.database.get("SELECT json_remove(r.payload,'$.workspace.files') AS payload FROM local_dataset_workspaces w JOIN local_dataset_records r ON r.record_hash=w.record_hash WHERE w.id=?",[t.id]).payload,n=E.parse(l(this.database,o));return this.datasetListings.set(t.id,{stamp:r,value:n}),structuredClone(n)})}async readLocalDatasetListing(e,a){await this.ready,await this.writeQueue;let s=a===void 0?"local_dataset_workspaces":"local_dataset_versions",t=this.database.get(`SELECT json_remove(r.payload,'$.workspace.files') AS payload FROM ${s} w JOIN local_dataset_records r ON r.record_hash=w.record_hash WHERE w.id=?${a===void 0?"":" AND w.revision=?"}`,a===void 0?[e]:[e,a]);return t?E.parse(l(this.database,t.payload)):null}async readLocalDatasetProjection(e,a,s){await this.ready,await this.writeQueue;let t=s.workspaceHash?"w.id=? AND json_extract(r.payload,'$.workspace.contentHash')=?":s.revision===void 0?"w.id=?":"w.id=? AND w.revision=?",r=s.workspaceHash||s.revision!==void 0?"local_dataset_versions":"local_dataset_workspaces",i=s.workspaceHash?[e,s.workspaceHash]:s.revision===void 0?[e]:[e,s.revision],o=`${r} w JOIN local_dataset_records r ON r.record_hash=w.record_hash`,n=this.database.get(`SELECT json_remove(r.payload,'$.workspace.files') AS payload FROM ${o} WHERE ${t}`,i);if(!n)return null;let h=E.parse(l(this.database,n.payload)),{paths:I,policyPaths:N}=D(h.workspace.draft,a),p=[...N],u=[...I],S=p.length?`json_extract(file.value,'$.path') NOT IN (${p.map(()=>"?").join(",")})`:"1",b=u.length?` OR json_extract(file.value,'$.path') IN (${u.map(()=>"?").join(",")})`:"",v=this.database.all(`SELECT file.value AS payload FROM ${o},json_each(r.payload,'$.workspace.files') file WHERE ${t} AND (${S}${b})`,[...i,...p,...u]).map(x=>m.parse(R(this.database,JSON.parse(x.payload)))),T=h.workspace.contentHash,C=O({...h.workspace,files:v},a);return{record:c.parse({...h,workspace:C}),sourceWorkspaceHash:T}}async recoverLocalDatasetOperation(e,a){await this.ready,await this.writeQueue;let s=this.database.get("SELECT w.request_hash,r.payload FROM local_dataset_operations w JOIN local_dataset_records r ON r.record_hash=w.record_hash WHERE w.operation_id=?",[e]);if(!s)return null;if(s.request_hash!==a)throw new Error("Dataset operation ID was reused with different input.");return d(this.database,s.payload)}async saveLocalDataset(e){let a=c.parse(e.record);if(f(a.workspace,Number.POSITIVE_INFINITY),a.workspace.draft.profileId!==a.ownerId||a.workspace.draft.modelScope!==null)throw new Error("Independent local Dataset ownership cannot change.");await this.ready;let s=this.writeQueue.then(()=>{this.database.exec("BEGIN IMMEDIATE");try{let t=this.database.get("SELECT w.request_hash,r.payload FROM local_dataset_operations w JOIN local_dataset_records r ON r.record_hash=w.record_hash WHERE w.operation_id=?",[e.operationId]);if(t){if(t.request_hash!==e.requestHash)throw new Error("Dataset operation ID was reused with different input.");let n=d(this.database,t.payload);return this.database.exec("COMMIT"),n}let r=a.workspace.draft.id,i=this.database.get("SELECT w.revision,r.payload FROM local_dataset_workspaces w JOIN local_dataset_records r ON r.record_hash=w.record_hash WHERE w.id=?",[r]);if((i?.revision??0)!==e.expectedRevision)throw new Error("Dataset changed. Reload its saved revision before editing.");if(a.workspace.draft.revision!==e.expectedRevision+1)throw new Error("Dataset revisions must advance once per saved edit.");if(i){let n=d(this.database,i.payload);if(n.ownerId!==a.ownerId||n.projectId!==a.projectId||n.workspace.draft.createdAt!==a.workspace.draft.createdAt)throw new Error("Dataset ownership and origin cannot change.");a.sync=n.sync}let o=_(this.database,a);return this.database.run("INSERT INTO local_dataset_workspaces(id,revision,record_hash,updated_at) VALUES(?,?,?,?) ON CONFLICT(id) DO UPDATE SET revision=excluded.revision,record_hash=excluded.record_hash,updated_at=excluded.updated_at",[r,a.workspace.draft.revision,o,a.workspace.draft.updatedAt]),this.database.run("INSERT INTO local_dataset_versions(id,revision,record_hash) VALUES(?,?,?)",[r,a.workspace.draft.revision,o]),this.database.run("INSERT INTO local_dataset_operations(operation_id,request_hash,record_hash) VALUES(?,?,?)",[e.operationId,e.requestHash,o]),this.database.exec("COMMIT"),this.datasetListings.delete(r),a}catch(t){throw this.database.exec("ROLLBACK"),t}});return this.writeQueue=s.then(()=>{},()=>{}),s}async updateLocalDatasetMetadata(e,a,s){await this.ready;let t=this.writeQueue.then(()=>{this.database.exec("BEGIN IMMEDIATE");try{let r=this.database.get("SELECT r.payload FROM local_dataset_workspaces w JOIN local_dataset_records r ON r.record_hash=w.record_hash WHERE w.id=?",[e]);if(!r)throw new Error("Local Dataset was not found.");let i=d(this.database,r.payload);if(y(i)!==a)throw new Error("Dataset state changed. Retry against its latest saved state.");let o=c.parse(s(i));if(o.ownerId!==i.ownerId||o.projectId!==i.projectId||o.workspace.contentHash!==i.workspace.contentHash)throw new Error("Metadata updates cannot edit Dataset bytes or ownership.");let n=_(this.database,o);return this.database.run("UPDATE local_dataset_workspaces SET record_hash=? WHERE id=?",[n,e]),this.database.run("UPDATE local_dataset_versions SET record_hash=? WHERE id=? AND revision=?",[n,e,o.workspace.draft.revision]),this.database.exec("COMMIT"),this.datasetListings.delete(e),o}catch(r){throw this.database.exec("ROLLBACK"),r}});return this.writeQueue=t.then(()=>{},()=>{}),t}async linkChatResource(e,a,s){let t=w.parse(s);await this.upsertPayload("INSERT INTO chat_resource_links(session_id,turn_id,kind,resource_id,revision,payload) VALUES(?,?,?,?,?,?) ON CONFLICT(session_id,turn_id,kind,resource_id) DO UPDATE SET revision=excluded.revision,payload=excluded.payload WHERE excluded.revision>=chat_resource_links.revision",[e,a,t.kind,t.id,t.revision,JSON.stringify(t)])}async chatResourceLinks(e){await this.ready,await this.writeQueue;let a=[],s=[];return e.sessionId&&(a.push("session_id=?"),s.push(e.sessionId)),e.kind&&(a.push("kind=?"),s.push(e.kind)),e.id&&(a.push("resource_id=?"),s.push(e.id)),this.database.all(`SELECT session_id,turn_id,payload FROM chat_resource_links${a.length?` WHERE ${a.join(" AND ")}`:""}`,s).map(t=>({sessionId:t.session_id,turnId:t.turn_id,summary:w.parse(JSON.parse(t.payload))}))}};export{k as SqliteChatResourceStore};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as s,b as o}from"./chunk-WDKZMXIU.js";import{a as u}from"./chunk-KCJVFLBB.js";import"./chunk-FCXDPVGJ.js";import"./chunk-UTIELP6F.js";import"./chunk-5TPYBXWM.js";import"./chunk-7J2NMUTK.js";import"./chunk-W45RKGM6.js";import"./chunk-LI56PPCN.js";import"./chunk-6LFTQBXP.js";import"./chunk-XGY4OQLC.js";import"./chunk-VPAEFG7X.js";import"./chunk-QOUOU7FE.js";import"./chunk-TS5HNRZB.js";import"./chunk-5ZNE43XC.js";import"./chunk-HIQPGYVH.js";import"./chunk-263WS3TB.js";import"./chunk-SD2XDZQW.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-I6VMRQF4.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-XHU4BZQY.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as l}from"./chunk-FTQLQJQV.js";var T=class extends u{static{l(this,"SqliteConversationServingStore")}conversationTables=null;async ensureConversationTables(){if(await this.ready,!this.conversationTables){let e=this.writeQueue.then(async()=>{await this.exec("CREATE TABLE IF NOT EXISTS conversation_serving_grants (id TEXT PRIMARY KEY, revision INTEGER NOT NULL, payload TEXT NOT NULL)"),await this.exec("CREATE TABLE IF NOT EXISTS conversation_serving_executions (id TEXT PRIMARY KEY, grant_id TEXT NOT NULL, revision INTEGER NOT NULL, payload TEXT NOT NULL)")});this.writeQueue=e.catch(()=>{}),this.conversationTables=e}await this.conversationTables}async listConversationServingGrants(){return await this.ensureConversationTables(),await this.writeQueue,(await this.all("SELECT payload FROM conversation_serving_grants ORDER BY id",[])).map(e=>s.parse(JSON.parse(e.payload)))}async listConversationServingExecutions(e){return await this.ensureConversationTables(),await this.writeQueue,(await this.all("SELECT payload FROM conversation_serving_executions WHERE grant_id = ? ORDER BY id",[e])).map(i=>o.parse(JSON.parse(i.payload)))}async saveConversationServingGrant(e,i){let n=s.parse(e);return await this.saveConversationServingRow("conversation_serving_grants",n.id,n.revision,n,i),n}async saveConversationServingExecution(e,i){let n=o.parse(e);return await this.saveConversationServingRow("conversation_serving_executions",n.id,n.revision,n,i,n.grantId),n}async saveConversationServingRow(e,i,n,t,v,c){if(n!==v+1)throw new Error("Conversation serving revision is invalid.");await this.ensureConversationTables();let d=this.writeQueue.then(async()=>{await this.exec("BEGIN IMMEDIATE");try{let r=await this.get(`SELECT revision, payload FROM ${e} WHERE id = ?`,[i]);if((r?.revision??0)!==v)throw new Error("Conversation serving authority changed.");if(r){let a=JSON.parse(r.payload),g=t;if((e==="conversation_serving_grants"?["id","ownerInstanceId","teamId","profileId","projectId","hostedModelId","role","roleTargetId"]:["id","grantId","jobId","artifactHash","priorBindingId","leaseId","canarySeconds","createdAt"]).some(E=>a[E]!==g[E]))throw new Error("The retained serving identity cannot be replaced.")}if(e==="conversation_serving_grants"){let a=s.parse(t);if(a.enabled&&await this.get("SELECT id FROM conversation_serving_grants WHERE id != ? AND json_extract(payload, '$.enabled') = 1 AND json_extract(payload, '$.profileId') = ? AND json_extract(payload, '$.role') = ? AND json_extract(payload, '$.roleTargetId') = ? LIMIT 1",[i,a.profileId,a.role,a.roleTargetId]))throw new Error("This native serving target already has an enabled owner grant. Revoke it before registering another.")}r?await this.run(`UPDATE ${e} SET revision = ?, payload = ? WHERE id = ?`,[n,JSON.stringify(t),i]):c?await this.run(`INSERT INTO ${e} (id, grant_id, revision, payload) VALUES (?, ?, ?, ?)`,[i,c,n,JSON.stringify(t)]):await this.run(`INSERT INTO ${e} (id, revision, payload) VALUES (?, ?, ?)`,[i,n,JSON.stringify(t)]),await this.exec("COMMIT")}catch(r){throw await this.exec("ROLLBACK").catch(()=>{}),r}});this.writeQueue=d.catch(()=>{}),await d}};export{T as SqliteConversationServingStore};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as m}from"./chunk-K6DB5QWG.js";import{a as k}from"./chunk-KCJVFLBB.js";import{v as f}from"./chunk-CJDGLPNX.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-GD3RCUDH.js";import"./chunk-FCXDPVGJ.js";import"./chunk-UTIELP6F.js";import"./chunk-5TPYBXWM.js";import"./chunk-FYWQWKVS.js";import"./chunk-6ESBAHWK.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-7J2NMUTK.js";import"./chunk-W45RKGM6.js";import"./chunk-W45RKGM6.js";import"./chunk-543QHE3D.js";import"./chunk-LI56PPCN.js";import"./chunk-GI7LTJV3.js";import"./chunk-6LFTQBXP.js";import"./chunk-XGY4OQLC.js";import"./chunk-VPAEFG7X.js";import"./chunk-SFR32TMJ.js";import"./chunk-AXYAEWWA.js";import"./chunk-QOUOU7FE.js";import"./chunk-WJSJXK2N.js";import"./chunk-TS5HNRZB.js";import"./chunk-5ZNE43XC.js";import"./chunk-HIQPGYVH.js";import"./chunk-263WS3TB.js";import"./chunk-SD2XDZQW.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import{A as v,C as y,Hb as E,Ib as O,Ob as h,Pb as C,f as R,h as p,m as H}from"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-6FA3GG5B.js";import"./chunk-XHU4BZQY.js";import{Ka as P,m as _}from"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import{n as s,o as c}from"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as g}from"./chunk-FTQLQJQV.js";var w=class extends k{static{g(this,"SqliteEvaluationResultStore")}async saveProfileEvaluationGrade(a){let e=P.parse(a);c(e,"Profile evaluation grade");let n=await this.getProfileEvaluationGrade(e.contentHash);return n||(await this.upsertPayload("INSERT INTO profile_evaluation_grades (content_hash, payload) VALUES (?, ?) ON CONFLICT(content_hash) DO NOTHING",[e.contentHash,JSON.stringify(e)]),e)}async getProfileEvaluationGrade(a){return this.getParsedPayload("SELECT payload FROM profile_evaluation_grades WHERE content_hash = ?",[a],P.parse)}async saveProfileEvaluationReceipt(a){let e=R.parse(a);H(e);let n=await this.getProfileEvaluationReceipt(e.id);if(n){if(n.contentHash!==e.contentHash)throw new Error(`Profile evaluation receipt ${e.id} is immutable.`);return n}return await this.upsertPayload("INSERT INTO profile_evaluation_receipts (id, run_id, payload) VALUES (?, ?, ?)",[e.id,e.runManifest.id,JSON.stringify(e)]),e}async getProfileEvaluationReceipt(a){return this.getParsedPayload("SELECT payload FROM profile_evaluation_receipts WHERE id = ?",[a],R.parse)}async saveProfileEvaluationRun(a){let e=m.parse(a);c(e,"Profile evaluation run"),c(e.manifest,"Profile evaluation run manifest"),_(e.metric);let n=e.manifest.profileEvaluation;if(!n||n.profileId!==e.profileRef.profileId||e.metric.runManifest.id!==e.manifest.id||e.metric.runManifest.contentHash!==e.manifest.contentHash||s(e.receiptRefs)!==s(e.metric.receiptRefs))throw new Error("Profile evaluation run differs from its manifest or metric receipts.");if(e.receiptRefs.length!==e.manifest.population.length||e.gradeRefs.length!==e.receiptRefs.length)throw new Error("Profile evaluation run has an incomplete receipt or grade population.");for(let[t,u]of e.manifest.population.entries()){let d=e.receiptRefs[t],r=await this.getProfileEvaluationReceipt(d.id);if(!r||r.contentHash!==d.contentHash||r.runManifest.id!==e.manifest.id||r.runManifest.contentHash!==e.manifest.contentHash||r.id!==u.receiptId||r.taskId!==u.taskId||r.seed!==u.seed)throw new Error("Profile evaluation run references a missing or mismatched receipt.");let l=e.gradeRefs[t],o=await this.getProfileEvaluationGrade(l.contentHash);if(!o||o.contentHash!==l.contentHash||!r.graderEvidenceRefs.some(S=>S.id===l.id&&S.contentHash===l.contentHash))throw new Error("Profile evaluation run references a missing or mismatched grade.")}let i=await this.getProfileEvaluationRun(e.manifest.id);if(i){if(i.contentHash!==e.contentHash)throw new Error(`Profile evaluation run ${e.manifest.id} is immutable.`);return i}return await this.upsertPayload("INSERT INTO profile_evaluation_runs (id, profile_key, taskset_id, payload, created_at) VALUES (?, ?, ?, ?, ?)",[e.manifest.id,s(e.profileRef),e.manifest.tasksetRelease.id,JSON.stringify(e),e.completedAt]),e}async getProfileEvaluationRun(a){return this.getParsedPayload("SELECT payload FROM profile_evaluation_runs WHERE id = ?",[a],m.parse)}async listProfileEvaluationRuns(a){return this.listParsedPayloads("SELECT payload FROM profile_evaluation_runs WHERE profile_key = ? ORDER BY created_at DESC, id ASC",[s(f.parse(a))],m.parse)}async saveProfileEvaluationComparison(a,e){let n=f.parse(a),i=E.parse(e);c(i,"Profile evaluation comparison");let t=[];for(let d of i.members){let r=await this.getProfileEvaluationRun(d.runManifest.id);if(!r||s(r.profileRef)!==s(n)||r.manifest.contentHash!==d.runManifest.contentHash||r.metric.contentHash!==d.metricResultHash)throw new Error("Profile evaluation comparison references a missing or mismatched run.");t.push({manifest:r.manifest,result:r.metric})}if(O({id:i.id,members:t,createdAt:i.createdAt}).contentHash!==i.contentHash)throw new Error("Profile evaluation comparison differs from retained run evidence.");let u=await this.getProfileEvaluationComparison(i.id);if(u){if(u.contentHash!==i.contentHash)throw new Error(`Profile evaluation comparison ${i.id} is immutable.`);return u}return await this.upsertPayload("INSERT INTO profile_evaluation_comparisons (id, profile_key, payload, created_at) VALUES (?, ?, ?, ?)",[i.id,s(n),JSON.stringify(i),i.createdAt]),i}async getProfileEvaluationComparison(a){return this.getParsedPayload("SELECT payload FROM profile_evaluation_comparisons WHERE id = ?",[a],E.parse)}async listProfileEvaluationComparisons(a){return this.listParsedPayloads("SELECT payload FROM profile_evaluation_comparisons WHERE profile_key = ? ORDER BY created_at DESC, id ASC",[s(f.parse(a))],E.parse)}async saveProfileEvaluationSuiteRun(a,e,n){let i=f.parse(a),t=h.parse(n);c(t,"Profile evaluation suite run");let u=[];for(let l of t.members){let o=await this.getProfileEvaluationRun(l.runManifest.id);if(!o||s(o.profileRef)!==s(i)||o.manifest.contentHash!==l.runManifest.contentHash||o.contentHash!==l.runHash||o.passed!==l.passed||o.metric.value!==l.score)throw new Error("Profile evaluation suite references a missing or mismatched run.");u.push({definitionId:l.definitionId,manifest:o.manifest,runHash:o.contentHash,passed:o.passed,score:o.metric.value})}if(C({id:t.id,suiteId:t.suiteId,catalog:e,members:u,createdAt:t.createdAt,completedAt:t.completedAt}).contentHash!==t.contentHash)throw new Error("Profile evaluation suite differs from retained run evidence.");let r=await this.getProfileEvaluationSuiteRun(t.id);if(r){if(r.contentHash!==t.contentHash)throw new Error(`Profile evaluation suite run ${t.id} is immutable.`);return r}return await this.upsertPayload("INSERT INTO profile_evaluation_suite_runs (id, profile_key, payload, created_at) VALUES (?, ?, ?, ?)",[t.id,s(i),JSON.stringify(t),t.createdAt]),t}async getProfileEvaluationSuiteRun(a){return this.getParsedPayload("SELECT payload FROM profile_evaluation_suite_runs WHERE id = ?",[a],h.parse)}async listProfileEvaluationSuiteRuns(a){return this.listParsedPayloads("SELECT payload FROM profile_evaluation_suite_runs WHERE profile_key = ? ORDER BY created_at DESC, id ASC",[s(f.parse(a))],h.parse)}async saveBenchmarkRun(a){let e=v.parse(a.run);return c(e,"Benchmark run"),await this.upsertPayload(`INSERT INTO benchmark_runs (id, taskset_id, phase, payload, created_at)
|
|
3
|
-
VALUES (?, ?, ?, ?, ?)
|
|
4
|
-
ON CONFLICT(id) DO NOTHING`,[e.id,a.tasksetId,e.phase,JSON.stringify(e),e.createdAt]),e}async listBenchmarkRuns(a){return this.listParsedPayloads("SELECT payload FROM benchmark_runs WHERE taskset_id = ? ORDER BY created_at DESC, id ASC",[a],v.parse)}async saveBenchmarkComparison(a){let e=y.parse(a.comparison);return c(e,"Benchmark comparison"),await this.upsertPayload(`INSERT INTO benchmark_comparisons (id, taskset_id, payload, created_at)
|
|
5
|
-
VALUES (?, ?, ?, ?)
|
|
6
|
-
ON CONFLICT(id) DO NOTHING`,[e.id,a.tasksetId,JSON.stringify(e),e.createdAt]),e}async listBenchmarkComparisons(a){return this.listParsedPayloads("SELECT payload FROM benchmark_comparisons WHERE taskset_id = ? ORDER BY created_at DESC, id ASC",[a],y.parse)}async saveEvaluationResult(a){let e=p.parse(a.result);if(c(e,"Evaluation result"),e.metadata.sourceTasksetId!==a.tasksetId)throw new Error("Evaluation result does not match the supplied Taskset identity.");let n=await this.getEvaluationResult(e.id);if(n){if(n.contentHash!==e.contentHash)throw new Error(`Evaluation result ${e.id} is immutable and already has another content hash.`);return n}return await this.upsertPayload(`INSERT INTO evaluation_results (id, taskset_id, kind, payload, created_at)
|
|
7
|
-
VALUES (?, ?, ?, ?, ?)`,[e.id,a.tasksetId,a.kind,JSON.stringify(e),a.createdAt]),e}async getEvaluationResult(a){return this.getParsedPayload("SELECT payload FROM evaluation_results WHERE id = ?",[a],p.parse)}async listEvaluationResults(a,e){return this.listParsedPayloads(e?"SELECT payload FROM evaluation_results WHERE taskset_id = ? AND kind = ? ORDER BY created_at DESC, id ASC":"SELECT payload FROM evaluation_results WHERE taskset_id = ? ORDER BY created_at DESC, id ASC",e?[a,e]:[a],p.parse)}};export{m as LocalProfileEvaluationRunSchema,w as SqliteEvaluationResultStore};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as h,b as d,c as p,h as N}from"./chunk-MX7KV5DA.js";import"./chunk-R5GRESW3.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import{a as T}from"./chunk-KCJVFLBB.js";import"./chunk-CJDGLPNX.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-GD3RCUDH.js";import"./chunk-FCXDPVGJ.js";import"./chunk-UTIELP6F.js";import"./chunk-5TPYBXWM.js";import"./chunk-FYWQWKVS.js";import"./chunk-6ESBAHWK.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-7J2NMUTK.js";import"./chunk-W45RKGM6.js";import"./chunk-W45RKGM6.js";import"./chunk-543QHE3D.js";import"./chunk-LI56PPCN.js";import"./chunk-GI7LTJV3.js";import"./chunk-6LFTQBXP.js";import"./chunk-XGY4OQLC.js";import"./chunk-VPAEFG7X.js";import"./chunk-SFR32TMJ.js";import"./chunk-AXYAEWWA.js";import"./chunk-QOUOU7FE.js";import"./chunk-WJSJXK2N.js";import"./chunk-TS5HNRZB.js";import"./chunk-5ZNE43XC.js";import"./chunk-HIQPGYVH.js";import"./chunk-263WS3TB.js";import"./chunk-SD2XDZQW.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-6FA3GG5B.js";import"./chunk-XHU4BZQY.js";import{Aa as I,F as u}from"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import{n as l}from"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as c}from"./chunk-FTQLQJQV.js";function L(o,e){let i=d(o,e.scope,e.executionId);if(i.ownerActorId!==e.actorId||!i.completedAt)throw new Error("human_local_publication_source_denied");return o.exec("CREATE TABLE IF NOT EXISTS human_local_publications(scope TEXT NOT NULL,actor_id TEXT NOT NULL,execution_id TEXT NOT NULL,operation_id TEXT NOT NULL,execution_hash TEXT NOT NULL,publication TEXT NOT NULL,PRIMARY KEY(scope,actor_id,execution_id,operation_id))"),i}c(L,"setup");function w(o,e){if(L(o,e).executionHash!==e.executionHash)throw new Error("human_local_publication_source_changed");let t=o.get("SELECT publication,execution_hash FROM human_local_publications WHERE scope=? AND actor_id=? AND execution_id=? AND operation_id=?",[e.scope,e.actorId,e.executionId,e.operationId]);if(t){if(t.execution_hash!==e.executionHash||l(JSON.parse(t.publication))!==l(e.publication))throw new Error("human_local_publication_operation_conflict");return}o.run("INSERT INTO human_local_publications VALUES(?,?,?,?,?,?)",[e.scope,e.actorId,e.executionId,e.operationId,e.executionHash,JSON.stringify(e.publication)])}c(w,"retainHumanLocalPublication");function O(o,e){let i=L(o,e);return o.all("SELECT publication,execution_hash FROM human_local_publications WHERE scope=? AND actor_id=? AND execution_id=? ORDER BY operation_id LIMIT 1001",[e.scope,e.actorId,e.executionId]).map(t=>{if(t.execution_hash!==i.executionHash)throw new Error("human_local_publication_source_changed");return JSON.parse(t.publication)})}c(O,"readHumanLocalPublications");function _(o,e){let i=d(o,e.teamId,e.executionId);if(i.ownerActorId!==e.actorId)throw new Error("live_agent_account_denied");let t=o.get("SELECT owner_id FROM local_experiment_executions WHERE team_id=? AND id=?",[e.teamId,e.executionId]),n=p(o,e.teamId,e.executionId).find(g=>g.receiptId===e.receiptId);if(!n||n.admission.request.model.providerId!=="claude-code")throw new Error("live_agent_case_denied");let a=o.get("SELECT payload FROM local_experiment_events WHERE team_id=? AND execution_id=? AND case_id=? AND type='external.start' ORDER BY sequence LIMIT 1",[e.teamId,e.executionId,e.receiptId]);if(!a||JSON.parse(a.payload).sessionId!==e.sessionId)throw new Error("live_agent_session_stale");o.exec("CREATE TABLE IF NOT EXISTS human_live_controls(team_id TEXT NOT NULL,actor_id TEXT NOT NULL,operation_id TEXT NOT NULL,request_hash TEXT NOT NULL,state TEXT NOT NULL,PRIMARY KEY(team_id,actor_id,operation_id))");let{phase:r,ownerId:R,...E}=e,m=l(E),s=o.get("SELECT request_hash,state FROM human_live_controls WHERE team_id=? AND actor_id=? AND operation_id=?",[e.teamId,e.actorId,e.operationId]);if(s&&s.request_hash!==m)throw new Error("live_agent_operation_conflict");if(e.phase==="inspect")return s?{replay:!0,state:s.state}:null;if(N(o,e.ownerId),t?.owner_id!==e.ownerId)throw new Error("live_agent_execution_lease_lost");if(e.phase==="acknowledge"){if(!s)throw new Error("live_agent_operation_missing");return s.state==="acknowledged"?{replay:!0,state:"acknowledged"}:(v(o,e,"external.control_receipt",{sessionId:e.sessionId,operationId:e.operationId,action:e.action,transport:"process_stdin",state:"acknowledged",occurredAt:new Date().toISOString()}),o.run("UPDATE human_live_controls SET state='acknowledged' WHERE team_id=? AND actor_id=? AND operation_id=?",[e.teamId,e.actorId,e.operationId]),{replay:!1,state:"acknowledged"})}if(s)return{replay:!0,state:s.state};if(o.get("SELECT c.operation_id FROM human_live_controls c JOIN local_experiment_events e ON e.team_id=c.team_id AND json_extract(e.payload,'$.actorId')=c.actor_id AND json_extract(e.payload,'$.operationId')=c.operation_id WHERE c.team_id=? AND c.actor_id=? AND c.state='prepared' AND e.execution_id=? AND e.case_id=? AND e.type='external.human_intervention' LIMIT 1",[e.teamId,e.actorId,e.executionId,e.receiptId]))throw new Error("live_agent_prior_delivery_unknown");if(n.status!=="running"||i.completedAt)throw new Error("live_agent_already_sealed");return o.run("INSERT INTO human_live_controls VALUES(?,?,?,?,'prepared')",[e.teamId,e.actorId,e.operationId,m]),v(o,e,"external.human_intervention",{...E,occurredAt:new Date().toISOString()}),{replay:!1,state:"prepared"}}c(_,"writeHumanLiveControl");function v(o,e,i,t){let n=JSON.stringify(t),a=Buffer.byteLength(n),r=o.get("SELECT event_count,byte_count FROM local_experiment_trace_budgets WHERE team_id=? AND execution_id=?",[e.teamId,e.executionId]);if(a>1048576||(r?.event_count??0)>=2e4||(r?.byte_count??0)+a>67108864)throw new Error("live_agent_control_too_large");o.run("INSERT INTO local_experiment_events(team_id,execution_id,case_id,type,payload) VALUES(?,?,?,?,?)",[e.teamId,e.executionId,e.receiptId,i,n]),o.run("INSERT INTO local_experiment_trace_budgets(team_id,execution_id,event_count,byte_count) VALUES(?,?,1,?) ON CONFLICT(team_id,execution_id) DO UPDATE SET event_count=event_count+1,byte_count=byte_count+excluded.byte_count",[e.teamId,e.executionId,a])}c(v,"appendControlEvent");var y=`
|
|
3
|
-
CREATE TABLE IF NOT EXISTS human_review_revisions(scope TEXT NOT NULL,id TEXT NOT NULL,revision INTEGER NOT NULL,payload TEXT NOT NULL,PRIMARY KEY(scope,id,revision));
|
|
4
|
-
CREATE TABLE IF NOT EXISTS human_reviews(scope TEXT NOT NULL,id TEXT NOT NULL,revision INTEGER NOT NULL,project_id TEXT NOT NULL,payload TEXT NOT NULL,PRIMARY KEY(scope,id));
|
|
5
|
-
CREATE INDEX IF NOT EXISTS human_reviews_project_idx ON human_reviews(scope,project_id,id);
|
|
6
|
-
CREATE TABLE IF NOT EXISTS human_review_operations(scope TEXT NOT NULL,id TEXT NOT NULL,payload TEXT NOT NULL,PRIMARY KEY(scope,id));
|
|
7
|
-
`,x=class extends T{static{c(this,"SqliteHumanReviewStore")}async humanLiveControl(e){await this.ready;let i=this.writeQueue.then(()=>{let t=this.database;t.exec("BEGIN IMMEDIATE");try{let n=_(t,e);return t.exec("COMMIT"),n}catch(n){throw t.exec("ROLLBACK"),n}});return this.writeQueue=i.then(()=>{},()=>{}),i}async humanLiveControlReceipt(e){return await this.ready,await this.writeQueue,_(this.database,{...e,phase:"inspect"})}async rememberHumanLocalPublication(e){await this.ready;let i=this.writeQueue.then(()=>{let t=this.database;t.exec("BEGIN IMMEDIATE");try{w(t,e),t.exec("COMMIT")}catch(n){throw t.exec("ROLLBACK"),n}});return this.writeQueue=i.then(()=>{},()=>{}),i}async forgetHumanLocalPublication(e){await this.ready;let i=this.writeQueue.then(()=>{if(this.database.get("SELECT name FROM sqlite_master WHERE type='table' AND name='human_local_publications'"))return this.database.run("DELETE FROM human_local_publications WHERE scope=? AND actor_id=? AND json_extract(publication,'$.id')=?",[e.scope,e.actorId,e.publicationId])});return this.writeQueue=i.then(()=>{},()=>{}),i}async humanLocalPublications(e){return await this.ready,await this.writeQueue,O(this.database,e)}humanReviewRepository(){return{transaction:c(async(e,i)=>{await this.ready;let t=this.writeQueue.then(async()=>{let n=this.database;n.exec(y),n.exec("BEGIN IMMEDIATE");let a=!0;try{let r=await i(S(n,e,()=>{if(!a)throw new Error("human_transaction_closed")}));return n.exec("COMMIT"),r}catch(r){throw n.exec("ROLLBACK"),r}finally{a=!1}});return this.writeQueue=t.then(()=>{},()=>{}),t},"transaction")}}humanReviewLocalEvidence(e,i){let t=d(this.database,e,i),n=h(this.database,e,t.definition.id,t.definition.revision);return{execution:t,released:n,cases:p(this.database,e,i)}}};function S(o,e,i){return{async get(t,n){i();let a=n===void 0?o.get("SELECT payload FROM human_reviews WHERE scope=? AND id=?",[e,t]):o.get("SELECT payload FROM human_review_revisions WHERE scope=? AND id=? AND revision=?",[e,t,n]);return a?u.parse(JSON.parse(a.payload)):null},async put(t,n){i();let a=u.parse(t),r=o.get("SELECT revision FROM human_reviews WHERE scope=? AND id=?",[e,a.id]);if(a.scope!==e||a.revision!==n+1||(r?.revision??0)!==n)throw new I("human_revision_conflict",409);o.run("INSERT INTO human_review_revisions(scope,id,revision,payload) VALUES(?,?,?,?)",[e,a.id,a.revision,JSON.stringify(a)]),o.run("INSERT INTO human_reviews(scope,id,revision,project_id,payload) VALUES(?,?,?,?,?) ON CONFLICT(scope,id) DO UPDATE SET revision=excluded.revision,payload=excluded.payload",[e,a.id,a.revision,a.projectId,JSON.stringify(a)])},async list(t){i();let n=o.all(`SELECT payload FROM human_reviews WHERE scope=? ${t.projectId?"AND project_id=?":""} ${t.afterId?"AND id>?":""} ORDER BY id LIMIT ?`,[e,...t.projectId?[t.projectId]:[],...t.afterId?[t.afterId]:[],t.limit+1]),a=n.slice(0,t.limit).map(r=>u.parse(JSON.parse(r.payload)));return{items:a,nextCursor:n.length>t.limit?a.at(-1).id:null}},async operation(t){i();let n=o.get("SELECT payload FROM human_review_operations WHERE scope=? AND id=?",[e,t]);return n?JSON.parse(n.payload):null},async saveOperation(t,n){i(),o.run("INSERT INTO human_review_operations(scope,id,payload) VALUES(?,?,?)",[e,t,JSON.stringify(n)])}}}c(S,"createHumanReviewTransaction");export{y as HUMAN_REVIEW_SQL,x as SqliteHumanReviewStore,S as createHumanReviewTransaction};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import"./chunk-CJDGLPNX.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-GD3RCUDH.js";import{H as d}from"./chunk-FCXDPVGJ.js";import"./chunk-UTIELP6F.js";import"./chunk-5TPYBXWM.js";import"./chunk-FYWQWKVS.js";import"./chunk-6ESBAHWK.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-7J2NMUTK.js";import"./chunk-W45RKGM6.js";import"./chunk-W45RKGM6.js";import"./chunk-543QHE3D.js";import"./chunk-LI56PPCN.js";import"./chunk-GI7LTJV3.js";import"./chunk-6LFTQBXP.js";import"./chunk-XGY4OQLC.js";import"./chunk-VPAEFG7X.js";import"./chunk-SFR32TMJ.js";import"./chunk-AXYAEWWA.js";import"./chunk-QOUOU7FE.js";import"./chunk-WJSJXK2N.js";import"./chunk-TS5HNRZB.js";import"./chunk-5ZNE43XC.js";import"./chunk-HIQPGYVH.js";import"./chunk-263WS3TB.js";import"./chunk-SD2XDZQW.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-6FA3GG5B.js";import"./chunk-XHU4BZQY.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as s}from"./chunk-FTQLQJQV.js";function f(e){if(Array.isArray(e)){let r=!1,n=e.map(c=>{let t=f(c);return r||=t.changed,t.value});return{value:r?n:e,changed:r}}if(!u(e))return{value:e,changed:!1};let o=!1,i={};for(let[r,n]of Object.entries(e)){if(r==="learnedPreference"&&n!==null){let t=u(n)?Object.fromEntries(Object.entries(n).filter(([l])=>l!=="qualificationKind")):n,a=d.safeParse(t);i[r]=a.success?a.data:null,o||=!a.success||t!==n;continue}let c=f(n);i[r]=c.value,o||=c.changed}return{value:o?i:e,changed:o}}s(f,"sanitizeUnverifiableLearnedPreferenceBindings");function u(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}s(u,"isRecord");export{f as sanitizeUnverifiableLearnedPreferenceBindings};
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as D,c as j}from"./chunk-XVDFJ3ZF.js";import{a as N,b as u,c as R,d as E,e as w,f as v,g as M,h as x,i as P}from"./chunk-MX7KV5DA.js";import{h as s}from"./chunk-R5GRESW3.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import{a as F}from"./chunk-KCJVFLBB.js";import{Xb as f,_b as h,bc as O,cc as W}from"./chunk-CJDGLPNX.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-GD3RCUDH.js";import"./chunk-FCXDPVGJ.js";import"./chunk-UTIELP6F.js";import"./chunk-5TPYBXWM.js";import"./chunk-FYWQWKVS.js";import"./chunk-6ESBAHWK.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-7J2NMUTK.js";import"./chunk-W45RKGM6.js";import"./chunk-W45RKGM6.js";import"./chunk-543QHE3D.js";import"./chunk-LI56PPCN.js";import"./chunk-GI7LTJV3.js";import"./chunk-6LFTQBXP.js";import"./chunk-XGY4OQLC.js";import"./chunk-VPAEFG7X.js";import"./chunk-SFR32TMJ.js";import"./chunk-AXYAEWWA.js";import"./chunk-QOUOU7FE.js";import"./chunk-WJSJXK2N.js";import"./chunk-TS5HNRZB.js";import{ja as L}from"./chunk-5ZNE43XC.js";import"./chunk-HIQPGYVH.js";import"./chunk-263WS3TB.js";import"./chunk-SD2XDZQW.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-6FA3GG5B.js";import{e as y}from"./chunk-XHU4BZQY.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import{n as d}from"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import{A as I}from"./chunk-X2J2P5ZT.js";import{a as m}from"./chunk-FTQLQJQV.js";function J(c,e){let t=c.all(`SELECT e.id,e.payload,
|
|
3
|
-
COALESCE(json_extract(c.payload,'$.configuration.request.name'),json_extract(d.payload,'$.configuration.request.name')) AS name,
|
|
4
|
-
count(*) OVER () AS total FROM local_experiment_executions e
|
|
5
|
-
LEFT JOIN local_experiment_configurations c ON c.team_id=e.team_id AND c.execution_id=e.id
|
|
6
|
-
JOIN local_experiment_definitions d ON d.team_id=e.team_id AND d.id=e.definition_id AND d.revision=e.definition_revision
|
|
7
|
-
WHERE e.team_id=? AND json_extract(e.payload,'$.ownerActorId')=?
|
|
8
|
-
AND json_extract(e.payload,'$.status') IN ('queued','running','cancelling')
|
|
9
|
-
${e.projectId?"AND COALESCE(json_extract(c.payload,'$.configuration.request.project.id'),json_extract(d.payload,'$.configuration.request.project.id'))=?":""}
|
|
10
|
-
ORDER BY json_extract(e.payload,'$.updatedAt') DESC,e.id DESC LIMIT ?`,[e.teamId,e.actorId,...e.projectId?[e.projectId]:[],e.limit]);return{count:Number(t[0]?.total??0),items:t.map(n=>{let i=JSON.parse(n.payload);return{kind:"experiment",location:"local",id:n.id,name:n.name??"Experiment",phase:i.status,updatedAt:i.updatedAt??i.startedAt??i.createdAt}})}}m(J,"readLocalExecutionActivity");var Y=`
|
|
11
|
-
CREATE TABLE IF NOT EXISTS local_experiment_owner (
|
|
12
|
-
singleton INTEGER PRIMARY KEY CHECK(singleton=1), owner_id TEXT NOT NULL,
|
|
13
|
-
pid INTEGER NOT NULL, lease_until INTEGER NOT NULL
|
|
14
|
-
);
|
|
15
|
-
CREATE TABLE IF NOT EXISTS local_experiment_definitions (
|
|
16
|
-
team_id TEXT NOT NULL, id TEXT NOT NULL, revision INTEGER NOT NULL,
|
|
17
|
-
content_hash TEXT NOT NULL, project_id TEXT, payload TEXT NOT NULL, package_payload TEXT NOT NULL,
|
|
18
|
-
PRIMARY KEY (team_id,id,revision)
|
|
19
|
-
);
|
|
20
|
-
CREATE TABLE IF NOT EXISTS local_experiment_operations (
|
|
21
|
-
team_id TEXT NOT NULL, operation_id TEXT NOT NULL, kind TEXT NOT NULL,
|
|
22
|
-
intent_hash TEXT NOT NULL, receipt TEXT NOT NULL, PRIMARY KEY (team_id,operation_id)
|
|
23
|
-
);
|
|
24
|
-
CREATE TABLE IF NOT EXISTS local_experiment_executions (
|
|
25
|
-
team_id TEXT NOT NULL, id TEXT NOT NULL, definition_id TEXT NOT NULL, definition_revision INTEGER NOT NULL,
|
|
26
|
-
owner_id TEXT NOT NULL, payload TEXT NOT NULL, PRIMARY KEY (team_id,id)
|
|
27
|
-
);
|
|
28
|
-
CREATE TABLE IF NOT EXISTS local_experiment_cases (
|
|
29
|
-
team_id TEXT NOT NULL, execution_id TEXT NOT NULL, receipt_id TEXT NOT NULL, ordinal INTEGER NOT NULL,
|
|
30
|
-
status TEXT NOT NULL, admission TEXT NOT NULL, result TEXT, error TEXT,
|
|
31
|
-
PRIMARY KEY (team_id,execution_id,receipt_id), UNIQUE (team_id,execution_id,ordinal),
|
|
32
|
-
FOREIGN KEY (team_id,execution_id) REFERENCES local_experiment_executions(team_id,id)
|
|
33
|
-
);
|
|
34
|
-
CREATE TABLE IF NOT EXISTS local_experiment_configurations (
|
|
35
|
-
team_id TEXT NOT NULL, execution_id TEXT NOT NULL, payload TEXT NOT NULL, package_payload TEXT NOT NULL,
|
|
36
|
-
PRIMARY KEY(team_id,execution_id),
|
|
37
|
-
FOREIGN KEY (team_id,execution_id) REFERENCES local_experiment_executions(team_id,id)
|
|
38
|
-
);
|
|
39
|
-
CREATE TABLE IF NOT EXISTS local_experiment_charges (
|
|
40
|
-
team_id TEXT NOT NULL, execution_id TEXT NOT NULL, request_id TEXT NOT NULL, case_id TEXT NOT NULL,
|
|
41
|
-
maximum_usd REAL NOT NULL CHECK(maximum_usd >= 0), cost_usd REAL CHECK(cost_usd >= 0),
|
|
42
|
-
status TEXT NOT NULL, usage TEXT,
|
|
43
|
-
PRIMARY KEY(team_id,execution_id,request_id),
|
|
44
|
-
FOREIGN KEY (team_id,execution_id) REFERENCES local_experiment_executions(team_id,id)
|
|
45
|
-
);
|
|
46
|
-
CREATE TABLE IF NOT EXISTS local_experiment_scoring_selections (
|
|
47
|
-
team_id TEXT NOT NULL, execution_id TEXT NOT NULL, source_execution_id TEXT NOT NULL,
|
|
48
|
-
package_payload TEXT NOT NULL, graders TEXT NOT NULL,
|
|
49
|
-
PRIMARY KEY(team_id,execution_id),
|
|
50
|
-
FOREIGN KEY (team_id,execution_id) REFERENCES local_experiment_executions(team_id,id)
|
|
51
|
-
);
|
|
52
|
-
CREATE TABLE IF NOT EXISTS local_experiment_judge_budgets (
|
|
53
|
-
team_id TEXT NOT NULL, execution_id TEXT NOT NULL, calls TEXT NOT NULL,
|
|
54
|
-
PRIMARY KEY(team_id,execution_id),
|
|
55
|
-
FOREIGN KEY (team_id,execution_id) REFERENCES local_experiment_executions(team_id,id)
|
|
56
|
-
);
|
|
57
|
-
CREATE TABLE IF NOT EXISTS local_experiment_events (
|
|
58
|
-
sequence INTEGER PRIMARY KEY AUTOINCREMENT, team_id TEXT NOT NULL, execution_id TEXT NOT NULL,
|
|
59
|
-
case_id TEXT NOT NULL, type TEXT NOT NULL, payload TEXT NOT NULL,
|
|
60
|
-
FOREIGN KEY (team_id,execution_id) REFERENCES local_experiment_executions(team_id,id)
|
|
61
|
-
);
|
|
62
|
-
CREATE TABLE IF NOT EXISTS local_experiment_trace_budgets (
|
|
63
|
-
team_id TEXT NOT NULL, execution_id TEXT NOT NULL, event_count INTEGER NOT NULL, byte_count INTEGER NOT NULL,
|
|
64
|
-
PRIMARY KEY(team_id,execution_id), FOREIGN KEY (team_id,execution_id) REFERENCES local_experiment_executions(team_id,id)
|
|
65
|
-
);
|
|
66
|
-
CREATE INDEX IF NOT EXISTS local_experiment_case_events ON local_experiment_events(team_id,execution_id,case_id,sequence);
|
|
67
|
-
CREATE INDEX IF NOT EXISTS local_experiment_definition_project ON local_experiment_definitions(team_id,project_id,id);
|
|
68
|
-
CREATE INDEX IF NOT EXISTS local_experiment_execution_definition ON local_experiment_executions(team_id,definition_id,id);
|
|
69
|
-
`;import{randomUUID as ie}from"node:crypto";var C=I.string().regex(/^[a-f0-9]{64}$/),H=I.object({scopeHash:C,action:I.string().trim().min(1).max(100),intentHash:C}).strict(),B=["advanced-refiner-start","experiment-evaluation-schedule"],$=`CREATE TABLE IF NOT EXISTS evaluation_operation_intents (
|
|
70
|
-
scope_hash TEXT NOT NULL,action TEXT NOT NULL,intent_hash TEXT NOT NULL,
|
|
71
|
-
operation_id TEXT NOT NULL,created_at TEXT NOT NULL,acknowledged_at TEXT,
|
|
72
|
-
PRIMARY KEY(scope_hash,action,intent_hash)
|
|
73
|
-
);
|
|
74
|
-
CREATE TABLE IF NOT EXISTS evaluation_operation_reviewed_payloads (
|
|
75
|
-
scope_hash TEXT NOT NULL,action TEXT NOT NULL,intent_hash TEXT NOT NULL,
|
|
76
|
-
operation_id TEXT NOT NULL,payload TEXT NOT NULL,command TEXT,phase TEXT NOT NULL,
|
|
77
|
-
PRIMARY KEY(scope_hash,action,intent_hash)
|
|
78
|
-
);
|
|
79
|
-
CREATE TABLE IF NOT EXISTS evaluation_operation_acknowledged_history (
|
|
80
|
-
scope_hash TEXT NOT NULL,action TEXT NOT NULL,intent_hash TEXT NOT NULL,
|
|
81
|
-
operation_id TEXT PRIMARY KEY,created_at TEXT NOT NULL,acknowledged_at TEXT NOT NULL,
|
|
82
|
-
payload TEXT,command TEXT,phase TEXT
|
|
83
|
-
);`;function U(c,e){let t=[e.scopeHash,e.action,e.intentHash,e.id];return c.get("SELECT i.operation_id,i.created_at,i.acknowledged_at,p.payload,p.command,p.phase FROM evaluation_operation_intents i LEFT JOIN evaluation_operation_reviewed_payloads p USING(scope_hash,action,intent_hash,operation_id) WHERE i.scope_hash=? AND i.action=? AND i.intent_hash=? AND i.operation_id=?",t)??c.get("SELECT operation_id,created_at,acknowledged_at,payload,command,phase FROM evaluation_operation_acknowledged_history WHERE scope_hash=? AND action=? AND intent_hash=? AND operation_id=?",t)}m(U,"retainedRow");function G(c,e,t){c.run("INSERT OR IGNORE INTO evaluation_operation_acknowledged_history(scope_hash,action,intent_hash,operation_id,created_at,acknowledged_at,payload,command,phase) SELECT i.scope_hash,i.action,i.intent_hash,i.operation_id,i.created_at,i.acknowledged_at,p.payload,p.command,p.phase FROM evaluation_operation_intents i LEFT JOIN evaluation_operation_reviewed_payloads p USING(scope_hash,action,intent_hash,operation_id) WHERE i.scope_hash=? AND i.action=? AND i.intent_hash=? AND i.operation_id=? AND i.acknowledged_at IS NOT NULL",[e.scopeHash,e.action,e.intentHash,t])}m(G,"archiveAcknowledged");function K(c){let e=JSON.stringify(c);if(e===void 0||Buffer.byteLength(e,"utf8")>1048576)throw new Error("Reviewed operation payload exceeds 1 MiB.");return e}m(K,"bounded");function k(c){if(!B.some(e=>e===c))throw new Error("This action does not admit recoverable reviewed payloads.")}m(k,"retainable");function V(c,e){let t=H.parse({scopeHash:e.scopeHash,action:e.action,intentHash:e.intentHash}),n;if(e.reviewedIntent!==void 0){if(k(t.action),d(e.reviewedIntent)!==t.intentHash)throw new Error("Reviewed intent changed its exact hash.");n=K(e.reviewedIntent)}let i=c.get("SELECT operation_id,created_at,acknowledged_at FROM evaluation_operation_intents WHERE scope_hash=? AND action=? AND intent_hash=?",[t.scopeHash,t.action,t.intentHash]);if((!i||i.acknowledged_at)&&B.some(r=>r===t.action)&&c.get("SELECT i.operation_id FROM evaluation_operation_intents i LEFT JOIN evaluation_operation_reviewed_payloads p USING(scope_hash,action,intent_hash,operation_id) WHERE i.scope_hash=? AND i.action=? AND i.acknowledged_at IS NULL AND (p.phase='dispatching' OR p.payload IS NULL) LIMIT 1",[t.scopeHash,t.action]))throw new Error("Recover the original uncertain operation before preparing another reviewed intent.");let a=i&&!i.acknowledged_at?i.operation_id:ie(),o=i&&!i.acknowledged_at?i.created_at:new Date().toISOString();if((!i||i.acknowledged_at)&&(i?.acknowledged_at&&G(c,t,i.operation_id),c.run("INSERT INTO evaluation_operation_intents(scope_hash,action,intent_hash,operation_id,created_at) VALUES(?,?,?,?,?) ON CONFLICT(scope_hash,action,intent_hash) DO UPDATE SET operation_id=excluded.operation_id,created_at=excluded.created_at,acknowledged_at=NULL",[t.scopeHash,t.action,t.intentHash,a,o]),c.run("DELETE FROM evaluation_operation_reviewed_payloads WHERE scope_hash=? AND action=? AND intent_hash=?",[t.scopeHash,t.action,t.intentHash])),n!==void 0){let r=c.get("SELECT operation_id,payload FROM evaluation_operation_reviewed_payloads WHERE scope_hash=? AND action=? AND intent_hash=?",[t.scopeHash,t.action,t.intentHash]);if(r&&(r.operation_id!==a||d(JSON.parse(r.payload))!==t.intentHash))throw new Error("The retained reviewed payload belongs to another exact operation.");r||c.run("INSERT INTO evaluation_operation_reviewed_payloads(scope_hash,action,intent_hash,operation_id,payload,phase) VALUES(?,?,?,?,?,'reviewed')",[t.scopeHash,t.action,t.intentHash,a,n])}return{id:a,createdAt:o}}m(V,"prepareEvaluationOperation");function b(c,e){k(e.action);let t=H.parse({scopeHash:e.scopeHash,action:e.action,intentHash:e.intentHash}),n=K(e.command),i=U(c,{...t,id:e.id});if(!i?.payload||d(JSON.parse(i.payload))!==t.intentHash)throw new Error("The reviewed command requires its exact retained operation.");if(i.command&&d(JSON.parse(i.command))!==d(e.command))throw new Error("The reviewed command is immutable.");if(Buffer.byteLength(i.payload,"utf8")+Buffer.byteLength(n,"utf8")>1048576)throw new Error("Reviewed intent and command exceed 1 MiB.");let a=i.phase==="dispatching"?"dispatching":e.phase;if(i.acknowledged_at){if(!i.command||i.phase!=="dispatching")throw new Error("The original reviewed command was discarded before dispatch.");return{retained:!0,phase:i.phase??a}}return c.run("UPDATE evaluation_operation_reviewed_payloads SET command=?,phase=? WHERE scope_hash=? AND action=? AND intent_hash=? AND operation_id=?",[n,a,t.scopeHash,t.action,t.intentHash,e.id]),{retained:!0,phase:a}}m(b,"retainEvaluationOperation");function Q(c,e){k(e.action);let t=C.parse(e.scopeHash),n=I.number().int().min(1).max(100).parse(e.limit??100),i=c.all("SELECT i.operation_id,i.intent_hash,i.created_at,p.payload,p.command,p.phase FROM evaluation_operation_intents i LEFT JOIN evaluation_operation_reviewed_payloads p USING(scope_hash,action,intent_hash,operation_id) WHERE i.scope_hash=? AND i.action=? AND i.acknowledged_at IS NULL AND i.operation_id>? ORDER BY i.operation_id LIMIT ?",[t,e.action,e.cursor??"",n]);return{items:i.map(a=>({id:a.operation_id,action:e.action,intentHash:a.intent_hash,createdAt:a.created_at,reviewedIntent:a.payload?JSON.parse(a.payload):null,command:a.command?JSON.parse(a.command):null,phase:a.phase,recoveryReady:!!(a.payload&&a.command)})),nextCursor:i.length===n?i.at(-1).operation_id:null}}m(Q,"pendingEvaluationOperations");function z(c,e){let t=U(c,e);if(!t?.payload||!t.phase)throw new Error("The original reviewed operation payload is unavailable; recover its actual canonical receipt.");let n=JSON.parse(t.payload);if(d(n)!==e.intentHash)throw new Error("Retained reviewed intent hash changed.");return{reviewedIntent:n,command:t.command?JSON.parse(t.command):null,phase:t.phase}}m(z,"readPendingEvaluationOperation");function Z(c,e){let t=H.parse({scopeHash:e.scopeHash,action:e.action,intentHash:e.intentHash}),n=U(c,{...t,id:e.id});if(!n)throw new Error("This acknowledgement does not own the retained operation intent.");if(e.expectedPhase&&n.phase!==e.expectedPhase)throw new Error("The reviewed command crossed dispatch; recover its canonical receipt before acknowledgement.");return n.acknowledged_at?{acknowledged:!0}:(c.run("UPDATE evaluation_operation_intents SET acknowledged_at=COALESCE(acknowledged_at,?) WHERE scope_hash=? AND action=? AND intent_hash=? AND operation_id=?",[new Date().toISOString(),t.scopeHash,t.action,t.intentHash,e.id]),G(c,t,e.id),{acknowledged:!0})}m(Z,"acknowledgeEvaluationOperation");function q(c,e){if(e.kind!=="target")throw new s("local_experiment_not_found","This id names a scoring pass, not an Experiment.",404);let t=c.get("SELECT payload,package_payload FROM local_experiment_configurations WHERE team_id=? AND execution_id=?",[e.teamId,e.id]);if(t){let p=O.parse(JSON.parse(t.payload)),T=L(JSON.parse(t.package_payload));if(p.packageHash!==T.contentHash||p.packageHash!==e.packageHash)throw new s("local_package_pin_conflict","The retained Experiment package differs from its admission.");return{snapshot:p,package:T}}let n=N(c,e.teamId,e.definition.id,e.definition.revision),i=n.definition,a=L(n.package),{contentHash:o,...r}=i;if(d(r)!==o)throw new s("local_configuration_pin_conflict","The retained configuration bytes differ from their sealed hash.");if(i.contentHash!==e.definition.contentHash||i.ownerActorId!==e.ownerActorId||i.teamId!==e.teamId||i.packageHash!==e.packageHash||a.contentHash!==e.packageHash)throw new s("local_configuration_pin_conflict","The retained Experiment configuration differs from its owner or immutable admission.");let _=i.configuration,g={configuration:{operationId:e.operationId,request:{..._.request,operationId:e.operationId},maximumCostUsd:_.maximumCostUsd,..._.graders?{graders:_.graders}:{}},model:i.model,packageHash:i.packageHash,graders:i.graders,availableGraders:i.availableGraders,retainedConfigurationHash:i.contentHash},l=O.parse({...g,configurationHash:d(g)});return X(c,e,l,a),{snapshot:l,package:a}}m(q,"localFlatSnapshot");function X(c,e,t,n){c.run("INSERT INTO local_experiment_configurations(team_id,execution_id,payload,package_payload) VALUES(?,?,?,?)",[e.teamId,e.id,JSON.stringify(t),JSON.stringify(n)])}m(X,"writeLocalFlatSnapshot");function S(c,e,t){let n=u(c,e,t),{snapshot:i}=q(c,n),{definition:a,...o}=n;return W.parse({...o,...i})}m(S,"localFlatRecord");var ee=class extends F{static{m(this,"SqliteLocalExperimentStore")}localTablesReady=!1;async localWrite(e){await this.ready;let t=this.writeQueue.then(()=>{let n=this.database;this.localTablesReady||(n.exec(Y),n.exec($),this.localTablesReady=!0),n.exec("BEGIN IMMEDIATE");try{let i=e(n);return n.exec("COMMIT"),i}catch(i){throw n.exec("ROLLBACK"),i}});return this.writeQueue=t.then(()=>{},()=>{}),t}async prepareEvaluationOperation(e){return this.localWrite(t=>V(t,e))}async retainEvaluationOperation(e){return this.localWrite(t=>b(t,e))}async readPendingEvaluationOperation(e){return this.localWrite(t=>z(t,e))}async pendingEvaluationOperations(e){return this.localWrite(t=>Q(t,e))}async acknowledgeEvaluationOperation(e){return this.localWrite(t=>Z(t,e))}async claimLocalExperimentOwner(e,t=process.pid){return this.localWrite(n=>M(n,e,t))}async renewLocalExperimentOwner(e){return this.localWrite(t=>P(t,e))}async releaseLocalExperimentOwner(e){return this.localWrite(t=>t.run("DELETE FROM local_experiment_owner WHERE singleton=1 AND owner_id=?",[e]))}async saveLocalExperiment(e){let t=f.parse(e.definition);return this.localWrite(n=>w(n,t.teamId,e.operationId,"save",e.intentHash,()=>{let i=n.get("SELECT MAX(revision) AS revision FROM local_experiment_definitions WHERE team_id=? AND id=?",[t.teamId,t.id]);if(i?.revision&&N(n,t.teamId,t.id).definition.ownerActorId!==t.ownerActorId)throw new s("local_resource_denied","This local resource belongs to another account.",404);if((i?.revision??0)!==e.expectedRevision||t.revision!==e.expectedRevision+1)throw new s("local_definition_revision_conflict","The Experiment changed. Reload its saved revision before editing.");return v(n,t,e.package),t}))}async readLocalExperiment(e,t,n){return this.localWrite(i=>N(i,e,t,n))}async recoverLocalExperimentOperation(e,t,n,i){return this.localWrite(a=>{let o=a.get("SELECT kind,intent_hash,receipt FROM local_experiment_operations WHERE team_id=? AND operation_id=?",[e,t]);if(!o)return null;if(o.kind!==n||o.intent_hash!==i)throw new s("local_operation_conflict","This operation already owns different immutable inputs.");return JSON.parse(o.receipt)})}async listLocalExperiments(e){return this.localWrite(t=>{let n=t.all(`SELECT d.payload FROM local_experiment_definitions d WHERE d.team_id=? AND json_extract(d.payload,'$.ownerActorId')=?
|
|
84
|
-
AND d.revision=(SELECT MAX(revision) FROM local_experiment_definitions v WHERE v.team_id=d.team_id AND v.id=d.id)
|
|
85
|
-
${e.projectId?"AND d.project_id=?":""} ${e.afterId?"AND d.id>?":""} ORDER BY d.id LIMIT ?`,[e.teamId,e.ownerActorId,...e.projectId?[e.projectId]:[],...e.afterId?[e.afterId]:[],e.limit+1]),i=n.slice(0,e.limit).map(a=>f.parse(JSON.parse(a.payload)));return{items:i,nextCursor:n.length>e.limit?i.at(-1).id:null}})}async listLocalExecutionHistory(e){return this.localWrite(t=>{let n=t.all(`SELECT e.payload AS execution,d.payload AS definition,e.id FROM local_experiment_executions e
|
|
86
|
-
JOIN local_experiment_definitions d ON d.team_id=e.team_id AND d.id=e.definition_id AND d.revision=e.definition_revision
|
|
87
|
-
WHERE e.team_id=? AND json_extract(e.payload,'$.ownerActorId')=?
|
|
88
|
-
${e.projectId?"AND d.project_id=?":""} ${e.afterId?"AND e.id>?":""} ORDER BY e.id LIMIT ?`,[e.teamId,e.ownerActorId,...e.projectId?[e.projectId]:[],...e.afterId?[e.afterId]:[],e.limit+1]),i=n.slice(0,e.limit).map(a=>({execution:h.parse(JSON.parse(a.execution)),definition:f.parse(JSON.parse(a.definition))}));return{items:i,nextCursor:n.length>e.limit?i.at(-1).execution.id:null}})}async startLocalExperiment(e){return this.localWrite(t=>w(t,e.execution.teamId,e.operationId,"start",e.intentHash,()=>{x(t,e.ownerId);let n=h.parse(e.execution),i=n.definition,a=N(t,n.teamId,i.id,i.revision).definition;if(a.ownerActorId!==n.ownerActorId)throw new s("local_resource_denied","This local resource belongs to another account.",404);if(a.contentHash!==i.contentHash||a.packageHash!==n.packageHash||a.configuration.maximumCostUsd!==n.maximumCostUsd)throw new s("local_definition_pin_conflict","Execution requires its exact retained definition and package.");if(!e.admissions.length||e.admissions.length!==n.counts.pending||new Set(e.admissions.map(o=>o.receiptId)).size!==e.admissions.length)throw new s("local_population_conflict","Execution admissions must cover the exact unique population.");return t.run("INSERT INTO local_experiment_executions(team_id,id,definition_id,definition_revision,owner_id,payload) VALUES(?,?,?,?,?,?)",[n.teamId,n.id,i.id,i.revision,e.ownerId,JSON.stringify(n)]),e.admissions.forEach((o,r)=>t.run("INSERT INTO local_experiment_cases(team_id,execution_id,receipt_id,ordinal,status,admission) VALUES(?,?,?,?,?,?)",[n.teamId,n.id,o.receiptId,r,"pending",JSON.stringify(o)])),n}))}async admitLocalExperimentRun(e){let t=D(),n=m(i=>w(i,e.execution.teamId,e.execution.operationId,"run",e.intentHash,()=>{x(i,e.ownerId);let a=h.parse(e.execution),o=f.parse(e.definition),r=O.parse(e.snapshot),_=a.definition,g=L(e.package),{contentHash:l,...p}=o,{sourceExperimentId:T,...te}=r.configuration;if(a.kind!=="target"||o.ownerActorId!==a.ownerActorId||o.teamId!==a.teamId||d(p)!==l||d({...te,expectedRevision:0})!==d(o.configuration)||o.id!==_.id||o.revision!==_.revision||o.contentHash!==_.contentHash||g.contentHash!==r.packageHash||r.packageHash!==a.packageHash||r.configuration.maximumCostUsd!==a.maximumCostUsd||r.configuration.operationId!==a.operationId||r.configuration.request.teamId!==a.teamId||d(r.model)!==d(o.model)||d(r.graders)!==d(o.graders))throw new s("local_configuration_pin_conflict","The local run requires its exact sealed configuration and owner.");if(!e.admissions.length||e.admissions.length!==a.counts.pending||new Set(e.admissions.map(A=>A.receiptId)).size!==e.admissions.length)throw new s("local_population_conflict","The run admissions must cover the exact unique population.");return v(i,o,e.package),i.run("INSERT INTO local_experiment_executions(team_id,id,definition_id,definition_revision,owner_id,payload) VALUES(?,?,?,?,?,?)",[a.teamId,a.id,_.id,_.revision,e.ownerId,JSON.stringify(a)]),X(i,a,r,e.package),e.admissions.forEach((A,ne)=>i.run("INSERT INTO local_experiment_cases(team_id,execution_id,receipt_id,ordinal,status,admission) VALUES(?,?,?,?,?,?)",[a.teamId,a.id,A.receiptId,ne,"pending",JSON.stringify(A)])),S(i,a.teamId,a.id)}),"apply");return this.localWrite(i=>{let a=i.get("SELECT receipt FROM local_experiment_operations WHERE team_id=? AND operation_id=? AND kind='run'",[e.execution.teamId,e.execution.operationId]);return t&&!a?t.withAdmission(()=>n(i)):n(i)})}async findLocalExperimentRunOperation(e,t){return this.localWrite(n=>{let i=n.get("SELECT receipt FROM local_experiment_operations WHERE team_id=? AND operation_id=? AND kind='run'",[e,t]);if(!i)return null;let a=JSON.parse(i.receipt);return S(n,e,a.id)})}async readLocalExperimentRecord(e,t){return this.localWrite(n=>S(n,e,t))}async readLocalExperimentSnapshot(e,t){return this.localWrite(n=>q(n,u(n,e,t)))}async readExecutionActivity(e){if(!e.actorId.trim()||!e.teamId.trim())throw new s("local_activity_scope_missing","Activity requires a signed-in workspace owner.",403);return this.localWrite(t=>J(t,{...e,limit:Math.min(100,Math.max(1,e.limit??100))}))}async listLocalExperimentRecords(e){return this.localWrite(t=>{let n=t.all(`SELECT e.id FROM local_experiment_executions e
|
|
89
|
-
LEFT JOIN local_experiment_configurations c ON c.team_id=e.team_id AND c.execution_id=e.id
|
|
90
|
-
JOIN local_experiment_definitions d ON d.team_id=e.team_id AND d.id=e.definition_id AND d.revision=e.definition_revision
|
|
91
|
-
WHERE e.team_id=? AND json_extract(e.payload,'$.ownerActorId')=? AND json_extract(e.payload,'$.kind')='target'
|
|
92
|
-
${e.projectId?"AND COALESCE(json_extract(c.payload,'$.configuration.request.project.id'),json_extract(d.payload,'$.configuration.request.project.id'))=?":""}
|
|
93
|
-
${e.status?"AND json_extract(e.payload,'$.status')=?":""}
|
|
94
|
-
${e.datasetHash?"AND COALESCE(json_extract(c.payload,'$.configuration.request.taskset.contentHash'),json_extract(d.payload,'$.configuration.request.taskset.contentHash'))=?":""}
|
|
95
|
-
${e.search?"AND instr(lower(COALESCE(json_extract(c.payload,'$.configuration.request.name'),json_extract(d.payload,'$.configuration.request.name'))),lower(?))>0":""}
|
|
96
|
-
${e.afterId?"AND e.id>?":""} ORDER BY e.id LIMIT ?`,[e.teamId,e.ownerActorId,...e.projectId?[e.projectId]:[],...e.status?[e.status]:[],...e.datasetHash?[e.datasetHash]:[],...e.search?[e.search]:[],...e.afterId?[e.afterId]:[],e.limit+1]),i=n.slice(0,e.limit).map(a=>S(t,e.teamId,a.id));return{items:i,nextCursor:n.length>e.limit?i.at(-1).id:null}})}async readLocalExecution(e,t){return this.localWrite(n=>({execution:u(n,e,t),cases:R(n,e,t)}))}async readLocalExecutionCharges(e,t){return this.localWrite(n=>(u(n,e,t),n.all("SELECT request_id,case_id,status,maximum_usd,cost_usd,usage FROM local_experiment_charges WHERE team_id=? AND execution_id=? ORDER BY request_id",[e,t]).map(i=>({requestId:i.request_id,caseId:i.case_id,status:i.status,maximumUsd:i.maximum_usd,costUsd:i.cost_usd,usage:i.usage?JSON.parse(i.usage):null}))))}async appendLocalExperimentEvent(e){return this.localWrite(t=>{this.requireLocalOwner(t,e.teamId,e.id,e.ownerId);let n=JSON.stringify(e.payload),i=Buffer.byteLength(n),a=t.get("SELECT event_count,byte_count FROM local_experiment_trace_budgets WHERE team_id=? AND execution_id=?",[e.teamId,e.id]);if(i>2097152||(a?.event_count??0)>=2e4||(a?.byte_count??0)+i>67108864)throw new s("local_trace_limit_exceeded","The execution exceeded its bounded retained trace budget.",422);if(!t.get("SELECT receipt_id FROM local_experiment_cases WHERE team_id=? AND execution_id=? AND receipt_id=?",[e.teamId,e.id,e.caseId]))throw new s("local_trace_case_conflict","Trace evidence must belong to an admitted case.");t.run("INSERT INTO local_experiment_events(team_id,execution_id,case_id,type,payload) VALUES(?,?,?,?,?)",[e.teamId,e.id,e.caseId,e.type,n]),t.run("INSERT INTO local_experiment_trace_budgets(team_id,execution_id,event_count,byte_count) VALUES(?,?,1,?) ON CONFLICT(team_id,execution_id) DO UPDATE SET event_count=event_count+1,byte_count=byte_count+excluded.byte_count",[e.teamId,e.id,i])})}async localExperimentTrace(e){return this.localWrite(t=>{if(u(t,e.teamId,e.id),!t.get("SELECT receipt_id FROM local_experiment_cases WHERE team_id=? AND execution_id=? AND receipt_id=?",[e.teamId,e.id,e.caseId]))throw new s("local_case_not_found","This retained case does not belong to the execution.",404);let i=t.all("SELECT sequence,type,payload FROM local_experiment_events WHERE team_id=? AND execution_id=? AND case_id=? AND sequence>? ORDER BY sequence LIMIT ?",[e.teamId,e.id,e.caseId,e.afterSequence??0,e.limit+1]),a=i.slice(0,e.limit).map(o=>({sequence:o.sequence,type:o.type,payload:JSON.parse(o.payload)}));return{items:a,nextCursor:i.length>e.limit?a.at(-1).sequence:null}})}async localExperimentDiagnosticTrace(e){return this.localWrite(t=>{u(t,e.teamId,e.id);let n=t.all("SELECT sequence,case_id,type,payload FROM local_experiment_events WHERE team_id=? AND execution_id=? AND sequence>? ORDER BY sequence LIMIT 101",[e.teamId,e.id,e.afterSequence??-1]),i=t.get("SELECT count(*) AS count FROM local_experiment_events WHERE team_id=? AND execution_id=?",[e.teamId,e.id]).count,a=new Map(R(t,e.teamId,e.id).map(o=>[o.admission.receiptId,o.admission.taskId]));return{items:n.slice(0,100).map(o=>({...o,taskId:a.get(o.case_id)??null,payload:JSON.parse(o.payload)})),count:i,nextCursor:n.length>100?n[99].sequence:null}})}async startLocalScoringPass(e){return this.localWrite(t=>w(t,e.execution.teamId,e.operationId,"score",e.intentHash,()=>{x(t,e.ownerId);let n=h.parse(e.execution),i=n.sourceExecution;if(n.kind!=="scoring"||!i)throw new s("local_scoring_source_missing","A scoring pass requires an exact original execution.");let a=u(t,n.teamId,i.id);if(a.ownerActorId!==n.ownerActorId)throw new s("local_resource_denied","This local resource belongs to another account.",404);if(a.executionHash!==i.executionHash||a.kind!=="target"||!a.completedAt||!a.cleanupComplete)throw new s("local_scoring_source_unavailable","Retained grading requires a terminal original execution with confirmed cleanup.");if(n.packageHash!==a.packageHash||d(n.definition)!==d(a.definition))throw new s("local_scoring_pin_conflict","The scoring pass changed original execution pins.");let o=R(t,n.teamId,a.id);if(d(e.admissions)!==d(o.map(r=>r.admission)))throw new s("local_scoring_population_conflict","A scoring pass must cover the complete retained original population.");return t.run("INSERT INTO local_experiment_executions(team_id,id,definition_id,definition_revision,owner_id,payload) VALUES(?,?,?,?,?,?)",[n.teamId,n.id,n.definition.id,n.definition.revision,e.ownerId,JSON.stringify(n)]),t.run("INSERT INTO local_experiment_scoring_selections(team_id,execution_id,source_execution_id,package_payload,graders) VALUES(?,?,?,?,?)",[n.teamId,n.id,a.id,JSON.stringify(e.package),JSON.stringify(e.graders)]),e.admissions.forEach((r,_)=>t.run("INSERT INTO local_experiment_cases(team_id,execution_id,receipt_id,ordinal,status,admission) VALUES(?,?,?,?,?,?)",[n.teamId,n.id,r.receiptId,_,"pending",JSON.stringify(r)])),n}))}async readLocalScoringSelection(e,t){return this.localWrite(n=>{u(n,e,t);let i=n.get("SELECT package_payload,graders,source_execution_id FROM local_experiment_scoring_selections WHERE team_id=? AND execution_id=?",[e,t]);if(!i)throw new s("local_scoring_not_found","This execution is not a scoring pass.",404);return{package:JSON.parse(i.package_payload),graders:JSON.parse(i.graders),sourceExecutionId:i.source_execution_id}})}async localJudgeBudgetTransaction(e,t){return this.localWrite(n=>{this.requireLocalOwner(n,e.teamId,e.id,e.ownerId);let i=u(n,e.teamId,e.id);if(e.intent==="dispatch"){this.requireLocalChargeBounds(n,e.teamId,e.id);let l=n.get("SELECT status FROM local_experiment_cases WHERE team_id=? AND execution_id=? AND receipt_id=?",[e.teamId,e.id,e.caseId]);if(i.status!=="running"||l?.status!=="running")throw new s("local_grading_owner_inactive","Only an admitted running grader may reserve a judge call.")}let a=n.get("SELECT calls FROM local_experiment_judge_budgets WHERE team_id=? AND execution_id=?",[e.teamId,e.id]),o=a?y.array().parse(JSON.parse(a.calls)):[],r=n.get(`SELECT COALESCE(SUM(CASE WHEN status='settled' THEN cost_usd WHEN status IN ('reserved','dispatched','unknown') THEN maximum_usd ELSE 0 END),0) AS spent
|
|
97
|
-
FROM local_experiment_charges WHERE team_id=? AND execution_id=? AND request_id NOT IN (SELECT json_extract(value,'$.id') FROM json_each(?))`,[e.teamId,e.id,JSON.stringify(o)]).spent,_=t({maximumSpendUsd:Math.max(0,i.maximumCostUsd-r),calls:o}),g=y.array().parse(_.calls);for(let l of o){let p=g.find(T=>T.id===l.id);if(!p||p.requestHash!==l.requestHash||p.reservedUsd!==l.reservedUsd||l.status!=="reserved"&&d(l)!==d(p))throw new s("local_judge_receipt_conflict","Retained judge reservations and receipts are immutable.")}n.run("INSERT INTO local_experiment_judge_budgets(team_id,execution_id,calls) VALUES(?,?,?) ON CONFLICT(team_id,execution_id) DO UPDATE SET calls=excluded.calls",[e.teamId,e.id,JSON.stringify(g)]);for(let l of g){let p=l.status==="not_dispatched"?"released":l.response?.costUsd!==null&&l.response?.costUsd!==void 0?"settled":"unknown";n.run("INSERT INTO local_experiment_charges(team_id,execution_id,request_id,case_id,maximum_usd,cost_usd,status,usage) VALUES(?,?,?,?,?,?,?,?) ON CONFLICT(team_id,execution_id,request_id) DO UPDATE SET cost_usd=excluded.cost_usd,status=excluded.status,usage=excluded.usage",[e.teamId,e.id,l.id,e.caseId,l.reservedUsd,l.response?.costUsd??null,p,l.response?JSON.stringify(l.response):null])}return E(n,e.teamId,e.id),_.result})}async listLocalExecutions(e,t,n,i){return this.localWrite(a=>{let o=a.all(`SELECT payload FROM local_experiment_executions WHERE team_id=? AND definition_id=? AND json_extract(payload,'$.kind')='target' ${n?"AND id>?":""} ORDER BY id LIMIT ?`,[e,t,...n?[n]:[],i+1]),r=o.slice(0,i).map(_=>h.parse(JSON.parse(_.payload)));return{items:r,nextCursor:o.length>i?r.at(-1).id:null}})}async listLocalScoringPasses(e,t,n,i){return this.localWrite(a=>{let o=a.all(`SELECT e.payload FROM local_experiment_executions e JOIN local_experiment_scoring_selections s ON s.team_id=e.team_id AND s.execution_id=e.id WHERE e.team_id=? AND s.source_execution_id=? ${n?"AND e.id>?":""} ORDER BY e.id LIMIT ?`,[e,t,...n?[n]:[],i+1]),r=o.slice(0,i).map(_=>h.parse(JSON.parse(_.payload)));return{items:r,nextCursor:o.length>i?r.at(-1).id:null}})}async admitLocalCase(e,t,n,i){return this.localWrite(a=>{this.requireLocalOwner(a,e,t,i);let o=u(a,e,t);if(!["queued","running"].includes(o.status))return!1;let r=a.get("SELECT status FROM local_experiment_cases WHERE team_id=? AND execution_id=? AND receipt_id=?",[e,t,n]);return!r||r.status!=="pending"?!1:(a.run("UPDATE local_experiment_cases SET status='running' WHERE team_id=? AND execution_id=? AND receipt_id=?",[e,t,n]),E(a,e,t,{status:"running"}),!0)})}async settleLocalCase(e){return this.localWrite(t=>{if(this.requireLocalOwner(t,e.teamId,e.id,e.ownerId),t.get("SELECT status FROM local_experiment_cases WHERE team_id=? AND execution_id=? AND receipt_id=?",[e.teamId,e.id,e.receiptId])?.status!=="running")throw new s("local_case_not_owned","Only the admitted case owner may seal retained output.");return t.run("UPDATE local_experiment_cases SET status=?,result=?,error=? WHERE team_id=? AND execution_id=? AND receipt_id=?",[e.status,e.result===null?null:JSON.stringify(e.result),e.error,e.teamId,e.id,e.receiptId]),E(t,e.teamId,e.id)})}async cancelLocalExecution(e,t){return this.localWrite(n=>{let i=u(n,e,t);return["queued","running","cancelling"].includes(i.status)?(n.run("UPDATE local_experiment_cases SET status='cancelled' WHERE team_id=? AND execution_id=? AND status='pending'",[e,t]),E(n,e,t,{status:"cancelling"})):i})}async finishLocalExecution(e,t,n,i=null,a=!0){return this.localWrite(o=>{this.requireLocalOwner(o,e,t,n);let r=E(o,e,t);if(r.counts.running)throw new s("local_cleanup_pending","Wait for active case transport cleanup before sealing execution.");return r.counts.pending&&o.run("UPDATE local_experiment_cases SET status='cancelled' WHERE team_id=? AND execution_id=? AND status='pending'",[e,t]),r=E(o,e,t),E(o,e,t,{status:r.status==="cancelling"&&a?"cancelled":i||r.counts.failed||r.counts.unknown||!a?"failed":"completed",completedAt:new Date().toISOString(),cleanupComplete:a,error:i})})}async recoverLocalExperiments(e){return this.localWrite(t=>{x(t,e);let n=t.all("SELECT team_id,id FROM local_experiment_executions WHERE owner_id<>?",[e]),i=[];for(let a of n){let o=u(t,a.team_id,a.id);["queued","running","cancelling"].includes(o.status)&&(t.run("UPDATE local_experiment_cases SET status=CASE WHEN status='running' THEN 'unknown' ELSE 'cancelled' END,error='local_process_interrupted' WHERE team_id=? AND execution_id=? AND status IN ('pending','running')",[a.team_id,a.id]),t.run("UPDATE local_experiment_charges SET status='unknown' WHERE team_id=? AND execution_id=? AND status IN ('reserved','dispatched')",[a.team_id,a.id]),i.push(E(t,a.team_id,a.id,{status:"interrupted",completedAt:new Date().toISOString(),cleanupComplete:!1,error:"The previous process ended. Admitted calls and uncertain charges were retained; start a new execution explicitly."})))}return i})}async reserveLocalCharge(e){return this.localWrite(t=>{if(this.requireLocalOwner(t,e.teamId,e.id,e.ownerId),this.requireLocalChargeBounds(t,e.teamId,e.id),!Number.isFinite(e.maximumUsd)||e.maximumUsd<=0)throw new s("local_charge_bound_unknown","An enforceable positive model charge ceiling is required.",422);let n=E(t,e.teamId,e.id);if(n.status!=="running")throw new s("local_execution_not_running","The execution no longer accepts model dispatch.");if(t.get("SELECT status FROM local_experiment_cases WHERE team_id=? AND execution_id=? AND receipt_id=?",[e.teamId,e.id,e.caseId])?.status!=="running")throw new s("local_case_not_admitted","Model reservation requires an owned running case.");if(t.get("SELECT request_id FROM local_experiment_charges WHERE team_id=? AND execution_id=? AND request_id=?",[e.teamId,e.id,e.requestId]))throw new s("local_dispatch_already_admitted","This target request was already admitted and cannot be replayed.");if(n.usage.knownCostUsd+n.usage.heldUsd+e.maximumUsd>n.maximumCostUsd+1e-12)throw new s("experiment_budget_exhausted","The local ceiling cannot cover this model's maximum accepted request charge.",422);t.run("INSERT INTO local_experiment_charges(team_id,execution_id,request_id,case_id,maximum_usd,status) VALUES(?,?,?,?,?,'reserved')",[e.teamId,e.id,e.requestId,e.caseId,e.maximumUsd]),E(t,e.teamId,e.id)})}async markLocalChargeDispatched(e,t,n,i){let a=D();return this.localWrite(o=>{if(a?.assertExecution(t),this.requireLocalOwner(o,e,t,i),o.get("SELECT status FROM local_experiment_charges WHERE team_id=? AND execution_id=? AND request_id=?",[e,t,n])?.status!=="reserved")throw new s("local_dispatch_not_reserved","Target dispatch requires a fresh durable reservation.");o.run("UPDATE local_experiment_charges SET status='dispatched' WHERE team_id=? AND execution_id=? AND request_id=?",[e,t,n]),E(o,e,t)})}async settleLocalCharge(e){let t=await this.localWrite(n=>{this.requireLocalOwner(n,e.teamId,e.id,e.ownerId);let i=n.get("SELECT status,maximum_usd,cost_usd,usage FROM local_experiment_charges WHERE team_id=? AND execution_id=? AND request_id=?",[e.teamId,e.id,e.requestId]);if(!i)throw new s("local_charge_not_reserved","The charge does not belong to this execution.");if(e.costUsd!==null&&(!Number.isFinite(e.costUsd)||e.costUsd<0))throw new s("local_charge_invalid","Measured charge must be finite and nonnegative.");let a=e.costUsd!==null&&e.costUsd>i.maximum_usd+1e-12,o=e.confirmedTransportNotInvoked instanceof j&&e.confirmedTransportNotInvoked.executionId===e.id&&e.confirmedTransportNotInvoked.requestId===e.requestId&&e.costUsd===null&&e.usage===null&&i.status==="dispatched",r=e.notDispatched&&i.status==="reserved"||o?"released":e.costUsd===null?"unknown":"settled";if(["released","settled"].includes(i.status)){if(i.status!==r||i.cost_usd!==e.costUsd||(i.usage?d(JSON.parse(i.usage)):null)!==(e.usage?d(e.usage):null))throw new s("local_charge_receipt_conflict","A sealed charge receipt is immutable.");return{execution:E(n,e.teamId,e.id),exceedsBound:a}}return n.run("UPDATE local_experiment_charges SET status=?,cost_usd=?,usage=? WHERE team_id=? AND execution_id=? AND request_id=?",[r,e.costUsd,e.usage===null?null:JSON.stringify(e.usage),e.teamId,e.id,e.requestId]),{execution:E(n,e.teamId,e.id),exceedsBound:a}});if(t.exceedsBound)throw new s("local_charge_outside_bound","Measured charge exceeds its authoritative reservation. Its receipt was retained; no further target dispatch is admitted.");return t.execution}requireLocalChargeBounds(e,t,n){if(e.get("SELECT request_id FROM local_experiment_charges WHERE team_id=? AND execution_id=? AND cost_usd>maximum_usd+0.000000000001 LIMIT 1",[t,n]))throw new s("local_charge_outside_bound","A retained provider receipt exceeded its authoritative reservation. Further target and judge dispatch is blocked.")}requireLocalOwner(e,t,n,i){x(e,i);let a=e.get("SELECT owner_id FROM local_experiment_executions WHERE team_id=? AND id=?",[t,n]);if(!a||a.owner_id!==i)throw new s("local_execution_owner_conflict","This process does not own the execution.")}};export{ee as SqliteLocalExperimentStore};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{b as B}from"./chunk-B2K5WQZE.js";import{a as E}from"./chunk-KCJVFLBB.js";import"./chunk-CJDGLPNX.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-GD3RCUDH.js";import"./chunk-FCXDPVGJ.js";import"./chunk-UTIELP6F.js";import"./chunk-5TPYBXWM.js";import"./chunk-FYWQWKVS.js";import"./chunk-6ESBAHWK.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-7J2NMUTK.js";import"./chunk-W45RKGM6.js";import"./chunk-W45RKGM6.js";import"./chunk-543QHE3D.js";import"./chunk-LI56PPCN.js";import"./chunk-GI7LTJV3.js";import"./chunk-6LFTQBXP.js";import"./chunk-XGY4OQLC.js";import"./chunk-VPAEFG7X.js";import"./chunk-SFR32TMJ.js";import{b as k,m as v,n as y}from"./chunk-AXYAEWWA.js";import"./chunk-QOUOU7FE.js";import"./chunk-WJSJXK2N.js";import"./chunk-TS5HNRZB.js";import{wa as M}from"./chunk-5ZNE43XC.js";import"./chunk-HIQPGYVH.js";import{A as u}from"./chunk-263WS3TB.js";import"./chunk-SD2XDZQW.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-6FA3GG5B.js";import{L as R,ca as g}from"./chunk-XHU4BZQY.js";import{Aa as s}from"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import{n as d}from"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as p}from"./chunk-FTQLQJQV.js";var T=class extends E{static{p(this,"SqliteModelBatchReviewStore")}async findModelBatchReview(t,r){return this.modelBatchReviewTransaction(t,r)}async beginModelBatchReview(t,r,o){let e=await this.modelBatchReviewTransaction(t,r,o);if(!e)throw new Error("Model batch review was not created.");return e}async modelBatchReviewTransaction(t,r,o){let e=k.parse(r);await this.ready;let l=this.writeQueue.then(async()=>{let a=this.db;if(!a)throw new Error("Model review store is closed.");a.exec("BEGIN IMMEDIATE");let w=!0,h=B(a,t,()=>{if(!w)throw new Error("Model review transaction is closed.")});try{let i=a.get("SELECT payload FROM model_projects WHERE id = ? AND profile_id = ?",[e.modelId,t]);if(!i)throw new s("model_not_found",404);let n=u.parse(JSON.parse(i.payload)),m=await v(h,e);if(m||!o)return a.exec("COMMIT"),m;if(n.revision!==e.expectedModelRevision||!n.trainingSetup.tasksetRef||!R(n.trainingSetup.tasksetRef,e.tasksetRef))throw new s("model_revision_conflict",409);let f=a.get("SELECT payload FROM taskset_revisions WHERE taskset_id = ? AND revision = ? AND profile_id = ?",[e.tasksetRef.id,e.tasksetRef.revision,t]),c=f?M.parse(JSON.parse(f.payload)):null;if(!c||c.contentHash!==e.tasksetRef.contentHash||d(c.metadata.learning)!==d(g(o.taskset)))throw new s("model_review_package_mismatch",409);let _=await y(h,{scope:t,request:e,package:o,now:new Date().toISOString()});return a.exec("COMMIT"),_}catch(i){throw a.exec("ROLLBACK"),i}finally{w=!1}});return this.writeQueue=l.then(()=>{},()=>{}),l}};export{T as SqliteModelBatchReviewStore};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import"./chunk-6IS5OLI5.js";import{c as D,e as O,f as W}from"./chunk-YQBL5P6R.js";import{a as _}from"./chunk-XDFXKRTI.js";import"./chunk-H6EUFJJK.js";import{d as C}from"./chunk-FVK4W27G.js";import"./chunk-YONDU5TN.js";import"./chunk-7HAGSE7L.js";import{e as B}from"./chunk-XKZ4PFMQ.js";import{a as z}from"./chunk-KCJVFLBB.js";import"./chunk-CJDGLPNX.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-GD3RCUDH.js";import"./chunk-FCXDPVGJ.js";import"./chunk-UTIELP6F.js";import"./chunk-5TPYBXWM.js";import"./chunk-FYWQWKVS.js";import"./chunk-6ESBAHWK.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-7J2NMUTK.js";import"./chunk-W45RKGM6.js";import"./chunk-W45RKGM6.js";import"./chunk-543QHE3D.js";import"./chunk-LI56PPCN.js";import"./chunk-GI7LTJV3.js";import"./chunk-6LFTQBXP.js";import"./chunk-XGY4OQLC.js";import"./chunk-VPAEFG7X.js";import"./chunk-SFR32TMJ.js";import{i as q,k as A}from"./chunk-AXYAEWWA.js";import{B as L}from"./chunk-QOUOU7FE.js";import"./chunk-WJSJXK2N.js";import"./chunk-TS5HNRZB.js";import{Fa as u,ga as b,ja as H,wa as x}from"./chunk-5ZNE43XC.js";import"./chunk-HIQPGYVH.js";import{B as T,C as I,H as y}from"./chunk-263WS3TB.js";import"./chunk-SD2XDZQW.js";import"./chunk-MTP3B2SU.js";import"./chunk-AMC4Z7G4.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-6FA3GG5B.js";import{K as w,P as E,R as S}from"./chunk-XHU4BZQY.js";import{Ra as R,Wa as M}from"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import{n as c}from"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import{A as s}from"./chunk-X2J2P5ZT.js";import{a as h}from"./chunk-FTQLQJQV.js";var F=s.string().trim().min(1).max(500),P=s.string().regex(/^[a-f0-9]{64}$/),f=s.object({schemaVersion:s.literal("openpond.localModelProjectPreparationInput.v1"),source:s.object({ownerId:F,datasetId:F,revision:s.number().int().positive(),workspaceHash:P,packageHash:P}).strict(),project:T,rewardBinding:M,rewards:s.array(R).min(1).max(100),assets:s.array(E).max(100)}).strict(),N=s.object({schemaVersion:s.literal("openpond.localModelProjectPreparation.v1"),request:f,package:b,taskset:x,saveRequest:I,contentHash:P}).strict();async function Q(p){let e=f.parse(p.request),r=H(p.source);if(r.contentHash!==e.source.packageHash)throw new Error("Dataset package changed since preparation was requested.");if(e.project.trainingSetup.tasksetRef||e.project.trainingSetup.tasksetRelease||e.project.trainingSetup.evaluationTasksetRef||e.project.trainingSetup.rewardBindingRef||e.project.trainingSetup.harnessRelease)throw new Error("Preparation selects its Taskset and Reward from the pinned source; omit preselected Taskset, Reward and Harness references.");if(!e.project.trainingSetup.recipe||!e.project.trainingSetup.baseModel)throw new Error("Preparation requires an explicit pinned base model and complete recipe.");let a=e.project.trainingSetup.baseModel,o=e.project.trainingSetup.recipe,i=o.baseModel;if(!a.revision||!a.tokenizerRevision||!a.chatTemplateHash||!i||i.id!==a.modelId||i.revision!==a.revision||i.tokenizerRevision!==a.tokenizerRevision||i.chatTemplateHash!==a.chatTemplateHash||o.method!==e.project.trainingSetup.method)throw new Error("Project and recipe must select the same pinned base model and training method.");if(!r.taskset.tasks.some(t=>t.split==="train")||!r.taskset.tasks.some(t=>t.split==="validation"||t.split==="frozen_eval"))throw new Error("Preparation requires existing training and held-out validation tasks; it never changes splits.");let n=new Set(e.rewardBinding.sources.map(t=>c(t.reward)));if(new Set(e.rewards.map(t=>c(w(t)))).size!==e.rewards.length||e.rewards.some(t=>!n.has(c(w(t)))))throw new Error("Preparation Reward closure contains unexpected or duplicate releases.");let l=e.rewards.flatMap(t=>[...t.assets,..."verifierRef"in t.implementation?[t.implementation.verifierRef]:[],..."rubricRef"in t.implementation?[t.implementation.rubricRef]:[],..."inputContract"in t.implementation?[t.implementation.inputContract]:[]]),G=new Set(l.map(t=>t.id));if(new Set(e.assets.map(t=>t.id)).size!==e.assets.length||e.assets.some(t=>!G.has(t.id)))throw new Error("Preparation Reward closure contains unexpected or duplicate assets.");for(let t of l){let d=e.assets.find(K=>K.id===t.id);if(!d||t.visibility!=="verifier")throw new Error("Preparation requires its exact private verifier asset closure.");S(d,t)}for(let t of["training","evaluation"])if(!e.rewardBinding.sources.some(d=>d.role===t&&d.weight>0))throw new Error(`Preparation requires a positively weighted ${t} Reward source.`);let k=A({owner:{scopeId:e.project.profileId,modelId:e.project.id},source:r,rewardBinding:e.rewardBinding,rewards:e.rewards,assets:e.assets}),g=k.modelResources.assets.filter(t=>e.assets.some(d=>d.id===t.id));if(new Set(g.map(t=>t.asset.path)).size!==g.length||g.some(t=>t.asset.visibility!=="verifier"))throw new Error("Preparation requires distinct private verifier paths with verifier visibility.");let m=u({package:k,profileId:e.project.profileId,name:p.name,createdAt:p.createdAt});m.taskset=_(m.taskset,p.reviewedTaskset,r);let j=w(m.taskset),J=await y({...e.project,trainingSetup:{...e.project.trainingSetup,tasksetRef:j,evaluationTasksetRef:m.taskset.tasks.some(t=>t.split==="validation"||t.split==="frozen_eval")?j:null,rewardBindingRef:w(e.rewardBinding)}},0),v={schemaVersion:"openpond.localModelProjectPreparation.v1",request:e,package:k,taskset:m.taskset,saveRequest:J};return N.parse({...v,contentHash:c(v)})}h(Q,"prepareLocalModelProject");function V(p){let e=N.parse(p),{contentHash:r,...a}=e;if(c(a)!==r)throw new Error("Project preparation receipt content hash changed.");return e}h(V,"parseLocalModelProjectPreparation");var $=class extends z{static{h(this,"SqliteModelProjectPreparationStore")}async compile(e){let r=this.database.get("SELECT id FROM local_resource_owner WHERE singleton=1",[]),a=this.database.get("SELECT r.payload FROM local_dataset_versions w JOIN local_dataset_records r ON r.record_hash=w.record_hash WHERE w.id=? AND w.revision=?",[e.source.datasetId,e.source.revision]);if(!a||!r||r.id!==e.source.ownerId)throw new Error("Dataset is unavailable on the selected local owner.");let o=B(this.database,a.payload);if(o.ownerId!==r.id||o.workspace.contentHash!==e.source.workspaceHash)throw new Error("Dataset owner or workspace changed since preparation was requested.");let i=q({workspace:o.workspace,preparation:null,adapterId:"openpond-desktop-taskset-authoring-v1",now:o.workspace.draft.updatedAt}),n=L({draft:{...o.workspace.draft,profileId:e.project.profileId},now:o.workspace.draft.updatedAt});return Q({request:e,source:i,reviewedTaskset:n,createdAt:o.workspace.draft.updatedAt,name:o.workspace.draft.name})}async prepareLocalModelProject(e){let r=f.parse(e);await this.ready;let a=this.writeQueue.then(async()=>{if(this.database.get("SELECT id FROM model_projects WHERE id=?",[r.project.id]))throw new Error("Model Project already exists; preparation only creates a distinct Model.");return this.compile(r)});return this.writeQueue=a.then(()=>{},()=>{}),a}async applyLocalModelProjectPreparation(e){let r=V(e);await this.ready;let a=this.writeQueue.then(async()=>{let o=await this.compile(r.request);if(c(o)!==c(r))throw new Error("Project preparation differs from the exact source, Reward closure or recipe. Prepare and review it again.");let i=D(this.database,r.saveRequest);if(i)return{project:i,taskset:r.taskset,packageHash:r.package.contentHash,preparationHash:r.contentHash};if(this.database.get("SELECT id FROM model_projects WHERE id=?",[r.request.project.id]))throw new Error("Model Project already exists with a different preparation.");let n=u({package:r.package,profileId:r.request.project.profileId,name:r.taskset.name,createdAt:r.taskset.createdAt});n.taskset=o.taskset,await C({home:this.home,...n}),this.database.exec("BEGIN IMMEDIATE");try{W(this.database,n);let l=O(this.database,r.saveRequest,null,r.package);return this.database.exec("COMMIT"),{project:l,taskset:n.taskset,packageHash:n.package.contentHash,preparationHash:r.contentHash}}catch(l){throw this.database.exec("ROLLBACK"),l}});return this.writeQueue=a.then(()=>{},()=>{}),a}};export{$ as SqliteModelProjectPreparationStore};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import"./chunk-W45RKGM6.js";import{a as ke}from"./chunk-GC6RJBRZ.js";import{a as N,d as L}from"./chunk-CWAQOFLP.js";import{d as x,e as Te,g as ye}from"./chunk-B7XJBP4U.js";import{e as we,f as Ee}from"./chunk-YQBL5P6R.js";import{a as ue}from"./chunk-XDFXKRTI.js";import"./chunk-H6EUFJJK.js";import{b as C,c as D,d as ge}from"./chunk-FVK4W27G.js";import{a as M,b as g,c as q}from"./chunk-YONDU5TN.js";import{a as me}from"./chunk-KCJVFLBB.js";import"./chunk-CJDGLPNX.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-GD3RCUDH.js";import"./chunk-FCXDPVGJ.js";import"./chunk-UTIELP6F.js";import"./chunk-5TPYBXWM.js";import"./chunk-FYWQWKVS.js";import"./chunk-6ESBAHWK.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-7J2NMUTK.js";import"./chunk-W45RKGM6.js";import"./chunk-W45RKGM6.js";import"./chunk-543QHE3D.js";import"./chunk-LI56PPCN.js";import"./chunk-GI7LTJV3.js";import"./chunk-6LFTQBXP.js";import"./chunk-XGY4OQLC.js";import"./chunk-VPAEFG7X.js";import"./chunk-SFR32TMJ.js";import{d as fe,e as le,f as U,o as pe,p as he}from"./chunk-AXYAEWWA.js";import{A as ce,j as ie,k as oe,m as ne,n as de}from"./chunk-QOUOU7FE.js";import"./chunk-WJSJXK2N.js";import"./chunk-TS5HNRZB.js";import{Ca as H,Fa as re,Oa as F,S as se,aa as A,b as X,c as Z,e as $,i as ee,oa as y,wa as T}from"./chunk-5ZNE43XC.js";import"./chunk-HIQPGYVH.js";import{A as S,B as ae,q as te}from"./chunk-263WS3TB.js";import"./chunk-SD2XDZQW.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-6FA3GG5B.js";import{K as J,L as I}from"./chunk-XHU4BZQY.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import{e as B,f as Y}from"./chunk-SH7POUVX.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import{n as m}from"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import{A as u}from"./chunk-X2J2P5ZT.js";import"./chunk-UGOK7VTC.js";import{a as h}from"./chunk-FTQLQJQV.js";import{randomUUID as et}from"node:crypto";import{cp as tt,mkdir as at,readdir as st,rename as G,rm as Ne,stat as rt}from"node:fs/promises";import O from"node:path";function ve(o,t,e,a){let s=t.modelScope;if(!s)return;let i=o.get("SELECT payload FROM model_projects WHERE id = ? AND profile_id = ?",[s.modelId,t.profileId]);if(!i)throw new Error("Taskset draft Model was not found in this Profile.");let r=S.parse(JSON.parse(i.payload)),n={id:e.id,revision:e.revision,contentHash:e.contentHash},f=e.metadata.rewardBinding===void 0?null:te.parse(e.metadata.rewardBinding),p=s.source?.authoringGraph==="bound"&&f&&r.trainingSetup.rewardBindingRef&&I(f,r.trainingSetup.rewardBindingRef);return we(o,{schemaVersion:"openpond.modelProjectSave.v1",operationId:`draft-publication:${m({draftId:t.id,revision:t.revision,scope:s,tasksetRef:n})}`,expectedRevision:s.expectedModelRevision,project:ae.strip().parse({...r,trainingSetup:{...r.trainingSetup,tasksetRef:n,rewardBindingRef:f,tasksetRelease:null,recipe:p?r.trainingSetup.recipe:null,...r.trainingSetup.evaluationTasksetRef&&r.trainingSetup.tasksetRef&&I(r.trainingSetup.evaluationTasksetRef,r.trainingSetup.tasksetRef)?{evaluationTasksetRef:n}:{}}})},null,a?.modelResources?{...a.modelResources,taskset:a.taskset,executionResources:{environment:a.environment,verifierSet:a.verifierSet}}:a??void 0)}h(ve,"selectTasksetDraftModel");import{createHash as je,randomUUID as Je}from"node:crypto";import{lstat as Se,mkdir as Pe,readdir as Be,readFile as $e,rename as qe,rm as Ue,writeFile as Ve}from"node:fs/promises";import R from"node:path";var b=pe.extend({workspaceHash:u.string().regex(/^[a-f0-9]{64}$/).nullable()}).strict();async function De(o){let{db:t,profileId:e}=o,a=Z.parse(o.request),s=h(()=>{let w=t.get("SELECT payload FROM model_projects WHERE id = ? AND profile_id = ?",[a.modelId,e]);if(!w)throw new Error("Taskset draft Model was not found in this Profile.");return S.parse(JSON.parse(w.payload))},"requireModel"),i=s(),r=m(a),n=t.get("SELECT request_hash, state, payload FROM model_taskset_draft_operations WHERE profile_id = ? AND operation_id = ?",[e,a.operationId]);if(n){if(n.request_hash!==r)throw new Error("Taskset draft operation was reused with different input.");if(n.state==="deleted")throw new Error("This Taskset draft was deleted.");return b.parse(JSON.parse(n.payload))}if(!o.source)return null;if(i.revision!==a.expectedModelRevision)throw new Error("Model changed before draft initialization. Refresh before editing.");let f=i.trainingSetup.tasksetRef,p=f?t.get("SELECT payload FROM taskset_revisions WHERE taskset_id = ? AND revision = ? AND profile_id = ?",[f.id,f.revision,e]):null,d=p?T.parse(JSON.parse(p.payload)):null;if(!d||!f||d.contentHash!==f.contentHash)throw new Error("The selected source Taskset is unavailable.");let l=o.source,c=i.hosted?.apiOrigin?i.hosted.tasksets.find(w=>w.localTasksetId===d.id&&w.localTasksetHash===d.contentHash&&w.packageHash===l.contentHash&&w.releaseId===l.taskset.id&&w.releaseRevision===l.taskset.revision&&w.releaseHash===l.taskset.contentHash):null,k=typeof d.metadata.importedPackageHash=="string"?d.metadata.importedPackageHash:c?.packageHash;if(k?k!==l.contentHash:!I(J(F({taskset:d,adapterId:x(d)}).tasksetRelease),J(l.taskset)))throw new Error("Taskset draft package differs from its selected source.");let P=l.modelResources?se.safeParse(l.taskset.metadata.modelTasksetDerivation):X.safeParse(l.taskset.metadata.modelTasksetAuthoring),_=c&&P.success&&P.data.owner.modelId===i.id?P.data.owner:{scopeId:e,modelId:i.id},Ce=fe({request:a,owner:_,source:l}),ze=he({sourceDraft:ce(d),source:l,preparation:Ce,expectedModelRevision:a.expectedModelRevision});await C(o.home,l);let K=b.parse({...ze,workspaceHash:null}),We=K.draft;t.exec("BEGIN IMMEDIATE");try{let w=t.get("SELECT request_hash FROM model_taskset_draft_operations WHERE profile_id = ? AND operation_id = ?",[e,a.operationId]);if(w&&w.request_hash!==r)throw new Error("Taskset draft operation was reused with different input.");if(!w&&s().revision!==a.expectedModelRevision)throw new Error("Model changed during draft initialization. Refresh before editing.");t.run("INSERT INTO model_taskset_draft_operations (profile_id, operation_id, request_hash, draft_id, state, payload) VALUES (?, ?, ?, ?, 'prepared', ?) ON CONFLICT(profile_id, operation_id) DO NOTHING",[e,a.operationId,r,We.id,JSON.stringify(K)]),t.exec("COMMIT")}catch(w){throw t.exec("ROLLBACK"),w}let j=t.get("SELECT request_hash, payload FROM model_taskset_draft_operations WHERE profile_id = ? AND operation_id = ?",[e,a.operationId]);if(!j||j.request_hash!==r)throw new Error("Taskset draft operation was reused with different input.");return b.parse(JSON.parse(j.payload))}h(De,"prepareDraftInitialization");async function Re(o){let{initialized:t,workspacePath:e}=o;if(o.completed())return;if(t.workspaceHash)try{if(await Se(e),o.completed())return;if(await V(e),await g(e)!==t.workspaceHash)throw new Error("Prepared Taskset draft files changed before initialization completed.");return}catch(s){if(s.code!=="ENOENT")throw s}let a=`${e}.initializing-${Je()}`;await Pe(R.dirname(e),{recursive:!0});try{let s=t.draft.modelScope?.source;if(!s)throw new Error("Taskset draft lost its source preparation.");let i=await D(o.home,s.sourcePackageHash),r=new Map;for(let f of t.filePaths){let p=i.files.find(d=>d.asset.id===f.assetId);if(!p)throw new Error("Taskset draft source asset is missing.");for(let d of f.paths){if(d.includes("\\")||R.posix.isAbsolute(d)||d.split("/").some(k=>!k||k==="."||k===".."||k.startsWith(".env")))throw new Error("Taskset draft source path is invalid.");let l=r.get(d);if(l&&l!==p.asset.contentHash)throw new Error("Taskset draft source paths conflict.");if(l)continue;let c=R.join(a,d);await Pe(R.dirname(c),{recursive:!0}),await Ve(c,A(p),{flag:"wx"}),r.set(d,p.asset.contentHash)}}await M(t.draft,a);for(let[f,p]of r)if(je("sha256").update(await $e(R.join(a,f))).digest("hex")!==p)throw new Error(`Taskset draft source asset conflicts with authoring file ${f}.`);let n=await g(a);if(o.retainHash({...t,workspaceHash:n}),o.completed())return;try{await qe(a,e)}catch(f){if(!["EEXIST","ENOTEMPTY"].includes(f.code??""))throw f;if(o.completed())return;if(await V(e),await g(e)!==n)throw new Error("Prepared Taskset draft files changed before initialization completed.")}}finally{await Ue(a,{recursive:!0,force:!0})}}h(Re,"materializeDraftInitialization");async function V(o){let t=await Se(o);if(!t.isDirectory()||t.isSymbolicLink())throw new Error("Taskset draft source must be a regular directory.");for(let e of await Be(o,{withFileTypes:!0})){if(e.name.startsWith(".env")||e.isSymbolicLink())throw new Error("Taskset draft source contains a prohibited file.");if(e.isDirectory())await V(R.join(o,e.name));else if(!e.isFile())throw new Error("Taskset draft source must contain regular files.")}}h(V,"assertRegularTree");import Qe from"node:path";async function be(o){let t=F({taskset:o.taskset,adapterId:x(o.taskset)}),e=await ye({root:o.directory,content:{schemaVersion:"openpond.tasksetPackage.v1",taskset:t.tasksetRelease,environment:t.environmentRelease,verifierSet:t.verifierSetRelease},sources:U.parse(o.taskset.metadata.portableFileInventory??[])}),a=o.preparation.authoringGraph==="bound"?await D(o.home,o.preparation.sourcePackageHash):void 0,s=le({preparation:o.preparation,edited:e,source:a});if(s.modelResources){let c=re({package:s,profileId:o.taskset.profileId,name:o.taskset.name,createdAt:o.taskset.createdAt}),k=ue(c.taskset,o.taskset),P=T.parse({...k,authoringProvenance:o.taskset.authoringProvenance,metadata:{...k.metadata,sourcePackageHash:o.taskset.metadata.sourcePackageHash}}),_=T.parse({...P,contentHash:H(P)});return await ge({home:o.home,...c,taskset:_}),{taskset:_,directory:Qe.join(o.home,"training","tasksets",String(_.environment.metadata.runtimeSourceTasksetId))}}let i=U.parse(o.taskset.metadata.portableFileInventory??[]),r=s.files.map(c=>({asset:c.asset,sourcePath:i.find(k=>k.asset.id===c.asset.id)?.sourcePath??c.asset.path})),n=s.taskset.environment.entrypoint==="openpond.javascript-environment.v1"?s.files.find(c=>c.asset.path==="environment/execution.json"):void 0,f=`model-draft-${m({packageHash:s.contentHash,taskset:o.taskset})}`,p=T.parse({...o.taskset,id:s.taskset.id,revision:s.taskset.revision,metadata:{...o.taskset.metadata,portableFileInventory:r,importedPackageHash:s.contentHash,derivedPortableMetadata:s.taskset.metadata},environment:{...o.taskset.environment,metadata:{...o.taskset.environment.metadata,runtimeSourceTasksetId:f,portableExecutionResources:{environment:s.environment,verifierSet:s.verifierSet}}}}),d=T.parse({...p,contentHash:H(p)}),l=await N(o.home,{taskset:d,generatedFiles:n?[{path:n.asset.path,role:"environment",content:new TextDecoder("utf-8",{fatal:!0}).decode(A(n))}]:[]},f,{source:{directory:o.directory,packageHash:await g(o.directory)},verify:h(c=>L(c,d),"verify")});return await C(o.home,s),{directory:l,taskset:d}}h(be,"materializeModelTasksetDraftPublication");import{constants as Q}from"node:fs";import{createHash as Ge}from"node:crypto";import{lstat as Ie,mkdir as Ke,open as Ye,readdir as Xe,rm as _e}from"node:fs/promises";import z from"node:path";var v=h((o,t)=>Y(z.join(o,"state","taskset-draft-writes"),t),"withTasksetDraftLock"),He=oe,Ze=h(o=>Ge("sha256").update(o).digest("hex"),"digest");async function W(o,t,e=!1){$.parse(t);let a=o;for(let s of["",...t.split("/").slice(0,-1)]){s&&(a=z.join(a,s)),e&&await Ke(a,{recursive:!1}).catch(r=>{if(r.code!=="EEXIST")throw r});let i=await Ie(a);if(!i.isDirectory()||i.isSymbolicLink())throw new Error("Taskset draft paths must use regular directories.")}return z.join(o,t)}h(W,"regularPath");async function Me(o,t){let e=await W(o,t),a=await Ye(e,Q.O_RDONLY|Q.O_NOFOLLOW|Q.O_NONBLOCK);try{let s=await a.stat();if(!s.isFile()||s.size>ie)throw new Error("Taskset draft file must be a regular file within the 6 MB editing limit.");let i=Buffer.alloc(s.size),r=0;for(;r<i.length;){let n=await a.read(i,r,i.length-r,r);if(!n.bytesRead)throw new Error("Taskset draft file changed during reading.");r+=n.bytesRead}if((await a.read(Buffer.alloc(1),0,1,r)).bytesRead)throw new Error("Taskset draft file changed during reading.");return i}finally{await a.close()}}h(Me,"readBytes");async function Oe(o,t){let e=await Me(o,t);return ne(t,e)}h(Oe,"readTasksetDraftFile");async function Ae(o){let t=[];async function e(a=""){for(let s of await Xe(z.join(o,a),{withFileTypes:!0})){let i=a?`${a}/${s.name}`:s.name;if($.parse(i),s.isSymbolicLink())throw new Error("Taskset draft files cannot contain symbolic links.");if(s.isDirectory()){await e(i);continue}if(!s.isFile())throw new Error("Taskset draft files must be regular files.");if(t.length>=1e4)throw new Error("Taskset draft file inventory exceeds its limit.");let r=await Ie(await W(o,i));if(!r.isFile()||r.isSymbolicLink())throw new Error("Taskset draft files must be regular files.");t.push({path:i,sizeBytes:r.size,writable:He(i)})}}return h(e,"visit"),await W(o,"taskset.json"),await e(),t.sort((a,s)=>a.path.localeCompare(s.path))}h(Ae,"listTasksetDraftFiles");async function Fe(o,t,e){if(!He(t.path))throw new Error("This file is managed by the Taskset forms or retained source history.");let a=null;try{a=await Me(o,t.path)}catch(r){if(r.code!=="ENOENT")throw r}if((a?Ze(a):null)!==t.expectedFileHash)throw new Error("Taskset draft file changed. Reload it before saving.");if(!a&&t.content===null)throw new Error("Taskset draft file does not exist.");let s=t.content?de(t.content):null,i=await W(o,t.path,!0);s?await B(i,s):await _e(i);try{return await e()}catch(r){throw a?await B(i,a):await _e(i,{force:!0}),r}}h(Fe,"mutateTasksetDraftFile");var E=u.object({schemaVersion:u.literal("openpond.tasksetDraftPointer.v1"),id:u.string().trim().min(1),profileId:u.string().trim().min(1),modelScope:y.shape.modelScope,status:u.enum(["draft","validating","needs_review","published"]),revision:u.number().int().positive(),workspacePath:u.string().trim().min(1),packageHash:u.string().regex(/^[a-f0-9]{64}$/),publishedTasksetRef:u.object({id:u.string().trim().min(1),revision:u.number().int().positive(),contentHash:u.string().trim().min(8)}).nullable(),createdAt:u.string().trim().min(1),updatedAt:u.string().trim().min(1)}),xe=class extends me{static{h(this,"SqliteTasksetDraftStore")}async initializeModelTasksetDraft(t,e,a){await this.ready;let s=this.writeQueue.then(()=>v(this.home,async()=>{let i=this.database,r=await De({db:i,home:this.home,profileId:t,request:e,source:a});if(!r)return null;let n=h(()=>{let d=i.get("SELECT state FROM model_taskset_draft_operations WHERE profile_id = ? AND operation_id = ?",[t,e.operationId]);if(d?.state==="deleted")throw new Error("This Taskset draft was deleted.");let l=i.get("SELECT payload FROM taskset_drafts WHERE id = ?",[r.draft.id]);if(!l){if(d?.state==="ready")throw new Error("The initialized Taskset draft is unavailable.");return!1}let c=E.parse(JSON.parse(l.payload));if(c.profileId!==t||c.modelScope?.source?.requestHash!==r.draft.modelScope?.source?.requestHash)throw new Error("Taskset draft identity conflicts with its initialization.");return!0},"completed"),f=this.workspacePath(r.draft.id);await Re({home:this.home,initialized:r,workspacePath:f,completed:n,retainHash:h(d=>{let l=i.get("SELECT payload FROM model_taskset_draft_operations WHERE profile_id = ? AND operation_id = ?",[t,e.operationId]),c=b.parse(JSON.parse(l.payload));if(c.workspaceHash&&c.workspaceHash!==d.workspaceHash)throw new Error("Taskset draft initialization produced different files on retry.");i.run("UPDATE model_taskset_draft_operations SET payload = ? WHERE profile_id = ? AND operation_id = ? AND state = 'prepared'",[JSON.stringify(d),t,e.operationId])},"retainHash")}),i.exec("BEGIN IMMEDIATE");try{if(!n()){let d=i.get("SELECT payload FROM model_taskset_draft_operations WHERE profile_id = ? AND operation_id = ?",[t,e.operationId]),l=b.parse(JSON.parse(d.payload)),c=l.draft,k=E.parse({schemaVersion:"openpond.tasksetDraftPointer.v1",id:c.id,profileId:t,modelScope:c.modelScope,status:c.status,revision:c.revision,workspacePath:f,packageHash:l.workspaceHash,publishedTasksetRef:c.publishedTasksetRef,createdAt:c.createdAt,updatedAt:c.updatedAt});i.run("INSERT INTO taskset_drafts (id, profile_id, status, revision, payload, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?)",[c.id,t,c.status,c.revision,JSON.stringify(k),c.createdAt,c.updatedAt]),i.run("UPDATE model_taskset_draft_operations SET state = 'ready' WHERE profile_id = ? AND operation_id = ?",[t,e.operationId])}i.exec("COMMIT")}catch(d){throw i.exec("ROLLBACK"),d}let p=i.get("SELECT payload FROM taskset_drafts WHERE id = ?",[r.draft.id]);return this.draftFromStoredPayload(JSON.parse(p.payload))}));return this.writeQueue=s.then(()=>{},()=>{}),s}async saveTasksetDraft(t,e,a={}){let s=y.parse(t);await this.ready;let i=this.writeQueue.then(()=>v(this.home,async()=>{let r=this.database.get("SELECT payload FROM taskset_drafts WHERE id = ?",[s.id]),n=r?E.safeParse(JSON.parse(r.payload)):null;if(n?.success){if(n.data.profileId!==s.profileId)throw new Error("Taskset draft profile cannot change.");if(m(n.data.modelScope?{...n.data.modelScope,expectedModelRevision:0}:null)!==m(s.modelScope?{...s.modelScope,expectedModelRevision:0}:null)||!a.refreshModelRevision&&m(n.data.modelScope)!==m(s.modelScope))throw new Error("Taskset draft Model ownership cannot change.");if(n.data.status==="published")throw new Error("Published Taskset drafts are immutable. Initialize a new draft to revise the Taskset.");if(s.revision<n.data.revision||e!==void 0&&n.data.revision!==e)throw new Error("Taskset draft changed before saving. Refresh before saving.")}else if(e!==void 0)throw new Error("Taskset draft is unavailable for saving.");if((!n?.success||a.refreshModelRevision)&&s.modelScope){let c=this.database.get("SELECT payload FROM model_projects WHERE id = ? AND profile_id = ?",[s.modelScope.modelId,s.profileId]);if(!c)throw new Error("Taskset draft Model was not found in this Profile.");if(S.parse(JSON.parse(c.payload)).revision!==s.modelScope.expectedModelRevision)throw new Error("Taskset draft Model changed. Refresh before editing.")}let f=this.workspacePath(s.id),d=(await M(s,f)).draft,l=E.parse({schemaVersion:"openpond.tasksetDraftPointer.v1",id:d.id,profileId:d.profileId,modelScope:d.modelScope,status:d.status,revision:d.revision,workspacePath:f,packageHash:await g(f),publishedTasksetRef:d.publishedTasksetRef,createdAt:d.createdAt,updatedAt:d.updatedAt});return await this.savePointer(l,!0),d}));return this.writeQueue=i.then(()=>{},()=>{}),i}async importTasksetDraftPackage(t){let e=O.resolve(t.packagePath),s=(await rt(e)).isDirectory()?e:O.dirname(e);await Le(s);let i=await g(s),r=await q(s),n=await this.getTasksetDraft(r.id);if(n){let c=n.metadata.importedTasksetPackage;if(c&&typeof c=="object"&&!Array.isArray(c)&&c.packageHash===i&&n.profileId===t.profileId)return n;throw new Error(`Taskset draft ${r.id} already exists. Import a package with a distinct Taskset id.`)}let f=y.parse({...r,profileId:t.profileId,modelScope:null,status:"draft",revision:1,publishedTasksetRef:null,metadata:{...r.metadata,importedTasksetPackage:{packageHash:i,importedAt:new Date().toISOString()}},updatedAt:new Date().toISOString()}),p=this.workspacePath(f.id),d=`${p}.import-${process.pid}-${Date.now()}`;await at(O.dirname(p),{recursive:!0});try{await tt(s,d,{recursive:!0,errorOnExist:!0,force:!1,preserveTimestamps:!0}),await M(f,d),await G(d,p)}catch(c){throw await Ne(d,{recursive:!0,force:!0}),c}let l=E.parse({schemaVersion:"openpond.tasksetDraftPointer.v1",id:f.id,profileId:f.profileId,status:f.status,revision:f.revision,workspacePath:p,packageHash:await g(p),publishedTasksetRef:f.publishedTasksetRef,createdAt:f.createdAt,updatedAt:f.updatedAt});return await this.savePointer(l),this.draftFromStoredPayload(l)}async materializePublishedTasksetPackage(t){let e=await this.getTasksetDraftWorkspace(t.draftId);if(!e)throw new Error(`Taskset draft ${t.draftId} workspace was not found.`);if(t.taskset.metadata.sourcePackageHash!==void 0&&t.taskset.metadata.sourcePackageHash!==e.packageHash)throw new Error("Taskset draft files changed before publication. Refresh before publishing.");let a=`draft-${m({taskset:t.taskset,packageHash:e.packageHash})}`,s=await Te(t.taskset,e.workspacePath),i=T.parse({...s.taskset,metadata:{...s.taskset.metadata,sourcePackageHash:e.packageHash},environment:{...s.taskset.environment,metadata:{...s.taskset.environment.metadata,runtimeSourceTasksetId:a}}}),r=T.parse({...i,contentHash:H(i)}),n=await N(this.home,{taskset:r,generatedFiles:s.generatedFiles},a,{source:{directory:e.workspacePath,packageHash:e.packageHash},verify:h(p=>L(p,r),"verify")}),f=await this.getTasksetDraft(t.draftId);return f?.modelScope?.source?be({home:this.home,directory:n,taskset:r,preparation:f.modelScope.source}):{directory:n,taskset:r}}async finalizeTasksetDraftPublication(t){await this.ready;let e=y.parse(t.draft),a=T.parse(t.taskset),s=e.modelScope?.source?.authoringGraph==="bound"&&typeof a.metadata.importedPackageHash=="string"?await D(this.home,a.metadata.importedPackageHash):null,i=this.writeQueue.then(()=>v(this.home,async()=>{let r=this.database.get("SELECT payload FROM taskset_drafts WHERE id = ?",[e.id]);if(!r)throw new Error("Taskset draft was deleted before publication.");let n=E.parse(JSON.parse(r.payload));if(n.profileId!==e.profileId||a.profileId!==e.profileId)throw new Error("Taskset publication belongs to another Profile.");if(m(n.modelScope)!==m(e.modelScope))throw new Error("Taskset draft Model ownership cannot change.");if(n.status==="published"&&n.publishedTasksetRef){let c=n.publishedTasksetRef,k=this.database.get("SELECT payload FROM taskset_revisions WHERE taskset_id = ? AND revision = ? AND content_hash = ?",[c.id,c.revision,c.contentHash]);if(!k)throw new Error("Published draft lost its immutable Taskset revision.");return{draft:y.parse({...e,status:n.status,revision:n.revision,publishedTasksetRef:c,updatedAt:n.updatedAt}),taskset:T.parse(JSON.parse(k.payload))}}if(n.revision!==e.revision||a.metadata.sourcePackageHash!==t.packageHash)throw new Error("Taskset draft changed before publication. Refresh before publishing.");let f=n.modelScope?.source,p=f?.authoringGraph==="bound"&&a.metadata.modelTasksetDerivation&&typeof a.metadata.modelTasksetDerivation=="object"?{...a.metadata.modelTasksetDerivation,schemaVersion:f.lineage.schemaVersion}:a.metadata.modelTasksetAuthoring;if(f&&(a.id!==f.tasksetId||a.revision!==f.tasksetRevision||m(p)!==m(f.lineage)))throw new Error("Taskset publication differs from its retained source preparation.");let d=y.parse({...e,status:"published",revision:e.revision+1,publishedTasksetRef:{id:a.id,revision:a.revision,contentHash:a.contentHash},updatedAt:new Date().toISOString()}),l=E.parse({...n,status:d.status,revision:d.revision,publishedTasksetRef:d.publishedTasksetRef,updatedAt:d.updatedAt});return ke(this.database,a,()=>{if(s&&Ee(this.database,{package:s,taskset:a,generatedFiles:[]}),ve(this.database,e,a,s),this.database.get("SELECT revision FROM taskset_drafts WHERE id = ?",[e.id])?.revision!==e.revision)throw new Error("Taskset draft changed during publication.");this.database.run("UPDATE taskset_drafts SET status = ?, revision = ?, payload = ?, updated_at = ? WHERE id = ?",[l.status,l.revision,JSON.stringify(l),l.updatedAt,e.id])}),{draft:d,taskset:a}}));return this.writeQueue=i.then(()=>{},()=>{}),i}async getTasksetDraft(t){let e=await this.getParsedPayload("SELECT payload FROM taskset_drafts WHERE id = ?",[t],a=>a);return e===null?null:this.draftFromStoredPayload(e)}async listTasksetDrafts(t){await this.ready,await this.writeQueue;let e=await this.all(t?"SELECT payload FROM taskset_drafts WHERE profile_id = ? ORDER BY updated_at DESC":"SELECT payload FROM taskset_drafts ORDER BY updated_at DESC",t?[t]:[]);return Promise.all(e.map(a=>this.draftFromStoredPayload(JSON.parse(a.payload))))}async readHumanPublishedTasksetDraft(t,e){let a=(await this.listTasksetDrafts(t)).filter(r=>r.status==="published"&&r.modelScope===null&&m(r.publishedTasksetRef)===m(e));if(a.length!==1)return null;let s=a[0],i=await this.getTasksetDraftWorkspace(s.id);return i?{draft:s,workspace:i}:null}async getTasksetDraftWorkspace(t){let e=await this.getParsedPayload("SELECT payload FROM taskset_drafts WHERE id = ?",[t],s=>s);if(e===null)return null;let a=await this.pointerFromStoredPayload(e);return{draftId:a.id,workspacePath:a.workspacePath,packageHash:await g(a.workspacePath)}}async deleteTasksetDraft(t){await this.ready;let e=this.writeQueue.then(()=>v(this.home,async()=>{let a=this.workspacePath(t),s=`${a}.delete-${et()}`,i=!1;try{await G(a,s),i=!0}catch(r){if(r.code!=="ENOENT")throw r}try{this.database.exec("BEGIN IMMEDIATE");try{this.database.run("DELETE FROM taskset_drafts WHERE id = ?",[t]),this.database.run("UPDATE model_taskset_draft_operations SET state = 'deleted' WHERE draft_id = ?",[t]),this.database.exec("COMMIT")}catch(r){throw this.database.exec("ROLLBACK"),r}}catch(r){throw i&&await G(s,a).catch(()=>{}),r}i&&await Ne(s,{recursive:!0,force:!0})}));this.writeQueue=e.catch(()=>{}),await e}async tasksetDraftFiles(t,e,a){return await this.ready,v(this.home,async()=>{let s=this.database.get("SELECT payload FROM taskset_drafts WHERE id = ? AND profile_id = ?",[e,t]);if(!s)throw new Error("Taskset draft was not found in this Profile.");let i=E.parse(JSON.parse(s.payload));if(a!==void 0){let n=await Oe(i.workspacePath,a);return{draftRevision:i.revision,file:{...n,writable:n.writable&&i.status!=="published"}}}let r=await Ae(i.workspacePath);return{draftRevision:i.revision,files:r.map(n=>({...n,writable:n.writable&&i.status!=="published"}))}})}async saveTasksetDraftFile(t,e){let a=ee.parse(e);await this.ready;let s=this.writeQueue.then(()=>v(this.home,async()=>{let i=this.database.get("SELECT payload FROM taskset_drafts WHERE id = ? AND profile_id = ?",[a.draftId,t]);if(!i)throw new Error("Taskset draft was not found in this Profile.");let r=E.parse(JSON.parse(i.payload));if(r.status==="published")throw new Error("Published Taskset drafts are immutable.");if(r.revision!==a.expectedDraftRevision)throw new Error("Taskset draft changed. Reload before saving a file.");return Fe(r.workspacePath,a,async()=>{let n=E.parse({...r,revision:r.revision+1,packageHash:await g(r.workspacePath),updatedAt:new Date().toISOString()}),f=await this.draftFromStoredPayload(n);this.database.exec("BEGIN IMMEDIATE");try{if(this.database.get("SELECT revision FROM taskset_drafts WHERE id = ? AND profile_id = ?",[a.draftId,t])?.revision!==r.revision)throw new Error("Taskset draft changed during file saving.");this.database.run("UPDATE taskset_drafts SET revision = ?, payload = ?, updated_at = ? WHERE id = ?",[n.revision,JSON.stringify(n),n.updatedAt,n.id]),this.database.exec("COMMIT")}catch(p){throw this.database.exec("ROLLBACK"),p}return f})}));return this.writeQueue=s.then(()=>{},()=>{}),s}workspacePath(t){let e=m(t).slice(0,24);return O.join(this.home,"workspaces","tasksets",`taskset-${e}`)}async draftFromStoredPayload(t){let e=await this.pointerFromStoredPayload(t),a=await q(e.workspacePath);return y.parse({...a,id:e.id,profileId:e.profileId,modelScope:e.modelScope,status:e.status,revision:e.revision,publishedTasksetRef:e.publishedTasksetRef,createdAt:e.createdAt,updatedAt:e.updatedAt})}async pointerFromStoredPayload(t){let e=E.safeParse(t);if(e.success)return e.data;let a=y.parse(t);await this.saveTasksetDraft(a);let s=await this.getParsedPayload("SELECT payload FROM taskset_drafts WHERE id = ?",[a.id],E.parse);if(!s)throw new Error(`Taskset draft ${a.id} migration failed.`);return s}async savePointer(t,e=!1){await(e?this.run.bind(this):this.upsertPayload.bind(this))(`INSERT INTO taskset_drafts (id, profile_id, status, revision, payload, created_at, updated_at)
|
|
3
|
-
VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
4
|
-
ON CONFLICT(id) DO UPDATE SET
|
|
5
|
-
profile_id = excluded.profile_id,
|
|
6
|
-
status = excluded.status,
|
|
7
|
-
revision = excluded.revision,
|
|
8
|
-
payload = excluded.payload,
|
|
9
|
-
updated_at = excluded.updated_at`,[t.id,t.profileId,t.status,t.revision,JSON.stringify(t),t.createdAt,t.updatedAt])}};async function Le(o){let t=await st(o,{withFileTypes:!0});for(let e of t){let a=O.join(o,e.name);if(e.isSymbolicLink())throw new Error(`Taskset packages cannot contain symbolic links: ${a}`);if(e.isDirectory()){await Le(a);continue}if(!e.isFile())throw new Error(`Taskset packages may contain only files and directories: ${a}`)}}h(Le,"assertRegularPackageTree");export{xe as SqliteTasksetDraftStore};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as F,b as G,c as H,d as I,e as P,f as Q,g as R,h as S,i as T,j as U,k as V,l as W,m as X,n as Y,o as Z,p as _,q as $,r as aa,s as ba,t as ca,u as da}from"./chunk-OYIFH2OM.js";import{i as J,j as K,k as L,l as M,m as N,o as O}from"./chunk-2UZHLO2V.js";import{A as n,B as o,C as p,D as q,E as r,K as s,L as t,M as u,N as v,O as w,P as x,Q as y,R as z,S as A,T as B,U as C,V as D,W as E,m as b,n as c,o as d,p as e,q as f,r as g,s as h,t as i,u as j,v as k,w as l,x as m}from"./chunk-TV2LE2BD.js";import"./chunk-OE2OOWEQ.js";import"./chunk-RRWL5BHZ.js";import"./chunk-NXN7GJOH.js";import"./chunk-TERKCK4I.js";import"./chunk-5HPZGLOL.js";import"./chunk-I6VMRQF4.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-XHU4BZQY.js";import{Aa as a}from"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import"./chunk-FTQLQJQV.js";export{L as AuthoredTasksetFileInventorySchema,n as MAX_TASKSET_PACKAGE_BYTES,a as ModelBatchReviewError,X as ModelBatchReviewInspectionSchema,Z as ModelBatchReviewReceiptSchema,Y as ModelBatchReviewRequestSchema,e as ModelTasksetAuthoringOwnerSchema,f as ModelTasksetAuthoringSchema,h as ModelTasksetDraftPreparationSchema,g as ModelTasksetDraftRequestSchema,W as OpenPondTasksetPackageClient,V as OpenPondTasksetPackageError,k as TasksetDraftFileContentSchema,j as TasksetDraftFileInfoSchema,m as TasksetDraftFileMutationSchema,i as TasksetDraftFilePathSchema,l as TasksetDraftFileSchema,ba as TasksetDraftSourceInitializationSchema,s as TasksetPackageContentSchema,o as TasksetPackageFileSchema,b as TasksetPackageLearningResourcesSchema,Q as TasksetPackageModelConfigurationSchema,R as TasksetPackagePublicationSchema,T as TasksetPackageReadbackSchema,S as TasksetPackageReceiptSchema,t as TasksetPackageSchema,U as TasksetReleasePackageReadbackSchema,aa as beginModelBatchReview,P as bindOrdinaryModelTasksetReward,O as compileModelTasksetDraftWorkspace,x as createTasksetPackage,r as createTasksetPackageExecutionFile,p as decodeTasksetPackageFile,$ as findModelBatchReview,_ as inspectModelBatchPackage,M as isGeneratedTasksetPublicationFilePath,c as learningPackageContextFiles,G as learningVerifierModule,A as materializePortableTasksetRelease,da as materializeTasksetDraftWorkspace,C as portableTasksetEnvironment,D as portableTasksetTools,N as prepareAuthoredTasksetSource,H as prepareImportedTasksetPackage,J as prepareModelTasksetDraft,ca as prepareTasksetDraftSource,F as projectLearningBatchGraders,E as projectPortableTaskRecord,B as projectPreferenceComparisonRelease,K as publishModelTasksetDraftPackage,z as resolvePortableTasksetRewardExecution,q as resolveTasksetPackageExecution,v as resolveTasksetPackageInstructions,y as resolveTasksetWorkOutputs,u as tasksetPackageRewardBinding,I as tasksetPackageSourceId,d as validateTasksetLearningResources,w as validateTasksetPackage};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import"./chunk-SFR32TMJ.js";import{a as Q,b as R,c as S,d as T,e as U,f as V,g as W,h as X,j as Y,k as Z,l as _,m as $,n as aa,o as ba,p as ca,q as da}from"./chunk-AXYAEWWA.js";import{c as J,d as K,e as L,f as M,g as N,h as O,i as P}from"./chunk-QOUOU7FE.js";import{$ as o,Da as z,Ea as A,Fa as B,Ga as C,Na as D,Oa as E,Pa as F,Qa as G,Ra as H,Sa as I,X as k,Y as l,Z as m,_ as n,a as b,aa as p,b as c,ba as q,c as d,ca as r,d as e,e as f,f as g,fa as s,g as h,ga as t,h as i,ha as u,i as j,ia as v,ja as w,ka as x,la as y}from"./chunk-5ZNE43XC.js";import"./chunk-HIQPGYVH.js";import"./chunk-263WS3TB.js";import"./chunk-SD2XDZQW.js";import"./chunk-MTP3B2SU.js";import"./chunk-I6VMRQF4.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-XHU4BZQY.js";import{Aa as a}from"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import"./chunk-FTQLQJQV.js";export{V as AuthoredTasksetFileInventorySchema,n as MAX_TASKSET_PACKAGE_BYTES,a as ModelBatchReviewError,Q as ModelBatchReviewInspectionSchema,S as ModelBatchReviewReceiptSchema,R as ModelBatchReviewRequestSchema,b as ModelTasksetAuthoringOwnerSchema,c as ModelTasksetAuthoringSchema,e as ModelTasksetDraftPreparationSchema,d as ModelTasksetDraftRequestSchema,P as OpenPondTasksetPackageClient,O as OpenPondTasksetPackageError,h as TasksetDraftFileContentSchema,g as TasksetDraftFileInfoSchema,j as TasksetDraftFileMutationSchema,f as TasksetDraftFilePathSchema,i as TasksetDraftFileSchema,ba as TasksetDraftSourceInitializationSchema,s as TasksetPackageContentSchema,o as TasksetPackageFileSchema,k as TasksetPackageLearningResourcesSchema,J as TasksetPackageModelConfigurationSchema,K as TasksetPackagePublicationSchema,M as TasksetPackageReadbackSchema,L as TasksetPackageReceiptSchema,t as TasksetPackageSchema,N as TasksetReleasePackageReadbackSchema,aa as beginModelBatchReview,Z as bindOrdinaryModelTasksetReward,Y as compileModelTasksetDraftWorkspace,x as createTasksetPackage,r as createTasksetPackageExecutionFile,p as decodeTasksetPackageFile,$ as findModelBatchReview,_ as inspectModelBatchPackage,W as isGeneratedTasksetPublicationFilePath,l as learningPackageContextFiles,A as learningVerifierModule,E as materializePortableTasksetRelease,da as materializeTasksetDraftWorkspace,G as portableTasksetEnvironment,H as portableTasksetTools,X as prepareAuthoredTasksetSource,B as prepareImportedTasksetPackage,T as prepareModelTasksetDraft,ca as prepareTasksetDraftSource,z as projectLearningBatchGraders,I as projectPortableTaskRecord,F as projectPreferenceComparisonRelease,U as publishModelTasksetDraftPackage,D as resolvePortableTasksetRewardExecution,q as resolveTasksetPackageExecution,v as resolveTasksetPackageInstructions,y as resolveTasksetWorkOutputs,u as tasksetPackageRewardBinding,C as tasksetPackageSourceId,m as validateTasksetLearningResources,w as validateTasksetPackage};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as n,b as o}from"./chunk-IF5A3XWP.js";import"./chunk-4DYWVGVS.js";import"./chunk-4TO743HO.js";import"./chunk-A77DLBR4.js";import{A as g,B as h,C as i,D as j,E as k,F as l,G as m,u as a,v as b,w as c,x as d,y as e,z as f}from"./chunk-V3T2OJBZ.js";import"./chunk-BUZ7CBJC.js";import"./chunk-O6ZYDHEJ.js";import"./chunk-TS5HNRZB.js";import"./chunk-5ZNE43XC.js";import"./chunk-HIQPGYVH.js";import"./chunk-263WS3TB.js";import"./chunk-SD2XDZQW.js";import"./chunk-MTP3B2SU.js";import"./chunk-I6VMRQF4.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-XHU4BZQY.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-SH7POUVX.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import"./chunk-UGOK7VTC.js";import"./chunk-FTQLQJQV.js";export{k as LocalToolConsultInput,b as ToolLearningCredentialRecordSchema,j as captureLocalToolBoundary,h as configureLocalToolLearning,l as consultLocalToolLearning,i as flushToolLearning,e as loadToolLearningCredential,a as nativeToolLearningClientVersion,o as probeToolLearningMcp,m as readLocalToolConsultation,n as runToolLearningMcp,f as saveToolLearningCredential,d as toolLearningCredentialId,c as toolLearningHome,g as toolLearningProducer};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d,e}from"./chunk-6HQUIKC5.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import"./chunk-3M53YXEI.js";import"./chunk-TERKCK4I.js";import"./chunk-5HPZGLOL.js";import"./chunk-GLUWATL5.js";import"./chunk-XHU4BZQY.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-SH7POUVX.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import"./chunk-UGOK7VTC.js";import"./chunk-FTQLQJQV.js";export{a as DEFAULT_LOCAL_TRAINING_API_URL,b as LOCAL_TRAINING_RESPONSE_LIMIT,e as TrainingApiClient,d as createLocalAuthenticatedRequest,c as runTrainingCommand};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{$ as ia,A as J,Aa as Ja,B as K,Ba as Ka,C as L,D as M,E as N,F as O,G as P,H as Q,I as R,J as S,K as T,L as U,M as V,N as W,O as X,P as Y,Q as Z,R as _,S as $,T as aa,U as ba,V as ca,W as da,X as ea,Y as fa,Z as ga,_ as ha,a as q,aa as ja,b as r,ba as ka,c as s,ca as la,d as t,da as ma,e as u,ea as na,f as v,fa as oa,ga as pa,ha as qa,ia as ra,ja as sa,ka as ta,la as ua,ma as va,na as wa,oa as xa,pa as ya,qa as za,r as A,ra as Aa,s as B,sa as Ba,t as C,ta as Ca,u as D,ua as Da,v as E,va as Ea,w as F,wa as Fa,x as G,xa as Ga,y as H,ya as Ha,z as I,za as Ia}from"./chunk-OE2OOWEQ.js";import{a as w,b as x,c as y,d as z}from"./chunk-RRWL5BHZ.js";import{a as o,b as p}from"./chunk-NXN7GJOH.js";import{a as l,b as m,c as n}from"./chunk-TERKCK4I.js";import{a,b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k}from"./chunk-5HPZGLOL.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-XHU4BZQY.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import"./chunk-FTQLQJQV.js";export{w as HardwareAvailabilitySchema,z as HardwareFleetSnapshotSchema,x as HardwareGpuObservationSchema,y as HardwareObservationSchema,r as ManagedSftRecipeSchema,b as OPENPOND_TRAINING_MEDIA_TYPE,a as OPENPOND_TRAINING_PROTOCOL_MAJOR,f as OpenPondProtocolError,p as OpenPondTrainingApiError,oa as PolicyOptimizationRequestSchema,ma as RewardModelTrainingRequestSchema,q as SftRecipeSchema,e as TRAINING_API_RESPONSE_MAX_BYTES,aa as TRAINING_EVALUATION_SOURCE_PATH,d as TRAINING_INPUT_ARTIFACT_MAX_BYTES,c as TRAINING_JOB_SUBMISSION_MAX_BYTES,u as TrainingAcceptanceGroupPageSchema,v as TrainingAcceptanceGroupQuerySchema,s as TrainingAcceptanceGroupReferenceSchema,t as TrainingAcceptanceGroupSummarySchema,o as TrainingApiErrorSchema,T as TrainingCandidateDecisionRequestSchema,U as TrainingCandidateDecisionSchema,Ja as TrainingCapabilitiesSchema,ka as TrainingCapabilityRequirementSchema,C as TrainingCheckpointRecoveryRequestSchema,A as TrainingCheckpointRecoveryResourceApprovalSchema,O as TrainingEstimateComponentSchema,N as TrainingEstimateRequestSchema,m as TrainingEstimateReviewSchema,Q as TrainingEstimateSchema,M as TrainingEstimateSourceSchema,ba as TrainingEvaluationSourceSchema,Y as TrainingEvaluationTaskPageSchema,X as TrainingEvaluationTaskResultSchema,Ca as TrainingExecutionReceiptSchema,n as TrainingGpuCatalogSchema,l as TrainingGpuSelectionSchema,S as TrainingHarnessSourcePublicationSchema,fa as TrainingInputArtifactSchema,ea as TrainingInputArtifactUploadSchema,qa as TrainingJobApprovalSchema,za as TrainingJobControlRequestSchema,xa as TrainingJobEventSchema,ia as TrainingJobKindSchema,ya as TrainingJobLogSchema,Aa as TrainingJobOutputSchema,Ga as TrainingJobOutputsSchema,wa as TrainingJobPageSchema,ua as TrainingJobRecoverySchema,pa as TrainingJobRequestSchema,va as TrainingJobSchema,la as TrainingJobSourceSchema,ja as TrainingJobStateSchema,ra as TrainingJobSubmissionSchema,D as TrainingPhysicalPlacementSchema,Ha as TrainingPolicyLoraCapabilitiesSchema,I as TrainingPreparationControlSchema,J as TrainingPreparationListQuerySchema,K as TrainingPreparationPageSchema,F as TrainingPreparationPlanContentSchema,G as TrainingPreparationPlanSchema,H as TrainingPreparationReceiptSchema,E as TrainingPreparationRequestSchema,na as TrainingQualificationBaseModelSchema,Ba as TrainingQualificationEvidenceSchema,R as TrainingQueueStatusSchema,j as assertCanonicalPayloadSize,ca as assertTrainingEvaluationIsolation,Fa as assertTrainingQualificationReceipt,g as canonicalJson,h as canonicalJsonByteLength,i as canonicalSha256,B as createTrainingCheckpointRecoveryResourceApproval,Ka as createTrainingClient,$ as deterministicTrainingRewardSource,W as parseAndVerifyTrainingCandidateDecision,_ as parseAndVerifyTrainingEvaluationTaskPage,Ea as parseAndVerifyTrainingExecutionReceipt,ha as parseAndVerifyTrainingInputArtifactUpload,ta as parseAndVerifyTrainingJobSubmission,L as parseAndVerifyTrainingPreparationReceipt,k as parseBoundedJson,Ia as supportsTrainingPolicyLoraRank,V as trainingCandidateDecisionHash,P as trainingEstimateSourceIdentity,da as trainingEvaluationSourceRef,Z as trainingEvaluationTaskPageHash,Da as trainingExecutionReceiptHash,ga as trainingInputArtifactUploadHash,sa as trainingJobSubmissionHash};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as ne}from"./chunk-IHAEZ73V.js";import{a as W}from"./chunk-IOSBGCRT.js";import"./chunk-V3KEG6MI.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{c as k,f as E,h as T}from"./chunk-3M53YXEI.js";import"./chunk-4N4EH3RJ.js";import"./chunk-ULJZ7NUF.js";import"./chunk-WJSJXK2N.js";import{b as A,c as K}from"./chunk-R6MMWEH4.js";import{a as x}from"./chunk-TBODQT4W.js";import{Ba as te,C as Z,ka as Y,v as X,wa as ee}from"./chunk-OE2OOWEQ.js";import"./chunk-RRWL5BHZ.js";import{b as M}from"./chunk-NXN7GJOH.js";import{k as Q,m as S}from"./chunk-TERKCK4I.js";import"./chunk-UNE52L3Y.js";import{g as G}from"./chunk-5HPZGLOL.js";import"./chunk-GLUWATL5.js";import"./chunk-JCLTFDVW.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-6FA3GG5B.js";import{Bb as L,sc as q,tc as B,uc as F,vc as V,wc as z}from"./chunk-XHU4BZQY.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-SH7POUVX.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import{A as g}from"./chunk-X2J2P5ZT.js";import"./chunk-UGOK7VTC.js";import{a as f}from"./chunk-FTQLQJQV.js";async function re(n,c={}){let t=process.env.OPENPOND_CHAT_INVOCATION;if(t)try{let e=process.env.OPENPOND_LOCAL_API_URL;if(!e)throw new Error("The chat executor did not supply its local API URL.");let o=new URL(e);if(o.protocol!=="http:"||!["127.0.0.1","localhost","[::1]"].includes(o.hostname)||o.username||o.password)throw new Error("Chat attachment requires the app's loopback API origin.");let l=await(c.request??await(await import("./training-7VQNCOGH.js")).createLocalAuthenticatedRequest(e,{timeoutMs:15e3}))(new URL("/v1/chat-experiments",o),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:"attach_training",invocationToken:t,payload:{location:"cloud",...n}}),signal:AbortSignal.timeout(15e3),redirect:"error"});if(!l.ok)throw new Error(`Chat attachment returned HTTP ${l.status}.`)}catch(e){(c.warn??console.error)(`Hosted operation succeeded, but chat attachment failed: ${e instanceof Error?e.message:String(e)}. Inspect the saved job to retry attachment; do not submit it again.`)}}f(re,"attachHostedTrainingToChat");import{readFile as me}from"node:fs/promises";var C=g.string().trim().min(1).max(500),ce=g.object({id:C,contentHash:g.string().regex(/^[a-f0-9]{64}$/)}).strict(),de=g.object({teamId:C,modelId:C,runId:C.optional(),from:g.string().datetime().optional(),to:g.string().datetime().optional()}).strict(),le=g.discriminatedUnion("action",[g.object({action:g.literal("declare_verification"),teamId:C,operationId:C,plan:g.object({modelId:q.shape.modelId,classification:q.shape.classification,feedback:q.shape.feedback,evidence:q.shape.evidence,trainingJobId:q.shape.trainingJobId,checkpoint:q.shape.checkpoint,artifact:q.shape.artifact,taskset:q.shape.taskset,checks:q.shape.checks,baselineOperationId:q.shape.baselineOperationId,candidateOperationId:q.shape.candidateOperationId,criterion:q.shape.criterion}).strict()}).strict(),g.object({action:g.literal("link_live_opportunity"),teamId:C,operationId:C,correction:ce,inferenceRequestId:C,grade:g.object({id:C,revision:g.number().int().positive()}).strict(),checkIds:g.array(C).min(1).max(1e3)}).strict()]),ue=g.object({summary:z.nullable(),observations:g.array(V).max(1e3)}).strict(),P=class{static{f(this,"OpenPondCorrectionMetricsClient")}options;constructor(c){if(!c.apiKey.trim())throw new Error("Learning API key is required.");let t=new URL(c.baseUrl);if(!["http:","https:"].includes(t.protocol)||t.username||t.password||t.search||t.hash)throw new Error("Learning base URL must be an HTTP(S) endpoint without credentials, query, or fragment.");this.options={...c,baseUrl:t.toString().replace(/\/+$/,"")}}async request(c,t,e){let o=await(this.options.fetch??globalThis.fetch)(`${this.options.baseUrl}${c}`,{...e,redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"Content-Type":"application/json",Accept:"application/json","X-OpenPond-Team-Id":t}}),i;try{i=await K(o)}catch(l){throw l instanceof x?l:new x(o.ok?502:o.status,"invalid_response","Correction metrics returned an invalid response.",null)}if(!o.ok){let l=g.object({code:g.string().optional(),error:g.string().optional()}).passthrough().safeParse(i);throw new x(o.status,l.success?l.data.code??"correction_request_failed":"correction_request_failed",l.success?l.data.error??`Correction metrics request failed (${o.status}).`:`Correction metrics request failed (${o.status}).`,i)}return i}async read(c,t={}){let e=de.parse(c),o=ue.parse(await this.request(`/v1/learning/corrections?query=${encodeURIComponent(JSON.stringify(e))}`,e.teamId,{method:"GET",signal:t.signal}));if(o.summary&&(o.summary.scope.teamId!==e.teamId||o.summary.scope.modelId!==e.modelId||e.runId&&o.summary.scope.runId!==e.runId)||o.observations.some(i=>i.modelId!==e.modelId||e.runId&&i.trainingJobId!==e.runId))throw new x(502,"correction_scope_mismatch","Correction metrics did not match the requested workspace, Model or run.",null);return o}async command(c,t={}){let e=le.parse(c);L(e);let o=await this.request("/v1/learning/corrections",e.teamId,{method:"POST",body:JSON.stringify(e),signal:t.signal});if(e.action==="declare_verification"){let l=B.parse(o);if(l.teamId!==e.teamId||l.modelId!==e.plan.modelId||l.trainingJobId!==e.plan.trainingJobId)throw new x(502,"correction_scope_mismatch","Correction declaration did not match the requested workspace, Model or run.",null);return l}let i=F.parse(o);if(i.correction.id!==e.correction.id||i.correction.contentHash!==e.correction.contentHash||i.attempt.id!==e.inferenceRequestId)throw new x(502,"correction_scope_mismatch","Correction opportunity did not match the declared correction and serving request.",null);return i}};var H=new Set(["succeeded","failed","cancelled"]);function U(n){let c=T(n.intervalMs,"interval-ms")??1e4,t=T(n.cleanupTimeoutMs,"cleanup-timeout-ms")??18e4,e=T(n.cleanupReserveMs,"cleanup-reserve-ms")??18e4;if([c,t,e].some(l=>!Number.isSafeInteger(l)||l>2147483647))throw new Error("Watch intervals and cleanup bounds must fit a positive 32-bit millisecond timer.");if(c<250)throw new Error("--interval-ms must be at least 250.");if(t<1e3||e<1e3)throw new Error("Cleanup timeout and reserve must be at least 1000 ms.");let o=k(n,"deadlineAt");if(!o&&n.cleanupReserveMs!==void 0)throw new Error("--cleanup-reserve-ms requires --deadline-at.");let i=o?Date.parse(o):null;if(o&&(!/T.*(?:Z|[+-]\d{2}:\d{2})$/.test(o)||!Number.isFinite(i)))throw new Error("--deadline-at requires an ISO timestamp with an explicit timezone.");if(i!==null&&i-e<=Date.now())throw new Error("--deadline-at must leave time for execution and the cleanup reserve.");return{intervalMs:c,deadlineAt:i,cancelAt:i===null?null:i-e,waitForCleanup:i!==null||E(n.waitForCleanup)||E(n.cancelOnInfrastructureError),cleanupTimeoutMs:t,cancelOnInfrastructureError:E(n.cancelOnInfrastructureError)}}f(U,"parseHostedWatchOptions");async function R(n,c,t){for(let e=0;e<4;e++){let o=await n.getJob(c);if(O(o,c,t),H.has(o.state)||o.state==="cancelling")return o;try{let i=await n.cancelJob(c,o.version);return O(i,c,t,o.submissionHash),i}catch(i){if(!(i instanceof M)||i.status!==409||i.code!=="stale_version"||e===3)throw i}}throw new Error("Hosted cancellation could not reconcile the current Job version.")}f(R,"cancelHostedTrainingJob");async function ie(n,c,t){for(let e=0;e<4;e++){let o=await n.getJob(c);if(O(o,c,t),H.has(o.state)||o.state==="cancelling")return o;try{let i=await n.stopAfterGroup(c,o.version);return O(i,c,t,o.submissionHash),i}catch(i){if(!(i instanceof M)||i.status!==409||i.code!=="stale_version"||e===3)throw i}}throw new Error("Hosted graceful stop could not reconcile the current Job version.")}f(ie,"stopHostedTrainingJobAfterGroup");async function N(n){let{client:c,options:t,jobId:e,teamId:o}=n,i=null,l,p=!1;for(;;){let m=Math.min(t.deadlineAt??1/0,i??1/0);if(n.requestBound.deadlineAt=Number.isFinite(m)?m:null,Date.now()>=m)throw oe(e);try{let s=t.cancelAt!==null&&Date.now()>=t.cancelAt&&!p?await R(c,e,o):await c.getJob(e);if(O(s,e,o,l),l=s.submissionHash,t.cancelOnInfrastructureError&&!p&&!H.has(s.state)&&s.state!=="cancelling"){let d=await c.events(e);if(d.some(b=>b.jobId!==e))throw new Error("Hosted event does not match the watched Job.");let v=d.find(b=>b.type==="rollout_metric"&&b.data.terminalClass==="infrastructure"&&b.data.rewardEligible===!1);v&&(n.print({jobId:e,event:"hosted_watch_infrastructure_failure",trajectoryEventId:v.id,data:v.data}),s=await R(c,e,o),O(s,e,o,l),i??=Date.now()+t.cleanupTimeoutMs)}if(p||=s.state==="cancelling"||H.has(s.state),n.print(s),H.has(s.state)){let d=s.executionMode==="qualification"&&s.state==="succeeded";if(!t.waitForCleanup&&!d)return;i??=Date.now()+t.cleanupTimeoutMs,n.requestBound.deadlineAt=Math.min(t.deadlineAt??1/0,i);let{receipt:v,outputs:b}=await c.outputs(e);if(v){if(v.jobId!==e||v.teamId!==o||v.submissionHash!==l)throw new Error("Hosted cleanup receipt does not match the watched Job and submission.");if(v.cleanupComplete){d&&await ee(v,{submissionHash:l,outputs:b}),n.print({jobId:e,cleanup:{scope:"job",complete:!0,receipt:v}});return}}else if(s.rolloutProgress.groupsTarget===0&&n.readNativeInspection){let I=ne(await n.readNativeInspection(e),s);if(I.cleanupComplete){n.print({jobId:e,cleanup:{scope:"job",complete:!0,evidence:"native_read_only_attestation",nativeJobVersion:I.nativeJobVersion,attestation:I.cleanupAttestation}});return}}}}catch(s){if(n.requestBound.deadlineAt!==null&&Date.now()>=n.requestBound.deadlineAt)throw oe(e);if(t.deadlineAt===null&&i===null||!pe(s))throw s;console.error(JSON.stringify({jobId:e,event:"hosted_watch_retry",code:s instanceof M?s.code:"transport_unavailable"}))}let y=Math.min(n.requestBound.deadlineAt??1/0,!p&&t.cancelAt!==null&&Date.now()<t.cancelAt?t.cancelAt:1/0);await new Promise(s=>setTimeout(s,Math.max(0,Math.min(t.intervalMs,y-Date.now()))))}}f(N,"watchHostedTrainingJob");function O(n,c,t,e){if(n.id!==c||n.teamId!==t||e!==void 0&&n.submissionHash!==e)throw new Error("Hosted response does not match the requested Job, workspace, and submission.")}f(O,"assertJobIdentity");function pe(n){return n instanceof M?n.status===429||n.status>=500:n instanceof G?n.code==="invalid_error_response"||n.code==="invalid_json":n instanceof TypeError||n instanceof Error&&["TimeoutError","AbortError"].includes(n.name)}f(pe,"isTransient");function oe(n){return new Error(`Hosted watch deadline reached for ${n}; completed job cleanup is unverified. Inspect hosted-status, hosted-artifacts, and provider retirement before treating resources as released.`)}f(oe,"cleanupDeadlineError");var $=f(n=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:4}).format(n),"money"),ae=f(n=>n>=3600?`${(n/3600).toFixed(1)} hours`:`${Math.max(1,Math.ceil(n/60))} minutes`,"duration");function D(n,c){if(c){console.log(JSON.stringify(n,null,2));return}console.log(`Estimate ${n.id} (${n.status.replaceAll("_"," ")})`),console.log(`Model: ${n.configuration.modelId}@${n.configuration.modelRevision}`);let t=n.configuration;console.log(`Configuration: ${t.method}${t.loraRank===null?"":`, rank ${t.loraRank}`}${t.groups===null?"":`, ${t.groups} groups`}${t.rolloutConcurrency===null?"":`, ${t.rolloutConcurrency} rollout lanes`}${t.adapterMode===null?"":`, ${t.adapterMode}`}`),console.log(`GPU: ${n.gpu.resolved?.gpuType??"Awaiting a supported offering"} \xD7 ${n.gpu.resolved?.gpuCount??n.gpu.requested.gpuCount??1} (${n.gpu.requested.mode}, ${n.gpu.availability})`);let e=n.cost;console.log(`Expected cost: ${e.expectedUsd===null?"Not yet calibrated":$(e.expectedUsd)}`),e.planningRangeUsd&&console.log(`Planning range: ${$(e.planningRangeUsd.low)}\u2013${$(e.planningRangeUsd.high)}`),console.log(`Execution time: ${n.executionSeconds.expected===null?"Not yet calibrated":ae(n.executionSeconds.expected)}`),console.log(`Queue wait: ${n.queueWaitSeconds===null?"Start time not yet known":`about ${ae(n.queueWaitSeconds.expected)}`}`),console.log(`Recommended maximum budget: ${e.recommendedMaximumUsd===null?"Unavailable with current evidence":$(e.recommendedMaximumUsd)}`),console.log(`Approved hard cap: ${t.approvedMaximumUsd===null?"Not approved":$(t.approvedMaximumUsd)}`),t.approvedMaximumUsd!==null&&e.expectedUsd!==null&&e.expectedUsd>t.approvedMaximumUsd&&console.log("Expected cost exceeds the approved cap. Change the run or explicitly approve a different budget before submission.");for(let o of e.components)o.expectedUsd!==null&&console.log(` ${o.phase.replaceAll("_"," ")} / ${o.resource}: ${$(o.expectedUsd)}`);for(let o of n.assumptions)console.log(`Assumption: ${o}`);for(let o of n.unknowns)console.log(`Unknown: ${o}`);console.log(`Evidence: ${n.calibration.completedSamples} completed, ${n.calibration.partialSamples} partial samples; expires ${n.expiresAt}`),console.log("This estimate reserves no resources and approves no spending.")}f(D,"printTrainingEstimate");var h=f(n=>console.log(JSON.stringify(n,null,2)),"print");async function Re(n,c){let t=c[0],e=c[1],o=t==="hosted-watch"?U(n):null,i={deadlineAt:o?.deadlineAt??null},{context:l,baseUrl:p,teamId:m,headers:y}=await W(n),s=f((r,a)=>{let u=i.deadlineAt===null?1/0:i.deadlineAt-Date.now();if(u<=0)throw new DOMException("Hosted watch deadline reached","TimeoutError");let w=AbortSignal.timeout(Math.max(1,Math.min(o?1e4:18e4,u)));return fetch(r,{...a,redirect:"error",signal:a?.signal?AbortSignal.any([a.signal,w]):w})},"request"),d=te({baseUrl:p,headers:y,fetch:s}),v=f(r=>re({jobId:r,teamId:m,apiOrigin:new URL(p).origin}),"attach"),b=f(async(r,a)=>{h(r),await v(a)},"printAttached"),I=f(async()=>{if(!e)throw new Error(`${t} requires an input JSON file.`);let r=await me(e);if(r.byteLength>64*1024*1024)throw new Error("Hosted training input exceeds 64 MiB.");return JSON.parse(r.toString("utf8"))},"readInput"),_=f(async r=>{let a=await s(new URL(`/v1/managed-rl/jobs/${encodeURIComponent(r)}`,p),{headers:y});if(!a.ok)throw new M(a.status,{schemaVersion:"openpond.trainingApiError.v2",code:"inspection_failed",message:`Hosted job inspection failed (${a.status}).`,retryable:a.status===429||a.status>=500,requestId:null,details:{}});return a.json()},"readNativeInspection");if(c.length>2)throw new Error(`${t} accepts at most one identifier or input file.`);if(["hosted-serving-pools","hosted-base-serving-prepare","hosted-serving-pool-retire"].includes(t??"")){h(await(await import("./training-hosted-serving-N2MHWGZN.js")).runHostedServingCommand({action:t,target:e,baseUrl:p,headers:y,request:s,readInput:I,confirmed:E(n.yes)}));return}if(t==="hosted-evaluate-checkpoint"){if(!E(n.yes))throw new Error("Paid checkpoint evaluation requires --yes.");let r=(await import("./training-hosted-checkpoint-evaluation-2X7RSOLC.js")).parseCheckpointEvaluationRequest(await I()),a=new Headers(y);a.set("content-type","application/json");let u=await s(new URL("/v1/managed-rl/serving-soaks",p),{method:"POST",headers:a,body:JSON.stringify(r)}),w=await u.json();if(!u.ok){let J=w&&typeof w=="object"&&"error"in w?String(w.error):"checkpoint_evaluation_failed";throw new Error(`Checkpoint evaluation failed (${u.status}): ${J}. Reconcile hosted-jobs before retrying the same immutable request.`)}let j=(await import("./training-hosted-checkpoint-evaluation-2X7RSOLC.js")).parseCheckpointEvaluationResponse(w,r);await b(j,j.job.id);return}if(t==="hosted-provider"||t==="hosted-quotes"){if(e)throw new Error(`${t} does not accept an identifier.`);let r=t==="hosted-provider"?"/v1/managed-rl/provider-inventory":"/v1/managed-rl/quotes",a=await s(new URL(r,p),{headers:y}),u=await a.json();if(!a.ok)throw new Error(`Hosted capacity read failed (${a.status}).`);h(u);return}if(t==="hosted-hardware"){if(e)throw new Error("hosted-hardware does not accept an identifier; use --worker-id or --job-id.");h(await d.hardwareObservations({teamId:m,workerId:k(n,"workerId")||void 0,jobId:k(n,"jobId")||void 0,cursor:k(n,"cursor")||void 0,limit:n.limit===void 0?void 0:T(n.limit,"limit")}));return}if(t==="hosted-workers"||t==="hosted-worker"||t?.startsWith("hosted-worker-")){h(await(await import("./training-hosted-workers-Y2PO5IOA.js")).runHostedWorkerCommand({action:t,target:e,baseUrl:p,headers:y,request:s,readInput:I,confirmed:E(n.yes)}));return}if(t==="hosted-models"){h(await S({baseUrl:p,headers:y,fetch:s}).list());return}if(t==="hosted-model"){if(!e)throw new Error("hosted-model requires a Model Project ID.");h(await S({baseUrl:p,headers:y,fetch:s}).get(e));return}if(t==="hosted-corrections"||t==="hosted-learning-inspect"){if(!e)throw new Error(`${t} requires a hosted Model Project ID.`);let{project:r}=await S({baseUrl:p,headers:y,fetch:s}).get(e);h(await(await import("./training-hosted-learning-WQ2IP5FP.js")).inspectHostedLearning({action:t,options:n,teamId:m,model:r,learning:new A({baseUrl:p,apiKey:l.token,scope:m,fetch:s}),corrections:new P({baseUrl:p,apiKey:l.token,fetch:s})}));return}if(t==="hosted-sync-model"){let r=Q.parse(await I());h(await S({baseUrl:p,headers:y,fetch:s}).upsert(r));return}if(t==="hosted-publish-taskset"){let{OpenPondTasksetPackageClient:r,TasksetPackagePublicationSchema:a}=await import("./taskset-packages-SXBLYHSP.js"),u=a.parse(await I());h(await new r({baseUrl:p,apiKey:l.token,teamId:m,fetch:s}).publish(u));return}if(t==="hosted-capabilities"){h(await d.capabilities());return}if(t==="hosted-gpu-catalog"){h(await d.gpuCatalog());return}if(t==="hosted-start-model"){if(!e)throw new Error("training start requires a saved hosted Model Project ID.");let r=await(await import("./training-model-start-G7YDZ7ZG.js")).startHostedModel({options:n,modelId:e,teamId:m,client:d,models:S({baseUrl:p,headers:y,fetch:s}),learning:new A({baseUrl:p,apiKey:l.token,scope:m,fetch:s})});h(r),r.preparation.jobId&&await v(r.preparation.jobId),r.preparation.jobId&&!E(n.detach)&&await N({client:d,jobId:r.preparation.jobId,teamId:m,options:U(n),print:h,requestBound:i,readNativeInspection:_});return}if(t==="hosted-estimate-model"){if(!e)throw new Error("training estimate requires a hosted Model Project ID.");let{project:r}=await S({baseUrl:p,headers:y,fetch:s}).get(e),a=k(n,"batchId"),u=a?await new A({baseUrl:p,apiKey:l.token,scope:m,fetch:s}).get("batch",a):null,{trainingGpuChoice:w}=await import("./training-model-start-G7YDZ7ZG.js"),j=w(n)??r.trainingSetup.managedGpuSelection;D(await d.estimate({schemaVersion:"openpond.trainingEstimateRequest.v1",teamId:m,source:{kind:"configuration",id:r.id,expectedRevision:r.revision,expectedEtag:r.etag,batch:u?{id:u.id,revision:u.revision,contentHash:u.contentHash}:null},...j?{gpuSelection:j}:{}}),E(n.json));return}if(t==="hosted-estimate"){let{TrainingEstimateRequestSchema:r}=await import("./training-VKLPNCMC.js"),a=r.parse(await I());if(a.teamId!==m)throw new Error("Estimate input belongs to a different workspace.");D(await d.estimate(a),E(n.json));return}if(t==="hosted-batches"){let r=new A({baseUrl:p,apiKey:l.token,scope:m,fetch:s});h(await r.list("batch",{limit:100}));return}if(t==="hosted-preparations"){h(await d.listPreparations(m));return}if(t==="hosted-jobs"){h(await d.listJobs({limit:100}));return}if(t==="hosted-prepare"){let r=X.parse(await I());if(r.teamId!==m)throw new Error("Preparation input belongs to a different workspace.");h(await d.prepareRun(r));return}if(t==="hosted-start"){let r=await Z(await I());if(r.plan.request.teamId!==m)throw new Error("Preparation belongs to a different workspace.");if(!E(n.yes))throw new Error("Starting paid hosted training requires --yes.");let a=await d.startPreparation(r.plan.id,{teamId:m,planHash:r.plan.contentHash,expectedRevision:r.revision});h(a),a.jobId&&await v(a.jobId);return}if(t==="hosted-stage"){h(await d.stageArtifact(await I()));return}if(t==="hosted-submit"||t==="hosted-qualify"){let r=await Y(await I());if(t==="hosted-qualify"&&(r.job.kind!=="policy_optimize"||r.job.executionMode!=="qualification"))throw new Error("hosted-qualify requires an immutable policy_optimize submission with executionMode=qualification.");if(!E(n.yes))throw new Error("Submitting paid hosted training requires --yes.");if(r.gpuSelection?.gpuCount===2||r.job.kind==="policy_optimize"&&r.job.executionMode==="qualification"){let u=await d.capabilities();if(r.gpuSelection?.gpuCount===2&&!u.policyDataParallel)throw new Error("This hosted runtime has no qualified two-GPU policy-training image.");if(r.job.kind==="policy_optimize"&&r.job.executionMode==="qualification"&&!u.executionModes?.includes("qualification"))throw new Error("This hosted runtime does not advertise original-learner qualification support.")}let a=await d.createJob(r);if(a.teamId!==m||a.submissionHash!==r.contentHash||a.kind!==r.job.kind||r.job.kind==="policy_optimize"&&a.executionMode!==r.job.executionMode)throw new Error(`Hosted submission response identity or execution mode mismatch; inspect hosted-status ${a.id} before attempting another submission.`);await b(a,a.id);return}if(!e)throw new Error(`${t} requires a hosted job ID.`);if(t==="hosted-status"){await b(await d.getJob(e),e);return}if(t==="hosted-report"){let r=await d.getJob(e),[a,u]=await Promise.all([d.events(e),d.outputs(e)]),w=await d.getJob(e);if(w.id!==e||w.teamId!==m||r.id!==e||r.teamId!==m)throw new Error("Hosted report status identity mismatch.");let j=w.recovery?await d.getJob(w.recovery.sourceJobId):void 0,J=w.rolloutProgress.groupsTarget===0?(await import("./training-hosted-serving-report-VZ4SMLMG.js")).parseHostedServingReportEvidence(await _(e),w):void 0,{buildHostedTrainingReport:se}=await import("./training-hosted-report-T633TNJG.js");await b(se({job:w,events:a,outputs:u,recoverySourceJob:j,servingEvidence:J,versionBeforeRead:r.version,generatedAt:new Date().toISOString()}),e);return}if(t==="hosted-evaluation-tasks"){let r=k(n,"evaluationId");if(!r)throw new Error("hosted-evaluation-tasks requires --evaluation-id from hosted-artifacts.");let u=(await d.outputs(e)).outputs.find(w=>w.kind==="evaluation"&&w.id===r);if(!u)throw new Error("Evaluation does not belong to this job's retained outputs.");h(await d.evaluationTasks(e,{id:u.id,contentHash:u.contentHash},{cursor:k(n,"cursor")||void 0,limit:T(n.limit,"--limit")}));return}if(t==="hosted-trajectory"){let r=k(n,"trajectoryId");if(!r)throw new Error("hosted-trajectory requires --trajectory-id <receipt-id> from hosted-inspect.");let a=await s(new URL(`/v1/managed-rl/jobs/${encodeURIComponent(e)}/trajectories/${encodeURIComponent(r)}`,p),{headers:y});if(!a.ok)throw new Error(`Hosted trajectory read failed (${a.status}).`);h(await a.json());return}if(t==="hosted-feedback"){let{readHostedGraderFeedback:r}=await import("./training-hosted-feedback-5B2KJGOT.js");h(await r({jobId:e,baseUrl:p,headers:y,request:s,trajectoryId:k(n,"trajectoryId")||void 0,evaluationId:k(n,"evaluationId")||void 0,taskId:k(n,"taskId")||void 0}));return}if(t==="hosted-inspect"){h(await _(e));return}if(t==="hosted-recover"){if(!E(n.yes))throw new Error("hosted-recover requires --yes for its explicit funded execution request.");let{jobId:r,...a}=await I();if(typeof r!="string"||!r)throw new Error("hosted-recover requires jobId in its input JSON.");let u=await d.recoverCheckpoint(r,a);await b(u,u.id);return}if(t==="hosted-cancel"){await b(await R(d,e,m),e);return}if(t==="hosted-stop-after-group"){if(!E(n.yes))throw new Error("hosted-stop-after-group requires --yes to shorten the admitted training schedule.");await b(await ie(d,e,m),e);return}if(t==="hosted-artifacts"){await b(await d.outputs(e),e);return}if(t==="hosted-logs"){await b(await d.logs(e),e);return}if(t==="hosted-events"){await b(await d.events(e),e);return}if(t==="hosted-watch"&&o){await v(e),await N({client:d,jobId:e,teamId:m,options:o,print:h,requestBound:i,readNativeInspection:_});return}throw new Error(`Unknown hosted training command: ${t}`)}f(Re,"runHostedTrainingCommand");export{Re as runHostedTrainingCommand};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a}from"./chunk-IHAEZ73V.js";import"./chunk-OE2OOWEQ.js";import"./chunk-RRWL5BHZ.js";import"./chunk-NXN7GJOH.js";import"./chunk-TERKCK4I.js";import"./chunk-5HPZGLOL.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import"./chunk-XHU4BZQY.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import"./chunk-FTQLQJQV.js";export{a as parseHostedServingReportEvidence};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{c as s,f as l,g as f}from"./chunk-3M53YXEI.js";import"./chunk-OE2OOWEQ.js";import"./chunk-RRWL5BHZ.js";import"./chunk-NXN7GJOH.js";import{a as b}from"./chunk-TERKCK4I.js";import"./chunk-5HPZGLOL.js";import"./chunk-QAFXQHHG.js";import"./chunk-OKKNDQJF.js";import"./chunk-AJXWJLZA.js";import{K as y}from"./chunk-XHU4BZQY.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as g}from"./chunk-FTQLQJQV.js";import{randomUUID as $}from"node:crypto";import{createInterface as h}from"node:readline/promises";function x(i){let e=s(i,"gpuType"),d=s(i,"availabilityId"),c=s(i,"gpuPlacementObjective"),t=f(i.gpuCount,"gpu-count");if(t!==void 0&&t!==1&&t!==2)throw new Error("--gpu-count must be 1 or 2.");if(e||d){if(!e||!d||c)throw new Error("Choose --gpu-type with --availability-id, or --gpu-placement-objective.");return b.parse({mode:"manual",gpuType:e,availabilityId:d,...t!==void 0?{gpuCount:t}:{}})}return c||t!==void 0?b.parse({mode:"automatic",objective:c??"balanced",...t!==void 0?{gpuCount:t}:{}}):void 0}g(x,"trainingGpuChoice");async function E(i){let{options:e,client:d,teamId:c}=i,t=s(e,"batchId");if(!t)throw new Error("training start --team-id requires --batch-id <sealed-approved-batch-id>.");let v=process.stdin.isTTY&&process.stdout.isTTY&&!l(e.json),m=l(e.yes);if(!m&&!v)throw new Error("Noninteractive training start requires --yes and an explicitly approved --max-spend or saved budget.");for(let a of["manifest","comparisonSeriesEntry","retentionDays","exportApproved"])if(e[a]!==void 0)throw new Error(`Hosted saved-Model starts use the retained configuration; ${a} is not a run override.`);let[{project:r},w]=await Promise.all([i.models.get(i.modelId),i.learning.get("batch",t)]),p=x(e)??r.trainingSetup.managedGpuSelection,n=f(e.maxSpend,"max-spend")??r.trainingSetup.preferredMaximumSpendUsd;if(v&&!m){let a=h({input:process.stdin,output:process.stdout});try{let u=await a.question(`Maximum budget in USD${n===null?"":` [${n}]`}: `);u.trim()&&(n=Number(u.trim()))}finally{a.close()}}if(n===null||!Number.isFinite(n)||n<=0||n>1e6)throw new Error("Choose an explicit positive --max-spend or save a positive Model budget before starting.");let o=await d.prepareRun({schemaVersion:"openpond.trainingPreparationRequest.v1",teamId:c,operationId:s(e,"operationId")||$(),projectId:s(e,"projectId")||null,configuration:{id:r.id,expectedRevision:r.revision,expectedEtag:r.etag},batch:y(w),name:s(e,"name")||r.name,maximumSpendUsd:n,...p?{gpuSelection:p}:{}});if(l(e.json)||console.log(`Retained preparation: ${o.plan.id}`),l(e.json)||(console.log(`Prepared run: ${o.plan.id}; approved maximum $${n}.`),console.log(`Model: ${r.name}@${o.plan.source.modelProject.revision}; batch: ${o.plan.request.batch.id}@${o.plan.request.batch.revision}.`),console.log(`GPU choice: ${p?.mode==="manual"?`${p.gpuType} / ${p.availabilityId}`:`Automatic (${p?.objective??r.trainingSetup.managedGpuPlacementObjective})`}; count ${p?.gpuCount??1}.`)),!m){let a=h({input:process.stdin,output:process.stdout});try{let u=await a.question(`Start this exact prepared run with a $${n} maximum? [y/N] `);if(!["y","yes"].includes(u.trim().toLowerCase()))throw new Error(`Training was not started. Preparation ${o.plan.id} is retained for review or cancellation.`)}finally{a.close()}}return{preparation:await d.startPreparation(o.plan.id,{teamId:c,planHash:o.plan.contentHash,expectedRevision:o.revision})}}g(E,"startHostedModel");export{E as startHostedModel,x as trainingGpuChoice};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d,e}from"./chunk-6C3CXME7.js";import"./chunk-MCBRB5D6.js";import"./chunk-4N4EH3RJ.js";import"./chunk-ULJZ7NUF.js";import"./chunk-WJSJXK2N.js";import"./chunk-JCLTFDVW.js";import"./chunk-6FA3GG5B.js";import"./chunk-SH7POUVX.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import"./chunk-UGOK7VTC.js";import"./chunk-FTQLQJQV.js";export{a as createHostedWebSearchExecutor,b as createWebSearchExecutorFromEnv,d as normalizeSearchApiUrl,e as normalizeWebSearchRequest,c as resolveWebSearchEndpoint};
|