openpond 0.2.57 → 0.2.59
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 +2 -1
- package/dist/app-server.js +1 -1
- package/dist/chunks/{actions-command-QU4H53OG.js → actions-command-JJ3CU7J6.js} +1 -1
- package/dist/chunks/{app-layer-NSTE5HIT.js → app-layer-KAUZAHGE.js} +1 -1
- package/dist/chunks/{app-server-connected-apps-JHGWLBXT.js → app-server-connected-apps-SXGZOUJJ.js} +1 -1
- package/dist/chunks/{app-server-evaluations-GJPFWIDA.js → app-server-evaluations-N4OMTPCI.js} +1 -1
- package/dist/chunks/{app-server-harness-services-IH4G6POY.js → app-server-harness-services-DDFUMNYC.js} +1 -1
- package/dist/chunks/app-server-runtime-SVB6L26M.js +2 -0
- package/dist/chunks/{apps-BKTOR4F7.js → apps-EZB56RHV.js} +1 -1
- package/dist/chunks/{chunk-SDXFLO7J.js → chunk-22VMH6JV.js} +1 -1
- package/dist/chunks/{chunk-FTEOCCPB.js → chunk-25JDHAZ5.js} +1 -1
- package/dist/chunks/{chunk-PPAPVGJP.js → chunk-2G4BEISF.js} +1 -1
- package/dist/chunks/{chunk-O72BSKSO.js → chunk-2L5XWJJ5.js} +1 -1
- package/dist/chunks/{chunk-QOTVNQDI.js → chunk-2RNQQNB7.js} +2 -2
- package/dist/chunks/{chunk-O6ULLQJ6.js → chunk-2WKUBGIF.js} +1 -1
- package/dist/chunks/{chunk-F4KOGISR.js → chunk-37MWETFU.js} +1 -1
- package/dist/chunks/{chunk-D74JEERO.js → chunk-3CDEBKSU.js} +1 -1
- package/dist/chunks/{chunk-L6K7ERG5.js → chunk-4EDIRCD3.js} +1 -1
- package/dist/chunks/{chunk-JYKRR7E5.js → chunk-4GPXTISD.js} +1 -1
- package/dist/chunks/chunk-57TRXBLT.js +3 -0
- package/dist/chunks/{chunk-LQQNBVEB.js → chunk-76M2MEHV.js} +1 -1
- package/dist/chunks/{chunk-HCYX6RHP.js → chunk-776WNDV2.js} +1 -1
- package/dist/chunks/{chunk-HDL5YSAA.js → chunk-7AVNZF36.js} +1 -1
- package/dist/chunks/{chunk-3K4VVB7S.js → chunk-7K7O3CKY.js} +1 -1
- package/dist/chunks/chunk-7UH4YDA7.js +3 -0
- package/dist/chunks/{chunk-KUERKVEU.js → chunk-ABZ2ZOLU.js} +1 -1
- package/dist/chunks/{chunk-ZRDGQDZL.js → chunk-ANFDRKUU.js} +1 -1
- package/dist/chunks/{chunk-GWCHDF2C.js → chunk-AQD7K4Z5.js} +1 -1
- package/dist/chunks/{chunk-4D7HWVWD.js → chunk-ARLOVWQ3.js} +1 -1
- package/dist/chunks/{chunk-2QUCCP6Z.js → chunk-ATAOHSFR.js} +1 -1
- package/dist/chunks/{chunk-3RCRSMWZ.js → chunk-BE6SS65L.js} +2 -2
- package/dist/chunks/{chunk-Z54O534A.js → chunk-BGJYITVI.js} +1 -1
- package/dist/chunks/{chunk-BLXEAZCQ.js → chunk-BL3YH2QU.js} +1 -1
- package/dist/chunks/{chunk-2D4Y3HNW.js → chunk-BO5JZYWG.js} +1 -1
- package/dist/chunks/{chunk-ZGTOK7ZK.js → chunk-BQS7Z4AP.js} +1 -1
- package/dist/chunks/{chunk-7HPDGZOR.js → chunk-BRORSFJX.js} +3 -3
- package/dist/chunks/{chunk-XXYGGNVM.js → chunk-BVQWVIGK.js} +1 -1
- package/dist/chunks/{chunk-SWUEFLOH.js → chunk-C37PUHA6.js} +1 -1
- package/dist/chunks/{chunk-3VUATFZD.js → chunk-CGWA54LE.js} +1 -1
- package/dist/chunks/{chunk-EQFGBL3O.js → chunk-CKMSBAI2.js} +1 -1
- package/dist/chunks/{chunk-YOBN7KTF.js → chunk-COHMDT7A.js} +7 -7
- package/dist/chunks/{chunk-JDEEWOD7.js → chunk-DPHAN6N3.js} +1 -1
- package/dist/chunks/{chunk-YOQRYNLP.js → chunk-DZUN5YWB.js} +1 -1
- package/dist/chunks/{chunk-6FDWRG55.js → chunk-E72UU4VX.js} +1 -1
- package/dist/chunks/{chunk-ABD5M2D2.js → chunk-EOBHQ3JT.js} +1 -1
- package/dist/chunks/chunk-EQOV34UH.js +2 -0
- package/dist/chunks/chunk-EUMXMT3S.js +2 -0
- package/dist/chunks/{chunk-773TH7FN.js → chunk-EWOSLZDX.js} +1 -1
- package/dist/chunks/{chunk-HIOKCIL7.js → chunk-FAYASU7Z.js} +1 -1
- package/dist/chunks/{chunk-EIRYMSEG.js → chunk-FKJHEZCW.js} +1 -1
- package/dist/chunks/{chunk-Q2QL6UWN.js → chunk-GL3NX3F3.js} +1 -1
- package/dist/chunks/{chunk-UKMA4R6X.js → chunk-GOPFFQZU.js} +1 -1
- package/dist/chunks/{chunk-RAXOSUSW.js → chunk-GUOLMLZN.js} +1 -1
- package/dist/chunks/{chunk-GZ7M5XBP.js → chunk-GVZLGS2U.js} +1 -1
- package/dist/chunks/chunk-GYJQKCEO.js +5 -0
- package/dist/chunks/{chunk-XDQMGUWL.js → chunk-H7ATCPPB.js} +1 -1
- package/dist/chunks/{chunk-J2TWKFML.js → chunk-IFDALGZE.js} +4 -4
- package/dist/chunks/{chunk-S5ESN275.js → chunk-IRV6GWGG.js} +3 -3
- package/dist/chunks/chunk-JFXINDOQ.js +3 -0
- package/dist/chunks/{chunk-PRGBLQVH.js → chunk-JMBQYBPI.js} +1 -1
- package/dist/chunks/{chunk-DBK66CJP.js → chunk-JQKSXCAJ.js} +1 -1
- package/dist/chunks/{chunk-DARVPBZ4.js → chunk-JUQMSHNR.js} +1 -1
- package/dist/chunks/{chunk-3Z47M3YY.js → chunk-K44RHALX.js} +1 -1
- package/dist/chunks/{chunk-4EPSHPZL.js → chunk-KO3HNMLJ.js} +1 -1
- package/dist/chunks/{chunk-4NESNOK5.js → chunk-LNCHFVHT.js} +1 -1
- package/dist/chunks/{chunk-7E6T7GP5.js → chunk-LPWBIGKW.js} +1 -1
- package/dist/chunks/{chunk-OIUTWU6K.js → chunk-MFMYWZK2.js} +1 -1
- package/dist/chunks/{chunk-A6USMRWK.js → chunk-MMQRHR3V.js} +1 -1
- package/dist/chunks/{chunk-I7AQMAQI.js → chunk-MNC4YUDI.js} +6 -6
- package/dist/chunks/{chunk-ZFSHBFG5.js → chunk-N6ENLEMY.js} +2 -2
- package/dist/chunks/{chunk-SH5CBAFC.js → chunk-NTB2O4RP.js} +1 -1
- package/dist/chunks/{chunk-OQKJGTTO.js → chunk-O3RF72BT.js} +1 -1
- package/dist/chunks/{chunk-QEFHOJFE.js → chunk-O4VIXU7A.js} +1 -1
- package/dist/chunks/{chunk-5MCNZCVQ.js → chunk-OLDK2LKJ.js} +1 -1
- package/dist/chunks/{chunk-WMKYHXVM.js → chunk-OX3XZKGK.js} +2 -2
- package/dist/chunks/{chunk-SDAUS5PY.js → chunk-P2RSBSCT.js} +1 -1
- package/dist/chunks/{chunk-EKM2D7JU.js → chunk-PFSMXKTI.js} +1 -1
- package/dist/chunks/{chunk-FUOEIDMA.js → chunk-PH6IORGZ.js} +1 -1
- package/dist/chunks/{chunk-PUZQU66L.js → chunk-PQJTYOR2.js} +1 -1
- package/dist/chunks/{chunk-OLLLZVHF.js → chunk-PY6K2JRH.js} +1 -1
- package/dist/chunks/{chunk-EYPCBBMS.js → chunk-RBZH6A6M.js} +1 -1
- package/dist/chunks/{chunk-6QSSIT62.js → chunk-RZUEVS64.js} +1 -1
- package/dist/chunks/{chunk-Q5LEXXJG.js → chunk-SF5HJ7PL.js} +4 -4
- package/dist/chunks/{chunk-NHQ36THU.js → chunk-TG7P7BSV.js} +1 -1
- package/dist/chunks/{chunk-G3RXYI2L.js → chunk-TIHXUKFD.js} +1 -1
- package/dist/chunks/{chunk-QOGJAQDO.js → chunk-TKLBP3MM.js} +1 -1
- package/dist/chunks/{chunk-M4JWQSV7.js → chunk-U2MAPON2.js} +1 -1
- package/dist/chunks/chunk-U5FKRYJO.js +86 -0
- package/dist/chunks/{chunk-QNG27G3T.js → chunk-V34H7Y2T.js} +2 -2
- package/dist/chunks/chunk-VGRMAGOK.js +9 -0
- package/dist/chunks/chunk-VRODAXFS.js +145 -0
- package/dist/chunks/{chunk-EIEZHFIW.js → chunk-WC42WOLG.js} +1 -1
- package/dist/chunks/{chunk-OS3LO5J3.js → chunk-WRI4XKSK.js} +1 -1
- package/dist/chunks/{chunk-XTFPDQMH.js → chunk-XJZSIXEO.js} +2 -2
- package/dist/chunks/{chunk-25MBPJVY.js → chunk-XMKCCLGB.js} +1 -1
- package/dist/chunks/{chunk-HZEIRHEB.js → chunk-XMWXH7TS.js} +1 -1
- package/dist/chunks/chunk-YCQSVHCD.js +9 -0
- package/dist/chunks/{chunk-B7RFL4N2.js → chunk-YHHF4Q7Y.js} +1 -1
- package/dist/chunks/{chunk-DMVD2RFZ.js → chunk-ZAN4DYLH.js} +1 -1
- package/dist/chunks/chunk-ZH3K7LKQ.js +2 -0
- package/dist/chunks/cli-5DFVQL5Y.js +2 -0
- package/dist/chunks/{configuration-command-6C5UO7GE.js → configuration-command-JS6U3RMC.js} +1 -1
- package/dist/chunks/connected-app-executor-UBMGMV76.js +2 -0
- package/dist/chunks/{connected-evidence-GH2ATNEX.js → connected-evidence-NLAIEVQ3.js} +1 -1
- package/dist/chunks/connection-NZSD3U5O.js +2 -0
- package/dist/chunks/{continual-6CQAMTTR.js → continual-WFPIDWPH.js} +1 -1
- package/dist/chunks/core-commands-U4IBRRY5.js +2 -0
- package/dist/chunks/{datasets-7BNMVJOY.js → datasets-UX47DTTB.js} +1 -1
- package/dist/chunks/{desktop-test-3CUHVLXV.js → desktop-test-UUU7PD4P.js} +1 -1
- package/dist/chunks/{dist-VYC5VMQB.js → dist-OGLX76LL.js} +1 -1
- package/dist/chunks/{dist-ZVJPJLXR.js → dist-W5MJYSPF.js} +1 -1
- package/dist/chunks/{evaluation-coordination-XEF5L7KZ.js → evaluation-coordination-3YQN5JQW.js} +1 -1
- package/dist/chunks/{experiment-improvements-KRX2DP27.js → experiment-improvements-ZRVD2AGY.js} +1 -1
- package/dist/chunks/{experiments-DFGQYA4O.js → experiments-JEB5A2N5.js} +1 -1
- package/dist/chunks/{extension-XKXXOP5N.js → extension-JCUA3RWV.js} +1 -1
- package/dist/chunks/{help-S7THC6IE.js → help-KA4OINP5.js} +1 -1
- package/dist/chunks/host-profile-evaluation-tools-2URLU5SG.js +2 -0
- package/dist/chunks/host-profile-external-dataset-B2AQNSDR.js +2 -0
- package/dist/chunks/{hosted-app-server-composition-HPL3CRXN.js → hosted-app-server-composition-VJQ3FM4I.js} +1 -1
- package/dist/chunks/{hosted-experiment-improvement-NFSVS5TU.js → hosted-experiment-improvement-42YWXB3P.js} +1 -1
- package/dist/chunks/hosted-harness-runtime-BM4WONJN.js +2 -0
- package/dist/chunks/{hosted-profile-candidate-2S5LFUWD.js → hosted-profile-candidate-HVVC43XQ.js} +1 -1
- package/dist/chunks/hosted-profile-compiler-RKDWHYK3.js +2 -0
- package/dist/chunks/{hosted-profile-evaluation-control-76BTRTYD.js → hosted-profile-evaluation-control-57V24UGU.js} +1 -1
- package/dist/chunks/{hosted-profile-evaluation-inspection-V6Z3A5XJ.js → hosted-profile-evaluation-inspection-BUWLCKCD.js} +1 -1
- package/dist/chunks/{hosted-profile-evaluation-preparation-IDJYREW3.js → hosted-profile-evaluation-preparation-3XLRR6UH.js} +1 -1
- package/dist/chunks/{hosted-tasksets-ANAE2PIW.js → hosted-tasksets-THKM5QY5.js} +1 -1
- package/dist/chunks/{human-review-WR777ODH.js → human-review-CSYAW4PC.js} +1 -1
- package/dist/chunks/import-CBDJ4DME.js +3 -0
- package/dist/chunks/local-harness-improvement-runtime-3T6E7I5Q.js +2 -0
- package/dist/chunks/local-harness-taskset-review-LQPQBALH.js +2 -0
- package/dist/chunks/{opchat-T4QTNEIY.js → opchat-6ADSONAD.js} +1 -1
- package/dist/chunks/{organizations-75L5DZDV.js → organizations-GT24ZTCN.js} +1 -1
- package/dist/chunks/{profile-TFZMUEDR.js → profile-Y2MCSOUK.js} +1 -1
- package/dist/chunks/project-action-payload-GHSLE7K3.js +2 -0
- package/dist/chunks/{project-agent-6RRO233B.js → project-agent-YYSQIHVE.js} +1 -1
- package/dist/chunks/{published-experiment-source-DZFENAQA.js → published-experiment-source-5TMGLKDM.js} +1 -1
- package/dist/chunks/refiner-profile-service-ZK7KAFP5.js +2 -0
- package/dist/chunks/{runtime-A7OZXM43.js → runtime-QFXCXSVB.js} +2 -2
- package/dist/chunks/{sandbox-command-IU5XFTJP.js → sandbox-command-U6346TVJ.js} +1 -1
- package/dist/chunks/{sandbox-template-C4V6T36U.js → sandbox-template-XWWPWWNR.js} +1 -1
- package/dist/chunks/saved-work-SWHZ4OLO.js +2 -0
- package/dist/chunks/{send-turn-XTAIS2JN.js → send-turn-SIXOZUVJ.js} +1 -1
- package/dist/chunks/{src-LMC3K6LH.js → src-6SHCCYEN.js} +1 -1
- package/dist/chunks/{src-INHPJ63Z.js → src-EZAKCCUV.js} +56 -56
- package/dist/chunks/standalone-experiment-turn-owner-LIAQWTGI.js +2 -0
- package/dist/chunks/{store-continual-support-reviews-HHA6NX7K.js → store-continual-support-reviews-GDX6CSUU.js} +1 -1
- package/dist/chunks/{store-conversation-serving-KPC62UEY.js → store-conversation-serving-W55XMDH4.js} +1 -1
- package/dist/chunks/{store-create-improve-QV54XIZW.js → store-create-improve-A7E7CUPZ.js} +1 -1
- package/dist/chunks/{store-datasets-RXJ33SUN.js → store-datasets-HKF3EO7B.js} +1 -1
- package/dist/chunks/{store-evaluation-results-3F3P527G.js → store-evaluation-results-645RFBGR.js} +1 -1
- package/dist/chunks/{store-human-review-RAH7WMIP.js → store-human-review-F5KESW52.js} +1 -1
- package/dist/chunks/{store-learned-preference-migration-validation-4CI2IRUF.js → store-learned-preference-migration-validation-V27XD4I7.js} +1 -1
- package/dist/chunks/{store-local-experiments-5LUJR7GI.js → store-local-experiments-HWQWNTIU.js} +1 -1
- package/dist/chunks/{store-model-batch-review-YEGX327M.js → store-model-batch-review-TOCSDVAP.js} +1 -1
- package/dist/chunks/{store-model-configuration-5ZURQATB.js → store-model-configuration-6543ASY2.js} +1 -1
- package/dist/chunks/{store-sidebar-file-bookmarks-VB5GTLFY.js → store-sidebar-file-bookmarks-53B7QIGS.js} +1 -1
- package/dist/chunks/{store-sidebar-preferences-GWIOG2NH.js → store-sidebar-preferences-YXGEJVUO.js} +1 -1
- package/dist/chunks/{store-subagents-T7R2Z6TB.js → store-subagents-HRCAK7VZ.js} +1 -1
- package/dist/chunks/{store-task-inbox-JJTBW76C.js → store-task-inbox-WF74W4U2.js} +11 -11
- package/dist/chunks/{store-task-inventory-OB3F2APC.js → store-task-inventory-KHCTEZVK.js} +1 -1
- package/dist/chunks/{store-taskset-drafts-EKQWWFYQ.js → store-taskset-drafts-3ACG5AVX.js} +1 -1
- package/dist/chunks/{store-training-G6YLFSIR.js → store-training-R46WOGXB.js} +1 -1
- package/dist/chunks/{store-training-jobs-RC46YBF6.js → store-training-jobs-D4LECE7O.js} +1 -1
- package/dist/chunks/{store-training-models-6BA43IPP.js → store-training-models-EQVNXOVB.js} +1 -1
- package/dist/chunks/{taskset-EQRFQBYM.js → taskset-NR2X2UOK.js} +1 -1
- package/dist/chunks/{taskset-packages-XC6HEE3K.js → taskset-packages-ONULEIVI.js} +1 -1
- package/dist/chunks/{teams-bot-EAPGPTHZ.js → teams-bot-CHUYMD6K.js} +1 -1
- package/dist/chunks/{training-UF6RPI4T.js → training-IDSGYGU2.js} +1 -1
- package/dist/chunks/{web-search-CZ3NCLPY.js → web-search-BPON7H5N.js} +1 -1
- package/dist/chunks/{workspaces-EKKE5NAC.js → workspaces-2TJRDM5K.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/web/assets/App-pcwmC4IR.js +154 -0
- package/dist/web/assets/{AppDialog-t2Fx5tK3.js → AppDialog-CdHad7GT.js} +1 -1
- package/dist/web/assets/{AppTerminalPanel-Dj1Y32oI.js → AppTerminalPanel-CrmoOgd4.js} +2 -2
- package/dist/web/assets/AppsView-0P6cBsD4.js +1 -0
- package/dist/web/assets/{BrowserSidebar-jhWi4rVm.js → BrowserSidebar-Cb6edJw6.js} +1 -1
- package/dist/web/assets/{CartesianChart-C1DIx0Ia.js → CartesianChart-B2Sxi0lv.js} +1 -1
- package/dist/web/assets/{CollaborationTabs-Bdr-HmOL.js → CollaborationTabs-PP0AIXhb.js} +1 -1
- package/dist/web/assets/{CommandMenu-Ux2yOHAc.js → CommandMenu-GfQIMe6W.js} +1 -1
- package/dist/web/assets/{CommunityView-DPEeVKFn.js → CommunityView-V6KmMl5n.js} +1 -1
- package/dist/web/assets/ComposerCreateImproveStrip-oeVeyhPX.js +1 -0
- package/dist/web/assets/ConversationImportsSettings-CuQcvVgE.js +1 -0
- package/dist/web/assets/ConversationImportsSettings-PfUa8V7X.css +1 -0
- package/dist/web/assets/{GetStartedView-CFHP0AaI.js → GetStartedView-2oZ068h_.js} +1 -1
- package/dist/web/assets/{HostedModelLearningReview-D8BGTPVN.js → HostedModelLearningReview-DLzak_Vf.js} +1 -1
- package/dist/web/assets/{HostedModelLearningSettings-JS1S7vNO.js → HostedModelLearningSettings-Eca6Pd9R.js} +1 -1
- package/dist/web/assets/{LabModelVersionDetailPage-Dx5Q3xV2.js → LabModelVersionDetailPage-DsBblnMp.js} +1 -1
- package/dist/web/assets/LabSkillSidebar-DDknttrB.js +1 -0
- package/dist/web/assets/{LabsRoute-CyYF8-dw.js → LabsRoute-CgNiUHsy.js} +4 -4
- package/dist/web/assets/MainChatThread-yCVg99LU.js +2 -0
- package/dist/web/assets/MainPane-C86le7UF.js +65 -0
- package/dist/web/assets/{MarkdownText-BR4V6lNO.js → MarkdownText-BBVriBCj.js} +1 -1
- package/dist/web/assets/{NativeSkillSidebar-DU9IEgIO.js → NativeSkillSidebar-D2uVZkqh.js} +1 -1
- package/dist/web/assets/{NewExperienceSwitcher-mIy6FzCj.js → NewExperienceSwitcher-DuD6GScJ.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-RfTZTHxl.js → NewProjectDialog-B6XZkJrU.js} +1 -1
- package/dist/web/assets/OutputsPage-PUlmcWjv.js +1 -0
- package/dist/web/assets/{ProjectsPage-CE6QUB-b.js → ProjectsPage-DWBRmej6.js} +1 -1
- package/dist/web/assets/RightChatPanelStack-HaCVep4t.js +1 -0
- package/dist/web/assets/{RightSidebarHomePanel-CK0rP3WT.js → RightSidebarHomePanel-BUtdPb2L.js} +1 -1
- package/dist/web/assets/{ScheduledWorkPage-vOrYv8pp.js → ScheduledWorkPage-Dg9GkGrT.js} +1 -1
- package/dist/web/assets/SettingsView-DjjnCnlb.css +1 -0
- package/dist/web/assets/{SettingsView-DCKVrfjj.js → SettingsView-DtldfnV-.js} +4 -4
- package/dist/web/assets/{TeamChatView-Bwrjr-vk.js → TeamChatView-C71JX4je.js} +2 -2
- package/dist/web/assets/{TerminalOverlay-DhPoKZAq.js → TerminalOverlay-B4F6Q36s.js} +1 -1
- package/dist/web/assets/TrainingCreationPanel-B9MxFzQx.js +1 -0
- package/dist/web/assets/{TrainingDraftPanel-C9cRX5qf.js → TrainingDraftPanel-7C48sHfC.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-CrdcSGeW.js → UsageSettingsSection-CC57FcUB.js} +1 -1
- package/dist/web/assets/{WorkSidebarPanel-DSSikNFQ.js → WorkSidebarPanel-Cto1usLM.js} +1 -1
- package/dist/web/assets/{WorkspaceDiffPanel-BAFo0CPN.js → WorkspaceDiffPanel-CL7wi3kp.js} +3 -3
- package/dist/web/assets/{WorkspaceEnvironmentMenu-BVHAhwnJ.js → WorkspaceEnvironmentMenu-zdzSDofs.js} +18 -18
- package/dist/web/assets/{WorkspaceGitDialogs-CwVoiDQ2.js → WorkspaceGitDialogs-CZSmjnrc.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-TxLyhzNp.js → WorkspaceMonacoEditor-TrUDJMKb.js} +3 -3
- package/dist/web/assets/agent-connections-4Dza2mDg.js +1 -0
- package/dist/web/assets/{arrow-up-right-C9aE8Mfz.js → arrow-up-right-xKb5kWQJ.js} +1 -1
- package/dist/web/assets/{chunk-P3BRSSRD-DUGfuKA8.js → chunk-P3BRSSRD-BsGTkgyC.js} +1 -1
- package/dist/web/assets/{clipboard-Dk158Qp4.js → clipboard-BgjV3aCx.js} +1 -1
- package/dist/web/assets/{cloud-upload-k9eqBsHr.js → cloud-upload-Bw9XUsKQ.js} +1 -1
- package/dist/web/assets/{cssMode-CO35ARZp.js → cssMode-DxsFJGb-.js} +1 -1
- package/dist/web/assets/{folder-open-sYgceW_f.js → folder-open-CbmUjIYS.js} +1 -1
- package/dist/web/assets/{folder-plus-CS0R49m9.js → folder-plus-slsst7Ct.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-DrGxH2h4.js → git-commit-horizontal-BIS-8MuS.js} +1 -1
- package/dist/web/assets/{htmlMode-REMmzdfq.js → htmlMode-BE4VOrZo.js} +1 -1
- package/dist/web/assets/{index-C8aCGagb.js → index-DEg0S7Qk.js} +2 -2
- package/dist/web/assets/index-erq7hUne.css +1 -0
- package/dist/web/assets/{info-DLdbiUrh.js → info-5bL9xSSf.js} +1 -1
- package/dist/web/assets/{jsonMode-KEdMfkIf.js → jsonMode-CYimnBhD.js} +1 -1
- package/dist/web/assets/{lspLanguageFeatures-5KZwEoxW.js → lspLanguageFeatures-CiFuk-P7.js} +1 -1
- package/dist/web/assets/{minimize-2-CqcI4zcM.js → minimize-2-BGVWKvTg.js} +1 -1
- package/dist/web/assets/{monaco.contribution-omszXBEj.js → monaco.contribution-BTY4dJ0f.js} +2 -2
- package/dist/web/assets/{monaco.contribution-BJGj65F9.js → monaco.contribution-C7sMrcos.js} +2 -2
- package/dist/web/assets/{monaco.contribution-DO10L0zW.js → monaco.contribution-DUE3CQph.js} +2 -2
- package/dist/web/assets/{monaco.contribution-Cly9Wt7L.js → monaco.contribution-DkLVGT8N.js} +2 -2
- package/dist/web/assets/{monitor-BFVCcbxp.js → monitor-B5hx_tzp.js} +1 -1
- package/dist/web/assets/{play-C469pVZq.js → play-pmSO95Qg.js} +1 -1
- package/dist/web/assets/{python-Dw0YcVy9.js → python-CiZvL3LX.js} +1 -1
- package/dist/web/assets/{save-CtSjPydi.js → save-CvYL4DUg.js} +1 -1
- package/dist/web/assets/{square-BuImvLhT.js → square-DT_uFOml.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-DjCO9lIP.js → toggleHighContrast-CrE1_HY0.js} +1 -1
- package/dist/web/assets/{tsMode-BAOnxKd6.js → tsMode-CI_PdZmj.js} +1 -1
- package/dist/web/assets/{upload-2JkFZo3h.js → upload-PVi8vC3T.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules-BNqAisfS.js → useLocalAgentSchedules-BHJNVf42.js} +1 -1
- package/dist/web/assets/useProviderSettings-CU3zXyie.js +5 -0
- package/dist/web/assets/{useProviderSettings-CmL_BaxP.css → useProviderSettings-Cktvzinz.css} +1 -1
- package/dist/web/assets/{useSessionTurnCache-BHU2-Jmz.js → useSessionTurnCache-BE7cipLX.js} +1 -1
- package/dist/web/assets/{wifi-off-CpOAH62M.js → wifi-off-7WiFuOhD.js} +1 -1
- package/dist/web/assets/{workers-0QvlA2T5.js → workers-Cv8r4CvM.js} +1 -1
- package/dist/web/assets/{yaml-BK3qxo7D.js → yaml-Bj7mdkV2.js} +1 -1
- package/dist/web/index.html +2 -2
- package/docs/command-reference.md +10 -3
- package/docs/conversation-imports.md +57 -0
- package/package.json +1 -1
- package/dist/chunks/app-server-runtime-VCRNCNX2.js +0 -2
- package/dist/chunks/chunk-FV2R5RUN.js +0 -3
- package/dist/chunks/chunk-FY5KHLMW.js +0 -2
- package/dist/chunks/chunk-HY3GOBFJ.js +0 -58
- package/dist/chunks/chunk-KG325WTN.js +0 -2
- package/dist/chunks/chunk-MULXCKG7.js +0 -10
- package/dist/chunks/chunk-OGDADQGH.js +0 -143
- package/dist/chunks/chunk-QHWGQ3A4.js +0 -5
- package/dist/chunks/chunk-VRIEKBBH.js +0 -9
- package/dist/chunks/chunk-WJ43MJ3F.js +0 -2
- package/dist/chunks/chunk-YY7LEQGP.js +0 -2
- package/dist/chunks/cli-X25RSO2X.js +0 -2
- package/dist/chunks/connected-app-executor-IVLGQP65.js +0 -2
- package/dist/chunks/connection-HTF6CC7M.js +0 -2
- package/dist/chunks/core-commands-A2DGGIPS.js +0 -2
- package/dist/chunks/host-profile-evaluation-tools-NRLXL2S5.js +0 -2
- package/dist/chunks/host-profile-external-dataset-K3ICDHIP.js +0 -2
- package/dist/chunks/hosted-harness-runtime-723S5ZSH.js +0 -2
- package/dist/chunks/hosted-profile-compiler-2DQIFSXW.js +0 -2
- package/dist/chunks/import-MLZUHITH.js +0 -4
- package/dist/chunks/local-harness-improvement-runtime-JIQ6ZVDW.js +0 -2
- package/dist/chunks/local-harness-taskset-review-XVYTGAGK.js +0 -2
- package/dist/chunks/project-action-payload-7VGL7OER.js +0 -2
- package/dist/chunks/refiner-profile-service-UUIWFJVT.js +0 -2
- package/dist/chunks/saved-work-6BMBFP43.js +0 -2
- package/dist/chunks/standalone-experiment-turn-owner-JCY5LL5R.js +0 -2
- package/dist/web/assets/App-s-CJswyt.js +0 -154
- package/dist/web/assets/AppsView-BYE5EBDJ.js +0 -1
- package/dist/web/assets/ComposerCreateImproveStrip-CEgh4OtN.js +0 -1
- package/dist/web/assets/LabSkillSidebar-BxffN-pN.js +0 -1
- package/dist/web/assets/MainChatThread-DZpcFRFl.js +0 -2
- package/dist/web/assets/MainPane-5DTtwVCk.js +0 -65
- package/dist/web/assets/OutputsPage-Cr1Spf7S.js +0 -1
- package/dist/web/assets/RightChatPanelStack-T6VRWuHo.js +0 -1
- package/dist/web/assets/SettingsView-Dulr_xlq.css +0 -1
- package/dist/web/assets/TrainingCreationPanel-BXHfohNm.js +0 -1
- package/dist/web/assets/index-3iPNbbER.css +0 -1
- package/dist/web/assets/useProviderSettings-C4L4wDoh.js +0 -5
|
@@ -0,0 +1,9 @@
|
|
|
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 Pe}from"node:crypto";function G(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(G);if(typeof i=="object"){let t={};for(let r of Object.keys(i).sort()){let n=i[r];n!==void 0&&(t[r]=G(n))}return t}throw new Error(`Canonical JSON cannot encode ${typeof i}.`)}o(G,"canonicalJson");function C(i){return Pe("sha256").update(JSON.stringify(G(i)),"utf8").digest("hex")}o(C,"canonicalHash");function at(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(at,"agentCompactionDecision");async function ct(i){await i.started();try{return await i.compact()}catch(t){throw await i.failed(t),t}}o(ct,"runAgentCompaction");async function lt(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}),f=Date.now(),v=(await i.host.streamSummary({model:i.model,messages:y,signal:i.signal})).trim(),x=Date.now()-f;if(!v)throw new Error("Compaction summary was empty.");let _=i.host.estimateProjection({events:t,preservedEvents:s,summary:v}),g=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:_.inputTokensAfter,durationMs:x,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:_.inputTokensBefore,inputTokensAfter:_.inputTokensAfter,maxContextTokens:i.maxContextTokens,tokenSource:"heuristic",metrics:g}}o(lt,"runAgentCompactionProgram");var Ae=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"]),ze=e.object({sequence:e.number().int().nonnegative(),name:Ae,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 ht(i){return C(ze.parse(i))}o(ht,"canonicalEventHash");var H="2026-09-20",wt=["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"],te=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(),re=e.object({jsonrpc:e.literal("2.0"),method:e.string().trim().min(1),params:e.unknown().optional()}).strict(),K=e.object({jsonrpc:e.literal("2.0"),id:e.union([e.string(),e.number()]),result:e.unknown()}).strict(),Q=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(),vt=e.union([te,re,K,Q]),He=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(),L=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=re.safeParse(t);if(r.success&&!("id"in t)){if(r.data.method==="initialized"){if(!this.#t)throw new q(-32002,"initialize must be called first");this.#r=!0}return null}let n=te.safeParse(t);if(!n.success)return ee(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 q?c:new q(-32603,c instanceof Error?c.message:String(c));return ee(s.id,l.code,l.message,l.data)}}async#n(t,r){if(t==="initialize"){let n=He.parse(r);if(n.protocolVersion!==H)throw new q(-32001,"Incompatible agent protocol version",{requested:n.protocolVersion,supported:H});return this.#t=n,{protocolVersion:H,server:{name:"openpond-app-server",version:"1"},capabilities:await this.#e.capabilities()}}if(!this.#r)throw new q(-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 q(-32601,`Method not found: ${t}`)}}},q=class extends Error{static{o(this,"JsonRpcDispatchError")}code;data;constructor(t,r,n){super(r),this.code=t,this.data=n}};function ee(i,t,r,n){return{jsonrpc:"2.0",id:i,error:{code:t,message:r,...n===void 0?{}:{data:n}}}}o(ee,"jsonRpcError");var ne=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:H,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 X=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),D=e.string().trim().min(1).max(32e3),M=e.number().int().nonnegative(),ie=e.object({id:d,sessionId:d,senderSessionId:d.nullable(),senderKind:e.enum(["user","task","runtime"]),kind:e.enum(["steer","message","followup","queued","result"]),body:D,payload:e.record(e.string(),e.unknown()),idempotencyKey:d,replyTo:d.nullable(),expectedTurnId:d.nullable()}).strict(),Me=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:D}).strict(),e.object({action:e.literal("steer"),expectedRevision:e.number().int().positive(),expectedTurnId:d}).strict()]),se=e.object({id:d,sessionId:d,turnId:d,targetSessionId:d.nullable(),targetTurnId:d.nullable(),targetInputId:d.nullable(),afterSequence:M,deadline:e.string(),state:e.enum(["waiting","message","completed","failed","interrupted","unavailable","timeout","cancelled"]),createdAt:e.string(),updatedAt:e.string()}).strict(),oe=e.record(e.string(),e.unknown()),Ve=e.enum(["queued","running","completed","failed","cancelled","needs_resume"]),Ue=e.object({parentSessionId:d.nullable().optional(),childSessionId:d.nullable().optional(),status:e.array(Ve).nullable().optional(),afterId:e.string().max(200),limit:e.number().int().min(1).max(10)}).strict(),ae=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:M}).strict(),e.object({action:e.literal("declareTaskWork"),sessionId:d,turnId:d,ownerId:d,areas:e.array(D).max(100)}).strict(),e.object({action:e.literal("taskWorkAreas"),sessionId:d}).strict(),e.object({action:e.literal("admitTaskInput"),input:ie}).strict(),e.object({action:e.literal("admitTaskInputs"),inputs:e.array(ie).max(50)}).strict(),e.object({action:e.literal("rejectTaskInput"),id:d,error:D}).strict(),e.object({action:e.literal("getTaskInput"),id:d}).strict(),e.object({action:e.literal("taskInputsForSession"),sessionId:d,query:e.object({afterSequence:M.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:Me}).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:M}).strict(),e.object({action:e.literal("taskAssignmentInputs"),turnId:d,afterSequence:M}).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:se}).strict(),e.object({action:e.literal("settleTaskWait"),id:d,state:se.shape.state}).strict(),e.object({action:e.literal("taskWaitsForSession"),sessionId:d,afterId:e.string().max(200)}).strict(),e.object({action:e.literal("commitSubagentCompletion"),value:oe,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:oe}).strict(),e.object({action:e.literal("getSubagentRun"),id:d}).strict(),e.object({action:e.literal("listSubagentRuns"),query:Ue}).strict()]);var V=e.string().trim().min(1).max(191),ce=e.object({createdAt:e.string().min(1),id:V}).strict(),le=e.enum(["trigger_decision","route_decision","refiner_outcome","proposal","targeted_validation","apply_receipt"]),ue=e.discriminatedUnion("action",[e.object({action:e.literal("active_release"),workspaceId:V}).strict(),e.object({action:e.literal("put_artifact"),workspaceId:V,kind:le,artifact:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("artifact_page"),workspaceId:V,kind:le,before:ce.nullable(),limit:e.number().int().min(1).max(200)}).strict(),e.object({action:e.literal("pending_trigger_page"),workspaceId:V,before:ce.nullable(),limit:e.number().int().min(1).max(200)}).strict()]);var w=e.string().trim().min(1).max(240),de=e.string().regex(/^[a-f0-9]{64}$/),pe=e.enum(["run_overlay","observation","trigger_decision","route_decision","proposal","targeted_validation","apply_receipt","refiner_outcome"]),me=e.object({createdAt:e.string().datetime(),id:w}).strict(),he=e.discriminatedUnion("action",[e.object({action:e.literal("artifact_put"),workspaceId:w,kind:pe,artifact:e.record(e.string(),e.unknown())}).strict(),e.object({action:e.literal("artifact_page"),workspaceId:w,kind:pe,before:me.nullable(),limit:e.number().int().min(1).max(100)}).strict(),e.object({action:e.literal("pending_page"),workspaceId:w,before:me.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:de}).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:de,snapshot:e.record(e.string(),e.unknown())}).strict()]);var E=e.string().trim().min(1).max(200),fe=e.string().regex(/^[a-f0-9]{64}$/),Oe=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()}),be=e.object({id:E,title:e.string().trim().min(1).max(240),sourceTaskId:E,sourceTurnId:E,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:fe,validation:e.array(Oe).max(32)}).strict(),ge=e.object({sessionId:E,turnId:E,output:be}).strict(),we=e.object({uploadId:E,index:e.number().int().min(0).max(1024),offset:e.number().int().min(0).max(1e7),sha256:fe,contentsBase64:e.string().min(1).max(131072)}).strict(),ve=e.object({uploadId:E}).strict(),$e=be.pick({id:!0,title:!0,sourceTaskId:!0,sourceTurnId:!0,revision:!0,createdAt:!0,validation:!0}),xe=e.object({sessionId:E,turnId:E,output:$e,sandboxPath:e.string().trim().min(1).max(4096)}).strict();var U=e.string().trim().min(1).max(200),Be=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:U.optional(),payload:e.unknown().optional(),processId:U.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."})}),Ie=e.object({action:Be}).strict(),ye=e.object({sessionId:U,turnId:U,name:U}).strict();var p=1,a=e.string().trim().min(1).max(191),P=e.number().int().min(1).max(200),Dt=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(),ke=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:X}).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:Ie}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("embedding/authorize"),params:ye}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/begin"),params:ge}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/chunk"),params:we}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/complete"),params:ve}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("output/saveSandboxFile"),params:xe}).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:P}).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:ae}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("harness/review/execute"),params:he}).strict(),e.object({contractVersion:e.literal(p),requestId:a,operation:e.literal("refiner/execute"),params:e.object({action:ue}).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:P}).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:P}).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:P}).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:P}).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:P}).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:P,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()]),Ft=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:P,maxRequestBytes:e.number().int().min(1).max(8388608),maxInFlight:e.number().int().min(1).max(64)}).strict();var je=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=ke.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=this.#t,m=new Promise((h,y)=>{let f=n.operation==="profile-evaluations/grade"?42e4:n.operation==="sandbox/request"||n.operation==="profile-evaluations/sandbox"||l?3e5:6e4,v=Math.max(1,Math.min(f,r)),x=setTimeout(()=>{this.#e.delete(s),y(new Error(`Host storage request timed out: operation=${n.operation}, request=${s}, deadlineMs=${v}.`))},v);this.#e.set(s,{resolve:h,reject:y,timer:x,maxResponseBytes:n.operation==="experiment/environment"?16e5:1e6})});return Promise.resolve().then(()=>u(c)).catch(h=>{let y=this.#e.get(s);y&&(clearTimeout(y.timer),this.#e.delete(s),y.reject(h instanceof Error?h:new Error(String(h))))}),m}accept(t){let r=K.safeParse(t),n=r.success?null:Q.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 Ne}from"node:events";import{createInterface as Le}from"node:readline";async function tr(i){let t=null,r=Promise.resolve(),n,s=o(b=>{n??=b,i.hostStorageClient?.close(),y.close()},"observeFailure"),c=[],l=o(b=>(r=r.then(async()=>{i.writable.write(`${JSON.stringify(b)}
|
|
3
|
+
`)||await Ne(i.writable,"drain")}),r.catch(s),r),"write");i.hostStorageClient?.bind(b=>l(b));let u=o(()=>{if(!(!t?.initialized||c.length===0))for(let b of c.splice(0))l(b)},"flushPendingNotifications"),m,h=new Set,y=Le({input:i.readable,crlfDelay:1/0}),f=[],v=!1,x=null,_=o(async b=>{let k=t;if(!k)throw new Error("Agent runtime dispatcher is unavailable.");let S=(async()=>{let N=await k.handle(b);N&&await l(N),u()})(),Z=b&&typeof b=="object"&&"method"in b?b.method:null;if(Z==="initialize"||Z==="initialized"){await S;return}h.add(S),S.then(()=>{h.delete(S)},N=>{h.delete(S),s(N)})},"dispatch"),g=(async()=>{let b=typeof i.host=="function"?await i.host():i.host;for(t=new L(b),m=b.subscribe?.(k=>{if(!t?.initialized){c.push(k);return}l(k)});f.length>0;)await _(f.shift());v=!0})().catch(b=>{x=b,y.close()});try{for await(let b of y){if(!b.trim())continue;if(Buffer.byteLength(b,"utf8")>1e6){await l({jsonrpc:"2.0",id:null,error:{code:-32600,message:"Request exceeds the JSONL size limit"}});continue}let k;try{k=JSON.parse(b)}catch{await l({jsonrpc:"2.0",id:null,error:{code:-32700,message:"Parse error"}});continue}if(!i.hostStorageClient?.accept(k))if(v)await _(k);else if(f.length>=64){let S=k&&typeof k=="object"&&"id"in k?k.id:null;(typeof S=="string"||typeof S=="number")&&await l({jsonrpc:"2.0",id:S,error:{code:-32e3,message:"Runtime startup request limit exceeded"}})}else f.push(k)}if(i.hostStorageClient?.close(),await g,x)throw x;if(await Promise.all(h),await r,n)throw n}finally{i.hostStorageClient?.close(),m?.()}}o(tr,"runAgentJsonlServer");async function*_e(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(_e,"providerRoundSequence");async function De(i){for await(let t of _e(i)){let r=await i.runRound(t);if(r.type==="complete")return r.result}return i.onExhausted()}o(De,"runProviderRoundLoop");async function Fe(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(Fe,"runProviderRound");var F=e.object({threadId:e.string().trim().min(1)}).passthrough(),We=F.extend({includeHistory:e.boolean().optional()}),Je=e.object({session:e.unknown()}).strict(),O=F.extend({input:e.unknown()}),Ge=O.extend({idempotencyKey:e.string().trim().min(1).max(200)}),Ke=O.extend({inputId:e.string().trim().min(1)}),Qe=F.extend({reason:e.string().trim().min(1).optional()}),Xe=e.object({approvalId:e.string().trim().min(1),input:e.unknown()}).strict();function lr(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}=We.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(Je.parse(n).session)})),"threadStart"),threadResume:o(n=>r(n,"thread/resume"),"threadResume"),threadRead:r,turnStart:o(async n=>{let s=O.parse(n);return t("turn/start",s.threadId,async()=>({turn:await i.startTurn(s.threadId,s.input)}))},"turnStart"),turnSteer:o(async n=>{let s=O.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}=F.parse(n);return t("task/inbox",s,()=>i.readTaskInbox(s))},"taskInbox"),taskQueue:o(async n=>{let s=Ge.parse(n);return t("task/queue",s.threadId,()=>i.queueTaskInput(s.threadId,s.input,s.idempotencyKey))},"taskQueue"),taskInputUpdate:o(async n=>{let s=Ke.parse(n);return t("task/inputUpdate",s.threadId,()=>i.updateTaskInput(s.threadId,s.inputId,s.input))},"taskInputUpdate"),turnInterrupt:o(async n=>{let s=Qe.parse(n);return t("turn/interrupt",s.threadId,async()=>({turn:await i.interruptTurn(s.threadId,s.reason)}))},"turnInterrupt"),approvalResolve:o(async n=>{let s=Xe.parse(n);return t("approval/resolve",null,async()=>({approval:await i.resolveApproval(s.approvalId,s.input)}))},"approvalResolve"),userInputResolve:o(async n=>{let s=O.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(lr,"createAgentRuntimeService");var A=e.string().regex(/^[a-f0-9]{64}$/),Ye=e.object({harnessReleaseHash:A,instructionsHash:A,skillHashes:e.record(e.string(),A),agentAssetHashes:e.record(e.string(),A),toolCatalogHash:A,memoryRevision:e.number().int().nonnegative().nullable()}).strict(),Ze=e.object({protocolVersion:e.string().trim().min(1),threadId:e.string().trim().min(1),turnId:e.string().trim().min(1),harnessReleaseHash:A,toolCatalogHash:A,context:e.record(e.string(),e.unknown()),pendingInteraction:e.record(e.string(),e.unknown()).nullable(),usage:e.record(e.string(),e.unknown())}).strict();function hr(i){return C(Ye.parse(i))}o(hr,"effectiveSurfaceHash");function fr(i){return C(Ze.parse(i))}o(fr,"checkpointHash");function br(i){return[i.system,...i.harnessInstructions,...i.skillInstructions,...i.hostInstructions??[]].map(t=>t.trim()).filter(Boolean).join(`
|
|
4
|
+
|
|
5
|
+
`)}o(br,"materializeAgentPrompt");function Ir(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=C({modelTools:n,capabilities:s});return{byName:t,tools:r,modelTools:n,capabilities:s,hash:c}}o(Ir,"createAgentToolCatalog");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.`);return r.execute(r.inputSchema.parse(t.arguments),t.context)}o(yr,"executeAgentTool");function kr(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:C({modelTools:n,capabilities:s})}}o(kr,"createAgentToolCatalogProjection");async function jr(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(jr,"executeProjectedAgentTool");var Se=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()}}},Ee=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 W=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 et}from"node:child_process";function j(i,t){if(i.pid){if(process.platform==="win32"){et("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(j,"signalNativeProcess");import{spawn as tt}from"node:child_process";import{StringDecoder as rt}from"node:string_decoder";var Y=8*1024*1024,J={outcome:{outcome:"cancelled"}};function z(i){return i!==null&&typeof i=="object"&&!Array.isArray(i)}o(z,"object");var Re=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 rt("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=tt(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(()=>j(t,"SIGKILL"),2e3);n.unref(),t.once("exit",()=>{clearTimeout(n),r()}),j(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)>Y)throw new Error("ACP frame exceeds the size limit.");this.child.stdin.write(`${r}
|
|
6
|
+
`)}consume(t){this.buffer+=t;let r;for(;(r=this.buffer.indexOf(`
|
|
7
|
+
`))!==-1;){let n=this.buffer.slice(0,r);if(this.buffer=this.buffer.slice(r+1),!!n.trim())try{if(Buffer.byteLength(n)>Y)throw new Error("ACP frame exceeds the size limit.");this.receive(JSON.parse(n))}catch{this.fail(new Error("Invalid ACP protocol frame.")),this.stop();return}}Buffer.byteLength(this.buffer)>Y&&(this.fail(new Error("ACP frame exceeds the size limit.")),this.stop())}receive(t){if(!z(t)||t.jsonrpc!=="2.0")throw new Error("Invalid JSON-RPC envelope.");if(typeof t.method=="string"){if("id"in t){this.handleRequest(t);return}if(t.method==="session/update"&&z(t.params)){let{sessionId:n,update:s}=t.params;if(typeof n!="string"||!this.sessions.has(n)||!z(s))return;this.updateQueue=this.updateQueue.then(async()=>{await this.options.onUpdate?.(n,s)}),this.updateQueue.catch(c=>{this.fail(c),this.stop()})}return}if(typeof t.id!="number")return;let r=this.pending.get(t.id);r&&(this.pending.delete(t.id),r.timer&&clearTimeout(r.timer),z(t.error)?r.reject(new W(Number(t.error.code),String(t.error.message),t.error.data)):r.resolve(t.result))}async handleRequest(t){let r=t.id;if(!(typeof r!="number"&&typeof r!="string"))try{if(t.method!=="session/request_permission"){this.write({jsonrpc:"2.0",id:r,error:{code:-32601,message:"Client method not supported."}});return}let n=t.params;if(!z(n)||typeof n.sessionId!="string"||!Array.isArray(n.options)||!z(n.toolCall))throw new Error("Invalid permission request.");if(this.assertSession(n.sessionId),!this.activePrompts.has(n.sessionId)){this.write({jsonrpc:"2.0",id:r,result:J});return}let s=new AbortController,c=this.permissions.get(n.sessionId)??new Set;c.add(s),this.permissions.set(n.sessionId,c);let l=J;try{if(this.options.onPermission&&(l=await Promise.race([this.options.onPermission(n,s.signal),new Promise(u=>s.signal.addEventListener("abort",()=>u(J),{once:!0}))])),s.signal.aborted&&(l=J),l.outcome.outcome==="selected"){let u=l.outcome.optionId;if(!n.options.some(m=>z(m)&&m.optionId===u))throw new Error("Permission option was not advertised by the agent.")}}finally{c.delete(s),c.size||this.permissions.delete(n.sessionId)}this.child&&this.write({jsonrpc:"2.0",id:r,result:l})}catch{this.child&&this.write({jsonrpc:"2.0",id:r,error:{code:-32602,message:"Invalid or expired client request."}})}}cancelPermissions(t){for(let r of this.permissions.get(t)??[])r.abort();this.permissions.delete(t)}fail(t){let r=this.child,n=!!r;this.child=null,r&&(j(r,"SIGTERM"),setTimeout(()=>j(r,"SIGKILL"),2e3).unref());for(let s of this.pending.values())s.timer&&clearTimeout(s.timer),s.reject(t);this.pending.clear();for(let s of this.sessions)this.cancelPermissions(s);this.sessions.clear(),n&&this.options.onExit?.(t)}};var R=o(i=>i&&typeof i=="object"&&!Array.isArray(i)?i:{},"record"),T=o(i=>typeof i=="number"&&Number.isFinite(i)&&i>=0?Math.floor(i):null,"count"),$=class{static{o(this,"ClaudeObservations")}emit;contextWindows;tools=new Map;models=new Set;latestUsage={};latestModel="unknown";compacting=!1;constructor(t,r=new Map){this.emit=t,this.contextWindows=r}tool(t){let r=String(t.toolCallId),s={...this.tools.get(r)??{},...t};this.tools.set(r,s),this.emit(s)}observe(t){if(!t.parent_tool_use_id){if(t.type==="stream_event"){let r=R(t.event),n=R(r.message);r.type==="message_start"&&this.assistant(n,!0),r.type==="message_delta"&&(this.latestUsage={...this.latestUsage,...R(r.usage)},this.context())}if(t.type==="assistant"){this.assistant(R(t.message),!1);let r=R(t.context_usage),n=T(r.total_tokens),s=T(r.raw_max_tokens);n!==null&&s&&typeof r.model=="string"&&(this.contextWindows.set(r.model,s),this.emit({sessionUpdate:"context_usage",model:r.model,usedTokens:n,maxContextTokens:s}))}if(t.type==="system"&&t.subtype==="status"&&t.status==="compacting"&&!this.compacting&&(this.compacting=!0,this.emit({sessionUpdate:"compaction_started"})),t.type==="system"&&t.subtype==="compact_boundary"){this.compacting=!1,this.latestUsage={};let r=R(t.compact_metadata);this.emit({sessionUpdate:"compaction_completed",reason:r.trigger,preTokens:r.pre_tokens})}}}assistant(t,r){typeof t.model=="string"&&!t.model.startsWith("<")&&(this.latestModel=t.model,this.models.add(t.model));let n=R(t.usage);r?this.latestUsage=n:this.latestUsage={...this.latestUsage,...n,output_tokens:Math.max(T(this.latestUsage.output_tokens)??0,T(n.output_tokens)??0)}}result(t,r){this.finishCompaction(),this.emit({sessionUpdate:"usage_update",usage:t.usage,model:this.models.size>1?"Claude Code (multiple models)":this.latestModel,status:r?"interrupted":t.is_error?"failed":"completed",scope:"main_loop_turn"});for(let[n,s]of Object.entries(R(t.modelUsage))){let c=T(R(s).contextWindow);c&&this.contextWindows.set(n,c)}this.context()}context(){let t=this.contextWindows.get(this.latestModel),r=T(this.latestUsage.input_tokens);if(t&&r!==null){let n=r+(T(this.latestUsage.cache_read_input_tokens)??0)+(T(this.latestUsage.cache_creation_input_tokens)??0)+(T(this.latestUsage.output_tokens)??0);this.emit({sessionUpdate:"context_usage",model:this.latestModel,usedTokens:n,maxContextTokens:t})}}finishCompaction(){this.compacting&&(this.compacting=!1,this.emit({sessionUpdate:"compaction_failed",error:"Claude ended before confirming compaction completed."}))}};import{spawn as nt}from"node:child_process";import{randomUUID as B}from"node:crypto";import{StringDecoder as Te}from"node:string_decoder";var I=o(i=>i&&typeof i=="object"&&!Array.isArray(i)?i:{},"record"),Ce=[{id:"manual",name:"Ask for permissions"},{id:"plan",name:"Plan"},{id:"bypassPermissions",name:"YOLO / Full access"}],qe=class{static{o(this,"ClaudeCliClient")}options;child=null;sessionId=null;pending=new Map;turn=null;messageId="";lastTextMessageId=null;completedResultIds=new Set;permissions=new Set;updates=Promise.resolve();closed=!1;model="default";contextWindows=new Map;observations=new $(t=>this.emit(t),this.contextWindows);stderrTail="";constructor(t){this.options=t}async initialize(){return{protocolVersion:1,agentCapabilities:{loadSession:!0,mcpCapabilities:{http:!0},promptCapabilities:{image:!0,embeddedContext:!0}},authMethods:[],agentInfo:{name:"Claude Code CLI",version:"native"}}}async authenticate(t){throw new Error("Use Claude Code's native login, then reconnect.")}async createSession(t,r=[]){return this.start(B(),t,!1,r)}async loadSession(t,r,n=[]){return this.start(t,r,!0,n)}async start(t,r,n,s){if(this.child||this.closed)throw new Error("Claude connection already owns a session or is closed.");if(!/^[a-f0-9-]{36}$/i.test(t))throw new Error("Invalid native Claude session identity.");this.sessionId=t;let c=Object.fromEntries(s.map(f=>[String(f.name),{type:"http",url:f.url,headers:Object.fromEntries((Array.isArray(f.headers)?f.headers:[]).map(v=>{let x=I(v);return[String(x.name),String(x.value)]}))}])),l=["--print","--verbose","--input-format","stream-json","--output-format","stream-json","--include-partial-messages","--allow-dangerously-skip-permissions","--permission-prompt-tool","stdio","--append-system-prompt","When you create files for the user, link each deliverable using Markdown with its absolute local path so OpenPond can open it. For example: [Report](/absolute/path/report.pdf).",...(this.options.additionalDirectories??[]).flatMap(f=>["--add-dir",f]),...s.length?["--mcp-config",JSON.stringify({mcpServers:c})]:[],n?"--resume":"--session-id",t],u=nt(this.options.command,l,{cwd:r,env:this.options.env??process.env,stdio:["pipe","pipe","pipe"],shell:!1,detached:process.platform!=="win32"});this.child=u;let m=new Te("utf8"),h="",y=new Te("utf8");u.stderr.on("data",f=>{this.stderrTail=(this.stderrTail+y.write(f)).slice(-4096)}),u.stdout.on("data",f=>{h+=m.write(f);let v;for(;(v=h.indexOf(`
|
|
8
|
+
`))>=0;){let x=h.slice(0,v);if(h=h.slice(v+1),!!x.trim())try{if(Buffer.byteLength(x)>8*1024*1024)throw new Error("Oversized frame");this.receive(I(JSON.parse(x)))}catch{this.fail(new Error("Invalid Claude CLI protocol frame.")),this.stop();return}}Buffer.byteLength(h)>8*1024*1024&&(this.fail(new Error("Claude CLI frame exceeds limit.")),this.stop())}),u.on("error",f=>this.fail(f)),u.stdin.on("error",f=>this.fail(f)),u.on("exit",f=>{this.fail(new Error(`Claude CLI exited (${f??"signal"}).${this.stderrTail.trim()?` ${this.stderrTail.trim()}`:""}`)),j(u,"SIGTERM"),setTimeout(()=>j(u,"SIGKILL"),2e3).unref(),this.child=null});try{let f=await this.control({subtype:"initialize",hooks:null}),v=Array.isArray(f.models)?f.models.map(I).filter(g=>typeof g.value=="string"):[],x=v.find(g=>g.value==="default")?.description,_=typeof x=="string"?v.find(g=>g.value!=="default"&&typeof g.displayName=="string"&&(x===g.displayName||x.startsWith(`${g.displayName} \xB7`))):void 0;return{sessionId:t,models:{currentModelId:this.model,availableModels:v.map(g=>({modelId:String(g.value),name:g.value==="default"&&_?`${_.displayName} (default)`:String(g.displayName??g.value),...typeof g.description=="string"?{description:g.description}:{}}))},modes:{currentModeId:String(f.current_permission_mode??"manual"),availableModes:Ce.map(g=>({...g}))}}}catch(f){throw await this.stop(),f}}async setModel(t,r){this.assertSession(t),await this.control({subtype:"set_model",model:r}),this.model=r}async setMode(t,r){if(this.assertSession(t),!Ce.some(n=>n.id===r))throw new Error("Unsupported Claude permission mode.");await this.control({subtype:"set_permission_mode",mode:r})}async prompt(t,r,n){if(this.assertSession(t),this.turn)throw new Error("A prompt is already active for this native session.");if(n?.aborted)throw new Error("Claude turn cancelled.");this.observations=new $(u=>this.emit(u),this.contextWindows),this.stderrTail="",this.messageId=B(),this.lastTextMessageId=null;let s=new Promise((u,m)=>{this.turn={resolve:u,reject:m,signal:n,resultReceived:!1}}),c,l=o(()=>{for(let u of this.permissions)u.abort();this.control({subtype:"interrupt"}).catch(()=>{}),c=setTimeout(()=>{this.stop()},5e3),c.unref()},"abort");n?.addEventListener("abort",l,{once:!0});try{this.write({type:"user",session_id:t,parent_tool_use_id:null,message:{role:"user",content:r.map(m=>m.type==="image"?{type:"image",source:{type:"base64",media_type:m.mimeType,data:m.data}}:m)}});let u=await s;return await this.updates,n?.aborted?{stopReason:"cancelled"}:u}catch(u){if(await this.updates.catch(()=>{}),n?.aborted)return{stopReason:"cancelled"};throw u}finally{n?.removeEventListener("abort",l),c&&clearTimeout(c),this.turn=null;for(let u of this.permissions)u.abort();this.permissions.clear()}}assertSession(t){if(!this.child||this.sessionId!==t||this.closed)throw new Error("Session does not belong to this Claude connection.")}write(t){if(!this.child||this.child.stdin.destroyed)throw new Error("Claude connection is closed.");let r=JSON.stringify(t);if(Buffer.byteLength(r)>8*1024*1024)throw new Error("Claude input exceeds limit.");this.child.stdin.write(`${r}
|
|
9
|
+
`)}control(t){let r=B();return new Promise((n,s)=>{let c=setTimeout(()=>{this.pending.delete(r),s(new Error(`Claude control request timed out: ${t.subtype}`))},this.options.requestTimeoutMs??3e4);c.unref(),this.pending.set(r,{resolve:n,reject:s,timer:c});try{this.write({type:"control_request",request_id:r,request:t})}catch(l){clearTimeout(c),this.pending.delete(r),s(l)}})}emit(t){if(!this.turn||!this.sessionId)return;let r=this.sessionId;this.updates=this.updates.then(async()=>{await this.options.onUpdate?.(r,t)}),this.updates.catch(n=>{this.fail(n),this.stop()})}receive(t){if(typeof t.session_id=="string"&&t.session_id!==this.sessionId){this.fail(new Error("Claude changed native session identity.")),this.stop();return}if(!(t.type==="result"&&typeof t.uuid=="string"&&this.completedResultIds.has(t.uuid))){if(this.turn&&!this.turn.resultReceived&&this.observations.observe(t),t.type==="control_response"){let r=I(t.response),n=String(r.request_id),s=this.pending.get(n);if(!s)return;clearTimeout(s.timer),this.pending.delete(n),r.subtype==="error"?s.reject(new Error(String(r.error??"Claude control failed."))):s.resolve(I(r.response))}else if(t.type==="control_request")this.permission(t);else if(t.type==="stream_event"){if(!this.turn||this.turn.resultReceived||t.parent_tool_use_id)return;let r=I(t.event),n=I(r.delta),s=I(r.content_block);if(r.type==="message_start"){let c=I(r.message).id;this.messageId=typeof c=="string"?c:B(),this.lastTextMessageId=null}if(r.type==="content_block_delta"&&(n.type==="text_delta"||n.type==="thinking_delta")){let c=n.type==="text_delta";c&&(this.lastTextMessageId=this.messageId),this.emit({sessionUpdate:c?"agent_message_chunk":"agent_thought_chunk",messageId:this.messageId,phase:c?"commentary":"reasoning",content:{type:"text",text:n.text??n.thinking??""}})}r.type==="content_block_start"&&s.type==="tool_use"&&(this.lastTextMessageId=null,this.observations.tool({sessionUpdate:"tool_call",toolCallId:s.id,title:s.name,kind:"other",status:"in_progress",rawInput:s.input}))}else if(t.type==="assistant"){if(!this.turn||this.turn.resultReceived)return;let r=I(t.message),n=r.content;!t.parent_tool_use_id&&typeof r.id=="string"&&Array.isArray(n)&&n.some(s=>I(s).type==="text")&&(this.lastTextMessageId=r.id),!t.parent_tool_use_id&&Array.isArray(n)&&n.some(s=>I(s).type==="tool_use")&&(this.lastTextMessageId=null);for(let s of Array.isArray(n)?n.map(I):[])s.type==="tool_use"&&this.observations.tool({sessionUpdate:"tool_call_update",toolCallId:s.id,title:s.name,status:"in_progress",rawInput:s.input})}else if(t.type==="user"){if(!this.turn||this.turn.resultReceived)return;let r=I(t.message).content;for(let n of Array.isArray(r)?r.map(I):[])n.type==="tool_result"&&this.observations.tool({sessionUpdate:"tool_call_update",toolCallId:n.tool_use_id,status:n.is_error?"failed":"completed",content:n.content})}else if(t.type==="result"){if(!this.turn||this.turn.resultReceived)return;if(typeof t.uuid=="string"&&this.completedResultIds.add(t.uuid),this.turn.resultReceived=!0,t.session_id&&t.session_id!==this.sessionId){this.fail(new Error("Claude changed native session identity."));return}!t.is_error&&!this.turn.signal?.aborted&&typeof t.result=="string"&&t.result.trim()&&this.emit({sessionUpdate:"agent_message_final",messageId:this.lastTextMessageId??B(),content:{type:"text",text:t.result}}),this.observations.result(t,!!this.turn.signal?.aborted),t.is_error?this.turn?.reject(new Error(Array.isArray(t.errors)?t.errors.map(String).join("; "):"Claude turn failed.")):this.turn?.resolve({stopReason:"end_turn"})}}}async permission(t){let r=I(t.request),n=String(t.request_id);if(r.subtype!=="can_use_tool"||!this.turn||!this.sessionId){this.write({type:"control_response",response:{subtype:"error",request_id:n,error:"Unsupported or inactive control request."}});return}let s=new AbortController;this.permissions.add(s);try{let c=I(r.input),l=r.tool_name==="AskUserQuestion"&&Array.isArray(c.questions)?c.questions:void 0,u=new Promise(y=>s.signal.addEventListener("abort",()=>y({outcome:{outcome:"cancelled"}}),{once:!0})),m=await Promise.race([u,this.options.onPermission?.({sessionId:this.sessionId,toolCall:{toolCallId:r.tool_use_id,title:r.title??r.tool_name,rawInput:r.input},questions:l,options:[{optionId:"allow",name:"Allow once",kind:"allow_once"},{optionId:"deny",name:"Deny",kind:"reject_once"}]},s.signal)]),h=!s.signal.aborted&&m?.outcome.outcome==="selected"&&m.outcome.optionId==="allow";this.child&&this.write({type:"control_response",response:{subtype:"success",request_id:n,response:h?{behavior:"allow",updatedInput:l?{...c,answers:m?.answers}:r.input}:{behavior:"deny",message:"Permission declined or turn cancelled."}}})}catch{this.child&&this.write({type:"control_response",response:{subtype:"success",request_id:n,response:{behavior:"deny",message:"Permission could not be resolved."}}})}finally{this.permissions.delete(s)}}fail(t){this.observations.finishCompaction();for(let r of this.pending.values())clearTimeout(r.timer),r.reject(t);this.pending.clear(),this.turn?.reject(t),this.turn=null;for(let r of this.permissions)r.abort();this.permissions.clear(),this.options.onExit?.(t)}async stop(){if(this.closed)return;this.closed=!0,this.fail(new Error("Claude connection closed."));let t=this.child;!t||t.exitCode!==null||t.signalCode!==null||(await new Promise(r=>{let n=setTimeout(()=>j(t,"SIGKILL"),2e3);n.unref(),t.once("exit",()=>{clearTimeout(n),r()}),j(t,"SIGTERM")}),this.child=null)}};export{_e as a,De as b,Fe as c,G as d,C as e,at as f,ct as g,lt as h,Ae as i,ze as j,ht as k,H as l,wt as m,te as n,re as o,K as p,Q as q,vt as r,He as s,L as t,ne as u,X as v,ae as w,ue as x,he as y,be as z,ge as A,we as B,ve as C,$e as D,xe as E,Be as F,Ie as G,ye as H,p as I,Dt as J,ke as K,Ft as L,je as M,tr as N,lr as O,Ye as P,Ze as Q,hr as R,fr as S,br as T,Ir as U,yr as V,kr as W,jr as X,Se as Y,Ee as Z,W as _,Re as $,qe as aa};
|