openpond 0.2.58 → 0.2.60
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/README.md +27 -0
- package/dist/app-server.d.ts +8 -1
- package/dist/app-server.js +1 -1
- package/dist/chunks/acp-ARBNMIPT.js +2 -0
- package/dist/chunks/acp-agent-53COYDHB.js +21 -0
- package/dist/chunks/{actions-command-QU4H53OG.js → actions-command-6YSZ7EJS.js} +1 -1
- package/dist/chunks/{app-layer-NSTE5HIT.js → app-layer-TVG7KTW6.js} +1 -1
- package/dist/chunks/{app-server-connected-apps-JHGWLBXT.js → app-server-connected-apps-K62M6LCT.js} +1 -1
- package/dist/chunks/{app-server-evaluations-K52NAQLP.js → app-server-evaluations-RM6WXX3H.js} +1 -1
- package/dist/chunks/app-server-harness-services-RLKMWOQ4.js +2 -0
- package/dist/chunks/app-server-runtime-OKMEHNEU.js +2 -0
- package/dist/chunks/apps-YWZL2H34.js +2 -0
- package/dist/chunks/{chunk-DARVPBZ4.js → chunk-23P2O7PH.js} +1 -1
- package/dist/chunks/{chunk-PF5R6CMP.js → chunk-2GICDASL.js} +1 -1
- package/dist/chunks/{chunk-6MI4KKWF.js → chunk-2ITZW2CN.js} +1 -1
- package/dist/chunks/chunk-2MMCZHKL.js +2 -0
- package/dist/chunks/{chunk-ABD5M2D2.js → chunk-2PAJCXFC.js} +1 -1
- package/dist/chunks/chunk-2RNCXDJC.js +5 -0
- package/dist/chunks/{chunk-APB2STJK.js → chunk-2SUMZ73C.js} +1 -1
- package/dist/chunks/{chunk-YOQRYNLP.js → chunk-3CWRTKHY.js} +1 -1
- package/dist/chunks/{chunk-TRQQNFMO.js → chunk-44LWH5U6.js} +1 -1
- package/dist/chunks/{chunk-HPBQ4VTW.js → chunk-52KIORRX.js} +1 -1
- package/dist/chunks/{chunk-NHQ36THU.js → chunk-5RHYSQZ5.js} +1 -1
- package/dist/chunks/{chunk-3QIB5FXI.js → chunk-5ZBLCWEJ.js} +1 -1
- package/dist/chunks/{chunk-FTEOCCPB.js → chunk-637UACKH.js} +1 -1
- package/dist/chunks/chunk-655DQ6AX.js +145 -0
- package/dist/chunks/{chunk-N4FFQPLR.js → chunk-6GWOVHIG.js} +1 -1
- package/dist/chunks/chunk-6HQB3MQO.js +2 -0
- package/dist/chunks/{chunk-UKMA4R6X.js → chunk-7LZISGTA.js} +2 -2
- package/dist/chunks/{chunk-A6USMRWK.js → chunk-7RC5WPVT.js} +1 -1
- package/dist/chunks/{chunk-H6IW2R22.js → chunk-7YTHEMWI.js} +1 -1
- package/dist/chunks/{chunk-PCSIOUHF.js → chunk-A3L74U3W.js} +1 -1
- package/dist/chunks/{chunk-25MBPJVY.js → chunk-A66CSUBJ.js} +1 -1
- package/dist/chunks/{chunk-OUVIWDL2.js → chunk-AGVOGPAZ.js} +1 -1
- package/dist/chunks/{chunk-M4JWQSV7.js → chunk-AW5Q6NXT.js} +1 -1
- package/dist/chunks/{chunk-RWWE5OXU.js → chunk-B46HZ3MX.js} +1 -1
- package/dist/chunks/{chunk-KGNCKIFP.js → chunk-BIPQCJ5V.js} +1 -1
- package/dist/chunks/{chunk-HCYX6RHP.js → chunk-BIQ33JV5.js} +1 -1
- package/dist/chunks/{chunk-JFXWI3EN.js → chunk-BK63OQRW.js} +1 -1
- package/dist/chunks/{chunk-2D4Y3HNW.js → chunk-CFSIU6CW.js} +1 -1
- package/dist/chunks/{chunk-EIEZHFIW.js → chunk-D3RRUWNN.js} +1 -1
- package/dist/chunks/{chunk-X4OSOOSU.js → chunk-D4UX2O45.js} +1 -1
- package/dist/chunks/{chunk-GJ2ZJFDD.js → chunk-DG4TYVPF.js} +1 -1
- package/dist/chunks/{chunk-QIKWJ2AA.js → chunk-DGIEXZJV.js} +1 -1
- package/dist/chunks/{chunk-PRGBLQVH.js → chunk-DIGX56JY.js} +1 -1
- package/dist/chunks/{chunk-JYKRR7E5.js → chunk-DISNCX6R.js} +1 -1
- package/dist/chunks/{chunk-773TH7FN.js → chunk-DK7IKI7O.js} +1 -1
- package/dist/chunks/{chunk-74IIXVAE.js → chunk-DX7YEUNQ.js} +1 -1
- package/dist/chunks/{chunk-523TE4BI.js → chunk-E63VWAQA.js} +1 -1
- package/dist/chunks/{chunk-5MCNZCVQ.js → chunk-EL454L26.js} +1 -1
- package/dist/chunks/{chunk-OS3LO5J3.js → chunk-ENSB6ZTM.js} +1 -1
- package/dist/chunks/{chunk-EAPFMACH.js → chunk-ERJV5BMC.js} +1 -1
- package/dist/chunks/{chunk-RNIAFXMB.js → chunk-EXJGCNRS.js} +1 -1
- package/dist/chunks/chunk-F5KCCDQM.js +2 -0
- package/dist/chunks/chunk-FSQWAANK.js +3 -0
- package/dist/chunks/{chunk-Z54O534A.js → chunk-G5B3PB5X.js} +1 -1
- package/dist/chunks/{chunk-4D7HWVWD.js → chunk-GAWGIJQG.js} +1 -1
- package/dist/chunks/{chunk-IIZ4CWBX.js → chunk-GGGF5NHJ.js} +1 -1
- package/dist/chunks/{chunk-APB4O67E.js → chunk-GOYBYYPQ.js} +1 -1
- package/dist/chunks/{chunk-XDQMGUWL.js → chunk-H3BSIAQO.js} +1 -1
- package/dist/chunks/{chunk-EYPCBBMS.js → chunk-HCEJAOIF.js} +1 -1
- package/dist/chunks/{chunk-OPNRWESL.js → chunk-IFQCOSU6.js} +1 -1
- package/dist/chunks/chunk-IJHZBHEK.js +9 -0
- package/dist/chunks/{chunk-RAXOSUSW.js → chunk-ISFIDCIH.js} +1 -1
- package/dist/chunks/{chunk-OLLLZVHF.js → chunk-ITKTILKI.js} +1 -1
- package/dist/chunks/{chunk-D74JEERO.js → chunk-IUBARBGI.js} +1 -1
- package/dist/chunks/{chunk-O72BSKSO.js → chunk-J24I74EM.js} +1 -1
- package/dist/chunks/{chunk-H4QHIHMK.js → chunk-J7QGHA7G.js} +3 -3
- package/dist/chunks/chunk-JFXINDOQ.js +3 -0
- package/dist/chunks/{chunk-HIOKCIL7.js → chunk-JGWINTT5.js} +1 -1
- package/dist/chunks/{chunk-Q2QL6UWN.js → chunk-JHEFWB6O.js} +1 -1
- package/dist/chunks/{chunk-QNG27G3T.js → chunk-JHMS2WXM.js} +2 -2
- package/dist/chunks/{chunk-PSGGOZFM.js → chunk-JHR3LF2F.js} +1 -1
- package/dist/chunks/{chunk-JE7RJZOA.js → chunk-KGLJU66U.js} +3 -3
- package/dist/chunks/{chunk-XEOEKFG6.js → chunk-KJFRCVQC.js} +1 -1
- package/dist/chunks/chunk-KNO355LC.js +2 -0
- package/dist/chunks/{chunk-ZGTOK7ZK.js → chunk-LD7PGREF.js} +2 -2
- package/dist/chunks/{chunk-I7AQMAQI.js → chunk-LHA7RQBA.js} +6 -6
- package/dist/chunks/{chunk-6QSSIT62.js → chunk-LO3O45IX.js} +1 -1
- package/dist/chunks/{chunk-G3RXYI2L.js → chunk-M2SKXY5C.js} +2 -2
- package/dist/chunks/{chunk-2IHO4GDJ.js → chunk-M3ZQDPRS.js} +1 -1
- package/dist/chunks/{chunk-JDEEWOD7.js → chunk-M4ZF44H5.js} +1 -1
- package/dist/chunks/{chunk-Y4OWBBDD.js → chunk-M55H7KVR.js} +1 -1
- package/dist/chunks/{chunk-JAJ46T5X.js → chunk-MGKMIRYG.js} +1 -1
- package/dist/chunks/{chunk-4EQA2M7K.js → chunk-MJGU2JJ2.js} +2 -2
- package/dist/chunks/{chunk-65PL62KH.js → chunk-MS37ISA4.js} +2 -2
- package/dist/chunks/{chunk-NH6UUX5S.js → chunk-NCKXI2VB.js} +11 -11
- package/dist/chunks/chunk-NHUUCNAD.js +2 -0
- package/dist/chunks/{chunk-O6ULLQJ6.js → chunk-O3VP46SE.js} +1 -1
- package/dist/chunks/chunk-O4FBOUNX.js +2 -0
- package/dist/chunks/chunk-O6IFVTZT.js +9 -0
- package/dist/chunks/{chunk-5IPFI25K.js → chunk-O7B44IYN.js} +1 -1
- package/dist/chunks/{chunk-DMVD2RFZ.js → chunk-OGMDEA3Y.js} +1 -1
- package/dist/chunks/{chunk-BLXEAZCQ.js → chunk-OKBIWRHC.js} +1 -1
- package/dist/chunks/{chunk-FFRFSDBM.js → chunk-ON2RNOCG.js} +1 -1
- package/dist/chunks/{chunk-LQQNBVEB.js → chunk-ONDCV5QC.js} +1 -1
- package/dist/chunks/{chunk-UCPGRPWY.js → chunk-OQ4VGCRG.js} +1 -1
- package/dist/chunks/{chunk-YNH3NMPF.js → chunk-OWK7HU5I.js} +1 -1
- package/dist/chunks/{chunk-DBK66CJP.js → chunk-OY5HC2P6.js} +1 -1
- package/dist/chunks/{chunk-T5AACNJI.js → chunk-P7HRF4FM.js} +1 -1
- package/dist/chunks/{chunk-7ED24PP6.js → chunk-PCNLC5H3.js} +1 -1
- package/dist/chunks/{chunk-ES2ISFJC.js → chunk-PF56N7ZY.js} +1 -1
- package/dist/chunks/{chunk-VVCKLCF3.js → chunk-PKALOVHC.js} +2 -2
- package/dist/chunks/{chunk-ZCHXGRRU.js → chunk-PR5TYTY4.js} +1 -1
- package/dist/chunks/{chunk-Q4TBTRIG.js → chunk-PWK5Z5S3.js} +1 -1
- package/dist/chunks/chunk-PXS4SVQG.js +16 -0
- package/dist/chunks/{chunk-AY64VY4E.js → chunk-QGOPYQW3.js} +1 -1
- package/dist/chunks/{chunk-7E6T7GP5.js → chunk-R7YEURUQ.js} +1 -1
- package/dist/chunks/{chunk-ACYFMLWG.js → chunk-RCA6NGVA.js} +2 -2
- package/dist/chunks/{chunk-DUURYZOI.js → chunk-RG3NH6YQ.js} +1 -1
- package/dist/chunks/{chunk-7SC46OFC.js → chunk-RJIUOLWY.js} +1 -1
- package/dist/chunks/{chunk-F4KOGISR.js → chunk-RXE3FYMJ.js} +1 -1
- package/dist/chunks/chunk-RYGWCN2R.js +2 -0
- package/dist/chunks/{chunk-VYLGI3IH.js → chunk-SFNCAPCJ.js} +1 -1
- package/dist/chunks/{chunk-Z4Z5UOZM.js → chunk-SG6JZ7HD.js} +1 -1
- package/dist/chunks/{chunk-XX6SMFDY.js → chunk-SKRNWRKV.js} +5 -5
- package/dist/chunks/{chunk-ZRDGQDZL.js → chunk-SLZH4Z6C.js} +1 -1
- package/dist/chunks/{chunk-WN3V6KDN.js → chunk-SPDSSMFD.js} +1 -1
- package/dist/chunks/chunk-STWRTNRK.js +2 -0
- package/dist/chunks/{chunk-HZEIRHEB.js → chunk-T5J7HIHR.js} +1 -1
- package/dist/chunks/{chunk-ROGF26KV.js → chunk-TBUAQWFS.js} +1 -1
- package/dist/chunks/{chunk-ZUJ3XUCP.js → chunk-TEPRCBDV.js} +1 -1
- package/dist/chunks/{chunk-HDGTHRY7.js → chunk-TOFMA2L5.js} +2 -2
- package/dist/chunks/{chunk-QOGJAQDO.js → chunk-UFHLLSCE.js} +1 -1
- package/dist/chunks/{chunk-TTVS6JMC.js → chunk-UJKQLO6B.js} +2 -2
- package/dist/chunks/{chunk-OQKJGTTO.js → chunk-UZQNFTLR.js} +1 -1
- package/dist/chunks/{chunk-F74GBN6K.js → chunk-V2HMWCT6.js} +1 -1
- package/dist/chunks/{chunk-6ZFPQYHG.js → chunk-V4KT5FCJ.js} +1 -1
- package/dist/chunks/{chunk-TVQAPBLZ.js → chunk-VHSX3JPX.js} +1 -1
- package/dist/chunks/{chunk-SDXFLO7J.js → chunk-W2SXOGTQ.js} +1 -1
- package/dist/chunks/{chunk-FUOEIDMA.js → chunk-WDEO44UN.js} +1 -1
- package/dist/chunks/{chunk-4NESNOK5.js → chunk-WEHBK3MC.js} +1 -1
- package/dist/chunks/{chunk-4EPSHPZL.js → chunk-WGX7WY4N.js} +1 -1
- package/dist/chunks/{chunk-NC27T4AB.js → chunk-WHREO7A2.js} +1 -1
- package/dist/chunks/{chunk-RNQF63ZR.js → chunk-WS2ZZBAQ.js} +4 -4
- package/dist/chunks/{chunk-DIO5CB6U.js → chunk-WYZWDMMF.js} +1 -1
- package/dist/chunks/{chunk-MQULU465.js → chunk-XO3H32KX.js} +1 -1
- package/dist/chunks/{chunk-EIRYMSEG.js → chunk-XQBIHPPX.js} +1 -1
- package/dist/chunks/chunk-XRKFTPHD.js +2 -0
- package/dist/chunks/{chunk-B7RFL4N2.js → chunk-XSCIOQYE.js} +1 -1
- package/dist/chunks/{chunk-TJ6GVTYB.js → chunk-XTWEWYK7.js} +9 -9
- package/dist/chunks/{chunk-JUHZ5S3R.js → chunk-Y3GIM6WK.js} +1 -1
- package/dist/chunks/{chunk-74ZXXBGN.js → chunk-Y54RKLOI.js} +1 -1
- package/dist/chunks/{chunk-SWUEFLOH.js → chunk-Y777GISF.js} +1 -1
- package/dist/chunks/{chunk-EKM2D7JU.js → chunk-YDU3S6UT.js} +1 -1
- package/dist/chunks/{chunk-UGL7WF3W.js → chunk-YOZIZYSC.js} +1 -1
- package/dist/chunks/{chunk-OSIO7PLX.js → chunk-YQKOB56U.js} +1 -1
- package/dist/chunks/chunk-YVNDDNMK.js +3 -0
- package/dist/chunks/chunk-ZAZKJJOT.js +86 -0
- package/dist/chunks/{chunk-QL4OIPEZ.js → chunk-ZR7LIMJS.js} +2 -2
- package/dist/chunks/{chunk-L3KCP52O.js → chunk-ZTJOOY2F.js} +1 -1
- package/dist/chunks/{chunk-GPVCOEUH.js → chunk-ZTVXRZ6D.js} +1 -1
- package/dist/chunks/cli-CNYNXKGQ.js +2 -0
- package/dist/chunks/configuration-command-5K7EE2J5.js +2 -0
- package/dist/chunks/connected-app-executor-E25XCNAS.js +2 -0
- package/dist/chunks/connected-evidence-QNSO5BTF.js +2 -0
- package/dist/chunks/connection-Y2KCMBYD.js +2 -0
- package/dist/chunks/{continual-6CQAMTTR.js → continual-SOO3QBNQ.js} +1 -1
- package/dist/chunks/core-commands-ZTWPYAFQ.js +2 -0
- package/dist/chunks/datasets-XPUMWGOC.js +2 -0
- package/dist/chunks/desktop-test-HVSW4JHY.js +3 -0
- package/dist/chunks/dist-4N6AHWNN.js +2 -0
- package/dist/chunks/{dist-OMGUJYPD.js → dist-N6R6VNFD.js} +1 -1
- package/dist/chunks/{dist-VYC5VMQB.js → dist-QN7WKZ2D.js} +1 -1
- package/dist/chunks/{enclave-QS4BUNDU.js → enclave-VURYNILU.js} +1 -1
- package/dist/chunks/evaluation-coordination-AOTFPVMS.js +2 -0
- package/dist/chunks/experiment-improvements-75CN3VI7.js +2 -0
- package/dist/chunks/experiments-AGAHM2AK.js +2 -0
- package/dist/chunks/{experiments-VFQGE4HC.js → experiments-DYSHYBGB.js} +1 -1
- package/dist/chunks/{extension-XKXXOP5N.js → extension-UT4CSDJF.js} +1 -1
- package/dist/chunks/help-KU52CFMW.js +8 -0
- package/dist/chunks/host-profile-evaluation-tools-LZDMQCMT.js +2 -0
- package/dist/chunks/host-profile-external-dataset-VK3NJHMC.js +2 -0
- package/dist/chunks/hosted-app-server-composition-P7V7K7CG.js +2 -0
- package/dist/chunks/{hosted-experiment-improvement-HVMDGS75.js → hosted-experiment-improvement-P433KDX2.js} +1 -1
- package/dist/chunks/hosted-harness-runtime-Y4DONWPC.js +2 -0
- package/dist/chunks/{hosted-profile-candidate-EXNN6MVN.js → hosted-profile-candidate-72MMPN6U.js} +1 -1
- package/dist/chunks/hosted-profile-compiler-RXHLK224.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-control-LS4DCSDO.js +2 -0
- package/dist/chunks/{hosted-profile-evaluation-inspection-ZUANDYZ6.js → hosted-profile-evaluation-inspection-3Q6EHO66.js} +1 -1
- package/dist/chunks/{hosted-profile-evaluation-preparation-ORVZ6MBD.js → hosted-profile-evaluation-preparation-ZD27HNLF.js} +1 -1
- package/dist/chunks/{hosted-tasksets-ANAE2PIW.js → hosted-tasksets-V2PQZJN4.js} +1 -1
- package/dist/chunks/human-review-4FJFINQX.js +2 -0
- package/dist/chunks/import-GBHSLA3G.js +3 -0
- package/dist/chunks/{learning-ACEVFL5M.js → learning-U3FZL5YB.js} +1 -1
- package/dist/chunks/local-harness-improvement-runtime-UP2P7UT4.js +2 -0
- package/dist/chunks/local-harness-taskset-review-ZNOKSPJJ.js +2 -0
- package/dist/chunks/{local-scope-HVF2GZ5W.js → local-scope-62GWHDXS.js} +1 -1
- package/dist/chunks/{model-projects-QPO22JPA.js → model-projects-LQ4C6R3X.js} +1 -1
- package/dist/chunks/opchat-Q4PIWPYW.js +3 -0
- package/dist/chunks/organizations-TEH6HBQ3.js +2 -0
- package/dist/chunks/{profile-TFZMUEDR.js → profile-SWPVCGTR.js} +1 -1
- package/dist/chunks/{profile-training-source-6GOT7AHM.js → profile-training-source-J73ZLNSC.js} +1 -1
- package/dist/chunks/project-action-payload-OU3ZPHW7.js +2 -0
- package/dist/chunks/project-agent-J7ILCRBS.js +2 -0
- package/dist/chunks/{published-experiment-source-HVP5IGRH.js → published-experiment-source-HVHKSYDL.js} +1 -1
- package/dist/chunks/refiner-profile-service-E7YU4E3N.js +2 -0
- package/dist/chunks/{runtime-A7OZXM43.js → runtime-LIPHPKKJ.js} +2 -2
- package/dist/chunks/sandbox-command-G6KID3OP.js +2 -0
- package/dist/chunks/{sandbox-template-C4V6T36U.js → sandbox-template-MZTMAUFS.js} +1 -1
- package/dist/chunks/saved-work-LOUWLF37.js +2 -0
- package/dist/chunks/{send-turn-XTAIS2JN.js → send-turn-UEUEGY5W.js} +1 -1
- package/dist/chunks/{src-R36AGJY7.js → src-7WMZOWZZ.js} +107 -100
- package/dist/chunks/{src-DZL5T2MT.js → src-MVAK6D6Y.js} +1 -1
- package/dist/chunks/standalone-experiment-turn-owner-YRKEOEJ2.js +2 -0
- package/dist/chunks/{store-continual-support-reviews-LJPNG4SP.js → store-continual-support-reviews-FJLLNKCY.js} +1 -1
- package/dist/chunks/{store-conversation-serving-KPC62UEY.js → store-conversation-serving-4KWR4IZY.js} +1 -1
- package/dist/chunks/{store-create-improve-SW5FTBTL.js → store-create-improve-JWBJZRAU.js} +1 -1
- package/dist/chunks/{store-datasets-WMA7AJKN.js → store-datasets-4N2M6Y3K.js} +2 -2
- package/dist/chunks/{store-evaluation-results-ZO6R653G.js → store-evaluation-results-OBM4623U.js} +1 -1
- package/dist/chunks/{store-harness-memory-VINCZ4GK.js → store-harness-memory-4HUEMRCD.js} +1 -1
- package/dist/chunks/{store-harness-refinement-candidates-EA5KFQPH.js → store-harness-refinement-candidates-NMRWMN23.js} +1 -1
- package/dist/chunks/store-harness-workspaces-BGONIQDY.js +2 -0
- package/dist/chunks/{store-human-review-7QQ7ZQ6P.js → store-human-review-J75SIZAL.js} +1 -1
- package/dist/chunks/store-learned-preference-migration-validation-VLASM4CT.js +2 -0
- package/dist/chunks/store-learning-TUCQFBLT.js +2 -0
- package/dist/chunks/{store-learning-credentials-WZQJ4HPJ.js → store-learning-credentials-S4RF57NV.js} +1 -1
- package/dist/chunks/{store-local-experiments-SAULQSBN.js → store-local-experiments-LULRLTII.js} +5 -5
- package/dist/chunks/{store-model-batch-review-VKLDYGH3.js → store-model-batch-review-SVL4MT6D.js} +1 -1
- package/dist/chunks/{store-model-configuration-BYRJUR3C.js → store-model-configuration-ZHDSM3XM.js} +2 -2
- package/dist/chunks/{store-preference-comparison-LV32MHVL.js → store-preference-comparison-YMMCKXS5.js} +1 -1
- package/dist/chunks/{store-schedules-VGTEQVKH.js → store-schedules-6Z4QS3NU.js} +1 -1
- package/dist/chunks/{store-sidebar-file-bookmarks-VB5GTLFY.js → store-sidebar-file-bookmarks-MX6EP6OB.js} +2 -2
- package/dist/chunks/{store-sidebar-preferences-GWIOG2NH.js → store-sidebar-preferences-VYREPW26.js} +1 -1
- package/dist/chunks/{store-subagents-T7R2Z6TB.js → store-subagents-WGBCRALX.js} +1 -1
- package/dist/chunks/{store-task-inbox-QPE44OSS.js → store-task-inbox-43BNZSB7.js} +6 -6
- package/dist/chunks/{store-task-inventory-I3RDRI52.js → store-task-inventory-AEW4POAJ.js} +2 -2
- package/dist/chunks/{store-taskset-drafts-2IULRV2W.js → store-taskset-drafts-DKFO2CYB.js} +1 -1
- package/dist/chunks/{store-training-B2TW2MLA.js → store-training-6PFFR6ST.js} +1 -1
- package/dist/chunks/{store-training-jobs-VBNG23RL.js → store-training-jobs-ANDEBQ67.js} +2 -2
- package/dist/chunks/{store-training-models-OMV5FIC4.js → store-training-models-OOI4ZJPX.js} +2 -2
- package/dist/chunks/{store-usage-IE2U2FD3.js → store-usage-U72RNW64.js} +1 -1
- package/dist/chunks/{store-work-evidence-QQDKM5AQ.js → store-work-evidence-NY5OBATB.js} +1 -1
- package/dist/chunks/{taskset-EQRFQBYM.js → taskset-SL3YOXW7.js} +1 -1
- package/dist/chunks/{taskset-packages-XC6HEE3K.js → taskset-packages-3PCEYYDA.js} +1 -1
- package/dist/chunks/{teams-bot-EAPGPTHZ.js → teams-bot-IDEF3BMI.js} +1 -1
- package/dist/chunks/{training-UF6RPI4T.js → training-57ISIC7U.js} +1 -1
- package/dist/chunks/web-search-222Y63QW.js +2 -0
- package/dist/chunks/{workspaces-EKKE5NAC.js → workspaces-5DF4H5EX.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/sandbox-template/manifest.js +1 -1
- package/dist/web/assets/{App-CaRMZoxo.css → App-DbYvV_W6.css} +1 -1
- package/dist/web/assets/App-nzE7JU_O.js +154 -0
- package/dist/web/assets/{AppDialog-t2Fx5tK3.js → AppDialog-VtNvqbDm.js} +1 -1
- package/dist/web/assets/{AppTerminalPanel-Dj1Y32oI.js → AppTerminalPanel-BMfKdrrN.js} +2 -2
- package/dist/web/assets/AppsView-CdWyrDEb.js +1 -0
- package/dist/web/assets/{BrowserSidebar-jhWi4rVm.js → BrowserSidebar-CtOIciOa.js} +1 -1
- package/dist/web/assets/{CartesianChart-C1DIx0Ia.js → CartesianChart-u1lvLM30.js} +1 -1
- package/dist/web/assets/{CollaborationTabs-Bdr-HmOL.js → CollaborationTabs-CaBfDYRW.js} +1 -1
- package/dist/web/assets/{CommandMenu-Ux2yOHAc.js → CommandMenu-CFW3WJ11.js} +1 -1
- package/dist/web/assets/{CommunityView-DPEeVKFn.js → CommunityView-D2EjaeuH.js} +1 -1
- package/dist/web/assets/ComposerCreateImproveStrip-6wYSJdzv.js +1 -0
- package/dist/web/assets/ConversationImportsSettings-BJ4QhF7p.js +1 -0
- package/dist/web/assets/ConversationImportsSettings-PfUa8V7X.css +1 -0
- package/dist/web/assets/{GetStartedView-CFHP0AaI.js → GetStartedView-DBcOwIJn.js} +1 -1
- package/dist/web/assets/{HostedModelLearningReview-D8BGTPVN.js → HostedModelLearningReview-BNpK6_W9.js} +1 -1
- package/dist/web/assets/{HostedModelLearningSettings-JS1S7vNO.js → HostedModelLearningSettings-SrsdeeoA.js} +1 -1
- package/dist/web/assets/{LabModelVersionDetailPage-Dx5Q3xV2.js → LabModelVersionDetailPage-Cd6bRHt9.js} +1 -1
- package/dist/web/assets/LabSkillSidebar-CQfvel4w.js +1 -0
- package/dist/web/assets/{LabsRoute-CyYF8-dw.js → LabsRoute-sXLJt1KR.js} +4 -4
- package/dist/web/assets/MainChatThread-dlDDK2JM.js +2 -0
- package/dist/web/assets/MainPane-DCz38-qy.js +65 -0
- package/dist/web/assets/{MarkdownText-BR4V6lNO.js → MarkdownText-Drjq6-JM.js} +1 -1
- package/dist/web/assets/{NativeSkillSidebar-DU9IEgIO.js → NativeSkillSidebar-jncZijt-.js} +1 -1
- package/dist/web/assets/{NewExperienceSwitcher-mIy6FzCj.js → NewExperienceSwitcher-DXKzoMaM.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-RfTZTHxl.js → NewProjectDialog-DIyjAxJG.js} +1 -1
- package/dist/web/assets/OutputsPage-Dy1cNr3n.js +1 -0
- package/dist/web/assets/{ProjectsPage-CE6QUB-b.js → ProjectsPage-D2EeybIv.js} +1 -1
- package/dist/web/assets/RightChatPanelStack-4wUL-W9_.js +1 -0
- package/dist/web/assets/{RightSidebarHomePanel-CK0rP3WT.js → RightSidebarHomePanel-Bd_AHUp8.js} +1 -1
- package/dist/web/assets/{ScheduledWorkPage-vOrYv8pp.js → ScheduledWorkPage-BJkSzwz2.js} +1 -1
- package/dist/web/assets/{SettingsView-DCKVrfjj.js → SettingsView-BhcP72KH.js} +4 -4
- package/dist/web/assets/SettingsView-DjjnCnlb.css +1 -0
- package/dist/web/assets/{TeamChatView-Bwrjr-vk.js → TeamChatView-CR0fdicZ.js} +2 -2
- package/dist/web/assets/{TerminalOverlay-DhPoKZAq.js → TerminalOverlay-DGrZRZ_3.js} +10 -10
- package/dist/web/assets/TrainingCreationPanel-BsTG7aFS.js +1 -0
- package/dist/web/assets/{TrainingDraftPanel-C9cRX5qf.js → TrainingDraftPanel-ByErrht7.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-CrdcSGeW.js → UsageSettingsSection-DeYTJbcM.js} +1 -1
- package/dist/web/assets/{WorkSidebarPanel-DSSikNFQ.js → WorkSidebarPanel-DcNvEEoy.js} +1 -1
- package/dist/web/assets/{WorkspaceDiffPanel-BAFo0CPN.js → WorkspaceDiffPanel-CdPRcYWN.js} +3 -3
- package/dist/web/assets/{WorkspaceEnvironmentMenu-BVHAhwnJ.js → WorkspaceEnvironmentMenu-xUYg-iGn.js} +18 -18
- package/dist/web/assets/{WorkspaceGitDialogs-CwVoiDQ2.js → WorkspaceGitDialogs-CBViLL3S.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-TxLyhzNp.js → WorkspaceMonacoEditor-frxie2_S.js} +3 -3
- package/dist/web/assets/agent-connections-D7ao-vbU.js +1 -0
- package/dist/web/assets/{arrow-up-right-C9aE8Mfz.js → arrow-up-right-DCWPxdbD.js} +1 -1
- package/dist/web/assets/{chunk-P3BRSSRD-DUGfuKA8.js → chunk-P3BRSSRD-B5JXa0Nh.js} +1 -1
- package/dist/web/assets/{clipboard-Dk158Qp4.js → clipboard-B-GnMVLp.js} +1 -1
- package/dist/web/assets/{cloud-upload-k9eqBsHr.js → cloud-upload-DpaGFZ9J.js} +1 -1
- package/dist/web/assets/{cssMode-CO35ARZp.js → cssMode-DJHE7R3W.js} +1 -1
- package/dist/web/assets/{folder-open-sYgceW_f.js → folder-open-B-DFLDFH.js} +1 -1
- package/dist/web/assets/{folder-plus-CS0R49m9.js → folder-plus-CPXxPvSH.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-DrGxH2h4.js → git-commit-horizontal-DCTzcivA.js} +1 -1
- package/dist/web/assets/{htmlMode-REMmzdfq.js → htmlMode-DxZVBAYd.js} +1 -1
- package/dist/web/assets/index-BojtIRzO.css +1 -0
- package/dist/web/assets/{index-C8aCGagb.js → index-Di1MU6Xr.js} +2 -2
- package/dist/web/assets/{info-DLdbiUrh.js → info-BMxsR_bn.js} +1 -1
- package/dist/web/assets/{jsonMode-KEdMfkIf.js → jsonMode-CzWoMkpp.js} +1 -1
- package/dist/web/assets/{lspLanguageFeatures-5KZwEoxW.js → lspLanguageFeatures-15K7ND6Q.js} +1 -1
- package/dist/web/assets/{minimize-2-CqcI4zcM.js → minimize-2-DwUgqXoR.js} +1 -1
- package/dist/web/assets/{monaco.contribution-Cly9Wt7L.js → monaco.contribution-BBLKjER5.js} +2 -2
- package/dist/web/assets/{monaco.contribution-omszXBEj.js → monaco.contribution-DBjvSu8p.js} +2 -2
- package/dist/web/assets/{monaco.contribution-DO10L0zW.js → monaco.contribution-DUWvjhIG.js} +2 -2
- package/dist/web/assets/{monaco.contribution-BJGj65F9.js → monaco.contribution-w0zfkYLX.js} +2 -2
- package/dist/web/assets/{monitor-BFVCcbxp.js → monitor-Ihu5LVYx.js} +1 -1
- package/dist/web/assets/{play-C469pVZq.js → play-D_YGCdxU.js} +1 -1
- package/dist/web/assets/{python-Dw0YcVy9.js → python-Q4OuoXYc.js} +1 -1
- package/dist/web/assets/{save-CtSjPydi.js → save-DJYUOhtD.js} +1 -1
- package/dist/web/assets/{square-BuImvLhT.js → square-DXtoCBNw.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-DjCO9lIP.js → toggleHighContrast-CaNeuWVE.js} +1 -1
- package/dist/web/assets/{tsMode-BAOnxKd6.js → tsMode-CJnQ2wmM.js} +1 -1
- package/dist/web/assets/{upload-2JkFZo3h.js → upload-fCP3_OEO.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules-BNqAisfS.js → useLocalAgentSchedules-BFoH_gwZ.js} +1 -1
- package/dist/web/assets/useProviderSettings-2eysgqiA.js +5 -0
- package/dist/web/assets/{useProviderSettings-CmL_BaxP.css → useProviderSettings-Cktvzinz.css} +1 -1
- package/dist/web/assets/{useSessionTurnCache-BHU2-Jmz.js → useSessionTurnCache-DLF5SPD-.js} +1 -1
- package/dist/web/assets/{wifi-off-CpOAH62M.js → wifi-off-DZoiFrRz.js} +1 -1
- package/dist/web/assets/{workers-0QvlA2T5.js → workers-D5nr74M-.js} +1 -1
- package/dist/web/assets/{yaml-BK3qxo7D.js → yaml-CwsoTJmk.js} +1 -1
- package/dist/web/index.html +2 -2
- package/docs/command-reference.md +22 -3
- package/docs/conversation-imports.md +57 -0
- package/package.json +1 -1
- package/dist/chunks/app-server-harness-services-QMUOEYOA.js +0 -2
- package/dist/chunks/app-server-runtime-ISGGLQHU.js +0 -2
- package/dist/chunks/apps-BKTOR4F7.js +0 -2
- package/dist/chunks/chunk-3VUATFZD.js +0 -2
- package/dist/chunks/chunk-3Z47M3YY.js +0 -2
- package/dist/chunks/chunk-6UDGARFC.js +0 -143
- package/dist/chunks/chunk-FV2R5RUN.js +0 -3
- package/dist/chunks/chunk-HY3GOBFJ.js +0 -58
- package/dist/chunks/chunk-I3HZKJB3.js +0 -2
- package/dist/chunks/chunk-I3VVWNUW.js +0 -5
- package/dist/chunks/chunk-KG325WTN.js +0 -2
- package/dist/chunks/chunk-Q5LEXXJG.js +0 -16
- package/dist/chunks/chunk-QDC4OW3S.js +0 -2
- package/dist/chunks/chunk-SDAUS5PY.js +0 -2
- package/dist/chunks/chunk-VRIEKBBH.js +0 -9
- package/dist/chunks/chunk-WJ43MJ3F.js +0 -2
- package/dist/chunks/chunk-X2HIHF2I.js +0 -2
- package/dist/chunks/chunk-YBT2NB32.js +0 -2
- package/dist/chunks/chunk-ZTNHW2K7.js +0 -10
- package/dist/chunks/cli-XZENDZ7Z.js +0 -2
- package/dist/chunks/configuration-command-6C5UO7GE.js +0 -2
- package/dist/chunks/connected-app-executor-LQNIU5NR.js +0 -2
- package/dist/chunks/connected-evidence-GH2ATNEX.js +0 -2
- package/dist/chunks/connection-HTF6CC7M.js +0 -2
- package/dist/chunks/core-commands-A2DGGIPS.js +0 -2
- package/dist/chunks/datasets-7BNMVJOY.js +0 -2
- package/dist/chunks/desktop-test-3CUHVLXV.js +0 -3
- package/dist/chunks/dist-ZVJPJLXR.js +0 -2
- package/dist/chunks/evaluation-coordination-XEF5L7KZ.js +0 -2
- package/dist/chunks/experiment-improvements-KRX2DP27.js +0 -2
- package/dist/chunks/experiments-DFGQYA4O.js +0 -2
- package/dist/chunks/help-S7THC6IE.js +0 -8
- package/dist/chunks/host-profile-evaluation-tools-JOFBL5OF.js +0 -2
- package/dist/chunks/host-profile-external-dataset-K3ICDHIP.js +0 -2
- package/dist/chunks/hosted-app-server-composition-T5IWGOTA.js +0 -2
- package/dist/chunks/hosted-harness-runtime-YCKB6NBI.js +0 -2
- package/dist/chunks/hosted-profile-compiler-IYLLHCRY.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-control-TJVER3NW.js +0 -2
- package/dist/chunks/human-review-WR777ODH.js +0 -2
- package/dist/chunks/import-MLZUHITH.js +0 -4
- package/dist/chunks/local-harness-improvement-runtime-QRFGPFRM.js +0 -2
- package/dist/chunks/local-harness-taskset-review-HR7KLY4B.js +0 -2
- package/dist/chunks/opchat-T4QTNEIY.js +0 -3
- package/dist/chunks/organizations-75L5DZDV.js +0 -2
- package/dist/chunks/project-action-payload-JDS6OQAW.js +0 -2
- package/dist/chunks/project-agent-6RRO233B.js +0 -2
- package/dist/chunks/refiner-profile-service-FDTQKY33.js +0 -2
- package/dist/chunks/sandbox-command-IU5XFTJP.js +0 -2
- package/dist/chunks/saved-work-SHEEDZ6Z.js +0 -2
- package/dist/chunks/standalone-experiment-turn-owner-JCY5LL5R.js +0 -2
- package/dist/chunks/store-harness-workspaces-XUM4Z66X.js +0 -2
- package/dist/chunks/store-learned-preference-migration-validation-NADPXOTG.js +0 -2
- package/dist/chunks/store-learning-WLG6KFIO.js +0 -2
- package/dist/chunks/web-search-CZ3NCLPY.js +0 -2
- package/dist/web/assets/App-s-CJswyt.js +0 -154
- package/dist/web/assets/AppsView-BYE5EBDJ.js +0 -1
- package/dist/web/assets/ComposerCreateImproveStrip-CEgh4OtN.js +0 -1
- package/dist/web/assets/LabSkillSidebar-BxffN-pN.js +0 -1
- package/dist/web/assets/MainChatThread-DZpcFRFl.js +0 -2
- package/dist/web/assets/MainPane-5DTtwVCk.js +0 -65
- package/dist/web/assets/OutputsPage-Cr1Spf7S.js +0 -1
- package/dist/web/assets/RightChatPanelStack-T6VRWuHo.js +0 -1
- package/dist/web/assets/SettingsView-Dulr_xlq.css +0 -1
- package/dist/web/assets/TrainingCreationPanel-BXHfohNm.js +0 -1
- package/dist/web/assets/index-3iPNbbER.css +0 -1
- package/dist/web/assets/useProviderSettings-C4L4wDoh.js +0 -5
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{a as H,d as ie,f as se}from"./chunk-44LWH5U6.js";import{a as oe}from"./chunk-FEAKTSRS.js";import{a as te}from"./chunk-6HQB3MQO.js";import{d as Y,g as Z,h as ee}from"./chunk-J24I74EM.js";import{d as X}from"./chunk-WDEO44UN.js";import{Y as ae,_ as re}from"./chunk-IJHZBHEK.js";import{o as Q,s as b}from"./chunk-O4FBOUNX.js";import{Ib as K,ca as P,la as g,xa as U}from"./chunk-A66CSUBJ.js";import{w as G,x as F,z as T}from"./chunk-M55H7KVR.js";import{a as j,f as q}from"./chunk-ON2RNOCG.js";import{g as L}from"./chunk-SFNCAPCJ.js";import{cb as N,db as y,e as _,fb as W,lb as $}from"./chunk-RCA6NGVA.js";import{b as R,c as v,d as J,l as S,m as n}from"./chunk-BIPQCJ5V.js";import{A as h}from"./chunk-PF56N7ZY.js";import{a as d}from"./chunk-FTQLQJQV.js";import{promises as fe}from"node:fs";import ue from"node:path";async function Ae(e){let a=e.definition.tasksetRelease,i=await X(e.store,e.harnessRelease);if(!i)throw new Error("Evaluation Profile Harness release is unavailable.");let t=await me({...e,runtime:i});if(t)return t;let r=await e.store.listTasksetRevisions(e.profileId);for(let o of r){if(a.id!==o.id&&a.id!==`taskset-release-${o.id}-r${o.revision}`)continue;let s=await pe(e.storeDir,o);if(s.taskset.id===a.id&&s.taskset.contentHash===a.contentHash)return s}throw new Error(`Released Taskset ${a.id} is unavailable in Profile ${e.profileId}.`)}d(Ae,"loadLocalProfileEvaluationTaskset");async function pe(e,a){let i=a.metadata.importedPackageHash;if(typeof i=="string"){let o=await ee(e,i);if(o.taskset.id!==a.id||o.taskset.revision!==a.revision)throw new Error("Imported evaluation Taskset differs from its local Profile revision.");return o}if(U(a)!==a.contentHash)throw new Error("Authored evaluation Taskset differs from its immutable revision.");let t=K({taskset:a,adapterId:Y(a)}),r=await te({storeDir:e,taskset:a,content:{schemaVersion:"openpond.tasksetPackage.v1",taskset:t.tasksetRelease,environment:t.environmentRelease,verifierSet:t.verifierSetRelease}});return await Z(e,r),r}d(pe,"loadCandidate");async function me(e){let a=e.definition.tasksetRelease,i=e.runtime;if(i.release.harnessRelease.id!==e.harnessRelease.id||i.release.harnessRelease.contentHash!==e.harnessRelease.contentHash)throw new Error("Evaluation Taskset runtime differs from its requested release.");let t=`evals/tasksets/${a.contentHash}.json`,r=i.release.harnessRelease.files.find(o=>o.path===t);if(r){if(r.visibility!=="verifier")throw new Error("Evaluation Taskset package is not verifier-private.");let o=await fe.readFile(ue.join(i.release.bundlePath,"source",...t.split("/")));if(S(o)!==r.contentHash)throw new Error("Released evaluation Taskset package bytes differ from their source receipt.");let s=g(JSON.parse(o.toString("utf8")));if(s.taskset.id!==a.id||s.taskset.contentHash!==a.contentHash)throw new Error("Released evaluation Taskset package differs from its definition.");return s}return null}d(me,"loadReleasedProfileEvaluationTaskset");function D(e){return{id:W(e),label:"Selected Dataset evaluation",description:"Explicit sealed external Dataset evaluation recipe.",target:e.target,tasksetRelease:{id:e.dataset.id,contentHash:e.dataset.contentHash},split:e.split,taskIds:[...new Set(e.population.map(a=>a.taskId))],seeds:[...new Set(e.population.map(a=>a.seed))],criterion:e.criterion}}d(D,"externalProfileEvaluationDefinition");async function Je(e){let a=e.manifest.profileEvaluation,i=a?.externalDatasetBinding?y(a.externalDatasetBinding):null;if(!i)return null;if(!e.resolveExternalDataset)throw new Error("This owner has no authorized external Dataset resolver.");let t=await e.resolveExternalDataset(i,e.selected);await t.authorize();let r=g(t.packageValue),o=await e.loadCatalog({ref:e.selected.profileRef,sourceRevision:e.selected.sourceRevision,harnessRelease:e.selected.harnessRelease});if(n(t.binding)!==n(i)||i.profileId!==e.selected.profileRef.profileId||i.declaredProfileCatalogHash!==o.catalogHash||r.contentHash!==i.packageHash||n(r.taskset)!==n(e.taskset)||i.environmentHash!==n(r.taskset.environment)||i.privateDatasetClosureHash!==n(r.files.filter(l=>l.asset.visibility!=="policy").map(l=>l.asset)))throw new Error("External Dataset admission changed its actual Profile, package or private closure.");let s=D(i),f={schemaVersion:"openpond.profileEvaluations.v1",definitions:[s],suites:[]};if(T(e.manifest,e.taskset,f),!a||a.catalogHash!==n(f)||a.definitionHash!==n(s)||n(a.target)!==n(i.target))throw new Error("External Dataset manifest changed its derived definition.");return await t.authorize(),{...t,packageValue:r,definition:s,catalog:f}}d(Je,"admitProfileExternalDataset");var he=h.object({id:R,createdAt:J,definitionId:R,externalDatasetBinding:N.optional(),profileRef:Q.optional(),profileSource:h.object({sourceRevision:h.string().min(1).max(500),harnessRelease:h.object({id:R,contentHash:v}).strict()}).strict().optional(),modelRef:q,hostModelConfigurationHash:v.optional(),hostArtifactHash:v.optional(),maximumSpendUsd:h.number().positive().max(1e4).optional(),expectedManifestHash:v.optional(),hostExperiment:h.object({definition:h.object({id:R,revision:h.number().int().positive(),contentHash:v}).strict().nullable(),configurationHash:v,project:h.object({id:R,revision:h.number().int().positive(),contentHash:v,targetId:R.nullable()}).strict().optional()}).strict().optional()}).strict();function Le(e){return async(a,i)=>{let t=he.parse(a);if(i?.requireExpectedManifestHash&&!t.expectedManifestHash)throw new Error("Profile evaluation execution requires the reviewed manifest hash.");if(t.profileSource&&!t.profileRef)throw new Error("An exact Profile source requires its accepted Profile reference.");let r=i?.selectedWorkflows??await e.selectedWorkflows(t.profileRef,t.profileSource);if(t.profileRef&&n(t.profileRef)!==n(r.profileRef))throw new Error("Profile preparation did not resolve the explicitly selected Profile.");if(t.profileSource&&(r.sourceRevision!==t.profileSource.sourceRevision||n(r.harnessRelease)!==n(t.profileSource.harnessRelease)))throw new Error("Profile preparation changed its explicitly pinned source.");let o=t.externalDatasetBinding?y(t.externalDatasetBinding):null,s=o?await(e.resolveExternalDataset?e.resolveExternalDataset(o,r):Promise.reject(new Error("This host has not qualified external Dataset Profile execution."))):null;if(s&&(await s.authorize(),n(y(s.binding))!==n(o)))throw new Error("External Dataset admission differs from the actual authorized recipe.");let f=await e.loadCatalog({ref:r.profileRef,sourceRevision:r.sourceRevision,harnessRelease:r.harnessRelease});if(o&&o.declaredProfileCatalogHash!==f.catalogHash)throw new Error("The original Profile verifier catalog changed.");let l=o?D(o):null;if(l&&t.definitionId!==l.id)throw new Error("Use the external recipe's own definition identity.");let m={schemaVersion:"openpond.profileEvaluations.v1",definitions:l?[l]:f.definitions,suites:l?[]:f.suites},u=l??f.definitions.find(c=>c.id===t.definitionId);if(!u)throw new Error(`Evaluation ${t.definitionId} is absent from the selected Profile release.`);let k=u.target,z=k.kind==="workflow"?r.workflows.find(c=>c.binding.workflowId===k.workflowId)?.binding:_.parse({schemaVersion:"openpond.profileComponentBinding.v1",profileId:r.profileRef.profileId,sourceRevision:r.sourceRevision,harnessRelease:r.harnessRelease,target:k});if(!z)throw new Error(`Evaluation workflow ${k.kind==="workflow"?k.workflowId:""} is absent from the selected Profile release.`);let w=g(s?.packageValue??await e.loadTasksetPackage(u,r.profileRef.profileId,r.harnessRelease)),p=w.taskset;if(p.id!==u.tasksetRelease.id||p.contentHash!==u.tasksetRelease.contentHash)throw new Error("Evaluation Taskset package differs from its released definition.");let le=p.environment.kind==="text"&&p.tools.length===0,M=p.environment.kind==="work"&&p.environment.entrypoint==="openpond-work-v1"&&p.tools.every(c=>["work_exec","work_save_output"].includes(c.name));if(!le&&!M)throw new Error("Profile evaluation supports text cases or Work cases with the built-in execution and output tools.");if(t.maximumSpendUsd!==void 0&&M&&!e.boundedWorkComputeAvailable)throw new Error("This host has not admitted budgeted Work compute.");if(p.tasks.some(c=>c.artifactRefs.length>b.maxAttachments||c.artifactRefs.some(x=>x.visibility!=="policy"||x.mediaType!=="application/pdf"||x.sizeBytes>b.maxAttachmentBytes)))throw new Error("Profile evaluation accepts only bounded policy-visible PDF task attachments.");if(!o&&!e.privateGradingPreflight&&(p.graders.some(c=>c.kind==="model_judge"||c.kind==="custom_verifier")||p.metrics?.aggregation==="custom"))throw new Error("Profile evaluation cannot run this Taskset's model judge, custom verifier, or custom metric in the current app-server runtime.");await e.privateGradingPreflight?.(w);let B={adapterId:k.kind==="workflow"?"openpond.profile-workflow":"openpond.profile-component",placement:e.placement,runtimeVersion:"app-server-v1",capabilityReceipt:n({adapterId:k.kind==="workflow"?"openpond.profile-workflow":"openpond.profile-component",packageHash:w.contentHash,connectedAppScopes:p.policy.connectedAppScopes})},ce={...$({catalog:m,definitionId:u.id,profileId:r.profileRef.profileId,sourceRevision:r.sourceRevision,harnessRelease:r.harnessRelease,environmentHash:n({packageHash:w.contentHash,runtimeTarget:B})}),...o?{externalDatasetBinding:o}:{},...e.sourceCandidate?{sourceCandidate:e.sourceCandidate}:{}};if(o&&(o.packageHash!==w.contentHash||o.environmentHash!==n(p.environment)||o.privateDatasetClosureHash!==n(w.files.filter(c=>c.asset.visibility!=="policy").map(c=>c.asset))))throw new Error("External Dataset package/environment/private closure changed.");let de=j.parse({provider:t.modelRef.providerId,model:t.modelRef.modelId,revision:null,artifactHash:t.hostArtifactHash??null,tokenizerRevision:null,chatTemplateHash:null}),O=await e.modelConfigurationHash(t.modelRef,t),I=G({schemaVersion:"openpond.tasksetRunManifest.v1",id:t.id,tasksetRelease:u.tasksetRelease,packageHash:w.contentHash,execution:{kind:"harness",harnessRelease:r.harnessRelease},profileEvaluation:ce,policy:{kind:"model",model:de,configurationHash:O},gradingRole:"evaluation",metricPolicy:F(p),population:o?o.population.map(c=>({...c,receiptId:`evaluation-${n([t.id,c.taskId,c.seed,c.fixtureId]).slice(0,32)}`})):u.taskIds.flatMap(c=>u.seeds.map(x=>({receiptId:`evaluation-${n([t.id,c,x]).slice(0,32)}`,taskId:c,seed:x,fixtureId:null}))),runtimeTarget:B,limits:{maxTurns:128,timeoutMs:p.environment.defaultTimeoutMs,maxOutputBytes:25e7,maximumSpendUsd:t.maximumSpendUsd??null},createdAt:t.createdAt,metadata:{sourceTasksetId:p.metadata.sourceTasksetId??p.id,...r.profileRef.source==="openpond_git"?{profileRepositoryId:r.profileRef.repositoryId}:{},...t.hostExperiment?{experimentDefinition:t.hostExperiment.definition,experimentConfigurationHash:t.hostExperiment.configurationHash,...t.hostExperiment.project?{project:t.hostExperiment.project}:{}}:{}}});if(T(I,p,m),s&&await s.authorize(),t.expectedManifestHash&&I.contentHash!==t.expectedManifestHash)throw new Error("Profile evaluation setup changed since preview; prepare the run again.");return{manifest:I,taskset:p,profileRef:r.profileRef,binding:z,modelRef:t.modelRef,modelConfigurationHash:O}}}d(Le,"createProfileEvaluationRunPreparationService");import{randomUUID as A,createHash as ge}from"node:crypto";import{mkdtemp as ve,mkdir as ke,writeFile as V,rm as we}from"node:fs/promises";import Re from"node:os";import E from"node:path";var ne=d(async e=>{let a=g(e.packageValue);if(e.grader.runtime!=="sandbox_process")throw new Error("Select the sandbox process runtime for a local file grader.");if(!a.taskset.graders.some(r=>n(r)===n(e.grader)))throw new Error("The private grader differs from its package.");if(!a.taskset.tasks.some(r=>n(r)===n(e.task)))throw new Error("The private case differs from its package.");await e.authorize(),e.signal?.throwIfAborted();let i=await ve(E.join(Re.tmpdir(),"profile-private-grade-")),t=A();try{for(let f of a.files.filter(l=>l.asset.visibility!=="policy")){let l=f.asset.path;if(E.isAbsolute(l)||l.split(/[\\/]/).some(u=>!u||u==="."||u===".."))throw new Error("Private grader asset path invalid.");let m=E.join(i,"package",l);await ke(E.dirname(m),{recursive:!0,mode:448}),await V(m,P(f),{mode:256})}await V(E.join(i,"request.json"),JSON.stringify({task:e.task,attempt:e.evidence,input:e.task.input,output:e.evidence.output,artifacts:"artifacts"in e.evidence?e.evidence.artifacts:[],expectedOutput:e.task.expectedOutput}),{mode:256});let r=`import fs from 'node:fs/promises'; const module=await import(${JSON.stringify("./package/"+e.grader.verifierRef.path)}); const result=await module[${JSON.stringify(e.grader.exportName??"verify")}](JSON.parse(await fs.readFile('request.json','utf8'))); console.log(JSON.stringify(result));`;await V(E.join(i,"runner.mjs"),r,{mode:256});let s=await oe({authorize:d(async()=>(await e.authorize(),e.signal?.throwIfAborted(),{candidateId:t,candidateRevision:1,ownerId:t,sessionId:t,turnId:t,sourceRoot:i,writablePaths:[]}),"authorize")})({candidateId:t,sessionId:t,turnId:t,expectedRevision:1,command:"/runtime/node --max-old-space-size=512 runner.mjs",timeoutMs:e.grader.timeoutMs,maxOutputBytes:7e4,signal:e.signal});if(await e.authorize(),e.signal?.throwIfAborted(),s.code!==0||s.timedOut||s.stdoutTruncated||s.stderrTruncated)throw new Error("Private grading sandbox did not complete.");return H.parse(JSON.parse(s.stdout))}finally{await we(i,{recursive:!0,force:!0})}},"executeLocalProfileVerifier");function lt(e){return async a=>{if(!a.manifest)throw new Error("The hosted grader requires its admitted manifest.");await a.authorize(),a.signal?.throwIfAborted();let i="artifacts"in a.evidence&&Array.isArray(a.evidence.artifacts)?a.evidence.artifacts.map(({reference:l,title:m,contentType:u})=>({reference:l,title:m,contentType:u})):[],t="caseOwner"in a.evidence?a.evidence.caseOwner:null;if(!t?.sessionId||!t.turnId)throw new Error("The private grader has no sealed case owner.");let r=Buffer.from(JSON.stringify({manifest:a.manifest,packageValue:a.packageValue,graderId:a.grader.id,taskId:a.task.id,evidence:{...a.evidence,artifacts:i}}));if(r.length>2e7)throw new Error("The private grading package exceeds its transport limit.");let o={callId:A(),sessionId:t.sessionId,turnId:t.turnId,sha256:ge("sha256").update(r).digest("hex"),sizeBytes:r.length,timeoutMs:a.grader.timeoutMs},s=d((l,m=12e4)=>e.request(re.parse({contractVersion:ae,requestId:A(),operation:"profile-evaluations/grade",params:l}),m),"request");for(let l=0;l<r.length;l+=98304)await a.authorize(),a.signal?.throwIfAborted(),await s({...o,action:"upload",offset:l,contentsBase64:r.subarray(l,l+98304).toString("base64")});let f=await s({...o,action:"execute"},a.grader.timeoutMs+12e4);return await a.authorize(),a.signal?.throwIfAborted(),H.parse(f)}}d(lt,"createHostedProfileVerifier");async function Pe(e,a){let i=g(e);for(let r of i.taskset.graders){if(r.kind==="model_judge"&&(!a||r.calibrationStatus!=="passed"))throw new Error("This Profile requires its current calibrated judge and bounded private provider owner.");let o="verifierRef"in r?r.verifierRef:"rubricRef"in r?r.rubricRef:null;o&&C(i,o)}let t=i.taskset.metrics?.customAggregator;if(t){let r=i.files.find(o=>o.asset.path===t.module);if(!r||r.asset.visibility==="policy"||S(P(r))!==t.contentHash)throw new Error("The authored aggregate metric is not its exact private release.");new TextDecoder("utf8",{fatal:!0}).decode(P(r))}}d(Pe,"preflightProfilePrivateGrading");function C(e,a){let i=e.files.find(t=>t.asset.id===a.id);if(!i||i.asset.visibility==="policy"||n(i.asset)!==n(a))throw new Error("The exact private grader asset is unavailable.");return new TextDecoder("utf8",{fatal:!0}).decode(P(i))}d(C,"readPrivate");async function vt(e){let a=g(e.packageValue);if(a.contentHash!==e.manifest.packageHash||a.taskset.contentHash!==e.manifest.tasksetRelease.contentHash)throw new Error("The private grading package changed its frozen Run identity.");await e.authorize(),await Pe(a,!!e.executeBudgetedJudge),await e.authorize();let i=d(async({grader:o,task:s,evidence:f})=>{let l=e.signal;await e.authorize(),l?.throwIfAborted();let m={manifest:e.manifest,packageValue:a,grader:o,task:s,evidence:f,signal:l,authorize:e.authorize},u=e.executeSandboxVerifier?await e.executeSandboxVerifier(m):o.runtime==="sandbox_process"?await ne(m):await ie({source:C(a,o.verifierRef),exportName:o.exportName,runtime:o.runtime,timeoutMs:o.timeoutMs,signal:l,value:{task:s,attempt:f,input:s.input,output:f.output,artifacts:"artifacts"in f?f.artifacts:[],expectedOutput:s.expectedOutput,infrastructureError:f.infrastructureError??null}});return await e.authorize(),l?.throwIfAborted(),{score:u.score,passed:u.passed,rewardEligible:o.rewardEligible,failureClass:null,feedback:[u.feedback],visibleEvidenceRefs:[],privilegedEvidenceRefs:u.evidenceRefs}},"customVerifier"),t=a.taskset.metrics?.customAggregator,r=t?new TextDecoder("utf8",{fatal:!0}).decode(P(a.files.find(o=>o.asset.path===t.module))):void 0;return{authorize:e.authorize,customVerifier:i,...e.executeBudgetedJudge?{modelJudge:L({readRubric:d(async o=>{await e.authorize();let s=C(a,o);return await e.authorize(),s},"readRubric"),executeBudgeted:d(async(o,s)=>{await e.authorize(),s?.throwIfAborted();let f=await e.executeBudgetedJudge(o,s);return await e.authorize(),s?.throwIfAborted(),f},"executeBudgeted")})}:{},...r!==void 0?{metricSource:r,metricExecutor:d(async o=>{await e.authorize(),o.signal?.throwIfAborted();let s=await se(o);return await e.authorize(),o.signal?.throwIfAborted(),s},"metricExecutor")}:{}}}d(vt,"createProfilePrivateGradingOwner");export{ne as a,lt as b,Ae as c,me as d,Je as e,Le as f,Pe as g,vt as h};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{o as r}from"./chunk-
|
|
2
|
+
import{o as r}from"./chunk-O4FBOUNX.js";import{v as o}from"./chunk-M55H7KVR.js";import{M as t}from"./chunk-RCA6NGVA.js";import{f as a}from"./chunk-BIPQCJ5V.js";import{A as e}from"./chunk-PF56N7ZY.js";var s=e.object({profileRef:r,manifest:o,metric:t,gradeRefs:e.array(a),receiptRefs:e.array(a),passRate:e.number().min(0).max(1),passed:e.boolean(),completedAt:e.string().datetime(),contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict();export{s as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{a as E}from"./chunk-WYZWDMMF.js";import{d as y}from"./chunk-DG4TYVPF.js";import{h as c,i as _}from"./chunk-PWK5Z5S3.js";import{G as v,I,J as t,K as d,L as o,M as g,N as l,P as A,Q as C,T as k,U as w,Y as j,k as P,q as i,u as r,x as R}from"./chunk-SG6JZ7HD.js";import{c as f,f as n}from"./chunk-ON2RNOCG.js";import{d as q,e as T}from"./chunk-RCA6NGVA.js";import{A as e}from"./chunk-PF56N7ZY.js";import{a as u}from"./chunk-FTQLQJQV.js";var b="local_path:";function Y(p){return`${b}${p.trim()}`}u(Y,"localPathWorkspaceId");function Z(p){return p.startsWith(b)&&p.slice(b.length).trim()||null}u(Z,"workspacePathFromLocalPathWorkspaceId");var ee=e.object({appId:e.string(),source:e.enum(["openpond","github","local_git","local_folder","unknown"]),workspacePath:e.string(),repoPath:e.string(),initialized:e.boolean(),remoteUrl:e.string().nullable(),expectedRemoteUrl:e.string().nullable(),currentBranch:e.string().nullable(),headCommit:e.string().nullable().optional().default(null),upstreamBranch:e.string().nullable().optional().default(null),ahead:e.number().int().nonnegative().optional().default(0),behind:e.number().int().nonnegative().optional().default(0),diverged:e.boolean().optional().default(!1),linkedSourceHeadCommit:e.string().nullable().optional().default(null),aheadOfLinkedSource:e.number().int().nonnegative().optional().default(0),behindLinkedSource:e.number().int().nonnegative().optional().default(0),divergedFromLinkedSource:e.boolean().optional().default(!1),linkedSourceComparisonError:e.string().nullable().optional().default(null),lastFetchAt:e.string().nullable().optional().default(null),defaultBranch:e.string().nullable(),branches:e.array(e.string()),dirty:e.boolean(),changedFilesCount:e.number(),untrackedFilesCount:e.number(),error:e.string().nullable(),updatedAt:e.string()}),F=e.object({path:e.string(),status:e.string(),additions:e.number(),deletions:e.number(),patch:e.string(),content:e.string().nullable().optional().default(null)}),ne=e.object({appId:e.string(),repoPath:e.string(),initialized:e.boolean(),dirty:e.boolean(),filesChanged:e.number(),additions:e.number(),deletions:e.number(),repoFiles:e.array(e.string()).optional().default([]),files:e.array(F),error:e.string().nullable(),updatedAt:e.string()}),te=e.object({branch:e.string().trim().min(1).max(160)}),oe=e.object({path:e.string().trim().min(1),content:e.string()}),M=e.object({line:e.number().int().nonnegative(),character:e.number().int().nonnegative()}),U=e.object({start:M,end:M}),N=e.object({path:e.string(),range:U,severity:e.enum(["error","warning","info","hint"]),message:e.string(),source:e.string().nullable().optional().default(null),code:e.string().nullable().optional().default(null)}),W=e.object({id:e.string(),root:e.string(),status:e.enum(["connected","unavailable","error"]),message:e.string().nullable().optional().default(null)}),ae=e.object({path:e.string().trim().min(1),content:e.string().optional(),waitForDiagnostics:e.boolean().optional().default(!0)}),ie=e.object({appId:e.string(),path:e.string(),diagnostics:e.array(N),servers:e.array(W),updatedAt:e.string()}),K=e.object({operation:e.enum(["hover","definition","references","documentSymbol"]),path:e.string().trim().min(1),content:e.string().optional(),line:e.number().int().nonnegative().optional(),character:e.number().int().nonnegative().optional()}),re=e.object({appId:e.string(),operation:K.shape.operation,path:e.string(),results:e.unknown(),servers:e.array(W),updatedAt:e.string()}),h=e.object({pinned:e.boolean().optional(),archived:e.boolean().optional(),order:e.number().optional()}),le=e.record(e.string(),h);var a=e.object({source:e.enum(["local","github","openpond_git"]),repositoryId:e.string().trim().min(1),profileId:e.string().trim().min(1)}),B=e.object({ref:a,revision:e.string().nullable(),sourceHash:e.string()});var s=e.enum(["chat","work","development"]),de=e.enum(["chat","models","console","development"]),D="work";var S=e.enum(["openpond.lab"]),x=e.object({id:e.string(),experience:s.default(D),provider:t,modelRef:n.nullable().optional(),openPondCommandAccessMode:o.default(I),systemKind:S.nullable().optional(),hiddenFromDefaultSidebar:e.boolean().optional(),parentSessionId:e.string().nullable().optional(),parentTurnId:e.string().nullable().optional(),subagentRunId:e.string().nullable().optional(),subagentRoleId:i.nullable().optional(),subagentDelegationMode:r.nullable().optional(),title:e.string(),appId:e.string().nullable(),appName:e.string().nullable(),workspaceKind:l.optional(),workspaceId:e.string().nullable().optional(),workspaceName:e.string().nullable().optional(),localProjectId:e.string().nullable().optional(),cloudProjectId:e.string().nullable().optional(),cloudTeamId:e.string().nullable().optional(),currentProfile:a.nullable().optional(),profileWorkflowBinding:q.nullable().optional(),profileComponentBinding:T.nullable().optional(),metadata:e.record(e.string(),e.unknown()).optional(),cwd:e.string().nullable(),codexThreadId:e.string().nullable(),nativeAgent:e.object({provider:e.union([e.enum(["claude-code","grok-build","opencode"]),f]),instanceId:e.string().min(1),sessionId:e.string().min(1),cwd:e.string().min(1)}).nullable().optional(),createdAt:e.string(),updatedAt:e.string(),status:e.enum(["idle","active","failed","closed"]),runtimeSeconds:e.number().int().nonnegative().optional(),runtimeRunningSince:e.string().nullable().optional(),pinned:e.boolean(),savedForLater:e.boolean().optional(),archived:e.boolean(),order:e.number()}),Ce=e.object({id:e.string(),sessionId:e.string(),providerTurnId:e.string().nullable(),modelRef:n.nullable().optional(),prompt:e.string(),startedAt:e.string(),completedAt:e.string().nullable(),status:e.enum(["in_progress","completed","failed","interrupted"]),error:e.string().nullable(),metadata:e.record(e.string(),e.unknown()).optional().default({}),createImproveRun:c.nullable().optional().default(null),profileSnapshot:B.nullable().optional(),harnessSnapshot:y.nullable().optional()});var L=e.object({id:e.string().trim().min(1).max(191),agentId:e.string().trim().min(1).max(191).optional().nullable(),sourcePath:e.string().trim().min(1).max(2e3).optional().nullable(),sourceActionId:e.string().trim().min(1).max(191).optional().nullable(),name:e.string().trim().min(1).max(191).optional().nullable(),label:e.string().trim().min(1).max(160).optional().nullable(),description:e.string().trim().max(1e3).optional().nullable(),visibility:e.string().trim().max(80).optional().nullable(),inputSchema:e.union([e.string().trim().max(191),e.record(e.string(),e.unknown())]).optional().nullable(),outputSchema:e.union([e.string().trim().max(191),e.record(e.string(),e.unknown())]).optional().nullable(),approvalPolicy:e.record(e.string(),e.unknown()).optional().nullable(),artifactPolicy:e.record(e.string(),e.unknown()).optional().nullable(),setupRequirements:e.array(e.record(e.string(),e.unknown())).optional(),mcp:e.record(e.string(),e.unknown()).optional().nullable(),schedulePolicy:e.record(e.string(),e.unknown()).optional().nullable(),trace:e.record(e.string(),e.unknown()).optional().nullable(),implementation:e.record(e.string(),e.unknown()).optional().nullable(),invokesModel:e.boolean().optional()});var z=e.enum(["slack","microsoft_teams","github","google","turnkey","x","mcp"]),H=e.enum(["slack","microsoft_teams","github","google","turnkey","x","mcp"]),V=e.enum(["native_bot","oauth_connector","wallet_connector","mcp_endpoint"]),X=e.object({kind:e.literal("integration"),provider:z,appIds:e.array(H).min(1).max(4),setupSurfaces:e.array(V).min(1).max(4),connectionIds:e.array(e.string().trim().min(1)).max(8).optional(),capabilities:e.array(e.string().trim().min(1)).max(64).optional()}).strict(),m={maxAttachments:10,maxAttachmentBytes:12*1024*1024,maxAttachmentBase64Chars:Math.ceil(12*1024*1024*4/3)+16,maxTextChars:2e5},$=e.enum(["image","text","file"]),G=e.object({sessionId:e.string().trim().min(1).max(200),turnId:e.string().trim().min(1).max(200),attachmentId:e.string().trim().min(1).max(200),storageName:e.string().trim().min(1).max(240),contentType:e.string().trim().min(1).max(160)}),J=e.object({sessionId:e.string().trim().min(1).max(200),turnId:e.string().trim().min(1).max(200),attachmentId:e.string().trim().min(1).max(200),storageName:e.string().trim().min(1).max(1024),contentType:e.string().trim().min(1).max(160)}),O=e.object({id:e.string().trim().min(1),name:e.string().trim().min(1).max(240),mediaType:e.string().trim().min(1).max(160),sizeBytes:e.number().int().nonnegative().max(m.maxAttachmentBytes),kind:$,lineCount:e.number().int().nonnegative().max(m.maxAttachmentBytes+1).optional(),relativePath:e.string().trim().min(1).max(1024).optional(),text:e.string().max(m.maxTextChars).optional(),contentsBase64:e.string().max(m.maxAttachmentBase64Chars).optional()}),He=O.omit({text:!0,contentsBase64:!0}).extend({imagePreview:G.optional(),filePreview:J.optional()}),Ve=e.object({experience:s.optional(),provider:t.default(v),modelRef:n.optional(),openPondCommandAccessMode:o.optional(),systemKind:S.nullable().optional(),hiddenFromDefaultSidebar:e.boolean().optional(),parentSessionId:e.string().trim().min(1).max(200).nullable().optional(),parentTurnId:e.string().trim().min(1).max(200).nullable().optional(),subagentRunId:e.string().trim().min(1).max(200).nullable().optional(),subagentRoleId:i.nullable().optional(),subagentDelegationMode:r.nullable().optional(),appId:e.string().nullable().optional(),appName:e.string().nullable().optional(),workspaceKind:l.optional(),workspaceId:e.string().nullable().optional(),workspaceName:e.string().nullable().optional(),localProjectId:e.string().nullable().optional(),cloudProjectId:e.string().nullable().optional(),cloudTeamId:e.string().nullable().optional(),currentProfile:a.nullable().optional(),profileWorkflowBinding:x.shape.profileWorkflowBinding,profileComponentBinding:x.shape.profileComponentBinding,metadata:e.record(e.string(),e.unknown()).optional(),cwd:e.string().nullable().optional(),title:e.string().optional(),autoTitlePrompt:e.string().trim().min(1).max(2e4).optional()}),Xe=e.object({teamId:e.string().trim().min(1),projectName:e.string().trim().min(1).max(120).optional(),branch:e.string().trim().min(1).max(120).optional(),chatSessionId:e.string().trim().min(1).max(200).optional(),displayPrompt:e.string().trim().min(1).max(2e3).optional()}),$e=e.object({branch:e.string().trim().min(1).max(120).optional()}),Ge=e.object({prompt:e.string().min(1),workflowInput:e.unknown().optional(),metadata:e.record(e.string(),e.unknown()).optional(),usageAttribution:E.optional().nullable(),cwd:e.string().nullable().optional(),model:e.string().nullable().optional(),modelRef:n.optional(),mentionedAppIds:e.array(e.string().trim().min(1)).max(8).optional(),mentionedConnectedApps:e.array(X).max(8).optional(),openPondActionCatalog:e.array(L).max(100).optional(),attachments:e.array(O).max(m.maxAttachments).optional(),createImproveRun:c.optional().nullable(),approvalPolicy:e.enum(["untrusted","on-failure","on-request","never"]).default("on-request"),sandbox:e.enum(["read-only","workspace-write","danger-full-access"]).default("workspace-write"),codexPermissionMode:d.default("default"),codexReasoningEffort:g.optional()}),Je=e.object({prompt:e.string().min(1),error:e.string().min(1),target:e.enum(["cloud_workspace","hybrid_sandbox"])}),Qe=_,Ye=e.object({reason:e.enum(["manual"]).default("manual"),model:e.string().nullable().optional(),modelRef:n.optional()}),Ze=e.object({experience:s.optional(),provider:t.optional(),modelRef:n.nullable().optional(),openPondCommandAccessMode:o.optional(),pinned:e.boolean().optional(),savedForLater:e.boolean().optional(),archived:e.boolean().optional(),order:e.number().optional(),title:e.string().optional(),parentSessionId:e.string().trim().min(1).max(200).nullable().optional(),parentTurnId:e.string().trim().min(1).max(200).nullable().optional(),subagentRunId:e.string().trim().min(1).max(200).nullable().optional(),subagentRoleId:i.nullable().optional(),subagentDelegationMode:r.nullable().optional(),appId:e.string().nullable().optional(),appName:e.string().nullable().optional(),workspaceKind:l.optional(),workspaceId:e.string().nullable().optional(),workspaceName:e.string().nullable().optional(),localProjectId:e.string().nullable().optional(),cloudProjectId:e.string().nullable().optional(),cloudTeamId:e.string().nullable().optional(),currentProfile:a.nullable().optional(),metadata:e.record(e.string(),e.unknown()).optional(),cwd:e.string().nullable().optional()}),en=e.object({command:e.string().trim().min(1),cwd:e.string().trim().min(1).max(4096).nullable().optional(),timeoutSeconds:e.number().int().min(1).max(3600).optional()}),nn=h,tn=e.object({appIds:e.array(e.string()).min(1)}),on=e.object({expectedRevision:e.string().optional(),defaultChatProvider:t.optional(),defaultChatModel:e.string().min(1).optional(),defaultChatModelRef:n.nullable().optional(),subagents:R.optional(),codexPermissionMode:d.optional(),codexReasoningEffort:g.optional(),openPondCommandAccessMode:o.optional(),defaultBranchPrefix:e.string().trim().max(48).optional(),defaultNewProjectDirectory:e.string().trim().max(4096).optional(),defaultTeamId:e.string().trim().max(191).nullable().optional(),advancedWorkspaceControls:e.boolean().optional(),steerActiveResponses:e.boolean().optional(),contextCompaction:k.optional(),training:w.optional(),sidebarWidth:e.number().int().min(244).max(560).optional(),diffPanelWidth:e.number().int().min(320).max(2400).optional(),sidebarSectionsCollapsed:A.optional(),editor:C.optional()}),an=P,rn=e.object({message:e.string().trim().min(1).max(4e3),surface:e.string().trim().min(1).max(120).default("app"),stack:e.string().max(12e3).nullable().optional(),context:e.record(e.string(),e.unknown()).optional()}).strict();var ln=e.object({activeTemplateId:j,templateName:e.string().trim().min(1).max(80),soul:e.string().trim().min(1).max(8e3),saveAsNew:e.boolean().optional().default(!1)}),sn=e.object({decision:e.enum(["accept","acceptForSession","decline","cancel"]),answers:e.record(e.string().min(1).max(2e3),e.string().trim().min(1).max(8e3)).optional()}),mn=e.object({branch:e.string().trim().min(1).max(240).nullable().optional(),surface:e.enum(["desktop","terminal"])}),pn=e.object({handle:e.string().min(1),baseUrl:e.string().nullable().optional()}),cn=e.object({handle:e.string().min(1),baseUrl:e.string().nullable().optional()}),un=e.object({handle:e.string().min(1).optional(),apiKey:e.string().min(1),baseUrl:e.string().nullable().optional(),apiBaseUrl:e.string().nullable().optional(),chatApiBaseUrl:e.string().nullable().optional(),environment:e.string().nullable().optional(),setActive:e.boolean().optional()}),dn=e.object({handle:e.string().min(1),currentBaseUrl:e.string().nullable().optional(),apiKey:e.string().min(1).optional(),baseUrl:e.string().nullable().optional(),apiBaseUrl:e.string().nullable().optional(),chatApiBaseUrl:e.string().nullable().optional(),environment:e.string().nullable().optional(),setActive:e.boolean().optional()});export{Y as a,Z as b,ee as c,F as d,ne as e,te as f,oe as g,ae as h,ie as i,K as j,re as k,le as l,s as m,D as n,a as o,x as p,Ce as q,L as r,m as s,J as t,O as u,Ve as v,Xe as w,$e as x,Ge as y,Je as z,Qe as A,Ye as B,Ze as C,en as D,nn as E,tn as F,on as G,an as H,rn as I,ln as J,sn as K,mn as L,pn as M,cn as N,un as O,dn as P};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{a as L,b as Ne,d as de}from"./chunk-M4ZF44H5.js";import{a as dt}from"./chunk-SKRNWRKV.js";import{a as Ke,b as Xe,c as Qe,d as Ye,e as ce}from"./chunk-IUBARBGI.js";import{a as M,b as ue}from"./chunk-DK7IKI7O.js";import{b as pt,c as mt}from"./chunk-GOYBYYPQ.js";import{R as it,a as ie,d as Ue,e as ze,g as et,ga as lt,ha as ct,ia as ft,j as tt,k as nt,v as st,w as pe,y as at}from"./chunk-655DQ6AX.js";import{a as $e}from"./chunk-WEHBK3MC.js";import{g as ut}from"./chunk-B46HZ3MX.js";import{b as Ze}from"./chunk-WS2ZZBAQ.js";import{b as Je,d as Ge}from"./chunk-WDEO44UN.js";import{k as Ve}from"./chunk-JHMS2WXM.js";import{a as rt,b as ot}from"./chunk-GW766ZSO.js";import{s as D,u as B,v as le,z as je}from"./chunk-XQBIHPPX.js";import{i as Fe,p as Be}from"./chunk-7LZISGTA.js";import{b as qe,d as E,g as Q}from"./chunk-FSQWAANK.js";import{Q as De,m as Le}from"./chunk-ZR7LIMJS.js";import{a as Me}from"./chunk-PCNLC5H3.js";import{a as We}from"./chunk-O4FBOUNX.js";import{c as Oe}from"./chunk-L3KS6MOV.js";import{a as er}from"./chunk-JFXINDOQ.js";import{g as He}from"./chunk-BK63OQRW.js";import{_ as Ie,ca as _e,fa as Ce}from"./chunk-LHA7RQBA.js";import{F as xe}from"./chunk-SG6JZ7HD.js";import{o as be}from"./chunk-H7IWJN7L.js";import{m as H}from"./chunk-BIPQCJ5V.js";import{a as n,e as Zt}from"./chunk-FTQLQJQV.js";import{randomUUID as yr}from"node:crypto";import{mkdir as Pr}from"node:fs/promises";import q from"node:path";function gt(e){return async(t,r)=>{let s=await e?.(t,r)??null;if((t.metadata?.standaloneExperiment!==void 0||t.metadata?.localProfileExperiment!==void 0)&&!s)throw new Error("This native Experiment session has no active durable model-dispatch owner.");return s}}n(gt,"experimentSessionStreamResolver");var wt=Zt(er(),1);import{randomUUID as me}from"node:crypto";var tr=15e3,rr=3e4;function Or(e){let t=new Set,r=null,s=null;async function p(a){if(!a.profileRef||!a.profileWorkflowId)throw new Error(a.profileMigrationError??`Chat Workflow ${a.id} has no Profile package.`);let u=await e.getSession(a.sessionId),i=await e.resolveProfileOwner(u,a.profileRef),c=await e.readProfilePackage(i.sourcePath,a.profileWorkflowId);return{...a,name:c.name,prompt:c.prompt}}n(p,"authoredWorkflow");async function h(){for(let a of await e.store.listChatWorkflows())if(!(a.profileRef&&a.profileWorkflowId))try{let u=await e.getSession(a.sessionId);if(!u.currentProfile)throw new Error("Original session has no explicit Profile owner.");let i=await e.resolveProfileOwner(u,u.currentProfile),c={...a,profileRef:i.ref,profileWorkflowId:a.profileWorkflowId??`chat-${a.id.toLowerCase()}`,profileMigrationError:null};await e.saveProfilePackage(i.sourcePath,c),await e.store.patchChatWorkflow(a.id,()=>c)}catch(u){let i=`Profile package migration unresolved: ${u instanceof Error?u.message:String(u)}`;await e.store.patchChatWorkflow(a.id,c=>({...c,profileMigrationError:i})),e.logger?.warn("chat workflow Profile migration unresolved",{workflowId:a.id,error:i})}}n(h,"migrateExistingWorkflows");async function w(a){let u=await e.getSession(a.sessionId),i=await e.resolveProfileOwner(u),c=E(),g=Y(a.recurrence,new Date,0);if(!g.value)throw new Error(g.error??"This workflow has no future occurrence.");let k={id:me(),sessionId:u.id,sessionTitle:u.title,sourceTurnId:a.sourceTurnId??null,name:a.name,prompt:a.prompt,profileRef:i.ref,profileWorkflowId:`chat-${me()}`,recurrence:a.recurrence,enabled:!0,nextRunAt:g.value,lastRunAt:null,lastRunStatus:null,lastRunId:null,lastError:g.error,scheduledRunCount:0,createdAt:c,updatedAt:c};return await e.saveProfilePackage(i.sourcePath,k),e.store.upsertChatWorkflow(k)}n(w,"create");async function v(){if(e.isClosing())return;let a=await e.store.listDueChatWorkflows(E());for(let u of a)if(!t.has(u.id)){if(e.isSessionTurnActive(u.sessionId)){await e.store.patchChatWorkflow(u.id,i=>({...i,nextRunAt:new Date(Date.now()+rr).toISOString(),lastError:"Waiting for the attached chat to finish its current turn.",updatedAt:E()}));continue}await d(u,u.nextRunAt??E(),"schedule")}}n(v,"runTick");function l(){if(s)return s;let a=v().finally(()=>{s===a&&(s=null)});return s=a,a}n(l,"trackedTick");async function d(a,u,i){a=await p(a);let c=E(),g=e.store.home?await Ce(e.store.home):void 0,k={definitionSnapshot:structuredClone(a),...g?{configurationSnapshot:{effectiveRevision:g.effectiveRevision,sources:g.sources}}:{},id:me(),workflowId:a.id,sessionId:a.sessionId,scheduledFor:u,trigger:i,status:"queued",turnId:null,error:null,createdAt:c,startedAt:null,completedAt:null,updatedAt:c},y=await e.store.insertChatWorkflowRun(k);return t.add(a.id),e.queue.enqueue({label:"chat-workflow-run",metadata:{workflowId:a.id,sessionId:a.sessionId,trigger:i,scheduledFor:u}},async()=>{try{await f(a,y)}finally{t.delete(a.id)}}),y}n(d,"enqueue");async function f(a,u){let i=E();await e.store.patchChatWorkflowRun(u.id,S=>({...S,status:"running",startedAt:i,updatedAt:i}));let c=null,g=null;try{c=await e.sendTurn(a.sessionId,{prompt:a.prompt,metadata:{interactionKind:"scheduled_workflow",chatWorkflowId:a.id,chatWorkflowName:a.name,chatWorkflowRunId:u.id,scheduledFor:u.scheduledFor}})}catch(S){g=S instanceof Error?S.message:String(S)}let k=E(),y=c?.status==="completed"?"succeeded":"failed";await e.store.patchChatWorkflowRun(u.id,S=>({...S,status:y,turnId:c?.id??null,error:g??c?.error??null,completedAt:k,updatedAt:k})),await e.store.patchChatWorkflow(a.id,S=>{let b=S.scheduledRunCount+(u.trigger==="schedule"?1:0),P=u.trigger==="manual"?{value:S.nextRunAt,error:null}:Y(S.recurrence,new Date,b);return{...S,enabled:P.value?S.enabled:!1,nextRunAt:S.enabled?P.value:null,lastRunAt:k,lastRunStatus:y,lastRunId:u.id,lastError:P.error??g??c?.error??null,scheduledRunCount:b,updatedAt:k}})}return n(f,"execute"),{async start(){r||(await h(),l().catch(a=>e.logger?.warn("chat workflow tick failed",{error:String(a)})),r=setInterval(()=>{l().catch(a=>e.logger?.warn("chat workflow tick failed",{error:String(a)}))},e.tickMs??tr),r.unref?.())},async stop(){r&&clearInterval(r),r=null,await s?.catch(()=>{})},create:w,async list(a){let u=await e.store.listChatWorkflows({sessionId:a});return Promise.all(u.map(async i=>{try{return await p(i)}catch(c){return{...i,profileMigrationError:c instanceof Error?c.message:String(c)}}}))},listRuns:n(a=>e.store.listChatWorkflowRuns(a),"listRuns"),async patch(a,u){let i=await e.store.getChatWorkflow(a);if(!i)return null;let c=E();if("enabled"in u){let S=u.enabled?Y(i.recurrence,new Date,i.scheduledRunCount):{value:null,error:null};return e.store.patchChatWorkflow(a,b=>({...b,enabled:u.enabled&&!!S.value,nextRunAt:u.enabled?S.value:null,lastError:S.error,updatedAt:c}))}let g=Y(u.recurrence,new Date,0);if(!i.profileRef||!i.profileWorkflowId)throw new Error(`Chat Workflow ${a} has no resolved Profile owner; migrate it before editing.`);let k=await e.getSession(i.sessionId),y=await e.resolveProfileOwner(k,i.profileRef);return await e.saveProfilePackage(y.sourcePath,{...i,name:u.name,prompt:u.prompt}),e.store.patchChatWorkflow(a,S=>({...S,name:u.name,prompt:u.prompt,recurrence:u.recurrence,enabled:!!g.value,nextRunAt:g.value,lastError:g.error,scheduledRunCount:0,updatedAt:c}))},remove:n(a=>e.store.deleteChatWorkflow(a),"remove"),async runNow(a){let u=await e.store.getChatWorkflow(a);if(!u)throw new Error("Chat workflow not found.");if(e.isSessionTurnActive(u.sessionId))throw new Error("The attached chat is currently running a turn.");return d(u,E(),"manual")}}}n(Or,"createChatWorkflowLoop");var or={sunday:0,monday:1,tuesday:2,wednesday:3,thursday:4,friday:5,saturday:6};function Y(e,t,r){try{return{value:fe(e,t,r),error:null}}catch(s){return{value:null,error:s instanceof Error?s.message:String(s)}}}n(Y,"safeNextOccurrence");function fe(e,t,r){if(e.end.kind==="after_occurrences"&&r>=e.end.occurrences)return null;let s=ht(e.startDate,e.localTime,e.timeZone);if(e.kind==="once")return s.getTime()>t.getTime()?s.toISOString():null;let[p,h]=e.localTime.split(":").map(Number),w=e.kind==="daily"?`${h} ${p} * * *`:e.kind==="weekdays"?`${h} ${p} * * 1-5`:e.kind==="weekly"?`${h} ${p} * * ${(e.weekdays??[]).map(d=>or[d]).join(",")}`:`${h} ${p} ${e.dayOfMonth} * *`,v=new Date(Math.max(t.getTime(),s.getTime()-1e3)),l=wt.CronExpressionParser.parse(w,{currentDate:v,tz:e.timeZone}).next().toDate();if(e.end.kind==="on_date"){let d=ht(e.end.date,"23:59",e.timeZone);if(l.getTime()>d.getTime()+59999)return null}return l.toISOString()}n(fe,"nextOccurrence");function ht(e,t,r){let[s,p,h]=e.split("-").map(Number),[w,v]=t.split(":").map(Number),l=Date.UTC(s,p-1,h,w,v),d=new Date(l);for(let f=0;f<3;f+=1){let a=new Intl.DateTimeFormat("en-CA",{timeZone:r,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).formatToParts(d),u=Object.fromEntries(a.map(g=>[g.type,g.value])),i=Date.UTC(Number(u.year),Number(u.month)-1,Number(u.day),Number(u.hour),Number(u.minute)),c=l-i;if(c===0)return d;d=new Date(d.getTime()+c)}return d}n(ht,"zonedLocalDateTime");function St(e){return be(e,t=>{let r=0,s=0;t.exec("BEGIN IMMEDIATE");try{for(let[p,h,w]of[["local_agent_schedule_runs","local_agent_schedules","scheduleId"],["chat_workflow_runs","chat_workflows","workflowId"]]){let v=t.prepare(`SELECT id, payload FROM ${p} WHERE status IN ('queued','running')`).all();for(let l of v){let d=JSON.parse(l.payload),f=new Date().toISOString(),a=typeof d.turnId=="string"?t.prepare("SELECT payload FROM turns WHERE id = ?").get(d.turnId):void 0,i=(a?JSON.parse(a.payload):null)?.status==="completed",c=i?"The previous scheduled turn completed before shutdown.":"OpenPond stopped before this scheduled run was settled. Its external outcome may be unknown. Review the run before retrying or enabling this schedule.",g=i?"succeeded":"failed";t.prepare(`UPDATE ${p} SET status=?, payload=?, updated_at=? WHERE id=?`).run(g,JSON.stringify({...d,status:g,error:i?null:c,completedAt:f,updatedAt:f}),f,l.id);let k=t.prepare(`SELECT payload FROM ${h} WHERE id = ?`).get(String(d[w]));if(k&&!i){let y=JSON.parse(k.payload);t.prepare(`UPDATE ${h} SET enabled=0, next_run_at=NULL, payload=?, updated_at=? WHERE id=?`).run(JSON.stringify({...y,enabled:!1,nextRunAt:null,lastRunStatus:g,lastRunId:l.id,lastError:c,updatedAt:f}),f,String(d[w]))}if(i&&k&&h==="chat_workflows"){let y=De.parse(JSON.parse(k.payload)),S=y.scheduledRunCount+(d.trigger==="schedule"?1:0),b=d.trigger==="manual"?y.nextRunAt:fe(y.recurrence,new Date(f),S),P=y.enabled&&b!==null;t.prepare("UPDATE chat_workflows SET enabled=?, next_run_at=?, payload=?, updated_at=? WHERE id=?").run(P?1:0,P?b:null,JSON.stringify({...y,enabled:P,nextRunAt:P?b:null,scheduledRunCount:S,lastRunStatus:g,lastRunId:l.id,lastRunAt:f,lastError:null,updatedAt:f}),f,y.id)}i?r+=1:s+=1}}return t.exec("COMMIT"),{recovered:r,needsReview:s}}catch(p){throw t.exec("ROLLBACK"),p}})}n(St,"reconcileInterruptedScheduledWork");async function vt(e,t){let r=nr(e);if(!r)return null;let s=await t.loadProfileState();return r==="help"?sr(s):ar(s)}n(vt,"runProfileSkillCommand");function nr(e){let t=/^\/skill(?:\s+([\s\S]*))?$/i.exec(e.trim());if(!t)return null;let r=t[1]?.trim().toLowerCase()??"";return!r||r==="list"?"list":r==="help"?"help":null}n(nr,"readOnlyProfileSkillAction");function sr(e){return{handled:!0,action:"help",profile:e,message:["Profile skills support:","- /skill list","- /skill create <what the skill should help with>","- /skill create <skill-name>: <what the skill should help with>","- /skill create --name <skill-name> <what the skill should help with>","- /skill edit <skill-name> <change request>","","Create and edit run as normal model turns with the bundled OpenPond Skill Authoring skill. Skills may include SKILL.md plus focused scripts, references, and assets. Use an Agent when the workflow needs code, actions, durable runtime behavior, setup, or Evals."].join(`
|
|
3
|
+
`)}}n(sr,"profileSkillHelp");function ar(e){let t=e.skills.slice().sort((s,p)=>s.name.localeCompare(p.name));return{handled:!0,action:"list",message:t.length===0?"No profile skills found in the active profile.":[`Profile skills (${t.length}):`,...t.map(s=>{let p=s.validationStatus==="valid"?"valid":`invalid: ${s.validationMessages.join("; ")}`;return`- ${s.name} (${p}) ${s.path}`})].join(`
|
|
4
|
+
`),skills:t,profile:e}}n(ar,"listProfileSkills");import{randomUUID as ir}from"node:crypto";function kt(e){return async function*({messages:t,signal:r}){for await(let s of e({model:xe,messages:t,requestId:`harness-continuous-review:${ir()}`,reasoningEffort:"medium",maxTokens:He,signal:r}))s.type==="text_delta"&&s.text?yield{text:s.text}:s.type==="usage"&&(yield{usage:{promptTokens:s.usage.prompt_tokens??0,completionTokens:s.usage.completion_tokens??0,totalTokens:s.usage.total_tokens??0}})}}n(kt,"createLocalHarnessEvaluationReviewModelStream");import{promises as _t}from"node:fs";import N from"node:path";import{createHash as lr}from"node:crypto";import{access as ur,readFile as yt}from"node:fs/promises";import x from"node:path";import{fileURLToPath as cr}from"node:url";var Tt=["openpond-skill-authoring","openpond-agent-authoring","openpond-refiner-authoring"],Pt={"openpond-skill-authoring":["references/skill-package-layout.md","references/copying-and-adaptation.md","references/validation-and-repair.md"],"openpond-agent-authoring":["references/profile-layout.md","references/action-and-chat-design.md","references/integrations-and-setup.md","references/validation-and-repair.md"],"openpond-refiner-authoring":["references/review-profile.md","references/core-boundary.md","references/validation-and-activation.md"]},Rt=x.dirname(cr(import.meta.url));function Et(e){return Tt.includes(e)}n(Et,"isBundledAuthoringSkillName");async function At(e=process.cwd()){return Promise.all(Tt.map(t=>Z(t,e)))}n(At,"loadBundledAuthoringSkills");async function Z(e,t=process.cwd()){let r=await It(e,t),s=await bt(e,t),p=Le.find(h=>h.name===e);if(!p)throw new Error(`Built-in OpenPond authoring skill metadata not found: ${e}`);return{...p,path:x.join(r,"SKILL.md"),sourcePath:r,charCount:s.length,sourceHash:lr("sha256").update(s).digest("hex"),validationMessages:[...p.validationMessages],resourceFiles:[...p.resourceFiles]}}n(Z,"loadBundledAuthoringProfileSkill");async function xt(e,t=process.cwd()){let r=await Z(e,t),s=await bt(e,t);return{name:r.name,description:r.description,body:s,path:r.path,sourceHash:r.sourceHash,charCount:r.charCount,packagePath:r.sourcePath,resourceFiles:r.resourceFiles}}n(xt,"readBundledAuthoringProfileSkill");async function bt(e,t=process.cwd()){let r=await It(e,t),[s,...p]=await Promise.all([yt(x.join(r,"SKILL.md"),"utf8"),...Pt[e].map(h=>yt(x.join(r,h),"utf8"))]);return[s.trim(),...p.map((h,w)=>`
|
|
5
|
+
## Bundled reference: ${Pt[e][w]}
|
|
6
|
+
|
|
7
|
+
${h.trim()}`)].join(`
|
|
8
|
+
`)}n(bt,"loadBundledAuthoringSkillBundle");async function It(e,t=process.cwd(),r=process.execPath){let s=[x.resolve(t,"apps","cli","skills",e),x.resolve(t,"dist","skills",e),x.resolve(x.dirname(r),"skills",e),x.resolve(Rt,"skills",e),x.resolve(Rt,"..","skills",e)];for(let p of s)if(await ur(x.join(p,"SKILL.md")).then(()=>!0,()=>!1))return p;throw new Error(`Bundled OpenPond authoring skill ${e} was not found. Checked: ${s.join(", ")}`)}n(It,"resolveBundledAuthoringSkillRoot");var Ct=24e3;function Ot(e){return[{name:"refiner_profile_inspect",description:"Inspect the separately versioned active Refiner Review Profile, its immutable release identity, and recent transitions. Use before editing Refiner behavior.",parameters:{type:"object",additionalProperties:!1,properties:{}},execute:n(async t=>I(t.callId,"refiner_profile_inspect",await(await import("./refiner-profile-service-E7YU4E3N.js")).inspectRefinerProfile(e.storeDir)),"execute")},{name:"refiner_profile_update",description:"Validate and write a complete JSON Refiner Review Profile as a new immutable Refiner release. Activation is explicit; normal Harness refinement never calls this tool.",parameters:{type:"object",additionalProperties:!1,properties:{profile:{type:"object",additionalProperties:!1,properties:{schemaVersion:{type:"string",const:"openpond.refinerReviewProfile.v1"},id:{type:"string",minLength:1,maxLength:120},version:{type:"string",minLength:1,maxLength:120},name:{type:"string",minLength:1,maxLength:200},objective:{type:"string",minLength:1,maxLength:1e4},instructions:{type:"array",maxItems:100,items:{type:"object",additionalProperties:!1,properties:{id:{type:"string",minLength:1,maxLength:120},text:{type:"string",minLength:1,maxLength:1e4}},required:["id","text"]}},allowedProposalRoutes:{type:"array",items:{type:"string",enum:["memory","prompt","skill","agent"]},maxItems:4},allowedExternalRoutes:{type:"array",items:{type:"string",enum:["runtime","product","taskset","training"]},maxItems:4}},required:["schemaVersion","id","version","name","objective","instructions","allowedProposalRoutes","allowedExternalRoutes"]},activate:{type:"boolean"},reason:{type:"string",minLength:1,maxLength:1e4}},required:["profile","activate","reason"]},execute:n(async t=>{let r=await Z("openpond-refiner-authoring");return I(t.callId,"refiner_profile_update",await(await import("./refiner-profile-service-E7YU4E3N.js")).updateRefinerProfile(e.storeDir,{profile:t.args.profile,activate:t.args.activate,reason:ee(t.args.reason,1e4),actor:`work:${t.session.id}`,authoringSkillHash:r.sourceHash}))},"execute")},{name:"memory_search",description:"Search bounded active Personal Harness memory without loading the full memory corpus into context. Returns ranked stable memory keys and excerpts.",parameters:{type:"object",additionalProperties:!1,properties:{query:{type:"string",minLength:1,maxLength:500},limit:{type:"integer",minimum:1,maximum:20}},required:["query"]},execute:n(async t=>{let r=await M(e.store,t.session.id);if(!r)throw new Error("No Local Harness is selected for this run.");let s=ee(t.args.query,500).toLowerCase(),p=[...new Set(s.split(/[^a-z0-9]+/).filter(l=>l.length>1))],h=typeof t.args.limit=="number"?Math.max(1,Math.min(20,Math.trunc(t.args.limit))):8,v=(await e.store.listHarnessMemories(r.workspace.id)).map(l=>{let d=`${l.key} ${l.tags.join(" ")} ${l.content}`.toLowerCase(),f=p.reduce((a,u)=>a+(d.includes(u)?1:0),0);return{entry:l,score:f}}).filter(({score:l})=>p.length===0||l>0).sort((l,d)=>d.score-l.score||d.entry.updatedAt.localeCompare(l.entry.updatedAt)).slice(0,h).map(({entry:l,score:d})=>({key:l.key,revision:l.revision,score:d,excerpt:l.content.slice(0,1e3),tags:l.tags,updatedAt:l.updatedAt}));return I(t.callId,"memory_search",{query:s,matches:v})},"execute")},{name:"memory_inspect",description:"Read one exact active Personal Harness memory entry returned by memory_search.",parameters:{type:"object",additionalProperties:!1,properties:{key:{type:"string",minLength:1,maxLength:120}},required:["key"]},execute:n(async t=>{let r=await M(e.store,t.session.id);if(!r)throw new Error("No Local Harness is selected for this run.");let s=ee(t.args.key,120).toLowerCase(),p=await e.store.getHarnessMemory(r.workspace.id,s);if(!p||p.status!=="active")throw new Error(`Harness memory does not exist: ${s}.`);return I(t.callId,"memory_inspect",p)},"execute")},{name:"context_read",description:"Read a bounded slice of the current Agent run's canonical host-owned turns or runtime events. This never exposes other conversations or the whole history corpus.",parameters:{type:"object",additionalProperties:!1,properties:{scope:{type:"string",enum:["turns","events"]},limit:{type:"integer",minimum:1,maximum:50}},required:["scope"]},execute:n(async t=>{let r=typeof t.args.limit=="number"?Math.max(1,Math.min(50,Math.trunc(t.args.limit))):12;if(t.args.scope==="turns"){let s=await e.store.turnsForSession(t.session.id,r);return I(t.callId,"context_read",{scope:"turns",values:s.map(p=>Ht(p,6e3))})}if(t.args.scope==="events"){let s=await e.store.runtimeEventsForSession(t.session.id,{limit:r});return I(t.callId,"context_read",{scope:"events",values:s.map(p=>Ht(p,6e3))})}throw new Error("context_read scope must be turns or events.")},"execute")},{name:"harness_inspect",description:"Inspect the immutable Harness release pinned to this Agent run. With no path, returns its release, overlay, and component catalog. With a policy-visible text path, returns bounded exact source content.",parameters:{type:"object",additionalProperties:!1,properties:{path:{type:"string",minLength:1,description:"Optional exact Harness-relative source path from the returned catalog."}}},execute:n(async t=>{let r=await M(e.store,t.session.id);if(!r)throw new Error("No Local Harness release is selected for this run.");let s=await e.store.getHarnessRunOverlay(t.session.id),p=N.join(r.release.bundlePath,"source"),h=Me.parse(JSON.parse(await _t.readFile(N.join(p,"harness.json"),"utf8"))),w=typeof t.args.path=="string"?t.args.path.trim().replaceAll("\\","/"):null,v=null;if(w){let l=h.files.find(f=>f.path===w);if(!l||l.visibility!=="policy")throw new Error(`Harness source is not policy-visible or declared: ${w}`);if(!l.mediaType.startsWith("text/")&&l.mediaType!=="application/json")throw new Error(`Harness source is not inspectable text: ${w}`);let d=await _t.readFile(dr(p,w),"utf8");v={path:w,content:d.slice(0,Ct),truncated:d.length>Ct}}return I(t.callId,"harness_inspect",{workspace:{id:r.workspace.id,name:r.workspace.name,revision:r.workspace.revision,channel:r.workspace.currentChannel},pinnedRelease:{id:r.release.harnessRelease.id,contentHash:r.release.harnessRelease.contentHash,sourceRevision:r.release.sourceRevision},overlay:s?{id:s.id,revision:s.revision,status:s.status,contentHash:s.contentHash}:null,components:h.files.filter(l=>l.visibility==="policy").map(l=>({kind:l.kind,path:l.path,portability:l.portability})),source:v})},"execute")},{name:"skill_inspect",description:"Read one exact textual Skill from the immutable Harness release pinned to this run. Use this before asking the Refiner to update an existing Skill.",parameters:{type:"object",additionalProperties:!1,properties:{name:{type:"string",minLength:1,description:"Exact Skill name from harness_inspect."}},required:["name"]},execute:n(async t=>{let r=await M(e.store,t.session.id),s=typeof t.args.name=="string"?t.args.name.trim():"";if(!r?.skillRuntime.readSkill||!s)throw new Error("A valid Skill name and a selected Local Harness are required.");return I(t.callId,"skill_inspect",await r.skillRuntime.readSkill(s))},"execute")},{name:"refine_request",description:"Mark a concrete reusable lesson from the current turn for bounded Harness refinement at the next safe tool boundary. Immediate task recovery remains your responsibility. Do not call for one-off errors or transient facts.",parameters:{type:"object",additionalProperties:!1,properties:{summary:{type:"string",minLength:1,maxLength:2e3},suggestedRoute:{type:"string",enum:["runtime","memory","prompt","skill","agent","product","taskset","training"]}},required:["summary"]},execute:n(async t=>I(t.callId,"refine_request",{queuedAtBoundary:!0,summary:ee(t.args.summary,2e3),suggestedRoute:typeof t.args.suggestedRoute=="string"?t.args.suggestedRoute:null}),"execute")},{name:"refine_status",description:"Inspect bounded Refiner trigger, proposal, route, validation, and outcome status for this Agent run.",parameters:{type:"object",additionalProperties:!1,properties:{}},execute:n(async t=>{let r=await M(e.store,t.session.id);if(!r)throw new Error("No Local Harness is selected for this run.");let s=n(async i=>e.store.listHarnessImprovementArtifacts(r.workspace.id,i,200),"all"),p=(await s("trigger_decision")).filter(i=>i.schemaVersion==="openpond.refinementTriggerDecision.v1").filter(i=>i.runRef===t.session.id),h=new Set(p.map(i=>U(i))),w=n(i=>h.has(U(ge(i.trigger))),"relatedToTrigger"),v=(await s("route_decision")).filter(i=>i.schemaVersion==="openpond.improvementRouteDecision.v1").filter(w),l=(await s("refiner_outcome")).filter(i=>i.schemaVersion==="openpond.harnessRefinerOutcome.v1").filter(w),d=new Set(l.flatMap(i=>{let c=ge(i.proposal);return c.id&&c.contentHash?[U(c)]:[]})),f=(await s("proposal")).filter(i=>i.schemaVersion==="openpond.harnessImprovementProposal.v1").filter(i=>d.has(U(i))),a=n(i=>d.has(U(ge(i.proposal))),"relatedToProposal"),u=[{kind:"trigger_decision",values:p},{kind:"route_decision",values:v},{kind:"proposal",values:f},{kind:"targeted_validation",values:(await s("targeted_validation")).filter(a)},{kind:"apply_receipt",values:(await s("apply_receipt")).filter(a)},{kind:"refiner_outcome",values:l}];return I(t.callId,"refine_status",{runId:t.session.id,artifacts:u})},"execute")}]}n(Ot,"createLocalHarnessModelToolDefinitions");function U(e){return`${String(e.id??"")}:${String(e.contentHash??"")}`}n(U,"artifactRefKey");function ge(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}n(ge,"asRecord");function I(e,t,r){return{toolCallId:e,name:t,ok:!0,contentText:JSON.stringify(r),data:r}}n(I,"modelResult");function ee(e,t){if(typeof e!="string"||!e.trim())throw new Error("A non-empty refinement summary is required.");return e.trim().slice(0,t)}n(ee,"boundedText");function Ht(e,t){let r=JSON.stringify(e);return r.length<=t?e:{truncated:!0,json:r.slice(0,t)}}n(Ht,"boundedJson");function dr(e,t){let r=N.resolve(e),s=N.resolve(r,...t.split("/")),p=N.relative(r,s);if(!p||p.startsWith("..")||N.isAbsolute(p))throw new Error(`Harness source path escapes its release: ${t}`);return s}n(dr,"containedSourcePath");function Wt(){return{loadOpenPondProfileStateForRef:le,executeProfileSkillCommand:n(({prompt:e,profileRef:t})=>vt(e,{loadProfileState:n(()=>le(t),"loadProfileState")}),"executeProfileSkillCommand")}}n(Wt,"createProfileTurnDependencies");import{randomUUID as pr}from"node:crypto";import{setTimeout as mr}from"node:timers/promises";async function Lt(e,t){if(t.metadata?.titleSource||t.archived||t.hiddenFromDefaultSidebar)return t;let s=(await e.runtimeEventsForSession(t.id,{names:["session.title.updated"]})).at(-1)?.data,p=s?.session;if(s?.titleSource!=="fallback"||p?.title!==t.title)return t;let[h]=await e.runtimeEventsForSession(t.id,{names:["turn.started"],limit:1}),w=h?.turnId?await e.getTurn(h.turnId):null;return w?.prompt.trim()?await e.updateSession(t.id,v=>v.metadata?.titleSource||v.title!==t.title?v:{...v,metadata:{...v.metadata,titleSource:"fallback",autoTitle:{prompt:w.prompt.slice(0,2e4),title:v.title,attempts:0,nextAttemptAt:0}}})??t:t}n(Lt,"recoverTemporarySessionTitle");var he="accounts/fireworks/models/deepseek-v4-flash",fr="off",gr=12e3,Dt=7,hr=["Make a concise conversation title from the user's message.","Return only the title: 3 to 7 words, plain text, sentence case.","Do not use quotation marks, markdown, labels, or ending punctuation."].join(" ");function wr(e){let s=(e.replace(/<[^>]*>/gu," ").replace(/[\r\n]+/gu," ").replace(/\s+/gu," ").trim().match(/[\p{L}\p{N}][\p{L}\p{N}'’._/+:-]*/gu)??[]).slice(0,Dt).join(" ");return s?`${s.charAt(0).toUpperCase()}${s.slice(1)}`:"New conversation"}n(wr,"fallbackSessionTitle");function Sr(e){let r=e.replace(/<think>[\s\S]*?<\/think>/giu," ").replace(/^\s*(?:title|conversation title)\s*:\s*/iu,"").replace(/^[\s`"'“”‘’*_#-]+|[\s`"'“”‘’*_#.!?,;:-]+$/gu,"").replace(/[\r\n]+/gu," ").replace(/\s+/gu," ").trim().split(" ").filter(Boolean);return r.length<2?null:r.slice(0,Dt).join(" ")}n(Sr,"generatedSessionTitle");function vr(e){return["Make a title from this request. Do not execute it.","<user_request>",e.slice(0,2e4),"</user_request>"].join(`
|
|
9
|
+
`)}n(vr,"titleRequestMessage");function Mt(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let t=e.autoTitlePrompt;return typeof t=="string"&&t.trim()?t.trim():null}n(Mt,"autoTitlePromptFromPayload");function kr(e){let t=Mt(e);if(!t||!e||typeof e!="object"||Array.isArray(e))return e;let r=e,s=r.metadata&&typeof r.metadata=="object"&&!Array.isArray(r.metadata)?r.metadata:{};return{...r,title:"",metadata:{...s,titleSource:"pending",autoTitle:{prompt:t.slice(0,2e4),title:"",attempts:0,nextAttemptAt:0}}}}n(kr,"withPendingAutoTitle");function te(e){if(!e||!["pending","fallback"].includes(String(e.metadata?.titleSource)))return null;let t=e.metadata?.autoTitle;return t&&typeof t.prompt=="string"&&t.title===e.title&&Number.isInteger(t.attempts)&&t.attempts>=0&&Number.isFinite(t.nextAttemptAt)?t:null}n(te,"pendingTitle");function Nt(e){let t=new Map,r=null,s=new AbortController,p=[5e3,3e4];async function h(l){let d=new AbortController,f=setTimeout(()=>d.abort(new Error("session_title_generation_timeout")),gr);f.unref?.();let a="";try{for await(let i of e.stream({model:he,messages:[{role:"system",content:hr},{role:"user",content:vr(l)}],reasoningEffort:fr,maxTokens:128,temperature:.2,requestId:`session-title-${pr()}`,signal:AbortSignal.any([d.signal,s.signal])}))i.type==="text_delta"&&i.text&&(a+=i.text);let u=Sr(a);if(!u)throw new Error("session_title_generation_empty_response");return u}finally{clearTimeout(f)}}n(h,"generate");async function w(l){for(;!s.signal.aborted;){let d=te(await e.store.getSession(l));if(!d||d.attempts>=3)return;let f=d.nextAttemptAt-Date.now();f>0&&await mr(f,void 0,{signal:s.signal,ref:!1});let a=te(await e.store.getSession(l));if(!a||a.attempts!==d.attempts)return;let u,i="model";try{u=await h(d.prompt)}catch(k){if(s.signal.aborted)return;u=wr(d.prompt),i="fallback",e.logger.warn("session title generation used temporary title",{error:k instanceof Error?k.message:String(k),model:he,sessionId:l,attempt:d.attempts+1})}if(s.signal.aborted)return;let c=!1,g=await e.store.updateSession(l,k=>{let y=te(k);return!y||y.attempts!==d.attempts||y.prompt!==d.prompt?k:(c=!0,{...k,title:u,metadata:{...k.metadata,titleSource:i,autoTitle:i==="model"?null:{...d,title:u,attempts:d.attempts+1,nextAttemptAt:Date.now()+(p[d.attempts]??0)}}})});if(!c||!g||(await e.appendRuntimeEvent(Q({sessionId:l,name:"session.title.updated",source:"server",status:"completed",data:{session:g,model:he,titleSource:i}})),i==="model"))return}}n(w,"run");function v(l){if(s.signal.aborted)return Promise.resolve();let d=t.get(l);if(d)return d;let f=w(l).catch(a=>{s.signal.aborted||e.logger.warn("session title generation failed",{error:a instanceof Error?a.message:String(a),sessionId:l})}).finally(()=>t.delete(l));return t.set(l,f),f}return n(v,"schedule"),{wrapCreateSession(l){return this.recover().catch(d=>e.logger.warn("Session title recovery failed",{error:String(d)})),async d=>{let f=await l(kr(d));return Mt(d)&&v(f.id),f}},schedule:v,recover(){return r||(r=(async()=>{for(let l of await e.store.sessionShells()){if(s.signal.aborted)return;let d=await Lt(e.store,l);te(d)&&v(l.id)}})().finally(()=>{r=null}),r)},async close(){s.abort(),await r?.catch(()=>{}),await Promise.allSettled(t.values())}}}n(Nt,"createSessionTitleService");var Rr=3,Tr=["sqlite_store","runtime_event_bus","session_store","hosted_provider","web_search","connected_apps","workspace_tools","command_approvals","harness","refiner","agent_runtime","jsonl_transport"];async function fn(e={}){if(e.runtimeStorage)return(await import("./hosted-app-server-composition-P7V7K7CG.js")).createHostedOwnedAppServer({...e,runtimeStorage:e.runtimeStorage});let t=q.resolve(e.storeDir??de());return Ne(t,()=>Er({...e,storeDir:t}))}n(fn,"createOpenPondAppServer");async function Er(e){let t=q.resolve(e.storeDir??de()),r=!!e.embedding;if(r&&!e.streamOpenPondHostedChatTurn)throw new Error("Embedded Work requires an explicit model-stream adapter.");let s=e.services??{},p=await $(s.webSearch,r,async()=>(await import("./web-search-222Y63QW.js")).createWebSearchExecutorFromEnv()),h=await $(s.scheduling,r,async()=>(await import("./saved-work-LOUWLF37.js")).createHostedSavedWork),w=await $(s.connectedApps,r,async()=>{let[o,m]=await Promise.all([import("./connected-app-executor-E25XCNAS.js"),import("./app-server-connected-apps-K62M6LCT.js")]);return{execute:o.createCloudConnectedAppToolExecutor(),list:m.listAppServerIntegrationConnections}}),v=await $(s.tasksets,r,async()=>(await import("./hosted-tasksets-V2PQZJN4.js")).executeHostedTasksetAction),l=s.backgroundReview??!r,d=!r&&!!v;await Ie(t),l&&await(await import("./refiner-profile-service-E7YU4E3N.js")).initializeRefinerProfile(t);let f=q.resolve(e.workspaceDir??process.cwd());await Pr(f,{recursive:!0});let a=e.version??qe,u=Be(),i=ze({channel:"app-server",logDir:q.join(t,"logs"),metadata:{version:a,runtimeVersion:u,placement:"hosted_work"}});L(()=>i.flush());let c=new dt(t,{logger:i});L(()=>c.close()),await c.recentTurns(1);let g=c,k=n(async()=>(await _e(t)).preferences,"loadRuntimePreferences"),y=St(t);(y.recovered||y.needsReview)&&i.warn("Scheduled work requires review after restart",y);let S=ot(e.streamOpenPondHostedChatTurn??Fe,{enabled:rt()}),b=kt(S),{appendRuntimeEvent:P,closeEventSubscribers:qt,subscribeRuntimeEvents:jt}=at({logger:i,store:g}),re=pe({queueId:"turn-follow-up",logger:i}),we=pe({queueId:"subagent",logger:i});if(e.harness&&e.profileSource)throw new Error("Configure either an explicit Harness source or Profile source for this app-server.");let A=null,z,oe;if(e.experimentHarnessSource){if(!e.experimentPolicyClient||e.profileSource||e.harness||e.runtimeStorage)throw new Error("A published standalone Experiment source requires its isolated policy owner and local case store.");let o=e.experimentHarnessSource.sourcePackage;z=await(await import("./published-experiment-source-HVHKSYDL.js")).installPublishedExperimentSource({store:c,storeDir:t,ownerId:e.experimentHarnessSource.ownerId,sourcePackage:o,reference:{harnessRelease:{id:o.harnessRelease.id,contentHash:o.harnessRelease.contentHash},agentSnapshot:{id:o.agentSnapshot.id,contentHash:o.agentSnapshot.contentHash},sourcePackageHash:o.contentHash},createdAt:E()})}if(e.profileSource){let o=e.profileSource;if(!o.repositoryId.trim()||!o.profileId.trim()||!o.sourceRevision.trim())throw new Error("Explicit Profile source requires an identity and accepted revision.");let m=await je({repoPath:o.repoPath,profileId:o.profileId});if(m.mode!=="local"||!m.sourcePath||m.error||m.git?.isRepo&&(m.git.head!==o.sourceRevision||m.git.dirty))throw new Error("Explicit Profile source does not match its accepted revision.");A=await Ke({store:c,storeDir:t,workspaceId:`${Xe}${H({profileId:o.profileId,sourceRevision:o.sourceRevision}).slice(0,24)}`,ownerId:"desktop-personal",name:o.profileId,profile:m,sourceRevision:o.sourceRevision,repositoryId:o.repositoryId})}e.harness&&(await Ve({store:c,storeDir:t,sourceDir:e.harness.sourceDirectory,id:e.harness.workspaceId,name:e.harness.name,ownerId:"desktop-personal"}),await c.selectHarnessWorkspace({ownerKind:"personal",ownerId:"desktop-personal",workspaceId:e.harness.workspaceId,updatedAt:E()})),await Je({store:c,storeDir:t,loadProfileState:D,now:E}).catch(o=>{i.warn("app-server Harness initialization failed",{error:o})});let V=tt({appendRuntimeEvent:P,findLocalProject:n(o=>it(c,o),"findLocalProject"),onRepositoryInstructionDiagnostic:n((o,m)=>{i.warn("repository instruction file skipped",{diagnostic:o,sessionId:m.id})},"onRepositoryInstructionDiagnostic")}),{createSession:j,getSession:C,updateSession:K,completeTurn:Ft,failTurn:Bt,interruptTurn:Ut}=ct({store:g,defaultSessionCwd:n(()=>f,"defaultSessionCwd"),appendRuntimeEvent:P,loadAppPreferences:k,loadLastUsedProfile:n(async()=>(await B()).lastUsed,"loadLastUsedProfile")}),Se=Nt({appendRuntimeEvent:P,store:g,logger:i,stream:S}),ve=r?j:Se.wrapCreateSession(j),J=st({workspaceDir:f,logger:i,getSession:C,updateSession:K,appendRuntimeEvent:P,sandboxRequest:e.sandboxRequest??(r?async()=>{throw new Error("Sandbox execution is not configured in this app-server deployment.")}:void 0)}),$t=d?await(await import("./local-harness-taskset-review-ZNOKSPJJ.js")).createLocalHarnessTasksetReviewControl({store:c,storeDir:t,evaluationRuntime:{streamOpenPondHostedChatTurn:S,workRuntime:{createSession:j,getSession:C,executeWorkspaceTool:J.executeWorkspaceTool,runtimeEventsForSession:n(o=>g.runtimeEventsForSession(o),"runtimeEventsForSession")},resolveReleasedHarness:n(async()=>{let o=await Ge(c);return o?{agentSnapshot:o.release.agentSnapshot,harnessRelease:o.release.harnessRelease,instructionContext:o.instructionContext}:null},"resolveReleasedHarness")}}):void 0,ke=n(async o=>{await g.upsertApproval(o)},"upsertApproval"),ye=Ze({upsertApproval:ke,appendRuntimeEvent:P}),zt=await $(s.projectActions,r,async()=>(await import("./project-action-payload-OU3ZPHW7.js")).createProjectActionRunPayload({appendRuntimeEvent:P,resolveProjectRoot:n(async()=>null,"resolveProjectRoot")})),Vt=n(async o=>{try{await g.upsertModelUsageRecord(o)}catch(m){await P(xr(o,m)).catch(()=>{})}},"safeUpsertModelUsageRecord"),Pe=l?(await import("./local-harness-improvement-runtime-UP2P7UT4.js")).createLocalHarnessImprovementRuntime({store:c,storeDir:t,queue:re,streamOpenPondHostedChatTurn:S,appendRuntimeEvent:P,upsertModelUsageRecord:Vt}):void 0;await Pe?.reconcilePending();let ne=e.profileExternalDataset?await(A&&e.profileExternalDatasetClient?(await import("./host-profile-external-dataset-VK3NJHMC.js")).createHostProfileExternalDataset({value:e.profileExternalDataset,release:A,sourceRevision:e.profileSource.sourceRevision,client:e.profileExternalDatasetClient}):Promise.reject(new Error("External Dataset execution requires an explicit private Profile source owner."))):null,Kt=Ue({deviceId:`evaluation-${H(t).slice(0,24)}`,storeDir:t,runtimeEventsForSession:n(o=>g.runtimeEventsForSession(o),"runtimeEventsForSession")}),_=A?(await import("./host-profile-evaluation-tools-LZDMQCMT.js")).createHostProfileEvaluationTools({storeDir:t,release:A,getTurn:n(o=>g.getTurn(o),"getTurn"),getSession:C,saveOutput:Kt.saveOwnedOutputBytes,recordOutput:n(async(o,m,T)=>{await P({id:yr(),timestamp:new Date().toISOString(),name:"workspace_action_result",source:"server",sessionId:o,turnId:m,action:"work_output_save",status:"completed",output:`Saved ${T.outputRef.title} as immutable case output.`,data:T})},"recordOutput"),authorize:n(async o=>{if(ne){await ne.authorize(o);return}let m=await Te();if(!m||m.ref.profileId!==e.profileSource?.profileId||m.sourceRevision!==e.profileSource?.sourceRevision)throw new Error("The released evaluation source authority changed.");let T=await c.getHarnessReleaseRecord(A.harnessRelease.contentHash);if(!T||T.harnessRelease.contentHash!==A.harnessRelease.contentHash)throw new Error("The isolated evaluation release is unavailable.")},"authorize")}):null,G=e.embedding?ft(e.embedding,async(o,m)=>{let T=await g.getTurn(o);if(!T)throw new Error("Embedded turn is unavailable.");let O=await C(T.sessionId),F=O.metadata?.embeddingToolBindings,W=[...m].sort((X,Yt)=>X.name.localeCompare(Yt.name));if(F!==void 0&&H(F)!==H(W))throw new Error("Embedded tool bindings changed; start a new thread.");await K(O.id,{metadata:{...O.metadata,embeddingToolBindings:W}}),await g.updateTurn(o,X=>({...X,metadata:{...X.metadata,toolBindings:W}}))}):void 0,R=lt({executionHost:r?"embedded":"local",storageHome:t,workInputsForSession:e.workInputsForSession,finalizeWorkTurn:e.finalizeWorkTurn,isolatedProfileEvaluationForTurn:_?async o=>{if(o.metadata?.profileEvaluationRun===void 0)return!1;if(!_.ownsSession(o.id))throw new Error("A Profile evaluation target has no actual admitted case owner.");return!0}:void 0,executeProfileEvaluationAction:_?.executeAction,resolveModelTools:e.resolveModelTools||_||G?async o=>{let m=_?_.ownsSession(o.session.id)?await _.resolveTools(o):await G?.(o)??[]:G?await G(o):o.tools;return e.resolveModelTools?e.resolveModelTools({...o,tools:m}):m}:void 0,...r?{hostedToolFlags:{toolMode:"native",nativeToolTransport:!0,nativeToolProviderDenylist:[],textToolFallback:!1}}:{},attachmentRootDir:q.join(t,"attachments"),store:g,inboxStore:c,createSession:j,upsertApproval:ke,getSession:C,updateSession:K,completeTurn:Ft,failTurn:Bt,interruptTurn:Ut,defaultSessionCwd:n(()=>f,"defaultSessionCwd"),findOpenPondApp:n(async o=>Ar(o,f),"findOpenPondApp"),resolveSessionWorkspaceCwd:n(async o=>o.cwd?.trim()||f,"resolveSessionWorkspaceCwd"),ensureCodexRuntime:n(async()=>{throw new Error("The hosted app-server placement uses the OpenPond provider; Codex process hosting is not configured.")},"ensureCodexRuntime"),appendWorkspaceDiffEvent:J.appendWorkspaceDiffEvent,workspaceDiffBaseline:J.workspaceDiffBaseline,appendRuntimeEvent:P,processHarnessImprovementBoundary:Pe,executeWorkspaceTool:J.executeWorkspaceTool,executeOpenPondCommand:ye.executeCommand,executeProjectAction:zt,executeDatasetBuilderAction:v,loadOpenPondProfileState:D,...Wt(),...r||s.profileActions===!1?{executeProfileSkillCommand:void 0}:{},loadOpenPondProfileLibrary:B,readOpenPondProfileSkill:Oe,loadSelectedHarnessRuntime:n(o=>ce(c,o),"loadSelectedHarnessRuntime"),ensureHarnessRunOverlay:n(o=>ue({store:c,...o}),"ensureHarnessRunOverlay"),harnessModelTools:Ot({store:c,storeDir:t}).filter(o=>l||!["refiner_profile_inspect","refiner_profile_update","refine_request","refine_status"].includes(o.name)),loadBuiltInOpenPondSkills:n(async()=>[await pt(),...await At()],"loadBuiltInOpenPondSkills"),readBuiltInOpenPondSkill:n(async o=>{if(o==="openpond-taskset-authoring")return mt();if(Et(o))return xt(o);throw new Error(`Built-in OpenPond skill not found: ${o}`)},"readBuiltInOpenPondSkill"),executeWebSearch:p,createScheduledWork:h,executeConnectedAppTool:w?.execute,listIntegrationConnections:w?.list,loadPersonalizationSoul:n(async()=>(await et(c,t)).soul,"loadPersonalizationSoul"),loadAppPreferences:k,maybeCreateScaffoldForTurn:V.maybeCreateScaffoldForTurn,hostedSystemPrompt:V.hostedSystemPrompt,appendAssistantText:V.appendAssistantText,appendHostedContextUsage:V.appendHostedContextUsage,streamOpenPondHostedChatTurn:S,turnFollowUpQueue:re,resolveSessionModelStream:gt(async(o,m)=>await oe?.resolveSessionModelStream(o,m)??await e.resolveSessionModelStream?.(o,m)??null),subagentQueue:we,maxHostedWorkspaceToolRounds:e.experimentHarnessSource?(await import("./experiments-DYSHYBGB.js")).STANDALONE_EXPERIMENT_MAX_POLICY_CALLS:ut(e.maxHostedWorkspaceToolRounds),maxRepeatedInvalidToolRequests:Rr});L(()=>R.close()),await R.recoverPendingSubagentCompletions(),await R.recoverTaskInbox();async function Jt(o,m){let T=await R.resolveNativeAgentApproval(o,m);if(T)return T;let O=await ye.resolveApproval(o,m);if(O)return O;let F=await R.resolveCreateImproveApproval(o,m);if(F)return F;let W=await R.resolveSubagentPatchApplyApproval(o,m);if(W)return W;throw new Error(`Approval not found: ${o}`)}n(Jt,"resolveApproval");let Re=!1,Te=n(async()=>{if(e.profileSource)return{ref:{source:"openpond_git",repositoryId:e.profileSource.repositoryId,profileId:e.profileSource.profileId},sourceRevision:e.profileSource.sourceRevision};let[o,m]=await Promise.all([B(),D()]);return o.lastUsed&&m.git?.head&&!m.git.dirty?{ref:o.lastUsed,sourceRevision:m.git.head}:null},"selectedEvaluationProfile"),Ee=n(async()=>{if(e.profileSource&&A)return Ye({store:c,release:A,ref:{source:"openpond_git",repositoryId:e.profileSource.repositoryId,profileId:e.profileSource.profileId},sourceRevision:e.profileSource.sourceRevision});let[o,m]=await Promise.all([B(),D()]);if(!o.lastUsed)throw new Error("Select a Profile before loading its workflows.");return Qe({store:c,storeDir:t,ref:o.lastUsed,profile:m,reloadProfile:D})},"listProfileWorkflows");if(z){let o=z;oe=(await import("./standalone-experiment-turn-owner-YRKEOEJ2.js")).createStandaloneExperimentTurnOwner({store:c,createSession:j,sendTurn:R.sendTurn,interruptSessionTurn:R.interruptSessionTurn,authorizeWorkspace:n(async(m,T)=>{if(T.id!==o.workspace.id||H(T.ownerScope)!==H(o.workspace.ownerScope)||m.sourcePackageHash!==o.workspace.metadata.experimentSourcePackageHash||m.harnessRelease.id!==o.release.harnessRelease.id||m.harnessRelease.contentHash!==o.release.harnessRelease.contentHash)throw new Error("Standalone Experiment source differs from this execution owner's admitted closure.")},"authorizeWorkspace")})}let se=ie(async()=>{let{createAppServerEvaluations:o}=await import("./app-server-evaluations-RM6WXX3H.js");return o({options:e,store:c,storeDir:t,explicitProfileRelease:A,externalDataset:ne,isolatedProfileTools:_,selectedEvaluationProfile:Te,listProfileWorkflows:Ee,createSessionWithAutoTitle:ve,turnRunner:R,streamOpenPondHostedChatTurn:S,publishedExperimentSource:z,standaloneExperimentOwner:oe})}),Gt=se.methods(["listProfileEvaluations","executeProfileEvaluationCase","executeExperimentCase","cancelExperimentCase","executeProfileEvaluationRun","prepareProfileEvaluationRun","runPreparedProfileEvaluation","runProfileEvaluationSuite","compareProfileEvaluationRuns","buildProfileEvaluationReport"]);L(()=>se.close());let ae=ie(async()=>{let{createAppServerHarnessServices:o}=await import("./app-server-harness-services-RLKMWOQ4.js");return o({store:c,storeDir:t,backgroundReview:l,harnessEvaluationEnabled:d,harnessEvaluationReviewStream:b,harnessTasksetReview:$t})}),Xt=ae.methods(["inspectHarness","reviewHarnessProposal","reviewHarness","acceptHarnessEvaluationReview","materializeHarnessEvaluationTaskset","runHarnessEvaluationBaseline","validateHarness","updateHarnessBackgroundReview","diffHarness","rollbackHarness","inspectRefiner","updateRefiner","activateRefiner","rollbackRefiner"]);L(()=>ae.close());let Qt=$e({ports:nt({placement:"hosted_work",connectedAppProviders:w?void 0:[],featureOverrides:{harnessBackgroundReview:l,harnessProposalReview:l,harnessReview:d,harnessEvaluationReview:d,harnessEvaluationReviewAcceptance:d,harnessEvaluationTasksetMaterialization:d,harnessEvaluationBaseline:d,refinerProfiles:l,immutableRefinerAdmission:l},createSession:ve,getSession:C,turnsForSession:n(o=>g.turnsForSession(o,1e3),"turnsForSession"),runtimeEventsForSession:n(o=>g.runtimeEventsForSession(o),"runtimeEventsForSession"),sendTurn:R.sendTurn,steerSessionTurn:R.steerSessionTurn,readTaskInbox:R.readTaskInbox,queueTaskInput:R.queueTaskInput,updateTaskInput:R.updateTaskInput,isSessionTurnActive:R.isSessionTurnActive,waitForSessionTurnSettlement:R.waitForSessionTurnSettlement,interruptSessionTurn:R.interruptSessionTurn,resolveApproval:Jt,listProfileWorkflows:Ee,loadProfileTrainingSource:n(async()=>{if(!e.profileSource||!A)throw new Error("An explicit published Profile is required for hosted training source export.");return(await import("./profile-training-source-J73ZLNSC.js")).profileTrainingSource({release:A,storeDir:t})},"loadProfileTrainingSource"),...Gt,...Xt,subscribeRuntimeEvents:jt,observeRuntimeOperation:n(o=>{i.info("agent runtime operation",o)},"observeRuntimeOperation")}),close:n(async()=>{Re||(Re=!0,await Se.close(),await Promise.all([se.close(),ae.close(),R.close()]),_?.close(),await Promise.all([re.drain(),we.drain()]),await qt(),await c.close(),await i.flush())},"close")}),Ae=Tr.filter(o=>(o!=="web_search"||!!p)&&(o!=="connected_apps"||!!w)&&(o!=="refiner"||l));return i.info("app-server ready",{storePath:c.storePath,workspaceDir:f,composition:Ae}),{...Qt,updateSession:K,pinSessionHarness:n(async o=>{let m=await ce(c,await C(o));if(!m)return null;let T={id:m.release.harnessRelease.id,contentHash:m.release.harnessRelease.contentHash};return await ue({store:c,runId:o,workspace:m.workspace,harnessRelease:T,admittedAt:E()}),T},"pinSessionHarness"),storePath:c.storePath,workspaceDir:f,composition:Ae}}n(Er,"createOwnedAppServer");function Ar(e,t){return{id:e||We(t),name:q.basename(t)||"Sandbox workspace",description:null,visibility:"private",gitOwner:null,gitRepo:null,gitHost:null,defaultBranch:null,sandbox:!1,updatedAt:E(),latestDeployment:null}}n(Ar,"workspaceApp");function xr(e,t){return Q({sessionId:e.sessionId??void 0,turnId:e.turnId??void 0,name:"diagnostic",source:"server",status:"failed",output:t instanceof Error?t.message:"Failed to persist model usage record.",data:{kind:"model_usage_record_failed",requestId:e.requestId,provider:e.provider,model:e.model}})}n(xr,"runtimeDiagnostic");async function $(e,t,r){if(e!==!1)return e!==void 0?e:t?void 0:r()}n($,"selectService");export{gt as a,Or as b,St as c,kt as d,Et as e,At as f,xt as g,Ot as h,Wt as i,Nt as j,Tr as k,fn as l};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{
|
|
2
|
+
import{k as v,t as x}from"./chunk-UJKQLO6B.js";import{a as l,c as j}from"./chunk-JHR3LF2F.js";import{Da as y,G as P,b as f,sb as E,ya as p}from"./chunk-ZR7LIMJS.js";import{v as w}from"./chunk-O4FBOUNX.js";import{m as g}from"./chunk-5ZBLCWEJ.js";import{q as S}from"./chunk-H7IWJN7L.js";import{A as s}from"./chunk-PF56N7ZY.js";import{a as n}from"./chunk-FTQLQJQV.js";function z(e){if(e.kind==="command"||e.kind==="file_change")return!0;if(e.kind!=="permissions")return!1;try{let o=JSON.parse(e.detail);return!o.questions&&Array.isArray(o.options)&&o.options.some(r=>r.kind==="allow_once")&&o.options.some(r=>r.kind==="reject_once")}catch{return!1}}n(z,"remoteApprovalSupported");import{createHash as A}from"node:crypto";import{realpath as R,stat as O}from"node:fs/promises";var k=n(e=>A("sha256").update(f("POST","/local/ponder-project",e)).digest("hex"),"hash"),_=s.object({projectId:s.string().min(1).max(200),name:s.string().min(1).max(300),cwd:s.string().min(1).max(8192),sourceFolders:s.array(s.object({path:s.string().min(1).max(8192),realpath:s.string().min(1).max(8192)}).strict()).min(1).max(1e3),configurationHash:s.string().regex(/^[a-f0-9]{64}$/),revision:s.string().regex(/^[a-f0-9]{64}$/)}).strict();function X(e){let o=Object.values(S(e,"saved_local_projects"));if(o.length>p)throw new Error("ponder_desktop_project_sharing_limit_exceeded");return o.map(r=>g.parse(r.value))}n(X,"readPonderLocalProjects");async function Y(e){if(e.hiddenFromDefaultSidebar)throw new Error("ponder_desktop_project_unavailable");let o=[...new Set([...e.sourceFolders??[e.path],e.path,...e.repoPath?[e.repoPath]:[]])];if(!o.length||o.length>1e3)throw new Error("ponder_desktop_project_folder_limit_exceeded");let r=await R(e.workspacePath);if(!(await O(r)).isDirectory())throw new Error("ponder_desktop_project_unavailable");let t=[];for(let c of o){let i=await R(c);if(!(await O(i)).isDirectory())throw new Error("ponder_desktop_project_unavailable");t.push({path:c,realpath:i})}let a={projectId:e.id,name:e.name,cwd:r,sourceFolders:t,configurationHash:k({id:e.id,name:e.name,path:e.path,workspacePath:e.workspacePath,repoPath:e.repoPath,sourceFolders:e.sourceFolders??null,hiddenFromDefaultSidebar:e.hiddenFromDefaultSidebar??!1})};return _.parse({...a,revision:k(a)})}n(Y,"capturePonderProjectSnapshot");import{createHash as D}from"node:crypto";var I=E,m=s.object({revision:s.number().int().positive(),owner:l,authority:I,project:_,shared:s.boolean(),updatedAt:s.string().datetime()}).strict(),b=m.omit({revision:!0}),h=n(e=>D("sha256").update(JSON.stringify(l.parse(e))).digest("hex"),"ownerKey");function N(e,o,r){let t=l.parse(o),a=I.parse(r),c=e.get("SELECT payload FROM ponder_desktop_authority WHERE id = 1"),i=c?y.parse(JSON.parse(c.payload)):null;if(!i||i.state!=="attached"||Date.parse(i.leaseExpiresAt)<=Date.now()||i.authorizationRevision!==a.authorizationRevision||!Object.entries(a.scope).every(([d,u])=>i.scope[d]===u)||i.scope.installationId!==t.installationId||i.scope.profileId!==t.profileId||i.scope.ownerUserId!==t.ownerUserId||i.scope.teamId!==t.teamId)throw new Error("ponder_desktop_project_authority_changed")}n(N,"assertAuthority");function ne(e,o){let r=b.parse(o);N(e,r.owner,r.authority);let t=h(r.owner),a=e.get("SELECT payload FROM ponder_project_sharing WHERE owner_key = ? AND project_id = ?",[t,r.project.projectId]);if(!a&&(e.get("SELECT count(*) AS count FROM ponder_project_sharing WHERE owner_key = ?",[t])?.count??0)>=p)throw new Error("ponder_desktop_project_sharing_limit_exceeded");let c=a?m.parse(JSON.parse(a.payload)):null,i=c&&c.shared===r.shared&&c.project.revision===r.project.revision&&c.authority.authorizationRevision===r.authority.authorizationRevision&&Object.entries(r.authority.scope).every(([u,L])=>c.authority.scope[u]===L),d=m.parse({...r,revision:c?c.revision+(i?0:1):1});return e.run("INSERT INTO ponder_project_sharing (owner_key, project_id, payload) VALUES (?, ?, ?) ON CONFLICT(owner_key, project_id) DO UPDATE SET payload = excluded.payload",[t,r.project.projectId,JSON.stringify(d)]),d}n(ne,"setPonderProjectSharing");function ae(e,o){let r=e.all("SELECT payload FROM ponder_project_sharing WHERE owner_key = ? ORDER BY project_id LIMIT ?",[h(o),p+1]);if(r.length>p)throw new Error("ponder_desktop_project_sharing_limit_exceeded");return r.map(t=>{let a=m.parse(JSON.parse(t.payload));if(h(a.owner)!==h(o))throw new Error("ponder_desktop_project_owner_changed");return a})}n(ae,"readPonderProjectSharing");function ie(e,o){return e.shared&&e.authority.authorizationRevision===o.authorizationRevision&&Object.entries(o.scope).every(([r,t])=>e.authority.scope[r]===t)}n(ie,"projectSharingMatchesAuthority");import{createHash as F}from"node:crypto";function ue(e,o,r){let t=F("sha256").update(JSON.stringify({ownership:x(e,o),paused:r.paused,activeTurnId:r.activeTurnId})).digest("hex");return Number.parseInt(t.slice(0,13),16)}n(ue,"remoteCommandTargetRevision");function le(e,o){let r=e.get("SELECT turn_id,paused,lease_until FROM task_inbox_turns WHERE session_id=?",[o]),t=r&&r.lease_until>Date.now()&&e.get("SELECT status FROM turns WHERE id=?",[r.turn_id])?.status==="in_progress";return{paused:!!r?.paused,activeTurnId:t?r.turn_id:null}}n(le,"readRemoteCommandTargetState");function he(e,o){if(o.payload.resume!==!0)return;if(o.action!=="follow_up")throw new Error("remote_resume_action_invalid");let r=e.get("SELECT turn_id,paused,lease_until FROM task_inbox_turns WHERE session_id=?",[o.localSessionId]),t=e.get("SELECT id,status FROM turns WHERE session_id=? ORDER BY sort_index DESC LIMIT 1",[o.localSessionId]);if(!o.expectedTurnId||t?.id!==o.expectedTurnId||r?.turn_id!==o.expectedTurnId||!r.paused||r.lease_until>Date.now()||!["completed","failed","interrupted"].includes(t.status))throw new Error("remote_resume_target_changed");e.run("UPDATE task_inbox_turns SET paused=0 WHERE session_id=?",[o.localSessionId])}n(he,"resumeRemoteTaskInput");import{createHash as M}from"node:crypto";function T(e){return w.parse({provider:e.provider,cwd:e.cwd,localProjectId:e.localProjectId,workspaceId:e.workspaceId,workspaceKind:e.workspaceKind,workspaceName:e.workspaceName,...e.modelRef?{modelRef:e.modelRef}:{},currentProfile:e.currentProfile,experience:e.experience,profileWorkflowBinding:e.profileWorkflowBinding,profileComponentBinding:e.profileComponentBinding,openPondCommandAccessMode:e.openPondCommandAccessMode})}n(T,"remoteStarterPayload");function q(e){return Number.parseInt(M("sha256").update(P({payload:T(e),owner:e.metadata?.ponderLocalOwner})).digest("hex").slice(0,13),16)}n(q,"remoteStarterRevision");function H(e,o){let r=new Map;for(let t of e){if(!j(t,o)||!t.localProjectId||!t.cwd||t.archived||t.status==="closed"||t.systemKind||t.hiddenFromDefaultSidebar||t.metadata?.nativeHistoryProjection||!v(t.provider)||["sandbox","sandbox_template","sandbox_app"].includes(t.workspaceKind??""))continue;try{T(t)}catch{continue}let a=`starter:${t.id}`;r.set(a,{source:t,target:{id:a,projectId:t.localProjectId,projectLabel:t.workspaceName??"Local project",title:`New ${t.provider} task in ${t.workspaceName??"local project"}`,revision:q(t)}})}return r}n(H,"captureRemoteStarters");function Pe(e){return async o=>{let r=await e.current();if(!r)throw new Error("remote_account_unavailable");let t=[];for(let c of await e.store.sessionShells()){let i=await e.store.getSession(c.id);i&&t.push(i)}let a=H(t,r.owner).get(o.localStarterId);if(!a||a.target.revision!==o.expectedRevision||a.target.projectId!==o.payload.projectId||a.target.revision!==o.payload.starterRevision)throw new Error("remote_starter_changed");return a.source}}n(Pe,"createRemoteStarterResolver");var C=class extends Error{constructor(r,t=409){super(r);this.status=t;this.name="LocalManagedMessageError"}status;static{n(this,"LocalManagedMessageError")}};export{ue as a,le as b,he as c,T as d,q as e,H as f,Pe as g,z as h,C as i,X as j,Y as k,ne as l,ae as m,ie as n};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as x}from"./chunk-
|
|
2
|
+
import{a as x}from"./chunk-YQKOB56U.js";import{m as w}from"./chunk-JHMS2WXM.js";import{e as u}from"./chunk-2MMCZHKL.js";import{la as f}from"./chunk-A66CSUBJ.js";import{_a as h,cb as m,db as p}from"./chunk-RCA6NGVA.js";import{m as s}from"./chunk-BIPQCJ5V.js";import{A as e}from"./chunk-PF56N7ZY.js";import{a as c}from"./chunk-FTQLQJQV.js";import g from"node:path";import{lstat as k,readFile as v,realpath as b}from"node:fs/promises";import{randomUUID as D}from"node:crypto";var y=e.object({id:e.string(),version:e.string(),contentHash:e.string().regex(/^[a-f0-9]{64}$/),feedbackKey:e.string(),release:e.object({id:e.string(),revision:e.union([e.string(),e.number()]),contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict().nullable()}).strict(),H=e.object({binding:m,packageValue:e.unknown(),graders:e.array(y).max(100),actualGrading:e.object({pass:e.unknown(),evidence:e.unknown()}).strict().optional(),sourceCandidate:h.optional()}).strict();async function q(i,o){let n=await b(o),a=g.resolve(i);if(g.dirname(a)!==n||await b(a)!==a)throw new Error("External Dataset package escaped its private owner home.");let l=await k(a);if(!l.isFile()||l.isSymbolicLink()||l.size>32*1024*1024)throw new Error("External Dataset package is not a bounded regular file.");let r=H.parse(JSON.parse(new TextDecoder("utf8",{fatal:!0}).decode(await v(a))));return r.binding=p(r.binding),r.packageValue=u({...r,packageValue:f(r.packageValue)}),r}c(q,"readHostProfileExternalDataset");async function A(i){let o=H.parse(i.value),n=p(o.binding),a=i.release,l={id:a.harnessRelease.id,contentHash:a.harnessRelease.contentHash};if(n.protectedProfileClosureHash!==s(a.harnessRelease.files.filter(t=>t.visibility!=="policy").map(t=>({path:t.path,asset:t}))))throw new Error("The external Dataset protected Profile closure changed.");if(o.sourceCandidate){let t=await w({workspaceId:typeof a.agentSnapshot.metadata.workspaceId=="string"?a.agentSnapshot.metadata.workspaceId:a.workspaceId,sourceDir:g.join(a.bundlePath,"source")});if(s(o.sourceCandidate.harnessRelease)!==s(l)||x(t).protectedClosureHash!==o.sourceCandidate.protectedClosureHash)throw new Error("The external Dataset candidate differs from its retained frozen compiled source.")}let r=c(async t=>{if(e.object({authorized:e.literal(!0),bindingHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict().parse(await i.client.request({contractVersion:1,requestId:D(),operation:"profile.externalDataset.authorize",params:{...t,bindingHash:n.contentHash}})).bindingHash!==n.contentHash)throw new Error("The host authorized another external Dataset binding.")},"authorize");return{authorize:r,resolveExternalDataset:c(async(t,d)=>{if(await r(),s(t)!==s(n)||d.profileRef.profileId!==n.profileId||d.sourceRevision!==i.sourceRevision||s(d.harnessRelease)!==s(l))throw new Error("External Dataset requested another actual Profile source or recipe.");let E=u({...o,binding:t,packageValue:f(o.packageValue)});return{binding:n,packageValue:E,authorize:r}},"resolveExternalDataset"),sourceCandidate:o.sourceCandidate}}c(A,"createHostProfileExternalDataset");export{q as a,A as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{b as Be}from"./chunk-SYUKES6H.js";import{a as ye}from"./chunk-UKMA4R6X.js";import{k as he,m as fe,n as Le}from"./chunk-OQPJ7FJF.js";import{a as me,b as le}from"./chunk-3QIB5FXI.js";import{c as Ne}from"./chunk-4EPSHPZL.js";import{a as ue,t as pe}from"./chunk-FTEOCCPB.js";import{Va as H}from"./chunk-25MBPJVY.js";import{e as ee,l as f,m as ze}from"./chunk-WN3V6KDN.js";import{a as Z}from"./chunk-QDC4OW3S.js";import{a as Te}from"./chunk-ZZWAQBA2.js";import{b as B}from"./chunk-YR5ID2SS.js";import{c as V,d as qe,e as Y,f as Q}from"./chunk-APB2STJK.js";import{k as _e}from"./chunk-VYLGI3IH.js";import{Aa as je,oa as Oe,ub as $e}from"./chunk-ACYFMLWG.js";import{b as o}from"./chunk-ES2ISFJC.js";import{a as d}from"./chunk-FTQLQJQV.js";var zt=3e4,Lt=8*1024*1024,Kn={timeoutMs:900*1e3,maxResponseBytes:64*1024*1024},He=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"}},ge=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"}},Fe=class extends Error{static{d(this,"OpenPondApiError")}status;apiMessage;code;constructor(t,e,n,r=null){let a=r||e;super(`${n} failed: ${t}${a?` ${a}`:""}`),this.status=t,this.apiMessage=r,this.name="OpenPondApiError",this.code=e||"OPENPOND_API_ERROR"}};async function te(t,e,n,r={}){let{timeoutMs:a=zt,maxResponseBytes:s=Lt,explicitBearerAuth:i=!1,...u}=r,c=`${t}${n}`,p=new Headers(u.headers);p.set("Content-Type","application/json");let b=i?void 0:process.env.OPENPOND_API_KEY,l=e?.trim()||"",g=!i&&l.startsWith("opk_"),E=b||(g?l:null);E&&!p.has("openpond-api-key")&&p.set("openpond-api-key",E),e?p.set("Authorization",g?`ApiKey ${l}`:`Bearer ${e}`):b&&!p.has("Authorization")&&p.set("Authorization",`ApiKey ${b}`);let N=new AbortController,O=new He(a,c),T=a>0?setTimeout(()=>N.abort(O),a):null;T?.unref?.();let ce=Bt(u.signal,N.signal,a),X=d(()=>{T&&clearTimeout(T)},"cleanup");try{let C=await fetch(c,{...u,headers:p,signal:ce});return Nt(C,{cleanup:X,maximumBytes:s,requestUrl:c,timeoutController:N,timeoutError:O})}catch(C){throw X(),N.signal.aborted?O:C}}d(te,"apiFetch");async function be(t,e){let n;try{let r=await t.text();n=r?JSON.parse(r):{}}catch(r){if(r instanceof He||r instanceof ge)throw r;n={}}if(!t.ok){let r=typeof n.error=="string"?n.error:null,a=typeof n.message=="string"?n.message:null;throw new Fe(t.status,r,e,a)}return n}d(be,"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 ge(e.maximumBytes,e.requestUrl);let r=t.body.getReader(),a=0,s=new ReadableStream({async pull(i){try{let u=await r.read();if(u.done){e.cleanup(),i.close();return}if(a+=u.value.byteLength,e.maximumBytes>0&&a>e.maximumBytes){e.cleanup(),await r.cancel(),i.error(new ge(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 Bt(t,e,n){return n<=0?t??void 0:t?AbortSignal.any([t,e]):e}d(Bt,"composedSignal");var R=o.string().trim().min(1).max(240),F=o.string().regex(/^[a-f0-9]{64}$/),tr=o.object({cursor:o.string().trim().min(1).max(2e3).optional(),projectId:R.optional(),search:o.string().trim().max(100).optional(),sort:o.enum(["id","name","updated"]).default("id"),limit:o.number().int().min(1).max(100).default(100)}).strict(),nr=o.object({operationId:R,expectedRevision:o.number().int().nonnegative(),originProjectId:R.optional(),workspace:pe,ownerScope:o.enum(["workspace","personal"]).optional()}).strict().superRefine((t,e)=>{t.workspace.draft.modelScope!==null&&e.addIssue({code:"custom",message:"Independent datasets cannot carry Model-owned draft preparation."}),t.workspace.draft.status!=="draft"&&e.addIssue({code:"custom",message:"Only draft workspaces can be saved."})}),M=o.object({schemaVersion:o.literal("openpond.datasetWorkspaceReceipt.v1"),teamId:R,datasetId:R,revision:o.number().int().positive(),originProjectId:R.optional(),workspace:pe,ownerScope:o.enum(["workspace","personal"]).optional(),publication:o.object({tasksetId:R,release:ue,packageHash:F}).strict().nullable()}).strict().superRefine((t,e)=>{(t.workspace.draft.id!==t.datasetId||t.workspace.draft.profileId!==t.teamId||t.workspace.draft.revision!==t.revision||t.workspace.draft.modelScope!==null)&&e.addIssue({code:"custom",message:"Dataset workspace scope/revision mismatch."})}),rr=o.object({operationId:R,expectedRevision:o.number().int().positive(),workspaceHash:F,packageHash:F}).strict(),or=o.object({operationId:R,expectedRevision:o.number().int().positive()}).strict(),ar=o.object({teamId:R,datasetId:R,items:o.array(o.object({workspaceRevision:o.number().int().positive(),publication:M.shape.publication.unwrap(),publishedAt:o.iso.datetime()}).strict()).max(25),nextBeforeRevision:o.number().int().positive().nullable()}).strict(),sr=o.object({teamId:R,datasets:o.array(o.object({id:R,revision:o.number().int().positive(),originProjectId:R.optional(),name:o.string(),status:o.enum(["draft","published"]),ownerScope:o.enum(["workspace","personal"]).optional(),taskCount:o.number().int().nonnegative().optional(),publication:M.shape.publication,updatedAt:o.string().datetime()}).strict()).max(100),nextCursor:o.string().trim().min(1).max(2e3).nullable()}).strict(),ir=o.object({teamId:R,datasetId:R,revision:o.number().int().positive(),workspaceHash:F,packageHash:F,release:ue}).strict();var S=o.string().trim().min(1).max(500),L=o.string().regex(/^[a-f0-9]{64}$/),hr=o.object({teamId:S,ownerUserId:S}).strict(),ne=o.object({id:S,snapshotHash:L,boundaryId:S,boundaryRevisionHash:L}).strict(),Ie=o.object({sourceId:S,source:qe,sessionId:S,snapshotHash:L,title:o.string().max(500),projectId:S.nullable(),capturedAt:o.string().datetime(),boundaries:o.array(Q.omit({start:!0,end:!0})).max(V.boundaries)}).strict(),Ht=o.object({operationId:S,conversationId:S.optional(),cursor:S.optional(),limit:o.number().int().min(1).max(50).default(20)}).strict(),We=o.object({hash:L,parts:o.number().int().min(1).max(1500)}).strict(),Ft=We.extend({index:o.number().int().nonnegative().max(1499),base64:o.string().max(35e4)}).strict(),fr=o.object({path:o.string().min(1).max(500),encoding:o.enum(["utf8","zstd"]),base64:o.string()}).strict(),j=o.object({upload:We,source:o.enum(["codex","claude_code","hermes","openclaw","opencode","grok_build","pi","oh_my_pi"]),branchLeafId:S.optional(),acquisition:o.object({machineId:S,sourceInstanceId:S}).strict().optional(),destination:o.discriminatedUnion("kind",[o.object({kind:o.literal("existing"),projectId:S}).strict(),o.object({kind:o.literal("new"),name:o.string().trim().min(1).max(200)}).strict()])}).strict(),Ge=j.extend({operationId:S,previewHash:L,selection:o.array(o.object({sessionHash:L,boundaryIds:o.array(S).min(1).max(V.boundaries)}).strict()).min(1).max(V.sessions)}).strict(),Mt=o.object({from:o.string().datetime(),to:o.string().datetime(),projectId:S.optional()}).strict(),yr=o.object({teamId:S,range:Mt,activity:o.object({conversations:o.number().int().nonnegative(),turns:o.number().int().nonnegative(),chatTurns:o.number().int().nonnegative(),workTurns:o.number().int().nonnegative()}).strict(),accounting:o.object({contextSnapshots:o.number().int().nonnegative()}).strict(),usage:Z}).strict(),k=o.string().min(1).max(200),z=o.string().regex(/^[a-f0-9]{64}$/),Se=o.object({operationId:k,name:o.string().trim().min(1).max(500),projectId:k,dataset:ee.extend({revision:o.number().int().positive()}).strict(),caseIds:o.array(k).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."})}),Dt=ne.extend({inputHash:z,outputHash:z.nullable(),task:Oe,taskHash:z}).strict(),Jt=o.object({schemaVersion:o.literal("openpond.connectedRecordedExecution.v1"),id:k,teamId:k,ownerUserId:k,request:Se,manifest:$e,sources:o.array(Dt).min(1).max(1e4),contentHash:z}).strict();function Me(t){let e=Jt.parse(t),{contentHash:n,...r}=e,{contentHash:a,...s}=e.manifest;if(f(r)!==n||f(s)!==a||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 Kt=o.object({projectId:k.optional(),cursor:k.optional(),limit:o.number().int().min(1).max(50).default(20)}).strict(),Wt=o.object({id:k,teamId:k,ownerUserId:k,projectId:k,name:o.string().min(1).max(500),dataset:Se.shape.dataset,manifestHash:z,contentHash:z,caseCount:o.number().int().min(1).max(1e4),createdAt:o.string().datetime()}).strict(),Gt=o.object({teamId:k,items:o.array(Wt).max(50),nextCursor:k.nullable()}).strict(),Xt=o.object({datasetId:o.string().trim().min(1).max(240),expectedRevision:o.number().int().positive(),operationId:o.string().trim().min(1).max(240),graders:o.array(je).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."})}),D=o.string().min(1).max(500),q=o.number().int().nonnegative(),Vt=o.object({teamId:D,ownerUserId:D,projectId:D.nullable(),status:o.enum(["active","paused","archived"]),revision:q,state:o.enum(["collecting","pending","attention","paused","archived"]),lastReconciledAt:o.string().datetime().nullable(),lastCapturedAt:o.string().datetime().nullable(),historyDays:o.number().int().positive(),sources:q,tasks:q,datasets:o.array(o.object({datasetId:D,projection:o.enum(["turn","conversation"]),revision:q}).strict()).max(2),latestBatch:o.object({operationId:D,updatedAt:o.string().datetime(),scanned:q,captured:q,unchanged:q,pending:q,failed:q,excluded:q,paused:q,hasMore:o.boolean()}).strict().nullable()}).strict(),h=o.string().min(1).max(500),A=o.string().regex(/^[a-f0-9]{64}$/),De=o.object({teamId:h,projectId:h.nullable(),status:o.enum(["active","paused","archived"]),revision:o.number().int().nonnegative()}).strict(),Yt=o.object({teamId:h,operationId:h,projectId:h.nullable(),outcomes:o.array(o.object({conversationId:h,state:o.enum(["captured","unchanged","pending","paused","excluded","failed"]),sourceId:h.optional(),snapshotHash:A.optional(),reason:o.string().optional()}).strict()).max(50),nextCursor:h.nullable()}).strict(),Qt=o.object({teamId:h,ref:ne,origin:Ie.shape.source,sessionId:h,projectId:h,capturedAt:o.string().datetime(),unmappedEvidence:o.object({count:o.number().int().nonnegative().max(1e5),contentHash:A}).strict(),evidence:o.object({input:o.array(Y),observed:o.array(Y),answer:o.json(),boundary:Q}).strict()}).strict(),Zt=o.object({teamId:h,sourceId:h,snapshotHash:A,contentHash:A,count:o.number().int().nonnegative(),offset:o.number().int().nonnegative(),events:o.array(Y).max(50),nextOffset:o.number().int().nonnegative().nullable()}).strict(),en=o.object({teamId:h,source:j.shape.source,sourceHash:A,previewHash:A,destination:j.shape.destination,issues:o.array(o.object({file:o.string(),message:o.string()}).strict()).max(100),sessions:o.array(o.object({sessionHash:A,sessionId:h,origin:Ie.shape.source,exporterVersion:o.string().nullable(),eventCount:o.number().int().nonnegative(),boundaries:o.array(o.object({id:h,projection:o.enum(["turn","conversation"]),answer:o.boolean(),process:o.enum(["retained","partial","absent"]),terminal:o.enum(["completed","failed","cancelled","unknown"])}).strict()).max(5001),warnings:o.array(o.string()).max(100),sample:o.array(o.object({role:o.enum(["user","assistant","system","tool"]).nullable(),text:o.string().max(4e3)}).strict()).max(3)}).strict()).max(1e3)}).strict(),Je=o.object({teamId:h,operationId:h,requestHash:A,previewHash:A,projectId:h.optional(),state:o.enum(["admitting","publishing","completed","failed"]),outcomes:o.array(o.object({sessionHash:A,sourceId:h,status:o.enum(["imported","already_present"]),datasets:o.array(o.object({datasetId:h,revision:o.number().int().positive(),changed:o.boolean()}).strict()).max(2)}).strict()).max(1e3),error:o.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=Ht.parse(t),r=Yt.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(a=>a.conversationId!==n.conversationId))throw new Error("Capture receipt differs from its requested source or operation.");return r}async list(t={},e){let n=o.object({projectId:h.optional(),cursor:h.optional(),limit:o.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)])),a=o.object({teamId:h,items:o.array(Ie).max(50),nextCursor:h.nullable()}).strict().parse(await this.request(`?${r}`,"GET",void 0,e));if(this.scope(a.teamId),a.items.length>n.limit||new Set(a.items.map(s=>s.sourceId)).size!==a.items.length||a.nextCursor!==null&&a.nextCursor===n.cursor||n.projectId&&a.items.some(s=>s.projectId!==n.projectId))throw new Error("Connected source page differs from its requested scope.");return a}async read(t,e){let n=ne.parse(t),r=Qt.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",o.object({paused:o.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=Vt.parse(await this.request("/collection/status","GET",void 0,t));return this.scope(e.teamId),e}async unmappedEvents(t,e){let n=o.object({id:h,snapshotHash:A,contentHash:A,offset:o.number().int().nonnegative().default(0),limit:o.number().int().min(1).max(50).default(20)}).strict().parse(t),r=Zt.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((a,s)=>a.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=o.object({from:o.string().datetime(),to:o.string().datetime(),projectId:h.optional()}).strict(),r=n.parse(t),a=new URLSearchParams(Object.entries(r)),s=o.object({teamId:h,range:n,activity:o.object({conversations:o.number().int().nonnegative(),turns:o.number().int().nonnegative(),chatTurns:o.number().int().nonnegative(),workTurns:o.number().int().nonnegative()}).strict(),accounting:o.object({contextSnapshots:o.number().int().nonnegative()}).strict(),usage:Z}).strict().parse(await this.request(`/summary?${a}`,"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=Ft.parse(t),r=o.object({teamId:h,hash:A,parts:o.number().int(),index:o.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=j.parse(t),r=en.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(a=>a.origin!==n.source)||new Set(r.sessions.map(a=>a.sessionHash)).size!==r.sessions.length)throw new Error("Import preview differs from its source or destination.");return r}async commit(t,e){let n=Ge.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(a=>!n.selection.some(s=>s.sessionHash===a.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=Se.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=Kt.parse(t),r=new URLSearchParams(Object.entries(n).filter(([,s])=>s!==void 0).map(([s,i])=>[s,String(i)])),a=Gt.parse(await this.request(`/recorded-executions?${r}`,"GET",void 0,e));if(this.scope(a.teamId),a.items.length>n.limit||a.items.some((s,i)=>s.teamId!==a.teamId||n.projectId&&s.projectId!==n.projectId||n.cursor&&s.id<=n.cursor||i>0&&s.id<=a.items[i-1].id)||a.items.some(s=>s.ownerUserId!==a.items[0]?.ownerUserId)||a.nextCursor!==null&&(n.cursor!==void 0&&a.nextCursor<=n.cursor||a.items.length>0&&a.nextCursor<a.items.at(-1).id))throw new Error("Recorded execution page differs from its requested scope or cursor.");return a}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=Xt.parse(t),r=M.parse(await this.request("/datasets/publish","POST",n,e));this.scope(r.teamId);let a=r.workspace.draft.metadata.connectedPublication;if(r.datasetId!==n.datasetId||!r.publication||!a||typeof a!="object"||!("requestHash"in a)||a.requestHash!==f(n))throw new Error("Published Dataset identity or original selection mismatch.");return r}async createSelection(t,e){let n=o.object({operationId:h.max(240),projectId:h.max(240),name:o.string().trim().min(1).max(200),cases:o.array(ne).min(1).max(500)}).strict().parse(t),r=M.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((a,s)=>f(a.input&&typeof a.input=="object"&&!Array.isArray(a.input)?a.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:a,value:s}=await Ne(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(!a.ok){let i=o.object({code:o.string(),message:o.string()}).safeParse(s);throw new Ke(a.status,i.success?i.data.code:"connected_request_failed",i.success?i.data.message:"Connected evidence request failed.")}return s}},P=o.string().trim().min(1).max(240),kr=o.object({id:P,source:j.shape.source,machineId:P,sourceInstanceId:P,sourceLabel:o.string().trim().min(1).max(200),sourceRoot:o.string().min(1).max(2e3),destination:j.shape.destination,since:o.string().datetime().nullable(),keepSyncing:o.boolean(),expectedRevision:o.number().int().nonnegative()}).strict(),Er=o.object({id:P,expectedRevision:o.number().int().positive(),action:o.enum(["pause","resume","disconnect"])}).strict(),Ar=o.object({id:P,operationId:P,expectedRevision:o.number().int().positive()}).strict(),Ur=o.object({id:P,expectedRevision:o.number().int().positive(),pendingOperations:o.number().int().min(0).max(1e4),error:o.string().max(500).nullable(),completedSyncRevision:o.number().int().nonnegative().default(0)}).strict(),qr=o.object({teamId:P,id:P,revision:o.number().int().positive(),source:j.shape.source,sourceLabel:o.string(),sourceRoot:o.string(),taskDatasetId:P.nullable(),conversationDatasetId:P.nullable(),machineId:P,sourceInstanceId:P,projectId:P,datasetIds:o.array(P).max(2),since:o.string().datetime().nullable(),keepSyncing:o.boolean(),state:o.enum(["active","paused","disconnected"]),health:o.enum(["online","offline"]),lastHeartbeatAt:o.string().datetime().nullable(),lastAdmissionAt:o.string().datetime().nullable(),pendingOperations:o.number().int().nonnegative(),admittedTasks:o.number().int().nonnegative(),error:o.string().nullable(),requestedSyncRevision:o.number().int().nonnegative().default(0),completedSyncRevision:o.number().int().nonnegative().default(0),syncRequestedAt:o.string().datetime().nullable().default(null),syncCompletedAt:o.string().datetime().nullable().default(null)}).strict().refine(t=>t.completedSyncRevision<=t.requestedSyncRevision&&t.requestedSyncRevision<=t.revision,"Invalid sync acknowledgement generation."),Or=o.object({connectionId:P,expectedRevision:o.number().int().positive(),request:Ge}).strict();function Br(t){let e=d(r=>`/v1/training/candidate-evaluations/${encodeURIComponent(r)}`,"path");function n(r,a,s){let i=rn.parse(r);if(i.teamId!==a||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,a={}){let s=new URLSearchParams({teamId:r,...a}),i=nn.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 a=Ve.parse(r),s=n(await t(`/v1/training/candidate-evaluations?teamId=${encodeURIComponent(a.teamId)}`,{method:"POST",body:JSON.stringify(a)}),a.teamId);if(s.requestHash!==f(a))throw new Error("The saved preparation differs from the selected candidate or frozen evaluation.");return s},async get(r,a){return n(await t(`${e(a)}?teamId=${encodeURIComponent(r)}`),r,a)},async control(r,a,s,i){let u=on.parse(i),c=n(await t(`${e(a)}/${s}?teamId=${encodeURIComponent(r)}`,{method:"POST",body:JSON.stringify(u)}),r,a);if(c.requestHash!==u.requestHash)throw new Error("The command returned a different frozen evaluation.");return c}}}d(Br,"createCandidateEvaluationClient");var I=o.string().trim().min(1).max(200),we=o.string().regex(/^[a-f0-9]{64}$/),Xe=o.object({id:I,contentHash:we}).strict(),tn=o.object({artifact:Xe,trainingJobId:I,configurationId:I,baseProfileId:I,ready:o.boolean(),reason:o.string().max(1e3).nullable()}).strict(),nn=o.object({teamId:I,ownerUserId:I,items:o.array(tn).max(100),nextCursor:I.nullable()}).strict(),Ve=o.object({teamId:I,operationId:I,artifact:Xe,configuration:H}).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."})}),rn=o.object({schemaVersion:o.literal("openpond.candidateEvaluationPreparation.v1"),teamId:I,ownerUserId:I,id:I,revision:o.number().int().positive(),requestHash:we,request:Ve,trainingJobId:I,dispatchId:I,lastOperationId:I.nullable(),runtime:o.object({poolId:I,endpointId:I.nullable(),baseProfileId:I,workerImageDigest:o.string().regex(/^sha256:[a-f0-9]{64}$/),modelId:I.nullable()}).strict().nullable(),state:o.enum(["configured","preparing","ready","dispatching","submitted","cleaning","completed","failed","cancelled"]),experimentId:I.nullable(),authorizedAt:o.iso.datetime().nullable(),cancelledAt:o.iso.datetime().nullable(),reason:o.string().max(1e3).nullable(),createdAt:o.iso.datetime(),updatedAt:o.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."})}),on=o.object({operationId:I,expectedRevision:o.number().int().positive(),requestHash:we}).strict();var x=o.string().trim().min(1).max(200),J=o.string().regex(/^[a-f0-9]{64}$/),K=o.string().datetime(),Ye=o.object({operationId:x,id:x.optional(),expectedRevision:o.number().int().nonnegative(),teamId:x,projectId:x.nullable(),enabled:o.boolean(),configuration:H,cadence:o.discriminatedUnion("kind",[o.object({kind:o.literal("interval"),seconds:o.number().int().min(60).max(31536e3)}).strict(),o.object({kind:o.literal("nightly"),calendar:_e}).strict()]),maximumTotalSpendUsd:o.number().finite().positive().max(1e4),maximumAttempts:o.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."})}),an=o.object({id:x,scheduledAt:K,coalescedThroughAt:K,coalescedCount:o.number().int().nonnegative(),configurationHash:J,operationId:x,state:o.enum(["reserved","dispatching","running","cleaning","completed","failed","cancelled","uncertain"]),executionId:x.nullable(),attempt:o.number().int().positive(),maximumCostUsd:o.number().finite().positive(),actualSpendUsd:o.number().finite().nonnegative().nullable(),cleanupComplete:o.boolean(),error:o.string().max(4e3).nullable()}).strict(),sn=o.object({schemaVersion:o.literal("openpond.experimentEvaluationSchedule.v1"),id:x,revision:o.number().int().positive(),actorId:x,teamId:x,projectId:x.nullable(),operationId:x,requestHash:J,configuration:H,configurationHash:J,cadence:Ye.shape.cadence,state:o.enum(["scheduled","disabled","blocked"]),nextRunAt:K.nullable(),maximumTotalSpendUsd:o.number().finite().positive(),maximumAttempts:o.number().int().positive(),lastEvaluatedConfigurationHash:J.nullable(),newerUnevaluatedRelease:ee.nullable(),fires:o.array(an).max(1e4),reason:o.string().max(4e3).nullable(),createdAt:K,updatedAt:K,contentHash:J}).strict();function dn(t){let{operationId:e,request:n,...r}=t,{operationId:a,...s}=n;return f({...r,request:s})}d(dn,"scheduledExperimentHash");function cn(t){let e=sn.parse(t);if(ze(e,"Scheduled Experiment"),e.configurationHash!==dn(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(cn,"verifyExperimentEvaluationSchedule");function Wr(t){return cn({...t,contentHash:f(t)})}d(Wr,"sealExperimentEvaluationSchedule");var un=o.object({teamId:x,id:x,operationId:x,expectedRevision:o.number().int().positive(),action:o.enum(["cancel_active","retry_active","pause"])}).strict(),Gr=o.discriminatedUnion("operation",[o.object({operation:o.literal("publish"),request:Ye}).strict(),o.object({operation:o.literal("control"),request:un}).strict(),o.object({operation:o.literal("read"),id:x}).strict(),o.object({operation:o.literal("list"),cursor:x.optional(),limit:o.number().int().min(1).max(100).default(50)}).strict()]);function pn(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(pn,"createSandboxRuntimeNamespace");function mn(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(mn,"createSandboxNamespace");function ln(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(ln,"createSandboxProjectNamespace");function hn(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(hn,"createSandboxProfileNamespace");function fn(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(fn,"createSandboxAgentNamespace");function yn(t,e,n=null){let r=d(async(c={},p={})=>{let b=await t.getSandboxRuntime(e);return b.sandboxId?t.get(b.sandboxId):t.createSandboxRuntimeSandbox(e,c,p).then(l=>l.sandbox)},"currentSandbox"),a=d(async(c={},p={})=>{let b=await t.getSandboxRuntime(e);if(!b.sandboxId)return t.createSandboxRuntimeSandbox(e,c,p).then(g=>g.sandbox);let l=await t.get(b.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:a,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=gn(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 a()).id,c,p),"write"),read:d(async c=>t.downloadFile((await a()).id,c),"read"),readResponse:d(async c=>t.downloadFileResponse((await a()).id,c),"readResponse"),list:d(async(c={})=>t.listFiles((await a()).id,c),"list"),delete:d(async(c,p={})=>t.deleteFile((await a()).id,c,p),"delete"),search:d(async c=>t.searchFiles((await a()).id,c),"search"),stat:d(async c=>t.statFile((await a()).id,c),"stat"),mkdir:d(async c=>t.mkdir((await a()).id,c),"mkdir"),move:d(async c=>t.moveFile((await a()).id,c),"move")},commands:{run:d(async c=>t.exec((await a()).id,typeof c=="string"?{command:c}:c),"run")},ports:{expose:d(async c=>t.openPort((await a()).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(yn,"createSandboxRuntimeHandle");function gn(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(gn,"runtimeKeepaliveUntilIso");async function bn(t,e={}){let n=`openpond-code-smoke-${Date.now()}`,r=`openpond-code-exec-ok:${n}`,a=`openpond-code-preview-ok:${n}`,s=`openpond-code-file-ok:${n}`,i=4173,u=null,c=null,p=!1,b=!1;try{let l=await Ze(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 E=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('${a}')).listen(${i}, '0.0.0.0');`,"EOF","nohup node server.cjs > server.log 2>&1 & sleep 1"].join(`
|
|
2
|
+
import{b as Be}from"./chunk-SYUKES6H.js";import{a as ye}from"./chunk-7LZISGTA.js";import{k as he,m as fe,n as Le}from"./chunk-OQPJ7FJF.js";import{a as me,b as le}from"./chunk-5ZBLCWEJ.js";import{c as Ne}from"./chunk-WGX7WY4N.js";import{a as ue,t as pe}from"./chunk-637UACKH.js";import{Va as H}from"./chunk-A66CSUBJ.js";import{e as ee,l as f,m as ze}from"./chunk-SPDSSMFD.js";import{a as Z}from"./chunk-RYGWCN2R.js";import{a as Te}from"./chunk-ZZWAQBA2.js";import{b as B}from"./chunk-YR5ID2SS.js";import{c as V,d as qe,e as Y,f as Q}from"./chunk-2SUMZ73C.js";import{k as _e}from"./chunk-SFNCAPCJ.js";import{Fb as $e,La as je,za as Oe}from"./chunk-RCA6NGVA.js";import{A as o}from"./chunk-PF56N7ZY.js";import{a as d}from"./chunk-FTQLQJQV.js";var zt=3e4,Lt=8*1024*1024,Kn={timeoutMs:900*1e3,maxResponseBytes:64*1024*1024},He=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"}},ge=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"}},Fe=class extends Error{static{d(this,"OpenPondApiError")}status;apiMessage;code;constructor(t,e,n,r=null){let a=r||e;super(`${n} failed: ${t}${a?` ${a}`:""}`),this.status=t,this.apiMessage=r,this.name="OpenPondApiError",this.code=e||"OPENPOND_API_ERROR"}};async function te(t,e,n,r={}){let{timeoutMs:a=zt,maxResponseBytes:s=Lt,explicitBearerAuth:i=!1,...u}=r,c=`${t}${n}`,p=new Headers(u.headers);p.set("Content-Type","application/json");let b=i?void 0:process.env.OPENPOND_API_KEY,l=e?.trim()||"",g=!i&&l.startsWith("opk_"),E=b||(g?l:null);E&&!p.has("openpond-api-key")&&p.set("openpond-api-key",E),e?p.set("Authorization",g?`ApiKey ${l}`:`Bearer ${e}`):b&&!p.has("Authorization")&&p.set("Authorization",`ApiKey ${b}`);let N=new AbortController,O=new He(a,c),T=a>0?setTimeout(()=>N.abort(O),a):null;T?.unref?.();let ce=Bt(u.signal,N.signal,a),X=d(()=>{T&&clearTimeout(T)},"cleanup");try{let C=await fetch(c,{...u,headers:p,signal:ce});return Nt(C,{cleanup:X,maximumBytes:s,requestUrl:c,timeoutController:N,timeoutError:O})}catch(C){throw X(),N.signal.aborted?O:C}}d(te,"apiFetch");async function be(t,e){let n;try{let r=await t.text();n=r?JSON.parse(r):{}}catch(r){if(r instanceof He||r instanceof ge)throw r;n={}}if(!t.ok){let r=typeof n.error=="string"?n.error:null,a=typeof n.message=="string"?n.message:null;throw new Fe(t.status,r,e,a)}return n}d(be,"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 ge(e.maximumBytes,e.requestUrl);let r=t.body.getReader(),a=0,s=new ReadableStream({async pull(i){try{let u=await r.read();if(u.done){e.cleanup(),i.close();return}if(a+=u.value.byteLength,e.maximumBytes>0&&a>e.maximumBytes){e.cleanup(),await r.cancel(),i.error(new ge(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 Bt(t,e,n){return n<=0?t??void 0:t?AbortSignal.any([t,e]):e}d(Bt,"composedSignal");var R=o.string().trim().min(1).max(240),F=o.string().regex(/^[a-f0-9]{64}$/),tr=o.object({cursor:o.string().trim().min(1).max(2e3).optional(),projectId:R.optional(),search:o.string().trim().max(100).optional(),sort:o.enum(["id","name","updated"]).default("id"),limit:o.number().int().min(1).max(100).default(100)}).strict(),nr=o.object({operationId:R,expectedRevision:o.number().int().nonnegative(),originProjectId:R.optional(),workspace:pe,ownerScope:o.enum(["workspace","personal"]).optional()}).strict().superRefine((t,e)=>{t.workspace.draft.modelScope!==null&&e.addIssue({code:"custom",message:"Independent datasets cannot carry Model-owned draft preparation."}),t.workspace.draft.status!=="draft"&&e.addIssue({code:"custom",message:"Only draft workspaces can be saved."})}),M=o.object({schemaVersion:o.literal("openpond.datasetWorkspaceReceipt.v1"),teamId:R,datasetId:R,revision:o.number().int().positive(),originProjectId:R.optional(),workspace:pe,ownerScope:o.enum(["workspace","personal"]).optional(),publication:o.object({tasksetId:R,release:ue,packageHash:F}).strict().nullable()}).strict().superRefine((t,e)=>{(t.workspace.draft.id!==t.datasetId||t.workspace.draft.profileId!==t.teamId||t.workspace.draft.revision!==t.revision||t.workspace.draft.modelScope!==null)&&e.addIssue({code:"custom",message:"Dataset workspace scope/revision mismatch."})}),rr=o.object({operationId:R,expectedRevision:o.number().int().positive(),workspaceHash:F,packageHash:F}).strict(),or=o.object({operationId:R,expectedRevision:o.number().int().positive()}).strict(),ar=o.object({teamId:R,datasetId:R,items:o.array(o.object({workspaceRevision:o.number().int().positive(),publication:M.shape.publication.unwrap(),publishedAt:o.iso.datetime()}).strict()).max(25),nextBeforeRevision:o.number().int().positive().nullable()}).strict(),sr=o.object({teamId:R,datasets:o.array(o.object({id:R,revision:o.number().int().positive(),originProjectId:R.optional(),name:o.string(),status:o.enum(["draft","published"]),ownerScope:o.enum(["workspace","personal"]).optional(),taskCount:o.number().int().nonnegative().optional(),publication:M.shape.publication,updatedAt:o.string().datetime()}).strict()).max(100),nextCursor:o.string().trim().min(1).max(2e3).nullable()}).strict(),ir=o.object({teamId:R,datasetId:R,revision:o.number().int().positive(),workspaceHash:F,packageHash:F,release:ue}).strict();var S=o.string().trim().min(1).max(500),L=o.string().regex(/^[a-f0-9]{64}$/),hr=o.object({teamId:S,ownerUserId:S}).strict(),ne=o.object({id:S,snapshotHash:L,boundaryId:S,boundaryRevisionHash:L}).strict(),Ie=o.object({sourceId:S,source:qe,sessionId:S,snapshotHash:L,title:o.string().max(500),projectId:S.nullable(),capturedAt:o.string().datetime(),boundaries:o.array(Q.omit({start:!0,end:!0})).max(V.boundaries)}).strict(),Ht=o.object({operationId:S,conversationId:S.optional(),cursor:S.optional(),limit:o.number().int().min(1).max(50).default(20)}).strict(),We=o.object({hash:L,parts:o.number().int().min(1).max(1500)}).strict(),Ft=We.extend({index:o.number().int().nonnegative().max(1499),base64:o.string().max(35e4)}).strict(),fr=o.object({path:o.string().min(1).max(500),encoding:o.enum(["utf8","zstd"]),base64:o.string()}).strict(),j=o.object({upload:We,source:o.enum(["codex","claude_code","hermes","openclaw","opencode","grok_build","pi","oh_my_pi"]),branchLeafId:S.optional(),acquisition:o.object({machineId:S,sourceInstanceId:S}).strict().optional(),destination:o.discriminatedUnion("kind",[o.object({kind:o.literal("existing"),projectId:S}).strict(),o.object({kind:o.literal("new"),name:o.string().trim().min(1).max(200)}).strict()])}).strict(),Ge=j.extend({operationId:S,previewHash:L,selection:o.array(o.object({sessionHash:L,boundaryIds:o.array(S).min(1).max(V.boundaries)}).strict()).min(1).max(V.sessions)}).strict(),Mt=o.object({from:o.string().datetime(),to:o.string().datetime(),projectId:S.optional()}).strict(),yr=o.object({teamId:S,range:Mt,activity:o.object({conversations:o.number().int().nonnegative(),turns:o.number().int().nonnegative(),chatTurns:o.number().int().nonnegative(),workTurns:o.number().int().nonnegative()}).strict(),accounting:o.object({contextSnapshots:o.number().int().nonnegative()}).strict(),usage:Z}).strict(),k=o.string().min(1).max(200),z=o.string().regex(/^[a-f0-9]{64}$/),Se=o.object({operationId:k,name:o.string().trim().min(1).max(500),projectId:k,dataset:ee.extend({revision:o.number().int().positive()}).strict(),caseIds:o.array(k).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."})}),Dt=ne.extend({inputHash:z,outputHash:z.nullable(),task:Oe,taskHash:z}).strict(),Jt=o.object({schemaVersion:o.literal("openpond.connectedRecordedExecution.v1"),id:k,teamId:k,ownerUserId:k,request:Se,manifest:$e,sources:o.array(Dt).min(1).max(1e4),contentHash:z}).strict();function Me(t){let e=Jt.parse(t),{contentHash:n,...r}=e,{contentHash:a,...s}=e.manifest;if(f(r)!==n||f(s)!==a||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 Kt=o.object({projectId:k.optional(),cursor:k.optional(),limit:o.number().int().min(1).max(50).default(20)}).strict(),Wt=o.object({id:k,teamId:k,ownerUserId:k,projectId:k,name:o.string().min(1).max(500),dataset:Se.shape.dataset,manifestHash:z,contentHash:z,caseCount:o.number().int().min(1).max(1e4),createdAt:o.string().datetime()}).strict(),Gt=o.object({teamId:k,items:o.array(Wt).max(50),nextCursor:k.nullable()}).strict(),Xt=o.object({datasetId:o.string().trim().min(1).max(240),expectedRevision:o.number().int().positive(),operationId:o.string().trim().min(1).max(240),graders:o.array(je).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."})}),D=o.string().min(1).max(500),q=o.number().int().nonnegative(),Vt=o.object({teamId:D,ownerUserId:D,projectId:D.nullable(),status:o.enum(["active","paused","archived"]),revision:q,state:o.enum(["collecting","pending","attention","paused","archived"]),lastReconciledAt:o.string().datetime().nullable(),lastCapturedAt:o.string().datetime().nullable(),historyDays:o.number().int().positive(),sources:q,tasks:q,datasets:o.array(o.object({datasetId:D,projection:o.enum(["turn","conversation"]),revision:q}).strict()).max(2),latestBatch:o.object({operationId:D,updatedAt:o.string().datetime(),scanned:q,captured:q,unchanged:q,pending:q,failed:q,excluded:q,paused:q,hasMore:o.boolean()}).strict().nullable()}).strict(),h=o.string().min(1).max(500),A=o.string().regex(/^[a-f0-9]{64}$/),De=o.object({teamId:h,projectId:h.nullable(),status:o.enum(["active","paused","archived"]),revision:o.number().int().nonnegative()}).strict(),Yt=o.object({teamId:h,operationId:h,projectId:h.nullable(),outcomes:o.array(o.object({conversationId:h,state:o.enum(["captured","unchanged","pending","paused","excluded","failed"]),sourceId:h.optional(),snapshotHash:A.optional(),reason:o.string().optional()}).strict()).max(50),nextCursor:h.nullable()}).strict(),Qt=o.object({teamId:h,ref:ne,origin:Ie.shape.source,sessionId:h,projectId:h,capturedAt:o.string().datetime(),unmappedEvidence:o.object({count:o.number().int().nonnegative().max(1e5),contentHash:A}).strict(),evidence:o.object({input:o.array(Y),observed:o.array(Y),answer:o.json(),boundary:Q}).strict()}).strict(),Zt=o.object({teamId:h,sourceId:h,snapshotHash:A,contentHash:A,count:o.number().int().nonnegative(),offset:o.number().int().nonnegative(),events:o.array(Y).max(50),nextOffset:o.number().int().nonnegative().nullable()}).strict(),en=o.object({teamId:h,source:j.shape.source,sourceHash:A,previewHash:A,destination:j.shape.destination,issues:o.array(o.object({file:o.string(),message:o.string()}).strict()).max(100),sessions:o.array(o.object({sessionHash:A,sessionId:h,origin:Ie.shape.source,exporterVersion:o.string().nullable(),eventCount:o.number().int().nonnegative(),boundaries:o.array(o.object({id:h,projection:o.enum(["turn","conversation"]),answer:o.boolean(),process:o.enum(["retained","partial","absent"]),terminal:o.enum(["completed","failed","cancelled","unknown"])}).strict()).max(5001),warnings:o.array(o.string()).max(100),sample:o.array(o.object({role:o.enum(["user","assistant","system","tool"]).nullable(),text:o.string().max(4e3)}).strict()).max(3)}).strict()).max(1e3)}).strict(),Je=o.object({teamId:h,operationId:h,requestHash:A,previewHash:A,projectId:h.optional(),state:o.enum(["admitting","publishing","completed","failed"]),outcomes:o.array(o.object({sessionHash:A,sourceId:h,status:o.enum(["imported","already_present"]),datasets:o.array(o.object({datasetId:h,revision:o.number().int().positive(),changed:o.boolean()}).strict()).max(2)}).strict()).max(1e3),error:o.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=Ht.parse(t),r=Yt.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(a=>a.conversationId!==n.conversationId))throw new Error("Capture receipt differs from its requested source or operation.");return r}async list(t={},e){let n=o.object({projectId:h.optional(),cursor:h.optional(),limit:o.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)])),a=o.object({teamId:h,items:o.array(Ie).max(50),nextCursor:h.nullable()}).strict().parse(await this.request(`?${r}`,"GET",void 0,e));if(this.scope(a.teamId),a.items.length>n.limit||new Set(a.items.map(s=>s.sourceId)).size!==a.items.length||a.nextCursor!==null&&a.nextCursor===n.cursor||n.projectId&&a.items.some(s=>s.projectId!==n.projectId))throw new Error("Connected source page differs from its requested scope.");return a}async read(t,e){let n=ne.parse(t),r=Qt.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",o.object({paused:o.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=Vt.parse(await this.request("/collection/status","GET",void 0,t));return this.scope(e.teamId),e}async unmappedEvents(t,e){let n=o.object({id:h,snapshotHash:A,contentHash:A,offset:o.number().int().nonnegative().default(0),limit:o.number().int().min(1).max(50).default(20)}).strict().parse(t),r=Zt.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((a,s)=>a.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=o.object({from:o.string().datetime(),to:o.string().datetime(),projectId:h.optional()}).strict(),r=n.parse(t),a=new URLSearchParams(Object.entries(r)),s=o.object({teamId:h,range:n,activity:o.object({conversations:o.number().int().nonnegative(),turns:o.number().int().nonnegative(),chatTurns:o.number().int().nonnegative(),workTurns:o.number().int().nonnegative()}).strict(),accounting:o.object({contextSnapshots:o.number().int().nonnegative()}).strict(),usage:Z}).strict().parse(await this.request(`/summary?${a}`,"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=Ft.parse(t),r=o.object({teamId:h,hash:A,parts:o.number().int(),index:o.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=j.parse(t),r=en.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(a=>a.origin!==n.source)||new Set(r.sessions.map(a=>a.sessionHash)).size!==r.sessions.length)throw new Error("Import preview differs from its source or destination.");return r}async commit(t,e){let n=Ge.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(a=>!n.selection.some(s=>s.sessionHash===a.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=Se.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=Kt.parse(t),r=new URLSearchParams(Object.entries(n).filter(([,s])=>s!==void 0).map(([s,i])=>[s,String(i)])),a=Gt.parse(await this.request(`/recorded-executions?${r}`,"GET",void 0,e));if(this.scope(a.teamId),a.items.length>n.limit||a.items.some((s,i)=>s.teamId!==a.teamId||n.projectId&&s.projectId!==n.projectId||n.cursor&&s.id<=n.cursor||i>0&&s.id<=a.items[i-1].id)||a.items.some(s=>s.ownerUserId!==a.items[0]?.ownerUserId)||a.nextCursor!==null&&(n.cursor!==void 0&&a.nextCursor<=n.cursor||a.items.length>0&&a.nextCursor<a.items.at(-1).id))throw new Error("Recorded execution page differs from its requested scope or cursor.");return a}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=Xt.parse(t),r=M.parse(await this.request("/datasets/publish","POST",n,e));this.scope(r.teamId);let a=r.workspace.draft.metadata.connectedPublication;if(r.datasetId!==n.datasetId||!r.publication||!a||typeof a!="object"||!("requestHash"in a)||a.requestHash!==f(n))throw new Error("Published Dataset identity or original selection mismatch.");return r}async createSelection(t,e){let n=o.object({operationId:h.max(240),projectId:h.max(240),name:o.string().trim().min(1).max(200),cases:o.array(ne).min(1).max(500)}).strict().parse(t),r=M.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((a,s)=>f(a.input&&typeof a.input=="object"&&!Array.isArray(a.input)?a.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:a,value:s}=await Ne(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(!a.ok){let i=o.object({code:o.string(),message:o.string()}).safeParse(s);throw new Ke(a.status,i.success?i.data.code:"connected_request_failed",i.success?i.data.message:"Connected evidence request failed.")}return s}},P=o.string().trim().min(1).max(240),kr=o.object({id:P,source:j.shape.source,machineId:P,sourceInstanceId:P,sourceLabel:o.string().trim().min(1).max(200),sourceRoot:o.string().min(1).max(2e3),destination:j.shape.destination,since:o.string().datetime().nullable(),keepSyncing:o.boolean(),expectedRevision:o.number().int().nonnegative()}).strict(),Er=o.object({id:P,expectedRevision:o.number().int().positive(),action:o.enum(["pause","resume","disconnect"])}).strict(),Ar=o.object({id:P,operationId:P,expectedRevision:o.number().int().positive()}).strict(),Ur=o.object({id:P,expectedRevision:o.number().int().positive(),pendingOperations:o.number().int().min(0).max(1e4),error:o.string().max(500).nullable(),completedSyncRevision:o.number().int().nonnegative().default(0)}).strict(),qr=o.object({teamId:P,id:P,revision:o.number().int().positive(),source:j.shape.source,sourceLabel:o.string(),sourceRoot:o.string(),taskDatasetId:P.nullable(),conversationDatasetId:P.nullable(),machineId:P,sourceInstanceId:P,projectId:P,datasetIds:o.array(P).max(2),since:o.string().datetime().nullable(),keepSyncing:o.boolean(),state:o.enum(["active","paused","disconnected"]),health:o.enum(["online","offline"]),lastHeartbeatAt:o.string().datetime().nullable(),lastAdmissionAt:o.string().datetime().nullable(),pendingOperations:o.number().int().nonnegative(),admittedTasks:o.number().int().nonnegative(),error:o.string().nullable(),requestedSyncRevision:o.number().int().nonnegative().default(0),completedSyncRevision:o.number().int().nonnegative().default(0),syncRequestedAt:o.string().datetime().nullable().default(null),syncCompletedAt:o.string().datetime().nullable().default(null)}).strict().refine(t=>t.completedSyncRevision<=t.requestedSyncRevision&&t.requestedSyncRevision<=t.revision,"Invalid sync acknowledgement generation."),Or=o.object({connectionId:P,expectedRevision:o.number().int().positive(),request:Ge}).strict();function Br(t){let e=d(r=>`/v1/training/candidate-evaluations/${encodeURIComponent(r)}`,"path");function n(r,a,s){let i=rn.parse(r);if(i.teamId!==a||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,a={}){let s=new URLSearchParams({teamId:r,...a}),i=nn.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 a=Ve.parse(r),s=n(await t(`/v1/training/candidate-evaluations?teamId=${encodeURIComponent(a.teamId)}`,{method:"POST",body:JSON.stringify(a)}),a.teamId);if(s.requestHash!==f(a))throw new Error("The saved preparation differs from the selected candidate or frozen evaluation.");return s},async get(r,a){return n(await t(`${e(a)}?teamId=${encodeURIComponent(r)}`),r,a)},async control(r,a,s,i){let u=on.parse(i),c=n(await t(`${e(a)}/${s}?teamId=${encodeURIComponent(r)}`,{method:"POST",body:JSON.stringify(u)}),r,a);if(c.requestHash!==u.requestHash)throw new Error("The command returned a different frozen evaluation.");return c}}}d(Br,"createCandidateEvaluationClient");var I=o.string().trim().min(1).max(200),we=o.string().regex(/^[a-f0-9]{64}$/),Xe=o.object({id:I,contentHash:we}).strict(),tn=o.object({artifact:Xe,trainingJobId:I,configurationId:I,baseProfileId:I,ready:o.boolean(),reason:o.string().max(1e3).nullable()}).strict(),nn=o.object({teamId:I,ownerUserId:I,items:o.array(tn).max(100),nextCursor:I.nullable()}).strict(),Ve=o.object({teamId:I,operationId:I,artifact:Xe,configuration:H}).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."})}),rn=o.object({schemaVersion:o.literal("openpond.candidateEvaluationPreparation.v1"),teamId:I,ownerUserId:I,id:I,revision:o.number().int().positive(),requestHash:we,request:Ve,trainingJobId:I,dispatchId:I,lastOperationId:I.nullable(),runtime:o.object({poolId:I,endpointId:I.nullable(),baseProfileId:I,workerImageDigest:o.string().regex(/^sha256:[a-f0-9]{64}$/),modelId:I.nullable()}).strict().nullable(),state:o.enum(["configured","preparing","ready","dispatching","submitted","cleaning","completed","failed","cancelled"]),experimentId:I.nullable(),authorizedAt:o.iso.datetime().nullable(),cancelledAt:o.iso.datetime().nullable(),reason:o.string().max(1e3).nullable(),createdAt:o.iso.datetime(),updatedAt:o.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."})}),on=o.object({operationId:I,expectedRevision:o.number().int().positive(),requestHash:we}).strict();var x=o.string().trim().min(1).max(200),J=o.string().regex(/^[a-f0-9]{64}$/),K=o.string().datetime(),Ye=o.object({operationId:x,id:x.optional(),expectedRevision:o.number().int().nonnegative(),teamId:x,projectId:x.nullable(),enabled:o.boolean(),configuration:H,cadence:o.discriminatedUnion("kind",[o.object({kind:o.literal("interval"),seconds:o.number().int().min(60).max(31536e3)}).strict(),o.object({kind:o.literal("nightly"),calendar:_e}).strict()]),maximumTotalSpendUsd:o.number().finite().positive().max(1e4),maximumAttempts:o.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."})}),an=o.object({id:x,scheduledAt:K,coalescedThroughAt:K,coalescedCount:o.number().int().nonnegative(),configurationHash:J,operationId:x,state:o.enum(["reserved","dispatching","running","cleaning","completed","failed","cancelled","uncertain"]),executionId:x.nullable(),attempt:o.number().int().positive(),maximumCostUsd:o.number().finite().positive(),actualSpendUsd:o.number().finite().nonnegative().nullable(),cleanupComplete:o.boolean(),error:o.string().max(4e3).nullable()}).strict(),sn=o.object({schemaVersion:o.literal("openpond.experimentEvaluationSchedule.v1"),id:x,revision:o.number().int().positive(),actorId:x,teamId:x,projectId:x.nullable(),operationId:x,requestHash:J,configuration:H,configurationHash:J,cadence:Ye.shape.cadence,state:o.enum(["scheduled","disabled","blocked"]),nextRunAt:K.nullable(),maximumTotalSpendUsd:o.number().finite().positive(),maximumAttempts:o.number().int().positive(),lastEvaluatedConfigurationHash:J.nullable(),newerUnevaluatedRelease:ee.nullable(),fires:o.array(an).max(1e4),reason:o.string().max(4e3).nullable(),createdAt:K,updatedAt:K,contentHash:J}).strict();function dn(t){let{operationId:e,request:n,...r}=t,{operationId:a,...s}=n;return f({...r,request:s})}d(dn,"scheduledExperimentHash");function cn(t){let e=sn.parse(t);if(ze(e,"Scheduled Experiment"),e.configurationHash!==dn(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(cn,"verifyExperimentEvaluationSchedule");function Wr(t){return cn({...t,contentHash:f(t)})}d(Wr,"sealExperimentEvaluationSchedule");var un=o.object({teamId:x,id:x,operationId:x,expectedRevision:o.number().int().positive(),action:o.enum(["cancel_active","retry_active","pause"])}).strict(),Gr=o.discriminatedUnion("operation",[o.object({operation:o.literal("publish"),request:Ye}).strict(),o.object({operation:o.literal("control"),request:un}).strict(),o.object({operation:o.literal("read"),id:x}).strict(),o.object({operation:o.literal("list"),cursor:x.optional(),limit:o.number().int().min(1).max(100).default(50)}).strict()]);function pn(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(pn,"createSandboxRuntimeNamespace");function mn(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(mn,"createSandboxNamespace");function ln(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(ln,"createSandboxProjectNamespace");function hn(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(hn,"createSandboxProfileNamespace");function fn(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(fn,"createSandboxAgentNamespace");function yn(t,e,n=null){let r=d(async(c={},p={})=>{let b=await t.getSandboxRuntime(e);return b.sandboxId?t.get(b.sandboxId):t.createSandboxRuntimeSandbox(e,c,p).then(l=>l.sandbox)},"currentSandbox"),a=d(async(c={},p={})=>{let b=await t.getSandboxRuntime(e);if(!b.sandboxId)return t.createSandboxRuntimeSandbox(e,c,p).then(g=>g.sandbox);let l=await t.get(b.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:a,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=gn(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 a()).id,c,p),"write"),read:d(async c=>t.downloadFile((await a()).id,c),"read"),readResponse:d(async c=>t.downloadFileResponse((await a()).id,c),"readResponse"),list:d(async(c={})=>t.listFiles((await a()).id,c),"list"),delete:d(async(c,p={})=>t.deleteFile((await a()).id,c,p),"delete"),search:d(async c=>t.searchFiles((await a()).id,c),"search"),stat:d(async c=>t.statFile((await a()).id,c),"stat"),mkdir:d(async c=>t.mkdir((await a()).id,c),"mkdir"),move:d(async c=>t.moveFile((await a()).id,c),"move")},commands:{run:d(async c=>t.exec((await a()).id,typeof c=="string"?{command:c}:c),"run")},ports:{expose:d(async c=>t.openPort((await a()).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(yn,"createSandboxRuntimeHandle");function gn(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(gn,"runtimeKeepaliveUntilIso");async function bn(t,e={}){let n=`openpond-code-smoke-${Date.now()}`,r=`openpond-code-exec-ok:${n}`,a=`openpond-code-preview-ok:${n}`,s=`openpond-code-file-ok:${n}`,i=4173,u=null,c=null,p=!1,b=!1;try{let l=await Ze(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 E=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('${a}')).listen(${i}, '0.0.0.0');`,"EOF","nohup node server.cjs > server.log 2>&1 & sleep 1"].join(`
|
|
3
3
|
`),timeoutSeconds:120});if(E.command.status!=="succeeded")throw new Error(`expected command success, got ${E.command.status}`);if(!E.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 O=null;if(e.snapshot||e.fork){let C=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"}]}}}),U=C.snapshot??(await wn(t,l.id,C.snapshotJob?.snapshotId)).snapshot;if(O=U.id,U.state!=="ready")throw new Error(`expected ready snapshot, got ${U.state}`)}if(e.fork){if(!O)throw new Error("expected snapshot id before fork");let C=await Ze(t,(await t.forkSnapshot(O,{budget:{maxUsd:e.budgetUsd??"0.05"},metadata:{source:"openpond-code-sandbox-smoke-fork",templateSnapshotId:O}},{async:!0})).sandbox);c=C.id;let U=await t.exec(C.id,{command:"cat openpond-code-smoke.txt",timeoutSeconds:120});if(U.command.status!=="succeeded")throw new Error(`expected fork command success, got ${U.command.status}`);if(!U.command.output.includes(s))throw new Error("expected fork snapshot marker");e.keep||(await xe(t,C.id),b=!0)}let T=null;if(e.preview!==!1){let C=await t.openPort(l.id,{label:"openpond-code-smoke",port:i}),U=await fetch(C.preview.url);T=U.status;let Tt=await U.text();if(U.status!==200)throw new Error(`expected preview HTTP 200, got ${U.status}`);if(!Tt.includes(a))throw new Error("expected preview marker")}let{sandbox:ce,receipts:X}=await In(t,l.id);return e.keep||(await xe(t,l.id),p=!0),{deleted:p,execOutput:E.command.output.trim(),fileRoundtrip:!0,forkSandboxId:c,previewStatus:T,receiptRefs:X.map(C=>C.mpp.receiptRef??null),reservationRef:l.reservation.mpp?.reservationRef??null,runId:n,sandboxId:l.id,snapshotId:O,state:ce.state}}finally{c&&!e.keep&&!b&&await Qe(t,c),u&&!e.keep&&!p&&await Qe(t,u)}}d(bn,"runSandboxSmoke");async function In(t,e){try{await t.stop(e)}catch{await t.stop(e,{async:!0})}let n=await tt(t,e,new Set(["stopped","deleted"]),"stop"),r=await Sn(t,e);if(r.length===0)throw new Error("expected receipt readback");return{sandbox:n,receipts:r}}d(In,"stopSandboxForSmoke");async function xe(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 tt(t,e,new Set(["deleted"]),"delete")}d(xe,"deleteSandboxForSmoke");async function Qe(t,e){try{await xe(t,e)}catch{await t.delete(e,{async:!0}).catch(()=>{})}}d(Qe,"cleanupSandboxBestEffort");async function tt(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 re(3e3),u=await t.get(e)}throw new Error(`sandbox ${r} did not reach ${[...n].join("/")} before timeout: ${e} (${u.state})`)}d(tt,"waitForSandboxState");async function Sn(t,e){let a=Date.now()+12e4,s=await t.receipts(e);for(;Date.now()<a;){if(s.length>0)return s;await re(3e3),s=await t.receipts(e)}return s}d(Sn,"waitForReceipts");async function Ze(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,a=Date.now()+n,s=e;for(;Date.now()<a;){if(await re(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,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{b as o,c as t}from"./chunk-
|
|
2
|
+
import{b as o,c as t}from"./chunk-BIPQCJ5V.js";import{A as e}from"./chunk-PF56N7ZY.js";import{a}from"./chunk-FTQLQJQV.js";var d=e.object({provider:o,model:o,revision:e.string().trim().min(1).max(500).nullable().default(null),artifactHash:t.nullable().default(null),tokenizerRevision:e.string().trim().min(1).max(500).nullable().default(null),chatTemplateHash:t.nullable().default(null)}).strict(),l=["openpond","codex","claude-code","grok-build","opencode","anthropic","openai","xai","google","openrouter","deepseek","zai","moonshot","together","groq","custom-openai-compatible"],n=e.templateLiteral(["acp:",e.string().regex(/^[a-z0-9][a-z0-9-]{0,100}$/)]),i=e.union([e.enum(l),n]);function p(r){return/^acp:[a-z0-9][a-z0-9-]{0,100}$/.test(r)}a(p,"isRegisteredAcpProvider");var s=e.object({providerId:i,modelId:e.string().trim().min(1).max(300)});export{d as a,l as b,n as c,i as d,p as e,s as f};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as be,b as Ae,c as Ie,d as ve}from"./chunk-
|
|
2
|
+
import{a as be,b as Ae,c as Ie,d as ve}from"./chunk-YDU3S6UT.js";import{c as O,i as L}from"./chunk-ENSB6ZTM.js";import{a as Re}from"./chunk-6FA3GG5B.js";import{f as Oe}from"./chunk-H7IWJN7L.js";import{a as s}from"./chunk-FTQLQJQV.js";var W=class extends Error{static{s(this,"OpenPondProfileSetupRequiredError")}code="agent_source_setup_required";details;constructor(t,n){let o=n.blockingRequirements.map(r=>r.label);super(["agent_source_setup_required",`Profile action ${t} has unresolved required setup.`,o.length?`Missing setup: ${o.join(", ")}`:""].filter(Boolean).join(`
|
|
3
3
|
`)),this.name="OpenPondProfileSetupRequiredError",this.details={error:"agent_source_setup_required",actionId:t,setupGate:n,missing:o,blockingSetupRequirements:n.blockingRequirements,setupRequirements:n.requirements}}};function K(e){let t=new Map;for(let a of e.sourceSetupRequirements??[]){let l=bt(a);if(e.actionId&&l&&l!==e.actionId&&h(a.actionName)!==e.actionId&&h(a.sourceActionId)!==e.actionId)continue;let c=Ee({record:a,source:"source_upload_metadata",actionId:l});c&&t.set(c.ref,c)}for(let a of e.actionCatalog)if(!(e.actionId&&a.id!==e.actionId&&a.name!==e.actionId))for(let l of a.setupRequirements??[]){let c=Ee({record:l,source:"action_catalog",actionId:a.id});c&&t.set(c.ref,c)}let n=Array.from(t.values()),o=n.filter(a=>a.blocking),r=n.filter(a=>!a.required&&!ne(a.status)).length,i=n.filter(a=>ne(a.status)).length;return{status:It(o),requirementCount:n.length,blockingCount:o.length,optionalMissingCount:r,readyCount:i,requirements:n,blockingRequirements:o}}s(K,"buildOpenPondProfileSetupGate");function oe(e,t){if(t.blockingRequirements.length>0)throw new W(e,t)}s(oe,"assertOpenPondProfileActionReady");function Rt(e){let t=e.actionId?`${e.actionId}: `:"",n=e.required?"required":"optional";return`${t}${e.label} (${n}, ${e.status})`}s(Rt,"formatOpenPondProfileSetupRequirement");function Ee(e){let t=e.source==="action_catalog"&&h(e.record.source)==="source_upload_metadata"?"source_upload_metadata":e.source,n=h(e.record.kind)??h(e.record.type),o=h(e.record.label)??h(e.record.name)??h(e.record.key)??h(e.record.provider)??h(e.record.tool)??h(e.record.command)??h(e.record.packageName)??h(e.record.path)??h(e.record.repo)??h(e.record.url)??h(e.record.id)??n??"setup requirement",r=e.record.required!==!1,i=At(e.record);return{ref:[t,e.actionId??"source",n??"requirement",o].join(":"),source:t,actionId:e.actionId,kind:n,label:o,status:i,required:r,blocking:r&&!ne(i)}}s(Ee,"setupRequirementFromRecord");function bt(e){return h(e.actionId)??h(e.sourceActionId)??h(e.actionName)}s(bt,"setupRequirementActionId");function At(e){let t=h(e.status)??h(e.state);return t?t==="satisfied"||t==="connected"||t==="provided"?"ready":t:typeof e.satisfied=="boolean"?e.satisfied?"ready":"setup_required":typeof e.ready=="boolean"&&e.ready?"ready":"setup_required"}s(At,"setupStatus");function It(e){return e.length===0?"ready":e.some(t=>["blocked","unsupported","unsupported_dependency","stale"].includes(t.status))?"blocked":"setup_required"}s(It,"gateStatus");function ne(e){return e==="ready"||e==="disabled"}s(ne,"isReadyStatus");function h(e){return typeof e=="string"&&e.trim()?e.trim():null}s(h,"text");import{stat as qt}from"node:fs/promises";import se from"node:path";import{spawn as vt}from"node:child_process";import{existsSync as re}from"node:fs";import{readFile as Et,rm as Kn,writeFile as _e}from"node:fs/promises";import ie from"node:path";var Le=["**/node_modules/","**/.bun/","**/.env","**/.env.*","**/.openpond/traces/","**/.openpond/vendor/","**/.openpond/eval-results.json","**/.openpond/artifact-index.json","**/.openpond/source-upload-cache.json",""].join(`
|
|
4
4
|
`);async function Me(e){if(!re(ie.join(e,".git"))){let i=await R(e,["init","-b","main"]);if(i.code!==0)throw new Error(H("git init",i))}let t=ie.join(e,".gitignore");if(re(t)?await xt(t):await _e(t,Le,"utf8"),await _t(e))return;let n=await N(e);if(!n.dirty&&n.files.length===0)return;let o=await R(e,["add","-A"]);if(o.code!==0)throw new Error(H("git add",o));let r=await R(e,["commit","-m","Initialize OpenPond profile"],{env:{...process.env,GIT_AUTHOR_NAME:process.env.GIT_AUTHOR_NAME||"OpenPond",GIT_AUTHOR_EMAIL:process.env.GIT_AUTHOR_EMAIL||"openpond@example.invalid",GIT_COMMITTER_NAME:process.env.GIT_COMMITTER_NAME||"OpenPond",GIT_COMMITTER_EMAIL:process.env.GIT_COMMITTER_EMAIL||"openpond@example.invalid"}});if(r.code!==0&&!/nothing to commit/i.test(r.stdout+r.stderr))throw new Error(H("git commit",r))}s(Me,"ensureProfileGitRepo");async function xt(e){let t=await Et(e,"utf8").catch(()=>""),n=Le.split(/\r?\n/).map(r=>r.trim()).filter(Boolean).filter(r=>!t.split(/\r?\n/).some(i=>i.trim()===r));if(n.length===0)return;let o=t.endsWith(`
|
|
5
5
|
`)||t.length===0?"":`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{
|
|
2
|
+
import{rb as a,sb as r}from"./chunk-RCA6NGVA.js";import{m as t}from"./chunk-BIPQCJ5V.js";import{a as n}from"./chunk-FTQLQJQV.js";var T=r;function f(i,l){let s=new Map(i.map(o=>[o.name,o]));return l.map(o=>{let e=s.get(o.name);if(!a.has(o.name)||o.sideEffect!=="read"||!e||t(e.parameters)!==o.inputSchemaHash)throw new Error(`Standalone Harness tool has no compatible case-scoped implementation: ${o.name}.`);return e})}n(f,"isolateStandaloneExperimentTools");export{T as a,f as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as I,b as B}from"./chunk-
|
|
2
|
+
import{a as I,b as B}from"./chunk-V2HMWCT6.js";import{ab as $}from"./chunk-ZR7LIMJS.js";import{j as V,k as z,l as P,m as U,n as j,o as W}from"./chunk-2SUMZ73C.js";import{b as O,d as D}from"./chunk-SFNCAPCJ.js";import{l as p,ob as L,y as N}from"./chunk-RCA6NGVA.js";import{m as _}from"./chunk-BIPQCJ5V.js";import{A as n}from"./chunk-PF56N7ZY.js";import{a as m}from"./chunk-FTQLQJQV.js";function T(e,r){let i=r.scope==="arguments"?e.action?.arguments:e[r.scope];for(let d of r.path){if(!i||typeof i!="object"||!Object.hasOwn(i,d))throw new Error("environment_service_reference_missing");i=i[d]}return i}m(T,"resolveValue");async function F(e,r){if(!e.executionServices?.length)return r.controller(e);if(!Number.isSafeInteger(e.timeoutMs)||e.timeoutMs<1||e.timeoutMs>3e4)throw new Error("environment_timeout_invalid");p(e.value,4194304);let i=e.executionServices.map(c=>z.parse(c));if(i.length>16)throw new Error("environment_service_limit");if(new Set(i.map(c=>c.id)).size!==i.length)throw new Error("environment_service_identity_collision");let d=Date.now(),x=new AbortController,v=e.signal?AbortSignal.any([e.signal,x.signal]):x.signal,q=setTimeout(()=>x.abort(new Error("environment_timeout")),e.timeoutMs);try{let c=Object.create(null);for(let t of i){if(v.throwIfAborted(),t.operation!==e.operation||t.operation==="step"&&t.toolName!==e.value.action?.name)throw new Error("environment_service_operation_mismatch");let h=Math.min(t.timeoutMs,e.timeoutMs-(Date.now()-d));if(h<1)throw new Error("environment_timeout");let w=new AbortController,y=AbortSignal.any([v,w.signal]),S=setTimeout(()=>w.abort(new Error("environment_service_timeout")),h),E=Date.now();try{if(t.kind==="sqlite.v1"){if(!r.sql)throw new Error("environment_sql_executor_required");let s=T(e.value,t.sql);if(typeof s!="string"||!s.length||new TextEncoder().encode(s).byteLength>65536||s.includes("\0")){c[t.id]={status:"rejected",code:"invalid_submission"};continue}let l=V({schemaVersion:"openpond.sqlExecution.v1",snapshot:T(e.value,t.snapshot),sql:s,maxRows:t.maxRows,maxResultBytes:t.maxResultBytes});c[t.id]=await r.sql({request:l,timeoutMs:e.timeoutMs,signal:y})}else{let s=T(e.value,t.source),l=T(e.value,t.cases);if(typeof s!="string"||new TextEncoder().encode(s).byteLength>524288){c[t.id]={status:"rejected",code:"invalid_submission"};continue}if(!Array.isArray(l)||!l.length||l.length>t.maxCases||l.some(a=>!a||typeof a!="object"||!Object.hasOwn(a,"input")))throw new Error("environment_service_cases_invalid");let b=[];for(let a of l){let o=h-(Date.now()-E);if(o<1&&(w.abort(new Error("environment_service_timeout")),y.throwIfAborted()),b.push(await r.candidate({source:s,exportName:t.exportName,value:structuredClone(a.input),timeoutMs:Math.max(1,o),maxResultBytes:t.maxResultBytes,deterministic:!0,errorPrefix:"candidate",signal:y})),new TextEncoder().encode(JSON.stringify({status:"completed",cases:b})).byteLength>t.maxResultBytes)throw new I("candidate_result_too_large")}c[t.id]={status:"completed",cases:b}}}catch(s){if(v.throwIfAborted(),w.signal.aborted)c[t.id]={status:"rejected",code:"timeout"};else if(s instanceof I)c[t.id]={status:"rejected",code:"execution_failed"};else throw s}finally{clearTimeout(S)}}v.throwIfAborted();let g=e.timeoutMs-(Date.now()-d);if(g<1)throw new Error("environment_timeout");return await r.controller({...e,executionServices:void 0,value:{...e.value,services:c},timeoutMs:g,signal:v})}finally{clearTimeout(q)}}m(F,"executeEnvironmentWithServices");async function G(e){let r=U.parse(e.operation);return F(e,{candidate:B,controller:m(async i=>j.parse(await B({...i,exportName:r,maxResultBytes:1572864,deterministic:!0,errorPrefix:"environment"})),"controller")})}m(G,"executeJavaScriptEnvironment");var k=class extends Error{static{m(this,"JavaScriptEnvironmentActionError")}code;constructor(r){super(`environment_${r}`),this.code=r,this.name="JavaScriptEnvironmentActionError"}};async function me(e){let r=W(e.definition),i=D(e.asset,r.module);if(!Number.isSafeInteger(e.seed))throw new Error("environment_seed_invalid");let d=e.seed;p(e.input,1048576),p(e.initialState,r.maxStateBytes);let x=structuredClone(e.input),v=structuredClone(e.initialState),q=e.execute??G,c=new AbortController,g=e.signal?AbortSignal.any([e.signal,c.signal]):c.signal,t={},h=0,w=!1,y=!1,S=null,E=[],s=null;async function l(a,o){if(w||y)throw new Error("environment_closed");if(S)throw new Error("environment_operation_in_progress");g.throwIfAborted(),o&&(p(o,262144),o=structuredClone(o));let M=_(t),f=o?r.tools.find(u=>u.name===o.name):null;if(a==="step"){if(h>=r.maxSteps)throw new k("step_budget_exhausted");h++}let H=m((u,A)=>E.push({sequence:E.length,operation:a,toolName:o?.name??null,arguments:o?structuredClone(o.arguments):null,observation:u,beforeStateHash:M,afterStateHash:_(t),error:A}),"record");try{if(o&&!f)throw new k("unknown_tool");if(o&&f&&!N(f.inputSchema,o.arguments).valid)throw new k("invalid_arguments");let u=r.executionServices?.filter(R=>R.operation===a&&(a!=="step"||R.toolName===o?.name)),A=q({source:i,operation:a,value:{input:x,initialState:v,seed:d,state:structuredClone(t),sequence:h,action:o?structuredClone(o):null},timeoutMs:Math.min(r.operationTimeoutMs,f?.timeoutMs??r.operationTimeoutMs),signal:g,...u?.length?{executionServices:u}:{}});S=A;let C=j.parse(await A);if(g.throwIfAborted(),p(C.state,r.maxStateBytes),p(C.observation,r.maxObservationBytes),(a==="collect"||f?.sideEffect==="read")&&_(C.state)!==M)throw new Error("environment_read_changed_state");t=structuredClone(C.state);let J=structuredClone(C.observation);return H(J,null),{state:structuredClone(t),observation:J}}catch(u){throw H(null,u instanceof Error?u.message:"environment_execution_failed"),u}finally{S=null}}m(l,"invoke");async function b(){return s||(y=!0,c.abort(new Error("environment_destroyed")),s=(async()=>{try{try{await S}catch{}await q({source:i,operation:"destroy",value:{input:x,initialState:v,seed:d,state:structuredClone(t),sequence:h,action:null},timeoutMs:r.operationTimeoutMs})}finally{t={},w=!0}})(),s)}m(b,"destroy");try{await l("create");let a=await l("reset"),o=_(t),M=m(()=>{if(w)throw new Error("environment_closed");return{definition:{id:r.id,revision:r.revision,contentHash:r.contentHash},inputHash:_(x),seed:d,initialStateHash:o,finalStateHash:_(t),state:structuredClone(t),events:structuredClone(E)}},"snapshot");return{definition:structuredClone(r),observation:a.observation,async step(f){return(await l("step",f)).observation},async collect(){let f=await l("collect");return{...M(),observation:f.observation}},snapshot:M,destroy:b}}catch(a){try{await b()}catch{}throw a}}m(me,"createJavaScriptEnvironmentSession");var K=n.string().trim().min(1).max(500),Q=n.string().regex(/^[a-f0-9]{64}$/),X=n.object({kind:n.literal("model"),id:n.string().trim().min(1).max(191),taskId:K,admissionHash:Q,model:$,instructions:n.string().max(262144),harness:L.optional(),input:n.record(n.string(),n.unknown()),policyVisibleContext:n.record(n.string(),n.unknown()),timeoutMs:n.number().int().positive().max(36e5),environment:n.discriminatedUnion("kind",[n.object({kind:n.literal("text")}).strict(),n.object({kind:n.literal("javascript"),definition:P,asset:O,initialState:n.record(n.string(),n.unknown()),seed:n.number().int().safe()}).strict()])}).strict(),_e=n.discriminatedUnion("kind",[X,n.object({kind:n.literal("profile"),request:n.unknown()}).strict()]);export{F as a,k as b,me as c,X as d,_e as e};
|