openpond 0.2.55 → 0.2.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app-server.d.ts +10545 -10254
- package/dist/app-server.js +1 -1
- package/dist/chunks/actions-command-QU4H53OG.js +2 -0
- package/dist/chunks/{app-layer-Y2UERCPY.js → app-layer-NSTE5HIT.js} +1 -1
- package/dist/chunks/app-server-connected-apps-JHGWLBXT.js +2 -0
- package/dist/chunks/app-server-evaluations-GJPFWIDA.js +2 -0
- package/dist/chunks/app-server-harness-services-IH4G6POY.js +2 -0
- package/dist/chunks/app-server-runtime-DVKOZ5B6.js +2 -0
- package/dist/chunks/apps-BKTOR4F7.js +2 -0
- package/dist/chunks/chunk-25MBPJVY.js +2 -0
- package/dist/chunks/chunk-2D4Y3HNW.js +2 -0
- package/dist/chunks/chunk-2IHO4GDJ.js +2 -0
- package/dist/chunks/chunk-2QUCCP6Z.js +2 -0
- package/dist/chunks/chunk-3K4VVB7S.js +6 -0
- package/dist/chunks/chunk-3QIB5FXI.js +10 -0
- package/dist/chunks/chunk-3RCRSMWZ.js +17 -0
- package/dist/chunks/chunk-3VUATFZD.js +2 -0
- package/dist/chunks/chunk-3Z47M3YY.js +2 -0
- package/dist/chunks/{chunk-UA5DA5I2.js → chunk-4D7HWVWD.js} +1 -1
- package/dist/chunks/chunk-4EPSHPZL.js +2 -0
- package/dist/chunks/chunk-4NESNOK5.js +2 -0
- package/dist/chunks/chunk-523TE4BI.js +2 -0
- package/dist/chunks/{chunk-B7QDZPNX.js → chunk-5MCNZCVQ.js} +1 -1
- package/dist/chunks/{chunk-DLVPSCTB.js → chunk-6QSSIT62.js} +1 -1
- package/dist/chunks/chunk-6ZFPQYHG.js +2 -0
- package/dist/chunks/chunk-74IIXVAE.js +2 -0
- package/dist/chunks/chunk-74ZXXBGN.js +6 -0
- package/dist/chunks/chunk-773TH7FN.js +2 -0
- package/dist/chunks/chunk-7E6T7GP5.js +2 -0
- package/dist/chunks/chunk-7ED24PP6.js +2 -0
- package/dist/chunks/chunk-7HPDGZOR.js +86 -0
- package/dist/chunks/chunk-7KWD2I6W.js +2 -0
- package/dist/chunks/chunk-7PXZ4X4P.js +2 -0
- package/dist/chunks/chunk-A6USMRWK.js +2 -0
- package/dist/chunks/chunk-ABD5M2D2.js +2 -0
- package/dist/chunks/chunk-ACYFMLWG.js +10 -0
- package/dist/chunks/chunk-AN525SPP.js +6 -0
- package/dist/chunks/chunk-APB2STJK.js +2 -0
- package/dist/chunks/chunk-AY64VY4E.js +2 -0
- package/dist/chunks/{chunk-G6JMQGX7.js → chunk-B7RFL4N2.js} +1 -1
- package/dist/chunks/chunk-BLXEAZCQ.js +12 -0
- package/dist/chunks/chunk-D74JEERO.js +5 -0
- package/dist/chunks/{chunk-U2YMBCX7.js → chunk-DARVPBZ4.js} +1 -1
- package/dist/chunks/chunk-DBK66CJP.js +8 -0
- package/dist/chunks/chunk-DDMZSZFL.js +1 -0
- package/dist/chunks/chunk-DIO5CB6U.js +2 -0
- package/dist/chunks/chunk-DMFUEUAZ.js +5 -0
- package/dist/chunks/chunk-DMVD2RFZ.js +2 -0
- package/dist/chunks/chunk-DUURYZOI.js +2 -0
- package/dist/chunks/chunk-DZUAT3TP.js +1 -0
- package/dist/chunks/chunk-EIEZHFIW.js +6 -0
- package/dist/chunks/chunk-EIRYMSEG.js +19 -0
- package/dist/chunks/{chunk-R27YGT77.js → chunk-EKM2D7JU.js} +1 -1
- package/dist/chunks/chunk-EQFGBL3O.js +2 -0
- package/dist/chunks/chunk-EYPCBBMS.js +2 -0
- package/dist/chunks/chunk-F4KOGISR.js +10 -0
- package/dist/chunks/chunk-F74GBN6K.js +2 -0
- package/dist/chunks/chunk-FEAKTSRS.js +2 -0
- package/dist/chunks/chunk-FFRFSDBM.js +2 -0
- package/dist/chunks/chunk-FTEOCCPB.js +23 -0
- package/dist/chunks/chunk-FUOEIDMA.js +8 -0
- package/dist/chunks/{chunk-BQAF5P7K.js → chunk-FV2R5RUN.js} +2 -2
- package/dist/chunks/chunk-FWIPHEVA.js +12 -0
- package/dist/chunks/chunk-FY5KHLMW.js +2 -0
- package/dist/chunks/chunk-G3RXYI2L.js +6 -0
- package/dist/chunks/chunk-GJ2ZJFDD.js +2 -0
- package/dist/chunks/chunk-GLDYJM7O.js +1 -0
- package/dist/chunks/chunk-GPVCOEUH.js +2 -0
- package/dist/chunks/chunk-GW766ZSO.js +5 -0
- package/dist/chunks/chunk-GWCHDF2C.js +4 -0
- package/dist/chunks/chunk-GZ7M5XBP.js +2 -0
- package/dist/chunks/chunk-H6IW2R22.js +140 -0
- package/dist/chunks/chunk-HCYX6RHP.js +2 -0
- package/dist/chunks/chunk-HDL5YSAA.js +2 -0
- package/dist/chunks/chunk-HIOKCIL7.js +2 -0
- package/dist/chunks/{chunk-IODUCRBA.js → chunk-HY3GOBFJ.js} +1 -1
- package/dist/chunks/chunk-HZEIRHEB.js +2 -0
- package/dist/chunks/chunk-I2NXNMRZ.js +2 -0
- package/dist/chunks/chunk-I7AQMAQI.js +33 -0
- package/dist/chunks/chunk-IZ6DLEVY.js +2 -0
- package/dist/chunks/chunk-J2TWKFML.js +1871 -0
- package/dist/chunks/chunk-JDEEWOD7.js +2 -0
- package/dist/chunks/chunk-JFXWI3EN.js +6 -0
- package/dist/chunks/chunk-JYKRR7E5.js +5 -0
- package/dist/chunks/chunk-KCJVFLBB.js +2 -0
- package/dist/chunks/{chunk-5CMKGD43.js → chunk-KG325WTN.js} +1 -1
- package/dist/chunks/chunk-KUERKVEU.js +3 -0
- package/dist/chunks/chunk-KVTBX2UP.js +2 -0
- package/dist/chunks/chunk-L3KS6MOV.js +2 -0
- package/dist/chunks/chunk-L6K7ERG5.js +2 -0
- package/dist/chunks/{chunk-MH3LHSGX.js → chunk-LQQNBVEB.js} +1 -1
- package/dist/chunks/{chunk-BTI4N7YO.js → chunk-M4JWQSV7.js} +1 -1
- package/dist/chunks/chunk-MQULU465.js +2 -0
- package/dist/chunks/chunk-N4FFQPLR.js +2 -0
- package/dist/chunks/chunk-N73MU2C3.js +2 -0
- package/dist/chunks/chunk-NHQ36THU.js +3 -0
- package/dist/chunks/chunk-O6ULLQJ6.js +2 -0
- package/dist/chunks/chunk-O72BSKSO.js +2 -0
- package/dist/chunks/chunk-OGDADQGH.js +143 -0
- package/dist/chunks/chunk-OIUTWU6K.js +2 -0
- package/dist/chunks/chunk-OLLLZVHF.js +2 -0
- package/dist/chunks/chunk-OPNRWESL.js +3 -0
- package/dist/chunks/chunk-OQKJGTTO.js +4 -0
- package/dist/chunks/chunk-OQPJ7FJF.js +9 -0
- package/dist/chunks/{chunk-TERVLCRG.js → chunk-OS3LO5J3.js} +1 -1
- package/dist/chunks/chunk-OUVIWDL2.js +2 -0
- package/dist/chunks/chunk-PCSIOUHF.js +7 -0
- package/dist/chunks/chunk-PF5R6CMP.js +21 -0
- package/dist/chunks/chunk-PPAPVGJP.js +3 -0
- package/dist/chunks/chunk-PRGBLQVH.js +2 -0
- package/dist/chunks/chunk-PSGGOZFM.js +2 -0
- package/dist/chunks/chunk-PUZQU66L.js +2 -0
- package/dist/chunks/{chunk-NOTXPD2T.js → chunk-Q2QL6UWN.js} +1 -1
- package/dist/chunks/chunk-Q4TBTRIG.js +2 -0
- package/dist/chunks/chunk-Q5LEXXJG.js +16 -0
- package/dist/chunks/chunk-QDC4OW3S.js +2 -0
- package/dist/chunks/chunk-QEFHOJFE.js +7 -0
- package/dist/chunks/chunk-QHWGQ3A4.js +5 -0
- package/dist/chunks/chunk-QIKWJ2AA.js +11 -0
- package/dist/chunks/chunk-QNG27G3T.js +6 -0
- package/dist/chunks/chunk-QOGJAQDO.js +3 -0
- package/dist/chunks/chunk-QOTVNQDI.js +4 -0
- package/dist/chunks/{chunk-NNIRIUSY.js → chunk-RAXOSUSW.js} +1 -1
- package/dist/chunks/chunk-RNIAFXMB.js +50 -0
- package/dist/chunks/{chunk-SHQOIROR.js → chunk-S5ESN275.js} +3 -3
- package/dist/chunks/chunk-SDAUS5PY.js +2 -0
- package/dist/chunks/chunk-SDXFLO7J.js +5 -0
- package/dist/chunks/chunk-SH5CBAFC.js +2 -0
- package/dist/chunks/chunk-SWUEFLOH.js +2 -0
- package/dist/chunks/chunk-SYUKES6H.js +3 -0
- package/dist/chunks/chunk-T5AACNJI.js +2 -0
- package/dist/chunks/chunk-TRQQNFMO.js +4 -0
- package/dist/chunks/chunk-TVQAPBLZ.js +2 -0
- package/dist/chunks/chunk-UCPGRPWY.js +2 -0
- package/dist/chunks/chunk-UGL7WF3W.js +2 -0
- package/dist/chunks/chunk-UHFZHBGW.js +2 -0
- package/dist/chunks/{chunk-C6D4WAYN.js → chunk-UKMA4R6X.js} +2 -2
- package/dist/chunks/{chunk-4WEUCGJ3.js → chunk-VRIEKBBH.js} +1 -1
- package/dist/chunks/chunk-VYLGI3IH.js +13 -0
- package/dist/chunks/chunk-W45RKGM6.js +1 -0
- package/dist/chunks/chunk-WJ43MJ3F.js +2 -0
- package/dist/chunks/chunk-WMKYHXVM.js +3 -0
- package/dist/chunks/chunk-WN3V6KDN.js +3 -0
- package/dist/chunks/chunk-X4OSOOSU.js +3 -0
- package/dist/chunks/chunk-XDQMGUWL.js +2 -0
- package/dist/chunks/chunk-XTFPDQMH.js +3 -0
- package/dist/chunks/chunk-XVDFJ3ZF.js +2 -0
- package/dist/chunks/chunk-XW6HGSIT.js +8 -0
- package/dist/chunks/chunk-XXYGGNVM.js +2 -0
- package/dist/chunks/chunk-Y4OWBBDD.js +184 -0
- package/dist/chunks/chunk-YBT2NB32.js +2 -0
- package/dist/chunks/chunk-YCJO3YVD.js +10 -0
- package/dist/chunks/{chunk-QRAKXZOC.js → chunk-YOBN7KTF.js} +6 -6
- package/dist/chunks/chunk-YOQRYNLP.js +2 -0
- package/dist/chunks/chunk-YY7LEQGP.js +2 -0
- package/dist/chunks/chunk-Z4Z5UOZM.js +22 -0
- package/dist/chunks/chunk-Z54O534A.js +3 -0
- package/dist/chunks/chunk-ZCHXGRRU.js +2 -0
- package/dist/chunks/chunk-ZFSHBFG5.js +40 -0
- package/dist/chunks/chunk-ZGTOK7ZK.js +12 -0
- package/dist/chunks/{chunk-Q7AXHFZV.js → chunk-ZRDGQDZL.js} +1 -1
- package/dist/chunks/chunk-ZUJ3XUCP.js +2 -0
- package/dist/chunks/chunk-ZZWAQBA2.js +2 -0
- package/dist/chunks/cli-X25RSO2X.js +2 -0
- package/dist/chunks/configuration-command-6C5UO7GE.js +2 -0
- package/dist/chunks/connected-app-executor-IVLGQP65.js +2 -0
- package/dist/chunks/connected-evidence-GH2ATNEX.js +2 -0
- package/dist/chunks/connection-HTF6CC7M.js +2 -0
- package/dist/chunks/{continual-TTGJ6YTR.js → continual-6CQAMTTR.js} +3 -3
- package/dist/chunks/core-commands-A2DGGIPS.js +2 -0
- package/dist/chunks/datasets-7BNMVJOY.js +2 -0
- package/dist/chunks/desktop-test-3CUHVLXV.js +3 -0
- package/dist/chunks/dist-OMGUJYPD.js +2 -0
- package/dist/chunks/dist-VYC5VMQB.js +2 -0
- package/dist/chunks/{dist-FAJX2UBW.js → dist-ZVJPJLXR.js} +1 -1
- package/dist/chunks/enclave-QS4BUNDU.js +2 -0
- package/dist/chunks/evaluation-coordination-XEF5L7KZ.js +2 -0
- package/dist/chunks/experiment-improvements-KRX2DP27.js +2 -0
- package/dist/chunks/experiments-DFGQYA4O.js +2 -0
- package/dist/chunks/experiments-VFQGE4HC.js +2 -0
- package/dist/chunks/{extension-DWMY6D2R.js → extension-XKXXOP5N.js} +1 -1
- package/dist/chunks/{help-A72QDRNG.js → help-S7THC6IE.js} +1 -1
- package/dist/chunks/host-profile-evaluation-tools-JJQWJUBT.js +2 -0
- package/dist/chunks/host-profile-external-dataset-K3ICDHIP.js +2 -0
- package/dist/chunks/hosted-app-server-composition-BCOO5ANF.js +2 -0
- package/dist/chunks/hosted-experiment-improvement-NFSVS5TU.js +3 -0
- package/dist/chunks/hosted-harness-runtime-723S5ZSH.js +2 -0
- package/dist/chunks/hosted-profile-candidate-2S5LFUWD.js +3 -0
- package/dist/chunks/hosted-profile-compiler-2DQIFSXW.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-control-76BTRTYD.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-inspection-V6Z3A5XJ.js +3 -0
- package/dist/chunks/hosted-profile-evaluation-preparation-IDJYREW3.js +3 -0
- package/dist/chunks/hosted-tasksets-ANAE2PIW.js +2 -0
- package/dist/chunks/human-review-WR777ODH.js +2 -0
- package/dist/chunks/import-MLZUHITH.js +4 -0
- package/dist/chunks/learning-ACEVFL5M.js +2 -0
- package/dist/chunks/local-harness-improvement-runtime-JIQ6ZVDW.js +2 -0
- package/dist/chunks/local-harness-taskset-review-XVYTGAGK.js +2 -0
- package/dist/chunks/local-scope-HVF2GZ5W.js +2 -0
- package/dist/chunks/model-projects-QPO22JPA.js +2 -0
- package/dist/chunks/opchat-T4QTNEIY.js +3 -0
- package/dist/chunks/organizations-75L5DZDV.js +2 -0
- package/dist/chunks/{profile-NOZ6TVXL.js → profile-TFZMUEDR.js} +1 -1
- package/dist/chunks/profile-training-source-6GOT7AHM.js +2 -0
- package/dist/chunks/project-action-payload-7VGL7OER.js +2 -0
- package/dist/chunks/project-agent-6RRO233B.js +2 -0
- package/dist/chunks/published-experiment-source-DZFENAQA.js +2 -0
- package/dist/chunks/refiner-profile-service-UUIWFJVT.js +2 -0
- package/dist/chunks/runtime-A7OZXM43.js +6 -0
- package/dist/chunks/sandbox-command-IU5XFTJP.js +2 -0
- package/dist/chunks/{sandbox-template-LKGBDVJ4.js → sandbox-template-C4V6T36U.js} +1 -1
- package/dist/chunks/saved-work-6BMBFP43.js +2 -0
- package/dist/chunks/send-turn-XTAIS2JN.js +2 -0
- package/dist/chunks/src-CJM6HY5Y.js +326 -0
- package/dist/chunks/{src-ZWJ5IO7A.js → src-LMC3K6LH.js} +1 -1
- package/dist/chunks/standalone-experiment-turn-owner-JCY5LL5R.js +2 -0
- package/dist/chunks/store-chat-workflows-S72HZXQR.js +18 -0
- package/dist/chunks/store-continual-support-reviews-HHA6NX7K.js +7 -0
- package/dist/chunks/store-conversation-serving-KPC62UEY.js +2 -0
- package/dist/chunks/store-create-improve-QV54XIZW.js +40 -0
- package/dist/chunks/store-datasets-RXJ33SUN.js +86 -0
- package/dist/chunks/store-evaluation-results-3F3P527G.js +7 -0
- package/dist/chunks/store-harness-evaluation-review-settings-I2R3HPO3.js +29 -0
- package/dist/chunks/store-harness-memory-VINCZ4GK.js +17 -0
- package/dist/chunks/store-harness-refinement-candidates-EA5KFQPH.js +21 -0
- package/dist/chunks/store-harness-workspaces-XUM4Z66X.js +2 -0
- package/dist/chunks/store-human-review-RAH7WMIP.js +7 -0
- package/dist/chunks/store-learned-preference-migration-validation-4CI2IRUF.js +2 -0
- package/dist/chunks/store-learning-WLG6KFIO.js +2 -0
- package/dist/chunks/store-learning-credentials-WZQJ4HPJ.js +2 -0
- package/dist/chunks/store-local-experiments-5LUJR7GI.js +97 -0
- package/dist/chunks/store-model-batch-review-YEGX327M.js +2 -0
- package/dist/chunks/store-model-configuration-5ZURQATB.js +3 -0
- package/dist/chunks/store-preference-comparison-LV32MHVL.js +6 -0
- package/dist/chunks/store-schedules-VGTEQVKH.js +53 -0
- package/dist/chunks/store-sidebar-file-bookmarks-VB5GTLFY.js +18 -0
- package/dist/chunks/store-sidebar-preferences-GWIOG2NH.js +16 -0
- package/dist/chunks/store-subagents-T7R2Z6TB.js +67 -0
- package/dist/chunks/store-task-inbox-JJTBW76C.js +33 -0
- package/dist/chunks/store-task-inventory-OB3F2APC.js +10 -0
- package/dist/chunks/store-taskset-drafts-EKQWWFYQ.js +9 -0
- package/dist/chunks/store-training-G6YLFSIR.js +70 -0
- package/dist/chunks/store-training-jobs-RC46YBF6.js +19 -0
- package/dist/chunks/store-training-models-6BA43IPP.js +49 -0
- package/dist/chunks/store-usage-IE2U2FD3.js +63 -0
- package/dist/chunks/store-work-evidence-QQDKM5AQ.js +8 -0
- package/dist/chunks/taskset-EQRFQBYM.js +2 -0
- package/dist/chunks/taskset-packages-XC6HEE3K.js +2 -0
- package/dist/chunks/{teams-bot-H7XT23XB.js → teams-bot-EAPGPTHZ.js} +1 -1
- package/dist/chunks/training-UF6RPI4T.js +2 -0
- package/dist/chunks/web-search-CZ3NCLPY.js +2 -0
- package/dist/chunks/workspaces-EKKE5NAC.js +2 -0
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/web/assets/{App-CTlAPuCY.css → App-CaRMZoxo.css} +1 -1
- package/dist/web/assets/App-s-CJswyt.js +154 -0
- package/dist/web/assets/{AppDialog-CPHTPqrx.js → AppDialog-t2Fx5tK3.js} +1 -1
- package/dist/web/assets/{AppTerminalPanel-BVj5Tj93.js → AppTerminalPanel-Dj1Y32oI.js} +2 -2
- package/dist/web/assets/{AppsView-O69zEBY3.js → AppsView-BYE5EBDJ.js} +1 -1
- package/dist/web/assets/{BrowserSidebar-Pr_Kpe8p.js → BrowserSidebar-jhWi4rVm.js} +1 -1
- package/dist/web/assets/{CartesianChart-JPqo6YOf.js → CartesianChart-C1DIx0Ia.js} +1 -1
- package/dist/web/assets/{CollaborationTabs-CAJcQFn2.js → CollaborationTabs-Bdr-HmOL.js} +1 -1
- package/dist/web/assets/{CommandMenu-B-w53n9A.js → CommandMenu-Ux2yOHAc.js} +1 -1
- package/dist/web/assets/{CommunityView-DbZKK8_P.js → CommunityView-DPEeVKFn.js} +1 -1
- package/dist/web/assets/{ComposerCreateImproveStrip-3_083PF4.js → ComposerCreateImproveStrip-CEgh4OtN.js} +1 -1
- package/dist/web/assets/{GetStartedView-D7JGm_6c.js → GetStartedView-CFHP0AaI.js} +1 -1
- package/dist/web/assets/{HostedModelLearningReview-DwgMfZ7_.js → HostedModelLearningReview-D8BGTPVN.js} +1 -1
- package/dist/web/assets/{HostedModelLearningSettings-JRfQadRl.js → HostedModelLearningSettings-JS1S7vNO.js} +1 -1
- package/dist/web/assets/{LabModelVersionDetailPage-BUYflJY_.js → LabModelVersionDetailPage-Dx5Q3xV2.js} +1 -1
- package/dist/web/assets/{LabSkillSidebar-BBiqk7Rf.js → LabSkillSidebar-BxffN-pN.js} +1 -1
- package/dist/web/assets/{LabsRoute-Ci6vUnSd.js → LabsRoute-CyYF8-dw.js} +4 -4
- package/dist/web/assets/{MainChatThread-BQK3oI2N.js → MainChatThread-DZpcFRFl.js} +2 -2
- package/dist/web/assets/MainPane-5DTtwVCk.js +65 -0
- package/dist/web/assets/MainPane-BIM_UJ3q.css +1 -0
- package/dist/web/assets/{MarkdownText-DOdOVFXL.js → MarkdownText-BR4V6lNO.js} +21 -21
- package/dist/web/assets/{NativeSkillSidebar-CRI_ri8z.js → NativeSkillSidebar-DU9IEgIO.js} +1 -1
- package/dist/web/assets/{NewExperienceSwitcher-DhYtfE68.js → NewExperienceSwitcher-mIy6FzCj.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-D8sy1gOz.js → NewProjectDialog-RfTZTHxl.js} +1 -1
- package/dist/web/assets/{OutputsPage-CbWgrhXA.js → OutputsPage-Cr1Spf7S.js} +1 -1
- package/dist/web/assets/{ProjectsPage-DLB67lyA.js → ProjectsPage-CE6QUB-b.js} +1 -1
- package/dist/web/assets/{RightChatPanelStack-ozSKnDyX.js → RightChatPanelStack-T6VRWuHo.js} +1 -1
- package/dist/web/assets/RightSidebarHomePanel-CK0rP3WT.js +1 -0
- package/dist/web/assets/{ScheduledWorkPage-Cafv_QnR.js → ScheduledWorkPage-vOrYv8pp.js} +1 -1
- package/dist/web/assets/SettingsView-DCKVrfjj.js +5 -0
- package/dist/web/assets/SettingsView-Dulr_xlq.css +1 -0
- package/dist/web/assets/{TeamChatView-vIrmXOY_.js → TeamChatView-Bwrjr-vk.js} +2 -2
- package/dist/web/assets/{TerminalOverlay-CAmF__Dq.js → TerminalOverlay-DhPoKZAq.js} +1 -1
- package/dist/web/assets/TrainingCreationPanel-BXHfohNm.js +1 -0
- package/dist/web/assets/{TrainingDraftPanel-D7XZePAk.js → TrainingDraftPanel-C9cRX5qf.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-CYTmp7PG.js → UsageSettingsSection-CrdcSGeW.js} +1 -1
- package/dist/web/assets/WorkSidebarPanel-DSSikNFQ.js +1 -0
- package/dist/web/assets/{WorkspaceDiffPanel-DQGoIjH9.js → WorkspaceDiffPanel-BAFo0CPN.js} +6 -6
- package/dist/web/assets/{WorkspaceEnvironmentMenu-c1pHDskn.js → WorkspaceEnvironmentMenu-BVHAhwnJ.js} +1 -1
- package/dist/web/assets/WorkspaceGitDialogs-CwVoiDQ2.js +1 -0
- package/dist/web/assets/{WorkspaceMonacoEditor-BCKzvSj2.js → WorkspaceMonacoEditor-TxLyhzNp.js} +3 -3
- package/dist/web/assets/{arrow-up-right-CP4hZdrJ.js → arrow-up-right-C9aE8Mfz.js} +1 -1
- package/dist/web/assets/{chunk-NOJECMB7-Bhcms-w5.js → chunk-P3BRSSRD-DUGfuKA8.js} +1 -1
- package/dist/web/assets/{clipboard-BgrXorn-.js → clipboard-Dk158Qp4.js} +1 -1
- package/dist/web/assets/{cloud-upload-B_zYztb6.js → cloud-upload-k9eqBsHr.js} +1 -1
- package/dist/web/assets/{cssMode-DanjGgA8.js → cssMode-CO35ARZp.js} +1 -1
- package/dist/web/assets/{folder-open-CdVKbtGq.js → folder-open-sYgceW_f.js} +1 -1
- package/dist/web/assets/{folder-plus-Cc5KElB6.js → folder-plus-CS0R49m9.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-CjGIIgRi.js → git-commit-horizontal-DrGxH2h4.js} +1 -1
- package/dist/web/assets/{htmlMode-DRGDF_UL.js → htmlMode-REMmzdfq.js} +1 -1
- package/dist/web/assets/index-3iPNbbER.css +1 -0
- package/dist/web/assets/{index-BE-wXZ5R.js → index-C8aCGagb.js} +2 -2
- package/dist/web/assets/{info-BLj0RvhA.js → info-DLdbiUrh.js} +1 -1
- package/dist/web/assets/{jsonMode-CCu0j2GD.js → jsonMode-KEdMfkIf.js} +1 -1
- package/dist/web/assets/{lspLanguageFeatures-s_Lhm7P6.js → lspLanguageFeatures-5KZwEoxW.js} +1 -1
- package/dist/web/assets/{minimize-2-Cyg_zD9z.js → minimize-2-CqcI4zcM.js} +1 -1
- package/dist/web/assets/{monaco.contribution-CY7mRgOB.js → monaco.contribution-BJGj65F9.js} +2 -2
- package/dist/web/assets/{monaco.contribution-CAzXvYkn.js → monaco.contribution-Cly9Wt7L.js} +2 -2
- package/dist/web/assets/{monaco.contribution-mUPNK9ra.js → monaco.contribution-DO10L0zW.js} +2 -2
- package/dist/web/assets/{monaco.contribution-aUeLcBEg.js → monaco.contribution-omszXBEj.js} +2 -2
- package/dist/web/assets/{monitor-DZvOs_wC.js → monitor-BFVCcbxp.js} +1 -1
- package/dist/web/assets/{play-BJPzemuY.js → play-C469pVZq.js} +1 -1
- package/dist/web/assets/{python-B_qnnVaG.js → python-Dw0YcVy9.js} +1 -1
- package/dist/web/assets/{save-BDy9tA3E.js → save-CtSjPydi.js} +1 -1
- package/dist/web/assets/{square-Cb2c5td4.js → square-BuImvLhT.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-MhO1JLyR.js → toggleHighContrast-DjCO9lIP.js} +1 -1
- package/dist/web/assets/{tsMode-DfBXJb9V.js → tsMode-BAOnxKd6.js} +1 -1
- package/dist/web/assets/{upload-D56kThRh.js → upload-2JkFZo3h.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules-DMnGfswi.js → useLocalAgentSchedules-BNqAisfS.js} +1 -1
- package/dist/web/assets/useProviderSettings-C4L4wDoh.js +5 -0
- package/dist/web/assets/{useProviderSettings-Bw-csWbH.css → useProviderSettings-CmL_BaxP.css} +1 -1
- package/dist/web/assets/{useSessionTurnCache-ClAY8gze.js → useSessionTurnCache-BHU2-Jmz.js} +1 -1
- package/dist/web/assets/{wifi-off-C9lWJmVm.js → wifi-off-CpOAH62M.js} +1 -1
- package/dist/web/assets/{workers-BYzrH8by.js → workers-0QvlA2T5.js} +1 -1
- package/dist/web/assets/{yaml-D3T8UkT3.js → yaml-BK3qxo7D.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/chunks/actions-command-WTFZA7LF.js +0 -2
- package/dist/chunks/app-server-runtime-2RM3N4I6.js +0 -2
- package/dist/chunks/apps-KDNWYO3G.js +0 -2
- package/dist/chunks/chunk-2DFR7PJ4.js +0 -2460
- package/dist/chunks/chunk-4CRM2ADK.js +0 -2
- package/dist/chunks/chunk-55G6B54U.js +0 -6
- package/dist/chunks/chunk-73G5UYBB.js +0 -12
- package/dist/chunks/chunk-ARQEJOEK.js +0 -33
- package/dist/chunks/chunk-CGBI2VYJ.js +0 -2
- package/dist/chunks/chunk-GGIG3XU7.js +0 -3
- package/dist/chunks/chunk-JIMU3KDA.js +0 -24
- package/dist/chunks/chunk-JUJSA7KI.js +0 -22
- package/dist/chunks/chunk-K5SBVO3B.js +0 -195
- package/dist/chunks/chunk-KD3QVRIJ.js +0 -21
- package/dist/chunks/chunk-L4235TRQ.js +0 -140
- package/dist/chunks/chunk-MVF3F5QS.js +0 -2
- package/dist/chunks/chunk-OULAKUIN.js +0 -2
- package/dist/chunks/chunk-OWNLDB2O.js +0 -2
- package/dist/chunks/chunk-QDHMP5FS.js +0 -2
- package/dist/chunks/chunk-QKD5OMDI.js +0 -2
- package/dist/chunks/chunk-R2BSIRYL.js +0 -3
- package/dist/chunks/chunk-STDMBJOQ.js +0 -9
- package/dist/chunks/chunk-T4QGDQHP.js +0 -4
- package/dist/chunks/chunk-USMZT5FZ.js +0 -18
- package/dist/chunks/chunk-VJEZPDBS.js +0 -5
- package/dist/chunks/chunk-WDFLCNRC.js +0 -8
- package/dist/chunks/chunk-WZYRAR7X.js +0 -16
- package/dist/chunks/chunk-YDT7L3VZ.js +0 -24
- package/dist/chunks/chunk-YUPBAWBJ.js +0 -554
- package/dist/chunks/cli-465VC2WP.js +0 -2
- package/dist/chunks/configuration-command-LAAP2EXT.js +0 -2
- package/dist/chunks/connected-evidence-XM626247.js +0 -2
- package/dist/chunks/core-commands-W7EK552V.js +0 -2
- package/dist/chunks/datasets-QJWYTTQL.js +0 -2
- package/dist/chunks/desktop-test-3B2D34NF.js +0 -3
- package/dist/chunks/dist-HUAE2KFZ.js +0 -2
- package/dist/chunks/evaluation-coordination-2MONR4AX.js +0 -2
- package/dist/chunks/experiment-improvements-WVQ5FK46.js +0 -2
- package/dist/chunks/experiments-S5UQ32QB.js +0 -2
- package/dist/chunks/hosted-experiment-improvement-2OWOQLHC.js +0 -3
- package/dist/chunks/hosted-harness-runtime-TGFMAV7W.js +0 -2
- package/dist/chunks/hosted-profile-candidate-WQSI6HZO.js +0 -3
- package/dist/chunks/hosted-profile-compiler-Z2A4TEA6.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-control-FKGARUEE.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-inspection-QOY2JKV4.js +0 -3
- package/dist/chunks/hosted-profile-evaluation-preparation-WVP6CALP.js +0 -3
- package/dist/chunks/human-review-TGHQKXFZ.js +0 -2
- package/dist/chunks/import-4UE5XNSG.js +0 -4
- package/dist/chunks/learning-R2XBMMEM.js +0 -2
- package/dist/chunks/opchat-WULL6CUP.js +0 -3
- package/dist/chunks/organizations-I37HISVX.js +0 -2
- package/dist/chunks/project-agent-T6XKC54C.js +0 -2
- package/dist/chunks/sandbox-command-STB47FRY.js +0 -2
- package/dist/chunks/src-T3KWWCAH.js +0 -322
- package/dist/chunks/taskset-RNYDR4GS.js +0 -2
- package/dist/chunks/training-M6FAPRSJ.js +0 -2
- package/dist/chunks/workspaces-MFZ3OO6O.js +0 -2
- package/dist/web/assets/App-CLFfy_Av.js +0 -154
- package/dist/web/assets/MainPane-D3ojiN-p.js +0 -18
- package/dist/web/assets/MainPane-DOWsSew1.css +0 -1
- package/dist/web/assets/RightSidebarHomePanel-CKs3OwhD.js +0 -1
- package/dist/web/assets/SettingsView-BnANbPLS.css +0 -1
- package/dist/web/assets/SettingsView-T1vYDPjh.js +0 -5
- package/dist/web/assets/TrainingCreationPanel-D75K0yk5.js +0 -1
- package/dist/web/assets/WorkSidebarPanel-CODMjVHY.js +0 -1
- package/dist/web/assets/WorkspaceGitDialogs-DrVtapQQ.js +0 -1
- package/dist/web/assets/index-B5re-RJy.css +0 -1
- package/dist/web/assets/useProviderSettings-Bv5B9eNk.js +0 -5
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{i as a,j as b,k as c}from"./chunk-SHQOIROR.js";import"./chunk-4CRM2ADK.js";import"./chunk-C6D4WAYN.js";import"./chunk-VJEZPDBS.js";import"./chunk-OSIO7PLX.js";import"./chunk-STDMBJOQ.js";import"./chunk-2DFR7PJ4.js";import"./chunk-5CMKGD43.js";import"./chunk-4WEUCGJ3.js";import"./chunk-MVF3F5QS.js";import"./chunk-L4235TRQ.js";import"./chunk-BFKYRQMA.js";import"./chunk-DLVPSCTB.js";import"./chunk-WDFLCNRC.js";import"./chunk-JIMU3KDA.js";import"./chunk-6MI4KKWF.js";import"./chunk-QDHMP5FS.js";import"./chunk-YDT7L3VZ.js";import"./chunk-6FA3GG5B.js";import"./chunk-YR5ID2SS.js";import"./chunk-55G6B54U.js";import"./chunk-KD3QVRIJ.js";import"./chunk-ARQEJOEK.js";import"./chunk-JUJSA7KI.js";import"./chunk-KGNCKIFP.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import"./chunk-FTQLQJQV.js";export{a as resolveWebLaunchMessages,c as runOpenPondAppServerCli,b as runOpenPondServerCli};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as f}from"./chunk-BTI4N7YO.js";import"./chunk-BQAF5P7K.js";import"./chunk-3M53YXEI.js";import{H as J,W as N,X as q,_ as k,aa as A,b as d,ba as B,c as w,e as b,ea as H,fa as I,na as E,oa as M,p as C,pa as T,r as m,s as j,t as x,u as F,v,w as P}from"./chunk-ARQEJOEK.js";import"./chunk-JUJSA7KI.js";import"./chunk-KGNCKIFP.js";import"./chunk-ES2ISFJC.js";import{d as O,f as S,h as g}from"./chunk-H7IWJN7L.js";import{a as l}from"./chunk-FTQLQJQV.js";import R from"node:path";import{readFile as p}from"node:fs/promises";var n=l((t,s)=>typeof t[s]=="string"?t[s]:void 0,"stringOption");function a(t){console.log(JSON.stringify(t,null,2))}l(a,"print");function U(t,s){let i=n(t,"keyPath");if(i){let r=JSON.parse(i);if(Array.isArray(r)&&r.length&&r.every(c=>typeof c=="string"&&c.length))return r;throw new f("--key-path must be a JSON array of key segments.")}if(!s)throw new f("Specify a setting key, or --key-path for keys containing dots.");return s.split(".")}l(U,"keyPath");async function G(t,s){let i=S({home:n(t,"home")}),r=s[0]??"get",c=g(i).config;if(r==="path"){console.log(c);return}if(r==="export"){let e=await T(i),o=n(t,"file");o?(await b(R.resolve(o),JSON.stringify(e,null,2),{privateParent:!1}),a({path:R.resolve(o),requiresRebinding:e.requiresRebinding})):a(e);return}if(r==="backup"||r==="restore"){let e=n(t,"file"),o=n(t,"keyFile");if(!e||!o)throw new f(`config ${r} requires --file <encrypted-backup> and --key-file <separate-32-byte-key-file>.`);let u=await p(o),y=u.length===32?u:Buffer.from(u.toString("utf8").trim(),"base64");try{a(r==="backup"?await E(i,e,y):await M(e,i,y))}finally{y.fill(0),u.fill(0)}return}if(r==="collect-orphans"){a(await N(i));return}if(r==="schema"){a(F());return}if(r==="migrate"){let e=n(t,"resolutionFile"),o=e?q.parse(JSON.parse(await p(e,"utf8"))):void 0;a(await k(i,{resolutions:o,sourceAppHome:n(t,"sourceAppHome"),sourceConfig:n(t,"sourceConfig"),sourceBrowserState:n(t,"sourceBrowserState"),dryRun:t.dryRun===!0||t.dryRun==="true"}));return}if(r==="recover"){let e=n(t,"revision");a(e?await x(i,e,n(t,"expectedRevision")??d(await w(c))):await A(i));return}if(r==="restart-migration"){a(await B(i));return}if(r==="effective"){a(await I(i,{projectRoot:n(t,"projectRoot"),accountId:n(t,"accountId")}));return}if(r==="trust"||r==="untrust"){let e=n(t,"projectRoot")??s[1];if(!e)throw new f("Specify the canonical project root with --project-root.");await H(i,e,n(t,"accountId")??"local",r==="trust"),a({root:e,trusted:r==="trust"});return}if(r==="revisions"){a(await m(i));return}if(r==="validate"){let e=n(t,"file")??c;C(await p(e,"utf8"),e,t.project===!0||t.project==="true"?"project":"user"),a({valid:!0,path:e});return}if(r==="replace"){let e=n(t,"file");if(!e)throw new f("config replace requires --file <validated-toml-file>.");a(await j(i,n(t,"expectedRevision")??d(await w(c)),await p(e,"utf8")));return}if(r==="doctor"){let e=await w(c),o=null;try{await v(i)}catch(u){o=O(u,c)}a({home:i,path:c,rawRevision:d(e),issue:o,recoverableRevisions:await m(i),migration:await w(R.join(g(i).runtime,"migration.json"))!==null}),o&&(process.exitCode=1);return}if(await k(i),r==="clear-cache"){await J(i),a({cleared:!0,path:g(i).cache});return}let h=await v(i);if(r==="get"){if(!s[1]&&!t.keyPath){a(h);return}let e=h.document;for(let o of U(t,s[1]))e=e&&typeof e=="object"?e[o]:void 0;a(e??null);return}if(r==="set"||r==="unset"){let e=U(t,s[1]),o;if(r==="set"){let u=n(t,"value")??s[2];if(u===void 0)throw new f("config set requires a value. Use JSON for arrays, tables, numbers and booleans.");try{o=JSON.parse(u)}catch{o=u}}a(await P(i,n(t,"expectedRevision")??h.rawRevision,[r==="set"?{op:"set",path:e,value:o}:{op:"unset",path:e}]));return}throw new f(`Unknown config command: ${r}`)}l(G,"runConfigurationCommand");export{G as runConfigurationCommand};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as w,b as u}from"./chunk-G6JMQGX7.js";import"./chunk-NPOHW5OU.js";import"./chunk-NNIRIUSY.js";import"./chunk-U2YMBCX7.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import"./chunk-BTI4N7YO.js";import"./chunk-BQAF5P7K.js";import{c as o}from"./chunk-3M53YXEI.js";import"./chunk-B7QDZPNX.js";import{o as m}from"./chunk-WZYRAR7X.js";import"./chunk-BT5YNE5U.js";import"./chunk-TERVLCRG.js";import"./chunk-GLUWATL5.js";import"./chunk-73G5UYBB.js";import"./chunk-YR5ID2SS.js";import"./chunk-55G6B54U.js";import"./chunk-KD3QVRIJ.js";import"./chunk-ARQEJOEK.js";import"./chunk-JUJSA7KI.js";import"./chunk-KGNCKIFP.js";import{b as l}from"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import{a as s}from"./chunk-FTQLQJQV.js";async function y(i,p){let[n,c]=p;if(!n||p.length>2)throw new Error("usage: 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>]");if(o(i,"project")&&!["list","recorded-list"].includes(n))throw new Error("--project filters list commands; other operations retain their exact Project in --input-file.");if(i.local===!0||i.local==="true")throw new Error("Connected evidence is retained by its hosted source owner; select --api-base-url for that owner.");if(c&&!["recorded","import-receipt"].includes(n))throw new Error("This operation does not accept a resource id.");let a=new m(await u(i)),t=AbortSignal.timeout(6e4),d={...o(i,"project")?{projectId:o(i,"project")}:{},...o(i,"cursor")?{cursor:o(i,"cursor")}:{},limit:Number(o(i,"limit")||20)},r=s(async()=>w(i),"input"),e;switch(n){case"list":e=await a.list(d,t);break;case"recorded-list":e=await a.listRecordedExecutions(d,t);break;case"collection":e=await a.collection(t);break;case"recorded":if(!c)throw new Error("Select a recorded execution id.");e=await a.recordedExecution(c,t);break;case"import-receipt":if(!c)throw new Error("Select the original import operation id.");e=await a.readImport(c,t);break;case"summary":e=await a.homeSummary(await r(),t);break;case"case":e=await a.read(await r(),t);break;case"unmapped":e=await a.unmappedEvents(await r(),t);break;case"capture":e=await a.capture(await r(),t);break;case"selection":e=await a.createSelection(await r(),t);break;case"publish":e=await a.publishDataset(await r(),t);break;case"prepare-recorded":e=await a.prepareRecorded(await r(),t);break;case"upload-part":e=await a.uploadPart(await r(),t);break;case"preview":e=await a.preview(await r(),t);break;case"commit":e=await a.commit(await r(),t);break;case"set-collection":e=await a.setCollection(l.object({paused:l.boolean()}).strict().parse(await r()).paused,t);break;default:throw new Error("Unknown connected evidence operation.")}console.log(JSON.stringify(e,null,2))}s(y,"runConnectedEvidenceCommand");export{y as runConnectedEvidenceCommand};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p}from"./chunk-UA5DA5I2.js";import"./chunk-NNIRIUSY.js";import"./chunk-U2YMBCX7.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import"./chunk-BTI4N7YO.js";import"./chunk-BQAF5P7K.js";import"./chunk-3M53YXEI.js";import"./chunk-B7QDZPNX.js";import"./chunk-WZYRAR7X.js";import"./chunk-BT5YNE5U.js";import"./chunk-TERVLCRG.js";import"./chunk-GLUWATL5.js";import"./chunk-73G5UYBB.js";import"./chunk-YR5ID2SS.js";import"./chunk-55G6B54U.js";import"./chunk-KD3QVRIJ.js";import"./chunk-ARQEJOEK.js";import"./chunk-JUJSA7KI.js";import"./chunk-KGNCKIFP.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import"./chunk-FTQLQJQV.js";export{m as resolveGitBranch,f as runAccount,j as runBacktestRun,p as runCheckUpdate,k as runDeployWatch,g as runHealth,d as runLogin,o as runOpentool,e as runProfiles,l as runRepoCreate,n as runRepoPush,b as runTemplateBranches,a as runTemplateStatus,c as runTemplateUpdate,h as runToolList,i as runToolRun};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{d as C}from"./chunk-WDFLCNRC.js";import"./chunk-JIMU3KDA.js";import"./chunk-6MI4KKWF.js";import"./chunk-QDHMP5FS.js";import"./chunk-YDT7L3VZ.js";import"./chunk-6FA3GG5B.js";import"./chunk-NNIRIUSY.js";import{c as x}from"./chunk-U2YMBCX7.js";import{c as T,f as j}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import"./chunk-BTI4N7YO.js";import"./chunk-BQAF5P7K.js";import{c as p,f as R}from"./chunk-3M53YXEI.js";import"./chunk-B7QDZPNX.js";import{a as I,e as E,f as H,g as q,h as w,i as W,j as U,k as $,l as P,m as O}from"./chunk-WZYRAR7X.js";import"./chunk-BT5YNE5U.js";import{d as A}from"./chunk-TERVLCRG.js";import"./chunk-GLUWATL5.js";import"./chunk-73G5UYBB.js";import"./chunk-YR5ID2SS.js";import"./chunk-55G6B54U.js";import"./chunk-KD3QVRIJ.js";import"./chunk-ARQEJOEK.js";import"./chunk-JUJSA7KI.js";import"./chunk-KGNCKIFP.js";import{b as m}from"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import{a as v}from"./chunk-FTQLQJQV.js";var y=m.enum(["create","save","publish","begin_version"]),z=m.object({operationId:m.string().trim().min(1).max(240),kind:y,requestHash:m.string().regex(/^[a-f0-9]{64}$/),receipt:w,base:w.nullable()}).strict().superRefine((c,r)=>{let{receipt:e,base:t,kind:a}=c;(t&&(t.teamId!==e.teamId||t.datasetId!==e.datasetId||t.revision+1!==e.revision)||!t&&e.revision!==1)&&r.addIssue({code:"custom",message:"Operation recovery history identity/revision mismatch."}),t&&((t.ownerScope??"workspace")!==(e.ownerScope??"workspace")||t.originProjectId!==e.originProjectId||t.workspace.draft.createdAt!==e.workspace.draft.createdAt)&&r.addIssue({code:"custom",message:"Operation recovery cannot change Dataset ownership or origin."});let s=t?e.workspace.draft.status==="published"?"publish":t.workspace.draft.status==="published"?"begin_version":"save":"create";a!==s&&r.addIssue({code:"custom",message:"Operation recovery kind differs from its retained lifecycle."})});var g=class{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;static{v(this,"OpenPondDatasetWorkspaceClient")}baseUrl;async list(r={}){let{signal:e,...t}=r,a=H.parse(t),s=new URLSearchParams(Object.entries(a).filter(([,o])=>o!==void 0).map(([o,d])=>[o,String(d)])),i=P.parse(await this.request(`?${s}`,"GET",void 0,e));if(i.teamId!==this.options.teamId||i.datasets.length>a.limit||new Set(i.datasets.map(o=>o.id)).size!==i.datasets.length)throw new Error("Dataset list workspace/page mismatch.");return i}async get(r,e){return this.readback(await this.request(`/${encodeURIComponent(r)}`,"GET",void 0,e),r)}async operationResult(r,e){let t=y.parse(e.kind),a=new URLSearchParams({kind:t,...e.datasetId?{datasetId:e.datasetId}:{}}),s=await this.request(`/operations/${encodeURIComponent(r)}?${a}`,"GET",void 0,e.signal,132*1024*1024);if(s===null)return null;let i=z.parse(s);if(this.readback(i.receipt,i.receipt.datasetId),i.base&&this.readback(i.base,i.receipt.datasetId),i.operationId!==r||i.kind!==t||e.datasetId&&i.receipt.datasetId!==e.datasetId||e.requestHash&&i.requestHash!==e.requestHash)throw new Error("Dataset operation recovery identity/request mismatch.");return i}async beginVersion(r,e,t){let a=U.parse(e),s=this.readback(await this.request(`/${encodeURIComponent(r)}/begin-version`,"POST",a,t),r);if(s.revision!==a.expectedRevision+1||s.workspace.draft.status!=="draft"||!s.publication||!s.workspace.draft.publishedTasksetRef)throw new Error("Editable version receipt mismatch.");return s}async versions(r,e={}){let t=new URLSearchParams(e.beforeRevision===void 0?{}:{beforeRevision:String(e.beforeRevision)}),a=$.parse(await this.request(`/${encodeURIComponent(r)}/versions?${t}`,"GET",void 0,e.signal));if(a.teamId!==this.options.teamId||a.datasetId!==r||a.items.some((s,i)=>i>0&&s.workspaceRevision>=a.items[i-1].workspaceRevision||e.beforeRevision!==void 0&&s.workspaceRevision>=e.beforeRevision))throw new Error("Dataset version history scope/order mismatch.");return a}async version(r,e,t){let a=this.readback(await this.request(`/${encodeURIComponent(r)}/versions/${e}`,"GET",void 0,t),r);if(a.revision!==e||a.workspace.draft.status!=="published")throw new Error("Dataset immutable version mismatch.");return a}async save(r,e){let t=q.parse(r),a=I(t.workspace);if(a.draft.profileId!==this.options.teamId||a.draft.revision!==t.expectedRevision+1)throw new Error("Dataset write scope or revision mismatch.");let s=this.readback(await this.request(`/${encodeURIComponent(a.draft.id)}`,"PUT",t,e),a.draft.id);if(t.originProjectId&&s.originProjectId!==t.originProjectId)throw new Error("Dataset origin Project mismatch.");if(t.ownerScope&&s.ownerScope!==t.ownerScope)throw new Error("Dataset owner scope mismatch.");if(s.workspace.contentHash!==a.contentHash)throw new Error("Dataset write receipt differs from the saved bytes.");return s}async validate(r,e,t){let a=O.parse(await this.request(`/${encodeURIComponent(r)}/validate`,"POST",{expectedRevision:e},t));if(a.teamId!==this.options.teamId||a.datasetId!==r||a.revision!==e)throw new Error("Dataset validation receipt mismatch.");return a}async publish(r,e,t){let a=W.parse(e),s=this.readback(await this.request(`/${encodeURIComponent(r)}/publish`,"POST",a,t),r);if(s.revision!==a.expectedRevision+1||s.workspace.draft.status!=="published"||s.publication?.packageHash!==a.packageHash)throw new Error("Dataset publication receipt mismatch.");return s}readback(r,e){let t=w.parse(r);if(I(t.workspace),t.datasetId!==e||t.teamId!==this.options.teamId)throw new Error("Dataset identity mismatch.");return t}async request(r,e,t,a,s){let i=await(this.options.fetch??fetch)(`${this.baseUrl}/v1/dataset-workspaces${r}`,{method:e,signal:a,redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"X-OpenPond-Team-Id":this.options.teamId,"Content-Type":"application/json"},...t===void 0?{}:{body:JSON.stringify(t)}});if(!i.ok)throw new Error(`Dataset request failed (${i.status}).`);if(s!==void 0){if(!i.body)throw new Error("Dataset response is empty.");let o=i.body.getReader(),d=[],u=0;try{for(;;){let n=await o.read();if(n.done)break;if(u+=n.value.byteLength,u>s)throw new Error("Dataset recovery exceeds its bounded response.");d.push(n.value)}}finally{await o.cancel()}let h=new Uint8Array(u),l=0;for(let n of d)h.set(n,l),l+=n.length;return JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(h))}return i.json()}};async function re(c,r){let[e,t]=r,a=p(c,"team"),s=T(c);if(!a||!s||!e||r.length>2||!["upload","read","list","validate","publish"].includes(e))throw new Error("usage: datasets <upload|read|list|validate|publish> [folder|id] --team <id> --api-base-url <origin> [--operation-id <id>] [--expected-revision <n>] [--publish] [--project <id>]");let i=await A(),o=new g({teamId:a,baseUrl:s,apiKey:await x(i,j(i))}),d=p(c,"operationId"),u;if(e==="list"){if(t)throw new Error("List does not accept a dataset id.");u=await o.list({cursor:p(c,"cursor")||void 0})}else{if(!t)throw new Error(`${e} requires a ${e==="upload"?"folder":"dataset id"}.`);if(e==="read")u=await o.get(t);else if(e==="upload"){if(!d||d.length>220)throw new Error("Upload requires a stable --operation-id of at most 220 characters. Reuse it after an uncertain response.");let h=p(c,"expectedRevision"),l=h?Number(h):0;if(!Number.isSafeInteger(l)||l<0)throw new Error("Expected revision must be a nonnegative integer.");let n=await C({directory:t,teamId:a,expectedRevision:l,datasetId:p(c,"datasetId")||void 0}),k=E({workspace:n.workspace,preparation:null,adapterId:"openpond-hosted-taskset-authoring-v1",now:n.workspace.draft.updatedAt}),f=await o.save({operationId:`${d}:save`,expectedRevision:l,workspace:n.workspace,...p(c,"project")?{originProjectId:p(c,"project")}:{}}),S=await o.get(f.datasetId);if(S.workspace.draft.status==="draft"){let D=await o.validate(f.datasetId,f.revision);if(D.workspaceHash!==n.workspace.contentHash||D.packageHash!==k.contentHash)throw new Error("Hosted validation differs from the captured folder bytes.")}else if(S.publication?.packageHash!==k.contentHash)throw new Error("This dataset was changed after the upload receipt. Read the current version before continuing.");let b=R(c.publish)?await o.publish(f.datasetId,{operationId:`${d}:publish`,expectedRevision:f.revision,workspaceHash:f.workspace.contentHash,packageHash:k.contentHash}):f;u={teamId:a,datasetId:b.datasetId,revision:b.revision,status:b.workspace.draft.status,operationId:d,capturedBytes:n.capturedBytes,sourceHash:n.sourceHash,sourceFiles:n.sourceFiles,workspaceHash:f.workspace.contentHash,packageHash:k.contentHash,publication:b.publication}}else{let h=Number(p(c,"expectedRevision"));if(!Number.isSafeInteger(h)||h<=0)throw new Error(`${e} requires --expected-revision with the retained dataset revision.`);if(e==="validate")u=await o.validate(t,h);else{if(!d)throw new Error("Publish requires a stable --operation-id.");let l=p(c,"workspaceHash"),n=p(c,"packageHash");if(!l||!n)throw new Error("Publish requires --workspace-hash and --package-hash from the retained validation receipt. Keep these pins and the operation id unchanged on retry.");u=await o.publish(t,{operationId:d,expectedRevision:h,workspaceHash:l,packageHash:n})}}}console.log(JSON.stringify(u,null,2))}v(re,"runDatasetsCommand");export{re as runDatasetsCommand};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{u as f}from"./chunk-NNIRIUSY.js";import"./chunk-U2YMBCX7.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{a as c}from"./chunk-BTI4N7YO.js";import"./chunk-BQAF5P7K.js";import{c as p,f as u}from"./chunk-3M53YXEI.js";import"./chunk-B7QDZPNX.js";import"./chunk-WZYRAR7X.js";import"./chunk-BT5YNE5U.js";import"./chunk-TERVLCRG.js";import"./chunk-GLUWATL5.js";import"./chunk-73G5UYBB.js";import"./chunk-YR5ID2SS.js";import"./chunk-55G6B54U.js";import"./chunk-KD3QVRIJ.js";import"./chunk-ARQEJOEK.js";import"./chunk-JUJSA7KI.js";import"./chunk-KGNCKIFP.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import{a as r}from"./chunk-FTQLQJQV.js";import d from"node:path";import{access as v}from"node:fs/promises";import{constants as C}from"node:fs";import{createRequire as P}from"node:module";var l=d.join("scripts","desktop-harness.ts");async function $(n,t){let o=await j({options:n,rest:t}),e=await f(o.command,o.args,{cwd:o.cwd,inherit:!0,timeoutMs:0});if(e.code!==0)throw new m(e.code)}r($,"runDesktopTestCommand");async function j(n){let t=n.options,o=n.rest,e=o[0];if(e!=="run"&&e!=="attach")throw new c(D());let a=o.slice(1);if(a.length===0)throw new c("usage: openpond desktop-test run <scenario...> [options]");let g=p(t,"cwd")||n.cwd||process.cwd(),w=await O(g),k=(n.env??process.env).OPENPOND_NODE_BINARY?.trim()||process.execPath,s=[P(import.meta.url).resolve("tsx/cli"),l,"run",...a],h=x(t,e);return h&&s.push(`--${h}`),i(s,"--app",t,"app"),i(s,"--server",t,"server"),i(s,"--token",t,"token"),i(s,"--token-file",t,"tokenFile"),i(s,"--devtools-port",t,"devtoolsPort"),i(s,"--artifacts-dir",t,"artifactsDir"),H(s,t),i(s,"--grep",t,"grep"),i(s,"--timeout-ms",t,"timeoutMs"),u(t.keepHome)&&s.push("--keep-home"),{command:k,args:s,cwd:w}}r(j,"buildDesktopHarnessInvocation");async function O(n){let t=d.resolve(n);for(;;){let o=d.join(t,l);if(await R(o))return t;let e=d.dirname(t);if(e===t)throw new c(`Could not find ${l}. Run this command from the OpenPond source checkout or pass --cwd <repo>.`);t=e}}r(O,"resolveDesktopHarnessRepoRoot");function x(n,t){let o=t==="attach"?"attach":null;for(let e of["isolated","attach","packaged","none"])if(u(n[e])){if(o&&o!==e)throw new c("Choose only one desktop harness launch mode: --isolated, --attach, --packaged, or --none.");o=e}return o}r(x,"resolveLaunchMode");function i(n,t,o,e){let a=p(o,e);a&&n.push(t,a)}r(i,"appendStringFlag");function H(n,t){let o=p(t,"json"),e=p(t,"jsonPath");if(o&&y(o))throw new c("harness --json requires a report path. Use --json <path> or --json-path <path>.");if(o&&e&&o!==e)throw new c("Use only one JSON report path: --json <path> or --json-path <path>.");let a=o||e;a&&n.push("--json",a)}r(H,"appendJsonFlag");function y(n){return/^(true|false|1|0|yes|no)$/i.test(n)}r(y,"isBooleanLiteral");async function R(n){try{return await v(n,C.R_OK),!0}catch{return!1}}r(R,"fileExists");function D(){return["usage: openpond desktop-test run <scenario...> [options]"," openpond desktop-test attach <scenario...> [options]","","Options include --isolated, --attach, --packaged, --none, --app <path>,","--server <url>, --token <token>, --token-file <path>, --devtools-port <port>, --artifacts-dir <path>,","--json <path>, --json-path <path>, --grep <pattern>, --timeout-ms <ms>,","--keep-home, and --cwd <repo>."].join(`
|
|
3
|
-
`)}r(D,"desktopHarnessCliUsage");var m=class extends Error{static{r(this,"HarnessCommandFailedError")}exitCode;constructor(t){let o=typeof t=="number"&&t>0?t:1;super(`desktop harness failed with exit code ${o}`),this.name="HarnessCommandFailedError",this.exitCode=o}};export{j as buildDesktopHarnessInvocation,O as resolveDesktopHarnessRepoRoot,$ as runDesktopTestCommand};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{$ as ra,A as L,B as M,C as N,D as O,E as W,F as X,G as Y,H as Z,I as _,J as $,K as aa,L as ba,M as ca,N as da,O as ea,P as fa,Q as ga,R as ha,S as ia,T as ja,U as ka,V as la,W as ma,X as na,Y as oa,Z as pa,_ as qa,a as l,aa as sa,b as m,ba as ta,c as n,ca as ua,d as o,da as va,e as p,ea as wa,f as q,fa as xa,g as r,ga as ya,h as s,ha as za,i as t,ia as Aa,j as u,ja as Ba,k as v,ka as Ca,l as w,la as Da,m as x,ma as Ea,n as y,na as Fa,o as z,oa as Ga,p as A,pa as Ha,q as B,qa as Ia,r as C,s as D,t as E,u as F,v as G,w as H,x as I,y as J,z as K}from"./chunk-ARQEJOEK.js";import"./chunk-JUJSA7KI.js";import"./chunk-KGNCKIFP.js";import"./chunk-ES2ISFJC.js";import{a,b,c,d,e,f,g,h,i,k as j,l as k,m as P,n as Q,o as R,p as S,q as T,r as U,s as V}from"./chunk-H7IWJN7L.js";import"./chunk-FTQLQJQV.js";export{Ca as CLIENT_CHOICE_KEYS,Ba as ClientChoicesSchema,w as ConfigSchema,v as CredentialReferenceSchema,L as LAYOUT_PREFERENCE_KEYS,l as MISSING_REVISION,na as MigrationResolutionsSchema,P as PERSISTENCE_TABLES_SQL,c as PersistenceError,ea as accountId,r as acquireFileLock,ja as artifactReference,za as assertConfigRunCurrent,Ia as assertHomeCompatible,k as assertStorageAncestors,p as atomicWriteFile,b as bindHomeCallbacks,ya as captureConfigRun,Z as clearCache,ma as collectArtifactOrphans,F as configEditorSchema,C as configRecoveryRevisions,N as configToPreferences,da as credentialVersions,ba as deleteCredential,V as deleteLocalRecord,y as diffConfig,Aa as effectivePreferences,g as expandHome,Fa as exportRecoveryBackup,Ha as exportSettings,m as fileRevision,S as getLocalRecord,qa as initializeHome,e as isMissing,O as layoutPreferences,Y as listCache,T as listLocalRecords,J as mergeConfig,ca as newCredentialId,Q as openStorageDatabase,H as patchConfig,d as persistenceIssue,M as preferencesToConfig,o as privateDirectory,s as processIsDead,j as protectPrivateDirectory,ia as publishManagedArtifact,U as putLocalRecord,fa as readAccountConfiguration,W as readCache,Da as readClientChoices,G as readConfig,_ as readCredential,$ as readCredentials,t as readJsonFile,oa as readMigrationJournal,n as readOptionalFile,ua as readPreferences,sa as recoverMigration,la as releaseArtifactReference,B as rememberValidConfig,D as replaceConfigText,i as resolveConfigPath,xa as resolveEffectiveConfig,f as resolveOpenPondHome,pa as resolveStoredPath,ta as restartMigration,E as restoreConfigRevision,Ga as restoreRecoveryBackup,z as serializeConfig,wa as setProjectTrust,h as storagePaths,ga as updateAccountConfiguration,Ea as updateClientChoices,I as updateConfig,u as updateJsonFile,va as updatePreferences,x as validateConfigDocument,A as validateConfigText,ha as validateManagedArtifacts,ra as validateMigratedHome,K as watchConfig,q as withFileLock,R as withLocalDatabase,ka as withManagedArtifact,a as withOpenPondHome,X as writeCache,aa as writeCredential};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as p,b as v}from"./chunk-G6JMQGX7.js";import"./chunk-NPOHW5OU.js";import"./chunk-NNIRIUSY.js";import"./chunk-U2YMBCX7.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import"./chunk-BTI4N7YO.js";import"./chunk-BQAF5P7K.js";import{c as r}from"./chunk-3M53YXEI.js";import"./chunk-B7QDZPNX.js";import{v as d,w as s,x as h,y as w}from"./chunk-WZYRAR7X.js";import"./chunk-BT5YNE5U.js";import"./chunk-TERVLCRG.js";import"./chunk-GLUWATL5.js";import"./chunk-73G5UYBB.js";import"./chunk-YR5ID2SS.js";import"./chunk-55G6B54U.js";import"./chunk-KD3QVRIJ.js";import"./chunk-ARQEJOEK.js";import"./chunk-JUJSA7KI.js";import"./chunk-KGNCKIFP.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import{a as m}from"./chunk-FTQLQJQV.js";async function b(t,e,n){let[a,o]=n,i=r(e,"actor");if(!i||!a||n.length>2)throw new Error("Select --actor, --team and an evaluation command.");if(e.local!==!0&&e.local!=="true")throw new Error("These evaluation owners currently run through the authenticated native bridge. Select --local --server-url with its loopback origin.");let c={...await v(e),actorId:i,projectId:r(e,"project")||null},l=a==="request"?await p(e):a==="list"?t==="schedule"?{operation:a,...r(e,"cursor")?{cursor:r(e,"cursor")}:{},limit:Number(r(e,"limit")||50)}:{operation:a}:{operation:a,id:o};if((a==="request"||a==="list")&&o)throw new Error("This operation does not accept an additional resource id.");let u=AbortSignal.timeout(6e4),f=t==="schedule"?await new s(c).command(d.parse(l),u):await new w(c).command(h.parse(l),u);console.log(JSON.stringify(f,null,2))}m(b,"runEvaluationCoordinationCommand");export{b as runEvaluationCoordinationCommand};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as s,b as l}from"./chunk-G6JMQGX7.js";import"./chunk-NPOHW5OU.js";import"./chunk-NNIRIUSY.js";import"./chunk-U2YMBCX7.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import"./chunk-BTI4N7YO.js";import"./chunk-BQAF5P7K.js";import{c as e}from"./chunk-3M53YXEI.js";import"./chunk-B7QDZPNX.js";import{t as m,u as c}from"./chunk-WZYRAR7X.js";import"./chunk-BT5YNE5U.js";import"./chunk-TERVLCRG.js";import"./chunk-GLUWATL5.js";import"./chunk-73G5UYBB.js";import"./chunk-YR5ID2SS.js";import"./chunk-55G6B54U.js";import"./chunk-KD3QVRIJ.js";import"./chunk-ARQEJOEK.js";import"./chunk-JUJSA7KI.js";import"./chunk-KGNCKIFP.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import{a}from"./chunk-FTQLQJQV.js";async function f(t,i){let[r,o]=i,n=e(t,"actor");if(!n||!r||i.length>2)throw new Error("usage: improve <list|read|instructions|request> [id] --team <id> --actor <owner-id> [--input-file <path>] [--local --server-url <loopback-origin>]");let u=m.parse(r==="request"?await s(t):r==="list"?{operation:r,limit:Number(e(t,"limit")||30),...e(t,"cursor")?{cursor:e(t,"cursor")}:{}}:{operation:r,id:o});if(r==="request"&&o||r==="list"&&o)throw new Error("This operation does not accept a candidate id.");let d=new c({...await l(t),actorId:n});console.log(JSON.stringify(await d.command(u,AbortSignal.timeout(6e4)),null,2))}a(f,"runExperimentImprovementsCommand");export{f as runExperimentImprovementsCommand};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as ie,c as ae}from"./chunk-NPOHW5OU.js";import"./chunk-QDHMP5FS.js";import{Db as j,ib as te,jb as ne,ta as C,vb as U,wb as I,xb as re,yb as k}from"./chunk-YDT7L3VZ.js";import"./chunk-NNIRIUSY.js";import{c as X}from"./chunk-U2YMBCX7.js";import{c as Z,f as ee}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import"./chunk-BTI4N7YO.js";import"./chunk-BQAF5P7K.js";import{c as o}from"./chunk-3M53YXEI.js";import"./chunk-B7QDZPNX.js";import{b as K,c as M,d as P,q as W,r as Y}from"./chunk-WZYRAR7X.js";import"./chunk-BT5YNE5U.js";import{d as V}from"./chunk-TERVLCRG.js";import{b as Q}from"./chunk-GLUWATL5.js";import"./chunk-73G5UYBB.js";import"./chunk-YR5ID2SS.js";import"./chunk-55G6B54U.js";import{$a as T,Ra as F,db as D,eb as G,hb as B,ib as J}from"./chunk-KD3QVRIJ.js";import"./chunk-ARQEJOEK.js";import"./chunk-JUJSA7KI.js";import{m as H}from"./chunk-KGNCKIFP.js";import{b as e}from"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import{a as x}from"./chunk-FTQLQJQV.js";import{readFile as N,stat as z}from"node:fs/promises";var w=e.string().trim().min(1).max(500),oe=e.string().regex(/^[a-f0-9]{64}$/),ue=e.object({schemaVersion:e.literal("openpond.experimentCaseInspection.v1"),teamId:w,executionId:w,manifestHash:oe,receiptId:w,taskId:w,seed:e.string().min(1),input:e.record(e.string(),e.unknown()).nullable(),output:e.unknown().nullable(),error:e.string().nullable(),events:e.array(e.record(e.string(),e.unknown())).max(25),nextEventCursor:w.nullable(),eventCount:e.number().int().nonnegative()}).strict(),fe=ue.extend({contentHash:oe}).strict(),v=class{constructor(s){this.options=s;let n=new URL(s.baseUrl);if(!["http:","https:"].includes(n.protocol)||n.username||n.password||n.search||n.hash||!s.apiKey.trim()||!s.teamId.trim())throw new Error("A clean API origin and workspace credentials are required.");this.baseUrl=n.toString().replace(/\/+$/,"")}options;static{x(this,"OpenPondExperimentInspectionClient")}baseUrl;async case(s,n,r={}){let b=new URLSearchParams(r.afterId?{afterId:w.parse(r.afterId)}:{}),h=await(this.options.fetch??fetch)(`${this.baseUrl}/v1/experiments/${encodeURIComponent(w.parse(s))}/cases/${encodeURIComponent(w.parse(n))}?${b}`,{signal:r.signal,redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"X-OpenPond-Team-Id":this.options.teamId,Accept:"application/json"}}),S=await h.json();if(!h.ok)throw new Error(e.object({message:e.string()}).parse(S).message);let a=fe.parse(S),{contentHash:l,...i}=a;if(H(i)!==l||a.teamId!==this.options.teamId||a.executionId!==s||a.receiptId!==n||r.manifestHash&&a.manifestHash!==r.manifestHash||a.events.length>a.eventCount)throw new Error("Case inspection differs from its requested workspace, execution or retained content.");return a}};import{readFile as Re,stat as He}from"node:fs/promises";var q=e.object({source:e.enum(["local","github","openpond_git"]),repositoryId:e.string().trim().min(1),profileId:e.string().trim().min(1)}),Ue=e.object({ref:q,revision:e.string().nullable(),sourceHash:e.string()});var m=e.string().trim().min(1).max(200),d=e.string().regex(/^[a-f0-9]{64}$/),ce=e.enum(["queued","running","cancelling","completed","failed","cancelled","interrupted"]),me=e.object({providerId:e.enum(["openpond","custom-openai-compatible","claude-code"]),modelId:e.string().trim().min(1).max(500),configurationHash:d,maxOutputTokens:e.number().int().positive().max(262144),temperature:e.number().min(0).max(2).optional(),topP:e.number().positive().max(1).optional(),messages:e.array(e.object({role:e.enum(["system","user","assistant"]),content:e.string().max(262144)}).strict()).max(200)}).strict(),Te=e.object({configuration:k,package:C}).strict(),De=e.object({configuration:k,expectedPackageHash:d.optional()}).strict(),Ge=e.object({schemaVersion:e.literal("openpond.localExperimentDefinition.v1"),location:e.literal("local"),id:m,teamId:m,ownerActorId:m,revision:e.number().int().positive(),configuration:k,model:me,packageHash:d,graders:e.array(I).min(1).max(100),availableGraders:e.array(I).min(1).max(1e3),createdAt:e.iso.datetime(),updatedAt:e.iso.datetime(),contentHash:d}).strict(),Be=e.object({operationId:m,definition:U}).strict(),Je=e.object({teamId:m,id:m}).strict(),Ke=e.object({teamId:m,projectId:m.optional(),status:ce.optional(),datasetHash:d.optional(),search:e.string().max(100).optional(),afterId:m.optional(),limit:e.number().int().min(1).max(100).default(30)}).strict(),O=e.object({schemaVersion:e.literal("openpond.localExperimentExecution.v1"),location:e.literal("local"),id:m,teamId:m,ownerActorId:m,operationId:m,definition:U,kind:e.enum(["target","scoring"]),executionHash:d,sourceExecution:e.object({id:m,executionHash:d}).strict().nullable(),packageHash:d,maximumCostUsd:e.number().finite().positive(),status:ce,createdAt:e.iso.datetime(),completedAt:e.iso.datetime().nullable(),counts:e.object({pending:e.number().int().nonnegative(),running:e.number().int().nonnegative(),completed:e.number().int().nonnegative(),failed:e.number().int().nonnegative(),cancelled:e.number().int().nonnegative(),unknown:e.number().int().nonnegative()}).strict(),usage:e.object({knownCostUsd:e.number().finite().nonnegative(),costUsd:e.number().finite().nonnegative().nullable(),heldUsd:e.number().finite().nonnegative(),uncertainRequests:e.number().int().nonnegative()}).strict(),cleanupComplete:e.boolean(),error:e.string().max(2e3).nullable()}).strict(),xe=O.omit({definition:!0});function _(t,s){t.kind==="scoring"!=(t.sourceExecution!==null)&&s.addIssue({code:"custom",message:"Only retained scoring passes name an original execution."}),["completed","failed","cancelled","interrupted"].includes(t.status)&&(!t.completedAt||t.counts.pending||t.counts.running)&&s.addIssue({code:"custom",message:"Terminal local execution requires complete population accounting."}),["completed","cancelled"].includes(t.status)&&!t.cleanupComplete&&s.addIssue({code:"custom",message:"Successful completion or cancellation requires confirmed local transport cleanup."}),t.usage.uncertainRequests>0&&t.usage.costUsd!==null&&s.addIssue({code:"custom",message:"Uncertain provider charges cannot claim a measured total."})}x(_,"validateLocalExecutionState");var Me=O.superRefine(_),y=xe.superRefine(_),he=e.object({configuration:j,package:C}).strict(),ge=e.object({configuration:j,expectedPackageHash:e.string().regex(/^[a-f0-9]{64}$/).optional()}).strict(),A=e.object({configuration:j,model:me,packageHash:e.string().regex(/^[a-f0-9]{64}$/),graders:e.array(I).min(1).max(100),availableGraders:e.array(I).min(1).max(1e3),retainedConfigurationHash:e.string().regex(/^[a-f0-9]{64}$/).optional(),configurationHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict().superRefine((t,s)=>{let{configurationHash:n,...r}=t;H(r)!==n&&s.addIssue({code:"custom",message:"Local configuration snapshot bytes changed."})}),{definition:Ve,...Ee}=O.shape,L=e.object({...Ee,kind:e.literal("target"),...A.shape}).strict().superRefine((t,s)=>{let n={configuration:t.configuration,model:t.model,packageHash:t.packageHash,graders:t.graders,availableGraders:t.availableGraders,...t.retainedConfigurationHash?{retainedConfigurationHash:t.retainedConfigurationHash}:{},configurationHash:t.configurationHash};_(t,s),A.safeParse(n).success||s.addIssue({code:"custom",message:"Local Experiment configuration changed."}),(t.operationId!==t.configuration.operationId||t.teamId!==t.configuration.request.teamId||t.maximumCostUsd!==t.configuration.maximumCostUsd)&&s.addIssue({code:"custom",message:"Local Experiment differs from its sealed admission."})}),we=e.object({items:e.array(L).max(100),nextCursor:e.string().nullable()}).strict(),be=e.object({teamId:e.string().min(1).max(200),id:e.string().min(1).max(200),configurationHash:e.string().regex(/^[a-f0-9]{64}$/).optional()}).strict(),Se=e.object({operationId:m,execution:e.object({id:m,executionHash:d}).strict(),graderPackage:C,graders:e.array(re).min(1).max(100),maximumCostUsd:e.number().finite().positive().max(1e4)}).strict(),Qe=Se.omit({graderPackage:!0}),Ie=T,Le=e.object({sessionId:m,turnId:m,source:F,profileRef:q,admissionHash:d,modelConfigurationHash:d,traceHash:d,runtimeEventRefs:e.array(m).max(1e4),startedAt:e.iso.datetime(),completedAt:e.iso.datetime(),outputHash:d,partialOutputAvailable:e.boolean()}).strict(),le=e.object({receiptId:m,taskId:m,seed:e.string(),status:e.enum(["pending","running","completed","failed","cancelled","unknown"]),input:e.record(e.string(),e.unknown()),policyVisibleContext:e.record(e.string(),e.unknown()),output:e.string().nullable(),messages:e.array(e.unknown()).max(4002),grade:ne.nullable(),error:e.string().nullable(),native:Ie.optional(),profileNative:Le.optional(),externalProcess:te.optional()}).strict(),Xe=e.object({execution:e.union([L,y]),cases:e.array(le).max(1e4),contentHash:d}).strict(),ye=e.object({items:e.array(e.object({sequence:e.number().int().positive(),type:e.string().min(1),payload:e.unknown()}).strict()).max(500),nextCursor:e.number().int().positive().nullable()}).strict(),We=e.object({location:e.literal("local"),execution:e.union([L,y]),case:le,trace:ye}).strict(),Ye=e.object({items:e.array(y).max(100),nextCursor:m.nullable()}).strict(),Ze=e.object({execution:y,graders:e.array(I).min(1).max(100),graderPackageHash:d}).strict(),se=e.object({execution:y,manifest:D,result:G}).strict().superRefine((t,s)=>{try{if(B(t),t.manifest.id!==t.execution.id||t.manifest.teamId!==t.execution.teamId||t.manifest.lineage?.execution.id!==(t.execution.sourceExecution?.id??t.execution.id)||t.manifest.lineage.execution.contentHash!==(t.execution.sourceExecution?.executionHash??t.execution.executionHash)||t.manifest.lineage.scoringPassId!==(t.execution.kind==="scoring"?t.execution.id:null)||t.manifest.maximumCostUsd!==t.execution.maximumCostUsd)throw new Error("Portable evidence differs from its retained local execution.")}catch(n){s.addIssue({code:"custom",message:n instanceof Error?n.message:"Local portable evidence verification failed."})}}),pe=e.object({location:e.literal("local"),baseline:se,candidate:se}).strict();async function de(t,s){let[n,r,b]=s,h=o(t,"team");if(t.revision!==void 0)throw new Error("A local Experiment is one immutable run; read it by id rather than a saved configuration revision.");if(n!=="read"&&t.contentHash!==void 0)throw new Error("An exact configuration hash requires the local read action.");if(!h||!n||s.length>(n==="compare"?3:2))throw new Error("Local Experiments require an action and --team; use --server-url for an existing local server.");let S=o(t,"serverUrl")||process.env.OPENPOND_LOCAL_API_URL||ie,a=new URL(S);if(a.protocol!=="http:"||!["localhost","127.0.0.1"].includes(a.hostname)||a.username||a.password||a.search||a.hash||a.pathname!=="/")throw new Error("Local Experiments require an HTTP loopback server origin.");let l=await ae(a.origin);async function i(u,g){let c=await l(new URL("/v1/local-experiments",a),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({teamId:h,action:u,payload:g})}),p=await c.json();if(!c.ok)throw new Error(typeof p.error=="string"?p.error:`Local Experiment request failed (${c.status}).`);return p}x(i,"command");async function E(){let u=o(t,"inputFile");if(!u||(await He(u)).size>67108864)throw new Error("Provide a bounded --input-file with exact local configuration and retained package bytes.");return JSON.parse(await Re(u,"utf8"))}x(E,"input");let f;if(n==="prepare-harness"){if(r)throw new Error("Local Profile preparation accepts --input-file rather than an id.");f=await i("prepareHarness",await E())}else if(n==="run"){if(r)throw new Error("Local Run accepts reviewed configuration through --input-file rather than an id.");let u=await E();f=await i(u.package?"run":"runFromRelease",u)}else if(n==="list"){if(r)throw new Error("Local List does not accept an id.");let u=o(t,"status"),g=o(t,"limit"),c=o(t,"project"),p=o(t,"afterId"),R=o(t,"datasetHash"),$=o(t,"search");f=await i("list",{...u?{status:u}:{},...c?{projectId:c}:{},...R?{datasetHash:R}:{},...$?{search:$}:{},...p?{afterId:p}:{},...g?{limit:Number(g)}:{}})}else{if(!r)throw new Error(`${n} requires a local Experiment or scoring pass id.`);let u=o(t,"afterId"),g=o(t,"limit");if(n==="duplicate"){let c=o(t,"operationId");if(!c)throw new Error("Duplicate requires --operation-id for safe replay.");let p=L.parse(await i("read",{id:r})),R=P.parse({...p.configuration,operationId:c,request:{...p.configuration.request,operationId:c},sourceExperimentId:p.id});f=await i("runFromRelease",{configuration:R,expectedPackageHash:p.packageHash})}else if(n==="passes")f=await i("passes",{executionId:r,...u?{afterId:u}:{},...g?{limit:Number(g)}:{}});else if(n==="case"){let c=o(t,"receiptId"),p=o(t,"afterSequence");if(!c)throw new Error("Local case inspection requires --receipt-id from the retained execution.");f=await i("case",{id:r,receiptId:c,...p?{afterSequence:Number(p)}:{},...g?{limit:Number(g)}:{}})}else if(n==="score"){let c=await E();if(c.execution?.id!==r)throw new Error("Local scoring input belongs to a different retained execution.");f=await i("score",c)}else if(n==="compare"){if(!b)throw new Error("Local Compare requires baseline and candidate execution ids.");let c=pe.parse(await i("compare",{baselineId:r,candidateId:b}));f={...c,comparison:J(c.baseline,c.candidate)}}else if(n==="read"){let c=o(t,"contentHash");f=await i("read",{id:r,...c?{configurationHash:c}:{}})}else if(["status","cancel","result","pass"].includes(n))f=await i(n,{id:r});else if(n==="cancel-pass")f=await i("cancel",{id:r});else if(n==="pass-result")f=await i("result",{id:r});else throw new Error(`Local Experiment action is unavailable: ${n}`)}console.log(JSON.stringify(f,null,2))}x(de,"runLocalExperimentsCommand");async function Et(t,s){if(t.local===!0||t.local==="true")return de(t,s);if(t.revision!==void 0||t.contentHash!==void 0)throw new Error("Experiments retain their immutable configuration on the run; definition revisions are not selectable.");let[n,r]=s,b=o(t,"team");if(!b||!n||s.length>(n==="compare"?3:2))throw new Error("usage: 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>]");let h=await V(),S={teamId:b,apiKey:await X(h,ee(h)),baseUrl:Z(t)??h.apiBaseUrl??Q},a=new Y(S),l;if(n==="prepare-harness"){let i=o(t,"inputFile");if(!i||r||(await z(i)).size>1048576)throw new Error("Harness preparation requires a bounded --input-file with its released target, model and ceiling.");l=await a.prepareHarness(M.parse(JSON.parse(await N(i,"utf8"))))}else if(n==="run"){let i=o(t,"inputFile");if(!i||r)throw new Error("Run requires --input-file with the reviewed configuration and stable operationId.");if((await z(i)).size>1048576)throw new Error("Experiment input exceeds one MiB.");l=await a.run(P.parse(JSON.parse(await N(i,"utf8"))))}else if(n==="list"){if(r)throw new Error("List does not accept an Experiment id.");let i=o(t,"limit");l=await a.list(K.parse({projectId:o(t,"project")||void 0,datasetHash:o(t,"datasetHash")||void 0,search:o(t,"search")||void 0,status:o(t,"status")||void 0,afterId:o(t,"afterId")||void 0,...i?{limit:Number(i)}:{}}))}else{if(!r)throw new Error(`${n} requires an id.`);if(n==="read")l=await a.get(r);else if(n==="status")l=await a.get(r);else if(n==="cancel")l=await a.cancel(r);else if(n==="duplicate"){let i=o(t,"operationId");if(!i)throw new Error("Duplicate requires a stable --operation-id for the new Experiment.");l=await a.duplicate(r,i)}else if(n==="score"){let i=o(t,"inputFile");if(!i||(await z(i)).size>1048576)throw new Error("Score requires --input-file containing an exact execution reference, grader releases and explicit ceiling, within one MiB.");let E=W.parse(JSON.parse(await N(i,"utf8")));if(E.execution.id!==r)throw new Error("Scoring input belongs to a different execution.");l=await a.score(E)}else if(n==="passes")l=await a.scoringPasses(r,{afterId:o(t,"afterId")||void 0});else if(n==="pass")l=await a.scoringPass(r);else if(n==="cancel-pass")l=await a.cancelScoringPass(r);else if(n==="pass-result")l=await a.scoringResult(r);else if(n==="result")l=await a.result(r);else if(n==="case"){let i=o(t,"receiptId");if(!i)throw new Error("Case inspection requires --receipt-id from the retained Experiment.");let E=await a.get(r);l=await new v(S).case(r,i,{manifestHash:E.manifest.contentHash,afterId:o(t,"afterId")||void 0})}else if(n==="compare"){if(!s[2])throw new Error("Compare requires a baseline and candidate execution id.");l=await a.compare(r,s[2])}else throw new Error(`Unknown Experiment action: ${n}`)}console.log(JSON.stringify(l,null,2))}x(Et,"runExperimentsCommand");export{Et as runExperimentsCommand};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as Ie,b as ye,c as Re,d as He,e as Ee,f as Pe,h as B,i as Ae,j as je}from"./chunk-QRAKXZOC.js";import{e as Ce,f as U}from"./chunk-CGBI2VYJ.js";import{Lb as xe,Nb as Te,Rb as G,Sb as De,Tb as ze,V as be,Va as Se,W as ke,n as we,o as ve}from"./chunk-YUPBAWBJ.js";import"./chunk-C6D4WAYN.js";import"./chunk-USMZT5FZ.js";import"./chunk-QKD5OMDI.js";import{k as ge}from"./chunk-T4QGDQHP.js";import{a as z}from"./chunk-OSIO7PLX.js";import"./chunk-STDMBJOQ.js";import{E as W,M as me,Ra as fe,Va as D,Wa as he}from"./chunk-2DFR7PJ4.js";import"./chunk-5CMKGD43.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-MVF3F5QS.js";import"./chunk-L4235TRQ.js";import"./chunk-BFKYRQMA.js";import"./chunk-DLVPSCTB.js";import"./chunk-WDFLCNRC.js";import{Kd as le,Nb as de,Ob as ce,Od as V,Q as se,Qd as ue,Wa as C,Xa as $,he as pe}from"./chunk-JIMU3KDA.js";import"./chunk-6MI4KKWF.js";import"./chunk-QDHMP5FS.js";import{ta as ae,wa as ie}from"./chunk-YDT7L3VZ.js";import"./chunk-6FA3GG5B.js";import"./chunk-YR5ID2SS.js";import{S as re,T as oe,V as ne,c as Y,g as ee}from"./chunk-55G6B54U.js";import{hb as M,k as te}from"./chunk-KD3QVRIJ.js";import"./chunk-ARQEJOEK.js";import{d as X}from"./chunk-JUJSA7KI.js";import{l as J,m as R}from"./chunk-KGNCKIFP.js";import{b as e}from"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import{a as i}from"./chunk-FTQLQJQV.js";import{promises as $e}from"node:fs";import Ue from"node:path";import Le from"node:http";var Q=e.object({socketPath:e.string().min(1).max(1e3),capability:e.string().regex(/^[a-f0-9]{64}$/),jobId:e.string().min(1),pinHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),Ne=e.object({jobId:e.string().min(1),pinHash:e.string().regex(/^[a-f0-9]{64}$/),requestId:e.string().min(1).max(500),model:X,reasoningEffort:e.enum(["off","low","medium","high","xhigh","max","none"]).nullable(),messages:e.array(e.unknown()).min(1).max(1e3),tools:e.array(e.unknown()).max(100),toolChoice:e.unknown(),maxOutputTokens:e.number().int().positive().max(131072),temperature:e.number().finite().optional(),topP:e.number().finite().optional(),seed:e.number().int().optional()}).strict(),Je=e.discriminatedUnion("kind",[e.object({kind:e.literal("chat_completions_reasoning"),reasoningContent:e.string()}).strict(),e.object({kind:e.literal("responses_reasoning_items"),items:e.array(e.record(e.string(),e.unknown()))}).strict()]),Ve=e.object({id:e.string().optional(),type:e.string(),function:e.object({name:e.string().optional(),arguments:e.string().optional()}).passthrough().optional()}).passthrough(),Ge=e.object({text:e.string().optional(),usage:e.unknown().optional(),costUsd:e.number().finite().nonnegative().optional(),continuation:Je.optional(),toolCalls:e.array(Ve).optional()}).strict();function qe(s,r){let t=Q.parse(s);async function n(u,v,I=r){I.throwIfAborted();let x=Buffer.from(JSON.stringify({action:u,jobId:t.jobId,pinHash:t.pinHash,value:v}));if(x.length>8*1024*1024)throw new Error("Hosted advanced request exceeds its private byte limit.");return new Promise((y,h)=>{let l=Le.request({socketPath:t.socketPath,path:"/",method:"POST",headers:{authorization:`Bearer ${t.capability}`,"content-type":"application/json","content-length":x.length},signal:I},H=>{let E=[],P=0;H.on("data",w=>{if(P+=w.length,P>8388608){H.destroy(new Error("Hosted advanced response exceeds its private byte limit."));return}E.push(w)}),H.on("error",h),H.on("end",()=>{try{let w=JSON.parse(Buffer.concat(E).toString("utf8"));if(H.statusCode!==200)throw new Error(typeof w?.error=="string"?w.error:"The actual hosted advanced owner refused this operation.");y(w)}catch(w){h(w)}})});l.on("error",h),l.end(x)})}i(n,"call");let d=i(async function*(u){let v=Ne.parse({jobId:t.jobId,pinHash:t.pinHash,requestId:u.requestId,model:u.model,reasoningEffort:u.reasoningEffort,messages:u.messages,tools:u.tools,toolChoice:u.toolChoice,maxOutputTokens:u.maxOutputTokens??4096,...u.temperature===void 0?{}:{temperature:u.temperature},...u.topP===void 0?{}:{topP:u.topP},...u.seed===void 0?{}:{seed:u.seed}}),I=e.object({deltas:e.array(Ge).max(1e5)}).strict().parse(await n("model",v,AbortSignal.any([r,u.signal])));for(let x of I.deltas)yield x},"stream");return{stream:d,text:i(async u=>{let v="";for await(let I of d({...u,reasoningEffort:u.reasoningEffort??null,tools:[],toolChoice:"none"}))I.text&&(v+=I.text),I.usage!==void 0&&u.onUsage?.(I.usage,I.costUsd);return v},"text"),authorize:i(async()=>{await n("authorize",{})},"authorize"),ceiling:i(async(u,v,I)=>e.object({configurationHash:e.string().regex(/^[a-f0-9]{64}$/),maximumChargeUsd:e.number().finite().positive()}).strict().parse(await n("ceiling",{modelId:u,pricing:v,maximumOutputTokens:I})),"ceiling"),compute:i((u,v=!1)=>n("compute",u,v?AbortSignal.timeout(6e4):r),"compute"),checkpoint:i(u=>n("checkpoint",u),"checkpoint")}}i(qe,"createHostedAdvancedModelBridge");import Qe from"node:path";var Me=e.string().regex(/^[a-f0-9]{64}$/),Ke=e.object({taskId:e.string().min(1),caseHash:Me,session:C,turn:$,events:e.array(se).max(1e4),traceHash:Me,output:e.string().nullable()}).strict(),K=e.object({packageValue:ae,contexts:e.array(Ke).max(1e4)}).strict();async function _e(s){let r=V(s.pin),t=K.parse(s.privateSource),n=ie(t.packageValue),d=M(e.object({manifest:e.unknown(),result:e.unknown()}).parse(s.evidence));async function m(){if(await s.authorize(),r.actorId!==s.actor.actorId||r.teamId!==s.actor.teamId||r.profileRef.source!=="openpond_git"||r.profileRef.repositoryId!==s.source.repositoryId||r.profileRef.profileId!==s.source.profileId||r.sourceRevision!==s.source.sourceRevision)throw new Error("The actual hosted advanced source owner changed.")}if(i(m,"authorize"),await m(),d.manifest.teamId!==r.teamId||d.result.status!=="completed"||d.manifest.id!==r.evidence.id||d.result.contentHash!==r.evidence.contentHash||R(d.manifest.dataset)!==R(r.externalDatasetBinding.dataset))throw new Error("The exact completed hosted advanced evidence changed.");if(n.contentHash!==r.externalDatasetBinding.packageHash||n.contentHash!==r.adaptationDatasetBinding.packageHash||n.environment.contentHash!==r.environmentPolicy.environmentHash||n.environment.contract.networkPolicy!=="none")throw new Error("The hosted advanced environment/package is not the exact reviewed closed-network release.");if(n.taskset.tools.some(l=>l.name==="web_search"||l.name==="web_fetch"))throw new Error("Live external tools require their own qualified frozen-observation and budget owner.");if(n.verifierSet.graders.some(l=>l.kind==="human"||l.kind==="model_judge"&&l.calibrationStatus!=="passed"))throw new Error("Advanced hosted evaluation needs executable, qualified independent graders.");let u=r.adaptationTaskIds.map(l=>n.taskset.tasks.find(H=>H.id===l)),v=r.holdoutTaskIds.map(l=>n.taskset.tasks.find(H=>H.id===l)),I=new Set(u.map(l=>l?.clusterKey));if(u.some(l=>!l||l.split!==r.adaptationSplit)||v.some(l=>!l||l.split!==r.holdoutSplit||I.has(l.clusterKey)))throw new Error("Hosted adaptation/holdout membership or independent families changed.");let x=await s.store.getHarnessReleaseRecord(r.baselineRelease.contentHash);if(!x||x.harnessRelease.id!==r.baselineRelease.id||s.workspace.currentChannel.release?.contentHash!==r.baselineRelease.contentHash)throw new Error("The exact hosted source baseline is unavailable.");let y=await D({workspaceId:typeof x.agentSnapshot.metadata.workspaceId=="string"?x.agentSnapshot.metadata.workspaceId:x.workspaceId,sourceDir:Qe.join(x.bundlePath,"source")});if(z(y).protectedClosureHash!==r.privateClosureHash)throw new Error("The protected hosted Profile closure changed.");let h={packageValue:n,authorize:m};return{read:i(async l=>{if(V(l).contentHash!==r.contentHash)throw new Error("The actual hosted advanced admission changed.");return await m(),h},"read"),evidence:i(async()=>(await m(),d),"evidence"),authorize:i(async()=>m(),"authorize"),reviewContext:i(async(l,H)=>{await m();let E=t.contexts.filter(p=>p.taskId===H),P=d.result.cases.find(p=>p.identity.caseId===H);if(E.length!==1||!P||P.status!=="completed")throw new Error("The actual retained hosted review case is unavailable.");let w=E[0];if(w.caseHash!==R(P)||w.session.cloudTeamId!==r.teamId||w.turn.sessionId!==w.session.id||w.turn.status==="in_progress"||w.events.some(p=>p.sessionId!==w.session.id||p.turnId!==w.turn.id))throw new Error("The actual hosted review session/turn/trace binding changed.");return await m(),{...w,case:{output:w.output}}},"reviewContext")}}i(_e,"createHostedAdvancedRefinerSource");import{randomUUID as Ze}from"node:crypto";function Oe(s){async function r(n){let d=await s.store.getSession(n);if(!d||d.cloudTeamId!==s.teamId||d.metadata?.hostedAdvancedTurnId!==s.hostedTurnId||d.metadata?.parentModelRunId!==s.modelRunId)throw new Error("The actual hosted advanced case owner changed.");return d}i(r,"read");async function t(n,d,m){let u=await r(n),v=e.object({action:e.string()}).passthrough().parse(d).action;return ce.parse(await s.bridge.compute({session:u,payload:d,turnId:m??null},v==="sandbox_stop"||v==="sandbox_receipts"))}return i(t,"tool"),{createSession:i(async n=>{await s.bridge.authorize();let d=C.partial().parse(n),m=new Date().toISOString();if(d.metadata?.parentModelRunId!==s.modelRunId)throw new Error("The foreground case belongs to another actual advanced Run.");let u=C.parse({...d,id:`hosted-advanced-case-${Ze()}`,provider:"openpond",currentProfile:s.profileRef,cloudTeamId:s.teamId,cwd:null,codexThreadId:null,appId:null,appName:null,createdAt:m,updatedAt:m,status:"active",pinned:!1,archived:!1,order:0,hiddenFromDefaultSidebar:!0,title:d.title??"Advanced hosted evaluation case",metadata:{...d.metadata,source:"hosted-advanced-evaluation",hostedAdvancedTurnId:s.hostedTurnId,actorId:s.actorId,workspaceTarget:"hosted",benchmarkRuntime:"hosted_managed_work"}});return await s.store.insertSessionAtFront(u),await s.bridge.authorize(),u},"createSession"),getSession:r,runtimeEventsForSession:i(n=>s.store.runtimeEventsForSession(n),"runtimeEventsForSession"),executeWorkspaceTool:i((n,d,m)=>t(n,d,m?.turnId),"executeWorkspaceTool"),settleCostEvidence:i((n,d)=>t(n,{action:"sandbox_receipts",args:{}},d?.turnId),"settleCostEvidence")}}i(Oe,"createHostedAdvancedWorkRuntime");var Xe=e.string().regex(/^[a-f0-9]{64}$/),Be=e.object({version:e.string().min(1),source:e.string().min(1),effectiveAt:e.string().min(1),inputUsdPerMillionTokens:e.number().finite().nonnegative(),cachedInputUsdPerMillionTokens:e.number().finite().nonnegative(),outputUsdPerMillionTokens:e.number().finite().nonnegative()}).strict(),Z=e.object({operation:e.enum(["prepare_run","start","read","resume","cancel"]),request:ue,configuration:e.object({id:e.string().min(1),profileId:e.string().min(1),etag:Xe}).strict(),refinerRelease:Y,privateSource:K,upstream:e.object({modelId:e.string().min(1),revision:e.string().min(1),pricing:Be}).strict(),judgeModels:e.array(e.object({modelId:e.string().min(1),revision:e.string().min(1),pricing:Be}).strict()).max(50),bridge:Q.optional(),hostedTurnId:e.string().min(1).optional()}).strict();async function Fe(s){let r=Z.parse(s.request),t=r.request.pin;if(r.request.model.providerId!=="openpond"||r.request.model.modelId!==r.upstream.modelId||r.configuration.id!==r.request.modelId||r.configuration.profileId!==t.profileRef.profileId||r.request.profileId!==t.profileRef.profileId||r.refinerRelease.id!==t.refinerRelease.id||r.refinerRelease.contentHash!==t.refinerRelease.contentHash)throw new Error("The actual hosted advanced configuration/model/Refiner admission changed.");let n=`advanced-refiner-${R([t.actorId,t.teamId,t.operationId,t.contentHash,r.request.model,[r.request.seed],1]).slice(0,40)}`;if((r.operation==="start"||r.operation==="resume")&&(!r.bridge||!r.hostedTurnId))throw new Error("The actual hosted advanced execution grant is unavailable.");let m=r.bridge?qe(r.bridge,s.signal):null;if(r.bridge&&(r.bridge.jobId!==n||r.bridge.pinHash!==t.contentHash))throw new Error("The hosted model bridge belongs to another actual Run.");let u=i(async()=>{s.signal.throwIfAborted(),await s.authorize(),m&&await m.authorize()},"authorize"),v=await _e({...s,pin:t,privateSource:r.privateSource,authorize:u}),I=we(ve(s.storeDir));await I.persistRelease(r.refinerRelease),await I.writeSource(ee(r.refinerRelease.profile)),I.binding()?.release.contentHash!==t.refinerRelease.contentHash&&await I.transition(r.refinerRelease,{operation:"activate",bindingChanged:!0,actor:s.actor.actorId,reason:"Pin the actual hosted evaluation fork to its admitted immutable Refiner release.",authoringSkillHash:null});let y=ke({storeDir:s.storeDir,authorize:i(async()=>u(),"authorize"),packageForPin:i(async()=>r.privateSource.packageValue,"packageForPin"),prepareModel:i(async(c,f,k)=>{if(!m)throw new Error("The actual hosted model ceiling owner is unavailable.");return m.ceiling(c,k,f)},"prepareModel")}),h=i(async function*(c){let f=be(),k=[r.upstream,...r.judgeModels].find(q=>q.modelId===c.model.modelId);if(!m||!f||!k)throw new Error("The actual hosted model and durable shared budget are unavailable.");let{signal:T,...j}=c,O=c.maxOutputTokens??4096,L=await f.call(c.requestId,j,k.pricing,O,async()=>{let q=[],F=null;for await(let N of m.stream({...c,signal:AbortSignal.any([T,f.signal])}))q.push(N),N.costUsd!==void 0&&(F=(F??0)+N.costUsd);return{value:q,costUsd:F}});for(let q of L)yield q},"stream"),l=i(async c=>{let f="";for await(let k of h({...c,reasoningEffort:c.reasoningEffort??null,tools:[],toolChoice:"none"}))k.text&&(f+=k.text),k.usage!==void 0&&c.onUsage?.(k.usage,k.costUsd);return f},"text"),H=Ie({store:s.store,storeDir:s.storeDir}),E=await H.projectSelected({profileId:t.profileRef.profileId,package:r.privateSource.packageValue,adaptationSplit:t.adaptationSplit,holdoutSplit:t.holdoutSplit}),P=i(async c=>{let f=C.partial().parse(c),k=new Date().toISOString(),T=C.parse({...f,id:`hosted-review-${R([n,f.metadata]).slice(0,40)}`,cloudTeamId:t.teamId,currentProfile:t.profileRef,appId:null,appName:null,cwd:null,codexThreadId:null,title:f.title??"Hosted Refiner review",provider:"openpond",createdAt:k,updatedAt:k,status:"active",pinned:!1,archived:!1,order:0,metadata:{...f.metadata,hostedAdvancedTurnId:r.hostedTurnId??null,actorId:t.actorId,source:"hosted-advanced-evaluation"}});return await s.store.insertSessionAtFront(T),T},"createSession"),w=m&&r.hostedTurnId?Oe({store:s.store,bridge:m,teamId:t.teamId,actorId:t.actorId,hostedTurnId:r.hostedTurnId,modelRunId:n,profileRef:t.profileRef}):void 0,p=Se({store:s.store,storeDir:s.storeDir,modelJudge:ye({store:s.store,modelText:l}),modelText:l,modelStream:h,workRuntime:w,resolveTasksetRelease:i(c=>H.releaseForTaskset(c),"resolveTasksetRelease")}),a={store:s.store,storeDir:s.storeDir,evaluation:p,benchmarkTasksets:H,loadProfileState:i(async()=>s.profile,"loadProfileState"),resolveEvaluationProject:i(async(c,f)=>{if(await u(),c!==r.configuration.id||f!==r.configuration.profileId)throw new Error("The actual hosted evaluation configuration changed.");return{id:c,profileId:f}},"resolveEvaluationProject"),resolveUpstreamModel:i(async()=>({providerId:"openpond",modelId:r.upstream.modelId,revision:r.upstream.revision,pricing:r.upstream.pricing}),"resolveUpstreamModel"),advancedBoundary:y,refinerStream:i(async function*(c){if(!c.requestId)throw new Error("A hosted Refiner call needs its actual retained ID.");yield*h({model:c.model,reasoningEffort:"low",messages:c.messages,tools:[],toolChoice:"none",requestId:c.requestId,maxOutputTokens:4096,signal:c.signal,hostedTokenPricing:c.pricing})},"refinerStream")},o=Re({...a,reviewQuality:He({source:v,boundary:y,benchmark:a,createSession:P})}),g={advancedEvaluation:t,selectedTaskset:{id:E.id,revision:E.revision,contentHash:E.contentHash},modelId:r.request.modelId,profileId:r.request.profileId,model:r.request.model,reasoningEffort:r.request.reasoningEffort,seeds:[r.request.seed],repetitions:1,maximumSpendUsd:t.maximumCostUsd},b,S=i(()=>{o.cancel(n)},"stop");s.signal.addEventListener("abort",S,{once:!0});try{if(r.operation==="prepare_run")return o.prepare(g);let c=await s.store.getModelRun(n);if(!c||c.evaluation?.benchmarkId!=="harness-refiner"||c.evaluation.advancedEvaluation?.contentHash!==t.contentHash)throw new Error("The original hosted advanced Run is unavailable.");if(r.operation==="read")return c;if(r.operation==="cancel")return o.cancel(n);if(m){let T=!1;b=setInterval(()=>{T||(T=!0,s.store.getModelRun(n).then(j=>j?m.checkpoint(j):void 0).catch(()=>S()).finally(()=>{T=!1}))},2e3)}r.operation==="start"?await o.start(g):await o.resume(n);let f=await o.wait(n);if(!f)throw new Error("The actual hosted advanced engine did not retain its Run.");let k=pe.parse(f);return m&&await m.checkpoint(k),k}finally{b&&clearInterval(b),s.signal.removeEventListener("abort",S),await o.close(),await y.close()}}i(Fe,"runHostedAdvancedRefinerOwner");import{promises as _}from"node:fs";import A from"node:path";var Ye=e.object({actor:e.object({actorId:e.string().min(1),teamId:e.string().min(1)}).strict(),storeDir:e.string().min(1),source:e.object({repoPath:e.string().min(1),repositoryId:e.string().min(1),profileId:e.string().min(1),sourceRevision:e.string().regex(/^[a-f0-9]{40,64}$/),filesHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),evidence:e.object({manifest:e.unknown(),result:e.unknown()}).strict(),operation:e.enum(["advanced","describe","command","queue","cancelQueued","bind","finish","beginTesting","cancelTesting","failTesting","comparison","beginAdoption","export","source","tool","toolCatalog"]),advanced:Z.optional(),command:le.optional(),candidateId:e.string().optional(),revision:e.number().int().positive().optional(),actualSession:C.optional(),actualTurn:$.optional(),recipe:e.unknown().optional(),baseline:e.object({manifest:e.unknown(),result:e.unknown()}).strict().optional(),candidate:e.object({manifest:e.unknown(),result:e.unknown()}).strict().optional(),humanProjection:oe.optional(),humanSelections:re.optional(),adoptionReadback:e.unknown().optional(),failure:e.object({message:e.string().max(2e3),cancelled:e.boolean()}).strict().optional(),tool:e.object({name:e.string(),args:e.record(e.string(),e.unknown()),callId:e.string()}).strict().optional(),agentRuntime:e.object({source:e.string(),cliRelativePath:e.string()}).strict().optional(),queued:e.object({sessionId:e.string(),turnId:e.string(),createdAt:e.string().datetime()}).strict().optional()}).strict();async function We(s,r=new AbortController().signal){r.throwIfAborted();let t=Ye.parse(s),{actor:n,source:d}=t;if(!A.isAbsolute(t.storeDir)||!A.isAbsolute(d.repoPath))throw new Error("Hosted candidate owner requires contained absolute private paths.");let m=M(t.evidence),u=[t.baseline,t.candidate].filter(l=>l!==void 0).map(l=>M(l));if(m.manifest.teamId!==n.teamId)throw new Error("Hosted candidate evidence belongs to another team.");if(await B(d.repoPath)!==d.filesHash)throw new Error("The admitted hosted Profile source bytes changed.");let v=`hosted-improve-source-${R([n,d.repositoryId,d.profileId,d.sourceRevision]).slice(0,40)}`,I=A.join(t.storeDir,"library","profile-experiment-origins",v);if(await _.mkdir(A.dirname(I),{recursive:!0,mode:448}),await _.stat(I).catch(()=>null)||await _.cp(d.repoPath,I,{recursive:!0,errorOnExist:!0,force:!1}),await B(I)!==d.filesHash)throw new Error("The private accepted Profile cache changed.");let x=await W(I,d.profileId);if(x.error||!x.sourcePath)throw new Error("The accepted hosted Profile does not compile.");let y=new xe(t.storeDir),h;try{let l=await y.getHarnessWorkspace(v);l||(l=(await fe({store:y,storeDir:t.storeDir,id:v,ownerId:n.actorId,name:d.profileId,profile:x,sourceRevision:d.sourceRevision,repositoryId:d.repositoryId,selectionEligible:!1,originMetadata:{profileExperimentOrigin:{schemaVersion:"openpond.profileExperimentOrigin.v1",...n,sourceRevision:d.sourceRevision,sourcePath:I,sourceFilesHash:d.filesHash},hostedImprovementOwner:!0}})).workspace);let H={source:"openpond_git",repositoryId:d.repositoryId,profileId:d.profileId},E=i(async()=>{if(r.throwIfAborted(),await B(I)!==d.filesHash||await B(d.repoPath)!==d.filesHash)throw new Error("Accepted source changed during private candidate I/O.")},"authorizer");if(t.operation==="advanced"){if(!t.advanced)throw new Error("Missing actual hosted advanced owner command.");return Fe({store:y,storeDir:t.storeDir,actor:n,profile:x,workspace:l,source:d,evidence:m,request:t.advanced,authorize:E,signal:r})}let P=i(()=>{if(!t.adoptionReadback)throw new Error("Actual hosted Git owner has not returned its sealed adoption receipt.");return e.object({receipt:e.object({id:e.string(),contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),activeRelease:e.object({id:e.string(),contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),testedCandidateRelease:e.object({id:e.string(),contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),executableSourceHash:e.string().regex(/^[a-f0-9]{64}$/),protectedClosureHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict().parse(t.adoptionReadback)},"readback");h=Ee({store:y,storeDir:t.storeDir,projectHumanComparison:i(async()=>{if(await E(),!t.humanProjection)throw new Error("The current private Human comparison owner is unavailable.");return ne(t.humanProjection)},"projectHumanComparison"),authorizeOwner:i(async(a,o,g,b,S)=>{if(R(a)!==R(n)||R(g)!==R(H)||o.id!==v)throw new Error("Hosted candidate source owner changed.");if(S.requireCurrentBase&&(o.currentChannel.release?.contentHash!==l.currentChannel.release?.contentHash||d.sourceRevision!==o.metadata.profileExperimentOrigin.sourceRevision))throw new Error("Hosted candidate accepted revision changed.");await E()},"authorizeOwner"),loadEvidence:i(async(a,o)=>{if(R(a)!==R(n))throw new Error("Hosted candidate evidence actor changed.");let g=[m,...u].find(b=>b.manifest.id===o.id&&b.result.contentHash===o.contentHash&&b.manifest.teamId===n.teamId);if(!g)throw new Error("Hosted candidate exact retained evidence changed.");return await E(),g},"loadEvidence"),freezeProfile:i(async(a,o,g)=>{let b=await y.getHarnessReleaseRecord(o.baseRelease.contentHash);if(!b)throw new Error("Hosted source baseline is missing.");let S=await D({workspaceId:typeof b.agentSnapshot.metadata.workspaceId=="string"?b.agentSnapshot.metadata.workspaceId:b.workspaceId,sourceDir:A.join(b.bundlePath,"source")}),c=await D({workspaceId:typeof g.release.agentSnapshot.metadata.workspaceId=="string"?g.release.agentSnapshot.metadata.workspaceId:g.release.workspaceId,sourceDir:A.join(g.release.bundlePath,"source")});return Ae({store:y,storeDir:t.storeDir,state:o},async f=>{await Ce({...f,state:o,base:S,candidate:c});let k=await W(f.root,o.profileRef.profileId),T=await U({storeDir:t.storeDir,state:o,profile:k,sourceRevision:g.profileSourceRevision,base:S}),j=z(T);if(j.protectedClosureHash!==z(S).protectedClosureHash)throw new Error("Hosted source candidate changed protected evaluation closure.");let O=A.join(t.storeDir,"library","profile-candidate-archives",o.id,j.contentHash);await _.mkdir(A.dirname(O),{recursive:!0,mode:448}),await _.stat(O).catch(()=>null)||await _.cp(f.root,O,{recursive:!0,errorOnExist:!0,force:!1});let L=await W(O,o.profileRef.profileId);if((await U({storeDir:t.storeDir,state:o,profile:L,sourceRevision:g.profileSourceRevision,base:S})).harnessRelease.contentHash!==T.harnessRelease.contentHash)throw new Error("Hosted frozen Profile archive readback differs.");let F=await he({storeDir:t.storeDir,workspaceId:g.release.workspaceId,compiled:T,createdAt:g.release.createdAt});return await E(),{...g,release:F,executableIdentity:j}})},"freezeProfile"),adopt:i(async()=>P(),"adopt"),readAdoption:i(async()=>t.adoptionReadback?P():null,"readAdoption"),rollback:i(async()=>P(),"rollback")});let w=Pe({store:y,improvements:h,actorId:i(async()=>n.actorId,"actorId"),teamId:i(async()=>n.teamId,"teamId"),loadProfile:i(async a=>{if(R(a)!==R(H))throw new Error("Candidate requested another source owner.");return x},"loadProfile"),agentRuntime:t.agentRuntime,operationSignal:r,loadAgentRuntime:De({storeDir:t.storeDir,loadArchive:ze({storeDir:t.storeDir})})});if(t.operation==="describe"){await E();let a=l.currentChannel.release,o=a?await y.getHarnessReleaseRecord(a.contentHash):null;if(!a||!o||o.workspaceId!==l.id||o.harnessRelease.id!==a.id||o.harnessRelease.contentHash!==a.contentHash||l.ownerScope.kind!=="personal"||l.ownerScope.id!==n.actorId)throw new Error("Hosted source release is unavailable to its admitted owner.");let g=await D({workspaceId:typeof o.agentSnapshot.metadata.workspaceId=="string"?o.agentSnapshot.metadata.workspaceId:v,sourceDir:A.join(o.bundlePath,"source")});if(g.harnessRelease.contentHash!==o.harnessRelease.contentHash)throw new Error("Hosted source compiler readback changed.");let b=await ge({runtime:{release:o},ref:H,sourceRevision:d.sourceRevision,harnessRelease:a}),S=i(c=>{let f=g.sourceFiles.find(k=>k.path===c)?.bytes;return f?JSON.parse(Buffer.from(f).toString("utf8")):null},"readJson");return await E(),{workspaceId:v,ownerRevision:l.revision,profileRef:H,baseRelease:l.currentChannel.release,profileSourceRevision:d.sourceRevision,manifest:g.manifest,executable:z(g),catalogHash:b.catalogHash,workflows:S("workflows/catalog.json"),actions:S("workflows/actions.json")}}if(t.operation==="command"){let a=t.command;if(!a)throw new Error("Missing canonical Improve command.");if(a.operation==="start")return h.start(n,a.request);if(a.operation==="list")return h.list(n,a.limit,a.cursor);if(!("id"in a))throw new Error("Discover exact hosted source choices through the authenticated host.");let o=await h.read(n,a.id);if(a.operation==="read")return o;if(a.operation==="instructions"){let g=await h.partition(n,o.id),b=await me(g.sourceRoot,o.component.path),S=await _.readFile(b);if(S.length>25e4)throw new Error("Instruction editor size limit exceeded.");let c=S.toString("utf8");if(o.component.kind==="workflow"){let f=JSON.parse(c).workflows?.find(k=>k.id===o.component.workflowId);if(f?.invocation?.kind!=="instructions")throw new Error("Use Work to author this executable Workflow.");c=f.invocation.instructions}return{candidateId:o.id,candidateRevision:o.revision,path:o.component.path,text:c,textHash:J(c),contentHash:J(S)}}if(a.operation==="humanComparisonOptions")throw new Error("Read the actual paired sources through their current hosted Experiment owner.");if(!("revision"in a)||o.revision!==a.revision)throw new Error("Candidate revision changed.");if(a.operation==="edit")return h.edit(n,o.id,o.revision,a.expectedFileHash,a.text);if(a.operation==="mode")return h.setMode(n,o.id,o.revision,a.mode);if(a.operation==="freeze")return h.freeze(n,o.id,o.revision);if(a.operation==="useCandidate")return h.useCandidate(n,o.id,o.revision);if(a.operation==="rollback")return h.rollback(n,o.id,o.revision);if(a.operation==="discard")return h.discard(n,o.id,o.revision);throw new Error("Hosted Work/test lifecycle requires the actual host turn/run admission.")}if(!t.candidateId)throw new Error("Missing actual hosted candidate ID.");let p=await h.read(n,t.candidateId);if(t.operation==="beginAdoption")return h.beginAdoption(n,p.id,t.revision);if(t.operation==="export")return je(y,p,"hosted_execution");if(t.operation==="source"){if(!p.frozen||p.status!=="frozen"&&p.status!=="testing"&&p.status!=="ready_for_review"&&p.status!=="adopting")throw new Error("Only the exact frozen source can enter hosted preparation.");let a=await y.getHarnessReleaseRecord(p.frozen.release.contentHash);if(!a||a.harnessRelease.id!==p.frozen.release.id)throw new Error("Frozen hosted source is unavailable.");let o=await D({workspaceId:typeof a.agentSnapshot.metadata.workspaceId=="string"?a.agentSnapshot.metadata.workspaceId:a.workspaceId,sourceDir:A.join(a.bundlePath,"source")}),g=z(o);if(o.harnessRelease.contentHash!==p.frozen.release.contentHash||g.contentHash!==p.frozen.executableSourceHash||g.protectedClosureHash!==p.frozen.protectedClosureHash)throw new Error("Frozen hosted executable changed.");let b=A.join(t.storeDir,"library","profile-candidate-archives",p.id,g.contentHash),S=await W(b,p.profileRef.profileId);if(S.error||!S.sourcePath)throw new Error("Frozen actual Profile archive is unavailable.");let c=await y.getHarnessReleaseRecord(p.baseRelease.contentHash);if(!c)throw new Error("Frozen baseline is unavailable.");let f=await D({workspaceId:typeof c.agentSnapshot.metadata.workspaceId=="string"?c.agentSnapshot.metadata.workspaceId:c.workspaceId,sourceDir:A.join(c.bundlePath,"source")}),k=await U({storeDir:t.storeDir,state:p,profile:S,sourceRevision:p.frozen.profileSourceRevision,base:f});if(k.harnessRelease.contentHash!==p.frozen.release.contentHash||z(k).contentHash!==g.contentHash)throw new Error("Actual frozen Profile archive differs from its compiled release.");return{state:p,profileSource:{repoPath:b,profileId:p.profileRef.profileId,sourceRevision:p.frozen.profileSourceRevision,repositoryId:p.profileRef.repositoryId,filesHash:await B(b)},sourcePackage:te({agentSnapshot:o.agentSnapshot,harnessRelease:o.harnessRelease,files:new Map(o.sourceFiles.map(T=>[T.path,T.bytes]))})}}if(t.operation==="comparison"){if(!t.baseline||!t.candidate)throw new Error("Missing actual hosted paired evidence.");return h.completeComparison(n,p.id,t.revision,M(t.baseline),M(t.candidate),t.humanSelections)}if(t.operation==="beginTesting")return h.beginTesting(n,p.id,t.revision,t.recipe);if(t.operation==="failTesting"){if(!t.failure)throw new Error("Missing actual hosted test failure.");return h.failTesting(n,p.id,t.revision,t.failure.message,t.failure.cancelled)}if(t.operation==="cancelTesting")return h.cancelTesting(n,p.id,t.revision);if(t.operation==="queue"){if(!t.queued)throw new Error("Missing actual hosted queue admission.");return h.queueAuthoringTurn(n,p.id,t.revision,t.queued.sessionId,t.queued.turnId,t.queued.createdAt)}if(t.operation==="cancelQueued")return h.cancelQueuedAuthoring(n,p.id,t.revision);if(t.operation==="bind"||t.operation==="finish"||t.operation==="tool"||t.operation==="toolCatalog"){if(!t.actualSession||!t.actualTurn||t.actualTurn.sessionId!==t.actualSession.id||t.actualSession.cloudTeamId!==n.teamId||R(t.actualSession.currentProfile)!==R(H))throw new Error("Actual hosted candidate Work binding changed.");let a=t.actualSession,o=t.actualTurn,g=await y.getSession(a.id);if(!g)await y.insertSessionAtFront(a);else if(R({...g,updatedAt:a.updatedAt,status:a.status})!==R(a))throw new Error("Retained hosted candidate session changed.");let b=await y.getTurn(o.id);if(!b)await y.insertTurn(o);else{if(b.sessionId!==o.sessionId||R(b.metadata.refinementCandidate)!==R(o.metadata.refinementCandidate)||b.prompt!==o.prompt)throw new Error("Actual hosted candidate turn identity changed.");await y.updateTurn(o.id,()=>o)}if(t.operation==="bind")return h.bindAuthoringTurn(n,p.id,t.revision,a.id,o.id);if(t.operation==="finish")return h.finishAuthoring(n,p.id,t.revision);if(t.operation==="toolCatalog")return await w.candidateAuthoringForTurn(a.id,o.id),[...G({loadProfileState:i(async()=>x,"loadProfileState"),resolveCandidateProfile:w.resolveCandidateProfile,executeCandidateAgentCommand:w.executeCandidateAgentCommand}),...Te(async()=>{throw new Error("Hosted file tools require a bound private call.")}),{name:"exec_command",description:"Run a bounded command confined to the selected public candidate component.",parameters:{type:"object",additionalProperties:!1,properties:{command:{type:"string",minLength:1,maxLength:2e4},cwd:{type:"string"}},required:["command"]}},{name:"view_image",description:"Inspect an image inside the candidate public source tree.",parameters:{type:"object",additionalProperties:!1,properties:{path:{type:"string"}},required:["path"]}}].map(({name:c,description:f,parameters:k})=>({name:c,description:f,parameters:k}));if(!t.tool)throw new Error("Missing candidate tool call.");await w.authorizeCandidateTool({sessionId:a.id,turnId:o.id,name:t.tool.name});let S={session:a,turnId:o.id,args:t.tool.args,callId:t.tool.callId,signal:r,workspaceDiffBaseline:null,turnPermissions:{approvalPolicy:"never",sandbox:"workspace-write",codexPermissionMode:"default"},provider:a.provider,model:o.modelRef?.modelId??a.modelRef?.modelId??"",mentionedApps:[],userPrompt:o.prompt,turnMetadata:o.metadata};if(t.tool.name==="get_profile"||t.tool.name.startsWith("agent_")||t.tool.name==="ask_user"){let c=G({loadProfileState:i(async()=>x,"loadProfileState"),resolveCandidateProfile:w.resolveCandidateProfile,executeCandidateAgentCommand:w.executeCandidateAgentCommand}).find(f=>f.name===t.tool.name);if(!c)throw new Error("Candidate authoring tool is unavailable.");return c.execute(S)}if(t.tool.name==="view_image")return w.executeCandidateImage(S);if(t.tool.name==="exec_command")return w.executeCandidateCommand(S,{session:a,turnId:o.id,command:e.string().min(1).max(2e4).parse(t.tool.args.command),cwd:typeof t.tool.args.cwd=="string"?t.tool.args.cwd:null,signal:S.signal,source:"model_tool"});if(["list_files","read_files","search_files","workspace_status","write_file","write_files","edit_file","delete_file"].includes(t.tool.name))return w.executeCandidateWorkspaceTool({session:a,turnId:o.id,request:de.parse({action:t.tool.name,args:t.tool.args,source:"chat_action"})});throw new Error("This hosted tool has no confined candidate transport.")}throw new Error("Unknown private hosted Improve operation.")}finally{await h?.close(),await y.close()}}i(We,"runHostedExperimentImprovementOwner");async function wr(s){if(s.length!==1||s[0].length>16e3||!/^[A-Za-z0-9_-]+$/.test(s[0]))throw new Error("Hosted Improve IPC argument is invalid.");let r=e.object({directory:e.string(),file:e.string().regex(/^[A-Za-z0-9_-]+\.json$/)}).strict().parse(JSON.parse(Buffer.from(s[0],"base64url").toString("utf8")));if(!Ue.isAbsolute(r.directory))throw new Error("Hosted Improve IPC requires an absolute private directory.");let t=Ue.join(r.directory,r.file),n=await $e.lstat(t);if(!n.isFile()||n.isSymbolicLink()||n.size>32*1024*1024)throw new Error("Hosted Improve private request exceeds its byte/type limit.");let d=new AbortController,m=i(()=>d.abort(new Error("The actual hosted owner stopped this private operation.")),"stop");process.once("SIGTERM",m),process.once("SIGINT",m);try{let u=await We(JSON.parse(await $e.readFile(t,"utf8")),d.signal),v=Buffer.from(JSON.stringify(u));if(v.length>32*1024*1024)throw new Error("Hosted Improve private response exceeds its byte limit.");process.stdout.write(`${v.toString("utf8")}
|
|
3
|
-
`)}finally{process.removeListener("SIGTERM",m),process.removeListener("SIGINT",m)}}i(wr,"runHostedExperimentImprovementCli");export{wr as runHostedExperimentImprovementCli};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{b as a,c as b}from"./chunk-VJEZPDBS.js";import"./chunk-STDMBJOQ.js";import"./chunk-2DFR7PJ4.js";import"./chunk-5CMKGD43.js";import"./chunk-4WEUCGJ3.js";import"./chunk-MVF3F5QS.js";import"./chunk-L4235TRQ.js";import"./chunk-DLVPSCTB.js";import"./chunk-WDFLCNRC.js";import"./chunk-JIMU3KDA.js";import"./chunk-6MI4KKWF.js";import"./chunk-QDHMP5FS.js";import"./chunk-YDT7L3VZ.js";import"./chunk-6FA3GG5B.js";import"./chunk-55G6B54U.js";import"./chunk-KD3QVRIJ.js";import"./chunk-ARQEJOEK.js";import"./chunk-JUJSA7KI.js";import"./chunk-KGNCKIFP.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import"./chunk-FTQLQJQV.js";export{a as loadHostedHarnessRuntime,b as loadHostedHarnessRuntimeForSession};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a,e as F}from"./chunk-CGBI2VYJ.js";import{a as O}from"./chunk-QKD5OMDI.js";import{a as h}from"./chunk-OSIO7PLX.js";import{F as w,Sa as I,Va as D,Wa as M}from"./chunk-2DFR7PJ4.js";import"./chunk-5CMKGD43.js";import"./chunk-MVF3F5QS.js";import"./chunk-L4235TRQ.js";import"./chunk-DLVPSCTB.js";import"./chunk-WDFLCNRC.js";import{kf as A}from"./chunk-JIMU3KDA.js";import"./chunk-6MI4KKWF.js";import"./chunk-QDHMP5FS.js";import"./chunk-YDT7L3VZ.js";import"./chunk-6FA3GG5B.js";import"./chunk-55G6B54U.js";import{n as R}from"./chunk-KD3QVRIJ.js";import"./chunk-ARQEJOEK.js";import"./chunk-JUJSA7KI.js";import{k as C,l as v}from"./chunk-KGNCKIFP.js";import{b as c}from"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import{a as f}from"./chunk-FTQLQJQV.js";import{promises as m}from"node:fs";import n from"node:path";var $=c.object({action:c.enum(["stage","readback","rollback"]),repoPath:c.string(),outputDir:c.string(),exportFile:c.string(),commit:c.string().regex(/^[a-f0-9]{40}$/).optional(),expectedExecutableSourceHash:c.string().regex(/^[a-f0-9]{64}$/).optional()}).strict();async function z(l){let e=$.parse(l);if(!n.isAbsolute(e.repoPath)||!n.isAbsolute(e.outputDir)||!/^[a-zA-Z0-9_-]+\.json$/.test(e.exportFile))throw new Error("Hosted candidate private IPC is not contained.");let g=n.join(e.outputDir,e.exportFile),H=await m.lstat(g);if(!H.isFile()||H.isSymbolicLink()||H.size>8*1024*1024)throw new Error("Hosted candidate export exceeds its private IPC bound.");let t=O(JSON.parse(await m.readFile(g,"utf8"))),u=await w({repoPath:e.repoPath,profileId:t.profileRef.profileId});if(u.error||!u.sourcePath)throw new Error("Actual hosted Profile source is unavailable.");if(e.action!=="readback"){let o=!1;try{await a(e.repoPath,["symbolic-ref","-q","HEAD"]),o=!0}catch{}if(o||await a(e.repoPath,["rev-parse","HEAD"])!==(e.action==="rollback"?e.commit:t.expectedCommit)||await a(e.repoPath,["status","--porcelain","--untracked-files=all"]))throw new Error("Candidate staging requires a clean detached exact original source worktree.")}let x=f(async o=>I({storeDir:e.outputDir,workspaceId:t.compiler.workspaceId,name:t.compiler.name,profile:await w({repoPath:e.repoPath,profileId:t.profileRef.profileId}),sourceRevision:o,repositoryId:t.compiler.repositoryId}),"compile");if(e.action==="readback"){if(!e.commit||await a(e.repoPath,["rev-parse","HEAD"])!==e.commit)throw new Error("Hosted Profile readback is not the committed source.");let o=await x(e.commit),i=h(o);if(i.profileGitHead!==e.commit||i.contentHash!==(e.expectedExecutableSourceHash??t.executableSourceHash)||i.protectedClosureHash!==t.protectedClosureHash)throw new Error("Hosted active executable differs from the actual tested candidate.");let s=await M({storeDir:e.outputDir,workspaceId:t.compiler.workspaceId,compiled:o,createdAt:t.createdAt});return{commit:e.commit,activeRelease:{id:s.harnessRelease.id,contentHash:s.harnessRelease.contentHash},executableSourceHash:i.contentHash,protectedClosureHash:i.protectedClosureHash}}if(e.action==="rollback"){if(!e.commit)throw new Error("Rollback requires the exact accepted commit.");await a(e.repoPath,["-c","core.hooksPath=/dev/null","revert","--no-commit",e.commit])}let p=await x(t.expectedCommit);if(p.harnessRelease.contentHash!==t.baseRelease.contentHash||p.harnessRelease.id!==t.baseRelease.id)throw new Error("Hosted original source differs from the owner-attested baseline release.");if(e.action==="stage"){let o=Buffer.from(t.sourceManifest.base64,"base64");if(o.toString("base64")!==t.sourceManifest.base64||o.length!==t.sourceManifest.sizeBytes||v(o)!==t.sourceManifest.contentHash)throw new Error("Candidate source manifest byte identity differs.");let i=A.parse(JSON.parse(o.toString("utf8"))),s=n.join(e.outputDir,"candidate-source");await m.mkdir(s,{recursive:!0}),await m.writeFile(n.join(s,"harness.json"),C(i));let _=R(t.policySource),j=new Map(p.sourceFiles.filter(r=>r.asset.visibility!=="policy").map(r=>[r.path,r]));for(let r of i.files){let k=r.visibility==="policy"?_.get(r.path):j.get(r.path)?.bytes;if(!k)throw new Error("The hosted source cannot hydrate the exact protected candidate closure.");let y=n.join(s,r.path);if(n.relative(s,y).startsWith(".."))throw new Error("Candidate release path escapes private staging.");await m.mkdir(n.dirname(y),{recursive:!0}),await m.writeFile(y,k)}let P=await D({workspaceId:t.compiler.workspaceId,sourceDir:s}),S=h(P);if(P.harnessRelease.contentHash!==t.policySource.harnessRelease.contentHash||S.contentHash!==t.executableSourceHash||S.protectedClosureHash!==t.protectedClosureHash)throw new Error("Owner-attested candidate differs from independently compiled hosted source.");await F({source:u.sourcePath,state:{component:t.component},base:p,candidate:P,profile:u})}await a(e.repoPath,["add","--all"]),await a(e.repoPath,["-c","core.hooksPath=/dev/null","-c","commit.gpgSign=false","commit","-m",`${e.action==="rollback"?"Roll back":"Adopt"} owner-tested candidate ${t.candidateId}`],{GIT_AUTHOR_NAME:"OpenPond",GIT_AUTHOR_EMAIL:"profile-candidate@openpond.local",GIT_COMMITTER_NAME:"OpenPond",GIT_COMMITTER_EMAIL:"profile-candidate@openpond.local"});let E=await a(e.repoPath,["rev-parse","HEAD"]),T=await w({repoPath:e.repoPath,profileId:t.profileRef.profileId}),b=await I({storeDir:e.outputDir,workspaceId:t.compiler.workspaceId,name:t.compiler.name,profile:T,sourceRevision:E,repositoryId:t.compiler.repositoryId}),d=h(b);if(e.action==="stage"&&(d.contentHash!==t.executableSourceHash||d.protectedClosureHash!==t.protectedClosureHash)||e.action==="rollback"&&(d.contentHash!==h(p).contentHash||d.protectedClosureHash!==h(p).protectedClosureHash))throw new Error("Staged actual source differs from its exact tested executable graph.");return{commit:E,activeRelease:{id:b.harnessRelease.id,contentHash:b.harnessRelease.contentHash},executableSourceHash:d.contentHash,protectedClosureHash:d.protectedClosureHash}}f(z,"hostedProfileCandidate");async function Q(l){if(l.length!==1||l[0].length>16e3||!/^[a-zA-Z0-9_-]+$/.test(l[0]))throw new Error("Hosted candidate IPC argument is invalid.");process.stdout.write(`${JSON.stringify(await z(JSON.parse(Buffer.from(l[0],"base64url").toString("utf8"))))}
|
|
3
|
-
`)}f(Q,"runHostedProfileCandidateCli");export{z as hostedProfileCandidate,Q as runHostedProfileCandidateCli};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d}from"./chunk-R2BSIRYL.js";import"./chunk-2DFR7PJ4.js";import"./chunk-5CMKGD43.js";import"./chunk-MVF3F5QS.js";import"./chunk-L4235TRQ.js";import"./chunk-DLVPSCTB.js";import"./chunk-WDFLCNRC.js";import"./chunk-JIMU3KDA.js";import"./chunk-6MI4KKWF.js";import"./chunk-QDHMP5FS.js";import"./chunk-YDT7L3VZ.js";import"./chunk-6FA3GG5B.js";import"./chunk-55G6B54U.js";import"./chunk-KD3QVRIJ.js";import"./chunk-ARQEJOEK.js";import"./chunk-JUJSA7KI.js";import"./chunk-KGNCKIFP.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import"./chunk-FTQLQJQV.js";export{a as compileHostedProfileRelease,b as runHostedProfileCompilerCli,c as runHostedProfileEvaluationCli,d as runHostedProfileInspectionCli};
|
|
@@ -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 c}from"./chunk-GGIG3XU7.js";import{a as l}from"./chunk-MVF3F5QS.js";import{Va as f}from"./chunk-JIMU3KDA.js";import"./chunk-6MI4KKWF.js";import{a as s,e as u}from"./chunk-QDHMP5FS.js";import"./chunk-YDT7L3VZ.js";import"./chunk-6FA3GG5B.js";import"./chunk-55G6B54U.js";import"./chunk-KD3QVRIJ.js";import"./chunk-JUJSA7KI.js";import{n as t}from"./chunk-KGNCKIFP.js";import{b as n}from"./chunk-ES2ISFJC.js";import{a as i}from"./chunk-FTQLQJQV.js";var v=n.object({profileRef:f,sourceRevision:n.string().min(1),action:n.enum(["compare","report"]),request:n.unknown(),runs:n.array(l).max(1e4),comparisons:n.array(s).max(1e4),suiteRuns:n.array(u).max(1e4)}).strict();async function h(p){let o=v.parse(p);for(let e of[...o.runs,...o.comparisons,...o.suiteRuns])t(e,"Hosted evaluation evidence");let a={getProfileEvaluationRun:i(async e=>o.runs.find(r=>r.manifest.id===e)??null,"getProfileEvaluationRun"),getProfileEvaluationComparison:i(async e=>o.comparisons.find(r=>r.id===e)??null,"getProfileEvaluationComparison"),getProfileEvaluationSuiteRun:i(async e=>o.suiteRuns.find(r=>r.id===e)??null,"getProfileEvaluationSuiteRun"),saveProfileEvaluationComparison:i(async(e,r)=>r,"saveProfileEvaluationComparison")};return o.action==="compare"?m({store:a,selectedProfile:i(async()=>({ref:o.profileRef,sourceRevision:o.sourceRevision}),"selectedProfile")})(o.request):c({store:a,profileRef:o.profileRef,request:o.request})}i(h,"controlHostedProfileEvaluation");export{h as controlHostedProfileEvaluation};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{c as R,d as P}from"./chunk-OULAKUIN.js";import{a as E}from"./chunk-MVF3F5QS.js";import{Q as h,Va as v,Wa as S,Xa as w,gb as y}from"./chunk-JIMU3KDA.js";import"./chunk-6MI4KKWF.js";import"./chunk-QDHMP5FS.js";import"./chunk-YDT7L3VZ.js";import"./chunk-6FA3GG5B.js";import{B as g}from"./chunk-55G6B54U.js";import{E as m}from"./chunk-KD3QVRIJ.js";import"./chunk-JUJSA7KI.js";import"./chunk-KGNCKIFP.js";import{b as s}from"./chunk-ES2ISFJC.js";import{a as n}from"./chunk-FTQLQJQV.js";var I=s.object({profileRef:v,inspection:R,run:E.nullable(),receipts:s.array(g).max(1e4),grades:s.array(m).max(1e4),sessions:s.array(S).max(1e4),turns:s.array(w).max(1e4),events:s.array(h).max(1e4),usage:s.array(y).max(1e4)}).strict();async function x(c){let t=I.parse(c),o=n((e,i)=>{let f=new Map;for(let p of e){let d=i(p);if(f.has(d))throw new Error("Hosted evaluation inspection has duplicate evidence identities.");f.set(d,p)}return f},"map"),r=o(t.receipts,e=>e.id),u=o(t.grades,e=>e.contentHash),l=o(t.sessions,e=>e.id),a=o(t.turns,e=>e.id);return P({profileRef:t.profileRef,...t.inspection,store:{getProfileEvaluationRun:n(async e=>t.run?.manifest.id===e?t.run:null,"getProfileEvaluationRun"),getProfileEvaluationReceipt:n(async e=>r.get(e)??null,"getProfileEvaluationReceipt"),getProfileEvaluationGrade:n(async e=>u.get(e)??null,"getProfileEvaluationGrade"),getSession:n(async e=>l.get(e)??null,"getSession"),getTurn:n(async e=>a.get(e)??null,"getTurn"),runtimeEventsForTurn:n(async e=>t.events.filter(i=>i.turnId===e),"runtimeEventsForTurn"),listModelUsageRecords:n(async e=>t.usage.filter(i=>(!e?.sessionId||i.sessionId===e.sessionId)&&(!e?.turnId||i.turnId===e.turnId)),"listModelUsageRecords")}})}n(x,"inspectHostedProfileEvaluation");async function B(c){if(c.length!==0)throw new Error("Hosted evaluation inspection uses bounded standard input.");let t=[],o=0;for await(let l of process.stdin){let a=Buffer.from(l);if(o+=a.length,o>32*1024*1024)throw new Error("Hosted evaluation inspection input is too large.");t.push(a)}let r=JSON.parse(Buffer.concat(t).toString("utf8")),u=r.action==="compare"||r.action==="report"?await(await import("./hosted-profile-evaluation-control-FKGARUEE.js")).controlHostedProfileEvaluation(r):await x(r);process.stdout.write(`${JSON.stringify(u)}
|
|
3
|
-
`)}n(B,"runHostedProfileInspectionCli");export{x as inspectHostedProfileEvaluation,B as runHostedProfileInspectionCli};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as V}from"./chunk-R2BSIRYL.js";import{c as I,f as j,h as D}from"./chunk-OWNLDB2O.js";import{k as x}from"./chunk-T4QGDQHP.js";import{a as E}from"./chunk-OSIO7PLX.js";import"./chunk-STDMBJOQ.js";import{Ma as b,Va as C}from"./chunk-2DFR7PJ4.js";import"./chunk-5CMKGD43.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-4WEUCGJ3.js";import"./chunk-MVF3F5QS.js";import"./chunk-L4235TRQ.js";import"./chunk-DLVPSCTB.js";import"./chunk-WDFLCNRC.js";import"./chunk-JIMU3KDA.js";import"./chunk-6MI4KKWF.js";import{m}from"./chunk-QDHMP5FS.js";import{wa as S}from"./chunk-YDT7L3VZ.js";import"./chunk-6FA3GG5B.js";import"./chunk-55G6B54U.js";import{Ja as H,c as P,f as R,v as y}from"./chunk-KD3QVRIJ.js";import"./chunk-ARQEJOEK.js";import"./chunk-JUJSA7KI.js";import{m as d}from"./chunk-KGNCKIFP.js";import{b as e}from"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import{a as s}from"./chunk-FTQLQJQV.js";import{readFile as h,realpath as z,lstat as T}from"node:fs/promises";import l from"node:path";var B=e.object({compile:e.object({repoPath:e.string(),profileId:e.string(),repositoryId:e.string(),sourceRevision:e.string(),workspaceId:e.string(),outputDir:e.string()}).strict(),externalDatasetPackage:e.string().regex(/^external-dataset-[a-f0-9-]+\.json$/).optional(),sourceCandidate:H.optional(),action:e.enum(["catalog","prepare"]),request:e.unknown().optional()}).strict();async function G(t){let o=await V(t.compile);if(t.sourceCandidate){let a=await C({workspaceId:typeof o.agentSnapshot.metadata.workspaceId=="string"?o.agentSnapshot.metadata.workspaceId:o.workspaceId,sourceDir:l.join(o.bundlePath,"source")});if(d(t.sourceCandidate.harnessRelease)!==d({id:o.harnessRelease.id,contentHash:o.harnessRelease.contentHash})||E(a).protectedClosureHash!==t.sourceCandidate.protectedClosureHash)throw new Error("Private candidate source differs from its actual frozen compiled release.")}let g={release:b.parse({schemaVersion:"openpond.localHarnessReleaseRecord.v1",workspaceId:o.workspaceId,sourceRevision:o.sourceRevision,agentSnapshot:P.parse(o.agentSnapshot),harnessRelease:R.parse(o.harnessRelease),bundlePath:o.bundlePath,createdAt:new Date().toISOString()})},p={source:"openpond_git",profileId:t.compile.profileId,repositoryId:t.compile.repositoryId},f=t.compile.sourceRevision,c={id:o.harnessRelease.id,contentHash:o.harnessRelease.contentHash},w=s(async a=>x({...a,runtime:g}),"loadCatalog"),q=await w({ref:p,sourceRevision:f,harnessRelease:c}),k=l.join(o.bundlePath,"source"),v=o.harnessRelease.files.some(a=>a.path==="workflows/catalog.json")?await(async()=>{let a=y({agentSnapshot:o.agentSnapshot,harnessRelease:o.harnessRelease,catalogBytes:await h(l.join(k,"workflows/catalog.json")),actionBytes:await h(l.join(k,"workflows/actions.json"))});return a.catalog.workflows.map(r=>({workflow:r,binding:{schemaVersion:"openpond.profileWorkflowBinding.v1",profileId:p.profileId,sourceRevision:f,harnessRelease:c,catalogHash:a.catalogHash,workflowId:r.id}}))})():[],A={profileRef:p,sourceRevision:f,harnessRelease:c,workflows:v};if(t.action==="catalog")return{...q,workflows:v};let u=t.externalDatasetPackage?await(async()=>{let a=await z(t.compile.outputDir),r=l.join(a,t.externalDatasetPackage),i=await T(r);if(!i.isFile()||i.isSymbolicLink()||i.size>32*1024*1024||await z(r)!==r)throw new Error("External Dataset cache is outside its bounded verifier storage.");let n=e.object({packageValue:e.unknown(),graders:e.array(e.object({id:e.string(),version:e.string(),contentHash:e.string(),feedbackKey:e.string(),release:e.object({id:e.string(),revision:e.union([e.string(),e.number()]),contentHash:e.string()}).strict().nullable()}).strict()).max(100)}).strict().parse(JSON.parse(await h(r,"utf8")));return{packageValue:S(n.packageValue),graders:n.graders}})():null;return D({privateGradingPreflight:s(a=>I(a,!1),"privateGradingPreflight"),sourceCandidate:t.sourceCandidate,resolveExternalDataset:u?async a=>{let r=m({binding:a,...u}),i=d(o.harnessRelease.files.filter(n=>n.visibility!=="policy").map(n=>({path:n.path,asset:n})));if(a.protectedProfileClosureHash!==i)throw new Error("The selected Profile's protected evaluator closure changed.");return{binding:a,packageValue:r,authorize:s(async()=>{m({binding:a,...u})},"authorize")}}:void 0,loadCatalog:w,selectedWorkflows:s(async()=>A,"selectedWorkflows"),placement:"remote",boundedWorkComputeAvailable:!0,loadTasksetPackage:s(async a=>{let r=await j({runtime:g,definition:a,harnessRelease:c});if(!r)throw new Error("Hosted evaluation Taskset is absent from its published Profile release.");return r},"loadTasksetPackage"),modelConfigurationHash:s(async(a,r)=>{if(a.providerId!=="openpond"||!r.hostModelConfigurationHash)throw new Error("Hosted evaluation preparation requires a trusted model configuration receipt.");return r.hostModelConfigurationHash},"modelConfigurationHash")})(t.request)}s(G,"prepareHostedProfileEvaluation");async function ae(t){if(t.length!==1||t[0].length>48e3||!/^[A-Za-z0-9_-]+$/.test(t[0]))throw new Error("Hosted Profile evaluation preparation argument is invalid.");let o=B.parse(JSON.parse(Buffer.from(t[0],"base64url").toString("utf8")));process.stdout.write(`${JSON.stringify(await G(o))}
|
|
3
|
-
`)}s(ae,"runHostedProfileEvaluationCli");export{G as prepareHostedProfileEvaluation,ae as runHostedProfileEvaluationCli};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as E,c as S}from"./chunk-NPOHW5OU.js";import"./chunk-NNIRIUSY.js";import{c as I}from"./chunk-U2YMBCX7.js";import{c as x,f as y}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import"./chunk-BTI4N7YO.js";import"./chunk-BQAF5P7K.js";import{c as n}from"./chunk-3M53YXEI.js";import"./chunk-B7QDZPNX.js";import{s as R}from"./chunk-WZYRAR7X.js";import"./chunk-BT5YNE5U.js";import{d as g}from"./chunk-TERVLCRG.js";import{b}from"./chunk-GLUWATL5.js";import"./chunk-73G5UYBB.js";import"./chunk-YR5ID2SS.js";import{Q as v}from"./chunk-55G6B54U.js";import{$ as w,aa as f,ja as p,ka as h}from"./chunk-KD3QVRIJ.js";import"./chunk-ARQEJOEK.js";import"./chunk-JUJSA7KI.js";import{m as u}from"./chunk-KGNCKIFP.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import{a as m}from"./chunk-FTQLQJQV.js";import{readFile as A,stat as L}from"node:fs/promises";async function C(r,l){let[o,a]=l,i=n(r,"team"),q=r.local===!0||r.local==="true";if(!i||!o||l.length>2)throw new Error("usage: human-review <read|inbox|inspect|results|request> [id] --team <id> [--input-file <path>] [--local --server-url <loopback-origin>]");let t;if(o==="request"){let e=n(r,"inputFile");if(a||!e||(await L(e)).size>1048576)throw new Error("Request requires a bounded --input-file with exact scoped pins, revision and stable operationId for mutations.");if(t=p.parse(JSON.parse(await A(e,"utf8"))),t.scope!==i)throw new Error("Input belongs to another workspace.")}else if(o==="inbox"){if(a)throw new Error("Inbox does not accept an assignment id.");t=p.parse({endpoint:"inbox",scope:i,view:n(r,"view")||"mine",status:n(r,"status")||"active",limit:Number(n(r,"limit")||100),...n(r,"project")?{projectId:n(r,"project")}:{},...n(r,"afterId")?{afterId:n(r,"afterId")}:{}})}else{if(!a)throw new Error(`${o} requires an exact assignment or execution id.`);t=p.parse(o==="read"?{endpoint:"get",scope:i,id:a,...n(r,"revision")?{revision:Number(n(r,"revision"))}:{}}:o==="inspect"?{endpoint:"inspect",scope:i,id:a,...n(r,"slot")?{slot:Number(n(r,"slot"))}:{},...n(r,"afterId")?{afterId:n(r,"afterId")}:{}}:o==="results"?{endpoint:"results",scope:i,executionId:a}:{endpoint:o,scope:i,id:a})}let s;if(q){let e=new URL(n(r,"serverUrl")||E);if(e.protocol!=="http:"||!["localhost","127.0.0.1","[::1]"].includes(e.hostname)||e.username||e.password||e.search||e.hash||e.pathname!=="/")throw new Error("Local Human review requires an HTTP loopback server origin.");let c=await S(e.origin),d=await c(new URL("/v1/human-review?location=local",e),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t),redirect:"error",signal:AbortSignal.timeout(3e4)}),H=await U(d);if(s=JSON.parse(H),!d.ok)throw new Error(typeof s.error=="string"?s.error:`Local Human request failed (${d.status}).`)}else{let e=await g();s=await new R({scope:i,apiKey:await I(e,y(e)),baseUrl:x(r)??e.apiBaseUrl??b}).request(t,AbortSignal.timeout(3e4))}if(t.endpoint==="get"||t.endpoint==="command"){let e=w.parse(s),c=t.endpoint==="get"?t.id:t.command.id;if(e.id!==c||e.scope!==i)throw new Error("Review response differs from the requested identity.")}if(t.endpoint==="inbox"&&f.parse(s).items.some(c=>c.scope!==i||t.projectId&&c.projectId!==t.projectId))throw new Error("Inbox response differs from the requested scope.");if(t.endpoint==="inspect"&&h.parse(s).some(e=>e.reviewId!==t.id))throw new Error("Inspection response differs from the selected assignment.");if(t.endpoint==="results"){let e=v.parse(s),{contentHash:c,...d}=e;if(e.executionId!==t.executionId||u(d)!==c||t.selection!==void 0&&u(e.selection)!==u(t.selection))throw new Error("Result response differs from the selected execution or retained review revisions.")}console.log(JSON.stringify(s,null,2))}m(C,"runHumanReviewCommand");async function U(r){let l=r.body?.getReader();if(!l)throw new Error("Review response is unavailable.");let o=[],a=0;try{for(;;){let i=await l.read();if(i.done)break;if(a+=i.value.byteLength,a>8388608)throw new Error("Review response exceeds its bounded transport.");o.push(i.value)}}finally{await l.cancel(),l.releaseLock()}return Buffer.concat(o).toString("utf8")}m(U,"boundedResponse");export{C as runHumanReviewCommand};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as D,b as ce,c as de,d as le,e as M,f as X,g as J,h as L,i as Z,j as B,k as z,l as P,m as ee,n as te,o as ue,p as se,q as pe,r as G}from"./chunk-IODUCRBA.js";import{k as W}from"./chunk-NNIRIUSY.js";import{a as we}from"./chunk-U2YMBCX7.js";import{c as ve,f as ye}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import"./chunk-BTI4N7YO.js";import"./chunk-BQAF5P7K.js";import{c as E,f as H}from"./chunk-3M53YXEI.js";import"./chunk-B7QDZPNX.js";import{n as fe,o as me,p as F}from"./chunk-WZYRAR7X.js";import"./chunk-BT5YNE5U.js";import{d as Y,g as he}from"./chunk-TERVLCRG.js";import{b as ge}from"./chunk-GLUWATL5.js";import"./chunk-73G5UYBB.js";import"./chunk-YR5ID2SS.js";import"./chunk-55G6B54U.js";import"./chunk-KD3QVRIJ.js";import"./chunk-ARQEJOEK.js";import"./chunk-JUJSA7KI.js";import{l as ae,m as T}from"./chunk-KGNCKIFP.js";import{b as I}from"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import{a as p}from"./chunk-FTQLQJQV.js";import{createInterface as qe}from"node:readline/promises";import{resolve as Ue}from"node:path";import{watch as Pe}from"node:fs";import{randomUUID as je}from"node:crypto";var Me=["source","admission","control","heartbeat"],j=class{static{p(this,"CollectorErrors")}store;constructor(e){this.store=e}read(e){let o=this.store.setting(`errors:${e}`);if(o)return JSON.parse(o);let s=this.store.database.prepare("SELECT error FROM backfill_units WHERE connection_id=? AND state='error' AND error IS NOT NULL ORDER BY session_key LIMIT 1").get(e);return typeof s?.error=="string"?{source:s.error}:{}}message(e,o){let s=this.read(e);return Me.filter(r=>r!==o).map(r=>s[r]).find(Boolean)??null}source(e){return this.read(e).source??null}set(e,o,s){let r=this.read(e);s?r[o]=s.slice(0,500):delete r[o],this.store.set(`errors:${e}`,JSON.stringify(r)),this.store.error(e,this.message(e))}};var Le=I.object({leafId:I.string().min(1).max(200),chainHash:I.string().regex(/^[a-f0-9]{64}$/),sourceInstanceId:I.string().min(1)}).strict(),Se=p((t,e)=>`branch:${JSON.stringify([t,e])}`,"key");function be(t,e,o){let s=t.setting(Se(e,o));if(!s)return;let r=Le.parse(JSON.parse(s));return t.connections().find(g=>g.id===e)?.source.instanceId===r.sourceInstanceId?{leafId:r.leafId,chainHash:r.chainHash}:void 0}p(be,"collectorBranchAnchor");async function Ie(t,e){if(t.source!=="claude_code")throw new Error("Branch selection is currently supported for Claude Code.");let o,s=[];do{let r=await M(t,{cursor:o,limit:100});s.push(...r.items.filter(a=>a.nativeSessionId===e)),o=r.nextCursor??void 0}while(o);if(s.length!==1)throw new Error("Select exactly one native session in this connection's source location.");return s[0]}p(Ie,"findSession");async function Re(t,e,o){let s=await B.open(t);try{let r=s.connections().find(g=>g.id===e);if(!r)throw new Error("Select a connection from openpond import status.");let a=await Ie(r.source,o);return{session:a,...await X(r.source,a)}}finally{s.close()}}p(Re,"inspectCollectorBranches");async function Ce(t,e,o,s){let r=await B.open(t);try{let a=r.connections().find(u=>u.id===e);if(!a||a.state!=="paused")throw new Error(`Pause this connection first: openpond import pause ${e}`);let g=await Ie(a.source,o),c=await X(a.source,g),l=c.branches.find(u=>u.leafId===s.leafId);if(c.revision!==s.revision||!l)throw new Error("This conversation changed. Refresh its branches and choose again.");await J(a.source,g,{branchLeafId:s.leafId,expectedBranchRevision:s.revision}),r.database.exec("BEGIN IMMEDIATE");try{let u=r.connections().find(S=>S.id===e);if(!u||u.state!=="paused"||u.revision!==a.revision||u.source.instanceId!==a.source.instanceId)throw new Error("Connection changed during branch selection. Refresh and try again.");r.set(Se(e,o),JSON.stringify({leafId:l.leafId,chainHash:l.chainHash,sourceInstanceId:a.source.instanceId}));for(let S of["source_scans","checkpoints","pending"])r.database.prepare(`DELETE FROM ${S} WHERE connection_id=?`).run(e);let v=new j(r);v.set(e,"source",v.source(e)),r.progress.reset(e),v.set(e,"admission",null),r.database.exec("COMMIT")}catch(u){throw r.database.exec("ROLLBACK"),u}return{connectionId:e,nativeSessionId:o,leafId:l.leafId,state:"paused"}}finally{r.close()}}p(Ce,"selectCollectorBranch");var V=class{static{p(this,"CollectorSyncRequests")}store;acquisitions=new Map;constructor(e){this.store=e}observe(e,o){let s=o.requestedSyncRevision??e.requestedSyncRevision??0,r=o.completedSyncRevision??0;if(!Number.isSafeInteger(s)||s<0||s>o.revision||!Number.isSafeInteger(r)||r<0||r>s)throw new Error("Invalid remote sync acknowledgement.");let a=this.confirmed(e.id);return r>a&&this.store.set(`syncAcknowledged:${e.id}`,String(r)),{requestedSyncRevision:Math.max(e.requestedSyncRevision??0,s),completedSyncRevision:Math.max(e.completedSyncRevision??0,r)}}needsAcquisition(e){let o=e.requestedSyncRevision??0;if(o<=(e.completedSyncRevision??0))return!1;let s=this.acquisitions.get(e.id);return s?.controlRevision!==e.revision||s.requestedSyncRevision!==o}acquired(e,o){this.acquisitions.set(e,o)}complete(e,o){let s=this.acquisitions.get(e.id),r=e.requestedSyncRevision??0;if(e.state!=="active"||this.store.setting("desiredState")!=="running"||this.store.queued(e.id)||o||!s?.succeeded||s.controlRevision!==e.revision||s.requestedSyncRevision!==r||r<=(e.completedSyncRevision??0))return e;let a={...e,completedSyncRevision:r};return this.store.put(a),a}confirmed(e){return Number(this.store.setting(`syncAcknowledged:${e}`))||0}needsAcknowledgement(e){return(e.completedSyncRevision??0)>this.confirmed(e.id)}};async function Ee(t){let e=await B.open(t.directory),o=je();e.database.exec("BEGIN IMMEDIATE");try{let i=e.setting("owner");if(i){let f=JSON.parse(i),h=!0;try{process.kill(f.pid,0)}catch(n){h=n.code!=="ESRCH"}if(h)throw new Error("The collector already has a live owner.")}e.set("owner",JSON.stringify({pid:process.pid,nonce:o})),e.database.exec("COMMIT")}catch(i){throw e.database.exec("ROLLBACK"),e.close(),i}if(e.setting("desiredState")!=="running"){e.set("owner",""),e.close();return}e.set("pid",String(process.pid));let s=!0,r=0,a=0,g=new Map,c=new j(e),l=new V(e),u=new Map;function v(i){return e.connections().find(f=>f.id===i.id)??i}p(v,"retained");function S(i){let f=e.queued(i.id),h=c.message(i.id,"heartbeat");return{pendingOperations:f,error:h,completedSyncRevision:!f&&!h?i.completedSyncRevision??0:0}}p(S,"heartbeatInput");function d(i,f){let h=v(i);if(h.state==="disconnected"||f.revision<h.revision)return h;let n=l.observe(h,f);f.revision>h.revision&&c.set(h.id,"control",null);let m={...h,...n,...f.revision>h.revision?{revision:f.revision,state:f.state}:{},...f.destinations?{destinations:f.destinations}:{}};return e.put(m),m}p(d,"applyRemote");function R(i,f,h){let n=f instanceof Error?f.message:"Collection failed.";c.set(i.id,h,n);let m=f&&typeof f=="object"&&"status"in f?Number(f.status):0,C=v(i);C.state!=="disconnected"&&[400,401,403].includes(m)&&e.put({...C,state:m===400?"paused":"disconnected"})}p(R,"recordFailure");async function N(i){let f=i.revision,h=i.requestedSyncRevision??0,n,m=[];do{if(Date.now()-a>=L.heartbeatMs){a=Date.now(),e.set("heartbeatAt",new Date().toISOString());for(let w of e.connections())if(w.state!=="disconnected")try{let x=await t.transport.heartbeat(w,S(w));d(w,x),c.set(w.id,"heartbeat",null)}catch(x){R(w,x,"heartbeat")}}if(i=e.connections().find(w=>w.id===i.id)??i,i.state!=="active"||t.signal.aborted||e.setting("desiredState")!=="running")return;let C=await M(i.source,{since:i.since??void 0,cursor:n,limit:50});for(let w of C.items){let x=JSON.stringify([w.path,w.nativeSessionId]),O=w.storageRevision?T([w.storageRevision,de(i.source.source)]):null;if(e.progress.select(i.id,x),t.signal.aborted||e.setting("desiredState")!=="running"||e.connections().find(y=>y.id===i.id)?.state!=="active")return;try{if(O&&!e.sourceChanged(i.id,x,O)&&!e.progress.tracks(i.id,x))continue;let{files:y,preview:b,branchLeafId:k}=await J(i.source,w,{branchAnchor:be(e,i.id,w.nativeSessionId)}),$=!1;for(let q of b.sessions){let _=JSON.stringify([i.source.instanceId,q.sessionId,q.branchId]);e.progress.retained(i.id,x,_);let ne=q.boundaries.filter(A=>A.projection==="turn"&&A.terminal!=="unknown"&&(!i.since||Date.parse(q.events[A.start].occurredAt??w.updatedAt)>=Date.parse(i.since)));$||=ne.length>0;let ie=ne.filter(A=>e.changed(i.id,_,A.id,T([A.inputHash,A.revisionHash])));for(let A=0;A<ie.length;A+=L.batchCases){let Q=ie.slice(A,A+L.batchCases),De=`sync-${T([i.id,_,Q.map(U=>[U.id,U.inputHash,U.revisionHash])]).slice(0,48)}`;e.enqueue({operationId:De,connectionId:i.id,sessionKey:_,contentHash:q.contentHash,files:y,boundaryIds:Q.map(U=>U.id),...k?{branchLeafId:k}:{}},Q.map(U=>({id:U.id,revision:T([U.inputHash,U.revisionHash])})),x)}}e.progress.read(i.id,x,$),O&&e.scanned(i.id,x,O)}catch(y){if(y instanceof le){e.progress.read(i.id,x,!1),O&&e.scanned(i.id,x,O);continue}e.progress.failed(i.id,x,y instanceof Error?y.message:"Unable to read session"),m.push(`${w.nativeSessionId}: ${y instanceof Error?y.message:"Unable to read session"}`)}}n=C.nextCursor??void 0}while(n);e.progress.discovered(i.id),u.set(i.id,f),l.acquired(i.id,{controlRevision:f,requestedSyncRevision:h,succeeded:m.length===0}),c.set(i.id,"source",m.length?`${m.length} session(s) need attention. ${m[0]}`:null)}p(N,"acquire");try{for(;!t.signal.aborted&&e.setting("desiredState")==="running";){let i=e.connections();e.set("heartbeatAt",new Date().toISOString());for(let n of i)if(n.state!=="disconnected"&&!g.has(n.source.root))try{let m=Pe(n.source.root,{recursive:n.source.acquisition!=="sqlite"},()=>{s=!0});m.on("error",()=>{s=!0}),g.set(n.source.root,m)}catch{}let f=Date.now()-a>=L.heartbeatMs;f&&(a=Date.now());let h=s||Date.now()-r>=L.reconcileMs||e.setting("syncNow")==="yes";h&&(s=!1,r=Date.now(),e.set("syncNow","no"));for(let n of i){if(n=v(n),n.state==="disconnected")continue;let m="heartbeat";try{if(f){let w=await t.transport.heartbeat(n,S(n));n=d(n,w),c.set(n.id,"heartbeat",null)}if(n.state!=="active"){u.delete(n.id);continue}if(m="source",(h||u.get(n.id)!==n.revision||l.needsAcquisition(n))&&await N(n),n=e.connections().find(w=>w.id===n.id)??n,n.state!=="active"||t.signal.aborted||e.setting("desiredState")!=="running")continue;m="admission";let C=e.next(n.id);if(C)try{await t.transport.admit(n,C.entry),e.acknowledge(C.entry),c.set(n.id,"admission",null)}catch(w){throw e.retry(C.entry.operationId,C.attempts),w}if(n=v(n),t.signal.aborted||e.setting("desiredState")!=="running"||n.state!=="active")continue;if(n=l.complete(n,c.message(n.id,"heartbeat")),l.needsAcknowledgement(n)&&S(n).completedSyncRevision){m="heartbeat";let w=await t.transport.heartbeat(n,S(n));n=d(n,w),c.set(n.id,"heartbeat",null)}if(!t.signal.aborted&&e.setting("desiredState")==="running"&&n.state==="active"&&!n.keepSyncing&&u.get(n.id)===n.revision&&e.queued(n.id)===0&&e.progress.status(n.id).stage==="complete"&&!c.source(n.id)&&l.confirmed(n.id)>=(n.requestedSyncRevision??0)){if(m="control",!t.transport.pause)throw new Error("This transport cannot acknowledge completion of a one-time import.");let w=await t.transport.pause(n);d(n,w),c.set(n.id,"control",null)}}catch(C){R(n,C,m)}}await new Promise(n=>{let m=p(()=>{clearTimeout(C),t.signal.removeEventListener("abort",m),n()},"done"),C=setTimeout(m,1e3);t.signal.addEventListener("abort",m,{once:!0})})}}finally{for(let f of g.values())f.close();JSON.parse(e.setting("owner")||"{}").nonce===o&&(e.set("pid",""),e.set("heartbeatAt",""),e.set("owner","")),e.close()}}p(Ee,"runCollector");import{createHash as Ne,generateKeyPairSync as Ke,createPublicKey as _e,diffieHellman as Je,createDecipheriv as ze}from"node:crypto";import{spawn as Ge}from"node:child_process";var xe=p(t=>Ne("sha256").update(t).digest("hex"),"hash"),Fe=I.object({publicKey:I.string().max(200),iv:I.string().max(100),tag:I.string().max(100),ciphertext:I.string().max(1e4)}).strict();async function re(t,e,o){let s=await fetch(`${t}${e}`,{method:"POST",redirect:"error",signal:AbortSignal.timeout(15e3),headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}),r=await s.text();if(r.length>16384)throw new Error("Authorization response exceeded its limit.");if(!s.ok)throw Object.assign(new Error(`Browser sign-in failed (${s.status}).`),{status:s.status});return JSON.parse(r)}p(re,"post");function Ye(t){let e=process.platform==="darwin"?"open":process.platform==="win32"?"rundll32":"xdg-open",o=process.platform==="win32"?["url.dll,FileProtocolHandler",t]:[t],s=Ge(e,o,{stdio:"ignore",detached:!0});s.on("error",()=>{}),s.unref()}p(Ye,"openBrowser");async function Oe(t,e){let o=await Y(),s=ve(e)||o.apiBaseUrl||ge,r=E(e,"baseUrl")||(new URL(s).hostname==="staging-api.openpond.ai"?"https://staging.openpond.ai":ye(o)),a=new URL(r),g=new URL(s);for(let d of[a,g])if(d.protocol!=="https:"&&!(d.protocol==="http:"&&["localhost","127.0.0.1"].includes(d.hostname))||d.username||d.password||d.search||d.hash)throw new Error("Sign-in requires a clean HTTPS origin or local development origin.");let c=`import-${xe([a.origin,t.machineId,t.instanceId].join(":")).slice(0,24)}`,l=Ke("x25519"),u=l.publicKey.export({format:"der",type:"spki"}).toString("base64"),v=I.object({deviceCode:I.string(),userCode:I.string(),expiresAt:I.string().datetime(),intervalSeconds:I.number().min(2).max(10)}).strict().parse(await re(a.origin,"/api/cli/import/device",{publicKey:u,machineId:t.machineId,sourceInstanceId:t.instanceId,sourceLabel:D[t.source],sourceRoot:t.root,...E(e,"team")?{requestedTeamId:E(e,"team")}:{}})),S=`${a.origin}/console/connections/authorize?code=${encodeURIComponent(v.userCode)}`;for(console.log(`OpenPond sign-in code: ${v.userCode}
|
|
3
|
-
${S}`),Ye(S);Date.now()<Date.parse(v.expiresAt);){await new Promise(m=>setTimeout(m,v.intervalSeconds*1e3));let d;try{d=await re(a.origin,"/api/cli/import/token",{deviceCode:v.deviceCode})}catch(m){if(Number(m.status)===429)continue;throw m}let R=I.object({state:I.enum(["pending","approved","denied","consumed"]),envelope:Fe.nullable().optional()}).strict().parse(d);if(R.state==="denied"||R.state==="consumed")throw new Error("Browser sign-in was declined or already consumed. Start the connection again.");if(R.state!=="approved"||!R.envelope)continue;let N=R.envelope,i=_e({key:Buffer.from(N.publicKey,"base64"),format:"der",type:"spki"});if(i.asymmetricKeyType!=="x25519")throw new Error("Invalid sign-in encryption key.");let f=Ne("sha256").update(Je({privateKey:l.privateKey,publicKey:i})).digest(),h=ze("aes-256-gcm",f,Buffer.from(N.iv,"base64"));h.setAAD(Buffer.from(xe(v.deviceCode))),h.setAuthTag(Buffer.from(N.tag,"base64"));let n=I.object({apiKey:I.string().min(1),teamId:I.string().min(1),expiresAt:I.string().datetime()}).strict().parse(JSON.parse(Buffer.concat([h.update(Buffer.from(N.ciphertext,"base64")),h.final()]).toString("utf8")));if(E(e,"team")&&n.teamId!==E(e,"team"))throw new Error("Browser approved a different workspace.");return await he({handle:c,apiKey:n.apiKey,baseUrl:a.origin,apiBaseUrl:g.origin,setActive:!1}),await re(a.origin,"/api/cli/import/token",{deviceCode:v.deviceCode,acknowledge:!0}),{apiKey:n.apiKey,teamId:n.teamId,baseUrl:g.origin,account:c,accountBaseUrl:a.origin}}throw new Error("Browser sign-in expired. Start the connection again.")}p(Oe,"authorizeImporter");async function K(t){let e=await Y({account:t.account,baseUrl:t.accountBaseUrl}),o=t.account?e.apiKey:we(e);if(!o)throw Object.assign(new Error("This source is disconnected. Reconnect it with OpenPond Importer to authorize collection."),{status:401});let s={apiKey:o,baseUrl:t.apiBaseUrl,teamId:t.teamId};return{evidence:new me(s),sync:new F(s)}}p(K,"collectorClients");var ke={async pause(t){let{sync:e}=await K(t),o=await e.control({id:t.id,expectedRevision:t.revision,action:"pause"});return{revision:o.revision,state:o.state,destinations:Z(t,o),requestedSyncRevision:o.requestedSyncRevision,completedSyncRevision:o.completedSyncRevision}},async heartbeat(t,e){let{sync:o}=await K(t),s=await o.heartbeat({id:t.id,expectedRevision:t.revision,...e});return{revision:s.revision,state:s.state,destinations:Z(t,s),requestedSyncRevision:s.requestedSyncRevision,completedSyncRevision:s.completedSyncRevision}},async admit(t,e){let{evidence:o,sync:s}=await K(t),r=AbortSignal.timeout(6e4),a=Buffer.from(JSON.stringify(e.files.map(d=>({path:d.path,encoding:"utf8",base64:Buffer.from(d.text).toString("base64")})))),g={hash:ae(a),parts:Math.ceil(a.length/2e5)};for(let d=0;d<g.parts;d++)await o.uploadPart({...g,index:d,base64:a.subarray(d*2e5,(d+1)*2e5).toString("base64")},r);let c={upload:g,source:t.source.source,...e.branchLeafId?{branchLeafId:e.branchLeafId}:{},destination:{kind:"existing",projectId:t.projectId},acquisition:{machineId:t.source.machineId,sourceInstanceId:t.source.instanceId}},l=await o.preview(c,r);if(l.issues.length)throw Object.assign(new Error("Source schema was rejected; inspect the connection before resuming."),{status:400});let u=l.sessions.find(d=>d.sessionHash===e.contentHash);if(!u||e.boundaryIds.some(d=>!u.boundaries.some(R=>R.id===d&&R.projection==="turn"&&R.terminal!=="unknown")))throw Object.assign(new Error("Server preview differs from the retained source boundaries."),{status:400});let v={...c,operationId:e.operationId,previewHash:l.previewHash,selection:[{sessionHash:u.sessionHash,boundaryIds:e.boundaryIds}]},S=fe.parse(await s.commit({connectionId:t.id,expectedRevision:t.revision,request:v},r));if(S.state!=="completed"||S.operationId!==e.operationId||S.requestHash!==T(v)||S.projectId!==t.projectId)throw new Error("Admission did not acknowledge this retained operation.")}};import{emitKeypressEvents as We}from"node:readline";async function Ae(t){console.log("Ctrl+C closes this view and keeps syncing. Ctrl+D pauses this connection.");let e=new AbortController,o=p(()=>e.abort(),"detach"),s=!1,r=process.stdin.isRaw,a=p((c,l)=>{l?.ctrl&&(l.name==="c"&&o(),l.name==="d"&&!s&&(s=!0,t.pause().then(o).catch(u=>{console.error(`
|
|
4
|
-
Unable to pause: ${u instanceof Error?u.message:"connection update failed"}`),s=!1})))},"keypress");We(process.stdin),process.stdin.setRawMode(!0),process.stdin.resume(),process.stdin.on("keypress",a),process.stdin.once("end",o),process.once("SIGINT",o);let g=0;try{for(;!e.signal.aborted;){let c=await P(t.directory),l=c.connections.find(f=>f.id===t.connectionId);if(!l)break;let u=l.backfill,v=u.admitted+u.skipped,S=u.total?v/u.total:u.stage==="complete"?1:0,d=Math.max(0,Math.min(20,Math.floor(S*20))),R=u.stage==="discovering"?`${["|","/","-","\\"][g++%4]} Discovering conversations (${u.total} found)`:`[${"=".repeat(d)}${" ".repeat(20-d)}] ${v}/${u.total} conversations`,N=c.running?l.state!=="active"?l.state:u.stage==="complete"?t.keepSyncing?"Watching for new conversations":"Import complete":u.stage:"Service offline",i=`${R} ${l.admitted} tasks admitted ${u.skipped} skipped ${u.failed} need attention ${l.queued} queued ${l.error||N}${l.lastAdmissionAt?` Last sync ${l.lastAdmissionAt}`:""}`;if(process.stdout.clearLine(0),process.stdout.cursorTo(0),process.stdout.write(i),!t.keepSyncing&&l.state==="paused"&&l.queued===0)break;await new Promise(f=>{let h=p(()=>{clearTimeout(n),e.signal.removeEventListener("abort",h),f()},"done"),n=setTimeout(h,1e3);e.signal.addEventListener("abort",h,{once:!0})})}}finally{process.stdin.off("keypress",a),process.stdin.off("end",o),process.off("SIGINT",o),process.stdin.setRawMode(r??!1),process.stdin.pause(),console.log()}}p(Ae,"monitorImport");async function oe(t,e){let o=await B.open(t),s;try{s=o.connections().find(r=>r.id===e)}finally{o.close()}if(!s)throw new Error("Select a retained connection from openpond import status.");if(s.source.machineId!==await G(t))throw new Error("This connection belongs to another machine. Use explicit Connect setup.");if(!s.accountBaseUrl)throw new Error("The original sign-in destination is unavailable. Use explicit Connect setup.");return s}p(oe,"retainedReconnect");function Te(t,e){if(!e?.available||!e.capabilities.history||e.source!==t.source.source||e.machineId!==t.source.machineId||e.instanceId!==t.source.instanceId||e.root!==t.source.root)throw new Error("The retained source is unavailable or its identity changed. Restore its original location or use explicit Connect setup.")}p(Te,"assertReconnectSource");async function $e(t,e){let o=await oe(t,e.id),s=p(r=>({...r,destinations:void 0,requestedSyncRevision:r.requestedSyncRevision??0,completedSyncRevision:r.completedSyncRevision??0}),"scope");if(T(s(o))!==T(s(e)))throw new Error("The connection changed during sign-in. Reconnect again after reviewing its current scope.")}p($e,"assertReconnectUnchanged");import{createInterface as Ve}from"node:readline/promises";async function Be(t,e,o,s){let r=E(s,"session");if(!o||!r)throw new Error("Use openpond import branches <connection-id> --session <native-session-id>.");let a=await Re(t,o,r);if(e==="branches"){console.log(JSON.stringify(a,null,2));return}let g=process.stdin.isTTY&&process.stdout.isTTY&&!H(s.json),c=E(s,"leaf"),l=E(s,"revision");if(!c&&g){a.branches.forEach((S,d)=>console.log(`${d+1}. ${S.title||S.leafId} (${S.messages} messages; ${S.updatedAt||"date unavailable"})`));let v=Ve({input:process.stdin,output:process.stdout});try{c=a.branches[Number(await v.question("Choose the branch to sync: "))-1]?.leafId??"",l=a.revision}finally{v.close()}}if(!c||!l)throw new Error("Supply --leaf and --revision from import branches, or choose interactively. No branch was selected.");if(!a.branches.some(v=>v.leafId===c)||l!==a.revision)throw new Error("Branch selection is stale or invalid. Run import branches again.");if(!H(s.yes)&&(!g||!await W("Sync only this branch and its unambiguous future continuation for this conversation? Other branches stay excluded.",!1)))throw new Error("Branch selection was not approved.");let u=await Ce(t,o,r,{leafId:c,revision:l});console.log(JSON.stringify({...u,next:`openpond import resume ${o}`},null,2))}p(Be,"runImporterBranchCommand");async function is(t,e){let[o="connect",s]=e,r=Ue(E(t,"collectorDir")||pe()),a=H(t.json),g=p(y=>console.log(JSON.stringify(y,null,2)),"print");if(o==="branches"||o==="branch"){await Be(r,o,s,t);return}if(o==="service"){if(s==="status"){g(await P(r));return}if(s==="stop"){g(await ee(r,"stop"));return}if(s==="uninstall"){g(await ue(r));return}if(s==="install"){g(await te({directory:r,executable:process.execPath,args:[process.argv[1]],environment:He()}));return}if(s==="start"){g(await se(r));return}if(s==="run"){let y=new AbortController,b=p(()=>y.abort(),"stop");process.once("SIGTERM",b),process.once("SIGINT",b);try{await Ee({directory:r,transport:ke,signal:y.signal})}finally{process.off("SIGTERM",b),process.off("SIGINT",b)}return}throw new Error("usage: openpond import service <install|start|stop|status|run|uninstall>")}if(o==="status"){g(await P(r));return}if(o==="sync"){g(await ee(r,"sync"));return}if(["pause","resume","disconnect"].includes(o)){let y=await B.open(r),b;try{b=y.connections().find(q=>q.id===s)}finally{y.close()}if(!b)throw new Error("Select a connection id from openpond import status.");let{sync:k}=await K(b),$=await k.control({id:b.id,expectedRevision:b.revision,action:o});await z(r,{...b,revision:$.revision,state:$.state}),g($);return}let c=o==="reconnect"?await oe(r,s):null;c&&(t={...t,source:c.source.source,sourcePath:c.source.root,project:c.projectId,connection:c.id,team:c.teamId,apiBaseUrl:c.apiBaseUrl,baseUrl:c.accountBaseUrl,once:!c.keepSyncing});let l=E(t,"source");if(l&&!(l in D))throw new Error("Choose a supported native source name.");let u=await G(r),v=await ce({machineId:u,...l&&E(t,"sourcePath")?{locations:{[l]:Ue(E(t,"sourcePath"))}}:{}});if(o==="discover"){g(v);return}if(o!=="connect"&&o!=="reconnect")throw new Error("usage: openpond import <connect|reconnect|discover|status|sync|pause|resume|disconnect|branches|branch|service>");let S=v.filter(y=>y.source===l),d=S.length===1?S[0]:void 0,R=process.stdin.isTTY&&process.stdout.isTTY&&!a;if(c&&Te(c,d),!d&&R){let y=S.length>1?S:v.filter(k=>k.available);y.forEach((k,$)=>console.log(`${$+1}. ${D[k.source]} ${k.root}${k.capabilities.history?"":` (${k.reason})`}`));let b=qe({input:process.stdin,output:process.stdout});try{d=y[Number(await b.question("Choose a source: "))-1]}finally{b.close()}}if(!d?.capabilities.history)throw new Error(d?.reason??(S.length>1?"Multiple source instances found. Select the exact --source-path or use interactive setup.":"Select --source and optionally --source-path."));let N=E(t,"range")||"week";if(!c&&R&&!t.range){let y=qe({input:process.stdin,output:process.stdout});try{N=(await y.question("History: day, week, or all [week]: ")).trim()||"week"}finally{y.close()}}if(!["day","week","all"].includes(N))throw new Error("--range must be day, week or all.");let i=c?c.since:N==="all"?null:new Date(Date.now()-(N==="day"?1:7)*864e5).toISOString(),f=await M(d,{since:i??void 0,limit:100});a||console.log(`Found ${f.items.length}${f.nextCursor?"+":""} sessions in ${d.root}. History: ${c?i?`since ${i}`:"all":N}.`);let h=!H(t.once),n=E(t,"project");if(!H(t.yes)&&(!R||!await W(`Sync this source to ${n||"your personal Imported conversations Project"} and ${h?"keep syncing":"import once"}?`,!0)))throw new Error("Connection was not approved. No history was uploaded.");let m=await Oe(d,t),C=new F(m),w=E(t,"connection")||`sync-${T([m.baseUrl,m.teamId,d.instanceId,n||"default"]).slice(0,40)}`;c&&await $e(r,c);let x=(await C.list()).items.find(y=>y.id===w),O=await C.register({id:w,source:d.source,machineId:u,sourceInstanceId:d.instanceId,sourceLabel:D[d.source],sourceRoot:d.root,destination:n?{kind:"existing",projectId:n}:{kind:"new",name:"Imported conversations"},since:i,keepSyncing:h,expectedRevision:x?.revision??0});await z(r,{id:O.id,teamId:m.teamId,apiBaseUrl:m.baseUrl,account:m.account,accountBaseUrl:m.accountBaseUrl,source:d,projectId:O.projectId,revision:O.revision,requestedSyncRevision:O.requestedSyncRevision,completedSyncRevision:O.completedSyncRevision,since:i,keepSyncing:h,state:O.state}),await te({directory:r,executable:process.execPath,args:[process.argv[1]],environment:He()}),await se(r),g({connection:O,service:await P(r)}),R&&!H(t.detach)&&await Ae({directory:r,connectionId:w,keepSyncing:h,async pause(){let y=await B.open(r),b;try{b=y.connections().find(q=>q.id===w)}finally{y.close()}if(!b)throw new Error("The connection is unavailable.");let{sync:k}=await K(b),$=await k.control({id:b.id,expectedRevision:b.revision,action:"pause"});await z(r,{...b,revision:$.revision,state:$.state})}})}p(is,"runImportCommand");function He(){return{...process.env.OPENPOND_HOME?{OPENPOND_HOME:process.env.OPENPOND_HOME}:{},...process.env.ELECTRON_RUN_AS_NODE==="1"?{ELECTRON_RUN_AS_NODE:"1"}:{}}}p(He,"collectorEnvironment");export{is as runImportCommand};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{$b as X,$c as Xa,$d as Xb,Ab as w,Ac as wa,Ad as wb,Bb as x,Bc as xa,Bd as xb,Cb as y,Cc as ya,Cd as yb,Db as z,Dc as za,Dd as zb,Eb as A,Ec as Aa,Ed as Ab,Fa as b,Fb as B,Fc as Ba,Fd as Bb,Ga as c,Gb as C,Gc as Ca,Gd as Cb,Ha as d,Hb as D,Hc as Da,Hd as Db,Ia as e,Ib as E,Ic as Ea,Id as Eb,Jb as F,Jc as Fa,Jd as Fb,Kb as G,Kc as Ga,Kd as Gb,Lb as H,Lc as Ha,Ld as Hb,Mb as I,Mc as Ia,Md as Ib,Nb as J,Nc as Ja,Nd as Jb,Ob as K,Oc as Ka,Od as Kb,Pb as L,Pc as La,Pd as Lb,Qb as M,Qc as Ma,Qd as Mb,Rb as N,Rc as Na,Rd as Nb,Sb as O,Sc as Oa,Sd as Ob,Tb as P,Tc as Pa,Td as Pb,Ub as Q,Uc as Qa,Ud as Qb,Vb as R,Vc as Ra,Vd as Rb,Wb as S,Wc as Sa,Wd as Sb,Xb as T,Xc as Ta,Xd as Tb,Yb as U,Yc as Ua,Yd as Ub,Zb as V,Zc as Va,Zd as Vb,_b as W,_c as Wa,_d as Wb,ac as Y,ad as Ya,ae as Yb,bc as Z,bd as Za,be as Zb,cc as _,cd as _a,ce as _b,dc as $,dd as $a,de as $b,ec as aa,ed as ab,ee as ac,fc as ba,fd as bb,fe as bc,gc as ca,gd as cb,ge as cc,hc as da,hd as db,he as dc,ic as ea,id as eb,ie as ec,jb as f,jc as fa,jd as fb,je as fc,kb as g,kc as ga,kd as gb,ke as gc,lb as h,lc as ha,ld as hb,le as hc,mb as i,mc as ia,md as ib,me as ic,nb as j,nc as ja,nd as jb,ne as jc,ob as k,oc as ka,od as kb,oe as kc,pb as l,pc as la,pd as lb,pe as lc,qb as m,qc as ma,qd as mb,qe as mc,rb as n,rc as na,rd as nb,re as nc,sb as o,sc as oa,sd as ob,tb as p,tc as pa,td as pb,ub as q,uc as qa,ud as qb,vb as r,vc as ra,vd as rb,wb as s,wc as sa,wd as sb,x as a,xb as t,xc as ta,xd as tb,yb as u,yc as ua,yd as ub,zb as v,zc as va,zd as vb}from"./chunk-KD3QVRIJ.js";import"./chunk-KGNCKIFP.js";import"./chunk-ES2ISFJC.js";import"./chunk-FTQLQJQV.js";export{fc as AcceptanceAttemptSchema,Zb as AcceptanceCheckSchema,dc as AcceptanceGroupManifestContentSchema,ec as AcceptanceGroupManifestSchema,gc as AcceptanceGroupSnapshotContentSchema,hc as AcceptanceGroupSnapshotSchema,bc as AcceptanceMeasurementSchema,_b as AcceptancePlanContentSchema,$b as AcceptancePlanSchema,Da as ApplyTaskCorrectionCommandSchema,Ka as ArchiveAuthoringDraftCommandSchema,oa as AuthoringDraftContentSchema,qa as AuthoringDraftFinalizationSchema,na as AuthoringDraftInputSchema,pa as AuthoringDraftSchema,ma as AuthoringTargetKindSchema,g as BoundJudgeResponseSchema,Qa as CancelLearningIterationCommandSchema,Pa as CancelLearningIterationReservationCommandSchema,Ma as CancelRewardCheckCommandSchema,Ia as CancelTaskGradeCommandSchema,la as CombinedRewardAuthoringFieldsSchema,Ya as DEFAULT_REWARD_VERIFIER_SOURCE,ya as ImportTaskIntakeCommandSchema,i as JudgeCallReservationSchema,J as LearningAcceptedParentSchema,Wb as LearningCandidateDecisionObservationSchema,ea as LearningChainSchema,Ab as LearningCommandRequestSchema,Sa as LearningCommandSchema,lb as LearningConflictError,ga as LearningConsumptionSchema,a as LearningDomainError,fa as LearningEligibilityCountsSchema,Ua as LearningIterationDispatchSchema,Va as LearningIterationObservationSchema,ha as LearningIterationReservationSchema,L as LearningIterationSchema,K as LearningIterationStatusSchema,Ta as LearningIterationSubmissionSchema,da as LearningIterationTriggerSchema,o as LearningJsonObjectSchema,q as LearningJsonPointerSchema,Db as LearningOperationResultSchema,H as LearningPolicyContentSchema,tb as LearningPolicyInspectionResultSchema,I as LearningPolicySchema,Bb as LearningReadRequestSchema,kb as LearningResourceKindSchema,N as LearningResourceSchema,u as LearningReviewOriginSchema,p as LearningRevisionRefSchema,Xa as LearningScheduleFireSchema,Wa as LearningScheduleSchema,v as LearningSourceContentSchema,w as LearningSourceSchema,xb as LearningTaskQueueInspectionSchema,b as LearningTextAssetContentSchema,c as LearningTextAssetSchema,Ob as MAX_REWARD_CALIBRATION_CLOSURE_BYTES,l as NightlyScheduleSchema,Na as PublishCheckedRewardCommandSchema,za as PublishLearningResourceCommandSchema,Aa as PublishLearningResourcesCommandSchema,La as QueueRewardCheckCommandSchema,Fa as QueueTaskGradeCommandSchema,Oa as ReserveLearningIterationCommandSchema,Ea as ResolveTaskFeedbackCommandSchema,Ra as RetryLearningIterationDispatchCommandSchema,Ga as ReviewTaskEvidenceCommandSchema,ja as RewardAuthoringFieldsSchema,Pb as RewardCalibrationClosureSchema,eb as RewardCheckRunSchema,cb as RewardCheckRuntimeSchema,ia as RewardFixtureAuthoringFieldsSchema,db as RewardFixtureCheckResultSchema,bb as RewardFixtureSchema,Ja as SaveAuthoringDraftCommandSchema,Ha as SealTaskBatchCommandSchema,Ba as SubmitTaskExampleCommandSchema,Ca as SubmitTaskFeedbackCommandSchema,ra as TASK_INTAKE_LIMITS,D as TaskAdmissionDecisionContentSchema,E as TaskAdmissionDecisionSchema,F as TaskBatchContentSchema,aa as TaskBatchPackageMetadataSchema,G as TaskBatchSchema,r as TaskDefinitionContentSchema,s as TaskDefinitionSchema,y as TaskEvidenceContentSchema,Cb as TaskEvidenceInspectionResultSchema,z as TaskEvidenceSchema,x as TaskExampleSubmissionSchema,C as TaskFeedbackSchema,B as TaskFeedbackSubmissionSchema,ka as TaskFormatAuthoringFieldsSchema,M as TaskGradeRunSchema,ta as TaskIntakeFileSchema,sa as TaskIntakeFormatSchema,va as TaskIntakePreviewSchema,ua as TaskIntakeRecordSchema,A as TaskRatingSchema,t as TaskSourceMappingSchema,f as TrainingHandoffOriginSchema,nc as acceptanceGroupVerdict,mc as assertAcceptanceBaselineReuse,kc as assertAcceptanceGroupSnapshot,lc as assertAcceptanceGroupUpdate,Y as assertAdmissionDecision,Z as assertGradeIdentity,R as assertLearningContentHash,zb as assertLearningRequestJson,wb as assertRewardCalibration,ab as authoringNumber,n as coalesceNightlyOccurrences,Za as compileRewardAuthoring,gb as compileRewardCheck,fb as compileRewardFixtures,ba as compileTaskBatch,ic as createAcceptanceGroupManifest,jc as createAcceptanceGroupSnapshot,ac as createAcceptancePlan,h as createBoundModelJudgeRunner,k as createBudgetedJudgeExecutor,Nb as createBudgetedRewardFixtureExecutor,Hb as createBuiltinTaskGradeExecutor,Mb as createIsolatedRewardFixtureExecutor,Vb as createLearningIterationWorker,Yb as createLearningScheduleWorker,Gb as createLearningService,d as createLearningTextAsset,Rb as createRewardCalibrationClosure,Kb as createRewardCheckJudgeBudgetStore,Ub as createRewardCheckWorker,Lb as createTaskGradeJudgeBudgetStore,Ib as createTaskGradeWorker,Eb as decodeTaskIntakeText,cc as evaluateAcceptancePlan,hb as executeRewardFixture,Sb as exportRewardCalibrationClosure,ub as inspectLearningPolicy,yb as inspectLearningTaskQueue,S as inspectTaskEvidence,xa as intakeDate,wa as intakeId,j as judgeCommittedSpend,ob as learningEvidenceId,pb as learningOperationId,O as learningRef,jb as learningResourceSchemas,rb as learningScheduleId,U as mapTaskSourceRecord,ib as matchRewardFixture,m as nextNightlyOccurrence,$a as parseRewardAuthoringObject,Fb as previewTaskIntake,vb as qualifyRewardCheck,V as readTaskJsonPointer,Xb as reconcileLearningCandidateDecision,nb as requireLearningRelease,mb as requireLearningResource,qb as resolveLearningTrainingParent,_a as rewardAuthoringFields,Tb as rewardCalibrationClosureAsset,Jb as rewardFixtureFromRating,P as sameLearningRef,Q as sealLearningContent,$ as sealTaskBatch,sb as synchronizeLearningSchedule,X as taskAttemptEvidence,ca as taskBatchPackageMetadata,_ as taskFamilyReservations,W as taskRecordFromEvidence,T as validateSourceSubmission,e as verifyLearningTextAsset,Qb as verifyRewardCalibrationClosure};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as u,c as A,d as x,i as v,j as S,k as R}from"./chunk-JEVA7YQL.js";import"./chunk-NNIRIUSY.js";import{c as B}from"./chunk-U2YMBCX7.js";import{c as U,d as C,f as O}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import"./chunk-BTI4N7YO.js";import"./chunk-BQAF5P7K.js";import{f as m}from"./chunk-3M53YXEI.js";import"./chunk-B7QDZPNX.js";import"./chunk-WZYRAR7X.js";import"./chunk-BT5YNE5U.js";import{d as k}from"./chunk-TERVLCRG.js";import"./chunk-GLUWATL5.js";import"./chunk-73G5UYBB.js";import"./chunk-YR5ID2SS.js";import"./chunk-55G6B54U.js";import"./chunk-KD3QVRIJ.js";import"./chunk-ARQEJOEK.js";import{P as y}from"./chunk-JUJSA7KI.js";import"./chunk-KGNCKIFP.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import{a as i}from"./chunk-FTQLQJQV.js";import{randomUUID as b}from"node:crypto";async function G(r,t){let e=t[0]||"smoke",n=await k(),l=await B(n,O(n)),c=P(n,r);if(e==="provider-catalog"||e==="providers-catalog"||e==="catalog"){let a=await E({apiBaseUrl:c,token:l});console.log(JSON.stringify(a,null,2));return}if(e==="models"||e==="model-list"){let a=await A({apiBaseUrl:c,token:l});console.log(JSON.stringify(a,null,2));return}if(e==="model"||e==="model-get"){let a=t[1]||o(r,"model");if(!a)throw new Error("usage: opchat model <model>");let p=await x({apiBaseUrl:c,token:l,model:a});console.log(JSON.stringify(p,null,2));return}if(e==="chat"){let a=o(r,"model")||"openpond-chat",p=o(r,"effort"),f=p?y.parse(p):void 0,d=o(r,"message")||o(r,"prompt")||"Reply with a short confirmation from OpChat.";if(!m(r.stream)){let s=await v({apiBaseUrl:c,token:l,model:a,reasoningEffort:f,messages:[{role:"user",content:d}]});console.log(JSON.stringify(s,null,2));return}let g="",h=null,w=null;for await(let s of S({apiBaseUrl:c,token:l,model:a,reasoningEffort:f,messages:[{role:"user",content:d}]}))s.type==="text_delta"?(g+=s.text,process.stdout.write(s.text)):s.type==="finish"?h=s.finishReason:s.type==="usage"&&(w=s.usage);process.stdout.write(`
|
|
3
|
-
`),console.log(JSON.stringify({finishReason:h,usage:w,text:g},null,2));return}if(e==="smoke"){let a=await R({apiBaseUrl:c,token:l,defaultModel:o(r,"model")||void 0,compatibilityModel:o(r,"compatibilityModel")||o(r,"compatModel")||void 0,skipStream:m(r.skipStream),skipTool:m(r.skipTool),log:i(p=>console.log(p),"log")});m(r.json)&&console.log(JSON.stringify(a,null,2));return}throw new Error("usage: opchat <provider-catalog|models|model|chat|smoke> [--opchat-api-base-url <url>] [chat --model <id> --effort <off|low|medium|high|xhigh|max>]")}i(G,"runOpChatCommand");async function E(r){let t=r.apiBaseUrl.trim().replace(/\/+$/,"");if(!t)throw new Error("OpChat API base URL is required.");let e=r.token.trim();if(!e)throw new Error("OpenPond API key is required.");let n=await fetch(`${t}/provider-catalog`,{method:"GET",headers:{Authorization:`Bearer ${e}`,Accept:"application/json","Content-Type":"application/json","x-openpond-client":"openpond-cli","x-openpond-request-id":b()}});if(!n.ok)throw new Error(`Hosted provider catalog failed: ${n.status} ${await T(n)}`);return n.json()}i(E,"getOpChatProviderCatalog");async function T(r){let t=await r.text().catch(()=>"");if(!t)return r.statusText||`HTTP ${r.status}`;try{let e=JSON.parse(t);if(typeof e.message=="string")return e.message;if(typeof e.error=="string")return e.error;if(e.error&&typeof e.error=="object"&&!Array.isArray(e.error)){let n=e.error;return[n.code,n.message].filter(Boolean).join(": ")||t}return t}catch{return t}}i(T,"readResponseError");function P(r,t){let e=o(t,"opchatApiBaseUrl")||o(t,"opchatApiBaseurl")||o(t,"opChatApiBaseUrl")||o(t,"opChatApiBaseurl")||o(t,"opchatApiUrl")||o(t,"opChatApiUrl");return e?u({opChatApiBaseUrl:e}):u({apiBaseUrl:U(t)||r.apiBaseUrl,chatApiBaseUrl:C(t)||r.chatApiBaseUrl})}i(P,"resolveOpChatCliBaseUrl");function o(r,t){let e=r[t];return typeof e=="string"?e.trim():""}i(o,"optionString");export{G as runOpChatCommand};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import"./chunk-BFKYRQMA.js";import"./chunk-DLVPSCTB.js";import"./chunk-JIMU3KDA.js";import"./chunk-6MI4KKWF.js";import"./chunk-QDHMP5FS.js";import"./chunk-YDT7L3VZ.js";import"./chunk-6FA3GG5B.js";import{m as B}from"./chunk-NNIRIUSY.js";import"./chunk-U2YMBCX7.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import"./chunk-BTI4N7YO.js";import"./chunk-BQAF5P7K.js";import{a as _,f as b,h as k,i as E}from"./chunk-3M53YXEI.js";import"./chunk-B7QDZPNX.js";import"./chunk-WZYRAR7X.js";import"./chunk-BT5YNE5U.js";import"./chunk-TERVLCRG.js";import"./chunk-GLUWATL5.js";import"./chunk-73G5UYBB.js";import{d as x,e as C}from"./chunk-YR5ID2SS.js";import"./chunk-55G6B54U.js";import"./chunk-KD3QVRIJ.js";import"./chunk-ARQEJOEK.js";import"./chunk-JUJSA7KI.js";import"./chunk-KGNCKIFP.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import{a as o}from"./chunk-FTQLQJQV.js";import{createHash as re,randomBytes as se}from"node:crypto";import{createServer as ie}from"node:http";var Ue=new URL(C).hostname,ve=new URL(x).hostname,Se=`${C}/opchat/v1`;import{spawn as oe}from"node:child_process";function M(e,t=process.platform){return t==="darwin"?{command:"open",args:[e]}:t==="win32"?{command:"rundll32.exe",args:["url.dll,FileProtocolHandler",e]}:{command:"xdg-open",args:[e]}}o(M,"resolveSystemBrowserCommand");async function S(e,t={}){let n=t.command??M(e),s=t.handoffTimeoutMs??1500;return new Promise(u=>{let r=!1,i=null,c=o(a=>{r||(r=!0,i&&clearTimeout(i),u(a))},"finish"),p=oe(n.command,n.args,{detached:!1,shell:!1,stdio:"ignore",windowsHide:!0});p.once("error",a=>{let l=a.code;c({opened:!1,error:l?`browser launcher ${n.command} failed (${l})`:`browser launcher ${n.command} failed`})}),p.once("close",(a,l)=>{if(a===0){c({opened:!0});return}let d=l?`signal ${l}`:`code ${a??"unknown"}`;c({opened:!1,error:`browser launcher ${n.command} exited with ${d}`})}),i=setTimeout(()=>{p.unref(),c({opened:!0})},s),i.unref()})}o(S,"openUrlWithSystemBrowser");function ae(e){return[e.slug,`team=${e.teamId}`,`role=${e.role}`,`status=${e.status}`,e.displayName].join(" ")}o(ae,"formatOrganizationLine");function le(e){return[e.email??e.userId,`user=${e.userId}`,`role=${e.role}`,e.createdAt].join(" ")}o(le,"formatOrganizationMemberLine");function ce(e){return e?[e.slug,`team=${e.teamId}`,`status=${e.status}`,`tools=${e.toolset.join(",")||"-"}`,e.resourceUrl].join(" "):"no mcp server configured"}o(ce,"formatOrganizationMcpServerLine");var ue=["estimate.read","estimate.write","estimate.execute","artifacts.read","artifacts.write"];function O(e){let t=e.trim().replace(/\/$/,"");if(!t)throw new Error("MCP resource URL must be non-empty");return new URL(t).toString().replace(/\/$/,"")}o(O,"normalizeMcpResourceUrl");function N(e,t){let n=typeof t.resourceUrl=="string"&&t.resourceUrl.trim()?t.resourceUrl.trim():typeof t.url=="string"&&t.url.trim()?t.url.trim():"";if(n)return O(n);if(!e?.resourceUrl)throw new Error("organization does not have an MCP server; run organizations mcp-generate first");return O(e.resourceUrl)}o(N,"resolveMcpProbeResourceUrl");function D(e,t){let n=typeof t.origin=="string"&&t.origin.trim()?t.origin.trim():"";return n?O(n):new URL(e).origin}o(D,"resolveMcpProbeOrigin");function $(e=32){return se(e).toString("base64url")}o($,"randomOauthToken");function de(e){return re("sha256").update(e).digest("base64url")}o(de,"buildMcpOauthPkceChallenge");function pe(e){let t=typeof e.scope=="string"&&e.scope.trim()?e.scope:typeof e.scopes=="string"&&e.scopes.trim()?e.scopes:"";if(!t)return[...ue];let n=t.split(/[,\s]+/g).map(s=>s.trim()).filter(Boolean);if(n.length===0)throw new Error("scope must include at least one OAuth scope");return n}o(pe,"parseMcpOAuthScopes");function me(e){let t=typeof e.clientId=="string"&&e.clientId.trim()?e.clientId.trim():"openpond-code-mcp-proof";if(t==="true")throw new Error("client-id must be a non-empty value");return t}o(me,"resolveMcpOAuthClientId");function fe(e){let t=k(e.timeoutSeconds,"timeout-seconds")??k(e.timeout,"timeout")??180;if(t<=0)throw new Error("timeout must be greater than zero");return t*1e3}o(fe,"resolveMcpOAuthTimeoutMs");function ge(e){let t=k(e.callbackPort,"callback-port")??0;if(t<0||t>65535)throw new Error("callback-port must be between 0 and 65535");return t}o(ge,"resolveMcpOAuthCallbackPort");function j(e){return new Promise((t,n)=>{e.close(s=>{s?n(s):t()})})}o(j,"closeServer");async function he(e){let t=!1,n=null,s=null,u=null,r=new Promise((a,l)=>{s=a,u=l}),i=o((a,l,d,m,f)=>{if(t){a.writeHead(204).end();return}t=!0,a.writeHead(l,{"cache-control":"no-store","content-type":"text/html; charset=utf-8"}),a.end(d),n&&clearTimeout(n),m?s?.(m):u?.(f??new Error("oauth_callback_failed"))},"settle"),c=ie((a,l)=>{let d=a.headers.host??"127.0.0.1",m=new URL(a.url??"/",`http://${d}`);if(m.pathname!=="/callback"){l.writeHead(404,{"content-type":"text/plain; charset=utf-8"}),l.end("Not found");return}let f=m.searchParams.get("state")??"",g=m.searchParams.get("error")??"",P=m.searchParams.get("code")??"";if(f!==e.expectedState){i(l,400,"<!doctype html><title>OpenPond OAuth failed</title><p>State mismatch. Return to the terminal and retry.</p>",void 0,new Error("oauth_state_mismatch"));return}if(g){i(l,400,"<!doctype html><title>OpenPond OAuth denied</title><p>Authorization was not completed. Return to the terminal.</p>",void 0,new Error(`oauth_authorization_failed:${g}`));return}if(!P){i(l,400,"<!doctype html><title>OpenPond OAuth failed</title><p>Missing authorization code. Return to the terminal and retry.</p>",void 0,new Error("oauth_code_missing"));return}i(l,200,"<!doctype html><title>OpenPond OAuth complete</title><p>Authorization complete. You can return to the terminal.</p>",{code:P,state:f})});await new Promise((a,l)=>{let d=o(f=>{c.off("listening",m),l(f)},"onError"),m=o(()=>{c.off("error",d),a()},"onListening");c.once("error",d),c.once("listening",m),c.listen(e.port,"127.0.0.1")});let p=c.address();if(!p||typeof p.port!="number")throw await j(c),new Error("oauth_callback_listener_failed");return n=setTimeout(()=>{t||(t=!0,u?.(new Error("oauth_callback_timeout")))},e.timeoutMs),{close:o(async()=>{n&&clearTimeout(n),await j(c).catch(()=>{})},"close"),redirectUri:`http://127.0.0.1:${p.port}/callback`,waitForCallback:o(()=>r,"waitForCallback")}}o(he,"startMcpOAuthCallbackListener");function ye(e){S(e)}o(ye,"openUrlWithSystemBrowser");function Pe(e){let t=new URL(e.authorizationEndpoint);return t.searchParams.set("response_type","code"),t.searchParams.set("client_id",e.clientId),t.searchParams.set("redirect_uri",e.redirectUri),t.searchParams.set("code_challenge",e.codeChallenge),t.searchParams.set("code_challenge_method","S256"),t.searchParams.set("resource",e.resourceUrl),t.searchParams.set("scope",e.scopes.join(" ")),t.searchParams.set("state",e.state),t.toString()}o(Pe,"buildMcpOAuthAuthorizeUrl");async function Ae(e){let t=new URLSearchParams;t.set("grant_type","authorization_code"),t.set("client_id",e.clientId),t.set("redirect_uri",e.redirectUri),t.set("code",e.code),t.set("code_verifier",e.codeVerifier);let n=await fetch(`${e.origin}/oauth/token`,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:t}),s=await J(n);if(!n.ok)throw new Error(`oauth_token_exchange_failed:${n.status}:${JSON.stringify(s)}`);if(!s||typeof s!="object"||Array.isArray(s))throw new Error("oauth_token_exchange_invalid_response");let u=s;if(typeof u.access_token!="string"||!u.access_token.trim())throw new Error("oauth_token_exchange_missing_access_token");return{access_token:u.access_token,...typeof u.expires_in=="number"?{expires_in:u.expires_in}:{},...typeof u.refresh_token=="string"?{refresh_token:u.refresh_token}:{},...typeof u.scope=="string"?{scope:u.scope}:{},...typeof u.token_type=="string"?{token_type:u.token_type}:{}}}o(Ae,"exchangeMcpOAuthAuthorizationCode");async function J(e){let t=await e.text().catch(()=>"");if(!t)return null;let n=t.trim();if((e.headers.get("content-type")??"").toLowerCase().includes("application/json")||n.startsWith("{")||n.startsWith("["))try{return JSON.parse(n)}catch{return t}return t}o(J,"readMcpProbeBody");async function U(e,t={}){let n=await fetch(e,t);return{url:e,status:n.status,ok:n.ok,headers:{contentType:n.headers.get("content-type"),location:n.headers.get("location"),wwwAuthenticate:n.headers.get("www-authenticate")},body:await J(n)}}o(U,"fetchMcpProbe");function we(e,t,n){return n?{jsonrpc:"2.0",id:e,method:t,params:n}:{jsonrpc:"2.0",id:e,method:t}}o(we,"buildMcpJsonRpcRequest");function F(e){let t=typeof e.arguments=="string"&&e.arguments.trim()?e.arguments:typeof e.args=="string"&&e.args.trim()?e.args:"";if(!t)return{};let n=_(t,"arguments");if(!n||typeof n!="object"||Array.isArray(n))throw new Error("arguments must be a JSON object");return n}o(F,"parseMcpToolArguments");async function R(e){let t={"content-type":"application/json"};return e.accessToken&&(t.authorization=`Bearer ${e.accessToken}`),U(e.resourceUrl,{method:"POST",headers:t,body:JSON.stringify(we(e.id,e.method,e.params))})}o(R,"postMcpJsonRpcProbe");async function q(e){let t=O(e.resourceUrl),n=O(e.origin),s=`${t}/.well-known/oauth-protected-resource`,u=`${n}/.well-known/oauth-authorization-server`,[r,i,c,p,a,l,d]=await Promise.all([U(s),U(u),U(t),R({resourceUrl:t,id:1,method:"initialize"}),R({resourceUrl:t,id:2,method:"tools/list"}),R({resourceUrl:t,id:3,method:"tools/call",params:{name:e.toolName,arguments:e.toolArguments}}),e.accessToken?R({resourceUrl:t,id:4,method:"tools/call",params:{name:e.toolName,arguments:e.toolArguments},accessToken:e.accessToken}):Promise.resolve(null)]);return{resourceUrl:t,origin:n,protectedResource:r,authorizationServer:i,directGetChallenge:c,initialize:p,toolsList:a,unauthenticatedToolCall:l,...d?{authenticatedToolCall:d}:{}}}o(q,"probeOrganizationMcp");function Oe(e){let t=typeof e=="string"?e.trim():"";if(t==="owner"||t==="admin"||t==="member")return t;throw new Error("role must be owner, admin, or member")}o(Oe,"parseOrganizationRole");function be(e){let t=typeof e.displayName=="string"&&e.displayName.trim()?e.displayName.trim():typeof e.name=="string"&&e.name.trim()?e.name.trim():"";if(!t)throw new Error("usage: organizations create --name <name> [--slug <slug>]");return{displayName:t,...typeof e.slug=="string"&&e.slug.trim()?{slug:e.slug.trim()}:{},...typeof e.primaryContactEmail=="string"&&e.primaryContactEmail.trim()?{primaryContactEmail:e.primaryContactEmail.trim()}:{},...typeof e.customDomain=="string"&&e.customDomain.trim()?{customDomain:e.customDomain.trim()}:{}}}o(be,"buildOrganizationCreateInput");function ke(e){let t={},n=typeof e.displayName=="string"&&e.displayName.trim()?e.displayName.trim():typeof e.name=="string"&&e.name.trim()?e.name.trim():"";if(n&&(t.displayName=n),typeof e.slug=="string"&&e.slug.trim()&&(t.slug=e.slug.trim()),typeof e.primaryContactEmail=="string"&&(t.primaryContactEmail=e.primaryContactEmail.trim()||null),typeof e.customDomain=="string"&&(t.customDomain=e.customDomain.trim()||null),typeof e.status=="string"&&e.status.trim()){let s=e.status.trim();if(s!=="active"&&s!=="disabled"&&s!=="archived")throw new Error("status must be active, disabled, or archived");t.status=s}if(Object.keys(t).length===0)throw new Error("organizations update requires at least one changed field");return t}o(ke,"buildOrganizationUpdateInput");function xe(e){let t=typeof e.email=="string"?e.email.trim():"";if(!t)throw new Error("usage: organizations member-upsert <slug> --email <email> --role <role>");return{email:t,role:Oe(e.role)}}o(xe,"buildOrganizationMemberInput");function Ce(e){return{...typeof e.origin=="string"&&e.origin.trim()?{origin:e.origin.trim()}:{},...typeof e.toolset=="string"&&e.toolset.trim()?{toolset:E(e.toolset)}:{}}}o(Ce,"buildOrganizationMcpGenerateInput");async function Nn(e,t){let n=t[0]||"list",s=await B(e),u=b(e.json);if(n==="list"){let r=await s.listOrganizations();if(u){console.log(JSON.stringify({organizations:r},null,2));return}if(r.length===0){console.log("no organizations found");return}for(let i of r)console.log(ae(i));return}if(n==="create"){let r=await s.createOrganization(be(e));console.log(JSON.stringify({organization:r},null,2));return}if(n==="get"){let r=t[1];if(!r)throw new Error("usage: organizations get <slug>");let i=await s.getOrganization(r);console.log(JSON.stringify({organization:i},null,2));return}if(n==="update"){let r=t[1];if(!r)throw new Error("usage: organizations update <slug> [--name <name>]");let i=await s.updateOrganization(r,ke(e));console.log(JSON.stringify({organization:i},null,2));return}if(n==="members"||n==="member-list"){let r=t[1];if(!r)throw new Error("usage: organizations members <slug>");let i=await s.listOrganizationMembers(r);if(u){console.log(JSON.stringify({members:i},null,2));return}if(i.length===0){console.log("no organization members found");return}for(let c of i)console.log(le(c));return}if(n==="member-upsert"||n==="member-add"){let r=t[1];if(!r)throw new Error("usage: organizations member-upsert <slug> --email <email> --role <role>");let i=await s.upsertOrganizationMember(r,xe(e));console.log(JSON.stringify({member:i},null,2));return}if(n==="mcp-get"||n==="mcp-server"){let r=t[1];if(!r)throw new Error("usage: organizations mcp-get <slug>");let i=await s.getOrganizationMcpServer(r);if(u){console.log(JSON.stringify({mcpServer:i},null,2));return}console.log(ce(i));return}if(n==="mcp-generate"){let r=t[1];if(!r)throw new Error("usage: organizations mcp-generate <slug> [--origin <url>]");let i=await s.generateOrganizationMcpServer(r,Ce(e));console.log(JSON.stringify({mcpServer:i},null,2));return}if(n==="mcp-probe"||n==="mcp-inspect"){let r=t[1];if(!r)throw new Error("usage: organizations mcp-probe <slug> [--origin <url>] [--tool <name>] [--arguments <json>] [--access-token <token>]");let i=await s.getOrganizationMcpServer(r),c=N(i,e),p=D(c,e),a=typeof e.tool=="string"&&e.tool.trim()?e.tool.trim():typeof e.toolName=="string"&&e.toolName.trim()?e.toolName.trim():"estimate_search_history",l=F(e),d=typeof e.accessToken=="string"&&e.accessToken.trim()?e.accessToken.trim():"",m=await q({resourceUrl:c,origin:p,toolName:a,toolArguments:l,...d?{accessToken:d}:{}});console.log(JSON.stringify({mcpServer:i,probe:m},null,2));return}if(n==="mcp-authorize"||n==="mcp-oauth"){let r=t[1];if(!r)throw new Error("usage: organizations mcp-authorize <slug> [--origin <url>] [--scope <csv|space>] [--tool <name>] [--arguments <json>] [--open]");let i=await s.getOrganizationMcpServer(r),c=N(i,e),p=D(c,e),a=me(e),l=pe(e),d=$(18),m=$(48),f=de(m),g=await he({expectedState:d,port:ge(e),timeoutMs:fe(e)}),P=Pe({authorizationEndpoint:`${p}/oauth/authorize`,clientId:a,codeChallenge:f,redirectUri:g.redirectUri,resourceUrl:c,scopes:l,state:d});if(console.error("Open this URL to authorize the organization MCP connection:"),console.error(P),console.error(`Waiting for OAuth callback on ${g.redirectUri}`),b(e.open))try{ye(P)}catch(A){console.error(`Unable to open a browser automatically: ${A instanceof Error?A.message:String(A)}`)}try{let A=await g.waitForCallback(),y=await Ae({clientId:a,code:A.code,codeVerifier:m,origin:p,redirectUri:g.redirectUri}),K=typeof e.tool=="string"&&e.tool.trim()?e.tool.trim():typeof e.toolName=="string"&&e.toolName.trim()?e.toolName.trim():"estimate_search_history",G=F(e),W=await q({accessToken:y.access_token,origin:p,resourceUrl:c,toolArguments:G,toolName:K}),V=b(e.printToken);console.log(JSON.stringify({mcpServer:i,oauth:{accessTokenReceived:!0,clientId:a,expiresIn:y.expires_in??null,refreshTokenReceived:!!y.refresh_token,scope:y.scope??l.join(" "),tokenType:y.token_type??"Bearer",...V?{accessToken:y.access_token,refreshToken:y.refresh_token??null}:{}},probe:W},null,2))}finally{await g.close()}return}if(n==="mcp-rotate"||n==="mcp-disable"||n==="mcp-enable"){let r=t[1];if(!r)throw new Error(`usage: organizations ${n} <slug>`);let i=n==="mcp-rotate"?await s.rotateOrganizationMcpServer(r):n==="mcp-disable"?await s.disableOrganizationMcpServer(r):await s.enableOrganizationMcpServer(r);console.log(JSON.stringify({mcpServer:i},null,2));return}throw new Error("usage: organizations <list|create|get|update|members|member-upsert|mcp-get|mcp-generate|mcp-probe|mcp-authorize|mcp-rotate|mcp-disable|mcp-enable> [args]")}o(Nn,"runOrganizationsCommand");export{ue as DEFAULT_MCP_AUTHORIZE_SCOPES,we as buildMcpJsonRpcRequest,Pe as buildMcpOAuthAuthorizeUrl,de as buildMcpOauthPkceChallenge,be as buildOrganizationCreateInput,Ce as buildOrganizationMcpGenerateInput,xe as buildOrganizationMemberInput,ke as buildOrganizationUpdateInput,j as closeServer,Ae as exchangeMcpOAuthAuthorizationCode,U as fetchMcpProbe,ae as formatOrganizationLine,ce as formatOrganizationMcpServerLine,le as formatOrganizationMemberLine,O as normalizeMcpResourceUrl,ye as openUrlWithSystemBrowser,pe as parseMcpOAuthScopes,F as parseMcpToolArguments,Oe as parseOrganizationRole,R as postMcpJsonRpcProbe,q as probeOrganizationMcp,$ as randomOauthToken,J as readMcpProbeBody,ge as resolveMcpOAuthCallbackPort,me as resolveMcpOAuthClientId,fe as resolveMcpOAuthTimeoutMs,D as resolveMcpProbeOrigin,N as resolveMcpProbeResourceUrl,Nn as runOrganizationsCommand,he as startMcpOAuthCallbackListener};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as b,b as Y,c as F,d as H,e as W,f as z,g as X,h as E,i as y,j as v,k as C,l as Z,m as ee,n as A,o as te,p as _,q as j,r as re,s as ne,t as x,u as M,v as R,w as J,x as N,y as U,z as T}from"./chunk-Q7AXHFZV.js";import"./chunk-R27YGT77.js";import"./chunk-EAPFMACH.js";import"./chunk-6FA3GG5B.js";import{m as h,n as I,v as P}from"./chunk-NNIRIUSY.js";import"./chunk-U2YMBCX7.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import"./chunk-BTI4N7YO.js";import"./chunk-BQAF5P7K.js";import{c as u,d,e as w,f as S}from"./chunk-3M53YXEI.js";import"./chunk-B7QDZPNX.js";import"./chunk-WZYRAR7X.js";import"./chunk-BT5YNE5U.js";import"./chunk-TERVLCRG.js";import"./chunk-GLUWATL5.js";import"./chunk-73G5UYBB.js";import"./chunk-YR5ID2SS.js";import"./chunk-55G6B54U.js";import"./chunk-KD3QVRIJ.js";import"./chunk-ARQEJOEK.js";import"./chunk-JUJSA7KI.js";import"./chunk-KGNCKIFP.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import{a as g}from"./chunk-FTQLQJQV.js";function k(e){let o=e.gitRepo?`${e.gitOwner??"_"}/${e.gitRepo}`:e.internalRepoPath??e.templateRepoUrl??e.normalizedSourceIdentity;return[e.id,e.status,e.sourceType,e.name,o].join(" ")}g(k,"formatProjectLine");function L(e){let o=e.selectedEntrypoint.name?`${e.selectedEntrypoint.scope}:${e.selectedEntrypoint.name}`:e.selectedEntrypoint.scope,i=e.runtimeSource?[e.runtimeSource.mode,e.runtimeSource.publishedSnapshotName??e.runtimeSource.publishedSnapshotId??e.runtimeSource.sourceRef].filter(a=>!!a).join(":"):"latest_source";return[e.id,e.status,e.triggerType,e.defaultWorkflowMode,i,o,e.name].join(" ")}g(L,"formatAgentLine");async function B(e,o,i){let a=i[1]?.trim(),t=i[2]?.trim(),n="usage: agent source <deploy-plan|checks|manifest-snapshots|setup|publish> <agent-id> --team-id <id>",r=d(o,n);if(!a||!t)throw new Error(n);if(a==="deploy-plan"){let s=await e.agents.sourceDeployPlan(t,{teamId:r});console.log(JSON.stringify({deployPlan:s},null,2));return}if(a==="manifest-snapshots"){let s=await e.agents.manifestSnapshots(t,{teamId:r,limit:x(o.limit)});console.log(JSON.stringify({manifestSnapshots:s},null,2));return}if(a==="checks"){let s=await e.agents.requestSourceChecks(t,M(r,o));console.log(JSON.stringify(s,null,2));return}if(a==="setup"){let s=typeof o.provider=="string"?o.provider.trim():"",l=typeof o.allowedActions=="string"?o.allowedActions.split(",").map(c=>c.trim()).filter(Boolean):[];if(!s||l.length===0)throw new Error(`${n}; setup requires --provider and --allowed-actions`);let p=await e.agents.configureSourceSetup(t,{teamId:r,integrationBindings:[{provider:s,mode:"connected",connectionMode:"member_connection",grantPolicy:"read_only",allowedActions:l,enabled:!0}]});console.log(JSON.stringify(p,null,2));return}if(a==="publish"){let s=await e.agents.publishSource(t,R(r,o));console.log(JSON.stringify(s,null,2));return}throw new Error(n)}g(B,"runAgentSourceWorkflow");import G from"node:path";var Q=new Set(["inspect","build","validate","eval","traces"]);function $(e,o){return Q.has(e)?!0:e==="run"&&!u(o,"teamId")}g($,"shouldDelegateLocalAgentSdkCommand");async function q(e,o){let i=o[0]||"inspect",a=G.resolve(u(e,"cwd")||u(e,"path")||"."),t=[i,...o.slice(1),"--cwd",a];S(e.json)&&t.push("--json"),D(t,e,"input","input"),D(t,e,"inputFile","input-file");let n=b(a),r=await P(n.command,[...n.args,...t],{cwd:a,inherit:!0});r.code!==0&&(process.exitCode=r.code??1)}g(q,"runLocalAgentSdkCommand");function D(e,o,i,a){let t=u(o,i);t&&e.push(`--${a}`,t)}g(D,"appendForwardedOption");async function Oe(e,o){let i=o[0]||"list";if($(i,e)){await q(e,o);return}let a=await h(e);if(i==="list"){let t=d(e,"usage: agent list"),n=await a.agents.list({teamId:t});if(S(e.json)){console.log(JSON.stringify({agents:n},null,2));return}if(n.length===0){console.log("no sandbox agents found");return}for(let r of n)console.log(L(r));return}if(i==="create"||i==="upsert"){let t=await a.agents.upsert(U(e));console.log(JSON.stringify({agent:t},null,2));return}if(i==="get"){let t=o[1]?.trim(),n=d(e,"usage: agent get <agentId>");if(!t)throw new Error("usage: agent get <agentId> --team-id <id>");let r=await a.agents.get(t,{teamId:n});console.log(JSON.stringify({agent:r},null,2));return}if(i==="run"){let t=o[1]?.trim(),n=d(e,"usage: agent run <agentId>");if(!t)throw new Error("usage: agent run <agentId> --team-id <id>");let r=u(e,"idempotencyKey"),s=u(e,"conversationId"),l=u(e,"targetProjectId"),p=A(e.triggerType),c=I(e.workflowMode),m=w(e,"input","input"),f=w(e,"metadata","metadata"),O=j(e),K=await a.agents.run(t,{teamId:n,...s?{conversationId:s}:{},...r?{idempotencyKey:r}:{},...l?{targetProjectId:l}:{},...l?{targetProject:{id:l}}:{},...p?{triggerType:p}:{},...c?{workflowMode:c}:{},...m?{input:m}:{},...f?{metadata:f}:{},...O?{runtimeSourcePolicy:O}:{}});console.log(JSON.stringify(K,null,2));return}if(i==="bind-runtime-source"||i==="bind-source"){let t=o[1]?.trim(),n=d(e,"usage: agent bind-source <agentId>");if(!t)throw new Error("usage: agent bind-source <agentId> --team-id <id> --source-mode latest_source|published_snapshot|auto");let r=_(e);if(!r?.mode)throw new Error("usage: agent bind-source <agentId> --team-id <id> --source-mode latest_source|published_snapshot|auto");let s=await a.agents.update(t,{teamId:n,runtimeSource:r});console.log(JSON.stringify({agent:s,agentSource:s.runtimeSource},null,2));return}if(i==="run-test"){let t=o[1]?.trim(),n=d(e,"usage: agent run-test <agentId>");if(!t)throw new Error("usage: agent run-test <agentId> --team-id <id>");let r=u(e,"idempotencyKey"),s=u(e,"conversationId"),l=u(e,"targetProjectId"),p=w(e,"input","input"),c=w(e,"metadata","metadata"),m=I(e.workflowMode),f=await a.agents.run(t,{teamId:n,...s?{conversationId:s}:{},...r?{idempotencyKey:r}:{},...l?{targetProjectId:l}:{},...l?{targetProject:{id:l}}:{},...m?{workflowMode:m}:{},...p?{input:p}:{},metadata:{...c??{},source:"agent_run_test"},runtimeSourcePolicy:j(e,"diagnostic")});console.log(JSON.stringify({resolvedRuntimeSource:f.run.runtimeSource,agent:f.agent,run:f.run,sandbox:f.sandbox??null},null,2));return}if(i==="source"){await B(a,e,o);return}if(i==="update"){let t=o[1]?.trim(),n=d(e,"usage: agent update <agentId>");if(!t)throw new Error("usage: agent update <agentId> --team-id <id>");let r=await a.agents.update(t,T(n,e));console.log(JSON.stringify({agent:r},null,2));return}if(i==="archive"){let t=o[1]?.trim(),n=d(e,"usage: agent archive <agentId>");if(!t)throw new Error("usage: agent archive <agentId> --team-id <id>");let r=await a.agents.archive(t,{teamId:n});console.log(JSON.stringify({agent:r},null,2));return}throw new Error("usage: agent <inspect|build|validate|eval|traces|list|create|upsert|get|update|run|run-test|bind-source|source|edit|archive> [--team-id <id>] [--project-id <id>] [--name <name>]")}g(Oe,"runAgentCommand");import V from"node:path";async function xe(e,o){let i=o[0]||"list",a=await h(e);if(i==="list"){let t=d(e,"usage: project list"),n=await a.projects.list({teamId:t});if(S(e.json)){console.log(JSON.stringify({projects:n},null,2));return}if(n.length===0){console.log("no sandbox projects found");return}for(let r of n)console.log(k(r));return}if(i==="create"||i==="upsert"){let t=await a.projects.upsert(J(e));console.log(JSON.stringify({project:t},null,2));return}if(i==="get"){let t=o[1]?.trim(),n=d(e,"usage: project get <projectId>");if(!t)throw new Error("usage: project get <projectId> --team-id <id>");let r=await a.projects.get(t,{teamId:n});console.log(JSON.stringify({project:r},null,2));return}if(i==="update"){let t=o[1]?.trim(),n=d(e,"usage: project update <projectId>");if(!t)throw new Error("usage: project update <projectId> --team-id <id>");let r=await a.projects.update(t,N(n,e));console.log(JSON.stringify({project:r},null,2));return}if(i==="sync"){let t=o[1]?.trim(),n=d(e,"usage: project sync <projectId>");if(!t)throw new Error("usage: project sync <projectId> --team-id <id>");let r=await a.projects.sync(t,{teamId:n});console.log(JSON.stringify({project:r},null,2));return}if(i==="source-upload"||i==="upload-source"){let t=o[1]?.trim(),n=d(e,"usage: project source-upload <projectId>");if(!t)throw new Error("usage: project source-upload <projectId> --team-id <id> [--path <dir>]");let r=V.resolve(u(e,"path")||"."),s=await E(r,e),l=u(e,"commitMessage")||u(e,"commit-message")||"Upload OpenPond project source",p=await y(r),c=await v(r,p.entries),m=C(p,c.entries),f=await a.projects.uploadSource(t,{teamId:n,entries:m.entries,...s?{branch:s}:{},commitMessage:l});console.log(JSON.stringify({project:f,uploaded:{path:r,branch:s,fileCount:m.fileCount,totalBytes:m.totalBytes,limits:m.limits,transport:m.transport,...c.generatedManifestPath?{agentSdk:{generatedManifestPath:c.generatedManifestPath,generatedEntryCount:c.entries.length,synthesizedOpenPondYaml:c.synthesizedOpenPondYaml,uploadMetadataPath:c.uploadMetadataPath,uploadMetadataHash:c.uploadMetadataHash,commands:c.uploadMetadata?.commands,dependencySetup:c.uploadMetadata?.dependencySetup,packageManager:c.uploadMetadata?.packageManager,sourceTreeMode:c.uploadMetadata?.sourceTreeMode,artifactHashes:c.uploadMetadata?.artifactHashes}}:{}}},null,2));return}if(i==="archive"){let t=o[1]?.trim(),n=d(e,"usage: project archive <projectId>");if(!t)throw new Error("usage: project archive <projectId> --team-id <id>");let r=await a.projects.archive(t,{teamId:n});console.log(JSON.stringify({project:r},null,2));return}throw new Error("usage: project <list|create|upsert|get|update|sync|source-upload|archive> [--team-id <id>] [--name <name>]")}g(xe,"runProjectCommand");export{W as PROJECT_SOURCE_UPLOAD_CONCURRENCY,z as PROJECT_SOURCE_UPLOAD_LIMITS,H as PROJECT_SOURCE_UPLOAD_MAX_BYTES,Y as PROJECT_SOURCE_UPLOAD_MAX_FILES,F as PROJECT_SOURCE_UPLOAD_MAX_FILE_BYTES,X as PROJECT_SOURCE_UPLOAD_TRANSPORT,M as buildAgentSourceChecksInput,_ as buildAgentSourceConfig,j as buildAgentSourcePolicy,R as buildAgentSourcePublishInput,T as buildAgentUpdateInput,U as buildAgentUpsertInput,N as buildProjectUpdateInput,J as buildProjectUpsertInput,y as collectProjectSourceUploadEntries,L as formatAgentLine,k as formatProjectLine,ee as parseAgentEntrypointScope,ne as parseAgentSourceCheckDispatch,re as parseAgentSourceCheckKind,te as parseAgentSourceMode,A as parseAgentTriggerType,x as parsePositiveLimit,Z as parseProjectSourceType,b as resolveLocalAgentSdkCommand,Oe as runAgentCommand,B as runAgentSourceWorkflow,xe as runProjectCommand};
|