openpond 0.0.35 → 0.0.37
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 +4 -0
- package/dist/chunks/{app-layer-GUF2CKYH.js → app-layer-LF2HK2B2.js} +6 -3
- package/dist/chunks/{apps-DIVHAUOV.js → apps-ZMCMQZKX.js} +16 -12
- package/dist/chunks/{chunk-YPK2W34Z.js → chunk-2WMGA5FE.js} +8 -10
- package/dist/chunks/{chunk-NTRTK6C6.js → chunk-35PPAOWD.js} +2 -2
- package/dist/chunks/chunk-3VURZQHA.js +864 -0
- package/dist/chunks/{chunk-FRPL5XPX.js → chunk-43YI36NA.js} +1 -1
- package/dist/chunks/{chunk-4Y25BACE.js → chunk-A3CJUBA7.js} +1 -1
- package/dist/chunks/{chunk-RLQGMSW7.js → chunk-BWA3COR4.js} +573 -1204
- package/dist/chunks/{chunk-TXJ4TIDO.js → chunk-HLCTINEP.js} +1 -1
- package/dist/chunks/{chunk-GUGFYXFS.js → chunk-IATK3CIP.js} +6 -6
- package/dist/chunks/{chunk-2GV3QBBZ.js → chunk-ICLLW5QD.js} +1 -1
- package/dist/chunks/chunk-KSRWKXRB.js +12 -0
- package/dist/chunks/{chunk-II2ERA2H.js → chunk-KT2BB4AR.js} +30 -11
- package/dist/chunks/{chunk-XIF53VR3.js → chunk-LNKYEHIJ.js} +28 -3
- package/dist/chunks/{chunk-SECNDLPQ.js → chunk-MHBQWGCL.js} +1070 -57
- package/dist/chunks/chunk-MUMPWI4O.js +92 -0
- package/dist/chunks/{chunk-ZZOTKXRD.js → chunk-N6E6YSTP.js} +2 -2
- package/dist/chunks/{chunk-S3VA47DG.js → chunk-PGET7EZF.js} +7 -5
- package/dist/chunks/chunk-T4QXKU5Y.js +1 -0
- package/dist/chunks/{chunk-LUA5QGQP.js → chunk-VFL2JVBZ.js} +48 -121
- package/dist/chunks/{chunk-EY52SLOQ.js → chunk-WL76II47.js} +1 -1
- package/dist/chunks/{chunk-CRFB72X2.js → chunk-WTA33KQQ.js} +23 -19
- package/dist/chunks/{chunk-LHYK6QO2.js → chunk-XEJ7XXUQ.js} +1 -0
- package/dist/chunks/{chunk-2I5TZW66.js → chunk-ZPL4GZML.js} +128 -4
- package/dist/chunks/chunk-ZZ4ECDTP.js +668 -0
- package/dist/chunks/{cli-HUVI6ELM.js → cli-5NFIDCRL.js} +5 -5
- package/dist/chunks/cli-AS3DZ7XB.js +23 -0
- package/dist/chunks/{core-commands-2HUTKFHQ.js → core-commands-7223BEQL.js} +7 -4
- package/dist/chunks/{extend-PAJMXYKV.js → extend-6N5S5KA5.js} +18 -13
- package/dist/chunks/extension-FJSVCG2Q.js +121 -0
- package/dist/chunks/{harness-UWAS2VAN.js → harness-OMJXIGEW.js} +6 -3
- package/dist/chunks/{help-M7D2XAOX.js → help-YPPROIS7.js} +2 -1
- package/dist/chunks/{opchat-FQ2CJVM6.js → opchat-K7IYFPX6.js} +12 -7
- package/dist/chunks/{organizations-L5N6LJ7O.js → organizations-W3FMAWQ4.js} +8 -5
- package/dist/chunks/{profile-KH5IKVNY.js → profile-N4B3F7M7.js} +11 -8
- package/dist/chunks/{project-agent-F4NHVRGY.js → project-agent-NA6SGU25.js} +10 -7
- package/dist/chunks/{sandbox-command-DDXRQNB6.js → sandbox-command-AKCFJKKN.js} +7 -4
- package/dist/chunks/{sandbox-template-5EEEQKR5.js → sandbox-template-5NKTAXCL.js} +11 -7
- package/dist/chunks/{src-34FV42HE.js → src-SCS4KKP4.js} +2387 -1262
- package/dist/chunks/{src-LHZWUSD7.js → src-XAVSQTVR.js} +3 -3
- package/dist/chunks/{teams-bot-HFWO5GOV.js → teams-bot-557NZC73.js} +6 -3
- package/dist/chunks/{workspaces-LO44JAC2.js → workspaces-S2H75XQB.js} +6 -2
- package/dist/cli.js +14 -11
- package/dist/index.js +27 -9
- package/dist/profile/local-profile-types.d.ts +1 -0
- package/dist/profile/profile-skills.d.ts +2 -0
- package/dist/web/assets/{AppDialog-T3j6O3yg.js → AppDialog-y6krB0MJ.js} +1 -1
- package/dist/web/assets/{AppsView-70Qqf9eJ.js → AppsView-4F6oLktr.js} +1 -1
- package/dist/web/assets/{BrowserSidebar-CdBLHdNW.js → BrowserSidebar-C0MHQaaD.js} +1 -1
- package/dist/web/assets/{CloudWorkView-C5-jvlOo.js → CloudWorkView-DwFIZoXy.js} +1 -1
- package/dist/web/assets/CommandMenu-CYGFrMZi.js +1 -0
- package/dist/web/assets/{CommunityView-BHUJ9Hun.js → CommunityView-C6n89YXz.js} +1 -1
- package/dist/web/assets/ComposerCreateImproveStrip-C3RwXC3_.js +1 -0
- package/dist/web/assets/{GetStartedView-CIXScviw.js → GetStartedView-fwD0ZXo9.js} +1 -1
- package/dist/web/assets/LabSkillSidebar-BSuc-NJr.js +1 -0
- package/dist/web/assets/LabSkillSidebar-CVxtS9pd.css +1 -0
- package/dist/web/assets/LabsRoute-BrJkBNig.css +1 -0
- package/dist/web/assets/LabsRoute-D2y8dSsT.js +3 -0
- package/dist/web/assets/MainChatThread-Dj_Ry6WQ.js +2 -0
- package/dist/web/assets/{MakeAgentTutorialLearningPanel-r7jyZVc0.js → MakeAgentTutorialLearningPanel-Bz2VDaRe.js} +2 -2
- package/dist/web/assets/{MarkdownText-E35C404I.js → MarkdownText-B6Nu_0Fz.js} +4 -4
- package/dist/web/assets/Messages-CH2wfv2a.js +10 -0
- package/dist/web/assets/NativeSkillSidebar-4iUfgwqO.js +1 -0
- package/dist/web/assets/{NewProjectDialog-BowacUmA.js → NewProjectDialog-8M5-6-h-.js} +1 -1
- package/dist/web/assets/{PostTrainingLearningPanel-oJu5qaHK.js → PostTrainingLearningPanel-CdG5KHZs.js} +2 -2
- package/dist/web/assets/{PostTrainingStatusPill-B9Eoc4s0.js → PostTrainingStatusPill-COZ4qISQ.js} +1 -1
- package/dist/web/assets/{ProfileSettingsSection-Dnh92gDH.js → ProfileSettingsSection-Bo7dybgW.js} +1 -1
- package/dist/web/assets/RightChatPanelStack-Di8zoHJI.js +1 -0
- package/dist/web/assets/{SettingsView-uHhQnazW.css → SettingsView-BcYyY66X.css} +1 -1
- package/dist/web/assets/SettingsView-CAaKdDHt.js +6 -0
- package/dist/web/assets/{TeamChatView-Tn4X5cuY.js → TeamChatView-CzQYFBap.js} +2 -2
- package/dist/web/assets/{TerminalOverlay-DoX5LYzK.js → TerminalOverlay-B56XmI-k.js} +1 -1
- package/dist/web/assets/TrainingCreationPanel-C_ntWAAP.js +1 -0
- package/dist/web/assets/{TrainingDraftPanel-Da6uGu9y.js → TrainingDraftPanel-3hJIxLNn.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-DKky0p47.js → UsageSettingsSection-r3CqRm6Q.js} +1 -1
- package/dist/web/assets/WorkspaceDiffPanel-By8PWUuE.js +14 -0
- package/dist/web/assets/{WorkspaceEnvironmentMenu-Ba4M8z1N.js → WorkspaceEnvironmentMenu-7wmC-spz.js} +3 -3
- package/dist/web/assets/{WorkspaceGitDialogs-CSepNOb8.js → WorkspaceGitDialogs-Hn--lsRh.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-LhFdzCRs.js → WorkspaceMonacoEditor-CHd22UcG.js} +3 -3
- package/dist/web/assets/{activity-bW02ZsBD.js → activity-Dp5V58om.js} +1 -1
- package/dist/web/assets/{boxes-B1dRA1pi.js → boxes-DE7WJaEv.js} +1 -1
- package/dist/web/assets/{chevron-up-CySy6WNq.js → chevron-up-BWx8gGab.js} +1 -1
- package/dist/web/assets/{circle-x-DY8vKAKi.js → circle-x-DnmOfZIg.js} +1 -1
- package/dist/web/assets/{copy-DuHI1UZ_.js → copy-BjWvaXLC.js} +1 -1
- package/dist/web/assets/{create-pipeline-request-CGBcdK9r.js → create-pipeline-request-C4V6-lWN.js} +3 -3
- package/dist/web/assets/{credit-card-Bot0OuTl.js → credit-card-Bjg0Zaw5.js} +1 -1
- package/dist/web/assets/{cssMode-BIjAothW.js → cssMode-KFDYjM8T.js} +1 -1
- package/dist/web/assets/file-BrC1KjAS.js +1 -0
- package/dist/web/assets/{git-branch-Cm02aNWq.js → git-branch-DTeeARsp.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-FYILXW0v.js → git-commit-horizontal-C8UFKlXy.js} +1 -1
- package/dist/web/assets/{htmlMode-zO2xLLgL.js → htmlMode-NbLN3n6Q.js} +1 -1
- package/dist/web/assets/index-BcZetaeD.css +1 -0
- package/dist/web/assets/index-DQalqxbw.js +177 -0
- package/dist/web/assets/index-DYxF_d9i.js +1 -0
- package/dist/web/assets/{info-DeuEU_RO.js → info-BXBpMeVU.js} +1 -1
- package/dist/web/assets/{jsonMode-D2A3mj4n.js → jsonMode-Bl3r4LM_.js} +1 -1
- package/dist/web/assets/{lspLanguageFeatures-aPSqvscU.js → lspLanguageFeatures-DH22w5XD.js} +1 -1
- package/dist/web/assets/make-agent-tutorial-CAnTPFCK.js +2 -0
- package/dist/web/assets/{monaco.contribution-Do3Jjslo.js → monaco.contribution-C0BsxYAz.js} +2 -2
- package/dist/web/assets/{monaco.contribution-DAq6Jihl.js → monaco.contribution-CzpXjm9j.js} +2 -2
- package/dist/web/assets/{monaco.contribution-CHVe9CQ9.js → monaco.contribution-DK-g-i00.js} +2 -2
- package/dist/web/assets/{monaco.contribution-KqCt1n9-.js → monaco.contribution-iAurj7TQ.js} +2 -2
- package/dist/web/assets/{monitor-DXvHWFeW.js → monitor-Ba2FFblh.js} +1 -1
- package/dist/web/assets/{play-BIHyH-Yu.js → play-2NDQ4-7K.js} +1 -1
- package/dist/web/assets/{python-g3mtmU2J.js → python-CQ0TmUW9.js} +1 -1
- package/dist/web/assets/{refresh-cw-Daz0oqwK.js → refresh-cw-CyermMsy.js} +1 -1
- package/dist/web/assets/{reply-wu9DIBuK.js → reply-BSExNLHM.js} +1 -1
- package/dist/web/assets/{rotate-cw-D7q9GgNc.js → rotate-cw-DJ-zYG9E.js} +1 -1
- package/dist/web/assets/{save-BVFY6VTI.js → save-Bij3cc3Q.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-D9C_WUDu.js → toggleHighContrast-CxALivAH.js} +1 -1
- package/dist/web/assets/{training-1du5QD-P.css → training-BN8CALIc.css} +1 -1
- package/dist/web/assets/{tsMode-B4lEUN5X.js → tsMode-vH4lMS7h.js} +1 -1
- package/dist/web/assets/{upload-DNbYB4Rl.js → upload-DbJfEI3G.js} +1 -1
- package/dist/web/assets/{wifi-off-C5QLifIJ.js → wifi-off-BnVFBG28.js} +1 -1
- package/dist/web/assets/{workers-CV4BZb_x.js → workers-CBihj7z6.js} +1 -1
- package/dist/web/assets/{yaml-3ah8oX43.js → yaml-Bhkoq1sy.js} +1 -1
- package/dist/web/index.html +2 -2
- package/docs/command-reference.md +15 -0
- package/package.json +1 -1
- package/dist/chunks/cli-3AEIYSMD.js +0 -19
- package/dist/web/assets/CommandMenu-B3Y4MvmT.js +0 -1
- package/dist/web/assets/ComposerCreateImproveStrip-DeRI5XEO.js +0 -1
- package/dist/web/assets/LabsRoute-CgKtVYTP.css +0 -1
- package/dist/web/assets/LabsRoute-Cs_R1fuu.js +0 -3
- package/dist/web/assets/MainChatThread-h7VSA_Rc.js +0 -2
- package/dist/web/assets/Messages-BANZuAnA.js +0 -10
- package/dist/web/assets/NativeSkillSidebar-Qgccncuc.js +0 -1
- package/dist/web/assets/RightChatPanelStack-pGwbt6Wy.js +0 -1
- package/dist/web/assets/SettingsView-Bjehxwt1.js +0 -6
- package/dist/web/assets/TrainingCreationPanel-BLSf1Bnp.js +0 -1
- package/dist/web/assets/WorkspaceDiffPanel-DTRtW9n8.js +0 -14
- package/dist/web/assets/circle-alert-DMHz5tj_.js +0 -1
- package/dist/web/assets/index-B5AN29EO.js +0 -177
- package/dist/web/assets/index-BnwYyUgT.js +0 -1
- package/dist/web/assets/index-COGlKIJ4.css +0 -1
- package/dist/web/assets/make-agent-tutorial-A2W9Ajwv.js +0 -2
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
DEFAULT_OPENPOND_API_BASE_URL,
|
|
4
|
-
DEFAULT_OPENPOND_WEB_BASE_URL
|
|
5
|
-
|
|
6
|
-
resolveBaseUrl,
|
|
7
|
-
resolveSandboxApiUrlOption
|
|
8
|
-
} from "./chunk-YPK2W34Z.js";
|
|
9
|
-
import {
|
|
10
|
-
parseBooleanOption
|
|
11
|
-
} from "./chunk-LUA5QGQP.js";
|
|
4
|
+
DEFAULT_OPENPOND_WEB_BASE_URL
|
|
5
|
+
} from "./chunk-KSRWKXRB.js";
|
|
12
6
|
|
|
13
7
|
// ../../packages/cloud/src/api/core.ts
|
|
14
8
|
var DEFAULT_API_TIMEOUT_MS = 3e4;
|
|
@@ -89,16 +83,16 @@ async function readApiJson(response, label) {
|
|
|
89
83
|
}
|
|
90
84
|
return payload;
|
|
91
85
|
}
|
|
92
|
-
function boundedResponse(response,
|
|
86
|
+
function boundedResponse(response, input) {
|
|
93
87
|
if (!response.body) {
|
|
94
|
-
|
|
88
|
+
input.cleanup();
|
|
95
89
|
return response;
|
|
96
90
|
}
|
|
97
91
|
const contentLength = Number(response.headers.get("content-length"));
|
|
98
|
-
if (
|
|
99
|
-
|
|
92
|
+
if (input.maximumBytes > 0 && Number.isFinite(contentLength) && contentLength > input.maximumBytes) {
|
|
93
|
+
input.cleanup();
|
|
100
94
|
void response.body.cancel();
|
|
101
|
-
throw new ApiResponseTooLargeError(
|
|
95
|
+
throw new ApiResponseTooLargeError(input.maximumBytes, input.requestUrl);
|
|
102
96
|
}
|
|
103
97
|
const reader = response.body.getReader();
|
|
104
98
|
let receivedBytes = 0;
|
|
@@ -107,25 +101,25 @@ function boundedResponse(response, input3) {
|
|
|
107
101
|
try {
|
|
108
102
|
const result = await reader.read();
|
|
109
103
|
if (result.done) {
|
|
110
|
-
|
|
104
|
+
input.cleanup();
|
|
111
105
|
controller.close();
|
|
112
106
|
return;
|
|
113
107
|
}
|
|
114
108
|
receivedBytes += result.value.byteLength;
|
|
115
|
-
if (
|
|
116
|
-
|
|
109
|
+
if (input.maximumBytes > 0 && receivedBytes > input.maximumBytes) {
|
|
110
|
+
input.cleanup();
|
|
117
111
|
await reader.cancel();
|
|
118
|
-
controller.error(new ApiResponseTooLargeError(
|
|
112
|
+
controller.error(new ApiResponseTooLargeError(input.maximumBytes, input.requestUrl));
|
|
119
113
|
return;
|
|
120
114
|
}
|
|
121
115
|
controller.enqueue(result.value);
|
|
122
116
|
} catch (error) {
|
|
123
|
-
|
|
124
|
-
controller.error(
|
|
117
|
+
input.cleanup();
|
|
118
|
+
controller.error(input.timeoutController.signal.aborted ? input.timeoutError : error);
|
|
125
119
|
}
|
|
126
120
|
},
|
|
127
121
|
async cancel(reason) {
|
|
128
|
-
|
|
122
|
+
input.cleanup();
|
|
129
123
|
await reader.cancel(reason);
|
|
130
124
|
}
|
|
131
125
|
});
|
|
@@ -141,8 +135,8 @@ function composedSignal(callerSignal, timeoutSignal, timeoutMs) {
|
|
|
141
135
|
}
|
|
142
136
|
|
|
143
137
|
// ../../packages/cloud/src/api/deployments.ts
|
|
144
|
-
async function deployApp(baseUrl, token, appId,
|
|
145
|
-
const environment =
|
|
138
|
+
async function deployApp(baseUrl, token, appId, input) {
|
|
139
|
+
const environment = input?.environment ?? "production";
|
|
146
140
|
const response = await apiFetch(
|
|
147
141
|
baseUrl,
|
|
148
142
|
token,
|
|
@@ -151,8 +145,8 @@ async function deployApp(baseUrl, token, appId, input3) {
|
|
|
151
145
|
method: "POST",
|
|
152
146
|
body: JSON.stringify({
|
|
153
147
|
environment,
|
|
154
|
-
...
|
|
155
|
-
...
|
|
148
|
+
...input?.commitSha ? { commitSha: input.commitSha } : {},
|
|
149
|
+
...input?.branch ? { branch: input.branch } : {}
|
|
156
150
|
})
|
|
157
151
|
}
|
|
158
152
|
);
|
|
@@ -276,10 +270,10 @@ async function listApps(apiBase, token, options) {
|
|
|
276
270
|
const payload = await response.json().catch(() => ({}));
|
|
277
271
|
return Array.isArray(payload.apps) ? payload.apps : [];
|
|
278
272
|
}
|
|
279
|
-
async function createRepo(apiBase, apiKey,
|
|
273
|
+
async function createRepo(apiBase, apiKey, input) {
|
|
280
274
|
const response = await apiFetch(apiBase, apiKey, "/apps/repo/create", {
|
|
281
275
|
method: "POST",
|
|
282
|
-
body: JSON.stringify(
|
|
276
|
+
body: JSON.stringify(input)
|
|
283
277
|
});
|
|
284
278
|
if (!response.ok) {
|
|
285
279
|
const text = await response.text().catch(() => "");
|
|
@@ -342,14 +336,14 @@ async function listTemplateBranches(apiBase, token, appId) {
|
|
|
342
336
|
}
|
|
343
337
|
return await response.json();
|
|
344
338
|
}
|
|
345
|
-
async function deployLatestTemplate(apiBase, token, appId,
|
|
339
|
+
async function deployLatestTemplate(apiBase, token, appId, input) {
|
|
346
340
|
const response = await apiFetch(
|
|
347
341
|
apiBase,
|
|
348
342
|
token,
|
|
349
343
|
`/v4/apps/${appId}/template/deploy-latest`,
|
|
350
344
|
{
|
|
351
345
|
method: "POST",
|
|
352
|
-
body: JSON.stringify(
|
|
346
|
+
body: JSON.stringify(input)
|
|
353
347
|
}
|
|
354
348
|
);
|
|
355
349
|
if (!response.ok) {
|
|
@@ -358,14 +352,14 @@ async function deployLatestTemplate(apiBase, token, appId, input3) {
|
|
|
358
352
|
}
|
|
359
353
|
return await response.json();
|
|
360
354
|
}
|
|
361
|
-
async function updateAppEnvironment(apiBase, token, appId,
|
|
355
|
+
async function updateAppEnvironment(apiBase, token, appId, input) {
|
|
362
356
|
const response = await apiFetch(
|
|
363
357
|
apiBase,
|
|
364
358
|
token,
|
|
365
359
|
`/v4/apps/${appId}/environment`,
|
|
366
360
|
{
|
|
367
361
|
method: "POST",
|
|
368
|
-
body: JSON.stringify(
|
|
362
|
+
body: JSON.stringify(input)
|
|
369
363
|
}
|
|
370
364
|
);
|
|
371
365
|
if (!response.ok) {
|
|
@@ -806,13 +800,13 @@ function selectorFromAccount(account) {
|
|
|
806
800
|
}
|
|
807
801
|
function sanitizeActiveProfile(value) {
|
|
808
802
|
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
809
|
-
const
|
|
803
|
+
const input = value;
|
|
810
804
|
const handle = normalizeHandle(
|
|
811
|
-
typeof
|
|
805
|
+
typeof input.handle === "string" ? input.handle : void 0
|
|
812
806
|
);
|
|
813
807
|
if (!handle) return null;
|
|
814
808
|
const baseUrl = normalizeBaseUrl(
|
|
815
|
-
typeof
|
|
809
|
+
typeof input.baseUrl === "string" ? input.baseUrl : void 0
|
|
816
810
|
);
|
|
817
811
|
return baseUrl ? { handle, baseUrl } : { handle };
|
|
818
812
|
}
|
|
@@ -820,17 +814,17 @@ function sanitizeLocalOpenPondProfile(value) {
|
|
|
820
814
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
821
815
|
return void 0;
|
|
822
816
|
}
|
|
823
|
-
const
|
|
824
|
-
const repoPath = typeof
|
|
825
|
-
const profile = typeof
|
|
817
|
+
const input = value;
|
|
818
|
+
const repoPath = typeof input.repoPath === "string" ? input.repoPath.trim() : "";
|
|
819
|
+
const profile = typeof input.profile === "string" && input.profile.trim() ? input.profile.trim() : "default";
|
|
826
820
|
if (!repoPath) return void 0;
|
|
827
821
|
const out = {
|
|
828
822
|
repoPath,
|
|
829
823
|
profile,
|
|
830
824
|
mode: "local"
|
|
831
825
|
};
|
|
832
|
-
if (
|
|
833
|
-
const check =
|
|
826
|
+
if (input.lastCheck && typeof input.lastCheck === "object" && !Array.isArray(input.lastCheck)) {
|
|
827
|
+
const check = input.lastCheck;
|
|
834
828
|
const command = check.command;
|
|
835
829
|
const status = check.status;
|
|
836
830
|
const checkedAt = check.checkedAt;
|
|
@@ -844,8 +838,8 @@ function sanitizeLocalOpenPondProfile(value) {
|
|
|
844
838
|
};
|
|
845
839
|
}
|
|
846
840
|
}
|
|
847
|
-
if (
|
|
848
|
-
const push =
|
|
841
|
+
if (input.lastPush && typeof input.lastPush === "object" && !Array.isArray(input.lastPush)) {
|
|
842
|
+
const push = input.lastPush;
|
|
849
843
|
const status = push.status;
|
|
850
844
|
const pushedAt = push.pushedAt;
|
|
851
845
|
if ((status === "pushed" || status === "failed") && typeof pushedAt === "string") {
|
|
@@ -874,120 +868,120 @@ function sanitizeLocalOpenPondProfile(value) {
|
|
|
874
868
|
}
|
|
875
869
|
function sanitizeHostedMaterializationStatus(value) {
|
|
876
870
|
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
877
|
-
const
|
|
878
|
-
const status = stringField(
|
|
871
|
+
const input = value;
|
|
872
|
+
const status = stringField(input.status);
|
|
879
873
|
if (!status) return null;
|
|
880
874
|
return {
|
|
881
875
|
status,
|
|
882
|
-
...nullableStringProp(
|
|
883
|
-
...nullableStringProp(
|
|
884
|
-
...nullableStringProp(
|
|
885
|
-
...nullableStringProp(
|
|
886
|
-
...nullableStringProp(
|
|
887
|
-
...nullableStringProp(
|
|
888
|
-
...nullableStringProp(
|
|
889
|
-
...nullableStringProp(
|
|
890
|
-
...nullableStringProp(
|
|
891
|
-
...nullableNumberProp(
|
|
892
|
-
...nullableNumberProp(
|
|
893
|
-
...nullableStringProp(
|
|
894
|
-
...nullableBooleanProp(
|
|
895
|
-
...nullableStringProp(
|
|
896
|
-
...stringArrayProp(
|
|
897
|
-
...stringArrayProp(
|
|
898
|
-
...nullableStringProp(
|
|
899
|
-
...nullableStringProp(
|
|
876
|
+
...nullableStringProp(input, "agentId"),
|
|
877
|
+
...nullableStringProp(input, "runtimeAgentId"),
|
|
878
|
+
...nullableStringProp(input, "projectId"),
|
|
879
|
+
...nullableStringProp(input, "sourceRoot"),
|
|
880
|
+
...nullableStringProp(input, "sourceRef"),
|
|
881
|
+
...nullableStringProp(input, "sourceCommitSha"),
|
|
882
|
+
...nullableStringProp(input, "manifestHash"),
|
|
883
|
+
...nullableStringProp(input, "manifestPath"),
|
|
884
|
+
...nullableStringProp(input, "manifestSyncedAt"),
|
|
885
|
+
...nullableNumberProp(input, "fileCount"),
|
|
886
|
+
...nullableNumberProp(input, "totalBytes"),
|
|
887
|
+
...nullableStringProp(input, "generatedManifestPath"),
|
|
888
|
+
...nullableBooleanProp(input, "synthesizedOpenPondYaml"),
|
|
889
|
+
...nullableStringProp(input, "uploadMetadataPath"),
|
|
890
|
+
...stringArrayProp(input, "setupCommands"),
|
|
891
|
+
...stringArrayProp(input, "validationCommands"),
|
|
892
|
+
...nullableStringProp(input, "materializedAt"),
|
|
893
|
+
...nullableStringProp(input, "error")
|
|
900
894
|
};
|
|
901
895
|
}
|
|
902
896
|
function sanitizeHostedSourceCheckStatus(value) {
|
|
903
897
|
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
904
|
-
const
|
|
905
|
-
const status = stringField(
|
|
898
|
+
const input = value;
|
|
899
|
+
const status = stringField(input.status);
|
|
906
900
|
if (!status) return null;
|
|
907
901
|
return {
|
|
908
902
|
status,
|
|
909
|
-
...nullableStringProp(
|
|
910
|
-
...nullableStringProp(
|
|
911
|
-
...nullableStringProp(
|
|
912
|
-
...nullableBooleanProp(
|
|
913
|
-
...nullableBooleanProp(
|
|
914
|
-
...nullableStringProp(
|
|
915
|
-
...nullableStringProp(
|
|
916
|
-
...nullableStringProp(
|
|
917
|
-
...nullableStringProp(
|
|
918
|
-
...stringArrayProp(
|
|
919
|
-
...stringArrayProp(
|
|
920
|
-
...stringArrayProp(
|
|
921
|
-
...stringArrayProp(
|
|
922
|
-
...stringArrayProp(
|
|
923
|
-
...stringArrayProp(
|
|
924
|
-
...nullableStringProp(
|
|
925
|
-
...nullableStringProp(
|
|
926
|
-
...stringArrayProp(
|
|
927
|
-
...stringArrayProp(
|
|
928
|
-
...stringArrayProp(
|
|
929
|
-
...nullableStringProp(
|
|
930
|
-
...nullableStringProp(
|
|
903
|
+
...nullableStringProp(input, "agentId"),
|
|
904
|
+
...nullableStringProp(input, "workItemId"),
|
|
905
|
+
...nullableStringProp(input, "deployPlanStatus"),
|
|
906
|
+
...nullableBooleanProp(input, "canRun"),
|
|
907
|
+
...nullableBooleanProp(input, "canDeploy"),
|
|
908
|
+
...nullableStringProp(input, "sourceRef"),
|
|
909
|
+
...nullableStringProp(input, "sourceCommitSha"),
|
|
910
|
+
...nullableStringProp(input, "manifestHash"),
|
|
911
|
+
...nullableStringProp(input, "manifestPath"),
|
|
912
|
+
...stringArrayProp(input, "setupCommands"),
|
|
913
|
+
...stringArrayProp(input, "validationCommands"),
|
|
914
|
+
...stringArrayProp(input, "requiredChecks"),
|
|
915
|
+
...stringArrayProp(input, "evalNames"),
|
|
916
|
+
...stringArrayProp(input, "blockedReasons"),
|
|
917
|
+
...stringArrayProp(input, "staleReasons"),
|
|
918
|
+
...nullableStringProp(input, "runtimeId"),
|
|
919
|
+
...nullableStringProp(input, "sandboxId"),
|
|
920
|
+
...stringArrayProp(input, "traceArtifactRefs"),
|
|
921
|
+
...stringArrayProp(input, "evalResultArtifactRefs"),
|
|
922
|
+
...stringArrayProp(input, "validatorArtifactRefs"),
|
|
923
|
+
...nullableStringProp(input, "checkedAt"),
|
|
924
|
+
...nullableStringProp(input, "error")
|
|
931
925
|
};
|
|
932
926
|
}
|
|
933
927
|
function sanitizeHostedPublishStatus(value) {
|
|
934
928
|
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
935
|
-
const
|
|
936
|
-
const status = stringField(
|
|
929
|
+
const input = value;
|
|
930
|
+
const status = stringField(input.status);
|
|
937
931
|
if (!status) return null;
|
|
938
932
|
return {
|
|
939
933
|
status,
|
|
940
|
-
...nullableStringProp(
|
|
941
|
-
...nullableStringProp(
|
|
942
|
-
...nullableStringProp(
|
|
943
|
-
...nullableStringProp(
|
|
944
|
-
...nullableStringProp(
|
|
945
|
-
...nullableStringProp(
|
|
946
|
-
...nullableStringProp(
|
|
947
|
-
...nullableStringProp(
|
|
948
|
-
...nullableStringProp(
|
|
949
|
-
...nullableStringProp(
|
|
950
|
-
...nullableStringProp(
|
|
934
|
+
...nullableStringProp(input, "agentId"),
|
|
935
|
+
...nullableStringProp(input, "snapshotId"),
|
|
936
|
+
...nullableStringProp(input, "sourceRef"),
|
|
937
|
+
...nullableStringProp(input, "sourceCommitSha"),
|
|
938
|
+
...nullableStringProp(input, "manifestHash"),
|
|
939
|
+
...nullableStringProp(input, "manifestPath"),
|
|
940
|
+
...nullableStringProp(input, "buildStatus"),
|
|
941
|
+
...nullableStringProp(input, "validationStatus"),
|
|
942
|
+
...nullableStringProp(input, "evalStatus"),
|
|
943
|
+
...nullableStringProp(input, "publishedAt"),
|
|
944
|
+
...nullableStringProp(input, "error")
|
|
951
945
|
};
|
|
952
946
|
}
|
|
953
947
|
function sanitizeHostedRunSummary(value) {
|
|
954
948
|
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
955
|
-
const
|
|
956
|
-
const status = stringField(
|
|
949
|
+
const input = value;
|
|
950
|
+
const status = stringField(input.status);
|
|
957
951
|
if (!status) return null;
|
|
958
952
|
return {
|
|
959
953
|
status,
|
|
960
|
-
...nullableStringProp(
|
|
961
|
-
...nullableStringProp(
|
|
962
|
-
...nullableStringProp(
|
|
963
|
-
...nullableStringProp(
|
|
964
|
-
...nullableStringProp(
|
|
965
|
-
...nullableStringProp(
|
|
966
|
-
...nullableStringProp(
|
|
967
|
-
...nullableStringProp(
|
|
968
|
-
...stringArrayProp(
|
|
969
|
-
...stringArrayProp(
|
|
970
|
-
...stringArrayProp(
|
|
971
|
-
...stringArrayProp(
|
|
972
|
-
...nullableStringProp(
|
|
973
|
-
...nullableStringProp(
|
|
974
|
-
...nullableStringProp(
|
|
954
|
+
...nullableStringProp(input, "agentId"),
|
|
955
|
+
...nullableStringProp(input, "runId"),
|
|
956
|
+
...nullableStringProp(input, "runtimeId"),
|
|
957
|
+
...nullableStringProp(input, "sandboxId"),
|
|
958
|
+
...nullableStringProp(input, "sourceRef"),
|
|
959
|
+
...nullableStringProp(input, "sourceCommitSha"),
|
|
960
|
+
...nullableStringProp(input, "manifestHash"),
|
|
961
|
+
...nullableStringProp(input, "setupGateStatus"),
|
|
962
|
+
...stringArrayProp(input, "setupRequirementRefs"),
|
|
963
|
+
...stringArrayProp(input, "artifactRefs"),
|
|
964
|
+
...stringArrayProp(input, "traceArtifactRefs"),
|
|
965
|
+
...stringArrayProp(input, "evalArtifactRefs"),
|
|
966
|
+
...nullableStringProp(input, "startedAt"),
|
|
967
|
+
...nullableStringProp(input, "completedAt"),
|
|
968
|
+
...nullableStringProp(input, "error")
|
|
975
969
|
};
|
|
976
970
|
}
|
|
977
|
-
function nullableStringProp(
|
|
978
|
-
const value =
|
|
971
|
+
function nullableStringProp(input, key) {
|
|
972
|
+
const value = input[key];
|
|
979
973
|
return typeof value === "string" || value === null ? { [key]: value } : {};
|
|
980
974
|
}
|
|
981
|
-
function nullableBooleanProp(
|
|
982
|
-
const value =
|
|
975
|
+
function nullableBooleanProp(input, key) {
|
|
976
|
+
const value = input[key];
|
|
983
977
|
return typeof value === "boolean" || value === null ? { [key]: value } : {};
|
|
984
978
|
}
|
|
985
|
-
function nullableNumberProp(
|
|
986
|
-
const value =
|
|
979
|
+
function nullableNumberProp(input, key) {
|
|
980
|
+
const value = input[key];
|
|
987
981
|
return typeof value === "number" || value === null ? { [key]: value } : {};
|
|
988
982
|
}
|
|
989
|
-
function stringArrayProp(
|
|
990
|
-
const value =
|
|
983
|
+
function stringArrayProp(input, key) {
|
|
984
|
+
const value = input[key];
|
|
991
985
|
if (!Array.isArray(value)) return {};
|
|
992
986
|
const strings = value.filter((item) => typeof item === "string");
|
|
993
987
|
return { [key]: strings };
|
|
@@ -1024,33 +1018,33 @@ function sanitizeSession(value) {
|
|
|
1024
1018
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
1025
1019
|
return void 0;
|
|
1026
1020
|
}
|
|
1027
|
-
const
|
|
1021
|
+
const input = value;
|
|
1028
1022
|
const out = {};
|
|
1029
|
-
if (typeof
|
|
1030
|
-
if (typeof
|
|
1031
|
-
out.appId =
|
|
1023
|
+
if (typeof input.token === "string") out.token = input.token;
|
|
1024
|
+
if (typeof input.appId === "string" || input.appId === null) {
|
|
1025
|
+
out.appId = input.appId;
|
|
1032
1026
|
}
|
|
1033
|
-
if (typeof
|
|
1034
|
-
out.conversationId =
|
|
1027
|
+
if (typeof input.conversationId === "string" || input.conversationId === null) {
|
|
1028
|
+
out.conversationId = input.conversationId;
|
|
1035
1029
|
}
|
|
1036
1030
|
return Object.keys(out).length > 0 ? out : void 0;
|
|
1037
1031
|
}
|
|
1038
1032
|
function sanitizeAccount(value) {
|
|
1039
1033
|
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
1040
|
-
const
|
|
1034
|
+
const input = value;
|
|
1041
1035
|
const handle = normalizeHandle(
|
|
1042
|
-
typeof
|
|
1036
|
+
typeof input.handle === "string" ? input.handle : void 0
|
|
1043
1037
|
);
|
|
1044
1038
|
if (!handle) return null;
|
|
1045
1039
|
const out = { handle };
|
|
1046
|
-
if (typeof
|
|
1047
|
-
if (typeof
|
|
1048
|
-
if (typeof
|
|
1049
|
-
if (typeof
|
|
1050
|
-
out.chatApiBaseUrl =
|
|
1051
|
-
if (typeof
|
|
1052
|
-
out.environment =
|
|
1053
|
-
const session = sanitizeSession(
|
|
1040
|
+
if (typeof input.apiKey === "string") out.apiKey = input.apiKey;
|
|
1041
|
+
if (typeof input.baseUrl === "string") out.baseUrl = input.baseUrl;
|
|
1042
|
+
if (typeof input.apiBaseUrl === "string") out.apiBaseUrl = input.apiBaseUrl;
|
|
1043
|
+
if (typeof input.chatApiBaseUrl === "string")
|
|
1044
|
+
out.chatApiBaseUrl = input.chatApiBaseUrl;
|
|
1045
|
+
if (typeof input.environment === "string")
|
|
1046
|
+
out.environment = input.environment;
|
|
1047
|
+
const session = sanitizeSession(input.session);
|
|
1054
1048
|
if (session) out.session = session;
|
|
1055
1049
|
return out;
|
|
1056
1050
|
}
|
|
@@ -1374,12 +1368,12 @@ async function setActiveProfile(handle, options = {}) {
|
|
|
1374
1368
|
const profiles = await listConfiguredProfiles();
|
|
1375
1369
|
return profiles.find((profile) => profile.isActive) ?? profiles[selectedIndex];
|
|
1376
1370
|
}
|
|
1377
|
-
async function saveProfileApiKey(
|
|
1378
|
-
const handle = requireHandle(
|
|
1379
|
-
const apiKey = requireApiKey(
|
|
1380
|
-
const baseUrl = normalizeBaseUrl(
|
|
1381
|
-
const apiBaseUrl = normalizeBaseUrl(
|
|
1382
|
-
const chatApiBaseUrl = normalizeBaseUrl(
|
|
1371
|
+
async function saveProfileApiKey(input) {
|
|
1372
|
+
const handle = requireHandle(input.handle);
|
|
1373
|
+
const apiKey = requireApiKey(input.apiKey);
|
|
1374
|
+
const baseUrl = normalizeBaseUrl(input.baseUrl);
|
|
1375
|
+
const apiBaseUrl = normalizeBaseUrl(input.apiBaseUrl);
|
|
1376
|
+
const chatApiBaseUrl = normalizeBaseUrl(input.chatApiBaseUrl);
|
|
1383
1377
|
let savedSelector = { handle };
|
|
1384
1378
|
await updateGlobalConfig((global) => {
|
|
1385
1379
|
const accounts = global.accounts ?? [];
|
|
@@ -1387,16 +1381,16 @@ async function saveProfileApiKey(input3) {
|
|
|
1387
1381
|
account.apiKey = apiKey;
|
|
1388
1382
|
if (baseUrl) account.baseUrl = baseUrl;
|
|
1389
1383
|
if (apiBaseUrl) account.apiBaseUrl = apiBaseUrl;
|
|
1390
|
-
else if (
|
|
1384
|
+
else if (input.apiBaseUrl === null) delete account.apiBaseUrl;
|
|
1391
1385
|
if (chatApiBaseUrl) account.chatApiBaseUrl = chatApiBaseUrl;
|
|
1392
|
-
else if (
|
|
1393
|
-
if (
|
|
1394
|
-
else if (typeof
|
|
1395
|
-
account.environment =
|
|
1386
|
+
else if (input.chatApiBaseUrl === null) delete account.chatApiBaseUrl;
|
|
1387
|
+
if (input.environment === null) delete account.environment;
|
|
1388
|
+
else if (typeof input.environment === "string" && input.environment.trim()) {
|
|
1389
|
+
account.environment = input.environment.trim();
|
|
1396
1390
|
}
|
|
1397
1391
|
global.accounts = accounts;
|
|
1398
1392
|
savedSelector = selectorFromAccount(account);
|
|
1399
|
-
if (
|
|
1393
|
+
if (input.setActive !== false) global.activeProfile = savedSelector;
|
|
1400
1394
|
});
|
|
1401
1395
|
const profiles = await listConfiguredProfiles();
|
|
1402
1396
|
const saved = profiles.find((profile) => {
|
|
@@ -1416,102 +1410,6 @@ async function saveGlobalConfig(next) {
|
|
|
1416
1410
|
});
|
|
1417
1411
|
}
|
|
1418
1412
|
|
|
1419
|
-
// src/cli/common/auth.ts
|
|
1420
|
-
import { stdin as input, stdout as output } from "node:process";
|
|
1421
|
-
import { createInterface } from "node:readline/promises";
|
|
1422
|
-
var UI_API_KEY_URL = `${DEFAULT_OPENPOND_WEB_BASE_URL}/settings/api-keys`;
|
|
1423
|
-
function resolveApiKey(config) {
|
|
1424
|
-
const envKey = process.env.OPENPOND_API_KEY?.trim();
|
|
1425
|
-
if (envKey) return envKey;
|
|
1426
|
-
const stored = config.apiKey?.trim();
|
|
1427
|
-
if (stored) return stored;
|
|
1428
|
-
const legacy = config.token?.trim();
|
|
1429
|
-
if (legacy && legacy.startsWith("opk_")) return legacy;
|
|
1430
|
-
return null;
|
|
1431
|
-
}
|
|
1432
|
-
async function promptForApiKey() {
|
|
1433
|
-
if (!input.isTTY || !output.isTTY) {
|
|
1434
|
-
throw new Error(
|
|
1435
|
-
"OpenPond API key is required in non-interactive mode. Set OPENPOND_API_KEY or run `openpond login` in a terminal."
|
|
1436
|
-
);
|
|
1437
|
-
}
|
|
1438
|
-
console.log("Open the OpenPond UI to create an API key:");
|
|
1439
|
-
console.log(UI_API_KEY_URL);
|
|
1440
|
-
const rl = createInterface({ input, output });
|
|
1441
|
-
try {
|
|
1442
|
-
const value = (await rl.question("Paste your OpenPond API key: ")).trim();
|
|
1443
|
-
if (!value) {
|
|
1444
|
-
throw new Error("API key is required");
|
|
1445
|
-
}
|
|
1446
|
-
if (!value.startsWith("opk_")) {
|
|
1447
|
-
console.log("warning: API keys usually start with opk_.");
|
|
1448
|
-
}
|
|
1449
|
-
return value;
|
|
1450
|
-
} finally {
|
|
1451
|
-
rl.close();
|
|
1452
|
-
}
|
|
1453
|
-
}
|
|
1454
|
-
async function ensureApiKey(config, baseUrl) {
|
|
1455
|
-
const existing = resolveApiKey(config);
|
|
1456
|
-
if (existing) return existing;
|
|
1457
|
-
const apiKey = await promptForApiKey();
|
|
1458
|
-
await saveGlobalConfig({
|
|
1459
|
-
apiKey,
|
|
1460
|
-
baseUrl,
|
|
1461
|
-
activeProfile: config.activeProfile
|
|
1462
|
-
});
|
|
1463
|
-
console.log("saved api key to ~/.openpond/config.json");
|
|
1464
|
-
return apiKey;
|
|
1465
|
-
}
|
|
1466
|
-
|
|
1467
|
-
// src/cli/common/repo-format.ts
|
|
1468
|
-
function resolveRepoUrl(response) {
|
|
1469
|
-
if (response.repoUrl) return response.repoUrl;
|
|
1470
|
-
if (response.gitHost && response.gitOwner && response.gitRepo) {
|
|
1471
|
-
return `https://${response.gitHost}/${response.gitOwner}/${response.gitRepo}.git`;
|
|
1472
|
-
}
|
|
1473
|
-
throw new Error("repoUrl missing from API response");
|
|
1474
|
-
}
|
|
1475
|
-
function formatTokenizedRepoUrl(repoUrl, token) {
|
|
1476
|
-
const url = new URL(repoUrl);
|
|
1477
|
-
const encodedToken = encodeURIComponent(token);
|
|
1478
|
-
return `${url.protocol}//x-access-token:${encodedToken}@${url.host}${url.pathname}`;
|
|
1479
|
-
}
|
|
1480
|
-
function formatTokenizedRepoUrlForPrint(repoUrl) {
|
|
1481
|
-
const url = new URL(repoUrl);
|
|
1482
|
-
return `${url.protocol}//x-access-token:$OPENPOND_API_KEY@${url.host}${url.pathname}`;
|
|
1483
|
-
}
|
|
1484
|
-
function redactToken(value) {
|
|
1485
|
-
return value.replace(/x-access-token:[^@]+@/g, "x-access-token:***@");
|
|
1486
|
-
}
|
|
1487
|
-
function warnOnRepoHostMismatch(repoUrl) {
|
|
1488
|
-
const envBase = process.env.OPENPOND_BASE_URL;
|
|
1489
|
-
if (!envBase) return;
|
|
1490
|
-
try {
|
|
1491
|
-
const baseHost = new URL(envBase).hostname;
|
|
1492
|
-
const repoHost = new URL(repoUrl).hostname;
|
|
1493
|
-
if (baseHost && repoHost && baseHost !== repoHost) {
|
|
1494
|
-
console.warn(
|
|
1495
|
-
`warning: repo host (${repoHost}) does not match OPENPOND_BASE_URL (${baseHost})`
|
|
1496
|
-
);
|
|
1497
|
-
console.warn(
|
|
1498
|
-
"warning: verify your git host configuration matches OPENPOND_BASE_URL."
|
|
1499
|
-
);
|
|
1500
|
-
}
|
|
1501
|
-
} catch {
|
|
1502
|
-
}
|
|
1503
|
-
}
|
|
1504
|
-
function parseHandleRepo(value) {
|
|
1505
|
-
const parts = value.split("/").filter(Boolean);
|
|
1506
|
-
if (parts.length !== 2) {
|
|
1507
|
-
throw new Error("expected <handle>/<repo>");
|
|
1508
|
-
}
|
|
1509
|
-
return { handle: parts[0], repo: parts[1] };
|
|
1510
|
-
}
|
|
1511
|
-
function normalizeRepoName(value) {
|
|
1512
|
-
return (value || "").trim().toLowerCase();
|
|
1513
|
-
}
|
|
1514
|
-
|
|
1515
1413
|
// ../../packages/cloud/src/cache.ts
|
|
1516
1414
|
import { promises as fs3 } from "node:fs";
|
|
1517
1415
|
import { createHash } from "node:crypto";
|
|
@@ -1602,260 +1500,128 @@ async function mutateCache(mutate) {
|
|
|
1602
1500
|
});
|
|
1603
1501
|
}
|
|
1604
1502
|
|
|
1605
|
-
// src/
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
apiKey: params.apiKey,
|
|
1611
|
-
ttlMs: DEFAULT_CACHE_TTL_MS
|
|
1612
|
-
});
|
|
1613
|
-
if (cached) {
|
|
1614
|
-
return cached;
|
|
1615
|
-
}
|
|
1503
|
+
// ../../packages/cloud/src/sandbox/url.ts
|
|
1504
|
+
function normalizeSandboxApiUrl(baseUrlOrApiUrl) {
|
|
1505
|
+
const trimmed = baseUrlOrApiUrl.trim().replace(/\/$/, "");
|
|
1506
|
+
if (!trimmed) {
|
|
1507
|
+
throw new Error("sandbox API URL must be non-empty");
|
|
1616
1508
|
}
|
|
1617
|
-
const
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
apps
|
|
1622
|
-
});
|
|
1623
|
-
return apps;
|
|
1624
|
-
}
|
|
1625
|
-
async function fetchToolsWithCache(params) {
|
|
1626
|
-
if (!params.forceRefresh) {
|
|
1627
|
-
const cached = await getCachedTools({
|
|
1628
|
-
apiBase: params.apiBase,
|
|
1629
|
-
apiKey: params.apiKey,
|
|
1630
|
-
ttlMs: DEFAULT_CACHE_TTL_MS
|
|
1631
|
-
});
|
|
1632
|
-
if (cached) {
|
|
1633
|
-
return cached;
|
|
1634
|
-
}
|
|
1509
|
+
const url = new URL(trimmed);
|
|
1510
|
+
const normalizedPath = url.pathname.replace(/\/$/, "");
|
|
1511
|
+
if (normalizedPath.endsWith("/v1/sandboxes") || normalizedPath.endsWith("/api/sandboxes")) {
|
|
1512
|
+
return `${url.origin}${normalizedPath}`;
|
|
1635
1513
|
}
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
await setCachedTools({
|
|
1639
|
-
apiBase: params.apiBase,
|
|
1640
|
-
apiKey: params.apiKey,
|
|
1641
|
-
tools
|
|
1642
|
-
});
|
|
1643
|
-
return tools;
|
|
1644
|
-
}
|
|
1645
|
-
async function resolveAppTarget(apiBase, apiKey, target) {
|
|
1646
|
-
const { handle, repo } = parseHandleRepo(target);
|
|
1647
|
-
const apps = await fetchAppsWithCache({ apiBase, apiKey });
|
|
1648
|
-
const normalizedRepo = normalizeRepoName(repo);
|
|
1649
|
-
const match = apps.find((app) => {
|
|
1650
|
-
if (app.handle && app.handle !== handle) {
|
|
1651
|
-
return false;
|
|
1652
|
-
}
|
|
1653
|
-
const candidates = [app.repo, app.gitRepo, app.id].map(normalizeRepoName);
|
|
1654
|
-
return candidates.includes(normalizedRepo);
|
|
1655
|
-
});
|
|
1656
|
-
if (!match) {
|
|
1657
|
-
throw new Error(`app not found for ${handle}/${repo}`);
|
|
1514
|
+
if (normalizedPath.endsWith("/v1")) {
|
|
1515
|
+
return `${url.origin}${normalizedPath}/sandboxes`;
|
|
1658
1516
|
}
|
|
1659
|
-
|
|
1660
|
-
}
|
|
1661
|
-
async function pollDeploymentLogs(params) {
|
|
1662
|
-
const intervalMs = params.intervalMs ?? 5e3;
|
|
1663
|
-
const timeoutMs = params.timeoutMs ?? 4 * 60 * 1e3;
|
|
1664
|
-
const seen = /* @__PURE__ */ new Set();
|
|
1665
|
-
const startedAt = Date.now();
|
|
1666
|
-
while (Date.now() - startedAt < timeoutMs) {
|
|
1667
|
-
const logs = await getDeploymentLogs(
|
|
1668
|
-
params.baseUrl,
|
|
1669
|
-
params.apiKey,
|
|
1670
|
-
params.deploymentId
|
|
1671
|
-
);
|
|
1672
|
-
const newLogs = logs.filter((log) => !seen.has(log.id));
|
|
1673
|
-
for (const log of newLogs) {
|
|
1674
|
-
seen.add(log.id);
|
|
1675
|
-
}
|
|
1676
|
-
for (const log of newLogs) {
|
|
1677
|
-
console.log(`${params.prefix}${log.message}`);
|
|
1678
|
-
}
|
|
1679
|
-
const status = await getDeploymentStatus(
|
|
1680
|
-
params.baseUrl,
|
|
1681
|
-
params.apiKey,
|
|
1682
|
-
params.deploymentId
|
|
1683
|
-
);
|
|
1684
|
-
if (status.status === "failed") {
|
|
1685
|
-
console.log(`${params.prefix}deployment failed`);
|
|
1686
|
-
return;
|
|
1687
|
-
}
|
|
1688
|
-
if (status.status === "running" || status.status === "deployed") {
|
|
1689
|
-
console.log(`${params.prefix}deployment complete`);
|
|
1690
|
-
return;
|
|
1691
|
-
}
|
|
1692
|
-
await new Promise((resolve) => setTimeout(resolve, intervalMs));
|
|
1517
|
+
if (isOpenPondHostedApiHost(url.hostname)) {
|
|
1518
|
+
return `${url.origin}${normalizedPath}/v1/sandboxes`;
|
|
1693
1519
|
}
|
|
1694
|
-
|
|
1695
|
-
}
|
|
1696
|
-
|
|
1697
|
-
// src/cli/common/prompts.ts
|
|
1698
|
-
import { stdin as input2, stdout as output2 } from "node:process";
|
|
1699
|
-
import { createInterface as createInterface2 } from "node:readline/promises";
|
|
1700
|
-
async function readAllStdin() {
|
|
1701
|
-
const chunks = [];
|
|
1702
|
-
for await (const chunk of process.stdin) {
|
|
1703
|
-
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(String(chunk)));
|
|
1704
|
-
}
|
|
1705
|
-
return Buffer.concat(chunks).toString("utf8").replace(/\r?\n$/, "");
|
|
1706
|
-
}
|
|
1707
|
-
function readMaskedLine(prompt) {
|
|
1708
|
-
return new Promise((resolve, reject) => {
|
|
1709
|
-
const stdin = process.stdin;
|
|
1710
|
-
const stderr = process.stderr;
|
|
1711
|
-
let value = "";
|
|
1712
|
-
const wasRaw = stdin.isRaw;
|
|
1713
|
-
function cleanup() {
|
|
1714
|
-
stdin.off("data", onData);
|
|
1715
|
-
if (stdin.setRawMode) stdin.setRawMode(wasRaw);
|
|
1716
|
-
stdin.pause();
|
|
1717
|
-
stderr.write("\n");
|
|
1718
|
-
}
|
|
1719
|
-
function onData(chunk) {
|
|
1720
|
-
const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
1721
|
-
for (const byte of buffer) {
|
|
1722
|
-
if (byte === 3) {
|
|
1723
|
-
cleanup();
|
|
1724
|
-
reject(new Error("secret prompt cancelled"));
|
|
1725
|
-
return;
|
|
1726
|
-
}
|
|
1727
|
-
if (byte === 13 || byte === 10) {
|
|
1728
|
-
cleanup();
|
|
1729
|
-
resolve(value);
|
|
1730
|
-
return;
|
|
1731
|
-
}
|
|
1732
|
-
if (byte === 127 || byte === 8) {
|
|
1733
|
-
if (value.length > 0) {
|
|
1734
|
-
value = value.slice(0, -1);
|
|
1735
|
-
stderr.write("\b \b");
|
|
1736
|
-
}
|
|
1737
|
-
continue;
|
|
1738
|
-
}
|
|
1739
|
-
value += Buffer.from([byte]).toString("utf8");
|
|
1740
|
-
stderr.write("*");
|
|
1741
|
-
}
|
|
1742
|
-
}
|
|
1743
|
-
stderr.write(prompt);
|
|
1744
|
-
stdin.resume();
|
|
1745
|
-
if (stdin.setRawMode) stdin.setRawMode(true);
|
|
1746
|
-
stdin.on("data", onData);
|
|
1747
|
-
});
|
|
1748
|
-
}
|
|
1749
|
-
async function promptConfirm(question, defaultValue = false) {
|
|
1750
|
-
const rl = createInterface2({ input: input2, output: output2 });
|
|
1751
|
-
try {
|
|
1752
|
-
const suffix = defaultValue ? "[Y/n]" : "[y/N]";
|
|
1753
|
-
const answer = (await rl.question(`${question} ${suffix} `)).trim().toLowerCase();
|
|
1754
|
-
if (!answer) return defaultValue;
|
|
1755
|
-
return answer === "y" || answer === "yes";
|
|
1756
|
-
} finally {
|
|
1757
|
-
rl.close();
|
|
1520
|
+
if (url.origin === DEFAULT_OPENPOND_WEB_BASE_URL) {
|
|
1521
|
+
return `${DEFAULT_OPENPOND_API_BASE_URL}/v1/sandboxes`;
|
|
1758
1522
|
}
|
|
1523
|
+
return `${url.origin}${normalizedPath}/api/sandboxes`;
|
|
1759
1524
|
}
|
|
1760
|
-
|
|
1761
|
-
const
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
return answer || defaultPath;
|
|
1765
|
-
} finally {
|
|
1766
|
-
rl.close();
|
|
1525
|
+
function apiRootUrlFromSandboxApiUrl(sandboxApiUrl) {
|
|
1526
|
+
const suffix = "/sandboxes";
|
|
1527
|
+
if (!sandboxApiUrl.endsWith(suffix)) {
|
|
1528
|
+
throw new Error("sandbox API URL must end with /sandboxes");
|
|
1767
1529
|
}
|
|
1530
|
+
return sandboxApiUrl.slice(0, -suffix.length);
|
|
1531
|
+
}
|
|
1532
|
+
function isOpenPondHostedApiHost(hostname) {
|
|
1533
|
+
return hostname === "api.openpond.ai" || hostname.startsWith("api") && hostname.endsWith(".openpond.ai");
|
|
1768
1534
|
}
|
|
1769
1535
|
|
|
1770
1536
|
// ../../packages/cloud/src/sandbox/client-handles.ts
|
|
1771
1537
|
function createSandboxRuntimeNamespace(client) {
|
|
1772
1538
|
return {
|
|
1773
|
-
list: (
|
|
1774
|
-
create: (
|
|
1539
|
+
list: (input = {}) => client.listSandboxRuntimes(input),
|
|
1540
|
+
create: (input) => client.createSandboxRuntime(input),
|
|
1775
1541
|
handle: (runtimeId, initial = null) => client.sandboxRuntime(runtimeId, initial),
|
|
1776
1542
|
get: (runtimeId) => client.getSandboxRuntime(runtimeId),
|
|
1777
|
-
createSandbox: (runtimeId,
|
|
1778
|
-
updateStatus: (runtimeId,
|
|
1543
|
+
createSandbox: (runtimeId, input = {}, options = {}) => client.createSandboxRuntimeSandbox(runtimeId, input, options),
|
|
1544
|
+
updateStatus: (runtimeId, input) => client.updateSandboxRuntimeStatus(runtimeId, input),
|
|
1779
1545
|
events: (runtimeId) => client.listSandboxRuntimeEvents(runtimeId),
|
|
1780
|
-
event: (runtimeId,
|
|
1781
|
-
checkpoint: (runtimeId,
|
|
1782
|
-
promote: (runtimeId,
|
|
1783
|
-
preserveSource: (runtimeId,
|
|
1546
|
+
event: (runtimeId, input) => client.emitSandboxRuntimeEvent(runtimeId, input),
|
|
1547
|
+
checkpoint: (runtimeId, input = {}) => client.checkpointSandboxRuntime(runtimeId, input),
|
|
1548
|
+
promote: (runtimeId, input, options = {}) => client.promoteSandboxRuntime(runtimeId, input, options),
|
|
1549
|
+
preserveSource: (runtimeId, input = {}, options = {}) => client.preserveSandboxRuntimeSource(runtimeId, input, options)
|
|
1784
1550
|
};
|
|
1785
1551
|
}
|
|
1786
1552
|
function createSandboxNamespace(client) {
|
|
1787
1553
|
return {
|
|
1788
|
-
list: (
|
|
1789
|
-
create: (
|
|
1554
|
+
list: (input = {}) => client.list(input),
|
|
1555
|
+
create: (input) => client.create(input),
|
|
1790
1556
|
get: (sandboxId) => client.get(sandboxId),
|
|
1791
1557
|
pricing: () => client.pricing(),
|
|
1792
|
-
costs: (
|
|
1558
|
+
costs: (input = {}) => client.costs(input)
|
|
1793
1559
|
};
|
|
1794
1560
|
}
|
|
1795
1561
|
function createSandboxProjectNamespace(client) {
|
|
1796
1562
|
return {
|
|
1797
|
-
list: (
|
|
1798
|
-
upsert: (
|
|
1799
|
-
upsertGitRemote: (
|
|
1800
|
-
get: (projectId,
|
|
1801
|
-
update: (projectId,
|
|
1802
|
-
sync: (projectId,
|
|
1803
|
-
ensureGitRemote: (projectId,
|
|
1804
|
-
getGitRemote: (projectId,
|
|
1805
|
-
git: (projectId,
|
|
1806
|
-
uploadSource: (projectId,
|
|
1807
|
-
archive: (projectId,
|
|
1563
|
+
list: (input) => client.listProjects(input),
|
|
1564
|
+
upsert: (input) => client.upsertProject(input),
|
|
1565
|
+
upsertGitRemote: (input) => client.upsertProjectGitRemote(input),
|
|
1566
|
+
get: (projectId, input) => client.getProject(projectId, input),
|
|
1567
|
+
update: (projectId, input) => client.updateProject(projectId, input),
|
|
1568
|
+
sync: (projectId, input) => client.syncProject(projectId, input),
|
|
1569
|
+
ensureGitRemote: (projectId, input) => client.ensureProjectGitRemote(projectId, input),
|
|
1570
|
+
getGitRemote: (projectId, input) => client.ensureProjectGitRemote(projectId, input),
|
|
1571
|
+
git: (projectId, input) => client.ensureProjectGitRemote(projectId, input),
|
|
1572
|
+
uploadSource: (projectId, input) => client.uploadProjectSource(projectId, input),
|
|
1573
|
+
archive: (projectId, input) => client.archiveProject(projectId, input)
|
|
1808
1574
|
};
|
|
1809
1575
|
}
|
|
1810
1576
|
function createSandboxProfileNamespace(client) {
|
|
1811
1577
|
return {
|
|
1812
|
-
get: (
|
|
1813
|
-
status: (
|
|
1814
|
-
ensureHosted: (
|
|
1815
|
-
push: (
|
|
1578
|
+
get: (input) => client.getHostedProfile(input),
|
|
1579
|
+
status: (input) => client.getHostedProfile(input),
|
|
1580
|
+
ensureHosted: (input) => client.ensureHostedProfile(input),
|
|
1581
|
+
push: (input) => client.pushHostedProfile(input)
|
|
1816
1582
|
};
|
|
1817
1583
|
}
|
|
1818
1584
|
function createSandboxAgentNamespace(client) {
|
|
1819
1585
|
return {
|
|
1820
|
-
list: (
|
|
1821
|
-
upsert: (
|
|
1822
|
-
get: (agentId,
|
|
1823
|
-
update: (agentId,
|
|
1824
|
-
archive: (agentId,
|
|
1825
|
-
run: (agentId,
|
|
1826
|
-
sourceDeployPlan: (agentId,
|
|
1827
|
-
manifestSnapshots: (agentId,
|
|
1828
|
-
requestSourceChecks: (agentId,
|
|
1829
|
-
publishSource: (agentId,
|
|
1830
|
-
openEditWorkItem: (agentId,
|
|
1586
|
+
list: (input) => client.listAgents(input),
|
|
1587
|
+
upsert: (input) => client.upsertAgent(input),
|
|
1588
|
+
get: (agentId, input) => client.getAgent(agentId, input),
|
|
1589
|
+
update: (agentId, input) => client.updateAgent(agentId, input),
|
|
1590
|
+
archive: (agentId, input) => client.archiveAgent(agentId, input),
|
|
1591
|
+
run: (agentId, input) => client.runAgent(agentId, input),
|
|
1592
|
+
sourceDeployPlan: (agentId, input) => client.getAgentSourceDeployPlan(agentId, input),
|
|
1593
|
+
manifestSnapshots: (agentId, input) => client.listAgentManifestSnapshots(agentId, input),
|
|
1594
|
+
requestSourceChecks: (agentId, input) => client.requestAgentSourceChecks(agentId, input),
|
|
1595
|
+
publishSource: (agentId, input) => client.publishAgentSource(agentId, input),
|
|
1596
|
+
openEditWorkItem: (agentId, input) => client.openAgentEditWorkItem(agentId, input)
|
|
1831
1597
|
};
|
|
1832
1598
|
}
|
|
1833
1599
|
function createSandboxWorkItemNamespace(client) {
|
|
1834
1600
|
return {
|
|
1835
|
-
get: (workItemId,
|
|
1836
|
-
chat: (workItemId,
|
|
1837
|
-
activity: (workItemId,
|
|
1838
|
-
status: (workItemId,
|
|
1839
|
-
handleBackground: (workItemId,
|
|
1840
|
-
promoteCheckpoint: (workItemId,
|
|
1841
|
-
promoteCommit: (workItemId,
|
|
1842
|
-
promotePullRequest: (workItemId,
|
|
1601
|
+
get: (workItemId, input) => client.getCodingWorkItem(workItemId, input),
|
|
1602
|
+
chat: (workItemId, input) => client.sendCodingWorkItemChat(workItemId, input),
|
|
1603
|
+
activity: (workItemId, input) => client.listCodingWorkItemActivity(workItemId, input),
|
|
1604
|
+
status: (workItemId, input) => client.getCodingWorkItemStatus(workItemId, input),
|
|
1605
|
+
handleBackground: (workItemId, input) => client.handleCodingWorkItemInBackground(workItemId, input),
|
|
1606
|
+
promoteCheckpoint: (workItemId, input) => client.promoteCodingWorkItemResult(workItemId, "checkpoint", input),
|
|
1607
|
+
promoteCommit: (workItemId, input) => client.promoteCodingWorkItemResult(workItemId, "commit", input),
|
|
1608
|
+
promotePullRequest: (workItemId, input) => client.promoteCodingWorkItemResult(workItemId, "pr", input)
|
|
1843
1609
|
};
|
|
1844
1610
|
}
|
|
1845
1611
|
|
|
1846
1612
|
// ../../packages/cloud/src/sandbox/runtime-handle.ts
|
|
1847
1613
|
function createSandboxRuntimeHandle(client, runtimeId, initial = null) {
|
|
1848
|
-
const currentSandbox = async (
|
|
1614
|
+
const currentSandbox = async (input = {}, options = {}) => {
|
|
1849
1615
|
const runtime = await client.getSandboxRuntime(runtimeId);
|
|
1850
1616
|
if (runtime.sandboxId) {
|
|
1851
1617
|
return client.get(runtime.sandboxId);
|
|
1852
1618
|
}
|
|
1853
|
-
return client.createSandboxRuntimeSandbox(runtimeId,
|
|
1619
|
+
return client.createSandboxRuntimeSandbox(runtimeId, input, options).then((payload) => payload.sandbox);
|
|
1854
1620
|
};
|
|
1855
|
-
const resume = async (
|
|
1621
|
+
const resume = async (input = {}, options = {}) => {
|
|
1856
1622
|
const runtime = await client.getSandboxRuntime(runtimeId);
|
|
1857
1623
|
if (!runtime.sandboxId) {
|
|
1858
|
-
return client.createSandboxRuntimeSandbox(runtimeId,
|
|
1624
|
+
return client.createSandboxRuntimeSandbox(runtimeId, input, options).then((payload) => payload.sandbox);
|
|
1859
1625
|
}
|
|
1860
1626
|
const sandbox = await client.get(runtime.sandboxId);
|
|
1861
1627
|
if (sandbox.state === "stopped") {
|
|
@@ -1865,34 +1631,34 @@ function createSandboxRuntimeHandle(client, runtimeId, initial = null) {
|
|
|
1865
1631
|
return client.restore(sandbox.id).then((payload) => payload.sandbox);
|
|
1866
1632
|
}
|
|
1867
1633
|
if (sandbox.state === "deleted" || sandbox.state === "error") {
|
|
1868
|
-
return client.createSandboxRuntimeSandbox(runtimeId,
|
|
1634
|
+
return client.createSandboxRuntimeSandbox(runtimeId, input, options).then((payload) => payload.sandbox);
|
|
1869
1635
|
}
|
|
1870
1636
|
return sandbox;
|
|
1871
1637
|
};
|
|
1872
|
-
const checkpointHint = (
|
|
1638
|
+
const checkpointHint = (input = {}) => client.emitSandboxRuntimeEvent(runtimeId, {
|
|
1873
1639
|
type: "workflow.checkpoint_hint",
|
|
1874
|
-
summary:
|
|
1640
|
+
summary: input.summary ?? input.reason ?? "Workflow checkpoint hint",
|
|
1875
1641
|
payload: {
|
|
1876
|
-
...
|
|
1877
|
-
reason:
|
|
1642
|
+
...input.payload,
|
|
1643
|
+
reason: input.reason ?? null
|
|
1878
1644
|
},
|
|
1879
|
-
artifactRefs:
|
|
1645
|
+
artifactRefs: input.artifactRefs,
|
|
1880
1646
|
lifecycleHint: {
|
|
1881
1647
|
kind: "checkpoint",
|
|
1882
|
-
reason:
|
|
1648
|
+
reason: input.reason ?? null
|
|
1883
1649
|
}
|
|
1884
1650
|
});
|
|
1885
|
-
const waitForUser = async (
|
|
1651
|
+
const waitForUser = async (input = {}) => {
|
|
1886
1652
|
await client.emitSandboxRuntimeEvent(runtimeId, {
|
|
1887
1653
|
type: "workflow.waiting_for_user",
|
|
1888
|
-
summary:
|
|
1654
|
+
summary: input.summary ?? input.reason ?? "Waiting for user",
|
|
1889
1655
|
payload: {
|
|
1890
|
-
...
|
|
1891
|
-
reason:
|
|
1656
|
+
...input.payload,
|
|
1657
|
+
reason: input.reason ?? null
|
|
1892
1658
|
},
|
|
1893
1659
|
lifecycleHint: {
|
|
1894
1660
|
kind: "waiting_for_user",
|
|
1895
|
-
reason:
|
|
1661
|
+
reason: input.reason ?? null
|
|
1896
1662
|
}
|
|
1897
1663
|
});
|
|
1898
1664
|
const current = await client.getSandboxRuntime(runtimeId);
|
|
@@ -1900,25 +1666,25 @@ function createSandboxRuntimeHandle(client, runtimeId, initial = null) {
|
|
|
1900
1666
|
return client.updateSandboxRuntimeStatus(runtimeId, {
|
|
1901
1667
|
status: "waiting_for_user",
|
|
1902
1668
|
expectedVersion: current.version,
|
|
1903
|
-
summary:
|
|
1669
|
+
summary: input.summary ?? input.reason,
|
|
1904
1670
|
metadata: {
|
|
1905
|
-
workflowWaitForUserReason:
|
|
1671
|
+
workflowWaitForUserReason: input.reason ?? null
|
|
1906
1672
|
}
|
|
1907
1673
|
});
|
|
1908
1674
|
};
|
|
1909
|
-
const keepAlive = (
|
|
1910
|
-
const keepaliveUntil = runtimeKeepaliveUntilIso(
|
|
1675
|
+
const keepAlive = (input = {}) => {
|
|
1676
|
+
const keepaliveUntil = runtimeKeepaliveUntilIso(input);
|
|
1911
1677
|
return client.emitSandboxRuntimeEvent(runtimeId, {
|
|
1912
1678
|
type: "workflow.keepalive",
|
|
1913
|
-
summary:
|
|
1679
|
+
summary: input.summary ?? input.reason ?? "Workflow keepalive",
|
|
1914
1680
|
payload: {
|
|
1915
|
-
...
|
|
1916
|
-
reason:
|
|
1681
|
+
...input.payload,
|
|
1682
|
+
reason: input.reason ?? null,
|
|
1917
1683
|
keepaliveUntil
|
|
1918
1684
|
},
|
|
1919
1685
|
lifecycleHint: {
|
|
1920
1686
|
kind: "keepalive",
|
|
1921
|
-
reason:
|
|
1687
|
+
reason: input.reason ?? null,
|
|
1922
1688
|
keepaliveUntil
|
|
1923
1689
|
}
|
|
1924
1690
|
});
|
|
@@ -1929,38 +1695,38 @@ function createSandboxRuntimeHandle(client, runtimeId, initial = null) {
|
|
|
1929
1695
|
get: () => client.getSandboxRuntime(runtimeId),
|
|
1930
1696
|
sandbox: currentSandbox,
|
|
1931
1697
|
resume,
|
|
1932
|
-
createSandbox: (
|
|
1933
|
-
status: async (
|
|
1934
|
-
if (typeof
|
|
1935
|
-
return client.updateSandboxRuntimeStatus(runtimeId,
|
|
1698
|
+
createSandbox: (input = {}, options = {}) => client.createSandboxRuntimeSandbox(runtimeId, input, options),
|
|
1699
|
+
status: async (input) => {
|
|
1700
|
+
if (typeof input !== "string") {
|
|
1701
|
+
return client.updateSandboxRuntimeStatus(runtimeId, input);
|
|
1936
1702
|
}
|
|
1937
1703
|
const current = await client.getSandboxRuntime(runtimeId);
|
|
1938
1704
|
return client.updateSandboxRuntimeStatus(runtimeId, {
|
|
1939
|
-
status:
|
|
1705
|
+
status: input,
|
|
1940
1706
|
expectedVersion: current.version
|
|
1941
1707
|
});
|
|
1942
1708
|
},
|
|
1943
1709
|
events: () => client.listSandboxRuntimeEvents(runtimeId),
|
|
1944
|
-
event: (
|
|
1945
|
-
recordCommit: (commitSha,
|
|
1946
|
-
...
|
|
1947
|
-
type:
|
|
1710
|
+
event: (input) => client.emitSandboxRuntimeEvent(runtimeId, input),
|
|
1711
|
+
recordCommit: (commitSha, input = {}) => client.emitSandboxRuntimeEvent(runtimeId, {
|
|
1712
|
+
...input,
|
|
1713
|
+
type: input.type ?? "git.commit",
|
|
1948
1714
|
commitSha
|
|
1949
1715
|
}),
|
|
1950
1716
|
checkpointHint,
|
|
1951
1717
|
waitForUser,
|
|
1952
1718
|
keepAlive,
|
|
1953
|
-
checkpoint: (
|
|
1719
|
+
checkpoint: (input) => client.checkpointSandboxRuntime(runtimeId, input),
|
|
1954
1720
|
files: {
|
|
1955
1721
|
write: async (path4, contents) => client.uploadFile((await resume()).id, path4, contents),
|
|
1956
1722
|
read: async (path4) => client.downloadFile((await resume()).id, path4),
|
|
1957
|
-
readResponse: async (
|
|
1958
|
-
list: async (
|
|
1959
|
-
delete: async (path4,
|
|
1960
|
-
search: async (
|
|
1723
|
+
readResponse: async (input) => client.downloadFileResponse((await resume()).id, input),
|
|
1724
|
+
list: async (input = {}) => client.listFiles((await resume()).id, input),
|
|
1725
|
+
delete: async (path4, input = {}) => client.deleteFile((await resume()).id, path4, input),
|
|
1726
|
+
search: async (input) => client.searchFiles((await resume()).id, input),
|
|
1961
1727
|
stat: async (path4) => client.statFile((await resume()).id, path4),
|
|
1962
|
-
mkdir: async (
|
|
1963
|
-
move: async (
|
|
1728
|
+
mkdir: async (input) => client.mkdir((await resume()).id, input),
|
|
1729
|
+
move: async (input) => client.moveFile((await resume()).id, input)
|
|
1964
1730
|
},
|
|
1965
1731
|
commands: {
|
|
1966
1732
|
run: async (command) => client.exec(
|
|
@@ -1974,8 +1740,8 @@ function createSandboxRuntimeHandle(client, runtimeId, initial = null) {
|
|
|
1974
1740
|
typeof port === "number" ? { port } : port
|
|
1975
1741
|
)
|
|
1976
1742
|
},
|
|
1977
|
-
promote: (
|
|
1978
|
-
preserveSource: (
|
|
1743
|
+
promote: (input, options = {}) => client.promoteSandboxRuntime(runtimeId, input, options),
|
|
1744
|
+
preserveSource: (input = {}, options = {}) => client.preserveSandboxRuntimeSource(runtimeId, input, options),
|
|
1979
1745
|
archive: async (expectedVersion) => {
|
|
1980
1746
|
const version = expectedVersion ?? (await client.getSandboxRuntime(runtimeId)).version;
|
|
1981
1747
|
return client.updateSandboxRuntimeStatus(runtimeId, {
|
|
@@ -1985,14 +1751,14 @@ function createSandboxRuntimeHandle(client, runtimeId, initial = null) {
|
|
|
1985
1751
|
}
|
|
1986
1752
|
};
|
|
1987
1753
|
}
|
|
1988
|
-
function runtimeKeepaliveUntilIso(
|
|
1989
|
-
if (
|
|
1990
|
-
return
|
|
1754
|
+
function runtimeKeepaliveUntilIso(input) {
|
|
1755
|
+
if (input?.until instanceof Date) {
|
|
1756
|
+
return input.until.toISOString();
|
|
1991
1757
|
}
|
|
1992
|
-
if (typeof
|
|
1993
|
-
return new Date(
|
|
1758
|
+
if (typeof input?.until === "string" && input.until.trim()) {
|
|
1759
|
+
return new Date(input.until).toISOString();
|
|
1994
1760
|
}
|
|
1995
|
-
const seconds = typeof
|
|
1761
|
+
const seconds = typeof input?.seconds === "number" && Number.isFinite(input.seconds) ? Math.max(1, Math.trunc(input.seconds)) : 60;
|
|
1996
1762
|
return new Date(Date.now() + seconds * 1e3).toISOString();
|
|
1997
1763
|
}
|
|
1998
1764
|
|
|
@@ -2369,8 +2135,8 @@ async function streamSandboxEventOutput(params) {
|
|
|
2369
2135
|
while (separatorIndex !== -1) {
|
|
2370
2136
|
const event = buffered.slice(0, separatorIndex);
|
|
2371
2137
|
buffered = buffered.slice(separatorIndex + 2);
|
|
2372
|
-
const
|
|
2373
|
-
if (
|
|
2138
|
+
const output = parseProcessOutputEvent(event);
|
|
2139
|
+
if (output) process.stdout.write(output);
|
|
2374
2140
|
separatorIndex = buffered.indexOf("\n\n");
|
|
2375
2141
|
}
|
|
2376
2142
|
}
|
|
@@ -2378,14 +2144,14 @@ async function streamSandboxEventOutput(params) {
|
|
|
2378
2144
|
reader.releaseLock();
|
|
2379
2145
|
}
|
|
2380
2146
|
}
|
|
2381
|
-
function normalizePtyInput(
|
|
2382
|
-
if (typeof
|
|
2383
|
-
return { dataBase64: Buffer.from(
|
|
2147
|
+
function normalizePtyInput(input) {
|
|
2148
|
+
if (typeof input === "string") {
|
|
2149
|
+
return { dataBase64: Buffer.from(input, "utf-8").toString("base64") };
|
|
2384
2150
|
}
|
|
2385
|
-
if (
|
|
2386
|
-
return { dataBase64: Buffer.from(
|
|
2151
|
+
if (input instanceof Uint8Array) {
|
|
2152
|
+
return { dataBase64: Buffer.from(input).toString("base64") };
|
|
2387
2153
|
}
|
|
2388
|
-
return
|
|
2154
|
+
return input;
|
|
2389
2155
|
}
|
|
2390
2156
|
function parseProcessOutputEvent(event) {
|
|
2391
2157
|
if (!event.includes("event: output")) {
|
|
@@ -2403,39 +2169,6 @@ function parseProcessOutputEvent(event) {
|
|
|
2403
2169
|
}
|
|
2404
2170
|
}
|
|
2405
2171
|
|
|
2406
|
-
// ../../packages/cloud/src/sandbox/url.ts
|
|
2407
|
-
function normalizeSandboxApiUrl(baseUrlOrApiUrl) {
|
|
2408
|
-
const trimmed = baseUrlOrApiUrl.trim().replace(/\/$/, "");
|
|
2409
|
-
if (!trimmed) {
|
|
2410
|
-
throw new Error("sandbox API URL must be non-empty");
|
|
2411
|
-
}
|
|
2412
|
-
const url = new URL(trimmed);
|
|
2413
|
-
const normalizedPath = url.pathname.replace(/\/$/, "");
|
|
2414
|
-
if (normalizedPath.endsWith("/v1/sandboxes") || normalizedPath.endsWith("/api/sandboxes")) {
|
|
2415
|
-
return `${url.origin}${normalizedPath}`;
|
|
2416
|
-
}
|
|
2417
|
-
if (normalizedPath.endsWith("/v1")) {
|
|
2418
|
-
return `${url.origin}${normalizedPath}/sandboxes`;
|
|
2419
|
-
}
|
|
2420
|
-
if (isOpenPondHostedApiHost(url.hostname)) {
|
|
2421
|
-
return `${url.origin}${normalizedPath}/v1/sandboxes`;
|
|
2422
|
-
}
|
|
2423
|
-
if (url.origin === DEFAULT_OPENPOND_WEB_BASE_URL) {
|
|
2424
|
-
return `${DEFAULT_OPENPOND_API_BASE_URL}/v1/sandboxes`;
|
|
2425
|
-
}
|
|
2426
|
-
return `${url.origin}${normalizedPath}/api/sandboxes`;
|
|
2427
|
-
}
|
|
2428
|
-
function apiRootUrlFromSandboxApiUrl(sandboxApiUrl) {
|
|
2429
|
-
const suffix = "/sandboxes";
|
|
2430
|
-
if (!sandboxApiUrl.endsWith(suffix)) {
|
|
2431
|
-
throw new Error("sandbox API URL must end with /sandboxes");
|
|
2432
|
-
}
|
|
2433
|
-
return sandboxApiUrl.slice(0, -suffix.length);
|
|
2434
|
-
}
|
|
2435
|
-
function isOpenPondHostedApiHost(hostname) {
|
|
2436
|
-
return hostname === "api.openpond.ai" || hostname.startsWith("api") && hostname.endsWith(".openpond.ai");
|
|
2437
|
-
}
|
|
2438
|
-
|
|
2439
2172
|
// ../../packages/cloud/src/sandbox/sandbox-instance-client.ts
|
|
2440
2173
|
var OpenPondSandboxInstanceClient = class {
|
|
2441
2174
|
apiKey;
|
|
@@ -2448,11 +2181,11 @@ var OpenPondSandboxInstanceClient = class {
|
|
|
2448
2181
|
);
|
|
2449
2182
|
this.apiRootUrl = apiRootUrlFromSandboxApiUrl(this.sandboxApiUrl);
|
|
2450
2183
|
}
|
|
2451
|
-
create(
|
|
2184
|
+
create(input, options = {}) {
|
|
2452
2185
|
return this.request("", {
|
|
2453
2186
|
method: "POST",
|
|
2454
2187
|
headers: asyncRequestHeaders(options),
|
|
2455
|
-
body: JSON.stringify(
|
|
2188
|
+
body: JSON.stringify(input)
|
|
2456
2189
|
}).then((payload) => payload.sandbox);
|
|
2457
2190
|
}
|
|
2458
2191
|
get(sandboxId) {
|
|
@@ -2460,21 +2193,21 @@ var OpenPondSandboxInstanceClient = class {
|
|
|
2460
2193
|
`/${encodeURIComponent(sandboxId)}`
|
|
2461
2194
|
).then((payload) => payload.sandbox);
|
|
2462
2195
|
}
|
|
2463
|
-
exec(sandboxId,
|
|
2196
|
+
exec(sandboxId, input) {
|
|
2464
2197
|
return this.request(
|
|
2465
2198
|
`/${encodeURIComponent(sandboxId)}/exec`,
|
|
2466
2199
|
{
|
|
2467
2200
|
method: "POST",
|
|
2468
|
-
body: JSON.stringify(
|
|
2201
|
+
body: JSON.stringify(input)
|
|
2469
2202
|
}
|
|
2470
2203
|
);
|
|
2471
2204
|
}
|
|
2472
|
-
startProcess(sandboxId,
|
|
2205
|
+
startProcess(sandboxId, input) {
|
|
2473
2206
|
return this.request(
|
|
2474
2207
|
`/${encodeURIComponent(sandboxId)}/processes`,
|
|
2475
2208
|
{
|
|
2476
2209
|
method: "POST",
|
|
2477
|
-
body: JSON.stringify(
|
|
2210
|
+
body: JSON.stringify(input)
|
|
2478
2211
|
}
|
|
2479
2212
|
);
|
|
2480
2213
|
}
|
|
@@ -2483,10 +2216,10 @@ var OpenPondSandboxInstanceClient = class {
|
|
|
2483
2216
|
`/${encodeURIComponent(sandboxId)}/processes`
|
|
2484
2217
|
);
|
|
2485
2218
|
}
|
|
2486
|
-
getProcess(sandboxId, processId,
|
|
2219
|
+
getProcess(sandboxId, processId, input = {}) {
|
|
2487
2220
|
const query = new URLSearchParams();
|
|
2488
|
-
if (
|
|
2489
|
-
query.set("since", String(Math.max(0,
|
|
2221
|
+
if (input.since !== void 0)
|
|
2222
|
+
query.set("since", String(Math.max(0, input.since)));
|
|
2490
2223
|
return this.request(
|
|
2491
2224
|
`/${encodeURIComponent(sandboxId)}/processes/${encodeURIComponent(
|
|
2492
2225
|
processId
|
|
@@ -2503,10 +2236,10 @@ var OpenPondSandboxInstanceClient = class {
|
|
|
2503
2236
|
}
|
|
2504
2237
|
);
|
|
2505
2238
|
}
|
|
2506
|
-
async streamProcessOutput(sandboxId, processId,
|
|
2239
|
+
async streamProcessOutput(sandboxId, processId, input = {}) {
|
|
2507
2240
|
const query = new URLSearchParams();
|
|
2508
|
-
if (
|
|
2509
|
-
query.set("since", String(Math.max(0,
|
|
2241
|
+
if (input.since !== void 0)
|
|
2242
|
+
query.set("since", String(Math.max(0, input.since)));
|
|
2510
2243
|
await streamSandboxEventOutput({
|
|
2511
2244
|
sandboxApiUrl: this.sandboxApiUrl,
|
|
2512
2245
|
apiKey: this.apiKey,
|
|
@@ -2515,12 +2248,12 @@ var OpenPondSandboxInstanceClient = class {
|
|
|
2515
2248
|
)}/stream${query.size > 0 ? `?${query.toString()}` : ""}`
|
|
2516
2249
|
});
|
|
2517
2250
|
}
|
|
2518
|
-
startPty(sandboxId,
|
|
2251
|
+
startPty(sandboxId, input = {}) {
|
|
2519
2252
|
return this.request(
|
|
2520
2253
|
`/${encodeURIComponent(sandboxId)}/pty`,
|
|
2521
2254
|
{
|
|
2522
2255
|
method: "POST",
|
|
2523
|
-
body: JSON.stringify(
|
|
2256
|
+
body: JSON.stringify(input)
|
|
2524
2257
|
}
|
|
2525
2258
|
);
|
|
2526
2259
|
}
|
|
@@ -2529,22 +2262,22 @@ var OpenPondSandboxInstanceClient = class {
|
|
|
2529
2262
|
`/${encodeURIComponent(sandboxId)}/pty`
|
|
2530
2263
|
);
|
|
2531
2264
|
}
|
|
2532
|
-
getPty(sandboxId, ptyId,
|
|
2265
|
+
getPty(sandboxId, ptyId, input = {}) {
|
|
2533
2266
|
const query = new URLSearchParams();
|
|
2534
|
-
if (
|
|
2535
|
-
query.set("since", String(Math.max(0,
|
|
2267
|
+
if (input.since !== void 0)
|
|
2268
|
+
query.set("since", String(Math.max(0, input.since)));
|
|
2536
2269
|
return this.request(
|
|
2537
2270
|
`/${encodeURIComponent(sandboxId)}/pty/${encodeURIComponent(ptyId)}${query.size > 0 ? `?${query.toString()}` : ""}`
|
|
2538
2271
|
);
|
|
2539
2272
|
}
|
|
2540
|
-
writePtyInput(sandboxId, ptyId,
|
|
2273
|
+
writePtyInput(sandboxId, ptyId, input) {
|
|
2541
2274
|
return this.request(
|
|
2542
2275
|
`/${encodeURIComponent(sandboxId)}/pty/${encodeURIComponent(
|
|
2543
2276
|
ptyId
|
|
2544
2277
|
)}/input`,
|
|
2545
2278
|
{
|
|
2546
2279
|
method: "POST",
|
|
2547
|
-
body: JSON.stringify(normalizePtyInput(
|
|
2280
|
+
body: JSON.stringify(normalizePtyInput(input))
|
|
2548
2281
|
}
|
|
2549
2282
|
);
|
|
2550
2283
|
}
|
|
@@ -2556,10 +2289,10 @@ var OpenPondSandboxInstanceClient = class {
|
|
|
2556
2289
|
}
|
|
2557
2290
|
);
|
|
2558
2291
|
}
|
|
2559
|
-
async streamPtyOutput(sandboxId, ptyId,
|
|
2292
|
+
async streamPtyOutput(sandboxId, ptyId, input = {}) {
|
|
2560
2293
|
const query = new URLSearchParams();
|
|
2561
|
-
if (
|
|
2562
|
-
query.set("since", String(Math.max(0,
|
|
2294
|
+
if (input.since !== void 0)
|
|
2295
|
+
query.set("since", String(Math.max(0, input.since)));
|
|
2563
2296
|
await streamSandboxEventOutput({
|
|
2564
2297
|
sandboxApiUrl: this.sandboxApiUrl,
|
|
2565
2298
|
apiKey: this.apiKey,
|
|
@@ -2591,8 +2324,8 @@ var OpenPondSandboxInstanceClient = class {
|
|
|
2591
2324
|
const payload = await this.downloadFileResponse(sandboxId, path4);
|
|
2592
2325
|
return Buffer.from(payload.file.contentsBase64, "base64").toString("utf-8");
|
|
2593
2326
|
}
|
|
2594
|
-
downloadFileResponse(sandboxId,
|
|
2595
|
-
const normalized = typeof
|
|
2327
|
+
downloadFileResponse(sandboxId, input) {
|
|
2328
|
+
const normalized = typeof input === "string" ? { path: input } : input;
|
|
2596
2329
|
const query = new URLSearchParams({ path: normalized.path });
|
|
2597
2330
|
if (normalized.offsetBytes !== void 0) {
|
|
2598
2331
|
query.set("offsetBytes", String(normalized.offsetBytes));
|
|
@@ -2604,21 +2337,21 @@ var OpenPondSandboxInstanceClient = class {
|
|
|
2604
2337
|
`/${encodeURIComponent(sandboxId)}/files?${query.toString()}`
|
|
2605
2338
|
);
|
|
2606
2339
|
}
|
|
2607
|
-
listFiles(sandboxId,
|
|
2340
|
+
listFiles(sandboxId, input = {}) {
|
|
2608
2341
|
const query = new URLSearchParams({ list: "1" });
|
|
2609
|
-
if (
|
|
2610
|
-
if (
|
|
2611
|
-
query.set("recursive", String(
|
|
2612
|
-
if (
|
|
2613
|
-
query.set("maxEntries", String(
|
|
2342
|
+
if (input.path) query.set("path", input.path);
|
|
2343
|
+
if (input.recursive !== void 0)
|
|
2344
|
+
query.set("recursive", String(input.recursive));
|
|
2345
|
+
if (input.maxEntries !== void 0)
|
|
2346
|
+
query.set("maxEntries", String(input.maxEntries));
|
|
2614
2347
|
return this.request(
|
|
2615
2348
|
`/${encodeURIComponent(sandboxId)}/files?${query.toString()}`
|
|
2616
2349
|
);
|
|
2617
2350
|
}
|
|
2618
|
-
deleteFile(sandboxId, path4,
|
|
2351
|
+
deleteFile(sandboxId, path4, input = {}) {
|
|
2619
2352
|
const query = new URLSearchParams({ path: path4 });
|
|
2620
|
-
if (
|
|
2621
|
-
query.set("recursive", String(
|
|
2353
|
+
if (input.recursive !== void 0)
|
|
2354
|
+
query.set("recursive", String(input.recursive));
|
|
2622
2355
|
return this.request(
|
|
2623
2356
|
`/${encodeURIComponent(sandboxId)}/files?${query.toString()}`,
|
|
2624
2357
|
{
|
|
@@ -2632,8 +2365,8 @@ var OpenPondSandboxInstanceClient = class {
|
|
|
2632
2365
|
`/${encodeURIComponent(sandboxId)}/files?${query.toString()}`
|
|
2633
2366
|
);
|
|
2634
2367
|
}
|
|
2635
|
-
mkdir(sandboxId,
|
|
2636
|
-
const normalized = typeof
|
|
2368
|
+
mkdir(sandboxId, input) {
|
|
2369
|
+
const normalized = typeof input === "string" ? { path: input } : input;
|
|
2637
2370
|
const query = new URLSearchParams({ path: normalized.path });
|
|
2638
2371
|
if (normalized.recursive !== void 0)
|
|
2639
2372
|
query.set("recursive", String(normalized.recursive));
|
|
@@ -2644,13 +2377,13 @@ var OpenPondSandboxInstanceClient = class {
|
|
|
2644
2377
|
}
|
|
2645
2378
|
);
|
|
2646
2379
|
}
|
|
2647
|
-
moveFile(sandboxId,
|
|
2380
|
+
moveFile(sandboxId, input) {
|
|
2648
2381
|
const query = new URLSearchParams({
|
|
2649
|
-
fromPath:
|
|
2650
|
-
toPath:
|
|
2382
|
+
fromPath: input.fromPath,
|
|
2383
|
+
toPath: input.toPath
|
|
2651
2384
|
});
|
|
2652
|
-
if (
|
|
2653
|
-
query.set("overwrite", String(
|
|
2385
|
+
if (input.overwrite !== void 0)
|
|
2386
|
+
query.set("overwrite", String(input.overwrite));
|
|
2654
2387
|
return this.request(
|
|
2655
2388
|
`/${encodeURIComponent(sandboxId)}/files?${query.toString()}`,
|
|
2656
2389
|
{
|
|
@@ -2658,55 +2391,55 @@ var OpenPondSandboxInstanceClient = class {
|
|
|
2658
2391
|
}
|
|
2659
2392
|
);
|
|
2660
2393
|
}
|
|
2661
|
-
searchFiles(sandboxId,
|
|
2394
|
+
searchFiles(sandboxId, input) {
|
|
2662
2395
|
const query = new URLSearchParams({
|
|
2663
2396
|
search: "1",
|
|
2664
|
-
query:
|
|
2397
|
+
query: input.query
|
|
2665
2398
|
});
|
|
2666
|
-
if (
|
|
2667
|
-
if (
|
|
2668
|
-
query.set("maxResults", String(
|
|
2399
|
+
if (input.path) query.set("path", input.path);
|
|
2400
|
+
if (input.maxResults !== void 0)
|
|
2401
|
+
query.set("maxResults", String(input.maxResults));
|
|
2669
2402
|
return this.request(
|
|
2670
2403
|
`/${encodeURIComponent(sandboxId)}/files?${query.toString()}`
|
|
2671
2404
|
);
|
|
2672
2405
|
}
|
|
2673
|
-
openPort(sandboxId,
|
|
2406
|
+
openPort(sandboxId, input) {
|
|
2674
2407
|
return this.request(
|
|
2675
2408
|
`/${encodeURIComponent(sandboxId)}/ports`,
|
|
2676
2409
|
{
|
|
2677
2410
|
method: "POST",
|
|
2678
|
-
body: JSON.stringify(
|
|
2411
|
+
body: JSON.stringify(input)
|
|
2679
2412
|
}
|
|
2680
2413
|
);
|
|
2681
2414
|
}
|
|
2682
|
-
createSnapshot(sandboxId,
|
|
2415
|
+
createSnapshot(sandboxId, input) {
|
|
2683
2416
|
return this.request(
|
|
2684
2417
|
`/${encodeURIComponent(sandboxId)}/snapshots`,
|
|
2685
2418
|
{
|
|
2686
2419
|
method: "POST",
|
|
2687
|
-
body: JSON.stringify(
|
|
2420
|
+
body: JSON.stringify(input)
|
|
2688
2421
|
}
|
|
2689
2422
|
);
|
|
2690
2423
|
}
|
|
2691
|
-
updateSnapshot(sandboxId, snapshotId,
|
|
2424
|
+
updateSnapshot(sandboxId, snapshotId, input) {
|
|
2692
2425
|
return this.request(
|
|
2693
2426
|
`/${encodeURIComponent(sandboxId)}/snapshots/${encodeURIComponent(
|
|
2694
2427
|
snapshotId
|
|
2695
2428
|
)}`,
|
|
2696
2429
|
{
|
|
2697
2430
|
method: "PATCH",
|
|
2698
|
-
body: JSON.stringify(
|
|
2431
|
+
body: JSON.stringify(input)
|
|
2699
2432
|
}
|
|
2700
2433
|
);
|
|
2701
2434
|
}
|
|
2702
|
-
validateSnapshot(sandboxId, snapshotId,
|
|
2435
|
+
validateSnapshot(sandboxId, snapshotId, input = {}) {
|
|
2703
2436
|
return this.request(
|
|
2704
2437
|
`/${encodeURIComponent(sandboxId)}/snapshots/${encodeURIComponent(
|
|
2705
2438
|
snapshotId
|
|
2706
2439
|
)}/validate`,
|
|
2707
2440
|
{
|
|
2708
2441
|
method: "POST",
|
|
2709
|
-
body: JSON.stringify(
|
|
2442
|
+
body: JSON.stringify(input)
|
|
2710
2443
|
}
|
|
2711
2444
|
);
|
|
2712
2445
|
}
|
|
@@ -2720,12 +2453,12 @@ var OpenPondSandboxInstanceClient = class {
|
|
|
2720
2453
|
}
|
|
2721
2454
|
);
|
|
2722
2455
|
}
|
|
2723
|
-
fork(sandboxId,
|
|
2456
|
+
fork(sandboxId, input = {}) {
|
|
2724
2457
|
return this.request(
|
|
2725
2458
|
`/${encodeURIComponent(sandboxId)}/fork`,
|
|
2726
2459
|
{
|
|
2727
2460
|
method: "POST",
|
|
2728
|
-
body: JSON.stringify(
|
|
2461
|
+
body: JSON.stringify(input)
|
|
2729
2462
|
}
|
|
2730
2463
|
);
|
|
2731
2464
|
}
|
|
@@ -2787,57 +2520,57 @@ var OpenPondSandboxInstanceClient = class {
|
|
|
2787
2520
|
`/${encodeURIComponent(sandboxId)}/git/status`
|
|
2788
2521
|
);
|
|
2789
2522
|
}
|
|
2790
|
-
gitDiff(sandboxId,
|
|
2523
|
+
gitDiff(sandboxId, input = {}) {
|
|
2791
2524
|
return this.request(
|
|
2792
2525
|
`/${encodeURIComponent(sandboxId)}/git/diff`,
|
|
2793
2526
|
{
|
|
2794
2527
|
method: "POST",
|
|
2795
|
-
body: JSON.stringify(
|
|
2528
|
+
body: JSON.stringify(input)
|
|
2796
2529
|
}
|
|
2797
2530
|
);
|
|
2798
2531
|
}
|
|
2799
|
-
gitExportPatch(sandboxId,
|
|
2532
|
+
gitExportPatch(sandboxId, input = {}) {
|
|
2800
2533
|
return this.request(
|
|
2801
2534
|
`/${encodeURIComponent(sandboxId)}/git/export-patch`,
|
|
2802
2535
|
{
|
|
2803
2536
|
method: "POST",
|
|
2804
|
-
body: JSON.stringify(
|
|
2537
|
+
body: JSON.stringify(input)
|
|
2805
2538
|
}
|
|
2806
2539
|
);
|
|
2807
2540
|
}
|
|
2808
|
-
gitBranch(sandboxId,
|
|
2541
|
+
gitBranch(sandboxId, input) {
|
|
2809
2542
|
return this.request(
|
|
2810
2543
|
`/${encodeURIComponent(sandboxId)}/git/branch`,
|
|
2811
2544
|
{
|
|
2812
2545
|
method: "POST",
|
|
2813
|
-
body: JSON.stringify(
|
|
2546
|
+
body: JSON.stringify(input)
|
|
2814
2547
|
}
|
|
2815
2548
|
);
|
|
2816
2549
|
}
|
|
2817
|
-
gitCommit(sandboxId,
|
|
2550
|
+
gitCommit(sandboxId, input) {
|
|
2818
2551
|
return this.request(
|
|
2819
2552
|
`/${encodeURIComponent(sandboxId)}/git/commit`,
|
|
2820
2553
|
{
|
|
2821
2554
|
method: "POST",
|
|
2822
|
-
body: JSON.stringify(
|
|
2555
|
+
body: JSON.stringify(input)
|
|
2823
2556
|
}
|
|
2824
2557
|
);
|
|
2825
2558
|
}
|
|
2826
|
-
gitPull(sandboxId,
|
|
2559
|
+
gitPull(sandboxId, input = {}) {
|
|
2827
2560
|
return this.request(
|
|
2828
2561
|
`/${encodeURIComponent(sandboxId)}/git/pull`,
|
|
2829
2562
|
{
|
|
2830
2563
|
method: "POST",
|
|
2831
|
-
body: JSON.stringify(
|
|
2564
|
+
body: JSON.stringify(input)
|
|
2832
2565
|
}
|
|
2833
2566
|
);
|
|
2834
2567
|
}
|
|
2835
|
-
gitPush(sandboxId,
|
|
2568
|
+
gitPush(sandboxId, input = {}) {
|
|
2836
2569
|
return this.request(
|
|
2837
2570
|
`/${encodeURIComponent(sandboxId)}/git/push`,
|
|
2838
2571
|
{
|
|
2839
2572
|
method: "POST",
|
|
2840
|
-
body: JSON.stringify(
|
|
2573
|
+
body: JSON.stringify(input)
|
|
2841
2574
|
}
|
|
2842
2575
|
);
|
|
2843
2576
|
}
|
|
@@ -2849,11 +2582,11 @@ var OpenPondSandboxInstanceClient = class {
|
|
|
2849
2582
|
pricing() {
|
|
2850
2583
|
return this.request("/pricing");
|
|
2851
2584
|
}
|
|
2852
|
-
costs(
|
|
2585
|
+
costs(input = {}) {
|
|
2853
2586
|
const query = new URLSearchParams();
|
|
2854
|
-
if (
|
|
2855
|
-
if (
|
|
2856
|
-
if (
|
|
2587
|
+
if (input.teamId) query.set("teamId", input.teamId);
|
|
2588
|
+
if (input.projectId) query.set("projectId", input.projectId);
|
|
2589
|
+
if (input.agentId) query.set("agentId", input.agentId);
|
|
2857
2590
|
return this.request(
|
|
2858
2591
|
`/costs${query.size > 0 ? `?${query.toString()}` : ""}`
|
|
2859
2592
|
);
|
|
@@ -2863,12 +2596,12 @@ var OpenPondSandboxInstanceClient = class {
|
|
|
2863
2596
|
`/${encodeURIComponent(sandboxId)}/integrations`
|
|
2864
2597
|
);
|
|
2865
2598
|
}
|
|
2866
|
-
attachIntegrationConnection(sandboxId,
|
|
2599
|
+
attachIntegrationConnection(sandboxId, input) {
|
|
2867
2600
|
return this.request(
|
|
2868
2601
|
`/${encodeURIComponent(sandboxId)}/integrations`,
|
|
2869
2602
|
{
|
|
2870
2603
|
method: "POST",
|
|
2871
|
-
body: JSON.stringify(
|
|
2604
|
+
body: JSON.stringify(input)
|
|
2872
2605
|
}
|
|
2873
2606
|
);
|
|
2874
2607
|
}
|
|
@@ -2904,39 +2637,39 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
2904
2637
|
projects = createSandboxProjectNamespace(this);
|
|
2905
2638
|
agents = createSandboxAgentNamespace(this);
|
|
2906
2639
|
workItems = createSandboxWorkItemNamespace(this);
|
|
2907
|
-
list(
|
|
2640
|
+
list(input = {}) {
|
|
2908
2641
|
const query = new URLSearchParams();
|
|
2909
|
-
if (
|
|
2910
|
-
if (
|
|
2911
|
-
if (
|
|
2642
|
+
if (input.teamId) query.set("teamId", input.teamId);
|
|
2643
|
+
if (input.projectId) query.set("projectId", input.projectId);
|
|
2644
|
+
if (input.agentId) query.set("agentId", input.agentId);
|
|
2912
2645
|
return this.request(
|
|
2913
2646
|
query.size > 0 ? `?${query.toString()}` : ""
|
|
2914
2647
|
).then((payload) => payload.sandboxes);
|
|
2915
2648
|
}
|
|
2916
|
-
listSecrets(
|
|
2649
|
+
listSecrets(input = {}) {
|
|
2917
2650
|
const query = new URLSearchParams();
|
|
2918
|
-
if (
|
|
2651
|
+
if (input.teamId) query.set("teamId", input.teamId);
|
|
2919
2652
|
return this.requestApiRoot(
|
|
2920
2653
|
`/sandbox-secrets${query.size > 0 ? `?${query.toString()}` : ""}`
|
|
2921
2654
|
).then((payload) => payload.secrets);
|
|
2922
2655
|
}
|
|
2923
|
-
getSecret(secretId,
|
|
2656
|
+
getSecret(secretId, input = {}) {
|
|
2924
2657
|
const query = new URLSearchParams();
|
|
2925
|
-
if (
|
|
2658
|
+
if (input.teamId) query.set("teamId", input.teamId);
|
|
2926
2659
|
return this.requestApiRoot(
|
|
2927
2660
|
`/sandbox-secrets/${encodeURIComponent(secretId)}${query.size > 0 ? `?${query.toString()}` : ""}`
|
|
2928
2661
|
).then((payload) => payload.secret);
|
|
2929
2662
|
}
|
|
2930
|
-
createSecret(
|
|
2663
|
+
createSecret(input) {
|
|
2931
2664
|
return this.requestApiRoot("/sandbox-secrets", {
|
|
2932
2665
|
method: "POST",
|
|
2933
|
-
body: JSON.stringify(
|
|
2666
|
+
body: JSON.stringify(input)
|
|
2934
2667
|
}).then((payload) => payload.secret);
|
|
2935
2668
|
}
|
|
2936
|
-
rotateSecret(secretId,
|
|
2669
|
+
rotateSecret(secretId, input) {
|
|
2937
2670
|
const query = new URLSearchParams();
|
|
2938
|
-
if (
|
|
2939
|
-
const { teamId: _teamId, ...body } =
|
|
2671
|
+
if (input.teamId) query.set("teamId", input.teamId);
|
|
2672
|
+
const { teamId: _teamId, ...body } = input;
|
|
2940
2673
|
return this.requestApiRoot(
|
|
2941
2674
|
`/sandbox-secrets/${encodeURIComponent(secretId)}/rotate${query.size > 0 ? `?${query.toString()}` : ""}`,
|
|
2942
2675
|
{
|
|
@@ -2945,10 +2678,10 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
2945
2678
|
}
|
|
2946
2679
|
).then((payload) => payload.secret);
|
|
2947
2680
|
}
|
|
2948
|
-
attachSecret(secretId,
|
|
2681
|
+
attachSecret(secretId, input) {
|
|
2949
2682
|
const query = new URLSearchParams();
|
|
2950
|
-
if (
|
|
2951
|
-
const { teamId: _teamId, ...body } =
|
|
2683
|
+
if (input.teamId) query.set("teamId", input.teamId);
|
|
2684
|
+
const { teamId: _teamId, ...body } = input;
|
|
2952
2685
|
return this.requestApiRoot(
|
|
2953
2686
|
`/sandbox-secrets/${encodeURIComponent(secretId)}/attach${query.size > 0 ? `?${query.toString()}` : ""}`,
|
|
2954
2687
|
{
|
|
@@ -2957,67 +2690,67 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
2957
2690
|
}
|
|
2958
2691
|
).then((payload) => payload.secret);
|
|
2959
2692
|
}
|
|
2960
|
-
revokeSecret(secretId,
|
|
2693
|
+
revokeSecret(secretId, input = {}) {
|
|
2961
2694
|
const query = new URLSearchParams();
|
|
2962
|
-
if (
|
|
2695
|
+
if (input.teamId) query.set("teamId", input.teamId);
|
|
2963
2696
|
return this.requestApiRoot(
|
|
2964
2697
|
`/sandbox-secrets/${encodeURIComponent(secretId)}/revoke${query.size > 0 ? `?${query.toString()}` : ""}`,
|
|
2965
2698
|
{ method: "POST" }
|
|
2966
2699
|
).then((payload) => payload.secret);
|
|
2967
2700
|
}
|
|
2968
|
-
deleteSecret(secretId,
|
|
2701
|
+
deleteSecret(secretId, input = {}) {
|
|
2969
2702
|
const query = new URLSearchParams();
|
|
2970
|
-
if (
|
|
2703
|
+
if (input.teamId) query.set("teamId", input.teamId);
|
|
2971
2704
|
return this.requestApiRoot(
|
|
2972
2705
|
`/sandbox-secrets/${encodeURIComponent(secretId)}${query.size > 0 ? `?${query.toString()}` : ""}`,
|
|
2973
2706
|
{ method: "DELETE" }
|
|
2974
2707
|
).then((payload) => payload.secret);
|
|
2975
2708
|
}
|
|
2976
|
-
snapshotCatalog(
|
|
2709
|
+
snapshotCatalog(input = {}) {
|
|
2977
2710
|
const query = new URLSearchParams();
|
|
2978
|
-
if (
|
|
2979
|
-
if (
|
|
2980
|
-
if (
|
|
2981
|
-
if (
|
|
2982
|
-
if (
|
|
2983
|
-
if (
|
|
2984
|
-
if (
|
|
2985
|
-
if (
|
|
2986
|
-
if (
|
|
2987
|
-
if (
|
|
2711
|
+
if (input.teamId) query.set("teamId", input.teamId);
|
|
2712
|
+
if (input.projectId) query.set("projectId", input.projectId);
|
|
2713
|
+
if (input.agentId) query.set("agentId", input.agentId);
|
|
2714
|
+
if (input.q) query.set("q", input.q);
|
|
2715
|
+
if (input.kind) query.set("kind", input.kind);
|
|
2716
|
+
if (input.replayState) query.set("replayState", input.replayState);
|
|
2717
|
+
if (input.visibility) query.set("visibility", input.visibility);
|
|
2718
|
+
if (input.tag) query.set("tag", input.tag);
|
|
2719
|
+
if (input.useCase) query.set("useCase", input.useCase);
|
|
2720
|
+
if (input.limit) query.set("limit", String(input.limit));
|
|
2988
2721
|
return this.request(
|
|
2989
2722
|
`/catalog/snapshots${query.size > 0 ? `?${query.toString()}` : ""}`
|
|
2990
2723
|
);
|
|
2991
2724
|
}
|
|
2992
|
-
listSandboxRuntimes(
|
|
2725
|
+
listSandboxRuntimes(input = {}) {
|
|
2993
2726
|
const query = new URLSearchParams();
|
|
2994
|
-
if (
|
|
2995
|
-
if (
|
|
2996
|
-
if (
|
|
2727
|
+
if (input.teamId) query.set("teamId", input.teamId);
|
|
2728
|
+
if (input.projectId) query.set("projectId", input.projectId);
|
|
2729
|
+
if (input.agentId) query.set("agentId", input.agentId);
|
|
2997
2730
|
return this.requestApiRoot(
|
|
2998
2731
|
`/runtimes${query.size > 0 ? `?${query.toString()}` : ""}`
|
|
2999
2732
|
).then((payload) => payload.runtimes);
|
|
3000
2733
|
}
|
|
3001
|
-
listProjects(
|
|
3002
|
-
const query = new URLSearchParams({ teamId:
|
|
2734
|
+
listProjects(input) {
|
|
2735
|
+
const query = new URLSearchParams({ teamId: input.teamId });
|
|
3003
2736
|
return this.requestApiRoot(
|
|
3004
2737
|
`/projects?${query.toString()}`
|
|
3005
2738
|
).then((payload) => payload.projects);
|
|
3006
2739
|
}
|
|
3007
|
-
upsertProject(
|
|
2740
|
+
upsertProject(input) {
|
|
3008
2741
|
return this.requestApiRoot("/projects", {
|
|
3009
2742
|
method: "POST",
|
|
3010
|
-
body: JSON.stringify(
|
|
2743
|
+
body: JSON.stringify(input)
|
|
3011
2744
|
}).then((payload) => payload.project);
|
|
3012
2745
|
}
|
|
3013
|
-
getHostedProfile(
|
|
3014
|
-
const query = new URLSearchParams({ teamId:
|
|
2746
|
+
getHostedProfile(input) {
|
|
2747
|
+
const query = new URLSearchParams({ teamId: input.teamId });
|
|
3015
2748
|
return this.requestApiRoot(
|
|
3016
2749
|
`/profile?${query.toString()}`
|
|
3017
2750
|
).then((payload) => payload.profile);
|
|
3018
2751
|
}
|
|
3019
|
-
ensureHostedProfile(
|
|
3020
|
-
const query = new URLSearchParams({ teamId:
|
|
2752
|
+
ensureHostedProfile(input) {
|
|
2753
|
+
const query = new URLSearchParams({ teamId: input.teamId });
|
|
3021
2754
|
return this.requestApiRoot(
|
|
3022
2755
|
`/profile/ensure?${query.toString()}`,
|
|
3023
2756
|
{ method: "POST" }
|
|
@@ -3028,9 +2761,9 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
3028
2761
|
return payload.profile;
|
|
3029
2762
|
});
|
|
3030
2763
|
}
|
|
3031
|
-
pushHostedProfile(
|
|
3032
|
-
const query = new URLSearchParams({ teamId:
|
|
3033
|
-
const { teamId: _teamId, ...body } =
|
|
2764
|
+
pushHostedProfile(input) {
|
|
2765
|
+
const query = new URLSearchParams({ teamId: input.teamId });
|
|
2766
|
+
const { teamId: _teamId, ...body } = input;
|
|
3034
2767
|
return this.requestApiRoot(
|
|
3035
2768
|
`/profile/push?${query.toString()}`,
|
|
3036
2769
|
{
|
|
@@ -3039,33 +2772,33 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
3039
2772
|
}
|
|
3040
2773
|
);
|
|
3041
2774
|
}
|
|
3042
|
-
async upsertProjectGitRemote(
|
|
3043
|
-
const project = await this.upsertProject(
|
|
3044
|
-
return this.ensureProjectGitRemote(project.id, { teamId:
|
|
2775
|
+
async upsertProjectGitRemote(input) {
|
|
2776
|
+
const project = await this.upsertProject(input);
|
|
2777
|
+
return this.ensureProjectGitRemote(project.id, { teamId: input.teamId });
|
|
3045
2778
|
}
|
|
3046
|
-
getProject(projectId,
|
|
3047
|
-
const query = new URLSearchParams({ teamId:
|
|
2779
|
+
getProject(projectId, input) {
|
|
2780
|
+
const query = new URLSearchParams({ teamId: input.teamId });
|
|
3048
2781
|
return this.requestApiRoot(
|
|
3049
2782
|
`/projects/${encodeURIComponent(projectId)}?${query.toString()}`
|
|
3050
2783
|
).then((payload) => payload.project);
|
|
3051
2784
|
}
|
|
3052
|
-
syncProject(projectId,
|
|
3053
|
-
const query = new URLSearchParams({ teamId:
|
|
2785
|
+
syncProject(projectId, input) {
|
|
2786
|
+
const query = new URLSearchParams({ teamId: input.teamId });
|
|
3054
2787
|
return this.requestApiRoot(
|
|
3055
2788
|
`/projects/${encodeURIComponent(projectId)}/sync?${query.toString()}`,
|
|
3056
2789
|
{ method: "POST" }
|
|
3057
2790
|
).then((payload) => payload.project);
|
|
3058
2791
|
}
|
|
3059
|
-
ensureProjectGitRemote(projectId,
|
|
3060
|
-
const query = new URLSearchParams({ teamId:
|
|
2792
|
+
ensureProjectGitRemote(projectId, input) {
|
|
2793
|
+
const query = new URLSearchParams({ teamId: input.teamId });
|
|
3061
2794
|
return this.requestApiRoot(
|
|
3062
2795
|
`/projects/${encodeURIComponent(projectId)}/git?${query.toString()}`,
|
|
3063
2796
|
{ method: "POST" }
|
|
3064
2797
|
);
|
|
3065
2798
|
}
|
|
3066
|
-
uploadProjectSource(projectId,
|
|
3067
|
-
const query = new URLSearchParams({ teamId:
|
|
3068
|
-
const { teamId: _teamId, ...body } =
|
|
2799
|
+
uploadProjectSource(projectId, input) {
|
|
2800
|
+
const query = new URLSearchParams({ teamId: input.teamId });
|
|
2801
|
+
const { teamId: _teamId, ...body } = input;
|
|
3069
2802
|
return this.requestApiRoot(
|
|
3070
2803
|
`/projects/${encodeURIComponent(projectId)}/source?${query.toString()}`,
|
|
3071
2804
|
{
|
|
@@ -3074,9 +2807,9 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
3074
2807
|
}
|
|
3075
2808
|
).then((payload) => payload.project);
|
|
3076
2809
|
}
|
|
3077
|
-
updateProject(projectId,
|
|
3078
|
-
const query = new URLSearchParams({ teamId:
|
|
3079
|
-
const { teamId: _teamId, ...body } =
|
|
2810
|
+
updateProject(projectId, input) {
|
|
2811
|
+
const query = new URLSearchParams({ teamId: input.teamId });
|
|
2812
|
+
const { teamId: _teamId, ...body } = input;
|
|
3080
2813
|
return this.requestApiRoot(
|
|
3081
2814
|
`/projects/${encodeURIComponent(projectId)}?${query.toString()}`,
|
|
3082
2815
|
{
|
|
@@ -3085,41 +2818,41 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
3085
2818
|
}
|
|
3086
2819
|
).then((payload) => payload.project);
|
|
3087
2820
|
}
|
|
3088
|
-
archiveProject(projectId,
|
|
3089
|
-
const query = new URLSearchParams({ teamId:
|
|
2821
|
+
archiveProject(projectId, input) {
|
|
2822
|
+
const query = new URLSearchParams({ teamId: input.teamId });
|
|
3090
2823
|
return this.requestApiRoot(
|
|
3091
2824
|
`/projects/${encodeURIComponent(projectId)}?${query.toString()}`,
|
|
3092
2825
|
{ method: "DELETE" }
|
|
3093
2826
|
).then((payload) => payload.project);
|
|
3094
2827
|
}
|
|
3095
|
-
listAgents(
|
|
3096
|
-
const query = new URLSearchParams({ teamId:
|
|
2828
|
+
listAgents(input) {
|
|
2829
|
+
const query = new URLSearchParams({ teamId: input.teamId });
|
|
3097
2830
|
return this.requestApiRoot(
|
|
3098
2831
|
`/agents?${query.toString()}`
|
|
3099
2832
|
).then((payload) => payload.agents);
|
|
3100
2833
|
}
|
|
3101
|
-
upsertAgent(
|
|
2834
|
+
upsertAgent(input) {
|
|
3102
2835
|
return this.requestApiRoot("/agents", {
|
|
3103
2836
|
method: "POST",
|
|
3104
|
-
body: JSON.stringify(
|
|
2837
|
+
body: JSON.stringify(input)
|
|
3105
2838
|
}).then((payload) => payload.agent);
|
|
3106
2839
|
}
|
|
3107
|
-
getAgent(agentId,
|
|
3108
|
-
const query = new URLSearchParams({ teamId:
|
|
2840
|
+
getAgent(agentId, input) {
|
|
2841
|
+
const query = new URLSearchParams({ teamId: input.teamId });
|
|
3109
2842
|
return this.requestApiRoot(
|
|
3110
2843
|
`/agents/${encodeURIComponent(agentId)}?${query.toString()}`
|
|
3111
2844
|
).then((payload) => payload.agent);
|
|
3112
2845
|
}
|
|
3113
|
-
archiveAgent(agentId,
|
|
3114
|
-
const query = new URLSearchParams({ teamId:
|
|
2846
|
+
archiveAgent(agentId, input) {
|
|
2847
|
+
const query = new URLSearchParams({ teamId: input.teamId });
|
|
3115
2848
|
return this.requestApiRoot(
|
|
3116
2849
|
`/agents/${encodeURIComponent(agentId)}?${query.toString()}`,
|
|
3117
2850
|
{ method: "DELETE" }
|
|
3118
2851
|
).then((payload) => payload.agent);
|
|
3119
2852
|
}
|
|
3120
|
-
updateAgent(agentId,
|
|
3121
|
-
const query = new URLSearchParams({ teamId:
|
|
3122
|
-
const { teamId: _teamId, ...body } =
|
|
2853
|
+
updateAgent(agentId, input) {
|
|
2854
|
+
const query = new URLSearchParams({ teamId: input.teamId });
|
|
2855
|
+
const { teamId: _teamId, ...body } = input;
|
|
3123
2856
|
return this.requestApiRoot(
|
|
3124
2857
|
`/agents/${encodeURIComponent(agentId)}?${query.toString()}`,
|
|
3125
2858
|
{
|
|
@@ -3128,7 +2861,7 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
3128
2861
|
}
|
|
3129
2862
|
).then((payload) => payload.agent);
|
|
3130
2863
|
}
|
|
3131
|
-
runAgent(agentId,
|
|
2864
|
+
runAgent(agentId, input) {
|
|
3132
2865
|
return this.requestApiRoot(
|
|
3133
2866
|
`/agents/${encodeURIComponent(agentId)}/run`,
|
|
3134
2867
|
{
|
|
@@ -3136,30 +2869,30 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
3136
2869
|
headers: {
|
|
3137
2870
|
Prefer: "respond-async"
|
|
3138
2871
|
},
|
|
3139
|
-
body: JSON.stringify(
|
|
2872
|
+
body: JSON.stringify(input)
|
|
3140
2873
|
}
|
|
3141
2874
|
);
|
|
3142
2875
|
}
|
|
3143
|
-
getAgentSourceDeployPlan(agentId,
|
|
3144
|
-
const query = new URLSearchParams({ teamId:
|
|
2876
|
+
getAgentSourceDeployPlan(agentId, input) {
|
|
2877
|
+
const query = new URLSearchParams({ teamId: input.teamId });
|
|
3145
2878
|
return this.requestApiRoot(
|
|
3146
2879
|
`/agents/${encodeURIComponent(
|
|
3147
2880
|
agentId
|
|
3148
2881
|
)}/source/deploy-plan?${query.toString()}`
|
|
3149
2882
|
).then((payload) => payload.deployPlan);
|
|
3150
2883
|
}
|
|
3151
|
-
listAgentManifestSnapshots(agentId,
|
|
3152
|
-
const query = new URLSearchParams({ teamId:
|
|
3153
|
-
if (
|
|
2884
|
+
listAgentManifestSnapshots(agentId, input) {
|
|
2885
|
+
const query = new URLSearchParams({ teamId: input.teamId });
|
|
2886
|
+
if (input.limit !== void 0) query.set("limit", String(input.limit));
|
|
3154
2887
|
return this.requestApiRoot(
|
|
3155
2888
|
`/agents/${encodeURIComponent(
|
|
3156
2889
|
agentId
|
|
3157
2890
|
)}/source/manifest-snapshots?${query.toString()}`
|
|
3158
2891
|
).then((payload) => payload.manifestSnapshots);
|
|
3159
2892
|
}
|
|
3160
|
-
requestAgentSourceChecks(agentId,
|
|
3161
|
-
const query = new URLSearchParams({ teamId:
|
|
3162
|
-
const { teamId: _teamId, ...body } =
|
|
2893
|
+
requestAgentSourceChecks(agentId, input) {
|
|
2894
|
+
const query = new URLSearchParams({ teamId: input.teamId });
|
|
2895
|
+
const { teamId: _teamId, ...body } = input;
|
|
3163
2896
|
return this.requestApiRoot(
|
|
3164
2897
|
`/agents/${encodeURIComponent(
|
|
3165
2898
|
agentId
|
|
@@ -3170,9 +2903,9 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
3170
2903
|
}
|
|
3171
2904
|
);
|
|
3172
2905
|
}
|
|
3173
|
-
publishAgentSource(agentId,
|
|
3174
|
-
const query = new URLSearchParams({ teamId:
|
|
3175
|
-
const { teamId: _teamId, ...body } =
|
|
2906
|
+
publishAgentSource(agentId, input) {
|
|
2907
|
+
const query = new URLSearchParams({ teamId: input.teamId });
|
|
2908
|
+
const { teamId: _teamId, ...body } = input;
|
|
3176
2909
|
return this.requestApiRoot(
|
|
3177
2910
|
`/agents/${encodeURIComponent(
|
|
3178
2911
|
agentId
|
|
@@ -3183,9 +2916,9 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
3183
2916
|
}
|
|
3184
2917
|
);
|
|
3185
2918
|
}
|
|
3186
|
-
openAgentEditWorkItem(agentId,
|
|
3187
|
-
const query = new URLSearchParams({ teamId:
|
|
3188
|
-
const { teamId: _teamId, ...body } =
|
|
2919
|
+
openAgentEditWorkItem(agentId, input) {
|
|
2920
|
+
const query = new URLSearchParams({ teamId: input.teamId });
|
|
2921
|
+
const { teamId: _teamId, ...body } = input;
|
|
3189
2922
|
return this.requestApiRoot(
|
|
3190
2923
|
`/agents/${encodeURIComponent(
|
|
3191
2924
|
agentId
|
|
@@ -3196,109 +2929,109 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
3196
2929
|
}
|
|
3197
2930
|
);
|
|
3198
2931
|
}
|
|
3199
|
-
getCodingWorkItem(workItemId,
|
|
3200
|
-
const query = new URLSearchParams({ teamId:
|
|
3201
|
-
if (
|
|
2932
|
+
getCodingWorkItem(workItemId, input) {
|
|
2933
|
+
const query = new URLSearchParams({ teamId: input.teamId });
|
|
2934
|
+
if (input.includeArchived) query.set("includeArchived", "true");
|
|
3202
2935
|
return this.requestApiRoot(
|
|
3203
2936
|
`/work-items/${encodeURIComponent(workItemId)}?${query.toString()}`
|
|
3204
2937
|
).then((payload) => payload.workItem);
|
|
3205
2938
|
}
|
|
3206
|
-
sendCodingWorkItemChat(workItemId,
|
|
2939
|
+
sendCodingWorkItemChat(workItemId, input) {
|
|
3207
2940
|
return this.requestApiRoot(
|
|
3208
2941
|
`/work-items/${encodeURIComponent(workItemId)}/chat`,
|
|
3209
2942
|
{
|
|
3210
2943
|
method: "POST",
|
|
3211
|
-
body: JSON.stringify(
|
|
2944
|
+
body: JSON.stringify(input)
|
|
3212
2945
|
}
|
|
3213
2946
|
);
|
|
3214
2947
|
}
|
|
3215
|
-
listCodingWorkItemActivity(workItemId,
|
|
3216
|
-
const query = new URLSearchParams({ teamId:
|
|
3217
|
-
if (
|
|
2948
|
+
listCodingWorkItemActivity(workItemId, input) {
|
|
2949
|
+
const query = new URLSearchParams({ teamId: input.teamId });
|
|
2950
|
+
if (input.limit !== void 0) query.set("limit", String(input.limit));
|
|
3218
2951
|
return this.requestApiRoot(
|
|
3219
2952
|
`/work-items/${encodeURIComponent(
|
|
3220
2953
|
workItemId
|
|
3221
2954
|
)}/activity?${query.toString()}`
|
|
3222
2955
|
).then((payload) => payload.activity);
|
|
3223
2956
|
}
|
|
3224
|
-
getCodingWorkItemStatus(workItemId,
|
|
3225
|
-
const query = new URLSearchParams({ teamId:
|
|
3226
|
-
if (
|
|
3227
|
-
if (
|
|
2957
|
+
getCodingWorkItemStatus(workItemId, input) {
|
|
2958
|
+
const query = new URLSearchParams({ teamId: input.teamId });
|
|
2959
|
+
if (input.limit !== void 0) query.set("limit", String(input.limit));
|
|
2960
|
+
if (input.includeArchived) query.set("includeArchived", "true");
|
|
3228
2961
|
return this.requestApiRoot(
|
|
3229
2962
|
`/work-items/${encodeURIComponent(workItemId)}/status?${query.toString()}`
|
|
3230
2963
|
);
|
|
3231
2964
|
}
|
|
3232
|
-
handleCodingWorkItemInBackground(workItemId,
|
|
2965
|
+
handleCodingWorkItemInBackground(workItemId, input) {
|
|
3233
2966
|
return this.requestApiRoot(
|
|
3234
2967
|
`/work-items/${encodeURIComponent(workItemId)}/handle-background`,
|
|
3235
2968
|
{
|
|
3236
2969
|
method: "POST",
|
|
3237
|
-
body: JSON.stringify(
|
|
2970
|
+
body: JSON.stringify(input)
|
|
3238
2971
|
}
|
|
3239
2972
|
);
|
|
3240
2973
|
}
|
|
3241
|
-
promoteCodingWorkItemResult(workItemId, action,
|
|
2974
|
+
promoteCodingWorkItemResult(workItemId, action, input) {
|
|
3242
2975
|
return this.requestApiRoot(
|
|
3243
2976
|
`/work-items/${encodeURIComponent(workItemId)}/result/${action}`,
|
|
3244
2977
|
{
|
|
3245
2978
|
method: "POST",
|
|
3246
|
-
body: JSON.stringify(
|
|
2979
|
+
body: JSON.stringify(input)
|
|
3247
2980
|
}
|
|
3248
2981
|
).then((payload) => payload.artifact);
|
|
3249
2982
|
}
|
|
3250
|
-
getMicrosoftTeamsBotOverview(
|
|
3251
|
-
const query = new URLSearchParams({ teamId:
|
|
2983
|
+
getMicrosoftTeamsBotOverview(input) {
|
|
2984
|
+
const query = new URLSearchParams({ teamId: input.teamId });
|
|
3252
2985
|
return this.requestApiRoot(
|
|
3253
2986
|
`/teams/bot/overview?${query.toString()}`
|
|
3254
2987
|
);
|
|
3255
2988
|
}
|
|
3256
|
-
bindMicrosoftTeamsBotConversation(
|
|
2989
|
+
bindMicrosoftTeamsBotConversation(input) {
|
|
3257
2990
|
return this.requestApiRoot(
|
|
3258
2991
|
"/teams/bot/bindings",
|
|
3259
2992
|
{
|
|
3260
2993
|
method: "POST",
|
|
3261
|
-
body: JSON.stringify(
|
|
2994
|
+
body: JSON.stringify(input)
|
|
3262
2995
|
}
|
|
3263
2996
|
);
|
|
3264
2997
|
}
|
|
3265
|
-
rebindMicrosoftTeamsBotConversation(bindingId,
|
|
2998
|
+
rebindMicrosoftTeamsBotConversation(bindingId, input) {
|
|
3266
2999
|
return this.requestApiRoot(
|
|
3267
3000
|
`/teams/bot/bindings/${encodeURIComponent(bindingId)}`,
|
|
3268
3001
|
{
|
|
3269
3002
|
method: "PATCH",
|
|
3270
|
-
body: JSON.stringify(
|
|
3003
|
+
body: JSON.stringify(input)
|
|
3271
3004
|
}
|
|
3272
3005
|
);
|
|
3273
3006
|
}
|
|
3274
|
-
unlinkMicrosoftTeamsBotConversation(
|
|
3007
|
+
unlinkMicrosoftTeamsBotConversation(input) {
|
|
3275
3008
|
return this.requestApiRoot(
|
|
3276
|
-
`/teams/bot/bindings/${encodeURIComponent(
|
|
3009
|
+
`/teams/bot/bindings/${encodeURIComponent(input.bindingId)}`,
|
|
3277
3010
|
{
|
|
3278
3011
|
method: "DELETE",
|
|
3279
|
-
body: JSON.stringify({ teamId:
|
|
3012
|
+
body: JSON.stringify({ teamId: input.teamId })
|
|
3280
3013
|
}
|
|
3281
3014
|
);
|
|
3282
3015
|
}
|
|
3283
|
-
sendMicrosoftTeamsBotDiagnostic(
|
|
3016
|
+
sendMicrosoftTeamsBotDiagnostic(input) {
|
|
3284
3017
|
return this.requestApiRoot("/teams/bot/diagnostics", {
|
|
3285
3018
|
method: "POST",
|
|
3286
|
-
body: JSON.stringify(
|
|
3019
|
+
body: JSON.stringify(input)
|
|
3287
3020
|
});
|
|
3288
3021
|
}
|
|
3289
|
-
sendMicrosoftTeamsBotDiagnosticRun(
|
|
3022
|
+
sendMicrosoftTeamsBotDiagnosticRun(input) {
|
|
3290
3023
|
return this.requestApiRoot(
|
|
3291
3024
|
"/teams/bot/diagnostics/run",
|
|
3292
3025
|
{
|
|
3293
3026
|
method: "POST",
|
|
3294
|
-
body: JSON.stringify(
|
|
3027
|
+
body: JSON.stringify(input)
|
|
3295
3028
|
}
|
|
3296
3029
|
);
|
|
3297
3030
|
}
|
|
3298
|
-
createSandboxRuntime(
|
|
3031
|
+
createSandboxRuntime(input) {
|
|
3299
3032
|
return this.requestApiRoot("/runtimes", {
|
|
3300
3033
|
method: "POST",
|
|
3301
|
-
body: JSON.stringify(
|
|
3034
|
+
body: JSON.stringify(input)
|
|
3302
3035
|
}).then((payload) => payload.runtime);
|
|
3303
3036
|
}
|
|
3304
3037
|
sandboxRuntime(runtimeId, initial = null) {
|
|
@@ -3309,22 +3042,22 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
3309
3042
|
`/runtimes/${encodeURIComponent(runtimeId)}`
|
|
3310
3043
|
).then((payload) => payload.runtime);
|
|
3311
3044
|
}
|
|
3312
|
-
createSandboxRuntimeSandbox(runtimeId,
|
|
3045
|
+
createSandboxRuntimeSandbox(runtimeId, input = {}, options = {}) {
|
|
3313
3046
|
return this.requestApiRoot(
|
|
3314
3047
|
`/runtimes/${encodeURIComponent(runtimeId)}/sandbox`,
|
|
3315
3048
|
{
|
|
3316
3049
|
method: "POST",
|
|
3317
3050
|
headers: asyncRequestHeaders(options),
|
|
3318
|
-
body: JSON.stringify(
|
|
3051
|
+
body: JSON.stringify(input)
|
|
3319
3052
|
}
|
|
3320
3053
|
);
|
|
3321
3054
|
}
|
|
3322
|
-
updateSandboxRuntimeStatus(runtimeId,
|
|
3055
|
+
updateSandboxRuntimeStatus(runtimeId, input) {
|
|
3323
3056
|
return this.requestApiRoot(
|
|
3324
3057
|
`/runtimes/${encodeURIComponent(runtimeId)}/status`,
|
|
3325
3058
|
{
|
|
3326
3059
|
method: "PATCH",
|
|
3327
|
-
body: JSON.stringify(
|
|
3060
|
+
body: JSON.stringify(input)
|
|
3328
3061
|
}
|
|
3329
3062
|
).then((payload) => payload.runtime);
|
|
3330
3063
|
}
|
|
@@ -3333,52 +3066,52 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
3333
3066
|
`/runtimes/${encodeURIComponent(runtimeId)}/events`
|
|
3334
3067
|
);
|
|
3335
3068
|
}
|
|
3336
|
-
emitSandboxRuntimeEvent(runtimeId,
|
|
3069
|
+
emitSandboxRuntimeEvent(runtimeId, input) {
|
|
3337
3070
|
return this.requestApiRoot(
|
|
3338
3071
|
`/runtimes/${encodeURIComponent(runtimeId)}/events`,
|
|
3339
3072
|
{
|
|
3340
3073
|
method: "POST",
|
|
3341
|
-
body: JSON.stringify(
|
|
3074
|
+
body: JSON.stringify(input)
|
|
3342
3075
|
}
|
|
3343
3076
|
);
|
|
3344
3077
|
}
|
|
3345
|
-
checkpointSandboxRuntime(runtimeId,
|
|
3078
|
+
checkpointSandboxRuntime(runtimeId, input) {
|
|
3346
3079
|
return this.requestApiRoot(
|
|
3347
3080
|
`/runtimes/${encodeURIComponent(runtimeId)}/checkpoints`,
|
|
3348
3081
|
{
|
|
3349
3082
|
method: "POST",
|
|
3350
|
-
body: JSON.stringify(
|
|
3083
|
+
body: JSON.stringify(input)
|
|
3351
3084
|
}
|
|
3352
3085
|
).then((payload) => payload.runtime);
|
|
3353
3086
|
}
|
|
3354
|
-
promoteSandboxRuntime(runtimeId,
|
|
3087
|
+
promoteSandboxRuntime(runtimeId, input, options = {}) {
|
|
3355
3088
|
const query = new URLSearchParams();
|
|
3356
3089
|
if (options.teamId) query.set("teamId", options.teamId);
|
|
3357
3090
|
return this.requestApiRoot(
|
|
3358
3091
|
`/runtimes/${encodeURIComponent(runtimeId)}/promote${query.size > 0 ? `?${query.toString()}` : ""}`,
|
|
3359
3092
|
{
|
|
3360
3093
|
method: "POST",
|
|
3361
|
-
body: JSON.stringify(
|
|
3094
|
+
body: JSON.stringify(input)
|
|
3362
3095
|
}
|
|
3363
3096
|
);
|
|
3364
3097
|
}
|
|
3365
|
-
preserveSandboxRuntimeSource(runtimeId,
|
|
3098
|
+
preserveSandboxRuntimeSource(runtimeId, input = {}, options = {}) {
|
|
3366
3099
|
const query = new URLSearchParams();
|
|
3367
3100
|
if (options.teamId) query.set("teamId", options.teamId);
|
|
3368
3101
|
return this.requestApiRoot(
|
|
3369
3102
|
`/runtimes/${encodeURIComponent(runtimeId)}/preserve-source${query.size > 0 ? `?${query.toString()}` : ""}`,
|
|
3370
3103
|
{
|
|
3371
3104
|
method: "POST",
|
|
3372
|
-
body: JSON.stringify(
|
|
3105
|
+
body: JSON.stringify(input)
|
|
3373
3106
|
}
|
|
3374
3107
|
);
|
|
3375
3108
|
}
|
|
3376
|
-
forkSnapshot(snapshotId,
|
|
3109
|
+
forkSnapshot(snapshotId, input = {}, options = {}) {
|
|
3377
3110
|
const query = new URLSearchParams();
|
|
3378
|
-
if (
|
|
3379
|
-
if (
|
|
3111
|
+
if (input.teamId) query.set("teamId", input.teamId);
|
|
3112
|
+
if (input.projectId) query.set("projectId", input.projectId);
|
|
3380
3113
|
if (options.async) query.set("async", "1");
|
|
3381
|
-
const { teamId: _teamId, projectId: _projectId, ...body } =
|
|
3114
|
+
const { teamId: _teamId, projectId: _projectId, ...body } = input;
|
|
3382
3115
|
return this.request(
|
|
3383
3116
|
`/catalog/snapshots/${encodeURIComponent(snapshotId)}/fork${query.size > 0 ? `?${query.toString()}` : ""}`,
|
|
3384
3117
|
{
|
|
@@ -3391,32 +3124,32 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
3391
3124
|
}
|
|
3392
3125
|
);
|
|
3393
3126
|
}
|
|
3394
|
-
templates(
|
|
3127
|
+
templates(input = {}) {
|
|
3395
3128
|
const query = new URLSearchParams();
|
|
3396
|
-
if (
|
|
3397
|
-
if (
|
|
3398
|
-
if (
|
|
3399
|
-
if (
|
|
3400
|
-
if (
|
|
3401
|
-
if (
|
|
3402
|
-
if (
|
|
3403
|
-
if (
|
|
3404
|
-
if (
|
|
3129
|
+
if (input.teamId) query.set("teamId", input.teamId);
|
|
3130
|
+
if (input.projectId) query.set("projectId", input.projectId);
|
|
3131
|
+
if (input.q) query.set("q", input.q);
|
|
3132
|
+
if (input.name) query.set("name", input.name);
|
|
3133
|
+
if (input.version) query.set("version", input.version);
|
|
3134
|
+
if (input.visibility) query.set("visibility", input.visibility);
|
|
3135
|
+
if (input.tag) query.set("tag", input.tag);
|
|
3136
|
+
if (input.useCase) query.set("useCase", input.useCase);
|
|
3137
|
+
if (input.limit) query.set("limit", String(input.limit));
|
|
3405
3138
|
return this.request(
|
|
3406
3139
|
`/templates${query.size > 0 ? `?${query.toString()}` : ""}`
|
|
3407
3140
|
);
|
|
3408
3141
|
}
|
|
3409
|
-
publishedSnapshots(
|
|
3142
|
+
publishedSnapshots(input = {}) {
|
|
3410
3143
|
const query = new URLSearchParams();
|
|
3411
|
-
if (
|
|
3412
|
-
if (
|
|
3413
|
-
if (
|
|
3414
|
-
if (
|
|
3415
|
-
if (
|
|
3416
|
-
if (
|
|
3417
|
-
if (
|
|
3418
|
-
if (
|
|
3419
|
-
if (
|
|
3144
|
+
if (input.teamId) query.set("teamId", input.teamId);
|
|
3145
|
+
if (input.projectId) query.set("projectId", input.projectId);
|
|
3146
|
+
if (input.q) query.set("q", input.q);
|
|
3147
|
+
if (input.name) query.set("name", input.name);
|
|
3148
|
+
if (input.version) query.set("version", input.version);
|
|
3149
|
+
if (input.visibility) query.set("visibility", input.visibility);
|
|
3150
|
+
if (input.tag) query.set("tag", input.tag);
|
|
3151
|
+
if (input.useCase) query.set("useCase", input.useCase);
|
|
3152
|
+
if (input.limit) query.set("limit", String(input.limit));
|
|
3420
3153
|
return this.request(
|
|
3421
3154
|
`/published-snapshots${query.size > 0 ? `?${query.toString()}` : ""}`
|
|
3422
3155
|
).then((payload) => {
|
|
@@ -3428,11 +3161,11 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
3428
3161
|
};
|
|
3429
3162
|
});
|
|
3430
3163
|
}
|
|
3431
|
-
launchTemplate(
|
|
3164
|
+
launchTemplate(input) {
|
|
3432
3165
|
const query = new URLSearchParams();
|
|
3433
|
-
if (
|
|
3434
|
-
if (
|
|
3435
|
-
const { teamId: _teamId, projectId: _projectId, ...body } =
|
|
3166
|
+
if (input.teamId) query.set("teamId", input.teamId);
|
|
3167
|
+
if (input.projectId) query.set("projectId", input.projectId);
|
|
3168
|
+
const { teamId: _teamId, projectId: _projectId, ...body } = input;
|
|
3436
3169
|
return this.request(
|
|
3437
3170
|
`/templates/launch${query.size > 0 ? `?${query.toString()}` : ""}`,
|
|
3438
3171
|
{
|
|
@@ -3441,11 +3174,11 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
3441
3174
|
}
|
|
3442
3175
|
);
|
|
3443
3176
|
}
|
|
3444
|
-
runPublishedSnapshot(
|
|
3177
|
+
runPublishedSnapshot(input) {
|
|
3445
3178
|
const query = new URLSearchParams();
|
|
3446
|
-
if (
|
|
3447
|
-
if (
|
|
3448
|
-
const { teamId: _teamId, projectId: _projectId, ...body } =
|
|
3179
|
+
if (input.teamId) query.set("teamId", input.teamId);
|
|
3180
|
+
if (input.projectId) query.set("projectId", input.projectId);
|
|
3181
|
+
const { teamId: _teamId, projectId: _projectId, ...body } = input;
|
|
3449
3182
|
return this.request(
|
|
3450
3183
|
`/published-snapshots/launch${query.size > 0 ? `?${query.toString()}` : ""}`,
|
|
3451
3184
|
{
|
|
@@ -3461,20 +3194,20 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
3461
3194
|
};
|
|
3462
3195
|
});
|
|
3463
3196
|
}
|
|
3464
|
-
listSchedules(
|
|
3197
|
+
listSchedules(input = {}) {
|
|
3465
3198
|
const query = new URLSearchParams();
|
|
3466
|
-
if (
|
|
3467
|
-
if (
|
|
3468
|
-
if (
|
|
3469
|
-
query.set("sourceSandboxId",
|
|
3199
|
+
if (input.teamId) query.set("teamId", input.teamId);
|
|
3200
|
+
if (input.projectId) query.set("projectId", input.projectId);
|
|
3201
|
+
if (input.sourceSandboxId)
|
|
3202
|
+
query.set("sourceSandboxId", input.sourceSandboxId);
|
|
3470
3203
|
return this.request(
|
|
3471
3204
|
`/schedules${query.size > 0 ? `?${query.toString()}` : ""}`
|
|
3472
3205
|
);
|
|
3473
3206
|
}
|
|
3474
|
-
createSchedule(
|
|
3207
|
+
createSchedule(input) {
|
|
3475
3208
|
const query = new URLSearchParams();
|
|
3476
|
-
if (
|
|
3477
|
-
const { projectId: _projectId, ...body } =
|
|
3209
|
+
if (input.projectId) query.set("projectId", input.projectId);
|
|
3210
|
+
const { projectId: _projectId, ...body } = input;
|
|
3478
3211
|
return this.request(
|
|
3479
3212
|
`/schedules${query.size > 0 ? `?${query.toString()}` : ""}`,
|
|
3480
3213
|
{
|
|
@@ -3488,12 +3221,12 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
3488
3221
|
`/schedules/${encodeURIComponent(scheduleId)}`
|
|
3489
3222
|
);
|
|
3490
3223
|
}
|
|
3491
|
-
updateSchedule(scheduleId,
|
|
3224
|
+
updateSchedule(scheduleId, input) {
|
|
3492
3225
|
return this.request(
|
|
3493
3226
|
`/schedules/${encodeURIComponent(scheduleId)}`,
|
|
3494
3227
|
{
|
|
3495
3228
|
method: "PATCH",
|
|
3496
|
-
body: JSON.stringify(
|
|
3229
|
+
body: JSON.stringify(input)
|
|
3497
3230
|
}
|
|
3498
3231
|
);
|
|
3499
3232
|
}
|
|
@@ -3505,34 +3238,34 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
3505
3238
|
}
|
|
3506
3239
|
);
|
|
3507
3240
|
}
|
|
3508
|
-
listScheduleRuns(scheduleId,
|
|
3241
|
+
listScheduleRuns(scheduleId, input = {}) {
|
|
3509
3242
|
const query = new URLSearchParams();
|
|
3510
|
-
if (
|
|
3243
|
+
if (input.limit !== void 0) query.set("limit", String(input.limit));
|
|
3511
3244
|
return this.request(
|
|
3512
3245
|
`/schedules/${encodeURIComponent(scheduleId)}/runs${query.size > 0 ? `?${query.toString()}` : ""}`
|
|
3513
3246
|
);
|
|
3514
3247
|
}
|
|
3515
|
-
runScheduleNow(scheduleId,
|
|
3248
|
+
runScheduleNow(scheduleId, input = {}) {
|
|
3516
3249
|
return this.request(
|
|
3517
3250
|
`/schedules/${encodeURIComponent(scheduleId)}/run`,
|
|
3518
3251
|
{
|
|
3519
3252
|
method: "POST",
|
|
3520
|
-
body: JSON.stringify(
|
|
3253
|
+
body: JSON.stringify(input)
|
|
3521
3254
|
}
|
|
3522
3255
|
);
|
|
3523
3256
|
}
|
|
3524
|
-
listTemplateBuilds(
|
|
3525
|
-
const query = new URLSearchParams({ teamId:
|
|
3257
|
+
listTemplateBuilds(input) {
|
|
3258
|
+
const query = new URLSearchParams({ teamId: input.teamId });
|
|
3526
3259
|
return this.requestApiRoot(
|
|
3527
3260
|
`/sandbox-template-builds?${query.toString()}`
|
|
3528
3261
|
).then((payload) => payload.builds);
|
|
3529
3262
|
}
|
|
3530
|
-
createTemplateBuild(
|
|
3263
|
+
createTemplateBuild(input) {
|
|
3531
3264
|
return this.requestApiRoot(
|
|
3532
3265
|
"/sandbox-template-builds",
|
|
3533
3266
|
{
|
|
3534
3267
|
method: "POST",
|
|
3535
|
-
body: JSON.stringify(
|
|
3268
|
+
body: JSON.stringify(input)
|
|
3536
3269
|
}
|
|
3537
3270
|
).then((payload) => payload.build);
|
|
3538
3271
|
}
|
|
@@ -3554,18 +3287,18 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
3554
3287
|
}
|
|
3555
3288
|
).then((payload) => payload.build);
|
|
3556
3289
|
}
|
|
3557
|
-
listPublishedSnapshotBuilds(
|
|
3558
|
-
const query = new URLSearchParams({ teamId:
|
|
3290
|
+
listPublishedSnapshotBuilds(input) {
|
|
3291
|
+
const query = new URLSearchParams({ teamId: input.teamId });
|
|
3559
3292
|
return this.requestApiRoot(
|
|
3560
3293
|
`/published-snapshot-builds?${query.toString()}`
|
|
3561
3294
|
).then((payload) => payload.builds);
|
|
3562
3295
|
}
|
|
3563
|
-
createPublishedSnapshotBuild(
|
|
3296
|
+
createPublishedSnapshotBuild(input) {
|
|
3564
3297
|
return this.requestApiRoot(
|
|
3565
3298
|
"/published-snapshot-builds",
|
|
3566
3299
|
{
|
|
3567
3300
|
method: "POST",
|
|
3568
|
-
body: JSON.stringify(
|
|
3301
|
+
body: JSON.stringify(input)
|
|
3569
3302
|
}
|
|
3570
3303
|
).then((payload) => payload.build);
|
|
3571
3304
|
}
|
|
@@ -3592,10 +3325,10 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
3592
3325
|
"/organizations"
|
|
3593
3326
|
).then((payload) => payload.organizations ?? payload.teams ?? []);
|
|
3594
3327
|
}
|
|
3595
|
-
createOrganization(
|
|
3328
|
+
createOrganization(input) {
|
|
3596
3329
|
return this.requestApiRoot("/organizations", {
|
|
3597
3330
|
method: "POST",
|
|
3598
|
-
body: JSON.stringify(
|
|
3331
|
+
body: JSON.stringify(input)
|
|
3599
3332
|
}).then((payload) => payload.organization);
|
|
3600
3333
|
}
|
|
3601
3334
|
getOrganization(slug) {
|
|
@@ -3603,12 +3336,12 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
3603
3336
|
`/organizations/${encodeURIComponent(slug)}`
|
|
3604
3337
|
).then((payload) => payload.organization);
|
|
3605
3338
|
}
|
|
3606
|
-
updateOrganization(slug,
|
|
3339
|
+
updateOrganization(slug, input) {
|
|
3607
3340
|
return this.requestApiRoot(
|
|
3608
3341
|
`/organizations/${encodeURIComponent(slug)}`,
|
|
3609
3342
|
{
|
|
3610
3343
|
method: "PATCH",
|
|
3611
|
-
body: JSON.stringify(
|
|
3344
|
+
body: JSON.stringify(input)
|
|
3612
3345
|
}
|
|
3613
3346
|
).then((payload) => payload.organization);
|
|
3614
3347
|
}
|
|
@@ -3617,12 +3350,12 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
3617
3350
|
`/organizations/${encodeURIComponent(slug)}/members`
|
|
3618
3351
|
).then((payload) => payload.members);
|
|
3619
3352
|
}
|
|
3620
|
-
upsertOrganizationMember(slug,
|
|
3353
|
+
upsertOrganizationMember(slug, input) {
|
|
3621
3354
|
return this.requestApiRoot(
|
|
3622
3355
|
`/organizations/${encodeURIComponent(slug)}/members`,
|
|
3623
3356
|
{
|
|
3624
3357
|
method: "POST",
|
|
3625
|
-
body: JSON.stringify(
|
|
3358
|
+
body: JSON.stringify(input)
|
|
3626
3359
|
}
|
|
3627
3360
|
).then((payload) => payload.member);
|
|
3628
3361
|
}
|
|
@@ -3631,12 +3364,12 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
3631
3364
|
`/organizations/${encodeURIComponent(slug)}/mcp-server`
|
|
3632
3365
|
).then((payload) => payload.mcpServer);
|
|
3633
3366
|
}
|
|
3634
|
-
generateOrganizationMcpServer(slug,
|
|
3367
|
+
generateOrganizationMcpServer(slug, input = {}) {
|
|
3635
3368
|
return this.requestApiRoot(
|
|
3636
3369
|
`/organizations/${encodeURIComponent(slug)}/mcp-server`,
|
|
3637
3370
|
{
|
|
3638
3371
|
method: "POST",
|
|
3639
|
-
body: JSON.stringify(
|
|
3372
|
+
body: JSON.stringify(input)
|
|
3640
3373
|
}
|
|
3641
3374
|
).then((payload) => payload.mcpServer);
|
|
3642
3375
|
}
|
|
@@ -3664,11 +3397,11 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
3664
3397
|
}
|
|
3665
3398
|
).then((payload) => payload.mcpServer);
|
|
3666
3399
|
}
|
|
3667
|
-
startReplay(
|
|
3400
|
+
startReplay(input) {
|
|
3668
3401
|
const query = new URLSearchParams();
|
|
3669
|
-
if (
|
|
3670
|
-
if (
|
|
3671
|
-
const { teamId: _teamId, projectId: _projectId, ...body } =
|
|
3402
|
+
if (input.teamId) query.set("teamId", input.teamId);
|
|
3403
|
+
if (input.projectId) query.set("projectId", input.projectId);
|
|
3404
|
+
const { teamId: _teamId, projectId: _projectId, ...body } = input;
|
|
3672
3405
|
return this.requestApiRoot(
|
|
3673
3406
|
`/sandbox-replays${query.size > 0 ? `?${query.toString()}` : ""}`,
|
|
3674
3407
|
{
|
|
@@ -3677,42 +3410,42 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
3677
3410
|
}
|
|
3678
3411
|
);
|
|
3679
3412
|
}
|
|
3680
|
-
listReplays(
|
|
3413
|
+
listReplays(input = {}) {
|
|
3681
3414
|
const query = new URLSearchParams();
|
|
3682
|
-
if (
|
|
3683
|
-
if (
|
|
3415
|
+
if (input.teamId) query.set("teamId", input.teamId);
|
|
3416
|
+
if (input.projectId) query.set("projectId", input.projectId);
|
|
3684
3417
|
return this.requestApiRoot(
|
|
3685
3418
|
`/sandbox-replays${query.size > 0 ? `?${query.toString()}` : ""}`
|
|
3686
3419
|
);
|
|
3687
3420
|
}
|
|
3688
|
-
getReplay(replayId,
|
|
3421
|
+
getReplay(replayId, input = {}) {
|
|
3689
3422
|
const query = new URLSearchParams();
|
|
3690
|
-
if (
|
|
3691
|
-
if (
|
|
3423
|
+
if (input.teamId) query.set("teamId", input.teamId);
|
|
3424
|
+
if (input.projectId) query.set("projectId", input.projectId);
|
|
3692
3425
|
return this.requestApiRoot(
|
|
3693
3426
|
`/sandbox-replays/${encodeURIComponent(replayId)}${query.size > 0 ? `?${query.toString()}` : ""}`
|
|
3694
3427
|
);
|
|
3695
3428
|
}
|
|
3696
|
-
getReplayLogs(replayId,
|
|
3429
|
+
getReplayLogs(replayId, input = {}) {
|
|
3697
3430
|
const query = new URLSearchParams();
|
|
3698
|
-
if (
|
|
3699
|
-
if (
|
|
3431
|
+
if (input.teamId) query.set("teamId", input.teamId);
|
|
3432
|
+
if (input.projectId) query.set("projectId", input.projectId);
|
|
3700
3433
|
return this.requestApiRoot(
|
|
3701
3434
|
`/sandbox-replays/${encodeURIComponent(replayId)}/logs${query.size > 0 ? `?${query.toString()}` : ""}`
|
|
3702
3435
|
);
|
|
3703
3436
|
}
|
|
3704
|
-
getReplayArtifacts(replayId,
|
|
3437
|
+
getReplayArtifacts(replayId, input = {}) {
|
|
3705
3438
|
const query = new URLSearchParams();
|
|
3706
|
-
if (
|
|
3707
|
-
if (
|
|
3439
|
+
if (input.teamId) query.set("teamId", input.teamId);
|
|
3440
|
+
if (input.projectId) query.set("projectId", input.projectId);
|
|
3708
3441
|
return this.requestApiRoot(
|
|
3709
3442
|
`/sandbox-replays/${encodeURIComponent(replayId)}/artifacts${query.size > 0 ? `?${query.toString()}` : ""}`
|
|
3710
3443
|
);
|
|
3711
3444
|
}
|
|
3712
|
-
cancelReplay(replayId,
|
|
3445
|
+
cancelReplay(replayId, input = {}) {
|
|
3713
3446
|
const query = new URLSearchParams();
|
|
3714
|
-
if (
|
|
3715
|
-
if (
|
|
3447
|
+
if (input.teamId) query.set("teamId", input.teamId);
|
|
3448
|
+
if (input.projectId) query.set("projectId", input.projectId);
|
|
3716
3449
|
return this.requestApiRoot(
|
|
3717
3450
|
`/sandbox-replays/${encodeURIComponent(replayId)}/cancel${query.size > 0 ? `?${query.toString()}` : ""}`,
|
|
3718
3451
|
{
|
|
@@ -3720,12 +3453,12 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
3720
3453
|
}
|
|
3721
3454
|
);
|
|
3722
3455
|
}
|
|
3723
|
-
integrationConnections(
|
|
3456
|
+
integrationConnections(input = {}) {
|
|
3724
3457
|
const query = new URLSearchParams();
|
|
3725
|
-
if (
|
|
3726
|
-
if (
|
|
3727
|
-
if (
|
|
3728
|
-
if (
|
|
3458
|
+
if (input.teamId) query.set("teamId", input.teamId);
|
|
3459
|
+
if (input.projectId) query.set("projectId", input.projectId);
|
|
3460
|
+
if (input.agentId) query.set("agentId", input.agentId);
|
|
3461
|
+
if (input.status) query.set("status", input.status);
|
|
3729
3462
|
return this.requestApiRoot(
|
|
3730
3463
|
`/integrations/connections${query.size > 0 ? `?${query.toString()}` : ""}`
|
|
3731
3464
|
);
|
|
@@ -3753,361 +3486,15 @@ var SANDBOX_RUNTIME_PROFILE_IDS = [
|
|
|
3753
3486
|
"openpond-coding-core-v1"
|
|
3754
3487
|
];
|
|
3755
3488
|
|
|
3756
|
-
// src/cli/common/sandbox-options.ts
|
|
3757
|
-
var SANDBOX_WORKFLOW_MODES = [
|
|
3758
|
-
"readonly",
|
|
3759
|
-
"attempt",
|
|
3760
|
-
"feature",
|
|
3761
|
-
"rollout",
|
|
3762
|
-
"replay",
|
|
3763
|
-
"template_build",
|
|
3764
|
-
"scheduled_run",
|
|
3765
|
-
"patch_only",
|
|
3766
|
-
"hotfix",
|
|
3767
|
-
"multi_feature_batch"
|
|
3768
|
-
];
|
|
3769
|
-
var SANDBOX_RUNTIME_PROMOTION_POLICIES = ["none", "manual", "auto_after_checks"];
|
|
3770
|
-
var SANDBOX_RUNTIME_PROFILES = [
|
|
3771
|
-
...SANDBOX_RUNTIME_PROFILE_IDS
|
|
3772
|
-
];
|
|
3773
|
-
function resolveSandboxBaseUrl(config, options) {
|
|
3774
|
-
const envName = typeof options.env === "string" ? options.env.trim().toLowerCase() : typeof options.environment === "string" ? options.environment.trim().toLowerCase() : "";
|
|
3775
|
-
if (envName === "staging") {
|
|
3776
|
-
return "https://api-new.staging-api.openpond.ai";
|
|
3777
|
-
}
|
|
3778
|
-
if (envName && envName !== "production") {
|
|
3779
|
-
throw new Error("sandbox env must be staging or production");
|
|
3780
|
-
}
|
|
3781
|
-
const base = process.env.OPENPOND_SANDBOX_BASE_URL || process.env.OPENPOND_API_URL || config.apiBaseUrl || mapUiBaseToApiBase(process.env.OPENPOND_BASE_URL || config.baseUrl) || DEFAULT_OPENPOND_API_BASE_URL;
|
|
3782
|
-
return base.replace(/\/$/, "");
|
|
3783
|
-
}
|
|
3784
|
-
async function resolveSandboxClient(options) {
|
|
3785
|
-
const config = await loadConfig();
|
|
3786
|
-
const uiBase = resolveBaseUrl(config);
|
|
3787
|
-
const apiKey = await ensureApiKey(config, uiBase);
|
|
3788
|
-
const sandboxApiUrl = resolveSandboxApiUrlOption(options) || process.env.OPENPOND_SANDBOX_API_URL?.trim() || null;
|
|
3789
|
-
return createOpenPondSandboxClient(
|
|
3790
|
-
sandboxApiUrl ? { apiKey, sandboxApiUrl } : { apiKey, baseUrl: resolveSandboxBaseUrl(config, options) }
|
|
3791
|
-
);
|
|
3792
|
-
}
|
|
3793
|
-
function parseSandboxWorkflowModeOption(value) {
|
|
3794
|
-
if (value === void 0) return void 0;
|
|
3795
|
-
if (typeof value !== "string" || !value.trim()) {
|
|
3796
|
-
throw new Error("workflow-mode must be a non-empty value");
|
|
3797
|
-
}
|
|
3798
|
-
const mode = value.trim();
|
|
3799
|
-
if (!SANDBOX_WORKFLOW_MODES.includes(mode)) {
|
|
3800
|
-
throw new Error(
|
|
3801
|
-
`workflow-mode must be one of ${SANDBOX_WORKFLOW_MODES.join(", ")}`
|
|
3802
|
-
);
|
|
3803
|
-
}
|
|
3804
|
-
return mode;
|
|
3805
|
-
}
|
|
3806
|
-
function parseSandboxRuntimePromotionPolicyOption(value) {
|
|
3807
|
-
if (value === void 0) return void 0;
|
|
3808
|
-
if (typeof value !== "string" || !value.trim()) {
|
|
3809
|
-
throw new Error("runtime-promotion-policy must be a non-empty value");
|
|
3810
|
-
}
|
|
3811
|
-
const policy = value.trim();
|
|
3812
|
-
if (!SANDBOX_RUNTIME_PROMOTION_POLICIES.includes(policy)) {
|
|
3813
|
-
throw new Error(
|
|
3814
|
-
`runtime-promotion-policy must be one of ${SANDBOX_RUNTIME_PROMOTION_POLICIES.join(
|
|
3815
|
-
", "
|
|
3816
|
-
)}`
|
|
3817
|
-
);
|
|
3818
|
-
}
|
|
3819
|
-
return policy;
|
|
3820
|
-
}
|
|
3821
|
-
function parseSandboxRuntimeProfileIdOption(value) {
|
|
3822
|
-
if (typeof value !== "string" || !value.trim()) return void 0;
|
|
3823
|
-
const runtimeProfileId = value.trim();
|
|
3824
|
-
if (!SANDBOX_RUNTIME_PROFILES.includes(runtimeProfileId)) {
|
|
3825
|
-
throw new Error(
|
|
3826
|
-
`runtime-profile-id must be one of ${SANDBOX_RUNTIME_PROFILES.join(
|
|
3827
|
-
", "
|
|
3828
|
-
)}`
|
|
3829
|
-
);
|
|
3830
|
-
}
|
|
3831
|
-
return runtimeProfileId;
|
|
3832
|
-
}
|
|
3833
|
-
function parseSandboxEnvOptions(options) {
|
|
3834
|
-
const refs = parseSandboxEnvAssignments(options.envRef, "env-ref").map(
|
|
3835
|
-
({ name, value }) => ({ name, secretRef: value })
|
|
3836
|
-
);
|
|
3837
|
-
const literals = parseSandboxEnvAssignments(
|
|
3838
|
-
options.envLiteral,
|
|
3839
|
-
"env-literal"
|
|
3840
|
-
).map(({ name, value }) => {
|
|
3841
|
-
if (isSecretLikeEnvName(name) && !parseBooleanOption(options.allowPlainSecretEnv)) {
|
|
3842
|
-
throw new Error(
|
|
3843
|
-
`refusing plaintext value for secret-like env ${name}; create a sandbox secret and pass --env-ref ${name}=openpond://secret/...`
|
|
3844
|
-
);
|
|
3845
|
-
}
|
|
3846
|
-
return { name, value };
|
|
3847
|
-
});
|
|
3848
|
-
const env = [...refs, ...literals];
|
|
3849
|
-
const names = /* @__PURE__ */ new Set();
|
|
3850
|
-
for (const item of env) {
|
|
3851
|
-
if (names.has(item.name)) {
|
|
3852
|
-
throw new Error(`duplicate sandbox env var: ${item.name}`);
|
|
3853
|
-
}
|
|
3854
|
-
names.add(item.name);
|
|
3855
|
-
}
|
|
3856
|
-
return env;
|
|
3857
|
-
}
|
|
3858
|
-
function parseSandboxTemplateEnvOptions(manifest, options) {
|
|
3859
|
-
const env = parseSandboxEnvOptions(options);
|
|
3860
|
-
const provided = new Set(env.map((item) => item.name));
|
|
3861
|
-
const providedByName = new Map(env.map((item) => [item.name, item]));
|
|
3862
|
-
for (const requirement of manifest.inputs.env) {
|
|
3863
|
-
const value = providedByName.get(requirement.name);
|
|
3864
|
-
if (value?.value !== void 0 && requirement.secret !== false) {
|
|
3865
|
-
throw new Error(
|
|
3866
|
-
`sandbox template env ${requirement.name} requires a secret ref. Pass --env-ref ${requirement.name}=openpond://secret/...`
|
|
3867
|
-
);
|
|
3868
|
-
}
|
|
3869
|
-
}
|
|
3870
|
-
const missing = manifest.inputs.env.filter((item) => item.required && !provided.has(item.name)).map((item) => item.name);
|
|
3871
|
-
if (missing.length > 0) {
|
|
3872
|
-
throw new Error(
|
|
3873
|
-
`missing required sandbox template env refs: ${missing.join(
|
|
3874
|
-
", "
|
|
3875
|
-
)}. Pass --env-ref NAME=openpond://secret/...`
|
|
3876
|
-
);
|
|
3877
|
-
}
|
|
3878
|
-
return env;
|
|
3879
|
-
}
|
|
3880
|
-
function parseSandboxEnvAssignments(value, label) {
|
|
3881
|
-
if (typeof value !== "string") return [];
|
|
3882
|
-
return value.split(",").map((item) => item.trim()).filter(Boolean).map((item) => {
|
|
3883
|
-
const separator = item.indexOf("=");
|
|
3884
|
-
if (separator <= 0) {
|
|
3885
|
-
throw new Error(`${label} entries must use NAME=value`);
|
|
3886
|
-
}
|
|
3887
|
-
const name = item.slice(0, separator).trim();
|
|
3888
|
-
const entryValue = item.slice(separator + 1).trim();
|
|
3889
|
-
if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(name)) {
|
|
3890
|
-
throw new Error(`${label} has invalid env name: ${name}`);
|
|
3891
|
-
}
|
|
3892
|
-
if (!entryValue) {
|
|
3893
|
-
throw new Error(`${label} value is required for ${name}`);
|
|
3894
|
-
}
|
|
3895
|
-
return { name, value: entryValue };
|
|
3896
|
-
});
|
|
3897
|
-
}
|
|
3898
|
-
function isSecretLikeEnvName(name) {
|
|
3899
|
-
return /(?:SECRET|TOKEN|KEY|PASSWORD|PASSWD|PRIVATE|CREDENTIAL|DATABASE_URL|DSN)/i.test(
|
|
3900
|
-
name
|
|
3901
|
-
);
|
|
3902
|
-
}
|
|
3903
|
-
async function readSandboxSecretValue(options, label) {
|
|
3904
|
-
if (typeof options.value === "string" || typeof options.secretValue === "string") {
|
|
3905
|
-
throw new Error(
|
|
3906
|
-
"sandbox secret values must be provided with --stdin or the masked prompt"
|
|
3907
|
-
);
|
|
3908
|
-
}
|
|
3909
|
-
const useStdin = parseBooleanOption(options.stdin);
|
|
3910
|
-
if (useStdin) {
|
|
3911
|
-
const value2 = await readAllStdin();
|
|
3912
|
-
if (!value2) throw new Error(`${label} read no secret value from stdin`);
|
|
3913
|
-
return value2;
|
|
3914
|
-
}
|
|
3915
|
-
if (!process.stdin.isTTY) {
|
|
3916
|
-
throw new Error(`${label} requires --stdin when not running in a TTY`);
|
|
3917
|
-
}
|
|
3918
|
-
const value = await readMaskedLine(`${label}: `);
|
|
3919
|
-
if (!value) throw new Error(`${label} cannot be empty`);
|
|
3920
|
-
return value;
|
|
3921
|
-
}
|
|
3922
|
-
function summarizeSandboxSecret(secret) {
|
|
3923
|
-
return {
|
|
3924
|
-
id: secret.id,
|
|
3925
|
-
teamId: secret.teamId,
|
|
3926
|
-
name: secret.name,
|
|
3927
|
-
scope: secret.scope,
|
|
3928
|
-
status: secret.status,
|
|
3929
|
-
secretRef: secret.secretRef,
|
|
3930
|
-
currentVersion: secret.currentVersion,
|
|
3931
|
-
updatedAt: secret.updatedAt,
|
|
3932
|
-
lastUsedAt: secret.lastUsedAt,
|
|
3933
|
-
attachedDestinations: secret.attachments?.length ?? 0
|
|
3934
|
-
};
|
|
3935
|
-
}
|
|
3936
|
-
|
|
3937
|
-
// ../../packages/cloud/src/process-runner.ts
|
|
3938
|
-
import { Buffer as Buffer2 } from "node:buffer";
|
|
3939
|
-
import { spawn } from "node:child_process";
|
|
3940
|
-
var DEFAULT_PROCESS_TIMEOUT_MS = 10 * 60 * 1e3;
|
|
3941
|
-
var DEFAULT_PROCESS_MAX_OUTPUT_BYTES = 2 * 1024 * 1024;
|
|
3942
|
-
function runProcessCommand(command, args = [], options = {}) {
|
|
3943
|
-
if (options.inherit && options.terminateWhenStdoutIncludes !== void 0) {
|
|
3944
|
-
return Promise.reject(new Error("terminateWhenStdoutIncludes requires captured stdout"));
|
|
3945
|
-
}
|
|
3946
|
-
if (options.terminateWhenStdoutIncludes === "") {
|
|
3947
|
-
return Promise.reject(new Error("terminateWhenStdoutIncludes must not be empty"));
|
|
3948
|
-
}
|
|
3949
|
-
return new Promise((resolve, reject) => {
|
|
3950
|
-
const proc = spawn(command, args, {
|
|
3951
|
-
cwd: options.cwd,
|
|
3952
|
-
env: options.env ? { ...process.env, ...options.env } : void 0,
|
|
3953
|
-
shell: options.shell,
|
|
3954
|
-
detached: options.detached ?? process.platform !== "win32",
|
|
3955
|
-
stdio: options.inherit ? "inherit" : [options.stdin === void 0 ? "ignore" : "pipe", "pipe", "pipe"]
|
|
3956
|
-
});
|
|
3957
|
-
const stdout = new BoundedOutput(maxOutputBytes(options));
|
|
3958
|
-
const stderr = new BoundedOutput(maxOutputBytes(options));
|
|
3959
|
-
let timedOut = false;
|
|
3960
|
-
const timeoutMs = options.timeoutMs ?? DEFAULT_PROCESS_TIMEOUT_MS;
|
|
3961
|
-
let timeout;
|
|
3962
|
-
let forceKill;
|
|
3963
|
-
let requestedTermination = null;
|
|
3964
|
-
let settled = false;
|
|
3965
|
-
const clearTimers = () => {
|
|
3966
|
-
if (timeout) clearTimeout(timeout);
|
|
3967
|
-
if (forceKill) clearTimeout(forceKill);
|
|
3968
|
-
};
|
|
3969
|
-
const requestTermination = (reason) => {
|
|
3970
|
-
if (requestedTermination !== null || settled) return;
|
|
3971
|
-
requestedTermination = reason;
|
|
3972
|
-
timedOut = reason === "timeout";
|
|
3973
|
-
if (timeout) {
|
|
3974
|
-
clearTimeout(timeout);
|
|
3975
|
-
timeout = void 0;
|
|
3976
|
-
}
|
|
3977
|
-
terminateProcessTree(proc.pid, "SIGTERM");
|
|
3978
|
-
forceKill = setTimeout(() => {
|
|
3979
|
-
if (proc.exitCode === null && proc.signalCode === null) terminateProcessTree(proc.pid, "SIGKILL");
|
|
3980
|
-
}, 5e3);
|
|
3981
|
-
};
|
|
3982
|
-
if (timeoutMs > 0) {
|
|
3983
|
-
timeout = setTimeout(() => {
|
|
3984
|
-
requestTermination("timeout");
|
|
3985
|
-
}, timeoutMs);
|
|
3986
|
-
}
|
|
3987
|
-
if (!options.inherit) {
|
|
3988
|
-
proc.stdout?.on("data", (chunk) => {
|
|
3989
|
-
stdout.append(chunk);
|
|
3990
|
-
const marker = options.terminateWhenStdoutIncludes;
|
|
3991
|
-
if (marker !== void 0 && stdout.text().includes(marker)) {
|
|
3992
|
-
requestTermination("output");
|
|
3993
|
-
}
|
|
3994
|
-
});
|
|
3995
|
-
proc.stderr?.on("data", (chunk) => {
|
|
3996
|
-
stderr.append(chunk);
|
|
3997
|
-
});
|
|
3998
|
-
}
|
|
3999
|
-
proc.on("error", (error) => {
|
|
4000
|
-
clearTimers();
|
|
4001
|
-
settled = true;
|
|
4002
|
-
reject(error);
|
|
4003
|
-
});
|
|
4004
|
-
proc.on("close", (code, signal) => {
|
|
4005
|
-
if (settled) return;
|
|
4006
|
-
settled = true;
|
|
4007
|
-
clearTimers();
|
|
4008
|
-
resolve({
|
|
4009
|
-
code,
|
|
4010
|
-
signal,
|
|
4011
|
-
terminationReason: requestedTermination ?? (signal ? "signal" : "exit"),
|
|
4012
|
-
stdout: stdout.text(),
|
|
4013
|
-
stderr: stderr.text(),
|
|
4014
|
-
timedOut,
|
|
4015
|
-
stdoutTruncated: stdout.truncated,
|
|
4016
|
-
stderrTruncated: stderr.truncated
|
|
4017
|
-
});
|
|
4018
|
-
});
|
|
4019
|
-
if (options.stdin !== void 0) {
|
|
4020
|
-
proc.stdin?.end(options.stdin);
|
|
4021
|
-
}
|
|
4022
|
-
});
|
|
4023
|
-
}
|
|
4024
|
-
var BoundedOutput = class {
|
|
4025
|
-
#chunks = [];
|
|
4026
|
-
#maxBytes;
|
|
4027
|
-
#bytes = 0;
|
|
4028
|
-
truncated = false;
|
|
4029
|
-
constructor(maxBytes) {
|
|
4030
|
-
this.#maxBytes = maxBytes;
|
|
4031
|
-
}
|
|
4032
|
-
append(value) {
|
|
4033
|
-
const chunk = Buffer2.isBuffer(value) ? value : Buffer2.from(value);
|
|
4034
|
-
const remaining = this.#maxBytes - this.#bytes;
|
|
4035
|
-
if (remaining <= 0) {
|
|
4036
|
-
if (chunk.byteLength > 0) this.truncated = true;
|
|
4037
|
-
return;
|
|
4038
|
-
}
|
|
4039
|
-
if (chunk.byteLength <= remaining) {
|
|
4040
|
-
this.#chunks.push(chunk);
|
|
4041
|
-
this.#bytes += chunk.byteLength;
|
|
4042
|
-
return;
|
|
4043
|
-
}
|
|
4044
|
-
this.#chunks.push(chunk.subarray(0, remaining));
|
|
4045
|
-
this.#bytes += remaining;
|
|
4046
|
-
this.truncated = true;
|
|
4047
|
-
}
|
|
4048
|
-
text() {
|
|
4049
|
-
const value = Buffer2.concat(this.#chunks, this.#bytes).toString("utf8");
|
|
4050
|
-
return this.truncated ? `${value}
|
|
4051
|
-
[truncated after ${this.#maxBytes} bytes]
|
|
4052
|
-
` : value;
|
|
4053
|
-
}
|
|
4054
|
-
};
|
|
4055
|
-
function maxOutputBytes(options) {
|
|
4056
|
-
const value = options.maxOutputBytes ?? DEFAULT_PROCESS_MAX_OUTPUT_BYTES;
|
|
4057
|
-
return Math.max(0, Math.floor(value));
|
|
4058
|
-
}
|
|
4059
|
-
function terminateProcessTree(pid, signal) {
|
|
4060
|
-
if (!pid) return;
|
|
4061
|
-
if (process.platform === "win32") {
|
|
4062
|
-
const args = ["/PID", String(pid), "/T"];
|
|
4063
|
-
if (signal === "SIGKILL") args.push("/F");
|
|
4064
|
-
const killer = spawn("taskkill", args, { stdio: "ignore", windowsHide: true });
|
|
4065
|
-
killer.unref();
|
|
4066
|
-
return;
|
|
4067
|
-
}
|
|
4068
|
-
try {
|
|
4069
|
-
process.kill(-pid, signal);
|
|
4070
|
-
} catch (error) {
|
|
4071
|
-
if (error.code !== "ESRCH") throw error;
|
|
4072
|
-
}
|
|
4073
|
-
}
|
|
4074
|
-
|
|
4075
|
-
// src/cli/common/shell.ts
|
|
4076
|
-
async function runCommand(command, args, options = {}) {
|
|
4077
|
-
return runProcessCommand(command, args, {
|
|
4078
|
-
cwd: options.cwd,
|
|
4079
|
-
inherit: options.inherit,
|
|
4080
|
-
timeoutMs: options.timeoutMs,
|
|
4081
|
-
maxOutputBytes: options.maxOutputBytes,
|
|
4082
|
-
terminateWhenStdoutIncludes: options.terminateWhenStdoutIncludes
|
|
4083
|
-
});
|
|
4084
|
-
}
|
|
4085
|
-
async function runShellCommand(command, options = {}) {
|
|
4086
|
-
const timeoutMs = options.timeoutSeconds === void 0 ? void 0 : options.timeoutSeconds * 1e3;
|
|
4087
|
-
return runProcessCommand(command, [], {
|
|
4088
|
-
cwd: options.cwd,
|
|
4089
|
-
env: options.env,
|
|
4090
|
-
shell: true,
|
|
4091
|
-
inherit: options.inherit,
|
|
4092
|
-
timeoutMs,
|
|
4093
|
-
maxOutputBytes: options.maxOutputBytes
|
|
4094
|
-
});
|
|
4095
|
-
}
|
|
4096
|
-
async function getGitRemoteUrl(cwd, remoteName) {
|
|
4097
|
-
const result = await runCommand("git", ["remote", "get-url", remoteName], {
|
|
4098
|
-
cwd
|
|
4099
|
-
});
|
|
4100
|
-
if (result.code !== 0) return null;
|
|
4101
|
-
const url = result.stdout.trim();
|
|
4102
|
-
return url.length > 0 ? url : null;
|
|
4103
|
-
}
|
|
4104
|
-
|
|
4105
3489
|
export {
|
|
4106
3490
|
apiFetch,
|
|
4107
3491
|
readApiJson,
|
|
4108
3492
|
deployApp,
|
|
3493
|
+
getDeploymentLogs,
|
|
3494
|
+
getDeploymentStatus,
|
|
4109
3495
|
getLatestDeploymentForApp,
|
|
4110
3496
|
getDeploymentDetail,
|
|
3497
|
+
listApps,
|
|
4111
3498
|
createRepo,
|
|
4112
3499
|
updateAppCodeVisibility,
|
|
4113
3500
|
createHeadlessApps,
|
|
@@ -4116,6 +3503,7 @@ export {
|
|
|
4116
3503
|
deployLatestTemplate,
|
|
4117
3504
|
updateAppEnvironment,
|
|
4118
3505
|
getAppEnvironment,
|
|
3506
|
+
listUserTools,
|
|
4119
3507
|
createAgentFromPrompt,
|
|
4120
3508
|
getUserPerformance,
|
|
4121
3509
|
getAppRuntimeSummary,
|
|
@@ -4130,37 +3518,18 @@ export {
|
|
|
4130
3518
|
executeHostedTool,
|
|
4131
3519
|
openPondConfigDirectory,
|
|
4132
3520
|
writePrivateJsonFile,
|
|
3521
|
+
updatePrivateJsonFile,
|
|
4133
3522
|
loadGlobalConfig,
|
|
4134
3523
|
loadConfig,
|
|
4135
3524
|
listConfiguredProfiles,
|
|
4136
3525
|
setActiveProfile,
|
|
4137
3526
|
saveProfileApiKey,
|
|
4138
3527
|
saveGlobalConfig,
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
warnOnRepoHostMismatch,
|
|
4147
|
-
normalizeRepoName,
|
|
4148
|
-
fetchAppsWithCache,
|
|
4149
|
-
fetchToolsWithCache,
|
|
4150
|
-
resolveAppTarget,
|
|
4151
|
-
pollDeploymentLogs,
|
|
4152
|
-
promptConfirm,
|
|
4153
|
-
promptForPath,
|
|
4154
|
-
resolveSandboxClient,
|
|
4155
|
-
parseSandboxWorkflowModeOption,
|
|
4156
|
-
parseSandboxRuntimePromotionPolicyOption,
|
|
4157
|
-
parseSandboxRuntimeProfileIdOption,
|
|
4158
|
-
parseSandboxEnvOptions,
|
|
4159
|
-
parseSandboxTemplateEnvOptions,
|
|
4160
|
-
readSandboxSecretValue,
|
|
4161
|
-
summarizeSandboxSecret,
|
|
4162
|
-
runProcessCommand,
|
|
4163
|
-
runCommand,
|
|
4164
|
-
runShellCommand,
|
|
4165
|
-
getGitRemoteUrl
|
|
3528
|
+
DEFAULT_CACHE_TTL_MS,
|
|
3529
|
+
getCachedApps,
|
|
3530
|
+
setCachedApps,
|
|
3531
|
+
getCachedTools,
|
|
3532
|
+
setCachedTools,
|
|
3533
|
+
createOpenPondSandboxClient,
|
|
3534
|
+
SANDBOX_RUNTIME_PROFILE_IDS
|
|
4166
3535
|
};
|