openpond 0.2.55 → 0.2.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app-server.d.ts +10545 -10254
- package/dist/app-server.js +1 -1
- package/dist/chunks/actions-command-QU4H53OG.js +2 -0
- package/dist/chunks/{app-layer-Y2UERCPY.js → app-layer-NSTE5HIT.js} +1 -1
- package/dist/chunks/app-server-connected-apps-JHGWLBXT.js +2 -0
- package/dist/chunks/app-server-evaluations-GJPFWIDA.js +2 -0
- package/dist/chunks/app-server-harness-services-IH4G6POY.js +2 -0
- package/dist/chunks/app-server-runtime-DVKOZ5B6.js +2 -0
- package/dist/chunks/apps-BKTOR4F7.js +2 -0
- package/dist/chunks/chunk-25MBPJVY.js +2 -0
- package/dist/chunks/chunk-2D4Y3HNW.js +2 -0
- package/dist/chunks/chunk-2IHO4GDJ.js +2 -0
- package/dist/chunks/chunk-2QUCCP6Z.js +2 -0
- package/dist/chunks/chunk-3K4VVB7S.js +6 -0
- package/dist/chunks/chunk-3QIB5FXI.js +10 -0
- package/dist/chunks/chunk-3RCRSMWZ.js +17 -0
- package/dist/chunks/chunk-3VUATFZD.js +2 -0
- package/dist/chunks/chunk-3Z47M3YY.js +2 -0
- package/dist/chunks/{chunk-UA5DA5I2.js → chunk-4D7HWVWD.js} +1 -1
- package/dist/chunks/chunk-4EPSHPZL.js +2 -0
- package/dist/chunks/chunk-4NESNOK5.js +2 -0
- package/dist/chunks/chunk-523TE4BI.js +2 -0
- package/dist/chunks/{chunk-B7QDZPNX.js → chunk-5MCNZCVQ.js} +1 -1
- package/dist/chunks/{chunk-DLVPSCTB.js → chunk-6QSSIT62.js} +1 -1
- package/dist/chunks/chunk-6ZFPQYHG.js +2 -0
- package/dist/chunks/chunk-74IIXVAE.js +2 -0
- package/dist/chunks/chunk-74ZXXBGN.js +6 -0
- package/dist/chunks/chunk-773TH7FN.js +2 -0
- package/dist/chunks/chunk-7E6T7GP5.js +2 -0
- package/dist/chunks/chunk-7ED24PP6.js +2 -0
- package/dist/chunks/chunk-7HPDGZOR.js +86 -0
- package/dist/chunks/chunk-7KWD2I6W.js +2 -0
- package/dist/chunks/chunk-7PXZ4X4P.js +2 -0
- package/dist/chunks/chunk-A6USMRWK.js +2 -0
- package/dist/chunks/chunk-ABD5M2D2.js +2 -0
- package/dist/chunks/chunk-ACYFMLWG.js +10 -0
- package/dist/chunks/chunk-AN525SPP.js +6 -0
- package/dist/chunks/chunk-APB2STJK.js +2 -0
- package/dist/chunks/chunk-AY64VY4E.js +2 -0
- package/dist/chunks/{chunk-G6JMQGX7.js → chunk-B7RFL4N2.js} +1 -1
- package/dist/chunks/chunk-BLXEAZCQ.js +12 -0
- package/dist/chunks/chunk-D74JEERO.js +5 -0
- package/dist/chunks/{chunk-U2YMBCX7.js → chunk-DARVPBZ4.js} +1 -1
- package/dist/chunks/chunk-DBK66CJP.js +8 -0
- package/dist/chunks/chunk-DDMZSZFL.js +1 -0
- package/dist/chunks/chunk-DIO5CB6U.js +2 -0
- package/dist/chunks/chunk-DMFUEUAZ.js +5 -0
- package/dist/chunks/chunk-DMVD2RFZ.js +2 -0
- package/dist/chunks/chunk-DUURYZOI.js +2 -0
- package/dist/chunks/chunk-DZUAT3TP.js +1 -0
- package/dist/chunks/chunk-EIEZHFIW.js +6 -0
- package/dist/chunks/chunk-EIRYMSEG.js +19 -0
- package/dist/chunks/{chunk-R27YGT77.js → chunk-EKM2D7JU.js} +1 -1
- package/dist/chunks/chunk-EQFGBL3O.js +2 -0
- package/dist/chunks/chunk-EYPCBBMS.js +2 -0
- package/dist/chunks/chunk-F4KOGISR.js +10 -0
- package/dist/chunks/chunk-F74GBN6K.js +2 -0
- package/dist/chunks/chunk-FEAKTSRS.js +2 -0
- package/dist/chunks/chunk-FFRFSDBM.js +2 -0
- package/dist/chunks/chunk-FTEOCCPB.js +23 -0
- package/dist/chunks/chunk-FUOEIDMA.js +8 -0
- package/dist/chunks/{chunk-BQAF5P7K.js → chunk-FV2R5RUN.js} +2 -2
- package/dist/chunks/chunk-FWIPHEVA.js +12 -0
- package/dist/chunks/chunk-FY5KHLMW.js +2 -0
- package/dist/chunks/chunk-G3RXYI2L.js +6 -0
- package/dist/chunks/chunk-GJ2ZJFDD.js +2 -0
- package/dist/chunks/chunk-GLDYJM7O.js +1 -0
- package/dist/chunks/chunk-GPVCOEUH.js +2 -0
- package/dist/chunks/chunk-GW766ZSO.js +5 -0
- package/dist/chunks/chunk-GWCHDF2C.js +4 -0
- package/dist/chunks/chunk-GZ7M5XBP.js +2 -0
- package/dist/chunks/chunk-H6IW2R22.js +140 -0
- package/dist/chunks/chunk-HCYX6RHP.js +2 -0
- package/dist/chunks/chunk-HDL5YSAA.js +2 -0
- package/dist/chunks/chunk-HIOKCIL7.js +2 -0
- package/dist/chunks/{chunk-IODUCRBA.js → chunk-HY3GOBFJ.js} +1 -1
- package/dist/chunks/chunk-HZEIRHEB.js +2 -0
- package/dist/chunks/chunk-I2NXNMRZ.js +2 -0
- package/dist/chunks/chunk-I7AQMAQI.js +33 -0
- package/dist/chunks/chunk-IZ6DLEVY.js +2 -0
- package/dist/chunks/chunk-J2TWKFML.js +1871 -0
- package/dist/chunks/chunk-JDEEWOD7.js +2 -0
- package/dist/chunks/chunk-JFXWI3EN.js +6 -0
- package/dist/chunks/chunk-JYKRR7E5.js +5 -0
- package/dist/chunks/chunk-KCJVFLBB.js +2 -0
- package/dist/chunks/{chunk-5CMKGD43.js → chunk-KG325WTN.js} +1 -1
- package/dist/chunks/chunk-KUERKVEU.js +3 -0
- package/dist/chunks/chunk-KVTBX2UP.js +2 -0
- package/dist/chunks/chunk-L3KS6MOV.js +2 -0
- package/dist/chunks/chunk-L6K7ERG5.js +2 -0
- package/dist/chunks/{chunk-MH3LHSGX.js → chunk-LQQNBVEB.js} +1 -1
- package/dist/chunks/{chunk-BTI4N7YO.js → chunk-M4JWQSV7.js} +1 -1
- package/dist/chunks/chunk-MQULU465.js +2 -0
- package/dist/chunks/chunk-N4FFQPLR.js +2 -0
- package/dist/chunks/chunk-N73MU2C3.js +2 -0
- package/dist/chunks/chunk-NHQ36THU.js +3 -0
- package/dist/chunks/chunk-O6ULLQJ6.js +2 -0
- package/dist/chunks/chunk-O72BSKSO.js +2 -0
- package/dist/chunks/chunk-OGDADQGH.js +143 -0
- package/dist/chunks/chunk-OIUTWU6K.js +2 -0
- package/dist/chunks/chunk-OLLLZVHF.js +2 -0
- package/dist/chunks/chunk-OPNRWESL.js +3 -0
- package/dist/chunks/chunk-OQKJGTTO.js +4 -0
- package/dist/chunks/chunk-OQPJ7FJF.js +9 -0
- package/dist/chunks/{chunk-TERVLCRG.js → chunk-OS3LO5J3.js} +1 -1
- package/dist/chunks/chunk-OUVIWDL2.js +2 -0
- package/dist/chunks/chunk-PCSIOUHF.js +7 -0
- package/dist/chunks/chunk-PF5R6CMP.js +21 -0
- package/dist/chunks/chunk-PPAPVGJP.js +3 -0
- package/dist/chunks/chunk-PRGBLQVH.js +2 -0
- package/dist/chunks/chunk-PSGGOZFM.js +2 -0
- package/dist/chunks/chunk-PUZQU66L.js +2 -0
- package/dist/chunks/{chunk-NOTXPD2T.js → chunk-Q2QL6UWN.js} +1 -1
- package/dist/chunks/chunk-Q4TBTRIG.js +2 -0
- package/dist/chunks/chunk-Q5LEXXJG.js +16 -0
- package/dist/chunks/chunk-QDC4OW3S.js +2 -0
- package/dist/chunks/chunk-QEFHOJFE.js +7 -0
- package/dist/chunks/chunk-QHWGQ3A4.js +5 -0
- package/dist/chunks/chunk-QIKWJ2AA.js +11 -0
- package/dist/chunks/chunk-QNG27G3T.js +6 -0
- package/dist/chunks/chunk-QOGJAQDO.js +3 -0
- package/dist/chunks/chunk-QOTVNQDI.js +4 -0
- package/dist/chunks/{chunk-NNIRIUSY.js → chunk-RAXOSUSW.js} +1 -1
- package/dist/chunks/chunk-RNIAFXMB.js +50 -0
- package/dist/chunks/{chunk-SHQOIROR.js → chunk-S5ESN275.js} +3 -3
- package/dist/chunks/chunk-SDAUS5PY.js +2 -0
- package/dist/chunks/chunk-SDXFLO7J.js +5 -0
- package/dist/chunks/chunk-SH5CBAFC.js +2 -0
- package/dist/chunks/chunk-SWUEFLOH.js +2 -0
- package/dist/chunks/chunk-SYUKES6H.js +3 -0
- package/dist/chunks/chunk-T5AACNJI.js +2 -0
- package/dist/chunks/chunk-TRQQNFMO.js +4 -0
- package/dist/chunks/chunk-TVQAPBLZ.js +2 -0
- package/dist/chunks/chunk-UCPGRPWY.js +2 -0
- package/dist/chunks/chunk-UGL7WF3W.js +2 -0
- package/dist/chunks/chunk-UHFZHBGW.js +2 -0
- package/dist/chunks/{chunk-C6D4WAYN.js → chunk-UKMA4R6X.js} +2 -2
- package/dist/chunks/{chunk-4WEUCGJ3.js → chunk-VRIEKBBH.js} +1 -1
- package/dist/chunks/chunk-VYLGI3IH.js +13 -0
- package/dist/chunks/chunk-W45RKGM6.js +1 -0
- package/dist/chunks/chunk-WJ43MJ3F.js +2 -0
- package/dist/chunks/chunk-WMKYHXVM.js +3 -0
- package/dist/chunks/chunk-WN3V6KDN.js +3 -0
- package/dist/chunks/chunk-X4OSOOSU.js +3 -0
- package/dist/chunks/chunk-XDQMGUWL.js +2 -0
- package/dist/chunks/chunk-XTFPDQMH.js +3 -0
- package/dist/chunks/chunk-XVDFJ3ZF.js +2 -0
- package/dist/chunks/chunk-XW6HGSIT.js +8 -0
- package/dist/chunks/chunk-XXYGGNVM.js +2 -0
- package/dist/chunks/chunk-Y4OWBBDD.js +184 -0
- package/dist/chunks/chunk-YBT2NB32.js +2 -0
- package/dist/chunks/chunk-YCJO3YVD.js +10 -0
- package/dist/chunks/{chunk-QRAKXZOC.js → chunk-YOBN7KTF.js} +6 -6
- package/dist/chunks/chunk-YOQRYNLP.js +2 -0
- package/dist/chunks/chunk-YY7LEQGP.js +2 -0
- package/dist/chunks/chunk-Z4Z5UOZM.js +22 -0
- package/dist/chunks/chunk-Z54O534A.js +3 -0
- package/dist/chunks/chunk-ZCHXGRRU.js +2 -0
- package/dist/chunks/chunk-ZFSHBFG5.js +40 -0
- package/dist/chunks/chunk-ZGTOK7ZK.js +12 -0
- package/dist/chunks/{chunk-Q7AXHFZV.js → chunk-ZRDGQDZL.js} +1 -1
- package/dist/chunks/chunk-ZUJ3XUCP.js +2 -0
- package/dist/chunks/chunk-ZZWAQBA2.js +2 -0
- package/dist/chunks/cli-X25RSO2X.js +2 -0
- package/dist/chunks/configuration-command-6C5UO7GE.js +2 -0
- package/dist/chunks/connected-app-executor-IVLGQP65.js +2 -0
- package/dist/chunks/connected-evidence-GH2ATNEX.js +2 -0
- package/dist/chunks/connection-HTF6CC7M.js +2 -0
- package/dist/chunks/{continual-TTGJ6YTR.js → continual-6CQAMTTR.js} +3 -3
- package/dist/chunks/core-commands-A2DGGIPS.js +2 -0
- package/dist/chunks/datasets-7BNMVJOY.js +2 -0
- package/dist/chunks/desktop-test-3CUHVLXV.js +3 -0
- package/dist/chunks/dist-OMGUJYPD.js +2 -0
- package/dist/chunks/dist-VYC5VMQB.js +2 -0
- package/dist/chunks/{dist-FAJX2UBW.js → dist-ZVJPJLXR.js} +1 -1
- package/dist/chunks/enclave-QS4BUNDU.js +2 -0
- package/dist/chunks/evaluation-coordination-XEF5L7KZ.js +2 -0
- package/dist/chunks/experiment-improvements-KRX2DP27.js +2 -0
- package/dist/chunks/experiments-DFGQYA4O.js +2 -0
- package/dist/chunks/experiments-VFQGE4HC.js +2 -0
- package/dist/chunks/{extension-DWMY6D2R.js → extension-XKXXOP5N.js} +1 -1
- package/dist/chunks/{help-A72QDRNG.js → help-S7THC6IE.js} +1 -1
- package/dist/chunks/host-profile-evaluation-tools-JJQWJUBT.js +2 -0
- package/dist/chunks/host-profile-external-dataset-K3ICDHIP.js +2 -0
- package/dist/chunks/hosted-app-server-composition-BCOO5ANF.js +2 -0
- package/dist/chunks/hosted-experiment-improvement-NFSVS5TU.js +3 -0
- package/dist/chunks/hosted-harness-runtime-723S5ZSH.js +2 -0
- package/dist/chunks/hosted-profile-candidate-2S5LFUWD.js +3 -0
- package/dist/chunks/hosted-profile-compiler-2DQIFSXW.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-control-76BTRTYD.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-inspection-V6Z3A5XJ.js +3 -0
- package/dist/chunks/hosted-profile-evaluation-preparation-IDJYREW3.js +3 -0
- package/dist/chunks/hosted-tasksets-ANAE2PIW.js +2 -0
- package/dist/chunks/human-review-WR777ODH.js +2 -0
- package/dist/chunks/import-MLZUHITH.js +4 -0
- package/dist/chunks/learning-ACEVFL5M.js +2 -0
- package/dist/chunks/local-harness-improvement-runtime-JIQ6ZVDW.js +2 -0
- package/dist/chunks/local-harness-taskset-review-XVYTGAGK.js +2 -0
- package/dist/chunks/local-scope-HVF2GZ5W.js +2 -0
- package/dist/chunks/model-projects-QPO22JPA.js +2 -0
- package/dist/chunks/opchat-T4QTNEIY.js +3 -0
- package/dist/chunks/organizations-75L5DZDV.js +2 -0
- package/dist/chunks/{profile-NOZ6TVXL.js → profile-TFZMUEDR.js} +1 -1
- package/dist/chunks/profile-training-source-6GOT7AHM.js +2 -0
- package/dist/chunks/project-action-payload-7VGL7OER.js +2 -0
- package/dist/chunks/project-agent-6RRO233B.js +2 -0
- package/dist/chunks/published-experiment-source-DZFENAQA.js +2 -0
- package/dist/chunks/refiner-profile-service-UUIWFJVT.js +2 -0
- package/dist/chunks/runtime-A7OZXM43.js +6 -0
- package/dist/chunks/sandbox-command-IU5XFTJP.js +2 -0
- package/dist/chunks/{sandbox-template-LKGBDVJ4.js → sandbox-template-C4V6T36U.js} +1 -1
- package/dist/chunks/saved-work-6BMBFP43.js +2 -0
- package/dist/chunks/send-turn-XTAIS2JN.js +2 -0
- package/dist/chunks/src-CJM6HY5Y.js +326 -0
- package/dist/chunks/{src-ZWJ5IO7A.js → src-LMC3K6LH.js} +1 -1
- package/dist/chunks/standalone-experiment-turn-owner-JCY5LL5R.js +2 -0
- package/dist/chunks/store-chat-workflows-S72HZXQR.js +18 -0
- package/dist/chunks/store-continual-support-reviews-HHA6NX7K.js +7 -0
- package/dist/chunks/store-conversation-serving-KPC62UEY.js +2 -0
- package/dist/chunks/store-create-improve-QV54XIZW.js +40 -0
- package/dist/chunks/store-datasets-RXJ33SUN.js +86 -0
- package/dist/chunks/store-evaluation-results-3F3P527G.js +7 -0
- package/dist/chunks/store-harness-evaluation-review-settings-I2R3HPO3.js +29 -0
- package/dist/chunks/store-harness-memory-VINCZ4GK.js +17 -0
- package/dist/chunks/store-harness-refinement-candidates-EA5KFQPH.js +21 -0
- package/dist/chunks/store-harness-workspaces-XUM4Z66X.js +2 -0
- package/dist/chunks/store-human-review-RAH7WMIP.js +7 -0
- package/dist/chunks/store-learned-preference-migration-validation-4CI2IRUF.js +2 -0
- package/dist/chunks/store-learning-WLG6KFIO.js +2 -0
- package/dist/chunks/store-learning-credentials-WZQJ4HPJ.js +2 -0
- package/dist/chunks/store-local-experiments-5LUJR7GI.js +97 -0
- package/dist/chunks/store-model-batch-review-YEGX327M.js +2 -0
- package/dist/chunks/store-model-configuration-5ZURQATB.js +3 -0
- package/dist/chunks/store-preference-comparison-LV32MHVL.js +6 -0
- package/dist/chunks/store-schedules-VGTEQVKH.js +53 -0
- package/dist/chunks/store-sidebar-file-bookmarks-VB5GTLFY.js +18 -0
- package/dist/chunks/store-sidebar-preferences-GWIOG2NH.js +16 -0
- package/dist/chunks/store-subagents-T7R2Z6TB.js +67 -0
- package/dist/chunks/store-task-inbox-JJTBW76C.js +33 -0
- package/dist/chunks/store-task-inventory-OB3F2APC.js +10 -0
- package/dist/chunks/store-taskset-drafts-EKQWWFYQ.js +9 -0
- package/dist/chunks/store-training-G6YLFSIR.js +70 -0
- package/dist/chunks/store-training-jobs-RC46YBF6.js +19 -0
- package/dist/chunks/store-training-models-6BA43IPP.js +49 -0
- package/dist/chunks/store-usage-IE2U2FD3.js +63 -0
- package/dist/chunks/store-work-evidence-QQDKM5AQ.js +8 -0
- package/dist/chunks/taskset-EQRFQBYM.js +2 -0
- package/dist/chunks/taskset-packages-XC6HEE3K.js +2 -0
- package/dist/chunks/{teams-bot-H7XT23XB.js → teams-bot-EAPGPTHZ.js} +1 -1
- package/dist/chunks/training-UF6RPI4T.js +2 -0
- package/dist/chunks/web-search-CZ3NCLPY.js +2 -0
- package/dist/chunks/workspaces-EKKE5NAC.js +2 -0
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/web/assets/{App-CTlAPuCY.css → App-CaRMZoxo.css} +1 -1
- package/dist/web/assets/App-s-CJswyt.js +154 -0
- package/dist/web/assets/{AppDialog-CPHTPqrx.js → AppDialog-t2Fx5tK3.js} +1 -1
- package/dist/web/assets/{AppTerminalPanel-BVj5Tj93.js → AppTerminalPanel-Dj1Y32oI.js} +2 -2
- package/dist/web/assets/{AppsView-O69zEBY3.js → AppsView-BYE5EBDJ.js} +1 -1
- package/dist/web/assets/{BrowserSidebar-Pr_Kpe8p.js → BrowserSidebar-jhWi4rVm.js} +1 -1
- package/dist/web/assets/{CartesianChart-JPqo6YOf.js → CartesianChart-C1DIx0Ia.js} +1 -1
- package/dist/web/assets/{CollaborationTabs-CAJcQFn2.js → CollaborationTabs-Bdr-HmOL.js} +1 -1
- package/dist/web/assets/{CommandMenu-B-w53n9A.js → CommandMenu-Ux2yOHAc.js} +1 -1
- package/dist/web/assets/{CommunityView-DbZKK8_P.js → CommunityView-DPEeVKFn.js} +1 -1
- package/dist/web/assets/{ComposerCreateImproveStrip-3_083PF4.js → ComposerCreateImproveStrip-CEgh4OtN.js} +1 -1
- package/dist/web/assets/{GetStartedView-D7JGm_6c.js → GetStartedView-CFHP0AaI.js} +1 -1
- package/dist/web/assets/{HostedModelLearningReview-DwgMfZ7_.js → HostedModelLearningReview-D8BGTPVN.js} +1 -1
- package/dist/web/assets/{HostedModelLearningSettings-JRfQadRl.js → HostedModelLearningSettings-JS1S7vNO.js} +1 -1
- package/dist/web/assets/{LabModelVersionDetailPage-BUYflJY_.js → LabModelVersionDetailPage-Dx5Q3xV2.js} +1 -1
- package/dist/web/assets/{LabSkillSidebar-BBiqk7Rf.js → LabSkillSidebar-BxffN-pN.js} +1 -1
- package/dist/web/assets/{LabsRoute-Ci6vUnSd.js → LabsRoute-CyYF8-dw.js} +4 -4
- package/dist/web/assets/{MainChatThread-BQK3oI2N.js → MainChatThread-DZpcFRFl.js} +2 -2
- package/dist/web/assets/MainPane-5DTtwVCk.js +65 -0
- package/dist/web/assets/MainPane-BIM_UJ3q.css +1 -0
- package/dist/web/assets/{MarkdownText-DOdOVFXL.js → MarkdownText-BR4V6lNO.js} +21 -21
- package/dist/web/assets/{NativeSkillSidebar-CRI_ri8z.js → NativeSkillSidebar-DU9IEgIO.js} +1 -1
- package/dist/web/assets/{NewExperienceSwitcher-DhYtfE68.js → NewExperienceSwitcher-mIy6FzCj.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-D8sy1gOz.js → NewProjectDialog-RfTZTHxl.js} +1 -1
- package/dist/web/assets/{OutputsPage-CbWgrhXA.js → OutputsPage-Cr1Spf7S.js} +1 -1
- package/dist/web/assets/{ProjectsPage-DLB67lyA.js → ProjectsPage-CE6QUB-b.js} +1 -1
- package/dist/web/assets/{RightChatPanelStack-ozSKnDyX.js → RightChatPanelStack-T6VRWuHo.js} +1 -1
- package/dist/web/assets/RightSidebarHomePanel-CK0rP3WT.js +1 -0
- package/dist/web/assets/{ScheduledWorkPage-Cafv_QnR.js → ScheduledWorkPage-vOrYv8pp.js} +1 -1
- package/dist/web/assets/SettingsView-DCKVrfjj.js +5 -0
- package/dist/web/assets/SettingsView-Dulr_xlq.css +1 -0
- package/dist/web/assets/{TeamChatView-vIrmXOY_.js → TeamChatView-Bwrjr-vk.js} +2 -2
- package/dist/web/assets/{TerminalOverlay-CAmF__Dq.js → TerminalOverlay-DhPoKZAq.js} +1 -1
- package/dist/web/assets/TrainingCreationPanel-BXHfohNm.js +1 -0
- package/dist/web/assets/{TrainingDraftPanel-D7XZePAk.js → TrainingDraftPanel-C9cRX5qf.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-CYTmp7PG.js → UsageSettingsSection-CrdcSGeW.js} +1 -1
- package/dist/web/assets/WorkSidebarPanel-DSSikNFQ.js +1 -0
- package/dist/web/assets/{WorkspaceDiffPanel-DQGoIjH9.js → WorkspaceDiffPanel-BAFo0CPN.js} +6 -6
- package/dist/web/assets/{WorkspaceEnvironmentMenu-c1pHDskn.js → WorkspaceEnvironmentMenu-BVHAhwnJ.js} +1 -1
- package/dist/web/assets/WorkspaceGitDialogs-CwVoiDQ2.js +1 -0
- package/dist/web/assets/{WorkspaceMonacoEditor-BCKzvSj2.js → WorkspaceMonacoEditor-TxLyhzNp.js} +3 -3
- package/dist/web/assets/{arrow-up-right-CP4hZdrJ.js → arrow-up-right-C9aE8Mfz.js} +1 -1
- package/dist/web/assets/{chunk-NOJECMB7-Bhcms-w5.js → chunk-P3BRSSRD-DUGfuKA8.js} +1 -1
- package/dist/web/assets/{clipboard-BgrXorn-.js → clipboard-Dk158Qp4.js} +1 -1
- package/dist/web/assets/{cloud-upload-B_zYztb6.js → cloud-upload-k9eqBsHr.js} +1 -1
- package/dist/web/assets/{cssMode-DanjGgA8.js → cssMode-CO35ARZp.js} +1 -1
- package/dist/web/assets/{folder-open-CdVKbtGq.js → folder-open-sYgceW_f.js} +1 -1
- package/dist/web/assets/{folder-plus-Cc5KElB6.js → folder-plus-CS0R49m9.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-CjGIIgRi.js → git-commit-horizontal-DrGxH2h4.js} +1 -1
- package/dist/web/assets/{htmlMode-DRGDF_UL.js → htmlMode-REMmzdfq.js} +1 -1
- package/dist/web/assets/index-3iPNbbER.css +1 -0
- package/dist/web/assets/{index-BE-wXZ5R.js → index-C8aCGagb.js} +2 -2
- package/dist/web/assets/{info-BLj0RvhA.js → info-DLdbiUrh.js} +1 -1
- package/dist/web/assets/{jsonMode-CCu0j2GD.js → jsonMode-KEdMfkIf.js} +1 -1
- package/dist/web/assets/{lspLanguageFeatures-s_Lhm7P6.js → lspLanguageFeatures-5KZwEoxW.js} +1 -1
- package/dist/web/assets/{minimize-2-Cyg_zD9z.js → minimize-2-CqcI4zcM.js} +1 -1
- package/dist/web/assets/{monaco.contribution-CY7mRgOB.js → monaco.contribution-BJGj65F9.js} +2 -2
- package/dist/web/assets/{monaco.contribution-CAzXvYkn.js → monaco.contribution-Cly9Wt7L.js} +2 -2
- package/dist/web/assets/{monaco.contribution-mUPNK9ra.js → monaco.contribution-DO10L0zW.js} +2 -2
- package/dist/web/assets/{monaco.contribution-aUeLcBEg.js → monaco.contribution-omszXBEj.js} +2 -2
- package/dist/web/assets/{monitor-DZvOs_wC.js → monitor-BFVCcbxp.js} +1 -1
- package/dist/web/assets/{play-BJPzemuY.js → play-C469pVZq.js} +1 -1
- package/dist/web/assets/{python-B_qnnVaG.js → python-Dw0YcVy9.js} +1 -1
- package/dist/web/assets/{save-BDy9tA3E.js → save-CtSjPydi.js} +1 -1
- package/dist/web/assets/{square-Cb2c5td4.js → square-BuImvLhT.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-MhO1JLyR.js → toggleHighContrast-DjCO9lIP.js} +1 -1
- package/dist/web/assets/{tsMode-DfBXJb9V.js → tsMode-BAOnxKd6.js} +1 -1
- package/dist/web/assets/{upload-D56kThRh.js → upload-2JkFZo3h.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules-DMnGfswi.js → useLocalAgentSchedules-BNqAisfS.js} +1 -1
- package/dist/web/assets/useProviderSettings-C4L4wDoh.js +5 -0
- package/dist/web/assets/{useProviderSettings-Bw-csWbH.css → useProviderSettings-CmL_BaxP.css} +1 -1
- package/dist/web/assets/{useSessionTurnCache-ClAY8gze.js → useSessionTurnCache-BHU2-Jmz.js} +1 -1
- package/dist/web/assets/{wifi-off-C9lWJmVm.js → wifi-off-CpOAH62M.js} +1 -1
- package/dist/web/assets/{workers-BYzrH8by.js → workers-0QvlA2T5.js} +1 -1
- package/dist/web/assets/{yaml-D3T8UkT3.js → yaml-BK3qxo7D.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/chunks/actions-command-WTFZA7LF.js +0 -2
- package/dist/chunks/app-server-runtime-2RM3N4I6.js +0 -2
- package/dist/chunks/apps-KDNWYO3G.js +0 -2
- package/dist/chunks/chunk-2DFR7PJ4.js +0 -2460
- package/dist/chunks/chunk-4CRM2ADK.js +0 -2
- package/dist/chunks/chunk-55G6B54U.js +0 -6
- package/dist/chunks/chunk-73G5UYBB.js +0 -12
- package/dist/chunks/chunk-ARQEJOEK.js +0 -33
- package/dist/chunks/chunk-CGBI2VYJ.js +0 -2
- package/dist/chunks/chunk-GGIG3XU7.js +0 -3
- package/dist/chunks/chunk-JIMU3KDA.js +0 -24
- package/dist/chunks/chunk-JUJSA7KI.js +0 -22
- package/dist/chunks/chunk-K5SBVO3B.js +0 -195
- package/dist/chunks/chunk-KD3QVRIJ.js +0 -21
- package/dist/chunks/chunk-L4235TRQ.js +0 -140
- package/dist/chunks/chunk-MVF3F5QS.js +0 -2
- package/dist/chunks/chunk-OULAKUIN.js +0 -2
- package/dist/chunks/chunk-OWNLDB2O.js +0 -2
- package/dist/chunks/chunk-QDHMP5FS.js +0 -2
- package/dist/chunks/chunk-QKD5OMDI.js +0 -2
- package/dist/chunks/chunk-R2BSIRYL.js +0 -3
- package/dist/chunks/chunk-STDMBJOQ.js +0 -9
- package/dist/chunks/chunk-T4QGDQHP.js +0 -4
- package/dist/chunks/chunk-USMZT5FZ.js +0 -18
- package/dist/chunks/chunk-VJEZPDBS.js +0 -5
- package/dist/chunks/chunk-WDFLCNRC.js +0 -8
- package/dist/chunks/chunk-WZYRAR7X.js +0 -16
- package/dist/chunks/chunk-YDT7L3VZ.js +0 -24
- package/dist/chunks/chunk-YUPBAWBJ.js +0 -554
- package/dist/chunks/cli-465VC2WP.js +0 -2
- package/dist/chunks/configuration-command-LAAP2EXT.js +0 -2
- package/dist/chunks/connected-evidence-XM626247.js +0 -2
- package/dist/chunks/core-commands-W7EK552V.js +0 -2
- package/dist/chunks/datasets-QJWYTTQL.js +0 -2
- package/dist/chunks/desktop-test-3B2D34NF.js +0 -3
- package/dist/chunks/dist-HUAE2KFZ.js +0 -2
- package/dist/chunks/evaluation-coordination-2MONR4AX.js +0 -2
- package/dist/chunks/experiment-improvements-WVQ5FK46.js +0 -2
- package/dist/chunks/experiments-S5UQ32QB.js +0 -2
- package/dist/chunks/hosted-experiment-improvement-2OWOQLHC.js +0 -3
- package/dist/chunks/hosted-harness-runtime-TGFMAV7W.js +0 -2
- package/dist/chunks/hosted-profile-candidate-WQSI6HZO.js +0 -3
- package/dist/chunks/hosted-profile-compiler-Z2A4TEA6.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-control-FKGARUEE.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-inspection-QOY2JKV4.js +0 -3
- package/dist/chunks/hosted-profile-evaluation-preparation-WVP6CALP.js +0 -3
- package/dist/chunks/human-review-TGHQKXFZ.js +0 -2
- package/dist/chunks/import-4UE5XNSG.js +0 -4
- package/dist/chunks/learning-R2XBMMEM.js +0 -2
- package/dist/chunks/opchat-WULL6CUP.js +0 -3
- package/dist/chunks/organizations-I37HISVX.js +0 -2
- package/dist/chunks/project-agent-T6XKC54C.js +0 -2
- package/dist/chunks/sandbox-command-STB47FRY.js +0 -2
- package/dist/chunks/src-T3KWWCAH.js +0 -322
- package/dist/chunks/taskset-RNYDR4GS.js +0 -2
- package/dist/chunks/training-M6FAPRSJ.js +0 -2
- package/dist/chunks/workspaces-MFZ3OO6O.js +0 -2
- package/dist/web/assets/App-CLFfy_Av.js +0 -154
- package/dist/web/assets/MainPane-D3ojiN-p.js +0 -18
- package/dist/web/assets/MainPane-DOWsSew1.css +0 -1
- package/dist/web/assets/RightSidebarHomePanel-CKs3OwhD.js +0 -1
- package/dist/web/assets/SettingsView-BnANbPLS.css +0 -1
- package/dist/web/assets/SettingsView-T1vYDPjh.js +0 -5
- package/dist/web/assets/TrainingCreationPanel-D75K0yk5.js +0 -1
- package/dist/web/assets/WorkSidebarPanel-CODMjVHY.js +0 -1
- package/dist/web/assets/WorkspaceGitDialogs-DrVtapQQ.js +0 -1
- package/dist/web/assets/index-B5re-RJy.css +0 -1
- package/dist/web/assets/useProviderSettings-Bv5B9eNk.js +0 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{b as e}from"./chunk-ES2ISFJC.js";import{a as o}from"./chunk-FTQLQJQV.js";import{createHash as Ce}from"node:crypto";function F(i){if(i===null||typeof i=="boolean"||typeof i=="string")return i;if(typeof i=="number"){if(!Number.isFinite(i))throw new Error("Canonical JSON cannot encode a non-finite number.");return i}if(Array.isArray(i))return i.map(F);if(typeof i=="object"){let t={};for(let r of Object.keys(i).sort()){let n=i[r];n!==void 0&&(t[r]=F(n))}return t}throw new Error(`Canonical JSON cannot encode ${typeof i}.`)}o(F,"canonicalJson");function R(i){return Ce("sha256").update(JSON.stringify(F(i)),"utf8").digest("hex")}o(R,"canonicalHash");function st(i){if(!i.maxContextTokens||!i.usableContextTokens)return{shouldCompact:!1,projectedTokens:i.projectedTokens,thresholdTokens:Number.MAX_SAFE_INTEGER,usableContextTokens:0,maxContextTokens:0,tokenSource:"heuristic"};let t=Math.max(.01,Math.min(1,(i.triggerPercent??85)/100)),r=Math.max(1,Math.floor(i.usableContextTokens*t));return{shouldCompact:i.projectedTokens>=r,projectedTokens:i.projectedTokens,thresholdTokens:r,usableContextTokens:i.usableContextTokens,maxContextTokens:i.maxContextTokens,tokenSource:"heuristic"}}o(st,"agentCompactionDecision");async function ot(i){await i.started();try{return await i.compact()}catch(t){throw await i.failed(t),t}}o(ot,"runAgentCompaction");async function at(i){let t=i.host.projectEvents(i.events),r=i.host.selectEvents(t,i.maxContextTokens),{summaryEvents:n,preservedEvents:s,preservedEventIds:c}=r;if(n.length===0)throw new Error("There is not enough prior context to compact.");let l=i.host.normalizeRecords(n),u=i.host.normalizeRecords(s),m=i.host.buildFileLedger(i.host.normalizeRecords(t)),h=i.host.serializeRecords(l,i.host.inputCharBudget(i.maxContextTokens));if(!h.text.trim())throw new Error("There is not enough prior context to compact.");let y=i.host.buildSummaryMessages({serializedHistory:h.text,fileLedger:m}),b=Date.now(),v=(await i.host.streamSummary({model:i.model,messages:y,signal:i.signal})).trim(),I=Date.now()-b;if(!v)throw new Error("Compaction summary was empty.");let g=i.host.estimateProjection({events:t,preservedEvents:s,summary:v}),f=i.host.createMetrics({sourceEvents:t.length,summarizedEvents:n.length,preservedEvents:s.length,sourceRecords:h.sourceRecordCount,includedRecords:h.includedRecordCount,omittedRecords:h.omittedRecordCount,preservedRecords:u.length,truncatedRecords:h.truncatedRecordCount,summaryInputTruncated:h.inputTruncated,sourceSelectionStrategy:h.selectionStrategy,summaryInputChars:h.inputChars,retainedTailTokens:r.retainedTailTokens,retainedTailBudgetTokens:r.retainedTailBudgetTokens,finalProviderContextTokens:g.inputTokensAfter,durationMs:I,fileLedgerEntries:m.length,splitTurnId:r.splitTurnId});return{summary:v,model:i.model,compactedThroughEventId:t[t.length-1]?.id??null,compactedThroughTurnId:i.host.lastTurnId(t),preservedFromEventId:s[0]?.id??null,preservedEventIds:c,preservedResourceRefs:i.host.durableResourceRefs(i.events),sourceEventCount:n.length,preservedEventCount:s.length,fileLedger:m,inputTokensBefore:g.inputTokensBefore,inputTokensAfter:g.inputTokensAfter,maxContextTokens:i.maxContextTokens,tokenSource:"heuristic",metrics:f}}o(at,"runAgentCompactionProgram");var qe=e.enum(["thread.started","thread.resumed","turn.started","turn.steered","turn.interrupted","turn.completed","turn.failed","item.started","item.delta","item.completed","assistant.reasoning.delta","assistant.delta","tool.started","tool.completed","approval.requested","approval.resolved","user_input.requested","user_input.resolved","compaction.started","compaction.completed","harness.admitted","harness.refiner.queued","harness.refiner.started","harness.refiner.completed","harness.refiner.failed","diagnostic"]),Pe=e.object({sequence:e.number().int().nonnegative(),name:qe,source:e.enum(["runtime","provider","tool","host","refiner"]),status:e.string().trim().min(1).nullable().default(null),threadId:e.string().trim().min(1),turnId:e.string().trim().min(1).nullable().default(null),callId:e.string().trim().min(1).nullable().default(null),output:e.string().nullable().default(null),error:e.string().nullable().default(null),data:e.record(e.string(),e.unknown()).default({})}).strict();function pt(i){return R(Pe.parse(i))}o(pt,"canonicalEventHash");var A="2026-09-20",bt=["initialize","initialized","runtime/capabilities","thread/start","thread/resume","thread/read","turn/start","turn/steer","task/inbox","task/queue","task/inputUpdate","turn/interrupt","approval/resolve","userInput/resolve","profile/workflows","profile/evaluations","profile/trainingSource","profile/evaluations/prepare","profile/evaluations/run","profile/evaluations/runSuite","profile/evaluations/executeCase","profile/evaluations/executeRun","profile/evaluations/compare","profile/evaluations/report","experiments/executeCase","experiments/cancelCase","harness/inspect","harness/proposalReview","harness/review","harness/acceptEvaluationReview","harness/materializeEvaluationTaskset","harness/runEvaluationBaseline","harness/validate","harness/backgroundReview","harness/diff","harness/rollback","refiner/inspect","refiner/update","refiner/activate","refiner/rollback"],Z=e.object({jsonrpc:e.literal("2.0"),id:e.union([e.string(),e.number()]),method:e.string().trim().min(1),params:e.unknown().optional()}).strict(),ee=e.object({jsonrpc:e.literal("2.0"),method:e.string().trim().min(1),params:e.unknown().optional()}).strict(),W=e.object({jsonrpc:e.literal("2.0"),id:e.union([e.string(),e.number()]),result:e.unknown()}).strict(),J=e.object({jsonrpc:e.literal("2.0"),id:e.union([e.string(),e.number(),e.null()]),error:e.object({code:e.number().int(),message:e.string(),data:e.unknown().optional()}).strict()}).strict(),gt=e.union([Z,ee,W,J]),Ae=e.object({protocolVersion:e.string().trim().min(1),client:e.object({name:e.string().trim().min(1),version:e.string().trim().min(1)}).strict(),capabilities:e.record(e.string(),e.unknown()).default({})}).strict(),B=class{static{o(this,"AgentJsonRpcDispatcher")}#e;#t=null;#r=!1;constructor(t){this.#e=t}get initialized(){return this.#r}async handle(t){let r=ee.safeParse(t);if(r.success&&!("id"in t)){if(r.data.method==="initialized"){if(!this.#t)throw new T(-32002,"initialize must be called first");this.#r=!0}return null}let n=Z.safeParse(t);if(!n.success)return Y(null,-32600,"Invalid Request",n.error.flatten());let s=n.data;try{let c=await this.#n(s.method,s.params);return{jsonrpc:"2.0",id:s.id,result:c}}catch(c){let l=c instanceof T?c:new T(-32603,c instanceof Error?c.message:String(c));return Y(s.id,l.code,l.message,l.data)}}async#n(t,r){if(t==="initialize"){let n=Ae.parse(r);if(n.protocolVersion!==A)throw new T(-32001,"Incompatible agent protocol version",{requested:n.protocolVersion,supported:A});return this.#t=n,{protocolVersion:A,server:{name:"openpond-app-server",version:"1"},capabilities:await this.#e.capabilities()}}if(!this.#r)throw new T(-32002,"initialized notification is required");switch(t){case"runtime/capabilities":return this.#e.capabilities(r);case"thread/start":return this.#e.threadStart(r);case"thread/resume":return this.#e.threadResume(r);case"thread/read":return this.#e.threadRead(r);case"turn/start":return this.#e.turnStart(r);case"turn/steer":return this.#e.turnSteer(r);case"task/inbox":return this.#e.taskInbox(r);case"task/queue":return this.#e.taskQueue(r);case"task/inputUpdate":return this.#e.taskInputUpdate(r);case"turn/interrupt":return this.#e.turnInterrupt(r);case"approval/resolve":return this.#e.approvalResolve(r);case"userInput/resolve":return this.#e.userInputResolve(r);case"profile/workflows":return this.#e.profileWorkflows(r);case"profile/evaluations":return this.#e.profileEvaluations(r);case"profile/trainingSource":return this.#e.profileTrainingSource(r);case"profile/evaluations/prepare":return this.#e.profileEvaluationPrepare(r);case"profile/evaluations/run":return this.#e.profileEvaluationRun(r);case"experiments/executeCase":{if(!this.#e.experimentExecuteCase)throw new Error("Experiment execution is unavailable in this runtime.");return this.#e.experimentExecuteCase(r)}case"experiments/cancelCase":{if(!this.#e.experimentCancelCase)throw new Error("Experiment cancellation is unavailable in this runtime.");return this.#e.experimentCancelCase(r)}case"profile/evaluations/runSuite":return this.#e.profileEvaluationRunSuite(r);case"profile/evaluations/executeCase":return this.#e.profileEvaluationExecuteCase(r);case"profile/evaluations/executeRun":return this.#e.profileEvaluationExecuteRun(r);case"profile/evaluations/compare":return this.#e.profileEvaluationCompare(r);case"profile/evaluations/report":return this.#e.profileEvaluationReport(r);case"harness/inspect":return this.#e.harnessInspect(r);case"harness/proposalReview":return this.#e.harnessProposalReview(r);case"harness/review":return this.#e.harnessReview(r);case"harness/acceptEvaluationReview":return this.#e.harnessAcceptEvaluationReview(r);case"harness/materializeEvaluationTaskset":return this.#e.harnessMaterializeEvaluationTaskset(r);case"harness/runEvaluationBaseline":return this.#e.harnessRunEvaluationBaseline(r);case"harness/validate":return this.#e.harnessValidate(r);case"harness/backgroundReview":return this.#e.harnessBackgroundReview(r);case"harness/diff":return this.#e.harnessDiff(r);case"harness/rollback":return this.#e.harnessRollback(r);case"refiner/inspect":return this.#e.refinerInspect(r);case"refiner/update":return this.#e.refinerUpdate(r);case"refiner/activate":return this.#e.refinerActivate(r);case"refiner/rollback":return this.#e.refinerRollback(r);default:throw new T(-32601,`Method not found: ${t}`)}}},T=class extends Error{static{o(this,"JsonRpcDispatchError")}code;data;constructor(t,r,n){super(r),this.code=t,this.data=n}};function Y(i,t,r,n){return{jsonrpc:"2.0",id:i,error:{code:t,message:r,...n===void 0?{}:{data:n}}}}o(Y,"jsonRpcError");var te=class{static{o(this,"AgentRpcClient")}#e;#t;constructor(t){this.#e=t.request.bind(t),this.#t=t.notify.bind(t)}async initialize(t,r={}){let n=await this.#e("initialize",{protocolVersion:A,client:t,capabilities:r});return await this.#t("initialized"),n}capabilities=o((t={})=>this.#e("runtime/capabilities",t),"capabilities");threadStart=o(t=>this.#e("thread/start",t),"threadStart");threadResume=o(t=>this.#e("thread/resume",t),"threadResume");threadRead=o(t=>this.#e("thread/read",t),"threadRead");turnStart=o(t=>this.#e("turn/start",t),"turnStart");turnSteer=o(t=>this.#e("turn/steer",t),"turnSteer");taskInbox=o(t=>this.#e("task/inbox",t),"taskInbox");taskQueue=o(t=>this.#e("task/queue",t),"taskQueue");taskInputUpdate=o(t=>this.#e("task/inputUpdate",t),"taskInputUpdate");turnInterrupt=o(t=>this.#e("turn/interrupt",t),"turnInterrupt");approvalResolve=o(t=>this.#e("approval/resolve",t),"approvalResolve");userInputResolve=o(t=>this.#e("userInput/resolve",t),"userInputResolve");profileWorkflows=o(t=>this.#e("profile/workflows",t),"profileWorkflows");profileEvaluations=o(t=>this.#e("profile/evaluations",t),"profileEvaluations");profileEvaluationPrepare=o(t=>this.#e("profile/evaluations/prepare",t),"profileEvaluationPrepare");profileEvaluationRun=o(t=>this.#e("profile/evaluations/run",t),"profileEvaluationRun");profileEvaluationRunSuite=o(t=>this.#e("profile/evaluations/runSuite",t),"profileEvaluationRunSuite");profileEvaluationExecuteCase=o(t=>this.#e("profile/evaluations/executeCase",t),"profileEvaluationExecuteCase");profileEvaluationExecuteRun=o(t=>this.#e("profile/evaluations/executeRun",t),"profileEvaluationExecuteRun");profileEvaluationCompare=o(t=>this.#e("profile/evaluations/compare",t),"profileEvaluationCompare");experimentExecuteCase=o(t=>this.#e("experiments/executeCase",t),"experimentExecuteCase");experimentCancelCase=o(t=>this.#e("experiments/cancelCase",t),"experimentCancelCase");harnessInspect=o((t={})=>this.#e("harness/inspect",t),"harnessInspect");harnessProposalReview=o((t={})=>this.#e("harness/proposalReview",t),"harnessProposalReview");harnessReview=o((t={})=>this.#e("harness/review",t),"harnessReview");harnessAcceptEvaluationReview=o((t={})=>this.#e("harness/acceptEvaluationReview",t),"harnessAcceptEvaluationReview");harnessMaterializeEvaluationTaskset=o((t={})=>this.#e("harness/materializeEvaluationTaskset",t),"harnessMaterializeEvaluationTaskset");harnessRunEvaluationBaseline=o((t={})=>this.#e("harness/runEvaluationBaseline",t),"harnessRunEvaluationBaseline");harnessValidate=o((t={})=>this.#e("harness/validate",t),"harnessValidate");harnessBackgroundReview=o((t={})=>this.#e("harness/backgroundReview",t),"harnessBackgroundReview");harnessDiff=o((t={})=>this.#e("harness/diff",t),"harnessDiff");harnessRollback=o((t={})=>this.#e("harness/rollback",t),"harnessRollback");refinerInspect=o(t=>this.#e("refiner/inspect",t),"refinerInspect");refinerUpdate=o(t=>this.#e("refiner/update",t),"refinerUpdate");refinerActivate=o(t=>this.#e("refiner/activate",t),"refinerActivate");refinerRollback=o(t=>this.#e("refiner/rollback",t),"refinerRollback")};var G=e.object({caseId:e.string().trim().min(1).max(191),admissionHash:e.string().regex(/^[a-f0-9]{64}$/),definitionHash:e.string().regex(/^[a-f0-9]{64}$/),ordinal:e.number().int().nonnegative(),operation:e.enum(["create","reset","step","collect","destroy"]),value:e.record(e.string(),e.unknown()),timeoutMs:e.number().int().min(1).max(3e4)}).strict();var d=e.string().trim().min(1).max(200),$=e.string().trim().min(1).max(32e3),z=e.number().int().nonnegative(),re=e.object({id:d,sessionId:d,senderSessionId:d.nullable(),senderKind:e.enum(["user","task","runtime"]),kind:e.enum(["steer","message","followup","queued","result"]),body:$,payload:e.record(e.string(),e.unknown()),idempotencyKey:d,replyTo:d.nullable(),expectedTurnId:d.nullable()}).strict(),ze=e.discriminatedUnion("action",[e.object({action:e.literal("resume"),expectedRevision:e.number().int().positive()}).strict(),e.object({action:e.literal("cancel"),expectedRevision:e.number().int().positive()}).strict(),e.object({action:e.literal("edit"),expectedRevision:e.number().int().positive(),body:$}).strict(),e.object({action:e.literal("steer"),expectedRevision:e.number().int().positive(),expectedTurnId:d}).strict()]),ne=e.object({id:d,sessionId:d,turnId:d,targetSessionId:d.nullable(),targetTurnId:d.nullable(),targetInputId:d.nullable(),afterSequence:z,deadline:e.string(),state:e.enum(["waiting","message","completed","failed","interrupted","unavailable","timeout","cancelled"]),createdAt:e.string(),updatedAt:e.string()}).strict(),ie=e.record(e.string(),e.unknown()),He=e.enum(["queued","running","completed","failed","cancelled","needs_resume"]),Me=e.object({parentSessionId:d.nullable().optional(),childSessionId:d.nullable().optional(),status:e.array(He).nullable().optional(),afterId:e.string().max(200),limit:e.number().int().min(1).max(10)}).strict(),se=e.discriminatedUnion("action",[e.object({action:e.literal("recoverTaskInboxOwners"),ownerId:d}).strict(),e.object({action:e.literal("hasTaskCompletion"),turnId:d}).strict(),e.object({action:e.literal("taskInboxSnapshot"),sessionId:d}).strict(),e.object({action:e.literal("taskInboxSnapshotInputs"),sessionId:d,afterSequence:z}).strict(),e.object({action:e.literal("declareTaskWork"),sessionId:d,turnId:d,ownerId:d,areas:e.array($).max(100)}).strict(),e.object({action:e.literal("taskWorkAreas"),sessionId:d}).strict(),e.object({action:e.literal("admitTaskInput"),input:re}).strict(),e.object({action:e.literal("admitTaskInputs"),inputs:e.array(re).max(50)}).strict(),e.object({action:e.literal("rejectTaskInput"),id:d,error:$}).strict(),e.object({action:e.literal("getTaskInput"),id:d}).strict(),e.object({action:e.literal("taskInputsForSession"),sessionId:d,query:e.object({afterSequence:z.optional(),pendingOnly:e.boolean().optional(),limit:e.number().int().min(1).max(500).optional()}).strict()}).strict(),e.object({action:e.literal("mutateTaskInput"),sessionId:d,inputId:d,change:ze}).strict(),e.object({action:e.literal("openTaskInboxTurn"),sessionId:d,turnId:d,ownerId:d}).strict(),e.object({action:e.literal("renewTaskInboxTurn"),sessionId:d,turnId:d,ownerId:d}).strict(),e.object({action:e.literal("pendingTaskInputs"),sessionId:d,turnId:d,afterSequence:z}).strict(),e.object({action:e.literal("taskAssignmentInputs"),turnId:d,afterSequence:z}).strict(),e.object({action:e.literal("pauseTaskInboxTurn"),sessionId:d,turnId:d,ownerId:d}).strict(),e.object({action:e.literal("includeTaskInputs"),sessionId:d,turnId:d,ownerId:d,requestId:d}).strict(),e.object({action:e.literal("settleTaskInputRequest"),requestId:d,outcome:e.enum(["resolved","failed","replaced"])}).strict(),e.object({action:e.literal("sealTaskInboxTurn"),sessionId:d,turnId:d,ownerId:d}).strict(),e.object({action:e.literal("sealNativeTaskInboxTurn"),sessionId:d,turnId:d,ownerId:d}).strict(),e.object({action:e.literal("closeTaskInboxTurn"),sessionId:d,turnId:d,ownerId:d,outcome:e.enum(["completed","failed","interrupted"])}).strict(),e.object({action:e.literal("taskInboxPaused"),sessionId:d}).strict(),e.object({action:e.literal("reserveTaskFollowup"),sessionId:d,turnId:d,ownerId:d}).strict(),e.object({action:e.literal("taskInboxWakeTargets"),afterSessionId:e.string().max(200)}).strict(),e.object({action:e.literal("createTaskWait"),value:ne}).strict(),e.object({action:e.literal("settleTaskWait"),id:d,state:ne.shape.state}).strict(),e.object({action:e.literal("taskWaitsForSession"),sessionId:d,afterId:e.string().max(200)}).strict(),e.object({action:e.literal("commitSubagentCompletion"),value:ie,turnId:d}).strict(),e.object({action:e.literal("pendingTaskCompletions"),afterTurnId:e.string().max(200)}).strict(),e.object({action:e.literal("settleTaskCompletion"),turnId:d,inputId:d}).strict(),e.object({action:e.literal("upsertSubagentRun"),value:ie}).strict(),e.object({action:e.literal("getSubagentRun"),id:d}).strict(),e.object({action:e.literal("listSubagentRuns"),query:Me}).strict()]);var H=e.string().trim().min(1).max(191),oe=e.object({createdAt:e.string().min(1),id:H}).strict(),ae=e.enum(["trigger_decision","route_decision","refiner_outcome","proposal","targeted_validation","apply_receipt"]),ce=e.discriminatedUnion("action",[e.object({action:e.literal("active_release"),workspaceId:H}).strict(),e.object({action:e.literal("put_artifact"),workspaceId:H,kind:ae,artifact:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("artifact_page"),workspaceId:H,kind:ae,before:oe.nullable(),limit:e.number().int().min(1).max(200)}).strict(),e.object({action:e.literal("pending_trigger_page"),workspaceId:H,before:oe.nullable(),limit:e.number().int().min(1).max(200)}).strict()]);var w=e.string().trim().min(1).max(240),le=e.string().regex(/^[a-f0-9]{64}$/),ue=e.enum(["run_overlay","observation","trigger_decision","route_decision","proposal","targeted_validation","apply_receipt","refiner_outcome"]),de=e.object({createdAt:e.string().datetime(),id:w}).strict(),pe=e.discriminatedUnion("action",[e.object({action:e.literal("artifact_put"),workspaceId:w,kind:ue,artifact:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("artifact_page"),workspaceId:w,kind:ue,before:de.nullable(),limit:e.number().int().min(1).max(100)}).strict(),e.object({action:e.literal("pending_page"),workspaceId:w,before:de.nullable(),limit:e.number().int().min(1).max(100)}).strict(),e.object({action:e.literal("workspace_get"),workspaceId:w}).strict(),e.object({action:e.literal("background_get"),workspaceId:w}).strict(),e.object({action:e.literal("overlay_get"),runId:w}).strict(),e.object({action:e.literal("overlay_freeze"),runId:w,expectedRevision:e.number().int().nonnegative(),overlay:e.record(e.string(),e.unknown()),proposal:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("memory_get"),workspaceId:w,sessionId:w,key:w}).strict(),e.object({action:e.literal("memory_page"),workspaceId:w,sessionId:w,before:e.object({updatedAt:e.string().datetime(),key:w}).strict().nullable(),limit:e.number().int().min(1).max(20),includeDeleted:e.boolean()}).strict(),e.object({action:e.literal("memory_write"),sessionId:w,input:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("release_get"),contentHash:le}).strict(),e.object({action:e.literal("release_put"),record:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("session_get"),sessionId:w}).strict(),e.object({action:e.literal("turn_get"),turnId:w}).strict(),e.object({action:e.literal("turn_page"),sessionId:w,before:e.number().int().positive().nullable(),limit:e.number().int().min(1).max(100)}).strict(),e.object({action:e.literal("event_page"),turnId:w,afterSequence:e.number().int().nonnegative(),names:e.array(w).max(40),limit:e.number().int().min(1).max(100)}).strict(),e.object({action:e.literal("event_append"),event:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("usage_put"),record:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("snapshot_restore"),turnId:w,expectedHash:le,snapshot:e.record(e.string(),e.unknown())}).strict()]);var j=e.string().trim().min(1).max(200),me=e.string().regex(/^[a-f0-9]{64}$/),Ve=e.object({kind:e.enum(["structural","visual","test","user_review"]),status:e.enum(["passed","failed","not_run"]),label:e.string().trim().min(1).max(240),detail:e.string().trim().max(4e3).nullable().optional(),ref:e.string().trim().max(4096).nullable().optional()}),he=e.object({id:j,title:e.string().trim().min(1).max(240),sourceTaskId:j,sourceTurnId:j,revision:e.number().int().positive(),createdAt:e.string().datetime(),contentType:e.string().trim().min(1).max(200),sizeBytes:e.number().int().min(1).max(1e7),sha256:me,validation:e.array(Ve).max(32)}).strict(),fe=e.object({sessionId:j,turnId:j,output:he}).strict(),be=e.object({uploadId:j,index:e.number().int().min(0).max(1024),offset:e.number().int().min(0).max(1e7),sha256:me,contentsBase64:e.string().min(1).max(131072)}).strict(),ge=e.object({uploadId:j}).strict(),Ue=he.pick({id:!0,title:!0,sourceTaskId:!0,sourceTurnId:!0,revision:!0,createdAt:!0,validation:!0}),we=e.object({sessionId:j,turnId:j,output:Ue,sandboxPath:e.string().trim().min(1).max(4096)}).strict();var M=e.string().trim().min(1).max(200),Oe=e.object({type:e.enum(["create","get","start","stop","exec","open_port","list_files","download_file","upload_file","search_files","delete_file","stat_file","mkdir","move_file","process_start","process_get","git_status","git_diff","git_export_patch","git_branch","git_commit","git_pull","git_push"]),sandboxId:M.optional(),payload:e.unknown().optional(),processId:M.optional(),failOnUnpreservedChanges:e.boolean().optional()}).strict().superRefine((i,t)=>{i.type!=="create"&&!i.sandboxId&&t.addIssue({code:"custom",message:"Sandbox identity is required."}),i.type==="create"&&i.sandboxId&&t.addIssue({code:"custom",message:"Create cannot target a sandbox identity."}),i.type==="process_get"&&!i.processId&&t.addIssue({code:"custom",message:"Process identity is required."})}),ve=e.object({action:Oe}).strict(),xe=e.object({sessionId:M,turnId:M,name:M}).strict();var p=1,a=e.string().trim().min(1).max(191),C=e.number().int().min(1).max(200),Nt=e.object({teamId:a,ownerUserId:a,workspaceId:a,conversationId:a,turnId:a,attempt:e.number().int().min(1),leaseGeneration:e.number().int().min(1)}).strict(),Ie=e.discriminatedUnion("operation",[e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("profile-evaluations/grade"),params:e.object({action:e.enum(["upload","execute"]),callId:a,sessionId:a,turnId:a,sha256:e.string().regex(/^[a-f0-9]{64}$/),sizeBytes:e.number().int().positive().max(2e7),timeoutMs:e.number().int().positive().max(3e5),offset:e.number().int().nonnegative().max(2e7).optional(),contentsBase64:e.string().max(131072).optional()}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("profile-evaluations/sandbox"),params:e.object({sessionId:a,turnId:a,action:e.enum(["upload","exec","read","stop"]),area:e.enum(["policy","runtime"]).optional(),path:e.string().min(1).max(4096).optional(),sha256:e.string().regex(/^[a-f0-9]{64}$/).optional(),sizeBytes:e.number().int().min(0).max(1e7).optional(),offset:e.number().int().min(0).max(1e7).optional(),contentsBase64:e.string().max(131072).optional(),command:e.string().min(1).max(2e4).optional(),stdin:e.string().max(12e4).optional(),cwd:e.string().max(4096).optional(),timeoutMs:e.number().int().min(1).max(18e4).optional()}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/list"),params:e.object({}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/read"),params:e.object({fileId:a,revision:e.number().int().min(1),offset:e.number().int().min(0).max(1e7).optional(),maxChars:e.number().int().min(1).max(1e5).optional(),firstPage:e.number().int().min(1).max(1e3).optional(),pageCount:e.number().int().min(1).max(10).optional()}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/readBytes"),params:e.object({sessionId:a,turnId:a,fileId:a,revision:e.number().int().positive(),sha256:e.string().regex(/^[a-f0-9]{64}$/),sizeBytes:e.number().int().min(1).max(1e7),offset:e.number().int().min(0).max(1e7)}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("profile.externalDataset.authorize"),params:e.object({bindingHash:e.string().regex(/^[a-f0-9]{64}$/),manifestHash:e.string().regex(/^[a-f0-9]{64}$/).optional(),taskId:a.optional(),seed:e.string().min(1).max(500).optional()}).strict().refine(i=>!!i.taskId==!!i.seed,"Case authority requires both task and seed.")}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("experiment/environment"),params:G}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("experiment/policy"),params:e.object({caseId:a,admissionHash:e.string().regex(/^[a-f0-9]{64}$/),ordinal:e.number().int().nonnegative(),messages:e.array(e.record(e.string(),e.unknown())).max(2e3),tools:e.array(e.record(e.string(),e.unknown())).max(200)}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("sandbox/request"),params:ve}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("embedding/authorize"),params:xe}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/begin"),params:fe}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/chunk"),params:be}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/complete"),params:ge}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/saveSandboxFile"),params:we}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("settings/get"),params:e.object({}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/get"),params:e.object({reference:e.object({id:a,contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict().nullable()}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/overlay/get"),params:e.object({runId:a}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/overlay/put"),params:e.object({runId:a,expectedRevision:e.number().int().min(0).nullable(),overlay:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/overlay/freezeProposal"),params:e.object({runId:a,expectedRevision:e.number().int().min(0),overlay:e.record(e.string(),e.unknown()),proposal:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/memory/get"),params:e.object({workspaceId:a,key:e.string().min(1).max(120)}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/memory/list"),params:e.object({workspaceId:a,includeDeleted:e.boolean(),before:e.object({updatedAt:e.string(),key:e.string()}).strict().nullable(),limit:C}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/memory/search"),params:e.object({workspaceId:a,query:e.string().trim().min(1).max(500),limit:e.number().int().min(1).max(20)}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/memory/write"),params:e.object({input:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/state/read"),params:e.object({workspaceId:a,kind:e.enum(["selection","workspace_settings","evaluation_review_settings","candidates","cross_run_requests"]),afterId:a.nullable(),limit:e.number().int().min(1).max(100)}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("profile-evaluations/execute"),params:e.discriminatedUnion("action",[e.object({action:e.literal("get"),kind:e.enum(["grade","receipt","run","comparison","suite"]),id:a}).strict(),e.object({action:e.literal("page"),kind:e.enum(["grade","receipt","run","comparison","suite"]),profileKey:e.string().regex(/^[a-f0-9]{64}$/),before:e.object({createdAt:e.string(),id:a}).strict().nullable(),limit:e.number().int().min(1).max(100)}).strict(),e.object({action:e.literal("put"),kind:e.enum(["grade","receipt","run","comparison","suite"]),payload:e.record(e.string(),e.unknown()),profileKey:e.string().regex(/^[a-f0-9]{64}$/).nullable(),createdAt:e.string()}).strict()])}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/workspace/transition"),params:e.discriminatedUnion("action",[e.object({action:e.literal("advance"),receiptId:a,workspaceId:a,proposal:e.record(e.string(),e.unknown()),validations:e.array(e.record(e.string(),e.unknown())).max(100),nextRelease:e.object({id:a,contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),nextSourceRevision:e.string().min(1),now:e.string()}).strict(),e.object({action:e.literal("reviewedAdvance"),receiptId:a,workspaceId:a,proposal:e.record(e.string(),e.unknown()),validations:e.array(e.record(e.string(),e.unknown())).max(100),nextRelease:e.object({id:a,contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),nextSourceRevision:e.string().min(1),reviewer:a,now:e.string()}).strict(),e.object({action:e.literal("rollback"),receiptId:a,workspaceId:a,expectedWorkspaceRevision:e.number().int().nonnegative(),expectedChannelRevision:e.number().int().nonnegative(),targetRelease:e.object({id:a,contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),targetSourceRevision:e.string().min(1),rollbackOf:e.object({id:a,contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),now:e.string()}).strict()])}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("task-inbox/execute"),params:se}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/review/execute"),params:pe}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("refiner/execute"),params:e.object({action:ce}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("create-improve/execute"),params:e.discriminatedUnion("action",[e.object({action:e.literal("get"),runId:a}).strict(),e.object({action:e.literal("page"),query:e.object({profileId:a.nullable(),targetKind:a.nullable(),targetId:a.nullable(),state:e.array(a).max(20)}).strict(),before:e.object({updatedAt:e.string(),id:a}).strict().nullable(),limit:C}).strict(),e.object({action:e.literal("put"),run:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("mutate"),mutation:e.record(e.string(),e.unknown()),next:e.record(e.string(),e.unknown())}).strict()])}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("approval/get"),params:e.object({approvalId:a}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("approval/upsert"),params:e.object({approval:e.record(e.string(),e.unknown()),expectedRevision:e.number().int().min(1).nullable()}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("usage/getByRequestId"),params:e.object({requestId:a}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("usage/upsert"),params:e.object({record:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("usage/page"),params:e.object({query:e.object({sessionId:a.optional(),turnId:a.optional(),provider:a.optional(),model:a.optional(),startedAtFrom:e.string().optional(),startedAtTo:e.string().optional(),visibility:e.enum(["user_facing","background","system"]).optional(),status:e.enum(["started","completed","failed","interrupted","missing"]).optional()}).strict(),before:e.object({startedAt:e.string(),requestOrdinal:e.number().int().min(0),id:a}).strict().nullable(),limit:C}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("capabilities"),params:e.object({}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("session/count"),params:e.object({}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("session/get"),params:e.object({sessionId:a}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("session/page"),params:e.object({afterId:a.nullable(),limit:C}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("session/put"),params:e.object({sessionId:a,expectedRevision:e.number().int().min(1).nullable(),session:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("turn/count"),params:e.object({sessionId:a}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("turn/wakeCount"),params:e.object({sessionId:a,key:e.enum(["messageId","fromRunId"]),value:a}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("turn/get"),params:e.object({turnId:a}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("turn/put"),params:e.object({sessionId:a,turnId:a,expectedRevision:e.number().int().min(1).nullable(),turn:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("turn/latest"),params:e.object({sessionId:a,status:e.enum(["in_progress","completed","failed","interrupted"]).nullable()}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("turn/page"),params:e.object({sessionId:a,beforeSortIndex:e.number().int().min(0).nullable().optional(),limit:C}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("thread/turnPage"),params:e.object({sessionId:a,beforeSortIndex:e.number().int().min(0).nullable().optional(),limit:C}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("event/append"),params:e.object({event:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("events/page"),params:e.object({sessionId:a.nullable(),afterSequence:e.number().int().min(0),beforeSequence:e.number().int().min(1).nullable().optional(),limit:C,excludeReasoningDeltas:e.boolean().optional()}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("events/latestAssistantText"),params:e.object({sessionId:a}).strict()}).strict()]),Lt=e.object({contractVersion:e.literal(p),operations:e.array(e.enum(["experiment/policy","experiment/environment","sandbox/request","embedding/authorize","output/begin","output/chunk","output/complete","output/saveSandboxFile","output/list","output/read","output/readBytes","settings/get","harness/get","harness/overlay/get","harness/overlay/put","harness/overlay/freezeProposal","harness/memory/get","harness/memory/list","harness/memory/search","harness/memory/write","harness/state/read","profile-evaluations/execute","profile-evaluations/sandbox","profile-evaluations/grade","harness/review/execute","harness/workspace/transition","task-inbox/execute","refiner/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"])).max(50),allowedTools:e.array(a).max(128),maxPageSize:C,maxRequestBytes:e.number().int().min(1).max(8388608),maxInFlight:e.number().int().min(1).max(64)}).strict();var ye=class{static{o(this,"AgentHostStorageClient")}#e=new Map;#t=null;#r=1;bind(t){if(this.#t)throw new Error("Host storage client is already bound.");this.#t=t}async request(t,r=15e3){let n=Ie.parse(t);if(!this.#t)throw new Error("Host storage transport is unavailable.");if(this.#e.size>=32)throw new Error("Host storage request limit exceeded.");let s=`host-storage:${this.#r++}`,c={jsonrpc:"2.0",id:s,method:"host/storage",params:n},l=n.operation==="experiment/policy"||n.operation==="experiment/environment";if(Buffer.byteLength(JSON.stringify(c))>(l?8388608:256e3))throw new Error("Host storage request is too large.");let u=new Promise((m,h)=>{let y=n.operation==="profile-evaluations/grade"?42e4:n.operation==="sandbox/request"||n.operation==="profile-evaluations/sandbox"||l?3e5:6e4,b=setTimeout(()=>{this.#e.delete(s),h(new Error("Host storage request timed out."))},Math.max(1,Math.min(y,r)));this.#e.set(s,{resolve:m,reject:h,timer:b,maxResponseBytes:n.operation==="experiment/environment"?16e5:1e6})});try{await this.#t(c)}catch(m){let h=this.#e.get(s);h&&(clearTimeout(h.timer),this.#e.delete(s),h.reject(m instanceof Error?m:new Error(String(m))))}return u}accept(t){let r=W.safeParse(t),n=r.success?null:J.safeParse(t),s=r.success?r.data:n?.success?n.data:null;if(!s||typeof s.id!="string"||!s.id.startsWith("host-storage:"))return!1;let c=this.#e.get(s.id);return c?(clearTimeout(c.timer),this.#e.delete(s.id),Buffer.byteLength(JSON.stringify(s))>c.maxResponseBytes?(c.reject(new Error("Host storage response is too large.")),!0):("error"in s?c.reject(new Error(`Host storage request failed: ${s.error.message}`)):c.resolve(s.result),!0)):!0}close(){this.#t=null;for(let t of this.#e.values())clearTimeout(t.timer),t.reject(new Error("Host storage transport closed."));this.#e.clear()}};import{once as Be}from"node:events";import{createInterface as $e}from"node:readline";async function Zt(i){let t=null,r=Promise.resolve(),n=[],s=o(g=>(r=r.then(async()=>{i.writable.write(`${JSON.stringify(g)}
|
|
2
|
+
import{b as e}from"./chunk-ES2ISFJC.js";import{a as o}from"./chunk-FTQLQJQV.js";import{createHash as Ce}from"node:crypto";function F(i){if(i===null||typeof i=="boolean"||typeof i=="string")return i;if(typeof i=="number"){if(!Number.isFinite(i))throw new Error("Canonical JSON cannot encode a non-finite number.");return i}if(Array.isArray(i))return i.map(F);if(typeof i=="object"){let t={};for(let r of Object.keys(i).sort()){let n=i[r];n!==void 0&&(t[r]=F(n))}return t}throw new Error(`Canonical JSON cannot encode ${typeof i}.`)}o(F,"canonicalJson");function R(i){return Ce("sha256").update(JSON.stringify(F(i)),"utf8").digest("hex")}o(R,"canonicalHash");function st(i){if(!i.maxContextTokens||!i.usableContextTokens)return{shouldCompact:!1,projectedTokens:i.projectedTokens,thresholdTokens:Number.MAX_SAFE_INTEGER,usableContextTokens:0,maxContextTokens:0,tokenSource:"heuristic"};let t=Math.max(.01,Math.min(1,(i.triggerPercent??85)/100)),r=Math.max(1,Math.floor(i.usableContextTokens*t));return{shouldCompact:i.projectedTokens>=r,projectedTokens:i.projectedTokens,thresholdTokens:r,usableContextTokens:i.usableContextTokens,maxContextTokens:i.maxContextTokens,tokenSource:"heuristic"}}o(st,"agentCompactionDecision");async function ot(i){await i.started();try{return await i.compact()}catch(t){throw await i.failed(t),t}}o(ot,"runAgentCompaction");async function at(i){let t=i.host.projectEvents(i.events),r=i.host.selectEvents(t,i.maxContextTokens),{summaryEvents:n,preservedEvents:s,preservedEventIds:c}=r;if(n.length===0)throw new Error("There is not enough prior context to compact.");let l=i.host.normalizeRecords(n),u=i.host.normalizeRecords(s),m=i.host.buildFileLedger(i.host.normalizeRecords(t)),h=i.host.serializeRecords(l,i.host.inputCharBudget(i.maxContextTokens));if(!h.text.trim())throw new Error("There is not enough prior context to compact.");let y=i.host.buildSummaryMessages({serializedHistory:h.text,fileLedger:m}),b=Date.now(),v=(await i.host.streamSummary({model:i.model,messages:y,signal:i.signal})).trim(),I=Date.now()-b;if(!v)throw new Error("Compaction summary was empty.");let g=i.host.estimateProjection({events:t,preservedEvents:s,summary:v}),f=i.host.createMetrics({sourceEvents:t.length,summarizedEvents:n.length,preservedEvents:s.length,sourceRecords:h.sourceRecordCount,includedRecords:h.includedRecordCount,omittedRecords:h.omittedRecordCount,preservedRecords:u.length,truncatedRecords:h.truncatedRecordCount,summaryInputTruncated:h.inputTruncated,sourceSelectionStrategy:h.selectionStrategy,summaryInputChars:h.inputChars,retainedTailTokens:r.retainedTailTokens,retainedTailBudgetTokens:r.retainedTailBudgetTokens,finalProviderContextTokens:g.inputTokensAfter,durationMs:I,fileLedgerEntries:m.length,splitTurnId:r.splitTurnId});return{summary:v,model:i.model,compactedThroughEventId:t[t.length-1]?.id??null,compactedThroughTurnId:i.host.lastTurnId(t),preservedFromEventId:s[0]?.id??null,preservedEventIds:c,preservedResourceRefs:i.host.durableResourceRefs(i.events),sourceEventCount:n.length,preservedEventCount:s.length,fileLedger:m,inputTokensBefore:g.inputTokensBefore,inputTokensAfter:g.inputTokensAfter,maxContextTokens:i.maxContextTokens,tokenSource:"heuristic",metrics:f}}o(at,"runAgentCompactionProgram");var qe=e.enum(["thread.started","thread.resumed","turn.started","turn.steered","turn.interrupted","turn.completed","turn.failed","item.started","item.delta","item.completed","assistant.reasoning.delta","assistant.delta","tool.started","tool.completed","approval.requested","approval.resolved","user_input.requested","user_input.resolved","compaction.started","compaction.completed","harness.admitted","harness.refiner.queued","harness.refiner.started","harness.refiner.completed","harness.refiner.failed","diagnostic"]),Pe=e.object({sequence:e.number().int().nonnegative(),name:qe,source:e.enum(["runtime","provider","tool","host","refiner"]),status:e.string().trim().min(1).nullable().default(null),threadId:e.string().trim().min(1),turnId:e.string().trim().min(1).nullable().default(null),callId:e.string().trim().min(1).nullable().default(null),output:e.string().nullable().default(null),error:e.string().nullable().default(null),data:e.record(e.string(),e.unknown()).default({})}).strict();function pt(i){return R(Pe.parse(i))}o(pt,"canonicalEventHash");var A="2026-09-20",bt=["initialize","initialized","runtime/capabilities","thread/start","thread/resume","thread/read","turn/start","turn/steer","task/inbox","task/queue","task/inputUpdate","turn/interrupt","approval/resolve","userInput/resolve","profile/workflows","profile/evaluations","profile/trainingSource","profile/evaluations/prepare","profile/evaluations/run","profile/evaluations/runSuite","profile/evaluations/executeCase","profile/evaluations/executeRun","profile/evaluations/compare","profile/evaluations/report","experiments/executeCase","experiments/cancelCase","harness/inspect","harness/proposalReview","harness/review","harness/acceptEvaluationReview","harness/materializeEvaluationTaskset","harness/runEvaluationBaseline","harness/validate","harness/backgroundReview","harness/diff","harness/rollback","refiner/inspect","refiner/update","refiner/activate","refiner/rollback"],Z=e.object({jsonrpc:e.literal("2.0"),id:e.union([e.string(),e.number()]),method:e.string().trim().min(1),params:e.unknown().optional()}).strict(),ee=e.object({jsonrpc:e.literal("2.0"),method:e.string().trim().min(1),params:e.unknown().optional()}).strict(),W=e.object({jsonrpc:e.literal("2.0"),id:e.union([e.string(),e.number()]),result:e.unknown()}).strict(),J=e.object({jsonrpc:e.literal("2.0"),id:e.union([e.string(),e.number(),e.null()]),error:e.object({code:e.number().int(),message:e.string(),data:e.unknown().optional()}).strict()}).strict(),gt=e.union([Z,ee,W,J]),Ae=e.object({protocolVersion:e.string().trim().min(1),client:e.object({name:e.string().trim().min(1),version:e.string().trim().min(1)}).strict(),capabilities:e.record(e.string(),e.unknown()).default({})}).strict(),B=class{static{o(this,"AgentJsonRpcDispatcher")}#e;#t=null;#r=!1;constructor(t){this.#e=t}get initialized(){return this.#r}async handle(t){let r=ee.safeParse(t);if(r.success&&!("id"in t)){if(r.data.method==="initialized"){if(!this.#t)throw new T(-32002,"initialize must be called first");this.#r=!0}return null}let n=Z.safeParse(t);if(!n.success)return Y(null,-32600,"Invalid Request",n.error.flatten());let s=n.data;try{let c=await this.#n(s.method,s.params);return{jsonrpc:"2.0",id:s.id,result:c}}catch(c){let l=c instanceof T?c:new T(-32603,c instanceof Error?c.message:String(c));return Y(s.id,l.code,l.message,l.data)}}async#n(t,r){if(t==="initialize"){let n=Ae.parse(r);if(n.protocolVersion!==A)throw new T(-32001,"Incompatible agent protocol version",{requested:n.protocolVersion,supported:A});return this.#t=n,{protocolVersion:A,server:{name:"openpond-app-server",version:"1"},capabilities:await this.#e.capabilities()}}if(!this.#r)throw new T(-32002,"initialized notification is required");switch(t){case"runtime/capabilities":return this.#e.capabilities(r);case"thread/start":return this.#e.threadStart(r);case"thread/resume":return this.#e.threadResume(r);case"thread/read":return this.#e.threadRead(r);case"turn/start":return this.#e.turnStart(r);case"turn/steer":return this.#e.turnSteer(r);case"task/inbox":return this.#e.taskInbox(r);case"task/queue":return this.#e.taskQueue(r);case"task/inputUpdate":return this.#e.taskInputUpdate(r);case"turn/interrupt":return this.#e.turnInterrupt(r);case"approval/resolve":return this.#e.approvalResolve(r);case"userInput/resolve":return this.#e.userInputResolve(r);case"profile/workflows":return this.#e.profileWorkflows(r);case"profile/evaluations":return this.#e.profileEvaluations(r);case"profile/trainingSource":return this.#e.profileTrainingSource(r);case"profile/evaluations/prepare":return this.#e.profileEvaluationPrepare(r);case"profile/evaluations/run":return this.#e.profileEvaluationRun(r);case"experiments/executeCase":{if(!this.#e.experimentExecuteCase)throw new Error("Experiment execution is unavailable in this runtime.");return this.#e.experimentExecuteCase(r)}case"experiments/cancelCase":{if(!this.#e.experimentCancelCase)throw new Error("Experiment cancellation is unavailable in this runtime.");return this.#e.experimentCancelCase(r)}case"profile/evaluations/runSuite":return this.#e.profileEvaluationRunSuite(r);case"profile/evaluations/executeCase":return this.#e.profileEvaluationExecuteCase(r);case"profile/evaluations/executeRun":return this.#e.profileEvaluationExecuteRun(r);case"profile/evaluations/compare":return this.#e.profileEvaluationCompare(r);case"profile/evaluations/report":return this.#e.profileEvaluationReport(r);case"harness/inspect":return this.#e.harnessInspect(r);case"harness/proposalReview":return this.#e.harnessProposalReview(r);case"harness/review":return this.#e.harnessReview(r);case"harness/acceptEvaluationReview":return this.#e.harnessAcceptEvaluationReview(r);case"harness/materializeEvaluationTaskset":return this.#e.harnessMaterializeEvaluationTaskset(r);case"harness/runEvaluationBaseline":return this.#e.harnessRunEvaluationBaseline(r);case"harness/validate":return this.#e.harnessValidate(r);case"harness/backgroundReview":return this.#e.harnessBackgroundReview(r);case"harness/diff":return this.#e.harnessDiff(r);case"harness/rollback":return this.#e.harnessRollback(r);case"refiner/inspect":return this.#e.refinerInspect(r);case"refiner/update":return this.#e.refinerUpdate(r);case"refiner/activate":return this.#e.refinerActivate(r);case"refiner/rollback":return this.#e.refinerRollback(r);default:throw new T(-32601,`Method not found: ${t}`)}}},T=class extends Error{static{o(this,"JsonRpcDispatchError")}code;data;constructor(t,r,n){super(r),this.code=t,this.data=n}};function Y(i,t,r,n){return{jsonrpc:"2.0",id:i,error:{code:t,message:r,...n===void 0?{}:{data:n}}}}o(Y,"jsonRpcError");var te=class{static{o(this,"AgentRpcClient")}#e;#t;constructor(t){this.#e=t.request.bind(t),this.#t=t.notify.bind(t)}async initialize(t,r={}){let n=await this.#e("initialize",{protocolVersion:A,client:t,capabilities:r});return await this.#t("initialized"),n}capabilities=o((t={})=>this.#e("runtime/capabilities",t),"capabilities");threadStart=o(t=>this.#e("thread/start",t),"threadStart");threadResume=o(t=>this.#e("thread/resume",t),"threadResume");threadRead=o(t=>this.#e("thread/read",t),"threadRead");turnStart=o(t=>this.#e("turn/start",t),"turnStart");turnSteer=o(t=>this.#e("turn/steer",t),"turnSteer");taskInbox=o(t=>this.#e("task/inbox",t),"taskInbox");taskQueue=o(t=>this.#e("task/queue",t),"taskQueue");taskInputUpdate=o(t=>this.#e("task/inputUpdate",t),"taskInputUpdate");turnInterrupt=o(t=>this.#e("turn/interrupt",t),"turnInterrupt");approvalResolve=o(t=>this.#e("approval/resolve",t),"approvalResolve");userInputResolve=o(t=>this.#e("userInput/resolve",t),"userInputResolve");profileWorkflows=o(t=>this.#e("profile/workflows",t),"profileWorkflows");profileEvaluations=o(t=>this.#e("profile/evaluations",t),"profileEvaluations");profileEvaluationPrepare=o(t=>this.#e("profile/evaluations/prepare",t),"profileEvaluationPrepare");profileEvaluationRun=o(t=>this.#e("profile/evaluations/run",t),"profileEvaluationRun");profileEvaluationRunSuite=o(t=>this.#e("profile/evaluations/runSuite",t),"profileEvaluationRunSuite");profileEvaluationExecuteCase=o(t=>this.#e("profile/evaluations/executeCase",t),"profileEvaluationExecuteCase");profileEvaluationExecuteRun=o(t=>this.#e("profile/evaluations/executeRun",t),"profileEvaluationExecuteRun");profileEvaluationCompare=o(t=>this.#e("profile/evaluations/compare",t),"profileEvaluationCompare");experimentExecuteCase=o(t=>this.#e("experiments/executeCase",t),"experimentExecuteCase");experimentCancelCase=o(t=>this.#e("experiments/cancelCase",t),"experimentCancelCase");harnessInspect=o((t={})=>this.#e("harness/inspect",t),"harnessInspect");harnessProposalReview=o((t={})=>this.#e("harness/proposalReview",t),"harnessProposalReview");harnessReview=o((t={})=>this.#e("harness/review",t),"harnessReview");harnessAcceptEvaluationReview=o((t={})=>this.#e("harness/acceptEvaluationReview",t),"harnessAcceptEvaluationReview");harnessMaterializeEvaluationTaskset=o((t={})=>this.#e("harness/materializeEvaluationTaskset",t),"harnessMaterializeEvaluationTaskset");harnessRunEvaluationBaseline=o((t={})=>this.#e("harness/runEvaluationBaseline",t),"harnessRunEvaluationBaseline");harnessValidate=o((t={})=>this.#e("harness/validate",t),"harnessValidate");harnessBackgroundReview=o((t={})=>this.#e("harness/backgroundReview",t),"harnessBackgroundReview");harnessDiff=o((t={})=>this.#e("harness/diff",t),"harnessDiff");harnessRollback=o((t={})=>this.#e("harness/rollback",t),"harnessRollback");refinerInspect=o(t=>this.#e("refiner/inspect",t),"refinerInspect");refinerUpdate=o(t=>this.#e("refiner/update",t),"refinerUpdate");refinerActivate=o(t=>this.#e("refiner/activate",t),"refinerActivate");refinerRollback=o(t=>this.#e("refiner/rollback",t),"refinerRollback")};var G=e.object({caseId:e.string().trim().min(1).max(191),admissionHash:e.string().regex(/^[a-f0-9]{64}$/),definitionHash:e.string().regex(/^[a-f0-9]{64}$/),ordinal:e.number().int().nonnegative(),operation:e.enum(["create","reset","step","collect","destroy"]),value:e.record(e.string(),e.unknown()),timeoutMs:e.number().int().min(1).max(3e4)}).strict();var d=e.string().trim().min(1).max(200),$=e.string().trim().min(1).max(32e3),z=e.number().int().nonnegative(),re=e.object({id:d,sessionId:d,senderSessionId:d.nullable(),senderKind:e.enum(["user","task","runtime"]),kind:e.enum(["steer","message","followup","queued","result"]),body:$,payload:e.record(e.string(),e.unknown()),idempotencyKey:d,replyTo:d.nullable(),expectedTurnId:d.nullable()}).strict(),ze=e.discriminatedUnion("action",[e.object({action:e.literal("resume"),expectedRevision:e.number().int().positive()}).strict(),e.object({action:e.literal("cancel"),expectedRevision:e.number().int().positive()}).strict(),e.object({action:e.literal("edit"),expectedRevision:e.number().int().positive(),body:$}).strict(),e.object({action:e.literal("steer"),expectedRevision:e.number().int().positive(),expectedTurnId:d}).strict()]),ne=e.object({id:d,sessionId:d,turnId:d,targetSessionId:d.nullable(),targetTurnId:d.nullable(),targetInputId:d.nullable(),afterSequence:z,deadline:e.string(),state:e.enum(["waiting","message","completed","failed","interrupted","unavailable","timeout","cancelled"]),createdAt:e.string(),updatedAt:e.string()}).strict(),ie=e.record(e.string(),e.unknown()),He=e.enum(["queued","running","completed","failed","cancelled","needs_resume"]),Me=e.object({parentSessionId:d.nullable().optional(),childSessionId:d.nullable().optional(),status:e.array(He).nullable().optional(),afterId:e.string().max(200),limit:e.number().int().min(1).max(10)}).strict(),se=e.discriminatedUnion("action",[e.object({action:e.literal("recoverTaskInboxOwners"),ownerId:d}).strict(),e.object({action:e.literal("hasTaskCompletion"),turnId:d}).strict(),e.object({action:e.literal("taskInboxSnapshot"),sessionId:d}).strict(),e.object({action:e.literal("taskInboxSnapshotInputs"),sessionId:d,afterSequence:z}).strict(),e.object({action:e.literal("declareTaskWork"),sessionId:d,turnId:d,ownerId:d,areas:e.array($).max(100)}).strict(),e.object({action:e.literal("taskWorkAreas"),sessionId:d}).strict(),e.object({action:e.literal("admitTaskInput"),input:re}).strict(),e.object({action:e.literal("admitTaskInputs"),inputs:e.array(re).max(50)}).strict(),e.object({action:e.literal("rejectTaskInput"),id:d,error:$}).strict(),e.object({action:e.literal("getTaskInput"),id:d}).strict(),e.object({action:e.literal("taskInputsForSession"),sessionId:d,query:e.object({afterSequence:z.optional(),pendingOnly:e.boolean().optional(),limit:e.number().int().min(1).max(500).optional()}).strict()}).strict(),e.object({action:e.literal("mutateTaskInput"),sessionId:d,inputId:d,change:ze}).strict(),e.object({action:e.literal("openTaskInboxTurn"),sessionId:d,turnId:d,ownerId:d}).strict(),e.object({action:e.literal("renewTaskInboxTurn"),sessionId:d,turnId:d,ownerId:d}).strict(),e.object({action:e.literal("pendingTaskInputs"),sessionId:d,turnId:d,afterSequence:z}).strict(),e.object({action:e.literal("taskAssignmentInputs"),turnId:d,afterSequence:z}).strict(),e.object({action:e.literal("pauseTaskInboxTurn"),sessionId:d,turnId:d,ownerId:d}).strict(),e.object({action:e.literal("includeTaskInputs"),sessionId:d,turnId:d,ownerId:d,requestId:d}).strict(),e.object({action:e.literal("settleTaskInputRequest"),requestId:d,outcome:e.enum(["resolved","failed","replaced"])}).strict(),e.object({action:e.literal("sealTaskInboxTurn"),sessionId:d,turnId:d,ownerId:d}).strict(),e.object({action:e.literal("sealNativeTaskInboxTurn"),sessionId:d,turnId:d,ownerId:d}).strict(),e.object({action:e.literal("closeTaskInboxTurn"),sessionId:d,turnId:d,ownerId:d,outcome:e.enum(["completed","failed","interrupted"])}).strict(),e.object({action:e.literal("taskInboxPaused"),sessionId:d}).strict(),e.object({action:e.literal("reserveTaskFollowup"),sessionId:d,turnId:d,ownerId:d}).strict(),e.object({action:e.literal("taskInboxWakeTargets"),afterSessionId:e.string().max(200)}).strict(),e.object({action:e.literal("createTaskWait"),value:ne}).strict(),e.object({action:e.literal("settleTaskWait"),id:d,state:ne.shape.state}).strict(),e.object({action:e.literal("taskWaitsForSession"),sessionId:d,afterId:e.string().max(200)}).strict(),e.object({action:e.literal("commitSubagentCompletion"),value:ie,turnId:d}).strict(),e.object({action:e.literal("pendingTaskCompletions"),afterTurnId:e.string().max(200)}).strict(),e.object({action:e.literal("settleTaskCompletion"),turnId:d,inputId:d}).strict(),e.object({action:e.literal("upsertSubagentRun"),value:ie}).strict(),e.object({action:e.literal("getSubagentRun"),id:d}).strict(),e.object({action:e.literal("listSubagentRuns"),query:Me}).strict()]);var H=e.string().trim().min(1).max(191),oe=e.object({createdAt:e.string().min(1),id:H}).strict(),ae=e.enum(["trigger_decision","route_decision","refiner_outcome","proposal","targeted_validation","apply_receipt"]),ce=e.discriminatedUnion("action",[e.object({action:e.literal("active_release"),workspaceId:H}).strict(),e.object({action:e.literal("put_artifact"),workspaceId:H,kind:ae,artifact:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("artifact_page"),workspaceId:H,kind:ae,before:oe.nullable(),limit:e.number().int().min(1).max(200)}).strict(),e.object({action:e.literal("pending_trigger_page"),workspaceId:H,before:oe.nullable(),limit:e.number().int().min(1).max(200)}).strict()]);var w=e.string().trim().min(1).max(240),le=e.string().regex(/^[a-f0-9]{64}$/),ue=e.enum(["run_overlay","observation","trigger_decision","route_decision","proposal","targeted_validation","apply_receipt","refiner_outcome"]),de=e.object({createdAt:e.string().datetime(),id:w}).strict(),pe=e.discriminatedUnion("action",[e.object({action:e.literal("artifact_put"),workspaceId:w,kind:ue,artifact:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("artifact_page"),workspaceId:w,kind:ue,before:de.nullable(),limit:e.number().int().min(1).max(100)}).strict(),e.object({action:e.literal("pending_page"),workspaceId:w,before:de.nullable(),limit:e.number().int().min(1).max(100)}).strict(),e.object({action:e.literal("workspace_get"),workspaceId:w}).strict(),e.object({action:e.literal("background_get"),workspaceId:w}).strict(),e.object({action:e.literal("overlay_get"),runId:w}).strict(),e.object({action:e.literal("overlay_freeze"),runId:w,expectedRevision:e.number().int().nonnegative(),overlay:e.record(e.string(),e.unknown()),proposal:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("memory_get"),workspaceId:w,sessionId:w,key:w}).strict(),e.object({action:e.literal("memory_page"),workspaceId:w,sessionId:w,before:e.object({updatedAt:e.string().datetime(),key:w}).strict().nullable(),limit:e.number().int().min(1).max(20),includeDeleted:e.boolean()}).strict(),e.object({action:e.literal("memory_write"),sessionId:w,input:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("release_get"),contentHash:le}).strict(),e.object({action:e.literal("release_put"),record:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("session_get"),sessionId:w}).strict(),e.object({action:e.literal("turn_get"),turnId:w}).strict(),e.object({action:e.literal("turn_page"),sessionId:w,before:e.number().int().positive().nullable(),limit:e.number().int().min(1).max(100)}).strict(),e.object({action:e.literal("event_page"),turnId:w,afterSequence:e.number().int().nonnegative(),names:e.array(w).max(40),limit:e.number().int().min(1).max(100)}).strict(),e.object({action:e.literal("event_append"),event:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("usage_put"),record:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("snapshot_restore"),turnId:w,expectedHash:le,snapshot:e.record(e.string(),e.unknown())}).strict()]);var j=e.string().trim().min(1).max(200),me=e.string().regex(/^[a-f0-9]{64}$/),Ve=e.object({kind:e.enum(["structural","visual","test","user_review"]),status:e.enum(["passed","failed","not_run"]),label:e.string().trim().min(1).max(240),detail:e.string().trim().max(4e3).nullable().optional(),ref:e.string().trim().max(4096).nullable().optional()}),he=e.object({id:j,title:e.string().trim().min(1).max(240),sourceTaskId:j,sourceTurnId:j,revision:e.number().int().positive(),createdAt:e.string().datetime(),contentType:e.string().trim().min(1).max(200),sizeBytes:e.number().int().min(1).max(1e7),sha256:me,validation:e.array(Ve).max(32)}).strict(),fe=e.object({sessionId:j,turnId:j,output:he}).strict(),be=e.object({uploadId:j,index:e.number().int().min(0).max(1024),offset:e.number().int().min(0).max(1e7),sha256:me,contentsBase64:e.string().min(1).max(131072)}).strict(),ge=e.object({uploadId:j}).strict(),Ue=he.pick({id:!0,title:!0,sourceTaskId:!0,sourceTurnId:!0,revision:!0,createdAt:!0,validation:!0}),we=e.object({sessionId:j,turnId:j,output:Ue,sandboxPath:e.string().trim().min(1).max(4096)}).strict();var M=e.string().trim().min(1).max(200),Oe=e.object({type:e.enum(["create","get","start","stop","exec","open_port","list_files","download_file","upload_file","search_files","delete_file","stat_file","mkdir","move_file","process_start","process_get","git_status","git_diff","git_export_patch","git_branch","git_commit","git_pull","git_push"]),sandboxId:M.optional(),payload:e.unknown().optional(),processId:M.optional(),failOnUnpreservedChanges:e.boolean().optional()}).strict().superRefine((i,t)=>{i.type!=="create"&&!i.sandboxId&&t.addIssue({code:"custom",message:"Sandbox identity is required."}),i.type==="create"&&i.sandboxId&&t.addIssue({code:"custom",message:"Create cannot target a sandbox identity."}),i.type==="process_get"&&!i.processId&&t.addIssue({code:"custom",message:"Process identity is required."})}),ve=e.object({action:Oe}).strict(),xe=e.object({sessionId:M,turnId:M,name:M}).strict();var p=1,a=e.string().trim().min(1).max(191),C=e.number().int().min(1).max(200),Nt=e.object({teamId:a,ownerUserId:a,workspaceId:a,conversationId:a,turnId:a,attempt:e.number().int().min(1),leaseGeneration:e.number().int().min(1)}).strict(),Ie=e.discriminatedUnion("operation",[e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("profile-evaluations/grade"),params:e.object({action:e.enum(["upload","execute"]),callId:a,sessionId:a,turnId:a,sha256:e.string().regex(/^[a-f0-9]{64}$/),sizeBytes:e.number().int().positive().max(2e7),timeoutMs:e.number().int().positive().max(3e5),offset:e.number().int().nonnegative().max(2e7).optional(),contentsBase64:e.string().max(131072).optional()}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("profile-evaluations/sandbox"),params:e.object({sessionId:a,turnId:a,action:e.enum(["upload","exec","read","stop"]),area:e.enum(["policy","runtime"]).optional(),path:e.string().min(1).max(4096).optional(),sha256:e.string().regex(/^[a-f0-9]{64}$/).optional(),sizeBytes:e.number().int().min(0).max(1e7).optional(),offset:e.number().int().min(0).max(1e7).optional(),contentsBase64:e.string().max(131072).optional(),command:e.string().min(1).max(2e4).optional(),stdin:e.string().max(12e4).optional(),cwd:e.string().max(4096).optional(),timeoutMs:e.number().int().min(1).max(18e4).optional()}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/list"),params:e.object({}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/read"),params:e.object({fileId:a,revision:e.number().int().min(1),offset:e.number().int().min(0).max(1e7).optional(),maxChars:e.number().int().min(1).max(1e5).optional(),firstPage:e.number().int().min(1).max(1e3).optional(),pageCount:e.number().int().min(1).max(10).optional()}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/readBytes"),params:e.object({sessionId:a,turnId:a,fileId:a,revision:e.number().int().positive(),sha256:e.string().regex(/^[a-f0-9]{64}$/),sizeBytes:e.number().int().min(1).max(1e7),offset:e.number().int().min(0).max(1e7)}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("profile.externalDataset.authorize"),params:e.object({bindingHash:e.string().regex(/^[a-f0-9]{64}$/),manifestHash:e.string().regex(/^[a-f0-9]{64}$/).optional(),taskId:a.optional(),seed:e.string().min(1).max(500).optional()}).strict().refine(i=>!!i.taskId==!!i.seed,"Case authority requires both task and seed.")}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("experiment/environment"),params:G}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("experiment/policy"),params:e.object({caseId:a,admissionHash:e.string().regex(/^[a-f0-9]{64}$/),ordinal:e.number().int().nonnegative(),messages:e.array(e.record(e.string(),e.unknown())).max(2e3),tools:e.array(e.record(e.string(),e.unknown())).max(200)}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("sandbox/request"),params:ve}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("embedding/authorize"),params:xe}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/begin"),params:fe}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/chunk"),params:be}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/complete"),params:ge}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/saveSandboxFile"),params:we}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("settings/get"),params:e.object({}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/get"),params:e.object({reference:e.object({id:a,contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict().nullable()}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/overlay/get"),params:e.object({runId:a}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/overlay/put"),params:e.object({runId:a,expectedRevision:e.number().int().min(0).nullable(),overlay:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/overlay/freezeProposal"),params:e.object({runId:a,expectedRevision:e.number().int().min(0),overlay:e.record(e.string(),e.unknown()),proposal:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/memory/get"),params:e.object({workspaceId:a,key:e.string().min(1).max(120)}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/memory/list"),params:e.object({workspaceId:a,includeDeleted:e.boolean(),before:e.object({updatedAt:e.string(),key:e.string()}).strict().nullable(),limit:C}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/memory/search"),params:e.object({workspaceId:a,query:e.string().trim().min(1).max(500),limit:e.number().int().min(1).max(20)}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/memory/write"),params:e.object({input:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/state/read"),params:e.object({workspaceId:a,kind:e.enum(["selection","workspace_settings","evaluation_review_settings","candidates","cross_run_requests"]),afterId:a.nullable(),limit:e.number().int().min(1).max(100)}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("profile-evaluations/execute"),params:e.discriminatedUnion("action",[e.object({action:e.literal("get"),kind:e.enum(["grade","receipt","run","comparison","suite"]),id:a}).strict(),e.object({action:e.literal("page"),kind:e.enum(["grade","receipt","run","comparison","suite"]),profileKey:e.string().regex(/^[a-f0-9]{64}$/),before:e.object({createdAt:e.string(),id:a}).strict().nullable(),limit:e.number().int().min(1).max(100)}).strict(),e.object({action:e.literal("put"),kind:e.enum(["grade","receipt","run","comparison","suite"]),payload:e.record(e.string(),e.unknown()),profileKey:e.string().regex(/^[a-f0-9]{64}$/).nullable(),createdAt:e.string()}).strict()])}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/workspace/transition"),params:e.discriminatedUnion("action",[e.object({action:e.literal("advance"),receiptId:a,workspaceId:a,proposal:e.record(e.string(),e.unknown()),validations:e.array(e.record(e.string(),e.unknown())).max(100),nextRelease:e.object({id:a,contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),nextSourceRevision:e.string().min(1),now:e.string()}).strict(),e.object({action:e.literal("reviewedAdvance"),receiptId:a,workspaceId:a,proposal:e.record(e.string(),e.unknown()),validations:e.array(e.record(e.string(),e.unknown())).max(100),nextRelease:e.object({id:a,contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),nextSourceRevision:e.string().min(1),reviewer:a,now:e.string()}).strict(),e.object({action:e.literal("rollback"),receiptId:a,workspaceId:a,expectedWorkspaceRevision:e.number().int().nonnegative(),expectedChannelRevision:e.number().int().nonnegative(),targetRelease:e.object({id:a,contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),targetSourceRevision:e.string().min(1),rollbackOf:e.object({id:a,contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),now:e.string()}).strict()])}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("task-inbox/execute"),params:se}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/review/execute"),params:pe}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("refiner/execute"),params:e.object({action:ce}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("create-improve/execute"),params:e.discriminatedUnion("action",[e.object({action:e.literal("get"),runId:a}).strict(),e.object({action:e.literal("page"),query:e.object({profileId:a.nullable(),targetKind:a.nullable(),targetId:a.nullable(),state:e.array(a).max(20)}).strict(),before:e.object({updatedAt:e.string(),id:a}).strict().nullable(),limit:C}).strict(),e.object({action:e.literal("put"),run:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("mutate"),mutation:e.record(e.string(),e.unknown()),next:e.record(e.string(),e.unknown())}).strict()])}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("approval/get"),params:e.object({approvalId:a}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("approval/upsert"),params:e.object({approval:e.record(e.string(),e.unknown()),expectedRevision:e.number().int().min(1).nullable()}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("usage/getByRequestId"),params:e.object({requestId:a}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("usage/upsert"),params:e.object({record:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("usage/page"),params:e.object({query:e.object({sessionId:a.optional(),turnId:a.optional(),provider:a.optional(),model:a.optional(),startedAtFrom:e.string().optional(),startedAtTo:e.string().optional(),visibility:e.enum(["user_facing","background","system"]).optional(),status:e.enum(["started","completed","failed","interrupted","missing"]).optional()}).strict(),before:e.object({startedAt:e.string(),requestOrdinal:e.number().int().min(0),id:a}).strict().nullable(),limit:C}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("capabilities"),params:e.object({}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("session/count"),params:e.object({}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("session/get"),params:e.object({sessionId:a}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("session/page"),params:e.object({afterId:a.nullable(),limit:C}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("session/put"),params:e.object({sessionId:a,expectedRevision:e.number().int().min(1).nullable(),session:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("turn/count"),params:e.object({sessionId:a}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("turn/wakeCount"),params:e.object({sessionId:a,key:e.enum(["messageId","fromRunId"]),value:a}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("turn/get"),params:e.object({turnId:a}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("turn/put"),params:e.object({sessionId:a,turnId:a,expectedRevision:e.number().int().min(1).nullable(),turn:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("turn/latest"),params:e.object({sessionId:a,status:e.enum(["in_progress","completed","failed","interrupted"]).nullable()}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("turn/page"),params:e.object({sessionId:a,beforeSortIndex:e.number().int().min(0).nullable().optional(),limit:C}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("thread/turnPage"),params:e.object({sessionId:a,beforeSortIndex:e.number().int().min(0).nullable().optional(),limit:C}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("event/append"),params:e.object({event:e.record(e.string(),e.unknown())}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("events/page"),params:e.object({sessionId:a.nullable(),afterSequence:e.number().int().min(0),beforeSequence:e.number().int().min(1).nullable().optional(),limit:C,excludeReasoningDeltas:e.boolean().optional()}).strict()}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("events/latestAssistantText"),params:e.object({sessionId:a}).strict()}).strict()]),Lt=e.object({contractVersion:e.literal(p),operations:e.array(e.enum(["profile.externalDataset.authorize","experiment/policy","experiment/environment","sandbox/request","embedding/authorize","output/begin","output/chunk","output/complete","output/saveSandboxFile","output/list","output/read","output/readBytes","settings/get","harness/get","harness/overlay/get","harness/overlay/put","harness/overlay/freezeProposal","harness/memory/get","harness/memory/list","harness/memory/search","harness/memory/write","harness/state/read","profile-evaluations/execute","profile-evaluations/sandbox","profile-evaluations/grade","harness/review/execute","harness/workspace/transition","task-inbox/execute","refiner/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"])).max(50),allowedTools:e.array(a).max(128),maxPageSize:C,maxRequestBytes:e.number().int().min(1).max(8388608),maxInFlight:e.number().int().min(1).max(64)}).strict();var ye=class{static{o(this,"AgentHostStorageClient")}#e=new Map;#t=null;#r=1;bind(t){if(this.#t)throw new Error("Host storage client is already bound.");this.#t=t}async request(t,r=15e3){let n=Ie.parse(t);if(!this.#t)throw new Error("Host storage transport is unavailable.");if(this.#e.size>=32)throw new Error("Host storage request limit exceeded.");let s=`host-storage:${this.#r++}`,c={jsonrpc:"2.0",id:s,method:"host/storage",params:n},l=n.operation==="experiment/policy"||n.operation==="experiment/environment";if(Buffer.byteLength(JSON.stringify(c))>(l?8388608:256e3))throw new Error("Host storage request is too large.");let u=new Promise((m,h)=>{let y=n.operation==="profile-evaluations/grade"?42e4:n.operation==="sandbox/request"||n.operation==="profile-evaluations/sandbox"||l?3e5:6e4,b=setTimeout(()=>{this.#e.delete(s),h(new Error("Host storage request timed out."))},Math.max(1,Math.min(y,r)));this.#e.set(s,{resolve:m,reject:h,timer:b,maxResponseBytes:n.operation==="experiment/environment"?16e5:1e6})});try{await this.#t(c)}catch(m){let h=this.#e.get(s);h&&(clearTimeout(h.timer),this.#e.delete(s),h.reject(m instanceof Error?m:new Error(String(m))))}return u}accept(t){let r=W.safeParse(t),n=r.success?null:J.safeParse(t),s=r.success?r.data:n?.success?n.data:null;if(!s||typeof s.id!="string"||!s.id.startsWith("host-storage:"))return!1;let c=this.#e.get(s.id);return c?(clearTimeout(c.timer),this.#e.delete(s.id),Buffer.byteLength(JSON.stringify(s))>c.maxResponseBytes?(c.reject(new Error("Host storage response is too large.")),!0):("error"in s?c.reject(new Error(`Host storage request failed: ${s.error.message}`)):c.resolve(s.result),!0)):!0}close(){this.#t=null;for(let t of this.#e.values())clearTimeout(t.timer),t.reject(new Error("Host storage transport closed."));this.#e.clear()}};import{once as Be}from"node:events";import{createInterface as $e}from"node:readline";async function Zt(i){let t=null,r=Promise.resolve(),n=[],s=o(g=>(r=r.then(async()=>{i.writable.write(`${JSON.stringify(g)}
|
|
3
3
|
`)||await Be(i.writable,"drain")}),r),"write");i.hostStorageClient?.bind(g=>s(g));let c=o(()=>{if(!(!t?.initialized||n.length===0))for(let g of n.splice(0))s(g)},"flushPendingNotifications"),l,u=new Set,m=$e({input:i.readable,crlfDelay:1/0}),h=[],y=!1,b=null,v=o(async g=>{let f=t;if(!f)throw new Error("Agent runtime dispatcher is unavailable.");let E=(async()=>{let X=await f.handle(g);X&&await s(X),c()})(),Q=g&&typeof g=="object"&&"method"in g?g.method:null;if(Q==="initialize"||Q==="initialized"){await E;return}u.add(E),E.finally(()=>u.delete(E))},"dispatch"),I=(async()=>{let g=typeof i.host=="function"?await i.host():i.host;for(t=new B(g),l=g.subscribe?.(f=>{if(!t?.initialized){n.push(f);return}s(f)});h.length>0;)await v(h.shift());y=!0})().catch(g=>{b=g,m.close()});try{for await(let g of m){if(!g.trim())continue;if(Buffer.byteLength(g,"utf8")>1e6){await s({jsonrpc:"2.0",id:null,error:{code:-32600,message:"Request exceeds the JSONL size limit"}});continue}let f;try{f=JSON.parse(g)}catch{await s({jsonrpc:"2.0",id:null,error:{code:-32700,message:"Parse error"}});continue}if(!i.hostStorageClient?.accept(f))if(y)await v(f);else if(h.length>=64){let E=f&&typeof f=="object"&&"id"in f?f.id:null;(typeof E=="string"||typeof E=="number")&&await s({jsonrpc:"2.0",id:E,error:{code:-32e3,message:"Runtime startup request limit exceeded"}})}else h.push(f)}if(await I,b)throw b;await Promise.all(u),await r}finally{i.hostStorageClient?.close(),l?.()}}o(Zt,"runAgentJsonlServer");async function*ke(i){if(!Number.isInteger(i.maxRounds)||i.maxRounds<1)throw new Error("Provider maxRounds must be a positive integer.");for(let t=0;t<i.maxRounds;t+=1){if(i.signal.aborted)throw i.signal.reason??new Error("Provider loop interrupted.");yield{index:t,requestId:`${i.turnId}:model:${t}`,signal:i.signal}}}o(ke,"providerRoundSequence");async function Ne(i){for await(let t of ke(i)){let r=await i.runRound(t);if(r.type==="complete")return r.result}return i.onExhausted()}o(Ne,"runProviderRoundLoop");async function Le(i){let t="",r="",n,s=null,c,l=[];try{for await(let m of i.stream){if(await i.onDelta?.(m),i.signal.aborted)throw i.signal.reason??new Error("Provider round interrupted.");m.text&&(t+=m.text),m.reasoningText&&(r+=m.reasoningText),m.usage!==void 0&&(n=m.usage),m.continuation!==void 0&&(s=m.continuation),m.toolCalls&&l.push([...m.toolCalls]),m.finishReason!==void 0&&(c=m.finishReason)}let u={text:t,reasoningText:r,usage:n,continuation:s,toolCallBatches:l,finishReason:c};return await i.onCompleted?.(u),u}catch(u){throw await i.onFailed?.(u),u}}o(Le,"runProviderRound");var N=e.object({threadId:e.string().trim().min(1)}).passthrough(),De=N.extend({includeHistory:e.boolean().optional()}),Fe=e.object({session:e.unknown()}).strict(),V=N.extend({input:e.unknown()}),We=V.extend({idempotencyKey:e.string().trim().min(1).max(200)}),Je=V.extend({inputId:e.string().trim().min(1)}),Ge=N.extend({reason:e.string().trim().min(1).optional()}),Ke=e.object({approvalId:e.string().trim().min(1),input:e.unknown()}).strict();function ar(i){let t=o(async(n,s,c)=>{let l=performance.now();i.telemetry?.({method:n,phase:"started",threadId:s,durationMs:null,errorClass:null});try{let u=await c();return i.telemetry?.({method:n,phase:"completed",threadId:s,durationMs:performance.now()-l,errorClass:null}),u}catch(u){throw i.telemetry?.({method:n,phase:"failed",threadId:s,durationMs:performance.now()-l,errorClass:u instanceof Error?u.name:"UnknownError"}),u}},"run"),r=o(async(n,s="thread/read")=>{let{threadId:c,includeHistory:l}=De.parse(n);return t(s,c,async()=>{if(l===!1)return{thread:await i.readThread(c),turns:[],events:[]};let[u,m,h]=await Promise.all([i.readThread(c),i.listTurns(c),i.listEvents(c)]);return{thread:u,turns:m,events:h}})},"threadRead");return{capabilities:o(n=>t("runtime/capabilities",null,()=>i.capabilities(n)),"capabilities"),threadStart:o(async n=>t("thread/start",null,async()=>({thread:await i.createThread(Fe.parse(n).session)})),"threadStart"),threadResume:o(n=>r(n,"thread/resume"),"threadResume"),threadRead:r,turnStart:o(async n=>{let s=V.parse(n);return t("turn/start",s.threadId,async()=>({turn:await i.startTurn(s.threadId,s.input)}))},"turnStart"),turnSteer:o(async n=>{let s=V.parse(n);return t("turn/steer",s.threadId,async()=>({receipt:await i.steerTurn(s.threadId,s.input)}))},"turnSteer"),taskInbox:o(async n=>{let{threadId:s}=N.parse(n);return t("task/inbox",s,()=>i.readTaskInbox(s))},"taskInbox"),taskQueue:o(async n=>{let s=We.parse(n);return t("task/queue",s.threadId,()=>i.queueTaskInput(s.threadId,s.input,s.idempotencyKey))},"taskQueue"),taskInputUpdate:o(async n=>{let s=Je.parse(n);return t("task/inputUpdate",s.threadId,()=>i.updateTaskInput(s.threadId,s.inputId,s.input))},"taskInputUpdate"),turnInterrupt:o(async n=>{let s=Ge.parse(n);return t("turn/interrupt",s.threadId,async()=>({turn:await i.interruptTurn(s.threadId,s.reason)}))},"turnInterrupt"),approvalResolve:o(async n=>{let s=Ke.parse(n);return t("approval/resolve",null,async()=>({approval:await i.resolveApproval(s.approvalId,s.input)}))},"approvalResolve"),userInputResolve:o(async n=>{let s=V.parse(n);return t("userInput/resolve",s.threadId,async()=>(i.isTurnActive(s.threadId)&&await i.waitForTurnSettlement(s.threadId),{turn:await i.startTurn(s.threadId,s.input)}))},"userInputResolve"),profileWorkflows:o(()=>t("profile/workflows",null,()=>i.listProfileWorkflows()),"profileWorkflows"),profileEvaluations:o(n=>t("profile/evaluations",null,()=>i.listProfileEvaluations(n)),"profileEvaluations"),profileTrainingSource:o(()=>t("profile/trainingSource",null,()=>i.loadProfileTrainingSource()),"profileTrainingSource"),profileEvaluationPrepare:o(n=>t("profile/evaluations/prepare",null,()=>i.prepareProfileEvaluationRun(n)),"profileEvaluationPrepare"),profileEvaluationRun:o(n=>t("profile/evaluations/run",null,()=>i.runPreparedProfileEvaluation(n)),"profileEvaluationRun"),...i.executeExperimentCase?{experimentExecuteCase:o(n=>t("experiments/executeCase",null,()=>i.executeExperimentCase(n)),"experimentExecuteCase")}:{},...i.cancelExperimentCase?{experimentCancelCase:o(n=>t("experiments/cancelCase",null,()=>i.cancelExperimentCase(n)),"experimentCancelCase")}:{},profileEvaluationRunSuite:o(n=>t("profile/evaluations/runSuite",null,()=>i.runProfileEvaluationSuite(n)),"profileEvaluationRunSuite"),profileEvaluationExecuteCase:o(n=>t("profile/evaluations/executeCase",null,()=>i.executeProfileEvaluationCase(n)),"profileEvaluationExecuteCase"),profileEvaluationExecuteRun:o(n=>t("profile/evaluations/executeRun",null,()=>i.executeProfileEvaluationRun(n)),"profileEvaluationExecuteRun"),profileEvaluationCompare:o(n=>t("profile/evaluations/compare",null,()=>i.compareProfileEvaluationRuns(n)),"profileEvaluationCompare"),profileEvaluationReport:o(n=>t("profile/evaluations/report",null,()=>i.buildProfileEvaluationReport(n)),"profileEvaluationReport"),harnessInspect:o(()=>t("harness/inspect",null,()=>i.inspectHarness()),"harnessInspect"),harnessProposalReview:o(n=>t("harness/proposalReview",null,()=>i.reviewHarnessProposal(n)),"harnessProposalReview"),harnessReview:o(n=>t("harness/review",null,()=>i.reviewHarness(n)),"harnessReview"),harnessAcceptEvaluationReview:o(n=>t("harness/acceptEvaluationReview",null,()=>i.acceptHarnessEvaluationReview(n)),"harnessAcceptEvaluationReview"),harnessMaterializeEvaluationTaskset:o(n=>t("harness/materializeEvaluationTaskset",null,()=>i.materializeHarnessEvaluationTaskset(n)),"harnessMaterializeEvaluationTaskset"),harnessRunEvaluationBaseline:o(n=>t("harness/runEvaluationBaseline",null,()=>i.runHarnessEvaluationBaseline(n)),"harnessRunEvaluationBaseline"),harnessValidate:o(()=>t("harness/validate",null,()=>i.validateHarness()),"harnessValidate"),harnessBackgroundReview:o(n=>t("harness/backgroundReview",null,()=>i.updateHarnessBackgroundReview(n)),"harnessBackgroundReview"),harnessDiff:o(n=>t("harness/diff",null,()=>i.diffHarness(n)),"harnessDiff"),harnessRollback:o(n=>t("harness/rollback",null,()=>i.rollbackHarness(n)),"harnessRollback"),refinerInspect:o(()=>t("refiner/inspect",null,()=>i.inspectRefiner()),"refinerInspect"),refinerUpdate:o(n=>t("refiner/update",null,()=>i.updateRefiner(n)),"refinerUpdate"),refinerActivate:o(n=>t("refiner/activate",null,()=>i.activateRefiner(n)),"refinerActivate"),refinerRollback:o(n=>t("refiner/rollback",null,()=>i.rollbackRefiner(n)),"refinerRollback"),subscribe:i.subscribeEvents&&i.eventNotification?n=>i.subscribeEvents(s=>n(i.eventNotification(s))):void 0}}o(ar,"createAgentRuntimeService");var q=e.string().regex(/^[a-f0-9]{64}$/),Qe=e.object({harnessReleaseHash:q,instructionsHash:q,skillHashes:e.record(e.string(),q),agentAssetHashes:e.record(e.string(),q),toolCatalogHash:q,memoryRevision:e.number().int().nonnegative().nullable()}).strict(),Xe=e.object({protocolVersion:e.string().trim().min(1),threadId:e.string().trim().min(1),turnId:e.string().trim().min(1),harnessReleaseHash:q,toolCatalogHash:q,context:e.record(e.string(),e.unknown()),pendingInteraction:e.record(e.string(),e.unknown()).nullable(),usage:e.record(e.string(),e.unknown())}).strict();function pr(i){return R(Qe.parse(i))}o(pr,"effectiveSurfaceHash");function mr(i){return R(Xe.parse(i))}o(mr,"checkpointHash");function hr(i){return[i.system,...i.harnessInstructions,...i.skillInstructions,...i.hostInstructions??[]].map(t=>t.trim()).filter(Boolean).join(`
|
|
4
4
|
|
|
5
5
|
`)}o(hr,"materializeAgentPrompt");function vr(i){let t=new Map;for(let l of i){let u=l.name.trim();if(!u)throw new Error("Agent tool names cannot be empty.");if(t.has(u))throw new Error(`Duplicate agent tool: ${u}.`);if(!l.unavailableReason&&!l.execute)throw new Error(`Agent tool ${u} is declared as available without an executor.`);t.set(u,{...l,name:u})}let r=[...t.values()].sort((l,u)=>l.name.localeCompare(u.name)),n=r.filter(l=>!l.unavailableReason).map(l=>({name:l.name,description:l.description,inputSchema:e.toJSONSchema(l.inputSchema,{target:"draft-7",unrepresentable:"any"})})),s=r.map(l=>({name:l.name,displayLabel:l.displayLabel??l.name,placement:l.placement,available:!l.unavailableReason,unavailableReason:l.unavailableReason??null})),c=R({modelTools:n,capabilities:s});return{byName:t,tools:r,modelTools:n,capabilities:s,hash:c}}o(vr,"createAgentToolCatalog");async function xr(i,t){let r=i.byName.get(t.name);if(!r)throw new Error(`Unknown agent tool: ${t.name}.`);if(r.unavailableReason)throw new Error(`Agent tool ${t.name} is unavailable: ${r.unavailableReason}`);if(!r.execute)throw new Error(`Agent tool ${t.name} has no executor.`);return r.execute(r.inputSchema.parse(t.arguments),t.context)}o(xr,"executeAgentTool");function Ir(i){let t=new Set,r=[...i].map(c=>{let l=c.name.trim();if(!l)throw new Error("Agent tool names cannot be empty.");if(t.has(l))throw new Error(`Duplicate agent tool: ${l}.`);if(t.add(l),!c.unavailableReason&&!c.executorAvailable)throw new Error(`Agent tool ${l} is declared as available without an executor.`);return{...c,name:l}}).sort((c,l)=>c.name.localeCompare(l.name)),n=r.filter(c=>!c.unavailableReason).map(c=>({name:c.name,description:c.description,inputSchema:c.inputSchema})),s=r.map(c=>({name:c.name,displayLabel:c.displayLabel??c.name,placement:c.placement,available:!c.unavailableReason,unavailableReason:c.unavailableReason??null}));return{byName:new Map(r.map(c=>[c.name,c])),tools:r,modelTools:n,capabilities:s,hash:R({modelTools:n,capabilities:s})}}o(Ir,"createAgentToolCatalogProjection");async function yr(i,t){let r=i.byName.get(t.name);if(!r)throw new Error(`Unknown agent tool: ${t.name}.`);if(r.unavailableReason)throw new Error(`Agent tool ${t.name} is unavailable: ${r.unavailableReason}`);if(!r.execute)throw new Error(`Agent tool ${t.name} has no executor.`);let n=r.validateArguments?r.validateArguments(t.arguments):t.arguments;return r.execute(n,t.context)}o(yr,"executeProjectedAgentTool");var je=class{static{o(this,"TaskSignals")}#e=new Map;notify(t){for(let r of[...this.#e.get(t)??[]])r()}subscribe(t,r){let n=this.#e.get(t);return n||this.#e.set(t,n=new Set),n.add(r),()=>{n.delete(r),n.size===0&&this.#e.delete(t)}}async wait(t){let r=o(()=>{},"wake"),n=0,s=o(()=>{n+=1,r()},"changed"),c=[...new Set(t.taskIds)].map(u=>this.subscribe(u,s)),l=setTimeout(s,Math.max(0,t.deadline-Date.now()));t.signal.addEventListener("abort",s);try{for(;;){t.signal.throwIfAborted();let u=n,m=await t.read();if(m!==null)return m;if(Date.now()>=t.deadline)return null;n===u&&await new Promise(h=>{r=h,(n!==u||t.signal.aborted)&&h()})}}finally{clearTimeout(l),t.signal.removeEventListener("abort",s);for(let u of c)u()}}},_e=class{static{o(this,"TaskSerialExecutor")}#e=new Map;async run(t,r){let s=(this.#e.get(t)??Promise.resolve()).then(r),c=s.then(()=>{},()=>{});this.#e.set(t,c);try{return await s}finally{this.#e.get(t)===c&&this.#e.delete(t)}}};var L=class extends Error{static{o(this,"AcpRpcError")}code;data;constructor(t,r,n){super(r),this.code=t,this.data=n,this.name="AcpRpcError"}};import{execFile as Ye}from"node:child_process";function k(i,t){if(i.pid){if(process.platform==="win32"){Ye("taskkill",["/PID",String(i.pid),"/T",...t==="SIGKILL"?["/F"]:[]],{windowsHide:!0},()=>{});return}try{process.kill(-i.pid,t)}catch(r){if(r.code!=="ESRCH")throw r}}}o(k,"signalNativeProcess");import{spawn as Ze}from"node:child_process";import{StringDecoder as et}from"node:string_decoder";var K=8*1024*1024,D={outcome:{outcome:"cancelled"}};function P(i){return i!==null&&typeof i=="object"&&!Array.isArray(i)}o(P,"object");var Se=class{static{o(this,"AcpClient")}options;child=null;pending=new Map;sessions=new Set;activePrompts=new Set;permissions=new Map;nextId=1;buffer="";decoder=new et("utf8");initialized=null;updateQueue=Promise.resolve();stopped=!1;constructor(t){this.options=t}initialize(){return this.initialized?this.initialized:(this.initialized=this.connect(),this.initialized)}async connect(){if(this.stopped)throw new Error("ACP client is closed; reconnect with a new client.");let t=Ze(this.options.command,this.options.args,{cwd:this.options.cwd,env:this.options.env??process.env,stdio:["pipe","pipe","pipe"],shell:!1,detached:process.platform!=="win32"});this.child=t,t.stdout.on("data",r=>this.consume(this.decoder.write(r))),t.stderr.resume(),t.stdin.on("error",r=>this.fail(r)),t.on("error",r=>this.fail(r)),t.on("exit",(r,n)=>this.fail(new Error(`ACP agent exited (${n??r??"unknown"}).`)));try{let r=await this.request("initialize",{protocolVersion:1,clientInfo:{name:"openpond",title:"OpenPond",version:"1"},clientCapabilities:{fs:{readTextFile:!1,writeTextFile:!1},terminal:!1,auth:{terminal:!1}}});if(r.protocolVersion!==1)throw new Error(`Unsupported ACP protocol version: ${r.protocolVersion}`);return r}catch(r){throw await this.stop(),r}}async authenticate(t){let n=(await this.initialize()).authMethods?.find(s=>s.id===t);if(!n)throw new Error("The agent did not advertise this authentication method.");if(n.type==="terminal")throw new Error("Run the agent's terminal login, then reconnect.");await this.request("authenticate",{methodId:t})}async createSession(t,r=[]){await this.initialize();let n=await this.request("session/new",{cwd:t,mcpServers:r});if(typeof n.sessionId!="string"||!n.sessionId)throw new Error("Agent returned no native session identity.");return this.sessions.add(n.sessionId),n}async loadSession(t,r,n=[]){if(!(await this.initialize()).agentCapabilities?.loadSession)throw new Error("This agent does not support native session loading.");this.sessions.add(t);try{let c=await this.request("session/load",{sessionId:t,cwd:r,mcpServers:n});return await this.updateQueue,{...c,sessionId:t}}catch(c){throw this.sessions.delete(t),c}}async setModel(t,r){this.assertSession(t),await this.request("session/set_model",{sessionId:t,modelId:r})}async setMode(t,r){this.assertSession(t),await this.request("session/set_mode",{sessionId:t,modeId:r})}async setConfigOption(t,r,n){return this.assertSession(t),await this.request("session/set_config_option",{sessionId:t,configId:r,value:n})}async prompt(t,r,n){if(this.assertSession(t),n?.aborted)throw new Error("ACP prompt cancelled.");if(this.activePrompts.has(t))throw new Error("A prompt is already active for this native session.");this.activePrompts.add(t);let s,c=o(()=>{this.cancel(t),s=setTimeout(()=>{this.stop()},5e3),s.unref()},"abort");n?.addEventListener("abort",c,{once:!0});try{let l=await this.request("session/prompt",{sessionId:t,prompt:r},0);return await this.updateQueue,n?.aborted?{...l,stopReason:"cancelled"}:l}catch(l){if(n?.aborted)return{stopReason:"cancelled"};throw l}finally{s&&clearTimeout(s),n?.removeEventListener("abort",c),this.activePrompts.delete(t),this.cancelPermissions(t)}}cancel(t){this.cancelPermissions(t),this.sessions.has(t)&&this.child&&this.write({jsonrpc:"2.0",method:"session/cancel",params:{sessionId:t}})}async stop(){if(this.stopped)return;this.stopped=!0;let t=this.child;this.fail(new Error("ACP connection closed.")),!(!t||t.exitCode!==null||t.signalCode!==null)&&await new Promise(r=>{let n=setTimeout(()=>k(t,"SIGKILL"),2e3);n.unref(),t.once("exit",()=>{clearTimeout(n),r()}),k(t,"SIGTERM")})}assertSession(t){if(!this.sessions.has(t))throw new Error("Session does not belong to this ACP connection.")}request(t,r,n=this.options.requestTimeoutMs??3e4){let s=this.nextId++;return new Promise((c,l)=>{let u=n>0?setTimeout(()=>{this.pending.delete(s),l(new Error(`ACP request timed out: ${t}`))},n):void 0;u?.unref(),this.pending.set(s,{resolve:c,reject:l,timer:u});try{this.write({jsonrpc:"2.0",id:s,method:t,params:r})}catch(m){u&&clearTimeout(u),this.pending.delete(s),l(m)}})}write(t){if(!this.child||this.child.stdin.destroyed)throw new Error("ACP connection is not running.");let r=JSON.stringify(t);if(Buffer.byteLength(r)>K)throw new Error("ACP frame exceeds the size limit.");this.child.stdin.write(`${r}
|