@sandblocks/cli 0.6.8 → 0.6.9
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/dist/cli.js +13 -11
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -13286,10 +13286,11 @@ async function create(args, dependencies) {
|
|
|
13286
13286
|
projectId,
|
|
13287
13287
|
sandboxId,
|
|
13288
13288
|
workspaceId,
|
|
13289
|
-
pool: dependencies.option(options, "pool") ?? process.env.SANDBLOCKS_WORKER_POOL ?? "build-fleet",
|
|
13289
|
+
pool: dependencies.option(options, "pool") ?? process.env.SANDBLOCKS_WORKER_POOL ?? (preview.mode === "development" ? undefined : "build-fleet"),
|
|
13290
13290
|
apiUrl,
|
|
13291
13291
|
apiKey,
|
|
13292
13292
|
idempotencyKey: `${sandboxId}:workspace-import`,
|
|
13293
|
+
requiredWorkerRole: preview.mode === "development" ? "development" : "build",
|
|
13293
13294
|
source: dependencies.source,
|
|
13294
13295
|
..."image" in loaded.manifest.workspace && loaded.manifest.workspace.image ? { workspaceImage: loaded.manifest.workspace.image } : {}
|
|
13295
13296
|
});
|
|
@@ -13456,7 +13457,7 @@ async function deployUnlocked(args, dependencies) {
|
|
|
13456
13457
|
workspaceId: buildWorkspaceId,
|
|
13457
13458
|
sandboxId: context.state.sandboxId,
|
|
13458
13459
|
revisionId: deploymentId,
|
|
13459
|
-
runtimeType:
|
|
13460
|
+
runtimeType: managedEnvironmentId(context),
|
|
13460
13461
|
serviceUrls,
|
|
13461
13462
|
steps: serviceSteps,
|
|
13462
13463
|
..."image" in loaded.manifest.workspace && loaded.manifest.workspace.image ? { workspaceImage: loaded.manifest.workspace.image } : {},
|
|
@@ -13574,7 +13575,7 @@ async function deployUnlocked(args, dependencies) {
|
|
|
13574
13575
|
workspaceId: context.state.workspaceId,
|
|
13575
13576
|
deploymentId,
|
|
13576
13577
|
sandboxId: context.state.sandboxId,
|
|
13577
|
-
runtimeType:
|
|
13578
|
+
runtimeType: managedEnvironmentId(context),
|
|
13578
13579
|
stack,
|
|
13579
13580
|
workspace: preview.workspace,
|
|
13580
13581
|
artifactImage,
|
|
@@ -13630,7 +13631,7 @@ async function deployUnlocked(args, dependencies) {
|
|
|
13630
13631
|
workspaceId: buildWorkspaceId ?? context.state.workspaceId,
|
|
13631
13632
|
deploymentId,
|
|
13632
13633
|
sandboxId: context.state.sandboxId,
|
|
13633
|
-
runtimeType:
|
|
13634
|
+
runtimeType: managedEnvironmentId(context),
|
|
13634
13635
|
checks: preview.steps,
|
|
13635
13636
|
serviceUrls: serviceUrls2,
|
|
13636
13637
|
placement: {
|
|
@@ -13694,7 +13695,7 @@ async function deployDevelopmentUnlocked(context, loaded, preview) {
|
|
|
13694
13695
|
workspaceId: context.state.workspaceId,
|
|
13695
13696
|
sandboxId: context.state.sandboxId,
|
|
13696
13697
|
revisionId: context.state.sourceRevision ?? deploymentId,
|
|
13697
|
-
runtimeType:
|
|
13698
|
+
runtimeType: managedEnvironmentId(context),
|
|
13698
13699
|
serviceUrls,
|
|
13699
13700
|
steps,
|
|
13700
13701
|
..."image" in loaded.manifest.workspace && loaded.manifest.workspace.image ? { workspaceImage: loaded.manifest.workspace.image } : {},
|
|
@@ -13721,7 +13722,7 @@ async function deployDevelopmentUnlocked(context, loaded, preview) {
|
|
|
13721
13722
|
workspaceId: context.state.workspaceId,
|
|
13722
13723
|
deploymentId,
|
|
13723
13724
|
sandboxId: context.state.sandboxId,
|
|
13724
|
-
runtimeType:
|
|
13725
|
+
runtimeType: managedEnvironmentId(context),
|
|
13725
13726
|
stack,
|
|
13726
13727
|
workspace: preview.workspace,
|
|
13727
13728
|
mutableDevelopment: true,
|
|
@@ -14148,16 +14149,19 @@ async function importSource(input) {
|
|
|
14148
14149
|
"x-sandblocks-api-key": input.apiKey,
|
|
14149
14150
|
"x-sandblocks-workspace-id": input.workspaceId,
|
|
14150
14151
|
...input.sandboxId ? { "x-sandblocks-sandbox-id": input.sandboxId } : {},
|
|
14151
|
-
"x-sandblocks-worker-pool": input.pool,
|
|
14152
|
+
...input.pool ? { "x-sandblocks-worker-pool": input.pool } : {},
|
|
14152
14153
|
...input.memoryReservationBytes ? { "x-sandblocks-memory-reservation-bytes": String(input.memoryReservationBytes) } : {},
|
|
14154
|
+
...input.requiredWorkerRole ? { "x-sandblocks-worker-role": input.requiredWorkerRole } : {},
|
|
14153
14155
|
...input.workspaceImage ? { "x-sandblocks-workspace-image": input.workspaceImage } : {},
|
|
14154
14156
|
"idempotency-key": input.idempotencyKey
|
|
14155
14157
|
},
|
|
14156
14158
|
body: new Blob([Uint8Array.from(source.bundle)])
|
|
14157
14159
|
});
|
|
14158
14160
|
const submitted = await response.json().catch(() => ({}));
|
|
14159
|
-
if (!response.ok)
|
|
14160
|
-
|
|
14161
|
+
if (!response.ok) {
|
|
14162
|
+
const placement = submitted?.placement ? `: ${JSON.stringify(submitted.placement)}` : "";
|
|
14163
|
+
throw new Error(`${String(submitted?.error ?? `sandbox import failed (${response.status})`)}${placement}`);
|
|
14164
|
+
}
|
|
14161
14165
|
return {
|
|
14162
14166
|
files: source.files,
|
|
14163
14167
|
bytes: source.bundle.byteLength,
|
|
@@ -16657,5 +16661,3 @@ export {
|
|
|
16657
16661
|
run3 as run,
|
|
16658
16662
|
parse2 as parse
|
|
16659
16663
|
};
|
|
16660
|
-
|
|
16661
|
-
//# debugId=818C8E6D2946F5CD64756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sandblocks/cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Sandblocks command-line interface for workspaces, deployments, and agent sandboxes.",
|
|
6
6
|
"bin": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"bun": ">=1.1.0"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@sandblocks/manifest": "
|
|
21
|
-
"@sandblocks/sdk": "
|
|
20
|
+
"@sandblocks/manifest": "workspace:*",
|
|
21
|
+
"@sandblocks/sdk": "workspace:*"
|
|
22
22
|
}
|
|
23
23
|
}
|