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
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import"./chunk-RAXOSUSW.js";import{c as X}from"./chunk-DARVPBZ4.js";import{a as ie,c as ae}from"./chunk-NPOHW5OU.js";import"./chunk-M4JWQSV7.js";import"./chunk-FV2R5RUN.js";import{c as Z,f as ee}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{c as o}from"./chunk-3M53YXEI.js";import"./chunk-W45RKGM6.js";import"./chunk-3VUATFZD.js";import"./chunk-4EPSHPZL.js";import"./chunk-DZUAT3TP.js";import"./chunk-XDQMGUWL.js";import"./chunk-FTEOCCPB.js";import{Aa as te,Ba as ne,Na as U,Oa as I,Pa as re,Qa as k,Va as j,ia as C}from"./chunk-25MBPJVY.js";import"./chunk-WN3V6KDN.js";import"./chunk-523TE4BI.js";import"./chunk-ZCHXGRRU.js";import"./chunk-5MCNZCVQ.js";import"./chunk-BT5YNE5U.js";import{b as K,c as M,d as P,q as W,r as Y}from"./chunk-Q5LEXXJG.js";import"./chunk-FWIPHEVA.js";import{d as V}from"./chunk-OS3LO5J3.js";import{b as Q}from"./chunk-GLUWATL5.js";import"./chunk-QDC4OW3S.js";import"./chunk-ZZWAQBA2.js";import"./chunk-YR5ID2SS.js";import"./chunk-YBT2NB32.js";import"./chunk-74ZXXBGN.js";import"./chunk-APB2STJK.js";import"./chunk-I7AQMAQI.js";import"./chunk-Z4Z5UOZM.js";import"./chunk-Y4OWBBDD.js";import"./chunk-6ZFPQYHG.js";import"./chunk-JFXWI3EN.js";import"./chunk-FFRFSDBM.js";import"./chunk-VYLGI3IH.js";import{Cb as B,Db as J,_a as F,jb as T,ub as D,zb as G}from"./chunk-ACYFMLWG.js";import"./chunk-TVQAPBLZ.js";import{m as H}from"./chunk-KGNCKIFP.js";import{b as e}from"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import{a as x}from"./chunk-FTQLQJQV.js";import{readFile as N,stat as z}from"node:fs/promises";var w=e.string().trim().min(1).max(500),oe=e.string().regex(/^[a-f0-9]{64}$/),ue=e.object({schemaVersion:e.literal("openpond.experimentCaseInspection.v1"),teamId:w,executionId:w,manifestHash:oe,receiptId:w,taskId:w,seed:e.string().min(1),input:e.record(e.string(),e.unknown()).nullable(),output:e.unknown().nullable(),error:e.string().nullable(),events:e.array(e.record(e.string(),e.unknown())).max(25),nextEventCursor:w.nullable(),eventCount:e.number().int().nonnegative()}).strict(),fe=ue.extend({contentHash:oe}).strict(),v=class{constructor(s){this.options=s;let n=new URL(s.baseUrl);if(!["http:","https:"].includes(n.protocol)||n.username||n.password||n.search||n.hash||!s.apiKey.trim()||!s.teamId.trim())throw new Error("A clean API origin and workspace credentials are required.");this.baseUrl=n.toString().replace(/\/+$/,"")}options;static{x(this,"OpenPondExperimentInspectionClient")}baseUrl;async case(s,n,r={}){let b=new URLSearchParams(r.afterId?{afterId:w.parse(r.afterId)}:{}),h=await(this.options.fetch??fetch)(`${this.baseUrl}/v1/experiments/${encodeURIComponent(w.parse(s))}/cases/${encodeURIComponent(w.parse(n))}?${b}`,{signal:r.signal,redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"X-OpenPond-Team-Id":this.options.teamId,Accept:"application/json"}}),S=await h.json();if(!h.ok)throw new Error(e.object({message:e.string()}).parse(S).message);let a=fe.parse(S),{contentHash:l,...i}=a;if(H(i)!==l||a.teamId!==this.options.teamId||a.executionId!==s||a.receiptId!==n||r.manifestHash&&a.manifestHash!==r.manifestHash||a.events.length>a.eventCount)throw new Error("Case inspection differs from its requested workspace, execution or retained content.");return a}};import{readFile as Re,stat as He}from"node:fs/promises";var q=e.object({source:e.enum(["local","github","openpond_git"]),repositoryId:e.string().trim().min(1),profileId:e.string().trim().min(1)}),Ue=e.object({ref:q,revision:e.string().nullable(),sourceHash:e.string()});var m=e.string().trim().min(1).max(200),d=e.string().regex(/^[a-f0-9]{64}$/),ce=e.enum(["queued","running","cancelling","completed","failed","cancelled","interrupted"]),me=e.object({providerId:e.enum(["openpond","custom-openai-compatible","claude-code"]),modelId:e.string().trim().min(1).max(500),configurationHash:d,maxOutputTokens:e.number().int().positive().max(262144),temperature:e.number().min(0).max(2).optional(),topP:e.number().positive().max(1).optional(),messages:e.array(e.object({role:e.enum(["system","user","assistant"]),content:e.string().max(262144)}).strict()).max(200)}).strict(),Te=e.object({configuration:k,package:C}).strict(),De=e.object({configuration:k,expectedPackageHash:d.optional()}).strict(),Ge=e.object({schemaVersion:e.literal("openpond.localExperimentDefinition.v1"),location:e.literal("local"),id:m,teamId:m,ownerActorId:m,revision:e.number().int().positive(),configuration:k,model:me,packageHash:d,graders:e.array(I).min(1).max(100),availableGraders:e.array(I).min(1).max(1e3),createdAt:e.iso.datetime(),updatedAt:e.iso.datetime(),contentHash:d}).strict(),Be=e.object({operationId:m,definition:U}).strict(),Je=e.object({teamId:m,id:m}).strict(),Ke=e.object({teamId:m,projectId:m.optional(),status:ce.optional(),datasetHash:d.optional(),search:e.string().max(100).optional(),afterId:m.optional(),limit:e.number().int().min(1).max(100).default(30)}).strict(),O=e.object({schemaVersion:e.literal("openpond.localExperimentExecution.v1"),location:e.literal("local"),id:m,teamId:m,ownerActorId:m,operationId:m,definition:U,kind:e.enum(["target","scoring"]),executionHash:d,sourceExecution:e.object({id:m,executionHash:d}).strict().nullable(),packageHash:d,maximumCostUsd:e.number().finite().positive(),status:ce,createdAt:e.iso.datetime(),completedAt:e.iso.datetime().nullable(),counts:e.object({pending:e.number().int().nonnegative(),running:e.number().int().nonnegative(),completed:e.number().int().nonnegative(),failed:e.number().int().nonnegative(),cancelled:e.number().int().nonnegative(),unknown:e.number().int().nonnegative()}).strict(),usage:e.object({knownCostUsd:e.number().finite().nonnegative(),costUsd:e.number().finite().nonnegative().nullable(),heldUsd:e.number().finite().nonnegative(),uncertainRequests:e.number().int().nonnegative()}).strict(),cleanupComplete:e.boolean(),error:e.string().max(2e3).nullable()}).strict(),xe=O.omit({definition:!0});function _(t,s){t.kind==="scoring"!=(t.sourceExecution!==null)&&s.addIssue({code:"custom",message:"Only retained scoring passes name an original execution."}),["completed","failed","cancelled","interrupted"].includes(t.status)&&(!t.completedAt||t.counts.pending||t.counts.running)&&s.addIssue({code:"custom",message:"Terminal local execution requires complete population accounting."}),["completed","cancelled"].includes(t.status)&&!t.cleanupComplete&&s.addIssue({code:"custom",message:"Successful completion or cancellation requires confirmed local transport cleanup."}),t.usage.uncertainRequests>0&&t.usage.costUsd!==null&&s.addIssue({code:"custom",message:"Uncertain provider charges cannot claim a measured total."})}x(_,"validateLocalExecutionState");var Me=O.superRefine(_),y=xe.superRefine(_),he=e.object({configuration:j,package:C}).strict(),ge=e.object({configuration:j,expectedPackageHash:e.string().regex(/^[a-f0-9]{64}$/).optional()}).strict(),A=e.object({configuration:j,model:me,packageHash:e.string().regex(/^[a-f0-9]{64}$/),graders:e.array(I).min(1).max(100),availableGraders:e.array(I).min(1).max(1e3),retainedConfigurationHash:e.string().regex(/^[a-f0-9]{64}$/).optional(),configurationHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict().superRefine((t,s)=>{let{configurationHash:n,...r}=t;H(r)!==n&&s.addIssue({code:"custom",message:"Local configuration snapshot bytes changed."})}),{definition:Ve,...Ee}=O.shape,L=e.object({...Ee,kind:e.literal("target"),...A.shape}).strict().superRefine((t,s)=>{let n={configuration:t.configuration,model:t.model,packageHash:t.packageHash,graders:t.graders,availableGraders:t.availableGraders,...t.retainedConfigurationHash?{retainedConfigurationHash:t.retainedConfigurationHash}:{},configurationHash:t.configurationHash};_(t,s),A.safeParse(n).success||s.addIssue({code:"custom",message:"Local Experiment configuration changed."}),(t.operationId!==t.configuration.operationId||t.teamId!==t.configuration.request.teamId||t.maximumCostUsd!==t.configuration.maximumCostUsd)&&s.addIssue({code:"custom",message:"Local Experiment differs from its sealed admission."})}),we=e.object({items:e.array(L).max(100),nextCursor:e.string().nullable()}).strict(),be=e.object({teamId:e.string().min(1).max(200),id:e.string().min(1).max(200),configurationHash:e.string().regex(/^[a-f0-9]{64}$/).optional()}).strict(),Se=e.object({operationId:m,execution:e.object({id:m,executionHash:d}).strict(),graderPackage:C,graders:e.array(re).min(1).max(100),maximumCostUsd:e.number().finite().positive().max(1e4)}).strict(),Qe=Se.omit({graderPackage:!0}),Ie=T,Le=e.object({sessionId:m,turnId:m,source:F,profileRef:q,admissionHash:d,modelConfigurationHash:d,traceHash:d,runtimeEventRefs:e.array(m).max(1e4),startedAt:e.iso.datetime(),completedAt:e.iso.datetime(),outputHash:d,partialOutputAvailable:e.boolean()}).strict(),le=e.object({receiptId:m,taskId:m,seed:e.string(),status:e.enum(["pending","running","completed","failed","cancelled","unknown"]),input:e.record(e.string(),e.unknown()),policyVisibleContext:e.record(e.string(),e.unknown()),output:e.string().nullable(),messages:e.array(e.unknown()).max(4002),grade:ne.nullable(),error:e.string().nullable(),native:Ie.optional(),profileNative:Le.optional(),externalProcess:te.optional()}).strict(),Xe=e.object({execution:e.union([L,y]),cases:e.array(le).max(1e4),contentHash:d}).strict(),ye=e.object({items:e.array(e.object({sequence:e.number().int().positive(),type:e.string().min(1),payload:e.unknown()}).strict()).max(500),nextCursor:e.number().int().positive().nullable()}).strict(),We=e.object({location:e.literal("local"),execution:e.union([L,y]),case:le,trace:ye}).strict(),Ye=e.object({items:e.array(y).max(100),nextCursor:m.nullable()}).strict(),Ze=e.object({execution:y,graders:e.array(I).min(1).max(100),graderPackageHash:d}).strict(),se=e.object({execution:y,manifest:D,result:G}).strict().superRefine((t,s)=>{try{if(B(t),t.manifest.id!==t.execution.id||t.manifest.teamId!==t.execution.teamId||t.manifest.lineage?.execution.id!==(t.execution.sourceExecution?.id??t.execution.id)||t.manifest.lineage.execution.contentHash!==(t.execution.sourceExecution?.executionHash??t.execution.executionHash)||t.manifest.lineage.scoringPassId!==(t.execution.kind==="scoring"?t.execution.id:null)||t.manifest.maximumCostUsd!==t.execution.maximumCostUsd)throw new Error("Portable evidence differs from its retained local execution.")}catch(n){s.addIssue({code:"custom",message:n instanceof Error?n.message:"Local portable evidence verification failed."})}}),pe=e.object({location:e.literal("local"),baseline:se,candidate:se}).strict();async function de(t,s){let[n,r,b]=s,h=o(t,"team");if(t.revision!==void 0)throw new Error("A local Experiment is one immutable run; read it by id rather than a saved configuration revision.");if(n!=="read"&&t.contentHash!==void 0)throw new Error("An exact configuration hash requires the local read action.");if(!h||!n||s.length>(n==="compare"?3:2))throw new Error("Local Experiments require an action and --team; use --server-url for an existing local server.");let S=o(t,"serverUrl")||process.env.OPENPOND_LOCAL_API_URL||ie,a=new URL(S);if(a.protocol!=="http:"||!["localhost","127.0.0.1"].includes(a.hostname)||a.username||a.password||a.search||a.hash||a.pathname!=="/")throw new Error("Local Experiments require an HTTP loopback server origin.");let l=await ae(a.origin);async function i(u,g){let c=await l(new URL("/v1/local-experiments",a),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({teamId:h,action:u,payload:g})}),p=await c.json();if(!c.ok)throw new Error(typeof p.error=="string"?p.error:`Local Experiment request failed (${c.status}).`);return p}x(i,"command");async function E(){let u=o(t,"inputFile");if(!u||(await He(u)).size>67108864)throw new Error("Provide a bounded --input-file with exact local configuration and retained package bytes.");return JSON.parse(await Re(u,"utf8"))}x(E,"input");let f;if(n==="prepare-harness"){if(r)throw new Error("Local Profile preparation accepts --input-file rather than an id.");f=await i("prepareHarness",await E())}else if(n==="run"){if(r)throw new Error("Local Run accepts reviewed configuration through --input-file rather than an id.");let u=await E();f=await i(u.package?"run":"runFromRelease",u)}else if(n==="list"){if(r)throw new Error("Local List does not accept an id.");let u=o(t,"status"),g=o(t,"limit"),c=o(t,"project"),p=o(t,"afterId"),R=o(t,"datasetHash"),$=o(t,"search");f=await i("list",{...u?{status:u}:{},...c?{projectId:c}:{},...R?{datasetHash:R}:{},...$?{search:$}:{},...p?{afterId:p}:{},...g?{limit:Number(g)}:{}})}else{if(!r)throw new Error(`${n} requires a local Experiment or scoring pass id.`);let u=o(t,"afterId"),g=o(t,"limit");if(n==="duplicate"){let c=o(t,"operationId");if(!c)throw new Error("Duplicate requires --operation-id for safe replay.");let p=L.parse(await i("read",{id:r})),R=P.parse({...p.configuration,operationId:c,request:{...p.configuration.request,operationId:c},sourceExperimentId:p.id});f=await i("runFromRelease",{configuration:R,expectedPackageHash:p.packageHash})}else if(n==="passes")f=await i("passes",{executionId:r,...u?{afterId:u}:{},...g?{limit:Number(g)}:{}});else if(n==="case"){let c=o(t,"receiptId"),p=o(t,"afterSequence");if(!c)throw new Error("Local case inspection requires --receipt-id from the retained execution.");f=await i("case",{id:r,receiptId:c,...p?{afterSequence:Number(p)}:{},...g?{limit:Number(g)}:{}})}else if(n==="score"){let c=await E();if(c.execution?.id!==r)throw new Error("Local scoring input belongs to a different retained execution.");f=await i("score",c)}else if(n==="compare"){if(!b)throw new Error("Local Compare requires baseline and candidate execution ids.");let c=pe.parse(await i("compare",{baselineId:r,candidateId:b}));f={...c,comparison:J(c.baseline,c.candidate)}}else if(n==="read"){let c=o(t,"contentHash");f=await i("read",{id:r,...c?{configurationHash:c}:{}})}else if(["status","cancel","result","pass"].includes(n))f=await i(n,{id:r});else if(n==="cancel-pass")f=await i("cancel",{id:r});else if(n==="pass-result")f=await i("result",{id:r});else throw new Error(`Local Experiment action is unavailable: ${n}`)}console.log(JSON.stringify(f,null,2))}x(de,"runLocalExperimentsCommand");async function Et(t,s){if(t.local===!0||t.local==="true")return de(t,s);if(t.revision!==void 0||t.contentHash!==void 0)throw new Error("Experiments retain their immutable configuration on the run; definition revisions are not selectable.");let[n,r]=s,b=o(t,"team");if(!b||!n||s.length>(n==="compare"?3:2))throw new Error("usage: experiments <prepare-harness|run|read|list|status|cancel|duplicate|score|passes|pass|cancel-pass|pass-result|result|compare|case> [id] [candidate-id] --team <id> [--input-file <path>] [--operation-id <id>]");let h=await V(),S={teamId:b,apiKey:await X(h,ee(h)),baseUrl:Z(t)??h.apiBaseUrl??Q},a=new Y(S),l;if(n==="prepare-harness"){let i=o(t,"inputFile");if(!i||r||(await z(i)).size>1048576)throw new Error("Harness preparation requires a bounded --input-file with its released target, model and ceiling.");l=await a.prepareHarness(M.parse(JSON.parse(await N(i,"utf8"))))}else if(n==="run"){let i=o(t,"inputFile");if(!i||r)throw new Error("Run requires --input-file with the reviewed configuration and stable operationId.");if((await z(i)).size>1048576)throw new Error("Experiment input exceeds one MiB.");l=await a.run(P.parse(JSON.parse(await N(i,"utf8"))))}else if(n==="list"){if(r)throw new Error("List does not accept an Experiment id.");let i=o(t,"limit");l=await a.list(K.parse({projectId:o(t,"project")||void 0,datasetHash:o(t,"datasetHash")||void 0,search:o(t,"search")||void 0,status:o(t,"status")||void 0,afterId:o(t,"afterId")||void 0,...i?{limit:Number(i)}:{}}))}else{if(!r)throw new Error(`${n} requires an id.`);if(n==="read")l=await a.get(r);else if(n==="status")l=await a.get(r);else if(n==="cancel")l=await a.cancel(r);else if(n==="duplicate"){let i=o(t,"operationId");if(!i)throw new Error("Duplicate requires a stable --operation-id for the new Experiment.");l=await a.duplicate(r,i)}else if(n==="score"){let i=o(t,"inputFile");if(!i||(await z(i)).size>1048576)throw new Error("Score requires --input-file containing an exact execution reference, grader releases and explicit ceiling, within one MiB.");let E=W.parse(JSON.parse(await N(i,"utf8")));if(E.execution.id!==r)throw new Error("Scoring input belongs to a different execution.");l=await a.score(E)}else if(n==="passes")l=await a.scoringPasses(r,{afterId:o(t,"afterId")||void 0});else if(n==="pass")l=await a.scoringPass(r);else if(n==="cancel-pass")l=await a.cancelScoringPass(r);else if(n==="pass-result")l=await a.scoringResult(r);else if(n==="result")l=await a.result(r);else if(n==="case"){let i=o(t,"receiptId");if(!i)throw new Error("Case inspection requires --receipt-id from the retained Experiment.");let E=await a.get(r);l=await new v(S).case(r,i,{manifestHash:E.manifest.contentHash,afterId:o(t,"afterId")||void 0})}else if(n==="compare"){if(!s[2])throw new Error("Compare requires a baseline and candidate execution id.");l=await a.compare(r,s[2])}else throw new Error(`Unknown Experiment action: ${n}`)}console.log(JSON.stringify(l,null,2))}x(Et,"runExperimentsCommand");export{Et as runExperimentsCommand};
|
|
2
|
+
import"./chunk-GUOLMLZN.js";import{c as X}from"./chunk-JUQMSHNR.js";import{a as ie,c as ae}from"./chunk-NPOHW5OU.js";import"./chunk-U2MAPON2.js";import"./chunk-7UH4YDA7.js";import{c as Z,f as ee}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{c as o}from"./chunk-3M53YXEI.js";import"./chunk-W45RKGM6.js";import"./chunk-CGWA54LE.js";import"./chunk-KO3HNMLJ.js";import"./chunk-DZUAT3TP.js";import"./chunk-H7ATCPPB.js";import"./chunk-25JDHAZ5.js";import{Aa as te,Ba as ne,Na as U,Oa as I,Pa as re,Qa as k,Va as j,ia as C}from"./chunk-XMKCCLGB.js";import"./chunk-WN3V6KDN.js";import"./chunk-523TE4BI.js";import"./chunk-ZCHXGRRU.js";import"./chunk-OLDK2LKJ.js";import"./chunk-BT5YNE5U.js";import{b as K,c as M,d as P,q as W,r as Y}from"./chunk-SF5HJ7PL.js";import"./chunk-FWIPHEVA.js";import{d as V}from"./chunk-WRI4XKSK.js";import{b as Q}from"./chunk-GLUWATL5.js";import"./chunk-QDC4OW3S.js";import"./chunk-ZZWAQBA2.js";import"./chunk-YR5ID2SS.js";import"./chunk-YBT2NB32.js";import"./chunk-74ZXXBGN.js";import"./chunk-APB2STJK.js";import"./chunk-Y4OWBBDD.js";import"./chunk-6ZFPQYHG.js";import"./chunk-JFXWI3EN.js";import"./chunk-MNC4YUDI.js";import"./chunk-Z4Z5UOZM.js";import"./chunk-FFRFSDBM.js";import"./chunk-H7IWJN7L.js";import"./chunk-VYLGI3IH.js";import{Cb as B,Db as J,_a as F,jb as T,ub as D,zb as G}from"./chunk-ACYFMLWG.js";import"./chunk-TVQAPBLZ.js";import{m as H}from"./chunk-KGNCKIFP.js";import{b as e}from"./chunk-ES2ISFJC.js";import{a as x}from"./chunk-FTQLQJQV.js";import{readFile as N,stat as z}from"node:fs/promises";var w=e.string().trim().min(1).max(500),oe=e.string().regex(/^[a-f0-9]{64}$/),ue=e.object({schemaVersion:e.literal("openpond.experimentCaseInspection.v1"),teamId:w,executionId:w,manifestHash:oe,receiptId:w,taskId:w,seed:e.string().min(1),input:e.record(e.string(),e.unknown()).nullable(),output:e.unknown().nullable(),error:e.string().nullable(),events:e.array(e.record(e.string(),e.unknown())).max(25),nextEventCursor:w.nullable(),eventCount:e.number().int().nonnegative()}).strict(),fe=ue.extend({contentHash:oe}).strict(),v=class{constructor(s){this.options=s;let n=new URL(s.baseUrl);if(!["http:","https:"].includes(n.protocol)||n.username||n.password||n.search||n.hash||!s.apiKey.trim()||!s.teamId.trim())throw new Error("A clean API origin and workspace credentials are required.");this.baseUrl=n.toString().replace(/\/+$/,"")}options;static{x(this,"OpenPondExperimentInspectionClient")}baseUrl;async case(s,n,r={}){let b=new URLSearchParams(r.afterId?{afterId:w.parse(r.afterId)}:{}),h=await(this.options.fetch??fetch)(`${this.baseUrl}/v1/experiments/${encodeURIComponent(w.parse(s))}/cases/${encodeURIComponent(w.parse(n))}?${b}`,{signal:r.signal,redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"X-OpenPond-Team-Id":this.options.teamId,Accept:"application/json"}}),S=await h.json();if(!h.ok)throw new Error(e.object({message:e.string()}).parse(S).message);let a=fe.parse(S),{contentHash:l,...i}=a;if(H(i)!==l||a.teamId!==this.options.teamId||a.executionId!==s||a.receiptId!==n||r.manifestHash&&a.manifestHash!==r.manifestHash||a.events.length>a.eventCount)throw new Error("Case inspection differs from its requested workspace, execution or retained content.");return a}};import{readFile as Re,stat as He}from"node:fs/promises";var q=e.object({source:e.enum(["local","github","openpond_git"]),repositoryId:e.string().trim().min(1),profileId:e.string().trim().min(1)}),Ue=e.object({ref:q,revision:e.string().nullable(),sourceHash:e.string()});var m=e.string().trim().min(1).max(200),d=e.string().regex(/^[a-f0-9]{64}$/),ce=e.enum(["queued","running","cancelling","completed","failed","cancelled","interrupted"]),me=e.object({providerId:e.enum(["openpond","custom-openai-compatible","claude-code"]),modelId:e.string().trim().min(1).max(500),configurationHash:d,maxOutputTokens:e.number().int().positive().max(262144),temperature:e.number().min(0).max(2).optional(),topP:e.number().positive().max(1).optional(),messages:e.array(e.object({role:e.enum(["system","user","assistant"]),content:e.string().max(262144)}).strict()).max(200)}).strict(),Te=e.object({configuration:k,package:C}).strict(),De=e.object({configuration:k,expectedPackageHash:d.optional()}).strict(),Ge=e.object({schemaVersion:e.literal("openpond.localExperimentDefinition.v1"),location:e.literal("local"),id:m,teamId:m,ownerActorId:m,revision:e.number().int().positive(),configuration:k,model:me,packageHash:d,graders:e.array(I).min(1).max(100),availableGraders:e.array(I).min(1).max(1e3),createdAt:e.iso.datetime(),updatedAt:e.iso.datetime(),contentHash:d}).strict(),Be=e.object({operationId:m,definition:U}).strict(),Je=e.object({teamId:m,id:m}).strict(),Ke=e.object({teamId:m,projectId:m.optional(),status:ce.optional(),datasetHash:d.optional(),search:e.string().max(100).optional(),afterId:m.optional(),limit:e.number().int().min(1).max(100).default(30)}).strict(),O=e.object({schemaVersion:e.literal("openpond.localExperimentExecution.v1"),location:e.literal("local"),id:m,teamId:m,ownerActorId:m,operationId:m,definition:U,kind:e.enum(["target","scoring"]),executionHash:d,sourceExecution:e.object({id:m,executionHash:d}).strict().nullable(),packageHash:d,maximumCostUsd:e.number().finite().positive(),status:ce,createdAt:e.iso.datetime(),completedAt:e.iso.datetime().nullable(),counts:e.object({pending:e.number().int().nonnegative(),running:e.number().int().nonnegative(),completed:e.number().int().nonnegative(),failed:e.number().int().nonnegative(),cancelled:e.number().int().nonnegative(),unknown:e.number().int().nonnegative()}).strict(),usage:e.object({knownCostUsd:e.number().finite().nonnegative(),costUsd:e.number().finite().nonnegative().nullable(),heldUsd:e.number().finite().nonnegative(),uncertainRequests:e.number().int().nonnegative()}).strict(),cleanupComplete:e.boolean(),error:e.string().max(2e3).nullable()}).strict(),xe=O.omit({definition:!0});function _(t,s){t.kind==="scoring"!=(t.sourceExecution!==null)&&s.addIssue({code:"custom",message:"Only retained scoring passes name an original execution."}),["completed","failed","cancelled","interrupted"].includes(t.status)&&(!t.completedAt||t.counts.pending||t.counts.running)&&s.addIssue({code:"custom",message:"Terminal local execution requires complete population accounting."}),["completed","cancelled"].includes(t.status)&&!t.cleanupComplete&&s.addIssue({code:"custom",message:"Successful completion or cancellation requires confirmed local transport cleanup."}),t.usage.uncertainRequests>0&&t.usage.costUsd!==null&&s.addIssue({code:"custom",message:"Uncertain provider charges cannot claim a measured total."})}x(_,"validateLocalExecutionState");var Me=O.superRefine(_),y=xe.superRefine(_),he=e.object({configuration:j,package:C}).strict(),ge=e.object({configuration:j,expectedPackageHash:e.string().regex(/^[a-f0-9]{64}$/).optional()}).strict(),A=e.object({configuration:j,model:me,packageHash:e.string().regex(/^[a-f0-9]{64}$/),graders:e.array(I).min(1).max(100),availableGraders:e.array(I).min(1).max(1e3),retainedConfigurationHash:e.string().regex(/^[a-f0-9]{64}$/).optional(),configurationHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict().superRefine((t,s)=>{let{configurationHash:n,...r}=t;H(r)!==n&&s.addIssue({code:"custom",message:"Local configuration snapshot bytes changed."})}),{definition:Ve,...Ee}=O.shape,L=e.object({...Ee,kind:e.literal("target"),...A.shape}).strict().superRefine((t,s)=>{let n={configuration:t.configuration,model:t.model,packageHash:t.packageHash,graders:t.graders,availableGraders:t.availableGraders,...t.retainedConfigurationHash?{retainedConfigurationHash:t.retainedConfigurationHash}:{},configurationHash:t.configurationHash};_(t,s),A.safeParse(n).success||s.addIssue({code:"custom",message:"Local Experiment configuration changed."}),(t.operationId!==t.configuration.operationId||t.teamId!==t.configuration.request.teamId||t.maximumCostUsd!==t.configuration.maximumCostUsd)&&s.addIssue({code:"custom",message:"Local Experiment differs from its sealed admission."})}),we=e.object({items:e.array(L).max(100),nextCursor:e.string().nullable()}).strict(),be=e.object({teamId:e.string().min(1).max(200),id:e.string().min(1).max(200),configurationHash:e.string().regex(/^[a-f0-9]{64}$/).optional()}).strict(),Se=e.object({operationId:m,execution:e.object({id:m,executionHash:d}).strict(),graderPackage:C,graders:e.array(re).min(1).max(100),maximumCostUsd:e.number().finite().positive().max(1e4)}).strict(),Qe=Se.omit({graderPackage:!0}),Ie=T,Le=e.object({sessionId:m,turnId:m,source:F,profileRef:q,admissionHash:d,modelConfigurationHash:d,traceHash:d,runtimeEventRefs:e.array(m).max(1e4),startedAt:e.iso.datetime(),completedAt:e.iso.datetime(),outputHash:d,partialOutputAvailable:e.boolean()}).strict(),le=e.object({receiptId:m,taskId:m,seed:e.string(),status:e.enum(["pending","running","completed","failed","cancelled","unknown"]),input:e.record(e.string(),e.unknown()),policyVisibleContext:e.record(e.string(),e.unknown()),output:e.string().nullable(),messages:e.array(e.unknown()).max(4002),grade:ne.nullable(),error:e.string().nullable(),native:Ie.optional(),profileNative:Le.optional(),externalProcess:te.optional()}).strict(),Xe=e.object({execution:e.union([L,y]),cases:e.array(le).max(1e4),contentHash:d}).strict(),ye=e.object({items:e.array(e.object({sequence:e.number().int().positive(),type:e.string().min(1),payload:e.unknown()}).strict()).max(500),nextCursor:e.number().int().positive().nullable()}).strict(),We=e.object({location:e.literal("local"),execution:e.union([L,y]),case:le,trace:ye}).strict(),Ye=e.object({items:e.array(y).max(100),nextCursor:m.nullable()}).strict(),Ze=e.object({execution:y,graders:e.array(I).min(1).max(100),graderPackageHash:d}).strict(),se=e.object({execution:y,manifest:D,result:G}).strict().superRefine((t,s)=>{try{if(B(t),t.manifest.id!==t.execution.id||t.manifest.teamId!==t.execution.teamId||t.manifest.lineage?.execution.id!==(t.execution.sourceExecution?.id??t.execution.id)||t.manifest.lineage.execution.contentHash!==(t.execution.sourceExecution?.executionHash??t.execution.executionHash)||t.manifest.lineage.scoringPassId!==(t.execution.kind==="scoring"?t.execution.id:null)||t.manifest.maximumCostUsd!==t.execution.maximumCostUsd)throw new Error("Portable evidence differs from its retained local execution.")}catch(n){s.addIssue({code:"custom",message:n instanceof Error?n.message:"Local portable evidence verification failed."})}}),pe=e.object({location:e.literal("local"),baseline:se,candidate:se}).strict();async function de(t,s){let[n,r,b]=s,h=o(t,"team");if(t.revision!==void 0)throw new Error("A local Experiment is one immutable run; read it by id rather than a saved configuration revision.");if(n!=="read"&&t.contentHash!==void 0)throw new Error("An exact configuration hash requires the local read action.");if(!h||!n||s.length>(n==="compare"?3:2))throw new Error("Local Experiments require an action and --team; use --server-url for an existing local server.");let S=o(t,"serverUrl")||process.env.OPENPOND_LOCAL_API_URL||ie,a=new URL(S);if(a.protocol!=="http:"||!["localhost","127.0.0.1"].includes(a.hostname)||a.username||a.password||a.search||a.hash||a.pathname!=="/")throw new Error("Local Experiments require an HTTP loopback server origin.");let l=await ae(a.origin);async function i(u,g){let c=await l(new URL("/v1/local-experiments",a),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({teamId:h,action:u,payload:g})}),p=await c.json();if(!c.ok)throw new Error(typeof p.error=="string"?p.error:`Local Experiment request failed (${c.status}).`);return p}x(i,"command");async function E(){let u=o(t,"inputFile");if(!u||(await He(u)).size>67108864)throw new Error("Provide a bounded --input-file with exact local configuration and retained package bytes.");return JSON.parse(await Re(u,"utf8"))}x(E,"input");let f;if(n==="prepare-harness"){if(r)throw new Error("Local Profile preparation accepts --input-file rather than an id.");f=await i("prepareHarness",await E())}else if(n==="run"){if(r)throw new Error("Local Run accepts reviewed configuration through --input-file rather than an id.");let u=await E();f=await i(u.package?"run":"runFromRelease",u)}else if(n==="list"){if(r)throw new Error("Local List does not accept an id.");let u=o(t,"status"),g=o(t,"limit"),c=o(t,"project"),p=o(t,"afterId"),R=o(t,"datasetHash"),$=o(t,"search");f=await i("list",{...u?{status:u}:{},...c?{projectId:c}:{},...R?{datasetHash:R}:{},...$?{search:$}:{},...p?{afterId:p}:{},...g?{limit:Number(g)}:{}})}else{if(!r)throw new Error(`${n} requires a local Experiment or scoring pass id.`);let u=o(t,"afterId"),g=o(t,"limit");if(n==="duplicate"){let c=o(t,"operationId");if(!c)throw new Error("Duplicate requires --operation-id for safe replay.");let p=L.parse(await i("read",{id:r})),R=P.parse({...p.configuration,operationId:c,request:{...p.configuration.request,operationId:c},sourceExperimentId:p.id});f=await i("runFromRelease",{configuration:R,expectedPackageHash:p.packageHash})}else if(n==="passes")f=await i("passes",{executionId:r,...u?{afterId:u}:{},...g?{limit:Number(g)}:{}});else if(n==="case"){let c=o(t,"receiptId"),p=o(t,"afterSequence");if(!c)throw new Error("Local case inspection requires --receipt-id from the retained execution.");f=await i("case",{id:r,receiptId:c,...p?{afterSequence:Number(p)}:{},...g?{limit:Number(g)}:{}})}else if(n==="score"){let c=await E();if(c.execution?.id!==r)throw new Error("Local scoring input belongs to a different retained execution.");f=await i("score",c)}else if(n==="compare"){if(!b)throw new Error("Local Compare requires baseline and candidate execution ids.");let c=pe.parse(await i("compare",{baselineId:r,candidateId:b}));f={...c,comparison:J(c.baseline,c.candidate)}}else if(n==="read"){let c=o(t,"contentHash");f=await i("read",{id:r,...c?{configurationHash:c}:{}})}else if(["status","cancel","result","pass"].includes(n))f=await i(n,{id:r});else if(n==="cancel-pass")f=await i("cancel",{id:r});else if(n==="pass-result")f=await i("result",{id:r});else throw new Error(`Local Experiment action is unavailable: ${n}`)}console.log(JSON.stringify(f,null,2))}x(de,"runLocalExperimentsCommand");async function Et(t,s){if(t.local===!0||t.local==="true")return de(t,s);if(t.revision!==void 0||t.contentHash!==void 0)throw new Error("Experiments retain their immutable configuration on the run; definition revisions are not selectable.");let[n,r]=s,b=o(t,"team");if(!b||!n||s.length>(n==="compare"?3:2))throw new Error("usage: experiments <prepare-harness|run|read|list|status|cancel|duplicate|score|passes|pass|cancel-pass|pass-result|result|compare|case> [id] [candidate-id] --team <id> [--input-file <path>] [--operation-id <id>]");let h=await V(),S={teamId:b,apiKey:await X(h,ee(h)),baseUrl:Z(t)??h.apiBaseUrl??Q},a=new Y(S),l;if(n==="prepare-harness"){let i=o(t,"inputFile");if(!i||r||(await z(i)).size>1048576)throw new Error("Harness preparation requires a bounded --input-file with its released target, model and ceiling.");l=await a.prepareHarness(M.parse(JSON.parse(await N(i,"utf8"))))}else if(n==="run"){let i=o(t,"inputFile");if(!i||r)throw new Error("Run requires --input-file with the reviewed configuration and stable operationId.");if((await z(i)).size>1048576)throw new Error("Experiment input exceeds one MiB.");l=await a.run(P.parse(JSON.parse(await N(i,"utf8"))))}else if(n==="list"){if(r)throw new Error("List does not accept an Experiment id.");let i=o(t,"limit");l=await a.list(K.parse({projectId:o(t,"project")||void 0,datasetHash:o(t,"datasetHash")||void 0,search:o(t,"search")||void 0,status:o(t,"status")||void 0,afterId:o(t,"afterId")||void 0,...i?{limit:Number(i)}:{}}))}else{if(!r)throw new Error(`${n} requires an id.`);if(n==="read")l=await a.get(r);else if(n==="status")l=await a.get(r);else if(n==="cancel")l=await a.cancel(r);else if(n==="duplicate"){let i=o(t,"operationId");if(!i)throw new Error("Duplicate requires a stable --operation-id for the new Experiment.");l=await a.duplicate(r,i)}else if(n==="score"){let i=o(t,"inputFile");if(!i||(await z(i)).size>1048576)throw new Error("Score requires --input-file containing an exact execution reference, grader releases and explicit ceiling, within one MiB.");let E=W.parse(JSON.parse(await N(i,"utf8")));if(E.execution.id!==r)throw new Error("Scoring input belongs to a different execution.");l=await a.score(E)}else if(n==="passes")l=await a.scoringPasses(r,{afterId:o(t,"afterId")||void 0});else if(n==="pass")l=await a.scoringPass(r);else if(n==="cancel-pass")l=await a.cancelScoringPass(r);else if(n==="pass-result")l=await a.scoringResult(r);else if(n==="result")l=await a.result(r);else if(n==="case"){let i=o(t,"receiptId");if(!i)throw new Error("Case inspection requires --receipt-id from the retained Experiment.");let E=await a.get(r);l=await new v(S).case(r,i,{manifestHash:E.manifest.contentHash,afterId:o(t,"afterId")||void 0})}else if(n==="compare"){if(!s[2])throw new Error("Compare requires a baseline and candidate execution id.");l=await a.compare(r,s[2])}else throw new Error(`Unknown Experiment action: ${n}`)}console.log(JSON.stringify(l,null,2))}x(Et,"runExperimentsCommand");export{Et as runExperimentsCommand};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{f as z}from"./chunk-3M53YXEI.js";import{a as L,x as se}from"./chunk-
|
|
2
|
+
import{f as z}from"./chunk-3M53YXEI.js";import{a as L,x as se}from"./chunk-76M2MEHV.js";import"./chunk-PFSMXKTI.js";import"./chunk-BT5YNE5U.js";import"./chunk-WRI4XKSK.js";import"./chunk-6FA3GG5B.js";import{f as F}from"./chunk-MNC4YUDI.js";import"./chunk-Z4Z5UOZM.js";import"./chunk-FFRFSDBM.js";import{f as ne,h as q,p as D,r as ie}from"./chunk-H7IWJN7L.js";import"./chunk-KGNCKIFP.js";import{b as c}from"./chunk-ES2ISFJC.js";import{a as r}from"./chunk-FTQLQJQV.js";var u=class extends Error{static{r(this,"GithubExtensionError")}code;status;constructor(t,i){super(t),this.name="GithubExtensionError",this.code=i.code,this.status=i.status??400}};import{createHash as de}from"node:crypto";import B from"node:path";var oe="HEAD",re=64,ae=512,ue=20*1024*1024,V=5*1024*1024,pe=8,Ge=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,le=/^[A-Za-z0-9_.-]+$/,ce=new Set(["agents","assets","references","scripts"]);function he(e={}){let t=e.fetch??fetch,i=e.githubToken?.trim()||process.env.GITHUB_TOKEN?.trim()||process.env.GH_TOKEN?.trim()||null;return{async resolve(n){let s=await Ie(n,t,i);return{preview:await Ae(s,t,i),files:ge(s)}},async download(n,s){await Me({resolution:n,fetchImpl:t,githubToken:i,writeFile:s})}}}r(he,"createGithubSourceClient");function k(e){let t=e.trim(),i="",n="";if(/^(?:https?:\/\/)?github\.com\//i.test(t)){let l=new URL(t.startsWith("http")?t:`https://${t}`);if(l.hostname.toLowerCase()!=="github.com")throw M(e);let a=l.pathname.replace(/^\/+|\/+$/g,"").split("/");if(a.length!==2)throw M(e);[i="",n=""]=a}else{let a=t.replace(/^github:/i,"").replace(/^\/+|\/+$/g,"").split("/");if(a.length!==2)throw M(e);[i="",n=""]=a}if(n=n.replace(/\.git$/i,""),!le.test(i)||!le.test(n))throw M(e);let s=i.toLowerCase(),o=n.toLowerCase();return{id:`github:${s}/${o}`,owner:s,repo:o,repositoryUrl:`https://github.com/${s}/${o}`}}r(k,"parseGithubExtensionSource");async function Ie(e,t,i){let n=k(e.source),s=e.ref?.trim()||oe,o=await K(t,i,`/repos/${n.owner}/${n.repo}`),l=s===oe?o.default_branch?.trim()||"main":s,a=await K(t,i,`/repos/${n.owner}/${n.repo}/commits/${encodeURIComponent(l)}`),w=a.sha?.trim(),v=a.commit?.tree?.sha?.trim();if(!w||!v)throw new u("GitHub returned an incomplete commit response.",{code:"github_invalid_commit",status:502});let P=await K(t,i,`/repos/${n.owner}/${n.repo}/git/trees/${v}?recursive=1`);if(P.truncated)throw new u("The GitHub repository tree is too large to install safely.",{code:"github_tree_truncated"});let S=(P.tree??[]).filter(He),x=Ce(S);if(x.length===0)throw new u("No skills found. Add SKILL.md at the repository root or use a standard agent skills directory.",{code:"extension_no_skills"});if(x.length>re)throw new u(`Extension contains more than ${re} skills.`,{code:"extension_too_many_skills"});je(x);let A=S.find(g=>g.type==="blob"&&/^readme(?:\.[^/]+)?$/i.test(g.path))??null;return{identity:n,requestedRef:s,resolvedCommit:w,tree:S,skillPackages:x,readme:A}}r(Ie,"resolveSource");async function Ae(e,t,i){let n=await we(e.skillPackages,pe,async a=>{let w=await Ne(e,a.entry,t,i);return Te(a,w)}),s=qe(n.map(a=>a.name));for(let a of n)s.has(a.name)&&(a.validationStatus="error",a.validationMessages=[...a.validationMessages,`Duplicate skill name: ${a.name}`]);let o=n.flatMap(a=>a.validationMessages.map(w=>`${a.relativePath}: ${w}`)),l=ge(e);return{...e.identity,source:"github",requestedRef:e.requestedRef,resolvedCommit:e.resolvedCommit,sourcePath:null,readmePath:e.readme?.path??null,packageHash:Ue(l),skills:n.sort((a,w)=>a.name.localeCompare(w.name)),validationStatus:o.length===0?"valid":"error",validationMessages:o}}r(Ae,"buildPreview");function Te(e,t){let i=L(t),n=e.root==="."?null:B.posix.basename(e.root),s=i.name??n??"invalid-skill",o=[...i.messages];Ge.test(s)||o.push("Skill name must be lowercase kebab-case."),n&&s!==n&&o.push(`Skill name must match its directory name (${n}).`);let l=e.files.filter(a=>a.path!==e.entry.path).map(a=>ze(e.root,a.path)).sort();return{name:s,description:i.description??"",relativePath:e.root==="."?"SKILL.md":`${e.root}/SKILL.md`,sourcePath:"",charCount:t.length,sourceHash:de("sha256").update(t).digest("hex"),resourceFiles:l,validationStatus:o.length===0?"valid":"error",validationMessages:[...new Set(o)]}}r(Te,"previewSkill");function Ce(e){let t=[],i=e.find(a=>a.type==="blob"&&a.path==="SKILL.md");i&&t.push({root:".",entry:i});let n=e.filter(a=>a.type==="blob"&&a.path.endsWith("/SKILL.md")),s=n.filter(a=>Le(a.path)),o=s.length>0?s:n,l=new Set(o.map(a=>B.posix.dirname(a.path)));for(let a of o){let w=B.posix.dirname(a.path);[...l].some(v=>v!==w&&w.startsWith(`${v}/`))||t.push({root:w,entry:a})}return t.map(({root:a,entry:w})=>{let v=e.filter(x=>{if(x.type!=="blob")return!1;if(a!==".")return x.path.startsWith(`${a}/`);if(x.path==="SKILL.md")return!0;let A=x.path.split("/",1)[0]??"";return ce.has(A)}),P=e.find(x=>x.type!=="blob"&&x.type!=="tree"&&(a==="."?x.path==="SKILL.md"||ce.has(x.path.split("/",1)[0]??""):x.path.startsWith(`${a}/`))),S=v.find(x=>x.mode==="120000");if(P||S)throw new u(`Skill package ${a} contains a symlink or submodule.`,{code:"extension_unsafe_entry"});return{root:a,entry:w,files:v}})}r(Ce,"discoverSkillPackages");function Le(e){let t=e.split("/");if(t.at(-1)!=="SKILL.md")return!1;let i=t.slice(0,-1);if(i.length<2)return!1;let n=i.lastIndexOf("skills");if(n<0||n>2)return!1;let s=i.slice(0,n),o=i.slice(n+1);if(o.length<1||o.length>2)return!1;if(n===0)return!0;let l=s[0]??"";return l.startsWith(".")||l==="agent"||l==="data"}r(Le,"isStandardAgentSkillsPath");function ge(e){let t=new Map;e.readme&&t.set(e.readme.path,e.readme);for(let i of e.skillPackages)for(let n of i.files)t.set(n.path,n);return[...t.values()].sort((i,n)=>i.path.localeCompare(n.path))}r(ge,"filesToDownload");async function Me(e){let t=0;await we(e.resolution.files,pe,async i=>{let n=await fe({owner:e.resolution.preview.owner,repo:e.resolution.preview.repo,commit:e.resolution.preview.resolvedCommit,file:i,fetchImpl:e.fetchImpl,githubToken:e.githubToken});if(t+=n.byteLength,t>ue)throw new u("Extension download exceeds the maximum allowed size.",{code:"extension_too_large"});await e.writeFile(i.path,n,i.mode==="100755")})}r(Me,"downloadFiles");async function Ne(e,t,i,n){let s=await fe({owner:e.identity.owner,repo:e.identity.repo,commit:e.resolvedCommit,file:t,fetchImpl:i,githubToken:n});return new TextDecoder("utf-8",{fatal:!0}).decode(s)}r(Ne,"downloadText");async function fe(e){let t=e.file.path.split("/").map(encodeURIComponent).join("/"),i=`https://raw.githubusercontent.com/${e.owner}/${e.repo}/${e.commit}/${t}`,n=await e.fetchImpl(i,{headers:me(e.githubToken,"application/vnd.github.raw"),redirect:"follow"});if(!n.ok)throw new u(`GitHub file download failed (${n.status}): ${e.file.path}`,{code:"github_download_failed",status:n.status});let s=Number(n.headers.get("content-length"));if(Number.isFinite(s)&&s>V)throw new u(`Extension file is too large: ${e.file.path}`,{code:"extension_file_too_large"});let o=new Uint8Array(await n.arrayBuffer());if(o.byteLength>V)throw new u(`Extension file is too large: ${e.file.path}`,{code:"extension_file_too_large"});return o}r(fe,"downloadBytes");async function K(e,t,i){let n=await e(`https://api.github.com${i}`,{headers:me(t,"application/vnd.github+json")});if(!n.ok){let s=await n.json().catch(()=>null),o=typeof s?.message=="string"?`: ${s.message}`:"";throw new u(`GitHub request failed (${n.status})${o}`,{code:n.status===404?"github_repository_not_found":"github_request_failed",status:n.status})}return await n.json()}r(K,"githubJson");function me(e,t){let i=new Headers({Accept:t,"User-Agent":"openpond-extension-installer","X-GitHub-Api-Version":"2022-11-28"});return e&&i.set("Authorization",`Bearer ${e}`),i}r(me,"githubHeaders");function je(e){let t=new Map;for(let n of e)for(let s of n.files)t.set(s.path,s);if(t.size>ae)throw new u(`Extension contains more than ${ae} skill files.`,{code:"extension_too_many_files"});let i=0;for(let n of t.values()){if((n.size??0)>V)throw new u(`Extension file is too large: ${n.path}`,{code:"extension_file_too_large"});i+=n.size??0}if(i>ue)throw new u("Extension exceeds the maximum allowed size.",{code:"extension_too_large"})}r(je,"validateDownloadLimits");function He(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.path=="string"&&!t.path.startsWith("/")&&!t.path.split("/").includes("..")&&typeof t.mode=="string"&&(t.type==="blob"||t.type==="tree"||t.type==="commit")&&typeof t.sha=="string"}r(He,"validTreeEntry");function Ue(e){let t=de("sha256");for(let i of e)t.update(`${i.path}\0${i.sha}\0${i.size??""}
|
|
3
3
|
`);return t.digest("hex")}r(Ue,"hashTree");function ze(e,t){return e==="."?t:t.slice(e.length+1)}r(ze,"relativeSkillPath");function qe(e){let t=new Set,i=new Set;for(let n of e)t.has(n)&&i.add(n),t.add(n);return i}r(qe,"duplicateValues");async function we(e,t,i){let n=new Array(e.length),s=0;async function o(){for(;s<e.length;){let l=s;s+=1,n[l]=await i(e[l])}}return r(o,"worker"),await Promise.all(Array.from({length:Math.min(t,e.length)},o)),n}r(we,"mapConcurrent");function M(e){return new u(`Invalid GitHub extension source: ${e}. Use owner/repo or https://github.com/owner/repo.`,{code:"github_invalid_source"})}r(M,"invalidSource");import{createHash as Fe,randomUUID as Pe}from"node:crypto";import{existsSync as _}from"node:fs";import{mkdir as W,readFile as De,rename as G,rm as I,stat as Ke,writeFile as ye}from"node:fs/promises";import m from"node:path";var j=1,Be=15e3;function ke(e={}){let t=m.resolve(e.home??e.rootPath??ne()),i=m.resolve(e.rootPath??m.join(t,"library","extensions")),n=q(t).database,s=he({fetch:e.fetch,githubToken:e.githubToken}),o=e.now??(()=>new Date);async function l(){try{let g=await O(t),d=await Promise.all(g.extensions.map(f=>X(i,f)));return Je(d,await R(e.reservedSkillNames)),{rootPath:i,registryPath:n,extensions:d.sort(Q),error:null}}catch(g){return{rootPath:i,registryPath:n,extensions:[],error:g instanceof Error?g.message:String(g)}}}r(l,"list");async function a(g){let d=await s.resolve(g),f=await O(t),p=f.extensions.find(h=>h.id===d.preview.id)??null;return T(d.preview,f.extensions.filter(h=>h.id!==p?.id),await R(e.reservedSkillNames)),d.preview}r(a,"preview");async function w(g){let d=k(g.source);return Y(i,d.id,async()=>{let f=await O(t);if(f.extensions.some(y=>y.id===d.id))throw new u(`${d.owner}/${d.repo} is already installed.`,{code:"extension_already_installed",status:409});let p=await s.resolve(g);Ee(p.preview),T(p.preview,f.extensions,await R(e.reservedSkillNames));let h=o().toISOString(),b=await xe({rootPath:i,resolution:p,installedAt:h,updatedAt:h,github:s});try{let y=await R(e.reservedSkillNames);return await J(t,o,E=>({...E,extensions:We(E,b,y)})),await be(i,b.id),b}catch(y){throw await ve(i,b.id),y}})}r(w,"add");async function v(g){let d=k(g.source);return Y(i,d.id,async()=>{let f=await O(t),p=N(f,d.id),h=await s.resolve({source:p.repositoryUrl,ref:g.ref?.trim()||p.requestedRef});if(Ee(h.preview),T(h.preview,f.extensions.filter(y=>y.id!==p.id),await R(e.reservedSkillNames)),p.resolvedCommit===h.preview.resolvedCommit&&p.packageHash===h.preview.packageHash&&p.requestedRef===h.preview.requestedRef)return X(i,p);let b=await xe({rootPath:i,resolution:h,installedAt:p.installedAt,updatedAt:o().toISOString(),github:s});try{let y=await R(e.reservedSkillNames);return await J(t,o,E=>({...E,extensions:Xe(E,b,y)})),await be(i,b.id),b}catch(y){throw await ve(i,b.id),y}})}r(v,"update");async function P(){let g=await l();if(g.error)throw new u(g.error,{code:"extension_registry_error"});let d={updated:[],unchanged:[],failed:[]};for(let f of g.extensions)try{let p=await v({source:f.repositoryUrl,ref:f.requestedRef});p.resolvedCommit===f.resolvedCommit&&p.packageHash===f.packageHash?d.unchanged.push(p):d.updated.push(p)}catch(p){d.failed.push({id:f.id,error:p instanceof Error?p.message:String(p)})}return d}r(P,"updateAll");async function S(g){let d=k(g),f=await O(t);return X(i,N(f,d.id))}r(S,"inspect");async function x(g){let d=k(g);return Y(i,d.id,async()=>{let f=await O(t),p=N(f,d.id),h=C(i,d.owner,d.repo),b=`${h}.${Pe()}.remove`;_(h)&&await G(h,b);try{return await J(t,o,y=>({...y,extensions:y.extensions.filter(E=>E.id!==p.id)})),await I(b,{recursive:!0,force:!0}),p}catch(y){throw _(b)&&!_(h)&&await G(b,h),y}})}r(x,"remove");async function A(g){let d=g.trim();if(!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(d))throw new u("Extension skill name must be lowercase kebab-case.",{code:"extension_skill_invalid_name"});let f=await l();if(f.error)throw new u(f.error,{code:"extension_registry_error"});let p=f.extensions.flatMap(te=>te.skills.filter(U=>U.name===d).map(U=>({extension:te,skill:U})));if(p.length===0)throw new u(`Extension skill not found: ${d}`,{code:"extension_skill_not_found",status:404});if(p.length>1)throw new u(`Extension skill name is ambiguous: ${d}`,{code:"extension_skill_conflict",status:409});let h=p[0];if(h.extension.validationStatus!=="valid"||h.skill.validationStatus!=="valid")throw new u(`Extension skill ${d} is not valid.`,{code:"extension_skill_invalid"});let b=Oe(h.extension.sourcePath,h.skill.relativePath),y=await De(b,"utf8"),E=Fe("sha256").update(y).digest("hex");if(E!==h.skill.sourceHash)throw new u(`Extension skill ${d} changed on disk. Update or reinstall its extension before using it.`,{code:"extension_skill_modified"});let $=L(y);if($.messages.length>0||$.name!==d||!$.description)throw new u(`Extension skill ${d} is not valid. ${$.messages.join(" ")}`.trim(),{code:"extension_skill_invalid"});return{name:d,description:$.description,body:$.body,path:h.skill.relativePath,sourcePath:h.extension.sourcePath,sourceHash:E,charCount:y.length,packagePath:m.dirname(b),resourceFiles:h.skill.resourceFiles}}return r(A,"readSkill"),{rootPath:i,registryPath:n,list:l,preview:a,add:w,update:v,updateAll:P,inspect:S,remove:x,readSkill:A}}r(ke,"createGithubExtensionManager");async function xe(e){let t=e.resolution.preview,i=C(e.rootPath,t.owner,t.repo),n=`${i}.${Pe()}.install`,s=Z(e.rootPath,t.id),o=m.join(n,"current");await I(n,{recursive:!0,force:!0}),await I(s,{recursive:!0,force:!0}),await W(o,{recursive:!0,mode:448});try{await e.github.download(e.resolution,async(a,w,v)=>{let P=Oe(o,a);await W(m.dirname(P),{recursive:!0,mode:448}),await ye(P,w,{mode:v?448:384})});let l=Ve(t,i,e.installedAt,e.updatedAt);return await ye(m.join(n,"extension.json"),`${JSON.stringify(l,null,2)}
|
|
4
4
|
`,{mode:384}),await W(m.dirname(i),{recursive:!0,mode:448}),_(i)&&await G(i,s),await G(n,i),l}catch(l){throw await I(n,{recursive:!0,force:!0}),_(s)&&!_(i)&&await G(s,i),l}}r(xe,"materializeExtension");function Ve(e,t,i,n){let s=m.join(t,"current");return{...e,sourcePath:s,readmePath:e.readmePath?m.join(s,e.readmePath):null,installedAt:i,updatedAt:n,skills:e.skills.map(o=>({...o,sourcePath:m.join(s,o.relativePath)}))}}r(Ve,"installedExtension");async function be(e,t){await I(Z(e,t),{recursive:!0,force:!0})}r(be,"finalizeMaterialization");async function ve(e,t){let i=k(t.replace(/^github:/,"")),n=C(e,i.owner,i.repo),s=Z(e,t);await I(n,{recursive:!0,force:!0}),_(s)&&await G(s,n)}r(ve,"rollbackMaterialization");async function X(e,t){let i=C(e,t.owner,t.repo),n=m.join(i,"current"),s=(await Ke(m.join(i,"extension.json")).catch(()=>null))?.isFile()??!1,o=t.validationMessages.filter(l=>l!=="Installed files are missing.");return s||o.push("Installed files are missing."),{...t,sourcePath:n,readmePath:t.readmePath?m.join(n,m.basename(t.readmePath)):null,skills:t.skills.map(l=>({...l,sourcePath:m.join(n,l.relativePath)})),validationStatus:o.length===0?"valid":"error",validationMessages:o}}r(X,"hydrateExtension");function Ee(e){if(e.validationStatus!=="valid")throw new u(`Extension contains invalid skills: ${e.validationMessages.join(" ")}`,{code:"extension_invalid"})}r(Ee,"assertInstallable");function T(e,t,i){let n=new Map;for(let o of i)n.set(o,"a shipped OpenPond skill");for(let o of t)for(let l of o.skills)n.set(l.name,o.id);let s=e.skills.map(o=>({name:o.name,owner:n.get(o.name)})).filter(o=>!!o.owner);if(s.length!==0)throw new u(`Skill name conflict: ${s.map(o=>`${o.name} (${o.owner})`).join(", ")}.`,{code:"extension_skill_conflict",status:409})}r(T,"assertSkillNamesAvailable");function We(e,t,i){if(e.extensions.some(n=>n.id===t.id))throw new u(`${t.owner}/${t.repo} is already installed.`,{code:"extension_already_installed",status:409});return T(t,e.extensions,i),[...e.extensions,t].sort(Q)}r(We,"appendInstalledExtension");function Xe(e,t,i){return N(e,t.id),T(t,e.extensions.filter(n=>n.id!==t.id),i),e.extensions.map(n=>n.id===t.id?t:n).sort(Q)}r(Xe,"replaceInstalledExtension");function Je(e,t){let i=new Map;for(let n of t)i.set(n,"built-in");for(let n of e)for(let s of n.skills){let o=i.get(s.name);if(!o){i.set(s.name,n.id);continue}let l=`Skill name conflicts with ${o}: ${s.name}`;s.validationStatus="error",s.validationMessages=[...new Set([...s.validationMessages,l])],n.validationStatus="error",n.validationMessages=[...new Set([...n.validationMessages,l])]}}r(Je,"markInstalledSkillConflicts");async function R(e){let t=typeof e=="function"?await e():e??[];return[...new Set(t.map(i=>i.trim()).filter(Boolean))]}r(R,"reservedSkillNames");function N(e,t){let i=e.extensions.find(n=>n.id===t);if(i)return i;throw new u(`${t.replace(/^github:/,"")} is not installed.`,{code:"extension_not_installed",status:404})}r(N,"requireInstalled");async function O(e){let t=D(e,"extension_installations","registry")?.value;if(!t)return Ze();if(t.schemaVersion!==j||!Array.isArray(t.extensions)||!t.extensions.every(Se))throw new Error("Extension registry has an unsupported format.");return Ye(t)}r(O,"readRegistry");async function J(e,t,i){await F(m.join(q(e).runtime,"extension-registry"),async()=>{let n=D(e,"extension_installations","registry"),s=i(await O(e));ie(e,"extension_installations","registry",{...s,schemaVersion:j,updatedAt:t().toISOString()},n?.revision??null)})}r(J,"writeRegistry");function Ye(e){return{schemaVersion:j,updatedAt:typeof e?.updatedAt=="string"?e.updatedAt:null,extensions:Array.isArray(e?.extensions)?e.extensions.filter(Se):[]}}r(Ye,"normalizeRegistry");function Ze(){return{schemaVersion:j,updatedAt:null,extensions:[]}}r(Ze,"emptyRegistry");function Se(e){if(!e||typeof e!="object")return!1;let t=e;return t.source==="github"&&typeof t.id=="string"&&typeof t.owner=="string"&&typeof t.repo=="string"&&typeof t.repositoryUrl=="string"&&typeof t.requestedRef=="string"&&typeof t.resolvedCommit=="string"&&Array.isArray(t.skills)}r(Se,"isStoredExtension");function Oe(e,t){if(m.isAbsolute(t)||t.split(/[\\/]/).includes(".."))throw new u(`Unsafe extension path: ${t}`,{code:"extension_unsafe_path"});let i=m.resolve(e,...t.split("/")),n=`${m.resolve(e)}${m.sep}`;if(!i.startsWith(n))throw new u(`Unsafe extension path: ${t}`,{code:"extension_unsafe_path"});return i}r(Oe,"safeDestination");function C(e,t,i){return m.join(e,"github",t,i)}r(C,"extensionDirectory");function Z(e,t){let i=k(t.replace(/^github:/,""));return`${C(e,i.owner,i.repo)}.previous`}r(Z,"backupDirectory");async function Y(e,t,i){let n=t.replace(/[^a-z0-9.-]+/gi,"-");return F(m.join(e,".locks",n),i,Be)}r(Y,"withExtensionLock");function Q(e,t){return e.id.localeCompare(t.id)}r(Q,"extensionSort");var _e=["openpond-cli","openpond-desktop-harness","openpond-taskset-authoring","openpond-skill-authoring","openpond-agent-authoring","openpond-refiner-authoring"];var Qe=c.object({name:c.string(),description:c.string(),relativePath:c.string(),sourcePath:c.string(),charCount:c.number().int().nonnegative(),sourceHash:c.string(),resourceFiles:c.array(c.string()),validationStatus:c.enum(["valid","error"]),validationMessages:c.array(c.string())}),$e=c.object({id:c.string(),source:c.literal("github"),owner:c.string(),repo:c.string(),repositoryUrl:c.string().url(),requestedRef:c.string(),resolvedCommit:c.string(),sourcePath:c.string(),readmePath:c.string().nullable(),installedAt:c.string(),updatedAt:c.string(),packageHash:c.string(),skills:c.array(Qe),validationStatus:c.enum(["valid","error"]),validationMessages:c.array(c.string())}),vt=$e.omit({installedAt:!0,updatedAt:!0,sourcePath:!0}).extend({sourcePath:c.null()}),Et=c.object({rootPath:c.string(),registryPath:c.string(),extensions:c.array($e),error:c.string().nullable()}),Pt=c.object({source:c.string().trim().min(1),ref:c.string().trim().min(1).optional()});async function $t(e,t,i=ke({reservedSkillNames:r(async()=>{let n=await se();return[..._e,...n.skills.map(s=>s.name)]},"reservedSkillNames")})){let n=t[0]?.toLowerCase()||"list",s=z(e.json);if(n==="list"){let o=await i.list();if(o.error)throw new Error(o.error);et(o.extensions,s);return}if(n==="add"||n==="preview"){let l={source:H(t[1],n),ref:Re(e.ref)},a=n==="preview"?await i.preview(l):await i.add(l);ee(a,s,n==="preview"?"Preview":"Installed");return}if(n==="inspect"){ee(await i.inspect(H(t[1],n)),s,"Installed");return}if(n==="update"){if(z(e.all)){let a=await i.updateAll();if(s)console.log(JSON.stringify(a,null,2));else{console.log(`Updated ${a.updated.length}; unchanged ${a.unchanged.length}; failed ${a.failed.length}.`);for(let w of a.failed)console.log(`- ${w.id}: ${w.error}`)}a.failed.length>0&&(process.exitCode=1);return}let o=H(t[1],n),l=await i.update({source:o,ref:Re(e.ref)});ee(l,s,"Updated");return}if(n==="remove"){let o=await i.remove(H(t[1],n));console.log(s?JSON.stringify({removed:o},null,2):`Removed ${o.owner}/${o.repo} and ${o.skills.length} skill(s).`);return}throw new Error("usage: openpond extension <add|preview|list|inspect|update|remove> [owner/repo] [--ref <ref>] [--all] [--json]")}r($t,"runOpenPondExtensionCommand");function ee(e,t,i){if(t){console.log(JSON.stringify(e,null,2));return}console.log(`${i} ${e.owner}/${e.repo}@${e.resolvedCommit.slice(0,12)} (${e.requestedRef}).`);for(let n of e.skills){let s=n.resourceFiles.length>0?`, ${n.resourceFiles.length} resource(s)`:"";console.log(`- ${n.name}${s}: ${n.description}`)}}r(ee,"printExtension");function et(e,t){if(t){console.log(JSON.stringify({extensions:e},null,2));return}if(e.length===0){console.log("No third-party extensions installed.");return}console.log(`Third-party extensions (${e.length}):`);for(let i of e)console.log(`- ${i.owner}/${i.repo}@${i.resolvedCommit.slice(0,12)} \xB7 ${i.skills.length} skill(s) \xB7 ${i.validationStatus}`)}r(et,"printExtensionList");function H(e,t){let i=e?.trim();if(i)return i;throw new Error(`usage: openpond extension ${t} <owner/repo>`)}r(H,"requiredSource");function Re(e){return typeof e=="string"&&e.trim()?e.trim():void 0}r(Re,"optionText");export{$t as runOpenPondExtensionCommand};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{d as r,f as i,k as p}from"./chunk-
|
|
2
|
+
import{d as r,f as i,k as p}from"./chunk-7UH4YDA7.js";import"./chunk-3M53YXEI.js";import{a as t}from"./chunk-FTQLQJQV.js";function d(){console.log(m())}t(d,"printHelp");function m(){let n=["OpenPond CLI","","Usage:"," openpond [--no-open] [--hostname HOST] [--port PORT]"," openpond <command> [options] [-- passthrough...]"," openpond --version","","Commands:"];for(let o of i()){let s=o.aliases?.length?` (aliases: ${o.aliases.join(", ")})`:"";n.push(` ${o.usage}${s}`);for(let e of o.usages??[])n.push(` ${e}`)}n.push("","Global options:");for(let[o,s]of Object.entries(r).sort(([e],[a])=>e.localeCompare(a))){let e=o.replace(/[A-Z]/g,a=>`-${a.toLowerCase()}`);n.push(s==="boolean"?` --${e}`:` --${e} <${s}>`)}return n.push("","Run `openpond <command> --help` for the selected command schema.","Arguments after `--` are passed through without option parsing."),n.join(`
|
|
3
3
|
`)}t(m,"formatCliHelp");function l(){return["# OpenPond CLI command reference","","<!-- Generated by `pnpm --dir apps/cli docs:commands`; do not edit by hand. -->","","Parsing, aliases, command help, and this reference use the same authoritative registry.","",...i().map(o=>`## ${o.name}
|
|
4
4
|
|
|
5
5
|
\`\`\`text
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{b as a}from"./chunk-E72UU4VX.js";import"./chunk-PF5R6CMP.js";import"./chunk-FEAKTSRS.js";import"./chunk-2RNQQNB7.js";import"./chunk-OQPJ7FJF.js";import"./chunk-EUMXMT3S.js";import"./chunk-Q4TBTRIG.js";import"./chunk-T5AACNJI.js";import"./chunk-TKLBP3MM.js";import"./chunk-RBZH6A6M.js";import"./chunk-DIO5CB6U.js";import"./chunk-7ED24PP6.js";import"./chunk-N4FFQPLR.js";import"./chunk-AY64VY4E.js";import"./chunk-GJ2ZJFDD.js";import"./chunk-3QIB5FXI.js";import"./chunk-6MI4KKWF.js";import"./chunk-DDMZSZFL.js";import"./chunk-W45RKGM6.js";import"./chunk-CGWA54LE.js";import"./chunk-KO3HNMLJ.js";import"./chunk-L3KS6MOV.js";import"./chunk-MQULU465.js";import"./chunk-JMBQYBPI.js";import"./chunk-LPWBIGKW.js";import"./chunk-DZUAT3TP.js";import"./chunk-H7ATCPPB.js";import"./chunk-25JDHAZ5.js";import"./chunk-XMKCCLGB.js";import"./chunk-WN3V6KDN.js";import"./chunk-523TE4BI.js";import"./chunk-ZCHXGRRU.js";import"./chunk-YBT2NB32.js";import"./chunk-74ZXXBGN.js";import"./chunk-APB2STJK.js";import"./chunk-Y4OWBBDD.js";import"./chunk-6ZFPQYHG.js";import"./chunk-JFXWI3EN.js";import"./chunk-6FA3GG5B.js";import"./chunk-Z4Z5UOZM.js";import"./chunk-FFRFSDBM.js";import"./chunk-VYLGI3IH.js";import"./chunk-ACYFMLWG.js";import"./chunk-TVQAPBLZ.js";import"./chunk-KGNCKIFP.js";import"./chunk-ES2ISFJC.js";import"./chunk-FTQLQJQV.js";export{a as createHostProfileEvaluationTools};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{a,b}from"./chunk-ZAN4DYLH.js";import"./chunk-OSIO7PLX.js";import"./chunk-V34H7Y2T.js";import"./chunk-FKJHEZCW.js";import"./chunk-7ED24PP6.js";import"./chunk-RNIAFXMB.js";import"./chunk-2IHO4GDJ.js";import"./chunk-KCJVFLBB.js";import"./chunk-N4FFQPLR.js";import"./chunk-AY64VY4E.js";import"./chunk-GJ2ZJFDD.js";import"./chunk-RZUEVS64.js";import"./chunk-W45RKGM6.js";import"./chunk-CGWA54LE.js";import"./chunk-KO3HNMLJ.js";import"./chunk-H6IW2R22.js";import"./chunk-L3KS6MOV.js";import"./chunk-LPWBIGKW.js";import"./chunk-DZUAT3TP.js";import"./chunk-H7ATCPPB.js";import"./chunk-25JDHAZ5.js";import"./chunk-XMKCCLGB.js";import"./chunk-WN3V6KDN.js";import"./chunk-523TE4BI.js";import"./chunk-ZCHXGRRU.js";import"./chunk-74ZXXBGN.js";import"./chunk-APB2STJK.js";import"./chunk-Y4OWBBDD.js";import"./chunk-6ZFPQYHG.js";import"./chunk-JFXWI3EN.js";import"./chunk-6FA3GG5B.js";import"./chunk-MNC4YUDI.js";import"./chunk-Z4Z5UOZM.js";import"./chunk-FFRFSDBM.js";import"./chunk-H7IWJN7L.js";import"./chunk-VYLGI3IH.js";import"./chunk-ACYFMLWG.js";import"./chunk-TVQAPBLZ.js";import"./chunk-KGNCKIFP.js";import"./chunk-ES2ISFJC.js";import"./chunk-FTQLQJQV.js";export{b as createHostProfileExternalDataset,a as readHostProfileExternalDataset};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{c as wt,d as vt,e as yt}from"./chunk-QHWGQ3A4.js";import{b as gt,c as re,e as Rt}from"./chunk-SH5CBAFC.js";import{a as pt,b as ft}from"./chunk-6FDWRG55.js";import"./chunk-PF5R6CMP.js";import{b as ht}from"./chunk-DMVD2RFZ.js";import{a as ee,b as O,c as te}from"./chunk-JYKRR7E5.js";import{a as St}from"./chunk-OIUTWU6K.js";import"./chunk-X4OSOOSU.js";import"./chunk-3K4VVB7S.js";import{b as De,c as Me,d as ze,f as Ne,h as $e}from"./chunk-3Z47M3YY.js";import{b as je}from"./chunk-ABD5M2D2.js";import"./chunk-TRQQNFMO.js";import"./chunk-FEAKTSRS.js";import"./chunk-OSIO7PLX.js";import"./chunk-F74GBN6K.js";import"./chunk-SDAUS5PY.js";import"./chunk-I2NXNMRZ.js";import"./chunk-O72BSKSO.js";import{a as Je,b as Ze}from"./chunk-OPNRWESL.js";import{b as Ke,c as Qe}from"./chunk-2QUCCP6Z.js";import{a as Y}from"./chunk-O6ULLQJ6.js";import"./chunk-FY5KHLMW.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-DBK66CJP.js";import{d as tt,e as st,ga as ct,ha as dt,ia as mt,j as ot,k as it,v as lt,w as X,y as ut}from"./chunk-OGDADQGH.js";import{a as rt}from"./chunk-4NESNOK5.js";import"./chunk-BLXEAZCQ.js";import"./chunk-UCPGRPWY.js";import{b as et}from"./chunk-HDL5YSAA.js";import"./chunk-ZFSHBFG5.js";import"./chunk-AN525SPP.js";import"./chunk-SYUKES6H.js";import"./chunk-HIOKCIL7.js";import{a as at,b as nt}from"./chunk-GW766ZSO.js";import{p as Ye}from"./chunk-UKMA4R6X.js";import"./chunk-OQKJGTTO.js";import"./chunk-KVTBX2UP.js";import"./chunk-IZ6DLEVY.js";import"./chunk-A6USMRWK.js";import"./chunk-PCSIOUHF.js";import"./chunk-7KWD2I6W.js";import"./chunk-GPVCOEUH.js";import"./chunk-N73MU2C3.js";import"./chunk-ZGTOK7ZK.js";import"./chunk-XW6HGSIT.js";import{b as Xe}from"./chunk-KG325WTN.js";import"./chunk-3RCRSMWZ.js";import"./chunk-DMFUEUAZ.js";import"./chunk-PSGGOZFM.js";import"./chunk-FUOEIDMA.js";import"./chunk-NHQ36THU.js";import{F as qe,I as h,K as z,L as Be}from"./chunk-VRIEKBBH.js";import{g as Oe,m as _e}from"./chunk-QNG27G3T.js";import"./chunk-EIRYMSEG.js";import{a as ge,j as We,k as Ve,t as Ge}from"./chunk-QOTVNQDI.js";import"./chunk-OQPJ7FJF.js";import{a as Fe,o as F,p as Ue,q as U,v as Le,y as Z}from"./chunk-WJ43MJ3F.js";import"./chunk-Q4TBTRIG.js";import"./chunk-T5AACNJI.js";import"./chunk-QOGJAQDO.js";import"./chunk-EYPCBBMS.js";import"./chunk-DIO5CB6U.js";import"./chunk-7ED24PP6.js";import{a as he}from"./chunk-RNIAFXMB.js";import{a as fe}from"./chunk-2IHO4GDJ.js";import"./chunk-KCJVFLBB.js";import{b as Te}from"./chunk-N4FFQPLR.js";import{a as Ie,c as ke}from"./chunk-AY64VY4E.js";import{a as ce,h as be}from"./chunk-GJ2ZJFDD.js";import"./chunk-BFKYRQMA.js";import"./chunk-6QSSIT62.js";import"./chunk-3QIB5FXI.js";import"./chunk-6MI4KKWF.js";import"./chunk-DDMZSZFL.js";import"./chunk-W45RKGM6.js";import"./chunk-3VUATFZD.js";import"./chunk-4EPSHPZL.js";import"./chunk-H6IW2R22.js";import"./chunk-L3KS6MOV.js";import"./chunk-MQULU465.js";import"./chunk-PRGBLQVH.js";import"./chunk-7E6T7GP5.js";import"./chunk-DZUAT3TP.js";import"./chunk-XDQMGUWL.js";import"./chunk-FTEOCCPB.js";import"./chunk-25MBPJVY.js";import"./chunk-WN3V6KDN.js";import"./chunk-523TE4BI.js";import"./chunk-ZCHXGRRU.js";import"./chunk-QDC4OW3S.js";import"./chunk-ZZWAQBA2.js";import"./chunk-YR5ID2SS.js";import"./chunk-YBT2NB32.js";import{c as xe}from"./chunk-74ZXXBGN.js";import"./chunk-APB2STJK.js";import"./chunk-I7AQMAQI.js";import{V as pe,X as Ce}from"./chunk-Z4Z5UOZM.js";import"./chunk-6FA3GG5B.js";import{Hb as Q,Ob as J,f as me,m as Ae}from"./chunk-Y4OWBBDD.js";import"./chunk-6ZFPQYHG.js";import"./chunk-JFXWI3EN.js";import"./chunk-FFRFSDBM.js";import"./chunk-VYLGI3IH.js";import{w as de}from"./chunk-ACYFMLWG.js";import"./chunk-TVQAPBLZ.js";import{l as q,m as g,n as M}from"./chunk-KGNCKIFP.js";import{b as n}from"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import{a as r}from"./chunk-FTQLQJQV.js";import{randomUUID as Vt}from"node:crypto";import{promises as _}from"node:fs";import I from"node:path";function Pt(l){let e=new Map,t=new Map;async function o(s,d){let m=(t.get(s)??Promise.resolve()).catch(()=>{}).then(d);t.set(s,m);try{return await m}finally{t.get(s)===m&&t.delete(s)}}r(o,"serial");let a=r((s,d=18e4)=>l.request(z.parse({contractVersion:h,requestId:Vt(),operation:"profile-evaluations/sandbox",params:s}),d),"request");async function c(s,d,m,f){let y=q(f),v=`${d}/${m}/${y}`,b=e.get(s.sessionId)??new Set;if(!b.has(v)){if(f.length>1e7)throw new Error("The public case file exceeds its admitted bound.");for(let R=0;R===0||R<f.length;R+=98304)s.signal.throwIfAborted(),await a({sessionId:s.sessionId,turnId:s.turnId,action:"upload",area:d,path:m,sha256:y,sizeBytes:f.length,offset:R,contentsBase64:f.subarray(R,R+98304).toString("base64")},3e5);b.add(v),e.set(s.sessionId,b)}}r(c,"upload");async function u(s,d=""){let m=[];for(let f of await _.readdir(I.join(s,d),{withFileTypes:!0})){let y=I.posix.join(d,f.name);if(f.isSymbolicLink()){let v=await _.realpath(I.join(s,y));if(!v.startsWith(`${await _.realpath(s)}${I.sep}`)||(await _.stat(v)).isDirectory())throw new Error("The public Agent runtime symlink escapes its file closure.");m.push(y);continue}if(f.isDirectory()?m.push(...await u(s,y)):f.isFile()&&m.push(y),m.length>8192)throw new Error("The public Agent runtime exceeds the file limit.")}return m}return r(u,"runtimeFiles"),{execute:r(s=>o(s.sessionId,async()=>{s.signal.throwIfAborted();for(let[f,y]of Object.entries(s.publicHashes)){let v=await _.realpath(I.join(s.sourceRoot,f)),b=await _.realpath(s.sourceRoot);if(!v.startsWith(`${b}${I.sep}`))throw new Error("The public case file escaped its source root.");let R=await _.readFile(v);if(q(R)!==y)throw new Error("The public case file changed before upload.");await c(s,"policy",f,R)}if(s.runtimeRoot)for(let f of await u(s.runtimeRoot))await c(s,"runtime",f,await _.readFile(I.join(s.runtimeRoot,f)));let d=I.relative(s.sourceRoot,s.cwd??s.sourceRoot);if(d.startsWith("..")||I.isAbsolute(d))throw new Error("The command cwd escaped the admitted case.");let m=n.object({code:n.number().int().nullable(),stdout:n.string().max(75e4),stderr:n.string().max(75e4),timedOut:n.boolean(),stdoutTruncated:n.boolean(),stderrTruncated:n.boolean()}).parse(await a({sessionId:s.sessionId,turnId:s.turnId,action:"exec",command:s.command,stdin:s.stdin,cwd:d.split(I.sep).join("/"),timeoutMs:s.timeoutMs},s.timeoutMs+15e3));return s.signal.throwIfAborted(),m}),"execute"),readOutput:r(s=>o(s.sessionId,async()=>{let d=pt(s.path),m=[],f=null,y=null;for(let b=0;f===null||b<f;b+=98304){s.signal.throwIfAborted();let R=n.object({sizeBytes:n.number().int().min(1).max(1e7),sha256:n.string().regex(/^[a-f0-9]{64}$/),contentsBase64:n.string().max(131072)}).parse(await a({sessionId:s.sessionId,turnId:s.turnId,action:"read",path:d,offset:b},6e4));f??=R.sizeBytes,y??=R.sha256;let p=Buffer.from(R.contentsBase64,"base64");if(R.sizeBytes!==f||R.sha256!==y||p.length!==Math.min(98304,f-b)||p.toString("base64")!==R.contentsBase64)throw new Error("The confined output changed during readback.");m.push(p)}let v=Buffer.concat(m);if(q(v)!==y)throw new Error("The confined output differs from its saved byte identity.");return s.signal.throwIfAborted(),{bytes:v,title:d.split("/").at(-1)}}),"readOutput"),settle:r((s,d)=>o(s,async()=>{try{await a({sessionId:s,turnId:d,action:"stop"},6e4)}finally{e.delete(s)}}),"settle")}}r(Pt,"createHostedProfileCommandOwner");import{randomUUID as Lt}from"node:crypto";var j=98304;function Ht(l){let e=r((t,o)=>l.request(z.parse({contractVersion:h,requestId:Lt(),operation:t,params:o})),"request");return{persistence:{sourceTurnStartedAt:r(async()=>{throw new Error("The case owner must supply its actual turn start time.")},"sourceTurnStartedAt"),saveSandboxFile:r(async()=>{throw new Error("Isolated Profile outputs must be read by the confined case owner.")},"saveSandboxFile"),save:r(async({sessionId:t,turnId:o,identity:a,bytes:c})=>{let u=n.object({uploadId:n.string().min(1),maxChunkBytes:n.literal(j)}).parse(await e("output/begin",{sessionId:t,turnId:o,output:a}));for(let d=0;d<c.length;d+=j){let m=c.subarray(d,d+j);await e("output/chunk",{uploadId:u.uploadId,index:d/j,offset:d,sha256:q(m),contentsBase64:m.toString("base64")})}let{outputRef:s}=n.object({outputRef:Ge}).parse(await e("output/complete",{uploadId:u.uploadId}));if(s.location.kind!=="managed"||s.sha256!==a.sha256||s.sizeBytes!==c.length||s.sourceTaskId!==t||s.sourceTurnId!==o||s.id!==a.id||s.revision!==a.revision)throw new Error("The durable case output differs from its saved identity.");return{outputRef:s,artifact:{artifactRef:s.location.fileId,path:s.location.downloadPath,title:s.title,contentType:s.contentType,sizeBytes:s.sizeBytes}}},"save")},read:r(async(t,o)=>{if(t.location.kind!=="managed"||t.sizeBytes>1e7)throw new Error("Select a bounded managed case output.");let a=[];for(let u=0;u<t.sizeBytes;u+=j){o?.throwIfAborted();let s=n.object({offset:n.number().int(),contentsBase64:n.string().max(131072),sha256:n.string(),sizeBytes:n.number().int()}).parse(await e("output/readBytes",{sessionId:t.sourceTaskId,turnId:t.sourceTurnId,fileId:t.location.fileId,revision:t.revision,sha256:t.sha256,sizeBytes:t.sizeBytes,offset:u})),d=Buffer.from(s.contentsBase64,"base64");if(s.offset!==u||s.sha256!==t.sha256||s.sizeBytes!==t.sizeBytes||d.length!==Math.min(j,t.sizeBytes-u)||d.toString("base64")!==s.contentsBase64)throw new Error("The durable workbook byte range changed.");a.push(d)}o?.throwIfAborted();let c=Buffer.concat(a);if(q(c)!==t.sha256)throw new Error("The durable workbook differs from its sealed hash.");return c},"read")}}r(Ht,"createHostedProfileArtifactOwner");import{randomUUID as Gt}from"node:crypto";var $t=n.object({createdAt:n.string().datetime(),id:n.string().min(1)}).strict(),Kt=n.object({entries:n.array(n.unknown()).max(100),nextBefore:$t.nullable()}).strict(),se=class{constructor(e){this.client=e}client;static{r(this,"HostedProfileEvaluationStorage")}execute(e){return this.client.request({contractVersion:h,requestId:Gt(),operation:"profile-evaluations/execute",params:e})}async get(e,t,o){let a=await this.execute({action:"get",kind:e,id:t});if(a===null)return null;let c=o.parse(a);return M(c,`Hosted Profile evaluation ${e}`),c}async put(e,t,o,a,c){let u=o.parse(t);M(u,`Hosted Profile evaluation ${e}`);let s=o.parse(await this.execute({action:"put",kind:e,payload:u,profileKey:a,createdAt:c}));if(s.contentHash!==u.contentHash||g(s)!==g(u))throw new Error("Hosted Profile evaluation write returned different evidence.");return s}async page(e,t,o){let a=[],c=null;do{let u=Kt.parse(await this.execute({action:"page",kind:e,profileKey:g(F.parse(t)),before:c,limit:100}));if(u.nextBefore&&(u.entries.length===0||c&&(u.nextBefore.createdAt>c.createdAt||u.nextBefore.createdAt===c.createdAt&&u.nextBefore.id>=c.id)))throw new Error("Hosted Profile evaluation cursor did not advance.");for(let s of u.entries){let d=o.parse(s);M(d,`Hosted Profile evaluation ${e}`),a.push(d)}if(a.length>1e4)throw new Error("Hosted Profile evaluation history exceeds the bounded catalog limit.");c=u.nextBefore}while(c);return a}getProfileEvaluationGrade(e){return this.get("grade",e,de)}saveProfileEvaluationGrade(e){return this.put("grade",e,de,null,new Date().toISOString())}getProfileEvaluationReceipt(e){return this.get("receipt",e,me)}saveProfileEvaluationReceipt(e){if(!Ae(e))throw new Error("Hosted Profile evaluation receipt is invalid.");return this.put("receipt",e,me,null,e.completedAt)}getProfileEvaluationRun(e){return this.get("run",e,Y)}saveProfileEvaluationRun(e){return this.put("run",e,Y,g(F.parse(e.profileRef)),e.completedAt)}listProfileEvaluationRuns(e){return this.page("run",e,Y)}getProfileEvaluationComparison(e){return this.get("comparison",e,Q)}saveProfileEvaluationComparison(e,t){return this.put("comparison",t,Q,g(F.parse(e)),t.createdAt)}listProfileEvaluationComparisons(e){return this.page("comparison",e,Q)}getProfileEvaluationSuiteRun(e){return this.get("suite",e,J)}saveProfileEvaluationSuiteRun(e,t,o){if(g(t)!==o.catalogHash)throw new Error("Hosted Profile evaluation suite differs from its catalog.");return this.put("suite",o,J,g(F.parse(e)),o.createdAt)}listProfileEvaluationSuiteRuns(e){return this.page("suite",e,J)}};async function Et(l){let e=l.release;if(!e.hostExecution)throw new Error("Hosted evaluation requires explicit host execution attribution.");let t={hostConversationId:e.hostExecution.conversationId,hostTurnId:e.hostExecution.turnId},o={source:"openpond_git",profileId:e.profileId,repositoryId:e.repositoryId},a=r(async()=>({ref:o,sourceRevision:e.sourceRevision}),"selectedProfile"),c=r(()=>re(l.client,e),"selectedWorkflows"),u=new se(l.client),s=r(async p=>{if(g(p)!==g(e.harnessRelease))throw new Error("Evaluation requires the admitted Profile release.");let S=await O(l.client,p);if(!S)throw new Error("Admitted evaluation Profile is unavailable.");return S},"loadRuntime"),d=r(async p=>{if(g(p.ref)!==g(o)||p.sourceRevision!==e.sourceRevision)throw new Error("Evaluation requires the admitted Profile source.");return je({...p,runtime:await s(p.harnessRelease)})},"loadCatalog"),m=l.externalDataset?await ht({value:l.externalDataset,release:(await s(e.harnessRelease)).release,sourceRevision:e.sourceRevision,client:l.client}):null,f=r(async(p,S,x)=>{if(S!==e.profileId)throw new Error("Evaluation Taskset Profile differs from its admitted source.");let E=await Ne({definition:p,harnessRelease:x,runtime:await s(x)});if(!E)throw new Error("Evaluation Taskset is absent from the admitted Profile release.");return E},"loadTasksetPackage"),y=wt({resolveExternalDataset:m?.resolveExternalDataset,store:{runtimeEventsForTurn:r(p=>l.core.runtimeEventsForTurn(p),"runtimeEventsForTurn")},storeDir:l.storeDir,readManagedArtifact:l.readManagedArtifact,admitSession:l.admitSession,settleSession:l.settleSession,loadCatalog:d,loadTasksetPackage:f,selectedProfile:a,createSession:r(p=>{let S=Le.parse(p);return l.createSession({...S,metadata:{...S.metadata,...t}})},"createSession"),sendTurn:r((p,S)=>{let x=Z.parse(S);return l.sendTurn(p,{...x,metadata:{...x.metadata,...t}})},"sendTurn"),interruptSessionTurn:l.interruptSessionTurn}),v=$e({resolveExternalDataset:m?.resolveExternalDataset,sourceCandidate:m?.sourceCandidate,privateGradingPreflight:r(p=>Me(p,!1),"privateGradingPreflight"),loadCatalog:d,selectedWorkflows:c,loadTasksetPackage:f,placement:"remote",boundedWorkComputeAvailable:!0,modelConfigurationHash:r(async(p,S)=>{if(p.providerId!=="openpond"||!S.hostModelConfigurationHash)throw new Error("Hosted evaluation requires a host-admitted model configuration receipt.");return S.hostModelConfigurationHash},"modelConfigurationHash")}),b=vt({resolveExternalDataset:m?.resolveExternalDataset,store:u,loadCatalog:d,loadTasksetPackage:f,selectedProfile:a,executeCase:y,privateGrading:r((p,S,x)=>ze({manifest:p,packageValue:S,signal:x,executeSandboxVerifier:De(l.client),authorize:r(async()=>{let E=p.profileEvaluation;if(!E||E.profileId!==e.profileId||E.sourceRevision!==e.sourceRevision)throw new Error("The hosted private grading source changed.");if(E.externalDatasetBinding){if(!m)throw new Error("The frozen Dataset owner is unavailable.");await m.authorize({bindingHash:E.externalDatasetBinding.contentHash,manifestHash:p.contentHash})}let B=await d({ref:o,sourceRevision:e.sourceRevision,harnessRelease:E.harnessRelease});if(!E.externalDatasetBinding&&B.catalogHash!==E.catalogHash)throw new Error("The hosted private grading catalog changed.")},"authorize")}),"privateGrading")}),R={getProfileEvaluationRun:u.getProfileEvaluationRun.bind(u),getProfileEvaluationReceipt:u.getProfileEvaluationReceipt.bind(u),getProfileEvaluationGrade:u.getProfileEvaluationGrade.bind(u),getSession:l.core.getSession.bind(l.core),getTurn:l.core.getTurn.bind(l.core),runtimeEventsForTurn:l.core.runtimeEventsForTurn.bind(l.core),listModelUsageRecords:l.core.listModelUsageRecords.bind(l.core)};return{prepareProfileEvaluationRun:v,executeProfileEvaluationCase:y,executeProfileEvaluationRun:b,runPreparedProfileEvaluation:r(async p=>b(await v(p,{requireExpectedManifestHash:!0})),"runPreparedProfileEvaluation"),runProfileEvaluationSuite:yt({store:u,loadCatalog:d,selectedWorkflows:c,prepareRun:v,executeRun:b}),compareProfileEvaluationRuns:Je({store:u,selectedProfile:a}),buildProfileEvaluationReport:r(p=>Ze({store:u,profileRef:o,request:p}),"buildProfileEvaluationReport"),listProfileEvaluations:r(async p=>{if(p&&typeof p=="object"&&"runId"in p)return Qe({store:R,profileRef:o,...Ke.parse(p)});let[S,x,E,B]=await Promise.all([d({ref:o,sourceRevision:e.sourceRevision,harnessRelease:e.harnessRelease}),u.listProfileEvaluationRuns(o),u.listProfileEvaluationComparisons(o),u.listProfileEvaluationSuiteRuns(o)]);return{...S,runs:x,comparisons:E,suiteRuns:B}},"listProfileEvaluations")}}r(Et,"createHostedProfileEvaluationRuntime");import{mkdir as lr}from"node:fs/promises";import{randomUUID as Dt}from"node:crypto";import W from"node:path";import{randomUUID as bt}from"node:crypto";var Qt=n.object({revision:n.number().int().nonnegative(),payload:n.record(n.string(),n.unknown()).nullable()}).strict(),Jt=n.object({entries:n.array(n.unknown()).max(100),nextAfterId:n.string().min(1).nullable()}).strict(),oe=class{constructor(e){this.client=e}client;static{r(this,"HostedHarnessStateStorage")}async getPreference(e,t){return Qt.parse(await this.client.request({contractVersion:h,requestId:bt(),operation:"harness/state/read",params:{workspaceId:e,kind:t,afterId:null,limit:1}}))}async listCandidates(e){return(await this.readAll(e,"candidates")).map(t=>Ie.parse(t))}async listCrossRunRequests(e){return(await this.readAll(e,"cross_run_requests")).map(t=>ke.parse(t))}async readAll(e,t){let o=[],a=null;do{let c=Jt.parse(await this.client.request({contractVersion:h,requestId:bt(),operation:"harness/state/read",params:{workspaceId:e,kind:t,afterId:a,limit:Math.min(100,1001-o.length)}}));if(c.nextAfterId&&(c.entries.length===0||c.nextAfterId===a))throw new Error("Hosted Harness state cursor did not advance.");if(o.push(...c.entries),o.length>1e3)throw new Error("Hosted Harness state exceeds 1,000 entries.");a=c.nextAfterId}while(a);return o}};import{randomUUID as Zt}from"node:crypto";import{cp as Yt,mkdir as Xt,rm as er}from"node:fs/promises";import tr from"node:path";var we=n.object({schemaVersion:n.literal("openpond.harnessMemoryEntry.v1"),id:n.string(),workspaceId:n.string(),key:n.string(),content:n.string(),tags:n.array(n.string()),revision:n.number().int().positive(),status:n.enum(["active","deleted"]),sourceRunId:n.string().nullable(),sourceProposal:n.object({id:n.string(),contentHash:n.string()}).nullable(),createdAt:n.string().datetime(),updatedAt:n.string().datetime(),contentHash:n.string().regex(/^[a-f0-9]{64}$/)}).strict(),rr=n.object({createdAt:n.string().datetime(),id:n.string()}).strict(),Tt=n.object({entries:n.array(n.unknown()).max(100),nextBefore:rr.nullable()}).strict(),ve=n.object({workspace:ce,receipt:be}).strict(),ae=class{constructor(e,t){this.client=e;this.storeDir=t;this.usage=new Rt(e),this.overlay=new ee({request:r(async o=>o.operation==="harness/overlay/get"?this.request({action:"overlay_get",...o.params}):o.operation==="harness/overlay/freezeProposal"?this.request({action:"overlay_freeze",...o.params},o.requestId):e.request(o),"request")})}client;storeDir;static{r(this,"HostedHarnessReviewStorage")}harnessStoragePlacement="hosted";reviewSessionId=null;overlay;usage;request(e,t=Zt()){return this.client.request({contractVersion:h,requestId:t,operation:"harness/review/execute",params:e},e.action==="release_put"?6e4:15e3)}sessionId(){if(!this.reviewSessionId)throw new Error("Hosted review memory requires an admitted review session.");return this.reviewSessionId}async prepareReview(e){let t=await this.getSession(e.runRef);if(!t)throw new Error("Hosted review session is unavailable.");this.reviewSessionId=t.id;let o=await this.getHarnessRunOverlay(t.id);if(!o)throw new Error("Hosted review overlay is unavailable.");let a=await this.getHarnessWorkspace(o.workspace.workspaceId);if(!a?.currentChannel.release)throw new Error("Hosted review workspace release is unavailable.");let c=await this.getHarnessReleaseRecord(a.currentChannel.release.contentHash);if(!c||c.sourceRevision!==a.sourceRevision)throw new Error("Hosted review source binding changed.");let u=Oe(this.storeDir,a.id);await Xt(u.root,{recursive:!0,mode:448}),await er(u.source,{recursive:!0,force:!0}),await Yt(tr.join(c.bundlePath,"source"),u.source,{recursive:!0,force:!1,errorOnExist:!0});let s=await _e({workspaceId:a.id,sourceDir:u.source});if(s.sourceRevision!==a.sourceRevision||s.harnessRelease.contentHash!==c.harnessRelease.contentHash)throw new Error("Hosted review source cache differs from its immutable release.")}getHarnessWorkspace=r(async e=>ce.nullable().parse(await this.request({action:"workspace_get",workspaceId:e})),"getHarnessWorkspace");getHarnessReleaseRecord=r(async e=>fe.nullable().parse(await this.request({action:"release_get",contentHash:e})),"getHarnessReleaseRecord");saveHarnessReleaseRecord=r(async e=>fe.parse(await this.request({action:"release_put",record:e},`review-release:${e.harnessRelease.contentHash}`)),"saveHarnessReleaseRecord");getHarnessRunOverlay=r(e=>this.overlay.getHarnessRunOverlay(e),"getHarnessRunOverlay");createHarnessRunOverlay=r(e=>this.overlay.createHarnessRunOverlay(e),"createHarnessRunOverlay");freezeHarnessRunOverlayWithProposalAtomically=r(e=>this.overlay.freezeHarnessRunOverlayWithProposalAtomically(e),"freezeHarnessRunOverlayWithProposalAtomically");getHarnessBackgroundReviewSettings=r(async e=>n.object({enabled:n.boolean(),updatedAt:n.string().datetime().nullable()}).strict().parse(await this.request({action:"background_get",workspaceId:e})),"getHarnessBackgroundReviewSettings");getHarnessMemory=r(async(e,t)=>we.nullable().parse(await this.request({action:"memory_get",workspaceId:e,sessionId:this.sessionId(),key:t})),"getHarnessMemory");listHarnessMemories=r(async(e,t={})=>{let o=n.object({entries:n.array(we).max(20),nextBefore:n.object({updatedAt:n.string().datetime(),key:n.string()}).nullable()}),a=[],c=null;do{let u=o.parse(await this.request({action:"memory_page",workspaceId:e,sessionId:this.sessionId(),before:c,limit:20,includeDeleted:t.includeDeleted??!1}));if(a.push(...u.entries),u.nextBefore&&(!u.entries.length||g(u.nextBefore)===g(c)))throw new Error("Hosted memory cursor did not advance.");c=u.nextBefore}while(c&&a.length<1e3);if(c)throw new Error("Hosted review memory exceeds its bounded window.");return a},"listHarnessMemories");writeHarnessMemory=r(async e=>we.parse(await this.request({action:"memory_write",sessionId:this.sessionId(),input:e},`review-memory:${g(e)}`)),"writeHarnessMemory");saveHarnessImprovementArtifact=r(async(e,t,o)=>{let a={action:"artifact_put",workspaceId:e,kind:t,artifact:o},c=(await import("./dist-ZVJPJLXR.js")).HarnessReviewStorageParamsSchema.parse(a);return he[t].parse(await this.request(c,`review-artifact:${t}:${o.contentHash}`))},"saveHarnessImprovementArtifact");listHarnessImprovementArtifacts=r(async(e,t,o=100)=>{let a=[],c=null,u=Math.min(Math.max(1,Math.trunc(o)),1e3);do{let s=(await import("./dist-ZVJPJLXR.js")).HarnessReviewStorageParamsSchema.parse({action:"artifact_page",workspaceId:e,kind:t,before:c,limit:Math.min(100,u-a.length)}),d=Tt.parse(await this.request(s));if(a.push(...d.entries),d.nextBefore&&(!d.entries.length||g(d.nextBefore)===g(c)))throw new Error("Hosted artifact cursor did not advance.");c=d.nextBefore}while(c&&a.length<u);return a.map(s=>he[t].parse(s))},"listHarnessImprovementArtifacts");listPendingHarnessRefinerTriggers=r(async()=>{let e=await import("./hosted-harness-runtime-723S5ZSH.js").then(a=>a.loadHostedHarnessRuntime(this.client));if(!e)return[];let t=[],o=null;do{let a=Tt.parse(await this.request({action:"pending_page",workspaceId:e.workspace.id,before:o,limit:100}));if(t.push(...a.entries.map(c=>({workspaceId:e.workspace.id,trigger:Te.parse(c)}))),a.nextBefore&&(!a.entries.length||g(a.nextBefore)===g(o)))throw new Error("Hosted pending-review cursor did not advance.");o=a.nextBefore}while(o&&t.length<1e3);if(o)throw new Error("Hosted pending reviews exceed the bounded recovery window.");return t},"listPendingHarnessRefinerTriggers");advanceHarnessWorkspaceAtomically=r(async e=>ve.parse(await this.client.request({contractVersion:h,requestId:e.receiptId,operation:"harness/workspace/transition",params:{action:"advance",...e}})),"advanceHarnessWorkspaceAtomically");advanceReviewedHarnessWorkspaceAtomically=r(async e=>ve.parse(await this.client.request({contractVersion:h,requestId:e.receiptId,operation:"harness/workspace/transition",params:{action:"reviewedAdvance",...e}})),"advanceReviewedHarnessWorkspaceAtomically");rollbackHarnessWorkspaceAtomically=r(async e=>ve.parse(await this.client.request({contractVersion:h,requestId:e.receiptId,operation:"harness/workspace/transition",params:{action:"rollback",...e}})),"rollbackHarnessWorkspaceAtomically");getSession=r(async e=>Ue.nullable().parse(await this.request({action:"session_get",sessionId:e})),"getSession");getTurn=r(async e=>U.nullable().parse(await this.request({action:"turn_get",turnId:e})),"getTurn");updateTurn=r(async(e,t)=>{let o=await this.getTurn(e);if(!o)return null;let a=U.parse(t(o)),{harnessSnapshot:c,...u}=o,{harnessSnapshot:s,...d}=a;if(!s||g(u)!==g(d))throw new Error("Hosted review may only restore a missing Harness snapshot.");return U.parse(await this.request({action:"snapshot_restore",turnId:e,expectedHash:g(o),snapshot:s}))},"updateTurn");turnsForSession=r(async(e,t=1e3)=>{let o=n.object({entries:n.array(U).max(100),nextBefore:n.number().int().positive().nullable()}),a=[],c=null,u=Math.min(Math.max(1,Math.trunc(t)),1e3);do{let s=o.parse(await this.request({action:"turn_page",sessionId:e,before:c,limit:Math.min(100,u-a.length)}));if(a.push(...s.entries),s.nextBefore&&(!s.entries.length||c!==null&&s.nextBefore>=c))throw new Error("Hosted review turn cursor did not advance.");c=s.nextBefore}while(c&&a.length<u);return a.reverse()},"turnsForSession");runtimeEventsForTurn=r(async(e,t={})=>{let o=n.object({entries:n.array(ge).max(100),nextAfterSequence:n.number().int().positive().nullable()}),a=[],c=0,u=Math.min(t.limit??1e4,1e4);do{let s=o.parse(await this.request({action:"event_page",turnId:e,afterSequence:c,names:[...t.names??[]],limit:Math.min(100,u-a.length)}));if(a.push(...s.entries),!s.nextAfterSequence)return a;if(!s.entries.length||s.nextAfterSequence<=c)throw new Error("Hosted review event cursor did not advance.");c=s.nextAfterSequence}while(a.length<u);return a},"runtimeEventsForTurn");listModelUsageRecords=r(e=>this.usage.listModelUsageRecords(e),"listModelUsageRecords");async appendRuntimeEvent(e){return ge.parse(await this.request({action:"event_append",event:e},`review-event:${e.id}`))}async upsertModelUsageRecord(e){await this.request({action:"usage_put",record:e},`review-usage:${g(e)}`)}};import{randomUUID as sr}from"node:crypto";async function xt(l,e){let t=xe.parse(await l.request({contractVersion:h,requestId:sr(),operation:"refiner/execute",params:{action:{action:"active_release",workspaceId:e}}}));return M(t,"Hosted Refiner active release"),t}r(xt,"loadHostedRefinerRelease");import{randomUUID as or}from"node:crypto";var ar=n.object({personalizationSoul:n.string().max(8e3).optional(),userInstructions:n.string().max(64e3).optional(),preferences:pe.optional()}).strict(),nr=n.object({revision:n.number().int().positive(),settings:ar}).strict();async function ye(l){let e=await l.request({contractVersion:h,requestId:or(),operation:"settings/get",params:{}}),t=e===null?null:nr.parse(e);return{revision:t?.revision??null,personalizationSoul:t?.settings.personalizationSoul??Ce[0].content,userInstructions:t?.settings.userInstructions??"",preferences:t?.settings.preferences??pe.parse({})}}r(ye,"loadHostedRuntimeSettings");import{randomUUID as It}from"node:crypto";function kt(l){async function e(t){let o=await te(l,t);if(!o)throw new Error("No hosted Harness is selected for this run.");return o.workspace.id}return r(e,"workspaceId"),[{name:"memory_search",description:"Search bounded active memory for this selected Harness or Profile. Returns keys, revisions and short excerpts.",parameters:{type:"object",additionalProperties:!1,properties:{query:{type:"string",minLength:1,maxLength:500},limit:{type:"integer",minimum:1,maximum:20}},required:["query"]},execute:r(async t=>{let o=t.args.query;if(typeof o!="string"||!o.trim()||o.length>500)throw new Error("Memory query is invalid.");let a=t.args.limit===void 0?8:t.args.limit;if(typeof a!="number"||!Number.isInteger(a)||a<1||a>20)throw new Error("Memory search limit is invalid.");let c=await l.request({contractVersion:h,requestId:It(),operation:"harness/memory/search",params:{workspaceId:await e(t.session),query:o,limit:a}});return{toolCallId:t.callId,name:"memory_search",ok:!0,contentText:JSON.stringify(c),data:c}},"execute")},{name:"memory_inspect",description:"Read one exact active memory entry returned by memory_search.",parameters:{type:"object",additionalProperties:!1,properties:{key:{type:"string",minLength:1,maxLength:120}},required:["key"]},execute:r(async t=>{let o=t.args.key;if(typeof o!="string"||!/^[a-z0-9][a-z0-9-]{0,119}$/.test(o))throw new Error("Memory key is invalid.");let a=await l.request({contractVersion:h,requestId:It(),operation:"harness/memory/get",params:{workspaceId:await e(t.session),key:o}});if(!a||typeof a!="object"||Array.isArray(a)||a.status!=="active")throw new Error(`Harness memory does not exist: ${o}.`);return{toolCallId:t.callId,name:"memory_inspect",ok:!0,contentText:JSON.stringify(a),data:a}},"execute")}]}r(kt,"createHostedHarnessMemoryTools");import{randomUUID as At}from"node:crypto";function Ct(l){return[{name:"work_list_outputs",description:"List this conversation's published outputs from completed turns without starting sandbox compute. Use this before reading a previously saved file; returns exact file IDs and revisions. New workspace files are published after the current turn ends. Inspect those with workspace tools and finish the turn instead of polling this list.",parameters:{type:"object",additionalProperties:!1,properties:{}},execute:r(async e=>{let t=await l.request({contractVersion:h,requestId:At(),operation:"output/list",params:{}});return{toolCallId:e.callId,name:"work_list_outputs",ok:!0,contentText:JSON.stringify(t),data:t}},"execute")},{name:"work_read_output",description:"Read the actual saved text/Markdown or PDF text of a file returned by work_list_outputs, without starting sandbox compute. Prefer this for questions about saved outputs. Use workspace tools for edits, execution and unsaved files. PDF text extraction does not inspect images or page appearance.",parameters:{type:"object",additionalProperties:!1,properties:{fileId:{type:"string",minLength:1,maxLength:191},revision:{type:"integer",minimum:1},offset:{type:"integer",minimum:0,maximum:1e7},maxChars:{type:"integer",minimum:1,maximum:1e5},firstPage:{type:"integer",minimum:1,maximum:1e3},pageCount:{type:"integer",minimum:1,maximum:10}},required:["fileId","revision"]},execute:r(async e=>{let t=await l.request(z.parse({contractVersion:h,requestId:At(),operation:"output/read",params:e.args}),6e4);return{toolCallId:e.callId,name:"work_read_output",ok:!0,contentText:JSON.stringify(t),data:t}},"execute")}]}r(Ct,"createHostedWorkOutputTools");import{randomUUID as Ot}from"node:crypto";function _t(l,e){return{allowedTools:e,authorizeTool:r(async t=>{let o=await l.request({contractVersion:h,requestId:Ot(),operation:"embedding/authorize",params:{sessionId:t.session.id,turnId:t.turnId,name:t.name}});if(!o||typeof o!="object"||Array.isArray(o)||o.allowed!==!0)throw new Error("Hosted tool authorization denied.")},"authorizeTool")}}r(_t,"createHostedEmbeddingAdapter");function qt(l){return async e=>{let t=qe.parse(e);return l.request({contractVersion:h,requestId:Ot(),operation:"sandbox/request",params:{action:t}},e.type==="create"?3e5:e.type==="exec"?18e4:6e4)}}r(qt,"createHostedSandboxRequest");var ir=["sandbox/request","embedding/authorize","output/begin","output/chunk","output/complete","output/saveSandboxFile","output/list","output/read","settings/get","harness/get","harness/overlay/get","harness/overlay/put","harness/memory/get","harness/memory/list","harness/memory/search","harness/memory/write","harness/state/read","task-inbox/execute","create-improve/execute","approval/get","approval/upsert","usage/getByRequestId","usage/upsert","usage/page","session/count","session/get","session/page","session/put","turn/count","turn/wakeCount","turn/get","turn/put","turn/latest","turn/page","thread/turnPage","event/append","events/page","events/latestAssistantText"];function Bt(l){if(ir.some(e=>!l.operations.includes(e)))throw new Error("Hosted Postgres runtime capabilities are incomplete.");if(l.maxRequestBytes<256e3||l.maxInFlight<32||l.maxPageSize<200)throw new Error("Hosted Postgres runtime transport limits are incompatible.")}r(Bt,"assertHostedWorkCapabilities");var w=r(async()=>{throw new Error("This hosted control is not available until its Postgres repository is activated.")},"unavailable"),ur=We(),cr=Ve();async function _o(l){let e=l.runtimeStorage,t=l.hostStorageClient;if(e.kind!=="hosted_postgres"||!t||e.client!==t)throw new Error("Hosted storage selection mismatch.");if(l.embedding||l.sandboxRequest)throw new Error("Hosted Postgres tool and sandbox authority must come from the host transport.");if(!l.streamOpenPondHostedChatTurn)throw new Error("Hosted Postgres runtime requires a host-admitted model stream.");if(l.profileSource||l.harness)throw new Error("Hosted Postgres runtime accepts only host-admitted immutable sources.");if(l.services&&Object.values(l.services).some(i=>i!==!1&&i!==void 0))throw new Error("Hosted service adapters must be admitted by the Postgres composition.");let o=Be.parse(await t.request({contractVersion:h,requestId:Dt(),operation:"capabilities",params:{}}));Bt(o);let a=_t(t,o.allowedTools),c=qt(t),u=W.resolve(l.storeDir??process.cwd()),s=W.resolve(l.workspaceDir??process.cwd());await lr(s,{recursive:!0});let d=st({channel:"app-server",logDir:W.join(u,"logs"),metadata:{version:l.version??Xe,runtimeVersion:Ye(),placement:"hosted_work"}}),m=e.core,f=new ae(t,u),y=e.admittedProfileRelease?await gt(t,e.admittedProfileRelease):{profile:cr,profileLibrary:ur},{appendRuntimeEvent:v,closeEventSubscribers:b,subscribeRuntimeEvents:R}=ut({logger:d,assistantDeltaFlushMs:250,store:{appendRuntimeEvent:r(i=>["harness.refiner.queued","harness.refiner.started","harness.refiner.completed","harness.refiner.failed"].includes(i.name)?f.appendRuntimeEvent(i):m.appendRuntimeEvent(i),"appendRuntimeEvent"),runtimeEventPageRows:r(i=>m.runtimeEventPageRows(i),"runtimeEventPageRows")}}),p=X({queueId:"turn-follow-up",logger:d}),S=X({queueId:"subagent",logger:d}),x=nt(l.streamOpenPondHostedChatTurn,{enabled:at()}),E=X({queueId:"harness-refiner",logger:d,concurrency:1}),B=St({store:f,storeDir:u,queue:E,streamOpenPondHostedChatTurn:x,appendRuntimeEvent:v,upsertModelUsageRecord:r(i=>f.upsertModelUsageRecord(i),"upsertModelUsageRecord"),prepareReview:r(i=>f.prepareReview(i),"prepareReview"),loadActiveRefinerRelease:r(async()=>{let i=await O(t);if(!i)throw new Error("Hosted review has no admitted Harness workspace.");return xt(t,i.workspace.id)},"loadActiveRefinerRelease")}),Re=r(async()=>(await ye(t)).preferences,"preferences"),{createSession:ne,getSession:D,updateSession:ie,completeTurn:Mt,failTurn:zt,interruptTurn:jt}=dt({store:m,defaultSessionCwd:r(()=>s,"defaultSessionCwd"),appendRuntimeEvent:v,loadAppPreferences:Re,loadLastUsedProfile:r(async()=>y.profileLibrary.lastUsed,"loadLastUsedProfile")}),le=lt({workspaceDir:s,logger:d,getSession:D,updateSession:ie,appendRuntimeEvent:v,sandboxRequest:c,sandboxCreationMode:"hosted_worker"}),V=ot({appendRuntimeEvent:v,findLocalProject:r(async()=>null,"findLocalProject"),onRepositoryInstructionDiagnostic:r((i,P)=>d.warn("repository instruction file skipped",{diagnostic:i,sessionId:P.id}),"onRepositoryInstructionDiagnostic")}),Nt=new ee(t),L=new oe(t),Se=Ht(t),ue=Pt(t),G=e.admittedProfileRelease?.hostExecution?await O(t,e.admittedProfileRelease.harnessRelease):null;if(e.admittedProfileRelease?.hostExecution&&(!G||!o.operations.includes("output/readBytes")||!o.operations.includes("profile-evaluations/sandbox")||!o.operations.includes("profile-evaluations/grade")))throw new Error("Hosted evaluation requires its admitted release, managed artifact owner and private sandbox grader.");let Ft=tt({deviceId:"hosted-evaluation",storeDir:u,runtimeEventsForSession:r(i=>m.runtimeEventsForSession(i),"runtimeEventsForSession"),managedPersistence:{...Se.persistence,sourceTurnStartedAt:r(async(i,P)=>{let H=await m.getTurn(P);if(!H||H.sessionId!==i||!H.startedAt)throw new Error("The managed output has no actual started case turn.");return H.startedAt},"sourceTurnStartedAt")}}),k=G?ft({readOutput:ue.readOutput,executeCommand:ue.execute,settleRemote:ue.settle,runtimeNode:"node",runtimeAgentRoot:"/workspace/runtime",storeDir:u,release:G.release,getSession:D,getTurn:r(i=>m.getTurn(i),"getTurn"),saveOutput:Ft.saveOwnedOutputBytes,recordOutput:r(async(i,P,H)=>{await v({id:Dt(),timestamp:new Date().toISOString(),name:"workspace_action_result",source:"server",sessionId:i,turnId:P,action:"work_output_save",status:"completed",data:H})},"recordOutput"),authorize:r(async()=>{let i=await O(t,e.admittedProfileRelease.harnessRelease);if(!i||i.release.harnessRelease.contentHash!==G.release.harnessRelease.contentHash)throw new Error("The hosted isolated evaluation source authority changed.")},"authorize")}):null,Ut=mt(a,async(i,P)=>{let H=await m.getTurn(i);if(!H)throw new Error("Embedded turn is unavailable.");let C=await D(H.sessionId),$=C.metadata?.embeddingToolBindings,N=[...P].sort((K,Wt)=>K.name.localeCompare(Wt.name));if($!==void 0&&g($)!==g(N))throw new Error("Embedded tool bindings changed; start a new thread.");await ie(C.id,{metadata:{...C.metadata,embeddingToolBindings:N}}),await m.updateTurn(i,K=>({...K,metadata:{...K.metadata,toolBindings:N}}))}),T=ct({executionHost:"embedded",workInputsForSession:l.workInputsForSession,attachmentRootDir:W.join(u,"attachments"),isolatedProfileEvaluationForTurn:k?async i=>{if(i.metadata?.profileEvaluationRun===void 0)return!1;if(!k.ownsSession(i.id))throw new Error("The hosted evaluation has no actual isolated case owner.");return!0}:void 0,executeProfileEvaluationAction:k?.executeAction,resolveModelTools:r(i=>k?.ownsSession(i.session.id)?k.resolveTools(i):Ut(i),"resolveModelTools"),hostedToolFlags:{toolMode:"native",nativeToolTransport:!0,nativeToolProviderDenylist:[],textToolFallback:!1},store:m,inboxStore:e.inbox,createSession:ne,getSession:D,updateSession:ie,completeTurn:Mt,failTurn:zt,interruptTurn:jt,upsertApproval:r(i=>m.upsertApproval(i),"upsertApproval"),defaultSessionCwd:r(()=>s,"defaultSessionCwd"),findOpenPondApp:r(async i=>({id:i||Fe(s),name:W.basename(s)||"Workspace",description:null,visibility:"private",sandbox:!0}),"findOpenPondApp"),resolveSessionWorkspaceCwd:r(async i=>i.cwd?.trim()||s,"resolveSessionWorkspaceCwd"),ensureCodexRuntime:r(async()=>{throw new Error("Codex process hosting is unavailable.")},"ensureCodexRuntime"),appendWorkspaceDiffEvent:le.appendWorkspaceDiffEvent,workspaceDiffBaseline:le.workspaceDiffBaseline,appendRuntimeEvent:v,executeWorkspaceTool:le.executeWorkspaceTool,executeOpenPondCommand:r(async()=>{throw new Error("Hosted commands require durable authorization.")},"executeOpenPondCommand"),loadOpenPondProfileState:r(async()=>y.profile,"loadOpenPondProfileState"),loadOpenPondProfileLibrary:r(async()=>y.profileLibrary,"loadOpenPondProfileLibrary"),readOpenPondProfileSkill:w,loadSelectedHarnessRuntime:r(i=>{if(i.currentProfile&&(!e.admittedProfileRelease||i.currentProfile.repositoryId!==e.admittedProfileRelease.repositoryId||i.currentProfile.profileId!==e.admittedProfileRelease.profileId))throw new Error("Hosted Profile session lacks admitted immutable source.");return te(t,i)},"loadSelectedHarnessRuntime"),ensureHarnessRunOverlay:r(i=>Nt.ensureHarnessRunOverlay(i),"ensureHarnessRunOverlay"),processHarnessImprovementBoundary:B,harnessModelTools:[...kt(t),...Ct(t)],loadBuiltInOpenPondSkills:r(async()=>[],"loadBuiltInOpenPondSkills"),readBuiltInOpenPondSkill:w,loadPersonalizationSoul:r(async()=>(await ye(t)).personalizationSoul,"loadPersonalizationSoul"),loadAppPreferences:Re,maybeCreateScaffoldForTurn:V.maybeCreateScaffoldForTurn,hostedSystemPrompt:V.hostedSystemPrompt,appendAssistantText:V.appendAssistantText,appendHostedContextUsage:V.appendHostedContextUsage,streamOpenPondHostedChatTurn:x,turnFollowUpQueue:p,subagentQueue:S,maxHostedWorkspaceToolRounds:et(l.maxHostedWorkspaceToolRounds),maxRepeatedInvalidToolRequests:3});await T.recoverPendingSubagentCompletions(),await T.recoverTaskInbox();let Pe=!1,He=r(async(i,P)=>{if(Z.parse(P).attachments?.length&&!k?.ownsSession(i))throw new Error("Hosted attachments require managed-file admission.");let H=await D(i);if(H.currentProfile&&(!e.admittedProfileRelease||H.currentProfile.repositoryId!==e.admittedProfileRelease.repositoryId||H.currentProfile.profileId!==e.admittedProfileRelease.profileId))throw new Error("Hosted Profile session lacks admitted immutable source.");return Pe||(await B.reconcilePending(),await E.drain(),Pe=!0),T.sendTurn(i,P)},"sendTurn");if(l.profileExternalDataset&&!e.admittedProfileRelease?.hostExecution)throw new Error("External Dataset requires its admitted hosted evaluation.");let A=e.admittedProfileRelease?.hostExecution?await Et({client:t,core:m,release:e.admittedProfileRelease,storeDir:u,...l.profileExternalDataset?{externalDataset:l.profileExternalDataset}:{},readManagedArtifact:Se.read,admitSession:k.admitSession,settleSession:k.settleSession,createSession:ne,sendTurn:He,interruptSessionTurn:T.interruptSessionTurn}):null,Ee=!1;return{...rt({ports:it({bindHome:!1,placement:"hosted_work",connectedAppProviders:[],featureOverrides:{profileWorkflows:!!e.admittedProfileRelease,profileEvaluations:!!A,harnessProposalReview:!1,harnessEvaluationReview:!1,harnessEvaluationReviewAcceptance:!1,harnessEvaluationTasksetMaterialization:!1,harnessEvaluationBaseline:!1,harnessBackgroundReview:!1,harnessDiff:!1,harnessRollback:!1,harnessReview:!1,refinerProfiles:!1,immutableRefinerAdmission:!1},createSession:ne,getSession:D,turnsForSession:r(i=>m.turnsForSession(i,1e3),"turnsForSession"),runtimeEventsForSession:r(i=>m.runtimeEventsForSession(i,{excludeReasoningDeltas:!0}),"runtimeEventsForSession"),sendTurn:He,steerSessionTurn:T.steerSessionTurn,readTaskInbox:T.readTaskInbox,queueTaskInput:T.queueTaskInput,updateTaskInput:T.updateTaskInput,isSessionTurnActive:T.isSessionTurnActive,waitForSessionTurnSettlement:T.waitForSessionTurnSettlement,interruptSessionTurn:T.interruptSessionTurn,resolveApproval:r(async(i,P)=>{let H=await T.resolveCreateImproveApproval(i,P);if(H)return H;let C=await T.resolveSubagentPatchApplyApproval(i,P);if(C)return C;throw new Error(`Approval not found: ${i}`)},"resolveApproval"),listProfileWorkflows:e.admittedProfileRelease?()=>re(t,e.admittedProfileRelease):w,listProfileEvaluations:A?.listProfileEvaluations??w,loadProfileTrainingSource:w,prepareProfileEvaluationRun:A?.prepareProfileEvaluationRun??w,runPreparedProfileEvaluation:A?.runPreparedProfileEvaluation??w,runProfileEvaluationSuite:A?.runProfileEvaluationSuite??w,executeProfileEvaluationCase:A?.executeProfileEvaluationCase??w,executeProfileEvaluationRun:A?.executeProfileEvaluationRun??w,compareProfileEvaluationRuns:A?.compareProfileEvaluationRuns??w,buildProfileEvaluationReport:A?.buildProfileEvaluationReport??w,inspectHarness:r(async()=>{let i=await O(t);if(!i)return null;let P=i.workspace.id,[H,C,$,N]=await Promise.all([L.getPreference(P,"workspace_settings"),L.getPreference(P,"evaluation_review_settings"),L.listCandidates(P),L.listCrossRunRequests(P)]);return{workspace:i.workspace,release:i.release,backgroundReview:H,evaluationReview:C,refinementCandidates:$,crossRunRequests:N}},"inspectHarness"),reviewHarnessProposal:w,reviewHarness:w,acceptHarnessEvaluationReview:w,materializeHarnessEvaluationTaskset:w,runHarnessEvaluationBaseline:w,validateHarness:r(async()=>{let i=await O(t);return i?{valid:!0,workspaceId:i.workspace.id,harnessRelease:i.release.harnessRelease,agentSnapshot:i.release.agentSnapshot}:{valid:!1,reason:"No admitted hosted Harness release."}},"validateHarness"),updateHarnessBackgroundReview:w,diffHarness:w,rollbackHarness:w,inspectRefiner:w,updateRefiner:w,activateRefiner:w,rollbackRefiner:w,subscribeRuntimeEvents:R,observeRuntimeOperation:r(i=>d.info("agent runtime operation",i),"observeRuntimeOperation")}),close:r(async()=>{Ee||(Ee=!0,k?.close(),await T.close(),await Promise.all([p.drain(),S.drain(),E.drain()]),await b(),await d.flush())},"close")}),storePath:"hosted-postgres",workspaceDir:s,composition:["runtime_event_bus","session_store","hosted_provider","workspace_tools","command_approvals","harness","agent_runtime","jsonl_transport"]}}r(_o,"createHostedOwnedAppServer");export{_o as createHostedOwnedAppServer};
|
|
2
|
+
import{c as wt,d as vt,e as yt}from"./chunk-GYJQKCEO.js";import{b as gt,c as re,e as Rt}from"./chunk-NTB2O4RP.js";import{a as pt,b as ft}from"./chunk-E72UU4VX.js";import"./chunk-PF5R6CMP.js";import{b as ht}from"./chunk-ZAN4DYLH.js";import{a as ee,b as O,c as te}from"./chunk-4GPXTISD.js";import{a as St}from"./chunk-MFMYWZK2.js";import"./chunk-X4OSOOSU.js";import"./chunk-7K7O3CKY.js";import{b as De,c as Me,d as ze,f as Ne,h as $e}from"./chunk-K44RHALX.js";import{b as je}from"./chunk-EOBHQ3JT.js";import"./chunk-TRQQNFMO.js";import"./chunk-FEAKTSRS.js";import"./chunk-OSIO7PLX.js";import"./chunk-F74GBN6K.js";import"./chunk-P2RSBSCT.js";import"./chunk-I2NXNMRZ.js";import"./chunk-2L5XWJJ5.js";import{a as Je,b as Ze}from"./chunk-OPNRWESL.js";import{b as Ke,c as Qe}from"./chunk-ATAOHSFR.js";import{a as Y}from"./chunk-2WKUBGIF.js";import"./chunk-EQOV34UH.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-JQKSXCAJ.js";import{d as tt,e as st,ga as ct,ha as dt,ia as mt,j as ot,k as it,v as lt,w as X,y as ut}from"./chunk-VRODAXFS.js";import{a as rt}from"./chunk-LNCHFVHT.js";import"./chunk-BL3YH2QU.js";import"./chunk-UCPGRPWY.js";import{b as et}from"./chunk-7AVNZF36.js";import"./chunk-N6ENLEMY.js";import"./chunk-AN525SPP.js";import"./chunk-SYUKES6H.js";import"./chunk-FAYASU7Z.js";import{a as at,b as nt}from"./chunk-GW766ZSO.js";import{p as Ye}from"./chunk-GOPFFQZU.js";import"./chunk-O3RF72BT.js";import"./chunk-KVTBX2UP.js";import"./chunk-IZ6DLEVY.js";import"./chunk-MMQRHR3V.js";import"./chunk-PCSIOUHF.js";import"./chunk-7KWD2I6W.js";import"./chunk-GPVCOEUH.js";import"./chunk-N73MU2C3.js";import"./chunk-BQS7Z4AP.js";import"./chunk-XW6HGSIT.js";import{b as Xe}from"./chunk-57TRXBLT.js";import"./chunk-BE6SS65L.js";import"./chunk-DMFUEUAZ.js";import"./chunk-PSGGOZFM.js";import"./chunk-PH6IORGZ.js";import"./chunk-TG7P7BSV.js";import{F as qe,I as h,K as z,L as Be}from"./chunk-VGRMAGOK.js";import{g as Oe,m as _e}from"./chunk-V34H7Y2T.js";import"./chunk-FKJHEZCW.js";import{a as ge,j as We,k as Ve,t as Ge}from"./chunk-2RNQQNB7.js";import"./chunk-OQPJ7FJF.js";import{a as Fe,o as F,p as Ue,q as U,v as Le,y as Z}from"./chunk-EUMXMT3S.js";import"./chunk-Q4TBTRIG.js";import"./chunk-T5AACNJI.js";import"./chunk-TKLBP3MM.js";import"./chunk-RBZH6A6M.js";import"./chunk-DIO5CB6U.js";import"./chunk-7ED24PP6.js";import{a as he}from"./chunk-RNIAFXMB.js";import{a as fe}from"./chunk-2IHO4GDJ.js";import"./chunk-KCJVFLBB.js";import{b as xe}from"./chunk-N4FFQPLR.js";import{a as ke,c as Ae}from"./chunk-AY64VY4E.js";import{a as de,h as Te}from"./chunk-GJ2ZJFDD.js";import"./chunk-BFKYRQMA.js";import"./chunk-RZUEVS64.js";import"./chunk-3QIB5FXI.js";import"./chunk-6MI4KKWF.js";import"./chunk-DDMZSZFL.js";import"./chunk-W45RKGM6.js";import"./chunk-CGWA54LE.js";import"./chunk-KO3HNMLJ.js";import"./chunk-H6IW2R22.js";import"./chunk-L3KS6MOV.js";import"./chunk-MQULU465.js";import"./chunk-JMBQYBPI.js";import"./chunk-LPWBIGKW.js";import"./chunk-DZUAT3TP.js";import"./chunk-H7ATCPPB.js";import"./chunk-25JDHAZ5.js";import"./chunk-XMKCCLGB.js";import"./chunk-WN3V6KDN.js";import"./chunk-523TE4BI.js";import"./chunk-ZCHXGRRU.js";import"./chunk-QDC4OW3S.js";import"./chunk-ZZWAQBA2.js";import"./chunk-YR5ID2SS.js";import"./chunk-YBT2NB32.js";import{c as Ie}from"./chunk-74ZXXBGN.js";import"./chunk-APB2STJK.js";import{Hb as Q,Ob as J,f as pe,m as Ce}from"./chunk-Y4OWBBDD.js";import"./chunk-6ZFPQYHG.js";import"./chunk-JFXWI3EN.js";import"./chunk-6FA3GG5B.js";import"./chunk-MNC4YUDI.js";import{V as ce,X as be}from"./chunk-Z4Z5UOZM.js";import"./chunk-FFRFSDBM.js";import"./chunk-H7IWJN7L.js";import"./chunk-VYLGI3IH.js";import{w as me}from"./chunk-ACYFMLWG.js";import"./chunk-TVQAPBLZ.js";import{l as q,m as g,n as M}from"./chunk-KGNCKIFP.js";import{b as n}from"./chunk-ES2ISFJC.js";import{a as r}from"./chunk-FTQLQJQV.js";import{randomUUID as Vt}from"node:crypto";import{promises as _}from"node:fs";import I from"node:path";function Pt(l){let e=new Map,t=new Map;async function o(s,d){let m=(t.get(s)??Promise.resolve()).catch(()=>{}).then(d);t.set(s,m);try{return await m}finally{t.get(s)===m&&t.delete(s)}}r(o,"serial");let a=r((s,d=18e4)=>l.request(z.parse({contractVersion:h,requestId:Vt(),operation:"profile-evaluations/sandbox",params:s}),d),"request");async function c(s,d,m,f){let y=q(f),v=`${d}/${m}/${y}`,b=e.get(s.sessionId)??new Set;if(!b.has(v)){if(f.length>1e7)throw new Error("The public case file exceeds its admitted bound.");for(let R=0;R===0||R<f.length;R+=98304)s.signal.throwIfAborted(),await a({sessionId:s.sessionId,turnId:s.turnId,action:"upload",area:d,path:m,sha256:y,sizeBytes:f.length,offset:R,contentsBase64:f.subarray(R,R+98304).toString("base64")},3e5);b.add(v),e.set(s.sessionId,b)}}r(c,"upload");async function u(s,d=""){let m=[];for(let f of await _.readdir(I.join(s,d),{withFileTypes:!0})){let y=I.posix.join(d,f.name);if(f.isSymbolicLink()){let v=await _.realpath(I.join(s,y));if(!v.startsWith(`${await _.realpath(s)}${I.sep}`)||(await _.stat(v)).isDirectory())throw new Error("The public Agent runtime symlink escapes its file closure.");m.push(y);continue}if(f.isDirectory()?m.push(...await u(s,y)):f.isFile()&&m.push(y),m.length>8192)throw new Error("The public Agent runtime exceeds the file limit.")}return m}return r(u,"runtimeFiles"),{execute:r(s=>o(s.sessionId,async()=>{s.signal.throwIfAborted();for(let[f,y]of Object.entries(s.publicHashes)){let v=await _.realpath(I.join(s.sourceRoot,f)),b=await _.realpath(s.sourceRoot);if(!v.startsWith(`${b}${I.sep}`))throw new Error("The public case file escaped its source root.");let R=await _.readFile(v);if(q(R)!==y)throw new Error("The public case file changed before upload.");await c(s,"policy",f,R)}if(s.runtimeRoot)for(let f of await u(s.runtimeRoot))await c(s,"runtime",f,await _.readFile(I.join(s.runtimeRoot,f)));let d=I.relative(s.sourceRoot,s.cwd??s.sourceRoot);if(d.startsWith("..")||I.isAbsolute(d))throw new Error("The command cwd escaped the admitted case.");let m=n.object({code:n.number().int().nullable(),stdout:n.string().max(75e4),stderr:n.string().max(75e4),timedOut:n.boolean(),stdoutTruncated:n.boolean(),stderrTruncated:n.boolean()}).parse(await a({sessionId:s.sessionId,turnId:s.turnId,action:"exec",command:s.command,stdin:s.stdin,cwd:d.split(I.sep).join("/"),timeoutMs:s.timeoutMs},s.timeoutMs+15e3));return s.signal.throwIfAborted(),m}),"execute"),readOutput:r(s=>o(s.sessionId,async()=>{let d=pt(s.path),m=[],f=null,y=null;for(let b=0;f===null||b<f;b+=98304){s.signal.throwIfAborted();let R=n.object({sizeBytes:n.number().int().min(1).max(1e7),sha256:n.string().regex(/^[a-f0-9]{64}$/),contentsBase64:n.string().max(131072)}).parse(await a({sessionId:s.sessionId,turnId:s.turnId,action:"read",path:d,offset:b},6e4));f??=R.sizeBytes,y??=R.sha256;let p=Buffer.from(R.contentsBase64,"base64");if(R.sizeBytes!==f||R.sha256!==y||p.length!==Math.min(98304,f-b)||p.toString("base64")!==R.contentsBase64)throw new Error("The confined output changed during readback.");m.push(p)}let v=Buffer.concat(m);if(q(v)!==y)throw new Error("The confined output differs from its saved byte identity.");return s.signal.throwIfAborted(),{bytes:v,title:d.split("/").at(-1)}}),"readOutput"),settle:r((s,d)=>o(s,async()=>{try{await a({sessionId:s,turnId:d,action:"stop"},6e4)}finally{e.delete(s)}}),"settle")}}r(Pt,"createHostedProfileCommandOwner");import{randomUUID as Lt}from"node:crypto";var j=98304;function Ht(l){let e=r((t,o)=>l.request(z.parse({contractVersion:h,requestId:Lt(),operation:t,params:o})),"request");return{persistence:{sourceTurnStartedAt:r(async()=>{throw new Error("The case owner must supply its actual turn start time.")},"sourceTurnStartedAt"),saveSandboxFile:r(async()=>{throw new Error("Isolated Profile outputs must be read by the confined case owner.")},"saveSandboxFile"),save:r(async({sessionId:t,turnId:o,identity:a,bytes:c})=>{let u=n.object({uploadId:n.string().min(1),maxChunkBytes:n.literal(j)}).parse(await e("output/begin",{sessionId:t,turnId:o,output:a}));for(let d=0;d<c.length;d+=j){let m=c.subarray(d,d+j);await e("output/chunk",{uploadId:u.uploadId,index:d/j,offset:d,sha256:q(m),contentsBase64:m.toString("base64")})}let{outputRef:s}=n.object({outputRef:Ge}).parse(await e("output/complete",{uploadId:u.uploadId}));if(s.location.kind!=="managed"||s.sha256!==a.sha256||s.sizeBytes!==c.length||s.sourceTaskId!==t||s.sourceTurnId!==o||s.id!==a.id||s.revision!==a.revision)throw new Error("The durable case output differs from its saved identity.");return{outputRef:s,artifact:{artifactRef:s.location.fileId,path:s.location.downloadPath,title:s.title,contentType:s.contentType,sizeBytes:s.sizeBytes}}},"save")},read:r(async(t,o)=>{if(t.location.kind!=="managed"||t.sizeBytes>1e7)throw new Error("Select a bounded managed case output.");let a=[];for(let u=0;u<t.sizeBytes;u+=j){o?.throwIfAborted();let s=n.object({offset:n.number().int(),contentsBase64:n.string().max(131072),sha256:n.string(),sizeBytes:n.number().int()}).parse(await e("output/readBytes",{sessionId:t.sourceTaskId,turnId:t.sourceTurnId,fileId:t.location.fileId,revision:t.revision,sha256:t.sha256,sizeBytes:t.sizeBytes,offset:u})),d=Buffer.from(s.contentsBase64,"base64");if(s.offset!==u||s.sha256!==t.sha256||s.sizeBytes!==t.sizeBytes||d.length!==Math.min(j,t.sizeBytes-u)||d.toString("base64")!==s.contentsBase64)throw new Error("The durable workbook byte range changed.");a.push(d)}o?.throwIfAborted();let c=Buffer.concat(a);if(q(c)!==t.sha256)throw new Error("The durable workbook differs from its sealed hash.");return c},"read")}}r(Ht,"createHostedProfileArtifactOwner");import{randomUUID as Gt}from"node:crypto";var $t=n.object({createdAt:n.string().datetime(),id:n.string().min(1)}).strict(),Kt=n.object({entries:n.array(n.unknown()).max(100),nextBefore:$t.nullable()}).strict(),se=class{constructor(e){this.client=e}client;static{r(this,"HostedProfileEvaluationStorage")}execute(e){return this.client.request({contractVersion:h,requestId:Gt(),operation:"profile-evaluations/execute",params:e})}async get(e,t,o){let a=await this.execute({action:"get",kind:e,id:t});if(a===null)return null;let c=o.parse(a);return M(c,`Hosted Profile evaluation ${e}`),c}async put(e,t,o,a,c){let u=o.parse(t);M(u,`Hosted Profile evaluation ${e}`);let s=o.parse(await this.execute({action:"put",kind:e,payload:u,profileKey:a,createdAt:c}));if(s.contentHash!==u.contentHash||g(s)!==g(u))throw new Error("Hosted Profile evaluation write returned different evidence.");return s}async page(e,t,o){let a=[],c=null;do{let u=Kt.parse(await this.execute({action:"page",kind:e,profileKey:g(F.parse(t)),before:c,limit:100}));if(u.nextBefore&&(u.entries.length===0||c&&(u.nextBefore.createdAt>c.createdAt||u.nextBefore.createdAt===c.createdAt&&u.nextBefore.id>=c.id)))throw new Error("Hosted Profile evaluation cursor did not advance.");for(let s of u.entries){let d=o.parse(s);M(d,`Hosted Profile evaluation ${e}`),a.push(d)}if(a.length>1e4)throw new Error("Hosted Profile evaluation history exceeds the bounded catalog limit.");c=u.nextBefore}while(c);return a}getProfileEvaluationGrade(e){return this.get("grade",e,me)}saveProfileEvaluationGrade(e){return this.put("grade",e,me,null,new Date().toISOString())}getProfileEvaluationReceipt(e){return this.get("receipt",e,pe)}saveProfileEvaluationReceipt(e){if(!Ce(e))throw new Error("Hosted Profile evaluation receipt is invalid.");return this.put("receipt",e,pe,null,e.completedAt)}getProfileEvaluationRun(e){return this.get("run",e,Y)}saveProfileEvaluationRun(e){return this.put("run",e,Y,g(F.parse(e.profileRef)),e.completedAt)}listProfileEvaluationRuns(e){return this.page("run",e,Y)}getProfileEvaluationComparison(e){return this.get("comparison",e,Q)}saveProfileEvaluationComparison(e,t){return this.put("comparison",t,Q,g(F.parse(e)),t.createdAt)}listProfileEvaluationComparisons(e){return this.page("comparison",e,Q)}getProfileEvaluationSuiteRun(e){return this.get("suite",e,J)}saveProfileEvaluationSuiteRun(e,t,o){if(g(t)!==o.catalogHash)throw new Error("Hosted Profile evaluation suite differs from its catalog.");return this.put("suite",o,J,g(F.parse(e)),o.createdAt)}listProfileEvaluationSuiteRuns(e){return this.page("suite",e,J)}};async function Et(l){let e=l.release;if(!e.hostExecution)throw new Error("Hosted evaluation requires explicit host execution attribution.");let t={hostConversationId:e.hostExecution.conversationId,hostTurnId:e.hostExecution.turnId},o={source:"openpond_git",profileId:e.profileId,repositoryId:e.repositoryId},a=r(async()=>({ref:o,sourceRevision:e.sourceRevision}),"selectedProfile"),c=r(()=>re(l.client,e),"selectedWorkflows"),u=new se(l.client),s=r(async p=>{if(g(p)!==g(e.harnessRelease))throw new Error("Evaluation requires the admitted Profile release.");let S=await O(l.client,p);if(!S)throw new Error("Admitted evaluation Profile is unavailable.");return S},"loadRuntime"),d=r(async p=>{if(g(p.ref)!==g(o)||p.sourceRevision!==e.sourceRevision)throw new Error("Evaluation requires the admitted Profile source.");return je({...p,runtime:await s(p.harnessRelease)})},"loadCatalog"),m=l.externalDataset?await ht({value:l.externalDataset,release:(await s(e.harnessRelease)).release,sourceRevision:e.sourceRevision,client:l.client}):null,f=r(async(p,S,x)=>{if(S!==e.profileId)throw new Error("Evaluation Taskset Profile differs from its admitted source.");let E=await Ne({definition:p,harnessRelease:x,runtime:await s(x)});if(!E)throw new Error("Evaluation Taskset is absent from the admitted Profile release.");return E},"loadTasksetPackage"),y=wt({resolveExternalDataset:m?.resolveExternalDataset,store:{runtimeEventsForTurn:r(p=>l.core.runtimeEventsForTurn(p),"runtimeEventsForTurn")},storeDir:l.storeDir,readManagedArtifact:l.readManagedArtifact,admitSession:l.admitSession,settleSession:l.settleSession,loadCatalog:d,loadTasksetPackage:f,selectedProfile:a,createSession:r(p=>{let S=Le.parse(p);return l.createSession({...S,metadata:{...S.metadata,...t}})},"createSession"),sendTurn:r((p,S)=>{let x=Z.parse(S);return l.sendTurn(p,{...x,metadata:{...x.metadata,...t}})},"sendTurn"),interruptSessionTurn:l.interruptSessionTurn}),v=$e({resolveExternalDataset:m?.resolveExternalDataset,sourceCandidate:m?.sourceCandidate,privateGradingPreflight:r(p=>Me(p,!1),"privateGradingPreflight"),loadCatalog:d,selectedWorkflows:c,loadTasksetPackage:f,placement:"remote",boundedWorkComputeAvailable:!0,modelConfigurationHash:r(async(p,S)=>{if(p.providerId!=="openpond"||!S.hostModelConfigurationHash)throw new Error("Hosted evaluation requires a host-admitted model configuration receipt.");return S.hostModelConfigurationHash},"modelConfigurationHash")}),b=vt({resolveExternalDataset:m?.resolveExternalDataset,store:u,loadCatalog:d,loadTasksetPackage:f,selectedProfile:a,executeCase:y,privateGrading:r((p,S,x)=>ze({manifest:p,packageValue:S,signal:x,executeSandboxVerifier:De(l.client),authorize:r(async()=>{let E=p.profileEvaluation;if(!E||E.profileId!==e.profileId||E.sourceRevision!==e.sourceRevision)throw new Error("The hosted private grading source changed.");if(E.externalDatasetBinding){if(!m)throw new Error("The frozen Dataset owner is unavailable.");await m.authorize({bindingHash:E.externalDatasetBinding.contentHash,manifestHash:p.contentHash})}let B=await d({ref:o,sourceRevision:e.sourceRevision,harnessRelease:E.harnessRelease});if(!E.externalDatasetBinding&&B.catalogHash!==E.catalogHash)throw new Error("The hosted private grading catalog changed.")},"authorize")}),"privateGrading")}),R={getProfileEvaluationRun:u.getProfileEvaluationRun.bind(u),getProfileEvaluationReceipt:u.getProfileEvaluationReceipt.bind(u),getProfileEvaluationGrade:u.getProfileEvaluationGrade.bind(u),getSession:l.core.getSession.bind(l.core),getTurn:l.core.getTurn.bind(l.core),runtimeEventsForTurn:l.core.runtimeEventsForTurn.bind(l.core),listModelUsageRecords:l.core.listModelUsageRecords.bind(l.core)};return{prepareProfileEvaluationRun:v,executeProfileEvaluationCase:y,executeProfileEvaluationRun:b,runPreparedProfileEvaluation:r(async p=>b(await v(p,{requireExpectedManifestHash:!0})),"runPreparedProfileEvaluation"),runProfileEvaluationSuite:yt({store:u,loadCatalog:d,selectedWorkflows:c,prepareRun:v,executeRun:b}),compareProfileEvaluationRuns:Je({store:u,selectedProfile:a}),buildProfileEvaluationReport:r(p=>Ze({store:u,profileRef:o,request:p}),"buildProfileEvaluationReport"),listProfileEvaluations:r(async p=>{if(p&&typeof p=="object"&&"runId"in p)return Qe({store:R,profileRef:o,...Ke.parse(p)});let[S,x,E,B]=await Promise.all([d({ref:o,sourceRevision:e.sourceRevision,harnessRelease:e.harnessRelease}),u.listProfileEvaluationRuns(o),u.listProfileEvaluationComparisons(o),u.listProfileEvaluationSuiteRuns(o)]);return{...S,runs:x,comparisons:E,suiteRuns:B}},"listProfileEvaluations")}}r(Et,"createHostedProfileEvaluationRuntime");import{mkdir as lr}from"node:fs/promises";import{randomUUID as Dt}from"node:crypto";import W from"node:path";import{randomUUID as bt}from"node:crypto";var Qt=n.object({revision:n.number().int().nonnegative(),payload:n.record(n.string(),n.unknown()).nullable()}).strict(),Jt=n.object({entries:n.array(n.unknown()).max(100),nextAfterId:n.string().min(1).nullable()}).strict(),oe=class{constructor(e){this.client=e}client;static{r(this,"HostedHarnessStateStorage")}async getPreference(e,t){return Qt.parse(await this.client.request({contractVersion:h,requestId:bt(),operation:"harness/state/read",params:{workspaceId:e,kind:t,afterId:null,limit:1}}))}async listCandidates(e){return(await this.readAll(e,"candidates")).map(t=>ke.parse(t))}async listCrossRunRequests(e){return(await this.readAll(e,"cross_run_requests")).map(t=>Ae.parse(t))}async readAll(e,t){let o=[],a=null;do{let c=Jt.parse(await this.client.request({contractVersion:h,requestId:bt(),operation:"harness/state/read",params:{workspaceId:e,kind:t,afterId:a,limit:Math.min(100,1001-o.length)}}));if(c.nextAfterId&&(c.entries.length===0||c.nextAfterId===a))throw new Error("Hosted Harness state cursor did not advance.");if(o.push(...c.entries),o.length>1e3)throw new Error("Hosted Harness state exceeds 1,000 entries.");a=c.nextAfterId}while(a);return o}};import{randomUUID as Zt}from"node:crypto";import{cp as Yt,mkdir as Xt,rm as er}from"node:fs/promises";import tr from"node:path";var we=n.object({schemaVersion:n.literal("openpond.harnessMemoryEntry.v1"),id:n.string(),workspaceId:n.string(),key:n.string(),content:n.string(),tags:n.array(n.string()),revision:n.number().int().positive(),status:n.enum(["active","deleted"]),sourceRunId:n.string().nullable(),sourceProposal:n.object({id:n.string(),contentHash:n.string()}).nullable(),createdAt:n.string().datetime(),updatedAt:n.string().datetime(),contentHash:n.string().regex(/^[a-f0-9]{64}$/)}).strict(),rr=n.object({createdAt:n.string().datetime(),id:n.string()}).strict(),Tt=n.object({entries:n.array(n.unknown()).max(100),nextBefore:rr.nullable()}).strict(),ve=n.object({workspace:de,receipt:Te}).strict(),ae=class{constructor(e,t){this.client=e;this.storeDir=t;this.usage=new Rt(e),this.overlay=new ee({request:r(async o=>o.operation==="harness/overlay/get"?this.request({action:"overlay_get",...o.params}):o.operation==="harness/overlay/freezeProposal"?this.request({action:"overlay_freeze",...o.params},o.requestId):e.request(o),"request")})}client;storeDir;static{r(this,"HostedHarnessReviewStorage")}harnessStoragePlacement="hosted";reviewSessionId=null;overlay;usage;request(e,t=Zt()){return this.client.request({contractVersion:h,requestId:t,operation:"harness/review/execute",params:e},e.action==="release_put"?6e4:15e3)}sessionId(){if(!this.reviewSessionId)throw new Error("Hosted review memory requires an admitted review session.");return this.reviewSessionId}async prepareReview(e){let t=await this.getSession(e.runRef);if(!t)throw new Error("Hosted review session is unavailable.");this.reviewSessionId=t.id;let o=await this.getHarnessRunOverlay(t.id);if(!o)throw new Error("Hosted review overlay is unavailable.");let a=await this.getHarnessWorkspace(o.workspace.workspaceId);if(!a?.currentChannel.release)throw new Error("Hosted review workspace release is unavailable.");let c=await this.getHarnessReleaseRecord(a.currentChannel.release.contentHash);if(!c||c.sourceRevision!==a.sourceRevision)throw new Error("Hosted review source binding changed.");let u=Oe(this.storeDir,a.id);await Xt(u.root,{recursive:!0,mode:448}),await er(u.source,{recursive:!0,force:!0}),await Yt(tr.join(c.bundlePath,"source"),u.source,{recursive:!0,force:!1,errorOnExist:!0});let s=await _e({workspaceId:a.id,sourceDir:u.source});if(s.sourceRevision!==a.sourceRevision||s.harnessRelease.contentHash!==c.harnessRelease.contentHash)throw new Error("Hosted review source cache differs from its immutable release.")}getHarnessWorkspace=r(async e=>de.nullable().parse(await this.request({action:"workspace_get",workspaceId:e})),"getHarnessWorkspace");getHarnessReleaseRecord=r(async e=>fe.nullable().parse(await this.request({action:"release_get",contentHash:e})),"getHarnessReleaseRecord");saveHarnessReleaseRecord=r(async e=>fe.parse(await this.request({action:"release_put",record:e},`review-release:${e.harnessRelease.contentHash}`)),"saveHarnessReleaseRecord");getHarnessRunOverlay=r(e=>this.overlay.getHarnessRunOverlay(e),"getHarnessRunOverlay");createHarnessRunOverlay=r(e=>this.overlay.createHarnessRunOverlay(e),"createHarnessRunOverlay");freezeHarnessRunOverlayWithProposalAtomically=r(e=>this.overlay.freezeHarnessRunOverlayWithProposalAtomically(e),"freezeHarnessRunOverlayWithProposalAtomically");getHarnessBackgroundReviewSettings=r(async e=>n.object({enabled:n.boolean(),updatedAt:n.string().datetime().nullable()}).strict().parse(await this.request({action:"background_get",workspaceId:e})),"getHarnessBackgroundReviewSettings");getHarnessMemory=r(async(e,t)=>we.nullable().parse(await this.request({action:"memory_get",workspaceId:e,sessionId:this.sessionId(),key:t})),"getHarnessMemory");listHarnessMemories=r(async(e,t={})=>{let o=n.object({entries:n.array(we).max(20),nextBefore:n.object({updatedAt:n.string().datetime(),key:n.string()}).nullable()}),a=[],c=null;do{let u=o.parse(await this.request({action:"memory_page",workspaceId:e,sessionId:this.sessionId(),before:c,limit:20,includeDeleted:t.includeDeleted??!1}));if(a.push(...u.entries),u.nextBefore&&(!u.entries.length||g(u.nextBefore)===g(c)))throw new Error("Hosted memory cursor did not advance.");c=u.nextBefore}while(c&&a.length<1e3);if(c)throw new Error("Hosted review memory exceeds its bounded window.");return a},"listHarnessMemories");writeHarnessMemory=r(async e=>we.parse(await this.request({action:"memory_write",sessionId:this.sessionId(),input:e},`review-memory:${g(e)}`)),"writeHarnessMemory");saveHarnessImprovementArtifact=r(async(e,t,o)=>{let a={action:"artifact_put",workspaceId:e,kind:t,artifact:o},c=(await import("./dist-W5MJYSPF.js")).HarnessReviewStorageParamsSchema.parse(a);return he[t].parse(await this.request(c,`review-artifact:${t}:${o.contentHash}`))},"saveHarnessImprovementArtifact");listHarnessImprovementArtifacts=r(async(e,t,o=100)=>{let a=[],c=null,u=Math.min(Math.max(1,Math.trunc(o)),1e3);do{let s=(await import("./dist-W5MJYSPF.js")).HarnessReviewStorageParamsSchema.parse({action:"artifact_page",workspaceId:e,kind:t,before:c,limit:Math.min(100,u-a.length)}),d=Tt.parse(await this.request(s));if(a.push(...d.entries),d.nextBefore&&(!d.entries.length||g(d.nextBefore)===g(c)))throw new Error("Hosted artifact cursor did not advance.");c=d.nextBefore}while(c&&a.length<u);return a.map(s=>he[t].parse(s))},"listHarnessImprovementArtifacts");listPendingHarnessRefinerTriggers=r(async()=>{let e=await import("./hosted-harness-runtime-BM4WONJN.js").then(a=>a.loadHostedHarnessRuntime(this.client));if(!e)return[];let t=[],o=null;do{let a=Tt.parse(await this.request({action:"pending_page",workspaceId:e.workspace.id,before:o,limit:100}));if(t.push(...a.entries.map(c=>({workspaceId:e.workspace.id,trigger:xe.parse(c)}))),a.nextBefore&&(!a.entries.length||g(a.nextBefore)===g(o)))throw new Error("Hosted pending-review cursor did not advance.");o=a.nextBefore}while(o&&t.length<1e3);if(o)throw new Error("Hosted pending reviews exceed the bounded recovery window.");return t},"listPendingHarnessRefinerTriggers");advanceHarnessWorkspaceAtomically=r(async e=>ve.parse(await this.client.request({contractVersion:h,requestId:e.receiptId,operation:"harness/workspace/transition",params:{action:"advance",...e}})),"advanceHarnessWorkspaceAtomically");advanceReviewedHarnessWorkspaceAtomically=r(async e=>ve.parse(await this.client.request({contractVersion:h,requestId:e.receiptId,operation:"harness/workspace/transition",params:{action:"reviewedAdvance",...e}})),"advanceReviewedHarnessWorkspaceAtomically");rollbackHarnessWorkspaceAtomically=r(async e=>ve.parse(await this.client.request({contractVersion:h,requestId:e.receiptId,operation:"harness/workspace/transition",params:{action:"rollback",...e}})),"rollbackHarnessWorkspaceAtomically");getSession=r(async e=>Ue.nullable().parse(await this.request({action:"session_get",sessionId:e})),"getSession");getTurn=r(async e=>U.nullable().parse(await this.request({action:"turn_get",turnId:e})),"getTurn");updateTurn=r(async(e,t)=>{let o=await this.getTurn(e);if(!o)return null;let a=U.parse(t(o)),{harnessSnapshot:c,...u}=o,{harnessSnapshot:s,...d}=a;if(!s||g(u)!==g(d))throw new Error("Hosted review may only restore a missing Harness snapshot.");return U.parse(await this.request({action:"snapshot_restore",turnId:e,expectedHash:g(o),snapshot:s}))},"updateTurn");turnsForSession=r(async(e,t=1e3)=>{let o=n.object({entries:n.array(U).max(100),nextBefore:n.number().int().positive().nullable()}),a=[],c=null,u=Math.min(Math.max(1,Math.trunc(t)),1e3);do{let s=o.parse(await this.request({action:"turn_page",sessionId:e,before:c,limit:Math.min(100,u-a.length)}));if(a.push(...s.entries),s.nextBefore&&(!s.entries.length||c!==null&&s.nextBefore>=c))throw new Error("Hosted review turn cursor did not advance.");c=s.nextBefore}while(c&&a.length<u);return a.reverse()},"turnsForSession");runtimeEventsForTurn=r(async(e,t={})=>{let o=n.object({entries:n.array(ge).max(100),nextAfterSequence:n.number().int().positive().nullable()}),a=[],c=0,u=Math.min(t.limit??1e4,1e4);do{let s=o.parse(await this.request({action:"event_page",turnId:e,afterSequence:c,names:[...t.names??[]],limit:Math.min(100,u-a.length)}));if(a.push(...s.entries),!s.nextAfterSequence)return a;if(!s.entries.length||s.nextAfterSequence<=c)throw new Error("Hosted review event cursor did not advance.");c=s.nextAfterSequence}while(a.length<u);return a},"runtimeEventsForTurn");listModelUsageRecords=r(e=>this.usage.listModelUsageRecords(e),"listModelUsageRecords");async appendRuntimeEvent(e){return ge.parse(await this.request({action:"event_append",event:e},`review-event:${e.id}`))}async upsertModelUsageRecord(e){await this.request({action:"usage_put",record:e},`review-usage:${g(e)}`)}};import{randomUUID as sr}from"node:crypto";async function xt(l,e){let t=Ie.parse(await l.request({contractVersion:h,requestId:sr(),operation:"refiner/execute",params:{action:{action:"active_release",workspaceId:e}}}));return M(t,"Hosted Refiner active release"),t}r(xt,"loadHostedRefinerRelease");import{randomUUID as or}from"node:crypto";var ar=n.object({personalizationSoul:n.string().max(8e3).optional(),userInstructions:n.string().max(64e3).optional(),preferences:ce.optional()}).strict(),nr=n.object({revision:n.number().int().positive(),settings:ar}).strict();async function ye(l){let e=await l.request({contractVersion:h,requestId:or(),operation:"settings/get",params:{}}),t=e===null?null:nr.parse(e);return{revision:t?.revision??null,personalizationSoul:t?.settings.personalizationSoul??be[0].content,userInstructions:t?.settings.userInstructions??"",preferences:t?.settings.preferences??ce.parse({})}}r(ye,"loadHostedRuntimeSettings");import{randomUUID as It}from"node:crypto";function kt(l){async function e(t){let o=await te(l,t);if(!o)throw new Error("No hosted Harness is selected for this run.");return o.workspace.id}return r(e,"workspaceId"),[{name:"memory_search",description:"Search bounded active memory for this selected Harness or Profile. Returns keys, revisions and short excerpts.",parameters:{type:"object",additionalProperties:!1,properties:{query:{type:"string",minLength:1,maxLength:500},limit:{type:"integer",minimum:1,maximum:20}},required:["query"]},execute:r(async t=>{let o=t.args.query;if(typeof o!="string"||!o.trim()||o.length>500)throw new Error("Memory query is invalid.");let a=t.args.limit===void 0?8:t.args.limit;if(typeof a!="number"||!Number.isInteger(a)||a<1||a>20)throw new Error("Memory search limit is invalid.");let c=await l.request({contractVersion:h,requestId:It(),operation:"harness/memory/search",params:{workspaceId:await e(t.session),query:o,limit:a}});return{toolCallId:t.callId,name:"memory_search",ok:!0,contentText:JSON.stringify(c),data:c}},"execute")},{name:"memory_inspect",description:"Read one exact active memory entry returned by memory_search.",parameters:{type:"object",additionalProperties:!1,properties:{key:{type:"string",minLength:1,maxLength:120}},required:["key"]},execute:r(async t=>{let o=t.args.key;if(typeof o!="string"||!/^[a-z0-9][a-z0-9-]{0,119}$/.test(o))throw new Error("Memory key is invalid.");let a=await l.request({contractVersion:h,requestId:It(),operation:"harness/memory/get",params:{workspaceId:await e(t.session),key:o}});if(!a||typeof a!="object"||Array.isArray(a)||a.status!=="active")throw new Error(`Harness memory does not exist: ${o}.`);return{toolCallId:t.callId,name:"memory_inspect",ok:!0,contentText:JSON.stringify(a),data:a}},"execute")}]}r(kt,"createHostedHarnessMemoryTools");import{randomUUID as At}from"node:crypto";function Ct(l){return[{name:"work_list_outputs",description:"List this conversation's published outputs from completed turns without starting sandbox compute. Use this before reading a previously saved file; returns exact file IDs and revisions. New workspace files are published after the current turn ends. Inspect those with workspace tools and finish the turn instead of polling this list.",parameters:{type:"object",additionalProperties:!1,properties:{}},execute:r(async e=>{let t=await l.request({contractVersion:h,requestId:At(),operation:"output/list",params:{}});return{toolCallId:e.callId,name:"work_list_outputs",ok:!0,contentText:JSON.stringify(t),data:t}},"execute")},{name:"work_read_output",description:"Read the actual saved text/Markdown or PDF text of a file returned by work_list_outputs, without starting sandbox compute. Prefer this for questions about saved outputs. Use workspace tools for edits, execution and unsaved files. PDF text extraction does not inspect images or page appearance.",parameters:{type:"object",additionalProperties:!1,properties:{fileId:{type:"string",minLength:1,maxLength:191},revision:{type:"integer",minimum:1},offset:{type:"integer",minimum:0,maximum:1e7},maxChars:{type:"integer",minimum:1,maximum:1e5},firstPage:{type:"integer",minimum:1,maximum:1e3},pageCount:{type:"integer",minimum:1,maximum:10}},required:["fileId","revision"]},execute:r(async e=>{let t=await l.request(z.parse({contractVersion:h,requestId:At(),operation:"output/read",params:e.args}),6e4);return{toolCallId:e.callId,name:"work_read_output",ok:!0,contentText:JSON.stringify(t),data:t}},"execute")}]}r(Ct,"createHostedWorkOutputTools");import{randomUUID as Ot}from"node:crypto";function _t(l,e){return{allowedTools:e,authorizeTool:r(async t=>{let o=await l.request({contractVersion:h,requestId:Ot(),operation:"embedding/authorize",params:{sessionId:t.session.id,turnId:t.turnId,name:t.name}});if(!o||typeof o!="object"||Array.isArray(o)||o.allowed!==!0)throw new Error("Hosted tool authorization denied.")},"authorizeTool")}}r(_t,"createHostedEmbeddingAdapter");function qt(l){return async e=>{let t=qe.parse(e);return l.request({contractVersion:h,requestId:Ot(),operation:"sandbox/request",params:{action:t}},e.type==="create"?3e5:e.type==="exec"?18e4:6e4)}}r(qt,"createHostedSandboxRequest");var ir=["sandbox/request","embedding/authorize","output/begin","output/chunk","output/complete","output/saveSandboxFile","output/list","output/read","settings/get","harness/get","harness/overlay/get","harness/overlay/put","harness/memory/get","harness/memory/list","harness/memory/search","harness/memory/write","harness/state/read","task-inbox/execute","create-improve/execute","approval/get","approval/upsert","usage/getByRequestId","usage/upsert","usage/page","session/count","session/get","session/page","session/put","turn/count","turn/wakeCount","turn/get","turn/put","turn/latest","turn/page","thread/turnPage","event/append","events/page","events/latestAssistantText"];function Bt(l){if(ir.some(e=>!l.operations.includes(e)))throw new Error("Hosted Postgres runtime capabilities are incomplete.");if(l.maxRequestBytes<256e3||l.maxInFlight<32||l.maxPageSize<200)throw new Error("Hosted Postgres runtime transport limits are incompatible.")}r(Bt,"assertHostedWorkCapabilities");var w=r(async()=>{throw new Error("This hosted control is not available until its Postgres repository is activated.")},"unavailable"),ur=We(),cr=Ve();async function _o(l){let e=l.runtimeStorage,t=l.hostStorageClient;if(e.kind!=="hosted_postgres"||!t||e.client!==t)throw new Error("Hosted storage selection mismatch.");if(l.embedding||l.sandboxRequest)throw new Error("Hosted Postgres tool and sandbox authority must come from the host transport.");if(!l.streamOpenPondHostedChatTurn)throw new Error("Hosted Postgres runtime requires a host-admitted model stream.");if(l.profileSource||l.harness)throw new Error("Hosted Postgres runtime accepts only host-admitted immutable sources.");if(l.services&&Object.values(l.services).some(i=>i!==!1&&i!==void 0))throw new Error("Hosted service adapters must be admitted by the Postgres composition.");let o=Be.parse(await t.request({contractVersion:h,requestId:Dt(),operation:"capabilities",params:{}}));Bt(o);let a=_t(t,o.allowedTools),c=qt(t),u=W.resolve(l.storeDir??process.cwd()),s=W.resolve(l.workspaceDir??process.cwd());await lr(s,{recursive:!0});let d=st({channel:"app-server",logDir:W.join(u,"logs"),metadata:{version:l.version??Xe,runtimeVersion:Ye(),placement:"hosted_work"}}),m=e.core,f=new ae(t,u),y=e.admittedProfileRelease?await gt(t,e.admittedProfileRelease):{profile:cr,profileLibrary:ur},{appendRuntimeEvent:v,closeEventSubscribers:b,subscribeRuntimeEvents:R}=ut({logger:d,assistantDeltaFlushMs:250,store:{appendRuntimeEvent:r(i=>["harness.refiner.queued","harness.refiner.started","harness.refiner.completed","harness.refiner.failed"].includes(i.name)?f.appendRuntimeEvent(i):m.appendRuntimeEvent(i),"appendRuntimeEvent"),runtimeEventPageRows:r(i=>m.runtimeEventPageRows(i),"runtimeEventPageRows")}}),p=X({queueId:"turn-follow-up",logger:d}),S=X({queueId:"subagent",logger:d}),x=nt(l.streamOpenPondHostedChatTurn,{enabled:at()}),E=X({queueId:"harness-refiner",logger:d,concurrency:1}),B=St({store:f,storeDir:u,queue:E,streamOpenPondHostedChatTurn:x,appendRuntimeEvent:v,upsertModelUsageRecord:r(i=>f.upsertModelUsageRecord(i),"upsertModelUsageRecord"),prepareReview:r(i=>f.prepareReview(i),"prepareReview"),loadActiveRefinerRelease:r(async()=>{let i=await O(t);if(!i)throw new Error("Hosted review has no admitted Harness workspace.");return xt(t,i.workspace.id)},"loadActiveRefinerRelease")}),Re=r(async()=>(await ye(t)).preferences,"preferences"),{createSession:ne,getSession:D,updateSession:ie,completeTurn:Mt,failTurn:zt,interruptTurn:jt}=dt({store:m,defaultSessionCwd:r(()=>s,"defaultSessionCwd"),appendRuntimeEvent:v,loadAppPreferences:Re,loadLastUsedProfile:r(async()=>y.profileLibrary.lastUsed,"loadLastUsedProfile")}),le=lt({workspaceDir:s,logger:d,getSession:D,updateSession:ie,appendRuntimeEvent:v,sandboxRequest:c,sandboxCreationMode:"hosted_worker"}),V=ot({appendRuntimeEvent:v,findLocalProject:r(async()=>null,"findLocalProject"),onRepositoryInstructionDiagnostic:r((i,P)=>d.warn("repository instruction file skipped",{diagnostic:i,sessionId:P.id}),"onRepositoryInstructionDiagnostic")}),Nt=new ee(t),L=new oe(t),Se=Ht(t),ue=Pt(t),G=e.admittedProfileRelease?.hostExecution?await O(t,e.admittedProfileRelease.harnessRelease):null;if(e.admittedProfileRelease?.hostExecution&&(!G||!o.operations.includes("output/readBytes")||!o.operations.includes("profile-evaluations/sandbox")||!o.operations.includes("profile-evaluations/grade")))throw new Error("Hosted evaluation requires its admitted release, managed artifact owner and private sandbox grader.");let Ft=tt({deviceId:"hosted-evaluation",storeDir:u,runtimeEventsForSession:r(i=>m.runtimeEventsForSession(i),"runtimeEventsForSession"),managedPersistence:{...Se.persistence,sourceTurnStartedAt:r(async(i,P)=>{let H=await m.getTurn(P);if(!H||H.sessionId!==i||!H.startedAt)throw new Error("The managed output has no actual started case turn.");return H.startedAt},"sourceTurnStartedAt")}}),k=G?ft({readOutput:ue.readOutput,executeCommand:ue.execute,settleRemote:ue.settle,runtimeNode:"node",runtimeAgentRoot:"/workspace/runtime",storeDir:u,release:G.release,getSession:D,getTurn:r(i=>m.getTurn(i),"getTurn"),saveOutput:Ft.saveOwnedOutputBytes,recordOutput:r(async(i,P,H)=>{await v({id:Dt(),timestamp:new Date().toISOString(),name:"workspace_action_result",source:"server",sessionId:i,turnId:P,action:"work_output_save",status:"completed",data:H})},"recordOutput"),authorize:r(async()=>{let i=await O(t,e.admittedProfileRelease.harnessRelease);if(!i||i.release.harnessRelease.contentHash!==G.release.harnessRelease.contentHash)throw new Error("The hosted isolated evaluation source authority changed.")},"authorize")}):null,Ut=mt(a,async(i,P)=>{let H=await m.getTurn(i);if(!H)throw new Error("Embedded turn is unavailable.");let C=await D(H.sessionId),$=C.metadata?.embeddingToolBindings,N=[...P].sort((K,Wt)=>K.name.localeCompare(Wt.name));if($!==void 0&&g($)!==g(N))throw new Error("Embedded tool bindings changed; start a new thread.");await ie(C.id,{metadata:{...C.metadata,embeddingToolBindings:N}}),await m.updateTurn(i,K=>({...K,metadata:{...K.metadata,toolBindings:N}}))}),T=ct({executionHost:"embedded",workInputsForSession:l.workInputsForSession,attachmentRootDir:W.join(u,"attachments"),isolatedProfileEvaluationForTurn:k?async i=>{if(i.metadata?.profileEvaluationRun===void 0)return!1;if(!k.ownsSession(i.id))throw new Error("The hosted evaluation has no actual isolated case owner.");return!0}:void 0,executeProfileEvaluationAction:k?.executeAction,resolveModelTools:r(i=>k?.ownsSession(i.session.id)?k.resolveTools(i):Ut(i),"resolveModelTools"),hostedToolFlags:{toolMode:"native",nativeToolTransport:!0,nativeToolProviderDenylist:[],textToolFallback:!1},store:m,inboxStore:e.inbox,createSession:ne,getSession:D,updateSession:ie,completeTurn:Mt,failTurn:zt,interruptTurn:jt,upsertApproval:r(i=>m.upsertApproval(i),"upsertApproval"),defaultSessionCwd:r(()=>s,"defaultSessionCwd"),findOpenPondApp:r(async i=>({id:i||Fe(s),name:W.basename(s)||"Workspace",description:null,visibility:"private",sandbox:!0}),"findOpenPondApp"),resolveSessionWorkspaceCwd:r(async i=>i.cwd?.trim()||s,"resolveSessionWorkspaceCwd"),ensureCodexRuntime:r(async()=>{throw new Error("Codex process hosting is unavailable.")},"ensureCodexRuntime"),appendWorkspaceDiffEvent:le.appendWorkspaceDiffEvent,workspaceDiffBaseline:le.workspaceDiffBaseline,appendRuntimeEvent:v,executeWorkspaceTool:le.executeWorkspaceTool,executeOpenPondCommand:r(async()=>{throw new Error("Hosted commands require durable authorization.")},"executeOpenPondCommand"),loadOpenPondProfileState:r(async()=>y.profile,"loadOpenPondProfileState"),loadOpenPondProfileLibrary:r(async()=>y.profileLibrary,"loadOpenPondProfileLibrary"),readOpenPondProfileSkill:w,loadSelectedHarnessRuntime:r(i=>{if(i.currentProfile&&(!e.admittedProfileRelease||i.currentProfile.repositoryId!==e.admittedProfileRelease.repositoryId||i.currentProfile.profileId!==e.admittedProfileRelease.profileId))throw new Error("Hosted Profile session lacks admitted immutable source.");return te(t,i)},"loadSelectedHarnessRuntime"),ensureHarnessRunOverlay:r(i=>Nt.ensureHarnessRunOverlay(i),"ensureHarnessRunOverlay"),processHarnessImprovementBoundary:B,harnessModelTools:[...kt(t),...Ct(t)],loadBuiltInOpenPondSkills:r(async()=>[],"loadBuiltInOpenPondSkills"),readBuiltInOpenPondSkill:w,loadPersonalizationSoul:r(async()=>(await ye(t)).personalizationSoul,"loadPersonalizationSoul"),loadAppPreferences:Re,maybeCreateScaffoldForTurn:V.maybeCreateScaffoldForTurn,hostedSystemPrompt:V.hostedSystemPrompt,appendAssistantText:V.appendAssistantText,appendHostedContextUsage:V.appendHostedContextUsage,streamOpenPondHostedChatTurn:x,turnFollowUpQueue:p,subagentQueue:S,maxHostedWorkspaceToolRounds:et(l.maxHostedWorkspaceToolRounds),maxRepeatedInvalidToolRequests:3});await T.recoverPendingSubagentCompletions(),await T.recoverTaskInbox();let Pe=!1,He=r(async(i,P)=>{if(Z.parse(P).attachments?.length&&!k?.ownsSession(i))throw new Error("Hosted attachments require managed-file admission.");let H=await D(i);if(H.currentProfile&&(!e.admittedProfileRelease||H.currentProfile.repositoryId!==e.admittedProfileRelease.repositoryId||H.currentProfile.profileId!==e.admittedProfileRelease.profileId))throw new Error("Hosted Profile session lacks admitted immutable source.");return Pe||(await B.reconcilePending(),await E.drain(),Pe=!0),T.sendTurn(i,P)},"sendTurn");if(l.profileExternalDataset&&!e.admittedProfileRelease?.hostExecution)throw new Error("External Dataset requires its admitted hosted evaluation.");let A=e.admittedProfileRelease?.hostExecution?await Et({client:t,core:m,release:e.admittedProfileRelease,storeDir:u,...l.profileExternalDataset?{externalDataset:l.profileExternalDataset}:{},readManagedArtifact:Se.read,admitSession:k.admitSession,settleSession:k.settleSession,createSession:ne,sendTurn:He,interruptSessionTurn:T.interruptSessionTurn}):null,Ee=!1;return{...rt({ports:it({bindHome:!1,placement:"hosted_work",connectedAppProviders:[],featureOverrides:{profileWorkflows:!!e.admittedProfileRelease,profileEvaluations:!!A,harnessProposalReview:!1,harnessEvaluationReview:!1,harnessEvaluationReviewAcceptance:!1,harnessEvaluationTasksetMaterialization:!1,harnessEvaluationBaseline:!1,harnessBackgroundReview:!1,harnessDiff:!1,harnessRollback:!1,harnessReview:!1,refinerProfiles:!1,immutableRefinerAdmission:!1},createSession:ne,getSession:D,turnsForSession:r(i=>m.turnsForSession(i,1e3),"turnsForSession"),runtimeEventsForSession:r(i=>m.runtimeEventsForSession(i,{excludeReasoningDeltas:!0}),"runtimeEventsForSession"),sendTurn:He,steerSessionTurn:T.steerSessionTurn,readTaskInbox:T.readTaskInbox,queueTaskInput:T.queueTaskInput,updateTaskInput:T.updateTaskInput,isSessionTurnActive:T.isSessionTurnActive,waitForSessionTurnSettlement:T.waitForSessionTurnSettlement,interruptSessionTurn:T.interruptSessionTurn,resolveApproval:r(async(i,P)=>{let H=await T.resolveCreateImproveApproval(i,P);if(H)return H;let C=await T.resolveSubagentPatchApplyApproval(i,P);if(C)return C;throw new Error(`Approval not found: ${i}`)},"resolveApproval"),listProfileWorkflows:e.admittedProfileRelease?()=>re(t,e.admittedProfileRelease):w,listProfileEvaluations:A?.listProfileEvaluations??w,loadProfileTrainingSource:w,prepareProfileEvaluationRun:A?.prepareProfileEvaluationRun??w,runPreparedProfileEvaluation:A?.runPreparedProfileEvaluation??w,runProfileEvaluationSuite:A?.runProfileEvaluationSuite??w,executeProfileEvaluationCase:A?.executeProfileEvaluationCase??w,executeProfileEvaluationRun:A?.executeProfileEvaluationRun??w,compareProfileEvaluationRuns:A?.compareProfileEvaluationRuns??w,buildProfileEvaluationReport:A?.buildProfileEvaluationReport??w,inspectHarness:r(async()=>{let i=await O(t);if(!i)return null;let P=i.workspace.id,[H,C,$,N]=await Promise.all([L.getPreference(P,"workspace_settings"),L.getPreference(P,"evaluation_review_settings"),L.listCandidates(P),L.listCrossRunRequests(P)]);return{workspace:i.workspace,release:i.release,backgroundReview:H,evaluationReview:C,refinementCandidates:$,crossRunRequests:N}},"inspectHarness"),reviewHarnessProposal:w,reviewHarness:w,acceptHarnessEvaluationReview:w,materializeHarnessEvaluationTaskset:w,runHarnessEvaluationBaseline:w,validateHarness:r(async()=>{let i=await O(t);return i?{valid:!0,workspaceId:i.workspace.id,harnessRelease:i.release.harnessRelease,agentSnapshot:i.release.agentSnapshot}:{valid:!1,reason:"No admitted hosted Harness release."}},"validateHarness"),updateHarnessBackgroundReview:w,diffHarness:w,rollbackHarness:w,inspectRefiner:w,updateRefiner:w,activateRefiner:w,rollbackRefiner:w,subscribeRuntimeEvents:R,observeRuntimeOperation:r(i=>d.info("agent runtime operation",i),"observeRuntimeOperation")}),close:r(async()=>{Ee||(Ee=!0,k?.close(),await T.close(),await Promise.all([p.drain(),S.drain(),E.drain()]),await b(),await d.flush())},"close")}),storePath:"hosted-postgres",workspaceDir:s,composition:["runtime_event_bus","session_store","hosted_provider","workspace_tools","command_approvals","harness","agent_runtime","jsonl_transport"]}}r(_o,"createHostedOwnedAppServer");export{_o as createHostedOwnedAppServer};
|