openpond 0.2.45 → 0.2.46
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/RELEASE.md +16 -13
- package/dist/app-server.d.ts +10474 -10090
- package/dist/app-server.js +1 -1
- package/dist/chunks/actions-command-I3NI75P2.js +2 -0
- package/dist/chunks/{app-layer-MDJFV3HZ.js → app-layer-B3SMVO4B.js} +1 -1
- package/dist/chunks/app-server-runtime-FL2CHQU2.js +2 -0
- package/dist/chunks/apps-OA2VX34V.js +2 -0
- package/dist/chunks/{chunk-4EGDKOYP.js → chunk-33AO3P6X.js} +1 -1
- package/dist/chunks/chunk-4UTIEH5H.js +16 -0
- package/dist/chunks/{chunk-J65BMG5Q.js → chunk-4VKNBADF.js} +1 -1
- package/dist/chunks/{chunk-B6LYKEMU.js → chunk-5OGRWWEH.js} +1 -1
- package/dist/chunks/chunk-5ZZM3TUN.js +24 -0
- package/dist/chunks/chunk-6JBWHR6T.js +5 -0
- package/dist/chunks/{chunk-DXAZUJPA.js → chunk-6SJZXZNA.js} +1 -1
- package/dist/chunks/{chunk-TVQE3JMI.js → chunk-6WLJWRMF.js} +1 -1
- package/dist/chunks/chunk-BKMGBIBT.js +2 -0
- package/dist/chunks/chunk-BQNK2NMB.js +21 -0
- package/dist/chunks/{chunk-VESOG2SS.js → chunk-BUFQKDAW.js} +1 -1
- package/dist/chunks/{chunk-DWGB536R.js → chunk-D6E7JBBQ.js} +7 -7
- package/dist/chunks/chunk-D6MQTNJ3.js +9 -0
- package/dist/chunks/chunk-DNXKIIV7.js +3 -0
- package/dist/chunks/{chunk-EG55BFQ4.js → chunk-EWS7MXTM.js} +1 -1
- package/dist/chunks/{chunk-GEDEVI4Y.js → chunk-F2AG46CV.js} +1 -1
- package/dist/chunks/{chunk-CR6CDOKS.js → chunk-F5DUN73H.js} +2 -2
- package/dist/chunks/chunk-FKCWOASO.js +49 -0
- package/dist/chunks/chunk-FOEUDMME.js +2678 -0
- package/dist/chunks/chunk-H6W55CQG.js +2 -0
- package/dist/chunks/chunk-HK3WGUKK.js +17 -0
- package/dist/chunks/{chunk-25GCTLAZ.js → chunk-HO5L2FUU.js} +1 -1
- package/dist/chunks/{chunk-XPB6NY7L.js → chunk-HP2D3W2B.js} +3 -3
- package/dist/chunks/chunk-ICZEOMPO.js +2 -0
- package/dist/chunks/{chunk-IYRHG54Q.js → chunk-IV7F74JJ.js} +1 -1
- package/dist/chunks/{chunk-U6SFIFDM.js → chunk-JBHAU7PH.js} +39 -39
- package/dist/chunks/chunk-JO7GRBOG.js +2 -0
- package/dist/chunks/{chunk-KPDWQCF6.js → chunk-KE5RH6JA.js} +1 -1
- package/dist/chunks/chunk-KUKOZJIR.js +2 -0
- package/dist/chunks/chunk-L4BYPZ4U.js +22 -0
- package/dist/chunks/{chunk-Z2BYC6TP.js → chunk-LZSY5IM3.js} +1 -1
- package/dist/chunks/{chunk-TNXILYI6.js → chunk-M7PBDRKC.js} +1 -1
- package/dist/chunks/{chunk-OJVIH7J6.js → chunk-MCRA6ZGJ.js} +1 -1
- package/dist/chunks/{chunk-YWX7FKLM.js → chunk-OGXSE57Z.js} +1 -1
- package/dist/chunks/{chunk-HZP5U2AA.js → chunk-P653BXMY.js} +1 -1
- package/dist/chunks/chunk-PMZH2TKS.js +4 -0
- package/dist/chunks/chunk-TYWBEJOA.js +3 -0
- package/dist/chunks/chunk-USWZ3KUC.js +2 -0
- package/dist/chunks/chunk-UWO34HP6.js +33 -0
- package/dist/chunks/{chunk-5ZFEQLRI.js → chunk-VW7D3DRM.js} +1 -1
- package/dist/chunks/chunk-W4IL6TWB.js +186 -0
- package/dist/chunks/chunk-WVNN3RB2.js +2 -0
- package/dist/chunks/{chunk-VVV5I22A.js → chunk-WWABOVRW.js} +2 -2
- package/dist/chunks/{chunk-B3O2GAQH.js → chunk-XLDW5NN3.js} +1 -1
- package/dist/chunks/chunk-YSYXIJ46.js +8 -0
- package/dist/chunks/{chunk-V62BHD5G.js → chunk-ZC57DX6D.js} +1 -1
- package/dist/chunks/{chunk-FXIUKYUR.js → chunk-ZJY2L43W.js} +3 -3
- package/dist/chunks/cli-5QR7QNQJ.js +2 -0
- package/dist/chunks/{configuration-command-75ZCMZ6X.js → configuration-command-MVZS625X.js} +1 -1
- package/dist/chunks/connected-evidence-7LHUZ2UI.js +2 -0
- package/dist/chunks/{continual-WWPXK2LO.js → continual-K5JNHNQH.js} +3 -3
- package/dist/chunks/core-commands-J2SJM5I5.js +2 -0
- package/dist/chunks/datasets-KDN2EXHE.js +2 -0
- package/dist/chunks/desktop-test-WIOEKMPR.js +3 -0
- package/dist/chunks/dist-3MTJ7VM6.js +2 -0
- package/dist/chunks/{dist-ELWB75PL.js → dist-JBE7DPFZ.js} +1 -1
- package/dist/chunks/evaluation-coordination-NGYHL7HG.js +2 -0
- package/dist/chunks/experiment-improvements-2M7GRGWS.js +2 -0
- package/dist/chunks/experiments-B6CRZ3GI.js +2 -0
- package/dist/chunks/{extension-3M2CSWZB.js → extension-RZTMK3ON.js} +1 -1
- package/dist/chunks/{help-RLRU33WN.js → help-EISFHH2F.js} +1 -1
- package/dist/chunks/hosted-experiment-improvement-6CHH65DX.js +3 -0
- package/dist/chunks/hosted-harness-runtime-PAYMAXH7.js +2 -0
- package/dist/chunks/hosted-profile-candidate-HYEISIAC.js +3 -0
- package/dist/chunks/hosted-profile-compiler-KQREWJA5.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-control-LV6YXOG7.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-inspection-A62UYFEP.js +3 -0
- package/dist/chunks/hosted-profile-evaluation-preparation-OR4OLYEX.js +3 -0
- package/dist/chunks/human-review-J6JGNRBR.js +2 -0
- package/dist/chunks/import-YHSX6SBZ.js +4 -0
- package/dist/chunks/learning-REL6GGNA.js +2 -0
- package/dist/chunks/opchat-CUZUU2WM.js +3 -0
- package/dist/chunks/organizations-VT27V4B2.js +2 -0
- package/dist/chunks/{profile-DC4UEVVG.js → profile-N2E5ASHQ.js} +1 -1
- package/dist/chunks/project-agent-XMXOBJSC.js +2 -0
- package/dist/chunks/sandbox-command-NC665ZZ5.js +2 -0
- package/dist/chunks/{sandbox-template-DFHWHCIQ.js → sandbox-template-OTP6S3RU.js} +1 -1
- package/dist/chunks/src-TNWF3IC5.js +329 -0
- package/dist/chunks/{src-CREVQF7M.js → src-WM35IF4W.js} +5 -5
- package/dist/chunks/{taskset-TB2ICAZU.js → taskset-COAPMTT3.js} +1 -1
- package/dist/chunks/{teams-bot-BNBL57S5.js → teams-bot-ACWJ7PJP.js} +1 -1
- package/dist/chunks/{training-FW5FOGR3.js → training-4JUK7YQV.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/web/assets/App-CdDQ-lXE.css +1 -0
- package/dist/web/assets/App-D2f8_mGk.js +235 -0
- package/dist/web/assets/{AppDialog-Cgn_fTGR.js → AppDialog-CaxeNfsu.js} +1 -1
- package/dist/web/assets/{AppTerminalPanel-cNYkSvM2.js → AppTerminalPanel-dtK0ZPer.js} +2 -2
- package/dist/web/assets/{AppsView-9zpKBSLv.js → AppsView-DwK1UBJP.js} +1 -1
- package/dist/web/assets/BrowserSidebar-Cj9VnkgU.js +1 -0
- package/dist/web/assets/{CartesianChart-Bg3Lm5mZ.js → CartesianChart-Drfk6jTn.js} +1 -1
- package/dist/web/assets/{CollaborationTabs-BIfgIy5X.js → CollaborationTabs-Czh2noeb.js} +1 -1
- package/dist/web/assets/{CommandMenu-D9BimyPx.js → CommandMenu-D-M-xomh.js} +1 -1
- package/dist/web/assets/CommunityView-BrdxUI5Z.js +1 -0
- package/dist/web/assets/ComposerCreateImproveStrip-CJ8nkYJf.js +1 -0
- package/dist/web/assets/GetStartedView-u7Jw7YA1.js +1 -0
- package/dist/web/assets/HostedModelLearningReview-D0a2nwse.js +1 -0
- package/dist/web/assets/HostedModelLearningSettings-CQQGyjxi.js +1 -0
- package/dist/web/assets/LabModelVersionDetailPage-Cxlc4sSC.js +1 -0
- package/dist/web/assets/LabSkillSidebar-BnJkDb0c.js +1 -0
- package/dist/web/assets/LabsRoute-hHwZNbqN.js +99 -0
- package/dist/web/assets/MainChatThread-r_TYiTnW.js +2 -0
- package/dist/web/assets/MainPane-DJcd4tPk.js +19 -0
- package/dist/web/assets/MainPane-DOWsSew1.css +1 -0
- package/dist/web/assets/{MarkdownText-De0WzrEw.js → MarkdownText-BxPHz4je.js} +1 -1
- package/dist/web/assets/{NativeSkillSidebar-B4jtf5RO.js → NativeSkillSidebar-CCHK6kMG.js} +1 -1
- package/dist/web/assets/{NewExperienceSwitcher-Bg1DVr96.js → NewExperienceSwitcher-CuKWTDZj.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-i_wvIBw-.js → NewProjectDialog-CS6sw2oD.js} +1 -1
- package/dist/web/assets/OutputsPage-JDM5bfLJ.js +1 -0
- package/dist/web/assets/{ProjectsPage-BD0eml0M.js → ProjectsPage-B3zTBHOA.js} +1 -1
- package/dist/web/assets/RightChatPanelStack-L8S3yj1u.js +1 -0
- package/dist/web/assets/{RightSidebarHomePanel-BTpU5wGh.js → RightSidebarHomePanel-BWJQKFUp.js} +1 -1
- package/dist/web/assets/ScheduledWorkPage-qX12p4B0.js +1 -0
- package/dist/web/assets/SettingsView-0KMs-r2I.js +9 -0
- package/dist/web/assets/SettingsView-CVsuQeCZ.css +1 -0
- package/dist/web/assets/{TeamChatView-5LjuRNd6.js → TeamChatView-DakXCNQE.js} +2 -2
- package/dist/web/assets/{TerminalOverlay-BCWBSotQ.js → TerminalOverlay-DaonK5C0.js} +12 -12
- package/dist/web/assets/{TrainingCreationPanel-hvOHRVJx.js → TrainingCreationPanel-CUvSsSwp.js} +1 -1
- package/dist/web/assets/{TrainingDraftPanel-CGEHGljE.js → TrainingDraftPanel-DNivtVwd.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-B8nbqhag.js → UsageSettingsSection-rbmuoPoE.js} +1 -1
- package/dist/web/assets/WorkSidebarPanel-DrYt9xzv.js +1 -0
- package/dist/web/assets/WorkspaceDiffPanel-CThoTqe4.js +14 -0
- package/dist/web/assets/WorkspaceEnvironmentMenu-DeODKxvW.js +32 -0
- package/dist/web/assets/{WorkspaceGitDialogs-Dyx4Rbiy.js → WorkspaceGitDialogs-CBarJYF-.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-B1dKexHo.js → WorkspaceMonacoEditor-Hmu5m_sO.js} +3 -3
- package/dist/web/assets/{arrow-up-right-CCj7SOGp.js → arrow-up-right-BV2IHfb9.js} +1 -1
- package/dist/web/assets/chunk-YTGRET2L-PKzEfYnf.js +1 -0
- package/dist/web/assets/{clipboard-BY6ELc9Z.js → clipboard-DDIvAWKp.js} +1 -1
- package/dist/web/assets/{cloud-upload-BOka5EKK.js → cloud-upload-Dv6kFnfC.js} +1 -1
- package/dist/web/assets/{cssMode-C34j8ti5.js → cssMode-BK0jFqWW.js} +1 -1
- package/dist/web/assets/{folder-open-CX2jidFj.js → folder-open-B9ixJQJX.js} +1 -1
- package/dist/web/assets/{folder-plus-Dh2Q9LP3.js → folder-plus-DqSKvtNB.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-CfevriuT.js → git-commit-horizontal-C1lQvfxe.js} +1 -1
- package/dist/web/assets/{htmlMode-BORwVkZg.js → htmlMode-CCV301b6.js} +1 -1
- package/dist/web/assets/index-1cMIFBxZ.css +1 -0
- package/dist/web/assets/{index-BBjRfC--.js → index-DIaKfM8a.js} +2 -2
- package/dist/web/assets/{info-Bv3dbs3G.js → info-BEvaynAD.js} +1 -1
- package/dist/web/assets/{jsonMode-BYWtZ6AK.js → jsonMode-Co4pyN4F.js} +1 -1
- package/dist/web/assets/{lspLanguageFeatures-CEAdFSpU.js → lspLanguageFeatures-CSU0G5da.js} +1 -1
- package/dist/web/assets/{minimize-2-MhorZwY5.js → minimize-2-DT8t8wwP.js} +1 -1
- package/dist/web/assets/{monaco.contribution-CDhPpbIo.js → monaco.contribution-CBwGIQY1.js} +2 -2
- package/dist/web/assets/{monaco.contribution-ZUUVx_3M.js → monaco.contribution-Cr0AaHCD.js} +2 -2
- package/dist/web/assets/{monaco.contribution-CN7AWJNd.js → monaco.contribution-DSBAb_PC.js} +2 -2
- package/dist/web/assets/{monaco.contribution-DHA7FuJX.js → monaco.contribution-DUZrs1D-.js} +2 -2
- package/dist/web/assets/{monitor-DLcrkfM5.js → monitor-DGqnfsK9.js} +1 -1
- package/dist/web/assets/play-C1XWyKh6.js +1 -0
- package/dist/web/assets/{python-CXwvPmc4.js → python-Z1foxLdf.js} +1 -1
- package/dist/web/assets/{save-DaN65kMq.js → save-CX2kF74j.js} +1 -1
- package/dist/web/assets/{square-zRgIUdSv.js → square-DMkXeYeV.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-DWeRZFzr.js → toggleHighContrast-CRMVp779.js} +1 -1
- package/dist/web/assets/{tsMode-nLBhKngY.js → tsMode-Czu8YAqh.js} +1 -1
- package/dist/web/assets/{upload-BfUu4Eu1.js → upload-giKOPnl1.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules-BCITWhg2.js → useLocalAgentSchedules-BHxWmOeC.js} +1 -1
- package/dist/web/assets/{useSessionTurnCache-BQMWfV8u.js → useSessionTurnCache-CUYFsu_W.js} +1 -1
- package/dist/web/assets/{wifi-off-bdka5es5.js → wifi-off-DbDXaV1N.js} +1 -1
- package/dist/web/assets/{workers-z7XHFFNs.js → workers-Cno4XklJ.js} +1 -1
- package/dist/web/assets/{yaml-BTr4i4DD.js → yaml-C28t_C6h.js} +1 -1
- package/dist/web/index.html +2 -2
- package/docs/command-reference.md +22 -0
- package/package.json +1 -2
- package/dist/chunks/actions-command-CRDLSPFA.js +0 -2
- package/dist/chunks/app-server-runtime-PJONTCCO.js +0 -2
- package/dist/chunks/apps-MD2DKEDW.js +0 -2
- package/dist/chunks/chunk-3BJ4P5LI.js +0 -520
- package/dist/chunks/chunk-3SRIPOJQ.js +0 -2
- package/dist/chunks/chunk-65BW2QXY.js +0 -2
- package/dist/chunks/chunk-6BL2ZIAP.js +0 -184
- package/dist/chunks/chunk-6QUICEQA.js +0 -5
- package/dist/chunks/chunk-7D2WMUWK.js +0 -3
- package/dist/chunks/chunk-7KIBRK3A.js +0 -4
- package/dist/chunks/chunk-ALZRXBEC.js +0 -33
- package/dist/chunks/chunk-CXS3WXL3.js +0 -2
- package/dist/chunks/chunk-ELNJUG64.js +0 -17
- package/dist/chunks/chunk-H3C4ZYEA.js +0 -16
- package/dist/chunks/chunk-HUBI3RUK.js +0 -2
- package/dist/chunks/chunk-KOR2AZVB.js +0 -24
- package/dist/chunks/chunk-M2YXYBSP.js +0 -2
- package/dist/chunks/chunk-MTJNKRXL.js +0 -22
- package/dist/chunks/chunk-NXUCGKY2.js +0 -5
- package/dist/chunks/chunk-PDIT2QS7.js +0 -8
- package/dist/chunks/chunk-QVRNOGAU.js +0 -21
- package/dist/chunks/chunk-V6WBSW5Q.js +0 -3
- package/dist/chunks/chunk-VFTUP5NQ.js +0 -2
- package/dist/chunks/chunk-XWLI7WJH.js +0 -2160
- package/dist/chunks/cli-BKBH6FZY.js +0 -2
- package/dist/chunks/connected-evidence-UPUVVQ6P.js +0 -2
- package/dist/chunks/core-commands-SS2GV7WU.js +0 -2
- package/dist/chunks/datasets-TCLXV34N.js +0 -2
- package/dist/chunks/desktop-test-7ZHZHUB6.js +0 -3
- package/dist/chunks/dist-VDN6E54A.js +0 -2
- package/dist/chunks/evaluation-coordination-ZX5GLMRC.js +0 -2
- package/dist/chunks/experiment-improvements-O6DCQXCX.js +0 -2
- package/dist/chunks/experiments-JOQOBQXY.js +0 -2
- package/dist/chunks/hosted-experiment-improvement-IKO677PI.js +0 -3
- package/dist/chunks/hosted-harness-runtime-H2Q2SNZT.js +0 -2
- package/dist/chunks/hosted-profile-candidate-FHHSLJNO.js +0 -3
- package/dist/chunks/hosted-profile-compiler-5B256VV3.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-control-Z25TZOW4.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-inspection-MFYPLTZQ.js +0 -3
- package/dist/chunks/hosted-profile-evaluation-preparation-MAB2PSCC.js +0 -3
- package/dist/chunks/human-review-6H3BW7OZ.js +0 -2
- package/dist/chunks/learning-Y6WNDVQW.js +0 -2
- package/dist/chunks/opchat-3E4FH3DC.js +0 -3
- package/dist/chunks/organizations-PRVCUPMN.js +0 -2
- package/dist/chunks/project-agent-ZX3CELKI.js +0 -2
- package/dist/chunks/sandbox-command-HHQMZK3G.js +0 -2
- package/dist/chunks/src-MAZ7OBVY.js +0 -327
- package/dist/web/assets/App-BgeSqoRS.css +0 -1
- package/dist/web/assets/App-C6EWFrLP.js +0 -227
- package/dist/web/assets/BrowserSidebar-Xo21N1ej.js +0 -1
- package/dist/web/assets/CommunityView-BoW-yLju.js +0 -1
- package/dist/web/assets/ComposerCreateImproveStrip-BIKVEgr1.js +0 -1
- package/dist/web/assets/GetStartedView-B99v4-hh.js +0 -1
- package/dist/web/assets/HostedModelLearningReview-DEScpX2Z.js +0 -1
- package/dist/web/assets/HostedModelLearningSettings-4HT5eEiL.js +0 -1
- package/dist/web/assets/LabModelVersionDetailPage-DkYdI7gr.js +0 -1
- package/dist/web/assets/LabSkillSidebar-Bp5XYipm.js +0 -1
- package/dist/web/assets/LabsRoute-VopO7n34.js +0 -105
- package/dist/web/assets/MainChatThread-3Gg0oDZT.js +0 -2
- package/dist/web/assets/MainPane-CUqMVG9-.js +0 -19
- package/dist/web/assets/OutputsPage-CZiPxLyN.js +0 -1
- package/dist/web/assets/RightChatPanelStack-CEBFPHKP.js +0 -1
- package/dist/web/assets/ScheduledWorkPage-Y6XGoh-X.js +0 -1
- package/dist/web/assets/SettingsView-C7av3zwv.css +0 -1
- package/dist/web/assets/SettingsView-Kh14f463.js +0 -9
- package/dist/web/assets/WorkSidebarPanel-B6hlPEIs.js +0 -1
- package/dist/web/assets/WorkspaceDiffPanel-q8A15-0x.js +0 -14
- package/dist/web/assets/WorkspaceEnvironmentMenu-BiFTPWtC.js +0 -32
- package/dist/web/assets/chunk-DJWHN7NU-1eQoMoKO.js +0 -1
- package/dist/web/assets/index-B9VSiz_z.css +0 -1
- package/dist/web/assets/refresh-cw-BTfIxHb3.js +0 -1
package/dist/app-server.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{
|
|
2
|
+
import{jc as r}from"./chunks/chunk-W4IL6TWB.js";import{e as p}from"./chunks/chunk-KUKOZJIR.js";import"./chunks/chunk-5OGRWWEH.js";import{i as e}from"./chunks/chunk-D6MQTNJ3.js";import"./chunks/chunk-ICZEOMPO.js";import"./chunks/chunk-DNXKIIV7.js";import"./chunks/chunk-WVNN3RB2.js";import"./chunks/chunk-FOEUDMME.js";import"./chunks/chunk-BKMGBIBT.js";import"./chunks/chunk-33AO3P6X.js";import"./chunks/chunk-4VKNBADF.js";import"./chunks/chunk-BUFQKDAW.js";import"./chunks/chunk-HO5L2FUU.js";import"./chunks/chunk-JBHAU7PH.js";import"./chunks/chunk-F2AG46CV.js";import"./chunks/chunk-SDO4FC4Q.js";import"./chunks/chunk-IR3YJWPW.js";import"./chunks/chunk-LL4QP2IM.js";import"./chunks/chunk-PGKEDR3S.js";import"./chunks/chunk-XEOEKFG6.js";import"./chunks/chunk-ZJY2L43W.js";import"./chunks/chunk-L3KS6MOV.js";import"./chunks/chunk-YSYXIJ46.js";import"./chunks/chunk-6JBWHR6T.js";import"./chunks/chunk-HK3WGUKK.js";import"./chunks/chunk-6MI4KKWF.js";import"./chunks/chunk-5ZZM3TUN.js";import"./chunks/chunk-6FA3GG5B.js";import"./chunks/chunk-H6W55CQG.js";import"./chunks/chunk-Z3D4C7BG.js";import"./chunks/chunk-JO7GRBOG.js";import"./chunks/chunk-BQNK2NMB.js";import"./chunks/chunk-VW7D3DRM.js";import"./chunks/chunk-UWO34HP6.js";import"./chunks/chunk-L4BYPZ4U.js";import"./chunks/chunk-P653BXMY.js";import"./chunks/chunk-ES2ISFJC.js";import"./chunks/chunk-H7IWJN7L.js";import"./chunks/chunk-FTQLQJQV.js";export{e as AGENT_PROTOCOL_VERSION,r as createOpenPondAppServer,p as runAppServerJsonl};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{b as R,c as p,d as m}from"./chunk-XEOEKFG6.js";import{a as v}from"./chunk-USWZ3KUC.js";import"./chunk-XWPC3AN4.js";import{f as b}from"./chunk-3M53YXEI.js";import{C as O}from"./chunk-4UTIEH5H.js";import{d as P}from"./chunk-6SJZXZNA.js";import"./chunk-GLUWATL5.js";import"./chunk-H6W55CQG.js";import"./chunk-Z3D4C7BG.js";import"./chunk-JO7GRBOG.js";import"./chunk-BQNK2NMB.js";import"./chunk-VW7D3DRM.js";import"./chunk-UWO34HP6.js";import"./chunk-L4BYPZ4U.js";import"./chunk-P653BXMY.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import{a as c}from"./chunk-FTQLQJQV.js";import{promises as $,watch as C}from"node:fs";import y from"node:path";import{execFile as J}from"node:child_process";import{promisify as k}from"node:util";var K=k(J);async function G(t,n){let e=n[0]??"check",o=y.resolve(i(t,"cwd")??process.cwd()),l=i(t,"sourceDirectory"),u=i(t,"outputDirectory"),d=b(t.json);if(e==="check"||e==="build"){let r=await p({projectRoot:o,sourceDirectory:l,outputDirectory:u});if(d){console.log(JSON.stringify({status:"passed",actionCount:r.registry.actions.length,registry:r.registry,manifest:r.manifest,outputDirectory:r.outputDirectory},null,2));return}console.log(`${e==="check"?"Validated":"Built"} ${r.registry.actions.length} Project Action${r.registry.actions.length===1?"":"s"}.`),console.log(`Registry: ${r.registryPath}`),console.log(`Bundle: ${r.bundlePath}`);return}if(e==="run"){let r=n[1];if(!r)throw new Error("usage: openpond actions run <action-id> [--input JSON|--input-file PATH]");let a=await m({projectRoot:o,sourceDirectory:l,outputDirectory:u,build:"always"}).run({actionId:r,input:await I(t,o),timeoutMs:A(t,"timeoutMs")});console.log(JSON.stringify(a,null,2));return}if(e==="dev"){let r=n[1]??null;await _({projectRoot:o,sourceDirectory:l,outputDirectory:u,actionId:r,options:t,json:d});return}if(e==="publish"){let r=j(t,"projectId"),s=j(t,"teamId"),a=i(t,"apiKey"),w=process.env.OPENPOND_API_KEY?.trim()||null,g=a||w?null:await P({account:i(t,"account")}),h=a??w??(g?v(g):null);if(!h)throw new Error("OpenPond API key is required. Select a saved OpenPond account, set OPENPOND_API_KEY, or pass --api-key.");let N=await p({projectRoot:o,sourceDirectory:l,outputDirectory:u}),E=i(t,"sourceCommitSha")??await D(o,["rev-parse","HEAD"]),S=i(t,"sourceRef")??await D(o,["rev-parse","--abbrev-ref","HEAD"]),f=await O({apiKey:h,baseUrl:i(t,"baseUrl")??(process.env.OPENPOND_API_URL?.trim()||g?.apiBaseUrl)}).actions.publish({projectId:r,teamId:s,sourceRef:S,sourceCommitSha:E,build:N});console.log(d?JSON.stringify({release:f},null,2):`Published Project Actions release ${f.id} from ${f.sourceCommitSha}.`);return}throw new Error("usage: openpond actions <check|build|run|dev|publish> [action-id]")}c(G,"runProjectActionsCommand");async function _(t){let n=!1,e=!1,o=c(async()=>{if(n){e=!0;return}n=!0;try{let r=m({projectRoot:t.projectRoot,sourceDirectory:t.sourceDirectory,outputDirectory:t.outputDirectory,build:"always"});if(t.actionId){let s=await r.run({actionId:t.actionId,input:await I(t.options,t.projectRoot),timeoutMs:A(t.options,"timeoutMs")});console.log(JSON.stringify(s,null,2))}else{let s=await r.build(),a={status:"ready",actionCount:s.registry.actions.length,bundleHash:s.manifest.bundleHash};console.log(t.json?JSON.stringify(a):`Ready with ${a.actionCount} Project Action${a.actionCount===1?"":"s"}.`)}}catch(r){console.error(r instanceof Error?r.message:String(r))}finally{n=!1,e&&(e=!1,await o())}},"execute");await o();let l=await R(t.projectRoot),u=y.resolve(t.projectRoot,t.sourceDirectory??l.sourceDirectory??"openpond/actions");console.log(`Watching ${u}`);let d=C(u,{recursive:!0},()=>{setTimeout(()=>{o()},50)});await new Promise(r=>{let s=c(()=>{d.close(),r()},"stop");process.once("SIGINT",s),process.once("SIGTERM",s)})}c(_,"runDev");async function I(t,n){let e=i(t,"input"),o=i(t,"inputFile");if(e&&o)throw new Error("Use either --input or --input-file, not both.");return e?JSON.parse(e):o?JSON.parse(await $.readFile(y.resolve(n,o),"utf8")):{}}c(I,"actionInput");function i(t,n){let e=t[n];return typeof e=="string"&&e.trim()?e.trim():void 0}c(i,"stringOption");function j(t,n){let e=i(t,n);if(!e)throw new Error(`--${n.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`)} is required.`);return e}c(j,"requiredOption");async function D(t,n){let{stdout:e}=await K("git",n,{cwd:t}),o=e.trim();if(!o)throw new Error(`git ${n.join(" ")} returned no value.`);return o}c(D,"gitValue");function A(t,n){let e=i(t,n);if(e===void 0)return;let o=Number(e);if(!Number.isInteger(o)||o<=0)throw new Error(`--${n} must be a positive integer.`);return o}c(A,"integerOption");export{G as runProjectActionsCommand};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{u as m}from"./chunk-
|
|
2
|
+
import{u as m}from"./chunk-XLDW5NN3.js";import"./chunk-USWZ3KUC.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{a as l}from"./chunk-EWS7MXTM.js";import"./chunk-TYWBEJOA.js";import"./chunk-3M53YXEI.js";import"./chunk-OGPHXXCD.js";import"./chunk-4UTIEH5H.js";import"./chunk-LZSY5IM3.js";import"./chunk-6SJZXZNA.js";import"./chunk-GLUWATL5.js";import"./chunk-H6W55CQG.js";import"./chunk-Z3D4C7BG.js";import"./chunk-JO7GRBOG.js";import"./chunk-BQNK2NMB.js";import"./chunk-VW7D3DRM.js";import"./chunk-UWO34HP6.js";import"./chunk-L4BYPZ4U.js";import"./chunk-P653BXMY.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import{a as i}from"./chunk-FTQLQJQV.js";import{existsSync as c}from"node:fs";import{createRequire as v}from"node:module";import s from"node:path";import{fileURLToPath as E}from"node:url";var p="24.18.0";function N(e=process.versions.node){let r=/^(\d+)\.(\d+)\.(\d+)/.exec(e),n=r?Number(r[1]):Number.NaN,o=r?Number(r[2]):Number.NaN;return n===24&&o>=18?null:[`OpenPond TUI requires Node.js ${p} or newer in the Node 24 release line; detected Node.js ${e}.`,`Switch Node versions and retry (with nvm: \`nvm install ${p} && nvm use ${p}\`).`].join(`
|
|
3
3
|
`)}i(N,"openPondTuiNodeRuntimeMessage");var u=s.dirname(E(import.meta.url)),O=class extends Error{constructor(n,o){super(n);this.exitCode=o;this.name="OpenPondChildProcessExitError"}exitCode;static{i(this,"OpenPondChildProcessExitError")}};async function F(e,r,n){let o=f(e==="app-server"?"app-server":"server"),t=[...o.args,e,...P(r),...n];e==="web"&&t.push(r.noOpen===!0||r.noOpen==="true"?"--print-access-url":"--open-browser");let a=e==="web"&&typeof r.webRoot!="string"?C():null;a&&t.push("--web-root",a),await w(o.runner,t,e==="app-server"?process.cwd():o.cwd)}i(F,"runOpenPondServerCommand");async function q(e,r){b(e);let n=N();if(n)throw new l(n);let o=f("terminal"),t=f("server"),a=[...o.args,"chat",...P(R(e)),...r];await w(o.runner,a,process.cwd(),{OPENPOND_SERVER_RUNNER:t.runner,OPENPOND_SERVER_ARGS:JSON.stringify(t.args),OPENPOND_SERVER_CWD:t.cwd})}i(q,"runOpenPondTerminalCommand");function h(){if(process.env.OPENPOND_FORCE_EMBEDDED_COMPANIONS==="1")return null;let e=[s.resolve(u,"../../../.."),s.resolve(u,"../../.."),process.cwd()];for(let r of e)if(c(s.join(r,"apps","server"))&&c(s.join(r,"apps","terminal")))return r;return null}i(h,"findWorkspaceRoot");function f(e){let r=h();if(r){let t=e==="app-server"?s.join(r,"apps","server","src","app-server-entry.ts"):s.join(r,"apps",e,"src","index.ts");if(c(t)){let d=v(s.join(r,"package.json"));return{runner:process.execPath,args:[d.resolve("tsx/cli"),t],cwd:r}}let a=e==="app-server"?s.join(r,"apps","server","dist","app-server-entry.js"):s.join(r,"apps",e,"dist","index.js");if(c(a))return{runner:process.execPath,args:[a],cwd:r}}let n=_(),o=e==="app-server"?"__app-server":e==="server"?"__server":"__terminal";if(n)return{runner:process.execPath,args:[n,o],cwd:s.dirname(s.dirname(n))};if(D())return{runner:process.execPath,args:[o],cwd:process.cwd()};throw new Error(`Could not find the installed OpenPond ${e} companion.`)}i(f,"resolveAppEntrypoint");function _(){for(let e of[s.resolve(u,"../cli.js"),s.resolve(u,"../../dist/cli.js")])if(c(e))return e;return null}i(_,"installedCliEntrypoint");function C(){if(!1){let n=s.join(s.dirname(process.execPath),"web");return c(s.join(n,"index.html"))?n:null}let e=_();if(!e)return null;let r=s.join(s.dirname(e),"web");return c(s.join(r,"index.html"))?r:null}i(C,"packagedWebRoot");function D(){if(!1)return!0;let e=process.argv[1];return!!(e&&s.resolve(e)===s.resolve(process.execPath))}i(D,"isCompiledExecutable");function P(e){let r=new Set(["account","handle","baseUrl","noOpen","tui","home"]),n=[];for(let[o,t]of Object.entries(e)){if(r.has(o))continue;let a=`--${o.replace(/[A-Z]/g,d=>`-${d.toLowerCase()}`)}`;if(t===!0||t==="true")n.push(a);else{if(t===!1||t==="false")continue;n.push(a,t)}}return n}i(P,"forwardedOptions");function R(e){let r=process.cwd(),n={...e};return typeof e.cwd=="string"&&e.cwd.trim().length>0&&(n.cwd=s.resolve(r,e.cwd)),typeof e.messageFile=="string"&&e.messageFile.trim().length>0&&(n.messageFile=s.resolve(r,e.messageFile)),n}i(R,"normalizeTerminalPaths");function b(e){if(typeof e.approvalPolicy=="string"&&!["on-request","never","on-failure","untrusted"].includes(e.approvalPolicy))throw new l("approval-policy must be on-request, never, on-failure, or untrusted");if(typeof e.sandbox=="string"&&!["read-only","workspace-write","danger-full-access"].includes(e.sandbox))throw new l("sandbox must be read-only, workspace-write, or danger-full-access")}i(b,"validateTerminalForwardingOptions");async function w(e,r,n,o){let t=await m(e,r,{cwd:n,detached:!1,env:o,inherit:!0,timeoutMs:0});if(t.code!==0||t.signal){let a=t.signal?`signal ${t.signal}`:`code ${t.code??"unknown"}`;throw new O(`${s.basename(e)} exited with ${a}`,t.code??1)}}i(w,"runChild");export{O as OpenPondChildProcessExitError,F as runOpenPondServerCommand,q as runOpenPondTerminalCommand};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{ic as c,jc as d}from"./chunk-W4IL6TWB.js";import{e as b}from"./chunk-KUKOZJIR.js";import"./chunk-5OGRWWEH.js";import{i as a}from"./chunk-D6MQTNJ3.js";import"./chunk-ICZEOMPO.js";import"./chunk-DNXKIIV7.js";import"./chunk-WVNN3RB2.js";import"./chunk-FOEUDMME.js";import"./chunk-BKMGBIBT.js";import"./chunk-33AO3P6X.js";import"./chunk-4VKNBADF.js";import"./chunk-BUFQKDAW.js";import"./chunk-HO5L2FUU.js";import"./chunk-JBHAU7PH.js";import"./chunk-F2AG46CV.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-LL4QP2IM.js";import"./chunk-PGKEDR3S.js";import"./chunk-XEOEKFG6.js";import"./chunk-ZJY2L43W.js";import"./chunk-L3KS6MOV.js";import"./chunk-YSYXIJ46.js";import"./chunk-6JBWHR6T.js";import"./chunk-HK3WGUKK.js";import"./chunk-6MI4KKWF.js";import"./chunk-5ZZM3TUN.js";import"./chunk-6FA3GG5B.js";import"./chunk-H6W55CQG.js";import"./chunk-Z3D4C7BG.js";import"./chunk-JO7GRBOG.js";import"./chunk-BQNK2NMB.js";import"./chunk-VW7D3DRM.js";import"./chunk-UWO34HP6.js";import"./chunk-L4BYPZ4U.js";import"./chunk-P653BXMY.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import"./chunk-FTQLQJQV.js";export{a as AGENT_PROTOCOL_VERSION,c as APP_SERVER_COMPOSITION,d as createOpenPondAppServer,b as runAppServerJsonl};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{b as H,c as Q}from"./chunk-22UARBPW.js";import{f as $,g as J,h as L,i as v,j as q}from"./chunk-XLDW5NN3.js";import{c as g}from"./chunk-USWZ3KUC.js";import{f as m,h as y}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import"./chunk-EWS7MXTM.js";import"./chunk-TYWBEJOA.js";import{a as S,f as w,j as T,k as j}from"./chunk-3M53YXEI.js";import"./chunk-OGPHXXCD.js";import"./chunk-4UTIEH5H.js";import{J as C,K as G,L as k,O as W,Q as M,S as z,T as F,c as D,m as K,r as V,s as _}from"./chunk-LZSY5IM3.js";import{d as f}from"./chunk-6SJZXZNA.js";import"./chunk-GLUWATL5.js";import"./chunk-H6W55CQG.js";import"./chunk-Z3D4C7BG.js";import"./chunk-JO7GRBOG.js";import"./chunk-BQNK2NMB.js";import"./chunk-VW7D3DRM.js";import"./chunk-UWO34HP6.js";import"./chunk-L4BYPZ4U.js";import"./chunk-P653BXMY.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import{a as p}from"./chunk-FTQLQJQV.js";async function ie(){let e=await f(),s=m(e),t=await g(e,s),n=y(e),r=await L({apiBase:n,apiKey:t});console.log(JSON.stringify(r,null,2))}p(ie,"runAppsTools");async function se(e){let s=await f(),t=m(s),n=y(s),r=await g(s,t),i=typeof e.handle=="string"?String(e.handle):void 0,o=i?$(i):null,c=e.refresh!==void 0?w(e.refresh):void 0,l=await J({apiBase:n,apiKey:r,forceRefresh:c}),u=o?l.filter(a=>$(a.handle||a.gitOwner)===o):l;if(u.length===0){console.log("no apps found");return}if(w(e.json)){console.log(JSON.stringify({apps:u},null,2));return}for(let a of u){let d=a.handle||a.gitOwner||"unknown",h=a.repo||a.gitRepo||a.id,B=a.latestDeployment?.status||"no-deploy",R=a.latestDeployment?.gitBranch||a.defaultBranch||"-",I=a.codeVisibility||"unknown",E=a.sandbox?"yes":"no";console.log(`${d}/${h} ${B} ${R} code=${I} sandbox=${E} ${a.id}`)}}p(se,"runAppsList");async function oe(e,s){let t=typeof e.visibility=="string"?e.visibility.trim():typeof e.codeVisibility=="string"?e.codeVisibility.trim():"";if(t!=="public"&&t!=="private")throw new Error("usage: apps code-visibility <handle>/<repo> --visibility public|private");let n=await f(),r=m(n),i=y(n),o=await g(n,r),{app:c,handle:l,repo:u}=await v(i,o,s),a=await K(i,o,c.id,t);console.log(`${l}/${u} code_visibility=${a.app?.codeVisibility??t} app_id=${c.id}`)}p(oe,"runAppsCodeVisibility");async function ae(e){let s=await f(),t=m(s),n=await g(s,t),r=y(s),i=typeof e.appId=="string"?String(e.appId):void 0,o=await G(r,n,{appId:i});console.log(JSON.stringify(o,null,2))}p(ae,"runAppsPerformance");async function ce(e,s){let t=await f(),n=m(t),r=y(t),i=await g(t,n),{app:o}=await v(r,i,s),c=await k(r,i,o.id);console.log(JSON.stringify(c,null,2))}p(ce,"runAppsSummary");async function le(e,s,t,n){let r=(typeof e.prompt=="string"?e.prompt:null)||n.join(" ");if(!r.trim())throw new Error("usage: apps assistant <plan|performance> <handle>/<repo> --prompt <text>");let i=await f(),o=m(i),c=y(i),l=await g(i,o),{app:u}=await v(c,l,t),a=await W(c,l,{appId:u.id,mode:s,prompt:r.trim()});console.log(JSON.stringify(a,null,2))}p(le,"runAppsAssistant");async function de(e,s){let t=await f(),n=m(t),r=await g(t,n),i=y(t),o=(typeof e.prompt=="string"?e.prompt:null)||s.join(" ");if(!o.trim())throw new Error("usage: apps agent create --prompt <text> [--team-id <id>]");let c=typeof e.templateRepoUrl=="string"?e.templateRepoUrl:void 0,l=typeof e.templateBranch=="string"?e.templateBranch:void 0,u=typeof e.templateLocalPath=="string"?e.templateLocalPath:void 0,a=typeof e.teamId=="string"&&e.teamId.trim()?e.teamId.trim():void 0;if(u&&String(u).trim().length>0)throw new Error("templateLocalPath is not supported; use templateRepoUrl");let d=typeof e.env=="string"?S(e.env,"env"):void 0;if(d){if(typeof d!="object"||Array.isArray(d))throw new Error("env must be a JSON object");for(let[b,A]of Object.entries(d))if(typeof A!="string")throw new Error(`env value for ${b} must be a string`)}let h=c||l||d?{templateRepoUrl:c,templateBranch:l,envVars:d}:void 0,B=typeof e.deployEnvironment=="string"?e.deployEnvironment==="preview"?"preview":"production":void 0,R=e.deployDisabled!==void 0?w(e.deployDisabled):void 0,I=e.streamDeployLogs!==void 0?w(e.streamDeployLogs):!0,E=await C(i,r,{prompt:o.trim(),...a?{teamId:a}:{},...h?{template:h}:{},...B?{deployEnvironment:B}:{},...R!==void 0?{deployDisabled:R}:{},streamDeployLogs:I});if(!E.ok){let b=await E.text().catch(()=>"");throw new Error(`agent create failed: ${E.status} ${b}`)}let N=null,O=null,P=null;await H(E,{onConversationId:p(b=>{N=b},"onConversationId"),onItems:p(b=>{for(let A of b){let U=Q(A);U&&console.log(U);let x=A;!O&&typeof x.appId=="string"&&(O=x.appId),!P&&typeof x.deploymentId=="string"&&(P=x.deploymentId)}},"onItems")}),N&&console.log(`conversation_id: ${N}`),O&&console.log(`app_id: ${O}`),P&&console.log(`deployment_id: ${P}`);try{await J({apiBase:i,apiKey:r,forceRefresh:!0}),await L({apiBase:i,apiKey:r,forceRefresh:!0})}catch(b){console.warn("cache refresh failed",b)}}p(de,"runAppsAgentCreate");async function pe(e,s,t,n){let r=await f(),i=m(r),o=await g(r,i),c=y(r),l=typeof e.method=="string"?String(e.method).toUpperCase():void 0,u=l&&["GET","POST","PUT","DELETE"].includes(l)?l:void 0;if(l&&!u)throw new Error("method must be GET, POST, PUT, or DELETE");let a=typeof e.body=="string"?S(String(e.body),"body"):void 0,d=typeof e.headers=="string"?S(String(e.headers),"headers"):void 0,h=typeof e.scheduleId=="string"?String(e.scheduleId):void 0,B=w(e.notifyEmail),R=w(e.summary)||w(e.withSummary),I=await M(c,o,{appId:s,deploymentId:t,toolName:n,scheduleId:h,method:u,body:a,headers:d,notifyEmail:B||void 0});if(console.log(JSON.stringify(I,null,2)),R&&I.ok){let E=await k(c,o,s);console.log(JSON.stringify({summary:E},null,2))}}p(pe,"runAppsToolsExecute");async function ue(e,s){let t=typeof e.env=="string"?e.env:typeof e.vars=="string"?e.vars:typeof e.envVars=="string"?e.envVars:null;if(!t)throw new Error("usage: apps env set <handle>/<repo> --env <json>");let n=S(t,"env");if(!n||typeof n!="object"||Array.isArray(n))throw new Error("env must be a JSON object");let r={};for(let[d,h]of Object.entries(n)){if(typeof h!="string")throw new Error(`env value for ${d} must be a string`);if(!d.startsWith("OPENTOOL_PUBLIC_"))throw new Error("only OPENTOOL_PUBLIC_ env vars can be set");r[d]=h}let i=await f(),o=m(i),c=y(i),l=await g(i,o),{app:u}=await v(c,l,s),a=await V(c,l,u.id,{envVars:r});console.log(JSON.stringify(a,null,2))}p(ue,"runAppsEnvSet");async function fe(e,s){let t=await f(),n=m(t),r=y(t),i=await g(t,n),{app:o}=await v(r,i,s),c=await _(r,i,o.id);console.log(JSON.stringify(c,null,2))}p(fe,"runAppsEnvGet");async function ge(e,s){let t=await f(),n=m(t),r=y(t),i=await g(t,n),{app:o,handle:c,repo:l}=await v(r,i,s),u=typeof e.env=="string"?e.env:typeof e.environment=="string"?e.environment:void 0,a=j(u),d=await D(r,i,o.id,{environment:a});console.log(JSON.stringify(d,null,2)),(w(e.watch)||w(e.wait)||w(e.follow))&&await q({baseUrl:r,apiKey:i,deploymentId:d.deploymentId,prefix:`[${c}/${l}] `,intervalMs:e.interval?Number(e.interval):void 0,timeoutMs:e.timeout?Number(e.timeout):void 0})}p(ge,"runAppsDeploy");function X(e){let s={};if(typeof e.params=="string"){let n=S(String(e.params),"params");if(!n||typeof n!="object"||Array.isArray(n))throw new Error("params must be a JSON object");for(let[r,i]of Object.entries(n))i!==void 0&&(s[r]=typeof i=="string"?i:JSON.stringify(i))}let t=p((n,r)=>{r===void 0||r===""||(s[n]=r)},"addParam");if(t("source",typeof e.source=="string"?e.source.trim():void 0),t("symbol",typeof e.symbol=="string"?e.symbol.trim():void 0),t("cursor",typeof e.cursor=="string"?e.cursor.trim():void 0),t("status",typeof e.status=="string"?e.status.trim():void 0),t("backtestRunId",typeof e.runId=="string"?e.runId.trim():typeof e.backtestRunId=="string"?e.backtestRunId.trim():void 0),t("since",T(e.since,"since")),t("until",T(e.until,"until")),typeof e.limit=="string"&&e.limit.trim().length>0){let n=Number.parseInt(e.limit,10);if(!Number.isFinite(n))throw new Error("limit must be a number");t("limit",String(n))}return Object.keys(s).length?s:void 0}p(X,"resolveBacktestEventsParams");async function me(e,s){let t=await f(),n=m(t),r=await g(t,n),i=y(t),{app:o}=await v(i,r,s),c={...X(e)??{},appId:o.id},l=await z(i,r,{method:"GET",query:c});console.log(JSON.stringify(l,null,2))}p(me,"runBacktestEvents");async function ye(e,s){let t=typeof e.runId=="string"?e.runId.trim():typeof e.backtestRunId=="string"?e.backtestRunId.trim():"";if(!t)throw new Error("usage: backtest get <handle>/<repo> --run-id <id>");let n=await f(),r=m(n),i=await g(n,r),o=y(n),{app:c}=await v(o,i,s),l=await F(o,i,{appId:c.id,runId:t});console.log(JSON.stringify(l,null,2))}p(ye,"runBacktestGet");export{X as resolveBacktestEventsParams,de as runAppsAgentCreate,le as runAppsAssistant,oe as runAppsCodeVisibility,ge as runAppsDeploy,fe as runAppsEnvGet,ue as runAppsEnvSet,se as runAppsList,ae as runAppsPerformance,ce as runAppsSummary,ie as runAppsTools,pe as runAppsToolsExecute,me as runBacktestEvents,ye as runBacktestGet};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as fe,b as me,d as he,e as q,f as L,g as ye,h as Ae,i as ge,j as Pe}from"./chunk-FXIUKYUR.js";import{e as pe}from"./chunk-6QUICEQA.js";import{d as N,e as B}from"./chunk-Z3D4C7BG.js";import{D as oe,g as te}from"./chunk-MTJNKRXL.js";import{p as de}from"./chunk-HZP5U2AA.js";import{a}from"./chunk-FTQLQJQV.js";import{randomUUID as qe}from"node:crypto";var Te=new URL(B).hostname,we=new URL(N).hostname,Ne=`${B}/opchat/v1`;function l(e){if(!e)return null;let n=e.trim();return n?n.replace(/\/+$/,""):null}a(l,"normalizeBaseUrl");function V(e){let n=l(e);if(!n)return null;try{let o=new URL(n).hostname.toLowerCase();if(o===Te)return B;if(o===we||o===`www.${we}`||o==="openpond.live"||o==="www.openpond.live")return B;if(o.startsWith("api."))return n}catch{return null}return null}a(V,"mapUiBaseToApiBase");function G(e,n){let t=l(process.env.OPENPOND_API_URL);if(t)return t;let o=l(e?.apiBaseUrl);if(o)return o;let r=l(n.apiBaseUrl);if(r)return r;let s=V(process.env.OPENPOND_BASE_URL);return s||(V(e?.baseUrl||n.baseUrl)??B)}a(G,"resolvePublicApiBaseUrl");function J(e,n,t){return Le(e,n,t)}a(J,"resolveHostedChatApiBaseUrl");function Le(e,n,t){let o=typeof process<"u"?process.env:{};return W(o.OPENPOND_OPCHAT_API_URL)??W(e?.chatApiBaseUrl??n.chatApiBaseUrl)??W(o.OPENPOND_CHAT_API_URL)??De(t)}a(Le,"resolveOpChatApiBaseUrl");function W(e){let n=l(e);if(!n)return null;try{let t=new URL(n),o=t.pathname.split("/").filter(Boolean),r=o.findIndex(i=>i.toLowerCase()==="opchat");return r>=0?(t.pathname=`/${[...o.slice(0,r+1),"v1"].join("/")}`,t.search="",t.hash="",l(t.toString())??null):o.findIndex(i=>i.toLowerCase()==="v1")>=0?(t.pathname="/opchat/v1",t.search="",t.hash="",l(t.toString())??null):(t.pathname=`${t.pathname.replace(/\/+$/,"")}/opchat/v1`.replace(/\/{2,}/g,"/"),t.search="",t.hash="",l(t.toString())??null)}catch{return null}}a(W,"normalizeOpChatApiBaseUrl");function De(e){return W(e)??Ne}a(De,"opChatBaseFromPublicApiBase");function D(e){return e?.trim()?e.trim():"production"}a(D,"deriveEnvironment");function Y(e,n=process.env){let t=[e?.apiKey,e?.session?.token,e?.token,n.OPENPOND_API_KEY];for(let o of t){let r=typeof o=="string"?o.trim():"";if(r)return r}return null}a(Y,"accountToken");function P(e,n){return!!(e&&n&&e.toLowerCase()===n.toLowerCase())}a(P,"handleEquals");function b(e,n){return l(e)===l(n)}a(b,"baseUrlEquals");function F(e,n){return`${e?.trim().toLowerCase()||""}|${l(n)??"default"}`}a(F,"profileKey");function Q(e){return l(e?.baseUrl)}a(Q,"selectorBaseUrl");function _(e){let n=l(e.baseUrl);return n?{handle:e.handle,baseUrl:n}:{handle:e.handle}}a(_,"selectorFromAccount");function A(e){let n=typeof e?.handle=="string"?e.handle.trim():"";if(!n)return null;let t=l(e?.baseUrl);return t?{handle:n,baseUrl:t}:{handle:n}}a(A,"normalizeActiveProfile");function U(e,n){if(!P(e.handle,n.handle))return!1;let t=Q(n);return t?b(e.baseUrl,t):!l(e.baseUrl)}a(U,"accountMatchesSelector");function re(e,n){if(!P(e.handle,n.handle))return!1;let t=Q(n);return t?b(e.baseUrl,t):!l(e.baseUrl)}a(re,"profileMatchesSelector");function Oe(e,n,t){let o=Array.isArray(e.accounts)?e.accounts:[],r=n||process.env.OPENPOND_ACCOUNT?A({handle:n||process.env.OPENPOND_ACCOUNT||"",baseUrl:t??process.env.OPENPOND_BASE_URL??null}):A(e.activeProfile);if(r){let s=o.find(c=>U(c,r));if(s)return s;let i=o.filter(c=>P(c.handle,r.handle));return i.length===1?i[0]??null:null}return o[0]?o[0]:null}a(Oe,"findActiveAccount");function xe(e){let n=Array.isArray(e.accounts)?e.accounts:[],t=A(e.activeProfile)??(n[0]?_(n[0]):null);return ae(n.map(o=>({handle:o.handle,baseUrl:l(o.baseUrl),apiBaseUrl:l(o.apiBaseUrl),chatApiBaseUrl:l(o.chatApiBaseUrl),environment:D(o.environment),isActive:t?U(o,t):!1,hasApiKey:!!o.apiKey?.trim(),hasSessionToken:!!(o.session?.token?.trim()||o.token?.trim()),sessionAppId:o.session?.appId??null,sessionConversationId:o.session?.conversationId??null})))}a(xe,"fallbackProfilesFromConfig");function ae(e){let n=new Map;for(let t of e){let o=l(t.baseUrl),r=`${t.handle.toLowerCase()}|${o??"default"}`,s={...t,baseUrl:o,apiBaseUrl:l(t.apiBaseUrl),chatApiBaseUrl:l(t.chatApiBaseUrl),environment:D(t.environment),isActive:t.isActive},i=n.get(r);(!i||s.isActive&&!i.isActive||s.hasApiKey&&!i.hasApiKey)&&n.set(r,s)}return Array.from(n.values())}a(ae,"normalizeProfiles");function be(e){return e.hasApiKey||e.hasSessionToken?"signed_in":"signed_out"}a(be,"profileAuthHealth");function $e(e,n){return e?{reachable:e.reachable,authenticated:e.authenticated,apiBase:e.apiBase||n,latencyMs:e.latencyMs,status:e.status,service:e.service,checkedAt:e.checkedAt,error:e.error??null}:null}a($e,"normalizeHealth");function Ue(e){let n=e?.account;return n?{id:n.id??null,email:n.email??null,name:n.name??null,handle:n.handle??null,image:n.image??null,timezone:n.timezone??null,isAdmin:n.isAdmin??null,isVerified:n.isVerified??null,dailyAgentAppId:n.dailyAgentAppId??null,dailyAgentDeploymentId:n.dailyAgentDeploymentId??null,credits:n.credits??null}:null}a(Ue,"normalizeProfile");function He(e){return(e??[]).map(n=>({...n,id:n.id||n.userProductId||n.openPondProductId||n.name,name:n.name,type:n.type,status:n.status,isActive:n.isActive??null,price:n.price??null,currency:n.currency??null,credits:n.credits??null}))}a(He,"normalizeProducts");function Me(e){return e.handle.trim().toLowerCase()==="default"&&!l(e.baseUrl)&&!e.hasApiKey&&!e.hasSessionToken}a(Me,"isEmptyDefaultProfile");function ze(e){let n=e?.trim();return n?n.length>=12?`\u2022\u2022\u2022\u2022\u2022\u2022${n.slice(-6)}`:"\u2022\u2022\u2022\u2022\u2022\u2022":null}a(ze,"apiKeyHint");function Fe(e){return e?.auth?.authType!=="openpond-api-key"||!e.auth.keyAccess?null:{ownerType:e.auth.keyAccess.ownerType,teamId:e.auth.keyAccess.teamId,scopes:e.auth.scopes}}a(Fe,"apiKeyAccess");function X(e){let{config:n,profiles:t,account:o,token:r,apiBaseUrl:s,accountResponse:i,accountProfiles:c,health:m,authFailed:g,error:f}=e,w=J(o,n,s),h=Ue(i??null),C=A(n.activeProfile),v=(o?_(o):null)??C,O=h?.handle||o?.handle||v?.handle||null,I=(v?t.find(d=>re(d,v)):null)??t.find(d=>d.isActive)??null,y=g?"auth_error":r?"signed_in":"signed_out",u=h?.name||h?.handle||h?.email||O||"Signed out",R=l(I?.baseUrl||o?.baseUrl||N),k=D(I?.environment||o?.environment),x=A(v)??(O?A({handle:O,baseUrl:I?.baseUrl??o?.baseUrl}):null),M=(t.length>0?t:O?[{handle:O,baseUrl:Q(x)??l(o?.baseUrl),apiBaseUrl:s,chatApiBaseUrl:w,environment:k,isActive:!0,hasApiKey:!!r,hasSessionToken:!1,sessionAppId:null,sessionConversationId:null}]:[]).filter(d=>!Me(d));return{state:y,activeProfile:x,label:u,email:h?.email??null,avatarUrl:h?.image??null,environment:k,baseUrl:R,apiBaseUrl:s,chatApiBaseUrl:w,creditsLabel:h?.credits??null,profile:h,products:He(i?.products),apiHealth:$e(m??null,s),accounts:M.map(d=>{let T=l(d.baseUrl),Re=n.accounts?.find(ue=>P(ue.handle,d.handle)&&b(ue.baseUrl,T)),ne=c?.[F(d.handle,T)]??null,z=Ue(ne?.response??null);return{handle:d.handle,baseUrl:T,apiBaseUrl:l(d.apiBaseUrl),chatApiBaseUrl:l(d.chatApiBaseUrl),environment:D(d.environment),isActive:x?re(d,x):!1,authHealth:ne?.authFailed?"auth_error":be(d),displayLabel:z?.name||z?.handle||z?.email||d.handle,email:z?.email??null,avatarUrl:z?.image??null,apiKeyHint:ze(Re?.apiKey),apiKeyAccess:Fe(ne?.response??null)}}),error:f??m?.error??null}}a(X,"toAccountState");async function je(e){try{return ae(await Ae())}catch{return xe(e)}}a(je,"loadProfiles");async function p(e,n){let t=await ye(),o=await je(t),r=Oe(t,e,n),s=Y(r),i=G(r,t),c=J(r,t,i);return{config:t,profiles:o,account:r,token:s,apiBaseUrl:i,chatApiBaseUrl:c,accountState:X({config:t,profiles:o,account:r,token:s,apiBaseUrl:i})}}a(p,"loadOpenPondAccountContext");async function Ke(e){let n=l(e.baseUrl);return await ge(e.handle,{baseUrl:n}),p(e.handle,n)}a(Ke,"switchOpenPondAccount");function $(e){return e instanceof Error?e.message:String(e)}a($,"errorMessage");var We=15e3;function Ve(e){return e===oe?"OpenPond Chat":e==="deepseek-v4-flash"?"DeepSeek V4 Flash":e.replace(/[-_/]+/g," ")}a(Ve,"displayNameForHostedModel");function Ge(e){let n=typeof e.id=="string"?e.id:null;return n?{id:n,displayName:Ve(n),ownedBy:typeof e.owned_by=="string"?e.owned_by:null,streaming:!0,raw:e}:null}a(Ge,"normalizeHostedModel");async function Je(){let e=await p();if(!e.token)return{models:[],error:"No OpenPond API key or session token is configured."};try{return{models:(await Xe({apiBaseUrl:e.chatApiBaseUrl,token:e.token})).data.map(o=>Ge(o)).filter(o=>!!o),error:null}}catch(n){return{models:[],error:$(n)}}}a(Je,"loadOpenPondHostedModels");async function Ye(){let e=await p();if(!e.token)return{catalog:null,error:"No OpenPond API key or session token is configured."};let n=new AbortController,t=setTimeout(()=>{n.abort(new Error("OpenPond provider catalog request timed out."))},We);try{return{catalog:await Ee({apiBaseUrl:e.chatApiBaseUrl,token:e.token,signal:n.signal}),error:null}}catch(o){return{catalog:null,error:$(o)}}finally{clearTimeout(t)}}a(Ye,"loadOpenPondProviderCatalog");async function*Qe(e){let n=await p();if(!n.token)throw new Error("OpenPond is signed out. Add an account in Settings before using OpenPond Chat.");yield*ve({apiBaseUrl:n.chatApiBaseUrl,token:n.token,model:e.model||oe,messages:e.messages,tools:e.tools,toolChoice:e.toolChoice,requestId:e.requestId,reasoningEffort:e.reasoningEffort,maxTokens:e.maxTokens,temperature:e.temperature,topP:e.topP,signal:e.signal})}a(Qe,"streamOpenPondHostedChatTurn");async function Xe(e){let n=se(e.apiBaseUrl,"models"),t=await fetch(n,{method:"GET",headers:ie(e.token,"application/json"),signal:e.signal});if(!t.ok)throw new Error(`OpenPond OpChat model list failed: ${t.status} ${await le(t)}`);return await t.json()}a(Xe,"listOpChatModels");async function Ee(e){let n=se(e.apiBaseUrl,"provider-catalog"),t=await fetch(n,{method:"GET",headers:ie(e.token,"application/json"),signal:e.signal});if(!t.ok)throw new Error(`OpenPond OpChat provider catalog failed: ${t.status} ${await le(t)}`);let o=await t.json();return!o||typeof o!="object"||!Array.isArray(o.providers)?te.parse(o):te.parse({...o,providers:o.providers.filter(r=>r!==null&&typeof r=="object"&&de.safeParse(r.id).success)})}a(Ee,"listOpChatProviderCatalog");async function*ve(e){let n=se(e.apiBaseUrl,"chat/completions"),t=await fetch(n,{method:"POST",headers:ie(e.token,"text/event-stream",e.requestId),body:JSON.stringify(rn(e,!0)),signal:e.signal});if(!t.ok)throw new Error(`OpenPond OpChat request failed: ${t.status} ${await le(t)}`);if(!t.body)throw new Error("OpenPond OpChat request failed: streaming response body is missing.");let o=new Map,r=!1,s=null,i={},c="",m=null,g=Ze(t.headers),f=t.body.getReader(),w=new TextDecoder,h="",C=[],ee=a(()=>{if(C.length===0)return[];let y=C.join(`
|
|
2
|
+
import{a as fe,b as me,d as he,e as q,f as L,g as ye,h as Ae,i as ge,j as Pe}from"./chunk-ZJY2L43W.js";import{e as pe}from"./chunk-6JBWHR6T.js";import{d as N,e as B}from"./chunk-Z3D4C7BG.js";import{D as oe,g as te}from"./chunk-L4BYPZ4U.js";import{p as de}from"./chunk-P653BXMY.js";import{a}from"./chunk-FTQLQJQV.js";import{randomUUID as qe}from"node:crypto";var Te=new URL(B).hostname,we=new URL(N).hostname,Ne=`${B}/opchat/v1`;function l(e){if(!e)return null;let n=e.trim();return n?n.replace(/\/+$/,""):null}a(l,"normalizeBaseUrl");function V(e){let n=l(e);if(!n)return null;try{let o=new URL(n).hostname.toLowerCase();if(o===Te)return B;if(o===we||o===`www.${we}`||o==="openpond.live"||o==="www.openpond.live")return B;if(o.startsWith("api."))return n}catch{return null}return null}a(V,"mapUiBaseToApiBase");function G(e,n){let t=l(process.env.OPENPOND_API_URL);if(t)return t;let o=l(e?.apiBaseUrl);if(o)return o;let r=l(n.apiBaseUrl);if(r)return r;let s=V(process.env.OPENPOND_BASE_URL);return s||(V(e?.baseUrl||n.baseUrl)??B)}a(G,"resolvePublicApiBaseUrl");function J(e,n,t){return Le(e,n,t)}a(J,"resolveHostedChatApiBaseUrl");function Le(e,n,t){let o=typeof process<"u"?process.env:{};return W(o.OPENPOND_OPCHAT_API_URL)??W(e?.chatApiBaseUrl??n.chatApiBaseUrl)??W(o.OPENPOND_CHAT_API_URL)??De(t)}a(Le,"resolveOpChatApiBaseUrl");function W(e){let n=l(e);if(!n)return null;try{let t=new URL(n),o=t.pathname.split("/").filter(Boolean),r=o.findIndex(i=>i.toLowerCase()==="opchat");return r>=0?(t.pathname=`/${[...o.slice(0,r+1),"v1"].join("/")}`,t.search="",t.hash="",l(t.toString())??null):o.findIndex(i=>i.toLowerCase()==="v1")>=0?(t.pathname="/opchat/v1",t.search="",t.hash="",l(t.toString())??null):(t.pathname=`${t.pathname.replace(/\/+$/,"")}/opchat/v1`.replace(/\/{2,}/g,"/"),t.search="",t.hash="",l(t.toString())??null)}catch{return null}}a(W,"normalizeOpChatApiBaseUrl");function De(e){return W(e)??Ne}a(De,"opChatBaseFromPublicApiBase");function D(e){return e?.trim()?e.trim():"production"}a(D,"deriveEnvironment");function Y(e,n=process.env){let t=[e?.apiKey,e?.session?.token,e?.token,n.OPENPOND_API_KEY];for(let o of t){let r=typeof o=="string"?o.trim():"";if(r)return r}return null}a(Y,"accountToken");function P(e,n){return!!(e&&n&&e.toLowerCase()===n.toLowerCase())}a(P,"handleEquals");function b(e,n){return l(e)===l(n)}a(b,"baseUrlEquals");function F(e,n){return`${e?.trim().toLowerCase()||""}|${l(n)??"default"}`}a(F,"profileKey");function Q(e){return l(e?.baseUrl)}a(Q,"selectorBaseUrl");function _(e){let n=l(e.baseUrl);return n?{handle:e.handle,baseUrl:n}:{handle:e.handle}}a(_,"selectorFromAccount");function A(e){let n=typeof e?.handle=="string"?e.handle.trim():"";if(!n)return null;let t=l(e?.baseUrl);return t?{handle:n,baseUrl:t}:{handle:n}}a(A,"normalizeActiveProfile");function U(e,n){if(!P(e.handle,n.handle))return!1;let t=Q(n);return t?b(e.baseUrl,t):!l(e.baseUrl)}a(U,"accountMatchesSelector");function re(e,n){if(!P(e.handle,n.handle))return!1;let t=Q(n);return t?b(e.baseUrl,t):!l(e.baseUrl)}a(re,"profileMatchesSelector");function Oe(e,n,t){let o=Array.isArray(e.accounts)?e.accounts:[],r=n||process.env.OPENPOND_ACCOUNT?A({handle:n||process.env.OPENPOND_ACCOUNT||"",baseUrl:t??process.env.OPENPOND_BASE_URL??null}):A(e.activeProfile);if(r){let s=o.find(c=>U(c,r));if(s)return s;let i=o.filter(c=>P(c.handle,r.handle));return i.length===1?i[0]??null:null}return o[0]?o[0]:null}a(Oe,"findActiveAccount");function xe(e){let n=Array.isArray(e.accounts)?e.accounts:[],t=A(e.activeProfile)??(n[0]?_(n[0]):null);return ae(n.map(o=>({handle:o.handle,baseUrl:l(o.baseUrl),apiBaseUrl:l(o.apiBaseUrl),chatApiBaseUrl:l(o.chatApiBaseUrl),environment:D(o.environment),isActive:t?U(o,t):!1,hasApiKey:!!o.apiKey?.trim(),hasSessionToken:!!(o.session?.token?.trim()||o.token?.trim()),sessionAppId:o.session?.appId??null,sessionConversationId:o.session?.conversationId??null})))}a(xe,"fallbackProfilesFromConfig");function ae(e){let n=new Map;for(let t of e){let o=l(t.baseUrl),r=`${t.handle.toLowerCase()}|${o??"default"}`,s={...t,baseUrl:o,apiBaseUrl:l(t.apiBaseUrl),chatApiBaseUrl:l(t.chatApiBaseUrl),environment:D(t.environment),isActive:t.isActive},i=n.get(r);(!i||s.isActive&&!i.isActive||s.hasApiKey&&!i.hasApiKey)&&n.set(r,s)}return Array.from(n.values())}a(ae,"normalizeProfiles");function be(e){return e.hasApiKey||e.hasSessionToken?"signed_in":"signed_out"}a(be,"profileAuthHealth");function $e(e,n){return e?{reachable:e.reachable,authenticated:e.authenticated,apiBase:e.apiBase||n,latencyMs:e.latencyMs,status:e.status,service:e.service,checkedAt:e.checkedAt,error:e.error??null}:null}a($e,"normalizeHealth");function Ue(e){let n=e?.account;return n?{id:n.id??null,email:n.email??null,name:n.name??null,handle:n.handle??null,image:n.image??null,timezone:n.timezone??null,isAdmin:n.isAdmin??null,isVerified:n.isVerified??null,dailyAgentAppId:n.dailyAgentAppId??null,dailyAgentDeploymentId:n.dailyAgentDeploymentId??null,credits:n.credits??null}:null}a(Ue,"normalizeProfile");function He(e){return(e??[]).map(n=>({...n,id:n.id||n.userProductId||n.openPondProductId||n.name,name:n.name,type:n.type,status:n.status,isActive:n.isActive??null,price:n.price??null,currency:n.currency??null,credits:n.credits??null}))}a(He,"normalizeProducts");function Me(e){return e.handle.trim().toLowerCase()==="default"&&!l(e.baseUrl)&&!e.hasApiKey&&!e.hasSessionToken}a(Me,"isEmptyDefaultProfile");function ze(e){let n=e?.trim();return n?n.length>=12?`\u2022\u2022\u2022\u2022\u2022\u2022${n.slice(-6)}`:"\u2022\u2022\u2022\u2022\u2022\u2022":null}a(ze,"apiKeyHint");function Fe(e){return e?.auth?.authType!=="openpond-api-key"||!e.auth.keyAccess?null:{ownerType:e.auth.keyAccess.ownerType,teamId:e.auth.keyAccess.teamId,scopes:e.auth.scopes}}a(Fe,"apiKeyAccess");function X(e){let{config:n,profiles:t,account:o,token:r,apiBaseUrl:s,accountResponse:i,accountProfiles:c,health:m,authFailed:g,error:f}=e,w=J(o,n,s),h=Ue(i??null),C=A(n.activeProfile),v=(o?_(o):null)??C,O=h?.handle||o?.handle||v?.handle||null,I=(v?t.find(d=>re(d,v)):null)??t.find(d=>d.isActive)??null,y=g?"auth_error":r?"signed_in":"signed_out",u=h?.name||h?.handle||h?.email||O||"Signed out",R=l(I?.baseUrl||o?.baseUrl||N),k=D(I?.environment||o?.environment),x=A(v)??(O?A({handle:O,baseUrl:I?.baseUrl??o?.baseUrl}):null),M=(t.length>0?t:O?[{handle:O,baseUrl:Q(x)??l(o?.baseUrl),apiBaseUrl:s,chatApiBaseUrl:w,environment:k,isActive:!0,hasApiKey:!!r,hasSessionToken:!1,sessionAppId:null,sessionConversationId:null}]:[]).filter(d=>!Me(d));return{state:y,activeProfile:x,label:u,email:h?.email??null,avatarUrl:h?.image??null,environment:k,baseUrl:R,apiBaseUrl:s,chatApiBaseUrl:w,creditsLabel:h?.credits??null,profile:h,products:He(i?.products),apiHealth:$e(m??null,s),accounts:M.map(d=>{let T=l(d.baseUrl),Re=n.accounts?.find(ue=>P(ue.handle,d.handle)&&b(ue.baseUrl,T)),ne=c?.[F(d.handle,T)]??null,z=Ue(ne?.response??null);return{handle:d.handle,baseUrl:T,apiBaseUrl:l(d.apiBaseUrl),chatApiBaseUrl:l(d.chatApiBaseUrl),environment:D(d.environment),isActive:x?re(d,x):!1,authHealth:ne?.authFailed?"auth_error":be(d),displayLabel:z?.name||z?.handle||z?.email||d.handle,email:z?.email??null,avatarUrl:z?.image??null,apiKeyHint:ze(Re?.apiKey),apiKeyAccess:Fe(ne?.response??null)}}),error:f??m?.error??null}}a(X,"toAccountState");async function je(e){try{return ae(await Ae())}catch{return xe(e)}}a(je,"loadProfiles");async function p(e,n){let t=await ye(),o=await je(t),r=Oe(t,e,n),s=Y(r),i=G(r,t),c=J(r,t,i);return{config:t,profiles:o,account:r,token:s,apiBaseUrl:i,chatApiBaseUrl:c,accountState:X({config:t,profiles:o,account:r,token:s,apiBaseUrl:i})}}a(p,"loadOpenPondAccountContext");async function Ke(e){let n=l(e.baseUrl);return await ge(e.handle,{baseUrl:n}),p(e.handle,n)}a(Ke,"switchOpenPondAccount");function $(e){return e instanceof Error?e.message:String(e)}a($,"errorMessage");var We=15e3;function Ve(e){return e===oe?"OpenPond Chat":e==="deepseek-v4-flash"?"DeepSeek V4 Flash":e.replace(/[-_/]+/g," ")}a(Ve,"displayNameForHostedModel");function Ge(e){let n=typeof e.id=="string"?e.id:null;return n?{id:n,displayName:Ve(n),ownedBy:typeof e.owned_by=="string"?e.owned_by:null,streaming:!0,raw:e}:null}a(Ge,"normalizeHostedModel");async function Je(){let e=await p();if(!e.token)return{models:[],error:"No OpenPond API key or session token is configured."};try{return{models:(await Xe({apiBaseUrl:e.chatApiBaseUrl,token:e.token})).data.map(o=>Ge(o)).filter(o=>!!o),error:null}}catch(n){return{models:[],error:$(n)}}}a(Je,"loadOpenPondHostedModels");async function Ye(){let e=await p();if(!e.token)return{catalog:null,error:"No OpenPond API key or session token is configured."};let n=new AbortController,t=setTimeout(()=>{n.abort(new Error("OpenPond provider catalog request timed out."))},We);try{return{catalog:await Ee({apiBaseUrl:e.chatApiBaseUrl,token:e.token,signal:n.signal}),error:null}}catch(o){return{catalog:null,error:$(o)}}finally{clearTimeout(t)}}a(Ye,"loadOpenPondProviderCatalog");async function*Qe(e){let n=await p();if(!n.token)throw new Error("OpenPond is signed out. Add an account in Settings before using OpenPond Chat.");yield*ve({apiBaseUrl:n.chatApiBaseUrl,token:n.token,model:e.model||oe,messages:e.messages,tools:e.tools,toolChoice:e.toolChoice,requestId:e.requestId,reasoningEffort:e.reasoningEffort,maxTokens:e.maxTokens,temperature:e.temperature,topP:e.topP,signal:e.signal})}a(Qe,"streamOpenPondHostedChatTurn");async function Xe(e){let n=se(e.apiBaseUrl,"models"),t=await fetch(n,{method:"GET",headers:ie(e.token,"application/json"),signal:e.signal});if(!t.ok)throw new Error(`OpenPond OpChat model list failed: ${t.status} ${await le(t)}`);return await t.json()}a(Xe,"listOpChatModels");async function Ee(e){let n=se(e.apiBaseUrl,"provider-catalog"),t=await fetch(n,{method:"GET",headers:ie(e.token,"application/json"),signal:e.signal});if(!t.ok)throw new Error(`OpenPond OpChat provider catalog failed: ${t.status} ${await le(t)}`);let o=await t.json();return!o||typeof o!="object"||!Array.isArray(o.providers)?te.parse(o):te.parse({...o,providers:o.providers.filter(r=>r!==null&&typeof r=="object"&&de.safeParse(r.id).success)})}a(Ee,"listOpChatProviderCatalog");async function*ve(e){let n=se(e.apiBaseUrl,"chat/completions"),t=await fetch(n,{method:"POST",headers:ie(e.token,"text/event-stream",e.requestId),body:JSON.stringify(rn(e,!0)),signal:e.signal});if(!t.ok)throw new Error(`OpenPond OpChat request failed: ${t.status} ${await le(t)}`);if(!t.body)throw new Error("OpenPond OpChat request failed: streaming response body is missing.");let o=new Map,r=!1,s=null,i={},c="",m=null,g=Ze(t.headers),f=t.body.getReader(),w=new TextDecoder,h="",C=[],ee=a(()=>{if(C.length===0)return[];let y=C.join(`
|
|
3
3
|
`);if(C=[],y==="[DONE]")return r=!0,[];let u;try{u=JSON.parse(y)}catch{throw new Error("OpenPond OpChat request failed: malformed streaming event.")}if(u&&typeof u=="object"&&"error"in u)throw new Error(`OpenPond OpChat request failed: ${_e(u)}`);i=u;let R=u&&typeof u=="object"?u:{},k=Array.isArray(R.choices)?R.choices:[],x=k[0]&&typeof k[0]=="object"?k[0]:{},K=x.delta&&typeof x.delta=="object"?x.delta:{},M=[],d=Be(K.reasoning_content);d&&(c+=d,M.push({type:"reasoning_delta",text:d,raw:u}));let T=Be(K.content);return T&&M.push({type:"text_delta",text:T,raw:u}),tn(o,K.tool_calls),s=H(x.finish_reason)??s,m=ln(u)??m,M},"consumeEvent"),v=a(y=>{let u=y.endsWith("\r")?y.slice(0,-1):y;return u?u.startsWith(":")?[]:(u.startsWith("data:")&&C.push(u.slice(5).trimStart()),[]):ee()},"consumeLine");try{for(;;){let y=await f.read();if(y.done)break;h+=w.decode(y.value,{stream:!0});let u=h.split(`
|
|
4
4
|
`);h=u.pop()??"";for(let R of u)for(let k of v(R))yield k}if(h+=w.decode(),h)for(let y of v(h))yield y;for(let y of ee())yield y}finally{f.releaseLock()}if(!r)throw new Error("OpenPond OpChat request failed: stream ended before [DONE].");let O=on(o);O.length>0&&(yield{type:"tool_call_delta",toolCalls:O,raw:i}),O.length>0&&c&&(yield{type:"continuation",continuation:{kind:"chat_completions_reasoning",reasoningContent:c},raw:i});let I=en(m,g);I&&(yield{type:"usage",usage:I,raw:i}),yield{type:"finish",finishReason:s,raw:i}}a(ve,"streamOpChatChatCompletion");function Ze(e){let n=ke(e,["fireworks-prompt-tokens","prompt-tokens"]),t=ke(e,["fireworks-cached-prompt-tokens","cached-prompt-tokens"]);return t===null?null:{...n===null?{}:{prompt_tokens:n},cached_input_tokens:t,cache_telemetry_source:"provider_response_headers"}}a(Ze,"cacheUsageFromResponseHeaders");function ke(e,n){for(let t of n){let o=e.get(t);if(o===null||!/^\d+$/.test(o.trim()))continue;let r=Number(o);if(Number.isSafeInteger(r)&&r>=0)return r}return null}a(ke,"firstHeaderTokenCount");function en(e,n){if(!n||nn(e))return e;let t={...e??{},cached_input_tokens:n.cached_input_tokens,cache_telemetry_source:"provider_response_headers"};return E(e?.prompt_tokens)===null&&n.prompt_tokens!==void 0&&(t.prompt_tokens=n.prompt_tokens),t}a(en,"usageWithResponseHeaderCache");function nn(e){return e?E(e.cached_input_tokens)!==null||E(e.cache_read_input_tokens)!==null||E(e.cache_creation_input_tokens)!==null||E(e.prompt_cache_hit_tokens)!==null||E(e.prompt_cache_miss_tokens)!==null?!0:E(e.prompt_tokens_details?.cached_tokens)!==null||E(e.input_tokens_details?.cached_tokens)!==null:!1}a(nn,"usageHasCacheTelemetry");function E(e){if(typeof e=="number"&&Number.isSafeInteger(e)&&e>=0)return e;if(typeof e!="string"||!/^\d+$/.test(e.trim()))return null;let n=Number(e);return Number.isSafeInteger(n)?n:null}a(E,"usageTokenCount");function tn(e,n){Array.isArray(n)&&n.forEach((t,o)=>{if(!t||typeof t!="object")return;let r=t,s=typeof r.index=="number"&&Number.isInteger(r.index)?r.index:o,i=e.get(s)??{arguments:""};typeof r.id=="string"&&(i.id=r.id);let c=r.function&&typeof r.function=="object"?r.function:{};typeof c.name=="string"&&(i.name=`${i.name??""}${c.name}`),typeof c.arguments=="string"&&(i.arguments+=c.arguments),e.set(s,i)})}a(tn,"mergeOpChatToolCallDeltas");function on(e){return[...e.entries()].sort(([n],[t])=>n-t).flatMap(([,n])=>n.id&&n.name?[{id:n.id,type:"function",function:{name:n.name,arguments:n.arguments}}]:[])}a(on,"completedOpChatToolCalls");function rn(e,n){let t={model:e.model,messages:e.messages.map(sn),stream:n};return e.tools&&(t.tools=e.tools),e.toolChoice!==void 0&&(t.tool_choice=e.toolChoice),typeof e.maxTokens=="number"&&(t.max_tokens=e.maxTokens),typeof e.temperature=="number"&&(t.temperature=e.temperature),typeof e.topP=="number"&&(t.top_p=e.topP),Object.assign(t,an(e.reasoningEffort)),t}a(rn,"buildOpChatBody");function an(e){return e?e==="off"?{thinking:{type:"disabled"}}:{thinking:{type:"enabled"},reasoning_effort:e}:{}}a(an,"opChatReasoningFields");function sn(e){let{continuation:n,images:t,...o}=e,r=t?.length?[...typeof e.content=="string"&&e.content.trim()?[{type:"text",text:e.content}]:[],...t.map(s=>({type:"image_url",image_url:{url:s.url,...s.detail?{detail:s.detail}:{}}}))]:e.content;return e.role==="assistant"&&n?.kind==="chat_completions_reasoning"?{...o,...r!==void 0?{content:r}:{},reasoning_content:n.reasoningContent}:{...o,...r!==void 0?{content:r}:{}}}a(sn,"opChatMessage");function se(e,n){let t=e.trim().replace(/\/+$/,"");if(!t)throw new Error("OpenPond OpChat API base URL is required.");return`${t}/${n}`}a(se,"opChatEndpointUrl");function ie(e,n,t){let o=e.trim();if(!o)throw new Error("OpenPond API key is required for OpChat.");let r=new Headers;r.set("Authorization",`Bearer ${o}`),r.set("Content-Type","application/json"),r.set("Accept",n),r.set("x-openpond-client","openpond-app");let s=t||qe();return r.set("x-openpond-request-id",s),r.set("x-request-id",s),r}a(ie,"opChatHeaders");async function le(e){let n=await e.text().catch(()=>"");if(!n)return e.statusText||`HTTP ${e.status}`;try{return _e(JSON.parse(n))}catch{return n}}a(le,"readOpChatError");function _e(e){if(!e||typeof e!="object")return String(e||"unknown_error");let n=e,t=n.error;if(t&&typeof t=="object"){let o=t;return[H(o.code),H(o.type),H(o.message)].filter(Boolean).join(": ")}return[H(n.error),H(n.message)].filter(Boolean).join(": ")||JSON.stringify(e)}a(_e,"errorMessageFromPayload");function ln(e){if(!e||typeof e!="object")return null;let n=e.usage;return!n||typeof n!="object"?null:n}a(ln,"parseUsage");function H(e){return typeof e=="string"&&e.trim()?e:null}a(H,"stringValue");function Be(e){return typeof e=="string"&&e.length>0?e:null}a(Be,"streamTextValue");import{readFileSync as cn}from"node:fs";var j;function un(){if(j!==void 0)return j??"openpond-code bundled";try{let e=new URL("../package.json",import.meta.resolve("openpond")),n=JSON.parse(cn(e,"utf8"));j=typeof n.version=="string"?`openpond-code@${n.version}`:null}catch{j=null}return j??"openpond-code bundled"}a(un,"getBundledRuntimeVersion");import{spawn as dn}from"node:child_process";function Se(e,n=process.platform){return n==="darwin"?{command:"open",args:[e]}:n==="win32"?{command:"rundll32.exe",args:["url.dll,FileProtocolHandler",e]}:{command:"xdg-open",args:[e]}}a(Se,"resolveSystemBrowserCommand");async function pn(e,n={}){let t=n.command??Se(e),o=n.handoffTimeoutMs??1500;return new Promise(r=>{let s=!1,i=null,c=a(g=>{s||(s=!0,i&&clearTimeout(i),r(g))},"finish"),m=dn(t.command,t.args,{detached:!1,shell:!1,stdio:"ignore",windowsHide:!0});m.once("error",g=>{let f=g.code;c({opened:!1,error:f?`browser launcher ${t.command} failed (${f})`:`browser launcher ${t.command} failed`})}),m.once("close",(g,f)=>{if(g===0){c({opened:!0});return}let w=f?`signal ${f}`:`code ${g??"unknown"}`;c({opened:!1,error:`browser launcher ${t.command} exited with ${w}`})}),i=setTimeout(()=>{m.unref(),c({opened:!0})},o),i.unref()})}a(pn,"openUrlWithSystemBrowser");function fn(e){if(!e||typeof e!="object")return null;let n=e,t=typeof n.id=="string"?n.id:null,o=typeof n.name=="string"?n.name:t;if(!t||!o)return null;let r=n.latestDeployment&&typeof n.latestDeployment=="object"?n.latestDeployment:null,s=pe.safeParse(n.sandboxActionRegistry);return{id:t,name:o,description:typeof n.description=="string"?n.description:null,visibility:typeof n.visibility=="string"?n.visibility:null,gitOwner:typeof n.gitOwner=="string"?n.gitOwner:null,gitRepo:typeof n.gitRepo=="string"?n.gitRepo:null,gitHost:typeof n.gitHost=="string"?n.gitHost:null,defaultBranch:typeof n.defaultBranch=="string"?n.defaultBranch:null,sandbox:n.sandbox===!0,sandboxActionRegistry:s.success?s.data:null,sandboxManifestHash:typeof n.sandboxManifestHash=="string"?n.sandboxManifestHash:null,sandboxManifestPath:typeof n.sandboxManifestPath=="string"?n.sandboxManifestPath:null,sandboxManifestSyncedAt:typeof n.sandboxManifestSyncedAt=="string"?n.sandboxManifestSyncedAt:n.sandboxManifestSyncedAt instanceof Date?n.sandboxManifestSyncedAt.toISOString():null,sandboxManifestError:typeof n.sandboxManifestError=="string"?n.sandboxManifestError:null,updatedAt:typeof n.updatedAt=="string"?n.updatedAt:null,latestDeployment:r?{id:typeof r.id=="string"?r.id:void 0,status:typeof r.status=="string"?r.status:void 0,deploymentDomain:typeof r.deploymentDomain=="string"?r.deploymentDomain:null,createdAt:typeof r.createdAt=="string"?r.createdAt:void 0,isProduction:typeof r.isProduction=="boolean"?r.isProduction:null,gitBranch:typeof r.gitBranch=="string"?r.gitBranch:null}:null,scheduleSummary:hn(n.scheduleSummary)}}a(fn,"normalizeApp");function S(e){return typeof e=="string"?e:e instanceof Date?e.toISOString():null}a(S,"normalizeDateString");function mn(e){if(!e||typeof e!="object")return null;let n=e,t=typeof n.id=="string"?n.id:null,o=typeof n.name=="string"?n.name:t,r=typeof n.deploymentId=="string"?n.deploymentId:null;return!t||!o||!r?null:{id:t,name:o,description:typeof n.description=="string"?n.description:null,scheduleType:typeof n.scheduleType=="string"?n.scheduleType:"cron",scheduleExpression:typeof n.scheduleExpression=="string"?n.scheduleExpression:"",enabled:!!n.enabled,rawEnabled:typeof n.rawEnabled=="boolean"?n.rawEnabled:void 0,syncStatus:typeof n.syncStatus=="string"?n.syncStatus:null,syncError:typeof n.syncError=="string"?n.syncError:null,startAt:S(n.startAt),endAt:S(n.endAt),maxRuns:typeof n.maxRuns=="number"?n.maxRuns:null,executionCount:typeof n.executionCount=="number"?n.executionCount:null,lifecycleStatus:typeof n.lifecycleStatus=="string"?n.lifecycleStatus:null,lifecycleReason:typeof n.lifecycleReason=="string"?n.lifecycleReason:null,lastExecutionAt:S(n.lastExecutionAt),lastExecutionStatus:typeof n.lastExecutionStatus=="string"?n.lastExecutionStatus:null,lastRunNowAt:S(n.lastRunNowAt),lastRunNowStatus:typeof n.lastRunNowStatus=="string"?n.lastRunNowStatus:null,updatedAt:S(n.updatedAt)??new Date().toISOString(),deploymentId:r,isProduction:typeof n.isProduction=="boolean"?n.isProduction:void 0,payload:n.payload}}a(mn,"normalizeSchedule");function hn(e){if(!e||typeof e!="object")return null;let n=e,t=Array.isArray(n.schedules)?n.schedules.map(mn).filter(i=>!!i):[],o=typeof n.total=="number"?n.total:t.length,r=typeof n.active=="number"?n.active:t.filter(i=>i.enabled).length,s=typeof n.paused=="number"?n.paused:Math.max(0,o-r);return{total:o,active:r,paused:s,enabled:typeof n.enabled=="number"?n.enabled:r,disabled:typeof n.disabled=="number"?n.disabled:s,nextRunAt:S(n.nextRunAt),lastRunAt:S(n.lastRunAt),schedules:t,truncated:typeof n.truncated=="boolean"?n.truncated:void 0}}a(hn,"normalizeScheduleSummary");async function yn(e){let n=Array.isArray(e.config.accounts)?e.config.accounts:[],t=await Promise.all(n.map(async o=>{let r=F(o.handle,o.baseUrl),s=Y(o);if(!s)return[r,{response:null,authFailed:!1,error:null}];try{return[r,{response:await q(G(o,e.config),s),authFailed:!1,error:null}]}catch(i){return[r,{response:null,authFailed:!0,error:$(i)}]}}));return Object.fromEntries(t)}a(yn,"loadAccountProfileLookups");async function Ce(e){let n=await yn(e),t=e.account?n[F(e.account.handle,e.account.baseUrl)]??null:null,o=t?.response??null,r=e.token&&t?.authFailed?t.error||"OpenPond account authentication failed.":null;return{account:X({...e,accountResponse:o,accountProfiles:n,authFailed:!!r,error:r})}}a(Ce,"loadOpenPondAccountStateForContext");async function An(){return Ce(await p())}a(An,"loadOpenPondAccountState");async function Ie(e={}){let n=await p(),t=Ce(n);if(!n.token)return{...await t,apps:[],error:"No OpenPond API key or session token is configured."};let[o,r]=await Promise.allSettled([t,fe(n.apiBaseUrl,n.token,{handle:n.account?.handle,limit:e.limit??20,offset:e.offset??0,includeScheduled:e.includeScheduled??!0})]);if(o.status==="rejected")throw o.reason;return{account:o.value.account,apps:r.status==="fulfilled"?r.value.map(fn).filter(s=>!!s):[],error:r.status==="rejected"?$(r.reason):null}}a(Ie,"loadOpenPondApps");async function gn(e){let n=await p();if(!n.token)throw new Error("No OpenPond API key or session token is configured.");return{account:n,response:await me(n.apiBaseUrl,n.token,e)}}a(gn,"createOpenPondRepoApp");import{createHash as Pn}from"node:crypto";function wn(e){return`account-${Pn("sha256").update(e).digest("hex").slice(0,8)}`}a(wn,"fallbackHandleForApiKey");function Z(e){let n=e?.trim();return n?n.replace(/^@/,""):null}a(Z,"normalizeDerivedHandle");async function On(e,n){let t=Z(e.handle);if(t)return t;try{let r=(await q(n,e.apiKey)).account,s=Z(r.handle)??Z(r.email?.split("@")[0])??Z(r.id);if(s)return s}catch{}return wn(e.apiKey)}a(On,"deriveHandleForApiKey");async function xn(e){let n=e.baseUrl??N,t=l(e.apiBaseUrl)??V(n)??B,o=l(e.chatApiBaseUrl),r=await On(e,t);return await Pe({handle:r,apiKey:e.apiKey,baseUrl:n,apiBaseUrl:t,chatApiBaseUrl:o,environment:e.environment??"production",setActive:e.setActive}),p(r,n)}a(xn,"saveOpenPondAccount");function bn(e,n,t){let o=l(t),r=e.findIndex(i=>P(i.handle,n)&&b(i.baseUrl,o));if(r!==-1)return r;let s=e.map((i,c)=>({account:i,index:c})).filter(({account:i})=>P(i.handle,n));if(s.length===1)return s[0].index;if(s.length>1)throw new Error(`Multiple OpenPond accounts match ${n}; select one with its base URL.`);return-1}a(bn,"findAccountIndex");async function Un(e){let n=e.handle.trim();if(!n)throw new Error("OpenPond account handle is required.");return await L(t=>{let o=(t.accounts??[]).map(m=>({...m})),r=bn(o,n,e.baseUrl);if(r===-1)throw new Error(`OpenPond account not found: ${n}`);let s=o[r],i=A(t.activeProfile),c=!!(i&&U(s,i));o.splice(r,1),t.accounts=o,(c||!i||!o.some(m=>U(m,i)))&&(o[0]?t.activeProfile=_(o[0]):delete t.activeProfile)}),p()}a(Un,"removeOpenPondAccount");async function kn(){let e;return await L(n=>{let t=A(n.activeProfile),o=(n.accounts??[]).map(s=>({...s})),r=t?o.findIndex(s=>U(s,t)):0;if(r<0||!o[r])throw new Error("No active OpenPond account to log out.");e={...o[r]},delete e.apiKey,delete e.session,o[r]=e,n.accounts=o}),p(e.handle,e.baseUrl)}a(kn,"signOutOpenPondAccount");function Bn(e,n,t){let o=l(t),r=e.findIndex(i=>P(i.handle,n)&&b(i.baseUrl,o));if(r!==-1)return r;let s=e.map((i,c)=>({account:i,index:c})).filter(({account:i})=>P(i.handle,n));if(s.length===1)return s[0].index;if(s.length>1)throw new Error(`Multiple OpenPond accounts match ${n}; select one with its current base URL.`);return-1}a(Bn,"findAccountIndex");function ce(e,n,t){if(t===void 0)return;let o=l(t);if(o){e[n]=o;return}(t===null||t.trim()==="")&&delete e[n]}a(ce,"applyOptionalUrl");async function En(e){let n=e.handle.trim();if(!n)throw new Error("OpenPond account handle is required.");let t;return await L(o=>{let r=(o.accounts??[]).map(f=>({...f})),s=Bn(r,n,e.currentBaseUrl);if(s===-1)throw new Error(`OpenPond account not found: ${n}`);let i=r[s];if(t={...i},e.apiKey!==void 0){let f=e.apiKey.trim();if(!f)throw new Error("OpenPond API key cannot be empty.");t.apiKey=f,delete t.session,delete t.token}if(ce(t,"baseUrl",e.baseUrl),ce(t,"apiBaseUrl",e.apiBaseUrl),ce(t,"chatApiBaseUrl",e.chatApiBaseUrl),e.environment===null?delete t.environment:typeof e.environment=="string"&&e.environment.trim()&&(t.environment=e.environment.trim()),r.findIndex((f,w)=>w!==s&&P(f.handle,t.handle)&&b(f.baseUrl,t.baseUrl))!==-1)throw new Error("Another OpenPond account already uses that handle and base URL.");let m=A(o.activeProfile),g=!!(m&&U(i,m));r[s]=t,o.accounts=r,o.activeProfile=e.setActive||g?_(t):o.activeProfile}),p(t.handle,t.baseUrl)}a(En,"updateOpenPondAccountConfig");async function vn(e){let n=await p();if(!n.token)throw new Error("OpenPond is signed out. Add an account before reading app config.");return he(n.apiBaseUrl,n.token,e.appId)}a(vn,"getOpenPondAppEnvironment");function _n(e,n){let t="",o=a(r=>{r.startsWith(e)&&n(JSON.parse(r.slice(e.length)))},"processLine");return{push(r){for(t+=r;;){let s=Sn(t);if(s<0)return;let i=t.slice(0,s).replace(/\r$/,""),c=t[s]==="\r"&&t[s+1]===`
|
|
5
5
|
`?2:1;t=t.slice(s+c),o(i)}},flush(){let r=t.trimEnd();t="",r&&o(r)}}}a(_n,"createReadyLineParser");function Sn(e){let n=e.indexOf(`
|