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
package/dist/index.js
CHANGED
|
@@ -5,6 +5,24 @@ var __export = (target, all) => {
|
|
|
5
5
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
6
6
|
};
|
|
7
7
|
|
|
8
|
+
// ../../packages/cloud/src/api/vercel-protection.ts
|
|
9
|
+
var VERCEL_PROTECTION_BYPASS_HEADER = "x-vercel-protection-bypass";
|
|
10
|
+
function withVercelProtectionBypass(requestUrl, inputHeaders, env = typeof process === "undefined" ? {} : process.env) {
|
|
11
|
+
const headers = new Headers(inputHeaders);
|
|
12
|
+
const secret = env.VERCEL_AUTOMATION_BYPASS_SECRET?.trim();
|
|
13
|
+
if (!secret || !isOpenPondStagingUrl(requestUrl)) return headers;
|
|
14
|
+
headers.set(VERCEL_PROTECTION_BYPASS_HEADER, secret);
|
|
15
|
+
return headers;
|
|
16
|
+
}
|
|
17
|
+
function isOpenPondStagingUrl(requestUrl) {
|
|
18
|
+
try {
|
|
19
|
+
const hostname3 = new URL(requestUrl).hostname.toLowerCase();
|
|
20
|
+
return hostname3 === "staging.openpond.ai" || hostname3 === "staging-api.openpond.ai" || hostname3.endsWith(".staging-api.openpond.ai");
|
|
21
|
+
} catch {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
8
26
|
// ../../packages/cloud/src/api/core.ts
|
|
9
27
|
var DEFAULT_API_TIMEOUT_MS = 3e4;
|
|
10
28
|
var DEFAULT_API_RESPONSE_BYTES = 8 * 1024 * 1024;
|
|
@@ -31,9 +49,23 @@ var ApiResponseTooLargeError = class extends Error {
|
|
|
31
49
|
requestUrl;
|
|
32
50
|
code = "OPENPOND_API_RESPONSE_TOO_LARGE";
|
|
33
51
|
};
|
|
52
|
+
var OpenPondApiError = class extends Error {
|
|
53
|
+
constructor(status, errorCode, label, apiMessage = null) {
|
|
54
|
+
const detail = apiMessage || errorCode;
|
|
55
|
+
super(`${label} failed: ${status}${detail ? ` ${detail}` : ""}`);
|
|
56
|
+
this.status = status;
|
|
57
|
+
this.apiMessage = apiMessage;
|
|
58
|
+
this.name = "OpenPondApiError";
|
|
59
|
+
this.code = errorCode || "OPENPOND_API_ERROR";
|
|
60
|
+
}
|
|
61
|
+
status;
|
|
62
|
+
apiMessage;
|
|
63
|
+
code;
|
|
64
|
+
};
|
|
34
65
|
async function apiFetch(baseUrl, token, requestPath, options = {}) {
|
|
35
66
|
const { timeoutMs = DEFAULT_API_TIMEOUT_MS, maxResponseBytes = DEFAULT_API_RESPONSE_BYTES, ...init } = options;
|
|
36
|
-
const
|
|
67
|
+
const requestUrl = `${baseUrl}${requestPath}`;
|
|
68
|
+
const headers = withVercelProtectionBypass(requestUrl, init.headers);
|
|
37
69
|
headers.set("Content-Type", "application/json");
|
|
38
70
|
const apiKey = process.env.OPENPOND_API_KEY;
|
|
39
71
|
const trimmedToken = token?.trim() || "";
|
|
@@ -45,7 +77,6 @@ async function apiFetch(baseUrl, token, requestPath, options = {}) {
|
|
|
45
77
|
} else if (apiKey && !headers.has("Authorization")) {
|
|
46
78
|
headers.set("Authorization", `ApiKey ${apiKey}`);
|
|
47
79
|
}
|
|
48
|
-
const requestUrl = `${baseUrl}${requestPath}`;
|
|
49
80
|
const timeoutController = new AbortController();
|
|
50
81
|
const timeoutError = new ApiTimeoutError(timeoutMs, requestUrl);
|
|
51
82
|
const timer = timeoutMs > 0 ? setTimeout(() => timeoutController.abort(timeoutError), timeoutMs) : null;
|
|
@@ -79,8 +110,9 @@ async function readApiJson(response, label) {
|
|
|
79
110
|
payload = {};
|
|
80
111
|
}
|
|
81
112
|
if (!response.ok) {
|
|
82
|
-
const
|
|
83
|
-
|
|
113
|
+
const errorCode = typeof payload.error === "string" ? payload.error : null;
|
|
114
|
+
const apiMessage = typeof payload.message === "string" ? payload.message : null;
|
|
115
|
+
throw new OpenPondApiError(response.status, errorCode, label, apiMessage);
|
|
84
116
|
}
|
|
85
117
|
return payload;
|
|
86
118
|
}
|
|
@@ -706,7 +738,7 @@ async function getAppRuntimeSummary(baseUrl, token, appId) {
|
|
|
706
738
|
return await response.json();
|
|
707
739
|
}
|
|
708
740
|
async function getOpenPondAccount(baseUrl, token) {
|
|
709
|
-
const response = await apiFetch(baseUrl, token, "/account", {
|
|
741
|
+
const response = await apiFetch(baseUrl, token, "/v1/account", {
|
|
710
742
|
method: "GET"
|
|
711
743
|
});
|
|
712
744
|
if (!response.ok) {
|
|
@@ -715,24 +747,12 @@ async function getOpenPondAccount(baseUrl, token) {
|
|
|
715
747
|
}
|
|
716
748
|
return await response.json();
|
|
717
749
|
}
|
|
718
|
-
async function getOpenPondAccountBalance(baseUrl, token) {
|
|
719
|
-
const response = await apiFetch(baseUrl, token, "/account/balance", {
|
|
720
|
-
method: "GET"
|
|
721
|
-
});
|
|
722
|
-
if (!response.ok) {
|
|
723
|
-
const text5 = await response.text().catch(() => "");
|
|
724
|
-
throw new Error(
|
|
725
|
-
`Account balance lookup failed: ${response.status} ${text5}`
|
|
726
|
-
);
|
|
727
|
-
}
|
|
728
|
-
return await response.json();
|
|
729
|
-
}
|
|
730
750
|
async function checkOpenPondApiHealth(baseUrl, token) {
|
|
731
751
|
const checkedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
732
752
|
const started = Date.now();
|
|
733
753
|
const normalizedBase = baseUrl.replace(/\/$/, "");
|
|
734
754
|
try {
|
|
735
|
-
const response = await
|
|
755
|
+
const response = await apiFetch(normalizedBase, null, "/health", {
|
|
736
756
|
method: "GET",
|
|
737
757
|
headers: { Accept: "application/json" }
|
|
738
758
|
});
|
|
@@ -820,18 +840,6 @@ async function executeUserTool(baseUrl, token, body) {
|
|
|
820
840
|
data: payload
|
|
821
841
|
};
|
|
822
842
|
}
|
|
823
|
-
async function submitPositionsTx(baseUrl, token, params) {
|
|
824
|
-
const qs = params.query && Object.keys(params.query).length > 0 ? `?${new URLSearchParams(params.query).toString()}` : "";
|
|
825
|
-
const response = await apiFetch(baseUrl, token, `/apps/positions/tx${qs}`, {
|
|
826
|
-
method: params.method,
|
|
827
|
-
body: params.method === "POST" && params.body !== void 0 ? JSON.stringify(params.body) : void 0
|
|
828
|
-
});
|
|
829
|
-
if (!response.ok) {
|
|
830
|
-
const text5 = await response.text().catch(() => "");
|
|
831
|
-
throw new Error(`Positions request failed: ${response.status} ${text5}`);
|
|
832
|
-
}
|
|
833
|
-
return await response.json();
|
|
834
|
-
}
|
|
835
843
|
function normalizeToolPathSegment(toolName) {
|
|
836
844
|
const trimmed = toolName.trim().replace(/^\/+/, "");
|
|
837
845
|
return encodeURIComponent(trimmed || "tool");
|
|
@@ -1262,14 +1270,14 @@ function requireToken(value) {
|
|
|
1262
1270
|
if (!trimmed) throw new Error("OpenPond API key is required");
|
|
1263
1271
|
return trimmed;
|
|
1264
1272
|
}
|
|
1265
|
-
function hostedHeaders(token, accept, requestId) {
|
|
1273
|
+
function hostedHeaders(requestUrl, token, accept, requestId) {
|
|
1266
1274
|
const headers = new Headers();
|
|
1267
1275
|
headers.set("Authorization", `Bearer ${requireToken(token)}`);
|
|
1268
1276
|
headers.set("Content-Type", "application/json");
|
|
1269
1277
|
headers.set("Accept", accept);
|
|
1270
1278
|
headers.set("x-openpond-client", "openpond-code");
|
|
1271
1279
|
headers.set("x-openpond-request-id", requestId || randomUUID2());
|
|
1272
|
-
return headers;
|
|
1280
|
+
return withVercelProtectionBypass(requestUrl, headers);
|
|
1273
1281
|
}
|
|
1274
1282
|
async function readError(response) {
|
|
1275
1283
|
const text5 = await response.text().catch(() => "");
|
|
@@ -1311,9 +1319,10 @@ function buildHostedChatBody(options, stream) {
|
|
|
1311
1319
|
}
|
|
1312
1320
|
async function listOpChatModels(options) {
|
|
1313
1321
|
const apiBaseUrl = normalizeApiBaseUrl(options.apiBaseUrl);
|
|
1314
|
-
const
|
|
1322
|
+
const requestUrl = `${apiBaseUrl}/models`;
|
|
1323
|
+
const response = await fetch(requestUrl, {
|
|
1315
1324
|
method: "GET",
|
|
1316
|
-
headers: hostedHeaders(options.token, "application/json"),
|
|
1325
|
+
headers: hostedHeaders(requestUrl, options.token, "application/json"),
|
|
1317
1326
|
signal: options.signal
|
|
1318
1327
|
});
|
|
1319
1328
|
if (!response.ok) {
|
|
@@ -1327,11 +1336,12 @@ async function listOpChatModels(options) {
|
|
|
1327
1336
|
}
|
|
1328
1337
|
async function getOpChatModel(options) {
|
|
1329
1338
|
const apiBaseUrl = normalizeApiBaseUrl(options.apiBaseUrl);
|
|
1339
|
+
const requestUrl = `${apiBaseUrl}/models/${encodeURIComponent(options.model)}`;
|
|
1330
1340
|
const response = await fetch(
|
|
1331
|
-
|
|
1341
|
+
requestUrl,
|
|
1332
1342
|
{
|
|
1333
1343
|
method: "GET",
|
|
1334
|
-
headers: hostedHeaders(options.token, "application/json"),
|
|
1344
|
+
headers: hostedHeaders(requestUrl, options.token, "application/json"),
|
|
1335
1345
|
signal: options.signal
|
|
1336
1346
|
}
|
|
1337
1347
|
);
|
|
@@ -1347,9 +1357,10 @@ async function getOpChatModel(options) {
|
|
|
1347
1357
|
var listHostedModels = listOpChatModels;
|
|
1348
1358
|
async function listOpChatProviders(options) {
|
|
1349
1359
|
const apiBaseUrl = normalizeApiBaseUrl(options.apiBaseUrl);
|
|
1350
|
-
const
|
|
1360
|
+
const requestUrl = `${apiBaseUrl}/providers`;
|
|
1361
|
+
const response = await fetch(requestUrl, {
|
|
1351
1362
|
method: "GET",
|
|
1352
|
-
headers: hostedHeaders(options.token, "application/json"),
|
|
1363
|
+
headers: hostedHeaders(requestUrl, options.token, "application/json"),
|
|
1353
1364
|
signal: options.signal
|
|
1354
1365
|
});
|
|
1355
1366
|
if (!response.ok) {
|
|
@@ -1363,11 +1374,12 @@ async function listOpChatProviders(options) {
|
|
|
1363
1374
|
}
|
|
1364
1375
|
async function getOpChatProvider(options) {
|
|
1365
1376
|
const apiBaseUrl = normalizeApiBaseUrl(options.apiBaseUrl);
|
|
1377
|
+
const requestUrl = `${apiBaseUrl}/providers/${encodeURIComponent(options.provider)}`;
|
|
1366
1378
|
const response = await fetch(
|
|
1367
|
-
|
|
1379
|
+
requestUrl,
|
|
1368
1380
|
{
|
|
1369
1381
|
method: "GET",
|
|
1370
|
-
headers: hostedHeaders(options.token, "application/json"),
|
|
1382
|
+
headers: hostedHeaders(requestUrl, options.token, "application/json"),
|
|
1371
1383
|
signal: options.signal
|
|
1372
1384
|
}
|
|
1373
1385
|
);
|
|
@@ -1383,9 +1395,11 @@ async function getOpChatProvider(options) {
|
|
|
1383
1395
|
var listHostedProviders = listOpChatProviders;
|
|
1384
1396
|
async function sendHostedChatTurn(options) {
|
|
1385
1397
|
const apiBaseUrl = normalizeApiBaseUrl(options.apiBaseUrl);
|
|
1386
|
-
const
|
|
1398
|
+
const requestUrl = `${apiBaseUrl}/chat/completions`;
|
|
1399
|
+
const response = await fetch(requestUrl, {
|
|
1387
1400
|
method: "POST",
|
|
1388
1401
|
headers: hostedHeaders(
|
|
1402
|
+
requestUrl,
|
|
1389
1403
|
options.token,
|
|
1390
1404
|
"application/json",
|
|
1391
1405
|
options.requestId
|
|
@@ -1431,9 +1445,11 @@ async function* parseOpenAISSE(stream, signal) {
|
|
|
1431
1445
|
}
|
|
1432
1446
|
async function* streamHostedChatTurn(options) {
|
|
1433
1447
|
const apiBaseUrl = normalizeApiBaseUrl(options.apiBaseUrl);
|
|
1434
|
-
const
|
|
1448
|
+
const requestUrl = `${apiBaseUrl}/chat/completions`;
|
|
1449
|
+
const response = await fetch(requestUrl, {
|
|
1435
1450
|
method: "POST",
|
|
1436
1451
|
headers: hostedHeaders(
|
|
1452
|
+
requestUrl,
|
|
1437
1453
|
options.token,
|
|
1438
1454
|
"text/event-stream",
|
|
1439
1455
|
options.requestId
|
|
@@ -2057,6 +2073,24 @@ function sanitizeLocalOpenPondProfile(value) {
|
|
|
2057
2073
|
};
|
|
2058
2074
|
}
|
|
2059
2075
|
}
|
|
2076
|
+
if (Array.isArray(input.profiles)) {
|
|
2077
|
+
const profiles = input.profiles.flatMap((value2) => {
|
|
2078
|
+
const entry = sanitizeLocalOpenPondProfile(value2);
|
|
2079
|
+
if (!entry) return [];
|
|
2080
|
+
const rawEntry = value2;
|
|
2081
|
+
const source = rawEntry.source === "github" || rawEntry.source === "openpond_git" ? rawEntry.source : "local";
|
|
2082
|
+
const repositoryId = typeof rawEntry.repositoryId === "string" && rawEntry.repositoryId.trim() ? rawEntry.repositoryId.trim() : path3.resolve(entry.repoPath);
|
|
2083
|
+
return [{
|
|
2084
|
+
source,
|
|
2085
|
+
repositoryId,
|
|
2086
|
+
repoPath: entry.repoPath,
|
|
2087
|
+
profile: entry.profile,
|
|
2088
|
+
...entry.lastCheck ? { lastCheck: entry.lastCheck } : {},
|
|
2089
|
+
...entry.lastPush ? { lastPush: entry.lastPush } : {}
|
|
2090
|
+
}];
|
|
2091
|
+
});
|
|
2092
|
+
if (profiles.length > 0) out.profiles = profiles;
|
|
2093
|
+
}
|
|
2060
2094
|
return out;
|
|
2061
2095
|
}
|
|
2062
2096
|
function sanitizeHostedMaterializationStatus(value) {
|
|
@@ -2094,7 +2128,6 @@ function sanitizeHostedSourceCheckStatus(value) {
|
|
|
2094
2128
|
return {
|
|
2095
2129
|
status,
|
|
2096
2130
|
...nullableStringProp(input, "agentId"),
|
|
2097
|
-
...nullableStringProp(input, "workItemId"),
|
|
2098
2131
|
...nullableStringProp(input, "deployPlanStatus"),
|
|
2099
2132
|
...nullableBooleanProp(input, "canRun"),
|
|
2100
2133
|
...nullableBooleanProp(input, "canDeploy"),
|
|
@@ -2265,9 +2298,6 @@ function extractLegacyAccount(raw, handle) {
|
|
|
2265
2298
|
}
|
|
2266
2299
|
function normalizeGlobalConfig(raw) {
|
|
2267
2300
|
const normalized = {};
|
|
2268
|
-
if (raw.goalStorageLocation === "global" || raw.goalStorageLocation === "workspace") {
|
|
2269
|
-
normalized.goalStorageLocation = raw.goalStorageLocation;
|
|
2270
|
-
}
|
|
2271
2301
|
if (typeof raw.lspEnabled === "boolean")
|
|
2272
2302
|
normalized.lspEnabled = raw.lspEnabled;
|
|
2273
2303
|
if (raw.executionMode === "local" || raw.executionMode === "hosted") {
|
|
@@ -2434,13 +2464,6 @@ function applyAccountPatch(global, source, options) {
|
|
|
2434
2464
|
return true;
|
|
2435
2465
|
}
|
|
2436
2466
|
function applyTopLevelPatch(global, source) {
|
|
2437
|
-
if (hasOwn(source, "goalStorageLocation")) {
|
|
2438
|
-
if (source.goalStorageLocation === "global" || source.goalStorageLocation === "workspace") {
|
|
2439
|
-
global.goalStorageLocation = source.goalStorageLocation;
|
|
2440
|
-
} else if (source.goalStorageLocation === null) {
|
|
2441
|
-
delete global.goalStorageLocation;
|
|
2442
|
-
}
|
|
2443
|
-
}
|
|
2444
2467
|
if (hasOwn(source, "lspEnabled")) {
|
|
2445
2468
|
if (typeof source.lspEnabled === "boolean") {
|
|
2446
2469
|
global.lspEnabled = source.lspEnabled;
|
|
@@ -2824,7 +2847,6 @@ function createClient(options) {
|
|
|
2824
2847
|
apiKey,
|
|
2825
2848
|
account: {
|
|
2826
2849
|
get: async () => getOpenPondAccount(apiUrl, apiKey),
|
|
2827
|
-
balance: async () => getOpenPondAccountBalance(apiUrl, apiKey),
|
|
2828
2850
|
health: async () => checkOpenPondApiHealth(apiUrl, apiKey)
|
|
2829
2851
|
},
|
|
2830
2852
|
chat: {
|
|
@@ -3092,25 +3114,6 @@ function createClient(options) {
|
|
|
3092
3114
|
return updateAppEnvironment(apiUrl, apiKey, input.appId, {
|
|
3093
3115
|
envVars: input.envVars
|
|
3094
3116
|
});
|
|
3095
|
-
},
|
|
3096
|
-
positionsTx: async (input) => {
|
|
3097
|
-
const method = input?.method ?? "POST";
|
|
3098
|
-
if (method !== "GET" && method !== "POST") {
|
|
3099
|
-
throw new Error("method must be GET or POST");
|
|
3100
|
-
}
|
|
3101
|
-
let query = input?.query;
|
|
3102
|
-
if (!query && input?.params) {
|
|
3103
|
-
query = {};
|
|
3104
|
-
for (const [key, value] of Object.entries(input.params)) {
|
|
3105
|
-
if (value === void 0) continue;
|
|
3106
|
-
query[key] = typeof value === "string" ? value : JSON.stringify(value);
|
|
3107
|
-
}
|
|
3108
|
-
}
|
|
3109
|
-
return submitPositionsTx(apiUrl, apiKey, {
|
|
3110
|
-
method,
|
|
3111
|
-
body: method === "POST" ? input?.body : void 0,
|
|
3112
|
-
query
|
|
3113
|
-
});
|
|
3114
3117
|
}
|
|
3115
3118
|
},
|
|
3116
3119
|
repo: {
|
|
@@ -3134,10 +3137,13 @@ function createClient(options) {
|
|
|
3134
3137
|
|
|
3135
3138
|
// ../../packages/cloud/src/sandbox/types/runtime-profiles.ts
|
|
3136
3139
|
var SANDBOX_RUNTIME_PROFILE_IDS = [
|
|
3137
|
-
"openpond-
|
|
3140
|
+
"openpond-generic-v1",
|
|
3141
|
+
"openpond-work-v1",
|
|
3142
|
+
"openpond-coding-core-v1",
|
|
3143
|
+
"openpond-agent-harness-v1"
|
|
3138
3144
|
];
|
|
3139
3145
|
|
|
3140
|
-
// ../../packages/cloud/
|
|
3146
|
+
// ../../packages/cloud/dist/sandbox/client-handles.js
|
|
3141
3147
|
function createSandboxRuntimeNamespace(client) {
|
|
3142
3148
|
return {
|
|
3143
3149
|
list: (input = {}) => client.listSandboxRuntimes(input),
|
|
@@ -3196,24 +3202,11 @@ function createSandboxAgentNamespace(client) {
|
|
|
3196
3202
|
sourceDeployPlan: (agentId, input) => client.getAgentSourceDeployPlan(agentId, input),
|
|
3197
3203
|
manifestSnapshots: (agentId, input) => client.listAgentManifestSnapshots(agentId, input),
|
|
3198
3204
|
requestSourceChecks: (agentId, input) => client.requestAgentSourceChecks(agentId, input),
|
|
3199
|
-
publishSource: (agentId, input) => client.publishAgentSource(agentId, input)
|
|
3200
|
-
openEditWorkItem: (agentId, input) => client.openAgentEditWorkItem(agentId, input)
|
|
3201
|
-
};
|
|
3202
|
-
}
|
|
3203
|
-
function createSandboxWorkItemNamespace(client) {
|
|
3204
|
-
return {
|
|
3205
|
-
get: (workItemId, input) => client.getCodingWorkItem(workItemId, input),
|
|
3206
|
-
chat: (workItemId, input) => client.sendCodingWorkItemChat(workItemId, input),
|
|
3207
|
-
activity: (workItemId, input) => client.listCodingWorkItemActivity(workItemId, input),
|
|
3208
|
-
status: (workItemId, input) => client.getCodingWorkItemStatus(workItemId, input),
|
|
3209
|
-
handleBackground: (workItemId, input) => client.handleCodingWorkItemInBackground(workItemId, input),
|
|
3210
|
-
promoteCheckpoint: (workItemId, input) => client.promoteCodingWorkItemResult(workItemId, "checkpoint", input),
|
|
3211
|
-
promoteCommit: (workItemId, input) => client.promoteCodingWorkItemResult(workItemId, "commit", input),
|
|
3212
|
-
promotePullRequest: (workItemId, input) => client.promoteCodingWorkItemResult(workItemId, "pr", input)
|
|
3205
|
+
publishSource: (agentId, input) => client.publishAgentSource(agentId, input)
|
|
3213
3206
|
};
|
|
3214
3207
|
}
|
|
3215
3208
|
|
|
3216
|
-
// ../../packages/cloud/
|
|
3209
|
+
// ../../packages/cloud/dist/sandbox/runtime-handle.js
|
|
3217
3210
|
function createSandboxRuntimeHandle(client, runtimeId, initial = null) {
|
|
3218
3211
|
const currentSandbox = async (input = {}, options = {}) => {
|
|
3219
3212
|
const runtime = await client.getSandboxRuntime(runtimeId);
|
|
@@ -3266,7 +3259,8 @@ function createSandboxRuntimeHandle(client, runtimeId, initial = null) {
|
|
|
3266
3259
|
}
|
|
3267
3260
|
});
|
|
3268
3261
|
const current = await client.getSandboxRuntime(runtimeId);
|
|
3269
|
-
if (current.status === "waiting_for_user")
|
|
3262
|
+
if (current.status === "waiting_for_user")
|
|
3263
|
+
return current;
|
|
3270
3264
|
return client.updateSandboxRuntimeStatus(runtimeId, {
|
|
3271
3265
|
status: "waiting_for_user",
|
|
3272
3266
|
expectedVersion: current.version,
|
|
@@ -3333,16 +3327,10 @@ function createSandboxRuntimeHandle(client, runtimeId, initial = null) {
|
|
|
3333
3327
|
move: async (input) => client.moveFile((await resume()).id, input)
|
|
3334
3328
|
},
|
|
3335
3329
|
commands: {
|
|
3336
|
-
run: async (command) => client.exec(
|
|
3337
|
-
(await resume()).id,
|
|
3338
|
-
typeof command === "string" ? { command } : command
|
|
3339
|
-
)
|
|
3330
|
+
run: async (command) => client.exec((await resume()).id, typeof command === "string" ? { command } : command)
|
|
3340
3331
|
},
|
|
3341
3332
|
ports: {
|
|
3342
|
-
expose: async (port) => client.openPort(
|
|
3343
|
-
(await resume()).id,
|
|
3344
|
-
typeof port === "number" ? { port } : port
|
|
3345
|
-
)
|
|
3333
|
+
expose: async (port) => client.openPort((await resume()).id, typeof port === "number" ? { port } : port)
|
|
3346
3334
|
},
|
|
3347
3335
|
promote: (input, options = {}) => client.promoteSandboxRuntime(runtimeId, input, options),
|
|
3348
3336
|
preserveSource: (input = {}, options = {}) => client.preserveSandboxRuntimeSource(runtimeId, input, options),
|
|
@@ -3366,7 +3354,7 @@ function runtimeKeepaliveUntilIso(input) {
|
|
|
3366
3354
|
return new Date(Date.now() + seconds * 1e3).toISOString();
|
|
3367
3355
|
}
|
|
3368
3356
|
|
|
3369
|
-
// ../../packages/cloud/
|
|
3357
|
+
// ../../packages/cloud/dist/sandbox/smoke.js
|
|
3370
3358
|
async function runSandboxSmoke(client, options = {}) {
|
|
3371
3359
|
const runId = `openpond-code-smoke-${Date.now()}`;
|
|
3372
3360
|
const expectedExec = `openpond-code-exec-ok:${runId}`;
|
|
@@ -3378,43 +3366,29 @@ async function runSandboxSmoke(client, options = {}) {
|
|
|
3378
3366
|
let deleted = false;
|
|
3379
3367
|
let forkDeleted = false;
|
|
3380
3368
|
try {
|
|
3381
|
-
const sandbox = await waitForCreateReady(
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
source: "openpond-code-sandbox-smoke"
|
|
3401
|
-
}
|
|
3402
|
-
},
|
|
3403
|
-
{ async: true }
|
|
3404
|
-
)
|
|
3405
|
-
);
|
|
3369
|
+
const sandbox = await waitForCreateReady(client, await client.create({
|
|
3370
|
+
repo: options.repo ?? "https://github.com/octocat/Hello-World",
|
|
3371
|
+
resources: {
|
|
3372
|
+
cpu: options.cpu ?? 1,
|
|
3373
|
+
memoryGb: options.memoryGb ?? 1,
|
|
3374
|
+
diskGb: options.diskGb ?? 8
|
|
3375
|
+
},
|
|
3376
|
+
budget: { maxUsd: options.budgetUsd ?? "0.05" },
|
|
3377
|
+
quotas: {
|
|
3378
|
+
maxSpendUsd: options.budgetUsd ?? "0.05",
|
|
3379
|
+
maxDurationSeconds: 600,
|
|
3380
|
+
idleTimeoutSeconds: 600,
|
|
3381
|
+
maxOpenPorts: 2
|
|
3382
|
+
},
|
|
3383
|
+
metadata: {
|
|
3384
|
+
runId,
|
|
3385
|
+
source: "openpond-code-sandbox-smoke"
|
|
3386
|
+
}
|
|
3387
|
+
}, { async: true }));
|
|
3406
3388
|
sandboxId = sandbox.id;
|
|
3407
|
-
const expectedRuntimeDriver = options.expectedRuntimeDriver ?? "remote-firecracker";
|
|
3408
|
-
if (sandbox.runtimeDriver !== expectedRuntimeDriver) {
|
|
3409
|
-
throw new Error(
|
|
3410
|
-
`expected ${expectedRuntimeDriver}, got ${sandbox.runtimeDriver}`
|
|
3411
|
-
);
|
|
3412
|
-
}
|
|
3413
3389
|
const expectedMppMode = options.expectedMppMode;
|
|
3414
3390
|
if (expectedMppMode && sandbox.reservation.mpp?.mode !== expectedMppMode) {
|
|
3415
|
-
throw new Error(
|
|
3416
|
-
`expected ${expectedMppMode} reservation, got ${sandbox.reservation.mpp?.mode ?? "none"}`
|
|
3417
|
-
);
|
|
3391
|
+
throw new Error(`expected ${expectedMppMode} reservation, got ${sandbox.reservation.mpp?.mode ?? "none"}`);
|
|
3418
3392
|
}
|
|
3419
3393
|
if (!expectedMppMode && !sandbox.reservation.mpp?.mode) {
|
|
3420
3394
|
throw new Error("expected sandbox reservation MPP metadata");
|
|
@@ -3437,15 +3411,8 @@ async function runSandboxSmoke(client, options = {}) {
|
|
|
3437
3411
|
if (!exec.command.output.includes(expectedExec)) {
|
|
3438
3412
|
throw new Error("expected exec marker");
|
|
3439
3413
|
}
|
|
3440
|
-
await client.uploadFile(
|
|
3441
|
-
|
|
3442
|
-
"openpond-code-smoke.txt",
|
|
3443
|
-
expectedFile
|
|
3444
|
-
);
|
|
3445
|
-
const downloaded = await client.downloadFile(
|
|
3446
|
-
sandbox.id,
|
|
3447
|
-
"openpond-code-smoke.txt"
|
|
3448
|
-
);
|
|
3414
|
+
await client.uploadFile(sandbox.id, "openpond-code-smoke.txt", expectedFile);
|
|
3415
|
+
const downloaded = await client.downloadFile(sandbox.id, "openpond-code-smoke.txt");
|
|
3449
3416
|
if (downloaded !== expectedFile) {
|
|
3450
3417
|
throw new Error("expected file roundtrip marker");
|
|
3451
3418
|
}
|
|
@@ -3481,11 +3448,7 @@ async function runSandboxSmoke(client, options = {}) {
|
|
|
3481
3448
|
}
|
|
3482
3449
|
}
|
|
3483
3450
|
});
|
|
3484
|
-
const snapshot = snapshotResponse.snapshot ?? (await waitForSnapshotReady(
|
|
3485
|
-
client,
|
|
3486
|
-
sandbox.id,
|
|
3487
|
-
snapshotResponse.snapshotJob?.snapshotId
|
|
3488
|
-
)).snapshot;
|
|
3451
|
+
const snapshot = snapshotResponse.snapshot ?? (await waitForSnapshotReady(client, sandbox.id, snapshotResponse.snapshotJob?.snapshotId)).snapshot;
|
|
3489
3452
|
snapshotId = snapshot.id;
|
|
3490
3453
|
if (snapshot.state !== "ready") {
|
|
3491
3454
|
throw new Error(`expected ready snapshot, got ${snapshot.state}`);
|
|
@@ -3495,29 +3458,20 @@ async function runSandboxSmoke(client, options = {}) {
|
|
|
3495
3458
|
if (!snapshotId) {
|
|
3496
3459
|
throw new Error("expected snapshot id before fork");
|
|
3497
3460
|
}
|
|
3498
|
-
const forked = await waitForCreateReady(
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
source: "openpond-code-sandbox-smoke-fork",
|
|
3506
|
-
templateSnapshotId: snapshotId
|
|
3507
|
-
}
|
|
3508
|
-
},
|
|
3509
|
-
{ async: true }
|
|
3510
|
-
)).sandbox
|
|
3511
|
-
);
|
|
3461
|
+
const forked = await waitForCreateReady(client, (await client.forkSnapshot(snapshotId, {
|
|
3462
|
+
budget: { maxUsd: options.budgetUsd ?? "0.05" },
|
|
3463
|
+
metadata: {
|
|
3464
|
+
source: "openpond-code-sandbox-smoke-fork",
|
|
3465
|
+
templateSnapshotId: snapshotId
|
|
3466
|
+
}
|
|
3467
|
+
}, { async: true })).sandbox);
|
|
3512
3468
|
forkSandboxId = forked.id;
|
|
3513
3469
|
const forkExec = await client.exec(forked.id, {
|
|
3514
3470
|
command: "cat openpond-code-smoke.txt",
|
|
3515
3471
|
timeoutSeconds: 120
|
|
3516
3472
|
});
|
|
3517
3473
|
if (forkExec.command.status !== "succeeded") {
|
|
3518
|
-
throw new Error(
|
|
3519
|
-
`expected fork command success, got ${forkExec.command.status}`
|
|
3520
|
-
);
|
|
3474
|
+
throw new Error(`expected fork command success, got ${forkExec.command.status}`);
|
|
3521
3475
|
}
|
|
3522
3476
|
if (!forkExec.command.output.includes(expectedFile)) {
|
|
3523
3477
|
throw new Error("expected fork snapshot marker");
|
|
@@ -3543,10 +3497,7 @@ async function runSandboxSmoke(client, options = {}) {
|
|
|
3543
3497
|
throw new Error("expected preview marker");
|
|
3544
3498
|
}
|
|
3545
3499
|
}
|
|
3546
|
-
const { sandbox: readback, receipts } = await stopSandboxForSmoke(
|
|
3547
|
-
client,
|
|
3548
|
-
sandbox.id
|
|
3549
|
-
);
|
|
3500
|
+
const { sandbox: readback, receipts } = await stopSandboxForSmoke(client, sandbox.id);
|
|
3550
3501
|
if (!options.keep) {
|
|
3551
3502
|
await deleteSandboxForSmoke(client, sandbox.id);
|
|
3552
3503
|
deleted = true;
|
|
@@ -3579,12 +3530,7 @@ async function stopSandboxForSmoke(client, sandboxId) {
|
|
|
3579
3530
|
} catch {
|
|
3580
3531
|
await client.stop(sandboxId, { async: true });
|
|
3581
3532
|
}
|
|
3582
|
-
const sandbox = await waitForSandboxState(
|
|
3583
|
-
client,
|
|
3584
|
-
sandboxId,
|
|
3585
|
-
/* @__PURE__ */ new Set(["stopped", "deleted"]),
|
|
3586
|
-
"stop"
|
|
3587
|
-
);
|
|
3533
|
+
const sandbox = await waitForSandboxState(client, sandboxId, /* @__PURE__ */ new Set(["stopped", "deleted"]), "stop");
|
|
3588
3534
|
const receipts = await waitForReceipts(client, sandboxId);
|
|
3589
3535
|
if (receipts.length === 0) {
|
|
3590
3536
|
throw new Error("expected receipt readback");
|
|
@@ -3601,12 +3547,7 @@ async function deleteSandboxForSmoke(client, sandboxId) {
|
|
|
3601
3547
|
} catch {
|
|
3602
3548
|
await client.delete(sandboxId, { async: true });
|
|
3603
3549
|
}
|
|
3604
|
-
return waitForSandboxState(
|
|
3605
|
-
client,
|
|
3606
|
-
sandboxId,
|
|
3607
|
-
/* @__PURE__ */ new Set(["deleted"]),
|
|
3608
|
-
"delete"
|
|
3609
|
-
);
|
|
3550
|
+
return waitForSandboxState(client, sandboxId, /* @__PURE__ */ new Set(["deleted"]), "delete");
|
|
3610
3551
|
}
|
|
3611
3552
|
async function cleanupSandboxBestEffort(client, sandboxId) {
|
|
3612
3553
|
try {
|
|
@@ -3630,11 +3571,7 @@ async function waitForSandboxState(client, sandboxId, targetStates, operation) {
|
|
|
3630
3571
|
await sleep(pollMs);
|
|
3631
3572
|
latest = await client.get(sandboxId);
|
|
3632
3573
|
}
|
|
3633
|
-
throw new Error(
|
|
3634
|
-
`sandbox ${operation} did not reach ${[...targetStates].join(
|
|
3635
|
-
"/"
|
|
3636
|
-
)} before timeout: ${sandboxId} (${latest.state})`
|
|
3637
|
-
);
|
|
3574
|
+
throw new Error(`sandbox ${operation} did not reach ${[...targetStates].join("/")} before timeout: ${sandboxId} (${latest.state})`);
|
|
3638
3575
|
}
|
|
3639
3576
|
async function waitForReceipts(client, sandboxId) {
|
|
3640
3577
|
const timeoutMs = 2 * 6e4;
|
|
@@ -3655,10 +3592,8 @@ async function waitForCreateReady(client, sandbox) {
|
|
|
3655
3592
|
return sandbox;
|
|
3656
3593
|
}
|
|
3657
3594
|
if (sandbox.state === "error") {
|
|
3658
|
-
throw new Error(
|
|
3659
|
-
|
|
3660
|
-
${sandbox.logs.join("\n")}`
|
|
3661
|
-
);
|
|
3595
|
+
throw new Error(`sandbox create failed: ${sandbox.id}
|
|
3596
|
+
${sandbox.logs.join("\n")}`);
|
|
3662
3597
|
}
|
|
3663
3598
|
const timeoutMs = 12 * 6e4;
|
|
3664
3599
|
const pollMs = 3e3;
|
|
@@ -3671,15 +3606,11 @@ ${sandbox.logs.join("\n")}`
|
|
|
3671
3606
|
return latest;
|
|
3672
3607
|
}
|
|
3673
3608
|
if (latest.state === "error") {
|
|
3674
|
-
throw new Error(
|
|
3675
|
-
|
|
3676
|
-
${latest.logs.join("\n")}`
|
|
3677
|
-
);
|
|
3609
|
+
throw new Error(`sandbox create failed: ${latest.id}
|
|
3610
|
+
${latest.logs.join("\n")}`);
|
|
3678
3611
|
}
|
|
3679
3612
|
}
|
|
3680
|
-
throw new Error(
|
|
3681
|
-
`sandbox create did not reach running state before timeout: ${latest.id} (${latest.state})`
|
|
3682
|
-
);
|
|
3613
|
+
throw new Error(`sandbox create did not reach running state before timeout: ${latest.id} (${latest.state})`);
|
|
3683
3614
|
}
|
|
3684
3615
|
async function waitForSnapshotReady(client, sandboxId, snapshotId) {
|
|
3685
3616
|
if (!snapshotId) {
|
|
@@ -3694,36 +3625,199 @@ async function waitForSnapshotReady(client, sandboxId, snapshotId) {
|
|
|
3694
3625
|
if (snapshot?.state === "ready") {
|
|
3695
3626
|
return { sandbox: latest, snapshot };
|
|
3696
3627
|
}
|
|
3697
|
-
const job = latest.snapshotJobs?.find(
|
|
3698
|
-
(item) => item.snapshotId === snapshotId
|
|
3699
|
-
);
|
|
3628
|
+
const job = latest.snapshotJobs?.find((item) => item.snapshotId === snapshotId);
|
|
3700
3629
|
if (job?.status === "failed") {
|
|
3701
3630
|
throw new Error(`snapshot job failed: ${job.error ?? snapshotId}`);
|
|
3702
3631
|
}
|
|
3703
3632
|
await sleep(pollMs);
|
|
3704
3633
|
latest = await client.get(sandboxId);
|
|
3705
3634
|
}
|
|
3706
|
-
throw new Error(
|
|
3707
|
-
`snapshot did not reach ready state before timeout: ${snapshotId}`
|
|
3708
|
-
);
|
|
3635
|
+
throw new Error(`snapshot did not reach ready state before timeout: ${snapshotId}`);
|
|
3709
3636
|
}
|
|
3710
3637
|
function sleep(ms) {
|
|
3711
3638
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
3712
3639
|
}
|
|
3713
3640
|
|
|
3714
|
-
// ../../packages/cloud/
|
|
3641
|
+
// ../../packages/cloud/dist/sandbox/async-request-options.js
|
|
3715
3642
|
function asyncRequestHeaders(options = {}) {
|
|
3716
3643
|
return options.async || options.respondAsync ? { Prefer: "respond-async" } : void 0;
|
|
3717
3644
|
}
|
|
3718
3645
|
|
|
3719
|
-
// ../../packages/cloud/
|
|
3646
|
+
// ../../packages/cloud/dist/api/vercel-protection.js
|
|
3647
|
+
var VERCEL_PROTECTION_BYPASS_HEADER2 = "x-vercel-protection-bypass";
|
|
3648
|
+
function withVercelProtectionBypass2(requestUrl, inputHeaders, env = typeof process === "undefined" ? {} : process.env) {
|
|
3649
|
+
const headers = new Headers(inputHeaders);
|
|
3650
|
+
const secret = env.VERCEL_AUTOMATION_BYPASS_SECRET?.trim();
|
|
3651
|
+
if (!secret || !isOpenPondStagingUrl2(requestUrl))
|
|
3652
|
+
return headers;
|
|
3653
|
+
headers.set(VERCEL_PROTECTION_BYPASS_HEADER2, secret);
|
|
3654
|
+
return headers;
|
|
3655
|
+
}
|
|
3656
|
+
function isOpenPondStagingUrl2(requestUrl) {
|
|
3657
|
+
try {
|
|
3658
|
+
const hostname3 = new URL(requestUrl).hostname.toLowerCase();
|
|
3659
|
+
return hostname3 === "staging.openpond.ai" || hostname3 === "staging-api.openpond.ai" || hostname3.endsWith(".staging-api.openpond.ai");
|
|
3660
|
+
} catch {
|
|
3661
|
+
return false;
|
|
3662
|
+
}
|
|
3663
|
+
}
|
|
3664
|
+
|
|
3665
|
+
// ../../packages/cloud/dist/api/core.js
|
|
3666
|
+
var DEFAULT_API_TIMEOUT_MS2 = 3e4;
|
|
3667
|
+
var DEFAULT_API_RESPONSE_BYTES2 = 8 * 1024 * 1024;
|
|
3668
|
+
var LONG_STREAM_API_OPTIONS2 = { timeoutMs: 15 * 60 * 1e3, maxResponseBytes: 64 * 1024 * 1024 };
|
|
3669
|
+
var ApiTimeoutError2 = class extends Error {
|
|
3670
|
+
timeoutMs;
|
|
3671
|
+
requestUrl;
|
|
3672
|
+
code = "OPENPOND_API_TIMEOUT";
|
|
3673
|
+
constructor(timeoutMs, requestUrl) {
|
|
3674
|
+
super(`API request timed out after ${timeoutMs}ms: ${requestUrl}`);
|
|
3675
|
+
this.timeoutMs = timeoutMs;
|
|
3676
|
+
this.requestUrl = requestUrl;
|
|
3677
|
+
this.name = "ApiTimeoutError";
|
|
3678
|
+
}
|
|
3679
|
+
};
|
|
3680
|
+
var ApiResponseTooLargeError2 = class extends Error {
|
|
3681
|
+
maximumBytes;
|
|
3682
|
+
requestUrl;
|
|
3683
|
+
code = "OPENPOND_API_RESPONSE_TOO_LARGE";
|
|
3684
|
+
constructor(maximumBytes, requestUrl) {
|
|
3685
|
+
super(`API response exceeded ${maximumBytes} bytes: ${requestUrl}`);
|
|
3686
|
+
this.maximumBytes = maximumBytes;
|
|
3687
|
+
this.requestUrl = requestUrl;
|
|
3688
|
+
this.name = "ApiResponseTooLargeError";
|
|
3689
|
+
}
|
|
3690
|
+
};
|
|
3691
|
+
var OpenPondApiError2 = class extends Error {
|
|
3692
|
+
status;
|
|
3693
|
+
apiMessage;
|
|
3694
|
+
code;
|
|
3695
|
+
constructor(status, errorCode, label, apiMessage = null) {
|
|
3696
|
+
const detail = apiMessage || errorCode;
|
|
3697
|
+
super(`${label} failed: ${status}${detail ? ` ${detail}` : ""}`);
|
|
3698
|
+
this.status = status;
|
|
3699
|
+
this.apiMessage = apiMessage;
|
|
3700
|
+
this.name = "OpenPondApiError";
|
|
3701
|
+
this.code = errorCode || "OPENPOND_API_ERROR";
|
|
3702
|
+
}
|
|
3703
|
+
};
|
|
3704
|
+
async function apiFetch2(baseUrl, token, requestPath, options = {}) {
|
|
3705
|
+
const { timeoutMs = DEFAULT_API_TIMEOUT_MS2, maxResponseBytes = DEFAULT_API_RESPONSE_BYTES2, ...init } = options;
|
|
3706
|
+
const requestUrl = `${baseUrl}${requestPath}`;
|
|
3707
|
+
const headers = withVercelProtectionBypass2(requestUrl, init.headers);
|
|
3708
|
+
headers.set("Content-Type", "application/json");
|
|
3709
|
+
const apiKey = process.env.OPENPOND_API_KEY;
|
|
3710
|
+
const trimmedToken = token?.trim() || "";
|
|
3711
|
+
const tokenIsApiKey = trimmedToken.startsWith("opk_");
|
|
3712
|
+
const effectiveApiKey = apiKey || (tokenIsApiKey ? trimmedToken : null);
|
|
3713
|
+
if (effectiveApiKey && !headers.has("openpond-api-key"))
|
|
3714
|
+
headers.set("openpond-api-key", effectiveApiKey);
|
|
3715
|
+
if (token) {
|
|
3716
|
+
headers.set("Authorization", tokenIsApiKey ? `ApiKey ${trimmedToken}` : `Bearer ${token}`);
|
|
3717
|
+
} else if (apiKey && !headers.has("Authorization")) {
|
|
3718
|
+
headers.set("Authorization", `ApiKey ${apiKey}`);
|
|
3719
|
+
}
|
|
3720
|
+
const timeoutController = new AbortController();
|
|
3721
|
+
const timeoutError = new ApiTimeoutError2(timeoutMs, requestUrl);
|
|
3722
|
+
const timer = timeoutMs > 0 ? setTimeout(() => timeoutController.abort(timeoutError), timeoutMs) : null;
|
|
3723
|
+
timer?.unref?.();
|
|
3724
|
+
const signal = composedSignal2(init.signal, timeoutController.signal, timeoutMs);
|
|
3725
|
+
const cleanup = () => {
|
|
3726
|
+
if (timer)
|
|
3727
|
+
clearTimeout(timer);
|
|
3728
|
+
};
|
|
3729
|
+
try {
|
|
3730
|
+
const response = await fetch(requestUrl, { ...init, headers, signal });
|
|
3731
|
+
return boundedResponse2(response, {
|
|
3732
|
+
cleanup,
|
|
3733
|
+
maximumBytes: maxResponseBytes,
|
|
3734
|
+
requestUrl,
|
|
3735
|
+
timeoutController,
|
|
3736
|
+
timeoutError
|
|
3737
|
+
});
|
|
3738
|
+
} catch (error51) {
|
|
3739
|
+
cleanup();
|
|
3740
|
+
if (timeoutController.signal.aborted)
|
|
3741
|
+
throw timeoutError;
|
|
3742
|
+
throw error51;
|
|
3743
|
+
}
|
|
3744
|
+
}
|
|
3745
|
+
async function readApiJson2(response, label) {
|
|
3746
|
+
let payload;
|
|
3747
|
+
try {
|
|
3748
|
+
const text5 = await response.text();
|
|
3749
|
+
payload = text5 ? JSON.parse(text5) : {};
|
|
3750
|
+
} catch (error51) {
|
|
3751
|
+
if (error51 instanceof ApiTimeoutError2 || error51 instanceof ApiResponseTooLargeError2)
|
|
3752
|
+
throw error51;
|
|
3753
|
+
payload = {};
|
|
3754
|
+
}
|
|
3755
|
+
if (!response.ok) {
|
|
3756
|
+
const errorCode = typeof payload.error === "string" ? payload.error : null;
|
|
3757
|
+
const apiMessage = typeof payload.message === "string" ? payload.message : null;
|
|
3758
|
+
throw new OpenPondApiError2(response.status, errorCode, label, apiMessage);
|
|
3759
|
+
}
|
|
3760
|
+
return payload;
|
|
3761
|
+
}
|
|
3762
|
+
function boundedResponse2(response, input) {
|
|
3763
|
+
if (!response.body) {
|
|
3764
|
+
input.cleanup();
|
|
3765
|
+
return response;
|
|
3766
|
+
}
|
|
3767
|
+
const contentLength = Number(response.headers.get("content-length"));
|
|
3768
|
+
if (input.maximumBytes > 0 && Number.isFinite(contentLength) && contentLength > input.maximumBytes) {
|
|
3769
|
+
input.cleanup();
|
|
3770
|
+
void response.body.cancel();
|
|
3771
|
+
throw new ApiResponseTooLargeError2(input.maximumBytes, input.requestUrl);
|
|
3772
|
+
}
|
|
3773
|
+
const reader = response.body.getReader();
|
|
3774
|
+
let receivedBytes = 0;
|
|
3775
|
+
const body = new ReadableStream({
|
|
3776
|
+
async pull(controller) {
|
|
3777
|
+
try {
|
|
3778
|
+
const result = await reader.read();
|
|
3779
|
+
if (result.done) {
|
|
3780
|
+
input.cleanup();
|
|
3781
|
+
controller.close();
|
|
3782
|
+
return;
|
|
3783
|
+
}
|
|
3784
|
+
receivedBytes += result.value.byteLength;
|
|
3785
|
+
if (input.maximumBytes > 0 && receivedBytes > input.maximumBytes) {
|
|
3786
|
+
input.cleanup();
|
|
3787
|
+
await reader.cancel();
|
|
3788
|
+
controller.error(new ApiResponseTooLargeError2(input.maximumBytes, input.requestUrl));
|
|
3789
|
+
return;
|
|
3790
|
+
}
|
|
3791
|
+
controller.enqueue(result.value);
|
|
3792
|
+
} catch (error51) {
|
|
3793
|
+
input.cleanup();
|
|
3794
|
+
controller.error(input.timeoutController.signal.aborted ? input.timeoutError : error51);
|
|
3795
|
+
}
|
|
3796
|
+
},
|
|
3797
|
+
async cancel(reason) {
|
|
3798
|
+
input.cleanup();
|
|
3799
|
+
await reader.cancel(reason);
|
|
3800
|
+
}
|
|
3801
|
+
});
|
|
3802
|
+
return new Response(body, {
|
|
3803
|
+
headers: response.headers,
|
|
3804
|
+
status: response.status,
|
|
3805
|
+
statusText: response.statusText
|
|
3806
|
+
});
|
|
3807
|
+
}
|
|
3808
|
+
function composedSignal2(callerSignal, timeoutSignal, timeoutMs) {
|
|
3809
|
+
if (timeoutMs <= 0)
|
|
3810
|
+
return callerSignal ?? void 0;
|
|
3811
|
+
return callerSignal ? AbortSignal.any([callerSignal, timeoutSignal]) : timeoutSignal;
|
|
3812
|
+
}
|
|
3813
|
+
|
|
3814
|
+
// ../../packages/cloud/dist/urls.js
|
|
3815
|
+
var DEFAULT_OPENPOND_WEB_BASE_URL2 = "https://openpond.ai";
|
|
3816
|
+
var DEFAULT_OPENPOND_API_BASE_URL2 = "https://api.openpond.ai";
|
|
3817
|
+
|
|
3818
|
+
// ../../packages/cloud/dist/sandbox/stream.js
|
|
3720
3819
|
async function streamSandboxEventOutput(params) {
|
|
3721
|
-
const response = await
|
|
3722
|
-
params.sandboxApiUrl,
|
|
3723
|
-
params.apiKey,
|
|
3724
|
-
params.path,
|
|
3725
|
-
{ timeoutMs: 0, maxResponseBytes: 0 }
|
|
3726
|
-
);
|
|
3820
|
+
const response = await apiFetch2(params.sandboxApiUrl, params.apiKey, params.path, { timeoutMs: 0, maxResponseBytes: 0 });
|
|
3727
3821
|
if (!response.body) {
|
|
3728
3822
|
return;
|
|
3729
3823
|
}
|
|
@@ -3733,14 +3827,16 @@ async function streamSandboxEventOutput(params) {
|
|
|
3733
3827
|
try {
|
|
3734
3828
|
while (true) {
|
|
3735
3829
|
const { done, value } = await reader.read();
|
|
3736
|
-
if (done)
|
|
3830
|
+
if (done)
|
|
3831
|
+
break;
|
|
3737
3832
|
buffered += decoder.decode(value, { stream: true });
|
|
3738
3833
|
let separatorIndex = buffered.indexOf("\n\n");
|
|
3739
3834
|
while (separatorIndex !== -1) {
|
|
3740
3835
|
const event = buffered.slice(0, separatorIndex);
|
|
3741
3836
|
buffered = buffered.slice(separatorIndex + 2);
|
|
3742
3837
|
const output = parseProcessOutputEvent(event);
|
|
3743
|
-
if (output)
|
|
3838
|
+
if (output)
|
|
3839
|
+
process.stdout.write(output);
|
|
3744
3840
|
separatorIndex = buffered.indexOf("\n\n");
|
|
3745
3841
|
}
|
|
3746
3842
|
}
|
|
@@ -3773,7 +3869,7 @@ function parseProcessOutputEvent(event) {
|
|
|
3773
3869
|
}
|
|
3774
3870
|
}
|
|
3775
3871
|
|
|
3776
|
-
// ../../packages/cloud/
|
|
3872
|
+
// ../../packages/cloud/dist/sandbox/url.js
|
|
3777
3873
|
function normalizeSandboxApiUrl(baseUrlOrApiUrl) {
|
|
3778
3874
|
const trimmed = baseUrlOrApiUrl.trim().replace(/\/$/, "");
|
|
3779
3875
|
if (!trimmed) {
|
|
@@ -3790,8 +3886,8 @@ function normalizeSandboxApiUrl(baseUrlOrApiUrl) {
|
|
|
3790
3886
|
if (isOpenPondHostedApiHost(url2.hostname)) {
|
|
3791
3887
|
return `${url2.origin}${normalizedPath}/v1/sandboxes`;
|
|
3792
3888
|
}
|
|
3793
|
-
if (url2.origin ===
|
|
3794
|
-
return `${
|
|
3889
|
+
if (url2.origin === DEFAULT_OPENPOND_WEB_BASE_URL2) {
|
|
3890
|
+
return `${DEFAULT_OPENPOND_API_BASE_URL2}/v1/sandboxes`;
|
|
3795
3891
|
}
|
|
3796
3892
|
return `${url2.origin}${normalizedPath}/api/sandboxes`;
|
|
3797
3893
|
}
|
|
@@ -3803,19 +3899,17 @@ function apiRootUrlFromSandboxApiUrl(sandboxApiUrl) {
|
|
|
3803
3899
|
return sandboxApiUrl.slice(0, -suffix.length);
|
|
3804
3900
|
}
|
|
3805
3901
|
function isOpenPondHostedApiHost(hostname3) {
|
|
3806
|
-
return hostname3 === "api.openpond.ai" || hostname3.startsWith("api") && hostname3.endsWith(".openpond.ai");
|
|
3902
|
+
return hostname3 === "api.openpond.ai" || hostname3 === "staging-api.openpond.ai" || hostname3.startsWith("api") && hostname3.endsWith(".openpond.ai");
|
|
3807
3903
|
}
|
|
3808
3904
|
|
|
3809
|
-
// ../../packages/cloud/
|
|
3905
|
+
// ../../packages/cloud/dist/sandbox/sandbox-instance-client.js
|
|
3810
3906
|
var OpenPondSandboxInstanceClient = class {
|
|
3811
3907
|
apiKey;
|
|
3812
3908
|
apiRootUrl;
|
|
3813
3909
|
sandboxApiUrl;
|
|
3814
3910
|
constructor(options) {
|
|
3815
3911
|
this.apiKey = options.apiKey;
|
|
3816
|
-
this.sandboxApiUrl = normalizeSandboxApiUrl(
|
|
3817
|
-
options.sandboxApiUrl ?? options.baseUrl ?? DEFAULT_OPENPOND_API_BASE_URL
|
|
3818
|
-
);
|
|
3912
|
+
this.sandboxApiUrl = normalizeSandboxApiUrl(options.sandboxApiUrl ?? options.baseUrl ?? DEFAULT_OPENPOND_API_BASE_URL2);
|
|
3819
3913
|
this.apiRootUrl = apiRootUrlFromSandboxApiUrl(this.sandboxApiUrl);
|
|
3820
3914
|
}
|
|
3821
3915
|
create(input, options = {}) {
|
|
@@ -3826,52 +3920,33 @@ var OpenPondSandboxInstanceClient = class {
|
|
|
3826
3920
|
}).then((payload) => payload.sandbox);
|
|
3827
3921
|
}
|
|
3828
3922
|
get(sandboxId) {
|
|
3829
|
-
return this.request(
|
|
3830
|
-
`/${encodeURIComponent(sandboxId)}`
|
|
3831
|
-
).then((payload) => payload.sandbox);
|
|
3923
|
+
return this.request(`/${encodeURIComponent(sandboxId)}`).then((payload) => payload.sandbox);
|
|
3832
3924
|
}
|
|
3833
3925
|
exec(sandboxId, input) {
|
|
3834
|
-
return this.request(
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
body: JSON.stringify(input)
|
|
3839
|
-
}
|
|
3840
|
-
);
|
|
3926
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/exec`, {
|
|
3927
|
+
method: "POST",
|
|
3928
|
+
body: JSON.stringify(input)
|
|
3929
|
+
});
|
|
3841
3930
|
}
|
|
3842
3931
|
startProcess(sandboxId, input) {
|
|
3843
|
-
return this.request(
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
body: JSON.stringify(input)
|
|
3848
|
-
}
|
|
3849
|
-
);
|
|
3932
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/processes`, {
|
|
3933
|
+
method: "POST",
|
|
3934
|
+
body: JSON.stringify(input)
|
|
3935
|
+
});
|
|
3850
3936
|
}
|
|
3851
3937
|
listProcesses(sandboxId) {
|
|
3852
|
-
return this.request(
|
|
3853
|
-
`/${encodeURIComponent(sandboxId)}/processes`
|
|
3854
|
-
);
|
|
3938
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/processes`);
|
|
3855
3939
|
}
|
|
3856
3940
|
getProcess(sandboxId, processId, input = {}) {
|
|
3857
3941
|
const query = new URLSearchParams();
|
|
3858
3942
|
if (input.since !== void 0)
|
|
3859
3943
|
query.set("since", String(Math.max(0, input.since)));
|
|
3860
|
-
return this.request(
|
|
3861
|
-
`/${encodeURIComponent(sandboxId)}/processes/${encodeURIComponent(
|
|
3862
|
-
processId
|
|
3863
|
-
)}${query.size > 0 ? `?${query.toString()}` : ""}`
|
|
3864
|
-
);
|
|
3944
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/processes/${encodeURIComponent(processId)}${query.size > 0 ? `?${query.toString()}` : ""}`);
|
|
3865
3945
|
}
|
|
3866
3946
|
stopProcess(sandboxId, processId) {
|
|
3867
|
-
return this.request(
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
)}`,
|
|
3871
|
-
{
|
|
3872
|
-
method: "DELETE"
|
|
3873
|
-
}
|
|
3874
|
-
);
|
|
3947
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/processes/${encodeURIComponent(processId)}`, {
|
|
3948
|
+
method: "DELETE"
|
|
3949
|
+
});
|
|
3875
3950
|
}
|
|
3876
3951
|
async streamProcessOutput(sandboxId, processId, input = {}) {
|
|
3877
3952
|
const query = new URLSearchParams();
|
|
@@ -3880,51 +3955,34 @@ var OpenPondSandboxInstanceClient = class {
|
|
|
3880
3955
|
await streamSandboxEventOutput({
|
|
3881
3956
|
sandboxApiUrl: this.sandboxApiUrl,
|
|
3882
3957
|
apiKey: this.apiKey,
|
|
3883
|
-
path: `/${encodeURIComponent(sandboxId)}/processes/${encodeURIComponent(
|
|
3884
|
-
processId
|
|
3885
|
-
)}/stream${query.size > 0 ? `?${query.toString()}` : ""}`
|
|
3958
|
+
path: `/${encodeURIComponent(sandboxId)}/processes/${encodeURIComponent(processId)}/stream${query.size > 0 ? `?${query.toString()}` : ""}`
|
|
3886
3959
|
});
|
|
3887
3960
|
}
|
|
3888
3961
|
startPty(sandboxId, input = {}) {
|
|
3889
|
-
return this.request(
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
body: JSON.stringify(input)
|
|
3894
|
-
}
|
|
3895
|
-
);
|
|
3962
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/pty`, {
|
|
3963
|
+
method: "POST",
|
|
3964
|
+
body: JSON.stringify(input)
|
|
3965
|
+
});
|
|
3896
3966
|
}
|
|
3897
3967
|
listPtys(sandboxId) {
|
|
3898
|
-
return this.request(
|
|
3899
|
-
`/${encodeURIComponent(sandboxId)}/pty`
|
|
3900
|
-
);
|
|
3968
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/pty`);
|
|
3901
3969
|
}
|
|
3902
3970
|
getPty(sandboxId, ptyId, input = {}) {
|
|
3903
3971
|
const query = new URLSearchParams();
|
|
3904
3972
|
if (input.since !== void 0)
|
|
3905
3973
|
query.set("since", String(Math.max(0, input.since)));
|
|
3906
|
-
return this.request(
|
|
3907
|
-
`/${encodeURIComponent(sandboxId)}/pty/${encodeURIComponent(ptyId)}${query.size > 0 ? `?${query.toString()}` : ""}`
|
|
3908
|
-
);
|
|
3974
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/pty/${encodeURIComponent(ptyId)}${query.size > 0 ? `?${query.toString()}` : ""}`);
|
|
3909
3975
|
}
|
|
3910
3976
|
writePtyInput(sandboxId, ptyId, input) {
|
|
3911
|
-
return this.request(
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
{
|
|
3916
|
-
method: "POST",
|
|
3917
|
-
body: JSON.stringify(normalizePtyInput(input))
|
|
3918
|
-
}
|
|
3919
|
-
);
|
|
3977
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/pty/${encodeURIComponent(ptyId)}/input`, {
|
|
3978
|
+
method: "POST",
|
|
3979
|
+
body: JSON.stringify(normalizePtyInput(input))
|
|
3980
|
+
});
|
|
3920
3981
|
}
|
|
3921
3982
|
stopPty(sandboxId, ptyId) {
|
|
3922
|
-
return this.request(
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
method: "DELETE"
|
|
3926
|
-
}
|
|
3927
|
-
);
|
|
3983
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/pty/${encodeURIComponent(ptyId)}`, {
|
|
3984
|
+
method: "DELETE"
|
|
3985
|
+
});
|
|
3928
3986
|
}
|
|
3929
3987
|
async streamPtyOutput(sandboxId, ptyId, input = {}) {
|
|
3930
3988
|
const query = new URLSearchParams();
|
|
@@ -3933,29 +3991,20 @@ var OpenPondSandboxInstanceClient = class {
|
|
|
3933
3991
|
await streamSandboxEventOutput({
|
|
3934
3992
|
sandboxApiUrl: this.sandboxApiUrl,
|
|
3935
3993
|
apiKey: this.apiKey,
|
|
3936
|
-
path: `/${encodeURIComponent(sandboxId)}/pty/${encodeURIComponent(
|
|
3937
|
-
ptyId
|
|
3938
|
-
)}/stream${query.size > 0 ? `?${query.toString()}` : ""}`
|
|
3994
|
+
path: `/${encodeURIComponent(sandboxId)}/pty/${encodeURIComponent(ptyId)}/stream${query.size > 0 ? `?${query.toString()}` : ""}`
|
|
3939
3995
|
});
|
|
3940
3996
|
}
|
|
3941
3997
|
uploadFile(sandboxId, path10, contents) {
|
|
3942
|
-
return this.uploadFileBase64(
|
|
3943
|
-
sandboxId,
|
|
3944
|
-
path10,
|
|
3945
|
-
Buffer.from(contents, "utf-8").toString("base64")
|
|
3946
|
-
);
|
|
3998
|
+
return this.uploadFileBase64(sandboxId, path10, Buffer.from(contents, "utf-8").toString("base64"));
|
|
3947
3999
|
}
|
|
3948
4000
|
uploadFileBase64(sandboxId, path10, contentsBase64) {
|
|
3949
|
-
return this.request(
|
|
3950
|
-
|
|
3951
|
-
{
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
})
|
|
3957
|
-
}
|
|
3958
|
-
);
|
|
4001
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/files`, {
|
|
4002
|
+
method: "POST",
|
|
4003
|
+
body: JSON.stringify({
|
|
4004
|
+
path: path10,
|
|
4005
|
+
contentsBase64
|
|
4006
|
+
})
|
|
4007
|
+
});
|
|
3959
4008
|
}
|
|
3960
4009
|
async downloadFile(sandboxId, path10) {
|
|
3961
4010
|
const payload = await this.downloadFileResponse(sandboxId, path10);
|
|
@@ -3970,49 +4019,38 @@ var OpenPondSandboxInstanceClient = class {
|
|
|
3970
4019
|
if (normalized.maxBytes !== void 0) {
|
|
3971
4020
|
query.set("maxBytes", String(normalized.maxBytes));
|
|
3972
4021
|
}
|
|
3973
|
-
return this.request(
|
|
3974
|
-
`/${encodeURIComponent(sandboxId)}/files?${query.toString()}`
|
|
3975
|
-
);
|
|
4022
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/files?${query.toString()}`);
|
|
3976
4023
|
}
|
|
3977
4024
|
listFiles(sandboxId, input = {}) {
|
|
3978
4025
|
const query = new URLSearchParams({ list: "1" });
|
|
3979
|
-
if (input.path)
|
|
4026
|
+
if (input.path)
|
|
4027
|
+
query.set("path", input.path);
|
|
3980
4028
|
if (input.recursive !== void 0)
|
|
3981
4029
|
query.set("recursive", String(input.recursive));
|
|
3982
4030
|
if (input.maxEntries !== void 0)
|
|
3983
4031
|
query.set("maxEntries", String(input.maxEntries));
|
|
3984
|
-
return this.request(
|
|
3985
|
-
`/${encodeURIComponent(sandboxId)}/files?${query.toString()}`
|
|
3986
|
-
);
|
|
4032
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/files?${query.toString()}`);
|
|
3987
4033
|
}
|
|
3988
4034
|
deleteFile(sandboxId, path10, input = {}) {
|
|
3989
4035
|
const query = new URLSearchParams({ path: path10 });
|
|
3990
4036
|
if (input.recursive !== void 0)
|
|
3991
4037
|
query.set("recursive", String(input.recursive));
|
|
3992
|
-
return this.request(
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
method: "DELETE"
|
|
3996
|
-
}
|
|
3997
|
-
);
|
|
4038
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/files?${query.toString()}`, {
|
|
4039
|
+
method: "DELETE"
|
|
4040
|
+
});
|
|
3998
4041
|
}
|
|
3999
4042
|
statFile(sandboxId, path10) {
|
|
4000
4043
|
const query = new URLSearchParams({ stat: "1", path: path10 });
|
|
4001
|
-
return this.request(
|
|
4002
|
-
`/${encodeURIComponent(sandboxId)}/files?${query.toString()}`
|
|
4003
|
-
);
|
|
4044
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/files?${query.toString()}`);
|
|
4004
4045
|
}
|
|
4005
4046
|
mkdir(sandboxId, input) {
|
|
4006
4047
|
const normalized = typeof input === "string" ? { path: input } : input;
|
|
4007
4048
|
const query = new URLSearchParams({ path: normalized.path });
|
|
4008
4049
|
if (normalized.recursive !== void 0)
|
|
4009
4050
|
query.set("recursive", String(normalized.recursive));
|
|
4010
|
-
return this.request(
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
method: "PUT"
|
|
4014
|
-
}
|
|
4015
|
-
);
|
|
4051
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/files?${query.toString()}`, {
|
|
4052
|
+
method: "PUT"
|
|
4053
|
+
});
|
|
4016
4054
|
}
|
|
4017
4055
|
moveFile(sandboxId, input) {
|
|
4018
4056
|
const query = new URLSearchParams({
|
|
@@ -4021,281 +4059,201 @@ var OpenPondSandboxInstanceClient = class {
|
|
|
4021
4059
|
});
|
|
4022
4060
|
if (input.overwrite !== void 0)
|
|
4023
4061
|
query.set("overwrite", String(input.overwrite));
|
|
4024
|
-
return this.request(
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
method: "PATCH"
|
|
4028
|
-
}
|
|
4029
|
-
);
|
|
4062
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/files?${query.toString()}`, {
|
|
4063
|
+
method: "PATCH"
|
|
4064
|
+
});
|
|
4030
4065
|
}
|
|
4031
4066
|
searchFiles(sandboxId, input) {
|
|
4032
4067
|
const query = new URLSearchParams({
|
|
4033
4068
|
search: "1",
|
|
4034
4069
|
query: input.query
|
|
4035
4070
|
});
|
|
4036
|
-
if (input.path)
|
|
4071
|
+
if (input.path)
|
|
4072
|
+
query.set("path", input.path);
|
|
4037
4073
|
if (input.maxResults !== void 0)
|
|
4038
4074
|
query.set("maxResults", String(input.maxResults));
|
|
4039
|
-
return this.request(
|
|
4040
|
-
`/${encodeURIComponent(sandboxId)}/files?${query.toString()}`
|
|
4041
|
-
);
|
|
4075
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/files?${query.toString()}`);
|
|
4042
4076
|
}
|
|
4043
4077
|
openPort(sandboxId, input) {
|
|
4044
|
-
return this.request(
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
body: JSON.stringify(input)
|
|
4049
|
-
}
|
|
4050
|
-
);
|
|
4078
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/ports`, {
|
|
4079
|
+
method: "POST",
|
|
4080
|
+
body: JSON.stringify(input)
|
|
4081
|
+
});
|
|
4051
4082
|
}
|
|
4052
4083
|
createSnapshot(sandboxId, input) {
|
|
4053
|
-
return this.request(
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
body: JSON.stringify(input)
|
|
4058
|
-
}
|
|
4059
|
-
);
|
|
4084
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/snapshots`, {
|
|
4085
|
+
method: "POST",
|
|
4086
|
+
body: JSON.stringify(input)
|
|
4087
|
+
});
|
|
4060
4088
|
}
|
|
4061
4089
|
updateSnapshot(sandboxId, snapshotId, input) {
|
|
4062
|
-
return this.request(
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
{
|
|
4067
|
-
method: "PATCH",
|
|
4068
|
-
body: JSON.stringify(input)
|
|
4069
|
-
}
|
|
4070
|
-
);
|
|
4090
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/snapshots/${encodeURIComponent(snapshotId)}`, {
|
|
4091
|
+
method: "PATCH",
|
|
4092
|
+
body: JSON.stringify(input)
|
|
4093
|
+
});
|
|
4071
4094
|
}
|
|
4072
4095
|
validateSnapshot(sandboxId, snapshotId, input = {}) {
|
|
4073
|
-
return this.request(
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
{
|
|
4078
|
-
method: "POST",
|
|
4079
|
-
body: JSON.stringify(input)
|
|
4080
|
-
}
|
|
4081
|
-
);
|
|
4096
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/snapshots/${encodeURIComponent(snapshotId)}/validate`, {
|
|
4097
|
+
method: "POST",
|
|
4098
|
+
body: JSON.stringify(input)
|
|
4099
|
+
});
|
|
4082
4100
|
}
|
|
4083
4101
|
publishSnapshot(sandboxId, snapshotId) {
|
|
4084
|
-
return this.request(
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
)}/publish`,
|
|
4088
|
-
{
|
|
4089
|
-
method: "POST"
|
|
4090
|
-
}
|
|
4091
|
-
);
|
|
4102
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/snapshots/${encodeURIComponent(snapshotId)}/publish`, {
|
|
4103
|
+
method: "POST"
|
|
4104
|
+
});
|
|
4092
4105
|
}
|
|
4093
4106
|
fork(sandboxId, input = {}) {
|
|
4094
|
-
return this.request(
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
body: JSON.stringify(input)
|
|
4099
|
-
}
|
|
4100
|
-
);
|
|
4107
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/fork`, {
|
|
4108
|
+
method: "POST",
|
|
4109
|
+
body: JSON.stringify(input)
|
|
4110
|
+
});
|
|
4101
4111
|
}
|
|
4102
4112
|
stop(sandboxId, options = {}) {
|
|
4103
4113
|
const query = new URLSearchParams();
|
|
4104
4114
|
if (options.failOnUnpreservedChanges) {
|
|
4105
4115
|
query.set("failOnUnpreservedChanges", "true");
|
|
4106
4116
|
}
|
|
4107
|
-
return this.request(
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
headers: asyncRequestHeaders(options)
|
|
4112
|
-
}
|
|
4113
|
-
);
|
|
4117
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/stop${query.size > 0 ? `?${query.toString()}` : ""}`, {
|
|
4118
|
+
method: "POST",
|
|
4119
|
+
headers: asyncRequestHeaders(options)
|
|
4120
|
+
});
|
|
4114
4121
|
}
|
|
4115
4122
|
start(sandboxId, options = {}) {
|
|
4116
|
-
return this.request(
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
headers: asyncRequestHeaders(options)
|
|
4121
|
-
}
|
|
4122
|
-
);
|
|
4123
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/start`, {
|
|
4124
|
+
method: "POST",
|
|
4125
|
+
headers: asyncRequestHeaders(options)
|
|
4126
|
+
});
|
|
4123
4127
|
}
|
|
4124
4128
|
restore(sandboxId) {
|
|
4125
|
-
return this.request(
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
method: "POST"
|
|
4129
|
-
}
|
|
4130
|
-
);
|
|
4129
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/restore`, {
|
|
4130
|
+
method: "POST"
|
|
4131
|
+
});
|
|
4131
4132
|
}
|
|
4132
4133
|
delete(sandboxId, options = {}) {
|
|
4133
4134
|
const query = new URLSearchParams();
|
|
4134
4135
|
if (options.failOnUnpreservedChanges) {
|
|
4135
4136
|
query.set("failOnUnpreservedChanges", "true");
|
|
4136
4137
|
}
|
|
4137
|
-
return this.request(
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
headers: asyncRequestHeaders(options)
|
|
4142
|
-
}
|
|
4143
|
-
).then((payload) => payload.sandbox);
|
|
4138
|
+
return this.request(`/${encodeURIComponent(sandboxId)}${query.size > 0 ? `?${query.toString()}` : ""}`, {
|
|
4139
|
+
method: "DELETE",
|
|
4140
|
+
headers: asyncRequestHeaders(options)
|
|
4141
|
+
}).then((payload) => payload.sandbox);
|
|
4144
4142
|
}
|
|
4145
4143
|
receipts(sandboxId) {
|
|
4146
|
-
return this.request(
|
|
4147
|
-
`/${encodeURIComponent(sandboxId)}/receipts`
|
|
4148
|
-
).then((payload) => payload.receipts);
|
|
4144
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/receipts`).then((payload) => payload.receipts);
|
|
4149
4145
|
}
|
|
4150
4146
|
logs(sandboxId) {
|
|
4151
|
-
return this.request(
|
|
4152
|
-
`/${encodeURIComponent(sandboxId)}/logs`
|
|
4153
|
-
).then((payload) => payload.logs);
|
|
4147
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/logs`).then((payload) => payload.logs);
|
|
4154
4148
|
}
|
|
4155
4149
|
gitStatus(sandboxId) {
|
|
4156
|
-
return this.request(
|
|
4157
|
-
`/${encodeURIComponent(sandboxId)}/git/status`
|
|
4158
|
-
);
|
|
4150
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/git/status`);
|
|
4159
4151
|
}
|
|
4160
4152
|
gitDiff(sandboxId, input = {}) {
|
|
4161
|
-
return this.request(
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
body: JSON.stringify(input)
|
|
4166
|
-
}
|
|
4167
|
-
);
|
|
4153
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/git/diff`, {
|
|
4154
|
+
method: "POST",
|
|
4155
|
+
body: JSON.stringify(input)
|
|
4156
|
+
});
|
|
4168
4157
|
}
|
|
4169
4158
|
gitExportPatch(sandboxId, input = {}) {
|
|
4170
|
-
return this.request(
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
body: JSON.stringify(input)
|
|
4175
|
-
}
|
|
4176
|
-
);
|
|
4159
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/git/export-patch`, {
|
|
4160
|
+
method: "POST",
|
|
4161
|
+
body: JSON.stringify(input)
|
|
4162
|
+
});
|
|
4177
4163
|
}
|
|
4178
4164
|
gitBranch(sandboxId, input) {
|
|
4179
|
-
return this.request(
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
body: JSON.stringify(input)
|
|
4184
|
-
}
|
|
4185
|
-
);
|
|
4165
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/git/branch`, {
|
|
4166
|
+
method: "POST",
|
|
4167
|
+
body: JSON.stringify(input)
|
|
4168
|
+
});
|
|
4186
4169
|
}
|
|
4187
4170
|
gitCommit(sandboxId, input) {
|
|
4188
|
-
return this.request(
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
body: JSON.stringify(input)
|
|
4193
|
-
}
|
|
4194
|
-
);
|
|
4171
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/git/commit`, {
|
|
4172
|
+
method: "POST",
|
|
4173
|
+
body: JSON.stringify(input)
|
|
4174
|
+
});
|
|
4195
4175
|
}
|
|
4196
4176
|
gitPull(sandboxId, input = {}) {
|
|
4197
|
-
return this.request(
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
body: JSON.stringify(input)
|
|
4202
|
-
}
|
|
4203
|
-
);
|
|
4177
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/git/pull`, {
|
|
4178
|
+
method: "POST",
|
|
4179
|
+
body: JSON.stringify(input)
|
|
4180
|
+
});
|
|
4204
4181
|
}
|
|
4205
4182
|
gitPush(sandboxId, input = {}) {
|
|
4206
|
-
return this.request(
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
body: JSON.stringify(input)
|
|
4211
|
-
}
|
|
4212
|
-
);
|
|
4183
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/git/push`, {
|
|
4184
|
+
method: "POST",
|
|
4185
|
+
body: JSON.stringify(input)
|
|
4186
|
+
});
|
|
4213
4187
|
}
|
|
4214
4188
|
billing(sandboxId) {
|
|
4215
|
-
return this.request(
|
|
4216
|
-
`/${encodeURIComponent(sandboxId)}/billing`
|
|
4217
|
-
);
|
|
4189
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/billing`);
|
|
4218
4190
|
}
|
|
4219
4191
|
pricing() {
|
|
4220
4192
|
return this.request("/pricing");
|
|
4221
4193
|
}
|
|
4222
4194
|
costs(input = {}) {
|
|
4223
4195
|
const query = new URLSearchParams();
|
|
4224
|
-
if (input.teamId)
|
|
4225
|
-
|
|
4226
|
-
if (input.
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4196
|
+
if (input.teamId)
|
|
4197
|
+
query.set("teamId", input.teamId);
|
|
4198
|
+
if (input.projectId)
|
|
4199
|
+
query.set("projectId", input.projectId);
|
|
4200
|
+
if (input.agentId)
|
|
4201
|
+
query.set("agentId", input.agentId);
|
|
4202
|
+
return this.request(`/costs${query.size > 0 ? `?${query.toString()}` : ""}`);
|
|
4230
4203
|
}
|
|
4231
4204
|
integrationLeases(sandboxId) {
|
|
4232
|
-
return this.request(
|
|
4233
|
-
`/${encodeURIComponent(sandboxId)}/integrations`
|
|
4234
|
-
);
|
|
4205
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/integrations`);
|
|
4235
4206
|
}
|
|
4236
4207
|
attachIntegrationConnection(sandboxId, input) {
|
|
4237
|
-
return this.request(
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
body: JSON.stringify(input)
|
|
4242
|
-
}
|
|
4243
|
-
);
|
|
4208
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/integrations`, {
|
|
4209
|
+
method: "POST",
|
|
4210
|
+
body: JSON.stringify(input)
|
|
4211
|
+
});
|
|
4244
4212
|
}
|
|
4245
4213
|
removeIntegrationLease(sandboxId, leaseId) {
|
|
4246
|
-
return this.request(
|
|
4247
|
-
|
|
4248
|
-
{
|
|
4249
|
-
|
|
4250
|
-
body: JSON.stringify({ leaseId })
|
|
4251
|
-
}
|
|
4252
|
-
);
|
|
4214
|
+
return this.request(`/${encodeURIComponent(sandboxId)}/integrations`, {
|
|
4215
|
+
method: "DELETE",
|
|
4216
|
+
body: JSON.stringify({ leaseId })
|
|
4217
|
+
});
|
|
4253
4218
|
}
|
|
4254
4219
|
async request(path10, init = {}) {
|
|
4255
|
-
const response = await
|
|
4256
|
-
|
|
4257
|
-
this.apiKey,
|
|
4258
|
-
path10,
|
|
4259
|
-
init
|
|
4260
|
-
);
|
|
4261
|
-
return readApiJson(response, "Sandbox request");
|
|
4220
|
+
const response = await apiFetch2(this.sandboxApiUrl, this.apiKey, path10, init);
|
|
4221
|
+
return readApiJson2(response, "Sandbox request");
|
|
4262
4222
|
}
|
|
4263
4223
|
async requestApiRoot(path10, init = {}) {
|
|
4264
|
-
const response = await
|
|
4265
|
-
return
|
|
4224
|
+
const response = await apiFetch2(this.apiRootUrl, this.apiKey, path10, init);
|
|
4225
|
+
return readApiJson2(response, "OpenPond API request");
|
|
4266
4226
|
}
|
|
4267
4227
|
};
|
|
4268
4228
|
|
|
4269
|
-
// ../../packages/cloud/
|
|
4229
|
+
// ../../packages/cloud/dist/sandbox/client.js
|
|
4270
4230
|
var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
4271
4231
|
runtimes = createSandboxRuntimeNamespace(this);
|
|
4272
4232
|
sandboxes = createSandboxNamespace(this);
|
|
4273
4233
|
profile = createSandboxProfileNamespace(this);
|
|
4274
4234
|
projects = createSandboxProjectNamespace(this);
|
|
4275
4235
|
agents = createSandboxAgentNamespace(this);
|
|
4276
|
-
workItems = createSandboxWorkItemNamespace(this);
|
|
4277
4236
|
list(input = {}) {
|
|
4278
4237
|
const query = new URLSearchParams();
|
|
4279
|
-
if (input.teamId)
|
|
4280
|
-
|
|
4281
|
-
if (input.
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4238
|
+
if (input.teamId)
|
|
4239
|
+
query.set("teamId", input.teamId);
|
|
4240
|
+
if (input.projectId)
|
|
4241
|
+
query.set("projectId", input.projectId);
|
|
4242
|
+
if (input.agentId)
|
|
4243
|
+
query.set("agentId", input.agentId);
|
|
4244
|
+
return this.request(query.size > 0 ? `?${query.toString()}` : "").then((payload) => payload.sandboxes);
|
|
4285
4245
|
}
|
|
4286
4246
|
listSecrets(input = {}) {
|
|
4287
4247
|
const query = new URLSearchParams();
|
|
4288
|
-
if (input.teamId)
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
).then((payload) => payload.secrets);
|
|
4248
|
+
if (input.teamId)
|
|
4249
|
+
query.set("teamId", input.teamId);
|
|
4250
|
+
return this.requestApiRoot(`/sandbox-secrets${query.size > 0 ? `?${query.toString()}` : ""}`).then((payload) => payload.secrets);
|
|
4292
4251
|
}
|
|
4293
4252
|
getSecret(secretId, input = {}) {
|
|
4294
4253
|
const query = new URLSearchParams();
|
|
4295
|
-
if (input.teamId)
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
).then((payload) => payload.secret);
|
|
4254
|
+
if (input.teamId)
|
|
4255
|
+
query.set("teamId", input.teamId);
|
|
4256
|
+
return this.requestApiRoot(`/sandbox-secrets/${encodeURIComponent(secretId)}${query.size > 0 ? `?${query.toString()}` : ""}`).then((payload) => payload.secret);
|
|
4299
4257
|
}
|
|
4300
4258
|
createSecret(input) {
|
|
4301
4259
|
return this.requestApiRoot("/sandbox-secrets", {
|
|
@@ -4305,74 +4263,73 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
4305
4263
|
}
|
|
4306
4264
|
rotateSecret(secretId, input) {
|
|
4307
4265
|
const query = new URLSearchParams();
|
|
4308
|
-
if (input.teamId)
|
|
4266
|
+
if (input.teamId)
|
|
4267
|
+
query.set("teamId", input.teamId);
|
|
4309
4268
|
const { teamId: _teamId, ...body } = input;
|
|
4310
|
-
return this.requestApiRoot(
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
body: JSON.stringify(body)
|
|
4315
|
-
}
|
|
4316
|
-
).then((payload) => payload.secret);
|
|
4269
|
+
return this.requestApiRoot(`/sandbox-secrets/${encodeURIComponent(secretId)}/rotate${query.size > 0 ? `?${query.toString()}` : ""}`, {
|
|
4270
|
+
method: "POST",
|
|
4271
|
+
body: JSON.stringify(body)
|
|
4272
|
+
}).then((payload) => payload.secret);
|
|
4317
4273
|
}
|
|
4318
4274
|
attachSecret(secretId, input) {
|
|
4319
4275
|
const query = new URLSearchParams();
|
|
4320
|
-
if (input.teamId)
|
|
4276
|
+
if (input.teamId)
|
|
4277
|
+
query.set("teamId", input.teamId);
|
|
4321
4278
|
const { teamId: _teamId, ...body } = input;
|
|
4322
|
-
return this.requestApiRoot(
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
body: JSON.stringify(body)
|
|
4327
|
-
}
|
|
4328
|
-
).then((payload) => payload.secret);
|
|
4279
|
+
return this.requestApiRoot(`/sandbox-secrets/${encodeURIComponent(secretId)}/attach${query.size > 0 ? `?${query.toString()}` : ""}`, {
|
|
4280
|
+
method: "POST",
|
|
4281
|
+
body: JSON.stringify(body)
|
|
4282
|
+
}).then((payload) => payload.secret);
|
|
4329
4283
|
}
|
|
4330
4284
|
revokeSecret(secretId, input = {}) {
|
|
4331
4285
|
const query = new URLSearchParams();
|
|
4332
|
-
if (input.teamId)
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
{ method: "POST" }
|
|
4336
|
-
).then((payload) => payload.secret);
|
|
4286
|
+
if (input.teamId)
|
|
4287
|
+
query.set("teamId", input.teamId);
|
|
4288
|
+
return this.requestApiRoot(`/sandbox-secrets/${encodeURIComponent(secretId)}/revoke${query.size > 0 ? `?${query.toString()}` : ""}`, { method: "POST" }).then((payload) => payload.secret);
|
|
4337
4289
|
}
|
|
4338
4290
|
deleteSecret(secretId, input = {}) {
|
|
4339
4291
|
const query = new URLSearchParams();
|
|
4340
|
-
if (input.teamId)
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
{ method: "DELETE" }
|
|
4344
|
-
).then((payload) => payload.secret);
|
|
4292
|
+
if (input.teamId)
|
|
4293
|
+
query.set("teamId", input.teamId);
|
|
4294
|
+
return this.requestApiRoot(`/sandbox-secrets/${encodeURIComponent(secretId)}${query.size > 0 ? `?${query.toString()}` : ""}`, { method: "DELETE" }).then((payload) => payload.secret);
|
|
4345
4295
|
}
|
|
4346
4296
|
snapshotCatalog(input = {}) {
|
|
4347
4297
|
const query = new URLSearchParams();
|
|
4348
|
-
if (input.teamId)
|
|
4349
|
-
|
|
4350
|
-
if (input.
|
|
4351
|
-
|
|
4352
|
-
if (input.
|
|
4353
|
-
|
|
4354
|
-
if (input.
|
|
4355
|
-
|
|
4356
|
-
if (input.
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
)
|
|
4298
|
+
if (input.teamId)
|
|
4299
|
+
query.set("teamId", input.teamId);
|
|
4300
|
+
if (input.projectId)
|
|
4301
|
+
query.set("projectId", input.projectId);
|
|
4302
|
+
if (input.agentId)
|
|
4303
|
+
query.set("agentId", input.agentId);
|
|
4304
|
+
if (input.q)
|
|
4305
|
+
query.set("q", input.q);
|
|
4306
|
+
if (input.kind)
|
|
4307
|
+
query.set("kind", input.kind);
|
|
4308
|
+
if (input.replayState)
|
|
4309
|
+
query.set("replayState", input.replayState);
|
|
4310
|
+
if (input.visibility)
|
|
4311
|
+
query.set("visibility", input.visibility);
|
|
4312
|
+
if (input.tag)
|
|
4313
|
+
query.set("tag", input.tag);
|
|
4314
|
+
if (input.useCase)
|
|
4315
|
+
query.set("useCase", input.useCase);
|
|
4316
|
+
if (input.limit)
|
|
4317
|
+
query.set("limit", String(input.limit));
|
|
4318
|
+
return this.request(`/catalog/snapshots${query.size > 0 ? `?${query.toString()}` : ""}`);
|
|
4361
4319
|
}
|
|
4362
4320
|
listSandboxRuntimes(input = {}) {
|
|
4363
4321
|
const query = new URLSearchParams();
|
|
4364
|
-
if (input.teamId)
|
|
4365
|
-
|
|
4366
|
-
if (input.
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4322
|
+
if (input.teamId)
|
|
4323
|
+
query.set("teamId", input.teamId);
|
|
4324
|
+
if (input.projectId)
|
|
4325
|
+
query.set("projectId", input.projectId);
|
|
4326
|
+
if (input.agentId)
|
|
4327
|
+
query.set("agentId", input.agentId);
|
|
4328
|
+
return this.requestApiRoot(`/runtimes${query.size > 0 ? `?${query.toString()}` : ""}`).then((payload) => payload.runtimes);
|
|
4370
4329
|
}
|
|
4371
4330
|
listProjects(input) {
|
|
4372
4331
|
const query = new URLSearchParams({ teamId: input.teamId });
|
|
4373
|
-
return this.requestApiRoot(
|
|
4374
|
-
`/projects?${query.toString()}`
|
|
4375
|
-
).then((payload) => payload.projects);
|
|
4332
|
+
return this.requestApiRoot(`/projects?${query.toString()}`).then((payload) => payload.projects);
|
|
4376
4333
|
}
|
|
4377
4334
|
upsertProject(input) {
|
|
4378
4335
|
return this.requestApiRoot("/projects", {
|
|
@@ -4382,16 +4339,11 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
4382
4339
|
}
|
|
4383
4340
|
getHostedProfile(input) {
|
|
4384
4341
|
const query = new URLSearchParams({ teamId: input.teamId });
|
|
4385
|
-
return this.requestApiRoot(
|
|
4386
|
-
`/profile?${query.toString()}`
|
|
4387
|
-
).then((payload) => payload.profile);
|
|
4342
|
+
return this.requestApiRoot(`/profile?${query.toString()}`).then((payload) => payload.profile);
|
|
4388
4343
|
}
|
|
4389
4344
|
ensureHostedProfile(input) {
|
|
4390
4345
|
const query = new URLSearchParams({ teamId: input.teamId });
|
|
4391
|
-
return this.requestApiRoot(
|
|
4392
|
-
`/profile/ensure?${query.toString()}`,
|
|
4393
|
-
{ method: "POST" }
|
|
4394
|
-
).then((payload) => {
|
|
4346
|
+
return this.requestApiRoot(`/profile/ensure?${query.toString()}`, { method: "POST" }).then((payload) => {
|
|
4395
4347
|
if (!payload.profile) {
|
|
4396
4348
|
throw new Error("hosted_profile_missing");
|
|
4397
4349
|
}
|
|
@@ -4401,13 +4353,10 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
4401
4353
|
pushHostedProfile(input) {
|
|
4402
4354
|
const query = new URLSearchParams({ teamId: input.teamId });
|
|
4403
4355
|
const { teamId: _teamId, ...body } = input;
|
|
4404
|
-
return this.requestApiRoot(
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
body: JSON.stringify(body)
|
|
4409
|
-
}
|
|
4410
|
-
);
|
|
4356
|
+
return this.requestApiRoot(`/profile/push?${query.toString()}`, {
|
|
4357
|
+
method: "POST",
|
|
4358
|
+
body: JSON.stringify(body)
|
|
4359
|
+
});
|
|
4411
4360
|
}
|
|
4412
4361
|
async upsertProjectGitRemote(input) {
|
|
4413
4362
|
const project = await this.upsertProject(input);
|
|
@@ -4415,58 +4364,39 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
4415
4364
|
}
|
|
4416
4365
|
getProject(projectId, input) {
|
|
4417
4366
|
const query = new URLSearchParams({ teamId: input.teamId });
|
|
4418
|
-
return this.requestApiRoot(
|
|
4419
|
-
`/projects/${encodeURIComponent(projectId)}?${query.toString()}`
|
|
4420
|
-
).then((payload) => payload.project);
|
|
4367
|
+
return this.requestApiRoot(`/projects/${encodeURIComponent(projectId)}?${query.toString()}`).then((payload) => payload.project);
|
|
4421
4368
|
}
|
|
4422
4369
|
syncProject(projectId, input) {
|
|
4423
4370
|
const query = new URLSearchParams({ teamId: input.teamId });
|
|
4424
|
-
return this.requestApiRoot(
|
|
4425
|
-
`/projects/${encodeURIComponent(projectId)}/sync?${query.toString()}`,
|
|
4426
|
-
{ method: "POST" }
|
|
4427
|
-
).then((payload) => payload.project);
|
|
4371
|
+
return this.requestApiRoot(`/projects/${encodeURIComponent(projectId)}/sync?${query.toString()}`, { method: "POST" }).then((payload) => payload.project);
|
|
4428
4372
|
}
|
|
4429
4373
|
ensureProjectGitRemote(projectId, input) {
|
|
4430
4374
|
const query = new URLSearchParams({ teamId: input.teamId });
|
|
4431
|
-
return this.requestApiRoot(
|
|
4432
|
-
`/projects/${encodeURIComponent(projectId)}/git?${query.toString()}`,
|
|
4433
|
-
{ method: "POST" }
|
|
4434
|
-
);
|
|
4375
|
+
return this.requestApiRoot(`/projects/${encodeURIComponent(projectId)}/git?${query.toString()}`, { method: "POST" });
|
|
4435
4376
|
}
|
|
4436
4377
|
uploadProjectSource(projectId, input) {
|
|
4437
4378
|
const query = new URLSearchParams({ teamId: input.teamId });
|
|
4438
4379
|
const { teamId: _teamId, ...body } = input;
|
|
4439
|
-
return this.requestApiRoot(
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
body: JSON.stringify(body)
|
|
4444
|
-
}
|
|
4445
|
-
).then((payload) => payload.project);
|
|
4380
|
+
return this.requestApiRoot(`/projects/${encodeURIComponent(projectId)}/source?${query.toString()}`, {
|
|
4381
|
+
method: "POST",
|
|
4382
|
+
body: JSON.stringify(body)
|
|
4383
|
+
}).then((payload) => payload.project);
|
|
4446
4384
|
}
|
|
4447
4385
|
updateProject(projectId, input) {
|
|
4448
4386
|
const query = new URLSearchParams({ teamId: input.teamId });
|
|
4449
4387
|
const { teamId: _teamId, ...body } = input;
|
|
4450
|
-
return this.requestApiRoot(
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
body: JSON.stringify(body)
|
|
4455
|
-
}
|
|
4456
|
-
).then((payload) => payload.project);
|
|
4388
|
+
return this.requestApiRoot(`/projects/${encodeURIComponent(projectId)}?${query.toString()}`, {
|
|
4389
|
+
method: "PATCH",
|
|
4390
|
+
body: JSON.stringify(body)
|
|
4391
|
+
}).then((payload) => payload.project);
|
|
4457
4392
|
}
|
|
4458
4393
|
archiveProject(projectId, input) {
|
|
4459
4394
|
const query = new URLSearchParams({ teamId: input.teamId });
|
|
4460
|
-
return this.requestApiRoot(
|
|
4461
|
-
`/projects/${encodeURIComponent(projectId)}?${query.toString()}`,
|
|
4462
|
-
{ method: "DELETE" }
|
|
4463
|
-
).then((payload) => payload.project);
|
|
4395
|
+
return this.requestApiRoot(`/projects/${encodeURIComponent(projectId)}?${query.toString()}`, { method: "DELETE" }).then((payload) => payload.project);
|
|
4464
4396
|
}
|
|
4465
4397
|
listAgents(input) {
|
|
4466
4398
|
const query = new URLSearchParams({ teamId: input.teamId });
|
|
4467
|
-
return this.requestApiRoot(
|
|
4468
|
-
`/agents?${query.toString()}`
|
|
4469
|
-
).then((payload) => payload.agents);
|
|
4399
|
+
return this.requestApiRoot(`/agents?${query.toString()}`).then((payload) => payload.agents);
|
|
4470
4400
|
}
|
|
4471
4401
|
upsertAgent(input) {
|
|
4472
4402
|
return this.requestApiRoot("/agents", {
|
|
@@ -4476,179 +4406,76 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
4476
4406
|
}
|
|
4477
4407
|
getAgent(agentId, input) {
|
|
4478
4408
|
const query = new URLSearchParams({ teamId: input.teamId });
|
|
4479
|
-
return this.requestApiRoot(
|
|
4480
|
-
`/agents/${encodeURIComponent(agentId)}?${query.toString()}`
|
|
4481
|
-
).then((payload) => payload.agent);
|
|
4409
|
+
return this.requestApiRoot(`/agents/${encodeURIComponent(agentId)}?${query.toString()}`).then((payload) => payload.agent);
|
|
4482
4410
|
}
|
|
4483
4411
|
archiveAgent(agentId, input) {
|
|
4484
4412
|
const query = new URLSearchParams({ teamId: input.teamId });
|
|
4485
|
-
return this.requestApiRoot(
|
|
4486
|
-
`/agents/${encodeURIComponent(agentId)}?${query.toString()}`,
|
|
4487
|
-
{ method: "DELETE" }
|
|
4488
|
-
).then((payload) => payload.agent);
|
|
4413
|
+
return this.requestApiRoot(`/agents/${encodeURIComponent(agentId)}?${query.toString()}`, { method: "DELETE" }).then((payload) => payload.agent);
|
|
4489
4414
|
}
|
|
4490
4415
|
updateAgent(agentId, input) {
|
|
4491
4416
|
const query = new URLSearchParams({ teamId: input.teamId });
|
|
4492
4417
|
const { teamId: _teamId, ...body } = input;
|
|
4493
|
-
return this.requestApiRoot(
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
body: JSON.stringify(body)
|
|
4498
|
-
}
|
|
4499
|
-
).then((payload) => payload.agent);
|
|
4418
|
+
return this.requestApiRoot(`/agents/${encodeURIComponent(agentId)}?${query.toString()}`, {
|
|
4419
|
+
method: "PATCH",
|
|
4420
|
+
body: JSON.stringify(body)
|
|
4421
|
+
}).then((payload) => payload.agent);
|
|
4500
4422
|
}
|
|
4501
4423
|
runAgent(agentId, input) {
|
|
4502
|
-
return this.requestApiRoot(
|
|
4503
|
-
|
|
4504
|
-
{
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
body: JSON.stringify(input)
|
|
4510
|
-
}
|
|
4511
|
-
);
|
|
4424
|
+
return this.requestApiRoot(`/agents/${encodeURIComponent(agentId)}/run`, {
|
|
4425
|
+
method: "POST",
|
|
4426
|
+
headers: {
|
|
4427
|
+
Prefer: "respond-async"
|
|
4428
|
+
},
|
|
4429
|
+
body: JSON.stringify(input)
|
|
4430
|
+
});
|
|
4512
4431
|
}
|
|
4513
4432
|
getAgentSourceDeployPlan(agentId, input) {
|
|
4514
4433
|
const query = new URLSearchParams({ teamId: input.teamId });
|
|
4515
|
-
return this.requestApiRoot(
|
|
4516
|
-
`/agents/${encodeURIComponent(
|
|
4517
|
-
agentId
|
|
4518
|
-
)}/source/deploy-plan?${query.toString()}`
|
|
4519
|
-
).then((payload) => payload.deployPlan);
|
|
4434
|
+
return this.requestApiRoot(`/agents/${encodeURIComponent(agentId)}/source/deploy-plan?${query.toString()}`).then((payload) => payload.deployPlan);
|
|
4520
4435
|
}
|
|
4521
4436
|
listAgentManifestSnapshots(agentId, input) {
|
|
4522
4437
|
const query = new URLSearchParams({ teamId: input.teamId });
|
|
4523
|
-
if (input.limit !== void 0)
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
agentId
|
|
4527
|
-
)}/source/manifest-snapshots?${query.toString()}`
|
|
4528
|
-
).then((payload) => payload.manifestSnapshots);
|
|
4438
|
+
if (input.limit !== void 0)
|
|
4439
|
+
query.set("limit", String(input.limit));
|
|
4440
|
+
return this.requestApiRoot(`/agents/${encodeURIComponent(agentId)}/source/manifest-snapshots?${query.toString()}`).then((payload) => payload.manifestSnapshots);
|
|
4529
4441
|
}
|
|
4530
4442
|
requestAgentSourceChecks(agentId, input) {
|
|
4531
4443
|
const query = new URLSearchParams({ teamId: input.teamId });
|
|
4532
4444
|
const { teamId: _teamId, ...body } = input;
|
|
4533
|
-
return this.requestApiRoot(
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
{
|
|
4538
|
-
method: "POST",
|
|
4539
|
-
body: JSON.stringify(body)
|
|
4540
|
-
}
|
|
4541
|
-
);
|
|
4445
|
+
return this.requestApiRoot(`/agents/${encodeURIComponent(agentId)}/source/checks?${query.toString()}`, {
|
|
4446
|
+
method: "POST",
|
|
4447
|
+
body: JSON.stringify(body)
|
|
4448
|
+
});
|
|
4542
4449
|
}
|
|
4543
4450
|
publishAgentSource(agentId, input) {
|
|
4544
4451
|
const query = new URLSearchParams({ teamId: input.teamId });
|
|
4545
4452
|
const { teamId: _teamId, ...body } = input;
|
|
4546
|
-
return this.requestApiRoot(
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
{
|
|
4551
|
-
method: "POST",
|
|
4552
|
-
body: JSON.stringify(body)
|
|
4553
|
-
}
|
|
4554
|
-
);
|
|
4555
|
-
}
|
|
4556
|
-
openAgentEditWorkItem(agentId, input) {
|
|
4557
|
-
const query = new URLSearchParams({ teamId: input.teamId });
|
|
4558
|
-
const { teamId: _teamId, ...body } = input;
|
|
4559
|
-
return this.requestApiRoot(
|
|
4560
|
-
`/agents/${encodeURIComponent(
|
|
4561
|
-
agentId
|
|
4562
|
-
)}/edit-work-item?${query.toString()}`,
|
|
4563
|
-
{
|
|
4564
|
-
method: "POST",
|
|
4565
|
-
body: JSON.stringify(body)
|
|
4566
|
-
}
|
|
4567
|
-
);
|
|
4568
|
-
}
|
|
4569
|
-
getCodingWorkItem(workItemId, input) {
|
|
4570
|
-
const query = new URLSearchParams({ teamId: input.teamId });
|
|
4571
|
-
if (input.includeArchived) query.set("includeArchived", "true");
|
|
4572
|
-
return this.requestApiRoot(
|
|
4573
|
-
`/work-items/${encodeURIComponent(workItemId)}?${query.toString()}`
|
|
4574
|
-
).then((payload) => payload.workItem);
|
|
4575
|
-
}
|
|
4576
|
-
sendCodingWorkItemChat(workItemId, input) {
|
|
4577
|
-
return this.requestApiRoot(
|
|
4578
|
-
`/work-items/${encodeURIComponent(workItemId)}/chat`,
|
|
4579
|
-
{
|
|
4580
|
-
method: "POST",
|
|
4581
|
-
body: JSON.stringify(input)
|
|
4582
|
-
}
|
|
4583
|
-
);
|
|
4584
|
-
}
|
|
4585
|
-
listCodingWorkItemActivity(workItemId, input) {
|
|
4586
|
-
const query = new URLSearchParams({ teamId: input.teamId });
|
|
4587
|
-
if (input.limit !== void 0) query.set("limit", String(input.limit));
|
|
4588
|
-
return this.requestApiRoot(
|
|
4589
|
-
`/work-items/${encodeURIComponent(
|
|
4590
|
-
workItemId
|
|
4591
|
-
)}/activity?${query.toString()}`
|
|
4592
|
-
).then((payload) => payload.activity);
|
|
4593
|
-
}
|
|
4594
|
-
getCodingWorkItemStatus(workItemId, input) {
|
|
4595
|
-
const query = new URLSearchParams({ teamId: input.teamId });
|
|
4596
|
-
if (input.limit !== void 0) query.set("limit", String(input.limit));
|
|
4597
|
-
if (input.includeArchived) query.set("includeArchived", "true");
|
|
4598
|
-
return this.requestApiRoot(
|
|
4599
|
-
`/work-items/${encodeURIComponent(workItemId)}/status?${query.toString()}`
|
|
4600
|
-
);
|
|
4601
|
-
}
|
|
4602
|
-
handleCodingWorkItemInBackground(workItemId, input) {
|
|
4603
|
-
return this.requestApiRoot(
|
|
4604
|
-
`/work-items/${encodeURIComponent(workItemId)}/handle-background`,
|
|
4605
|
-
{
|
|
4606
|
-
method: "POST",
|
|
4607
|
-
body: JSON.stringify(input)
|
|
4608
|
-
}
|
|
4609
|
-
);
|
|
4610
|
-
}
|
|
4611
|
-
promoteCodingWorkItemResult(workItemId, action, input) {
|
|
4612
|
-
return this.requestApiRoot(
|
|
4613
|
-
`/work-items/${encodeURIComponent(workItemId)}/result/${action}`,
|
|
4614
|
-
{
|
|
4615
|
-
method: "POST",
|
|
4616
|
-
body: JSON.stringify(input)
|
|
4617
|
-
}
|
|
4618
|
-
).then((payload) => payload.artifact);
|
|
4453
|
+
return this.requestApiRoot(`/agents/${encodeURIComponent(agentId)}/source/publish?${query.toString()}`, {
|
|
4454
|
+
method: "POST",
|
|
4455
|
+
body: JSON.stringify(body)
|
|
4456
|
+
});
|
|
4619
4457
|
}
|
|
4620
4458
|
getMicrosoftTeamsBotOverview(input) {
|
|
4621
4459
|
const query = new URLSearchParams({ teamId: input.teamId });
|
|
4622
|
-
return this.requestApiRoot(
|
|
4623
|
-
`/teams/bot/overview?${query.toString()}`
|
|
4624
|
-
);
|
|
4460
|
+
return this.requestApiRoot(`/teams/bot/overview?${query.toString()}`);
|
|
4625
4461
|
}
|
|
4626
4462
|
bindMicrosoftTeamsBotConversation(input) {
|
|
4627
|
-
return this.requestApiRoot(
|
|
4628
|
-
"
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
body: JSON.stringify(input)
|
|
4632
|
-
}
|
|
4633
|
-
);
|
|
4463
|
+
return this.requestApiRoot("/teams/bot/bindings", {
|
|
4464
|
+
method: "POST",
|
|
4465
|
+
body: JSON.stringify(input)
|
|
4466
|
+
});
|
|
4634
4467
|
}
|
|
4635
4468
|
rebindMicrosoftTeamsBotConversation(bindingId, input) {
|
|
4636
|
-
return this.requestApiRoot(
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
body: JSON.stringify(input)
|
|
4641
|
-
}
|
|
4642
|
-
);
|
|
4469
|
+
return this.requestApiRoot(`/teams/bot/bindings/${encodeURIComponent(bindingId)}`, {
|
|
4470
|
+
method: "PATCH",
|
|
4471
|
+
body: JSON.stringify(input)
|
|
4472
|
+
});
|
|
4643
4473
|
}
|
|
4644
4474
|
unlinkMicrosoftTeamsBotConversation(input) {
|
|
4645
|
-
return this.requestApiRoot(
|
|
4646
|
-
|
|
4647
|
-
{
|
|
4648
|
-
|
|
4649
|
-
body: JSON.stringify({ teamId: input.teamId })
|
|
4650
|
-
}
|
|
4651
|
-
);
|
|
4475
|
+
return this.requestApiRoot(`/teams/bot/bindings/${encodeURIComponent(input.bindingId)}`, {
|
|
4476
|
+
method: "DELETE",
|
|
4477
|
+
body: JSON.stringify({ teamId: input.teamId })
|
|
4478
|
+
});
|
|
4652
4479
|
}
|
|
4653
4480
|
sendMicrosoftTeamsBotDiagnostic(input) {
|
|
4654
4481
|
return this.requestApiRoot("/teams/bot/diagnostics", {
|
|
@@ -4657,13 +4484,10 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
4657
4484
|
});
|
|
4658
4485
|
}
|
|
4659
4486
|
sendMicrosoftTeamsBotDiagnosticRun(input) {
|
|
4660
|
-
return this.requestApiRoot(
|
|
4661
|
-
"
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
body: JSON.stringify(input)
|
|
4665
|
-
}
|
|
4666
|
-
);
|
|
4487
|
+
return this.requestApiRoot("/teams/bot/diagnostics/run", {
|
|
4488
|
+
method: "POST",
|
|
4489
|
+
body: JSON.stringify(input)
|
|
4490
|
+
});
|
|
4667
4491
|
}
|
|
4668
4492
|
createSandboxRuntime(input) {
|
|
4669
4493
|
return this.requestApiRoot("/runtimes", {
|
|
@@ -4675,121 +4499,115 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
4675
4499
|
return createSandboxRuntimeHandle(this, runtimeId, initial);
|
|
4676
4500
|
}
|
|
4677
4501
|
getSandboxRuntime(runtimeId) {
|
|
4678
|
-
return this.requestApiRoot(
|
|
4679
|
-
`/runtimes/${encodeURIComponent(runtimeId)}`
|
|
4680
|
-
).then((payload) => payload.runtime);
|
|
4502
|
+
return this.requestApiRoot(`/runtimes/${encodeURIComponent(runtimeId)}`).then((payload) => payload.runtime);
|
|
4681
4503
|
}
|
|
4682
4504
|
createSandboxRuntimeSandbox(runtimeId, input = {}, options = {}) {
|
|
4683
|
-
return this.requestApiRoot(
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
body: JSON.stringify(input)
|
|
4689
|
-
}
|
|
4690
|
-
);
|
|
4505
|
+
return this.requestApiRoot(`/runtimes/${encodeURIComponent(runtimeId)}/sandbox`, {
|
|
4506
|
+
method: "POST",
|
|
4507
|
+
headers: asyncRequestHeaders(options),
|
|
4508
|
+
body: JSON.stringify(input)
|
|
4509
|
+
});
|
|
4691
4510
|
}
|
|
4692
4511
|
updateSandboxRuntimeStatus(runtimeId, input) {
|
|
4693
|
-
return this.requestApiRoot(
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
body: JSON.stringify(input)
|
|
4698
|
-
}
|
|
4699
|
-
).then((payload) => payload.runtime);
|
|
4512
|
+
return this.requestApiRoot(`/runtimes/${encodeURIComponent(runtimeId)}/status`, {
|
|
4513
|
+
method: "PATCH",
|
|
4514
|
+
body: JSON.stringify(input)
|
|
4515
|
+
}).then((payload) => payload.runtime);
|
|
4700
4516
|
}
|
|
4701
4517
|
listSandboxRuntimeEvents(runtimeId) {
|
|
4702
|
-
return this.requestApiRoot(
|
|
4703
|
-
`/runtimes/${encodeURIComponent(runtimeId)}/events`
|
|
4704
|
-
);
|
|
4518
|
+
return this.requestApiRoot(`/runtimes/${encodeURIComponent(runtimeId)}/events`);
|
|
4705
4519
|
}
|
|
4706
4520
|
emitSandboxRuntimeEvent(runtimeId, input) {
|
|
4707
|
-
return this.requestApiRoot(
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
body: JSON.stringify(input)
|
|
4712
|
-
}
|
|
4713
|
-
);
|
|
4521
|
+
return this.requestApiRoot(`/runtimes/${encodeURIComponent(runtimeId)}/events`, {
|
|
4522
|
+
method: "POST",
|
|
4523
|
+
body: JSON.stringify(input)
|
|
4524
|
+
});
|
|
4714
4525
|
}
|
|
4715
4526
|
checkpointSandboxRuntime(runtimeId, input) {
|
|
4716
|
-
return this.requestApiRoot(
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
body: JSON.stringify(input)
|
|
4721
|
-
}
|
|
4722
|
-
).then((payload) => payload.runtime);
|
|
4527
|
+
return this.requestApiRoot(`/runtimes/${encodeURIComponent(runtimeId)}/checkpoints`, {
|
|
4528
|
+
method: "POST",
|
|
4529
|
+
body: JSON.stringify(input)
|
|
4530
|
+
}).then((payload) => payload.runtime);
|
|
4723
4531
|
}
|
|
4724
4532
|
promoteSandboxRuntime(runtimeId, input, options = {}) {
|
|
4725
4533
|
const query = new URLSearchParams();
|
|
4726
|
-
if (options.teamId)
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
}
|
|
4733
|
-
);
|
|
4534
|
+
if (options.teamId)
|
|
4535
|
+
query.set("teamId", options.teamId);
|
|
4536
|
+
return this.requestApiRoot(`/runtimes/${encodeURIComponent(runtimeId)}/promote${query.size > 0 ? `?${query.toString()}` : ""}`, {
|
|
4537
|
+
method: "POST",
|
|
4538
|
+
body: JSON.stringify(input)
|
|
4539
|
+
});
|
|
4734
4540
|
}
|
|
4735
4541
|
preserveSandboxRuntimeSource(runtimeId, input = {}, options = {}) {
|
|
4736
4542
|
const query = new URLSearchParams();
|
|
4737
|
-
if (options.teamId)
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
}
|
|
4744
|
-
);
|
|
4543
|
+
if (options.teamId)
|
|
4544
|
+
query.set("teamId", options.teamId);
|
|
4545
|
+
return this.requestApiRoot(`/runtimes/${encodeURIComponent(runtimeId)}/preserve-source${query.size > 0 ? `?${query.toString()}` : ""}`, {
|
|
4546
|
+
method: "POST",
|
|
4547
|
+
body: JSON.stringify(input)
|
|
4548
|
+
});
|
|
4745
4549
|
}
|
|
4746
4550
|
forkSnapshot(snapshotId, input = {}, options = {}) {
|
|
4747
4551
|
const query = new URLSearchParams();
|
|
4748
|
-
if (input.teamId)
|
|
4749
|
-
|
|
4750
|
-
if (
|
|
4552
|
+
if (input.teamId)
|
|
4553
|
+
query.set("teamId", input.teamId);
|
|
4554
|
+
if (input.projectId)
|
|
4555
|
+
query.set("projectId", input.projectId);
|
|
4556
|
+
if (options.async)
|
|
4557
|
+
query.set("async", "1");
|
|
4751
4558
|
const { teamId: _teamId, projectId: _projectId, ...body } = input;
|
|
4752
|
-
return this.request(
|
|
4753
|
-
|
|
4754
|
-
{
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
})
|
|
4761
|
-
}
|
|
4762
|
-
);
|
|
4559
|
+
return this.request(`/catalog/snapshots/${encodeURIComponent(snapshotId)}/fork${query.size > 0 ? `?${query.toString()}` : ""}`, {
|
|
4560
|
+
method: "POST",
|
|
4561
|
+
headers: options.async ? { Prefer: "respond-async" } : void 0,
|
|
4562
|
+
body: JSON.stringify({
|
|
4563
|
+
...body,
|
|
4564
|
+
snapshotId
|
|
4565
|
+
})
|
|
4566
|
+
});
|
|
4763
4567
|
}
|
|
4764
4568
|
templates(input = {}) {
|
|
4765
4569
|
const query = new URLSearchParams();
|
|
4766
|
-
if (input.teamId)
|
|
4767
|
-
|
|
4768
|
-
if (input.
|
|
4769
|
-
|
|
4770
|
-
if (input.
|
|
4771
|
-
|
|
4772
|
-
if (input.
|
|
4773
|
-
|
|
4774
|
-
if (input.
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4570
|
+
if (input.teamId)
|
|
4571
|
+
query.set("teamId", input.teamId);
|
|
4572
|
+
if (input.projectId)
|
|
4573
|
+
query.set("projectId", input.projectId);
|
|
4574
|
+
if (input.q)
|
|
4575
|
+
query.set("q", input.q);
|
|
4576
|
+
if (input.name)
|
|
4577
|
+
query.set("name", input.name);
|
|
4578
|
+
if (input.version)
|
|
4579
|
+
query.set("version", input.version);
|
|
4580
|
+
if (input.visibility)
|
|
4581
|
+
query.set("visibility", input.visibility);
|
|
4582
|
+
if (input.tag)
|
|
4583
|
+
query.set("tag", input.tag);
|
|
4584
|
+
if (input.useCase)
|
|
4585
|
+
query.set("useCase", input.useCase);
|
|
4586
|
+
if (input.limit)
|
|
4587
|
+
query.set("limit", String(input.limit));
|
|
4588
|
+
return this.request(`/templates${query.size > 0 ? `?${query.toString()}` : ""}`);
|
|
4778
4589
|
}
|
|
4779
4590
|
publishedSnapshots(input = {}) {
|
|
4780
4591
|
const query = new URLSearchParams();
|
|
4781
|
-
if (input.teamId)
|
|
4782
|
-
|
|
4783
|
-
if (input.
|
|
4784
|
-
|
|
4785
|
-
if (input.
|
|
4786
|
-
|
|
4787
|
-
if (input.
|
|
4788
|
-
|
|
4789
|
-
if (input.
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4592
|
+
if (input.teamId)
|
|
4593
|
+
query.set("teamId", input.teamId);
|
|
4594
|
+
if (input.projectId)
|
|
4595
|
+
query.set("projectId", input.projectId);
|
|
4596
|
+
if (input.q)
|
|
4597
|
+
query.set("q", input.q);
|
|
4598
|
+
if (input.name)
|
|
4599
|
+
query.set("name", input.name);
|
|
4600
|
+
if (input.version)
|
|
4601
|
+
query.set("version", input.version);
|
|
4602
|
+
if (input.visibility)
|
|
4603
|
+
query.set("visibility", input.visibility);
|
|
4604
|
+
if (input.tag)
|
|
4605
|
+
query.set("tag", input.tag);
|
|
4606
|
+
if (input.useCase)
|
|
4607
|
+
query.set("useCase", input.useCase);
|
|
4608
|
+
if (input.limit)
|
|
4609
|
+
query.set("limit", String(input.limit));
|
|
4610
|
+
return this.request(`/published-snapshots${query.size > 0 ? `?${query.toString()}` : ""}`).then((payload) => {
|
|
4793
4611
|
const publishedSnapshots = payload.publishedSnapshots ?? payload.templates;
|
|
4794
4612
|
return {
|
|
4795
4613
|
...payload,
|
|
@@ -4800,29 +4618,27 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
4800
4618
|
}
|
|
4801
4619
|
launchTemplate(input) {
|
|
4802
4620
|
const query = new URLSearchParams();
|
|
4803
|
-
if (input.teamId)
|
|
4804
|
-
|
|
4621
|
+
if (input.teamId)
|
|
4622
|
+
query.set("teamId", input.teamId);
|
|
4623
|
+
if (input.projectId)
|
|
4624
|
+
query.set("projectId", input.projectId);
|
|
4805
4625
|
const { teamId: _teamId, projectId: _projectId, ...body } = input;
|
|
4806
|
-
return this.request(
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
body: JSON.stringify(body)
|
|
4811
|
-
}
|
|
4812
|
-
);
|
|
4626
|
+
return this.request(`/templates/launch${query.size > 0 ? `?${query.toString()}` : ""}`, {
|
|
4627
|
+
method: "POST",
|
|
4628
|
+
body: JSON.stringify(body)
|
|
4629
|
+
});
|
|
4813
4630
|
}
|
|
4814
4631
|
runPublishedSnapshot(input) {
|
|
4815
4632
|
const query = new URLSearchParams();
|
|
4816
|
-
if (input.teamId)
|
|
4817
|
-
|
|
4633
|
+
if (input.teamId)
|
|
4634
|
+
query.set("teamId", input.teamId);
|
|
4635
|
+
if (input.projectId)
|
|
4636
|
+
query.set("projectId", input.projectId);
|
|
4818
4637
|
const { teamId: _teamId, projectId: _projectId, ...body } = input;
|
|
4819
|
-
return this.request(
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
body: JSON.stringify(body)
|
|
4824
|
-
}
|
|
4825
|
-
).then((payload) => {
|
|
4638
|
+
return this.request(`/published-snapshots/launch${query.size > 0 ? `?${query.toString()}` : ""}`, {
|
|
4639
|
+
method: "POST",
|
|
4640
|
+
body: JSON.stringify(body)
|
|
4641
|
+
}).then((payload) => {
|
|
4826
4642
|
const publishedSnapshot = payload.publishedSnapshot ?? payload.template;
|
|
4827
4643
|
return {
|
|
4828
4644
|
...payload,
|
|
@@ -4833,134 +4649,94 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
4833
4649
|
}
|
|
4834
4650
|
listSchedules(input = {}) {
|
|
4835
4651
|
const query = new URLSearchParams();
|
|
4836
|
-
if (input.teamId)
|
|
4837
|
-
|
|
4652
|
+
if (input.teamId)
|
|
4653
|
+
query.set("teamId", input.teamId);
|
|
4654
|
+
if (input.projectId)
|
|
4655
|
+
query.set("projectId", input.projectId);
|
|
4838
4656
|
if (input.sourceSandboxId)
|
|
4839
4657
|
query.set("sourceSandboxId", input.sourceSandboxId);
|
|
4840
|
-
return this.request(
|
|
4841
|
-
`/schedules${query.size > 0 ? `?${query.toString()}` : ""}`
|
|
4842
|
-
);
|
|
4658
|
+
return this.request(`/schedules${query.size > 0 ? `?${query.toString()}` : ""}`);
|
|
4843
4659
|
}
|
|
4844
4660
|
createSchedule(input) {
|
|
4845
4661
|
const query = new URLSearchParams();
|
|
4846
|
-
if (input.projectId)
|
|
4662
|
+
if (input.projectId)
|
|
4663
|
+
query.set("projectId", input.projectId);
|
|
4847
4664
|
const { projectId: _projectId, ...body } = input;
|
|
4848
|
-
return this.request(
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
body: JSON.stringify(body)
|
|
4853
|
-
}
|
|
4854
|
-
);
|
|
4665
|
+
return this.request(`/schedules${query.size > 0 ? `?${query.toString()}` : ""}`, {
|
|
4666
|
+
method: "POST",
|
|
4667
|
+
body: JSON.stringify(body)
|
|
4668
|
+
});
|
|
4855
4669
|
}
|
|
4856
4670
|
getSchedule(scheduleId) {
|
|
4857
|
-
return this.request(
|
|
4858
|
-
`/schedules/${encodeURIComponent(scheduleId)}`
|
|
4859
|
-
);
|
|
4671
|
+
return this.request(`/schedules/${encodeURIComponent(scheduleId)}`);
|
|
4860
4672
|
}
|
|
4861
4673
|
updateSchedule(scheduleId, input) {
|
|
4862
|
-
return this.request(
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
body: JSON.stringify(input)
|
|
4867
|
-
}
|
|
4868
|
-
);
|
|
4674
|
+
return this.request(`/schedules/${encodeURIComponent(scheduleId)}`, {
|
|
4675
|
+
method: "PATCH",
|
|
4676
|
+
body: JSON.stringify(input)
|
|
4677
|
+
});
|
|
4869
4678
|
}
|
|
4870
4679
|
deleteSchedule(scheduleId) {
|
|
4871
|
-
return this.request(
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
method: "DELETE"
|
|
4875
|
-
}
|
|
4876
|
-
);
|
|
4680
|
+
return this.request(`/schedules/${encodeURIComponent(scheduleId)}`, {
|
|
4681
|
+
method: "DELETE"
|
|
4682
|
+
});
|
|
4877
4683
|
}
|
|
4878
4684
|
listScheduleRuns(scheduleId, input = {}) {
|
|
4879
4685
|
const query = new URLSearchParams();
|
|
4880
|
-
if (input.limit !== void 0)
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
);
|
|
4686
|
+
if (input.limit !== void 0)
|
|
4687
|
+
query.set("limit", String(input.limit));
|
|
4688
|
+
return this.request(`/schedules/${encodeURIComponent(scheduleId)}/runs${query.size > 0 ? `?${query.toString()}` : ""}`);
|
|
4884
4689
|
}
|
|
4885
4690
|
runScheduleNow(scheduleId, input = {}) {
|
|
4886
|
-
return this.request(
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
body: JSON.stringify(input)
|
|
4891
|
-
}
|
|
4892
|
-
);
|
|
4691
|
+
return this.request(`/schedules/${encodeURIComponent(scheduleId)}/run`, {
|
|
4692
|
+
method: "POST",
|
|
4693
|
+
body: JSON.stringify(input)
|
|
4694
|
+
});
|
|
4893
4695
|
}
|
|
4894
4696
|
listTemplateBuilds(input) {
|
|
4895
4697
|
const query = new URLSearchParams({ teamId: input.teamId });
|
|
4896
|
-
return this.requestApiRoot(
|
|
4897
|
-
`/sandbox-template-builds?${query.toString()}`
|
|
4898
|
-
).then((payload) => payload.builds);
|
|
4698
|
+
return this.requestApiRoot(`/sandbox-template-builds?${query.toString()}`).then((payload) => payload.builds);
|
|
4899
4699
|
}
|
|
4900
4700
|
createTemplateBuild(input) {
|
|
4901
|
-
return this.requestApiRoot(
|
|
4902
|
-
"
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
body: JSON.stringify(input)
|
|
4906
|
-
}
|
|
4907
|
-
).then((payload) => payload.build);
|
|
4701
|
+
return this.requestApiRoot("/sandbox-template-builds", {
|
|
4702
|
+
method: "POST",
|
|
4703
|
+
body: JSON.stringify(input)
|
|
4704
|
+
}).then((payload) => payload.build);
|
|
4908
4705
|
}
|
|
4909
4706
|
getTemplateBuild(buildId) {
|
|
4910
|
-
return this.requestApiRoot(
|
|
4911
|
-
`/sandbox-template-builds/${encodeURIComponent(buildId)}`
|
|
4912
|
-
).then((payload) => payload.build);
|
|
4707
|
+
return this.requestApiRoot(`/sandbox-template-builds/${encodeURIComponent(buildId)}`).then((payload) => payload.build);
|
|
4913
4708
|
}
|
|
4914
4709
|
getTemplateBuildLogs(buildId) {
|
|
4915
|
-
return this.requestApiRoot(
|
|
4916
|
-
`/sandbox-template-builds/${encodeURIComponent(buildId)}/logs`
|
|
4917
|
-
);
|
|
4710
|
+
return this.requestApiRoot(`/sandbox-template-builds/${encodeURIComponent(buildId)}/logs`);
|
|
4918
4711
|
}
|
|
4919
4712
|
cancelTemplateBuild(buildId) {
|
|
4920
|
-
return this.requestApiRoot(
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
method: "POST"
|
|
4924
|
-
}
|
|
4925
|
-
).then((payload) => payload.build);
|
|
4713
|
+
return this.requestApiRoot(`/sandbox-template-builds/${encodeURIComponent(buildId)}/cancel`, {
|
|
4714
|
+
method: "POST"
|
|
4715
|
+
}).then((payload) => payload.build);
|
|
4926
4716
|
}
|
|
4927
4717
|
listPublishedSnapshotBuilds(input) {
|
|
4928
4718
|
const query = new URLSearchParams({ teamId: input.teamId });
|
|
4929
|
-
return this.requestApiRoot(
|
|
4930
|
-
`/published-snapshot-builds?${query.toString()}`
|
|
4931
|
-
).then((payload) => payload.builds);
|
|
4719
|
+
return this.requestApiRoot(`/published-snapshot-builds?${query.toString()}`).then((payload) => payload.builds);
|
|
4932
4720
|
}
|
|
4933
4721
|
createPublishedSnapshotBuild(input) {
|
|
4934
|
-
return this.requestApiRoot(
|
|
4935
|
-
"
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
body: JSON.stringify(input)
|
|
4939
|
-
}
|
|
4940
|
-
).then((payload) => payload.build);
|
|
4722
|
+
return this.requestApiRoot("/published-snapshot-builds", {
|
|
4723
|
+
method: "POST",
|
|
4724
|
+
body: JSON.stringify(input)
|
|
4725
|
+
}).then((payload) => payload.build);
|
|
4941
4726
|
}
|
|
4942
4727
|
getPublishedSnapshotBuild(buildId) {
|
|
4943
|
-
return this.requestApiRoot(
|
|
4944
|
-
`/published-snapshot-builds/${encodeURIComponent(buildId)}`
|
|
4945
|
-
).then((payload) => payload.build);
|
|
4728
|
+
return this.requestApiRoot(`/published-snapshot-builds/${encodeURIComponent(buildId)}`).then((payload) => payload.build);
|
|
4946
4729
|
}
|
|
4947
4730
|
getPublishedSnapshotBuildLogs(buildId) {
|
|
4948
|
-
return this.requestApiRoot(
|
|
4949
|
-
`/published-snapshot-builds/${encodeURIComponent(buildId)}/logs`
|
|
4950
|
-
);
|
|
4731
|
+
return this.requestApiRoot(`/published-snapshot-builds/${encodeURIComponent(buildId)}/logs`);
|
|
4951
4732
|
}
|
|
4952
4733
|
cancelPublishedSnapshotBuild(buildId) {
|
|
4953
|
-
return this.requestApiRoot(
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
method: "POST"
|
|
4957
|
-
}
|
|
4958
|
-
).then((payload) => payload.build);
|
|
4734
|
+
return this.requestApiRoot(`/published-snapshot-builds/${encodeURIComponent(buildId)}/cancel`, {
|
|
4735
|
+
method: "POST"
|
|
4736
|
+
}).then((payload) => payload.build);
|
|
4959
4737
|
}
|
|
4960
4738
|
listOrganizations() {
|
|
4961
|
-
return this.requestApiRoot(
|
|
4962
|
-
"/organizations"
|
|
4963
|
-
).then((payload) => payload.organizations ?? payload.teams ?? []);
|
|
4739
|
+
return this.requestApiRoot("/organizations").then((payload) => payload.organizations ?? payload.teams ?? []);
|
|
4964
4740
|
}
|
|
4965
4741
|
createOrganization(input) {
|
|
4966
4742
|
return this.requestApiRoot("/organizations", {
|
|
@@ -4969,136 +4745,112 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
4969
4745
|
}).then((payload) => payload.organization);
|
|
4970
4746
|
}
|
|
4971
4747
|
getOrganization(slug2) {
|
|
4972
|
-
return this.requestApiRoot(
|
|
4973
|
-
`/organizations/${encodeURIComponent(slug2)}`
|
|
4974
|
-
).then((payload) => payload.organization);
|
|
4748
|
+
return this.requestApiRoot(`/organizations/${encodeURIComponent(slug2)}`).then((payload) => payload.organization);
|
|
4975
4749
|
}
|
|
4976
4750
|
updateOrganization(slug2, input) {
|
|
4977
|
-
return this.requestApiRoot(
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
body: JSON.stringify(input)
|
|
4982
|
-
}
|
|
4983
|
-
).then((payload) => payload.organization);
|
|
4751
|
+
return this.requestApiRoot(`/organizations/${encodeURIComponent(slug2)}`, {
|
|
4752
|
+
method: "PATCH",
|
|
4753
|
+
body: JSON.stringify(input)
|
|
4754
|
+
}).then((payload) => payload.organization);
|
|
4984
4755
|
}
|
|
4985
4756
|
listOrganizationMembers(slug2) {
|
|
4986
|
-
return this.requestApiRoot(
|
|
4987
|
-
`/organizations/${encodeURIComponent(slug2)}/members`
|
|
4988
|
-
).then((payload) => payload.members);
|
|
4757
|
+
return this.requestApiRoot(`/organizations/${encodeURIComponent(slug2)}/members`).then((payload) => payload.members);
|
|
4989
4758
|
}
|
|
4990
4759
|
upsertOrganizationMember(slug2, input) {
|
|
4991
|
-
return this.requestApiRoot(
|
|
4992
|
-
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
body: JSON.stringify(input)
|
|
4996
|
-
}
|
|
4997
|
-
).then((payload) => payload.member);
|
|
4760
|
+
return this.requestApiRoot(`/organizations/${encodeURIComponent(slug2)}/members`, {
|
|
4761
|
+
method: "POST",
|
|
4762
|
+
body: JSON.stringify(input)
|
|
4763
|
+
}).then((payload) => payload.member);
|
|
4998
4764
|
}
|
|
4999
4765
|
getOrganizationMcpServer(slug2) {
|
|
5000
|
-
return this.requestApiRoot(
|
|
5001
|
-
`/organizations/${encodeURIComponent(slug2)}/mcp-server`
|
|
5002
|
-
).then((payload) => payload.mcpServer);
|
|
4766
|
+
return this.requestApiRoot(`/organizations/${encodeURIComponent(slug2)}/mcp-server`).then((payload) => payload.mcpServer);
|
|
5003
4767
|
}
|
|
5004
4768
|
generateOrganizationMcpServer(slug2, input = {}) {
|
|
5005
|
-
return this.requestApiRoot(
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
body: JSON.stringify(input)
|
|
5010
|
-
}
|
|
5011
|
-
).then((payload) => payload.mcpServer);
|
|
4769
|
+
return this.requestApiRoot(`/organizations/${encodeURIComponent(slug2)}/mcp-server`, {
|
|
4770
|
+
method: "POST",
|
|
4771
|
+
body: JSON.stringify(input)
|
|
4772
|
+
}).then((payload) => payload.mcpServer);
|
|
5012
4773
|
}
|
|
5013
4774
|
rotateOrganizationMcpServer(slug2) {
|
|
5014
|
-
return this.requestApiRoot(
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
method: "POST"
|
|
5018
|
-
}
|
|
5019
|
-
).then((payload) => payload.mcpServer);
|
|
4775
|
+
return this.requestApiRoot(`/organizations/${encodeURIComponent(slug2)}/mcp-server/rotate`, {
|
|
4776
|
+
method: "POST"
|
|
4777
|
+
}).then((payload) => payload.mcpServer);
|
|
5020
4778
|
}
|
|
5021
4779
|
disableOrganizationMcpServer(slug2) {
|
|
5022
|
-
return this.requestApiRoot(
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
method: "POST"
|
|
5026
|
-
}
|
|
5027
|
-
).then((payload) => payload.mcpServer);
|
|
4780
|
+
return this.requestApiRoot(`/organizations/${encodeURIComponent(slug2)}/mcp-server/disable`, {
|
|
4781
|
+
method: "POST"
|
|
4782
|
+
}).then((payload) => payload.mcpServer);
|
|
5028
4783
|
}
|
|
5029
4784
|
enableOrganizationMcpServer(slug2) {
|
|
5030
|
-
return this.requestApiRoot(
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
method: "POST"
|
|
5034
|
-
}
|
|
5035
|
-
).then((payload) => payload.mcpServer);
|
|
4785
|
+
return this.requestApiRoot(`/organizations/${encodeURIComponent(slug2)}/mcp-server/enable`, {
|
|
4786
|
+
method: "POST"
|
|
4787
|
+
}).then((payload) => payload.mcpServer);
|
|
5036
4788
|
}
|
|
5037
4789
|
startReplay(input) {
|
|
5038
4790
|
const query = new URLSearchParams();
|
|
5039
|
-
if (input.teamId)
|
|
5040
|
-
|
|
4791
|
+
if (input.teamId)
|
|
4792
|
+
query.set("teamId", input.teamId);
|
|
4793
|
+
if (input.projectId)
|
|
4794
|
+
query.set("projectId", input.projectId);
|
|
5041
4795
|
const { teamId: _teamId, projectId: _projectId, ...body } = input;
|
|
5042
|
-
return this.requestApiRoot(
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
body: JSON.stringify(body)
|
|
5047
|
-
}
|
|
5048
|
-
);
|
|
4796
|
+
return this.requestApiRoot(`/sandbox-replays${query.size > 0 ? `?${query.toString()}` : ""}`, {
|
|
4797
|
+
method: "POST",
|
|
4798
|
+
body: JSON.stringify(body)
|
|
4799
|
+
});
|
|
5049
4800
|
}
|
|
5050
4801
|
listReplays(input = {}) {
|
|
5051
4802
|
const query = new URLSearchParams();
|
|
5052
|
-
if (input.teamId)
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
);
|
|
4803
|
+
if (input.teamId)
|
|
4804
|
+
query.set("teamId", input.teamId);
|
|
4805
|
+
if (input.projectId)
|
|
4806
|
+
query.set("projectId", input.projectId);
|
|
4807
|
+
return this.requestApiRoot(`/sandbox-replays${query.size > 0 ? `?${query.toString()}` : ""}`);
|
|
5057
4808
|
}
|
|
5058
4809
|
getReplay(replayId, input = {}) {
|
|
5059
4810
|
const query = new URLSearchParams();
|
|
5060
|
-
if (input.teamId)
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
);
|
|
4811
|
+
if (input.teamId)
|
|
4812
|
+
query.set("teamId", input.teamId);
|
|
4813
|
+
if (input.projectId)
|
|
4814
|
+
query.set("projectId", input.projectId);
|
|
4815
|
+
return this.requestApiRoot(`/sandbox-replays/${encodeURIComponent(replayId)}${query.size > 0 ? `?${query.toString()}` : ""}`);
|
|
5065
4816
|
}
|
|
5066
4817
|
getReplayLogs(replayId, input = {}) {
|
|
5067
4818
|
const query = new URLSearchParams();
|
|
5068
|
-
if (input.teamId)
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
);
|
|
4819
|
+
if (input.teamId)
|
|
4820
|
+
query.set("teamId", input.teamId);
|
|
4821
|
+
if (input.projectId)
|
|
4822
|
+
query.set("projectId", input.projectId);
|
|
4823
|
+
return this.requestApiRoot(`/sandbox-replays/${encodeURIComponent(replayId)}/logs${query.size > 0 ? `?${query.toString()}` : ""}`);
|
|
5073
4824
|
}
|
|
5074
4825
|
getReplayArtifacts(replayId, input = {}) {
|
|
5075
4826
|
const query = new URLSearchParams();
|
|
5076
|
-
if (input.teamId)
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
);
|
|
4827
|
+
if (input.teamId)
|
|
4828
|
+
query.set("teamId", input.teamId);
|
|
4829
|
+
if (input.projectId)
|
|
4830
|
+
query.set("projectId", input.projectId);
|
|
4831
|
+
return this.requestApiRoot(`/sandbox-replays/${encodeURIComponent(replayId)}/artifacts${query.size > 0 ? `?${query.toString()}` : ""}`);
|
|
5081
4832
|
}
|
|
5082
4833
|
cancelReplay(replayId, input = {}) {
|
|
5083
4834
|
const query = new URLSearchParams();
|
|
5084
|
-
if (input.teamId)
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
);
|
|
4835
|
+
if (input.teamId)
|
|
4836
|
+
query.set("teamId", input.teamId);
|
|
4837
|
+
if (input.projectId)
|
|
4838
|
+
query.set("projectId", input.projectId);
|
|
4839
|
+
return this.requestApiRoot(`/sandbox-replays/${encodeURIComponent(replayId)}/cancel${query.size > 0 ? `?${query.toString()}` : ""}`, {
|
|
4840
|
+
method: "POST"
|
|
4841
|
+
});
|
|
5092
4842
|
}
|
|
5093
4843
|
integrationConnections(input = {}) {
|
|
5094
4844
|
const query = new URLSearchParams();
|
|
5095
|
-
if (input.teamId)
|
|
5096
|
-
|
|
5097
|
-
if (input.
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
)
|
|
4845
|
+
if (input.teamId)
|
|
4846
|
+
query.set("teamId", input.teamId);
|
|
4847
|
+
if (input.projectId)
|
|
4848
|
+
query.set("projectId", input.projectId);
|
|
4849
|
+
if (input.agentId)
|
|
4850
|
+
query.set("agentId", input.agentId);
|
|
4851
|
+
if (input.status)
|
|
4852
|
+
query.set("status", input.status);
|
|
4853
|
+
return this.requestApiRoot(`/integrations/connections${query.size > 0 ? `?${query.toString()}` : ""}`);
|
|
5102
4854
|
}
|
|
5103
4855
|
mcpServerConfig() {
|
|
5104
4856
|
return {
|
|
@@ -5118,6 +4870,34 @@ function createOpenPondSandboxClient(options) {
|
|
|
5118
4870
|
return new OpenPondSandboxClient(options);
|
|
5119
4871
|
}
|
|
5120
4872
|
|
|
4873
|
+
// ../../packages/sdk/src/work.ts
|
|
4874
|
+
var MAX_WORK_INPUT_BYTES = 100 * 1024 * 1024;
|
|
4875
|
+
var WORK_OUTPUT_MIME_TYPES = Object.freeze({
|
|
4876
|
+
".avif": "image/avif",
|
|
4877
|
+
".csv": "text/csv",
|
|
4878
|
+
".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
4879
|
+
".gif": "image/gif",
|
|
4880
|
+
".html": "text/html",
|
|
4881
|
+
".jpeg": "image/jpeg",
|
|
4882
|
+
".jpg": "image/jpeg",
|
|
4883
|
+
".json": "application/json",
|
|
4884
|
+
".m4a": "audio/mp4",
|
|
4885
|
+
".md": "text/markdown",
|
|
4886
|
+
".mov": "video/quicktime",
|
|
4887
|
+
".mp3": "audio/mpeg",
|
|
4888
|
+
".mp4": "video/mp4",
|
|
4889
|
+
".pdf": "application/pdf",
|
|
4890
|
+
".png": "image/png",
|
|
4891
|
+
".pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
4892
|
+
".svg": "image/svg+xml",
|
|
4893
|
+
".tsv": "text/tab-separated-values",
|
|
4894
|
+
".txt": "text/plain",
|
|
4895
|
+
".wav": "audio/wav",
|
|
4896
|
+
".webm": "video/webm",
|
|
4897
|
+
".webp": "image/webp",
|
|
4898
|
+
".xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
4899
|
+
});
|
|
4900
|
+
|
|
5121
4901
|
// ../../node_modules/.pnpm/js-yaml@4.3.0/node_modules/js-yaml/dist/js-yaml.mjs
|
|
5122
4902
|
function getDefaultExportFromCjs(x) {
|
|
5123
4903
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
@@ -23472,6 +23252,7 @@ function slug(value) {
|
|
|
23472
23252
|
|
|
23473
23253
|
// ../../packages/cloud/src/profile/local-profile.ts
|
|
23474
23254
|
import { createRequire } from "node:module";
|
|
23255
|
+
import { createHash as createHash4, randomUUID as randomUUID3 } from "node:crypto";
|
|
23475
23256
|
import { spawn as spawn2 } from "node:child_process";
|
|
23476
23257
|
import { existsSync as existsSync4 } from "node:fs";
|
|
23477
23258
|
import {
|
|
@@ -23479,6 +23260,8 @@ import {
|
|
|
23479
23260
|
mkdir,
|
|
23480
23261
|
readFile as readFile5,
|
|
23481
23262
|
readdir as readdir2,
|
|
23263
|
+
rename,
|
|
23264
|
+
rm,
|
|
23482
23265
|
symlink,
|
|
23483
23266
|
writeFile as writeFile2
|
|
23484
23267
|
} from "node:fs/promises";
|
|
@@ -23548,6 +23331,7 @@ import path4 from "node:path";
|
|
|
23548
23331
|
var AGENT_MANIFEST_PATH = ".openpond/agent-manifest.json";
|
|
23549
23332
|
var ACTION_REGISTRY_PATH = ".openpond/action-registry.json";
|
|
23550
23333
|
var SOURCE_UPLOAD_METADATA_PATH = ".openpond/source-upload-metadata.json";
|
|
23334
|
+
var AGENT_PACKAGE_ORIGIN_PATH = ".openpond/agent-package-origin.json";
|
|
23551
23335
|
async function loadProfileActionCatalog(sourcePath) {
|
|
23552
23336
|
return loadProfileActionCatalogSource({
|
|
23553
23337
|
agentId: "default",
|
|
@@ -23574,7 +23358,9 @@ async function loadProfileActionCatalogForSources(sources) {
|
|
|
23574
23358
|
...sources.filter((source) => source.preferred),
|
|
23575
23359
|
...sources.filter((source) => !source.preferred)
|
|
23576
23360
|
];
|
|
23577
|
-
const results = await Promise.all(
|
|
23361
|
+
const results = await Promise.all(
|
|
23362
|
+
sortedSources.map(loadProfileActionCatalogSource)
|
|
23363
|
+
);
|
|
23578
23364
|
const byId = /* @__PURE__ */ new Map();
|
|
23579
23365
|
const actionCatalog = [];
|
|
23580
23366
|
for (const result of results) {
|
|
@@ -23585,7 +23371,9 @@ async function loadProfileActionCatalogForSources(sources) {
|
|
|
23585
23371
|
actionCatalog.push(next);
|
|
23586
23372
|
}
|
|
23587
23373
|
}
|
|
23588
|
-
const generatedAt = latestIso(
|
|
23374
|
+
const generatedAt = latestIso(
|
|
23375
|
+
results.map((result) => result.catalog.generatedAt)
|
|
23376
|
+
);
|
|
23589
23377
|
const errors = results.map((result) => result.catalog.error).filter(Boolean);
|
|
23590
23378
|
return {
|
|
23591
23379
|
catalog: {
|
|
@@ -23597,20 +23385,37 @@ async function loadProfileActionCatalogForSources(sources) {
|
|
|
23597
23385
|
error: errors.length > 0 ? errors.join("; ") : null
|
|
23598
23386
|
},
|
|
23599
23387
|
actionCatalog,
|
|
23600
|
-
sourceSetupRequirements: results.flatMap(
|
|
23388
|
+
sourceSetupRequirements: results.flatMap(
|
|
23389
|
+
(result) => result.sourceSetupRequirements
|
|
23390
|
+
)
|
|
23601
23391
|
};
|
|
23602
23392
|
}
|
|
23603
23393
|
async function loadProfileActionCatalogSource(source) {
|
|
23604
23394
|
const sourcePath = source.sourcePath;
|
|
23605
23395
|
const manifestPath = path4.join(sourcePath, AGENT_MANIFEST_PATH);
|
|
23606
23396
|
const registryPath = path4.join(sourcePath, ACTION_REGISTRY_PATH);
|
|
23607
|
-
const sourceUploadMetadataPath = path4.join(
|
|
23397
|
+
const sourceUploadMetadataPath = path4.join(
|
|
23398
|
+
sourcePath,
|
|
23399
|
+
SOURCE_UPLOAD_METADATA_PATH
|
|
23400
|
+
);
|
|
23401
|
+
const agentPackageOriginPath = path4.join(
|
|
23402
|
+
sourcePath,
|
|
23403
|
+
AGENT_PACKAGE_ORIGIN_PATH
|
|
23404
|
+
);
|
|
23608
23405
|
try {
|
|
23609
23406
|
const manifest = await readJsonIfExists(manifestPath);
|
|
23610
23407
|
const registry2 = await readJsonIfExists(registryPath);
|
|
23611
|
-
const sourceUploadMetadata = await readJsonIfExists(
|
|
23408
|
+
const sourceUploadMetadata = await readJsonIfExists(
|
|
23409
|
+
sourceUploadMetadataPath
|
|
23410
|
+
);
|
|
23411
|
+
const agentPackageOrigin = asRecord2(
|
|
23412
|
+
await readJsonIfExists(agentPackageOriginPath)
|
|
23413
|
+
);
|
|
23414
|
+
const namedInputSchemas = asRecord2(asRecord2(manifest)?.inputSchemas);
|
|
23612
23415
|
const sourceSetupRequirements = recordArray(asRecord2(sourceUploadMetadata)?.setupRequirements) ?? [];
|
|
23613
|
-
const sourceRequirementsByAction = sourceSetupRequirementsByAction(
|
|
23416
|
+
const sourceRequirementsByAction = sourceSetupRequirementsByAction(
|
|
23417
|
+
sourceSetupRequirements
|
|
23418
|
+
);
|
|
23614
23419
|
const byId = /* @__PURE__ */ new Map();
|
|
23615
23420
|
for (const record3 of [
|
|
23616
23421
|
...records(asRecord2(manifest)?.actionCatalog),
|
|
@@ -23638,14 +23443,17 @@ async function loadProfileActionCatalogSource(source) {
|
|
|
23638
23443
|
label: text(record3.label) ?? existing?.label ?? titleFromActionId(id),
|
|
23639
23444
|
description: text(record3.description) ?? existing?.description ?? null,
|
|
23640
23445
|
visibility: text(record3.visibility) ?? existing?.visibility ?? "default",
|
|
23641
|
-
inputSchema:
|
|
23446
|
+
inputSchema: resolvedSchemaValue(record3.inputSchema, namedInputSchemas) ?? existing?.inputSchema ?? null,
|
|
23642
23447
|
outputSchema: schemaValue(record3.outputSchema) ?? existing?.outputSchema ?? null,
|
|
23643
23448
|
approvalPolicy: asRecord2(record3.approvalPolicy) ?? existing?.approvalPolicy ?? null,
|
|
23644
23449
|
artifactPolicy: asRecord2(record3.artifactPolicy) ?? existing?.artifactPolicy ?? null,
|
|
23645
23450
|
setupRequirements,
|
|
23646
23451
|
mcp: asRecord2(record3.mcp) ?? existing?.mcp ?? null,
|
|
23647
23452
|
schedulePolicy: asRecord2(record3.schedulePolicy) ?? existing?.schedulePolicy ?? null,
|
|
23648
|
-
trace:
|
|
23453
|
+
trace: mergeAgentPackageTrace(
|
|
23454
|
+
asRecord2(record3.trace) ?? existing?.trace ?? null,
|
|
23455
|
+
agentPackageOrigin
|
|
23456
|
+
),
|
|
23649
23457
|
implementation: asRecord2(record3.implementation) ?? existing?.implementation ?? null,
|
|
23650
23458
|
invokesModel: typeof record3.invokesModel === "boolean" ? record3.invokesModel : existing?.invokesModel
|
|
23651
23459
|
};
|
|
@@ -23686,6 +23494,24 @@ async function loadProfileActionCatalogSource(source) {
|
|
|
23686
23494
|
};
|
|
23687
23495
|
}
|
|
23688
23496
|
}
|
|
23497
|
+
function mergeAgentPackageTrace(trace, origin) {
|
|
23498
|
+
if (!origin) return trace;
|
|
23499
|
+
const versionId = text(origin.versionId);
|
|
23500
|
+
const digest = text(origin.digest);
|
|
23501
|
+
if (!versionId || !digest) return trace;
|
|
23502
|
+
return {
|
|
23503
|
+
...trace ?? {},
|
|
23504
|
+
agentVersionId: versionId,
|
|
23505
|
+
agentPackageDigest: digest,
|
|
23506
|
+
validationReceiptIds: stringArray(origin.validationReceiptIds),
|
|
23507
|
+
evalReceiptIds: stringArray(origin.evalReceiptIds)
|
|
23508
|
+
};
|
|
23509
|
+
}
|
|
23510
|
+
function stringArray(value) {
|
|
23511
|
+
return Array.isArray(value) ? value.filter(
|
|
23512
|
+
(entry) => typeof entry === "string" && entry.trim().length > 0
|
|
23513
|
+
) : [];
|
|
23514
|
+
}
|
|
23689
23515
|
function latestIso(values) {
|
|
23690
23516
|
let latest = 0;
|
|
23691
23517
|
for (const value of values) {
|
|
@@ -23763,11 +23589,15 @@ function asRecord2(value) {
|
|
|
23763
23589
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
23764
23590
|
}
|
|
23765
23591
|
function records(value) {
|
|
23766
|
-
return Array.isArray(value) ? value.filter(
|
|
23592
|
+
return Array.isArray(value) ? value.filter(
|
|
23593
|
+
(item) => Boolean(asRecord2(item))
|
|
23594
|
+
) : [];
|
|
23767
23595
|
}
|
|
23768
23596
|
function recordArray(value) {
|
|
23769
23597
|
if (!Array.isArray(value)) return null;
|
|
23770
|
-
return value.filter(
|
|
23598
|
+
return value.filter(
|
|
23599
|
+
(item) => Boolean(asRecord2(item))
|
|
23600
|
+
);
|
|
23771
23601
|
}
|
|
23772
23602
|
function text(value) {
|
|
23773
23603
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
@@ -23775,6 +23605,11 @@ function text(value) {
|
|
|
23775
23605
|
function schemaValue(value) {
|
|
23776
23606
|
return text(value) ?? asRecord2(value);
|
|
23777
23607
|
}
|
|
23608
|
+
function resolvedSchemaValue(value, namedSchemas) {
|
|
23609
|
+
const schema2 = schemaValue(value);
|
|
23610
|
+
if (typeof schema2 !== "string") return schema2;
|
|
23611
|
+
return asRecord2(namedSchemas?.[schema2]) ?? schema2;
|
|
23612
|
+
}
|
|
23778
23613
|
function titleFromActionId(id) {
|
|
23779
23614
|
const title = id.replace(/[._-]+/g, " ").trim();
|
|
23780
23615
|
return title ? title.replace(/\b\w/g, (letter) => letter.toUpperCase()) : id;
|
|
@@ -24102,7 +23937,6 @@ var PROFILE_REPO_GITIGNORE = [
|
|
|
24102
23937
|
"**/.bun/",
|
|
24103
23938
|
"**/.env",
|
|
24104
23939
|
"**/.env.*",
|
|
24105
|
-
"**/.openpond/goals/",
|
|
24106
23940
|
"**/.openpond/traces/",
|
|
24107
23941
|
"**/.openpond/vendor/",
|
|
24108
23942
|
"**/.openpond/eval-results.json",
|
|
@@ -24513,12 +24347,10 @@ function hostedSourceCheckStatusFromPayload(input) {
|
|
|
24513
24347
|
const deployPlan = record2(checkResult?.deployPlan) ?? record2(input.deployPlan);
|
|
24514
24348
|
const source = record2(deployPlan?.source);
|
|
24515
24349
|
const checks = record2(deployPlan?.checks);
|
|
24516
|
-
const workItem = record2(checkResult?.workItem);
|
|
24517
24350
|
const sourceCheckStatus = record2(checkResult?.sourceCheckStatus);
|
|
24518
24351
|
return {
|
|
24519
24352
|
status: input.status,
|
|
24520
24353
|
agentId: input.agentId,
|
|
24521
|
-
workItemId: text4(workItem?.id),
|
|
24522
24354
|
deployPlanStatus: text4(deployPlan?.status),
|
|
24523
24355
|
canRun: booleanValue(deployPlan?.canRun),
|
|
24524
24356
|
canDeploy: booleanValue(deployPlan?.canDeploy),
|
|
@@ -24631,19 +24463,58 @@ function mergeProfileRepoManifestEntry(existing, profilePath) {
|
|
|
24631
24463
|
};
|
|
24632
24464
|
}
|
|
24633
24465
|
function mergeActiveLocalProfileConfig(existing, repoPath, profile) {
|
|
24466
|
+
const previousEntries = profileConfigEntries(existing);
|
|
24467
|
+
if (existing) {
|
|
24468
|
+
const previousIndex = previousEntries.findIndex(
|
|
24469
|
+
(entry) => path9.resolve(entry.repoPath) === path9.resolve(existing.repoPath) && entry.profile === existing.profile
|
|
24470
|
+
);
|
|
24471
|
+
const previousEntry = {
|
|
24472
|
+
source: previousEntries[previousIndex]?.source ?? "local",
|
|
24473
|
+
repositoryId: previousEntries[previousIndex]?.repositoryId ?? path9.resolve(existing.repoPath),
|
|
24474
|
+
repoPath: path9.resolve(existing.repoPath),
|
|
24475
|
+
profile: existing.profile,
|
|
24476
|
+
...existing.lastCheck ? { lastCheck: existing.lastCheck } : {},
|
|
24477
|
+
...existing.lastPush ? { lastPush: existing.lastPush } : {}
|
|
24478
|
+
};
|
|
24479
|
+
if (previousIndex >= 0) previousEntries[previousIndex] = previousEntry;
|
|
24480
|
+
else previousEntries.push(previousEntry);
|
|
24481
|
+
}
|
|
24482
|
+
const targetIndex = previousEntries.findIndex(
|
|
24483
|
+
(entry) => path9.resolve(entry.repoPath) === path9.resolve(repoPath) && entry.profile === profile
|
|
24484
|
+
);
|
|
24485
|
+
const target = targetIndex >= 0 ? previousEntries[targetIndex] : {
|
|
24486
|
+
source: "local",
|
|
24487
|
+
repositoryId: path9.resolve(repoPath),
|
|
24488
|
+
repoPath: path9.resolve(repoPath),
|
|
24489
|
+
profile
|
|
24490
|
+
};
|
|
24491
|
+
if (targetIndex < 0) previousEntries.push(target);
|
|
24634
24492
|
const next = {
|
|
24635
|
-
repoPath,
|
|
24493
|
+
repoPath: path9.resolve(repoPath),
|
|
24636
24494
|
profile,
|
|
24637
|
-
mode: "local"
|
|
24495
|
+
mode: "local",
|
|
24496
|
+
profiles: previousEntries,
|
|
24497
|
+
...target.lastCheck ? { lastCheck: target.lastCheck } : {},
|
|
24498
|
+
...target.lastPush ? { lastPush: target.lastPush } : {}
|
|
24638
24499
|
};
|
|
24639
|
-
|
|
24640
|
-
|
|
24641
|
-
|
|
24500
|
+
return next;
|
|
24501
|
+
}
|
|
24502
|
+
function profileConfigEntries(config2) {
|
|
24503
|
+
if (!config2) return [];
|
|
24504
|
+
const configured = config2.profiles?.map((entry) => ({ ...entry })) ?? [];
|
|
24505
|
+
if (!configured.some(
|
|
24506
|
+
(entry) => path9.resolve(entry.repoPath) === path9.resolve(config2.repoPath) && entry.profile === config2.profile
|
|
24507
|
+
)) {
|
|
24508
|
+
configured.push({
|
|
24509
|
+
source: "local",
|
|
24510
|
+
repositoryId: path9.resolve(config2.repoPath),
|
|
24511
|
+
repoPath: path9.resolve(config2.repoPath),
|
|
24512
|
+
profile: config2.profile,
|
|
24513
|
+
...config2.lastCheck ? { lastCheck: config2.lastCheck } : {},
|
|
24514
|
+
...config2.lastPush ? { lastPush: config2.lastPush } : {}
|
|
24515
|
+
});
|
|
24642
24516
|
}
|
|
24643
|
-
return
|
|
24644
|
-
...existing,
|
|
24645
|
-
...next
|
|
24646
|
-
};
|
|
24517
|
+
return configured;
|
|
24647
24518
|
}
|
|
24648
24519
|
var require2 = createRequire(import.meta.url);
|
|
24649
24520
|
function defaultLocalProfileRepoPath() {
|
|
@@ -24679,22 +24550,36 @@ async function initLocalProfileRepo(input = {}) {
|
|
|
24679
24550
|
const profile = normalizeProfileName(input.profile);
|
|
24680
24551
|
const profilePath = path9.join("profiles", profile);
|
|
24681
24552
|
const profileSourcePath2 = path9.join(repoPath, profilePath);
|
|
24553
|
+
const template = input.template ?? "blank-agent";
|
|
24554
|
+
const blankProfile = template === "blank-profile";
|
|
24682
24555
|
await mkdir(repoPath, { recursive: true });
|
|
24556
|
+
const manifestAlreadyExists = existsSync4(
|
|
24557
|
+
path9.join(repoPath, PROFILE_REPO_MANIFEST)
|
|
24558
|
+
);
|
|
24683
24559
|
const manifest = await readProfileManifest(repoPath).catch(
|
|
24684
24560
|
() => defaultProfileManifest(profile, profilePath)
|
|
24685
24561
|
);
|
|
24562
|
+
if (blankProfile && manifestAlreadyExists && manifest.profiles[profile]) {
|
|
24563
|
+
throw new Error(`Profile "${profile}" already exists in ${repoPath}.`);
|
|
24564
|
+
}
|
|
24686
24565
|
manifest.defaultProfile = manifest.defaultProfile || profile;
|
|
24687
24566
|
manifest.profiles[profile] = mergeProfileRepoManifestEntry(
|
|
24688
24567
|
manifest.profiles[profile],
|
|
24689
24568
|
profilePath
|
|
24690
24569
|
);
|
|
24691
|
-
|
|
24692
|
-
|
|
24693
|
-
|
|
24694
|
-
|
|
24695
|
-
|
|
24570
|
+
if (blankProfile) manifest.profiles[profile].enabledAgents = [];
|
|
24571
|
+
if (blankProfile) await mkdir(profileSourcePath2, { recursive: true });
|
|
24572
|
+
else {
|
|
24573
|
+
await ensureProfileSource(
|
|
24574
|
+
profileSourcePath2,
|
|
24575
|
+
template,
|
|
24576
|
+
Boolean(input.force)
|
|
24577
|
+
);
|
|
24578
|
+
}
|
|
24696
24579
|
await ensureProfileDependencies(profileSourcePath2);
|
|
24697
|
-
await ensureProfileScaffoldFiles(repoPath, profileSourcePath2, profile
|
|
24580
|
+
await ensureProfileScaffoldFiles(repoPath, profileSourcePath2, profile, {
|
|
24581
|
+
includeDefaultAgent: !blankProfile
|
|
24582
|
+
});
|
|
24698
24583
|
await writeProfileManifest(repoPath, manifest);
|
|
24699
24584
|
await ensureProfileGitRepo(repoPath);
|
|
24700
24585
|
const currentConfig = (await loadGlobalConfig()).openpondProfile;
|
|
@@ -24707,21 +24592,51 @@ async function initLocalProfileRepo(input = {}) {
|
|
|
24707
24592
|
});
|
|
24708
24593
|
return loadOpenPondProfileState();
|
|
24709
24594
|
}
|
|
24710
|
-
async function loadLocalProfileRepo(repoPathInput, profileInput) {
|
|
24595
|
+
async function loadLocalProfileRepo(repoPathInput, profileInput, identity) {
|
|
24711
24596
|
const repoPath = path9.resolve(repoPathInput);
|
|
24712
24597
|
const manifest = await readProfileManifest(repoPath);
|
|
24713
24598
|
const profile = normalizeProfileName(profileInput ?? manifest.defaultProfile);
|
|
24714
24599
|
profileSourcePath(manifest, repoPath, profile);
|
|
24715
24600
|
const currentConfig = (await loadGlobalConfig()).openpondProfile;
|
|
24716
|
-
|
|
24717
|
-
|
|
24718
|
-
|
|
24719
|
-
repoPath,
|
|
24720
|
-
profile
|
|
24721
|
-
)
|
|
24722
|
-
});
|
|
24601
|
+
const next = mergeActiveLocalProfileConfig(currentConfig, repoPath, profile);
|
|
24602
|
+
applyProfileIdentity(next, repoPath, profile, identity);
|
|
24603
|
+
await saveGlobalConfig({ openpondProfile: next });
|
|
24723
24604
|
return loadOpenPondProfileState();
|
|
24724
24605
|
}
|
|
24606
|
+
async function registerLocalProfileRepo(repoPathInput, profileInput, identity) {
|
|
24607
|
+
const repoPath = path9.resolve(repoPathInput);
|
|
24608
|
+
const manifest = await readProfileManifest(repoPath);
|
|
24609
|
+
const profile = normalizeProfileName(profileInput ?? manifest.defaultProfile);
|
|
24610
|
+
profileSourcePath(manifest, repoPath, profile);
|
|
24611
|
+
const currentConfig = (await loadGlobalConfig()).openpondProfile;
|
|
24612
|
+
const next = mergeActiveLocalProfileConfig(currentConfig, repoPath, profile);
|
|
24613
|
+
applyProfileIdentity(next, repoPath, profile, identity);
|
|
24614
|
+
if (currentConfig) {
|
|
24615
|
+
next.repoPath = currentConfig.repoPath;
|
|
24616
|
+
next.profile = currentConfig.profile;
|
|
24617
|
+
next.lastCheck = currentConfig.lastCheck;
|
|
24618
|
+
next.lastPush = currentConfig.lastPush;
|
|
24619
|
+
}
|
|
24620
|
+
await saveGlobalConfig({ openpondProfile: next });
|
|
24621
|
+
return loadOpenPondProfileStateForRef(
|
|
24622
|
+
openPondProfileRef({
|
|
24623
|
+
repoPath,
|
|
24624
|
+
profile,
|
|
24625
|
+
source: identity?.source,
|
|
24626
|
+
repositoryId: identity?.repositoryId
|
|
24627
|
+
})
|
|
24628
|
+
);
|
|
24629
|
+
}
|
|
24630
|
+
function applyProfileIdentity(config2, repoPath, profile, identity) {
|
|
24631
|
+
if (!identity) return;
|
|
24632
|
+
config2.profiles = profileConfigEntries(config2).map(
|
|
24633
|
+
(entry) => path9.resolve(entry.repoPath) === repoPath && entry.profile === profile ? {
|
|
24634
|
+
...entry,
|
|
24635
|
+
source: identity.source,
|
|
24636
|
+
repositoryId: identity.repositoryId
|
|
24637
|
+
} : entry
|
|
24638
|
+
);
|
|
24639
|
+
}
|
|
24725
24640
|
async function renameActiveProfileAgent(agentIdInput, nameInput) {
|
|
24726
24641
|
const agentId = agentIdInput.trim();
|
|
24727
24642
|
const name = normalizeAgentDisplayName(nameInput);
|
|
@@ -24749,10 +24664,196 @@ async function renameActiveProfileAgent(agentIdInput, nameInput) {
|
|
|
24749
24664
|
await writeProfileManifest(active.repoPath, manifest);
|
|
24750
24665
|
return loadOpenPondProfileState();
|
|
24751
24666
|
}
|
|
24667
|
+
async function installAgentPackageIntoActiveProfile(input) {
|
|
24668
|
+
const agentPackage = input.agentPackage;
|
|
24669
|
+
verifyAgentPackageIntegrity(agentPackage);
|
|
24670
|
+
if (!/^[a-z0-9][a-z0-9._-]{0,190}$/.test(agentPackage.agentId)) {
|
|
24671
|
+
throw new Error("Agent package ID is not safe for a local Profile.");
|
|
24672
|
+
}
|
|
24673
|
+
const active = await requireActiveLocalProfile();
|
|
24674
|
+
const profileSourcePath2 = active.state.sourcePath;
|
|
24675
|
+
await ensureProfileDependencies(profileSourcePath2);
|
|
24676
|
+
const agentsRoot = path9.join(profileSourcePath2, "agents");
|
|
24677
|
+
await mkdir(agentsRoot, { recursive: true });
|
|
24678
|
+
const target = path9.join(agentsRoot, agentPackage.agentId);
|
|
24679
|
+
const targetExists = existsSync4(target);
|
|
24680
|
+
if (targetExists && input.overwrite !== true) {
|
|
24681
|
+
throw new Error(
|
|
24682
|
+
`Agent "${agentPackage.agentId}" already exists. Confirm replacement to install this version.`
|
|
24683
|
+
);
|
|
24684
|
+
}
|
|
24685
|
+
const temporary = path9.join(
|
|
24686
|
+
agentsRoot,
|
|
24687
|
+
`.${agentPackage.agentId}.${randomUUID3()}.installing`
|
|
24688
|
+
);
|
|
24689
|
+
const backup = path9.join(
|
|
24690
|
+
agentsRoot,
|
|
24691
|
+
`.${agentPackage.agentId}.${randomUUID3()}.backup`
|
|
24692
|
+
);
|
|
24693
|
+
const manifest = await readProfileManifest(active.config.repoPath);
|
|
24694
|
+
const originalManifest = JSON.stringify(manifest);
|
|
24695
|
+
let movedExisting = false;
|
|
24696
|
+
let installed = false;
|
|
24697
|
+
try {
|
|
24698
|
+
await materializeAgentPackage(temporary, agentPackage);
|
|
24699
|
+
if (targetExists) {
|
|
24700
|
+
await rename(target, backup);
|
|
24701
|
+
movedExisting = true;
|
|
24702
|
+
}
|
|
24703
|
+
await rename(temporary, target);
|
|
24704
|
+
installed = true;
|
|
24705
|
+
const profileConfig = manifest.profiles[active.config.profile];
|
|
24706
|
+
if (!profileConfig) {
|
|
24707
|
+
throw new Error(`Profile "${active.config.profile}" was not found.`);
|
|
24708
|
+
}
|
|
24709
|
+
const enabledAgents = new Set(profileConfig.enabledAgents ?? []);
|
|
24710
|
+
enabledAgents.add(agentPackage.agentId);
|
|
24711
|
+
profileConfig.enabledAgents = [...enabledAgents];
|
|
24712
|
+
if (!profileConfig.defaultAgent) {
|
|
24713
|
+
profileConfig.defaultAgent = agentPackage.agentId;
|
|
24714
|
+
}
|
|
24715
|
+
profileConfig.agentNames = {
|
|
24716
|
+
...profileConfig.agentNames ?? {},
|
|
24717
|
+
[agentPackage.agentId]: agentPackage.title
|
|
24718
|
+
};
|
|
24719
|
+
await writeProfileManifest(active.config.repoPath, manifest);
|
|
24720
|
+
if (movedExisting) await rm(backup, { recursive: true, force: true });
|
|
24721
|
+
} catch (error51) {
|
|
24722
|
+
await rm(temporary, { recursive: true, force: true });
|
|
24723
|
+
if (installed) await rm(target, { recursive: true, force: true });
|
|
24724
|
+
if (movedExisting && existsSync4(backup)) await rename(backup, target);
|
|
24725
|
+
if (JSON.stringify(manifest) !== originalManifest) {
|
|
24726
|
+
await writeProfileManifest(
|
|
24727
|
+
active.config.repoPath,
|
|
24728
|
+
JSON.parse(originalManifest)
|
|
24729
|
+
).catch(() => void 0);
|
|
24730
|
+
}
|
|
24731
|
+
throw error51;
|
|
24732
|
+
}
|
|
24733
|
+
return {
|
|
24734
|
+
state: await loadOpenPondProfileState(),
|
|
24735
|
+
agentId: agentPackage.agentId,
|
|
24736
|
+
versionId: agentPackage.versionId,
|
|
24737
|
+
digest: agentPackage.digest
|
|
24738
|
+
};
|
|
24739
|
+
}
|
|
24752
24740
|
async function loadOpenPondProfileState() {
|
|
24753
24741
|
const config2 = await loadGlobalConfig();
|
|
24754
24742
|
const active = config2.openpondProfile;
|
|
24755
24743
|
if (!active) return emptyProfileState();
|
|
24744
|
+
return loadOpenPondProfileStateForConfig(active);
|
|
24745
|
+
}
|
|
24746
|
+
function openPondProfileRef(input) {
|
|
24747
|
+
return {
|
|
24748
|
+
source: input.source ?? "local",
|
|
24749
|
+
repositoryId: input.repositoryId?.trim() || path9.resolve(input.repoPath),
|
|
24750
|
+
profileId: input.profile
|
|
24751
|
+
};
|
|
24752
|
+
}
|
|
24753
|
+
async function loadOpenPondProfileLibrary() {
|
|
24754
|
+
const active = (await loadGlobalConfig()).openpondProfile;
|
|
24755
|
+
if (!active) return { lastUsed: null, profiles: [] };
|
|
24756
|
+
const entries = profileConfigEntries(active);
|
|
24757
|
+
const profiles = await Promise.all(
|
|
24758
|
+
entries.map(async (entry) => {
|
|
24759
|
+
const state = await loadOpenPondProfileStateForConfig({
|
|
24760
|
+
repoPath: entry.repoPath,
|
|
24761
|
+
profile: entry.profile,
|
|
24762
|
+
mode: "local",
|
|
24763
|
+
...entry.lastCheck ? { lastCheck: entry.lastCheck } : {},
|
|
24764
|
+
...entry.lastPush ? { lastPush: entry.lastPush } : {}
|
|
24765
|
+
});
|
|
24766
|
+
return {
|
|
24767
|
+
ref: openPondProfileRef(entry),
|
|
24768
|
+
name: entry.profile,
|
|
24769
|
+
repoPath: entry.repoPath,
|
|
24770
|
+
sourcePath: state.sourcePath,
|
|
24771
|
+
state
|
|
24772
|
+
};
|
|
24773
|
+
})
|
|
24774
|
+
);
|
|
24775
|
+
return {
|
|
24776
|
+
lastUsed: openPondProfileRef({
|
|
24777
|
+
repoPath: active.repoPath,
|
|
24778
|
+
profile: active.profile,
|
|
24779
|
+
source: profileConfigEntries(active).find(
|
|
24780
|
+
(entry) => path9.resolve(entry.repoPath) === path9.resolve(active.repoPath) && entry.profile === active.profile
|
|
24781
|
+
)?.source,
|
|
24782
|
+
repositoryId: profileConfigEntries(active).find(
|
|
24783
|
+
(entry) => path9.resolve(entry.repoPath) === path9.resolve(active.repoPath) && entry.profile === active.profile
|
|
24784
|
+
)?.repositoryId
|
|
24785
|
+
}),
|
|
24786
|
+
profiles
|
|
24787
|
+
};
|
|
24788
|
+
}
|
|
24789
|
+
async function loadOpenPondProfileStateForRef(ref) {
|
|
24790
|
+
if (!ref) return loadOpenPondProfileState();
|
|
24791
|
+
const active = (await loadGlobalConfig()).openpondProfile;
|
|
24792
|
+
const entry = profileConfigEntries(active).find(
|
|
24793
|
+
(candidate) => candidate.source === ref.source && candidate.repositoryId === ref.repositoryId && candidate.profile === ref.profileId
|
|
24794
|
+
);
|
|
24795
|
+
if (!entry) {
|
|
24796
|
+
return emptyProfileState(
|
|
24797
|
+
`Profile "${ref.profileId}" is not installed on this device.`
|
|
24798
|
+
);
|
|
24799
|
+
}
|
|
24800
|
+
return loadOpenPondProfileStateForConfig({
|
|
24801
|
+
repoPath: entry.repoPath,
|
|
24802
|
+
profile: entry.profile,
|
|
24803
|
+
mode: "local",
|
|
24804
|
+
...entry.lastCheck ? { lastCheck: entry.lastCheck } : {},
|
|
24805
|
+
...entry.lastPush ? { lastPush: entry.lastPush } : {}
|
|
24806
|
+
});
|
|
24807
|
+
}
|
|
24808
|
+
async function selectOpenPondProfile(ref) {
|
|
24809
|
+
const config2 = (await loadGlobalConfig()).openpondProfile;
|
|
24810
|
+
const entry = profileConfigEntries(config2).find(
|
|
24811
|
+
(candidate) => candidate.source === ref.source && candidate.repositoryId === ref.repositoryId && candidate.profile === ref.profileId
|
|
24812
|
+
);
|
|
24813
|
+
if (!entry)
|
|
24814
|
+
throw new Error(
|
|
24815
|
+
`Profile "${ref.profileId}" is not installed on this device.`
|
|
24816
|
+
);
|
|
24817
|
+
await saveGlobalConfig({
|
|
24818
|
+
openpondProfile: mergeActiveLocalProfileConfig(
|
|
24819
|
+
config2,
|
|
24820
|
+
entry.repoPath,
|
|
24821
|
+
entry.profile
|
|
24822
|
+
)
|
|
24823
|
+
});
|
|
24824
|
+
return loadOpenPondProfileState();
|
|
24825
|
+
}
|
|
24826
|
+
async function removeOpenPondProfile(ref) {
|
|
24827
|
+
const config2 = (await loadGlobalConfig()).openpondProfile;
|
|
24828
|
+
if (!config2) return { lastUsed: null, profiles: [] };
|
|
24829
|
+
const remaining = profileConfigEntries(config2).filter(
|
|
24830
|
+
(candidate) => candidate.source !== ref.source || candidate.repositoryId !== ref.repositoryId || candidate.profile !== ref.profileId
|
|
24831
|
+
);
|
|
24832
|
+
if (remaining.length === 0) {
|
|
24833
|
+
await saveGlobalConfig({ openpondProfile: null });
|
|
24834
|
+
return { lastUsed: null, profiles: [] };
|
|
24835
|
+
}
|
|
24836
|
+
const currentRemoved = path9.resolve(config2.repoPath) === path9.resolve(
|
|
24837
|
+
profileConfigEntries(config2).find(
|
|
24838
|
+
(candidate) => candidate.source === ref.source && candidate.repositoryId === ref.repositoryId && candidate.profile === ref.profileId
|
|
24839
|
+
)?.repoPath ?? ""
|
|
24840
|
+
) && config2.profile === ref.profileId;
|
|
24841
|
+
const next = currentRemoved ? remaining[0] : remaining.find(
|
|
24842
|
+
(entry) => path9.resolve(entry.repoPath) === path9.resolve(config2.repoPath) && entry.profile === config2.profile
|
|
24843
|
+
) ?? remaining[0];
|
|
24844
|
+
await saveGlobalConfig({
|
|
24845
|
+
openpondProfile: {
|
|
24846
|
+
repoPath: next.repoPath,
|
|
24847
|
+
profile: next.profile,
|
|
24848
|
+
mode: "local",
|
|
24849
|
+
profiles: remaining,
|
|
24850
|
+
...next.lastCheck ? { lastCheck: next.lastCheck } : {},
|
|
24851
|
+
...next.lastPush ? { lastPush: next.lastPush } : {}
|
|
24852
|
+
}
|
|
24853
|
+
});
|
|
24854
|
+
return loadOpenPondProfileLibrary();
|
|
24855
|
+
}
|
|
24856
|
+
async function loadOpenPondProfileStateForConfig(active) {
|
|
24756
24857
|
try {
|
|
24757
24858
|
const manifest = await readProfileManifest(active.repoPath);
|
|
24758
24859
|
const sourcePath = profileSourcePath(
|
|
@@ -24885,7 +24986,9 @@ async function runProfileSdkCommand(input) {
|
|
|
24885
24986
|
inherit: input.inherit,
|
|
24886
24987
|
throwOnFailure: false
|
|
24887
24988
|
});
|
|
24888
|
-
|
|
24989
|
+
if (input.command === "inspect" || input.command === "build" || input.command === "validate" || input.command === "eval") {
|
|
24990
|
+
await saveProfileCheckStatus(input.command, result.code);
|
|
24991
|
+
}
|
|
24889
24992
|
if (result.code !== 0) {
|
|
24890
24993
|
const detail = result.stderr.trim() || result.stdout.trim();
|
|
24891
24994
|
throw new Error(
|
|
@@ -24993,10 +25096,14 @@ async function commitActiveProfileChanges(message) {
|
|
|
24993
25096
|
async function saveProfilePushStatus(status) {
|
|
24994
25097
|
const config2 = (await loadGlobalConfig()).openpondProfile;
|
|
24995
25098
|
if (!config2) return;
|
|
25099
|
+
const profiles = profileConfigEntries(config2).map(
|
|
25100
|
+
(entry) => path9.resolve(entry.repoPath) === path9.resolve(config2.repoPath) && entry.profile === config2.profile ? { ...entry, lastPush: status } : entry
|
|
25101
|
+
);
|
|
24996
25102
|
await saveGlobalConfig({
|
|
24997
25103
|
openpondProfile: {
|
|
24998
25104
|
...config2,
|
|
24999
|
-
lastPush: status
|
|
25105
|
+
lastPush: status,
|
|
25106
|
+
profiles
|
|
25000
25107
|
}
|
|
25001
25108
|
});
|
|
25002
25109
|
}
|
|
@@ -25004,16 +25111,21 @@ async function saveProfileCheckStatus(command, exitCode) {
|
|
|
25004
25111
|
const config2 = (await loadGlobalConfig()).openpondProfile;
|
|
25005
25112
|
if (!config2) return;
|
|
25006
25113
|
const sourceHead = await profileGitHead(config2.repoPath).catch(() => null);
|
|
25114
|
+
const lastCheck = {
|
|
25115
|
+
command,
|
|
25116
|
+
status: exitCode === 0 ? "passed" : "failed",
|
|
25117
|
+
checkedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
25118
|
+
exitCode,
|
|
25119
|
+
sourceHead
|
|
25120
|
+
};
|
|
25121
|
+
const profiles = profileConfigEntries(config2).map(
|
|
25122
|
+
(entry) => path9.resolve(entry.repoPath) === path9.resolve(config2.repoPath) && entry.profile === config2.profile ? { ...entry, lastCheck } : entry
|
|
25123
|
+
);
|
|
25007
25124
|
await saveGlobalConfig({
|
|
25008
25125
|
openpondProfile: {
|
|
25009
25126
|
...config2,
|
|
25010
|
-
lastCheck
|
|
25011
|
-
|
|
25012
|
-
status: exitCode === 0 ? "passed" : "failed",
|
|
25013
|
-
checkedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
25014
|
-
exitCode,
|
|
25015
|
-
sourceHead
|
|
25016
|
-
}
|
|
25127
|
+
lastCheck,
|
|
25128
|
+
profiles
|
|
25017
25129
|
}
|
|
25018
25130
|
});
|
|
25019
25131
|
}
|
|
@@ -25033,7 +25145,7 @@ async function ensureProfileSource(profileSourcePath2, template, force) {
|
|
|
25033
25145
|
});
|
|
25034
25146
|
await rewriteTemplateSdkDependency(profileSourcePath2, sdkRoot);
|
|
25035
25147
|
}
|
|
25036
|
-
async function ensureProfileScaffoldFiles(repoPath, profileSourcePath2, profile) {
|
|
25148
|
+
async function ensureProfileScaffoldFiles(repoPath, profileSourcePath2, profile, options = {}) {
|
|
25037
25149
|
await mkdir(path9.join(repoPath, "profiles"), { recursive: true });
|
|
25038
25150
|
for (const dir of [
|
|
25039
25151
|
"agents",
|
|
@@ -25050,15 +25162,18 @@ async function ensureProfileScaffoldFiles(repoPath, profileSourcePath2, profile)
|
|
|
25050
25162
|
}
|
|
25051
25163
|
const profileManifestPath = path9.join(profileSourcePath2, PROFILE_MANIFEST);
|
|
25052
25164
|
if (!existsSync4(profileManifestPath)) {
|
|
25165
|
+
const agentLines = options.includeDefaultAgent === false ? ["agents: []"] : [
|
|
25166
|
+
"agents:",
|
|
25167
|
+
` - id: ${DEFAULT_PROFILE_AGENT}`,
|
|
25168
|
+
" path: agent/agent.ts",
|
|
25169
|
+
" enabled: true"
|
|
25170
|
+
];
|
|
25053
25171
|
await writeFile2(
|
|
25054
25172
|
profileManifestPath,
|
|
25055
25173
|
[
|
|
25056
25174
|
"schema: openpond.profile.v1",
|
|
25057
25175
|
`profile: ${profile}`,
|
|
25058
|
-
|
|
25059
|
-
` - id: ${DEFAULT_PROFILE_AGENT}`,
|
|
25060
|
-
" path: agent/agent.ts",
|
|
25061
|
-
" enabled: true",
|
|
25176
|
+
...agentLines,
|
|
25062
25177
|
""
|
|
25063
25178
|
].join("\n"),
|
|
25064
25179
|
"utf8"
|
|
@@ -25452,6 +25567,95 @@ function profileSourcePath(manifest, repoPath, profile) {
|
|
|
25452
25567
|
}
|
|
25453
25568
|
return sourcePath;
|
|
25454
25569
|
}
|
|
25570
|
+
function verifyAgentPackageIntegrity(agentPackage) {
|
|
25571
|
+
let totalSizeBytes = 0;
|
|
25572
|
+
const seen = /* @__PURE__ */ new Set();
|
|
25573
|
+
for (const file2 of agentPackage.source.files) {
|
|
25574
|
+
const filePath = normalizeAgentPackagePath(file2.path);
|
|
25575
|
+
if (seen.has(filePath)) {
|
|
25576
|
+
throw new Error(
|
|
25577
|
+
`Agent package contains duplicate source path ${filePath}.`
|
|
25578
|
+
);
|
|
25579
|
+
}
|
|
25580
|
+
seen.add(filePath);
|
|
25581
|
+
const bytes = Buffer.from(file2.contentsBase64, "base64");
|
|
25582
|
+
if (bytes.byteLength !== file2.sizeBytes || createHash4("sha256").update(bytes).digest("hex") !== file2.sha256) {
|
|
25583
|
+
throw new Error(`Agent package source checksum failed for ${filePath}.`);
|
|
25584
|
+
}
|
|
25585
|
+
totalSizeBytes += bytes.byteLength;
|
|
25586
|
+
}
|
|
25587
|
+
if (totalSizeBytes !== agentPackage.source.totalSizeBytes) {
|
|
25588
|
+
throw new Error("Agent package source size does not match its manifest.");
|
|
25589
|
+
}
|
|
25590
|
+
const { digest: _digest, versionId: _versionId, ...canonical } = agentPackage;
|
|
25591
|
+
const digest = createHash4("sha256").update(stableAgentPackageJson(canonical)).digest("hex");
|
|
25592
|
+
if (digest !== agentPackage.digest || agentPackage.versionId !== `agent-${digest.slice(0, 20)}`) {
|
|
25593
|
+
throw new Error("Agent package content digest does not match its version.");
|
|
25594
|
+
}
|
|
25595
|
+
}
|
|
25596
|
+
async function materializeAgentPackage(target, agentPackage) {
|
|
25597
|
+
await mkdir(target, { recursive: true, mode: 448 });
|
|
25598
|
+
for (const file2 of agentPackage.source.files) {
|
|
25599
|
+
const relativePath = normalizeAgentPackagePath(file2.path);
|
|
25600
|
+
const destination = path9.resolve(target, relativePath);
|
|
25601
|
+
if (!destination.startsWith(`${path9.resolve(target)}${path9.sep}`)) {
|
|
25602
|
+
throw new Error("Agent package source path escapes its install root.");
|
|
25603
|
+
}
|
|
25604
|
+
await mkdir(path9.dirname(destination), { recursive: true, mode: 448 });
|
|
25605
|
+
let bytes = Buffer.from(file2.contentsBase64, "base64");
|
|
25606
|
+
if (relativePath === "package.json") {
|
|
25607
|
+
const packageJson = JSON.parse(bytes.toString("utf8"));
|
|
25608
|
+
packageJson.dependencies = {
|
|
25609
|
+
...packageJson.dependencies ?? {},
|
|
25610
|
+
"openpond-agent-sdk": `file:${resolveAgentSdkRoot()}`
|
|
25611
|
+
};
|
|
25612
|
+
bytes = Buffer.from(`${JSON.stringify(packageJson, null, 2)}
|
|
25613
|
+
`, "utf8");
|
|
25614
|
+
}
|
|
25615
|
+
await writeFile2(destination, bytes, { mode: 384, flag: "wx" });
|
|
25616
|
+
}
|
|
25617
|
+
const provenancePath = path9.join(
|
|
25618
|
+
target,
|
|
25619
|
+
".openpond",
|
|
25620
|
+
"agent-package-origin.json"
|
|
25621
|
+
);
|
|
25622
|
+
await mkdir(path9.dirname(provenancePath), { recursive: true, mode: 448 });
|
|
25623
|
+
await writeFile2(
|
|
25624
|
+
provenancePath,
|
|
25625
|
+
`${JSON.stringify(
|
|
25626
|
+
{
|
|
25627
|
+
schema: "openpond.agent-package-origin.v1",
|
|
25628
|
+
agentId: agentPackage.agentId,
|
|
25629
|
+
versionId: agentPackage.versionId,
|
|
25630
|
+
digest: agentPackage.digest,
|
|
25631
|
+
validationReceiptIds: agentPackage.receipts.filter((receipt) => receipt.kind === "sdk_validation").map((receipt) => receipt.id),
|
|
25632
|
+
evalReceiptIds: agentPackage.receipts.filter((receipt) => receipt.kind === "sdk_eval").map((receipt) => receipt.id)
|
|
25633
|
+
},
|
|
25634
|
+
null,
|
|
25635
|
+
2
|
|
25636
|
+
)}
|
|
25637
|
+
`,
|
|
25638
|
+
{ mode: 384, flag: "wx" }
|
|
25639
|
+
);
|
|
25640
|
+
}
|
|
25641
|
+
function normalizeAgentPackagePath(value) {
|
|
25642
|
+
const normalized = value.trim().replaceAll("\\", "/");
|
|
25643
|
+
const clean = path9.posix.normalize(normalized);
|
|
25644
|
+
if (!clean || clean === "." || clean === ".." || clean.startsWith("/") || clean.startsWith("../") || clean.split("/").some((part) => part === "..")) {
|
|
25645
|
+
throw new Error(`Agent package contains an invalid source path: ${value}.`);
|
|
25646
|
+
}
|
|
25647
|
+
return clean;
|
|
25648
|
+
}
|
|
25649
|
+
function stableAgentPackageJson(value) {
|
|
25650
|
+
return JSON.stringify(sortAgentPackageJson(value));
|
|
25651
|
+
}
|
|
25652
|
+
function sortAgentPackageJson(value) {
|
|
25653
|
+
if (Array.isArray(value)) return value.map(sortAgentPackageJson);
|
|
25654
|
+
if (!value || typeof value !== "object") return value;
|
|
25655
|
+
return Object.fromEntries(
|
|
25656
|
+
Object.entries(value).sort(([left], [right]) => left.localeCompare(right)).map(([key, child]) => [key, sortAgentPackageJson(child)])
|
|
25657
|
+
);
|
|
25658
|
+
}
|
|
25455
25659
|
function resolveAgentSdkRoot() {
|
|
25456
25660
|
const packageJsonPath = require2.resolve("openpond-agent-sdk/package.json");
|
|
25457
25661
|
return path9.dirname(packageJsonPath);
|
|
@@ -25628,7 +25832,6 @@ export {
|
|
|
25628
25832
|
getOpChatModel,
|
|
25629
25833
|
getOpChatProvider,
|
|
25630
25834
|
getOpenPondAccount,
|
|
25631
|
-
getOpenPondAccountBalance,
|
|
25632
25835
|
getOpenToolRecipe,
|
|
25633
25836
|
getOpenToolRules,
|
|
25634
25837
|
getScheduleExecutionLog,
|
|
@@ -25639,6 +25842,7 @@ export {
|
|
|
25639
25842
|
hostedRunSummaryFromPayload,
|
|
25640
25843
|
hostedSourceCheckStatusFromPayload,
|
|
25641
25844
|
initLocalProfileRepo,
|
|
25845
|
+
installAgentPackageIntoActiveProfile,
|
|
25642
25846
|
listAppSchedules,
|
|
25643
25847
|
listApps,
|
|
25644
25848
|
listConfiguredProfiles,
|
|
@@ -25654,14 +25858,19 @@ export {
|
|
|
25654
25858
|
loadConfig,
|
|
25655
25859
|
loadGlobalConfig,
|
|
25656
25860
|
loadLocalProfileRepo,
|
|
25861
|
+
loadOpenPondProfileLibrary,
|
|
25657
25862
|
loadOpenPondProfileState,
|
|
25863
|
+
loadOpenPondProfileStateForRef,
|
|
25658
25864
|
mergeActiveLocalProfileConfig,
|
|
25659
25865
|
mergeProfileRepoManifestEntry,
|
|
25660
25866
|
normalizeDataFrames,
|
|
25661
25867
|
normalizeSandboxApiUrl,
|
|
25868
|
+
openPondProfileRef,
|
|
25662
25869
|
parseSandboxTemplateYaml,
|
|
25663
25870
|
postAgentDigest,
|
|
25664
25871
|
promotePreviewToProduction,
|
|
25872
|
+
registerLocalProfileRepo,
|
|
25873
|
+
removeOpenPondProfile,
|
|
25665
25874
|
renameActiveProfileAgent,
|
|
25666
25875
|
requireActiveLocalProfile,
|
|
25667
25876
|
resolveHostedChatApiBaseUrl,
|
|
@@ -25687,6 +25896,7 @@ export {
|
|
|
25687
25896
|
saveProfileApiKey,
|
|
25688
25897
|
saveProfilePushStatus,
|
|
25689
25898
|
searchOpenToolRecipes,
|
|
25899
|
+
selectOpenPondProfile,
|
|
25690
25900
|
sendHostedChatTurn,
|
|
25691
25901
|
setActiveProfile,
|
|
25692
25902
|
setCachedApps,
|
|
@@ -25696,7 +25906,6 @@ export {
|
|
|
25696
25906
|
stopAppSchedules,
|
|
25697
25907
|
stopCurrentAppSchedules,
|
|
25698
25908
|
streamHostedChatTurn,
|
|
25699
|
-
submitPositionsTx,
|
|
25700
25909
|
updateAppEnvironment,
|
|
25701
25910
|
validateSandboxTemplateManifest,
|
|
25702
25911
|
validateSandboxTemplateYaml
|