openpond 0.2.54 → 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 +10823 -9118
- package/dist/app-server.js +1 -1
- package/dist/chunks/actions-command-QU4H53OG.js +2 -0
- package/dist/chunks/{app-layer-I7MZYVLL.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-GXSTZBM6.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-5MCNZCVQ.js +2 -0
- package/dist/chunks/chunk-6QSSIT62.js +2 -0
- 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-UJ5EFSEC.js → chunk-B7RFL4N2.js} +1 -1
- package/dist/chunks/chunk-BFKYRQMA.js +2 -0
- package/dist/chunks/chunk-BLXEAZCQ.js +12 -0
- package/dist/chunks/chunk-D74JEERO.js +5 -0
- package/dist/chunks/{chunk-PA7XP42P.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-JDLAHVAJ.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-AH22RHPS.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-HY3GOBFJ.js +58 -0
- 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-KGNCKIFP.js +3 -0
- package/dist/chunks/chunk-KUERKVEU.js +3 -0
- package/dist/chunks/chunk-KVTBX2UP.js +2 -0
- package/dist/chunks/chunk-L6K7ERG5.js +2 -0
- package/dist/chunks/{chunk-N5QNXMIS.js → chunk-LQQNBVEB.js} +1 -1
- package/dist/chunks/{chunk-YJ4PNAST.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-4SHKI3BH.js → chunk-O6ULLQJ6.js} +1 -1
- 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-XM26DGML.js → chunk-OPNRWESL.js} +1 -1
- package/dist/chunks/chunk-OQKJGTTO.js +4 -0
- package/dist/chunks/chunk-OQPJ7FJF.js +9 -0
- package/dist/chunks/{chunk-R3XFY7VL.js → chunk-OS3LO5J3.js} +1 -1
- package/dist/chunks/{chunk-T5LE6R5S.js → chunk-OSIO7PLX.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-WITSXYEW.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-YL6VFJ4P.js → chunk-QDC4OW3S.js} +1 -1
- 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-N3DEA6PG.js → chunk-RAXOSUSW.js} +1 -1
- package/dist/chunks/chunk-RNIAFXMB.js +50 -0
- package/dist/chunks/chunk-S5ESN275.js +42 -0
- 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-UKMA4R6X.js +6 -0
- package/dist/chunks/{chunk-7ZG3IT7C.js → chunk-VRIEKBBH.js} +6 -6
- 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-YD55Z5H3.js → chunk-YOBN7KTF.js} +11 -11
- package/dist/chunks/chunk-YOQRYNLP.js +2 -0
- package/dist/chunks/chunk-YR5ID2SS.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-NAZ26IZL.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-PKK2BOTB.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/{chunk-6VF3Q6QJ.js → dist-SKYG5LZO.js} +2 -4
- package/dist/chunks/dist-VYC5VMQB.js +2 -0
- package/dist/chunks/dist-ZVJPJLXR.js +2 -0
- 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-XKXXOP5N.js +4 -0
- package/dist/chunks/{help-WLKSACLZ.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/javascript-isolate-process-source-ZPQKKLR4.js +2 -0
- package/dist/chunks/javascript-verifier-worker-source-F3LSGPOY.js +2 -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-TFZMUEDR.js +3 -0
- 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-BBGGPJMI.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/sql-execution-process-source-B4HQM6ZV.js +2 -0
- package/dist/chunks/src-CJM6HY5Y.js +326 -0
- package/dist/chunks/{src-CR6UZYTX.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-7I4BAUVO.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-CaRMZoxo.css +1 -0
- package/dist/web/assets/App-s-CJswyt.js +154 -0
- package/dist/web/assets/{AppDialog-BdusXgU0.js → AppDialog-t2Fx5tK3.js} +1 -1
- package/dist/web/assets/{AppTerminalPanel-C4uRpnBz.js → AppTerminalPanel-Dj1Y32oI.js} +2 -2
- package/dist/web/assets/AppsView-BYE5EBDJ.js +1 -0
- package/dist/web/assets/{BrowserSidebar-Bl7V6YO2.js → BrowserSidebar-jhWi4rVm.js} +1 -1
- package/dist/web/assets/{CartesianChart-BstFbsdn.js → CartesianChart-C1DIx0Ia.js} +1 -1
- package/dist/web/assets/{CollaborationTabs-B8YAf0c1.js → CollaborationTabs-Bdr-HmOL.js} +1 -1
- package/dist/web/assets/{CommandMenu-DZct7zUJ.js → CommandMenu-Ux2yOHAc.js} +1 -1
- package/dist/web/assets/{CommunityView-CR0-W-uG.js → CommunityView-DPEeVKFn.js} +1 -1
- package/dist/web/assets/{ComposerCreateImproveStrip-DR-Qo7b4.js → ComposerCreateImproveStrip-CEgh4OtN.js} +1 -1
- package/dist/web/assets/{GetStartedView-xqQoMMei.js → GetStartedView-CFHP0AaI.js} +1 -1
- package/dist/web/assets/HostedModelLearningReview-D8BGTPVN.js +1 -0
- package/dist/web/assets/{HostedModelLearningSettings-De3i9wF4.js → HostedModelLearningSettings-JS1S7vNO.js} +1 -1
- package/dist/web/assets/{LabModelVersionDetailPage-DAY1MmqP.js → LabModelVersionDetailPage-Dx5Q3xV2.js} +1 -1
- package/dist/web/assets/{LabSkillSidebar-DLnIgnry.js → LabSkillSidebar-BxffN-pN.js} +1 -1
- package/dist/web/assets/LabsRoute-CyYF8-dw.js +99 -0
- package/dist/web/assets/MainChatThread-DZpcFRFl.js +2 -0
- package/dist/web/assets/MainPane-5DTtwVCk.js +65 -0
- package/dist/web/assets/MainPane-BIM_UJ3q.css +1 -0
- package/dist/web/assets/{MarkdownText-gJMuefaJ.js → MarkdownText-BR4V6lNO.js} +24 -24
- package/dist/web/assets/{NativeSkillSidebar-Dlxb8iOC.js → NativeSkillSidebar-DU9IEgIO.js} +1 -1
- package/dist/web/assets/{NewExperienceSwitcher-DM-cqJ-K.js → NewExperienceSwitcher-mIy6FzCj.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-Cu1q75gq.js → NewProjectDialog-RfTZTHxl.js} +1 -1
- package/dist/web/assets/{OutputsPage-DiXMkasl.js → OutputsPage-Cr1Spf7S.js} +1 -1
- package/dist/web/assets/{ProjectsPage-DqiBHiCB.js → ProjectsPage-CE6QUB-b.js} +1 -1
- package/dist/web/assets/RightChatPanelStack-T6VRWuHo.js +1 -0
- package/dist/web/assets/RightSidebarHomePanel-CK0rP3WT.js +1 -0
- package/dist/web/assets/ScheduledWorkPage-vOrYv8pp.js +1 -0
- package/dist/web/assets/SettingsView-DCKVrfjj.js +5 -0
- package/dist/web/assets/SettingsView-Dulr_xlq.css +1 -0
- package/dist/web/assets/{TeamChatView-DM0adMtj.js → TeamChatView-Bwrjr-vk.js} +2 -2
- package/dist/web/assets/{TerminalOverlay-CFlH51DD.js → TerminalOverlay-DhPoKZAq.js} +1 -1
- package/dist/web/assets/TrainingCreationPanel-BXHfohNm.js +1 -0
- package/dist/web/assets/{TrainingDraftPanel-Bbo3RRie.js → TrainingDraftPanel-C9cRX5qf.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-CSRjJUSa.js → UsageSettingsSection-CrdcSGeW.js} +1 -1
- package/dist/web/assets/{WorkSidebarPanel-DwlEMEoG.js → WorkSidebarPanel-DSSikNFQ.js} +1 -1
- package/dist/web/assets/WorkspaceDiffPanel-BAFo0CPN.js +14 -0
- package/dist/web/assets/WorkspaceEnvironmentMenu-BVHAhwnJ.js +63 -0
- package/dist/web/assets/WorkspaceGitDialogs-CwVoiDQ2.js +1 -0
- package/dist/web/assets/{WorkspaceMonacoEditor-BR4qxMgU.js → WorkspaceMonacoEditor-TxLyhzNp.js} +3 -3
- package/dist/web/assets/arrow-up-right-C9aE8Mfz.js +1 -0
- package/dist/web/assets/chunk-P3BRSSRD-DUGfuKA8.js +1 -0
- package/dist/web/assets/{clipboard-BZzZ82Bk.js → clipboard-Dk158Qp4.js} +1 -1
- package/dist/web/assets/{cloud-upload-CJPYPVl8.js → cloud-upload-k9eqBsHr.js} +1 -1
- package/dist/web/assets/{cssMode-WC4Rg1l-.js → cssMode-CO35ARZp.js} +1 -1
- package/dist/web/assets/{folder-open-sLZJxLQy.js → folder-open-sYgceW_f.js} +1 -1
- package/dist/web/assets/folder-plus-CS0R49m9.js +1 -0
- package/dist/web/assets/{git-commit-horizontal-Cotm7KEC.js → git-commit-horizontal-DrGxH2h4.js} +1 -1
- package/dist/web/assets/{htmlMode-C6oZGeaB.js → htmlMode-REMmzdfq.js} +1 -1
- package/dist/web/assets/index-3iPNbbER.css +1 -0
- package/dist/web/assets/{index-BxWTVKtn.js → index-C8aCGagb.js} +2 -2
- package/dist/web/assets/info-DLdbiUrh.js +1 -0
- package/dist/web/assets/{jsonMode-BET4LQIn.js → jsonMode-KEdMfkIf.js} +1 -1
- package/dist/web/assets/{lspLanguageFeatures-BPxA_-Kg.js → lspLanguageFeatures-5KZwEoxW.js} +1 -1
- package/dist/web/assets/minimize-2-CqcI4zcM.js +1 -0
- package/dist/web/assets/{monaco.contribution-DFzEyaHi.js → monaco.contribution-BJGj65F9.js} +2 -2
- package/dist/web/assets/{monaco.contribution-DXzyQfVi.js → monaco.contribution-Cly9Wt7L.js} +2 -2
- package/dist/web/assets/{monaco.contribution-BH6kkO4b.js → monaco.contribution-DO10L0zW.js} +2 -2
- package/dist/web/assets/{monaco.contribution-7AUuf2NS.js → monaco.contribution-omszXBEj.js} +2 -2
- package/dist/web/assets/monitor-BFVCcbxp.js +1 -0
- package/dist/web/assets/play-C469pVZq.js +1 -0
- package/dist/web/assets/{python-PzBkTjWx.js → python-Dw0YcVy9.js} +1 -1
- package/dist/web/assets/{save-DpezrtH2.js → save-CtSjPydi.js} +1 -1
- package/dist/web/assets/square-BuImvLhT.js +1 -0
- package/dist/web/assets/{toggleHighContrast-Cto-fOXm.js → toggleHighContrast-DjCO9lIP.js} +1 -1
- package/dist/web/assets/{tsMode-BYA4LNc6.js → tsMode-BAOnxKd6.js} +1 -1
- package/dist/web/assets/{upload-C5YFNgtS.js → upload-2JkFZo3h.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules-CnyTsqlf.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-DICuJSJW.js → useSessionTurnCache-BHU2-Jmz.js} +1 -1
- package/dist/web/assets/{wifi-off-nzHj7JXp.js → wifi-off-CpOAH62M.js} +1 -1
- package/dist/web/assets/{workers-Dboaw6f_.js → workers-0QvlA2T5.js} +1 -1
- package/dist/web/assets/{yaml-uuY5JmO8.js → yaml-BK3qxo7D.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +3 -3
- package/dist/chunks/actions-command-DSO6YOEE.js +0 -2
- package/dist/chunks/app-server-runtime-7AXV6JZI.js +0 -2
- package/dist/chunks/apps-TM74FFQB.js +0 -2
- package/dist/chunks/chunk-2JO2KWT3.js +0 -5
- package/dist/chunks/chunk-2SPZYBDN.js +0 -16
- package/dist/chunks/chunk-37DXASQL.js +0 -191
- package/dist/chunks/chunk-4EEH7MEC.js +0 -2
- package/dist/chunks/chunk-4TZHH5FC.js +0 -2409
- package/dist/chunks/chunk-5TNDPNS3.js +0 -2
- package/dist/chunks/chunk-6JAN4RMN.js +0 -42
- package/dist/chunks/chunk-7QEE4PBI.js +0 -8
- package/dist/chunks/chunk-BX4J2VDU.js +0 -2
- package/dist/chunks/chunk-DALJMSJG.js +0 -33
- package/dist/chunks/chunk-EMKZVP7Z.js +0 -2
- package/dist/chunks/chunk-FPUUZQUP.js +0 -6
- package/dist/chunks/chunk-GCOUYYHG.js +0 -5
- package/dist/chunks/chunk-GS2NKNKG.js +0 -4
- package/dist/chunks/chunk-H2VT22JK.js +0 -2
- package/dist/chunks/chunk-HA7EFTPF.js +0 -23
- package/dist/chunks/chunk-IKWDL3RB.js +0 -17
- package/dist/chunks/chunk-NHFGEVVH.js +0 -518
- package/dist/chunks/chunk-NNF6KCHD.js +0 -3
- package/dist/chunks/chunk-PJM2G7SG.js +0 -21
- package/dist/chunks/chunk-PQHTZ5CP.js +0 -2
- package/dist/chunks/chunk-PYABBF53.js +0 -53
- package/dist/chunks/chunk-QRWPEW3Z.js +0 -24
- package/dist/chunks/chunk-QXVIIM4T.js +0 -2
- package/dist/chunks/chunk-SDEDAHV6.js +0 -160
- package/dist/chunks/chunk-TGIB24K4.js +0 -22
- package/dist/chunks/chunk-UE3DMPGM.js +0 -3
- package/dist/chunks/chunk-USKE34VR.js +0 -9
- package/dist/chunks/chunk-USMZT5FZ.js +0 -18
- package/dist/chunks/chunk-WV2APYWG.js +0 -2
- package/dist/chunks/chunk-YIB3J4RC.js +0 -2
- package/dist/chunks/chunk-Z3D4C7BG.js +0 -12
- package/dist/chunks/cli-JVB345H2.js +0 -2
- package/dist/chunks/configuration-command-MATM4XR5.js +0 -2
- package/dist/chunks/connected-evidence-YDPGNHLP.js +0 -2
- package/dist/chunks/core-commands-MTV4EKXY.js +0 -2
- package/dist/chunks/datasets-CP3IT47T.js +0 -2
- package/dist/chunks/desktop-test-IAZC5MAH.js +0 -3
- package/dist/chunks/dist-4HV2W6V4.js +0 -2
- package/dist/chunks/dist-SAABJU5F.js +0 -2
- package/dist/chunks/evaluation-coordination-EPHLZXYM.js +0 -2
- package/dist/chunks/experiment-improvements-6JTOPA74.js +0 -2
- package/dist/chunks/experiments-XHPFGECH.js +0 -2
- package/dist/chunks/extension-GX7DLW2X.js +0 -4
- package/dist/chunks/hosted-experiment-improvement-HAB3UE6A.js +0 -3
- package/dist/chunks/hosted-harness-runtime-YM23QNDK.js +0 -2
- package/dist/chunks/hosted-profile-candidate-EOBGKQAS.js +0 -3
- package/dist/chunks/hosted-profile-compiler-SCVJI2CP.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-control-RJ6XJZCS.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-inspection-OC4XNGL2.js +0 -3
- package/dist/chunks/hosted-profile-evaluation-preparation-ZD4FM3FD.js +0 -3
- package/dist/chunks/human-review-AAVMISBF.js +0 -2
- package/dist/chunks/import-V3HUGRHR.js +0 -4
- package/dist/chunks/learning-FNBEIAY6.js +0 -2
- package/dist/chunks/opchat-QK43DXTY.js +0 -3
- package/dist/chunks/organizations-SRPAWKC7.js +0 -2
- package/dist/chunks/profile-C6CQNVYE.js +0 -3
- package/dist/chunks/project-agent-GZV5HNYI.js +0 -2
- package/dist/chunks/sandbox-command-4TJXQTKT.js +0 -2
- package/dist/chunks/src-NE6R4XC6.js +0 -329
- package/dist/chunks/taskset-LUG3ZU6J.js +0 -2
- package/dist/chunks/training-XHE6FVII.js +0 -2
- package/dist/chunks/workspaces-MFZ3OO6O.js +0 -2
- package/dist/web/assets/App-CO2F717V.css +0 -1
- package/dist/web/assets/App-CuhaCsfb.js +0 -235
- package/dist/web/assets/AppsView-BS1czXUP.js +0 -1
- package/dist/web/assets/HostedModelLearningReview-CHxxf_Lu.js +0 -1
- package/dist/web/assets/LabsRoute-CXJRJMhr.js +0 -99
- package/dist/web/assets/MainChatThread-BwAla81W.js +0 -2
- package/dist/web/assets/MainPane-CakOBCHw.js +0 -19
- package/dist/web/assets/MainPane-DOWsSew1.css +0 -1
- package/dist/web/assets/RightChatPanelStack-VaOOmxwd.js +0 -1
- package/dist/web/assets/RightSidebarHomePanel-CeSFJM5s.js +0 -1
- package/dist/web/assets/ScheduledWorkPage-D1jRQxFs.js +0 -1
- package/dist/web/assets/SettingsView-BnANbPLS.css +0 -1
- package/dist/web/assets/SettingsView-RA9OXgcu.js +0 -5
- package/dist/web/assets/TrainingCreationPanel-CgIBVGha.js +0 -1
- package/dist/web/assets/WorkspaceDiffPanel-pGVezNMw.js +0 -14
- package/dist/web/assets/WorkspaceEnvironmentMenu-Byjngd9V.js +0 -32
- package/dist/web/assets/WorkspaceGitDialogs-Dgmg-6XG.js +0 -1
- package/dist/web/assets/arrow-up-right-H0pvnH2s.js +0 -1
- package/dist/web/assets/chunk-UHVJOMWN-BqXRe639.js +0 -1
- package/dist/web/assets/folder-plus-C84wrpt_.js +0 -1
- package/dist/web/assets/index-dSmk3FLJ.css +0 -1
- package/dist/web/assets/info-Dc81lEfw.js +0 -1
- package/dist/web/assets/minimize-2-Bs7MVN3C.js +0 -1
- package/dist/web/assets/monitor-DXL019Wf.js +0 -1
- package/dist/web/assets/play-CXkxUZeU.js +0 -1
- package/dist/web/assets/square-oy7f5Ce6.js +0 -1
- package/dist/web/assets/useProviderSettings-B_KeQjE5.js +0 -5
- /package/dist/chunks/{chunk-OGPHXXCD.js → chunk-BT5YNE5U.js} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
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-I7AQMAQI.js";import"./chunk-Z4Z5UOZM.js";import"./chunk-FFRFSDBM.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};
|
|
@@ -0,0 +1,2 @@
|
|
|
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,Q,R,S,T,U,V,W,X,Y,Z,_,a,aa,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-VRIEKBBH.js";import"./chunk-ES2ISFJC.js";import"./chunk-FTQLQJQV.js";export{l as AGENT_PROTOCOL_VERSION,m as AGENT_RPC_METHODS,$ as AcpClient,_ as AcpRpcError,Q as AgentCheckpointSchema,P as AgentEffectiveSurfaceSchema,i as AgentEventNameSchema,M as AgentHostStorageClient,t as AgentJsonRpcDispatcher,r as AgentProtocolEnvelopeSchema,u as AgentRpcClient,j as CanonicalAgentEventSchema,aa as ClaudeCliClient,v as ExperimentEnvironmentParamsSchema,I as HOST_STORAGE_CONTRACT_VERSION,y as HarnessReviewStorageParamsSchema,L as HostStorageCapabilitySchema,K as HostStorageRequestSchema,J as HostStorageScopeSchema,A as HostedOutputBeginParamsSchema,B as HostedOutputChunkParamsSchema,C as HostedOutputCompleteParamsSchema,z as HostedOutputIdentitySchema,E as HostedOutputSaveSandboxFileParamsSchema,F as HostedSandboxActionSchema,D as HostedSandboxOutputIdentitySchema,G as HostedSandboxRequestParamsSchema,H as HostedToolAuthorizationParamsSchema,s as InitializeParamsSchema,q as JsonRpcErrorSchema,o as JsonRpcNotificationSchema,n as JsonRpcRequestSchema,p as JsonRpcSuccessSchema,x as RefinerStorageActionSchema,w as TaskInboxStorageParamsSchema,Z as TaskSerialExecutor,Y as TaskSignals,f as agentCompactionDecision,k as canonicalEventHash,e as canonicalHash,d as canonicalJson,S as checkpointHash,O as createAgentRuntimeService,U as createAgentToolCatalog,W as createAgentToolCatalogProjection,R as effectiveSurfaceHash,V as executeAgentTool,X as executeProjectedAgentTool,T as materializeAgentPrompt,a as providerRoundSequence,g as runAgentCompaction,h as runAgentCompactionProgram,N as runAgentJsonlServer,c as runProviderRound,b as runProviderRoundLoop};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d}from"./chunk-DUURYZOI.js";import"./chunk-ES2ISFJC.js";import"./chunk-FTQLQJQV.js";export{a as EnclaveHealthSchema,c as EnclavePromptSchema,b as EnclaveReplySchema,d as UrlModelSchema};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{a as p,b as v}from"./chunk-B7RFL4N2.js";import"./chunk-RAXOSUSW.js";import"./chunk-DARVPBZ4.js";import"./chunk-NPOHW5OU.js";import"./chunk-M4JWQSV7.js";import"./chunk-FV2R5RUN.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{c as r}from"./chunk-3M53YXEI.js";import"./chunk-5MCNZCVQ.js";import"./chunk-BT5YNE5U.js";import{v as d,w as s,x as h,y as w}from"./chunk-Q5LEXXJG.js";import"./chunk-FWIPHEVA.js";import"./chunk-OS3LO5J3.js";import"./chunk-GLUWATL5.js";import"./chunk-QDC4OW3S.js";import"./chunk-ZZWAQBA2.js";import"./chunk-YR5ID2SS.js";import"./chunk-YBT2NB32.js";import"./chunk-74ZXXBGN.js";import"./chunk-APB2STJK.js";import"./chunk-I7AQMAQI.js";import"./chunk-Z4Z5UOZM.js";import"./chunk-Y4OWBBDD.js";import"./chunk-6ZFPQYHG.js";import"./chunk-JFXWI3EN.js";import"./chunk-FFRFSDBM.js";import"./chunk-VYLGI3IH.js";import"./chunk-ACYFMLWG.js";import"./chunk-TVQAPBLZ.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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{a as s,b as l}from"./chunk-B7RFL4N2.js";import"./chunk-RAXOSUSW.js";import"./chunk-DARVPBZ4.js";import"./chunk-NPOHW5OU.js";import"./chunk-M4JWQSV7.js";import"./chunk-FV2R5RUN.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{c as e}from"./chunk-3M53YXEI.js";import"./chunk-5MCNZCVQ.js";import"./chunk-BT5YNE5U.js";import{t as m,u as c}from"./chunk-Q5LEXXJG.js";import"./chunk-FWIPHEVA.js";import"./chunk-OS3LO5J3.js";import"./chunk-GLUWATL5.js";import"./chunk-QDC4OW3S.js";import"./chunk-ZZWAQBA2.js";import"./chunk-YR5ID2SS.js";import"./chunk-YBT2NB32.js";import"./chunk-74ZXXBGN.js";import"./chunk-APB2STJK.js";import"./chunk-I7AQMAQI.js";import"./chunk-Z4Z5UOZM.js";import"./chunk-Y4OWBBDD.js";import"./chunk-6ZFPQYHG.js";import"./chunk-JFXWI3EN.js";import"./chunk-FFRFSDBM.js";import"./chunk-VYLGI3IH.js";import"./chunk-ACYFMLWG.js";import"./chunk-TVQAPBLZ.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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import"./chunk-RAXOSUSW.js";import{c as X}from"./chunk-DARVPBZ4.js";import{a as ie,c as ae}from"./chunk-NPOHW5OU.js";import"./chunk-M4JWQSV7.js";import"./chunk-FV2R5RUN.js";import{c as Z,f as ee}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{c as o}from"./chunk-3M53YXEI.js";import"./chunk-W45RKGM6.js";import"./chunk-3VUATFZD.js";import"./chunk-4EPSHPZL.js";import"./chunk-DZUAT3TP.js";import"./chunk-XDQMGUWL.js";import"./chunk-FTEOCCPB.js";import{Aa as te,Ba as ne,Na as U,Oa as I,Pa as re,Qa as k,Va as j,ia as C}from"./chunk-25MBPJVY.js";import"./chunk-WN3V6KDN.js";import"./chunk-523TE4BI.js";import"./chunk-ZCHXGRRU.js";import"./chunk-5MCNZCVQ.js";import"./chunk-BT5YNE5U.js";import{b as K,c as M,d as P,q as W,r as Y}from"./chunk-Q5LEXXJG.js";import"./chunk-FWIPHEVA.js";import{d as V}from"./chunk-OS3LO5J3.js";import{b as Q}from"./chunk-GLUWATL5.js";import"./chunk-QDC4OW3S.js";import"./chunk-ZZWAQBA2.js";import"./chunk-YR5ID2SS.js";import"./chunk-YBT2NB32.js";import"./chunk-74ZXXBGN.js";import"./chunk-APB2STJK.js";import"./chunk-I7AQMAQI.js";import"./chunk-Z4Z5UOZM.js";import"./chunk-Y4OWBBDD.js";import"./chunk-6ZFPQYHG.js";import"./chunk-JFXWI3EN.js";import"./chunk-FFRFSDBM.js";import"./chunk-VYLGI3IH.js";import{Cb as B,Db as J,_a as F,jb as T,ub as D,zb as G}from"./chunk-ACYFMLWG.js";import"./chunk-TVQAPBLZ.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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{Ab as x,Bb as y,Cb as z,Db as A,db as a,eb as b,fb as c,gb as d,hb as e,ib as f,jb as g,kb as h,lb as i,mb as j,nb as k,ob as l,pb as m,qb as n,rb as o,sb as p,tb as q,ub as r,vb as s,wb as t,xb as u,yb as v,zb as w}from"./chunk-ACYFMLWG.js";import"./chunk-TVQAPBLZ.js";import"./chunk-KGNCKIFP.js";import"./chunk-ES2ISFJC.js";import"./chunk-FTQLQJQV.js";export{n as ExperimentCaseIdentitySchema,u as ExperimentCaseResultSchema,m as ExperimentEvaluatorSchema,s as ExperimentFeedbackSchema,q as ExperimentManifestContentSchema,r as ExperimentManifestSchema,v as ExperimentResultContentSchema,w as ExperimentResultSchema,l as ExperimentTargetSchema,t as ExperimentUsageSchema,h as NativeHarnessExperimentAttemptContentSchema,i as NativeHarnessExperimentAttemptSchema,g as NativeHarnessExperimentEvidenceSchema,b as STANDALONE_EXPERIMENT_MAX_POLICY_CALLS,d as STANDALONE_EXPERIMENT_READ_TOOLS,a as StandaloneHarnessExperimentSourceSchema,A as compareExperiments,x as createExperimentManifest,y as createExperimentResult,j as createNativeHarnessExperimentAttempt,o as experimentCaseKey,f as harnessExperimentReadToolDeclarations,c as harnessExperimentSourceRequiresProfile,p as humanProjectionViewId,e as standaloneHarnessExperimentTools,z as verifyExperimentEvidence,k as verifyNativeHarnessExperimentAttempt};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{f as z}from"./chunk-3M53YXEI.js";import{a as L,x as se}from"./chunk-LQQNBVEB.js";import"./chunk-EKM2D7JU.js";import"./chunk-BT5YNE5U.js";import"./chunk-OS3LO5J3.js";import{f as F}from"./chunk-I7AQMAQI.js";import"./chunk-Z4Z5UOZM.js";import"./chunk-6FA3GG5B.js";import"./chunk-FFRFSDBM.js";import"./chunk-KGNCKIFP.js";import{b as c}from"./chunk-ES2ISFJC.js";import{f as ne,h as q,p as D,r as ie}from"./chunk-H7IWJN7L.js";import{a as r}from"./chunk-FTQLQJQV.js";var u=class extends Error{static{r(this,"GithubExtensionError")}code;status;constructor(t,i){super(t),this.name="GithubExtensionError",this.code=i.code,this.status=i.status??400}};import{createHash as de}from"node:crypto";import B from"node:path";var oe="HEAD",re=64,ae=512,ue=20*1024*1024,V=5*1024*1024,pe=8,Ge=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,le=/^[A-Za-z0-9_.-]+$/,ce=new Set(["agents","assets","references","scripts"]);function he(e={}){let t=e.fetch??fetch,i=e.githubToken?.trim()||process.env.GITHUB_TOKEN?.trim()||process.env.GH_TOKEN?.trim()||null;return{async resolve(n){let s=await Ie(n,t,i);return{preview:await Ae(s,t,i),files:ge(s)}},async download(n,s){await Me({resolution:n,fetchImpl:t,githubToken:i,writeFile:s})}}}r(he,"createGithubSourceClient");function k(e){let t=e.trim(),i="",n="";if(/^(?:https?:\/\/)?github\.com\//i.test(t)){let l=new URL(t.startsWith("http")?t:`https://${t}`);if(l.hostname.toLowerCase()!=="github.com")throw M(e);let a=l.pathname.replace(/^\/+|\/+$/g,"").split("/");if(a.length!==2)throw M(e);[i="",n=""]=a}else{let a=t.replace(/^github:/i,"").replace(/^\/+|\/+$/g,"").split("/");if(a.length!==2)throw M(e);[i="",n=""]=a}if(n=n.replace(/\.git$/i,""),!le.test(i)||!le.test(n))throw M(e);let s=i.toLowerCase(),o=n.toLowerCase();return{id:`github:${s}/${o}`,owner:s,repo:o,repositoryUrl:`https://github.com/${s}/${o}`}}r(k,"parseGithubExtensionSource");async function Ie(e,t,i){let n=k(e.source),s=e.ref?.trim()||oe,o=await K(t,i,`/repos/${n.owner}/${n.repo}`),l=s===oe?o.default_branch?.trim()||"main":s,a=await K(t,i,`/repos/${n.owner}/${n.repo}/commits/${encodeURIComponent(l)}`),w=a.sha?.trim(),v=a.commit?.tree?.sha?.trim();if(!w||!v)throw new u("GitHub returned an incomplete commit response.",{code:"github_invalid_commit",status:502});let P=await K(t,i,`/repos/${n.owner}/${n.repo}/git/trees/${v}?recursive=1`);if(P.truncated)throw new u("The GitHub repository tree is too large to install safely.",{code:"github_tree_truncated"});let S=(P.tree??[]).filter(He),x=Ce(S);if(x.length===0)throw new u("No skills found. Add SKILL.md at the repository root or use a standard agent skills directory.",{code:"extension_no_skills"});if(x.length>re)throw new u(`Extension contains more than ${re} skills.`,{code:"extension_too_many_skills"});je(x);let A=S.find(g=>g.type==="blob"&&/^readme(?:\.[^/]+)?$/i.test(g.path))??null;return{identity:n,requestedRef:s,resolvedCommit:w,tree:S,skillPackages:x,readme:A}}r(Ie,"resolveSource");async function Ae(e,t,i){let n=await we(e.skillPackages,pe,async a=>{let w=await Ne(e,a.entry,t,i);return Te(a,w)}),s=qe(n.map(a=>a.name));for(let a of n)s.has(a.name)&&(a.validationStatus="error",a.validationMessages=[...a.validationMessages,`Duplicate skill name: ${a.name}`]);let o=n.flatMap(a=>a.validationMessages.map(w=>`${a.relativePath}: ${w}`)),l=ge(e);return{...e.identity,source:"github",requestedRef:e.requestedRef,resolvedCommit:e.resolvedCommit,sourcePath:null,readmePath:e.readme?.path??null,packageHash:Ue(l),skills:n.sort((a,w)=>a.name.localeCompare(w.name)),validationStatus:o.length===0?"valid":"error",validationMessages:o}}r(Ae,"buildPreview");function Te(e,t){let i=L(t),n=e.root==="."?null:B.posix.basename(e.root),s=i.name??n??"invalid-skill",o=[...i.messages];Ge.test(s)||o.push("Skill name must be lowercase kebab-case."),n&&s!==n&&o.push(`Skill name must match its directory name (${n}).`);let l=e.files.filter(a=>a.path!==e.entry.path).map(a=>ze(e.root,a.path)).sort();return{name:s,description:i.description??"",relativePath:e.root==="."?"SKILL.md":`${e.root}/SKILL.md`,sourcePath:"",charCount:t.length,sourceHash:de("sha256").update(t).digest("hex"),resourceFiles:l,validationStatus:o.length===0?"valid":"error",validationMessages:[...new Set(o)]}}r(Te,"previewSkill");function Ce(e){let t=[],i=e.find(a=>a.type==="blob"&&a.path==="SKILL.md");i&&t.push({root:".",entry:i});let n=e.filter(a=>a.type==="blob"&&a.path.endsWith("/SKILL.md")),s=n.filter(a=>Le(a.path)),o=s.length>0?s:n,l=new Set(o.map(a=>B.posix.dirname(a.path)));for(let a of o){let w=B.posix.dirname(a.path);[...l].some(v=>v!==w&&w.startsWith(`${v}/`))||t.push({root:w,entry:a})}return t.map(({root:a,entry:w})=>{let v=e.filter(x=>{if(x.type!=="blob")return!1;if(a!==".")return x.path.startsWith(`${a}/`);if(x.path==="SKILL.md")return!0;let A=x.path.split("/",1)[0]??"";return ce.has(A)}),P=e.find(x=>x.type!=="blob"&&x.type!=="tree"&&(a==="."?x.path==="SKILL.md"||ce.has(x.path.split("/",1)[0]??""):x.path.startsWith(`${a}/`))),S=v.find(x=>x.mode==="120000");if(P||S)throw new u(`Skill package ${a} contains a symlink or submodule.`,{code:"extension_unsafe_entry"});return{root:a,entry:w,files:v}})}r(Ce,"discoverSkillPackages");function Le(e){let t=e.split("/");if(t.at(-1)!=="SKILL.md")return!1;let i=t.slice(0,-1);if(i.length<2)return!1;let n=i.lastIndexOf("skills");if(n<0||n>2)return!1;let s=i.slice(0,n),o=i.slice(n+1);if(o.length<1||o.length>2)return!1;if(n===0)return!0;let l=s[0]??"";return l.startsWith(".")||l==="agent"||l==="data"}r(Le,"isStandardAgentSkillsPath");function ge(e){let t=new Map;e.readme&&t.set(e.readme.path,e.readme);for(let i of e.skillPackages)for(let n of i.files)t.set(n.path,n);return[...t.values()].sort((i,n)=>i.path.localeCompare(n.path))}r(ge,"filesToDownload");async function Me(e){let t=0;await we(e.resolution.files,pe,async i=>{let n=await fe({owner:e.resolution.preview.owner,repo:e.resolution.preview.repo,commit:e.resolution.preview.resolvedCommit,file:i,fetchImpl:e.fetchImpl,githubToken:e.githubToken});if(t+=n.byteLength,t>ue)throw new u("Extension download exceeds the maximum allowed size.",{code:"extension_too_large"});await e.writeFile(i.path,n,i.mode==="100755")})}r(Me,"downloadFiles");async function Ne(e,t,i,n){let s=await fe({owner:e.identity.owner,repo:e.identity.repo,commit:e.resolvedCommit,file:t,fetchImpl:i,githubToken:n});return new TextDecoder("utf-8",{fatal:!0}).decode(s)}r(Ne,"downloadText");async function fe(e){let t=e.file.path.split("/").map(encodeURIComponent).join("/"),i=`https://raw.githubusercontent.com/${e.owner}/${e.repo}/${e.commit}/${t}`,n=await e.fetchImpl(i,{headers:me(e.githubToken,"application/vnd.github.raw"),redirect:"follow"});if(!n.ok)throw new u(`GitHub file download failed (${n.status}): ${e.file.path}`,{code:"github_download_failed",status:n.status});let s=Number(n.headers.get("content-length"));if(Number.isFinite(s)&&s>V)throw new u(`Extension file is too large: ${e.file.path}`,{code:"extension_file_too_large"});let o=new Uint8Array(await n.arrayBuffer());if(o.byteLength>V)throw new u(`Extension file is too large: ${e.file.path}`,{code:"extension_file_too_large"});return o}r(fe,"downloadBytes");async function K(e,t,i){let n=await e(`https://api.github.com${i}`,{headers:me(t,"application/vnd.github+json")});if(!n.ok){let s=await n.json().catch(()=>null),o=typeof s?.message=="string"?`: ${s.message}`:"";throw new u(`GitHub request failed (${n.status})${o}`,{code:n.status===404?"github_repository_not_found":"github_request_failed",status:n.status})}return await n.json()}r(K,"githubJson");function me(e,t){let i=new Headers({Accept:t,"User-Agent":"openpond-extension-installer","X-GitHub-Api-Version":"2022-11-28"});return e&&i.set("Authorization",`Bearer ${e}`),i}r(me,"githubHeaders");function je(e){let t=new Map;for(let n of e)for(let s of n.files)t.set(s.path,s);if(t.size>ae)throw new u(`Extension contains more than ${ae} skill files.`,{code:"extension_too_many_files"});let i=0;for(let n of t.values()){if((n.size??0)>V)throw new u(`Extension file is too large: ${n.path}`,{code:"extension_file_too_large"});i+=n.size??0}if(i>ue)throw new u("Extension exceeds the maximum allowed size.",{code:"extension_too_large"})}r(je,"validateDownloadLimits");function He(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.path=="string"&&!t.path.startsWith("/")&&!t.path.split("/").includes("..")&&typeof t.mode=="string"&&(t.type==="blob"||t.type==="tree"||t.type==="commit")&&typeof t.sha=="string"}r(He,"validTreeEntry");function Ue(e){let t=de("sha256");for(let i of e)t.update(`${i.path}\0${i.sha}\0${i.size??""}
|
|
3
|
+
`);return t.digest("hex")}r(Ue,"hashTree");function ze(e,t){return e==="."?t:t.slice(e.length+1)}r(ze,"relativeSkillPath");function qe(e){let t=new Set,i=new Set;for(let n of e)t.has(n)&&i.add(n),t.add(n);return i}r(qe,"duplicateValues");async function we(e,t,i){let n=new Array(e.length),s=0;async function o(){for(;s<e.length;){let l=s;s+=1,n[l]=await i(e[l])}}return r(o,"worker"),await Promise.all(Array.from({length:Math.min(t,e.length)},o)),n}r(we,"mapConcurrent");function M(e){return new u(`Invalid GitHub extension source: ${e}. Use owner/repo or https://github.com/owner/repo.`,{code:"github_invalid_source"})}r(M,"invalidSource");import{createHash as Fe,randomUUID as Pe}from"node:crypto";import{existsSync as _}from"node:fs";import{mkdir as W,readFile as De,rename as G,rm as I,stat as Ke,writeFile as ye}from"node:fs/promises";import m from"node:path";var j=1,Be=15e3;function ke(e={}){let t=m.resolve(e.home??e.rootPath??ne()),i=m.resolve(e.rootPath??m.join(t,"library","extensions")),n=q(t).database,s=he({fetch:e.fetch,githubToken:e.githubToken}),o=e.now??(()=>new Date);async function l(){try{let g=await O(t),d=await Promise.all(g.extensions.map(f=>X(i,f)));return Je(d,await R(e.reservedSkillNames)),{rootPath:i,registryPath:n,extensions:d.sort(Q),error:null}}catch(g){return{rootPath:i,registryPath:n,extensions:[],error:g instanceof Error?g.message:String(g)}}}r(l,"list");async function a(g){let d=await s.resolve(g),f=await O(t),p=f.extensions.find(h=>h.id===d.preview.id)??null;return T(d.preview,f.extensions.filter(h=>h.id!==p?.id),await R(e.reservedSkillNames)),d.preview}r(a,"preview");async function w(g){let d=k(g.source);return Y(i,d.id,async()=>{let f=await O(t);if(f.extensions.some(y=>y.id===d.id))throw new u(`${d.owner}/${d.repo} is already installed.`,{code:"extension_already_installed",status:409});let p=await s.resolve(g);Ee(p.preview),T(p.preview,f.extensions,await R(e.reservedSkillNames));let h=o().toISOString(),b=await xe({rootPath:i,resolution:p,installedAt:h,updatedAt:h,github:s});try{let y=await R(e.reservedSkillNames);return await J(t,o,E=>({...E,extensions:We(E,b,y)})),await be(i,b.id),b}catch(y){throw await ve(i,b.id),y}})}r(w,"add");async function v(g){let d=k(g.source);return Y(i,d.id,async()=>{let f=await O(t),p=N(f,d.id),h=await s.resolve({source:p.repositoryUrl,ref:g.ref?.trim()||p.requestedRef});if(Ee(h.preview),T(h.preview,f.extensions.filter(y=>y.id!==p.id),await R(e.reservedSkillNames)),p.resolvedCommit===h.preview.resolvedCommit&&p.packageHash===h.preview.packageHash&&p.requestedRef===h.preview.requestedRef)return X(i,p);let b=await xe({rootPath:i,resolution:h,installedAt:p.installedAt,updatedAt:o().toISOString(),github:s});try{let y=await R(e.reservedSkillNames);return await J(t,o,E=>({...E,extensions:Xe(E,b,y)})),await be(i,b.id),b}catch(y){throw await ve(i,b.id),y}})}r(v,"update");async function P(){let g=await l();if(g.error)throw new u(g.error,{code:"extension_registry_error"});let d={updated:[],unchanged:[],failed:[]};for(let f of g.extensions)try{let p=await v({source:f.repositoryUrl,ref:f.requestedRef});p.resolvedCommit===f.resolvedCommit&&p.packageHash===f.packageHash?d.unchanged.push(p):d.updated.push(p)}catch(p){d.failed.push({id:f.id,error:p instanceof Error?p.message:String(p)})}return d}r(P,"updateAll");async function S(g){let d=k(g),f=await O(t);return X(i,N(f,d.id))}r(S,"inspect");async function x(g){let d=k(g);return Y(i,d.id,async()=>{let f=await O(t),p=N(f,d.id),h=C(i,d.owner,d.repo),b=`${h}.${Pe()}.remove`;_(h)&&await G(h,b);try{return await J(t,o,y=>({...y,extensions:y.extensions.filter(E=>E.id!==p.id)})),await I(b,{recursive:!0,force:!0}),p}catch(y){throw _(b)&&!_(h)&&await G(b,h),y}})}r(x,"remove");async function A(g){let d=g.trim();if(!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(d))throw new u("Extension skill name must be lowercase kebab-case.",{code:"extension_skill_invalid_name"});let f=await l();if(f.error)throw new u(f.error,{code:"extension_registry_error"});let p=f.extensions.flatMap(te=>te.skills.filter(U=>U.name===d).map(U=>({extension:te,skill:U})));if(p.length===0)throw new u(`Extension skill not found: ${d}`,{code:"extension_skill_not_found",status:404});if(p.length>1)throw new u(`Extension skill name is ambiguous: ${d}`,{code:"extension_skill_conflict",status:409});let h=p[0];if(h.extension.validationStatus!=="valid"||h.skill.validationStatus!=="valid")throw new u(`Extension skill ${d} is not valid.`,{code:"extension_skill_invalid"});let b=Oe(h.extension.sourcePath,h.skill.relativePath),y=await De(b,"utf8"),E=Fe("sha256").update(y).digest("hex");if(E!==h.skill.sourceHash)throw new u(`Extension skill ${d} changed on disk. Update or reinstall its extension before using it.`,{code:"extension_skill_modified"});let $=L(y);if($.messages.length>0||$.name!==d||!$.description)throw new u(`Extension skill ${d} is not valid. ${$.messages.join(" ")}`.trim(),{code:"extension_skill_invalid"});return{name:d,description:$.description,body:$.body,path:h.skill.relativePath,sourcePath:h.extension.sourcePath,sourceHash:E,charCount:y.length,packagePath:m.dirname(b),resourceFiles:h.skill.resourceFiles}}return r(A,"readSkill"),{rootPath:i,registryPath:n,list:l,preview:a,add:w,update:v,updateAll:P,inspect:S,remove:x,readSkill:A}}r(ke,"createGithubExtensionManager");async function xe(e){let t=e.resolution.preview,i=C(e.rootPath,t.owner,t.repo),n=`${i}.${Pe()}.install`,s=Z(e.rootPath,t.id),o=m.join(n,"current");await I(n,{recursive:!0,force:!0}),await I(s,{recursive:!0,force:!0}),await W(o,{recursive:!0,mode:448});try{await e.github.download(e.resolution,async(a,w,v)=>{let P=Oe(o,a);await W(m.dirname(P),{recursive:!0,mode:448}),await ye(P,w,{mode:v?448:384})});let l=Ve(t,i,e.installedAt,e.updatedAt);return await ye(m.join(n,"extension.json"),`${JSON.stringify(l,null,2)}
|
|
4
|
+
`,{mode:384}),await W(m.dirname(i),{recursive:!0,mode:448}),_(i)&&await G(i,s),await G(n,i),l}catch(l){throw await I(n,{recursive:!0,force:!0}),_(s)&&!_(i)&&await G(s,i),l}}r(xe,"materializeExtension");function Ve(e,t,i,n){let s=m.join(t,"current");return{...e,sourcePath:s,readmePath:e.readmePath?m.join(s,e.readmePath):null,installedAt:i,updatedAt:n,skills:e.skills.map(o=>({...o,sourcePath:m.join(s,o.relativePath)}))}}r(Ve,"installedExtension");async function be(e,t){await I(Z(e,t),{recursive:!0,force:!0})}r(be,"finalizeMaterialization");async function ve(e,t){let i=k(t.replace(/^github:/,"")),n=C(e,i.owner,i.repo),s=Z(e,t);await I(n,{recursive:!0,force:!0}),_(s)&&await G(s,n)}r(ve,"rollbackMaterialization");async function X(e,t){let i=C(e,t.owner,t.repo),n=m.join(i,"current"),s=(await Ke(m.join(i,"extension.json")).catch(()=>null))?.isFile()??!1,o=t.validationMessages.filter(l=>l!=="Installed files are missing.");return s||o.push("Installed files are missing."),{...t,sourcePath:n,readmePath:t.readmePath?m.join(n,m.basename(t.readmePath)):null,skills:t.skills.map(l=>({...l,sourcePath:m.join(n,l.relativePath)})),validationStatus:o.length===0?"valid":"error",validationMessages:o}}r(X,"hydrateExtension");function Ee(e){if(e.validationStatus!=="valid")throw new u(`Extension contains invalid skills: ${e.validationMessages.join(" ")}`,{code:"extension_invalid"})}r(Ee,"assertInstallable");function T(e,t,i){let n=new Map;for(let o of i)n.set(o,"a shipped OpenPond skill");for(let o of t)for(let l of o.skills)n.set(l.name,o.id);let s=e.skills.map(o=>({name:o.name,owner:n.get(o.name)})).filter(o=>!!o.owner);if(s.length!==0)throw new u(`Skill name conflict: ${s.map(o=>`${o.name} (${o.owner})`).join(", ")}.`,{code:"extension_skill_conflict",status:409})}r(T,"assertSkillNamesAvailable");function We(e,t,i){if(e.extensions.some(n=>n.id===t.id))throw new u(`${t.owner}/${t.repo} is already installed.`,{code:"extension_already_installed",status:409});return T(t,e.extensions,i),[...e.extensions,t].sort(Q)}r(We,"appendInstalledExtension");function Xe(e,t,i){return N(e,t.id),T(t,e.extensions.filter(n=>n.id!==t.id),i),e.extensions.map(n=>n.id===t.id?t:n).sort(Q)}r(Xe,"replaceInstalledExtension");function Je(e,t){let i=new Map;for(let n of t)i.set(n,"built-in");for(let n of e)for(let s of n.skills){let o=i.get(s.name);if(!o){i.set(s.name,n.id);continue}let l=`Skill name conflicts with ${o}: ${s.name}`;s.validationStatus="error",s.validationMessages=[...new Set([...s.validationMessages,l])],n.validationStatus="error",n.validationMessages=[...new Set([...n.validationMessages,l])]}}r(Je,"markInstalledSkillConflicts");async function R(e){let t=typeof e=="function"?await e():e??[];return[...new Set(t.map(i=>i.trim()).filter(Boolean))]}r(R,"reservedSkillNames");function N(e,t){let i=e.extensions.find(n=>n.id===t);if(i)return i;throw new u(`${t.replace(/^github:/,"")} is not installed.`,{code:"extension_not_installed",status:404})}r(N,"requireInstalled");async function O(e){let t=D(e,"extension_installations","registry")?.value;if(!t)return Ze();if(t.schemaVersion!==j||!Array.isArray(t.extensions)||!t.extensions.every(Se))throw new Error("Extension registry has an unsupported format.");return Ye(t)}r(O,"readRegistry");async function J(e,t,i){await F(m.join(q(e).runtime,"extension-registry"),async()=>{let n=D(e,"extension_installations","registry"),s=i(await O(e));ie(e,"extension_installations","registry",{...s,schemaVersion:j,updatedAt:t().toISOString()},n?.revision??null)})}r(J,"writeRegistry");function Ye(e){return{schemaVersion:j,updatedAt:typeof e?.updatedAt=="string"?e.updatedAt:null,extensions:Array.isArray(e?.extensions)?e.extensions.filter(Se):[]}}r(Ye,"normalizeRegistry");function Ze(){return{schemaVersion:j,updatedAt:null,extensions:[]}}r(Ze,"emptyRegistry");function Se(e){if(!e||typeof e!="object")return!1;let t=e;return t.source==="github"&&typeof t.id=="string"&&typeof t.owner=="string"&&typeof t.repo=="string"&&typeof t.repositoryUrl=="string"&&typeof t.requestedRef=="string"&&typeof t.resolvedCommit=="string"&&Array.isArray(t.skills)}r(Se,"isStoredExtension");function Oe(e,t){if(m.isAbsolute(t)||t.split(/[\\/]/).includes(".."))throw new u(`Unsafe extension path: ${t}`,{code:"extension_unsafe_path"});let i=m.resolve(e,...t.split("/")),n=`${m.resolve(e)}${m.sep}`;if(!i.startsWith(n))throw new u(`Unsafe extension path: ${t}`,{code:"extension_unsafe_path"});return i}r(Oe,"safeDestination");function C(e,t,i){return m.join(e,"github",t,i)}r(C,"extensionDirectory");function Z(e,t){let i=k(t.replace(/^github:/,""));return`${C(e,i.owner,i.repo)}.previous`}r(Z,"backupDirectory");async function Y(e,t,i){let n=t.replace(/[^a-z0-9.-]+/gi,"-");return F(m.join(e,".locks",n),i,Be)}r(Y,"withExtensionLock");function Q(e,t){return e.id.localeCompare(t.id)}r(Q,"extensionSort");var _e=["openpond-cli","openpond-desktop-harness","openpond-taskset-authoring","openpond-skill-authoring","openpond-agent-authoring","openpond-refiner-authoring"];var Qe=c.object({name:c.string(),description:c.string(),relativePath:c.string(),sourcePath:c.string(),charCount:c.number().int().nonnegative(),sourceHash:c.string(),resourceFiles:c.array(c.string()),validationStatus:c.enum(["valid","error"]),validationMessages:c.array(c.string())}),$e=c.object({id:c.string(),source:c.literal("github"),owner:c.string(),repo:c.string(),repositoryUrl:c.string().url(),requestedRef:c.string(),resolvedCommit:c.string(),sourcePath:c.string(),readmePath:c.string().nullable(),installedAt:c.string(),updatedAt:c.string(),packageHash:c.string(),skills:c.array(Qe),validationStatus:c.enum(["valid","error"]),validationMessages:c.array(c.string())}),vt=$e.omit({installedAt:!0,updatedAt:!0,sourcePath:!0}).extend({sourcePath:c.null()}),Et=c.object({rootPath:c.string(),registryPath:c.string(),extensions:c.array($e),error:c.string().nullable()}),Pt=c.object({source:c.string().trim().min(1),ref:c.string().trim().min(1).optional()});async function $t(e,t,i=ke({reservedSkillNames:r(async()=>{let n=await se();return[..._e,...n.skills.map(s=>s.name)]},"reservedSkillNames")})){let n=t[0]?.toLowerCase()||"list",s=z(e.json);if(n==="list"){let o=await i.list();if(o.error)throw new Error(o.error);et(o.extensions,s);return}if(n==="add"||n==="preview"){let l={source:H(t[1],n),ref:Re(e.ref)},a=n==="preview"?await i.preview(l):await i.add(l);ee(a,s,n==="preview"?"Preview":"Installed");return}if(n==="inspect"){ee(await i.inspect(H(t[1],n)),s,"Installed");return}if(n==="update"){if(z(e.all)){let a=await i.updateAll();if(s)console.log(JSON.stringify(a,null,2));else{console.log(`Updated ${a.updated.length}; unchanged ${a.unchanged.length}; failed ${a.failed.length}.`);for(let w of a.failed)console.log(`- ${w.id}: ${w.error}`)}a.failed.length>0&&(process.exitCode=1);return}let o=H(t[1],n),l=await i.update({source:o,ref:Re(e.ref)});ee(l,s,"Updated");return}if(n==="remove"){let o=await i.remove(H(t[1],n));console.log(s?JSON.stringify({removed:o},null,2):`Removed ${o.owner}/${o.repo} and ${o.skills.length} skill(s).`);return}throw new Error("usage: openpond extension <add|preview|list|inspect|update|remove> [owner/repo] [--ref <ref>] [--all] [--json]")}r($t,"runOpenPondExtensionCommand");function ee(e,t,i){if(t){console.log(JSON.stringify(e,null,2));return}console.log(`${i} ${e.owner}/${e.repo}@${e.resolvedCommit.slice(0,12)} (${e.requestedRef}).`);for(let n of e.skills){let s=n.resourceFiles.length>0?`, ${n.resourceFiles.length} resource(s)`:"";console.log(`- ${n.name}${s}: ${n.description}`)}}r(ee,"printExtension");function et(e,t){if(t){console.log(JSON.stringify({extensions:e},null,2));return}if(e.length===0){console.log("No third-party extensions installed.");return}console.log(`Third-party extensions (${e.length}):`);for(let i of e)console.log(`- ${i.owner}/${i.repo}@${i.resolvedCommit.slice(0,12)} \xB7 ${i.skills.length} skill(s) \xB7 ${i.validationStatus}`)}r(et,"printExtensionList");function H(e,t){let i=e?.trim();if(i)return i;throw new Error(`usage: openpond extension ${t} <owner/repo>`)}r(H,"requiredSource");function Re(e){return typeof e=="string"&&e.trim()?e.trim():void 0}r(Re,"optionText");export{$t as runOpenPondExtensionCommand};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{d as r,f as i,k as p}from"./chunk-
|
|
2
|
+
import{d as r,f as i,k as p}from"./chunk-FV2R5RUN.js";import"./chunk-3M53YXEI.js";import{a as t}from"./chunk-FTQLQJQV.js";function d(){console.log(m())}t(d,"printHelp");function m(){let n=["OpenPond CLI","","Usage:"," openpond [--no-open] [--hostname HOST] [--port PORT]"," openpond <command> [options] [-- passthrough...]"," openpond --version","","Commands:"];for(let o of i()){let s=o.aliases?.length?` (aliases: ${o.aliases.join(", ")})`:"";n.push(` ${o.usage}${s}`);for(let e of o.usages??[])n.push(` ${e}`)}n.push("","Global options:");for(let[o,s]of Object.entries(r).sort(([e],[a])=>e.localeCompare(a))){let e=o.replace(/[A-Z]/g,a=>`-${a.toLowerCase()}`);n.push(s==="boolean"?` --${e}`:` --${e} <${s}>`)}return n.push("","Run `openpond <command> --help` for the selected command schema.","Arguments after `--` are passed through without option parsing."),n.join(`
|
|
3
3
|
`)}t(m,"formatCliHelp");function l(){return["# OpenPond CLI command reference","","<!-- Generated by `pnpm --dir apps/cli docs:commands`; do not edit by hand. -->","","Parsing, aliases, command help, and this reference use the same authoritative registry.","",...i().map(o=>`## ${o.name}
|
|
4
4
|
|
|
5
5
|
\`\`\`text
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{b as a}from"./chunk-UHFZHBGW.js";import"./chunk-PF5R6CMP.js";import"./chunk-FEAKTSRS.js";import"./chunk-QOTVNQDI.js";import"./chunk-OQPJ7FJF.js";import"./chunk-WJ43MJ3F.js";import"./chunk-Q4TBTRIG.js";import"./chunk-T5AACNJI.js";import"./chunk-QOGJAQDO.js";import"./chunk-EYPCBBMS.js";import"./chunk-DIO5CB6U.js";import"./chunk-7ED24PP6.js";import"./chunk-N4FFQPLR.js";import"./chunk-AY64VY4E.js";import"./chunk-GJ2ZJFDD.js";import"./chunk-3QIB5FXI.js";import"./chunk-6MI4KKWF.js";import"./chunk-DDMZSZFL.js";import"./chunk-W45RKGM6.js";import"./chunk-3VUATFZD.js";import"./chunk-4EPSHPZL.js";import"./chunk-MQULU465.js";import"./chunk-PRGBLQVH.js";import"./chunk-7E6T7GP5.js";import"./chunk-DZUAT3TP.js";import"./chunk-XDQMGUWL.js";import"./chunk-FTEOCCPB.js";import"./chunk-25MBPJVY.js";import"./chunk-WN3V6KDN.js";import"./chunk-523TE4BI.js";import"./chunk-ZCHXGRRU.js";import"./chunk-YBT2NB32.js";import"./chunk-74ZXXBGN.js";import"./chunk-APB2STJK.js";import"./chunk-Z4Z5UOZM.js";import"./chunk-6FA3GG5B.js";import"./chunk-Y4OWBBDD.js";import"./chunk-6ZFPQYHG.js";import"./chunk-JFXWI3EN.js";import"./chunk-FFRFSDBM.js";import"./chunk-VYLGI3IH.js";import"./chunk-ACYFMLWG.js";import"./chunk-TVQAPBLZ.js";import"./chunk-KGNCKIFP.js";import"./chunk-ES2ISFJC.js";import"./chunk-FTQLQJQV.js";export{a as createHostProfileEvaluationTools};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{a,b}from"./chunk-DMVD2RFZ.js";import"./chunk-OSIO7PLX.js";import"./chunk-QNG27G3T.js";import"./chunk-EIRYMSEG.js";import"./chunk-7ED24PP6.js";import"./chunk-RNIAFXMB.js";import"./chunk-2IHO4GDJ.js";import"./chunk-KCJVFLBB.js";import"./chunk-N4FFQPLR.js";import"./chunk-AY64VY4E.js";import"./chunk-GJ2ZJFDD.js";import"./chunk-6QSSIT62.js";import"./chunk-W45RKGM6.js";import"./chunk-3VUATFZD.js";import"./chunk-4EPSHPZL.js";import"./chunk-H6IW2R22.js";import"./chunk-L3KS6MOV.js";import"./chunk-7E6T7GP5.js";import"./chunk-DZUAT3TP.js";import"./chunk-XDQMGUWL.js";import"./chunk-FTEOCCPB.js";import"./chunk-25MBPJVY.js";import"./chunk-WN3V6KDN.js";import"./chunk-523TE4BI.js";import"./chunk-ZCHXGRRU.js";import"./chunk-74ZXXBGN.js";import"./chunk-APB2STJK.js";import"./chunk-I7AQMAQI.js";import"./chunk-Z4Z5UOZM.js";import"./chunk-6FA3GG5B.js";import"./chunk-Y4OWBBDD.js";import"./chunk-6ZFPQYHG.js";import"./chunk-JFXWI3EN.js";import"./chunk-FFRFSDBM.js";import"./chunk-VYLGI3IH.js";import"./chunk-ACYFMLWG.js";import"./chunk-TVQAPBLZ.js";import"./chunk-KGNCKIFP.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import"./chunk-FTQLQJQV.js";export{b as createHostProfileExternalDataset,a as readHostProfileExternalDataset};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{c as wt,d as vt,e as yt}from"./chunk-QHWGQ3A4.js";import{b as gt,c as re,e as Rt}from"./chunk-SH5CBAFC.js";import{a as pt,b as ft}from"./chunk-UHFZHBGW.js";import"./chunk-PF5R6CMP.js";import{b as ht}from"./chunk-DMVD2RFZ.js";import{a as ee,b as O,c as te}from"./chunk-JYKRR7E5.js";import{a as St}from"./chunk-OIUTWU6K.js";import"./chunk-X4OSOOSU.js";import"./chunk-3K4VVB7S.js";import{b as De,c as Me,d as ze,f as Ne,h as $e}from"./chunk-3Z47M3YY.js";import{b as je}from"./chunk-ABD5M2D2.js";import"./chunk-TRQQNFMO.js";import"./chunk-FEAKTSRS.js";import"./chunk-OSIO7PLX.js";import"./chunk-F74GBN6K.js";import"./chunk-SDAUS5PY.js";import"./chunk-I2NXNMRZ.js";import"./chunk-O72BSKSO.js";import{a as Je,b as Ze}from"./chunk-OPNRWESL.js";import{b as Ke,c as Qe}from"./chunk-2QUCCP6Z.js";import{a as Y}from"./chunk-O6ULLQJ6.js";import"./chunk-FY5KHLMW.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-DBK66CJP.js";import{d as tt,e as st,ga as ct,ha as dt,ia as mt,j as ot,k as it,v as lt,w as X,y as ut}from"./chunk-OGDADQGH.js";import{a as rt}from"./chunk-4NESNOK5.js";import"./chunk-BLXEAZCQ.js";import"./chunk-UCPGRPWY.js";import{b as et}from"./chunk-HDL5YSAA.js";import"./chunk-ZFSHBFG5.js";import"./chunk-AN525SPP.js";import"./chunk-SYUKES6H.js";import"./chunk-HIOKCIL7.js";import{a as at,b as nt}from"./chunk-GW766ZSO.js";import{p as Ye}from"./chunk-UKMA4R6X.js";import"./chunk-OQKJGTTO.js";import"./chunk-KVTBX2UP.js";import"./chunk-IZ6DLEVY.js";import"./chunk-A6USMRWK.js";import"./chunk-PCSIOUHF.js";import"./chunk-7KWD2I6W.js";import"./chunk-GPVCOEUH.js";import"./chunk-N73MU2C3.js";import"./chunk-ZGTOK7ZK.js";import"./chunk-XW6HGSIT.js";import{b as Xe}from"./chunk-KG325WTN.js";import"./chunk-3RCRSMWZ.js";import"./chunk-DMFUEUAZ.js";import"./chunk-PSGGOZFM.js";import"./chunk-FUOEIDMA.js";import"./chunk-NHQ36THU.js";import{F as qe,I as h,K as z,L as Be}from"./chunk-VRIEKBBH.js";import{g as Oe,m as _e}from"./chunk-QNG27G3T.js";import"./chunk-EIRYMSEG.js";import{a as ge,j as We,k as Ve,t as Ge}from"./chunk-QOTVNQDI.js";import"./chunk-OQPJ7FJF.js";import{a as Fe,o as F,p as Ue,q as U,v as Le,y as Z}from"./chunk-WJ43MJ3F.js";import"./chunk-Q4TBTRIG.js";import"./chunk-T5AACNJI.js";import"./chunk-QOGJAQDO.js";import"./chunk-EYPCBBMS.js";import"./chunk-DIO5CB6U.js";import"./chunk-7ED24PP6.js";import{a as he}from"./chunk-RNIAFXMB.js";import{a as fe}from"./chunk-2IHO4GDJ.js";import"./chunk-KCJVFLBB.js";import{b as Te}from"./chunk-N4FFQPLR.js";import{a as Ie,c as ke}from"./chunk-AY64VY4E.js";import{a as ce,h as be}from"./chunk-GJ2ZJFDD.js";import"./chunk-BFKYRQMA.js";import"./chunk-6QSSIT62.js";import"./chunk-3QIB5FXI.js";import"./chunk-6MI4KKWF.js";import"./chunk-DDMZSZFL.js";import"./chunk-W45RKGM6.js";import"./chunk-3VUATFZD.js";import"./chunk-4EPSHPZL.js";import"./chunk-H6IW2R22.js";import"./chunk-L3KS6MOV.js";import"./chunk-MQULU465.js";import"./chunk-PRGBLQVH.js";import"./chunk-7E6T7GP5.js";import"./chunk-DZUAT3TP.js";import"./chunk-XDQMGUWL.js";import"./chunk-FTEOCCPB.js";import"./chunk-25MBPJVY.js";import"./chunk-WN3V6KDN.js";import"./chunk-523TE4BI.js";import"./chunk-ZCHXGRRU.js";import"./chunk-QDC4OW3S.js";import"./chunk-ZZWAQBA2.js";import"./chunk-YR5ID2SS.js";import"./chunk-YBT2NB32.js";import{c as xe}from"./chunk-74ZXXBGN.js";import"./chunk-APB2STJK.js";import"./chunk-I7AQMAQI.js";import{V as pe,X as Ce}from"./chunk-Z4Z5UOZM.js";import"./chunk-6FA3GG5B.js";import{Hb as Q,Ob as J,f as me,m as Ae}from"./chunk-Y4OWBBDD.js";import"./chunk-6ZFPQYHG.js";import"./chunk-JFXWI3EN.js";import"./chunk-FFRFSDBM.js";import"./chunk-VYLGI3IH.js";import{w as de}from"./chunk-ACYFMLWG.js";import"./chunk-TVQAPBLZ.js";import{l as q,m as g,n as M}from"./chunk-KGNCKIFP.js";import{b as n}from"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import{a as r}from"./chunk-FTQLQJQV.js";import{randomUUID as Vt}from"node:crypto";import{promises as _}from"node:fs";import I from"node:path";function Pt(l){let e=new Map,t=new Map;async function o(s,d){let m=(t.get(s)??Promise.resolve()).catch(()=>{}).then(d);t.set(s,m);try{return await m}finally{t.get(s)===m&&t.delete(s)}}r(o,"serial");let a=r((s,d=18e4)=>l.request(z.parse({contractVersion:h,requestId:Vt(),operation:"profile-evaluations/sandbox",params:s}),d),"request");async function c(s,d,m,f){let y=q(f),v=`${d}/${m}/${y}`,b=e.get(s.sessionId)??new Set;if(!b.has(v)){if(f.length>1e7)throw new Error("The public case file exceeds its admitted bound.");for(let R=0;R===0||R<f.length;R+=98304)s.signal.throwIfAborted(),await a({sessionId:s.sessionId,turnId:s.turnId,action:"upload",area:d,path:m,sha256:y,sizeBytes:f.length,offset:R,contentsBase64:f.subarray(R,R+98304).toString("base64")},3e5);b.add(v),e.set(s.sessionId,b)}}r(c,"upload");async function u(s,d=""){let m=[];for(let f of await _.readdir(I.join(s,d),{withFileTypes:!0})){let y=I.posix.join(d,f.name);if(f.isSymbolicLink()){let v=await _.realpath(I.join(s,y));if(!v.startsWith(`${await _.realpath(s)}${I.sep}`)||(await _.stat(v)).isDirectory())throw new Error("The public Agent runtime symlink escapes its file closure.");m.push(y);continue}if(f.isDirectory()?m.push(...await u(s,y)):f.isFile()&&m.push(y),m.length>8192)throw new Error("The public Agent runtime exceeds the file limit.")}return m}return r(u,"runtimeFiles"),{execute:r(s=>o(s.sessionId,async()=>{s.signal.throwIfAborted();for(let[f,y]of Object.entries(s.publicHashes)){let v=await _.realpath(I.join(s.sourceRoot,f)),b=await _.realpath(s.sourceRoot);if(!v.startsWith(`${b}${I.sep}`))throw new Error("The public case file escaped its source root.");let R=await _.readFile(v);if(q(R)!==y)throw new Error("The public case file changed before upload.");await c(s,"policy",f,R)}if(s.runtimeRoot)for(let f of await u(s.runtimeRoot))await c(s,"runtime",f,await _.readFile(I.join(s.runtimeRoot,f)));let d=I.relative(s.sourceRoot,s.cwd??s.sourceRoot);if(d.startsWith("..")||I.isAbsolute(d))throw new Error("The command cwd escaped the admitted case.");let m=n.object({code:n.number().int().nullable(),stdout:n.string().max(75e4),stderr:n.string().max(75e4),timedOut:n.boolean(),stdoutTruncated:n.boolean(),stderrTruncated:n.boolean()}).parse(await a({sessionId:s.sessionId,turnId:s.turnId,action:"exec",command:s.command,stdin:s.stdin,cwd:d.split(I.sep).join("/"),timeoutMs:s.timeoutMs},s.timeoutMs+15e3));return s.signal.throwIfAborted(),m}),"execute"),readOutput:r(s=>o(s.sessionId,async()=>{let d=pt(s.path),m=[],f=null,y=null;for(let b=0;f===null||b<f;b+=98304){s.signal.throwIfAborted();let R=n.object({sizeBytes:n.number().int().min(1).max(1e7),sha256:n.string().regex(/^[a-f0-9]{64}$/),contentsBase64:n.string().max(131072)}).parse(await a({sessionId:s.sessionId,turnId:s.turnId,action:"read",path:d,offset:b},6e4));f??=R.sizeBytes,y??=R.sha256;let p=Buffer.from(R.contentsBase64,"base64");if(R.sizeBytes!==f||R.sha256!==y||p.length!==Math.min(98304,f-b)||p.toString("base64")!==R.contentsBase64)throw new Error("The confined output changed during readback.");m.push(p)}let v=Buffer.concat(m);if(q(v)!==y)throw new Error("The confined output differs from its saved byte identity.");return s.signal.throwIfAborted(),{bytes:v,title:d.split("/").at(-1)}}),"readOutput"),settle:r((s,d)=>o(s,async()=>{try{await a({sessionId:s,turnId:d,action:"stop"},6e4)}finally{e.delete(s)}}),"settle")}}r(Pt,"createHostedProfileCommandOwner");import{randomUUID as Lt}from"node:crypto";var j=98304;function Ht(l){let e=r((t,o)=>l.request(z.parse({contractVersion:h,requestId:Lt(),operation:t,params:o})),"request");return{persistence:{sourceTurnStartedAt:r(async()=>{throw new Error("The case owner must supply its actual turn start time.")},"sourceTurnStartedAt"),saveSandboxFile:r(async()=>{throw new Error("Isolated Profile outputs must be read by the confined case owner.")},"saveSandboxFile"),save:r(async({sessionId:t,turnId:o,identity:a,bytes:c})=>{let u=n.object({uploadId:n.string().min(1),maxChunkBytes:n.literal(j)}).parse(await e("output/begin",{sessionId:t,turnId:o,output:a}));for(let d=0;d<c.length;d+=j){let m=c.subarray(d,d+j);await e("output/chunk",{uploadId:u.uploadId,index:d/j,offset:d,sha256:q(m),contentsBase64:m.toString("base64")})}let{outputRef:s}=n.object({outputRef:Ge}).parse(await e("output/complete",{uploadId:u.uploadId}));if(s.location.kind!=="managed"||s.sha256!==a.sha256||s.sizeBytes!==c.length||s.sourceTaskId!==t||s.sourceTurnId!==o||s.id!==a.id||s.revision!==a.revision)throw new Error("The durable case output differs from its saved identity.");return{outputRef:s,artifact:{artifactRef:s.location.fileId,path:s.location.downloadPath,title:s.title,contentType:s.contentType,sizeBytes:s.sizeBytes}}},"save")},read:r(async(t,o)=>{if(t.location.kind!=="managed"||t.sizeBytes>1e7)throw new Error("Select a bounded managed case output.");let a=[];for(let u=0;u<t.sizeBytes;u+=j){o?.throwIfAborted();let s=n.object({offset:n.number().int(),contentsBase64:n.string().max(131072),sha256:n.string(),sizeBytes:n.number().int()}).parse(await e("output/readBytes",{sessionId:t.sourceTaskId,turnId:t.sourceTurnId,fileId:t.location.fileId,revision:t.revision,sha256:t.sha256,sizeBytes:t.sizeBytes,offset:u})),d=Buffer.from(s.contentsBase64,"base64");if(s.offset!==u||s.sha256!==t.sha256||s.sizeBytes!==t.sizeBytes||d.length!==Math.min(j,t.sizeBytes-u)||d.toString("base64")!==s.contentsBase64)throw new Error("The durable workbook byte range changed.");a.push(d)}o?.throwIfAborted();let c=Buffer.concat(a);if(q(c)!==t.sha256)throw new Error("The durable workbook differs from its sealed hash.");return c},"read")}}r(Ht,"createHostedProfileArtifactOwner");import{randomUUID as Gt}from"node:crypto";var $t=n.object({createdAt:n.string().datetime(),id:n.string().min(1)}).strict(),Kt=n.object({entries:n.array(n.unknown()).max(100),nextBefore:$t.nullable()}).strict(),se=class{constructor(e){this.client=e}client;static{r(this,"HostedProfileEvaluationStorage")}execute(e){return this.client.request({contractVersion:h,requestId:Gt(),operation:"profile-evaluations/execute",params:e})}async get(e,t,o){let a=await this.execute({action:"get",kind:e,id:t});if(a===null)return null;let c=o.parse(a);return M(c,`Hosted Profile evaluation ${e}`),c}async put(e,t,o,a,c){let u=o.parse(t);M(u,`Hosted Profile evaluation ${e}`);let s=o.parse(await this.execute({action:"put",kind:e,payload:u,profileKey:a,createdAt:c}));if(s.contentHash!==u.contentHash||g(s)!==g(u))throw new Error("Hosted Profile evaluation write returned different evidence.");return s}async page(e,t,o){let a=[],c=null;do{let u=Kt.parse(await this.execute({action:"page",kind:e,profileKey:g(F.parse(t)),before:c,limit:100}));if(u.nextBefore&&(u.entries.length===0||c&&(u.nextBefore.createdAt>c.createdAt||u.nextBefore.createdAt===c.createdAt&&u.nextBefore.id>=c.id)))throw new Error("Hosted Profile evaluation cursor did not advance.");for(let s of u.entries){let d=o.parse(s);M(d,`Hosted Profile evaluation ${e}`),a.push(d)}if(a.length>1e4)throw new Error("Hosted Profile evaluation history exceeds the bounded catalog limit.");c=u.nextBefore}while(c);return a}getProfileEvaluationGrade(e){return this.get("grade",e,de)}saveProfileEvaluationGrade(e){return this.put("grade",e,de,null,new Date().toISOString())}getProfileEvaluationReceipt(e){return this.get("receipt",e,me)}saveProfileEvaluationReceipt(e){if(!Ae(e))throw new Error("Hosted Profile evaluation receipt is invalid.");return this.put("receipt",e,me,null,e.completedAt)}getProfileEvaluationRun(e){return this.get("run",e,Y)}saveProfileEvaluationRun(e){return this.put("run",e,Y,g(F.parse(e.profileRef)),e.completedAt)}listProfileEvaluationRuns(e){return this.page("run",e,Y)}getProfileEvaluationComparison(e){return this.get("comparison",e,Q)}saveProfileEvaluationComparison(e,t){return this.put("comparison",t,Q,g(F.parse(e)),t.createdAt)}listProfileEvaluationComparisons(e){return this.page("comparison",e,Q)}getProfileEvaluationSuiteRun(e){return this.get("suite",e,J)}saveProfileEvaluationSuiteRun(e,t,o){if(g(t)!==o.catalogHash)throw new Error("Hosted Profile evaluation suite differs from its catalog.");return this.put("suite",o,J,g(F.parse(e)),o.createdAt)}listProfileEvaluationSuiteRuns(e){return this.page("suite",e,J)}};async function Et(l){let e=l.release;if(!e.hostExecution)throw new Error("Hosted evaluation requires explicit host execution attribution.");let t={hostConversationId:e.hostExecution.conversationId,hostTurnId:e.hostExecution.turnId},o={source:"openpond_git",profileId:e.profileId,repositoryId:e.repositoryId},a=r(async()=>({ref:o,sourceRevision:e.sourceRevision}),"selectedProfile"),c=r(()=>re(l.client,e),"selectedWorkflows"),u=new se(l.client),s=r(async p=>{if(g(p)!==g(e.harnessRelease))throw new Error("Evaluation requires the admitted Profile release.");let S=await O(l.client,p);if(!S)throw new Error("Admitted evaluation Profile is unavailable.");return S},"loadRuntime"),d=r(async p=>{if(g(p.ref)!==g(o)||p.sourceRevision!==e.sourceRevision)throw new Error("Evaluation requires the admitted Profile source.");return je({...p,runtime:await s(p.harnessRelease)})},"loadCatalog"),m=l.externalDataset?await ht({value:l.externalDataset,release:(await s(e.harnessRelease)).release,sourceRevision:e.sourceRevision,client:l.client}):null,f=r(async(p,S,x)=>{if(S!==e.profileId)throw new Error("Evaluation Taskset Profile differs from its admitted source.");let E=await Ne({definition:p,harnessRelease:x,runtime:await s(x)});if(!E)throw new Error("Evaluation Taskset is absent from the admitted Profile release.");return E},"loadTasksetPackage"),y=wt({resolveExternalDataset:m?.resolveExternalDataset,store:{runtimeEventsForTurn:r(p=>l.core.runtimeEventsForTurn(p),"runtimeEventsForTurn")},storeDir:l.storeDir,readManagedArtifact:l.readManagedArtifact,admitSession:l.admitSession,settleSession:l.settleSession,loadCatalog:d,loadTasksetPackage:f,selectedProfile:a,createSession:r(p=>{let S=Le.parse(p);return l.createSession({...S,metadata:{...S.metadata,...t}})},"createSession"),sendTurn:r((p,S)=>{let x=Z.parse(S);return l.sendTurn(p,{...x,metadata:{...x.metadata,...t}})},"sendTurn"),interruptSessionTurn:l.interruptSessionTurn}),v=$e({resolveExternalDataset:m?.resolveExternalDataset,sourceCandidate:m?.sourceCandidate,privateGradingPreflight:r(p=>Me(p,!1),"privateGradingPreflight"),loadCatalog:d,selectedWorkflows:c,loadTasksetPackage:f,placement:"remote",boundedWorkComputeAvailable:!0,modelConfigurationHash:r(async(p,S)=>{if(p.providerId!=="openpond"||!S.hostModelConfigurationHash)throw new Error("Hosted evaluation requires a host-admitted model configuration receipt.");return S.hostModelConfigurationHash},"modelConfigurationHash")}),b=vt({resolveExternalDataset:m?.resolveExternalDataset,store:u,loadCatalog:d,loadTasksetPackage:f,selectedProfile:a,executeCase:y,privateGrading:r((p,S,x)=>ze({manifest:p,packageValue:S,signal:x,executeSandboxVerifier:De(l.client),authorize:r(async()=>{let E=p.profileEvaluation;if(!E||E.profileId!==e.profileId||E.sourceRevision!==e.sourceRevision)throw new Error("The hosted private grading source changed.");if(E.externalDatasetBinding){if(!m)throw new Error("The frozen Dataset owner is unavailable.");await m.authorize({bindingHash:E.externalDatasetBinding.contentHash,manifestHash:p.contentHash})}let B=await d({ref:o,sourceRevision:e.sourceRevision,harnessRelease:E.harnessRelease});if(!E.externalDatasetBinding&&B.catalogHash!==E.catalogHash)throw new Error("The hosted private grading catalog changed.")},"authorize")}),"privateGrading")}),R={getProfileEvaluationRun:u.getProfileEvaluationRun.bind(u),getProfileEvaluationReceipt:u.getProfileEvaluationReceipt.bind(u),getProfileEvaluationGrade:u.getProfileEvaluationGrade.bind(u),getSession:l.core.getSession.bind(l.core),getTurn:l.core.getTurn.bind(l.core),runtimeEventsForTurn:l.core.runtimeEventsForTurn.bind(l.core),listModelUsageRecords:l.core.listModelUsageRecords.bind(l.core)};return{prepareProfileEvaluationRun:v,executeProfileEvaluationCase:y,executeProfileEvaluationRun:b,runPreparedProfileEvaluation:r(async p=>b(await v(p,{requireExpectedManifestHash:!0})),"runPreparedProfileEvaluation"),runProfileEvaluationSuite:yt({store:u,loadCatalog:d,selectedWorkflows:c,prepareRun:v,executeRun:b}),compareProfileEvaluationRuns:Je({store:u,selectedProfile:a}),buildProfileEvaluationReport:r(p=>Ze({store:u,profileRef:o,request:p}),"buildProfileEvaluationReport"),listProfileEvaluations:r(async p=>{if(p&&typeof p=="object"&&"runId"in p)return Qe({store:R,profileRef:o,...Ke.parse(p)});let[S,x,E,B]=await Promise.all([d({ref:o,sourceRevision:e.sourceRevision,harnessRelease:e.harnessRelease}),u.listProfileEvaluationRuns(o),u.listProfileEvaluationComparisons(o),u.listProfileEvaluationSuiteRuns(o)]);return{...S,runs:x,comparisons:E,suiteRuns:B}},"listProfileEvaluations")}}r(Et,"createHostedProfileEvaluationRuntime");import{mkdir as lr}from"node:fs/promises";import{randomUUID as Dt}from"node:crypto";import W from"node:path";import{randomUUID as bt}from"node:crypto";var Qt=n.object({revision:n.number().int().nonnegative(),payload:n.record(n.string(),n.unknown()).nullable()}).strict(),Jt=n.object({entries:n.array(n.unknown()).max(100),nextAfterId:n.string().min(1).nullable()}).strict(),oe=class{constructor(e){this.client=e}client;static{r(this,"HostedHarnessStateStorage")}async getPreference(e,t){return Qt.parse(await this.client.request({contractVersion:h,requestId:bt(),operation:"harness/state/read",params:{workspaceId:e,kind:t,afterId:null,limit:1}}))}async listCandidates(e){return(await this.readAll(e,"candidates")).map(t=>Ie.parse(t))}async listCrossRunRequests(e){return(await this.readAll(e,"cross_run_requests")).map(t=>ke.parse(t))}async readAll(e,t){let o=[],a=null;do{let c=Jt.parse(await this.client.request({contractVersion:h,requestId:bt(),operation:"harness/state/read",params:{workspaceId:e,kind:t,afterId:a,limit:Math.min(100,1001-o.length)}}));if(c.nextAfterId&&(c.entries.length===0||c.nextAfterId===a))throw new Error("Hosted Harness state cursor did not advance.");if(o.push(...c.entries),o.length>1e3)throw new Error("Hosted Harness state exceeds 1,000 entries.");a=c.nextAfterId}while(a);return o}};import{randomUUID as Zt}from"node:crypto";import{cp as Yt,mkdir as Xt,rm as er}from"node:fs/promises";import tr from"node:path";var we=n.object({schemaVersion:n.literal("openpond.harnessMemoryEntry.v1"),id:n.string(),workspaceId:n.string(),key:n.string(),content:n.string(),tags:n.array(n.string()),revision:n.number().int().positive(),status:n.enum(["active","deleted"]),sourceRunId:n.string().nullable(),sourceProposal:n.object({id:n.string(),contentHash:n.string()}).nullable(),createdAt:n.string().datetime(),updatedAt:n.string().datetime(),contentHash:n.string().regex(/^[a-f0-9]{64}$/)}).strict(),rr=n.object({createdAt:n.string().datetime(),id:n.string()}).strict(),Tt=n.object({entries:n.array(n.unknown()).max(100),nextBefore:rr.nullable()}).strict(),ve=n.object({workspace:ce,receipt:be}).strict(),ae=class{constructor(e,t){this.client=e;this.storeDir=t;this.usage=new Rt(e),this.overlay=new ee({request:r(async o=>o.operation==="harness/overlay/get"?this.request({action:"overlay_get",...o.params}):o.operation==="harness/overlay/freezeProposal"?this.request({action:"overlay_freeze",...o.params},o.requestId):e.request(o),"request")})}client;storeDir;static{r(this,"HostedHarnessReviewStorage")}harnessStoragePlacement="hosted";reviewSessionId=null;overlay;usage;request(e,t=Zt()){return this.client.request({contractVersion:h,requestId:t,operation:"harness/review/execute",params:e},e.action==="release_put"?6e4:15e3)}sessionId(){if(!this.reviewSessionId)throw new Error("Hosted review memory requires an admitted review session.");return this.reviewSessionId}async prepareReview(e){let t=await this.getSession(e.runRef);if(!t)throw new Error("Hosted review session is unavailable.");this.reviewSessionId=t.id;let o=await this.getHarnessRunOverlay(t.id);if(!o)throw new Error("Hosted review overlay is unavailable.");let a=await this.getHarnessWorkspace(o.workspace.workspaceId);if(!a?.currentChannel.release)throw new Error("Hosted review workspace release is unavailable.");let c=await this.getHarnessReleaseRecord(a.currentChannel.release.contentHash);if(!c||c.sourceRevision!==a.sourceRevision)throw new Error("Hosted review source binding changed.");let u=Oe(this.storeDir,a.id);await Xt(u.root,{recursive:!0,mode:448}),await er(u.source,{recursive:!0,force:!0}),await Yt(tr.join(c.bundlePath,"source"),u.source,{recursive:!0,force:!1,errorOnExist:!0});let s=await _e({workspaceId:a.id,sourceDir:u.source});if(s.sourceRevision!==a.sourceRevision||s.harnessRelease.contentHash!==c.harnessRelease.contentHash)throw new Error("Hosted review source cache differs from its immutable release.")}getHarnessWorkspace=r(async e=>ce.nullable().parse(await this.request({action:"workspace_get",workspaceId:e})),"getHarnessWorkspace");getHarnessReleaseRecord=r(async e=>fe.nullable().parse(await this.request({action:"release_get",contentHash:e})),"getHarnessReleaseRecord");saveHarnessReleaseRecord=r(async e=>fe.parse(await this.request({action:"release_put",record:e},`review-release:${e.harnessRelease.contentHash}`)),"saveHarnessReleaseRecord");getHarnessRunOverlay=r(e=>this.overlay.getHarnessRunOverlay(e),"getHarnessRunOverlay");createHarnessRunOverlay=r(e=>this.overlay.createHarnessRunOverlay(e),"createHarnessRunOverlay");freezeHarnessRunOverlayWithProposalAtomically=r(e=>this.overlay.freezeHarnessRunOverlayWithProposalAtomically(e),"freezeHarnessRunOverlayWithProposalAtomically");getHarnessBackgroundReviewSettings=r(async e=>n.object({enabled:n.boolean(),updatedAt:n.string().datetime().nullable()}).strict().parse(await this.request({action:"background_get",workspaceId:e})),"getHarnessBackgroundReviewSettings");getHarnessMemory=r(async(e,t)=>we.nullable().parse(await this.request({action:"memory_get",workspaceId:e,sessionId:this.sessionId(),key:t})),"getHarnessMemory");listHarnessMemories=r(async(e,t={})=>{let o=n.object({entries:n.array(we).max(20),nextBefore:n.object({updatedAt:n.string().datetime(),key:n.string()}).nullable()}),a=[],c=null;do{let u=o.parse(await this.request({action:"memory_page",workspaceId:e,sessionId:this.sessionId(),before:c,limit:20,includeDeleted:t.includeDeleted??!1}));if(a.push(...u.entries),u.nextBefore&&(!u.entries.length||g(u.nextBefore)===g(c)))throw new Error("Hosted memory cursor did not advance.");c=u.nextBefore}while(c&&a.length<1e3);if(c)throw new Error("Hosted review memory exceeds its bounded window.");return a},"listHarnessMemories");writeHarnessMemory=r(async e=>we.parse(await this.request({action:"memory_write",sessionId:this.sessionId(),input:e},`review-memory:${g(e)}`)),"writeHarnessMemory");saveHarnessImprovementArtifact=r(async(e,t,o)=>{let a={action:"artifact_put",workspaceId:e,kind:t,artifact:o},c=(await import("./dist-ZVJPJLXR.js")).HarnessReviewStorageParamsSchema.parse(a);return he[t].parse(await this.request(c,`review-artifact:${t}:${o.contentHash}`))},"saveHarnessImprovementArtifact");listHarnessImprovementArtifacts=r(async(e,t,o=100)=>{let a=[],c=null,u=Math.min(Math.max(1,Math.trunc(o)),1e3);do{let s=(await import("./dist-ZVJPJLXR.js")).HarnessReviewStorageParamsSchema.parse({action:"artifact_page",workspaceId:e,kind:t,before:c,limit:Math.min(100,u-a.length)}),d=Tt.parse(await this.request(s));if(a.push(...d.entries),d.nextBefore&&(!d.entries.length||g(d.nextBefore)===g(c)))throw new Error("Hosted artifact cursor did not advance.");c=d.nextBefore}while(c&&a.length<u);return a.map(s=>he[t].parse(s))},"listHarnessImprovementArtifacts");listPendingHarnessRefinerTriggers=r(async()=>{let e=await import("./hosted-harness-runtime-723S5ZSH.js").then(a=>a.loadHostedHarnessRuntime(this.client));if(!e)return[];let t=[],o=null;do{let a=Tt.parse(await this.request({action:"pending_page",workspaceId:e.workspace.id,before:o,limit:100}));if(t.push(...a.entries.map(c=>({workspaceId:e.workspace.id,trigger:Te.parse(c)}))),a.nextBefore&&(!a.entries.length||g(a.nextBefore)===g(o)))throw new Error("Hosted pending-review cursor did not advance.");o=a.nextBefore}while(o&&t.length<1e3);if(o)throw new Error("Hosted pending reviews exceed the bounded recovery window.");return t},"listPendingHarnessRefinerTriggers");advanceHarnessWorkspaceAtomically=r(async e=>ve.parse(await this.client.request({contractVersion:h,requestId:e.receiptId,operation:"harness/workspace/transition",params:{action:"advance",...e}})),"advanceHarnessWorkspaceAtomically");advanceReviewedHarnessWorkspaceAtomically=r(async e=>ve.parse(await this.client.request({contractVersion:h,requestId:e.receiptId,operation:"harness/workspace/transition",params:{action:"reviewedAdvance",...e}})),"advanceReviewedHarnessWorkspaceAtomically");rollbackHarnessWorkspaceAtomically=r(async e=>ve.parse(await this.client.request({contractVersion:h,requestId:e.receiptId,operation:"harness/workspace/transition",params:{action:"rollback",...e}})),"rollbackHarnessWorkspaceAtomically");getSession=r(async e=>Ue.nullable().parse(await this.request({action:"session_get",sessionId:e})),"getSession");getTurn=r(async e=>U.nullable().parse(await this.request({action:"turn_get",turnId:e})),"getTurn");updateTurn=r(async(e,t)=>{let o=await this.getTurn(e);if(!o)return null;let a=U.parse(t(o)),{harnessSnapshot:c,...u}=o,{harnessSnapshot:s,...d}=a;if(!s||g(u)!==g(d))throw new Error("Hosted review may only restore a missing Harness snapshot.");return U.parse(await this.request({action:"snapshot_restore",turnId:e,expectedHash:g(o),snapshot:s}))},"updateTurn");turnsForSession=r(async(e,t=1e3)=>{let o=n.object({entries:n.array(U).max(100),nextBefore:n.number().int().positive().nullable()}),a=[],c=null,u=Math.min(Math.max(1,Math.trunc(t)),1e3);do{let s=o.parse(await this.request({action:"turn_page",sessionId:e,before:c,limit:Math.min(100,u-a.length)}));if(a.push(...s.entries),s.nextBefore&&(!s.entries.length||c!==null&&s.nextBefore>=c))throw new Error("Hosted review turn cursor did not advance.");c=s.nextBefore}while(c&&a.length<u);return a.reverse()},"turnsForSession");runtimeEventsForTurn=r(async(e,t={})=>{let o=n.object({entries:n.array(ge).max(100),nextAfterSequence:n.number().int().positive().nullable()}),a=[],c=0,u=Math.min(t.limit??1e4,1e4);do{let s=o.parse(await this.request({action:"event_page",turnId:e,afterSequence:c,names:[...t.names??[]],limit:Math.min(100,u-a.length)}));if(a.push(...s.entries),!s.nextAfterSequence)return a;if(!s.entries.length||s.nextAfterSequence<=c)throw new Error("Hosted review event cursor did not advance.");c=s.nextAfterSequence}while(a.length<u);return a},"runtimeEventsForTurn");listModelUsageRecords=r(e=>this.usage.listModelUsageRecords(e),"listModelUsageRecords");async appendRuntimeEvent(e){return ge.parse(await this.request({action:"event_append",event:e},`review-event:${e.id}`))}async upsertModelUsageRecord(e){await this.request({action:"usage_put",record:e},`review-usage:${g(e)}`)}};import{randomUUID as sr}from"node:crypto";async function xt(l,e){let t=xe.parse(await l.request({contractVersion:h,requestId:sr(),operation:"refiner/execute",params:{action:{action:"active_release",workspaceId:e}}}));return M(t,"Hosted Refiner active release"),t}r(xt,"loadHostedRefinerRelease");import{randomUUID as or}from"node:crypto";var ar=n.object({personalizationSoul:n.string().max(8e3).optional(),userInstructions:n.string().max(64e3).optional(),preferences:pe.optional()}).strict(),nr=n.object({revision:n.number().int().positive(),settings:ar}).strict();async function ye(l){let e=await l.request({contractVersion:h,requestId:or(),operation:"settings/get",params:{}}),t=e===null?null:nr.parse(e);return{revision:t?.revision??null,personalizationSoul:t?.settings.personalizationSoul??Ce[0].content,userInstructions:t?.settings.userInstructions??"",preferences:t?.settings.preferences??pe.parse({})}}r(ye,"loadHostedRuntimeSettings");import{randomUUID as It}from"node:crypto";function kt(l){async function e(t){let o=await te(l,t);if(!o)throw new Error("No hosted Harness is selected for this run.");return o.workspace.id}return r(e,"workspaceId"),[{name:"memory_search",description:"Search bounded active memory for this selected Harness or Profile. Returns keys, revisions and short excerpts.",parameters:{type:"object",additionalProperties:!1,properties:{query:{type:"string",minLength:1,maxLength:500},limit:{type:"integer",minimum:1,maximum:20}},required:["query"]},execute:r(async t=>{let o=t.args.query;if(typeof o!="string"||!o.trim()||o.length>500)throw new Error("Memory query is invalid.");let a=t.args.limit===void 0?8:t.args.limit;if(typeof a!="number"||!Number.isInteger(a)||a<1||a>20)throw new Error("Memory search limit is invalid.");let c=await l.request({contractVersion:h,requestId:It(),operation:"harness/memory/search",params:{workspaceId:await e(t.session),query:o,limit:a}});return{toolCallId:t.callId,name:"memory_search",ok:!0,contentText:JSON.stringify(c),data:c}},"execute")},{name:"memory_inspect",description:"Read one exact active memory entry returned by memory_search.",parameters:{type:"object",additionalProperties:!1,properties:{key:{type:"string",minLength:1,maxLength:120}},required:["key"]},execute:r(async t=>{let o=t.args.key;if(typeof o!="string"||!/^[a-z0-9][a-z0-9-]{0,119}$/.test(o))throw new Error("Memory key is invalid.");let a=await l.request({contractVersion:h,requestId:It(),operation:"harness/memory/get",params:{workspaceId:await e(t.session),key:o}});if(!a||typeof a!="object"||Array.isArray(a)||a.status!=="active")throw new Error(`Harness memory does not exist: ${o}.`);return{toolCallId:t.callId,name:"memory_inspect",ok:!0,contentText:JSON.stringify(a),data:a}},"execute")}]}r(kt,"createHostedHarnessMemoryTools");import{randomUUID as At}from"node:crypto";function Ct(l){return[{name:"work_list_outputs",description:"List this conversation's published outputs from completed turns without starting sandbox compute. Use this before reading a previously saved file; returns exact file IDs and revisions. New workspace files are published after the current turn ends. Inspect those with workspace tools and finish the turn instead of polling this list.",parameters:{type:"object",additionalProperties:!1,properties:{}},execute:r(async e=>{let t=await l.request({contractVersion:h,requestId:At(),operation:"output/list",params:{}});return{toolCallId:e.callId,name:"work_list_outputs",ok:!0,contentText:JSON.stringify(t),data:t}},"execute")},{name:"work_read_output",description:"Read the actual saved text/Markdown or PDF text of a file returned by work_list_outputs, without starting sandbox compute. Prefer this for questions about saved outputs. Use workspace tools for edits, execution and unsaved files. PDF text extraction does not inspect images or page appearance.",parameters:{type:"object",additionalProperties:!1,properties:{fileId:{type:"string",minLength:1,maxLength:191},revision:{type:"integer",minimum:1},offset:{type:"integer",minimum:0,maximum:1e7},maxChars:{type:"integer",minimum:1,maximum:1e5},firstPage:{type:"integer",minimum:1,maximum:1e3},pageCount:{type:"integer",minimum:1,maximum:10}},required:["fileId","revision"]},execute:r(async e=>{let t=await l.request(z.parse({contractVersion:h,requestId:At(),operation:"output/read",params:e.args}),6e4);return{toolCallId:e.callId,name:"work_read_output",ok:!0,contentText:JSON.stringify(t),data:t}},"execute")}]}r(Ct,"createHostedWorkOutputTools");import{randomUUID as Ot}from"node:crypto";function _t(l,e){return{allowedTools:e,authorizeTool:r(async t=>{let o=await l.request({contractVersion:h,requestId:Ot(),operation:"embedding/authorize",params:{sessionId:t.session.id,turnId:t.turnId,name:t.name}});if(!o||typeof o!="object"||Array.isArray(o)||o.allowed!==!0)throw new Error("Hosted tool authorization denied.")},"authorizeTool")}}r(_t,"createHostedEmbeddingAdapter");function qt(l){return async e=>{let t=qe.parse(e);return l.request({contractVersion:h,requestId:Ot(),operation:"sandbox/request",params:{action:t}},e.type==="create"?3e5:e.type==="exec"?18e4:6e4)}}r(qt,"createHostedSandboxRequest");var ir=["sandbox/request","embedding/authorize","output/begin","output/chunk","output/complete","output/saveSandboxFile","output/list","output/read","settings/get","harness/get","harness/overlay/get","harness/overlay/put","harness/memory/get","harness/memory/list","harness/memory/search","harness/memory/write","harness/state/read","task-inbox/execute","create-improve/execute","approval/get","approval/upsert","usage/getByRequestId","usage/upsert","usage/page","session/count","session/get","session/page","session/put","turn/count","turn/wakeCount","turn/get","turn/put","turn/latest","turn/page","thread/turnPage","event/append","events/page","events/latestAssistantText"];function Bt(l){if(ir.some(e=>!l.operations.includes(e)))throw new Error("Hosted Postgres runtime capabilities are incomplete.");if(l.maxRequestBytes<256e3||l.maxInFlight<32||l.maxPageSize<200)throw new Error("Hosted Postgres runtime transport limits are incompatible.")}r(Bt,"assertHostedWorkCapabilities");var w=r(async()=>{throw new Error("This hosted control is not available until its Postgres repository is activated.")},"unavailable"),ur=We(),cr=Ve();async function _o(l){let e=l.runtimeStorage,t=l.hostStorageClient;if(e.kind!=="hosted_postgres"||!t||e.client!==t)throw new Error("Hosted storage selection mismatch.");if(l.embedding||l.sandboxRequest)throw new Error("Hosted Postgres tool and sandbox authority must come from the host transport.");if(!l.streamOpenPondHostedChatTurn)throw new Error("Hosted Postgres runtime requires a host-admitted model stream.");if(l.profileSource||l.harness)throw new Error("Hosted Postgres runtime accepts only host-admitted immutable sources.");if(l.services&&Object.values(l.services).some(i=>i!==!1&&i!==void 0))throw new Error("Hosted service adapters must be admitted by the Postgres composition.");let o=Be.parse(await t.request({contractVersion:h,requestId:Dt(),operation:"capabilities",params:{}}));Bt(o);let a=_t(t,o.allowedTools),c=qt(t),u=W.resolve(l.storeDir??process.cwd()),s=W.resolve(l.workspaceDir??process.cwd());await lr(s,{recursive:!0});let d=st({channel:"app-server",logDir:W.join(u,"logs"),metadata:{version:l.version??Xe,runtimeVersion:Ye(),placement:"hosted_work"}}),m=e.core,f=new ae(t,u),y=e.admittedProfileRelease?await gt(t,e.admittedProfileRelease):{profile:cr,profileLibrary:ur},{appendRuntimeEvent:v,closeEventSubscribers:b,subscribeRuntimeEvents:R}=ut({logger:d,assistantDeltaFlushMs:250,store:{appendRuntimeEvent:r(i=>["harness.refiner.queued","harness.refiner.started","harness.refiner.completed","harness.refiner.failed"].includes(i.name)?f.appendRuntimeEvent(i):m.appendRuntimeEvent(i),"appendRuntimeEvent"),runtimeEventPageRows:r(i=>m.runtimeEventPageRows(i),"runtimeEventPageRows")}}),p=X({queueId:"turn-follow-up",logger:d}),S=X({queueId:"subagent",logger:d}),x=nt(l.streamOpenPondHostedChatTurn,{enabled:at()}),E=X({queueId:"harness-refiner",logger:d,concurrency:1}),B=St({store:f,storeDir:u,queue:E,streamOpenPondHostedChatTurn:x,appendRuntimeEvent:v,upsertModelUsageRecord:r(i=>f.upsertModelUsageRecord(i),"upsertModelUsageRecord"),prepareReview:r(i=>f.prepareReview(i),"prepareReview"),loadActiveRefinerRelease:r(async()=>{let i=await O(t);if(!i)throw new Error("Hosted review has no admitted Harness workspace.");return xt(t,i.workspace.id)},"loadActiveRefinerRelease")}),Re=r(async()=>(await ye(t)).preferences,"preferences"),{createSession:ne,getSession:D,updateSession:ie,completeTurn:Mt,failTurn:zt,interruptTurn:jt}=dt({store:m,defaultSessionCwd:r(()=>s,"defaultSessionCwd"),appendRuntimeEvent:v,loadAppPreferences:Re,loadLastUsedProfile:r(async()=>y.profileLibrary.lastUsed,"loadLastUsedProfile")}),le=lt({workspaceDir:s,logger:d,getSession:D,updateSession:ie,appendRuntimeEvent:v,sandboxRequest:c,sandboxCreationMode:"hosted_worker"}),V=ot({appendRuntimeEvent:v,findLocalProject:r(async()=>null,"findLocalProject"),onRepositoryInstructionDiagnostic:r((i,P)=>d.warn("repository instruction file skipped",{diagnostic:i,sessionId:P.id}),"onRepositoryInstructionDiagnostic")}),Nt=new ee(t),L=new oe(t),Se=Ht(t),ue=Pt(t),G=e.admittedProfileRelease?.hostExecution?await O(t,e.admittedProfileRelease.harnessRelease):null;if(e.admittedProfileRelease?.hostExecution&&(!G||!o.operations.includes("output/readBytes")||!o.operations.includes("profile-evaluations/sandbox")||!o.operations.includes("profile-evaluations/grade")))throw new Error("Hosted evaluation requires its admitted release, managed artifact owner and private sandbox grader.");let Ft=tt({deviceId:"hosted-evaluation",storeDir:u,runtimeEventsForSession:r(i=>m.runtimeEventsForSession(i),"runtimeEventsForSession"),managedPersistence:{...Se.persistence,sourceTurnStartedAt:r(async(i,P)=>{let H=await m.getTurn(P);if(!H||H.sessionId!==i||!H.startedAt)throw new Error("The managed output has no actual started case turn.");return H.startedAt},"sourceTurnStartedAt")}}),k=G?ft({readOutput:ue.readOutput,executeCommand:ue.execute,settleRemote:ue.settle,runtimeNode:"node",runtimeAgentRoot:"/workspace/runtime",storeDir:u,release:G.release,getSession:D,getTurn:r(i=>m.getTurn(i),"getTurn"),saveOutput:Ft.saveOwnedOutputBytes,recordOutput:r(async(i,P,H)=>{await v({id:Dt(),timestamp:new Date().toISOString(),name:"workspace_action_result",source:"server",sessionId:i,turnId:P,action:"work_output_save",status:"completed",data:H})},"recordOutput"),authorize:r(async()=>{let i=await O(t,e.admittedProfileRelease.harnessRelease);if(!i||i.release.harnessRelease.contentHash!==G.release.harnessRelease.contentHash)throw new Error("The hosted isolated evaluation source authority changed.")},"authorize")}):null,Ut=mt(a,async(i,P)=>{let H=await m.getTurn(i);if(!H)throw new Error("Embedded turn is unavailable.");let C=await D(H.sessionId),$=C.metadata?.embeddingToolBindings,N=[...P].sort((K,Wt)=>K.name.localeCompare(Wt.name));if($!==void 0&&g($)!==g(N))throw new Error("Embedded tool bindings changed; start a new thread.");await ie(C.id,{metadata:{...C.metadata,embeddingToolBindings:N}}),await m.updateTurn(i,K=>({...K,metadata:{...K.metadata,toolBindings:N}}))}),T=ct({executionHost:"embedded",workInputsForSession:l.workInputsForSession,attachmentRootDir:W.join(u,"attachments"),isolatedProfileEvaluationForTurn:k?async i=>{if(i.metadata?.profileEvaluationRun===void 0)return!1;if(!k.ownsSession(i.id))throw new Error("The hosted evaluation has no actual isolated case owner.");return!0}:void 0,executeProfileEvaluationAction:k?.executeAction,resolveModelTools:r(i=>k?.ownsSession(i.session.id)?k.resolveTools(i):Ut(i),"resolveModelTools"),hostedToolFlags:{toolMode:"native",nativeToolTransport:!0,nativeToolProviderDenylist:[],textToolFallback:!1},store:m,inboxStore:e.inbox,createSession:ne,getSession:D,updateSession:ie,completeTurn:Mt,failTurn:zt,interruptTurn:jt,upsertApproval:r(i=>m.upsertApproval(i),"upsertApproval"),defaultSessionCwd:r(()=>s,"defaultSessionCwd"),findOpenPondApp:r(async i=>({id:i||Fe(s),name:W.basename(s)||"Workspace",description:null,visibility:"private",sandbox:!0}),"findOpenPondApp"),resolveSessionWorkspaceCwd:r(async i=>i.cwd?.trim()||s,"resolveSessionWorkspaceCwd"),ensureCodexRuntime:r(async()=>{throw new Error("Codex process hosting is unavailable.")},"ensureCodexRuntime"),appendWorkspaceDiffEvent:le.appendWorkspaceDiffEvent,workspaceDiffBaseline:le.workspaceDiffBaseline,appendRuntimeEvent:v,executeWorkspaceTool:le.executeWorkspaceTool,executeOpenPondCommand:r(async()=>{throw new Error("Hosted commands require durable authorization.")},"executeOpenPondCommand"),loadOpenPondProfileState:r(async()=>y.profile,"loadOpenPondProfileState"),loadOpenPondProfileLibrary:r(async()=>y.profileLibrary,"loadOpenPondProfileLibrary"),readOpenPondProfileSkill:w,loadSelectedHarnessRuntime:r(i=>{if(i.currentProfile&&(!e.admittedProfileRelease||i.currentProfile.repositoryId!==e.admittedProfileRelease.repositoryId||i.currentProfile.profileId!==e.admittedProfileRelease.profileId))throw new Error("Hosted Profile session lacks admitted immutable source.");return te(t,i)},"loadSelectedHarnessRuntime"),ensureHarnessRunOverlay:r(i=>Nt.ensureHarnessRunOverlay(i),"ensureHarnessRunOverlay"),processHarnessImprovementBoundary:B,harnessModelTools:[...kt(t),...Ct(t)],loadBuiltInOpenPondSkills:r(async()=>[],"loadBuiltInOpenPondSkills"),readBuiltInOpenPondSkill:w,loadPersonalizationSoul:r(async()=>(await ye(t)).personalizationSoul,"loadPersonalizationSoul"),loadAppPreferences:Re,maybeCreateScaffoldForTurn:V.maybeCreateScaffoldForTurn,hostedSystemPrompt:V.hostedSystemPrompt,appendAssistantText:V.appendAssistantText,appendHostedContextUsage:V.appendHostedContextUsage,streamOpenPondHostedChatTurn:x,turnFollowUpQueue:p,subagentQueue:S,maxHostedWorkspaceToolRounds:et(l.maxHostedWorkspaceToolRounds),maxRepeatedInvalidToolRequests:3});await T.recoverPendingSubagentCompletions(),await T.recoverTaskInbox();let Pe=!1,He=r(async(i,P)=>{if(Z.parse(P).attachments?.length&&!k?.ownsSession(i))throw new Error("Hosted attachments require managed-file admission.");let H=await D(i);if(H.currentProfile&&(!e.admittedProfileRelease||H.currentProfile.repositoryId!==e.admittedProfileRelease.repositoryId||H.currentProfile.profileId!==e.admittedProfileRelease.profileId))throw new Error("Hosted Profile session lacks admitted immutable source.");return Pe||(await B.reconcilePending(),await E.drain(),Pe=!0),T.sendTurn(i,P)},"sendTurn");if(l.profileExternalDataset&&!e.admittedProfileRelease?.hostExecution)throw new Error("External Dataset requires its admitted hosted evaluation.");let A=e.admittedProfileRelease?.hostExecution?await Et({client:t,core:m,release:e.admittedProfileRelease,storeDir:u,...l.profileExternalDataset?{externalDataset:l.profileExternalDataset}:{},readManagedArtifact:Se.read,admitSession:k.admitSession,settleSession:k.settleSession,createSession:ne,sendTurn:He,interruptSessionTurn:T.interruptSessionTurn}):null,Ee=!1;return{...rt({ports:it({bindHome:!1,placement:"hosted_work",connectedAppProviders:[],featureOverrides:{profileWorkflows:!!e.admittedProfileRelease,profileEvaluations:!!A,harnessProposalReview:!1,harnessEvaluationReview:!1,harnessEvaluationReviewAcceptance:!1,harnessEvaluationTasksetMaterialization:!1,harnessEvaluationBaseline:!1,harnessBackgroundReview:!1,harnessDiff:!1,harnessRollback:!1,harnessReview:!1,refinerProfiles:!1,immutableRefinerAdmission:!1},createSession:ne,getSession:D,turnsForSession:r(i=>m.turnsForSession(i,1e3),"turnsForSession"),runtimeEventsForSession:r(i=>m.runtimeEventsForSession(i,{excludeReasoningDeltas:!0}),"runtimeEventsForSession"),sendTurn:He,steerSessionTurn:T.steerSessionTurn,readTaskInbox:T.readTaskInbox,queueTaskInput:T.queueTaskInput,updateTaskInput:T.updateTaskInput,isSessionTurnActive:T.isSessionTurnActive,waitForSessionTurnSettlement:T.waitForSessionTurnSettlement,interruptSessionTurn:T.interruptSessionTurn,resolveApproval:r(async(i,P)=>{let H=await T.resolveCreateImproveApproval(i,P);if(H)return H;let C=await T.resolveSubagentPatchApplyApproval(i,P);if(C)return C;throw new Error(`Approval not found: ${i}`)},"resolveApproval"),listProfileWorkflows:e.admittedProfileRelease?()=>re(t,e.admittedProfileRelease):w,listProfileEvaluations:A?.listProfileEvaluations??w,loadProfileTrainingSource:w,prepareProfileEvaluationRun:A?.prepareProfileEvaluationRun??w,runPreparedProfileEvaluation:A?.runPreparedProfileEvaluation??w,runProfileEvaluationSuite:A?.runProfileEvaluationSuite??w,executeProfileEvaluationCase:A?.executeProfileEvaluationCase??w,executeProfileEvaluationRun:A?.executeProfileEvaluationRun??w,compareProfileEvaluationRuns:A?.compareProfileEvaluationRuns??w,buildProfileEvaluationReport:A?.buildProfileEvaluationReport??w,inspectHarness:r(async()=>{let i=await O(t);if(!i)return null;let P=i.workspace.id,[H,C,$,N]=await Promise.all([L.getPreference(P,"workspace_settings"),L.getPreference(P,"evaluation_review_settings"),L.listCandidates(P),L.listCrossRunRequests(P)]);return{workspace:i.workspace,release:i.release,backgroundReview:H,evaluationReview:C,refinementCandidates:$,crossRunRequests:N}},"inspectHarness"),reviewHarnessProposal:w,reviewHarness:w,acceptHarnessEvaluationReview:w,materializeHarnessEvaluationTaskset:w,runHarnessEvaluationBaseline:w,validateHarness:r(async()=>{let i=await O(t);return i?{valid:!0,workspaceId:i.workspace.id,harnessRelease:i.release.harnessRelease,agentSnapshot:i.release.agentSnapshot}:{valid:!1,reason:"No admitted hosted Harness release."}},"validateHarness"),updateHarnessBackgroundReview:w,diffHarness:w,rollbackHarness:w,inspectRefiner:w,updateRefiner:w,activateRefiner:w,rollbackRefiner:w,subscribeRuntimeEvents:R,observeRuntimeOperation:r(i=>d.info("agent runtime operation",i),"observeRuntimeOperation")}),close:r(async()=>{Ee||(Ee=!0,k?.close(),await T.close(),await Promise.all([p.drain(),S.drain(),E.drain()]),await b(),await d.flush())},"close")}),storePath:"hosted-postgres",workspaceDir:s,composition:["runtime_event_bus","session_store","hosted_provider","workspace_tools","command_approvals","harness","agent_runtime","jsonl_transport"]}}r(_o,"createHostedOwnedAppServer");export{_o as createHostedOwnedAppServer};
|
|
@@ -0,0 +1,3 @@
|
|
|
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-YOBN7KTF.js";import{A as Se,s as be,t as ke}from"./chunk-7HPDGZOR.js";import"./chunk-PPAPVGJP.js";import{e as Ce,f as U}from"./chunk-HZEIRHEB.js";import{b as De,c as ze}from"./chunk-PF5R6CMP.js";import"./chunk-X4OSOOSU.js";import"./chunk-3K4VVB7S.js";import"./chunk-XVDFJ3ZF.js";import"./chunk-EQFGBL3O.js";import"./chunk-GZ7M5XBP.js";import"./chunk-HCYX6RHP.js";import{b as pe}from"./chunk-ABD5M2D2.js";import"./chunk-TRQQNFMO.js";import"./chunk-FEAKTSRS.js";import{a as z}from"./chunk-OSIO7PLX.js";import"./chunk-F74GBN6K.js";import"./chunk-I2NXNMRZ.js";import"./chunk-O72BSKSO.js";import{a as we,b as ve}from"./chunk-FY5KHLMW.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-DBK66CJP.js";import{a as xe}from"./chunk-J2TWKFML.js";import"./chunk-773TH7FN.js";import{g as Te,j as G}from"./chunk-HDL5YSAA.js";import"./chunk-ZFSHBFG5.js";import"./chunk-AN525SPP.js";import"./chunk-SYUKES6H.js";import"./chunk-HIOKCIL7.js";import"./chunk-UKMA4R6X.js";import"./chunk-KVTBX2UP.js";import"./chunk-IZ6DLEVY.js";import"./chunk-7KWD2I6W.js";import"./chunk-OLLLZVHF.js";import"./chunk-7PXZ4X4P.js";import"./chunk-ZGTOK7ZK.js";import"./chunk-XW6HGSIT.js";import"./chunk-KG325WTN.js";import"./chunk-3RCRSMWZ.js";import"./chunk-UGL7WF3W.js";import"./chunk-DMFUEUAZ.js";import"./chunk-PSGGOZFM.js";import"./chunk-FUOEIDMA.js";import"./chunk-NHQ36THU.js";import{b as ce,i as le,m as D,n as ue}from"./chunk-QNG27G3T.js";import{y as W}from"./chunk-EIRYMSEG.js";import{a as me,r as fe,s as he}from"./chunk-QOTVNQDI.js";import"./chunk-OQPJ7FJF.js";import{p as C,q as $}from"./chunk-WJ43MJ3F.js";import"./chunk-Q4TBTRIG.js";import"./chunk-T5AACNJI.js";import{u as ge}from"./chunk-QOGJAQDO.js";import{g as se,l as V,n as de}from"./chunk-EYPCBBMS.js";import"./chunk-DIO5CB6U.js";import"./chunk-7ED24PP6.js";import"./chunk-RNIAFXMB.js";import"./chunk-2IHO4GDJ.js";import"./chunk-KCJVFLBB.js";import"./chunk-N4FFQPLR.js";import"./chunk-AY64VY4E.js";import"./chunk-GJ2ZJFDD.js";import"./chunk-BFKYRQMA.js";import"./chunk-6QSSIT62.js";import"./chunk-3QIB5FXI.js";import"./chunk-6MI4KKWF.js";import"./chunk-DDMZSZFL.js";import"./chunk-W45RKGM6.js";import"./chunk-3VUATFZD.js";import"./chunk-4EPSHPZL.js";import"./chunk-H6IW2R22.js";import"./chunk-L3KS6MOV.js";import"./chunk-MQULU465.js";import"./chunk-PRGBLQVH.js";import"./chunk-7E6T7GP5.js";import"./chunk-DZUAT3TP.js";import"./chunk-XDQMGUWL.js";import"./chunk-FTEOCCPB.js";import{ia as ae,la as ie}from"./chunk-25MBPJVY.js";import"./chunk-WN3V6KDN.js";import"./chunk-523TE4BI.js";import"./chunk-ZCHXGRRU.js";import"./chunk-YR5ID2SS.js";import{c as re,d as oe,f as ne}from"./chunk-YBT2NB32.js";import{c as Y,g as ee}from"./chunk-74ZXXBGN.js";import"./chunk-APB2STJK.js";import"./chunk-I7AQMAQI.js";import"./chunk-Z4Z5UOZM.js";import"./chunk-6FA3GG5B.js";import"./chunk-Y4OWBBDD.js";import"./chunk-6ZFPQYHG.js";import"./chunk-JFXWI3EN.js";import{f as X}from"./chunk-FFRFSDBM.js";import"./chunk-VYLGI3IH.js";import{Cb as M}from"./chunk-ACYFMLWG.js";import{r as te}from"./chunk-TVQAPBLZ.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(me).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 he.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:de,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=ge.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:se.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 le({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 ue({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 pe({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 ce(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:fe.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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{b as a,c as b}from"./chunk-JYKRR7E5.js";import"./chunk-FUOEIDMA.js";import"./chunk-NHQ36THU.js";import"./chunk-VRIEKBBH.js";import"./chunk-QNG27G3T.js";import"./chunk-EIRYMSEG.js";import"./chunk-QOTVNQDI.js";import"./chunk-OQPJ7FJF.js";import"./chunk-WJ43MJ3F.js";import"./chunk-Q4TBTRIG.js";import"./chunk-T5AACNJI.js";import"./chunk-QOGJAQDO.js";import"./chunk-EYPCBBMS.js";import"./chunk-DIO5CB6U.js";import"./chunk-7ED24PP6.js";import"./chunk-RNIAFXMB.js";import"./chunk-2IHO4GDJ.js";import"./chunk-KCJVFLBB.js";import"./chunk-N4FFQPLR.js";import"./chunk-AY64VY4E.js";import"./chunk-GJ2ZJFDD.js";import"./chunk-6QSSIT62.js";import"./chunk-3QIB5FXI.js";import"./chunk-6MI4KKWF.js";import"./chunk-DDMZSZFL.js";import"./chunk-W45RKGM6.js";import"./chunk-3VUATFZD.js";import"./chunk-4EPSHPZL.js";import"./chunk-H6IW2R22.js";import"./chunk-L3KS6MOV.js";import"./chunk-MQULU465.js";import"./chunk-PRGBLQVH.js";import"./chunk-7E6T7GP5.js";import"./chunk-DZUAT3TP.js";import"./chunk-XDQMGUWL.js";import"./chunk-FTEOCCPB.js";import"./chunk-25MBPJVY.js";import"./chunk-WN3V6KDN.js";import"./chunk-523TE4BI.js";import"./chunk-ZCHXGRRU.js";import"./chunk-YBT2NB32.js";import"./chunk-74ZXXBGN.js";import"./chunk-APB2STJK.js";import"./chunk-I7AQMAQI.js";import"./chunk-Z4Z5UOZM.js";import"./chunk-6FA3GG5B.js";import"./chunk-Y4OWBBDD.js";import"./chunk-6ZFPQYHG.js";import"./chunk-JFXWI3EN.js";import"./chunk-FFRFSDBM.js";import"./chunk-VYLGI3IH.js";import"./chunk-ACYFMLWG.js";import"./chunk-TVQAPBLZ.js";import"./chunk-KGNCKIFP.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import"./chunk-FTQLQJQV.js";export{a as loadHostedHarnessRuntime,b as loadHostedHarnessRuntimeForSession};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{a,e as F}from"./chunk-HZEIRHEB.js";import{a as h}from"./chunk-OSIO7PLX.js";import{a as O}from"./chunk-HIOKCIL7.js";import{j as I,m as D,n as M}from"./chunk-QNG27G3T.js";import{z as w}from"./chunk-EIRYMSEG.js";import"./chunk-QOTVNQDI.js";import"./chunk-OQPJ7FJF.js";import"./chunk-WJ43MJ3F.js";import"./chunk-Q4TBTRIG.js";import"./chunk-T5AACNJI.js";import"./chunk-QOGJAQDO.js";import"./chunk-EYPCBBMS.js";import"./chunk-DIO5CB6U.js";import{a as A}from"./chunk-7ED24PP6.js";import"./chunk-RNIAFXMB.js";import"./chunk-2IHO4GDJ.js";import"./chunk-KCJVFLBB.js";import"./chunk-N4FFQPLR.js";import"./chunk-AY64VY4E.js";import"./chunk-GJ2ZJFDD.js";import"./chunk-6QSSIT62.js";import"./chunk-3QIB5FXI.js";import"./chunk-6MI4KKWF.js";import"./chunk-DDMZSZFL.js";import"./chunk-W45RKGM6.js";import"./chunk-3VUATFZD.js";import"./chunk-4EPSHPZL.js";import"./chunk-H6IW2R22.js";import"./chunk-L3KS6MOV.js";import"./chunk-MQULU465.js";import"./chunk-PRGBLQVH.js";import"./chunk-7E6T7GP5.js";import"./chunk-DZUAT3TP.js";import"./chunk-XDQMGUWL.js";import"./chunk-FTEOCCPB.js";import"./chunk-25MBPJVY.js";import"./chunk-WN3V6KDN.js";import"./chunk-523TE4BI.js";import"./chunk-ZCHXGRRU.js";import"./chunk-YBT2NB32.js";import"./chunk-74ZXXBGN.js";import"./chunk-APB2STJK.js";import"./chunk-I7AQMAQI.js";import"./chunk-Z4Z5UOZM.js";import"./chunk-6FA3GG5B.js";import"./chunk-Y4OWBBDD.js";import"./chunk-6ZFPQYHG.js";import"./chunk-JFXWI3EN.js";import"./chunk-FFRFSDBM.js";import"./chunk-VYLGI3IH.js";import"./chunk-ACYFMLWG.js";import{u as R}from"./chunk-TVQAPBLZ.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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d}from"./chunk-XTFPDQMH.js";import"./chunk-QNG27G3T.js";import"./chunk-EIRYMSEG.js";import"./chunk-7ED24PP6.js";import"./chunk-RNIAFXMB.js";import"./chunk-2IHO4GDJ.js";import"./chunk-KCJVFLBB.js";import"./chunk-N4FFQPLR.js";import"./chunk-AY64VY4E.js";import"./chunk-GJ2ZJFDD.js";import"./chunk-6QSSIT62.js";import"./chunk-H6IW2R22.js";import"./chunk-L3KS6MOV.js";import"./chunk-7E6T7GP5.js";import"./chunk-25MBPJVY.js";import"./chunk-WN3V6KDN.js";import"./chunk-523TE4BI.js";import"./chunk-ZCHXGRRU.js";import"./chunk-74ZXXBGN.js";import"./chunk-APB2STJK.js";import"./chunk-I7AQMAQI.js";import"./chunk-Z4Z5UOZM.js";import"./chunk-6FA3GG5B.js";import"./chunk-Y4OWBBDD.js";import"./chunk-6ZFPQYHG.js";import"./chunk-JFXWI3EN.js";import"./chunk-FFRFSDBM.js";import"./chunk-VYLGI3IH.js";import"./chunk-ACYFMLWG.js";import"./chunk-TVQAPBLZ.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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{a as m,b as c}from"./chunk-OPNRWESL.js";import{a as l}from"./chunk-O6ULLQJ6.js";import"./chunk-QOTVNQDI.js";import"./chunk-OQPJ7FJF.js";import{o as f}from"./chunk-WJ43MJ3F.js";import"./chunk-Q4TBTRIG.js";import"./chunk-T5AACNJI.js";import"./chunk-QOGJAQDO.js";import"./chunk-EYPCBBMS.js";import"./chunk-DIO5CB6U.js";import"./chunk-7ED24PP6.js";import"./chunk-N4FFQPLR.js";import"./chunk-AY64VY4E.js";import"./chunk-GJ2ZJFDD.js";import"./chunk-3QIB5FXI.js";import"./chunk-6MI4KKWF.js";import"./chunk-DDMZSZFL.js";import"./chunk-W45RKGM6.js";import"./chunk-3VUATFZD.js";import"./chunk-4EPSHPZL.js";import"./chunk-MQULU465.js";import"./chunk-PRGBLQVH.js";import"./chunk-7E6T7GP5.js";import"./chunk-DZUAT3TP.js";import"./chunk-XDQMGUWL.js";import"./chunk-FTEOCCPB.js";import"./chunk-25MBPJVY.js";import"./chunk-WN3V6KDN.js";import"./chunk-523TE4BI.js";import"./chunk-ZCHXGRRU.js";import"./chunk-YBT2NB32.js";import"./chunk-74ZXXBGN.js";import"./chunk-APB2STJK.js";import"./chunk-Z4Z5UOZM.js";import"./chunk-6FA3GG5B.js";import{Hb as s,Ob as u}from"./chunk-Y4OWBBDD.js";import"./chunk-6ZFPQYHG.js";import"./chunk-JFXWI3EN.js";import"./chunk-FFRFSDBM.js";import"./chunk-VYLGI3IH.js";import"./chunk-ACYFMLWG.js";import"./chunk-TVQAPBLZ.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};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{b as R,c as P}from"./chunk-2QUCCP6Z.js";import{a as E}from"./chunk-O6ULLQJ6.js";import{a as h}from"./chunk-QOTVNQDI.js";import"./chunk-OQPJ7FJF.js";import{o as v,p as S,q as w}from"./chunk-WJ43MJ3F.js";import"./chunk-Q4TBTRIG.js";import"./chunk-T5AACNJI.js";import"./chunk-QOGJAQDO.js";import"./chunk-EYPCBBMS.js";import{b as y}from"./chunk-DIO5CB6U.js";import"./chunk-7ED24PP6.js";import"./chunk-N4FFQPLR.js";import"./chunk-AY64VY4E.js";import"./chunk-GJ2ZJFDD.js";import"./chunk-3QIB5FXI.js";import"./chunk-6MI4KKWF.js";import"./chunk-DDMZSZFL.js";import"./chunk-W45RKGM6.js";import"./chunk-3VUATFZD.js";import"./chunk-4EPSHPZL.js";import"./chunk-MQULU465.js";import"./chunk-PRGBLQVH.js";import"./chunk-7E6T7GP5.js";import"./chunk-DZUAT3TP.js";import"./chunk-XDQMGUWL.js";import"./chunk-FTEOCCPB.js";import"./chunk-25MBPJVY.js";import"./chunk-WN3V6KDN.js";import"./chunk-523TE4BI.js";import"./chunk-ZCHXGRRU.js";import"./chunk-YBT2NB32.js";import"./chunk-74ZXXBGN.js";import"./chunk-APB2STJK.js";import"./chunk-Z4Z5UOZM.js";import"./chunk-6FA3GG5B.js";import{f as g}from"./chunk-Y4OWBBDD.js";import"./chunk-6ZFPQYHG.js";import"./chunk-JFXWI3EN.js";import"./chunk-FFRFSDBM.js";import"./chunk-VYLGI3IH.js";import{w as m}from"./chunk-ACYFMLWG.js";import"./chunk-TVQAPBLZ.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-76BTRTYD.js")).controlHostedProfileEvaluation(r):await x(r);process.stdout.write(`${JSON.stringify(u)}
|
|
3
|
+
`)}n(B,"runHostedProfileInspectionCli");export{x as inspectHostedProfileEvaluation,B as runHostedProfileInspectionCli};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{c as I,f as j,h as D}from"./chunk-3Z47M3YY.js";import{b as x}from"./chunk-ABD5M2D2.js";import"./chunk-TRQQNFMO.js";import"./chunk-FEAKTSRS.js";import{a as E}from"./chunk-OSIO7PLX.js";import"./chunk-F74GBN6K.js";import"./chunk-SDAUS5PY.js";import"./chunk-I2NXNMRZ.js";import"./chunk-O72BSKSO.js";import{a as V}from"./chunk-XTFPDQMH.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-DBK66CJP.js";import"./chunk-FUOEIDMA.js";import"./chunk-NHQ36THU.js";import"./chunk-VRIEKBBH.js";import{m as C}from"./chunk-QNG27G3T.js";import"./chunk-EIRYMSEG.js";import"./chunk-QOTVNQDI.js";import"./chunk-OQPJ7FJF.js";import"./chunk-WJ43MJ3F.js";import"./chunk-Q4TBTRIG.js";import"./chunk-T5AACNJI.js";import"./chunk-QOGJAQDO.js";import"./chunk-EYPCBBMS.js";import"./chunk-DIO5CB6U.js";import"./chunk-7ED24PP6.js";import"./chunk-RNIAFXMB.js";import{a as b}from"./chunk-2IHO4GDJ.js";import"./chunk-KCJVFLBB.js";import"./chunk-N4FFQPLR.js";import"./chunk-AY64VY4E.js";import"./chunk-GJ2ZJFDD.js";import"./chunk-6QSSIT62.js";import"./chunk-3QIB5FXI.js";import"./chunk-6MI4KKWF.js";import"./chunk-DDMZSZFL.js";import"./chunk-W45RKGM6.js";import{e as m}from"./chunk-3VUATFZD.js";import"./chunk-4EPSHPZL.js";import"./chunk-H6IW2R22.js";import"./chunk-L3KS6MOV.js";import"./chunk-MQULU465.js";import"./chunk-PRGBLQVH.js";import"./chunk-7E6T7GP5.js";import"./chunk-DZUAT3TP.js";import"./chunk-XDQMGUWL.js";import"./chunk-FTEOCCPB.js";import{la as S}from"./chunk-25MBPJVY.js";import"./chunk-WN3V6KDN.js";import"./chunk-523TE4BI.js";import"./chunk-ZCHXGRRU.js";import"./chunk-YBT2NB32.js";import"./chunk-74ZXXBGN.js";import"./chunk-APB2STJK.js";import"./chunk-I7AQMAQI.js";import"./chunk-Z4Z5UOZM.js";import"./chunk-6FA3GG5B.js";import"./chunk-Y4OWBBDD.js";import"./chunk-6ZFPQYHG.js";import"./chunk-JFXWI3EN.js";import"./chunk-FFRFSDBM.js";import"./chunk-VYLGI3IH.js";import{Pa as H,f as y}from"./chunk-ACYFMLWG.js";import{e as P,i as R}from"./chunk-TVQAPBLZ.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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{v as h}from"./chunk-BLXEAZCQ.js";import"./chunk-SYUKES6H.js";import"./chunk-HIOKCIL7.js";import"./chunk-UKMA4R6X.js";import"./chunk-GPVCOEUH.js";import"./chunk-OQPJ7FJF.js";import"./chunk-EYPCBBMS.js";import"./chunk-BFKYRQMA.js";import"./chunk-6QSSIT62.js";import"./chunk-3QIB5FXI.js";import"./chunk-3VUATFZD.js";import"./chunk-4EPSHPZL.js";import"./chunk-XDQMGUWL.js";import"./chunk-FTEOCCPB.js";import"./chunk-25MBPJVY.js";import"./chunk-WN3V6KDN.js";import"./chunk-523TE4BI.js";import"./chunk-ZCHXGRRU.js";import"./chunk-QDC4OW3S.js";import"./chunk-ZZWAQBA2.js";import"./chunk-YR5ID2SS.js";import"./chunk-YBT2NB32.js";import"./chunk-APB2STJK.js";import"./chunk-I7AQMAQI.js";import"./chunk-Z4Z5UOZM.js";import"./chunk-6FA3GG5B.js";import"./chunk-Y4OWBBDD.js";import"./chunk-6ZFPQYHG.js";import"./chunk-JFXWI3EN.js";import"./chunk-FFRFSDBM.js";import"./chunk-VYLGI3IH.js";import"./chunk-ACYFMLWG.js";import"./chunk-TVQAPBLZ.js";import"./chunk-KGNCKIFP.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import{a as r}from"./chunk-FTQLQJQV.js";import{createHash as p}from"node:crypto";import{setTimeout as b}from"node:timers/promises";async function T(e){if(e.signal.throwIfAborted(),!e.turnId.trim()||!e.callId.trim())throw new Error("Hosted Taskset actions require their originating turn and tool call.");let s=y(e.session.metadata?.hostConversationId),l=y(e.session.metadata?.hostSandboxId);if(e.session.workspaceKind!=="sandbox"||!l||e.session.workspaceId!==l||!s)throw new Error("Hosted Taskset actions require the bound Work workspace.");if(e.action==="answer_questions")throw new Error("Hosted Taskset authoring has no separate question queue. Revise with the complete buildSpecification.");if(e.action==="revise"&&!e.payload.buildSpecification)throw new Error("Hosted Taskset revisions require the complete buildSpecification.");let g=I(e.payload.sourceReferenceIds??e.payload.sourceIds),u=k({action:e.action,clientRequestId:w(e),creationId:e.payload.creationId,tasksetId:e.payload.tasksetId,objective:e.payload.objective,buildIntent:e.payload.buildIntent,buildSpecification:e.payload.buildSpecification,sourceReferenceIds:g,methodHint:e.payload.methodHint,approved:e.payload.approved,split:e.payload.split,taskLimit:e.payload.taskLimit,attemptsPerTask:e.payload.attemptsPerTask,maximumSpendUsd:e.payload.maximumSpendUsd,message:e.payload.message,answers:e.payload.answers}),f=e.request??h,n=["audit_graders","calibrate_judges","baseline","readiness"].includes(e.action),o=n?AbortSignal.any([e.signal,AbortSignal.timeout(900*1e3)]):e.signal,c=null;try{for(;;){o.throwIfAborted();let a=await f({path:"/hosted-tasksets/actions",method:"POST",body:u,signal:o,...n?{timeoutMs:3e4}:{}});o.throwIfAborted();let t=a.result;if(!n||!t||typeof t!="object"||Array.isArray(t)||!("schemaVersion"in t)||t.schemaVersion!=="openpond.hostedTasksetOperation.v1")return a;let m="status"in t?t.status:null,i="id"in t?t.id:null,d="retryAfterMs"in t?t.retryAfterMs:null;if(m!=="queued"&&m!=="running"||typeof i!="string"||!i||typeof d!="number"||!Number.isFinite(d)||d<1)throw new Error("Hosted Taskset check returned an invalid operation status.");if(c!==null&&c!==i)throw new Error("Hosted Taskset check operation identity changed while polling.");c=i,await b(Math.min(d,5e3),void 0,{signal:o})}}catch(a){throw n&&o.aborted&&(await f({path:"/hosted-tasksets/actions",method:"POST",body:{...u,cancelCheck:!0},timeoutMs:1e4,signal:AbortSignal.timeout(1e4)}).catch(()=>{}),o.throwIfAborted()),a}}r(T,"executeHostedTasksetAction");function w(e){let s=p("sha256").update(JSON.stringify([e.session.id,e.turnId,e.callId])).digest("hex").slice(0,32);return`${e.session.id}:${s}`.slice(0,191)}r(w,"actionRequestId");function k(e){return Object.fromEntries(Object.entries(e).filter(([,s])=>s!==void 0))}r(k,"compact");function y(e){return typeof e=="string"&&e.trim()?e.trim():null}r(y,"stringValue");function I(e){return Array.isArray(e)&&e.every(s=>typeof s=="string")?e:void 0}r(I,"stringArray");export{T as executeHostedTasksetAction};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import"./chunk-RAXOSUSW.js";import{c as I}from"./chunk-DARVPBZ4.js";import{a as E,c as S}from"./chunk-NPOHW5OU.js";import"./chunk-M4JWQSV7.js";import"./chunk-FV2R5RUN.js";import{c as x,f as y}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{c as n}from"./chunk-3M53YXEI.js";import"./chunk-5MCNZCVQ.js";import"./chunk-BT5YNE5U.js";import{s as R}from"./chunk-Q5LEXXJG.js";import"./chunk-FWIPHEVA.js";import{d as g}from"./chunk-OS3LO5J3.js";import{b}from"./chunk-GLUWATL5.js";import"./chunk-QDC4OW3S.js";import"./chunk-ZZWAQBA2.js";import"./chunk-YR5ID2SS.js";import{a as v}from"./chunk-YBT2NB32.js";import"./chunk-74ZXXBGN.js";import"./chunk-APB2STJK.js";import"./chunk-I7AQMAQI.js";import"./chunk-Z4Z5UOZM.js";import"./chunk-Y4OWBBDD.js";import"./chunk-6ZFPQYHG.js";import"./chunk-JFXWI3EN.js";import"./chunk-FFRFSDBM.js";import"./chunk-VYLGI3IH.js";import{U as w,V as f,ca as p,da as h}from"./chunk-ACYFMLWG.js";import"./chunk-TVQAPBLZ.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};
|