@vite-hub/sandbox 0.1.0 → 0.3.1
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 +118 -53
- package/dist/abortable-CR01hzfi.js +57 -0
- package/dist/cloudflare-Cog_r2Me.js +910 -0
- package/dist/cloudflare-env-lookup-DzI6Xv1Y.js +16 -0
- package/dist/cloudflare-failure-CFQhalfh.js +50 -0
- package/dist/container-CqfD8yuE.js +868 -0
- package/dist/{crabbox-BFCdf41h.js → crabbox-sbV3Zjuo.js} +10 -6
- package/dist/error-diagnostics-5QT_BjbQ.js +354 -0
- package/dist/error-diagnostics-BJtLRL9w.js +536 -0
- package/dist/{file-listing-DECFTdSl.js → file-listing-CHtRrfo1.js} +1 -1
- package/dist/{file-lock-CxyVl4Cv.js → file-lock-D0-XPogS.js} +3 -2
- package/dist/{index-CXej1Bt0.d.ts → index-DsoQAUb7.d.ts} +94 -19
- package/dist/index.d.ts +2 -2
- package/dist/index.js +15 -10
- package/dist/internal/cloudflare.d.ts +173 -1
- package/dist/internal/cloudflare.js +4 -12
- package/dist/internal/host-toolchain.d.ts +1 -1
- package/dist/internal/host-toolchain.js +6 -7
- package/dist/internal/vercel.d.ts +1 -1
- package/dist/internal/vercel.js +3 -11
- package/dist/invariant-DolT9EEx.js +22 -0
- package/dist/module-types-B0LQ5H2S.js +7 -0
- package/dist/module-types-DCeJbS9Z.d.ts +110 -0
- package/dist/process-sweep-CMaujWE5.js +33 -0
- package/dist/provider-resolution-C6AQzuFG.js +133 -0
- package/dist/{remote-1Jz2oUMK.js → remote-70ZVZZlq.js} +32 -14
- package/dist/runtime-type-Deo4qzxN.js +9 -0
- package/dist/{session-DD0S1PDC.js → session-e0lyzjJ3.js} +2 -1
- package/dist/size-7AkVwGZb.js +118 -0
- package/dist/ssh.d.ts +8 -0
- package/dist/ssh.js +107 -40
- package/dist/task/index.d.ts +19 -17
- package/dist/task/index.js +92 -201
- package/dist/task/runtime/provider-loader.d.ts +7 -9
- package/dist/task/runtime/provider-loader.js +2 -5
- package/dist/task/runtime/providers/cloudflare.d.ts +5 -19
- package/dist/task/runtime/providers/cloudflare.js +7 -6
- package/dist/task/runtime/providers/vercel.d.ts +3 -3
- package/dist/task/runtime/providers/vercel.js +35 -4
- package/dist/task/runtime/state.d.ts +4 -1
- package/dist/task/runtime/state.js +11 -2
- package/dist/task/vite.d.ts +143 -17
- package/dist/task/vite.js +723 -400
- package/dist/{toolchain-BUVXtQ2m.js → toolchain-BIVGMRty.js} +12 -11
- package/dist/{trusted-host-DNMJ-Oig.js → trusted-host-kxkpaQcs.js} +21 -179
- package/dist/{vercel-Jtxa9TJx.js → vercel-BGGrNpza.js} +107 -34
- package/package.json +15 -12
- package/dist/cloudflare-DO0h3Ncf.js +0 -281
- package/dist/cloudflare-env-BBJaBbuQ.js +0 -39
- package/dist/error-diagnostics-BSysPv-D.js +0 -166
- package/dist/error-diagnostics-dGQqfgLt.js +0 -99
- package/dist/module-types-BfyRBaiP.js +0 -7
- package/dist/module-types-Cis4hrF1.d.ts +0 -95
- package/dist/runtime-type-DrmrW5m5.js +0 -42
package/dist/task/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { t as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { n as cloudflareRetryDelays, r as readCloudflareFailure, t as canRetryCloudflareRequest } from "../cloudflare-failure-CFQhalfh.js";
|
|
2
|
+
import { t as sandboxTaskErrorDiagnostics } from "../error-diagnostics-5QT_BjbQ.js";
|
|
3
|
+
import { a as resolveTaskSandbox, c as isSandboxTaskError, i as resolveRuntimeProvider, l as sandboxTaskError, n as assertSandboxTaskDefinitionOptions, o as unsupportedHostedSandboxTaskProviderError, r as createCloudflareExecutionSandboxId, s as withSandboxTaskProvider } from "../provider-resolution-C6AQzuFG.js";
|
|
4
|
+
import { getSandboxTaskRuntimeConfig, getSandboxTaskRuntimeRegistry, isSandboxTaskRuntimeDevelopment } from "./runtime/state.js";
|
|
5
|
+
import { t as getSandboxTaskFeatureDriver } from "../module-types-B0LQ5H2S.js";
|
|
6
|
+
import { deserializeResponse, getViteHubErrorShape, isSerializedResponse, toResponse } from "@vite-hub/runtime";
|
|
7
7
|
import { types } from "node:util";
|
|
8
|
-
import {
|
|
8
|
+
import { getStandardContext } from "@vite-hub/runtime/internal/h3";
|
|
9
9
|
import { dirname } from "pathe";
|
|
10
10
|
//#region src/task/internal/shared/definition.ts
|
|
11
11
|
function assertDefinitionHandler(functionName, handler, label) {
|
|
@@ -24,21 +24,22 @@ function validateDefinitionOptions(functionName, options, config) {
|
|
|
24
24
|
//#endregion
|
|
25
25
|
//#region src/task/runtime/registry.ts
|
|
26
26
|
function createSandboxTaskDefinition(functionName, input) {
|
|
27
|
+
if (input instanceof Object && Object.hasOwn(input, "run")) throw sandboxTaskErrorDiagnostics.SANDBOX_TASK_C0014({ message: `[vitehub] \`${functionName}({ run })\` was renamed. Pass the Sandbox handler as \`handler\`: \`${functionName}({ handler })\`.` });
|
|
27
28
|
const validated = validateDefinitionOptions(functionName, input, {
|
|
28
29
|
allowedKeys: [
|
|
29
|
-
"
|
|
30
|
+
"handler",
|
|
30
31
|
"timeout",
|
|
31
32
|
"env",
|
|
32
33
|
"project"
|
|
33
34
|
],
|
|
34
|
-
invalidKeysMessage: "supports only portable Sandbox options (
|
|
35
|
+
invalidKeysMessage: "supports only portable Sandbox options (handler, timeout, env, project)"
|
|
35
36
|
});
|
|
36
37
|
if (!validated) throw sandboxTaskErrorDiagnostics.SANDBOX_TASK_R0072({ message: `[vitehub] \`${functionName}()\` requires an options object.` });
|
|
37
38
|
if (typeof validated.project !== "undefined" && typeof validated.project !== "boolean") throw sandboxTaskErrorDiagnostics.SANDBOX_TASK_R0073({ message: `[vitehub] \`${functionName}()\` project must be a boolean.` });
|
|
38
|
-
const { project: _project,
|
|
39
|
-
assertDefinitionHandler(functionName,
|
|
39
|
+
const { project: _project, handler, ...options } = validated;
|
|
40
|
+
assertDefinitionHandler(functionName, handler, "Sandbox handler in `handler`");
|
|
40
41
|
return {
|
|
41
|
-
|
|
42
|
+
handler,
|
|
42
43
|
options: Object.keys(options).length ? options : void 0
|
|
43
44
|
};
|
|
44
45
|
}
|
|
@@ -47,53 +48,9 @@ function defineSandboxTask(input) {
|
|
|
47
48
|
}
|
|
48
49
|
//#endregion
|
|
49
50
|
//#region src/task/internal/shared/request-payload.ts
|
|
51
|
+
/** Read the JSON body of the request in the event's Standard Context, or `fallback` when the body is not JSON. */
|
|
50
52
|
async function readRequestPayload(event, fallback = {}) {
|
|
51
|
-
return await event.req.json().catch(() => fallback);
|
|
52
|
-
}
|
|
53
|
-
//#endregion
|
|
54
|
-
//#region src/task/sandbox-task/errors.ts
|
|
55
|
-
function sanitizeSandboxTaskDetail(value, depth = 0, seen = /* @__PURE__ */ new WeakSet()) {
|
|
56
|
-
if (value === null || typeof value === "boolean") return value;
|
|
57
|
-
if (typeof value === "string") return value.slice(0, 16384);
|
|
58
|
-
if (typeof value === "number") return Number.isFinite(value) ? value : void 0;
|
|
59
|
-
if (!value || typeof value !== "object" || depth >= 8 || seen.has(value)) return void 0;
|
|
60
|
-
seen.add(value);
|
|
61
|
-
try {
|
|
62
|
-
if (Array.isArray(value)) return value.slice(0, 128).flatMap((item) => {
|
|
63
|
-
const sanitized = sanitizeSandboxTaskDetail(item, depth + 1, seen);
|
|
64
|
-
return sanitized === void 0 ? [] : [sanitized];
|
|
65
|
-
});
|
|
66
|
-
if (Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null) return void 0;
|
|
67
|
-
const result = {};
|
|
68
|
-
for (const [key, item] of Object.entries(value).slice(0, 128)) {
|
|
69
|
-
if (!key || key.length > 128) continue;
|
|
70
|
-
result[key] = sanitizeSandboxTaskDetail(item, depth + 1, seen);
|
|
71
|
-
}
|
|
72
|
-
return result;
|
|
73
|
-
} catch {
|
|
74
|
-
return;
|
|
75
|
-
} finally {
|
|
76
|
-
seen.delete(value);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
function sanitizeSandboxTaskDetails(details) {
|
|
80
|
-
const sanitized = sanitizeSandboxTaskDetail(details);
|
|
81
|
-
return sanitized && !Array.isArray(sanitized) && typeof sanitized === "object" ? sanitized : void 0;
|
|
82
|
-
}
|
|
83
|
-
function sandboxTaskError(message, metadata = {}) {
|
|
84
|
-
const { cause, code = "SANDBOX_TASK_RUNTIME_ERROR", details, httpStatus, method, provider } = metadata;
|
|
85
|
-
return new ViteHubError(code, message.slice(0, 16384) || "Sandbox execution failed.", {
|
|
86
|
-
cause,
|
|
87
|
-
details: sanitizeSandboxTaskDetails({
|
|
88
|
-
...provider === void 0 ? {} : { provider },
|
|
89
|
-
...method === void 0 ? {} : { method },
|
|
90
|
-
...httpStatus === void 0 ? {} : { httpStatus },
|
|
91
|
-
...sanitizeSandboxTaskDetails(details)
|
|
92
|
-
})
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
function isSandboxTaskError(value) {
|
|
96
|
-
return getViteHubErrorShape(value)?.code.startsWith("SANDBOX_TASK_") === true;
|
|
53
|
+
return await getStandardContext(event).req.json().catch(() => fallback);
|
|
97
54
|
}
|
|
98
55
|
//#endregion
|
|
99
56
|
//#region src/task/internal/shared/validation.ts
|
|
@@ -190,33 +147,6 @@ async function readValidatedPayload(payload, validate, options) {
|
|
|
190
147
|
}
|
|
191
148
|
}
|
|
192
149
|
//#endregion
|
|
193
|
-
//#region src/task/internal/shared/cloudflare-retry.ts
|
|
194
|
-
const CLOUDFLARE_SANDBOX_RETRY_DELAYS_MS = [
|
|
195
|
-
1e3,
|
|
196
|
-
2e3,
|
|
197
|
-
5e3,
|
|
198
|
-
1e4,
|
|
199
|
-
15e3
|
|
200
|
-
];
|
|
201
|
-
const CLOUDFLARE_RETRIABLE_STARTUP_ERROR_RE = /container is starting|currently provisioning|retry in a moment|network connection lost|not listening in the tcp address|durable object reset|code was updated|aborterror|aborted|maximum number of running container instances exceeded|there is no container instance that can be provided to this durable object|cloudflare sandbox [a-z][a-z0-9]* timed out after \d+ms/i;
|
|
202
|
-
function collectErrorMessages(error) {
|
|
203
|
-
try {
|
|
204
|
-
if (types.isNativeError(error)) {
|
|
205
|
-
const message = error.message;
|
|
206
|
-
const cause = error.cause;
|
|
207
|
-
return [message, types.isNativeError(cause) ? cause.message : ""].filter(Boolean).join("\n");
|
|
208
|
-
}
|
|
209
|
-
} catch {}
|
|
210
|
-
try {
|
|
211
|
-
return String(error);
|
|
212
|
-
} catch {
|
|
213
|
-
return "";
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
function collectCloudflareErrorMessages(error, ...extraMessages) {
|
|
217
|
-
return [collectErrorMessages(error), ...extraMessages].filter(Boolean).join("\n");
|
|
218
|
-
}
|
|
219
|
-
//#endregion
|
|
220
150
|
//#region src/task/internal/shared/utils.ts
|
|
221
151
|
async function sleep(ms, signal) {
|
|
222
152
|
if (signal?.aborted) throw signal.reason;
|
|
@@ -422,7 +352,7 @@ function isErrorValue(value) {
|
|
|
422
352
|
function readErrorMessage(error) {
|
|
423
353
|
try {
|
|
424
354
|
const message = error.message;
|
|
425
|
-
return
|
|
355
|
+
return typeof message === "string" && message.length > 0 ? message : void 0;
|
|
426
356
|
} catch {
|
|
427
357
|
return;
|
|
428
358
|
}
|
|
@@ -431,7 +361,7 @@ function sandboxTaskCode(code) {
|
|
|
431
361
|
return code?.startsWith("SANDBOX_TASK_") ? code : "SANDBOX_TASK_RUNTIME_ERROR";
|
|
432
362
|
}
|
|
433
363
|
//#endregion
|
|
434
|
-
//#region src/task/runtime/entry-script.ts
|
|
364
|
+
//#region src/task/runtime/entry-script.injected.ts
|
|
435
365
|
const EXEC_STDIO_OUTPUT_MARKER = "__VITEHUB_OUTPUT__";
|
|
436
366
|
function createEntrySource(definitionPath, execution = "definition") {
|
|
437
367
|
const invocation = execution === "module" ? [
|
|
@@ -443,9 +373,9 @@ function createEntrySource(definitionPath, execution = "definition") {
|
|
|
443
373
|
] : [
|
|
444
374
|
` const mod = await import(pathToFileURL(${JSON.stringify(definitionPath)}).href)`,
|
|
445
375
|
` const definition = mod?.default`,
|
|
446
|
-
` if (!definition || typeof definition.
|
|
447
|
-
` throw new Error('Sandbox Task Definition must default-export defineSandboxTask({
|
|
448
|
-
` const result = await definition.
|
|
376
|
+
` if (!definition || typeof definition.handler !== 'function')`,
|
|
377
|
+
` throw new Error('Sandbox Task Definition must default-export defineSandboxTask({ handler }).')`,
|
|
378
|
+
` const result = await definition.handler(input.payload, input.context)`
|
|
449
379
|
];
|
|
450
380
|
return [
|
|
451
381
|
`import { mkdir, readFile, writeFile } from 'node:fs/promises'`,
|
|
@@ -717,6 +647,7 @@ function createEntrySource(definitionPath, execution = "definition") {
|
|
|
717
647
|
` try {`,
|
|
718
648
|
` const raw = await readFile(inputPath, 'utf8')`,
|
|
719
649
|
` const input = await reviveValue(JSON.parse(raw || '{}'), inputPath + '.files', 'input')`,
|
|
650
|
+
` input.context ??= {}`,
|
|
720
651
|
...invocation,
|
|
721
652
|
` const output = await serializeSuccess(result, outputPath + '.files')`,
|
|
722
653
|
` await writeFile(outputPath, output)`,
|
|
@@ -859,6 +790,7 @@ async function prepareSandboxTaskProjectAtomically(sandbox, bundle, projectDir,
|
|
|
859
790
|
signal: options.signal
|
|
860
791
|
});
|
|
861
792
|
await writeSandboxTaskDefinitionBundle(sandbox, staging, bundle, options.signal);
|
|
793
|
+
options.onCommandStart?.();
|
|
862
794
|
const result = await sandbox.exec(bundle.project.install.command, bundle.project.install.args, {
|
|
863
795
|
signal: options.signal,
|
|
864
796
|
timeout: options.timeout,
|
|
@@ -877,6 +809,7 @@ async function prepareSandboxTaskProjectAtomically(sandbox, bundle, projectDir,
|
|
|
877
809
|
signal: options.signal
|
|
878
810
|
});
|
|
879
811
|
await sandbox.writeFile(`${staging}/.vitehub/prepared`, bundle.project.digest, { signal: options.signal });
|
|
812
|
+
options.onCommandStart?.();
|
|
880
813
|
const published = await sandbox.exec("node", [
|
|
881
814
|
"-e",
|
|
882
815
|
"import(\"node:fs/promises\").then(({ rename }) => rename(process.argv[1], process.argv[2]))",
|
|
@@ -917,11 +850,14 @@ function getErrorMessage(error) {
|
|
|
917
850
|
if (error === void 0) return void 0;
|
|
918
851
|
return String(error);
|
|
919
852
|
}
|
|
920
|
-
|
|
853
|
+
/** The handler command may still write its output when the Cloudflare request failed after it could reach the Container. */
|
|
854
|
+
function mayHaveRunCloudflareExec(error) {
|
|
921
855
|
const metadata = readSandboxTaskErrorMetadata(error);
|
|
922
856
|
if (metadata?.provider && metadata.provider !== "cloudflare") return false;
|
|
923
|
-
if (metadata?.code === "SANDBOX_TASK_TIMEOUT"
|
|
924
|
-
|
|
857
|
+
if (metadata?.code === "SANDBOX_TASK_TIMEOUT") return true;
|
|
858
|
+
if (metadata?.code !== "SANDBOX_R0088") return false;
|
|
859
|
+
const failure = readCloudflareFailure(error);
|
|
860
|
+
return !failure.overloaded && !failure.coldStart;
|
|
925
861
|
}
|
|
926
862
|
function createHandlerError(message, provider, details) {
|
|
927
863
|
const publicDetails = {};
|
|
@@ -944,7 +880,7 @@ function tryParseSandboxTaskOutput(outputRaw) {
|
|
|
944
880
|
if (!outputRaw.trim()) return null;
|
|
945
881
|
try {
|
|
946
882
|
const output = JSON.parse(outputRaw);
|
|
947
|
-
if (
|
|
883
|
+
if (typeof output !== "object" || output === null || Array.isArray(output) || typeof Reflect.get(output, "ok") !== "boolean") return null;
|
|
948
884
|
return output;
|
|
949
885
|
} catch {
|
|
950
886
|
return null;
|
|
@@ -1039,7 +975,7 @@ async function waitForExecOutput(sandbox, outputPath, error, timeout, execution,
|
|
|
1039
975
|
});
|
|
1040
976
|
}
|
|
1041
977
|
async function recoverExecOutput(sandbox, outputPath, error, timeout, execution, signal) {
|
|
1042
|
-
if (sandbox.provider !== "cloudflare" || !
|
|
978
|
+
if (sandbox.provider !== "cloudflare" || !mayHaveRunCloudflareExec(error)) return null;
|
|
1043
979
|
return await waitForExecOutput(sandbox, outputPath, error, timeout, execution, signal);
|
|
1044
980
|
}
|
|
1045
981
|
async function waitForCloudflareOutput(sandbox, outputPath, error, timeout, execution, signal) {
|
|
@@ -1092,6 +1028,7 @@ async function executeSandboxTaskDefinitionOnce(sandbox, definitionName, definit
|
|
|
1092
1028
|
context
|
|
1093
1029
|
}, files.inputAssetsDir, "payload/context", signal), "payload/context") : void 0;
|
|
1094
1030
|
const prepared = await prepareSandboxTaskDefinition(sandbox, bundle, files.baseDir, {
|
|
1031
|
+
onCommandStart: lifecycle?.onCommandStart,
|
|
1095
1032
|
signal,
|
|
1096
1033
|
timeout: definitionOptions?.timeout
|
|
1097
1034
|
});
|
|
@@ -1113,7 +1050,7 @@ async function executeSandboxTaskDefinitionOnce(sandbox, definitionName, definit
|
|
|
1113
1050
|
let outputRaw = "";
|
|
1114
1051
|
let execution;
|
|
1115
1052
|
try {
|
|
1116
|
-
lifecycle?.
|
|
1053
|
+
lifecycle?.onCommandStart?.();
|
|
1117
1054
|
execution = await sandbox.exec("node", execArgs, {
|
|
1118
1055
|
cwd: prepared.cwd,
|
|
1119
1056
|
env: definitionOptions?.env,
|
|
@@ -1154,7 +1091,7 @@ async function executeSandboxTaskDefinitionOnce(sandbox, definitionName, definit
|
|
|
1154
1091
|
failure = { error };
|
|
1155
1092
|
throw error;
|
|
1156
1093
|
} finally {
|
|
1157
|
-
if (sandbox.provider === "cloudflare") {
|
|
1094
|
+
if (sandbox.provider === "cloudflare" && !sandbox.closesAfterRun) {
|
|
1158
1095
|
const cleanupTimeout = deadline === void 0 ? void 0 : SANDBOX_CLEANUP_GRACE_MS;
|
|
1159
1096
|
const cleanupOptions = cleanupTimeout === void 0 ? void 0 : { timeout: cleanupTimeout };
|
|
1160
1097
|
try {
|
|
@@ -1236,12 +1173,13 @@ async function executeSandboxTaskDefinition(sandbox, definitionName, definitionO
|
|
|
1236
1173
|
}
|
|
1237
1174
|
//#endregion
|
|
1238
1175
|
//#region src/task/runtime/task-sandbox.ts
|
|
1239
|
-
function createTaskSandbox(session, provider) {
|
|
1176
|
+
function createTaskSandbox(session, provider, closesAfterRun) {
|
|
1240
1177
|
return {
|
|
1241
1178
|
executionAuthority: session.executionAuthority,
|
|
1242
1179
|
id: session.id,
|
|
1243
1180
|
files: session.files,
|
|
1244
1181
|
provider,
|
|
1182
|
+
closesAfterRun,
|
|
1245
1183
|
async close() {
|
|
1246
1184
|
await session.close();
|
|
1247
1185
|
},
|
|
@@ -1265,87 +1203,6 @@ function createTaskSandbox(session, provider) {
|
|
|
1265
1203
|
};
|
|
1266
1204
|
}
|
|
1267
1205
|
//#endregion
|
|
1268
|
-
//#region src/task/internal/shared/provider-detection.ts
|
|
1269
|
-
function createProviderDetector(rules) {
|
|
1270
|
-
return () => {
|
|
1271
|
-
for (const rule of rules) if (rule.when()) return rule.provider;
|
|
1272
|
-
};
|
|
1273
|
-
}
|
|
1274
|
-
function getRuntimeEnv() {
|
|
1275
|
-
return typeof process !== "undefined" ? process.env : {};
|
|
1276
|
-
}
|
|
1277
|
-
const isCloudflare = () => {
|
|
1278
|
-
const env = getRuntimeEnv();
|
|
1279
|
-
return !!(env.CLOUDFLARE_WORKER || env.CF_PAGES);
|
|
1280
|
-
};
|
|
1281
|
-
const isVercel = () => {
|
|
1282
|
-
const env = getRuntimeEnv();
|
|
1283
|
-
return !!(env.VERCEL || env.VERCEL_ENV);
|
|
1284
|
-
};
|
|
1285
|
-
//#endregion
|
|
1286
|
-
//#region src/task/runtime/provider-resolution.ts
|
|
1287
|
-
const allowedDefinitionKeys = /* @__PURE__ */ new Set(["timeout", "env"]);
|
|
1288
|
-
const maxTimeout = 2147483647;
|
|
1289
|
-
const detectProvider = createProviderDetector([{
|
|
1290
|
-
provider: "cloudflare",
|
|
1291
|
-
when: isCloudflare
|
|
1292
|
-
}, {
|
|
1293
|
-
provider: "vercel",
|
|
1294
|
-
when: isVercel
|
|
1295
|
-
}]);
|
|
1296
|
-
function detectSandbox() {
|
|
1297
|
-
const env = typeof process !== "undefined" ? process.env : {};
|
|
1298
|
-
const type = detectProvider() || "none";
|
|
1299
|
-
if (type === "cloudflare") return {
|
|
1300
|
-
type,
|
|
1301
|
-
details: { runtime: typeof process === "undefined" ? "workerd" : "node" }
|
|
1302
|
-
};
|
|
1303
|
-
if (type === "vercel") return {
|
|
1304
|
-
type,
|
|
1305
|
-
details: { env: env.VERCEL_ENV }
|
|
1306
|
-
};
|
|
1307
|
-
return { type };
|
|
1308
|
-
}
|
|
1309
|
-
function hashCloudflareSandboxName(name) {
|
|
1310
|
-
let hash = 2166136261;
|
|
1311
|
-
for (let index = 0; index < name.length; index++) hash = Math.imul(hash ^ name.charCodeAt(index), 16777619);
|
|
1312
|
-
return (hash >>> 0).toString(36);
|
|
1313
|
-
}
|
|
1314
|
-
function createCloudflareExecutionSandboxId(name, sandboxId) {
|
|
1315
|
-
if (sandboxId) return sandboxId;
|
|
1316
|
-
const prefix = "vitehub-";
|
|
1317
|
-
const suffix = `-${hashCloudflareSandboxName(name)}-${crypto.randomUUID()}`;
|
|
1318
|
-
return `${prefix}${encodeURIComponent(name).slice(0, 55 - suffix.length)}${suffix}`;
|
|
1319
|
-
}
|
|
1320
|
-
function resolveRuntimeProvider(provider, event) {
|
|
1321
|
-
if (provider?.provider) return provider.provider;
|
|
1322
|
-
const envProvider = typeof process !== "undefined" ? process.env?.SANDBOX_PROVIDER : void 0;
|
|
1323
|
-
if (envProvider === "cloudflare" || envProvider === "vercel") return envProvider;
|
|
1324
|
-
if (getCloudflareEnv(event)) return "cloudflare";
|
|
1325
|
-
const detected = detectSandbox();
|
|
1326
|
-
if (detected.type === "cloudflare" || detected.type === "vercel") return detected.type;
|
|
1327
|
-
throw sandboxTaskError("Sandbox provider could not be inferred. Configure `sandbox.provider` as `cloudflare` or `vercel`.", { code: "SANDBOX_TASK_PROVIDER_REQUIRED" });
|
|
1328
|
-
}
|
|
1329
|
-
function assertSandboxTaskDefinitionOptions(local) {
|
|
1330
|
-
const invalidKeys = Object.keys(local).filter((key) => !allowedDefinitionKeys.has(key));
|
|
1331
|
-
if (invalidKeys.length > 0) throw sandboxTaskErrorDiagnostics.SANDBOX_TASK_R0069({ message: `[vitehub] Sandbox Task Definition options only support timeout and env. Unsupported: ${invalidKeys.join(", ")}` });
|
|
1332
|
-
if (local.timeout !== void 0 && (!Number.isInteger(local.timeout) || local.timeout <= 0 || local.timeout > maxTimeout)) throw sandboxTaskErrorDiagnostics.SANDBOX_TASK_R0070({ message: `[vitehub] Sandbox Task Definition timeout must be a positive integer no greater than ${maxTimeout}.` });
|
|
1333
|
-
}
|
|
1334
|
-
async function resolveTaskSandbox(provider, providerOptions, local, context) {
|
|
1335
|
-
return await (await (await import("vitehub-sandbox-task-provider-loader").catch(() => {
|
|
1336
|
-
return new Function("specifier", "return import(specifier)")("@vite-hub/sandbox/task/runtime/provider-loader");
|
|
1337
|
-
})).loadSandboxTaskRuntimeProvider(provider)).resolveTaskSandbox({
|
|
1338
|
-
local,
|
|
1339
|
-
provider: providerOptions
|
|
1340
|
-
}, context);
|
|
1341
|
-
}
|
|
1342
|
-
function withSandboxTaskProvider(provider, options) {
|
|
1343
|
-
return {
|
|
1344
|
-
...options,
|
|
1345
|
-
provider
|
|
1346
|
-
};
|
|
1347
|
-
}
|
|
1348
|
-
//#endregion
|
|
1349
1206
|
//#region src/task/runtime/result.ts
|
|
1350
1207
|
/** Convert a sandbox value to the native Web Response contract. */
|
|
1351
1208
|
async function ok(value) {
|
|
@@ -1354,16 +1211,33 @@ async function ok(value) {
|
|
|
1354
1211
|
function statusFor(error) {
|
|
1355
1212
|
const status = error.details?.httpStatus;
|
|
1356
1213
|
if (Number.isInteger(status) && Number(status) >= 400 && Number(status) <= 599) return Number(status);
|
|
1357
|
-
if (error.code
|
|
1214
|
+
if (error.code === "SANDBOX_TASK_TIMEOUT") return 504;
|
|
1358
1215
|
if (error.code.includes("NOT_FOUND")) return 404;
|
|
1359
1216
|
if (error.code.includes("VALIDATION")) return 400;
|
|
1360
1217
|
return 500;
|
|
1361
1218
|
}
|
|
1362
|
-
|
|
1219
|
+
const developmentOnlyDetails = /* @__PURE__ */ new Set([
|
|
1220
|
+
"args",
|
|
1221
|
+
"cause",
|
|
1222
|
+
"cwd",
|
|
1223
|
+
"output",
|
|
1224
|
+
"outputPreview",
|
|
1225
|
+
"stack",
|
|
1226
|
+
"stderr",
|
|
1227
|
+
"stderrPreview",
|
|
1228
|
+
"stdout",
|
|
1229
|
+
"stdoutPreview"
|
|
1230
|
+
]);
|
|
1231
|
+
function publicDetails(details, development) {
|
|
1232
|
+
if (development || !details) return details;
|
|
1233
|
+
return Object.fromEntries(Object.entries(details).filter(([key]) => !developmentOnlyDetails.has(key)));
|
|
1234
|
+
}
|
|
1235
|
+
/** Outside `vite dev`, the body keeps the code, message, and details without stack or process output. */
|
|
1236
|
+
function err(error, development = false) {
|
|
1363
1237
|
const body = JSON.stringify({ error: {
|
|
1364
1238
|
code: error.code,
|
|
1365
1239
|
message: error.message,
|
|
1366
|
-
details: error.details
|
|
1240
|
+
details: publicDetails(error.details, development)
|
|
1367
1241
|
} });
|
|
1368
1242
|
return new Response(body, {
|
|
1369
1243
|
status: statusFor(error),
|
|
@@ -1417,14 +1291,21 @@ async function serializeCloudflareRun(id, run, signal) {
|
|
|
1417
1291
|
else previous.then(releaseAfterPrevious, releaseAfterPrevious);
|
|
1418
1292
|
}
|
|
1419
1293
|
}
|
|
1420
|
-
|
|
1294
|
+
/**
|
|
1295
|
+
* A new run repeats every command of the failed one. Once a command starts, only the transport
|
|
1296
|
+
* can retry that request on a cold start without replaying earlier work.
|
|
1297
|
+
*/
|
|
1298
|
+
function canRerunCloudflareTask(error, commandMayHaveRun) {
|
|
1299
|
+
if (commandMayHaveRun) return false;
|
|
1421
1300
|
if (isSandboxTaskError(error) && error.cause instanceof AggregateError) error = error.cause.errors[0];
|
|
1301
|
+
if (error instanceof AggregateError) error = error.errors[0];
|
|
1422
1302
|
const metadata = readSandboxTaskErrorMetadata(error);
|
|
1423
1303
|
const provider = metadata?.provider;
|
|
1424
1304
|
if (provider && provider !== "cloudflare") return false;
|
|
1425
|
-
if (metadata?.code === "SANDBOX_TASK_TIMEOUT") return false;
|
|
1426
|
-
const
|
|
1427
|
-
|
|
1305
|
+
if (metadata?.code === "SANDBOX_TASK_TIMEOUT" || metadata?.code === "SANDBOX_TASK_HANDLER_ERROR") return false;
|
|
1306
|
+
const failure = readCloudflareFailure(error);
|
|
1307
|
+
if (failure.timedOut) return true;
|
|
1308
|
+
return canRetryCloudflareRequest(failure, true);
|
|
1428
1309
|
}
|
|
1429
1310
|
async function loadSandboxTaskDefinition(name) {
|
|
1430
1311
|
const registry = getSandboxTaskRuntimeRegistry() ?? {};
|
|
@@ -1437,9 +1318,9 @@ function hasValidSandboxTaskBundle(definition) {
|
|
|
1437
1318
|
}
|
|
1438
1319
|
async function resolveSandboxTaskProvider(sandboxTaskConfig, definition) {
|
|
1439
1320
|
assertSandboxTaskDefinitionOptions(definition.options ?? {});
|
|
1440
|
-
const config =
|
|
1321
|
+
const config = getSandboxTaskFeatureDriver(sandboxTaskConfig);
|
|
1441
1322
|
const provider = resolveRuntimeProvider(config);
|
|
1442
|
-
return await resolveTaskSandbox(provider, withSandboxTaskProvider(provider, config), definition.options ?? {}
|
|
1323
|
+
return await resolveTaskSandbox(provider, withSandboxTaskProvider(provider, config), definition.options ?? {});
|
|
1443
1324
|
}
|
|
1444
1325
|
async function createSandboxTaskRunner(name, definition, provider) {
|
|
1445
1326
|
const packageManager = definition.bundle.project?.install.command;
|
|
@@ -1448,26 +1329,28 @@ async function createSandboxTaskRunner(name, definition, provider) {
|
|
|
1448
1329
|
executionAuthority: sandbox.plan.executionAuthority,
|
|
1449
1330
|
name,
|
|
1450
1331
|
async run(payload, options = {}) {
|
|
1451
|
-
const
|
|
1452
|
-
const
|
|
1332
|
+
const namedSandboxId = options.sandboxId || provider.sandboxId;
|
|
1333
|
+
const cloudflareSandboxId = provider.provider === "cloudflare" ? createCloudflareExecutionSandboxId(name, namedSandboxId) : void 0;
|
|
1334
|
+
const closesAfterRun = provider.provider !== "cloudflare" || !namedSandboxId;
|
|
1335
|
+
const attempts = provider.provider === "cloudflare" ? cloudflareRetryDelays.length + 1 : 1;
|
|
1453
1336
|
options.signal?.throwIfAborted();
|
|
1454
1337
|
return await awaitWithAbort(serializeCloudflareRun(cloudflareSandboxId, async () => {
|
|
1455
1338
|
for (let attempt = 0; attempt < attempts; attempt++) {
|
|
1456
1339
|
let taskSandbox;
|
|
1457
|
-
let
|
|
1340
|
+
let commandMayHaveRun = false;
|
|
1458
1341
|
let runError;
|
|
1459
1342
|
let executionSettled;
|
|
1460
1343
|
try {
|
|
1461
1344
|
taskSandbox = createTaskSandbox(options.signal ? await sandbox.open({
|
|
1462
1345
|
id: cloudflareSandboxId,
|
|
1463
1346
|
signal: options.signal
|
|
1464
|
-
}) : await sandbox.open({ id: cloudflareSandboxId }), provider.provider);
|
|
1347
|
+
}) : await sandbox.open({ id: cloudflareSandboxId }), provider.provider, closesAfterRun);
|
|
1465
1348
|
const lifecycle = {
|
|
1466
1349
|
onExecution(execution) {
|
|
1467
1350
|
executionSettled = execution.then(() => void 0, () => void 0);
|
|
1468
1351
|
},
|
|
1469
|
-
|
|
1470
|
-
|
|
1352
|
+
onCommandStart() {
|
|
1353
|
+
commandMayHaveRun = true;
|
|
1471
1354
|
}
|
|
1472
1355
|
};
|
|
1473
1356
|
return options.signal ? await executeSandboxTaskDefinition(taskSandbox, name, definition.options, definition.bundle, payload, options.context, lifecycle, options.signal) : await executeSandboxTaskDefinition(taskSandbox, name, definition.options, definition.bundle, payload, options.context, lifecycle);
|
|
@@ -1475,12 +1358,12 @@ async function createSandboxTaskRunner(name, definition, provider) {
|
|
|
1475
1358
|
if (options.signal?.aborted) throw options.signal.reason ?? error;
|
|
1476
1359
|
const sandboxTaskError = toSandboxTaskError(error);
|
|
1477
1360
|
runError = sandboxTaskError;
|
|
1478
|
-
if (!(
|
|
1479
|
-
if (options.signal) await sleep(
|
|
1480
|
-
else await sleep(
|
|
1361
|
+
if (!(provider.provider === "cloudflare" && attempt < cloudflareRetryDelays.length && canRerunCloudflareTask(error, commandMayHaveRun))) throw sandboxTaskError;
|
|
1362
|
+
if (options.signal) await sleep(cloudflareRetryDelays[attempt], options.signal);
|
|
1363
|
+
else await sleep(cloudflareRetryDelays[attempt]);
|
|
1481
1364
|
} finally {
|
|
1482
1365
|
await executionSettled;
|
|
1483
|
-
if (
|
|
1366
|
+
if (closesAfterRun) try {
|
|
1484
1367
|
await taskSandbox?.close();
|
|
1485
1368
|
} catch (cleanupError) {
|
|
1486
1369
|
if (options.signal?.aborted) throw options.signal.reason ?? cleanupError;
|
|
@@ -1501,9 +1384,17 @@ async function resolveSandboxTaskRunner(name) {
|
|
|
1501
1384
|
if (!name) throw sandboxTaskErrorDiagnostics.SANDBOX_TASK_R0052({ message: "[vitehub] Sandbox name is required. An explicit name is required." });
|
|
1502
1385
|
const config = getSandboxTaskRuntimeConfig();
|
|
1503
1386
|
const definition = await loadSandboxTaskDefinition(name);
|
|
1504
|
-
if (!definition) throw sandboxTaskErrorDiagnostics.SANDBOX_TASK_R0053({ message: `[vitehub] Unknown Sandbox Task "${name}".` });
|
|
1387
|
+
if (!definition) throw sandboxTaskErrorDiagnostics.SANDBOX_TASK_R0053({ message: getSandboxTaskRuntimeRegistry() ? `[vitehub] Unknown Sandbox Task "${name}".` : `[vitehub] Unknown Sandbox Task "${name}". Sandbox Tasks are not enabled in this build. Set \`sandboxTask: true\` on a preset that supports Sandbox.` });
|
|
1505
1388
|
if (!hasValidSandboxTaskBundle(definition)) throw sandboxTaskErrorDiagnostics.SANDBOX_TASK_R0054({ message: `[vitehub] Sandbox "${name}" is invalid.` });
|
|
1506
|
-
|
|
1389
|
+
assertSandboxTaskDefinitionOptions(definition.options ?? {});
|
|
1390
|
+
const runDefinition = {
|
|
1391
|
+
...definition,
|
|
1392
|
+
options: {
|
|
1393
|
+
...definition.options,
|
|
1394
|
+
timeout: definition.options?.timeout ?? 3e5
|
|
1395
|
+
}
|
|
1396
|
+
};
|
|
1397
|
+
return await createSandboxTaskRunner(name, runDefinition, await resolveSandboxTaskProvider(config, runDefinition));
|
|
1507
1398
|
}
|
|
1508
1399
|
async function runSandboxTaskRuntime(name, payload, options) {
|
|
1509
1400
|
try {
|
|
@@ -1511,7 +1402,7 @@ async function runSandboxTaskRuntime(name, payload, options) {
|
|
|
1511
1402
|
return await ok(await (await resolveSandboxTaskRunner(name)).run(payload, options));
|
|
1512
1403
|
} catch (error) {
|
|
1513
1404
|
if (options?.signal?.aborted) throw options.signal.reason ?? error;
|
|
1514
|
-
return err(toSandboxTaskError(error));
|
|
1405
|
+
return err(toSandboxTaskError(error), isSandboxTaskRuntimeDevelopment());
|
|
1515
1406
|
}
|
|
1516
1407
|
}
|
|
1517
1408
|
//#endregion
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import { l as Sandbox } from "../../index-
|
|
2
|
-
import {
|
|
1
|
+
import { l as Sandbox } from "../../index-DsoQAUb7.js";
|
|
2
|
+
import { d as SandboxTaskDriver, o as SandboxTaskDefinitionDriverOptions, u as SandboxTaskDefinitionOptions } from "../../module-types-DCeJbS9Z.js";
|
|
3
3
|
//#region src/task/runtime/provider-loader.d.ts
|
|
4
4
|
export interface ResolvedTaskSandbox {
|
|
5
|
-
|
|
6
|
-
provider: SandboxTaskProvider;
|
|
5
|
+
provider: SandboxTaskDriver;
|
|
7
6
|
resolveSandbox: (requirements: readonly string[]) => Promise<Sandbox>;
|
|
8
7
|
sandboxId?: string;
|
|
9
8
|
}
|
|
10
9
|
export interface SandboxTaskRuntimeProvider {
|
|
11
10
|
resolveTaskSandbox: (options: {
|
|
12
11
|
local: SandboxTaskDefinitionOptions;
|
|
13
|
-
provider:
|
|
14
|
-
|
|
12
|
+
provider: SandboxTaskDefinitionDriverOptions & {
|
|
13
|
+
driver: SandboxTaskDriver;
|
|
15
14
|
};
|
|
16
|
-
} | any
|
|
15
|
+
} | any) => Promise<ResolvedTaskSandbox>;
|
|
17
16
|
}
|
|
18
|
-
export declare function
|
|
19
|
-
export declare function loadSandboxTaskRuntimeProvider(provider: SandboxTaskProvider): Promise<SandboxTaskRuntimeProvider>;
|
|
17
|
+
export declare function loadSandboxTaskRuntimeProvider(provider: SandboxTaskDriver): Promise<SandboxTaskRuntimeProvider>;
|
|
20
18
|
//#endregion
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { t as sandboxTaskErrorDiagnostics } from "../../error-diagnostics-
|
|
1
|
+
import { t as sandboxTaskErrorDiagnostics } from "../../error-diagnostics-5QT_BjbQ.js";
|
|
2
2
|
//#region src/task/runtime/provider-loader.ts
|
|
3
3
|
const dynamicImport = new Function("specifier", "return import(specifier)");
|
|
4
|
-
function unsupportedHostedSandboxTaskProviderError(provider) {
|
|
5
|
-
return sandboxTaskErrorDiagnostics.SANDBOX_TASK_R0076({ message: `[vitehub] Unsupported sandbox provider for this hosted build: ${String(provider)}` });
|
|
6
|
-
}
|
|
7
4
|
async function loadSandboxTaskRuntimeProvider(provider) {
|
|
8
5
|
if (provider === "cloudflare") {
|
|
9
6
|
const { resolveCloudflareTaskSandbox } = await dynamicImport("./providers/cloudflare.js");
|
|
@@ -16,4 +13,4 @@ async function loadSandboxTaskRuntimeProvider(provider) {
|
|
|
16
13
|
throw sandboxTaskErrorDiagnostics.SANDBOX_TASK_R0068({ message: `[vitehub] Unsupported sandbox provider: ${provider}` });
|
|
17
14
|
}
|
|
18
15
|
//#endregion
|
|
19
|
-
export { loadSandboxTaskRuntimeProvider
|
|
16
|
+
export { loadSandboxTaskRuntimeProvider };
|
|
@@ -1,26 +1,12 @@
|
|
|
1
|
-
import { l as Sandbox } from "../../../index-
|
|
2
|
-
import {
|
|
1
|
+
import { l as Sandbox } from "../../../index-DsoQAUb7.js";
|
|
2
|
+
import { n as CloudflareSandboxTaskDefinitionDriverOptions, u as SandboxTaskDefinitionOptions } from "../../../module-types-DCeJbS9Z.js";
|
|
3
3
|
//#region src/task/runtime/providers/cloudflare.d.ts
|
|
4
4
|
type SandboxTaskOptions = {
|
|
5
5
|
local: SandboxTaskDefinitionOptions;
|
|
6
|
-
provider:
|
|
6
|
+
provider: CloudflareSandboxTaskDefinitionDriverOptions;
|
|
7
7
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
cloudflare?: {
|
|
11
|
-
env?: Record<string, unknown>;
|
|
12
|
-
};
|
|
13
|
-
_platform?: {
|
|
14
|
-
cloudflare?: {
|
|
15
|
-
env?: Record<string, unknown>;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
export declare function resolveCloudflareTaskSandbox(options: SandboxTaskOptions, context?: {
|
|
21
|
-
event?: SandboxTaskEvent;
|
|
22
|
-
}): Promise<{
|
|
23
|
-
closeAfterRun: boolean;
|
|
8
|
+
/** Resolve the Sandbox namespace from the bindings of the active Cloudflare request. */
|
|
9
|
+
export declare function resolveCloudflareTaskSandbox(options: SandboxTaskOptions): Promise<{
|
|
24
10
|
provider: "cloudflare";
|
|
25
11
|
sandboxId: string | undefined;
|
|
26
12
|
resolveSandbox: (requirements: readonly string[]) => Promise<Sandbox>;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { resolveCloudflareSandbox } from "../../../internal/cloudflare.js";
|
|
2
|
-
import { t as sandboxTaskErrorDiagnostics } from "../../../error-diagnostics-
|
|
3
|
-
import { t as
|
|
2
|
+
import { t as sandboxTaskErrorDiagnostics } from "../../../error-diagnostics-5QT_BjbQ.js";
|
|
3
|
+
import { t as getActiveCloudflareEnv } from "../../../cloudflare-env-lookup-DzI6Xv1Y.js";
|
|
4
4
|
//#region src/task/runtime/providers/cloudflare.ts
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
/** Resolve the Sandbox namespace from the bindings of the active Cloudflare request. */
|
|
6
|
+
async function resolveCloudflareTaskSandbox(options) {
|
|
7
|
+
const env = getActiveCloudflareEnv();
|
|
7
8
|
const bindingName = options.provider.binding || "SANDBOX";
|
|
8
9
|
const namespace = env && Object.hasOwn(env, bindingName) ? env[bindingName] : void 0;
|
|
9
|
-
if (!namespace) throw sandboxTaskErrorDiagnostics.SANDBOX_TASK_R0071({ message: `Cloudflare sandbox requires the "${bindingName}" binding. Set sandbox.binding or run inside Cloudflare. The cloudflare preset writes the binding and its Container to .output/server/wrangler.json, and the Vite or Nuxt dev server cannot host them: build, then run \`npx wrangler --
|
|
10
|
+
if (!namespace) throw sandboxTaskErrorDiagnostics.SANDBOX_TASK_R0071({ message: `Cloudflare sandbox requires the "${bindingName}" binding. Set sandbox.binding or run inside Cloudflare. The cloudflare preset writes the binding and its Container to .output/server/wrangler.json, and the Vite or Nuxt dev server cannot host them: build, then run \`npx wrangler dev --config .output/server/wrangler.json\` (needs Docker).` });
|
|
10
11
|
return {
|
|
11
|
-
closeAfterRun: options.provider.keepAlive === true,
|
|
12
12
|
provider: "cloudflare",
|
|
13
13
|
sandboxId: options.provider.sandboxId,
|
|
14
14
|
resolveSandbox: async (requirements) => await resolveCloudflareSandbox({
|
|
15
15
|
namespace,
|
|
16
|
+
networkPolicy: options.provider.networkPolicy,
|
|
16
17
|
sandboxId: options.provider.sandboxId,
|
|
17
18
|
cloudflare: {
|
|
18
19
|
sleepAfter: options.provider.sleepAfter ?? "5m",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { l as Sandbox } from "../../../index-
|
|
2
|
-
import {
|
|
1
|
+
import { l as Sandbox } from "../../../index-DsoQAUb7.js";
|
|
2
|
+
import { g as VercelSandboxTaskDriverOptions, u as SandboxTaskDefinitionOptions } from "../../../module-types-DCeJbS9Z.js";
|
|
3
3
|
//#region src/task/runtime/providers/vercel.d.ts
|
|
4
4
|
type SandboxTaskOptions = {
|
|
5
5
|
local: SandboxTaskDefinitionOptions;
|
|
6
|
-
provider:
|
|
6
|
+
provider: VercelSandboxTaskDriverOptions;
|
|
7
7
|
};
|
|
8
8
|
export declare function resolveVercelTaskSandbox(options: SandboxTaskOptions): Promise<{
|
|
9
9
|
provider: "vercel";
|