windows-development-sandbox 0.0.0-stage → 1.1.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/.sandbox-config.example.json +14 -0
- package/LICENSE +21 -0
- package/README.md +94 -2
- package/config.example.json +349 -0
- package/dist/api.d.ts +31 -0
- package/dist/api.js +31 -0
- package/dist/bin/agent-sandbox.d.ts +2 -0
- package/dist/bin/agent-sandbox.js +3 -0
- package/dist/bin/claude-host.d.ts +2 -0
- package/dist/bin/claude-host.js +5 -0
- package/dist/bin/claude-sbx.d.ts +2 -0
- package/dist/bin/claude-sbx.js +3 -0
- package/dist/bin/codex-sbx.d.ts +2 -0
- package/dist/bin/codex-sbx.js +3 -0
- package/dist/bin/gemini-sbx.d.ts +2 -0
- package/dist/bin/gemini-sbx.js +3 -0
- package/dist/bin/sandbox.d.ts +2 -0
- package/dist/bin/sandbox.js +4 -0
- package/dist/bin/sbx-hide.d.ts +2 -0
- package/dist/bin/sbx-hide.js +3 -0
- package/dist/bin/sbx-show.d.ts +2 -0
- package/dist/bin/sbx-show.js +3 -0
- package/dist/cli/args.d.ts +52 -0
- package/dist/cli/args.js +143 -0
- package/dist/cli/colors.d.ts +24 -0
- package/dist/cli/colors.js +42 -0
- package/dist/cli/commands/accounts.d.ts +2 -0
- package/dist/cli/commands/accounts.js +52 -0
- package/dist/cli/commands/agent-commands.d.ts +6 -0
- package/dist/cli/commands/agent-commands.js +61 -0
- package/dist/cli/commands/context.d.ts +23 -0
- package/dist/cli/commands/context.js +57 -0
- package/dist/cli/commands/data/clean.d.ts +15 -0
- package/dist/cli/commands/data/clean.js +101 -0
- package/dist/cli/commands/data/collect.d.ts +11 -0
- package/dist/cli/commands/data/collect.js +54 -0
- package/dist/cli/commands/data/index.d.ts +4 -0
- package/dist/cli/commands/data/index.js +45 -0
- package/dist/cli/commands/data/remove.d.ts +2 -0
- package/dist/cli/commands/data/remove.js +30 -0
- package/dist/cli/commands/index.d.ts +10 -0
- package/dist/cli/commands/index.js +10 -0
- package/dist/cli/commands/launch.d.ts +29 -0
- package/dist/cli/commands/launch.js +333 -0
- package/dist/cli/commands/maintenance.d.ts +8 -0
- package/dist/cli/commands/maintenance.js +154 -0
- package/dist/cli/commands/project.d.ts +29 -0
- package/dist/cli/commands/project.js +63 -0
- package/dist/cli/commands/projects.d.ts +14 -0
- package/dist/cli/commands/projects.js +146 -0
- package/dist/cli/commands/repair/checks.d.ts +2 -0
- package/dist/cli/commands/repair/checks.js +170 -0
- package/dist/cli/commands/repair/finders.d.ts +30 -0
- package/dist/cli/commands/repair/finders.js +108 -0
- package/dist/cli/commands/repair/index.d.ts +12 -0
- package/dist/cli/commands/repair/index.js +61 -0
- package/dist/cli/commands/repair/types.d.ts +26 -0
- package/dist/cli/commands/repair/types.js +3 -0
- package/dist/cli/commands/restart.d.ts +6 -0
- package/dist/cli/commands/restart.js +85 -0
- package/dist/cli/commands/sessions.d.ts +12 -0
- package/dist/cli/commands/sessions.js +257 -0
- package/dist/cli/commands/setup/checks.d.ts +13 -0
- package/dist/cli/commands/setup/checks.js +71 -0
- package/dist/cli/commands/setup/facts.d.ts +31 -0
- package/dist/cli/commands/setup/facts.js +60 -0
- package/dist/cli/commands/setup/index.d.ts +2 -0
- package/dist/cli/commands/setup/index.js +43 -0
- package/dist/cli/commands/user-config.d.ts +8 -0
- package/dist/cli/commands/user-config.js +41 -0
- package/dist/cli/history.d.ts +11 -0
- package/dist/cli/history.js +21 -0
- package/dist/cli/index.d.ts +20 -0
- package/dist/cli/index.js +121 -0
- package/dist/cli/manifest.d.ts +103 -0
- package/dist/cli/manifest.js +107 -0
- package/dist/cli/menu-multi.d.ts +12 -0
- package/dist/cli/menu-multi.js +82 -0
- package/dist/cli/menu.d.ts +14 -0
- package/dist/cli/menu.js +290 -0
- package/dist/cli/progress.d.ts +9 -0
- package/dist/cli/progress.js +49 -0
- package/dist/cli/settings/edit.d.ts +13 -0
- package/dist/cli/settings/edit.js +19 -0
- package/dist/cli/settings/index.d.ts +8 -0
- package/dist/cli/settings/index.js +131 -0
- package/dist/cli/settings/prompts.d.ts +7 -0
- package/dist/cli/settings/prompts.js +48 -0
- package/dist/cli/settings/schema.d.ts +33 -0
- package/dist/cli/settings/schema.js +29 -0
- package/dist/cli/validate.d.ts +17 -0
- package/dist/cli/validate.js +89 -0
- package/dist/core/config.d.ts +17 -0
- package/dist/core/config.js +106 -0
- package/dist/core/detect-databases.d.ts +15 -0
- package/dist/core/detect-databases.js +147 -0
- package/dist/core/detect-pwsh.d.ts +18 -0
- package/dist/core/detect-pwsh.js +111 -0
- package/dist/core/detect-toolchains.d.ts +30 -0
- package/dist/core/detect-toolchains.js +58 -0
- package/dist/core/disk.d.ts +16 -0
- package/dist/core/disk.js +55 -0
- package/dist/core/local-config.d.ts +20 -0
- package/dist/core/local-config.js +77 -0
- package/dist/core/project-policy.d.ts +15 -0
- package/dist/core/project-policy.js +35 -0
- package/dist/core/prompt.d.ts +4 -0
- package/dist/core/prompt.js +15 -0
- package/dist/core/safe-paths.d.ts +4 -0
- package/dist/core/safe-paths.js +37 -0
- package/dist/core/schema/common.d.ts +17 -0
- package/dist/core/schema/common.js +15 -0
- package/dist/core/schema/config.d.ts +594 -0
- package/dist/core/schema/config.js +63 -0
- package/dist/core/schema/databases.d.ts +33 -0
- package/dist/core/schema/databases.js +35 -0
- package/dist/core/schema/harness.d.ts +12 -0
- package/dist/core/schema/harness.js +17 -0
- package/dist/core/schema/json-schema.d.ts +5 -0
- package/dist/core/schema/json-schema.js +25 -0
- package/dist/core/schema/profile.d.ts +27 -0
- package/dist/core/schema/profile.js +29 -0
- package/dist/core/schema/projects.d.ts +9 -0
- package/dist/core/schema/projects.js +11 -0
- package/dist/core/schema/sandbox.d.ts +50 -0
- package/dist/core/schema/sandbox.js +36 -0
- package/dist/core/schema/toolchains.d.ts +93 -0
- package/dist/core/schema/toolchains.js +83 -0
- package/dist/core/schema.d.ts +6 -0
- package/dist/core/schema.js +8 -0
- package/dist/core/types.d.ts +190 -0
- package/dist/core/types.js +1 -0
- package/dist/core/util.d.ts +60 -0
- package/dist/core/util.js +154 -0
- package/dist/core/workspace.d.ts +18 -0
- package/dist/core/workspace.js +128 -0
- package/dist/guest/boot-env.d.ts +4 -0
- package/dist/guest/boot-env.js +25 -0
- package/dist/guest/cmdline.d.ts +12 -0
- package/dist/guest/cmdline.js +23 -0
- package/dist/guest/daemon/exec.d.ts +5 -0
- package/dist/guest/daemon/exec.js +32 -0
- package/dist/guest/daemon/project.d.ts +14 -0
- package/dist/guest/daemon/project.js +132 -0
- package/dist/guest/daemon/session.d.ts +13 -0
- package/dist/guest/daemon/session.js +139 -0
- package/dist/guest/daemon/shutdown.d.ts +1 -0
- package/dist/guest/daemon/shutdown.js +21 -0
- package/dist/guest/daemon/state.d.ts +17 -0
- package/dist/guest/daemon/state.js +31 -0
- package/dist/guest/daemon.d.ts +1 -0
- package/dist/guest/daemon.js +53 -0
- package/dist/guest/db.d.ts +1 -0
- package/dist/guest/db.js +75 -0
- package/dist/guest/env.d.ts +51 -0
- package/dist/guest/env.js +101 -0
- package/dist/guest/gitguard.d.ts +7 -0
- package/dist/guest/gitguard.js +60 -0
- package/dist/guest/gitrules.d.ts +2 -0
- package/dist/guest/gitrules.js +11 -0
- package/dist/guest/guide.d.ts +16 -0
- package/dist/guest/guide.js +69 -0
- package/dist/guest/helpers.d.ts +3 -0
- package/dist/guest/helpers.js +26 -0
- package/dist/guest/main.d.ts +1 -0
- package/dist/guest/main.js +130 -0
- package/dist/guest/ports.d.ts +6 -0
- package/dist/guest/ports.js +22 -0
- package/dist/guest/project-context.d.ts +7 -0
- package/dist/guest/project-context.js +10 -0
- package/dist/guest/project-env.d.ts +20 -0
- package/dist/guest/project-env.js +20 -0
- package/dist/guest/project-status.d.ts +5 -0
- package/dist/guest/project-status.js +17 -0
- package/dist/guest/ptyhost.d.ts +22 -0
- package/dist/guest/ptyhost.js +36 -0
- package/dist/guest/setup/agents.d.ts +11 -0
- package/dist/guest/setup/agents.js +87 -0
- package/dist/guest/setup/claude.d.ts +21 -0
- package/dist/guest/setup/claude.js +146 -0
- package/dist/guest/setup/environment.d.ts +16 -0
- package/dist/guest/setup/environment.js +69 -0
- package/dist/guest/setup/hooks.d.ts +9 -0
- package/dist/guest/setup/hooks.js +50 -0
- package/dist/guest/setup/network.d.ts +10 -0
- package/dist/guest/setup/network.js +99 -0
- package/dist/guest/setup/policy.d.ts +3 -0
- package/dist/guest/setup/policy.js +18 -0
- package/dist/guest/setup/user.d.ts +7 -0
- package/dist/guest/setup/user.js +47 -0
- package/dist/guest/toolchains/catalogue.d.ts +55 -0
- package/dist/guest/toolchains/catalogue.js +31 -0
- package/dist/guest/toolchains/cli.d.ts +10 -0
- package/dist/guest/toolchains/cli.js +72 -0
- package/dist/guest/toolchains/common.d.ts +54 -0
- package/dist/guest/toolchains/common.js +147 -0
- package/dist/guest/toolchains/databases/dynamodb.d.ts +8 -0
- package/dist/guest/toolchains/databases/dynamodb.js +52 -0
- package/dist/guest/toolchains/databases/index.d.ts +6 -0
- package/dist/guest/toolchains/databases/index.js +62 -0
- package/dist/guest/toolchains/databases/mongodb.d.ts +3 -0
- package/dist/guest/toolchains/databases/mongodb.js +31 -0
- package/dist/guest/toolchains/databases/mysql.d.ts +3 -0
- package/dist/guest/toolchains/databases/mysql.js +38 -0
- package/dist/guest/toolchains/databases/postgres.d.ts +5 -0
- package/dist/guest/toolchains/databases/postgres.js +38 -0
- package/dist/guest/toolchains/databases/redis.d.ts +3 -0
- package/dist/guest/toolchains/databases/redis.js +16 -0
- package/dist/guest/toolchains/databases/server.d.ts +14 -0
- package/dist/guest/toolchains/databases/server.js +52 -0
- package/dist/guest/toolchains/git.d.ts +3 -0
- package/dist/guest/toolchains/git.js +121 -0
- package/dist/guest/toolchains/go.d.ts +3 -0
- package/dist/guest/toolchains/go.js +33 -0
- package/dist/guest/toolchains/index.d.ts +17 -0
- package/dist/guest/toolchains/index.js +80 -0
- package/dist/guest/toolchains/java.d.ts +8 -0
- package/dist/guest/toolchains/java.js +96 -0
- package/dist/guest/toolchains/leftovers.d.ts +2 -0
- package/dist/guest/toolchains/leftovers.js +26 -0
- package/dist/guest/toolchains/managers.d.ts +16 -0
- package/dist/guest/toolchains/managers.js +84 -0
- package/dist/guest/toolchains/native/binstall.d.ts +7 -0
- package/dist/guest/toolchains/native/binstall.js +52 -0
- package/dist/guest/toolchains/native/cpp.d.ts +4 -0
- package/dist/guest/toolchains/native/cpp.js +38 -0
- package/dist/guest/toolchains/native/dotnet.d.ts +4 -0
- package/dist/guest/toolchains/native/dotnet.js +103 -0
- package/dist/guest/toolchains/native/mesa.d.ts +7 -0
- package/dist/guest/toolchains/native/mesa.js +46 -0
- package/dist/guest/toolchains/native/msvc/environment.d.ts +16 -0
- package/dist/guest/toolchains/native/msvc/environment.js +57 -0
- package/dist/guest/toolchains/native/msvc/index.d.ts +6 -0
- package/dist/guest/toolchains/native/msvc/index.js +48 -0
- package/dist/guest/toolchains/native/msvc/packages.d.ts +6 -0
- package/dist/guest/toolchains/native/msvc/packages.js +156 -0
- package/dist/guest/toolchains/native/msvc/tree.d.ts +15 -0
- package/dist/guest/toolchains/native/msvc/tree.js +21 -0
- package/dist/guest/toolchains/native/rust.d.ts +3 -0
- package/dist/guest/toolchains/native/rust.js +45 -0
- package/dist/guest/toolchains/node.d.ts +3 -0
- package/dist/guest/toolchains/node.js +152 -0
- package/dist/guest/toolchains/plan.d.ts +22 -0
- package/dist/guest/toolchains/plan.js +96 -0
- package/dist/guest/toolchains/pwsh.d.ts +4 -0
- package/dist/guest/toolchains/pwsh.js +14 -0
- package/dist/guest/toolchains/python.d.ts +3 -0
- package/dist/guest/toolchains/python.js +54 -0
- package/dist/guest/toolchains/runtimes.d.ts +19 -0
- package/dist/guest/toolchains/runtimes.js +38 -0
- package/dist/guest/toolchains/scripting/php.d.ts +3 -0
- package/dist/guest/toolchains/scripting/php.js +71 -0
- package/dist/guest/toolchains/scripting/ruby.d.ts +3 -0
- package/dist/guest/toolchains/scripting/ruby.js +47 -0
- package/dist/guest/toolchains/scripting/vcruntime.d.ts +7 -0
- package/dist/guest/toolchains/scripting/vcruntime.js +45 -0
- package/dist/guest/toolchains/versions.d.ts +47 -0
- package/dist/guest/toolchains/versions.js +77 -0
- package/dist/guest/toolchains/vscode.d.ts +2 -0
- package/dist/guest/toolchains/vscode.js +53 -0
- package/dist/guest/view.d.ts +1 -0
- package/dist/guest/view.js +42 -0
- package/dist/host/accounts.d.ts +32 -0
- package/dist/host/accounts.js +128 -0
- package/dist/host/agent-commands.d.ts +25 -0
- package/dist/host/agent-commands.js +145 -0
- package/dist/host/attach.d.ts +17 -0
- package/dist/host/attach.js +69 -0
- package/dist/host/channel.d.ts +38 -0
- package/dist/host/channel.js +162 -0
- package/dist/host/claude-profile.d.ts +15 -0
- package/dist/host/claude-profile.js +107 -0
- package/dist/host/cleanup.d.ts +23 -0
- package/dist/host/cleanup.js +57 -0
- package/dist/host/database-plan.d.ts +12 -0
- package/dist/host/database-plan.js +52 -0
- package/dist/host/generate.d.ts +7 -0
- package/dist/host/generate.js +98 -0
- package/dist/host/join.d.ts +28 -0
- package/dist/host/join.js +76 -0
- package/dist/host/launch/mappings.d.ts +3 -0
- package/dist/host/launch/mappings.js +50 -0
- package/dist/host/launch/projects.d.ts +15 -0
- package/dist/host/launch/projects.js +56 -0
- package/dist/host/launch/stage.d.ts +11 -0
- package/dist/host/launch/stage.js +66 -0
- package/dist/host/launch/wsb.d.ts +10 -0
- package/dist/host/launch/wsb.js +34 -0
- package/dist/host/pc-scan.d.ts +6 -0
- package/dist/host/pc-scan.js +37 -0
- package/dist/host/personalize.d.ts +10 -0
- package/dist/host/personalize.js +97 -0
- package/dist/host/platform.d.ts +19 -0
- package/dist/host/platform.js +126 -0
- package/dist/host/project-scan.d.ts +7 -0
- package/dist/host/project-scan.js +89 -0
- package/dist/host/projects.d.ts +100 -0
- package/dist/host/projects.js +147 -0
- package/dist/host/repo-guard.d.ts +36 -0
- package/dist/host/repo-guard.js +219 -0
- package/dist/host/secrets.d.ts +14 -0
- package/dist/host/secrets.js +133 -0
- package/dist/host/terminal.d.ts +32 -0
- package/dist/host/terminal.js +130 -0
- package/dist/host/test-guard.d.ts +6 -0
- package/dist/host/test-guard.js +15 -0
- package/dist/host/window.d.ts +4 -0
- package/dist/host/window.js +72 -0
- package/dist/host/wsb.d.ts +37 -0
- package/dist/host/wsb.js +101 -0
- package/dist/runtime/daemon.js +28494 -0
- package/dist/runtime/db.js +26387 -0
- package/dist/runtime/gitguard.js +84 -0
- package/dist/runtime/main.js +28622 -0
- package/dist/runtime/view.js +25841 -0
- package/dist/selftest/accounts.test.d.ts +2 -0
- package/dist/selftest/accounts.test.js +44 -0
- package/dist/selftest/agent-commands.test.d.ts +2 -0
- package/dist/selftest/agent-commands.test.js +47 -0
- package/dist/selftest/channel.test.d.ts +2 -0
- package/dist/selftest/channel.test.js +37 -0
- package/dist/selftest/cli.test.d.ts +2 -0
- package/dist/selftest/cli.test.js +118 -0
- package/dist/selftest/cmdline.test.d.ts +2 -0
- package/dist/selftest/cmdline.test.js +45 -0
- package/dist/selftest/config.test.d.ts +2 -0
- package/dist/selftest/config.test.js +38 -0
- package/dist/selftest/data.test.d.ts +2 -0
- package/dist/selftest/data.test.js +80 -0
- package/dist/selftest/detect.test.d.ts +2 -0
- package/dist/selftest/detect.test.js +58 -0
- package/dist/selftest/fixtures.d.ts +272 -0
- package/dist/selftest/fixtures.js +80 -0
- package/dist/selftest/generate.test.d.ts +2 -0
- package/dist/selftest/generate.test.js +63 -0
- package/dist/selftest/git-access.test.d.ts +2 -0
- package/dist/selftest/git-access.test.js +26 -0
- package/dist/selftest/guest-boot.test.d.ts +2 -0
- package/dist/selftest/guest-boot.test.js +76 -0
- package/dist/selftest/harness.d.ts +51 -0
- package/dist/selftest/harness.js +77 -0
- package/dist/selftest/host-sim.test.d.ts +2 -0
- package/dist/selftest/host-sim.test.js +93 -0
- package/dist/selftest/hostile-input.test.d.ts +2 -0
- package/dist/selftest/hostile-input.test.js +54 -0
- package/dist/selftest/index.d.ts +8 -0
- package/dist/selftest/index.js +155 -0
- package/dist/selftest/links.test.d.ts +2 -0
- package/dist/selftest/links.test.js +50 -0
- package/dist/selftest/live-daemon.test.d.ts +2 -0
- package/dist/selftest/live-daemon.test.js +91 -0
- package/dist/selftest/live-git.test.d.ts +2 -0
- package/dist/selftest/live-git.test.js +60 -0
- package/dist/selftest/live-projects.test.d.ts +2 -0
- package/dist/selftest/live-projects.test.js +127 -0
- package/dist/selftest/live.d.ts +65 -0
- package/dist/selftest/live.js +109 -0
- package/dist/selftest/local-config.test.d.ts +2 -0
- package/dist/selftest/local-config.test.js +107 -0
- package/dist/selftest/mirror.test.d.ts +2 -0
- package/dist/selftest/mirror.test.js +101 -0
- package/dist/selftest/network.test.d.ts +2 -0
- package/dist/selftest/network.test.js +28 -0
- package/dist/selftest/personalization.test.d.ts +2 -0
- package/dist/selftest/personalization.test.js +53 -0
- package/dist/selftest/projects.test.d.ts +2 -0
- package/dist/selftest/projects.test.js +254 -0
- package/dist/selftest/repair.test.d.ts +2 -0
- package/dist/selftest/repair.test.js +42 -0
- package/dist/selftest/repo-guard.test.d.ts +2 -0
- package/dist/selftest/repo-guard.test.js +63 -0
- package/dist/selftest/secrets.test.d.ts +2 -0
- package/dist/selftest/secrets.test.js +71 -0
- package/dist/selftest/setup.test.d.ts +2 -0
- package/dist/selftest/setup.test.js +46 -0
- package/dist/selftest/suite.d.ts +13 -0
- package/dist/selftest/suite.js +1 -0
- package/dist/selftest/sync.test.d.ts +2 -0
- package/dist/selftest/sync.test.js +94 -0
- package/dist/selftest/test-guard.test.d.ts +2 -0
- package/dist/selftest/test-guard.test.js +49 -0
- package/dist/selftest/toolchains.test.d.ts +2 -0
- package/dist/selftest/toolchains.test.js +103 -0
- package/dist/selftest/workspace.test.d.ts +2 -0
- package/dist/selftest/workspace.test.js +53 -0
- package/dist/shared/download.d.ts +60 -0
- package/dist/shared/download.js +215 -0
- package/dist/shared/guest-paths.d.ts +30 -0
- package/dist/shared/guest-paths.js +61 -0
- package/dist/shared/netrules.d.ts +18 -0
- package/dist/shared/netrules.js +98 -0
- package/dist/shared/paths.d.ts +14 -0
- package/dist/shared/paths.js +28 -0
- package/dist/shared/projects.d.ts +53 -0
- package/dist/shared/projects.js +67 -0
- package/dist/shared/pty-client.d.ts +86 -0
- package/dist/shared/pty-client.js +227 -0
- package/dist/shared/rundir.d.ts +39 -0
- package/dist/shared/rundir.js +94 -0
- package/dist/shared/safe-remove.d.ts +10 -0
- package/dist/shared/safe-remove.js +66 -0
- package/dist/shared/schema.d.ts +527 -0
- package/dist/shared/schema.js +90 -0
- package/dist/shared/system.d.ts +15 -0
- package/dist/shared/system.js +19 -0
- package/dist/shared/test-guard.d.ts +4 -0
- package/dist/shared/test-guard.js +37 -0
- package/dist/sync/claude-mem.d.ts +8 -0
- package/dist/sync/claude-mem.js +79 -0
- package/dist/sync/history.d.ts +41 -0
- package/dist/sync/history.js +161 -0
- package/dist/sync/watcher.d.ts +21 -0
- package/dist/sync/watcher.js +135 -0
- package/hooks/post-agent/README.txt +1 -0
- package/hooks/pre-provision/README.txt +1 -0
- package/package.json +91 -4
- package/sandbox/bootstrap.ps1 +258 -0
- package/sandbox/cpucap.ps1 +51 -0
- package/sandbox/gitshim.cs +35 -0
- package/sandbox/logon.cmd +18 -0
- package/sandbox/openssl.cs +42 -0
- package/sandbox/ptyhost.cs +614 -0
- package/sandbox/trust.cmd +35 -0
- package/sandbox/vswhere.cs +83 -0
- package/schemas/config.schema.json +1161 -0
- package/schemas/sandbox-config.schema.json +968 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// `sandbox data`: what persists between sandboxes (toolchains, databases, agent state, logs, host storage) and
|
|
2
|
+
// removing chosen parts of it. Everything under the data folder is sandbox-writable: sizes and deletes never follow
|
|
3
|
+
// links, and targets resolve strictly inside the data folder.
|
|
4
|
+
import _ from 'lodash';
|
|
5
|
+
import { diskUsage, humanBytes } from '../../../core/disk.js';
|
|
6
|
+
import { fail } from '../../../core/util.js';
|
|
7
|
+
import { printJson, table } from '../context.js';
|
|
8
|
+
import { working } from '../../progress.js';
|
|
9
|
+
import { dataClean } from './clean.js';
|
|
10
|
+
import { collectDataEntries } from './collect.js';
|
|
11
|
+
const AREA_LABEL = { tools: 'Toolchains', databases: 'Databases', state: 'Agent state', logs: 'Logs', data: 'Other', host: 'On this PC' };
|
|
12
|
+
export const dataInfo = async (ctx) => {
|
|
13
|
+
const entries = await working('Measuring the saved data (big folders take a moment)', () => collectDataEntries(ctx.dataPath, ctx.storageRoot), !ctx.options.json);
|
|
14
|
+
const total = _.sumBy(entries, 'bytes');
|
|
15
|
+
const disks = diskUsage(ctx.storageRoot);
|
|
16
|
+
if (printJson(ctx, { dataPath: ctx.dataPath, storageRoot: ctx.storageRoot, totalBytes: total, entries, disks }))
|
|
17
|
+
return 0;
|
|
18
|
+
console.log('Disks\n');
|
|
19
|
+
table([['DRIVE', 'USED', 'FREE', 'SIZE', ''], ...disks.map((d) => [d.drive, humanBytes(d.usedBytes) + ' (' + Math.round((d.usedBytes / d.totalBytes) * 100) + '%)', humanBytes(d.freeBytes), humanBytes(d.totalBytes), d.holdsStorage ? '<- sandbox storage (' + humanBytes(total) + ' of it)' : ''])]);
|
|
20
|
+
console.log('');
|
|
21
|
+
console.log('Persistent data for the sandbox: ' + ctx.dataPath + ' (C:\\AgentData inside)\n');
|
|
22
|
+
if (!entries.length) {
|
|
23
|
+
console.log('Nothing stored yet. Toolchains, databases and agent logins appear here after the first start.');
|
|
24
|
+
return 0;
|
|
25
|
+
}
|
|
26
|
+
const rows = _.flatMap(_.groupBy(entries, 'area'), (group, area) => [
|
|
27
|
+
[AREA_LABEL[area], humanBytes(_.sumBy(group, 'bytes')), ''],
|
|
28
|
+
...group.map((e) => [' ' + e.name, humanBytes(e.bytes), e.path]),
|
|
29
|
+
]);
|
|
30
|
+
table([...rows, ['', '', ''], ['Total', humanBytes(total), '']]);
|
|
31
|
+
console.log('\nFree space with: sandbox data clean <target...> (e.g. tools/go, databases/postgres-18, logs, launches)');
|
|
32
|
+
return 0;
|
|
33
|
+
};
|
|
34
|
+
/** `sandbox data [info|clean] [targets...]`. */
|
|
35
|
+
export const data = (ctx) => {
|
|
36
|
+
const [action = 'info'] = ctx.options.positionals;
|
|
37
|
+
switch (action) {
|
|
38
|
+
case 'info':
|
|
39
|
+
case 'show':
|
|
40
|
+
case 'list': return dataInfo(ctx);
|
|
41
|
+
case 'clean':
|
|
42
|
+
case 'remove': return dataClean(ctx);
|
|
43
|
+
default: return fail('Unknown data action "' + action + '".', 'Use: sandbox data (what is stored) or sandbox data clean <target...>');
|
|
44
|
+
}
|
|
45
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Deleting inside the data folder. The sandbox can write there, so links are removed themselves and never followed.
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { dirExists, isLink, removeLink } from '../../../core/util.js';
|
|
5
|
+
import { removeRefusal, safeRemove } from '../../../shared/safe-remove.js';
|
|
6
|
+
/** Deletes p (strictly inside root): links inside are removed first and never followed; see shared/safe-remove.ts. */
|
|
7
|
+
export const removeTree = (p, root) => {
|
|
8
|
+
const unlinkInside = (dir) => {
|
|
9
|
+
for (const d of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
10
|
+
const child = path.join(dir, d.name);
|
|
11
|
+
if (d.isSymbolicLink() || isLink(child))
|
|
12
|
+
removeLink(child);
|
|
13
|
+
else if (d.isDirectory())
|
|
14
|
+
unlinkInside(child);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
if (isLink(p)) {
|
|
18
|
+
removeLink(p);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (!fs.existsSync(p))
|
|
22
|
+
return;
|
|
23
|
+
// Refused before anything is touched (safeRemove below checks again).
|
|
24
|
+
const refusal = removeRefusal(p, root);
|
|
25
|
+
if (refusal)
|
|
26
|
+
throw new Error('Refusing to delete ' + p + ': ' + refusal);
|
|
27
|
+
if (dirExists(p))
|
|
28
|
+
unlinkInside(p);
|
|
29
|
+
safeRemove(p, root);
|
|
30
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { createContext, type Context } from './context.js';
|
|
2
|
+
export { launch } from './launch.js';
|
|
3
|
+
export { setup } from './setup/index.js';
|
|
4
|
+
export { data } from './data/index.js';
|
|
5
|
+
export { repairCommand } from './repair/index.js';
|
|
6
|
+
export { attach, db, exec, hide, restart, sessions, show, status, stop } from './sessions.js';
|
|
7
|
+
export { account } from './accounts.js';
|
|
8
|
+
export { projects } from './projects.js';
|
|
9
|
+
export { claudeHost, clean, config, doctor, logs, sync, watcher } from './maintenance.js';
|
|
10
|
+
export { agentCommandsCommand, syncAgentCommands } from './agent-commands.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { createContext } from './context.js';
|
|
2
|
+
export { launch } from './launch.js';
|
|
3
|
+
export { setup } from './setup/index.js';
|
|
4
|
+
export { data } from './data/index.js';
|
|
5
|
+
export { repairCommand } from './repair/index.js';
|
|
6
|
+
export { attach, db, exec, hide, restart, sessions, show, status, stop } from './sessions.js';
|
|
7
|
+
export { account } from './accounts.js';
|
|
8
|
+
export { projects } from './projects.js';
|
|
9
|
+
export { claudeHost, clean, config, doctor, logs, sync, watcher } from './maintenance.js';
|
|
10
|
+
export { agentCommandsCommand, syncAgentCommands } from './agent-commands.js';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { attachTerminal } from '../../host/attach.js';
|
|
2
|
+
import type { SandboxStatus } from '../../core/types.js';
|
|
3
|
+
import { type Context } from './context.js';
|
|
4
|
+
import { type Joined } from './project.js';
|
|
5
|
+
/** Attaches this terminal; with attach.autoHide the sandbox window hides meanwhile (best effort, never fails the attach). */
|
|
6
|
+
export declare const attachHere: (ctx: Context, session: Parameters<typeof attachTerminal>[0]) => Promise<number>;
|
|
7
|
+
/** The sandbox writes sandbox.json a few seconds into its boot; a second launch right after the first waits for it. */
|
|
8
|
+
export declare const runningSandboxStatus: (dataPath: string) => Promise<SandboxStatus>;
|
|
9
|
+
/** Waits for the boot with its current step on a spinner (plain lines without a terminal). */
|
|
10
|
+
export declare const waitForBoot: (dataPath: string, launchId: string | null) => Promise<SandboxStatus>;
|
|
11
|
+
/** The running sandbox, once it is ready. */
|
|
12
|
+
export declare const readySandbox: (dataPath: string) => Promise<SandboxStatus>;
|
|
13
|
+
/**
|
|
14
|
+
* Starts (or picks back up) a session in the folder `joined` describes. attach: show it in this terminal.
|
|
15
|
+
* Exported for restart.ts, which reopens the sessions a restart ended.
|
|
16
|
+
*/
|
|
17
|
+
export declare const openSession: (ctx: Context, ready: SandboxStatus, joined: Joined, o: {
|
|
18
|
+
attach: boolean;
|
|
19
|
+
harness?: string;
|
|
20
|
+
args?: string[];
|
|
21
|
+
reuse?: boolean;
|
|
22
|
+
}) => Promise<number>;
|
|
23
|
+
/** A restart that adds a project: map these too, start no session at boot (restart.ts opens them), wait until ready. */
|
|
24
|
+
export interface LaunchExtras {
|
|
25
|
+
extraProjects?: string[];
|
|
26
|
+
autoSession?: boolean;
|
|
27
|
+
waitUntilReady?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export declare const launch: (ctx: Context, generateOnly?: boolean, extras?: LaunchExtras) => Promise<number>;
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
// `launch` / `generate`, and what sandbox claude runs: start a sandbox, or another session in the running one. From a
|
|
2
|
+
// folder the running sandbox does not have yet, the folder joins it (no restart) when it can, and otherwise a
|
|
3
|
+
// restart that adds it is offered (restart.ts).
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import fs from 'node:fs';
|
|
6
|
+
import { select } from '@inquirer/prompts';
|
|
7
|
+
import { activateAccount, activeAccount, defaultAccount } from '../../host/accounts.js';
|
|
8
|
+
import { attachTerminal, findUnwatchedSession } from '../../host/attach.js';
|
|
9
|
+
import { requestSession, resetRunDir, waitForReady, waitForSession } from '../../host/channel.js';
|
|
10
|
+
import { describePrune, pruneStorage } from '../../host/cleanup.js';
|
|
11
|
+
import { generateSandbox } from '../../host/generate.js';
|
|
12
|
+
import { findSecretFiles } from '../../host/secrets.js';
|
|
13
|
+
import { checkRepo, saveRepoSnapshot } from '../../host/repo-guard.js';
|
|
14
|
+
import { assertCanLaunch, insideSandbox, isSandboxRunning, probeHost, spawnDetached, startSandbox } from '../../host/platform.js';
|
|
15
|
+
import { NeedsRestart, rememberProject, startRegistry } from '../../host/projects.js';
|
|
16
|
+
import { ensureTerminal } from '../../host/terminal.js';
|
|
17
|
+
import { hideSandboxWindow, showSandboxWindow } from '../../host/window.js';
|
|
18
|
+
import { readSandboxStatus } from '../../shared/rundir.js';
|
|
19
|
+
import { isWithin } from '../../shared/projects.js';
|
|
20
|
+
import { syncBeforeLaunch, watcherRunning } from '../../sync/watcher.js';
|
|
21
|
+
import { protectionsOf } from '../../core/project-policy.js';
|
|
22
|
+
import { assertSafeMapping, assertSafeWorkspace } from '../../core/safe-paths.js';
|
|
23
|
+
import { errMsg, fail, isRootPath, sleep } from '../../core/util.js';
|
|
24
|
+
import { syncAgentCommands } from './agent-commands.js';
|
|
25
|
+
import { askYesNo } from '../../core/prompt.js';
|
|
26
|
+
import { resolveRun } from '../../core/workspace.js';
|
|
27
|
+
import { c } from '../colors.js';
|
|
28
|
+
import { working } from '../progress.js';
|
|
29
|
+
import { requireOnPc, sandboxAlive, table } from './context.js';
|
|
30
|
+
import _ from 'lodash';
|
|
31
|
+
import { hereDir, joinHere, readyHere } from './project.js';
|
|
32
|
+
import { offerRestart } from './restart.js';
|
|
33
|
+
import { addToList, setSetting } from './user-config.js';
|
|
34
|
+
/** Attaches this terminal; with attach.autoHide the sandbox window hides meanwhile (best effort, never fails the attach). */
|
|
35
|
+
export const attachHere = (ctx, session) => {
|
|
36
|
+
if (ctx.loaded.config.attach.autoHide && !insideSandbox())
|
|
37
|
+
void hideSandboxWindow(ctx.storageRoot, 120).catch(() => false);
|
|
38
|
+
return attachTerminal(session);
|
|
39
|
+
};
|
|
40
|
+
/** Nothing has been installed into this data set yet: the first start downloads every toolchain once. */
|
|
41
|
+
const firstBoot = (dataPath) => !fs.existsSync(path.join(dataPath, 'tools', 'resolved-versions.json'));
|
|
42
|
+
const FIRST_BOOT = 'First start for this storage: the sandbox downloads and installs the toolchains, databases and agent this project needs.\n' +
|
|
43
|
+
'That takes a few minutes, once. Everything is kept, so every later start reuses it and takes seconds.';
|
|
44
|
+
/** The sandbox writes sandbox.json a few seconds into its boot; a second launch right after the first waits for it. */
|
|
45
|
+
export const runningSandboxStatus = async (dataPath) => {
|
|
46
|
+
for (let i = 0; i < 60; i++) {
|
|
47
|
+
const status = readSandboxStatus(dataPath);
|
|
48
|
+
if (status)
|
|
49
|
+
return status;
|
|
50
|
+
await sleep(1000);
|
|
51
|
+
}
|
|
52
|
+
return fail('A Windows Sandbox is running that this tool did not start (or that uses another storage.dataName).', 'Close that sandbox window first, then run sandbox claude again.');
|
|
53
|
+
};
|
|
54
|
+
/** Waits for the boot with its current step on a spinner (plain lines without a terminal). */
|
|
55
|
+
export const waitForBoot = (dataPath, launchId) => {
|
|
56
|
+
let step = 'starting Windows Sandbox';
|
|
57
|
+
return working(() => 'Waiting for the sandbox: ' + step, () => waitForReady(dataPath, launchId, sandboxAlive, (m) => { step = m; }));
|
|
58
|
+
};
|
|
59
|
+
/** The running sandbox, once it is ready. */
|
|
60
|
+
export const readySandbox = async (dataPath) => {
|
|
61
|
+
const status = await runningSandboxStatus(dataPath);
|
|
62
|
+
return status.phase === 'ready' ? status : waitForBoot(dataPath, status.launchId);
|
|
63
|
+
};
|
|
64
|
+
/** Waits for a session to start (its project's setup, the agent's install) with its progress on a spinner. */
|
|
65
|
+
const waitForStart = (ctx, requestId, what) => {
|
|
66
|
+
let step = 'starting';
|
|
67
|
+
return working(() => what + ': ' + step, () => waitForSession(ctx.dataPath, requestId, sandboxAlive, 60 * 60 * 1000, (m) => { step = m; }));
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Starts (or picks back up) a session in the folder `joined` describes. attach: show it in this terminal.
|
|
71
|
+
* Exported for restart.ts, which reopens the sessions a restart ended.
|
|
72
|
+
*/
|
|
73
|
+
export const openSession = async (ctx, ready, joined, o) => {
|
|
74
|
+
const { options, loaded, dataPath } = ctx;
|
|
75
|
+
const cwd = joined.guestDir;
|
|
76
|
+
const harness = o.harness ?? options.harness ?? joined.harness ?? loaded.config.defaultHarness;
|
|
77
|
+
const args = o.args ?? options.passthrough;
|
|
78
|
+
// -t with nothing new for the agent: pick up this folder's session if no terminal on this PC shows it (its tab was
|
|
79
|
+
// closed, or you detached). Someone already attached, --new, or agent arguments: a new session, as before.
|
|
80
|
+
const reuse = (o.reuse ?? true) && o.attach && !options.newSession && args.length === 0 && loaded.config.attach.reuseSession;
|
|
81
|
+
const existing = reuse ? await findUnwatchedSession(dataPath, harness, cwd) : null;
|
|
82
|
+
if (existing) {
|
|
83
|
+
console.log('Reattaching to ' + harness + ' session ' + existing.id + ' in ' + cwd + ' (no other terminal is attached; --new starts another).');
|
|
84
|
+
return attachHere(ctx, existing);
|
|
85
|
+
}
|
|
86
|
+
console.log(joined.spec
|
|
87
|
+
? 'Starting ' + harness + ' for ' + joined.project?.host + ' in the running sandbox (' + cwd + '; the first time sets up what it needs).'
|
|
88
|
+
: 'Sandbox already running: starting another ' + harness + ' session in ' + cwd);
|
|
89
|
+
// The agent's definition goes along: the sandbox may have booted with another agent.
|
|
90
|
+
const harnessSpec = loaded.config.harnesses[harness];
|
|
91
|
+
const requestId = requestSession(dataPath, harness, args, cwd, { ...(joined.spec ? { project: joined.spec } : {}), ...(harnessSpec ? { harnessSpec } : {}) });
|
|
92
|
+
const session = await waitForStart(ctx, requestId, 'Starting ' + harness + ' in ' + cwd);
|
|
93
|
+
if (o.attach)
|
|
94
|
+
return attachHere(ctx, session);
|
|
95
|
+
console.log('Session ' + session.id + ' opened in a new tab inside the sandbox. Attach here with: sandbox attach ' + session.id + (ready.headless ? ' (headless: sbx-show opens the window)' : ''));
|
|
96
|
+
return 0;
|
|
97
|
+
};
|
|
98
|
+
/** The sessions a launch asks for: each --session, else one (the agent, in this folder). */
|
|
99
|
+
const wantedSessions = (ctx) => ctx.options.sessions.length ? ctx.options.sessions : [{ harness: ctx.options.harness, folder: hereDir(ctx) }];
|
|
100
|
+
/** The same command, for one of its sessions (its folder, agent, and the arguments after -- plus its own). */
|
|
101
|
+
const contextFor = (ctx, want) => ({ ...ctx, options: { ...ctx.options, workspace: want.folder, harness: want.harness, sessions: [], passthrough: [...ctx.options.passthrough, ...(want.args ?? [])] } });
|
|
102
|
+
/** Several sessions at once: all requested together (projects set up in parallel), then listed; -t attaches the first. */
|
|
103
|
+
const openSessions = async (ctx, ready, list) => {
|
|
104
|
+
const { dataPath, loaded, options } = ctx;
|
|
105
|
+
const requests = list.map(({ ctx: at, joined }) => {
|
|
106
|
+
const harness = at.options.harness ?? joined.harness ?? loaded.config.defaultHarness;
|
|
107
|
+
const harnessSpec = loaded.config.harnesses[harness];
|
|
108
|
+
const id = requestSession(dataPath, harness, at.options.passthrough, joined.guestDir, { ...(joined.spec ? { project: joined.spec } : {}), ...(harnessSpec ? { harnessSpec } : {}) });
|
|
109
|
+
return { id, harness, folder: at.options.workspace ?? joined.guestDir, cwd: joined.guestDir };
|
|
110
|
+
});
|
|
111
|
+
let started = 0;
|
|
112
|
+
const results = await working(() => 'Starting ' + requests.length + ' sessions (' + started + ' running)', () => Promise.allSettled(requests.map(async (r) => {
|
|
113
|
+
const s = await waitForSession(dataPath, r.id, sandboxAlive, 60 * 60 * 1000, () => undefined);
|
|
114
|
+
started++;
|
|
115
|
+
return s;
|
|
116
|
+
})));
|
|
117
|
+
table([['SESSION', 'AGENT', 'FOLDER', ''], ...requests.map((r, i) => {
|
|
118
|
+
const result = results[i];
|
|
119
|
+
return [r.id, r.harness, r.folder, result.status === 'fulfilled' ? 'running sandbox attach ' + r.id : c.red('FAILED: ' + errMsg(result.reason))];
|
|
120
|
+
})]);
|
|
121
|
+
const first = results.find((r) => r.status === 'fulfilled');
|
|
122
|
+
if (options.terminal && first)
|
|
123
|
+
return attachHere(ctx, first.value);
|
|
124
|
+
if (!first)
|
|
125
|
+
return 1;
|
|
126
|
+
console.log('Each has its own tab inside the sandbox' + (ready.headless ? ' (headless: sbx-show opens the window)' : '') + '. Attach to any of them, from any terminal: sandbox attach');
|
|
127
|
+
return results.every((r) => r.status === 'fulfilled') ? 0 : 1;
|
|
128
|
+
};
|
|
129
|
+
/** A sandbox is already running: open the sessions in it (new tabs inside; optionally attach here). */
|
|
130
|
+
const launchIntoRunning = async (ctx) => {
|
|
131
|
+
const ready = await readySandbox(ctx.dataPath);
|
|
132
|
+
const wants = wantedSessions(ctx);
|
|
133
|
+
// Every folder joins first: when one needs a restart, nothing has been started that the restart would end.
|
|
134
|
+
const joined = [];
|
|
135
|
+
const needs = [];
|
|
136
|
+
for (const want of wants) {
|
|
137
|
+
const at = ctx.options.sessions.length ? contextFor(ctx, want) : ctx;
|
|
138
|
+
try {
|
|
139
|
+
joined.push({ ctx: at, joined: await joinHere(at, ready) });
|
|
140
|
+
}
|
|
141
|
+
catch (e) {
|
|
142
|
+
if (!(e instanceof NeedsRestart))
|
|
143
|
+
throw e;
|
|
144
|
+
if (!needs.some((n) => n.hostDir.toLowerCase() === e.hostDir.toLowerCase()))
|
|
145
|
+
needs.push(e);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (needs.length)
|
|
149
|
+
return offerRestart(ctx, needs, () => launchIntoRunning(ctx));
|
|
150
|
+
for (const note of _.uniq(joined.flatMap((j) => j.joined.notes)))
|
|
151
|
+
console.log(note);
|
|
152
|
+
if (joined.length === 1)
|
|
153
|
+
return openSession(joined[0].ctx, ready, joined[0].joined, { attach: ctx.options.terminal });
|
|
154
|
+
return openSessions(ctx, ready, joined);
|
|
155
|
+
};
|
|
156
|
+
/** `sandbox start` while one runs: this folder joins it (set up, no agent), or a restart that adds it is offered. */
|
|
157
|
+
const startIntoRunning = async (ctx) => {
|
|
158
|
+
const ready = await readySandbox(ctx.dataPath);
|
|
159
|
+
let joined;
|
|
160
|
+
try {
|
|
161
|
+
joined = await readyHere(ctx, ready);
|
|
162
|
+
}
|
|
163
|
+
catch (e) {
|
|
164
|
+
if (e instanceof NeedsRestart)
|
|
165
|
+
return offerRestart(ctx, [e], () => startIntoRunning(ctx));
|
|
166
|
+
throw e;
|
|
167
|
+
}
|
|
168
|
+
const where = joined.spec ? ' This folder is ready in it as ' + joined.guestDir + ' (sbx-shell ' + joined.spec.name + ' opens a terminal there inside).' : '';
|
|
169
|
+
console.log('A sandbox is already running' + (showSandboxWindow(ctx.storageRoot) ? '; its window is in front now.' : '.') + where + ' Start an agent in it with sandbox claude (or sandbox <agent>); stop it with sandbox stop.');
|
|
170
|
+
return 0;
|
|
171
|
+
};
|
|
172
|
+
const syncSummary = (config, dataPath, workspaceHost) => {
|
|
173
|
+
try {
|
|
174
|
+
const s = syncBeforeLaunch(config, dataPath, workspaceHost);
|
|
175
|
+
return s.history + ' file(s) of history in, claude-mem ' + s.claudeMem;
|
|
176
|
+
}
|
|
177
|
+
catch (e) {
|
|
178
|
+
return 'FAILED: ' + errMsg(e);
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* Asked once per parent folder: map it at every start (a project root), so the projects next to this one open in the
|
|
183
|
+
* running sandbox without a restart. The answer is saved to your config.
|
|
184
|
+
*/
|
|
185
|
+
const maybeAddRoot = async (ctx, run) => {
|
|
186
|
+
const { projects } = run.config;
|
|
187
|
+
const parent = path.dirname(run.workspaceHost);
|
|
188
|
+
if (!projects.askToAddRoot || ctx.options.yes || !process.stdin.isTTY || !process.stdout.isTTY)
|
|
189
|
+
return;
|
|
190
|
+
if (projects.roots.some((r) => isWithin(r, run.workspaceHost)) || projects.declinedRoots.some((d) => isWithin(d, parent) && isWithin(parent, d)))
|
|
191
|
+
return;
|
|
192
|
+
if (isRootPath(parent))
|
|
193
|
+
return;
|
|
194
|
+
try {
|
|
195
|
+
assertSafeWorkspace(parent, ctx.packageRoot, run.storageRoot);
|
|
196
|
+
assertSafeMapping(parent, ctx.packageRoot, run.storageRoot);
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
const answer = await select({
|
|
202
|
+
message: 'Map ' + parent + ' at every start, so other projects there (also new ones) open in the running sandbox without a restart? Agents in the sandbox can then see every project in it.',
|
|
203
|
+
choices: [
|
|
204
|
+
{ name: 'Yes, from now on', value: 'yes' },
|
|
205
|
+
{ name: 'No (and do not ask again for this folder)', value: 'no' },
|
|
206
|
+
{ name: 'Never ask this again', value: 'never' },
|
|
207
|
+
],
|
|
208
|
+
});
|
|
209
|
+
if (answer === 'yes') {
|
|
210
|
+
addToList(ctx, ['projects', 'roots'], parent);
|
|
211
|
+
run.config.projects.roots.push(parent);
|
|
212
|
+
console.log('Added ' + parent + ' to projects.roots (sandbox projects roots remove ' + parent + ' undoes it).');
|
|
213
|
+
}
|
|
214
|
+
if (answer === 'no')
|
|
215
|
+
addToList(ctx, ['projects', 'declinedRoots'], parent);
|
|
216
|
+
if (answer === 'never')
|
|
217
|
+
setSetting(ctx, ['projects', 'askToAddRoot'], false);
|
|
218
|
+
};
|
|
219
|
+
/** Everything a real launch does before the sandbox starts (skipped by `generate`, which only writes files). */
|
|
220
|
+
const prepare = async (ctx, run) => {
|
|
221
|
+
const { options, dataPath, storageRoot } = ctx;
|
|
222
|
+
const { config } = run;
|
|
223
|
+
const account = options.account ?? defaultAccount(storageRoot);
|
|
224
|
+
if (account && run.harnessName === 'claude' && account !== activeAccount(dataPath))
|
|
225
|
+
activateAccount(storageRoot, dataPath, account);
|
|
226
|
+
const terminal = config.provisioning.terminal.enabled ? await ensureTerminal(dataPath, config.provisioning.refresh, { pwsh: config.toolchains.pwsh.enabled !== false }) : { exe: null, message: 'disabled' };
|
|
227
|
+
const history = syncSummary(config, dataPath, run.workspaceHost);
|
|
228
|
+
const guarded = checkRepo(dataPath);
|
|
229
|
+
if (guarded.length)
|
|
230
|
+
console.warn(c.yellow('SECURITY: neutralised ' + guarded.length + ' change(s) the last sandbox made that could run code on this PC (see sandbox status).'));
|
|
231
|
+
resetRunDir(dataPath);
|
|
232
|
+
return { account, terminal: terminal.message, history, pruned: describePrune(pruneStorage(storageRoot)) };
|
|
233
|
+
};
|
|
234
|
+
export const launch = async (ctx, generateOnly = false, extras = {}) => {
|
|
235
|
+
const { options, loaded, packageRoot, dataPath, storageRoot } = ctx;
|
|
236
|
+
// attach.auto: an agent started from an interactive terminal attaches it, as with -t.
|
|
237
|
+
if (loaded.config.attach.auto && !options.noAgent && process.stdin.isTTY && process.stdout.isTTY)
|
|
238
|
+
options.terminal = true;
|
|
239
|
+
if (!generateOnly)
|
|
240
|
+
requireOnPc('launch');
|
|
241
|
+
// agentCommands (Beta) follows the config: a setting changed in the file takes effect here too. Never blocks a launch.
|
|
242
|
+
if (!generateOnly) {
|
|
243
|
+
try {
|
|
244
|
+
syncAgentCommands(ctx, loaded.config);
|
|
245
|
+
}
|
|
246
|
+
catch (e) {
|
|
247
|
+
console.warn('Agent commands (Beta): ' + errMsg(e));
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
if (!generateOnly && isSandboxRunning())
|
|
251
|
+
return options.noAgent ? startIntoRunning(ctx) : launchIntoRunning(ctx);
|
|
252
|
+
// Several sessions: the sandbox starts from the first one's folder with the others' folders mapped too, then
|
|
253
|
+
// they all open in it (each project is set up on demand, in parallel). One --session is an ordinary launch.
|
|
254
|
+
const wants = options.sessions;
|
|
255
|
+
if (wants.length === 1)
|
|
256
|
+
return launch(contextFor(ctx, wants[0]), generateOnly, extras);
|
|
257
|
+
if (wants.length > 1) {
|
|
258
|
+
const first = contextFor(ctx, wants[0]);
|
|
259
|
+
const others = _.uniqBy(wants.slice(1).map((w) => w.folder).filter((f) => !isWithin(wants[0].folder, f)), (f) => f.toLowerCase());
|
|
260
|
+
const started = await launch({ ...first, options: { ...first.options, terminal: false } }, generateOnly, { ...extras, extraProjects: [...(extras.extraProjects ?? []), ...others], autoSession: false, waitUntilReady: true });
|
|
261
|
+
return generateOnly || started !== 0 ? started : launchIntoRunning(ctx);
|
|
262
|
+
}
|
|
263
|
+
const run = await resolveRun({
|
|
264
|
+
packageRoot, loaded, cwd: process.cwd(), workspace: options.workspace, harness: options.harness, noAgent: options.noAgent,
|
|
265
|
+
noLocalConfig: options.noLocalConfig, trustConfig: options.trustConfig, scripts: options.scripts, databases: options.databases, headless: options.headless,
|
|
266
|
+
nodeVersion: options.node, pythonVersion: options.python, ask: askYesNo,
|
|
267
|
+
});
|
|
268
|
+
const { config } = run;
|
|
269
|
+
if (!generateOnly)
|
|
270
|
+
assertCanLaunch();
|
|
271
|
+
if (!generateOnly && !extras.extraProjects)
|
|
272
|
+
await maybeAddRoot(ctx, run);
|
|
273
|
+
const prepared = generateOnly ? null : await prepare(ctx, run);
|
|
274
|
+
const generated = generateSandbox({ packageRoot, run, harnessArgs: options.passthrough, probe: probeHost(config, run.harnessName), extraProjects: extras.extraProjects, autoSession: extras.autoSession });
|
|
275
|
+
for (const note of [...run.notes, ...generated.projects.notes])
|
|
276
|
+
console.log(note);
|
|
277
|
+
const secretFiles = config.secrets.warnFiles ? findSecretFiles(run.workspaceHost) : [];
|
|
278
|
+
if (secretFiles.length) {
|
|
279
|
+
const shown = secretFiles.slice(0, 12).join(', ') + (secretFiles.length > 12 ? ', ...' : '');
|
|
280
|
+
console.warn(c.yellow('Heads-up: the agent can read these files in your workspace, which often hold secrets: ' + shown + '. Move real credentials out of the folder (or use test ones). Silence with secrets.warnFiles = false.'));
|
|
281
|
+
}
|
|
282
|
+
const { roots, projects } = generated.projects;
|
|
283
|
+
table([
|
|
284
|
+
['Workspace', run.workspaceHost + ' -> ' + config.guestWorkspace + (config.readOnly ? ' (read-only)' : '')],
|
|
285
|
+
['Agent', run.harnessName + (prepared?.account ? ' (account: ' + prepared.account + ')' : '') + ' Memory: ' + generated.memoryMb + ' MB CPU: ' + (config.sandbox.cpuLimit === 'none' ? 'all' : 'max ' + config.sandbox.cpuLimit + '%') + ' Network: ' + config.sandbox.networking + (config.sandbox.headless ? ' HEADLESS' : '')],
|
|
286
|
+
['Node', run.versions.node.spec + ' (' + run.versions.node.source + ') Python: ' + run.versions.python.spec + ' (' + run.versions.python.source + ')'],
|
|
287
|
+
...(prepared ? [['Terminal', prepared.terminal], ['History', prepared.history], ['Cleanup', prepared.pruned]] : []),
|
|
288
|
+
['Toolchains', Object.entries(generated.toolchains).filter(([, d]) => d.on).map(([name, d]) => name + ' (' + d.reason + ')').join(', ') || 'Node only (nothing else used by this project)'],
|
|
289
|
+
...(generated.databases.length
|
|
290
|
+
? generated.databases.map((d, i) => [i ? '' : 'Databases', d.database + (d.database === 'sqlserver' ? ' (cannot run in the sandbox; use Postgres or SQLite for local work)' : ' on port ' + d.port) + ' because ' + d.reasons[0] + (d.reasons.length > 1 ? ' (+' + (d.reasons.length - 1) + ' more)' : '')])
|
|
291
|
+
: [['Databases', 'none needed (databases.<name>.enabled = true adds one)']]),
|
|
292
|
+
['Desktop', generated.personalization],
|
|
293
|
+
['Claude', generated.profile.staged.length ? generated.profile.staged.join(', ') + (generated.profile.credentials ? ' (INCLUDING YOUR LOGIN)' : '') : 'no settings copied'],
|
|
294
|
+
['Secrets', !config.secrets.strip ? 'NOT stripped (secrets.strip is off)' : generated.profile.secretsRemoved.length ? 'kept on this PC: ' + generated.profile.secretsRemoved.join(', ') + ' (secrets.allow lets one through)' : 'none found in what is copied'],
|
|
295
|
+
...roots.map((r, i) => [i ? '' : 'Project roots', r.host + ' -> ' + r.guest + ' (every project in it opens without a restart)']),
|
|
296
|
+
...projects.map((p, i) => [i ? '' : 'Projects', p.host + ' -> ' + p.guest]),
|
|
297
|
+
...generated.mappings.slice(3).filter((m) => ![...roots, ...projects].some((p) => p.guest === m.guest)).map((m) => [' map ' + (m.readOnly ? 'ro' : 'rw'), m.host + ' -> ' + m.guest]),
|
|
298
|
+
['Generated', generated.wsbPath],
|
|
299
|
+
]);
|
|
300
|
+
if (generateOnly)
|
|
301
|
+
return 0;
|
|
302
|
+
// Every folder the sandbox can write is snapshotted before it starts (the guard compares against this), and the
|
|
303
|
+
// projects it starts with are recorded host-side for the commands that run later.
|
|
304
|
+
saveRepoSnapshot(dataPath, run.workspaceHost, projects.map((p) => p.host), roots.map((r) => r.host));
|
|
305
|
+
startRegistry(storageRoot, { launchId: generated.launchId, protections: protectionsOf(config), primary: { host: run.workspaceHost, guest: config.guestWorkspace }, roots, boot: projects });
|
|
306
|
+
rememberProject(storageRoot, run.workspaceHost);
|
|
307
|
+
startSandbox(generated.wsbPath);
|
|
308
|
+
// Absolute: the watcher runs from another folder, and a relative --config there would make it exit silently.
|
|
309
|
+
if (!watcherRunning(dataPath))
|
|
310
|
+
spawnDetached(ctx.entry, ['_watch', ...(options.config ? ['--config', path.resolve(options.config)] : [])]);
|
|
311
|
+
// Hiding runs alongside; a failure to find the window must never break the launch or an attach.
|
|
312
|
+
const hidden = config.sandbox.headless ? hideSandboxWindow(storageRoot).catch(() => false) : null;
|
|
313
|
+
if (options.terminal || options.noAgent || extras.waitUntilReady) {
|
|
314
|
+
if (firstBoot(dataPath))
|
|
315
|
+
console.log(FIRST_BOOT);
|
|
316
|
+
await waitForBoot(dataPath, generated.launchId);
|
|
317
|
+
if (extras.waitUntilReady)
|
|
318
|
+
return 0;
|
|
319
|
+
// Without an agent there is no session to attach to: the sandbox itself is the result.
|
|
320
|
+
if (options.noAgent) {
|
|
321
|
+
console.log('Sandbox ready. Its window has a terminal in ' + config.guestWorkspace + '; from here: sandbox exec -- <command>, sandbox stop.');
|
|
322
|
+
return 0;
|
|
323
|
+
}
|
|
324
|
+
return attachHere(ctx, await waitForStart(ctx, generated.launchId, 'Starting ' + run.harnessName));
|
|
325
|
+
}
|
|
326
|
+
if (firstBoot(dataPath))
|
|
327
|
+
console.log(FIRST_BOOT);
|
|
328
|
+
if (hidden)
|
|
329
|
+
console.log(await hidden ? 'Sandbox running headless. Open the window: sbx-show Attach here: sandbox claude -t' : 'Could not find the sandbox window to hide (it may still be starting); run sandbox hide in a moment.');
|
|
330
|
+
else
|
|
331
|
+
console.log('Sandbox starting. ' + run.harnessName + ' opens in Windows Terminal inside it. Attach here any time: sandbox claude -t');
|
|
332
|
+
return 0;
|
|
333
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Context } from './context.js';
|
|
2
|
+
export declare const sync: (ctx: Context) => number;
|
|
3
|
+
export declare const logs: (ctx: Context) => Promise<number>;
|
|
4
|
+
export declare const clean: (ctx: Context) => number;
|
|
5
|
+
export declare const config: (ctx: Context) => number;
|
|
6
|
+
export declare const doctor: (ctx: Context) => number;
|
|
7
|
+
export declare const claudeHost: (ctx: Context) => number;
|
|
8
|
+
export declare const watcher: (ctx: Context) => Promise<void>;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
// sync, logs, clean, config, doctor, host-claude and the internal sync watcher.
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { pathToFileURL } from 'node:url';
|
|
5
|
+
import _ from 'lodash';
|
|
6
|
+
import { DEFAULTS, userConfigPath, userDir } from '../../core/config.js';
|
|
7
|
+
import { describeOverrides, isTrusted, LOCAL_CONFIG_NAME, normalizeOverrides, readLocalConfig, trustStorePath } from '../../core/local-config.js';
|
|
8
|
+
import { expandPath, fail, safeText, sleep, writeJson } from '../../core/util.js';
|
|
9
|
+
import { readKnown, readRegistry } from '../../host/projects.js';
|
|
10
|
+
import { detectWsb } from '../../host/wsb.js';
|
|
11
|
+
import { describePrune, pruneStorage } from '../../host/cleanup.js';
|
|
12
|
+
import { doctorRows, hostClaude, insideSandbox, isSandboxRunning } from '../../host/platform.js';
|
|
13
|
+
import { readSandboxStatus } from '../../shared/rundir.js';
|
|
14
|
+
import { syncBack, watch } from '../../sync/watcher.js';
|
|
15
|
+
import { table } from './context.js';
|
|
16
|
+
export const sync = (ctx) => {
|
|
17
|
+
const running = isSandboxRunning();
|
|
18
|
+
const result = syncBack(ctx.dataPath, !running);
|
|
19
|
+
console.log('History: ' + result.history + ' item(s) synced back. claude-mem: ' + result.claudeMem + (running ? ' (claude-mem syncs when the sandbox closes)' : ''));
|
|
20
|
+
return 0;
|
|
21
|
+
};
|
|
22
|
+
const newestLog = (dir) => {
|
|
23
|
+
if (!fs.existsSync(dir))
|
|
24
|
+
return null;
|
|
25
|
+
const logs = fs.readdirSync(dir).filter((f) => /^(guest|daemon|bootstrap)-.*\.log$/.test(f) && fs.lstatSync(path.join(dir, f)).isFile());
|
|
26
|
+
const newest = _.maxBy(logs, (f) => fs.statSync(path.join(dir, f)).mtimeMs);
|
|
27
|
+
return newest ? path.join(dir, newest) : null;
|
|
28
|
+
};
|
|
29
|
+
export const logs = async (ctx) => {
|
|
30
|
+
const dir = path.join(ctx.dataPath, 'logs');
|
|
31
|
+
const file = newestLog(dir) ?? fail('No sandbox logs yet in ' + dir + '.', 'Logs appear after the first start (sandbox claude).');
|
|
32
|
+
console.log('== ' + file + ' ==');
|
|
33
|
+
let printed = 0;
|
|
34
|
+
// The log is written inside the sandbox: read only its tail, and make it safe for your terminal.
|
|
35
|
+
const print = () => {
|
|
36
|
+
const size = fs.statSync(file).size;
|
|
37
|
+
const from = printed === 0 ? Math.max(0, size - 64 * 1024) : printed;
|
|
38
|
+
if (size <= from)
|
|
39
|
+
return;
|
|
40
|
+
const fd = fs.openSync(file, 'r');
|
|
41
|
+
const buffer = Buffer.alloc(Math.min(size - from, 4 * 1024 * 1024));
|
|
42
|
+
fs.readSync(fd, buffer, 0, buffer.length, from);
|
|
43
|
+
fs.closeSync(fd);
|
|
44
|
+
const text = safeText(buffer.toString('utf8'));
|
|
45
|
+
process.stdout.write(printed === 0 ? text.split('\n').slice(-120).join('\n') : text);
|
|
46
|
+
printed = from + buffer.length;
|
|
47
|
+
};
|
|
48
|
+
print();
|
|
49
|
+
if (ctx.options.follow)
|
|
50
|
+
console.error('(following; Ctrl+C to stop)');
|
|
51
|
+
while (ctx.options.follow) {
|
|
52
|
+
await sleep(1000);
|
|
53
|
+
print();
|
|
54
|
+
}
|
|
55
|
+
return 0;
|
|
56
|
+
};
|
|
57
|
+
export const clean = (ctx) => {
|
|
58
|
+
const running = isSandboxRunning() ? readSandboxStatus(ctx.dataPath)?.launchId : undefined;
|
|
59
|
+
console.log('Cleanup: ' + describePrune(pruneStorage(ctx.storageRoot, { launchDays: ctx.options.days, keep: _.compact([running]) })));
|
|
60
|
+
return 0;
|
|
61
|
+
};
|
|
62
|
+
const initConfig = () => {
|
|
63
|
+
const file = userConfigPath();
|
|
64
|
+
if (fs.existsSync(file))
|
|
65
|
+
fail(file + ' already exists.');
|
|
66
|
+
fs.mkdirSync(path.join(userDir(), 'hooks', 'pre-agent'), { recursive: true });
|
|
67
|
+
// The schema sits next to the file (a local path), so editors trust it and show docs and autocomplete.
|
|
68
|
+
writeJson(file, { $schema: './config.schema.json', ...DEFAULTS });
|
|
69
|
+
console.log('Created ' + file + '. It lists every setting with its default; delete the ones you do not change.');
|
|
70
|
+
console.log('Your own hook scripts go in ' + path.join(userDir(), 'hooks') + '\\{pre-provision,pre-agent,post-agent}.');
|
|
71
|
+
console.log('For editor help in every project\'s .sandbox-config.json, run: sandbox config schema');
|
|
72
|
+
return 0;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* VS Code setting that maps every .sandbox-config.json (and the user config) to the local schema files, so project
|
|
76
|
+
* files need no "$schema" line and nothing is fetched from the internet (remote schemas need trusting).
|
|
77
|
+
*/
|
|
78
|
+
const printSchemaSettings = () => {
|
|
79
|
+
const url = (name) => pathToFileURL(path.join(userDir(), name)).href;
|
|
80
|
+
const setting = {
|
|
81
|
+
'json.schemas': [
|
|
82
|
+
{ fileMatch: ['**/.sandbox-config.json'], url: url('sandbox-config.schema.json') },
|
|
83
|
+
{ fileMatch: ['**/.agent-sandbox/config.json'], url: url('config.schema.json') },
|
|
84
|
+
],
|
|
85
|
+
};
|
|
86
|
+
console.log('Add this to your VS Code settings.json (Ctrl+Shift+P > "Preferences: Open User Settings (JSON)"):\n');
|
|
87
|
+
console.log(JSON.stringify(setting, null, 2).slice(2, -2));
|
|
88
|
+
console.log('\nThe schema files live in ' + userDir() + ' and are refreshed whenever the sandbox command runs.');
|
|
89
|
+
return 0;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* `sandbox config check`: the folder's .sandbox-config.json validated and described (risky settings flagged, approval
|
|
93
|
+
* state), without launching. Fails with the same message a launch would give when the file is not valid.
|
|
94
|
+
*/
|
|
95
|
+
const checkLocalConfig = (ctx) => {
|
|
96
|
+
const dir = path.resolve(ctx.options.workspace ?? process.cwd());
|
|
97
|
+
const file = readLocalConfig(dir);
|
|
98
|
+
if (!file) {
|
|
99
|
+
console.log('No ' + LOCAL_CONFIG_NAME + ' in ' + dir + '; the sandbox uses your own settings only.');
|
|
100
|
+
return 0;
|
|
101
|
+
}
|
|
102
|
+
const overrides = normalizeOverrides(file.data, dir, file.path);
|
|
103
|
+
const approved = isTrusted(trustStorePath(ctx.storageRoot), file.path, file.hash);
|
|
104
|
+
console.log(file.path + ': valid. ' + (approved ? 'Approved (this exact version).' : 'Not approved yet: the next launch asks you.') + '\n');
|
|
105
|
+
for (const line of describeOverrides(overrides))
|
|
106
|
+
console.log(' ' + safeText(line));
|
|
107
|
+
return 0;
|
|
108
|
+
};
|
|
109
|
+
export const config = (ctx) => {
|
|
110
|
+
const [action = 'summary'] = ctx.options.positionals;
|
|
111
|
+
switch (action) {
|
|
112
|
+
case 'summary':
|
|
113
|
+
table([
|
|
114
|
+
['Settings file', ctx.loaded.configPath ?? userConfigPath() + ' (does not exist yet; sandbox config init creates it)'],
|
|
115
|
+
['Default agent', ctx.loaded.config.defaultHarness],
|
|
116
|
+
['Storage', ctx.storageRoot],
|
|
117
|
+
['Memory', String(ctx.loaded.config.sandbox.memoryMb) + (ctx.loaded.config.sandbox.memoryMb === 'auto' ? '' : ' MB')],
|
|
118
|
+
]);
|
|
119
|
+
console.log('\nChange settings in the menu (sandbox > Settings). All of them as JSON: sandbox config show');
|
|
120
|
+
return 0;
|
|
121
|
+
case 'path':
|
|
122
|
+
console.log(ctx.loaded.configPath ?? userConfigPath() + ' (does not exist yet)');
|
|
123
|
+
return 0;
|
|
124
|
+
case 'init': return initConfig();
|
|
125
|
+
case 'show':
|
|
126
|
+
console.log(JSON.stringify(ctx.loaded.config, null, 2));
|
|
127
|
+
return 0;
|
|
128
|
+
case 'schema': return printSchemaSettings();
|
|
129
|
+
case 'check': return checkLocalConfig(ctx);
|
|
130
|
+
default: fail('Unknown config action "' + action + '".', 'Use one of: sandbox config show | path | init | schema | check');
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
export const doctor = (ctx) => {
|
|
134
|
+
const rows = doctorRows(ctx.loaded.config, ctx.options.harness ?? ctx.loaded.config.defaultHarness, ctx.storageRoot, ctx.loaded.configPath);
|
|
135
|
+
// Inside a sandbox the feature and "running" rows describe the sandbox itself, and the host rows describe nothing useful.
|
|
136
|
+
if (insideSandbox()) {
|
|
137
|
+
table([['Where', 'inside a Windows Sandbox started by this tool (run doctor on your PC to check the PC)'], ...rows.filter(([name]) => name === 'Config file')]);
|
|
138
|
+
return 0;
|
|
139
|
+
}
|
|
140
|
+
// Several projects: the roots mapped at every start, what the running sandbox has, and whether wsb share is there.
|
|
141
|
+
const p = ctx.loaded.config.projects;
|
|
142
|
+
const registry = isSandboxRunning() ? readRegistry(ctx.storageRoot) : null;
|
|
143
|
+
const wsb = p.wsbShare ? detectWsb() : null;
|
|
144
|
+
table([
|
|
145
|
+
...rows,
|
|
146
|
+
['Project roots', p.roots.length ? p.roots.map((r) => expandPath(r, ctx.loaded.base)).join(', ') : 'none (sandbox projects roots add <folder>)'],
|
|
147
|
+
['All projects', p.all ? 'on: ' + readKnown(ctx.storageRoot).length + ' known project(s) mapped at every start (' + p.exclude.length + ' excluded)' : 'off'],
|
|
148
|
+
['Projects running', registry ? registry.projects.map((x) => x.name + ' (' + x.mechanism + ')').join(', ') : '-'],
|
|
149
|
+
['wsb share', !p.wsbShare ? 'off (projects.wsbShare)' : wsb ? 'available: ' + wsb.exe + (wsb.version ? ' ' + wsb.version : '') + ' (untested; a failure offers a restart instead)' : 'not on this Windows (needs Windows 11 24H2+ with the updated Windows Sandbox): folders outside your roots need a restart'],
|
|
150
|
+
]);
|
|
151
|
+
return 0;
|
|
152
|
+
};
|
|
153
|
+
export const claudeHost = (ctx) => hostClaude(ctx.storageRoot, ctx.options.personal, ctx.options.passthrough);
|
|
154
|
+
export const watcher = (ctx) => watch(ctx.dataPath);
|