windows-development-sandbox 1.10.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 +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 +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 +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 +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/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 +323 -176
- package/dist/runtime/db.js +30 -6
- package/dist/runtime/main.js +375 -76
- package/dist/runtime/netproxy.js +30 -6
- package/dist/runtime/view.js +495 -146
- 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/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.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/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
|
@@ -1,9 +1,111 @@
|
|
|
1
|
+
import { addAgent, agentsView, listAgents, makeDefaultAgent, removeAgent, startAgent } from './agents/agents.def.js';
|
|
2
|
+
import { accountsView, defaultAccount, listAccounts, removeAccount, renameAccount, saveAccount, useAccount, } from './accounts/accounts.def.js';
|
|
3
|
+
import { appsView, listApps, requestApp, setCustomApps, toggleApp } from './apps/apps.def.js';
|
|
4
|
+
import { browseFolder } from './files/files.def.js';
|
|
5
|
+
import { checkEngine, cleanEngine, engineLeftovers, engineStatus, engineView } from './engine/engine.def.js';
|
|
6
|
+
import { checkHealth, enableSandbox, healthView, lastHealth, repairHealth } from './health/health.def.js';
|
|
7
|
+
import { cleanData, dataView, pruneStorage, showData } from './data/data.def.js';
|
|
8
|
+
import { changeDataFolder, containedOff, containedOn, containedStatus, moveStorage, showStorage, storageView, useStorage, } from './storage/storage.def.js';
|
|
1
9
|
import { hideWindow, sandboxStatus, sandboxView, showWindow, stopSandbox } from './sandbox/sandbox.def.js';
|
|
10
|
+
import { addProject, allProjects, chooseProjects, excludeProject, includeProject, listProjects, projectRoots, projectsView, removeProject, } from './projects/projects.def.js';
|
|
11
|
+
import { listLogs, logsView, tailLog } from './logs/logs.def.js';
|
|
2
12
|
import { listSessions, restartSessions, sessionsView } from './sessions/sessions.def.js';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
13
|
+
import { vpnLogin, vpnLogout, vpnStatus, vpnView } from './vpn/vpn.def.js';
|
|
14
|
+
import { githubLogin, githubLogout, githubStatus, githubView } from './github/github.def.js';
|
|
15
|
+
import { exportConfig, getSetting, importConfig, listSettings, resetSetting, setSetting, settingsView, } from './settings/settings.def.js';
|
|
16
|
+
import { migrateSettings, runUpdate, updatesStatus, updatesView } from './updates/updates.def.js';
|
|
17
|
+
import { openWeb, startWeb, stopWeb, webStatus, webView } from './web/web.def.js';
|
|
18
|
+
export const OPERATIONS = [
|
|
19
|
+
cleanEngine,
|
|
20
|
+
showWindow,
|
|
21
|
+
hideWindow,
|
|
22
|
+
stopSandbox,
|
|
23
|
+
restartSessions,
|
|
24
|
+
startAgent,
|
|
25
|
+
addAgent,
|
|
26
|
+
makeDefaultAgent,
|
|
27
|
+
removeAgent,
|
|
28
|
+
setSetting,
|
|
29
|
+
resetSetting,
|
|
30
|
+
exportConfig,
|
|
31
|
+
importConfig,
|
|
32
|
+
saveAccount,
|
|
33
|
+
useAccount,
|
|
34
|
+
defaultAccount,
|
|
35
|
+
renameAccount,
|
|
36
|
+
removeAccount,
|
|
37
|
+
toggleApp,
|
|
38
|
+
setCustomApps,
|
|
39
|
+
requestApp,
|
|
40
|
+
chooseProjects,
|
|
41
|
+
addProject,
|
|
42
|
+
removeProject,
|
|
43
|
+
includeProject,
|
|
44
|
+
excludeProject,
|
|
45
|
+
allProjects,
|
|
46
|
+
projectRoots,
|
|
47
|
+
checkHealth,
|
|
48
|
+
repairHealth,
|
|
49
|
+
enableSandbox,
|
|
50
|
+
cleanData,
|
|
51
|
+
pruneStorage,
|
|
52
|
+
runUpdate,
|
|
53
|
+
migrateSettings,
|
|
54
|
+
moveStorage,
|
|
55
|
+
useStorage,
|
|
56
|
+
changeDataFolder,
|
|
57
|
+
containedOn,
|
|
58
|
+
containedOff,
|
|
59
|
+
startWeb,
|
|
60
|
+
openWeb,
|
|
61
|
+
stopWeb,
|
|
62
|
+
vpnLogin,
|
|
63
|
+
vpnLogout,
|
|
64
|
+
githubLogin,
|
|
65
|
+
githubLogout,
|
|
66
|
+
];
|
|
67
|
+
export const QUERIES = [
|
|
68
|
+
sandboxStatus,
|
|
69
|
+
listSessions,
|
|
70
|
+
listAgents,
|
|
71
|
+
listSettings,
|
|
72
|
+
getSetting,
|
|
73
|
+
browseFolder,
|
|
74
|
+
listAccounts,
|
|
75
|
+
listApps,
|
|
76
|
+
listProjects,
|
|
77
|
+
lastHealth,
|
|
78
|
+
showData,
|
|
79
|
+
showStorage,
|
|
80
|
+
containedStatus,
|
|
81
|
+
listLogs,
|
|
82
|
+
tailLog,
|
|
83
|
+
updatesStatus,
|
|
84
|
+
engineStatus,
|
|
85
|
+
checkEngine,
|
|
86
|
+
engineLeftovers,
|
|
87
|
+
webStatus,
|
|
88
|
+
vpnStatus,
|
|
89
|
+
githubStatus,
|
|
90
|
+
];
|
|
91
|
+
export const VIEWS = [
|
|
92
|
+
sandboxView,
|
|
93
|
+
sessionsView,
|
|
94
|
+
agentsView,
|
|
95
|
+
settingsView,
|
|
96
|
+
accountsView,
|
|
97
|
+
appsView,
|
|
98
|
+
projectsView,
|
|
99
|
+
healthView,
|
|
100
|
+
dataView,
|
|
101
|
+
storageView,
|
|
102
|
+
logsView,
|
|
103
|
+
updatesView,
|
|
104
|
+
engineView,
|
|
105
|
+
webView,
|
|
106
|
+
vpnView,
|
|
107
|
+
githubView,
|
|
108
|
+
];
|
|
7
109
|
export const DEFINITIONS = [...OPERATIONS, ...QUERIES];
|
|
8
110
|
export function definitionById(id) {
|
|
9
111
|
return DEFINITIONS.find((d) => d.id === id);
|
|
@@ -17,12 +119,47 @@ export function queryById(id) {
|
|
|
17
119
|
export function viewById(id) {
|
|
18
120
|
return VIEWS.find((v) => v.id === id);
|
|
19
121
|
}
|
|
122
|
+
/** Every entry of the navigation, children included, in order. */
|
|
123
|
+
export function navSections(nav) {
|
|
124
|
+
return nav.flatMap((n) => [n, ...navSections(n.children ?? [])]);
|
|
125
|
+
}
|
|
126
|
+
/** Every view the web's navigation opens. */
|
|
127
|
+
export function navViews(nav) {
|
|
128
|
+
return navSections(nav).flatMap((n) => (n.view ? [n.view] : []));
|
|
129
|
+
}
|
|
20
130
|
export const NAV = [
|
|
21
|
-
{ label: 'Agents',
|
|
131
|
+
{ label: 'Agents', view: 'agents' },
|
|
22
132
|
{ label: 'Sessions', view: 'sessions' },
|
|
23
|
-
{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
133
|
+
{
|
|
134
|
+
label: 'Sandbox',
|
|
135
|
+
children: [
|
|
136
|
+
{ label: 'Status', view: 'sandbox' },
|
|
137
|
+
{ label: 'Projects', view: 'projects' },
|
|
138
|
+
],
|
|
139
|
+
},
|
|
140
|
+
{ label: 'Apps', view: 'apps' },
|
|
141
|
+
{
|
|
142
|
+
label: 'Settings',
|
|
143
|
+
children: [
|
|
144
|
+
{ label: 'All settings', view: 'settings' },
|
|
145
|
+
{ label: 'VPN', view: 'vpn' },
|
|
146
|
+
{ label: 'GitHub', view: 'github' },
|
|
147
|
+
],
|
|
148
|
+
},
|
|
149
|
+
{ label: 'Accounts', view: 'accounts' },
|
|
150
|
+
{
|
|
151
|
+
label: 'Maintenance',
|
|
152
|
+
children: [
|
|
153
|
+
{ label: 'Updates', view: 'updates' },
|
|
154
|
+
{ label: 'Data', view: 'data' },
|
|
155
|
+
{ label: 'Storage', view: 'storage' },
|
|
156
|
+
{ label: 'Health', view: 'health' },
|
|
157
|
+
{ label: 'Logs', view: 'logs' },
|
|
158
|
+
{ label: 'Engine', view: 'engine' },
|
|
159
|
+
{
|
|
160
|
+
label: 'More',
|
|
161
|
+
elsewhere: 'The less common commands are in the menu (sandbox > Maintenance).',
|
|
162
|
+
},
|
|
163
|
+
],
|
|
164
|
+
},
|
|
28
165
|
];
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type Page } from '../../kernel/index.js';
|
|
3
|
+
/** The label of each capability, in the order the page and the command line show them. */
|
|
4
|
+
export declare const CAPABILITY_NAMES: {
|
|
5
|
+
readonly desktop: "desktop window";
|
|
6
|
+
readonly gpu: "GPU";
|
|
7
|
+
readonly clipboard: "clipboard";
|
|
8
|
+
readonly audio: "audio";
|
|
9
|
+
readonly video: "camera";
|
|
10
|
+
readonly printers: "printers";
|
|
11
|
+
readonly liveFolderAdd: "add folders while running";
|
|
12
|
+
readonly attachedDisks: "attached disks";
|
|
13
|
+
readonly multipleInstances: "several at once";
|
|
14
|
+
readonly hvsocket: "Hyper-V sockets";
|
|
15
|
+
};
|
|
16
|
+
export declare const EngineIdSchema: z.ZodEnum<{
|
|
17
|
+
"windows-sandbox": "windows-sandbox";
|
|
18
|
+
hcs: "hcs";
|
|
19
|
+
}>;
|
|
20
|
+
export declare const CapabilitiesSchema: z.ZodObject<{
|
|
21
|
+
desktop: z.ZodBoolean;
|
|
22
|
+
gpu: z.ZodBoolean;
|
|
23
|
+
clipboard: z.ZodBoolean;
|
|
24
|
+
audio: z.ZodBoolean;
|
|
25
|
+
video: z.ZodBoolean;
|
|
26
|
+
printers: z.ZodBoolean;
|
|
27
|
+
liveFolderAdd: z.ZodBoolean;
|
|
28
|
+
attachedDisks: z.ZodBoolean;
|
|
29
|
+
multipleInstances: z.ZodBoolean;
|
|
30
|
+
hvsocket: z.ZodBoolean;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
export declare const EngineCheckSchema: z.ZodObject<{
|
|
33
|
+
available: z.ZodBoolean;
|
|
34
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
35
|
+
fixes: z.ZodArray<z.ZodString>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
export declare const EngineReportSchema: z.ZodObject<{
|
|
38
|
+
id: z.ZodEnum<{
|
|
39
|
+
"windows-sandbox": "windows-sandbox";
|
|
40
|
+
hcs: "hcs";
|
|
41
|
+
}>;
|
|
42
|
+
inUse: z.ZodBoolean;
|
|
43
|
+
capabilities: z.ZodObject<{
|
|
44
|
+
desktop: z.ZodBoolean;
|
|
45
|
+
gpu: z.ZodBoolean;
|
|
46
|
+
clipboard: z.ZodBoolean;
|
|
47
|
+
audio: z.ZodBoolean;
|
|
48
|
+
video: z.ZodBoolean;
|
|
49
|
+
printers: z.ZodBoolean;
|
|
50
|
+
liveFolderAdd: z.ZodBoolean;
|
|
51
|
+
attachedDisks: z.ZodBoolean;
|
|
52
|
+
multipleInstances: z.ZodBoolean;
|
|
53
|
+
hvsocket: z.ZodBoolean;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
check: z.ZodObject<{
|
|
56
|
+
available: z.ZodBoolean;
|
|
57
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
58
|
+
fixes: z.ZodArray<z.ZodString>;
|
|
59
|
+
}, z.core.$strip>;
|
|
60
|
+
}, z.core.$strip>;
|
|
61
|
+
export type EngineReportRow = z.output<typeof EngineReportSchema>;
|
|
62
|
+
export declare const EnginesSchema: z.ZodObject<{
|
|
63
|
+
engine: z.ZodEnum<{
|
|
64
|
+
"windows-sandbox": "windows-sandbox";
|
|
65
|
+
hcs: "hcs";
|
|
66
|
+
}>;
|
|
67
|
+
engines: z.ZodArray<z.ZodObject<{
|
|
68
|
+
id: z.ZodEnum<{
|
|
69
|
+
"windows-sandbox": "windows-sandbox";
|
|
70
|
+
hcs: "hcs";
|
|
71
|
+
}>;
|
|
72
|
+
inUse: z.ZodBoolean;
|
|
73
|
+
capabilities: z.ZodObject<{
|
|
74
|
+
desktop: z.ZodBoolean;
|
|
75
|
+
gpu: z.ZodBoolean;
|
|
76
|
+
clipboard: z.ZodBoolean;
|
|
77
|
+
audio: z.ZodBoolean;
|
|
78
|
+
video: z.ZodBoolean;
|
|
79
|
+
printers: z.ZodBoolean;
|
|
80
|
+
liveFolderAdd: z.ZodBoolean;
|
|
81
|
+
attachedDisks: z.ZodBoolean;
|
|
82
|
+
multipleInstances: z.ZodBoolean;
|
|
83
|
+
hvsocket: z.ZodBoolean;
|
|
84
|
+
}, z.core.$strip>;
|
|
85
|
+
check: z.ZodObject<{
|
|
86
|
+
available: z.ZodBoolean;
|
|
87
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
88
|
+
fixes: z.ZodArray<z.ZodString>;
|
|
89
|
+
}, z.core.$strip>;
|
|
90
|
+
}, z.core.$strip>>;
|
|
91
|
+
}, z.core.$strip>;
|
|
92
|
+
export type Engines = z.output<typeof EnginesSchema>;
|
|
93
|
+
/** The lines `sandbox engine check` prints (plain: the colours are the command line's own). */
|
|
94
|
+
export declare function checkText(r: EngineReportRow): string;
|
|
95
|
+
export declare const engineStatus: import("../../kernel/define.js").QueryDef<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
96
|
+
engine: z.ZodEnum<{
|
|
97
|
+
"windows-sandbox": "windows-sandbox";
|
|
98
|
+
hcs: "hcs";
|
|
99
|
+
}>;
|
|
100
|
+
engines: z.ZodArray<z.ZodObject<{
|
|
101
|
+
id: z.ZodEnum<{
|
|
102
|
+
"windows-sandbox": "windows-sandbox";
|
|
103
|
+
hcs: "hcs";
|
|
104
|
+
}>;
|
|
105
|
+
inUse: z.ZodBoolean;
|
|
106
|
+
capabilities: z.ZodObject<{
|
|
107
|
+
desktop: z.ZodBoolean;
|
|
108
|
+
gpu: z.ZodBoolean;
|
|
109
|
+
clipboard: z.ZodBoolean;
|
|
110
|
+
audio: z.ZodBoolean;
|
|
111
|
+
video: z.ZodBoolean;
|
|
112
|
+
printers: z.ZodBoolean;
|
|
113
|
+
liveFolderAdd: z.ZodBoolean;
|
|
114
|
+
attachedDisks: z.ZodBoolean;
|
|
115
|
+
multipleInstances: z.ZodBoolean;
|
|
116
|
+
hvsocket: z.ZodBoolean;
|
|
117
|
+
}, z.core.$strip>;
|
|
118
|
+
check: z.ZodObject<{
|
|
119
|
+
available: z.ZodBoolean;
|
|
120
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
121
|
+
fixes: z.ZodArray<z.ZodString>;
|
|
122
|
+
}, z.core.$strip>;
|
|
123
|
+
}, z.core.$strip>>;
|
|
124
|
+
}, z.core.$strip>, "engine.status">;
|
|
125
|
+
export declare const checkEngine: import("../../kernel/define.js").QueryDef<z.ZodObject<{
|
|
126
|
+
engine: z.ZodDefault<z.ZodString>;
|
|
127
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
128
|
+
id: z.ZodEnum<{
|
|
129
|
+
"windows-sandbox": "windows-sandbox";
|
|
130
|
+
hcs: "hcs";
|
|
131
|
+
}>;
|
|
132
|
+
inUse: z.ZodBoolean;
|
|
133
|
+
capabilities: z.ZodObject<{
|
|
134
|
+
desktop: z.ZodBoolean;
|
|
135
|
+
gpu: z.ZodBoolean;
|
|
136
|
+
clipboard: z.ZodBoolean;
|
|
137
|
+
audio: z.ZodBoolean;
|
|
138
|
+
video: z.ZodBoolean;
|
|
139
|
+
printers: z.ZodBoolean;
|
|
140
|
+
liveFolderAdd: z.ZodBoolean;
|
|
141
|
+
attachedDisks: z.ZodBoolean;
|
|
142
|
+
multipleInstances: z.ZodBoolean;
|
|
143
|
+
hvsocket: z.ZodBoolean;
|
|
144
|
+
}, z.core.$strip>;
|
|
145
|
+
check: z.ZodObject<{
|
|
146
|
+
available: z.ZodBoolean;
|
|
147
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
148
|
+
fixes: z.ZodArray<z.ZodString>;
|
|
149
|
+
}, z.core.$strip>;
|
|
150
|
+
}, z.core.$strip>, "engine.check">;
|
|
151
|
+
export declare const LeftoverSystemSchema: z.ZodObject<{
|
|
152
|
+
id: z.ZodString;
|
|
153
|
+
kind: z.ZodString;
|
|
154
|
+
state: z.ZodString;
|
|
155
|
+
since: z.ZodNullable<z.ZodString>;
|
|
156
|
+
}, z.core.$strip>;
|
|
157
|
+
export type LeftoverRow = z.output<typeof LeftoverSystemSchema>;
|
|
158
|
+
export declare const LeftoversSchema: z.ZodObject<{
|
|
159
|
+
available: z.ZodBoolean;
|
|
160
|
+
message: z.ZodString;
|
|
161
|
+
systems: z.ZodArray<z.ZodObject<{
|
|
162
|
+
id: z.ZodString;
|
|
163
|
+
kind: z.ZodString;
|
|
164
|
+
state: z.ZodString;
|
|
165
|
+
since: z.ZodNullable<z.ZodString>;
|
|
166
|
+
}, z.core.$strip>>;
|
|
167
|
+
}, z.core.$strip>;
|
|
168
|
+
export type Leftovers = z.output<typeof LeftoversSchema>;
|
|
169
|
+
export declare const engineLeftovers: import("../../kernel/define.js").QueryDef<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
170
|
+
available: z.ZodBoolean;
|
|
171
|
+
message: z.ZodString;
|
|
172
|
+
systems: z.ZodArray<z.ZodObject<{
|
|
173
|
+
id: z.ZodString;
|
|
174
|
+
kind: z.ZodString;
|
|
175
|
+
state: z.ZodString;
|
|
176
|
+
since: z.ZodNullable<z.ZodString>;
|
|
177
|
+
}, z.core.$strip>>;
|
|
178
|
+
}, z.core.$strip>, "engine.leftovers">;
|
|
179
|
+
export declare const cleanEngine: import("../../kernel/define.js").OperationDef<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
180
|
+
available: z.ZodBoolean;
|
|
181
|
+
stopped: z.ZodNumber;
|
|
182
|
+
failed: z.ZodNumber;
|
|
183
|
+
message: z.ZodString;
|
|
184
|
+
}, z.core.$strip>, "engine.clean">;
|
|
185
|
+
/** The engine page: the engine in use, then a card per engine with its capabilities, reasons and fixes. Pure. */
|
|
186
|
+
export declare function enginePage(o: Engines, leftovers?: Leftovers): Page;
|
|
187
|
+
export declare const engineView: import("../../kernel/define.js").ViewDef<{
|
|
188
|
+
engines: import("../../kernel/define.js").QueryDef<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
189
|
+
engine: z.ZodEnum<{
|
|
190
|
+
"windows-sandbox": "windows-sandbox";
|
|
191
|
+
hcs: "hcs";
|
|
192
|
+
}>;
|
|
193
|
+
engines: z.ZodArray<z.ZodObject<{
|
|
194
|
+
id: z.ZodEnum<{
|
|
195
|
+
"windows-sandbox": "windows-sandbox";
|
|
196
|
+
hcs: "hcs";
|
|
197
|
+
}>;
|
|
198
|
+
inUse: z.ZodBoolean;
|
|
199
|
+
capabilities: z.ZodObject<{
|
|
200
|
+
desktop: z.ZodBoolean;
|
|
201
|
+
gpu: z.ZodBoolean;
|
|
202
|
+
clipboard: z.ZodBoolean;
|
|
203
|
+
audio: z.ZodBoolean;
|
|
204
|
+
video: z.ZodBoolean;
|
|
205
|
+
printers: z.ZodBoolean;
|
|
206
|
+
liveFolderAdd: z.ZodBoolean;
|
|
207
|
+
attachedDisks: z.ZodBoolean;
|
|
208
|
+
multipleInstances: z.ZodBoolean;
|
|
209
|
+
hvsocket: z.ZodBoolean;
|
|
210
|
+
}, z.core.$strip>;
|
|
211
|
+
check: z.ZodObject<{
|
|
212
|
+
available: z.ZodBoolean;
|
|
213
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
214
|
+
fixes: z.ZodArray<z.ZodString>;
|
|
215
|
+
}, z.core.$strip>;
|
|
216
|
+
}, z.core.$strip>>;
|
|
217
|
+
}, z.core.$strip>, "engine.status">;
|
|
218
|
+
leftovers: import("../../kernel/define.js").QueryDef<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
219
|
+
available: z.ZodBoolean;
|
|
220
|
+
message: z.ZodString;
|
|
221
|
+
systems: z.ZodArray<z.ZodObject<{
|
|
222
|
+
id: z.ZodString;
|
|
223
|
+
kind: z.ZodString;
|
|
224
|
+
state: z.ZodString;
|
|
225
|
+
since: z.ZodNullable<z.ZodString>;
|
|
226
|
+
}, z.core.$strip>>;
|
|
227
|
+
}, z.core.$strip>, "engine.leftovers">;
|
|
228
|
+
}, Record<string, never>, "engine">;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
// The sandbox engines: the engine in use, and for each engine what it can do and whether this PC can run it. `check`
|
|
2
|
+
// says what this PC lacks, with the commands that would fix it as text to copy: nothing is run or changed. Pure: the
|
|
3
|
+
// schemas, the words the check prints and the page. The checks run in engine.run.ts (Node side).
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { action, ago, defineOperation, defineQuery, defineView, plural, } from '../../kernel/index.js';
|
|
6
|
+
/** The label of each capability, in the order the page and the command line show them. */
|
|
7
|
+
export const CAPABILITY_NAMES = {
|
|
8
|
+
desktop: 'desktop window',
|
|
9
|
+
gpu: 'GPU',
|
|
10
|
+
clipboard: 'clipboard',
|
|
11
|
+
audio: 'audio',
|
|
12
|
+
video: 'camera',
|
|
13
|
+
printers: 'printers',
|
|
14
|
+
liveFolderAdd: 'add folders while running',
|
|
15
|
+
attachedDisks: 'attached disks',
|
|
16
|
+
multipleInstances: 'several at once',
|
|
17
|
+
hvsocket: 'Hyper-V sockets',
|
|
18
|
+
};
|
|
19
|
+
const CAPABILITY_KEYS = Object.keys(CAPABILITY_NAMES);
|
|
20
|
+
const FALLBACK_FIX = 'see docs/design/engines.md';
|
|
21
|
+
export const EngineIdSchema = z.enum(['windows-sandbox', 'hcs']).describe('The engine');
|
|
22
|
+
export const CapabilitiesSchema = z.object({
|
|
23
|
+
desktop: z.boolean().describe(CAPABILITY_NAMES.desktop),
|
|
24
|
+
gpu: z.boolean().describe(CAPABILITY_NAMES.gpu),
|
|
25
|
+
clipboard: z.boolean().describe(CAPABILITY_NAMES.clipboard),
|
|
26
|
+
audio: z.boolean().describe(CAPABILITY_NAMES.audio),
|
|
27
|
+
video: z.boolean().describe(CAPABILITY_NAMES.video),
|
|
28
|
+
printers: z.boolean().describe(CAPABILITY_NAMES.printers),
|
|
29
|
+
liveFolderAdd: z.boolean().describe(CAPABILITY_NAMES.liveFolderAdd),
|
|
30
|
+
attachedDisks: z.boolean().describe(CAPABILITY_NAMES.attachedDisks),
|
|
31
|
+
multipleInstances: z.boolean().describe(CAPABILITY_NAMES.multipleInstances),
|
|
32
|
+
hvsocket: z.boolean().describe(CAPABILITY_NAMES.hvsocket),
|
|
33
|
+
});
|
|
34
|
+
export const EngineCheckSchema = z
|
|
35
|
+
.object({
|
|
36
|
+
available: z.boolean().describe('This PC can run it'),
|
|
37
|
+
reasons: z.array(z.string()).describe('Why not, in plain words'),
|
|
38
|
+
fixes: z.array(z.string()).describe('The command that fixes each reason (never run for you)'),
|
|
39
|
+
})
|
|
40
|
+
.describe('Whether this PC can run it');
|
|
41
|
+
export const EngineReportSchema = z.object({
|
|
42
|
+
id: EngineIdSchema,
|
|
43
|
+
inUse: z.boolean().describe('The setting sandbox.engine names it'),
|
|
44
|
+
capabilities: CapabilitiesSchema.describe('What it can do'),
|
|
45
|
+
check: EngineCheckSchema,
|
|
46
|
+
});
|
|
47
|
+
export const EnginesSchema = z.object({
|
|
48
|
+
engine: EngineIdSchema.describe('The engine in use (the setting sandbox.engine)'),
|
|
49
|
+
engines: z.array(EngineReportSchema).describe('Every engine'),
|
|
50
|
+
});
|
|
51
|
+
/** The lines `sandbox engine check` prints (plain: the colours are the command line's own). */
|
|
52
|
+
export function checkText(r) {
|
|
53
|
+
if (r.check.available) {
|
|
54
|
+
const lines = [r.id + ' can be used on this PC.'];
|
|
55
|
+
if (r.id === 'hcs')
|
|
56
|
+
lines.push('HCS is in alpha: starting it is not enabled yet (docs/design/engines.md).');
|
|
57
|
+
return lines.join('\n');
|
|
58
|
+
}
|
|
59
|
+
const lines = [r.id + ' cannot be used on this PC yet:'];
|
|
60
|
+
r.check.reasons.forEach((reason, i) => {
|
|
61
|
+
lines.push('', ' ' + (i + 1) + '. ' + reason, ' To fix: ' + (r.check.fixes[i] ?? FALLBACK_FIX));
|
|
62
|
+
});
|
|
63
|
+
lines.push('', 'Nothing was changed. These commands change Windows, so they are yours to run (or not).');
|
|
64
|
+
return lines.join('\n');
|
|
65
|
+
}
|
|
66
|
+
export const engineStatus = defineQuery({
|
|
67
|
+
id: 'engine.status',
|
|
68
|
+
title: 'Engine',
|
|
69
|
+
summary: 'the engine in use and what each engine can do on this PC',
|
|
70
|
+
input: z.object({}),
|
|
71
|
+
output: EnginesSchema,
|
|
72
|
+
cli: { name: 'engine', action: 'show', json: true },
|
|
73
|
+
});
|
|
74
|
+
export const checkEngine = defineQuery({
|
|
75
|
+
id: 'engine.check',
|
|
76
|
+
title: 'Check an engine',
|
|
77
|
+
summary: 'what this PC lacks for an engine, and the commands that would fix it',
|
|
78
|
+
input: z.object({ engine: z.string().default('hcs').describe('the engine to check') }),
|
|
79
|
+
output: EngineReportSchema,
|
|
80
|
+
surfaces: {
|
|
81
|
+
except: {
|
|
82
|
+
menu: 'the Engine category shows every engine and its check with the fixes (engine.status)',
|
|
83
|
+
web: 'the Engine page shows every engine and its check with the fixes (engine.status)',
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
text: checkText,
|
|
87
|
+
cli: {
|
|
88
|
+
name: 'engine',
|
|
89
|
+
action: 'check',
|
|
90
|
+
positional: ['engine'],
|
|
91
|
+
json: true,
|
|
92
|
+
exitCode: (r) => (r.check.available ? 0 : 1),
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
export const LeftoverSystemSchema = z.object({
|
|
96
|
+
id: z.string().describe('The compute system'),
|
|
97
|
+
kind: z.string().describe('Container or VirtualMachine (the utility VM)'),
|
|
98
|
+
state: z.string().describe('What it is doing'),
|
|
99
|
+
since: z.string().nullable().describe('When it was created (ISO time), when HCS says'),
|
|
100
|
+
});
|
|
101
|
+
export const LeftoversSchema = z.object({
|
|
102
|
+
available: z.boolean().describe('HCS could be asked'),
|
|
103
|
+
message: z.string().describe('What was found, or why nothing is listed'),
|
|
104
|
+
systems: z.array(LeftoverSystemSchema).describe('Ours that are running now'),
|
|
105
|
+
});
|
|
106
|
+
export const engineLeftovers = defineQuery({
|
|
107
|
+
id: 'engine.leftovers',
|
|
108
|
+
title: 'HCS systems left running',
|
|
109
|
+
summary: 'list the HCS compute systems this tool left running (a crashed command can leave one up)',
|
|
110
|
+
input: z.object({}),
|
|
111
|
+
output: LeftoversSchema,
|
|
112
|
+
cli: { name: 'engine', action: 'leftovers', json: true },
|
|
113
|
+
});
|
|
114
|
+
export const cleanEngine = defineOperation({
|
|
115
|
+
id: 'engine.clean',
|
|
116
|
+
title: 'Stop the leftover systems…',
|
|
117
|
+
summary: 'stop the HCS compute systems this tool left running (frees their memory; nothing else is touched)',
|
|
118
|
+
input: z.object({}),
|
|
119
|
+
output: z.object({
|
|
120
|
+
available: z.boolean().describe('HCS could be asked'),
|
|
121
|
+
stopped: z.number().describe('How many were stopped'),
|
|
122
|
+
failed: z.number().describe('How many could not be stopped'),
|
|
123
|
+
message: z.string().describe('What happened'),
|
|
124
|
+
}),
|
|
125
|
+
danger: true,
|
|
126
|
+
text: (o) => o.message,
|
|
127
|
+
cli: { name: 'engine', action: 'clean' },
|
|
128
|
+
});
|
|
129
|
+
function leftoverItem(s) {
|
|
130
|
+
return {
|
|
131
|
+
id: 'leftover:' + s.id,
|
|
132
|
+
label: s.id,
|
|
133
|
+
hint: s.state + (s.since ? ' started ' + ago(s.since) : ''),
|
|
134
|
+
tone: 'warn',
|
|
135
|
+
details: [
|
|
136
|
+
'System ' + s.id,
|
|
137
|
+
'Kind ' + s.kind,
|
|
138
|
+
'State ' + s.state,
|
|
139
|
+
...(s.since ? ['Created ' + s.since] : []),
|
|
140
|
+
],
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
/** The HCS systems left running (a section only when there are some). */
|
|
144
|
+
function leftoversSection(o) {
|
|
145
|
+
if (!o.systems.length)
|
|
146
|
+
return [];
|
|
147
|
+
return [
|
|
148
|
+
{
|
|
149
|
+
id: 'leftovers',
|
|
150
|
+
title: 'HCS systems left running',
|
|
151
|
+
summary: plural(o.systems.length, 'system') + ' (they hold memory; a sandbox running on purpose is listed too)',
|
|
152
|
+
items: o.systems.map(leftoverItem),
|
|
153
|
+
actions: [action(cleanEngine, {}, { key: 'x', verb: 'stop them', importance: 1 })],
|
|
154
|
+
},
|
|
155
|
+
];
|
|
156
|
+
}
|
|
157
|
+
function engineSection(r) {
|
|
158
|
+
const facts = CAPABILITY_KEYS.map((key) => {
|
|
159
|
+
const yes = r.capabilities[key];
|
|
160
|
+
return {
|
|
161
|
+
id: key,
|
|
162
|
+
label: CAPABILITY_NAMES[key],
|
|
163
|
+
value: yes ? 'yes' : 'no',
|
|
164
|
+
...(yes ? {} : { tone: 'muted' }),
|
|
165
|
+
};
|
|
166
|
+
});
|
|
167
|
+
const items = [
|
|
168
|
+
...r.check.reasons.map((reason, i) => ({ id: 'reason:' + i, label: reason, tone: 'warn' })),
|
|
169
|
+
...r.check.fixes.map((fix, i) => ({ id: 'fix:' + i, label: 'Fix: ' + fix })),
|
|
170
|
+
];
|
|
171
|
+
return {
|
|
172
|
+
id: r.id,
|
|
173
|
+
title: r.id + (r.id === 'hcs' ? ' (alpha)' : '') + (r.inUse ? ' (in use)' : ''),
|
|
174
|
+
summary: r.check.available ? 'can be used on this PC' : 'cannot be used yet',
|
|
175
|
+
facts,
|
|
176
|
+
items,
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
/** The engine page: the engine in use, then a card per engine with its capabilities, reasons and fixes. Pure. */
|
|
180
|
+
export function enginePage(o, leftovers) {
|
|
181
|
+
return {
|
|
182
|
+
title: 'Engine',
|
|
183
|
+
notice: { text: 'Engine in use: ' + o.engine + ' (setting: sandbox.engine)' },
|
|
184
|
+
sections: [...o.engines.map(engineSection), ...(leftovers ? leftoversSection(leftovers) : [])],
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
export const engineView = defineView({
|
|
188
|
+
id: 'engine',
|
|
189
|
+
title: 'Engine',
|
|
190
|
+
summary: 'What runs your sandbox, and what each engine can do on this PC.',
|
|
191
|
+
queries: { engines: engineStatus, leftovers: engineLeftovers },
|
|
192
|
+
operations: [cleanEngine],
|
|
193
|
+
build: ({ engines, leftovers }) => enginePage(engines, leftovers),
|
|
194
|
+
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export declare const engineStatusRun: import("../../kernel/define.js").Implementation<import("../../kernel/define.js").QueryDef<import("zod").ZodObject<{}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
2
|
+
engine: import("zod").ZodEnum<{
|
|
3
|
+
"windows-sandbox": "windows-sandbox";
|
|
4
|
+
hcs: "hcs";
|
|
5
|
+
}>;
|
|
6
|
+
engines: import("zod").ZodArray<import("zod").ZodObject<{
|
|
7
|
+
id: import("zod").ZodEnum<{
|
|
8
|
+
"windows-sandbox": "windows-sandbox";
|
|
9
|
+
hcs: "hcs";
|
|
10
|
+
}>;
|
|
11
|
+
inUse: import("zod").ZodBoolean;
|
|
12
|
+
capabilities: import("zod").ZodObject<{
|
|
13
|
+
desktop: import("zod").ZodBoolean;
|
|
14
|
+
gpu: import("zod").ZodBoolean;
|
|
15
|
+
clipboard: import("zod").ZodBoolean;
|
|
16
|
+
audio: import("zod").ZodBoolean;
|
|
17
|
+
video: import("zod").ZodBoolean;
|
|
18
|
+
printers: import("zod").ZodBoolean;
|
|
19
|
+
liveFolderAdd: import("zod").ZodBoolean;
|
|
20
|
+
attachedDisks: import("zod").ZodBoolean;
|
|
21
|
+
multipleInstances: import("zod").ZodBoolean;
|
|
22
|
+
hvsocket: import("zod").ZodBoolean;
|
|
23
|
+
}, import("zod/v4/core").$strip>;
|
|
24
|
+
check: import("zod").ZodObject<{
|
|
25
|
+
available: import("zod").ZodBoolean;
|
|
26
|
+
reasons: import("zod").ZodArray<import("zod").ZodString>;
|
|
27
|
+
fixes: import("zod").ZodArray<import("zod").ZodString>;
|
|
28
|
+
}, import("zod/v4/core").$strip>;
|
|
29
|
+
}, import("zod/v4/core").$strip>>;
|
|
30
|
+
}, import("zod/v4/core").$strip>, "engine.status">, import("../../../cli/commands/context.js").Context>;
|
|
31
|
+
export declare const checkEngineRun: import("../../kernel/define.js").Implementation<import("../../kernel/define.js").QueryDef<import("zod").ZodObject<{
|
|
32
|
+
engine: import("zod").ZodDefault<import("zod").ZodString>;
|
|
33
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
34
|
+
id: import("zod").ZodEnum<{
|
|
35
|
+
"windows-sandbox": "windows-sandbox";
|
|
36
|
+
hcs: "hcs";
|
|
37
|
+
}>;
|
|
38
|
+
inUse: import("zod").ZodBoolean;
|
|
39
|
+
capabilities: import("zod").ZodObject<{
|
|
40
|
+
desktop: import("zod").ZodBoolean;
|
|
41
|
+
gpu: import("zod").ZodBoolean;
|
|
42
|
+
clipboard: import("zod").ZodBoolean;
|
|
43
|
+
audio: import("zod").ZodBoolean;
|
|
44
|
+
video: import("zod").ZodBoolean;
|
|
45
|
+
printers: import("zod").ZodBoolean;
|
|
46
|
+
liveFolderAdd: import("zod").ZodBoolean;
|
|
47
|
+
attachedDisks: import("zod").ZodBoolean;
|
|
48
|
+
multipleInstances: import("zod").ZodBoolean;
|
|
49
|
+
hvsocket: import("zod").ZodBoolean;
|
|
50
|
+
}, import("zod/v4/core").$strip>;
|
|
51
|
+
check: import("zod").ZodObject<{
|
|
52
|
+
available: import("zod").ZodBoolean;
|
|
53
|
+
reasons: import("zod").ZodArray<import("zod").ZodString>;
|
|
54
|
+
fixes: import("zod").ZodArray<import("zod").ZodString>;
|
|
55
|
+
}, import("zod/v4/core").$strip>;
|
|
56
|
+
}, import("zod/v4/core").$strip>, "engine.check">, import("../../../cli/commands/context.js").Context>;
|
|
57
|
+
export declare const engineLeftoversRun: import("../../kernel/define.js").Implementation<import("../../kernel/define.js").QueryDef<import("zod").ZodObject<{}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
58
|
+
available: import("zod").ZodBoolean;
|
|
59
|
+
message: import("zod").ZodString;
|
|
60
|
+
systems: import("zod").ZodArray<import("zod").ZodObject<{
|
|
61
|
+
id: import("zod").ZodString;
|
|
62
|
+
kind: import("zod").ZodString;
|
|
63
|
+
state: import("zod").ZodString;
|
|
64
|
+
since: import("zod").ZodNullable<import("zod").ZodString>;
|
|
65
|
+
}, import("zod/v4/core").$strip>>;
|
|
66
|
+
}, import("zod/v4/core").$strip>, "engine.leftovers">, import("../../../cli/commands/context.js").Context>;
|
|
67
|
+
export declare const cleanEngineRun: import("../../kernel/define.js").Implementation<import("../../kernel/define.js").OperationDef<import("zod").ZodObject<{}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
68
|
+
available: import("zod").ZodBoolean;
|
|
69
|
+
stopped: import("zod").ZodNumber;
|
|
70
|
+
failed: import("zod").ZodNumber;
|
|
71
|
+
message: import("zod").ZodString;
|
|
72
|
+
}, import("zod/v4/core").$strip>, "engine.clean">, import("../../../cli/commands/context.js").Context>;
|