windows-development-sandbox 1.5.0 → 1.9.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/README.md +1 -0
- package/config.example.json +27 -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} +4 -0
- package/dist/{cli/menu/settings/categories.js → app/features/settings/categories.def.js} +40 -46
- 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/{cli/menu/settings → app/kernel}/schema-node.d.ts +9 -0
- package/dist/{cli/menu/settings → app/kernel}/schema-node.js +26 -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 +18 -2
- package/dist/cli/args.js +101 -24
- package/dist/cli/commands/accounts.js +45 -17
- package/dist/cli/commands/context.d.ts +2 -0
- package/dist/cli/commands/context.js +9 -2
- package/dist/cli/commands/data/clean.js +32 -9
- package/dist/cli/commands/engine.d.ts +2 -0
- package/dist/cli/commands/engine.js +60 -0
- package/dist/cli/commands/index.d.ts +2 -1
- package/dist/cli/commands/index.js +2 -1
- package/dist/cli/commands/launch/add-root.d.ts +3 -2
- package/dist/cli/commands/launch/add-root.js +11 -10
- package/dist/cli/commands/launch/launch.js +102 -9
- package/dist/cli/commands/launch/prepare.js +6 -4
- package/dist/cli/commands/launch/running.js +2 -1
- package/dist/cli/commands/launch/summary.d.ts +2 -0
- package/dist/cli/commands/maintenance/audit.js +1 -1
- package/dist/cli/commands/maintenance/clean.d.ts +1 -1
- package/dist/cli/commands/maintenance/clean.js +17 -3
- 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.d.ts +1 -1
- package/dist/cli/commands/maintenance/config.js +38 -10
- package/dist/cli/commands/maintenance/doctor.d.ts +1 -1
- package/dist/cli/commands/maintenance/doctor.js +2 -4
- package/dist/cli/commands/maintenance/logs.js +14 -0
- package/dist/cli/commands/maintenance/migrate.d.ts +2 -1
- package/dist/cli/commands/maintenance/migrate.js +19 -4
- package/dist/cli/commands/maintenance/sync.js +2 -0
- package/dist/cli/commands/maintenance/update.d.ts +2 -0
- package/dist/cli/commands/maintenance/update.js +27 -4
- package/dist/cli/commands/projects/here.js +12 -7
- package/dist/cli/commands/projects/projects.js +26 -17
- package/dist/cli/commands/registry.js +10 -7
- package/dist/cli/commands/repair/checks/agents.d.ts +2 -0
- package/dist/cli/commands/repair/checks/agents.js +70 -0
- package/dist/cli/commands/repair/checks/common.d.ts +8 -0
- package/dist/cli/commands/repair/checks/common.js +22 -0
- 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/data.d.ts +2 -0
- package/dist/cli/commands/repair/checks/data.js +241 -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.d.ts +2 -0
- package/dist/cli/commands/repair/checks/index.js +24 -0
- package/dist/cli/commands/repair/checks/install.d.ts +5 -0
- package/dist/cli/commands/repair/checks/install.js +318 -0
- package/dist/cli/commands/repair/checks/machine.d.ts +2 -0
- package/dist/cli/commands/repair/checks/machine.js +232 -0
- package/dist/cli/commands/repair/checks/network.d.ts +6 -0
- package/dist/cli/commands/repair/checks/network.js +60 -0
- package/dist/cli/commands/repair/checks/pc.d.ts +4 -0
- package/dist/cli/commands/repair/checks/pc.js +86 -0
- package/dist/cli/commands/repair/checks/sandbox.d.ts +2 -0
- package/dist/cli/commands/repair/checks/sandbox.js +282 -0
- package/dist/cli/commands/repair/checks/settings.d.ts +2 -0
- package/dist/cli/commands/repair/checks/settings.js +169 -0
- package/dist/cli/commands/repair/checks/vpn.d.ts +2 -0
- package/dist/cli/commands/repair/checks/vpn.js +78 -0
- package/dist/cli/commands/repair/engine.d.ts +32 -0
- package/dist/cli/commands/repair/engine.js +127 -0
- package/dist/cli/commands/repair/env.d.ts +7 -0
- package/dist/cli/commands/repair/env.js +50 -0
- package/dist/cli/commands/repair/index.d.ts +1 -9
- package/dist/cli/commands/repair/index.js +2 -54
- package/dist/cli/commands/repair/log.d.ts +17 -0
- package/dist/cli/commands/repair/log.js +82 -0
- package/dist/cli/commands/repair/printer.d.ts +32 -0
- package/dist/cli/commands/repair/printer.js +132 -0
- package/dist/cli/commands/repair/run.d.ts +33 -0
- package/dist/cli/commands/repair/run.js +133 -0
- package/dist/cli/commands/repair/types.d.ts +97 -9
- package/dist/cli/commands/repair/types.js +11 -7
- package/dist/cli/commands/resume.js +2 -2
- package/dist/cli/commands/sessions/index.d.ts +0 -4
- package/dist/cli/commands/sessions/index.js +3 -7
- package/dist/cli/commands/setup/index.d.ts +5 -0
- package/dist/cli/commands/setup/index.js +25 -1
- 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/index.d.ts +2 -0
- package/dist/cli/commands/storage/index.js +2 -0
- package/dist/cli/commands/storage/offer.d.ts +3 -0
- package/dist/cli/commands/storage/offer.js +91 -0
- package/dist/cli/commands/storage/storage.d.ts +8 -0
- package/dist/cli/commands/storage/storage.js +179 -0
- package/dist/cli/commands/user-config.js +2 -2
- package/dist/cli/commands/vpn.d.ts +4 -0
- package/dist/cli/commands/vpn.js +91 -0
- package/dist/cli/commands/web.d.ts +4 -0
- package/dist/cli/commands/web.js +97 -0
- package/dist/cli/history.js +1 -1
- package/dist/cli/index.js +48 -4
- package/dist/cli/manifest.d.ts +339 -97
- package/dist/cli/manifest.js +222 -67
- package/dist/cli/menu/add-agent.d.ts +47 -0
- package/dist/cli/menu/add-agent.js +168 -0
- package/dist/cli/menu/apps.d.ts +38 -3
- package/dist/cli/menu/apps.js +80 -5
- package/dist/cli/menu/command-fields.d.ts +18 -0
- package/dist/cli/menu/command-fields.js +61 -0
- package/dist/cli/menu/command-form.d.ts +22 -0
- package/dist/cli/menu/command-form.js +169 -46
- package/dist/cli/menu/data-folder.d.ts +18 -0
- package/dist/cli/menu/data-folder.js +99 -0
- 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 +11 -2
- package/dist/cli/menu/menu.js +36 -15
- package/dist/cli/menu/pages/accounts-page.js +55 -24
- package/dist/cli/menu/pages/agents-page.d.ts +68 -0
- package/dist/cli/menu/pages/agents-page.js +345 -0
- package/dist/cli/menu/pages/apps-page.d.ts +3 -1
- package/dist/cli/menu/pages/apps-page.js +20 -4
- package/dist/cli/menu/pages/list-page.d.ts +43 -3
- package/dist/cli/menu/pages/list-page.js +146 -12
- package/dist/cli/menu/pages/maintenance-page.d.ts +9 -5
- package/dist/cli/menu/pages/maintenance-page.js +172 -85
- package/dist/cli/menu/pages/sandbox-page.d.ts +7 -6
- package/dist/cli/menu/pages/sandbox-page.js +117 -120
- package/dist/cli/menu/pages/scopes.d.ts +1 -1
- package/dist/cli/menu/pages/sessions-page.d.ts +6 -8
- package/dist/cli/menu/pages/sessions-page.js +22 -75
- package/dist/cli/menu/pages/settings-page.d.ts +10 -14
- package/dist/cli/menu/pages/settings-page.js +95 -102
- package/dist/cli/menu/render-view.d.ts +28 -0
- package/dist/cli/menu/render-view.js +112 -0
- package/dist/cli/menu/settings/ask-path.d.ts +14 -0
- package/dist/cli/menu/settings/ask-path.js +14 -0
- package/dist/cli/menu/settings/collections/collection-editor.d.ts +8 -2
- package/dist/cli/menu/settings/collections/collection-editor.js +12 -8
- package/dist/cli/menu/settings/collections/map-editor.js +5 -1
- package/dist/cli/menu/settings/collections/object-list-editor.js +2 -2
- package/dist/cli/menu/settings/collections/object-map-editor.js +2 -2
- package/dist/cli/menu/settings/collections/string-list-editor.d.ts +10 -1
- package/dist/cli/menu/settings/collections/string-list-editor.js +23 -0
- 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 +6 -2
- package/dist/cli/menu/settings/object-editor.js +15 -4
- 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 +10 -1
- package/dist/cli/menu/settings/value-editor.js +99 -63
- package/dist/cli/menu/several.js +7 -5
- 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 +53 -10
- package/dist/cli/menu/shell.js +115 -10
- package/dist/cli/menu/views.d.ts +7 -0
- package/dist/cli/menu/views.js +11 -0
- package/dist/cli/menu/vpn-login.d.ts +16 -0
- package/dist/cli/menu/vpn-login.js +74 -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 +5 -1
- package/dist/cli/output/print.js +15 -4
- 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/accounts-service.d.ts +2 -0
- package/dist/cli/services/accounts-service.js +2 -2
- 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/health-service.d.ts +0 -6
- package/dist/cli/services/health-service.js +5 -42
- package/dist/cli/services/index.d.ts +3 -1
- package/dist/cli/services/index.js +3 -1
- package/dist/cli/services/logs-service.js +4 -3
- package/dist/cli/services/migrate-service.js +1 -1
- package/dist/cli/services/update-service.d.ts +2 -0
- package/dist/cli/services/update-service.js +13 -6
- package/dist/cli/services/vpn-service.d.ts +28 -0
- package/dist/cli/services/vpn-service.js +46 -0
- package/dist/cli/services/web-service.d.ts +22 -0
- package/dist/cli/services/web-service.js +111 -0
- package/dist/cli/tui/app.d.ts +12 -4
- package/dist/cli/tui/app.js +38 -9
- package/dist/cli/tui/dialogs/path-listing.d.ts +43 -0
- package/dist/cli/tui/dialogs/path-listing.js +127 -0
- package/dist/cli/tui/dialogs/path-picker.d.ts +67 -0
- package/dist/cli/tui/dialogs/path-picker.js +423 -0
- package/dist/cli/tui/dialogs/text-screen.d.ts +6 -0
- package/dist/cli/tui/dialogs/text-screen.js +10 -3
- package/dist/cli/tui/frame.d.ts +7 -10
- package/dist/cli/tui/frame.js +19 -10
- package/dist/cli/tui/index.d.ts +4 -3
- package/dist/cli/tui/index.js +2 -1
- package/dist/cli/tui/list/list-screen.d.ts +28 -2
- package/dist/cli/tui/list/list-screen.js +130 -66
- package/dist/cli/tui/list/list-types.d.ts +10 -4
- package/dist/cli/tui/nav.d.ts +29 -0
- package/dist/cli/tui/nav.js +67 -0
- package/dist/cli/tui/terminal.d.ts +7 -0
- package/dist/cli/tui/terminal.js +30 -10
- package/dist/cli/validate.d.ts +1 -1
- package/dist/cli/validate.js +3 -3
- package/dist/cli/version.d.ts +2 -0
- package/dist/cli/version.js +11 -0
- package/dist/core/config/defaults.js +13 -1
- package/dist/core/config/loader.js +12 -2
- package/dist/core/local-config/overrides.js +1 -0
- package/dist/core/prompt.d.ts +19 -0
- package/dist/core/prompt.js +43 -3
- package/dist/core/schema/common.d.ts +6 -0
- package/dist/core/schema/common.js +8 -0
- package/dist/core/schema/config.d.ts +36 -0
- package/dist/core/schema/config.js +26 -2
- package/dist/core/schema/harness.d.ts +2 -0
- package/dist/core/schema/harness.js +13 -2
- package/dist/core/schema/index.d.ts +3 -1
- package/dist/core/schema/index.js +3 -1
- package/dist/core/schema/profile.d.ts +1 -0
- package/dist/core/schema/profile.js +3 -0
- package/dist/core/schema/redact.d.ts +13 -0
- package/dist/core/schema/redact.js +75 -0
- package/dist/core/schema/sandbox.d.ts +6 -0
- package/dist/core/schema/sandbox.js +21 -3
- package/dist/core/schema/vpn.d.ts +18 -0
- package/dist/core/schema/vpn.js +22 -0
- package/dist/core/schema/web.d.ts +6 -0
- package/dist/core/schema/web.js +14 -0
- package/dist/core/types.d.ts +44 -0
- 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 +54 -0
- package/dist/guest/agents/agent-files.js +67 -0
- package/dist/guest/agents/agent-installer.js +2 -9
- package/dist/guest/agents/local-state.d.ts +14 -0
- package/dist/guest/agents/local-state.js +218 -0
- package/dist/guest/agents/sbx-agent.d.ts +2 -0
- package/dist/guest/agents/sbx-agent.js +35 -0
- package/dist/guest/boot/boot.d.ts +4 -0
- package/dist/guest/boot/boot.js +51 -11
- package/dist/guest/daemon/daemon.js +8 -1
- package/dist/guest/daemon/exec.js +2 -1
- package/dist/guest/daemon/idle-shutdown.js +2 -0
- package/dist/guest/daemon/sessions.d.ts +5 -0
- package/dist/guest/daemon/sessions.js +20 -3
- package/dist/guest/entries/agent.d.ts +1 -0
- package/dist/guest/entries/agent.js +10 -0
- package/dist/guest/entries/daemon.js +5 -0
- package/dist/guest/governor/decide.d.ts +61 -0
- package/dist/guest/governor/decide.js +182 -0
- package/dist/guest/governor/governor.d.ts +42 -0
- package/dist/guest/governor/governor.js +214 -0
- package/dist/guest/governor/index.d.ts +2 -0
- package/dist/guest/governor/index.js +2 -0
- package/dist/guest/runtime/csc.d.ts +2 -0
- package/dist/guest/runtime/csc.js +2 -0
- package/dist/guest/runtime/secrets.d.ts +12 -0
- package/dist/guest/runtime/secrets.js +63 -0
- package/dist/guest/sessions/viewer.js +3 -1
- package/dist/guest/setup/claude-profile.d.ts +2 -1
- package/dist/guest/setup/claude-profile.js +12 -1
- package/dist/guest/setup/environment.d.ts +6 -0
- package/dist/guest/setup/environment.js +56 -6
- package/dist/guest/setup/path-plan.d.ts +32 -0
- package/dist/guest/setup/path-plan.js +67 -0
- package/dist/guest/setup/shell-path.d.ts +1 -0
- package/dist/guest/setup/shell-path.js +22 -0
- package/dist/guest/toolchains/languages/python.js +1 -1
- package/dist/guest/toolchains/native/rust-extras.js +4 -2
- package/dist/guest/toolchains/runtimes.js +2 -2
- package/dist/guest/vpn/index.d.ts +1 -0
- package/dist/guest/vpn/index.js +1 -0
- package/dist/guest/vpn/openvpn.d.ts +9 -0
- package/dist/guest/vpn/openvpn.js +47 -0
- package/dist/guest/vpn/tunnel.d.ts +17 -0
- package/dist/guest/vpn/tunnel.js +78 -0
- package/dist/guest/vpn/vpn.d.ts +6 -0
- package/dist/guest/vpn/vpn.js +174 -0
- 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 +6 -2
- package/dist/host/channel/attach.js +6 -3
- package/dist/host/channel/channel.d.ts +9 -0
- package/dist/host/channel/channel.js +30 -2
- 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/health/acl-read.d.ts +17 -0
- package/dist/host/health/acl-read.js +45 -0
- package/dist/host/health/config-backup.d.ts +11 -0
- package/dist/host/health/config-backup.js +73 -0
- package/dist/host/health/index.d.ts +6 -0
- package/dist/host/health/index.js +7 -0
- package/dist/host/health/install-state.d.ts +33 -0
- package/dist/host/health/install-state.js +110 -0
- package/dist/host/health/path-copies.d.ts +32 -0
- package/dist/host/health/path-copies.js +82 -0
- package/dist/host/health/stale.d.ts +45 -0
- package/dist/host/health/stale.js +120 -0
- package/dist/host/health/system.d.ts +37 -0
- package/dist/host/health/system.js +87 -0
- package/dist/host/install/copies.d.ts +13 -0
- package/dist/host/install/copies.js +63 -0
- package/dist/host/install/index.d.ts +1 -0
- package/dist/host/install/index.js +1 -0
- package/dist/host/launch/generate.d.ts +5 -1
- package/dist/host/launch/generate.js +73 -7
- 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 +11 -2
- package/dist/host/launch/stage.js +1 -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 +40 -0
- package/dist/host/life/host-memory.js +137 -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 +54 -0
- package/dist/host/life/watchdog.js +108 -0
- package/dist/host/migrate/backup.js +3 -0
- package/dist/host/migrate/migrations/config-file.d.ts +2 -0
- package/dist/host/migrate/migrations/config-file.js +7 -0
- package/dist/host/migrate/migrations/follow-machine-storage.js +9 -1
- package/dist/host/migrate/migrations/pin-storage-root.d.ts +4 -0
- package/dist/host/migrate/migrations/pin-storage-root.js +46 -0
- package/dist/host/migrate/migrations/unpin-config-defaults.js +4 -1
- package/dist/host/migrate/registry.js +2 -1
- package/dist/host/native.d.ts +3 -2
- package/dist/host/native.js +22 -3
- package/dist/host/profile/accounts.d.ts +25 -1
- package/dist/host/profile/accounts.js +96 -13
- package/dist/host/profile/agent-accounts.d.ts +5 -1
- package/dist/host/profile/agent-accounts.js +35 -5
- package/dist/host/profile/claude-login.js +3 -2
- package/dist/host/profile/index.d.ts +2 -1
- package/dist/host/profile/index.js +1 -0
- package/dist/host/profile/plugin-share.d.ts +26 -0
- package/dist/host/profile/plugin-share.js +146 -0
- package/dist/host/projects/join.d.ts +7 -1
- package/dist/host/projects/join.js +21 -4
- package/dist/host/projects/registry.d.ts +16 -10
- package/dist/host/projects/registry.js +74 -6
- 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 +4 -0
- package/dist/host/sandbox/platform.js +23 -4
- package/dist/host/sandbox/tasklist.d.ts +13 -0
- package/dist/host/sandbox/tasklist.js +47 -0
- package/dist/host/secrets/index.d.ts +2 -0
- package/dist/host/secrets/index.js +2 -0
- package/dist/host/secrets/launch-secrets.d.ts +17 -0
- package/dist/host/secrets/launch-secrets.js +94 -0
- package/dist/host/secrets/secret-store.d.ts +25 -0
- package/dist/host/secrets/secret-store.js +89 -0
- package/dist/host/sharing/acl.d.ts +16 -2
- package/dist/host/sharing/acl.js +35 -10
- package/dist/host/sharing/current.js +8 -3
- package/dist/host/sharing/doctor.d.ts +2 -0
- package/dist/host/sharing/doctor.js +44 -0
- package/dist/host/sharing/group-access.d.ts +6 -0
- package/dist/host/sharing/group-access.js +24 -0
- package/dist/host/sharing/index.d.ts +2 -1
- package/dist/host/sharing/index.js +2 -1
- package/dist/host/sharing/lifecycle.d.ts +8 -2
- package/dist/host/sharing/lifecycle.js +16 -7
- package/dist/host/storage/cleanup.d.ts +2 -0
- package/dist/host/storage/cleanup.js +2 -1
- 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/history.d.ts +21 -0
- package/dist/host/storage/history.js +49 -0
- package/dist/host/storage/index.d.ts +6 -0
- package/dist/host/storage/index.js +6 -0
- package/dist/host/storage/move.d.ts +95 -0
- package/dist/host/storage/move.js +384 -0
- package/dist/host/storage/offer.d.ts +11 -0
- package/dist/host/storage/offer.js +36 -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/storage/root.d.ts +18 -0
- package/dist/host/storage/root.js +77 -0
- package/dist/host/tools/conpty.js +3 -2
- package/dist/host/tools/windows-terminal.d.ts +2 -0
- package/dist/host/tools/windows-terminal.js +31 -12
- package/dist/host/update/index.d.ts +1 -1
- package/dist/host/update/index.js +1 -1
- package/dist/host/update/notice.d.ts +2 -0
- package/dist/host/update/notice.js +13 -1
- package/dist/host/update/update-state.d.ts +6 -0
- package/dist/host/update/update-state.js +2 -0
- package/dist/host/update/updater.d.ts +19 -0
- package/dist/host/update/updater.js +88 -12
- package/dist/host/vpn/index.d.ts +4 -0
- package/dist/host/vpn/index.js +4 -0
- package/dist/host/vpn/login.d.ts +24 -0
- package/dist/host/vpn/login.js +79 -0
- package/dist/host/vpn/nordvpn.d.ts +21 -0
- package/dist/host/vpn/nordvpn.js +77 -0
- package/dist/host/vpn/prepare.d.ts +19 -0
- package/dist/host/vpn/prepare.js +138 -0
- package/dist/host/vpn/status.d.ts +12 -0
- package/dist/host/vpn/status.js +53 -0
- package/dist/host/web/auth.d.ts +38 -0
- package/dist/host/web/auth.js +96 -0
- package/dist/host/web/backend.d.ts +14 -0
- package/dist/host/web/backend.js +1 -0
- package/dist/host/web/bridge.d.ts +27 -0
- package/dist/host/web/bridge.js +144 -0
- package/dist/host/web/browser.d.ts +3 -0
- package/dist/host/web/browser.js +23 -0
- package/dist/host/web/control.d.ts +17 -0
- package/dist/host/web/control.js +67 -0
- package/dist/host/web/index.d.ts +10 -0
- package/dist/host/web/index.js +9 -0
- package/dist/host/web/rpc.d.ts +24 -0
- package/dist/host/web/rpc.js +149 -0
- package/dist/host/web/runner.d.ts +16 -0
- package/dist/host/web/runner.js +44 -0
- package/dist/host/web/server.d.ts +47 -0
- package/dist/host/web/server.js +238 -0
- package/dist/host/web/state.d.ts +20 -0
- package/dist/host/web/state.js +41 -0
- package/dist/host/web/static-files.d.ts +13 -0
- package/dist/host/web/static-files.js +57 -0
- package/dist/runtime/agent.js +27675 -0
- package/dist/runtime/daemon.js +1950 -1122
- package/dist/runtime/db.js +302 -111
- package/dist/runtime/main.js +1560 -275
- package/dist/runtime/netproxy.js +168 -8
- package/dist/runtime/view.js +186 -13
- package/dist/selftest/accounts.test.js +40 -0
- package/dist/selftest/agent-paths.test.d.ts +2 -0
- package/dist/selftest/agent-paths.test.js +125 -0
- package/dist/selftest/app.test.d.ts +2 -0
- package/dist/selftest/app.test.js +324 -0
- package/dist/selftest/channel.test.js +18 -0
- package/dist/selftest/cli.test.js +35 -4
- 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.d.ts +2 -0
- package/dist/selftest/credentials.test.js +198 -0
- package/dist/selftest/engine.test.d.ts +2 -0
- package/dist/selftest/engine.test.js +127 -0
- package/dist/selftest/generate.test.js +1 -1
- package/dist/selftest/hcs.test.d.ts +2 -0
- package/dist/selftest/hcs.test.js +482 -0
- package/dist/selftest/health.test.d.ts +2 -0
- package/dist/selftest/health.test.js +470 -0
- package/dist/selftest/heavy-load.test.d.ts +2 -0
- package/dist/selftest/heavy-load.test.js +329 -0
- package/dist/selftest/host-sim.test.js +2 -0
- package/dist/selftest/index.js +31 -0
- package/dist/selftest/layout.test.js +14 -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.d.ts +7 -0
- package/dist/selftest/menu-screens.js +68 -17
- package/dist/selftest/menu.test.js +603 -22
- package/dist/selftest/migrate.test.js +1 -1
- package/dist/selftest/personalization.test.js +3 -1
- package/dist/selftest/projects.test.js +39 -1
- package/dist/selftest/shared-use.test.js +64 -2
- package/dist/selftest/sharing.test.js +50 -1
- package/dist/selftest/storage.test.d.ts +2 -0
- package/dist/selftest/storage.test.js +363 -0
- 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 +20 -0
- package/dist/selftest/support/hcs-probes.d.ts +17 -0
- package/dist/selftest/support/hcs-probes.js +41 -0
- package/dist/selftest/support/releases.js +1 -1
- package/dist/selftest/toolchains.test.js +21 -0
- package/dist/selftest/update-service.test.js +87 -3
- package/dist/selftest/vpn.test.d.ts +2 -0
- package/dist/selftest/vpn.test.js +412 -0
- package/dist/selftest/web.test.d.ts +2 -0
- package/dist/selftest/web.test.js +402 -0
- package/dist/shared/apps/catalogue.js +31 -0
- package/dist/shared/channel/index.d.ts +1 -0
- package/dist/shared/channel/index.js +1 -0
- package/dist/shared/channel/run-dir.d.ts +9 -1
- package/dist/shared/channel/run-dir.js +18 -1
- package/dist/shared/channel/schema.d.ts +53 -0
- package/dist/shared/channel/schema.js +38 -0
- package/dist/shared/channel/secrets.d.ts +29 -0
- package/dist/shared/channel/secrets.js +50 -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 +33 -0
- package/dist/shared/memory/policy.js +55 -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 +29 -0
- package/dist/shared/vpn/download.js +30 -0
- package/dist/shared/vpn/kill-switch.d.ts +18 -0
- package/dist/shared/vpn/kill-switch.js +81 -0
- package/dist/shared/vpn/ovpn.d.ts +23 -0
- package/dist/shared/vpn/ovpn.js +244 -0
- package/dist/shared/vpn/wireguard.d.ts +51 -0
- package/dist/shared/vpn/wireguard.js +227 -0
- package/dist/shared/web/index.d.ts +1 -0
- package/dist/shared/web/index.js +1 -0
- package/dist/shared/web/protocol.d.ts +61 -0
- package/dist/shared/web/protocol.js +35 -0
- package/dist/sync/sync-cycle.js +9 -5
- package/dist/sync/sync-state.d.ts +1 -0
- package/dist/sync/sync-state.js +1 -0
- package/dist/sync/watcher.d.ts +13 -0
- package/dist/sync/watcher.js +102 -3
- package/dist/web/index.html +14 -0
- package/dist/web/main-NRRS5O6Z.js +157 -0
- package/dist/web/main-T5DMCHYV.css +1 -0
- package/native/csharp/FolderSecurity.cs +29 -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 +107 -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 +34 -0
- package/native/scripts/mount-contained.ps1 +139 -0
- package/native/scripts/protect-data.ps1 +29 -0
- package/native/scripts/read-folder-sddl.ps1 +10 -0
- package/native/scripts/run-elevated.ps1 +17 -4
- package/native/scripts/set-folder-access.ps1 +49 -7
- package/native/scripts/stop-events.ps1 +23 -8
- package/node_modules/ws/LICENSE +20 -0
- package/node_modules/ws/README.md +548 -0
- package/node_modules/ws/browser.js +8 -0
- package/node_modules/ws/index.js +22 -0
- package/node_modules/ws/lib/buffer-util.js +131 -0
- package/node_modules/ws/lib/constants.js +19 -0
- package/node_modules/ws/lib/event-target.js +292 -0
- package/node_modules/ws/lib/extension.js +203 -0
- package/node_modules/ws/lib/limiter.js +55 -0
- package/node_modules/ws/lib/permessage-deflate.js +530 -0
- package/node_modules/ws/lib/receiver.js +743 -0
- package/node_modules/ws/lib/sender.js +607 -0
- package/node_modules/ws/lib/stream.js +161 -0
- package/node_modules/ws/lib/subprotocol.js +62 -0
- package/node_modules/ws/lib/validation.js +152 -0
- package/node_modules/ws/lib/websocket-server.js +562 -0
- package/node_modules/ws/lib/websocket.js +1421 -0
- package/node_modules/ws/package.json +74 -0
- package/node_modules/ws/wrapper.mjs +21 -0
- package/package.json +22 -5
- package/sandbox/csharp/EnvBroadcast.cs +33 -0
- package/sandbox/csharp/MemGov.cs +398 -0
- package/sandbox/csharp/PathSync.cs +90 -0
- package/sandbox/csharp/PtyHost.cs +111 -5
- package/sandbox/scripts/install-shell-path.ps1 +73 -0
- package/sandbox/scripts/set-machine-environment.ps1 +37 -4
- package/schemas/config.schema.json +136 -7
- package/schemas/sandbox-config.schema.json +17 -4
- package/dist/cli/commands/repair/checks.d.ts +0 -2
- package/dist/cli/commands/repair/checks.js +0 -246
- 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 -45
- package/dist/cli/commands/sessions/status.d.ts +0 -2
- package/dist/cli/commands/sessions/status.js +0 -93
- package/dist/cli/commands/sessions/window.d.ts +0 -3
- package/dist/cli/commands/sessions/window.js +0 -18
- package/dist/cli/menu/pages/start-page.d.ts +0 -43
- package/dist/cli/menu/pages/start-page.js +0 -192
- package/dist/cli/tui/tab-bar.d.ts +0 -9
- package/dist/cli/tui/tab-bar.js +0 -33
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
// The data folder: where it is, that it can be written, how much room is left, data left behind in another folder, and
|
|
2
|
+
// what an interrupted install left inside it (links the sandbox made, half-downloaded or half-installed tools). Nothing
|
|
3
|
+
// here follows a link or deletes anything but leftovers.
|
|
4
|
+
import fs from 'node:fs';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { GB, freeBytesAt, humanBytes } from '../../../../core/disk.js';
|
|
7
|
+
import { dirExists, isLink, removeLink } from '../../../../core/util/index.js';
|
|
8
|
+
import { writeProblem } from '../../../../host/health/index.js';
|
|
9
|
+
import { assertTestWritable } from '../../../../host/test-guard.js';
|
|
10
|
+
import { OLD_DEFAULT_ROOT, StorageHistory, holdsData, oldDefaultRoot, otherDataFolders, sharedDefaultRoot, } from '../../../../host/storage/index.js';
|
|
11
|
+
import { removeTree } from '../../data/remove.js';
|
|
12
|
+
import { findHalfInstalled, findLinks, findStagingLeftovers, resolvedVersionsValid } from '../finders.js';
|
|
13
|
+
import { guard, ok, plural, rel } from './common.js';
|
|
14
|
+
const same = (a, b) => path.resolve(a).toLowerCase() === path.resolve(b).toLowerCase();
|
|
15
|
+
export const DATA_CHECKS = [
|
|
16
|
+
{
|
|
17
|
+
id: 'data-folder',
|
|
18
|
+
group: 'Data folder',
|
|
19
|
+
name: 'Data folder',
|
|
20
|
+
checking: 'where the data folder is',
|
|
21
|
+
run: (env) => {
|
|
22
|
+
for (const dir of [env.storageRoot, env.dataPath])
|
|
23
|
+
if (isLink(dir))
|
|
24
|
+
return {
|
|
25
|
+
status: 'needs-you',
|
|
26
|
+
detail: dir + ' is a link or junction',
|
|
27
|
+
means: 'The sandbox tool refuses to work through links: one could lead to other folders on this PC.',
|
|
28
|
+
fix: 'Point storage.root at the real folder (sandbox config path), or move the data with: sandbox storage move <folder>',
|
|
29
|
+
};
|
|
30
|
+
if (!dirExists(env.storageRoot))
|
|
31
|
+
return ok(env.storageRoot + ' (not created yet; the first start makes it)');
|
|
32
|
+
const bad = writeProblem(env.storageRoot) ?? (dirExists(env.dataPath) ? writeProblem(env.dataPath) : null);
|
|
33
|
+
if (bad)
|
|
34
|
+
return {
|
|
35
|
+
status: 'needs-you',
|
|
36
|
+
detail: 'cannot write in ' + env.storageRoot + ' (' + bad + ')',
|
|
37
|
+
means: 'The sandbox cannot save its tools, logins or logs.',
|
|
38
|
+
fix: 'Check the folder is not read-only and that you may write to it, or choose another with: sandbox storage move <folder>',
|
|
39
|
+
};
|
|
40
|
+
return ok(env.dataPath + ' (you can write there)');
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: 'data-disk',
|
|
45
|
+
group: 'Data folder',
|
|
46
|
+
name: 'Free disk space',
|
|
47
|
+
run: (env) => {
|
|
48
|
+
const free = freeBytesAt(env.storageRoot);
|
|
49
|
+
if (free === null)
|
|
50
|
+
return { status: 'skipped', detail: 'could not check the drive of ' + env.storageRoot };
|
|
51
|
+
if (free >= 20 * GB)
|
|
52
|
+
return ok(humanBytes(free) + ' free');
|
|
53
|
+
return {
|
|
54
|
+
status: 'warn',
|
|
55
|
+
detail: humanBytes(free) +
|
|
56
|
+
' free on the drive of ' +
|
|
57
|
+
env.storageRoot +
|
|
58
|
+
(free < 5 * GB ? ' (toolchains need several GB)' : ' (getting low)'),
|
|
59
|
+
means: 'Tool installs and caches can use several GB.',
|
|
60
|
+
fix: 'See what is stored with: sandbox data, and free space with: sandbox data clean <target>',
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: 'data-pinned-old',
|
|
66
|
+
group: 'Data folder',
|
|
67
|
+
name: 'Old data folder',
|
|
68
|
+
run: (env) => {
|
|
69
|
+
const old = oldDefaultRoot();
|
|
70
|
+
const shared = sharedDefaultRoot();
|
|
71
|
+
if (!old || !same(env.storageRoot, old) || same(old, shared))
|
|
72
|
+
return ok('your data is not in the old per-user folder');
|
|
73
|
+
if (!holdsData(env.storageRoot))
|
|
74
|
+
return ok('the old folder is empty');
|
|
75
|
+
return {
|
|
76
|
+
status: 'warn',
|
|
77
|
+
detail: 'your data is still in the old per-user folder ' +
|
|
78
|
+
old +
|
|
79
|
+
' (kept by settings that say ' +
|
|
80
|
+
OLD_DEFAULT_ROOT +
|
|
81
|
+
')',
|
|
82
|
+
means: 'It keeps working. New installs keep their data in ' +
|
|
83
|
+
shared +
|
|
84
|
+
', which only you can read, and which an install for everyone can share.',
|
|
85
|
+
fix: 'Move it when you like (it shows the size and time first): sandbox storage move "' + shared + '"',
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: 'data-elsewhere',
|
|
91
|
+
group: 'Data folder',
|
|
92
|
+
name: 'Data in other folders',
|
|
93
|
+
run: (env) => {
|
|
94
|
+
const others = otherDataFolders(env.storageRoot, new StorageHistory(env.userDir));
|
|
95
|
+
if (!others.length)
|
|
96
|
+
return ok('no saved data in any other known folder');
|
|
97
|
+
const both = holdsData(env.storageRoot);
|
|
98
|
+
return {
|
|
99
|
+
status: 'warn',
|
|
100
|
+
detail: (both ? 'data is in this folder and also in ' : 'data is in ') + others.join(', '),
|
|
101
|
+
means: both
|
|
102
|
+
? 'A move may have stopped half way, or you used another version for a while. Nothing is deleted for you.'
|
|
103
|
+
: 'Your current data folder is empty, so the sandbox starts from scratch. That data is not lost.',
|
|
104
|
+
fix: both
|
|
105
|
+
? 'Check that other folder, and delete it yourself when you are sure. Or switch to it with: sandbox storage use "' +
|
|
106
|
+
others[0] +
|
|
107
|
+
'"'
|
|
108
|
+
: 'Bring it here with: sandbox storage move "' +
|
|
109
|
+
others[0] +
|
|
110
|
+
'" (or switch with: sandbox storage use "' +
|
|
111
|
+
others[0] +
|
|
112
|
+
'")',
|
|
113
|
+
};
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
id: 'data-links',
|
|
118
|
+
group: 'Data folder',
|
|
119
|
+
name: 'Links in the data folder',
|
|
120
|
+
checking: 'the data folder for links',
|
|
121
|
+
needsIdle: 'look',
|
|
122
|
+
run: (env) => {
|
|
123
|
+
const links = findLinks(env.dataPath);
|
|
124
|
+
if (!links.length)
|
|
125
|
+
return ok('none (nothing in ' + env.dataPath + ' points elsewhere)');
|
|
126
|
+
return {
|
|
127
|
+
status: 'needs-you',
|
|
128
|
+
detail: plural(links.length, 'link') + ' made inside the sandbox',
|
|
129
|
+
means: "A link here could point at this PC's own files; the tool must not follow it.",
|
|
130
|
+
plan: 'remove ' + plural(links.length, 'link') + ' without following them',
|
|
131
|
+
lines: links.map((l) => rel(env.dataPath, l)),
|
|
132
|
+
data: links,
|
|
133
|
+
};
|
|
134
|
+
},
|
|
135
|
+
fix: (env, finding) => {
|
|
136
|
+
const links = Array.isArray(finding.data) ? finding.data : [];
|
|
137
|
+
// Only if every folder above is still real.
|
|
138
|
+
for (const link of links) {
|
|
139
|
+
guard(env, path.dirname(link));
|
|
140
|
+
removeLink(link);
|
|
141
|
+
}
|
|
142
|
+
return {
|
|
143
|
+
done: 'removed ' + plural(links.length, 'link') + ' without following ' + (links.length === 1 ? 'it' : 'them'),
|
|
144
|
+
};
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
id: 'data-downloads',
|
|
149
|
+
group: 'Data folder',
|
|
150
|
+
name: 'Interrupted downloads',
|
|
151
|
+
needsIdle: 'look',
|
|
152
|
+
run: (env) => {
|
|
153
|
+
guard(env, env.toolsDir);
|
|
154
|
+
const found = findStagingLeftovers(env.toolsDir);
|
|
155
|
+
if (!found.length)
|
|
156
|
+
return ok('none');
|
|
157
|
+
return {
|
|
158
|
+
status: 'needs-you',
|
|
159
|
+
detail: plural(found.length, 'half-finished download or copy folder'),
|
|
160
|
+
means: 'They only waste space; the next start downloads again.',
|
|
161
|
+
plan: 'remove ' + plural(found.length, 'half-finished folder'),
|
|
162
|
+
lines: found.map((p) => rel(env.toolsDir, p)),
|
|
163
|
+
data: found,
|
|
164
|
+
};
|
|
165
|
+
},
|
|
166
|
+
fix: (env, finding) => {
|
|
167
|
+
const found = Array.isArray(finding.data) ? finding.data : [];
|
|
168
|
+
guard(env, env.toolsDir);
|
|
169
|
+
for (const p of found)
|
|
170
|
+
removeTree(p, env.dataPath);
|
|
171
|
+
return { done: 'removed ' + plural(found.length, 'half-finished folder') };
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
id: 'data-toolchains',
|
|
176
|
+
group: 'Data folder',
|
|
177
|
+
name: 'Half-installed toolchains',
|
|
178
|
+
needsIdle: 'look',
|
|
179
|
+
run: (env) => {
|
|
180
|
+
guard(env, env.toolsDir);
|
|
181
|
+
const found = findHalfInstalled(env.toolsDir);
|
|
182
|
+
if (!found.length)
|
|
183
|
+
return ok('every toolchain folder has its program');
|
|
184
|
+
return {
|
|
185
|
+
status: 'needs-you',
|
|
186
|
+
detail: found.map((f) => rel(env.toolsDir, f.path) + ' (no ' + f.missing + ')').join(', '),
|
|
187
|
+
means: 'An install stopped half way; that tool will not run.',
|
|
188
|
+
plan: 'remove ' + plural(found.length, 'half-installed folder') + ' (the next sandbox installs them again)',
|
|
189
|
+
data: found.map((f) => f.path),
|
|
190
|
+
};
|
|
191
|
+
},
|
|
192
|
+
fix: (env, finding) => {
|
|
193
|
+
const found = Array.isArray(finding.data) ? finding.data : [];
|
|
194
|
+
guard(env, env.toolsDir);
|
|
195
|
+
for (const p of found)
|
|
196
|
+
removeTree(p, env.dataPath);
|
|
197
|
+
return {
|
|
198
|
+
done: 'removed ' + found.map((p) => rel(env.toolsDir, p)).join(', ') + '; the next sandbox installs them again',
|
|
199
|
+
};
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
id: 'data-versions-cache',
|
|
204
|
+
group: 'Data folder',
|
|
205
|
+
name: 'Resolved versions cache',
|
|
206
|
+
needsIdle: 'look',
|
|
207
|
+
run: (env) => {
|
|
208
|
+
const file = path.join(env.toolsDir, 'resolved-versions.json');
|
|
209
|
+
if (!fs.existsSync(file) && !isLink(file))
|
|
210
|
+
return ok('not created yet');
|
|
211
|
+
guard(env, env.toolsDir);
|
|
212
|
+
if (isLink(file))
|
|
213
|
+
return {
|
|
214
|
+
status: 'needs-you',
|
|
215
|
+
detail: 'tools\\resolved-versions.json is a link',
|
|
216
|
+
plan: 'remove the link',
|
|
217
|
+
data: file,
|
|
218
|
+
};
|
|
219
|
+
if (fs.statSync(file).size < 4 * 1024 * 1024 && resolvedVersionsValid(fs.readFileSync(file, 'utf8')))
|
|
220
|
+
return ok('valid');
|
|
221
|
+
return {
|
|
222
|
+
status: 'needs-you',
|
|
223
|
+
detail: 'tools\\resolved-versions.json is damaged',
|
|
224
|
+
means: 'The sandbox cannot read which tool versions it looked up.',
|
|
225
|
+
plan: 'remove it (versions are looked up again on the next start)',
|
|
226
|
+
data: file,
|
|
227
|
+
};
|
|
228
|
+
},
|
|
229
|
+
fix: (env, finding) => {
|
|
230
|
+
const file = String(finding.data);
|
|
231
|
+
guard(env, env.toolsDir);
|
|
232
|
+
if (isLink(file)) {
|
|
233
|
+
removeLink(file);
|
|
234
|
+
return { done: 'removed the link in place of tools\\resolved-versions.json' };
|
|
235
|
+
}
|
|
236
|
+
assertTestWritable(file);
|
|
237
|
+
fs.rmSync(file, { force: true });
|
|
238
|
+
return { done: 'removed tools\\resolved-versions.json (versions are looked up again on the next start)' };
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type HcsProbes } from '../../../../host/engines/index.js';
|
|
2
|
+
import type { Check } from '../types.js';
|
|
3
|
+
/** Replaceable by tests: the probes the row looks through. */
|
|
4
|
+
export declare const HCS_PROBES: {
|
|
5
|
+
current: HcsProbes | null;
|
|
6
|
+
};
|
|
7
|
+
export declare const HCS_CHECKS: Check[];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// The HCS engine (alpha), only when sandbox.engine is "hcs": can this PC run it. Looks only; the fixes are commands for
|
|
2
|
+
// you to run (they change Windows), never run by repair.
|
|
3
|
+
import { checkHcs, realHcsProbes } from '../../../../host/engines/index.js';
|
|
4
|
+
import { ok } from './common.js';
|
|
5
|
+
const hcsInUse = (env) => env.ctx.loaded.config.sandbox.engine === 'hcs';
|
|
6
|
+
/** Replaceable by tests: the probes the row looks through. */
|
|
7
|
+
export const HCS_PROBES = { current: null };
|
|
8
|
+
export const HCS_CHECKS = [
|
|
9
|
+
{
|
|
10
|
+
id: 'hcs-engine',
|
|
11
|
+
group: 'Sandbox',
|
|
12
|
+
name: 'HCS engine (alpha)',
|
|
13
|
+
checking: 'the HCS engine',
|
|
14
|
+
applies: hcsInUse,
|
|
15
|
+
timeoutMs: 60000,
|
|
16
|
+
run: () => {
|
|
17
|
+
const check = checkHcs(HCS_PROBES.current ?? realHcsProbes());
|
|
18
|
+
if (check.available)
|
|
19
|
+
return ok('this PC can run it (starting it is not enabled yet in this alpha)');
|
|
20
|
+
return {
|
|
21
|
+
status: 'needs-you',
|
|
22
|
+
detail: check.reasons.length + ' thing(s) missing: ' + check.reasons[0],
|
|
23
|
+
means: check.reasons.join(' '),
|
|
24
|
+
fix: check.fixes.join(' | '),
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { AGENT_CHECKS } from './agents.js';
|
|
2
|
+
import { CONTAINED_CHECKS } from './contained.js';
|
|
3
|
+
import { DATA_CHECKS } from './data.js';
|
|
4
|
+
import { HCS_CHECKS } from './hcs.js';
|
|
5
|
+
import { INSTALL_CHECKS } from './install.js';
|
|
6
|
+
import { MACHINE_CHECKS } from './machine.js';
|
|
7
|
+
import { NETWORK_CHECKS } from './network.js';
|
|
8
|
+
import { PC_CHECKS } from './pc.js';
|
|
9
|
+
import { SANDBOX_CHECKS } from './sandbox.js';
|
|
10
|
+
import { SETTINGS_CHECKS } from './settings.js';
|
|
11
|
+
import { VPN_CHECKS } from './vpn.js';
|
|
12
|
+
export const ALL_CHECKS = [
|
|
13
|
+
...PC_CHECKS,
|
|
14
|
+
...INSTALL_CHECKS,
|
|
15
|
+
...MACHINE_CHECKS,
|
|
16
|
+
...DATA_CHECKS,
|
|
17
|
+
...CONTAINED_CHECKS,
|
|
18
|
+
...SETTINGS_CHECKS,
|
|
19
|
+
...SANDBOX_CHECKS,
|
|
20
|
+
...HCS_CHECKS,
|
|
21
|
+
...AGENT_CHECKS,
|
|
22
|
+
...NETWORK_CHECKS,
|
|
23
|
+
...VPN_CHECKS,
|
|
24
|
+
];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type CommandCopy } from '../../../../host/health/index.js';
|
|
2
|
+
import type { Check } from '../types.js';
|
|
3
|
+
/** The exact way to get rid of one copy (nothing here runs it: doctor only prints it). */
|
|
4
|
+
export declare function removalCommand(copy: CommandCopy): string;
|
|
5
|
+
export declare const INSTALL_CHECKS: Check[];
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
// Install: how this program was installed, and whether the pieces a managed install runs from are in one piece (the
|
|
2
|
+
// version and Node pointers, the shims, the PATH entry, the update task, the record). Fixes move a pointer, rewrite
|
|
3
|
+
// shims or add the user PATH entry; they never delete a version.
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { spawnSync } from 'node:child_process';
|
|
6
|
+
import { fileExists } from '../../../../core/util/index.js';
|
|
7
|
+
import { editUserPath } from '../../../../host/agent-commands/index.js';
|
|
8
|
+
import { HIGH_INTEGRITY_SID, binsOfPackage, currentPathext, fileOnDisk, findCommandCopies, inspectPointers, ownBinDir, pathHas, repairPointers, sameFolder, shimProblems, } from '../../../../host/health/index.js';
|
|
9
|
+
import { UpdateTask, writeShims } from '../../../../host/install/index.js';
|
|
10
|
+
import { assertTestWritable, refuseInSelfTest } from '../../../../host/test-guard.js';
|
|
11
|
+
import { globalPackages } from '../finders.js';
|
|
12
|
+
import { ok, plural } from './common.js';
|
|
13
|
+
const UNINSTALL = '& ([scriptblock]::Create((irm https://github.com/JoshDiDuca/windows-development-sandbox/releases/latest/download/install.ps1))) -Uninstall -Scope ';
|
|
14
|
+
/** The exact way to get rid of one copy (nothing here runs it: doctor only prints it). */
|
|
15
|
+
export function removalCommand(copy) {
|
|
16
|
+
switch (copy.kind) {
|
|
17
|
+
case 'managed-machine':
|
|
18
|
+
return 'in an admin PowerShell: ' + UNINSTALL + 'AllUsers';
|
|
19
|
+
case 'managed-user':
|
|
20
|
+
return 'in PowerShell: ' + UNINSTALL + 'CurrentUser';
|
|
21
|
+
case 'npm': {
|
|
22
|
+
const current = fileOnDisk(path.join(copy.dir, 'node_modules', 'windows-development-sandbox', 'package.json'));
|
|
23
|
+
return 'npm uninstall -g ' + (current ? 'windows-development-sandbox' : 'agent-sandbox');
|
|
24
|
+
}
|
|
25
|
+
case 'old-scripts': {
|
|
26
|
+
const root = path.basename(copy.dir).toLowerCase() === 'bin' ? path.dirname(copy.dir) : copy.dir;
|
|
27
|
+
return 'Remove-Item -Recurse -Force "' + root + '" (and take ' + copy.dir + ' off your PATH)';
|
|
28
|
+
}
|
|
29
|
+
default:
|
|
30
|
+
return 'delete ' + copy.files.join(', ') + ' in ' + copy.dir + ', or take that folder off the PATH';
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const KIND_NAMES = {
|
|
34
|
+
'managed-machine': 'the install for everyone',
|
|
35
|
+
'managed-user': 'the install for just you',
|
|
36
|
+
npm: 'an npm copy',
|
|
37
|
+
'old-scripts': 'an old Scripts\\agent-sandbox copy',
|
|
38
|
+
other: 'a copy of unknown origin',
|
|
39
|
+
};
|
|
40
|
+
const managed = (env) => env.layout !== null;
|
|
41
|
+
const machine = (env) => env.layout?.scope === 'machine';
|
|
42
|
+
/** The commands of the version the pointers name, else of the one running now. */
|
|
43
|
+
function currentBins(env) {
|
|
44
|
+
const layout = env.layout;
|
|
45
|
+
if (!layout)
|
|
46
|
+
return null;
|
|
47
|
+
const active = layout.activeVersion();
|
|
48
|
+
return (active ? binsOfPackage(layout.packageDir(active)) : null) ?? binsOfPackage(env.ctx.packageRoot);
|
|
49
|
+
}
|
|
50
|
+
export const INSTALL_CHECKS = [
|
|
51
|
+
{
|
|
52
|
+
id: 'install-kind',
|
|
53
|
+
group: 'Install',
|
|
54
|
+
name: 'Install type',
|
|
55
|
+
run: (env) => {
|
|
56
|
+
const layout = env.layout;
|
|
57
|
+
if (!layout)
|
|
58
|
+
return ok('npm global install (update it with npm; there are no automatic updates)');
|
|
59
|
+
const who = layout.scope === 'machine' ? 'for everyone on this PC' : 'for you';
|
|
60
|
+
return ok('managed install ' + who + ' in ' + layout.root + ', version ' + (layout.activeVersion() ?? 'unknown'));
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: 'install-record',
|
|
65
|
+
group: 'Install',
|
|
66
|
+
name: 'Install record',
|
|
67
|
+
applies: managed,
|
|
68
|
+
run: (env) => {
|
|
69
|
+
if (env.record)
|
|
70
|
+
return ok('install.json: ' + env.record.scope + ' install, automatic updates ' + (env.record.autoUpdate ? 'on' : 'off'));
|
|
71
|
+
return {
|
|
72
|
+
status: 'warn',
|
|
73
|
+
detail: 'install.json is missing or cannot be read',
|
|
74
|
+
means: 'Updates and sharing cannot tell how this was installed, so they act as if automatic updates are off.',
|
|
75
|
+
fix: 'Run the installer again over this install (it writes the record and keeps your data).',
|
|
76
|
+
};
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: 'install-pointers',
|
|
81
|
+
group: 'Install',
|
|
82
|
+
name: 'Active version',
|
|
83
|
+
applies: managed,
|
|
84
|
+
run: (env) => {
|
|
85
|
+
const layout = env.layout;
|
|
86
|
+
if (!layout)
|
|
87
|
+
return ok('');
|
|
88
|
+
const state = inspectPointers(layout);
|
|
89
|
+
if (!state.problems.length)
|
|
90
|
+
return ok('version ' + state.activeVersion + ' with Node ' + state.activeNode);
|
|
91
|
+
const base = {
|
|
92
|
+
status: 'needs-you',
|
|
93
|
+
detail: state.problems.join('; '),
|
|
94
|
+
means: 'The sandbox command cannot start until both pointers name an installed version and Node.',
|
|
95
|
+
};
|
|
96
|
+
if (!state.want)
|
|
97
|
+
return {
|
|
98
|
+
...base,
|
|
99
|
+
fix: 'Nothing complete is installed in ' + layout.root + '. Run the installer again.',
|
|
100
|
+
};
|
|
101
|
+
return {
|
|
102
|
+
...base,
|
|
103
|
+
plan: 'point active-version at ' + state.want.version + ' and active-node at ' + state.want.node + ' (installed)',
|
|
104
|
+
};
|
|
105
|
+
},
|
|
106
|
+
fix: (env) => {
|
|
107
|
+
if (!env.layout)
|
|
108
|
+
throw new Error('not a managed install');
|
|
109
|
+
assertTestWritable(env.layout.root);
|
|
110
|
+
return { done: 'pointed at ' + repairPointers(env.layout) };
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
id: 'install-shims',
|
|
115
|
+
group: 'Install',
|
|
116
|
+
name: 'Commands (shims)',
|
|
117
|
+
applies: managed,
|
|
118
|
+
run: (env) => {
|
|
119
|
+
const layout = env.layout;
|
|
120
|
+
const bins = currentBins(env);
|
|
121
|
+
if (!layout || !bins)
|
|
122
|
+
return { status: 'skipped', detail: 'the package.json of the active version cannot be read' };
|
|
123
|
+
const problems = shimProblems(layout, bins);
|
|
124
|
+
const count = Object.keys(bins).length;
|
|
125
|
+
if (!problems.missing.length && !problems.different.length)
|
|
126
|
+
return ok(plural(count, 'command') + ' in ' + layout.binDir + ' read the active version');
|
|
127
|
+
const bad = [
|
|
128
|
+
...problems.missing.map((f) => f + ' (missing)'),
|
|
129
|
+
...problems.different.map((f) => f + ' (out of date)'),
|
|
130
|
+
];
|
|
131
|
+
return {
|
|
132
|
+
status: 'needs-you',
|
|
133
|
+
detail: bad.slice(0, 4).join(', ') + (bad.length > 4 ? ' and ' + (bad.length - 4) + ' more' : ''),
|
|
134
|
+
means: 'Typing sandbox in a terminal may fail or run the wrong version.',
|
|
135
|
+
plan: 'rewrite ' + plural(bad.length, 'command file') + ' in ' + layout.binDir,
|
|
136
|
+
lines: bad,
|
|
137
|
+
};
|
|
138
|
+
},
|
|
139
|
+
fix: (env) => {
|
|
140
|
+
const bins = currentBins(env);
|
|
141
|
+
if (!env.layout || !bins)
|
|
142
|
+
throw new Error('the package.json of the active version cannot be read');
|
|
143
|
+
assertTestWritable(env.layout.binDir);
|
|
144
|
+
writeShims(env.layout, bins);
|
|
145
|
+
return { done: 'rewrote the command files for ' + Object.keys(bins).join(', ') };
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
id: 'install-path',
|
|
150
|
+
group: 'Install',
|
|
151
|
+
name: 'PATH',
|
|
152
|
+
applies: managed,
|
|
153
|
+
timeoutMs: 40_000,
|
|
154
|
+
run: (env) => {
|
|
155
|
+
const layout = env.layout;
|
|
156
|
+
if (!layout)
|
|
157
|
+
return ok('');
|
|
158
|
+
const scope = layout.scope === 'machine' ? 'machine' : 'user';
|
|
159
|
+
const where = scope === 'machine' ? 'the PATH of this PC' : 'your PATH';
|
|
160
|
+
const own = env.system.registryPath(scope);
|
|
161
|
+
if (own === null)
|
|
162
|
+
return { status: 'skipped', detail: 'could not read ' + where };
|
|
163
|
+
if (pathHas(own, layout.binDir))
|
|
164
|
+
return ok(layout.binDir + ' is on ' + where);
|
|
165
|
+
const other = env.system.registryPath(scope === 'machine' ? 'user' : 'machine');
|
|
166
|
+
const base = {
|
|
167
|
+
status: 'needs-you',
|
|
168
|
+
detail: layout.binDir + ' is not on ' + where + (pathHas(other, layout.binDir) ? ' (only on the other one)' : ''),
|
|
169
|
+
means: 'New terminals will not find the sandbox command.',
|
|
170
|
+
};
|
|
171
|
+
if (scope === 'user')
|
|
172
|
+
return { ...base, plan: 'add ' + layout.binDir + ' to your PATH' };
|
|
173
|
+
return {
|
|
174
|
+
...base,
|
|
175
|
+
fix: 'Run the installer again in an admin PowerShell (it adds the folder to the PATH of this PC).',
|
|
176
|
+
};
|
|
177
|
+
},
|
|
178
|
+
fix: (env) => {
|
|
179
|
+
if (!env.layout)
|
|
180
|
+
throw new Error('not a managed install');
|
|
181
|
+
editUserPath(env.layout.binDir, true, env.storageRoot);
|
|
182
|
+
return { done: 'added ' + env.layout.binDir + ' to your PATH (open a new terminal to use it)' };
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
id: 'install-copies',
|
|
187
|
+
group: 'Install',
|
|
188
|
+
name: 'Copies on the PATH',
|
|
189
|
+
timeoutMs: 40_000,
|
|
190
|
+
run: (env) => {
|
|
191
|
+
const machinePath = env.system.registryPath('machine');
|
|
192
|
+
const userPath = env.system.registryPath('user');
|
|
193
|
+
const copies = findCommandCopies({
|
|
194
|
+
machinePath: machinePath ?? (userPath === null ? (process.env.Path ?? null) : null),
|
|
195
|
+
userPath,
|
|
196
|
+
pathext: currentPathext(),
|
|
197
|
+
programFiles: process.env.ProgramFiles ?? null,
|
|
198
|
+
localAppData: process.env.LOCALAPPDATA ?? null,
|
|
199
|
+
exists: fileOnDisk,
|
|
200
|
+
});
|
|
201
|
+
if (!copies.length)
|
|
202
|
+
return ok('no sandbox command is on the PATH of a new terminal');
|
|
203
|
+
const runs = copies.find((c) => c.files.some((f) => f.startsWith('sandbox.'))) ?? copies[0];
|
|
204
|
+
const own = ownBinDir(env.ctx.packageRoot, env.layout?.binDir ?? null);
|
|
205
|
+
const keep = copies.find((c) => c.kind === 'managed-machine' || c.kind === 'managed-user') ?? runs;
|
|
206
|
+
if (copies.length === 1 && (!own || sameFolder(own, runs.dir)))
|
|
207
|
+
return ok('one copy: ' + runs.dir + ' (' + KIND_NAMES[runs.kind] + ')');
|
|
208
|
+
const hidden = copies.filter((c) => c !== keep);
|
|
209
|
+
const wrong = keep !== runs;
|
|
210
|
+
return {
|
|
211
|
+
status: wrong || (own !== null && !sameFolder(own, runs.dir)) ? 'needs-you' : 'warn',
|
|
212
|
+
detail: wrong
|
|
213
|
+
? 'typing sandbox runs ' + runs.dir + ' (' + KIND_NAMES[runs.kind] + '), not ' + keep.dir
|
|
214
|
+
: copies.length + ' copies are on the PATH; ' + runs.dir + ' runs (' + KIND_NAMES[runs.kind] + ')',
|
|
215
|
+
means: wrong
|
|
216
|
+
? 'The install you update is hidden, so its fixes never reach you, and sharing with other users may not work from this copy.'
|
|
217
|
+
: 'The others are never used, and they may be the ones an old shortcut or script starts.',
|
|
218
|
+
fix: 'Remove the copies you do not want (repair never deletes them; run "Get-Command sandbox -All" to list them):',
|
|
219
|
+
lines: hidden.map((c) => c.dir + ': ' + removalCommand(c)),
|
|
220
|
+
};
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
id: 'install-task',
|
|
225
|
+
group: 'Install',
|
|
226
|
+
name: 'Automatic updates',
|
|
227
|
+
applies: machine,
|
|
228
|
+
timeoutMs: 40_000,
|
|
229
|
+
run: (env) => {
|
|
230
|
+
const wanted = env.record?.autoUpdate ?? false;
|
|
231
|
+
const has = env.system.updateTaskExists();
|
|
232
|
+
if (has === null)
|
|
233
|
+
return { status: 'skipped', detail: 'could not ask Windows about the update task' };
|
|
234
|
+
if (has === wanted)
|
|
235
|
+
return ok(wanted ? 'on, and the scheduled task is there' : 'off, and no scheduled task is left');
|
|
236
|
+
const admin = env.system.tokenHasGroup(HIGH_INTEGRITY_SID) === true;
|
|
237
|
+
const command = 'sandbox update --auto ' + (wanted ? 'on' : 'off');
|
|
238
|
+
const base = {
|
|
239
|
+
status: 'needs-you',
|
|
240
|
+
detail: wanted
|
|
241
|
+
? 'automatic updates are on but the scheduled task \\WindowsDevelopmentSandbox\\Update is missing'
|
|
242
|
+
: 'automatic updates are off but the scheduled task is still there',
|
|
243
|
+
means: wanted ? 'No update is installed by itself.' : 'The task keeps trying to update.',
|
|
244
|
+
};
|
|
245
|
+
return admin
|
|
246
|
+
? { ...base, plan: wanted ? 'create the update task' : 'remove the update task' }
|
|
247
|
+
: { ...base, fix: 'Changing it needs admin rights. In an admin terminal run: ' + command };
|
|
248
|
+
},
|
|
249
|
+
fix: (env) => {
|
|
250
|
+
if (!env.layout)
|
|
251
|
+
throw new Error('not a managed install');
|
|
252
|
+
refuseInSelfTest('change scheduled tasks');
|
|
253
|
+
const task = new UpdateTask(env.layout);
|
|
254
|
+
if (env.record?.autoUpdate) {
|
|
255
|
+
task.register();
|
|
256
|
+
return { done: 'created the update task' };
|
|
257
|
+
}
|
|
258
|
+
task.remove();
|
|
259
|
+
return { done: 'removed the update task' };
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
id: 'install-user-leftover',
|
|
264
|
+
group: 'Install',
|
|
265
|
+
name: 'Install for just you',
|
|
266
|
+
applies: (env) => machine(env) && env.userInstallRoot !== null,
|
|
267
|
+
run: (env) => {
|
|
268
|
+
const root = env.userInstallRoot;
|
|
269
|
+
if (!root || !fileExists(path.join(root, 'active-version')))
|
|
270
|
+
return ok('no second install for just you next to this one');
|
|
271
|
+
return {
|
|
272
|
+
status: 'warn',
|
|
273
|
+
detail: 'an install for just you is still in ' + root,
|
|
274
|
+
means: 'Both are on your PATH; whichever comes first runs, and its updates differ from the one for everyone.',
|
|
275
|
+
fix: 'Remove it in PowerShell (your data stays): ' + UNINSTALL + 'CurrentUser',
|
|
276
|
+
};
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
id: 'install-old-npm',
|
|
281
|
+
group: 'Install',
|
|
282
|
+
name: 'npm packages',
|
|
283
|
+
timeoutMs: 90_000,
|
|
284
|
+
run: (env) => {
|
|
285
|
+
const npmCli = path.join(path.dirname(process.execPath), 'node_modules', 'npm', 'bin', 'npm-cli.js');
|
|
286
|
+
if (!fileExists(npmCli))
|
|
287
|
+
return { status: 'skipped', detail: 'npm not found next to this Node (' + npmCli + ')' };
|
|
288
|
+
// cwd = Node's own folder: npm reads .npmrc from the current folder, which could be a sandbox-writable workspace.
|
|
289
|
+
const result = spawnSync(process.execPath, [npmCli, 'ls', '-g', '--json', '--depth=0'], {
|
|
290
|
+
cwd: path.dirname(process.execPath),
|
|
291
|
+
encoding: 'utf8',
|
|
292
|
+
windowsHide: true,
|
|
293
|
+
timeout: 60000,
|
|
294
|
+
maxBuffer: 16 * 1024 * 1024,
|
|
295
|
+
});
|
|
296
|
+
const names = globalPackages(result.stdout ?? '');
|
|
297
|
+
if (!names.length)
|
|
298
|
+
return { status: 'skipped', detail: 'could not read the global npm packages' };
|
|
299
|
+
if (names.includes('agent-sandbox') && names.includes('windows-development-sandbox'))
|
|
300
|
+
return {
|
|
301
|
+
status: 'needs-you',
|
|
302
|
+
detail: 'the old agent-sandbox package is installed next to windows-development-sandbox',
|
|
303
|
+
means: 'Their commands clash, and the one first on PATH runs.',
|
|
304
|
+
fix: 'Run: npm uninstall -g agent-sandbox',
|
|
305
|
+
};
|
|
306
|
+
if (managed(env) && names.includes('windows-development-sandbox'))
|
|
307
|
+
return {
|
|
308
|
+
status: 'warn',
|
|
309
|
+
detail: 'an npm global copy of windows-development-sandbox is installed next to the managed install',
|
|
310
|
+
means: 'Both are on PATH; whichever comes first runs, and only the managed one updates itself.',
|
|
311
|
+
fix: 'Run: npm uninstall -g windows-development-sandbox',
|
|
312
|
+
};
|
|
313
|
+
return ok(names.includes('agent-sandbox')
|
|
314
|
+
? 'agent-sandbox installed (the old name; fine on its own)'
|
|
315
|
+
: 'no old agent-sandbox package');
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
];
|