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
package/dist/web/assets/{useLocalAgentSchedules-BHJNVf42.js → useLocalAgentSchedules-BFoH_gwZ.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i}from"./index-
|
|
1
|
+
import{r as i}from"./index-Di1MU6Xr.js";import{W as s}from"./App-nzE7JU_O.js";const m=5e3;function _(t){const[h,n]=i.useState([]),[y,r]=i.useState(!1),[p,l]=i.useState(null),[o,w]=i.useState(()=>new Set);i.useEffect(()=>{if(!t){n([]),l(null),r(!1);return}const e=t;let a=!1;async function d(S){if(!a){S&&r(!0);try{const g=await s.localAgentSchedules(e);if(a)return;n(g.schedules),l(null)}catch(g){a||l(f(g))}finally{!a&&S&&r(!1)}}}d(!0);const u=window.setInterval(()=>{d(!1)},m);return()=>{a=!0,window.clearInterval(u)}},[t]);async function A(){if(t){r(!0);try{const e=await s.syncLocalAgentSchedules(t);n(e.schedules),l(null)}catch(e){l(f(e))}finally{r(!1)}}}async function E(e){if(!(!t||o.has(e.id))){c(e.id,!0);try{await s.runLocalAgentSchedule(t,e.id);const a=await s.localAgentSchedules(t);n(a.schedules),l(null)}catch(a){l(f(a))}finally{c(e.id,!1)}}}async function L(e){if(!(!t||o.has(e.id))){c(e.id,!0);try{await s.patchLocalAgentSchedule(t,e.id,{enabled:!e.enabled});const a=await s.localAgentSchedules(t);n(a.schedules),l(null)}catch(a){l(f(a))}finally{c(e.id,!1)}}}function c(e,a){w(d=>{const u=new Set(d);return a?u.add(e):u.delete(e),u})}return{error:p,loading:y,pendingScheduleIds:o,refresh:A,run:E,schedules:h,toggle:L}}function f(t){return t instanceof Error?t.message:String(t)}export{_ as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as t,j as e}from"./index-DEg0S7Qk.js";import{e as Ae,g as K,v as Ee,X as ae,aB as le,bA as V,T as ne,r as Y,E as Oe,az as be,aG as fe,cq as Me,bH as Re,cu as $e,W as q,cv as te,bD as De,q as Te,ad as ce}from"./App-pcwmC4IR.js";import{A as _e}from"./AppDialog-CdHad7GT.js";import{S as Le}from"./save-CvYL4DUg.js";import{T as ue}from"./MarkdownText-BBVriBCj.js";const Ue=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],I=Ae("key-round",Ue);function ze({connection:s,onChanged:r,onAdded:d}){const i=t.useId(),[o,g]=t.useState(!1),[c,l]=t.useState(!1),[S,D]=t.useState(null),[w,P]=t.useState(0),[T,m]=t.useState(""),[p,O]=t.useState(null),[$,k]=t.useState(""),[M,h]=t.useState(""),[v,A]=t.useState(""),[E,R]=t.useState(""),[b,N]=t.useState("[]"),[L,U]=t.useState("{}"),[x,u]=t.useState(!1),[a,f]=t.useState(!1),[C,j]=t.useState(null);t.useEffect(()=>{if(!o||c||!s)return;const n=new AbortController;return u(!0),j(null),K(s,`/v1/providers/acp-registry${w?"?refresh=true":""}`,{signal:n.signal}).then(y=>{n.signal.aborted||(D(y),O(null))}).catch(y=>{n.signal.aborted||j(y instanceof Error?y.message:"Could not load ACP registry.")}).finally(()=>{n.signal.aborted||u(!1)}),()=>n.abort()},[o,c,s,w]);const J=p?[p.distribution.binary?.[S?.platform??""]?"binary":null,p.distribution.npx?"npx":null,p.distribution.uvx?"uvx":null].filter(n=>!!n):[],G=S?.agents.filter(n=>`${n.name} ${n.id} ${n.description}`.toLowerCase().includes(T.trim().toLowerCase()))??[],F=J.includes($)?$:J[0],W=F==="binary"?p?.distribution.binary?.[S?.platform??""]:F==="npx"?p?.distribution.npx:p?.distribution.uvx;async function Z(n){if(n.preventDefault(),!(!s||a)){f(!0),j(null);try{const y=c?{custom:{displayName:v.trim(),command:E.trim(),args:JSON.parse(b),env:JSON.parse(L)}}:{registryId:p?.id,version:p?.version,distribution:F,displayName:M.trim()||p?.name},z=await K(s,"/v1/providers/acp-registry",{method:"POST",body:JSON.stringify(y)});r(z.settings),d(z.providerId),g(!1),O(null),h(""),A(""),R(""),N("[]"),U("{}")}catch(y){j(y instanceof Error?y.message:"Could not add ACP agent.")}finally{f(!1)}}}function X(){a||g(!1)}return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"settings-secondary acp-add-button",disabled:!s||a,onClick:()=>g(!0),children:[e.jsx(Ee,{size:16,"aria-hidden":"true"})," ACP Agent"]}),o?e.jsxs(_e,{ariaLabel:"Add ACP agent",backdropClassName:"git-dialog-backdrop provider-dialog-backdrop",className:"git-dialog provider-details-dialog acp-agent-dialog",dismissDisabled:a,onClose:X,children:[e.jsx("button",{type:"button",className:"git-dialog-close","aria-label":"Close",disabled:a,onClick:X,children:e.jsx(ae,{size:18})}),e.jsx("div",{className:"provider-dialog-header",children:e.jsxs("div",{children:[e.jsx("h2",{children:"Add ACP agent"}),e.jsx("span",{children:"Choose from the registry or register your own agent."})]})}),e.jsxs("div",{className:"surface-tabs",role:"tablist","aria-label":"Agent registration",onKeyDown:n=>{if(a||!["ArrowLeft","ArrowRight","Home","End"].includes(n.key))return;n.preventDefault();const y=n.key==="Home"?!1:n.key==="End"?!0:!c;l(y),j(null),n.currentTarget.querySelectorAll('[role="tab"]')[y?1:0]?.focus()},children:[e.jsx("button",{type:"button",role:"tab",id:`${i}-registry-tab`,"aria-controls":`${i}-panel`,"aria-selected":!c,tabIndex:c?-1:0,disabled:a,onClick:()=>{l(!1),j(null)},children:"Registry"}),e.jsx("button",{type:"button",role:"tab",id:`${i}-custom-tab`,"aria-controls":`${i}-panel`,"aria-selected":c,tabIndex:c?0:-1,disabled:a,onClick:()=>{l(!0),j(null)},children:"Custom agent"})]}),e.jsxs("div",{className:"provider-dialog-body",role:"tabpanel",id:`${i}-panel`,"aria-labelledby":`${i}-${c?"custom":"registry"}-tab`,children:[e.jsx("p",{children:c?"Register an installed agent using its ACP executable and launch settings.":"Browse agents from the Agent Client Protocol registry."}),C?e.jsx("p",{role:"alert",children:C}):null,e.jsxs("form",{className:"provider-card-form",onSubmit:n=>{Z(n)},children:[c?e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Name"}),e.jsx("input",{required:!0,maxLength:160,value:v,disabled:a,onChange:n=>A(n.target.value),placeholder:"My ACP agent"})]}),e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"ACP executable"}),e.jsx("input",{required:!0,value:E,disabled:a,onChange:n=>R(n.target.value),placeholder:"Executable from PATH or absolute path"})]}),e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Arguments (JSON array)"}),e.jsx("textarea",{value:b,disabled:a,onChange:n=>N(n.target.value),placeholder:'["--acp"]'})]}),e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Environment overrides (JSON object)"}),e.jsx("textarea",{value:L,disabled:a,onChange:n=>U(n.target.value)})]}),e.jsx("small",{children:"Overrides are saved in your local configuration. Inherited environment variables do not need to be entered here."})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"acp-registry-search",children:[e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Search registry"}),e.jsx("input",{value:T,disabled:a,onChange:n=>m(n.target.value),placeholder:"Search agents"})]}),e.jsx("button",{type:"button",className:"settings-secondary",disabled:x||a,onClick:()=>P(n=>n+1),"aria-label":"Refresh ACP registry",children:e.jsx(le,{size:14})})]}),x?e.jsxs("p",{role:"status",children:[e.jsx(V,{size:16,className:"settings-spin"})," Loading registry…"]}):null,e.jsxs("div",{className:"acp-registry-content",children:[S?e.jsxs("div",{className:"acp-registry-list",role:"group","aria-label":"ACP registry agents",children:[G.map(n=>e.jsxs("button",{type:"button",className:"acp-registry-entry",disabled:a,"aria-pressed":p?.id===n.id,onClick:()=>{O(n),k(""),h(n.name)},children:[e.jsxs("strong",{children:[n.name," ",e.jsx("small",{children:n.version})]}),e.jsx("span",{children:n.description}),n.supported?null:e.jsxs("small",{children:["No distribution for ",S.platform,"; use a custom command."]})]},n.id)),G.length?null:e.jsx("p",{className:"acp-registry-empty",children:"No agents match your search."})]}):null,p?e.jsxs("div",{className:"acp-install-summary",children:[e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Connection name"}),e.jsx("input",{value:M,disabled:a,onChange:n=>h(n.target.value)})]}),J.length?e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Distribution"}),e.jsx("select",{value:F,disabled:a,onChange:n=>k(n.target.value),children:J.map(n=>e.jsx("option",{value:n,children:n==="binary"?`Binary for ${S?.platform}`:n},n))})]}):null,W?e.jsxs(e.Fragment,{children:[e.jsx("code",{children:F==="binary"?W.archive:`${F} ${W.package} ${(W.args??[]).join(" ")}`}),e.jsxs("p",{children:[F==="binary"?"Adding downloads and installs this version locally.":`Connecting runs ${F}, which downloads this package version if needed.`," The agent uses its own authentication and model catalog."]})]}):null,p.website||p.repository?e.jsx("a",{href:p.website??p.repository,target:"_blank",rel:"noreferrer",children:"Agent documentation"}):null]}):null,!p&&S?e.jsx("div",{className:"acp-registry-hint",children:"Select an agent to see its installation options."}):null]})]}),e.jsxs("div",{className:"acp-registration-actions",children:[e.jsx("button",{type:"button",className:"settings-secondary",disabled:a,onClick:X,children:"Cancel"}),e.jsx("button",{className:"settings-primary",disabled:a||!s||(c?!v.trim()||!E.trim():!p||!F),children:a?"Adding agent…":"Add and connect"})]})]})]})]}):null]})}function xe(s){const r=t.useRef(null),d=t.useRef(s);return d.current=s,t.useEffect(()=>{const i=document.activeElement instanceof HTMLElement?document.activeElement:null,o=()=>[...r.current?.querySelectorAll('button:not(:disabled), input:not(:disabled), select:not(:disabled), a[href], [tabindex="0"]')??[]].filter(c=>c.getClientRects().length>0);o()[0]?.focus();const g=c=>{if(document.querySelector(".native-setup-terminal")||(c.key==="Escape"&&(c.preventDefault(),c.stopPropagation(),d.current()),c.key!=="Tab"))return;const l=o(),S=l[0],D=l.at(-1);c.shiftKey&&document.activeElement===S?(c.preventDefault(),D?.focus()):!c.shiftKey&&document.activeElement===D&&(c.preventDefault(),S?.focus())};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g),i?.isConnected&&i.focus()}},[]),r}function Be({connection:s,onChanged:r}){const[d,i]=t.useState(!1),[o,g]=t.useState([]),[c,l]=t.useState(null),[S,D]=t.useState(null),[w,P]=t.useState(0);t.useEffect(()=>{const m=new AbortController;return g([]),l(null),s&&K(s,"/v1/url-models/list",{signal:m.signal}).then(p=>{m.signal.aborted||g(p.models)}).catch(()=>{m.signal.aborted||l("Could not load your model connections.")}),()=>m.abort()},[s,w]);async function T(m){if(!(!s||S)){D(m.id),l(null);try{const p=await K(s,"/v1/url-models/remove",{method:"POST",body:JSON.stringify({id:m.id})});g(p.models),await r()}catch(p){l(p instanceof Error?p.message:"Could not remove the connection.")}finally{D(null)}}}return e.jsxs("section",{"aria-label":"Models from URL",className:"url-model-connections",children:[e.jsxs("div",{className:"provider-connections-intro",children:[e.jsxs("div",{children:[e.jsx("h2",{children:"Models from URL"}),e.jsx("p",{children:"Connect a model endpoint and select it in your chats. "})]}),e.jsx("button",{type:"button",className:"settings-primary",disabled:!s,onClick:()=>i(!0),children:"Add model"})]}),c?e.jsxs("p",{role:"alert",children:[c," ",e.jsx("button",{type:"button",onClick:()=>P(m=>m+1),children:"Retry"})]}):null,e.jsx("div",{className:"provider-connections-grid",children:o.map(m=>e.jsxs("div",{className:"provider-connection-card",children:[e.jsx("strong",{children:m.name}),e.jsx("p",{className:"url-model-endpoint",children:m.endpoint}),e.jsxs("p",{children:[m.providerName," · ",m.model," · ",m.hasToken?"Key saved securely":"No API key"]}),e.jsx("button",{type:"button",className:"settings-secondary",disabled:!!S,onClick:()=>{T(m)},children:S===m.id?"Removing…":"Remove model"})]},m.id))}),d&&s?e.jsx(Je,{providerNames:[...new Set(o.map(m=>m.providerName))],connection:s,onClose:()=>i(!1),onSaved:async m=>{g(m.models),await r(),i(!1)}}):null]})}function Je({connection:s,providerNames:r,onClose:d,onSaved:i}){const o=xe(d),[g,c]=t.useState(r[0]?`provider:${r[0]}`:"__new__"),[l,S]=t.useState(""),D=g==="__new__"?l.trim():g.slice(9),[w,P]=t.useState(""),[T,m]=t.useState(""),[p,O]=t.useState(""),[$,k]=t.useState(""),[M,h]=t.useState(null),[v,A]=t.useState(!1),[E,R]=t.useState(null),b=t.useRef(null);t.useEffect(()=>()=>b.current?.abort(),[]);function N(){h(null),k(""),R(null)}async function L(x){if(b.current)return;const u=new AbortController;b.current=u,A(!0),R(null);try{if(x){const a=await K(s,"/v1/url-models/save",{method:"POST",signal:u.signal,body:JSON.stringify({endpoint:w.trim(),token:T,name:p.trim(),model:$,providerName:D})});u.signal.aborted||(m(""),await i(a))}else{const a=await K(s,"/v1/url-models/inspect",{method:"POST",signal:u.signal,body:JSON.stringify({endpoint:w.trim(),token:T})});u.signal.aborted||(h(a),k(a.models[0]??""),p.trim()||O(a.models[0]??""))}}catch(a){u.signal.aborted||R(a instanceof Error?a.message:"Connection failed.")}finally{b.current=null,u.signal.aborted||A(!1)}}function U(x){x.preventDefault(),L(!!M)}return e.jsx("div",{className:"git-dialog-backdrop provider-dialog-backdrop",role:"presentation",onMouseDown:x=>{x.target===x.currentTarget&&d()},children:e.jsxs("section",{ref:o,className:"git-dialog provider-details-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"url-model-title",tabIndex:-1,children:[e.jsxs("div",{className:"provider-dialog-header",children:[e.jsx("h2",{id:"url-model-title",children:"Add model"}),e.jsx("button",{type:"button",className:"git-dialog-close","aria-label":"Close Add model",onClick:d,children:e.jsx(ae,{size:18})})]}),e.jsxs("form",{className:"url-model-connection-form",onSubmit:U,children:[e.jsxs("div",{className:"url-model-field",children:[e.jsx("span",{children:"Provider"}),e.jsx(ne,{label:"Provider",value:g,disabled:v,floating:!0,options:[...r.map(x=>({value:`provider:${x}`,label:x})),{value:"__new__",label:"Create new provider",icon:"plus",separatorBefore:!!r.length}],onChange:c})]}),g==="__new__"?e.jsxs("label",{children:["Provider name",e.jsx("input",{required:!0,maxLength:100,placeholder:"My model provider",value:l,disabled:v,onChange:x=>S(x.target.value)})]}):null,e.jsxs("label",{children:["Endpoint URL",e.jsx("input",{type:"url",required:!0,placeholder:"https://api.example.com/v1",value:w,disabled:v,onChange:x=>{P(x.target.value),N()}})]}),e.jsxs("label",{children:["API key ",e.jsx("span",{className:"settings-footnote",children:"Optional for endpoints that do not require one"}),e.jsx("input",{type:"password",autoComplete:"new-password",spellCheck:!1,value:T,disabled:v,placeholder:"API key",onChange:x=>{m(x.target.value),N()}})]}),M?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"url-model-field",children:[e.jsx("span",{children:"Model"}),e.jsx(ne,{label:"Model",value:$,disabled:v,floating:!0,searchable:!0,options:M.models.map(x=>({value:x,label:x})),onChange:x=>{k(x),O(x)}})]}),e.jsxs("label",{children:["Display name",e.jsx("input",{required:!0,maxLength:100,value:p,disabled:v,onChange:x=>O(x.target.value)})]})]}):e.jsx("p",{className:"settings-footnote",children:"Use the model service’s API base URL. Keys are encrypted on this machine."}),E?e.jsx("p",{role:"alert",children:E}):null,e.jsxs("div",{className:"url-model-connection-actions",children:[e.jsx("button",{className:"settings-primary",type:"submit",disabled:v||!D||!!M&&(!$||!p.trim()),children:v?"Connecting…":M?"Add model":"Fetch models"}),e.jsx("button",{type:"button",className:"settings-secondary",onClick:d,children:"Cancel"})]})]})]})})}const se=["codex","claude-code","grok-build","opencode"];function ee(s){return Y(s)||["claude-code","grok-build","opencode"].includes(s)}const Fe={codex:{executable:"codex",install:"https://developers.openai.com/codex/cli"},"claude-code":{executable:"claude",install:"https://code.claude.com/docs/en/setup"},"grok-build":{executable:"grok",install:"https://docs.x.ai/build/cli"},opencode:{executable:"opencode",install:"https://opencode.ai/docs"}},Q=(s,r)=>JSON.stringify([s||"",r||""]);function he({connection:s,providerId:r,config:d,status:i,cachedModels:o,busy:g,onCheck:c}){const[l,S]=t.useState(null),[D,w]=t.useState(null),[P,T]=t.useState(null),[m,p]=t.useState(!1),[O,$]=t.useState(d.binaryPath??""),[k,M]=t.useState(d.sourceHome??""),h=t.useRef(null),v=t.useRef(null),A=t.useRef(c);A.current=c;const E=Y(r),R=Fe[r]??{executable:d.acp?.command??"",install:d.acp?.installUrl??""},[b,N]=t.useState(d.acp?.command??""),[L,U]=t.useState(JSON.stringify(d.acp?.args??[])),[x,u]=t.useState(JSON.stringify(d.acp?.env??{},null,2)),a=Q(d.binaryPath,d.sourceHome)+JSON.stringify(d.acp),f=Q(O.trim(),k.trim())!==Q(d.binaryPath,d.sourceHome)||E&&(b!==d.acp?.command||L!==JSON.stringify(d.acp?.args??[])||x!==JSON.stringify(d.acp?.env??{},null,2)),C=g||m||l!==null,j=t.useCallback(async n=>{h.current?.abort();const y=new AbortController;h.current=y;const z=setTimeout(()=>y.abort(new Error("Connection check timed out. Retry when the agent is available.")),45e3);p(!0),w(null);try{const B=await A.current(r,y.signal,n);h.current===y&&!y.signal.aborted&&T(B)}catch(B){h.current===y&&w(B instanceof Error?B.message:"Could not check the agent.")}finally{clearTimeout(z),h.current===y&&(h.current=null,p(!1))}},[r]);t.useEffect(()=>{if(N(d.acp?.command??""),U(JSON.stringify(d.acp?.args??[])),u(JSON.stringify(d.acp?.env??{},null,2)),$(d.binaryPath??""),M(d.sourceHome??""),v.current===a){v.current=null;return}S(null),T(null),j()},[j,a,d.binaryPath,d.sourceHome,s?.serverUrl,s?.token]),t.useEffect(()=>()=>{const n=h.current;h.current=null,n?.abort()},[]);async function J(n){if(n.preventDefault(),!(!f||C)){try{const y=E&&d.acp?{...d.acp,command:b.trim(),args:JSON.parse(L),env:JSON.parse(x)}:d.acp;v.current=Q(O.trim(),k.trim())+JSON.stringify(y),await j({binaryPath:O.trim()||null,sourceHome:k.trim()||null,...E?{acp:y}:{}})}catch(y){w(y instanceof Error?y.message:"Invalid command configuration.")}v.current=null}}async function G(){if(!s||P?.status!=="needs_login")return;const n=new AbortController,y=setTimeout(()=>n.abort(),1e4);h.current?.abort(),h.current=n,p(!0),w(null);try{const z=await K(s,`/v1/providers/${r}/native-setup`,{method:"POST",body:JSON.stringify({action:"login"}),signal:n.signal});h.current===n&&!n.signal.aborted&&S(z.command)}catch(z){h.current===n&&w(z instanceof Error?z.message:"Could not open native login.")}finally{clearTimeout(y),h.current===n&&(h.current=null,p(!1))}}async function F(n){if(!s||C||f)return;p(!0),w(null);const y=new AbortController;h.current=y;const z=setTimeout(()=>y.abort(new Error("Authentication timed out. Use the agent’s login and refresh.")),185e3);try{const B=await K(s,`/v1/providers/${r}/native-setup`,{method:"POST",body:JSON.stringify({action:"authenticate",authMethodId:n}),signal:y.signal});y.signal.aborted||(v.current=Q(B.settings.providers[r]?.binaryPath,B.settings.providers[r]?.sourceHome)+JSON.stringify(B.settings.providers[r]?.acp),T(B),await j(),v.current=null)}catch(B){y.signal.aborted||w(B instanceof Error?B.message:"Authentication failed.")}finally{clearTimeout(z),h.current===y&&(h.current=null,p(!1))}}const W=P?.settings.modelCaches[r]?.models??o,Z=[...new Set(W.map(n=>Oe(n.displayName||n.id)))],X=D??P?.error;return e.jsxs("div",{className:"provider-dialog-body native-agent-setup",children:[e.jsx("p",{children:E?`Uses the configured ${i.displayName} ACP command and its own login.`:`Uses your existing ${i.displayName} installation and login.`}),e.jsxs("div",{className:"native-connection-status",children:[e.jsx("div",{role:"status","aria-live":"polite",children:m?e.jsxs(e.Fragment,{children:[e.jsx(V,{size:16,className:"settings-spin"}),e.jsx("span",{children:"Checking connection…"})]}):P?.status==="ready"?e.jsxs(e.Fragment,{children:[e.jsx(be,{size:16}),e.jsx("span",{children:d.enabled?"Connected":"Connected, disabled for chat"})]}):e.jsxs(e.Fragment,{children:[e.jsx(fe,{size:16}),e.jsx("span",{children:P?.status==="missing"?"Installation not found":P?.status==="needs_login"?"Sign in required":"Connection needs attention"})]})}),e.jsxs("button",{type:"button",className:"settings-secondary",disabled:C||!s,onClick:()=>{j()},title:"Refresh connection","aria-label":"Refresh connection",children:[e.jsx(le,{size:14})," Refresh"]})]}),X?e.jsx("p",{role:"alert",children:X}):null,Z.length?e.jsxs("section",{className:"native-model-section","aria-label":"Available models",children:[e.jsxs("div",{className:"native-model-heading",children:[e.jsx("h3",{children:"Models"}),e.jsxs("small",{children:[Z.length," available"]})]}),e.jsx("div",{className:"native-model-list",tabIndex:0,"aria-label":"Models",role:"list",children:Z.map(n=>e.jsx("span",{role:"listitem",children:n},n))}),e.jsx("small",{children:"Choose a model when starting a chat."})]}):null,P?.version?e.jsx("small",{className:"native-agent-version",children:P.version}):null,!E&&P?.status==="needs_login"?e.jsx("button",{type:"button",className:"settings-secondary",disabled:C||f||!s,title:f?"Save changes before signing in to a different installation":void 0,onClick:()=>{G()},children:"Sign in"}):null,E&&P?.authMethods?.length?e.jsx("div",{className:"acp-auth-methods",children:P.authMethods.map(n=>n.type==="terminal"?e.jsxs("p",{children:["Use ",n.name," in the agent’s own terminal, then refresh this connection."]},n.id):e.jsx("button",{type:"button",className:"settings-secondary",disabled:C||f||!s,onClick:()=>{F(n.id)},title:n.description,children:n.name},n.id))}):null,P?.status==="missing"&&R.install?e.jsxs("p",{children:[e.jsxs("a",{href:R.install,target:"_blank",rel:"noreferrer",children:["Install ",i.displayName]}),", then refresh this connection."]}):null,(D||P?.status==="unavailable")&&!m?e.jsx("button",{type:"button",className:"settings-secondary",disabled:C||!s,onClick:()=>{j()},children:"Retry"}):null,l&&s?e.jsx(Me,{connection:s,command:l,onComplete:()=>{S(null),j()},onClose:()=>{S(null),j()}}):null,ee(r)?e.jsxs("details",{children:[e.jsx("summary",{children:"Advanced"}),e.jsxs("form",{className:"provider-card-form",onSubmit:n=>{J(n)},children:[E?e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"ACP command"}),e.jsx("input",{value:b,disabled:C,onChange:n=>N(n.target.value)})]}),e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Arguments (JSON array)"}),e.jsx("textarea",{value:L,disabled:C,onChange:n=>U(n.target.value)})]}),e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Environment overrides (JSON object)"}),e.jsx("textarea",{value:x,disabled:C,onChange:n=>u(n.target.value)})]})]}):null,e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Executable override"}),e.jsx("input",{value:O,placeholder:`${R.executable} from PATH, or an absolute path`,disabled:C,onChange:n=>$(n.currentTarget.value)})]}),e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:E?"Home directory":"Source home"}),e.jsx("input",{value:k,placeholder:"Use the agent's existing home",disabled:C,onChange:n=>M(n.currentTarget.value)})]}),f?e.jsx("button",{className:"settings-secondary",disabled:C||!s,children:"Save changes"}):null]})]}):null]})}const Ge=[{value:"local_secret",label:"Saved key",description:"Encrypted on this machine"},{value:"env",label:"Environment variable",description:"Read by the local server"}],He=120,qe=new Set(["openai","xai","zai"]),Ke=new Set(["chatgpt-subscription"]),Ve="https://api.z.ai/api/coding/paas/v4";function me(s){return s.split(/[\n,]/).map(r=>r.trim()).filter(Boolean)}function ve(s){return s?s.available?"Ready":s.credential.connected?"Configured":s.credential.lastError||s.lastError?"Needs attention":s.id==="codex"?"Needs Codex login":ee(s.id)?"Check connection":s.routing.localByok?"Needs key":s.enabled?"Enabled":"Off":"Unknown"}function je(s){return s?s.available?"ready":s.credential.connected?"configured":s.credential.lastError||s.lastError||s.id==="codex"?"warning":"muted":"unknown"}function pe(s){return s.credential.connected?s.credential.redacted?s.credential.redacted:s.credential.source==="native_agent_login"?"Native login":s.credential.source==="chatgpt_subscription"?"ChatGPT subscription":s.credential.source:s.credential.lastError??"Not connected"}function We(s){return s?.trim().replace(/\/+$/,"")??""}function ye(s,r){return s.id==="zai"&&We(r.providers.zai?.baseUrl)===Ve}function Ze(s,r){return!s.credential.connected||!s.routing.localByok?"":s.credential.source==="native_agent_login"?"Native login":s.credential.source==="chatgpt_subscription"?"Subscription":ye(s,r)?"Coding Plan key":"API key"}function Xe(s,r){const d=r.modelCaches[s.id];if(s.routing.localByok&&s.enabled&&!s.credential.connected||!s.enabled&&s.id!=="openpond")return"";const i=Math.max(d?.models.length??0,s.modelIds.length),o=s.defaultModel?De(s.defaultModel,r,s.id):"",g=i===1?"1 model":`${i} models`;return[Ze(s,r),d?g:"",o].filter(Boolean).join(" · ")}function Ye(s){return s!=="openpond"&&te(s)}function Ne(s){return s?qe.has(s.id)||s.credentialModes.some(r=>Ke.has(r)):!1}function Ie(s){return Ne(s)?["api","subscription"]:["api"]}function ge(s,r){return!s||!r||!Ne(s)?"api":s.credential.source==="chatgpt_subscription"||ye(s,r)?"subscription":"api"}function Qe(s){if(!s)return"Never";const r=new Date(s);return Number.isNaN(r.getTime())?s:r.toLocaleString()}function es(s,r,d=He){const i=[],o=new Set,g=new Set(r.map(l=>l.trim()).filter(Boolean)),c=l=>{o.has(l.value)||i.length>=d||(o.add(l.value),i.push(l))};for(const l of s)g.has(l.value)&&c(l);for(const l of s)c(l);return i}function os({onProvidersChanged:s,checkNativeProvider:r,connection:d,account:i,codex:o,providers:g,providerBusy:c,validationMessage:l,deleteProviderCredential:S,loadProviderModels:D,refreshProviderModels:w,saveProviderConfig:P,saveProviderCredential:T,startOpenAiSubscriptionAuth:m,validateProvider:p}){const[O,$]=t.useState(null),[k,M]=t.useState(null),[h,v]=t.useState(null),A=[...se,...Object.keys(g?.statuses??{}).filter(Y)].filter(b=>g?.statuses[b]),E=h?g?.statuses[h]??null:null;function R(b,N){v(b),N&&D(b)}return e.jsxs("section",{className:"account-settings provider-connections-settings",children:[e.jsxs("div",{className:"provider-connections-heading",children:[e.jsx("h1",{children:"Providers"}),e.jsx(ze,{connection:d,onChanged:s,onAdded:b=>v(b)})]}),e.jsxs("div",{className:"provider-connections-intro",children:[e.jsx("p",{children:"Manage your installed agents and login. Sync their conversations from Connections."}),e.jsx("button",{type:"button",className:"settings-secondary",onClick:()=>{Re({kind:"view",view:"apps"})},children:"Connections & apps"})]}),g?e.jsx("div",{className:"provider-connections-panel",children:A.length>0?e.jsx("div",{className:"provider-connections-grid",role:"list",children:A.map(b=>{const N=g.statuses[b],L=g.modelCaches[b],U=N.modelIds.length>0&&(L?.models.length??0)<N.modelIds.length,x=c?.startsWith(`${b}:`)??!1,u=Ye(b),a=b==="openpond"||!!g.providers[b]?.enabled;return e.jsxs("div",{className:"provider-connection-card",role:"listitem",children:[e.jsxs("div",{className:"provider-connection-identity",children:[e.jsx("strong",{children:N.displayName}),e.jsxs("label",{className:"provider-toggle","aria-label":`Enable ${N.displayName}`,children:[e.jsx("input",{type:"checkbox",checked:a,disabled:!u||x,onChange:f=>{P(b,{enabled:f.currentTarget.checked})}}),e.jsx("span",{})]})]}),e.jsxs("div",{className:`provider-connection-status ${je(N)}`,children:[x?e.jsx(V,{size:13,className:"settings-spin"}):null,e.jsx("span",{children:ve(N)})]}),e.jsx("p",{children:Xe(N,g)||(N.enabled?"Check your installation and sign in to use this agent.":"Enable this agent to use it in chats.")}),b==="codex"||b==="claude-code"?e.jsx($e,{connection:d,provider:b}):null,e.jsx("button",{type:"button",className:"settings-secondary",onClick:()=>{R(b,U)},children:"Manage"}),Y(b)?e.jsx("button",{type:"button",className:"settings-secondary",disabled:O!==null||!d,onClick:async()=>{if(d){$(b),M(null);try{const f=await K(d,"/v1/providers/acp-registry",{method:"DELETE",body:JSON.stringify({providerId:b})});s(f.settings),h===b&&v(null)}catch(f){M(f instanceof Error?f.message:"Could not remove ACP agent.")}finally{$(null)}}},children:O===b?"Removing…":"Remove connection"}):null]},b)})}):e.jsx("div",{className:"empty-account-list provider-manager-empty",children:e.jsx("strong",{children:"No agent providers available"})})}):null,k?e.jsx("p",{role:"alert",children:k}):null,e.jsx(Be,{connection:d,onChanged:async()=>{d&&s(await q.providerSettings(d))}}),l?e.jsxs("div",{className:"settings-footnote provider-validation-message",children:[e.jsx("span",{children:"Last validation"}),e.jsx("strong",{children:l})]}):null,h&&E&&g?e.jsx(ss,{checkNativeProvider:r,connection:d,account:i,codex:o,providerId:h,providerBusy:c,settings:g,status:E,onClose:()=>v(null),onDeleteCredential:S,onRefreshModels:w,onSaveConfig:P,onSaveCredential:T,onStartOpenAiSubscriptionAuth:m,onValidate:p}):null]})}function ss({checkNativeProvider:s,connection:r,account:d,codex:i,providerId:o,providerBusy:g,settings:c,status:l,onClose:S,onDeleteCredential:D,onRefreshModels:w,onSaveConfig:P,onSaveCredential:T,onStartOpenAiSubscriptionAuth:m,onValidate:p,conversationPanel:O}){const $=xe(S),[k,M]=t.useState("setup"),h=t.useId(),v=c.providers[o],A=c.modelCaches[o],E=t.useId(),R=t.useRef(o),b=Math.max(A?.models.length??0,l.modelIds.length),N=l.routing.localByok&&te(o)&&o!=="codex"&&!ee(o),L=t.useMemo(()=>N?Ie(l):[],[N,l]),U=L.includes("subscription"),[x,u]=t.useState(()=>ge(l,c)),a=N&&x==="subscription"&&U,f=j=>`${E}-${j}-panel`,C=o==="codex"?"Codex app server":v?.baseUrl??(o==="openpond"?d?.chatApiBaseUrl:null)??"Not set";return t.useEffect(()=>{if(R.current!==o){R.current=o,u(ge(l,c));return}N&&!L.includes(x)&&u("api")},[x,L,N,o,c,l]),e.jsx("div",{className:"git-dialog-backdrop provider-dialog-backdrop",role:"presentation",onMouseDown:S,children:e.jsxs("section",{ref:$,className:`git-dialog provider-details-dialog${O?" agent-setup-dialog":""}`,role:"dialog","aria-modal":"true","aria-label":`${l.displayName} provider details`,onMouseDown:j=>j.stopPropagation(),children:[e.jsx("button",{className:"git-dialog-close",type:"button",title:"Close","aria-label":"Close",onClick:S,children:e.jsx(ae,{size:16})}),e.jsxs("div",{className:"provider-dialog-header",children:[e.jsxs("div",{children:[e.jsx("h2",{children:l.displayName}),e.jsx("span",{children:se.includes(o)||Y(o)?"Installation and login":"API and subscription settings"})]}),e.jsx("div",{className:`provider-state-pill ${je(l)}`,children:ve(l)})]}),(se.includes(o)||Y(o))&&v?e.jsxs("label",{className:"provider-chat-toggle",children:[e.jsxs("span",{className:"provider-toggle",children:[e.jsx("input",{type:"checkbox","aria-label":`Enable ${l.displayName} for chat`,checked:v.enabled,disabled:g!==null,onChange:j=>{P(o,{enabled:j.target.checked})}}),e.jsx("span",{"aria-hidden":"true"})]}),e.jsxs("span",{children:["Use ",l.displayName," for chats"]})]}):null,O?e.jsxs("div",{className:"surface-tabs provider-agent-tabs",role:"tablist","aria-label":"Agent settings",onKeyDown:j=>{if(j.key!=="ArrowLeft"&&j.key!=="ArrowRight")return;j.preventDefault();const J=k==="setup"?"sync":"setup";M(J),j.currentTarget.querySelector(`#${CSS.escape(`${h}-${J}`)}`)?.focus()},children:[e.jsx("button",{type:"button",role:"tab",id:`${h}-setup`,"aria-controls":`${h}-setup-panel`,"aria-selected":k==="setup",tabIndex:k==="setup"?0:-1,onClick:()=>M("setup"),children:"Agent setup"}),e.jsx("button",{type:"button",role:"tab",id:`${h}-sync`,"aria-controls":`${h}-sync-panel`,"aria-selected":k==="sync",tabIndex:k==="sync"?0:-1,onClick:()=>M("sync"),children:"Conversation sync"})]}):null,e.jsxs("div",{hidden:k!=="setup",id:`${h}-setup-panel`,role:O?"tabpanel":void 0,"aria-labelledby":O?`${h}-setup`:void 0,children:[N?e.jsx("div",{className:"surface-tabs provider-mode-tabs",role:"tablist","aria-label":`${l.displayName} mode`,children:L.map(j=>e.jsx("button",{type:"button",role:"tab",id:`${E}-${j}`,className:x===j?"active":void 0,"aria-selected":x===j,"aria-controls":f(j),onClick:()=>u(j),children:j==="api"?"API":"Subscription"},j))}):null,se.includes(o)||Y(o)?null:e.jsxs("dl",{className:"provider-dialog-stats",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Credential"}),e.jsx("dd",{title:pe(l),children:pe(l)})]}),a?null:e.jsxs(e.Fragment,{children:[ee(o)?null:e.jsxs("div",{children:[e.jsx("dt",{children:"Base URL"}),e.jsx("dd",{title:C,children:C})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Model"}),e.jsx("dd",{title:v?.defaultModel??l.defaultModel??void 0,children:v?.defaultModel??l.defaultModel??"Not set"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Models"}),e.jsxs("dd",{title:A?.lastError??void 0,children:[b," cached, ",Qe(A?.fetchedAt)]})]})]}),o==="codex"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Account"}),e.jsx("dd",{title:i?.account?.email??void 0,children:i?.account?.label??i?.account?.email??"Not signed in"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Binary"}),e.jsx("dd",{title:i?.binaryPath??void 0,children:i?.binaryPath??"Not found"})]})]}):null,l.credential.lastError||A?.lastError||l.lastError?e.jsxs("div",{className:"provider-dialog-error",children:[e.jsx("dt",{children:"Error"}),e.jsx("dd",{title:l.credential.lastError??A?.lastError??l.lastError??void 0,children:l.credential.lastError??A?.lastError??l.lastError})]}):null]}),o==="codex"?e.jsxs(e.Fragment,{children:[v?e.jsx(he,{connection:r,providerId:o,config:v,status:l,cachedModels:A?.models??[],busy:g!==null,onCheck:s},o):null,e.jsxs("div",{className:"provider-dialog-body",children:[e.jsx("h3",{children:"ChatGPT with the OpenPond harness"}),e.jsx("p",{children:"Native Codex and the OpenPond harness keep their own connections. Choose the execution path in the model picker."}),e.jsx("p",{children:c.statuses.openai?.credential.connected?"OpenPond harness connected":"OpenPond harness not connected"}),e.jsx("button",{type:"button",className:"settings-secondary",disabled:g!==null,onClick:()=>{m("browser")},children:"Connect ChatGPT for OpenPond"}),e.jsxs("button",{type:"button",className:"settings-secondary",disabled:g!==null,onClick:()=>{P("openai",{enabled:!c.providers.openai?.enabled})},children:[c.providers.openai?.enabled?"Disable":"Enable"," OpenPond harness route"]})]})]}):ee(o)&&v?e.jsx(he,{connection:r,providerId:o,config:v,status:l,cachedModels:A?.models??[],busy:g!==null,onCheck:s},o):N&&v&&A?e.jsx(ns,{credentialTab:x,credentialTabsId:E,hasSubscriptionTab:U,providerId:o,providerBusy:g,settings:c,status:l,onDeleteCredential:D,onRefreshModels:w,onSaveConfig:P,onSaveCredential:T,onStartOpenAiSubscriptionAuth:m,onValidate:p}):l.routing.localByok&&!te(o)?e.jsxs("div",{className:"provider-dialog-note",children:[e.jsx(fe,{size:15}),e.jsx("span",{children:"Adapter pending"})]}):null]}),k==="sync"?e.jsx("div",{role:"tabpanel",id:`${h}-sync-panel`,"aria-labelledby":`${h}-sync`,children:O}):null]})})}function ns({credentialTab:s,credentialTabsId:r,hasSubscriptionTab:d,providerId:i,providerBusy:o,settings:g,status:c,onDeleteCredential:l,onRefreshModels:S,onSaveConfig:D,onSaveCredential:w,onStartOpenAiSubscriptionAuth:P,onValidate:T}){const m=g.providers[i],p=t.useMemo(()=>Te(i,g),[i,g]),O=`provider-models-${i}`,$=t.useRef(i),[k,M]=t.useState(m.baseUrl??""),[h,v]=t.useState(m.defaultModel??""),[A,E]=t.useState(m.modelOverrides.join(`
|
|
1
|
+
import{r as t,j as e}from"./index-Di1MU6Xr.js";import{e as Ae,g as K,v as Ee,X as ae,aB as le,bA as V,T as ne,r as Y,E as Oe,az as be,aG as fe,cq as Me,bH as Re,cu as $e,W as q,cv as te,bD as De,q as Te,ad as ce}from"./App-nzE7JU_O.js";import{A as _e}from"./AppDialog-VtNvqbDm.js";import{S as Le}from"./save-DJYUOhtD.js";import{T as ue}from"./MarkdownText-Drjq6-JM.js";const Ue=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],I=Ae("key-round",Ue);function ze({connection:s,onChanged:r,onAdded:d}){const i=t.useId(),[o,g]=t.useState(!1),[c,l]=t.useState(!1),[S,D]=t.useState(null),[w,P]=t.useState(0),[T,m]=t.useState(""),[p,O]=t.useState(null),[$,k]=t.useState(""),[M,h]=t.useState(""),[v,A]=t.useState(""),[E,R]=t.useState(""),[b,N]=t.useState("[]"),[L,U]=t.useState("{}"),[x,u]=t.useState(!1),[a,f]=t.useState(!1),[C,j]=t.useState(null);t.useEffect(()=>{if(!o||c||!s)return;const n=new AbortController;return u(!0),j(null),K(s,`/v1/providers/acp-registry${w?"?refresh=true":""}`,{signal:n.signal}).then(y=>{n.signal.aborted||(D(y),O(null))}).catch(y=>{n.signal.aborted||j(y instanceof Error?y.message:"Could not load ACP registry.")}).finally(()=>{n.signal.aborted||u(!1)}),()=>n.abort()},[o,c,s,w]);const J=p?[p.distribution.binary?.[S?.platform??""]?"binary":null,p.distribution.npx?"npx":null,p.distribution.uvx?"uvx":null].filter(n=>!!n):[],G=S?.agents.filter(n=>`${n.name} ${n.id} ${n.description}`.toLowerCase().includes(T.trim().toLowerCase()))??[],F=J.includes($)?$:J[0],W=F==="binary"?p?.distribution.binary?.[S?.platform??""]:F==="npx"?p?.distribution.npx:p?.distribution.uvx;async function Z(n){if(n.preventDefault(),!(!s||a)){f(!0),j(null);try{const y=c?{custom:{displayName:v.trim(),command:E.trim(),args:JSON.parse(b),env:JSON.parse(L)}}:{registryId:p?.id,version:p?.version,distribution:F,displayName:M.trim()||p?.name},z=await K(s,"/v1/providers/acp-registry",{method:"POST",body:JSON.stringify(y)});r(z.settings),d(z.providerId),g(!1),O(null),h(""),A(""),R(""),N("[]"),U("{}")}catch(y){j(y instanceof Error?y.message:"Could not add ACP agent.")}finally{f(!1)}}}function X(){a||g(!1)}return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"settings-secondary acp-add-button",disabled:!s||a,onClick:()=>g(!0),children:[e.jsx(Ee,{size:16,"aria-hidden":"true"})," ACP Agent"]}),o?e.jsxs(_e,{ariaLabel:"Add ACP agent",backdropClassName:"git-dialog-backdrop provider-dialog-backdrop",className:"git-dialog provider-details-dialog acp-agent-dialog",dismissDisabled:a,onClose:X,children:[e.jsx("button",{type:"button",className:"git-dialog-close","aria-label":"Close",disabled:a,onClick:X,children:e.jsx(ae,{size:18})}),e.jsx("div",{className:"provider-dialog-header",children:e.jsxs("div",{children:[e.jsx("h2",{children:"Add ACP agent"}),e.jsx("span",{children:"Choose from the registry or register your own agent."})]})}),e.jsxs("div",{className:"surface-tabs",role:"tablist","aria-label":"Agent registration",onKeyDown:n=>{if(a||!["ArrowLeft","ArrowRight","Home","End"].includes(n.key))return;n.preventDefault();const y=n.key==="Home"?!1:n.key==="End"?!0:!c;l(y),j(null),n.currentTarget.querySelectorAll('[role="tab"]')[y?1:0]?.focus()},children:[e.jsx("button",{type:"button",role:"tab",id:`${i}-registry-tab`,"aria-controls":`${i}-panel`,"aria-selected":!c,tabIndex:c?-1:0,disabled:a,onClick:()=>{l(!1),j(null)},children:"Registry"}),e.jsx("button",{type:"button",role:"tab",id:`${i}-custom-tab`,"aria-controls":`${i}-panel`,"aria-selected":c,tabIndex:c?0:-1,disabled:a,onClick:()=>{l(!0),j(null)},children:"Custom agent"})]}),e.jsxs("div",{className:"provider-dialog-body",role:"tabpanel",id:`${i}-panel`,"aria-labelledby":`${i}-${c?"custom":"registry"}-tab`,children:[e.jsx("p",{children:c?"Register an installed agent using its ACP executable and launch settings.":"Browse agents from the Agent Client Protocol registry."}),C?e.jsx("p",{role:"alert",children:C}):null,e.jsxs("form",{className:"provider-card-form",onSubmit:n=>{Z(n)},children:[c?e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Name"}),e.jsx("input",{required:!0,maxLength:160,value:v,disabled:a,onChange:n=>A(n.target.value),placeholder:"My ACP agent"})]}),e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"ACP executable"}),e.jsx("input",{required:!0,value:E,disabled:a,onChange:n=>R(n.target.value),placeholder:"Executable from PATH or absolute path"})]}),e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Arguments (JSON array)"}),e.jsx("textarea",{value:b,disabled:a,onChange:n=>N(n.target.value),placeholder:'["--acp"]'})]}),e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Environment overrides (JSON object)"}),e.jsx("textarea",{value:L,disabled:a,onChange:n=>U(n.target.value)})]}),e.jsx("small",{children:"Overrides are saved in your local configuration. Inherited environment variables do not need to be entered here."})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"acp-registry-search",children:[e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Search registry"}),e.jsx("input",{value:T,disabled:a,onChange:n=>m(n.target.value),placeholder:"Search agents"})]}),e.jsx("button",{type:"button",className:"settings-secondary",disabled:x||a,onClick:()=>P(n=>n+1),"aria-label":"Refresh ACP registry",children:e.jsx(le,{size:14})})]}),x?e.jsxs("p",{role:"status",children:[e.jsx(V,{size:16,className:"settings-spin"})," Loading registry…"]}):null,e.jsxs("div",{className:"acp-registry-content",children:[S?e.jsxs("div",{className:"acp-registry-list",role:"group","aria-label":"ACP registry agents",children:[G.map(n=>e.jsxs("button",{type:"button",className:"acp-registry-entry",disabled:a,"aria-pressed":p?.id===n.id,onClick:()=>{O(n),k(""),h(n.name)},children:[e.jsxs("strong",{children:[n.name," ",e.jsx("small",{children:n.version})]}),e.jsx("span",{children:n.description}),n.supported?null:e.jsxs("small",{children:["No distribution for ",S.platform,"; use a custom command."]})]},n.id)),G.length?null:e.jsx("p",{className:"acp-registry-empty",children:"No agents match your search."})]}):null,p?e.jsxs("div",{className:"acp-install-summary",children:[e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Connection name"}),e.jsx("input",{value:M,disabled:a,onChange:n=>h(n.target.value)})]}),J.length?e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Distribution"}),e.jsx("select",{value:F,disabled:a,onChange:n=>k(n.target.value),children:J.map(n=>e.jsx("option",{value:n,children:n==="binary"?`Binary for ${S?.platform}`:n},n))})]}):null,W?e.jsxs(e.Fragment,{children:[e.jsx("code",{children:F==="binary"?W.archive:`${F} ${W.package} ${(W.args??[]).join(" ")}`}),e.jsxs("p",{children:[F==="binary"?"Adding downloads and installs this version locally.":`Connecting runs ${F}, which downloads this package version if needed.`," The agent uses its own authentication and model catalog."]})]}):null,p.website||p.repository?e.jsx("a",{href:p.website??p.repository,target:"_blank",rel:"noreferrer",children:"Agent documentation"}):null]}):null,!p&&S?e.jsx("div",{className:"acp-registry-hint",children:"Select an agent to see its installation options."}):null]})]}),e.jsxs("div",{className:"acp-registration-actions",children:[e.jsx("button",{type:"button",className:"settings-secondary",disabled:a,onClick:X,children:"Cancel"}),e.jsx("button",{className:"settings-primary",disabled:a||!s||(c?!v.trim()||!E.trim():!p||!F),children:a?"Adding agent…":"Add and connect"})]})]})]})]}):null]})}function xe(s){const r=t.useRef(null),d=t.useRef(s);return d.current=s,t.useEffect(()=>{const i=document.activeElement instanceof HTMLElement?document.activeElement:null,o=()=>[...r.current?.querySelectorAll('button:not(:disabled), input:not(:disabled), select:not(:disabled), a[href], [tabindex="0"]')??[]].filter(c=>c.getClientRects().length>0);o()[0]?.focus();const g=c=>{if(document.querySelector(".native-setup-terminal")||(c.key==="Escape"&&(c.preventDefault(),c.stopPropagation(),d.current()),c.key!=="Tab"))return;const l=o(),S=l[0],D=l.at(-1);c.shiftKey&&document.activeElement===S?(c.preventDefault(),D?.focus()):!c.shiftKey&&document.activeElement===D&&(c.preventDefault(),S?.focus())};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g),i?.isConnected&&i.focus()}},[]),r}function Be({connection:s,onChanged:r}){const[d,i]=t.useState(!1),[o,g]=t.useState([]),[c,l]=t.useState(null),[S,D]=t.useState(null),[w,P]=t.useState(0);t.useEffect(()=>{const m=new AbortController;return g([]),l(null),s&&K(s,"/v1/url-models/list",{signal:m.signal}).then(p=>{m.signal.aborted||g(p.models)}).catch(()=>{m.signal.aborted||l("Could not load your model connections.")}),()=>m.abort()},[s,w]);async function T(m){if(!(!s||S)){D(m.id),l(null);try{const p=await K(s,"/v1/url-models/remove",{method:"POST",body:JSON.stringify({id:m.id})});g(p.models),await r()}catch(p){l(p instanceof Error?p.message:"Could not remove the connection.")}finally{D(null)}}}return e.jsxs("section",{"aria-label":"Models from URL",className:"url-model-connections",children:[e.jsxs("div",{className:"provider-connections-intro",children:[e.jsxs("div",{children:[e.jsx("h2",{children:"Models from URL"}),e.jsx("p",{children:"Connect a model endpoint and select it in your chats. "})]}),e.jsx("button",{type:"button",className:"settings-primary",disabled:!s,onClick:()=>i(!0),children:"Add model"})]}),c?e.jsxs("p",{role:"alert",children:[c," ",e.jsx("button",{type:"button",onClick:()=>P(m=>m+1),children:"Retry"})]}):null,e.jsx("div",{className:"provider-connections-grid",children:o.map(m=>e.jsxs("div",{className:"provider-connection-card",children:[e.jsx("strong",{children:m.name}),e.jsx("p",{className:"url-model-endpoint",children:m.endpoint}),e.jsxs("p",{children:[m.providerName," · ",m.model," · ",m.hasToken?"Key saved securely":"No API key"]}),e.jsx("button",{type:"button",className:"settings-secondary",disabled:!!S,onClick:()=>{T(m)},children:S===m.id?"Removing…":"Remove model"})]},m.id))}),d&&s?e.jsx(Je,{providerNames:[...new Set(o.map(m=>m.providerName))],connection:s,onClose:()=>i(!1),onSaved:async m=>{g(m.models),await r(),i(!1)}}):null]})}function Je({connection:s,providerNames:r,onClose:d,onSaved:i}){const o=xe(d),[g,c]=t.useState(r[0]?`provider:${r[0]}`:"__new__"),[l,S]=t.useState(""),D=g==="__new__"?l.trim():g.slice(9),[w,P]=t.useState(""),[T,m]=t.useState(""),[p,O]=t.useState(""),[$,k]=t.useState(""),[M,h]=t.useState(null),[v,A]=t.useState(!1),[E,R]=t.useState(null),b=t.useRef(null);t.useEffect(()=>()=>b.current?.abort(),[]);function N(){h(null),k(""),R(null)}async function L(x){if(b.current)return;const u=new AbortController;b.current=u,A(!0),R(null);try{if(x){const a=await K(s,"/v1/url-models/save",{method:"POST",signal:u.signal,body:JSON.stringify({endpoint:w.trim(),token:T,name:p.trim(),model:$,providerName:D})});u.signal.aborted||(m(""),await i(a))}else{const a=await K(s,"/v1/url-models/inspect",{method:"POST",signal:u.signal,body:JSON.stringify({endpoint:w.trim(),token:T})});u.signal.aborted||(h(a),k(a.models[0]??""),p.trim()||O(a.models[0]??""))}}catch(a){u.signal.aborted||R(a instanceof Error?a.message:"Connection failed.")}finally{b.current=null,u.signal.aborted||A(!1)}}function U(x){x.preventDefault(),L(!!M)}return e.jsx("div",{className:"git-dialog-backdrop provider-dialog-backdrop",role:"presentation",onMouseDown:x=>{x.target===x.currentTarget&&d()},children:e.jsxs("section",{ref:o,className:"git-dialog provider-details-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"url-model-title",tabIndex:-1,children:[e.jsxs("div",{className:"provider-dialog-header",children:[e.jsx("h2",{id:"url-model-title",children:"Add model"}),e.jsx("button",{type:"button",className:"git-dialog-close","aria-label":"Close Add model",onClick:d,children:e.jsx(ae,{size:18})})]}),e.jsxs("form",{className:"url-model-connection-form",onSubmit:U,children:[e.jsxs("div",{className:"url-model-field",children:[e.jsx("span",{children:"Provider"}),e.jsx(ne,{label:"Provider",value:g,disabled:v,floating:!0,options:[...r.map(x=>({value:`provider:${x}`,label:x})),{value:"__new__",label:"Create new provider",icon:"plus",separatorBefore:!!r.length}],onChange:c})]}),g==="__new__"?e.jsxs("label",{children:["Provider name",e.jsx("input",{required:!0,maxLength:100,placeholder:"My model provider",value:l,disabled:v,onChange:x=>S(x.target.value)})]}):null,e.jsxs("label",{children:["Endpoint URL",e.jsx("input",{type:"url",required:!0,placeholder:"https://api.example.com/v1",value:w,disabled:v,onChange:x=>{P(x.target.value),N()}})]}),e.jsxs("label",{children:["API key ",e.jsx("span",{className:"settings-footnote",children:"Optional for endpoints that do not require one"}),e.jsx("input",{type:"password",autoComplete:"new-password",spellCheck:!1,value:T,disabled:v,placeholder:"API key",onChange:x=>{m(x.target.value),N()}})]}),M?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"url-model-field",children:[e.jsx("span",{children:"Model"}),e.jsx(ne,{label:"Model",value:$,disabled:v,floating:!0,searchable:!0,options:M.models.map(x=>({value:x,label:x})),onChange:x=>{k(x),O(x)}})]}),e.jsxs("label",{children:["Display name",e.jsx("input",{required:!0,maxLength:100,value:p,disabled:v,onChange:x=>O(x.target.value)})]})]}):e.jsx("p",{className:"settings-footnote",children:"Use the model service’s API base URL. Keys are encrypted on this machine."}),E?e.jsx("p",{role:"alert",children:E}):null,e.jsxs("div",{className:"url-model-connection-actions",children:[e.jsx("button",{className:"settings-primary",type:"submit",disabled:v||!D||!!M&&(!$||!p.trim()),children:v?"Connecting…":M?"Add model":"Fetch models"}),e.jsx("button",{type:"button",className:"settings-secondary",onClick:d,children:"Cancel"})]})]})]})})}const se=["codex","claude-code","grok-build","opencode"];function ee(s){return Y(s)||["claude-code","grok-build","opencode"].includes(s)}const Fe={codex:{executable:"codex",install:"https://developers.openai.com/codex/cli"},"claude-code":{executable:"claude",install:"https://code.claude.com/docs/en/setup"},"grok-build":{executable:"grok",install:"https://docs.x.ai/build/cli"},opencode:{executable:"opencode",install:"https://opencode.ai/docs"}},Q=(s,r)=>JSON.stringify([s||"",r||""]);function he({connection:s,providerId:r,config:d,status:i,cachedModels:o,busy:g,onCheck:c}){const[l,S]=t.useState(null),[D,w]=t.useState(null),[P,T]=t.useState(null),[m,p]=t.useState(!1),[O,$]=t.useState(d.binaryPath??""),[k,M]=t.useState(d.sourceHome??""),h=t.useRef(null),v=t.useRef(null),A=t.useRef(c);A.current=c;const E=Y(r),R=Fe[r]??{executable:d.acp?.command??"",install:d.acp?.installUrl??""},[b,N]=t.useState(d.acp?.command??""),[L,U]=t.useState(JSON.stringify(d.acp?.args??[])),[x,u]=t.useState(JSON.stringify(d.acp?.env??{},null,2)),a=Q(d.binaryPath,d.sourceHome)+JSON.stringify(d.acp),f=Q(O.trim(),k.trim())!==Q(d.binaryPath,d.sourceHome)||E&&(b!==d.acp?.command||L!==JSON.stringify(d.acp?.args??[])||x!==JSON.stringify(d.acp?.env??{},null,2)),C=g||m||l!==null,j=t.useCallback(async n=>{h.current?.abort();const y=new AbortController;h.current=y;const z=setTimeout(()=>y.abort(new Error("Connection check timed out. Retry when the agent is available.")),45e3);p(!0),w(null);try{const B=await A.current(r,y.signal,n);h.current===y&&!y.signal.aborted&&T(B)}catch(B){h.current===y&&w(B instanceof Error?B.message:"Could not check the agent.")}finally{clearTimeout(z),h.current===y&&(h.current=null,p(!1))}},[r]);t.useEffect(()=>{if(N(d.acp?.command??""),U(JSON.stringify(d.acp?.args??[])),u(JSON.stringify(d.acp?.env??{},null,2)),$(d.binaryPath??""),M(d.sourceHome??""),v.current===a){v.current=null;return}S(null),T(null),j()},[j,a,d.binaryPath,d.sourceHome,s?.serverUrl,s?.token]),t.useEffect(()=>()=>{const n=h.current;h.current=null,n?.abort()},[]);async function J(n){if(n.preventDefault(),!(!f||C)){try{const y=E&&d.acp?{...d.acp,command:b.trim(),args:JSON.parse(L),env:JSON.parse(x)}:d.acp;v.current=Q(O.trim(),k.trim())+JSON.stringify(y),await j({binaryPath:O.trim()||null,sourceHome:k.trim()||null,...E?{acp:y}:{}})}catch(y){w(y instanceof Error?y.message:"Invalid command configuration.")}v.current=null}}async function G(){if(!s||P?.status!=="needs_login")return;const n=new AbortController,y=setTimeout(()=>n.abort(),1e4);h.current?.abort(),h.current=n,p(!0),w(null);try{const z=await K(s,`/v1/providers/${r}/native-setup`,{method:"POST",body:JSON.stringify({action:"login"}),signal:n.signal});h.current===n&&!n.signal.aborted&&S(z.command)}catch(z){h.current===n&&w(z instanceof Error?z.message:"Could not open native login.")}finally{clearTimeout(y),h.current===n&&(h.current=null,p(!1))}}async function F(n){if(!s||C||f)return;p(!0),w(null);const y=new AbortController;h.current=y;const z=setTimeout(()=>y.abort(new Error("Authentication timed out. Use the agent’s login and refresh.")),185e3);try{const B=await K(s,`/v1/providers/${r}/native-setup`,{method:"POST",body:JSON.stringify({action:"authenticate",authMethodId:n}),signal:y.signal});y.signal.aborted||(v.current=Q(B.settings.providers[r]?.binaryPath,B.settings.providers[r]?.sourceHome)+JSON.stringify(B.settings.providers[r]?.acp),T(B),await j(),v.current=null)}catch(B){y.signal.aborted||w(B instanceof Error?B.message:"Authentication failed.")}finally{clearTimeout(z),h.current===y&&(h.current=null,p(!1))}}const W=P?.settings.modelCaches[r]?.models??o,Z=[...new Set(W.map(n=>Oe(n.displayName||n.id)))],X=D??P?.error;return e.jsxs("div",{className:"provider-dialog-body native-agent-setup",children:[e.jsx("p",{children:E?`Uses the configured ${i.displayName} ACP command and its own login.`:`Uses your existing ${i.displayName} installation and login.`}),e.jsxs("div",{className:"native-connection-status",children:[e.jsx("div",{role:"status","aria-live":"polite",children:m?e.jsxs(e.Fragment,{children:[e.jsx(V,{size:16,className:"settings-spin"}),e.jsx("span",{children:"Checking connection…"})]}):P?.status==="ready"?e.jsxs(e.Fragment,{children:[e.jsx(be,{size:16}),e.jsx("span",{children:d.enabled?"Connected":"Connected, disabled for chat"})]}):e.jsxs(e.Fragment,{children:[e.jsx(fe,{size:16}),e.jsx("span",{children:P?.status==="missing"?"Installation not found":P?.status==="needs_login"?"Sign in required":"Connection needs attention"})]})}),e.jsxs("button",{type:"button",className:"settings-secondary",disabled:C||!s,onClick:()=>{j()},title:"Refresh connection","aria-label":"Refresh connection",children:[e.jsx(le,{size:14})," Refresh"]})]}),X?e.jsx("p",{role:"alert",children:X}):null,Z.length?e.jsxs("section",{className:"native-model-section","aria-label":"Available models",children:[e.jsxs("div",{className:"native-model-heading",children:[e.jsx("h3",{children:"Models"}),e.jsxs("small",{children:[Z.length," available"]})]}),e.jsx("div",{className:"native-model-list",tabIndex:0,"aria-label":"Models",role:"list",children:Z.map(n=>e.jsx("span",{role:"listitem",children:n},n))}),e.jsx("small",{children:"Choose a model when starting a chat."})]}):null,P?.version?e.jsx("small",{className:"native-agent-version",children:P.version}):null,!E&&P?.status==="needs_login"?e.jsx("button",{type:"button",className:"settings-secondary",disabled:C||f||!s,title:f?"Save changes before signing in to a different installation":void 0,onClick:()=>{G()},children:"Sign in"}):null,E&&P?.authMethods?.length?e.jsx("div",{className:"acp-auth-methods",children:P.authMethods.map(n=>n.type==="terminal"?e.jsxs("p",{children:["Use ",n.name," in the agent’s own terminal, then refresh this connection."]},n.id):e.jsx("button",{type:"button",className:"settings-secondary",disabled:C||f||!s,onClick:()=>{F(n.id)},title:n.description,children:n.name},n.id))}):null,P?.status==="missing"&&R.install?e.jsxs("p",{children:[e.jsxs("a",{href:R.install,target:"_blank",rel:"noreferrer",children:["Install ",i.displayName]}),", then refresh this connection."]}):null,r==="codex"&&P?.status==="missing"?e.jsx("p",{children:"OpenPond needs the Codex CLI installed separately from ChatGPT."}):null,(D||P?.status==="unavailable")&&!m?e.jsx("button",{type:"button",className:"settings-secondary",disabled:C||!s,onClick:()=>{j()},children:"Retry"}):null,l&&s?e.jsx(Me,{connection:s,command:l,onComplete:()=>{S(null),j()},onClose:()=>{S(null),j()}}):null,ee(r)?e.jsxs("details",{children:[e.jsx("summary",{children:"Advanced"}),e.jsxs("form",{className:"provider-card-form",onSubmit:n=>{J(n)},children:[E?e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"ACP command"}),e.jsx("input",{value:b,disabled:C,onChange:n=>N(n.target.value)})]}),e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Arguments (JSON array)"}),e.jsx("textarea",{value:L,disabled:C,onChange:n=>U(n.target.value)})]}),e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Environment overrides (JSON object)"}),e.jsx("textarea",{value:x,disabled:C,onChange:n=>u(n.target.value)})]})]}):null,e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Executable override"}),e.jsx("input",{value:O,placeholder:`${R.executable} from PATH, or an absolute path`,disabled:C,onChange:n=>$(n.currentTarget.value)})]}),e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:E?"Home directory":"Source home"}),e.jsx("input",{value:k,placeholder:"Use the agent's existing home",disabled:C,onChange:n=>M(n.currentTarget.value)})]}),f?e.jsx("button",{className:"settings-secondary",disabled:C||!s,children:"Save changes"}):null]})]}):null]})}const Ge=[{value:"local_secret",label:"Saved key",description:"Encrypted on this machine"},{value:"env",label:"Environment variable",description:"Read by the local server"}],He=120,qe=new Set(["openai","xai","zai"]),Ke=new Set(["chatgpt-subscription"]),Ve="https://api.z.ai/api/coding/paas/v4";function me(s){return s.split(/[\n,]/).map(r=>r.trim()).filter(Boolean)}function ve(s){return s?s.available?"Ready":s.credential.connected?"Configured":s.credential.lastError||s.lastError?"Needs attention":s.id==="codex"?"Needs Codex login":ee(s.id)?"Check connection":s.routing.localByok?"Needs key":s.enabled?"Enabled":"Off":"Unknown"}function je(s){return s?s.available?"ready":s.credential.connected?"configured":s.credential.lastError||s.lastError||s.id==="codex"?"warning":"muted":"unknown"}function pe(s){return s.credential.connected?s.credential.redacted?s.credential.redacted:s.credential.source==="native_agent_login"?"Native login":s.credential.source==="chatgpt_subscription"?"ChatGPT subscription":s.credential.source:s.credential.lastError??"Not connected"}function We(s){return s?.trim().replace(/\/+$/,"")??""}function ye(s,r){return s.id==="zai"&&We(r.providers.zai?.baseUrl)===Ve}function Ze(s,r){return!s.credential.connected||!s.routing.localByok?"":s.credential.source==="native_agent_login"?"Native login":s.credential.source==="chatgpt_subscription"?"Subscription":ye(s,r)?"Coding Plan key":"API key"}function Xe(s,r){const d=r.modelCaches[s.id];if(s.routing.localByok&&s.enabled&&!s.credential.connected||!s.enabled&&s.id!=="openpond")return"";const i=Math.max(d?.models.length??0,s.modelIds.length),o=s.defaultModel?De(s.defaultModel,r,s.id):"",g=i===1?"1 model":`${i} models`;return[Ze(s,r),d?g:"",o].filter(Boolean).join(" · ")}function Ye(s){return s!=="openpond"&&te(s)}function Ne(s){return s?qe.has(s.id)||s.credentialModes.some(r=>Ke.has(r)):!1}function Ie(s){return Ne(s)?["api","subscription"]:["api"]}function ge(s,r){return!s||!r||!Ne(s)?"api":s.credential.source==="chatgpt_subscription"||ye(s,r)?"subscription":"api"}function Qe(s){if(!s)return"Never";const r=new Date(s);return Number.isNaN(r.getTime())?s:r.toLocaleString()}function es(s,r,d=He){const i=[],o=new Set,g=new Set(r.map(l=>l.trim()).filter(Boolean)),c=l=>{o.has(l.value)||i.length>=d||(o.add(l.value),i.push(l))};for(const l of s)g.has(l.value)&&c(l);for(const l of s)c(l);return i}function os({onProvidersChanged:s,checkNativeProvider:r,connection:d,account:i,codex:o,providers:g,providerBusy:c,validationMessage:l,deleteProviderCredential:S,loadProviderModels:D,refreshProviderModels:w,saveProviderConfig:P,saveProviderCredential:T,startOpenAiSubscriptionAuth:m,validateProvider:p}){const[O,$]=t.useState(null),[k,M]=t.useState(null),[h,v]=t.useState(null),A=[...se,...Object.keys(g?.statuses??{}).filter(Y)].filter(b=>g?.statuses[b]),E=h?g?.statuses[h]??null:null;function R(b,N){v(b),N&&D(b)}return e.jsxs("section",{className:"account-settings provider-connections-settings",children:[e.jsxs("div",{className:"provider-connections-heading",children:[e.jsx("h1",{children:"Providers"}),e.jsx(ze,{connection:d,onChanged:s,onAdded:b=>v(b)})]}),e.jsxs("div",{className:"provider-connections-intro",children:[e.jsx("p",{children:"Manage your installed agents and login. Sync their conversations from Connections."}),e.jsx("button",{type:"button",className:"settings-secondary",onClick:()=>{Re({kind:"view",view:"apps"})},children:"Connections & apps"})]}),g?e.jsx("div",{className:"provider-connections-panel",children:A.length>0?e.jsx("div",{className:"provider-connections-grid",role:"list",children:A.map(b=>{const N=g.statuses[b],L=g.modelCaches[b],U=N.modelIds.length>0&&(L?.models.length??0)<N.modelIds.length,x=c?.startsWith(`${b}:`)??!1,u=Ye(b),a=b==="openpond"||!!g.providers[b]?.enabled;return e.jsxs("div",{className:"provider-connection-card",role:"listitem",children:[e.jsxs("div",{className:"provider-connection-identity",children:[e.jsx("strong",{children:N.displayName}),e.jsxs("label",{className:"provider-toggle","aria-label":`Enable ${N.displayName}`,children:[e.jsx("input",{type:"checkbox",checked:a,disabled:!u||x,onChange:f=>{P(b,{enabled:f.currentTarget.checked})}}),e.jsx("span",{})]})]}),e.jsxs("div",{className:`provider-connection-status ${je(N)}`,children:[x?e.jsx(V,{size:13,className:"settings-spin"}):null,e.jsx("span",{children:ve(N)})]}),e.jsx("p",{children:Xe(N,g)||(N.enabled?"Check your installation and sign in to use this agent.":"Enable this agent to use it in chats.")}),b==="codex"||b==="claude-code"?e.jsx($e,{connection:d,provider:b}):null,e.jsx("button",{type:"button",className:"settings-secondary",onClick:()=>{R(b,U)},children:"Manage"}),Y(b)?e.jsx("button",{type:"button",className:"settings-secondary",disabled:O!==null||!d,onClick:async()=>{if(d){$(b),M(null);try{const f=await K(d,"/v1/providers/acp-registry",{method:"DELETE",body:JSON.stringify({providerId:b})});s(f.settings),h===b&&v(null)}catch(f){M(f instanceof Error?f.message:"Could not remove ACP agent.")}finally{$(null)}}},children:O===b?"Removing…":"Remove connection"}):null]},b)})}):e.jsx("div",{className:"empty-account-list provider-manager-empty",children:e.jsx("strong",{children:"No agent providers available"})})}):null,k?e.jsx("p",{role:"alert",children:k}):null,e.jsx(Be,{connection:d,onChanged:async()=>{d&&s(await q.providerSettings(d))}}),l?e.jsxs("div",{className:"settings-footnote provider-validation-message",children:[e.jsx("span",{children:"Last validation"}),e.jsx("strong",{children:l})]}):null,h&&E&&g?e.jsx(ss,{checkNativeProvider:r,connection:d,account:i,codex:o,providerId:h,providerBusy:c,settings:g,status:E,onClose:()=>v(null),onDeleteCredential:S,onRefreshModels:w,onSaveConfig:P,onSaveCredential:T,onStartOpenAiSubscriptionAuth:m,onValidate:p}):null]})}function ss({checkNativeProvider:s,connection:r,account:d,codex:i,providerId:o,providerBusy:g,settings:c,status:l,onClose:S,onDeleteCredential:D,onRefreshModels:w,onSaveConfig:P,onSaveCredential:T,onStartOpenAiSubscriptionAuth:m,onValidate:p,conversationPanel:O}){const $=xe(S),[k,M]=t.useState("setup"),h=t.useId(),v=c.providers[o],A=c.modelCaches[o],E=t.useId(),R=t.useRef(o),b=Math.max(A?.models.length??0,l.modelIds.length),N=l.routing.localByok&&te(o)&&o!=="codex"&&!ee(o),L=t.useMemo(()=>N?Ie(l):[],[N,l]),U=L.includes("subscription"),[x,u]=t.useState(()=>ge(l,c)),a=N&&x==="subscription"&&U,f=j=>`${E}-${j}-panel`,C=o==="codex"?"Codex app server":v?.baseUrl??(o==="openpond"?d?.chatApiBaseUrl:null)??"Not set";return t.useEffect(()=>{if(R.current!==o){R.current=o,u(ge(l,c));return}N&&!L.includes(x)&&u("api")},[x,L,N,o,c,l]),e.jsx("div",{className:"git-dialog-backdrop provider-dialog-backdrop",role:"presentation",onMouseDown:S,children:e.jsxs("section",{ref:$,className:`git-dialog provider-details-dialog${O?" agent-setup-dialog":""}`,role:"dialog","aria-modal":"true","aria-label":`${l.displayName} provider details`,onMouseDown:j=>j.stopPropagation(),children:[e.jsx("button",{className:"git-dialog-close",type:"button",title:"Close","aria-label":"Close",onClick:S,children:e.jsx(ae,{size:16})}),e.jsxs("div",{className:"provider-dialog-header",children:[e.jsxs("div",{children:[e.jsx("h2",{children:l.displayName}),e.jsx("span",{children:se.includes(o)||Y(o)?"Installation and login":"API and subscription settings"})]}),e.jsx("div",{className:`provider-state-pill ${je(l)}`,children:ve(l)})]}),(se.includes(o)||Y(o))&&v?e.jsxs("label",{className:"provider-chat-toggle",children:[e.jsxs("span",{className:"provider-toggle",children:[e.jsx("input",{type:"checkbox","aria-label":`Enable ${l.displayName} for chat`,checked:v.enabled,disabled:g!==null,onChange:j=>{P(o,{enabled:j.target.checked})}}),e.jsx("span",{"aria-hidden":"true"})]}),e.jsxs("span",{children:["Use ",l.displayName," for chats"]})]}):null,O?e.jsxs("div",{className:"surface-tabs provider-agent-tabs",role:"tablist","aria-label":"Agent settings",onKeyDown:j=>{if(j.key!=="ArrowLeft"&&j.key!=="ArrowRight")return;j.preventDefault();const J=k==="setup"?"sync":"setup";M(J),j.currentTarget.querySelector(`#${CSS.escape(`${h}-${J}`)}`)?.focus()},children:[e.jsx("button",{type:"button",role:"tab",id:`${h}-setup`,"aria-controls":`${h}-setup-panel`,"aria-selected":k==="setup",tabIndex:k==="setup"?0:-1,onClick:()=>M("setup"),children:"Agent setup"}),e.jsx("button",{type:"button",role:"tab",id:`${h}-sync`,"aria-controls":`${h}-sync-panel`,"aria-selected":k==="sync",tabIndex:k==="sync"?0:-1,onClick:()=>M("sync"),children:"Conversation sync"})]}):null,e.jsxs("div",{hidden:k!=="setup",id:`${h}-setup-panel`,role:O?"tabpanel":void 0,"aria-labelledby":O?`${h}-setup`:void 0,children:[N?e.jsx("div",{className:"surface-tabs provider-mode-tabs",role:"tablist","aria-label":`${l.displayName} mode`,children:L.map(j=>e.jsx("button",{type:"button",role:"tab",id:`${E}-${j}`,className:x===j?"active":void 0,"aria-selected":x===j,"aria-controls":f(j),onClick:()=>u(j),children:j==="api"?"API":"Subscription"},j))}):null,se.includes(o)||Y(o)?null:e.jsxs("dl",{className:"provider-dialog-stats",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Credential"}),e.jsx("dd",{title:pe(l),children:pe(l)})]}),a?null:e.jsxs(e.Fragment,{children:[ee(o)?null:e.jsxs("div",{children:[e.jsx("dt",{children:"Base URL"}),e.jsx("dd",{title:C,children:C})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Model"}),e.jsx("dd",{title:v?.defaultModel??l.defaultModel??void 0,children:v?.defaultModel??l.defaultModel??"Not set"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Models"}),e.jsxs("dd",{title:A?.lastError??void 0,children:[b," cached, ",Qe(A?.fetchedAt)]})]})]}),o==="codex"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Account"}),e.jsx("dd",{title:i?.account?.email??void 0,children:i?.account?.label??i?.account?.email??"Not signed in"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Binary"}),e.jsx("dd",{title:i?.binaryPath??void 0,children:i?.binaryPath??"Not found"})]})]}):null,l.credential.lastError||A?.lastError||l.lastError?e.jsxs("div",{className:"provider-dialog-error",children:[e.jsx("dt",{children:"Error"}),e.jsx("dd",{title:l.credential.lastError??A?.lastError??l.lastError??void 0,children:l.credential.lastError??A?.lastError??l.lastError})]}):null]}),o==="codex"?e.jsxs(e.Fragment,{children:[v?e.jsx(he,{connection:r,providerId:o,config:v,status:l,cachedModels:A?.models??[],busy:g!==null,onCheck:s},o):null,e.jsxs("div",{className:"provider-dialog-body",children:[e.jsx("h3",{children:"ChatGPT with the OpenPond harness"}),e.jsx("p",{children:"Native Codex and the OpenPond harness keep their own connections. Choose the execution path in the model picker."}),e.jsx("p",{children:c.statuses.openai?.credential.connected?"OpenPond harness connected":"OpenPond harness not connected"}),e.jsx("button",{type:"button",className:"settings-secondary",disabled:g!==null,onClick:()=>{m("browser")},children:"Connect ChatGPT for OpenPond"}),e.jsxs("button",{type:"button",className:"settings-secondary",disabled:g!==null,onClick:()=>{P("openai",{enabled:!c.providers.openai?.enabled})},children:[c.providers.openai?.enabled?"Disable":"Enable"," OpenPond harness route"]})]})]}):ee(o)&&v?e.jsx(he,{connection:r,providerId:o,config:v,status:l,cachedModels:A?.models??[],busy:g!==null,onCheck:s},o):N&&v&&A?e.jsx(ns,{credentialTab:x,credentialTabsId:E,hasSubscriptionTab:U,providerId:o,providerBusy:g,settings:c,status:l,onDeleteCredential:D,onRefreshModels:w,onSaveConfig:P,onSaveCredential:T,onStartOpenAiSubscriptionAuth:m,onValidate:p}):l.routing.localByok&&!te(o)?e.jsxs("div",{className:"provider-dialog-note",children:[e.jsx(fe,{size:15}),e.jsx("span",{children:"Adapter pending"})]}):null]}),k==="sync"?e.jsx("div",{role:"tabpanel",id:`${h}-sync-panel`,"aria-labelledby":`${h}-sync`,children:O}):null]})})}function ns({credentialTab:s,credentialTabsId:r,hasSubscriptionTab:d,providerId:i,providerBusy:o,settings:g,status:c,onDeleteCredential:l,onRefreshModels:S,onSaveConfig:D,onSaveCredential:w,onStartOpenAiSubscriptionAuth:P,onValidate:T}){const m=g.providers[i],p=t.useMemo(()=>Te(i,g),[i,g]),O=`provider-models-${i}`,$=t.useRef(i),[k,M]=t.useState(m.baseUrl??""),[h,v]=t.useState(m.defaultModel??""),[A,E]=t.useState(m.modelOverrides.join(`
|
|
2
2
|
`)),[R,b]=t.useState({baseUrl:!1,defaultModel:!1,modelOverrides:!1}),[N,L]=t.useState("local_secret"),[U,x]=t.useState(""),[u,a]=t.useState(""),f=o===`${i}:config`,C=o===`${i}:credential`,j=o===`${i}:validate`,J=o===`${i}:models`,G=o==="openai:credential",F=i==="openai",W=i==="xai",Z=i==="zai",n=(_=>`${r}-${_}-panel`)(s),y=s==="subscription"&&d,z=s==="subscription"&&Z?"coding-plan":"api",B=z==="coding-plan"?"Coding Plan key":"API key",Ce=c.credential.connected?z==="coding-plan"?"Replace saved plan key":"Replace saved key":B,Se=z==="coding-plan"?"Save plan key":"Save key",ie=t.useMemo(()=>es(p,[h,...me(A)]),[h,p,A]),re=Math.max(0,p.length-ie.length);t.useEffect(()=>{if($.current!==i){$.current=i,b({baseUrl:!1,defaultModel:!1,modelOverrides:!1}),M(m.baseUrl??""),v(m.defaultModel??""),E(m.modelOverrides.join(`
|
|
3
3
|
`));return}R.baseUrl||M(m.baseUrl??""),R.defaultModel||v(m.defaultModel??""),R.modelOverrides||E(m.modelOverrides.join(`
|
|
4
4
|
`))},[m.baseUrl,m.defaultModel,m.modelOverrides,R.baseUrl,R.defaultModel,R.modelOverrides,i]);const oe=N==="env"?!!u.trim():!!U.trim();async function Pe(_){_.preventDefault(),await D(i,{enabled:!0,baseUrl:k.trim()||null,defaultModel:h.trim()||null,modelOverrides:me(A)}),b({baseUrl:!1,defaultModel:!1,modelOverrides:!1})}async function ke(_){if(_.preventDefault(),!!oe){if(N==="env"){await w(i,{source:"env",envVar:u.trim()});return}await w(i,{source:"local_secret",value:U}),x("")}}function de({panel:_=!0}={}){return e.jsxs("form",{className:"provider-credential-panel",id:_?n:void 0,role:_?"tabpanel":void 0,"aria-labelledby":_?`${r}-${s}`:void 0,onSubmit:H=>{ke(H)},children:[e.jsxs("div",{className:"provider-card-grid credential-grid",children:[e.jsxs("div",{className:"settings-select-field",children:[e.jsx("span",{children:"Credential source"}),e.jsx(ne,{value:N,disabled:C,label:"Credential source",options:Ge,onChange:H=>L(H)})]}),N==="env"?e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Environment variable"}),e.jsx("input",{value:u,disabled:C,placeholder:"PROVIDER_API_KEY",onChange:H=>a(H.currentTarget.value)})]}):e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:B}),e.jsx("input",{type:"password",value:U,disabled:C,placeholder:Ce,autoComplete:"off",onChange:H=>x(H.currentTarget.value)})]})]}),e.jsxs("div",{className:"settings-button-row",children:[e.jsxs("button",{className:"settings-secondary",disabled:C||!oe,children:[C?e.jsx(V,{size:14,className:"settings-spin"}):e.jsx(I,{size:14}),e.jsx("span",{children:C?"Saving":Se})]}),e.jsx("button",{type:"button",className:"settings-icon-button ghost","aria-label":`Delete ${c.displayName} credential`,disabled:C||!c.credential.connected,onClick:()=>{l(i)},children:e.jsx(ue,{size:15})})]})]})}function we(){return F?e.jsxs("div",{className:"provider-subscription-panel",id:n,role:"tabpanel","aria-labelledby":`${r}-subscription`,children:[e.jsxs("div",{className:"provider-dialog-note codex-provider-note",children:[e.jsx(I,{size:15}),e.jsx("span",{children:"ChatGPT subscription auth opens OpenAI login and stores a refresh token locally. API keys remain available under the API tab for raw Platform billing."})]}),e.jsxs("div",{className:"settings-button-row",children:[e.jsxs("button",{type:"button",className:"settings-secondary",disabled:G,onClick:()=>{P("browser")},children:[G?e.jsx(V,{size:14,className:"settings-spin"}):e.jsx(I,{size:14}),e.jsx("span",{children:G?"Opening":"Connect ChatGPT"})]}),e.jsxs("button",{type:"button",className:"settings-secondary",disabled:G,onClick:()=>{P("device")},children:[G?e.jsx(V,{size:14,className:"settings-spin"}):e.jsx(I,{size:14}),e.jsx("span",{children:"Device code"})]}),e.jsx("button",{type:"button",className:"settings-icon-button ghost","aria-label":`Delete ${c.displayName} credential`,disabled:G||!c.credential.connected,onClick:()=>{l(i)},children:e.jsx(ue,{size:15})})]})]}):W?e.jsx("div",{className:"provider-subscription-panel",id:n,role:"tabpanel","aria-labelledby":`${r}-subscription`,children:e.jsxs("div",{className:"provider-dialog-note xai-provider-note",children:[e.jsx(I,{size:15}),e.jsx("span",{children:"SuperGrok includes Grok app and Grok Build access. xAI API calls here still use an xAI Console API key with API credits or invoiced billing, so there is no separate Connect SuperGrok step yet."})]})}):Z?e.jsxs("div",{className:"provider-subscription-panel",id:n,role:"tabpanel","aria-labelledby":`${r}-subscription`,children:[e.jsxs("div",{className:"provider-dialog-note subscription-provider-note",children:[e.jsx(I,{size:15}),e.jsx("span",{children:"GLM Coding Plan uses a plan API key with the dedicated Coding endpoint. General Z.ai API keys and balances are separate."})]}),de({panel:!1})]}):null}return e.jsxs("div",{className:"provider-dialog-body",children:[y?null:e.jsxs("form",{className:"provider-card-form",onSubmit:_=>{Pe(_)},children:[e.jsxs("div",{className:"provider-card-grid",children:[e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Base URL"}),e.jsx("input",{value:k,disabled:f,placeholder:"https://api.example.com/v1",onChange:_=>{b(H=>({...H,baseUrl:!0})),M(_.currentTarget.value)}})]}),e.jsxs("label",{className:"settings-select-field",children:[e.jsx("span",{children:"Default model"}),e.jsx("input",{list:O,value:h,disabled:f,placeholder:"Model id",onChange:_=>{b(H=>({...H,defaultModel:!0})),v(_.currentTarget.value)}}),e.jsx("datalist",{id:O,children:ie.map(_=>e.jsx("option",{value:_.value,children:_.label},_.value))}),re>0?e.jsxs("small",{children:[re," more cached models hidden from suggestions"]}):null]})]}),e.jsxs("div",{className:"settings-button-row",children:[e.jsxs("button",{className:"settings-secondary",disabled:f,children:[f?e.jsx(V,{size:14,className:"settings-spin"}):e.jsx(Le,{size:14}),e.jsx("span",{children:f?"Saving":"Save config"})]}),e.jsxs("button",{type:"button",className:"settings-secondary",disabled:J,onClick:()=>{S(i)},children:[J?e.jsx(V,{size:14,className:"settings-spin"}):e.jsx(le,{size:14}),e.jsx("span",{children:J?"Refreshing":"Refresh models"})]}),e.jsxs("button",{type:"button",className:"settings-secondary",disabled:j||!h.trim(),onClick:()=>{T(i,{baseUrl:k.trim()||void 0,modelId:h.trim()||void 0})},children:[j?e.jsx(V,{size:14,className:"settings-spin"}):e.jsx(be,{size:14}),e.jsx("span",{children:j?"Testing":"Test"})]})]})]}),e.jsx("div",{className:"provider-card-form credential-form",children:y?we():de()})]})}function ds({connection:s,onError:r,onPreferences:d,onProviders:i,preferences:o,providers:g}){const c=t.useRef(s);c.current=s;const[l,S]=t.useState(o.defaultChatProvider),[D,w]=t.useState(o.defaultChatModel),[P,T]=t.useState(!1),[m,p]=t.useState(null),[O,$]=t.useState(null);t.useEffect(()=>{S(o.defaultChatProvider),w(o.defaultChatModel)},[o.defaultChatProvider,o.defaultChatModel]);async function k(u){if(u.preventDefault(),!!s){T(!0),r(null);try{d(await q.savePreferences(s,{defaultChatProvider:l,defaultChatModel:ce(l,D,g)}))}catch(a){r(a instanceof Error?a.message:String(a))}finally{T(!1)}}}function M(u){S(u),w(a=>ce(u,a,g))}async function h(u,a,f){if(!s)return null;p(`${u}:${a}`),$(null),r(null);try{return await f()}catch(C){return r(C instanceof Error?C.message:String(C)),null}finally{p(null)}}async function v(u,a){await h(u,"config",async()=>{const f=await q.saveProviderSettings(s,{providers:{[u]:a}});return i(f),f})}async function A(u,a){await h(u,"credential",async()=>{const f=await q.saveProviderCredential(s,u,a);return i(f),f})}async function E(u){await h(u,"credential",async()=>{const a=await q.deleteProviderCredential(s,u,{});return i(a),a})}async function R(u){return h("openai","credential",async()=>{const a=await q.startOpenAiSubscriptionAuth(s,{method:u});return a.method==="browser"?(window.open(a.url,"_blank","noopener,noreferrer"),$("OpenAI ChatGPT login opened in your browser. Return here after authorization.")):(window.open(a.url,"_blank","noopener,noreferrer"),$(`OpenAI device login started. Enter code ${a.userCode}.`)),b(a.expiresAt),a})}async function b(u){if(s)for(;Date.now()<u;){await new Promise(a=>setTimeout(a,2500));try{const a=await q.providerSettings(s);i(a);const f=a.statuses.openai?.credential;if(f?.connected&&f.source==="chatgpt_subscription"){$("OpenAI ChatGPT subscription connected.");return}}catch{}}}async function N(u){await h(u,"models",async()=>{const a=await q.refreshProviderModels(s,u,{force:!0});return i(a.providers),a})}async function L(u){await h(u,"models",async()=>{const a=await q.loadProviderModels(s,u,{limit:500});return i(a.providers),a})}async function U(u,a={}){await h(u,"validate",async()=>{const f=await q.validateProviderCredential(s,u,a);return $(f.ok?`${u} validated${f.modelId?` with ${f.modelId}`:""}.`:f.errors.join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f}from"./index-
|
|
1
|
+
import{r as f}from"./index-Di1MU6Xr.js";import{W as C}from"./App-nzE7JU_O.js";function S(n,e,t){return new Set(n.filter(i=>{if(e.has(i.id))return!1;if(t===void 0)return!0;if(typeof i.timestamp!="string")return!1;const a=Date.parse(i.timestamp);return Number.isFinite(a)&&a>=t}).map(i=>i.id))}function v(n){let e=null;for(const t of n){if(typeof t.timestamp!="string")continue;const i=Date.parse(t.timestamp);Number.isFinite(i)&&(e=e===null?i:Math.max(e,i))}return e}function E(n,e){const t=f.useRef({scopeKey:e,ids:new Set(n.map(r=>r.id)),initialized:!1,liveCutoff:null}),i=t.current.scopeKey===e,d=i&&t.current.initialized?S(n,t.current.ids,t.current.liveCutoff??void 0):new Set;return f.useLayoutEffect(()=>{const r=t.current,s=r.scopeKey!==e,u=Date.now();t.current={scopeKey:e,ids:new Set(n.map(l=>l.id)),initialized:!s,liveCutoff:s?Math.max(u,v(n)??0):r.liveCutoff??Math.max(u,v(n)??0)}},[n,i,e]),d}const w=new Map,M=[200,600,1500];function x({connection:n,latestTurnId:e,sessionId:t,turnRunning:i}){const[a,d]=f.useState(()=>({sessionId:null,summaries:w}));return f.useEffect(()=>{if(!n||!t)return;let r=!1,s=null;const u=i?null:e,l=o=>{const c=M[o];c===void 0||r||(s=setTimeout(()=>{m(o+1)},c))},m=async o=>{try{const c=await C.usageTurnCache(n,t);if(r)return;const p=new Map(c.turns.map(h=>[h.turnId,h]));d({sessionId:t,summaries:p}),u&&!p.has(u)&&l(o)}catch{l(o)}};return m(0),()=>{r=!0,s!==null&&clearTimeout(s)}},[n,e,t,i]),a.sessionId===t?a.summaries:w}export{x as a,E as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as a}from"./App-
|
|
1
|
+
import{e as a}from"./App-nzE7JU_O.js";const e=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],y=a("bell",e);const t=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]],k=a("bell-off",t);const o=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],c=a("scroll-text",o);const h=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],p=a("wifi-off",h);export{k as B,c as S,p as W,y as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j7 as c}from"./WorkspaceMonacoEditor-
|
|
1
|
+
import{j7 as c}from"./WorkspaceMonacoEditor-frxie2_S.js";import"./toggleHighContrast-CaNeuWVE.js";function a(e,o){const r=globalThis.MonacoEnvironment;if(r?.createTrustedTypesPolicy)try{return r.createTrustedTypesPolicy(e,o)}catch(t){console.error(t);return}try{return globalThis.trustedTypes?.createPolicy(e,o)}catch(t){console.error(t);return}}let n;typeof self=="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope"&&globalThis.workerttPolicy!==void 0?n=globalThis.workerttPolicy:n=a("defaultWorkerFactory",{createScriptURL:e=>e});function l(e){const o=e.label,r=globalThis.MonacoEnvironment;if(r){if(typeof r.getWorker=="function")return r.getWorker("workerMain.js",o);if(typeof r.getWorkerUrl=="function"){const t=r.getWorkerUrl("workerMain.js",o);return new Worker(n?n.createScriptURL(t):t,{name:o,type:"module"})}}if(e.createWorker)return e.createWorker();throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function u(e){const o=Promise.resolve(l({label:e.label??"monaco-editor-worker",moduleId:e.moduleId,createWorker:e.createWorker})).then(r=>(r.postMessage("ignore"),r.postMessage(e.createData),r));return c.createWebWorker({worker:o,host:e.host,keepIdleModels:e.keepIdleModels})}export{u as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e}from"./WorkspaceMonacoEditor-
|
|
1
|
+
import{l as e}from"./WorkspaceMonacoEditor-frxie2_S.js";import"./toggleHighContrast-CaNeuWVE.js";import"./index-Di1MU6Xr.js";const r={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{offSide:!0},onEnterRules:[{beforeText:/:\s*$/,action:{indentAction:e.IndentAction.Indent}}]},l={tokenPostfix:".yaml",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.square",open:"[",close:"]"}],keywords:["true","True","TRUE","false","False","FALSE","null","Null","Null","~"],numberInteger:/(?:0|[+-]?[0-9]+)/,numberFloat:/(?:0|[+-]?[0-9]+)(?:\.[0-9]+)?(?:e[-+][1-9][0-9]*)?/,numberOctal:/0o[0-7]+/,numberHex:/0x[0-9a-fA-F]+/,numberInfinity:/[+-]?\.(?:inf|Inf|INF)/,numberNaN:/\.(?:nan|Nan|NAN)/,numberDate:/\d{4}-\d\d-\d\d([Tt ]\d\d:\d\d:\d\d(\.\d+)?(( ?[+-]\d\d?(:\d\d)?)|Z)?)?/,escapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,tokenizer:{root:[{include:"@whitespace"},{include:"@comment"},[/%[^ ]+.*$/,"meta.directive"],[/---/,"operators.directivesEnd"],[/\.{3}/,"operators.documentEnd"],[/[-?:](?= )/,"operators"],{include:"@anchor"},{include:"@tagHandle"},{include:"@flowCollections"},{include:"@blockStyle"},[/@numberInteger(?![ \t]*\S+)/,"number"],[/@numberFloat(?![ \t]*\S+)/,"number.float"],[/@numberOctal(?![ \t]*\S+)/,"number.octal"],[/@numberHex(?![ \t]*\S+)/,"number.hex"],[/@numberInfinity(?![ \t]*\S+)/,"number.infinity"],[/@numberNaN(?![ \t]*\S+)/,"number.nan"],[/@numberDate(?![ \t]*\S+)/,"number.date"],[/(".*?"|'.*?'|[^#'"]*?)([ \t]*)(:)( |$)/,["type","white","operators","white"]],{include:"@flowScalars"},[/.+?(?=(\s+#|$))/,{cases:{"@keywords":"keyword","@default":"string"}}]],object:[{include:"@whitespace"},{include:"@comment"},[/\}/,"@brackets","@pop"],[/,/,"delimiter.comma"],[/:(?= )/,"operators"],[/(?:".*?"|'.*?'|[^,\{\[]+?)(?=: )/,"type"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^\},]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],array:[{include:"@whitespace"},{include:"@comment"},[/\]/,"@brackets","@pop"],[/,/,"delimiter.comma"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^\],]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],multiString:[[/^( +).+$/,"string","@multiStringContinued.$1"]],multiStringContinued:[[/^( *).+$/,{cases:{"$1==$S2":"string","@default":{token:"@rematch",next:"@popall"}}}]],whitespace:[[/[ \t\r\n]+/,"white"]],comment:[[/#.*$/,"comment"]],flowCollections:[[/\[/,"@brackets","@array"],[/\{/,"@brackets","@object"]],flowScalars:[[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'[^']*'/,"string"],[/"/,"string","@doubleQuotedString"]],doubleQuotedString:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],blockStyle:[[/[>|][0-9]*[+-]?$/,"operators","@multiString"]],flowNumber:[[/@numberInteger(?=[ \t]*[,\]\}])/,"number"],[/@numberFloat(?=[ \t]*[,\]\}])/,"number.float"],[/@numberOctal(?=[ \t]*[,\]\}])/,"number.octal"],[/@numberHex(?=[ \t]*[,\]\}])/,"number.hex"],[/@numberInfinity(?=[ \t]*[,\]\}])/,"number.infinity"],[/@numberNaN(?=[ \t]*[,\]\}])/,"number.nan"],[/@numberDate(?=[ \t]*[,\]\}])/,"number.date"]],tagHandle:[[/\![^ ]*/,"tag"]],anchor:[[/[&*][^ ]+/,"namespace"]]}};export{r as conf,l as language};
|
package/dist/web/index.html
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
|
|
8
8
|
<link rel="apple-touch-icon" href="/openpond-icon.png" />
|
|
9
9
|
<title>OpenPond App</title>
|
|
10
|
-
<script type="module" crossorigin src="/assets/index-
|
|
11
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
10
|
+
<script type="module" crossorigin src="/assets/index-Di1MU6Xr.js"></script>
|
|
11
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BojtIRzO.css">
|
|
12
12
|
</head>
|
|
13
13
|
<body>
|
|
14
14
|
<div id="root"></div>
|
|
@@ -413,6 +413,18 @@ Usage:
|
|
|
413
413
|
Options:
|
|
414
414
|
--json
|
|
415
415
|
```
|
|
416
|
+
## acp
|
|
417
|
+
|
|
418
|
+
```text
|
|
419
|
+
Usage:
|
|
420
|
+
openpond acp [--home DIR] [--model ID] [--login]
|
|
421
|
+
|
|
422
|
+
Options:
|
|
423
|
+
--api-key <string>
|
|
424
|
+
--home <string>
|
|
425
|
+
--login
|
|
426
|
+
--model <string>
|
|
427
|
+
```
|
|
416
428
|
## app-server
|
|
417
429
|
|
|
418
430
|
```text
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as H,c as m,d as k}from"./chunk-O4VIXU7A.js";import"./chunk-7K7O3CKY.js";import{d,f as p,g as f,h as w}from"./chunk-EQOV34UH.js";import"./chunk-EWOSLZDX.js";import"./chunk-AN525SPP.js";import"./chunk-IZ6DLEVY.js";import"./chunk-BQS7Z4AP.js";import"./chunk-XW6HGSIT.js";import"./chunk-57TRXBLT.js";import{c as R}from"./chunk-PH6IORGZ.js";import"./chunk-TG7P7BSV.js";import"./chunk-V34H7Y2T.js";import"./chunk-FKJHEZCW.js";import"./chunk-2RNQQNB7.js";import"./chunk-OQPJ7FJF.js";import"./chunk-EUMXMT3S.js";import"./chunk-Q4TBTRIG.js";import"./chunk-T5AACNJI.js";import"./chunk-TKLBP3MM.js";import"./chunk-RBZH6A6M.js";import"./chunk-DIO5CB6U.js";import"./chunk-7ED24PP6.js";import"./chunk-RNIAFXMB.js";import"./chunk-2IHO4GDJ.js";import"./chunk-KCJVFLBB.js";import"./chunk-N4FFQPLR.js";import"./chunk-AY64VY4E.js";import"./chunk-GJ2ZJFDD.js";import"./chunk-RZUEVS64.js";import"./chunk-3QIB5FXI.js";import"./chunk-6MI4KKWF.js";import"./chunk-DDMZSZFL.js";import"./chunk-W45RKGM6.js";import"./chunk-CGWA54LE.js";import"./chunk-KO3HNMLJ.js";import"./chunk-H6IW2R22.js";import"./chunk-L3KS6MOV.js";import"./chunk-MQULU465.js";import"./chunk-JMBQYBPI.js";import"./chunk-LPWBIGKW.js";import"./chunk-DZUAT3TP.js";import"./chunk-H7ATCPPB.js";import"./chunk-25JDHAZ5.js";import"./chunk-XMKCCLGB.js";import"./chunk-WN3V6KDN.js";import"./chunk-523TE4BI.js";import"./chunk-ZCHXGRRU.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-6FA3GG5B.js";import"./chunk-MNC4YUDI.js";import"./chunk-Z4Z5UOZM.js";import"./chunk-FFRFSDBM.js";import"./chunk-H7IWJN7L.js";import"./chunk-VYLGI3IH.js";import"./chunk-ACYFMLWG.js";import"./chunk-TVQAPBLZ.js";import"./chunk-KGNCKIFP.js";import"./chunk-ES2ISFJC.js";import{a as t}from"./chunk-FTQLQJQV.js";function b(i){let{store:n,storeDir:s,backgroundReview:r,harnessEvaluationEnabled:o,harnessTasksetReview:c}=i,v=new AbortController,u=t(e=>{let g=e.signal?AbortSignal.any([e.signal,v.signal]):v.signal;return i.harnessEvaluationReviewStream({...e,signal:g})},"harnessEvaluationReviewStream"),l=m({store:n,storeDir:s,evaluationReviewStream:u});return{inspectHarness:t(()=>k(n),"inspectHarness"),reviewHarnessProposal:a(r,"Harness review",l.reviewHarnessProposalPayload),reviewHarness:a(o,"Harness evaluation",e=>H({store:n,request:e,stream:u,continuation:{storeDir:s,stream:u}})),acceptHarnessEvaluationReview:a(o,"Tasksets",e=>c.acceptEvaluationReview(e)),materializeHarnessEvaluationTaskset:a(o,"Tasksets",e=>c.materializeEvaluationTaskset(e)),runHarnessEvaluationBaseline:a(o,"Tasksets",e=>c.runEvaluationBaseline(e)),validateHarness:t(async()=>{let e=await R(n);return e?{valid:!0,workspaceId:e.workspaceId,harnessRelease:e.harnessRelease,agentSnapshot:e.agentSnapshot}:{valid:!1,reason:"No app-server Harness release is selected."}},"validateHarness"),updateHarnessBackgroundReview:a(r,"Background review",l.updateHarnessBackgroundReviewPayload),diffHarness:l.harnessDiffPayload,rollbackHarness:l.rollbackHarnessPayload,inspectRefiner:a(r,"Refiner",()=>d(s)),updateRefiner:a(r,"Refiner",e=>p(s,e)),activateRefiner:a(r,"Refiner",e=>f(s,e)),rollbackRefiner:a(r,"Refiner",e=>w(s,e)),async close(){v.abort(new Error("Harness runtime closed"))}}}t(b,"createAppServerHarnessServices");function a(i,n,s){return async(...r)=>{if(!i)throw new Error(`${n} is disabled in this app-server deployment.`);return s(...r)}}t(a,"guardService");export{b as createAppServerHarnessServices};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{k as c,l as d}from"./chunk-YCQSVHCD.js";import"./chunk-3CDEBKSU.js";import"./chunk-DPHAN6N3.js";import"./chunk-VRODAXFS.js";import{b}from"./chunk-LNCHFVHT.js";import"./chunk-BL3YH2QU.js";import"./chunk-UCPGRPWY.js";import"./chunk-4EDIRCD3.js";import"./chunk-IFDALGZE.js";import"./chunk-EWOSLZDX.js";import"./chunk-7AVNZF36.js";import"./chunk-N6ENLEMY.js";import"./chunk-AN525SPP.js";import"./chunk-SYUKES6H.js";import"./chunk-FAYASU7Z.js";import"./chunk-GW766ZSO.js";import"./chunk-GOPFFQZU.js";import"./chunk-O3RF72BT.js";import"./chunk-KVTBX2UP.js";import"./chunk-IZ6DLEVY.js";import"./chunk-MMQRHR3V.js";import"./chunk-PCSIOUHF.js";import"./chunk-7KWD2I6W.js";import"./chunk-GPVCOEUH.js";import"./chunk-PY6K2JRH.js";import"./chunk-7PXZ4X4P.js";import"./chunk-N73MU2C3.js";import"./chunk-BQS7Z4AP.js";import"./chunk-XW6HGSIT.js";import"./chunk-57TRXBLT.js";import"./chunk-BE6SS65L.js";import"./chunk-UGL7WF3W.js";import"./chunk-DMFUEUAZ.js";import"./chunk-PSGGOZFM.js";import"./chunk-PH6IORGZ.js";import"./chunk-TG7P7BSV.js";import{l as a}from"./chunk-VGRMAGOK.js";import"./chunk-V34H7Y2T.js";import"./chunk-FKJHEZCW.js";import"./chunk-2RNQQNB7.js";import"./chunk-OQPJ7FJF.js";import"./chunk-EUMXMT3S.js";import"./chunk-Q4TBTRIG.js";import"./chunk-T5AACNJI.js";import"./chunk-TKLBP3MM.js";import"./chunk-RBZH6A6M.js";import"./chunk-DIO5CB6U.js";import"./chunk-7ED24PP6.js";import"./chunk-RNIAFXMB.js";import"./chunk-2IHO4GDJ.js";import"./chunk-KCJVFLBB.js";import"./chunk-N4FFQPLR.js";import"./chunk-AY64VY4E.js";import"./chunk-GJ2ZJFDD.js";import"./chunk-BFKYRQMA.js";import"./chunk-RZUEVS64.js";import"./chunk-3QIB5FXI.js";import"./chunk-6MI4KKWF.js";import"./chunk-DDMZSZFL.js";import"./chunk-W45RKGM6.js";import"./chunk-CGWA54LE.js";import"./chunk-KO3HNMLJ.js";import"./chunk-H6IW2R22.js";import"./chunk-L3KS6MOV.js";import"./chunk-JFXINDOQ.js";import"./chunk-MQULU465.js";import"./chunk-JMBQYBPI.js";import"./chunk-LPWBIGKW.js";import"./chunk-DZUAT3TP.js";import"./chunk-H7ATCPPB.js";import"./chunk-25JDHAZ5.js";import"./chunk-XMKCCLGB.js";import"./chunk-WN3V6KDN.js";import"./chunk-523TE4BI.js";import"./chunk-ZCHXGRRU.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-6FA3GG5B.js";import"./chunk-MNC4YUDI.js";import"./chunk-Z4Z5UOZM.js";import"./chunk-FFRFSDBM.js";import"./chunk-H7IWJN7L.js";import"./chunk-VYLGI3IH.js";import"./chunk-ACYFMLWG.js";import"./chunk-TVQAPBLZ.js";import"./chunk-KGNCKIFP.js";import"./chunk-ES2ISFJC.js";import"./chunk-FTQLQJQV.js";export{a as AGENT_PROTOCOL_VERSION,c as APP_SERVER_COMPOSITION,d as createOpenPondAppServer,b as runAppServerJsonl};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{f as $,g as J,h as L,i as v,j as q}from"./chunk-GUOLMLZN.js";import{c as g}from"./chunk-JUQMSHNR.js";import"./chunk-U2MAPON2.js";import"./chunk-7UH4YDA7.js";import{f as m,h as y}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{a as S,f as w,j as T,k as j}from"./chunk-3M53YXEI.js";import{b as H,c as Q}from"./chunk-22UARBPW.js";import{J as C,K as G,L as k,O as W,Q as M,S as z,T as F,c as D,m as K,r as V,s as _}from"./chunk-OLDK2LKJ.js";import"./chunk-BT5YNE5U.js";import"./chunk-SF5HJ7PL.js";import"./chunk-FWIPHEVA.js";import{d as f}from"./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-MNC4YUDI.js";import"./chunk-Z4Z5UOZM.js";import"./chunk-FFRFSDBM.js";import"./chunk-H7IWJN7L.js";import"./chunk-VYLGI3IH.js";import"./chunk-ACYFMLWG.js";import"./chunk-TVQAPBLZ.js";import"./chunk-KGNCKIFP.js";import"./chunk-ES2ISFJC.js";import{a as p}from"./chunk-FTQLQJQV.js";async function ie(){let e=await f(),s=m(e),t=await g(e,s),n=y(e),r=await L({apiBase:n,apiKey:t});console.log(JSON.stringify(r,null,2))}p(ie,"runAppsTools");async function se(e){let s=await f(),t=m(s),n=y(s),r=await g(s,t),i=typeof e.handle=="string"?String(e.handle):void 0,o=i?$(i):null,c=e.refresh!==void 0?w(e.refresh):void 0,l=await J({apiBase:n,apiKey:r,forceRefresh:c}),u=o?l.filter(a=>$(a.handle||a.gitOwner)===o):l;if(u.length===0){console.log("no apps found");return}if(w(e.json)){console.log(JSON.stringify({apps:u},null,2));return}for(let a of u){let d=a.handle||a.gitOwner||"unknown",h=a.repo||a.gitRepo||a.id,B=a.latestDeployment?.status||"no-deploy",R=a.latestDeployment?.gitBranch||a.defaultBranch||"-",I=a.codeVisibility||"unknown",E=a.sandbox?"yes":"no";console.log(`${d}/${h} ${B} ${R} code=${I} sandbox=${E} ${a.id}`)}}p(se,"runAppsList");async function oe(e,s){let t=typeof e.visibility=="string"?e.visibility.trim():typeof e.codeVisibility=="string"?e.codeVisibility.trim():"";if(t!=="public"&&t!=="private")throw new Error("usage: apps code-visibility <handle>/<repo> --visibility public|private");let n=await f(),r=m(n),i=y(n),o=await g(n,r),{app:c,handle:l,repo:u}=await v(i,o,s),a=await K(i,o,c.id,t);console.log(`${l}/${u} code_visibility=${a.app?.codeVisibility??t} app_id=${c.id}`)}p(oe,"runAppsCodeVisibility");async function ae(e){let s=await f(),t=m(s),n=await g(s,t),r=y(s),i=typeof e.appId=="string"?String(e.appId):void 0,o=await G(r,n,{appId:i});console.log(JSON.stringify(o,null,2))}p(ae,"runAppsPerformance");async function ce(e,s){let t=await f(),n=m(t),r=y(t),i=await g(t,n),{app:o}=await v(r,i,s),c=await k(r,i,o.id);console.log(JSON.stringify(c,null,2))}p(ce,"runAppsSummary");async function le(e,s,t,n){let r=(typeof e.prompt=="string"?e.prompt:null)||n.join(" ");if(!r.trim())throw new Error("usage: apps assistant <plan|performance> <handle>/<repo> --prompt <text>");let i=await f(),o=m(i),c=y(i),l=await g(i,o),{app:u}=await v(c,l,t),a=await W(c,l,{appId:u.id,mode:s,prompt:r.trim()});console.log(JSON.stringify(a,null,2))}p(le,"runAppsAssistant");async function de(e,s){let t=await f(),n=m(t),r=await g(t,n),i=y(t),o=(typeof e.prompt=="string"?e.prompt:null)||s.join(" ");if(!o.trim())throw new Error("usage: apps agent create --prompt <text> [--team-id <id>]");let c=typeof e.templateRepoUrl=="string"?e.templateRepoUrl:void 0,l=typeof e.templateBranch=="string"?e.templateBranch:void 0,u=typeof e.templateLocalPath=="string"?e.templateLocalPath:void 0,a=typeof e.teamId=="string"&&e.teamId.trim()?e.teamId.trim():void 0;if(u&&String(u).trim().length>0)throw new Error("templateLocalPath is not supported; use templateRepoUrl");let d=typeof e.env=="string"?S(e.env,"env"):void 0;if(d){if(typeof d!="object"||Array.isArray(d))throw new Error("env must be a JSON object");for(let[b,A]of Object.entries(d))if(typeof A!="string")throw new Error(`env value for ${b} must be a string`)}let h=c||l||d?{templateRepoUrl:c,templateBranch:l,envVars:d}:void 0,B=typeof e.deployEnvironment=="string"?e.deployEnvironment==="preview"?"preview":"production":void 0,R=e.deployDisabled!==void 0?w(e.deployDisabled):void 0,I=e.streamDeployLogs!==void 0?w(e.streamDeployLogs):!0,E=await C(i,r,{prompt:o.trim(),...a?{teamId:a}:{},...h?{template:h}:{},...B?{deployEnvironment:B}:{},...R!==void 0?{deployDisabled:R}:{},streamDeployLogs:I});if(!E.ok){let b=await E.text().catch(()=>"");throw new Error(`agent create failed: ${E.status} ${b}`)}let N=null,O=null,P=null;await H(E,{onConversationId:p(b=>{N=b},"onConversationId"),onItems:p(b=>{for(let A of b){let U=Q(A);U&&console.log(U);let x=A;!O&&typeof x.appId=="string"&&(O=x.appId),!P&&typeof x.deploymentId=="string"&&(P=x.deploymentId)}},"onItems")}),N&&console.log(`conversation_id: ${N}`),O&&console.log(`app_id: ${O}`),P&&console.log(`deployment_id: ${P}`);try{await J({apiBase:i,apiKey:r,forceRefresh:!0}),await L({apiBase:i,apiKey:r,forceRefresh:!0})}catch(b){console.warn("cache refresh failed",b)}}p(de,"runAppsAgentCreate");async function pe(e,s,t,n){let r=await f(),i=m(r),o=await g(r,i),c=y(r),l=typeof e.method=="string"?String(e.method).toUpperCase():void 0,u=l&&["GET","POST","PUT","DELETE"].includes(l)?l:void 0;if(l&&!u)throw new Error("method must be GET, POST, PUT, or DELETE");let a=typeof e.body=="string"?S(String(e.body),"body"):void 0,d=typeof e.headers=="string"?S(String(e.headers),"headers"):void 0,h=typeof e.scheduleId=="string"?String(e.scheduleId):void 0,B=w(e.notifyEmail),R=w(e.summary)||w(e.withSummary),I=await M(c,o,{appId:s,deploymentId:t,toolName:n,scheduleId:h,method:u,body:a,headers:d,notifyEmail:B||void 0});if(console.log(JSON.stringify(I,null,2)),R&&I.ok){let E=await k(c,o,s);console.log(JSON.stringify({summary:E},null,2))}}p(pe,"runAppsToolsExecute");async function ue(e,s){let t=typeof e.env=="string"?e.env:typeof e.vars=="string"?e.vars:typeof e.envVars=="string"?e.envVars:null;if(!t)throw new Error("usage: apps env set <handle>/<repo> --env <json>");let n=S(t,"env");if(!n||typeof n!="object"||Array.isArray(n))throw new Error("env must be a JSON object");let r={};for(let[d,h]of Object.entries(n)){if(typeof h!="string")throw new Error(`env value for ${d} must be a string`);if(!d.startsWith("OPENTOOL_PUBLIC_"))throw new Error("only OPENTOOL_PUBLIC_ env vars can be set");r[d]=h}let i=await f(),o=m(i),c=y(i),l=await g(i,o),{app:u}=await v(c,l,s),a=await V(c,l,u.id,{envVars:r});console.log(JSON.stringify(a,null,2))}p(ue,"runAppsEnvSet");async function fe(e,s){let t=await f(),n=m(t),r=y(t),i=await g(t,n),{app:o}=await v(r,i,s),c=await _(r,i,o.id);console.log(JSON.stringify(c,null,2))}p(fe,"runAppsEnvGet");async function ge(e,s){let t=await f(),n=m(t),r=y(t),i=await g(t,n),{app:o,handle:c,repo:l}=await v(r,i,s),u=typeof e.env=="string"?e.env:typeof e.environment=="string"?e.environment:void 0,a=j(u),d=await D(r,i,o.id,{environment:a});console.log(JSON.stringify(d,null,2)),(w(e.watch)||w(e.wait)||w(e.follow))&&await q({baseUrl:r,apiKey:i,deploymentId:d.deploymentId,prefix:`[${c}/${l}] `,intervalMs:e.interval?Number(e.interval):void 0,timeoutMs:e.timeout?Number(e.timeout):void 0})}p(ge,"runAppsDeploy");function X(e){let s={};if(typeof e.params=="string"){let n=S(String(e.params),"params");if(!n||typeof n!="object"||Array.isArray(n))throw new Error("params must be a JSON object");for(let[r,i]of Object.entries(n))i!==void 0&&(s[r]=typeof i=="string"?i:JSON.stringify(i))}let t=p((n,r)=>{r===void 0||r===""||(s[n]=r)},"addParam");if(t("source",typeof e.source=="string"?e.source.trim():void 0),t("symbol",typeof e.symbol=="string"?e.symbol.trim():void 0),t("cursor",typeof e.cursor=="string"?e.cursor.trim():void 0),t("status",typeof e.status=="string"?e.status.trim():void 0),t("backtestRunId",typeof e.runId=="string"?e.runId.trim():typeof e.backtestRunId=="string"?e.backtestRunId.trim():void 0),t("since",T(e.since,"since")),t("until",T(e.until,"until")),typeof e.limit=="string"&&e.limit.trim().length>0){let n=Number.parseInt(e.limit,10);if(!Number.isFinite(n))throw new Error("limit must be a number");t("limit",String(n))}return Object.keys(s).length?s:void 0}p(X,"resolveBacktestEventsParams");async function me(e,s){let t=await f(),n=m(t),r=await g(t,n),i=y(t),{app:o}=await v(i,r,s),c={...X(e)??{},appId:o.id},l=await z(i,r,{method:"GET",query:c});console.log(JSON.stringify(l,null,2))}p(me,"runBacktestEvents");async function ye(e,s){let t=typeof e.runId=="string"?e.runId.trim():typeof e.backtestRunId=="string"?e.backtestRunId.trim():"";if(!t)throw new Error("usage: backtest get <handle>/<repo> --run-id <id>");let n=await f(),r=m(n),i=await g(n,r),o=y(n),{app:c}=await v(o,i,s),l=await F(o,i,{appId:c.id,runId:t});console.log(JSON.stringify(l,null,2))}p(ye,"runBacktestGet");export{X as resolveBacktestEventsParams,de as runAppsAgentCreate,le as runAppsAssistant,oe as runAppsCodeVisibility,ge as runAppsDeploy,fe as runAppsEnvGet,ue as runAppsEnvSet,se as runAppsList,ae as runAppsPerformance,ce as runAppsSummary,ie as runAppsTools,pe as runAppsToolsExecute,me as runBacktestEvents,ye as runBacktestGet};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{f as S}from"./chunk-3M53YXEI.js";import{a as o}from"./chunk-FTQLQJQV.js";import{readFileSync as j}from"node:fs";import k from"node:path";function x(){let t=["../../../package.json","../../package.json","../package.json","./package.json","../../../../package.json"];for(let n of t)try{let s=new URL(n,import.meta.url),i=j(s,"utf-8"),r=JSON.parse(i);if(r.name==="openpond"&&typeof r.version=="string")return r.version}catch{}try{let n=j(k.join(k.dirname(process.execPath),"package.json"),"utf-8"),s=JSON.parse(n);if(s.name==="openpond"&&typeof s.version=="string")return s.version}catch{}return"unknown"}o(x,"getInstalledCliVersion");function I(t){let n=/^v?(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/.exec(t.trim());if(!n)return null;let s=Number.parseInt(n[1],10),i=Number.parseInt(n[2],10),r=Number.parseInt(n[3],10);return!Number.isFinite(s)||!Number.isFinite(i)||!Number.isFinite(r)?null:[s,i,r]}o(I,"parseSemver");function X(t,n){let s=I(t),i=I(n);if(!s||!i)return null;for(let r=0;r<3;r+=1){if(s[r]<i[r])return-1;if(s[r]>i[r])return 1}return 0}o(X,"compareSemver");async function Y(t){let n=new AbortController,s=setTimeout(()=>n.abort(),7e3);try{let i=await fetch(`https://registry.npmjs.org/${encodeURIComponent(t)}/latest`,{signal:n.signal});if(!i.ok){let c=await i.text().catch(()=>"");throw new Error(`npm registry request failed: ${i.status} ${c}`.trim())}let r=await i.json().catch(()=>({}));if(typeof r.version!="string"||r.version.trim().length===0)throw new Error("npm registry payload missing version");return r.version.trim()}finally{clearTimeout(s)}}o(Y,"fetchLatestNpmVersion");var a="boolean",m="integer",l="json",g="number",e="string",P={agent:e,approvalPolicy:e,cwd:e,json:a,maxOutputBytes:m,message:e,messageFile:e,model:e,noServerStart:a,nonInteractive:a,project:e,provider:e,resume:e,sandbox:e,server:e,stdin:a,timeoutSec:m,yes:a},O={access:e,agentId:e,all:a,artifactPaths:e,async:a,authHeader:e,authHeaderValue:e,authToken:e,autoStart:a,baseRef:e,branch:e,budget:g,budgetUsd:g,cleanup:a,cols:m,command:e,content:e,contentBase64:e,contents:e,contentsBase64:e,cpu:g,create:a,description:e,diskGb:g,dockerBuildArgs:l,dockerRegistrySecretRefs:e,dockerfile:e,dockerfileContext:e,dockerfileTarget:e,domain:e,env:e,environment:e,envLiteral:e,envName:e,envRef:e,expectedMppMode:e,expectedVersion:m,failOnUnpreservedChanges:a,ffOnly:a,forceWithLease:a,fork:a,fromPath:e,idempotencyKey:e,idleTimeoutSeconds:m,image:e,imageDigest:e,input:e,inputBase64:e,integrationCapabilities:e,integrationConnection:e,integrationScopes:e,intervalMs:m,json:a,keep:a,label:e,leaseId:e,lifecycleHint:l,manifestPath:e,maxDurationSeconds:m,maxEntries:g,maxResults:g,memoryGb:g,message:e,name:e,noPreview:a,overwrite:a,params:l,path:e,paths:e,payload:l,port:m,preview:a,projectId:e,publish:a,q:e,query:e,rebase:a,recursive:a,registrySecretRef:e,remote:e,replayState:e,repo:e,respondAsync:a,rows:m,runtimeAgentId:e,runtimeBaseBranch:e,runtimeBaseSha:e,runtimeId:e,runtimeProfileId:e,runtimeProjectId:e,runtimePromotionPolicy:e,runtimeWorkspaceRoot:e,sandboxId:e,scope:e,since:m,snapshot:a,snapshotId:e,sourceProjectId:e,sourceRepoUrl:e,sourceSandboxId:e,startPoint:e,status:e,stdin:a,summary:a,tag:e,tags:e,targetId:e,targetType:e,teamId:e,templateName:e,templateVersion:e,templateVisibility:e,timeoutSeconds:m,toPath:e,type:e,useCase:e,validationCommand:e,value:e,version:e,volumeDeleteOnSandboxDelete:a,volumeMountPath:e,volumeName:e,volumeStorageGb:g,workflowMode:e},A={action:e,agentId:e,budget:g,budgetUsd:g,build:e,branch:e,commit:a,commitMessage:e,description:e,dir:e,disableSchedule:e,disableSchedules:e,enableSchedule:e,enableSchedules:e,entrypoint:e,env:l,envRef:e,file:e,force:a,idleTimeoutSeconds:m,inherit:a,input:l,inputFile:e,inputFiles:e,inputJson:l,inputs:l,json:a,keepTokenRemote:a,manifest:e,maxDurationSeconds:m,name:e,noPush:a,noWrite:a,out:e,outDir:e,output:e,outputDir:e,params:l,path:e,plan:e,projectId:e,repo:e,runtimeAgentId:e,runtimeBaseBranch:e,runtimeBaseSha:e,runtimeId:e,runtimeProjectId:e,runtimePromotionPolicy:e,scheduleMode:e,scheduleOverride:l,scheduleOverrides:l,schedules:e,service:e,setRemoteToken:a,setupTimeoutSeconds:m,target:e,teamId:e,timeoutSeconds:m,token:e,workflowMode:e,yes:a},E={branch:e,commitMessage:e,defaultBranch:e,description:e,gitOwner:e,gitRepo:e,internalRepoPath:e,json:a,name:e,path:e,projectId:e,repo:e,sourceCheckDispatch:e,sourceType:e,teamId:e,templateRepoUrl:e},T={agentId:e,agentEdit:l,allowLatestSource:a,allowedActions:e,attachmentsJson:l,baseSha:e,chatMode:e,checkKind:e,conversationId:e,cwd:e,dispatch:e,entrypointName:e,entrypointScope:e,expectedManifestHash:e,evalStatus:e,expectedSourceCommitSha:e,idempotencyKey:e,input:l,inputFile:e,json:a,limit:m,message:e,metadata:l,name:e,path:e,payload:l,projectId:e,prompt:e,provider:e,publishedSnapshotId:e,ref:e,requirePublishedSnapshot:a,requiredEnv:e,requiredIntegrations:e,runtimePromotionPolicy:e,runtimeSourceMode:e,sourceCheckDispatch:e,sourceMode:e,sourceRef:e,status:e,targetProjectId:e,teamId:e,triggerType:e,workflowMode:e};var b={account:"string",apiBaseUrl:"string",apiBaseurl:"string",baseUrl:"string",baseurl:"string",chatApiBaseUrl:"string",chatApiBaseurl:"string",checkUpdate:"boolean",cwd:"string",help:"boolean",home:"string",json:"boolean",profile:"string",sandboxApiUrl:"string",sandboxApiurl:"string",tui:"boolean",version:"boolean"},ae={C:"cwd",f:"force",h:"help",j:"json",v:"version",y:"yes"},H={cwd:"string",input:"json",inputFile:"string",json:"boolean",path:"string"},y=[{name:"import",usage:"openpond import <connect|reconnect|discover|status|sync|schedule|cancel|pause|resume|disconnect|branches|branch|service> [id] [--source <name>] [--source-path <path>] [--range day|week|all] [--team <id>] [--project <id>] [--session <native-id>] [--leaf <uuid>] [--revision <hash>] [--continual [--daily|--weekly|--hourly|--cron <expression>] [--at HH:MM] [--on sun|mon|tue|wed|thu|fri|sat]] [--off] [--yes]",optionSchema:{source:"string",sourcePath:"string",range:"string",team:"string",project:"string",session:"string",leaf:"string",revision:"string",continual:"boolean",daily:"boolean",weekly:"boolean",hourly:"boolean",cron:"string",at:"string",on:"string",off:"boolean",scheduled:"boolean",yes:"boolean",connection:"string",collectorDir:"string",json:"boolean"},handler:o(async({options:t,rest:n})=>(await import("./import-CBDJ4DME.js")).runImportCommand(t,n),"handler")},{name:"datasets",usage:"openpond datasets <upload|read|list|validate|publish> [folder|id] --team <id> --api-base-url <origin> [--operation-id <id>] [--expected-revision <n>] [--publish] [--project <id>] [--dataset-id <id>]",optionSchema:{team:"string",operationId:"string",expectedRevision:"integer",publish:"boolean",project:"string",datasetId:"string",cursor:"string",workspaceHash:"string",packageHash:"string",json:"boolean"},handler:o(async({options:t,rest:n})=>(await import("./datasets-UX47DTTB.js")).runDatasetsCommand(t,n),"handler")},{name:"connected-evidence",usage:"openpond connected-evidence <list|collection|recorded-list|recorded|import-receipt|summary|case|unmapped|capture|selection|publish|prepare-recorded|upload-part|preview|commit|set-collection> [id] --team <id> [--input-file <path>] [--project <id>] [--cursor <id>] [--limit <n>]",optionSchema:{team:"string",inputFile:"string",project:"string",cursor:"string",limit:"integer"},handler:o(async({options:t,rest:n})=>(await import("./connected-evidence-NLAIEVQ3.js")).runConnectedEvidenceCommand(t,n),"handler")},{name:"improve",usage:"openpond improve <list|read|instructions|request> [id] --team <id> --actor <owner-id> [--input-file <path>] [--cursor <id>] [--limit <n>] [--local --server-url <loopback-origin>]",optionSchema:{team:"string",actor:"string",inputFile:"string",cursor:"string",limit:"integer",local:"boolean",serverUrl:"string"},handler:o(async({options:t,rest:n})=>(await import("./experiment-improvements-ZRVD2AGY.js")).runExperimentImprovementsCommand(t,n),"handler")},{name:"evaluation-schedules",usage:"openpond evaluation-schedules <list|read|request> [id] --team <id> --actor <id> --local [--server-url <loopback-origin>] [--project <id>] [--input-file <path>] [--cursor <id>] [--limit <n>]",optionSchema:{team:"string",actor:"string",local:"boolean",serverUrl:"string",project:"string",inputFile:"string",cursor:"string",limit:"integer"},handler:o(async({options:t,rest:n})=>(await import("./evaluation-coordination-3YQN5JQW.js")).runEvaluationCoordinationCommand("schedule",t,n),"handler")},{name:"evaluate-refiner",usage:"openpond evaluate-refiner <list|read|cancel|resume|request> [id] --team <id> --actor <id> --local [--server-url <loopback-origin>] [--project <id>] [--input-file <path>]",optionSchema:{team:"string",actor:"string",local:"boolean",serverUrl:"string",project:"string",inputFile:"string"},handler:o(async({options:t,rest:n})=>(await import("./evaluation-coordination-3YQN5JQW.js")).runEvaluationCoordinationCommand("refiner",t,n),"handler")},{name:"human-review",usage:"openpond human-review <read|inbox|inspect|results|request> [id] --team <id> [--input-file <path>] [--view <mine|team|approval>] [--status <active|history>] [--project <id>] [--revision <n>] [--slot <0|1>] [--after-id <id>] [--limit <n>] [--local --server-url <loopback-origin>]",optionSchema:{team:"string",inputFile:"string",view:"string",status:"string",project:"string",revision:"integer",slot:"integer",afterId:"string",limit:"integer",local:"boolean",serverUrl:"string"},handler:o(async({options:t,rest:n})=>(await import("./human-review-CSYAW4PC.js")).runHumanReviewCommand(t,n),"handler")},{name:"experiments",usage:"openpond experiments <prepare-harness|run|read|list|status|cancel|duplicate|score|passes|pass|cancel-pass|pass-result|result|compare|case> [id] [candidate-id] --team <id> [--input-file <path>] [--operation-id <id>] [--local --server-url <loopback-origin>] [--receipt-id <id>] [--json]",optionSchema:{team:"string",inputFile:"string",operationId:"string",project:"string",datasetHash:"string",search:"string",status:"string",afterId:"string",limit:"integer",json:"boolean",local:"boolean",serverUrl:"string",receiptId:"string",afterSequence:"integer",revision:"integer",contentHash:"string"},handler:o(async({options:t,rest:n})=>(await import("./experiments-JEB5A2N5.js")).runExperimentsCommand(t,n),"handler")},{name:"home",usage:"openpond home [--home <directory>]",optionSchema:{},handler:o(async()=>console.log((await import("./dist-OGLX76LL.js")).resolveOpenPondHome()),"handler")},{name:"config",usage:"openpond config <get|set|unset|path|validate|schema|doctor|migrate|recover|restart-migration|revisions|replace|effective|trust|untrust|export|backup|restore|collect-orphans|clear-cache> [key] [value] [--home <directory>] [--json]",optionSchema:{keyPath:"json",value:"string",file:"string",project:"boolean",revision:"string",expectedRevision:"string",sourceAppHome:"string",sourceConfig:"string",sourceBrowserState:"string",dryRun:"boolean"},handler:o(async({options:t,rest:n})=>(await import("./configuration-command-JS6U3RMC.js")).runConfigurationCommand(t,n),"handler")},{name:"help",usage:"openpond help",optionSchema:{},handler:o(async()=>(await import("./help-KA4OINP5.js")).printHelp(),"handler")},{name:"version",usage:"openpond version",optionSchema:{},handler:o(()=>console.log(x()),"handler")},{name:"check-update",usage:"openpond check-update",optionSchema:{},handler:o(async()=>(await import("./core-commands-U4IBRRY5.js")).runCheckUpdate(),"handler")},{name:"login",usage:"openpond login [--base-url <url>]",optionSchema:b,handler:o(async({options:t})=>(await import("./core-commands-U4IBRRY5.js")).runLogin(t),"handler")},{name:"init",usage:"openpond init [--path <dir>] [--profile <name>] [--template <name>] [--force] [--json]",optionSchema:{...b,force:"boolean",path:"string",template:"string"},handler:o(async({options:t})=>(await import("./profile-Y2MCSOUK.js")).runOpenPondInitCommand(t),"handler")},{name:"profile",usage:"openpond profile <current|init|load|check|push|commit|diff|catalog>",optionSchema:{checkKind:"string",conversationId:"string",ensureHosted:"boolean",expectedManifestHash:"string",force:"boolean",hostedCheckKind:"string",hostedRunAgentId:"string",hostedRunConversationId:"string",hostedRunIdempotencyKey:"string",hostedRunInput:"json",hostedRunRetry:"boolean",hostedRunTargetProjectId:"string",hostedSourceDispatch:"string",hostedSourceAgentId:"string",hostedSourceChecks:"boolean",hostedSourceProjectId:"string",json:"boolean",kind:"string",path:"string",publishHostedSource:"boolean",teamId:"string"},handler:o(async({options:t,rest:n})=>(await import("./profile-Y2MCSOUK.js")).runOpenPondProfileCommand(t,n),"handler")},{name:"agents",usage:"openpond agents [--json]",optionSchema:{json:"boolean"},handler:o(async({options:t,rest:n})=>(await import("./profile-Y2MCSOUK.js")).runOpenPondAgentsCommand(t,n),"handler")},{name:"actions",usage:"openpond actions <check|build|run|dev|publish> [action-id] [--cwd DIR] [--input JSON|--input-file PATH]",optionSchema:{apiKey:"string",baseUrl:"string",cwd:"string",input:"string",inputFile:"string",json:"boolean",outputDirectory:"string",sourceDirectory:"string",sourceCommitSha:"string",sourceRef:"string",projectId:"string",teamId:"string",timeoutMs:"integer"},handler:o(async({options:t,rest:n})=>(await import("./actions-command-JJ3CU7J6.js")).runProjectActionsCommand(t,n),"handler")},...F(),{name:"extension",usage:"openpond extension <add|preview|list|inspect|update|remove> [owner/repo]",usages:["openpond extension add <owner/repo> [--ref <branch|tag|sha>] [--json]","openpond extension update <owner/repo> [--ref <branch|tag|sha>] [--json]","openpond extension update --all [--json]","openpond extension remove <owner/repo> [--json]"],optionSchema:{all:"boolean",json:"boolean",ref:"string"},handler:o(async({options:t,rest:n})=>(await import("./extension-JCUA3RWV.js")).runOpenPondExtensionCommand(t,n),"handler")},{name:"profiles",usage:"openpond profiles [args]",optionSchema:{json:"boolean"},handler:o(async({options:t,rest:n})=>(await import("./core-commands-U4IBRRY5.js")).runProfiles(t,n),"handler")},{name:"account",usage:"openpond account",optionSchema:{json:"boolean"},handler:o(async()=>(await import("./core-commands-U4IBRRY5.js")).runAccount(),"handler")},{name:"health",usage:"openpond health",optionSchema:{json:"boolean"},handler:o(async({options:t})=>(await import("./core-commands-U4IBRRY5.js")).runHealth(t),"handler")},{name:"app-server",usage:"openpond app-server [--home DIR]",optionSchema:{home:"string"},handler:o(async({options:t,rest:n})=>(await import("./app-layer-KAUZAHGE.js")).runOpenPondServerCommand("app-server",t,n),"handler")},{name:"serve",usage:"openpond serve [args]",optionSchema:{host:"string",hostname:"string",listen:"string",port:"integer"},handler:o(async({options:t,rest:n})=>(await import("./app-layer-KAUZAHGE.js")).runOpenPondServerCommand("serve",t,n),"handler")},{name:"ui",usage:"openpond ui [--no-open] [--hostname HOST] [--port PORT]",optionSchema:{host:"string",hostname:"string",listen:"string",noOpen:"boolean",port:"integer",webRoot:"string"},handler:o(async({options:t,rest:n})=>(await import("./app-layer-KAUZAHGE.js")).runOpenPondServerCommand("web",t,n),"handler")},{name:"tui",aliases:["interactive"],usage:"openpond tui [--provider <id>] [--model <id>] [--project <id>]",optionSchema:{cwd:"string",model:"string",noServerStart:"boolean",project:"string",provider:"string",server:"string"},handler:o(async({options:t,rest:n})=>(await import("./app-layer-KAUZAHGE.js")).runOpenPondTerminalCommand(t,n),"handler")},{name:"chat",usage:"openpond chat (--message-file <path>|--message <text>|--stdin) --non-interactive [--provider <id>] [--model <id>] [--agent <id>] [--project <id>] [--resume <session-id>] [--yes] [--approval-policy <policy>] [--json] [--timeout-sec <n>] [--max-output-bytes <n>] [--sandbox <mode>]",optionSchema:P,handler:o(async({options:t,rest:n})=>(await import("./app-layer-KAUZAHGE.js")).runOpenPondTerminalCommand(t,n),"handler")},{name:"tool",usage:"openpond tool <list|run> <handle>/<repo> [args]",optionSchema:{body:"json",json:"boolean"},handler:K},{name:"backtest",usage:"openpond backtest <run|events|get> <handle>/<repo> [args]",optionSchema:{body:"json",branch:"string",deploymentId:"string",limit:"integer",runId:"string"},handler:$},{name:"deploy",usage:"openpond deploy watch <handle>/<repo> [--branch <branch>]",optionSchema:{branch:"string"},handler:q},{name:"template",usage:"openpond template <status|branches|update> <handle>/<repo> [--env preview|production]",optionSchema:{env:"string"},handler:G},{name:"sandbox-template",usage:"openpond sandbox-template <command> [args]",optionSchema:A,handler:o(async({options:t,rest:n})=>(await import("./sandbox-template-XWWPWWNR.js")).runSandboxTemplateCommand(t,n),"handler")},{name:"repo",usage:"openpond repo <create|push> [--name <name>] [--path <dir>] [--branch <branch>]",optionSchema:{branch:"string",name:"string",path:"string"},handler:J},{name:"organizations",aliases:["organization"],usage:"openpond organizations <login|list|use|logout|whoami> [args]",optionSchema:{accessToken:"string",arguments:"json",callbackPort:"integer",clientId:"string",customDomain:"string",displayName:"string",email:"string",env:"string",environment:"string",json:"boolean",name:"string",open:"boolean",origin:"string",primaryContactEmail:"string",printToken:"boolean",resourceUrl:"string",role:"string",scope:"string",scopes:"string",slug:"string",status:"string",timeout:"integer",timeoutSeconds:"integer",tool:"string",toolName:"string",toolset:"string",url:"string"},handler:o(async({options:t,rest:n})=>(await import("./organizations-GT24ZTCN.js")).runOrganizationsCommand(t,n),"handler")},{name:"project",usage:"openpond project <list|create|upsert|get|update|sync|source-upload|archive> [args]",optionSchema:E,handler:o(async({options:t,rest:n})=>(await import("./project-agent-YYSQIHVE.js")).runProjectCommand(t,n),"handler")},{name:"agent",usage:"openpond agent <inspect|build|validate|eval|traces|list|create|upsert|get|update|run|run-test|bind-source|source|archive> [args]",usages:["openpond agent run <action> [--cwd <project>] [--input <json>]","openpond agent run <agentId> --team-id <id> [--conversation-id <id>] [--target-project-id <projectId>] [--input <json>]","openpond agent source checks <agentId> --team-id <id> [--check-kind <kind>]","openpond agent source publish <agentId> --team-id <id> [--expected-manifest-hash <hash>]"],optionSchema:T,handler:o(async({options:t,rest:n})=>(await import("./project-agent-YYSQIHVE.js")).runAgentCommand(t,n),"handler")},{name:"desktop-test",usage:"openpond desktop-test <run|attach> <scenario...> [--isolated|--attach|--packaged|--none] [--app <path>] [--artifacts-dir <path>] [--json <path>]",optionSchema:{artifactsDir:"string",attach:"boolean",cwd:"string",devtoolsPort:"integer",grep:"string",isolated:"boolean",json:"string",jsonPath:"string",keepHome:"boolean",none:"boolean",server:"string",timeoutMs:"integer",token:"string",tokenFile:"string"},handler:o(async({options:t,rest:n})=>(await import("./desktop-test-UUU7PD4P.js")).runDesktopTestCommand(t,n),"handler")},{name:"sandbox",usage:"openpond sandbox <command> [args]",optionSchema:O,handler:o(async({options:t,rest:n})=>(await import("./sandbox-command-U6346TVJ.js")).runSandboxCommand(t,n),"handler")},{name:"continual",usage:"openpond continual <init|validate|run|report> [manifest-or-series-id]",usages:["openpond continual init --from <tasks.jsonl> [--output <continual-support.yaml>] [--non-interactive]","openpond continual validate <continual-support.yaml> [--json]","openpond continual run <continual-support.yaml> [--api-base-url <url>] [--json]","openpond continual report <comparison-series-id> [--output <report.json>] [--json]"],optionSchema:{apiBaseUrl:"string",commit:"string",correctionCasesPerFamily:"integer",correctionSelection:"string",description:"string",from:"string",grader:"string",id:"string",json:"boolean",license:"string",name:"string",nonInteractive:"boolean",output:"string",repository:"string",seed:"string",semanticSimilarityThreshold:"number"},handler:o(async({options:t,rest:n})=>(await import("./continual-WFPIDWPH.js")).runContinualCommand(t,n),"handler")},{name:"training",usage:"openpond training <create-project|start|status|watch|logs|cancel|resume|artifacts|benchmark> <taskset-id|model-run-id|run-id|model-id>",usages:["openpond training create-project <taskset-id> --recipe <path> [--project-id <id>] [--profile <id>] [--name <name>] [--objective <text>] [--destination <id>] [--rollout-placement <local|remote>] [--gpu-placement-objective <fast|balanced|economical>] [--run-preset <preset>] [--max-spend <usd>] [--retention-days <days>] [--json]","openpond training start <model-project-id> [--comparison-series-entry <entry-id>] [--manifest <path>] [--yes] [--export-approved] [--max-spend <usd>] [--retention-days <days>] [--detach] [--json]","openpond training status <run-id> [--json]","openpond training watch <run-id> [--interval-ms <ms>] [--json]","openpond training logs <run-id> [--json]","openpond training cancel <run-id> [--json]","openpond training resume <model-run-id> [--json]","openpond training artifacts <run-id> [--json]","openpond training benchmark <model-id> [--provider <id>] [--model <id>] [--reasoning-effort <level>] [--max-spend <usd>] [--json]"],optionSchema:{apiBaseUrl:"string",comparisonSeriesEntry:"string",detach:"boolean",destination:"string",exportApproved:"boolean",gpuPlacementObjective:"string",intervalMs:"integer",json:"boolean",manifest:"string",maxSpend:"number",model:"string",name:"string",objective:"string",profile:"string",projectId:"string",provider:"string",recipe:"string",reasoningEffort:"string",retentionDays:"integer",rolloutPlacement:"string",runPreset:"string",yes:"boolean"},handler:o(async({options:t,rest:n})=>(await import("./training-IDSGYGU2.js")).runTrainingCommand(t,n),"handler")},{name:"taskset",usage:"openpond taskset <import|publish|readiness|delete-draft> <package-path|draft-id|taskset-id> [--profile <id>] [--model <id>] [--json]",usages:["openpond taskset import <package-directory|taskset.json> [--profile <id>] [--json]","openpond taskset publish <draft-id> [--model <id>] [--json]","openpond taskset readiness <taskset-id> [--json]","openpond taskset delete-draft <draft-id> [--json]"],optionSchema:{apiBaseUrl:"string",json:"boolean",model:"string",profile:"string"},handler:o(async({options:t,rest:n})=>(await import("./taskset-NR2X2UOK.js")).runTasksetCommand(t,n),"handler")},{name:"opchat",usage:"openpond opchat <command> [args]",optionSchema:{compatModel:"string",compatibilityModel:"string",env:"string",environment:"string",effort:"string",json:"boolean",message:"string",model:"string",opchatApiBaseUrl:"string",opchatApiUrl:"string",prompt:"string",skipStream:"boolean",skipTool:"boolean",stream:"boolean"},handler:o(async({options:t,rest:n})=>(await import("./opchat-6ADSONAD.js")).runOpChatCommand(t,n),"handler")},{name:"teams-bot",usage:"openpond teams-bot <command> [args]",optionSchema:{json:"boolean",teamId:"string"},handler:o(async({options:t,rest:n})=>(await import("./teams-bot-CHUYMD6K.js")).runTeamsBotCommand(t,n),"handler")},{name:"apps",usage:"openpond apps <list|code-visibility|tools|deploy|env get|env set|performance|summary|assistant|agent create> [args]",optionSchema:{appId:"string",body:"json",env:"json",json:"boolean",limit:"integer",refresh:"boolean",teamId:"string",watch:"boolean"},handler:V},{name:"opentool",usage:"openpond opentool <init|validate|build> [args]",optionSchema:{},handler:o(async({rest:t})=>(await import("./core-commands-U4IBRRY5.js")).runOpentool(t),"handler")}],v=new Map;for(let t of y){v.set(t.name,t);for(let n of t.aliases??[])v.set(n,t)}function re(){return y}o(re,"listCliCommandDefinitions");function w(t){return v.get(t)??null}o(w,"getCliCommandDefinition");function ie(t,n){return w(t||"ui")?.optionSchema[n]??b[n]}o(ie,"getCliOptionKind");function se(t){let n=b[t];if(n)return n;for(let s of y){let i=s.optionSchema[t];if(i)return i}}o(se,"getAnyCliOptionKind");async function pe(t){let n=w(t.command);return n?S(t.options.help)?(U(n),!0):(await n.handler(t),!0):!1}o(pe,"runCliCommand");function B(t){let n=["Usage:",` ${t.usage}`,...(t.usages??[]).map(i=>` ${i}`)];t.aliases?.length&&n.push("","Aliases:",` ${t.aliases.join(", ")}`);let s=Object.entries(t.optionSchema).sort(([i],[r])=>i.localeCompare(r));if(s.length>0){n.push("","Options:");for(let[i,r]of s){let c=L(i);n.push(r==="boolean"?` --${c}`:` --${c} <${r}>`)}}return n.join(`
|
|
3
|
-
`)}o(B,"formatCliCommandUsage");function U(t){console.log(B(t))}o(U,"printCliCommandUsage");function L(t){return t.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}o(L,"cliOptionName");function F(){return["inspect","build","validate","eval","run"].map(n=>({name:n,usage:`openpond ${n} [args]`,optionSchema:H,handler:o(async({options:s,rest:i})=>(await import("./profile-Y2MCSOUK.js")).runOpenPondProfileSdkAlias(n,s,i),"handler")}))}o(F,"profileSdkAliasDefinitions");async function K({options:t,rest:n}){let{runToolList:s,runToolRun:i}=await import("./core-commands-U4IBRRY5.js"),r=n[0];if(r==="list"){let c=n[1];if(!c)throw new Error("usage: tool list <handle>/<repo>");await s(t,c);return}if(r==="run"){let c=n[1],d=n[2];if(!c||!d)throw new Error("usage: tool run <handle>/<repo> <tool> [--body <json>]");await i(t,c,d);return}throw new Error("usage: tool <list|run> <handle>/<repo> [args]")}o(K,"runToolCommand");async function $({options:t,rest:n}){let{runBacktestRun:s}=await import("./core-commands-U4IBRRY5.js"),{runBacktestEvents:i,runBacktestGet:r}=await import("./apps-EZB56RHV.js"),c=n[0]||"run";if(c==="run"){let d=n[1],f=n[2];if(!d||!f)throw new Error("usage: backtest run <handle>/<repo> <tool> [--body <json>] [--branch <branch>] [--deployment-id <id>]");await s(t,d,f);return}if(c==="events"){let d=n[1];if(!d)throw new Error("usage: backtest events <handle>/<repo> [--run-id <id>] [--limit <n>]");await i(t,d);return}if(c==="get"){let d=n[1];if(!d)throw new Error("usage: backtest get <handle>/<repo> --run-id <id>");await r(t,d);return}throw new Error("usage: backtest <run|events|get> <handle>/<repo> [args]")}o($,"runBacktestCommand");async function q({options:t,rest:n}){let{runDeployWatch:s}=await import("./core-commands-U4IBRRY5.js");if((n[0]||"watch")!=="watch")throw new Error("usage: deploy watch <handle>/<repo> [--branch <branch>]");let r=n[1];if(!r)throw new Error("usage: deploy watch <handle>/<repo> [--branch <branch>]");await s(t,r)}o(q,"runDeployCommand");async function G({options:t,rest:n}){let{runTemplateBranches:s,runTemplateStatus:i,runTemplateUpdate:r}=await import("./core-commands-U4IBRRY5.js"),c=n[0]||"status",d=n[1];if(!d)throw new Error("usage: template <status|branches|update> <handle>/<repo> [--env preview|production]");if(c==="status"){await i(t,d);return}if(c==="branches"){await s(t,d);return}if(c==="update"){await r(t,d);return}throw new Error("usage: template <status|branches|update> <handle>/<repo> [--env preview|production]")}o(G,"runTemplateCommand");async function J({options:t,rest:n}){let{runRepoCreate:s,runRepoPush:i}=await import("./core-commands-U4IBRRY5.js"),r=n[0]||"create";if(r==="create"){await s(t,n.slice(1));return}if(r==="push"){await i(t);return}throw new Error("usage: repo <create|push> [--name <name>] [--path <dir>] [--branch <branch>]")}o(J,"runRepoCommand");async function V({options:t,rest:n}){let{runAppsAgentCreate:s,runAppsAssistant:i,runAppsCodeVisibility:r,runAppsDeploy:c,runAppsEnvGet:d,runAppsEnvSet:f,runAppsList:R,runAppsPerformance:N,runAppsSummary:M,runAppsTools:_,runAppsToolsExecute:D}=await import("./apps-EZB56RHV.js"),u=n[0];if(u==="list"){await R(t);return}if(u==="code-visibility"){let p=n[1];if(!p)throw new Error("usage: apps code-visibility <handle>/<repo> --visibility public|private");await r(t,p);return}if(u==="tools"){if(n[1]==="execute"){let p=n[2],h=n[3],C=n[4];if(!p||!h||!C)throw new Error("usage: apps tools execute <appId> <deploymentId> <tool> [--body <json>]");await D(t,p,h,C);return}await _();return}if(u==="deploy"){let p=n[1];if(!p)throw new Error("usage: apps deploy <handle>/<repo> [--env preview|production] [--watch]");await c(t,p);return}if(u==="env"&&n[1]==="get"){let p=n[2];if(!p)throw new Error("usage: apps env get <handle>/<repo>");await d(t,p);return}if(u==="env"&&n[1]==="set"){let p=n[2];if(!p)throw new Error("usage: apps env set <handle>/<repo> --env <json>");await f(t,p);return}if(u==="performance"){await N(t);return}if(u==="summary"){let p=n[1];if(!p)throw new Error("usage: apps summary <handle>/<repo>");await M(t,p);return}if(u==="assistant"){let p=n[1],h=n[2];if(p!=="plan"&&p!=="performance"||!h)throw new Error("usage: apps assistant <plan|performance> <handle>/<repo> --prompt <text>");await i(t,p,h,n.slice(3));return}if(u==="agent"&&n[1]==="create"){await s(t,n.slice(2));return}throw new Error("usage: apps <list|code-visibility|tools|deploy|env get|env set|performance|summary|assistant|agent create> [args]")}o(V,"runAppsCommand");export{x as a,X as b,Y as c,b as d,ae as e,re as f,w as g,ie as h,se as i,pe as j,B as k};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as M,b as x,c as A}from"./chunk-KO3HNMLJ.js";import{Ea as q,Fa as U,Ia as T,Ja as $,La as j,Oa as D,Ra as O,Sa as K,Ta as z,Ua as _,Va as G,la as P}from"./chunk-XMKCCLGB.js";import{e as w,l as c}from"./chunk-WN3V6KDN.js";import{Hb as R,Kb as H,Ob as C,v as k}from"./chunk-Y4OWBBDD.js";import{B as I,Cb as h,Db as b,Ua as v,Xa as E,Ya as y,db as S}from"./chunk-ACYFMLWG.js";import{b as a}from"./chunk-ES2ISFJC.js";import{a as p}from"./chunk-FTQLQJQV.js";var L=a.string().regex(/^[a-f0-9]{64}$/),J=a.object({request:q,maximumCostUsd:a.number().finite().positive().max(1e4),graders:a.array(D).min(1).max(100),admissionRequestHash:L.optional(),sourceExperimentId:a.string().trim().min(1).max(200).optional()}).strict(),X=J.extend({configurationHash:L}).strict(),F=U.extend({configuration:X}).strict();function g(r){return r.policy.kind==="hosted_harness"?{...r,population:r.population.map(({receiptId:e,...t})=>t)}:r}p(g,"experimentConfigurationRequest");function V(r){let e=J.parse(r);return c({...e,request:g(e.request)})}p(V,"experimentRunConfigurationHash");async function Q(r){let e=F.parse(r),{configuration:t,...s}=e,n=await $(s),{configurationHash:o,...i}=t;if(o!==V(i)||c(g(t.request))!==c(g(n.request))||t.maximumCostUsd!==n.manifest.limits.maximumSpendUsd)throw new Error("Experiment configuration differs from its retained run.");if(n.manifest.metadata.experimentDefinition===null){let d=K.parse({definition:null,configurationHash:t.configurationHash,maximumCostUsd:t.maximumCostUsd,graders:t.graders,...t.admissionRequestHash?{admissionRequestHash:t.admissionRequestHash}:{},...t.sourceExperimentId?{sourceExperimentId:t.sourceExperimentId}:{}});if(n.manifest.metadata.experimentConfigurationHash!==c(d))throw new Error("Experiment configuration differs from its admitted manifest.")}return{...n,configuration:t}}p(Q,"verifyExperimentRunDetails");var W=a.object({teamId:a.string().trim().min(1).max(240),items:a.array(a.object({name:a.string().trim().min(1).max(500),source:S,ready:a.boolean(),reason:a.string().min(1).max(2e3).nullable()}).strict()).max(8),nextCursor:a.string().min(1).max(8192).nullable()}).strict(),u=a.string().trim().min(1).max(200),Y=class extends Error{static{p(this,"OpenPondExperimentError")}constructor(r,e,t){super(t),this.status=r,this.code=e,this.name="OpenPondExperimentError"}status;code},we=class{static{p(this,"OpenPondExperimentsClient")}constructor(r){this.options=r;let e=new URL(r.baseUrl);if(!["http:","https:"].includes(e.protocol)||e.username||e.password||e.search||e.hash||!r.apiKey.trim()||!r.teamId.trim())throw new Error("A clean API origin and workspace credentials are required.");this.baseUrl=e.toString().replace(/\/+$/,"")}options;baseUrl;async harnessSources(r={}){let e=r.cursor===void 0?void 0:a.string().min(1).max(8192).parse(r.cursor),t=new URLSearchParams(e?{cursor:e}:{}),s=W.parse(await this.request(`/harness-sources?${t}`,"GET",void 0,r.signal));if(s.teamId!==this.options.teamId||new Set(s.items.map(n=>c(n.source))).size!==s.items.length||s.nextCursor!==null&&s.nextCursor===e||s.items.some(n=>n.ready!==(n.reason===null)))throw new Error("Harness catalog differs from its workspace, readiness or continuation.");return s}async prepareHarness(r,e){let t=z.parse(r),s=_.parse(await this.request("/harness-setup","POST",t,e));T(s.request,s.manifest);let n=s.request.policy;if(s.request.teamId!==this.options.teamId||s.request.operationId!==t.operationId||n.kind!=="hosted_harness"||n.profileRepositoryId!==t.profileRepositoryId||n.source.definitionId!==t.definitionId||n.modelId!==t.modelId||n.reasoningEffort!==t.reasoningEffort||s.maximumCostUsd!==t.maximumCostUsd||s.manifest.limits.maximumSpendUsd!==t.maximumCostUsd)throw new Error("Harness preparation differs from its requested scope or configuration.");return s}async run(r,e){let t=G.parse(r);if(t.request.teamId!==this.options.teamId)throw new Error("Experiment workspace mismatch.");let s=await this.details(await this.request("","POST",t,e));if(c(g(s.request))!==c(g(t.request))||s.configuration.maximumCostUsd!==t.maximumCostUsd||s.configuration.sourceExperimentId!==t.sourceExperimentId||s.configuration.admissionRequestHash!==c(t))throw new Error("Experiment admission differs from its submitted configuration.");if(t.graders&&c(t.graders)!==c(s.configuration.graders.map(n=>({id:n.id,version:n.version,contentHash:n.contentHash,mappings:n.mappings??[]}))))throw new Error("Experiment admission differs from its selected graders or mappings.");return s}async get(r,e={}){return this.details(await this.request(`/${encodeURIComponent(u.parse(r))}`,"GET",void 0,e.signal),r)}async list(r={},e){let t=O.parse(r),s=new URLSearchParams(Object.entries(t).filter(([,i])=>i!==void 0).map(([i,d])=>[i,String(d)])),n=a.object({items:a.array(a.unknown()).max(100),nextCursor:u.nullable()}).strict().parse(await this.request(`?${s}`,"GET",void 0,e)),o=await Promise.all(n.items.map(i=>this.details(i)));if(o.length>t.limit||new Set(o.map(i=>i.summary.id)).size!==o.length||n.nextCursor!==null&&n.nextCursor!==o.at(-1)?.summary.id||o.some(i=>t.projectId&&i.request.project?.id!==t.projectId||t.datasetHash&&i.request.taskset.contentHash!==t.datasetHash||t.status&&i.summary.status!==t.status))throw new Error("Experiment page differs from its selected scope.");return{items:o,nextCursor:n.nextCursor}}async result(r,e){let t=a.object({executionId:u,passId:u.nullable(),manifest:a.unknown(),result:a.unknown()}).strict().parse(await this.request(`/${encodeURIComponent(u.parse(r))}/result`,"GET",void 0,e)),s=h(t);if(t.executionId!==r||s.manifest.teamId!==this.options.teamId||s.manifest.lineage?.execution.id!==r||s.manifest.lineage.scoringPassId!==t.passId)throw new Error("Experiment result identity mismatch.");return{...s,executionId:r,passId:t.passId}}async cancel(r,e){return this.details(await this.request(`/${encodeURIComponent(u.parse(r))}/cancel`,"POST",{},e),r)}async duplicate(r,e,t){let s=await this.details(await this.request(`/${encodeURIComponent(u.parse(r))}/duplicate`,"POST",{operationId:u.parse(e)},t));if(s.request.operationId!==e||s.configuration.sourceExperimentId!==r||s.summary.id===r)throw new Error("Duplicate Experiment admission differs from its source or operation.");return s}async score(r,e){let t=M.parse(r),s=this.pass(await this.request(`/${encodeURIComponent(t.execution.id)}/scoring-passes`,"POST",t,e));if(c(s.request)!==c(t))throw new Error("Scoring admission differs from its submitted inputs.");return s}async scoringPass(r,e){return this.pass(await this.request(`/scoring-passes/${encodeURIComponent(u.parse(r))}`,"GET",void 0,e),r)}async scoringPasses(r,e={}){let t=new URLSearchParams(e.afterId?{afterId:u.parse(e.afterId)}:{});e.executionKind&&t.set("executionKind",a.literal("recorded_evidence").parse(e.executionKind));let s=a.object({items:a.array(a.unknown()).max(30),nextCursor:u.nullable()}).strict().parse(await this.request(`/${encodeURIComponent(u.parse(r))}/scoring-passes?${t}`,"GET",void 0,e.signal)),n=s.items.map(o=>this.pass(o));if(n.some(o=>o.request.execution.id!==r||o.request.executionKind!==e.executionKind)||new Set(n.map(o=>o.id)).size!==n.length)throw new Error("Scoring pass page differs from its execution ownership.");return{items:n,nextCursor:s.nextCursor}}async cancelScoringPass(r,e){return this.pass(await this.request(`/scoring-passes/${encodeURIComponent(u.parse(r))}/cancel`,"POST",{},e),r)}async scoringResult(r,e){let t=a.object({executionId:u,passId:u,manifest:a.unknown(),result:a.unknown()}).strict().parse(await this.request(`/scoring-passes/${encodeURIComponent(u.parse(r))}/result`,"GET",void 0,e)),s=h(t);if(t.passId!==r||s.manifest.teamId!==this.options.teamId||s.manifest.id!==r||s.manifest.lineage?.execution.id!==t.executionId||s.manifest.lineage.scoringPassId!==r)throw new Error("Scoring result identity mismatch.");return{...s,executionId:t.executionId,passId:r}}async compare(r,e,t){let s=p(i=>i.startsWith("score_")?this.scoringResult(i,t):this.result(i,t),"read"),[n,o]=await Promise.all([s(r),s(e)]);return{baseline:n,candidate:o,comparison:b(n,o)}}async details(r,e){let t=await Q(r);if(t.summary.teamId!==this.options.teamId||e&&t.summary.id!==e)throw new Error("Experiment identity mismatch.");return t}pass(r,e){let t=x(r);if(t.teamId!==this.options.teamId||e&&t.id!==e)throw new Error("Scoring pass identity mismatch.");return t}async request(r,e,t,s){let n=await(this.options.fetch??fetch)(`${this.baseUrl}/v1/experiments${r}`,{method:e,signal:s,redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"X-OpenPond-Team-Id":this.options.teamId,"Content-Type":"application/json",Accept:"application/json"},...t===void 0?{}:{body:JSON.stringify(t)}}),o=await n.json();if(!n.ok){let i=a.object({code:a.string(),message:a.string()}).safeParse(o);throw new Y(n.status,i.success?i.data.code:"experiment_request_failed",i.success?i.data.message:"Experiment request failed.")}return o}},l=a.string().trim().min(1).max(500),N=a.string().regex(/^[a-f0-9]{64}$/),Z=a.object({schemaVersion:a.literal("openpond.experimentCaseInspection.v1"),teamId:l,executionId:l,manifestHash:N,receiptId:l,taskId:l,seed:a.string().min(1),input:a.record(a.string(),a.unknown()).nullable(),output:a.unknown().nullable(),error:a.string().nullable(),events:a.array(a.record(a.string(),a.unknown())).max(25),nextEventCursor:l.nullable(),eventCount:a.number().int().nonnegative()}).strict(),ee=Z.extend({contentHash:N}).strict(),Ie=class{static{p(this,"OpenPondExperimentInspectionClient")}constructor(r){this.options=r;let e=new URL(r.baseUrl);if(!["http:","https:"].includes(e.protocol)||e.username||e.password||e.search||e.hash||!r.apiKey.trim()||!r.teamId.trim())throw new Error("A clean API origin and workspace credentials are required.");this.baseUrl=e.toString().replace(/\/+$/,"")}options;baseUrl;async case(r,e,t={}){let s=new URLSearchParams(t.afterId?{afterId:l.parse(t.afterId)}:{}),n=await(this.options.fetch??fetch)(`${this.baseUrl}/v1/experiments/${encodeURIComponent(l.parse(r))}/cases/${encodeURIComponent(l.parse(e))}?${s}`,{signal:t.signal,redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"X-OpenPond-Team-Id":this.options.teamId,Accept:"application/json"}}),o=await n.json();if(!n.ok)throw new Error(a.object({message:a.string()}).parse(o).message);let i=ee.parse(o),{contentHash:d,...m}=i;if(c(m)!==d||i.teamId!==this.options.teamId||i.executionId!==r||i.receiptId!==e||t.manifestHash&&i.manifestHash!==t.manifestHash||i.events.length>i.eventCount)throw new Error("Case inspection differs from its requested workspace, execution or retained content.");return i}};function re(r){return JSON.stringify(r.release?["reward",r.release.id,r.release.revision,r.release.contentHash,r.feedbackKey]:["dataset",r.id,r.version,r.contentHash,r.feedbackKey])}p(re,"datasetGraderIdentity");function te(r){let e=new Map;for(let t of r){let s=re(t),n=e.get(s);n?n.aliases.push(t):e.set(s,{key:s,grader:t,aliases:[t]})}return[...e.values()]}p(te,"groupDatasetGraders");function ve(r){let e=te(r),t=new Map;for(let s of e){let n=t.get(s.grader.feedbackKey);if(n&&n!==s.key)throw new Error(`Different selected grader releases use feedback key "${s.grader.feedbackKey}". Select one, or publish graders with distinct feedback keys.`);t.set(s.grader.feedbackKey,s.key);let o=JSON.stringify(s.grader.mappings??[]);if(s.aliases.some(i=>JSON.stringify(i.mappings??[])!==o))throw new Error(`Aliases of grader "${s.grader.feedbackKey}" have different field mappings. Select one alias and review its mappings.`)}return e.map(s=>s.grader)}p(ve,"canonicalDatasetGraderSelection");function be(r){let e=v(r.binding),t=P(r.packageValue),s=t.taskset;if(s.id!==e.dataset.id||s.revision!==e.dataset.revision||s.contentHash!==e.dataset.contentHash||t.contentHash!==e.packageHash||c(s.environment)!==e.environmentHash||c(t.files.filter(n=>n.asset.visibility!=="policy").map(n=>n.asset))!==e.privateDatasetClosureHash)throw new Error("The selected Dataset package, environment or protected closure changed.");if(e.population.length>500)throw new Error("Select at most 500 exact Dataset cases before starting this bounded Profile evaluation.");for(let n of e.population){let o=s.tasks.find(i=>i.id===n.taskId);if(!o||o.split!==e.split)throw new Error("The selected ordered population is outside its exact Dataset split.");if(n.fixtureId!==null)throw new Error("This recorded cutoff needs an admitted replay fixture before executing the Profile target.")}if(e.gradingSource){if(!r.actualGrading)throw new Error("The actual selected scoring owner is required for this recipe.");let n=x(r.actualGrading.pass),o=h(a.object({manifest:a.unknown(),result:a.unknown()}).strict().parse(r.actualGrading.evidence));if(n.status!=="completed"||n.id!==e.gradingSource.pass.id||n.contentHash!==e.gradingSource.pass.contentHash||o.manifest.id!==e.gradingSource.evidence.id||o.result.contentHash!==e.gradingSource.evidence.contentHash||o.manifest.lineage?.scoringPassId!==n.id||c(o.manifest.dataset)!==c(e.dataset)||c(o.manifest.evaluators)!==c(e.evaluators)||c(e.fieldMappings)!==c(n.graders.map(m=>({graderId:m.id,fields:m.mappings??[]}))))throw new Error("The selected scoring owner changed its exact Dataset, measurements or mappings.");let i=o.manifest.population,d=e.recordedOrigin?e.recordedOrigin.members.map(m=>({caseId:m.caseId,seed:m.seed,fixtureId:m.fixtureId})):e.population.map(m=>({caseId:m.taskId,seed:m.seed,fixtureId:m.fixtureId}));if(i.length!==d.length||i.some((m,B)=>c(m)!==c(d[B])))throw new Error("The selected scoring population differs from the exact ordered original cases and cutoffs.")}else{if(e.fieldMappings.some(i=>!s.graders.some(d=>d.id===i.graderId)))throw new Error("The field mappings name a grader outside the selected release.");for(let i of e.fieldMappings)j.parse(i.fields);let n=e.evaluators.map(i=>{let d=r.graders.find(m=>m.feedbackKey===i.feedbackKey&&c(m.release??{id:m.id,revision:m.version,contentHash:m.contentHash})===c(i.release));if(!d)throw new Error("Select an exact released Dataset grader for this external recipe.");return d});if(e.fieldMappings.some(i=>!n.some(d=>d.id===i.graderId)))throw new Error("Field mappings refer to an unselected grader.");let o=n.map(i=>({release:i.release??{id:i.id,revision:i.version,contentHash:i.contentHash},feedbackKey:i.feedbackKey,configurationHash:c({graderHash:i.contentHash,mappings:e.fieldMappings.find(d=>d.graderId===i.id)?.fields??[]}),output:"score",categories:[]}));if(c(o)!==c(e.evaluators))throw new Error("The external recipe's graders or mappings differ from the current exact released grading settings.");for(let i of r.graders)if(!s.graders.some(d=>d.id===i.id&&d.version===i.version&&c(d)===i.contentHash))throw new Error("External grader pins differ from the actual Dataset implementation.")}for(let n of r.graders)if(!s.graders.some(o=>o.id===n.id&&o.version===n.version&&c(o)===n.contentHash))throw new Error("Dataset-native grader pins differ from their actual implementation.");return t}p(be,"verifyExternalDatasetPackage");var f=a.string().trim().min(1).max(240),se=a.object({profileRef:a.object({source:a.enum(["local","github","openpond_git"]),repositoryId:f,profileId:f}).strict(),sourceRevision:a.string().min(1).max(500),harnessRelease:w,catalogHash:a.string().regex(/^[a-f0-9]{64}$/).nullable(),definitions:a.array(E).max(1e3),suites:a.array(y).max(100),runs:a.array(a.object({profileRef:a.object({source:a.enum(["local","github","openpond_git"]),repositoryId:f,profileId:f}).strict(),manifest:k,metric:I,gradeRefs:a.array(w),receiptRefs:a.array(w),passRate:a.number().min(0).max(1),passed:a.boolean(),completedAt:a.iso.datetime(),contentHash:a.string().regex(/^[a-f0-9]{64}$/)}).strict()).max(1e3),comparisons:a.array(R).max(1e3),suiteRuns:a.array(C).max(1e3),reports:a.array(H).max(1e3)}).strict(),ae=a.object({teamId:f,profileRepositoryId:f,trainingProjectId:f.optional()}).strict(),He=class{static{p(this,"OpenPondProfileEvaluationDiscoveryClient")}constructor(r){this.options=r;let e=new URL(r.baseUrl);if(!["http:","https:"].includes(e.protocol)||e.username||e.password||e.search||e.hash||!r.apiKey.trim()||!r.teamId.trim())throw new Error("Profile discovery requires a scoped HTTP endpoint and owner credential.")}options;async read(r,e){let t=ae.parse({...r,teamId:this.options.teamId}),{response:s,value:n}=await A(this.options.fetch??fetch,`${this.options.baseUrl.replace(/\/$/,"")}/v1/profile-evaluation-discovery`,{method:"POST",redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"X-OpenPond-Team-Id":this.options.teamId,"Content-Type":"application/json"},body:JSON.stringify(t),signal:e},(i,d,m)=>new Error(m));if(!s.ok)throw new Error("The released Profile evaluation owner is unavailable to this account and workspace.");let o=se.parse(n);if(o.profileRef.repositoryId!==t.profileRepositoryId)throw new Error("Profile discovery returned another source owner.");return o}};export{Y as a,we as b,Ie as c,ve as d,be as e,He as f};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as H,d as Q,f as X}from"./chunk-TRQQNFMO.js";import{a as ee}from"./chunk-FEAKTSRS.js";import{a as re}from"./chunk-P2RSBSCT.js";import{d as ae,i as oe,j as ie}from"./chunk-2L5XWJJ5.js";import{d as te}from"./chunk-PH6IORGZ.js";import{I as Y,K as Z}from"./chunk-VGRMAGOK.js";import{o as se,s as b}from"./chunk-EUMXMT3S.js";import{Ib as K,ca as P,la as g,xa as U}from"./chunk-XMKCCLGB.js";import{w as G,x as F,z as T}from"./chunk-Y4OWBBDD.js";import{a as j,f as q}from"./chunk-FFRFSDBM.js";import{g as L}from"./chunk-VYLGI3IH.js";import{Ta as N,Ua as y,Wa as W,ab as $,e as _}from"./chunk-ACYFMLWG.js";import{b as R,c as v,d as J,l as S,m as n}from"./chunk-KGNCKIFP.js";import{b as h}from"./chunk-ES2ISFJC.js";import{a as d}from"./chunk-FTQLQJQV.js";import{randomUUID as V,createHash as fe}from"node:crypto";import{mkdtemp as ue,mkdir as pe,writeFile as D,rm as me}from"node:fs/promises";import he from"node:os";import E from"node:path";var ne=d(async e=>{let a=g(e.packageValue);if(e.grader.runtime!=="sandbox_process")throw new Error("Select the sandbox process runtime for a local file grader.");if(!a.taskset.graders.some(r=>n(r)===n(e.grader)))throw new Error("The private grader differs from its package.");if(!a.taskset.tasks.some(r=>n(r)===n(e.task)))throw new Error("The private case differs from its package.");await e.authorize(),e.signal?.throwIfAborted();let i=await ue(E.join(he.tmpdir(),"profile-private-grade-")),t=V();try{for(let f of a.files.filter(l=>l.asset.visibility!=="policy")){let l=f.asset.path;if(E.isAbsolute(l)||l.split(/[\\/]/).some(u=>!u||u==="."||u===".."))throw new Error("Private grader asset path invalid.");let m=E.join(i,"package",l);await pe(E.dirname(m),{recursive:!0,mode:448}),await D(m,P(f),{mode:256})}await D(E.join(i,"request.json"),JSON.stringify({task:e.task,attempt:e.evidence,input:e.task.input,output:e.evidence.output,artifacts:"artifacts"in e.evidence?e.evidence.artifacts:[],expectedOutput:e.task.expectedOutput}),{mode:256});let r=`import fs from 'node:fs/promises'; const module=await import(${JSON.stringify("./package/"+e.grader.verifierRef.path)}); const result=await module[${JSON.stringify(e.grader.exportName??"verify")}](JSON.parse(await fs.readFile('request.json','utf8'))); console.log(JSON.stringify(result));`;await D(E.join(i,"runner.mjs"),r,{mode:256});let s=await ee({authorize:d(async()=>(await e.authorize(),e.signal?.throwIfAborted(),{candidateId:t,candidateRevision:1,ownerId:t,sessionId:t,turnId:t,sourceRoot:i,writablePaths:[]}),"authorize")})({candidateId:t,sessionId:t,turnId:t,expectedRevision:1,command:"/runtime/node --max-old-space-size=512 runner.mjs",timeoutMs:e.grader.timeoutMs,maxOutputBytes:7e4,signal:e.signal});if(await e.authorize(),e.signal?.throwIfAborted(),s.code!==0||s.timedOut||s.stdoutTruncated||s.stderrTruncated)throw new Error("Private grading sandbox did not complete.");return H.parse(JSON.parse(s.stdout))}finally{await me(i,{recursive:!0,force:!0})}},"executeLocalProfileVerifier");function Me(e){return async a=>{if(!a.manifest)throw new Error("The hosted grader requires its admitted manifest.");await a.authorize(),a.signal?.throwIfAborted();let i="artifacts"in a.evidence&&Array.isArray(a.evidence.artifacts)?a.evidence.artifacts.map(({reference:l,title:m,contentType:u})=>({reference:l,title:m,contentType:u})):[],t="caseOwner"in a.evidence?a.evidence.caseOwner:null;if(!t?.sessionId||!t.turnId)throw new Error("The private grader has no sealed case owner.");let r=Buffer.from(JSON.stringify({manifest:a.manifest,packageValue:a.packageValue,graderId:a.grader.id,taskId:a.task.id,evidence:{...a.evidence,artifacts:i}}));if(r.length>2e7)throw new Error("The private grading package exceeds its transport limit.");let o={callId:V(),sessionId:t.sessionId,turnId:t.turnId,sha256:fe("sha256").update(r).digest("hex"),sizeBytes:r.length,timeoutMs:a.grader.timeoutMs},s=d((l,m=12e4)=>e.request(Z.parse({contractVersion:Y,requestId:V(),operation:"profile-evaluations/grade",params:l}),m),"request");for(let l=0;l<r.length;l+=98304)await a.authorize(),a.signal?.throwIfAborted(),await s({...o,action:"upload",offset:l,contentsBase64:r.subarray(l,l+98304).toString("base64")});let f=await s({...o,action:"execute"},a.grader.timeoutMs+12e4);return await a.authorize(),a.signal?.throwIfAborted(),H.parse(f)}}d(Me,"createHostedProfileVerifier");async function ge(e,a){let i=g(e);for(let r of i.taskset.graders){if(r.kind==="model_judge"&&(!a||r.calibrationStatus!=="passed"))throw new Error("This Profile requires its current calibrated judge and bounded private provider owner.");let o="verifierRef"in r?r.verifierRef:"rubricRef"in r?r.rubricRef:null;o&&A(i,o)}let t=i.taskset.metrics?.customAggregator;if(t){let r=i.files.find(o=>o.asset.path===t.module);if(!r||r.asset.visibility==="policy"||S(P(r))!==t.contentHash)throw new Error("The authored aggregate metric is not its exact private release.");new TextDecoder("utf8",{fatal:!0}).decode(P(r))}}d(ge,"preflightProfilePrivateGrading");function A(e,a){let i=e.files.find(t=>t.asset.id===a.id);if(!i||i.asset.visibility==="policy"||n(i.asset)!==n(a))throw new Error("The exact private grader asset is unavailable.");return new TextDecoder("utf8",{fatal:!0}).decode(P(i))}d(A,"readPrivate");async function $e(e){let a=g(e.packageValue);if(a.contentHash!==e.manifest.packageHash||a.taskset.contentHash!==e.manifest.tasksetRelease.contentHash)throw new Error("The private grading package changed its frozen Run identity.");await e.authorize(),await ge(a,!!e.executeBudgetedJudge),await e.authorize();let i=d(async({grader:o,task:s,evidence:f})=>{let l=e.signal;await e.authorize(),l?.throwIfAborted();let m={manifest:e.manifest,packageValue:a,grader:o,task:s,evidence:f,signal:l,authorize:e.authorize},u=e.executeSandboxVerifier?await e.executeSandboxVerifier(m):o.runtime==="sandbox_process"?await ne(m):await Q({source:A(a,o.verifierRef),exportName:o.exportName,runtime:o.runtime,timeoutMs:o.timeoutMs,signal:l,value:{task:s,attempt:f,input:s.input,output:f.output,artifacts:"artifacts"in f?f.artifacts:[],expectedOutput:s.expectedOutput,infrastructureError:f.infrastructureError??null}});return await e.authorize(),l?.throwIfAborted(),{score:u.score,passed:u.passed,rewardEligible:o.rewardEligible,failureClass:null,feedback:[u.feedback],visibleEvidenceRefs:[],privilegedEvidenceRefs:u.evidenceRefs}},"customVerifier"),t=a.taskset.metrics?.customAggregator,r=t?new TextDecoder("utf8",{fatal:!0}).decode(P(a.files.find(o=>o.asset.path===t.module))):void 0;return{authorize:e.authorize,customVerifier:i,...e.executeBudgetedJudge?{modelJudge:L({readRubric:d(async o=>{await e.authorize();let s=A(a,o);return await e.authorize(),s},"readRubric"),executeBudgeted:d(async(o,s)=>{await e.authorize(),s?.throwIfAborted();let f=await e.executeBudgetedJudge(o,s);return await e.authorize(),s?.throwIfAborted(),f},"executeBudgeted")})}:{},...r!==void 0?{metricSource:r,metricExecutor:d(async o=>{await e.authorize(),o.signal?.throwIfAborted();let s=await X(o);return await e.authorize(),o.signal?.throwIfAborted(),s},"metricExecutor")}:{}}}d($e,"createProfilePrivateGradingOwner");import{promises as ve}from"node:fs";import ke from"node:path";async function at(e){let a=e.definition.tasksetRelease,i=await te(e.store,e.harnessRelease);if(!i)throw new Error("Evaluation Profile Harness release is unavailable.");let t=await Re({...e,runtime:i});if(t)return t;let r=await e.store.listTasksetRevisions(e.profileId);for(let o of r){if(a.id!==o.id&&a.id!==`taskset-release-${o.id}-r${o.revision}`)continue;let s=await we(e.storeDir,o);if(s.taskset.id===a.id&&s.taskset.contentHash===a.contentHash)return s}throw new Error(`Released Taskset ${a.id} is unavailable in Profile ${e.profileId}.`)}d(at,"loadLocalProfileEvaluationTaskset");async function we(e,a){let i=a.metadata.importedPackageHash;if(typeof i=="string"){let o=await ie(e,i);if(o.taskset.id!==a.id||o.taskset.revision!==a.revision)throw new Error("Imported evaluation Taskset differs from its local Profile revision.");return o}if(U(a)!==a.contentHash)throw new Error("Authored evaluation Taskset differs from its immutable revision.");let t=K({taskset:a,adapterId:ae(a)}),r=await re({storeDir:e,taskset:a,content:{schemaVersion:"openpond.tasksetPackage.v1",taskset:t.tasksetRelease,environment:t.environmentRelease,verifierSet:t.verifierSetRelease}});return await oe(e,r),r}d(we,"loadCandidate");async function Re(e){let a=e.definition.tasksetRelease,i=e.runtime;if(i.release.harnessRelease.id!==e.harnessRelease.id||i.release.harnessRelease.contentHash!==e.harnessRelease.contentHash)throw new Error("Evaluation Taskset runtime differs from its requested release.");let t=`evals/tasksets/${a.contentHash}.json`,r=i.release.harnessRelease.files.find(o=>o.path===t);if(r){if(r.visibility!=="verifier")throw new Error("Evaluation Taskset package is not verifier-private.");let o=await ve.readFile(ke.join(i.release.bundlePath,"source",...t.split("/")));if(S(o)!==r.contentHash)throw new Error("Released evaluation Taskset package bytes differ from their source receipt.");let s=g(JSON.parse(o.toString("utf8")));if(s.taskset.id!==a.id||s.taskset.contentHash!==a.contentHash)throw new Error("Released evaluation Taskset package differs from its definition.");return s}return null}d(Re,"loadReleasedProfileEvaluationTaskset");function C(e){return{id:W(e),label:"Selected Dataset evaluation",description:"Explicit sealed external Dataset evaluation recipe.",target:e.target,tasksetRelease:{id:e.dataset.id,contentHash:e.dataset.contentHash},split:e.split,taskIds:[...new Set(e.population.map(a=>a.taskId))],seeds:[...new Set(e.population.map(a=>a.seed))],criterion:e.criterion}}d(C,"externalProfileEvaluationDefinition");async function lt(e){let a=e.manifest.profileEvaluation,i=a?.externalDatasetBinding?y(a.externalDatasetBinding):null;if(!i)return null;if(!e.resolveExternalDataset)throw new Error("This owner has no authorized external Dataset resolver.");let t=await e.resolveExternalDataset(i,e.selected);await t.authorize();let r=g(t.packageValue),o=await e.loadCatalog({ref:e.selected.profileRef,sourceRevision:e.selected.sourceRevision,harnessRelease:e.selected.harnessRelease});if(n(t.binding)!==n(i)||i.profileId!==e.selected.profileRef.profileId||i.declaredProfileCatalogHash!==o.catalogHash||r.contentHash!==i.packageHash||n(r.taskset)!==n(e.taskset)||i.environmentHash!==n(r.taskset.environment)||i.privateDatasetClosureHash!==n(r.files.filter(l=>l.asset.visibility!=="policy").map(l=>l.asset)))throw new Error("External Dataset admission changed its actual Profile, package or private closure.");let s=C(i),f={schemaVersion:"openpond.profileEvaluations.v1",definitions:[s],suites:[]};if(T(e.manifest,e.taskset,f),!a||a.catalogHash!==n(f)||a.definitionHash!==n(s)||n(a.target)!==n(i.target))throw new Error("External Dataset manifest changed its derived definition.");return await t.authorize(),{...t,packageValue:r,definition:s,catalog:f}}d(lt,"admitProfileExternalDataset");var Pe=h.object({id:R,createdAt:J,definitionId:R,externalDatasetBinding:N.optional(),profileRef:se.optional(),profileSource:h.object({sourceRevision:h.string().min(1).max(500),harnessRelease:h.object({id:R,contentHash:v}).strict()}).strict().optional(),modelRef:q,hostModelConfigurationHash:v.optional(),hostArtifactHash:v.optional(),maximumSpendUsd:h.number().positive().max(1e4).optional(),expectedManifestHash:v.optional(),hostExperiment:h.object({definition:h.object({id:R,revision:h.number().int().positive(),contentHash:v}).strict().nullable(),configurationHash:v,project:h.object({id:R,revision:h.number().int().positive(),contentHash:v,targetId:R.nullable()}).strict().optional()}).strict().optional()}).strict();function vt(e){return async(a,i)=>{let t=Pe.parse(a);if(i?.requireExpectedManifestHash&&!t.expectedManifestHash)throw new Error("Profile evaluation execution requires the reviewed manifest hash.");if(t.profileSource&&!t.profileRef)throw new Error("An exact Profile source requires its accepted Profile reference.");let r=i?.selectedWorkflows??await e.selectedWorkflows(t.profileRef,t.profileSource);if(t.profileRef&&n(t.profileRef)!==n(r.profileRef))throw new Error("Profile preparation did not resolve the explicitly selected Profile.");if(t.profileSource&&(r.sourceRevision!==t.profileSource.sourceRevision||n(r.harnessRelease)!==n(t.profileSource.harnessRelease)))throw new Error("Profile preparation changed its explicitly pinned source.");let o=t.externalDatasetBinding?y(t.externalDatasetBinding):null,s=o?await(e.resolveExternalDataset?e.resolveExternalDataset(o,r):Promise.reject(new Error("This host has not qualified external Dataset Profile execution."))):null;if(s&&(await s.authorize(),n(y(s.binding))!==n(o)))throw new Error("External Dataset admission differs from the actual authorized recipe.");let f=await e.loadCatalog({ref:r.profileRef,sourceRevision:r.sourceRevision,harnessRelease:r.harnessRelease});if(o&&o.declaredProfileCatalogHash!==f.catalogHash)throw new Error("The original Profile verifier catalog changed.");let l=o?C(o):null;if(l&&t.definitionId!==l.id)throw new Error("Use the external recipe's own definition identity.");let m={schemaVersion:"openpond.profileEvaluations.v1",definitions:l?[l]:f.definitions,suites:l?[]:f.suites},u=l??f.definitions.find(c=>c.id===t.definitionId);if(!u)throw new Error(`Evaluation ${t.definitionId} is absent from the selected Profile release.`);let k=u.target,z=k.kind==="workflow"?r.workflows.find(c=>c.binding.workflowId===k.workflowId)?.binding:_.parse({schemaVersion:"openpond.profileComponentBinding.v1",profileId:r.profileRef.profileId,sourceRevision:r.sourceRevision,harnessRelease:r.harnessRelease,target:k});if(!z)throw new Error(`Evaluation workflow ${k.kind==="workflow"?k.workflowId:""} is absent from the selected Profile release.`);let w=g(s?.packageValue??await e.loadTasksetPackage(u,r.profileRef.profileId,r.harnessRelease)),p=w.taskset;if(p.id!==u.tasksetRelease.id||p.contentHash!==u.tasksetRelease.contentHash)throw new Error("Evaluation Taskset package differs from its released definition.");let le=p.environment.kind==="text"&&p.tools.length===0,M=p.environment.kind==="work"&&p.environment.entrypoint==="openpond-work-v1"&&p.tools.every(c=>["work_exec","work_save_output"].includes(c.name));if(!le&&!M)throw new Error("Profile evaluation supports text cases or Work cases with the built-in execution and output tools.");if(t.maximumSpendUsd!==void 0&&M&&!e.boundedWorkComputeAvailable)throw new Error("This host has not admitted budgeted Work compute.");if(p.tasks.some(c=>c.artifactRefs.length>b.maxAttachments||c.artifactRefs.some(x=>x.visibility!=="policy"||x.mediaType!=="application/pdf"||x.sizeBytes>b.maxAttachmentBytes)))throw new Error("Profile evaluation accepts only bounded policy-visible PDF task attachments.");if(!o&&!e.privateGradingPreflight&&(p.graders.some(c=>c.kind==="model_judge"||c.kind==="custom_verifier")||p.metrics?.aggregation==="custom"))throw new Error("Profile evaluation cannot run this Taskset's model judge, custom verifier, or custom metric in the current app-server runtime.");await e.privateGradingPreflight?.(w);let B={adapterId:k.kind==="workflow"?"openpond.profile-workflow":"openpond.profile-component",placement:e.placement,runtimeVersion:"app-server-v1",capabilityReceipt:n({adapterId:k.kind==="workflow"?"openpond.profile-workflow":"openpond.profile-component",packageHash:w.contentHash,connectedAppScopes:p.policy.connectedAppScopes})},ce={...$({catalog:m,definitionId:u.id,profileId:r.profileRef.profileId,sourceRevision:r.sourceRevision,harnessRelease:r.harnessRelease,environmentHash:n({packageHash:w.contentHash,runtimeTarget:B})}),...o?{externalDatasetBinding:o}:{},...e.sourceCandidate?{sourceCandidate:e.sourceCandidate}:{}};if(o&&(o.packageHash!==w.contentHash||o.environmentHash!==n(p.environment)||o.privateDatasetClosureHash!==n(w.files.filter(c=>c.asset.visibility!=="policy").map(c=>c.asset))))throw new Error("External Dataset package/environment/private closure changed.");let de=j.parse({provider:t.modelRef.providerId,model:t.modelRef.modelId,revision:null,artifactHash:t.hostArtifactHash??null,tokenizerRevision:null,chatTemplateHash:null}),O=await e.modelConfigurationHash(t.modelRef,t),I=G({schemaVersion:"openpond.tasksetRunManifest.v1",id:t.id,tasksetRelease:u.tasksetRelease,packageHash:w.contentHash,execution:{kind:"harness",harnessRelease:r.harnessRelease},profileEvaluation:ce,policy:{kind:"model",model:de,configurationHash:O},gradingRole:"evaluation",metricPolicy:F(p),population:o?o.population.map(c=>({...c,receiptId:`evaluation-${n([t.id,c.taskId,c.seed,c.fixtureId]).slice(0,32)}`})):u.taskIds.flatMap(c=>u.seeds.map(x=>({receiptId:`evaluation-${n([t.id,c,x]).slice(0,32)}`,taskId:c,seed:x,fixtureId:null}))),runtimeTarget:B,limits:{maxTurns:128,timeoutMs:p.environment.defaultTimeoutMs,maxOutputBytes:25e7,maximumSpendUsd:t.maximumSpendUsd??null},createdAt:t.createdAt,metadata:{sourceTasksetId:p.metadata.sourceTasksetId??p.id,...r.profileRef.source==="openpond_git"?{profileRepositoryId:r.profileRef.repositoryId}:{},...t.hostExperiment?{experimentDefinition:t.hostExperiment.definition,experimentConfigurationHash:t.hostExperiment.configurationHash,...t.hostExperiment.project?{project:t.hostExperiment.project}:{}}:{}}});if(T(I,p,m),s&&await s.authorize(),t.expectedManifestHash&&I.contentHash!==t.expectedManifestHash)throw new Error("Profile evaluation setup changed since preview; prepare the run again.");return{manifest:I,taskset:p,profileRef:r.profileRef,binding:z,modelRef:t.modelRef,modelConfigurationHash:O}}}d(vt,"createProfileEvaluationRunPreparationService");export{ne as a,Me as b,ge as c,$e as d,at as e,Re as f,lt as g,vt as h};
|