openpond 0.2.45 → 0.2.47
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 +10584 -10105
- package/dist/app-server.js +1 -1
- package/dist/chunks/actions-command-DSO6YOEE.js +2 -0
- package/dist/chunks/{app-layer-MDJFV3HZ.js → app-layer-RRFI27N4.js} +1 -1
- package/dist/chunks/app-server-runtime-3KFJJUJH.js +2 -0
- package/dist/chunks/apps-NELJL377.js +2 -0
- package/dist/chunks/chunk-2SPZYBDN.js +16 -0
- package/dist/chunks/{chunk-U6SFIFDM.js → chunk-36YNUUZL.js} +136 -136
- package/dist/chunks/chunk-3HBCQNRN.js +2 -0
- package/dist/chunks/chunk-4UTBLHFC.js +2 -0
- package/dist/chunks/chunk-526PVA3V.js +2678 -0
- package/dist/chunks/{chunk-B6LYKEMU.js → chunk-6MH55NGW.js} +1 -1
- package/dist/chunks/chunk-7QEE4PBI.js +8 -0
- package/dist/chunks/{chunk-GEDEVI4Y.js → chunk-7YR6CBNU.js} +1 -1
- package/dist/chunks/{chunk-25GCTLAZ.js → chunk-A2GVVXFV.js} +1 -1
- package/dist/chunks/chunk-BM7TU6NX.js +190 -0
- package/dist/chunks/{chunk-XPB6NY7L.js → chunk-CNTGL5IX.js} +3 -3
- package/dist/chunks/{chunk-VVV5I22A.js → chunk-D7DA5G2U.js} +2 -2
- package/dist/chunks/chunk-DALJMSJG.js +33 -0
- package/dist/chunks/{chunk-4EGDKOYP.js → chunk-DLZP22WV.js} +1 -1
- package/dist/chunks/chunk-EMKZVP7Z.js +2 -0
- package/dist/chunks/{chunk-CXS3WXL3.js → chunk-F7RCOLZD.js} +1 -1
- package/dist/chunks/{chunk-FXIUKYUR.js → chunk-HA7EFTPF.js} +3 -3
- package/dist/chunks/chunk-IKWDL3RB.js +17 -0
- package/dist/chunks/{chunk-V62BHD5G.js → chunk-JDLAHVAJ.js} +1 -1
- package/dist/chunks/chunk-K6S4TY5W.js +9 -0
- package/dist/chunks/{chunk-IYRHG54Q.js → chunk-MASJQWA2.js} +1 -1
- package/dist/chunks/{chunk-B3O2GAQH.js → chunk-N3DEA6PG.js} +1 -1
- package/dist/chunks/{chunk-CR6CDOKS.js → chunk-N5QNXMIS.js} +2 -2
- package/dist/chunks/{chunk-OJVIH7J6.js → chunk-NAZ26IZL.js} +1 -1
- package/dist/chunks/chunk-NNF6KCHD.js +3 -0
- package/dist/chunks/chunk-PA7XP42P.js +2 -0
- package/dist/chunks/chunk-PJM2G7SG.js +21 -0
- package/dist/chunks/chunk-PYABBF53.js +53 -0
- package/dist/chunks/chunk-Q4H3NUVW.js +3 -0
- package/dist/chunks/chunk-QRWPEW3Z.js +24 -0
- package/dist/chunks/{chunk-Z2BYC6TP.js → chunk-QXVIIM4T.js} +1 -1
- package/dist/chunks/{chunk-DXAZUJPA.js → chunk-R3XFY7VL.js} +1 -1
- package/dist/chunks/{chunk-EG55BFQ4.js → chunk-RLZPX4YP.js} +1 -1
- package/dist/chunks/{chunk-5ZFEQLRI.js → chunk-SDEDAHV6.js} +72 -67
- package/dist/chunks/{chunk-VESOG2SS.js → chunk-T5LE6R5S.js} +1 -1
- package/dist/chunks/chunk-TGIB24K4.js +22 -0
- package/dist/chunks/chunk-TT46OISU.js +2 -0
- package/dist/chunks/{chunk-TVQE3JMI.js → chunk-UJ5EFSEC.js} +1 -1
- package/dist/chunks/{chunk-KPDWQCF6.js → chunk-WITSXYEW.js} +1 -1
- package/dist/chunks/chunk-WV2APYWG.js +2 -0
- package/dist/chunks/chunk-XBCIBAXD.js +4 -0
- package/dist/chunks/chunk-XDMUD4FW.js +5 -0
- package/dist/chunks/chunk-XM26DGML.js +3 -0
- package/dist/chunks/{chunk-J65BMG5Q.js → chunk-XON44M6V.js} +1 -1
- package/dist/chunks/{chunk-DWGB536R.js → chunk-YBVIFIXN.js} +7 -7
- package/dist/chunks/{chunk-YWX7FKLM.js → chunk-YIB3J4RC.js} +1 -1
- package/dist/chunks/chunk-YL6VFJ4P.js +2 -0
- package/dist/chunks/cli-WPAYXAJX.js +2 -0
- package/dist/chunks/{configuration-command-75ZCMZ6X.js → configuration-command-SA56RV5B.js} +1 -1
- package/dist/chunks/connected-evidence-IVSQZYIB.js +2 -0
- package/dist/chunks/{continual-WWPXK2LO.js → continual-PKK2BOTB.js} +3 -3
- package/dist/chunks/core-commands-W5IGIITV.js +2 -0
- package/dist/chunks/datasets-KSO2UG6R.js +2 -0
- package/dist/chunks/desktop-test-6HXFM7PO.js +3 -0
- package/dist/chunks/{dist-ELWB75PL.js → dist-4HV2W6V4.js} +1 -1
- package/dist/chunks/dist-VDVI7KIO.js +2 -0
- package/dist/chunks/evaluation-coordination-MOFBXRXN.js +2 -0
- package/dist/chunks/experiment-improvements-TDHM6NEA.js +2 -0
- package/dist/chunks/experiments-HFPDFD4I.js +2 -0
- package/dist/chunks/{extension-3M2CSWZB.js → extension-R373LYIB.js} +1 -1
- package/dist/chunks/{help-RLRU33WN.js → help-PEFQDDTA.js} +1 -1
- package/dist/chunks/hosted-experiment-improvement-T6Q7ASMI.js +3 -0
- package/dist/chunks/hosted-harness-runtime-2R5QRZCG.js +2 -0
- package/dist/chunks/hosted-profile-candidate-TKOY3M4S.js +3 -0
- package/dist/chunks/hosted-profile-compiler-VLBFIEWK.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-control-7B3RAZU2.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-inspection-3MB6MWO6.js +3 -0
- package/dist/chunks/hosted-profile-evaluation-preparation-C7WEABZ5.js +3 -0
- package/dist/chunks/human-review-HRGGACEM.js +2 -0
- package/dist/chunks/import-RSAQ44GG.js +4 -0
- package/dist/chunks/learning-FNBEIAY6.js +2 -0
- package/dist/chunks/opchat-I7ZWJ5XK.js +3 -0
- package/dist/chunks/organizations-LFCZIH7E.js +2 -0
- package/dist/chunks/{profile-DC4UEVVG.js → profile-EPIX5QVK.js} +1 -1
- package/dist/chunks/project-agent-DGOPMECP.js +2 -0
- package/dist/chunks/sandbox-command-Q5F6VUOS.js +2 -0
- package/dist/chunks/{sandbox-template-DFHWHCIQ.js → sandbox-template-7GICPIKJ.js} +1 -1
- package/dist/chunks/{src-CREVQF7M.js → src-DH5AQ4Z7.js} +5 -5
- package/dist/chunks/src-R4TSYNTK.js +329 -0
- package/dist/chunks/{taskset-TB2ICAZU.js → taskset-LUG3ZU6J.js} +1 -1
- package/dist/chunks/{teams-bot-BNBL57S5.js → teams-bot-Z6RJGHME.js} +1 -1
- package/dist/chunks/{training-FW5FOGR3.js → training-XHE6FVII.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/web/agent-sources/SOURCES.md +11 -0
- package/dist/web/agent-sources/claude-code.svg +1 -0
- package/dist/web/agent-sources/codex.svg +1 -0
- package/dist/web/agent-sources/grok-build.svg +3 -0
- package/dist/web/agent-sources/hermes.png +0 -0
- package/dist/web/agent-sources/oh-my-pi.svg +11 -0
- package/dist/web/agent-sources/openclaw.svg +54 -0
- package/dist/web/agent-sources/opencode.svg +4 -0
- package/dist/web/agent-sources/pi.svg +6 -0
- package/dist/web/assets/App-BI-uOpnP.js +234 -0
- package/dist/web/assets/App-DkH8CeoI.css +1 -0
- package/dist/web/assets/{AppDialog-Cgn_fTGR.js → AppDialog-1iGodoot.js} +1 -1
- package/dist/web/assets/{AppTerminalPanel-cNYkSvM2.js → AppTerminalPanel-udtBdWFn.js} +2 -2
- package/dist/web/assets/AppsView-BonAGiS8.css +1 -0
- package/dist/web/assets/AppsView-DhKsU4yi.js +1 -0
- package/dist/web/assets/BrowserSidebar-BnOyqIQT.js +1 -0
- package/dist/web/assets/{CartesianChart-Bg3Lm5mZ.js → CartesianChart-C24DAywn.js} +1 -1
- package/dist/web/assets/{CollaborationTabs-BIfgIy5X.js → CollaborationTabs-DgmOF5Fe.js} +1 -1
- package/dist/web/assets/{CommandMenu-D9BimyPx.js → CommandMenu-CUNGtHwS.js} +1 -1
- package/dist/web/assets/CommunityView-CE7qeJnr.js +1 -0
- package/dist/web/assets/ComposerCreateImproveStrip-BixNsg2a.js +1 -0
- package/dist/web/assets/GetStartedView-B8gCwmBX.js +1 -0
- package/dist/web/assets/HostedModelLearningReview-CitgUNfC.js +1 -0
- package/dist/web/assets/HostedModelLearningSettings-WUaqzNsa.js +1 -0
- package/dist/web/assets/LabModelVersionDetailPage-Cx0kL69J.js +1 -0
- package/dist/web/assets/LabSkillSidebar-DRggqZ1j.js +1 -0
- package/dist/web/assets/LabsRoute-BujTZhqC.js +99 -0
- package/dist/web/assets/MainChatThread-CyA_644R.js +2 -0
- package/dist/web/assets/MainPane-DOWsSew1.css +1 -0
- package/dist/web/assets/MainPane-LaEtxydD.js +19 -0
- package/dist/web/assets/{MarkdownText-De0WzrEw.js → MarkdownText-DJI5LwT0.js} +19 -19
- package/dist/web/assets/{NativeSkillSidebar-B4jtf5RO.js → NativeSkillSidebar-CkFpWxjd.js} +1 -1
- package/dist/web/assets/{NewExperienceSwitcher-Bg1DVr96.js → NewExperienceSwitcher-DXcRHHsu.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-i_wvIBw-.js → NewProjectDialog-gDzX_ZIJ.js} +1 -1
- package/dist/web/assets/OutputsPage-J_k-_N82.js +1 -0
- package/dist/web/assets/{ProjectsPage-BD0eml0M.js → ProjectsPage-BsyZmvlg.js} +1 -1
- package/dist/web/assets/RightChatPanelStack-Bz8puMUB.js +1 -0
- package/dist/web/assets/{RightSidebarHomePanel-BTpU5wGh.js → RightSidebarHomePanel-DmorYb6p.js} +1 -1
- package/dist/web/assets/ScheduledWorkPage-BFDzQUyL.js +1 -0
- package/dist/web/assets/SettingsView-BB7wCdbr.js +5 -0
- package/dist/web/assets/SettingsView-BnANbPLS.css +1 -0
- package/dist/web/assets/{TeamChatView-5LjuRNd6.js → TeamChatView-CZ3b7rq2.js} +2 -2
- package/dist/web/assets/{TerminalOverlay-BCWBSotQ.js → TerminalOverlay-Ck43Qri3.js} +12 -12
- package/dist/web/assets/{TrainingCreationPanel-hvOHRVJx.js → TrainingCreationPanel-ejqPZm3g.js} +1 -1
- package/dist/web/assets/{TrainingDraftPanel-CGEHGljE.js → TrainingDraftPanel-Cy2AQxxL.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-B8nbqhag.js → UsageSettingsSection-B7nyMItm.js} +1 -1
- package/dist/web/assets/WorkSidebarPanel-BfjAc097.js +1 -0
- package/dist/web/assets/WorkspaceDiffPanel-D9hAV8l7.js +14 -0
- package/dist/web/assets/WorkspaceEnvironmentMenu-B-K9XgFB.js +32 -0
- package/dist/web/assets/{WorkspaceGitDialogs-Dyx4Rbiy.js → WorkspaceGitDialogs-BJVFx_L3.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-B1dKexHo.js → WorkspaceMonacoEditor-p-FWMXoZ.js} +3 -3
- package/dist/web/assets/{arrow-up-right-CCj7SOGp.js → arrow-up-right-CFGI2YSt.js} +1 -1
- package/dist/web/assets/chunk-UHVJOMWN-BAlur2vw.js +1 -0
- package/dist/web/assets/{clipboard-BY6ELc9Z.js → clipboard-DIIxBort.js} +1 -1
- package/dist/web/assets/{cloud-upload-BOka5EKK.js → cloud-upload-BaQFNCTp.js} +1 -1
- package/dist/web/assets/{cssMode-C34j8ti5.js → cssMode-6LOkSggB.js} +1 -1
- package/dist/web/assets/{folder-open-CX2jidFj.js → folder-open-DZSxfPtr.js} +1 -1
- package/dist/web/assets/{folder-plus-Dh2Q9LP3.js → folder-plus-21v4D_Vx.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-CfevriuT.js → git-commit-horizontal-CgGixL64.js} +1 -1
- package/dist/web/assets/{htmlMode-BORwVkZg.js → htmlMode-B5uRraNd.js} +1 -1
- package/dist/web/assets/index-DJcUXSsN.css +1 -0
- package/dist/web/assets/{index-BBjRfC--.js → index-DOMrqhcz.js} +2 -2
- package/dist/web/assets/{info-Bv3dbs3G.js → info-BGTcmow7.js} +1 -1
- package/dist/web/assets/{jsonMode-BYWtZ6AK.js → jsonMode-D3m8N4Gi.js} +1 -1
- package/dist/web/assets/{lspLanguageFeatures-CEAdFSpU.js → lspLanguageFeatures-DoyipLsB.js} +1 -1
- package/dist/web/assets/{minimize-2-MhorZwY5.js → minimize-2-B01qSko4.js} +1 -1
- package/dist/web/assets/{monaco.contribution-ZUUVx_3M.js → monaco.contribution--U8v3jpa.js} +2 -2
- package/dist/web/assets/{monaco.contribution-CN7AWJNd.js → monaco.contribution-BJyfaGX2.js} +2 -2
- package/dist/web/assets/{monaco.contribution-CDhPpbIo.js → monaco.contribution-Bc22foTx.js} +2 -2
- package/dist/web/assets/{monaco.contribution-DHA7FuJX.js → monaco.contribution-DuRhJ6zU.js} +2 -2
- package/dist/web/assets/{monitor-DLcrkfM5.js → monitor-eZP8ZTHe.js} +1 -1
- package/dist/web/assets/play-CGsWFR_B.js +1 -0
- package/dist/web/assets/{python-CXwvPmc4.js → python-BNrLZWud.js} +1 -1
- package/dist/web/assets/{save-DaN65kMq.js → save-BLgjrccP.js} +1 -1
- package/dist/web/assets/{square-zRgIUdSv.js → square-CI1qNtvE.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-DWeRZFzr.js → toggleHighContrast-B_GcTCnw.js} +1 -1
- package/dist/web/assets/{tsMode-nLBhKngY.js → tsMode-CmruH_ys.js} +1 -1
- package/dist/web/assets/{upload-BfUu4Eu1.js → upload-DnlgGS2x.js} +1 -1
- package/dist/web/assets/useLocalAgentSchedules-BBhGUfK-.js +1 -0
- package/dist/web/assets/useProviderSettings-Bw-csWbH.css +1 -0
- package/dist/web/assets/useProviderSettings-DfhdkKdC.js +5 -0
- package/dist/web/assets/{useSessionTurnCache-BQMWfV8u.js → useSessionTurnCache-BwscKl5i.js} +1 -1
- package/dist/web/assets/{wifi-off-bdka5es5.js → wifi-off-Dz-4EDCc.js} +1 -1
- package/dist/web/assets/{workers-z7XHFFNs.js → workers-Bi9u46cp.js} +1 -1
- package/dist/web/assets/{yaml-BTr4i4DD.js → yaml-DVTkiRnh.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-ELNJUG64.js +0 -17
- package/dist/chunks/chunk-H3C4ZYEA.js +0 -16
- package/dist/chunks/chunk-HUBI3RUK.js +0 -2
- package/dist/chunks/chunk-HZP5U2AA.js +0 -3
- 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-TNXILYI6.js +0 -2
- 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/AppsView-9zpKBSLv.js +0 -1
- package/dist/web/assets/AppsView-CzbB5pXp.css +0 -1
- 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/web/assets/useLocalAgentSchedules-BCITWhg2.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as v,b as I}from"./chunk-GLUWATL5.js";import{E as L,F as E}from"./chunk-ALZRXBEC.js";import{f as w}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"},S=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,s,r=null){let c=r||e;super(`${s} 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(o,n,t,e={}){let{timeoutMs:s=3e4,maxResponseBytes:r=8388608,explicitBearerAuth:c=!1,...p}=e,d=`${o}${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_"),x=g||(u?h:null);x&&!m.has("openpond-api-key")&&m.set("openpond-api-key",x),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(s,d),R=s>0?setTimeout(()=>y.abort(f),s):null;R?.unref?.();let P=U(p.signal,y.signal,s),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(o,n){let t;try{let e=await o.text();t=e?JSON.parse(e):{}}catch(e){if(e instanceof T||e instanceof S)throw e;t={}}if(!o.ok){let e=typeof t.error=="string"?t.error:null,s=typeof t.message=="string"?t.message:null;throw new O(o.status,e,n,s)}return t}a(l,"readApiJson");function C(o,n){if(!o.body)return n.cleanup(),o;let t=Number(o.headers.get("content-length"));if(n.maximumBytes>0&&Number.isFinite(t)&&t>n.maximumBytes)throw n.cleanup(),o.body.cancel(),new S(n.maximumBytes,n.requestUrl);let e=o.body.getReader(),s=0,r=new ReadableStream({async pull(c){try{let p=await e.read();if(p.done){n.cleanup(),c.close();return}if(s+=p.value.byteLength,n.maximumBytes>0&&s>n.maximumBytes){n.cleanup(),await e.cancel(),c.error(new S(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:o.headers,status:o.status,statusText:o.statusText})}a(C,"boundedResponse");function U(o,n,t){return t<=0?o??void 0:o?AbortSignal.any([o,n]):n}a(U,"composedSignal");async function _(o,n,t,e,s){let r=await i(o,n,`/v4/apps/${t}/commits`,{method:"POST",body:JSON.stringify({files:e,message:s})});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(o,n,t,e){let s=e?.environment??"production",r=await i(o,n,`/v4/apps/${t}/deployments`,{method:"POST",body:JSON.stringify({environment:s,...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(o,n,t,e){let s=await i(o,n,`/v4/apps/${encodeURIComponent(t)}/deployments/promote-preview`,{method:"POST",body:JSON.stringify(e)});return l(s,"Preview promotion")}a(B,"promotePreviewToProduction");async function G(o,n,t,e){let s=await i(o,n,`/v1/apps/${encodeURIComponent(t)}/lifecycle/start`,{method:"POST",body:JSON.stringify(e)});return l(s,"App lifecycle start")}a(G,"startAppLifecycle");async function J(o,n,t){let e=await i(o,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 s=await e.json().catch(()=>({}));return(Array.isArray(s.logs)?s.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(J,"getDeploymentLogs");async function M(o,n,t){let e=await i(o,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(M,"getDeploymentStatus");async function F(o,n,t,e){let s=new URLSearchParams;e?.status&&e.status.length>0&&s.set("status",e.status.join(",")),e?.createdAfter&&s.set("createdAfter",e.createdAfter),e?.branch&&s.set("branch",e.branch);let r=s.toString(),c=await i(o,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(F,"getLatestDeploymentForApp");async function H(o,n,t){let e=await i(o,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(H,"getDeploymentDetail");var V=new URL(I).hostname,D=new URL(v).hostname;async function ae(o,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 s=e.toString(),r=await i(o,n,`/apps/list${s?`?${s}`:""}`,{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(o,n,t){let e=await i(o,n,"/api/projects/local",{method:"POST",body:JSON.stringify(t)});if(!e.ok){let s=await e.text().catch(()=>"");throw new Error(`Create project failed: ${e.status} ${s}`)}return await e.json()}a(ie,"createLocalProject");async function ce(o,n,t){let e=await i(o,n,"/apps/repo/create",{method:"POST",body:JSON.stringify(t)});if(!e.ok){let s=await e.text().catch(()=>"");throw new Error(`Repo create failed: ${e.status} ${s}`)}return await e.json()}a(ce,"createRepo");async function pe(o,n,t,e){let s=await i(o,n,`/apps/${encodeURIComponent(t)}/code-visibility`,{method:"PATCH",body:JSON.stringify({codeVisibility:e})});if(!s.ok){let r=await s.text().catch(()=>"");throw new Error(`Code visibility update failed: ${s.status} ${r}`)}return await s.json()}a(pe,"updateAppCodeVisibility");async function ue(o,n,t,e){let s=await i(o,n,"/v4/apps/headless",{method:"POST",body:JSON.stringify({items:t,...e?{teamId:e}:{}})});if(!s.ok){let r=await s.text().catch(()=>"");throw new Error(`Headless create failed: ${s.status} ${r}`)}return await s.json()}a(ue,"createHeadlessApps");async function le(o,n,t){let e=await i(o,n,`/v4/apps/${t}/template/status`,{method:"GET"});if(!e.ok){let s=await e.text().catch(()=>"");throw new Error(`Template status failed: ${e.status} ${s}`)}return await e.json()}a(le,"getTemplateStatus");async function de(o,n,t){let e=await i(o,n,`/v4/apps/${t}/template/branches`,{method:"GET"});if(!e.ok){let s=await e.text().catch(()=>"");throw new Error(`Template branches failed: ${e.status} ${s}`)}return await e.json()}a(de,"listTemplateBranches");async function me(o,n,t,e){let s=await i(o,n,`/v4/apps/${t}/template/deploy-latest`,{method:"POST",body:JSON.stringify(e)});if(!s.ok){let r=await s.text().catch(()=>"");throw new Error(`Template deploy failed: ${s.status} ${r}`)}return await s.json()}a(me,"deployLatestTemplate");async function ge(o,n,t,e){let s=await i(o,n,`/v4/apps/${t}/environment`,{method:"POST",body:JSON.stringify(e)});if(!s.ok){let r=await s.text().catch(()=>"");throw new Error(`Environment update failed: ${s.status} ${r}`)}return await s.json()}a(ge,"updateAppEnvironment");async function he(o,n,t){let e=await i(o,n,`/v4/apps/${t}/environment`,{method:"GET"});if(!e.ok){let s=await e.text().catch(()=>"");throw new Error(`Environment get failed: ${e.status} ${s}`)}return await e.json()}a(he,"getAppEnvironment");async function ye(o,n){let t=await i(o,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(o,n){let t=await i(o,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(o,n,t){let e=await i(o,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 s=await e.json().catch(()=>({}));return{schedules:Array.isArray(s.schedules)?s.schedules:[]}}a(Re,"listAppSchedules");async function we(o,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 s=e.toString(),r=await i(o,n,`/v1/opentool/recipes${s?`?${s}`:""}`,{method:"GET"});return l(r,"OpenTool recipe list")}a(we,"listOpenToolRecipes");async function Se(o,n,t){let e=await i(o,n,"/v1/opentool/recipes/search",{method:"POST",body:JSON.stringify(t)});return l(e,"OpenTool recipe search")}a(Se,"searchOpenToolRecipes");async function xe(o,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 s=e.toString(),r=await i(o,n,`/v1/opentool/recipes/${encodeURIComponent(t.id)}${s?`?${s}`:""}`,{method:"GET"});return l(r,"OpenTool recipe get")}a(xe,"getOpenToolRecipe");async function Te(o,n,t){let e=await i(o,n,"/v1/opentool/rules",{method:"POST",body:JSON.stringify(t)});return l(e,"OpenTool rules get")}a(Te,"getOpenToolRules");function b(o){let n=new URLSearchParams;typeof o=="number"&&Number.isFinite(o)&&n.set("limit",String(Math.max(1,Math.floor(o))));let t=n.toString();return t?`?${t}`:""}a(b,"buildLimitQuery");function N(o){if(Array.isArray(o))return o;if(!o||typeof o!="object")return[];let n=o;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(o,n,t,e){let s={...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(o,n,`/apps/${encodeURIComponent(t)}/schedules/start`,{method:"POST",body:JSON.stringify(s)});return l(r,"Schedule start")}a(Pe,"startAppSchedules");async function Ae(o,n,t){let e=await i(o,n,`/apps/${encodeURIComponent(t)}/schedules/stop`,{method:"POST",body:JSON.stringify({})});return l(e,"Schedule stop")}a(Ae,"stopAppSchedules");async function Ee(o,n){let t=await i(o,n,"/apps/schedules/current/stop",{method:"POST",body:JSON.stringify({})});return l(t,"Current schedule stop")}a(Ee,"stopCurrentAppSchedules");async function Oe(o,n,t){let e=await i(o,n,"/v1/schedules/run",{method:"POST",body:JSON.stringify({scheduleId:t.scheduleId})});return l(e,"Schedule run")}a(Oe,"runScheduleNow");async function be(o,n,t,e){let s=await i(o,n,`/apps/${encodeURIComponent(t)}/schedules/${encodeURIComponent(e)}`,{method:"DELETE"});return l(s,"Schedule delete")}a(be,"deleteOrArchiveSchedule");async function $e(o,n,t,e){let s=await i(o,n,`/v1/schedules/${encodeURIComponent(t)}/execution-logs${b(e?.limit)}`,{method:"GET"}),r=await l(s,"Schedule execution logs");return{logs:N(r)}}a($e,"listScheduleExecutionLogs");async function ke(o,n,t,e){let s=await i(o,n,`/v1/deployments/${encodeURIComponent(t)}/schedule-execution-logs${b(e?.limit)}`,{method:"GET"}),r=await l(s,"Deployment schedule execution logs");return{logs:N(r)}}a(ke,"listDeploymentScheduleExecutionLogs");async function Le(o,n,t){let e=await i(o,n,`/v1/schedule-execution-logs/${encodeURIComponent(t)}`,{method:"GET"});return l(e,"Schedule execution log")}a(Le,"getScheduleExecutionLog");async function ve(o,n,t,e){let s=await i(o,n,`/v1/apps/${encodeURIComponent(t)}/execution-timeline${b(e?.limit)}`,{method:"GET"});return l(s,"App execution timeline")}a(ve,"getAppExecutionTimeline");async function Ie(o,n,t){return i(o,n,"/apps/agent/create",{method:"POST",body:JSON.stringify(t)})}a(Ie,"createAgentFromPrompt");async function De(o,n,t){let e=new URLSearchParams;t?.appId&&e.set("appId",t.appId);let s=e.toString(),r=await i(o,n,`/apps/performance${s?`?${s}`:""}`,{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(o,n,t){let e=new URLSearchParams({appId:t}),s=await i(o,n,`/apps/summary?${e.toString()}`,{method:"GET"});if(!s.ok){let r=await s.text().catch(()=>"");throw new Error(`Summary lookup failed: ${s.status} ${r}`)}return await s.json()}a(Ne,"getAppRuntimeSummary");async function z(o,n){let t=await i(o,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(o,n){let t=new Date().toISOString(),e=Date.now(),s=o.replace(/\/$/,"");try{let r=await i(s,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(s,n);d=!0,m=g.account}catch{d=!1}return{reachable:r.ok,authenticated:d,apiBase:s,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:s,latencyMs:Date.now()-e,status:null,service:null,checkedAt:t,error:r instanceof Error?r.message:String(r)}}}a(qe,"checkOpenPondApiHealth");async function Ce(o,n,t){let e=await i(o,n,"/apps/assistant/run",{method:"POST",body:JSON.stringify(t)});if(!e.ok){let s=await e.text().catch(()=>"");throw new Error(`Assistant run failed: ${e.status} ${s}`)}return await e.json()}a(Ce,"runAssistantMode");async function Ue(o,n,t){let e=await i(o,n,"/apps/agent/digest",{method:"POST",body:JSON.stringify(t)});if(!e.ok){let s=await e.text().catch(()=>"");throw new Error(`Agent digest failed: ${e.status} ${s}`)}return await e.json()}a(Ue,"postAgentDigest");async function _e(o,n,t){let e=await i(o,n,"/apps/tools/execute",{method:"POST",body:JSON.stringify(t)}),s=await e.text().catch(()=>""),r=null;try{r=s?JSON.parse(s):null}catch{r=s}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):s||e.statusText}}a(_e,"executeUserTool");async function je(o,n,t){let e=await i(o,n,"/apps/backtests/run",{method:"POST",body:JSON.stringify(t)});if(!e.ok){let s=await e.text().catch(()=>"");throw new Error(`Backtest run failed: ${e.status} ${s}`)}return await e.json()}a(je,"submitBacktestRun");async function Be(o,n,t){let e=t.query&&Object.keys(t.query).length>0?`?${new URLSearchParams(t.query).toString()}`:"",s=await i(o,n,`/apps/backtests/tx${e}`,{method:t.method,body:t.method==="POST"&&t.body!==void 0?JSON.stringify(t.body):void 0});if(!s.ok){let r=await s.text().catch(()=>"");throw new Error(`Backtests request failed: ${s.status} ${r}`)}return await s.json()}a(Be,"submitBacktestTx");async function Ge(o,n,t){let e=new URLSearchParams(t).toString(),s=await i(o,n,`/apps/backtests/detail?${e}`,{method:"GET"});if(!s.ok){let r=await s.text().catch(()=>"");throw new Error(`Backtest detail failed: ${s.status} ${r}`)}return await s.json()}a(Ge,"submitBacktestDetail");function K(o){let n=o.trim().replace(/^\/+/,"");return encodeURIComponent(n||"tool")}a(K,"normalizeToolPathSegment");function W(o){let n=o.replace(/\/$/,""),t=process.env.OPENPOND_TOOL_URL;if(t)return t.replace(/\/$/,"");try{let e=new URL(n),s=e.hostname.toLowerCase(),r=s==="apps.openpond.live"?null:s===V||s===D||s===`www.${D}`||s==="openpond.live"||s==="www.openpond.live"?"https://apps.openpond.live":null;if(r)return r;let c=s==="localhost"||s==="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 Je(o,n,t){let e=W(o),s=K(t.toolName),c=`${t.deploymentId?`/${t.appId}/deployments/${t.deploymentId}`:`/${t.appId}`}/${s}`,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 x=u&&typeof u=="object"&&"ok"in u?!!u.ok:!0,y=g.ok&&x,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(Je,"executeHostedTool");import{createHash as Y}from"node:crypto";var X=3600*1e3;function $(o){return Y("sha256").update(JSON.stringify([o.apiBase.replace(/\/$/,""),o.apiKey.trim()])).digest("hex")}a($,"buildCacheKey");async function q(o,n){let t=await L(w(),o,$(n),{allowStale:!0});return!t||Date.now()-Date.parse(t.updatedAt)>=(n.ttlMs??X)?null:t.payload}a(q,"cached");async function ot(o){return q("cloud.apps",o)}a(ot,"getCachedApps");async function st(o){await E(w(),"cloud.apps",$(o),o.apps)}a(st,"setCachedApps");async function rt(o){return q("cloud.tools",o)}a(rt,"getCachedTools");async function at(o){await E(w(),"cloud.tools",$(o),o.tools)}a(at,"setCachedTools");var pt=["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,J as f,M as g,F as h,H 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,ve as I,Ie 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,Je as V,X as W,ot as X,st as Y,rt as Z,at as _,pt as $};
|
|
2
|
+
import{a as v,b as I}from"./chunk-GLUWATL5.js";import{E as L,F as E}from"./chunk-DALJMSJG.js";import{f as w}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"},S=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,s,r=null){let c=r||e;super(`${s} 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(o,n,t,e={}){let{timeoutMs:s=3e4,maxResponseBytes:r=8388608,explicitBearerAuth:c=!1,...p}=e,d=`${o}${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_"),x=g||(u?h:null);x&&!m.has("openpond-api-key")&&m.set("openpond-api-key",x),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(s,d),R=s>0?setTimeout(()=>y.abort(f),s):null;R?.unref?.();let P=U(p.signal,y.signal,s),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(o,n){let t;try{let e=await o.text();t=e?JSON.parse(e):{}}catch(e){if(e instanceof T||e instanceof S)throw e;t={}}if(!o.ok){let e=typeof t.error=="string"?t.error:null,s=typeof t.message=="string"?t.message:null;throw new O(o.status,e,n,s)}return t}a(l,"readApiJson");function C(o,n){if(!o.body)return n.cleanup(),o;let t=Number(o.headers.get("content-length"));if(n.maximumBytes>0&&Number.isFinite(t)&&t>n.maximumBytes)throw n.cleanup(),o.body.cancel(),new S(n.maximumBytes,n.requestUrl);let e=o.body.getReader(),s=0,r=new ReadableStream({async pull(c){try{let p=await e.read();if(p.done){n.cleanup(),c.close();return}if(s+=p.value.byteLength,n.maximumBytes>0&&s>n.maximumBytes){n.cleanup(),await e.cancel(),c.error(new S(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:o.headers,status:o.status,statusText:o.statusText})}a(C,"boundedResponse");function U(o,n,t){return t<=0?o??void 0:o?AbortSignal.any([o,n]):n}a(U,"composedSignal");async function _(o,n,t,e,s){let r=await i(o,n,`/v4/apps/${t}/commits`,{method:"POST",body:JSON.stringify({files:e,message:s})});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(o,n,t,e){let s=e?.environment??"production",r=await i(o,n,`/v4/apps/${t}/deployments`,{method:"POST",body:JSON.stringify({environment:s,...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(o,n,t,e){let s=await i(o,n,`/v4/apps/${encodeURIComponent(t)}/deployments/promote-preview`,{method:"POST",body:JSON.stringify(e)});return l(s,"Preview promotion")}a(B,"promotePreviewToProduction");async function G(o,n,t,e){let s=await i(o,n,`/v1/apps/${encodeURIComponent(t)}/lifecycle/start`,{method:"POST",body:JSON.stringify(e)});return l(s,"App lifecycle start")}a(G,"startAppLifecycle");async function J(o,n,t){let e=await i(o,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 s=await e.json().catch(()=>({}));return(Array.isArray(s.logs)?s.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(J,"getDeploymentLogs");async function M(o,n,t){let e=await i(o,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(M,"getDeploymentStatus");async function F(o,n,t,e){let s=new URLSearchParams;e?.status&&e.status.length>0&&s.set("status",e.status.join(",")),e?.createdAfter&&s.set("createdAfter",e.createdAfter),e?.branch&&s.set("branch",e.branch);let r=s.toString(),c=await i(o,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(F,"getLatestDeploymentForApp");async function H(o,n,t){let e=await i(o,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(H,"getDeploymentDetail");var V=new URL(I).hostname,D=new URL(v).hostname;async function ae(o,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 s=e.toString(),r=await i(o,n,`/apps/list${s?`?${s}`:""}`,{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(o,n,t){let e=await i(o,n,"/api/projects/local",{method:"POST",body:JSON.stringify(t)});if(!e.ok){let s=await e.text().catch(()=>"");throw new Error(`Create project failed: ${e.status} ${s}`)}return await e.json()}a(ie,"createLocalProject");async function ce(o,n,t){let e=await i(o,n,"/apps/repo/create",{method:"POST",body:JSON.stringify(t)});if(!e.ok){let s=await e.text().catch(()=>"");throw new Error(`Repo create failed: ${e.status} ${s}`)}return await e.json()}a(ce,"createRepo");async function pe(o,n,t,e){let s=await i(o,n,`/apps/${encodeURIComponent(t)}/code-visibility`,{method:"PATCH",body:JSON.stringify({codeVisibility:e})});if(!s.ok){let r=await s.text().catch(()=>"");throw new Error(`Code visibility update failed: ${s.status} ${r}`)}return await s.json()}a(pe,"updateAppCodeVisibility");async function ue(o,n,t,e){let s=await i(o,n,"/v4/apps/headless",{method:"POST",body:JSON.stringify({items:t,...e?{teamId:e}:{}})});if(!s.ok){let r=await s.text().catch(()=>"");throw new Error(`Headless create failed: ${s.status} ${r}`)}return await s.json()}a(ue,"createHeadlessApps");async function le(o,n,t){let e=await i(o,n,`/v4/apps/${t}/template/status`,{method:"GET"});if(!e.ok){let s=await e.text().catch(()=>"");throw new Error(`Template status failed: ${e.status} ${s}`)}return await e.json()}a(le,"getTemplateStatus");async function de(o,n,t){let e=await i(o,n,`/v4/apps/${t}/template/branches`,{method:"GET"});if(!e.ok){let s=await e.text().catch(()=>"");throw new Error(`Template branches failed: ${e.status} ${s}`)}return await e.json()}a(de,"listTemplateBranches");async function me(o,n,t,e){let s=await i(o,n,`/v4/apps/${t}/template/deploy-latest`,{method:"POST",body:JSON.stringify(e)});if(!s.ok){let r=await s.text().catch(()=>"");throw new Error(`Template deploy failed: ${s.status} ${r}`)}return await s.json()}a(me,"deployLatestTemplate");async function ge(o,n,t,e){let s=await i(o,n,`/v4/apps/${t}/environment`,{method:"POST",body:JSON.stringify(e)});if(!s.ok){let r=await s.text().catch(()=>"");throw new Error(`Environment update failed: ${s.status} ${r}`)}return await s.json()}a(ge,"updateAppEnvironment");async function he(o,n,t){let e=await i(o,n,`/v4/apps/${t}/environment`,{method:"GET"});if(!e.ok){let s=await e.text().catch(()=>"");throw new Error(`Environment get failed: ${e.status} ${s}`)}return await e.json()}a(he,"getAppEnvironment");async function ye(o,n){let t=await i(o,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(o,n){let t=await i(o,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(o,n,t){let e=await i(o,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 s=await e.json().catch(()=>({}));return{schedules:Array.isArray(s.schedules)?s.schedules:[]}}a(Re,"listAppSchedules");async function we(o,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 s=e.toString(),r=await i(o,n,`/v1/opentool/recipes${s?`?${s}`:""}`,{method:"GET"});return l(r,"OpenTool recipe list")}a(we,"listOpenToolRecipes");async function Se(o,n,t){let e=await i(o,n,"/v1/opentool/recipes/search",{method:"POST",body:JSON.stringify(t)});return l(e,"OpenTool recipe search")}a(Se,"searchOpenToolRecipes");async function xe(o,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 s=e.toString(),r=await i(o,n,`/v1/opentool/recipes/${encodeURIComponent(t.id)}${s?`?${s}`:""}`,{method:"GET"});return l(r,"OpenTool recipe get")}a(xe,"getOpenToolRecipe");async function Te(o,n,t){let e=await i(o,n,"/v1/opentool/rules",{method:"POST",body:JSON.stringify(t)});return l(e,"OpenTool rules get")}a(Te,"getOpenToolRules");function b(o){let n=new URLSearchParams;typeof o=="number"&&Number.isFinite(o)&&n.set("limit",String(Math.max(1,Math.floor(o))));let t=n.toString();return t?`?${t}`:""}a(b,"buildLimitQuery");function N(o){if(Array.isArray(o))return o;if(!o||typeof o!="object")return[];let n=o;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(o,n,t,e){let s={...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(o,n,`/apps/${encodeURIComponent(t)}/schedules/start`,{method:"POST",body:JSON.stringify(s)});return l(r,"Schedule start")}a(Pe,"startAppSchedules");async function Ae(o,n,t){let e=await i(o,n,`/apps/${encodeURIComponent(t)}/schedules/stop`,{method:"POST",body:JSON.stringify({})});return l(e,"Schedule stop")}a(Ae,"stopAppSchedules");async function Ee(o,n){let t=await i(o,n,"/apps/schedules/current/stop",{method:"POST",body:JSON.stringify({})});return l(t,"Current schedule stop")}a(Ee,"stopCurrentAppSchedules");async function Oe(o,n,t){let e=await i(o,n,"/v1/schedules/run",{method:"POST",body:JSON.stringify({scheduleId:t.scheduleId})});return l(e,"Schedule run")}a(Oe,"runScheduleNow");async function be(o,n,t,e){let s=await i(o,n,`/apps/${encodeURIComponent(t)}/schedules/${encodeURIComponent(e)}`,{method:"DELETE"});return l(s,"Schedule delete")}a(be,"deleteOrArchiveSchedule");async function $e(o,n,t,e){let s=await i(o,n,`/v1/schedules/${encodeURIComponent(t)}/execution-logs${b(e?.limit)}`,{method:"GET"}),r=await l(s,"Schedule execution logs");return{logs:N(r)}}a($e,"listScheduleExecutionLogs");async function ke(o,n,t,e){let s=await i(o,n,`/v1/deployments/${encodeURIComponent(t)}/schedule-execution-logs${b(e?.limit)}`,{method:"GET"}),r=await l(s,"Deployment schedule execution logs");return{logs:N(r)}}a(ke,"listDeploymentScheduleExecutionLogs");async function Le(o,n,t){let e=await i(o,n,`/v1/schedule-execution-logs/${encodeURIComponent(t)}`,{method:"GET"});return l(e,"Schedule execution log")}a(Le,"getScheduleExecutionLog");async function ve(o,n,t,e){let s=await i(o,n,`/v1/apps/${encodeURIComponent(t)}/execution-timeline${b(e?.limit)}`,{method:"GET"});return l(s,"App execution timeline")}a(ve,"getAppExecutionTimeline");async function Ie(o,n,t){return i(o,n,"/apps/agent/create",{method:"POST",body:JSON.stringify(t)})}a(Ie,"createAgentFromPrompt");async function De(o,n,t){let e=new URLSearchParams;t?.appId&&e.set("appId",t.appId);let s=e.toString(),r=await i(o,n,`/apps/performance${s?`?${s}`:""}`,{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(o,n,t){let e=new URLSearchParams({appId:t}),s=await i(o,n,`/apps/summary?${e.toString()}`,{method:"GET"});if(!s.ok){let r=await s.text().catch(()=>"");throw new Error(`Summary lookup failed: ${s.status} ${r}`)}return await s.json()}a(Ne,"getAppRuntimeSummary");async function z(o,n){let t=await i(o,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(o,n){let t=new Date().toISOString(),e=Date.now(),s=o.replace(/\/$/,"");try{let r=await i(s,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(s,n);d=!0,m=g.account}catch{d=!1}return{reachable:r.ok,authenticated:d,apiBase:s,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:s,latencyMs:Date.now()-e,status:null,service:null,checkedAt:t,error:r instanceof Error?r.message:String(r)}}}a(qe,"checkOpenPondApiHealth");async function Ce(o,n,t){let e=await i(o,n,"/apps/assistant/run",{method:"POST",body:JSON.stringify(t)});if(!e.ok){let s=await e.text().catch(()=>"");throw new Error(`Assistant run failed: ${e.status} ${s}`)}return await e.json()}a(Ce,"runAssistantMode");async function Ue(o,n,t){let e=await i(o,n,"/apps/agent/digest",{method:"POST",body:JSON.stringify(t)});if(!e.ok){let s=await e.text().catch(()=>"");throw new Error(`Agent digest failed: ${e.status} ${s}`)}return await e.json()}a(Ue,"postAgentDigest");async function _e(o,n,t){let e=await i(o,n,"/apps/tools/execute",{method:"POST",body:JSON.stringify(t)}),s=await e.text().catch(()=>""),r=null;try{r=s?JSON.parse(s):null}catch{r=s}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):s||e.statusText}}a(_e,"executeUserTool");async function je(o,n,t){let e=await i(o,n,"/apps/backtests/run",{method:"POST",body:JSON.stringify(t)});if(!e.ok){let s=await e.text().catch(()=>"");throw new Error(`Backtest run failed: ${e.status} ${s}`)}return await e.json()}a(je,"submitBacktestRun");async function Be(o,n,t){let e=t.query&&Object.keys(t.query).length>0?`?${new URLSearchParams(t.query).toString()}`:"",s=await i(o,n,`/apps/backtests/tx${e}`,{method:t.method,body:t.method==="POST"&&t.body!==void 0?JSON.stringify(t.body):void 0});if(!s.ok){let r=await s.text().catch(()=>"");throw new Error(`Backtests request failed: ${s.status} ${r}`)}return await s.json()}a(Be,"submitBacktestTx");async function Ge(o,n,t){let e=new URLSearchParams(t).toString(),s=await i(o,n,`/apps/backtests/detail?${e}`,{method:"GET"});if(!s.ok){let r=await s.text().catch(()=>"");throw new Error(`Backtest detail failed: ${s.status} ${r}`)}return await s.json()}a(Ge,"submitBacktestDetail");function K(o){let n=o.trim().replace(/^\/+/,"");return encodeURIComponent(n||"tool")}a(K,"normalizeToolPathSegment");function W(o){let n=o.replace(/\/$/,""),t=process.env.OPENPOND_TOOL_URL;if(t)return t.replace(/\/$/,"");try{let e=new URL(n),s=e.hostname.toLowerCase(),r=s==="apps.openpond.live"?null:s===V||s===D||s===`www.${D}`||s==="openpond.live"||s==="www.openpond.live"?"https://apps.openpond.live":null;if(r)return r;let c=s==="localhost"||s==="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 Je(o,n,t){let e=W(o),s=K(t.toolName),c=`${t.deploymentId?`/${t.appId}/deployments/${t.deploymentId}`:`/${t.appId}`}/${s}`,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 x=u&&typeof u=="object"&&"ok"in u?!!u.ok:!0,y=g.ok&&x,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(Je,"executeHostedTool");import{createHash as Y}from"node:crypto";var X=3600*1e3;function $(o){return Y("sha256").update(JSON.stringify([o.apiBase.replace(/\/$/,""),o.apiKey.trim()])).digest("hex")}a($,"buildCacheKey");async function q(o,n){let t=await L(w(),o,$(n),{allowStale:!0});return!t||Date.now()-Date.parse(t.updatedAt)>=(n.ttlMs??X)?null:t.payload}a(q,"cached");async function ot(o){return q("cloud.apps",o)}a(ot,"getCachedApps");async function st(o){await E(w(),"cloud.apps",$(o),o.apps)}a(st,"setCachedApps");async function rt(o){return q("cloud.tools",o)}a(rt,"getCachedTools");async function at(o){await E(w(),"cloud.tools",$(o),o.tools)}a(at,"setCachedTools");var pt=["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,J as f,M as g,F as h,H 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,ve as I,Ie 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,Je as V,X as W,ot as X,st as Y,rt as Z,at as _,pt as $};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{P as H,Q as L,_ as S}from"./chunk-ALZRXBEC.js";import{f as A,h as O}from"./chunk-H7IWJN7L.js";import{a as l}from"./chunk-FTQLQJQV.js";import Q from"node:path";var U="default",z=["apiKey","baseUrl","apiBaseUrl","chatApiBaseUrl","token","appId","conversationId"];function re(){return V()}l(re,"getConfigPath");function V(){return O(A()).config}l(V,"getGlobalConfigPath");function m(n,e){return Object.prototype.hasOwnProperty.call(n,e)}l(m,"hasOwn");function h(n){if(typeof n!="string")return null;let e=n.trim();return e.length>0?e:null}l(h,"normalizeHandle");function d(n){if(typeof n!="string")return null;let e=n.trim();return e?e.replace(/\/$/,""):null}l(d,"normalizeBaseUrl");function q(n){let e=h(n);if(!e)throw new Error("profile handle must be non-empty");return e}l(q,"requireHandle");function W(n){if(typeof n!="string")throw new Error("apiKey must be a non-empty string");let e=n.trim();if(!e)throw new Error("apiKey must be a non-empty string");return e}l(W,"requireApiKey");function b(n,e){let t=h(n),s=h(e);return!!(t&&s&&t.toLowerCase()===s.toLowerCase())}l(b,"handleEquals");function v(n,e,t){let s=d(t);return n.findIndex(i=>b(i.handle,e)?s?d(i.baseUrl)===s:!0:!1)}l(v,"findAccountIndex");function P(n){let e=h(n.handle)??U,t=d(n.baseUrl);return t?{handle:e,baseUrl:t}:{handle:e}}l(P,"selectorFromAccount");function y(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=h(typeof e.handle=="string"?e.handle:void 0);if(!t)return null;let s=d(typeof e.baseUrl=="string"?e.baseUrl:void 0);return s?{handle:t,baseUrl:s}:{handle:t}}l(y,"sanitizeActiveProfile");function B(n){if(!n||typeof n!="object"||Array.isArray(n))return;let e=n,t=typeof e.repoPath=="string"?e.repoPath.trim():"",s=typeof e.profile=="string"&&e.profile.trim()?e.profile.trim():"default";if(!t)return;let i={repoPath:t,profile:s,mode:"local"};if(e.lastCheck&&typeof e.lastCheck=="object"&&!Array.isArray(e.lastCheck)){let o=e.lastCheck,a=o.command,u=o.status,c=o.checkedAt;(a==="inspect"||a==="build"||a==="validate"||a==="eval"||a==="run")&&(u==="passed"||u==="failed")&&typeof c=="string"&&(i.lastCheck={command:a,status:u,checkedAt:c,...typeof o.exitCode=="number"||o.exitCode===null?{exitCode:o.exitCode}:{},...typeof o.sourceHead=="string"||o.sourceHead===null?{sourceHead:o.sourceHead}:{}})}if(e.lastPush&&typeof e.lastPush=="object"&&!Array.isArray(e.lastPush)){let o=e.lastPush,a=o.status,u=o.pushedAt;(a==="pushed"||a==="failed")&&typeof u=="string"&&(i.lastPush={status:a,pushedAt:u,...typeof o.teamId=="string"||o.teamId===null?{teamId:o.teamId}:{},...typeof o.projectId=="string"||o.projectId===null?{projectId:o.projectId}:{},...typeof o.localHead=="string"||o.localHead===null?{localHead:o.localHead}:{},...typeof o.hostedHead=="string"||o.hostedHead===null?{hostedHead:o.hostedHead}:{},...typeof o.sourceRef=="string"||o.sourceRef===null?{sourceRef:o.sourceRef}:{},...o.promotionStatus==="uploaded"||o.promotionStatus==="hosted_source_materialized"||o.promotionStatus==="hosted_source_materialize_failed"||o.promotionStatus==="hosted_source_check_pending"||o.promotionStatus==="hosted_source_check_failed"||o.promotionStatus==="hosted_source_published"||o.promotionStatus==="hosted_source_publish_failed"||o.promotionStatus==="hosted_run_pending"||o.promotionStatus==="hosted_run_passed"||o.promotionStatus==="hosted_run_failed"||o.promotionStatus===null?{promotionStatus:o.promotionStatus}:{},...o.hostedRunStatus==="not_started"||o.hostedRunStatus==="running"||o.hostedRunStatus==="passed"||o.hostedRunStatus==="failed"||o.hostedRunStatus===null?{hostedRunStatus:o.hostedRunStatus}:{},...typeof o.hostedRunAgentId=="string"||o.hostedRunAgentId===null?{hostedRunAgentId:o.hostedRunAgentId}:{},...typeof o.hostedRunId=="string"||o.hostedRunId===null?{hostedRunId:o.hostedRunId}:{},...typeof o.hostedRunAt=="string"||o.hostedRunAt===null?{hostedRunAt:o.hostedRunAt}:{},...w(o.hostedSourceMaterialization)?{hostedSourceMaterialization:w(o.hostedSourceMaterialization)}:{},...E(o.hostedSourceCheck)?{hostedSourceCheck:E(o.hostedSourceCheck)}:{},...K(o.hostedPublish)?{hostedPublish:K(o.hostedPublish)}:{},...M(o.hostedRun)?{hostedRun:M(o.hostedRun)}:{},...typeof o.error=="string"||o.error===null?{error:o.error}:{}})}if(Array.isArray(e.profiles)){let o=e.profiles.flatMap(a=>{let u=B(a);if(!u)return[];let c=a,p=c.source==="github"||c.source==="openpond_git"?c.source:"local",C=typeof c.repositoryId=="string"&&c.repositoryId.trim()?c.repositoryId.trim():Q.resolve(u.repoPath);return[{source:p,repositoryId:C,repoPath:u.repoPath,profile:u.profile,...u.lastCheck?{lastCheck:u.lastCheck}:{},...u.lastPush?{lastPush:u.lastPush}:{}}]});o.length>0&&(i.profiles=o)}return i}l(B,"sanitizeLocalOpenPondProfile");function w(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=R(e.status);return t?{status:t,...r(e,"agentId"),...r(e,"runtimeAgentId"),...r(e,"projectId"),...r(e,"sourceRoot"),...r(e,"sourceRef"),...r(e,"sourceCommitSha"),...r(e,"manifestHash"),...r(e,"manifestPath"),...r(e,"manifestSyncedAt"),...T(e,"fileCount"),...T(e,"totalBytes"),...r(e,"generatedManifestPath"),...k(e,"synthesizedOpenPondYaml"),...r(e,"uploadMetadataPath"),...f(e,"setupCommands"),...f(e,"validationCommands"),...r(e,"materializedAt"),...r(e,"error")}:null}l(w,"sanitizeHostedMaterializationStatus");function E(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=R(e.status);return t?{status:t,...r(e,"agentId"),...r(e,"deployPlanStatus"),...k(e,"canRun"),...k(e,"canDeploy"),...r(e,"sourceRef"),...r(e,"sourceCommitSha"),...r(e,"manifestHash"),...r(e,"manifestPath"),...f(e,"setupCommands"),...f(e,"validationCommands"),...f(e,"requiredChecks"),...f(e,"evalNames"),...f(e,"blockedReasons"),...f(e,"staleReasons"),...r(e,"runtimeId"),...r(e,"sandboxId"),...f(e,"traceArtifactRefs"),...f(e,"evalResultArtifactRefs"),...f(e,"validatorArtifactRefs"),...r(e,"checkedAt"),...r(e,"error")}:null}l(E,"sanitizeHostedSourceCheckStatus");function K(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=R(e.status);return t?{status:t,...r(e,"agentId"),...r(e,"snapshotId"),...r(e,"sourceRef"),...r(e,"sourceCommitSha"),...r(e,"manifestHash"),...r(e,"manifestPath"),...r(e,"buildStatus"),...r(e,"validationStatus"),...r(e,"evalStatus"),...r(e,"publishedAt"),...r(e,"error")}:null}l(K,"sanitizeHostedPublishStatus");function M(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=R(e.status);return t?{status:t,...r(e,"agentId"),...r(e,"runId"),...r(e,"runtimeId"),...r(e,"sandboxId"),...r(e,"sourceRef"),...r(e,"sourceCommitSha"),...r(e,"manifestHash"),...r(e,"setupGateStatus"),...f(e,"setupRequirementRefs"),...f(e,"artifactRefs"),...f(e,"traceArtifactRefs"),...f(e,"evalArtifactRefs"),...r(e,"startedAt"),...r(e,"completedAt"),...r(e,"error")}:null}l(M,"sanitizeHostedRunSummary");function r(n,e){let t=n[e];return typeof t=="string"||t===null?{[e]:t}:{}}l(r,"nullableStringProp");function k(n,e){let t=n[e];return typeof t=="boolean"||t===null?{[e]:t}:{}}l(k,"nullableBooleanProp");function T(n,e){let t=n[e];return typeof t=="number"||t===null?{[e]:t}:{}}l(T,"nullableNumberProp");function f(n,e){let t=n[e];if(!Array.isArray(t))return{};let s=t.filter(i=>typeof i=="string");return{[e]:s}}l(f,"stringArrayProp");function R(n){return typeof n=="string"&&n.trim()?n.trim():null}l(R,"stringField");function D(n,e){if(!b(n.handle,e.handle))return!1;let t=d(e.baseUrl);return t?d(n.baseUrl)===t:!d(n.baseUrl)}l(D,"accountMatchesSelector");function I(n,e,t={}){let s=d(e.baseUrl);if(s)return v(n,e.handle,s);let i=n.findIndex(a=>D(a,e));if(i!==-1)return i;let o=n.map((a,u)=>({account:a,index:u})).filter(({account:a})=>b(a.handle,e.handle));if(o.length>1&&t.requireUnambiguous)throw new Error(`multiple profiles found for ${e.handle}; pass --base-url to select one`);return o[0]?.index??-1}l(I,"findAccountIndexForSelector");function X(n){if(!n||typeof n!="object"||Array.isArray(n))return;let e=n,t={};return typeof e.token=="string"&&(t.token=e.token),(typeof e.appId=="string"||e.appId===null)&&(t.appId=e.appId),(typeof e.conversationId=="string"||e.conversationId===null)&&(t.conversationId=e.conversationId),Object.keys(t).length>0?t:void 0}l(X,"sanitizeSession");function Z(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=h(typeof e.handle=="string"?e.handle:void 0);if(!t)return null;let s={handle:t};typeof e.apiKey=="string"&&(s.apiKey=e.apiKey),typeof e.baseUrl=="string"&&(s.baseUrl=e.baseUrl),typeof e.apiBaseUrl=="string"&&(s.apiBaseUrl=e.apiBaseUrl),typeof e.chatApiBaseUrl=="string"&&(s.chatApiBaseUrl=e.chatApiBaseUrl),typeof e.environment=="string"&&(s.environment=e.environment);let i=X(e.session);return i&&(s.session=i),s}l(Z,"sanitizeAccount");function ee(n){let e={};return typeof n.token=="string"&&(e.token=n.token),(typeof n.appId=="string"||n.appId===null)&&(e.appId=n.appId),(typeof n.conversationId=="string"||n.conversationId===null)&&(e.conversationId=n.conversationId),Object.keys(e).length>0?e:void 0}l(ee,"extractLegacySession");function ne(n,e){let t={handle:e};typeof n.apiKey=="string"&&(t.apiKey=n.apiKey),typeof n.baseUrl=="string"&&(t.baseUrl=n.baseUrl),typeof n.apiBaseUrl=="string"&&(t.apiBaseUrl=n.apiBaseUrl),typeof n.chatApiBaseUrl=="string"&&(t.chatApiBaseUrl=n.chatApiBaseUrl);let s=ee(n);return s&&(t.session=s),t}l(ne,"extractLegacyAccount");function x(n){let e={};typeof n.lspEnabled=="boolean"&&(e.lspEnabled=n.lspEnabled),(n.executionMode==="local"||n.executionMode==="hosted")&&(e.executionMode=n.executionMode),(n.mode==="general"||n.mode==="builder")&&(e.mode=n.mode);let t=B(n.openpondProfile);t&&(e.openpondProfile=t);let s=[],i=Array.isArray(n.accounts)?n.accounts:[];for(let c of i){let p=Z(c);p&&v(s,p.handle,p.baseUrl)===-1&&s.push(p)}if(s.length===0){let c=y(n.activeProfile)?.handle||U;s.push(ne(n,c))}let o=y(n.activeProfile),a=o?I(s,o):-1,u=s[a===-1?0:a];return e.accounts=s,e.activeProfile=P(u),e}l(x,"normalizeGlobalConfig");function N(n,e,t){let s=n.accounts??[],i=d(t??process.env.OPENPOND_BASE_URL),o=h(e);if(o)return i?{handle:o,baseUrl:i}:{handle:o};let a=h(process.env.OPENPOND_ACCOUNT);if(a)return i?{handle:a,baseUrl:i}:{handle:a};let u=y(n.activeProfile);return u?i?{handle:u.handle,baseUrl:i}:u:s[0]?P(s[0]):{handle:U}}l(N,"resolveRequestedProfile");function G(n,e,t){let s=d(t);if(s){let o=v(n,e,s);if(o!==-1)return n[o]}else{let o=n.filter(a=>b(a.handle,e));if(o.length>1)throw new Error(`multiple profiles found for ${e}; pass --base-url to select one`);if(o.length===1)return o[0]}let i={handle:e};return s&&(i.baseUrl=s),n.push(i),i}l(G,"ensureAccount");function j(n){n.session&&Object.keys(n.session).length===0&&delete n.session}l(j,"cleanupAccount");function te(n,e,t,s){let i=t===null||t===void 0&&s.undefinedDeletes;switch(e){case"apiKey":{if(i){delete n.apiKey;return}typeof t=="string"&&(n.apiKey=t);return}case"baseUrl":{if(i){delete n.baseUrl;return}typeof t=="string"&&(n.baseUrl=t);return}case"apiBaseUrl":{if(i){delete n.apiBaseUrl;return}typeof t=="string"&&(n.apiBaseUrl=t);return}case"chatApiBaseUrl":{if(i){delete n.chatApiBaseUrl;return}typeof t=="string"&&(n.chatApiBaseUrl=t);return}case"token":case"appId":case"conversationId":{if(n.session||(n.session={}),i){delete n.session[e],j(n);return}(typeof t=="string"||t===null)&&(n.session[e]=t),j(n);return}}}l(te,"applyScopedKey");function $(n,e,t){if(!z.some(c=>m(e,c)))return!1;let i=n.accounts??[],o=y(e.activeProfile)??N(n),a=d(m(e,"baseUrl")?e.baseUrl??null:o.baseUrl??process.env.OPENPOND_BASE_URL),u=G(i,o.handle,a);for(let c of z)m(e,c)&&te(u,c,e[c],t);return n.accounts=i,n.activeProfile=P(u),!0}l($,"applyAccountPatch");function F(n,e){if(m(e,"lspEnabled")&&(typeof e.lspEnabled=="boolean"?n.lspEnabled=e.lspEnabled:e.lspEnabled===null&&delete n.lspEnabled),m(e,"executionMode")&&(e.executionMode==="local"||e.executionMode==="hosted"?n.executionMode=e.executionMode:e.executionMode===null&&delete n.executionMode),m(e,"mode")&&(e.mode==="general"||e.mode==="builder"?n.mode=e.mode:e.mode===null&&delete n.mode),m(e,"activeProfile")){let t=y(e.activeProfile);if(t){let s=I(n.accounts??[],t);n.activeProfile=s===-1?t:P((n.accounts??[])[s])}else e.activeProfile===null&&delete n.activeProfile}if(m(e,"openpondProfile")){let t=B(e.openpondProfile);t?n.openpondProfile=t:e.openpondProfile===null&&delete n.openpondProfile}}l(F,"applyTopLevelPatch");async function oe(n){let e=A();await S(e),await L(e,()=>n)}l(oe,"writeGlobalConfig");async function _(n){let e=A();return await S(e),await L(e,t=>{let s=x(t);return n(s),s})}l(_,"updateGlobalConfig");async function Y(){let n=A();return await S(n),x(await H(n))}l(Y,"loadGlobalConfig");async function le(n={}){let e=await Y(),t=e.accounts??[],s=N(e,n.account,n.baseUrl),i=I(t,s,{requireUnambiguous:!0}),o=i===-1?null:t[i],a=o?.session;return{...e,activeProfile:o?P(o):s,apiKey:o?.apiKey,baseUrl:o?.baseUrl,apiBaseUrl:o?.apiBaseUrl,chatApiBaseUrl:o?.chatApiBaseUrl,token:a?.token,appId:a?.appId,conversationId:a?.conversationId}}l(le,"loadConfig");async function J(){let n=await Y(),e=y(n.activeProfile);return(n.accounts??[]).map(t=>{let s=h(t.handle)??U;return{handle:s,baseUrl:d(t.baseUrl),apiBaseUrl:d(t.apiBaseUrl),chatApiBaseUrl:d(t.chatApiBaseUrl),environment:t.environment?.trim()||null,isActive:!!(e&&D({...t,handle:s},e)),hasApiKey:!!t.apiKey?.trim(),hasSessionToken:!!t.session?.token?.trim(),sessionAppId:t.session?.appId??null,sessionConversationId:t.session?.conversationId??null}})}l(J,"listConfiguredProfiles");async function ae(n,e={}){let t=q(n),s=d(e.baseUrl),i=-1;await _(a=>{let u=a.accounts??[];if(i=I(u,s?{handle:t,baseUrl:s}:{handle:t},{requireUnambiguous:!0}),i===-1)throw new Error(`profile not found: ${t}`);a.activeProfile=P(u[i])});let o=await J();return o.find(a=>a.isActive)??o[i]}l(ae,"setActiveProfile");async function ue(n){let e=q(n.handle),t=W(n.apiKey),s=d(n.baseUrl),i=d(n.apiBaseUrl),o=d(n.chatApiBaseUrl),a={handle:e};await _(p=>{let C=p.accounts??[],g=G(C,e,s);g.apiKey=t,s&&(g.baseUrl=s),i?g.apiBaseUrl=i:n.apiBaseUrl===null&&delete g.apiBaseUrl,o?g.chatApiBaseUrl=o:n.chatApiBaseUrl===null&&delete g.chatApiBaseUrl,n.environment===null?delete g.environment:typeof n.environment=="string"&&n.environment.trim()&&(g.environment=n.environment.trim()),p.accounts=C,a=P(g),n.setActive!==!1&&(p.activeProfile=a)});let c=(await J()).find(p=>b(p.handle,a.handle)?s?d(p.baseUrl)===s:!0:!1);if(!c)throw new Error(`failed to save profile: ${e}`);return c}l(ue,"saveProfileApiKey");async function ce(n){let e=x(n);F(e,n),$(e,n,{undefinedDeletes:!0}),await oe(e)}l(ce,"saveConfig");async function de(n){await _(e=>{F(e,n),$(e,n,{undefinedDeletes:!1})})}l(de,"saveGlobalConfig");export{re as a,_ as b,Y as c,le as d,J as e,ae as f,ue as g,ce as h,de as i};
|
|
2
|
+
import{P as H,Q as L,_ as S}from"./chunk-DALJMSJG.js";import{f as A,h as O}from"./chunk-H7IWJN7L.js";import{a as l}from"./chunk-FTQLQJQV.js";import Q from"node:path";var U="default",z=["apiKey","baseUrl","apiBaseUrl","chatApiBaseUrl","token","appId","conversationId"];function re(){return V()}l(re,"getConfigPath");function V(){return O(A()).config}l(V,"getGlobalConfigPath");function m(n,e){return Object.prototype.hasOwnProperty.call(n,e)}l(m,"hasOwn");function h(n){if(typeof n!="string")return null;let e=n.trim();return e.length>0?e:null}l(h,"normalizeHandle");function d(n){if(typeof n!="string")return null;let e=n.trim();return e?e.replace(/\/$/,""):null}l(d,"normalizeBaseUrl");function q(n){let e=h(n);if(!e)throw new Error("profile handle must be non-empty");return e}l(q,"requireHandle");function W(n){if(typeof n!="string")throw new Error("apiKey must be a non-empty string");let e=n.trim();if(!e)throw new Error("apiKey must be a non-empty string");return e}l(W,"requireApiKey");function b(n,e){let t=h(n),s=h(e);return!!(t&&s&&t.toLowerCase()===s.toLowerCase())}l(b,"handleEquals");function v(n,e,t){let s=d(t);return n.findIndex(i=>b(i.handle,e)?s?d(i.baseUrl)===s:!0:!1)}l(v,"findAccountIndex");function P(n){let e=h(n.handle)??U,t=d(n.baseUrl);return t?{handle:e,baseUrl:t}:{handle:e}}l(P,"selectorFromAccount");function y(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=h(typeof e.handle=="string"?e.handle:void 0);if(!t)return null;let s=d(typeof e.baseUrl=="string"?e.baseUrl:void 0);return s?{handle:t,baseUrl:s}:{handle:t}}l(y,"sanitizeActiveProfile");function B(n){if(!n||typeof n!="object"||Array.isArray(n))return;let e=n,t=typeof e.repoPath=="string"?e.repoPath.trim():"",s=typeof e.profile=="string"&&e.profile.trim()?e.profile.trim():"default";if(!t)return;let i={repoPath:t,profile:s,mode:"local"};if(e.lastCheck&&typeof e.lastCheck=="object"&&!Array.isArray(e.lastCheck)){let o=e.lastCheck,a=o.command,u=o.status,c=o.checkedAt;(a==="inspect"||a==="build"||a==="validate"||a==="eval"||a==="run")&&(u==="passed"||u==="failed")&&typeof c=="string"&&(i.lastCheck={command:a,status:u,checkedAt:c,...typeof o.exitCode=="number"||o.exitCode===null?{exitCode:o.exitCode}:{},...typeof o.sourceHead=="string"||o.sourceHead===null?{sourceHead:o.sourceHead}:{}})}if(e.lastPush&&typeof e.lastPush=="object"&&!Array.isArray(e.lastPush)){let o=e.lastPush,a=o.status,u=o.pushedAt;(a==="pushed"||a==="failed")&&typeof u=="string"&&(i.lastPush={status:a,pushedAt:u,...typeof o.teamId=="string"||o.teamId===null?{teamId:o.teamId}:{},...typeof o.projectId=="string"||o.projectId===null?{projectId:o.projectId}:{},...typeof o.localHead=="string"||o.localHead===null?{localHead:o.localHead}:{},...typeof o.hostedHead=="string"||o.hostedHead===null?{hostedHead:o.hostedHead}:{},...typeof o.sourceRef=="string"||o.sourceRef===null?{sourceRef:o.sourceRef}:{},...o.promotionStatus==="uploaded"||o.promotionStatus==="hosted_source_materialized"||o.promotionStatus==="hosted_source_materialize_failed"||o.promotionStatus==="hosted_source_check_pending"||o.promotionStatus==="hosted_source_check_failed"||o.promotionStatus==="hosted_source_published"||o.promotionStatus==="hosted_source_publish_failed"||o.promotionStatus==="hosted_run_pending"||o.promotionStatus==="hosted_run_passed"||o.promotionStatus==="hosted_run_failed"||o.promotionStatus===null?{promotionStatus:o.promotionStatus}:{},...o.hostedRunStatus==="not_started"||o.hostedRunStatus==="running"||o.hostedRunStatus==="passed"||o.hostedRunStatus==="failed"||o.hostedRunStatus===null?{hostedRunStatus:o.hostedRunStatus}:{},...typeof o.hostedRunAgentId=="string"||o.hostedRunAgentId===null?{hostedRunAgentId:o.hostedRunAgentId}:{},...typeof o.hostedRunId=="string"||o.hostedRunId===null?{hostedRunId:o.hostedRunId}:{},...typeof o.hostedRunAt=="string"||o.hostedRunAt===null?{hostedRunAt:o.hostedRunAt}:{},...w(o.hostedSourceMaterialization)?{hostedSourceMaterialization:w(o.hostedSourceMaterialization)}:{},...E(o.hostedSourceCheck)?{hostedSourceCheck:E(o.hostedSourceCheck)}:{},...K(o.hostedPublish)?{hostedPublish:K(o.hostedPublish)}:{},...M(o.hostedRun)?{hostedRun:M(o.hostedRun)}:{},...typeof o.error=="string"||o.error===null?{error:o.error}:{}})}if(Array.isArray(e.profiles)){let o=e.profiles.flatMap(a=>{let u=B(a);if(!u)return[];let c=a,p=c.source==="github"||c.source==="openpond_git"?c.source:"local",C=typeof c.repositoryId=="string"&&c.repositoryId.trim()?c.repositoryId.trim():Q.resolve(u.repoPath);return[{source:p,repositoryId:C,repoPath:u.repoPath,profile:u.profile,...u.lastCheck?{lastCheck:u.lastCheck}:{},...u.lastPush?{lastPush:u.lastPush}:{}}]});o.length>0&&(i.profiles=o)}return i}l(B,"sanitizeLocalOpenPondProfile");function w(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=R(e.status);return t?{status:t,...r(e,"agentId"),...r(e,"runtimeAgentId"),...r(e,"projectId"),...r(e,"sourceRoot"),...r(e,"sourceRef"),...r(e,"sourceCommitSha"),...r(e,"manifestHash"),...r(e,"manifestPath"),...r(e,"manifestSyncedAt"),...T(e,"fileCount"),...T(e,"totalBytes"),...r(e,"generatedManifestPath"),...k(e,"synthesizedOpenPondYaml"),...r(e,"uploadMetadataPath"),...f(e,"setupCommands"),...f(e,"validationCommands"),...r(e,"materializedAt"),...r(e,"error")}:null}l(w,"sanitizeHostedMaterializationStatus");function E(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=R(e.status);return t?{status:t,...r(e,"agentId"),...r(e,"deployPlanStatus"),...k(e,"canRun"),...k(e,"canDeploy"),...r(e,"sourceRef"),...r(e,"sourceCommitSha"),...r(e,"manifestHash"),...r(e,"manifestPath"),...f(e,"setupCommands"),...f(e,"validationCommands"),...f(e,"requiredChecks"),...f(e,"evalNames"),...f(e,"blockedReasons"),...f(e,"staleReasons"),...r(e,"runtimeId"),...r(e,"sandboxId"),...f(e,"traceArtifactRefs"),...f(e,"evalResultArtifactRefs"),...f(e,"validatorArtifactRefs"),...r(e,"checkedAt"),...r(e,"error")}:null}l(E,"sanitizeHostedSourceCheckStatus");function K(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=R(e.status);return t?{status:t,...r(e,"agentId"),...r(e,"snapshotId"),...r(e,"sourceRef"),...r(e,"sourceCommitSha"),...r(e,"manifestHash"),...r(e,"manifestPath"),...r(e,"buildStatus"),...r(e,"validationStatus"),...r(e,"evalStatus"),...r(e,"publishedAt"),...r(e,"error")}:null}l(K,"sanitizeHostedPublishStatus");function M(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=R(e.status);return t?{status:t,...r(e,"agentId"),...r(e,"runId"),...r(e,"runtimeId"),...r(e,"sandboxId"),...r(e,"sourceRef"),...r(e,"sourceCommitSha"),...r(e,"manifestHash"),...r(e,"setupGateStatus"),...f(e,"setupRequirementRefs"),...f(e,"artifactRefs"),...f(e,"traceArtifactRefs"),...f(e,"evalArtifactRefs"),...r(e,"startedAt"),...r(e,"completedAt"),...r(e,"error")}:null}l(M,"sanitizeHostedRunSummary");function r(n,e){let t=n[e];return typeof t=="string"||t===null?{[e]:t}:{}}l(r,"nullableStringProp");function k(n,e){let t=n[e];return typeof t=="boolean"||t===null?{[e]:t}:{}}l(k,"nullableBooleanProp");function T(n,e){let t=n[e];return typeof t=="number"||t===null?{[e]:t}:{}}l(T,"nullableNumberProp");function f(n,e){let t=n[e];if(!Array.isArray(t))return{};let s=t.filter(i=>typeof i=="string");return{[e]:s}}l(f,"stringArrayProp");function R(n){return typeof n=="string"&&n.trim()?n.trim():null}l(R,"stringField");function D(n,e){if(!b(n.handle,e.handle))return!1;let t=d(e.baseUrl);return t?d(n.baseUrl)===t:!d(n.baseUrl)}l(D,"accountMatchesSelector");function I(n,e,t={}){let s=d(e.baseUrl);if(s)return v(n,e.handle,s);let i=n.findIndex(a=>D(a,e));if(i!==-1)return i;let o=n.map((a,u)=>({account:a,index:u})).filter(({account:a})=>b(a.handle,e.handle));if(o.length>1&&t.requireUnambiguous)throw new Error(`multiple profiles found for ${e.handle}; pass --base-url to select one`);return o[0]?.index??-1}l(I,"findAccountIndexForSelector");function X(n){if(!n||typeof n!="object"||Array.isArray(n))return;let e=n,t={};return typeof e.token=="string"&&(t.token=e.token),(typeof e.appId=="string"||e.appId===null)&&(t.appId=e.appId),(typeof e.conversationId=="string"||e.conversationId===null)&&(t.conversationId=e.conversationId),Object.keys(t).length>0?t:void 0}l(X,"sanitizeSession");function Z(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=h(typeof e.handle=="string"?e.handle:void 0);if(!t)return null;let s={handle:t};typeof e.apiKey=="string"&&(s.apiKey=e.apiKey),typeof e.baseUrl=="string"&&(s.baseUrl=e.baseUrl),typeof e.apiBaseUrl=="string"&&(s.apiBaseUrl=e.apiBaseUrl),typeof e.chatApiBaseUrl=="string"&&(s.chatApiBaseUrl=e.chatApiBaseUrl),typeof e.environment=="string"&&(s.environment=e.environment);let i=X(e.session);return i&&(s.session=i),s}l(Z,"sanitizeAccount");function ee(n){let e={};return typeof n.token=="string"&&(e.token=n.token),(typeof n.appId=="string"||n.appId===null)&&(e.appId=n.appId),(typeof n.conversationId=="string"||n.conversationId===null)&&(e.conversationId=n.conversationId),Object.keys(e).length>0?e:void 0}l(ee,"extractLegacySession");function ne(n,e){let t={handle:e};typeof n.apiKey=="string"&&(t.apiKey=n.apiKey),typeof n.baseUrl=="string"&&(t.baseUrl=n.baseUrl),typeof n.apiBaseUrl=="string"&&(t.apiBaseUrl=n.apiBaseUrl),typeof n.chatApiBaseUrl=="string"&&(t.chatApiBaseUrl=n.chatApiBaseUrl);let s=ee(n);return s&&(t.session=s),t}l(ne,"extractLegacyAccount");function x(n){let e={};typeof n.lspEnabled=="boolean"&&(e.lspEnabled=n.lspEnabled),(n.executionMode==="local"||n.executionMode==="hosted")&&(e.executionMode=n.executionMode),(n.mode==="general"||n.mode==="builder")&&(e.mode=n.mode);let t=B(n.openpondProfile);t&&(e.openpondProfile=t);let s=[],i=Array.isArray(n.accounts)?n.accounts:[];for(let c of i){let p=Z(c);p&&v(s,p.handle,p.baseUrl)===-1&&s.push(p)}if(s.length===0){let c=y(n.activeProfile)?.handle||U;s.push(ne(n,c))}let o=y(n.activeProfile),a=o?I(s,o):-1,u=s[a===-1?0:a];return e.accounts=s,e.activeProfile=P(u),e}l(x,"normalizeGlobalConfig");function N(n,e,t){let s=n.accounts??[],i=d(t??process.env.OPENPOND_BASE_URL),o=h(e);if(o)return i?{handle:o,baseUrl:i}:{handle:o};let a=h(process.env.OPENPOND_ACCOUNT);if(a)return i?{handle:a,baseUrl:i}:{handle:a};let u=y(n.activeProfile);return u?i?{handle:u.handle,baseUrl:i}:u:s[0]?P(s[0]):{handle:U}}l(N,"resolveRequestedProfile");function G(n,e,t){let s=d(t);if(s){let o=v(n,e,s);if(o!==-1)return n[o]}else{let o=n.filter(a=>b(a.handle,e));if(o.length>1)throw new Error(`multiple profiles found for ${e}; pass --base-url to select one`);if(o.length===1)return o[0]}let i={handle:e};return s&&(i.baseUrl=s),n.push(i),i}l(G,"ensureAccount");function j(n){n.session&&Object.keys(n.session).length===0&&delete n.session}l(j,"cleanupAccount");function te(n,e,t,s){let i=t===null||t===void 0&&s.undefinedDeletes;switch(e){case"apiKey":{if(i){delete n.apiKey;return}typeof t=="string"&&(n.apiKey=t);return}case"baseUrl":{if(i){delete n.baseUrl;return}typeof t=="string"&&(n.baseUrl=t);return}case"apiBaseUrl":{if(i){delete n.apiBaseUrl;return}typeof t=="string"&&(n.apiBaseUrl=t);return}case"chatApiBaseUrl":{if(i){delete n.chatApiBaseUrl;return}typeof t=="string"&&(n.chatApiBaseUrl=t);return}case"token":case"appId":case"conversationId":{if(n.session||(n.session={}),i){delete n.session[e],j(n);return}(typeof t=="string"||t===null)&&(n.session[e]=t),j(n);return}}}l(te,"applyScopedKey");function $(n,e,t){if(!z.some(c=>m(e,c)))return!1;let i=n.accounts??[],o=y(e.activeProfile)??N(n),a=d(m(e,"baseUrl")?e.baseUrl??null:o.baseUrl??process.env.OPENPOND_BASE_URL),u=G(i,o.handle,a);for(let c of z)m(e,c)&&te(u,c,e[c],t);return n.accounts=i,n.activeProfile=P(u),!0}l($,"applyAccountPatch");function F(n,e){if(m(e,"lspEnabled")&&(typeof e.lspEnabled=="boolean"?n.lspEnabled=e.lspEnabled:e.lspEnabled===null&&delete n.lspEnabled),m(e,"executionMode")&&(e.executionMode==="local"||e.executionMode==="hosted"?n.executionMode=e.executionMode:e.executionMode===null&&delete n.executionMode),m(e,"mode")&&(e.mode==="general"||e.mode==="builder"?n.mode=e.mode:e.mode===null&&delete n.mode),m(e,"activeProfile")){let t=y(e.activeProfile);if(t){let s=I(n.accounts??[],t);n.activeProfile=s===-1?t:P((n.accounts??[])[s])}else e.activeProfile===null&&delete n.activeProfile}if(m(e,"openpondProfile")){let t=B(e.openpondProfile);t?n.openpondProfile=t:e.openpondProfile===null&&delete n.openpondProfile}}l(F,"applyTopLevelPatch");async function oe(n){let e=A();await S(e),await L(e,()=>n)}l(oe,"writeGlobalConfig");async function _(n){let e=A();return await S(e),await L(e,t=>{let s=x(t);return n(s),s})}l(_,"updateGlobalConfig");async function Y(){let n=A();return await S(n),x(await H(n))}l(Y,"loadGlobalConfig");async function le(n={}){let e=await Y(),t=e.accounts??[],s=N(e,n.account,n.baseUrl),i=I(t,s,{requireUnambiguous:!0}),o=i===-1?null:t[i],a=o?.session;return{...e,activeProfile:o?P(o):s,apiKey:o?.apiKey,baseUrl:o?.baseUrl,apiBaseUrl:o?.apiBaseUrl,chatApiBaseUrl:o?.chatApiBaseUrl,token:a?.token,appId:a?.appId,conversationId:a?.conversationId}}l(le,"loadConfig");async function J(){let n=await Y(),e=y(n.activeProfile);return(n.accounts??[]).map(t=>{let s=h(t.handle)??U;return{handle:s,baseUrl:d(t.baseUrl),apiBaseUrl:d(t.apiBaseUrl),chatApiBaseUrl:d(t.chatApiBaseUrl),environment:t.environment?.trim()||null,isActive:!!(e&&D({...t,handle:s},e)),hasApiKey:!!t.apiKey?.trim(),hasSessionToken:!!t.session?.token?.trim(),sessionAppId:t.session?.appId??null,sessionConversationId:t.session?.conversationId??null}})}l(J,"listConfiguredProfiles");async function ae(n,e={}){let t=q(n),s=d(e.baseUrl),i=-1;await _(a=>{let u=a.accounts??[];if(i=I(u,s?{handle:t,baseUrl:s}:{handle:t},{requireUnambiguous:!0}),i===-1)throw new Error(`profile not found: ${t}`);a.activeProfile=P(u[i])});let o=await J();return o.find(a=>a.isActive)??o[i]}l(ae,"setActiveProfile");async function ue(n){let e=q(n.handle),t=W(n.apiKey),s=d(n.baseUrl),i=d(n.apiBaseUrl),o=d(n.chatApiBaseUrl),a={handle:e};await _(p=>{let C=p.accounts??[],g=G(C,e,s);g.apiKey=t,s&&(g.baseUrl=s),i?g.apiBaseUrl=i:n.apiBaseUrl===null&&delete g.apiBaseUrl,o?g.chatApiBaseUrl=o:n.chatApiBaseUrl===null&&delete g.chatApiBaseUrl,n.environment===null?delete g.environment:typeof n.environment=="string"&&n.environment.trim()&&(g.environment=n.environment.trim()),p.accounts=C,a=P(g),n.setActive!==!1&&(p.activeProfile=a)});let c=(await J()).find(p=>b(p.handle,a.handle)?s?d(p.baseUrl)===s:!0:!1);if(!c)throw new Error(`failed to save profile: ${e}`);return c}l(ue,"saveProfileApiKey");async function ce(n){let e=x(n);F(e,n),$(e,n,{undefinedDeletes:!0}),await oe(e)}l(ce,"saveConfig");async function de(n){await _(e=>{F(e,n),$(e,n,{undefinedDeletes:!1})})}l(de,"saveGlobalConfig");export{re as a,_ as b,Y as c,le as d,J as e,ae as f,ue as g,ce as h,de as i};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{e as g,g as $,h as O,i as C}from"./chunk-
|
|
2
|
+
import{e as g,g as $,h as O,i as C}from"./chunk-Q4H3NUVW.js";import{a as w}from"./chunk-3M53YXEI.js";import{a as r}from"./chunk-FTQLQJQV.js";var L=Symbol("openpondCliOptionValues"),a=class extends Error{static{r(this,"CliUsageError")}exitCode=2;constructor(t){super(t),this.name="CliUsageError"}},K=new Set(["maxOutputBytes","timeoutSec"]);function k(n){let t=[...n],o="",i={},e={},u=[];for(;t.length>0;){let s=t.shift();if(s==="--"){u.push(...t);break}if(s.startsWith("--")){let f=s.indexOf("="),c=f>=0?s.slice(2,f):s.slice(2),p=N(c),d=f>=0?s.slice(f+1):P(t,p,o);h(i,e,p,d,o)}else _(s)?y(s,t,i,e):o?u.push(s):o=s}return Object.defineProperty(i,L,{value:e,enumerable:!1,configurable:!1,writable:!1}),V(o,i),{command:o,options:i,rest:u}}r(k,"parseArgs");function N(n){return n.replace(/-([a-z])/g,(t,o)=>o.toUpperCase())}r(N,"normalizeCliOptionKey");function _(n){return/^-[^-].*/.test(n)&&!S(n)}r(_,"isShortOptionToken");function y(n,t,o,i){let e=n.slice(1);if(!e)return;let u=e.indexOf("="),s=u>=0?e.slice(0,u):e,f=u>=0?e.slice(u+1):null;if(s.length!==1){for(let d of s){let m=g[d];if(!m)throw new a(`unknown short option -${d}`);if(C(m)!=="boolean")throw new a(`short option -${d} requires its own value`);h(o,i,m,"true")}return}let c=g[s];if(!c)throw new a(`unknown short option -${s}`);let p=f??P(t,c);h(o,i,c,p)}r(y,"parseShortOptionToken");function P(n,t,o){let i=I(t,o);if(i==="boolean")return n[0]&&x(n[0])?n.shift():"true";if(i){let e=n.shift();if(e===void 0||R(e)&&!S(e))throw e!==void 0&&n.unshift(e),new a(`${l(t)} must be ${b(i)}`);return e}return n[0]&&!n[0].startsWith("--")?n.shift():"true"}r(P,"readOptionValue");function h(n,t,o,i,e){T(o,i,e),n[o]=i,(t[o]??=[]).push(i)}r(h,"setParsedOption");function T(n,t,o){let i=I(n,o);if(i){if(i==="boolean"){if(!x(t))throw new a(`${l(n)} must be a boolean`);return}if(t.trim().length===0||t==="true")throw new a(`${l(n)} must be ${b(i)}`);if(i==="number"||i==="integer"){let e=Number(t);if(!Number.isFinite(e))throw new a(`${l(n)} must be ${b(i)}`);if(i==="integer"&&!Number.isInteger(e))throw new a(`${l(n)} must be an integer`);if(i==="integer"&&K.has(n)&&e<=0)throw new a(`${l(n)} must be a positive integer`);return}if(i==="json")try{w(t,l(n))}catch(e){throw new a(e instanceof Error?e.message:String(e))}}}r(T,"validateParsedOptionValue");function I(n,t){return t?O(t,n):C(n)}r(I,"typedOptionKind");function l(n){return n.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}r(l,"cliOptionLabel");function E(n){return n==="json"?"JSON value":n}r(E,"optionKindLabel");function b(n){let t=E(n);return/^[aeiou]/i.test(t)?`an ${t}`:`a ${t}`}r(b,"optionKindPhrase");function x(n){return/^(true|false|1|0|yes|no)$/i.test(n)}r(x,"isBooleanLiteral");function R(n){return n.startsWith("-")&&n!=="-"}r(R,"isOptionLike");function S(n){return/^-\d+(?:\.\d+)?$/.test(n)}r(S,"isNegativeNumber");function V(n,t){let o=n?$(n):null;for(let i of Object.keys(t))if(!O(n,i)){let e=l(i),u=o?` for ${o.name}`:"";throw new a(`unknown option --${e}${u}`)}}r(V,"validateCommandOptions");export{a,k as b};
|