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
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type AppEntry } from '../../../shared/apps/index.js';
|
|
2
|
+
import type { ConfigFile } from '../settings/settings-file.js';
|
|
3
|
+
import { type AppRow, type CustomAppRow } from './apps.def.js';
|
|
4
|
+
export declare const INSTALL: string[];
|
|
5
|
+
export declare const CUSTOM_KEY: string[];
|
|
6
|
+
/** One program of your own, as apps.custom stores it. */
|
|
7
|
+
export interface CustomProgram {
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly github?: string;
|
|
10
|
+
readonly url?: string;
|
|
11
|
+
readonly cli?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** Where the values come from: the files, or the files with unsaved changes laid over them. */
|
|
14
|
+
export interface AppsSource {
|
|
15
|
+
/** apps.install as this scope will have it (undefined: not set). */
|
|
16
|
+
install(file: ConfigFile): string[] | undefined;
|
|
17
|
+
/** A setting-backed entry's value (VS Code: vscode.enabled ...). */
|
|
18
|
+
setting(file: ConfigFile, key: string[]): unknown;
|
|
19
|
+
/** Your own programs (none for a project). */
|
|
20
|
+
custom(file: ConfigFile): Record<string, CustomProgram>;
|
|
21
|
+
}
|
|
22
|
+
/** The files as they are on disk. */
|
|
23
|
+
export declare const SAVED: AppsSource;
|
|
24
|
+
/** The catalogue entries a file can change (a project cannot change an app that has a setting of its own). */
|
|
25
|
+
export declare function entriesOf(file: ConfigFile): AppEntry[];
|
|
26
|
+
/** Is the entry on in this source? */
|
|
27
|
+
export declare function appIsOn(entry: AppEntry, file: ConfigFile, source: AppsSource): boolean;
|
|
28
|
+
/** Every app this scope can change, as a row. */
|
|
29
|
+
export declare function appRows(file: ConfigFile, dataPath: string, source?: AppsSource): AppRow[];
|
|
30
|
+
/** Your own programs as rows (none for a project). */
|
|
31
|
+
export declare function customRows(file: ConfigFile, source?: AppsSource): CustomAppRow[];
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// The apps as rows: every catalogue entry this scope can change, its group, whether it is downloaded already and
|
|
2
|
+
// whether it is on, plus your own programs. Values come from an AppsSource: the files as saved (SAVED), or the menu's
|
|
3
|
+
// staged changes laid over them (the menu's draftSource). The menu and the web both build their lists from these rows.
|
|
4
|
+
import fs from 'node:fs';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import _ from 'lodash';
|
|
7
|
+
import { APPS } from '../../../shared/apps/index.js';
|
|
8
|
+
import { fieldOf } from '../../kernel/index.js';
|
|
9
|
+
import { labelOf } from '../settings/categories.def.js';
|
|
10
|
+
import { findSetting } from '../settings/settings-rows.js';
|
|
11
|
+
import { groupOf } from './apps.def.js';
|
|
12
|
+
export const INSTALL = ['apps', 'install'];
|
|
13
|
+
export const CUSTOM_KEY = ['apps', 'custom'];
|
|
14
|
+
/** The files as they are on disk. */
|
|
15
|
+
export const SAVED = {
|
|
16
|
+
install: (file) => (file.isProject ? file.valueInFile(INSTALL) : file.userConfig().apps.install),
|
|
17
|
+
setting: (file, key) => _.get(file.userConfig(), key),
|
|
18
|
+
custom: (file) => (file.isProject ? {} : file.userConfig().apps.custom),
|
|
19
|
+
};
|
|
20
|
+
/** The catalogue entries a file can change (a project cannot change an app that has a setting of its own). */
|
|
21
|
+
export function entriesOf(file) {
|
|
22
|
+
return APPS.filter((a) => !(file.isProject && a.setting));
|
|
23
|
+
}
|
|
24
|
+
/** Downloaded already (into this data folder), so the next sandbox starts it without a download. */
|
|
25
|
+
function installed(entry, dataPath) {
|
|
26
|
+
if (entry.id === 'vscode')
|
|
27
|
+
return fs.existsSync(path.join(dataPath, 'tools', 'vscode', 'Code.exe'));
|
|
28
|
+
if (entry.id === 'windows-terminal')
|
|
29
|
+
return fs.existsSync(path.join(dataPath, 'tools', 'terminal', 'WindowsTerminal.exe'));
|
|
30
|
+
return fs.existsSync(path.join(dataPath, 'tools', 'apps', entry.id, '.agent-sandbox-app'));
|
|
31
|
+
}
|
|
32
|
+
/** Is the entry on in this source? */
|
|
33
|
+
export function appIsOn(entry, file, source) {
|
|
34
|
+
if (entry.setting)
|
|
35
|
+
return source.setting(file, entry.setting.split('.')) === true;
|
|
36
|
+
return (source.install(file) ?? []).includes(entry.id);
|
|
37
|
+
}
|
|
38
|
+
/** A setting-backed entry's own Field and value (VS Code: on, off or "auto"). */
|
|
39
|
+
function settingParts(entry, file, source) {
|
|
40
|
+
if (!entry.setting)
|
|
41
|
+
return {};
|
|
42
|
+
const found = findSetting(file, entry.setting);
|
|
43
|
+
return {
|
|
44
|
+
setting: entry.setting,
|
|
45
|
+
settingField: fieldOf(found.node, found.key, labelOf(found.key)),
|
|
46
|
+
settingValue: source.setting(file, found.key),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/** Every app this scope can change, as a row. */
|
|
50
|
+
export function appRows(file, dataPath, source = SAVED) {
|
|
51
|
+
return entriesOf(file).map((entry) => ({
|
|
52
|
+
id: entry.id,
|
|
53
|
+
name: entry.name,
|
|
54
|
+
about: entry.about,
|
|
55
|
+
group: groupOf(entry.category),
|
|
56
|
+
size: entry.size,
|
|
57
|
+
cli: Boolean(entry.cli),
|
|
58
|
+
mesa: entry.needs?.includes('mesa') ?? false,
|
|
59
|
+
fullGitOnly: Boolean(entry.fullGitOnly),
|
|
60
|
+
...settingParts(entry, file, source),
|
|
61
|
+
installed: installed(entry, dataPath),
|
|
62
|
+
on: appIsOn(entry, file, source),
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
/** Your own programs as rows (none for a project). */
|
|
66
|
+
export function customRows(file, source = SAVED) {
|
|
67
|
+
return Object.entries(source.custom(file)).map(([id, a]) => ({
|
|
68
|
+
id,
|
|
69
|
+
name: a.name,
|
|
70
|
+
from: a.github ? 'From the latest ' + a.github + ' release.' : 'From ' + String(a.url),
|
|
71
|
+
cli: Boolean(a.cli),
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type Field, type Page } from '../../kernel/index.js';
|
|
3
|
+
export declare const AppsScopeSchema: z.ZodEnum<{
|
|
4
|
+
project: "project";
|
|
5
|
+
user: "user";
|
|
6
|
+
}>;
|
|
7
|
+
export type AppsScope = z.output<typeof AppsScopeSchema>;
|
|
8
|
+
/** A group of apps on the page: the catalogue's categories, merged (members are catalogue category ids). */
|
|
9
|
+
export interface AppGroup {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly label: string;
|
|
12
|
+
readonly description: string;
|
|
13
|
+
readonly members: readonly string[];
|
|
14
|
+
}
|
|
15
|
+
/** The groups the page shows; the menu and the web list the apps by these, so the navigation stays short. */
|
|
16
|
+
export declare const APP_GROUPS: readonly AppGroup[];
|
|
17
|
+
/** The group an app's catalogue category is listed under. */
|
|
18
|
+
export declare function groupOf(category: string): string;
|
|
19
|
+
/** The row that asks for an app that is not in the list (the menu's id; the web has a button instead). */
|
|
20
|
+
export declare const REQUEST_APP = "@request-app";
|
|
21
|
+
/** This project's new-issue page on GitHub. */
|
|
22
|
+
export declare const ISSUES_URL = "https://github.com/JoshDiDuca/windows-development-sandbox/issues/new";
|
|
23
|
+
/** The new-issue address with a title and a body to fill in (the page needs no login to show it). */
|
|
24
|
+
export declare function requestAppUrl(): string;
|
|
25
|
+
/** One app of the catalogue as this scope sees it. */
|
|
26
|
+
export declare const AppRowSchema: z.ZodObject<{
|
|
27
|
+
id: z.ZodString;
|
|
28
|
+
name: z.ZodString;
|
|
29
|
+
about: z.ZodString;
|
|
30
|
+
group: z.ZodString;
|
|
31
|
+
size: z.ZodString;
|
|
32
|
+
cli: z.ZodBoolean;
|
|
33
|
+
mesa: z.ZodBoolean;
|
|
34
|
+
fullGitOnly: z.ZodBoolean;
|
|
35
|
+
setting: z.ZodOptional<z.ZodString>;
|
|
36
|
+
settingField: z.ZodOptional<z.ZodType<Field, unknown, z.core.$ZodTypeInternals<Field, unknown>>>;
|
|
37
|
+
settingValue: z.ZodOptional<z.ZodUnknown>;
|
|
38
|
+
installed: z.ZodBoolean;
|
|
39
|
+
on: z.ZodBoolean;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
export type AppRow = z.output<typeof AppRowSchema>;
|
|
42
|
+
/** One program of your own (apps.custom). */
|
|
43
|
+
export declare const CustomAppRowSchema: z.ZodObject<{
|
|
44
|
+
id: z.ZodString;
|
|
45
|
+
name: z.ZodString;
|
|
46
|
+
from: z.ZodString;
|
|
47
|
+
cli: z.ZodBoolean;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
export type CustomAppRow = z.output<typeof CustomAppRowSchema>;
|
|
50
|
+
export declare const AppsListSchema: z.ZodObject<{
|
|
51
|
+
scope: z.ZodEnum<{
|
|
52
|
+
project: "project";
|
|
53
|
+
user: "user";
|
|
54
|
+
}>;
|
|
55
|
+
file: z.ZodString;
|
|
56
|
+
exists: z.ZodBoolean;
|
|
57
|
+
apps: z.ZodArray<z.ZodObject<{
|
|
58
|
+
id: z.ZodString;
|
|
59
|
+
name: z.ZodString;
|
|
60
|
+
about: z.ZodString;
|
|
61
|
+
group: z.ZodString;
|
|
62
|
+
size: z.ZodString;
|
|
63
|
+
cli: z.ZodBoolean;
|
|
64
|
+
mesa: z.ZodBoolean;
|
|
65
|
+
fullGitOnly: z.ZodBoolean;
|
|
66
|
+
setting: z.ZodOptional<z.ZodString>;
|
|
67
|
+
settingField: z.ZodOptional<z.ZodType<Field, unknown, z.core.$ZodTypeInternals<Field, unknown>>>;
|
|
68
|
+
settingValue: z.ZodOptional<z.ZodUnknown>;
|
|
69
|
+
installed: z.ZodBoolean;
|
|
70
|
+
on: z.ZodBoolean;
|
|
71
|
+
}, z.core.$strip>>;
|
|
72
|
+
custom: z.ZodArray<z.ZodObject<{
|
|
73
|
+
id: z.ZodString;
|
|
74
|
+
name: z.ZodString;
|
|
75
|
+
from: z.ZodString;
|
|
76
|
+
cli: z.ZodBoolean;
|
|
77
|
+
}, z.core.$strip>>;
|
|
78
|
+
customValue: z.ZodOptional<z.ZodUnknown>;
|
|
79
|
+
customField: z.ZodOptional<z.ZodType<Field, unknown, z.core.$ZodTypeInternals<Field, unknown>>>;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
export type AppsList = z.output<typeof AppsListSchema>;
|
|
82
|
+
export declare const listApps: import("../../kernel/define.js").QueryDef<z.ZodObject<{
|
|
83
|
+
scope: z.ZodDefault<z.ZodEnum<{
|
|
84
|
+
project: "project";
|
|
85
|
+
user: "user";
|
|
86
|
+
}>>;
|
|
87
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
88
|
+
scope: z.ZodEnum<{
|
|
89
|
+
project: "project";
|
|
90
|
+
user: "user";
|
|
91
|
+
}>;
|
|
92
|
+
file: z.ZodString;
|
|
93
|
+
exists: z.ZodBoolean;
|
|
94
|
+
apps: z.ZodArray<z.ZodObject<{
|
|
95
|
+
id: z.ZodString;
|
|
96
|
+
name: z.ZodString;
|
|
97
|
+
about: z.ZodString;
|
|
98
|
+
group: z.ZodString;
|
|
99
|
+
size: z.ZodString;
|
|
100
|
+
cli: z.ZodBoolean;
|
|
101
|
+
mesa: z.ZodBoolean;
|
|
102
|
+
fullGitOnly: z.ZodBoolean;
|
|
103
|
+
setting: z.ZodOptional<z.ZodString>;
|
|
104
|
+
settingField: z.ZodOptional<z.ZodType<Field, unknown, z.core.$ZodTypeInternals<Field, unknown>>>;
|
|
105
|
+
settingValue: z.ZodOptional<z.ZodUnknown>;
|
|
106
|
+
installed: z.ZodBoolean;
|
|
107
|
+
on: z.ZodBoolean;
|
|
108
|
+
}, z.core.$strip>>;
|
|
109
|
+
custom: z.ZodArray<z.ZodObject<{
|
|
110
|
+
id: z.ZodString;
|
|
111
|
+
name: z.ZodString;
|
|
112
|
+
from: z.ZodString;
|
|
113
|
+
cli: z.ZodBoolean;
|
|
114
|
+
}, z.core.$strip>>;
|
|
115
|
+
customValue: z.ZodOptional<z.ZodUnknown>;
|
|
116
|
+
customField: z.ZodOptional<z.ZodType<Field, unknown, z.core.$ZodTypeInternals<Field, unknown>>>;
|
|
117
|
+
}, z.core.$strip>, "apps.list">;
|
|
118
|
+
export declare const toggleApp: import("../../kernel/define.js").OperationDef<z.ZodObject<{
|
|
119
|
+
scope: z.ZodDefault<z.ZodEnum<{
|
|
120
|
+
project: "project";
|
|
121
|
+
user: "user";
|
|
122
|
+
}>>;
|
|
123
|
+
id: z.ZodString;
|
|
124
|
+
on: z.ZodBoolean;
|
|
125
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
126
|
+
message: z.ZodString;
|
|
127
|
+
}, z.core.$strip>, "apps.toggle">;
|
|
128
|
+
export declare const setCustomApps: import("../../kernel/define.js").OperationDef<z.ZodObject<{
|
|
129
|
+
scope: z.ZodDefault<z.ZodEnum<{
|
|
130
|
+
project: "project";
|
|
131
|
+
user: "user";
|
|
132
|
+
}>>;
|
|
133
|
+
value: z.ZodUnknown;
|
|
134
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
135
|
+
message: z.ZodString;
|
|
136
|
+
}, z.core.$strip>, "apps.setCustom">;
|
|
137
|
+
export declare const requestApp: import("../../kernel/define.js").OperationDef<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
138
|
+
url: z.ZodString;
|
|
139
|
+
}, z.core.$strip>, "apps.request">;
|
|
140
|
+
/** The apps page of one scope: a category per group (with a switch per app), your own programs and their actions. */
|
|
141
|
+
export declare function appsPage(o: AppsList): Page;
|
|
142
|
+
export declare const appsView: import("../../kernel/define.js").ViewDef<{
|
|
143
|
+
apps: import("../../kernel/define.js").QueryDef<z.ZodObject<{
|
|
144
|
+
scope: z.ZodDefault<z.ZodEnum<{
|
|
145
|
+
project: "project";
|
|
146
|
+
user: "user";
|
|
147
|
+
}>>;
|
|
148
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
149
|
+
scope: z.ZodEnum<{
|
|
150
|
+
project: "project";
|
|
151
|
+
user: "user";
|
|
152
|
+
}>;
|
|
153
|
+
file: z.ZodString;
|
|
154
|
+
exists: z.ZodBoolean;
|
|
155
|
+
apps: z.ZodArray<z.ZodObject<{
|
|
156
|
+
id: z.ZodString;
|
|
157
|
+
name: z.ZodString;
|
|
158
|
+
about: z.ZodString;
|
|
159
|
+
group: z.ZodString;
|
|
160
|
+
size: z.ZodString;
|
|
161
|
+
cli: z.ZodBoolean;
|
|
162
|
+
mesa: z.ZodBoolean;
|
|
163
|
+
fullGitOnly: z.ZodBoolean;
|
|
164
|
+
setting: z.ZodOptional<z.ZodString>;
|
|
165
|
+
settingField: z.ZodOptional<z.ZodType<Field, unknown, z.core.$ZodTypeInternals<Field, unknown>>>;
|
|
166
|
+
settingValue: z.ZodOptional<z.ZodUnknown>;
|
|
167
|
+
installed: z.ZodBoolean;
|
|
168
|
+
on: z.ZodBoolean;
|
|
169
|
+
}, z.core.$strip>>;
|
|
170
|
+
custom: z.ZodArray<z.ZodObject<{
|
|
171
|
+
id: z.ZodString;
|
|
172
|
+
name: z.ZodString;
|
|
173
|
+
from: z.ZodString;
|
|
174
|
+
cli: z.ZodBoolean;
|
|
175
|
+
}, z.core.$strip>>;
|
|
176
|
+
customValue: z.ZodOptional<z.ZodUnknown>;
|
|
177
|
+
customField: z.ZodOptional<z.ZodType<Field, unknown, z.core.$ZodTypeInternals<Field, unknown>>>;
|
|
178
|
+
}, z.core.$strip>, "apps.list">;
|
|
179
|
+
}, {
|
|
180
|
+
scope: AppsScope;
|
|
181
|
+
}, "apps">;
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
// Apps: the catalogue of apps every sandbox can install (ticked = installed), grouped by category, for all projects or
|
|
2
|
+
// this project. Pure: schemas, the groups, the request address, the operations and the view. The rows are made on the
|
|
3
|
+
// Node side (apps-rows.ts), because the catalogue and the files are read there. Ticks written here are saved at once;
|
|
4
|
+
// the menu stages them until Ctrl+S (menu/pages/apps-page.ts).
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { action, defineOperation, defineQuery, defineView, FieldSchema, } from '../../kernel/index.js';
|
|
7
|
+
import { setSetting } from '../settings/settings.def.js';
|
|
8
|
+
export const AppsScopeSchema = z
|
|
9
|
+
.enum(['user', 'project'])
|
|
10
|
+
.describe("Your own settings (all projects) or this folder's .sandbox-config.json (this project)");
|
|
11
|
+
/** The groups the page shows; the menu and the web list the apps by these, so the navigation stays short. */
|
|
12
|
+
export const APP_GROUPS = [
|
|
13
|
+
{
|
|
14
|
+
id: 'editors',
|
|
15
|
+
label: 'Editors & docs',
|
|
16
|
+
description: 'Code and text editors (VS Code is on by default), plus diagrams and document conversion.',
|
|
17
|
+
members: ['editors', 'diagrams'],
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: 'clients',
|
|
21
|
+
label: 'DB & API clients',
|
|
22
|
+
description: 'GUIs for the sandbox databases, tools to send HTTP, REST and GraphQL requests, and to inspect traffic.',
|
|
23
|
+
members: ['databases', 'api', 'network'],
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: 'tools',
|
|
27
|
+
label: 'Git & utilities',
|
|
28
|
+
description: 'Git GUIs and terminal UIs, archives, file search and comparing, process tools, and decompilers.',
|
|
29
|
+
members: ['git', 'utilities', 'reversing'],
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: 'cli',
|
|
33
|
+
label: 'Command-line & cloud',
|
|
34
|
+
description: 'Small developer tools (JSON, search, builds, media ...) and tools for clouds and Kubernetes.',
|
|
35
|
+
members: ['cli', 'cloud'],
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: 'play',
|
|
39
|
+
label: 'Browsers & games',
|
|
40
|
+
description: 'Browsers for testing web apps, and game engines and editors (they draw with OpenGL on the CPU).',
|
|
41
|
+
members: ['browsers', 'gamedev'],
|
|
42
|
+
},
|
|
43
|
+
];
|
|
44
|
+
/** The group an app's catalogue category is listed under. */
|
|
45
|
+
export function groupOf(category) {
|
|
46
|
+
return APP_GROUPS.find((g) => g.members.includes(category))?.id ?? 'tools';
|
|
47
|
+
}
|
|
48
|
+
/** The row that asks for an app that is not in the list (the menu's id; the web has a button instead). */
|
|
49
|
+
export const REQUEST_APP = '@request-app';
|
|
50
|
+
/** This project's new-issue page on GitHub. */
|
|
51
|
+
export const ISSUES_URL = 'https://github.com/JoshDiDuca/windows-development-sandbox/issues/new';
|
|
52
|
+
/** The new-issue address with a title and a body to fill in (the page needs no login to show it). */
|
|
53
|
+
export function requestAppUrl() {
|
|
54
|
+
const body = [
|
|
55
|
+
'**App name:**',
|
|
56
|
+
'',
|
|
57
|
+
'**Where to get it** (GitHub releases page or a direct download link):',
|
|
58
|
+
'',
|
|
59
|
+
'**What it is for:**',
|
|
60
|
+
'',
|
|
61
|
+
'**Command-line tool or desktop app?**',
|
|
62
|
+
'',
|
|
63
|
+
'**Does it need a GPU, a license or an account?**',
|
|
64
|
+
].join('\n');
|
|
65
|
+
const query = [
|
|
66
|
+
['title', 'App request: '],
|
|
67
|
+
['body', body],
|
|
68
|
+
['labels', 'app-request'],
|
|
69
|
+
];
|
|
70
|
+
return ISSUES_URL + '?' + query.map(([k, v]) => k + '=' + encodeURIComponent(v)).join('&');
|
|
71
|
+
}
|
|
72
|
+
/** One app of the catalogue as this scope sees it. */
|
|
73
|
+
export const AppRowSchema = z.object({
|
|
74
|
+
id: z.string().describe('The app'),
|
|
75
|
+
name: z.string().describe('Its name'),
|
|
76
|
+
about: z.string().describe('What it is for'),
|
|
77
|
+
group: z.string().describe('The group it is listed under (APP_GROUPS id)'),
|
|
78
|
+
size: z.string().describe('Its download size'),
|
|
79
|
+
cli: z.boolean().describe('A command-line tool (on PATH), not a desktop app'),
|
|
80
|
+
mesa: z.boolean().describe('Needs OpenGL on the CPU (Mesa)'),
|
|
81
|
+
fullGitOnly: z.boolean().describe('Only with full git access'),
|
|
82
|
+
setting: z.string().optional().describe('The setting it stands for (VS Code, Windows Terminal)'),
|
|
83
|
+
/** That setting's own Field and value (on, off or auto), so it is changed with its own control. */
|
|
84
|
+
settingField: FieldSchema.optional(),
|
|
85
|
+
settingValue: z.unknown().optional(),
|
|
86
|
+
installed: z.boolean().describe('Downloaded already into the data folder'),
|
|
87
|
+
on: z.boolean().describe('Installed in every sandbox of this scope'),
|
|
88
|
+
});
|
|
89
|
+
/** One program of your own (apps.custom). */
|
|
90
|
+
export const CustomAppRowSchema = z.object({
|
|
91
|
+
id: z.string().describe('Its key in apps.custom'),
|
|
92
|
+
name: z.string().describe('Its name'),
|
|
93
|
+
from: z.string().describe('"From the latest <repo> release." or "From <url>"'),
|
|
94
|
+
cli: z.boolean().describe('A command-line tool'),
|
|
95
|
+
});
|
|
96
|
+
export const AppsListSchema = z.object({
|
|
97
|
+
scope: AppsScopeSchema,
|
|
98
|
+
file: z.string().describe('The file this scope edits'),
|
|
99
|
+
exists: z.boolean().describe('The file exists already'),
|
|
100
|
+
apps: z.array(AppRowSchema).describe('The catalogue entries this scope can change'),
|
|
101
|
+
custom: z.array(CustomAppRowSchema).describe('Your own programs (your own scope only)'),
|
|
102
|
+
customValue: z.unknown().optional().describe('apps.custom as saved, to edit (your own scope only)'),
|
|
103
|
+
customField: FieldSchema.optional().describe('The Field of apps.custom (your own scope only)'),
|
|
104
|
+
});
|
|
105
|
+
export const listApps = defineQuery({
|
|
106
|
+
id: 'apps.list',
|
|
107
|
+
title: 'Apps',
|
|
108
|
+
summary: 'the apps catalogue: what every sandbox installs',
|
|
109
|
+
input: z.object({ scope: AppsScopeSchema.default('user') }),
|
|
110
|
+
output: AppsListSchema,
|
|
111
|
+
surfaces: { except: { cli: 'apps are settings: sandbox config set apps.install / apps.custom' } },
|
|
112
|
+
});
|
|
113
|
+
export const toggleApp = defineOperation({
|
|
114
|
+
id: 'apps.toggle',
|
|
115
|
+
title: 'Install in every sandbox',
|
|
116
|
+
summary: 'turn an app of the catalogue on or off for this scope',
|
|
117
|
+
input: z.object({
|
|
118
|
+
scope: AppsScopeSchema.default('user'),
|
|
119
|
+
id: z.string().max(100).describe('The app'),
|
|
120
|
+
on: z.boolean().describe('Install it (true) or not (false)'),
|
|
121
|
+
}),
|
|
122
|
+
output: z.object({ message: z.string().describe('What changed') }),
|
|
123
|
+
text: (o) => o.message,
|
|
124
|
+
surfaces: { except: { cli: 'apps are settings: sandbox config set apps.install / apps.custom' } },
|
|
125
|
+
});
|
|
126
|
+
export const setCustomApps = defineOperation({
|
|
127
|
+
id: 'apps.setCustom',
|
|
128
|
+
title: 'Your own programs',
|
|
129
|
+
summary: 'change your own programs (apps.custom)',
|
|
130
|
+
input: z.object({
|
|
131
|
+
scope: AppsScopeSchema.default('user'),
|
|
132
|
+
value: z.unknown().describe('Programs of your own: a GitHub release or a download link, and the program to start.'),
|
|
133
|
+
}),
|
|
134
|
+
output: z.object({ message: z.string().describe('What changed') }),
|
|
135
|
+
text: (o) => o.message,
|
|
136
|
+
surfaces: { except: { cli: 'apps are settings: sandbox config set apps.custom' } },
|
|
137
|
+
});
|
|
138
|
+
export const requestApp = defineOperation({
|
|
139
|
+
id: 'apps.request',
|
|
140
|
+
title: 'Request an app…',
|
|
141
|
+
summary: 'open a prefilled GitHub request for an app that is not in the list',
|
|
142
|
+
input: z.object({}),
|
|
143
|
+
output: z.object({ url: z.string().describe('The request page') }),
|
|
144
|
+
text: (o) => 'Opened the request form in your browser: ' + o.url,
|
|
145
|
+
surfaces: { except: { cli: 'a request is filed on GitHub; the address is in docs' } },
|
|
146
|
+
});
|
|
147
|
+
/** The lines under an app: its download, how it starts, what it needs. Plain text, like the CLI's. */
|
|
148
|
+
function details(row) {
|
|
149
|
+
return [
|
|
150
|
+
'Download ~' +
|
|
151
|
+
row.size +
|
|
152
|
+
' once, kept in C:\\AgentData\\tools\\' +
|
|
153
|
+
(row.setting ? '' : 'apps\\') +
|
|
154
|
+
row.id +
|
|
155
|
+
(row.installed ? ' (downloaded already)' : ''),
|
|
156
|
+
'Starts ' + (row.cli ? 'from a terminal (on PATH)' : 'from the desktop or Start > Sandbox apps'),
|
|
157
|
+
...(row.mesa ? ['Graphics OpenGL on the CPU (Mesa) is added for it'] : []),
|
|
158
|
+
...(row.fullGitOnly
|
|
159
|
+
? ['Needs full git access (Settings > Projects & setup > Git): it pushes with its own git.']
|
|
160
|
+
: []),
|
|
161
|
+
...(row.setting ? ['Setting ' + row.setting] : []),
|
|
162
|
+
];
|
|
163
|
+
}
|
|
164
|
+
/** The switch that turns an app on or off: one boolean field, changed in place. */
|
|
165
|
+
function switchField(row) {
|
|
166
|
+
return { name: 'on', key: ['apps', 'install'], kind: 'boolean', label: row.name, optional: false };
|
|
167
|
+
}
|
|
168
|
+
function appItem(row, scope) {
|
|
169
|
+
// An app that is a setting of its own (VS Code: on, off or "auto" = when this PC has it) gets that setting's control.
|
|
170
|
+
const primary = row.setting && row.settingField
|
|
171
|
+
? action(setSetting, { scope: 'user', key: row.setting }, {
|
|
172
|
+
label: 'Change',
|
|
173
|
+
verb: 'change',
|
|
174
|
+
inline: true,
|
|
175
|
+
fields: [{ ...row.settingField, name: 'value', label: row.name }],
|
|
176
|
+
initial: { value: row.settingValue },
|
|
177
|
+
})
|
|
178
|
+
: action(toggleApp, { scope, id: row.id }, {
|
|
179
|
+
label: row.on ? 'Turn off' : 'Turn on',
|
|
180
|
+
verb: 'tick',
|
|
181
|
+
inline: true,
|
|
182
|
+
fields: [switchField(row)],
|
|
183
|
+
initial: { on: row.on },
|
|
184
|
+
});
|
|
185
|
+
return {
|
|
186
|
+
id: row.id,
|
|
187
|
+
label: row.name,
|
|
188
|
+
description: row.about,
|
|
189
|
+
code: row.id,
|
|
190
|
+
keywords: row.id,
|
|
191
|
+
details: details(row),
|
|
192
|
+
...(row.on ? { tone: 'ok' } : {}),
|
|
193
|
+
primary,
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
function customItem(row) {
|
|
197
|
+
return {
|
|
198
|
+
id: 'custom-' + row.id,
|
|
199
|
+
label: row.name,
|
|
200
|
+
description: row.from,
|
|
201
|
+
hint: row.cli ? 'command line' : 'desktop',
|
|
202
|
+
disabled: 'Your own programs are always installed; change or remove them with Your own programs.',
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
/** The apps page of one scope: a category per group (with a switch per app), your own programs and their actions. */
|
|
206
|
+
export function appsPage(o) {
|
|
207
|
+
const sections = APP_GROUPS.map((g) => ({
|
|
208
|
+
id: g.id,
|
|
209
|
+
title: g.label,
|
|
210
|
+
description: g.description,
|
|
211
|
+
items: o.apps.filter((r) => r.group === g.id).map((r) => appItem(r, o.scope)),
|
|
212
|
+
})).filter((s) => (s.items?.length ?? 0) > 0);
|
|
213
|
+
if (o.scope === 'user')
|
|
214
|
+
sections.push({
|
|
215
|
+
id: 'custom',
|
|
216
|
+
title: 'Your own programs',
|
|
217
|
+
description: 'Programs you added yourself, from a GitHub release or a download link.',
|
|
218
|
+
items: o.custom.map(customItem),
|
|
219
|
+
});
|
|
220
|
+
const own = o.scope === 'user';
|
|
221
|
+
return {
|
|
222
|
+
title: 'Apps',
|
|
223
|
+
categories: true,
|
|
224
|
+
notice: {
|
|
225
|
+
text: 'Editing ' +
|
|
226
|
+
o.file +
|
|
227
|
+
(o.exists ? '' : ' (created when you save)') +
|
|
228
|
+
(o.scope === 'project' ? ': only apps from the list; needs your approval at the next launch' : ''),
|
|
229
|
+
tone: o.scope === 'project' ? 'accent' : 'muted',
|
|
230
|
+
},
|
|
231
|
+
sections,
|
|
232
|
+
actions: own
|
|
233
|
+
? [
|
|
234
|
+
...(o.customField
|
|
235
|
+
? [
|
|
236
|
+
action(setCustomApps, { scope: 'user' }, {
|
|
237
|
+
key: 'c',
|
|
238
|
+
verb: 'your own programs',
|
|
239
|
+
fields: [{ ...o.customField, name: 'value', label: 'Your own programs' }],
|
|
240
|
+
initial: { value: o.customValue },
|
|
241
|
+
}),
|
|
242
|
+
]
|
|
243
|
+
: []),
|
|
244
|
+
action(requestApp, {}, { key: 'r', verb: 'request an app' }),
|
|
245
|
+
]
|
|
246
|
+
: [],
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
export const appsView = defineView({
|
|
250
|
+
id: 'apps',
|
|
251
|
+
title: 'Apps',
|
|
252
|
+
summary: 'Tick the apps every sandbox should have. Each downloads once and is kept.',
|
|
253
|
+
queries: { apps: listApps },
|
|
254
|
+
operations: [toggleApp, setCustomApps, requestApp, setSetting],
|
|
255
|
+
tabs: {
|
|
256
|
+
param: 'scope',
|
|
257
|
+
choices: [
|
|
258
|
+
{ value: 'user', label: 'All projects' },
|
|
259
|
+
{ value: 'project', label: 'This project' },
|
|
260
|
+
],
|
|
261
|
+
},
|
|
262
|
+
inputs: (params) => ({ apps: { scope: params.scope } }),
|
|
263
|
+
build: ({ apps }) => appsPage(apps),
|
|
264
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export declare const listAppsRun: import("../../kernel/define.js").Implementation<import("../../kernel/define.js").QueryDef<import("zod").ZodObject<{
|
|
2
|
+
scope: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
3
|
+
project: "project";
|
|
4
|
+
user: "user";
|
|
5
|
+
}>>;
|
|
6
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
7
|
+
scope: import("zod").ZodEnum<{
|
|
8
|
+
project: "project";
|
|
9
|
+
user: "user";
|
|
10
|
+
}>;
|
|
11
|
+
file: import("zod").ZodString;
|
|
12
|
+
exists: import("zod").ZodBoolean;
|
|
13
|
+
apps: import("zod").ZodArray<import("zod").ZodObject<{
|
|
14
|
+
id: import("zod").ZodString;
|
|
15
|
+
name: import("zod").ZodString;
|
|
16
|
+
about: import("zod").ZodString;
|
|
17
|
+
group: import("zod").ZodString;
|
|
18
|
+
size: import("zod").ZodString;
|
|
19
|
+
cli: import("zod").ZodBoolean;
|
|
20
|
+
mesa: import("zod").ZodBoolean;
|
|
21
|
+
fullGitOnly: import("zod").ZodBoolean;
|
|
22
|
+
setting: import("zod").ZodOptional<import("zod").ZodString>;
|
|
23
|
+
settingField: import("zod").ZodOptional<import("zod").ZodType<import("../../kernel/fields.js").Field, unknown, import("zod/v4/core").$ZodTypeInternals<import("../../kernel/fields.js").Field, unknown>>>;
|
|
24
|
+
settingValue: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
25
|
+
installed: import("zod").ZodBoolean;
|
|
26
|
+
on: import("zod").ZodBoolean;
|
|
27
|
+
}, import("zod/v4/core").$strip>>;
|
|
28
|
+
custom: import("zod").ZodArray<import("zod").ZodObject<{
|
|
29
|
+
id: import("zod").ZodString;
|
|
30
|
+
name: import("zod").ZodString;
|
|
31
|
+
from: import("zod").ZodString;
|
|
32
|
+
cli: import("zod").ZodBoolean;
|
|
33
|
+
}, import("zod/v4/core").$strip>>;
|
|
34
|
+
customValue: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
35
|
+
customField: import("zod").ZodOptional<import("zod").ZodType<import("../../kernel/fields.js").Field, unknown, import("zod/v4/core").$ZodTypeInternals<import("../../kernel/fields.js").Field, unknown>>>;
|
|
36
|
+
}, import("zod/v4/core").$strip>, "apps.list">, import("../../../cli/commands/context.js").Context>;
|
|
37
|
+
export declare const toggleAppRun: import("../../kernel/define.js").Implementation<import("../../kernel/define.js").OperationDef<import("zod").ZodObject<{
|
|
38
|
+
scope: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
39
|
+
project: "project";
|
|
40
|
+
user: "user";
|
|
41
|
+
}>>;
|
|
42
|
+
id: import("zod").ZodString;
|
|
43
|
+
on: import("zod").ZodBoolean;
|
|
44
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
45
|
+
message: import("zod").ZodString;
|
|
46
|
+
}, import("zod/v4/core").$strip>, "apps.toggle">, import("../../../cli/commands/context.js").Context>;
|
|
47
|
+
export declare const setCustomAppsRun: import("../../kernel/define.js").Implementation<import("../../kernel/define.js").OperationDef<import("zod").ZodObject<{
|
|
48
|
+
scope: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
49
|
+
project: "project";
|
|
50
|
+
user: "user";
|
|
51
|
+
}>>;
|
|
52
|
+
value: import("zod").ZodUnknown;
|
|
53
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
54
|
+
message: import("zod").ZodString;
|
|
55
|
+
}, import("zod/v4/core").$strip>, "apps.setCustom">, import("../../../cli/commands/context.js").Context>;
|
|
56
|
+
export declare const requestAppRun: import("../../kernel/define.js").Implementation<import("../../kernel/define.js").OperationDef<import("zod").ZodObject<{}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
57
|
+
url: import("zod").ZodString;
|
|
58
|
+
}, import("zod/v4/core").$strip>, "apps.request">, import("../../../cli/commands/context.js").Context>;
|