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,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as pt}from"./chunk-SYUKES6H.js";import{a as A,b as L}from"./chunk-KVTBX2UP.js";import{a as dt}from"./chunk-IZ6DLEVY.js";import{b as re,m as mt,s as ft,t as oe,y as gt,z as se}from"./chunk-XW6HGSIT.js";import{d as ut,g as Te}from"./chunk-
|
|
2
|
+
import{a as pt}from"./chunk-SYUKES6H.js";import{a as A,b as L}from"./chunk-KVTBX2UP.js";import{a as dt}from"./chunk-IZ6DLEVY.js";import{b as re,m as mt,s as ft,t as oe,y as gt,z as se}from"./chunk-XW6HGSIT.js";import{d as ut,g as Te}from"./chunk-57TRXBLT.js";import{O as ct,r as at,z as Ie}from"./chunk-2RNQQNB7.js";import{e as st}from"./chunk-OQPJ7FJF.js";import{K as it}from"./chunk-EUMXMT3S.js";import{J as ne,L as lt}from"./chunk-TKLBP3MM.js";import{I as _e}from"./chunk-Z4Z5UOZM.js";import{a as i,c as Re,e as Pn}from"./chunk-FTQLQJQV.js";var kt=Re((is,yt)=>{"use strict";var Cn=["||","&&",";;","|&","<(","<<<",">>",">&","<&","&",";","(",")","|","<",">"],ht=/[\n\r\u2028\u2029]/,En=/[\s#!"$&'():;<=>@\\^`|]/g;yt.exports=i(function(t){return t.map(function(n){if(n==="")return"''";if(n&&typeof n=="object"){if("op"in n&&n.op==="glob"){if(typeof n.pattern!="string")throw new TypeError("glob token requires a string `pattern`");if(ht.test(n.pattern))throw new TypeError("glob `pattern` must not contain line terminators");return n.pattern.replace(En,"\\$&")}if("op"in n&&typeof n.op=="string"){if(Cn.indexOf(n.op)<0)throw new TypeError("invalid `op` value: "+JSON.stringify(n.op));return n.op.replace(/[\s\S]/g,"\\$&")}if("comment"in n&&typeof n.comment=="string"){if(ht.test(n.comment))throw new TypeError("`comment` must not contain line terminators");return"#"+n.comment}throw new TypeError("unrecognized object token shape")}return/["\s\\]/.test(n)&&!/'/.test(n)?"'"+n.replace(/(['])/g,"\\$1")+"'":/["'\s]/.test(n)?'"'+n.replace(/(["\\$`!])/g,"\\$1")+'"':String(n).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g,"$1\\$2")}).join(" ")},"quote")});var Tt=Re((cs,It)=>{"use strict";var _t="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",wt=new RegExp("^"+_t+"$"),bt="|&;()<> \\t",Mn="'([^']*?)'",Wn='"((\\\\"|[^"])*?)"',On=/^#$/,xt="'",Rt='"',ie="$",D="",qn=4294967296;for(ve=0;ve<4;ve++)D+=(qn*Math.random()).toString(16);var ve,jn=new RegExp("^"+D);function Bn(e,t){for(var n=t.lastIndex,r=[],o;o=t.exec(e);)r[r.length]=o,t.lastIndex===o.index&&(t.lastIndex+=1);return t.lastIndex=n,r}i(Bn,"matchAll");function $n(e,t,n){var r=typeof e=="function"?e(n):e[n];return typeof r>"u"&&n!=""?r="":typeof r>"u"&&(r="$"),typeof r=="object"?t+D+JSON.stringify(r)+D:t+r}i($n,"getVar");function Nn(e,t,n){n||(n={});var r=n.escape||"\\",o=n.splitUnquoted===!0?`
|
|
3
3
|
`:typeof n.splitUnquoted=="string"?n.splitUnquoted:"",s="(\\"+r+`['"`+bt+`]|[^\\s'"`+bt+"])+",a=new RegExp(["("+_t+")","("+s+"|"+Wn+"|"+Mn+")+"].join("|"),"g"),d=Bn(e,a);if(d.length===0)return[];t||(t={});var c=!1;return d.map(function(l){var u=l[0];if(!u||c)return;if(wt.test(u))return{op:u};var p=!1,f=!1,m="",h=[],W=!1,x=null,ye=!1,b;function tt(){b+=1;var I,V,be=u.charAt(b);if(be==="{"){if(b+=1,u.charAt(b)==="}")throw new Error("Bad substitution: "+u.slice(b-2,b+1));var te=1;for(I=b;te>0&&I<u.length;)u.charAt(I)==="{"&&u.charAt(I-1)==="$"?te+=1:u.charAt(I)==="}"&&(te-=1),I+=1;if(te!==0)throw new Error("Bad substitution: "+u.slice(b));I-=1,V=u.slice(b,I),b=I}else if(/[*@#?$!_-]/.test(be))V=be,b+=1;else{var xe=u.slice(b);I=xe.match(/[^\w\d_]/),I?(V=xe.slice(0,I.index),b+=I.index-1):(V=xe,b=u.length)}return $n(t,"",V)}i(tt,"parseEnvVar");function nt(){if(x!==null){if(x===0)m!==""&&(h[h.length]=m,m="");else{h[h.length]=m,m="";for(var I=1;I<x;I+=1)h[h.length]=""}x=null}}for(i(nt,"flushRun"),b=0;b<u.length;b++){var k=u.charAt(b);if(o&&k!==ie&&nt(),ye=ye||!p&&(k==="*"||k==="?"),f)m+=k,f=!1;else if(p)k===p?p=!1:p==xt?m+=k:k===r?(b+=1,k=u.charAt(b),k===Rt||k===r||k===ie?m+=k:m+=r+k):k===ie?m+=tt():m+=k;else if(k===Rt||k===xt)p=k,W=!0;else{if(wt.test(k))return{op:u};if(On.test(k)){c=!0;var rt={comment:e.slice(l.index+b+1)};return m.length?[m,rt]:[rt]}else if(k===r)f=!0;else if(k===ie){var ke=tt();if(!o)m+=ke;else for(var we=0;we<ke.length;we+=1){var O=ke.charAt(we);o.indexOf(O)<0?(nt(),m+=O):x===null?x=O===" "||O===" "||O===`
|
|
4
4
|
`?0:1:O!==" "&&O!==" "&&O!==`
|
|
5
5
|
`&&(x+=1)}}else m+=k}}if(ye)return{op:"glob",pattern:m};if(o){if(x!==null&&x>0){h[h.length]=m,m="";for(var ot=1;ot<x;ot+=1)h[h.length]=""}return(m!==""||W&&h.length===0)&&(h[h.length]=m),h}return m}).reduce(function(l,u){return typeof u>"u"||[].concat(u).forEach(function(p){l[l.length]=p}),l},[])}i(Nn,"parseInternal");It.exports=i(function(t,n,r){var o=Nn(t,n,r);return typeof n!="function"?o:o.reduce(function(s,a){if(typeof a=="object")return s[s.length]=a,s;var d=a.split(RegExp("("+D+".*?"+D+")","g"));return d.length===1?(s[s.length]=d[0],s):(d.filter(Boolean).forEach(function(c){s[s.length]=jn.test(c)?JSON.parse(c.split(D)[1]):c}),s)},[])},"parse")});var vt=Re(Se=>{"use strict";Se.quote=kt();Se.parse=Tt()});var Mt=Pn(vt(),1);import{spawn as Ln}from"node:child_process";import{randomUUID as Dn}from"node:crypto";import le from"node:path";var Fn=120,Un=3600,de=6e4,St=2e4,zn="Select a project to use this.";function bs(e){let{upsertApproval:t,appendRuntimeEvent:n}=e,r=new Map,o=new Set;async function s(c){let l=c.command.trim();if(!l)return ce(l,null,"Command is empty.",Pt(c.timeoutSeconds));let u=Pt(c.timeoutSeconds),p=A({session:c.session}),f=Xn({requestedCwd:c.cwd,session:c.session}),m=!!(c.cwd?.trim()&&le.isAbsolute(c.cwd.trim()));if(p.target==="sandbox"||!f||p.target!=="local"&&!m)return ce(l,f,zn,u);let h=c.session.openPondCommandAccessMode??_e;if(h==="disabled")return ce(l,f,"Command access is disabled for this chat.",u);let W=Hn(l);if(h==="ask"&&!o.has(At(c.session.id,W))){let x=await d({command:l,cwd:f,family:W,input:c,timeoutSeconds:u});if(x==="acceptForSession"&&o.add(At(c.session.id,W)),x!=="accept"&&x!=="acceptForSession")return ce(l,f,x==="cancel"?"Command was cancelled.":"Command was not approved.",u)}return Yn({command:l,cwd:f,timeoutSeconds:u,signal:c.signal})}i(s,"executeCommand");async function a(c,l){let u=r.get(c);if(!u)return null;let p=it.parse(l);r.delete(c);let f=Qn(p.decision),m={...u.approval,status:f};return await t(m),await n(Te({sessionId:m.sessionId,turnId:m.turnId??void 0,name:"approval.resolved",source:"server",action:"command",status:f==="accepted"||f==="accepted_for_session"?"completed":"failed",output:m.title,data:{approvalId:c,status:f,decision:p.decision,family:u.family}})),u.resolve(p.decision),m}i(a,"resolveApproval");async function d(c){let l={id:`approval_${Dn()}`,sessionId:c.input.session.id,turnId:c.input.turnId??null,providerRequestId:c.input.providerRequestId??c.input.turnId??c.input.session.id,kind:"command",title:c.command,detail:JSON.stringify({command:c.command,cwd:c.cwd,timeoutSeconds:c.timeoutSeconds,source:c.input.source,mode:c.input.session.openPondCommandAccessMode??_e,risk:Vn(c.command),sessionApprovalFamily:{key:c.family.key,label:c.family.label,broad:c.family.broad,reason:c.family.reason}},null,2),status:"pending",createdAt:ut()},u,p=new Promise(f=>{u=f});r.set(l.id,{approval:l,family:c.family,resolve:u});try{await t(l),await n(Te({sessionId:c.input.session.id,turnId:c.input.turnId??void 0,name:"approval.requested",source:"server",action:"command",appId:c.input.session.appId,status:"pending",output:l.title,data:l}))}catch(f){throw r.delete(l.id),f}return p}return i(d,"requestCommandApproval"),{executeCommand:s,resolveApproval:a}}i(bs,"createOpenPondCommandAccessService");function Wt(e){return JSON.stringify({ok:e.ok,action:"exec_command",output:Zn(e),data:{command:e.command,cwd:e.cwd,exitCode:e.exitCode,stdout:Et(e.stdout),stderr:Et(e.stderr),timedOut:e.timedOut,timeoutSeconds:e.timeoutSeconds,truncated:e.truncated,blockedReason:e.blockedReason}},null,2)}i(Wt,"commandResultForModel");function Hn(e){let t=Jn(e);if(!t)return ae(e,"Could not safely parse shell command.");let n=Kn(t);if(n===-1)return ae(e,"Could not find command executable.");if(Gn(t))return ae(e,"Shell operators require exact-command session approval.");let r=t[n],o=t[n+1]??null;return r==="pwd"?X("pwd","pwd","Allowlisted read-only command."):r==="ls"?X("ls","ls","Allowlisted directory listing command."):r==="git"&&o==="status"?X("git status","git status","Allowlisted git status family."):r==="docker"&&o==="system"?X("docker system","docker system","Allowlisted Docker system inspection family."):r==="bun"&&o==="run"?X("bun run","bun run","Allowlisted Bun script execution family."):ae(e,"Command is not in the broad session-approval allowlist.")}i(Hn,"classifyCommandFamily");function Jn(e){try{let t=(0,Mt.parse)(e),n=[];for(let r of t){if(typeof r=="string"){n.push(r);continue}if(!r||typeof r!="object")return null;let o=r.op;if(typeof o=="string"){n.push(o);continue}return null}return n}catch{return null}}i(Jn,"safeShellTokens");function Kn(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(!/^[A-Za-z_][A-Za-z0-9_]*=.*/.test(n))return t}return-1}i(Kn,"firstCommandTokenIndex");function Gn(e){return e.some(t=>/^(?:\||&&|\|\||;|&|<|>|\(|\)|\{|\})$/.test(t))}i(Gn,"hasUnsafeShellSyntax");function X(e,t,n){return{key:e,label:t,broad:!0,reason:n}}i(X,"broadFamily");function ae(e,t){return{key:`exact:${e}`,label:e,broad:!1,reason:t}}i(ae,"exactCommandFamily");function At(e,t){return`${e}:${t.key}`}i(At,"sessionFamilyKey");function Vn(e){let t=e.toLowerCase();return/\b(?:sudo|rm\s+-rf|mkfs|dd\s+if=|docker\s+(?:volume\s+rm|system\s+prune|container\s+rm)|kill(?:all)?)\b/.test(t)?"danger":/\b(?:npm|pnpm|yarn|bun)\s+(?:install|add|remove)|\bgit\s+(?:commit|push|reset|checkout|merge|rebase)|[>|]|\b(?:mv|cp|rm|touch|mkdir|docker\s+(?:run|build|compose))\b/.test(t)?"write":"read"}i(Vn,"commandRiskLabel");function Xn(e){let t=e.requestedCwd?.trim();return t?le.isAbsolute(t)?le.resolve(t):e.session.cwd?le.resolve(e.session.cwd,t):null:e.session.cwd?.trim()||null}i(Xn,"resolveCommandCwd");function Pt(e){return Number.isFinite(e??NaN)?Math.max(1,Math.min(Math.floor(e),Un)):Fn}i(Pt,"normalizedTimeout");function ce(e,t,n,r){return{ok:!1,command:e,cwd:t,exitCode:null,stdout:"",stderr:n,timedOut:!1,timeoutSeconds:r,truncated:!1,blockedReason:n}}i(ce,"blockedCommandResult");function Yn(e){return new Promise(t=>{let n=!1,r=!1,o="",s="",a=!1,d=null,c=pt(e.command),l=Ln(c.command,{cwd:e.cwd,shell:c.shell,env:{...process.env,PATH:dt()},stdio:["ignore","pipe","pipe"],detached:process.platform!=="win32"}),u=i(h=>{n||(n=!0,clearTimeout(m),d&&clearTimeout(d),e.signal?.removeEventListener("abort",f),t(h))},"finish"),p=i((h,W)=>{let x=W.toString("utf8");h==="stdout"?o=Ae(o,x):s=Ae(s,x),o.length+s.length>=de&&(a=!0)},"appendOutput"),f=i(()=>{Pe(l,"SIGTERM"),u({ok:!1,command:e.command,cwd:e.cwd,exitCode:null,stdout:o,stderr:s||"Command was interrupted.",timedOut:!1,timeoutSeconds:e.timeoutSeconds,truncated:a,blockedReason:"Command was interrupted."}),Ct(l)},"abort"),m=setTimeout(()=>{r=!0,Pe(l,"SIGTERM"),d=Ct(l)},e.timeoutSeconds*1e3);e.signal?.addEventListener("abort",f,{once:!0}),l.stdout?.on("data",h=>p("stdout",h)),l.stderr?.on("data",h=>p("stderr",h)),l.on("error",h=>{u({ok:!1,command:e.command,cwd:e.cwd,exitCode:null,stdout:o,stderr:h.message,timedOut:r,timeoutSeconds:e.timeoutSeconds,truncated:a,blockedReason:null})}),l.on("close",h=>{u({ok:!r&&(h??1)===0,command:e.command,cwd:e.cwd,exitCode:r?null:h??1,stdout:o,stderr:r?Ae(s,`
|
|
@@ -7,7 +7,7 @@ Command timed out after ${e.timeoutSeconds}s.`):s,timedOut:r,timeoutSeconds:e.ti
|
|
|
7
7
|
[command output truncated]`}i(Ae,"appendLimited");function Et(e){return e.length<=St?e:`${e.slice(0,St)}
|
|
8
8
|
[command output truncated for model]`}i(Et,"trimForModel");function Zn(e){if(e.blockedReason)return e.blockedReason;if(e.timedOut)return`Command timed out after ${e.timeoutSeconds}s.`;let t=e.exitCode??1;return t===0?"Command completed successfully.":`Command exited with code ${t}.`}i(Zn,"commandResultSummary");function Qn(e){return e==="accept"?"accepted":e==="acceptForSession"?"accepted_for_session":e==="cancel"?"cancelled":"declined"}i(Qn,"approvalStatusForDecision");import{createHash as ho}from"node:crypto";function Ce(e){return`tool-output:${encodeURIComponent(e)}`}i(Ce,"toolOutputResourceRef");function Ee(e){let t=Math.max(512,Math.floor(e.maxChars??8e3));if(e.output.length<=t)return{output:e.output,spill:null};let n=Math.ceil(t/2),r=Math.max(1,t-n),o=Ce(e.callId),s=n+r;return{output:[e.output.slice(0,n),`[tool output spilled: ${e.output.length-s} characters omitted; read ${o} with offsetBytes to page the durable output]`,e.output.slice(-r)].join(`
|
|
9
9
|
|
|
10
|
-
`),spill:{resourceRef:o,originalChars:e.output.length,returnedChars:s,omittedChars:e.output.length-s}}}i(Ee,"toolOutputSpillForModel");function _s(e){let t=Ee({output:e.output,callId:e.resourceRef.replace(/^tool-output:/,""),maxChars:e.maxChars??4e3});return t.spill?t.output.replace(t.spill.resourceRef,e.resourceRef):e.output}i(_s,"toolOutputPreviewForCompaction");var Ot=2e4,er=new Set(["remoteUrl","repoPath","workspacePath","expectedRemoteUrl"]),qt={resource_read:[{key:"ref",type:"nonEmptyString",description:"resource ref such as workspace:file:package.json"}],resource_search:[{key:"scope",type:"nonEmptyString",description:"resource scope such as workspace"},{key:"query",type:"nonEmptyString",description:"search text or path fragment"}],read_files:[{key:"paths",type:"stringArray",description:"one or more workspace-relative file paths"}],search_files:[{key:"query",type:"nonEmptyString",description:"search text or regex"}],preview_write_file:[{key:"path",type:"nonEmptyString",description:"workspace-relative file path"},{key:"content",type:"string",description:"complete file contents"}],write_file:[{key:"path",type:"nonEmptyString",description:"workspace-relative file path"},{key:"content",type:"string",description:"complete file contents"}],preview_write_files:[{key:"files",type:"stringRecord",description:"object mapping workspace-relative paths to complete file contents"}],write_files:[{key:"files",type:"stringRecord",description:"object mapping workspace-relative paths to complete file contents"}],preview_edit_file:[{key:"path",type:"nonEmptyString",description:"workspace-relative file path"},{key:"oldText",type:"nonEmptyString",description:"exact text currently in the file"},{key:"newText",type:"string",description:"replacement text; use an empty string only for deletion"}],edit_file:[{key:"path",type:"nonEmptyString",description:"workspace-relative file path"},{key:"oldText",type:"nonEmptyString",description:"exact text currently in the file"},{key:"newText",type:"string",description:"replacement text; use an empty string only for deletion"}],preview_delete_file:[{key:"path",type:"nonEmptyString",description:"workspace-relative file path"}],delete_file:[{key:"path",type:"nonEmptyString",description:"workspace-relative file path"}],git_commit:[{key:"message",type:"nonEmptyString",description:"commit message"}],sandbox_read_file:[{key:"path",type:"nonEmptyString",description:"sandbox file path"}],sandbox_search_files:[{key:"query",type:"nonEmptyString",description:"search text or regex"}],sandbox_write_file:[{key:"path",type:"nonEmptyString",description:"sandbox file path"},{key:"content",type:"string",description:"complete file contents"}],sandbox_edit_file:[{key:"path",type:"nonEmptyString",description:"sandbox file path"},{key:"oldText",type:"nonEmptyString",description:"exact text currently in the sandbox file"},{key:"newText",type:"string",description:"replacement text; use an empty string only for deletion"}],sandbox_delete_file:[{key:"path",type:"nonEmptyString",description:"sandbox file path"}],sandbox_mkdir:[{key:"path",type:"nonEmptyString",description:"sandbox directory path"}],sandbox_move_file:[{key:"fromPath",type:"nonEmptyString",description:"sandbox source path"},{key:"toPath",type:"nonEmptyString",description:"sandbox target path"}],sandbox_exec:[{key:"command",type:"nonEmptyString",description:"bounded shell command to run in the sandbox"}],sandbox_git_branch:[{key:"branch",type:"nonEmptyString",description:"sandbox git branch name"}],sandbox_git_commit:[{key:"message",type:"nonEmptyString",description:"sandbox git commit message"}],sandbox_run_action:[{key:"actionName",type:"nonEmptyString",description:"YAML action name from the project or agent registry"}],sandbox_snapshot_create:[{key:"name",type:"nonEmptyString",description:"snapshot name"}],sandbox_snapshot_update:[{key:"snapshotId",type:"nonEmptyString",description:"snapshot id"}],sandbox_snapshot_validate:[{key:"snapshotId",type:"nonEmptyString",description:"snapshot id"}],sandbox_snapshot_publish:[{key:"snapshotId",type:"nonEmptyString",description:"snapshot id"}],sandbox_replay_start:[{key:"snapshotId",type:"nonEmptyString",description:"published replayable snapshot id"}],sandbox_replay_get:[{key:"replayId",type:"nonEmptyString",description:"sandbox replay run id"}],sandbox_replay_logs:[{key:"replayId",type:"nonEmptyString",description:"sandbox replay run id"}],sandbox_replay_artifacts:[{key:"replayId",type:"nonEmptyString",description:"sandbox replay run id"}],sandbox_replay_cancel:[{key:"replayId",type:"nonEmptyString",description:"sandbox replay run id"}]},tr=["Workspace tools are available through a strict text protocol.","When you need to inspect or change the app workspace, respond with exactly one fenced block labelled openpond_tool and no other prose.",'The block must contain JSON: {"action":"read_files","args":{"paths":["package.json"]}}.',"Available actions: create_sandbox_template_scaffold, resource_search, resource_read, workspace_status, list_files, read_files, search_files, preview_write_files, preview_write_file, preview_edit_file, preview_delete_file, write_files, write_file, edit_file, delete_file, validate_sandbox_template, build_sandbox_template, run_sandbox_template, git_init, git_status, git_diff, git_fetch, git_commit, git_push, publish_openpond_repo, sandbox_create, sandbox_templates, sandbox_template_launch, sandbox_status, sandbox_list_files, sandbox_read_file, sandbox_search_files, sandbox_upload_file, sandbox_write_file, sandbox_edit_file, sandbox_delete_file, sandbox_mkdir, sandbox_move_file, sandbox_exec, sandbox_git_status, sandbox_git_diff, sandbox_git_export_patch, sandbox_git_apply_patch_local, sandbox_git_branch, sandbox_git_commit, sandbox_git_pull, sandbox_git_push, sandbox_preserve_source, sandbox_promote_source, sandbox_run_action, sandbox_open_port, sandbox_snapshot_catalog, sandbox_snapshot_create, sandbox_snapshot_update, sandbox_snapshot_validate, sandbox_snapshot_publish, sandbox_replays, sandbox_replay_start, sandbox_replay_get, sandbox_replay_logs, sandbox_replay_artifacts, sandbox_replay_cancel, sandbox_logs, sandbox_receipts, sandbox_stop.","Required args: resource_search {scope, query}; resource_read {ref}; read_files {paths}; search_files {query}; write_file/preview_write_file {path, content}; write_files/preview_write_files {files}; edit_file/preview_edit_file {path, oldText, newText}; delete_file/preview_delete_file {path}; git_commit {message}; run_sandbox_template {optional mode/target/params/uploads/sandboxId}; sandbox_create {optional repo/teamId/projectId/agentId/command/visibility/resources/budget/quotas/metadata/runtime/workflowMode/runtimeProfileId/runtimeBaseBranch/runtimePromotionPolicy/attachToSession}; sandbox_templates {optional teamId/projectId/q/name/version/tag/useCase}; sandbox_template_launch {snapshotId or templateName or useCase, optional teamId/projectId/version/visibility/resources/budget/quotas/metadata/attachToSession}; sandbox_read_file {path, optional sandboxId}; sandbox_search_files {query, optional sandboxId}; sandbox_upload_file {path, contentsBase64, optional sandboxId}; sandbox_write_file {path, content, optional sandboxId}; sandbox_edit_file {path, oldText, newText, optional sandboxId}; sandbox_delete_file {path, optional recursive/sandboxId}; sandbox_mkdir {path, optional recursive/sandboxId}; sandbox_move_file {fromPath, toPath, optional overwrite/sandboxId}; sandbox_exec {command, optional sandboxId}; sandbox_git_export_patch {optional baseRef/sandboxId}; sandbox_git_apply_patch_local {optional baseRef/sandboxId/localProjectId}; sandbox_git_branch {branch, optional create/startPoint/sandboxId}; sandbox_git_commit {message, optional all/paths/sandboxId}; sandbox_preserve_source {optional message/runtimeId/sandboxId}; sandbox_promote_source {optional expectedTargetSha/runtimeId/sandboxId}; sandbox_run_action {actionName, optional sandboxId/projectId/agentId/input}; sandbox_open_port {port, optional sandboxId}; sandbox_snapshot_create {name, optional sandboxId/template/replay}; sandbox_snapshot_update/validate/publish {snapshotId, optional sandboxId}; sandbox_replay_start {snapshotId, optional teamId/projectId/entrypoint/params/budget/artifactPaths}; sandbox_replay_get/logs/artifacts/cancel {replayId}.",'Prefer resource_search with scope workspace to find candidate files, then resource_read on returned refs to inspect stable, metadata-rich resources with explicit truncation. Use targeted path or identifier queries with limit 5-10; avoid repeated broad one-word searches unless the word is an exact component/function/file identifier. Workspace resource_search defaults to exact literal path/text search; pass filters.mode="path" for file/path lookup and filters.mode="ranked" for broad multi-term retrieval. Use read_files only when you already know exact paths and need raw file contents.',"For edit_file and sandbox_edit_file, oldText must exactly match existing file text. For targeted edits, include enough surrounding context for oldText to match exactly once; multi-match edits fail unless args.replaceAll is true. If you are not certain, call read_files or sandbox_read_file first.","Use write_files for multi-file edits so validation/build runs once after the batch.","Local write, edit, and delete actions return a pre-write diff preview plus validation/build results. Sandbox file actions return sandbox API read/write/delete results.","If a tool result has ok:false, inspect its output/data and repair the specific issue before trying to commit, push, or deploy.","Use sandbox_create to create or resume a sandbox runtime-backed remote sandbox from chat. When projectId or agentId is provided, sandbox_create reuses that project's or agent's default sandbox runtime unless args.runtime.runtimeId selects a specific runtime. Use sandbox_templates to find published project templates, and sandbox_template_launch to start from a published template. Use sandbox_edit_file for exact text edits after reading the sandbox file. Use sandbox_git_export_patch to export a portable patch without mutating local files, sandbox_git_apply_patch_local only after explicit user confirmation to apply the sandbox patch to the linked local checkout, sandbox_preserve_source to commit active changes back to the runtime source ref, and sandbox_promote_source only when the user asks to apply the preserved source ref to the Project branch. Use sandbox_run_action to execute a named action from openpond.yaml; when projectId or agentId is provided and args.sandboxId is omitted, sandbox_run_action starts a detached sandbox for that project or agent and then runs the action. By default, sandbox_create or sandbox_template_launch binds the chat session to that sandbox workspace; set args.attachToSession false for one-off tool-style execution that should leave the current chat scope unchanged.","Use sandbox_snapshot_create, sandbox_snapshot_validate, and sandbox_snapshot_publish when the user asks to preserve a sandbox as a replayable or launchable template. Use sandbox_replay_start and replay read/log/artifact tools for durable runs that should survive sandbox cleanup.","When the active workspace is a sandbox, use only sandbox_* actions for workspace inspection, file changes, commands, previews, logs, receipts, and stopping compute.","When you finish after workspace actions, answer in a concise Codex-style markdown format: brief outcome first, then Changed Files when files changed, then Verification when checks ran.","Do not use emojis in responses, generated prompts, templates, profile text, comments, or sample output unless the user explicitly asks for them.","Do not mention raw tool JSON, internal repo paths, or origin/remote URLs unless the user explicitly asks for those details or they are necessary to explain a git/deploy failure.","After a tool result is returned, either request the next tool the same way or answer the user normally."].join(`
|
|
10
|
+
`),spill:{resourceRef:o,originalChars:e.output.length,returnedChars:s,omittedChars:e.output.length-s}}}i(Ee,"toolOutputSpillForModel");function _s(e){let t=Ee({output:e.output,callId:e.resourceRef.replace(/^tool-output:/,""),maxChars:e.maxChars??4e3});return t.spill?t.output.replace(t.spill.resourceRef,e.resourceRef):e.output}i(_s,"toolOutputPreviewForCompaction");var Ot=2e4,er=new Set(["remoteUrl","repoPath","workspacePath","expectedRemoteUrl"]),qt={resource_read:[{key:"ref",type:"nonEmptyString",description:"resource ref such as workspace:file:package.json"}],resource_search:[{key:"scope",type:"nonEmptyString",description:"resource scope such as workspace"},{key:"query",type:"nonEmptyString",description:"search text or path fragment"}],read_files:[{key:"paths",type:"stringArray",description:"one or more workspace-relative file paths"}],search_files:[{key:"query",type:"nonEmptyString",description:"search text or regex"}],preview_write_file:[{key:"path",type:"nonEmptyString",description:"workspace-relative file path"},{key:"content",type:"string",description:"complete file contents"}],write_file:[{key:"path",type:"nonEmptyString",description:"workspace-relative file path"},{key:"content",type:"string",description:"complete file contents"}],preview_write_files:[{key:"files",type:"stringRecord",description:"object mapping workspace-relative paths to complete file contents"}],write_files:[{key:"files",type:"stringRecord",description:"object mapping workspace-relative paths to complete file contents"}],preview_edit_file:[{key:"path",type:"nonEmptyString",description:"workspace-relative file path"},{key:"oldText",type:"nonEmptyString",description:"exact text currently in the file"},{key:"newText",type:"string",description:"replacement text; use an empty string only for deletion"}],edit_file:[{key:"path",type:"nonEmptyString",description:"workspace-relative file path"},{key:"oldText",type:"nonEmptyString",description:"exact text currently in the file"},{key:"newText",type:"string",description:"replacement text; use an empty string only for deletion"}],preview_delete_file:[{key:"path",type:"nonEmptyString",description:"workspace-relative file path"}],delete_file:[{key:"path",type:"nonEmptyString",description:"workspace-relative file path"}],git_commit:[{key:"message",type:"nonEmptyString",description:"commit message"}],sandbox_read_file:[{key:"path",type:"nonEmptyString",description:"sandbox file path"}],sandbox_search_files:[{key:"query",type:"nonEmptyString",description:"search text or regex"}],sandbox_write_file:[{key:"path",type:"nonEmptyString",description:"sandbox file path"},{key:"content",type:"string",description:"complete file contents"}],sandbox_edit_file:[{key:"path",type:"nonEmptyString",description:"sandbox file path"},{key:"oldText",type:"nonEmptyString",description:"exact text currently in the sandbox file"},{key:"newText",type:"string",description:"replacement text; use an empty string only for deletion"}],sandbox_delete_file:[{key:"path",type:"nonEmptyString",description:"sandbox file path"}],sandbox_mkdir:[{key:"path",type:"nonEmptyString",description:"sandbox directory path"}],sandbox_move_file:[{key:"fromPath",type:"nonEmptyString",description:"sandbox source path"},{key:"toPath",type:"nonEmptyString",description:"sandbox target path"}],sandbox_exec:[{key:"command",type:"nonEmptyString",description:"bounded shell command to run in the sandbox"}],sandbox_git_branch:[{key:"branch",type:"nonEmptyString",description:"sandbox git branch name"}],sandbox_git_commit:[{key:"message",type:"nonEmptyString",description:"sandbox git commit message"}],sandbox_run_action:[{key:"actionName",type:"nonEmptyString",description:"YAML action name from the project or agent registry"}],sandbox_snapshot_create:[{key:"name",type:"nonEmptyString",description:"snapshot name"}],sandbox_snapshot_update:[{key:"snapshotId",type:"nonEmptyString",description:"snapshot id"}],sandbox_snapshot_validate:[{key:"snapshotId",type:"nonEmptyString",description:"snapshot id"}],sandbox_snapshot_publish:[{key:"snapshotId",type:"nonEmptyString",description:"snapshot id"}],sandbox_replay_start:[{key:"snapshotId",type:"nonEmptyString",description:"published replayable snapshot id"}],sandbox_replay_get:[{key:"replayId",type:"nonEmptyString",description:"sandbox replay run id"}],sandbox_replay_logs:[{key:"replayId",type:"nonEmptyString",description:"sandbox replay run id"}],sandbox_replay_artifacts:[{key:"replayId",type:"nonEmptyString",description:"sandbox replay run id"}],sandbox_replay_cancel:[{key:"replayId",type:"nonEmptyString",description:"sandbox replay run id"}]},tr=["Workspace tools are available through a strict text protocol.","When you need to inspect or change the app workspace, respond with exactly one fenced block labelled openpond_tool and no other prose.",'The block must contain JSON: {"action":"read_files","args":{"paths":["package.json"]}}.',"Available actions: create_sandbox_template_scaffold, resource_search, resource_read, workspace_status, list_files, read_files, search_files, preview_write_files, preview_write_file, preview_edit_file, preview_delete_file, write_files, write_file, edit_file, delete_file, validate_sandbox_template, build_sandbox_template, run_sandbox_template, git_init, git_status, git_diff, git_fetch, git_commit, git_push, publish_openpond_repo, sandbox_create, sandbox_templates, sandbox_template_launch, sandbox_status, sandbox_list_files, sandbox_read_file, sandbox_search_files, sandbox_upload_file, sandbox_write_file, sandbox_edit_file, sandbox_delete_file, sandbox_mkdir, sandbox_move_file, sandbox_exec, sandbox_git_status, sandbox_git_diff, sandbox_git_export_patch, sandbox_git_apply_patch_local, sandbox_git_branch, sandbox_git_commit, sandbox_git_pull, sandbox_git_push, sandbox_preserve_source, sandbox_promote_source, sandbox_run_action, sandbox_open_port, sandbox_snapshot_catalog, sandbox_snapshot_create, sandbox_snapshot_update, sandbox_snapshot_validate, sandbox_snapshot_publish, sandbox_replays, sandbox_replay_start, sandbox_replay_get, sandbox_replay_logs, sandbox_replay_artifacts, sandbox_replay_cancel, sandbox_logs, sandbox_receipts, sandbox_stop.","Required args: resource_search {scope, query}; resource_read {ref}; read_files {paths}; search_files {query}; write_file/preview_write_file {path, content}; write_files/preview_write_files {files}; edit_file/preview_edit_file {path, oldText, newText}; delete_file/preview_delete_file {path}; git_commit {message}; run_sandbox_template {optional mode/target/params/uploads/sandboxId}; sandbox_create {optional repo/teamId/projectId/agentId/command/visibility/resources/budget/quotas/metadata/runtime/workflowMode/runtimeProfileId/runtimeBaseBranch/runtimePromotionPolicy/attachToSession}; sandbox_templates {optional teamId/projectId/q/name/version/tag/useCase}; sandbox_template_launch {snapshotId or templateName or useCase, optional teamId/projectId/version/visibility/resources/budget/quotas/metadata/attachToSession}; sandbox_read_file {path, optional sandboxId}; sandbox_search_files {query, optional sandboxId}; sandbox_upload_file {path, contentsBase64, optional sandboxId}; sandbox_write_file {path, content, optional sandboxId}; sandbox_edit_file {path, oldText, newText, optional sandboxId}; sandbox_delete_file {path, optional recursive/sandboxId}; sandbox_mkdir {path, optional recursive/sandboxId}; sandbox_move_file {fromPath, toPath, optional overwrite/sandboxId}; sandbox_exec {command, optional sandboxId}; sandbox_git_export_patch {optional baseRef/sandboxId}; sandbox_git_apply_patch_local {optional baseRef/sandboxId/localProjectId}; sandbox_git_branch {branch, optional create/startPoint/sandboxId}; sandbox_git_commit {message, optional all/paths/sandboxId}; sandbox_preserve_source {optional message/runtimeId/sandboxId}; sandbox_promote_source {optional expectedTargetSha/runtimeId/sandboxId}; sandbox_run_action {actionName, optional sandboxId/projectId/agentId/input}; sandbox_open_port {port, optional sandboxId}; sandbox_snapshot_create {name, optional sandboxId/template/replay}; sandbox_snapshot_update/validate/publish {snapshotId, optional sandboxId}; sandbox_replay_start {snapshotId, optional teamId/projectId/entrypoint/params/budget/artifactPaths}; sandbox_replay_get/logs/artifacts/cancel {replayId}.",'Prefer resource_search with scope workspace to find candidate files, then resource_read on returned refs to inspect stable, metadata-rich resources with explicit truncation. Use targeted path or identifier queries with limit 5-10; avoid repeated broad one-word searches unless the word is an exact component/function/file identifier. Workspace resource_search defaults to exact literal path/text search; pass filters.mode="path" for file/path lookup and filters.mode="ranked" for broad multi-term retrieval. Use read_files only when you already know exact paths and need raw file contents.',"For edit_file and sandbox_edit_file, oldText must exactly match existing file text. For targeted edits, include enough surrounding context for oldText to match exactly once; multi-match edits fail unless args.replaceAll is true. If you are not certain, call read_files or sandbox_read_file first.","Use write_files for multi-file edits so validation/build runs once after the batch.","Local write, edit, and delete actions return a pre-write diff preview plus validation/build results. Sandbox file actions return sandbox API read/write/delete results.","If a tool result has ok:false, inspect its output/data and repair the specific issue before trying to commit, push, or deploy.","Use sandbox_create to create or resume a sandbox runtime-backed remote sandbox from chat. When projectId or agentId is provided, sandbox_create reuses that project's or agent's default sandbox runtime unless args.runtime.runtimeId selects a specific runtime. Use sandbox_templates to find published project templates, and sandbox_template_launch to start from a published template. Use sandbox_edit_file for exact text edits after reading the sandbox file. Use sandbox_git_export_patch to export a portable patch without mutating local files, sandbox_git_apply_patch_local only after explicit user confirmation to apply the sandbox patch to the linked local checkout, sandbox_preserve_source to commit active changes back to the runtime source ref, and sandbox_promote_source only when the user asks to apply the preserved source ref to the Project branch. Use sandbox_run_action to execute a named action from openpond.yaml; when projectId or agentId is provided and args.sandboxId is omitted, sandbox_run_action starts a detached sandbox for that project or agent and then runs the action. By default, sandbox_create or sandbox_template_launch binds the chat session to that sandbox workspace; set args.attachToSession false for one-off tool-style execution that should leave the current chat scope unchanged.","Use sandbox_snapshot_create, sandbox_snapshot_validate, and sandbox_snapshot_publish when the user asks to preserve a sandbox as a replayable or launchable template. Use sandbox_replay_start and replay read/log/artifact tools for durable runs that should survive sandbox cleanup.","When the active workspace is a sandbox, use only sandbox_* actions for workspace inspection, file changes, commands, previews, logs, receipts, and stopping compute.","Do not use emojis in responses, generated prompts, templates, profile text, comments, or sample output unless the user explicitly asks for them.","Do not mention raw tool JSON, internal repo paths, or origin/remote URLs unless the user explicitly asks for those details or they are necessary to explain a git/deploy failure.","After a tool result is returned, either request the next tool the same way or answer the user normally."].join(`
|
|
11
11
|
`),nr=["Workspace resource tools are available through a narrow text fallback protocol.","Prefer native function tools when they are available. Use this fallback only if native tool calling fails or is unavailable in the current model turn.","When you need to inspect the app workspace through the fallback, respond with exactly one fenced block labelled openpond_tool and no other prose.",'The block must contain JSON such as {"action":"resource_search","args":{"scope":"workspace","query":"package.json"}}.',"Available fallback actions: resource_search, resource_read.","Required args: resource_search {scope, query}; resource_read {ref}.",'Use resource_search first to find stable refs, then resource_read on returned refs. Use targeted path or identifier queries with limit 5-10; avoid repeated broad one-word searches unless the word is an exact component/function/file identifier. Workspace resource_search defaults to exact literal path/text search; pass filters.mode="path" for file/path lookup and filters.mode="ranked" for broad multi-term retrieval. Do not use broad legacy actions such as list_files, read_files, search_files, sandbox_read_file, or sandbox_search_files in this fallback mode.',"After a resource result is returned, either request another resource_search/resource_read fallback call or answer the user normally."].join(`
|
|
12
12
|
`);function As(e){return e==="none"?null:e==="resource_text_fallback"?nr:tr}i(As,"hostedToolProtocolForInstructionMode");function rr(e){return e.length<=Ot?e:`${e.slice(0,Ot)}
|
|
13
13
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{b as f}from"./chunk-
|
|
2
|
+
import{b as f}from"./chunk-4GPXTISD.js";import{I as c}from"./chunk-VGRMAGOK.js";import{h as g,j as w,k as I}from"./chunk-2RNQQNB7.js";import{b as m}from"./chunk-DIO5CB6U.js";import{f as R}from"./chunk-ACYFMLWG.js";import{b as r}from"./chunk-ES2ISFJC.js";import{a as d}from"./chunk-FTQLQJQV.js";import n from"node:path";import{readFile as y}from"node:fs/promises";var A=r.object({profileId:r.string().min(1),sourceRevision:r.string().min(1),repositoryId:r.string().min(1),harnessRelease:r.object({id:r.string().min(1),contentHash:r.string().regex(/^[a-f0-9]{64}$/)}).strict(),hostExecution:r.object({conversationId:r.string().min(1),turnId:r.string().min(1)}).strict().optional(),workspaceId:r.string().min(1),assetsPath:r.string().min(1).refine(n.isAbsolute)}).strict();async function _(p,e){let t=A.parse(e),s=await f(p,t.harnessRelease);if(!s||n.resolve(s.release.bundlePath)!==n.resolve(t.assetsPath))throw new Error("Hosted Profile release changed after admission.");let o=s.release.harnessRelease.metadata.profile;if(!o||typeof o!="object"||o.id!==t.profileId||o.sourceRevision!==t.sourceRevision||o.repositoryId!==void 0&&o.repositoryId!==t.repositoryId)throw new Error("Hosted Profile provenance differs from admitted release.");return{profile:I(),profileLibrary:w()}}d(_,"loadHostedProfileStateAndLibrary");async function B(p,e){let t=A.parse(e),s=await f(p,t.harnessRelease);if(!s||n.resolve(s.release.bundlePath)!==n.resolve(t.assetsPath))throw new Error("Hosted Profile workflow release is unavailable.");let o=s.release.harnessRelease.metadata.profile;if(o?.id!==t.profileId||o.sourceRevision!==t.sourceRevision||o.repositoryId!==void 0&&o.repositoryId!==t.repositoryId)throw new Error("Hosted Profile workflow provenance changed.");let a=t.harnessRelease,l={source:"openpond_git",repositoryId:t.repositoryId,profileId:t.profileId};if(!s.release.harnessRelease.files.some(u=>u.path==="workflows/catalog.json"))return{profileRef:l,sourceRevision:t.sourceRevision,harnessRelease:a,workflows:[]};let i=n.join(s.release.bundlePath,"source","workflows"),v=R({agentSnapshot:s.release.agentSnapshot,harnessRelease:s.release.harnessRelease,catalogBytes:await y(n.join(i,"catalog.json")),actionBytes:await y(n.join(i,"actions.json"))});return{profileRef:l,sourceRevision:t.sourceRevision,harnessRelease:a,workflows:v.catalog.workflows.map(u=>({workflow:u,binding:{schemaVersion:"openpond.profileWorkflowBinding.v1",profileId:t.profileId,sourceRevision:t.sourceRevision,harnessRelease:a,catalogHash:v.catalogHash,workflowId:u.id}}))}}d(B,"listHostedProfileWorkflows");import{createHash as U,randomUUID as h}from"node:crypto";var b=r.object({approval:g,revision:r.number().int().positive()}).strict(),P=r.object({record:m}).strict(),x=r.object({startedAt:r.string().min(1),requestOrdinal:r.number().int().nonnegative(),id:r.string().min(1)}).strict(),k=r.object({records:r.array(m).max(200),nextBefore:x.nullable()}).strict(),H=1e4,S=class{constructor(e){this.client=e}client;static{d(this,"HostedApprovalStorage")}async readApproval(e){let t=await this.client.request({contractVersion:c,requestId:h(),operation:"approval/get",params:{approvalId:e}});return t===null?null:b.parse(t)}async getApproval(e){return(await this.readApproval(e))?.approval??null}async putApproval(e){let t=g.parse(e.approval);if(!e.requestId.trim())throw new Error("Approval mutation requires a stable request ID.");return b.parse(await this.client.request({contractVersion:c,requestId:e.requestId,operation:"approval/upsert",params:{approval:t,expectedRevision:e.expectedRevision}}))}},M=class{constructor(e){this.client=e}client;static{d(this,"HostedModelUsageStorage")}async upsertModelUsageRecord(e){let t=m.parse(e),s=U("sha256").update(JSON.stringify(t)).digest("hex"),o=await this.client.request({contractVersion:c,requestId:`usage:${s}`,operation:"usage/upsert",params:{record:t}}),a=P.parse(o).record;if(a.requestId!==t.requestId)throw new Error("Host usage upsert changed request identity.");return a}async getModelUsageRecordByRequestId(e){let t=await this.client.request({contractVersion:c,requestId:h(),operation:"usage/getByRequestId",params:{requestId:e}});return t===null?null:P.parse(t).record}async listModelUsageRecords(e={}){let t=e.limit===void 0||e.limit>=H,s=e.limit===void 0?H:Math.max(1,Math.min(1e4,Math.trunc(e.limit))),o={...e.sessionId?{sessionId:e.sessionId}:{},...e.turnId?{turnId:e.turnId}:{},...e.provider?{provider:e.provider}:{},...e.model?{model:e.model}:{},...e.startedAtFrom?{startedAtFrom:e.startedAtFrom}:{},...e.startedAtTo?{startedAtTo:e.startedAtTo}:{},...e.visibility&&e.visibility!=="all"?{visibility:e.visibility}:{},...e.status&&e.status!=="all"?{status:e.status}:{}},a=[],l=null;for(;a.length<s+(t?1:0);){let i=k.parse(await this.client.request({contractVersion:c,requestId:h(),operation:"usage/page",params:{query:o,before:l,limit:Math.min(200,s+(t?1:0)-a.length)}}));if(a.push(...i.records),a.length>s)throw new Error(`Hosted usage query exceeds ${s} rows; narrow its filters or use a streamed aggregation.`);if(i.nextBefore===null)break;if(i.records.length===0||JSON.stringify(i.nextBefore)===JSON.stringify(l))throw new Error("Host usage cursor did not advance.");l=i.nextBefore}return a}async listModelUsageRecordsComplete(e={}){return this.listModelUsageRecords(e)}};export{A as a,_ as b,B as c,S as d,M as e};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as v}from"./chunk-KVTBX2UP.js";import{d as c}from"./chunk-
|
|
2
|
+
import{a as v}from"./chunk-KVTBX2UP.js";import{d as c}from"./chunk-57TRXBLT.js";import{h as m,j as d}from"./chunk-Q4TBTRIG.js";import{a as n}from"./chunk-FTQLQJQV.js";function k(e){return e.state==="planning"&&!e.plan}n(k,"shouldRunCreateImprovePlanner");function y(e){return e==="approved"?"accepted":e==="rejected"?"declined":e==="cancelled"?"cancelled":"pending"}n(y,"approvalStatusForPlan");function g(e){let t=e.run.plan;return{id:t?.approvalId??`approval_${e.run.id}`,sessionId:e.session.id,turnId:e.turn.id,providerRequestId:e.run.id,kind:"create_plan",title:`${e.run.operation==="improve"?"Approve improvement plan":"Approve creation plan"}: ${e.run.objective}`,detail:JSON.stringify({runId:e.run.id,revision:e.run.revision,planId:t?.id??null,target:e.run.target,objective:e.run.objective,summary:t?.summary??null,sourcePlan:t?.sourcePlan??[],requirements:t?.requirements??[],checks:t?.checks??[],workflowCaptureId:e.run.workflowCapture?.id??null},null,2),status:e.status,createdAt:e.existing?.createdAt??e.run.createdAt}}n(g,"createImprovePlanApproval");function h(e,t){if(e.id!==t.runId)throw new Error("Create/Improve action targets another run.");if(e.appliedActionIds.includes(t.actionId))return e;let a=c();if(t.type==="approve_plan"){if(e.state!=="awaiting_plan_approval"||!e.plan)throw new Error("Create/Improve plan is not ready for approval.");return d(e,{state:e.target.kind==="model"?"evaluating":"applying_source",plan:{...e.plan,status:"approved",approvedAt:e.plan.approvedAt??a,updatedAt:a},blockedReason:null,updatedAt:a},t.actionId)}if(t.type==="cancel"){if(!e.executionPolicy.cancellationAllowed)throw new Error("This Create/Improve run cannot be cancelled.");let r=t.reason?.trim()||"Cancelled before completion.";return d(e,{state:"cancelled",plan:e.plan?{...e.plan,status:"cancelled",approvedAt:null,metadata:{...e.plan.metadata,cancellationReason:r},updatedAt:a}:null,blockedReason:r,metadata:{...e.metadata,cancellationReason:r},updatedAt:a},t.actionId)}if(t.type==="revise_plan"){if(e.state!=="awaiting_plan_approval"||!e.plan)throw new Error("Create/Improve plan is not ready for revision.");let r=e.plan;return d(e,{state:"awaiting_plan_approval",plan:{...r,id:`create_improve_plan_${crypto.randomUUID()}`,status:"pending_approval",summary:`${r.summary}
|
|
3
3
|
|
|
4
4
|
Revision requested: ${t.revision}`,sourcePlan:r.sourcePlan.map(o=>({...o,reason:`${o.reason} Revision requested: ${t.revision}`})),approvedAt:null,editedFromPlanId:r.id,metadata:{...r.metadata,revision:t.revision,supersedesPlanId:r.id},createdAt:a,updatedAt:a},metadata:{...e.metadata,previousPlanId:r.id},updatedAt:a},t.actionId)}if(t.type==="answer_question"){if(e.state!=="awaiting_questions")throw new Error("Create/Improve run is not waiting for questions.");let r=e.questions.find(p=>p.id===t.questionId);if(!r||r.status!=="pending")throw new Error("Create/Improve question is no longer pending.");let o=r.options.find(p=>p.value===t.value),i=e.questions.map(p=>p.id===t.questionId?{...p,status:"answered",answer:{value:t.value,label:o?.label??null,detail:null,answeredAt:a,metadata:{}}}:p),s=i.some(p=>p.required&&p.status==="pending");return d(e,{state:s?"awaiting_questions":"planning",questions:i,plan:null,blockedReason:null,updatedAt:a},t.actionId)}if(t.type==="open_pull_request"||t.type==="apply_candidate"){let r=t.type==="apply_candidate"&&e.state==="blocked"&&!!e.localProfileCommit;if(e.state!=="awaiting_promotion"&&!r)throw new Error("Create/Improve candidate is not awaiting promotion.");let o=u(e,t.candidateId);if(o.status!=="evaluated"||!o.git?.headCommit)throw new Error("Create/Improve candidate must be committed and evaluated before it can be applied.");if(e.tasksetRef&&(o.tasksetRef?.id!==e.tasksetRef.id||o.tasksetRef.revision!==e.tasksetRef.revision||o.tasksetRef.contentHash!==e.tasksetRef.contentHash))throw new Error("Create/Improve candidate is not linked to the exact approved Taskset revision.");let i=e.evaluationReceipts.filter(s=>s.candidateId===o.id&&s.subject==="candidate");if(i.length===0||i.some(s=>s.status!=="passed"||s.publishGate==="failed"))throw new Error("Create/Improve candidate requires passing Eval receipts before it can be applied.");if(e.tasksetRef&&i.some(s=>s.tasksetId!==e.tasksetRef.id||s.tasksetHash!==e.tasksetRef.contentHash||s.metadata.trustedTasksetExecution!==!0||typeof s.metadata.executionContractHash!="string"))throw new Error("Create/Improve candidate requires a trusted receipt for the exact approved Taskset revision.");return d(e,{state:t.type==="apply_candidate"?"reconciling_release":"opening_pull_request",releaseOutcome:{...e.releaseOutcome,status:"pending",updatedAt:a},blockedReason:null,metadata:{...e.metadata,releaseAction:{type:t.type,candidateId:o.id,requestedAt:a}},updatedAt:a},t.actionId)}if(t.type==="reconcile_pull_request"){if(!["pull_request_open","blocked"].includes(e.state))throw new Error("Create/Improve run has no open PR to reconcile.");let r=u(e,t.candidateId);if(!r.git?.pullRequest)throw new Error("Create/Improve candidate has no PR to reconcile.");if(e.state==="blocked"&&r.git.pullRequest.state!=="merged")throw new Error("Only a merged PR with failed verification can be reconciled from a blocked run.");return d(e,{state:"reconciling_release",blockedReason:null,metadata:{...e.metadata,releaseAction:{type:t.type,candidateId:r.id,requestedAt:a}},updatedAt:a},t.actionId)}if(t.type==="reject_candidate"){if(!["awaiting_promotion","pull_request_open"].includes(e.state))throw new Error("Create/Improve candidate is not available for rejection.");let r=u(e,t.candidateId),o=t.reason?.trim()||"Candidate rejected.";return r.git?.pullRequest?d(e,{state:"reconciling_release",blockedReason:null,metadata:{...e.metadata,releaseAction:{type:t.type,candidateId:r.id,reason:o,requestedAt:a}},updatedAt:a},t.actionId):d(e,{state:"rejected",candidates:e.candidates.map(i=>i.id===r.id?{...i,status:"rejected",updatedAt:a}:i),releaseOutcome:{...e.releaseOutcome,status:"rejected",updatedAt:a},blockedReason:o,metadata:{...e.metadata,releaseAction:{type:t.type,candidateId:r.id,reason:o,completedAt:a}},updatedAt:a},t.actionId)}if(t.type==="pause"){if(!e.executionPolicy.pauseAllowed)throw new Error("This Create/Improve run cannot be paused.");if(["ready","ready_local","published_hosted","cancelled"].includes(e.state))throw new Error("Completed Create/Improve runs cannot be paused.");return d(e,{state:"paused",metadata:{...e.metadata,pausedFromState:e.state,pausedAt:a},updatedAt:a},t.actionId)}let l=I(e);return d(e,{state:l,metadata:{...e.metadata,resumedAt:a},updatedAt:a},t.actionId)}n(h,"applyCreateImproveRunAction");function u(e,t){let a=e.candidates.find(l=>l.id===t);if(!a)throw new Error(`Create/Improve candidate not found: ${t}`);return a}n(u,"requireRunCandidate");function A(e,t){if(e.state!=="applying_source"||e.plan?.status!=="approved"||e.adapter.kind==="local")return e;let a=v({session:t}),l=e.adapter.kind;return d(e,{state:"blocked",blockedReason:l==="hosted"?"Approved hosted Create/Improve plans from this chat require the Cloud work item background flow. No local source mutation was performed.":"Approved Profile promotion requires an explicit Cloud promotion flow. No local source mutation was performed.",metadata:{...e.metadata,createImproveApproval:{status:"blocked",reason:l==="hosted"?"hosted_create_improve_apply_not_configured":"promote_local_to_hosted_apply_not_configured",adapterKind:l,workspaceExecutionTarget:f(a)}},updatedAt:c()})}n(A,"createPlanExecutionRunForApprovedAdapter");function f(e){return e.target==="sandbox"?{target:e.target,ready:e.ready,workspaceKind:e.workspaceKind,workspaceId:e.workspaceId,sandboxId:e.sandboxId,cloudProjectId:e.cloudProjectId,localProjectId:e.localProjectId,hybrid:e.hybrid,reason:e.reason}:e.target==="local"?{target:e.target,ready:e.ready,workspaceKind:e.workspaceKind,workspaceId:e.workspaceId,localProjectId:e.localProjectId,cwd:e.cwd,reason:e.reason}:{target:e.target,ready:e.ready,workspaceKind:e.workspaceKind,workspaceId:e.workspaceId,reason:e.reason}}n(f,"createImproveExecutionTargetMetadata");function C(e){return["awaiting_questions","awaiting_plan_approval","awaiting_promotion","pull_request_open","paused"].includes(e.state)?"pending":["applying_source","running_checks","evaluating","opening_pull_request","reconciling_release","pushing_hosted","running_hosted_checks"].includes(e.state)?"started":["rejected","blocked","failed","cancelled"].includes(e.state)?"failed":"completed"}n(C,"createImproveRuntimeEventStatus");function b(e,t){return d(e,{state:"blocked",blockedReason:t,metadata:{...e.metadata,localCreateImprove:{status:"blocked",reason:"local_create_improve_background_apply_failed"}},updatedAt:c()})}n(b,"createImproveBackgroundFailureRun");function q(e){return e.mentionedApps,e.userPrompt,e.request}n(q,"normalizeMentionedSandboxToolRequest");function P(e,t){return{...e,metadata:{...e.metadata??{},createImproveRun:t},createImproveRun:t}}n(P,"withCreateImproveRun");function I(e){if(e.state!=="paused")throw new Error("Create/Improve run cannot be resumed.");let t=m.shape.state.safeParse(e.metadata.pausedFromState);return!t.success||t.data==="paused"?"planning":t.data}n(I,"resumeStateFromMetadata");export{k as a,y as b,g as c,h as d,A as e,C as f,b as g,q as h,P as i};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as Me,b as Be}from"./chunk-
|
|
2
|
+
import{a as Me,b as Be}from"./chunk-7K7O3CKY.js";import{b as Le}from"./chunk-EWOSLZDX.js";import{c as Oe}from"./chunk-AN525SPP.js";import{b as Te}from"./chunk-XW6HGSIT.js";import{a as te,c as ae}from"./chunk-PH6IORGZ.js";import{a as _e,b as De}from"./chunk-TG7P7BSV.js";import{g as Ie,j as ne}from"./chunk-N4FFQPLR.js";import{d as ee,e as xe,f as Pe,g as qe}from"./chunk-AY64VY4E.js";import{d as Se,f as Ae,h as Ce}from"./chunk-JFXWI3EN.js";import{m as D}from"./chunk-KGNCKIFP.js";import{b as C}from"./chunk-ES2ISFJC.js";import{a as o}from"./chunk-FTQLQJQV.js";function ze(e){let t=new Map,s=new Map,r=new Map,i=new Map(e.triggers.map(a=>[L(a),a])),u=new Map(e.observations.map(a=>[L(a),a])),c=new Map(e.outcomes.map(a=>[L(a.trigger),a]));return async a=>{let[p,f,R]=await Promise.all([d(a.runRef),m(a.runRef),e.store.getSession(a.runRef)]),A=f.slice().sort((S,x)=>S.startedAt.localeCompare(x.startedAt)),w=A.find(S=>S.id===a.turnId)??await e.store.getTurn(a.turnId),T=A.findIndex(S=>S.id===a.turnId),M=T>0?A.slice(0,T):[],F=M.slice(-e.limits.maxPrecedingTurns),$=tt(F,p,e.limits.maxConversationChars),W=p.filter(S=>S.turnId===a.turnId).filter(S=>["tool.completed","validation.completed","workspace_action_result"].includes(S.name)).filter(S=>S.status==="failed"||["validation.completed","workspace_action_result"].includes(S.name)),O=r.get(a.runRef);O||(O=await Me(R?.cwd),r.set(a.runRef,O));let g=e.sourcePolicies.get(a.runRef)??null,v=H(a),_=b(a),I=_.results,E={schemaVersion:"openpond.localHarnessDeepReviewContext.v1",binding:{ownerScope:e.workspace.ownerScope,workspaceId:e.workspace.id,sourceRef:a.runRef,sourceTurn:a.turnId,admittedHarness:a.harnessRelease,observation:Q(a),refinerOutcome:v?Q(v):null,sourcePolicy:g?{policy:g.policy,state:g.state,checkedAt:g.checkedAt}:null},conversation:{precedingTurns:$,currentTurn:w?We(w,p,2e3,6e3):null},artifactDiagnostics:O.slice(0,e.limits.maxArtifactDiagnostics),events:W.slice(-e.limits.maxContextEvents).map(nt),currentResult:v?l(v):null,laterResults:I,truncation:{availablePrecedingTurns:M.length,includedPrecedingTurns:$.length,precedingTurnsTruncated:M.length>$.length,conversationChars:rt($),availableContextEvents:W.length,includedContextEvents:Math.min(W.length,e.limits.maxContextEvents),availableArtifactDiagnostics:O.length,includedArtifactDiagnostics:Math.min(O.length,e.limits.maxArtifactDiagnostics),availableLaterResults:_.total,includedLaterResults:I.length,laterResultsTruncated:_.total>I.length,sessionMissing:R===null,turnMissing:w===null}};return{...E,contentHash:D(E)}};async function d(a){let p=t.get(a);if(p)return p;let f=await e.store.runtimeEventsForSession(a);return t.set(a,f),f}async function m(a){let p=s.get(a);if(p)return p;let f=await e.store.turnsForSession(a,500);return s.set(a,f),f}function H(a){for(let p of e.triggers)if(p.observations.some(f=>L(f)===L(a)))return c.get(L(p))??null;return null}function b(a){if(!a.deterministicClass)return{results:[],total:0};let f=e.outcomes.flatMap(R=>R.createdAt<=a.createdAt?[]:(i.get(L(R.trigger))?.observations.map(T=>u.get(L(T))).filter(T=>!!T)??[]).some(T=>T.deterministicClass===a.deterministicClass)?[l(R)]:[]).sort((R,A)=>String(R.createdAt).localeCompare(String(A.createdAt)));return{results:f.slice(0,e.limits.maxLaterResults),total:f.length}}function l(a){let p=a.proposal?e.applyReceipts.filter(w=>L(w.proposal)===L(a.proposal)):[],f=a.proposal?e.advanceReceipts.filter(w=>w.proposal&&L(w.proposal)===L(a.proposal)):[],R=new Set(f.map(w=>L(w))),A=e.advanceReceipts.filter(w=>w.rollbackOf&&R.has(L(w.rollbackOf)));return{outcome:Q(a),decision:a.decision,reason:N(a.reason,1500),proposal:a.proposal,createdAt:a.createdAt,applyReceipts:p.map(w=>({...Q(w),decision:w.decision,createdAt:w.createdAt})),advanceReceipts:f.map(w=>({...Q(w),decision:w.decision,previousRelease:w.previousRelease,nextRelease:w.nextRelease,createdAt:w.createdAt})),rollbackReceipts:A.map(w=>({...Q(w),decision:w.decision,rollbackOf:w.rollbackOf,nextRelease:w.nextRelease,createdAt:w.createdAt}))}}}o(ze,"createLocalHarnessDeepReviewContextLoader");function tt(e,t,s){if(!e.length||s<=0)return[];let r=Math.max(1,Math.floor(s/(e.length*2)));return e.map(i=>We(i,t,r,r))}o(tt,"boundedConversationTurns");function We(e,t,s,r){return{id:e.id,startedAt:e.startedAt,completedAt:e.completedAt,status:e.status,error:N(e.error??"",1e3),prompt:N(e.prompt,s),assistantOutput:N(st(t,e.id),r)}}o(We,"boundedTurn");function st(e,t){return e.filter(s=>s.turnId===t&&s.name==="assistant.delta").map(s=>s.output??"").join("")}o(st,"assistantOutputForTurn");function rt(e){return e.reduce((t,s)=>t+(typeof s.prompt=="string"?s.prompt.length:0)+(typeof s.assistantOutput=="string"?s.assistantOutput.length:0),0)}o(rt,"conversationCharacterCount");function nt(e){let t=$e(e.data),s=$e(t.result);return{id:e.id,name:e.name,action:e.action??(typeof t.tool=="string"?t.tool:null),status:e.status??null,error:N(e.error??"",750),output:N(typeof s.output=="string"?s.output:e.output??"",750),stderr:N(typeof s.stderr=="string"?s.stderr:"",750),exitCode:typeof s.exitCode=="number"?s.exitCode:null,timedOut:s.timedOut===!0}}o(nt,"boundedReviewEvent");function N(e,t){if(!e||t<=0)return null;let s=e.replace(/\bBearer\s+[A-Za-z0-9._~+/=-]+/gi,"Bearer [redacted]").replace(/\b(api[_-]?key|access[_-]?token|auth(?:orization)?|password|secret)(\s*[:=]\s*)([^\s,;]+)/gi,"$1$2[redacted]");if(s.length<=t)return s;let r=`
|
|
3
3
|
[... middle omitted ...]
|
|
4
4
|
`;if(r.length>=t)return s.slice(0,t);let i=Math.max(0,t-r.length),u=Math.ceil(i/2),c=Math.floor(i/2);return`${s.slice(0,u)}${r}${s.slice(-c)}`}o(N,"boundedReviewText");function Q(e){return{id:e.id,contentHash:e.contentHash}}o(Q,"artifactRef");function L(e){return`${e.id}:${e.contentHash}`}o(L,"artifactKey");function $e(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}o($e,"asRecord");var at=2160*60*60*1e3;async function fe(e){let t=[],s=await e.store.listHarnessRefinementCandidates(e.workspace.id),r=e.upsertReviewClaim!==!1&&e.review.classification==="harness_maintenance"?e.review.claim?.fingerprint??null:null;for(let c of s){if(c.fingerprint===r)continue;let d=ot({...e,candidate:c});d&&(await e.store.saveHarnessRefinementCandidateTransition({workspaceId:e.workspace.id,...d}),t.push(d.receipt))}let i=null;if(e.upsertReviewClaim!==!1&&e.review.classification==="harness_maintenance"&&e.review.claim){let c=await e.store.getHarnessRefinementCandidateByFingerprint(e.workspace.id,e.review.claim.fingerprint),d=it({...e,candidate:c});d?(await e.store.saveHarnessRefinementCandidateTransition({workspaceId:e.workspace.id,...d}),t.push(d.receipt),i=d.candidate):i=c}let u=await e.store.listHarnessRefinementCandidates(e.workspace.id);return e.upsertReviewClaim===!1&&(i=u.find(c=>c.status==="confirmed"&&c.sourceReviews.some(d=>d.id===e.review.id&&d.contentHash===e.review.contentHash))??null),{activeCandidate:i,candidates:u,lifecycleReceipts:t}}o(fe,"reconcileLocalHarnessRefinementCandidates");async function Ue(e){if(!["unresolved","confirmed"].includes(e.candidate.status))return e.candidate;let t=ee({...we(e.candidate),sourceReviews:V([...e.candidate.sourceReviews,z(e.review)]),relatedHarnessReleases:V([...e.candidate.relatedHarnessReleases,...e.relatedHarnessRelease?[e.relatedHarnessRelease]:[]]),lastReviewedAt:e.now,updatedAt:e.now,resolution:null}),s=ie({before:e.candidate,candidate:t,review:e.review,decision:"merged",addedEvidence:[],removedEvidence:[],reason:e.reason,now:e.now});return await e.store.saveHarnessRefinementCandidateTransition({workspaceId:e.candidate.workspaceRef,...s}),t}o(Ue,"recordAppliedLocalHarnessRefinementCandidate");async function Fe(e){if(e.candidate.status!=="confirmed")throw new Error("Later-success resolution requires a confirmed candidate.");let t=e.review.harnessRelease,s=e.candidate.relatedHarnessReleases.at(-1);if(e.candidate.relatedHarnessReleases.length<2||!s||s.id!==t.id||s.contentHash!==t.contentHash)throw new Error("Later-success evidence is not bound to the candidate's applied Harness release.");let r=new Set(e.candidate.occurrences.map(d=>d.sourceRef)),i=e.evidence.filter(d=>!r.has(d.sourceRef));if(i.length===0)throw new Error("Later-success resolution requires evidence from an independent work source.");let u=ee({...we(e.candidate),status:"resolved",sourceReviews:V([...e.candidate.sourceReviews,z(e.review)]),lastReviewedAt:e.now,updatedAt:e.now,resolution:{kind:"later_success",reason:e.reason,evidenceRefs:V(i.map(d=>d.evidence)),resolvedAt:e.now}}),c=ie({before:e.candidate,candidate:u,review:e.review,decision:"resolved",addedEvidence:i,removedEvidence:[],reason:e.reason,now:e.now});return await e.store.saveHarnessRefinementCandidateTransition({workspaceId:e.candidate.workspaceRef,...c}),u}o(Fe,"resolveLocalHarnessRefinementCandidateFromLaterSuccess");function ot(e){if(!["unresolved","confirmed"].includes(e.candidate.status))return null;let t=[],s=oe(e.candidate.occurrences,e.sourcePolicies,t),r=oe(e.candidate.counterevidence,e.sourcePolicies,t),i=V([...e.candidate.sourceReviews,z(e.review)]),u=Date.parse(e.candidate.expiresAt)<=Date.parse(e.now),c=s.length===0,d=c?"rejected":u?"expired":t.length>0?"unresolved":e.candidate.status,m=c?"rejected":u?"expired":"merged";if(!(t.length>0||e.candidate.lastReviewedAt!==e.now||e.candidate.sourceReviews.length!==i.length)&&!u)return null;let b=c?"All supporting occurrences were revoked, deleted, expired, or unavailable at review time.":u?"The bounded candidate lifetime elapsed without sufficient confirming evidence.":"Candidate evidence was reauthorized against the current source policy set.",l=ee({...we(e.candidate),status:d,occurrences:s,counterevidence:r,sourceReviews:i,lastReviewedAt:e.now,updatedAt:e.now,expiresAt:u?e.now:e.candidate.expiresAt,resolution:c||u?{kind:c?"source_revoked":"expired",reason:b,evidenceRefs:t.map(a=>a.evidence),resolvedAt:e.now}:null});return ie({before:e.candidate,candidate:l,review:e.review,decision:m,addedEvidence:[],removedEvidence:t.map(a=>a.evidence),reason:b,now:e.now})}o(ot,"reauthorizeOrExpireCandidate");function it(e){let t=e.review.claim,s=e.candidate,r=[],i=s?oe(s.occurrences,e.sourcePolicies,r):[],u=s?oe(s.counterevidence,e.sourcePolicies,r):[],c=new Set(s&&["unresolved","confirmed"].includes(s.status)?i.map(f=>f.occurrenceKey):[]),d=e.review.selectedEvidence.filter(f=>!c.has(f.occurrenceKey));if(s&&d.length===0&&r.length===0&&["unresolved","confirmed"].includes(s.status))return null;let m=ct([...i,...e.review.selectedEvidence]),H=t.candidateDisposition==="confirm"?"confirmed":"unresolved",b=m.map(f=>f.occurredAt).sort()[0],l=m.map(f=>f.occurredAt).sort().at(-1),a=ee({schemaVersion:"openpond.harnessRefinementCandidate.v1",id:s?.id??`refinement-candidate-${t.fingerprint.slice(0,24)}`,ownerScope:e.workspace.ownerScope,workspaceRef:e.workspace.id,fingerprint:t.fingerprint,recurrenceFamily:t.recurrenceFamily,statement:t.statement,status:H,occurrences:m,counterevidence:u,sourceReviews:V([...s?.sourceReviews??[],z(e.review)]),relatedHarnessReleases:V([...s?.relatedHarnessReleases??[],e.review.harnessRelease]),firstSeenAt:b,lastSeenAt:l,lastReviewedAt:e.now,expiresAt:new Date(Date.parse(e.now)+at).toISOString(),resolution:null,createdAt:s?.createdAt??e.now,updatedAt:e.now}),p=s?["resolved","rejected","expired"].includes(s.status)?"reopened":"merged":"created";return ie({before:s,candidate:a,review:e.review,decision:p,addedEvidence:d,removedEvidence:r.map(f=>f.evidence),reason:p==="created"?"Created a bounded candidate from an authorized cross-Work Harness claim.":p==="reopened"?"New authorized evidence reopened the prior candidate.":"Merged new authorized evidence into the existing candidate.",now:e.now})}o(it,"upsertCandidateFromReview");function ie(e){let t=xe({schemaVersion:"openpond.harnessRefinementCandidateLifecycleReceipt.v1",id:`candidate-lifecycle-${D({candidate:z(e.candidate),review:z(e.review),decision:e.decision}).slice(0,24)}`,candidateId:e.candidate.id,decision:e.decision,beforeCandidate:e.before?z(e.before):null,afterCandidate:z(e.candidate),review:z(e.review),addedEvidence:e.addedEvidence,removedEvidence:e.removedEvidence,reason:e.reason,createdAt:e.now});return{candidate:e.candidate,receipt:t}}o(ie,"transition");function oe(e,t,s){return e.flatMap(r=>{let i=t.get(r.sourceRef);return!i||i.state!=="authorized"?(s.push(r),[]):[{...r,sourcePolicy:i}]})}o(oe,"reauthorizedEvidence");function ct(e){return[...new Map(e.map(t=>[t.occurrenceKey,t])).values()].sort((t,s)=>t.occurredAt.localeCompare(s.occurredAt)||t.occurrenceKey.localeCompare(s.occurrenceKey))}o(ct,"uniqueEvidence");function V(e){return[...new Map(e.map(t=>[`${t.id}:${t.contentHash}`,t])).values()]}o(V,"uniqueRefs");function z(e){return{id:e.id,contentHash:e.contentHash}}o(z,"artifactRef");function we(e){let{contentHash:t,...s}=e;return s}o(we,"withoutHash");var dt={memory:!0,prompt:!0,skill:!0,agent:!1};async function je(e){if(e.candidate.status!=="confirmed")return null;if(e.review.classification!=="harness_maintenance"||e.review.contentHash!==e.candidate.sourceReviews.at(-1)?.contentHash)throw new Error("Cross-run continuation requires the candidate's confirming Harness review.");let t=await e.store.getHarnessWorkspace(e.candidate.workspaceRef),s=t?.currentChannel.release??null;if(!t||t.location!=="local"||!s)throw new Error("Cross-run continuation requires an active Local Harness release.");let r=Pe({workspaceRef:t.id,candidateFingerprint:e.candidate.fingerprint,admittedHarness:s}),i=(e.now??(()=>new Date().toISOString()))(),u=qe({schemaVersion:"openpond.harnessCrossRunRefinementRequest.v1",id:`cross-run-refinement-${r.slice(0,24)}`,ownerScope:t.ownerScope,workspaceRef:t.id,candidate:ce(e.candidate),candidateFingerprint:e.candidate.fingerprint,review:ce(e.review),admittedHarness:s,evidence:e.candidate.occurrences,capabilities:dt,deduplicationKey:r,createdAt:i}),c=await e.store.saveHarnessCrossRunRefinementRequestIfAbsent({workspaceId:t.id,request:u});if(!c.created)return null;let d=await ut(e.store,t.id,c.request.evidence);if(d.length===0)throw new Error("Confirmed cross-run candidate has no verifiable source observations.");let m=`cross-run-${c.request.deduplicationKey.slice(0,24)}`,H=await Le({store:e.store,runId:m,workspace:t,harnessRelease:c.request.admittedHarness,admittedAt:c.request.createdAt}),b=lt({request:c.request,overlay:H,observations:d});await e.store.saveHarnessImprovementArtifact(t.id,"trigger_decision",b);let l=await Be({store:e.store,storeDir:e.storeDir,trigger:b,additionalEvidence:{reviewScope:"cross_run_candidate",request:c.request,candidate:e.candidate,review:e.review},reviewScope:"cross_run_candidate",stream:e.stream,signal:e.signal,now:e.now}),a=e.candidate;return l.applyReceipt?.decision==="applied"&&(a=await Ue({store:e.store,candidate:a,review:e.review,relatedHarnessRelease:l.workspace.currentChannel.release??null,reason:"The confirmed candidate produced a validated applied Harness change and now awaits independent outcome evidence.",now:(e.now??(()=>new Date().toISOString()))()})),{candidate:a,worker:l}}o(je,"continueConfirmedLocalHarnessCandidate");function lt(e){let t=e.observations.slice(0,100).map(ce);return Ie({schemaVersion:"openpond.refinementTriggerDecision.v1",id:`cross-run-trigger-${e.request.deduplicationKey.slice(0,24)}`,runRef:e.overlay.runId,turnId:`candidate-${e.request.candidate.id}`,harnessRelease:e.request.admittedHarness,overlay:{id:e.overlay.id,revision:e.overlay.revision,contentHash:e.overlay.contentHash},observations:t,decision:"queue_refiner",deterministicRoute:null,suggestedRoutes:[],reason:"A confirmed authorized cross-Work candidate is ready for one bounded Refiner continuation.",deduplicationKey:e.request.deduplicationKey,policy:{schemaVersion:"openpond.refinementTriggerPolicy.v1",maxEstimatedCostUsd:.05,cooldownMs:0,maxPendingPlans:1,maxEvidenceEvents:100,maxProposalEdits:4,maxProposalBytes:2e4},estimatedMaxCostUsd:.05,pendingPlanCount:0,boundary:{kind:"turn_completed",eventSequence:0,occurredAt:e.request.createdAt},cooldownUntil:null,createdAt:e.request.createdAt,metadata:{origin:"cross_run_candidate",crossRunRefinementRequest:ce(e.request),candidate:e.request.candidate}})}o(lt,"createCrossRunTrigger");async function ut(e,t,s){let[r,i,u,c]=await Promise.all([e.listHarnessImprovementArtifacts(t,"observation",1e3),e.listHarnessImprovementArtifacts(t,"trigger_decision",1e3),e.listHarnessImprovementArtifacts(t,"route_decision",1e3),e.listHarnessImprovementArtifacts(t,"refiner_outcome",1e3)]),d=new Map(r.map(a=>[B(a),a])),m=new Map(i.map(a=>[B(a),a])),H=new Map(u.map(a=>[B(a),a])),b=new Map(c.map(a=>[B(a),a])),l=new Map;for(let a of s){if(a.kind==="observation"){let R=d.get(B(a.evidence));R&&l.set(B(R),R);continue}let p=a.kind==="route_decision"?H.get(B(a.evidence))?.trigger:a.kind==="refiner_outcome"?b.get(B(a.evidence))?.trigger:null,f=p?m.get(B(p)):null;for(let R of f?.observations??[]){let A=d.get(B(R));A&&l.set(B(A),A)}}return[...l.values()].sort((a,p)=>a.createdAt.localeCompare(p.createdAt)||a.id.localeCompare(p.id))}o(ut,"resolveCandidateObservations");function ce(e){return{id:e.id,contentHash:e.contentHash}}o(ce,"artifactRef");function B(e){return`${e.id}:${e.contentHash}`}o(B,"artifactKey");var mt=C.object({sourceRef:C.string().trim().min(1),policy:C.object({id:C.string().trim().min(1),contentHash:C.string().regex(/^[a-f0-9]{64}$/)}).strict(),state:C.enum(["authorized","revoked","deleted","expired"]),checkedAt:C.string().datetime()}).strict(),vt=C.object({previousWatermark:Se.nullable().optional(),sourcePolicies:C.array(mt).max(1e4).default([]),limits:C.object({maxEvidence:C.number().int().min(1).max(1e3).default(200),maxTokens:C.number().int().min(1).max(1e6).default(5e4),maxDurationMs:C.number().int().min(1).max(3e5).default(24e4),maxEstimatedCostUsd:C.number().finite().nonnegative().default(.1),maxPrecedingTurns:C.number().int().min(0).max(10).default(3),maxConversationChars:C.number().int().min(0).max(1e5).default(12e3),maxContextEvents:C.number().int().min(1).max(100).default(12),maxArtifactDiagnostics:C.number().int().min(0).max(100).default(20),maxLaterResults:C.number().int().min(0).max(50).default(8)}).strict().default({maxEvidence:200,maxTokens:5e4,maxDurationMs:24e4,maxEstimatedCostUsd:.1,maxPrecedingTurns:3,maxConversationChars:12e3,maxContextEvents:12,maxArtifactDiagnostics:20,maxLaterResults:8})}).strict(),de=new WeakMap;function Qe(e){let t=de.get(e.store);if(t)return t;let s=pt(e).finally(()=>{de.get(e.store)===s&&de.delete(e.store)});return de.set(e.store,s),s}o(Qe,"reviewSelectedLocalHarnessEvaluation");async function pt(e){let t=vt.parse(e.request??{}),s=performance.now(),r=await ae(e.store);if(!r)throw new Error("No Local Harness release is selected for evaluation review.");let i=await e.store.getHarnessWorkspace(r.workspaceId);if(!i)throw new Error(`Selected Harness workspace ${r.workspaceId} does not exist.`);let[u,c,d,m,H,b,l,a]=await Promise.all([e.store.listHarnessImprovementArtifacts(i.id,"evaluation_review",1e3),e.store.listHarnessImprovementArtifacts(i.id,"route_decision",1e3),e.store.listHarnessImprovementArtifacts(i.id,"trigger_decision",1e3),e.store.listHarnessImprovementArtifacts(i.id,"observation",1e3),e.store.listHarnessImprovementArtifacts(i.id,"apply_receipt",1e3),e.store.listHarnessImprovementArtifacts(i.id,"refiner_outcome",1e3),e.store.listHarnessAdvanceReceipts(i.id),e.store.listHarnessRefinementCandidates(i.id)]),p=u[0]??null,f=t.previousWatermark??p?.nextWatermark??null,R=c,A=d,w=m,T=H,M=b,F=[...R,...w,...M];if(t.previousWatermark===void 0&&p&&!F.some(n=>n.createdAt>p.nextWatermark.throughCreatedAt)){let n=(e.now??(()=>new Date().toISOString()))(),y=await fe({store:e.store,workspace:i,review:p,sourcePolicies:new Map(t.sourcePolicies.map(k=>[k.sourceRef,J(k)])),now:n,upsertReviewClaim:!1});return await Ke({...e,candidate:y.activeCandidate,review:p}),p}let $=new Map(A.map(n=>[P(n),n])),Y=new Set(A.filter(n=>n.metadata.origin==="cross_run_candidate").map(P)),W=new Map(w.map(n=>[P(n),n])),O=new Map(t.sourcePolicies.map(n=>[n.sourceRef,n])),g=ze({store:e.store,workspace:i,sourcePolicies:O,observations:w,triggers:A,outcomes:M,applyReceipts:T,advanceReceipts:l,limits:{maxPrecedingTurns:t.limits.maxPrecedingTurns,maxConversationChars:t.limits.maxConversationChars,maxContextEvents:t.limits.maxContextEvents,maxArtifactDiagnostics:t.limits.maxArtifactDiagnostics,maxLaterResults:t.limits.maxLaterResults}}),v=[],_=[],I=new Set,E=new Set(R.map(n=>P(n.trigger)));for(let n of R){let y=$.get(P(n.trigger));if(!y){v.push({evidence:q(n),sourcePolicy:null,reason:"unverified"});continue}if(Y.has(P(y))){v.push({evidence:q(n),sourcePolicy:null,reason:"resolved"});continue}let k=y.observations.map(j=>W.get(P(j))).filter(j=>!!j);for(let j of k)I.add(P(j));_.push({id:`route_decision:${n.id}`,artifact:n,kind:"route_decision",sourceRef:k[0]?.runRef??y.runRef,payload:{routeDecision:n,trigger:y,observations:k,turnContexts:await Ve(k,g)}})}for(let n of M){if(E.has(P(n.trigger)))continue;let y=$.get(P(n.trigger));if(!y){v.push({evidence:q(n),sourcePolicy:null,reason:"unverified"});continue}if(Y.has(P(y))){v.push({evidence:q(n),sourcePolicy:null,reason:"resolved"});continue}let k=y.observations.map(K=>W.get(P(K))).filter(K=>!!K);for(let K of k)I.add(P(K));let j=n.proposal?T.filter(K=>P(K.proposal)===P(n.proposal)):[];_.push({id:`refiner_outcome:${n.id}`,artifact:n,kind:"refiner_outcome",sourceRef:k[0]?.runRef??y.runRef,payload:{outcome:n,trigger:y,observations:k,turnContexts:await Ve(k,g),applyReceipts:j}})}for(let n of w)I.has(P(n))||_.push({id:`observation:${n.id}`,artifact:n,kind:"observation",sourceRef:n.runRef,payload:{observation:n,turnContext:await g(n)}});let S=[],x=[],Z=0,ue=0;for(let n of _.slice().sort((y,k)=>y.artifact.createdAt.localeCompare(k.artifact.createdAt)||y.id.localeCompare(k.id))){if(performance.now()-s>=t.limits.maxDurationMs){v.push({evidence:q(n.artifact),sourcePolicy:null,reason:"budget"});continue}if(f&&n.artifact.createdAt<=f.throughCreatedAt){v.push({evidence:q(n.artifact),sourcePolicy:null,reason:"before_watermark"});continue}if(Z>=t.limits.maxEvidence){v.push({evidence:q(n.artifact),sourcePolicy:null,reason:"budget"});continue}Z+=1;let y=Math.ceil(JSON.stringify(n.payload).length/4);if(ue+y>t.limits.maxTokens){v.push({evidence:q(n.artifact),sourcePolicy:null,reason:"budget"});continue}ue+=y,x.push(n.artifact);let k=O.get(n.sourceRef);if(!k||k.state!=="authorized"){v.push({evidence:q(n.artifact),sourcePolicy:k?J(k):null,reason:k&&k.state!=="authorized"?k.state:"unverified"});continue}S.push(n)}let h={schemaVersion:"openpond.harnessEvaluationReviewModelDecision.v2",decision:"no_action",reason:"No authorized unresolved evidence qualified for model review.",ignoredEvidence:[]},G={promptTokens:0,completionTokens:0,totalTokens:0},se={selectedIds:null};if(S.length>0&&t.limits.maxEstimatedCostUsd===0){for(let n of S)v.push({evidence:q(n.artifact),sourcePolicy:J(O.get(n.sourceRef)),reason:"budget"});h={schemaVersion:"openpond.harnessEvaluationReviewModelDecision.v2",decision:"no_action",reason:"Continuous review is disabled by a zero model-cost ceiling.",ignoredEvidence:S.map(n=>({id:n.id,reason:"The configured model-cost ceiling is zero."}))}}else if(S.length>0){if(!e.stream)throw new Error("Harness continuous review requires a model stream.");h=await Ce({evidence:S.map(n=>({id:n.id,evidence:q(n.artifact),kind:n.kind,sourceRef:n.sourceRef,occurredAt:n.artifact.createdAt,payload:n.payload})),harnessRelease:q(r.harnessRelease),previousReviews:u.slice(0,20),candidates:a.map(n=>({id:n.id,fingerprint:n.fingerprint,statement:n.statement,status:n.status,occurrences:n.occurrences,relatedHarnessReleases:n.relatedHarnessReleases,resolution:n.resolution})),stream:o(async function*(n){let y=null;for await(let k of e.stream(n))k.usage&&(y=k.usage),yield k;y&&(G={promptTokens:G.promptTokens+y.promptTokens,completionTokens:G.completionTokens+y.completionTokens,totalTokens:G.totalTokens+y.totalTokens})},"stream"),signal:e.signal??new AbortController().signal,timeoutMs:t.limits.maxDurationMs,onNavigation:o(n=>{se.selectedIds=new Set(n.selectedEvidenceIds)},"onNavigation")})}let He=se.selectedIds?S.filter(n=>!se.selectedIds.has(n.id)):[];for(let n of He)v.push({evidence:q(n.artifact),sourcePolicy:J(O.get(n.sourceRef)),reason:"budget"});let me=h.decision==="review"||h.decision==="resolve_candidate"?h.selectedEvidenceIds.map(n=>{let y=S.find(k=>k.id===n);if(!y)throw new Error(`Review selected unavailable evidence ${n}.`);return y}):[],ve=h.decision==="review"?h.classification:"no_action",pe=me.map(n=>ft(n,O.get(n.sourceRef))),re=(e.now??(()=>new Date().toISOString()))(),Xe=new Set(He.map(n=>P(n.artifact))),he=x.filter(n=>!Xe.has(P(n))),ye=he.map(n=>n.createdAt).sort().at(-1),ke=ye?Ne(f?.throughCreatedAt,ye):Ne(f?.throughCreatedAt,re),Ee=D({previousCursor:f?.cursor??null,throughCreatedAt:ke,examined:he.map(q)}),et=`evaluation-review-${D({workspaceId:i.id,harnessRelease:r.harnessRelease,previousWatermark:f,cursor:Ee}).slice(0,24)}`,X=Ae({schemaVersion:"openpond.harnessEvaluationReviewReceipt.v1",id:et,ownerScope:i.ownerScope,workspaceRef:i.id,harnessRelease:q(r.harnessRelease),previousWatermark:f,nextWatermark:{cursor:Ee,throughCreatedAt:ke},selectedEvidence:pe,excludedEvidence:v,claim:h.decision==="review"?{fingerprint:D({schemaVersion:"openpond.harnessRefinementCandidateFingerprint.v1",classification:ve,triageLayer:h.triageLayer,recurrenceFamily:Rt(h.recurrenceFamily)}),recurrenceFamily:h.recurrenceFamily,statement:h.statement,...h.classification==="harness_maintenance"?{candidateDisposition:h.candidateDisposition}:{},independentOccurrences:new Set(me.map(n=>n.sourceRef)).size,unresolvedOccurrences:new Set(me.map(n=>n.sourceRef)).size}:null,classification:ve,triage:h.decision==="review"?[{layer:h.triageLayer,status:"unresolved",reason:h.reason,evidenceRefs:pe.map(n=>n.evidence)}]:[],reason:h.reason,nextAuthority:wt(ve),maxEstimatedCostUsd:t.limits.maxEstimatedCostUsd,tasksetProposal:null,evaluation:null,trainingQualification:null,policyVersion:"public-model-driven-harness-review-v1",createdAt:re,metadata:{examinedEvidence:Z,fullyReviewedEvidence:se.selectedIds?.size??S.length,estimatedTokens:ue,elapsedMs:performance.now()-s,explicitInvocation:!0,modelDecision:h.decision,modelConfidence:h.decision==="review"||h.decision==="resolve_candidate"?h.confidence:null,counterevidence:h.decision==="review"?h.counterevidence:null,expectedOutcome:h.decision==="review"?h.expectedOutcome:null,ignoredEvidence:h.ignoredEvidence,modelUsage:G}});await e.store.saveHarnessImprovementArtifact(i.id,"evaluation_review",X);let be=await fe({store:e.store,workspace:i,review:X,sourcePolicies:new Map(t.sourcePolicies.map(n=>[n.sourceRef,J(n)])),now:re});if(h.decision==="resolve_candidate"){let n=be.candidates.find(y=>y.id===h.candidateId&&y.fingerprint===h.candidateFingerprint);if(!n)throw new Error("Later-success decision referenced an unavailable candidate.");await Fe({store:e.store,candidate:n,review:X,evidence:pe,reason:h.reason,now:re})}return await Ke({...e,candidate:be.activeCandidate,review:X}),X}o(pt,"runSelectedLocalHarnessEvaluation");async function Ke(e){!e.continuation||e.candidate?.status!=="confirmed"||await je({store:e.store,storeDir:e.continuation.storeDir,candidate:e.candidate,review:e.review,stream:e.continuation.stream,signal:e.signal??new AbortController().signal,now:e.now})}o(Ke,"continueCandidateIfEnabled");function q(e){return{id:e.id,contentHash:e.contentHash}}o(q,"artifactRef");function P(e){return`${e.id}:${e.contentHash}`}o(P,"artifactKey");function J(e){return{policy:e.policy,state:e.state,checkedAt:e.checkedAt}}o(J,"sourcePolicyRef");function ft(e,t){return{evidence:q(e.artifact),kind:e.kind,sourceRef:e.sourceRef,sourcePolicy:J(t),occurrenceKey:D({evidence:q(e.artifact),sourceRef:e.sourceRef}),occurredAt:e.artifact.createdAt}}o(ft,"evidenceRef");function wt(e){return e==="runtime"?"runtime_service":e==="product"?"product_team":e==="taskset"||e==="harness_maintenance"?"human_review":e==="model_improvement"?"training_system":"none"}o(wt,"nextAuthority");function Ne(...e){return e.filter(t=>!!t).sort().at(-1)}o(Ne,"maxTimestamp");function Rt(e){return e.trim().toLocaleLowerCase("en-US").replace(/\s+/g," ")}o(Rt,"normalizeRecurrenceFamily");async function Ve(e,t){let s=new Map;for(let r of e)s.set(`${r.runRef}:${r.turnId}`,r);return Promise.all([...s.values()].map(t))}o(Ve,"uniqueTurnContexts");var Je="local-personal-work-v1";async function le(e){let t=await ae(e.store);if(!t||t.workspaceId!==e.workspaceId)throw new Error("Evaluation review requires the selected Personal Local Harness.");let s=await e.store.getHarnessWorkspace(e.workspaceId);if(!s||s.ownerScope.kind!=="personal"||s.location!=="local")throw new Error("Evaluation review requires the selected Personal Local Harness.");let[r,i]=await Promise.all([e.store.listHarnessImprovementArtifacts(e.workspaceId,"observation",1e4),e.store.listHarnessImprovementArtifacts(e.workspaceId,"trigger_decision",1e4)]),u=new Set([...r.map(m=>m.runRef),...i.map(m=>m.runRef)]),c=(e.now??(()=>new Date().toISOString()))(),d=await Promise.all([...u].sort().map(async m=>{let H=await e.store.getSession(m);return{sourceRef:m,policy:{id:`source-policy-${D({workspaceId:e.workspaceId,sourceRef:m,policyVersion:Je}).slice(0,24)}`,contentHash:D({workspaceId:e.workspaceId,sourceRef:m,policyVersion:Je})},state:H?"authorized":"deleted",checkedAt:c}}));return Qe({store:e.store,request:{sourcePolicies:d,limits:{maxEvidence:200,maxTokens:5e4,maxDurationMs:24e4,maxEstimatedCostUsd:e.maxEstimatedCostUsd}},stream:e.stream,signal:e.signal,now:e.now,continuation:e.stream?{storeDir:e.storeDir,stream:e.stream}:void 0})}o(le,"reviewSelectedLocalHarnessEvaluationFromHost");var gt=15e3;function Re(e,t){if(e==="manual")return null;let s=new Date(t);return s.setUTCDate(s.getUTCDate()+(e==="daily"?1:7)),s.toISOString()}o(Re,"nextHarnessEvaluationReviewRunAt");function us(e){let t=null,s=null,r=e.now??(()=>new Date().toISOString());async function i(){return s||(s=(async()=>{let u=await e.store.getSelectedHarnessWorkspace({ownerKind:"personal",ownerId:te});if(!u)return null;let c=await e.store.getHarnessEvaluationReviewSettings(u.id),d=r();if(!c.enabled&&!c.activityEnabled)return null;let m=c.enabled&&c.cadence!=="manual"&&!!c.nextRunAt&&c.nextRunAt<=d,H=c.activityEnabled&&await Ht({store:e.store,workspaceId:u.id,batchSize:c.activityBatchSize});if(!m&&!H)return null;let b={...c,nextRunAt:m?Re(c.cadence,d):c.nextRunAt,lastRunAt:d,lastError:null,updatedAt:d};await e.store.setHarnessEvaluationReviewSettings({workspaceId:u.id,settings:b});try{let l=await le({store:e.store,storeDir:e.storeDir,workspaceId:u.id,maxEstimatedCostUsd:c.maxEstimatedCostUsd,stream:e.stream,now:r});return await e.store.setHarnessEvaluationReviewSettings({workspaceId:u.id,settings:{...b,lastResult:{id:l.id,contentHash:l.contentHash,classification:l.classification},updatedAt:r()}}),e.logger?.info("Harness evaluation review schedule completed",{workspaceId:u.id,reviewId:l.id,classification:l.classification}),l}catch(l){let a=l instanceof Error?l.message:String(l);return await e.store.setHarnessEvaluationReviewSettings({workspaceId:u.id,settings:{...b,lastError:a,updatedAt:r()}}),e.logger?.warn("Harness evaluation review schedule failed",{workspaceId:u.id,error:a}),null}})().finally(()=>{s=null}),s)}return o(i,"runDueNow"),{start(){t||(t=setInterval(()=>{e.isClosing()||i()},e.tickMs??gt),t.unref?.(),i())},async stop(){t&&clearInterval(t),t=null,await s},runDueNow:i}}o(us,"createLocalHarnessEvaluationReviewScheduler");async function Ht(e){let[t,s]=await Promise.all([e.store.listHarnessImprovementArtifacts(e.workspaceId,"refiner_outcome",e.batchSize),e.store.listHarnessImprovementArtifacts(e.workspaceId,"evaluation_review",1)]),r=s[0]?.nextWatermark.throughCreatedAt??null;return t.filter(i=>!r||i.createdAt>r).length>=e.batchSize}o(Ht,"hasEventDrivenReviewBatch");import ge from"node:path";function Us(e){return{harnessHistoryPayload:o(()=>U(e.store),"harnessHistoryPayload"),updateHarnessBackgroundReviewPayload:o(t=>It({store:e.store,request:kt(t)}),"updateHarnessBackgroundReviewPayload"),reviewHarnessEvaluationPayload:o(t=>At({store:e.store,storeDir:e.storeDir,stream:e.evaluationReviewStream,request:ht(t)}),"reviewHarnessEvaluationPayload"),updateHarnessEvaluationReviewSchedulePayload:o(t=>Ct({store:e.store,request:yt(t)}),"updateHarnessEvaluationReviewSchedulePayload"),harnessDiffPayload:o(t=>qt({...e,request:Et(t)}),"harnessDiffPayload"),rollbackHarnessPayload:o(t=>_t({...e,request:bt(t)}),"rollbackHarnessPayload"),reviewHarnessProposalPayload:o(t=>Dt({...e,request:St(t)}),"reviewHarnessProposalPayload")}}o(Us,"createLocalHarnessSettingsRoutePayloads");function ht(e){if(!e||typeof e!="object")throw new Error("Harness evaluation review requires a workspace.");let t=e;if(typeof t.workspaceId!="string")throw new Error("Harness evaluation review requires a workspace.");if(t.maxEstimatedCostUsd!==void 0&&(typeof t.maxEstimatedCostUsd!="number"||!Number.isFinite(t.maxEstimatedCostUsd)||t.maxEstimatedCostUsd<0))throw new Error("Harness evaluation review cost must be a non-negative number.");return{workspaceId:t.workspaceId,maxEstimatedCostUsd:t.maxEstimatedCostUsd}}o(ht,"parseHarnessEvaluationReviewRequest");function yt(e){if(!e||typeof e!="object")throw new Error("Harness evaluation review schedule requires a workspace and cadence.");let t=e;if(typeof t.workspaceId!="string"||typeof t.enabled!="boolean"||typeof t.activityEnabled!="boolean"||typeof t.activityBatchSize!="number"||!Number.isInteger(t.activityBatchSize)||t.activityBatchSize<1||t.activityBatchSize>100||t.cadence!=="manual"&&t.cadence!=="daily"&&t.cadence!=="weekly"||typeof t.maxEstimatedCostUsd!="number"||!Number.isFinite(t.maxEstimatedCostUsd)||t.maxEstimatedCostUsd<0)throw new Error("Harness evaluation review schedule requires a valid workspace, cadence, and cost limit.");return{workspaceId:t.workspaceId,enabled:t.enabled,activityEnabled:t.activityEnabled,activityBatchSize:t.activityBatchSize,cadence:t.cadence,maxEstimatedCostUsd:t.maxEstimatedCostUsd}}o(yt,"parseHarnessEvaluationReviewScheduleRequest");function kt(e){if(!e||typeof e!="object")throw new Error("Harness background review requires a workspace and enabled state.");let t=e;if(typeof t.workspaceId!="string"||typeof t.enabled!="boolean")throw new Error("Harness background review requires a workspace and enabled state.");return{workspaceId:t.workspaceId,enabled:t.enabled}}o(kt,"parseHarnessBackgroundReviewRequest");function Ye(e,t){if(!e||typeof e!="object")throw new Error(`${t} requires an id and content hash.`);let s=e;if(typeof s.id!="string"||typeof s.contentHash!="string")throw new Error(`${t} requires an id and content hash.`);return{id:s.id,contentHash:s.contentHash}}o(Ye,"parseHarnessReleaseRef");function Et(e){if(!e||typeof e!="object")throw new Error("Harness release diff requires a workspace and target release.");let t=e;if(typeof t.workspaceId!="string")throw new Error("Harness release diff requires a workspace and target release.");return{workspaceId:t.workspaceId,baseRelease:t.baseRelease===null?null:Ye(t.baseRelease,"Harness base release"),targetRelease:Ye(t.targetRelease,"Harness target release")}}o(Et,"parseHarnessReleaseDiffRequest");function bt(e){if(!e||typeof e!="object")throw new Error("Harness rollback requires a workspace and target release.");let t=e,s=t.targetRelease;if(typeof t.workspaceId!="string"||!s||typeof s!="object")throw new Error("Harness rollback requires a workspace and target release.");let r=s;if(typeof r.id!="string"||typeof r.contentHash!="string")throw new Error("Harness rollback target requires an id and content hash.");return{workspaceId:t.workspaceId,targetRelease:{id:r.id,contentHash:r.contentHash}}}o(bt,"parseHarnessRollbackRequest");function St(e){if(!e||typeof e!="object")throw new Error("Harness review requires a workspace, proposal, and decision.");let t=e,s=t.proposal;if(typeof t.workspaceId!="string"||t.decision!=="approve"&&t.decision!=="decline"||!s||typeof s!="object")throw new Error("Harness review requires a workspace, proposal, and decision.");let r=s;if(typeof r.id!="string"||typeof r.contentHash!="string")throw new Error("Harness proposal review requires an id and content hash.");return{workspaceId:t.workspaceId,proposal:{id:r.id,contentHash:r.contentHash},decision:t.decision}}o(St,"parseHarnessProposalReviewRequest");async function U(e){let t=await e.getSelectedHarnessWorkspace({ownerKind:"personal",ownerId:te});if(!t)return{workspace:null,backgroundReview:{enabled:!0,updatedAt:null},evaluationReviewSchedule:{enabled:!1,activityEnabled:!1,activityBatchSize:10,cadence:"manual",maxEstimatedCostUsd:0,nextRunAt:null,lastRunAt:null,lastResult:null,lastError:null,updatedAt:null},releases:[],changes:[],routes:[],evaluationReviews:[],refinementCandidates:[],modelImprovementQualifications:[],pendingReviews:[],memories:[]};let[s,r,i,u,c,d,m,H,b,l,a,p,f]=await Promise.all([e.getHarnessBackgroundReviewSettings(t.id),e.getHarnessEvaluationReviewSettings(t.id),e.listHarnessReleaseRecords(t.id),e.listHarnessAdvanceReceipts(t.id),e.listHarnessImprovementArtifacts(t.id,"proposal",1e3),e.listHarnessImprovementArtifacts(t.id,"targeted_validation",1e3),e.listHarnessImprovementArtifacts(t.id,"route_decision",1e3),e.listHarnessImprovementArtifacts(t.id,"evaluation_review",1e3),e.listHarnessRefinementCandidates(t.id),e.listHarnessImprovementArtifacts(t.id,"training_qualification",1e3),e.listHarnessImprovementArtifacts(t.id,"apply_receipt",1e3),e.listHarnessImprovementArtifacts(t.id,"refiner_outcome",1e3),e.listHarnessImprovementArtifacts(t.id,"trigger_decision",1e3)]),R=c,A=d,w=m,T=a,M=p,F=f,$=u.slice().reverse().map(g=>{let v=g.proposal?R.find(E=>E.id===g.proposal.id&&E.contentHash===g.proposal.contentHash)??null:null,_=v?M.find(E=>E.proposal?.id===v.id&&E.proposal.contentHash===v.contentHash)??null:null,I=_?F.find(E=>E.id===_.trigger.id&&E.contentHash===_.trigger.contentHash)??null:null;return{receipt:g,proposal:v,validations:v?A.filter(E=>E.proposal.id===v.id&&E.proposal.contentHash===v.contentHash):[],routeDecision:v?w.find(E=>E.metadata.proposalId===v.id)??null:null,applyReceipt:v?T.find(E=>E.proposal.id===v.id&&E.proposal.contentHash===v.contentHash)??null:null,outcome:_,trigger:I}}),Y=new Set($.flatMap(g=>g.routeDecision?[g.routeDecision.id]:[])),W=w.filter(g=>!Y.has(g.id)).map(g=>{let v=F.find(I=>I.id===g.trigger.id&&I.contentHash===g.trigger.contentHash)??null,_=M.find(I=>I.trigger.id===g.trigger.id&&I.trigger.contentHash===g.trigger.contentHash)??null;return{decision:g,trigger:v,outcome:_}}),O=R.reduce((g,v)=>{let I=T.filter(x=>x.proposal.id===v.id&&x.proposal.contentHash===v.contentHash).sort((x,Z)=>Z.createdAt.localeCompare(x.createdAt))[0]??null;if(!I||I.decision!=="retained")return g;let E=M.find(x=>x.proposal?.id===v.id&&x.proposal.contentHash===v.contentHash)??null,S=E?F.find(x=>x.id===E.trigger.id&&x.contentHash===E.trigger.contentHash)??null:null;return g.push({proposal:v,validations:A.filter(x=>x.proposal.id===v.id&&x.proposal.contentHash===v.contentHash),applyReceipt:I,outcome:E,trigger:S}),g},[]);return{workspace:t,backgroundReview:s,evaluationReviewSchedule:r,releases:i.map(g=>({id:g.harnessRelease.id,contentHash:g.harnessRelease.contentHash,sourceRevision:g.sourceRevision,createdAt:g.createdAt,current:t.currentChannel.release?.contentHash===g.harnessRelease.contentHash,files:g.harnessRelease.files.map(v=>({id:v.id,path:v.path,contentHash:v.contentHash,sizeBytes:v.sizeBytes,mediaType:v.mediaType}))})),changes:$,routes:W,evaluationReviews:H,refinementCandidates:b,modelImprovementQualifications:l,pendingReviews:O,memories:await e.listHarnessMemories(t.id)}}o(U,"localHarnessHistoryPayload");async function At(e){let t=await e.store.getHarnessEvaluationReviewSettings(e.request.workspaceId),s=await le({store:e.store,storeDir:e.storeDir,workspaceId:e.request.workspaceId,maxEstimatedCostUsd:e.request.maxEstimatedCostUsd??t.maxEstimatedCostUsd,stream:e.stream}),r=new Date().toISOString();return await e.store.setHarnessEvaluationReviewSettings({workspaceId:e.request.workspaceId,settings:{...t,lastRunAt:r,lastResult:{id:s.id,contentHash:s.contentHash,classification:s.classification},lastError:null,updatedAt:r}}),{receipt:s,history:await U(e.store)}}o(At,"reviewLocalHarnessEvaluationFromSettings");async function Ct(e){let t=await e.store.getHarnessWorkspace(e.request.workspaceId);if(!t||t.ownerScope.kind!=="personal"||t.location!=="local")throw new Error("Evaluation review schedule requires the selected Personal Local Harness.");if((await e.store.getSelectedHarnessWorkspace({ownerKind:"personal",ownerId:te}))?.id!==t.id)throw new Error("Evaluation review schedule requires the selected Personal Local Harness.");let r=await e.store.getHarnessEvaluationReviewSettings(t.id),i=new Date().toISOString(),u=e.request.enabled&&e.request.cadence!=="manual";return await e.store.setHarnessEvaluationReviewSettings({workspaceId:t.id,settings:{...r,enabled:u,activityEnabled:e.request.activityEnabled,activityBatchSize:e.request.activityBatchSize,cadence:e.request.cadence,maxEstimatedCostUsd:e.request.maxEstimatedCostUsd,nextRunAt:u?Re(e.request.cadence,i):null,lastError:null,updatedAt:i}}),{history:await U(e.store)}}o(Ct,"updateLocalHarnessEvaluationReviewScheduleFromSettings");async function It(e){let t=await e.store.getHarnessWorkspace(e.request.workspaceId);if(!t||t.ownerScope.kind!=="personal"||t.location!=="local")throw new Error("Background review settings require the selected Personal Local Harness.");return await e.store.setHarnessBackgroundReviewSettings({workspaceId:t.id,enabled:e.request.enabled,updatedAt:new Date().toISOString()}),{history:await U(e.store)}}o(It,"updateLocalHarnessBackgroundReviewFromSettings");async function Ze(e){let t=await e.store.getHarnessReleaseRecord(e.release.contentHash);if(!t||t.workspaceId!==e.workspaceId||t.harnessRelease.id!==e.release.id||t.harnessRelease.contentHash!==e.release.contentHash)throw new Error(`${e.label} is unavailable or hash-mismatched.`);return t}o(Ze,"requireHarnessReleaseRecord");function Ge(e,t){let s=ge.resolve(e.bundlePath,"source"),r=ge.resolve(s,...t.split("/"));if(r!==s&&!r.startsWith(`${s}${ge.sep}`))throw new Error(`Harness release contains an unsafe file path: ${t}.`);return r}o(Ge,"releaseSourcePath");function xt(e){return e.patch.split(`
|
|
5
5
|
`).map(t=>t.startsWith("diff --git ")?`diff --git a/${e.filePath} b/${e.filePath}`:t.startsWith("--- ")?e.baseExists?`--- a/${e.filePath}`:"--- /dev/null":t.startsWith("+++ ")?e.targetExists?`+++ b/${e.filePath}`:"+++ /dev/null":t).join(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as I,b as v}from"./chunk-GLUWATL5.js";import{E as L,F as E}from"./chunk-I7AQMAQI.js";import{f as x}from"./chunk-H7IWJN7L.js";import{a}from"./chunk-FTQLQJQV.js";var T=class extends Error{constructor(t,e){super(`API request timed out after ${t}ms: ${e}`);this.timeoutMs=t;this.requestUrl=e;this.name="ApiTimeoutError"}timeoutMs;requestUrl;static{a(this,"ApiTimeoutError")}code="OPENPOND_API_TIMEOUT"},w=class extends Error{constructor(t,e){super(`API response exceeded ${t} bytes: ${e}`);this.maximumBytes=t;this.requestUrl=e;this.name="ApiResponseTooLargeError"}maximumBytes;requestUrl;static{a(this,"ApiResponseTooLargeError")}code="OPENPOND_API_RESPONSE_TOO_LARGE"},O=class extends Error{constructor(t,e,o,r=null){let c=r||e;super(`${o} failed: ${t}${c?` ${c}`:""}`);this.status=t;this.apiMessage=r;this.name="OpenPondApiError",this.code=e||"OPENPOND_API_ERROR"}status;apiMessage;static{a(this,"OpenPondApiError")}code};async function i(s,n,t,e={}){let{timeoutMs:o=3e4,maxResponseBytes:r=8388608,explicitBearerAuth:c=!1,...p}=e,d=`${s}${t}`,m=new Headers(p.headers);m.set("Content-Type","application/json");let g=c?void 0:process.env.OPENPOND_API_KEY,h=n?.trim()||"",u=!c&&h.startsWith("opk_"),S=g||(u?h:null);S&&!m.has("openpond-api-key")&&m.set("openpond-api-key",S),n?m.set("Authorization",u?`ApiKey ${h}`:`Bearer ${n}`):g&&!m.has("Authorization")&&m.set("Authorization",`ApiKey ${g}`);let y=new AbortController,f=new T(o,d),R=o>0?setTimeout(()=>y.abort(f),o):null;R?.unref?.();let P=U(p.signal,y.signal,o),k=a(()=>{R&&clearTimeout(R)},"cleanup");try{let A=await fetch(d,{...p,headers:m,signal:P});return C(A,{cleanup:k,maximumBytes:r,requestUrl:d,timeoutController:y,timeoutError:f})}catch(A){throw k(),y.signal.aborted?f:A}}a(i,"apiFetch");async function l(s,n){let t;try{let e=await s.text();t=e?JSON.parse(e):{}}catch(e){if(e instanceof T||e instanceof w)throw e;t={}}if(!s.ok){let e=typeof t.error=="string"?t.error:null,o=typeof t.message=="string"?t.message:null;throw new O(s.status,e,n,o)}return t}a(l,"readApiJson");function C(s,n){if(!s.body)return n.cleanup(),s;let t=Number(s.headers.get("content-length"));if(n.maximumBytes>0&&Number.isFinite(t)&&t>n.maximumBytes)throw n.cleanup(),s.body.cancel(),new w(n.maximumBytes,n.requestUrl);let e=s.body.getReader(),o=0,r=new ReadableStream({async pull(c){try{let p=await e.read();if(p.done){n.cleanup(),c.close();return}if(o+=p.value.byteLength,n.maximumBytes>0&&o>n.maximumBytes){n.cleanup(),await e.cancel(),c.error(new w(n.maximumBytes,n.requestUrl));return}c.enqueue(p.value)}catch(p){n.cleanup(),c.error(n.timeoutController.signal.aborted?n.timeoutError:p)}},async cancel(c){n.cleanup(),await e.cancel(c)}});return new Response(r,{headers:s.headers,status:s.status,statusText:s.statusText})}a(C,"boundedResponse");function U(s,n,t){return t<=0?s??void 0:s?AbortSignal.any([s,n]):n}a(U,"composedSignal");async function _(s,n,t,e,o){let r=await i(s,n,`/v4/apps/${t}/commits`,{method:"POST",body:JSON.stringify({files:e,message:o})});if(!r.ok){let c=await r.text().catch(()=>"");throw new Error(`Commit failed: ${r.status} ${c}`)}return await r.json()}a(_,"commitFiles");async function j(s,n,t,e){let o=e?.environment??"production",r=await i(s,n,`/v4/apps/${t}/deployments`,{method:"POST",body:JSON.stringify({environment:o,...e?.commitSha?{commitSha:e.commitSha}:{},...e?.branch?{branch:e.branch}:{}})});if(!r.ok){let c=await r.text().catch(()=>"");throw new Error(`Deploy failed: ${r.status} ${c}`)}return await r.json()}a(j,"deployApp");async function B(s,n,t,e){let o=await i(s,n,`/v4/apps/${encodeURIComponent(t)}/deployments/promote-preview`,{method:"POST",body:JSON.stringify(e)});return l(o,"Preview promotion")}a(B,"promotePreviewToProduction");async function G(s,n,t,e){let o=await i(s,n,`/v1/apps/${encodeURIComponent(t)}/lifecycle/start`,{method:"POST",body:JSON.stringify(e)});return l(o,"App lifecycle start")}a(G,"startAppLifecycle");async function M(s,n,t){let e=await i(s,n,`/apps/deployments/${t}/logs`,{method:"GET"});if(!e.ok){let c=await e.text().catch(()=>"");throw new Error(`Deployment logs failed: ${e.status} ${c}`)}let o=await e.json().catch(()=>({}));return(Array.isArray(o.logs)?o.logs:[]).map(c=>{let p=typeof c.createdAt=="string"?c.createdAt:c.createdAt instanceof Date?c.createdAt.toISOString():new Date().toISOString();return{id:typeof c.id=="string"?c.id:`${Math.random()}`,type:typeof c.type=="string"?c.type:void 0,message:typeof c.message=="string"?c.message:"",createdAt:p}})}a(M,"getDeploymentLogs");async function J(s,n,t){let e=await i(s,n,`/apps/deployments/${t}/status`,{method:"GET"});if(!e.ok){let r=await e.text().catch(()=>"");throw new Error(`Deployment status failed: ${e.status} ${r}`)}return{status:(await e.json().catch(()=>({}))).deployment?.status}}a(J,"getDeploymentStatus");async function H(s,n,t,e){let o=new URLSearchParams;e?.status&&e.status.length>0&&o.set("status",e.status.join(",")),e?.createdAfter&&o.set("createdAfter",e.createdAfter),e?.branch&&o.set("branch",e.branch);let r=o.toString(),c=await i(s,n,`/apps/${t}/deployments/latest${r?`?${r}`:""}`,{method:"GET"});if(!c.ok){let d=await c.text().catch(()=>"");throw new Error(`Latest deployment lookup failed: ${c.status} ${d}`)}let p=await c.json().catch(()=>({}));return p.deployment?{id:p.deployment.id,status:p.deployment.status}:null}a(H,"getLatestDeploymentForApp");async function F(s,n,t){let e=await i(s,n,`/apps/deployments/${t}`,{method:"GET"});if(!e.ok){let r=await e.text().catch(()=>"");throw new Error(`Deployment fetch failed: ${e.status} ${r}`)}return(await e.json().catch(()=>({}))).deployment??null}a(F,"getDeploymentDetail");var V=new URL(v).hostname,D=new URL(I).hostname;async function ae(s,n,t){let e=new URLSearchParams;t?.handle&&e.set("handle",t.handle),typeof t?.limit=="number"&&Number.isFinite(t.limit)&&e.set("limit",String(Math.max(1,Math.floor(t.limit)))),typeof t?.offset=="number"&&Number.isFinite(t.offset)&&e.set("offset",String(Math.max(0,Math.floor(t.offset)))),typeof t?.includeScheduled=="boolean"&&e.set("includeScheduled",t.includeScheduled?"true":"false");let o=e.toString(),r=await i(s,n,`/apps/list${o?`?${o}`:""}`,{method:"GET"});if(!r.ok){let p=await r.text().catch(()=>"");throw new Error(`Apps list failed: ${r.status} ${p}`)}let c=await r.json().catch(()=>({}));return Array.isArray(c.apps)?c.apps:[]}a(ae,"listApps");async function ie(s,n,t){let e=await i(s,n,"/api/projects/local",{method:"POST",body:JSON.stringify(t)});if(!e.ok){let o=await e.text().catch(()=>"");throw new Error(`Create project failed: ${e.status} ${o}`)}return await e.json()}a(ie,"createLocalProject");async function ce(s,n,t){let e=await i(s,n,"/apps/repo/create",{method:"POST",body:JSON.stringify(t)});if(!e.ok){let o=await e.text().catch(()=>"");throw new Error(`Repo create failed: ${e.status} ${o}`)}return await e.json()}a(ce,"createRepo");async function pe(s,n,t,e){let o=await i(s,n,`/apps/${encodeURIComponent(t)}/code-visibility`,{method:"PATCH",body:JSON.stringify({codeVisibility:e})});if(!o.ok){let r=await o.text().catch(()=>"");throw new Error(`Code visibility update failed: ${o.status} ${r}`)}return await o.json()}a(pe,"updateAppCodeVisibility");async function ue(s,n,t,e){let o=await i(s,n,"/v4/apps/headless",{method:"POST",body:JSON.stringify({items:t,...e?{teamId:e}:{}})});if(!o.ok){let r=await o.text().catch(()=>"");throw new Error(`Headless create failed: ${o.status} ${r}`)}return await o.json()}a(ue,"createHeadlessApps");async function le(s,n,t){let e=await i(s,n,`/v4/apps/${t}/template/status`,{method:"GET"});if(!e.ok){let o=await e.text().catch(()=>"");throw new Error(`Template status failed: ${e.status} ${o}`)}return await e.json()}a(le,"getTemplateStatus");async function de(s,n,t){let e=await i(s,n,`/v4/apps/${t}/template/branches`,{method:"GET"});if(!e.ok){let o=await e.text().catch(()=>"");throw new Error(`Template branches failed: ${e.status} ${o}`)}return await e.json()}a(de,"listTemplateBranches");async function me(s,n,t,e){let o=await i(s,n,`/v4/apps/${t}/template/deploy-latest`,{method:"POST",body:JSON.stringify(e)});if(!o.ok){let r=await o.text().catch(()=>"");throw new Error(`Template deploy failed: ${o.status} ${r}`)}return await o.json()}a(me,"deployLatestTemplate");async function ge(s,n,t,e){let o=await i(s,n,`/v4/apps/${t}/environment`,{method:"POST",body:JSON.stringify(e)});if(!o.ok){let r=await o.text().catch(()=>"");throw new Error(`Environment update failed: ${o.status} ${r}`)}return await o.json()}a(ge,"updateAppEnvironment");async function he(s,n,t){let e=await i(s,n,`/v4/apps/${t}/environment`,{method:"GET"});if(!e.ok){let o=await e.text().catch(()=>"");throw new Error(`Environment get failed: ${e.status} ${o}`)}return await e.json()}a(he,"getAppEnvironment");async function ye(s,n){let t=await i(s,n,"/api/tools/manifest",{method:"GET"});if(!t.ok){let e=await t.text().catch(()=>"");throw new Error(`Manifest fetch failed: ${t.status} ${e}`)}return await t.json()}a(ye,"fetchToolManifest");async function fe(s,n){let t=await i(s,n,"/apps/tools",{method:"GET"});if(!t.ok){let e=await t.text().catch(()=>"");throw new Error(`Tools lookup failed: ${t.status} ${e}`)}return await t.json()}a(fe,"listUserTools");async function Re(s,n,t){let e=await i(s,n,`/apps/${encodeURIComponent(t)}/schedules`,{method:"GET"});if(!e.ok){let r=await e.text().catch(()=>"");throw new Error(`Schedules lookup failed: ${e.status} ${r}`)}let o=await e.json().catch(()=>({}));return{schedules:Array.isArray(o.schedules)?o.schedules:[]}}a(Re,"listAppSchedules");async function we(s,n,t={}){let e=new URLSearchParams;t.domain&&e.set("domain",t.domain),t.opentoolVersion&&e.set("opentoolVersion",t.opentoolVersion),typeof t.limit=="number"&&e.set("limit",String(t.limit));for(let c of t.tags??[])e.append("tag",c);let o=e.toString(),r=await i(s,n,`/v1/opentool/recipes${o?`?${o}`:""}`,{method:"GET"});return l(r,"OpenTool recipe list")}a(we,"listOpenToolRecipes");async function Se(s,n,t){let e=await i(s,n,"/v1/opentool/recipes/search",{method:"POST",body:JSON.stringify(t)});return l(e,"OpenTool recipe search")}a(Se,"searchOpenToolRecipes");async function xe(s,n,t){let e=new URLSearchParams;typeof t.includeExamples=="boolean"&&e.set("includeExamples",String(t.includeExamples)),typeof t.includeTests=="boolean"&&e.set("includeTests",String(t.includeTests)),t.opentoolVersion&&e.set("opentoolVersion",t.opentoolVersion);let o=e.toString(),r=await i(s,n,`/v1/opentool/recipes/${encodeURIComponent(t.id)}${o?`?${o}`:""}`,{method:"GET"});return l(r,"OpenTool recipe get")}a(xe,"getOpenToolRecipe");async function Te(s,n,t){let e=await i(s,n,"/v1/opentool/rules",{method:"POST",body:JSON.stringify(t)});return l(e,"OpenTool rules get")}a(Te,"getOpenToolRules");function b(s){let n=new URLSearchParams;typeof s=="number"&&Number.isFinite(s)&&n.set("limit",String(Math.max(1,Math.floor(s))));let t=n.toString();return t?`?${t}`:""}a(b,"buildLimitQuery");function N(s){if(Array.isArray(s))return s;if(!s||typeof s!="object")return[];let n=s;return Array.isArray(n.logs)?n.logs:Array.isArray(n.runs)?n.runs:Array.isArray(n.scheduleRuns)?n.scheduleRuns:Array.isArray(n.items)?n.items:[]}a(N,"normalizeScheduleExecutionLogs");async function Pe(s,n,t,e){let o={...e?.preferredScheduleId?{preferredScheduleId:e.preferredScheduleId}:{},...e?.scheduleId?{scheduleId:e.scheduleId}:{},...e?.startAt?{startAt:e.startAt}:{},...e&&"endAt"in e?{endAt:e.endAt??null}:{}},r=await i(s,n,`/apps/${encodeURIComponent(t)}/schedules/start`,{method:"POST",body:JSON.stringify(o)});return l(r,"Schedule start")}a(Pe,"startAppSchedules");async function Ae(s,n,t){let e=await i(s,n,`/apps/${encodeURIComponent(t)}/schedules/stop`,{method:"POST",body:JSON.stringify({})});return l(e,"Schedule stop")}a(Ae,"stopAppSchedules");async function Ee(s,n){let t=await i(s,n,"/apps/schedules/current/stop",{method:"POST",body:JSON.stringify({})});return l(t,"Current schedule stop")}a(Ee,"stopCurrentAppSchedules");async function Oe(s,n,t){let e=await i(s,n,"/v1/schedules/run",{method:"POST",body:JSON.stringify({scheduleId:t.scheduleId})});return l(e,"Schedule run")}a(Oe,"runScheduleNow");async function be(s,n,t,e){let o=await i(s,n,`/apps/${encodeURIComponent(t)}/schedules/${encodeURIComponent(e)}`,{method:"DELETE"});return l(o,"Schedule delete")}a(be,"deleteOrArchiveSchedule");async function $e(s,n,t,e){let o=await i(s,n,`/v1/schedules/${encodeURIComponent(t)}/execution-logs${b(e?.limit)}`,{method:"GET"}),r=await l(o,"Schedule execution logs");return{logs:N(r)}}a($e,"listScheduleExecutionLogs");async function ke(s,n,t,e){let o=await i(s,n,`/v1/deployments/${encodeURIComponent(t)}/schedule-execution-logs${b(e?.limit)}`,{method:"GET"}),r=await l(o,"Deployment schedule execution logs");return{logs:N(r)}}a(ke,"listDeploymentScheduleExecutionLogs");async function Le(s,n,t){let e=await i(s,n,`/v1/schedule-execution-logs/${encodeURIComponent(t)}`,{method:"GET"});return l(e,"Schedule execution log")}a(Le,"getScheduleExecutionLog");async function Ie(s,n,t,e){let o=await i(s,n,`/v1/apps/${encodeURIComponent(t)}/execution-timeline${b(e?.limit)}`,{method:"GET"});return l(o,"App execution timeline")}a(Ie,"getAppExecutionTimeline");async function ve(s,n,t){return i(s,n,"/apps/agent/create",{method:"POST",body:JSON.stringify(t)})}a(ve,"createAgentFromPrompt");async function De(s,n,t){let e=new URLSearchParams;t?.appId&&e.set("appId",t.appId);let o=e.toString(),r=await i(s,n,`/apps/performance${o?`?${o}`:""}`,{method:"GET"});if(!r.ok){let c=await r.text().catch(()=>"");throw new Error(`Performance lookup failed: ${r.status} ${c}`)}return await r.json()}a(De,"getUserPerformance");async function Ne(s,n,t){let e=new URLSearchParams({appId:t}),o=await i(s,n,`/apps/summary?${e.toString()}`,{method:"GET"});if(!o.ok){let r=await o.text().catch(()=>"");throw new Error(`Summary lookup failed: ${o.status} ${r}`)}return await o.json()}a(Ne,"getAppRuntimeSummary");async function z(s,n){let t=await i(s,n,"/v1/account",{method:"GET"});if(!t.ok){let e=await t.text().catch(()=>"");throw new Error(`Account lookup failed: ${t.status} ${e}`)}return await t.json()}a(z,"getOpenPondAccount");async function qe(s,n){let t=new Date().toISOString(),e=Date.now(),o=s.replace(/\/$/,"");try{let r=await i(o,null,"/health",{method:"GET",headers:{Accept:"application/json"}}),c=Date.now()-e,p=await r.json().catch(()=>({})),d=null,m=null;if(n?.trim())try{let g=await z(o,n);d=!0,m=g.account}catch{d=!1}return{reachable:r.ok,authenticated:d,apiBase:o,latencyMs:c,status:r.status,service:typeof p.service=="string"?p.service:null,checkedAt:t,account:m,...r.ok?{}:{error:r.statusText||`HTTP ${r.status}`}}}catch(r){return{reachable:!1,authenticated:n?.trim()?!1:null,apiBase:o,latencyMs:Date.now()-e,status:null,service:null,checkedAt:t,error:r instanceof Error?r.message:String(r)}}}a(qe,"checkOpenPondApiHealth");async function Ce(s,n,t){let e=await i(s,n,"/apps/assistant/run",{method:"POST",body:JSON.stringify(t)});if(!e.ok){let o=await e.text().catch(()=>"");throw new Error(`Assistant run failed: ${e.status} ${o}`)}return await e.json()}a(Ce,"runAssistantMode");async function Ue(s,n,t){let e=await i(s,n,"/apps/agent/digest",{method:"POST",body:JSON.stringify(t)});if(!e.ok){let o=await e.text().catch(()=>"");throw new Error(`Agent digest failed: ${e.status} ${o}`)}return await e.json()}a(Ue,"postAgentDigest");async function _e(s,n,t){let e=await i(s,n,"/apps/tools/execute",{method:"POST",body:JSON.stringify(t)}),o=await e.text().catch(()=>""),r=null;try{r=o?JSON.parse(o):null}catch{r=o}return e.ok?{ok:!0,status:e.status,data:r}:{ok:!1,status:e.status,error:r&&typeof r=="object"&&"error"in r?String(r.error):o||e.statusText}}a(_e,"executeUserTool");async function je(s,n,t){let e=await i(s,n,"/apps/backtests/run",{method:"POST",body:JSON.stringify(t)});if(!e.ok){let o=await e.text().catch(()=>"");throw new Error(`Backtest run failed: ${e.status} ${o}`)}return await e.json()}a(je,"submitBacktestRun");async function Be(s,n,t){let e=t.query&&Object.keys(t.query).length>0?`?${new URLSearchParams(t.query).toString()}`:"",o=await i(s,n,`/apps/backtests/tx${e}`,{method:t.method,body:t.method==="POST"&&t.body!==void 0?JSON.stringify(t.body):void 0});if(!o.ok){let r=await o.text().catch(()=>"");throw new Error(`Backtests request failed: ${o.status} ${r}`)}return await o.json()}a(Be,"submitBacktestTx");async function Ge(s,n,t){let e=new URLSearchParams(t).toString(),o=await i(s,n,`/apps/backtests/detail?${e}`,{method:"GET"});if(!o.ok){let r=await o.text().catch(()=>"");throw new Error(`Backtest detail failed: ${o.status} ${r}`)}return await o.json()}a(Ge,"submitBacktestDetail");function K(s){let n=s.trim().replace(/^\/+/,"");return encodeURIComponent(n||"tool")}a(K,"normalizeToolPathSegment");function W(s){let n=s.replace(/\/$/,""),t=process.env.OPENPOND_TOOL_URL;if(t)return t.replace(/\/$/,"");try{let e=new URL(n),o=e.hostname.toLowerCase(),r=o==="apps.openpond.live"?null:o===V||o===D||o===`www.${D}`||o==="openpond.live"||o==="www.openpond.live"?"https://apps.openpond.live":null;if(r)return r;let c=o==="localhost"||o==="127.0.0.1",p=e.port||(e.protocol==="https:"?"443":"80");if(c&&p==="3000")return n}catch{}return n}a(W,"resolveWorkerBaseUrl");async function Me(s,n,t){let e=W(s),o=K(t.toolName),c=`${t.deploymentId?`/${t.appId}/deployments/${t.deploymentId}`:`/${t.appId}`}/${o}`,p=new Headers(t.headers||{}),d=t.method??"POST",m=t.body===void 0||d==="GET"?void 0:JSON.stringify(t.body),g=await i(e,n,c,{method:d,body:m,headers:p}),h=await g.text().catch(()=>""),u=null;try{u=h?JSON.parse(h):null}catch{u=h}let S=u&&typeof u=="object"&&"ok"in u?!!u.ok:!0,y=g.ok&&S,f=u&&typeof u=="object"&&"status"in u&&Number(u.status)||g.status,R=u&&typeof u=="object"&&"error"in u?String(u.error):g.ok?void 0:h||g.statusText,P=u&&typeof u=="object"&&"data"in u?u.data:u;return{ok:y,status:f,data:P,error:R}}a(Me,"executeHostedTool");import{createHash as Y}from"node:crypto";var X=3600*1e3;function $(s){return Y("sha256").update(JSON.stringify([s.apiBase.replace(/\/$/,""),s.apiKey.trim()])).digest("hex")}a($,"buildCacheKey");async function q(s,n){let t=await L(x(),s,$(n),{allowStale:!0});return!t||Date.now()-Date.parse(t.updatedAt)>=(n.ttlMs??X)?null:t.payload}a(q,"cached");async function Ye(s){return q("cloud.apps",s)}a(Ye,"getCachedApps");async function Xe(s){await E(x(),"cloud.apps",$(s),s.apps)}a(Xe,"setCachedApps");async function Qe(s){return q("cloud.tools",s)}a(Qe,"getCachedTools");async function Ze(s){await E(x(),"cloud.tools",$(s),s.tools)}a(Ze,"setCachedTools");var it=["openpond-generic-v1","openpond-work-v1","openpond-coding-core-v1","openpond-agent-harness-v1"];export{i as a,_ as b,j as c,B as d,G as e,M as f,J as g,H as h,F as i,ae as j,ie as k,ce as l,pe as m,ue as n,le as o,de as p,me as q,ge as r,he as s,ye as t,fe as u,Re as v,we as w,Se as x,xe as y,Te as z,Pe as A,Ae as B,Ee as C,Oe as D,be as E,$e as F,ke as G,Le as H,Ie as I,ve as J,De as K,Ne as L,z as M,qe as N,Ce as O,Ue as P,_e as Q,je as R,Be as S,Ge as T,W as U,Me as V,X as W,Ye as X,Xe as Y,Qe as Z,Ze as _,it as $};
|
|
2
|
+
import{a as I,b as v}from"./chunk-GLUWATL5.js";import{E as L,F as E}from"./chunk-MNC4YUDI.js";import{f as x}from"./chunk-H7IWJN7L.js";import{a}from"./chunk-FTQLQJQV.js";var T=class extends Error{constructor(t,e){super(`API request timed out after ${t}ms: ${e}`);this.timeoutMs=t;this.requestUrl=e;this.name="ApiTimeoutError"}timeoutMs;requestUrl;static{a(this,"ApiTimeoutError")}code="OPENPOND_API_TIMEOUT"},w=class extends Error{constructor(t,e){super(`API response exceeded ${t} bytes: ${e}`);this.maximumBytes=t;this.requestUrl=e;this.name="ApiResponseTooLargeError"}maximumBytes;requestUrl;static{a(this,"ApiResponseTooLargeError")}code="OPENPOND_API_RESPONSE_TOO_LARGE"},O=class extends Error{constructor(t,e,o,r=null){let c=r||e;super(`${o} failed: ${t}${c?` ${c}`:""}`);this.status=t;this.apiMessage=r;this.name="OpenPondApiError",this.code=e||"OPENPOND_API_ERROR"}status;apiMessage;static{a(this,"OpenPondApiError")}code};async function i(s,n,t,e={}){let{timeoutMs:o=3e4,maxResponseBytes:r=8388608,explicitBearerAuth:c=!1,...p}=e,d=`${s}${t}`,m=new Headers(p.headers);m.set("Content-Type","application/json");let g=c?void 0:process.env.OPENPOND_API_KEY,h=n?.trim()||"",u=!c&&h.startsWith("opk_"),S=g||(u?h:null);S&&!m.has("openpond-api-key")&&m.set("openpond-api-key",S),n?m.set("Authorization",u?`ApiKey ${h}`:`Bearer ${n}`):g&&!m.has("Authorization")&&m.set("Authorization",`ApiKey ${g}`);let y=new AbortController,f=new T(o,d),R=o>0?setTimeout(()=>y.abort(f),o):null;R?.unref?.();let P=U(p.signal,y.signal,o),k=a(()=>{R&&clearTimeout(R)},"cleanup");try{let A=await fetch(d,{...p,headers:m,signal:P});return C(A,{cleanup:k,maximumBytes:r,requestUrl:d,timeoutController:y,timeoutError:f})}catch(A){throw k(),y.signal.aborted?f:A}}a(i,"apiFetch");async function l(s,n){let t;try{let e=await s.text();t=e?JSON.parse(e):{}}catch(e){if(e instanceof T||e instanceof w)throw e;t={}}if(!s.ok){let e=typeof t.error=="string"?t.error:null,o=typeof t.message=="string"?t.message:null;throw new O(s.status,e,n,o)}return t}a(l,"readApiJson");function C(s,n){if(!s.body)return n.cleanup(),s;let t=Number(s.headers.get("content-length"));if(n.maximumBytes>0&&Number.isFinite(t)&&t>n.maximumBytes)throw n.cleanup(),s.body.cancel(),new w(n.maximumBytes,n.requestUrl);let e=s.body.getReader(),o=0,r=new ReadableStream({async pull(c){try{let p=await e.read();if(p.done){n.cleanup(),c.close();return}if(o+=p.value.byteLength,n.maximumBytes>0&&o>n.maximumBytes){n.cleanup(),await e.cancel(),c.error(new w(n.maximumBytes,n.requestUrl));return}c.enqueue(p.value)}catch(p){n.cleanup(),c.error(n.timeoutController.signal.aborted?n.timeoutError:p)}},async cancel(c){n.cleanup(),await e.cancel(c)}});return new Response(r,{headers:s.headers,status:s.status,statusText:s.statusText})}a(C,"boundedResponse");function U(s,n,t){return t<=0?s??void 0:s?AbortSignal.any([s,n]):n}a(U,"composedSignal");async function _(s,n,t,e,o){let r=await i(s,n,`/v4/apps/${t}/commits`,{method:"POST",body:JSON.stringify({files:e,message:o})});if(!r.ok){let c=await r.text().catch(()=>"");throw new Error(`Commit failed: ${r.status} ${c}`)}return await r.json()}a(_,"commitFiles");async function j(s,n,t,e){let o=e?.environment??"production",r=await i(s,n,`/v4/apps/${t}/deployments`,{method:"POST",body:JSON.stringify({environment:o,...e?.commitSha?{commitSha:e.commitSha}:{},...e?.branch?{branch:e.branch}:{}})});if(!r.ok){let c=await r.text().catch(()=>"");throw new Error(`Deploy failed: ${r.status} ${c}`)}return await r.json()}a(j,"deployApp");async function B(s,n,t,e){let o=await i(s,n,`/v4/apps/${encodeURIComponent(t)}/deployments/promote-preview`,{method:"POST",body:JSON.stringify(e)});return l(o,"Preview promotion")}a(B,"promotePreviewToProduction");async function G(s,n,t,e){let o=await i(s,n,`/v1/apps/${encodeURIComponent(t)}/lifecycle/start`,{method:"POST",body:JSON.stringify(e)});return l(o,"App lifecycle start")}a(G,"startAppLifecycle");async function M(s,n,t){let e=await i(s,n,`/apps/deployments/${t}/logs`,{method:"GET"});if(!e.ok){let c=await e.text().catch(()=>"");throw new Error(`Deployment logs failed: ${e.status} ${c}`)}let o=await e.json().catch(()=>({}));return(Array.isArray(o.logs)?o.logs:[]).map(c=>{let p=typeof c.createdAt=="string"?c.createdAt:c.createdAt instanceof Date?c.createdAt.toISOString():new Date().toISOString();return{id:typeof c.id=="string"?c.id:`${Math.random()}`,type:typeof c.type=="string"?c.type:void 0,message:typeof c.message=="string"?c.message:"",createdAt:p}})}a(M,"getDeploymentLogs");async function J(s,n,t){let e=await i(s,n,`/apps/deployments/${t}/status`,{method:"GET"});if(!e.ok){let r=await e.text().catch(()=>"");throw new Error(`Deployment status failed: ${e.status} ${r}`)}return{status:(await e.json().catch(()=>({}))).deployment?.status}}a(J,"getDeploymentStatus");async function H(s,n,t,e){let o=new URLSearchParams;e?.status&&e.status.length>0&&o.set("status",e.status.join(",")),e?.createdAfter&&o.set("createdAfter",e.createdAfter),e?.branch&&o.set("branch",e.branch);let r=o.toString(),c=await i(s,n,`/apps/${t}/deployments/latest${r?`?${r}`:""}`,{method:"GET"});if(!c.ok){let d=await c.text().catch(()=>"");throw new Error(`Latest deployment lookup failed: ${c.status} ${d}`)}let p=await c.json().catch(()=>({}));return p.deployment?{id:p.deployment.id,status:p.deployment.status}:null}a(H,"getLatestDeploymentForApp");async function F(s,n,t){let e=await i(s,n,`/apps/deployments/${t}`,{method:"GET"});if(!e.ok){let r=await e.text().catch(()=>"");throw new Error(`Deployment fetch failed: ${e.status} ${r}`)}return(await e.json().catch(()=>({}))).deployment??null}a(F,"getDeploymentDetail");var V=new URL(v).hostname,D=new URL(I).hostname;async function ae(s,n,t){let e=new URLSearchParams;t?.handle&&e.set("handle",t.handle),typeof t?.limit=="number"&&Number.isFinite(t.limit)&&e.set("limit",String(Math.max(1,Math.floor(t.limit)))),typeof t?.offset=="number"&&Number.isFinite(t.offset)&&e.set("offset",String(Math.max(0,Math.floor(t.offset)))),typeof t?.includeScheduled=="boolean"&&e.set("includeScheduled",t.includeScheduled?"true":"false");let o=e.toString(),r=await i(s,n,`/apps/list${o?`?${o}`:""}`,{method:"GET"});if(!r.ok){let p=await r.text().catch(()=>"");throw new Error(`Apps list failed: ${r.status} ${p}`)}let c=await r.json().catch(()=>({}));return Array.isArray(c.apps)?c.apps:[]}a(ae,"listApps");async function ie(s,n,t){let e=await i(s,n,"/api/projects/local",{method:"POST",body:JSON.stringify(t)});if(!e.ok){let o=await e.text().catch(()=>"");throw new Error(`Create project failed: ${e.status} ${o}`)}return await e.json()}a(ie,"createLocalProject");async function ce(s,n,t){let e=await i(s,n,"/apps/repo/create",{method:"POST",body:JSON.stringify(t)});if(!e.ok){let o=await e.text().catch(()=>"");throw new Error(`Repo create failed: ${e.status} ${o}`)}return await e.json()}a(ce,"createRepo");async function pe(s,n,t,e){let o=await i(s,n,`/apps/${encodeURIComponent(t)}/code-visibility`,{method:"PATCH",body:JSON.stringify({codeVisibility:e})});if(!o.ok){let r=await o.text().catch(()=>"");throw new Error(`Code visibility update failed: ${o.status} ${r}`)}return await o.json()}a(pe,"updateAppCodeVisibility");async function ue(s,n,t,e){let o=await i(s,n,"/v4/apps/headless",{method:"POST",body:JSON.stringify({items:t,...e?{teamId:e}:{}})});if(!o.ok){let r=await o.text().catch(()=>"");throw new Error(`Headless create failed: ${o.status} ${r}`)}return await o.json()}a(ue,"createHeadlessApps");async function le(s,n,t){let e=await i(s,n,`/v4/apps/${t}/template/status`,{method:"GET"});if(!e.ok){let o=await e.text().catch(()=>"");throw new Error(`Template status failed: ${e.status} ${o}`)}return await e.json()}a(le,"getTemplateStatus");async function de(s,n,t){let e=await i(s,n,`/v4/apps/${t}/template/branches`,{method:"GET"});if(!e.ok){let o=await e.text().catch(()=>"");throw new Error(`Template branches failed: ${e.status} ${o}`)}return await e.json()}a(de,"listTemplateBranches");async function me(s,n,t,e){let o=await i(s,n,`/v4/apps/${t}/template/deploy-latest`,{method:"POST",body:JSON.stringify(e)});if(!o.ok){let r=await o.text().catch(()=>"");throw new Error(`Template deploy failed: ${o.status} ${r}`)}return await o.json()}a(me,"deployLatestTemplate");async function ge(s,n,t,e){let o=await i(s,n,`/v4/apps/${t}/environment`,{method:"POST",body:JSON.stringify(e)});if(!o.ok){let r=await o.text().catch(()=>"");throw new Error(`Environment update failed: ${o.status} ${r}`)}return await o.json()}a(ge,"updateAppEnvironment");async function he(s,n,t){let e=await i(s,n,`/v4/apps/${t}/environment`,{method:"GET"});if(!e.ok){let o=await e.text().catch(()=>"");throw new Error(`Environment get failed: ${e.status} ${o}`)}return await e.json()}a(he,"getAppEnvironment");async function ye(s,n){let t=await i(s,n,"/api/tools/manifest",{method:"GET"});if(!t.ok){let e=await t.text().catch(()=>"");throw new Error(`Manifest fetch failed: ${t.status} ${e}`)}return await t.json()}a(ye,"fetchToolManifest");async function fe(s,n){let t=await i(s,n,"/apps/tools",{method:"GET"});if(!t.ok){let e=await t.text().catch(()=>"");throw new Error(`Tools lookup failed: ${t.status} ${e}`)}return await t.json()}a(fe,"listUserTools");async function Re(s,n,t){let e=await i(s,n,`/apps/${encodeURIComponent(t)}/schedules`,{method:"GET"});if(!e.ok){let r=await e.text().catch(()=>"");throw new Error(`Schedules lookup failed: ${e.status} ${r}`)}let o=await e.json().catch(()=>({}));return{schedules:Array.isArray(o.schedules)?o.schedules:[]}}a(Re,"listAppSchedules");async function we(s,n,t={}){let e=new URLSearchParams;t.domain&&e.set("domain",t.domain),t.opentoolVersion&&e.set("opentoolVersion",t.opentoolVersion),typeof t.limit=="number"&&e.set("limit",String(t.limit));for(let c of t.tags??[])e.append("tag",c);let o=e.toString(),r=await i(s,n,`/v1/opentool/recipes${o?`?${o}`:""}`,{method:"GET"});return l(r,"OpenTool recipe list")}a(we,"listOpenToolRecipes");async function Se(s,n,t){let e=await i(s,n,"/v1/opentool/recipes/search",{method:"POST",body:JSON.stringify(t)});return l(e,"OpenTool recipe search")}a(Se,"searchOpenToolRecipes");async function xe(s,n,t){let e=new URLSearchParams;typeof t.includeExamples=="boolean"&&e.set("includeExamples",String(t.includeExamples)),typeof t.includeTests=="boolean"&&e.set("includeTests",String(t.includeTests)),t.opentoolVersion&&e.set("opentoolVersion",t.opentoolVersion);let o=e.toString(),r=await i(s,n,`/v1/opentool/recipes/${encodeURIComponent(t.id)}${o?`?${o}`:""}`,{method:"GET"});return l(r,"OpenTool recipe get")}a(xe,"getOpenToolRecipe");async function Te(s,n,t){let e=await i(s,n,"/v1/opentool/rules",{method:"POST",body:JSON.stringify(t)});return l(e,"OpenTool rules get")}a(Te,"getOpenToolRules");function b(s){let n=new URLSearchParams;typeof s=="number"&&Number.isFinite(s)&&n.set("limit",String(Math.max(1,Math.floor(s))));let t=n.toString();return t?`?${t}`:""}a(b,"buildLimitQuery");function N(s){if(Array.isArray(s))return s;if(!s||typeof s!="object")return[];let n=s;return Array.isArray(n.logs)?n.logs:Array.isArray(n.runs)?n.runs:Array.isArray(n.scheduleRuns)?n.scheduleRuns:Array.isArray(n.items)?n.items:[]}a(N,"normalizeScheduleExecutionLogs");async function Pe(s,n,t,e){let o={...e?.preferredScheduleId?{preferredScheduleId:e.preferredScheduleId}:{},...e?.scheduleId?{scheduleId:e.scheduleId}:{},...e?.startAt?{startAt:e.startAt}:{},...e&&"endAt"in e?{endAt:e.endAt??null}:{}},r=await i(s,n,`/apps/${encodeURIComponent(t)}/schedules/start`,{method:"POST",body:JSON.stringify(o)});return l(r,"Schedule start")}a(Pe,"startAppSchedules");async function Ae(s,n,t){let e=await i(s,n,`/apps/${encodeURIComponent(t)}/schedules/stop`,{method:"POST",body:JSON.stringify({})});return l(e,"Schedule stop")}a(Ae,"stopAppSchedules");async function Ee(s,n){let t=await i(s,n,"/apps/schedules/current/stop",{method:"POST",body:JSON.stringify({})});return l(t,"Current schedule stop")}a(Ee,"stopCurrentAppSchedules");async function Oe(s,n,t){let e=await i(s,n,"/v1/schedules/run",{method:"POST",body:JSON.stringify({scheduleId:t.scheduleId})});return l(e,"Schedule run")}a(Oe,"runScheduleNow");async function be(s,n,t,e){let o=await i(s,n,`/apps/${encodeURIComponent(t)}/schedules/${encodeURIComponent(e)}`,{method:"DELETE"});return l(o,"Schedule delete")}a(be,"deleteOrArchiveSchedule");async function $e(s,n,t,e){let o=await i(s,n,`/v1/schedules/${encodeURIComponent(t)}/execution-logs${b(e?.limit)}`,{method:"GET"}),r=await l(o,"Schedule execution logs");return{logs:N(r)}}a($e,"listScheduleExecutionLogs");async function ke(s,n,t,e){let o=await i(s,n,`/v1/deployments/${encodeURIComponent(t)}/schedule-execution-logs${b(e?.limit)}`,{method:"GET"}),r=await l(o,"Deployment schedule execution logs");return{logs:N(r)}}a(ke,"listDeploymentScheduleExecutionLogs");async function Le(s,n,t){let e=await i(s,n,`/v1/schedule-execution-logs/${encodeURIComponent(t)}`,{method:"GET"});return l(e,"Schedule execution log")}a(Le,"getScheduleExecutionLog");async function Ie(s,n,t,e){let o=await i(s,n,`/v1/apps/${encodeURIComponent(t)}/execution-timeline${b(e?.limit)}`,{method:"GET"});return l(o,"App execution timeline")}a(Ie,"getAppExecutionTimeline");async function ve(s,n,t){return i(s,n,"/apps/agent/create",{method:"POST",body:JSON.stringify(t)})}a(ve,"createAgentFromPrompt");async function De(s,n,t){let e=new URLSearchParams;t?.appId&&e.set("appId",t.appId);let o=e.toString(),r=await i(s,n,`/apps/performance${o?`?${o}`:""}`,{method:"GET"});if(!r.ok){let c=await r.text().catch(()=>"");throw new Error(`Performance lookup failed: ${r.status} ${c}`)}return await r.json()}a(De,"getUserPerformance");async function Ne(s,n,t){let e=new URLSearchParams({appId:t}),o=await i(s,n,`/apps/summary?${e.toString()}`,{method:"GET"});if(!o.ok){let r=await o.text().catch(()=>"");throw new Error(`Summary lookup failed: ${o.status} ${r}`)}return await o.json()}a(Ne,"getAppRuntimeSummary");async function z(s,n){let t=await i(s,n,"/v1/account",{method:"GET"});if(!t.ok){let e=await t.text().catch(()=>"");throw new Error(`Account lookup failed: ${t.status} ${e}`)}return await t.json()}a(z,"getOpenPondAccount");async function qe(s,n){let t=new Date().toISOString(),e=Date.now(),o=s.replace(/\/$/,"");try{let r=await i(o,null,"/health",{method:"GET",headers:{Accept:"application/json"}}),c=Date.now()-e,p=await r.json().catch(()=>({})),d=null,m=null;if(n?.trim())try{let g=await z(o,n);d=!0,m=g.account}catch{d=!1}return{reachable:r.ok,authenticated:d,apiBase:o,latencyMs:c,status:r.status,service:typeof p.service=="string"?p.service:null,checkedAt:t,account:m,...r.ok?{}:{error:r.statusText||`HTTP ${r.status}`}}}catch(r){return{reachable:!1,authenticated:n?.trim()?!1:null,apiBase:o,latencyMs:Date.now()-e,status:null,service:null,checkedAt:t,error:r instanceof Error?r.message:String(r)}}}a(qe,"checkOpenPondApiHealth");async function Ce(s,n,t){let e=await i(s,n,"/apps/assistant/run",{method:"POST",body:JSON.stringify(t)});if(!e.ok){let o=await e.text().catch(()=>"");throw new Error(`Assistant run failed: ${e.status} ${o}`)}return await e.json()}a(Ce,"runAssistantMode");async function Ue(s,n,t){let e=await i(s,n,"/apps/agent/digest",{method:"POST",body:JSON.stringify(t)});if(!e.ok){let o=await e.text().catch(()=>"");throw new Error(`Agent digest failed: ${e.status} ${o}`)}return await e.json()}a(Ue,"postAgentDigest");async function _e(s,n,t){let e=await i(s,n,"/apps/tools/execute",{method:"POST",body:JSON.stringify(t)}),o=await e.text().catch(()=>""),r=null;try{r=o?JSON.parse(o):null}catch{r=o}return e.ok?{ok:!0,status:e.status,data:r}:{ok:!1,status:e.status,error:r&&typeof r=="object"&&"error"in r?String(r.error):o||e.statusText}}a(_e,"executeUserTool");async function je(s,n,t){let e=await i(s,n,"/apps/backtests/run",{method:"POST",body:JSON.stringify(t)});if(!e.ok){let o=await e.text().catch(()=>"");throw new Error(`Backtest run failed: ${e.status} ${o}`)}return await e.json()}a(je,"submitBacktestRun");async function Be(s,n,t){let e=t.query&&Object.keys(t.query).length>0?`?${new URLSearchParams(t.query).toString()}`:"",o=await i(s,n,`/apps/backtests/tx${e}`,{method:t.method,body:t.method==="POST"&&t.body!==void 0?JSON.stringify(t.body):void 0});if(!o.ok){let r=await o.text().catch(()=>"");throw new Error(`Backtests request failed: ${o.status} ${r}`)}return await o.json()}a(Be,"submitBacktestTx");async function Ge(s,n,t){let e=new URLSearchParams(t).toString(),o=await i(s,n,`/apps/backtests/detail?${e}`,{method:"GET"});if(!o.ok){let r=await o.text().catch(()=>"");throw new Error(`Backtest detail failed: ${o.status} ${r}`)}return await o.json()}a(Ge,"submitBacktestDetail");function K(s){let n=s.trim().replace(/^\/+/,"");return encodeURIComponent(n||"tool")}a(K,"normalizeToolPathSegment");function W(s){let n=s.replace(/\/$/,""),t=process.env.OPENPOND_TOOL_URL;if(t)return t.replace(/\/$/,"");try{let e=new URL(n),o=e.hostname.toLowerCase(),r=o==="apps.openpond.live"?null:o===V||o===D||o===`www.${D}`||o==="openpond.live"||o==="www.openpond.live"?"https://apps.openpond.live":null;if(r)return r;let c=o==="localhost"||o==="127.0.0.1",p=e.port||(e.protocol==="https:"?"443":"80");if(c&&p==="3000")return n}catch{}return n}a(W,"resolveWorkerBaseUrl");async function Me(s,n,t){let e=W(s),o=K(t.toolName),c=`${t.deploymentId?`/${t.appId}/deployments/${t.deploymentId}`:`/${t.appId}`}/${o}`,p=new Headers(t.headers||{}),d=t.method??"POST",m=t.body===void 0||d==="GET"?void 0:JSON.stringify(t.body),g=await i(e,n,c,{method:d,body:m,headers:p}),h=await g.text().catch(()=>""),u=null;try{u=h?JSON.parse(h):null}catch{u=h}let S=u&&typeof u=="object"&&"ok"in u?!!u.ok:!0,y=g.ok&&S,f=u&&typeof u=="object"&&"status"in u&&Number(u.status)||g.status,R=u&&typeof u=="object"&&"error"in u?String(u.error):g.ok?void 0:h||g.statusText,P=u&&typeof u=="object"&&"data"in u?u.data:u;return{ok:y,status:f,data:P,error:R}}a(Me,"executeHostedTool");import{createHash as Y}from"node:crypto";var X=3600*1e3;function $(s){return Y("sha256").update(JSON.stringify([s.apiBase.replace(/\/$/,""),s.apiKey.trim()])).digest("hex")}a($,"buildCacheKey");async function q(s,n){let t=await L(x(),s,$(n),{allowStale:!0});return!t||Date.now()-Date.parse(t.updatedAt)>=(n.ttlMs??X)?null:t.payload}a(q,"cached");async function Ye(s){return q("cloud.apps",s)}a(Ye,"getCachedApps");async function Xe(s){await E(x(),"cloud.apps",$(s),s.apps)}a(Xe,"setCachedApps");async function Qe(s){return q("cloud.tools",s)}a(Qe,"getCachedTools");async function Ze(s){await E(x(),"cloud.tools",$(s),s.tools)}a(Ze,"setCachedTools");var it=["openpond-generic-v1","openpond-work-v1","openpond-coding-core-v1","openpond-agent-harness-v1"];export{i as a,_ as b,j as c,B as d,G as e,M as f,J as g,H as h,F as i,ae as j,ie as k,ce as l,pe as m,ue as n,le as o,de as p,me as q,ge as r,he as s,ye as t,fe as u,Re as v,we as w,Se as x,xe as y,Te as z,Pe as A,Ae as B,Ee as C,Oe as D,be as E,$e as F,ke as G,Le as H,Ie as I,ve as J,De as K,Ne as L,z as M,qe as N,Ce as O,Ue as P,_e as Q,je as R,Be as S,Ge as T,W as U,Me as V,X as W,Ye as X,Xe as Y,Qe as Z,Ze as _,it as $};
|