windows-development-sandbox 1.9.0 → 1.11.3
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 +7 -2
- 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 +201 -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 +952 -4
- package/dist/app/features/defs.js +147 -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 +281 -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 +225 -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 +225 -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 +23 -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 -88
- package/dist/cli/commands/web.d.ts +7 -1
- package/dist/cli/commands/web.js +45 -71
- 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 +3 -2
- package/dist/core/schema/config.d.ts +6 -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/schema/vpn.js +1 -1
- package/dist/core/schema/web.d.ts +1 -0
- package/dist/core/schema/web.js +4 -1
- package/dist/core/types.d.ts +6 -3
- package/dist/guest/boot/boot.js +11 -1
- 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 +53 -15
- package/dist/guest/governor/decide.js +155 -72
- package/dist/guest/governor/governor.d.ts +2 -35
- package/dist/guest/governor/governor.js +35 -99
- package/dist/guest/governor/index.d.ts +1 -0
- package/dist/guest/governor/index.js +1 -0
- package/dist/guest/network/firewall.d.ts +3 -0
- package/dist/guest/network/firewall.js +65 -23
- package/dist/guest/runtime/process.js +53 -5
- package/dist/guest/sessions/viewer.js +5 -1
- package/dist/guest/setup/claude-mem.js +12 -4
- 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 +40 -4
- 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 +16 -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 +1 -0
- package/dist/host/life/host-memory.js +4 -1
- package/dist/host/life/watchdog.d.ts +11 -0
- package/dist/host/life/watchdog.js +36 -4
- 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 +44 -16
- package/dist/runtime/daemon.js +1154 -857
- package/dist/runtime/db.js +44 -16
- package/dist/runtime/main.js +532 -115
- package/dist/runtime/netproxy.js +34 -9
- package/dist/runtime/view.js +499 -149
- package/dist/selftest/app.test.js +620 -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/guest-boot.test.js +47 -1
- package/dist/selftest/hcs.test.js +105 -8
- package/dist/selftest/health.test.js +71 -0
- package/dist/selftest/heavy-load.test.js +152 -66
- 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/network.test.js +20 -1
- 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 +5 -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/io/copy-tree.d.ts +7 -0
- package/dist/shared/io/copy-tree.js +45 -0
- package/dist/shared/io/index.d.ts +2 -0
- package/dist/shared/io/index.js +2 -0
- package/dist/shared/io/robocopy-result.d.ts +6 -0
- package/dist/shared/io/robocopy-result.js +23 -0
- package/dist/shared/memory/policy.d.ts +38 -12
- package/dist/shared/memory/policy.js +58 -19
- package/dist/shared/network/firewall-rules.d.ts +8 -0
- package/dist/shared/network/firewall-rules.js +28 -0
- 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.js +1 -1
- package/dist/web/index.html +2 -2
- package/dist/web/{main-T5DMCHYV.css → main-6JF3ASB5.css} +1 -1
- package/dist/web/main-Z645W45E.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 +128 -107
- package/native/scripts/memory-status.ps1 +10 -2
- package/package.json +10 -3
- package/sandbox/csharp/MemGov.cs +668 -398
- 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/new-shortcuts.ps1 +3 -1
- package/sandbox/scripts/repair-wmi-services.ps1 +26 -0
- package/schemas/config.schema.json +25 -7
- 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
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
// `sandbox storage`: where everything kept between sandboxes lives, moving it to another folder (with the size, an
|
|
2
|
-
// estimate and a warning first) and switching to a folder without moving. The work is in host/storage.
|
|
3
|
-
import fs from 'node:fs';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
import { userConfigPath, userDir } from '../../../core/config/index.js';
|
|
6
|
-
import { diskUsage, humanBytes } from '../../../core/disk.js';
|
|
7
|
-
import { askChoice, askName, askRequired } from '../../../core/prompt.js';
|
|
8
|
-
import { expandPath, fail } from '../../../core/util/index.js';
|
|
9
|
-
import { describeDuration, describeSize, estimate, holdsData, measureFolder, mountedSets, moveWarning, otherDataFolders, sharedDefaultRoot, StorageHistory, StorageMove, } from '../../../host/storage/index.js';
|
|
10
|
-
import { isSandboxRunning } from '../../../host/sandbox/index.js';
|
|
11
|
-
import { protectPrivateFolder } from '../../../host/sharing/index.js';
|
|
12
|
-
import { watcherRunning } from '../../../sync/index.js';
|
|
13
|
-
import { printJson, working } from '../../output/index.js';
|
|
14
|
-
import { requireOnPc } from '../context.js';
|
|
15
|
-
import { contained } from './contained.js';
|
|
16
|
-
/** Why a move cannot start (a background sync is still on a data folder in the old storage), or null. */
|
|
17
|
-
export function storageBusy(root) {
|
|
18
|
-
const mounted = mountedSets(root);
|
|
19
|
-
if (mounted.length > 0)
|
|
20
|
-
return ('The contained storage of "' +
|
|
21
|
-
mounted.join('", "') +
|
|
22
|
-
'" is mounted (a disk image; moving now would reach into it).');
|
|
23
|
-
const data = path.join(root, 'data');
|
|
24
|
-
try {
|
|
25
|
-
for (const name of fs.readdirSync(data))
|
|
26
|
-
if (watcherRunning(path.join(data, name)))
|
|
27
|
-
return 'The background sync of "' + name + '" is still finishing.';
|
|
28
|
-
}
|
|
29
|
-
catch {
|
|
30
|
-
// no data folder: nothing runs
|
|
31
|
-
}
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
function mover(ctx) {
|
|
35
|
-
return new StorageMove(ctx.loaded.configPath ?? userConfigPath(), () => storageBusy(ctx.storageRoot), isSandboxRunning, protectPrivateFolder);
|
|
36
|
-
}
|
|
37
|
-
/** The path as typed (variables and ~ expand, relative to the current folder). */
|
|
38
|
-
function typedPath(value) {
|
|
39
|
-
return expandPath(value, process.cwd());
|
|
40
|
-
}
|
|
41
|
-
/** The folder typed, or picked from the default folder, folders that hold data and the drives (or typed in). */
|
|
42
|
-
async function folderOf(ctx, value, what) {
|
|
43
|
-
if (value)
|
|
44
|
-
return typedPath(value);
|
|
45
|
-
const fix = 'Use: sandbox storage ' + what + ' <folder>';
|
|
46
|
-
const typed = 'type';
|
|
47
|
-
const known = [sharedDefaultRoot(), ...otherDataFolders(ctx.storageRoot, new StorageHistory(userDir()))];
|
|
48
|
-
const drives = diskUsage(ctx.storageRoot)
|
|
49
|
-
.filter((d) => !d.holdsStorage)
|
|
50
|
-
.map((d) => path.join(d.drive, 'AgentSandbox'));
|
|
51
|
-
const choices = [...new Set([...known, ...drives])]
|
|
52
|
-
.filter((f) => f.toLowerCase() !== ctx.storageRoot.toLowerCase())
|
|
53
|
-
.map((f) => ({ name: f, value: f }));
|
|
54
|
-
const picked = await askChoice('Which folder?', [...choices, { name: 'Type a path...', value: typed }], fix);
|
|
55
|
-
if (picked !== typed)
|
|
56
|
-
return picked;
|
|
57
|
-
const answer = await askName('Folder:', fix, (v) => v.length > 0 || 'Type a folder path.');
|
|
58
|
-
return typedPath(answer);
|
|
59
|
-
}
|
|
60
|
-
async function show(ctx) {
|
|
61
|
-
const history = new StorageHistory(userDir());
|
|
62
|
-
const measured = await working('Measuring your saved data (big folders take a moment)', () => measureFolder(ctx.storageRoot), !ctx.options.json);
|
|
63
|
-
const others = otherDataFolders(ctx.storageRoot, history);
|
|
64
|
-
const shared = sharedDefaultRoot();
|
|
65
|
-
if (printJson(ctx, {
|
|
66
|
-
root: ctx.storageRoot,
|
|
67
|
-
exists: fs.existsSync(ctx.storageRoot),
|
|
68
|
-
...measured,
|
|
69
|
-
defaultRoot: shared,
|
|
70
|
-
otherFoldersWithData: others,
|
|
71
|
-
}))
|
|
72
|
-
return 0;
|
|
73
|
-
const inUse = shared.toLowerCase() === ctx.storageRoot.toLowerCase() ? ' (in use)' : '';
|
|
74
|
-
console.log('Your saved data is in: ' + ctx.storageRoot);
|
|
75
|
-
console.log(' ' + (holdsData(ctx.storageRoot) ? describeSize(measured) : 'nothing in it yet'));
|
|
76
|
-
console.log('The default folder is: ' + shared + inUse);
|
|
77
|
-
for (const other of others)
|
|
78
|
-
console.log('Another folder with data: ' + other);
|
|
79
|
-
console.log('\nMove it with: sandbox storage move <folder> (or switch without moving: sandbox storage use <folder>)');
|
|
80
|
-
console.log('What takes the space: sandbox data');
|
|
81
|
-
return 0;
|
|
82
|
-
}
|
|
83
|
-
function printPlan(from, to, measured, copyOnly) {
|
|
84
|
-
const est = estimate(from, to, measured, copyOnly);
|
|
85
|
-
const time = est.sameVolume
|
|
86
|
-
? 'a few seconds (same drive, nothing is copied)'
|
|
87
|
-
: describeDuration(est.seconds) + ' (copied to another drive)';
|
|
88
|
-
console.log('Move from: ' + from);
|
|
89
|
-
console.log(' to: ' + to);
|
|
90
|
-
console.log(' size: ' + describeSize(measured));
|
|
91
|
-
console.log(' time: ' + time);
|
|
92
|
-
const warning = moveWarning(measured, est);
|
|
93
|
-
if (warning)
|
|
94
|
-
console.log('Warning: ' + warning);
|
|
95
|
-
if (!est.fits)
|
|
96
|
-
fail('Not enough free space on the target drive.', 'Free some space or pick another drive.');
|
|
97
|
-
}
|
|
98
|
-
/** Moves the data with progress on the terminal; remembers both folders. Used by the command and the start offer. */
|
|
99
|
-
export async function performMove(ctx, to, keepOld) {
|
|
100
|
-
const from = ctx.storageRoot;
|
|
101
|
-
const history = new StorageHistory(userDir());
|
|
102
|
-
let line = 'Moving your data';
|
|
103
|
-
const result = await working(() => line, () => mover(ctx).move(from, to, {
|
|
104
|
-
keepOld,
|
|
105
|
-
onProgress: (p) => {
|
|
106
|
-
line = 'Copying: ' + p.files.toLocaleString('en-US') + ' files, ' + humanBytes(p.bytes);
|
|
107
|
-
},
|
|
108
|
-
}));
|
|
109
|
-
history.remember(from);
|
|
110
|
-
history.remember(to);
|
|
111
|
-
return result;
|
|
112
|
-
}
|
|
113
|
-
async function move(ctx) {
|
|
114
|
-
const to = await folderOf(ctx, ctx.options.positionals[1], 'move');
|
|
115
|
-
const from = ctx.storageRoot;
|
|
116
|
-
if (!fs.existsSync(from))
|
|
117
|
-
fail('There is nothing to move: ' + from + ' does not exist.', 'Use sandbox storage use ' + to + ' to switch.');
|
|
118
|
-
mover(ctx).validate(from, to);
|
|
119
|
-
const measured = await working('Measuring your saved data', () => measureFolder(from), !ctx.options.json);
|
|
120
|
-
const keepOld = ctx.options.keepOld;
|
|
121
|
-
printPlan(from, to, measured, keepOld);
|
|
122
|
-
if (!ctx.options.yes) {
|
|
123
|
-
if (!(await askRequired('Move your data to ' + to + '?', 'Add --yes to move without asking.', true))) {
|
|
124
|
-
console.log('Nothing was moved.');
|
|
125
|
-
return 1;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
const result = await performMove(ctx, to, keepOld);
|
|
129
|
-
if (printJson(ctx, result))
|
|
130
|
-
return 0;
|
|
131
|
-
const left = result.removedOld ? '' : '; the old folder is still at ' + result.from;
|
|
132
|
-
console.log('Moved ' + result.files.toLocaleString('en-US') + ' files. Your data is now in ' + result.to + left + '.');
|
|
133
|
-
for (const note of result.notes)
|
|
134
|
-
console.log(note);
|
|
135
|
-
console.log('Your settings now point to ' + result.pinned + ', so older versions find the data too.');
|
|
136
|
-
return 0;
|
|
137
|
-
}
|
|
138
|
-
async function use(ctx) {
|
|
139
|
-
const to = await folderOf(ctx, ctx.options.positionals[1], 'use');
|
|
140
|
-
if (to.toLowerCase() === ctx.storageRoot.toLowerCase()) {
|
|
141
|
-
console.log('That folder is in use already.');
|
|
142
|
-
return 0;
|
|
143
|
-
}
|
|
144
|
-
const busy = storageBusy(ctx.storageRoot);
|
|
145
|
-
if (busy)
|
|
146
|
-
fail(busy, 'Wait a minute, then try again.');
|
|
147
|
-
const state = holdsData(to)
|
|
148
|
-
? to + ' is used as it is.'
|
|
149
|
-
: to + ' starts empty: tools, logins and history are set up again.';
|
|
150
|
-
console.log('Warning: your data stays in ' + ctx.storageRoot + '. ' + state);
|
|
151
|
-
if (!ctx.options.yes) {
|
|
152
|
-
if (!(await askRequired('Use ' + to + ' from now on, without moving your data?', 'Add --yes to switch without asking.'))) {
|
|
153
|
-
console.log('Nothing was changed.');
|
|
154
|
-
return 1;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
new StorageHistory(userDir()).remember(ctx.storageRoot);
|
|
158
|
-
mover(ctx).pin(to);
|
|
159
|
-
console.log('Your data is now looked for in ' + to + '. Move it later with: sandbox storage move <folder>');
|
|
160
|
-
return 0;
|
|
161
|
-
}
|
|
162
|
-
/** `sandbox storage [show|move <folder>|use <folder>]`. */
|
|
163
|
-
export function storage(ctx) {
|
|
164
|
-
requireOnPc('storage');
|
|
165
|
-
const [action = 'show'] = ctx.options.positionals;
|
|
166
|
-
switch (action) {
|
|
167
|
-
case 'show':
|
|
168
|
-
case 'info':
|
|
169
|
-
return show(ctx);
|
|
170
|
-
case 'move':
|
|
171
|
-
return move(ctx);
|
|
172
|
-
case 'use':
|
|
173
|
-
return use(ctx);
|
|
174
|
-
case 'contained':
|
|
175
|
-
return contained(ctx);
|
|
176
|
-
default:
|
|
177
|
-
return fail('Unknown storage action "' + action + '".', 'Use: sandbox storage, sandbox storage move <folder>, sandbox storage use <folder> or sandbox storage contained on|off|status');
|
|
178
|
-
}
|
|
179
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import type { Harness } from '../../core/types.js';
|
|
2
|
-
import type { App } from '../tui/index.js';
|
|
3
|
-
import type { ConfigFile } from '../../app/features/settings/index.js';
|
|
4
|
-
import type { Draft } from './settings/draft.js';
|
|
5
|
-
/** How a new agent gets into the sandbox. */
|
|
6
|
-
export type AgentSource = 'npm' | 'uv' | 'host';
|
|
7
|
-
/** Nothing wrong with the name (true), or what is wrong. Pure. */
|
|
8
|
-
export declare function agentNameProblem(name: string, taken: readonly string[]): true | string;
|
|
9
|
-
/** The command a package usually provides: "@scope/my-agent@latest" gives "my-agent". Pure. */
|
|
10
|
-
export declare function commandFromPackage(pkg: string): string;
|
|
11
|
-
/** The config entry for a new agent. Pure. */
|
|
12
|
-
export declare function newAgent(source: AgentSource, what: string, command: string, hostDir?: string): Harness;
|
|
13
|
-
/** What `harnesses` should say with `name` taken out. Pure. */
|
|
14
|
-
export declare function withoutAgent(current: unknown, name: string): Record<string, unknown>;
|
|
15
|
-
/** Writes a setting to your config file now, or adds it to the unsaved changes when it has some already. */
|
|
16
|
-
export declare function writeOrStage(file: ConfigFile, draft: Draft, key: string[], value: unknown): {
|
|
17
|
-
saved: boolean;
|
|
18
|
-
};
|
|
19
|
-
/** What `harnesses` should say with `name` added to what is staged or in the file now. Pure. */
|
|
20
|
-
export declare function withAgent(current: unknown, name: string, harness: Harness): Record<string, unknown>;
|
|
21
|
-
/** Makes `name` the agent that starts by default (written now, or joined to unsaved changes to that setting). */
|
|
22
|
-
export declare function makeDefaultAgent(file: ConfigFile, draft: Draft, name: string): {
|
|
23
|
-
saved: boolean;
|
|
24
|
-
};
|
|
25
|
-
/** Takes an agent you added out of your settings (the built-in ones are not removable). */
|
|
26
|
-
export declare function removeAgent(file: ConfigFile, draft: Draft, name: string): {
|
|
27
|
-
saved: boolean;
|
|
28
|
-
};
|
|
29
|
-
export interface AddedAgent {
|
|
30
|
-
readonly name: string;
|
|
31
|
-
/** Written to your config file now (false: waiting for Ctrl+S with the other unsaved changes). */
|
|
32
|
-
readonly saved: boolean;
|
|
33
|
-
}
|
|
34
|
-
export declare class AddAgent {
|
|
35
|
-
private readonly app;
|
|
36
|
-
private readonly file;
|
|
37
|
-
private readonly draft;
|
|
38
|
-
/** Every agent that exists now (the new name must be different). */
|
|
39
|
-
private readonly taken;
|
|
40
|
-
constructor(app: App, file: ConfigFile, draft: Draft,
|
|
41
|
-
/** Every agent that exists now (the new name must be different). */
|
|
42
|
-
taken: readonly string[]);
|
|
43
|
-
/** Asks, then adds the agent. Undefined when you backed out. */
|
|
44
|
-
run(): Promise<AddedAgent | undefined>;
|
|
45
|
-
/** Validates and writes (or stages) the entry. */
|
|
46
|
-
private add;
|
|
47
|
-
}
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
// "Add an agent": a few questions (how it installs, its name, its package or program) that end in a new entry of
|
|
2
|
-
// `harnesses` in your own config file. It is written at once, unless harnesses has unsaved changes in Settings (then
|
|
3
|
-
// it joins them). Everything else about the agent (arguments, login folders ...) is edited in Settings > Agents &
|
|
4
|
-
// sessions.
|
|
5
|
-
import { DEFAULTS } from '../../core/config/index.js';
|
|
6
|
-
import { HarnessSchema, NameSchema, describeIssues } from '../../core/schema/index.js';
|
|
7
|
-
import { fail } from '../../core/util/index.js';
|
|
8
|
-
import { askPath } from './settings/ask-path.js';
|
|
9
|
-
/** Nothing wrong with the name (true), or what is wrong. Pure. */
|
|
10
|
-
export function agentNameProblem(name, taken) {
|
|
11
|
-
const typed = name.trim();
|
|
12
|
-
if (!typed)
|
|
13
|
-
return 'Type a name.';
|
|
14
|
-
const parsed = NameSchema.safeParse(typed);
|
|
15
|
-
if (!parsed.success)
|
|
16
|
-
return 'Use letters, numbers, - and _ only.';
|
|
17
|
-
if (taken.some((t) => t.toLowerCase() === typed.toLowerCase()))
|
|
18
|
-
return typed + ' is an agent already.';
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
/** The command a package usually provides: "@scope/my-agent@latest" gives "my-agent". Pure. */
|
|
22
|
-
export function commandFromPackage(pkg) {
|
|
23
|
-
const version = pkg.lastIndexOf('@');
|
|
24
|
-
const bare = version > 0 ? pkg.slice(0, version) : pkg;
|
|
25
|
-
return (bare.split(/[\\/]/).pop() ?? '').replace(/[^A-Za-z0-9._-]/g, '');
|
|
26
|
-
}
|
|
27
|
-
/** The config entry for a new agent. Pure. */
|
|
28
|
-
export function newAgent(source, what, command, hostDir = 'auto') {
|
|
29
|
-
const common = { arguments: [], environment: {} };
|
|
30
|
-
if (source === 'npm')
|
|
31
|
-
return { ...common, npmPackage: what, npmBin: command };
|
|
32
|
-
if (source === 'uv')
|
|
33
|
-
return { ...common, uvPackage: what, uvBin: command };
|
|
34
|
-
return { ...common, hostExecutable: what, hostDir };
|
|
35
|
-
}
|
|
36
|
-
/** What `harnesses` should say with `name` taken out. Pure. */
|
|
37
|
-
export function withoutAgent(current, name) {
|
|
38
|
-
const rest = { ...(current && typeof current === 'object' ? current : {}) };
|
|
39
|
-
delete rest[name];
|
|
40
|
-
return rest;
|
|
41
|
-
}
|
|
42
|
-
/** Writes a setting to your config file now, or adds it to the unsaved changes when it has some already. */
|
|
43
|
-
export function writeOrStage(file, draft, key, value) {
|
|
44
|
-
if (draft.has(file, key)) {
|
|
45
|
-
draft.stage(file, key, value);
|
|
46
|
-
return { saved: false };
|
|
47
|
-
}
|
|
48
|
-
const result = file.set(key, value);
|
|
49
|
-
if (typeof result === 'object')
|
|
50
|
-
fail('It could not be saved: ' + result.problems.join('; '));
|
|
51
|
-
return { saved: true };
|
|
52
|
-
}
|
|
53
|
-
/** What `harnesses` should say with `name` added to what is staged or in the file now. Pure. */
|
|
54
|
-
export function withAgent(current, name, harness) {
|
|
55
|
-
return { ...(current && typeof current === 'object' ? current : {}), [name]: harness };
|
|
56
|
-
}
|
|
57
|
-
/** The staged value of a setting, else what your own file says (what `harnesses` or `defaultHarness` will be). */
|
|
58
|
-
function current(file, draft, key) {
|
|
59
|
-
return draft.has(file, key) ? draft.value(file, key) : file.valueInFile(key);
|
|
60
|
-
}
|
|
61
|
-
/** Makes `name` the agent that starts by default (written now, or joined to unsaved changes to that setting). */
|
|
62
|
-
export function makeDefaultAgent(file, draft, name) {
|
|
63
|
-
return writeOrStage(file, draft, ['defaultHarness'], name);
|
|
64
|
-
}
|
|
65
|
-
/** Takes an agent you added out of your settings (the built-in ones are not removable). */
|
|
66
|
-
export function removeAgent(file, draft, name) {
|
|
67
|
-
if (name in DEFAULTS.harnesses)
|
|
68
|
-
fail(name + ' is built in, so it cannot be removed.');
|
|
69
|
-
const key = ['harnesses'];
|
|
70
|
-
const standing = current(file, draft, ['defaultHarness']) ?? file.userConfig().defaultHarness;
|
|
71
|
-
if (standing === name)
|
|
72
|
-
fail(name + ' is the default agent.', 'Make another agent the default first.');
|
|
73
|
-
const rest = withoutAgent(current(file, draft, key), name);
|
|
74
|
-
// Nothing of your own left: the setting goes (the built-in agents need no line).
|
|
75
|
-
return writeOrStage(file, draft, key, Object.keys(rest).length ? rest : undefined);
|
|
76
|
-
}
|
|
77
|
-
export class AddAgent {
|
|
78
|
-
app;
|
|
79
|
-
file;
|
|
80
|
-
draft;
|
|
81
|
-
taken;
|
|
82
|
-
constructor(app, file, draft,
|
|
83
|
-
/** Every agent that exists now (the new name must be different). */
|
|
84
|
-
taken) {
|
|
85
|
-
this.app = app;
|
|
86
|
-
this.file = file;
|
|
87
|
-
this.draft = draft;
|
|
88
|
-
this.taken = taken;
|
|
89
|
-
}
|
|
90
|
-
/** Asks, then adds the agent. Undefined when you backed out. */
|
|
91
|
-
async run() {
|
|
92
|
-
const path = ['Agents', 'Add an agent'];
|
|
93
|
-
const source = await this.app.choose(path, 'How does the agent get into the sandbox?', [
|
|
94
|
-
{
|
|
95
|
-
value: 'npm',
|
|
96
|
-
label: 'An npm package',
|
|
97
|
-
description: 'Installed inside the sandbox with npm once and kept (e.g. @openai/codex).',
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
value: 'uv',
|
|
101
|
-
label: 'A Python package',
|
|
102
|
-
description: 'Installed inside the sandbox with uv once and kept (e.g. aider-chat).',
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
value: 'host',
|
|
106
|
-
label: 'A program on this PC',
|
|
107
|
-
description: 'An .exe copied from this PC into the sandbox (looked up on PATH and in ~/.local/bin).',
|
|
108
|
-
},
|
|
109
|
-
]);
|
|
110
|
-
if (!source)
|
|
111
|
-
return undefined;
|
|
112
|
-
const name = await this.app.text({
|
|
113
|
-
path,
|
|
114
|
-
label: 'Name of the agent',
|
|
115
|
-
about: ['What you type after "sandbox", e.g. sandbox <name>. Letters, numbers, - and _.'],
|
|
116
|
-
validate: (v) => agentNameProblem(v, this.taken),
|
|
117
|
-
});
|
|
118
|
-
if (!name)
|
|
119
|
-
return undefined;
|
|
120
|
-
if (source === 'host') {
|
|
121
|
-
const exe = await askPath(this.app, {
|
|
122
|
-
path,
|
|
123
|
-
title: 'Choose the program (.exe)',
|
|
124
|
-
about: ['The agent program on this PC. It is copied into the sandbox. A bare file name is looked up on PATH.'],
|
|
125
|
-
kind: 'file',
|
|
126
|
-
validate: (v) => (v.trim() ? true : 'Choose a file.'),
|
|
127
|
-
});
|
|
128
|
-
if (!exe)
|
|
129
|
-
return undefined;
|
|
130
|
-
const slash = Math.max(exe.lastIndexOf('\\'), exe.lastIndexOf('/'));
|
|
131
|
-
const dir = slash > 0 ? exe.slice(0, slash) : 'auto';
|
|
132
|
-
return this.add(name.trim(), newAgent('host', exe.slice(slash + 1), '', dir));
|
|
133
|
-
}
|
|
134
|
-
const what = await this.app.text({
|
|
135
|
-
path,
|
|
136
|
-
label: source === 'npm' ? 'npm package' : 'Python package',
|
|
137
|
-
about: [
|
|
138
|
-
source === 'npm'
|
|
139
|
-
? 'The package to install, optionally with a version: @scope/name or name@latest.'
|
|
140
|
-
: 'The package for `uv tool install`.',
|
|
141
|
-
],
|
|
142
|
-
validate: (v) => (v.trim() ? true : 'Type it.'),
|
|
143
|
-
});
|
|
144
|
-
if (!what)
|
|
145
|
-
return undefined;
|
|
146
|
-
const command = await this.app.text({
|
|
147
|
-
path,
|
|
148
|
-
label: 'Command',
|
|
149
|
-
about: ['The command the package provides; it is what runs inside the sandbox.'],
|
|
150
|
-
initial: commandFromPackage(what.trim()),
|
|
151
|
-
validate: (v) => (/^[A-Za-z0-9._-]+$/.test(v.trim()) ? true : 'Letters, numbers, . - and _ only.'),
|
|
152
|
-
});
|
|
153
|
-
if (!command)
|
|
154
|
-
return undefined;
|
|
155
|
-
return this.add(name.trim(), newAgent(source, what.trim(), command.trim()));
|
|
156
|
-
}
|
|
157
|
-
/** Validates and writes (or stages) the entry. */
|
|
158
|
-
add(name, harness) {
|
|
159
|
-
const checked = HarnessSchema.safeParse(harness);
|
|
160
|
-
if (!checked.success)
|
|
161
|
-
fail('That agent is not valid: ' + describeIssues(checked.error).join('; '));
|
|
162
|
-
const key = ['harnesses'];
|
|
163
|
-
return {
|
|
164
|
-
name,
|
|
165
|
-
...writeOrStage(this.file, this.draft, key, withAgent(current(this.file, this.draft, key), name, harness)),
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
}
|
package/dist/cli/menu/apps.d.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { type AppCategory, type AppEntry } from '../../shared/apps/index.js';
|
|
2
|
-
import { type Category, type ListItem } from '../tui/index.js';
|
|
3
|
-
import type { ConfigFile } from '../../app/features/settings/index.js';
|
|
4
|
-
import type { Draft } from './settings/draft.js';
|
|
5
|
-
export declare const CUSTOM = "@custom:";
|
|
6
|
-
/** The catalogue has many small categories; the menu shows these few groups so the navigation stays short. */
|
|
7
|
-
export declare const APP_GROUPS: readonly [{
|
|
8
|
-
readonly id: "editors";
|
|
9
|
-
readonly label: "Editors & docs";
|
|
10
|
-
readonly description: "Code and text editors (VS Code is on by default), plus diagrams and document conversion.";
|
|
11
|
-
readonly members: readonly ["editors", "diagrams"];
|
|
12
|
-
}, {
|
|
13
|
-
readonly id: "clients";
|
|
14
|
-
readonly label: "DB & API clients";
|
|
15
|
-
readonly description: "GUIs for the sandbox databases, tools to send HTTP, REST and GraphQL requests, and to inspect traffic.";
|
|
16
|
-
readonly members: readonly ["databases", "api", "network"];
|
|
17
|
-
}, {
|
|
18
|
-
readonly id: "tools";
|
|
19
|
-
readonly label: "Git & utilities";
|
|
20
|
-
readonly description: "Git GUIs and terminal UIs, archives, file search and comparing, process tools, and decompilers.";
|
|
21
|
-
readonly members: readonly ["git", "utilities", "reversing"];
|
|
22
|
-
}, {
|
|
23
|
-
readonly id: "cli";
|
|
24
|
-
readonly label: "Command-line & cloud";
|
|
25
|
-
readonly description: "Small developer tools (JSON, search, builds, media ...) and tools for clouds and Kubernetes.";
|
|
26
|
-
readonly members: readonly ["cli", "cloud"];
|
|
27
|
-
}, {
|
|
28
|
-
readonly id: "play";
|
|
29
|
-
readonly label: "Browsers & games";
|
|
30
|
-
readonly description: "Browsers for testing web apps, and game engines and editors (they draw with OpenGL on the CPU).";
|
|
31
|
-
readonly members: readonly ["browsers", "gamedev"];
|
|
32
|
-
}];
|
|
33
|
-
/** The group an app category is shown under. */
|
|
34
|
-
export declare function groupOf(category: AppCategory): string;
|
|
35
|
-
/** The row in Apps that opens the "request an app" issue form (its id is not an app). */
|
|
36
|
-
export declare const REQUEST_APP = "@request-app";
|
|
37
|
-
/** This project's new-issue page on GitHub. */
|
|
38
|
-
export declare const ISSUES_URL = "https://github.com/JoshDiDuca/windows-development-sandbox/issues/new";
|
|
39
|
-
/** The new-issue address with a title and a body to fill in (the page needs no login to show it). */
|
|
40
|
-
export declare function requestAppUrl(): string;
|
|
41
|
-
export declare class AppsModel {
|
|
42
|
-
private readonly file;
|
|
43
|
-
private readonly dataPath;
|
|
44
|
-
constructor(file: ConfigFile, dataPath: string);
|
|
45
|
-
/** The catalogue entries this file can change (a project cannot change an app that has a setting of its own). */
|
|
46
|
-
entries(): AppEntry[];
|
|
47
|
-
categories(): Category[];
|
|
48
|
-
/** Downloaded already (into this data folder), so the next sandbox starts it without a download. */
|
|
49
|
-
private installed;
|
|
50
|
-
private savedInstall;
|
|
51
|
-
/** Is the entry on in the saved file? */
|
|
52
|
-
private savedOn;
|
|
53
|
-
/** Is the entry on once the staged changes are saved? */
|
|
54
|
-
isOn(entry: AppEntry, draft: Draft): boolean;
|
|
55
|
-
/** Your own programs (apps.custom), staged or saved. */
|
|
56
|
-
custom(draft: Draft): Record<string, {
|
|
57
|
-
name: string;
|
|
58
|
-
github?: string;
|
|
59
|
-
url?: string;
|
|
60
|
-
cli?: boolean;
|
|
61
|
-
}>;
|
|
62
|
-
private item;
|
|
63
|
-
items(draft: Draft): ListItem<string>[];
|
|
64
|
-
/** Stages the ticks of the list: only what differs from the saved file is kept in the draft. */
|
|
65
|
-
stageTicks(draft: Draft, ticked: readonly string[]): void;
|
|
66
|
-
}
|
|
67
|
-
/** For notices: "12 apps chosen". */
|
|
68
|
-
export declare function appsSummary(file: ConfigFile): string;
|
|
69
|
-
export declare function appLabel(id: string): string;
|