openpond 0.0.37 → 0.0.39
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/README.md +3 -7
- package/dist/api/core.d.ts +6 -0
- package/dist/api/types.d.ts +0 -50
- package/dist/api/vercel-protection.d.ts +1 -0
- package/dist/api.d.ts +2 -8
- package/dist/chunks/{app-layer-LF2HK2B2.js → app-layer-LTBWNA2F.js} +32 -10
- package/dist/chunks/app-server-runtime-VYYJ2AWX.js +18 -0
- package/dist/chunks/{apps-ZMCMQZKX.js → apps-CZAJBGE3.js} +6 -124
- package/dist/chunks/{chunk-MHBQWGCL.js → chunk-2SF6HLT7.js} +5463 -5535
- package/dist/chunks/{chunk-VFL2JVBZ.js → chunk-3CDPPVLE.js} +111 -84
- package/dist/chunks/{chunk-N6E6YSTP.js → chunk-3HW6OSHP.js} +1 -3
- package/dist/chunks/{chunk-43YI36NA.js → chunk-3KLQ52B2.js} +228 -5
- package/dist/chunks/chunk-4HIWFIMN.js +37172 -0
- package/dist/chunks/{chunk-WTA33KQQ.js → chunk-4N6E3OVF.js} +4 -4
- package/dist/chunks/{chunk-35PPAOWD.js → chunk-6V7MJVRO.js} +56 -11
- package/dist/chunks/{chunk-ICLLW5QD.js → chunk-BQQZNGI6.js} +154 -194
- package/dist/chunks/chunk-DBHSOTYZ.js +1552 -0
- package/dist/chunks/{chunk-ZZ4ECDTP.js → chunk-FCVVOMIP.js} +145 -5
- package/dist/chunks/{chunk-A3CJUBA7.js → chunk-JIEUB6OS.js} +1 -1
- package/dist/chunks/{chunk-WL76II47.js → chunk-JJPAMKXZ.js} +1 -1
- package/dist/chunks/{chunk-2WMGA5FE.js → chunk-JRROTGQT.js} +1 -110
- package/dist/chunks/chunk-KHNHUA2H.js +1737 -0
- package/dist/chunks/{chunk-LNKYEHIJ.js → chunk-L6XH4ZGZ.js} +1 -1
- package/dist/chunks/chunk-M2NXTLH2.js +4054 -0
- package/dist/chunks/{chunk-IATK3CIP.js → chunk-MIZHCABO.js} +2 -195
- package/dist/chunks/chunk-SMNFI2FU.js +113 -0
- package/dist/chunks/chunk-VCVQLECH.js +675 -0
- package/dist/chunks/{chunk-KT2BB4AR.js → chunk-ZJBJQCQZ.js} +179 -52
- package/dist/chunks/{cli-5NFIDCRL.js → cli-JS76LCW2.js} +9 -5
- package/dist/chunks/{core-commands-7223BEQL.js → core-commands-4MRJQZJV.js} +7 -5
- package/dist/chunks/{harness-OMJXIGEW.js → desktop-test-RNMWLOVU.js} +15 -14
- package/dist/chunks/{chunk-ZPL4GZML.js → extension-GDRW22N3.js} +5866 -3601
- package/dist/chunks/{help-YPPROIS7.js → help-LWNREJ7U.js} +1 -1
- package/dist/chunks/{opchat-K7IYFPX6.js → opchat-2K2JIGK3.js} +9 -10
- package/dist/chunks/{organizations-W3FMAWQ4.js → organizations-Z5HVD2E7.js} +11 -9
- package/dist/chunks/{profile-N4B3F7M7.js → profile-QNECVVGN.js} +12 -38
- package/dist/chunks/{project-agent-NA6SGU25.js → project-agent-W3V75WBR.js} +9 -411
- package/dist/chunks/{sandbox-command-AKCFJKKN.js → sandbox-command-X3FO74NX.js} +7 -5
- package/dist/chunks/{sandbox-template-5NKTAXCL.js → sandbox-template-5B4T4BGU.js} +8 -6
- package/dist/chunks/{src-XAVSQTVR.js → src-ESAILPUH.js} +32 -30
- package/dist/chunks/src-IC5RX4L6.js +63517 -0
- package/dist/chunks/{teams-bot-557NZC73.js → teams-bot-NTQ6VFFL.js} +6 -4
- package/dist/chunks/training-BR5A7SPU.js +320 -0
- package/dist/chunks/{workspaces-S2H75XQB.js → workspaces-XC3QBD2Y.js} +2 -2
- package/dist/cli.js +24 -12
- package/dist/client-types.d.ts +1 -9
- package/dist/client.d.ts +3 -3
- package/dist/config.d.ts +9 -3
- package/dist/index.js +1300 -1091
- package/dist/profile/local-profile-types.d.ts +16 -0
- package/dist/profile/local-profile.d.ts +50 -4
- package/dist/sandbox/client-handles.d.ts +33 -46
- package/dist/sandbox/client.d.ts +4 -26
- package/dist/sandbox/sandbox-instance-client.d.ts +5 -5
- package/dist/sandbox/types/client.d.ts +1 -2
- package/dist/sandbox/types/core.d.ts +0 -1
- package/dist/sandbox/types/org-project-agent.d.ts +3 -89
- package/dist/sandbox/types/record.d.ts +1 -2
- package/dist/sandbox/types/runtime-profiles.d.ts +2 -2
- package/dist/sandbox-template/manifest.d.ts +1 -1
- package/dist/skills/openpond-agent-authoring/SKILL.md +40 -0
- package/dist/skills/openpond-agent-authoring/references/action-and-chat-design.md +13 -0
- package/dist/skills/openpond-agent-authoring/references/integrations-and-setup.md +13 -0
- package/dist/skills/openpond-agent-authoring/references/profile-layout.md +29 -0
- package/dist/skills/openpond-agent-authoring/references/validation-and-repair.md +14 -0
- package/dist/skills/openpond-desktop-harness/SKILL.md +1 -1
- package/dist/skills/openpond-skill-authoring/SKILL.md +44 -0
- package/dist/skills/openpond-skill-authoring/references/copying-and-adaptation.md +16 -0
- package/dist/skills/openpond-skill-authoring/references/skill-package-layout.md +38 -0
- package/dist/skills/openpond-skill-authoring/references/validation-and-repair.md +24 -0
- package/dist/skills/openpond-skill-authoring/scripts/validate-skill.mjs +102 -0
- package/dist/skills/openpond-taskset-authoring/SKILL.md +64 -22
- package/dist/skills/openpond-taskset-authoring/artifact.json +39 -0
- package/dist/skills/openpond-taskset-authoring/references/graders-and-rewards.md +3 -0
- package/dist/skills/openpond-taskset-authoring/references/method-selection.md +1 -1
- package/dist/skills/openpond-taskset-authoring/references/privacy-and-provenance.md +2 -0
- package/dist/skills/openpond-taskset-authoring/references/task-design.md +32 -0
- package/dist/web/assets/{AppDialog-y6krB0MJ.js → AppDialog-Bua3f-6v.js} +1 -1
- package/dist/web/assets/{AppsView-4F6oLktr.js → AppsView-DrJkHeSO.js} +1 -1
- package/dist/web/assets/BrowserSidebar-Bf-4Vozm.js +1 -0
- package/dist/web/assets/CommandMenu-DDZlGQiB.js +1 -0
- package/dist/web/assets/CommunityView-BtcCrba7.js +1 -0
- package/dist/web/assets/ComposerCreateImproveStrip-DOe5Otg6.js +1 -0
- package/dist/web/assets/GetStartedView-CG4z0Dtw.js +1 -0
- package/dist/web/assets/GetStartedView-yVmnGZPw.css +1 -0
- package/dist/web/assets/LabModelVersionDetailPage-BEkmSKuv.js +1 -0
- package/dist/web/assets/LabSkillSidebar-BIotN_RB.js +1 -0
- package/dist/web/assets/LabsRoute-CfOe0Zt5.js +3 -0
- package/dist/web/assets/LabsRoute-CoSPO4HR.css +1 -0
- package/dist/web/assets/MainChatThread-C0-l1mHt.js +2 -0
- package/dist/web/assets/MainPane-Bky_Rqcx.css +1 -0
- package/dist/web/assets/MainPane-aOVlVyRK.js +6 -0
- package/dist/web/assets/MarkdownText-D7DT1k1k.js +9 -0
- package/dist/web/assets/Messages-CBIXruA9.js +9 -0
- package/dist/web/assets/NativeSkillSidebar-C4t69Y7B.js +1 -0
- package/dist/web/assets/NewProjectDialog-Bat65tYD.js +1 -0
- package/dist/web/assets/OutputsPage-C58n39Db.js +1 -0
- package/dist/web/assets/RightChatPanelStack-Bp7nZxQ0.js +1 -0
- package/dist/web/assets/ScheduledWorkPage-BXP0j_c_.js +1 -0
- package/dist/web/assets/SettingsView-CtWK_aQ0.css +1 -0
- package/dist/web/assets/SettingsView-DOOfhO9a.js +6 -0
- package/dist/web/assets/TeamChatView-Cgxm-pKA.css +1 -0
- package/dist/web/assets/TeamChatView-De2wdqyY.js +3 -0
- package/dist/web/assets/{TerminalOverlay-B56XmI-k.js → TerminalOverlay-BsuCH3NX.js} +1 -1
- package/dist/web/assets/TrainingCreationPanel-D2OFWyQ-.js +1 -0
- package/dist/web/assets/TrainingDraftPanel-DBpulXTz.js +1 -0
- package/dist/web/assets/{UsageSettingsSection-r3CqRm6Q.js → UsageSettingsSection-DzMLUXAO.js} +37 -37
- package/dist/web/assets/WorkspaceDiffPanel-B7yIhjNF.js +14 -0
- package/dist/web/assets/WorkspaceEnvironmentMenu-B6jXM9xG.js +32 -0
- package/dist/web/assets/WorkspaceGitDialogs-CQ0fl9Qk.js +1 -0
- package/dist/web/assets/{WorkspaceMonacoEditor-CHd22UcG.js → WorkspaceMonacoEditor-C2ctzITz.js} +3 -3
- package/dist/web/assets/arrow-up-right-ecwcx3xt.js +1 -0
- package/dist/web/assets/chevron-up-DP8PPfWd.js +1 -0
- package/dist/web/assets/circle-alert-envg1D6O.js +1 -0
- package/dist/web/assets/cloud-upload-5MGPLnaA.js +1 -0
- package/dist/web/assets/{cssMode-KFDYjM8T.js → cssMode-CFifcEfw.js} +1 -1
- package/dist/web/assets/folder-open-Dq3ZjeEP.js +1 -0
- package/dist/web/assets/folder-plus-EiZ5wbv_.js +1 -0
- package/dist/web/assets/git-branch-w29jmQ-X.js +1 -0
- package/dist/web/assets/{git-commit-horizontal-C8UFKlXy.js → git-commit-horizontal-CGZM0PZo.js} +1 -1
- package/dist/web/assets/{htmlMode-NbLN3n6Q.js → htmlMode-Ct1P-_lf.js} +1 -1
- package/dist/web/assets/index-ByIQyiUl.js +178 -0
- package/dist/web/assets/index-D4uCeiep.js +1 -0
- package/dist/web/assets/index-D9jTe16Q.css +1 -0
- package/dist/web/assets/info-Cd2HkIeb.js +1 -0
- package/dist/web/assets/{jsonMode-Bl3r4LM_.js → jsonMode-BAUNCNAX.js} +1 -1
- package/dist/web/assets/{lspLanguageFeatures-DH22w5XD.js → lspLanguageFeatures-fucFYI1A.js} +1 -1
- package/dist/web/assets/monaco.contribution-Ce4v5kei.js +2 -0
- package/dist/web/assets/monaco.contribution-DLLMi4cB.js +2 -0
- package/dist/web/assets/monaco.contribution-g9QiIm1d.js +2 -0
- package/dist/web/assets/monaco.contribution-nG-5Cyjz.js +2 -0
- package/dist/web/assets/monitor-DgHCnCKl.js +1 -0
- package/dist/web/assets/{play-2NDQ4-7K.js → play-Be0XDHBu.js} +1 -1
- package/dist/web/assets/{python-CQ0TmUW9.js → python-CEhEiPo7.js} +1 -1
- package/dist/web/assets/{refresh-cw-CyermMsy.js → refresh-cw-DH0KLbdD.js} +1 -1
- package/dist/web/assets/reply-D1TK2yV8.js +1 -0
- package/dist/web/assets/{save-Bij3cc3Q.js → save-C1MSeBnQ.js} +1 -1
- package/dist/web/assets/square-CemI-0g5.js +1 -0
- package/dist/web/assets/square-pen-CqfsvR_n.js +1 -0
- package/dist/web/assets/{toggleHighContrast-CxALivAH.js → toggleHighContrast-DrdQN3Rl.js} +1 -1
- package/dist/web/assets/training-BQVNUTZA.css +1 -0
- package/dist/web/assets/training-model-data-B7-1Bxil.js +1 -0
- package/dist/web/assets/{tsMode-vH4lMS7h.js → tsMode-CKB5oOUU.js} +1 -1
- package/dist/web/assets/{upload-DbJfEI3G.js → upload-t751LLqP.js} +1 -1
- package/dist/web/assets/useLocalAgentSchedules-CzC3wfIP.js +1 -0
- package/dist/web/assets/{wifi-off-BnVFBG28.js → wifi-off-CxTHH3JU.js} +1 -1
- package/dist/web/assets/{workers-CBihj7z6.js → workers-CqYddzCd.js} +1 -1
- package/dist/web/assets/{yaml-Bhkoq1sy.js → yaml-e5wBkc-C.js} +1 -1
- package/dist/web/index.html +2 -2
- package/docs/command-reference.md +76 -41
- package/package.json +3 -1
- package/dist/chunks/chunk-3VURZQHA.js +0 -864
- package/dist/chunks/chunk-BWA3COR4.js +0 -3535
- package/dist/chunks/chunk-HLCTINEP.js +0 -224
- package/dist/chunks/chunk-PGET7EZF.js +0 -3896
- package/dist/chunks/chunk-T4QXKU5Y.js +0 -1
- package/dist/chunks/chunk-XEJ7XXUQ.js +0 -1301
- package/dist/chunks/cli-AS3DZ7XB.js +0 -23
- package/dist/chunks/extend-6N5S5KA5.js +0 -89
- package/dist/chunks/extension-FJSVCG2Q.js +0 -121
- package/dist/chunks/fileFromPath-DHCRY3BD.js +0 -2151
- package/dist/chunks/src-SCS4KKP4.js +0 -105881
- package/dist/web/assets/BrowserSidebar-C0MHQaaD.js +0 -1
- package/dist/web/assets/CloudWorkView-DNoPIlMj.css +0 -1
- package/dist/web/assets/CloudWorkView-DwFIZoXy.js +0 -1
- package/dist/web/assets/CommandMenu-CYGFrMZi.js +0 -1
- package/dist/web/assets/CommunityView-C6n89YXz.js +0 -1
- package/dist/web/assets/ComposerCreateImproveStrip-C3RwXC3_.js +0 -1
- package/dist/web/assets/GetStartedView-DBLdduwr.css +0 -1
- package/dist/web/assets/GetStartedView-fwD0ZXo9.js +0 -1
- package/dist/web/assets/LabSkillSidebar-BSuc-NJr.js +0 -1
- package/dist/web/assets/LabsRoute-BrJkBNig.css +0 -1
- package/dist/web/assets/LabsRoute-D2y8dSsT.js +0 -3
- package/dist/web/assets/MainChatThread-Dj_Ry6WQ.js +0 -2
- package/dist/web/assets/MakeAgentTutorialLearningPanel-Bz2VDaRe.js +0 -2
- package/dist/web/assets/MarkdownText-B6Nu_0Fz.js +0 -7
- package/dist/web/assets/Messages-CH2wfv2a.js +0 -10
- package/dist/web/assets/NativeSkillSidebar-4iUfgwqO.js +0 -1
- package/dist/web/assets/NewProjectDialog-8M5-6-h-.js +0 -1
- package/dist/web/assets/PostTrainingLearningPanel-CdG5KHZs.js +0 -2
- package/dist/web/assets/PostTrainingStatusPill-COZ4qISQ.js +0 -1
- package/dist/web/assets/ProfileSettingsSection-Bo7dybgW.js +0 -1
- package/dist/web/assets/ProfileSettingsSection-Cg4tKO-C.css +0 -1
- package/dist/web/assets/RightChatPanelStack-Di8zoHJI.js +0 -1
- package/dist/web/assets/SettingsView-BcYyY66X.css +0 -1
- package/dist/web/assets/SettingsView-CAaKdDHt.js +0 -6
- package/dist/web/assets/TeamChatView-Bx44q3WV.css +0 -1
- package/dist/web/assets/TeamChatView-CzQYFBap.js +0 -3
- package/dist/web/assets/TrainingCreationPanel-C_ntWAAP.js +0 -1
- package/dist/web/assets/TrainingDraftPanel-3hJIxLNn.js +0 -1
- package/dist/web/assets/WorkspaceDiffPanel-By8PWUuE.js +0 -14
- package/dist/web/assets/WorkspaceEnvironmentMenu-7wmC-spz.js +0 -32
- package/dist/web/assets/WorkspaceGitDialogs-Hn--lsRh.js +0 -1
- package/dist/web/assets/activity-Dp5V58om.js +0 -1
- package/dist/web/assets/boxes-DE7WJaEv.js +0 -1
- package/dist/web/assets/chevron-up-BWx8gGab.js +0 -1
- package/dist/web/assets/circle-x-DnmOfZIg.js +0 -1
- package/dist/web/assets/copy-BjWvaXLC.js +0 -1
- package/dist/web/assets/create-pipeline-request-C4V6-lWN.js +0 -4
- package/dist/web/assets/credit-card-Bjg0Zaw5.js +0 -1
- package/dist/web/assets/file-BrC1KjAS.js +0 -1
- package/dist/web/assets/git-branch-DTeeARsp.js +0 -1
- package/dist/web/assets/index-BcZetaeD.css +0 -1
- package/dist/web/assets/index-DQalqxbw.js +0 -177
- package/dist/web/assets/index-DYxF_d9i.js +0 -1
- package/dist/web/assets/info-BXBpMeVU.js +0 -1
- package/dist/web/assets/make-agent-tutorial-CAnTPFCK.js +0 -2
- package/dist/web/assets/monaco.contribution-C0BsxYAz.js +0 -2
- package/dist/web/assets/monaco.contribution-CzpXjm9j.js +0 -2
- package/dist/web/assets/monaco.contribution-DK-g-i00.js +0 -2
- package/dist/web/assets/monaco.contribution-iAurj7TQ.js +0 -2
- package/dist/web/assets/monitor-Ba2FFblh.js +0 -1
- package/dist/web/assets/reply-BSExNLHM.js +0 -1
- package/dist/web/assets/rotate-cw-DJ-zYG9E.js +0 -1
- package/dist/web/assets/training-BN8CALIc.css +0 -1
- package/dist/web/assets/training-model-data-BXUCzS0p.js +0 -1
- package/dist/web/tokens/eth.svg +0 -1
- package/dist/web/tokens/usdc.svg +0 -1
- package/docs/agent-edit-check-status-json.md +0 -132
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
|
-
DEFAULT_OPENPOND_API_BASE_URL,
|
|
4
3
|
DEFAULT_OPENPOND_CHAT_MODEL,
|
|
5
|
-
DEFAULT_OPENPOND_WEB_BASE_URL,
|
|
6
4
|
ProviderCatalogSchema,
|
|
7
5
|
SandboxAppActionRegistrySchema,
|
|
8
|
-
checkOpenPondApiHealth,
|
|
9
6
|
createRepo,
|
|
10
7
|
getAppEnvironment,
|
|
11
8
|
getOpenPondAccount,
|
|
12
|
-
getOpenPondAccountBalance,
|
|
13
9
|
listApps,
|
|
14
10
|
listConfiguredProfiles,
|
|
15
11
|
loadGlobalConfig,
|
|
16
12
|
saveConfig,
|
|
17
13
|
saveProfileApiKey,
|
|
18
14
|
setActiveProfile
|
|
19
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-2SF6HLT7.js";
|
|
16
|
+
import {
|
|
17
|
+
DEFAULT_OPENPOND_API_BASE_URL,
|
|
18
|
+
DEFAULT_OPENPOND_WEB_BASE_URL,
|
|
19
|
+
withVercelProtectionBypass
|
|
20
|
+
} from "./chunk-KHNHUA2H.js";
|
|
20
21
|
|
|
21
22
|
// ../../packages/runtime/dist/chat.js
|
|
22
23
|
import { randomUUID } from "node:crypto";
|
|
@@ -79,6 +80,9 @@ function normalizeOpChatApiBaseUrl(value) {
|
|
|
79
80
|
return null;
|
|
80
81
|
try {
|
|
81
82
|
const url = new URL(normalized);
|
|
83
|
+
if (url.hostname.toLowerCase() === "api-new.staging-api.openpond.ai") {
|
|
84
|
+
url.hostname = "staging-api.openpond.ai";
|
|
85
|
+
}
|
|
82
86
|
const segments = url.pathname.split("/").filter(Boolean);
|
|
83
87
|
const opChatIndex = segments.findIndex((segment) => segment.toLowerCase() === "opchat");
|
|
84
88
|
if (opChatIndex >= 0) {
|
|
@@ -253,9 +257,7 @@ function normalizeProfile(response) {
|
|
|
253
257
|
isVerified: account.isVerified ?? null,
|
|
254
258
|
dailyAgentAppId: account.dailyAgentAppId ?? null,
|
|
255
259
|
dailyAgentDeploymentId: account.dailyAgentDeploymentId ?? null,
|
|
256
|
-
credits: account.credits ?? null
|
|
257
|
-
turnkeyWalletAddress: account.turnkeyWalletAddress ?? null,
|
|
258
|
-
turnkeyOperatingWalletAddress: account.turnkeyOperatingWalletAddress ?? null
|
|
260
|
+
credits: account.credits ?? null
|
|
259
261
|
};
|
|
260
262
|
}
|
|
261
263
|
function normalizeProducts(products) {
|
|
@@ -271,35 +273,13 @@ function normalizeProducts(products) {
|
|
|
271
273
|
credits: product.credits ?? null
|
|
272
274
|
}));
|
|
273
275
|
}
|
|
274
|
-
function normalizeBalance(response, error) {
|
|
275
|
-
if (!response)
|
|
276
|
-
return null;
|
|
277
|
-
return {
|
|
278
|
-
balanceKind: response.balanceKind,
|
|
279
|
-
balanceUsd: response.balanceUsd ?? null,
|
|
280
|
-
balanceUsdCents: response.balanceUsdCents ?? null,
|
|
281
|
-
currency: response.currency,
|
|
282
|
-
asOf: response.asOf,
|
|
283
|
-
stale: response.stale ?? Boolean(error),
|
|
284
|
-
error: error ?? null,
|
|
285
|
-
breakdown: (response.breakdown ?? []).map((item) => ({
|
|
286
|
-
wallet: item.wallet,
|
|
287
|
-
chain: item.chain,
|
|
288
|
-
chainId: item.chainId ?? null,
|
|
289
|
-
asset: item.asset,
|
|
290
|
-
amount: item.amount ?? null,
|
|
291
|
-
usdValue: item.usdValue ?? null
|
|
292
|
-
}))
|
|
293
|
-
};
|
|
294
|
-
}
|
|
295
276
|
function isEmptyDefaultProfile(profile) {
|
|
296
277
|
return profile.handle.trim().toLowerCase() === "default" && !normalizeBaseUrl(profile.baseUrl) && !profile.hasApiKey && !profile.hasSessionToken;
|
|
297
278
|
}
|
|
298
279
|
function toAccountState(input) {
|
|
299
|
-
const { config, profiles, account, token, apiBaseUrl, accountResponse,
|
|
280
|
+
const { config, profiles, account, token, apiBaseUrl, accountResponse, accountProfiles, health, authFailed, error } = input;
|
|
300
281
|
const chatApiBaseUrl = resolveHostedChatApiBaseUrl(account, config, apiBaseUrl);
|
|
301
282
|
const profile = normalizeProfile(accountResponse ?? null);
|
|
302
|
-
const balance = normalizeBalance(balanceResponse, balanceError);
|
|
303
283
|
const configActiveProfile = normalizeActiveProfile(config.activeProfile);
|
|
304
284
|
const accountSelector = account ? selectorFromAccount(account) : null;
|
|
305
285
|
const activeSelector = accountSelector ?? configActiveProfile;
|
|
@@ -335,8 +315,6 @@ function toAccountState(input) {
|
|
|
335
315
|
baseUrl,
|
|
336
316
|
apiBaseUrl,
|
|
337
317
|
chatApiBaseUrl,
|
|
338
|
-
balanceLabel: balanceResponse?.balanceLabel ?? "$0.00",
|
|
339
|
-
balance,
|
|
340
318
|
creditsLabel: profile?.credits ?? null,
|
|
341
319
|
profile,
|
|
342
320
|
products: normalizeProducts(accountResponse?.products),
|
|
@@ -433,7 +411,7 @@ function errorMessage(error) {
|
|
|
433
411
|
}
|
|
434
412
|
|
|
435
413
|
// ../../packages/runtime/dist/chat.js
|
|
436
|
-
var PROVIDER_CATALOG_FETCH_TIMEOUT_MS =
|
|
414
|
+
var PROVIDER_CATALOG_FETCH_TIMEOUT_MS = 15e3;
|
|
437
415
|
async function loadOpenPondProviderCatalog() {
|
|
438
416
|
const context = await loadOpenPondAccountContext();
|
|
439
417
|
if (!context.token) {
|
|
@@ -478,13 +456,16 @@ async function* streamOpenPondHostedChatTurn(input) {
|
|
|
478
456
|
tools: input.tools,
|
|
479
457
|
toolChoice: input.toolChoice,
|
|
480
458
|
requestId: input.requestId,
|
|
459
|
+
reasoningEffort: input.reasoningEffort,
|
|
460
|
+
maxTokens: input.maxTokens,
|
|
481
461
|
signal: input.signal
|
|
482
462
|
});
|
|
483
463
|
}
|
|
484
464
|
async function listOpChatProviderCatalog(options) {
|
|
485
|
-
const
|
|
465
|
+
const requestUrl = opChatEndpointUrl(options.apiBaseUrl, "provider-catalog");
|
|
466
|
+
const response = await fetch(requestUrl, {
|
|
486
467
|
method: "GET",
|
|
487
|
-
headers: opChatHeaders(options.token, "application/json"),
|
|
468
|
+
headers: opChatHeaders(requestUrl, options.token, "application/json"),
|
|
488
469
|
signal: options.signal
|
|
489
470
|
});
|
|
490
471
|
if (!response.ok) {
|
|
@@ -493,56 +474,61 @@ async function listOpChatProviderCatalog(options) {
|
|
|
493
474
|
return ProviderCatalogSchema.parse(await response.json());
|
|
494
475
|
}
|
|
495
476
|
async function* streamOpChatChatCompletion(options) {
|
|
496
|
-
const
|
|
477
|
+
const requestUrl = opChatEndpointUrl(options.apiBaseUrl, "chat/completions");
|
|
478
|
+
const response = await fetch(requestUrl, {
|
|
497
479
|
method: "POST",
|
|
498
|
-
headers: opChatHeaders(options.token, "
|
|
499
|
-
|
|
480
|
+
headers: opChatHeaders(requestUrl, options.token, "application/json", options.requestId),
|
|
481
|
+
// Hosted turns are published only after the provider finishes. Requesting
|
|
482
|
+
// the complete response also preserves whitespace that some upstream
|
|
483
|
+
// token streams omit at chunk boundaries.
|
|
484
|
+
body: JSON.stringify(buildOpChatBody(options, false)),
|
|
500
485
|
signal: options.signal
|
|
501
486
|
});
|
|
502
|
-
if (!response.ok
|
|
503
|
-
throw new Error(`OpenPond OpChat
|
|
487
|
+
if (!response.ok) {
|
|
488
|
+
throw new Error(`OpenPond OpChat request failed: ${response.status} ${await readOpChatError(response)}`);
|
|
504
489
|
}
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
pendingFinish = delta;
|
|
524
|
-
else
|
|
525
|
-
yield delta;
|
|
526
|
-
}
|
|
490
|
+
const raw = await response.json();
|
|
491
|
+
if (raw && typeof raw === "object" && "error" in raw) {
|
|
492
|
+
throw new Error(`OpenPond OpChat request failed: ${errorMessageFromPayload(raw)}`);
|
|
493
|
+
}
|
|
494
|
+
const record = raw && typeof raw === "object" ? raw : {};
|
|
495
|
+
const choices = Array.isArray(record.choices) ? record.choices : [];
|
|
496
|
+
const choice = choices[0] && typeof choices[0] === "object" ? choices[0] : {};
|
|
497
|
+
const message = choice.message && typeof choice.message === "object" ? choice.message : {};
|
|
498
|
+
const reasoningText = streamTextValue(message.reasoning_content);
|
|
499
|
+
const content = streamTextValue(message.content);
|
|
500
|
+
const toolCalls = parseToolCalls(message.tool_calls);
|
|
501
|
+
const usage = parseUsage(raw);
|
|
502
|
+
if (reasoningText)
|
|
503
|
+
yield { type: "reasoning_delta", text: reasoningText, raw };
|
|
504
|
+
if (content)
|
|
505
|
+
yield { type: "text_delta", text: content, raw };
|
|
506
|
+
if (toolCalls.length > 0) {
|
|
507
|
+
yield { type: "tool_call_delta", toolCalls, raw };
|
|
527
508
|
}
|
|
528
|
-
if (
|
|
509
|
+
if (toolCalls.length > 0 && reasoningText) {
|
|
529
510
|
yield {
|
|
530
511
|
type: "continuation",
|
|
531
512
|
continuation: {
|
|
532
513
|
kind: "chat_completions_reasoning",
|
|
533
514
|
reasoningContent: reasoningText
|
|
534
515
|
},
|
|
535
|
-
raw
|
|
516
|
+
raw
|
|
536
517
|
};
|
|
537
518
|
}
|
|
538
|
-
if (
|
|
539
|
-
yield
|
|
519
|
+
if (usage)
|
|
520
|
+
yield { type: "usage", usage, raw };
|
|
521
|
+
yield {
|
|
522
|
+
type: "finish",
|
|
523
|
+
finishReason: stringValue(choice.finish_reason),
|
|
524
|
+
raw
|
|
525
|
+
};
|
|
540
526
|
}
|
|
541
|
-
function buildOpChatBody(options) {
|
|
527
|
+
function buildOpChatBody(options, stream) {
|
|
542
528
|
const body = {
|
|
543
529
|
model: options.model,
|
|
544
530
|
messages: options.messages.map(opChatMessage),
|
|
545
|
-
stream
|
|
531
|
+
stream
|
|
546
532
|
};
|
|
547
533
|
if (options.tools) {
|
|
548
534
|
body.tools = options.tools;
|
|
@@ -550,8 +536,23 @@ function buildOpChatBody(options) {
|
|
|
550
536
|
if (options.toolChoice !== void 0) {
|
|
551
537
|
body.tool_choice = options.toolChoice;
|
|
552
538
|
}
|
|
539
|
+
if (typeof options.maxTokens === "number") {
|
|
540
|
+
body.max_tokens = options.maxTokens;
|
|
541
|
+
}
|
|
542
|
+
Object.assign(body, opChatReasoningFields(options.reasoningEffort));
|
|
553
543
|
return body;
|
|
554
544
|
}
|
|
545
|
+
function opChatReasoningFields(effort) {
|
|
546
|
+
if (!effort)
|
|
547
|
+
return {};
|
|
548
|
+
if (effort === "low") {
|
|
549
|
+
return { thinking: { type: "disabled" } };
|
|
550
|
+
}
|
|
551
|
+
return {
|
|
552
|
+
thinking: { type: "enabled" },
|
|
553
|
+
reasoning_effort: effort === "xhigh" ? "max" : "high"
|
|
554
|
+
};
|
|
555
|
+
}
|
|
555
556
|
function opChatMessage(message) {
|
|
556
557
|
const { continuation, ...projected } = message;
|
|
557
558
|
if (message.role === "assistant" && continuation?.kind === "chat_completions_reasoning") {
|
|
@@ -568,7 +569,7 @@ function opChatEndpointUrl(apiBaseUrl, path) {
|
|
|
568
569
|
throw new Error("OpenPond OpChat API base URL is required.");
|
|
569
570
|
return `${normalized}/${path}`;
|
|
570
571
|
}
|
|
571
|
-
function opChatHeaders(token, accept, requestId) {
|
|
572
|
+
function opChatHeaders(requestUrl, token, accept, requestId) {
|
|
572
573
|
const trimmed = token.trim();
|
|
573
574
|
if (!trimmed)
|
|
574
575
|
throw new Error("OpenPond API key is required for OpChat.");
|
|
@@ -578,7 +579,7 @@ function opChatHeaders(token, accept, requestId) {
|
|
|
578
579
|
headers.set("Accept", accept);
|
|
579
580
|
headers.set("x-openpond-client", "openpond-app");
|
|
580
581
|
headers.set("x-openpond-request-id", requestId || randomUUID());
|
|
581
|
-
return headers;
|
|
582
|
+
return withVercelProtectionBypass(requestUrl, headers);
|
|
582
583
|
}
|
|
583
584
|
async function readOpChatError(response) {
|
|
584
585
|
const text = await response.text().catch(() => "");
|
|
@@ -605,72 +606,6 @@ function errorMessageFromPayload(payload) {
|
|
|
605
606
|
}
|
|
606
607
|
return [stringValue(record.error), stringValue(record.message)].filter(Boolean).join(": ") || JSON.stringify(payload);
|
|
607
608
|
}
|
|
608
|
-
async function* parseOpChatSse(stream, signal) {
|
|
609
|
-
const reader = stream.getReader();
|
|
610
|
-
const decoder = new TextDecoder();
|
|
611
|
-
let buffer = "";
|
|
612
|
-
const abortError = () => signal?.reason instanceof Error ? signal.reason : new Error("openpond_opchat_aborted");
|
|
613
|
-
try {
|
|
614
|
-
while (true) {
|
|
615
|
-
if (signal?.aborted)
|
|
616
|
-
throw abortError();
|
|
617
|
-
const result = await reader.read();
|
|
618
|
-
if (result.done)
|
|
619
|
-
break;
|
|
620
|
-
buffer += decoder.decode(result.value, { stream: true });
|
|
621
|
-
const blocks = buffer.split(/\r?\n\r?\n/);
|
|
622
|
-
buffer = blocks.pop() ?? "";
|
|
623
|
-
for (const block of blocks) {
|
|
624
|
-
for (const payload of parseSseBlock(block))
|
|
625
|
-
yield payload;
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
} finally {
|
|
629
|
-
reader.releaseLock();
|
|
630
|
-
}
|
|
631
|
-
buffer += decoder.decode();
|
|
632
|
-
if (buffer.trim()) {
|
|
633
|
-
for (const payload of parseSseBlock(buffer))
|
|
634
|
-
yield payload;
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
function parseSseBlock(block) {
|
|
638
|
-
const data = block.split(/\r?\n/).filter((line) => line.startsWith("data:")).map((line) => line.slice(5).trim()).join("\n").trim();
|
|
639
|
-
if (!data || data === "[DONE]")
|
|
640
|
-
return [];
|
|
641
|
-
return [JSON.parse(data)];
|
|
642
|
-
}
|
|
643
|
-
function streamDeltasFromChunk(raw) {
|
|
644
|
-
if (!raw || typeof raw !== "object")
|
|
645
|
-
return [];
|
|
646
|
-
const record = raw;
|
|
647
|
-
const choices = Array.isArray(record.choices) ? record.choices : [];
|
|
648
|
-
const deltas = [];
|
|
649
|
-
for (const choice of choices) {
|
|
650
|
-
if (!choice || typeof choice !== "object")
|
|
651
|
-
continue;
|
|
652
|
-
const choiceRecord = choice;
|
|
653
|
-
const delta = choiceRecord.delta && typeof choiceRecord.delta === "object" ? choiceRecord.delta : {};
|
|
654
|
-
for (const key of ["content", "reasoning_content"]) {
|
|
655
|
-
const value = stringValue(delta[key]);
|
|
656
|
-
if (!value)
|
|
657
|
-
continue;
|
|
658
|
-
deltas.push({
|
|
659
|
-
type: key === "content" ? "text_delta" : "reasoning_delta",
|
|
660
|
-
text: value,
|
|
661
|
-
raw
|
|
662
|
-
});
|
|
663
|
-
}
|
|
664
|
-
const toolCalls = parseToolCalls(delta.tool_calls);
|
|
665
|
-
if (toolCalls.length > 0) {
|
|
666
|
-
deltas.push({ type: "tool_call_delta", toolCalls, raw });
|
|
667
|
-
}
|
|
668
|
-
const finishReason = stringValue(choiceRecord.finish_reason);
|
|
669
|
-
if (finishReason)
|
|
670
|
-
deltas.push({ type: "finish", finishReason, raw });
|
|
671
|
-
}
|
|
672
|
-
return deltas;
|
|
673
|
-
}
|
|
674
609
|
function parseToolCalls(value) {
|
|
675
610
|
return Array.isArray(value) ? value.filter((item) => Boolean(item) && typeof item === "object") : [];
|
|
676
611
|
}
|
|
@@ -685,6 +620,9 @@ function parseUsage(raw) {
|
|
|
685
620
|
function stringValue(value) {
|
|
686
621
|
return typeof value === "string" && value.trim() ? value : null;
|
|
687
622
|
}
|
|
623
|
+
function streamTextValue(value) {
|
|
624
|
+
return typeof value === "string" && value.length > 0 ? value : null;
|
|
625
|
+
}
|
|
688
626
|
|
|
689
627
|
// ../../packages/runtime/dist/version.js
|
|
690
628
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
@@ -864,75 +802,76 @@ async function loadAccountProfileLookups(context) {
|
|
|
864
802
|
const key = profileKey(account.handle, account.baseUrl);
|
|
865
803
|
const token = accountToken(account);
|
|
866
804
|
if (!token) {
|
|
867
|
-
return [
|
|
805
|
+
return [
|
|
806
|
+
key,
|
|
807
|
+
{ response: null, authFailed: false, error: null }
|
|
808
|
+
];
|
|
868
809
|
}
|
|
869
810
|
try {
|
|
870
811
|
return [
|
|
871
812
|
key,
|
|
872
813
|
{
|
|
873
814
|
response: await getOpenPondAccount(resolvePublicApiBaseUrl(account, context.config), token),
|
|
874
|
-
authFailed: false
|
|
815
|
+
authFailed: false,
|
|
816
|
+
error: null
|
|
817
|
+
}
|
|
818
|
+
];
|
|
819
|
+
} catch (error) {
|
|
820
|
+
return [
|
|
821
|
+
key,
|
|
822
|
+
{
|
|
823
|
+
response: null,
|
|
824
|
+
authFailed: true,
|
|
825
|
+
error: errorMessage(error)
|
|
875
826
|
}
|
|
876
827
|
];
|
|
877
|
-
} catch {
|
|
878
|
-
return [key, { response: null, authFailed: true }];
|
|
879
828
|
}
|
|
880
829
|
}));
|
|
881
830
|
return Object.fromEntries(entries);
|
|
882
831
|
}
|
|
832
|
+
async function loadOpenPondAccountStateForContext(context) {
|
|
833
|
+
const accountProfiles = await loadAccountProfileLookups(context);
|
|
834
|
+
const activeLookup = context.account ? accountProfiles[profileKey(context.account.handle, context.account.baseUrl)] ?? null : null;
|
|
835
|
+
const accountResponse = activeLookup?.response ?? null;
|
|
836
|
+
const authError = context.token && activeLookup?.authFailed ? activeLookup.error || "OpenPond account authentication failed." : null;
|
|
837
|
+
return {
|
|
838
|
+
account: toAccountState({
|
|
839
|
+
...context,
|
|
840
|
+
accountResponse,
|
|
841
|
+
accountProfiles,
|
|
842
|
+
authFailed: Boolean(authError),
|
|
843
|
+
error: authError
|
|
844
|
+
})
|
|
845
|
+
};
|
|
846
|
+
}
|
|
847
|
+
async function loadOpenPondAccountState() {
|
|
848
|
+
return loadOpenPondAccountStateForContext(await loadOpenPondAccountContext());
|
|
849
|
+
}
|
|
883
850
|
async function loadOpenPondApps(options = {}) {
|
|
884
851
|
const context = await loadOpenPondAccountContext();
|
|
852
|
+
const accountPromise = loadOpenPondAccountStateForContext(context);
|
|
885
853
|
if (!context.token) {
|
|
886
|
-
const accountProfiles2 = await loadAccountProfileLookups(context);
|
|
887
854
|
return {
|
|
888
|
-
|
|
855
|
+
...await accountPromise,
|
|
889
856
|
apps: [],
|
|
890
857
|
error: "No OpenPond API key or session token is configured."
|
|
891
858
|
};
|
|
892
859
|
}
|
|
893
|
-
const [
|
|
894
|
-
|
|
895
|
-
getOpenPondAccount(context.apiBaseUrl, context.token),
|
|
896
|
-
getOpenPondAccountBalance(context.apiBaseUrl, context.token),
|
|
860
|
+
const [accountResult, appsResult] = await Promise.allSettled([
|
|
861
|
+
accountPromise,
|
|
897
862
|
listApps(context.apiBaseUrl, context.token, {
|
|
898
863
|
handle: context.account?.handle,
|
|
899
864
|
limit: options.limit ?? 20,
|
|
900
865
|
offset: options.offset ?? 0,
|
|
901
866
|
includeScheduled: options.includeScheduled ?? true
|
|
902
|
-
})
|
|
903
|
-
loadAccountProfileLookups(context)
|
|
867
|
+
})
|
|
904
868
|
]);
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
const balanceResponse = balanceResult.status === "fulfilled" ? balanceResult.value : null;
|
|
908
|
-
const accountProfiles = accountProfilesResult.status === "fulfilled" ? accountProfilesResult.value : {};
|
|
909
|
-
if (accountResult.status === "fulfilled" && context.account) {
|
|
910
|
-
accountProfiles[profileKey(context.account.handle, context.account.baseUrl)] = {
|
|
911
|
-
response: accountResult.value,
|
|
912
|
-
authFailed: false
|
|
913
|
-
};
|
|
914
|
-
}
|
|
915
|
-
const appsSucceeded = appsResult.status === "fulfilled";
|
|
916
|
-
const accountSucceeded = accountResult.status === "fulfilled";
|
|
917
|
-
const anyAuthenticatedCallSucceeded = appsSucceeded || accountSucceeded || health?.authenticated === true;
|
|
918
|
-
const allAuthenticatedCallsFailed = !appsSucceeded && !accountSucceeded && health?.authenticated !== true;
|
|
919
|
-
const authError = health?.authenticated === false && !anyAuthenticatedCallSucceeded ? health.error || "OpenPond account authentication failed." : allAuthenticatedCallsFailed ? appsResult.status === "rejected" ? errorMessage(appsResult.reason) : accountResult.status === "rejected" ? errorMessage(accountResult.reason) : null : null;
|
|
920
|
-
const profileError = accountResult.status === "rejected" && anyAuthenticatedCallSucceeded ? `Profile unavailable: ${errorMessage(accountResult.reason)}` : null;
|
|
921
|
-
const appsError = appsResult.status === "rejected" ? errorMessage(appsResult.reason) : null;
|
|
922
|
-
const effectiveHealth = health && anyAuthenticatedCallSucceeded ? { ...health, authenticated: true, error: void 0 } : health;
|
|
869
|
+
if (accountResult.status === "rejected")
|
|
870
|
+
throw accountResult.reason;
|
|
923
871
|
return {
|
|
924
|
-
account:
|
|
925
|
-
...context,
|
|
926
|
-
accountResponse,
|
|
927
|
-
balanceResponse,
|
|
928
|
-
accountProfiles,
|
|
929
|
-
health: effectiveHealth,
|
|
930
|
-
authFailed: Boolean(authError),
|
|
931
|
-
error: authError ?? profileError,
|
|
932
|
-
balanceError: balanceResult.status === "rejected" ? errorMessage(balanceResult.reason) : null
|
|
933
|
-
}),
|
|
872
|
+
account: accountResult.value.account,
|
|
934
873
|
apps: appsResult.status === "fulfilled" ? appsResult.value.map(normalizeApp).filter((value) => Boolean(value)) : [],
|
|
935
|
-
error:
|
|
874
|
+
error: appsResult.status === "rejected" ? errorMessage(appsResult.reason) : null
|
|
936
875
|
};
|
|
937
876
|
}
|
|
938
877
|
async function createOpenPondRepoApp(input) {
|
|
@@ -970,20 +909,6 @@ async function deriveHandleForApiKey(input, apiBaseUrl) {
|
|
|
970
909
|
return fromProfile;
|
|
971
910
|
} catch {
|
|
972
911
|
}
|
|
973
|
-
try {
|
|
974
|
-
const apps = await listApps(apiBaseUrl, input.apiKey);
|
|
975
|
-
const counts = /* @__PURE__ */ new Map();
|
|
976
|
-
for (const app of apps) {
|
|
977
|
-
const handle2 = normalizeDerivedHandle(app.handle);
|
|
978
|
-
if (!handle2)
|
|
979
|
-
continue;
|
|
980
|
-
counts.set(handle2, (counts.get(handle2) ?? 0) + 1);
|
|
981
|
-
}
|
|
982
|
-
const [handle] = Array.from(counts.entries()).sort((left, right) => right[1] - left[1])[0] ?? [];
|
|
983
|
-
if (handle)
|
|
984
|
-
return handle;
|
|
985
|
-
} catch {
|
|
986
|
-
}
|
|
987
912
|
return fallbackHandleForApiKey(input.apiKey);
|
|
988
913
|
}
|
|
989
914
|
async function saveOpenPondAccount(input) {
|
|
@@ -1003,8 +928,41 @@ async function saveOpenPondAccount(input) {
|
|
|
1003
928
|
return loadOpenPondAccountContext(handle, baseUrl);
|
|
1004
929
|
}
|
|
1005
930
|
|
|
931
|
+
// ../../packages/runtime/dist/remove-account.js
|
|
932
|
+
function findAccountIndex(accounts, handle, baseUrl) {
|
|
933
|
+
const normalizedBaseUrl = normalizeBaseUrl(baseUrl);
|
|
934
|
+
const exactIndex = accounts.findIndex((account) => handleEquals(account.handle, handle) && baseUrlEquals(account.baseUrl, normalizedBaseUrl));
|
|
935
|
+
if (exactIndex !== -1)
|
|
936
|
+
return exactIndex;
|
|
937
|
+
const matchingIndexes = accounts.map((account, index) => ({ account, index })).filter(({ account }) => handleEquals(account.handle, handle));
|
|
938
|
+
if (matchingIndexes.length === 1)
|
|
939
|
+
return matchingIndexes[0].index;
|
|
940
|
+
if (matchingIndexes.length > 1) {
|
|
941
|
+
throw new Error(`Multiple OpenPond accounts match ${handle}; select one with its base URL.`);
|
|
942
|
+
}
|
|
943
|
+
return -1;
|
|
944
|
+
}
|
|
945
|
+
async function removeOpenPondAccount(input) {
|
|
946
|
+
const handle = input.handle.trim();
|
|
947
|
+
if (!handle)
|
|
948
|
+
throw new Error("OpenPond account handle is required.");
|
|
949
|
+
const config = await loadGlobalConfig();
|
|
950
|
+
const accounts = (config.accounts ?? []).map((account2) => ({ ...account2 }));
|
|
951
|
+
const index = findAccountIndex(accounts, handle, input.baseUrl);
|
|
952
|
+
if (index === -1)
|
|
953
|
+
throw new Error(`OpenPond account not found: ${handle}`);
|
|
954
|
+
const account = accounts[index];
|
|
955
|
+
const activeProfile = normalizeActiveProfile(config.activeProfile);
|
|
956
|
+
if (activeProfile && accountMatchesSelector(account, activeProfile)) {
|
|
957
|
+
throw new Error("Switch to another OpenPond account before removing the active account.");
|
|
958
|
+
}
|
|
959
|
+
accounts.splice(index, 1);
|
|
960
|
+
await saveConfig({ ...config, accounts });
|
|
961
|
+
return loadOpenPondAccountContext();
|
|
962
|
+
}
|
|
963
|
+
|
|
1006
964
|
// ../../packages/runtime/dist/update-account-config.js
|
|
1007
|
-
function
|
|
965
|
+
function findAccountIndex2(accounts, handle, currentBaseUrl) {
|
|
1008
966
|
const normalizedCurrentBaseUrl = normalizeBaseUrl(currentBaseUrl);
|
|
1009
967
|
const exactIndex = accounts.findIndex((account) => handleEquals(account.handle, handle) && baseUrlEquals(account.baseUrl, normalizedCurrentBaseUrl));
|
|
1010
968
|
if (exactIndex !== -1)
|
|
@@ -1034,7 +992,7 @@ async function updateOpenPondAccountConfig(input) {
|
|
|
1034
992
|
throw new Error("OpenPond account handle is required.");
|
|
1035
993
|
const config = await loadGlobalConfig();
|
|
1036
994
|
const accounts = (config.accounts ?? []).map((account) => ({ ...account }));
|
|
1037
|
-
const index =
|
|
995
|
+
const index = findAccountIndex2(accounts, handle, input.currentBaseUrl);
|
|
1038
996
|
if (index === -1)
|
|
1039
997
|
throw new Error(`OpenPond account not found: ${handle}`);
|
|
1040
998
|
const previousAccount = accounts[index];
|
|
@@ -1113,11 +1071,13 @@ function nextLineEnd(value) {
|
|
|
1113
1071
|
export {
|
|
1114
1072
|
loadOpenPondAccountContext,
|
|
1115
1073
|
switchOpenPondAccount,
|
|
1074
|
+
loadOpenPondAccountState,
|
|
1116
1075
|
loadOpenPondApps,
|
|
1117
1076
|
createOpenPondRepoApp,
|
|
1118
1077
|
loadOpenPondProviderCatalog,
|
|
1119
1078
|
streamOpenPondHostedChatTurn,
|
|
1120
1079
|
saveOpenPondAccount,
|
|
1080
|
+
removeOpenPondAccount,
|
|
1121
1081
|
updateOpenPondAccountConfig,
|
|
1122
1082
|
getOpenPondAppEnvironment,
|
|
1123
1083
|
getBundledRuntimeVersion,
|