windows-development-sandbox 1.27.1 → 1.27.3
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/app/context.d.ts +5 -0
- package/dist/app/context.js +13 -0
- package/dist/app/features/accounts/accounts.def.d.ts +16 -0
- package/dist/app/features/accounts/accounts.run.d.ts +4 -0
- package/dist/app/features/accounts/services.def.d.ts +15 -1
- package/dist/app/features/accounts/services.def.js +67 -31
- package/dist/app/features/accounts/services.run.d.ts +7 -2
- package/dist/app/features/accounts/services.run.js +25 -6
- package/dist/app/features/defs.d.ts +17 -0
- package/dist/app/registry.d.ts +1 -1
- package/dist/app/registry.js +15 -2
- package/dist/bin/agent-sandbox.js +2 -2
- package/dist/bin/{chunk-QUHNXHVG.js → chunk-4M5SZZ5P.js} +46 -41
- package/dist/bin/{chunk-4TLSWPG7.js → chunk-FA5VWLP4.js} +1 -1
- package/dist/bin/{chunk-RSIX7C6D.js → chunk-RU7XRN62.js} +249 -101
- package/dist/bin/claude-host.js +2 -2
- package/dist/bin/claude-sbx.js +2 -2
- package/dist/bin/codex-sbx.js +2 -2
- package/dist/bin/gemini-sbx.js +2 -2
- package/dist/bin/sandbox.js +2 -2
- package/dist/bin/sbx-hide.js +2 -2
- package/dist/bin/sbx-show.js +2 -2
- package/dist/cli/menu/menu.js +6 -1
- package/dist/cli/menu/pages/accounts-page.js +9 -5
- package/dist/guest/apps/app-installer.js +7 -5
- package/dist/guest/apps/comet-unpack.js +2 -2
- package/dist/guest/runtime/pools.d.ts +4 -4
- package/dist/guest/runtime/pools.js +4 -15
- package/dist/guest/runtime/process.d.ts +5 -2
- package/dist/guest/runtime/process.js +23 -3
- package/dist/guest/toolchains/engines/epic-launcher.d.ts +6 -0
- package/dist/guest/toolchains/engines/epic-launcher.js +19 -1
- package/dist/guest/toolchains/engines/unreal-engines.js +2 -1
- package/dist/guest/toolchains/installers.d.ts +3 -3
- package/dist/guest/toolchains/installers.js +5 -5
- package/dist/guest/toolchains/native/vcruntime.js +2 -2
- package/dist/guest/toolchains/native/vs-persist.d.ts +2 -2
- package/dist/guest/toolchains/signature.d.ts +2 -0
- package/dist/guest/toolchains/signature.js +9 -2
- package/dist/guest/toolchains/step-scheduler.js +1 -1
- package/dist/host/accounts/deliver.js +15 -7
- package/dist/host/pc-installs/discover.js +5 -2
- package/dist/host/pc-installs/unreal.d.ts +3 -1
- package/dist/host/pc-installs/unreal.js +27 -1
- package/dist/runtime/agent.js +34 -22
- package/dist/runtime/daemon.js +96 -51
- package/dist/runtime/db.js +32 -16
- package/dist/runtime/main.js +98 -53
- package/dist/runtime/netproxy.js +26 -12
- package/dist/runtime/tool.js +32 -15
- package/dist/runtime/view.js +26 -12
- package/dist/selftest/app.test.js +20 -2
- package/dist/selftest/boot-runner.test.js +15 -1
- package/dist/selftest/engines.test.js +22 -1
- package/dist/selftest/menu-screens.js +52 -1
- package/dist/selftest/menu.test.js +29 -3
- package/dist/selftest/service-accounts.test.js +77 -2
- package/dist/selftest/ui-text.test.js +4 -0
- package/dist/shared/accounts/kinds.js +9 -9
- package/dist/shared/apps/catalogue-gamedev.js +1 -0
- package/dist/shared/apps/catalogue.d.ts +2 -0
- package/dist/shared/concurrency/pools.js +1 -1
- package/dist/shared/download/archive.js +4 -2
- package/dist/shared/download/index.d.ts +1 -1
- package/dist/shared/download/index.js +1 -1
- package/dist/shared/download/spawn.d.ts +7 -1
- package/dist/shared/download/spawn.js +16 -1
- package/dist/shared/paths/pc-installs.d.ts +8 -0
- package/dist/shared/unreal/launcher-files.d.ts +7 -0
- package/dist/shared/unreal/launcher-files.js +32 -1
- package/dist/web/index.html +1 -1
- package/dist/web/{main-VPMYTSUL.js → main-NKM7ECSB.js} +59 -59
- package/native/csharp/HcsHost/AssemblyInfo.cs +3 -3
- package/native/csharp/HostTools/AssemblyInfo.cs +3 -3
- package/native/csharp/StorageHelper/AssemblyInfo.cs +3 -3
- package/package.json +1 -1
- package/schemas/config.schema.json +9 -9
- package/schemas/sandbox-config.schema.json +9 -9
package/dist/runtime/db.js
CHANGED
|
@@ -26069,6 +26069,7 @@ var GAMEDEV_APPS = [
|
|
|
26069
26069
|
size: "100 MB",
|
|
26070
26070
|
source: { github: "f3d-app/f3d", asset: "^F3D-[\\d.]+-Windows-x86_64\\.zip$" },
|
|
26071
26071
|
exe: "f3d.exe",
|
|
26072
|
+
onPath: true,
|
|
26072
26073
|
needs: ["mesa"]
|
|
26073
26074
|
},
|
|
26074
26075
|
{
|
|
@@ -27168,7 +27169,7 @@ var SERVICE_SPECS = {
|
|
|
27168
27169
|
},
|
|
27169
27170
|
steam: {
|
|
27170
27171
|
kind: "steam",
|
|
27171
|
-
label: "Steam
|
|
27172
|
+
label: "Steam",
|
|
27172
27173
|
usedBy: ["steam"],
|
|
27173
27174
|
sources: ["file", "sandbox"],
|
|
27174
27175
|
singleHolder: true,
|
|
@@ -27204,7 +27205,7 @@ var SERVICE_SPECS = {
|
|
|
27204
27205
|
},
|
|
27205
27206
|
cfx: {
|
|
27206
27207
|
kind: "cfx",
|
|
27207
|
-
label: "
|
|
27208
|
+
label: "FiveM key",
|
|
27208
27209
|
usedBy: ["fivem"],
|
|
27209
27210
|
sources: ["typed", "file"],
|
|
27210
27211
|
singleHolder: false,
|
|
@@ -27233,7 +27234,7 @@ var SERVICE_SPECS = {
|
|
|
27233
27234
|
},
|
|
27234
27235
|
keystore: {
|
|
27235
27236
|
kind: "keystore",
|
|
27236
|
-
label: "Android
|
|
27237
|
+
label: "Android keystore",
|
|
27237
27238
|
usedBy: ["android"],
|
|
27238
27239
|
sources: ["file"],
|
|
27239
27240
|
singleHolder: false,
|
|
@@ -27248,7 +27249,7 @@ var SERVICE_SPECS = {
|
|
|
27248
27249
|
},
|
|
27249
27250
|
play: {
|
|
27250
27251
|
kind: "play",
|
|
27251
|
-
label: "Google Play
|
|
27252
|
+
label: "Google Play",
|
|
27252
27253
|
usedBy: ["android"],
|
|
27253
27254
|
sources: ["file"],
|
|
27254
27255
|
singleHolder: false,
|
|
@@ -27259,7 +27260,7 @@ var SERVICE_SPECS = {
|
|
|
27259
27260
|
},
|
|
27260
27261
|
expo: {
|
|
27261
27262
|
kind: "expo",
|
|
27262
|
-
label: "Expo
|
|
27263
|
+
label: "Expo",
|
|
27263
27264
|
usedBy: ["reactNative"],
|
|
27264
27265
|
sources: ["typed"],
|
|
27265
27266
|
singleHolder: false,
|
|
@@ -27270,7 +27271,7 @@ var SERVICE_SPECS = {
|
|
|
27270
27271
|
},
|
|
27271
27272
|
appstore: {
|
|
27272
27273
|
kind: "appstore",
|
|
27273
|
-
label: "App Store Connect
|
|
27274
|
+
label: "App Store Connect",
|
|
27274
27275
|
usedBy: ["reactNative", "flutter"],
|
|
27275
27276
|
sources: ["file", "typed"],
|
|
27276
27277
|
singleHolder: false,
|
|
@@ -27284,7 +27285,7 @@ var SERVICE_SPECS = {
|
|
|
27284
27285
|
},
|
|
27285
27286
|
perplexity: {
|
|
27286
27287
|
kind: "perplexity",
|
|
27287
|
-
label: "Perplexity API
|
|
27288
|
+
label: "Perplexity API",
|
|
27288
27289
|
usedBy: ["perplexity"],
|
|
27289
27290
|
sources: ["pc", "file", "typed"],
|
|
27290
27291
|
singleHolder: false,
|
|
@@ -27308,7 +27309,7 @@ var SERVICE_SPECS = {
|
|
|
27308
27309
|
},
|
|
27309
27310
|
comet: {
|
|
27310
27311
|
kind: "comet",
|
|
27311
|
-
label: "Comet
|
|
27312
|
+
label: "Comet",
|
|
27312
27313
|
usedBy: ["comet"],
|
|
27313
27314
|
sources: ["sandbox"],
|
|
27314
27315
|
singleHolder: false,
|
|
@@ -27324,7 +27325,7 @@ var SERVICE_SPECS = {
|
|
|
27324
27325
|
},
|
|
27325
27326
|
perplexityapp: {
|
|
27326
27327
|
kind: "perplexityapp",
|
|
27327
|
-
label: "Perplexity
|
|
27328
|
+
label: "Perplexity app",
|
|
27328
27329
|
usedBy: ["perplexityapp"],
|
|
27329
27330
|
sources: ["sandbox"],
|
|
27330
27331
|
singleHolder: false,
|
|
@@ -28160,10 +28161,20 @@ function scriptArgs(name, args = []) {
|
|
|
28160
28161
|
}
|
|
28161
28162
|
|
|
28162
28163
|
// src/shared/download/spawn.ts
|
|
28164
|
+
import os3 from "node:os";
|
|
28163
28165
|
import { spawn } from "node:child_process";
|
|
28166
|
+
function lowerPriority(pid) {
|
|
28167
|
+
if (pid === void 0) return;
|
|
28168
|
+
try {
|
|
28169
|
+
os3.setPriority(pid, os3.constants.priority.PRIORITY_BELOW_NORMAL);
|
|
28170
|
+
} catch {
|
|
28171
|
+
}
|
|
28172
|
+
}
|
|
28164
28173
|
function spawnAsync(file2, args, options = {}) {
|
|
28174
|
+
const { lowPriority, ...spawnOptions } = options;
|
|
28165
28175
|
return new Promise((resolve, reject) => {
|
|
28166
|
-
const child = spawn(file2, args, { stdio: "ignore", windowsHide: true, ...
|
|
28176
|
+
const child = spawn(file2, args, { stdio: "ignore", windowsHide: true, ...spawnOptions });
|
|
28177
|
+
if (lowPriority) lowerPriority(child.pid);
|
|
28167
28178
|
child.once("error", reject);
|
|
28168
28179
|
child.once("close", (code) => resolve(code ?? -1));
|
|
28169
28180
|
});
|
|
@@ -28184,13 +28195,16 @@ function extractArchive(archive, destination, members2 = []) {
|
|
|
28184
28195
|
}
|
|
28185
28196
|
async function extract(archive, destination, members2) {
|
|
28186
28197
|
fs7.mkdirSync(destination, { recursive: true });
|
|
28187
|
-
let status = await spawnAsync(SYSTEM.tar(), ["-xf", archive, "-C", destination, ...members2]
|
|
28198
|
+
let status = await spawnAsync(SYSTEM.tar(), ["-xf", archive, "-C", destination, ...members2], {
|
|
28199
|
+
lowPriority: true
|
|
28200
|
+
});
|
|
28188
28201
|
if (status !== 0 && /\.(zip|nupkg)$/i.test(archive)) {
|
|
28189
28202
|
const zip = archive.endsWith(".zip") ? archive : archive + ".zip";
|
|
28190
28203
|
if (zip !== archive) fs7.copyFileSync(archive, zip);
|
|
28191
28204
|
status = await spawnAsync(
|
|
28192
28205
|
SYSTEM.powershell(),
|
|
28193
|
-
scriptArgs("expand-archive.ps1", ["-Archive", zip, "-Destination", destination])
|
|
28206
|
+
scriptArgs("expand-archive.ps1", ["-Archive", zip, "-Destination", destination]),
|
|
28207
|
+
{ lowPriority: true }
|
|
28194
28208
|
);
|
|
28195
28209
|
}
|
|
28196
28210
|
if (status !== 0) throw new Error("Could not extract " + archive);
|
|
@@ -28439,7 +28453,7 @@ import { spawn as spawn4 } from "node:child_process";
|
|
|
28439
28453
|
|
|
28440
28454
|
// src/guest/runtime/process.ts
|
|
28441
28455
|
import fs10 from "node:fs";
|
|
28442
|
-
import
|
|
28456
|
+
import os4 from "node:os";
|
|
28443
28457
|
import path12 from "node:path";
|
|
28444
28458
|
import { spawn as spawn2, spawnSync as spawnSync2 } from "node:child_process";
|
|
28445
28459
|
var outputSink = null;
|
|
@@ -28461,13 +28475,15 @@ function logLines(stream) {
|
|
|
28461
28475
|
stream.on("end", () => logOutput(partial2));
|
|
28462
28476
|
}
|
|
28463
28477
|
async function execAsync(file2, args, options = {}) {
|
|
28478
|
+
const { lowPriority, ...spawnOptions } = options;
|
|
28464
28479
|
const code = captureOutput() ? await new Promise((resolve, reject) => {
|
|
28465
|
-
const child = spawn2(file2, args, { stdio: ["inherit", "pipe", "pipe"], windowsHide: true, ...
|
|
28480
|
+
const child = spawn2(file2, args, { stdio: ["inherit", "pipe", "pipe"], windowsHide: true, ...spawnOptions });
|
|
28481
|
+
if (lowPriority) lowerPriority(child.pid);
|
|
28466
28482
|
logLines(child.stdout);
|
|
28467
28483
|
logLines(child.stderr);
|
|
28468
28484
|
child.once("error", reject);
|
|
28469
28485
|
child.once("close", (c) => resolve(c ?? -1));
|
|
28470
|
-
}) : await spawnAsync(file2, args, { stdio: "inherit", ...
|
|
28486
|
+
}) : await spawnAsync(file2, args, { stdio: "inherit", ...spawnOptions, ...lowPriority ? { lowPriority } : {} });
|
|
28471
28487
|
if (code !== 0)
|
|
28472
28488
|
throw new Error(path12.basename(file2) + " " + args.slice(0, 3).join(" ") + " failed with exit code " + code);
|
|
28473
28489
|
}
|
|
@@ -28492,7 +28508,7 @@ function runScript(name, args = []) {
|
|
|
28492
28508
|
throw new Error(name + " failed with exit code " + result.status + (errors ? ": " + errors.slice(0, 400) : ""));
|
|
28493
28509
|
}
|
|
28494
28510
|
function runScriptWithJson(name, param, data, args = []) {
|
|
28495
|
-
const dir = fs10.mkdtempSync(path12.join(
|
|
28511
|
+
const dir = fs10.mkdtempSync(path12.join(os4.tmpdir(), "sbx-"));
|
|
28496
28512
|
const file2 = path12.join(dir, "input.json");
|
|
28497
28513
|
try {
|
|
28498
28514
|
fs10.writeFileSync(file2, JSON.stringify(data), "utf8");
|
package/dist/runtime/main.js
CHANGED
|
@@ -26086,6 +26086,7 @@ var GAMEDEV_APPS = [
|
|
|
26086
26086
|
size: "100 MB",
|
|
26087
26087
|
source: { github: "f3d-app/f3d", asset: "^F3D-[\\d.]+-Windows-x86_64\\.zip$" },
|
|
26088
26088
|
exe: "f3d.exe",
|
|
26089
|
+
onPath: true,
|
|
26089
26090
|
needs: ["mesa"]
|
|
26090
26091
|
},
|
|
26091
26092
|
{
|
|
@@ -27426,7 +27427,7 @@ var SERVICE_SPECS = {
|
|
|
27426
27427
|
},
|
|
27427
27428
|
steam: {
|
|
27428
27429
|
kind: "steam",
|
|
27429
|
-
label: "Steam
|
|
27430
|
+
label: "Steam",
|
|
27430
27431
|
usedBy: ["steam"],
|
|
27431
27432
|
sources: ["file", "sandbox"],
|
|
27432
27433
|
singleHolder: true,
|
|
@@ -27462,7 +27463,7 @@ var SERVICE_SPECS = {
|
|
|
27462
27463
|
},
|
|
27463
27464
|
cfx: {
|
|
27464
27465
|
kind: "cfx",
|
|
27465
|
-
label: "
|
|
27466
|
+
label: "FiveM key",
|
|
27466
27467
|
usedBy: ["fivem"],
|
|
27467
27468
|
sources: ["typed", "file"],
|
|
27468
27469
|
singleHolder: false,
|
|
@@ -27491,7 +27492,7 @@ var SERVICE_SPECS = {
|
|
|
27491
27492
|
},
|
|
27492
27493
|
keystore: {
|
|
27493
27494
|
kind: "keystore",
|
|
27494
|
-
label: "Android
|
|
27495
|
+
label: "Android keystore",
|
|
27495
27496
|
usedBy: ["android"],
|
|
27496
27497
|
sources: ["file"],
|
|
27497
27498
|
singleHolder: false,
|
|
@@ -27506,7 +27507,7 @@ var SERVICE_SPECS = {
|
|
|
27506
27507
|
},
|
|
27507
27508
|
play: {
|
|
27508
27509
|
kind: "play",
|
|
27509
|
-
label: "Google Play
|
|
27510
|
+
label: "Google Play",
|
|
27510
27511
|
usedBy: ["android"],
|
|
27511
27512
|
sources: ["file"],
|
|
27512
27513
|
singleHolder: false,
|
|
@@ -27517,7 +27518,7 @@ var SERVICE_SPECS = {
|
|
|
27517
27518
|
},
|
|
27518
27519
|
expo: {
|
|
27519
27520
|
kind: "expo",
|
|
27520
|
-
label: "Expo
|
|
27521
|
+
label: "Expo",
|
|
27521
27522
|
usedBy: ["reactNative"],
|
|
27522
27523
|
sources: ["typed"],
|
|
27523
27524
|
singleHolder: false,
|
|
@@ -27528,7 +27529,7 @@ var SERVICE_SPECS = {
|
|
|
27528
27529
|
},
|
|
27529
27530
|
appstore: {
|
|
27530
27531
|
kind: "appstore",
|
|
27531
|
-
label: "App Store Connect
|
|
27532
|
+
label: "App Store Connect",
|
|
27532
27533
|
usedBy: ["reactNative", "flutter"],
|
|
27533
27534
|
sources: ["file", "typed"],
|
|
27534
27535
|
singleHolder: false,
|
|
@@ -27542,7 +27543,7 @@ var SERVICE_SPECS = {
|
|
|
27542
27543
|
},
|
|
27543
27544
|
perplexity: {
|
|
27544
27545
|
kind: "perplexity",
|
|
27545
|
-
label: "Perplexity API
|
|
27546
|
+
label: "Perplexity API",
|
|
27546
27547
|
usedBy: ["perplexity"],
|
|
27547
27548
|
sources: ["pc", "file", "typed"],
|
|
27548
27549
|
singleHolder: false,
|
|
@@ -27566,7 +27567,7 @@ var SERVICE_SPECS = {
|
|
|
27566
27567
|
},
|
|
27567
27568
|
comet: {
|
|
27568
27569
|
kind: "comet",
|
|
27569
|
-
label: "Comet
|
|
27570
|
+
label: "Comet",
|
|
27570
27571
|
usedBy: ["comet"],
|
|
27571
27572
|
sources: ["sandbox"],
|
|
27572
27573
|
singleHolder: false,
|
|
@@ -27582,7 +27583,7 @@ var SERVICE_SPECS = {
|
|
|
27582
27583
|
},
|
|
27583
27584
|
perplexityapp: {
|
|
27584
27585
|
kind: "perplexityapp",
|
|
27585
|
-
label: "Perplexity
|
|
27586
|
+
label: "Perplexity app",
|
|
27586
27587
|
usedBy: ["perplexityapp"],
|
|
27587
27588
|
sources: ["sandbox"],
|
|
27588
27589
|
singleHolder: false,
|
|
@@ -28363,7 +28364,7 @@ var logsDir = path9.join(dataDir, "logs");
|
|
|
28363
28364
|
var run = new RunDir(dataDir);
|
|
28364
28365
|
|
|
28365
28366
|
// src/guest/runtime/status.ts
|
|
28366
|
-
import
|
|
28367
|
+
import os4 from "node:os";
|
|
28367
28368
|
|
|
28368
28369
|
// src/core/util/errors.ts
|
|
28369
28370
|
function errMsg(e) {
|
|
@@ -28548,10 +28549,20 @@ function scriptArgs(name, args = []) {
|
|
|
28548
28549
|
}
|
|
28549
28550
|
|
|
28550
28551
|
// src/shared/download/spawn.ts
|
|
28552
|
+
import os3 from "node:os";
|
|
28551
28553
|
import { spawn } from "node:child_process";
|
|
28554
|
+
function lowerPriority(pid) {
|
|
28555
|
+
if (pid === void 0) return;
|
|
28556
|
+
try {
|
|
28557
|
+
os3.setPriority(pid, os3.constants.priority.PRIORITY_BELOW_NORMAL);
|
|
28558
|
+
} catch {
|
|
28559
|
+
}
|
|
28560
|
+
}
|
|
28552
28561
|
function spawnAsync(file3, args, options = {}) {
|
|
28562
|
+
const { lowPriority, ...spawnOptions } = options;
|
|
28553
28563
|
return new Promise((resolve2, reject) => {
|
|
28554
|
-
const child = spawn(file3, args, { stdio: "ignore", windowsHide: true, ...
|
|
28564
|
+
const child = spawn(file3, args, { stdio: "ignore", windowsHide: true, ...spawnOptions });
|
|
28565
|
+
if (lowPriority) lowerPriority(child.pid);
|
|
28555
28566
|
child.once("error", reject);
|
|
28556
28567
|
child.once("close", (code) => resolve2(code ?? -1));
|
|
28557
28568
|
});
|
|
@@ -28575,13 +28586,16 @@ function extractArchive(archive, destination, members2 = []) {
|
|
|
28575
28586
|
}
|
|
28576
28587
|
async function extract(archive, destination, members2) {
|
|
28577
28588
|
fs10.mkdirSync(destination, { recursive: true });
|
|
28578
|
-
let status = await spawnAsync(SYSTEM.tar(), ["-xf", archive, "-C", destination, ...members2]
|
|
28589
|
+
let status = await spawnAsync(SYSTEM.tar(), ["-xf", archive, "-C", destination, ...members2], {
|
|
28590
|
+
lowPriority: true
|
|
28591
|
+
});
|
|
28579
28592
|
if (status !== 0 && /\.(zip|nupkg)$/i.test(archive)) {
|
|
28580
28593
|
const zip = archive.endsWith(".zip") ? archive : archive + ".zip";
|
|
28581
28594
|
if (zip !== archive) fs10.copyFileSync(archive, zip);
|
|
28582
28595
|
status = await spawnAsync(
|
|
28583
28596
|
SYSTEM.powershell(),
|
|
28584
|
-
scriptArgs("expand-archive.ps1", ["-Archive", zip, "-Destination", destination])
|
|
28597
|
+
scriptArgs("expand-archive.ps1", ["-Archive", zip, "-Destination", destination]),
|
|
28598
|
+
{ lowPriority: true }
|
|
28585
28599
|
);
|
|
28586
28600
|
}
|
|
28587
28601
|
if (status !== 0) throw new Error("Could not extract " + archive);
|
|
@@ -28825,7 +28839,7 @@ function setBackgroundWork(work) {
|
|
|
28825
28839
|
}
|
|
28826
28840
|
}
|
|
28827
28841
|
function ownAddresses() {
|
|
28828
|
-
return Object.values(
|
|
28842
|
+
return Object.values(os4.networkInterfaces()).flat().filter((i) => Boolean(i) && i.family === "IPv4" && !i.internal).map((i) => i.address).slice(0, 8);
|
|
28829
28843
|
}
|
|
28830
28844
|
function writeStatus(phase, message) {
|
|
28831
28845
|
writeJsonAtomic(run.sandboxFile, {
|
|
@@ -28893,7 +28907,7 @@ import path18 from "node:path";
|
|
|
28893
28907
|
|
|
28894
28908
|
// src/guest/runtime/process.ts
|
|
28895
28909
|
import fs14 from "node:fs";
|
|
28896
|
-
import
|
|
28910
|
+
import os5 from "node:os";
|
|
28897
28911
|
import path17 from "node:path";
|
|
28898
28912
|
import { spawn as spawn2, spawnSync } from "node:child_process";
|
|
28899
28913
|
var outputSink = null;
|
|
@@ -28931,13 +28945,15 @@ function exec(file3, args, options = {}) {
|
|
|
28931
28945
|
throw new Error(path17.basename(file3) + " " + args.slice(0, 3).join(" ") + " failed with exit code " + result.status);
|
|
28932
28946
|
}
|
|
28933
28947
|
async function execAsync(file3, args, options = {}) {
|
|
28948
|
+
const { lowPriority, ...spawnOptions } = options;
|
|
28934
28949
|
const code = captureOutput() ? await new Promise((resolve2, reject) => {
|
|
28935
|
-
const child = spawn2(file3, args, { stdio: ["inherit", "pipe", "pipe"], windowsHide: true, ...
|
|
28950
|
+
const child = spawn2(file3, args, { stdio: ["inherit", "pipe", "pipe"], windowsHide: true, ...spawnOptions });
|
|
28951
|
+
if (lowPriority) lowerPriority(child.pid);
|
|
28936
28952
|
logLines(child.stdout);
|
|
28937
28953
|
logLines(child.stderr);
|
|
28938
28954
|
child.once("error", reject);
|
|
28939
28955
|
child.once("close", (c) => resolve2(c ?? -1));
|
|
28940
|
-
}) : await spawnAsync(file3, args, { stdio: "inherit", ...
|
|
28956
|
+
}) : await spawnAsync(file3, args, { stdio: "inherit", ...spawnOptions, ...lowPriority ? { lowPriority } : {} });
|
|
28941
28957
|
if (code !== 0)
|
|
28942
28958
|
throw new Error(path17.basename(file3) + " " + args.slice(0, 3).join(" ") + " failed with exit code " + code);
|
|
28943
28959
|
}
|
|
@@ -28991,8 +29007,23 @@ function runScriptAsync(name, args = []) {
|
|
|
28991
29007
|
function scriptOutput(name, args = [], options = {}) {
|
|
28992
29008
|
return execOutput(SYSTEM.powershell(), scriptArgs(name, args), options);
|
|
28993
29009
|
}
|
|
29010
|
+
function scriptOutputAsync(name, args = []) {
|
|
29011
|
+
return new Promise((resolve2) => {
|
|
29012
|
+
const child = spawn2(SYSTEM.powershell(), scriptArgs(name, args), {
|
|
29013
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
29014
|
+
windowsHide: true
|
|
29015
|
+
});
|
|
29016
|
+
let out = "";
|
|
29017
|
+
child.stdout?.setEncoding("utf8");
|
|
29018
|
+
child.stdout?.on("data", (chunk) => {
|
|
29019
|
+
if (out.length < CAPTURE_BYTES) out += chunk;
|
|
29020
|
+
});
|
|
29021
|
+
child.once("error", () => resolve2(""));
|
|
29022
|
+
child.once("close", (code) => resolve2(code === 0 ? out.trim() : ""));
|
|
29023
|
+
});
|
|
29024
|
+
}
|
|
28994
29025
|
function runScriptWithJson(name, param, data, args = []) {
|
|
28995
|
-
const dir = fs14.mkdtempSync(path17.join(
|
|
29026
|
+
const dir = fs14.mkdtempSync(path17.join(os5.tmpdir(), "sbx-"));
|
|
28996
29027
|
const file3 = path17.join(dir, "input.json");
|
|
28997
29028
|
try {
|
|
28998
29029
|
fs14.writeFileSync(file3, JSON.stringify(data), "utf8");
|
|
@@ -29002,7 +29033,7 @@ function runScriptWithJson(name, param, data, args = []) {
|
|
|
29002
29033
|
}
|
|
29003
29034
|
}
|
|
29004
29035
|
async function runScriptWithJsonAsync(name, param, data, args = []) {
|
|
29005
|
-
const dir = fs14.mkdtempSync(path17.join(
|
|
29036
|
+
const dir = fs14.mkdtempSync(path17.join(os5.tmpdir(), "sbx-"));
|
|
29006
29037
|
const file3 = path17.join(dir, "input.json");
|
|
29007
29038
|
try {
|
|
29008
29039
|
fs14.writeFileSync(file3, JSON.stringify(data), "utf8");
|
|
@@ -29451,13 +29482,14 @@ function itemSizes(saved) {
|
|
|
29451
29482
|
}
|
|
29452
29483
|
return sizes;
|
|
29453
29484
|
}
|
|
29485
|
+
var ITEM_NAME = /^[A-Za-z0-9_-]{1,80}\.item$/;
|
|
29454
29486
|
function isItemUnder(text2, root) {
|
|
29455
29487
|
const at = itemInstallLocation(text2);
|
|
29456
29488
|
return at !== null && isWithin(root, at) && win2.resolve(at) !== win2.resolve(root);
|
|
29457
29489
|
}
|
|
29458
29490
|
function itemFiles(dir) {
|
|
29459
29491
|
try {
|
|
29460
|
-
return fs16.readdirSync(dir).filter((f) =>
|
|
29492
|
+
return fs16.readdirSync(dir).filter((f) => ITEM_NAME.test(f));
|
|
29461
29493
|
} catch {
|
|
29462
29494
|
return [];
|
|
29463
29495
|
}
|
|
@@ -30706,7 +30738,6 @@ import fs21 from "node:fs";
|
|
|
30706
30738
|
import path34 from "node:path";
|
|
30707
30739
|
|
|
30708
30740
|
// src/guest/runtime/pools.ts
|
|
30709
|
-
import os5 from "node:os";
|
|
30710
30741
|
import { spawn as spawn4 } from "node:child_process";
|
|
30711
30742
|
import path31 from "node:path";
|
|
30712
30743
|
|
|
@@ -30780,7 +30811,7 @@ function installerRetry(code, attempt) {
|
|
|
30780
30811
|
}
|
|
30781
30812
|
|
|
30782
30813
|
// src/shared/concurrency/pools.ts
|
|
30783
|
-
var net2 = new Limiter(
|
|
30814
|
+
var net2 = new Limiter(3, "net");
|
|
30784
30815
|
var heavy = new Limiter(2, "heavy");
|
|
30785
30816
|
var installer = new Limiter(1, "installer");
|
|
30786
30817
|
|
|
@@ -30789,14 +30820,7 @@ function installPools() {
|
|
|
30789
30820
|
downloader.limit = net2;
|
|
30790
30821
|
limitExtraction(heavy);
|
|
30791
30822
|
}
|
|
30792
|
-
var
|
|
30793
|
-
function belowNormal(pid) {
|
|
30794
|
-
if (pid === void 0) return;
|
|
30795
|
-
try {
|
|
30796
|
-
os5.setPriority(pid, BELOW_NORMAL);
|
|
30797
|
-
} catch {
|
|
30798
|
-
}
|
|
30799
|
-
}
|
|
30823
|
+
var belowNormal = lowerPriority;
|
|
30800
30824
|
async function runInstaller(file3, args, o = {}) {
|
|
30801
30825
|
for (let attempt = 1; ; attempt++) {
|
|
30802
30826
|
const code = await installer.run(
|
|
@@ -30822,7 +30846,7 @@ async function runInstallerChecked(file3, args, o = {}) {
|
|
|
30822
30846
|
throw new Error(path31.basename(file3) + " " + args.slice(0, 3).join(" ") + " failed with exit code " + code);
|
|
30823
30847
|
}
|
|
30824
30848
|
function execHeavy(file3, args, options = {}) {
|
|
30825
|
-
return heavy.run(() => execAsync(file3, args, options));
|
|
30849
|
+
return heavy.run(() => execAsync(file3, args, { ...options, lowPriority: true }));
|
|
30826
30850
|
}
|
|
30827
30851
|
|
|
30828
30852
|
// src/guest/toolchains/installers.ts
|
|
@@ -30832,7 +30856,10 @@ import path32 from "node:path";
|
|
|
30832
30856
|
// src/guest/toolchains/signature.ts
|
|
30833
30857
|
var SignatureSchema = external_exports.object({ subject: external_exports.string().max(4096), issuer: external_exports.string().max(4096) });
|
|
30834
30858
|
function signatureOf(file3) {
|
|
30835
|
-
|
|
30859
|
+
return parseSignature(scriptOutput("get-signature.ps1", ["-Path", file3]));
|
|
30860
|
+
}
|
|
30861
|
+
function parseSignature(output3) {
|
|
30862
|
+
const text2 = output3.trim();
|
|
30836
30863
|
if (!text2) return null;
|
|
30837
30864
|
try {
|
|
30838
30865
|
const parsed = SignatureSchema.safeParse(JSON.parse(text2));
|
|
@@ -30844,11 +30871,14 @@ function signatureOf(file3) {
|
|
|
30844
30871
|
function signedBy(file3, signer) {
|
|
30845
30872
|
return signerMatches(signatureOf(file3), signer);
|
|
30846
30873
|
}
|
|
30874
|
+
async function signedByAsync(file3, signer) {
|
|
30875
|
+
return signerMatches(parseSignature(await scriptOutputAsync("get-signature.ps1", ["-Path", file3])), signer);
|
|
30876
|
+
}
|
|
30847
30877
|
|
|
30848
30878
|
// src/guest/toolchains/installers.ts
|
|
30849
30879
|
function signatureCheck(signer, what) {
|
|
30850
|
-
return (file3) => {
|
|
30851
|
-
if (!
|
|
30880
|
+
return async (file3) => {
|
|
30881
|
+
if (!await signedByAsync(file3, signer)) throw new Error(what + " is not signed by its vendor");
|
|
30852
30882
|
};
|
|
30853
30883
|
}
|
|
30854
30884
|
async function signedInstaller(url2, file3, what, signer, sha256 = null) {
|
|
@@ -30857,7 +30887,7 @@ async function signedInstaller(url2, file3, what, signer, sha256 = null) {
|
|
|
30857
30887
|
mkdirp(path32.dirname(file3));
|
|
30858
30888
|
await downloader.file(url2, file3, { sha256, verify: signatureCheck(signer, path32.basename(file3)) });
|
|
30859
30889
|
}
|
|
30860
|
-
if (!
|
|
30890
|
+
if (!await signedByAsync(file3, signer)) {
|
|
30861
30891
|
fs20.rmSync(file3, { force: true });
|
|
30862
30892
|
throw new Error(
|
|
30863
30893
|
path32.basename(file3) + " is not signed by its vendor; deleted it (it is downloaded again next boot)"
|
|
@@ -30965,6 +30995,18 @@ function savedEntries() {
|
|
|
30965
30995
|
function restoreLauncherItems() {
|
|
30966
30996
|
return restoreItems(SAVED_MANIFESTS, launcherManifestsDir(programData()), ENGINES_DIR, exists);
|
|
30967
30997
|
}
|
|
30998
|
+
function writePcLauncherItems(items) {
|
|
30999
|
+
const dir = launcherManifestsDir(programData());
|
|
31000
|
+
let written = 0;
|
|
31001
|
+
for (const i of items) {
|
|
31002
|
+
if (i.kind !== "unreal" || !i.launcherItem || !ITEM_NAME.test(i.launcherItem.name)) continue;
|
|
31003
|
+
const at = itemInstallLocation(i.launcherItem.text);
|
|
31004
|
+
if (!at || path34.win32.resolve(at).toLowerCase() !== path34.win32.resolve(i.guest).toLowerCase()) continue;
|
|
31005
|
+
fs21.writeFileSync(path34.join(mkdirp(dir), i.launcherItem.name), i.launcherItem.text, "utf8");
|
|
31006
|
+
written++;
|
|
31007
|
+
}
|
|
31008
|
+
return written;
|
|
31009
|
+
}
|
|
30968
31010
|
function writeLauncherEntries(entries3) {
|
|
30969
31011
|
if (!entries3.length) return;
|
|
30970
31012
|
const file3 = launcherInstalledFile(programData());
|
|
@@ -31029,6 +31071,7 @@ async function registerEngines(engines, selectorFrom, ctx, aliases = []) {
|
|
|
31029
31071
|
];
|
|
31030
31072
|
if (values.length) await runScriptWithJsonAsync("set-registry-values.ps1", "PlanFile", { values });
|
|
31031
31073
|
try {
|
|
31074
|
+
writePcLauncherItems(ctx.pcInstalls.items);
|
|
31032
31075
|
writeLauncherEntries(launcherEntries(engines, ctx));
|
|
31033
31076
|
} catch (e) {
|
|
31034
31077
|
warn("Unreal: the Epic Games Launcher's LauncherInstalled.dat was left as it is (" + errMsg(e) + ")");
|
|
@@ -31912,7 +31955,7 @@ async function installFromKept(dest, signer, what) {
|
|
|
31912
31955
|
if (!installer2) return null;
|
|
31913
31956
|
const installed = installedCometExe();
|
|
31914
31957
|
if (fs29.existsSync(installed)) return installed;
|
|
31915
|
-
if (!
|
|
31958
|
+
if (!await signedByAsync(installer2, signer)) {
|
|
31916
31959
|
fs29.rmSync(path44.join(dest, ".agent-sandbox-app"), { force: true });
|
|
31917
31960
|
fs29.rmSync(installer2, { force: true });
|
|
31918
31961
|
throw new Error(what + "'s installer is not signed by its vendor; deleted it (it is downloaded again next boot)");
|
|
@@ -32214,7 +32257,7 @@ var MARKER = ".agent-sandbox-app";
|
|
|
32214
32257
|
function prefetchedFile(entry, fileName) {
|
|
32215
32258
|
return path48.join(tool("apps", ...entry.id.split("/")) + ".download", fileName.replace(/[\\/:*?"<>|]/g, "_"));
|
|
32216
32259
|
}
|
|
32217
|
-
var PARALLEL =
|
|
32260
|
+
var PARALLEL = 2;
|
|
32218
32261
|
var AppInstaller = class {
|
|
32219
32262
|
constructor(env, options, parallel = PARALLEL) {
|
|
32220
32263
|
this.env = env;
|
|
@@ -32235,19 +32278,21 @@ var AppInstaller = class {
|
|
|
32235
32278
|
const todo = entries3.filter(
|
|
32236
32279
|
(e) => !("remote" in e.source) && !("locked" in e.source) && !("store" in e.source) && !("npm" in e.source) && e.id !== "7zip" && (this.options.refresh || !exists(path48.join(tool("apps", ...e.id.split("/")), MARKER)))
|
|
32237
32280
|
);
|
|
32238
|
-
await
|
|
32239
|
-
|
|
32240
|
-
|
|
32241
|
-
|
|
32242
|
-
|
|
32243
|
-
|
|
32244
|
-
|
|
32245
|
-
|
|
32246
|
-
|
|
32247
|
-
|
|
32248
|
-
|
|
32249
|
-
|
|
32250
|
-
|
|
32281
|
+
await asBackground(
|
|
32282
|
+
() => Promise.all(
|
|
32283
|
+
todo.map(async (entry) => {
|
|
32284
|
+
try {
|
|
32285
|
+
const d = await resolve(entry);
|
|
32286
|
+
const file3 = prefetchedFile(entry, d.fileName);
|
|
32287
|
+
if (exists(file3)) return;
|
|
32288
|
+
await downloader.file(d.url, file3, {
|
|
32289
|
+
sha256: d.sha256 ?? null,
|
|
32290
|
+
...entry.signer ? { verify: signatureCheck(entry.signer, d.fileName) } : {}
|
|
32291
|
+
});
|
|
32292
|
+
} catch {
|
|
32293
|
+
}
|
|
32294
|
+
})
|
|
32295
|
+
)
|
|
32251
32296
|
);
|
|
32252
32297
|
}
|
|
32253
32298
|
/** Installs the entries (7-Zip first: the NSIS apps need it to unpack), then their shortcuts. */
|
|
@@ -32304,7 +32349,7 @@ var AppInstaller = class {
|
|
|
32304
32349
|
const exe = findExe(dest, entry.exe) ?? (entry.unpack === "chromium" && entry.signer ? await installFromKept(dest, entry.signer, entry.name) : null);
|
|
32305
32350
|
if (!exe) throw new Error(entry.exe + " not found in the download");
|
|
32306
32351
|
await afterInstall(entry, exe);
|
|
32307
|
-
if (!entry.service && (entry.cli || entry.id === "sysinternals")) {
|
|
32352
|
+
if (!entry.service && (entry.cli || entry.onPath || entry.id === "sysinternals")) {
|
|
32308
32353
|
if (entry.id === "rust-analyzer") this.env.prepend.unshift(path48.dirname(exe));
|
|
32309
32354
|
else this.env.prepend.push(path48.dirname(exe));
|
|
32310
32355
|
}
|
|
@@ -35406,7 +35451,7 @@ async function setupVcRuntime(env, summary = true) {
|
|
|
35406
35451
|
log("Downloading the Visual C++ runtime (~25 MB once) ...");
|
|
35407
35452
|
await downloadFile(VC_REDIST, installer2);
|
|
35408
35453
|
}
|
|
35409
|
-
if (!
|
|
35454
|
+
if (!await signedByAsync(installer2, SIGNERS.microsoft)) {
|
|
35410
35455
|
fs56.rmSync(installer2, { force: true });
|
|
35411
35456
|
throw new Error("vc_redist.x64.exe is not signed by Microsoft; deleted it (it is downloaded again next boot)");
|
|
35412
35457
|
}
|
|
@@ -38645,7 +38690,7 @@ function plan(config3, versions, o) {
|
|
|
38645
38690
|
|
|
38646
38691
|
// src/guest/toolchains/step-scheduler.ts
|
|
38647
38692
|
import { AsyncLocalStorage as AsyncLocalStorage4 } from "node:async_hooks";
|
|
38648
|
-
var PARALLEL2 =
|
|
38693
|
+
var PARALLEL2 = 3;
|
|
38649
38694
|
async function runReported(sink2, name, env, work) {
|
|
38650
38695
|
try {
|
|
38651
38696
|
await work();
|