openpond 0.2.59 → 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 +7 -0
- 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-JJ3CU7J6.js → actions-command-6YSZ7EJS.js} +1 -1
- package/dist/chunks/{app-layer-KAUZAHGE.js → app-layer-TVG7KTW6.js} +1 -1
- package/dist/chunks/{app-server-connected-apps-SXGZOUJJ.js → app-server-connected-apps-K62M6LCT.js} +1 -1
- package/dist/chunks/{app-server-evaluations-N4OMTPCI.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-JUQMSHNR.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-EOBHQ3JT.js → chunk-2PAJCXFC.js} +1 -1
- package/dist/chunks/{chunk-GYJQKCEO.js → chunk-2RNCXDJC.js} +1 -1
- package/dist/chunks/{chunk-APB2STJK.js → chunk-2SUMZ73C.js} +1 -1
- package/dist/chunks/{chunk-DZUN5YWB.js → chunk-3CWRTKHY.js} +1 -1
- package/dist/chunks/{chunk-TRQQNFMO.js → chunk-44LWH5U6.js} +1 -1
- package/dist/chunks/{chunk-BVQWVIGK.js → chunk-52KIORRX.js} +1 -1
- package/dist/chunks/{chunk-TG7P7BSV.js → chunk-5RHYSQZ5.js} +1 -1
- package/dist/chunks/{chunk-3QIB5FXI.js → chunk-5ZBLCWEJ.js} +1 -1
- package/dist/chunks/{chunk-25JDHAZ5.js → chunk-637UACKH.js} +1 -1
- package/dist/chunks/{chunk-VRODAXFS.js → chunk-655DQ6AX.js} +26 -26
- package/dist/chunks/{chunk-N4FFQPLR.js → chunk-6GWOVHIG.js} +1 -1
- package/dist/chunks/chunk-6HQB3MQO.js +2 -0
- package/dist/chunks/{chunk-GOPFFQZU.js → chunk-7LZISGTA.js} +2 -2
- package/dist/chunks/{chunk-MMQRHR3V.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-XMKCCLGB.js → chunk-A66CSUBJ.js} +1 -1
- package/dist/chunks/{chunk-OUVIWDL2.js → chunk-AGVOGPAZ.js} +1 -1
- package/dist/chunks/{chunk-U2MAPON2.js → chunk-AW5Q6NXT.js} +1 -1
- package/dist/chunks/{chunk-7AVNZF36.js → chunk-B46HZ3MX.js} +1 -1
- package/dist/chunks/{chunk-KGNCKIFP.js → chunk-BIPQCJ5V.js} +1 -1
- package/dist/chunks/{chunk-776WNDV2.js → chunk-BIQ33JV5.js} +1 -1
- package/dist/chunks/{chunk-JFXWI3EN.js → chunk-BK63OQRW.js} +1 -1
- package/dist/chunks/{chunk-BO5JZYWG.js → chunk-CFSIU6CW.js} +1 -1
- package/dist/chunks/{chunk-WC42WOLG.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-JMBQYBPI.js → chunk-DIGX56JY.js} +1 -1
- package/dist/chunks/{chunk-4GPXTISD.js → chunk-DISNCX6R.js} +1 -1
- package/dist/chunks/{chunk-EWOSLZDX.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-OLDK2LKJ.js → chunk-EL454L26.js} +1 -1
- package/dist/chunks/{chunk-WRI4XKSK.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-57TRXBLT.js → chunk-FSQWAANK.js} +1 -1
- package/dist/chunks/{chunk-BGJYITVI.js → chunk-G5B3PB5X.js} +1 -1
- package/dist/chunks/{chunk-ARLOVWQ3.js → chunk-GAWGIJQG.js} +1 -1
- package/dist/chunks/{chunk-ABZ2ZOLU.js → chunk-GGGF5NHJ.js} +1 -1
- package/dist/chunks/{chunk-4EDIRCD3.js → chunk-GOYBYYPQ.js} +1 -1
- package/dist/chunks/{chunk-H7ATCPPB.js → chunk-H3BSIAQO.js} +1 -1
- package/dist/chunks/{chunk-RBZH6A6M.js → chunk-HCEJAOIF.js} +1 -1
- package/dist/chunks/{chunk-OPNRWESL.js → chunk-IFQCOSU6.js} +1 -1
- package/dist/chunks/{chunk-VGRMAGOK.js → chunk-IJHZBHEK.js} +2 -2
- package/dist/chunks/{chunk-GUOLMLZN.js → chunk-ISFIDCIH.js} +1 -1
- package/dist/chunks/{chunk-PY6K2JRH.js → chunk-ITKTILKI.js} +1 -1
- package/dist/chunks/{chunk-3CDEBKSU.js → chunk-IUBARBGI.js} +1 -1
- package/dist/chunks/{chunk-2L5XWJJ5.js → chunk-J24I74EM.js} +1 -1
- package/dist/chunks/{chunk-IRV6GWGG.js → chunk-J7QGHA7G.js} +3 -3
- package/dist/chunks/{chunk-FAYASU7Z.js → chunk-JGWINTT5.js} +1 -1
- package/dist/chunks/{chunk-GL3NX3F3.js → chunk-JHEFWB6O.js} +1 -1
- package/dist/chunks/{chunk-V34H7Y2T.js → chunk-JHMS2WXM.js} +2 -2
- package/dist/chunks/{chunk-PSGGOZFM.js → chunk-JHR3LF2F.js} +1 -1
- package/dist/chunks/{chunk-O4VIXU7A.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-BQS7Z4AP.js → chunk-LD7PGREF.js} +2 -2
- package/dist/chunks/{chunk-MNC4YUDI.js → chunk-LHA7RQBA.js} +1 -1
- package/dist/chunks/{chunk-RZUEVS64.js → chunk-LO3O45IX.js} +1 -1
- package/dist/chunks/{chunk-TIHXUKFD.js → chunk-M2SKXY5C.js} +2 -2
- package/dist/chunks/{chunk-2IHO4GDJ.js → chunk-M3ZQDPRS.js} +1 -1
- package/dist/chunks/{chunk-DPHAN6N3.js → chunk-M4ZF44H5.js} +1 -1
- package/dist/chunks/{chunk-Y4OWBBDD.js → chunk-M55H7KVR.js} +1 -1
- package/dist/chunks/{chunk-NTB2O4RP.js → chunk-MGKMIRYG.js} +1 -1
- package/dist/chunks/{chunk-XJZSIXEO.js → chunk-MJGU2JJ2.js} +2 -2
- package/dist/chunks/{chunk-7K7O3CKY.js → chunk-MS37ISA4.js} +2 -2
- package/dist/chunks/{chunk-BRORSFJX.js → chunk-NCKXI2VB.js} +11 -11
- package/dist/chunks/chunk-NHUUCNAD.js +2 -0
- package/dist/chunks/{chunk-2WKUBGIF.js → chunk-O3VP46SE.js} +1 -1
- package/dist/chunks/{chunk-EUMXMT3S.js → chunk-O4FBOUNX.js} +1 -1
- package/dist/chunks/chunk-O6IFVTZT.js +9 -0
- package/dist/chunks/{chunk-ZH3K7LKQ.js → chunk-O7B44IYN.js} +1 -1
- package/dist/chunks/{chunk-ZAN4DYLH.js → chunk-OGMDEA3Y.js} +1 -1
- package/dist/chunks/{chunk-BL3YH2QU.js → chunk-OKBIWRHC.js} +1 -1
- package/dist/chunks/{chunk-FFRFSDBM.js → chunk-ON2RNOCG.js} +1 -1
- package/dist/chunks/{chunk-76M2MEHV.js → chunk-ONDCV5QC.js} +1 -1
- package/dist/chunks/{chunk-UCPGRPWY.js → chunk-OQ4VGCRG.js} +1 -1
- package/dist/chunks/{chunk-GVZLGS2U.js → chunk-OWK7HU5I.js} +1 -1
- package/dist/chunks/{chunk-JQKSXCAJ.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-OX3XZKGK.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-LPWBIGKW.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-ATAOHSFR.js → chunk-RJIUOLWY.js} +1 -1
- package/dist/chunks/{chunk-37MWETFU.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-IFDALGZE.js → chunk-SKRNWRKV.js} +5 -5
- package/dist/chunks/{chunk-ANFDRKUU.js → chunk-SLZH4Z6C.js} +1 -1
- package/dist/chunks/{chunk-WN3V6KDN.js → chunk-SPDSSMFD.js} +1 -1
- package/dist/chunks/{chunk-EQOV34UH.js → chunk-STWRTNRK.js} +1 -1
- package/dist/chunks/{chunk-XMWXH7TS.js → chunk-T5J7HIHR.js} +1 -1
- package/dist/chunks/{chunk-E72UU4VX.js → chunk-TBUAQWFS.js} +1 -1
- package/dist/chunks/{chunk-ZUJ3XUCP.js → chunk-TEPRCBDV.js} +1 -1
- package/dist/chunks/{chunk-2G4BEISF.js → chunk-TOFMA2L5.js} +2 -2
- package/dist/chunks/{chunk-TKLBP3MM.js → chunk-UFHLLSCE.js} +1 -1
- package/dist/chunks/{chunk-BE6SS65L.js → chunk-UJKQLO6B.js} +2 -2
- package/dist/chunks/{chunk-O3RF72BT.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-22VMH6JV.js → chunk-W2SXOGTQ.js} +1 -1
- package/dist/chunks/{chunk-PH6IORGZ.js → chunk-WDEO44UN.js} +1 -1
- package/dist/chunks/{chunk-LNCHFVHT.js → chunk-WEHBK3MC.js} +1 -1
- package/dist/chunks/{chunk-KO3HNMLJ.js → chunk-WGX7WY4N.js} +1 -1
- package/dist/chunks/{chunk-CKMSBAI2.js → chunk-WHREO7A2.js} +1 -1
- package/dist/chunks/{chunk-N6ENLEMY.js → chunk-WS2ZZBAQ.js} +3 -3
- 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-FKJHEZCW.js → chunk-XQBIHPPX.js} +1 -1
- package/dist/chunks/chunk-XRKFTPHD.js +2 -0
- package/dist/chunks/{chunk-YHHF4Q7Y.js → chunk-XSCIOQYE.js} +1 -1
- package/dist/chunks/{chunk-COHMDT7A.js → chunk-XTWEWYK7.js} +7 -7
- package/dist/chunks/{chunk-AQD7K4Z5.js → chunk-Y3GIM6WK.js} +1 -1
- package/dist/chunks/{chunk-74ZXXBGN.js → chunk-Y54RKLOI.js} +1 -1
- package/dist/chunks/{chunk-C37PUHA6.js → chunk-Y777GISF.js} +1 -1
- package/dist/chunks/{chunk-PFSMXKTI.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-U5FKRYJO.js → chunk-ZAZKJJOT.js} +1 -1
- package/dist/chunks/{chunk-2RNQQNB7.js → chunk-ZR7LIMJS.js} +1 -1
- package/dist/chunks/{chunk-PQJTYOR2.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-WFPIDWPH.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-OGLX76LL.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-JCUA3RWV.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-42YWXB3P.js → hosted-experiment-improvement-P433KDX2.js} +1 -1
- package/dist/chunks/hosted-harness-runtime-Y4DONWPC.js +2 -0
- package/dist/chunks/{hosted-profile-candidate-HVVC43XQ.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-BUWLCKCD.js → hosted-profile-evaluation-inspection-3Q6EHO66.js} +1 -1
- package/dist/chunks/{hosted-profile-evaluation-preparation-3XLRR6UH.js → hosted-profile-evaluation-preparation-ZD27HNLF.js} +1 -1
- package/dist/chunks/{hosted-tasksets-THKM5QY5.js → hosted-tasksets-V2PQZJN4.js} +1 -1
- package/dist/chunks/human-review-4FJFINQX.js +2 -0
- package/dist/chunks/{import-CBDJ4DME.js → import-GBHSLA3G.js} +1 -1
- 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-Y2MCSOUK.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-5TMGLKDM.js → published-experiment-source-HVHKSYDL.js} +1 -1
- package/dist/chunks/refiner-profile-service-E7YU4E3N.js +2 -0
- package/dist/chunks/{runtime-QFXCXSVB.js → runtime-LIPHPKKJ.js} +2 -2
- package/dist/chunks/sandbox-command-G6KID3OP.js +2 -0
- package/dist/chunks/{sandbox-template-XWWPWWNR.js → sandbox-template-MZTMAUFS.js} +1 -1
- package/dist/chunks/saved-work-LOUWLF37.js +2 -0
- package/dist/chunks/{send-turn-SIXOZUVJ.js → send-turn-UEUEGY5W.js} +1 -1
- package/dist/chunks/{src-EZAKCCUV.js → src-7WMZOWZZ.js} +102 -95
- package/dist/chunks/{src-6SHCCYEN.js → src-MVAK6D6Y.js} +1 -1
- package/dist/chunks/standalone-experiment-turn-owner-YRKEOEJ2.js +2 -0
- package/dist/chunks/{store-continual-support-reviews-GDX6CSUU.js → store-continual-support-reviews-FJLLNKCY.js} +1 -1
- package/dist/chunks/{store-conversation-serving-W55XMDH4.js → store-conversation-serving-4KWR4IZY.js} +1 -1
- package/dist/chunks/{store-create-improve-A7E7CUPZ.js → store-create-improve-JWBJZRAU.js} +1 -1
- package/dist/chunks/{store-datasets-HKF3EO7B.js → store-datasets-4N2M6Y3K.js} +2 -2
- package/dist/chunks/{store-evaluation-results-645RFBGR.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-F5KESW52.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-HWQWNTIU.js → store-local-experiments-LULRLTII.js} +5 -5
- package/dist/chunks/{store-model-batch-review-TOCSDVAP.js → store-model-batch-review-SVL4MT6D.js} +1 -1
- package/dist/chunks/{store-model-configuration-6543ASY2.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-53B7QIGS.js → store-sidebar-file-bookmarks-MX6EP6OB.js} +2 -2
- package/dist/chunks/{store-sidebar-preferences-YXGEJVUO.js → store-sidebar-preferences-VYREPW26.js} +1 -1
- package/dist/chunks/{store-subagents-HRCAK7VZ.js → store-subagents-WGBCRALX.js} +1 -1
- package/dist/chunks/{store-task-inbox-WF74W4U2.js → store-task-inbox-43BNZSB7.js} +6 -6
- package/dist/chunks/{store-task-inventory-KHCTEZVK.js → store-task-inventory-AEW4POAJ.js} +2 -2
- package/dist/chunks/{store-taskset-drafts-3ACG5AVX.js → store-taskset-drafts-DKFO2CYB.js} +1 -1
- package/dist/chunks/{store-training-R46WOGXB.js → store-training-6PFFR6ST.js} +1 -1
- package/dist/chunks/{store-training-jobs-D4LECE7O.js → store-training-jobs-ANDEBQ67.js} +2 -2
- package/dist/chunks/{store-training-models-EQVNXOVB.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-NR2X2UOK.js → taskset-SL3YOXW7.js} +1 -1
- package/dist/chunks/{taskset-packages-ONULEIVI.js → taskset-packages-3PCEYYDA.js} +1 -1
- package/dist/chunks/{teams-bot-CHUYMD6K.js → teams-bot-IDEF3BMI.js} +1 -1
- package/dist/chunks/{training-IDSGYGU2.js → training-57ISIC7U.js} +1 -1
- package/dist/chunks/web-search-222Y63QW.js +2 -0
- package/dist/chunks/{workspaces-2TJRDM5K.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-pcwmC4IR.js → App-nzE7JU_O.js} +4 -4
- package/dist/web/assets/{AppDialog-CdHad7GT.js → AppDialog-VtNvqbDm.js} +1 -1
- package/dist/web/assets/{AppTerminalPanel-CrmoOgd4.js → AppTerminalPanel-BMfKdrrN.js} +2 -2
- package/dist/web/assets/{AppsView-0P6cBsD4.js → AppsView-CdWyrDEb.js} +1 -1
- package/dist/web/assets/{BrowserSidebar-Cb6edJw6.js → BrowserSidebar-CtOIciOa.js} +1 -1
- package/dist/web/assets/{CartesianChart-B2Sxi0lv.js → CartesianChart-u1lvLM30.js} +1 -1
- package/dist/web/assets/{CollaborationTabs-PP0AIXhb.js → CollaborationTabs-CaBfDYRW.js} +1 -1
- package/dist/web/assets/{CommandMenu-GfQIMe6W.js → CommandMenu-CFW3WJ11.js} +1 -1
- package/dist/web/assets/{CommunityView-V6KmMl5n.js → CommunityView-D2EjaeuH.js} +1 -1
- package/dist/web/assets/{ComposerCreateImproveStrip-oeVeyhPX.js → ComposerCreateImproveStrip-6wYSJdzv.js} +1 -1
- package/dist/web/assets/{ConversationImportsSettings-CuQcvVgE.js → ConversationImportsSettings-BJ4QhF7p.js} +1 -1
- package/dist/web/assets/{GetStartedView-2oZ068h_.js → GetStartedView-DBcOwIJn.js} +1 -1
- package/dist/web/assets/{HostedModelLearningReview-DLzak_Vf.js → HostedModelLearningReview-BNpK6_W9.js} +1 -1
- package/dist/web/assets/{HostedModelLearningSettings-Eca6Pd9R.js → HostedModelLearningSettings-SrsdeeoA.js} +1 -1
- package/dist/web/assets/{LabModelVersionDetailPage-DsBblnMp.js → LabModelVersionDetailPage-Cd6bRHt9.js} +1 -1
- package/dist/web/assets/{LabSkillSidebar-DDknttrB.js → LabSkillSidebar-CQfvel4w.js} +1 -1
- package/dist/web/assets/{LabsRoute-CgNiUHsy.js → LabsRoute-sXLJt1KR.js} +4 -4
- package/dist/web/assets/{MainChatThread-yCVg99LU.js → MainChatThread-dlDDK2JM.js} +2 -2
- package/dist/web/assets/{MainPane-C86le7UF.js → MainPane-DCz38-qy.js} +4 -4
- package/dist/web/assets/{MarkdownText-BBVriBCj.js → MarkdownText-Drjq6-JM.js} +1 -1
- package/dist/web/assets/{NativeSkillSidebar-D2uVZkqh.js → NativeSkillSidebar-jncZijt-.js} +1 -1
- package/dist/web/assets/{NewExperienceSwitcher-DuD6GScJ.js → NewExperienceSwitcher-DXKzoMaM.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-B6XZkJrU.js → NewProjectDialog-DIyjAxJG.js} +1 -1
- package/dist/web/assets/{OutputsPage-PUlmcWjv.js → OutputsPage-Dy1cNr3n.js} +1 -1
- package/dist/web/assets/{ProjectsPage-DWBRmej6.js → ProjectsPage-D2EeybIv.js} +1 -1
- package/dist/web/assets/{RightChatPanelStack-HaCVep4t.js → RightChatPanelStack-4wUL-W9_.js} +1 -1
- package/dist/web/assets/{RightSidebarHomePanel-BUtdPb2L.js → RightSidebarHomePanel-Bd_AHUp8.js} +1 -1
- package/dist/web/assets/{ScheduledWorkPage-Dg9GkGrT.js → ScheduledWorkPage-BJkSzwz2.js} +1 -1
- package/dist/web/assets/{SettingsView-DtldfnV-.js → SettingsView-BhcP72KH.js} +3 -3
- package/dist/web/assets/{TeamChatView-C71JX4je.js → TeamChatView-CR0fdicZ.js} +1 -1
- package/dist/web/assets/{TerminalOverlay-B4F6Q36s.js → TerminalOverlay-DGrZRZ_3.js} +10 -10
- package/dist/web/assets/{TrainingCreationPanel-B9MxFzQx.js → TrainingCreationPanel-BsTG7aFS.js} +1 -1
- package/dist/web/assets/{TrainingDraftPanel-7C48sHfC.js → TrainingDraftPanel-ByErrht7.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-CC57FcUB.js → UsageSettingsSection-DeYTJbcM.js} +1 -1
- package/dist/web/assets/{WorkSidebarPanel-Cto1usLM.js → WorkSidebarPanel-DcNvEEoy.js} +1 -1
- package/dist/web/assets/{WorkspaceDiffPanel-CL7wi3kp.js → WorkspaceDiffPanel-CdPRcYWN.js} +3 -3
- package/dist/web/assets/{WorkspaceEnvironmentMenu-zdzSDofs.js → WorkspaceEnvironmentMenu-xUYg-iGn.js} +1 -1
- package/dist/web/assets/{WorkspaceGitDialogs-CZSmjnrc.js → WorkspaceGitDialogs-CBViLL3S.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-TrUDJMKb.js → WorkspaceMonacoEditor-frxie2_S.js} +3 -3
- package/dist/web/assets/{agent-connections-4Dza2mDg.js → agent-connections-D7ao-vbU.js} +1 -1
- package/dist/web/assets/{arrow-up-right-xKb5kWQJ.js → arrow-up-right-DCWPxdbD.js} +1 -1
- package/dist/web/assets/{chunk-P3BRSSRD-BsGTkgyC.js → chunk-P3BRSSRD-B5JXa0Nh.js} +1 -1
- package/dist/web/assets/{clipboard-BgjV3aCx.js → clipboard-B-GnMVLp.js} +1 -1
- package/dist/web/assets/{cloud-upload-Bw9XUsKQ.js → cloud-upload-DpaGFZ9J.js} +1 -1
- package/dist/web/assets/{cssMode-DxsFJGb-.js → cssMode-DJHE7R3W.js} +1 -1
- package/dist/web/assets/{folder-open-CbmUjIYS.js → folder-open-B-DFLDFH.js} +1 -1
- package/dist/web/assets/{folder-plus-slsst7Ct.js → folder-plus-CPXxPvSH.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-BIS-8MuS.js → git-commit-horizontal-DCTzcivA.js} +1 -1
- package/dist/web/assets/{htmlMode-BE4VOrZo.js → htmlMode-DxZVBAYd.js} +1 -1
- package/dist/web/assets/index-BojtIRzO.css +1 -0
- package/dist/web/assets/{index-DEg0S7Qk.js → index-Di1MU6Xr.js} +2 -2
- package/dist/web/assets/{info-5bL9xSSf.js → info-BMxsR_bn.js} +1 -1
- package/dist/web/assets/{jsonMode-CYimnBhD.js → jsonMode-CzWoMkpp.js} +1 -1
- package/dist/web/assets/{lspLanguageFeatures-CiFuk-P7.js → lspLanguageFeatures-15K7ND6Q.js} +1 -1
- package/dist/web/assets/{minimize-2-BGVWKvTg.js → minimize-2-DwUgqXoR.js} +1 -1
- package/dist/web/assets/{monaco.contribution-DkLVGT8N.js → monaco.contribution-BBLKjER5.js} +2 -2
- package/dist/web/assets/{monaco.contribution-BTY4dJ0f.js → monaco.contribution-DBjvSu8p.js} +2 -2
- package/dist/web/assets/{monaco.contribution-DUE3CQph.js → monaco.contribution-DUWvjhIG.js} +2 -2
- package/dist/web/assets/{monaco.contribution-C7sMrcos.js → monaco.contribution-w0zfkYLX.js} +2 -2
- package/dist/web/assets/{monitor-B5hx_tzp.js → monitor-Ihu5LVYx.js} +1 -1
- package/dist/web/assets/{play-pmSO95Qg.js → play-D_YGCdxU.js} +1 -1
- package/dist/web/assets/{python-CiZvL3LX.js → python-Q4OuoXYc.js} +1 -1
- package/dist/web/assets/{save-CvYL4DUg.js → save-DJYUOhtD.js} +1 -1
- package/dist/web/assets/{square-DT_uFOml.js → square-DXtoCBNw.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-CrE1_HY0.js → toggleHighContrast-CaNeuWVE.js} +1 -1
- package/dist/web/assets/{tsMode-CI_PdZmj.js → tsMode-CJnQ2wmM.js} +1 -1
- package/dist/web/assets/{upload-PVi8vC3T.js → upload-fCP3_OEO.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules-BHJNVf42.js → useLocalAgentSchedules-BFoH_gwZ.js} +1 -1
- package/dist/web/assets/{useProviderSettings-CU3zXyie.js → useProviderSettings-2eysgqiA.js} +1 -1
- package/dist/web/assets/{useSessionTurnCache-BE7cipLX.js → useSessionTurnCache-DLF5SPD-.js} +1 -1
- package/dist/web/assets/{wifi-off-7WiFuOhD.js → wifi-off-DZoiFrRz.js} +1 -1
- package/dist/web/assets/{workers-Cv8r4CvM.js → workers-D5nr74M-.js} +1 -1
- package/dist/web/assets/{yaml-Bj7mdkV2.js → yaml-CwsoTJmk.js} +1 -1
- package/dist/web/index.html +2 -2
- package/docs/command-reference.md +12 -0
- package/package.json +1 -1
- package/dist/chunks/app-server-harness-services-DDFUMNYC.js +0 -2
- package/dist/chunks/app-server-runtime-SVB6L26M.js +0 -2
- package/dist/chunks/apps-EZB56RHV.js +0 -2
- package/dist/chunks/chunk-7UH4YDA7.js +0 -3
- package/dist/chunks/chunk-CGWA54LE.js +0 -2
- package/dist/chunks/chunk-K44RHALX.js +0 -2
- package/dist/chunks/chunk-MFMYWZK2.js +0 -2
- package/dist/chunks/chunk-P2RSBSCT.js +0 -2
- package/dist/chunks/chunk-QDC4OW3S.js +0 -2
- package/dist/chunks/chunk-SF5HJ7PL.js +0 -16
- package/dist/chunks/chunk-YBT2NB32.js +0 -2
- package/dist/chunks/chunk-YCQSVHCD.js +0 -9
- package/dist/chunks/cli-5DFVQL5Y.js +0 -2
- package/dist/chunks/configuration-command-JS6U3RMC.js +0 -2
- package/dist/chunks/connected-app-executor-UBMGMV76.js +0 -2
- package/dist/chunks/connected-evidence-NLAIEVQ3.js +0 -2
- package/dist/chunks/connection-NZSD3U5O.js +0 -2
- package/dist/chunks/core-commands-U4IBRRY5.js +0 -2
- package/dist/chunks/datasets-UX47DTTB.js +0 -2
- package/dist/chunks/desktop-test-UUU7PD4P.js +0 -3
- package/dist/chunks/dist-W5MJYSPF.js +0 -2
- package/dist/chunks/evaluation-coordination-3YQN5JQW.js +0 -2
- package/dist/chunks/experiment-improvements-ZRVD2AGY.js +0 -2
- package/dist/chunks/experiments-JEB5A2N5.js +0 -2
- package/dist/chunks/help-KA4OINP5.js +0 -8
- package/dist/chunks/host-profile-evaluation-tools-2URLU5SG.js +0 -2
- package/dist/chunks/host-profile-external-dataset-B2AQNSDR.js +0 -2
- package/dist/chunks/hosted-app-server-composition-VJQ3FM4I.js +0 -2
- package/dist/chunks/hosted-harness-runtime-BM4WONJN.js +0 -2
- package/dist/chunks/hosted-profile-compiler-RKDWHYK3.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-control-57V24UGU.js +0 -2
- package/dist/chunks/human-review-CSYAW4PC.js +0 -2
- package/dist/chunks/local-harness-improvement-runtime-3T6E7I5Q.js +0 -2
- package/dist/chunks/local-harness-taskset-review-LQPQBALH.js +0 -2
- package/dist/chunks/opchat-6ADSONAD.js +0 -3
- package/dist/chunks/organizations-GT24ZTCN.js +0 -2
- package/dist/chunks/project-action-payload-GHSLE7K3.js +0 -2
- package/dist/chunks/project-agent-YYSQIHVE.js +0 -2
- package/dist/chunks/refiner-profile-service-ZK7KAFP5.js +0 -2
- package/dist/chunks/sandbox-command-U6346TVJ.js +0 -2
- package/dist/chunks/saved-work-SWHZ4OLO.js +0 -2
- package/dist/chunks/standalone-experiment-turn-owner-LIAQWTGI.js +0 -2
- package/dist/chunks/store-harness-workspaces-XUM4Z66X.js +0 -2
- package/dist/chunks/store-learned-preference-migration-validation-V27XD4I7.js +0 -2
- package/dist/chunks/store-learning-WLG6KFIO.js +0 -2
- package/dist/chunks/web-search-BPON7H5N.js +0 -2
- package/dist/web/assets/index-erq7hUne.css +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{P as k,Q as E,_ as S}from"./chunk-MNC4YUDI.js";import{f as B}from"./chunk-H7IWJN7L.js";import{a as l}from"./chunk-FTQLQJQV.js";import T from"node:path";var P="default",H=["apiKey","baseUrl","apiBaseUrl","chatApiBaseUrl","token","appId","conversationId"];function y(t,e){return Object.prototype.hasOwnProperty.call(t,e)}l(y,"hasOwn");function m(t){if(typeof t!="string")return null;let e=t.trim();return e.length>0?e:null}l(m,"normalizeHandle");function d(t){if(typeof t!="string")return null;let e=t.trim();return e?e.replace(/\/$/,""):null}l(d,"normalizeBaseUrl");function N(t){let e=m(t);if(!e)throw new Error("profile handle must be non-empty");return e}l(N,"requireHandle");function $(t){if(typeof t!="string")throw new Error("apiKey must be a non-empty string");let e=t.trim();if(!e)throw new Error("apiKey must be a non-empty string");return e}l($,"requireApiKey");function b(t,e){let n=m(t),s=m(e);return!!(n&&s&&n.toLowerCase()===s.toLowerCase())}l(b,"handleEquals");function R(t,e,n){let s=d(n);return t.findIndex(r=>b(r.handle,e)?s?d(r.baseUrl)===s:!0:!1)}l(R,"findAccountIndex");function U(t){let e=m(t.handle)??P,n=d(t.baseUrl);return n?{handle:e,baseUrl:n}:{handle:e}}l(U,"selectorFromAccount");function A(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=m(typeof e.handle=="string"?e.handle:void 0);if(!n)return null;let s=d(typeof e.baseUrl=="string"?e.baseUrl:void 0);return s?{handle:n,baseUrl:s}:{handle:n}}l(A,"sanitizeActiveProfile");function x(t){if(!t||typeof t!="object"||Array.isArray(t))return;let e=t,n=typeof e.repoPath=="string"?e.repoPath.trim():"",s=typeof e.profile=="string"&&e.profile.trim()?e.profile.trim():"default";if(!n)return;let r={repoPath:n,profile:s,mode:"local"};if(e.lastCheck&&typeof e.lastCheck=="object"&&!Array.isArray(e.lastCheck)){let o=e.lastCheck,a=o.command,c=o.status,f=o.checkedAt;(a==="inspect"||a==="build"||a==="validate"||a==="eval"||a==="run")&&(c==="passed"||c==="failed")&&typeof f=="string"&&(r.lastCheck={command:a,status:c,checkedAt:f,...typeof o.exitCode=="number"||o.exitCode===null?{exitCode:o.exitCode}:{},...typeof o.sourceHead=="string"||o.sourceHead===null?{sourceHead:o.sourceHead}:{}})}if(e.lastPush&&typeof e.lastPush=="object"&&!Array.isArray(e.lastPush)){let o=e.lastPush,a=o.status,c=o.pushedAt;(a==="pushed"||a==="failed")&&typeof c=="string"&&(r.lastPush={status:a,pushedAt:c,...typeof o.teamId=="string"||o.teamId===null?{teamId:o.teamId}:{},...typeof o.projectId=="string"||o.projectId===null?{projectId:o.projectId}:{},...typeof o.localHead=="string"||o.localHead===null?{localHead:o.localHead}:{},...typeof o.hostedHead=="string"||o.hostedHead===null?{hostedHead:o.hostedHead}:{},...typeof o.sourceRef=="string"||o.sourceRef===null?{sourceRef:o.sourceRef}:{},...o.promotionStatus==="uploaded"||o.promotionStatus==="hosted_source_materialized"||o.promotionStatus==="hosted_source_materialize_failed"||o.promotionStatus==="hosted_source_check_pending"||o.promotionStatus==="hosted_source_check_failed"||o.promotionStatus==="hosted_source_published"||o.promotionStatus==="hosted_source_publish_failed"||o.promotionStatus==="hosted_run_pending"||o.promotionStatus==="hosted_run_passed"||o.promotionStatus==="hosted_run_failed"||o.promotionStatus===null?{promotionStatus:o.promotionStatus}:{},...o.hostedRunStatus==="not_started"||o.hostedRunStatus==="running"||o.hostedRunStatus==="passed"||o.hostedRunStatus==="failed"||o.hostedRunStatus===null?{hostedRunStatus:o.hostedRunStatus}:{},...typeof o.hostedRunAgentId=="string"||o.hostedRunAgentId===null?{hostedRunAgentId:o.hostedRunAgentId}:{},...typeof o.hostedRunId=="string"||o.hostedRunId===null?{hostedRunId:o.hostedRunId}:{},...typeof o.hostedRunAt=="string"||o.hostedRunAt===null?{hostedRunAt:o.hostedRunAt}:{},...z(o.hostedSourceMaterialization)?{hostedSourceMaterialization:z(o.hostedSourceMaterialization)}:{},...K(o.hostedSourceCheck)?{hostedSourceCheck:K(o.hostedSourceCheck)}:{},...j(o.hostedPublish)?{hostedPublish:j(o.hostedPublish)}:{},...M(o.hostedRun)?{hostedRun:M(o.hostedRun)}:{},...typeof o.error=="string"||o.error===null?{error:o.error}:{}})}if(Array.isArray(e.profiles)){let o=e.profiles.flatMap(a=>{let c=x(a);if(!c)return[];let f=a,p=f.source==="github"||f.source==="openpond_git"?f.source:"local",g=typeof f.repositoryId=="string"&&f.repositoryId.trim()?f.repositoryId.trim():T.resolve(c.repoPath);return[{source:p,repositoryId:g,repoPath:c.repoPath,profile:c.profile,...c.lastCheck?{lastCheck:c.lastCheck}:{},...c.lastPush?{lastPush:c.lastPush}:{}}]});o.length>0&&(r.profiles=o)}return r}l(x,"sanitizeLocalOpenPondProfile");function z(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=I(e.status);return n?{status:n,...i(e,"agentId"),...i(e,"runtimeAgentId"),...i(e,"projectId"),...i(e,"sourceRoot"),...i(e,"sourceRef"),...i(e,"sourceCommitSha"),...i(e,"manifestHash"),...i(e,"manifestPath"),...i(e,"manifestSyncedAt"),...O(e,"fileCount"),...O(e,"totalBytes"),...i(e,"generatedManifestPath"),...C(e,"synthesizedOpenPondYaml"),...i(e,"uploadMetadataPath"),...u(e,"setupCommands"),...u(e,"validationCommands"),...i(e,"materializedAt"),...i(e,"error")}:null}l(z,"sanitizeHostedMaterializationStatus");function K(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=I(e.status);return n?{status:n,...i(e,"agentId"),...i(e,"deployPlanStatus"),...C(e,"canRun"),...C(e,"canDeploy"),...i(e,"sourceRef"),...i(e,"sourceCommitSha"),...i(e,"manifestHash"),...i(e,"manifestPath"),...u(e,"setupCommands"),...u(e,"validationCommands"),...u(e,"requiredChecks"),...u(e,"evalNames"),...u(e,"blockedReasons"),...u(e,"staleReasons"),...i(e,"runtimeId"),...i(e,"sandboxId"),...u(e,"traceArtifactRefs"),...u(e,"evalResultArtifactRefs"),...u(e,"validatorArtifactRefs"),...i(e,"checkedAt"),...i(e,"error")}:null}l(K,"sanitizeHostedSourceCheckStatus");function j(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=I(e.status);return n?{status:n,...i(e,"agentId"),...i(e,"snapshotId"),...i(e,"sourceRef"),...i(e,"sourceCommitSha"),...i(e,"manifestHash"),...i(e,"manifestPath"),...i(e,"buildStatus"),...i(e,"validationStatus"),...i(e,"evalStatus"),...i(e,"publishedAt"),...i(e,"error")}:null}l(j,"sanitizeHostedPublishStatus");function M(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=I(e.status);return n?{status:n,...i(e,"agentId"),...i(e,"runId"),...i(e,"runtimeId"),...i(e,"sandboxId"),...i(e,"sourceRef"),...i(e,"sourceCommitSha"),...i(e,"manifestHash"),...i(e,"setupGateStatus"),...u(e,"setupRequirementRefs"),...u(e,"artifactRefs"),...u(e,"traceArtifactRefs"),...u(e,"evalArtifactRefs"),...i(e,"startedAt"),...i(e,"completedAt"),...i(e,"error")}:null}l(M,"sanitizeHostedRunSummary");function i(t,e){let n=t[e];return typeof n=="string"||n===null?{[e]:n}:{}}l(i,"nullableStringProp");function C(t,e){let n=t[e];return typeof n=="boolean"||n===null?{[e]:n}:{}}l(C,"nullableBooleanProp");function O(t,e){let n=t[e];return typeof n=="number"||n===null?{[e]:n}:{}}l(O,"nullableNumberProp");function u(t,e){let n=t[e];if(!Array.isArray(n))return{};let s=n.filter(r=>typeof r=="string");return{[e]:s}}l(u,"stringArrayProp");function I(t){return typeof t=="string"&&t.trim()?t.trim():null}l(I,"stringField");function D(t,e){if(!b(t.handle,e.handle))return!1;let n=d(e.baseUrl);return n?d(t.baseUrl)===n:!d(t.baseUrl)}l(D,"accountMatchesSelector");function v(t,e,n={}){let s=d(e.baseUrl);if(s)return R(t,e.handle,s);let r=t.findIndex(a=>D(a,e));if(r!==-1)return r;let o=t.map((a,c)=>({account:a,index:c})).filter(({account:a})=>b(a.handle,e.handle));if(o.length>1&&n.requireUnambiguous)throw new Error(`multiple profiles found for ${e.handle}; pass --base-url to select one`);return o[0]?.index??-1}l(v,"findAccountIndexForSelector");function F(t){if(!t||typeof t!="object"||Array.isArray(t))return;let e=t,n={};return typeof e.token=="string"&&(n.token=e.token),(typeof e.appId=="string"||e.appId===null)&&(n.appId=e.appId),(typeof e.conversationId=="string"||e.conversationId===null)&&(n.conversationId=e.conversationId),Object.keys(n).length>0?n:void 0}l(F,"sanitizeSession");function Y(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=m(typeof e.handle=="string"?e.handle:void 0);if(!n)return null;let s={handle:n};typeof e.apiKey=="string"&&(s.apiKey=e.apiKey),typeof e.baseUrl=="string"&&(s.baseUrl=e.baseUrl),typeof e.apiBaseUrl=="string"&&(s.apiBaseUrl=e.apiBaseUrl),typeof e.chatApiBaseUrl=="string"&&(s.chatApiBaseUrl=e.chatApiBaseUrl),typeof e.environment=="string"&&(s.environment=e.environment);let r=F(e.session);return r&&(s.session=r),s}l(Y,"sanitizeAccount");function J(t){let e={};return typeof t.token=="string"&&(e.token=t.token),(typeof t.appId=="string"||t.appId===null)&&(e.appId=t.appId),(typeof t.conversationId=="string"||t.conversationId===null)&&(e.conversationId=t.conversationId),Object.keys(e).length>0?e:void 0}l(J,"extractLegacySession");function Q(t,e){let n={handle:e};typeof t.apiKey=="string"&&(n.apiKey=t.apiKey),typeof t.baseUrl=="string"&&(n.baseUrl=t.baseUrl),typeof t.apiBaseUrl=="string"&&(n.apiBaseUrl=t.apiBaseUrl),typeof t.chatApiBaseUrl=="string"&&(n.chatApiBaseUrl=t.chatApiBaseUrl);let s=J(t);return s&&(n.session=s),n}l(Q,"extractLegacyAccount");function L(t){let e={};typeof t.lspEnabled=="boolean"&&(e.lspEnabled=t.lspEnabled),(t.executionMode==="local"||t.executionMode==="hosted")&&(e.executionMode=t.executionMode),(t.mode==="general"||t.mode==="builder")&&(e.mode=t.mode);let n=x(t.openpondProfile);n&&(e.openpondProfile=n);let s=[],r=Array.isArray(t.accounts)?t.accounts:[];for(let f of r){let p=Y(f);p&&R(s,p.handle,p.baseUrl)===-1&&s.push(p)}if(s.length===0){let f=A(t.activeProfile)?.handle||P;s.push(Q(t,f))}let o=A(t.activeProfile),a=o?v(s,o):-1,c=s[a===-1?0:a];return e.accounts=s,e.activeProfile=U(c),e}l(L,"normalizeGlobalConfig");function V(t,e,n){let s=t.accounts??[],r=d(n??process.env.OPENPOND_BASE_URL),o=m(e);if(o)return r?{handle:o,baseUrl:r}:{handle:o};let a=m(process.env.OPENPOND_ACCOUNT);if(a)return r?{handle:a,baseUrl:r}:{handle:a};let c=A(t.activeProfile);return c?r?{handle:c.handle,baseUrl:r}:c:s[0]?U(s[0]):{handle:P}}l(V,"resolveRequestedProfile");function w(t,e,n){let s=d(n);if(s){let o=R(t,e,s);if(o!==-1)return t[o]}else{let o=t.filter(a=>b(a.handle,e));if(o.length>1)throw new Error(`multiple profiles found for ${e}; pass --base-url to select one`);if(o.length===1)return o[0]}let r={handle:e};return s&&(r.baseUrl=s),t.push(r),r}l(w,"ensureAccount");function q(t){t.session&&Object.keys(t.session).length===0&&delete t.session}l(q,"cleanupAccount");function W(t,e,n,s){let r=n===null||n===void 0&&s.undefinedDeletes;switch(e){case"apiKey":{if(r){delete t.apiKey;return}typeof n=="string"&&(t.apiKey=n);return}case"baseUrl":{if(r){delete t.baseUrl;return}typeof n=="string"&&(t.baseUrl=n);return}case"apiBaseUrl":{if(r){delete t.apiBaseUrl;return}typeof n=="string"&&(t.apiBaseUrl=n);return}case"chatApiBaseUrl":{if(r){delete t.chatApiBaseUrl;return}typeof n=="string"&&(t.chatApiBaseUrl=n);return}case"token":case"appId":case"conversationId":{if(t.session||(t.session={}),r){delete t.session[e],q(t);return}(typeof n=="string"||n===null)&&(t.session[e]=n),q(t);return}}}l(W,"applyScopedKey");function X(t,e,n){if(!H.some(f=>y(e,f)))return!1;let r=t.accounts??[],o=A(e.activeProfile)??V(t),a=d(y(e,"baseUrl")?e.baseUrl??null:o.baseUrl??process.env.OPENPOND_BASE_URL),c=w(r,o.handle,a);for(let f of H)y(e,f)&&W(c,f,e[f],n);return t.accounts=r,t.activeProfile=U(c),!0}l(X,"applyAccountPatch");function Z(t,e){if(y(e,"lspEnabled")&&(typeof e.lspEnabled=="boolean"?t.lspEnabled=e.lspEnabled:e.lspEnabled===null&&delete t.lspEnabled),y(e,"executionMode")&&(e.executionMode==="local"||e.executionMode==="hosted"?t.executionMode=e.executionMode:e.executionMode===null&&delete t.executionMode),y(e,"mode")&&(e.mode==="general"||e.mode==="builder"?t.mode=e.mode:e.mode===null&&delete t.mode),y(e,"activeProfile")){let n=A(e.activeProfile);if(n){let s=v(t.accounts??[],n);t.activeProfile=s===-1?n:U((t.accounts??[])[s])}else e.activeProfile===null&&delete t.activeProfile}if(y(e,"openpondProfile")){let n=x(e.openpondProfile);n?t.openpondProfile=n:e.openpondProfile===null&&delete t.openpondProfile}}l(Z,"applyTopLevelPatch");async function _(t){let e=B();return await S(e),await E(e,n=>{let s=L(n);return t(s),s})}l(_,"updateGlobalConfig");async function ee(){let t=B();return await S(t),L(await k(t))}l(ee,"loadGlobalConfig");async function G(){let t=await ee(),e=A(t.activeProfile);return(t.accounts??[]).map(n=>{let s=m(n.handle)??P;return{handle:s,baseUrl:d(n.baseUrl),apiBaseUrl:d(n.apiBaseUrl),chatApiBaseUrl:d(n.chatApiBaseUrl),environment:n.environment?.trim()||null,isActive:!!(e&&D({...n,handle:s},e)),hasApiKey:!!n.apiKey?.trim(),hasSessionToken:!!n.session?.token?.trim(),sessionAppId:n.session?.appId??null,sessionConversationId:n.session?.conversationId??null}})}l(G,"listConfiguredProfiles");async function se(t,e={}){let n=N(t),s=d(e.baseUrl),r=-1;await _(a=>{let c=a.accounts??[];if(r=v(c,s?{handle:n,baseUrl:s}:{handle:n},{requireUnambiguous:!0}),r===-1)throw new Error(`profile not found: ${n}`);a.activeProfile=U(c[r])});let o=await G();return o.find(a=>a.isActive)??o[r]}l(se,"setActiveProfile");async function re(t){let e=N(t.handle),n=$(t.apiKey),s=d(t.baseUrl),r=d(t.apiBaseUrl),o=d(t.chatApiBaseUrl),a={handle:e};await _(p=>{let g=p.accounts??[],h=w(g,e,s);h.apiKey=n,s&&(h.baseUrl=s),r?h.apiBaseUrl=r:t.apiBaseUrl===null&&delete h.apiBaseUrl,o?h.chatApiBaseUrl=o:t.chatApiBaseUrl===null&&delete h.chatApiBaseUrl,t.environment===null?delete h.environment:typeof t.environment=="string"&&t.environment.trim()&&(h.environment=t.environment.trim()),p.accounts=g,a=U(h),t.setActive!==!1&&(p.activeProfile=a)});let f=(await G()).find(p=>b(p.handle,a.handle)?s?d(p.baseUrl)===s:!0:!1);if(!f)throw new Error(`failed to save profile: ${e}`);return f}l(re,"saveProfileApiKey");async function ie(t){await _(e=>{Z(e,t),X(e,t,{undefinedDeletes:!1})})}l(ie,"saveGlobalConfig");export{_ as a,ee as b,G as c,se as d,re as e,ie as f};
|
|
2
|
+
import{P as k,Q as E,_ as S}from"./chunk-LHA7RQBA.js";import{f as B}from"./chunk-H7IWJN7L.js";import{a as l}from"./chunk-FTQLQJQV.js";import T from"node:path";var P="default",H=["apiKey","baseUrl","apiBaseUrl","chatApiBaseUrl","token","appId","conversationId"];function y(t,e){return Object.prototype.hasOwnProperty.call(t,e)}l(y,"hasOwn");function m(t){if(typeof t!="string")return null;let e=t.trim();return e.length>0?e:null}l(m,"normalizeHandle");function d(t){if(typeof t!="string")return null;let e=t.trim();return e?e.replace(/\/$/,""):null}l(d,"normalizeBaseUrl");function N(t){let e=m(t);if(!e)throw new Error("profile handle must be non-empty");return e}l(N,"requireHandle");function $(t){if(typeof t!="string")throw new Error("apiKey must be a non-empty string");let e=t.trim();if(!e)throw new Error("apiKey must be a non-empty string");return e}l($,"requireApiKey");function b(t,e){let n=m(t),s=m(e);return!!(n&&s&&n.toLowerCase()===s.toLowerCase())}l(b,"handleEquals");function R(t,e,n){let s=d(n);return t.findIndex(r=>b(r.handle,e)?s?d(r.baseUrl)===s:!0:!1)}l(R,"findAccountIndex");function U(t){let e=m(t.handle)??P,n=d(t.baseUrl);return n?{handle:e,baseUrl:n}:{handle:e}}l(U,"selectorFromAccount");function A(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=m(typeof e.handle=="string"?e.handle:void 0);if(!n)return null;let s=d(typeof e.baseUrl=="string"?e.baseUrl:void 0);return s?{handle:n,baseUrl:s}:{handle:n}}l(A,"sanitizeActiveProfile");function x(t){if(!t||typeof t!="object"||Array.isArray(t))return;let e=t,n=typeof e.repoPath=="string"?e.repoPath.trim():"",s=typeof e.profile=="string"&&e.profile.trim()?e.profile.trim():"default";if(!n)return;let r={repoPath:n,profile:s,mode:"local"};if(e.lastCheck&&typeof e.lastCheck=="object"&&!Array.isArray(e.lastCheck)){let o=e.lastCheck,a=o.command,c=o.status,f=o.checkedAt;(a==="inspect"||a==="build"||a==="validate"||a==="eval"||a==="run")&&(c==="passed"||c==="failed")&&typeof f=="string"&&(r.lastCheck={command:a,status:c,checkedAt:f,...typeof o.exitCode=="number"||o.exitCode===null?{exitCode:o.exitCode}:{},...typeof o.sourceHead=="string"||o.sourceHead===null?{sourceHead:o.sourceHead}:{}})}if(e.lastPush&&typeof e.lastPush=="object"&&!Array.isArray(e.lastPush)){let o=e.lastPush,a=o.status,c=o.pushedAt;(a==="pushed"||a==="failed")&&typeof c=="string"&&(r.lastPush={status:a,pushedAt:c,...typeof o.teamId=="string"||o.teamId===null?{teamId:o.teamId}:{},...typeof o.projectId=="string"||o.projectId===null?{projectId:o.projectId}:{},...typeof o.localHead=="string"||o.localHead===null?{localHead:o.localHead}:{},...typeof o.hostedHead=="string"||o.hostedHead===null?{hostedHead:o.hostedHead}:{},...typeof o.sourceRef=="string"||o.sourceRef===null?{sourceRef:o.sourceRef}:{},...o.promotionStatus==="uploaded"||o.promotionStatus==="hosted_source_materialized"||o.promotionStatus==="hosted_source_materialize_failed"||o.promotionStatus==="hosted_source_check_pending"||o.promotionStatus==="hosted_source_check_failed"||o.promotionStatus==="hosted_source_published"||o.promotionStatus==="hosted_source_publish_failed"||o.promotionStatus==="hosted_run_pending"||o.promotionStatus==="hosted_run_passed"||o.promotionStatus==="hosted_run_failed"||o.promotionStatus===null?{promotionStatus:o.promotionStatus}:{},...o.hostedRunStatus==="not_started"||o.hostedRunStatus==="running"||o.hostedRunStatus==="passed"||o.hostedRunStatus==="failed"||o.hostedRunStatus===null?{hostedRunStatus:o.hostedRunStatus}:{},...typeof o.hostedRunAgentId=="string"||o.hostedRunAgentId===null?{hostedRunAgentId:o.hostedRunAgentId}:{},...typeof o.hostedRunId=="string"||o.hostedRunId===null?{hostedRunId:o.hostedRunId}:{},...typeof o.hostedRunAt=="string"||o.hostedRunAt===null?{hostedRunAt:o.hostedRunAt}:{},...z(o.hostedSourceMaterialization)?{hostedSourceMaterialization:z(o.hostedSourceMaterialization)}:{},...K(o.hostedSourceCheck)?{hostedSourceCheck:K(o.hostedSourceCheck)}:{},...j(o.hostedPublish)?{hostedPublish:j(o.hostedPublish)}:{},...M(o.hostedRun)?{hostedRun:M(o.hostedRun)}:{},...typeof o.error=="string"||o.error===null?{error:o.error}:{}})}if(Array.isArray(e.profiles)){let o=e.profiles.flatMap(a=>{let c=x(a);if(!c)return[];let f=a,p=f.source==="github"||f.source==="openpond_git"?f.source:"local",g=typeof f.repositoryId=="string"&&f.repositoryId.trim()?f.repositoryId.trim():T.resolve(c.repoPath);return[{source:p,repositoryId:g,repoPath:c.repoPath,profile:c.profile,...c.lastCheck?{lastCheck:c.lastCheck}:{},...c.lastPush?{lastPush:c.lastPush}:{}}]});o.length>0&&(r.profiles=o)}return r}l(x,"sanitizeLocalOpenPondProfile");function z(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=I(e.status);return n?{status:n,...i(e,"agentId"),...i(e,"runtimeAgentId"),...i(e,"projectId"),...i(e,"sourceRoot"),...i(e,"sourceRef"),...i(e,"sourceCommitSha"),...i(e,"manifestHash"),...i(e,"manifestPath"),...i(e,"manifestSyncedAt"),...O(e,"fileCount"),...O(e,"totalBytes"),...i(e,"generatedManifestPath"),...C(e,"synthesizedOpenPondYaml"),...i(e,"uploadMetadataPath"),...u(e,"setupCommands"),...u(e,"validationCommands"),...i(e,"materializedAt"),...i(e,"error")}:null}l(z,"sanitizeHostedMaterializationStatus");function K(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=I(e.status);return n?{status:n,...i(e,"agentId"),...i(e,"deployPlanStatus"),...C(e,"canRun"),...C(e,"canDeploy"),...i(e,"sourceRef"),...i(e,"sourceCommitSha"),...i(e,"manifestHash"),...i(e,"manifestPath"),...u(e,"setupCommands"),...u(e,"validationCommands"),...u(e,"requiredChecks"),...u(e,"evalNames"),...u(e,"blockedReasons"),...u(e,"staleReasons"),...i(e,"runtimeId"),...i(e,"sandboxId"),...u(e,"traceArtifactRefs"),...u(e,"evalResultArtifactRefs"),...u(e,"validatorArtifactRefs"),...i(e,"checkedAt"),...i(e,"error")}:null}l(K,"sanitizeHostedSourceCheckStatus");function j(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=I(e.status);return n?{status:n,...i(e,"agentId"),...i(e,"snapshotId"),...i(e,"sourceRef"),...i(e,"sourceCommitSha"),...i(e,"manifestHash"),...i(e,"manifestPath"),...i(e,"buildStatus"),...i(e,"validationStatus"),...i(e,"evalStatus"),...i(e,"publishedAt"),...i(e,"error")}:null}l(j,"sanitizeHostedPublishStatus");function M(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=I(e.status);return n?{status:n,...i(e,"agentId"),...i(e,"runId"),...i(e,"runtimeId"),...i(e,"sandboxId"),...i(e,"sourceRef"),...i(e,"sourceCommitSha"),...i(e,"manifestHash"),...i(e,"setupGateStatus"),...u(e,"setupRequirementRefs"),...u(e,"artifactRefs"),...u(e,"traceArtifactRefs"),...u(e,"evalArtifactRefs"),...i(e,"startedAt"),...i(e,"completedAt"),...i(e,"error")}:null}l(M,"sanitizeHostedRunSummary");function i(t,e){let n=t[e];return typeof n=="string"||n===null?{[e]:n}:{}}l(i,"nullableStringProp");function C(t,e){let n=t[e];return typeof n=="boolean"||n===null?{[e]:n}:{}}l(C,"nullableBooleanProp");function O(t,e){let n=t[e];return typeof n=="number"||n===null?{[e]:n}:{}}l(O,"nullableNumberProp");function u(t,e){let n=t[e];if(!Array.isArray(n))return{};let s=n.filter(r=>typeof r=="string");return{[e]:s}}l(u,"stringArrayProp");function I(t){return typeof t=="string"&&t.trim()?t.trim():null}l(I,"stringField");function D(t,e){if(!b(t.handle,e.handle))return!1;let n=d(e.baseUrl);return n?d(t.baseUrl)===n:!d(t.baseUrl)}l(D,"accountMatchesSelector");function v(t,e,n={}){let s=d(e.baseUrl);if(s)return R(t,e.handle,s);let r=t.findIndex(a=>D(a,e));if(r!==-1)return r;let o=t.map((a,c)=>({account:a,index:c})).filter(({account:a})=>b(a.handle,e.handle));if(o.length>1&&n.requireUnambiguous)throw new Error(`multiple profiles found for ${e.handle}; pass --base-url to select one`);return o[0]?.index??-1}l(v,"findAccountIndexForSelector");function F(t){if(!t||typeof t!="object"||Array.isArray(t))return;let e=t,n={};return typeof e.token=="string"&&(n.token=e.token),(typeof e.appId=="string"||e.appId===null)&&(n.appId=e.appId),(typeof e.conversationId=="string"||e.conversationId===null)&&(n.conversationId=e.conversationId),Object.keys(n).length>0?n:void 0}l(F,"sanitizeSession");function Y(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=m(typeof e.handle=="string"?e.handle:void 0);if(!n)return null;let s={handle:n};typeof e.apiKey=="string"&&(s.apiKey=e.apiKey),typeof e.baseUrl=="string"&&(s.baseUrl=e.baseUrl),typeof e.apiBaseUrl=="string"&&(s.apiBaseUrl=e.apiBaseUrl),typeof e.chatApiBaseUrl=="string"&&(s.chatApiBaseUrl=e.chatApiBaseUrl),typeof e.environment=="string"&&(s.environment=e.environment);let r=F(e.session);return r&&(s.session=r),s}l(Y,"sanitizeAccount");function J(t){let e={};return typeof t.token=="string"&&(e.token=t.token),(typeof t.appId=="string"||t.appId===null)&&(e.appId=t.appId),(typeof t.conversationId=="string"||t.conversationId===null)&&(e.conversationId=t.conversationId),Object.keys(e).length>0?e:void 0}l(J,"extractLegacySession");function Q(t,e){let n={handle:e};typeof t.apiKey=="string"&&(n.apiKey=t.apiKey),typeof t.baseUrl=="string"&&(n.baseUrl=t.baseUrl),typeof t.apiBaseUrl=="string"&&(n.apiBaseUrl=t.apiBaseUrl),typeof t.chatApiBaseUrl=="string"&&(n.chatApiBaseUrl=t.chatApiBaseUrl);let s=J(t);return s&&(n.session=s),n}l(Q,"extractLegacyAccount");function L(t){let e={};typeof t.lspEnabled=="boolean"&&(e.lspEnabled=t.lspEnabled),(t.executionMode==="local"||t.executionMode==="hosted")&&(e.executionMode=t.executionMode),(t.mode==="general"||t.mode==="builder")&&(e.mode=t.mode);let n=x(t.openpondProfile);n&&(e.openpondProfile=n);let s=[],r=Array.isArray(t.accounts)?t.accounts:[];for(let f of r){let p=Y(f);p&&R(s,p.handle,p.baseUrl)===-1&&s.push(p)}if(s.length===0){let f=A(t.activeProfile)?.handle||P;s.push(Q(t,f))}let o=A(t.activeProfile),a=o?v(s,o):-1,c=s[a===-1?0:a];return e.accounts=s,e.activeProfile=U(c),e}l(L,"normalizeGlobalConfig");function V(t,e,n){let s=t.accounts??[],r=d(n??process.env.OPENPOND_BASE_URL),o=m(e);if(o)return r?{handle:o,baseUrl:r}:{handle:o};let a=m(process.env.OPENPOND_ACCOUNT);if(a)return r?{handle:a,baseUrl:r}:{handle:a};let c=A(t.activeProfile);return c?r?{handle:c.handle,baseUrl:r}:c:s[0]?U(s[0]):{handle:P}}l(V,"resolveRequestedProfile");function w(t,e,n){let s=d(n);if(s){let o=R(t,e,s);if(o!==-1)return t[o]}else{let o=t.filter(a=>b(a.handle,e));if(o.length>1)throw new Error(`multiple profiles found for ${e}; pass --base-url to select one`);if(o.length===1)return o[0]}let r={handle:e};return s&&(r.baseUrl=s),t.push(r),r}l(w,"ensureAccount");function q(t){t.session&&Object.keys(t.session).length===0&&delete t.session}l(q,"cleanupAccount");function W(t,e,n,s){let r=n===null||n===void 0&&s.undefinedDeletes;switch(e){case"apiKey":{if(r){delete t.apiKey;return}typeof n=="string"&&(t.apiKey=n);return}case"baseUrl":{if(r){delete t.baseUrl;return}typeof n=="string"&&(t.baseUrl=n);return}case"apiBaseUrl":{if(r){delete t.apiBaseUrl;return}typeof n=="string"&&(t.apiBaseUrl=n);return}case"chatApiBaseUrl":{if(r){delete t.chatApiBaseUrl;return}typeof n=="string"&&(t.chatApiBaseUrl=n);return}case"token":case"appId":case"conversationId":{if(t.session||(t.session={}),r){delete t.session[e],q(t);return}(typeof n=="string"||n===null)&&(t.session[e]=n),q(t);return}}}l(W,"applyScopedKey");function X(t,e,n){if(!H.some(f=>y(e,f)))return!1;let r=t.accounts??[],o=A(e.activeProfile)??V(t),a=d(y(e,"baseUrl")?e.baseUrl??null:o.baseUrl??process.env.OPENPOND_BASE_URL),c=w(r,o.handle,a);for(let f of H)y(e,f)&&W(c,f,e[f],n);return t.accounts=r,t.activeProfile=U(c),!0}l(X,"applyAccountPatch");function Z(t,e){if(y(e,"lspEnabled")&&(typeof e.lspEnabled=="boolean"?t.lspEnabled=e.lspEnabled:e.lspEnabled===null&&delete t.lspEnabled),y(e,"executionMode")&&(e.executionMode==="local"||e.executionMode==="hosted"?t.executionMode=e.executionMode:e.executionMode===null&&delete t.executionMode),y(e,"mode")&&(e.mode==="general"||e.mode==="builder"?t.mode=e.mode:e.mode===null&&delete t.mode),y(e,"activeProfile")){let n=A(e.activeProfile);if(n){let s=v(t.accounts??[],n);t.activeProfile=s===-1?n:U((t.accounts??[])[s])}else e.activeProfile===null&&delete t.activeProfile}if(y(e,"openpondProfile")){let n=x(e.openpondProfile);n?t.openpondProfile=n:e.openpondProfile===null&&delete t.openpondProfile}}l(Z,"applyTopLevelPatch");async function _(t){let e=B();return await S(e),await E(e,n=>{let s=L(n);return t(s),s})}l(_,"updateGlobalConfig");async function ee(){let t=B();return await S(t),L(await k(t))}l(ee,"loadGlobalConfig");async function G(){let t=await ee(),e=A(t.activeProfile);return(t.accounts??[]).map(n=>{let s=m(n.handle)??P;return{handle:s,baseUrl:d(n.baseUrl),apiBaseUrl:d(n.apiBaseUrl),chatApiBaseUrl:d(n.chatApiBaseUrl),environment:n.environment?.trim()||null,isActive:!!(e&&D({...n,handle:s},e)),hasApiKey:!!n.apiKey?.trim(),hasSessionToken:!!n.session?.token?.trim(),sessionAppId:n.session?.appId??null,sessionConversationId:n.session?.conversationId??null}})}l(G,"listConfiguredProfiles");async function se(t,e={}){let n=N(t),s=d(e.baseUrl),r=-1;await _(a=>{let c=a.accounts??[];if(r=v(c,s?{handle:n,baseUrl:s}:{handle:n},{requireUnambiguous:!0}),r===-1)throw new Error(`profile not found: ${n}`);a.activeProfile=U(c[r])});let o=await G();return o.find(a=>a.isActive)??o[r]}l(se,"setActiveProfile");async function re(t){let e=N(t.handle),n=$(t.apiKey),s=d(t.baseUrl),r=d(t.apiBaseUrl),o=d(t.chatApiBaseUrl),a={handle:e};await _(p=>{let g=p.accounts??[],h=w(g,e,s);h.apiKey=n,s&&(h.baseUrl=s),r?h.apiBaseUrl=r:t.apiBaseUrl===null&&delete h.apiBaseUrl,o?h.chatApiBaseUrl=o:t.chatApiBaseUrl===null&&delete h.chatApiBaseUrl,t.environment===null?delete h.environment:typeof t.environment=="string"&&t.environment.trim()&&(h.environment=t.environment.trim()),p.accounts=g,a=U(h),t.setActive!==!1&&(p.activeProfile=a)});let f=(await G()).find(p=>b(p.handle,a.handle)?s?d(p.baseUrl)===s:!0:!1);if(!f)throw new Error(`failed to save profile: ${e}`);return f}l(re,"saveProfileApiKey");async function ie(t){await _(e=>{Z(e,t),X(e,t,{undefinedDeletes:!1})})}l(ie,"saveGlobalConfig");export{_ as a,ee as b,G as c,se as d,re as e,ie as f};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as Ae}from"./chunk-GW766ZSO.js";import{b as be}from"./chunk-XW6HGSIT.js";import{g as H}from"./chunk-57TRXBLT.js";import{B as O,a as Pe,b as Ie}from"./chunk-FKJHEZCW.js";import{a as re,b as ye,j as A}from"./chunk-Q4TBTRIG.js";import{r as Ce}from"./chunk-JMBQYBPI.js";import{D as we}from"./chunk-Z4Z5UOZM.js";import{m as $}from"./chunk-KGNCKIFP.js";import{a as o}from"./chunk-FTQLQJQV.js";import{existsSync as z}from"node:fs";import{cp as xe,mkdir as Ee,readFile as Oe}from"node:fs/promises";import k from"node:path";import{existsSync as L}from"node:fs";import{readFile as K}from"node:fs/promises";import q from"node:path";async function F(e){await V(e.target);let t={},a=new Set([`${e.target.sourceRootRelativePath}/.openpond/agent-inspect.json`,`${e.target.sourceRootRelativePath}/.openpond/action-registry.json`,`${e.target.sourceRootRelativePath}/.openpond/eval-results.json`]),n=[{name:"inspect",command:"inspect",args:["--json"]},{name:"build",command:"build"},{name:"validate",command:"validate",args:["--json"]},{name:"eval",command:"eval",args:["--json"]},{name:"direct-run",command:"run",args:[e.target.defaultAction,"--json","--input",JSON.stringify({prompt:e.snapshot.objective,channel:"openpond_chat"})]}];for(let r of n){let s=await O({cwd:e.target.sourceRoot,command:r.command,args:r.args,...r.command==="eval"&&e.requireEvalPass===!1?{throwOnFailure:!1}:{}});if(s.code!==0&&!(r.command==="eval"&&e.requireEvalPass===!1))throw new Error(s.stderr.trim()||s.stdout.trim()||`${r.command} failed with exit code ${s.code??"unknown"}`);let i=lt(s.stdout),d=mt(i);d&&a.add(q.join(e.target.sourceRootRelativePath,d)),t[r.name]={summary:pt(r.name,i),traceArtifactRef:d,stdout:s.stdout.trim().slice(0,4e3),stderr:s.stderr.trim().slice(0,4e3)}}return await dt(e.target,e.requireEvalPass!==!1),{checkRefs:[...a],metadata:t}}o(F,"runLocalCreatePipelineChecks");async function V(e){if(!L(e.sourceRoot))throw new Error(`Codex did not create the expected agent source root: ${e.sourceRoot}`);let t=q.join(e.sourceRoot,"agent","agent.ts");if(!L(t))throw new Error(`Codex did not create the expected SDK agent source: ${t}`);let a=q.join(e.repoPath,"openpond-profile.json");if(!L(a))throw new Error(`Codex did not update the profile repo manifest: ${a}`);let n=q.join(e.sourcePath,"settings","profile.yaml");if(!L(n))throw new Error(`Codex did not update the profile manifest: ${n}`);let s=JSON.parse(await K(a,"utf8")).profiles?.[e.activeProfile];if(!s)throw new Error(`openpond-profile.json does not register profile ${e.activeProfile}.`);if(!s.enabledAgents?.includes(e.agentId))throw new Error(`openpond-profile.json does not enable generated agent ${e.agentId}.`);let i=await K(n,"utf8");if(!i.includes(`id: ${e.agentId}`)&&!i.includes(`id: "${e.agentId}"`))throw new Error(`settings/profile.yaml does not register generated agent ${e.agentId}.`);let d=e.agentId==="default"?["agent/agent.ts","agent"]:[`agents/${e.agentId}`];if(!d.some(u=>i.includes(u)))throw new Error(`settings/profile.yaml does not point ${e.agentId} at ${d[0]}.`)}o(V,"assertLocalCreateSourceLayout");async function dt(e,t=!0){let a=q.join(e.sourceRoot,".openpond","action-registry.json"),n=q.join(e.sourceRoot,".openpond","eval-results.json");if(!L(a))throw new Error(`Generated source did not produce an action registry: ${a}`);if(!L(n))throw new Error(`Generated source did not produce eval results: ${n}`);let r=JSON.parse(await K(a,"utf8")),s=Array.isArray(r.actions)?r.actions:[];if(!new Set(s.map(c=>typeof c.id=="string"?c.id:null).filter(c=>!!c)).has(e.defaultAction))throw new Error(`Generated action registry does not expose default action ${e.defaultAction}.`);let d=s.filter(c=>typeof c.id=="string"&&(!W(c.label)||!W(c.description)||typeof c.timeoutSeconds!="number"));if(d.length>0)throw new Error(`Generated action registry has actions missing labels, descriptions, or timeout policies: ${d.map(c=>c.id).join(", ")}`);let u=Pe({actionCatalog:s.filter(c=>typeof c.id=="string").map(c=>({id:c.id,name:W(c.name),setupRequirements:ut(c.setupRequirements)??[]})),actionId:e.defaultAction});if(u.blockingRequirements.length>0)throw new Error(`Generated default action ${e.defaultAction} has unresolved required setup and cannot be ready_local: ${u.blockingRequirements.map(Ie).join("; ")}. Mark built-in/local fixture requirements ready or optional when they are satisfied, or leave the pipeline blocked until the setup is configured.`);let m=JSON.parse(await K(n,"utf8"));if(typeof m.summary?.total!="number"||m.summary.total<1)throw new Error("Generated source must define at least one deterministic SDK eval.");if(t&&m.summary.failed!==0)throw new Error("Generated source evals did not all pass.")}o(dt,"assertGeneratedSdkArtifacts");function lt(e){let t=e.trim();if(!t.startsWith("{")&&!t.startsWith("["))return null;try{return JSON.parse(t)}catch{return null}}o(lt,"parseJsonOutput");function E(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}o(E,"asRecord");function ut(e){return Array.isArray(e)?e.filter(t=>!!E(t)):null}o(ut,"recordArray");function mt(e){let t=E(e),a=W(t?.traceArtifactRef);return a?.startsWith(".openpond/")?a:null}o(mt,"traceRefFromCommandResult");function pt(e,t){let a=E(t);return a?e==="inspect"?{actionCount:Array.isArray(a.actionCatalog)?a.actionCatalog.length:null,defaultAction:E(a.agent)?.defaultAction??null,projectName:E(a.project)?.name??null}:e==="validate"?{status:a.status??null,errors:E(a.summary)?.errors??null,warnings:E(a.summary)?.warnings??null}:e==="eval"?E(a.summary):e==="direct-run"?{hasResult:!!E(a.result),resultKeys:Object.keys(E(a.result)??{})}:null:null}o(pt,"summaryFromCommandResult");function W(e){return typeof e=="string"&&e.trim()?e.trim():null}o(W,"stringValue");var gt="Approved local Create plans require model-backed SDK source application; no source mutation was performed.",ft=1800*1e3,Te=".openpond-harness-source-application.json",ht=300*1e3,vt=2*1e3,Rt=5*1e3;async function He(e,t={}){if(!kt(e))return e;let a=t.now??(()=>new Date().toISOString()),n=e.adapter;if(n.kind!=="local")return e;if(!t.session||!t.turn||!t.ensureCodexRuntime||!t.appendRuntimeEvent||!t.setProviderTurnId)return Y(e,{now:a(),reason:gt,metadata:{reason:"model_backed_source_application_required",sourcePath:n.sourcePath??null,repoPath:n.repoPath??null,activeProfile:n.activeProfile??null,operation:e.operation,requestedAgentId:e.target.kind==="agent"?e.target.id:null}});let r;try{r=se(e)}catch(i){return Y(e,{now:a(),reason:i instanceof Error?i.message:String(i),metadata:{reason:"local_create_target_unresolved"}})}try{await ie({snapshot:e,session:t.session,turn:t.turn,target:r,ensureCodexRuntime:t.ensureCodexRuntime,appendRuntimeEvent:t.appendRuntimeEvent,setProviderTurnId:t.setProviderTurnId,model:t.model??we,codexReasoningEffort:t.codexReasoningEffort})}catch(i){return Y(e,{now:a(),reason:i instanceof Error?i.message:String(i),metadata:{reason:"model_backed_source_application_failed",target:r}})}let s=oe(e,{state:"running_checks",now:a(),blockedReason:null,sourceRefs:[r.sourceRootRelativePath,k.join(r.profileRelativePath,"settings","profile.yaml"),"openpond-profile.json"],metadata:{localCreatePipeline:{status:"running_checks",target:r}},candidates:[{id:Se(e.id),target:{kind:"agent",id:r.agentId,displayName:e.target.displayName,defaultActionKey:r.defaultAction},status:"checking",git:null,parentCandidateId:null,tasksetRef:e.tasksetRef,authoringModelRef:t.model??null,allowedPaths:e.plan?.sourcePlan.map(i=>i.path)??[],sourceRefs:[r.sourceRootRelativePath,k.join(r.profileRelativePath,"settings","profile.yaml"),"openpond-profile.json"],artifactRefs:[],checkRefs:[],evaluationReceiptRefs:[],createdAt:e.createdAt,updatedAt:a(),metadata:{sourceAuthority:e.adapter.sourceAuthority}}]});await t.onSnapshot?.(s);try{let i=await(t.runChecks??F)({snapshot:s,target:r}),d=a(),u=Se(e.id),m=`agent_eval_${e.id}`;return oe(s,{state:"ready_local",now:d,blockedReason:null,checkRefs:i.checkRefs,candidates:s.candidates.map(c=>c.id===u?{...c,status:"accepted",checkRefs:X(c.checkRefs,i.checkRefs),evaluationReceiptRefs:X(c.evaluationReceiptRefs,[m]),updatedAt:d}:c),evaluationReceipts:[...s.evaluationReceipts.filter(c=>c.id!==m),{id:m,candidateId:u,target:{kind:"agent",id:r.agentId,displayName:e.target.displayName,defaultActionKey:r.defaultAction},evaluatorKind:"agent_sdk",subject:"candidate",sourceCommit:e.adapter.kind==="local"?e.adapter.localHead:null,sourceBranch:null,tasksetId:e.tasksetRef?.id??null,tasksetHash:e.tasksetRef?.contentHash??null,taskAttemptRefs:i.checkRefs.filter(c=>c.includes("eval")),status:"passed",publishGate:"passed",summaryCounts:null,evalRefs:i.checkRefs.filter(c=>c.includes("eval")),artifactRefs:i.checkRefs,summary:wt(i.metadata),createdAt:d,metadata:i.metadata??{}}],metadata:{localCreatePipeline:{status:"ready_local",target:r,checks:i.metadata??{}}}})}catch(i){return Y(s,{now:a(),reason:i instanceof Error?i.message:String(i),metadata:{reason:"local_create_checks_failed",target:r}})}}o(He,"applyApprovedLocalCreateImproveRun");function kt(e){return e.state==="applying_source"&&e.plan?.status==="approved"&&e.adapter.kind==="local"&&e.target.kind==="agent"}o(kt,"shouldApplyLocalCreatePipeline");function oe(e,t){return A(e,{state:t.state,blockedReason:t.blockedReason===void 0?e.blockedReason:t.blockedReason,checkRefs:X(e.checkRefs,t.checkRefs??[]),sourceRefs:X(e.sourceRefs,t.sourceRefs??[]),candidates:t.candidates??e.candidates,evaluationReceipts:t.evaluationReceipts??e.evaluationReceipts,metadata:{...e.metadata,...t.metadata??{}},updatedAt:t.now})}o(oe,"transitionCreatePipeline");function Y(e,t){return oe(e,{state:"blocked",now:t.now,blockedReason:t.reason,metadata:{localCreatePipeline:{status:"blocked",...t.metadata}}})}o(Y,"blockLocalCreatePipeline");function X(e,t){return Array.from(new Set([...e,...t].filter(Boolean)))}o(X,"mergeRefs");function Se(e){return`agent_candidate_${e}`}o(Se,"agentCandidateId");function wt(e){let t=M(e?.eval),a=typeof t?.total=="number"?t.total:null;return a===null?"Agent SDK checks and deterministic Evals passed.":`${a} Agent SDK Eval${a===1?"":"s"} passed.`}o(wt,"checkSummary");function se(e){let t=e.adapter;if(t.kind!=="local")throw new Error("Create/Improve target must use the local adapter.");if(e.target.kind!=="agent")throw new Error("Local agent source application requires an Agent target.");let a=t.sourcePath?.trim(),n=t.repoPath?.trim();if(!a)throw new Error("Local Create approval is missing a profile source path.");if(!n)throw new Error("Local Create approval is missing a profile repo path.");let r=t.activeProfile?.trim()||"default",s=k.resolve(a),i=k.resolve(n),d=qe(e.target.id)??xt(e)??St(e.objective),u=Tt(Et(e.plan?.defaultChatAction.key)??"chat",d),m=e.operation==="improve"&&d==="default"?s:k.join(s,"agents",d);return{activeProfile:r,agentId:d,defaultAction:u,repoPath:i,sourcePath:s,workspaceRoot:i,profileRelativePath:je(k.relative(i,s)),sourceRoot:m,sourceRootRelativePath:je(k.relative(i,m))}}o(se,"resolveLocalCreatePipelineTarget");async function ie(e){if(!z(e.target.workspaceRoot))throw new Error(`Profile repo path does not exist: ${e.target.workspaceRoot}`);if(!z(e.target.sourcePath))throw new Error(`Profile source path does not exist: ${e.target.sourcePath}`);if(await Ct(e.snapshot,e.target)){await e.appendRuntimeEvent(H({sessionId:e.session.id,turnId:e.turn.id,name:"create_improve.updated",source:"server",appId:e.session.appId,status:"completed",output:`Applied prepared harness ${e.snapshot.operation==="improve"?"Improve":"Create"} source for ${e.target.agentId}; running local checks.`,data:{phase:"prepared_source_apply_completed",runId:e.snapshot.id,target:e.target}}));return}await e.appendRuntimeEvent(H({sessionId:e.session.id,turnId:e.turn.id,name:"create_improve.updated",source:"server",appId:e.session.appId,status:"started",output:`Applying approved ${e.snapshot.operation==="improve"?"Improve":"Create"} plan with Codex in ${e.target.sourceRootRelativePath}.`,data:{phase:"source_apply_started",runId:e.snapshot.id,target:e.target}}));let t={...e.session,provider:"codex",cwd:e.target.workspaceRoot,workspaceKind:"local_project",workspaceId:e.session.workspaceId??`openpond-profile:${e.target.activeProfile}`,workspaceName:e.session.workspaceName??`OpenPond profile ${e.target.activeProfile}`},a=e.session.provider==="codex"?e.model:null,n=await e.ensureCodexRuntime(t,{approvalPolicy:"never",sandbox:"workspace-write",model:a,codexPermissionMode:"auto-review",codexReasoningEffort:e.codexReasoningEffort}),r=await n.client.startTurn({threadId:n.threadId,prompt:At(e.snapshot,e.target),cwd:e.target.workspaceRoot,model:a,approvalPolicy:"never",sandbox:"workspace-write"});await e.setProviderTurnId(r.turnId);try{await n.client.waitForTurn(r.turnId,ft)}catch(s){if(!$e(s,r.turnId)&&!It(s))throw s;let i=$e(s,r.turnId)?"timed out":"exited cleanly before returning a turn completion";if(await e.appendRuntimeEvent(H({sessionId:e.session.id,turnId:e.turn.id,name:"create_improve.updated",source:"server",appId:e.session.appId,status:"started",output:`Codex source application ${i}; checking for completed generated source before blocking.`,data:{phase:"source_apply_recovery_started",runId:e.snapshot.id,providerTurnId:r.turnId,reason:i,target:e.target}})),!await yt(e.target))throw s;await e.appendRuntimeEvent(H({sessionId:e.session.id,turnId:e.turn.id,name:"create_improve.updated",source:"server",appId:e.session.appId,status:"completed",output:`Recovered completed ${e.snapshot.operation==="improve"?"Improve":"Create"} source after Codex source application ${i} for ${e.target.agentId}; running local checks.`,data:{phase:"source_apply_recovered",runId:e.snapshot.id,providerTurnId:r.turnId,reason:i,target:e.target}}))}await e.appendRuntimeEvent(H({sessionId:e.session.id,turnId:e.turn.id,name:"create_improve.updated",source:"provider",appId:e.session.appId,status:"completed",output:`Codex completed approved ${e.snapshot.operation==="improve"?"Improve":"Create"} source application for ${e.target.agentId}.`,data:{phase:"source_apply_completed",runId:e.snapshot.id,providerTurnId:r.turnId,target:e.target}}))}o(ie,"runModelBackedLocalCreateSourceApplication");async function Ct(e,t,a=process.env){if(!Ae(a))return!1;let n=k.join(t.workspaceRoot,Te);if(!z(n))return!1;let r=JSON.parse(await Oe(n,"utf8")),s=M(r);if(s?.schema!=="openpond.harnessPreparedSource.v1")throw new Error(`${Te} must use schema openpond.harnessPreparedSource.v1.`);let i=M(s.agents),d=M(i?.[t.agentId]),u=Pt(d?.[e.operation]);if(!u)return!1;let m=ne(t.workspaceRoot,u.source,"source");if(!z(m))throw new Error(`Prepared harness source does not exist: ${u.source}`);await Ee(t.sourceRoot,{recursive:!0}),await xe(m,t.sourceRoot,{recursive:!0,force:!0});for(let c of u.registrations??[]){let g=ne(t.workspaceRoot,c.source,"registration source"),l=ne(t.workspaceRoot,c.target,"registration target");if(!z(g))throw new Error(`Prepared harness registration source does not exist: ${c.source}`);await Ee(k.dirname(l),{recursive:!0}),await xe(g,l,{force:!0})}return!0}o(Ct,"applyPreparedHarnessSourceApplication");function Pt(e){let t=M(e);if(!t||typeof t.source!="string"||!t.source.trim())return null;if(t.registrations!==void 0&&!Array.isArray(t.registrations))throw new Error("Prepared harness source registrations must be an array.");let a=(t.registrations??[]).map(n=>{let r=M(n);if(!r||typeof r.source!="string"||!r.source.trim()||typeof r.target!="string"||!r.target.trim())throw new Error("Prepared harness source registrations require source and target paths.");return{source:r.source,target:r.target}});return{source:t.source,registrations:a}}o(Pt,"asHarnessPreparedSourceOperation");function ne(e,t,a){if(k.isAbsolute(t))throw new Error(`Prepared harness ${a} must be relative to the profile repo.`);let n=k.resolve(e),r=k.resolve(n,t);if(r!==n&&!r.startsWith(`${n}${k.sep}`))throw new Error(`Prepared harness ${a} must stay inside the profile repo.`);return r}o(ne,"resolveHarnessManifestPath");function $e(e,t){return(e instanceof Error?e.message:String(e))===`codex turn ${t} timed out`}o($e,"isCodexTurnTimeoutError");function It(e){return(e instanceof Error?e.message:String(e)).startsWith("codex app-server exited with code 0")}o(It,"isCodexAppServerCleanExitError");async function yt(e){let t=Date.now()+ht;for(;Date.now()<t;){if(await bt(e))return!0;await Le(vt)}return!1}o(yt,"waitForTimedOutSourceApplication");async function bt(e){try{await V(e);let t=await _e(e);await Le(Rt),await V(e);let a=await _e(e);return t===a}catch{return!1}}o(bt,"localCreateSourceLayoutIsStable");async function _e(e){let t=[k.join(e.sourceRoot,"agent","agent.ts"),k.join(e.sourceRoot,"package.json"),k.join(e.repoPath,"openpond-profile.json"),k.join(e.sourcePath,"settings","profile.yaml")];return(await Promise.all(t.map(async n=>{let r=await Oe(n,"utf8");return`${n}:${r.length}:${r}`}))).join(`
|
|
2
|
+
import{a as Ae}from"./chunk-GW766ZSO.js";import{B as H,a as Ie,b as ye}from"./chunk-XQBIHPPX.js";import{b as be}from"./chunk-XW6HGSIT.js";import{g as O}from"./chunk-FSQWAANK.js";import{a as re,b as Pe,j as A}from"./chunk-PWK5Z5S3.js";import{r as Ce}from"./chunk-DIGX56JY.js";import{D as we}from"./chunk-SG6JZ7HD.js";import{m as $}from"./chunk-BIPQCJ5V.js";import{a as o}from"./chunk-FTQLQJQV.js";import{existsSync as z}from"node:fs";import{cp as xe,mkdir as Ee,readFile as Oe}from"node:fs/promises";import k from"node:path";import{existsSync as L}from"node:fs";import{readFile as K}from"node:fs/promises";import q from"node:path";async function F(e){await V(e.target);let t={},a=new Set([`${e.target.sourceRootRelativePath}/.openpond/agent-inspect.json`,`${e.target.sourceRootRelativePath}/.openpond/action-registry.json`,`${e.target.sourceRootRelativePath}/.openpond/eval-results.json`]),n=[{name:"inspect",command:"inspect",args:["--json"]},{name:"build",command:"build"},{name:"validate",command:"validate",args:["--json"]},{name:"eval",command:"eval",args:["--json"]},{name:"direct-run",command:"run",args:[e.target.defaultAction,"--json","--input",JSON.stringify({prompt:e.snapshot.objective,channel:"openpond_chat"})]}];for(let r of n){let s=await H({cwd:e.target.sourceRoot,command:r.command,args:r.args,...r.command==="eval"&&e.requireEvalPass===!1?{throwOnFailure:!1}:{}});if(s.code!==0&&!(r.command==="eval"&&e.requireEvalPass===!1))throw new Error(s.stderr.trim()||s.stdout.trim()||`${r.command} failed with exit code ${s.code??"unknown"}`);let i=lt(s.stdout),d=mt(i);d&&a.add(q.join(e.target.sourceRootRelativePath,d)),t[r.name]={summary:pt(r.name,i),traceArtifactRef:d,stdout:s.stdout.trim().slice(0,4e3),stderr:s.stderr.trim().slice(0,4e3)}}return await dt(e.target,e.requireEvalPass!==!1),{checkRefs:[...a],metadata:t}}o(F,"runLocalCreatePipelineChecks");async function V(e){if(!L(e.sourceRoot))throw new Error(`Codex did not create the expected agent source root: ${e.sourceRoot}`);let t=q.join(e.sourceRoot,"agent","agent.ts");if(!L(t))throw new Error(`Codex did not create the expected SDK agent source: ${t}`);let a=q.join(e.repoPath,"openpond-profile.json");if(!L(a))throw new Error(`Codex did not update the profile repo manifest: ${a}`);let n=q.join(e.sourcePath,"settings","profile.yaml");if(!L(n))throw new Error(`Codex did not update the profile manifest: ${n}`);let s=JSON.parse(await K(a,"utf8")).profiles?.[e.activeProfile];if(!s)throw new Error(`openpond-profile.json does not register profile ${e.activeProfile}.`);if(!s.enabledAgents?.includes(e.agentId))throw new Error(`openpond-profile.json does not enable generated agent ${e.agentId}.`);let i=await K(n,"utf8");if(!i.includes(`id: ${e.agentId}`)&&!i.includes(`id: "${e.agentId}"`))throw new Error(`settings/profile.yaml does not register generated agent ${e.agentId}.`);let d=e.agentId==="default"?["agent/agent.ts","agent"]:[`agents/${e.agentId}`];if(!d.some(u=>i.includes(u)))throw new Error(`settings/profile.yaml does not point ${e.agentId} at ${d[0]}.`)}o(V,"assertLocalCreateSourceLayout");async function dt(e,t=!0){let a=q.join(e.sourceRoot,".openpond","action-registry.json"),n=q.join(e.sourceRoot,".openpond","eval-results.json");if(!L(a))throw new Error(`Generated source did not produce an action registry: ${a}`);if(!L(n))throw new Error(`Generated source did not produce eval results: ${n}`);let r=JSON.parse(await K(a,"utf8")),s=Array.isArray(r.actions)?r.actions:[];if(!new Set(s.map(c=>typeof c.id=="string"?c.id:null).filter(c=>!!c)).has(e.defaultAction))throw new Error(`Generated action registry does not expose default action ${e.defaultAction}.`);let d=s.filter(c=>typeof c.id=="string"&&(!W(c.label)||!W(c.description)||typeof c.timeoutSeconds!="number"));if(d.length>0)throw new Error(`Generated action registry has actions missing labels, descriptions, or timeout policies: ${d.map(c=>c.id).join(", ")}`);let u=Ie({actionCatalog:s.filter(c=>typeof c.id=="string").map(c=>({id:c.id,name:W(c.name),setupRequirements:ut(c.setupRequirements)??[]})),actionId:e.defaultAction});if(u.blockingRequirements.length>0)throw new Error(`Generated default action ${e.defaultAction} has unresolved required setup and cannot be ready_local: ${u.blockingRequirements.map(ye).join("; ")}. Mark built-in/local fixture requirements ready or optional when they are satisfied, or leave the pipeline blocked until the setup is configured.`);let m=JSON.parse(await K(n,"utf8"));if(typeof m.summary?.total!="number"||m.summary.total<1)throw new Error("Generated source must define at least one deterministic SDK eval.");if(t&&m.summary.failed!==0)throw new Error("Generated source evals did not all pass.")}o(dt,"assertGeneratedSdkArtifacts");function lt(e){let t=e.trim();if(!t.startsWith("{")&&!t.startsWith("["))return null;try{return JSON.parse(t)}catch{return null}}o(lt,"parseJsonOutput");function E(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}o(E,"asRecord");function ut(e){return Array.isArray(e)?e.filter(t=>!!E(t)):null}o(ut,"recordArray");function mt(e){let t=E(e),a=W(t?.traceArtifactRef);return a?.startsWith(".openpond/")?a:null}o(mt,"traceRefFromCommandResult");function pt(e,t){let a=E(t);return a?e==="inspect"?{actionCount:Array.isArray(a.actionCatalog)?a.actionCatalog.length:null,defaultAction:E(a.agent)?.defaultAction??null,projectName:E(a.project)?.name??null}:e==="validate"?{status:a.status??null,errors:E(a.summary)?.errors??null,warnings:E(a.summary)?.warnings??null}:e==="eval"?E(a.summary):e==="direct-run"?{hasResult:!!E(a.result),resultKeys:Object.keys(E(a.result)??{})}:null:null}o(pt,"summaryFromCommandResult");function W(e){return typeof e=="string"&&e.trim()?e.trim():null}o(W,"stringValue");var gt="Approved local Create plans require model-backed SDK source application; no source mutation was performed.",ft=1800*1e3,Te=".openpond-harness-source-application.json",ht=300*1e3,vt=2*1e3,Rt=5*1e3;async function He(e,t={}){if(!kt(e))return e;let a=t.now??(()=>new Date().toISOString()),n=e.adapter;if(n.kind!=="local")return e;if(!t.session||!t.turn||!t.ensureCodexRuntime||!t.appendRuntimeEvent||!t.setProviderTurnId)return Y(e,{now:a(),reason:gt,metadata:{reason:"model_backed_source_application_required",sourcePath:n.sourcePath??null,repoPath:n.repoPath??null,activeProfile:n.activeProfile??null,operation:e.operation,requestedAgentId:e.target.kind==="agent"?e.target.id:null}});let r;try{r=se(e)}catch(i){return Y(e,{now:a(),reason:i instanceof Error?i.message:String(i),metadata:{reason:"local_create_target_unresolved"}})}try{await ie({snapshot:e,session:t.session,turn:t.turn,target:r,ensureCodexRuntime:t.ensureCodexRuntime,appendRuntimeEvent:t.appendRuntimeEvent,setProviderTurnId:t.setProviderTurnId,model:t.model??we,codexReasoningEffort:t.codexReasoningEffort})}catch(i){return Y(e,{now:a(),reason:i instanceof Error?i.message:String(i),metadata:{reason:"model_backed_source_application_failed",target:r}})}let s=oe(e,{state:"running_checks",now:a(),blockedReason:null,sourceRefs:[r.sourceRootRelativePath,k.join(r.profileRelativePath,"settings","profile.yaml"),"openpond-profile.json"],metadata:{localCreatePipeline:{status:"running_checks",target:r}},candidates:[{id:Se(e.id),target:{kind:"agent",id:r.agentId,displayName:e.target.displayName,defaultActionKey:r.defaultAction},status:"checking",git:null,parentCandidateId:null,tasksetRef:e.tasksetRef,authoringModelRef:t.model??null,allowedPaths:e.plan?.sourcePlan.map(i=>i.path)??[],sourceRefs:[r.sourceRootRelativePath,k.join(r.profileRelativePath,"settings","profile.yaml"),"openpond-profile.json"],artifactRefs:[],checkRefs:[],evaluationReceiptRefs:[],createdAt:e.createdAt,updatedAt:a(),metadata:{sourceAuthority:e.adapter.sourceAuthority}}]});await t.onSnapshot?.(s);try{let i=await(t.runChecks??F)({snapshot:s,target:r}),d=a(),u=Se(e.id),m=`agent_eval_${e.id}`;return oe(s,{state:"ready_local",now:d,blockedReason:null,checkRefs:i.checkRefs,candidates:s.candidates.map(c=>c.id===u?{...c,status:"accepted",checkRefs:X(c.checkRefs,i.checkRefs),evaluationReceiptRefs:X(c.evaluationReceiptRefs,[m]),updatedAt:d}:c),evaluationReceipts:[...s.evaluationReceipts.filter(c=>c.id!==m),{id:m,candidateId:u,target:{kind:"agent",id:r.agentId,displayName:e.target.displayName,defaultActionKey:r.defaultAction},evaluatorKind:"agent_sdk",subject:"candidate",sourceCommit:e.adapter.kind==="local"?e.adapter.localHead:null,sourceBranch:null,tasksetId:e.tasksetRef?.id??null,tasksetHash:e.tasksetRef?.contentHash??null,taskAttemptRefs:i.checkRefs.filter(c=>c.includes("eval")),status:"passed",publishGate:"passed",summaryCounts:null,evalRefs:i.checkRefs.filter(c=>c.includes("eval")),artifactRefs:i.checkRefs,summary:wt(i.metadata),createdAt:d,metadata:i.metadata??{}}],metadata:{localCreatePipeline:{status:"ready_local",target:r,checks:i.metadata??{}}}})}catch(i){return Y(s,{now:a(),reason:i instanceof Error?i.message:String(i),metadata:{reason:"local_create_checks_failed",target:r}})}}o(He,"applyApprovedLocalCreateImproveRun");function kt(e){return e.state==="applying_source"&&e.plan?.status==="approved"&&e.adapter.kind==="local"&&e.target.kind==="agent"}o(kt,"shouldApplyLocalCreatePipeline");function oe(e,t){return A(e,{state:t.state,blockedReason:t.blockedReason===void 0?e.blockedReason:t.blockedReason,checkRefs:X(e.checkRefs,t.checkRefs??[]),sourceRefs:X(e.sourceRefs,t.sourceRefs??[]),candidates:t.candidates??e.candidates,evaluationReceipts:t.evaluationReceipts??e.evaluationReceipts,metadata:{...e.metadata,...t.metadata??{}},updatedAt:t.now})}o(oe,"transitionCreatePipeline");function Y(e,t){return oe(e,{state:"blocked",now:t.now,blockedReason:t.reason,metadata:{localCreatePipeline:{status:"blocked",...t.metadata}}})}o(Y,"blockLocalCreatePipeline");function X(e,t){return Array.from(new Set([...e,...t].filter(Boolean)))}o(X,"mergeRefs");function Se(e){return`agent_candidate_${e}`}o(Se,"agentCandidateId");function wt(e){let t=M(e?.eval),a=typeof t?.total=="number"?t.total:null;return a===null?"Agent SDK checks and deterministic Evals passed.":`${a} Agent SDK Eval${a===1?"":"s"} passed.`}o(wt,"checkSummary");function se(e){let t=e.adapter;if(t.kind!=="local")throw new Error("Create/Improve target must use the local adapter.");if(e.target.kind!=="agent")throw new Error("Local agent source application requires an Agent target.");let a=t.sourcePath?.trim(),n=t.repoPath?.trim();if(!a)throw new Error("Local Create approval is missing a profile source path.");if(!n)throw new Error("Local Create approval is missing a profile repo path.");let r=t.activeProfile?.trim()||"default",s=k.resolve(a),i=k.resolve(n),d=qe(e.target.id)??xt(e)??St(e.objective),u=Tt(Et(e.plan?.defaultChatAction.key)??"chat",d),m=e.operation==="improve"&&d==="default"?s:k.join(s,"agents",d);return{activeProfile:r,agentId:d,defaultAction:u,repoPath:i,sourcePath:s,workspaceRoot:i,profileRelativePath:je(k.relative(i,s)),sourceRoot:m,sourceRootRelativePath:je(k.relative(i,m))}}o(se,"resolveLocalCreatePipelineTarget");async function ie(e){if(!z(e.target.workspaceRoot))throw new Error(`Profile repo path does not exist: ${e.target.workspaceRoot}`);if(!z(e.target.sourcePath))throw new Error(`Profile source path does not exist: ${e.target.sourcePath}`);if(await Ct(e.snapshot,e.target)){await e.appendRuntimeEvent(O({sessionId:e.session.id,turnId:e.turn.id,name:"create_improve.updated",source:"server",appId:e.session.appId,status:"completed",output:`Applied prepared harness ${e.snapshot.operation==="improve"?"Improve":"Create"} source for ${e.target.agentId}; running local checks.`,data:{phase:"prepared_source_apply_completed",runId:e.snapshot.id,target:e.target}}));return}await e.appendRuntimeEvent(O({sessionId:e.session.id,turnId:e.turn.id,name:"create_improve.updated",source:"server",appId:e.session.appId,status:"started",output:`Applying approved ${e.snapshot.operation==="improve"?"Improve":"Create"} plan with Codex in ${e.target.sourceRootRelativePath}.`,data:{phase:"source_apply_started",runId:e.snapshot.id,target:e.target}}));let t={...e.session,provider:"codex",cwd:e.target.workspaceRoot,workspaceKind:"local_project",workspaceId:e.session.workspaceId??`openpond-profile:${e.target.activeProfile}`,workspaceName:e.session.workspaceName??`OpenPond profile ${e.target.activeProfile}`},a=e.session.provider==="codex"?e.model:null,n=await e.ensureCodexRuntime(t,{approvalPolicy:"never",sandbox:"workspace-write",model:a,codexPermissionMode:"auto-review",codexReasoningEffort:e.codexReasoningEffort}),r=await n.client.startTurn({threadId:n.threadId,prompt:At(e.snapshot,e.target),cwd:e.target.workspaceRoot,model:a,approvalPolicy:"never",sandbox:"workspace-write"});await e.setProviderTurnId(r.turnId);try{await n.client.waitForTurn(r.turnId,ft)}catch(s){if(!$e(s,r.turnId)&&!It(s))throw s;let i=$e(s,r.turnId)?"timed out":"exited cleanly before returning a turn completion";if(await e.appendRuntimeEvent(O({sessionId:e.session.id,turnId:e.turn.id,name:"create_improve.updated",source:"server",appId:e.session.appId,status:"started",output:`Codex source application ${i}; checking for completed generated source before blocking.`,data:{phase:"source_apply_recovery_started",runId:e.snapshot.id,providerTurnId:r.turnId,reason:i,target:e.target}})),!await yt(e.target))throw s;await e.appendRuntimeEvent(O({sessionId:e.session.id,turnId:e.turn.id,name:"create_improve.updated",source:"server",appId:e.session.appId,status:"completed",output:`Recovered completed ${e.snapshot.operation==="improve"?"Improve":"Create"} source after Codex source application ${i} for ${e.target.agentId}; running local checks.`,data:{phase:"source_apply_recovered",runId:e.snapshot.id,providerTurnId:r.turnId,reason:i,target:e.target}}))}await e.appendRuntimeEvent(O({sessionId:e.session.id,turnId:e.turn.id,name:"create_improve.updated",source:"provider",appId:e.session.appId,status:"completed",output:`Codex completed approved ${e.snapshot.operation==="improve"?"Improve":"Create"} source application for ${e.target.agentId}.`,data:{phase:"source_apply_completed",runId:e.snapshot.id,providerTurnId:r.turnId,target:e.target}}))}o(ie,"runModelBackedLocalCreateSourceApplication");async function Ct(e,t,a=process.env){if(!Ae(a))return!1;let n=k.join(t.workspaceRoot,Te);if(!z(n))return!1;let r=JSON.parse(await Oe(n,"utf8")),s=M(r);if(s?.schema!=="openpond.harnessPreparedSource.v1")throw new Error(`${Te} must use schema openpond.harnessPreparedSource.v1.`);let i=M(s.agents),d=M(i?.[t.agentId]),u=Pt(d?.[e.operation]);if(!u)return!1;let m=ne(t.workspaceRoot,u.source,"source");if(!z(m))throw new Error(`Prepared harness source does not exist: ${u.source}`);await Ee(t.sourceRoot,{recursive:!0}),await xe(m,t.sourceRoot,{recursive:!0,force:!0});for(let c of u.registrations??[]){let g=ne(t.workspaceRoot,c.source,"registration source"),l=ne(t.workspaceRoot,c.target,"registration target");if(!z(g))throw new Error(`Prepared harness registration source does not exist: ${c.source}`);await Ee(k.dirname(l),{recursive:!0}),await xe(g,l,{force:!0})}return!0}o(Ct,"applyPreparedHarnessSourceApplication");function Pt(e){let t=M(e);if(!t||typeof t.source!="string"||!t.source.trim())return null;if(t.registrations!==void 0&&!Array.isArray(t.registrations))throw new Error("Prepared harness source registrations must be an array.");let a=(t.registrations??[]).map(n=>{let r=M(n);if(!r||typeof r.source!="string"||!r.source.trim()||typeof r.target!="string"||!r.target.trim())throw new Error("Prepared harness source registrations require source and target paths.");return{source:r.source,target:r.target}});return{source:t.source,registrations:a}}o(Pt,"asHarnessPreparedSourceOperation");function ne(e,t,a){if(k.isAbsolute(t))throw new Error(`Prepared harness ${a} must be relative to the profile repo.`);let n=k.resolve(e),r=k.resolve(n,t);if(r!==n&&!r.startsWith(`${n}${k.sep}`))throw new Error(`Prepared harness ${a} must stay inside the profile repo.`);return r}o(ne,"resolveHarnessManifestPath");function $e(e,t){return(e instanceof Error?e.message:String(e))===`codex turn ${t} timed out`}o($e,"isCodexTurnTimeoutError");function It(e){return(e instanceof Error?e.message:String(e)).startsWith("codex app-server exited with code 0")}o(It,"isCodexAppServerCleanExitError");async function yt(e){let t=Date.now()+ht;for(;Date.now()<t;){if(await bt(e))return!0;await Le(vt)}return!1}o(yt,"waitForTimedOutSourceApplication");async function bt(e){try{await V(e);let t=await _e(e);await Le(Rt),await V(e);let a=await _e(e);return t===a}catch{return!1}}o(bt,"localCreateSourceLayoutIsStable");async function _e(e){let t=[k.join(e.sourceRoot,"agent","agent.ts"),k.join(e.sourceRoot,"package.json"),k.join(e.repoPath,"openpond-profile.json"),k.join(e.sourcePath,"settings","profile.yaml")];return(await Promise.all(t.map(async n=>{let r=await Oe(n,"utf8");return`${n}:${r.length}:${r}`}))).join(`
|
|
3
3
|
---
|
|
4
4
|
`)}o(_e,"sourceLayoutFingerprint");function Le(e){return new Promise(t=>setTimeout(t,e))}o(Le,"sleep");function At(e,t){return[`Apply this already-approved OpenPond ${e.operation==="improve"?"Improve":"Create"} plan by editing the local profile repo source.`,"","This is the source-materialization step, not another plan review. Make the file changes, inspect the existing profile shape first, and leave the repo with a valid openpond-agent-sdk source project.","","Hard requirements:",`- Current working directory is the profile repo root: ${t.workspaceRoot}`,`- Active profile source path relative to cwd: ${t.profileRelativePath}`,`- Target agent id: ${t.agentId}`,`- Target generated source root: ${t.sourceRootRelativePath}`,`- Default action to expose: ${t.defaultAction}`,`- For a create request, create the new SDK project under ${t.profileRelativePath}/agents/<agent-id>; do not overwrite ${t.profileRelativePath}/agent/agent.ts or unrelated existing agents.`,"- For an edit request, only edit the approved target agent source and shared profile registration files required for that edit.",`- Update openpond-profile.json and ${t.profileRelativePath}/settings/profile.yaml so the generated agent is registered, enabled, and catalog-discoverable.`,"- The generated source must be an actual openpond-agent-sdk project with package.json, tsconfig.json when needed, agent/agent.ts, deterministic evals, and action metadata.","- Preserve the approved objective and any captured conversation context in source metadata, instructions, fixture comments, or eval intent so source readback can prove what was captured.","- Treat plan.metadata.actionShape as the approved public action-shape decision when actionShapeDecisionSource is request_metadata or another explicit planner source.","- If plan.metadata.actionShapeDecisionSource is default_chat_fallback, use the approved objective and captured context to choose the actual generated public actions: keep chat-only for conversational assistants, create direct actions for explicit repeatable runs/workflows/artifact transforms, and expose both when the user needs normal chat plus a repeatable catalog action.","- When refining a default fallback during source materialization, encode the chosen public actions in generated SDK action metadata and evals; do not use business-example hardcoding.","- Every public action must have a stable action id, label, description, input/output schema when useful, timeout policy, artifact policy, setup requirement metadata, and deterministic eval coverage.","- The default action must be invocable through the local profile setup gate after checks. Do not leave built-in openpond_chat or committed local fixture/artifact requirements as unresolved required setup; mark those rows ready/satisfied or optional when the generated source already provides them.","- If the approved objective names multiple capabilities or direct action ids, implement each requested public action instead of collapsing everything into a single chat-only action.","- If a capability writes an artifact, declare it in the action artifact policy and assert it from at least one eval.","- Package scripts must be portable from the generated source root; do not hardcode absolute machine-local paths to this repository or CLI.","- Do not hardcode secrets, API keys, provider tokens, or user credentials in source, evals, traces, fixtures, or comments.","- Use realistic deterministic fixture-backed behavior when external systems are unavailable. Declare setup requirements rather than pretending live integrations exist.","- Run or prepare the source so these commands can pass from the target source root: inspect, build, validate, eval, and run of the default action.","","Approved Create request and plan:",JSON.stringify({run:e,plan:e.plan,questions:e.questions,workflowCapture:e.workflowCapture},null,2)].join(`
|
|
5
|
-
`)}o(At,"localCreatePipelinePrompt");function xt(e){for(let t of e.plan?.sourcePlan??[]){let a=/^agents\/([^/]+)/.exec(t.path),n=qe(a?.[1]);if(n)return n}return null}o(xt,"agentIdFromSourcePlan");function qe(e){let t=e?.trim();return t&&t.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||null}o(qe,"normalizeAgentId");function Et(e){return e?.trim()||null}o(Et,"normalizeActionId");function M(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}o(M,"asRecord");function Tt(e,t){let a=`${t}.`;return e.startsWith(a)?e.slice(a.length)||"chat":e}o(Tt,"sourceActionIdForAgent");function St(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64).replace(/-+$/g,"")||"generated-agent"}o(St,"slugFromObjective");function je(e){return e.replace(/\\/g,"/")||"."}o(je,"normalizeRelativePath");import de from"node:path";function Pa(e){let t=e.sources.length?e.sources.map(r=>({kind:"conversation",id:r.id,sourceHash:r.sourceHash,excerptRef:`training-source:${r.id}`})):[{kind:"manual_intent",id:`manual_intent_${$(e.objective).slice(0,24)}`,sourceHash:$({objective:e.objective}),excerptRef:null}],a={consent:{status:"granted",scope:e.sources.length?"selected_turns":"direct_intent",reviewedBy:"local_user",reviewedAt:e.timestamp},sources:t,reviewerIntent:e.objective},n=$(a);return re.parse({schemaVersion:"openpond.createImprove.evidenceSnapshot.v1",id:`evidence_snapshot_${n.slice(0,24)}`,contentHash:n,...a,createdAt:e.timestamp,metadata:{immutable:!0,sourceCount:t.length}})}o(Pa,"createEvidenceSnapshot");function Ia(e){let t={runId:e.run.id,candidateId:e.candidateId,tasksetId:e.run.tasksetRef?.id??null,tasksetRevision:e.run.tasksetRef?.revision??null,tasksetHash:e.run.tasksetRef?.contentHash??null,outcome:e.outcome,reason:e.reason,receiptRefs:e.receiptRefs},a=$(t);return re.parse({schemaVersion:"openpond.createImprove.evidenceSnapshot.v1",id:`evidence_outcome_${a.slice(0,24)}`,contentHash:a,consent:{status:"granted",scope:"direct_intent",reviewedBy:e.run.actor.id??"local_user",reviewedAt:e.timestamp},sources:[{kind:"artifact",id:`${e.outcome}:${e.run.id}:${e.candidateId}`,sourceHash:a,excerptRef:e.receiptRefs[0]??null}],reviewerIntent:e.reason,createdAt:e.timestamp,metadata:{immutable:!0,evidenceKind:"candidate_outcome",outcome:e.outcome,priorTasksetRevision:e.run.tasksetRef?.revision??null,recommendedNextTasksetRevision:e.run.tasksetRef?e.run.tasksetRef.revision+1:1,receiptRefs:e.receiptRefs}})}o(Ia,"createOutcomeEvidenceSnapshot");function ya(e){let t=e.proposal?$t(e.proposal):{kind:"model",rationale:["A reviewed training plan selected Model execution for this Taskset."],confidence:1};return ye.parse({schemaVersion:"openpond.createImprove.tasksetRef.v1",id:e.taskset.id,revision:e.taskset.revision,contentHash:e.taskset.contentHash,evidenceSnapshotIds:e.evidenceSnapshotIds,policyBoundary:e.taskset.policy,targetRecommendation:t,authoringSplitRefs:e.taskset.tasks.filter(a=>a.split==="train"||a.split==="validation").map(a=>a.id),privateSplitRefs:e.taskset.tasks.filter(a=>a.split==="test"||a.split==="frozen_eval").map(a=>a.id),approvedBy:"local_user",approvedAt:e.approvedAt,metadata:{immutable:!0,taskCreationProposalId:e.proposal?.id??null}})}o(ya,"createTasksetRef");function Me(e,t){if(e.id!==t.id||e.revision!==t.revision||e.contentHash!==t.contentHash)throw new Error(`Taskset lineage mismatch: the run approved ${e.id}@${e.revision} (${e.contentHash}), but execution resolved ${t.id}@${t.revision} (${t.contentHash}).`)}o(Me,"assertTasksetRefMatches");function $t(e){let t=_t(e);return{kind:t,rationale:e.diagnosis.rationale.length?e.diagnosis.rationale:[`${t} best matches the reviewed behavior boundary.`],confidence:e.diagnosis.confidence}}o($t,"recommendationForProposal");function _t(e){return e.diagnosis.trainingEligible?"model":e.diagnosis.intervention==="retrieval"?"configuration":"agent"}o(_t,"targetKindForProposal");async function Ge(e){let t=e.run.tasksetRef;if(!t)throw new Error("Agent Taskset execution requires an approved Taskset ref.");if(Me(t,e.taskset),e.taskset.environment.kind!=="agent")throw new Error(`Taskset ${e.taskset.id} is not an Agent-shaped Taskset.`);let a=new Set(t.privateSplitRefs),n=e.taskset.tasks.filter(c=>a.has(c.id));if(!n.length||n.length!==a.size)throw new Error("The approved Agent Taskset private split could not be resolved exactly.");let r={tasksetId:t.id,tasksetRevision:t.revision,tasksetHash:t.contentHash,taskRefs:n.map(c=>c.id),seed:0,timeoutMs:e.taskset.environment.defaultTimeoutMs,entrypoint:e.taskset.environment.entrypoint,evaluator:"openpond-agent-sdk-taskset.v1"},s=$(r),i=[],d=[],u=[];for(let c of n){let g=new Date().toISOString(),l=Date.now(),p=await(e.execute??O)({cwd:e.cwd,command:"run",args:[e.taskset.environment.entrypoint,"--json","--input",JSON.stringify({...c.input,channel:"manual"})],timeoutMs:e.taskset.environment.defaultTimeoutMs,throwOnFailure:!1}),x=p.code===0?jt(p.stdout):null,b=`agent_task_attempt_${$([e.run.id,e.subject,e.sourceCommit,t.contentHash,c.id,0]).slice(0,24)}`,f=Ot(x?.traceArtifactRef),P=Ce.parse({schemaVersion:"openpond.taskAttempt.v1",id:b,tasksetId:e.taskset.id,taskId:c.id,split:c.split,attempt:0,seed:0,modelRef:null,startedAt:g,completedAt:new Date().toISOString(),output:ce(x?.result),runtimeEventRefs:f?[f]:[],artifactRefs:f?[f]:[],privilegedOutcomeRef:c.privilegedContextRef,infrastructureError:p.code===0?null:p.stderr.trim().slice(0,1e4)||`Agent SDK action exited with code ${String(p.code)}.`,costUsd:0,latencyMs:Math.max(0,Date.now()-l),userInterventions:0,metadata:{executor:"openpond-agent-sdk",trustedTasksetExecution:!0,tasksetRevision:t.revision,tasksetHash:t.contentHash,sourceCommit:e.sourceCommit,subject:e.subject,executionContractHash:s}}),R=await e.gradeAttempt({tasksetId:e.taskset.id,taskId:c.id,attempt:P});d.push(P.id),i.push(R),f&&u.push(f)}let m=i.filter(c=>c.passed).length;return{taskAttemptRefs:d,gradeRefs:i.map(c=>c.id),taskRefs:n.map(c=>c.id),artifactRefs:[...new Set(u)],total:i.length,passed:m,failed:i.length-m,executionContractHash:s}}o(Ge,"executeAgentTasksetEvaluation");function jt(e){let t=e.trim();if(!t)return null;try{return ce(JSON.parse(t))}catch{let a=t.indexOf("{"),n=t.lastIndexOf("}");if(a<0||n<=a)return null;try{return ce(JSON.parse(t.slice(a,n+1)))}catch{return null}}}o(jt,"parseAgentRunPayload");function ce(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}o(ce,"recordValue");function Ot(e){return typeof e=="string"&&e.trim()?e.trim():null}o(Ot,"stringValue");async function le(e){let t=await(e.execute??O)({cwd:e.cwd,command:"eval",args:["--json"],throwOnFailure:!1}),a=qt(t.stdout),n=G(a.summary?.total)??0,r=G(a.summary?.passed)??0,s=G(a.summary?.failed)??Math.max(0,n-r),i=a.publishGate?.status==="passed"?"passed":"failed",d=Array.isArray(a.results)?a.results:[],u=d.map(R=>I(R.name)).filter(R=>!!R),m=new Set([de.posix.join(e.sourceRef,".openpond/eval-results.json")]);for(let R of d){let _=I(R.traceArtifactRef);_&&m.add(de.posix.join(e.sourceRef,Ne(_)));for(let J of De(R.artifacts))m.add(de.posix.join(e.sourceRef,Ne(J)))}let c=e.run.tasksetRef?await Ge({run:e.run,taskset:Ht(e.taskset),cwd:e.cwd,sourceCommit:e.sourceCommit,subject:e.subject,gradeAttempt:Lt(e.gradeAttempt),execute:e.execute}):null;for(let R of c?.artifactRefs??[])m.add(R);let g=n+(c?.total??0),l=r+(c?.passed??0),p=s+(c?.failed??0),x=[...new Set([...u,...c?.taskRefs??[]])],b=i==="passed"&&(c?.failed??0)===0?"passed":"failed",f=t.code===0&&p===0&&b==="passed"?"passed":"failed",P=e.timestamp??new Date().toISOString();return{id:`agent_eval_${e.run.id}_${e.subject}_${e.sourceCommit.slice(0,12)}`,candidateId:e.candidateId,target:e.run.target,evaluatorKind:"agent_sdk",subject:e.subject,sourceCommit:e.sourceCommit,sourceBranch:e.sourceBranch,tasksetId:e.run.tasksetRef?.id??null,tasksetHash:e.run.tasksetRef?.contentHash??null,taskAttemptRefs:c?.taskAttemptRefs??u,status:f,publishGate:b,summaryCounts:{total:g,passed:l,failed:p},evalRefs:x,artifactRefs:[...m],summary:`${e.subject==="active"?"Active":e.subject==="candidate"?"Candidate":"Post-release"} Agent SDK and Taskset Evals: ${l}/${g} passed${b==="failed"?"; publish gate failed":""}.`,createdAt:P,metadata:{schemaVersion:I(a.schemaVersion),schema:I(a.schema),project:{name:I(a.project?.name),version:I(a.project?.version)},source:{configPath:I(a.source?.configPath),configHash:I(a.source?.configHash)},publishGate:{total:G(a.publishGate?.total),passed:G(a.publishGate?.passed),failed:G(a.publishGate?.failed),blockingFailures:De(a.publishGate?.blockingFailures)},command:{code:t.code,timedOut:t.timedOut,stderr:t.stderr.trim().slice(0,4e3)},trustedTasksetExecution:!!c,tasksetRevision:e.run.tasksetRef?.revision??null,executionContractHash:c?.executionContractHash??null,gradeRefs:c?.gradeRefs??[],results:d.map(R=>({name:I(R.name),status:I(R.status),error:I(R.error),traceArtifactRef:I(R.traceArtifactRef)}))}}}o(le,"runNormalizedAgentEvaluation");function Ht(e){if(!e)throw new Error("The approved Agent Taskset could not be resolved for evaluation.");return e}o(Ht,"requireTaskset");function Lt(e){if(!e)throw new Error("Trusted Taskset grading is unavailable for Agent evaluation.");return e}o(Lt,"requireGradeAttempt");function qt(e){let t=e.trim();if(!t)throw new Error("Agent SDK Eval returned no JSON output.");try{return JSON.parse(t)}catch{let a=t.indexOf("{"),n=t.lastIndexOf("}");if(a>=0&&n>a)try{return JSON.parse(t.slice(a,n+1))}catch{}throw new Error("Agent SDK Eval returned invalid JSON output.")}}o(qt,"parseAgentEvalPayload");function Ne(e){return e.replace(/^\.\//,"").replaceAll("\\","/")}o(Ne,"normalizeRef");function I(e){return typeof e=="string"&&e.trim()?e.trim():null}o(I,"stringValue");function G(e){return typeof e=="number"&&Number.isFinite(e)?e:null}o(G,"numberValue");function De(e){return Array.isArray(e)?e.map(I).filter(t=>!!t):[]}o(De,"stringArray");import{existsSync as Z}from"node:fs";import{mkdir as Xe,realpath as Qe,rm as he,writeFile as Ft}from"node:fs/promises";import Ze from"node:os";import S from"node:path";import{existsSync as ue}from"node:fs";import{cp as Mt,lstat as Gt,mkdir as Be,rm as Nt,symlink as Dt,writeFile as Bt}from"node:fs/promises";import w from"node:path";function Ue(e,t){let a=C(t.profileRelativePath),n=[C(t.sourceRootRelativePath),w.posix.join(a,"evals"),w.posix.join(a,"settings"),w.posix.join(a,"package.json"),w.posix.join(a,"tsconfig.json"),w.posix.join(a,"openpond.lock"),w.posix.join(a,".gitignore"),"openpond-profile.json"],r=(e.plan?.sourcePlan??[]).flatMap(s=>{let i=C(s.path);return i?i==="."||i.startsWith(`${a}/`)?[i]:[w.posix.join(a,i),i]:[]});return[...new Set([...n,...r])]}o(Ue,"allowedAgentImprovementPaths");function Je(e,t){let a=C(e);return t.some(n=>a===n||a.startsWith(`${n}/`))}o(Je,"pathAllowed");function me(e){return C(e).split("/").some(a=>a==="node_modules"||a===".openpond"||a==="artifacts")}o(me,"isCandidateRuntimePath");function Fe(e){return e.split(/\r?\n/).map(t=>t.trimEnd()).filter(Boolean).map(t=>{let a=t.slice(3),n=a.split(" -> ");return C(n.at(-1)??a)})}o(Fe,"parseGitStatusPaths");async function pe(e,t,a){let n=await e("git",["diff","--name-only","-z",a,"--","."],t);return h(n,"Unable to inspect Agent candidate paths."),[...new Set(n.stdout.split("\0").map(C).filter(r=>r!=="."&&!me(r)))]}o(pe,"gitChangedPaths");async function ge(e){for(let t of e.paths){let a=await B(e.command,e.repoPath,["rev-parse",`${e.commit}:${t}`]),n=w.join(e.repoPath,...t.split("/"));if(!a){if(ue(n))return!1;continue}if(!ue(n))return!1;let r=await B(e.command,e.repoPath,["hash-object","--",t]);if(!r||r!==a)return!1}return!0}o(ge,"workingTreeMatchesCommit");async function ze(e,t){let a=new Set(["node_modules",w.posix.join(C(e.profileRelativePath),"node_modules"),w.posix.join(C(e.sourceRootRelativePath),"node_modules")]);for(let n of a){let r=w.join(e.repoPath,...n.split("/")),s=w.join(t,...n.split("/"));!await Jt(r)||ue(s)||(await Be(w.dirname(s),{recursive:!0}),await Dt(r,s,process.platform==="win32"?"junction":"dir"))}}o(ze,"linkCandidateDependencies");async function We(e){let t=await e.command("git",["diff","--binary","HEAD","--",".",":(exclude)**/tasksets/**"],e.repoPath);if(h(t,"Unable to capture active Profile changes."),t.stdout){let i=w.join(e.workspaceRoot,"active-profile.patch");await Bt(i,t.stdout,"utf8");let d=await e.command("git",["apply","--whitespace=nowarn",i],e.worktreePath);h(d,"Unable to apply active Profile changes to the candidate baseline."),await Nt(i,{force:!0})}let a=await e.command("git",["ls-files","--others","--exclude-standard","-z"],e.repoPath);h(a,"Unable to inspect untracked Profile source.");for(let i of a.stdout.split("\0").filter(Ut)){let d=w.join(e.repoPath,...i.split("/")),u=w.join(e.worktreePath,...i.split("/"));await Be(w.dirname(u),{recursive:!0}),await Mt(d,u,{recursive:!0,preserveTimestamps:!0})}let n=await e.command("git",["add","-A"],e.worktreePath);h(n,"Unable to stage the active Profile snapshot.");let r=await e.command("git",["diff","--cached","--quiet"],e.worktreePath);if(r.code===0)return;r.code!==1&&h(r,"Unable to inspect the active Profile snapshot.");let s=await e.command("git",["commit","-m","Snapshot active Profile before OpenPond improvement"],e.worktreePath,Q());h(s,"Unable to commit the active Profile snapshot.")}o(We,"snapshotActiveProfileChanges");function Ut(e){return e?!C(e).split("/").some(a=>a==="node_modules"||a===".openpond"||a==="artifacts"||a==="tasksets"):!1}o(Ut,"snapshotEligiblePath");function Q(){return{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"}}o(Q,"gitIdentityEnv");async function Jt(e){try{return(await Gt(e)).isDirectory()}catch{return!1}}o(Jt,"directoryExists");async function Ke(e,t,a){let n=await e("gh",["pr","list","--head",a,"--state","all","--json","number,url,state,mergedAt,mergeCommit,baseRefName,headRefName","--limit","20"],t);h(n,"Unable to inspect existing Agent improvement pull requests.");let r=JSON.parse(n.stdout);return Array.isArray(r)?r.filter(s=>!!(s&&typeof s=="object")):[]}o(Ke,"listPullRequestsForBranch");function fe(e,t=new Date().toISOString(),a=new Date().toISOString()){let n=typeof e.number=="number"?e.number:Number(e.number),r=typeof e.state=="string"?e.state.toLowerCase():"",i=N(e.mergedAt)||r==="merged"?"merged":r==="open"?"open":"closed",d=e.mergeCommit&&typeof e.mergeCommit=="object"?e.mergeCommit:null,u=N(d?.oid)??N(e.mergeCommit),m=N(e.url),c=N(e.baseRefName),g=N(e.headRefName);if(!Number.isInteger(n)||n<=0||!m||!c||!g)throw new Error("GitHub returned an incomplete pull request payload.");return{provider:"github",number:n,url:m,state:i,baseBranch:c,headBranch:g,mergeCommit:u,openedAt:t,updatedAt:a}}o(fe,"normalizePullRequest");function Ve(e,t){return`openpond/improve/${D(t)}/${D(e.id).slice(0,36)}`}o(Ve,"candidateBranch");function U(e){if(!e.worktreePath)throw new Error("Agent candidate worktree is unavailable.");return e.worktreePath}o(U,"requireWorktreePath");function Ye(e){let t=e.replace(/^git@github\.com:/i,"").replace(/^https?:\/\/github\.com\//i,"").replace(/\.git$/i,"").replace(/^\/+|\/+$/g,"");return/^[^/]+\/[^/]+$/.test(t)?t:null}o(Ye,"githubRepoFromRemote");function C(e){return e.replaceAll("\\","/").replace(/^\.\//,"").replace(/^\/+|\/+$/g,"")||"."}o(C,"normalizeRepoPath");function D(e){return e.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||"candidate"}o(D,"safePathSegment");async function y(e,t,a,n){let r=await e("git",a,t);h(r,n);let s=r.stdout.trim();if(!s)throw new Error(n);return s}o(y,"requiredGitText");async function B(e,t,a){let n=await e("git",a,t);return n.code===0&&n.stdout.trim()?n.stdout.trim():null}o(B,"optionalGitText");function h(e,t){if(e.code!==0)throw new Error(e.stderr.trim()||e.stdout.trim()||t)}o(h,"assertCommand");function N(e){return typeof e=="string"&&e.trim()?e.trim():null}o(N,"stringValue");function T(e,t,a,n={}){return be(e,t,a,n)}o(T,"defaultCommandRunner");function et(e,t){let a=U(t);if(!Z(a))throw new Error("The existing Agent candidate worktree is no longer available.");let n=C(e.profileRelativePath),r=C(e.sourceRootRelativePath);return{target:{...e,repoPath:a,workspaceRoot:a,sourcePath:S.join(a,...n.split("/")),sourceRoot:S.join(a,...r.split("/"))},git:t}}o(et,"restoreAgentImprovementWorkspace");async function tt(e){let t=e.command??T,a=await y(t,e.target.repoPath,["rev-parse","--show-toplevel"],"Profile source is not a Git repository."),[n,r]=await Promise.all([Qe(a),Qe(e.target.repoPath)]);if(n!==r)throw new Error("Profile repo path does not match the Git repository root.");let s=await t("git",["status","--porcelain=v1","-uall"],a);h(s,"Unable to inspect Profile Git status.");let[i,d,u]=await Promise.all([y(t,a,["rev-parse","HEAD"],"Profile Git repo has no HEAD commit."),y(t,a,["branch","--show-current"],"Profile Git repo must be on a branch."),B(t,a,["remote","get-url","origin"])]);if(e.run.adapter.kind==="local"&&e.run.adapter.localHead&&e.run.adapter.localHead!==i)throw new Error(`Profile source changed from ${e.run.adapter.localHead.slice(0,12)} to ${i.slice(0,12)}. Re-plan the improvement against the current source.`);let m=Ve(e.run,e.target.agentId),c=S.join(Ze.tmpdir(),"openpond-agent-improvements",D(S.basename(a)||"profile"),D(e.run.id)),g=S.join(c,"repo");await Xe(c,{recursive:!0});let l=await t("git",["show-ref","--verify","--quiet",`refs/heads/${m}`],a);if(Z(g)&&await B(t,g,["branch","--show-current"])!==m&&(await t("git",["worktree","remove","--force",g],a),await he(c,{recursive:!0,force:!0}),await Xe(c,{recursive:!0})),!Z(g)){let P=l.code===0?["worktree","add",g,m]:["worktree","add","-b",m,g,i],R=await t("git",P,a);h(R,"Unable to create the Agent candidate worktree.")}s.stdout.trim()&&await We({command:t,repoPath:a,worktreePath:g,workspaceRoot:c});let p=await y(t,g,["rev-parse","HEAD"],"Agent candidate worktree has no baseline commit.");if(await y(t,g,["rev-parse","HEAD"],"Agent candidate worktree has no HEAD commit.")!==p)throw new Error("Agent candidate baseline could not be resolved.");await ze(e.target,g);let b=C(e.target.profileRelativePath),f=C(e.target.sourceRootRelativePath);return{target:{...e.target,repoPath:g,workspaceRoot:g,sourcePath:S.join(g,...b.split("/")),sourceRoot:S.join(g,...f.split("/"))},git:{baseBranch:d,baseCommit:p,branch:m,headCommit:null,remoteName:"origin",remoteUrl:u,worktreePath:g,changedPaths:[],diffStat:null,pullRequest:null}}}o(tt,"prepareAgentImprovementWorkspace");async function at(e){let t=e.command??T,a=U(e.workspace.git),n=await t("git",["status","--porcelain=v1","-uall"],a);h(n,"Unable to inspect Agent candidate changes.");let r=Fe(n.stdout).filter(g=>!me(g));if(r.length===0)throw new Error("The Agent improvement produced no source changes.");let s=Ue(e.run,e.activeTarget),i=r.filter(g=>!Je(g,s));if(i.length>0)throw new Error(`Agent candidate changed paths outside the approved scope: ${i.join(", ")}`);let d=await t("git",["add","--",...r],a);h(d,"Unable to stage Agent candidate changes.");let u=await t("git",["commit","-m",`Improve ${e.run.target.displayName??e.activeTarget.agentId} via OpenPond`],a,Q());h(u,"Unable to commit Agent candidate changes.");let m=await y(t,a,["rev-parse","HEAD"],"Agent candidate commit was not created."),c=await B(t,a,["diff","--stat",`${e.workspace.git.baseCommit}..${m}`]);return{...e.workspace.git,headCommit:m,changedPaths:r,diffStat:c}}o(at,"commitAgentImprovementCandidate");async function Va(e){let t=e.command??T,a=U(e.git);if(!e.git.headCommit)throw new Error("Agent candidate has no commit to push.");if(!e.git.remoteUrl||!Ye(e.git.remoteUrl))throw new Error("Agent candidate is ready locally. Configure a GitHub origin remote before opening a pull request.");let n=await t("git",["push","--set-upstream",e.git.remoteName,e.git.branch],a);h(n,"Unable to push the Agent candidate branch.");let r=await Ke(t,a,e.git.branch);if(r.length>0)return fe(r[0],e.timestamp);let s=`Improve ${e.run.target.displayName??e.run.target.id??"Agent"}`,i=["## OpenPond Agent improvement","",e.run.objective,"","## Evaluation","",e.evaluationSummary,"",`Create/Improve run: \`${e.run.id}\``,`Base commit: \`${e.git.baseCommit}\``,`Candidate commit: \`${e.git.headCommit}\``].join(`
|
|
5
|
+
`)}o(At,"localCreatePipelinePrompt");function xt(e){for(let t of e.plan?.sourcePlan??[]){let a=/^agents\/([^/]+)/.exec(t.path),n=qe(a?.[1]);if(n)return n}return null}o(xt,"agentIdFromSourcePlan");function qe(e){let t=e?.trim();return t&&t.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||null}o(qe,"normalizeAgentId");function Et(e){return e?.trim()||null}o(Et,"normalizeActionId");function M(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}o(M,"asRecord");function Tt(e,t){let a=`${t}.`;return e.startsWith(a)?e.slice(a.length)||"chat":e}o(Tt,"sourceActionIdForAgent");function St(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64).replace(/-+$/g,"")||"generated-agent"}o(St,"slugFromObjective");function je(e){return e.replace(/\\/g,"/")||"."}o(je,"normalizeRelativePath");import de from"node:path";function Pa(e){let t=e.sources.length?e.sources.map(r=>({kind:"conversation",id:r.id,sourceHash:r.sourceHash,excerptRef:`training-source:${r.id}`})):[{kind:"manual_intent",id:`manual_intent_${$(e.objective).slice(0,24)}`,sourceHash:$({objective:e.objective}),excerptRef:null}],a={consent:{status:"granted",scope:e.sources.length?"selected_turns":"direct_intent",reviewedBy:"local_user",reviewedAt:e.timestamp},sources:t,reviewerIntent:e.objective},n=$(a);return re.parse({schemaVersion:"openpond.createImprove.evidenceSnapshot.v1",id:`evidence_snapshot_${n.slice(0,24)}`,contentHash:n,...a,createdAt:e.timestamp,metadata:{immutable:!0,sourceCount:t.length}})}o(Pa,"createEvidenceSnapshot");function Ia(e){let t={runId:e.run.id,candidateId:e.candidateId,tasksetId:e.run.tasksetRef?.id??null,tasksetRevision:e.run.tasksetRef?.revision??null,tasksetHash:e.run.tasksetRef?.contentHash??null,outcome:e.outcome,reason:e.reason,receiptRefs:e.receiptRefs},a=$(t);return re.parse({schemaVersion:"openpond.createImprove.evidenceSnapshot.v1",id:`evidence_outcome_${a.slice(0,24)}`,contentHash:a,consent:{status:"granted",scope:"direct_intent",reviewedBy:e.run.actor.id??"local_user",reviewedAt:e.timestamp},sources:[{kind:"artifact",id:`${e.outcome}:${e.run.id}:${e.candidateId}`,sourceHash:a,excerptRef:e.receiptRefs[0]??null}],reviewerIntent:e.reason,createdAt:e.timestamp,metadata:{immutable:!0,evidenceKind:"candidate_outcome",outcome:e.outcome,priorTasksetRevision:e.run.tasksetRef?.revision??null,recommendedNextTasksetRevision:e.run.tasksetRef?e.run.tasksetRef.revision+1:1,receiptRefs:e.receiptRefs}})}o(Ia,"createOutcomeEvidenceSnapshot");function ya(e){let t=e.proposal?$t(e.proposal):{kind:"model",rationale:["A reviewed training plan selected Model execution for this Taskset."],confidence:1};return Pe.parse({schemaVersion:"openpond.createImprove.tasksetRef.v1",id:e.taskset.id,revision:e.taskset.revision,contentHash:e.taskset.contentHash,evidenceSnapshotIds:e.evidenceSnapshotIds,policyBoundary:e.taskset.policy,targetRecommendation:t,authoringSplitRefs:e.taskset.tasks.filter(a=>a.split==="train"||a.split==="validation").map(a=>a.id),privateSplitRefs:e.taskset.tasks.filter(a=>a.split==="test"||a.split==="frozen_eval").map(a=>a.id),approvedBy:"local_user",approvedAt:e.approvedAt,metadata:{immutable:!0,taskCreationProposalId:e.proposal?.id??null}})}o(ya,"createTasksetRef");function Me(e,t){if(e.id!==t.id||e.revision!==t.revision||e.contentHash!==t.contentHash)throw new Error(`Taskset lineage mismatch: the run approved ${e.id}@${e.revision} (${e.contentHash}), but execution resolved ${t.id}@${t.revision} (${t.contentHash}).`)}o(Me,"assertTasksetRefMatches");function $t(e){let t=_t(e);return{kind:t,rationale:e.diagnosis.rationale.length?e.diagnosis.rationale:[`${t} best matches the reviewed behavior boundary.`],confidence:e.diagnosis.confidence}}o($t,"recommendationForProposal");function _t(e){return e.diagnosis.trainingEligible?"model":e.diagnosis.intervention==="retrieval"?"configuration":"agent"}o(_t,"targetKindForProposal");async function Ge(e){let t=e.run.tasksetRef;if(!t)throw new Error("Agent Taskset execution requires an approved Taskset ref.");if(Me(t,e.taskset),e.taskset.environment.kind!=="agent")throw new Error(`Taskset ${e.taskset.id} is not an Agent-shaped Taskset.`);let a=new Set(t.privateSplitRefs),n=e.taskset.tasks.filter(c=>a.has(c.id));if(!n.length||n.length!==a.size)throw new Error("The approved Agent Taskset private split could not be resolved exactly.");let r={tasksetId:t.id,tasksetRevision:t.revision,tasksetHash:t.contentHash,taskRefs:n.map(c=>c.id),seed:0,timeoutMs:e.taskset.environment.defaultTimeoutMs,entrypoint:e.taskset.environment.entrypoint,evaluator:"openpond-agent-sdk-taskset.v1"},s=$(r),i=[],d=[],u=[];for(let c of n){let g=new Date().toISOString(),l=Date.now(),p=await(e.execute??H)({cwd:e.cwd,command:"run",args:[e.taskset.environment.entrypoint,"--json","--input",JSON.stringify({...c.input,channel:"manual"})],timeoutMs:e.taskset.environment.defaultTimeoutMs,throwOnFailure:!1}),x=p.code===0?jt(p.stdout):null,b=`agent_task_attempt_${$([e.run.id,e.subject,e.sourceCommit,t.contentHash,c.id,0]).slice(0,24)}`,f=Ot(x?.traceArtifactRef),P=Ce.parse({schemaVersion:"openpond.taskAttempt.v1",id:b,tasksetId:e.taskset.id,taskId:c.id,split:c.split,attempt:0,seed:0,modelRef:null,startedAt:g,completedAt:new Date().toISOString(),output:ce(x?.result),runtimeEventRefs:f?[f]:[],artifactRefs:f?[f]:[],privilegedOutcomeRef:c.privilegedContextRef,infrastructureError:p.code===0?null:p.stderr.trim().slice(0,1e4)||`Agent SDK action exited with code ${String(p.code)}.`,costUsd:0,latencyMs:Math.max(0,Date.now()-l),userInterventions:0,metadata:{executor:"openpond-agent-sdk",trustedTasksetExecution:!0,tasksetRevision:t.revision,tasksetHash:t.contentHash,sourceCommit:e.sourceCommit,subject:e.subject,executionContractHash:s}}),R=await e.gradeAttempt({tasksetId:e.taskset.id,taskId:c.id,attempt:P});d.push(P.id),i.push(R),f&&u.push(f)}let m=i.filter(c=>c.passed).length;return{taskAttemptRefs:d,gradeRefs:i.map(c=>c.id),taskRefs:n.map(c=>c.id),artifactRefs:[...new Set(u)],total:i.length,passed:m,failed:i.length-m,executionContractHash:s}}o(Ge,"executeAgentTasksetEvaluation");function jt(e){let t=e.trim();if(!t)return null;try{return ce(JSON.parse(t))}catch{let a=t.indexOf("{"),n=t.lastIndexOf("}");if(a<0||n<=a)return null;try{return ce(JSON.parse(t.slice(a,n+1)))}catch{return null}}}o(jt,"parseAgentRunPayload");function ce(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}o(ce,"recordValue");function Ot(e){return typeof e=="string"&&e.trim()?e.trim():null}o(Ot,"stringValue");async function le(e){let t=await(e.execute??H)({cwd:e.cwd,command:"eval",args:["--json"],throwOnFailure:!1}),a=qt(t.stdout),n=G(a.summary?.total)??0,r=G(a.summary?.passed)??0,s=G(a.summary?.failed)??Math.max(0,n-r),i=a.publishGate?.status==="passed"?"passed":"failed",d=Array.isArray(a.results)?a.results:[],u=d.map(R=>I(R.name)).filter(R=>!!R),m=new Set([de.posix.join(e.sourceRef,".openpond/eval-results.json")]);for(let R of d){let _=I(R.traceArtifactRef);_&&m.add(de.posix.join(e.sourceRef,Ne(_)));for(let J of De(R.artifacts))m.add(de.posix.join(e.sourceRef,Ne(J)))}let c=e.run.tasksetRef?await Ge({run:e.run,taskset:Ht(e.taskset),cwd:e.cwd,sourceCommit:e.sourceCommit,subject:e.subject,gradeAttempt:Lt(e.gradeAttempt),execute:e.execute}):null;for(let R of c?.artifactRefs??[])m.add(R);let g=n+(c?.total??0),l=r+(c?.passed??0),p=s+(c?.failed??0),x=[...new Set([...u,...c?.taskRefs??[]])],b=i==="passed"&&(c?.failed??0)===0?"passed":"failed",f=t.code===0&&p===0&&b==="passed"?"passed":"failed",P=e.timestamp??new Date().toISOString();return{id:`agent_eval_${e.run.id}_${e.subject}_${e.sourceCommit.slice(0,12)}`,candidateId:e.candidateId,target:e.run.target,evaluatorKind:"agent_sdk",subject:e.subject,sourceCommit:e.sourceCommit,sourceBranch:e.sourceBranch,tasksetId:e.run.tasksetRef?.id??null,tasksetHash:e.run.tasksetRef?.contentHash??null,taskAttemptRefs:c?.taskAttemptRefs??u,status:f,publishGate:b,summaryCounts:{total:g,passed:l,failed:p},evalRefs:x,artifactRefs:[...m],summary:`${e.subject==="active"?"Active":e.subject==="candidate"?"Candidate":"Post-release"} Agent SDK and Taskset Evals: ${l}/${g} passed${b==="failed"?"; publish gate failed":""}.`,createdAt:P,metadata:{schemaVersion:I(a.schemaVersion),schema:I(a.schema),project:{name:I(a.project?.name),version:I(a.project?.version)},source:{configPath:I(a.source?.configPath),configHash:I(a.source?.configHash)},publishGate:{total:G(a.publishGate?.total),passed:G(a.publishGate?.passed),failed:G(a.publishGate?.failed),blockingFailures:De(a.publishGate?.blockingFailures)},command:{code:t.code,timedOut:t.timedOut,stderr:t.stderr.trim().slice(0,4e3)},trustedTasksetExecution:!!c,tasksetRevision:e.run.tasksetRef?.revision??null,executionContractHash:c?.executionContractHash??null,gradeRefs:c?.gradeRefs??[],results:d.map(R=>({name:I(R.name),status:I(R.status),error:I(R.error),traceArtifactRef:I(R.traceArtifactRef)}))}}}o(le,"runNormalizedAgentEvaluation");function Ht(e){if(!e)throw new Error("The approved Agent Taskset could not be resolved for evaluation.");return e}o(Ht,"requireTaskset");function Lt(e){if(!e)throw new Error("Trusted Taskset grading is unavailable for Agent evaluation.");return e}o(Lt,"requireGradeAttempt");function qt(e){let t=e.trim();if(!t)throw new Error("Agent SDK Eval returned no JSON output.");try{return JSON.parse(t)}catch{let a=t.indexOf("{"),n=t.lastIndexOf("}");if(a>=0&&n>a)try{return JSON.parse(t.slice(a,n+1))}catch{}throw new Error("Agent SDK Eval returned invalid JSON output.")}}o(qt,"parseAgentEvalPayload");function Ne(e){return e.replace(/^\.\//,"").replaceAll("\\","/")}o(Ne,"normalizeRef");function I(e){return typeof e=="string"&&e.trim()?e.trim():null}o(I,"stringValue");function G(e){return typeof e=="number"&&Number.isFinite(e)?e:null}o(G,"numberValue");function De(e){return Array.isArray(e)?e.map(I).filter(t=>!!t):[]}o(De,"stringArray");import{existsSync as Z}from"node:fs";import{mkdir as Xe,realpath as Qe,rm as he,writeFile as Ft}from"node:fs/promises";import Ze from"node:os";import S from"node:path";import{existsSync as ue}from"node:fs";import{cp as Mt,lstat as Gt,mkdir as Be,rm as Nt,symlink as Dt,writeFile as Bt}from"node:fs/promises";import w from"node:path";function Ue(e,t){let a=C(t.profileRelativePath),n=[C(t.sourceRootRelativePath),w.posix.join(a,"evals"),w.posix.join(a,"settings"),w.posix.join(a,"package.json"),w.posix.join(a,"tsconfig.json"),w.posix.join(a,"openpond.lock"),w.posix.join(a,".gitignore"),"openpond-profile.json"],r=(e.plan?.sourcePlan??[]).flatMap(s=>{let i=C(s.path);return i?i==="."||i.startsWith(`${a}/`)?[i]:[w.posix.join(a,i),i]:[]});return[...new Set([...n,...r])]}o(Ue,"allowedAgentImprovementPaths");function Je(e,t){let a=C(e);return t.some(n=>a===n||a.startsWith(`${n}/`))}o(Je,"pathAllowed");function me(e){return C(e).split("/").some(a=>a==="node_modules"||a===".openpond"||a==="artifacts")}o(me,"isCandidateRuntimePath");function Fe(e){return e.split(/\r?\n/).map(t=>t.trimEnd()).filter(Boolean).map(t=>{let a=t.slice(3),n=a.split(" -> ");return C(n.at(-1)??a)})}o(Fe,"parseGitStatusPaths");async function pe(e,t,a){let n=await e("git",["diff","--name-only","-z",a,"--","."],t);return h(n,"Unable to inspect Agent candidate paths."),[...new Set(n.stdout.split("\0").map(C).filter(r=>r!=="."&&!me(r)))]}o(pe,"gitChangedPaths");async function ge(e){for(let t of e.paths){let a=await B(e.command,e.repoPath,["rev-parse",`${e.commit}:${t}`]),n=w.join(e.repoPath,...t.split("/"));if(!a){if(ue(n))return!1;continue}if(!ue(n))return!1;let r=await B(e.command,e.repoPath,["hash-object","--",t]);if(!r||r!==a)return!1}return!0}o(ge,"workingTreeMatchesCommit");async function ze(e,t){let a=new Set(["node_modules",w.posix.join(C(e.profileRelativePath),"node_modules"),w.posix.join(C(e.sourceRootRelativePath),"node_modules")]);for(let n of a){let r=w.join(e.repoPath,...n.split("/")),s=w.join(t,...n.split("/"));!await Jt(r)||ue(s)||(await Be(w.dirname(s),{recursive:!0}),await Dt(r,s,process.platform==="win32"?"junction":"dir"))}}o(ze,"linkCandidateDependencies");async function We(e){let t=await e.command("git",["diff","--binary","HEAD","--",".",":(exclude)**/tasksets/**"],e.repoPath);if(h(t,"Unable to capture active Profile changes."),t.stdout){let i=w.join(e.workspaceRoot,"active-profile.patch");await Bt(i,t.stdout,"utf8");let d=await e.command("git",["apply","--whitespace=nowarn",i],e.worktreePath);h(d,"Unable to apply active Profile changes to the candidate baseline."),await Nt(i,{force:!0})}let a=await e.command("git",["ls-files","--others","--exclude-standard","-z"],e.repoPath);h(a,"Unable to inspect untracked Profile source.");for(let i of a.stdout.split("\0").filter(Ut)){let d=w.join(e.repoPath,...i.split("/")),u=w.join(e.worktreePath,...i.split("/"));await Be(w.dirname(u),{recursive:!0}),await Mt(d,u,{recursive:!0,preserveTimestamps:!0})}let n=await e.command("git",["add","-A"],e.worktreePath);h(n,"Unable to stage the active Profile snapshot.");let r=await e.command("git",["diff","--cached","--quiet"],e.worktreePath);if(r.code===0)return;r.code!==1&&h(r,"Unable to inspect the active Profile snapshot.");let s=await e.command("git",["commit","-m","Snapshot active Profile before OpenPond improvement"],e.worktreePath,Q());h(s,"Unable to commit the active Profile snapshot.")}o(We,"snapshotActiveProfileChanges");function Ut(e){return e?!C(e).split("/").some(a=>a==="node_modules"||a===".openpond"||a==="artifacts"||a==="tasksets"):!1}o(Ut,"snapshotEligiblePath");function Q(){return{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"}}o(Q,"gitIdentityEnv");async function Jt(e){try{return(await Gt(e)).isDirectory()}catch{return!1}}o(Jt,"directoryExists");async function Ke(e,t,a){let n=await e("gh",["pr","list","--head",a,"--state","all","--json","number,url,state,mergedAt,mergeCommit,baseRefName,headRefName","--limit","20"],t);h(n,"Unable to inspect existing Agent improvement pull requests.");let r=JSON.parse(n.stdout);return Array.isArray(r)?r.filter(s=>!!(s&&typeof s=="object")):[]}o(Ke,"listPullRequestsForBranch");function fe(e,t=new Date().toISOString(),a=new Date().toISOString()){let n=typeof e.number=="number"?e.number:Number(e.number),r=typeof e.state=="string"?e.state.toLowerCase():"",i=N(e.mergedAt)||r==="merged"?"merged":r==="open"?"open":"closed",d=e.mergeCommit&&typeof e.mergeCommit=="object"?e.mergeCommit:null,u=N(d?.oid)??N(e.mergeCommit),m=N(e.url),c=N(e.baseRefName),g=N(e.headRefName);if(!Number.isInteger(n)||n<=0||!m||!c||!g)throw new Error("GitHub returned an incomplete pull request payload.");return{provider:"github",number:n,url:m,state:i,baseBranch:c,headBranch:g,mergeCommit:u,openedAt:t,updatedAt:a}}o(fe,"normalizePullRequest");function Ve(e,t){return`openpond/improve/${D(t)}/${D(e.id).slice(0,36)}`}o(Ve,"candidateBranch");function U(e){if(!e.worktreePath)throw new Error("Agent candidate worktree is unavailable.");return e.worktreePath}o(U,"requireWorktreePath");function Ye(e){let t=e.replace(/^git@github\.com:/i,"").replace(/^https?:\/\/github\.com\//i,"").replace(/\.git$/i,"").replace(/^\/+|\/+$/g,"");return/^[^/]+\/[^/]+$/.test(t)?t:null}o(Ye,"githubRepoFromRemote");function C(e){return e.replaceAll("\\","/").replace(/^\.\//,"").replace(/^\/+|\/+$/g,"")||"."}o(C,"normalizeRepoPath");function D(e){return e.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||"candidate"}o(D,"safePathSegment");async function y(e,t,a,n){let r=await e("git",a,t);h(r,n);let s=r.stdout.trim();if(!s)throw new Error(n);return s}o(y,"requiredGitText");async function B(e,t,a){let n=await e("git",a,t);return n.code===0&&n.stdout.trim()?n.stdout.trim():null}o(B,"optionalGitText");function h(e,t){if(e.code!==0)throw new Error(e.stderr.trim()||e.stdout.trim()||t)}o(h,"assertCommand");function N(e){return typeof e=="string"&&e.trim()?e.trim():null}o(N,"stringValue");function T(e,t,a,n={}){return be(e,t,a,n)}o(T,"defaultCommandRunner");function et(e,t){let a=U(t);if(!Z(a))throw new Error("The existing Agent candidate worktree is no longer available.");let n=C(e.profileRelativePath),r=C(e.sourceRootRelativePath);return{target:{...e,repoPath:a,workspaceRoot:a,sourcePath:S.join(a,...n.split("/")),sourceRoot:S.join(a,...r.split("/"))},git:t}}o(et,"restoreAgentImprovementWorkspace");async function tt(e){let t=e.command??T,a=await y(t,e.target.repoPath,["rev-parse","--show-toplevel"],"Profile source is not a Git repository."),[n,r]=await Promise.all([Qe(a),Qe(e.target.repoPath)]);if(n!==r)throw new Error("Profile repo path does not match the Git repository root.");let s=await t("git",["status","--porcelain=v1","-uall"],a);h(s,"Unable to inspect Profile Git status.");let[i,d,u]=await Promise.all([y(t,a,["rev-parse","HEAD"],"Profile Git repo has no HEAD commit."),y(t,a,["branch","--show-current"],"Profile Git repo must be on a branch."),B(t,a,["remote","get-url","origin"])]);if(e.run.adapter.kind==="local"&&e.run.adapter.localHead&&e.run.adapter.localHead!==i)throw new Error(`Profile source changed from ${e.run.adapter.localHead.slice(0,12)} to ${i.slice(0,12)}. Re-plan the improvement against the current source.`);let m=Ve(e.run,e.target.agentId),c=S.join(Ze.tmpdir(),"openpond-agent-improvements",D(S.basename(a)||"profile"),D(e.run.id)),g=S.join(c,"repo");await Xe(c,{recursive:!0});let l=await t("git",["show-ref","--verify","--quiet",`refs/heads/${m}`],a);if(Z(g)&&await B(t,g,["branch","--show-current"])!==m&&(await t("git",["worktree","remove","--force",g],a),await he(c,{recursive:!0,force:!0}),await Xe(c,{recursive:!0})),!Z(g)){let P=l.code===0?["worktree","add",g,m]:["worktree","add","-b",m,g,i],R=await t("git",P,a);h(R,"Unable to create the Agent candidate worktree.")}s.stdout.trim()&&await We({command:t,repoPath:a,worktreePath:g,workspaceRoot:c});let p=await y(t,g,["rev-parse","HEAD"],"Agent candidate worktree has no baseline commit.");if(await y(t,g,["rev-parse","HEAD"],"Agent candidate worktree has no HEAD commit.")!==p)throw new Error("Agent candidate baseline could not be resolved.");await ze(e.target,g);let b=C(e.target.profileRelativePath),f=C(e.target.sourceRootRelativePath);return{target:{...e.target,repoPath:g,workspaceRoot:g,sourcePath:S.join(g,...b.split("/")),sourceRoot:S.join(g,...f.split("/"))},git:{baseBranch:d,baseCommit:p,branch:m,headCommit:null,remoteName:"origin",remoteUrl:u,worktreePath:g,changedPaths:[],diffStat:null,pullRequest:null}}}o(tt,"prepareAgentImprovementWorkspace");async function at(e){let t=e.command??T,a=U(e.workspace.git),n=await t("git",["status","--porcelain=v1","-uall"],a);h(n,"Unable to inspect Agent candidate changes.");let r=Fe(n.stdout).filter(g=>!me(g));if(r.length===0)throw new Error("The Agent improvement produced no source changes.");let s=Ue(e.run,e.activeTarget),i=r.filter(g=>!Je(g,s));if(i.length>0)throw new Error(`Agent candidate changed paths outside the approved scope: ${i.join(", ")}`);let d=await t("git",["add","--",...r],a);h(d,"Unable to stage Agent candidate changes.");let u=await t("git",["commit","-m",`Improve ${e.run.target.displayName??e.activeTarget.agentId} via OpenPond`],a,Q());h(u,"Unable to commit Agent candidate changes.");let m=await y(t,a,["rev-parse","HEAD"],"Agent candidate commit was not created."),c=await B(t,a,["diff","--stat",`${e.workspace.git.baseCommit}..${m}`]);return{...e.workspace.git,headCommit:m,changedPaths:r,diffStat:c}}o(at,"commitAgentImprovementCandidate");async function Va(e){let t=e.command??T,a=U(e.git);if(!e.git.headCommit)throw new Error("Agent candidate has no commit to push.");if(!e.git.remoteUrl||!Ye(e.git.remoteUrl))throw new Error("Agent candidate is ready locally. Configure a GitHub origin remote before opening a pull request.");let n=await t("git",["push","--set-upstream",e.git.remoteName,e.git.branch],a);h(n,"Unable to push the Agent candidate branch.");let r=await Ke(t,a,e.git.branch);if(r.length>0)return fe(r[0],e.timestamp);let s=`Improve ${e.run.target.displayName??e.run.target.id??"Agent"}`,i=["## OpenPond Agent improvement","",e.run.objective,"","## Evaluation","",e.evaluationSummary,"",`Create/Improve run: \`${e.run.id}\``,`Base commit: \`${e.git.baseCommit}\``,`Candidate commit: \`${e.git.headCommit}\``].join(`
|
|
6
6
|
`),d=await t("gh",["pr","create","--base",e.git.baseBranch,"--head",e.git.branch,"--title",s,"--body",i],a);h(d,"Unable to create the Agent improvement pull request.");let u=d.stdout.trim().split(/\s+/).find(m=>/^https:\/\/github\.com\//.test(m));if(!u)throw new Error("GitHub did not return the created pull request URL.");return zt({git:{...e.git,pullRequest:null},pullRequestRef:u,command:t,timestamp:e.timestamp})}o(Va,"openAgentImprovementPullRequest");async function zt(e){let t=e.command??T,a=e.cwd??U(e.git),n=e.pullRequestRef??e.git.pullRequest?.url;if(!n)throw new Error("Agent candidate has no pull request reference.");let r=await t("gh",["pr","view",n,"--json","number,url,state,mergedAt,mergeCommit,baseRefName,headRefName"],a);return h(r,"Unable to inspect the Agent improvement pull request."),fe(JSON.parse(r.stdout),e.git.pullRequest?.openedAt??e.timestamp,e.timestamp)}o(zt,"inspectAgentImprovementPullRequest");async function Ya(e){let t=e.command??T,a=e.cwd??U(e.git),n=e.git.pullRequest?.url;if(!n)return;let r=await t("gh",["pr","close",n,"--delete-branch","--comment",e.reason],a);h(r,"Unable to close the Agent improvement pull request.")}o(Ya,"closeAgentImprovementPullRequest");async function Xa(e){let t=e.command??T,a=await t("git",["status","--porcelain=v1","-uall"],e.repoPath);if(h(a,"Unable to inspect the active Profile checkout."),a.stdout.trim())throw new Error("Active Profile source has uncommitted changes and cannot sync the merged PR.");let n=await y(t,e.repoPath,["branch","--show-current"],"Active Profile checkout is not on a branch.");if(n!==e.baseBranch)throw new Error(`Active Profile checkout is on ${n}, expected ${e.baseBranch}.`);let r=await t("git",["fetch",e.remoteName,e.baseBranch],e.repoPath);h(r,"Unable to fetch the merged Profile branch.");let s=await t("git",["merge","--ff-only",`${e.remoteName}/${e.baseBranch}`],e.repoPath);return h(s,"Unable to fast-forward the active Profile checkout to the merged PR."),y(t,e.repoPath,["rev-parse","HEAD"],"Unable to resolve the merged Profile commit.")}o(Xa,"syncMergedAgentImprovement");async function Qa(e){let t=e.command??T;if(!e.git.headCommit)throw new Error("Agent candidate has no commit to apply.");let[a,n]=await Promise.all([y(t,e.repoPath,["branch","--show-current"],"Active Profile checkout is not on a branch."),y(t,e.repoPath,["rev-parse","HEAD"],"Active Profile checkout has no HEAD commit.")]);if(a!==e.git.baseBranch)throw new Error(`Active Profile checkout is on ${a}, expected ${e.git.baseBranch}.`);if(e.run.adapter.kind==="local"&&e.run.adapter.localHead&&n!==e.run.adapter.localHead)throw new Error(`Active Profile moved from ${e.run.adapter.localHead.slice(0,12)} to ${n.slice(0,12)}. Re-run the improvement against the current Profile.`);let r=await pe(t,e.repoPath,`${n}..${e.git.headCommit}`),s=await pe(t,e.repoPath,`${e.git.baseCommit}..${e.git.headCommit}`);if(r.length===0||s.length===0)throw new Error("Agent candidate has no source changes to apply.");if(!await ge({command:t,repoPath:e.repoPath,commit:e.git.baseCommit,paths:r}))throw new Error("The active Profile changed after this candidate was created. Review those changes and run the improvement again.");let i=await t("git",["diff","--binary",`${e.git.baseCommit}..${e.git.headCommit}`,"--",...s],e.repoPath);if(h(i,"Unable to build the local Agent change."),!i.stdout.trim())throw new Error("Agent candidate produced an empty local change.");let d=S.join(Ze.tmpdir(),`openpond-agent-change-${D(e.run.id)}-${Date.now()}.patch`);await Ft(d,i.stdout,"utf8");let u=!1;try{let m=await t("git",["apply","--check","--whitespace=nowarn",d],e.repoPath);h(m,"The Agent change no longer applies cleanly to the active Profile.");let c=await t("git",["apply","--whitespace=nowarn",d],e.repoPath);if(h(c,"Unable to apply the Agent change to the active Profile."),u=!0,!await ge({command:t,repoPath:e.repoPath,commit:e.git.headCommit,paths:r}))throw new Error("The active Profile did not match the reviewed candidate after applying the change.");let g=await t("git",["add","-A","--",...r],e.repoPath);h(g,"Unable to stage the reviewed Agent change.");let l=await t("git",["commit","--only","-m",`Apply OpenPond change: ${e.run.target.displayName??e.run.target.id??"Agent"}`,"--",...r],e.repoPath,Q());h(l,"Unable to commit the reviewed Agent change."),u=!1;let p=await y(t,e.repoPath,["rev-parse","HEAD"],"Unable to resolve the applied Profile commit."),x=await t("git",["diff","--quiet",p,e.git.headCommit,"--",...r],e.repoPath);if(x.code===1)throw new Error("The committed Profile does not match the reviewed candidate.");return h(x,"Unable to verify the committed Agent change."),p}catch(m){throw u&&await t("git",["apply","--reverse","--whitespace=nowarn",d],e.repoPath).catch(()=>{}),m}finally{await he(d,{force:!0}).catch(()=>{})}}o(Qa,"applyAgentImprovementCandidateLocally");async function Za(e){let t=e.command??T;e.git.worktreePath&&Z(e.git.worktreePath)&&await t("git",["worktree","remove","--force",e.git.worktreePath],e.repoPath),e.deleteLocalBranch!==!1&&await t("git",["branch","-D",e.git.branch],e.repoPath),e.git.worktreePath&&await he(S.dirname(e.git.worktreePath),{recursive:!0,force:!0}).catch(()=>{})}o(Za,"cleanupAgentImprovementWorkspace");import{promises as Wt}from"node:fs";import Kt from"node:path";async function ot(e,t){let a=Kt.join(e,".openpond","agent-package-origin.json"),n=await Wt.readFile(a,"utf8").then(i=>Vt(JSON.parse(i))).catch(()=>({})),r=rt(n.versionId),s=rt(n.digest);return r&&s&&/^[a-f0-9]{64}$/.test(s)&&r===`agent-${s.slice(0,20)}`?{versionId:r,digest:s,validationReceiptIds:nt(n.validationReceiptIds),evalReceiptIds:nt(n.evalReceiptIds)}:{versionId:`manifest-${t.slice(0,20)}`,digest:null,validationReceiptIds:[],evalReceiptIds:[]}}o(ot,"readAgentPackageOrigin");function Vt(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}o(Vt,"asRecord");function rt(e){return typeof e=="string"&&e.trim()?e.trim():null}o(rt,"stringValue");function nt(e){return Array.isArray(e)?[...new Set(e.flatMap(t=>typeof t=="string"&&t.trim()?[t.trim()]:[]))]:[]}o(nt,"stringArray");async function it(e,t,a={}){if(e.operation!=="improve"||e.target.kind!=="agent"||e.adapter.kind!=="local"||e.state!=="applying_source"||e.plan?.status!=="approved")return e;let n=o(()=>new Date().toISOString(),"timestamp"),r=e;try{let s=se(e),i=e.tasksetRef?await t.resolveTaskset?.(e.tasksetRef.id,e.tasksetRef.revision,e.tasksetRef.contentHash)??null:null,d=i?Yt(e,i):null,u=`agent_candidate_${e.id}`,m=`candidate_authoring_${u}`,c=`evaluation_${u}_${e.tasksetRef?.revision??"sdk"}`,g=e.candidates.find(v=>v.id===u&&!!v.git?.worktreePath&&["draft","checking"].includes(v.status)),l=g?.git?et(s,g.git):await(a.prepareWorkspace??tt)({run:e,target:s}),p=await ot(s.sourceRoot,l.git.baseCommit),x={kind:"agent",id:s.agentId,displayName:e.target.displayName,defaultActionKey:s.defaultAction};g||(r=A(e,{candidates:[...e.candidates.filter(v=>v.id!==u),Qt({id:u,run:e,target:x,git:l.git,basePackageOrigin:p,timestamp:n()})],sourceRefs:j(e.sourceRefs,[`git:${l.git.baseCommit}`,l.git.branch]),externalExecutionRefs:ee(e.externalExecutionRefs,{kind:"candidate_authoring",id:m,status:"running",metadata:{candidateId:u,tasksetId:e.tasksetRef?.id??null,tasksetRevision:e.tasksetRef?.revision??null,tasksetHash:e.tasksetRef?.contentHash??null,authoringModel:e.metadata.authoringModel??t.model,allowedPaths:e.plan?.sourcePlan.map(v=>v.path)??[],startedAt:n()}}),metadata:{...e.metadata,...d?{tasksetAuthoringContext:d}:{},agentImprovement:{status:"authoring",candidateId:u,baseBranch:l.git.baseBranch,baseCommit:l.git.baseCommit,candidateBranch:l.git.branch}},updatedAt:n()}),await t.onRun(r),await(a.applySource??ie)({snapshot:r,session:t.session,turn:t.turn,target:l.target,ensureCodexRuntime:t.ensureCodexRuntime,appendRuntimeEvent:t.appendRuntimeEvent,setProviderTurnId:t.setProviderTurnId,model:t.model})),r=A(r,{state:"running_checks",candidates:r.candidates.map(v=>v.id===u?{...v,status:"checking",updatedAt:n()}:v),metadata:{...r.metadata,agentImprovement:{...te(r.metadata.agentImprovement),status:"running_checks"}},updatedAt:n()}),await t.onRun(r);let b=await(t.runChecks??a.runChecks??F)({snapshot:r,target:l.target,requireEvalPass:!1}),f=await(a.commitCandidate??at)({run:r,activeTarget:s,workspace:l});r=A(r,{state:"evaluating",candidates:r.candidates.map(v=>v.id===u?{...v,status:"authored",git:f,sourceRefs:j(v.sourceRefs,[`git:${f.headCommit}`,...f.changedPaths]),artifactRefs:j(v.artifactRefs,[`git-diff:${f.baseCommit}..${f.headCommit}`]),checkRefs:j(v.checkRefs,b.checkRefs),updatedAt:n()}:v),checkRefs:j(r.checkRefs,b.checkRefs),sourceRefs:j(r.sourceRefs,[`git:${f.headCommit}`,...f.changedPaths]),externalExecutionRefs:ee(ee(r.externalExecutionRefs,{kind:"candidate_authoring",id:m,status:"completed",metadata:{candidateId:u,tasksetId:r.tasksetRef?.id??null,tasksetRevision:r.tasksetRef?.revision??null,tasksetHash:r.tasksetRef?.contentHash??null,authoringModel:r.metadata.authoringModel??t.model,candidateCommit:f.headCommit,changedPaths:f.changedPaths,completedAt:n()}}),{kind:"evaluation",id:c,status:"running",metadata:{candidateId:u,subjects:["active","candidate"],tasksetId:r.tasksetRef?.id??null,tasksetRevision:r.tasksetRef?.revision??null,tasksetHash:r.tasksetRef?.contentHash??null,startedAt:n()}}),metadata:{...r.metadata,agentImprovement:{...te(r.metadata.agentImprovement),status:"evaluating",candidateCommit:f.headCommit,changedPaths:f.changedPaths,diffStat:f.diffStat,checks:b.metadata??{}}},updatedAt:n()}),await t.onRun(r);let[P,R]=await Promise.all([(a.evaluate??le)({run:r,cwd:s.sourceRoot,sourceRef:s.sourceRootRelativePath,sourceCommit:f.baseCommit,sourceBranch:f.baseBranch,candidateId:u,subject:"active",taskset:i,gradeAttempt:t.gradeTaskAttempt}),(a.evaluate??le)({run:r,cwd:l.target.sourceRoot,sourceRef:l.target.sourceRootRelativePath,sourceCommit:f.headCommit,sourceBranch:f.branch,candidateId:u,subject:"candidate",taskset:i,gradeAttempt:t.gradeTaskAttempt})]);Xt(r,P,R);let _=n(),J=[P.id,R.id];return A(r,{state:"awaiting_promotion",candidates:r.candidates.map(v=>v.id===u?{...v,status:"evaluated",git:f,evaluationReceiptRefs:j(v.evaluationReceiptRefs,J),updatedAt:_}:v),evaluationReceipts:[...r.evaluationReceipts.filter(v=>!J.includes(v.id)),P,R],externalExecutionRefs:ee(r.externalExecutionRefs,{kind:"evaluation",id:c,status:"completed",metadata:{candidateId:u,subjects:["active","candidate"],tasksetId:r.tasksetRef?.id??null,tasksetRevision:r.tasksetRef?.revision??null,tasksetHash:r.tasksetRef?.contentHash??null,receiptIds:J,executionContractHash:P.metadata.executionContractHash??null,completedAt:_}}),releaseOutcome:{...r.releaseOutcome,status:"not_requested",pullRequest:null,updatedAt:_},blockedReason:null,metadata:{...r.metadata,agentImprovement:{...te(r.metadata.agentImprovement),status:"awaiting_promotion",comparison:{active:st(P),candidate:st(R),candidatePassed:R.status==="passed"&&R.publishGate==="passed"}}},updatedAt:_})}catch(s){let i=n();return A(r,{state:"blocked",blockedReason:s instanceof Error?s.message:String(s),metadata:{...r.metadata,agentImprovement:{...te(r.metadata.agentImprovement),status:"blocked"}},externalExecutionRefs:r.externalExecutionRefs.map(d=>(d.kind==="candidate_authoring"||d.kind==="evaluation")&&d.status==="running"?{...d,status:"failed",metadata:{...d.metadata,error:s instanceof Error?s.message:String(s),failedAt:i}}:d),updatedAt:i})}}o(it,"authorAgentImprovementCandidate");function ee(e,t){return[...e.filter(a=>a.kind!==t.kind||a.id!==t.id),t]}o(ee,"mergeExecutionRef");function Yt(e,t){let a=e.tasksetRef;if(!a)throw new Error("Agent authoring requires an approved Taskset ref.");let n=new Set(a.authoringSplitRefs),r=t.tasks.filter(s=>n.has(s.id));if(r.length!==n.size)throw new Error("The approved Agent Taskset authoring split could not be resolved exactly.");return{tasksetId:a.id,tasksetRevision:a.revision,tasksetHash:a.contentHash,targetRecommendation:a.targetRecommendation,policyVisibleFields:a.policyBoundary.policyVisibleFields,tasks:r.map(s=>({id:s.id,split:s.split,input:s.input,expectedOutput:s.expectedOutput,tags:s.tags})),privateEvaluation:{caseCount:a.privateSplitRefs.length,contentsWithheld:!0}}}o(Yt,"publicTasksetAuthoringContext");function Xt(e,t,a){if(e.tasksetRef){for(let n of[t,a])if(n.tasksetId!==e.tasksetRef.id||n.tasksetHash!==e.tasksetRef.contentHash||n.metadata.trustedTasksetExecution!==!0)throw new Error("Agent comparison did not use the exact approved trusted Taskset execution.");if(typeof t.metadata.executionContractHash!="string"||t.metadata.executionContractHash!==a.metadata.executionContractHash)throw new Error("Active and candidate Agent evaluations used different Taskset execution contracts.")}}o(Xt,"assertMatchedTasksetExecutions");function Qt(e){return{id:e.id,target:e.target,status:"draft",git:e.git,parentCandidateId:null,tasksetRef:e.run.tasksetRef,authoringModelRef:typeof e.run.metadata.authoringModel=="string"?e.run.metadata.authoringModel:null,allowedPaths:e.run.plan?.sourcePlan.map(t=>t.path)??[],sourceRefs:[`git:${e.git.baseCommit}`,e.git.branch],artifactRefs:[],checkRefs:[],evaluationReceiptRefs:[],createdAt:e.timestamp,updatedAt:e.timestamp,metadata:{sourceAuthority:e.run.adapter.sourceAuthority,authoringModel:e.run.metadata.authoringModel??null,agentPackageLineage:{baseVersionId:e.basePackageOrigin.versionId,basePackageDigest:e.basePackageOrigin.digest,validationReceiptIds:e.basePackageOrigin.validationReceiptIds,evalReceiptIds:e.basePackageOrigin.evalReceiptIds,candidateBaseCommit:e.git.baseCommit}}}}o(Qt,"candidateRecord");function st(e){return{status:e.status,publishGate:e.publishGate,summaryCounts:e.summaryCounts,sourceCommit:e.sourceCommit}}o(st,"receiptComparison");function j(e,t){return[...new Set([...e,...t.filter(a=>!!a)])]}o(j,"mergeRefs");function te(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}o(te,"record");var Zt={kind:"agent",planningContext:ve,scaffold:Re,allowedPaths:ct,checks:ke,evalRefs:o(e=>e.context.evalRefs,"evalRefs"),canExecute:o(e=>e.target.kind==="agent"&&e.adapter.kind==="local"&&e.state==="applying_source"&&e.plan?.status==="approved","canExecute"),execute:o((e,t)=>e.operation==="improve"?it(e,t):He(e,{session:t.session,turn:t.turn,ensureCodexRuntime:t.ensureCodexRuntime,appendRuntimeEvent:t.appendRuntimeEvent,setProviderTurnId:t.setProviderTurnId,onSnapshot:t.onRun,model:t.model,runChecks:t.runChecks}),"execute"),normalizeResult:o(e=>e,"normalizeResult")},ae=o(e=>({kind:e,planningContext:ve,scaffold:Re,allowedPaths:ct,checks:ke,evalRefs:o(t=>t.context.evalRefs,"evalRefs"),canExecute:o(()=>!1,"canExecute"),execute:o(async t=>A(t,{state:"blocked",blockedReason:`${e} authoring is not registered in this OpenPond build.`,updatedAt:new Date().toISOString()}),"execute"),normalizeResult:o(t=>t,"normalizeResult")}),"unsupportedSourceTargetAdapter"),ea={kind:"model",planningContext:o(e=>({...ve(e),specializedEvaluator:"taskset"}),"planningContext"),scaffold:Re,allowedPaths:o(()=>[],"allowedPaths"),checks:ke,evalRefs:o(e=>[...e.context.evalRefs,...e.evaluationReceipts.flatMap(t=>t.evalRefs)],"evalRefs"),canExecute:o(()=>!1,"canExecute"),execute:o(async e=>e,"execute"),normalizeResult:o(e=>e,"normalizeResult")},ta=new Map([["agent",Zt],["skill",ae("skill")],["extension",ae("extension")],["model",ea],["configuration",ae("configuration")],["unselected",ae("unselected")]]);function hr(e){let t=ta.get(e.kind);if(!t)throw new Error(`No Create/Improve target adapter is registered for ${e.kind}.`);return t}o(hr,"createImproveTargetAdapter");function vr(e){if(e.run.target.kind!=="model")throw new Error("Model refs can only be attached to a Model Create/Improve run.");let t=e.run.target,a=e.timestamp??new Date().toISOString();if(e.run.tasksetRef&&e.tasksetId&&e.tasksetId!==e.run.tasksetRef.id)throw new Error(`Model execution cannot replace approved Taskset ${e.run.tasksetRef.id} with ${e.tasksetId}.`);let n={...e.run.target,trainingPlanId:e.trainingPlanId??t.trainingPlanId,trainingJobId:e.trainingJobId??t.trainingJobId,artifactId:e.artifactId!==void 0?e.artifactId:e.trainingJobId&&e.trainingJobId!==t.trainingJobId?null:t.artifactId},r=(e.evaluations??[]).map(l=>({id:`model_eval_${e.run.id}_${e.trainingJobId??t.trainingJobId??e.run.revision+1}_${l.subject}`,evaluation:l})),s=r.filter(({evaluation:l})=>l.subject==="candidate").map(({id:l})=>l),i=e.run.candidates.filter(l=>l.target.kind==="model"),d=i.find(l=>l.target.kind==="model"&&l.target.trainingJobId===n.trainingJobId)??i.find(l=>l.target.kind==="model"&&!l.target.trainingJobId&&!l.target.artifactId),u=i.at(-1)??null,m=d?.id??(i.length&&n.trainingJobId?`model_candidate_${e.run.id}_${n.trainingJobId}`:`model_candidate_${e.run.id}`),c=o(l=>({...l,target:n,status:r.length?"evaluated":l.status,tasksetRef:l.tasksetRef??e.run.tasksetRef,sourceRefs:e.run.tasksetRef?[...new Set([...l.sourceRefs,e.run.tasksetRef.id])]:l.sourceRefs,artifactRefs:n.artifactId?[...new Set([...l.artifactRefs,n.artifactId])]:l.artifactRefs,evaluationReceiptRefs:s.length?[...new Set([...l.evaluationReceiptRefs,...s])]:l.evaluationReceiptRefs,updatedAt:a,metadata:{...l.metadata,trainingPlanId:n.trainingPlanId,trainingJobId:n.trainingJobId}}),"updateModelCandidate"),g=d?e.run.candidates.map(l=>l.id===d.id?c(l):l):[...e.run.candidates,c({id:m,target:n,status:n.artifactId?"authored":"checking",git:null,parentCandidateId:u?.id??null,tasksetRef:e.run.tasksetRef,authoringModelRef:null,allowedPaths:[],sourceRefs:[],artifactRefs:[],checkRefs:[],evaluationReceiptRefs:[],createdAt:a,updatedAt:a,metadata:{source:"model_training"}})];return A(e.run,{target:n,state:e.completed?"ready":"evaluating",blockedReason:null,externalExecutionRefs:aa(e.run,n),candidates:g,evaluationReceipts:r.length?[...e.run.evaluationReceipts.filter(l=>!r.some(({id:p})=>p===l.id)),...r.map(({id:l,evaluation:p})=>({id:l,candidateId:p.subject==="candidate"?m:null,target:n,evaluatorKind:"taskset",subject:p.subject,sourceCommit:null,sourceBranch:null,tasksetId:e.run.tasksetRef?.id??null,tasksetHash:e.run.tasksetRef?.contentHash??null,taskAttemptRefs:p.attemptRefs,status:p.evaluationComplete===!1?"blocked":p.failed===0&&p.total>0?"passed":"failed",publishGate:p.evaluationComplete!==!1&&p.failed===0&&p.total>0?"passed":"failed",summaryCounts:{total:p.total,passed:p.passed,failed:p.failed},evalRefs:p.gradeRefs,artifactRefs:n.artifactId?[n.artifactId]:[],summary:p.evaluationComplete===!1?`${p.subject==="active"?"Base":"Trained"} frozen Taskset evaluation was blocked by ${p.infrastructureFailureCount??0} infrastructure failure${p.infrastructureFailureCount===1?"":"s"}; no quality result was recorded.`:`${p.subject==="active"?"Base":"Trained"} frozen Taskset evaluation: ${p.passed}/${p.total} passed.`,createdAt:a,metadata:{trustedTasksetExecution:!0,tasksetRevision:e.run.tasksetRef?.revision??null,gradeRefs:p.gradeRefs,executionContractHash:p.executionContractHash,evaluationComplete:p.evaluationComplete??!0,infrastructureFailureCount:p.infrastructureFailureCount??0}}))]:e.run.evaluationReceipts,updatedAt:a})}o(vr,"attachModelTargetRefs");function ve(e){return{operation:e.operation,objective:e.objective,target:e.target,sourceAuthority:e.adapter.sourceAuthority,context:e.context}}o(ve,"commonPlanningContext");function Re(e){return{sourcePlan:e.plan?.sourcePlan??[],requirements:e.plan?.requirements??[]}}o(Re,"commonScaffold");function ct(e){return e.plan?.sourcePlan.map(t=>t.path)??[]}o(ct,"plannedPaths");function ke(e){return e.plan?.checks??[]}o(ke,"plannedChecks");function aa(e,t){let a=new Map(e.externalExecutionRefs.map(n=>[`${n.kind}:${n.id}`,n]));return t.trainingJobId&&a.set(`training_job:${t.trainingJobId}`,{kind:"training_job",id:t.trainingJobId,status:t.artifactId?"completed":"running",metadata:{tasksetId:e.tasksetRef?.id??null,tasksetHash:e.tasksetRef?.contentHash??null,trainingPlanId:t.trainingPlanId,artifactId:t.artifactId}}),[...a.values()]}o(aa,"mergeExternalModelRefs");export{se as a,Pa as b,Ia as c,ya as d,le as e,Va as f,zt as g,Ya as h,Xa as i,Qa as j,Za as k,ot as l,hr as m,vr as n};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{e as a,i as t}from"./chunk-
|
|
2
|
+
import{e as a,i as t}from"./chunk-VHSX3JPX.js";import{A as e}from"./chunk-PF56N7ZY.js";var h=e.object({schemaVersion:e.literal("openpond.localHarnessReleaseRecord.v1"),workspaceId:e.string().trim().min(1).max(240),sourceRevision:e.string().trim().min(1).max(500),agentSnapshot:a,harnessRelease:t,bundlePath:e.string().trim().min(1).max(8192),createdAt:e.string().datetime({offset:!0})}).strict().superRefine((s,n)=>{(s.harnessRelease.agentSnapshot.id!==s.agentSnapshot.id||s.harnessRelease.agentSnapshot.contentHash!==s.agentSnapshot.contentHash)&&n.addIssue({code:"custom",message:"Harness release must bind the stored Agent snapshot",path:["harnessRelease","agentSnapshot"]})});export{h as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{c as d,e as p,f,g,i as w,qa as P}from"./chunk-
|
|
2
|
+
import{c as d,e as p,f,g,i as w,qa as P}from"./chunk-LHA7RQBA.js";import{a as u,c as m,f as l,h as r}from"./chunk-H7IWJN7L.js";import{a as e}from"./chunk-FTQLQJQV.js";import c from"node:path";import{AsyncLocalStorage as v}from"node:async_hooks";import{promises as h}from"node:fs";var y=new v;function E(n,i=!1){let t=y.getStore();t&&(i&&(t.length=0),t.push(n))}e(E,"onStartupFailure");async function N(n,i){await P(n);let t;try{t=await g(c.join(r(n).runtime,"server-owner"),100)}catch(o){if(o instanceof m&&o.issue.code==="STORAGE_BUSY"){let a=await w(c.join(r(n).runtime,"endpoint.json"),()=>null);throw new m({code:"RUNTIME_ALREADY_RUNNING",path:n,message:"An OpenPond runtime already owns this home.",action:a?.url?`Connect to the existing runtime at ${a.url}, or stop it before starting another.`:"Stop the existing runtime before starting another with this home."})}throw o}let s=[];try{let o=await u(n,()=>y.run(s,i)),a=o.close.bind(o);s.length=0;let k;return{...o,close:e(()=>k??=(async()=>{try{await u(n,a)}finally{await h.rm(c.join(r(n).runtime,"endpoint.json"),{force:!0}),await t()}})(),"close")}}catch(o){try{for(let a of s.reverse())await Promise.resolve().then(()=>u(n,a)).catch(()=>{});await h.rm(c.join(r(n).runtime,"endpoint.json"),{force:!0})}finally{await t()}throw o}}e(N,"ownHomeRuntime");async function b(n,i,t){await p(c.join(r(n).runtime,"endpoint.json"),JSON.stringify({schemaVersion:"openpond.runtimeEndpoint.v1",pid:process.pid,url:i,serverId:t}))}e(b,"publishRuntimeEndpoint");import{randomBytes as x}from"node:crypto";function D(){return l()}e(D,"appDataDir");function _(n){return r(n).config}e(_,"providersConfigPath");function H(n){return r(n).credentials}e(H,"providerSecretsConfigPath");function L(n){return r(n).key}e(L,"providerSecretsKeyPath");async function U(n){let i=r(n).token;return f(i,async()=>{let t=(await d(i))?.trim(),s=process.env.OPENPOND_APP_TOKEN||t||x(32).toString("base64url");return s!==t&&await p(i,s),{token:s,tokenFile:i}})}e(U,"ensureCapabilityToken");export{E as a,N as b,b as c,D as d,_ as e,H as f,L as g,U as h};
|