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,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as P,b as ue,c as pe,d as fe,e as L,f as re,g as z,h as B,i as me,j as oe,k as he,l as we,m as ge,n as J,o as ye,p as ve,q as D,r as ne,s as M,t as se,u as Se,v as Y,w as be,x as Ie,y as G}from"./chunk-U5FKRYJO.js";import{k as Q}from"./chunk-GUOLMLZN.js";import{a as Oe}from"./chunk-JUQMSHNR.js";import"./chunk-U2MAPON2.js";import"./chunk-7UH4YDA7.js";import{c as Ae,f as ke}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{c as x,f as k}from"./chunk-3M53YXEI.js";import"./chunk-JFXINDOQ.js";import"./chunk-OLDK2LKJ.js";import"./chunk-BT5YNE5U.js";import{n as Ce,o as Ee,p as W}from"./chunk-SF5HJ7PL.js";import"./chunk-FWIPHEVA.js";import{d as V,g as Re}from"./chunk-WRI4XKSK.js";import{b as xe}from"./chunk-GLUWATL5.js";import"./chunk-QDC4OW3S.js";import"./chunk-ZZWAQBA2.js";import"./chunk-YR5ID2SS.js";import"./chunk-YBT2NB32.js";import"./chunk-74ZXXBGN.js";import"./chunk-APB2STJK.js";import"./chunk-Y4OWBBDD.js";import"./chunk-6ZFPQYHG.js";import"./chunk-JFXWI3EN.js";import"./chunk-MNC4YUDI.js";import"./chunk-Z4Z5UOZM.js";import"./chunk-FFRFSDBM.js";import{a as F,f as de}from"./chunk-H7IWJN7L.js";import"./chunk-VYLGI3IH.js";import"./chunk-ACYFMLWG.js";import"./chunk-TVQAPBLZ.js";import{l as le,m as $}from"./chunk-KGNCKIFP.js";import{b as O}from"./chunk-ES2ISFJC.js";import{a as c}from"./chunk-FTQLQJQV.js";import{createInterface as ze}from"node:readline/promises";import{join as lt,resolve as Ye}from"node:path";import{homedir as ut}from"node:os";import{randomUUID as Qe}from"node:crypto";import{setTimeout as Xe}from"node:timers/promises";var We=["source","admission","control","heartbeat"],_=class{static{c(this,"CollectorErrors")}store;constructor(e){this.store=e}read(e){let r=this.store.setting(`errors:${e}`);if(r)return JSON.parse(r);let n=this.store.database.prepare("SELECT error FROM backfill_units WHERE connection_id=? AND state='error' AND error IS NOT NULL ORDER BY session_key LIMIT 1").get(e);return typeof n?.error=="string"?{source:n.error}:{}}message(e,r){let n=this.read(e);return We.filter(o=>o!==r).map(o=>n[o]).find(Boolean)??null}source(e){return this.read(e).source??null}set(e,r,n){let o=this.read(e);n?o[r]=n.slice(0,500):delete o[r],this.store.set(`errors:${e}`,JSON.stringify(o)),this.store.error(e,this.message(e))}};var X=class{static{c(this,"CollectorSyncRequests")}store;acquisitions=new Map;constructor(e){this.store=e}observe(e,r){let n=r.requestedSyncRevision??e.requestedSyncRevision??0,o=r.completedSyncRevision??0;if(!Number.isSafeInteger(n)||n<0||n>r.revision||!Number.isSafeInteger(o)||o<0||o>n)throw new Error("Invalid remote sync acknowledgement.");let s=this.confirmed(e.id);return o>s&&this.store.set(`syncAcknowledged:${e.id}`,String(o)),{requestedSyncRevision:Math.max(e.requestedSyncRevision??0,n),completedSyncRevision:Math.max(e.completedSyncRevision??0,o)}}needsAcquisition(e){let r=e.requestedSyncRevision??0;if(r<=(e.completedSyncRevision??0))return!1;let n=this.acquisitions.get(e.id);return n?.controlRevision!==e.revision||n.requestedSyncRevision!==r}acquired(e,r){this.acquisitions.set(e,r)}complete(e,r){let n=this.acquisitions.get(e.id),o=e.requestedSyncRevision??0;if(e.state!=="active"||this.store.setting("desiredState")!=="running"||this.store.queued(e.id)||r||!n?.succeeded||n.controlRevision!==e.revision||n.requestedSyncRevision!==o||o<=(e.completedSyncRevision??0))return e;let s={...e,completedSyncRevision:o};return this.store.put(s),s}confirmed(e){return Number(this.store.setting(`syncAcknowledged:${e}`))||0}needsAcknowledgement(e){return(e.completedSyncRevision??0)>this.confirmed(e.id)}};var Ve=O.object({leafId:O.string().min(1).max(200),chainHash:O.string().regex(/^[a-f0-9]{64}$/),sourceInstanceId:O.string().min(1)}).strict(),Ne=c((t,e)=>`branch:${JSON.stringify([t,e])}`,"key");function $e(t,e,r){let n=t.setting(Ne(e,r));if(!n)return;let o=Ve.parse(JSON.parse(n));return t.connections().find(l=>l.id===e)?.source.instanceId===o.sourceInstanceId?{leafId:o.leafId,chainHash:o.chainHash}:void 0}c($e,"collectorBranchAnchor");async function Te(t,e){if(t.source!=="claude_code")throw new Error("Branch selection is currently supported for Claude Code.");let r,n=[];do{let o=await L(t,{cursor:r,limit:100});n.push(...o.items.filter(s=>s.nativeSessionId===e)),r=o.nextCursor??void 0}while(r);if(n.length!==1)throw new Error("Select exactly one native session in this connection's source location.");return n[0]}c(Te,"findSession");async function qe(t,e,r){let n=await D.open(t);try{let o=n.connections().find(l=>l.id===e);if(!o)throw new Error("Select a connection from openpond import status.");let s=await Te(o.source,r);return{session:s,...await re(o.source,s)}}finally{n.close()}}c(qe,"inspectCollectorBranches");async function Be(t,e,r,n){let o=await D.open(t);try{let s=o.connections().find(f=>f.id===e);if(!s||s.state!=="paused")throw new Error(`Pause this connection first: openpond import pause ${e}`);let l=await Te(s.source,r),a=await re(s.source,l),d=a.branches.find(f=>f.leafId===n.leafId);if(a.revision!==n.revision||!d)throw new Error("This conversation changed. Refresh its branches and choose again.");await z(s.source,l,{branchLeafId:n.leafId,expectedBranchRevision:n.revision}),o.database.exec("BEGIN IMMEDIATE");try{let f=o.connections().find(h=>h.id===e);if(!f||f.state!=="paused"||f.revision!==s.revision||f.source.instanceId!==s.source.instanceId)throw new Error("Connection changed during branch selection. Refresh and try again.");o.set(Ne(e,r),JSON.stringify({leafId:d.leafId,chainHash:d.chainHash,sourceInstanceId:s.source.instanceId}));for(let h of["source_scans","checkpoints","pending"])o.database.prepare(`DELETE FROM ${h} WHERE connection_id=?`).run(e);o.snapshots.collect();let w=new _(o);w.set(e,"source",w.source(e)),o.progress.reset(e),w.set(e,"admission",null),o.database.exec("COMMIT")}catch(f){throw o.database.exec("ROLLBACK"),f}return{connectionId:e,nativeSessionId:r,leafId:d.leafId,state:"paused"}}finally{o.close()}}c(Be,"selectCollectorBranch");async function Ue(t){let{store:e,connection:r,check:n,drain:o,progress:s}=t,l,a=0,d=0,f=[];do{await n(),s({phase:"discovering"});let w=await L(r.source,{since:r.since??void 0,cursor:l,limit:50});d+=w.items.length,s({discovered:d});for(let h of w.items){if(await n(),await o(),Number(e.database.prepare("SELECT COALESCE(SUM(bytes),0) AS n FROM pending").get()?.n)+e.snapshots.bytes()>=B.maxBytes)throw new oe;s({phase:"reading"});let p=JSON.stringify([h.path,h.nativeSessionId]),S=h.storageRevision?$([h.storageRevision,pe(r.source.source)]):null;e.progress.select(r.id,p);try{if(S&&!e.sourceChanged(r.id,p,S)&&!e.progress.tracks(r.id,p))continue;let{files:v,preview:i,branchLeafId:u}=await z(r.source,h,{branchAnchor:$e(e,r.id,h.nativeSessionId)});await n();let m=e.snapshots.prepare(v),I=!1;for(let R of i.sessions){let A=JSON.stringify([r.source.instanceId,R.sessionId,R.branchId]);e.progress.retained(r.id,p,A);let T=R.boundaries.filter(g=>g.projection==="turn"&&g.terminal!=="unknown"&&(!r.since||Date.parse(R.events[g.start].occurredAt??h.updatedAt)>=Date.parse(r.since)));I||=T.length>0;let U=T.filter(g=>e.changed(r.id,A,g.id,$([g.inputHash,g.revisionHash])));for(let g=0;g<U.length;g+=B.batchCases){await n();let C=U.slice(g,g+B.batchCases),y=`sync-${$([r.id,A,C.map(b=>[b.id,b.inputHash,b.revisionHash])]).slice(0,48)}`;e.enqueue({operationId:y,connectionId:r.id,sessionKey:A,contentHash:R.contentHash,files:v,boundaryIds:C.map(b=>b.id),...u?{branchLeafId:u}:{}},C.map(b=>({id:b.id,revision:$([b.inputHash,b.revisionHash])})),p,m)}}e.progress.read(r.id,p,I),S&&e.scanned(r.id,p,S)}catch(v){if(v instanceof fe){e.progress.read(r.id,p,!1),S&&e.scanned(r.id,p,S);continue}if(v instanceof oe||v instanceof q||v instanceof j)throw v;let i=v instanceof Error?v.message:"Unable to read session";e.progress.failed(r.id,p,i),f.push(`${h.nativeSessionId}: ${i}`)}finally{s({processed:++a})}await o()}l=w.nextCursor??void 0}while(l);if(e.progress.discovered(r.id),f.length)throw new Error(`${f.length} session(s) need attention. ${f[0]}`)}c(Ue,"acquireCollectorSource");var q=class extends Error{static{c(this,"CollectorInterruptedError")}},j=class extends Error{static{c(this,"CollectorScopeChangedError")}};async function De(t){let e=await D.open(t.directory),r=Qe(),n=[];e.database.exec("BEGIN IMMEDIATE");try{let i=e.setting("owner");if(i){let m=JSON.parse(i),I=!0;try{process.kill(m.pid,0)}catch(R){I=R.code!=="ESRCH"}if(I){if(t.trigger==="scheduled"){e.database.exec("COMMIT"),e.close();return}throw new Error("An import is already running. Cancel it or wait for it to finish.")}}let u=new Date;if(n=e.connections().filter(m=>m.state!=="disconnected"&&(!t.connectionIds||t.connectionIds.includes(m.id))&&(t.trigger!=="scheduled"||m.state==="active"&&ve(e.schedule(m.id),e.setting(`scheduledMinute:${m.id}`),u))),t.trigger==="scheduled")for(let m of n)e.set(`scheduledMinute:${m.id}`,ye(u));if(n.length&&t.trigger&&e.set("desiredState","running"),!n.length||e.setting("desiredState")!=="running"||t.signal.aborted){e.database.exec("COMMIT"),e.close();return}e.set("owner",JSON.stringify({pid:process.pid,nonce:r})),e.set("pid",String(process.pid)),e.set("heartbeatAt",u.toISOString()),e.database.exec("COMMIT")}catch(i){throw e.database.exec("ROLLBACK"),e.close(),i}let o=new AbortController,s=Date.now()+(t.maxDurationMs??B.runMs),l=AbortSignal.any([t.signal,o.signal]),a=setTimeout(()=>o.abort(new Error("Import exceeded its one-hour time budget. Remaining work is retained for the next run.")),t.maxDurationMs??B.runMs),d=setInterval(()=>{e.setting("desiredState")!=="running"?o.abort(new q("Import cancelled.")):e.set("heartbeatAt",new Date().toISOString())},250),f=new _(e),w=new X(e),h=c(i=>e.connections().find(u=>u.id===i.id)??i,"retained"),E=c(i=>{let u=e.queued(i.id),m=f.message(i.id,"heartbeat");return{pendingOperations:u,error:m,completedSyncRevision:!u&&!m?i.completedSyncRevision??0:0}},"heartbeatInput");function p(i,u){let m=h(i);if(m.state==="disconnected"||u.revision<m.revision)return m;let I=w.observe(m,u);u.revision>m.revision&&f.set(m.id,"control",null);let R={...m,...I,...u.revision>m.revision?{revision:u.revision,state:u.state}:{},...u.destinations?{destinations:u.destinations}:{}};return e.put(R),R}c(p,"applyRemote");function S(i,u,m){f.set(i.id,m,u instanceof Error?u.message:"Import failed.");let I=u&&typeof u=="object"&&"status"in u?Number(u.status):0,R=h(i);R.state!=="disconnected"&&[400,401,403].includes(I)&&e.put({...R,state:I===400?"paused":"disconnected"})}c(S,"recordFailure");function v(){if(Date.now()>=s&&!o.signal.aborted&&o.abort(new Error("Import time budget reached. Remaining work is retained for the next run.")),l.aborted)throw l.reason??new q("Import cancelled.");if(e.setting("desiredState")!=="running")throw new q("Import cancelled.")}c(v,"checkCancelled");try{await e.snapshots.migrate(()=>l.aborted||Date.now()>=s||e.setting("desiredState")!=="running");for(let i of n){let u="heartbeat",m=0,I={id:r,state:"running",phase:"discovering",startedAt:new Date().toISOString(),finishedAt:null,processed:0,discovered:0,uploaded:0,error:null},R=c(g=>{I={...I,...g},e.set(`run:${i.id}`,JSON.stringify(I))},"progress");R({});let A=c(async()=>{v(),u="heartbeat",i=h(i);let g=await t.transport.heartbeat(i,E(i),l);i=p(i,g),f.set(i.id,"heartbeat",null),m=Date.now()},"heartbeat"),T=c(async()=>{if(v(),Date.now()-m>=B.heartbeatMs&&await A(),i=h(i),i.state!=="active")throw new q(`Source ${i.state}.`)},"check"),U=c(async()=>{for(;e.queued(i.id);){await T();let g=e.next(i.id);if(!g)break;R({phase:"uploading"});let C=!1;for(let y=0;y<B.attemptsPerRun;y++){if(await T(),!e.database.prepare("SELECT 1 FROM pending WHERE id=? AND connection_id=?").get(g.entry.operationId,i.id)){C=!0;break}u="admission";try{await t.transport.admit(i,g.entry,l),e.acknowledge(g.entry),f.set(i.id,"admission",null),R({uploaded:I.uploaded+g.entry.boundaryIds.length}),C=!0;break}catch(b){e.retry(g.entry.operationId,g.attempts+y);let N=b&&typeof b=="object"&&"status"in b?Number(b.status):0;if(l.aborted||[400,401,403,409].includes(N)||y+1>=B.attemptsPerRun)throw b;await Xe(1e3*2**y,void 0,{signal:l})}}if(!C)throw new Error("Pending import was not acknowledged.")}},"drain");try{if(await A(),i.state!=="active")throw new q(`Source ${i.state}.`);await U();let g;for(let C=0;C<3;C++){await T();let y=i.revision,b=i.requestedSyncRevision??0;u="source";let N=c(async()=>{if(await T(),u="source",i.revision!==y)throw new j("Source settings changed during acquisition.")},"checkAcquisition");try{await Ue({store:e,connection:i,check:N,drain:c(async()=>{await U(),await N()},"drain"),progress:R})}catch(H){if(H instanceof j&&C<2)continue;throw H}if(f.set(i.id,"source",null),await U(),i=h(i),i.revision!==y){if(C===2)throw new Error("Source settings changed repeatedly during import. Run Sync now again.");continue}if(w.acquired(i.id,{controlRevision:y,requestedSyncRevision:b,succeeded:!0}),i=w.complete(i,f.message(i.id,"heartbeat")),await A(),i.revision!==y||w.needsAcquisition(i)){if(C===2)throw new Error("Source settings changed during completion. Run Sync now again.");continue}if(w.needsAcknowledgement(i))throw new Error("The server has not acknowledged sync completion. Retry with Sync now.");g=y;break}if(await T(),i.revision!==g)throw new j("Source settings changed before completion. Run Sync now again.");R({state:"completed",finishedAt:new Date().toISOString()}),e.set(`lastSuccess:${i.id}`,I.finishedAt)}catch(g){let C=g instanceof q||t.signal.aborted||l.reason instanceof q,y=l.aborted?l.reason:g,b=y instanceof Error?y.message:"Import cancelled.";C||S(i,y,u),R({state:C?"cancelled":"failed",error:b,finishedAt:new Date().toISOString()})}if(l.aborted||e.setting("desiredState")!=="running")break}}finally{clearInterval(d),clearTimeout(a),JSON.parse(e.setting("owner")||"{}").nonce===r&&(e.set("pid",""),e.set("heartbeatAt",""),e.set("owner",""),e.set("desiredState","stopped")),e.close()}}c(De,"runCollector");import{createHash as Me,generateKeyPairSync as Ze,createPublicKey as et,diffieHellman as tt,createDecipheriv as rt}from"node:crypto";import{spawn as ot}from"node:child_process";var He=c(t=>Me("sha256").update(t).digest("hex"),"hash"),nt=O.object({publicKey:O.string().max(200),iv:O.string().max(100),tag:O.string().max(100),ciphertext:O.string().max(1e4)}).strict();async function ie(t,e,r){let n=await fetch(`${t}${e}`,{method:"POST",redirect:"error",signal:AbortSignal.timeout(15e3),headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}),o=await n.text();if(o.length>16384)throw new Error("Authorization response exceeded its limit.");if(!n.ok)throw Object.assign(new Error(`Browser sign-in failed (${n.status}).`),{status:n.status});return JSON.parse(o)}c(ie,"post");function st(t){let e=process.platform==="darwin"?"open":process.platform==="win32"?"rundll32":"xdg-open",r=process.platform==="win32"?["url.dll,FileProtocolHandler",t]:[t],n=ot(e,r,{stdio:"ignore",detached:!0});n.on("error",()=>{}),n.unref()}c(st,"openBrowser");async function je(t,e){let r=await V(),n=Ae(e)||r.apiBaseUrl||xe,o=x(e,"baseUrl")||(new URL(n).hostname==="staging-api.openpond.ai"?"https://staging.openpond.ai":ke(r)),s=new URL(o),l=new URL(n);for(let E of[s,l])if(E.protocol!=="https:"&&!(E.protocol==="http:"&&["localhost","127.0.0.1"].includes(E.hostname))||E.username||E.password||E.search||E.hash)throw new Error("Sign-in requires a clean HTTPS origin or local development origin.");let a=`import-${He([s.origin,t.machineId,t.instanceId].join(":")).slice(0,24)}`,d=Ze("x25519"),f=d.publicKey.export({format:"der",type:"spki"}).toString("base64"),w=O.object({deviceCode:O.string(),userCode:O.string(),expiresAt:O.string().datetime(),intervalSeconds:O.number().min(2).max(10)}).strict().parse(await ie(s.origin,"/api/cli/import/device",{publicKey:f,machineId:t.machineId,sourceInstanceId:t.instanceId,sourceLabel:P[t.source],sourceRoot:t.root,...x(e,"team")?{requestedTeamId:x(e,"team")}:{}})),h=`${s.origin}/console/connections/authorize?code=${encodeURIComponent(w.userCode)}`;for(console.log(`OpenPond sign-in code: ${w.userCode}
|
|
2
|
+
import{a as P,b as ue,c as pe,d as fe,e as L,f as re,g as z,h as B,i as me,j as oe,k as he,l as we,m as ge,n as J,o as ye,p as ve,q as D,r as ne,s as M,t as se,u as Se,v as Y,w as be,x as Ie,y as G}from"./chunk-ZAZKJJOT.js";import{k as Q}from"./chunk-ISFIDCIH.js";import{a as Oe}from"./chunk-23P2O7PH.js";import"./chunk-AW5Q6NXT.js";import"./chunk-YVNDDNMK.js";import"./chunk-XRKFTPHD.js";import{c as Ae,f as ke}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{c as x,f as k}from"./chunk-3M53YXEI.js";import"./chunk-JFXINDOQ.js";import"./chunk-EL454L26.js";import"./chunk-BT5YNE5U.js";import{m as Ce,n as Ee,o as W}from"./chunk-PXS4SVQG.js";import"./chunk-FWIPHEVA.js";import{d as V,g as Re}from"./chunk-ENSB6ZTM.js";import{b as xe}from"./chunk-GLUWATL5.js";import"./chunk-RYGWCN2R.js";import"./chunk-ZZWAQBA2.js";import"./chunk-YR5ID2SS.js";import"./chunk-KNO355LC.js";import"./chunk-Y54RKLOI.js";import"./chunk-2SUMZ73C.js";import"./chunk-M55H7KVR.js";import"./chunk-BK63OQRW.js";import"./chunk-V4KT5FCJ.js";import"./chunk-LHA7RQBA.js";import"./chunk-SG6JZ7HD.js";import"./chunk-ON2RNOCG.js";import{a as F,f as de}from"./chunk-H7IWJN7L.js";import"./chunk-SFNCAPCJ.js";import"./chunk-RCA6NGVA.js";import"./chunk-VHSX3JPX.js";import{l as le,m as $}from"./chunk-BIPQCJ5V.js";import{A as O}from"./chunk-PF56N7ZY.js";import{a as c}from"./chunk-FTQLQJQV.js";import{createInterface as ze}from"node:readline/promises";import{join as lt,resolve as Ye}from"node:path";import{homedir as ut}from"node:os";import{randomUUID as Qe}from"node:crypto";import{setTimeout as Xe}from"node:timers/promises";var We=["source","admission","control","heartbeat"],_=class{static{c(this,"CollectorErrors")}store;constructor(e){this.store=e}read(e){let r=this.store.setting(`errors:${e}`);if(r)return JSON.parse(r);let n=this.store.database.prepare("SELECT error FROM backfill_units WHERE connection_id=? AND state='error' AND error IS NOT NULL ORDER BY session_key LIMIT 1").get(e);return typeof n?.error=="string"?{source:n.error}:{}}message(e,r){let n=this.read(e);return We.filter(o=>o!==r).map(o=>n[o]).find(Boolean)??null}source(e){return this.read(e).source??null}set(e,r,n){let o=this.read(e);n?o[r]=n.slice(0,500):delete o[r],this.store.set(`errors:${e}`,JSON.stringify(o)),this.store.error(e,this.message(e))}};var X=class{static{c(this,"CollectorSyncRequests")}store;acquisitions=new Map;constructor(e){this.store=e}observe(e,r){let n=r.requestedSyncRevision??e.requestedSyncRevision??0,o=r.completedSyncRevision??0;if(!Number.isSafeInteger(n)||n<0||n>r.revision||!Number.isSafeInteger(o)||o<0||o>n)throw new Error("Invalid remote sync acknowledgement.");let s=this.confirmed(e.id);return o>s&&this.store.set(`syncAcknowledged:${e.id}`,String(o)),{requestedSyncRevision:Math.max(e.requestedSyncRevision??0,n),completedSyncRevision:Math.max(e.completedSyncRevision??0,o)}}needsAcquisition(e){let r=e.requestedSyncRevision??0;if(r<=(e.completedSyncRevision??0))return!1;let n=this.acquisitions.get(e.id);return n?.controlRevision!==e.revision||n.requestedSyncRevision!==r}acquired(e,r){this.acquisitions.set(e,r)}complete(e,r){let n=this.acquisitions.get(e.id),o=e.requestedSyncRevision??0;if(e.state!=="active"||this.store.setting("desiredState")!=="running"||this.store.queued(e.id)||r||!n?.succeeded||n.controlRevision!==e.revision||n.requestedSyncRevision!==o||o<=(e.completedSyncRevision??0))return e;let s={...e,completedSyncRevision:o};return this.store.put(s),s}confirmed(e){return Number(this.store.setting(`syncAcknowledged:${e}`))||0}needsAcknowledgement(e){return(e.completedSyncRevision??0)>this.confirmed(e.id)}};var Ve=O.object({leafId:O.string().min(1).max(200),chainHash:O.string().regex(/^[a-f0-9]{64}$/),sourceInstanceId:O.string().min(1)}).strict(),Ne=c((t,e)=>`branch:${JSON.stringify([t,e])}`,"key");function $e(t,e,r){let n=t.setting(Ne(e,r));if(!n)return;let o=Ve.parse(JSON.parse(n));return t.connections().find(l=>l.id===e)?.source.instanceId===o.sourceInstanceId?{leafId:o.leafId,chainHash:o.chainHash}:void 0}c($e,"collectorBranchAnchor");async function Te(t,e){if(t.source!=="claude_code")throw new Error("Branch selection is currently supported for Claude Code.");let r,n=[];do{let o=await L(t,{cursor:r,limit:100});n.push(...o.items.filter(s=>s.nativeSessionId===e)),r=o.nextCursor??void 0}while(r);if(n.length!==1)throw new Error("Select exactly one native session in this connection's source location.");return n[0]}c(Te,"findSession");async function qe(t,e,r){let n=await D.open(t);try{let o=n.connections().find(l=>l.id===e);if(!o)throw new Error("Select a connection from openpond import status.");let s=await Te(o.source,r);return{session:s,...await re(o.source,s)}}finally{n.close()}}c(qe,"inspectCollectorBranches");async function Be(t,e,r,n){let o=await D.open(t);try{let s=o.connections().find(f=>f.id===e);if(!s||s.state!=="paused")throw new Error(`Pause this connection first: openpond import pause ${e}`);let l=await Te(s.source,r),a=await re(s.source,l),d=a.branches.find(f=>f.leafId===n.leafId);if(a.revision!==n.revision||!d)throw new Error("This conversation changed. Refresh its branches and choose again.");await z(s.source,l,{branchLeafId:n.leafId,expectedBranchRevision:n.revision}),o.database.exec("BEGIN IMMEDIATE");try{let f=o.connections().find(h=>h.id===e);if(!f||f.state!=="paused"||f.revision!==s.revision||f.source.instanceId!==s.source.instanceId)throw new Error("Connection changed during branch selection. Refresh and try again.");o.set(Ne(e,r),JSON.stringify({leafId:d.leafId,chainHash:d.chainHash,sourceInstanceId:s.source.instanceId}));for(let h of["source_scans","checkpoints","pending"])o.database.prepare(`DELETE FROM ${h} WHERE connection_id=?`).run(e);o.snapshots.collect();let w=new _(o);w.set(e,"source",w.source(e)),o.progress.reset(e),w.set(e,"admission",null),o.database.exec("COMMIT")}catch(f){throw o.database.exec("ROLLBACK"),f}return{connectionId:e,nativeSessionId:r,leafId:d.leafId,state:"paused"}}finally{o.close()}}c(Be,"selectCollectorBranch");async function Ue(t){let{store:e,connection:r,check:n,drain:o,progress:s}=t,l,a=0,d=0,f=[];do{await n(),s({phase:"discovering"});let w=await L(r.source,{since:r.since??void 0,cursor:l,limit:50});d+=w.items.length,s({discovered:d});for(let h of w.items){if(await n(),await o(),Number(e.database.prepare("SELECT COALESCE(SUM(bytes),0) AS n FROM pending").get()?.n)+e.snapshots.bytes()>=B.maxBytes)throw new oe;s({phase:"reading"});let p=JSON.stringify([h.path,h.nativeSessionId]),S=h.storageRevision?$([h.storageRevision,pe(r.source.source)]):null;e.progress.select(r.id,p);try{if(S&&!e.sourceChanged(r.id,p,S)&&!e.progress.tracks(r.id,p))continue;let{files:v,preview:i,branchLeafId:u}=await z(r.source,h,{branchAnchor:$e(e,r.id,h.nativeSessionId)});await n();let m=e.snapshots.prepare(v),I=!1;for(let R of i.sessions){let A=JSON.stringify([r.source.instanceId,R.sessionId,R.branchId]);e.progress.retained(r.id,p,A);let T=R.boundaries.filter(g=>g.projection==="turn"&&g.terminal!=="unknown"&&(!r.since||Date.parse(R.events[g.start].occurredAt??h.updatedAt)>=Date.parse(r.since)));I||=T.length>0;let U=T.filter(g=>e.changed(r.id,A,g.id,$([g.inputHash,g.revisionHash])));for(let g=0;g<U.length;g+=B.batchCases){await n();let C=U.slice(g,g+B.batchCases),y=`sync-${$([r.id,A,C.map(b=>[b.id,b.inputHash,b.revisionHash])]).slice(0,48)}`;e.enqueue({operationId:y,connectionId:r.id,sessionKey:A,contentHash:R.contentHash,files:v,boundaryIds:C.map(b=>b.id),...u?{branchLeafId:u}:{}},C.map(b=>({id:b.id,revision:$([b.inputHash,b.revisionHash])})),p,m)}}e.progress.read(r.id,p,I),S&&e.scanned(r.id,p,S)}catch(v){if(v instanceof fe){e.progress.read(r.id,p,!1),S&&e.scanned(r.id,p,S);continue}if(v instanceof oe||v instanceof q||v instanceof j)throw v;let i=v instanceof Error?v.message:"Unable to read session";e.progress.failed(r.id,p,i),f.push(`${h.nativeSessionId}: ${i}`)}finally{s({processed:++a})}await o()}l=w.nextCursor??void 0}while(l);if(e.progress.discovered(r.id),f.length)throw new Error(`${f.length} session(s) need attention. ${f[0]}`)}c(Ue,"acquireCollectorSource");var q=class extends Error{static{c(this,"CollectorInterruptedError")}},j=class extends Error{static{c(this,"CollectorScopeChangedError")}};async function De(t){let e=await D.open(t.directory),r=Qe(),n=[];e.database.exec("BEGIN IMMEDIATE");try{let i=e.setting("owner");if(i){let m=JSON.parse(i),I=!0;try{process.kill(m.pid,0)}catch(R){I=R.code!=="ESRCH"}if(I){if(t.trigger==="scheduled"){e.database.exec("COMMIT"),e.close();return}throw new Error("An import is already running. Cancel it or wait for it to finish.")}}let u=new Date;if(n=e.connections().filter(m=>m.state!=="disconnected"&&(!t.connectionIds||t.connectionIds.includes(m.id))&&(t.trigger!=="scheduled"||m.state==="active"&&ve(e.schedule(m.id),e.setting(`scheduledMinute:${m.id}`),u))),t.trigger==="scheduled")for(let m of n)e.set(`scheduledMinute:${m.id}`,ye(u));if(n.length&&t.trigger&&e.set("desiredState","running"),!n.length||e.setting("desiredState")!=="running"||t.signal.aborted){e.database.exec("COMMIT"),e.close();return}e.set("owner",JSON.stringify({pid:process.pid,nonce:r})),e.set("pid",String(process.pid)),e.set("heartbeatAt",u.toISOString()),e.database.exec("COMMIT")}catch(i){throw e.database.exec("ROLLBACK"),e.close(),i}let o=new AbortController,s=Date.now()+(t.maxDurationMs??B.runMs),l=AbortSignal.any([t.signal,o.signal]),a=setTimeout(()=>o.abort(new Error("Import exceeded its one-hour time budget. Remaining work is retained for the next run.")),t.maxDurationMs??B.runMs),d=setInterval(()=>{e.setting("desiredState")!=="running"?o.abort(new q("Import cancelled.")):e.set("heartbeatAt",new Date().toISOString())},250),f=new _(e),w=new X(e),h=c(i=>e.connections().find(u=>u.id===i.id)??i,"retained"),E=c(i=>{let u=e.queued(i.id),m=f.message(i.id,"heartbeat");return{pendingOperations:u,error:m,completedSyncRevision:!u&&!m?i.completedSyncRevision??0:0}},"heartbeatInput");function p(i,u){let m=h(i);if(m.state==="disconnected"||u.revision<m.revision)return m;let I=w.observe(m,u);u.revision>m.revision&&f.set(m.id,"control",null);let R={...m,...I,...u.revision>m.revision?{revision:u.revision,state:u.state}:{},...u.destinations?{destinations:u.destinations}:{}};return e.put(R),R}c(p,"applyRemote");function S(i,u,m){f.set(i.id,m,u instanceof Error?u.message:"Import failed.");let I=u&&typeof u=="object"&&"status"in u?Number(u.status):0,R=h(i);R.state!=="disconnected"&&[400,401,403].includes(I)&&e.put({...R,state:I===400?"paused":"disconnected"})}c(S,"recordFailure");function v(){if(Date.now()>=s&&!o.signal.aborted&&o.abort(new Error("Import time budget reached. Remaining work is retained for the next run.")),l.aborted)throw l.reason??new q("Import cancelled.");if(e.setting("desiredState")!=="running")throw new q("Import cancelled.")}c(v,"checkCancelled");try{await e.snapshots.migrate(()=>l.aborted||Date.now()>=s||e.setting("desiredState")!=="running");for(let i of n){let u="heartbeat",m=0,I={id:r,state:"running",phase:"discovering",startedAt:new Date().toISOString(),finishedAt:null,processed:0,discovered:0,uploaded:0,error:null},R=c(g=>{I={...I,...g},e.set(`run:${i.id}`,JSON.stringify(I))},"progress");R({});let A=c(async()=>{v(),u="heartbeat",i=h(i);let g=await t.transport.heartbeat(i,E(i),l);i=p(i,g),f.set(i.id,"heartbeat",null),m=Date.now()},"heartbeat"),T=c(async()=>{if(v(),Date.now()-m>=B.heartbeatMs&&await A(),i=h(i),i.state!=="active")throw new q(`Source ${i.state}.`)},"check"),U=c(async()=>{for(;e.queued(i.id);){await T();let g=e.next(i.id);if(!g)break;R({phase:"uploading"});let C=!1;for(let y=0;y<B.attemptsPerRun;y++){if(await T(),!e.database.prepare("SELECT 1 FROM pending WHERE id=? AND connection_id=?").get(g.entry.operationId,i.id)){C=!0;break}u="admission";try{await t.transport.admit(i,g.entry,l),e.acknowledge(g.entry),f.set(i.id,"admission",null),R({uploaded:I.uploaded+g.entry.boundaryIds.length}),C=!0;break}catch(b){e.retry(g.entry.operationId,g.attempts+y);let N=b&&typeof b=="object"&&"status"in b?Number(b.status):0;if(l.aborted||[400,401,403,409].includes(N)||y+1>=B.attemptsPerRun)throw b;await Xe(1e3*2**y,void 0,{signal:l})}}if(!C)throw new Error("Pending import was not acknowledged.")}},"drain");try{if(await A(),i.state!=="active")throw new q(`Source ${i.state}.`);await U();let g;for(let C=0;C<3;C++){await T();let y=i.revision,b=i.requestedSyncRevision??0;u="source";let N=c(async()=>{if(await T(),u="source",i.revision!==y)throw new j("Source settings changed during acquisition.")},"checkAcquisition");try{await Ue({store:e,connection:i,check:N,drain:c(async()=>{await U(),await N()},"drain"),progress:R})}catch(H){if(H instanceof j&&C<2)continue;throw H}if(f.set(i.id,"source",null),await U(),i=h(i),i.revision!==y){if(C===2)throw new Error("Source settings changed repeatedly during import. Run Sync now again.");continue}if(w.acquired(i.id,{controlRevision:y,requestedSyncRevision:b,succeeded:!0}),i=w.complete(i,f.message(i.id,"heartbeat")),await A(),i.revision!==y||w.needsAcquisition(i)){if(C===2)throw new Error("Source settings changed during completion. Run Sync now again.");continue}if(w.needsAcknowledgement(i))throw new Error("The server has not acknowledged sync completion. Retry with Sync now.");g=y;break}if(await T(),i.revision!==g)throw new j("Source settings changed before completion. Run Sync now again.");R({state:"completed",finishedAt:new Date().toISOString()}),e.set(`lastSuccess:${i.id}`,I.finishedAt)}catch(g){let C=g instanceof q||t.signal.aborted||l.reason instanceof q,y=l.aborted?l.reason:g,b=y instanceof Error?y.message:"Import cancelled.";C||S(i,y,u),R({state:C?"cancelled":"failed",error:b,finishedAt:new Date().toISOString()})}if(l.aborted||e.setting("desiredState")!=="running")break}}finally{clearInterval(d),clearTimeout(a),JSON.parse(e.setting("owner")||"{}").nonce===r&&(e.set("pid",""),e.set("heartbeatAt",""),e.set("owner",""),e.set("desiredState","stopped")),e.close()}}c(De,"runCollector");import{createHash as Me,generateKeyPairSync as Ze,createPublicKey as et,diffieHellman as tt,createDecipheriv as rt}from"node:crypto";import{spawn as ot}from"node:child_process";var He=c(t=>Me("sha256").update(t).digest("hex"),"hash"),nt=O.object({publicKey:O.string().max(200),iv:O.string().max(100),tag:O.string().max(100),ciphertext:O.string().max(1e4)}).strict();async function ie(t,e,r){let n=await fetch(`${t}${e}`,{method:"POST",redirect:"error",signal:AbortSignal.timeout(15e3),headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}),o=await n.text();if(o.length>16384)throw new Error("Authorization response exceeded its limit.");if(!n.ok)throw Object.assign(new Error(`Browser sign-in failed (${n.status}).`),{status:n.status});return JSON.parse(o)}c(ie,"post");function st(t){let e=process.platform==="darwin"?"open":process.platform==="win32"?"rundll32":"xdg-open",r=process.platform==="win32"?["url.dll,FileProtocolHandler",t]:[t],n=ot(e,r,{stdio:"ignore",detached:!0});n.on("error",()=>{}),n.unref()}c(st,"openBrowser");async function je(t,e){let r=await V(),n=Ae(e)||r.apiBaseUrl||xe,o=x(e,"baseUrl")||(new URL(n).hostname==="staging-api.openpond.ai"?"https://staging.openpond.ai":ke(r)),s=new URL(o),l=new URL(n);for(let E of[s,l])if(E.protocol!=="https:"&&!(E.protocol==="http:"&&["localhost","127.0.0.1"].includes(E.hostname))||E.username||E.password||E.search||E.hash)throw new Error("Sign-in requires a clean HTTPS origin or local development origin.");let a=`import-${He([s.origin,t.machineId,t.instanceId].join(":")).slice(0,24)}`,d=Ze("x25519"),f=d.publicKey.export({format:"der",type:"spki"}).toString("base64"),w=O.object({deviceCode:O.string(),userCode:O.string(),expiresAt:O.string().datetime(),intervalSeconds:O.number().min(2).max(10)}).strict().parse(await ie(s.origin,"/api/cli/import/device",{publicKey:f,machineId:t.machineId,sourceInstanceId:t.instanceId,sourceLabel:P[t.source],sourceRoot:t.root,...x(e,"team")?{requestedTeamId:x(e,"team")}:{}})),h=`${s.origin}/console/connections/authorize?code=${encodeURIComponent(w.userCode)}`;for(console.log(`OpenPond sign-in code: ${w.userCode}
|
|
3
3
|
${h}`),st(h);Date.now()<Date.parse(w.expiresAt);){await new Promise(I=>setTimeout(I,w.intervalSeconds*1e3));let E;try{E=await ie(s.origin,"/api/cli/import/token",{deviceCode:w.deviceCode})}catch(I){if(Number(I.status)===429)continue;throw I}let p=O.object({state:O.enum(["pending","approved","denied","consumed"]),envelope:nt.nullable().optional()}).strict().parse(E);if(p.state==="denied"||p.state==="consumed")throw new Error("Browser sign-in was declined or already consumed. Start the connection again.");if(p.state!=="approved"||!p.envelope)continue;let S=p.envelope,v=et({key:Buffer.from(S.publicKey,"base64"),format:"der",type:"spki"});if(v.asymmetricKeyType!=="x25519")throw new Error("Invalid sign-in encryption key.");let i=Me("sha256").update(tt({privateKey:d.privateKey,publicKey:v})).digest(),u=rt("aes-256-gcm",i,Buffer.from(S.iv,"base64"));u.setAAD(Buffer.from(He(w.deviceCode))),u.setAuthTag(Buffer.from(S.tag,"base64"));let m=O.object({apiKey:O.string().min(1),teamId:O.string().min(1),expiresAt:O.string().datetime()}).strict().parse(JSON.parse(Buffer.concat([u.update(Buffer.from(S.ciphertext,"base64")),u.final()]).toString("utf8")));if(x(e,"team")&&m.teamId!==x(e,"team"))throw new Error("Browser approved a different workspace.");return await Re({handle:a,apiKey:m.apiKey,baseUrl:s.origin,apiBaseUrl:l.origin,setActive:!1}),await ie(s.origin,"/api/cli/import/token",{deviceCode:w.deviceCode,acknowledge:!0}),{apiKey:m.apiKey,teamId:m.teamId,baseUrl:l.origin,account:a,accountBaseUrl:s.origin}}throw new Error("Browser sign-in expired. Start the connection again.")}c(je,"authorizeImporter");import{homedir as it}from"node:os";import{join as at}from"node:path";async function Z(t){let e=await F(t.credentialHome??at(it(),".openpond"),()=>V({account:t.account,baseUrl:t.accountBaseUrl})),r=t.account?e.apiKey:Oe(e);if(!r)throw Object.assign(new Error("This source is disconnected. Reconnect it with OpenPond Importer to authorize collection."),{status:401});let n={apiKey:r,baseUrl:t.apiBaseUrl,teamId:t.teamId};return{evidence:new Ee(n),sync:new W(n)}}c(Z,"collectorClients");var ae=null,Pe={async heartbeat(t,e,r){let{sync:n}=await Z(t),o=await n.heartbeat({id:t.id,expectedRevision:t.revision,...e},AbortSignal.any([AbortSignal.timeout(6e4),...r?[r]:[]]));return{revision:o.revision,state:o.state,destinations:me(t,o),requestedSyncRevision:o.requestedSyncRevision,completedSyncRevision:o.completedSyncRevision}},async admit(t,e,r){let{evidence:n,sync:o}=await Z(t),s=AbortSignal.any([AbortSignal.timeout(6e4),...r?[r]:[]]),l=$([t.id,t.revision,t.apiBaseUrl,t.teamId,t.account,t.credentialHome,t.projectId,t.source.instanceId,e.branchLeafId,e.files]);if(ae?.key!==l){let S=Buffer.from(JSON.stringify(e.files.map(v=>({path:v.path,encoding:"utf8",base64:Buffer.from(v.text).toString("base64")}))));ae={key:l,bytes:S,upload:{hash:le(S),parts:Math.ceil(S.length/2e5)},nextPart:0}}let a=ae,d=a.upload;for(;a.nextPart<d.parts;){let S=a.nextPart;await n.uploadPart({...d,index:S,base64:a.bytes.subarray(S*2e5,(S+1)*2e5).toString("base64")},s),a.nextPart++}let f={upload:d,source:t.source.source,...e.branchLeafId?{branchLeafId:e.branchLeafId}:{},destination:{kind:"existing",projectId:t.projectId},acquisition:{machineId:t.source.machineId,sourceInstanceId:t.source.instanceId}},w=a.preview??=await n.preview(f,s);if(w.issues.length)throw Object.assign(new Error("Source schema was rejected; inspect the connection before resuming."),{status:400});let h=w.sessions.find(S=>S.sessionHash===e.contentHash);if(!h||e.boundaryIds.some(S=>!h.boundaries.some(v=>v.id===S&&v.projection==="turn"&&v.terminal!=="unknown")))throw Object.assign(new Error("Server preview differs from the retained source boundaries."),{status:400});let E={...f,operationId:e.operationId,previewHash:w.previewHash,selection:[{sessionHash:h.sessionHash,boundaryIds:e.boundaryIds}]},p=Ce.parse(await o.commit({connectionId:t.id,expectedRevision:t.revision,request:E},s));if(p.state!=="completed"||p.operationId!==e.operationId||p.requestHash!==$(E)||p.projectId!==t.projectId)throw new Error("Admission did not acknowledge this retained operation.")}};function ee(t){if(t.everyMinute!==void 0)throw new Error("Every-minute imports are no longer supported. Use --continual --hourly or a slower schedule.");let e=k(t.continual),r=["daily","weekly","hourly"].filter(d=>k(t[d]));t.cron!==void 0&&r.push("cron");let n=t.at!==void 0||t.on!==void 0;if(!e&&(r.length||n))throw new Error("Add --continual to enable recurring imports. Without it, imports run once.");if(!e)return null;if(r.length>1)throw new Error("Choose one cadence: --daily, --weekly, --hourly, or --cron.");if(t.off!==void 0)throw new Error("Choose --continual or --off, not both.");let o=r[0]??"daily";if(["cron","hourly"].includes(o)){if(n)throw new Error("--at and --on are for daily/weekly imports; use a cron expression for other times.");return o==="cron"?ge({frequency:"cron",expression:x(t,"cron")}):{frequency:"hourly"}}if(o!=="weekly"&&t.on!==void 0)throw new Error("--on selects a weekday and requires --weekly.");let s=we(t.at===void 0?"00:00":x(t,"at"));if(o==="daily")return{frequency:"daily",time:s};let l=t.on===void 0?"mon":x(t,"on").toLowerCase(),a=he.findIndex(d=>d===l);if(a<0)throw new Error("Use --on sun|mon|tue|wed|thu|fri|sat (default: mon).");return{frequency:"weekly",time:s,day:a}}c(ee,"importSchedule");import{setTimeout as ct}from"node:timers/promises";async function Le(t){console.log("Importing saved conversations. Ctrl+C cancels this run; queued work is retained.");let e=0;try{for(;!t.signal.aborted;){let o=(await M(t.directory)).connections.filter(a=>!t.connectionId||a.id===t.connectionId).find(a=>a.run?.state==="running"),s=o?.run,l=o&&s?`${o.source}: ${s.phase} \xB7 ${s.processed}/${s.discovered} conversations checked \xB7 ${s.uploaded} turns uploaded \xB7 ${o.queued} queued`:"Starting import\u2026";process.stdout.clearLine(0),process.stdout.cursorTo(0),process.stdout.write(`${["|","/","-","\\"][e++%4]} ${l}`);try{await ct(500,void 0,{signal:t.signal})}catch{if(!t.signal.aborted)throw new Error("Import progress interrupted.")}}}finally{process.stdout.clearLine(0),process.stdout.cursorTo(0)}}c(Le,"monitorImport");async function K(t){let e=new AbortController,r=c(()=>e.abort(new Error("Import cancelled.")),"stop");process.once("SIGINT",r),process.once("SIGTERM",r);let n=new AbortController,o=!!process.stdin.isTTY&&!!process.stdout.isTTY&&!t.json,s;try{let a=De({directory:t.directory,signal:e.signal,...t.connectionId?{connectionIds:[t.connectionId]}:{},...t.retainedStart?{}:{trigger:t.scheduled?"scheduled":"manual"},transport:Pe}).finally(()=>n.abort());await Promise.all([a,o?Le({directory:t.directory,connectionId:t.connectionId,signal:n.signal}):Promise.resolve()]),s=await M(t.directory)}finally{n.abort(),process.off("SIGINT",r),process.off("SIGTERM",r)}let l=s.connections.filter(a=>!t.connectionId||a.id===t.connectionId);if(t.json)console.log(JSON.stringify(s,null,2));else for(let a of l){let d=a.run;d&&console.log(`${a.source}: ${d.state}. ${d.processed} conversations checked, ${d.uploaded} turns uploaded, ${a.queued} queued.${d.error?` ${d.error}`:""}`),console.log(a.schedule?`Continual imports: ${J(a.schedule)} (${s.timezone}). Next: ${a.nextRunAt??"source paused"}.`:"Automatic sync is off. Run openpond import sync to import again.")}return e.signal.aborted?process.exitCode=130:l.some(a=>a.run?.state==="failed")&&(process.exitCode=1),s}c(K,"runImportJob");function te(t){return{directory:t,executable:process.execPath,args:[...process.execArgv,process.argv[1]],environment:{...process.env.OPENPOND_HOME?{OPENPOND_HOME:process.env.OPENPOND_HOME}:{},...process.env.ELECTRON_RUN_AS_NODE==="1"?{ELECTRON_RUN_AS_NODE:"1"}:{}}}}c(te,"collectorSetup");async function _e(t,e,r,n){let o=c(l=>console.log(JSON.stringify(l,null,2)),"print"),s=k(n.json);if(e==="status")return o(await M(t)),!0;if(e==="cancel")return o(await se(t,"stop")),!0;if(e==="schedule"){if(!r)throw new Error("Use openpond import schedule <connection-id> --continual [--daily|--weekly|--hourly|--cron <expression>] or --off.");let l=ee(n),a=k(n.off);if(!l&&!a)throw new Error("Choose --continual [--daily|--weekly|--hourly|--cron <expression>] or --off.");return o(await Y(te(t),r,l)),!0}if(e==="sync"){let l=await M(t);if(r&&!l.connections.some(a=>a.id===r&&a.state==="active"))throw new Error("Select an active connection from import status; resume or reconnect it first.");if(!l.connections.some(a=>a.state==="active"))throw new Error("No active sources. Connect or resume a source first.");return await K({directory:t,connectionId:r,json:s}),!0}if(e!=="service")return!1;if(r==="status")o(await M(t));else if(r==="stop")o(await se(t,"stop"));else if(r==="uninstall")o(await be(t));else if(r==="install")o(await Se(te(t)));else if(r==="start")await K({directory:t,json:s});else if(r==="run")await K({directory:t,json:s,scheduled:k(n.scheduled),retainedStart:!k(n.scheduled)});else throw new Error("usage: openpond import service <install|start|stop|status|run|uninstall>");return!0}c(_e,"runImporterControl");async function ce(t,e){let r=await D.open(t),n;try{n=r.connections().find(o=>o.id===e)}finally{r.close()}if(!n)throw new Error("Select a retained connection from openpond import status.");if(n.source.machineId!==await G(t))throw new Error("This connection belongs to another machine. Use explicit Connect setup.");if(!n.accountBaseUrl)throw new Error("The original sign-in destination is unavailable. Use explicit Connect setup.");return n}c(ce,"retainedReconnect");function Ke(t,e){if(!e?.available||!e.capabilities.history||e.source!==t.source.source||e.machineId!==t.source.machineId||e.instanceId!==t.source.instanceId||e.root!==t.source.root)throw new Error("The retained source is unavailable or its identity changed. Restore its original location or use explicit Connect setup.")}c(Ke,"assertReconnectSource");async function Je(t,e){let r=await ce(t,e.id),n=c(o=>({...o,destinations:void 0,requestedSyncRevision:o.requestedSyncRevision??0,completedSyncRevision:o.completedSyncRevision??0}),"scope");if($(n(r))!==$(n(e)))throw new Error("The connection changed during sign-in. Reconnect again after reviewing its current scope.")}c(Je,"assertReconnectUnchanged");import{createInterface as dt}from"node:readline/promises";async function Fe(t,e,r,n){let o=x(n,"session");if(!r||!o)throw new Error("Use openpond import branches <connection-id> --session <native-session-id>.");let s=await qe(t,r,o);if(e==="branches"){console.log(JSON.stringify(s,null,2));return}let l=process.stdin.isTTY&&process.stdout.isTTY&&!k(n.json),a=x(n,"leaf"),d=x(n,"revision");if(!a&&l){s.branches.forEach((h,E)=>console.log(`${E+1}. ${h.title||h.leafId} (${h.messages} messages; ${h.updatedAt||"date unavailable"})`));let w=dt({input:process.stdin,output:process.stdout});try{a=s.branches[Number(await w.question("Choose the branch to sync: "))-1]?.leafId??"",d=s.revision}finally{w.close()}}if(!a||!d)throw new Error("Supply --leaf and --revision from import branches, or choose interactively. No branch was selected.");if(!s.branches.some(w=>w.leafId===a)||d!==s.revision)throw new Error("Branch selection is stale or invalid. Run import branches again.");if(!k(n.yes)&&(!l||!await Q("Sync only this branch and its unambiguous future continuation for this conversation? Other branches stay excluded.",!1)))throw new Error("Branch selection was not approved.");let f=await Be(t,r,o,{leafId:a,revision:d});console.log(JSON.stringify({...f,next:`openpond import resume ${r}`},null,2))}c(Fe,"runImporterBranchCommand");async function Wr(t,e){let[r="connect",n]=e,o=Ye(x(t,"collectorDir")||Ie()),s=k(t.json),l=c(y=>console.log(JSON.stringify(y,null,2)),"print"),a=ee(t);if(a&&!["connect","reconnect","schedule"].includes(r))throw new Error("Use --continual with import connect, reconnect, or schedule.");if(k(t.off)&&r!=="schedule")throw new Error("Use import schedule <connection-id> --off to disable recurring imports.");if(r==="branches"||r==="branch"){await Fe(o,r,n,t);return}if(await _e(o,r,n,t))return;if(["pause","resume","disconnect"].includes(r)){let y=await D.open(o),b;try{b=y.connections().find(Ge=>Ge.id===n)}finally{y.close()}if(!b)throw new Error("Select a connection id from openpond import status.");let{sync:N}=await Z(b),H=await N.control({id:b.id,expectedRevision:b.revision,action:r});await ne(o,{...b,revision:H.revision,state:H.state}),l(H);return}let d=r==="reconnect"?await ce(o,n):null;d&&(t={...t,source:d.source.source,sourcePath:d.source.root,project:d.projectId,connection:d.id,team:d.teamId,apiBaseUrl:d.apiBaseUrl,baseUrl:d.accountBaseUrl});let f=x(t,"source");if(f&&!(f in P))throw new Error("Choose a supported native source name.");let w=await G(o),h=await ue({machineId:w,...f&&x(t,"sourcePath")?{locations:{[f]:Ye(x(t,"sourcePath"))}}:{}});if(r==="discover"){l(h);return}if(r!=="connect"&&r!=="reconnect")throw new Error("usage: openpond import <connect|reconnect|discover|status|sync|schedule|cancel|pause|resume|disconnect|branches|branch|service>");let E=h.filter(y=>y.source===f),p=E.length===1?E[0]:void 0,S=process.stdin.isTTY&&process.stdout.isTTY&&!s;if(d&&Ke(d,p),!p&&S){let y=E.length>1?E:h.filter(N=>N.available);y.forEach((N,H)=>console.log(`${H+1}. ${P[N.source]} ${N.root}${N.capabilities.history?"":` (${N.reason})`}`));let b=ze({input:process.stdin,output:process.stdout});try{p=y[Number(await b.question("Choose a source: "))-1]}finally{b.close()}}if(!p?.capabilities.history)throw new Error(p?.reason??(E.length>1?"Multiple source instances found. Select the exact --source-path or use interactive setup.":"Select --source and optionally --source-path."));let v=x(t,"range")||"week";if(!d&&S&&!t.range){let y=ze({input:process.stdin,output:process.stdout});try{v=(await y.question("Initial history: day, week, or all [default: week]: ")).trim()||"week"}finally{y.close()}}if(!["day","week","all"].includes(v))throw new Error("--range must be day, week or all.");let i=d?d.since:v==="all"?null:new Date(Date.now()-(v==="day"?1:7)*864e5).toISOString(),u=d?i?`since ${i}`:"all":v==="week"?`last week${t.range?"":" (default)"}`:v==="day"?"last day":"all",m=await L(p,{since:i??void 0,limit:100});s||console.log(`Found ${m.items.length}${m.nextCursor?"+":""} sessions in ${p.root}. Initial history: ${u}.`),s||console.log(a?`Continual imports: ${J(a)} local time. Continual learning is unchanged.`:"One-time import. Continual imports default to off; existing schedules are unchanged.");let I=x(t,"project");if(!k(t.yes)&&(!S||!await Q(`Sync this source to ${I||"your personal Imported conversations Project"} and ${a?`enable continual imports ${J(a)} local time`:"import once (no new schedule)"}?`,!0)))throw new Error("Connection was not approved. No history was uploaded.");let R=d?d.credentialHome??lt(ut(),".openpond"):de(),A=await F(R,()=>je(p,t)),T=new W(A),U=x(t,"connection")||`sync-${$([A.baseUrl,A.teamId,p.instanceId,I||"default"]).slice(0,40)}`;d&&await Je(o,d);let g=(await T.list()).items.find(y=>y.id===U),C=await T.register({id:U,source:p.source,machineId:w,sourceInstanceId:p.instanceId,sourceLabel:P[p.source],sourceRoot:p.root,destination:I?{kind:"existing",projectId:I}:{kind:"new",name:"Imported conversations"},since:i,keepSyncing:!1,expectedRevision:g?.revision??0});await ne(o,{id:C.id,teamId:A.teamId,apiBaseUrl:A.baseUrl,account:A.account,accountBaseUrl:A.accountBaseUrl,credentialHome:R,source:p,projectId:C.projectId,revision:C.revision,requestedSyncRevision:C.requestedSyncRevision,completedSyncRevision:C.completedSyncRevision,since:i,keepSyncing:!1,state:C.state}),a&&await Y(te(o),C.id,a),await K({directory:o,connectionId:C.id,json:s})}c(Wr,"runImportCommand");export{Wr as runImportCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{$ as aa,$a as ab,$b as ac,A as B,Aa as Ba,Ab as Bb,B as C,Ba as Ca,Bb as Cb,C as D,Ca as Da,Cb as Db,D as E,Da as Ea,Db as Eb,E as F,Ea as Fa,Eb as Fb,F as G,Fa as Ga,Fb as Gb,G as H,Ga as Ha,Gb as Hb,H as I,Ha as Ia,Hb as Ib,I as J,Ia as Ja,Ib as Jb,J as K,Ja as Ka,Jb as Kb,K as L,Ka as La,Kb as Lb,L as M,La as Ma,Lb as Mb,M as N,Ma as Na,Mb as Nb,N as O,Na as Oa,Nb as Ob,O as P,Oa as Pa,Ob as Pb,P as Q,Pa as Qa,Pb as Qb,Q as R,Qa as Ra,Qb as Rb,R as S,Ra as Sa,Rb as Sb,S as T,Sa as Ta,Sb as Tb,T as U,Ta as Ua,Tb as Ub,U as V,Ua as Va,Ub as Vb,V as W,Va as Wa,Vb as Wb,W as X,Wa as Xa,Wb as Xb,X as Y,Xa as Ya,Xb as Yb,Y as Z,Ya as Za,Yb as Zb,Z as _,Za as _a,Zb as _b,_ as $,_a as $a,_b as $b,a as b,aa as ba,ab as bb,ac as bc,b as c,ba as ca,bb as cb,bc as cc,c as d,ca as da,cb as db,cc as dc,d as e,da as ea,db as eb,dc as ec,e as f,ea as fa,eb as fb,ec as fc,f as g,fa as ga,fb as gb,fc as gc,g as h,ga as ha,gb as hb,gc as hc,h as i,ha as ia,hb as ib,hc as ic,i as j,ia as ja,ib as jb,ic as jc,j as k,ja as ka,jb as kb,jc as kc,k as l,ka as la,kb as lb,kc as lc,l as m,la as ma,lb as mb,lc as mc,m as n,ma as na,mb as nb,mc as nc,n as o,na as oa,nb as ob,o as p,oa as pa,ob as pb,p as q,pa as qa,pb as qb,q as r,qa as ra,qb as rb,r as s,ra as sa,rb as sb,s as t,sa as ta,sb as tb,t as u,ta as ua,tb as ub,u as v,ua as va,ub as vb,v as w,va as wa,vb as wb,w as x,wa as xa,wb as xb,x as y,xa as ya,xb as yb,y as z,ya as za,yb as zb,z as A,za as Aa,zb as Ab}from"./chunk-
|
|
2
|
+
import{$ as aa,$a as ab,$b as ac,A as B,Aa as Ba,Ab as Bb,B as C,Ba as Ca,Bb as Cb,C as D,Ca as Da,Cb as Db,D as E,Da as Ea,Db as Eb,E as F,Ea as Fa,Eb as Fb,F as G,Fa as Ga,Fb as Gb,G as H,Ga as Ha,Gb as Hb,H as I,Ha as Ia,Hb as Ib,I as J,Ia as Ja,Ib as Jb,J as K,Ja as Ka,Jb as Kb,K as L,Ka as La,Kb as Lb,L as M,La as Ma,Lb as Mb,M as N,Ma as Na,Mb as Nb,N as O,Na as Oa,Nb as Ob,O as P,Oa as Pa,Ob as Pb,P as Q,Pa as Qa,Pb as Qb,Q as R,Qa as Ra,Qb as Rb,R as S,Ra as Sa,Rb as Sb,S as T,Sa as Ta,Sb as Tb,T as U,Ta as Ua,Tb as Ub,U as V,Ua as Va,Ub as Vb,V as W,Va as Wa,Vb as Wb,W as X,Wa as Xa,Wb as Xb,X as Y,Xa as Ya,Xb as Yb,Y as Z,Ya as Za,Yb as Zb,Z as _,Za as _a,Zb as _b,_ as $,_a as $a,_b as $b,a as b,aa as ba,ab as bb,ac as bc,b as c,ba as ca,bb as cb,bc as cc,c as d,ca as da,cb as db,cc as dc,d as e,da as ea,db as eb,dc as ec,e as f,ea as fa,eb as fb,ec as fc,f as g,fa as ga,fb as gb,fc as gc,g as h,ga as ha,gb as hb,gc as hc,h as i,ha as ia,hb as ib,hc as ic,i as j,ia as ja,ib as jb,ic as jc,j as k,ja as ka,jb as kb,jc as kc,k as l,ka as la,kb as lb,kc as lc,l as m,la as ma,lb as mb,lc as mc,m as n,ma as na,mb as nb,mc as nc,n as o,na as oa,nb as ob,o as p,oa as pa,ob as pb,p as q,pa as qa,pb as qb,q as r,qa as ra,qb as rb,r as s,ra as sa,rb as sb,s as t,sa as ta,sb as tb,t as u,ta as ua,tb as ub,u as v,ua as va,ub as vb,v as w,va as wa,vb as wb,w as x,wa as xa,wb as xb,x as y,xa as ya,xb as yb,y as z,ya as za,yb as zb,z as A,za as Aa,zb as Ab}from"./chunk-SFNCAPCJ.js";import{h as a}from"./chunk-RCA6NGVA.js";import"./chunk-VHSX3JPX.js";import"./chunk-BIPQCJ5V.js";import"./chunk-PF56N7ZY.js";import"./chunk-FTQLQJQV.js";export{fc as AcceptanceAttemptSchema,Zb as AcceptanceCheckSchema,dc as AcceptanceGroupManifestContentSchema,ec as AcceptanceGroupManifestSchema,gc as AcceptanceGroupSnapshotContentSchema,hc as AcceptanceGroupSnapshotSchema,bc as AcceptanceMeasurementSchema,_b as AcceptancePlanContentSchema,$b as AcceptancePlanSchema,Da as ApplyTaskCorrectionCommandSchema,Ka as ArchiveAuthoringDraftCommandSchema,oa as AuthoringDraftContentSchema,qa as AuthoringDraftFinalizationSchema,na as AuthoringDraftInputSchema,pa as AuthoringDraftSchema,ma as AuthoringTargetKindSchema,g as BoundJudgeResponseSchema,Qa as CancelLearningIterationCommandSchema,Pa as CancelLearningIterationReservationCommandSchema,Ma as CancelRewardCheckCommandSchema,Ia as CancelTaskGradeCommandSchema,la as CombinedRewardAuthoringFieldsSchema,Ya as DEFAULT_REWARD_VERIFIER_SOURCE,ya as ImportTaskIntakeCommandSchema,i as JudgeCallReservationSchema,J as LearningAcceptedParentSchema,Wb as LearningCandidateDecisionObservationSchema,ea as LearningChainSchema,Ab as LearningCommandRequestSchema,Sa as LearningCommandSchema,lb as LearningConflictError,ga as LearningConsumptionSchema,a as LearningDomainError,fa as LearningEligibilityCountsSchema,Ua as LearningIterationDispatchSchema,Va as LearningIterationObservationSchema,ha as LearningIterationReservationSchema,L as LearningIterationSchema,K as LearningIterationStatusSchema,Ta as LearningIterationSubmissionSchema,da as LearningIterationTriggerSchema,o as LearningJsonObjectSchema,q as LearningJsonPointerSchema,Db as LearningOperationResultSchema,H as LearningPolicyContentSchema,tb as LearningPolicyInspectionResultSchema,I as LearningPolicySchema,Bb as LearningReadRequestSchema,kb as LearningResourceKindSchema,N as LearningResourceSchema,u as LearningReviewOriginSchema,p as LearningRevisionRefSchema,Xa as LearningScheduleFireSchema,Wa as LearningScheduleSchema,v as LearningSourceContentSchema,w as LearningSourceSchema,xb as LearningTaskQueueInspectionSchema,b as LearningTextAssetContentSchema,c as LearningTextAssetSchema,Ob as MAX_REWARD_CALIBRATION_CLOSURE_BYTES,l as NightlyScheduleSchema,Na as PublishCheckedRewardCommandSchema,za as PublishLearningResourceCommandSchema,Aa as PublishLearningResourcesCommandSchema,La as QueueRewardCheckCommandSchema,Fa as QueueTaskGradeCommandSchema,Oa as ReserveLearningIterationCommandSchema,Ea as ResolveTaskFeedbackCommandSchema,Ra as RetryLearningIterationDispatchCommandSchema,Ga as ReviewTaskEvidenceCommandSchema,ja as RewardAuthoringFieldsSchema,Pb as RewardCalibrationClosureSchema,eb as RewardCheckRunSchema,cb as RewardCheckRuntimeSchema,ia as RewardFixtureAuthoringFieldsSchema,db as RewardFixtureCheckResultSchema,bb as RewardFixtureSchema,Ja as SaveAuthoringDraftCommandSchema,Ha as SealTaskBatchCommandSchema,Ba as SubmitTaskExampleCommandSchema,Ca as SubmitTaskFeedbackCommandSchema,ra as TASK_INTAKE_LIMITS,D as TaskAdmissionDecisionContentSchema,E as TaskAdmissionDecisionSchema,F as TaskBatchContentSchema,aa as TaskBatchPackageMetadataSchema,G as TaskBatchSchema,r as TaskDefinitionContentSchema,s as TaskDefinitionSchema,y as TaskEvidenceContentSchema,Cb as TaskEvidenceInspectionResultSchema,z as TaskEvidenceSchema,x as TaskExampleSubmissionSchema,C as TaskFeedbackSchema,B as TaskFeedbackSubmissionSchema,ka as TaskFormatAuthoringFieldsSchema,M as TaskGradeRunSchema,ta as TaskIntakeFileSchema,sa as TaskIntakeFormatSchema,va as TaskIntakePreviewSchema,ua as TaskIntakeRecordSchema,A as TaskRatingSchema,t as TaskSourceMappingSchema,f as TrainingHandoffOriginSchema,nc as acceptanceGroupVerdict,mc as assertAcceptanceBaselineReuse,kc as assertAcceptanceGroupSnapshot,lc as assertAcceptanceGroupUpdate,Y as assertAdmissionDecision,Z as assertGradeIdentity,R as assertLearningContentHash,zb as assertLearningRequestJson,wb as assertRewardCalibration,ab as authoringNumber,n as coalesceNightlyOccurrences,Za as compileRewardAuthoring,gb as compileRewardCheck,fb as compileRewardFixtures,ba as compileTaskBatch,ic as createAcceptanceGroupManifest,jc as createAcceptanceGroupSnapshot,ac as createAcceptancePlan,h as createBoundModelJudgeRunner,k as createBudgetedJudgeExecutor,Nb as createBudgetedRewardFixtureExecutor,Hb as createBuiltinTaskGradeExecutor,Mb as createIsolatedRewardFixtureExecutor,Vb as createLearningIterationWorker,Yb as createLearningScheduleWorker,Gb as createLearningService,d as createLearningTextAsset,Rb as createRewardCalibrationClosure,Kb as createRewardCheckJudgeBudgetStore,Ub as createRewardCheckWorker,Lb as createTaskGradeJudgeBudgetStore,Ib as createTaskGradeWorker,Eb as decodeTaskIntakeText,cc as evaluateAcceptancePlan,hb as executeRewardFixture,Sb as exportRewardCalibrationClosure,ub as inspectLearningPolicy,yb as inspectLearningTaskQueue,S as inspectTaskEvidence,xa as intakeDate,wa as intakeId,j as judgeCommittedSpend,ob as learningEvidenceId,pb as learningOperationId,O as learningRef,jb as learningResourceSchemas,rb as learningScheduleId,U as mapTaskSourceRecord,ib as matchRewardFixture,m as nextNightlyOccurrence,$a as parseRewardAuthoringObject,Fb as previewTaskIntake,vb as qualifyRewardCheck,V as readTaskJsonPointer,Xb as reconcileLearningCandidateDecision,nb as requireLearningRelease,mb as requireLearningResource,qb as resolveLearningTrainingParent,_a as rewardAuthoringFields,Tb as rewardCalibrationClosureAsset,Jb as rewardFixtureFromRating,P as sameLearningRef,Q as sealLearningContent,$ as sealTaskBatch,sb as synchronizeLearningSchedule,X as taskAttemptEvidence,ca as taskBatchPackageMetadata,_ as taskFamilyReservations,W as taskRecordFromEvidence,T as validateSourceSubmission,e as verifyLearningTextAsset,Qb as verifyRewardCalibrationClosure};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{a}from"./chunk-F5KCCDQM.js";import"./chunk-D4UX2O45.js";import"./chunk-MS37ISA4.js";import"./chunk-STWRTNRK.js";import"./chunk-IZ6DLEVY.js";import"./chunk-5RHYSQZ5.js";import"./chunk-JHMS2WXM.js";import"./chunk-EXJGCNRS.js";import"./chunk-M3ZQDPRS.js";import"./chunk-KCJVFLBB.js";import"./chunk-7RC5WPVT.js";import"./chunk-A3L74U3W.js";import"./chunk-7KWD2I6W.js";import"./chunk-XQBIHPPX.js";import"./chunk-LO3O45IX.js";import"./chunk-FSQWAANK.js";import"./chunk-ZR7LIMJS.js";import"./chunk-OQPJ7FJF.js";import"./chunk-PCNLC5H3.js";import"./chunk-P7HRF4FM.js";import"./chunk-UFHLLSCE.js";import"./chunk-2ITZW2CN.js";import"./chunk-HCEJAOIF.js";import"./chunk-6GWOVHIG.js";import"./chunk-QGOPYQW3.js";import"./chunk-O4FBOUNX.js";import"./chunk-5ZBLCWEJ.js";import"./chunk-WYZWDMMF.js";import"./chunk-DG4TYVPF.js";import"./chunk-PWK5Z5S3.js";import"./chunk-DDMZSZFL.js";import"./chunk-W45RKGM6.js";import"./chunk-2MMCZHKL.js";import"./chunk-WGX7WY4N.js";import"./chunk-7YTHEMWI.js";import"./chunk-L3KS6MOV.js";import"./chunk-XO3H32KX.js";import"./chunk-DIGX56JY.js";import"./chunk-R7YEURUQ.js";import"./chunk-DZUAT3TP.js";import"./chunk-H3BSIAQO.js";import"./chunk-637UACKH.js";import"./chunk-A66CSUBJ.js";import"./chunk-SPDSSMFD.js";import"./chunk-E63VWAQA.js";import"./chunk-PR5TYTY4.js";import"./chunk-KNO355LC.js";import"./chunk-Y54RKLOI.js";import"./chunk-2SUMZ73C.js";import"./chunk-M55H7KVR.js";import"./chunk-BK63OQRW.js";import"./chunk-V4KT5FCJ.js";import"./chunk-6FA3GG5B.js";import"./chunk-LHA7RQBA.js";import"./chunk-SG6JZ7HD.js";import"./chunk-ON2RNOCG.js";import"./chunk-H7IWJN7L.js";import"./chunk-SFNCAPCJ.js";import"./chunk-RCA6NGVA.js";import"./chunk-VHSX3JPX.js";import"./chunk-BIPQCJ5V.js";import"./chunk-PF56N7ZY.js";import"./chunk-FTQLQJQV.js";export{a as createLocalHarnessImprovementRuntime};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{i as a,j as b}from"./chunk-PKALOVHC.js";import"./chunk-NCKXI2VB.js";import"./chunk-TOFMA2L5.js";import"./chunk-44LWH5U6.js";import"./chunk-XVDFJ3ZF.js";import"./chunk-WHREO7A2.js";import"./chunk-OWK7HU5I.js";import"./chunk-V2HMWCT6.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-I2NXNMRZ.js";import"./chunk-BIQ33JV5.js";import"./chunk-J24I74EM.js";import"./chunk-OY5HC2P6.js";import"./chunk-GOYBYYPQ.js";import"./chunk-WS2ZZBAQ.js";import"./chunk-AN525SPP.js";import"./chunk-SYUKES6H.js";import"./chunk-IZ6DLEVY.js";import"./chunk-A3L74U3W.js";import"./chunk-7KWD2I6W.js";import"./chunk-XQBIHPPX.js";import"./chunk-7LZISGTA.js";import"./chunk-BFKYRQMA.js";import"./chunk-LO3O45IX.js";import"./chunk-LD7PGREF.js";import"./chunk-XW6HGSIT.js";import"./chunk-KVTBX2UP.js";import"./chunk-FSQWAANK.js";import"./chunk-ZR7LIMJS.js";import"./chunk-OQPJ7FJF.js";import"./chunk-PCNLC5H3.js";import"./chunk-P7HRF4FM.js";import"./chunk-UFHLLSCE.js";import"./chunk-2ITZW2CN.js";import"./chunk-HCEJAOIF.js";import"./chunk-6GWOVHIG.js";import"./chunk-QGOPYQW3.js";import"./chunk-O4FBOUNX.js";import"./chunk-5ZBLCWEJ.js";import"./chunk-WYZWDMMF.js";import"./chunk-DG4TYVPF.js";import"./chunk-PWK5Z5S3.js";import"./chunk-DDMZSZFL.js";import"./chunk-W45RKGM6.js";import"./chunk-2MMCZHKL.js";import"./chunk-WGX7WY4N.js";import"./chunk-L3KS6MOV.js";import"./chunk-XO3H32KX.js";import"./chunk-DIGX56JY.js";import"./chunk-R7YEURUQ.js";import"./chunk-DZUAT3TP.js";import"./chunk-H3BSIAQO.js";import"./chunk-637UACKH.js";import"./chunk-A66CSUBJ.js";import"./chunk-SPDSSMFD.js";import"./chunk-E63VWAQA.js";import"./chunk-PR5TYTY4.js";import"./chunk-YR5ID2SS.js";import"./chunk-KNO355LC.js";import"./chunk-Y54RKLOI.js";import"./chunk-2SUMZ73C.js";import"./chunk-M55H7KVR.js";import"./chunk-BK63OQRW.js";import"./chunk-V4KT5FCJ.js";import"./chunk-6FA3GG5B.js";import"./chunk-LHA7RQBA.js";import"./chunk-SG6JZ7HD.js";import"./chunk-ON2RNOCG.js";import"./chunk-H7IWJN7L.js";import"./chunk-SFNCAPCJ.js";import"./chunk-RCA6NGVA.js";import"./chunk-VHSX3JPX.js";import"./chunk-BIPQCJ5V.js";import"./chunk-PF56N7ZY.js";import"./chunk-FTQLQJQV.js";export{a as createLocalHarnessTasksetReviewControl,b as runLocalHarnessEvaluationBaseline};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d,e}from"./chunk-
|
|
2
|
+
import{a,b,c,d,e}from"./chunk-JHR3LF2F.js";import"./chunk-PF56N7ZY.js";import"./chunk-FTQLQJQV.js";export{a as DeviceLocalOwnerSchema,b as deviceLocalOwner,c as deviceOwnsLocalSession,e as preserveDeviceSessionIdentity,d as publicSessionMetadata};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import"./chunk-DDMZSZFL.js";import{A as s,B as t,C as u,D as v,E as w,F as x,G as y,H as z,I as A,J as B,K as C,L as D,b,f as c,g as d,m as e,n as f,o as g,p as h,q as i,r as j,s as k,t as l,u as m,v as n,w as o,x as p,y as q,z as r}from"./chunk-
|
|
2
|
+
import"./chunk-DDMZSZFL.js";import{A as s,B as t,C as u,D as v,E as w,F as x,G as y,H as z,I as A,J as B,K as C,L as D,b,f as c,g as d,m as e,n as f,o as g,p as h,q as i,r as j,s as k,t as l,u as m,v as n,w as o,x as p,y as q,z as r}from"./chunk-E63VWAQA.js";import{a}from"./chunk-PR5TYTY4.js";import"./chunk-SFNCAPCJ.js";import"./chunk-RCA6NGVA.js";import"./chunk-VHSX3JPX.js";import"./chunk-BIPQCJ5V.js";import"./chunk-PF56N7ZY.js";import"./chunk-FTQLQJQV.js";export{A as HostedModelProjectDetailSchema,n as HostedModelProjectLinkSchema,y as HostedModelProjectSummarySchema,x as HostedModelProjectSyncSchema,m as HostedModelProjectTrainingSetupSchema,d as MODEL_PROJECT_API_RESPONSE_MAX_BYTES,c as MODEL_PROJECT_SYNC_MAX_BYTES,a as ModelInitialLearningSchema,k as ModelProfileEvaluationSelectionSchema,j as ModelProfileSourceSelectionSchema,B as ModelProjectApiErrorSchema,t as ModelProjectBaseModelCandidateSchema,g as ModelProjectBaseModelSchema,s as ModelProjectConfigurationCheckSchema,q as ModelProjectEditableSchema,e as ModelProjectImmutableRefSchema,i as ModelProjectRecipeDocumentSchema,z as ModelProjectResourceSummarySchema,r as ModelProjectSaveRequestSchema,p as ModelProjectSchema,o as ModelProjectTasksetSyncSchema,h as ModelProjectTrainingMethodSchema,l as ModelProjectTrainingSetupSchema,f as ModelProjectVersionedRefSchema,b as OPENPOND_MODEL_PROJECT_MEDIA_TYPE,C as OpenPondModelProjectApiError,w as createModelProjectSaveRequest,D as createModelProjectsClient,u as modelProjectConfigurationHash,v as parseModelProjectSaveRequest};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import"./chunk-ISFIDCIH.js";import{c as B}from"./chunk-23P2O7PH.js";import"./chunk-AW5Q6NXT.js";import"./chunk-YVNDDNMK.js";import"./chunk-XRKFTPHD.js";import{c as U,d as C,f as O}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{f as m}from"./chunk-3M53YXEI.js";import{a as u,c as A,d as x,i as v,j as S,k as R}from"./chunk-JEVA7YQL.js";import"./chunk-EL454L26.js";import"./chunk-BT5YNE5U.js";import"./chunk-PXS4SVQG.js";import"./chunk-FWIPHEVA.js";import{d as k}from"./chunk-ENSB6ZTM.js";import"./chunk-GLUWATL5.js";import"./chunk-RYGWCN2R.js";import"./chunk-ZZWAQBA2.js";import"./chunk-YR5ID2SS.js";import"./chunk-KNO355LC.js";import"./chunk-Y54RKLOI.js";import"./chunk-2SUMZ73C.js";import"./chunk-M55H7KVR.js";import"./chunk-BK63OQRW.js";import"./chunk-V4KT5FCJ.js";import"./chunk-LHA7RQBA.js";import{M as y}from"./chunk-SG6JZ7HD.js";import"./chunk-ON2RNOCG.js";import"./chunk-H7IWJN7L.js";import"./chunk-SFNCAPCJ.js";import"./chunk-RCA6NGVA.js";import"./chunk-VHSX3JPX.js";import"./chunk-BIPQCJ5V.js";import"./chunk-PF56N7ZY.js";import{a as i}from"./chunk-FTQLQJQV.js";import{randomUUID as b}from"node:crypto";async function G(r,t){let e=t[0]||"smoke",n=await k(),l=await B(n,O(n)),c=P(n,r);if(e==="provider-catalog"||e==="providers-catalog"||e==="catalog"){let a=await E({apiBaseUrl:c,token:l});console.log(JSON.stringify(a,null,2));return}if(e==="models"||e==="model-list"){let a=await A({apiBaseUrl:c,token:l});console.log(JSON.stringify(a,null,2));return}if(e==="model"||e==="model-get"){let a=t[1]||o(r,"model");if(!a)throw new Error("usage: opchat model <model>");let p=await x({apiBaseUrl:c,token:l,model:a});console.log(JSON.stringify(p,null,2));return}if(e==="chat"){let a=o(r,"model")||"openpond-chat",p=o(r,"effort"),f=p?y.parse(p):void 0,d=o(r,"message")||o(r,"prompt")||"Reply with a short confirmation from OpChat.";if(!m(r.stream)){let s=await v({apiBaseUrl:c,token:l,model:a,reasoningEffort:f,messages:[{role:"user",content:d}]});console.log(JSON.stringify(s,null,2));return}let g="",h=null,w=null;for await(let s of S({apiBaseUrl:c,token:l,model:a,reasoningEffort:f,messages:[{role:"user",content:d}]}))s.type==="text_delta"?(g+=s.text,process.stdout.write(s.text)):s.type==="finish"?h=s.finishReason:s.type==="usage"&&(w=s.usage);process.stdout.write(`
|
|
3
|
+
`),console.log(JSON.stringify({finishReason:h,usage:w,text:g},null,2));return}if(e==="smoke"){let a=await R({apiBaseUrl:c,token:l,defaultModel:o(r,"model")||void 0,compatibilityModel:o(r,"compatibilityModel")||o(r,"compatModel")||void 0,skipStream:m(r.skipStream),skipTool:m(r.skipTool),log:i(p=>console.log(p),"log")});m(r.json)&&console.log(JSON.stringify(a,null,2));return}throw new Error("usage: opchat <provider-catalog|models|model|chat|smoke> [--opchat-api-base-url <url>] [chat --model <id> --effort <off|low|medium|high|xhigh|max>]")}i(G,"runOpChatCommand");async function E(r){let t=r.apiBaseUrl.trim().replace(/\/+$/,"");if(!t)throw new Error("OpChat API base URL is required.");let e=r.token.trim();if(!e)throw new Error("OpenPond API key is required.");let n=await fetch(`${t}/provider-catalog`,{method:"GET",headers:{Authorization:`Bearer ${e}`,Accept:"application/json","Content-Type":"application/json","x-openpond-client":"openpond-cli","x-openpond-request-id":b()}});if(!n.ok)throw new Error(`Hosted provider catalog failed: ${n.status} ${await T(n)}`);return n.json()}i(E,"getOpChatProviderCatalog");async function T(r){let t=await r.text().catch(()=>"");if(!t)return r.statusText||`HTTP ${r.status}`;try{let e=JSON.parse(t);if(typeof e.message=="string")return e.message;if(typeof e.error=="string")return e.error;if(e.error&&typeof e.error=="object"&&!Array.isArray(e.error)){let n=e.error;return[n.code,n.message].filter(Boolean).join(": ")||t}return t}catch{return t}}i(T,"readResponseError");function P(r,t){let e=o(t,"opchatApiBaseUrl")||o(t,"opchatApiBaseurl")||o(t,"opChatApiBaseUrl")||o(t,"opChatApiBaseurl")||o(t,"opchatApiUrl")||o(t,"opChatApiUrl");return e?u({opChatApiBaseUrl:e}):u({apiBaseUrl:U(t)||r.apiBaseUrl,chatApiBaseUrl:C(t)||r.chatApiBaseUrl})}i(P,"resolveOpChatCliBaseUrl");function o(r,t){let e=r[t];return typeof e=="string"?e.trim():""}i(o,"optionString");export{G as runOpChatCommand};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{m as B}from"./chunk-ISFIDCIH.js";import"./chunk-23P2O7PH.js";import"./chunk-AW5Q6NXT.js";import"./chunk-YVNDDNMK.js";import"./chunk-XRKFTPHD.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{a as _,f as b,h as k,i as E}from"./chunk-3M53YXEI.js";import"./chunk-BFKYRQMA.js";import"./chunk-LO3O45IX.js";import"./chunk-5ZBLCWEJ.js";import"./chunk-EL454L26.js";import"./chunk-BT5YNE5U.js";import"./chunk-PXS4SVQG.js";import"./chunk-FWIPHEVA.js";import"./chunk-ENSB6ZTM.js";import"./chunk-GLUWATL5.js";import"./chunk-RYGWCN2R.js";import"./chunk-ZZWAQBA2.js";import{d as x,e as C}from"./chunk-YR5ID2SS.js";import"./chunk-KNO355LC.js";import"./chunk-Y54RKLOI.js";import"./chunk-2SUMZ73C.js";import"./chunk-M55H7KVR.js";import"./chunk-BK63OQRW.js";import"./chunk-V4KT5FCJ.js";import"./chunk-6FA3GG5B.js";import"./chunk-LHA7RQBA.js";import"./chunk-SG6JZ7HD.js";import"./chunk-ON2RNOCG.js";import"./chunk-H7IWJN7L.js";import"./chunk-SFNCAPCJ.js";import"./chunk-RCA6NGVA.js";import"./chunk-VHSX3JPX.js";import"./chunk-BIPQCJ5V.js";import"./chunk-PF56N7ZY.js";import{a as o}from"./chunk-FTQLQJQV.js";import{createHash as re,randomBytes as se}from"node:crypto";import{createServer as ie}from"node:http";var Ue=new URL(C).hostname,ve=new URL(x).hostname,Se=`${C}/opchat/v1`;import{spawn as oe}from"node:child_process";function M(e,t=process.platform){return t==="darwin"?{command:"open",args:[e]}:t==="win32"?{command:"rundll32.exe",args:["url.dll,FileProtocolHandler",e]}:{command:"xdg-open",args:[e]}}o(M,"resolveSystemBrowserCommand");async function S(e,t={}){let n=t.command??M(e),s=t.handoffTimeoutMs??1500;return new Promise(u=>{let r=!1,i=null,c=o(a=>{r||(r=!0,i&&clearTimeout(i),u(a))},"finish"),p=oe(n.command,n.args,{detached:!1,shell:!1,stdio:"ignore",windowsHide:!0});p.once("error",a=>{let l=a.code;c({opened:!1,error:l?`browser launcher ${n.command} failed (${l})`:`browser launcher ${n.command} failed`})}),p.once("close",(a,l)=>{if(a===0){c({opened:!0});return}let d=l?`signal ${l}`:`code ${a??"unknown"}`;c({opened:!1,error:`browser launcher ${n.command} exited with ${d}`})}),i=setTimeout(()=>{p.unref(),c({opened:!0})},s),i.unref()})}o(S,"openUrlWithSystemBrowser");function ae(e){return[e.slug,`team=${e.teamId}`,`role=${e.role}`,`status=${e.status}`,e.displayName].join(" ")}o(ae,"formatOrganizationLine");function le(e){return[e.email??e.userId,`user=${e.userId}`,`role=${e.role}`,e.createdAt].join(" ")}o(le,"formatOrganizationMemberLine");function ce(e){return e?[e.slug,`team=${e.teamId}`,`status=${e.status}`,`tools=${e.toolset.join(",")||"-"}`,e.resourceUrl].join(" "):"no mcp server configured"}o(ce,"formatOrganizationMcpServerLine");var ue=["estimate.read","estimate.write","estimate.execute","artifacts.read","artifacts.write"];function O(e){let t=e.trim().replace(/\/$/,"");if(!t)throw new Error("MCP resource URL must be non-empty");return new URL(t).toString().replace(/\/$/,"")}o(O,"normalizeMcpResourceUrl");function N(e,t){let n=typeof t.resourceUrl=="string"&&t.resourceUrl.trim()?t.resourceUrl.trim():typeof t.url=="string"&&t.url.trim()?t.url.trim():"";if(n)return O(n);if(!e?.resourceUrl)throw new Error("organization does not have an MCP server; run organizations mcp-generate first");return O(e.resourceUrl)}o(N,"resolveMcpProbeResourceUrl");function D(e,t){let n=typeof t.origin=="string"&&t.origin.trim()?t.origin.trim():"";return n?O(n):new URL(e).origin}o(D,"resolveMcpProbeOrigin");function $(e=32){return se(e).toString("base64url")}o($,"randomOauthToken");function de(e){return re("sha256").update(e).digest("base64url")}o(de,"buildMcpOauthPkceChallenge");function pe(e){let t=typeof e.scope=="string"&&e.scope.trim()?e.scope:typeof e.scopes=="string"&&e.scopes.trim()?e.scopes:"";if(!t)return[...ue];let n=t.split(/[,\s]+/g).map(s=>s.trim()).filter(Boolean);if(n.length===0)throw new Error("scope must include at least one OAuth scope");return n}o(pe,"parseMcpOAuthScopes");function me(e){let t=typeof e.clientId=="string"&&e.clientId.trim()?e.clientId.trim():"openpond-code-mcp-proof";if(t==="true")throw new Error("client-id must be a non-empty value");return t}o(me,"resolveMcpOAuthClientId");function fe(e){let t=k(e.timeoutSeconds,"timeout-seconds")??k(e.timeout,"timeout")??180;if(t<=0)throw new Error("timeout must be greater than zero");return t*1e3}o(fe,"resolveMcpOAuthTimeoutMs");function ge(e){let t=k(e.callbackPort,"callback-port")??0;if(t<0||t>65535)throw new Error("callback-port must be between 0 and 65535");return t}o(ge,"resolveMcpOAuthCallbackPort");function j(e){return new Promise((t,n)=>{e.close(s=>{s?n(s):t()})})}o(j,"closeServer");async function he(e){let t=!1,n=null,s=null,u=null,r=new Promise((a,l)=>{s=a,u=l}),i=o((a,l,d,m,f)=>{if(t){a.writeHead(204).end();return}t=!0,a.writeHead(l,{"cache-control":"no-store","content-type":"text/html; charset=utf-8"}),a.end(d),n&&clearTimeout(n),m?s?.(m):u?.(f??new Error("oauth_callback_failed"))},"settle"),c=ie((a,l)=>{let d=a.headers.host??"127.0.0.1",m=new URL(a.url??"/",`http://${d}`);if(m.pathname!=="/callback"){l.writeHead(404,{"content-type":"text/plain; charset=utf-8"}),l.end("Not found");return}let f=m.searchParams.get("state")??"",g=m.searchParams.get("error")??"",P=m.searchParams.get("code")??"";if(f!==e.expectedState){i(l,400,"<!doctype html><title>OpenPond OAuth failed</title><p>State mismatch. Return to the terminal and retry.</p>",void 0,new Error("oauth_state_mismatch"));return}if(g){i(l,400,"<!doctype html><title>OpenPond OAuth denied</title><p>Authorization was not completed. Return to the terminal.</p>",void 0,new Error(`oauth_authorization_failed:${g}`));return}if(!P){i(l,400,"<!doctype html><title>OpenPond OAuth failed</title><p>Missing authorization code. Return to the terminal and retry.</p>",void 0,new Error("oauth_code_missing"));return}i(l,200,"<!doctype html><title>OpenPond OAuth complete</title><p>Authorization complete. You can return to the terminal.</p>",{code:P,state:f})});await new Promise((a,l)=>{let d=o(f=>{c.off("listening",m),l(f)},"onError"),m=o(()=>{c.off("error",d),a()},"onListening");c.once("error",d),c.once("listening",m),c.listen(e.port,"127.0.0.1")});let p=c.address();if(!p||typeof p.port!="number")throw await j(c),new Error("oauth_callback_listener_failed");return n=setTimeout(()=>{t||(t=!0,u?.(new Error("oauth_callback_timeout")))},e.timeoutMs),{close:o(async()=>{n&&clearTimeout(n),await j(c).catch(()=>{})},"close"),redirectUri:`http://127.0.0.1:${p.port}/callback`,waitForCallback:o(()=>r,"waitForCallback")}}o(he,"startMcpOAuthCallbackListener");function ye(e){S(e)}o(ye,"openUrlWithSystemBrowser");function Pe(e){let t=new URL(e.authorizationEndpoint);return t.searchParams.set("response_type","code"),t.searchParams.set("client_id",e.clientId),t.searchParams.set("redirect_uri",e.redirectUri),t.searchParams.set("code_challenge",e.codeChallenge),t.searchParams.set("code_challenge_method","S256"),t.searchParams.set("resource",e.resourceUrl),t.searchParams.set("scope",e.scopes.join(" ")),t.searchParams.set("state",e.state),t.toString()}o(Pe,"buildMcpOAuthAuthorizeUrl");async function Ae(e){let t=new URLSearchParams;t.set("grant_type","authorization_code"),t.set("client_id",e.clientId),t.set("redirect_uri",e.redirectUri),t.set("code",e.code),t.set("code_verifier",e.codeVerifier);let n=await fetch(`${e.origin}/oauth/token`,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:t}),s=await J(n);if(!n.ok)throw new Error(`oauth_token_exchange_failed:${n.status}:${JSON.stringify(s)}`);if(!s||typeof s!="object"||Array.isArray(s))throw new Error("oauth_token_exchange_invalid_response");let u=s;if(typeof u.access_token!="string"||!u.access_token.trim())throw new Error("oauth_token_exchange_missing_access_token");return{access_token:u.access_token,...typeof u.expires_in=="number"?{expires_in:u.expires_in}:{},...typeof u.refresh_token=="string"?{refresh_token:u.refresh_token}:{},...typeof u.scope=="string"?{scope:u.scope}:{},...typeof u.token_type=="string"?{token_type:u.token_type}:{}}}o(Ae,"exchangeMcpOAuthAuthorizationCode");async function J(e){let t=await e.text().catch(()=>"");if(!t)return null;let n=t.trim();if((e.headers.get("content-type")??"").toLowerCase().includes("application/json")||n.startsWith("{")||n.startsWith("["))try{return JSON.parse(n)}catch{return t}return t}o(J,"readMcpProbeBody");async function U(e,t={}){let n=await fetch(e,t);return{url:e,status:n.status,ok:n.ok,headers:{contentType:n.headers.get("content-type"),location:n.headers.get("location"),wwwAuthenticate:n.headers.get("www-authenticate")},body:await J(n)}}o(U,"fetchMcpProbe");function we(e,t,n){return n?{jsonrpc:"2.0",id:e,method:t,params:n}:{jsonrpc:"2.0",id:e,method:t}}o(we,"buildMcpJsonRpcRequest");function F(e){let t=typeof e.arguments=="string"&&e.arguments.trim()?e.arguments:typeof e.args=="string"&&e.args.trim()?e.args:"";if(!t)return{};let n=_(t,"arguments");if(!n||typeof n!="object"||Array.isArray(n))throw new Error("arguments must be a JSON object");return n}o(F,"parseMcpToolArguments");async function R(e){let t={"content-type":"application/json"};return e.accessToken&&(t.authorization=`Bearer ${e.accessToken}`),U(e.resourceUrl,{method:"POST",headers:t,body:JSON.stringify(we(e.id,e.method,e.params))})}o(R,"postMcpJsonRpcProbe");async function q(e){let t=O(e.resourceUrl),n=O(e.origin),s=`${t}/.well-known/oauth-protected-resource`,u=`${n}/.well-known/oauth-authorization-server`,[r,i,c,p,a,l,d]=await Promise.all([U(s),U(u),U(t),R({resourceUrl:t,id:1,method:"initialize"}),R({resourceUrl:t,id:2,method:"tools/list"}),R({resourceUrl:t,id:3,method:"tools/call",params:{name:e.toolName,arguments:e.toolArguments}}),e.accessToken?R({resourceUrl:t,id:4,method:"tools/call",params:{name:e.toolName,arguments:e.toolArguments},accessToken:e.accessToken}):Promise.resolve(null)]);return{resourceUrl:t,origin:n,protectedResource:r,authorizationServer:i,directGetChallenge:c,initialize:p,toolsList:a,unauthenticatedToolCall:l,...d?{authenticatedToolCall:d}:{}}}o(q,"probeOrganizationMcp");function Oe(e){let t=typeof e=="string"?e.trim():"";if(t==="owner"||t==="admin"||t==="member")return t;throw new Error("role must be owner, admin, or member")}o(Oe,"parseOrganizationRole");function be(e){let t=typeof e.displayName=="string"&&e.displayName.trim()?e.displayName.trim():typeof e.name=="string"&&e.name.trim()?e.name.trim():"";if(!t)throw new Error("usage: organizations create --name <name> [--slug <slug>]");return{displayName:t,...typeof e.slug=="string"&&e.slug.trim()?{slug:e.slug.trim()}:{},...typeof e.primaryContactEmail=="string"&&e.primaryContactEmail.trim()?{primaryContactEmail:e.primaryContactEmail.trim()}:{},...typeof e.customDomain=="string"&&e.customDomain.trim()?{customDomain:e.customDomain.trim()}:{}}}o(be,"buildOrganizationCreateInput");function ke(e){let t={},n=typeof e.displayName=="string"&&e.displayName.trim()?e.displayName.trim():typeof e.name=="string"&&e.name.trim()?e.name.trim():"";if(n&&(t.displayName=n),typeof e.slug=="string"&&e.slug.trim()&&(t.slug=e.slug.trim()),typeof e.primaryContactEmail=="string"&&(t.primaryContactEmail=e.primaryContactEmail.trim()||null),typeof e.customDomain=="string"&&(t.customDomain=e.customDomain.trim()||null),typeof e.status=="string"&&e.status.trim()){let s=e.status.trim();if(s!=="active"&&s!=="disabled"&&s!=="archived")throw new Error("status must be active, disabled, or archived");t.status=s}if(Object.keys(t).length===0)throw new Error("organizations update requires at least one changed field");return t}o(ke,"buildOrganizationUpdateInput");function xe(e){let t=typeof e.email=="string"?e.email.trim():"";if(!t)throw new Error("usage: organizations member-upsert <slug> --email <email> --role <role>");return{email:t,role:Oe(e.role)}}o(xe,"buildOrganizationMemberInput");function Ce(e){return{...typeof e.origin=="string"&&e.origin.trim()?{origin:e.origin.trim()}:{},...typeof e.toolset=="string"&&e.toolset.trim()?{toolset:E(e.toolset)}:{}}}o(Ce,"buildOrganizationMcpGenerateInput");async function Nn(e,t){let n=t[0]||"list",s=await B(e),u=b(e.json);if(n==="list"){let r=await s.listOrganizations();if(u){console.log(JSON.stringify({organizations:r},null,2));return}if(r.length===0){console.log("no organizations found");return}for(let i of r)console.log(ae(i));return}if(n==="create"){let r=await s.createOrganization(be(e));console.log(JSON.stringify({organization:r},null,2));return}if(n==="get"){let r=t[1];if(!r)throw new Error("usage: organizations get <slug>");let i=await s.getOrganization(r);console.log(JSON.stringify({organization:i},null,2));return}if(n==="update"){let r=t[1];if(!r)throw new Error("usage: organizations update <slug> [--name <name>]");let i=await s.updateOrganization(r,ke(e));console.log(JSON.stringify({organization:i},null,2));return}if(n==="members"||n==="member-list"){let r=t[1];if(!r)throw new Error("usage: organizations members <slug>");let i=await s.listOrganizationMembers(r);if(u){console.log(JSON.stringify({members:i},null,2));return}if(i.length===0){console.log("no organization members found");return}for(let c of i)console.log(le(c));return}if(n==="member-upsert"||n==="member-add"){let r=t[1];if(!r)throw new Error("usage: organizations member-upsert <slug> --email <email> --role <role>");let i=await s.upsertOrganizationMember(r,xe(e));console.log(JSON.stringify({member:i},null,2));return}if(n==="mcp-get"||n==="mcp-server"){let r=t[1];if(!r)throw new Error("usage: organizations mcp-get <slug>");let i=await s.getOrganizationMcpServer(r);if(u){console.log(JSON.stringify({mcpServer:i},null,2));return}console.log(ce(i));return}if(n==="mcp-generate"){let r=t[1];if(!r)throw new Error("usage: organizations mcp-generate <slug> [--origin <url>]");let i=await s.generateOrganizationMcpServer(r,Ce(e));console.log(JSON.stringify({mcpServer:i},null,2));return}if(n==="mcp-probe"||n==="mcp-inspect"){let r=t[1];if(!r)throw new Error("usage: organizations mcp-probe <slug> [--origin <url>] [--tool <name>] [--arguments <json>] [--access-token <token>]");let i=await s.getOrganizationMcpServer(r),c=N(i,e),p=D(c,e),a=typeof e.tool=="string"&&e.tool.trim()?e.tool.trim():typeof e.toolName=="string"&&e.toolName.trim()?e.toolName.trim():"estimate_search_history",l=F(e),d=typeof e.accessToken=="string"&&e.accessToken.trim()?e.accessToken.trim():"",m=await q({resourceUrl:c,origin:p,toolName:a,toolArguments:l,...d?{accessToken:d}:{}});console.log(JSON.stringify({mcpServer:i,probe:m},null,2));return}if(n==="mcp-authorize"||n==="mcp-oauth"){let r=t[1];if(!r)throw new Error("usage: organizations mcp-authorize <slug> [--origin <url>] [--scope <csv|space>] [--tool <name>] [--arguments <json>] [--open]");let i=await s.getOrganizationMcpServer(r),c=N(i,e),p=D(c,e),a=me(e),l=pe(e),d=$(18),m=$(48),f=de(m),g=await he({expectedState:d,port:ge(e),timeoutMs:fe(e)}),P=Pe({authorizationEndpoint:`${p}/oauth/authorize`,clientId:a,codeChallenge:f,redirectUri:g.redirectUri,resourceUrl:c,scopes:l,state:d});if(console.error("Open this URL to authorize the organization MCP connection:"),console.error(P),console.error(`Waiting for OAuth callback on ${g.redirectUri}`),b(e.open))try{ye(P)}catch(A){console.error(`Unable to open a browser automatically: ${A instanceof Error?A.message:String(A)}`)}try{let A=await g.waitForCallback(),y=await Ae({clientId:a,code:A.code,codeVerifier:m,origin:p,redirectUri:g.redirectUri}),K=typeof e.tool=="string"&&e.tool.trim()?e.tool.trim():typeof e.toolName=="string"&&e.toolName.trim()?e.toolName.trim():"estimate_search_history",G=F(e),W=await q({accessToken:y.access_token,origin:p,resourceUrl:c,toolArguments:G,toolName:K}),V=b(e.printToken);console.log(JSON.stringify({mcpServer:i,oauth:{accessTokenReceived:!0,clientId:a,expiresIn:y.expires_in??null,refreshTokenReceived:!!y.refresh_token,scope:y.scope??l.join(" "),tokenType:y.token_type??"Bearer",...V?{accessToken:y.access_token,refreshToken:y.refresh_token??null}:{}},probe:W},null,2))}finally{await g.close()}return}if(n==="mcp-rotate"||n==="mcp-disable"||n==="mcp-enable"){let r=t[1];if(!r)throw new Error(`usage: organizations ${n} <slug>`);let i=n==="mcp-rotate"?await s.rotateOrganizationMcpServer(r):n==="mcp-disable"?await s.disableOrganizationMcpServer(r):await s.enableOrganizationMcpServer(r);console.log(JSON.stringify({mcpServer:i},null,2));return}throw new Error("usage: organizations <list|create|get|update|members|member-upsert|mcp-get|mcp-generate|mcp-probe|mcp-authorize|mcp-rotate|mcp-disable|mcp-enable> [args]")}o(Nn,"runOrganizationsCommand");export{ue as DEFAULT_MCP_AUTHORIZE_SCOPES,we as buildMcpJsonRpcRequest,Pe as buildMcpOAuthAuthorizeUrl,de as buildMcpOauthPkceChallenge,be as buildOrganizationCreateInput,Ce as buildOrganizationMcpGenerateInput,xe as buildOrganizationMemberInput,ke as buildOrganizationUpdateInput,j as closeServer,Ae as exchangeMcpOAuthAuthorizationCode,U as fetchMcpProbe,ae as formatOrganizationLine,ce as formatOrganizationMcpServerLine,le as formatOrganizationMemberLine,O as normalizeMcpResourceUrl,ye as openUrlWithSystemBrowser,pe as parseMcpOAuthScopes,F as parseMcpToolArguments,Oe as parseOrganizationRole,R as postMcpJsonRpcProbe,q as probeOrganizationMcp,$ as randomOauthToken,J as readMcpProbeBody,ge as resolveMcpOAuthCallbackPort,me as resolveMcpOAuthClientId,fe as resolveMcpOAuthTimeoutMs,D as resolveMcpProbeOrigin,N as resolveMcpProbeResourceUrl,Nn as runOrganizationsCommand,he as startMcpOAuthCallbackListener};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{i as Ie,j as K,k as W,r as $e,s as Re}from"./chunk-ANFDRKUU.js";import{m as G}from"./chunk-GUOLMLZN.js";import"./chunk-JUQMSHNR.js";import"./chunk-U2MAPON2.js";import"./chunk-7UH4YDA7.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{c as f,d as B,f as S}from"./chunk-3M53YXEI.js";import{e as ie}from"./chunk-H6IW2R22.js";import{a as fe}from"./chunk-L3KS6MOV.js";import"./chunk-DZUAT3TP.js";import"./chunk-H7ATCPPB.js";import"./chunk-25JDHAZ5.js";import{la as ue}from"./chunk-XMKCCLGB.js";import"./chunk-WN3V6KDN.js";import"./chunk-523TE4BI.js";import"./chunk-ZCHXGRRU.js";import"./chunk-X37KMV27.js";import{G as Pe,I as ke,J as ye,K as R,e as Q,f as he,g as X,h as ge,i as me,j as pe,q as ee,s as Se,t as we,x}from"./chunk-76M2MEHV.js";import"./chunk-PFSMXKTI.js";import"./chunk-OLDK2LKJ.js";import"./chunk-BT5YNE5U.js";import"./chunk-SF5HJ7PL.js";import"./chunk-FWIPHEVA.js";import"./chunk-WRI4XKSK.js";import"./chunk-GLUWATL5.js";import"./chunk-QDC4OW3S.js";import"./chunk-ZZWAQBA2.js";import"./chunk-YR5ID2SS.js";import"./chunk-YBT2NB32.js";import"./chunk-74ZXXBGN.js";import"./chunk-APB2STJK.js";import"./chunk-Y4OWBBDD.js";import"./chunk-6ZFPQYHG.js";import"./chunk-JFXWI3EN.js";import"./chunk-EAPFMACH.js";import"./chunk-6FA3GG5B.js";import"./chunk-MNC4YUDI.js";import"./chunk-Z4Z5UOZM.js";import"./chunk-FFRFSDBM.js";import"./chunk-H7IWJN7L.js";import"./chunk-VYLGI3IH.js";import{$a as de,Xa as le,Ya as ce,c as ae}from"./chunk-ACYFMLWG.js";import"./chunk-TVQAPBLZ.js";import"./chunk-KGNCKIFP.js";import"./chunk-ES2ISFJC.js";import{a as i}from"./chunk-FTQLQJQV.js";import{readFile as qe}from"node:fs/promises";import L from"node:path";import{promises as A}from"node:fs";import b from"node:path";async function oe(e,t){let o=b.join(e,t),n=await A.lstat(o).catch(l=>{if(l.code==="ENOENT")return null;throw l});if(!n)return[];if(!n.isDirectory()||n.isSymbolicLink())throw new Error(`Profile source directory is not a regular directory: ${t}`);let a=[];for(let l of await A.readdir(o,{withFileTypes:!0})){let h=b.join(o,l.name),d=b.relative(e,h).split(b.sep).join("/");if(l.isSymbolicLink())throw new Error(`Profile source contains a symlink: ${d}`);if(l.isDirectory())a.push(...await oe(e,d));else if(l.isFile())a.push(d);else throw new Error(`Profile source contains a non-regular file: ${d}`)}return a.sort()}i(oe,"sourceFiles");async function Ce(e,t=new Set){let{skills:o,skillCatalog:n}=await fe(e);if(n.error)throw new Error(`Profile Skills: ${n.error}`);for(let s of o)if(s.validationStatus!=="valid")throw new Error(`Profile Skill ${s.name}: ${s.validationMessages.join(" ")}`);let a=new Set(o.map(s=>s.path)),l=[...await oe(e,"workflows"),...await oe(e,"evals")].sort(),h=l.filter(s=>s.startsWith("workflows/")),d=h.some(s=>/^workflows\/[^/]+\/(PROMPT\.md|ACTION\.json)$/.test(s)),u=h.includes("workflows/catalog.json");if(d&&u)throw new Error("Workflow packages and legacy workflows/catalog.json cannot coexist.");let y=d?ie({files:new Map(await Promise.all(h.map(async s=>[s,await A.readFile(b.join(e,s),"utf8")]))),skillPaths:a,actionIds:t}).catalog:u?ae({catalog:JSON.parse(await A.readFile(b.join(e,"workflows/catalog.json"),"utf8")),sourcePaths:a,actionIds:t}):{workflows:[]},$=new Set(y.workflows.map(s=>s.id)),C=l.filter(s=>/^workflows\/[^/]+\/evals\/[^/]+\.json$/.test(s)||/^evals\/definitions\/[^/]+\.json$/.test(s)),w=l.filter(s=>/^evals\/suites\/[^/]+\.json$/.test(s));if(l.includes("evals/catalog.json")&&(C.length||w.length))throw new Error("Evaluation packages and legacy evals/catalog.json cannot coexist.");let j=await Promise.all(C.map(async s=>{let r=le.parse(JSON.parse(await A.readFile(b.join(e,s),"utf8"))),m=/^workflows\/([^/]+)\/evals\//.exec(s)?.[1];if(m&&(r.target.kind!=="workflow"||r.target.workflowId!==m))throw new Error(`Evaluation ${r.id} must target its containing Workflow ${m}.`);return r})),N=await Promise.all(w.map(async s=>ce.parse(JSON.parse(await A.readFile(b.join(e,s),"utf8"))))),_=l.includes("evals/catalog.json")?JSON.parse(await A.readFile(b.join(e,"evals/catalog.json"),"utf8")):{schemaVersion:"openpond.profileEvaluations.v1",definitions:j,suites:N},P=de({catalog:_,workflowIds:$,skillPaths:a,actionIds:t}).catalog,g=l.filter(s=>/^evals\/tasksets\/[^/]+\.json$/.test(s)),O=new Map;for(let s of g){let r=ue(JSON.parse(await A.readFile(b.join(e,s),"utf8"))).taskset;if(s!==`evals/tasksets/${r.contentHash}.json`)throw new Error(`Frozen Taskset file name differs from its content hash: ${s}.`);O.set(r.contentHash,r)}for(let s of P.definitions){let r=s.tasksetRelease.contentHash,m=`evals/tasksets/${r}.json`,H=O.get(r);if(!H)throw new Error(`Evaluation ${s.id} is missing Taskset ${m}.`);if(H.id!==s.tasksetRelease.id||H.contentHash!==r)throw new Error(`Evaluation ${s.id} references a different frozen Taskset.`);let E=new Set(H.tasks.filter(k=>k.split===s.split).map(k=>k.id));for(let k of s.taskIds)if(!E.has(k))throw new Error(`Evaluation ${s.id} references missing Taskset case ${k} in split ${s.split}.`)}return{workflows:y.workflows.length,skills:o.length,evaluations:P.definitions.length,tasksets:O.size}}i(Ce,"checkLocalProfileSource");import te from"node:path";async function Ae(e){if(!e.state.sourcePath)throw new Error("Active OpenPond profile is missing a source path.");let t=e.state.agents.find(s=>s.id===e.agentId);if(!t)throw new Error(`Profile agent not found for hosted materialization: ${e.agentId}`);if(!t.enabled)throw new Error(`Profile agent is disabled: ${e.agentId}`);let o=xe(e.state.sourcePath,t.path),n=await Ie(o),a=await K(o,n.entries),l=W(n,a.entries),h=await Me({client:e.client,teamId:e.teamId,projectId:e.projectId??null,profileProjectId:e.profileProjectId,profileName:e.profileName,agentId:e.agentId,localHead:e.localHead,hostedHead:e.hostedHead}),d=await e.client.projects.uploadSource(h.id,{teamId:e.teamId,entries:l.entries,branch:e.sourceRef,commitMessage:`Materialize OpenPond profile agent ${e.agentId}`}),u=await e.client.projects.sync(d.id,{teamId:e.teamId}),y=be(u)??be(d),$=je(u)??je(d)??e.sourceRef,C=`openpond-profile-agent:${e.profileProjectId}:${e.profileName}:${e.agentId}`,w=(await e.client.agents.list({teamId:e.teamId})).find(s=>s.externalId===C),j=await e.client.agents.upsert({teamId:e.teamId,projectId:u.id,name:t.name||e.agentId,slug:_e(e.profileName,e.agentId),selectedEntrypoint:Ne(e.state,e.agentId),triggerType:"manual",runtimeSource:{mode:"latest_source",...$?{sourceRef:$}:{},...y?{sourceCommitSha:y}:{}},metadata:{...w?.metadata??{},source:"openpond_profile_agent_materialization",profileProjectId:e.profileProjectId,profileName:e.profileName,profileAgentId:e.agentId,profileSourcePath:t.path,localHead:e.localHead,hostedHead:e.hostedHead},externalId:C}),N=v(a.uploadMetadata),_=v(N?.commands),P=v(N?.dependencySetup),g=Ue(P?.commands),O=[I(_?.validate),I(_?.eval)].filter(s=>!!s);return{status:"uploaded",agentId:e.agentId,runtimeAgentId:j.id,projectId:u.id,sourceRoot:o,sourceRef:$,sourceCommitSha:y??null,manifestHash:u.sandboxManifestHash??null,manifestPath:u.sandboxManifestPath??null,manifestSyncedAt:u.sandboxManifestSyncedAt??null,fileCount:l.fileCount,totalBytes:l.totalBytes,generatedManifestPath:a.generatedManifestPath,synthesizedOpenPondYaml:a.synthesizedOpenPondYaml,uploadMetadataPath:a.uploadMetadataPath,setupCommands:g,validationCommands:O,materializedAt:new Date().toISOString()}}i(Ae,"materializeHostedProfileAgentSource");async function Me(e){if(e.projectId)try{return await e.client.projects.get(e.projectId,{teamId:e.teamId})}catch{}return e.client.projects.upsert({teamId:e.teamId,name:`OpenPond profile ${e.profileName} ${e.agentId}`,sourceType:"manual",externalId:`openpond-profile:${e.profileProjectId}:${e.profileName}:${e.agentId}`,description:`Materialized OpenPond profile agent ${e.agentId} for hosted Team execution.`,metadata:{source:"openpond_profile_agent_materialization",profileProjectId:e.profileProjectId,profileName:e.profileName,profileAgentId:e.agentId,localHead:e.localHead,hostedHead:e.hostedHead}})}i(Me,"getOrCreateHostedSourceProject");function xe(e,t){let o=t.replace(/\\/g,"/"),n=te.resolve(e,o),a=te.relative(e,n);if(a.startsWith("..")||te.isAbsolute(a))throw new Error(`Profile agent path escapes profile source: ${t}`);return o==="agent/agent.ts"||o.endsWith("/agent.ts")?e:n}i(xe,"resolveProfileAgentSourceRoot");function Ne(e,t){let o=e.actionCatalog.find(n=>n.agentId===t&&(n.sourceActionId==="chat"||n.name==="chat"))??e.actionCatalog.find(n=>n.agentId===t);return{scope:"action",name:typeof o?.sourceActionId=="string"&&o.sourceActionId||typeof o?.name=="string"&&o.name||"chat"}}i(Ne,"hostedEntrypointForProfileAgent");function _e(e,t){return`openpond-profile-${e}-${t}`.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"openpond-profile-agent"}i(_e,"hostedRuntimeAgentSlug");function be(e){let t=v(e),o=v(t?.sourceConfig),n=v(t?.metadata);return I(o?.sourceCommitSha)??I(o?.commitSha)??I(o?.remoteSha)??I(n?.projectSourceUploadCommitSha)??I(n?.sourceCommitSha)??I(t?.templateRemoteSha)}i(be,"sandboxProjectSourceCommitSha");function je(e){let t=v(e),o=v(t?.sourceConfig);return I(o?.sourceRef)??I(o?.branch)??I(t?.gitBranch)??I(t?.defaultBranch)}i(je,"sandboxProjectSourceRef");function v(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}i(v,"record");function I(e){return typeof e=="string"&&e.trim()?e.trim():null}i(I,"text");function Ue(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}i(Ue,"stringArray");import{createHash as Fe,randomUUID as Le}from"node:crypto";function ve(e){let t=e.explicitKey?.trim();if(t)return t;let o=e.sourceHead?.trim()||"unknown-source",n=e.targetProjectId?.trim()||"no-target-project",a=Te(e.input).slice(0,16),l=`profile-push-run:${e.localHead}:${o}:${e.runtimeAgentId}:${n}:${a}`;return e.retry?`${l}:retry:${(e.randomId??Le)()}`:l}i(ve,"buildHostedRunIdempotencyKey");function Te(e){return Fe("sha256").update(ne(e)).digest("hex")}i(Te,"hashStableJson");function ne(e){return e===void 0?"undefined":e===null||typeof e!="object"?JSON.stringify(e)??"null":Array.isArray(e)?`[${e.map(t=>ne(t)).join(",")}]`:`{${Object.entries(e).sort(([t],[o])=>t.localeCompare(o)).map(([t,o])=>`${JSON.stringify(t)}:${ne(o)}`).join(",")}}`}i(ne,"stableJsonStringify");async function zo(e){let t=await Se({repoPath:f(e,"path")||ee(),profile:f(e,"profile")||"default",template:f(e,"template")||"blank-agent",force:S(e.force)});if(S(e.json)){console.log(JSON.stringify(t,null,2));return}console.log(`Initialized OpenPond profile ${t.activeProfile} at ${t.repoPath}`),console.log(`Profile source: ${t.sourcePath}`)}i(zo,"runOpenPondInitCommand");async function Mo(e,t){let o=t[0]??"current";if(o==="load"){let n=f(e,"path")||t[1];if(!n)throw new Error("usage: openpond profile load --path <dir> [--profile <name>]");let a=await we(n,f(e,"profile")||void 0);if(S(e.json)){console.log(JSON.stringify(a,null,2));return}console.log(`Loaded OpenPond profile ${a.activeProfile} from ${a.repoPath}`);return}if(o==="current"||o==="status"){let n=await x();if(S(e.json)){console.log(JSON.stringify(n,null,2));return}re(n);return}if(o==="diff"){let n=await x();if(S(e.json)){console.log(JSON.stringify({diff:n.diff,profile:n},null,2));return}to(n);return}if(o==="catalog"){let n=await x();if(S(e.json)){console.log(JSON.stringify({catalog:n.catalog,actions:n.actionCatalog,profile:n},null,2));return}no(n);return}if(o==="commit"){await Je(e,t.slice(1));return}if(o==="push"){await De(e);return}if(o==="check"){let n=f(e,"kind")||t[1]||"all";if(!["all","inspect","build","validate","eval"].includes(n))throw new Error("check kind must be one of inspect, build, validate, eval, all");if(n==="all"||n==="validate"){let a=await x();if(!a.sourcePath)throw new Error("No active Profile source to validate.");let l=await Ce(a.sourcePath,new Set(a.actionCatalog.map(h=>h.id)));console.log(`Profile source valid: ${l.workflows} Workflows, ${l.skills} Skills, ${l.evaluations} evaluations, ${l.tasksets} frozen Tasksets.`)}await ke(n);return}if(o==="ensure-hosted"){await He(e);return}if(o==="hosted"){let n=t[1]??"status";if(n==="ensure"){await He(e);return}if(n==="status"||n==="current"){await eo(e);return}throw new Error("usage: openpond profile hosted [status|ensure] --team-id <id> [--json]")}if(o==="agents"){if((t[1]??"list")!=="list")throw new Error("usage: openpond profile agents list [--json]");await oo(e,["list"]);return}throw new Error("usage: openpond profile <status|diff|catalog|commit|push|load|check|agents|hosted|ensure-hosted> [args]")}i(Mo,"runOpenPondProfileCommand");async function Je(e,t){let o=f(e,"message")||f(e,"commitMessage")||t.join(" ").trim()||void 0,n=await ye(o);if(S(e.json)){console.log(JSON.stringify(n,null,2));return}if(!n.committed){console.log("No profile changes to commit."),re(n.state);return}console.log("Committed OpenPond profile changes."),n.stdout.trim()&&console.log(n.stdout.trim()),re(n.state)}i(Je,"runProfileCommitCommand");async function De(e){let t=B(e,"usage: openpond profile push"),o=await x();if(o.error)throw new Error(o.error);if(!o.repoPath||!o.sourcePath||!o.manifestPath)throw new Error("No active OpenPond profile. Run `openpond init`.");if(!o.git?.isRepo)throw new Error("Active OpenPond profile source is not Git-backed. Run `openpond init` or reload a Git-backed profile.");if(!o.git.head)throw new Error("Profile source must have a committed Git head before push. Run `openpond profile commit` first.");if(o.git.dirty)throw new Error("Profile source has uncommitted changes. Run `openpond profile commit` before push.");let n=await G(e),a=S(e.ensureHosted)?await n.profile.ensureHosted({teamId:t}):await n.profile.get({teamId:t});if(!a)throw new Error("No hosted OpenPond profile repo found. Run `openpond profile ensure-hosted --team-id <id>` first, or pass `--ensure-hosted` to push.");let l=S(e.force),h=a.sourceUpload?.sourceCommitSha??null,d=o.hosted?.sourceCommitSha??null;if(d&&h!==d&&!l)throw new Error(["Hosted profile source changed since the last local push.",`Last pushed hosted head: ${d}`,`Current hosted head: ${h??"none"}`,"Inspect hosted changes before pushing, or rerun with --force to overwrite explicitly."].join(`
|
|
2
|
+
import{i as Ie,j as K,k as W,r as $e,s as Re}from"./chunk-SLZH4Z6C.js";import{m as G}from"./chunk-ISFIDCIH.js";import"./chunk-23P2O7PH.js";import"./chunk-AW5Q6NXT.js";import"./chunk-YVNDDNMK.js";import"./chunk-XRKFTPHD.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{c as f,d as B,f as S}from"./chunk-3M53YXEI.js";import{e as ie}from"./chunk-7YTHEMWI.js";import{a as fe}from"./chunk-L3KS6MOV.js";import"./chunk-DZUAT3TP.js";import"./chunk-H3BSIAQO.js";import"./chunk-637UACKH.js";import{la as ue}from"./chunk-A66CSUBJ.js";import"./chunk-SPDSSMFD.js";import"./chunk-E63VWAQA.js";import"./chunk-PR5TYTY4.js";import"./chunk-X37KMV27.js";import{G as Pe,I as ke,J as ye,K as R,e as Q,f as he,g as X,h as ge,i as me,j as pe,q as ee,s as Se,t as we,x}from"./chunk-ONDCV5QC.js";import"./chunk-YDU3S6UT.js";import"./chunk-EL454L26.js";import"./chunk-BT5YNE5U.js";import"./chunk-PXS4SVQG.js";import"./chunk-FWIPHEVA.js";import"./chunk-ENSB6ZTM.js";import"./chunk-GLUWATL5.js";import"./chunk-RYGWCN2R.js";import"./chunk-ZZWAQBA2.js";import"./chunk-YR5ID2SS.js";import"./chunk-KNO355LC.js";import"./chunk-Y54RKLOI.js";import"./chunk-2SUMZ73C.js";import"./chunk-M55H7KVR.js";import"./chunk-BK63OQRW.js";import"./chunk-V4KT5FCJ.js";import"./chunk-ERJV5BMC.js";import"./chunk-6FA3GG5B.js";import"./chunk-LHA7RQBA.js";import"./chunk-SG6JZ7HD.js";import"./chunk-ON2RNOCG.js";import"./chunk-H7IWJN7L.js";import"./chunk-SFNCAPCJ.js";import{c as ae,gb as le,hb as ce,kb as de}from"./chunk-RCA6NGVA.js";import"./chunk-VHSX3JPX.js";import"./chunk-BIPQCJ5V.js";import"./chunk-PF56N7ZY.js";import{a as i}from"./chunk-FTQLQJQV.js";import{readFile as qe}from"node:fs/promises";import L from"node:path";import{promises as A}from"node:fs";import b from"node:path";async function oe(e,t){let o=b.join(e,t),n=await A.lstat(o).catch(l=>{if(l.code==="ENOENT")return null;throw l});if(!n)return[];if(!n.isDirectory()||n.isSymbolicLink())throw new Error(`Profile source directory is not a regular directory: ${t}`);let a=[];for(let l of await A.readdir(o,{withFileTypes:!0})){let h=b.join(o,l.name),d=b.relative(e,h).split(b.sep).join("/");if(l.isSymbolicLink())throw new Error(`Profile source contains a symlink: ${d}`);if(l.isDirectory())a.push(...await oe(e,d));else if(l.isFile())a.push(d);else throw new Error(`Profile source contains a non-regular file: ${d}`)}return a.sort()}i(oe,"sourceFiles");async function Ce(e,t=new Set){let{skills:o,skillCatalog:n}=await fe(e);if(n.error)throw new Error(`Profile Skills: ${n.error}`);for(let s of o)if(s.validationStatus!=="valid")throw new Error(`Profile Skill ${s.name}: ${s.validationMessages.join(" ")}`);let a=new Set(o.map(s=>s.path)),l=[...await oe(e,"workflows"),...await oe(e,"evals")].sort(),h=l.filter(s=>s.startsWith("workflows/")),d=h.some(s=>/^workflows\/[^/]+\/(PROMPT\.md|ACTION\.json)$/.test(s)),u=h.includes("workflows/catalog.json");if(d&&u)throw new Error("Workflow packages and legacy workflows/catalog.json cannot coexist.");let y=d?ie({files:new Map(await Promise.all(h.map(async s=>[s,await A.readFile(b.join(e,s),"utf8")]))),skillPaths:a,actionIds:t}).catalog:u?ae({catalog:JSON.parse(await A.readFile(b.join(e,"workflows/catalog.json"),"utf8")),sourcePaths:a,actionIds:t}):{workflows:[]},$=new Set(y.workflows.map(s=>s.id)),C=l.filter(s=>/^workflows\/[^/]+\/evals\/[^/]+\.json$/.test(s)||/^evals\/definitions\/[^/]+\.json$/.test(s)),w=l.filter(s=>/^evals\/suites\/[^/]+\.json$/.test(s));if(l.includes("evals/catalog.json")&&(C.length||w.length))throw new Error("Evaluation packages and legacy evals/catalog.json cannot coexist.");let j=await Promise.all(C.map(async s=>{let r=le.parse(JSON.parse(await A.readFile(b.join(e,s),"utf8"))),m=/^workflows\/([^/]+)\/evals\//.exec(s)?.[1];if(m&&(r.target.kind!=="workflow"||r.target.workflowId!==m))throw new Error(`Evaluation ${r.id} must target its containing Workflow ${m}.`);return r})),N=await Promise.all(w.map(async s=>ce.parse(JSON.parse(await A.readFile(b.join(e,s),"utf8"))))),_=l.includes("evals/catalog.json")?JSON.parse(await A.readFile(b.join(e,"evals/catalog.json"),"utf8")):{schemaVersion:"openpond.profileEvaluations.v1",definitions:j,suites:N},P=de({catalog:_,workflowIds:$,skillPaths:a,actionIds:t}).catalog,g=l.filter(s=>/^evals\/tasksets\/[^/]+\.json$/.test(s)),O=new Map;for(let s of g){let r=ue(JSON.parse(await A.readFile(b.join(e,s),"utf8"))).taskset;if(s!==`evals/tasksets/${r.contentHash}.json`)throw new Error(`Frozen Taskset file name differs from its content hash: ${s}.`);O.set(r.contentHash,r)}for(let s of P.definitions){let r=s.tasksetRelease.contentHash,m=`evals/tasksets/${r}.json`,H=O.get(r);if(!H)throw new Error(`Evaluation ${s.id} is missing Taskset ${m}.`);if(H.id!==s.tasksetRelease.id||H.contentHash!==r)throw new Error(`Evaluation ${s.id} references a different frozen Taskset.`);let E=new Set(H.tasks.filter(k=>k.split===s.split).map(k=>k.id));for(let k of s.taskIds)if(!E.has(k))throw new Error(`Evaluation ${s.id} references missing Taskset case ${k} in split ${s.split}.`)}return{workflows:y.workflows.length,skills:o.length,evaluations:P.definitions.length,tasksets:O.size}}i(Ce,"checkLocalProfileSource");import te from"node:path";async function Ae(e){if(!e.state.sourcePath)throw new Error("Active OpenPond profile is missing a source path.");let t=e.state.agents.find(s=>s.id===e.agentId);if(!t)throw new Error(`Profile agent not found for hosted materialization: ${e.agentId}`);if(!t.enabled)throw new Error(`Profile agent is disabled: ${e.agentId}`);let o=xe(e.state.sourcePath,t.path),n=await Ie(o),a=await K(o,n.entries),l=W(n,a.entries),h=await Me({client:e.client,teamId:e.teamId,projectId:e.projectId??null,profileProjectId:e.profileProjectId,profileName:e.profileName,agentId:e.agentId,localHead:e.localHead,hostedHead:e.hostedHead}),d=await e.client.projects.uploadSource(h.id,{teamId:e.teamId,entries:l.entries,branch:e.sourceRef,commitMessage:`Materialize OpenPond profile agent ${e.agentId}`}),u=await e.client.projects.sync(d.id,{teamId:e.teamId}),y=be(u)??be(d),$=je(u)??je(d)??e.sourceRef,C=`openpond-profile-agent:${e.profileProjectId}:${e.profileName}:${e.agentId}`,w=(await e.client.agents.list({teamId:e.teamId})).find(s=>s.externalId===C),j=await e.client.agents.upsert({teamId:e.teamId,projectId:u.id,name:t.name||e.agentId,slug:_e(e.profileName,e.agentId),selectedEntrypoint:Ne(e.state,e.agentId),triggerType:"manual",runtimeSource:{mode:"latest_source",...$?{sourceRef:$}:{},...y?{sourceCommitSha:y}:{}},metadata:{...w?.metadata??{},source:"openpond_profile_agent_materialization",profileProjectId:e.profileProjectId,profileName:e.profileName,profileAgentId:e.agentId,profileSourcePath:t.path,localHead:e.localHead,hostedHead:e.hostedHead},externalId:C}),N=v(a.uploadMetadata),_=v(N?.commands),P=v(N?.dependencySetup),g=Ue(P?.commands),O=[I(_?.validate),I(_?.eval)].filter(s=>!!s);return{status:"uploaded",agentId:e.agentId,runtimeAgentId:j.id,projectId:u.id,sourceRoot:o,sourceRef:$,sourceCommitSha:y??null,manifestHash:u.sandboxManifestHash??null,manifestPath:u.sandboxManifestPath??null,manifestSyncedAt:u.sandboxManifestSyncedAt??null,fileCount:l.fileCount,totalBytes:l.totalBytes,generatedManifestPath:a.generatedManifestPath,synthesizedOpenPondYaml:a.synthesizedOpenPondYaml,uploadMetadataPath:a.uploadMetadataPath,setupCommands:g,validationCommands:O,materializedAt:new Date().toISOString()}}i(Ae,"materializeHostedProfileAgentSource");async function Me(e){if(e.projectId)try{return await e.client.projects.get(e.projectId,{teamId:e.teamId})}catch{}return e.client.projects.upsert({teamId:e.teamId,name:`OpenPond profile ${e.profileName} ${e.agentId}`,sourceType:"manual",externalId:`openpond-profile:${e.profileProjectId}:${e.profileName}:${e.agentId}`,description:`Materialized OpenPond profile agent ${e.agentId} for hosted Team execution.`,metadata:{source:"openpond_profile_agent_materialization",profileProjectId:e.profileProjectId,profileName:e.profileName,profileAgentId:e.agentId,localHead:e.localHead,hostedHead:e.hostedHead}})}i(Me,"getOrCreateHostedSourceProject");function xe(e,t){let o=t.replace(/\\/g,"/"),n=te.resolve(e,o),a=te.relative(e,n);if(a.startsWith("..")||te.isAbsolute(a))throw new Error(`Profile agent path escapes profile source: ${t}`);return o==="agent/agent.ts"||o.endsWith("/agent.ts")?e:n}i(xe,"resolveProfileAgentSourceRoot");function Ne(e,t){let o=e.actionCatalog.find(n=>n.agentId===t&&(n.sourceActionId==="chat"||n.name==="chat"))??e.actionCatalog.find(n=>n.agentId===t);return{scope:"action",name:typeof o?.sourceActionId=="string"&&o.sourceActionId||typeof o?.name=="string"&&o.name||"chat"}}i(Ne,"hostedEntrypointForProfileAgent");function _e(e,t){return`openpond-profile-${e}-${t}`.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"openpond-profile-agent"}i(_e,"hostedRuntimeAgentSlug");function be(e){let t=v(e),o=v(t?.sourceConfig),n=v(t?.metadata);return I(o?.sourceCommitSha)??I(o?.commitSha)??I(o?.remoteSha)??I(n?.projectSourceUploadCommitSha)??I(n?.sourceCommitSha)??I(t?.templateRemoteSha)}i(be,"sandboxProjectSourceCommitSha");function je(e){let t=v(e),o=v(t?.sourceConfig);return I(o?.sourceRef)??I(o?.branch)??I(t?.gitBranch)??I(t?.defaultBranch)}i(je,"sandboxProjectSourceRef");function v(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}i(v,"record");function I(e){return typeof e=="string"&&e.trim()?e.trim():null}i(I,"text");function Ue(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}i(Ue,"stringArray");import{createHash as Fe,randomUUID as Le}from"node:crypto";function ve(e){let t=e.explicitKey?.trim();if(t)return t;let o=e.sourceHead?.trim()||"unknown-source",n=e.targetProjectId?.trim()||"no-target-project",a=Te(e.input).slice(0,16),l=`profile-push-run:${e.localHead}:${o}:${e.runtimeAgentId}:${n}:${a}`;return e.retry?`${l}:retry:${(e.randomId??Le)()}`:l}i(ve,"buildHostedRunIdempotencyKey");function Te(e){return Fe("sha256").update(ne(e)).digest("hex")}i(Te,"hashStableJson");function ne(e){return e===void 0?"undefined":e===null||typeof e!="object"?JSON.stringify(e)??"null":Array.isArray(e)?`[${e.map(t=>ne(t)).join(",")}]`:`{${Object.entries(e).sort(([t],[o])=>t.localeCompare(o)).map(([t,o])=>`${JSON.stringify(t)}:${ne(o)}`).join(",")}}`}i(ne,"stableJsonStringify");async function zo(e){let t=await Se({repoPath:f(e,"path")||ee(),profile:f(e,"profile")||"default",template:f(e,"template")||"blank-agent",force:S(e.force)});if(S(e.json)){console.log(JSON.stringify(t,null,2));return}console.log(`Initialized OpenPond profile ${t.activeProfile} at ${t.repoPath}`),console.log(`Profile source: ${t.sourcePath}`)}i(zo,"runOpenPondInitCommand");async function Mo(e,t){let o=t[0]??"current";if(o==="load"){let n=f(e,"path")||t[1];if(!n)throw new Error("usage: openpond profile load --path <dir> [--profile <name>]");let a=await we(n,f(e,"profile")||void 0);if(S(e.json)){console.log(JSON.stringify(a,null,2));return}console.log(`Loaded OpenPond profile ${a.activeProfile} from ${a.repoPath}`);return}if(o==="current"||o==="status"){let n=await x();if(S(e.json)){console.log(JSON.stringify(n,null,2));return}re(n);return}if(o==="diff"){let n=await x();if(S(e.json)){console.log(JSON.stringify({diff:n.diff,profile:n},null,2));return}to(n);return}if(o==="catalog"){let n=await x();if(S(e.json)){console.log(JSON.stringify({catalog:n.catalog,actions:n.actionCatalog,profile:n},null,2));return}no(n);return}if(o==="commit"){await Je(e,t.slice(1));return}if(o==="push"){await De(e);return}if(o==="check"){let n=f(e,"kind")||t[1]||"all";if(!["all","inspect","build","validate","eval"].includes(n))throw new Error("check kind must be one of inspect, build, validate, eval, all");if(n==="all"||n==="validate"){let a=await x();if(!a.sourcePath)throw new Error("No active Profile source to validate.");let l=await Ce(a.sourcePath,new Set(a.actionCatalog.map(h=>h.id)));console.log(`Profile source valid: ${l.workflows} Workflows, ${l.skills} Skills, ${l.evaluations} evaluations, ${l.tasksets} frozen Tasksets.`)}await ke(n);return}if(o==="ensure-hosted"){await He(e);return}if(o==="hosted"){let n=t[1]??"status";if(n==="ensure"){await He(e);return}if(n==="status"||n==="current"){await eo(e);return}throw new Error("usage: openpond profile hosted [status|ensure] --team-id <id> [--json]")}if(o==="agents"){if((t[1]??"list")!=="list")throw new Error("usage: openpond profile agents list [--json]");await oo(e,["list"]);return}throw new Error("usage: openpond profile <status|diff|catalog|commit|push|load|check|agents|hosted|ensure-hosted> [args]")}i(Mo,"runOpenPondProfileCommand");async function Je(e,t){let o=f(e,"message")||f(e,"commitMessage")||t.join(" ").trim()||void 0,n=await ye(o);if(S(e.json)){console.log(JSON.stringify(n,null,2));return}if(!n.committed){console.log("No profile changes to commit."),re(n.state);return}console.log("Committed OpenPond profile changes."),n.stdout.trim()&&console.log(n.stdout.trim()),re(n.state)}i(Je,"runProfileCommitCommand");async function De(e){let t=B(e,"usage: openpond profile push"),o=await x();if(o.error)throw new Error(o.error);if(!o.repoPath||!o.sourcePath||!o.manifestPath)throw new Error("No active OpenPond profile. Run `openpond init`.");if(!o.git?.isRepo)throw new Error("Active OpenPond profile source is not Git-backed. Run `openpond init` or reload a Git-backed profile.");if(!o.git.head)throw new Error("Profile source must have a committed Git head before push. Run `openpond profile commit` first.");if(o.git.dirty)throw new Error("Profile source has uncommitted changes. Run `openpond profile commit` before push.");let n=await G(e),a=S(e.ensureHosted)?await n.profile.ensureHosted({teamId:t}):await n.profile.get({teamId:t});if(!a)throw new Error("No hosted OpenPond profile repo found. Run `openpond profile ensure-hosted --team-id <id>` first, or pass `--ensure-hosted` to push.");let l=S(e.force),h=a.sourceUpload?.sourceCommitSha??null,d=o.hosted?.sourceCommitSha??null;if(d&&h!==d&&!l)throw new Error(["Hosted profile source changed since the last local push.",`Last pushed hosted head: ${d}`,`Current hosted head: ${h??"none"}`,"Inspect hosted changes before pushing, or rerun with --force to overwrite explicitly."].join(`
|
|
3
3
|
`));let u=f(e,"hostedSourceAgentId"),y=S(e.hostedSourceChecks),$=S(e.publishHostedSource),C=f(e,"hostedRunAgentId"),w=u||(y||$?C:null),j=JSON.parse(await qe(o.manifestPath,"utf8")),N=Ge(j),_=j.profiles[o.activeProfile??j.defaultProfile]?.path??"profiles/default",P=await Ke({state:o,hostedSourceAgentId:w}),g=await n.profile.push({teamId:t,entries:P.entries,branch:o.git.branch??"main",commitMessage:f(e,"commitMessage")||f(e,"message")||`Push OpenPond profile ${o.activeProfile??"default"} at ${o.git.shortHead??o.git.head}`,expectedSourceCommitSha:h,localHeadSha:o.git.head,manifest:N,sourcePath:_,agents:o.agents.map(c=>({id:c.id,path:c.path,enabled:c.enabled}))}),O=new Date().toISOString(),s=o.hosted?.lastPushedLocalHead===o.git.head&&o.hosted?.sourceCommitSha===g.sourceUpload.sourceCommitSha,r={status:"pushed",promotionStatus:s?o.hosted?.promotionStatus??"uploaded":"uploaded",hostedRunStatus:s?o.hosted?.hostedRunStatus??"not_started":"not_started",pushedAt:O,teamId:t,projectId:g.profile.project.id,localHead:o.git.head,hostedHead:g.sourceUpload.sourceCommitSha,sourceRef:g.sourceUpload.sourceRef,hostedRunAgentId:s?o.hosted?.hostedRunAgentId??null:null,hostedRunId:s?o.hosted?.hostedRunId??null:null,hostedRunAt:s?o.hosted?.hostedRunAt??null:null,hostedSourceMaterialization:s?o.hosted?.hostedSourceMaterialization??null:null,hostedSourceCheck:s?o.hosted?.hostedSourceCheck??null:null,hostedPublish:s?o.hosted?.hostedPublish??null:null,hostedRun:s?o.hosted?.hostedRun??null:null};await R(r);let m=w??Ve(o,C),H=Re(e.hostedSourceDispatch,"hosted-source-dispatch")??"coding_core",E=null,k=null,Z=null;if(w&&(y||$||u))try{let c=await Ae({client:n,teamId:t,profileProjectId:g.profile.project.id,profileName:o.activeProfile??j.defaultProfile,state:o,agentId:w,sourceRef:g.sourceUpload.sourceRef??o.git.branch??"main",localHead:o.git.head,hostedHead:g.sourceUpload.sourceCommitSha,projectId:f(e,"hostedSourceProjectId")||(o.hosted?.hostedSourceMaterialization?.agentId===w?o.hosted.hostedSourceMaterialization.projectId:null)});r={...r,promotionStatus:"hosted_source_materialized",hostedSourceMaterialization:c},m=c.runtimeAgentId??w,await R(r)}catch(c){let p=c instanceof Error?c.message:String(c);throw r={...r,promotionStatus:"hosted_source_materialize_failed",hostedSourceMaterialization:{status:"failed",agentId:w,projectId:f(e,"hostedSourceProjectId")??null,error:p},error:p},await R(r),new Error(`Hosted source materialization failed after push: ${p}`)}if(y||$){if(!w)throw new Error("--hosted-source-agent-id or --hosted-run-agent-id is required for hosted source checks or publish.");if(!m)throw new Error("Unable to resolve the hosted runtime agent for source checks.");try{if(E=await n.agents.sourceDeployPlan(m,{teamId:t}),y){let c=r.hostedSourceMaterialization?.sourceRef??g.sourceUpload.sourceRef,p=r.hostedSourceMaterialization?.sourceCommitSha??g.sourceUpload.sourceCommitSha;if(k=await n.agents.requestSourceChecks(m,{teamId:t,...c?{sourceRef:c}:{},...p?{baseSha:p}:{},checkKind:$e(f(e,"hostedCheckKind")||f(e,"checkKind"))??"all",dispatch:H,metadata:{source:"openpond_profile_push_checks",localHead:o.git.head,hostedHead:g.sourceUpload.sourceCommitSha,materializedProjectId:r.hostedSourceMaterialization?.projectId??null,materializedSourceCommitSha:r.hostedSourceMaterialization?.sourceCommitSha??null,sourceRef:c,dispatch:H}}),k.dispatchResult?.status==="failed")throw new Error(k.dispatchResult.error??"hosted_source_check_dispatch_failed");if(k.dispatchResult?.status==="completed"){let J=Y(k.sourceCheckStatus);Ze(J)&&(await Ye({client:n,teamId:t,runtimeAgentId:m,sourceRef:c,sourceCommitSha:p,validatedAt:new Date().toISOString()}),E=await n.agents.sourceDeployPlan(m,{teamId:t}))}}r={...r,promotionStatus:y?"hosted_source_check_pending":r.promotionStatus,hostedSourceCheck:X({agentId:m,status:y?"requested":"deploy_plan_ready",deployPlan:E,checkResult:k})},await R(r)}catch(c){let p=c instanceof Error?c.message:String(c);throw r={...r,promotionStatus:"hosted_source_check_failed",hostedSourceCheck:X({agentId:m,status:"failed",deployPlan:E,checkedAt:new Date().toISOString(),error:p}),error:p},await R(r),new Error(`Hosted source check failed after push: ${p}`)}}if($){if(!w)throw new Error("--hosted-source-agent-id or --hosted-run-agent-id is required for hosted source publish.");if(!m)throw new Error("Unable to resolve the hosted runtime agent for source publish.");try{let c=f(e,"expectedManifestHash")||r.hostedSourceCheck?.manifestHash||E?.source.manifestHash||void 0;Z=await n.agents.publishSource(m,{teamId:t,...c?{expectedManifestHash:c}:{},...r.hostedSourceMaterialization?.sourceCommitSha??g.sourceUpload.sourceCommitSha?{expectedSourceCommitSha:r.hostedSourceMaterialization?.sourceCommitSha??g.sourceUpload.sourceCommitSha}:{}}),r={...r,promotionStatus:"hosted_source_published",hostedPublish:ge({agentId:m,publishResult:Z})},await R(r)}catch(c){let p=c instanceof Error?c.message:String(c);throw r={...r,promotionStatus:"hosted_source_publish_failed",hostedPublish:{status:"failed",agentId:m,error:p},error:p},await R(r),new Error(`Hosted source publish failed after push: ${p}`)}}let z=null;if(C){let c=m||C,p=new Date().toISOString(),J=so(e,"hostedRunInput")??{prompt:"hello",channel:"openpond_chat"},D=f(e,"hostedRunConversationId")||f(e,"conversationId"),U=f(e,"hostedRunTargetProjectId"),se=ve({explicitKey:f(e,"hostedRunIdempotencyKey"),retry:S(e.hostedRunRetry),localHead:o.git.head,sourceHead:r.hostedSourceMaterialization?.sourceCommitSha??g.sourceUpload.sourceCommitSha,runtimeAgentId:c,targetProjectId:U,input:J});await R({...r,promotionStatus:"hosted_run_pending",hostedRunStatus:"running",hostedRunAgentId:c,hostedRunAt:p});try{z=await n.agents.run(c,{teamId:t,...D?{conversationId:D}:{},...U?{targetProjectId:U}:{},...U?{targetProject:{id:U}}:{},idempotencyKey:se,input:J,metadata:{source:"openpond_profile_push_run",...D?{conversationId:D}:{},targetProjectId:U||null,localHead:o.git.head,hostedHead:g.sourceUpload.sourceCommitSha,hostedRunIdempotencyKey:se,hostedRunRetry:S(e.hostedRunRetry),materializedProjectId:r.hostedSourceMaterialization?.projectId??null,materializedSourceCommitSha:r.hostedSourceMaterialization?.sourceCommitSha??null,sourceRef:r.hostedSourceMaterialization?.sourceRef??g.sourceUpload.sourceRef,publishedSnapshotId:r.hostedPublish?.snapshotId??null,manifestHash:r.hostedPublish?.manifestHash??r.hostedSourceCheck?.manifestHash??null},runtimeSourcePolicy:$?{requirePublishedSnapshot:!0,source:"diagnostic"}:{allowLatestSource:!0,source:"diagnostic"}});let F=me({agentId:c,runResult:z}),M=pe(F);await R({...r,promotionStatus:M==="passed"?"hosted_run_passed":M==="failed"?"hosted_run_failed":"hosted_run_pending",hostedRunStatus:M,hostedRunAgentId:c,hostedRunId:z.run.id,hostedRunAt:z.run.createdAt??p,hostedRun:F})}catch(F){let M=F instanceof Error?F.message:String(F);throw await R({...r,promotionStatus:"hosted_run_failed",hostedRunStatus:"failed",hostedRunAgentId:c,hostedRunAt:new Date().toISOString(),hostedRun:{status:"failed",agentId:c,error:M},error:M}),new Error(`Hosted invocation failed to start after push: ${M}`)}}if(S(e.json)){console.log(JSON.stringify({...g,uploaded:Be(P),hostedSourceMaterialization:r.hostedSourceMaterialization??null,hostedSourceChecks:k,hostedSourcePublish:Z,hostedRun:z},null,2));return}console.log(`Pushed OpenPond profile ${o.activeProfile??"default"} to hosted profile repo.`),console.log(`Project id: ${g.profile.project.id}`),console.log(`Local head: ${o.git.head}`),console.log(`Hosted source commit: ${g.sourceUpload.sourceCommitSha??"unknown"}`),console.log(`Uploaded ${P.fileCount} file(s), ${P.totalBytes} byte(s) via ${P.transport.mode} (limits: ${P.limits.maxFiles} files, ${P.limits.maxFileBytes} bytes/file, ${P.limits.maxTotalBytes} bytes total).`),console.log(z?`Hosted invocation: running ${z.run.id}`:"Hosted invocation: not started"),r.hostedSourceMaterialization&&console.log(`Hosted materialized: ${r.hostedSourceMaterialization.status}`+(r.hostedSourceMaterialization.projectId?` ${r.hostedSourceMaterialization.projectId}`:"")+(r.hostedSourceMaterialization.sourceCommitSha?` ${r.hostedSourceMaterialization.sourceCommitSha}`:"")),r.hostedSourceCheck&&console.log(`Hosted source checks: ${r.hostedSourceCheck.status}`),r.hostedPublish&&console.log(`Hosted publish: ${r.hostedPublish.status}`+(r.hostedPublish.snapshotId?` ${r.hostedPublish.snapshotId}`:"")),console.log(`Uploaded files: ${P.fileCount}`)}i(De,"runProfilePushCommand");function Be(e){return{fileCount:e.fileCount,totalBytes:e.totalBytes,limits:e.limits,transport:e.transport}}i(Be,"summarizeProfileSourceUpload");function Ge(e){return{...e,profiles:Object.fromEntries(Object.entries(e.profiles).map(([t,o])=>[t,{path:o.path,defaultAgent:o.defaultAgent??"default",enabledAgents:o.enabledAgents??[]}]))}}i(Ge,"normalizeHostedProfileManifest");async function Ke(e){let t=e.state.repoPath;if(!t)throw new Error("Active OpenPond profile is missing a repository path.");let o=await he(t);if(!e.hostedSourceAgentId)return o;if(!e.state.sourcePath)throw new Error("Active OpenPond profile is missing a source path.");let n=e.state.agents.find(d=>d.id===e.hostedSourceAgentId);if(!n)throw new Error(`Profile agent not found for hosted source upload: ${e.hostedSourceAgentId}`);let a=We(e.state.sourcePath,n.path),l=L.relative(t,a).replace(/\\/g,"/");if(l.startsWith("..")||L.isAbsolute(l))throw new Error(`Profile agent path escapes profile repo: ${n.path}`);let h=await K(a,[]);return h.entries.length===0?o:W(o,h.entries.map(d=>({...d,path:l?`${l}/${d.path}`:d.path})))}i(Ke,"collectProfileSourceUploadForPush");function We(e,t){let o=t.replace(/\\/g,"/"),n=L.resolve(e,o),a=L.relative(e,n);if(a.startsWith("..")||L.isAbsolute(a))throw new Error(`Profile agent path escapes profile source: ${t}`);return o==="agent/agent.ts"||o.endsWith("/agent.ts")?e:n}i(We,"resolveProfileAgentSourceRoot");function Y(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}i(Y,"record");function T(e){return typeof e=="string"&&e.trim()?e.trim():null}i(T,"text");function Ve(e,t){if(!t)return null;let o=e.hosted?.hostedSourceMaterialization;return o?.agentId===t&&o.runtimeAgentId?o.runtimeAgentId:t}i(Ve,"resolveHostedRuntimeAgentIdForRun");async function Ye(e){!e.sourceRef||!e.sourceCommitSha||await e.client.agents.update(e.runtimeAgentId,{teamId:e.teamId,runtimeSource:{mode:"latest_source",sourceRef:e.sourceRef,sourceCommitSha:e.sourceCommitSha,buildStatus:"succeeded",validationStatus:"passed",validatedAt:e.validatedAt}})}i(Ye,"bindValidatedHostedRuntimeSource");function Ze(e){if(!e)return!1;let t=T(e.finalResultState)?.toLowerCase();if(t&&t!=="completed"&&!Ee(t))return!1;let o=Array.isArray(e.checkRuns)?e.checkRuns.map(Y).filter(u=>!!u):[];if(o.some(Qe))return!1;let n=o.some(u=>V(u).includes("build")&&q(u)),a=q(Y(e.validation))||o.some(u=>V(u).includes("validate")&&q(u)),l=Y(e.eval),d=!((T(e.requestedCheckKind)??"all")==="all"||(T(e.requestedCheckKind)??"")==="eval"||!!l||o.some(u=>V(u).includes("eval")))||q(l)||o.some(u=>V(u).includes("eval")&&q(u));return n&&a&&d}i(Ze,"sourceCheckStatusPassed");function V(e){return(T(e.command)??"").toLowerCase()}i(V,"checkRunCommand");function Qe(e){let t=e.passed;if(typeof t=="boolean")return!t;let o=e.exitCode;if(typeof o=="number"&&o!==0)return!0;let n=T(e.status)?.toLowerCase();return!!(n&&Xe(n))}i(Qe,"checkRunFailed");function q(e){if(!e)return!1;if(typeof e.passed=="boolean")return e.passed;let t=Oe(e.failed)??Oe(e.failedCount);if(t!==null&&t>0)return!1;let o=e.exitCode;if(typeof o=="number")return o===0;let n=T(e.status)?.toLowerCase();return!!(n&&Ee(n))}i(q,"checkEvidencePassed");function Oe(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()){let t=Number(e);return Number.isFinite(t)?t:null}return null}i(Oe,"numericEvidence");function Ee(e){return e==="passed"||e==="succeeded"||e==="success"}i(Ee,"passingStatus");function Xe(e){return e==="failed"||e==="failure"||e==="cancelled"}i(Xe,"failingStatus");async function eo(e){let t=B(e,"usage: openpond profile hosted status"),n=await(await G(e)).profile.get({teamId:t});if(S(e.json)){console.log(JSON.stringify({profile:n},null,2));return}if(!n){console.log("No hosted OpenPond profile repo found."),console.log("Run `openpond profile ensure-hosted --team-id <id>` to create one.");return}ze(n)}i(eo,"runHostedProfileStatusCommand");async function He(e){let t=B(e,"usage: openpond profile ensure-hosted"),n=await(await G(e)).profile.ensureHosted({teamId:t});if(S(e.json)){console.log(JSON.stringify({profile:n},null,2));return}ze(n)}i(He,"runHostedProfileEnsureCommand");async function oo(e,t){if((t[0]??"list")!=="list")throw new Error("usage: openpond agents list [--json]");let n=await x();if(n.error)throw new Error(n.error);if(S(e.json)){console.log(JSON.stringify({agents:n.agents,profile:n},null,2));return}if(n.mode==="none"){console.log("No active OpenPond profile. Run `openpond init`.");return}if(n.agents.length===0){console.log(`No agents found in ${n.activeProfile}.`);return}for(let a of n.agents)console.log(`${a.id} ${a.enabled?"enabled":"disabled"} ${a.path}`)}i(oo,"runOpenPondAgentsCommand");async function xo(e,t,o){let n=f(t,"cwd"),a=[...o,...ro(t,new Set(["cwd","account","profile","handle","baseUrl"]))];await Pe({command:e,cwd:n?L.resolve(n):void 0,args:a,inherit:!0})}i(xo,"runOpenPondProfileSdkAlias");function re(e){if(e.mode==="none"){console.log("No active OpenPond profile."),console.log(`Default location: ${ee()}`);return}if(console.log(`Mode: ${e.mode}`),console.log(`Repo: ${e.repoPath}`),console.log(`Profile: ${e.activeProfile}`),console.log(`Source: ${e.sourcePath??"missing"}`),console.log(`State: ${e.summary.message}`),e.git&&(console.log(`Git: ${e.git.branch??"detached"} ${e.git.shortHead??"no-head"}${e.git.dirty?" dirty":" clean"}`),e.git.upstream&&console.log(`Upstream: ${e.git.upstream} ahead ${e.git.ahead??"?"} behind ${e.git.behind??"?"}`)),(e.hosted?.projectId||e.hosted?.sourceCommitSha)&&(console.log(`Hosted: ${e.hosted.projectId??"unbound"} ${e.hosted.sourceCommitSha??"no-source-head"}`),e.hosted.hostedSourceMaterialization&&console.log(`Hosted materialized: ${e.hosted.hostedSourceMaterialization.status}`+(e.hosted.hostedSourceMaterialization.agentId?` ${e.hosted.hostedSourceMaterialization.agentId}`:"")+(e.hosted.hostedSourceMaterialization.sourceCommitSha?` ${e.hosted.hostedSourceMaterialization.sourceCommitSha}`:"")),e.hosted.hostedSourceCheck&&console.log(`Hosted checks: ${e.hosted.hostedSourceCheck.status}`+(e.hosted.hostedSourceCheck.sandboxId?` sandbox ${e.hosted.hostedSourceCheck.sandboxId}`:"")),e.hosted.hostedPublish&&console.log(`Hosted publish: ${e.hosted.hostedPublish.status}`+(e.hosted.hostedPublish.snapshotId?` ${e.hosted.hostedPublish.snapshotId}`:"")),e.hosted.hostedRun&&console.log(`Hosted run: ${e.hosted.hostedRun.status}`+(e.hosted.hostedRun.runId?` ${e.hosted.hostedRun.runId}`:"")+(e.hosted.hostedRun.runtimeId?` runtime ${e.hosted.hostedRun.runtimeId}`:""))),console.log(`Catalog: ${e.catalog.actionCount} action(s)${e.catalog.stale?" stale":""}`),console.log(`Setup gate: ${e.setupGate.status} (${e.setupGate.blockingCount} blocking, ${e.setupGate.optionalMissingCount} optional missing)`),e.summary.defaultAction&&console.log(`Default action: ${e.summary.defaultAction}`),e.setupGate.blockingRequirements.length>0){console.log("Blocking setup:");for(let t of e.setupGate.blockingRequirements.slice(0,10))console.log(` ${Q(t)}`);e.setupGate.blockingRequirements.length>10&&console.log(` ... ${e.setupGate.blockingRequirements.length-10} more`)}if(!e.summary.checkFresh&&e.summary.checkStaleReason?console.log(`Checks: stale - ${e.summary.checkStaleReason}`):e.summary.checkFresh&&console.log("Checks: fresh"),e.lastCheck&&console.log(`Last check: ${e.lastCheck.command} ${e.lastCheck.status} at ${e.lastCheck.checkedAt}`),e.error&&console.log(`Error: ${e.error}`),e.agents.length>0){console.log("Agents:");for(let t of e.agents)console.log(` ${t.id} (${t.enabled?"enabled":"disabled"}) ${t.path}`)}if(e.skills.length>0){console.log("Skills:");for(let t of e.skills){let o=t.validationStatus==="valid"?"valid":t.validationStatus;console.log(` ${t.name} (${o}) ${t.path}`)}}}i(re,"printProfileState");function to(e){if(e.mode==="none"){console.log("No active OpenPond profile.");return}console.log(`Profile: ${e.activeProfile}`),console.log(`State: ${e.summary.message}`);let t=[["Changed agents",e.diff.changedAgents],["New agents",e.diff.newAgents],["Deleted agents",e.diff.deletedAgents],["Changed skills",e.diff.changedSkills],["Changed actions",e.diff.changedActions],["Changed extensions",e.diff.changedExtensions],["Setup changes",e.diff.setupChanges],["Env requirement changes",e.diff.envRequirementChanges]];for(let[o,n]of t)n.length!==0&&console.log(`${o}: ${n.join(", ")}`);if(e.diff.files.length===0){console.log("No source changes.");return}console.log("Files:");for(let o of e.diff.files)console.log(` ${o.status.padEnd(2)} ${o.path}`)}i(to,"printProfileDiff");function no(e){if(e.mode==="none"){console.log("No active OpenPond profile.");return}if(console.log(`Profile: ${e.activeProfile}`),console.log(`Catalog: ${e.catalog.actionCount} action(s)${e.catalog.stale?" stale":""}`),console.log(`Setup gate: ${e.setupGate.status} (${e.setupGate.blockingCount} blocking, ${e.setupGate.optionalMissingCount} optional missing)`),e.catalog.generatedAt&&console.log(`Generated at: ${e.catalog.generatedAt}`),e.catalog.error&&console.log(`Catalog error: ${e.catalog.error}`),e.actionCatalog.length===0){console.log("No catalog actions found. Run `openpond inspect` or `openpond build`.");return}for(let o of e.actionCatalog){let n=o.label??o.name??o.id,a=o.visibility??"default",l=e.setupGate.blockingRequirements.filter(d=>d.actionId===o.id),h=l.length?`setup_required:${l.map(d=>d.label).join(",")}`:"setup_ready";console.log(`${o.id} ${a} ${h} ${n}`)}let t=e.setupGate.blockingRequirements.filter(o=>o.actionId===null);if(t.length>0){console.log("Source setup blockers:");for(let o of t)console.log(` ${Q(o)}`)}}i(no,"printProfileCatalog");function ze(e){if(console.log(`Hosted profile repo: ${e.project.name}`),console.log(`Project id: ${e.project.id}`),console.log(`Role: ${e.project.role??"profile"}`),console.log(`Default profile: ${e.defaultProfile}`),console.log(`Source path: ${e.sourcePath}`),console.log(`Seed status: ${e.seedStatus}`),e.sourceUpload?.sourceRef&&console.log(`Source ref: ${e.sourceUpload.sourceRef}`),e.sourceUpload?.sourceCommitSha&&console.log(`Source commit: ${e.sourceUpload.sourceCommitSha}`),e.seededAt&&console.log(`Seeded at: ${e.seededAt}`),e.agents.length>0){console.log("Agents:");for(let t of e.agents)console.log(` ${t.id} (${t.enabled?"enabled":"disabled"}) ${t.path}`)}}i(ze,"printHostedProfileSummary");function ro(e,t){let o=[],n=new Set(["force","json"]);for(let[a,l]of Object.entries(e)){if(t.has(a))continue;let h=`--${a.replace(/[A-Z]/g,d=>`-${d.toLowerCase()}`)}`;if(l===!0||n.has(a)&&l==="true")o.push(h);else{if(n.has(a)&&l==="false")continue;typeof l=="string"&&o.push(h,l)}}return o}i(ro,"optionArgs");function so(e,t){let o=f(e,t);if(!o)return null;let n=JSON.parse(o);if(!n||typeof n!="object"||Array.isArray(n))throw new Error(`--${t} must be a JSON object`);return n}i(so,"parseJsonObjectOption");export{Ke as collectProfileSourceUploadForPush,oo as runOpenPondAgentsCommand,zo as runOpenPondInitCommand,Mo as runOpenPondProfileCommand,xo as runOpenPondProfileSdkAlias};
|
package/dist/chunks/{profile-training-source-6GOT7AHM.js → profile-training-source-J73ZLNSC.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{b as a}from"./chunk-
|
|
2
|
+
import{b as a}from"./chunk-DX7YEUNQ.js";import"./chunk-VHSX3JPX.js";import"./chunk-BIPQCJ5V.js";import"./chunk-PF56N7ZY.js";import"./chunk-FTQLQJQV.js";export{a as profileTrainingSource};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{w as a}from"./chunk-G5B3PB5X.js";import"./chunk-KJFRCVQC.js";import"./chunk-OKBIWRHC.js";import"./chunk-JGWINTT5.js";import"./chunk-SYUKES6H.js";import"./chunk-ZTVXRZ6D.js";import"./chunk-7LZISGTA.js";import"./chunk-BFKYRQMA.js";import"./chunk-LO3O45IX.js";import"./chunk-XW6HGSIT.js";import"./chunk-FSQWAANK.js";import"./chunk-ZR7LIMJS.js";import"./chunk-OQPJ7FJF.js";import"./chunk-PCNLC5H3.js";import"./chunk-P7HRF4FM.js";import"./chunk-UFHLLSCE.js";import"./chunk-2ITZW2CN.js";import"./chunk-HCEJAOIF.js";import"./chunk-6GWOVHIG.js";import"./chunk-QGOPYQW3.js";import"./chunk-O4FBOUNX.js";import"./chunk-5ZBLCWEJ.js";import"./chunk-WYZWDMMF.js";import"./chunk-DG4TYVPF.js";import"./chunk-PWK5Z5S3.js";import"./chunk-DDMZSZFL.js";import"./chunk-W45RKGM6.js";import"./chunk-2MMCZHKL.js";import"./chunk-WGX7WY4N.js";import"./chunk-XO3H32KX.js";import"./chunk-DIGX56JY.js";import"./chunk-R7YEURUQ.js";import"./chunk-DZUAT3TP.js";import"./chunk-H3BSIAQO.js";import"./chunk-637UACKH.js";import"./chunk-A66CSUBJ.js";import"./chunk-SPDSSMFD.js";import"./chunk-E63VWAQA.js";import"./chunk-PR5TYTY4.js";import"./chunk-RYGWCN2R.js";import"./chunk-ZZWAQBA2.js";import"./chunk-YR5ID2SS.js";import"./chunk-KNO355LC.js";import"./chunk-Y54RKLOI.js";import"./chunk-2SUMZ73C.js";import"./chunk-M55H7KVR.js";import"./chunk-BK63OQRW.js";import"./chunk-V4KT5FCJ.js";import"./chunk-6FA3GG5B.js";import"./chunk-LHA7RQBA.js";import"./chunk-SG6JZ7HD.js";import"./chunk-ON2RNOCG.js";import"./chunk-H7IWJN7L.js";import"./chunk-SFNCAPCJ.js";import"./chunk-RCA6NGVA.js";import"./chunk-VHSX3JPX.js";import"./chunk-BIPQCJ5V.js";import"./chunk-PF56N7ZY.js";import"./chunk-FTQLQJQV.js";export{a as createProjectActionRunPayload};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{a as b,b as Y,c as F,d as H,e as W,f as z,g as X,h as E,i as y,j as v,k as C,l as Z,m as ee,n as A,o as te,p as _,q as j,r as re,s as ne,t as x,u as M,v as R,w as J,x as N,y as U,z as T}from"./chunk-SLZH4Z6C.js";import{m as h,n as I,v as P}from"./chunk-ISFIDCIH.js";import"./chunk-23P2O7PH.js";import"./chunk-AW5Q6NXT.js";import"./chunk-YVNDDNMK.js";import"./chunk-XRKFTPHD.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{c as u,d,e as w,f as S}from"./chunk-3M53YXEI.js";import"./chunk-YDU3S6UT.js";import"./chunk-EL454L26.js";import"./chunk-BT5YNE5U.js";import"./chunk-PXS4SVQG.js";import"./chunk-FWIPHEVA.js";import"./chunk-ENSB6ZTM.js";import"./chunk-GLUWATL5.js";import"./chunk-RYGWCN2R.js";import"./chunk-ZZWAQBA2.js";import"./chunk-YR5ID2SS.js";import"./chunk-KNO355LC.js";import"./chunk-Y54RKLOI.js";import"./chunk-2SUMZ73C.js";import"./chunk-M55H7KVR.js";import"./chunk-BK63OQRW.js";import"./chunk-V4KT5FCJ.js";import"./chunk-ERJV5BMC.js";import"./chunk-6FA3GG5B.js";import"./chunk-LHA7RQBA.js";import"./chunk-SG6JZ7HD.js";import"./chunk-ON2RNOCG.js";import"./chunk-H7IWJN7L.js";import"./chunk-SFNCAPCJ.js";import"./chunk-RCA6NGVA.js";import"./chunk-VHSX3JPX.js";import"./chunk-BIPQCJ5V.js";import"./chunk-PF56N7ZY.js";import{a as g}from"./chunk-FTQLQJQV.js";function k(e){let o=e.gitRepo?`${e.gitOwner??"_"}/${e.gitRepo}`:e.internalRepoPath??e.templateRepoUrl??e.normalizedSourceIdentity;return[e.id,e.status,e.sourceType,e.name,o].join(" ")}g(k,"formatProjectLine");function L(e){let o=e.selectedEntrypoint.name?`${e.selectedEntrypoint.scope}:${e.selectedEntrypoint.name}`:e.selectedEntrypoint.scope,i=e.runtimeSource?[e.runtimeSource.mode,e.runtimeSource.publishedSnapshotName??e.runtimeSource.publishedSnapshotId??e.runtimeSource.sourceRef].filter(a=>!!a).join(":"):"latest_source";return[e.id,e.status,e.triggerType,e.defaultWorkflowMode,i,o,e.name].join(" ")}g(L,"formatAgentLine");async function B(e,o,i){let a=i[1]?.trim(),t=i[2]?.trim(),n="usage: agent source <deploy-plan|checks|manifest-snapshots|setup|publish> <agent-id> --team-id <id>",r=d(o,n);if(!a||!t)throw new Error(n);if(a==="deploy-plan"){let s=await e.agents.sourceDeployPlan(t,{teamId:r});console.log(JSON.stringify({deployPlan:s},null,2));return}if(a==="manifest-snapshots"){let s=await e.agents.manifestSnapshots(t,{teamId:r,limit:x(o.limit)});console.log(JSON.stringify({manifestSnapshots:s},null,2));return}if(a==="checks"){let s=await e.agents.requestSourceChecks(t,M(r,o));console.log(JSON.stringify(s,null,2));return}if(a==="setup"){let s=typeof o.provider=="string"?o.provider.trim():"",l=typeof o.allowedActions=="string"?o.allowedActions.split(",").map(c=>c.trim()).filter(Boolean):[];if(!s||l.length===0)throw new Error(`${n}; setup requires --provider and --allowed-actions`);let p=await e.agents.configureSourceSetup(t,{teamId:r,integrationBindings:[{provider:s,mode:"connected",connectionMode:"member_connection",grantPolicy:"read_only",allowedActions:l,enabled:!0}]});console.log(JSON.stringify(p,null,2));return}if(a==="publish"){let s=await e.agents.publishSource(t,R(r,o));console.log(JSON.stringify(s,null,2));return}throw new Error(n)}g(B,"runAgentSourceWorkflow");import G from"node:path";var Q=new Set(["inspect","build","validate","eval","traces"]);function $(e,o){return Q.has(e)?!0:e==="run"&&!u(o,"teamId")}g($,"shouldDelegateLocalAgentSdkCommand");async function q(e,o){let i=o[0]||"inspect",a=G.resolve(u(e,"cwd")||u(e,"path")||"."),t=[i,...o.slice(1),"--cwd",a];S(e.json)&&t.push("--json"),D(t,e,"input","input"),D(t,e,"inputFile","input-file");let n=b(a),r=await P(n.command,[...n.args,...t],{cwd:a,inherit:!0});r.code!==0&&(process.exitCode=r.code??1)}g(q,"runLocalAgentSdkCommand");function D(e,o,i,a){let t=u(o,i);t&&e.push(`--${a}`,t)}g(D,"appendForwardedOption");async function Oe(e,o){let i=o[0]||"list";if($(i,e)){await q(e,o);return}let a=await h(e);if(i==="list"){let t=d(e,"usage: agent list"),n=await a.agents.list({teamId:t});if(S(e.json)){console.log(JSON.stringify({agents:n},null,2));return}if(n.length===0){console.log("no sandbox agents found");return}for(let r of n)console.log(L(r));return}if(i==="create"||i==="upsert"){let t=await a.agents.upsert(U(e));console.log(JSON.stringify({agent:t},null,2));return}if(i==="get"){let t=o[1]?.trim(),n=d(e,"usage: agent get <agentId>");if(!t)throw new Error("usage: agent get <agentId> --team-id <id>");let r=await a.agents.get(t,{teamId:n});console.log(JSON.stringify({agent:r},null,2));return}if(i==="run"){let t=o[1]?.trim(),n=d(e,"usage: agent run <agentId>");if(!t)throw new Error("usage: agent run <agentId> --team-id <id>");let r=u(e,"idempotencyKey"),s=u(e,"conversationId"),l=u(e,"targetProjectId"),p=A(e.triggerType),c=I(e.workflowMode),m=w(e,"input","input"),f=w(e,"metadata","metadata"),O=j(e),K=await a.agents.run(t,{teamId:n,...s?{conversationId:s}:{},...r?{idempotencyKey:r}:{},...l?{targetProjectId:l}:{},...l?{targetProject:{id:l}}:{},...p?{triggerType:p}:{},...c?{workflowMode:c}:{},...m?{input:m}:{},...f?{metadata:f}:{},...O?{runtimeSourcePolicy:O}:{}});console.log(JSON.stringify(K,null,2));return}if(i==="bind-runtime-source"||i==="bind-source"){let t=o[1]?.trim(),n=d(e,"usage: agent bind-source <agentId>");if(!t)throw new Error("usage: agent bind-source <agentId> --team-id <id> --source-mode latest_source|published_snapshot|auto");let r=_(e);if(!r?.mode)throw new Error("usage: agent bind-source <agentId> --team-id <id> --source-mode latest_source|published_snapshot|auto");let s=await a.agents.update(t,{teamId:n,runtimeSource:r});console.log(JSON.stringify({agent:s,agentSource:s.runtimeSource},null,2));return}if(i==="run-test"){let t=o[1]?.trim(),n=d(e,"usage: agent run-test <agentId>");if(!t)throw new Error("usage: agent run-test <agentId> --team-id <id>");let r=u(e,"idempotencyKey"),s=u(e,"conversationId"),l=u(e,"targetProjectId"),p=w(e,"input","input"),c=w(e,"metadata","metadata"),m=I(e.workflowMode),f=await a.agents.run(t,{teamId:n,...s?{conversationId:s}:{},...r?{idempotencyKey:r}:{},...l?{targetProjectId:l}:{},...l?{targetProject:{id:l}}:{},...m?{workflowMode:m}:{},...p?{input:p}:{},metadata:{...c??{},source:"agent_run_test"},runtimeSourcePolicy:j(e,"diagnostic")});console.log(JSON.stringify({resolvedRuntimeSource:f.run.runtimeSource,agent:f.agent,run:f.run,sandbox:f.sandbox??null},null,2));return}if(i==="source"){await B(a,e,o);return}if(i==="update"){let t=o[1]?.trim(),n=d(e,"usage: agent update <agentId>");if(!t)throw new Error("usage: agent update <agentId> --team-id <id>");let r=await a.agents.update(t,T(n,e));console.log(JSON.stringify({agent:r},null,2));return}if(i==="archive"){let t=o[1]?.trim(),n=d(e,"usage: agent archive <agentId>");if(!t)throw new Error("usage: agent archive <agentId> --team-id <id>");let r=await a.agents.archive(t,{teamId:n});console.log(JSON.stringify({agent:r},null,2));return}throw new Error("usage: agent <inspect|build|validate|eval|traces|list|create|upsert|get|update|run|run-test|bind-source|source|edit|archive> [--team-id <id>] [--project-id <id>] [--name <name>]")}g(Oe,"runAgentCommand");import V from"node:path";async function xe(e,o){let i=o[0]||"list",a=await h(e);if(i==="list"){let t=d(e,"usage: project list"),n=await a.projects.list({teamId:t});if(S(e.json)){console.log(JSON.stringify({projects:n},null,2));return}if(n.length===0){console.log("no sandbox projects found");return}for(let r of n)console.log(k(r));return}if(i==="create"||i==="upsert"){let t=await a.projects.upsert(J(e));console.log(JSON.stringify({project:t},null,2));return}if(i==="get"){let t=o[1]?.trim(),n=d(e,"usage: project get <projectId>");if(!t)throw new Error("usage: project get <projectId> --team-id <id>");let r=await a.projects.get(t,{teamId:n});console.log(JSON.stringify({project:r},null,2));return}if(i==="update"){let t=o[1]?.trim(),n=d(e,"usage: project update <projectId>");if(!t)throw new Error("usage: project update <projectId> --team-id <id>");let r=await a.projects.update(t,N(n,e));console.log(JSON.stringify({project:r},null,2));return}if(i==="sync"){let t=o[1]?.trim(),n=d(e,"usage: project sync <projectId>");if(!t)throw new Error("usage: project sync <projectId> --team-id <id>");let r=await a.projects.sync(t,{teamId:n});console.log(JSON.stringify({project:r},null,2));return}if(i==="source-upload"||i==="upload-source"){let t=o[1]?.trim(),n=d(e,"usage: project source-upload <projectId>");if(!t)throw new Error("usage: project source-upload <projectId> --team-id <id> [--path <dir>]");let r=V.resolve(u(e,"path")||"."),s=await E(r,e),l=u(e,"commitMessage")||u(e,"commit-message")||"Upload OpenPond project source",p=await y(r),c=await v(r,p.entries),m=C(p,c.entries),f=await a.projects.uploadSource(t,{teamId:n,entries:m.entries,...s?{branch:s}:{},commitMessage:l});console.log(JSON.stringify({project:f,uploaded:{path:r,branch:s,fileCount:m.fileCount,totalBytes:m.totalBytes,limits:m.limits,transport:m.transport,...c.generatedManifestPath?{agentSdk:{generatedManifestPath:c.generatedManifestPath,generatedEntryCount:c.entries.length,synthesizedOpenPondYaml:c.synthesizedOpenPondYaml,uploadMetadataPath:c.uploadMetadataPath,uploadMetadataHash:c.uploadMetadataHash,commands:c.uploadMetadata?.commands,dependencySetup:c.uploadMetadata?.dependencySetup,packageManager:c.uploadMetadata?.packageManager,sourceTreeMode:c.uploadMetadata?.sourceTreeMode,artifactHashes:c.uploadMetadata?.artifactHashes}}:{}}},null,2));return}if(i==="archive"){let t=o[1]?.trim(),n=d(e,"usage: project archive <projectId>");if(!t)throw new Error("usage: project archive <projectId> --team-id <id>");let r=await a.projects.archive(t,{teamId:n});console.log(JSON.stringify({project:r},null,2));return}throw new Error("usage: project <list|create|upsert|get|update|sync|source-upload|archive> [--team-id <id>] [--name <name>]")}g(xe,"runProjectCommand");export{W as PROJECT_SOURCE_UPLOAD_CONCURRENCY,z as PROJECT_SOURCE_UPLOAD_LIMITS,H as PROJECT_SOURCE_UPLOAD_MAX_BYTES,Y as PROJECT_SOURCE_UPLOAD_MAX_FILES,F as PROJECT_SOURCE_UPLOAD_MAX_FILE_BYTES,X as PROJECT_SOURCE_UPLOAD_TRANSPORT,M as buildAgentSourceChecksInput,_ as buildAgentSourceConfig,j as buildAgentSourcePolicy,R as buildAgentSourcePublishInput,T as buildAgentUpdateInput,U as buildAgentUpsertInput,N as buildProjectUpdateInput,J as buildProjectUpsertInput,y as collectProjectSourceUploadEntries,L as formatAgentLine,k as formatProjectLine,ee as parseAgentEntrypointScope,ne as parseAgentSourceCheckDispatch,re as parseAgentSourceCheckKind,te as parseAgentSourceMode,A as parseAgentTriggerType,x as parsePositiveLimit,Z as parseProjectSourceType,b as resolveLocalAgentSdkCommand,Oe as runAgentCommand,B as runAgentSourceWorkflow,xe as runProjectCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as b}from"./chunk-
|
|
2
|
+
import{a as b}from"./chunk-OQ4VGCRG.js";import{a as x}from"./chunk-M3ZQDPRS.js";import"./chunk-ZR7LIMJS.js";import"./chunk-OQPJ7FJF.js";import"./chunk-PCNLC5H3.js";import"./chunk-P7HRF4FM.js";import"./chunk-UFHLLSCE.js";import"./chunk-2ITZW2CN.js";import"./chunk-HCEJAOIF.js";import"./chunk-6GWOVHIG.js";import"./chunk-QGOPYQW3.js";import"./chunk-O4FBOUNX.js";import"./chunk-5ZBLCWEJ.js";import"./chunk-WYZWDMMF.js";import{a as H}from"./chunk-DG4TYVPF.js";import"./chunk-PWK5Z5S3.js";import"./chunk-DDMZSZFL.js";import"./chunk-W45RKGM6.js";import"./chunk-2MMCZHKL.js";import"./chunk-WGX7WY4N.js";import"./chunk-XO3H32KX.js";import"./chunk-DIGX56JY.js";import"./chunk-R7YEURUQ.js";import"./chunk-DZUAT3TP.js";import"./chunk-H3BSIAQO.js";import"./chunk-637UACKH.js";import"./chunk-A66CSUBJ.js";import"./chunk-SPDSSMFD.js";import"./chunk-E63VWAQA.js";import"./chunk-PR5TYTY4.js";import"./chunk-KNO355LC.js";import"./chunk-Y54RKLOI.js";import"./chunk-2SUMZ73C.js";import"./chunk-M55H7KVR.js";import"./chunk-BK63OQRW.js";import"./chunk-V4KT5FCJ.js";import"./chunk-6FA3GG5B.js";import"./chunk-SG6JZ7HD.js";import"./chunk-ON2RNOCG.js";import"./chunk-SFNCAPCJ.js";import{ob as k}from"./chunk-RCA6NGVA.js";import{v as E,w as R}from"./chunk-VHSX3JPX.js";import{k as S,l as g,m as n}from"./chunk-BIPQCJ5V.js";import"./chunk-PF56N7ZY.js";import{a as p}from"./chunk-FTQLQJQV.js";import{randomUUID as v}from"node:crypto";import{promises as t}from"node:fs";import i from"node:path";async function J(r){let o=k.parse(r.reference),e=E(r.sourcePackage,o.harnessRelease);if(e.contentHash!==o.sourcePackageHash||n(o.agentSnapshot)!==n({id:e.agentSnapshot.id,contentHash:e.agentSnapshot.contentHash}))throw new Error("Published Experiment source differs from its admitted immutable closure.");if(!r.ownerId.trim())throw new Error("Published Experiment source requires its trusted execution owner.");b(e);let c=`experiment-source-${n({ownerId:r.ownerId,reference:o})}`,a=await r.store.getHarnessReleaseRecord(o.harnessRelease.contentHash);if(a){let s=await r.store.getHarnessWorkspace(a.workspaceId);if(!s||s.id!==c||s.ownerScope.kind!=="personal"||s.ownerScope.id!==r.ownerId||s.metadata.experimentSourcePackageHash!==e.contentHash||n(a.agentSnapshot)!==n(e.agentSnapshot)||n(a.harnessRelease)!==n(e.harnessRelease))throw new Error("Published Experiment source is already retained under a different owner or immutable closure.");return await y(a.bundlePath,e),{workspace:s,release:a}}let l=i.join(r.storeDir,"library","harnesses","releases"),h=i.join(l,e.harnessRelease.contentHash),d=i.join(l,`.${e.harnessRelease.contentHash}.experiment-${v()}`);await t.mkdir(l,{recursive:!0,mode:448});try{await t.mkdir(i.join(d,"source"),{recursive:!0,mode:448});for(let[s,m]of R(e)){let w=i.join(d,"source",...s.split("/"));await t.mkdir(i.dirname(w),{recursive:!0,mode:448}),await t.writeFile(w,m,{flag:"wx",mode:384})}for(let[s,m]of[["agent-snapshot.json",e.agentSnapshot],["harness-release.json",e.harnessRelease]])await t.writeFile(i.join(d,s),S(m),{flag:"wx",mode:384});try{await t.rename(d,h)}catch(s){if(!["EEXIST","ENOTEMPTY"].includes(s.code??""))throw s}await y(h,e)}finally{await t.rm(d,{recursive:!0,force:!0})}let u=x.parse({schemaVersion:"openpond.localHarnessReleaseRecord.v1",workspaceId:c,sourceRevision:e.contentHash,agentSnapshot:e.agentSnapshot,harnessRelease:e.harnessRelease,bundlePath:h,createdAt:r.createdAt}),f=H.parse({schemaVersion:"openpond.harnessWorkspace.v1",id:c,ownerScope:{kind:"personal",id:r.ownerId},name:"Experiment source",location:"local",sourceRevision:e.contentHash,revision:0,dirty:!1,currentChannel:{name:"personal",release:o.harnessRelease,revision:1},createdAt:r.createdAt,updatedAt:r.createdAt,metadata:{selectionEligible:!1,experimentSourcePackageHash:e.contentHash}});return await r.store.createHarnessWorkspaceWithRelease({workspace:f,release:u}),{workspace:f,release:u}}p(J,"installPublishedExperimentSource");async function y(r,o){if(await t.realpath(r)!==i.resolve(r))throw new Error("Published Experiment bundle cannot be a symbolic link.");for(let[c,a]of[["agent-snapshot.json",o.agentSnapshot],["harness-release.json",o.harnessRelease]]){let l=i.join(r,c);if(!(await t.lstat(l)).isFile()||n(JSON.parse(await t.readFile(l,"utf8")))!==n(a))throw new Error("Retained published Experiment release metadata changed.")}for(let c of o.harnessRelease.files){let a=i.join(r,"source",...c.path.split("/"));if(!(await t.lstat(a)).isFile()||await t.realpath(a)!==a)throw new Error("Published Experiment source must contain regular immutable files.");let l=await t.readFile(a);if(l.byteLength!==c.sizeBytes||g(l)!==c.contentHash)throw new Error("Retained published Experiment source differs from its released bytes.")}}p(y,"verifyBundle");export{J as installPublishedExperimentSource};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h}from"./chunk-STWRTNRK.js";import"./chunk-ZR7LIMJS.js";import"./chunk-OQPJ7FJF.js";import"./chunk-PCNLC5H3.js";import"./chunk-P7HRF4FM.js";import"./chunk-UFHLLSCE.js";import"./chunk-2ITZW2CN.js";import"./chunk-HCEJAOIF.js";import"./chunk-6GWOVHIG.js";import"./chunk-QGOPYQW3.js";import"./chunk-O4FBOUNX.js";import"./chunk-5ZBLCWEJ.js";import"./chunk-WYZWDMMF.js";import"./chunk-DG4TYVPF.js";import"./chunk-PWK5Z5S3.js";import"./chunk-DDMZSZFL.js";import"./chunk-W45RKGM6.js";import"./chunk-2MMCZHKL.js";import"./chunk-WGX7WY4N.js";import"./chunk-XO3H32KX.js";import"./chunk-DIGX56JY.js";import"./chunk-R7YEURUQ.js";import"./chunk-DZUAT3TP.js";import"./chunk-H3BSIAQO.js";import"./chunk-637UACKH.js";import"./chunk-A66CSUBJ.js";import"./chunk-SPDSSMFD.js";import"./chunk-E63VWAQA.js";import"./chunk-PR5TYTY4.js";import"./chunk-KNO355LC.js";import"./chunk-Y54RKLOI.js";import"./chunk-2SUMZ73C.js";import"./chunk-M55H7KVR.js";import"./chunk-BK63OQRW.js";import"./chunk-V4KT5FCJ.js";import"./chunk-6FA3GG5B.js";import"./chunk-LHA7RQBA.js";import"./chunk-SG6JZ7HD.js";import"./chunk-ON2RNOCG.js";import"./chunk-H7IWJN7L.js";import"./chunk-SFNCAPCJ.js";import"./chunk-RCA6NGVA.js";import"./chunk-VHSX3JPX.js";import"./chunk-BIPQCJ5V.js";import"./chunk-PF56N7ZY.js";import"./chunk-FTQLQJQV.js";export{f as activateRefinerRelease,b as createRefinerProfileRoutePayloads,h as initializeRefinerProfile,c as inspectRefinerProfile,d as loadActiveRefinerRelease,a as refinerProfilePaths,g as rollbackRefinerRelease,e as updateRefinerProfile};
|