windows-development-sandbox 1.10.0 → 1.11.4
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 +64 -17
- package/config.example.json +5 -1
- package/dist/app/features/accounts/accounts.def.d.ts +122 -0
- package/dist/app/features/accounts/accounts.def.js +243 -0
- package/dist/app/features/accounts/accounts.run.d.ts +51 -0
- package/dist/app/features/accounts/accounts.run.js +125 -0
- package/dist/app/features/accounts/index.d.ts +2 -0
- package/dist/app/features/accounts/index.js +3 -0
- package/dist/app/features/agents/agent-entry.d.ts +17 -0
- package/dist/app/features/agents/agent-entry.js +50 -0
- package/dist/app/features/agents/agents.def.d.ts +65 -0
- package/dist/app/features/agents/agents.def.js +142 -0
- package/dist/app/features/agents/agents.run.d.ts +31 -0
- package/dist/app/features/agents/agents.run.js +189 -0
- package/dist/app/features/agents/index.d.ts +3 -0
- package/dist/app/features/agents/index.js +4 -0
- package/dist/app/features/apps/apps-rows.d.ts +31 -0
- package/dist/app/features/apps/apps-rows.js +73 -0
- package/dist/app/features/apps/apps.def.d.ts +181 -0
- package/dist/app/features/apps/apps.def.js +264 -0
- package/dist/app/features/apps/apps.run.d.ts +58 -0
- package/dist/app/features/apps/apps.run.js +76 -0
- package/dist/app/features/apps/index.d.ts +3 -0
- package/dist/app/features/apps/index.js +4 -0
- package/dist/app/features/data/data.def.d.ts +154 -0
- package/dist/app/features/data/data.def.js +194 -0
- package/dist/app/features/data/data.run.d.ts +46 -0
- package/dist/app/features/data/data.run.js +141 -0
- package/dist/app/features/data/index.d.ts +2 -0
- package/dist/app/features/data/index.js +3 -0
- package/dist/app/features/defs.d.ts +959 -4
- package/dist/app/features/defs.js +151 -10
- package/dist/app/features/engine/engine.def.d.ts +228 -0
- package/dist/app/features/engine/engine.def.js +194 -0
- package/dist/app/features/engine/engine.run.d.ts +72 -0
- package/dist/app/features/engine/engine.run.js +77 -0
- package/dist/app/features/engine/index.d.ts +2 -0
- package/dist/app/features/engine/index.js +4 -0
- package/dist/app/features/files/files.def.d.ts +51 -0
- package/dist/app/features/files/files.def.js +38 -0
- package/dist/app/features/files/files.run.d.ts +20 -0
- package/dist/app/features/files/files.run.js +59 -0
- package/dist/app/features/files/index.d.ts +2 -0
- package/dist/app/features/files/index.js +3 -0
- package/dist/app/features/github/github.def.d.ts +80 -0
- package/dist/app/features/github/github.def.js +142 -0
- package/dist/app/features/github/github.run.d.ts +36 -0
- package/dist/app/features/github/github.run.js +59 -0
- package/dist/app/features/github/index.d.ts +2 -0
- package/dist/app/features/github/index.js +3 -0
- package/dist/app/features/health/health.def.d.ts +275 -0
- package/dist/app/features/health/health.def.js +297 -0
- package/dist/app/features/health/health.run.d.ts +125 -0
- package/dist/app/features/health/health.run.js +204 -0
- package/dist/app/features/health/index.d.ts +2 -0
- package/dist/app/features/health/index.js +3 -0
- package/dist/app/features/logs/index.d.ts +2 -0
- package/dist/app/features/logs/index.js +3 -0
- package/dist/app/features/logs/logs.def.d.ts +78 -0
- package/dist/app/features/logs/logs.def.js +115 -0
- package/dist/app/features/logs/logs.run.d.ts +20 -0
- package/dist/app/features/logs/logs.run.js +42 -0
- package/dist/app/features/projects/index.d.ts +2 -0
- package/dist/app/features/projects/index.js +3 -0
- package/dist/app/features/projects/projects.def.d.ts +101 -0
- package/dist/app/features/projects/projects.def.js +208 -0
- package/dist/app/features/projects/projects.run.d.ts +56 -0
- package/dist/app/features/projects/projects.run.js +155 -0
- package/dist/app/features/sandbox/sandbox.def.js +11 -5
- package/dist/app/features/sessions/sessions.def.js +3 -0
- package/dist/app/features/settings/categories.def.js +3 -2
- package/dist/{cli/menu/settings/share.d.ts → app/features/settings/settings-share.d.ts} +1 -1
- package/dist/{cli/menu/settings/share.js → app/features/settings/settings-share.js} +3 -2
- package/dist/app/features/settings/settings.def.d.ts +22 -5
- package/dist/app/features/settings/settings.def.js +81 -6
- package/dist/app/features/settings/settings.run.d.ts +17 -0
- package/dist/app/features/settings/settings.run.js +89 -4
- package/dist/app/features/storage/index.d.ts +2 -0
- package/dist/app/features/storage/index.js +3 -0
- package/dist/app/features/storage/storage.def.d.ts +133 -0
- package/dist/app/features/storage/storage.def.js +220 -0
- package/dist/app/features/storage/storage.run.d.ts +62 -0
- package/dist/app/features/storage/storage.run.js +370 -0
- package/dist/app/features/updates/index.d.ts +3 -0
- package/dist/app/features/updates/index.js +4 -0
- package/dist/app/features/updates/update-lines.d.ts +13 -0
- package/dist/app/features/updates/update-lines.js +61 -0
- package/dist/app/features/updates/updates.def.d.ts +89 -0
- package/dist/app/features/updates/updates.def.js +224 -0
- package/dist/app/features/updates/updates.run.d.ts +48 -0
- package/dist/app/features/updates/updates.run.js +154 -0
- package/dist/app/features/vpn/index.d.ts +2 -0
- package/dist/app/features/vpn/index.js +3 -0
- package/dist/app/features/vpn/vpn.def.d.ts +112 -0
- package/dist/app/features/vpn/vpn.def.js +174 -0
- package/dist/app/features/vpn/vpn.run.d.ts +37 -0
- package/dist/app/features/vpn/vpn.run.js +54 -0
- package/dist/app/features/web/index.d.ts +2 -0
- package/dist/app/features/web/index.js +3 -0
- package/dist/app/features/web/web.def.d.ts +33 -0
- package/dist/app/features/web/web.def.js +90 -0
- package/dist/app/features/web/web.run.d.ts +24 -0
- package/dist/app/features/web/web.run.js +93 -0
- package/dist/app/kernel/define.d.ts +10 -1
- package/dist/app/kernel/io.d.ts +34 -0
- package/dist/app/kernel/io.js +9 -0
- package/dist/app/kernel/rpc.d.ts +17 -0
- package/dist/app/kernel/text.d.ts +2 -0
- package/dist/app/kernel/text.js +7 -0
- package/dist/app/kernel/view.d.ts +24 -1
- package/dist/app/kernel/view.js +1 -1
- package/dist/app/registry.js +74 -1
- package/dist/cli/args.js +1 -1
- package/dist/cli/commands/context.d.ts +7 -0
- package/dist/cli/commands/context.js +29 -2
- package/dist/cli/commands/engine.js +5 -58
- package/dist/cli/commands/github.d.ts +2 -0
- package/dist/cli/commands/github.js +11 -0
- package/dist/cli/commands/index.d.ts +3 -5
- package/dist/cli/commands/index.js +3 -5
- package/dist/cli/commands/launch/launch.js +21 -4
- package/dist/cli/commands/launch/running.js +4 -1
- package/dist/cli/commands/maintenance/config.js +1 -6
- package/dist/cli/commands/maintenance/index.d.ts +0 -1
- package/dist/cli/commands/maintenance/index.js +1 -2
- package/dist/cli/commands/maintenance/logs.js +27 -32
- package/dist/cli/commands/maintenance/migrate.d.ts +0 -8
- package/dist/cli/commands/maintenance/migrate.js +2 -44
- package/dist/cli/commands/maintenance/update.d.ts +0 -19
- package/dist/cli/commands/maintenance/update.js +1 -99
- package/dist/cli/commands/projects/index.d.ts +0 -1
- package/dist/cli/commands/projects/index.js +0 -1
- package/dist/cli/commands/registry.d.ts +1 -1
- package/dist/cli/commands/registry.js +29 -11
- package/dist/cli/commands/repair/checks/data.js +1 -1
- package/dist/cli/commands/repair/checks/hcs.js +28 -1
- package/dist/cli/commands/repair/checks/sandbox.js +1 -1
- package/dist/cli/commands/repair/health-run.d.ts +30 -0
- package/dist/cli/commands/repair/health-run.js +32 -0
- package/dist/cli/commands/repair/printer.d.ts +2 -2
- package/dist/cli/commands/repair/printer.js +2 -11
- package/dist/cli/commands/repair/run.d.ts +1 -21
- package/dist/cli/commands/repair/run.js +13 -70
- package/dist/cli/commands/storage/index.d.ts +0 -1
- package/dist/cli/commands/storage/index.js +0 -1
- package/dist/cli/commands/storage/offer.js +6 -2
- package/dist/cli/commands/vpn.d.ts +1 -3
- package/dist/cli/commands/vpn.js +8 -89
- package/dist/cli/commands/web.d.ts +2 -1
- package/dist/cli/commands/web.js +14 -78
- package/dist/cli/index.js +3 -2
- package/dist/cli/manifest.d.ts +16 -153
- package/dist/cli/manifest.js +20 -50
- package/dist/cli/menu/command-form.js +1 -2
- package/dist/cli/menu/io-menu.d.ts +2 -2
- package/dist/cli/menu/io-menu.js +6 -4
- package/dist/cli/menu/menu.js +1 -1
- package/dist/cli/menu/pages/accounts-page.d.ts +5 -17
- package/dist/cli/menu/pages/accounts-page.js +28 -170
- package/dist/cli/menu/pages/agents-page.d.ts +17 -18
- package/dist/cli/menu/pages/agents-page.js +67 -124
- package/dist/cli/menu/pages/apps-page.d.ts +15 -8
- package/dist/cli/menu/pages/apps-page.js +121 -29
- package/dist/cli/menu/pages/list-page.js +10 -1
- package/dist/cli/menu/pages/maintenance-page.d.ts +51 -52
- package/dist/cli/menu/pages/maintenance-page.js +246 -427
- package/dist/cli/menu/pages/sandbox-page.d.ts +3 -5
- package/dist/cli/menu/pages/sandbox-page.js +34 -112
- package/dist/cli/menu/pages/settings-page.d.ts +21 -3
- package/dist/cli/menu/pages/settings-page.js +89 -17
- package/dist/cli/menu/render-view.js +2 -1
- package/dist/cli/menu/settings/index.d.ts +0 -1
- package/dist/cli/menu/settings/index.js +3 -3
- package/dist/cli/menu/views.js +28 -0
- package/dist/cli/operations/handler.js +7 -3
- package/dist/cli/operations/input.d.ts +1 -1
- package/dist/cli/operations/input.js +29 -5
- package/dist/cli/operations/io-cli.js +9 -1
- package/dist/cli/operations/spec.js +8 -2
- package/dist/cli/output/render-view.js +2 -0
- package/dist/cli/{commands/data/collect.js → services/data-collect.js} +2 -2
- package/dist/cli/{commands/data/remove.js → services/data-remove.js} +2 -2
- package/dist/cli/services/data-service.d.ts +1 -1
- package/dist/cli/services/data-service.js +2 -2
- package/dist/cli/services/databases-service.d.ts +5 -0
- package/dist/cli/services/databases-service.js +15 -0
- package/dist/cli/services/health-service.d.ts +8 -4
- package/dist/cli/services/health-service.js +10 -8
- package/dist/cli/services/index.d.ts +4 -1
- package/dist/cli/services/index.js +4 -1
- package/dist/cli/services/logs-service.d.ts +7 -0
- package/dist/cli/services/logs-service.js +13 -0
- package/dist/cli/services/storage-service.d.ts +19 -0
- package/dist/cli/services/storage-service.js +71 -0
- package/dist/cli/services/vpn-service.d.ts +6 -4
- package/dist/cli/services/vpn-service.js +5 -11
- package/dist/cli/services/web-service.d.ts +4 -3
- package/dist/cli/services/web-service.js +12 -32
- package/dist/core/config/defaults.js +2 -1
- package/dist/core/schema/config.d.ts +5 -0
- package/dist/core/schema/config.js +2 -0
- package/dist/core/schema/github.d.ts +4 -0
- package/dist/core/schema/github.js +7 -0
- package/dist/core/schema/index.d.ts +1 -0
- package/dist/core/schema/index.js +1 -0
- package/dist/core/schema/profile.d.ts +1 -0
- package/dist/core/schema/profile.js +3 -0
- package/dist/core/schema/sandbox.js +3 -3
- package/dist/core/schema/toolchains.js +2 -2
- package/dist/core/types.d.ts +6 -3
- package/dist/guest/boot/boot.js +8 -0
- package/dist/guest/daemon/daemon.js +1 -1
- package/dist/guest/daemon/sessions.d.ts +3 -2
- package/dist/guest/daemon/sessions.js +38 -7
- package/dist/guest/governor/core.d.ts +44 -0
- package/dist/guest/governor/core.js +124 -0
- package/dist/guest/governor/decide.d.ts +46 -18
- package/dist/guest/governor/decide.js +136 -82
- package/dist/guest/governor/governor.d.ts +2 -38
- package/dist/guest/governor/governor.js +33 -113
- package/dist/guest/governor/index.d.ts +1 -0
- package/dist/guest/governor/index.js +1 -0
- package/dist/guest/network/firewall.d.ts +2 -0
- package/dist/guest/network/firewall.js +3 -3
- package/dist/guest/sessions/viewer.js +5 -1
- package/dist/guest/setup/github-token.d.ts +7 -0
- package/dist/guest/setup/github-token.js +65 -0
- package/dist/guest/toolchains/languages/node.js +11 -1
- package/dist/guest/toolchains/native/rust-extras.js +2 -2
- package/dist/guest/toolchains/tools/cli.d.ts +8 -0
- package/dist/guest/toolchains/tools/cli.js +35 -2
- package/dist/guest/vpn/openvpn.d.ts +5 -0
- package/dist/guest/vpn/openvpn.js +14 -1
- package/dist/guest/vpn/vpn.js +55 -16
- package/dist/guest/vpn/wireguard.js +2 -0
- package/dist/host/channel/attach.d.ts +1 -0
- package/dist/host/channel/attach.js +1 -0
- package/dist/host/channel/channel.d.ts +1 -1
- package/dist/host/channel/channel.js +2 -2
- package/dist/host/engines/hcs/check.d.ts +1 -0
- package/dist/host/engines/hcs/check.js +1 -1
- package/dist/host/engines/hcs/engine.d.ts +1 -1
- package/dist/host/engines/hcs/engine.js +6 -4
- package/dist/host/engines/hcs/helper.d.ts +11 -0
- package/dist/host/engines/hcs/helper.js +31 -2
- package/dist/host/engines/hcs/leftovers.d.ts +42 -0
- package/dist/host/engines/hcs/leftovers.js +101 -0
- package/dist/host/engines/index.d.ts +1 -0
- package/dist/host/engines/index.js +1 -0
- package/dist/host/github/deliver.d.ts +13 -0
- package/dist/host/github/deliver.js +51 -0
- package/dist/host/github/index.d.ts +2 -0
- package/dist/host/github/index.js +3 -0
- package/dist/host/github/token.d.ts +21 -0
- package/dist/host/github/token.js +74 -0
- package/dist/host/launch/generate.js +11 -5
- package/dist/host/launch/index.d.ts +1 -1
- package/dist/host/launch/index.js +1 -1
- package/dist/host/launch/session-file.js +1 -2
- package/dist/host/launch/wsb-file.d.ts +11 -7
- package/dist/host/launch/wsb-file.js +30 -12
- package/dist/host/life/host-memory.d.ts +18 -0
- package/dist/host/life/host-memory.js +66 -0
- package/dist/host/life/watchdog.d.ts +9 -0
- package/dist/host/life/watchdog.js +17 -1
- package/dist/host/sandbox/tasklist.d.ts +6 -0
- package/dist/host/sandbox/tasklist.js +37 -0
- package/dist/host/secrets/launch-secrets.d.ts +2 -1
- package/dist/host/secrets/launch-secrets.js +4 -2
- package/dist/host/vpn/status.js +13 -3
- package/dist/host/web/backend.d.ts +1 -3
- package/dist/host/web/index.d.ts +2 -1
- package/dist/host/web/index.js +2 -1
- package/dist/host/web/live.d.ts +23 -0
- package/dist/host/web/live.js +107 -0
- package/dist/host/web/rpc.d.ts +6 -1
- package/dist/host/web/rpc.js +23 -31
- package/dist/host/web/runner.d.ts +4 -0
- package/dist/host/web/runner.js +12 -1
- package/dist/host/web/server.d.ts +30 -2
- package/dist/host/web/server.js +87 -29
- package/dist/host/web/state.d.ts +1 -0
- package/dist/host/web/state.js +2 -0
- package/dist/runtime/agent.js +30 -6
- package/dist/runtime/daemon.js +337 -177
- package/dist/runtime/db.js +30 -6
- package/dist/runtime/main.js +389 -77
- package/dist/runtime/netproxy.js +30 -6
- package/dist/runtime/view.js +495 -146
- package/dist/selftest/app.test.js +632 -12
- package/dist/selftest/channel.test.js +18 -1
- package/dist/selftest/cli.test.js +1 -1
- package/dist/selftest/config.test.js +1 -1
- package/dist/selftest/contained.test.js +1 -1
- package/dist/selftest/data.test.js +1 -2
- package/dist/selftest/engine.test.js +3 -1
- package/dist/selftest/github.test.d.ts +2 -0
- package/dist/selftest/github.test.js +243 -0
- package/dist/selftest/hcs.test.js +105 -8
- package/dist/selftest/health.test.js +71 -0
- package/dist/selftest/heavy-load.test.js +132 -72
- package/dist/selftest/index.js +4 -0
- package/dist/selftest/layout.test.js +8 -0
- package/dist/selftest/live-terminal.test.js +74 -0
- package/dist/selftest/menu-screens.js +171 -56
- package/dist/selftest/menu.test.js +54 -37
- package/dist/selftest/migrate.test.js +14 -12
- package/dist/selftest/powershell-variables.test.d.ts +2 -0
- package/dist/selftest/powershell-variables.test.js +61 -0
- package/dist/selftest/support/engine-golden.js +1 -0
- package/dist/selftest/support/fixtures.d.ts +4 -0
- package/dist/selftest/support/web-preview.d.ts +1 -0
- package/dist/selftest/support/web-preview.js +856 -0
- package/dist/selftest/update-service.test.js +15 -8
- package/dist/selftest/vpn.test.js +86 -2
- package/dist/selftest/web.test.js +58 -11
- package/dist/shared/channel/run-dir.d.ts +2 -0
- package/dist/shared/channel/run-dir.js +3 -0
- package/dist/shared/channel/schema.d.ts +7 -0
- package/dist/shared/channel/schema.js +9 -1
- package/dist/shared/channel/secrets.d.ts +1 -0
- package/dist/shared/channel/secrets.js +3 -0
- package/dist/shared/github/index.d.ts +1 -0
- package/dist/shared/github/index.js +2 -0
- package/dist/shared/github/token.d.ts +29 -0
- package/dist/shared/github/token.js +89 -0
- package/dist/shared/memory/policy.d.ts +33 -12
- package/dist/shared/memory/policy.js +50 -19
- package/dist/shared/pty/ctrl-c.d.ts +18 -0
- package/dist/shared/pty/ctrl-c.js +36 -0
- package/dist/shared/pty/index.d.ts +1 -0
- package/dist/shared/pty/index.js +1 -0
- package/dist/shared/pty/terminal.d.ts +2 -0
- package/dist/shared/pty/terminal.js +21 -2
- package/dist/shared/vpn/kill-switch.d.ts +13 -2
- package/dist/shared/vpn/kill-switch.js +88 -8
- package/dist/shared/web/protocol.d.ts +0 -4
- package/dist/sync/watcher.d.ts +2 -0
- package/dist/sync/watcher.js +8 -3
- package/dist/web/index.html +2 -2
- package/dist/web/{main-T5DMCHYV.css → main-MU5XWZMS.css} +1 -1
- package/dist/web/main-SLQNJRXD.js +219 -0
- package/native/csharp/HcsHost/AssemblyInfo.cs +3 -3
- package/native/csharp/HostTools/AssemblyInfo.cs +3 -3
- package/native/csharp/HostTools/MemoryStatus.cs +58 -2
- package/native/csharp/HostTools/Program.cs +7 -1
- package/package.json +10 -3
- package/sandbox/csharp/MemGov.cs +240 -38
- package/sandbox/csharp/PtyHost.cs +104 -15
- package/sandbox/csharp/SandboxTools/CpuCap.cs +50 -1
- package/sandbox/csharp/SandboxTools/Program.cs +1 -1
- package/sandbox/scripts/repair-wmi-services.ps1 +26 -0
- package/schemas/config.schema.json +19 -5
- package/schemas/sandbox-config.schema.json +7 -3
- package/dist/cli/commands/accounts.d.ts +0 -2
- package/dist/cli/commands/accounts.js +0 -96
- package/dist/cli/commands/data/clean.d.ts +0 -3
- package/dist/cli/commands/data/clean.js +0 -60
- package/dist/cli/commands/data/index.d.ts +0 -4
- package/dist/cli/commands/data/index.js +0 -62
- package/dist/cli/commands/maintenance/clean.d.ts +0 -2
- package/dist/cli/commands/maintenance/clean.js +0 -24
- package/dist/cli/commands/maintenance/config-share.d.ts +0 -12
- package/dist/cli/commands/maintenance/config-share.js +0 -80
- package/dist/cli/commands/projects/projects.d.ts +0 -2
- package/dist/cli/commands/projects/projects.js +0 -162
- package/dist/cli/commands/storage/contained.d.ts +0 -3
- package/dist/cli/commands/storage/contained.js +0 -179
- package/dist/cli/commands/storage/storage.d.ts +0 -8
- package/dist/cli/commands/storage/storage.js +0 -179
- package/dist/cli/menu/add-agent.d.ts +0 -47
- package/dist/cli/menu/add-agent.js +0 -168
- package/dist/cli/menu/apps.d.ts +0 -69
- package/dist/cli/menu/apps.js +0 -214
- package/dist/cli/menu/data-folder.d.ts +0 -18
- package/dist/cli/menu/data-folder.js +0 -99
- package/dist/cli/menu/share-settings.d.ts +0 -21
- package/dist/cli/menu/share-settings.js +0 -112
- package/dist/cli/menu/vpn-login.d.ts +0 -16
- package/dist/cli/menu/vpn-login.js +0 -74
- package/dist/web/main-NRRS5O6Z.js +0 -157
- /package/dist/cli/{commands/data/collect.d.ts → services/data-collect.d.ts} +0 -0
- /package/dist/cli/{commands/data/remove.d.ts → services/data-remove.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
**A throwaway Windows machine for every project, with or without an AI agent.**
|
|
6
6
|
|
|
7
7
|
[](https://github.com/JoshDiDuca/windows-development-sandbox/releases/latest)
|
|
8
|
+
[](https://www.npmjs.com/package/windows-development-sandbox)
|
|
8
9
|
[](https://github.com/JoshDiDuca/windows-development-sandbox/actions/workflows/ci.yml)
|
|
9
10
|

|
|
10
11
|

|
|
@@ -22,21 +23,24 @@ irm https://github.com/JoshDiDuca/windows-development-sandbox/releases/latest/do
|
|
|
22
23
|
```
|
|
23
24
|
|
|
24
25
|
It checks your PC, offers to turn on Windows Sandbox, and asks **1) Just me** or **2) Everyone on this PC** (needs
|
|
25
|
-
admin). It
|
|
26
|
-
installs newer versions
|
|
26
|
+
admin). It brings its own private copy of Node.js; nothing else is installed system-wide, and no Start menu shortcut
|
|
27
|
+
unless you ask for one. `sandbox update` installs newer versions (and can do it by itself); a version that fails to
|
|
28
|
+
start is rolled back automatically, and `sandbox update --rollback` goes back one by hand.
|
|
29
|
+
|
|
27
30
|
Needs Windows 10/11 **Pro, Enterprise or Education**. Have Node.js 20+? `npm install -g windows-development-sandbox`
|
|
28
|
-
works too. [Scopes, options, upgrading, uninstall](docs/install.md)
|
|
31
|
+
works too. [Scopes, options (`-Version`, `-StartMenuShortcut` ...), upgrading, uninstall](docs/install.md)
|
|
29
32
|
|
|
30
33
|
## Use
|
|
31
34
|
|
|
32
35
|
```powershell
|
|
33
36
|
cd C:\code\my-app
|
|
34
37
|
|
|
35
|
-
sandbox # the menu:
|
|
38
|
+
sandbox # the menu: agents, sessions, apps, every setting, diagnostics ...
|
|
36
39
|
sandbox claude # Claude Code in a sandbox for this folder (or: claude-sandbox)
|
|
37
40
|
sandbox claude -t # ... in this terminal (Ctrl+] detaches, the session keeps running)
|
|
38
41
|
sandbox start # just the sandbox, no agent
|
|
39
42
|
sandbox opencode # any supported agent by name
|
|
43
|
+
sandbox web open # (Beta) the web UI in your browser, signed in
|
|
40
44
|
```
|
|
41
45
|
|
|
42
46
|
The first start downloads what the project needs (a few minutes, once). After that, starts take seconds.
|
|
@@ -55,43 +59,86 @@ The first start downloads what the project needs (a few minutes, once). After th
|
|
|
55
59
|
| **Agents** | Claude Code, Codex, Gemini, opencode, Qwen, Crush, Copilot, Kilo, Amp, Cline, Continue, Kimi, Aider, DeepSeek agents |
|
|
56
60
|
| **Smart** | Detects what the project needs from its files, respects version files, installs in parallel and reuses everything |
|
|
57
61
|
| **Several projects** | `sandbox claude` from another project joins the running sandbox: its own folder, tools, versions, databases and environment, set up on demand. Start several agents at once (`--session claude@A --session codex@B`, or the menu) and attach to any of them from any terminal |
|
|
58
|
-
| **
|
|
59
|
-
| **Feels like home** | Your desktop look, Claude settings, MCP servers and conversation history come along; history syncs back |
|
|
62
|
+
| **Picks up where you left off** | After a crash or a restart, `sandbox resume` reopens the last sessions; `sandbox restart` restarts the agents in place and they continue their conversation |
|
|
63
|
+
| **Feels like home** | Your desktop look, Claude settings, MCP servers and conversation history come along; history syncs back. Logins you save (`sandbox account`) are kept encrypted for your Windows user |
|
|
64
|
+
|
|
65
|
+
## Built for heavy workloads
|
|
66
|
+
|
|
67
|
+
The sandbox behaves like a well-run PC of its own size: under load it slows down, it does not fail, and it never takes
|
|
68
|
+
your PC down with it. Nothing needs setting up.
|
|
69
|
+
|
|
70
|
+
- **Sized to what your PC can hold.** The sandbox gets only the memory your PC can keep in RAM for it, with room kept
|
|
71
|
+
for your PC itself (and more with vGPU on).
|
|
72
|
+
- **Builds within a budget.** Agents see the processors and memory they may really use, and every session gets a
|
|
73
|
+
matching number of build jobs and links, written to `run\budget.json` for agents to plan with.
|
|
74
|
+
- **Graduated throttling.** As memory fills, a governor in the sandbox turns one dial in steps: build programs get
|
|
75
|
+
lower CPU and memory priority, then a smaller share of the CPU, then compilers take turns while the waiting ones move
|
|
76
|
+
to the paging file. Builds get slower; nothing is stopped or killed, and agents, shells and Windows are never touched.
|
|
77
|
+
- **Your PC has a say.** A watchdog on your PC watches its memory, CPU and disks and asks the sandbox to ease off, at
|
|
78
|
+
once and all the way when your PC is nearly out of memory.
|
|
79
|
+
- **A last resort that only protects.** Only at the very edge of the sandbox's own memory limit, where Windows inside
|
|
80
|
+
it would otherwise start failing, is a build refused memory so that the sandbox stays up.
|
|
81
|
+
- **Answers after the fact.** `sandbox doctor` checks your paging file, and `sandbox logs --crash` explains a past
|
|
82
|
+
freeze or crash: the gap, blue screens, hardware and memory events, and whether vGPU was on.
|
|
83
|
+
|
|
84
|
+
Details and settings: [troubleshooting](docs/troubleshooting.md#the-sandbox-closes-under-heavy-load) and
|
|
85
|
+
[configuration](docs/configuration.md#cpu-ram-and-gpu).
|
|
60
86
|
|
|
61
87
|
## Commands
|
|
62
88
|
|
|
63
89
|
| Command | |
|
|
64
90
|
|---|---|
|
|
65
|
-
| `sandbox` | the menu, a full-screen app: start agents, attach to sessions, pick apps, edit every setting (yours and the project's), all commands, with search |
|
|
91
|
+
| `sandbox` | the menu, a full-screen app with a left navigation: start agents, attach to sessions, pick apps, edit every setting (yours and the project's), all commands, with search |
|
|
66
92
|
| `sandbox <agent>`, `claude-sandbox` | start an agent; `-t` for this terminal, `--headless` for no window |
|
|
67
93
|
| `sandbox start` | the sandbox without an agent |
|
|
68
94
|
| `sandbox attach` / `sessions` / `status` | work with a running sandbox (this folder's project first) |
|
|
95
|
+
| `sandbox restart` / `resume` | restart the agents in place; reopen the last sessions |
|
|
69
96
|
| `sandbox projects` | the projects a sandbox can open without a restart: roots, `all`, exclude |
|
|
70
97
|
| `sandbox db [start\|stop <name>]` | list, start or stop databases (`sbx-db` inside) |
|
|
71
98
|
| `sandbox exec -- <cmd>` | run a command inside |
|
|
72
|
-
| `sandbox
|
|
73
|
-
| `sandbox
|
|
99
|
+
| `sandbox config get\|set\|reset\|list` | read and change any setting from the command line (`export` / `import` to share them) |
|
|
100
|
+
| `sandbox account` | save, switch and rename agent logins |
|
|
101
|
+
| `sandbox web` | (Beta) the web UI: start, stop, status, open |
|
|
74
102
|
| `sandbox stop` / `hide` / `show` | shut down, hide or show the window |
|
|
75
|
-
| `sandbox data` / `
|
|
103
|
+
| `sandbox data` / `storage` | what's stored and how big, freeing space, moving the data folder |
|
|
76
104
|
| `sandbox setup` / `doctor` / `repair` | check this PC, see what will be installed, fix common problems |
|
|
105
|
+
| `sandbox logs [-f] [--crash]` | the sandbox log, or the report of the last crash |
|
|
106
|
+
| `sandbox update [--rollback]` / `--version` | update (or go back one version); the installed version |
|
|
77
107
|
|
|
78
108
|
All commands and options: [docs/commands.md](docs/commands.md)
|
|
79
109
|
|
|
110
|
+
## Beta and alpha features
|
|
111
|
+
|
|
112
|
+
These are off until you turn them on, and one setting turns each off again. Windows Sandbox stays the default and
|
|
113
|
+
keeps every feature it has.
|
|
114
|
+
|
|
115
|
+
| Feature | Status | |
|
|
116
|
+
|---|---|---|
|
|
117
|
+
| **Web UI** (`sandbox web`, `web.enabled`) | Beta | Agents, sessions with live terminals, the sandbox's status, apps, accounts and every setting in your browser, with search (Ctrl+K) and a folder picker; on this PC only (loopback, signed in with a token). `web.openOnLaunch` opens it with every sandbox. [web-ui.md](docs/web-ui.md) |
|
|
118
|
+
| **Agent commands** (`sandbox agent-commands on`) | Beta | Typing `claude`, `codex` ... in any folder starts it in a hidden sandbox and attaches your terminal |
|
|
119
|
+
| **Contained storage** (`sandbox storage contained on`) | Beta | Tools, logins and logs in one disk image per data set, mounted only while a sandbox runs. One admin prompt per launch. [engines](docs/design/engines.md) |
|
|
120
|
+
| **VPN** (`sandbox vpn`, `vpn.enabled`) | Alpha | The sandbox's traffic through NordVPN, your own OpenVPN profile or a WireGuard config, with a kill switch. Not yet tried on a real PC: read [vpn.md](docs/vpn.md) first |
|
|
121
|
+
| **HCS engine** (`sandbox.engine: hcs`, `sandbox engine`) | Alpha | Headless agents in a Hyper-V isolated Server Core container. `sandbox engine check hcs` shows what your PC lacks; starting it is not enabled yet |
|
|
122
|
+
|
|
80
123
|
## Known gaps
|
|
81
124
|
|
|
82
|
-
Adding a folder to a RUNNING sandbox needs Windows 11 24H2+ with the updated Windows Sandbox (`wsb share`,
|
|
83
|
-
On older Windows, folders inside a project root open at once and anything else offers a restart.
|
|
84
|
-
get `wsb
|
|
125
|
+
- Adding a folder to a RUNNING sandbox needs Windows 11 24H2+ with the updated Windows Sandbox (`wsb share`,
|
|
126
|
+
untested). On older Windows, folders inside a project root open at once and anything else offers a restart.
|
|
127
|
+
[Details, and how to get `wsb`](docs/projects.md#adding-folders-to-a-running-sandbox-wsb-share).
|
|
128
|
+
- Windows Sandbox runs one sandbox at a time per PC; every project and agent shares it.
|
|
129
|
+
- What is planned next: [roadmap](docs/roadmap.md).
|
|
85
130
|
|
|
86
131
|
## Documentation
|
|
87
132
|
|
|
88
|
-
|
|
133
|
+
All docs, with one line each: [docs/README.md](docs/README.md). The main ones:
|
|
134
|
+
|
|
135
|
+
- [Install](docs/install.md): requirements, other ways to install, upgrading, rolling back
|
|
89
136
|
- [Commands](docs/commands.md): every command and option, the menu, sessions and attaching
|
|
90
137
|
- [Tools and databases](docs/toolchains.md): languages, package managers, databases, agents, what is tested
|
|
91
138
|
- [Configuration](docs/configuration.md): settings, project files, paths, accounts, hooks
|
|
92
139
|
- [Several projects](docs/projects.md): project roots, adding a project to a running sandbox, what each agent can see
|
|
93
|
-
- [Changelog](CHANGELOG.md): what shipped in each version
|
|
94
140
|
- [Security](docs/security.md): how your PC is protected, secrets, git access
|
|
95
|
-
- [
|
|
96
|
-
- [Troubleshooting](docs/troubleshooting.md): common problems and
|
|
141
|
+
- [Web UI](docs/web-ui.md) (Beta) and [VPN](docs/vpn.md) (Alpha)
|
|
142
|
+
- [Troubleshooting](docs/troubleshooting.md): common problems, freezes and crash reports
|
|
143
|
+
- [Changelog](CHANGELOG.md) and [roadmap](docs/roadmap.md): what shipped, what is next
|
|
97
144
|
- [Development](docs/development.md): building, testing, releasing (code layout in [CLAUDE.md](CLAUDE.md))
|
package/config.example.json
CHANGED
|
@@ -64,6 +64,9 @@
|
|
|
64
64
|
"configFile": "",
|
|
65
65
|
"killSwitch": true
|
|
66
66
|
},
|
|
67
|
+
"github": {
|
|
68
|
+
"shareToken": false
|
|
69
|
+
},
|
|
67
70
|
"provisioning": {
|
|
68
71
|
"copyFromHost": true,
|
|
69
72
|
"fallbackToInstall": true,
|
|
@@ -218,7 +221,8 @@
|
|
|
218
221
|
"enabled": true,
|
|
219
222
|
"reuseSession": true,
|
|
220
223
|
"auto": false,
|
|
221
|
-
"autoHide": false
|
|
224
|
+
"autoHide": false,
|
|
225
|
+
"confirmCtrlC": true
|
|
222
226
|
},
|
|
223
227
|
"web": {
|
|
224
228
|
"enabled": false,
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type Page, type Section } from '../../kernel/index.js';
|
|
3
|
+
export declare const AccountRowSchema: z.ZodObject<{
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
email: z.ZodNullable<z.ZodString>;
|
|
6
|
+
isDefault: z.ZodBoolean;
|
|
7
|
+
isActive: z.ZodBoolean;
|
|
8
|
+
savedAt: z.ZodString;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type AccountRow = z.output<typeof AccountRowSchema>;
|
|
11
|
+
export declare const AgentAccountsSchema: z.ZodObject<{
|
|
12
|
+
name: z.ZodString;
|
|
13
|
+
kept: z.ZodBoolean;
|
|
14
|
+
canSavePc: z.ZodBoolean;
|
|
15
|
+
accounts: z.ZodArray<z.ZodObject<{
|
|
16
|
+
name: z.ZodString;
|
|
17
|
+
email: z.ZodNullable<z.ZodString>;
|
|
18
|
+
isDefault: z.ZodBoolean;
|
|
19
|
+
isActive: z.ZodBoolean;
|
|
20
|
+
savedAt: z.ZodString;
|
|
21
|
+
}, z.core.$strip>>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
export type AgentAccounts = z.output<typeof AgentAccountsSchema>;
|
|
24
|
+
export declare const AccountsListSchema: z.ZodObject<{
|
|
25
|
+
agent: z.ZodString;
|
|
26
|
+
agents: z.ZodArray<z.ZodObject<{
|
|
27
|
+
name: z.ZodString;
|
|
28
|
+
kept: z.ZodBoolean;
|
|
29
|
+
canSavePc: z.ZodBoolean;
|
|
30
|
+
accounts: z.ZodArray<z.ZodObject<{
|
|
31
|
+
name: z.ZodString;
|
|
32
|
+
email: z.ZodNullable<z.ZodString>;
|
|
33
|
+
isDefault: z.ZodBoolean;
|
|
34
|
+
isActive: z.ZodBoolean;
|
|
35
|
+
savedAt: z.ZodString;
|
|
36
|
+
}, z.core.$strip>>;
|
|
37
|
+
}, z.core.$strip>>;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
export type AccountsList = z.output<typeof AccountsListSchema>;
|
|
40
|
+
/** The name rule of a saved login: what the store accepts. */
|
|
41
|
+
export declare const NAME_RULE = "Use letters, digits, - and _ (up to 40).";
|
|
42
|
+
/** `sandbox account list`: the table of one agent, as the command line has always padded it. */
|
|
43
|
+
export declare function accountsText(o: AccountsList): string;
|
|
44
|
+
export declare const listAccounts: import("../../kernel/define.js").QueryDef<z.ZodObject<{
|
|
45
|
+
agent: z.ZodDefault<z.ZodString>;
|
|
46
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
47
|
+
agent: z.ZodString;
|
|
48
|
+
agents: z.ZodArray<z.ZodObject<{
|
|
49
|
+
name: z.ZodString;
|
|
50
|
+
kept: z.ZodBoolean;
|
|
51
|
+
canSavePc: z.ZodBoolean;
|
|
52
|
+
accounts: z.ZodArray<z.ZodObject<{
|
|
53
|
+
name: z.ZodString;
|
|
54
|
+
email: z.ZodNullable<z.ZodString>;
|
|
55
|
+
isDefault: z.ZodBoolean;
|
|
56
|
+
isActive: z.ZodBoolean;
|
|
57
|
+
savedAt: z.ZodString;
|
|
58
|
+
}, z.core.$strip>>;
|
|
59
|
+
}, z.core.$strip>>;
|
|
60
|
+
}, z.core.$strip>, "accounts.list">;
|
|
61
|
+
export declare const saveAccount: import("../../kernel/define.js").OperationDef<z.ZodObject<{
|
|
62
|
+
agent: z.ZodDefault<z.ZodString>;
|
|
63
|
+
name: z.ZodOptional<z.ZodString>;
|
|
64
|
+
fromHost: z.ZodDefault<z.ZodBoolean>;
|
|
65
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
66
|
+
name: z.ZodString;
|
|
67
|
+
message: z.ZodString;
|
|
68
|
+
}, z.core.$strip>, "accounts.save">;
|
|
69
|
+
export declare const useAccount: import("../../kernel/define.js").OperationDef<z.ZodObject<{
|
|
70
|
+
agent: z.ZodDefault<z.ZodString>;
|
|
71
|
+
name: z.ZodOptional<z.ZodString>;
|
|
72
|
+
noRestart: z.ZodDefault<z.ZodBoolean>;
|
|
73
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
74
|
+
lines: z.ZodArray<z.ZodString>;
|
|
75
|
+
}, z.core.$strip>, "accounts.use">;
|
|
76
|
+
export declare const defaultAccount: import("../../kernel/define.js").OperationDef<z.ZodObject<{
|
|
77
|
+
agent: z.ZodDefault<z.ZodString>;
|
|
78
|
+
name: z.ZodOptional<z.ZodString>;
|
|
79
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
80
|
+
message: z.ZodString;
|
|
81
|
+
}, z.core.$strip>, "accounts.default">;
|
|
82
|
+
export declare const renameAccount: import("../../kernel/define.js").OperationDef<z.ZodObject<{
|
|
83
|
+
agent: z.ZodDefault<z.ZodString>;
|
|
84
|
+
name: z.ZodOptional<z.ZodString>;
|
|
85
|
+
to: z.ZodOptional<z.ZodString>;
|
|
86
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
87
|
+
message: z.ZodString;
|
|
88
|
+
}, z.core.$strip>, "accounts.rename">;
|
|
89
|
+
export declare const removeAccount: import("../../kernel/define.js").OperationDef<z.ZodObject<{
|
|
90
|
+
agent: z.ZodDefault<z.ZodString>;
|
|
91
|
+
name: z.ZodOptional<z.ZodString>;
|
|
92
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
93
|
+
message: z.ZodString;
|
|
94
|
+
}, z.core.$strip>, "accounts.remove">;
|
|
95
|
+
/** One agent's card: its save rows and logins (a card to pick from), or the note that its login is not kept. */
|
|
96
|
+
export declare function agentSection(a: AgentAccounts): Section;
|
|
97
|
+
/** The web's page: one card per agent (its logins and the save rows). */
|
|
98
|
+
export declare function accountsPage(o: AccountsList): Page;
|
|
99
|
+
/**
|
|
100
|
+
* One agent's page for the menu: its section, and the keys of its save rows (s, p) which the menu's key bar shows
|
|
101
|
+
* while the agent's category is open. The keys of a login row (d, r, x) are on the row itself.
|
|
102
|
+
*/
|
|
103
|
+
export declare function agentPage(a: AgentAccounts): Page;
|
|
104
|
+
export declare const accountsView: import("../../kernel/define.js").ViewDef<{
|
|
105
|
+
accounts: import("../../kernel/define.js").QueryDef<z.ZodObject<{
|
|
106
|
+
agent: z.ZodDefault<z.ZodString>;
|
|
107
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
108
|
+
agent: z.ZodString;
|
|
109
|
+
agents: z.ZodArray<z.ZodObject<{
|
|
110
|
+
name: z.ZodString;
|
|
111
|
+
kept: z.ZodBoolean;
|
|
112
|
+
canSavePc: z.ZodBoolean;
|
|
113
|
+
accounts: z.ZodArray<z.ZodObject<{
|
|
114
|
+
name: z.ZodString;
|
|
115
|
+
email: z.ZodNullable<z.ZodString>;
|
|
116
|
+
isDefault: z.ZodBoolean;
|
|
117
|
+
isActive: z.ZodBoolean;
|
|
118
|
+
savedAt: z.ZodString;
|
|
119
|
+
}, z.core.$strip>>;
|
|
120
|
+
}, z.core.$strip>>;
|
|
121
|
+
}, z.core.$strip>, "accounts.list">;
|
|
122
|
+
}, Record<string, never>, "accounts">;
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
// Accounts: the saved logins of every agent that keeps one, and what to do with them (save, use, default, rename,
|
|
2
|
+
// remove). Pure: schemas, labels, the CLI hints of the `account` command's actions, the view and its page builders.
|
|
3
|
+
// accounts.run.ts does the work over AccountsService.
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { action, defineOperation, defineQuery, defineView, plural, } from '../../kernel/index.js';
|
|
6
|
+
const AgentSchema = z.string().default('claude').describe('whose login: an agent that keeps one (default: claude)');
|
|
7
|
+
const NameSchema = z.string().optional().describe('account name');
|
|
8
|
+
export const AccountRowSchema = z.object({
|
|
9
|
+
name: z.string().describe('The saved login'),
|
|
10
|
+
email: z.string().nullable().describe('Its email, when the agent says'),
|
|
11
|
+
isDefault: z.boolean().describe('New launches start with it'),
|
|
12
|
+
isActive: z.boolean().describe('The sandbox uses it now'),
|
|
13
|
+
savedAt: z.string().describe('When it was saved (ISO time)'),
|
|
14
|
+
});
|
|
15
|
+
export const AgentAccountsSchema = z.object({
|
|
16
|
+
name: z.string().describe('The agent'),
|
|
17
|
+
kept: z.boolean().describe('Its login can be saved and switched'),
|
|
18
|
+
canSavePc: z.boolean().describe("This PC's login can be saved"),
|
|
19
|
+
accounts: z.array(AccountRowSchema).describe('Its saved logins (empty when not kept)'),
|
|
20
|
+
});
|
|
21
|
+
export const AccountsListSchema = z.object({
|
|
22
|
+
agent: z.string().describe('The agent asked for (the command line table shows only it)'),
|
|
23
|
+
agents: z.array(AgentAccountsSchema).describe('Every agent, Claude first'),
|
|
24
|
+
});
|
|
25
|
+
const MessageSchema = z.object({ message: z.string().describe('What happened') });
|
|
26
|
+
/** The name rule of a saved login: what the store accepts. */
|
|
27
|
+
export const NAME_RULE = 'Use letters, digits, - and _ (up to 40).';
|
|
28
|
+
/** `sandbox account list`: the table of one agent, as the command line has always padded it. */
|
|
29
|
+
export function accountsText(o) {
|
|
30
|
+
const rows = o.agents.find((a) => a.name === o.agent)?.accounts ?? [];
|
|
31
|
+
if (!rows.length)
|
|
32
|
+
return o.agent === 'claude'
|
|
33
|
+
? "No saved accounts. Sign in inside the sandbox, then: sandbox account save <name> (or --from-host to save this PC's login)"
|
|
34
|
+
: 'No saved ' +
|
|
35
|
+
o.agent +
|
|
36
|
+
' accounts. Sign in inside the sandbox, then: sandbox account save <name> --agent ' +
|
|
37
|
+
o.agent;
|
|
38
|
+
const table = [
|
|
39
|
+
['', 'NAME', 'EMAIL', 'SAVED'],
|
|
40
|
+
...rows.map((a) => [
|
|
41
|
+
(a.isActive ? '*' : ' ') + (a.isDefault ? 'D' : ' '),
|
|
42
|
+
a.name,
|
|
43
|
+
a.email ?? '-',
|
|
44
|
+
a.savedAt.slice(0, 16).replace('T', ' '),
|
|
45
|
+
]),
|
|
46
|
+
];
|
|
47
|
+
const widths = table[0].map((_, i) => Math.max(...table.map((r) => r[i].length)));
|
|
48
|
+
const lines = table.map((r) => r.map((cell, i) => (i === r.length - 1 ? cell : cell.padEnd(widths[i] + 2))).join(''));
|
|
49
|
+
return [...lines, '', '* = active in the sandbox D = default for new launches'].join('\n');
|
|
50
|
+
}
|
|
51
|
+
export const listAccounts = defineQuery({
|
|
52
|
+
id: 'accounts.list',
|
|
53
|
+
title: 'Accounts',
|
|
54
|
+
summary: 'Claude logins: list, save, use, set the default, remove',
|
|
55
|
+
input: z.object({ agent: AgentSchema }),
|
|
56
|
+
output: AccountsListSchema,
|
|
57
|
+
text: accountsText,
|
|
58
|
+
cli: {
|
|
59
|
+
name: 'account',
|
|
60
|
+
action: 'list',
|
|
61
|
+
json: true,
|
|
62
|
+
flags: { agent: { flag: '--agent', value: 'name', choices: 'harnesses', label: 'Agent' } },
|
|
63
|
+
// `sandbox account list --json` has always printed the rows of the one agent.
|
|
64
|
+
shapeJson: (o) => o.agents.find((a) => a.name === o.agent)?.accounts ?? [],
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
export const saveAccount = defineOperation({
|
|
68
|
+
id: 'accounts.save',
|
|
69
|
+
title: "Save the sandbox's login",
|
|
70
|
+
summary: "save the sandbox's (or this PC's) login under a name",
|
|
71
|
+
input: z.object({
|
|
72
|
+
agent: AgentSchema,
|
|
73
|
+
name: NameSchema,
|
|
74
|
+
fromHost: z.boolean().default(false).describe("(save) save this PC's login instead of the sandbox's"),
|
|
75
|
+
}),
|
|
76
|
+
output: z.object({ name: z.string().describe('The saved login'), message: z.string().describe('What happened') }),
|
|
77
|
+
text: (o) => o.message,
|
|
78
|
+
cli: {
|
|
79
|
+
name: 'account',
|
|
80
|
+
action: 'save',
|
|
81
|
+
positional: ['name'],
|
|
82
|
+
flags: { agent: { flag: '--agent' }, fromHost: { flag: '--from-host' } },
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
export const useAccount = defineOperation({
|
|
86
|
+
id: 'accounts.use',
|
|
87
|
+
title: 'Use this login',
|
|
88
|
+
summary: 'make the sandbox use a saved login (running sessions restart)',
|
|
89
|
+
input: z.object({
|
|
90
|
+
agent: AgentSchema,
|
|
91
|
+
name: NameSchema,
|
|
92
|
+
noRestart: z.boolean().default(false).describe('(use) do not restart running sessions'),
|
|
93
|
+
}),
|
|
94
|
+
output: z.object({ lines: z.array(z.string()).describe('What happened, line by line') }),
|
|
95
|
+
text: (o) => o.lines.join('\n'),
|
|
96
|
+
cli: {
|
|
97
|
+
name: 'account',
|
|
98
|
+
action: 'use',
|
|
99
|
+
positional: ['name'],
|
|
100
|
+
flags: { agent: { flag: '--agent' }, noRestart: { flag: '--no-restart' } },
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
export const defaultAccount = defineOperation({
|
|
104
|
+
id: 'accounts.default',
|
|
105
|
+
title: 'Make default',
|
|
106
|
+
summary: 'the login new launches start with',
|
|
107
|
+
input: z.object({ agent: AgentSchema, name: NameSchema }),
|
|
108
|
+
output: MessageSchema,
|
|
109
|
+
text: (o) => o.message,
|
|
110
|
+
cli: { name: 'account', action: 'default', positional: ['name'], flags: { agent: { flag: '--agent' } } },
|
|
111
|
+
});
|
|
112
|
+
export const renameAccount = defineOperation({
|
|
113
|
+
id: 'accounts.rename',
|
|
114
|
+
title: 'Rename…',
|
|
115
|
+
summary: 'give a saved login another name (it keeps working)',
|
|
116
|
+
input: z.object({
|
|
117
|
+
agent: AgentSchema,
|
|
118
|
+
name: NameSchema,
|
|
119
|
+
to: z.string().optional().describe('(rename) the new name'),
|
|
120
|
+
}),
|
|
121
|
+
output: MessageSchema,
|
|
122
|
+
text: (o) => o.message,
|
|
123
|
+
cli: {
|
|
124
|
+
name: 'account',
|
|
125
|
+
action: 'rename',
|
|
126
|
+
positional: ['name'],
|
|
127
|
+
flags: { agent: { flag: '--agent' }, to: { flag: '--to' } },
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
export const removeAccount = defineOperation({
|
|
131
|
+
id: 'accounts.remove',
|
|
132
|
+
title: 'Remove…',
|
|
133
|
+
summary: 'delete a saved login (you would sign in again)',
|
|
134
|
+
danger: true,
|
|
135
|
+
input: z.object({ agent: AgentSchema, name: NameSchema }),
|
|
136
|
+
output: MessageSchema,
|
|
137
|
+
text: (o) => o.message,
|
|
138
|
+
cli: {
|
|
139
|
+
name: 'account',
|
|
140
|
+
action: 'remove',
|
|
141
|
+
positional: ['name'],
|
|
142
|
+
flags: { agent: { flag: '--agent' } },
|
|
143
|
+
yes: '(remove) do not ask first',
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
/** One agent's save rows (the sandbox's login, and this PC's when it can be saved). */
|
|
147
|
+
function saveItems(a) {
|
|
148
|
+
return [
|
|
149
|
+
{
|
|
150
|
+
id: '@save-sandbox',
|
|
151
|
+
label: "+ Save the sandbox's login…",
|
|
152
|
+
group: 'Save a login',
|
|
153
|
+
description: 'Saves the ' + a.name + ' login you signed in with inside the sandbox, under a name you choose.',
|
|
154
|
+
primary: action(saveAccount, { agent: a.name, fromHost: false }, { verb: 'save', label: "Save the sandbox's login" }),
|
|
155
|
+
},
|
|
156
|
+
...(a.canSavePc
|
|
157
|
+
? [
|
|
158
|
+
{
|
|
159
|
+
id: '@save-pc',
|
|
160
|
+
label: "+ Save this PC's login…",
|
|
161
|
+
group: 'Save a login',
|
|
162
|
+
description: 'Saves the ' + a.name + ' login of this PC, under a name you choose.',
|
|
163
|
+
primary: action(saveAccount, { agent: a.name, fromHost: true }, { verb: 'save', label: "Save this PC's login" }),
|
|
164
|
+
},
|
|
165
|
+
]
|
|
166
|
+
: []),
|
|
167
|
+
];
|
|
168
|
+
}
|
|
169
|
+
/** One saved login: its state in the hint and badges, Enter or a click uses it, d/r/x change it. */
|
|
170
|
+
function loginItem(a, r) {
|
|
171
|
+
const hint = [r.isActive ? 'in the sandbox' : '', r.isDefault ? 'default' : ''].filter(Boolean).join(' · ');
|
|
172
|
+
return {
|
|
173
|
+
id: a.name + ':' + r.name,
|
|
174
|
+
label: r.name,
|
|
175
|
+
group: 'Saved logins',
|
|
176
|
+
icon: a.name,
|
|
177
|
+
hint,
|
|
178
|
+
badges: [
|
|
179
|
+
...(r.isActive ? [{ text: 'in the sandbox', tone: 'ok' }] : []),
|
|
180
|
+
...(r.isDefault ? [{ text: 'default', tone: 'accent' }] : []),
|
|
181
|
+
],
|
|
182
|
+
description: 'Choose it to make the sandbox use this login.',
|
|
183
|
+
details: ['Agent ' + a.name, 'Email ' + (r.email ?? '-'), 'Saved ' + r.savedAt.slice(0, 16).replace('T', ' ')],
|
|
184
|
+
primary: action(useAccount, { agent: a.name, name: r.name }, { verb: 'use' }),
|
|
185
|
+
actions: [
|
|
186
|
+
action(defaultAccount, { agent: a.name, name: r.name }, { key: 'd', verb: 'make default', importance: 1 }),
|
|
187
|
+
action(renameAccount, { agent: a.name, name: r.name }, { key: 'r', verb: 'rename', importance: 2 }),
|
|
188
|
+
action(removeAccount, { agent: a.name, name: r.name }, { key: 'x', verb: 'remove', importance: 1 }),
|
|
189
|
+
],
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
/** One agent's card: its save rows and logins (a card to pick from), or the note that its login is not kept. */
|
|
193
|
+
export function agentSection(a) {
|
|
194
|
+
if (!a.kept)
|
|
195
|
+
return {
|
|
196
|
+
id: a.name,
|
|
197
|
+
title: a.name,
|
|
198
|
+
summary: 'not kept between sandboxes',
|
|
199
|
+
items: [
|
|
200
|
+
{
|
|
201
|
+
id: 'info:' + a.name,
|
|
202
|
+
label: "This agent's login is not kept between sandboxes",
|
|
203
|
+
tone: 'muted',
|
|
204
|
+
description: 'Sign in again in each new sandbox, or use an API key in the agent’s environment.',
|
|
205
|
+
},
|
|
206
|
+
],
|
|
207
|
+
};
|
|
208
|
+
return {
|
|
209
|
+
id: a.name,
|
|
210
|
+
title: a.name,
|
|
211
|
+
summary: a.accounts.length ? plural(a.accounts.length, 'saved login') : 'no saved login yet',
|
|
212
|
+
description: 'Saved ' + a.name + ' logins.',
|
|
213
|
+
cards: true,
|
|
214
|
+
items: [...saveItems(a), ...a.accounts.map((r) => loginItem(a, r))],
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
/** The web's page: one card per agent (its logins and the save rows). */
|
|
218
|
+
export function accountsPage(o) {
|
|
219
|
+
return { title: 'Accounts', sections: o.agents.map(agentSection) };
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* One agent's page for the menu: its section, and the keys of its save rows (s, p) which the menu's key bar shows
|
|
223
|
+
* while the agent's category is open. The keys of a login row (d, r, x) are on the row itself.
|
|
224
|
+
*/
|
|
225
|
+
export function agentPage(a) {
|
|
226
|
+
const keys = a.kept
|
|
227
|
+
? [
|
|
228
|
+
action(saveAccount, { agent: a.name, fromHost: false }, { key: 's', verb: 'save sandbox login', importance: 3 }),
|
|
229
|
+
...(a.canSavePc
|
|
230
|
+
? [action(saveAccount, { agent: a.name, fromHost: true }, { key: 'p', verb: 'save PC login', importance: 3 })]
|
|
231
|
+
: []),
|
|
232
|
+
]
|
|
233
|
+
: [];
|
|
234
|
+
return { title: 'Accounts', sections: [agentSection(a)], actions: keys };
|
|
235
|
+
}
|
|
236
|
+
export const accountsView = defineView({
|
|
237
|
+
id: 'accounts',
|
|
238
|
+
title: 'Accounts',
|
|
239
|
+
summary: 'Logins saved on this PC, per agent. Use puts one into the sandbox; new launches start with the default.',
|
|
240
|
+
queries: { accounts: listAccounts },
|
|
241
|
+
operations: [saveAccount, useAccount, defaultAccount, renameAccount, removeAccount],
|
|
242
|
+
build: ({ accounts }) => accountsPage(accounts),
|
|
243
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export declare const listAccountsRun: import("../../kernel/define.js").Implementation<import("../../kernel/define.js").QueryDef<import("zod").ZodObject<{
|
|
2
|
+
agent: import("zod").ZodDefault<import("zod").ZodString>;
|
|
3
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
4
|
+
agent: import("zod").ZodString;
|
|
5
|
+
agents: import("zod").ZodArray<import("zod").ZodObject<{
|
|
6
|
+
name: import("zod").ZodString;
|
|
7
|
+
kept: import("zod").ZodBoolean;
|
|
8
|
+
canSavePc: import("zod").ZodBoolean;
|
|
9
|
+
accounts: import("zod").ZodArray<import("zod").ZodObject<{
|
|
10
|
+
name: import("zod").ZodString;
|
|
11
|
+
email: import("zod").ZodNullable<import("zod").ZodString>;
|
|
12
|
+
isDefault: import("zod").ZodBoolean;
|
|
13
|
+
isActive: import("zod").ZodBoolean;
|
|
14
|
+
savedAt: import("zod").ZodString;
|
|
15
|
+
}, import("zod/v4/core").$strip>>;
|
|
16
|
+
}, import("zod/v4/core").$strip>>;
|
|
17
|
+
}, import("zod/v4/core").$strip>, "accounts.list">, import("../../../cli/commands/context.js").Context>;
|
|
18
|
+
export declare const saveAccountRun: import("../../kernel/define.js").Implementation<import("../../kernel/define.js").OperationDef<import("zod").ZodObject<{
|
|
19
|
+
agent: import("zod").ZodDefault<import("zod").ZodString>;
|
|
20
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
21
|
+
fromHost: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
22
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
23
|
+
name: import("zod").ZodString;
|
|
24
|
+
message: import("zod").ZodString;
|
|
25
|
+
}, import("zod/v4/core").$strip>, "accounts.save">, import("../../../cli/commands/context.js").Context>;
|
|
26
|
+
export declare const useAccountRun: import("../../kernel/define.js").Implementation<import("../../kernel/define.js").OperationDef<import("zod").ZodObject<{
|
|
27
|
+
agent: import("zod").ZodDefault<import("zod").ZodString>;
|
|
28
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
29
|
+
noRestart: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
30
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
31
|
+
lines: import("zod").ZodArray<import("zod").ZodString>;
|
|
32
|
+
}, import("zod/v4/core").$strip>, "accounts.use">, import("../../../cli/commands/context.js").Context>;
|
|
33
|
+
export declare const defaultAccountRun: import("../../kernel/define.js").Implementation<import("../../kernel/define.js").OperationDef<import("zod").ZodObject<{
|
|
34
|
+
agent: import("zod").ZodDefault<import("zod").ZodString>;
|
|
35
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
36
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
37
|
+
message: import("zod").ZodString;
|
|
38
|
+
}, import("zod/v4/core").$strip>, "accounts.default">, import("../../../cli/commands/context.js").Context>;
|
|
39
|
+
export declare const renameAccountRun: import("../../kernel/define.js").Implementation<import("../../kernel/define.js").OperationDef<import("zod").ZodObject<{
|
|
40
|
+
agent: import("zod").ZodDefault<import("zod").ZodString>;
|
|
41
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
42
|
+
to: import("zod").ZodOptional<import("zod").ZodString>;
|
|
43
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
44
|
+
message: import("zod").ZodString;
|
|
45
|
+
}, import("zod/v4/core").$strip>, "accounts.rename">, import("../../../cli/commands/context.js").Context>;
|
|
46
|
+
export declare const removeAccountRun: import("../../kernel/define.js").Implementation<import("../../kernel/define.js").OperationDef<import("zod").ZodObject<{
|
|
47
|
+
agent: import("zod").ZodDefault<import("zod").ZodString>;
|
|
48
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
49
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
50
|
+
message: import("zod").ZodString;
|
|
51
|
+
}, import("zod/v4/core").$strip>, "accounts.remove">, import("../../../cli/commands/context.js").Context>;
|