openpond 0.2.70 → 0.2.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app-server.js +1 -1
- package/dist/chunks/{acp-QTA6IU6W.js → acp-7A2UPCG5.js} +1 -1
- package/dist/chunks/{acp-agent-N77HPAYQ.js → acp-agent-AGALGR6V.js} +1 -1
- package/dist/chunks/{actions-command-BZQCUDMD.js → actions-command-AXGXBU75.js} +1 -1
- package/dist/chunks/{app-layer-YQQNLIXA.js → app-layer-DUCNCJ2X.js} +1 -1
- package/dist/chunks/{app-server-evaluations-RRLYWLPK.js → app-server-evaluations-SNWXULKD.js} +1 -1
- package/dist/chunks/{app-server-harness-services-XXM336NU.js → app-server-harness-services-YNMGMKPK.js} +1 -1
- package/dist/chunks/app-server-runtime-BKJ7L6JZ.js +2 -0
- package/dist/chunks/{apps-WG7WY5CB.js → apps-2OWE23BH.js} +1 -1
- package/dist/chunks/{chunk-ZDEIVUUI.js → chunk-27OJ2OLP.js} +1 -1
- package/dist/chunks/{chunk-NSSZ2ZIU.js → chunk-2EAZB2MW.js} +1 -1
- package/dist/chunks/{chunk-DRLP7GIU.js → chunk-2GEZ3ZY7.js} +1 -1
- package/dist/chunks/{chunk-PAYFJHPO.js → chunk-2PVW2XFF.js} +1 -1
- package/dist/chunks/chunk-2Q2AWPP2.js +2 -0
- package/dist/chunks/{chunk-Y2WNZWT2.js → chunk-2Q6FTL4C.js} +1 -1
- package/dist/chunks/{chunk-KP2MYTP5.js → chunk-2QHB5P2K.js} +1 -1
- package/dist/chunks/{chunk-HG2YFMVU.js → chunk-2THZ6GZY.js} +1 -1
- package/dist/chunks/{chunk-DXJC3QW7.js → chunk-3VT2PPKW.js} +1 -1
- package/dist/chunks/{chunk-4BUM6JEC.js → chunk-4JKWCLTQ.js} +1 -1
- package/dist/chunks/{chunk-AQUZCWM3.js → chunk-5TPJ5ECJ.js} +1 -1
- package/dist/chunks/{chunk-RCQYEHHD.js → chunk-5TTQCT3G.js} +1 -1
- package/dist/chunks/{chunk-NMMHXYDJ.js → chunk-5WFKBZCU.js} +1 -1
- package/dist/chunks/{chunk-P4QM63L3.js → chunk-5ZBDHIIE.js} +1 -1
- package/dist/chunks/{chunk-WD4KAKEX.js → chunk-64EDQ7UV.js} +1 -1
- package/dist/chunks/{chunk-KU4TPDPH.js → chunk-6LAGMWJE.js} +1 -1
- package/dist/chunks/{chunk-VJYOKU3C.js → chunk-6OD2FKUS.js} +1 -1
- package/dist/chunks/{chunk-65FJWWXG.js → chunk-6YR5IYHH.js} +1 -1
- package/dist/chunks/{chunk-AUO5DCEU.js → chunk-73COPJ32.js} +1 -1
- package/dist/chunks/{chunk-SSHE6B7Z.js → chunk-AITV76GO.js} +1 -1
- package/dist/chunks/{chunk-PLROXHG2.js → chunk-ATI52WMB.js} +1 -1
- package/dist/chunks/chunk-AWD72O3G.js +2 -0
- package/dist/chunks/{chunk-DKOVZ6R2.js → chunk-BQNU4HZW.js} +1 -1
- package/dist/chunks/{chunk-UANH7U3Y.js → chunk-BTEBZYK3.js} +1 -1
- package/dist/chunks/{chunk-3Z4VM2LF.js → chunk-BUMCJHQP.js} +1 -1
- package/dist/chunks/{chunk-BU6MW65V.js → chunk-BYVE4TMU.js} +1 -1
- package/dist/chunks/{chunk-PNPV2LDE.js → chunk-BZS2PA4O.js} +1 -1
- package/dist/chunks/{chunk-AFYYIJ6K.js → chunk-C7NQPICU.js} +1 -1
- package/dist/chunks/{chunk-EWH64WRR.js → chunk-CAYKEJJY.js} +1 -1
- package/dist/chunks/{chunk-K7KBFM2T.js → chunk-CBD554GZ.js} +1 -1
- package/dist/chunks/{chunk-7RJOCGQ6.js → chunk-CHRED2FK.js} +1 -1
- package/dist/chunks/{chunk-3A2Y7UK3.js → chunk-CQRA5TXF.js} +1 -1
- package/dist/chunks/{chunk-GYYJ47GX.js → chunk-CWE2N3JI.js} +1 -1
- package/dist/chunks/{chunk-ZYLLPRPU.js → chunk-CX4T7I47.js} +1 -1
- package/dist/chunks/{chunk-TAXCMCYZ.js → chunk-CX4U32VO.js} +4 -4
- package/dist/chunks/{chunk-7TM25J6S.js → chunk-DFSQ5HZ7.js} +2 -2
- package/dist/chunks/{chunk-2PXKSAG6.js → chunk-DLOJG7LP.js} +1 -1
- package/dist/chunks/{chunk-BGMAWETL.js → chunk-DNRC6TPJ.js} +1 -1
- package/dist/chunks/{chunk-5FSPDSAO.js → chunk-DUR32LJG.js} +1 -1
- package/dist/chunks/{chunk-FHDH4OUA.js → chunk-EHMA5XS7.js} +1 -1
- package/dist/chunks/{chunk-Z33RVGP6.js → chunk-ENY24ZBB.js} +1 -1
- package/dist/chunks/{chunk-JVNKSU27.js → chunk-F3IEAU7O.js} +1 -1
- package/dist/chunks/{chunk-M4A7G4S5.js → chunk-FOAM3YZQ.js} +1 -1
- package/dist/chunks/{chunk-VJR2GNRY.js → chunk-FVMTQSVW.js} +1 -1
- package/dist/chunks/{chunk-YI6ME6PU.js → chunk-GG6PM7TB.js} +1 -1
- package/dist/chunks/{chunk-DDOIPTOM.js → chunk-GMA365GI.js} +1 -1
- package/dist/chunks/{chunk-KCLMA2IH.js → chunk-GPGXBKXU.js} +1 -1
- package/dist/chunks/{chunk-JVMSN7LH.js → chunk-GR4MJJCE.js} +1 -1
- package/dist/chunks/{chunk-7OFD6TFD.js → chunk-HA762QYM.js} +1 -1
- package/dist/chunks/{chunk-Q7FBVLLB.js → chunk-HBGTHOOB.js} +1 -1
- package/dist/chunks/{chunk-AFH462DO.js → chunk-HT6ILPD6.js} +1 -1
- package/dist/chunks/{chunk-XYZV3FKD.js → chunk-I6KTJ3GH.js} +1 -1
- package/dist/chunks/{chunk-OUJ63LMU.js → chunk-IA6CTX7A.js} +1 -1
- package/dist/chunks/{chunk-XHACK2KR.js → chunk-IUYGQO2K.js} +1 -1
- package/dist/chunks/{chunk-55YD4UTW.js → chunk-IV2HEX3I.js} +1 -1
- package/dist/chunks/{chunk-MOXIGLN2.js → chunk-JALL5NPH.js} +1 -1
- package/dist/chunks/{chunk-U7X5ZLAL.js → chunk-JCHLDNCX.js} +1 -1
- package/dist/chunks/{chunk-7PKDJHT6.js → chunk-JH4RACOB.js} +1 -1
- package/dist/chunks/{chunk-MIFVX5PK.js → chunk-JSDGOQ5U.js} +1 -1
- package/dist/chunks/{chunk-65WRWLUD.js → chunk-JVEIK4RH.js} +1 -1
- package/dist/chunks/{chunk-PPF6EBTQ.js → chunk-K3WM4NEC.js} +1 -1
- package/dist/chunks/{chunk-CCZ276IA.js → chunk-KOIXRLZZ.js} +1 -1
- package/dist/chunks/{chunk-6C6ZCYTL.js → chunk-KRJZ5CW3.js} +1 -1
- package/dist/chunks/{chunk-CUB6PWAJ.js → chunk-KTQWWCP2.js} +6 -6
- package/dist/chunks/{chunk-Y4E5AAI7.js → chunk-KUEVP7WM.js} +1 -1
- package/dist/chunks/{chunk-U7D6Q744.js → chunk-L5L3H6CI.js} +1 -1
- package/dist/chunks/{chunk-VWWKWYSQ.js → chunk-LHTRQAPZ.js} +1 -1
- package/dist/chunks/{chunk-QLGP2OAQ.js → chunk-MLLMLXKG.js} +1 -1
- package/dist/chunks/{chunk-QUNQM2E3.js → chunk-MPEK4ZNY.js} +1 -1
- package/dist/chunks/{chunk-EGP6DF34.js → chunk-MPXOPL7R.js} +2 -2
- package/dist/chunks/{chunk-PHZZBXDO.js → chunk-MQMMJKOZ.js} +1 -1
- package/dist/chunks/{chunk-B66QCXH2.js → chunk-MWPMYCYB.js} +1 -1
- package/dist/chunks/{chunk-5G7BQAUA.js → chunk-N5FT6PTI.js} +1 -1
- package/dist/chunks/{chunk-SDHG6CKU.js → chunk-NDNSLCPE.js} +1 -1
- package/dist/chunks/{chunk-WCNPGKST.js → chunk-O4YHISU2.js} +1 -1
- package/dist/chunks/{chunk-IO5DZUKL.js → chunk-OI4DAZ4U.js} +1 -1
- package/dist/chunks/{chunk-Q73RKX7I.js → chunk-OIIE5GUK.js} +1 -1
- package/dist/chunks/{chunk-N5EAVX4G.js → chunk-OOKHHOIU.js} +1 -1
- package/dist/chunks/{chunk-7OKZCJHS.js → chunk-OXRN2257.js} +1 -1
- package/dist/chunks/{chunk-HES4VP3D.js → chunk-PYPXP5R3.js} +1 -1
- package/dist/chunks/{chunk-ZK3ET5EP.js → chunk-QKBMXL4D.js} +3 -3
- package/dist/chunks/{chunk-YAA7F5LI.js → chunk-QKGNAYSC.js} +1 -1
- package/dist/chunks/{chunk-KDER7R45.js → chunk-RIFWD5XM.js} +1 -1
- package/dist/chunks/{chunk-WZ35ICTE.js → chunk-RWBP2H4M.js} +1 -1
- package/dist/chunks/{chunk-SO4GMSNP.js → chunk-S5ACNR5Y.js} +1 -1
- package/dist/chunks/{chunk-M4ZHFDRJ.js → chunk-SRK4WX7D.js} +1 -1
- package/dist/chunks/{chunk-XY7HFXLH.js → chunk-SVLVIYH2.js} +1 -1
- package/dist/chunks/{chunk-FNGZ4UDZ.js → chunk-T6ML5SCD.js} +1 -1
- package/dist/chunks/{chunk-CO23RRN7.js → chunk-TD5YYA5Z.js} +1 -1
- package/dist/chunks/{chunk-7NCM6GBN.js → chunk-TOWY6Y23.js} +1 -1
- package/dist/chunks/{chunk-OXQ2WFIH.js → chunk-TR5UC5AF.js} +1 -1
- package/dist/chunks/{chunk-JQOVC35K.js → chunk-UCPD526R.js} +1 -1
- package/dist/chunks/{chunk-Y4I6CFZJ.js → chunk-UGDBMRCT.js} +1 -1
- package/dist/chunks/{chunk-E2JB5OCO.js → chunk-UZE3C2SF.js} +1 -1
- package/dist/chunks/{chunk-PACLKDTN.js → chunk-V4VM2R6D.js} +1 -1
- package/dist/chunks/{chunk-XOPHFUUY.js → chunk-VMBWCIGG.js} +1 -1
- package/dist/chunks/{chunk-CIZI6Z7D.js → chunk-VMW23TIZ.js} +1 -1
- package/dist/chunks/{chunk-4G3GTEVS.js → chunk-VSQPWLAG.js} +1 -1
- package/dist/chunks/{chunk-54755JYM.js → chunk-VXFGSFIE.js} +2 -2
- package/dist/chunks/{chunk-R2FYCJL6.js → chunk-W4JBPYGW.js} +1 -1
- package/dist/chunks/{chunk-JZKTBYNB.js → chunk-WMJEQK4G.js} +1 -1
- package/dist/chunks/{chunk-ESYPMD7Q.js → chunk-X2MJFTLS.js} +1 -1
- package/dist/chunks/{chunk-67U7PAMU.js → chunk-X7ZMUWJO.js} +1 -1
- package/dist/chunks/{chunk-WGQ3FMRF.js → chunk-XKDOPNQ5.js} +1 -1
- package/dist/chunks/{chunk-EYTTZ5H4.js → chunk-XLZMSD5K.js} +1 -1
- package/dist/chunks/{chunk-ZIQJDTQB.js → chunk-XTT3K3TR.js} +1 -1
- package/dist/chunks/{chunk-Q7P34B2O.js → chunk-YFHQRDNQ.js} +1 -1
- package/dist/chunks/{chunk-UGFSAG4U.js → chunk-YG3HITOU.js} +1 -1
- package/dist/chunks/{chunk-DWF3FCY4.js → chunk-Z5R4OSGC.js} +1 -1
- package/dist/chunks/{chunk-JT5YQ52I.js → chunk-Z6HWSTEP.js} +1 -1
- package/dist/chunks/{chunk-4PUOWSDE.js → chunk-ZEOYNUHL.js} +1 -1
- package/dist/chunks/{chunk-4KTGYHCE.js → chunk-ZMRP2A7K.js} +1 -1
- package/dist/chunks/{chunk-OL3L3U36.js → chunk-ZSWATWK2.js} +1 -1
- package/dist/chunks/cli-KXU5DNVV.js +2 -0
- package/dist/chunks/{command-5AXJMFYC.js → command-X35I53H3.js} +3 -3
- package/dist/chunks/{configuration-command-5LUNWPOL.js → configuration-command-VJUK34UQ.js} +1 -1
- package/dist/chunks/{connected-app-executor-DHXZE4X3.js → connected-app-executor-JBFJF2H5.js} +1 -1
- package/dist/chunks/{connected-evidence-NWMPICKJ.js → connected-evidence-CQ533AML.js} +1 -1
- package/dist/chunks/{connected-starting-assets-NRVXIKQ2.js → connected-starting-assets-RL5X6LZ7.js} +1 -1
- package/dist/chunks/{continual-UCKQ2QLH.js → continual-PHGIZFF6.js} +1 -1
- package/dist/chunks/{core-commands-ZPBX35M2.js → core-commands-5DYMDWXY.js} +1 -1
- package/dist/chunks/{dataset-preparation-authoring-UUYFWWCT.js → dataset-preparation-authoring-UDSX33YK.js} +1 -1
- package/dist/chunks/{datasets-6K3ZANIV.js → datasets-BW4JFUUU.js} +1 -1
- package/dist/chunks/{desktop-test-57INNJ76.js → desktop-test-RIG4CB2Z.js} +1 -1
- package/dist/chunks/{dist-2MKJC6HN.js → dist-C5XFRP53.js} +1 -1
- package/dist/chunks/{evaluation-coordination-B7CN4R2D.js → evaluation-coordination-6QJ6XTUX.js} +1 -1
- package/dist/chunks/{experiment-improvements-G357VLDB.js → experiment-improvements-2XF63AQ4.js} +1 -1
- package/dist/chunks/{experiments-BHQO26LJ.js → experiments-3S2BVNK6.js} +1 -1
- package/dist/chunks/{experiments-signal-BI6NKETB.js → experiments-signal-IRBHGGW5.js} +1 -1
- package/dist/chunks/{help-UQN5RUPA.js → help-Q2VMJVTR.js} +1 -1
- package/dist/chunks/host-profile-evaluation-tools-5LZQHA32.js +2 -0
- package/dist/chunks/{host-profile-external-dataset-KSEPXY2S.js → host-profile-external-dataset-C6ZPMTX6.js} +1 -1
- package/dist/chunks/{hosted-app-server-composition-WDDO6F23.js → hosted-app-server-composition-AYZM2HY6.js} +1 -1
- package/dist/chunks/{hosted-experiment-improvement-VVYXQ65K.js → hosted-experiment-improvement-SMZJYRJ7.js} +1 -1
- package/dist/chunks/hosted-harness-runtime-QWIFAITG.js +2 -0
- package/dist/chunks/{hosted-profile-candidate-PTGQLPZO.js → hosted-profile-candidate-WOMWAE5N.js} +1 -1
- package/dist/chunks/{hosted-profile-compiler-FS5R6CHJ.js → hosted-profile-compiler-NZ2BXN32.js} +1 -1
- package/dist/chunks/{hosted-profile-evaluation-control-UUEZEMXU.js → hosted-profile-evaluation-control-3ECFFM7E.js} +1 -1
- package/dist/chunks/{hosted-profile-evaluation-inspection-4F7OEF4T.js → hosted-profile-evaluation-inspection-TM7RKONG.js} +1 -1
- package/dist/chunks/{hosted-profile-evaluation-preparation-LIJJZDHQ.js → hosted-profile-evaluation-preparation-2MZIRT75.js} +1 -1
- package/dist/chunks/{hosted-tasksets-KCLNMPG5.js → hosted-tasksets-IUK3VWSL.js} +1 -1
- package/dist/chunks/{human-review-PX6DBIFT.js → human-review-PG4WWVWV.js} +1 -1
- package/dist/chunks/{import-2HEYPHPW.js → import-FAZAVZBF.js} +1 -1
- package/dist/chunks/{learning-Y3UKNUGE.js → learning-3XDYMYBE.js} +1 -1
- package/dist/chunks/{learning-LSXBL5DB.js → learning-OR4CYV4B.js} +1 -1
- package/dist/chunks/local-harness-improvement-runtime-OYLTKMJU.js +2 -0
- package/dist/chunks/local-harness-taskset-review-I7YU4RZI.js +2 -0
- package/dist/chunks/{model-projects-6YWVD2TS.js → model-projects-POZRHXTF.js} +1 -1
- package/dist/chunks/{opchat-66BCRKEZ.js → opchat-TCZA6373.js} +1 -1
- package/dist/chunks/{opchat-bounded-chat-KQWXZVFN.js → opchat-bounded-chat-GMYDXLWB.js} +1 -1
- package/dist/chunks/{organizations-IOYWDOCC.js → organizations-PYKGA2P2.js} +1 -1
- package/dist/chunks/{profile-YH6G3ZTD.js → profile-GYYI555I.js} +1 -1
- package/dist/chunks/project-action-payload-FE6M2OXJ.js +2 -0
- package/dist/chunks/{project-agent-RYVMKW2F.js → project-agent-4ISJFMJD.js} +1 -1
- package/dist/chunks/{published-experiment-source-SDXUVPE7.js → published-experiment-source-E2YAJCLM.js} +1 -1
- package/dist/chunks/{refiner-profile-service-56VYLZQJ.js → refiner-profile-service-LKGXD5WJ.js} +1 -1
- package/dist/chunks/{runtime-ISLJIGWC.js → runtime-UDLOZD4Y.js} +2 -2
- package/dist/chunks/{sandbox-command-DI45NRTV.js → sandbox-command-4J6DAY7T.js} +1 -1
- package/dist/chunks/{sandbox-template-T42MDUSR.js → sandbox-template-TSXWJMWG.js} +1 -1
- package/dist/chunks/saved-work-QTEBKVUB.js +2 -0
- package/dist/chunks/{send-turn-YLY3YNEQ.js → send-turn-4MH4WMLW.js} +1 -1
- package/dist/chunks/{setup-D6TY2GWV.js → setup-IVT2FQSE.js} +1 -1
- package/dist/chunks/{src-7RN7BF4W.js → src-DC7N2H7A.js} +111 -113
- package/dist/chunks/{src-LF5X4RNQ.js → src-TOSQX36I.js} +1 -1
- package/dist/chunks/{standalone-experiment-turn-owner-TW5MTWIO.js → standalone-experiment-turn-owner-UYPA6XHW.js} +1 -1
- package/dist/chunks/{store-chat-resources-IRHBW2EC.js → store-chat-resources-QLXKKYYC.js} +1 -1
- package/dist/chunks/{store-continual-support-reviews-3KK42L4I.js → store-continual-support-reviews-4F2BOG3H.js} +1 -1
- package/dist/chunks/{store-conversation-serving-IVURK52V.js → store-conversation-serving-EUD47W6X.js} +1 -1
- package/dist/chunks/{store-create-improve-UTCLBXF2.js → store-create-improve-QUOTNNIM.js} +1 -1
- package/dist/chunks/{store-datasets-4AQOVAQY.js → store-datasets-ZUC7CNVO.js} +1 -1
- package/dist/chunks/{store-evaluation-results-PK2P3IMH.js → store-evaluation-results-LHHPHESK.js} +1 -1
- package/dist/chunks/{store-harness-workspaces-YEXB4IRV.js → store-harness-workspaces-TKX5PZWP.js} +1 -1
- package/dist/chunks/{store-human-review-O4BVHP25.js → store-human-review-7WZWRJ6X.js} +1 -1
- package/dist/chunks/{store-learned-preference-migration-validation-44SVX6YB.js → store-learned-preference-migration-validation-MVNKBR4X.js} +1 -1
- package/dist/chunks/{store-learning-SIUQIY5C.js → store-learning-WLUW2PWE.js} +1 -1
- package/dist/chunks/{store-learning-credentials-BUHR7SN6.js → store-learning-credentials-FDKCEDHK.js} +1 -1
- package/dist/chunks/{store-local-experiments-BHVTKPPE.js → store-local-experiments-HB53QFLL.js} +1 -1
- package/dist/chunks/{store-model-batch-review-RVAYUVK2.js → store-model-batch-review-O3I6GIAA.js} +1 -1
- package/dist/chunks/{store-model-configuration-AYFGMC5D.js → store-model-configuration-CDIGNU6Q.js} +1 -1
- package/dist/chunks/{store-model-project-preparation-5DEIS7TB.js → store-model-project-preparation-QMQ2HMJV.js} +1 -1
- package/dist/chunks/{store-modification-recordings-LCPK6K2T.js → store-modification-recordings-W4VEZKKQ.js} +1 -1
- package/dist/chunks/{store-preference-comparison-5YVIQNVB.js → store-preference-comparison-JKURBESE.js} +1 -1
- package/dist/chunks/{store-sidebar-file-bookmarks-WLMYDA4E.js → store-sidebar-file-bookmarks-KAEDHVVF.js} +1 -1
- package/dist/chunks/{store-sidebar-preferences-AFMYIDWT.js → store-sidebar-preferences-QPBLTHY6.js} +1 -1
- package/dist/chunks/{store-subagents-KFPVSTRO.js → store-subagents-ZELQP3MX.js} +1 -1
- package/dist/chunks/{store-task-inbox-L6IQTY26.js → store-task-inbox-4ZDQR2E7.js} +1 -1
- package/dist/chunks/{store-task-inventory-QWS2C656.js → store-task-inventory-CTIJDLYE.js} +1 -1
- package/dist/chunks/{store-taskset-drafts-EAOOY6CR.js → store-taskset-drafts-FRPBYLTW.js} +1 -1
- package/dist/chunks/{store-training-FYXZU2FE.js → store-training-WQAYUT7B.js} +1 -1
- package/dist/chunks/{store-training-jobs-3N3VKPIY.js → store-training-jobs-O5EHGTH7.js} +1 -1
- package/dist/chunks/{store-training-models-VOFVGPZR.js → store-training-models-YSZMC66T.js} +1 -1
- package/dist/chunks/{taskset-HNDIGYQG.js → taskset-OVYM4QMS.js} +1 -1
- package/dist/chunks/{taskset-packages-WMG5DUBN.js → taskset-packages-FUQWNTSB.js} +1 -1
- package/dist/chunks/{taskset-packages-T6B6HYKZ.js → taskset-packages-GM6IUOTY.js} +1 -1
- package/dist/chunks/{teams-bot-Z5CZLWE4.js → teams-bot-U2M3ORWR.js} +1 -1
- package/dist/chunks/{tool-learning-ZQ6NSJ5K.js → tool-learning-NXVR4YPA.js} +1 -1
- package/dist/chunks/{training-JTYQA7GA.js → training-EQ7G5FDY.js} +1 -1
- package/dist/chunks/training-LQUAL4Y4.js +2 -0
- package/dist/chunks/training-PEZYJ2SN.js +2 -0
- package/dist/chunks/{training-hosted-36SZFS4U.js → training-hosted-XKSUTMLQ.js} +1 -1
- package/dist/chunks/{training-hosted-alphaedit-HSMRDJTD.js → training-hosted-alphaedit-VCOEYLKK.js} +1 -1
- package/dist/chunks/{training-hosted-decision-7JALOU6O.js → training-hosted-decision-IKWWXA56.js} +1 -1
- package/dist/chunks/{training-hosted-engram-SXO75MFG.js → training-hosted-engram-3TOPPVSW.js} +1 -1
- package/dist/chunks/{training-hosted-learning-E2N32YU5.js → training-hosted-learning-UEBGSSNC.js} +1 -1
- package/dist/chunks/{training-hosted-modification-comparison-TXFDJFTG.js → training-hosted-modification-comparison-C6S4JFHW.js} +1 -1
- package/dist/chunks/{training-hosted-neuron-training-J42WK4EH.js → training-hosted-neuron-training-EP2U4PHG.js} +1 -1
- package/dist/chunks/{training-hosted-serving-report-BAEABGJH.js → training-hosted-serving-report-KJMRZJLQ.js} +1 -1
- package/dist/chunks/{training-hosted-steering-T556BUBG.js → training-hosted-steering-I27DV6A2.js} +1 -1
- package/dist/chunks/{training-model-start-P3PXDWNT.js → training-model-start-NWXNGRDC.js} +1 -1
- package/dist/chunks/{workspaces-EK62ANTB.js → workspaces-FVQYJPOS.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/skills/manifest.json +3 -3
- package/dist/skills/openpond-cli/references/experiments-and-training.md +19 -0
- package/dist/web/assets/App-QM6Y2Eod.js +54 -0
- package/dist/web/assets/{AppDialog-x1HU1uLv.js → AppDialog-C8um481a.js} +1 -1
- package/dist/web/assets/{AppTerminalPanel-CNIKmqKc.js → AppTerminalPanel-OwNr-bp6.js} +2 -2
- package/dist/web/assets/{AppToastContext-DNWd43HS.js → AppToastContext-BQ4iRFif.js} +1 -1
- package/dist/web/assets/{AppsView-BvOD83Z1.js → AppsView-mk8m_Cra.js} +1 -1
- package/dist/web/assets/{AttachmentTypeIcon-BLdDr3JZ.js → AttachmentTypeIcon-SITPqTtF.js} +1 -1
- package/dist/web/assets/{BrowserSidebar-Ar0FlFKg.js → BrowserSidebar-BghdIKTB.js} +1 -1
- package/dist/web/assets/{CartesianChart-tS7f1HZv.js → CartesianChart-BdRx7q_O.js} +1 -1
- package/dist/web/assets/{ChatTimelineEntry-z7_kur3h.js → ChatTimelineEntry-BBOnAzJB.js} +1 -1
- package/dist/web/assets/{CollaborationTabs-CaiFEKrv.js → CollaborationTabs-Beja-9s5.js} +1 -1
- package/dist/web/assets/{CommandMenu-BpubEqaA.js → CommandMenu-CQtrSUpu.js} +1 -1
- package/dist/web/assets/{CommunityView-TGR4s99l.js → CommunityView-LPTAakS-.js} +1 -1
- package/dist/web/assets/{ComposerAttachments-DPWCjKXz.js → ComposerAttachments-DI-Gr7Zw.js} +1 -1
- package/dist/web/assets/{ComposerCreateImproveStrip-Drji01_6.js → ComposerCreateImproveStrip-CY5Uw1yc.js} +1 -1
- package/dist/web/assets/{ConversationImportsSettings-B_oW0cz7.js → ConversationImportsSettings-DFwhKERw.js} +1 -1
- package/dist/web/assets/{DatasetReviewImport-Dr3unJSY.js → DatasetReviewImport-C9xraQk7.js} +1 -1
- package/dist/web/assets/{ExperimentTrainingDataWorkspace-DObvpJAw.js → ExperimentTrainingDataWorkspace-Cx58S6R_.js} +2 -2
- package/dist/web/assets/{FilePagePreview-9kkXbARN.js → FilePagePreview-dlbmR8s8.js} +2 -2
- package/dist/web/assets/{GetStartedView-Dv2b_SlH.js → GetStartedView-BkTV_shK.js} +1 -1
- package/dist/web/assets/{GettingStartedDialog-sPaPMc61.js → GettingStartedDialog-DulDLYnr.js} +1 -1
- package/dist/web/assets/{HostedModelLearningReview-BlwhGxS6.js → HostedModelLearningReview--fXJEOfI.js} +1 -1
- package/dist/web/assets/{HostedModelLearningSettings-B5ahk3je.js → HostedModelLearningSettings-BEb7B_PC.js} +1 -1
- package/dist/web/assets/{HtmlVisual-rGsClq0p.js → HtmlVisual-BS61T2qR.js} +1 -1
- package/dist/web/assets/{LabModelVersionDetailPage-Da7AwZWV.js → LabModelVersionDetailPage-CmzUIDbR.js} +1 -1
- package/dist/web/assets/{LabModelWorkspace-DTeYViWH.js → LabModelWorkspace-DoAnQKWk.js} +1 -1
- package/dist/web/assets/{LabSkillSidebar-BieHbNl6.js → LabSkillSidebar-DJTm7ZQs.js} +1 -1
- package/dist/web/assets/{LabsRoute-D3XqPB0-.js → LabsRoute-DNtBot4a.js} +4 -4
- package/dist/web/assets/{LearningBatchesPage-CCBuf2u4.js → LearningBatchesPage-C_oQjciE.js} +1 -1
- package/dist/web/assets/{MainChatThread-B6BQJfcq.js → MainChatThread-D9e-to8e.js} +2 -2
- package/dist/web/assets/{MainPane-D3fQou29.js → MainPane-mWeD0M-f.js} +6 -6
- package/dist/web/assets/{ModelProjectPageHeader-BZn9Lu_J.js → ModelProjectPageHeader-BecKU_2p.js} +1 -1
- package/dist/web/assets/{NativeSetupTerminal-Bglqab_g.js → NativeSetupTerminal-DO0DN4fH.js} +2 -2
- package/dist/web/assets/{NativeSkillSidebar-pUGRdnV_.js → NativeSkillSidebar-jnxgQASC.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-BpHN38MA.js → NewProjectDialog-ByHR4vMf.js} +1 -1
- package/dist/web/assets/{OutputsPage-LunDCQ6w.js → OutputsPage-DZY4BUCy.js} +1 -1
- package/dist/web/assets/{PageChrome-DThEcWAx.js → PageChrome-DjPuwWsn.js} +1 -1
- package/dist/web/assets/{ProjectsPage-vct_TQgL.js → ProjectsPage-DKbwhIM4.js} +1 -1
- package/dist/web/assets/{RightChatPanelStack-CgFK7DY0.js → RightChatPanelStack-BARH0XuL.js} +1 -1
- package/dist/web/assets/RightSidebarHomePanel-qKL8dZrN.js +1 -0
- package/dist/web/assets/{ScheduledWorkPage-mmaZfybl.js → ScheduledWorkPage-CElrmRz9.js} +1 -1
- package/dist/web/assets/{SettingsView-CJfeRsWR.js → SettingsView-CsFSjE9s.js} +3 -3
- package/dist/web/assets/{TasksetDraftEditorPrimitives-CuimAfkv.js → TasksetDraftEditorPrimitives-DJoYkvWq.js} +1 -1
- package/dist/web/assets/{TeamChatView-BcK0lF1b.js → TeamChatView-D9Y4e98Y.js} +1 -1
- package/dist/web/assets/{TerminalOverlay-0pzEvy-C.js → TerminalOverlay-CUO8yZjy.js} +1 -1
- package/dist/web/assets/{TrainingCreationPanel-CcyzFz7l.js → TrainingCreationPanel-_mnLQ1HA.js} +1 -1
- package/dist/web/assets/{TrainingDraftPanel-DSLZXdLz.js → TrainingDraftPanel-CCqQTHo5.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-BT9pcnCn.js → UsageSettingsSection-CdWq5oYC.js} +1 -1
- package/dist/web/assets/WorkSidebarPanel-DRXaK-E6.js +1 -0
- package/dist/web/assets/{WorkspaceDiffPanel-Bbz5qrVA.js → WorkspaceDiffPanel-CdHr8bX6.js} +3 -3
- package/dist/web/assets/{WorkspaceEnvironmentMenu-6hXpvMTl.js → WorkspaceEnvironmentMenu-BnUh4dg9.js} +1 -1
- package/dist/web/assets/{WorkspaceFileLocation-BijVemBl.js → WorkspaceFileLocation-VzrSq_Ki.js} +1 -1
- package/dist/web/assets/{WorkspaceGitDialogs-BOO0E5i9.js → WorkspaceGitDialogs-nwvQOm9r.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-B_YzK7Do.js → WorkspaceMonacoEditor-m3bCIpZe.js} +3 -3
- package/dist/web/assets/{WorkspacePdfPreview-CFti1fvu.js → WorkspacePdfPreview-u6Iv0qr0.js} +2 -2
- package/dist/web/assets/{WorkspacePresentationPreview-DPAhNaV6.js → WorkspacePresentationPreview-CjvTjhUO.js} +1 -1
- package/dist/web/assets/{bot-BE2rL_qv.js → bot-DiDSZBLn.js} +1 -1
- package/dist/web/assets/{chat-resources-Beh5lB36.js → chat-resources-CmBtWC5V.js} +1 -1
- package/dist/web/assets/chevron-down-CqxKXYPf.js +1 -0
- package/dist/web/assets/chevron-right-ClP6ukIq.js +1 -0
- package/dist/web/assets/chevron-up-DY7wpdJ1.js +1 -0
- package/dist/web/assets/{chunk-C3TS766N-j1MK0e3c.js → chunk-C3TS766N-DSA4vs-Y.js} +1 -1
- package/dist/web/assets/{client-BnJhN-14.js → client-_uDCFdg5.js} +1 -1
- package/dist/web/assets/{client-choice-storage-CQ0CNkzG.js → client-choice-storage-CRKZpilL.js} +1 -1
- package/dist/web/assets/{cloud-upload-DFjZE4O4.js → cloud-upload-CWamjPts.js} +1 -1
- package/dist/web/assets/{copy-CGrLUtw5.js → copy-B56YjDkW.js} +1 -1
- package/dist/web/assets/{cssMode-DvRw2fUx.js → cssMode-BuC9qQvo.js} +1 -1
- package/dist/web/assets/{external-link-3ZnEFUXd.js → external-link-BSn21e-y.js} +1 -1
- package/dist/web/assets/{folder-open-i9n8450i.js → folder-open-CaJGWSr2.js} +1 -1
- package/dist/web/assets/{folder-plus-cu8Md_ej.js → folder-plus-eTUep-az.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-CwckmC09.js → git-commit-horizontal-Buk_hy6T.js} +1 -1
- package/dist/web/assets/{htmlMode-8VF4Ovtw.js → htmlMode-D7kF2kDL.js} +1 -1
- package/dist/web/assets/{icons-4yRSxBZj.js → icons-B4B5eUyR.js} +1 -1
- package/dist/web/assets/{image-D-umhyyK.js → image--4h1aK2l.js} +1 -1
- package/dist/web/assets/{index-DiVhx1GM.js → index-CCaTs7xt.js} +2 -2
- package/dist/web/assets/{info-Dq2RsPDJ.js → info-DjMTH4sJ.js} +1 -1
- package/dist/web/assets/{jsonMode-CvCYQHkB.js → jsonMode-BVX_7KjE.js} +1 -1
- package/dist/web/assets/loader-circle-DNHvEoaP.js +1 -0
- package/dist/web/assets/{lspLanguageFeatures-CjufNNFF.js → lspLanguageFeatures-RBOb-3wX.js} +1 -1
- package/dist/web/assets/{maximize-2-CKY8dua6.js → maximize-2-Cjg-f1xT.js} +1 -1
- package/dist/web/assets/{message-square-CVDgKlKX.js → message-square-oIMQDMc3.js} +1 -1
- package/dist/web/assets/{monaco.contribution-BYAgjZbj.js → monaco.contribution-CIbGU5-C.js} +2 -2
- package/dist/web/assets/{monaco.contribution-PjJ1258q.js → monaco.contribution-CIwt2mTE.js} +2 -2
- package/dist/web/assets/{monaco.contribution-BYY3-y9l.js → monaco.contribution-Dd1cPdSS.js} +2 -2
- package/dist/web/assets/{monaco.contribution-Bh0CKj9i.js → monaco.contribution-KRLNg324.js} +2 -2
- package/dist/web/assets/{monitor-UYe42gew.js → monitor-BWaitd6I.js} +1 -1
- package/dist/web/assets/{paperclip-DrlSVUoz.js → paperclip-FYK6OySO.js} +1 -1
- package/dist/web/assets/{pdf-BMhday2W.js → pdf-DbwlsqZP.js} +1 -1
- package/dist/web/assets/play-DieChKfF.js +1 -0
- package/dist/web/assets/plus-DkfcQyma.js +1 -0
- package/dist/web/assets/{presentation-DcZKqH7w.js → presentation-B6MaAPC7.js} +1 -1
- package/dist/web/assets/{python-CiA01i07.js → python-DRYJxjiM.js} +1 -1
- package/dist/web/assets/{refresh-cw-00D-GDnF.js → refresh-cw-DOVpqCfJ.js} +1 -1
- package/dist/web/assets/{save-CXe7bqR7.js → save-BuyyyR4Q.js} +1 -1
- package/dist/web/assets/{settings-lists-B5J40WM6.js → settings-lists-BeAdxSjx.js} +1 -1
- package/dist/web/assets/square-D0YnIVh6.js +1 -0
- package/dist/web/assets/{square-terminal-DxC7TTds.js → square-terminal-DTOIZy6_.js} +1 -1
- package/dist/web/assets/{submit-issue-command-Dq3TqJLV.js → submit-issue-command-V--K9lVQ.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-BH3Jckfo.js → toggleHighContrast-nNzCoE0h.js} +1 -1
- package/dist/web/assets/training-DZgfVcI-.js +1 -0
- package/dist/web/assets/{training-model-data-B6IZ3x-t.js → training-model-data-CWoTokkb.js} +1 -1
- package/dist/web/assets/{tsMode-DXkj4bqC.js → tsMode-BfVi5_FZ.js} +1 -1
- package/dist/web/assets/{upload-B3KRHVHl.js → upload-C2MnlWjj.js} +1 -1
- package/dist/web/assets/{useAccountSettings-BGRkTRrp.js → useAccountSettings-QwRbZIKu.js} +1 -1
- package/dist/web/assets/{useAgentInventory-D_1AlAZJ.js → useAgentInventory-B7xEgMCA.js} +1 -1
- package/dist/web/assets/{useChatContextSelection-hoMSuUSE.js → useChatContextSelection-O6wo4EqD.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules-DxTER7Ow.js → useLocalAgentSchedules-DpHnOGoV.js} +1 -1
- package/dist/web/assets/{useQuery-DkPec_9x.js → useQuery-CvZ8bzdW.js} +1 -1
- package/dist/web/assets/{wifi-off-CMzpvbWl.js → wifi-off-B8d12Alh.js} +1 -1
- package/dist/web/assets/{workers-ziY_bTv2.js → workers-sIVKxb8c.js} +1 -1
- package/dist/web/assets/x-BvVvVB-j.js +1 -0
- package/dist/web/assets/{yaml-mSvqVSko.js → yaml-8-aLM3zj.js} +1 -1
- package/dist/web/index.html +1 -1
- package/docs/command-reference.md +1 -0
- package/package.json +1 -1
- package/dist/chunks/app-server-runtime-B7AMBGQZ.js +0 -2
- package/dist/chunks/chunk-6D3FI2XT.js +0 -2
- package/dist/chunks/chunk-VEBW7NKD.js +0 -2
- package/dist/chunks/cli-ALEEFAJ7.js +0 -2
- package/dist/chunks/host-profile-evaluation-tools-UF4ATIUF.js +0 -2
- package/dist/chunks/hosted-harness-runtime-MMTLCL23.js +0 -2
- package/dist/chunks/local-harness-improvement-runtime-3YJQRYXC.js +0 -2
- package/dist/chunks/local-harness-taskset-review-E5GN5LTR.js +0 -2
- package/dist/chunks/project-action-payload-53OH6WDH.js +0 -2
- package/dist/chunks/saved-work-54I5ZJTC.js +0 -2
- package/dist/chunks/training-5NT2YB2L.js +0 -2
- package/dist/chunks/training-UY6KRG4M.js +0 -2
- package/dist/web/assets/App-CXhxya9x.js +0 -54
- package/dist/web/assets/RightSidebarHomePanel-BJmzUcmy.js +0 -1
- package/dist/web/assets/WorkSidebarPanel-CP-nHAsJ.js +0 -1
- package/dist/web/assets/chevron-down-Bn8yph2O.js +0 -1
- package/dist/web/assets/chevron-right-BU-jUmb2.js +0 -1
- package/dist/web/assets/chevron-up-DacwuDJZ.js +0 -1
- package/dist/web/assets/loader-circle-DBl6qqtR.js +0 -1
- package/dist/web/assets/play-DIqZnaNf.js +0 -1
- package/dist/web/assets/plus-CFNxAPMK.js +0 -1
- package/dist/web/assets/square-DJEaBefe.js +0 -1
- package/dist/web/assets/training-DWfghwfZ.js +0 -1
- package/dist/web/assets/x-omjwMPbJ.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{b as Ne}from"./chunk-SYUKES6H.js";import{a as B,b as G,c as ze,d as Le,e as q,f as ie,i as de,o as Be,q as ce}from"./chunk-U7X5ZLAL.js";import{a as ue}from"./chunk-2ACX7IW5.js";import{k as ae,m as se,n as Pe}from"./chunk-OQPJ7FJF.js";import{c as Te}from"./chunk-Y4I6CFZJ.js";import{E as L}from"./chunk-WGQ3FMRF.js";import{f as K,m as f,n as _e}from"./chunk-HIQPGYVH.js";import{a as Ce}from"./chunk-HLJJAOI2.js";import{a as Oe,c as $e,d as je}from"./chunk-AMC4Z7G4.js";import{l as J,m as qe}from"./chunk-I6VMRQF4.js";import{h as Ue}from"./chunk-4PUOWSDE.js";import{Sa as Ae,ea as Ee,wb as ke}from"./chunk-ZY32SZ2P.js";import{a as re,b as oe}from"./chunk-KUE46HTH.js";import{b as z}from"./chunk-MZKCW6CB.js";import{A as a}from"./chunk-X2J2P5ZT.js";import{a as d}from"./chunk-FTQLQJQV.js";function jt(t,e){let n=t.token?.trim();if(!n||t.accountState.state!=="signed_in"||!t.accountState.activeProfile)throw new Error("A signed-in OpenPond account is required.");let r=Ce(t.apiBaseUrl,{apiBaseUrl:t.apiBaseUrl}),o=/\/api\/sandboxes\/?$/.test(r)?r.replace(/\/api\/sandboxes\/?$/,"/v1"):r.replace(/\/sandboxes\/?$/,"");return{audience:new URL(o).origin,async request(s){let i=n.startsWith("opk_"),u=await z(o,n,s.path,{method:s.method??"GET",signal:s.signal,explicitBearerAuth:!i,headers:{...i?{"openpond-api-key":n}:{},...s.idempotencyKey?{"idempotency-key":s.idempotencyKey}:{},...e?{"X-OpenPond-Team-Id":e}:{}},...s.body?{body:JSON.stringify(s.body)}:{},...s.timeoutMs!==void 0?{timeoutMs:s.timeoutMs}:{}}),c=await u.json().catch(()=>({}));if(!u.ok)throw new Error(typeof c.error=="string"?c.error:`OpenPond API request failed with status ${u.status}`);return c}}}d(jt,"createCapturedOpenPondPublicApiClient");import{AsyncLocalStorage as _t}from"node:async_hooks";var Tt=new _t;function zt(){return Tt.getStore()}d(zt,"apiClientIdentity");var Lt=3e4,Bt=8*1024*1024,Gn={timeoutMs:900*1e3,maxResponseBytes:64*1024*1024},Fe=class extends Error{static{d(this,"ApiTimeoutError")}timeoutMs;requestUrl;code="OPENPOND_API_TIMEOUT";constructor(t,e){super(`API request timed out after ${t}ms: ${e}`),this.timeoutMs=t,this.requestUrl=e,this.name="ApiTimeoutError"}},pe=class extends Error{static{d(this,"ApiResponseTooLargeError")}maximumBytes;requestUrl;code="OPENPOND_API_RESPONSE_TOO_LARGE";constructor(t,e){super(`API response exceeded ${t} bytes: ${e}`),this.maximumBytes=t,this.requestUrl=e,this.name="ApiResponseTooLargeError"}},He=class extends Error{static{d(this,"OpenPondApiError")}status;apiMessage;code;constructor(t,e,n,r=null){let o=r||e;super(`${n} failed: ${t}${o?` ${o}`:""}`),this.status=t,this.apiMessage=r,this.name="OpenPondApiError",this.code=e||"OPENPOND_API_ERROR"}};async function W(t,e,n,r={}){let{timeoutMs:o=Lt,maxResponseBytes:s=Bt,explicitBearerAuth:i=!1,...u}=r,c=`${t}${n}`,p=new Headers(u.headers),I=zt();I&&!i&&p.set("x-openpond-client",I),p.set("Content-Type","application/json");let l=i?void 0:process.env.OPENPOND_API_KEY,g=e?.trim()||"",P=!i&&g.startsWith("opk_"),te=l||(P?g:null);te&&!p.has("openpond-api-key")&&p.set("openpond-api-key",te),e?p.set("Authorization",P?`ApiKey ${g}`:`Bearer ${e}`):l&&!p.has("Authorization")&&p.set("Authorization",`ApiKey ${l}`);let U=new AbortController,j=new Fe(o,c),T=o>0?setTimeout(()=>U.abort(j),o):null;T?.unref?.();let ne=Ft(u.signal,U.signal,o),A=d(()=>{T&&clearTimeout(T)},"cleanup");try{let R=await fetch(c,{...u,headers:p,signal:ne});return Nt(R,{cleanup:A,maximumBytes:s,requestUrl:c,timeoutController:U,timeoutError:j})}catch(R){throw A(),U.signal.aborted?j:R}}d(W,"apiFetch");async function me(t,e){let n;try{let r=await t.text();n=r?JSON.parse(r):{}}catch(r){if(r instanceof Fe||r instanceof pe)throw r;n={}}if(!t.ok){let r=typeof n.error=="string"?n.error:null,o=typeof n.message=="string"?n.message:null;throw new He(t.status,r,e,o)}return n}d(me,"readApiJson");function Nt(t,e){if(!t.body)return e.cleanup(),t;let n=Number(t.headers.get("content-length"));if(e.maximumBytes>0&&Number.isFinite(n)&&n>e.maximumBytes)throw e.cleanup(),t.body.cancel(),new pe(e.maximumBytes,e.requestUrl);let r=t.body.getReader(),o=0,s=new ReadableStream({async pull(i){try{let u=await r.read();if(u.done){e.cleanup(),i.close();return}if(o+=u.value.byteLength,e.maximumBytes>0&&o>e.maximumBytes){e.cleanup(),await r.cancel(),i.error(new pe(e.maximumBytes,e.requestUrl));return}i.enqueue(u.value)}catch(u){e.cleanup(),i.error(e.timeoutController.signal.aborted?e.timeoutError:u)}},async cancel(i){e.cleanup(),await r.cancel(i)}});return new Response(s,{headers:t.headers,status:t.status,statusText:t.statusText})}d(Nt,"boundedResponse");function Ft(t,e,n){return n<=0?t??void 0:t?AbortSignal.any([t,e]):e}d(Ft,"composedSignal");var C=a.string().min(1).max(200),_=a.string().regex(/^[a-f0-9]{64}$/),le=a.object({operationId:C,name:a.string().trim().min(1).max(500),projectId:C,dataset:K.extend({revision:a.number().int().positive()}).strict(),caseIds:a.array(C).min(1).max(1e4)}).strict().superRefine((t,e)=>{new Set(t.caseIds).size!==t.caseIds.length&&e.addIssue({code:"custom",message:"Select each case once."})}),Ht=B.extend({inputHash:_,outputHash:_.nullable(),task:Ee,taskHash:_}).strict(),Mt=a.object({schemaVersion:a.literal("openpond.connectedRecordedExecution.v1"),id:C,teamId:C,ownerUserId:C,request:le,manifest:ke,sources:a.array(Ht).min(1).max(1e4),contentHash:_}).strict();function Me(t){let e=Mt.parse(t),{contentHash:n,...r}=e,{contentHash:o,...s}=e.manifest;if(f(r)!==n||f(s)!==o||e.manifest.teamId!==e.teamId||e.manifest.id!==e.id||e.manifest.operationId!==e.request.operationId||f(e.manifest.dataset)!==f(e.request.dataset)||e.sources.length!==e.request.caseIds.length||e.sources.length!==e.manifest.population.length||e.sources.some((i,u)=>i.taskHash!==f(i.task)||i.task.id!==e.request.caseIds[u]||i.boundaryId!==i.task.id||e.manifest.population[u]?.caseId!==i.boundaryId))throw new Error("Recorded execution identity or population integrity failed.");return e}d(Me,"verifyConnectedRecordedExecution");var Dt=a.object({projectId:C.optional(),cursor:C.optional(),limit:a.number().int().min(1).max(50).default(20)}).strict(),Jt=a.object({id:C,teamId:C,ownerUserId:C,projectId:C,name:a.string().min(1).max(500),dataset:le.shape.dataset,manifestHash:_,contentHash:_,caseCount:a.number().int().min(1).max(1e4),createdAt:a.string().datetime()}).strict(),Kt=a.object({teamId:C,items:a.array(Jt).max(50),nextCursor:C.nullable()}).strict(),Gt=a.object({datasetId:a.string().trim().min(1).max(240),expectedRevision:a.number().int().positive(),operationId:a.string().trim().min(1).max(240),graders:a.array(Ae).min(1).max(100).optional()}).strict().superRefine((t,e)=>{t.graders&&new Set(t.graders.map(n=>n.id)).size!==t.graders.length&&e.addIssue({code:"custom",path:["graders"],message:"Choose one exact revision of each grader."})}),N=a.string().min(1).max(500),k=a.number().int().nonnegative(),Wt=a.object({teamId:N,ownerUserId:N,projectId:N.nullable(),status:a.enum(["active","paused","archived"]),revision:k,state:a.enum(["collecting","pending","attention","paused","archived"]),lastReconciledAt:a.string().datetime().nullable(),lastCapturedAt:a.string().datetime().nullable(),historyDays:a.number().int().positive(),sources:k,tasks:k,datasets:a.array(a.object({datasetId:N,projection:a.enum(["turn","conversation"]),revision:k}).strict()).max(2),latestBatch:a.object({operationId:N,updatedAt:a.string().datetime(),scanned:k,captured:k,unchanged:k,pending:k,failed:k,excluded:k,paused:k,hasMore:a.boolean()}).strict().nullable()}).strict(),h=a.string().min(1).max(500),E=a.string().regex(/^[a-f0-9]{64}$/),De=a.object({teamId:h,projectId:h.nullable(),status:a.enum(["active","paused","archived"]),revision:a.number().int().nonnegative()}).strict(),Xt=a.object({teamId:h,operationId:h,projectId:h.nullable(),outcomes:a.array(a.object({conversationId:h,state:a.enum(["captured","unchanged","pending","paused","excluded","failed"]),sourceId:h.optional(),snapshotHash:E.optional(),reason:a.string().optional()}).strict()).max(50),nextCursor:h.nullable()}).strict(),Vt=a.object({teamId:h,ref:B,origin:G.shape.source,sessionId:h,projectId:h,capturedAt:a.string().datetime(),unmappedEvidence:a.object({count:a.number().int().nonnegative().max(1e5),contentHash:E}).strict(),evidence:a.object({input:a.array(J),observed:a.array(J),answer:a.json(),boundary:qe}).strict()}).strict(),Yt=a.object({teamId:h,sourceId:h,snapshotHash:E,contentHash:E,count:a.number().int().nonnegative(),offset:a.number().int().nonnegative(),events:a.array(J).max(50),nextOffset:a.number().int().nonnegative().nullable()}).strict(),Zt=a.object({teamId:h,source:q.shape.source,sourceHash:E,previewHash:E,destination:q.shape.destination,issues:a.array(a.object({file:a.string(),message:a.string()}).strict()).max(100),sessions:a.array(a.object({sessionHash:E,sessionId:h,origin:G.shape.source,exporterVersion:a.string().nullable(),eventCount:a.number().int().nonnegative(),boundaries:a.array(a.object({id:h,projection:a.enum(["turn","conversation"]),answer:a.boolean(),process:a.enum(["retained","partial","absent"]),terminal:a.enum(["completed","failed","cancelled","unknown"])}).strict()).max(5001),warnings:a.array(a.string()).max(100),sample:a.array(a.object({role:a.enum(["user","assistant","system","tool"]).nullable(),text:a.string().max(4e3)}).strict()).max(3)}).strict()).max(1e3)}).strict(),Je=a.object({teamId:h,operationId:h,requestHash:E,previewHash:E,projectId:h.optional(),state:a.enum(["admitting","publishing","completed","failed"]),outcomes:a.array(a.object({sessionHash:E,sourceId:h,status:a.enum(["imported","already_present"]),datasets:a.array(a.object({datasetId:h,revision:a.number().int().positive(),changed:a.boolean()}).strict()).max(2)}).strict()).max(1e3),error:a.string().optional()}).strict(),Ke=class extends Error{static{d(this,"ConnectedEvidenceError")}constructor(t,e,n){super(n),this.status=t,this.code=e,this.name="ConnectedEvidenceError"}status;code},pr=class{static{d(this,"ConnectedEvidenceClient")}constructor(t){this.options=t;let e=new URL(t.baseUrl);if(!["http:","https:"].includes(e.protocol)||e.username||e.password||e.search||e.hash||!t.apiKey.trim()||!t.teamId.trim())throw new Error("A clean API origin and workspace credentials are required.");this.baseUrl=e.toString().replace(/\/+$/,"")}options;baseUrl;async capture(t,e){let n=ze.parse(t),r=Xt.parse(await this.request("/capture","POST",n,e));if(this.scope(r.teamId),r.operationId!==n.operationId||r.outcomes.length>n.limit||n.conversationId&&r.outcomes.some(o=>o.conversationId!==n.conversationId))throw new Error("Capture receipt differs from its requested source or operation.");return r}async retainStartingAssets(t,e){let n=Be.parse(t),r=ce(await this.request("/starting-assets","POST",n,e));if(this.scope(r.teamId),r.operationId!==n.operationId||r.requestHash!==f(n)||f(r.source)!==f(n.source)||r.assets.length!==n.proofs.length||r.assets.some((o,s)=>o.path!==n.proofs[s].path))throw new Error("Starting assets differ from the exact source, operation or selected paths.");return r}async startingAssets(t,e){let n=ce(await this.request(`/starting-assets/${encodeURIComponent(h.parse(t))}`,"GET",void 0,e));if(this.scope(n.teamId),n.id!==t)throw new Error("Starting assets identity mismatch.");return n}async list(t={},e){let n=a.object({projectId:h.optional(),cursor:h.optional(),limit:a.number().int().min(1).max(50).default(20)}).strict().parse(t),r=new URLSearchParams(Object.entries(n).filter(([,s])=>s!==void 0).map(([s,i])=>[s,String(i)])),o=a.object({teamId:h,items:a.array(G).max(50),nextCursor:h.nullable()}).strict().parse(await this.request(`?${r}`,"GET",void 0,e));if(this.scope(o.teamId),o.items.length>n.limit||new Set(o.items.map(s=>s.sourceId)).size!==o.items.length||o.nextCursor!==null&&o.nextCursor===n.cursor||n.projectId&&o.items.some(s=>s.projectId!==n.projectId))throw new Error("Connected source page differs from its requested scope.");return o}async read(t,e){let n=B.parse(t),r=Vt.parse(await this.request(`/${encodeURIComponent(n.id)}/cases/${encodeURIComponent(n.boundaryId)}?snapshotHash=${n.snapshotHash}&revisionHash=${n.boundaryRevisionHash}`,"GET",void 0,e));if(this.scope(r.teamId),f(r.ref)!==f(n)||r.evidence.boundary.id!==n.boundaryId||r.evidence.boundary.revisionHash!==n.boundaryRevisionHash||f(r.evidence.input)!==r.evidence.boundary.inputHash||f(r.evidence.observed)!==n.boundaryRevisionHash||r.evidence.boundary.outputHash!==null&&f(r.evidence.answer)!==r.evidence.boundary.outputHash)throw new Error("Connected case readback differs from its exact snapshot or cutoff.");return r}async setCollection(t,e){let n=De.parse(await this.request("/collection","PUT",a.object({paused:a.boolean()}).strict().parse({paused:t}),e));return this.scope(n.teamId),n}async collection(t){let e=De.parse(await this.request("/collection","GET",void 0,t));return this.scope(e.teamId),e}async collectionStatus(t){let e=Wt.parse(await this.request("/collection/status","GET",void 0,t));return this.scope(e.teamId),e}async unmappedEvents(t,e){let n=a.object({id:h,snapshotHash:E,contentHash:E,offset:a.number().int().nonnegative().default(0),limit:a.number().int().min(1).max(50).default(20)}).strict().parse(t),r=Yt.parse(await this.request(`/${encodeURIComponent(n.id)}/unmapped-events?snapshotHash=${n.snapshotHash}&offset=${n.offset}&limit=${n.limit}`,"GET",void 0,e));if(this.scope(r.teamId),r.sourceId!==n.id||r.snapshotHash!==n.snapshotHash||r.contentHash!==n.contentHash||r.offset!==n.offset||r.events.length>n.limit||r.events.some((o,s)=>o.sequence!==n.offset+s)||r.nextOffset!==null&&r.nextOffset!==n.offset+r.events.length)throw new Error("Unmapped source event page differs from its pinned snapshot.");return r}async homeSummary(t,e){let n=a.object({from:a.string().datetime(),to:a.string().datetime(),projectId:h.optional()}).strict(),r=n.parse(t),o=new URLSearchParams(Object.entries(r)),s=a.object({teamId:h,range:n,activity:a.object({conversations:a.number().int().nonnegative(),turns:a.number().int().nonnegative(),chatTurns:a.number().int().nonnegative(),workTurns:a.number().int().nonnegative()}).strict(),accounting:a.object({contextSnapshots:a.number().int().nonnegative()}).strict(),usage:Oe}).strict().parse(await this.request(`/summary?${o}`,"GET",void 0,e));if(this.scope(s.teamId),f(s.range)!==f(r)||s.activity.chatTurns+s.activity.workTurns!==s.activity.turns)throw new Error("Activity summary differs from its requested range.");for(let i of[s.usage.days,s.usage.modes,s.usage.models]){if(new Set(i.map(u=>u.key)).size!==i.length)throw new Error("Duplicate usage summary group.");for(let u of Object.keys(s.usage.total))if(i.reduce((c,p)=>c+p[u],0)!==s.usage.total[u])throw new Error("Usage totals differ from their displayed groups.")}return s}async uploadPart(t,e){let n=Le.parse(t),r=a.object({teamId:h,hash:E,parts:a.number().int(),index:a.number().int()}).strict().parse(await this.request("/imports/upload","POST",n,e));if(this.scope(r.teamId),r.hash!==n.hash||r.parts!==n.parts||r.index!==n.index)throw new Error("Upload receipt differs from its part identity.");return r}async preview(t,e){let n=q.parse(t),r=Zt.parse(await this.request("/imports/preview","POST",n,e));if(this.scope(r.teamId),r.source!==n.source||f(r.destination)!==f(n.destination)||r.sessions.some(o=>o.origin!==n.source)||new Set(r.sessions.map(o=>o.sessionHash)).size!==r.sessions.length)throw new Error("Import preview differs from its source or destination.");return r}async commit(t,e){let n=ie.parse(t),r=Je.parse(await this.request("/imports/commit","POST",n,e));if(this.scope(r.teamId),r.operationId!==n.operationId||r.previewHash!==n.previewHash||r.requestHash!==f(n)||r.outcomes.some(o=>!n.selection.some(s=>s.sessionHash===o.sessionHash))||r.state==="completed"&&r.outcomes.length!==n.selection.length)throw new Error("Import receipt differs from its exact selection or operation.");return r}async readImport(t,e){let n=h.parse(t),r=Je.parse(await this.request(`/imports/${encodeURIComponent(n)}`,"GET",void 0,e));if(this.scope(r.teamId),r.operationId!==n)throw new Error("Import identity mismatch.");return r}async prepareRecorded(t,e){let n=le.parse(t),r=Me(await this.request("/recorded-executions","POST",n,e));if(this.scope(r.teamId),f(r.request)!==f(n))throw new Error("Recorded admission differs from its selected Dataset/cases.");return r}async listRecordedExecutions(t={},e){let n=Dt.parse(t),r=new URLSearchParams(Object.entries(n).filter(([,s])=>s!==void 0).map(([s,i])=>[s,String(i)])),o=Kt.parse(await this.request(`/recorded-executions?${r}`,"GET",void 0,e));if(this.scope(o.teamId),o.items.length>n.limit||o.items.some((s,i)=>s.teamId!==o.teamId||n.projectId&&s.projectId!==n.projectId||n.cursor&&s.id<=n.cursor||i>0&&s.id<=o.items[i-1].id)||o.items.some(s=>s.ownerUserId!==o.items[0]?.ownerUserId)||o.nextCursor!==null&&(n.cursor!==void 0&&o.nextCursor<=n.cursor||o.items.length>0&&o.nextCursor<o.items.at(-1).id))throw new Error("Recorded execution page differs from its requested scope or cursor.");return o}async recordedExecution(t,e){let n=Me(await this.request(`/recorded-executions/${encodeURIComponent(h.parse(t))}`,"GET",void 0,e));if(this.scope(n.teamId),n.id!==t)throw new Error("Recorded execution identity mismatch.");return n}async publishDataset(t,e){let n=Gt.parse(t),r=de.parse(await this.request("/datasets/publish","POST",n,e));this.scope(r.teamId);let o=r.workspace.draft.metadata.connectedPublication;if(r.datasetId!==n.datasetId||!r.publication||!o||typeof o!="object"||!("requestHash"in o)||o.requestHash!==f(n))throw new Error("Published Dataset identity or original selection mismatch.");return r}async createSelection(t,e){let n=a.object({operationId:h.max(240),projectId:h.max(240),name:a.string().trim().min(1).max(200),cases:a.array(B).min(1).max(500)}).strict().parse(t),r=de.parse(await this.request("/datasets/selection","POST",n,e));if(this.scope(r.teamId),r.originProjectId!==n.projectId||r.workspace.draft.tasks.length!==n.cases.length||r.workspace.draft.tasks.some((o,s)=>f(o.input&&typeof o.input=="object"&&!Array.isArray(o.input)?o.input.connectedEvidenceRef:null)!==f(n.cases[s])))throw new Error("Selected Dataset differs from its exact source population.");return r}scope(t){if(t!==this.options.teamId)throw new Error("Connected evidence workspace mismatch.")}async request(t,e,n,r){let{response:o,value:s}=await Te(this.options.fetch??fetch,`${this.baseUrl}/v1/connected-evidence${t}`,{method:e,signal:r,redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"X-OpenPond-Team-Id":this.options.teamId,"Content-Type":"application/json",Accept:"application/json"},...n===void 0?{}:{body:JSON.stringify(n)}},(i,u,c)=>new Ke(i,u,c));if(!o.ok){let i=a.object({code:a.string(),message:a.string()}).safeParse(s);throw new Ke(o.status,i.success?i.data.code:"connected_request_failed",i.success?i.data.message:"Connected evidence request failed.")}return s}},b=a.string().trim().min(1).max(240),hr=a.object({id:b,expectedRevision:a.number().int().positive(),manifest:$e}).strict().refine(t=>t.id===t.manifest.connectionId&&t.expectedRevision===t.manifest.connectionRevision,"Collector coverage scope differs from its connection."),fr=a.object({id:b,cutoff:a.iso.datetime().optional()}).strict(),yr=a.object({schemaVersion:a.literal("openpond.connectedSyncCoverageReceipt.v1"),id:b,teamId:b,ownerUserId:b,connectionId:b,connectionRevision:a.number().int().positive(),receivedAt:a.iso.datetime(),summary:je}).strict(),gr=a.object({id:b,source:q.shape.source,machineId:b,sourceInstanceId:b,sourceLabel:a.string().trim().min(1).max(200),sourceRoot:a.string().min(1).max(2e3),destination:q.shape.destination,since:a.string().datetime().nullable(),keepSyncing:a.boolean(),expectedRevision:a.number().int().nonnegative()}).strict(),br=a.object({id:b,expectedRevision:a.number().int().positive(),action:a.enum(["pause","resume","disconnect"])}).strict(),Ir=a.object({id:b,operationId:b,expectedRevision:a.number().int().positive()}).strict(),Sr=a.object({id:b,expectedRevision:a.number().int().positive(),pendingOperations:a.number().int().min(0).max(1e4),error:a.string().max(500).nullable(),completedSyncRevision:a.number().int().nonnegative().default(0)}).strict(),wr=a.object({teamId:b,id:b,revision:a.number().int().positive(),source:q.shape.source,sourceLabel:a.string(),sourceRoot:a.string(),taskDatasetId:b.nullable(),conversationDatasetId:b.nullable(),machineId:b,sourceInstanceId:b,projectId:b,datasetIds:a.array(b).max(2),since:a.string().datetime().nullable(),keepSyncing:a.boolean(),state:a.enum(["active","paused","disconnected"]),health:a.enum(["online","offline"]),lastHeartbeatAt:a.string().datetime().nullable(),lastAdmissionAt:a.string().datetime().nullable(),pendingOperations:a.number().int().nonnegative(),admittedTasks:a.number().int().nonnegative(),error:a.string().nullable(),requestedSyncRevision:a.number().int().nonnegative().default(0),completedSyncRevision:a.number().int().nonnegative().default(0),syncRequestedAt:a.string().datetime().nullable().default(null),syncCompletedAt:a.string().datetime().nullable().default(null)}).strict().refine(t=>t.completedSyncRevision<=t.requestedSyncRevision&&t.requestedSyncRevision<=t.revision,"Invalid sync acknowledgement generation."),xr=a.object({connectionId:b,expectedRevision:a.number().int().positive(),request:ie}).strict();function Ur(t){let e=d(r=>`/v1/training/candidate-evaluations/${encodeURIComponent(r)}`,"path");function n(r,o,s){let i=tn.parse(r);if(i.teamId!==o||s&&i.id!==s)throw new Error("The preparation belongs to another workspace or candidate operation.");return i}return d(n,"read"),{async options(r,o={}){let s=new URLSearchParams({teamId:r,...o}),i=en.parse(await t(`/v1/training/candidates?${s}`));if(i.teamId!==r)throw new Error("The candidate catalog belongs to another workspace.");return i},async save(r){let o=We.parse(r),s=n(await t(`/v1/training/candidate-evaluations?teamId=${encodeURIComponent(o.teamId)}`,{method:"POST",body:JSON.stringify(o)}),o.teamId);if(s.requestHash!==f(o))throw new Error("The saved preparation differs from the selected candidate or frozen evaluation.");return s},async get(r,o){return n(await t(`${e(o)}?teamId=${encodeURIComponent(r)}`),r,o)},async control(r,o,s,i){let u=nn.parse(i),c=n(await t(`${e(o)}/${s}?teamId=${encodeURIComponent(r)}`,{method:"POST",body:JSON.stringify(u)}),r,o);if(c.requestHash!==u.requestHash)throw new Error("The command returned a different frozen evaluation.");return c}}}d(Ur,"createCandidateEvaluationClient");var S=a.string().trim().min(1).max(200),he=a.string().regex(/^[a-f0-9]{64}$/),Ge=a.object({id:S,contentHash:he}).strict(),Qt=a.object({artifact:Ge,trainingJobId:S,configurationId:S,baseProfileId:S,ready:a.boolean(),reason:a.string().max(1e3).nullable()}).strict(),en=a.object({teamId:S,ownerUserId:S,items:a.array(Qt).max(100),nextCursor:S.nullable()}).strict(),We=a.object({teamId:S,operationId:S,artifact:Ge,configuration:L}).strict().superRefine((t,e)=>{(t.configuration.request.teamId!==t.teamId||t.configuration.request.policy.kind==="fixture"||t.configuration.request.policy.candidate)&&e.addIssue({code:"custom",message:"Choose one exact model-backed evaluation before preparing the trained version."})}),tn=a.object({schemaVersion:a.literal("openpond.candidateEvaluationPreparation.v1"),teamId:S,ownerUserId:S,id:S,revision:a.number().int().positive(),requestHash:he,request:We,trainingJobId:S,dispatchId:S,lastOperationId:S.nullable(),runtime:a.object({poolId:S,endpointId:S.nullable(),baseProfileId:S,workerImageDigest:a.string().regex(/^sha256:[a-f0-9]{64}$/),modelId:S.nullable()}).strict().nullable(),state:a.enum(["configured","preparing","ready","dispatching","submitted","cleaning","completed","failed","cancelled"]),experimentId:S.nullable(),authorizedAt:a.iso.datetime().nullable(),cancelledAt:a.iso.datetime().nullable(),reason:a.string().max(1e3).nullable(),createdAt:a.iso.datetime(),updatedAt:a.iso.datetime()}).strict().superRefine((t,e)=>{(t.requestHash!==f(t.request)||!t.runtime&&["ready","dispatching","submitted","completed"].includes(t.state))&&e.addIssue({code:"custom",message:"The exact candidate preparation request or runtime changed."})}),nn=a.object({operationId:S,expectedRevision:a.number().int().positive(),requestHash:he}).strict();var x=a.string().trim().min(1).max(200),F=a.string().regex(/^[a-f0-9]{64}$/),H=a.string().datetime(),Xe=a.object({operationId:x,id:x.optional(),expectedRevision:a.number().int().nonnegative(),teamId:x,projectId:x.nullable(),enabled:a.boolean(),configuration:L,cadence:a.discriminatedUnion("kind",[a.object({kind:a.literal("interval"),seconds:a.number().int().min(60).max(31536e3)}).strict(),a.object({kind:a.literal("nightly"),calendar:Ue}).strict()]),maximumTotalSpendUsd:a.number().finite().positive().max(1e4),maximumAttempts:a.number().int().min(1).max(20)}).strict().superRefine((t,e)=>{(t.configuration.request.teamId!==t.teamId||(t.configuration.request.project?.id??null)!==t.projectId)&&e.addIssue({code:"custom",message:"The scheduled Experiment must retain its actual workspace and Project."}),t.configuration.maximumCostUsd>t.maximumTotalSpendUsd&&e.addIssue({code:"custom",message:"The run ceiling exceeds the approved cumulative schedule ceiling."})}),rn=a.object({id:x,scheduledAt:H,coalescedThroughAt:H,coalescedCount:a.number().int().nonnegative(),configurationHash:F,operationId:x,state:a.enum(["reserved","dispatching","running","cleaning","completed","failed","cancelled","uncertain"]),executionId:x.nullable(),attempt:a.number().int().positive(),maximumCostUsd:a.number().finite().positive(),actualSpendUsd:a.number().finite().nonnegative().nullable(),cleanupComplete:a.boolean(),error:a.string().max(4e3).nullable()}).strict(),on=a.object({schemaVersion:a.literal("openpond.experimentEvaluationSchedule.v1"),id:x,revision:a.number().int().positive(),actorId:x,teamId:x,projectId:x.nullable(),operationId:x,requestHash:F,configuration:L,configurationHash:F,cadence:Xe.shape.cadence,state:a.enum(["scheduled","disabled","blocked"]),nextRunAt:H.nullable(),maximumTotalSpendUsd:a.number().finite().positive(),maximumAttempts:a.number().int().positive(),lastEvaluatedConfigurationHash:F.nullable(),newerUnevaluatedRelease:K.nullable(),fires:a.array(rn).max(1e4),reason:a.string().max(4e3).nullable(),createdAt:H,updatedAt:H,contentHash:F}).strict();function an(t){let{operationId:e,request:n,...r}=t,{operationId:o,...s}=n;return f({...r,request:s})}d(an,"scheduledExperimentHash");function sn(t){let e=on.parse(t);if(_e(e,"Scheduled Experiment"),e.configurationHash!==an(e.configuration)||e.configuration.request.teamId!==e.teamId||(e.configuration.request.project?.id??null)!==e.projectId)throw new Error("Scheduled Experiment immutable authority differs from its recipe.");return e}d(sn,"verifyExperimentEvaluationSchedule");function zr(t){return sn({...t,contentHash:f(t)})}d(zr,"sealExperimentEvaluationSchedule");var dn=a.object({teamId:x,id:x,operationId:x,expectedRevision:a.number().int().positive(),action:a.enum(["cancel_active","retry_active","pause"])}).strict(),Lr=a.discriminatedUnion("operation",[a.object({operation:a.literal("publish"),request:Xe}).strict(),a.object({operation:a.literal("control"),request:dn}).strict(),a.object({operation:a.literal("read"),id:x}).strict(),a.object({operation:a.literal("list"),cursor:x.optional(),limit:a.number().int().min(1).max(100).default(50)}).strict()]);function cn(t){return{list:d((e={})=>t.listSandboxRuntimes(e),"list"),create:d(e=>t.createSandboxRuntime(e),"create"),handle:d((e,n=null)=>t.sandboxRuntime(e,n),"handle"),get:d(e=>t.getSandboxRuntime(e),"get"),createSandbox:d((e,n={},r={})=>t.createSandboxRuntimeSandbox(e,n,r),"createSandbox"),updateStatus:d((e,n)=>t.updateSandboxRuntimeStatus(e,n),"updateStatus"),events:d(e=>t.listSandboxRuntimeEvents(e),"events"),event:d((e,n)=>t.emitSandboxRuntimeEvent(e,n),"event"),checkpoint:d((e,n={})=>t.checkpointSandboxRuntime(e,n),"checkpoint"),promote:d((e,n,r={})=>t.promoteSandboxRuntime(e,n,r),"promote"),preserveSource:d((e,n={},r={})=>t.preserveSandboxRuntimeSource(e,n,r),"preserveSource")}}d(cn,"createSandboxRuntimeNamespace");function un(t){return{list:d((e={})=>t.list(e),"list"),create:d(e=>t.create(e),"create"),get:d(e=>t.get(e),"get"),pricing:d(()=>t.pricing(),"pricing"),costs:d((e={})=>t.costs(e),"costs")}}d(un,"createSandboxNamespace");function pn(t){return{list:d(e=>t.listProjects(e),"list"),upsert:d(e=>t.upsertProject(e),"upsert"),upsertGitRemote:d(e=>t.upsertProjectGitRemote(e),"upsertGitRemote"),get:d((e,n)=>t.getProject(e,n),"get"),update:d((e,n)=>t.updateProject(e,n),"update"),sync:d((e,n)=>t.syncProject(e,n),"sync"),ensureGitRemote:d((e,n)=>t.ensureProjectGitRemote(e,n),"ensureGitRemote"),getGitRemote:d((e,n)=>t.ensureProjectGitRemote(e,n),"getGitRemote"),git:d((e,n)=>t.ensureProjectGitRemote(e,n),"git"),uploadSource:d((e,n)=>t.uploadProjectSource(e,n),"uploadSource"),archive:d((e,n)=>t.archiveProject(e,n),"archive")}}d(pn,"createSandboxProjectNamespace");function mn(t){return{get:d(e=>t.getHostedProfile(e),"get"),status:d(e=>t.getHostedProfile(e),"status"),ensureHosted:d(e=>t.ensureHostedProfile(e),"ensureHosted"),push:d(e=>t.pushHostedProfile(e),"push")}}d(mn,"createSandboxProfileNamespace");function ln(t){return{list:d(e=>t.listAgents(e),"list"),upsert:d(e=>t.upsertAgent(e),"upsert"),get:d((e,n)=>t.getAgent(e,n),"get"),update:d((e,n)=>t.updateAgent(e,n),"update"),archive:d((e,n)=>t.archiveAgent(e,n),"archive"),run:d((e,n)=>t.runAgent(e,n),"run"),sourceDeployPlan:d((e,n)=>t.getAgentSourceDeployPlan(e,n),"sourceDeployPlan"),manifestSnapshots:d((e,n)=>t.listAgentManifestSnapshots(e,n),"manifestSnapshots"),requestSourceChecks:d((e,n)=>t.requestAgentSourceChecks(e,n),"requestSourceChecks"),configureSourceSetup:d((e,n)=>t.configureAgentSourceSetup(e,n),"configureSourceSetup"),publishSource:d((e,n)=>t.publishAgentSource(e,n),"publishSource")}}d(ln,"createSandboxAgentNamespace");function hn(t,e,n=null){let r=d(async(c={},p={})=>{let I=await t.getSandboxRuntime(e);return I.sandboxId?t.get(I.sandboxId):t.createSandboxRuntimeSandbox(e,c,p).then(l=>l.sandbox)},"currentSandbox"),o=d(async(c={},p={})=>{let I=await t.getSandboxRuntime(e);if(!I.sandboxId)return t.createSandboxRuntimeSandbox(e,c,p).then(g=>g.sandbox);let l=await t.get(I.sandboxId);return l.state==="stopped"?t.start(l.id,p).then(g=>g.sandbox):l.state==="archived"?t.restore(l.id).then(g=>g.sandbox):l.state==="deleted"||l.state==="error"?t.createSandboxRuntimeSandbox(e,c,p).then(g=>g.sandbox):l},"resume");return{id:e,initial:n,get:d(()=>t.getSandboxRuntime(e),"get"),sandbox:r,resume:o,createSandbox:d((c={},p={})=>t.createSandboxRuntimeSandbox(e,c,p),"createSandbox"),status:d(async c=>{if(typeof c!="string")return t.updateSandboxRuntimeStatus(e,c);let p=await t.getSandboxRuntime(e);return t.updateSandboxRuntimeStatus(e,{status:c,expectedVersion:p.version})},"status"),events:d(()=>t.listSandboxRuntimeEvents(e),"events"),event:d(c=>t.emitSandboxRuntimeEvent(e,c),"event"),recordCommit:d((c,p={})=>t.emitSandboxRuntimeEvent(e,{...p,type:p.type??"git.commit",commitSha:c}),"recordCommit"),checkpointHint:d((c={})=>t.emitSandboxRuntimeEvent(e,{type:"workflow.checkpoint_hint",summary:c.summary??c.reason??"Workflow checkpoint hint",payload:{...c.payload,reason:c.reason??null},artifactRefs:c.artifactRefs,lifecycleHint:{kind:"checkpoint",reason:c.reason??null}}),"checkpointHint"),waitForUser:d(async(c={})=>{await t.emitSandboxRuntimeEvent(e,{type:"workflow.waiting_for_user",summary:c.summary??c.reason??"Waiting for user",payload:{...c.payload,reason:c.reason??null},lifecycleHint:{kind:"waiting_for_user",reason:c.reason??null}});let p=await t.getSandboxRuntime(e);return p.status==="waiting_for_user"?p:t.updateSandboxRuntimeStatus(e,{status:"waiting_for_user",expectedVersion:p.version,summary:c.summary??c.reason,metadata:{workflowWaitForUserReason:c.reason??null}})},"waitForUser"),keepAlive:d((c={})=>{let p=fn(c);return t.emitSandboxRuntimeEvent(e,{type:"workflow.keepalive",summary:c.summary??c.reason??"Workflow keepalive",payload:{...c.payload,reason:c.reason??null,keepaliveUntil:p},lifecycleHint:{kind:"keepalive",reason:c.reason??null,keepaliveUntil:p}})},"keepAlive"),checkpoint:d(c=>t.checkpointSandboxRuntime(e,c),"checkpoint"),files:{write:d(async(c,p)=>t.uploadFile((await o()).id,c,p),"write"),read:d(async c=>t.downloadFile((await o()).id,c),"read"),readResponse:d(async c=>t.downloadFileResponse((await o()).id,c),"readResponse"),list:d(async(c={})=>t.listFiles((await o()).id,c),"list"),delete:d(async(c,p={})=>t.deleteFile((await o()).id,c,p),"delete"),search:d(async c=>t.searchFiles((await o()).id,c),"search"),stat:d(async c=>t.statFile((await o()).id,c),"stat"),mkdir:d(async c=>t.mkdir((await o()).id,c),"mkdir"),move:d(async c=>t.moveFile((await o()).id,c),"move")},commands:{run:d(async c=>t.exec((await o()).id,typeof c=="string"?{command:c}:c),"run")},ports:{expose:d(async c=>t.openPort((await o()).id,typeof c=="number"?{port:c}:c),"expose")},promote:d((c,p={})=>t.promoteSandboxRuntime(e,c,p),"promote"),preserveSource:d((c={},p={})=>t.preserveSandboxRuntimeSource(e,c,p),"preserveSource"),archive:d(async c=>{let p=c??(await t.getSandboxRuntime(e)).version;return t.updateSandboxRuntimeStatus(e,{status:"archived",expectedVersion:p})},"archive")}}d(hn,"createSandboxRuntimeHandle");function fn(t){if(t?.until instanceof Date)return t.until.toISOString();if(typeof t?.until=="string"&&t.until.trim())return new Date(t.until).toISOString();let e=typeof t?.seconds=="number"&&Number.isFinite(t.seconds)?Math.max(1,Math.trunc(t.seconds)):60;return new Date(Date.now()+e*1e3).toISOString()}d(fn,"runtimeKeepaliveUntilIso");async function yn(t,e={}){let n=`openpond-code-smoke-${Date.now()}`,r=`openpond-code-exec-ok:${n}`,o=`openpond-code-preview-ok:${n}`,s=`openpond-code-file-ok:${n}`,i=4173,u=null,c=null,p=!1,I=!1;try{let l=await Ye(t,await t.create({repo:e.repo??"https://github.com/octocat/Hello-World",resources:{cpu:e.cpu??1,memoryGb:e.memoryGb??1,diskGb:e.diskGb??8},budget:{maxUsd:e.budgetUsd??"0.05"},quotas:{maxSpendUsd:e.budgetUsd??"0.05",maxDurationSeconds:600,idleTimeoutSeconds:600,maxOpenPorts:2},metadata:{runId:n,source:"openpond-code-sandbox-smoke"}},{async:!0}));u=l.id;let g=e.expectedMppMode;if(g&&l.reservation.mpp?.mode!==g)throw new Error(`expected ${g} reservation, got ${l.reservation.mpp?.mode??"none"}`);if(!g&&!l.reservation.mpp?.mode)throw new Error("expected sandbox reservation MPP metadata");let P=await t.exec(l.id,{command:[`printf '${r}\\n'`,"test -f README && printf 'repo-clone-ok\\n'","cat > server.cjs <<'EOF'","const { createServer } = require('node:http');",`createServer((_request, response) => response.end('${o}')).listen(${i}, '0.0.0.0');`,"EOF","nohup node server.cjs > server.log 2>&1 & sleep 1"].join(`
|
|
2
|
+
import{b as Ne}from"./chunk-SYUKES6H.js";import{a as B,b as G,c as ze,d as Le,e as q,f as ie,i as de,o as Be,q as ce}from"./chunk-JCHLDNCX.js";import{a as ue}from"./chunk-2ACX7IW5.js";import{k as ae,m as se,n as Pe}from"./chunk-OQPJ7FJF.js";import{c as Te}from"./chunk-UGDBMRCT.js";import{E as L}from"./chunk-XKDOPNQ5.js";import{f as K,m as f,n as _e}from"./chunk-HIQPGYVH.js";import{a as Ce}from"./chunk-HLJJAOI2.js";import{a as Oe,c as $e,d as je}from"./chunk-AMC4Z7G4.js";import{l as J,m as qe}from"./chunk-I6VMRQF4.js";import{h as Ue}from"./chunk-ZEOYNUHL.js";import{Sa as Ae,ea as Ee,wb as ke}from"./chunk-ZY32SZ2P.js";import{a as re,b as oe}from"./chunk-KUE46HTH.js";import{b as z}from"./chunk-MZKCW6CB.js";import{A as a}from"./chunk-X2J2P5ZT.js";import{a as d}from"./chunk-FTQLQJQV.js";function jt(t,e){let n=t.token?.trim();if(!n||t.accountState.state!=="signed_in"||!t.accountState.activeProfile)throw new Error("A signed-in OpenPond account is required.");let r=Ce(t.apiBaseUrl,{apiBaseUrl:t.apiBaseUrl}),o=/\/api\/sandboxes\/?$/.test(r)?r.replace(/\/api\/sandboxes\/?$/,"/v1"):r.replace(/\/sandboxes\/?$/,"");return{audience:new URL(o).origin,async request(s){let i=n.startsWith("opk_"),u=await z(o,n,s.path,{method:s.method??"GET",signal:s.signal,explicitBearerAuth:!i,headers:{...i?{"openpond-api-key":n}:{},...s.idempotencyKey?{"idempotency-key":s.idempotencyKey}:{},...e?{"X-OpenPond-Team-Id":e}:{}},...s.body?{body:JSON.stringify(s.body)}:{},...s.timeoutMs!==void 0?{timeoutMs:s.timeoutMs}:{}}),c=await u.json().catch(()=>({}));if(!u.ok)throw new Error(typeof c.error=="string"?c.error:`OpenPond API request failed with status ${u.status}`);return c}}}d(jt,"createCapturedOpenPondPublicApiClient");import{AsyncLocalStorage as _t}from"node:async_hooks";var Tt=new _t;function zt(){return Tt.getStore()}d(zt,"apiClientIdentity");var Lt=3e4,Bt=8*1024*1024,Gn={timeoutMs:900*1e3,maxResponseBytes:64*1024*1024},Fe=class extends Error{static{d(this,"ApiTimeoutError")}timeoutMs;requestUrl;code="OPENPOND_API_TIMEOUT";constructor(t,e){super(`API request timed out after ${t}ms: ${e}`),this.timeoutMs=t,this.requestUrl=e,this.name="ApiTimeoutError"}},pe=class extends Error{static{d(this,"ApiResponseTooLargeError")}maximumBytes;requestUrl;code="OPENPOND_API_RESPONSE_TOO_LARGE";constructor(t,e){super(`API response exceeded ${t} bytes: ${e}`),this.maximumBytes=t,this.requestUrl=e,this.name="ApiResponseTooLargeError"}},He=class extends Error{static{d(this,"OpenPondApiError")}status;apiMessage;code;constructor(t,e,n,r=null){let o=r||e;super(`${n} failed: ${t}${o?` ${o}`:""}`),this.status=t,this.apiMessage=r,this.name="OpenPondApiError",this.code=e||"OPENPOND_API_ERROR"}};async function W(t,e,n,r={}){let{timeoutMs:o=Lt,maxResponseBytes:s=Bt,explicitBearerAuth:i=!1,...u}=r,c=`${t}${n}`,p=new Headers(u.headers),I=zt();I&&!i&&p.set("x-openpond-client",I),p.set("Content-Type","application/json");let l=i?void 0:process.env.OPENPOND_API_KEY,g=e?.trim()||"",P=!i&&g.startsWith("opk_"),te=l||(P?g:null);te&&!p.has("openpond-api-key")&&p.set("openpond-api-key",te),e?p.set("Authorization",P?`ApiKey ${g}`:`Bearer ${e}`):l&&!p.has("Authorization")&&p.set("Authorization",`ApiKey ${l}`);let U=new AbortController,j=new Fe(o,c),T=o>0?setTimeout(()=>U.abort(j),o):null;T?.unref?.();let ne=Ft(u.signal,U.signal,o),A=d(()=>{T&&clearTimeout(T)},"cleanup");try{let R=await fetch(c,{...u,headers:p,signal:ne});return Nt(R,{cleanup:A,maximumBytes:s,requestUrl:c,timeoutController:U,timeoutError:j})}catch(R){throw A(),U.signal.aborted?j:R}}d(W,"apiFetch");async function me(t,e){let n;try{let r=await t.text();n=r?JSON.parse(r):{}}catch(r){if(r instanceof Fe||r instanceof pe)throw r;n={}}if(!t.ok){let r=typeof n.error=="string"?n.error:null,o=typeof n.message=="string"?n.message:null;throw new He(t.status,r,e,o)}return n}d(me,"readApiJson");function Nt(t,e){if(!t.body)return e.cleanup(),t;let n=Number(t.headers.get("content-length"));if(e.maximumBytes>0&&Number.isFinite(n)&&n>e.maximumBytes)throw e.cleanup(),t.body.cancel(),new pe(e.maximumBytes,e.requestUrl);let r=t.body.getReader(),o=0,s=new ReadableStream({async pull(i){try{let u=await r.read();if(u.done){e.cleanup(),i.close();return}if(o+=u.value.byteLength,e.maximumBytes>0&&o>e.maximumBytes){e.cleanup(),await r.cancel(),i.error(new pe(e.maximumBytes,e.requestUrl));return}i.enqueue(u.value)}catch(u){e.cleanup(),i.error(e.timeoutController.signal.aborted?e.timeoutError:u)}},async cancel(i){e.cleanup(),await r.cancel(i)}});return new Response(s,{headers:t.headers,status:t.status,statusText:t.statusText})}d(Nt,"boundedResponse");function Ft(t,e,n){return n<=0?t??void 0:t?AbortSignal.any([t,e]):e}d(Ft,"composedSignal");var C=a.string().min(1).max(200),_=a.string().regex(/^[a-f0-9]{64}$/),le=a.object({operationId:C,name:a.string().trim().min(1).max(500),projectId:C,dataset:K.extend({revision:a.number().int().positive()}).strict(),caseIds:a.array(C).min(1).max(1e4)}).strict().superRefine((t,e)=>{new Set(t.caseIds).size!==t.caseIds.length&&e.addIssue({code:"custom",message:"Select each case once."})}),Ht=B.extend({inputHash:_,outputHash:_.nullable(),task:Ee,taskHash:_}).strict(),Mt=a.object({schemaVersion:a.literal("openpond.connectedRecordedExecution.v1"),id:C,teamId:C,ownerUserId:C,request:le,manifest:ke,sources:a.array(Ht).min(1).max(1e4),contentHash:_}).strict();function Me(t){let e=Mt.parse(t),{contentHash:n,...r}=e,{contentHash:o,...s}=e.manifest;if(f(r)!==n||f(s)!==o||e.manifest.teamId!==e.teamId||e.manifest.id!==e.id||e.manifest.operationId!==e.request.operationId||f(e.manifest.dataset)!==f(e.request.dataset)||e.sources.length!==e.request.caseIds.length||e.sources.length!==e.manifest.population.length||e.sources.some((i,u)=>i.taskHash!==f(i.task)||i.task.id!==e.request.caseIds[u]||i.boundaryId!==i.task.id||e.manifest.population[u]?.caseId!==i.boundaryId))throw new Error("Recorded execution identity or population integrity failed.");return e}d(Me,"verifyConnectedRecordedExecution");var Dt=a.object({projectId:C.optional(),cursor:C.optional(),limit:a.number().int().min(1).max(50).default(20)}).strict(),Jt=a.object({id:C,teamId:C,ownerUserId:C,projectId:C,name:a.string().min(1).max(500),dataset:le.shape.dataset,manifestHash:_,contentHash:_,caseCount:a.number().int().min(1).max(1e4),createdAt:a.string().datetime()}).strict(),Kt=a.object({teamId:C,items:a.array(Jt).max(50),nextCursor:C.nullable()}).strict(),Gt=a.object({datasetId:a.string().trim().min(1).max(240),expectedRevision:a.number().int().positive(),operationId:a.string().trim().min(1).max(240),graders:a.array(Ae).min(1).max(100).optional()}).strict().superRefine((t,e)=>{t.graders&&new Set(t.graders.map(n=>n.id)).size!==t.graders.length&&e.addIssue({code:"custom",path:["graders"],message:"Choose one exact revision of each grader."})}),N=a.string().min(1).max(500),k=a.number().int().nonnegative(),Wt=a.object({teamId:N,ownerUserId:N,projectId:N.nullable(),status:a.enum(["active","paused","archived"]),revision:k,state:a.enum(["collecting","pending","attention","paused","archived"]),lastReconciledAt:a.string().datetime().nullable(),lastCapturedAt:a.string().datetime().nullable(),historyDays:a.number().int().positive(),sources:k,tasks:k,datasets:a.array(a.object({datasetId:N,projection:a.enum(["turn","conversation"]),revision:k}).strict()).max(2),latestBatch:a.object({operationId:N,updatedAt:a.string().datetime(),scanned:k,captured:k,unchanged:k,pending:k,failed:k,excluded:k,paused:k,hasMore:a.boolean()}).strict().nullable()}).strict(),h=a.string().min(1).max(500),E=a.string().regex(/^[a-f0-9]{64}$/),De=a.object({teamId:h,projectId:h.nullable(),status:a.enum(["active","paused","archived"]),revision:a.number().int().nonnegative()}).strict(),Xt=a.object({teamId:h,operationId:h,projectId:h.nullable(),outcomes:a.array(a.object({conversationId:h,state:a.enum(["captured","unchanged","pending","paused","excluded","failed"]),sourceId:h.optional(),snapshotHash:E.optional(),reason:a.string().optional()}).strict()).max(50),nextCursor:h.nullable()}).strict(),Vt=a.object({teamId:h,ref:B,origin:G.shape.source,sessionId:h,projectId:h,capturedAt:a.string().datetime(),unmappedEvidence:a.object({count:a.number().int().nonnegative().max(1e5),contentHash:E}).strict(),evidence:a.object({input:a.array(J),observed:a.array(J),answer:a.json(),boundary:qe}).strict()}).strict(),Yt=a.object({teamId:h,sourceId:h,snapshotHash:E,contentHash:E,count:a.number().int().nonnegative(),offset:a.number().int().nonnegative(),events:a.array(J).max(50),nextOffset:a.number().int().nonnegative().nullable()}).strict(),Zt=a.object({teamId:h,source:q.shape.source,sourceHash:E,previewHash:E,destination:q.shape.destination,issues:a.array(a.object({file:a.string(),message:a.string()}).strict()).max(100),sessions:a.array(a.object({sessionHash:E,sessionId:h,origin:G.shape.source,exporterVersion:a.string().nullable(),eventCount:a.number().int().nonnegative(),boundaries:a.array(a.object({id:h,projection:a.enum(["turn","conversation"]),answer:a.boolean(),process:a.enum(["retained","partial","absent"]),terminal:a.enum(["completed","failed","cancelled","unknown"])}).strict()).max(5001),warnings:a.array(a.string()).max(100),sample:a.array(a.object({role:a.enum(["user","assistant","system","tool"]).nullable(),text:a.string().max(4e3)}).strict()).max(3)}).strict()).max(1e3)}).strict(),Je=a.object({teamId:h,operationId:h,requestHash:E,previewHash:E,projectId:h.optional(),state:a.enum(["admitting","publishing","completed","failed"]),outcomes:a.array(a.object({sessionHash:E,sourceId:h,status:a.enum(["imported","already_present"]),datasets:a.array(a.object({datasetId:h,revision:a.number().int().positive(),changed:a.boolean()}).strict()).max(2)}).strict()).max(1e3),error:a.string().optional()}).strict(),Ke=class extends Error{static{d(this,"ConnectedEvidenceError")}constructor(t,e,n){super(n),this.status=t,this.code=e,this.name="ConnectedEvidenceError"}status;code},pr=class{static{d(this,"ConnectedEvidenceClient")}constructor(t){this.options=t;let e=new URL(t.baseUrl);if(!["http:","https:"].includes(e.protocol)||e.username||e.password||e.search||e.hash||!t.apiKey.trim()||!t.teamId.trim())throw new Error("A clean API origin and workspace credentials are required.");this.baseUrl=e.toString().replace(/\/+$/,"")}options;baseUrl;async capture(t,e){let n=ze.parse(t),r=Xt.parse(await this.request("/capture","POST",n,e));if(this.scope(r.teamId),r.operationId!==n.operationId||r.outcomes.length>n.limit||n.conversationId&&r.outcomes.some(o=>o.conversationId!==n.conversationId))throw new Error("Capture receipt differs from its requested source or operation.");return r}async retainStartingAssets(t,e){let n=Be.parse(t),r=ce(await this.request("/starting-assets","POST",n,e));if(this.scope(r.teamId),r.operationId!==n.operationId||r.requestHash!==f(n)||f(r.source)!==f(n.source)||r.assets.length!==n.proofs.length||r.assets.some((o,s)=>o.path!==n.proofs[s].path))throw new Error("Starting assets differ from the exact source, operation or selected paths.");return r}async startingAssets(t,e){let n=ce(await this.request(`/starting-assets/${encodeURIComponent(h.parse(t))}`,"GET",void 0,e));if(this.scope(n.teamId),n.id!==t)throw new Error("Starting assets identity mismatch.");return n}async list(t={},e){let n=a.object({projectId:h.optional(),cursor:h.optional(),limit:a.number().int().min(1).max(50).default(20)}).strict().parse(t),r=new URLSearchParams(Object.entries(n).filter(([,s])=>s!==void 0).map(([s,i])=>[s,String(i)])),o=a.object({teamId:h,items:a.array(G).max(50),nextCursor:h.nullable()}).strict().parse(await this.request(`?${r}`,"GET",void 0,e));if(this.scope(o.teamId),o.items.length>n.limit||new Set(o.items.map(s=>s.sourceId)).size!==o.items.length||o.nextCursor!==null&&o.nextCursor===n.cursor||n.projectId&&o.items.some(s=>s.projectId!==n.projectId))throw new Error("Connected source page differs from its requested scope.");return o}async read(t,e){let n=B.parse(t),r=Vt.parse(await this.request(`/${encodeURIComponent(n.id)}/cases/${encodeURIComponent(n.boundaryId)}?snapshotHash=${n.snapshotHash}&revisionHash=${n.boundaryRevisionHash}`,"GET",void 0,e));if(this.scope(r.teamId),f(r.ref)!==f(n)||r.evidence.boundary.id!==n.boundaryId||r.evidence.boundary.revisionHash!==n.boundaryRevisionHash||f(r.evidence.input)!==r.evidence.boundary.inputHash||f(r.evidence.observed)!==n.boundaryRevisionHash||r.evidence.boundary.outputHash!==null&&f(r.evidence.answer)!==r.evidence.boundary.outputHash)throw new Error("Connected case readback differs from its exact snapshot or cutoff.");return r}async setCollection(t,e){let n=De.parse(await this.request("/collection","PUT",a.object({paused:a.boolean()}).strict().parse({paused:t}),e));return this.scope(n.teamId),n}async collection(t){let e=De.parse(await this.request("/collection","GET",void 0,t));return this.scope(e.teamId),e}async collectionStatus(t){let e=Wt.parse(await this.request("/collection/status","GET",void 0,t));return this.scope(e.teamId),e}async unmappedEvents(t,e){let n=a.object({id:h,snapshotHash:E,contentHash:E,offset:a.number().int().nonnegative().default(0),limit:a.number().int().min(1).max(50).default(20)}).strict().parse(t),r=Yt.parse(await this.request(`/${encodeURIComponent(n.id)}/unmapped-events?snapshotHash=${n.snapshotHash}&offset=${n.offset}&limit=${n.limit}`,"GET",void 0,e));if(this.scope(r.teamId),r.sourceId!==n.id||r.snapshotHash!==n.snapshotHash||r.contentHash!==n.contentHash||r.offset!==n.offset||r.events.length>n.limit||r.events.some((o,s)=>o.sequence!==n.offset+s)||r.nextOffset!==null&&r.nextOffset!==n.offset+r.events.length)throw new Error("Unmapped source event page differs from its pinned snapshot.");return r}async homeSummary(t,e){let n=a.object({from:a.string().datetime(),to:a.string().datetime(),projectId:h.optional()}).strict(),r=n.parse(t),o=new URLSearchParams(Object.entries(r)),s=a.object({teamId:h,range:n,activity:a.object({conversations:a.number().int().nonnegative(),turns:a.number().int().nonnegative(),chatTurns:a.number().int().nonnegative(),workTurns:a.number().int().nonnegative()}).strict(),accounting:a.object({contextSnapshots:a.number().int().nonnegative()}).strict(),usage:Oe}).strict().parse(await this.request(`/summary?${o}`,"GET",void 0,e));if(this.scope(s.teamId),f(s.range)!==f(r)||s.activity.chatTurns+s.activity.workTurns!==s.activity.turns)throw new Error("Activity summary differs from its requested range.");for(let i of[s.usage.days,s.usage.modes,s.usage.models]){if(new Set(i.map(u=>u.key)).size!==i.length)throw new Error("Duplicate usage summary group.");for(let u of Object.keys(s.usage.total))if(i.reduce((c,p)=>c+p[u],0)!==s.usage.total[u])throw new Error("Usage totals differ from their displayed groups.")}return s}async uploadPart(t,e){let n=Le.parse(t),r=a.object({teamId:h,hash:E,parts:a.number().int(),index:a.number().int()}).strict().parse(await this.request("/imports/upload","POST",n,e));if(this.scope(r.teamId),r.hash!==n.hash||r.parts!==n.parts||r.index!==n.index)throw new Error("Upload receipt differs from its part identity.");return r}async preview(t,e){let n=q.parse(t),r=Zt.parse(await this.request("/imports/preview","POST",n,e));if(this.scope(r.teamId),r.source!==n.source||f(r.destination)!==f(n.destination)||r.sessions.some(o=>o.origin!==n.source)||new Set(r.sessions.map(o=>o.sessionHash)).size!==r.sessions.length)throw new Error("Import preview differs from its source or destination.");return r}async commit(t,e){let n=ie.parse(t),r=Je.parse(await this.request("/imports/commit","POST",n,e));if(this.scope(r.teamId),r.operationId!==n.operationId||r.previewHash!==n.previewHash||r.requestHash!==f(n)||r.outcomes.some(o=>!n.selection.some(s=>s.sessionHash===o.sessionHash))||r.state==="completed"&&r.outcomes.length!==n.selection.length)throw new Error("Import receipt differs from its exact selection or operation.");return r}async readImport(t,e){let n=h.parse(t),r=Je.parse(await this.request(`/imports/${encodeURIComponent(n)}`,"GET",void 0,e));if(this.scope(r.teamId),r.operationId!==n)throw new Error("Import identity mismatch.");return r}async prepareRecorded(t,e){let n=le.parse(t),r=Me(await this.request("/recorded-executions","POST",n,e));if(this.scope(r.teamId),f(r.request)!==f(n))throw new Error("Recorded admission differs from its selected Dataset/cases.");return r}async listRecordedExecutions(t={},e){let n=Dt.parse(t),r=new URLSearchParams(Object.entries(n).filter(([,s])=>s!==void 0).map(([s,i])=>[s,String(i)])),o=Kt.parse(await this.request(`/recorded-executions?${r}`,"GET",void 0,e));if(this.scope(o.teamId),o.items.length>n.limit||o.items.some((s,i)=>s.teamId!==o.teamId||n.projectId&&s.projectId!==n.projectId||n.cursor&&s.id<=n.cursor||i>0&&s.id<=o.items[i-1].id)||o.items.some(s=>s.ownerUserId!==o.items[0]?.ownerUserId)||o.nextCursor!==null&&(n.cursor!==void 0&&o.nextCursor<=n.cursor||o.items.length>0&&o.nextCursor<o.items.at(-1).id))throw new Error("Recorded execution page differs from its requested scope or cursor.");return o}async recordedExecution(t,e){let n=Me(await this.request(`/recorded-executions/${encodeURIComponent(h.parse(t))}`,"GET",void 0,e));if(this.scope(n.teamId),n.id!==t)throw new Error("Recorded execution identity mismatch.");return n}async publishDataset(t,e){let n=Gt.parse(t),r=de.parse(await this.request("/datasets/publish","POST",n,e));this.scope(r.teamId);let o=r.workspace.draft.metadata.connectedPublication;if(r.datasetId!==n.datasetId||!r.publication||!o||typeof o!="object"||!("requestHash"in o)||o.requestHash!==f(n))throw new Error("Published Dataset identity or original selection mismatch.");return r}async createSelection(t,e){let n=a.object({operationId:h.max(240),projectId:h.max(240),name:a.string().trim().min(1).max(200),cases:a.array(B).min(1).max(500)}).strict().parse(t),r=de.parse(await this.request("/datasets/selection","POST",n,e));if(this.scope(r.teamId),r.originProjectId!==n.projectId||r.workspace.draft.tasks.length!==n.cases.length||r.workspace.draft.tasks.some((o,s)=>f(o.input&&typeof o.input=="object"&&!Array.isArray(o.input)?o.input.connectedEvidenceRef:null)!==f(n.cases[s])))throw new Error("Selected Dataset differs from its exact source population.");return r}scope(t){if(t!==this.options.teamId)throw new Error("Connected evidence workspace mismatch.")}async request(t,e,n,r){let{response:o,value:s}=await Te(this.options.fetch??fetch,`${this.baseUrl}/v1/connected-evidence${t}`,{method:e,signal:r,redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"X-OpenPond-Team-Id":this.options.teamId,"Content-Type":"application/json",Accept:"application/json"},...n===void 0?{}:{body:JSON.stringify(n)}},(i,u,c)=>new Ke(i,u,c));if(!o.ok){let i=a.object({code:a.string(),message:a.string()}).safeParse(s);throw new Ke(o.status,i.success?i.data.code:"connected_request_failed",i.success?i.data.message:"Connected evidence request failed.")}return s}},b=a.string().trim().min(1).max(240),hr=a.object({id:b,expectedRevision:a.number().int().positive(),manifest:$e}).strict().refine(t=>t.id===t.manifest.connectionId&&t.expectedRevision===t.manifest.connectionRevision,"Collector coverage scope differs from its connection."),fr=a.object({id:b,cutoff:a.iso.datetime().optional()}).strict(),yr=a.object({schemaVersion:a.literal("openpond.connectedSyncCoverageReceipt.v1"),id:b,teamId:b,ownerUserId:b,connectionId:b,connectionRevision:a.number().int().positive(),receivedAt:a.iso.datetime(),summary:je}).strict(),gr=a.object({id:b,source:q.shape.source,machineId:b,sourceInstanceId:b,sourceLabel:a.string().trim().min(1).max(200),sourceRoot:a.string().min(1).max(2e3),destination:q.shape.destination,since:a.string().datetime().nullable(),keepSyncing:a.boolean(),expectedRevision:a.number().int().nonnegative()}).strict(),br=a.object({id:b,expectedRevision:a.number().int().positive(),action:a.enum(["pause","resume","disconnect"])}).strict(),Ir=a.object({id:b,operationId:b,expectedRevision:a.number().int().positive()}).strict(),Sr=a.object({id:b,expectedRevision:a.number().int().positive(),pendingOperations:a.number().int().min(0).max(1e4),error:a.string().max(500).nullable(),completedSyncRevision:a.number().int().nonnegative().default(0)}).strict(),wr=a.object({teamId:b,id:b,revision:a.number().int().positive(),source:q.shape.source,sourceLabel:a.string(),sourceRoot:a.string(),taskDatasetId:b.nullable(),conversationDatasetId:b.nullable(),machineId:b,sourceInstanceId:b,projectId:b,datasetIds:a.array(b).max(2),since:a.string().datetime().nullable(),keepSyncing:a.boolean(),state:a.enum(["active","paused","disconnected"]),health:a.enum(["online","offline"]),lastHeartbeatAt:a.string().datetime().nullable(),lastAdmissionAt:a.string().datetime().nullable(),pendingOperations:a.number().int().nonnegative(),admittedTasks:a.number().int().nonnegative(),error:a.string().nullable(),requestedSyncRevision:a.number().int().nonnegative().default(0),completedSyncRevision:a.number().int().nonnegative().default(0),syncRequestedAt:a.string().datetime().nullable().default(null),syncCompletedAt:a.string().datetime().nullable().default(null)}).strict().refine(t=>t.completedSyncRevision<=t.requestedSyncRevision&&t.requestedSyncRevision<=t.revision,"Invalid sync acknowledgement generation."),xr=a.object({connectionId:b,expectedRevision:a.number().int().positive(),request:ie}).strict();function Ur(t){let e=d(r=>`/v1/training/candidate-evaluations/${encodeURIComponent(r)}`,"path");function n(r,o,s){let i=tn.parse(r);if(i.teamId!==o||s&&i.id!==s)throw new Error("The preparation belongs to another workspace or candidate operation.");return i}return d(n,"read"),{async options(r,o={}){let s=new URLSearchParams({teamId:r,...o}),i=en.parse(await t(`/v1/training/candidates?${s}`));if(i.teamId!==r)throw new Error("The candidate catalog belongs to another workspace.");return i},async save(r){let o=We.parse(r),s=n(await t(`/v1/training/candidate-evaluations?teamId=${encodeURIComponent(o.teamId)}`,{method:"POST",body:JSON.stringify(o)}),o.teamId);if(s.requestHash!==f(o))throw new Error("The saved preparation differs from the selected candidate or frozen evaluation.");return s},async get(r,o){return n(await t(`${e(o)}?teamId=${encodeURIComponent(r)}`),r,o)},async control(r,o,s,i){let u=nn.parse(i),c=n(await t(`${e(o)}/${s}?teamId=${encodeURIComponent(r)}`,{method:"POST",body:JSON.stringify(u)}),r,o);if(c.requestHash!==u.requestHash)throw new Error("The command returned a different frozen evaluation.");return c}}}d(Ur,"createCandidateEvaluationClient");var S=a.string().trim().min(1).max(200),he=a.string().regex(/^[a-f0-9]{64}$/),Ge=a.object({id:S,contentHash:he}).strict(),Qt=a.object({artifact:Ge,trainingJobId:S,configurationId:S,baseProfileId:S,ready:a.boolean(),reason:a.string().max(1e3).nullable()}).strict(),en=a.object({teamId:S,ownerUserId:S,items:a.array(Qt).max(100),nextCursor:S.nullable()}).strict(),We=a.object({teamId:S,operationId:S,artifact:Ge,configuration:L}).strict().superRefine((t,e)=>{(t.configuration.request.teamId!==t.teamId||t.configuration.request.policy.kind==="fixture"||t.configuration.request.policy.candidate)&&e.addIssue({code:"custom",message:"Choose one exact model-backed evaluation before preparing the trained version."})}),tn=a.object({schemaVersion:a.literal("openpond.candidateEvaluationPreparation.v1"),teamId:S,ownerUserId:S,id:S,revision:a.number().int().positive(),requestHash:he,request:We,trainingJobId:S,dispatchId:S,lastOperationId:S.nullable(),runtime:a.object({poolId:S,endpointId:S.nullable(),baseProfileId:S,workerImageDigest:a.string().regex(/^sha256:[a-f0-9]{64}$/),modelId:S.nullable()}).strict().nullable(),state:a.enum(["configured","preparing","ready","dispatching","submitted","cleaning","completed","failed","cancelled"]),experimentId:S.nullable(),authorizedAt:a.iso.datetime().nullable(),cancelledAt:a.iso.datetime().nullable(),reason:a.string().max(1e3).nullable(),createdAt:a.iso.datetime(),updatedAt:a.iso.datetime()}).strict().superRefine((t,e)=>{(t.requestHash!==f(t.request)||!t.runtime&&["ready","dispatching","submitted","completed"].includes(t.state))&&e.addIssue({code:"custom",message:"The exact candidate preparation request or runtime changed."})}),nn=a.object({operationId:S,expectedRevision:a.number().int().positive(),requestHash:he}).strict();var x=a.string().trim().min(1).max(200),F=a.string().regex(/^[a-f0-9]{64}$/),H=a.string().datetime(),Xe=a.object({operationId:x,id:x.optional(),expectedRevision:a.number().int().nonnegative(),teamId:x,projectId:x.nullable(),enabled:a.boolean(),configuration:L,cadence:a.discriminatedUnion("kind",[a.object({kind:a.literal("interval"),seconds:a.number().int().min(60).max(31536e3)}).strict(),a.object({kind:a.literal("nightly"),calendar:Ue}).strict()]),maximumTotalSpendUsd:a.number().finite().positive().max(1e4),maximumAttempts:a.number().int().min(1).max(20)}).strict().superRefine((t,e)=>{(t.configuration.request.teamId!==t.teamId||(t.configuration.request.project?.id??null)!==t.projectId)&&e.addIssue({code:"custom",message:"The scheduled Experiment must retain its actual workspace and Project."}),t.configuration.maximumCostUsd>t.maximumTotalSpendUsd&&e.addIssue({code:"custom",message:"The run ceiling exceeds the approved cumulative schedule ceiling."})}),rn=a.object({id:x,scheduledAt:H,coalescedThroughAt:H,coalescedCount:a.number().int().nonnegative(),configurationHash:F,operationId:x,state:a.enum(["reserved","dispatching","running","cleaning","completed","failed","cancelled","uncertain"]),executionId:x.nullable(),attempt:a.number().int().positive(),maximumCostUsd:a.number().finite().positive(),actualSpendUsd:a.number().finite().nonnegative().nullable(),cleanupComplete:a.boolean(),error:a.string().max(4e3).nullable()}).strict(),on=a.object({schemaVersion:a.literal("openpond.experimentEvaluationSchedule.v1"),id:x,revision:a.number().int().positive(),actorId:x,teamId:x,projectId:x.nullable(),operationId:x,requestHash:F,configuration:L,configurationHash:F,cadence:Xe.shape.cadence,state:a.enum(["scheduled","disabled","blocked"]),nextRunAt:H.nullable(),maximumTotalSpendUsd:a.number().finite().positive(),maximumAttempts:a.number().int().positive(),lastEvaluatedConfigurationHash:F.nullable(),newerUnevaluatedRelease:K.nullable(),fires:a.array(rn).max(1e4),reason:a.string().max(4e3).nullable(),createdAt:H,updatedAt:H,contentHash:F}).strict();function an(t){let{operationId:e,request:n,...r}=t,{operationId:o,...s}=n;return f({...r,request:s})}d(an,"scheduledExperimentHash");function sn(t){let e=on.parse(t);if(_e(e,"Scheduled Experiment"),e.configurationHash!==an(e.configuration)||e.configuration.request.teamId!==e.teamId||(e.configuration.request.project?.id??null)!==e.projectId)throw new Error("Scheduled Experiment immutable authority differs from its recipe.");return e}d(sn,"verifyExperimentEvaluationSchedule");function zr(t){return sn({...t,contentHash:f(t)})}d(zr,"sealExperimentEvaluationSchedule");var dn=a.object({teamId:x,id:x,operationId:x,expectedRevision:a.number().int().positive(),action:a.enum(["cancel_active","retry_active","pause"])}).strict(),Lr=a.discriminatedUnion("operation",[a.object({operation:a.literal("publish"),request:Xe}).strict(),a.object({operation:a.literal("control"),request:dn}).strict(),a.object({operation:a.literal("read"),id:x}).strict(),a.object({operation:a.literal("list"),cursor:x.optional(),limit:a.number().int().min(1).max(100).default(50)}).strict()]);function cn(t){return{list:d((e={})=>t.listSandboxRuntimes(e),"list"),create:d(e=>t.createSandboxRuntime(e),"create"),handle:d((e,n=null)=>t.sandboxRuntime(e,n),"handle"),get:d(e=>t.getSandboxRuntime(e),"get"),createSandbox:d((e,n={},r={})=>t.createSandboxRuntimeSandbox(e,n,r),"createSandbox"),updateStatus:d((e,n)=>t.updateSandboxRuntimeStatus(e,n),"updateStatus"),events:d(e=>t.listSandboxRuntimeEvents(e),"events"),event:d((e,n)=>t.emitSandboxRuntimeEvent(e,n),"event"),checkpoint:d((e,n={})=>t.checkpointSandboxRuntime(e,n),"checkpoint"),promote:d((e,n,r={})=>t.promoteSandboxRuntime(e,n,r),"promote"),preserveSource:d((e,n={},r={})=>t.preserveSandboxRuntimeSource(e,n,r),"preserveSource")}}d(cn,"createSandboxRuntimeNamespace");function un(t){return{list:d((e={})=>t.list(e),"list"),create:d(e=>t.create(e),"create"),get:d(e=>t.get(e),"get"),pricing:d(()=>t.pricing(),"pricing"),costs:d((e={})=>t.costs(e),"costs")}}d(un,"createSandboxNamespace");function pn(t){return{list:d(e=>t.listProjects(e),"list"),upsert:d(e=>t.upsertProject(e),"upsert"),upsertGitRemote:d(e=>t.upsertProjectGitRemote(e),"upsertGitRemote"),get:d((e,n)=>t.getProject(e,n),"get"),update:d((e,n)=>t.updateProject(e,n),"update"),sync:d((e,n)=>t.syncProject(e,n),"sync"),ensureGitRemote:d((e,n)=>t.ensureProjectGitRemote(e,n),"ensureGitRemote"),getGitRemote:d((e,n)=>t.ensureProjectGitRemote(e,n),"getGitRemote"),git:d((e,n)=>t.ensureProjectGitRemote(e,n),"git"),uploadSource:d((e,n)=>t.uploadProjectSource(e,n),"uploadSource"),archive:d((e,n)=>t.archiveProject(e,n),"archive")}}d(pn,"createSandboxProjectNamespace");function mn(t){return{get:d(e=>t.getHostedProfile(e),"get"),status:d(e=>t.getHostedProfile(e),"status"),ensureHosted:d(e=>t.ensureHostedProfile(e),"ensureHosted"),push:d(e=>t.pushHostedProfile(e),"push")}}d(mn,"createSandboxProfileNamespace");function ln(t){return{list:d(e=>t.listAgents(e),"list"),upsert:d(e=>t.upsertAgent(e),"upsert"),get:d((e,n)=>t.getAgent(e,n),"get"),update:d((e,n)=>t.updateAgent(e,n),"update"),archive:d((e,n)=>t.archiveAgent(e,n),"archive"),run:d((e,n)=>t.runAgent(e,n),"run"),sourceDeployPlan:d((e,n)=>t.getAgentSourceDeployPlan(e,n),"sourceDeployPlan"),manifestSnapshots:d((e,n)=>t.listAgentManifestSnapshots(e,n),"manifestSnapshots"),requestSourceChecks:d((e,n)=>t.requestAgentSourceChecks(e,n),"requestSourceChecks"),configureSourceSetup:d((e,n)=>t.configureAgentSourceSetup(e,n),"configureSourceSetup"),publishSource:d((e,n)=>t.publishAgentSource(e,n),"publishSource")}}d(ln,"createSandboxAgentNamespace");function hn(t,e,n=null){let r=d(async(c={},p={})=>{let I=await t.getSandboxRuntime(e);return I.sandboxId?t.get(I.sandboxId):t.createSandboxRuntimeSandbox(e,c,p).then(l=>l.sandbox)},"currentSandbox"),o=d(async(c={},p={})=>{let I=await t.getSandboxRuntime(e);if(!I.sandboxId)return t.createSandboxRuntimeSandbox(e,c,p).then(g=>g.sandbox);let l=await t.get(I.sandboxId);return l.state==="stopped"?t.start(l.id,p).then(g=>g.sandbox):l.state==="archived"?t.restore(l.id).then(g=>g.sandbox):l.state==="deleted"||l.state==="error"?t.createSandboxRuntimeSandbox(e,c,p).then(g=>g.sandbox):l},"resume");return{id:e,initial:n,get:d(()=>t.getSandboxRuntime(e),"get"),sandbox:r,resume:o,createSandbox:d((c={},p={})=>t.createSandboxRuntimeSandbox(e,c,p),"createSandbox"),status:d(async c=>{if(typeof c!="string")return t.updateSandboxRuntimeStatus(e,c);let p=await t.getSandboxRuntime(e);return t.updateSandboxRuntimeStatus(e,{status:c,expectedVersion:p.version})},"status"),events:d(()=>t.listSandboxRuntimeEvents(e),"events"),event:d(c=>t.emitSandboxRuntimeEvent(e,c),"event"),recordCommit:d((c,p={})=>t.emitSandboxRuntimeEvent(e,{...p,type:p.type??"git.commit",commitSha:c}),"recordCommit"),checkpointHint:d((c={})=>t.emitSandboxRuntimeEvent(e,{type:"workflow.checkpoint_hint",summary:c.summary??c.reason??"Workflow checkpoint hint",payload:{...c.payload,reason:c.reason??null},artifactRefs:c.artifactRefs,lifecycleHint:{kind:"checkpoint",reason:c.reason??null}}),"checkpointHint"),waitForUser:d(async(c={})=>{await t.emitSandboxRuntimeEvent(e,{type:"workflow.waiting_for_user",summary:c.summary??c.reason??"Waiting for user",payload:{...c.payload,reason:c.reason??null},lifecycleHint:{kind:"waiting_for_user",reason:c.reason??null}});let p=await t.getSandboxRuntime(e);return p.status==="waiting_for_user"?p:t.updateSandboxRuntimeStatus(e,{status:"waiting_for_user",expectedVersion:p.version,summary:c.summary??c.reason,metadata:{workflowWaitForUserReason:c.reason??null}})},"waitForUser"),keepAlive:d((c={})=>{let p=fn(c);return t.emitSandboxRuntimeEvent(e,{type:"workflow.keepalive",summary:c.summary??c.reason??"Workflow keepalive",payload:{...c.payload,reason:c.reason??null,keepaliveUntil:p},lifecycleHint:{kind:"keepalive",reason:c.reason??null,keepaliveUntil:p}})},"keepAlive"),checkpoint:d(c=>t.checkpointSandboxRuntime(e,c),"checkpoint"),files:{write:d(async(c,p)=>t.uploadFile((await o()).id,c,p),"write"),read:d(async c=>t.downloadFile((await o()).id,c),"read"),readResponse:d(async c=>t.downloadFileResponse((await o()).id,c),"readResponse"),list:d(async(c={})=>t.listFiles((await o()).id,c),"list"),delete:d(async(c,p={})=>t.deleteFile((await o()).id,c,p),"delete"),search:d(async c=>t.searchFiles((await o()).id,c),"search"),stat:d(async c=>t.statFile((await o()).id,c),"stat"),mkdir:d(async c=>t.mkdir((await o()).id,c),"mkdir"),move:d(async c=>t.moveFile((await o()).id,c),"move")},commands:{run:d(async c=>t.exec((await o()).id,typeof c=="string"?{command:c}:c),"run")},ports:{expose:d(async c=>t.openPort((await o()).id,typeof c=="number"?{port:c}:c),"expose")},promote:d((c,p={})=>t.promoteSandboxRuntime(e,c,p),"promote"),preserveSource:d((c={},p={})=>t.preserveSandboxRuntimeSource(e,c,p),"preserveSource"),archive:d(async c=>{let p=c??(await t.getSandboxRuntime(e)).version;return t.updateSandboxRuntimeStatus(e,{status:"archived",expectedVersion:p})},"archive")}}d(hn,"createSandboxRuntimeHandle");function fn(t){if(t?.until instanceof Date)return t.until.toISOString();if(typeof t?.until=="string"&&t.until.trim())return new Date(t.until).toISOString();let e=typeof t?.seconds=="number"&&Number.isFinite(t.seconds)?Math.max(1,Math.trunc(t.seconds)):60;return new Date(Date.now()+e*1e3).toISOString()}d(fn,"runtimeKeepaliveUntilIso");async function yn(t,e={}){let n=`openpond-code-smoke-${Date.now()}`,r=`openpond-code-exec-ok:${n}`,o=`openpond-code-preview-ok:${n}`,s=`openpond-code-file-ok:${n}`,i=4173,u=null,c=null,p=!1,I=!1;try{let l=await Ye(t,await t.create({repo:e.repo??"https://github.com/octocat/Hello-World",resources:{cpu:e.cpu??1,memoryGb:e.memoryGb??1,diskGb:e.diskGb??8},budget:{maxUsd:e.budgetUsd??"0.05"},quotas:{maxSpendUsd:e.budgetUsd??"0.05",maxDurationSeconds:600,idleTimeoutSeconds:600,maxOpenPorts:2},metadata:{runId:n,source:"openpond-code-sandbox-smoke"}},{async:!0}));u=l.id;let g=e.expectedMppMode;if(g&&l.reservation.mpp?.mode!==g)throw new Error(`expected ${g} reservation, got ${l.reservation.mpp?.mode??"none"}`);if(!g&&!l.reservation.mpp?.mode)throw new Error("expected sandbox reservation MPP metadata");let P=await t.exec(l.id,{command:[`printf '${r}\\n'`,"test -f README && printf 'repo-clone-ok\\n'","cat > server.cjs <<'EOF'","const { createServer } = require('node:http');",`createServer((_request, response) => response.end('${o}')).listen(${i}, '0.0.0.0');`,"EOF","nohup node server.cjs > server.log 2>&1 & sleep 1"].join(`
|
|
3
3
|
`),timeoutSeconds:120});if(P.command.status!=="succeeded")throw new Error(`expected command success, got ${P.command.status}`);if(!P.command.output.includes(r))throw new Error("expected exec marker");if(await t.uploadFile(l.id,"openpond-code-smoke.txt",s),await t.downloadFile(l.id,"openpond-code-smoke.txt")!==s)throw new Error("expected file roundtrip marker");let U=null;if(e.snapshot||e.fork){let A=await t.createSnapshot(l.id,{async:!0,name:`openpond-code-smoke-${n}`,replay:{entrypoints:[{command:"cat openpond-code-smoke.txt",name:"default"}],retention:{class:"pinned"},safety:{cleanup:"delete",idleTimeoutSeconds:600,internetEgress:"block",maxDurationSeconds:600,maxSpendUsd:e.budgetUsd??"0.05",publicPreview:!1},validation:{commands:[{command:"test -f openpond-code-smoke.txt"}]}}}),{snapshot:R}=await In(t,l.id,A.snapshotJob.snapshotId);if(U=R.id,R.state!=="ready")throw new Error(`expected ready snapshot, got ${R.state}`)}if(e.fork){if(!U)throw new Error("expected snapshot id before fork");let A=await Ye(t,(await t.forkSnapshot(U,{budget:{maxUsd:e.budgetUsd??"0.05"},metadata:{source:"openpond-code-sandbox-smoke-fork",templateSnapshotId:U}},{async:!0})).sandbox);c=A.id;let R=await t.exec(A.id,{command:"cat openpond-code-smoke.txt",timeoutSeconds:120});if(R.command.status!=="succeeded")throw new Error(`expected fork command success, got ${R.command.status}`);if(!R.command.output.includes(s))throw new Error("expected fork snapshot marker");e.keep||(await fe(t,A.id),I=!0)}let j=null;if(e.preview!==!1){let A=await t.openPort(l.id,{label:"openpond-code-smoke",port:i}),R=await fetch(A.preview.url);j=R.status;let $t=await R.text();if(R.status!==200)throw new Error(`expected preview HTTP 200, got ${R.status}`);if(!$t.includes(o))throw new Error("expected preview marker")}let{sandbox:T,receipts:ne}=await gn(t,l.id);return e.keep||(await fe(t,l.id),p=!0),{deleted:p,execOutput:P.command.output.trim(),fileRoundtrip:!0,forkSandboxId:c,previewStatus:j,receiptRefs:ne.map(A=>A.mpp.receiptRef??null),reservationRef:l.reservation.mpp?.reservationRef??null,runId:n,sandboxId:l.id,snapshotId:U,state:T.state}}finally{c&&!e.keep&&!I&&await Ve(t,c),u&&!e.keep&&!p&&await Ve(t,u)}}d(yn,"runSandboxSmoke");async function gn(t,e){try{await t.stop(e)}catch{await t.stop(e,{async:!0})}let n=await Qe(t,e,new Set(["stopped","deleted"]),"stop"),r=await bn(t,e);if(r.length===0)throw new Error("expected receipt readback");return{sandbox:n,receipts:r}}d(gn,"stopSandboxForSmoke");async function fe(t,e){try{let n=await t.delete(e);if(n.state==="deleted")return n;await t.delete(e,{async:!0})}catch{await t.delete(e,{async:!0})}return Qe(t,e,new Set(["deleted"]),"delete")}d(fe,"deleteSandboxForSmoke");async function Ve(t,e){try{await fe(t,e)}catch{await t.delete(e,{async:!0}).catch(()=>{})}}d(Ve,"cleanupSandboxBestEffort");async function Qe(t,e,n,r){let i=Date.now()+3e5,u=await t.get(e);for(;Date.now()<i;){if(n.has(u.state))return u;if(u.state==="error")throw new Error(`sandbox ${r} failed: ${e}`);await X(3e3),u=await t.get(e)}throw new Error(`sandbox ${r} did not reach ${[...n].join("/")} before timeout: ${e} (${u.state})`)}d(Qe,"waitForSandboxState");async function bn(t,e){let o=Date.now()+12e4,s=await t.receipts(e);for(;Date.now()<o;){if(s.length>0)return s;await X(3e3),s=await t.receipts(e)}return s}d(bn,"waitForReceipts");async function Ye(t,e){if(e.state==="running"||e.state==="stopped")return e;if(e.state==="error")throw new Error(`sandbox create failed: ${e.id}
|
|
4
4
|
${e.logs.join(`
|
|
5
5
|
`)}`);let n=12*6e4,r=3e3,o=Date.now()+n,s=e;for(;Date.now()<o;){if(await X(r),s=await t.get(e.id),s.state==="running"||s.state==="stopped")return s;if(s.state==="error")throw new Error(`sandbox create failed: ${s.id}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as ne}from"./chunk-
|
|
2
|
+
import{a as ne}from"./chunk-Z5R4OSGC.js";import{a as we}from"./chunk-QKGNAYSC.js";import{h as Te}from"./chunk-GR4MJJCE.js";import{y as he,z as Re}from"./chunk-GG6PM7TB.js";import{Ca as ae,Da as X,Fa as se,L as fe,Ma as ve,N as ue,O as z,R as Q,S as te,T as me,U as ge,ka as ke,wa as A}from"./chunk-BYVE4TMU.js";import{D as pe,H as F,N as U,U as J,j as u,x as q}from"./chunk-3VT2PPKW.js";import{L as R,M,N as $,O as b,S as V,ba as le,mb as W}from"./chunk-ZEOYNUHL.js";import{Ra as oe,Wa as ee,ab as de,bb as ce,ga as G}from"./chunk-ZY32SZ2P.js";import{a as g}from"./chunk-FTQLQJQV.js";import{createHash as Me}from"node:crypto";function w(e,s,a,n){let t=W[a].parse(n),r=e.get("SELECT payload FROM learning_revisions WHERE scope = ? AND kind = ? AND id = ? AND revision = ?",[s,a,t.id,t.revision]);if(r){if(u(JSON.parse(r.payload))!==u(t))throw new Error(`Starter dependency conflicts with an existing revision: ${t.id}.`);return}e.run("INSERT INTO learning_revisions (scope, kind, id, revision, payload) VALUES (?, ?, ?, ?, ?)",[s,a,t.id,t.revision,JSON.stringify(t)]),e.run(`INSERT INTO learning_resources (scope, kind, id, revision) VALUES (?, ?, ?, ?)
|
|
3
3
|
ON CONFLICT (scope, kind, id) DO UPDATE SET revision = excluded.revision
|
|
4
4
|
WHERE learning_resources.revision < excluded.revision`,[s,a,t.id,t.revision])}g(w,"importStarterReleaseInTransaction");function Se(e,s,a){function n(o,d){let k=e.get("SELECT payload FROM learning_revisions WHERE scope = ? AND kind = ? AND id = ? AND revision = ?",[s,o,d.id,d.revision]);k||D(404,"model_reward_unavailable",`The exact ${o} resource is unavailable in this Profile.`);let l=W[o].parse(JSON.parse(k.payload));return b(l),d.contentHash&&l.contentHash!==d.contentHash&&D(409,"model_reward_changed","The selected resource does not match its immutable content hash."),l}g(n,"read");let t=n("binding",a),r=[...new Map(t.sources.map(o=>[u(o.reward),n("reward",o.reward)])).values()],i=new Map;for(let o of r){let d=o.implementation;for(let k of[...o.assets,..."verifierRef"in d?[d.verifierRef]:[],..."rubricRef"in d?[d.rubricRef]:[],..."inputContract"in d?[d.inputContract]:[]])i.has(k.id)||i.set(k.id,n("asset",{id:k.id,revision:1})),V(i.get(k.id),k)}return{rewardBinding:t,rewards:r,assets:[...i.values()]}}g(Se,"readSelectedModelReward");function Y(e,s,a,n){let t=q.parse(s.metadata.rewardBinding),r=g((c,f)=>{let H=e.get("SELECT payload FROM learning_revisions WHERE scope = ? AND kind = ? AND id = ? AND revision = ?",[s.profileId,c,f.id,f.revision]);H||D(404,"model_reward_unavailable",`The exact ${c} resource is unavailable in this Profile.`);let m=W[c].parse(JSON.parse(H.payload));return b(m),f.contentHash&&m.contentHash!==f.contentHash&&D(409,"model_reward_changed","The selected resource does not match its immutable content hash."),m},"read"),i=r("definition",q.parse(s.metadata.taskDefinition));(u(s.policy)!==u(i.execution.policy)||u(s.environment.metadata.portableEnvironment)!==u(i.execution.environment)||u(s.environment.metadata.portableTools)!==u(i.execution.tools))&&D(409,"model_taskset_context_changed","Taskset context differs from its immutable task definition.");let o=r("binding",t),d=[...new Map(o.sources.map(c=>[u(c.reward),r("reward",c.reward)])).values()];s.metadata.rewardExecution!==void 0&&u(s.metadata.rewardExecution)!==u({binding:o,rewards:d})&&D(409,"model_taskset_rewards_changed","Taskset embedded Rewards differ from their immutable binding.");let k=r("binding",a),l=[...new Map(k.sources.map(c=>[u(c.reward),r("reward",c.reward)])).values()],T=new Map((n?.modelResources?.assets??[]).map(c=>[c.id,c])),v=g(c=>{T.has(c)||T.set(c,r("asset",{id:c,revision:1}))},"addAsset");for(let c of[...d,...l]){let f=c.implementation;for(let H of[...c.assets,..."verifierRef"in f?[f.verifierRef]:[],..."rubricRef"in f?[f.rubricRef]:[],..."inputContract"in f?[f.inputContract]:[]])v(H.id)}let h,S=me.shape.executionResources.parse(s.environment.metadata.portableExecutionResources);if(i.execution.environment.entrypoint==="openpond.javascript-environment.v1"){let c=r("asset",{id:ue(i.execution),revision:1});h=fe.parse(JSON.parse(V(c,c.asset)));for(let f of[h.javascript.module,h.environment.actionSchemaRef,h.environment.observationSchemaRef,h.environment.stateSchemaRef])f&&v(f.id)}for(let c of s.tasks)c.privilegedContextRef&&v(c.privilegedContextRef);u(s.graders)!==u(X(o,d,[...T.values()]))&&D(409,"model_taskset_graders_changed","Taskset graders differ from their immutable Reward binding.");let N=G.parse($({schemaVersion:"openpond.tasksetRelease.v2",id:s.id,revision:s.revision,...i.execution,graders:ce(o,d),...s.metrics?{metrics:s.metrics}:{},tasks:s.tasks.map(c=>{let f=ve(c);return c.requiredOutputs===void 0&&c.metadata.portableTaskRecord===void 0&&delete f.requiredOutputs,f}),metadata:s.metadata.derivedPortableMetadata??{localSource:R(s),starter:{taskDefinition:R(i),rewardBinding:t}}}));return{sourcePackage:n?{...n.modelResources,taskset:n.taskset,executionResources:{environment:n.environment,verifierSet:n.verifierSet}}:{taskset:N,taskDefinition:i,rewardBinding:o,rewards:d,assets:[...T.values()],...S?{executionResources:S}:{},...h?{execution:h}:{}},selectedBinding:k,selectedRewards:l,assets:T}}g(Y,"readModelTasksetSource");function D(e,s,a){throw new J(e,{schemaVersion:"openpond.modelProjectApiError.v2",code:s,message:a,retryable:!1,requestId:null,details:{}})}g(D,"fail");function re(e){if(e?.metadata.learning===void 0)return null;let s=le.parse(e.metadata.learning);return b(s.definition),de(s.binding,s.rewards),M(s.definition.rewardBinding,R(s.binding))||x(409,"model_batch_binding_changed","Reviewed task definition and Reward binding do not match."),s.binding}g(re,"reviewedTasksetRewardBinding");function it(e,s,a=!0,n){let t=U(s),{project:r}=t,i=e.get("SELECT payload FROM model_projects WHERE id = ?",[r.id]),o=i?F.parse(JSON.parse(i.payload)):null;o&&o.profileId!==r.profileId&&x(404,"model_not_found","Model is not available in this Profile."),(o?.revision??0)!==t.expectedRevision&&x(409,"model_revision_conflict","Model changed since it was opened. Refresh before saving.");let d=r.trainingSetup.tasksetRef;if(!d||!r.trainingSetup.rewardBindingRef)return null;let k=e.get("SELECT payload FROM taskset_revisions WHERE taskset_id = ? AND revision = ?",[d.id,d.revision]),l=k?A.parse(JSON.parse(k.payload)):null;(!l||l.profileId!==r.profileId)&&x(404,"model_taskset_not_found","The selected Taskset revision is not available in this Profile."),(l.contentHash!==d.contentHash||ae(l)!==l.contentHash)&&x(409,"model_taskset_changed","The selected Taskset does not match its immutable content hash.");let T=re(l);if(T)return M(R(T),r.trainingSetup.rewardBindingRef)||x(422,"model_batch_reward_review_required","Changing a reviewed batch's Reward requires regrading and a new reviewed batch."),null;let v=l.metadata.rewardBinding===void 0?null:q.parse(l.metadata.rewardBinding);if(v&&M(v,r.trainingSetup.rewardBindingRef))return null;if(!v&&n&&!n.modelResources&&!n.learningResources){let p=Se(e,r.profileId,r.trainingSetup.rewardBindingRef),_=Te({owner:{scopeId:r.profileId,modelId:r.id},source:n,...p}),O=_e(e,t,a),P=se({package:_,profileId:r.profileId,name:l.name,createdAt:O.created_at});P.taskset=ne(P.taskset,l);let L={..._.modelResources,taskset:_.taskset,executionResources:{environment:_.environment,verifierSet:_.verifierSet}};return{taskset:P.taskset,generatedFiles:P.generatedFiles,directoryId:String(P.taskset.environment.metadata.runtimeSourceTasksetId),source:l,sourcePackage:null,derived:L,imported:P}}v||x(422,"model_taskset_derivation_unavailable","This Taskset needs an authored task definition and Reward binding before its Reward can be changed.");let{sourcePackage:h,selectedBinding:S,selectedRewards:N,assets:I}=Y(e,l,r.trainingSetup.rewardBindingRef,n),c=te.safeParse(h.taskset.metadata.modelTasksetDerivation),H=o?.hosted?.apiOrigin&&o.hosted.tasksets.some(p=>{if(!c.success||p.localTasksetId!==l.id||!p.packageHash||!p.localTasksetHash)return!1;let _=e.get("SELECT payload FROM taskset_revisions WHERE taskset_id = ? AND content_hash = ? AND profile_id = ?",[l.id,p.localTasksetHash,r.profileId]),O=_?A.parse(JSON.parse(_.payload)):null;if(!O||O.contentHash!==p.localTasksetHash)return!1;let P=e.get("SELECT payload FROM learning_revisions WHERE scope = ? AND kind = 'package' AND id = ? AND revision = ?",[r.profileId,p.releaseId,p.releaseRevision]),L=P?G.parse(JSON.parse(P.payload)):null,y=te.safeParse(L?.metadata.modelTasksetDerivation);return L?.contentHash===p.releaseHash&&y.success&&u(y.data.owner)===u(c.data.owner)&&M(y.data.root,c.data.root)})&&c.success&&c.data.owner.modelId===r.id?c.data.owner:{scopeId:r.profileId,modelId:r.id},m=ge({owner:H,source:h,rewardBinding:S,rewards:N,assets:[...I.values()]}),K=_e(e,t,a);if(n){let p=new Map(n.files.map(B=>[B.asset.id,B]));for(let B of m.assets)p.set(B.id,{asset:B.asset,base64:Buffer.from(B.text).toString("base64")});let{taskset:_,executionResources:O,...P}=m;if(!O)throw new Error("Derived imported package is missing execution resources.");let L=ke({schemaVersion:"openpond.tasksetPackage.v1",taskset:_,...O,modelResources:P,files:[...p.values()]}),y=se({package:L,profileId:r.profileId,name:l.name,createdAt:K.created_at});return y.taskset=ne(y.taskset,l),{taskset:y.taskset,generatedFiles:y.generatedFiles,directoryId:String(y.taskset.environment.metadata.runtimeSourceTasksetId),source:l,sourcePackage:h,derived:m,imported:y}}let ie=`${m.taskset.id}-r${m.taskset.revision}-${$({packageHash:m.taskset.contentHash,preparedAt:K.created_at}).contentHash}`,j=he(l,K.created_at),ye=new Map(m.taskset.tasks.map(p=>[p.id,p])),Z=[];for(let p of m.taskset.graders)if(p.kind==="custom_verifier"){let _=p.verifierRef.path;Z.some(O=>O.path===_)||Z.push({path:_,role:"verifier",content:V(I.get(p.verifierRef.id),p.verifierRef)})}let C=Re({tasksetId:m.taskset.id,now:K.created_at,sourcePackageHash:m.taskset.contentHash,draft:{...j,policy:m.taskset.policy,tasks:j.tasks.map(p=>({...p,metadata:{...p.metadata,portableTaskRecord:ye.get(p.id)}})),environment:{...j.environment,metadata:{...j.environment.metadata,runtimeSourceTasksetId:ie,portableExecutionResources:m.executionResources}},graders:X(S,N,[...I.values()]),learningSignals:{...j.learningSignals,rewards:j.learningSignals.rewards.map(p=>({...p,rules:[{id:S.id,points:1,condition:"Execute the published Reward binding with its declared normalization, weights and required gates."}],artifactRef:S.id,metadata:{...p.metadata,rewardBinding:R(S)}}))},metadata:{...j.metadata,portableCapabilities:m.taskset.capabilities,taskDefinition:R(m.taskDefinition),rewardBinding:R(S),rewardExecution:{binding:S,rewards:N},derivedPortableMetadata:m.taskset.metadata,modelTasksetDerivation:m.taskset.metadata.modelTasksetDerivation}}});if(C.metrics=m.taskset.metrics,m.taskset.metadata.tasksetOutputContract===void 0?delete C.metadata.tasksetOutputContract:C.metadata.tasksetOutputContract=m.taskset.metadata.tasksetOutputContract,C.contentHash=ae(C),C.revision!==m.taskset.revision)throw new Error("Derived local and portable Taskset revisions differ.");return{taskset:C,generatedFiles:Z,directoryId:ie,source:l,sourcePackage:h,derived:m}}g(it,"prepareModelTasksetSave");function Pe(e,s,a){let n=s.project.profileId;for(let o of[a.sourcePackage,a.derived]){if(!o)continue;for(let k of o.assets)w(e,n,"asset",k);for(let k of o.rewards)w(e,n,"reward",k);w(e,n,"binding",o.rewardBinding),w(e,n,"package",o.taskset),w(e,n,"definition",o.taskDefinition);let d=o.executionResources??o.execution;d&&w(e,n,"asset",Q(d)),o.execution&&w(e,n,"asset",z(o.execution))}let t=a.taskset;e.get("SELECT content_hash FROM taskset_revisions WHERE taskset_id = ? AND revision = ?",[t.id,t.revision])&&x(409,"model_taskset_revision_conflict","The derived Taskset revision was already published. Refresh before saving.");let i=JSON.stringify(t);e.run("INSERT INTO tasksets (id, profile_id, status, payload, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?) ON CONFLICT(id) DO UPDATE SET status = excluded.status, payload = excluded.payload, updated_at = excluded.updated_at",[t.id,n,t.status,i,t.createdAt,t.updatedAt]),e.run("INSERT INTO taskset_revisions (taskset_id, revision, content_hash, profile_id, status, payload, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?)",[t.id,t.revision,t.contentHash,n,t.status,i,t.createdAt,t.updatedAt]),e.run("UPDATE model_project_taskset_preparations SET state = 'committed' WHERE profile_id = ? AND operation_id = ?",[n,s.operationId])}g(Pe,"commitPreparedModelTaskset");function _e(e,s,a){let n=Me("sha256").update(u(s)).digest("hex"),t=s.project.profileId;a&&e.run("INSERT OR IGNORE INTO model_project_taskset_preparations (profile_id, operation_id, request_hash, created_at, state) VALUES (?, ?, ?, ?, 'preparing')",[t,s.operationId,n,new Date().toISOString()]);let r=e.get("SELECT request_hash, created_at FROM model_project_taskset_preparations WHERE profile_id = ? AND operation_id = ?",[t,s.operationId])??{request_hash:n,created_at:new Date().toISOString()};return r.request_hash!==n&&x(409,"model_operation_conflict","This save operation was already used with different Model configuration."),r}g(_e,"recordModelTasksetPreparation");function x(e,s,a){throw new J(e,{schemaVersion:"openpond.modelProjectApiError.v2",code:s,message:a,retryable:!1,requestId:null,details:{}})}g(x,"fail");import{createHash as Ee}from"node:crypto";function Ie(e,s){let a=U(s),n=e.get("SELECT request_hash, payload FROM model_project_save_operations WHERE profile_id = ? AND operation_id = ?",[a.project.profileId,a.operationId]);if(!n)return null;let t=Ee("sha256").update(u(a)).digest("hex");return n.request_hash!==t&&E(409,"model_operation_conflict","This save operation was already used with different Model configuration."),F.parse(JSON.parse(n.payload))}g(Ie,"findModelProjectSave");function ht(e,s,a,n){e.exec("BEGIN IMMEDIATE");try{let t=Oe(e,s,a,n);return e.exec("COMMIT"),t}catch(t){throw e.exec("ROLLBACK"),t}}g(ht,"commitModelProjectSave");function Oe(e,s,a,n){let t=U(s);t.learning&&E(422,"model_learning_hosted_required","Create this Model in a hosted workspace to enable continual learning.");let r=Ee("sha256").update(u(t)).digest("hex"),{project:i,operationId:o,expectedRevision:d}=t,k=Ie(e,t);if(k)return k;let l=e.get("SELECT payload FROM model_projects WHERE id = ?",[i.id]),T=l?F.parse(JSON.parse(l.payload)):null;T&&T.profileId!==i.profileId&&E(404,"model_not_found","Model is not available in this Profile."),(T?.revision??0)!==d&&E(409,"model_revision_conflict","Model changed since it was opened. Refresh before saving.");let v=xe(e,t),h=re(v);h||Ne(e,t);let S=h?R(h):v?.metadata.rewardBinding===void 0?null:q.parse(v.metadata.rewardBinding);v&&i.trainingSetup.rewardBindingRef&&(!S||!M(S,i.trainingSetup.rewardBindingRef))&&!a&&E(409,"model_taskset_preparation_required","Changing this Reward requires publishing its model-owned Taskset revision."),a&&((!i.trainingSetup.tasksetRef||!M(i.trainingSetup.tasksetRef,R(a.source))||!i.trainingSetup.rewardBindingRef||!M(i.trainingSetup.rewardBindingRef,R(a.derived.rewardBinding)))&&E(409,"model_taskset_preparation_changed","The prepared Taskset differs from the selected configuration."),Pe(e,t,a));let N=new Date().toISOString(),I=pe.parse({...i.trainingSetup,baseModel:i.trainingSetup.baseModel??i.defaultBaseModel,method:i.trainingSetup.method??(v?.authoringProvenance.buildIntent==="verifiable_reward"?"grpo":v?.authoringProvenance.buildIntent==="demonstrations"?"sft":null),...S?{rewardBindingRef:S}:{},...a?{rewardBindingRef:R(a.derived.rewardBinding),tasksetRef:R(a.taskset),tasksetRelease:null,recipe:null,...i.trainingSetup.evaluationTasksetRef&&M(i.trainingSetup.evaluationTasksetRef,R(a.source))?{evaluationTasksetRef:R(a.taskset)}:{}}:{}}),c=a?.derived??n??(v&&!h&&I.rewardBindingRef&&v.metadata.taskDefinition!==void 0&&v.metadata.rewardBinding!==void 0?Y(e,v,I.rewardBindingRef).sourcePackage:void 0),f=F.parse({...T,...i,trainingSetup:c?we({setup:I,package:c}):I,schemaVersion:"openpond.modelProject.v2",revision:d+1,hosted:T?.hosted??null,tasksetSyncs:T?.tasksetSyncs??[],createdAt:T?.createdAt??N,updatedAt:N});return e.run(`INSERT INTO model_projects (id, profile_id, payload, created_at, updated_at) VALUES (?, ?, ?, ?, ?)
|
|
5
5
|
ON CONFLICT(id) DO UPDATE SET payload = excluded.payload, updated_at = excluded.updated_at`,[f.id,f.profileId,JSON.stringify(f),f.createdAt,f.updatedAt]),e.run("INSERT INTO model_project_save_operations (profile_id, operation_id, request_hash, payload) VALUES (?, ?, ?, ?)",[f.profileId,o,r,JSON.stringify(f)]),f}g(Oe,"saveModelProjectInTransaction");function xe(e,s){let a=s.project.trainingSetup.tasksetRef;if(!a){s.project.trainingSetup.tasksetRelease&&E(400,"model_taskset_required","Choose the Taskset corresponding to this release.");return}let n=e.get("SELECT payload FROM taskset_revisions WHERE taskset_id = ? AND revision = ?",[a.id,a.revision]),t=n?A.parse(JSON.parse(n.payload)):null;return(!t||t.profileId!==s.project.profileId)&&E(404,"model_taskset_not_found","The selected Taskset revision is not available in this Profile."),t.contentHash!==a.contentHash&&E(409,"model_taskset_changed","The selected Taskset does not match its immutable content hash."),t}g(xe,"assertTaskset");function Ne(e,s){let a=s.project.trainingSetup.rewardBindingRef;if(!a)return;function n(r,i){let o=e.get("SELECT payload FROM learning_revisions WHERE scope = ? AND kind = ? AND id = ? AND revision = ?",[s.project.profileId,r,i.id,i.revision]);o||E(404,"model_reward_unavailable","The exact Reward configuration is unavailable in this Profile.");let d=(r==="binding"?ee:oe).parse(JSON.parse(o.payload));return d.contentHash!==i.contentHash&&E(409,"model_reward_changed","The selected Reward does not match its immutable content hash."),b(d),d}g(n,"read");let t=ee.parse(n("binding",a));for(let r of t.sources)n("reward",r.reward)}g(Ne,"assertReward");function E(e,s,a){throw new J(e,{schemaVersion:"openpond.modelProjectApiError.v2",code:s,message:a,retryable:!1,requestId:null,details:{}})}g(E,"fail");function Et(e,s){let{taskset:a,package:n}=s,t=a.profileId,r=e.get("SELECT payload FROM taskset_revisions WHERE taskset_id = ? AND revision = ?",[a.id,a.revision]);if(r&&u(A.parse(JSON.parse(r.payload)))!==u(a))throw new Error("Imported Taskset revision conflicts with an existing immutable local revision.");let i=e.get("SELECT payload FROM tasksets WHERE id = ?",[a.id]),o=i?A.parse(JSON.parse(i.payload)):null;if(o&&o.profileId!==t)throw new Error("Imported Taskset belongs to another Profile.");w(e,t,"package",n.taskset);let d=n.modelResources;if(d){w(e,t,"definition",d.taskDefinition),w(e,t,"binding",d.rewardBinding);for(let l of d.rewards)w(e,t,"reward",l);for(let l of d.assets)w(e,t,"asset",l);w(e,t,"asset",Q({environment:n.environment,verifierSet:n.verifierSet})),d.execution&&w(e,t,"asset",z(d.execution))}let k=JSON.stringify(a);r||e.run("INSERT INTO taskset_revisions (taskset_id, revision, content_hash, profile_id, status, payload, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?)",[a.id,a.revision,a.contentHash,t,a.status,k,a.createdAt,a.updatedAt]),(!o||o.revision<a.revision)&&e.run("INSERT INTO tasksets (id, profile_id, status, payload, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?) ON CONFLICT(id) DO UPDATE SET status = excluded.status, payload = excluded.payload, updated_at = excluded.updated_at",[a.id,t,a.status,k,a.createdAt,a.updatedAt])}g(Et,"importTasksetPackageInTransaction");export{w as a,it as b,Ie as c,ht as d,Oe as e,Et as f};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as F,b as H,d as _}from"./chunk-DRMOHADV.js";import{k as j}from"./chunk-
|
|
2
|
+
import{a as F,b as H,d as _}from"./chunk-DRMOHADV.js";import{k as j}from"./chunk-DNRC6TPJ.js";import{a as R}from"./chunk-2ACX7IW5.js";import{b as P,s as C,t as N,z as x}from"./chunk-YU3C6U5V.js";import{d as U}from"./chunk-L5L3H6CI.js";import{B as D}from"./chunk-2THZ6GZY.js";import{b as I,c as T}from"./chunk-MZKCW6CB.js";import{a as n}from"./chunk-FTQLQJQV.js";import{randomUUID as Pt}from"node:crypto";var ot="https://api.openpond.ai";async function K(t){let e=await R(),o=e.token?.trim();if(!o)throw new Error("OpenPond account API key is required to manage organizations.");let r=rt(e);if(t.type==="list")return m(r,o,"/v1/organizations");if(t.type==="invitations_list")return m(r,o,"/v1/teams/invitations");if(t.type==="invitation_accept"||t.type==="invitation_decline"){let i=t.type==="invitation_accept"?"accept":"decline";return m(r,o,`/v1/teams/invitations/${i}`,{method:"POST",body:JSON.stringify(t.payload??{})})}if(t.type==="create")return m(r,o,"/v1/organizations",{method:"POST",body:JSON.stringify(t.payload??{})});if(t.type==="get")return m(r,o,`/v1/organizations/${encodeURIComponent(t.slug)}`);if(t.type==="update")return m(r,o,`/v1/organizations/${encodeURIComponent(t.slug)}`,{method:"PATCH",body:JSON.stringify(t.payload??{})});if(t.type==="members")return m(r,o,`/v1/organizations/${encodeURIComponent(t.slug)}/members`);if(t.type==="member_upsert")return m(r,o,`/v1/organizations/${encodeURIComponent(t.slug)}/members`,{method:"POST",body:JSON.stringify(t.payload??{})});if(t.type==="mcp_get")return m(r,o,`/v1/organizations/${encodeURIComponent(t.slug)}/mcp-server`);if(t.type==="mcp_generate")return m(r,o,`/v1/organizations/${encodeURIComponent(t.slug)}/mcp-server`,{method:"POST",body:JSON.stringify(t.payload??{})});if(t.type==="mcp_rotate")return m(r,o,`/v1/organizations/${encodeURIComponent(t.slug)}/mcp-server/rotate`,{method:"POST"});if(t.type==="mcp_disable")return m(r,o,`/v1/organizations/${encodeURIComponent(t.slug)}/mcp-server/disable`,{method:"POST"});if(t.type==="mcp_enable")return m(r,o,`/v1/organizations/${encodeURIComponent(t.slug)}/mcp-server/enable`,{method:"POST"});throw new Error(`Unsupported organization action: ${t.type}`)}n(K,"organizationRequestPayload");async function m(t,e,o,r={}){let i=await I(t,e,o,r),a=await i.json().catch(()=>({}));if(!i.ok){let l=typeof a.message=="string"?a.message:typeof a.error=="string"?a.error:i.statusText;throw new Error(l)}return a}n(m,"openPondApiRequest");function rt(t){return S(process.env.OPENPOND_API_URL)??S(t.apiBaseUrl)??S(t.account?.apiBaseUrl)??S(t.config.apiBaseUrl)??M(t.account?.baseUrl)??M(t.config.baseUrl)??ot}n(rt,"resolveApiBaseUrl");function M(t){let e=S(t);if(!e)return null;try{let o=new URL(e);if(o.hostname==="openpond.ai")return"https://api.openpond.ai";if(!o.hostname.startsWith("api.")&&o.hostname.endsWith(".openpond.ai"))return o.hostname=`api.${o.hostname}`,o.origin}catch{return e}return e}n(M,"normalizeOpenPondWebBaseAsApi");function S(t){let e=t?.trim();return e?e.replace(/\/$/,""):null}n(S,"normalizeOptionalUrl");import{promises as y}from"node:fs";import nt from"node:os";import g from"node:path";var at=5e3,it=32*1024*1024,st=250*1024*1024;async function J(t){let e=await O(t),o=await z(e.rootPath),r=[];for(let i of e.files)r.push({path:i.path,type:"file",contentsBase64:(await y.readFile(i.absolutePath)).toString("base64")});return{rootPath:e.rootPath,headCommit:o,entries:r,totalBytes:e.totalBytes,skipped:e.skipped}}n(J,"collectLocalProjectSourceUploadBundle");async function Ft(t){let e=await O(t),o=await z(e.rootPath);return{rootPath:e.rootPath,headCommit:o,fileCount:e.files.length,byteCount:e.totalBytes,skippedCount:e.skipped.length,initializedEmptyProject:e.files.length===0,skipped:e.skipped}}n(Ft,"previewLocalProjectSourceUpload");async function W(t,e){let o=pt(e.branch),r=await O(t),i=await z(r.rootPath);if(t.repoPath&&r.files.length>0&&await ut(r.rootPath))try{return await G({cwd:r.rootPath,repoUrl:e.repoUrl,apiKey:e.apiKey,branch:o}),{rootPath:r.rootPath,branch:o,headCommit:i,fileCount:r.files.length,byteCount:r.totalBytes,skipped:r.skipped,initializedEmptyProject:!1,transport:"git_head"}}catch(c){if(!yt(c))throw c}let a=await y.mkdtemp(g.join(nt.tmpdir(),"openpond-cloud-source-")),l=r.files.length===0;try{return l?await y.writeFile(g.join(a,"README.md"),e.fallbackReadme,"utf8"):await mt(r,a),await gt({cwd:a,branch:o,commitMessage:e.commitMessage,repoUrl:e.repoUrl,apiKey:e.apiKey}),await G({cwd:a,repoUrl:e.repoUrl,apiKey:e.apiKey,branch:o}),{rootPath:r.rootPath,branch:o,headCommit:i,fileCount:l?1:r.files.length,byteCount:l?Buffer.byteLength(e.fallbackReadme,"utf8"):r.totalBytes,skipped:r.skipped,initializedEmptyProject:l,transport:"snapshot"}}finally{await y.rm(a,{recursive:!0,force:!0})}}n(W,"pushLocalProjectSourceToGit");async function O(t){let e=t.repoPath??t.workspacePath,o=t.repoPath?await dt(e):await ct(e),r=[],i=[],a=0;for(let l of o){if(r.length>=at){i.push({path:l,reason:"total_limit"});continue}let c=C(l);if(!c){i.push({path:l,reason:"invalid_path"});continue}if(N(c)&&!q(c)){i.push({path:c,reason:"generated"});continue}let d=g.resolve(e,c),u=g.resolve(e);if(d!==u&&!d.startsWith(`${u}${g.sep}`)){i.push({path:c,reason:"invalid_path"});continue}try{let f=await y.lstat(d);if(!f.isFile()){i.push({path:c,reason:"not_file"});continue}if(f.size>it){i.push({path:c,reason:"too_large",sizeBytes:f.size});continue}if(a+f.size>st){i.push({path:c,reason:"total_limit",sizeBytes:f.size});continue}r.push({path:c,absolutePath:d,sizeBytes:f.size}),a+=f.size}catch{i.push({path:c,reason:"read_error"})}}return{rootPath:e,files:r,totalBytes:a,skipped:i}}n(O,"selectLocalProjectSourceFiles");async function ct(t){let e=await x(t),o=await lt(t);return Array.from(new Set([...e,...o])).sort((r,i)=>r.localeCompare(i))}n(ct,"listLocalProjectSourceUploadFiles");async function lt(t){let e=[],o=g.join(t,".openpond","skills");async function r(i){let a=g.join(t,i),l;try{l=await y.readdir(a,{withFileTypes:!0})}catch{return}l.sort((c,d)=>c.name.localeCompare(d.name));for(let c of l){let d=g.join(i,c.name).replace(/\\/g,"/"),u=C(d);if(u){if(c.isDirectory()){await r(u);continue}c.isFile()&&q(u)&&e.push(u)}}}return n(r,"visit"),await r(g.relative(t,o).replace(/\\/g,"/")),e}n(lt,"listGeneratedSkillSourceUploadFiles");function q(t){let e=C(t);if(!e)return!1;let o=e.split("/"),r=o.indexOf(".openpond");return r>=0&&o[r+1]==="skills"&&o.length>r+3}n(q,"isAllowedGeneratedSourceUploadPath");async function dt(t){let e=await P("git",["ls-files","-z","--cached","--others","--exclude-standard"],t);return e.code!==0?x(t):Array.from(new Set(e.stdout.split("\0").map(o=>o.trim()).filter(Boolean))).sort((o,r)=>o.localeCompare(r))}n(dt,"gitVisibleProjectFiles");function pt(t){let e=t.trim()||"main";if(e.length>120||e.startsWith("/")||e.endsWith("/")||e.includes("..")||!/^[A-Za-z0-9._/-]+$/.test(e))throw new Error("Cloud source branch contains unsupported characters.");return e}n(pt,"normalizeGitBranchName");async function ut(t){if((await P("git",["rev-parse","--verify","HEAD"],t)).code!==0)return!1;let o=await P("git",["status","--porcelain=v1"],t);return o.code===0&&o.stdout.trim().length===0}n(ut,"gitRepoHasCleanHead");async function z(t){let e=await P("git",["rev-parse","--verify","HEAD"],t);return e.code===0&&e.stdout.trim()||null}n(z,"readGitHeadCommit");async function mt(t,e){for(let o of t.files){let r=g.resolve(e,o.path),i=g.resolve(e);r!==i&&!r.startsWith(`${i}${g.sep}`)||(await y.mkdir(g.dirname(r),{recursive:!0}),await y.copyFile(o.absolutePath,r))}}n(mt,"copySelectedFilesToSnapshot");async function gt(t){await w(t.cwd,["init"],"Initialize Cloud source snapshot"),await w(t.cwd,["checkout","-B",t.branch],"Create Cloud source branch"),await w(t.cwd,["config","user.name","OpenPond Desktop"],"Configure Git user"),await w(t.cwd,["config","user.email","desktop@openpond.ai"],"Configure Git email"),await ft({cwd:t.cwd,repoUrl:t.repoUrl,apiKey:t.apiKey,branch:t.branch}),await w(t.cwd,["add","-A"],"Stage Cloud source snapshot"),await w(t.cwd,["commit","-m",t.commitMessage],"Commit Cloud source snapshot")}n(gt,"createSnapshotCommit");async function ft(t){let e=`refs/remotes/openpond/${t.branch}`,o=await V(t.cwd,["fetch","--depth=1",t.repoUrl,`refs/heads/${t.branch}:${e}`],t.apiKey);if(o.code!==0){let r=`${o.stderr}
|
|
3
3
|
${o.stdout}`;if(ht(r))return;throw new Error(`Fetch Cloud source parent failed: ${E(o)}`)}await w(t.cwd,["reset","--mixed",e],"Attach Cloud source snapshot to remote branch")}n(ft,"applyRemoteBranchParent");async function G(t){let e=await V(t.cwd,["push",t.repoUrl,`HEAD:${t.branch}`],t.apiKey);if(e.code!==0)throw new Error(`Push Cloud source to OpenPond Git failed: ${E(e)}`)}n(G,"pushGitHead");async function V(t,e,o){let r=Buffer.from(`openpond:${o}`,"utf8").toString("base64");return P("git",["-c",`http.extraHeader=Authorization: Basic ${r}`,...e],t)}n(V,"runGitWithAuth");function yt(t){let e=t instanceof Error?t.message:String(t);return e.includes("non-fast-forward")||e.includes("fetch first")||e.includes("remote contains work that you do not")}n(yt,"isNonFastForwardPushError");function ht(t){return t.includes("couldn't find remote ref")||t.includes("could not find remote ref")||t.includes("Remote branch")&&t.includes("not found")}n(ht,"isMissingRemoteRefOutput");function E(t){return(t.stderr||t.stdout||"Git command failed").trim().replace(/\s+/g," ").slice(0,500)}n(E,"formatGitError");async function w(t,e,o){let r=await P("git",e,t);if(r.code!==0)throw new Error(`${o} failed: ${E(r)}`)}n(w,"runGitOrThrow");var wt=new Set(["github_repo","internal_repo","template","manual"]);function Jt(t,e){return e&&t.status!=="active"?{...t,status:"active"}:t}n(Jt,"codexHistorySessionWithLiveStatus");async function Wt(){try{let t=p(await K({type:"list"})),e=L(t.organizations),o=(e.length>0?e:L(t.teams)).map(bt).filter(a=>!!a?.teamId),r=await Promise.all(o.map(async a=>{try{let l=p(await j({type:"project_list",payload:{teamId:a.teamId}}));return L(l.projects).map(c=>X(c,a)).filter(c=>!!c)}catch{return[]}})),i=new Map;for(let a of r.flat())i.set(`${a.teamId}:${a.id}`,a);return Array.from(i.values()).sort((a,l)=>{let c=Date.parse(a.updatedAt??"")||0,d=Date.parse(l.updatedAt??"")||0;return c!==d?d-c:a.name.localeCompare(l.name)})}catch{return[]}}n(Wt,"fetchCloudProjects");function bt(t){let e=s(t.teamId)??s(t.id);return e?{teamId:e,slug:s(t.slug),displayName:s(t.displayName)??s(t.name)}:null}n(bt,"normalizeOpenPondOrganization");function X(t,e){let o=s(t.id),r=s(t.teamId)??e.teamId;if(!o||!r||s(t.status)==="archived"||s(t.archivedAt))return null;let a=s(t.name)??s(t.slug)??o,l=$(t.sourceType);return{id:o,teamId:r,name:a,slug:s(t.slug),sourceType:l,sourceLabel:Y(t,l),defaultBranch:s(t.defaultBranch)??s(t.gitBranch),internalRepoPath:s(t.internalRepoPath),manifestPath:s(t.sandboxManifestPath),manifestHash:s(t.sandboxManifestHash),syncedAt:s(t.sandboxManifestSyncedAt),organizationName:e.displayName,organizationSlug:e.slug,createdAt:s(t.createdAt),updatedAt:s(t.updatedAt)}}n(X,"normalizeCloudProject");function $(t){return typeof t=="string"&&wt.has(t)?t:"manual"}n($,"normalizeCloudProjectSourceType");function Y(t,e){if(e==="github_repo"){let o=s(t.gitOwner),r=s(t.gitRepo);if(o&&r)return`${o}/${r}`}return e==="internal_repo"?s(t.internalRepoPath)??"Internal repo":e==="template"?s(t.templateRepoUrl)??s(t.templateSourceProjectId)??"Template":s(t.normalizedSourceIdentity)}n(Y,"cloudProjectSourceLabel");function qt(t){return typeof t=="boolean"?t:null}n(qt,"booleanValue");function p(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}n(p,"asRecord");function Vt(t){let e=p(t);return Object.keys(e).length>0?e:null}n(Vt,"nonEmptyRecord");function L(t){return Array.isArray(t)?t.map(p).filter(e=>Object.keys(e).length>0):[]}n(L,"asRecordArray");function s(t){return typeof t=="string"&&t.trim()?t.trim():null}n(s,"stringValue");function Xt(t){if(!t)return null;if(t==="request_only"||t==="coding_core")return t;throw new Error("hostedSourceDispatch must be one of request_only, coding_core.")}n(Xt,"parseHostedSourceDispatch");function jt(t){return Array.isArray(t)?t.filter(e=>typeof e=="string"&&e.trim().length>0).map(e=>e.trim()):[]}n(jt,"stringArrayValue");function Yt(t){let e=t.code===0||t.code===null?"completed":"failed",o=t.stdout.trim()||t.stderr.trim()||`Ran profile action ${t.action}.`,r=[],i=[];try{let a=JSON.parse(t.stdout),l=p(a),c=p(l.result),d=s(c.text)??s(c.summary)??s(c.message);d&&(o=d),r=jt(c.artifactRefs);let u=s(l.traceArtifactRef);i=u?[u]:[]}catch{}return{artifactRefs:r,output:o,responseSummary:{status:e==="completed"?"available":"failed",text:o},status:e,traceArtifactRefs:i}}n(Yt,"profileActionRunSummary");function Zt(t){let e=At(t.name),o=t.id.replace(/^local_/,"").replace(/[^a-z0-9]/gi,"").slice(0,16);return`desktop-${e}-${o||"project"}`}n(Zt,"internalRepoPathForLocalProject");function At(t){return t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||"project"}n(At,"slugifyInternalRepoSegment");async function Qt(t){try{let e=await W(t.localProject,{repoUrl:t.repoUrl,apiKey:t.apiKey,branch:t.branch,commitMessage:t.commitMessage,fallbackReadme:t.fallbackReadme}),o=p(await j({type:"project_sync",projectId:t.targetProjectId,payload:{teamId:t.teamId}}).catch(()=>({})));return{rootPath:e.rootPath,branch:e.branch,headCommit:e.headCommit,fileCount:e.fileCount,byteCount:e.byteCount,skippedCount:e.skipped.length,initializedEmptyProject:e.initializedEmptyProject,transport:e.transport,syncPayload:o}}catch{let e=await J(t.localProject),o=e.entries.length===0,r=o?[{path:"README.md",type:"file",contentsBase64:Buffer.from(t.fallbackReadme,"utf8").toString("base64")}]:e.entries,i=o?Buffer.byteLength(t.fallbackReadme,"utf8"):e.totalBytes,a=p(await j({type:"project_source_upload",projectId:t.targetProjectId,payload:{teamId:t.teamId,entries:r,branch:t.branch,commitMessage:t.commitMessage,metadata:{source:"openpond-app-local-project-cloud-setup",transport:"api_source_upload"}}}));return{rootPath:e.rootPath,branch:t.branch,headCommit:e.headCommit,fileCount:r.length,byteCount:i,skippedCount:e.skipped.length,initializedEmptyProject:o,transport:"api_source_upload",syncPayload:a}}}n(Qt,"uploadLocalProjectCloudSource");async function te(t){try{let e=p(await j({type:"project_get",projectId:t.projectId,payload:{teamId:t.teamId}})),o=p(e.project);return Object.keys(o).length>0?o:t.fallback}catch{return t.fallback}}n(te,"sandboxProjectRecordOrFallback");async function ee(t){let e=p(await j({type:"project_upsert",payload:{teamId:t.teamId,name:t.projectName,sourceType:"internal_repo",normalizedSourceIdentity:t.internalRepoPath,defaultBranch:t.branch,sourceConfig:{sourceType:"internal_repo",sourceValue:t.internalRepoPath},metadata:{source:"openpond-app-local-project-cloud-setup",localProjectId:t.localProjectId}}})),o=p(e.project);if(Object.keys(o).length===0)throw new Error("OpenPond Cloud Project response did not include a project.");return o}n(ee,"upsertInternalSandboxProject");function oe(t,e,o,r){let i=X({...t,teamId:e},{teamId:e,slug:null,displayName:null});if(i)return i;let a=s(t.id);if(!a)throw new Error("OpenPond Cloud Project response did not include a project id.");return{id:a,teamId:e,name:s(t.name)??o,slug:s(t.slug),sourceType:$(t.sourceType),sourceLabel:Y(t,$(t.sourceType)),defaultBranch:s(t.defaultBranch)??s(t.gitBranch)??r,internalRepoPath:s(t.internalRepoPath),manifestPath:s(t.sandboxManifestPath),manifestHash:s(t.sandboxManifestHash),syncedAt:s(t.sandboxManifestSyncedAt),organizationName:null,organizationSlug:null,createdAt:s(t.createdAt),updatedAt:s(t.updatedAt)}}n(oe,"cloudProjectFromSandboxRecord");function re(t){if(!t)return{};let e=St(t.searchParams.get("limit"));return{...e?{maxEvents:e}:{},tail:t.searchParams.get("tail")==="1"}}n(re,"codexHistoryThreadReadOptions");function ne(t){return`${t}_turn_attachment_${Pt()}`}n(ne,"nextCodexHistoryTurnId");function St(t){if(!t)return;let e=Number.parseInt(t,10);if(!(!Number.isFinite(e)||e<=0))return Math.min(5e4,e)}n(St,"positiveIntegerParam");var It={"tools.web_search":!0,"tools.view_image":!0,"features.web_search_request":!0};function ae(t){return{...It,approvals_reviewer:t==="auto-review"?"auto_review":"user"}}n(ae,"codexHistorySessionConfig");import Z from"node:path";import{promises as Rt}from"node:fs";async function ue(t){let e=await Ct(t.workspacePath);return(await Rt.stat(e).catch(()=>null))?.isDirectory()?(await _({projectRoot:t.workspacePath,build:"always"}).catalog()).actions.map(a=>D.parse({...a,sourcePath:t.workspacePath,implementation:{...a.implementation,projectId:t.id,projectRoot:Z.resolve(t.workspacePath)}})):[]}n(ue,"localProjectActionCatalog");async function Q(t){return _({projectRoot:t.projectRoot,build:"always"}).run({actionId:t.actionId,input:t.value,runId:t.runId,idempotencyKey:t.idempotencyKey,signal:t.signal})}n(Q,"runLocalProjectAction");async function Ct(t){try{let e=await H(t);return Z.resolve(t,e.sourceDirectory??"openpond/actions")}catch(e){throw new Error(`Cannot load ${F}: ${e instanceof Error?e.message:String(e)}`)}}n(Ct,"projectActionSourceDirectory");var kt="https://api.openpond.ai";async function B(t={}){let e=await(t.loadAccountContext??R)(),o=e.token?.trim();if(!o)throw new Error("OpenPond account API key is required.");return{apiBaseUrl:_t(e),token:o}}n(B,"resolveHostedApiAccess");async function ye(t={}){return{...await B(t),teamId:Ut(t.teamId)}}n(ye,"resolveManagedAdapterUserAccess");function he(t){let e=new Headers;return t.startsWith("opk_")?(e.set("Authorization",`ApiKey ${t}`),e.set("openpond-api-key",t)):e.set("Authorization",`Bearer ${t}`),e}n(he,"hostedApiAuthHeaders");function _t(t){return k(t.apiBaseUrl)??k(t.account?.apiBaseUrl)??k(t.config.apiBaseUrl)??tt(t.account?.baseUrl)??tt(t.config.baseUrl)??kt}n(_t,"resolveApiBaseUrl");function Ut(t){let e=t?.trim();if(!e||!/^[A-Za-z0-9_-]{3,191}$/.test(e))throw new Error("Select an OpenPond workspace before using OpenPond Managed RL.");return e}n(Ut,"managedAdapterTeamId");function tt(t){let e=k(t);if(!e)return null;try{let o=new URL(e);if(o.hostname==="openpond.ai")return"https://api.openpond.ai";if(!o.hostname.startsWith("api.")&&o.hostname.endsWith(".openpond.ai"))return o.hostname=`api.${o.hostname}`,o.origin}catch{return e}return e}n(tt,"normalizeOpenPondWebBaseAsApi");function k(t){let e=t?.trim();return e?e.replace(/\/$/,""):null}n(k,"normalizeOptionalUrl");async function et(t,e={}){let o=await(e.resolveAccess??B)(),r=await(e.fetch??I)(o.apiBaseUrl,o.token,`/v1/project-actions/${encodeURIComponent(t.projectId)}/actions/${encodeURIComponent(t.actionId)}?teamId=${encodeURIComponent(t.teamId)}`,{method:"POST",body:JSON.stringify({input:t.value,releaseId:t.releaseId,idempotencyKey:t.idempotencyKey,callerType:"work",callerId:t.callerId}),signal:t.signal,timeoutMs:900*1e3}),i=await T(r,"Run hosted Project Action");if(i.invocation.status==="failed")throw new Error(i.invocation.failureMessage||i.invocation.failureCode||"Hosted Project Action failed.");return i.invocation}n(et,"runHostedProjectAction");function _e(t){return n(async function(o){let r=p(o),i=s(r.action)??s(r.actionName);if(!i)throw new Error("Project Action name is required.");let a=p(r.metadata);if(s(a.execution)==="hosted"){let b=await et({projectId:A(a,"projectId"),teamId:A(a,"teamId"),releaseId:A(a,"releaseId"),actionId:i,value:r.input??{},idempotencyKey:s(a.toolCallId)?`${A(a,"turnId")}:${A(a,"toolCallId")}`:void 0,callerId:s(a.turnId)??void 0}),v=s(a.sessionId);return v&&await t.appendRuntimeEvent(U({name:"workspace_action_result",sessionId:v,turnId:A(a,"turnId"),source:"chat_action",action:"project_action_run",appId:null,status:"completed",output:JSON.stringify(b.resultJson),data:{openPondHostedProjectActionRun:!0,action:{name:i,label:s(a.selectedActionLabel)??i},releaseId:b.releaseId,invocationId:b.id,traces:b.traceJson,outputs:b.outputJson}})),b}let l=s(a.projectId);if(!l)throw new Error("Project Action Project id is required.");let c=await t.resolveProjectRoot(l);if(!c)throw new Error("Project Action Project is not registered locally.");let d=s(a.sessionId),u=s(a.turnId)??`openpond_project_action_${Date.now()}`,f=s(a.toolCallId),h=await Q({projectRoot:c,actionId:i,value:r.input??{},runId:f??void 0,idempotencyKey:f?`${u}:${f}`:null});return d&&await t.appendRuntimeEvent(U({name:"workspace_action_result",sessionId:d,turnId:u,source:"chat_action",action:"project_action_run",appId:null,status:"completed",output:JSON.stringify(h.output),data:{openPondProjectActionRun:!0,action:{name:i,label:s(a.selectedActionLabel)??i},runId:h.runId,traces:h.traces,outputs:h.outputs,outputDirectory:h.outputDirectory,durationMs:h.durationMs}})),h},"projectActionRunPayload")}n(_e,"createProjectActionRunPayload");function A(t,e){let o=s(t[e]);if(!o)throw new Error(`Hosted Project Action ${e} is required.`);return o}n(A,"requiredMetadata");export{K as a,Ft as b,Jt as c,Wt as d,qt as e,p as f,Vt as g,s as h,Xt as i,Yt as j,Zt as k,Qt as l,te as m,ee as n,oe as o,re as p,ne as q,ae as r,ue as s,B as t,ye as u,he as v,_e as w};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{F as d}from"./chunk-
|
|
2
|
+
import{F as d}from"./chunk-2THZ6GZY.js";import{a as n}from"./chunk-FTQLQJQV.js";import{access as m,readFile as g}from"node:fs/promises";import{createHash as h}from"node:crypto";import o from"node:path";import{fileURLToPath as w}from"node:url";var i="openpond-taskset-authoring",f="artifact.json",u=o.dirname(w(import.meta.url));async function P(e=process.cwd()){return(await p(e)).bundle}n(P,"loadTasksetAuthoringSkillBundle");async function p(e=process.cwd()){let s=await k(e),t=JSON.parse(await g(o.join(s,f),"utf8"));if(t.schemaVersion!==1||t.skillName!==i||!t.artifactVersion||!t.bundle||!/^[a-f0-9]{64}$/.test(t.contentHash))throw new Error("Bundled Taskset Authoring artifact is invalid.");let{contentHash:r,...a}=t;if(h("sha256").update(JSON.stringify(a)).digest("hex")!==r)throw new Error("Bundled Taskset Authoring artifact hash does not match.");for(let l of t.files)if(h("sha256").update(l.contents).digest("hex")!==l.sha256)throw new Error(`Bundled Taskset Authoring file hash does not match: ${l.path}`);return t}n(p,"loadTasksetAuthoringSkillArtifact");async function S(e=process.cwd()){let s=await k(e),t=await p(e),r=t.bundle,a=d.find(c=>c.name===i);if(!a)throw new Error("Taskset Authoring skill metadata is missing.");return{...a,path:o.join(s,"SKILL.md"),sourcePath:s,charCount:r.length,sourceHash:t.contentHash,validationMessages:[...a.validationMessages],resourceFiles:[...a.resourceFiles]}}n(S,"loadTasksetAuthoringProfileSkill");async function O(e=process.cwd()){let s=await S(e),t=await P(e);return{name:s.name,description:s.description,body:t,path:s.path,sourceHash:s.sourceHash,charCount:s.charCount,packagePath:s.sourcePath,resourceFiles:s.resourceFiles}}n(O,"readTasksetAuthoringProfileSkill");async function k(e=process.cwd(),s=process.execPath){let t=[process.env.OPENPOND_TASKSET_AUTHORING_SKILL_ROOT,o.resolve(e,"apps","cli","skills",i),o.resolve(e,"dist","skills",i),o.resolve(o.dirname(s),"skills",i),o.resolve(u,"skills",i),o.resolve(u,"..","skills",i)].filter(r=>!!r);for(let r of t)if(await m(o.join(r,f)).then(()=>!0,()=>!1))return r;throw new Error(`Bundled Taskset Authoring skill was not found. Checked: ${t.join(", ")}`)}n(k,"resolveTasksetAuthoringSkillRoot");export{p as a,S as b,O as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as P}from"./chunk-2ACX7IW5.js";import{f as O}from"./chunk-
|
|
2
|
+
import{a as P}from"./chunk-2ACX7IW5.js";import{f as O}from"./chunk-2THZ6GZY.js";import{b as A}from"./chunk-OQPJ7FJF.js";import{a as m}from"./chunk-HLJJAOI2.js";import{b as d,e as f}from"./chunk-MZKCW6CB.js";import{a as n}from"./chunk-FTQLQJQV.js";async function N(t,e,r,s={}){let o=await(s.apiFetch??d)(t,e,s.path??A,{method:"POST",signal:s.signal,body:JSON.stringify(r)}),i=await o.json().catch(()=>({})),c=o.status!==404&&o.status!==405&&o.status!==501;return o.ok?{ok:typeof i.ok=="boolean"?i.ok:!0,status:o.status,endpointAvailable:c,output:g(i),data:E(i)}:{ok:!1,status:o.status,endpointAvailable:c,output:g(i)??(c?`Connected app tool call failed with status ${o.status}.`:`Connected app tool-call endpoint is not available (${o.status}).`),data:E(i)}}n(N,"executeConnectedAppToolCall");function g(t){return typeof t.output=="string"&&t.output.trim()?t.output.trim():typeof t.message=="string"&&t.message.trim()?t.message.trim():typeof t.error=="string"&&t.error.trim()?t.error.trim():null}n(g,"responsePayloadMessage");function E(t){return"data"in t?t.data:"result"in t?t.result:null}n(E,"responsePayloadData");var h=A;function z(t={}){let e=t.env??process.env,r=t.apiFetch??d,s=t.loadAccountContext??P;return async(o,i)=>{if(I(e.OPENPOND_CONNECTED_APP_TOOL_EXECUTOR))return l(o.provider,"Cloud connected app execution is disabled.");let c=D(o),C=O.safeParse(c);if(!C.success)return l(o.provider,L(C.error));let u;try{u=await v({env:e,loadAccountContext:s})}catch(a){return l(o.provider,T(a))}try{let a=await N(u.apiBaseUrl,u.apiKey,C.data,{path:u.path,signal:i?.signal,apiFetch:r});return a.endpointAvailable?{ok:a.ok,output:a.output,data:a.data}:l(o.provider,`Cloud connected app connector endpoint is not available (${a.status}).`)}catch(a){if(a instanceof Error&&a.name==="AbortError")throw a;return l(o.provider,`Cloud connected app connector request failed: ${T(a)}`)}}}n(z,"createCloudConnectedAppToolExecutor");async function v(t={}){let e=t.env??process.env,r=y(e.OPENPOND_CONNECTED_APP_TOOL_PATH),s=e.OPENPOND_CONNECTED_APP_API_KEY?.trim()||e.OPENPOND_SANDBOX_API_KEY?.trim()||e.OPENPOND_API_KEY?.trim();if(s)return{apiBaseUrl:_(e,null),apiKey:s,path:r};let i=await(t.loadAccountContext??P)(),c=i.token?.trim();if(!c)throw new Error("OpenPond account API key is required for connected app connector execution.");return{apiBaseUrl:_(e,i.apiBaseUrl),apiKey:c,path:r}}n(v,"resolveCloudConnectedAppToolTarget");function _(t,e){return p(t.OPENPOND_CONNECTED_APP_API_URL)??U(t.OPENPOND_SANDBOX_API_URL)??p(t.OPENPOND_SANDBOX_BASE_URL)??p(t.OPENPOND_API_URL)??p(e)??f}n(_,"resolveCloudConnectedAppApiBaseUrl");function D(t){return{provider:t.provider,operation:t.operation,toolName:t.toolName,sessionId:t.sessionId,turnId:t.turnId,toolCallId:t.toolCallId,userPrompt:t.userPrompt,connectionIds:t.connectionIds,capabilityIds:t.capabilityIds,args:t.args}}n(D,"cloudConnectedAppToolPayload");function U(t){let e=x(t);return e?p(m(e,{apiBaseUrl:e})):null}n(U,"apiBaseUrlFromSandboxApiUrl");function p(t){let e=x(t);if(!e)return null;try{let r=new URL(e);return r.pathname=b(r.pathname),r.search="",r.hash="",r.toString().replace(/\/$/,"")}catch{return e.replace(/\/v1\/sandboxes\/?$/i,"").replace(/\/api\/sandboxes\/?$/i,"").replace(/\/sandboxes\/?$/i,"").replace(/\/v1\/?$/i,"").replace(/\/+$/,"")}}n(p,"normalizeApiBaseUrl");function b(t){let e=t.replace(/\/+$/,"");return e=e.replace(/\/v1\/sandboxes$/i,"").replace(/\/api\/sandboxes$/i,"").replace(/\/sandboxes$/i,"").replace(/\/v1$/i,""),e||"/"}n(b,"normalizeApiBasePath");function x(t){let e=t?.trim();return e?e.replace(/\/+$/,""):null}n(x,"normalizeOptionalUrl");function y(t){let e=t?.trim()||h;return e.startsWith("/")?e:`/${e}`}n(y,"normalizeToolPath");function l(t,e){return{ok:!1,output:`${e} No ${t} provider API call was made.`}}n(l,"connectorUnavailable");function I(t){let e=t?.trim().toLowerCase();return e==="0"||e==="false"||e==="off"||e==="disabled"}n(I,"isDisabled");function L(t){return t.issues?.[0]?.message??"Connected app tool call request is invalid."}n(L,"connectedAppToolCallValidationMessage");function T(t){return t instanceof Error?t.message:"Unknown error"}n(T,"errorMessage");export{h as a,z as b,v as c};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as D,b as J,c as q}from"./chunk-Q3WXB465.js";import{a as Y}from"./chunk-
|
|
2
|
+
import{a as D,b as J,c as q}from"./chunk-Q3WXB465.js";import{a as Y}from"./chunk-UCPD526R.js";import{a as L}from"./chunk-FEAKTSRS.js";import{na as F}from"./chunk-2THZ6GZY.js";import{b as W}from"./chunk-L3KS6MOV.js";import{X as z,x as C}from"./chunk-ZY32SZ2P.js";import{m as N,n as j}from"./chunk-RCT3O3HQ.js";import{A as x}from"./chunk-X2J2P5ZT.js";import{a as i}from"./chunk-FTQLQJQV.js";import{createHash as se}from"node:crypto";function U(a){let d=a.replace(/^\/workspace\/outputs\//,"").replace(/^\/workspace\/work\/outputs\//,"").replace(/^outputs\//,"");if(!d||d.startsWith("/")||d.includes("\0")||d.split(/[\\/]/).some(g=>!g||g==="."||g===".."))throw new Error("Select one file inside this case's writable outputs.");return d}i(U,"confinedProfileOutputPath");var K=i(a=>`'${a.replaceAll("'","'\\''")}'`,"quote");async function V(a){let d=U(a.path),g="const f=require('fs'),p=require('path'),c=require('crypto'),a=JSON.parse(process.argv[1]),r=f.realpathSync('/workspace/work/outputs'),q=f.realpathSync(p.join(r,a.path));if(!q.startsWith(r+'/'))throw Error('Output path escapes the case');const s=f.statSync(q);if(!s.isFile()||s.size>10000000)throw Error('Output exceeds its bound');if(a.offset===undefined){const b=f.readFileSync(q);process.stdout.write(JSON.stringify({size:b.length,hash:c.createHash('sha256').update(b).digest('hex')}))}else{const h=f.openSync(q,'r'),b=Buffer.alloc(Math.min(524288,s.size-a.offset));try{const n=f.readSync(h,b,0,b.length,a.offset);process.stdout.write(b.subarray(0,n).toString('base64'))}finally{f.closeSync(h)}}";async function w(E){let y=await a.command(`/runtime/node -e ${K(g)} ${K(JSON.stringify({path:d,...E!==void 0?{offset:E}:{}}))}`);if(y.code!==0)throw new Error("The confined output could not be read.");return y.stdout}i(w,"read");let b=x.object({size:x.number().int().min(1).max(F),hash:x.string().regex(/^[a-f0-9]{64}$/)}).strict().parse(JSON.parse(await w())),P=[];for(let E=0;E<b.size;E+=524288){let y=await w(E);if(!/^[A-Za-z0-9+/]*={0,2}$/.test(y)||y.length>7e5)throw new Error("Output chunk exceeded its boundary.");let O=Buffer.from(y,"base64");if(O.length!==Math.min(524288,b.size-E))throw new Error("The output changed during readback.");P.push(O)}let R=Buffer.concat(P),k=se("sha256").update(R).digest("hex"),T=x.object({size:x.number(),hash:x.string()}).strict().parse(JSON.parse(await w()));if(k!==b.hash||T.hash!==k||T.size!==R.length)throw new Error("The output changed before immutable readback.");return{bytes:R,title:d.split("/").at(-1)}}i(V,"readConfinedProfileOutput");import l from"node:path";import{promises as m}from"node:fs";import M from"node:path";function X(a,d,g,w){let b=i(()=>new Error("This source file is outside the public policy closure."),"denied"),P;if(a==="context_read"){if(typeof d.path!="string")throw b();P=d.path}else{let R=typeof d.name=="string"?w.get(d.name.trim()):void 0;if(!R||!Object.hasOwn(g,R))throw b();if(d.path===void 0)return R;let k=d.path;if(typeof k!="string"||!k||k.includes("\\")||k.includes("\0")||M.posix.isAbsolute(k)||M.win32.isAbsolute(k)||k.split("/").includes(".."))throw b();P=M.posix.join(M.posix.dirname(R),k)}if(!Object.hasOwn(g,P))throw b();return P}i(X,"resolveProfilePolicySourcePath");var Z=String.raw`
|
|
3
3
|
const fs=require('node:fs'),p=require('node:path');
|
|
4
4
|
const a=JSON.parse(fs.readFileSync(0,'utf8'));
|
|
5
5
|
const roots={work:'outputs',inputs:'inputs',harness:'harness'};
|