windows-development-sandbox 1.7.0 → 1.10.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 +12 -1
- package/dist/app/context.d.ts +8 -0
- package/dist/app/context.js +12 -0
- package/dist/app/features/defs.d.ts +322 -0
- package/dist/app/features/defs.js +28 -0
- package/dist/app/features/sandbox/index.d.ts +2 -0
- package/dist/app/features/sandbox/index.js +3 -0
- package/dist/app/features/sandbox/sandbox.def.d.ts +193 -0
- package/dist/app/features/sandbox/sandbox.def.js +245 -0
- package/dist/app/features/sandbox/sandbox.run.d.ts +72 -0
- package/dist/app/features/sandbox/sandbox.run.js +98 -0
- package/dist/app/features/sessions/index.d.ts +2 -0
- package/dist/app/features/sessions/index.js +3 -0
- package/dist/app/features/sessions/sessions.def.d.ts +141 -0
- package/dist/app/features/sessions/sessions.def.js +176 -0
- package/dist/app/features/sessions/sessions.run.d.ts +39 -0
- package/dist/app/features/sessions/sessions.run.js +58 -0
- package/dist/{cli/menu/settings/categories.d.ts → app/features/settings/categories.def.d.ts} +2 -0
- package/dist/{cli/menu/settings/categories.js → app/features/settings/categories.def.js} +24 -5
- package/dist/app/features/settings/index.d.ts +5 -0
- package/dist/app/features/settings/index.js +6 -0
- package/dist/{cli/menu/settings/config-file.d.ts → app/features/settings/settings-file.d.ts} +1 -1
- package/dist/{cli/menu/settings/config-file.js → app/features/settings/settings-file.js} +1 -1
- package/dist/app/features/settings/settings-rows.d.ts +35 -0
- package/dist/app/features/settings/settings-rows.js +94 -0
- package/dist/app/features/settings/settings.def.d.ts +157 -0
- package/dist/app/features/settings/settings.def.js +179 -0
- package/dist/app/features/settings/settings.run.d.ts +67 -0
- package/dist/app/features/settings/settings.run.js +84 -0
- package/dist/app/kernel/define.d.ts +143 -0
- package/dist/app/kernel/define.js +42 -0
- package/dist/app/kernel/errors.d.ts +34 -0
- package/dist/app/kernel/errors.js +45 -0
- package/dist/app/kernel/fields.d.ts +70 -0
- package/dist/app/kernel/fields.js +243 -0
- package/dist/app/kernel/index.d.ts +8 -0
- package/dist/app/kernel/index.js +10 -0
- package/dist/app/kernel/io.d.ts +193 -0
- package/dist/app/kernel/io.js +126 -0
- package/dist/app/kernel/rpc.d.ts +156 -0
- package/dist/app/kernel/rpc.js +47 -0
- package/dist/app/kernel/text.d.ts +6 -0
- package/dist/app/kernel/text.js +57 -0
- package/dist/app/kernel/view.d.ts +146 -0
- package/dist/app/kernel/view.js +28 -0
- package/dist/app/registry.d.ts +10 -0
- package/dist/app/registry.js +50 -0
- package/dist/cli/args.d.ts +5 -0
- package/dist/cli/args.js +6 -0
- package/dist/cli/commands/engine.d.ts +2 -0
- package/dist/cli/commands/engine.js +60 -0
- package/dist/cli/commands/index.d.ts +1 -1
- package/dist/cli/commands/index.js +1 -1
- package/dist/cli/commands/launch/launch.js +49 -7
- package/dist/cli/commands/launch/prepare.js +3 -3
- package/dist/cli/commands/launch/running.js +2 -1
- package/dist/cli/commands/launch/summary.d.ts +2 -0
- package/dist/cli/commands/maintenance/config-share.d.ts +12 -0
- package/dist/cli/commands/maintenance/config-share.js +80 -0
- package/dist/cli/commands/maintenance/config.js +8 -82
- package/dist/cli/commands/maintenance/logs.js +14 -0
- package/dist/cli/commands/registry.js +3 -7
- package/dist/cli/commands/repair/checks/contained.d.ts +2 -0
- package/dist/cli/commands/repair/checks/contained.js +139 -0
- package/dist/cli/commands/repair/checks/hcs.d.ts +7 -0
- package/dist/cli/commands/repair/checks/hcs.js +28 -0
- package/dist/cli/commands/repair/checks/index.js +4 -0
- package/dist/cli/commands/repair/checks/pc.js +32 -1
- package/dist/cli/commands/repair/checks/sandbox.js +16 -1
- package/dist/cli/commands/repair/checks/vpn.js +34 -9
- package/dist/cli/commands/repair/env.js +2 -1
- package/dist/cli/commands/sessions/index.d.ts +0 -4
- package/dist/cli/commands/sessions/index.js +3 -7
- package/dist/cli/commands/shared-use.d.ts +5 -2
- package/dist/cli/commands/shared-use.js +11 -8
- package/dist/cli/commands/storage/contained.d.ts +3 -0
- package/dist/cli/commands/storage/contained.js +179 -0
- package/dist/cli/commands/storage/offer.js +7 -1
- package/dist/cli/commands/storage/storage.js +10 -2
- package/dist/cli/commands/user-config.js +1 -1
- package/dist/cli/commands/vpn.js +20 -3
- package/dist/cli/commands/web.d.ts +5 -0
- package/dist/cli/commands/web.js +40 -0
- package/dist/cli/index.js +2 -1
- package/dist/cli/manifest.d.ts +72 -104
- package/dist/cli/manifest.js +64 -39
- package/dist/cli/menu/add-agent.d.ts +1 -1
- package/dist/cli/menu/add-agent.js +1 -1
- package/dist/cli/menu/apps.d.ts +7 -1
- package/dist/cli/menu/apps.js +36 -0
- package/dist/cli/menu/command-fields.d.ts +1 -1
- package/dist/cli/menu/command-form.js +2 -2
- package/dist/cli/menu/io-menu.d.ts +29 -0
- package/dist/cli/menu/io-menu.js +126 -0
- package/dist/cli/menu/live.d.ts +27 -0
- package/dist/cli/menu/live.js +69 -0
- package/dist/cli/menu/memory.d.ts +19 -0
- package/dist/cli/menu/memory.js +53 -0
- package/dist/cli/menu/menu.d.ts +10 -1
- package/dist/cli/menu/menu.js +27 -9
- package/dist/cli/menu/pages/agents-page.d.ts +3 -1
- package/dist/cli/menu/pages/agents-page.js +12 -5
- package/dist/cli/menu/pages/apps-page.d.ts +3 -1
- package/dist/cli/menu/pages/apps-page.js +19 -2
- package/dist/cli/menu/pages/list-page.d.ts +27 -0
- package/dist/cli/menu/pages/list-page.js +109 -7
- package/dist/cli/menu/pages/maintenance-page.d.ts +0 -5
- package/dist/cli/menu/pages/maintenance-page.js +17 -19
- package/dist/cli/menu/pages/sandbox-page.d.ts +4 -6
- package/dist/cli/menu/pages/sandbox-page.js +26 -118
- package/dist/cli/menu/pages/scopes.d.ts +1 -1
- package/dist/cli/menu/pages/sessions-page.d.ts +5 -11
- package/dist/cli/menu/pages/sessions-page.js +19 -88
- package/dist/cli/menu/pages/settings-page.d.ts +2 -10
- package/dist/cli/menu/pages/settings-page.js +64 -94
- package/dist/cli/menu/render-view.d.ts +28 -0
- package/dist/cli/menu/render-view.js +112 -0
- package/dist/cli/menu/settings/{path-kind.d.ts → ask-path.d.ts} +1 -7
- package/dist/cli/menu/settings/ask-path.js +14 -0
- package/dist/cli/menu/settings/collections/collection-editor.d.ts +1 -1
- package/dist/cli/menu/settings/collections/string-list-editor.d.ts +1 -2
- package/dist/cli/menu/settings/collections/string-list-editor.js +1 -1
- package/dist/cli/menu/settings/draft.d.ts +1 -1
- package/dist/cli/menu/settings/format.d.ts +1 -3
- package/dist/cli/menu/settings/format.js +6 -36
- package/dist/cli/menu/settings/index.d.ts +1 -3
- package/dist/cli/menu/settings/index.js +3 -3
- package/dist/cli/menu/settings/object-editor.d.ts +1 -1
- package/dist/cli/menu/settings/share.d.ts +36 -0
- package/dist/cli/menu/settings/share.js +131 -0
- package/dist/cli/menu/settings/value-editor.d.ts +5 -1
- package/dist/cli/menu/settings/value-editor.js +57 -54
- package/dist/cli/menu/several.js +1 -1
- package/dist/cli/menu/share-settings.d.ts +21 -0
- package/dist/cli/menu/share-settings.js +112 -0
- package/dist/cli/menu/shell.d.ts +21 -5
- package/dist/cli/menu/shell.js +31 -6
- package/dist/cli/menu/views.d.ts +7 -0
- package/dist/cli/menu/views.js +11 -0
- package/dist/cli/menu/vpn-login.js +8 -0
- package/dist/cli/operations/handler.d.ts +6 -0
- package/dist/cli/operations/handler.js +61 -0
- package/dist/cli/operations/index.d.ts +4 -0
- package/dist/cli/operations/index.js +5 -0
- package/dist/cli/operations/input.d.ts +6 -0
- package/dist/cli/operations/input.js +37 -0
- package/dist/cli/operations/io-cli.d.ts +7 -0
- package/dist/cli/operations/io-cli.js +62 -0
- package/dist/cli/operations/spec.d.ts +18 -0
- package/dist/cli/operations/spec.js +108 -0
- package/dist/cli/output/colors.d.ts +2 -2
- package/dist/cli/output/colors.js +2 -11
- package/dist/cli/output/index.d.ts +1 -0
- package/dist/cli/output/index.js +1 -0
- package/dist/cli/output/print.d.ts +3 -1
- package/dist/cli/output/print.js +7 -3
- package/dist/cli/output/progress.d.ts +15 -0
- package/dist/cli/output/progress.js +44 -0
- package/dist/cli/output/render-view.d.ts +4 -0
- package/dist/cli/output/render-view.js +63 -0
- package/dist/cli/services/agent-commands-service.d.ts +2 -0
- package/dist/cli/services/agent-commands-service.js +11 -2
- package/dist/cli/services/logs-service.js +4 -3
- package/dist/cli/tui/app.d.ts +6 -1
- package/dist/cli/tui/app.js +26 -4
- package/dist/cli/tui/list/list-screen.d.ts +14 -0
- package/dist/cli/tui/list/list-screen.js +64 -36
- package/dist/cli/tui/list/list-types.d.ts +2 -0
- package/dist/cli/tui/terminal.d.ts +7 -0
- package/dist/cli/tui/terminal.js +30 -10
- package/dist/core/config/defaults.js +9 -1
- package/dist/core/schema/config.d.ts +14 -0
- package/dist/core/schema/config.js +16 -1
- package/dist/core/schema/harness.d.ts +1 -0
- package/dist/core/schema/harness.js +5 -0
- package/dist/core/schema/sandbox.d.ts +6 -0
- package/dist/core/schema/sandbox.js +20 -3
- package/dist/core/schema/vpn.d.ts +2 -1
- package/dist/core/schema/vpn.js +4 -4
- package/dist/core/schema/web.d.ts +1 -0
- package/dist/core/schema/web.js +4 -1
- package/dist/core/types.d.ts +23 -5
- package/dist/core/util/fs.d.ts +2 -0
- package/dist/core/util/fs.js +9 -0
- package/dist/core/util/index.d.ts +1 -1
- package/dist/core/util/index.js +1 -1
- package/dist/guest/agents/agent-files.d.ts +5 -0
- package/dist/guest/agents/agent-files.js +4 -0
- package/dist/guest/agents/local-state.d.ts +2 -0
- package/dist/guest/agents/local-state.js +21 -1
- package/dist/guest/boot/boot.js +5 -2
- package/dist/guest/daemon/daemon.js +4 -0
- package/dist/guest/daemon/sessions.d.ts +5 -0
- package/dist/guest/daemon/sessions.js +17 -3
- package/dist/guest/entries/daemon.js +3 -0
- package/dist/guest/governor/decide.d.ts +71 -0
- package/dist/guest/governor/decide.js +211 -0
- package/dist/guest/governor/governor.d.ts +45 -0
- package/dist/guest/governor/governor.js +230 -0
- package/dist/guest/governor/index.d.ts +2 -0
- package/dist/guest/governor/index.js +2 -0
- package/dist/guest/network/firewall.d.ts +1 -0
- package/dist/guest/network/firewall.js +65 -23
- package/dist/guest/runtime/csc.d.ts +1 -0
- package/dist/guest/runtime/csc.js +1 -0
- package/dist/guest/runtime/process.js +53 -5
- package/dist/guest/sessions/viewer.js +3 -1
- package/dist/guest/setup/claude-mem.js +12 -4
- package/dist/guest/toolchains/languages/node.js +29 -3
- package/dist/guest/toolchains/native/rust-extras.js +4 -2
- package/dist/guest/vpn/vpn.js +69 -21
- package/dist/guest/vpn/wireguard.d.ts +32 -0
- package/dist/guest/vpn/wireguard.js +132 -0
- package/dist/host/agent-commands/commands.d.ts +4 -0
- package/dist/host/agent-commands/commands.js +31 -7
- package/dist/host/audit/log.d.ts +1 -1
- package/dist/host/channel/attach.d.ts +3 -1
- package/dist/host/channel/attach.js +5 -2
- package/dist/host/channel/channel.d.ts +2 -0
- package/dist/host/channel/channel.js +4 -0
- package/dist/host/engines/engine.d.ts +12 -0
- package/dist/host/engines/engine.js +1 -0
- package/dist/host/engines/hcs/check.d.ts +25 -0
- package/dist/host/engines/hcs/check.js +95 -0
- package/dist/host/engines/hcs/documents.d.ts +44 -0
- package/dist/host/engines/hcs/documents.js +155 -0
- package/dist/host/engines/hcs/engine.d.ts +39 -0
- package/dist/host/engines/hcs/engine.js +171 -0
- package/dist/host/engines/hcs/helper.d.ts +43 -0
- package/dist/host/engines/hcs/helper.js +173 -0
- package/dist/host/engines/hcs/images.d.ts +37 -0
- package/dist/host/engines/hcs/images.js +152 -0
- package/dist/host/engines/index.d.ts +7 -0
- package/dist/host/engines/index.js +5 -0
- package/dist/host/engines/registry.d.ts +16 -0
- package/dist/host/engines/registry.js +30 -0
- package/dist/host/engines/types.d.ts +58 -0
- package/dist/host/engines/types.js +1 -0
- package/dist/host/engines/windows-sandbox/engine.d.ts +16 -0
- package/dist/host/engines/windows-sandbox/engine.js +63 -0
- package/dist/host/engines/windows-sandbox/wsb-text.d.ts +2 -0
- package/dist/host/engines/windows-sandbox/wsb-text.js +29 -0
- package/dist/host/launch/generate.d.ts +5 -1
- package/dist/host/launch/generate.js +50 -8
- package/dist/host/launch/index.d.ts +3 -1
- package/dist/host/launch/index.js +3 -1
- package/dist/host/launch/launch-plan.d.ts +13 -0
- package/dist/host/launch/launch-plan.js +26 -0
- package/dist/host/launch/mappings.js +2 -1
- package/dist/host/launch/risk-notes.d.ts +10 -0
- package/dist/host/launch/risk-notes.js +18 -0
- package/dist/host/launch/session-file.d.ts +2 -0
- package/dist/host/launch/session-file.js +7 -1
- package/dist/host/launch/wsb-file.d.ts +28 -4
- package/dist/host/launch/wsb-file.js +61 -42
- package/dist/host/life/crash-report.d.ts +27 -1
- package/dist/host/life/crash-report.js +173 -7
- package/dist/host/life/host-memory.d.ts +41 -0
- package/dist/host/life/host-memory.js +140 -0
- package/dist/host/life/index.d.ts +2 -0
- package/dist/host/life/index.js +2 -0
- package/dist/host/life/stop-events.d.ts +2 -0
- package/dist/host/life/stop-events.js +20 -3
- package/dist/host/life/stop-warning.js +1 -1
- package/dist/host/life/watchdog.d.ts +56 -0
- package/dist/host/life/watchdog.js +124 -0
- package/dist/host/native.d.ts +3 -2
- package/dist/host/native.js +22 -3
- package/dist/host/profile/claude-login.js +3 -2
- package/dist/host/sandbox/contained-deps.d.ts +2 -0
- package/dist/host/sandbox/contained-deps.js +17 -0
- package/dist/host/sandbox/index.d.ts +2 -0
- package/dist/host/sandbox/index.js +2 -0
- package/dist/host/sandbox/platform.d.ts +2 -0
- package/dist/host/sandbox/platform.js +7 -7
- package/dist/host/sandbox/tasklist.d.ts +13 -0
- package/dist/host/sandbox/tasklist.js +47 -0
- package/dist/host/secrets/launch-secrets.js +2 -1
- package/dist/host/sharing/current.js +2 -6
- package/dist/host/storage/contained/check.d.ts +9 -0
- package/dist/host/storage/contained/check.js +37 -0
- package/dist/host/storage/contained/contained-storage.d.ts +66 -0
- package/dist/host/storage/contained/contained-storage.js +168 -0
- package/dist/host/storage/contained/disk-port.d.ts +43 -0
- package/dist/host/storage/contained/disk-port.js +122 -0
- package/dist/host/storage/contained/index.d.ts +9 -0
- package/dist/host/storage/contained/index.js +8 -0
- package/dist/host/storage/contained/layout.d.ts +28 -0
- package/dist/host/storage/contained/layout.js +45 -0
- package/dist/host/storage/contained/resolve.d.ts +4 -0
- package/dist/host/storage/contained/resolve.js +30 -0
- package/dist/host/storage/contained/setting.d.ts +1 -0
- package/dist/host/storage/contained/setting.js +5 -0
- package/dist/host/storage/contained/state.d.ts +89 -0
- package/dist/host/storage/contained/state.js +166 -0
- package/dist/host/storage/contained/transfer.d.ts +24 -0
- package/dist/host/storage/contained/transfer.js +121 -0
- package/dist/host/storage/index.d.ts +2 -0
- package/dist/host/storage/index.js +2 -0
- package/dist/host/storage/providers/contained.d.ts +15 -0
- package/dist/host/storage/providers/contained.js +39 -0
- package/dist/host/storage/providers/folder.d.ts +12 -0
- package/dist/host/storage/providers/folder.js +20 -0
- package/dist/host/storage/providers/index.d.ts +4 -0
- package/dist/host/storage/providers/index.js +3 -0
- package/dist/host/storage/providers/registry.d.ts +9 -0
- package/dist/host/storage/providers/registry.js +14 -0
- package/dist/host/storage/providers/types.d.ts +33 -0
- package/dist/host/storage/providers/types.js +1 -0
- package/dist/host/tools/conpty.js +3 -2
- package/dist/host/tools/windows-terminal.js +8 -7
- package/dist/host/vpn/index.d.ts +1 -1
- package/dist/host/vpn/index.js +1 -1
- package/dist/host/vpn/prepare.d.ts +2 -0
- package/dist/host/vpn/prepare.js +63 -2
- package/dist/host/web/browser.d.ts +2 -0
- package/dist/host/web/browser.js +14 -1
- package/dist/host/web/index.d.ts +3 -2
- package/dist/host/web/index.js +3 -2
- package/dist/host/web/rpc.d.ts +24 -0
- package/dist/host/web/rpc.js +149 -0
- package/dist/host/web/runner.d.ts +2 -0
- package/dist/host/web/runner.js +1 -2
- package/dist/host/web/server.d.ts +7 -0
- package/dist/host/web/server.js +23 -3
- package/dist/runtime/agent.js +83 -18
- package/dist/runtime/daemon.js +1805 -1221
- package/dist/runtime/db.js +83 -18
- package/dist/runtime/main.js +779 -219
- package/dist/runtime/netproxy.js +73 -11
- package/dist/runtime/view.js +91 -16
- package/dist/selftest/agent-paths.test.js +11 -1
- package/dist/selftest/app.test.d.ts +2 -0
- package/dist/selftest/app.test.js +324 -0
- package/dist/selftest/channel.test.js +13 -0
- package/dist/selftest/cli.test.js +2 -1
- package/dist/selftest/config.test.js +59 -0
- package/dist/selftest/contained.test.d.ts +2 -0
- package/dist/selftest/contained.test.js +544 -0
- package/dist/selftest/credentials.test.js +1 -1
- package/dist/selftest/engine.test.d.ts +2 -0
- package/dist/selftest/engine.test.js +127 -0
- package/dist/selftest/guest-boot.test.js +47 -1
- package/dist/selftest/hcs.test.d.ts +2 -0
- package/dist/selftest/hcs.test.js +482 -0
- package/dist/selftest/heavy-load.test.d.ts +2 -0
- package/dist/selftest/heavy-load.test.js +355 -0
- package/dist/selftest/index.js +12 -0
- package/dist/selftest/layout.test.js +12 -0
- package/dist/selftest/menu-perf.test.d.ts +2 -0
- package/dist/selftest/menu-perf.test.js +248 -0
- package/dist/selftest/menu-screens.js +4 -2
- package/dist/selftest/menu.test.js +36 -8
- package/dist/selftest/network.test.js +20 -1
- package/dist/selftest/support/engine-cases.d.ts +8 -0
- package/dist/selftest/support/engine-cases.js +65 -0
- package/dist/selftest/support/engine-golden.d.ts +3 -0
- package/dist/selftest/support/engine-golden.js +66 -0
- package/dist/selftest/support/fixtures.d.ts +8 -1
- package/dist/selftest/support/hcs-probes.d.ts +17 -0
- package/dist/selftest/support/hcs-probes.js +41 -0
- package/dist/selftest/vpn.test.js +136 -3
- package/dist/selftest/web.test.js +101 -3
- package/dist/shared/channel/run-dir.d.ts +4 -1
- package/dist/shared/channel/run-dir.js +7 -1
- package/dist/shared/channel/schema.d.ts +35 -1
- package/dist/shared/channel/schema.js +27 -0
- package/dist/shared/channel/secrets.d.ts +1 -0
- package/dist/shared/channel/secrets.js +6 -0
- package/dist/shared/io/copy-tree.d.ts +7 -0
- package/dist/shared/io/copy-tree.js +45 -0
- package/dist/shared/io/index.d.ts +2 -0
- package/dist/shared/io/index.js +2 -0
- package/dist/shared/io/robocopy-result.d.ts +6 -0
- package/dist/shared/io/robocopy-result.js +23 -0
- package/dist/shared/memory/index.d.ts +1 -0
- package/dist/shared/memory/index.js +1 -0
- package/dist/shared/memory/policy.d.ts +38 -0
- package/dist/shared/memory/policy.js +63 -0
- package/dist/shared/network/firewall-rules.d.ts +8 -0
- package/dist/shared/network/firewall-rules.js +28 -0
- package/dist/shared/pty/output-filter.d.ts +14 -1
- package/dist/shared/pty/output-filter.js +22 -4
- package/dist/shared/pty/terminal.d.ts +4 -1
- package/dist/shared/pty/terminal.js +4 -2
- package/dist/shared/system.d.ts +1 -0
- package/dist/shared/system.js +1 -0
- package/dist/shared/vpn/download.d.ts +16 -0
- package/dist/shared/vpn/download.js +16 -0
- package/dist/shared/vpn/wireguard.d.ts +51 -0
- package/dist/shared/vpn/wireguard.js +227 -0
- package/dist/sync/sync-cycle.js +5 -5
- package/dist/sync/watcher.d.ts +13 -0
- package/dist/sync/watcher.js +92 -3
- package/dist/web/index.html +4 -3
- package/dist/web/main-NRRS5O6Z.js +157 -0
- package/dist/web/main-T5DMCHYV.css +1 -0
- package/native/csharp/HcsHost/AssemblyInfo.cs +14 -0
- package/native/csharp/HcsHost/Guard.cs +100 -0
- package/native/csharp/HcsHost/Hcs.cs +256 -0
- package/native/csharp/HcsHost/Json.cs +78 -0
- package/native/csharp/HcsHost/Program.cs +185 -0
- package/native/csharp/HcsHost/VirtualDisk.cs +95 -0
- package/native/csharp/HostTools/AssemblyInfo.cs +14 -0
- package/native/csharp/HostTools/MemoryStatus.cs +128 -0
- package/native/csharp/HostTools/Program.cs +58 -17
- package/native/scripts/check-contained.ps1 +28 -0
- package/native/scripts/contained-common.ps1 +241 -0
- package/native/scripts/dismount-contained.ps1 +66 -0
- package/native/scripts/memory-status.ps1 +42 -0
- package/native/scripts/mount-contained.ps1 +139 -0
- package/native/scripts/run-elevated.ps1 +17 -4
- package/native/scripts/stop-events.ps1 +23 -8
- package/package.json +9 -2
- package/sandbox/csharp/MemGov.cs +466 -0
- package/sandbox/csharp/PtyHost.cs +111 -5
- package/sandbox/scripts/new-shortcuts.ps1 +3 -1
- package/schemas/config.schema.json +66 -8
- package/schemas/sandbox-config.schema.json +3 -3
- package/dist/cli/commands/sessions/control.d.ts +0 -4
- package/dist/cli/commands/sessions/control.js +0 -66
- package/dist/cli/commands/sessions/list.d.ts +0 -2
- package/dist/cli/commands/sessions/list.js +0 -48
- package/dist/cli/commands/sessions/status.d.ts +0 -4
- package/dist/cli/commands/sessions/status.js +0 -114
- package/dist/cli/commands/sessions/window.d.ts +0 -3
- package/dist/cli/commands/sessions/window.js +0 -18
- package/dist/cli/menu/settings/path-kind.js +0 -44
- package/dist/web/main-CXESL347.js +0 -45
- package/dist/web/main-VLR7DVQ4.css +0 -1
- /package/dist/{cli/menu/settings → app/kernel}/schema-node.d.ts +0 -0
- /package/dist/{cli/menu/settings → app/kernel}/schema-node.js +0 -0
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type net from 'node:net';
|
|
2
|
+
import type { RpcHost } from '../../app/kernel/index.js';
|
|
2
3
|
import type { Endpoint } from '../../shared/pty/index.js';
|
|
3
4
|
import type { WebBackend } from './backend.js';
|
|
4
5
|
/** No inline script: the page and its script are files from this server. Inline styles are what xterm.js needs. */
|
|
5
6
|
export declare const CONTENT_SECURITY_POLICY: string;
|
|
7
|
+
export declare const RPC_PATH = "/api/rpc";
|
|
6
8
|
export interface WebServerOptions {
|
|
7
9
|
/** 0 picks a free port (tests). */
|
|
8
10
|
readonly port: number;
|
|
@@ -14,6 +16,8 @@ export interface WebServerOptions {
|
|
|
14
16
|
readonly onStop?: () => void;
|
|
15
17
|
/** How terminals reach a session (tests use a fake on loopback). */
|
|
16
18
|
readonly dial?: (endpoint: Endpoint) => Promise<net.Socket>;
|
|
19
|
+
/** The shared core's operations and queries the browser may run (none: /api/rpc is not served). */
|
|
20
|
+
readonly rpc?: RpcHost;
|
|
17
21
|
}
|
|
18
22
|
export declare class WebServer {
|
|
19
23
|
private readonly options;
|
|
@@ -22,6 +26,7 @@ export declare class WebServer {
|
|
|
22
26
|
private readonly auth;
|
|
23
27
|
private readonly files;
|
|
24
28
|
private terminals;
|
|
29
|
+
private rpcSockets;
|
|
25
30
|
private actualPort;
|
|
26
31
|
constructor(options: WebServerOptions);
|
|
27
32
|
get port(): number;
|
|
@@ -37,4 +42,6 @@ export declare class WebServer {
|
|
|
37
42
|
/** A small JSON body (application/json only). */
|
|
38
43
|
private body;
|
|
39
44
|
private upgrade;
|
|
45
|
+
/** The RPC socket (after the same Origin and cookie checks as a terminal). */
|
|
46
|
+
private upgradeRpc;
|
|
40
47
|
}
|
package/dist/host/web/server.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
// The web UI's HTTP server: the app's files, a small JSON API for sessions,
|
|
2
|
-
// nothing works without the token's cookie, and Host / Origin / CSRF
|
|
1
|
+
// The web UI's HTTP server: the app's files, a small JSON API for sessions, the terminal WebSocket and the RPC
|
|
2
|
+
// WebSocket of the shared core. Loopback only; nothing works without the token's cookie, and Host / Origin / CSRF
|
|
3
|
+
// checks keep other sites out (docs/web-ui.md).
|
|
3
4
|
import fs from 'node:fs';
|
|
4
5
|
import http from 'node:http';
|
|
5
6
|
import { WebSocketServer } from 'ws';
|
|
@@ -7,13 +8,16 @@ import { UserError, safeText } from '../../core/util/index.js';
|
|
|
7
8
|
import { MAX_CLIENT_MESSAGE_BYTES, MAX_COLS, MAX_ROWS, MIN_COLS, MIN_ROWS, } from '../../shared/web/index.js';
|
|
8
9
|
import { cookieHeader, csrfOk, hostAllowed, originAllowed, WebAuth } from './auth.js';
|
|
9
10
|
import { TerminalBridge } from './bridge.js';
|
|
11
|
+
import { RpcSession } from './rpc.js';
|
|
10
12
|
import { StaticFiles } from './static-files.js';
|
|
11
13
|
/** No inline script: the page and its script are files from this server. Inline styles are what xterm.js needs. */
|
|
12
14
|
export const CONTENT_SECURITY_POLICY = "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; " +
|
|
13
15
|
"connect-src 'self'; font-src 'self'; object-src 'none'; base-uri 'none'; form-action 'self'; frame-ancestors 'none'";
|
|
14
16
|
const MAX_BODY_BYTES = 16 * 1024;
|
|
15
17
|
const MAX_TERMINALS = 16;
|
|
18
|
+
const MAX_RPC_SOCKETS = 8;
|
|
16
19
|
const SESSION_PATH = /^\/api\/sessions\/([A-Za-z0-9_-]{1,64})\/terminal$/;
|
|
20
|
+
export const RPC_PATH = '/api/rpc';
|
|
17
21
|
class HttpFailure extends Error {
|
|
18
22
|
status;
|
|
19
23
|
constructor(status, message) {
|
|
@@ -32,6 +36,7 @@ export class WebServer {
|
|
|
32
36
|
auth;
|
|
33
37
|
files;
|
|
34
38
|
terminals = 0;
|
|
39
|
+
rpcSockets = 0;
|
|
35
40
|
actualPort = 0;
|
|
36
41
|
constructor(options) {
|
|
37
42
|
this.options = options;
|
|
@@ -184,13 +189,18 @@ export class WebServer {
|
|
|
184
189
|
};
|
|
185
190
|
const url = new URL(req.url ?? '/', 'http://127.0.0.1');
|
|
186
191
|
const match = SESSION_PATH.exec(url.pathname);
|
|
187
|
-
|
|
192
|
+
const rpc = url.pathname === RPC_PATH ? this.options.rpc : undefined;
|
|
193
|
+
if (!match && !rpc)
|
|
188
194
|
return refuse('404 Not Found');
|
|
189
195
|
// The Origin must be this page (a page of another site can open WebSockets too) and the cookie is the login.
|
|
190
196
|
if (!originAllowed(req.headers.origin, req.headers.host, this.actualPort))
|
|
191
197
|
return refuse('403 Forbidden');
|
|
192
198
|
if (!this.auth.signedIn(req.headers.cookie))
|
|
193
199
|
return refuse('401 Unauthorized');
|
|
200
|
+
if (rpc)
|
|
201
|
+
return this.upgradeRpc(req, socket, head, rpc, refuse);
|
|
202
|
+
if (!match)
|
|
203
|
+
return refuse('404 Not Found');
|
|
194
204
|
if (this.terminals >= MAX_TERMINALS)
|
|
195
205
|
return refuse('503 Service Unavailable');
|
|
196
206
|
const endpoint = this.options.backend.endpoint(match[1]);
|
|
@@ -204,6 +214,16 @@ export class WebServer {
|
|
|
204
214
|
void new TerminalBridge(ws, endpoint, cols, rows, this.options.dial).start();
|
|
205
215
|
});
|
|
206
216
|
}
|
|
217
|
+
/** The RPC socket (after the same Origin and cookie checks as a terminal). */
|
|
218
|
+
upgradeRpc(req, socket, head, rpc, refuse) {
|
|
219
|
+
if (this.rpcSockets >= MAX_RPC_SOCKETS)
|
|
220
|
+
return refuse('503 Service Unavailable');
|
|
221
|
+
this.sockets.handleUpgrade(req, socket, head, (ws) => {
|
|
222
|
+
this.rpcSockets++;
|
|
223
|
+
ws.on('close', () => this.rpcSockets--);
|
|
224
|
+
new RpcSession(ws, rpc).start();
|
|
225
|
+
});
|
|
226
|
+
}
|
|
207
227
|
}
|
|
208
228
|
function bounded(text, min, max, fallback) {
|
|
209
229
|
const n = Number(text);
|
package/dist/runtime/agent.js
CHANGED
|
@@ -5553,6 +5553,7 @@ var SYSTEM = {
|
|
|
5553
5553
|
shutdown: () => system32("shutdown.exe"),
|
|
5554
5554
|
dism: () => system32("Dism.exe"),
|
|
5555
5555
|
msiexec: () => system32("msiexec.exe"),
|
|
5556
|
+
sc: () => system32("sc.exe"),
|
|
5556
5557
|
/** The .NET Framework C# compiler that ships with Windows (C# 5). */
|
|
5557
5558
|
csc: () => path.join(systemRoot(), "Microsoft.NET", "Framework64", "v4.0.30319", "csc.exe")
|
|
5558
5559
|
};
|
|
@@ -25378,6 +25379,9 @@ var HarnessSchema = external_exports.strictObject({
|
|
|
25378
25379
|
localState: external_exports.record(external_exports.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/), SubfolderSchema).optional().describe(
|
|
25379
25380
|
"Environment variable -> folder below the agent's own state folder (state\\<agent>) for SQLite databases. SQLite cannot run in a mapped folder, so the agent runs from a copy on the sandbox's disk (the variable points to it) that is copied from and back to that folder."
|
|
25380
25381
|
),
|
|
25382
|
+
bootReset: external_exports.array(SubfolderSchema).max(32).optional().describe(
|
|
25383
|
+
"Files and folders below the agent's own state folder (state\\<agent>) that only work on the machine that wrote them (keys sealed with Windows DPAPI, local accounts it created). Every sandbox is a new machine, so they are deleted at each boot and the agent sets them up again."
|
|
25384
|
+
),
|
|
25381
25385
|
resumeArguments: StringsSchema.optional().describe(
|
|
25382
25386
|
"Arguments used when the agent is restarted in place (e.g. after an account switch) so it resumes the conversation."
|
|
25383
25387
|
),
|
|
@@ -25455,6 +25459,9 @@ var MappingSchema = external_exports.strictObject({
|
|
|
25455
25459
|
optional: external_exports.boolean().optional().describe("true = skip it quietly when the host folder does not exist.")
|
|
25456
25460
|
});
|
|
25457
25461
|
var SandboxSchema = external_exports.strictObject({
|
|
25462
|
+
engine: external_exports.enum(["windows-sandbox", "hcs"]).describe(
|
|
25463
|
+
'(alpha) What runs the sandbox. "windows-sandbox" = Windows Sandbox (the default: desktop, Windows Terminal, GPU, clipboard, audio, printers). "hcs" = a headless Hyper-V isolated Server Core container for agents (no desktop, GPU or clipboard); it needs Windows features and an image on this PC (sandbox engine check hcs lists what is missing), and starting it is not enabled yet in this alpha. sandbox engine shows what each engine can do. Yours only: a project file (.sandbox-config.json) cannot set it.'
|
|
25464
|
+
),
|
|
25458
25465
|
memoryMb: external_exports.union([external_exports.literal("auto"), external_exports.number().int().min(2048)]).describe('Sandbox RAM in MB (>= 2048), or "auto": free RAM minus reserveHostMb, capped at maxMemoryMb.'),
|
|
25459
25466
|
maxMemoryMb: external_exports.number().int().positive().describe('Upper limit for memoryMb "auto".'),
|
|
25460
25467
|
maxMemoryPercent: external_exports.number().int().min(10).max(100).describe(`memoryMb "auto" never takes more than this share of this PC's total RAM (percent).`),
|
|
@@ -25464,10 +25471,22 @@ var SandboxSchema = external_exports.strictObject({
|
|
|
25464
25471
|
pageFileMb: external_exports.number().int().min(0).max(262144).describe(
|
|
25465
25472
|
`Size of the sandbox's paging file in MB, created at full size when it starts so it never grows while builds run (8 GB of its disk always stays free). Windows Sandbox starts with about 1 GB: parallel builds then fail with "The paging file is too small", and Windows grows the file under load. 0 = leave Windows' own.`
|
|
25466
25473
|
),
|
|
25467
|
-
reserveHostMb: external_exports.number().int().nonnegative().describe(
|
|
25468
|
-
|
|
25474
|
+
reserveHostMb: external_exports.number().int().nonnegative().describe(
|
|
25475
|
+
'Memory always left for this PC when memoryMb is "auto": the sandbox gets at most (free RAM, and RAM plus paging file still unused) minus this.'
|
|
25476
|
+
),
|
|
25477
|
+
agentMemoryHeadroomMb: external_exports.union([external_exports.literal("auto"), external_exports.literal("none"), external_exports.number().int().min(0)]).describe(
|
|
25478
|
+
'Memory kept out of the agents reach inside the sandbox, in MB: everything the agents start (their builds, tests, tools) together may use at most the sandbox memory minus this; a runaway parallel build then gets out-of-memory errors in its own session instead of freezing or crashing the whole sandbox. "auto" = the larger of 2048 MB and 10 % of the sandbox memory; "none" = no limit. Yours only: a project file cannot change it.'
|
|
25479
|
+
),
|
|
25480
|
+
pressureResponse: external_exports.boolean().describe(
|
|
25481
|
+
"When the sandbox (or this PC) runs low on memory, slow the heaviest build programs down (lower priority) and, if that is not enough, pause the biggest compiler for a few seconds at a time, so heavy parallel builds slow down instead of closing the sandbox. Never touches the agents themselves. Yours only: a project file cannot change it."
|
|
25482
|
+
),
|
|
25483
|
+
vGpu: external_exports.boolean().describe(
|
|
25484
|
+
"Virtual GPU. Off by default: Microsoft notes it widens the sandbox attack surface. The sandbox then uses this PC's graphics card, and with some graphics drivers heavy use can freeze the whole PC: turn it on only when a program in the sandbox needs the GPU (the mesa toolchain gives software OpenGL without it)."
|
|
25485
|
+
),
|
|
25469
25486
|
networking: external_exports.boolean().describe("Internet access. false is the only hard network isolation Windows Sandbox offers."),
|
|
25470
|
-
clipboard: external_exports.boolean().describe(
|
|
25487
|
+
clipboard: external_exports.boolean().describe(
|
|
25488
|
+
"Shared clipboard between this PC and the sandbox. Also lets an agent's copy (in sandbox attach) reach this PC's clipboard."
|
|
25489
|
+
),
|
|
25471
25490
|
audioInput: external_exports.boolean().describe("Microphone access."),
|
|
25472
25491
|
videoInput: external_exports.boolean().describe("Camera access."),
|
|
25473
25492
|
printerRedirection: external_exports.boolean().describe("Printers from this PC."),
|
|
@@ -26543,24 +26562,25 @@ var ResumeSchema = external_exports.strictObject({
|
|
|
26543
26562
|
// src/core/schema/web.ts
|
|
26544
26563
|
var WebSchema = external_exports.strictObject({
|
|
26545
26564
|
enabled: external_exports.boolean().describe(
|
|
26546
|
-
"(Beta)
|
|
26565
|
+
"(Beta) The web UI: your sandbox sessions in a browser on this PC (http://127.0.0.1:<port>, this PC only). On: every sandbox start also starts it in the background (it keeps running until sandbox web stop or a restart of the PC). Off: only sandbox web start runs it. Open it signed in with sandbox web open."
|
|
26547
26566
|
),
|
|
26548
|
-
port: external_exports.number().int().min(1024).max(65535).describe("Port of the web UI on 127.0.0.1 (this PC only). Pick another when it is taken.")
|
|
26567
|
+
port: external_exports.number().int().min(1024).max(65535).describe("Port of the web UI on 127.0.0.1 (this PC only). Pick another when it is taken."),
|
|
26568
|
+
openOnLaunch: external_exports.boolean().describe("(Beta) With the web UI on: open it in your browser, already signed in, every time a sandbox starts.")
|
|
26549
26569
|
});
|
|
26550
26570
|
|
|
26551
26571
|
// src/core/schema/vpn.ts
|
|
26552
|
-
var VPN_PROVIDERS = ["nordvpn", "openvpn-file"];
|
|
26572
|
+
var VPN_PROVIDERS = ["nordvpn", "openvpn-file", "wireguard-file"];
|
|
26553
26573
|
var VpnSchema = external_exports.strictObject({
|
|
26554
26574
|
enabled: external_exports.boolean().describe(
|
|
26555
|
-
"Send the sandbox's traffic through a VPN. Only the sandbox: your PC's own connection is untouched. Needs a saved login first (sandbox vpn login). The agent in the sandbox can read that login and can turn the tunnel off (it is the administrator there)."
|
|
26575
|
+
"(Alpha: not yet tried on a real PC) Send the sandbox's traffic through a VPN. Only the sandbox: your PC's own connection is untouched. Needs a saved login first (sandbox vpn login). The agent in the sandbox can read that login and can turn the tunnel off (it is the administrator there)."
|
|
26556
26576
|
),
|
|
26557
26577
|
provider: external_exports.enum(VPN_PROVIDERS).describe(
|
|
26558
|
-
"nordvpn: a recommended NordVPN server is picked at every launch. openvpn-file: your own .ovpn file (configFile)."
|
|
26578
|
+
"nordvpn: a recommended NordVPN server is picked at every launch. openvpn-file: your own .ovpn file (configFile). wireguard-file: your own WireGuard .conf (configFile), e.g. from your company."
|
|
26559
26579
|
),
|
|
26560
26580
|
protocol: external_exports.enum(["udp", "tcp"]).describe("udp is faster; tcp gets through networks that block udp."),
|
|
26561
26581
|
country: external_exports.string().regex(/^([A-Za-z][A-Za-z .'-]{0,39})?$/, "a country name or code like uk or Germany").describe("nordvpn: the country of the server, e.g. uk, us or Germany. Empty = the best server anywhere."),
|
|
26562
26582
|
configFile: external_exports.string().describe(
|
|
26563
|
-
"openvpn-file: the .ovpn file on this PC (its certificates inside it). Files that run programs (script-security, up, down, plugin ...) are refused. A project's file can never set this."
|
|
26583
|
+
"openvpn-file / wireguard-file: the .ovpn or .conf file on this PC (an .ovpn has its certificates inside it). Files that run programs (script-security, up, down, plugin, PostUp ...) are refused. A WireGuard file holds your private key: it is read when a sandbox starts and handed over in a one-shot file. A project's file can never set this."
|
|
26564
26584
|
),
|
|
26565
26585
|
killSwitch: external_exports.boolean().describe(
|
|
26566
26586
|
"Block all traffic that does not go through the tunnel: when the tunnel cannot start, the sandbox stays offline instead of using your normal connection. A project can only turn this on, never off."
|
|
@@ -26587,6 +26607,10 @@ var ConfigSchema = external_exports.strictObject({
|
|
|
26587
26607
|
markSandboxFiles: external_exports.boolean().describe(
|
|
26588
26608
|
`Programs and scripts (.exe, .ps1, .bat, .cmd, .msi, .lnk ...) that appear or change in your project while a sandbox runs get Windows' "downloaded from the internet" mark, so SmartScreen and PowerShell ask before they run on this PC.`
|
|
26589
26609
|
),
|
|
26610
|
+
contained: external_exports.enum(["off", "vhdx"]).describe(
|
|
26611
|
+
'(beta) Keep the sandbox tools, state and logs inside one disk image file (vhdx) instead of loose folders, so scanning programs on this PC see one file. Not yet tried on a real PC. Turn it on with sandbox storage contained on (it moves your files and asks first); Windows asks for permission to mount the image when a sandbox starts. "off" = loose folders, as always. Yours only: a project file (.sandbox-config.json) cannot set it.'
|
|
26612
|
+
),
|
|
26613
|
+
containedMaxGb: external_exports.number().int().min(8).max(4096).describe("(beta) Largest size, in GB, the disk image of storage.contained may grow to."),
|
|
26590
26614
|
warnDataGb: external_exports.number().min(0).describe(
|
|
26591
26615
|
"Say at launch when the persisted data (tools, databases, logins) is bigger than this many GB; 0 = never. sandbox data shows what takes the space."
|
|
26592
26616
|
)
|
|
@@ -26630,7 +26654,13 @@ var LocalOverridesSchema = external_exports.strictObject({
|
|
|
26630
26654
|
"Scripts (.ps1 / .mjs / .cmd, relative to this file) run inside the sandbox before the agent."
|
|
26631
26655
|
),
|
|
26632
26656
|
// This PC's resources are yours to share: CPU and paging file (this PC's disk) are not a project's to set.
|
|
26633
|
-
sandbox: SandboxSchema.omit({
|
|
26657
|
+
sandbox: SandboxSchema.omit({
|
|
26658
|
+
cpuLimit: true,
|
|
26659
|
+
pageFileMb: true,
|
|
26660
|
+
engine: true,
|
|
26661
|
+
agentMemoryHeadroomMb: true,
|
|
26662
|
+
pressureResponse: true
|
|
26663
|
+
}).partial(),
|
|
26634
26664
|
// A project may block more (the LAN, hosts); it never opens hosts, ports, DNS or a proxy.
|
|
26635
26665
|
network: NetworkSchema.pick({ blockPrivateRanges: true, blockHosts: true }).partial(),
|
|
26636
26666
|
// A project may turn the kill switch on, never off, and never choose a VPN, a server, a file or a login.
|
|
@@ -26739,8 +26769,34 @@ var GuestRequestSchema = external_exports.discriminatedUnion("kind", [
|
|
|
26739
26769
|
cwd: Text().optional(),
|
|
26740
26770
|
createdAt: TimeSchema
|
|
26741
26771
|
}),
|
|
26742
|
-
external_exports.strictObject({ kind: external_exports.literal("ping"), id: IdSchema, createdAt: TimeSchema })
|
|
26772
|
+
external_exports.strictObject({ kind: external_exports.literal("ping"), id: IdSchema, createdAt: TimeSchema }),
|
|
26773
|
+
/**
|
|
26774
|
+
* The PC's own memory or CPU is running low (the host watchdog): the sandbox slows its heaviest builds down for
|
|
26775
|
+
* `seconds` (it never stops them) so Windows does not have to close it. Repeated while the PC stays low.
|
|
26776
|
+
*/
|
|
26777
|
+
external_exports.strictObject({
|
|
26778
|
+
kind: external_exports.literal("pressure"),
|
|
26779
|
+
id: IdSchema,
|
|
26780
|
+
reason: Text(300),
|
|
26781
|
+
seconds: external_exports.number().int().min(10).max(300),
|
|
26782
|
+
createdAt: TimeSchema
|
|
26783
|
+
})
|
|
26743
26784
|
]);
|
|
26785
|
+
var PressureStatusSchema = external_exports.object({
|
|
26786
|
+
level: external_exports.enum(["ok", "throttled", "suspending"]),
|
|
26787
|
+
profile: external_exports.enum(["normal", "gentle"]),
|
|
26788
|
+
/** Share of the sandbox's RAM still free and of its commit limit in use (percent). */
|
|
26789
|
+
ramFreePercent: external_exports.number().int().min(0).max(100),
|
|
26790
|
+
commitPercent: external_exports.number().int().min(0).max(100),
|
|
26791
|
+
/** Programs running at lower priority because of it. */
|
|
26792
|
+
lowered: external_exports.number().int().min(0).max(1024),
|
|
26793
|
+
/** Programs paused right now (name, process id, seconds left). */
|
|
26794
|
+
paused: external_exports.array(external_exports.object({ name: Text(64), pid: external_exports.number().int(), seconds: external_exports.number().int().min(0).max(60) })).max(8),
|
|
26795
|
+
/** The PC itself asked for slowing down (its memory or CPU is low). */
|
|
26796
|
+
pcLow: external_exports.boolean(),
|
|
26797
|
+
lastAction: Text(300),
|
|
26798
|
+
updatedAt: TimeSchema
|
|
26799
|
+
});
|
|
26744
26800
|
var GuestResponseSchema = external_exports.object({
|
|
26745
26801
|
id: IdSchema,
|
|
26746
26802
|
ok: external_exports.boolean(),
|
|
@@ -26920,6 +26976,8 @@ var RunDir = class {
|
|
|
26920
26976
|
root;
|
|
26921
26977
|
sandboxFile;
|
|
26922
26978
|
vpnFile;
|
|
26979
|
+
/** What the memory governor in the sandbox is doing (pressure.json). */
|
|
26980
|
+
pressureFile;
|
|
26923
26981
|
requestsDir;
|
|
26924
26982
|
responsesDir;
|
|
26925
26983
|
sessionsDir;
|
|
@@ -26932,6 +26990,7 @@ var RunDir = class {
|
|
|
26932
26990
|
this.root = path5.join(dataDir2, "run");
|
|
26933
26991
|
this.sandboxFile = path5.join(this.root, "sandbox.json");
|
|
26934
26992
|
this.vpnFile = path5.join(this.root, "vpn.json");
|
|
26993
|
+
this.pressureFile = path5.join(this.root, "pressure.json");
|
|
26935
26994
|
this.requestsDir = path5.join(this.root, "requests");
|
|
26936
26995
|
this.responsesDir = path5.join(this.root, "responses");
|
|
26937
26996
|
this.sessionsDir = path5.join(this.root, "sessions");
|
|
@@ -26960,6 +27019,9 @@ var RunDir = class {
|
|
|
26960
27019
|
readVpnStatus() {
|
|
26961
27020
|
return readValid(VpnStatusSchema, this.vpnFile);
|
|
26962
27021
|
}
|
|
27022
|
+
readPressure() {
|
|
27023
|
+
return readValid(PressureStatusSchema, this.pressureFile);
|
|
27024
|
+
}
|
|
26963
27025
|
readSession(id) {
|
|
26964
27026
|
return readValid(SessionStatusSchema, this.sessionFile(id));
|
|
26965
27027
|
}
|
|
@@ -27298,12 +27360,6 @@ var githubAssetFromPage = async (repo, pattern, searchOlder) => {
|
|
|
27298
27360
|
};
|
|
27299
27361
|
|
|
27300
27362
|
// src/guest/runtime/process.ts
|
|
27301
|
-
function exec(file2, args, options = {}) {
|
|
27302
|
-
const result = spawnSync(file2, args, { stdio: "inherit", windowsHide: true, ...options });
|
|
27303
|
-
if (result.error) throw result.error;
|
|
27304
|
-
if (result.status !== 0)
|
|
27305
|
-
throw new Error(path11.basename(file2) + " " + args.slice(0, 3).join(" ") + " failed with exit code " + result.status);
|
|
27306
|
-
}
|
|
27307
27363
|
async function execAsync(file2, args, options = {}) {
|
|
27308
27364
|
const code = await spawnAsync(file2, args, { stdio: "inherit", ...options });
|
|
27309
27365
|
if (code !== 0)
|
|
@@ -27314,7 +27370,16 @@ function execOutput(file2, args, options = {}) {
|
|
|
27314
27370
|
return result.status === 0 ? String(result.stdout ?? "").trim() : "";
|
|
27315
27371
|
}
|
|
27316
27372
|
function runScript(name, args = []) {
|
|
27317
|
-
|
|
27373
|
+
const result = spawnSync(SYSTEM.powershell(), scriptArgs(name, args), {
|
|
27374
|
+
stdio: ["inherit", "inherit", "pipe"],
|
|
27375
|
+
encoding: "utf8",
|
|
27376
|
+
windowsHide: true
|
|
27377
|
+
});
|
|
27378
|
+
if (result.error) throw result.error;
|
|
27379
|
+
const errors = String(result.stderr ?? "").trim();
|
|
27380
|
+
if (errors) process.stderr.write(errors + "\n");
|
|
27381
|
+
if (result.status !== 0)
|
|
27382
|
+
throw new Error(name + " failed with exit code " + result.status + (errors ? ": " + errors.slice(0, 400) : ""));
|
|
27318
27383
|
}
|
|
27319
27384
|
function runScriptWithJson(name, param, data, args = []) {
|
|
27320
27385
|
const dir = fs10.mkdtempSync(path11.join(os3.tmpdir(), "sbx-"));
|