windows-development-sandbox 1.20.0 → 1.23.0
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/config.example.json +8 -1
- package/dist/app/features/access/access.def.js +5 -2
- package/dist/app/features/access/access.run.js +7 -3
- package/dist/app/features/accounts/accounts.def.d.ts +29 -1
- package/dist/app/features/accounts/accounts.def.js +10 -4
- package/dist/app/features/accounts/accounts.run.d.ts +1 -0
- package/dist/app/features/accounts/accounts.run.js +7 -2
- package/dist/app/features/accounts/services.def.d.ts +4 -1
- package/dist/app/features/accounts/services.def.js +15 -14
- package/dist/app/features/accounts/services.run.d.ts +1 -0
- package/dist/app/features/accounts/services.run.js +41 -15
- package/dist/app/features/defs.d.ts +39 -2
- package/dist/app/features/engine/engine.run.js +1 -1
- package/dist/app/features/github/github.def.d.ts +44 -3
- package/dist/app/features/github/github.def.js +145 -63
- package/dist/app/features/github/github.run.d.ts +9 -2
- package/dist/app/features/github/github.run.js +43 -5
- package/dist/app/features/health/health.def.js +8 -2
- package/dist/app/features/logs/logs.def.js +0 -8
- package/dist/app/features/projects/projects.def.js +2 -2
- package/dist/app/features/projects/projects.run.js +5 -5
- package/dist/app/features/sandbox/sandbox.def.js +7 -3
- package/dist/app/features/sessions/sessions.def.d.ts +4 -4
- package/dist/app/features/sessions/sessions.def.js +0 -5
- package/dist/app/features/sessions/sessions.run.d.ts +1 -1
- package/dist/app/features/sessions/sessions.run.js +2 -2
- package/dist/app/features/settings/categories.def.js +2 -0
- package/dist/app/features/settings/settings-rows.js +1 -1
- package/dist/app/features/settings/settings.def.js +1 -1
- package/dist/app/features/settings/settings.run.js +3 -3
- package/dist/app/features/storage/storage.run.js +18 -9
- package/dist/app/features/updates/update-lines.js +2 -2
- package/dist/app/features/updates/updates.def.js +1 -1
- package/dist/app/features/updates/updates.run.js +1 -1
- package/dist/app/features/web/web.def.js +2 -2
- package/dist/app/features/web/web.run.js +12 -4
- package/dist/app/kernel/errors.d.ts +7 -0
- package/dist/app/kernel/errors.js +18 -3
- package/dist/app/kernel/rpc.d.ts +5 -0
- package/dist/app/kernel/view.d.ts +11 -1
- package/dist/bin/agent-sandbox.js +2 -2
- package/dist/bin/{chunk-DK4NTBUF.js → chunk-JETGP2C3.js} +172 -48
- package/dist/bin/{chunk-2IMT7ZCT.js → chunk-XZKOPGNH.js} +1 -1
- package/dist/bin/{chunk-Z2P5OGKL.js → chunk-ZTTOF5V3.js} +2430 -1688
- 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/manifest.d.ts +2 -2
- package/dist/cli/manifest.js +2 -1
- package/dist/cli/menu/coverage-exempt.d.ts +17 -0
- package/dist/cli/menu/coverage-exempt.js +61 -0
- package/dist/cli/menu/io-menu.d.ts +2 -0
- package/dist/cli/menu/io-menu.js +50 -5
- package/dist/cli/menu/pages/accounts-page.js +1 -1
- package/dist/cli/menu/pages/agents-page.js +8 -2
- package/dist/cli/menu/pages/maintenance-page.d.ts +6 -0
- package/dist/cli/menu/pages/maintenance-page.js +9 -2
- package/dist/cli/menu/pages/sessions-page.d.ts +2 -0
- package/dist/cli/menu/pages/sessions-page.js +12 -4
- package/dist/cli/menu/pages/settings-page.js +12 -1
- package/dist/cli/menu/remote-menu.js +1 -1
- package/dist/cli/menu/shell.d.ts +5 -0
- package/dist/cli/menu/shell.js +13 -0
- package/dist/cli/report.js +2 -0
- package/dist/cli/tui/app.d.ts +5 -0
- package/dist/cli/tui/app.js +2 -0
- package/dist/core/config/defaults.js +3 -1
- package/dist/core/schema/accounts.d.ts +6 -0
- package/dist/core/schema/accounts.js +13 -11
- package/dist/core/schema/config.d.ts +20 -8
- package/dist/core/schema/config.js +4 -4
- package/dist/core/schema/github.js +1 -1
- package/dist/core/schema/profile.js +8 -4
- package/dist/core/schema/resume.js +1 -1
- package/dist/core/schema/sandbox.js +3 -3
- package/dist/core/schema/vpn.js +1 -1
- package/dist/core/schema/web.js +3 -3
- package/dist/core/types.d.ts +6 -0
- package/dist/core/util/errors.d.ts +11 -1
- package/dist/core/util/errors.js +7 -1
- package/dist/core/util/index.d.ts +1 -1
- package/dist/core/util/index.js +1 -1
- package/dist/guest/accounts/adapter.d.ts +2 -0
- package/dist/guest/accounts/adapters.js +4 -0
- package/dist/guest/accounts/apply.d.ts +6 -2
- package/dist/guest/accounts/kinds/cfx.d.ts +7 -0
- package/dist/guest/accounts/kinds/cfx.js +33 -3
- package/dist/guest/accounts/kinds/comet.d.ts +7 -0
- package/dist/guest/accounts/kinds/comet.js +50 -0
- package/dist/guest/accounts/kinds/perplexity.d.ts +2 -0
- package/dist/guest/accounts/kinds/perplexity.js +12 -0
- package/dist/guest/accounts/watch.d.ts +2 -0
- package/dist/guest/accounts/watch.js +12 -2
- package/dist/guest/agents/agent-installer.js +1 -1
- package/dist/guest/agents/profile-links.d.ts +2 -0
- package/dist/guest/agents/profile-links.js +18 -4
- package/dist/guest/apps/after-install.js +19 -0
- package/dist/guest/apps/app-installer.d.ts +11 -0
- package/dist/guest/apps/app-installer.js +69 -6
- package/dist/guest/apps/comet-unpack.d.ts +20 -0
- package/dist/guest/apps/comet-unpack.js +127 -0
- package/dist/guest/apps/index.d.ts +1 -1
- package/dist/guest/apps/index.js +1 -1
- package/dist/guest/apps/resolvers-agents-web.d.ts +2 -0
- package/dist/guest/apps/resolvers-agents-web.js +7 -0
- package/dist/guest/apps/resolvers.js +2 -0
- package/dist/guest/apps/shortcuts.d.ts +2 -0
- package/dist/guest/apps/shortcuts.js +1 -0
- package/dist/guest/apps/unpack.js +14 -4
- package/dist/guest/boot/boot.d.ts +45 -16
- package/dist/guest/boot/boot.js +316 -145
- package/dist/guest/boot/graph.d.ts +252 -0
- package/dist/guest/boot/graph.js +257 -0
- package/dist/guest/boot/guide-lines.d.ts +25 -0
- package/dist/guest/boot/guide-lines.js +41 -0
- package/dist/guest/boot/guide.d.ts +1 -4
- package/dist/guest/boot/guide.js +6 -8
- package/dist/guest/boot/runner.d.ts +77 -0
- package/dist/guest/boot/runner.js +215 -0
- package/dist/guest/browser/cdp.d.ts +71 -0
- package/dist/guest/browser/cdp.js +306 -0
- package/dist/guest/browser/comet.d.ts +28 -0
- package/dist/guest/browser/comet.js +155 -0
- package/dist/guest/daemon/project-provisioner.js +6 -1
- package/dist/guest/devtools/fivem.d.ts +1 -1
- package/dist/guest/devtools/fivem.js +243 -3
- package/dist/guest/entries/daemon.js +2 -0
- package/dist/guest/runtime/log.d.ts +12 -0
- package/dist/guest/runtime/log.js +29 -5
- package/dist/guest/runtime/pools.d.ts +24 -0
- package/dist/guest/runtime/pools.js +60 -0
- package/dist/guest/runtime/process.d.ts +4 -0
- package/dist/guest/runtime/process.js +38 -1
- package/dist/guest/runtime/status.d.ts +5 -1
- package/dist/guest/runtime/status.js +19 -0
- package/dist/guest/setup/addon-mcp.d.ts +1 -1
- package/dist/guest/setup/addon-mcp.js +52 -12
- package/dist/guest/setup/agent-addons.d.ts +3 -2
- package/dist/guest/setup/agent-addons.js +12 -3
- package/dist/guest/setup/environment.d.ts +1 -1
- package/dist/guest/setup/environment.js +25 -12
- package/dist/guest/setup/headroom.d.ts +8 -3
- package/dist/guest/setup/headroom.js +44 -15
- package/dist/guest/setup/path-plan.d.ts +28 -0
- package/dist/guest/setup/path-plan.js +69 -2
- package/dist/guest/setup/shell-path.d.ts +1 -1
- package/dist/guest/setup/shell-path.js +3 -3
- package/dist/guest/toolchains/fivem/artifacts.d.ts +48 -1
- package/dist/guest/toolchains/fivem/artifacts.js +97 -4
- package/dist/guest/toolchains/fivem/fivem.d.ts +32 -1
- package/dist/guest/toolchains/fivem/fivem.js +168 -3
- package/dist/guest/toolchains/fivem/scaffold.d.ts +35 -0
- package/dist/guest/toolchains/fivem/scaffold.js +105 -0
- package/dist/guest/toolchains/fivem/serve-plan.d.ts +34 -0
- package/dist/guest/toolchains/fivem/serve-plan.js +61 -0
- package/dist/guest/toolchains/languages/go.js +1 -1
- package/dist/guest/toolchains/languages/node.js +2 -1
- package/dist/guest/toolchains/languages/php.d.ts +2 -0
- package/dist/guest/toolchains/languages/php.js +13 -1
- package/dist/guest/toolchains/languages/python-tools.js +1 -1
- package/dist/guest/toolchains/languages/ruby.js +1 -1
- package/dist/guest/toolchains/native/binstall.js +1 -1
- package/dist/guest/toolchains/native/msvc/packages.js +10 -4
- package/dist/guest/toolchains/native/rust.d.ts +2 -0
- package/dist/guest/toolchains/native/rust.js +11 -4
- package/dist/guest/toolchains/native/unreal.d.ts +2 -0
- package/dist/guest/toolchains/native/unreal.js +16 -6
- package/dist/guest/toolchains/native/vcruntime.d.ts +2 -0
- package/dist/guest/toolchains/native/vcruntime.js +10 -2
- package/dist/guest/toolchains/native/visual-studio.d.ts +3 -0
- package/dist/guest/toolchains/native/visual-studio.js +44 -26
- package/dist/guest/toolchains/native/vs-request.d.ts +2 -0
- package/dist/guest/toolchains/native/vs-request.js +2 -0
- package/dist/guest/toolchains/plan.js +19 -8
- package/dist/guest/toolchains/scheduler.d.ts +2 -21
- package/dist/guest/toolchains/scheduler.js +7 -121
- package/dist/guest/toolchains/setup.d.ts +15 -2
- package/dist/guest/toolchains/setup.js +39 -20
- package/dist/guest/toolchains/split.d.ts +28 -0
- package/dist/guest/toolchains/split.js +60 -0
- package/dist/guest/toolchains/steam/client.js +2 -1
- package/dist/guest/toolchains/step-scheduler.d.ts +51 -0
- package/dist/guest/toolchains/step-scheduler.js +147 -0
- package/dist/guest/toolchains/step.d.ts +13 -0
- package/dist/guest/toolchains/tools/git.js +18 -0
- package/dist/guest/vpn/openvpn.js +3 -4
- package/dist/guest/vpn/wireguard.js +11 -4
- package/dist/host/accounts/deliver.js +7 -0
- package/dist/host/accounts/handoff.js +2 -6
- package/dist/host/accounts/index.d.ts +1 -1
- package/dist/host/accounts/index.js +1 -1
- package/dist/host/accounts/kinds/cfx.d.ts +1 -1
- package/dist/host/accounts/kinds/cfx.js +47 -4
- package/dist/host/accounts/kinds/comet.d.ts +2 -0
- package/dist/host/accounts/kinds/comet.js +6 -0
- package/dist/host/accounts/kinds/perplexity.d.ts +2 -0
- package/dist/host/accounts/kinds/perplexity.js +30 -0
- package/dist/host/accounts/leases.d.ts +7 -1
- package/dist/host/accounts/leases.js +13 -2
- package/dist/host/accounts/source.d.ts +7 -1
- package/dist/host/accounts/source.js +27 -0
- package/dist/host/accounts/sources.js +4 -0
- package/dist/host/github/deliver.d.ts +1 -1
- package/dist/host/github/deliver.js +20 -1
- package/dist/host/github/index.d.ts +2 -1
- package/dist/host/github/index.js +1 -0
- package/dist/host/github/token.d.ts +13 -1
- package/dist/host/github/token.js +19 -2
- package/dist/host/github/verify.d.ts +27 -0
- package/dist/host/github/verify.js +61 -0
- package/dist/host/launch/hints/fivem.d.ts +3 -1
- package/dist/host/launch/hints/fivem.js +68 -2
- package/dist/host/launch/session-file.js +4 -0
- package/dist/host/launch/toolchains.d.ts +2 -1
- package/dist/host/launch/toolchains.js +5 -3
- package/dist/host/vpn/nordvpn.d.ts +2 -4
- package/dist/host/vpn/nordvpn.js +2 -24
- package/dist/runtime/agent.js +405 -90
- package/dist/runtime/daemon.js +3010 -1383
- package/dist/runtime/db.js +333 -90
- package/dist/runtime/main.js +4720 -1954
- package/dist/runtime/netproxy.js +286 -69
- package/dist/runtime/tool.js +2852 -1780
- package/dist/runtime/view.js +286 -69
- package/dist/selftest/agent-paths.test.js +39 -1
- package/dist/selftest/agents-web.test.d.ts +2 -0
- package/dist/selftest/agents-web.test.js +647 -0
- package/dist/selftest/app.test.js +5 -2
- package/dist/selftest/boot-runner.test.d.ts +2 -0
- package/dist/selftest/boot-runner.test.js +456 -0
- package/dist/selftest/channel.test.js +15 -0
- package/dist/selftest/fivem.test.js +249 -3
- package/dist/selftest/github.test.js +94 -9
- package/dist/selftest/guest-boot.test.js +3 -0
- package/dist/selftest/health.test.js +1 -1
- package/dist/selftest/index.js +8 -0
- package/dist/selftest/layout.test.js +5 -0
- package/dist/selftest/menu-coverage.test.d.ts +2 -0
- package/dist/selftest/menu-coverage.test.js +46 -0
- package/dist/selftest/menu-screens.js +37 -1
- package/dist/selftest/persisted-installs.test.js +6 -3
- package/dist/selftest/service-accounts.test.js +3 -2
- package/dist/selftest/support/engine-golden.js +27 -0
- package/dist/selftest/support/fixtures.d.ts +6 -0
- package/dist/selftest/support/web-preview.d.ts +34 -1
- package/dist/selftest/support/web-preview.js +21 -18
- package/dist/selftest/toolchains.test.js +23 -1
- package/dist/selftest/ui-text.test.d.ts +7 -0
- package/dist/selftest/ui-text.test.js +300 -0
- package/dist/shared/accounts/index.d.ts +2 -0
- package/dist/shared/accounts/index.js +2 -0
- package/dist/shared/accounts/kinds/comet.d.ts +12 -0
- package/dist/shared/accounts/kinds/comet.js +64 -0
- package/dist/shared/accounts/kinds/perplexity.d.ts +8 -0
- package/dist/shared/accounts/kinds/perplexity.js +37 -0
- package/dist/shared/accounts/kinds.d.ts +24 -5
- package/dist/shared/accounts/kinds.js +86 -4
- package/dist/shared/accounts/payloads.d.ts +81 -0
- package/dist/shared/accounts/payloads.js +39 -1
- package/dist/shared/apps/agent-addons.d.ts +33 -5
- package/dist/shared/apps/agent-addons.js +95 -3
- package/dist/shared/apps/catalogue-agents-web.d.ts +14 -0
- package/dist/shared/apps/catalogue-agents-web.js +112 -0
- package/dist/shared/apps/catalogue-modding.js +32 -1
- package/dist/shared/apps/catalogue.d.ts +27 -3
- package/dist/shared/apps/catalogue.js +2 -1
- package/dist/shared/apps/index.d.ts +3 -1
- package/dist/shared/apps/index.js +3 -1
- package/dist/shared/channel/schema.d.ts +21 -3
- package/dist/shared/channel/schema.js +7 -0
- package/dist/shared/channel/secrets.d.ts +19 -0
- package/dist/shared/concurrency/index.d.ts +3 -0
- package/dist/shared/concurrency/index.js +3 -0
- package/dist/shared/concurrency/installer-retry.d.ts +6 -0
- package/dist/shared/concurrency/installer-retry.js +10 -0
- package/dist/shared/concurrency/limiter.d.ts +19 -0
- package/dist/shared/concurrency/limiter.js +67 -0
- package/dist/shared/concurrency/pools.d.ts +7 -0
- package/dist/shared/concurrency/pools.js +9 -0
- package/dist/shared/download/archive.d.ts +2 -0
- package/dist/shared/download/archive.js +11 -1
- package/dist/shared/download/bounded-fetch.d.ts +13 -0
- package/dist/shared/download/bounded-fetch.js +40 -0
- package/dist/shared/download/downloader.d.ts +5 -0
- package/dist/shared/download/downloader.js +50 -38
- package/dist/shared/download/index.d.ts +2 -1
- package/dist/shared/download/index.js +2 -1
- package/dist/shared/readiness.d.ts +2 -2
- package/dist/shared/readiness.js +2 -2
- package/dist/web/index.html +1 -1
- package/dist/web/{main-OUUQYNK4.js → main-CCILLX2M.js} +67 -67
- 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/sandbox/addons/browser-use-mcp/requirements.in +1 -0
- package/sandbox/addons/browser-use-mcp/requirements.txt +2350 -0
- package/sandbox/addons/chrome-devtools-mcp/package-lock.json +38 -0
- package/sandbox/addons/chrome-devtools-mcp/package.json +7 -0
- package/sandbox/addons/comet-mcp/package-lock.json +1277 -0
- package/sandbox/addons/comet-mcp/package.json +7 -0
- package/sandbox/addons/perplexity-mcp/package-lock.json +1655 -0
- package/sandbox/addons/perplexity-mcp/package.json +7 -0
- package/sandbox/scripts/add-firewall-port.ps1 +18 -4
- package/sandbox/scripts/set-machine-environment.ps1 +30 -15
- package/sandbox/templates/fivem/README.txt +6 -2
- package/sandbox/templates/fivem/cs/Client/Client.csproj +15 -0
- package/sandbox/templates/fivem/cs/Client/ClientMain.cs +20 -0
- package/sandbox/templates/fivem/cs/Server/Server.csproj +14 -0
- package/sandbox/templates/fivem/cs/Server/ServerMain.cs +20 -0
- package/sandbox/templates/fivem/cs/fxmanifest.lua +11 -0
- package/sandbox/templates/fivem/js/client.js +12 -0
- package/sandbox/templates/fivem/js/fxmanifest.lua +9 -0
- package/sandbox/templates/fivem/js/server.js +6 -0
- package/sandbox/templates/fivem/lua/client.lua +8 -0
- package/sandbox/templates/fivem/lua/fxmanifest.lua +10 -0
- package/sandbox/templates/fivem/lua/server.lua +6 -0
- package/sandbox/templates/fivem/server.cfg +37 -0
- package/sandbox/templates/fivem/ts/build.js +17 -0
- package/sandbox/templates/fivem/ts/fxmanifest.lua +9 -0
- package/sandbox/templates/fivem/ts/package.json +16 -0
- package/sandbox/templates/fivem/ts/src/client/client.ts +12 -0
- package/sandbox/templates/fivem/ts/src/client/tsconfig.json +13 -0
- package/sandbox/templates/fivem/ts/src/server/server.ts +6 -0
- package/sandbox/templates/fivem/ts/src/server/tsconfig.json +13 -0
- package/schemas/config.schema.json +56 -27
- package/schemas/sandbox-config.schema.json +37 -14
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { SYSTEM } from '../../shared/system.js';
|
|
4
|
+
import { errMsg } from '../../core/util/errors.js';
|
|
5
|
+
import { takePendingComet } from '../accounts/kinds/comet.js';
|
|
6
|
+
import { restoreCometSignIn } from '../browser/comet.js';
|
|
7
|
+
import { log, warn } from '../runtime/log.js';
|
|
4
8
|
import { execAsync } from '../runtime/process.js';
|
|
5
9
|
import { exists, mkdirp } from '../runtime/fs.js';
|
|
6
10
|
import { arch, tool } from '../toolchains/tool-env.js';
|
|
@@ -24,6 +28,19 @@ const SYSINTERNALS_TOOLS = [
|
|
|
24
28
|
'Du',
|
|
25
29
|
'ZoomIt',
|
|
26
30
|
];
|
|
31
|
+
/** Your saved Comet sign-in (handed over at boot) goes into Comet's profile now that Comet is there. */
|
|
32
|
+
async function restoreComet(exe) {
|
|
33
|
+
const pending = takePendingComet();
|
|
34
|
+
if (!pending)
|
|
35
|
+
return;
|
|
36
|
+
try {
|
|
37
|
+
const written = await restoreCometSignIn(exe, pending);
|
|
38
|
+
log('Comet: your saved sign-in is in its profile (' + written + ' cookies).');
|
|
39
|
+
}
|
|
40
|
+
catch (e) {
|
|
41
|
+
warn('Comet: your saved sign-in could not be put into its profile (' + errMsg(e) + '); sign in again in Comet.');
|
|
42
|
+
}
|
|
43
|
+
}
|
|
27
44
|
/** Settings an app needs on every boot (the sandbox's registry is new each time), and files next to its program. */
|
|
28
45
|
export async function afterInstall(entry, exe) {
|
|
29
46
|
const dir = path.dirname(exe);
|
|
@@ -39,6 +56,8 @@ export async function afterInstall(entry, exe) {
|
|
|
39
56
|
fs.writeFileSync(path.join(dir, '._sc_'), '');
|
|
40
57
|
if (entry.id === 'sublime')
|
|
41
58
|
mkdirp(path.join(dir, 'Data'));
|
|
59
|
+
if (entry.id === 'comet')
|
|
60
|
+
await restoreComet(exe);
|
|
42
61
|
if (entry.id === 'sysinternals') {
|
|
43
62
|
for (const name of SYSINTERNALS_TOOLS) {
|
|
44
63
|
await execAsync(SYSTEM.reg(), ['add', 'HKCU\\Software\\Sysinternals\\' + name, '/v', 'EulaAccepted', '/t', 'REG_DWORD', '/d', '1', '/f'], { stdio: 'ignore' }).catch(() => undefined);
|
|
@@ -4,6 +4,8 @@ import { type ToolEnv } from '../toolchains/tool-env.js';
|
|
|
4
4
|
export interface AppsOptions {
|
|
5
5
|
gitAccess: GitAccess;
|
|
6
6
|
refresh: boolean;
|
|
7
|
+
/** Every app chosen (apps.install): one app's start-up can depend on another (Comet's port for comet-mcp). */
|
|
8
|
+
chosen?: readonly string[];
|
|
7
9
|
}
|
|
8
10
|
export declare class AppInstaller {
|
|
9
11
|
private readonly env;
|
|
@@ -12,11 +14,20 @@ export declare class AppInstaller {
|
|
|
12
14
|
private readonly gui;
|
|
13
15
|
private readonly installed;
|
|
14
16
|
constructor(env: ToolEnv, options: AppsOptions, parallel?: number);
|
|
17
|
+
/**
|
|
18
|
+
* Downloads the plain downloads (not pinned, not npm, not remote) of the apps that are not installed yet, into
|
|
19
|
+
* `<app folder>.download`, which `download()` uses instead of downloading again. A failure is left for the install.
|
|
20
|
+
*/
|
|
21
|
+
prefetch(entries: readonly AppEntry[]): Promise<void>;
|
|
15
22
|
/** Installs the entries (7-Zip first: the NSIS apps need it to unpack), then their shortcuts. */
|
|
16
23
|
installAll(entries: readonly AppEntry[]): Promise<void>;
|
|
17
24
|
private installOne;
|
|
25
|
+
/** The command line an app's shortcut starts it with (Comet: its own profile, DevTools on 127.0.0.1). */
|
|
26
|
+
private launchArgs;
|
|
18
27
|
/** Downloads and unpacks one entry into its folder (replaced in one step: never half there). */
|
|
19
28
|
private download;
|
|
20
29
|
}
|
|
21
30
|
/** Installs apps.install and apps.custom (skipped ones are listed in the summary). */
|
|
22
31
|
export declare function setupApps(env: ToolEnv, apps: Config['apps'], o: AppsOptions): Promise<void>;
|
|
32
|
+
/** Downloads the apps ahead of their install (the Apps step waits for Mesa, uv and the runtime first). */
|
|
33
|
+
export declare function prefetchApps(apps: Config['apps'], o: AppsOptions): Promise<void>;
|
|
@@ -6,18 +6,25 @@ import { appsToInstall } from '../../shared/apps/index.js';
|
|
|
6
6
|
import { downloader, moveIntoPlace, stagingFolder } from '../../shared/download/index.js';
|
|
7
7
|
import { safeRemove } from '../../shared/io/safe-remove.js';
|
|
8
8
|
import { dryRun, launchDir } from '../runtime/paths.js';
|
|
9
|
-
import { execAsync } from '../runtime/
|
|
9
|
+
import { execHeavy as execAsync } from '../runtime/pools.js';
|
|
10
10
|
import { exists, mkdirp } from '../runtime/fs.js';
|
|
11
11
|
import { log, warn } from '../runtime/log.js';
|
|
12
12
|
import { errMsg } from '../../core/util/errors.js';
|
|
13
|
-
import { tool } from '../toolchains/tool-env.js';
|
|
13
|
+
import { emptyEnv, tool } from '../toolchains/tool-env.js';
|
|
14
14
|
import { uvVars } from '../toolchains/runtimes.js';
|
|
15
|
+
import { COMET_MCP_PORT, cometShortcutArgs } from '../browser/comet.js';
|
|
15
16
|
import { afterInstall } from './after-install.js';
|
|
17
|
+
import { installFromKept } from './comet-unpack.js';
|
|
16
18
|
import { findExe } from './find-exe.js';
|
|
17
19
|
import { shortcuts } from './shortcuts.js';
|
|
20
|
+
import { signatureCheck } from '../toolchains/installers.js';
|
|
18
21
|
import { resolve } from './sources.js';
|
|
19
22
|
import { unpack } from './unpack.js';
|
|
20
23
|
const MARKER = '.agent-sandbox-app';
|
|
24
|
+
/** Where `prefetch` keeps an app's download until `download()` takes it (next to the app's folder, never inside). */
|
|
25
|
+
function prefetchedFile(entry, fileName) {
|
|
26
|
+
return path.join(tool('apps', ...entry.id.split('/')) + '.download', fileName.replace(/[\\/:*?"<>|]/g, '_'));
|
|
27
|
+
}
|
|
21
28
|
/** How many apps download and unpack at once (they are big: a few at a time keeps the disk and network busy). */
|
|
22
29
|
const PARALLEL = 3;
|
|
23
30
|
export class AppInstaller {
|
|
@@ -31,6 +38,32 @@ export class AppInstaller {
|
|
|
31
38
|
this.options = options;
|
|
32
39
|
this.parallel = parallel;
|
|
33
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Downloads the plain downloads (not pinned, not npm, not remote) of the apps that are not installed yet, into
|
|
43
|
+
* `<app folder>.download`, which `download()` uses instead of downloading again. A failure is left for the install.
|
|
44
|
+
*/
|
|
45
|
+
async prefetch(entries) {
|
|
46
|
+
const todo = entries.filter((e) => !('remote' in e.source) &&
|
|
47
|
+
!('locked' in e.source) &&
|
|
48
|
+
!('npm' in e.source) &&
|
|
49
|
+
e.id !== '7zip' &&
|
|
50
|
+
(this.options.refresh || !exists(path.join(tool('apps', ...e.id.split('/')), MARKER))));
|
|
51
|
+
await Promise.all(todo.map(async (entry) => {
|
|
52
|
+
try {
|
|
53
|
+
const d = await resolve(entry);
|
|
54
|
+
const file = prefetchedFile(entry, d.fileName);
|
|
55
|
+
if (exists(file))
|
|
56
|
+
return;
|
|
57
|
+
await downloader.file(d.url, file, {
|
|
58
|
+
sha256: d.sha256 ?? null,
|
|
59
|
+
...(entry.signer ? { verify: signatureCheck(entry.signer, d.fileName) } : {}),
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
/* the install resolves and downloads again, and reports the reason if it fails too */
|
|
64
|
+
}
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
34
67
|
/** Installs the entries (7-Zip first: the NSIS apps need it to unpack), then their shortcuts. */
|
|
35
68
|
async installAll(entries) {
|
|
36
69
|
const [first, rest] = entries[0]?.id === '7zip' ? [[entries[0]], entries.slice(1)] : [[], entries];
|
|
@@ -53,9 +86,18 @@ export class AppInstaller {
|
|
|
53
86
|
async installOne(entry) {
|
|
54
87
|
try {
|
|
55
88
|
const dest = tool('apps', ...entry.id.split('/'));
|
|
89
|
+
if ('remote' in entry.source) {
|
|
90
|
+
// A remote MCP server: nothing to download, the marker only says it is set up.
|
|
91
|
+
if (!exists(path.join(dest, MARKER)))
|
|
92
|
+
fs.writeFileSync(path.join(mkdirp(dest), MARKER), JSON.stringify({ id: entry.id, at: new Date().toISOString() }));
|
|
93
|
+
this.installed.push(entry.name);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
56
96
|
if (!exists(path.join(dest, MARKER)) || this.options.refresh)
|
|
57
97
|
await this.download(entry, dest);
|
|
58
|
-
|
|
98
|
+
// A Chromium installer that could not be unpacked is kept and installed into the sandbox each boot instead.
|
|
99
|
+
const exe = findExe(dest, entry.exe) ??
|
|
100
|
+
(entry.unpack === 'chromium' && entry.signer ? await installFromKept(dest, entry.signer, entry.name) : null);
|
|
59
101
|
if (!exe)
|
|
60
102
|
throw new Error(entry.exe + ' not found in the download');
|
|
61
103
|
await afterInstall(entry, exe);
|
|
@@ -63,7 +105,7 @@ export class AppInstaller {
|
|
|
63
105
|
if (!entry.service && (entry.cli || entry.id === 'sysinternals'))
|
|
64
106
|
this.env.prepend.push(path.dirname(exe));
|
|
65
107
|
if (!entry.cli && !entry.service)
|
|
66
|
-
this.gui.push({ name: entry.name, exe });
|
|
108
|
+
this.gui.push({ name: entry.name, exe, ...this.launchArgs(entry) });
|
|
67
109
|
this.installed.push(entry.name);
|
|
68
110
|
}
|
|
69
111
|
catch (e) {
|
|
@@ -71,6 +113,12 @@ export class AppInstaller {
|
|
|
71
113
|
this.env.summary.push(entry.name + ': FAILED');
|
|
72
114
|
}
|
|
73
115
|
}
|
|
116
|
+
/** The command line an app's shortcut starts it with (Comet: its own profile, DevTools on 127.0.0.1). */
|
|
117
|
+
launchArgs(entry) {
|
|
118
|
+
if (entry.id !== 'comet')
|
|
119
|
+
return {};
|
|
120
|
+
return { args: cometShortcutArgs((this.options.chosen ?? []).includes('comet-mcp') ? COMET_MCP_PORT : 0) };
|
|
121
|
+
}
|
|
74
122
|
/** Downloads and unpacks one entry into its folder (replaced in one step: never half there). */
|
|
75
123
|
async download(entry, dest) {
|
|
76
124
|
const work = stagingFolder(dest);
|
|
@@ -98,7 +146,15 @@ export class AppInstaller {
|
|
|
98
146
|
const d = await resolve(entry);
|
|
99
147
|
log('Downloading ' + entry.name + ' (' + d.fileName + ', ~' + entry.size + ' once) ...');
|
|
100
148
|
const file = path.join(mkdirp(work), d.fileName.replace(/[\\/:*?"<>|]/g, '_'));
|
|
101
|
-
|
|
149
|
+
const ahead = prefetchedFile(entry, d.fileName);
|
|
150
|
+
if (exists(ahead))
|
|
151
|
+
fs.copyFileSync(ahead, file);
|
|
152
|
+
else
|
|
153
|
+
await downloader.file(d.url, file, {
|
|
154
|
+
sha256: d.sha256 ?? null,
|
|
155
|
+
...(entry.signer ? { verify: signatureCheck(entry.signer, d.fileName) } : {}),
|
|
156
|
+
});
|
|
157
|
+
fs.rmSync(ahead, { force: true });
|
|
102
158
|
await unpack(entry, file, out, d);
|
|
103
159
|
}
|
|
104
160
|
fs.writeFileSync(path.join(out, MARKER), JSON.stringify({ id: entry.id, at: new Date().toISOString() }));
|
|
@@ -158,5 +214,12 @@ export async function setupApps(env, apps, o) {
|
|
|
158
214
|
log('(dry run) would install apps: ' + entries.map((e) => e.name).join(', '));
|
|
159
215
|
return;
|
|
160
216
|
}
|
|
161
|
-
await new AppInstaller(env, o).installAll(entries);
|
|
217
|
+
await new AppInstaller(env, { ...o, chosen: apps.install }).installAll(entries);
|
|
218
|
+
}
|
|
219
|
+
/** Downloads the apps ahead of their install (the Apps step waits for Mesa, uv and the runtime first). */
|
|
220
|
+
export async function prefetchApps(apps, o) {
|
|
221
|
+
const { entries } = appsToInstall(apps, o.gitAccess);
|
|
222
|
+
if (dryRun)
|
|
223
|
+
return;
|
|
224
|
+
await new AppInstaller(emptyEnv(), { ...o, chosen: apps.install }).prefetch(entries);
|
|
162
225
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AppSigner } from '../../shared/signer.js';
|
|
2
|
+
/** Where the installer is kept when it could not be unpacked (below the app's folder). */
|
|
3
|
+
export declare const KEPT_INSTALLER_DIR = "installer";
|
|
4
|
+
/** The browser's own folder (Chrome-bin, holding `exe`) among what one stage unpacked, or null. */
|
|
5
|
+
export declare function chromiumBin(root: string, exe: string): string | null;
|
|
6
|
+
/** The next archive to open among what one stage unpacked (the latest stage wins), or null. */
|
|
7
|
+
export declare function nextInner(root: string): string | null;
|
|
8
|
+
/**
|
|
9
|
+
* Unpacks a Chromium installer into `out` with 7-Zip ("portable"); when no stage holds the browser, keeps the
|
|
10
|
+
* installer in out\installer instead ("installer").
|
|
11
|
+
*/
|
|
12
|
+
export declare function unpackChromium(sevenZip: string, file: string, out: string, work: string, exe: string): Promise<'portable' | 'installer'>;
|
|
13
|
+
/** The installer kept in an app's folder, or null when it was unpacked. */
|
|
14
|
+
export declare function keptInstaller(dest: string): string | null;
|
|
15
|
+
/**
|
|
16
|
+
* Comet from its kept installer: installed into this sandbox (--install --silent) once per boot, only while the
|
|
17
|
+
* installer is still signed by `signer` (else it is deleted, and downloaded again next boot). Null when there is no
|
|
18
|
+
* kept installer.
|
|
19
|
+
*/
|
|
20
|
+
export declare function installFromKept(dest: string, signer: AppSigner, what: string): Promise<string | null>;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
// A Chromium browser's Windows installer (Comet's) opened with 7-Zip instead of run: installer exe -> UPDATER.PACKED.7Z
|
|
2
|
+
// -> mini_installer.exe -> CHROME.PACKED.7Z -> chrome.7z -> Chrome-bin, whose contents run portable from
|
|
3
|
+
// tools\apps\<id> (nothing registered, no updater, no per-boot reinstall). When the layout is not that (a new
|
|
4
|
+
// installer), the signed installer is kept instead and run with --install --silent at every boot, after its signer is
|
|
5
|
+
// checked again (the data folder is shared with the sandbox, so the file is never trusted from last time).
|
|
6
|
+
import fs from 'node:fs';
|
|
7
|
+
import path from 'node:path';
|
|
8
|
+
import { installedCometExe } from '../browser/comet.js';
|
|
9
|
+
import { execAsync } from '../runtime/process.js';
|
|
10
|
+
import { heavy } from '../../shared/concurrency/index.js';
|
|
11
|
+
import { mkdirp } from '../runtime/fs.js';
|
|
12
|
+
import { signedBy } from '../toolchains/signature.js';
|
|
13
|
+
/** The archives inside, last stage first: the first one found is opened next. */
|
|
14
|
+
const INNER = [
|
|
15
|
+
/^chrome\.7z$/i,
|
|
16
|
+
/^chrome\.packed\.7z$/i,
|
|
17
|
+
/^mini_installer\.exe$/i,
|
|
18
|
+
/^updater\.packed\.7z$/i,
|
|
19
|
+
];
|
|
20
|
+
const MAX_LEVELS = 6;
|
|
21
|
+
const MAX_DEPTH = 4;
|
|
22
|
+
const MAX_ENTRIES = 20000;
|
|
23
|
+
/** Where the installer is kept when it could not be unpacked (below the app's folder). */
|
|
24
|
+
export const KEPT_INSTALLER_DIR = 'installer';
|
|
25
|
+
/** Every file and folder below `root`, breadth first and bounded (no links followed). */
|
|
26
|
+
function walk(root) {
|
|
27
|
+
const dirs = [];
|
|
28
|
+
const files = [];
|
|
29
|
+
let queue = [root];
|
|
30
|
+
for (let depth = 0; depth < MAX_DEPTH && queue.length && dirs.length + files.length < MAX_ENTRIES; depth++) {
|
|
31
|
+
const next = [];
|
|
32
|
+
for (const dir of queue) {
|
|
33
|
+
let entries = [];
|
|
34
|
+
try {
|
|
35
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
continue; // Unreadable: skipped.
|
|
39
|
+
}
|
|
40
|
+
for (const e of entries) {
|
|
41
|
+
const full = path.join(dir, e.name);
|
|
42
|
+
if (e.isDirectory() && !e.isSymbolicLink()) {
|
|
43
|
+
dirs.push(full);
|
|
44
|
+
next.push(full);
|
|
45
|
+
}
|
|
46
|
+
else if (e.isFile())
|
|
47
|
+
files.push(full);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
queue = next;
|
|
51
|
+
}
|
|
52
|
+
return { dirs, files };
|
|
53
|
+
}
|
|
54
|
+
/** The browser's own folder (Chrome-bin, holding `exe`) among what one stage unpacked, or null. */
|
|
55
|
+
export function chromiumBin(root, exe) {
|
|
56
|
+
return (walk(root).dirs.find((d) => path.basename(d).toLowerCase() === 'chrome-bin' && fs.existsSync(path.join(d, exe))) ??
|
|
57
|
+
null);
|
|
58
|
+
}
|
|
59
|
+
/** The next archive to open among what one stage unpacked (the latest stage wins), or null. */
|
|
60
|
+
export function nextInner(root) {
|
|
61
|
+
const { files } = walk(root);
|
|
62
|
+
for (const pattern of INNER) {
|
|
63
|
+
const hit = files.find((f) => pattern.test(path.basename(f)));
|
|
64
|
+
if (hit)
|
|
65
|
+
return hit;
|
|
66
|
+
}
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Unpacks a Chromium installer into `out` with 7-Zip ("portable"); when no stage holds the browser, keeps the
|
|
71
|
+
* installer in out\installer instead ("installer").
|
|
72
|
+
*/
|
|
73
|
+
export async function unpackChromium(sevenZip, file, out, work, exe) {
|
|
74
|
+
let current = file;
|
|
75
|
+
for (let level = 0; level < MAX_LEVELS; level++) {
|
|
76
|
+
const dir = path.join(work, 'stage' + level);
|
|
77
|
+
try {
|
|
78
|
+
await heavy.run(() => execAsync(sevenZip, ['x', '-y', '-o' + dir, current], { stdio: 'ignore' }));
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
break; // Not an archive 7-Zip opens: keep the installer.
|
|
82
|
+
}
|
|
83
|
+
const bin = chromiumBin(dir, exe);
|
|
84
|
+
if (bin) {
|
|
85
|
+
fs.renameSync(bin, out);
|
|
86
|
+
return 'portable';
|
|
87
|
+
}
|
|
88
|
+
const inner = nextInner(dir);
|
|
89
|
+
if (!inner)
|
|
90
|
+
break;
|
|
91
|
+
current = inner;
|
|
92
|
+
}
|
|
93
|
+
const kept = path.join(mkdirp(path.join(out, KEPT_INSTALLER_DIR)), path.basename(file));
|
|
94
|
+
fs.copyFileSync(file, kept);
|
|
95
|
+
return 'installer';
|
|
96
|
+
}
|
|
97
|
+
/** The installer kept in an app's folder, or null when it was unpacked. */
|
|
98
|
+
export function keptInstaller(dest) {
|
|
99
|
+
const dir = path.join(dest, KEPT_INSTALLER_DIR);
|
|
100
|
+
try {
|
|
101
|
+
const exe = fs.readdirSync(dir).find((n) => /\.exe$/i.test(n));
|
|
102
|
+
return exe ? path.join(dir, exe) : null;
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Comet from its kept installer: installed into this sandbox (--install --silent) once per boot, only while the
|
|
110
|
+
* installer is still signed by `signer` (else it is deleted, and downloaded again next boot). Null when there is no
|
|
111
|
+
* kept installer.
|
|
112
|
+
*/
|
|
113
|
+
export async function installFromKept(dest, signer, what) {
|
|
114
|
+
const installer = keptInstaller(dest);
|
|
115
|
+
if (!installer)
|
|
116
|
+
return null;
|
|
117
|
+
const installed = installedCometExe();
|
|
118
|
+
if (fs.existsSync(installed))
|
|
119
|
+
return installed;
|
|
120
|
+
if (!signedBy(installer, signer)) {
|
|
121
|
+
fs.rmSync(path.join(dest, '.agent-sandbox-app'), { force: true });
|
|
122
|
+
fs.rmSync(installer, { force: true });
|
|
123
|
+
throw new Error(what + "'s installer is not signed by its vendor; deleted it (it is downloaded again next boot)");
|
|
124
|
+
}
|
|
125
|
+
await execAsync(installer, ['--install', '--silent', '--do-not-launch-chrome'], { stdio: 'ignore' });
|
|
126
|
+
return fs.existsSync(installed) ? installed : null;
|
|
127
|
+
}
|
package/dist/guest/apps/index.js
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
// Installers are never run: archives are unpacked, NSIS installers opened with 7-Zip and MSIs extracted (msiexec /a),
|
|
3
3
|
// so nothing is registered and nothing is lost when the sandbox closes.
|
|
4
4
|
export { appsNeedMesa, appsNeedUv } from '../../shared/apps/index.js';
|
|
5
|
-
export { setupApps } from './app-installer.js';
|
|
5
|
+
export { prefetchApps, setupApps } from './app-installer.js';
|
|
6
6
|
export { findExe } from './find-exe.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Where the latest version of the agents' web apps (catalogue-agents-web.ts) is, when it is not a pinned package or a
|
|
2
|
+
// remote server: Comet's installer, from Perplexity's own download address (a redirect to the current release).
|
|
3
|
+
// Perplexity publishes no checksum: the download is kept only when Perplexity AI, Inc. signed it (AppEntry.signer).
|
|
4
|
+
import { COMET_DOWNLOAD_URL } from '../../shared/apps/index.js';
|
|
5
|
+
export const AGENTS_WEB_RESOLVERS = {
|
|
6
|
+
comet: () => Promise.resolve({ url: COMET_DOWNLOAD_URL, fileName: 'comet_installer.exe' }),
|
|
7
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Where the latest version of an app is, for apps that are not a plain GitHub release: each looks it up on the
|
|
2
2
|
// vendor's own site (and its published checksum, where there is one). Named by AppSource.resolve in shared/apps.ts.
|
|
3
3
|
import { fetchJson, fetchText, githubAsset, latestGithubTag } from '../../shared/download/index.js';
|
|
4
|
+
import { AGENTS_WEB_RESOLVERS } from './resolvers-agents-web.js';
|
|
4
5
|
import { GAMEDEV_RESOLVERS } from './resolvers-gamedev.js';
|
|
5
6
|
import { MOBILE_RESOLVERS } from './resolvers-mobile.js';
|
|
6
7
|
/** The SHA-256 on the line of a SHA256SUMS-style file that names `file`. */
|
|
@@ -14,6 +15,7 @@ const stripV = (tag) => tag.replace(/^v/, '');
|
|
|
14
15
|
export const RESOLVERS = {
|
|
15
16
|
...GAMEDEV_RESOLVERS,
|
|
16
17
|
...MOBILE_RESOLVERS,
|
|
18
|
+
...AGENTS_WEB_RESOLVERS,
|
|
17
19
|
sublime: async () => {
|
|
18
20
|
// Sublime publishes no checksums; the download is HTTPS from sublimetext.com.
|
|
19
21
|
const { latest_version: build } = await fetchJson('https://www.sublimetext.com/updates/4/stable_update_check');
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export interface Shortcut {
|
|
2
2
|
readonly name: string;
|
|
3
3
|
readonly exe: string;
|
|
4
|
+
/** The program's command line (Comet's profile and DevTools port). */
|
|
5
|
+
readonly args?: string;
|
|
4
6
|
}
|
|
5
7
|
/** Desktop and Start menu shortcuts, all in one PowerShell call (sandbox\scripts\new-shortcuts.ps1). */
|
|
6
8
|
export declare function shortcuts(apps: readonly Shortcut[]): void;
|
|
@@ -13,6 +13,7 @@ export function shortcuts(apps) {
|
|
|
13
13
|
link: path.join(folder, name + '.lnk'),
|
|
14
14
|
target: app.exe,
|
|
15
15
|
workingDirectory: path.dirname(app.exe),
|
|
16
|
+
...(app.args ? { arguments: app.args } : {}),
|
|
16
17
|
}));
|
|
17
18
|
});
|
|
18
19
|
runScriptWithJson('new-shortcuts.ps1', 'ListFile', links);
|
|
@@ -3,8 +3,11 @@ import path from 'node:path';
|
|
|
3
3
|
import { downloader, extractArchive, githubAsset } from '../../shared/download/index.js';
|
|
4
4
|
import { SYSTEM } from '../../shared/system.js';
|
|
5
5
|
import { execAsync } from '../runtime/process.js';
|
|
6
|
+
import { heavy } from '../../shared/concurrency/index.js';
|
|
7
|
+
import { runInstallerChecked } from '../runtime/pools.js';
|
|
6
8
|
import { exists, mkdirp } from '../runtime/fs.js';
|
|
7
9
|
import { tool } from '../toolchains/tool-env.js';
|
|
10
|
+
import { unpackChromium } from './comet-unpack.js';
|
|
8
11
|
import { findExe } from './find-exe.js';
|
|
9
12
|
const sevenZip = () => tool('apps', '7zip', '7z.exe');
|
|
10
13
|
export async function unpack(entry, file, out, d) {
|
|
@@ -13,7 +16,7 @@ export async function unpack(entry, file, out, d) {
|
|
|
13
16
|
const sevenZr = path.join(path.dirname(file), '7zr.exe');
|
|
14
17
|
const zr = await githubAsset('ip7z/7zip', /^7zr\.exe$/);
|
|
15
18
|
await downloader.file(zr.url, sevenZr, zr.sha256);
|
|
16
|
-
await execAsync(sevenZr, ['x', '-y', '-o' + out, file], { stdio: 'ignore' });
|
|
19
|
+
await heavy.run(() => execAsync(sevenZr, ['x', '-y', '-o' + out, file], { stdio: 'ignore' }));
|
|
17
20
|
return;
|
|
18
21
|
}
|
|
19
22
|
switch (entry.unpack ?? 'archive') {
|
|
@@ -26,19 +29,26 @@ export async function unpack(entry, file, out, d) {
|
|
|
26
29
|
if (!exists(sevenZip()))
|
|
27
30
|
throw new Error('7-Zip is needed to unpack ' + entry.name + ' and could not be installed');
|
|
28
31
|
const raw = path.join(path.dirname(out), 'raw');
|
|
29
|
-
await execAsync(sevenZip(), ['x', '-y', '-o' + raw, file], { stdio: 'ignore' });
|
|
32
|
+
await heavy.run(() => execAsync(sevenZip(), ['x', '-y', '-o' + raw, file], { stdio: 'ignore' }));
|
|
30
33
|
// electron-builder installers carry the app as one more archive inside.
|
|
31
34
|
const inner = findExe(raw, '/^app-64\\.7z$/');
|
|
32
35
|
if (inner)
|
|
33
|
-
await execAsync(sevenZip(), ['x', '-y', '-o' + out, inner], { stdio: 'ignore' });
|
|
36
|
+
await heavy.run(() => execAsync(sevenZip(), ['x', '-y', '-o' + out, inner], { stdio: 'ignore' }));
|
|
34
37
|
else
|
|
35
38
|
fs.renameSync(raw, out);
|
|
36
39
|
return;
|
|
37
40
|
}
|
|
41
|
+
case 'chromium': {
|
|
42
|
+
// A Chromium browser's installer (Comet), opened stage by stage; kept as an installer when that fails.
|
|
43
|
+
if (!exists(sevenZip()))
|
|
44
|
+
throw new Error('7-Zip is needed to unpack ' + entry.name + ' and could not be installed');
|
|
45
|
+
await unpackChromium(sevenZip(), file, out, path.join(path.dirname(out), 'chromium'), entry.exe);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
38
48
|
case 'msi': {
|
|
39
49
|
// An administrative install only extracts the files: nothing is registered with Windows.
|
|
40
50
|
mkdirp(out);
|
|
41
|
-
await
|
|
51
|
+
await runInstallerChecked(SYSTEM.msiexec(), ['/a', file, '/qn', 'TARGETDIR=' + out]);
|
|
42
52
|
return;
|
|
43
53
|
}
|
|
44
54
|
default:
|
|
@@ -1,27 +1,56 @@
|
|
|
1
|
-
/** One boot of the sandbox
|
|
1
|
+
/** One boot of the sandbox: a graph of tasks (graph.ts) run by the BootRunner, each task a method below. */
|
|
2
2
|
export declare class Boot {
|
|
3
3
|
private ptyHost;
|
|
4
4
|
private lan;
|
|
5
|
+
private tools;
|
|
6
|
+
private dbBin;
|
|
7
|
+
private allowSummary;
|
|
8
|
+
private vscodeSummary;
|
|
9
|
+
private env;
|
|
10
|
+
private toolVars;
|
|
11
|
+
private summary;
|
|
12
|
+
private headroom;
|
|
5
13
|
private readonly gitAccess;
|
|
6
|
-
/** What the host handed over in its one-shot file (read and deleted
|
|
14
|
+
/** What the host handed over in its one-shot file (read and deleted in the prelude; never changed afterwards). */
|
|
7
15
|
private secrets;
|
|
16
|
+
private basePath;
|
|
17
|
+
private readonly startedAt;
|
|
18
|
+
private openGate;
|
|
19
|
+
private readonly gate;
|
|
20
|
+
/** The boot is ready: the runner no longer writes the status (the session owns it). */
|
|
21
|
+
private ready;
|
|
22
|
+
private lastStatus;
|
|
23
|
+
private activeSteps;
|
|
24
|
+
private stepsDone;
|
|
25
|
+
private stepsTotal;
|
|
8
26
|
run(): Promise<void>;
|
|
27
|
+
private stageTitle;
|
|
28
|
+
/** The names shown for work that goes on after the boot is ready. */
|
|
29
|
+
private backgroundNames;
|
|
9
30
|
/**
|
|
10
|
-
* Your saved service sign-ins (accounts.<kind>.share) go to their tools before
|
|
11
|
-
* at once; what they give the agent (EXPO_TOKEN ...) joins its environment
|
|
31
|
+
* The host's one-shot file, read once. Your saved service sign-ins (accounts.<kind>.share) go to their tools before
|
|
32
|
+
* anything opens them, and leave memory at once; what they give the agent (EXPO_TOKEN ...) joins its environment
|
|
33
|
+
* (in memory only).
|
|
12
34
|
*/
|
|
13
|
-
private
|
|
14
|
-
|
|
15
|
-
private
|
|
16
|
-
/**
|
|
17
|
-
private
|
|
18
|
-
/**
|
|
19
|
-
private
|
|
20
|
-
|
|
21
|
-
private
|
|
22
|
-
private
|
|
23
|
-
|
|
24
|
-
|
|
35
|
+
private takeSecretsAndAccounts;
|
|
36
|
+
/** The host's progress line: the runner's stage, the tasks that run now, and what the toolchain scheduler runs. */
|
|
37
|
+
private publish;
|
|
38
|
+
/** Every task of the graph. */
|
|
39
|
+
private tasks;
|
|
40
|
+
/** The agent environment before the toolchains are known (the proxy needs no PATH of theirs). */
|
|
41
|
+
private headroomAgentEnv;
|
|
42
|
+
/** Foreground toolchain steps and databases and apps; Visual Studio and what needs it wait for the background. */
|
|
43
|
+
private toolchains;
|
|
44
|
+
private vscode;
|
|
45
|
+
/** The agent environment, saved machine-wide, and the PATH of new shells. */
|
|
46
|
+
private environment;
|
|
47
|
+
/** What the tools left: lines for the guide and status, and what later projects start from. */
|
|
48
|
+
private bootEnv;
|
|
49
|
+
/** The toolchains' lines, then the missing protections, allowOnly and VS Code (in this order). */
|
|
50
|
+
private summaryLines;
|
|
51
|
+
/** Visual Studio and what depends on it (after the session has started): merged into the environment again. */
|
|
52
|
+
private toolchainsLater;
|
|
53
|
+
/** Ready: starts the session daemon and, with an agent, its first session (shown in this window by run()). */
|
|
25
54
|
private start;
|
|
26
55
|
}
|
|
27
56
|
export declare function runBoot(): Promise<void>;
|