windows-development-sandbox 1.5.0 → 1.7.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 +17 -1
- package/dist/cli/args.d.ts +13 -2
- package/dist/cli/args.js +95 -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/index.d.ts +1 -0
- package/dist/cli/commands/index.js +1 -0
- 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 +57 -4
- package/dist/cli/commands/launch/prepare.js +3 -1
- 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.d.ts +1 -1
- package/dist/cli/commands/maintenance/config.js +112 -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/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 +7 -0
- 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/data.d.ts +2 -0
- package/dist/cli/commands/repair/checks/data.js +241 -0
- package/dist/cli/commands/repair/checks/index.d.ts +2 -0
- package/dist/cli/commands/repair/checks/index.js +20 -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 +55 -0
- package/dist/cli/commands/repair/checks/sandbox.d.ts +2 -0
- package/dist/cli/commands/repair/checks/sandbox.js +267 -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 +53 -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 +49 -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/list.js +5 -2
- package/dist/cli/commands/sessions/status.d.ts +2 -0
- package/dist/cli/commands/sessions/status.js +27 -6
- package/dist/cli/commands/setup/index.d.ts +5 -0
- package/dist/cli/commands/setup/index.js +25 -1
- 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 +85 -0
- package/dist/cli/commands/storage/storage.d.ts +8 -0
- package/dist/cli/commands/storage/storage.js +171 -0
- package/dist/cli/commands/user-config.js +1 -1
- package/dist/cli/commands/vpn.d.ts +4 -0
- package/dist/cli/commands/vpn.js +75 -0
- package/dist/cli/commands/web.d.ts +4 -0
- package/dist/cli/commands/web.js +95 -0
- package/dist/cli/history.js +1 -1
- package/dist/cli/index.js +46 -3
- package/dist/cli/manifest.d.ts +303 -29
- package/dist/cli/manifest.js +173 -43
- 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 +31 -2
- package/dist/cli/menu/apps.js +44 -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/menu.d.ts +1 -1
- package/dist/cli/menu/menu.js +11 -8
- package/dist/cli/menu/pages/accounts-page.js +55 -24
- package/dist/cli/menu/pages/agents-page.d.ts +66 -0
- package/dist/cli/menu/pages/agents-page.js +338 -0
- package/dist/cli/menu/pages/apps-page.js +1 -2
- package/dist/cli/menu/pages/list-page.d.ts +16 -3
- package/dist/cli/menu/pages/list-page.js +40 -8
- package/dist/cli/menu/pages/maintenance-page.d.ts +9 -0
- package/dist/cli/menu/pages/maintenance-page.js +161 -72
- package/dist/cli/menu/pages/sandbox-page.d.ts +3 -0
- package/dist/cli/menu/pages/sandbox-page.js +132 -43
- package/dist/cli/menu/pages/sessions-page.d.ts +4 -0
- package/dist/cli/menu/pages/sessions-page.js +41 -25
- package/dist/cli/menu/pages/settings-page.d.ts +8 -4
- package/dist/cli/menu/pages/settings-page.js +36 -13
- package/dist/cli/menu/settings/categories.d.ts +2 -0
- package/dist/cli/menu/settings/categories.js +19 -44
- package/dist/cli/menu/settings/collections/collection-editor.d.ts +7 -1
- 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 +11 -1
- package/dist/cli/menu/settings/collections/string-list-editor.js +23 -0
- package/dist/cli/menu/settings/index.d.ts +1 -1
- package/dist/cli/menu/settings/index.js +1 -1
- package/dist/cli/menu/settings/object-editor.d.ts +5 -1
- package/dist/cli/menu/settings/object-editor.js +15 -4
- package/dist/cli/menu/settings/path-kind.d.ts +20 -0
- package/dist/cli/menu/settings/path-kind.js +44 -0
- package/dist/cli/menu/settings/schema-node.d.ts +9 -0
- package/dist/cli/menu/settings/schema-node.js +26 -0
- package/dist/cli/menu/settings/value-editor.d.ts +5 -0
- package/dist/cli/menu/settings/value-editor.js +51 -18
- package/dist/cli/menu/several.js +7 -5
- package/dist/cli/menu/shell.d.ts +37 -10
- package/dist/cli/menu/shell.js +90 -10
- package/dist/cli/menu/vpn-login.d.ts +16 -0
- package/dist/cli/menu/vpn-login.js +66 -0
- package/dist/cli/output/print.d.ts +2 -0
- package/dist/cli/output/print.js +8 -1
- package/dist/cli/services/accounts-service.d.ts +2 -0
- package/dist/cli/services/accounts-service.js +2 -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/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 +6 -3
- package/dist/cli/tui/app.js +12 -5
- 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 +14 -2
- package/dist/cli/tui/list/list-screen.js +68 -32
- package/dist/cli/tui/list/list-types.d.ts +8 -4
- package/dist/cli/tui/nav.d.ts +29 -0
- package/dist/cli/tui/nav.js +67 -0
- 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 +5 -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 +23 -0
- package/dist/core/schema/config.js +10 -1
- package/dist/core/schema/harness.d.ts +1 -0
- package/dist/core/schema/harness.js +8 -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.js +1 -0
- package/dist/core/schema/vpn.d.ts +17 -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 +26 -0
- package/dist/guest/agents/agent-files.d.ts +49 -0
- package/dist/guest/agents/agent-files.js +63 -0
- package/dist/guest/agents/agent-installer.js +2 -9
- package/dist/guest/agents/local-state.d.ts +12 -0
- package/dist/guest/agents/local-state.js +198 -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 +50 -11
- package/dist/guest/daemon/daemon.js +4 -1
- package/dist/guest/daemon/exec.js +2 -1
- package/dist/guest/daemon/idle-shutdown.js +2 -0
- package/dist/guest/daemon/sessions.js +4 -1
- package/dist/guest/entries/agent.d.ts +1 -0
- package/dist/guest/entries/agent.js +10 -0
- package/dist/guest/entries/daemon.js +2 -0
- package/dist/guest/runtime/csc.d.ts +1 -0
- package/dist/guest/runtime/csc.js +1 -0
- package/dist/guest/runtime/secrets.d.ts +12 -0
- package/dist/guest/runtime/secrets.js +63 -0
- 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/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 +126 -0
- package/dist/host/channel/attach.d.ts +3 -1
- package/dist/host/channel/attach.js +1 -1
- package/dist/host/channel/channel.d.ts +7 -0
- package/dist/host/channel/channel.js +26 -2
- 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.js +25 -1
- package/dist/host/launch/session-file.js +4 -1
- package/dist/host/launch/stage.js +1 -1
- 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/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/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/platform.d.ts +2 -0
- package/dist/host/sandbox/platform.js +21 -2
- 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 +93 -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 +11 -2
- 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/history.d.ts +21 -0
- package/dist/host/storage/history.js +49 -0
- package/dist/host/storage/index.d.ts +4 -0
- package/dist/host/storage/index.js +4 -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/root.d.ts +18 -0
- package/dist/host/storage/root.js +77 -0
- package/dist/host/tools/windows-terminal.d.ts +2 -0
- package/dist/host/tools/windows-terminal.js +23 -5
- 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 +17 -0
- package/dist/host/vpn/prepare.js +77 -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 +1 -0
- package/dist/host/web/browser.js +10 -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 +9 -0
- package/dist/host/web/index.js +8 -0
- package/dist/host/web/runner.d.ts +14 -0
- package/dist/host/web/runner.js +45 -0
- package/dist/host/web/server.d.ts +40 -0
- package/dist/host/web/server.js +218 -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 +27614 -0
- package/dist/runtime/daemon.js +1012 -618
- package/dist/runtime/db.js +236 -106
- package/dist/runtime/main.js +1093 -250
- package/dist/runtime/netproxy.js +102 -3
- package/dist/runtime/view.js +102 -3
- 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 +115 -0
- package/dist/selftest/channel.test.js +5 -0
- package/dist/selftest/cli.test.js +34 -4
- package/dist/selftest/credentials.test.d.ts +2 -0
- package/dist/selftest/credentials.test.js +198 -0
- package/dist/selftest/generate.test.js +1 -1
- package/dist/selftest/health.test.d.ts +2 -0
- package/dist/selftest/health.test.js +470 -0
- package/dist/selftest/host-sim.test.js +2 -0
- package/dist/selftest/index.js +19 -0
- package/dist/selftest/layout.test.js +2 -0
- package/dist/selftest/menu-screens.d.ts +7 -0
- package/dist/selftest/menu-screens.js +65 -16
- package/dist/selftest/menu.test.js +574 -21
- 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/fixtures.d.ts +14 -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 +279 -0
- package/dist/selftest/web.test.d.ts +2 -0
- package/dist/selftest/web.test.js +304 -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 +6 -1
- package/dist/shared/channel/run-dir.js +12 -1
- package/dist/shared/channel/schema.d.ts +19 -0
- package/dist/shared/channel/schema.js +11 -0
- package/dist/shared/channel/secrets.d.ts +28 -0
- package/dist/shared/channel/secrets.js +44 -0
- package/dist/shared/vpn/download.d.ts +13 -0
- package/dist/shared/vpn/download.js +14 -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/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 +5 -1
- package/dist/sync/sync-state.d.ts +1 -0
- package/dist/sync/sync-state.js +1 -0
- package/dist/sync/watcher.js +10 -0
- package/dist/web/index.html +13 -0
- package/dist/web/main-CXESL347.js +45 -0
- package/dist/web/main-VLR7DVQ4.css +1 -0
- package/native/csharp/FolderSecurity.cs +29 -0
- package/native/scripts/protect-data.ps1 +29 -0
- package/native/scripts/read-folder-sddl.ps1 +10 -0
- package/native/scripts/set-folder-access.ps1 +49 -7
- 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 +15 -5
- package/sandbox/csharp/EnvBroadcast.cs +33 -0
- package/sandbox/csharp/PathSync.cs +90 -0
- package/sandbox/scripts/install-shell-path.ps1 +73 -0
- package/sandbox/scripts/set-machine-environment.ps1 +37 -4
- package/schemas/config.schema.json +79 -4
- package/schemas/sandbox-config.schema.json +14 -1
- package/dist/cli/commands/repair/checks.d.ts +0 -2
- package/dist/cli/commands/repair/checks.js +0 -246
- 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
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
// `sandbox projects`: which projects a sandbox can open without a restart. Project roots (whole folders of projects),
|
|
2
|
-
// the projects this tool has started before, and projects
|
|
2
|
+
// the projects this tool has started before, and the all-projects and exclude settings. Changes to what is mapped take
|
|
3
3
|
// effect at the next start; a project you start while a sandbox runs joins it when it can (projects.ts in host/).
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import { checkbox } from '@inquirer/prompts';
|
|
6
|
+
import { askChoice } from '../../../core/prompt.js';
|
|
6
7
|
import { fail } from '../../../core/util/index.js';
|
|
7
8
|
import { isSandboxRunning } from '../../../host/sandbox/index.js';
|
|
8
|
-
import { c, pageSizeFor, shortenMiddle, termWidth, printJson, table } from '../../output/index.js';
|
|
9
|
+
import { c, nextStep, pageSizeFor, shortenMiddle, termWidth, printJson, table } from '../../output/index.js';
|
|
9
10
|
import { ProjectsService } from '../../services/index.js';
|
|
10
11
|
const NEXT_START = 'This changes what is mapped from the next start.';
|
|
11
12
|
function runningNote() {
|
|
@@ -18,7 +19,7 @@ function list(ctx, service) {
|
|
|
18
19
|
const rows = listing.projects;
|
|
19
20
|
if (printJson(ctx, { all: listing.all, roots: listing.roots, exclude: listing.exclude, projects: rows }))
|
|
20
21
|
return 0;
|
|
21
|
-
console.log(c.bold('projects
|
|
22
|
+
console.log(c.bold('All projects') +
|
|
22
23
|
': ' +
|
|
23
24
|
(listing.all ? 'on (every project below is mapped at every start, except excluded ones)' : 'off') +
|
|
24
25
|
c.dim(' sandbox projects all on|off'));
|
|
@@ -42,7 +43,7 @@ function list(ctx, service) {
|
|
|
42
43
|
console.log(c.dim('* = this folder. Choose with: sandbox projects choose'));
|
|
43
44
|
return 0;
|
|
44
45
|
}
|
|
45
|
-
/** Ticks the projects mapped at every start (turns projects
|
|
46
|
+
/** Ticks the projects mapped at every start (any ticked turns all-projects on); the rest are excluded. */
|
|
46
47
|
async function choose(service) {
|
|
47
48
|
const rows = service.rows().filter((r) => !r.root);
|
|
48
49
|
if (!rows.length) {
|
|
@@ -65,14 +66,22 @@ async function choose(service) {
|
|
|
65
66
|
console.log(mapped + ' project(s) mapped at every start, ' + excluded + ' excluded. ' + NEXT_START + runningNote());
|
|
66
67
|
return 0;
|
|
67
68
|
}
|
|
69
|
+
/** The folder typed, or one picked from the known projects (or this folder) when it was left out. */
|
|
70
|
+
async function folderOf(service, action, given) {
|
|
71
|
+
if (given)
|
|
72
|
+
return given;
|
|
73
|
+
const rows = service.rows();
|
|
74
|
+
return askChoice('Which folder?', [
|
|
75
|
+
{ name: 'This folder (' + shortenMiddle(process.cwd(), termWidth() - 30) + ')', value: '.' },
|
|
76
|
+
...rows.filter((r) => !r.here).map((r) => ({ name: shortenMiddle(r.folder, termWidth() - 12), value: r.folder })),
|
|
77
|
+
], 'Usage: sandbox projects ' + action + ' <folder> (. = this folder)');
|
|
78
|
+
}
|
|
68
79
|
function add(service, value) {
|
|
69
80
|
const dir = service.add(value);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
(
|
|
74
|
-
? ' ' + NEXT_START
|
|
75
|
-
: ' It is mapped at every start once projects.all is on (sandbox projects all on).'));
|
|
81
|
+
const all = service.settings().all;
|
|
82
|
+
console.log('Added ' + dir + ' to your projects.' + (all ? ' ' + NEXT_START : ''));
|
|
83
|
+
if (!all)
|
|
84
|
+
nextStep('sandbox projects all on (map every project at every start)');
|
|
76
85
|
return 0;
|
|
77
86
|
}
|
|
78
87
|
function remove(service, value) {
|
|
@@ -88,18 +97,18 @@ function includeOrExclude(service, action, value) {
|
|
|
88
97
|
? (action === 'exclude' ? 'Excluded ' : 'Included ') + path.resolve(value) + '. ' + NEXT_START
|
|
89
98
|
: 'Nothing changed.') +
|
|
90
99
|
(action === 'include' && !service.settings().all
|
|
91
|
-
? '
|
|
100
|
+
? ' Mapping all projects is off: sandbox projects all on maps your projects at every start.'
|
|
92
101
|
: '') +
|
|
93
102
|
(changed ? runningNote() : ''));
|
|
94
103
|
return 0;
|
|
95
104
|
}
|
|
96
105
|
function all(service, value) {
|
|
97
106
|
if (value === undefined) {
|
|
98
|
-
console.log('
|
|
107
|
+
console.log('Mapping all projects at every start is ' + (service.settings().all ? 'on' : 'off') + '.');
|
|
99
108
|
return 0;
|
|
100
109
|
}
|
|
101
110
|
service.setAll(value === 'on');
|
|
102
|
-
console.log('
|
|
111
|
+
console.log('Mapping all projects at every start is ' +
|
|
103
112
|
value +
|
|
104
113
|
'. ' +
|
|
105
114
|
NEXT_START +
|
|
@@ -137,17 +146,17 @@ export async function projects(ctx) {
|
|
|
137
146
|
case 'choose':
|
|
138
147
|
return choose(service);
|
|
139
148
|
case 'add':
|
|
140
|
-
return add(service, value);
|
|
149
|
+
return add(service, await folderOf(service, action, value));
|
|
141
150
|
case 'remove':
|
|
142
|
-
return remove(service, value);
|
|
151
|
+
return remove(service, await folderOf(service, action, value));
|
|
143
152
|
case 'include':
|
|
144
153
|
case 'exclude':
|
|
145
|
-
return includeOrExclude(service, action, value);
|
|
154
|
+
return includeOrExclude(service, action, await folderOf(service, action, value));
|
|
146
155
|
case 'all':
|
|
147
156
|
return all(service, value);
|
|
148
157
|
case 'roots':
|
|
149
158
|
return roots(service, value, folder);
|
|
150
159
|
default:
|
|
151
|
-
return fail('Unknown projects action "' + action + '".');
|
|
160
|
+
return fail('Unknown projects action "' + action + '".', 'Use: sandbox projects list | choose | add | remove | include | exclude | all | roots');
|
|
152
161
|
}
|
|
153
162
|
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { launch } from './launch/index.js';
|
|
2
2
|
import { setup } from './setup/index.js';
|
|
3
3
|
import { data } from './data/index.js';
|
|
4
|
+
import { storage } from './storage/index.js';
|
|
4
5
|
import { attach, db, exec, hide, restart, sessions, show, status, stop } from './sessions/index.js';
|
|
5
6
|
import { account } from './accounts.js';
|
|
6
7
|
import { projects } from './projects/index.js';
|
|
7
8
|
import { audit, claudeHost, clean, config, doctor, hostCommand, logs, migrate, sync, watcher, } from './maintenance/index.js';
|
|
8
9
|
import { resume } from './resume.js';
|
|
9
10
|
import { agentCommandsCommand } from './agent-commands.js';
|
|
11
|
+
import { vpn } from './vpn.js';
|
|
12
|
+
import { web, webServer } from './web.js';
|
|
10
13
|
export const HANDLERS = {
|
|
11
14
|
launch: (ctx) => launch(ctx),
|
|
12
15
|
generate: (ctx) => launch(ctx, true),
|
|
@@ -32,7 +35,11 @@ export const HANDLERS = {
|
|
|
32
35
|
migrate: migrate,
|
|
33
36
|
setup: setup,
|
|
34
37
|
data: data,
|
|
38
|
+
storage: storage,
|
|
35
39
|
'host-claude': claudeHost,
|
|
36
40
|
host: hostCommand,
|
|
37
41
|
_watch: watcher,
|
|
42
|
+
vpn: vpn,
|
|
43
|
+
web: web,
|
|
44
|
+
_web: webServer,
|
|
38
45
|
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// Agents: is the default agent one of those configured, and for each agent that keeps a login, is a saved login in
|
|
2
|
+
// use in this data folder. Looks only; logins are never changed here.
|
|
3
|
+
import { errMsg } from '../../../../core/util/index.js';
|
|
4
|
+
import { AccountStore, AgentAccountStore } from '../../../../host/profile/index.js';
|
|
5
|
+
import { ok, plural } from './common.js';
|
|
6
|
+
function rowsOf(env, name, loginFiles) {
|
|
7
|
+
if (name === 'claude')
|
|
8
|
+
return new AccountStore(env.storageRoot).list(env.dataPath);
|
|
9
|
+
return loginFiles ? new AgentAccountStore(env.storageRoot, name, loginFiles).list(env.dataPath) : [];
|
|
10
|
+
}
|
|
11
|
+
export const AGENT_CHECKS = [
|
|
12
|
+
{
|
|
13
|
+
id: 'agents-default',
|
|
14
|
+
group: 'Agents & tools',
|
|
15
|
+
name: 'Default agent',
|
|
16
|
+
run: (env) => {
|
|
17
|
+
const config = env.ctx.loaded.config;
|
|
18
|
+
const name = env.ctx.options.harness ?? config.defaultHarness;
|
|
19
|
+
const harness = config.harnesses[name];
|
|
20
|
+
if (!harness)
|
|
21
|
+
return {
|
|
22
|
+
status: 'needs-you',
|
|
23
|
+
detail: '"' + name + '" is not one of your configured agents (' + Object.keys(config.harnesses).join(', ') + ')',
|
|
24
|
+
means: 'sandbox launch has no agent to start.',
|
|
25
|
+
fix: 'Set defaultHarness in your settings to one of those names (sandbox config path shows the file).',
|
|
26
|
+
};
|
|
27
|
+
return ok(name + ' (' + plural(Object.keys(config.harnesses).length, 'agent') + ' configured)');
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: 'agents-logins',
|
|
32
|
+
group: 'Agents & tools',
|
|
33
|
+
name: 'Agent logins',
|
|
34
|
+
run: (env) => {
|
|
35
|
+
const harnesses = env.ctx.loaded.config.harnesses;
|
|
36
|
+
const lines = [];
|
|
37
|
+
const idle = [];
|
|
38
|
+
for (const [name, harness] of Object.entries(harnesses)) {
|
|
39
|
+
let rows;
|
|
40
|
+
try {
|
|
41
|
+
rows = rowsOf(env, name, harness.home?.loginFiles);
|
|
42
|
+
}
|
|
43
|
+
catch (e) {
|
|
44
|
+
lines.push(name + ': saved logins cannot be read (' + errMsg(e) + ')');
|
|
45
|
+
idle.push(name);
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
if (!rows.length)
|
|
49
|
+
continue;
|
|
50
|
+
const active = rows.find((r) => r.isActive);
|
|
51
|
+
if (active)
|
|
52
|
+
lines.push(name + ': ' + active.name + ' is in use (' + plural(rows.length, 'login') + ' saved)');
|
|
53
|
+
else {
|
|
54
|
+
lines.push(name + ': ' + plural(rows.length, 'login') + ' saved, none in use here');
|
|
55
|
+
idle.push(name);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (!lines.length)
|
|
59
|
+
return ok('no saved logins (sign in inside the sandbox the first time)');
|
|
60
|
+
if (!idle.length)
|
|
61
|
+
return { ...ok(lines.join('; ')) };
|
|
62
|
+
return {
|
|
63
|
+
status: 'warn',
|
|
64
|
+
detail: lines.join('; '),
|
|
65
|
+
means: 'The sandbox starts signed out for ' + idle.join(', ') + ' until you pick a saved login.',
|
|
66
|
+
fix: 'Run: sandbox account use <name>' + (idle[0] === 'claude' ? '' : ' --agent ' + idle[0]),
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Finding, RepairEnv } from '../types.js';
|
|
2
|
+
export declare function ok(detail: string): Finding;
|
|
3
|
+
export declare function rel(root: string, p: string): string;
|
|
4
|
+
/** Throws unless every folder from the data folder's parent down to `p` is real (no link the sandbox made). */
|
|
5
|
+
export declare function guard(env: RepairEnv, p: string): void;
|
|
6
|
+
export declare function plural(n: number, one: string, many?: string): string;
|
|
7
|
+
/** The current Windows user's name (what the group lists, without the domain). */
|
|
8
|
+
export declare function sameUser(account: string, user: string): boolean;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Small helpers the checks share.
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { assertNoLinks } from '../../../../core/util/index.js';
|
|
4
|
+
export function ok(detail) {
|
|
5
|
+
return { status: 'ok', detail };
|
|
6
|
+
}
|
|
7
|
+
export function rel(root, p) {
|
|
8
|
+
return path.relative(root, p) || '.';
|
|
9
|
+
}
|
|
10
|
+
/** Throws unless every folder from the data folder's parent down to `p` is real (no link the sandbox made). */
|
|
11
|
+
export function guard(env, p) {
|
|
12
|
+
assertNoLinks(path.dirname(env.dataPath), p);
|
|
13
|
+
}
|
|
14
|
+
export function plural(n, one, many = one + 's') {
|
|
15
|
+
return n + ' ' + (n === 1 ? one : many);
|
|
16
|
+
}
|
|
17
|
+
/** The current Windows user's name (what the group lists, without the domain). */
|
|
18
|
+
export function sameUser(account, user) {
|
|
19
|
+
const a = account.toLowerCase();
|
|
20
|
+
const u = user.toLowerCase();
|
|
21
|
+
return a === u || a.endsWith('\\' + u);
|
|
22
|
+
}
|
|
@@ -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,20 @@
|
|
|
1
|
+
import { AGENT_CHECKS } from './agents.js';
|
|
2
|
+
import { DATA_CHECKS } from './data.js';
|
|
3
|
+
import { INSTALL_CHECKS } from './install.js';
|
|
4
|
+
import { MACHINE_CHECKS } from './machine.js';
|
|
5
|
+
import { NETWORK_CHECKS } from './network.js';
|
|
6
|
+
import { PC_CHECKS } from './pc.js';
|
|
7
|
+
import { SANDBOX_CHECKS } from './sandbox.js';
|
|
8
|
+
import { SETTINGS_CHECKS } from './settings.js';
|
|
9
|
+
import { VPN_CHECKS } from './vpn.js';
|
|
10
|
+
export const ALL_CHECKS = [
|
|
11
|
+
...PC_CHECKS,
|
|
12
|
+
...INSTALL_CHECKS,
|
|
13
|
+
...MACHINE_CHECKS,
|
|
14
|
+
...DATA_CHECKS,
|
|
15
|
+
...SETTINGS_CHECKS,
|
|
16
|
+
...SANDBOX_CHECKS,
|
|
17
|
+
...AGENT_CHECKS,
|
|
18
|
+
...NETWORK_CHECKS,
|
|
19
|
+
...VPN_CHECKS,
|
|
20
|
+
];
|
|
@@ -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[];
|