windows-development-sandbox 1.18.4 → 1.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/config.example.json +17 -1
- package/dist/app/features/access/access.def.js +5 -2
- package/dist/app/features/access/access.run.js +7 -3
- package/dist/app/features/accounts/accounts.def.d.ts +33 -1
- package/dist/app/features/accounts/accounts.def.js +10 -4
- package/dist/app/features/accounts/accounts.run.d.ts +2 -0
- package/dist/app/features/accounts/accounts.run.js +7 -2
- package/dist/app/features/accounts/services.def.d.ts +7 -1
- package/dist/app/features/accounts/services.def.js +19 -16
- package/dist/app/features/accounts/services.run.d.ts +2 -0
- package/dist/app/features/accounts/services.run.js +44 -16
- package/dist/app/features/agent-commands/agent-commands.def.d.ts +37 -0
- package/dist/app/features/agent-commands/agent-commands.def.js +91 -0
- package/dist/app/features/agent-commands/agent-commands.run.d.ts +28 -0
- package/dist/app/features/agent-commands/agent-commands.run.js +35 -0
- package/dist/app/features/agent-commands/index.d.ts +2 -0
- package/dist/app/features/agent-commands/index.js +3 -0
- package/dist/app/features/agents/agents.def.d.ts +14 -1
- package/dist/app/features/agents/agents.def.js +61 -6
- package/dist/app/features/agents/agents.run.d.ts +1 -0
- package/dist/app/features/agents/agents.run.js +8 -1
- package/dist/app/features/agents/claude-env.def.d.ts +36 -0
- package/dist/app/features/agents/claude-env.def.js +305 -0
- package/dist/app/features/agents/env.def.d.ts +163 -0
- package/dist/app/features/agents/env.def.js +184 -0
- package/dist/app/features/agents/env.run.d.ts +43 -0
- package/dist/app/features/agents/env.run.js +86 -0
- package/dist/app/features/agents/index.d.ts +2 -0
- package/dist/app/features/agents/index.js +2 -0
- package/dist/app/features/defs.d.ts +171 -3
- package/dist/app/features/defs.js +9 -0
- package/dist/app/features/engine/engine.run.js +1 -1
- package/dist/app/features/github/github.def.d.ts +44 -3
- package/dist/app/features/github/github.def.js +145 -63
- package/dist/app/features/github/github.run.d.ts +9 -2
- package/dist/app/features/github/github.run.js +43 -5
- package/dist/app/features/health/health.def.js +8 -2
- package/dist/app/features/logs/logs.def.js +0 -8
- package/dist/app/features/projects/projects.def.js +2 -2
- package/dist/app/features/projects/projects.run.js +5 -5
- package/dist/app/features/sandbox/sandbox.def.js +7 -3
- package/dist/app/features/sessions/sessions.def.d.ts +4 -4
- package/dist/app/features/sessions/sessions.def.js +0 -5
- package/dist/app/features/sessions/sessions.run.d.ts +1 -1
- package/dist/app/features/sessions/sessions.run.js +2 -2
- package/dist/app/features/settings/categories.def.js +7 -2
- package/dist/app/features/settings/settings-rows.js +6 -2
- package/dist/app/features/settings/settings.def.js +1 -1
- package/dist/app/features/settings/settings.run.d.ts +8 -0
- package/dist/app/features/settings/settings.run.js +12 -3
- package/dist/app/features/storage/storage.run.js +18 -9
- package/dist/app/features/updates/update-lines.js +2 -2
- package/dist/app/features/updates/updates.def.js +1 -1
- package/dist/app/features/updates/updates.run.js +13 -3
- package/dist/app/features/vpn/vpn.def.d.ts +33 -0
- package/dist/app/features/vpn/vpn.def.js +30 -6
- package/dist/app/features/vpn/vpn.run.d.ts +11 -0
- package/dist/app/features/vpn/vpn.run.js +4 -1
- package/dist/app/features/web/web.def.js +2 -2
- package/dist/app/features/web/web.run.js +12 -4
- package/dist/app/kernel/errors.d.ts +7 -0
- package/dist/app/kernel/errors.js +18 -3
- package/dist/app/kernel/rpc.d.ts +6 -1
- package/dist/app/kernel/view.d.ts +11 -1
- package/dist/app/registry.js +7 -1
- package/dist/bin/agent-sandbox.js +2 -2
- package/dist/bin/{chunk-N4GXYTLV.js → chunk-JETGP2C3.js} +239 -72
- package/dist/bin/{chunk-MY7NLQQY.js → chunk-XZKOPGNH.js} +1 -1
- package/dist/bin/{chunk-FRPLQLSY.js → chunk-ZTTOF5V3.js} +6566 -4964
- package/dist/bin/claude-host.js +2 -2
- package/dist/bin/claude-sbx.js +2 -2
- package/dist/bin/codex-sbx.js +2 -2
- package/dist/bin/gemini-sbx.js +2 -2
- package/dist/bin/sandbox.js +2 -2
- package/dist/bin/sbx-hide.js +2 -2
- package/dist/bin/sbx-show.js +2 -2
- package/dist/cli/commands/agent-commands.d.ts +0 -1
- package/dist/cli/commands/agent-commands.js +2 -32
- package/dist/cli/commands/index.d.ts +1 -1
- package/dist/cli/commands/index.js +1 -1
- package/dist/cli/commands/launch/launch.js +2 -2
- package/dist/cli/commands/registry.js +3 -2
- package/dist/cli/manifest.d.ts +3 -3
- package/dist/cli/manifest.js +3 -2
- package/dist/cli/menu/coverage-exempt.d.ts +17 -0
- package/dist/cli/menu/coverage-exempt.js +61 -0
- package/dist/cli/menu/io-menu.d.ts +2 -0
- package/dist/cli/menu/io-menu.js +50 -5
- package/dist/cli/menu/menu.d.ts +1 -1
- package/dist/cli/menu/menu.js +3 -3
- package/dist/cli/menu/pages/accounts-page.js +1 -1
- package/dist/cli/menu/pages/agents-page.d.ts +7 -2
- package/dist/cli/menu/pages/agents-page.js +75 -13
- package/dist/cli/menu/pages/maintenance-page.d.ts +6 -0
- package/dist/cli/menu/pages/maintenance-page.js +10 -4
- package/dist/cli/menu/pages/sessions-page.d.ts +2 -0
- package/dist/cli/menu/pages/sessions-page.js +12 -4
- package/dist/cli/menu/pages/settings-page.js +13 -1
- package/dist/cli/menu/remote-menu.js +1 -1
- package/dist/cli/menu/shell.d.ts +5 -0
- package/dist/cli/menu/shell.js +13 -0
- package/dist/cli/menu/views.js +2 -1
- package/dist/cli/report.js +2 -0
- package/dist/cli/services/agent-commands-service.d.ts +2 -0
- package/dist/cli/services/agent-commands-service.js +13 -7
- package/dist/cli/services/vpn-service.d.ts +5 -1
- package/dist/cli/services/vpn-service.js +6 -1
- package/dist/cli/tui/app.d.ts +5 -0
- package/dist/cli/tui/app.js +2 -0
- package/dist/cli/tui/dialogs/text-screen.js +2 -1
- package/dist/cli/tui/terminal.js +3 -1
- package/dist/core/config/defaults.js +12 -1
- package/dist/core/detect/toolchains.js +9 -0
- package/dist/core/disk.d.ts +1 -5
- package/dist/core/disk.js +1 -16
- package/dist/core/schema/accounts.d.ts +6 -0
- package/dist/core/schema/accounts.js +13 -11
- package/dist/core/schema/codex.d.ts +29 -0
- package/dist/core/schema/codex.js +24 -0
- package/dist/core/schema/config.d.ts +58 -14
- package/dist/core/schema/config.js +6 -4
- package/dist/core/schema/github.js +1 -1
- package/dist/core/schema/index.d.ts +1 -0
- package/dist/core/schema/index.js +1 -0
- package/dist/core/schema/profile.js +8 -4
- package/dist/core/schema/resume.js +1 -1
- package/dist/core/schema/sandbox.js +3 -3
- package/dist/core/schema/toolchains.d.ts +4 -0
- package/dist/core/schema/toolchains.js +3 -0
- package/dist/core/schema/vpn.js +1 -1
- package/dist/core/schema/web.js +3 -3
- package/dist/core/types.d.ts +8 -0
- package/dist/core/util/errors.d.ts +11 -1
- package/dist/core/util/errors.js +7 -1
- package/dist/core/util/index.d.ts +1 -1
- package/dist/core/util/index.js +1 -1
- package/dist/guest/accounts/adapter.d.ts +2 -0
- package/dist/guest/accounts/adapters.js +4 -0
- package/dist/guest/accounts/apply.d.ts +10 -6
- package/dist/guest/accounts/kinds/cfx.d.ts +7 -0
- package/dist/guest/accounts/kinds/cfx.js +33 -3
- package/dist/guest/accounts/kinds/comet.d.ts +7 -0
- package/dist/guest/accounts/kinds/comet.js +50 -0
- package/dist/guest/accounts/kinds/perplexity.d.ts +2 -0
- package/dist/guest/accounts/kinds/perplexity.js +12 -0
- package/dist/guest/accounts/watch.d.ts +2 -0
- package/dist/guest/accounts/watch.js +12 -2
- package/dist/guest/agents/agent-files.d.ts +26 -6
- package/dist/guest/agents/agent-files.js +84 -14
- package/dist/guest/agents/agent-installer.js +1 -1
- package/dist/guest/agents/local-state.d.ts +5 -2
- package/dist/guest/agents/local-state.js +24 -10
- package/dist/guest/agents/profile-links.d.ts +2 -0
- package/dist/guest/agents/profile-links.js +18 -4
- package/dist/guest/apps/after-install.js +19 -0
- package/dist/guest/apps/app-installer.d.ts +11 -0
- package/dist/guest/apps/app-installer.js +69 -6
- package/dist/guest/apps/comet-unpack.d.ts +20 -0
- package/dist/guest/apps/comet-unpack.js +127 -0
- package/dist/guest/apps/index.d.ts +1 -1
- package/dist/guest/apps/index.js +1 -1
- package/dist/guest/apps/resolvers-agents-web.d.ts +2 -0
- package/dist/guest/apps/resolvers-agents-web.js +7 -0
- package/dist/guest/apps/resolvers.js +2 -0
- package/dist/guest/apps/shortcuts.d.ts +2 -0
- package/dist/guest/apps/shortcuts.js +1 -0
- package/dist/guest/apps/unpack.js +14 -4
- package/dist/guest/boot/boot.d.ts +45 -16
- package/dist/guest/boot/boot.js +325 -149
- package/dist/guest/boot/graph.d.ts +252 -0
- package/dist/guest/boot/graph.js +257 -0
- package/dist/guest/boot/guide-lines.d.ts +25 -0
- package/dist/guest/boot/guide-lines.js +41 -0
- package/dist/guest/boot/guide.d.ts +1 -4
- package/dist/guest/boot/guide.js +6 -8
- package/dist/guest/boot/runner.d.ts +77 -0
- package/dist/guest/boot/runner.js +215 -0
- package/dist/guest/browser/cdp.d.ts +71 -0
- package/dist/guest/browser/cdp.js +306 -0
- package/dist/guest/browser/comet.d.ts +28 -0
- package/dist/guest/browser/comet.js +155 -0
- package/dist/guest/daemon/project-provisioner.js +6 -1
- package/dist/guest/daemon/sessions.js +2 -1
- package/dist/guest/devtools/fivem.d.ts +1 -1
- package/dist/guest/devtools/fivem.js +243 -3
- package/dist/guest/entries/daemon.js +2 -0
- package/dist/guest/runtime/log.d.ts +12 -0
- package/dist/guest/runtime/log.js +29 -5
- package/dist/guest/runtime/pools.d.ts +24 -0
- package/dist/guest/runtime/pools.js +60 -0
- package/dist/guest/runtime/process.d.ts +4 -0
- package/dist/guest/runtime/process.js +38 -1
- package/dist/guest/runtime/status.d.ts +5 -1
- package/dist/guest/runtime/status.js +19 -0
- package/dist/guest/setup/addon-mcp.d.ts +1 -1
- package/dist/guest/setup/addon-mcp.js +52 -12
- package/dist/guest/setup/agent-addons.d.ts +3 -2
- package/dist/guest/setup/agent-addons.js +12 -3
- package/dist/guest/setup/environment.d.ts +1 -1
- package/dist/guest/setup/environment.js +25 -12
- package/dist/guest/setup/headroom.d.ts +8 -3
- package/dist/guest/setup/headroom.js +44 -15
- package/dist/guest/setup/path-plan.d.ts +28 -0
- package/dist/guest/setup/path-plan.js +69 -2
- package/dist/guest/setup/shell-path.d.ts +1 -1
- package/dist/guest/setup/shell-path.js +3 -3
- package/dist/guest/toolchains/fivem/artifacts.d.ts +48 -1
- package/dist/guest/toolchains/fivem/artifacts.js +97 -4
- package/dist/guest/toolchains/fivem/fivem.d.ts +32 -1
- package/dist/guest/toolchains/fivem/fivem.js +168 -3
- package/dist/guest/toolchains/fivem/scaffold.d.ts +35 -0
- package/dist/guest/toolchains/fivem/scaffold.js +105 -0
- package/dist/guest/toolchains/fivem/serve-plan.d.ts +34 -0
- package/dist/guest/toolchains/fivem/serve-plan.js +61 -0
- package/dist/guest/toolchains/installers.d.ts +6 -10
- package/dist/guest/toolchains/installers.js +4 -12
- package/dist/guest/toolchains/languages/go.js +1 -1
- package/dist/guest/toolchains/languages/node.js +2 -1
- package/dist/guest/toolchains/languages/php.d.ts +2 -0
- package/dist/guest/toolchains/languages/php.js +13 -1
- package/dist/guest/toolchains/languages/python-tools.js +1 -1
- package/dist/guest/toolchains/languages/ruby.js +1 -1
- package/dist/guest/toolchains/native/autosdk.d.ts +3 -0
- package/dist/guest/toolchains/native/autosdk.js +50 -0
- package/dist/guest/toolchains/native/binstall.js +1 -1
- package/dist/guest/toolchains/native/msvc/packages.js +10 -4
- package/dist/guest/toolchains/native/rust.d.ts +2 -0
- package/dist/guest/toolchains/native/rust.js +11 -4
- package/dist/guest/toolchains/native/unreal.d.ts +2 -0
- package/dist/guest/toolchains/native/unreal.js +19 -6
- package/dist/guest/toolchains/native/vcruntime.d.ts +2 -3
- package/dist/guest/toolchains/native/vcruntime.js +12 -7
- package/dist/guest/toolchains/native/visual-studio.d.ts +5 -2
- package/dist/guest/toolchains/native/visual-studio.js +127 -25
- package/dist/guest/toolchains/native/vs-request.d.ts +23 -0
- package/dist/guest/toolchains/native/vs-request.js +62 -1
- package/dist/guest/toolchains/not-yet.d.ts +1 -1
- package/dist/guest/toolchains/not-yet.js +3 -3
- package/dist/guest/toolchains/persisted.js +2 -7
- package/dist/guest/toolchains/plan.js +27 -11
- package/dist/guest/toolchains/scheduler.d.ts +2 -21
- package/dist/guest/toolchains/scheduler.js +7 -121
- package/dist/guest/toolchains/setup.d.ts +15 -2
- package/dist/guest/toolchains/setup.js +39 -20
- package/dist/guest/toolchains/signature.d.ts +5 -0
- package/dist/guest/toolchains/signature.js +22 -0
- package/dist/guest/toolchains/split.d.ts +28 -0
- package/dist/guest/toolchains/split.js +60 -0
- package/dist/guest/toolchains/steam/client.js +2 -1
- package/dist/guest/toolchains/step-scheduler.d.ts +51 -0
- package/dist/guest/toolchains/step-scheduler.js +147 -0
- package/dist/guest/toolchains/step.d.ts +13 -0
- package/dist/guest/toolchains/tools/git.js +18 -0
- package/dist/guest/vpn/openvpn.js +3 -4
- package/dist/guest/vpn/tunnel.d.ts +3 -0
- package/dist/guest/vpn/tunnel.js +10 -12
- package/dist/guest/vpn/vpn.js +6 -1
- package/dist/guest/vpn/wireguard.js +11 -4
- package/dist/host/accounts/deliver.js +7 -0
- package/dist/host/accounts/handoff.js +2 -6
- package/dist/host/accounts/index.d.ts +1 -1
- package/dist/host/accounts/index.js +1 -1
- package/dist/host/accounts/kinds/cfx.d.ts +1 -1
- package/dist/host/accounts/kinds/cfx.js +47 -4
- package/dist/host/accounts/kinds/comet.d.ts +2 -0
- package/dist/host/accounts/kinds/comet.js +6 -0
- package/dist/host/accounts/kinds/perplexity.d.ts +2 -0
- package/dist/host/accounts/kinds/perplexity.js +30 -0
- package/dist/host/accounts/leases.d.ts +9 -3
- package/dist/host/accounts/leases.js +13 -2
- package/dist/host/accounts/source.d.ts +7 -1
- package/dist/host/accounts/source.js +28 -1
- package/dist/host/accounts/sources.js +4 -0
- package/dist/host/agent-commands/commands.js +1 -1
- package/dist/host/agent-commands/forwarders.d.ts +14 -2
- package/dist/host/agent-commands/forwarders.js +31 -13
- package/dist/host/agent-commands/reconcile.d.ts +2 -1
- package/dist/host/agent-commands/reconcile.js +7 -8
- package/dist/host/agent-commands/user-path.d.ts +5 -0
- package/dist/host/agent-commands/user-path.js +13 -0
- package/dist/host/github/deliver.d.ts +1 -1
- package/dist/host/github/deliver.js +20 -1
- package/dist/host/github/index.d.ts +2 -1
- package/dist/host/github/index.js +1 -0
- package/dist/host/github/token.d.ts +13 -1
- package/dist/host/github/token.js +19 -2
- package/dist/host/github/verify.d.ts +27 -0
- package/dist/host/github/verify.js +61 -0
- package/dist/host/launch/hints/fivem.d.ts +3 -1
- package/dist/host/launch/hints/fivem.js +68 -2
- package/dist/host/launch/session-file.js +5 -0
- package/dist/host/launch/toolchains.d.ts +2 -1
- package/dist/host/launch/toolchains.js +5 -3
- package/dist/host/profile/accounts.js +2 -4
- package/dist/host/profile/claude-login.d.ts +3 -2
- package/dist/host/profile/claude-login.js +3 -13
- package/dist/host/vpn/index.d.ts +2 -1
- package/dist/host/vpn/index.js +2 -1
- package/dist/host/vpn/last.d.ts +28 -0
- package/dist/host/vpn/last.js +43 -0
- package/dist/host/vpn/login.d.ts +3 -1
- package/dist/host/vpn/login.js +17 -3
- package/dist/host/vpn/nordvpn.d.ts +2 -4
- package/dist/host/vpn/nordvpn.js +2 -24
- package/dist/runtime/agent.js +433 -90
- package/dist/runtime/daemon.js +3378 -1546
- package/dist/runtime/db.js +363 -90
- package/dist/runtime/main.js +5134 -2096
- package/dist/runtime/netproxy.js +308 -69
- package/dist/runtime/tool.js +2867 -1765
- package/dist/runtime/view.js +308 -69
- package/dist/selftest/agent-commands.test.js +45 -7
- package/dist/selftest/agent-paths.test.js +40 -13
- package/dist/selftest/agent-settings.test.d.ts +2 -0
- package/dist/selftest/agent-settings.test.js +94 -0
- package/dist/selftest/agents-web.test.d.ts +2 -0
- package/dist/selftest/agents-web.test.js +647 -0
- package/dist/selftest/app.test.js +7 -3
- package/dist/selftest/boot-runner.test.d.ts +2 -0
- package/dist/selftest/boot-runner.test.js +456 -0
- package/dist/selftest/channel.test.js +15 -0
- package/dist/selftest/cli.test.js +4 -0
- package/dist/selftest/fivem.test.js +249 -3
- package/dist/selftest/github.test.js +94 -9
- package/dist/selftest/guest-boot.test.js +3 -0
- package/dist/selftest/health.test.js +1 -1
- package/dist/selftest/index.js +10 -0
- package/dist/selftest/layout.test.js +5 -0
- package/dist/selftest/menu-coverage.test.d.ts +2 -0
- package/dist/selftest/menu-coverage.test.js +46 -0
- package/dist/selftest/menu-screens.js +37 -1
- package/dist/selftest/menu.test.js +5 -3
- package/dist/selftest/pc-installs.test.js +5 -0
- package/dist/selftest/persisted-installs.test.js +72 -0
- package/dist/selftest/service-accounts.test.js +3 -2
- package/dist/selftest/support/engine-golden.js +28 -1
- package/dist/selftest/support/fixtures.d.ts +15 -0
- package/dist/selftest/support/web-preview.d.ts +34 -1
- package/dist/selftest/support/web-preview.js +21 -18
- package/dist/selftest/toolchains.test.js +23 -1
- package/dist/selftest/ui-text.test.d.ts +7 -0
- package/dist/selftest/ui-text.test.js +300 -0
- package/dist/selftest/vpn.test.js +51 -3
- package/dist/shared/accounts/anthropic.d.ts +5 -0
- package/dist/shared/accounts/anthropic.js +15 -0
- package/dist/shared/accounts/index.d.ts +3 -0
- package/dist/shared/accounts/index.js +3 -0
- package/dist/shared/accounts/kinds/comet.d.ts +12 -0
- package/dist/shared/accounts/kinds/comet.js +64 -0
- package/dist/shared/accounts/kinds/perplexity.d.ts +8 -0
- package/dist/shared/accounts/kinds/perplexity.js +37 -0
- package/dist/shared/accounts/kinds.d.ts +24 -5
- package/dist/shared/accounts/kinds.js +86 -4
- package/dist/shared/accounts/payloads.d.ts +81 -0
- package/dist/shared/accounts/payloads.js +39 -1
- package/dist/shared/apps/agent-addons.d.ts +33 -5
- package/dist/shared/apps/agent-addons.js +95 -3
- package/dist/shared/apps/catalogue-agents-web.d.ts +14 -0
- package/dist/shared/apps/catalogue-agents-web.js +112 -0
- package/dist/shared/apps/catalogue-modding.js +32 -1
- package/dist/shared/apps/catalogue.d.ts +27 -3
- package/dist/shared/apps/catalogue.js +2 -1
- package/dist/shared/apps/index.d.ts +3 -1
- package/dist/shared/apps/index.js +3 -1
- package/dist/shared/channel/schema.d.ts +40 -3
- package/dist/shared/channel/schema.js +9 -0
- package/dist/shared/channel/secrets.d.ts +19 -0
- package/dist/shared/concurrency/index.d.ts +3 -0
- package/dist/shared/concurrency/index.js +3 -0
- package/dist/shared/concurrency/installer-retry.d.ts +6 -0
- package/dist/shared/concurrency/installer-retry.js +10 -0
- package/dist/shared/concurrency/limiter.d.ts +19 -0
- package/dist/shared/concurrency/limiter.js +67 -0
- package/dist/shared/concurrency/pools.d.ts +7 -0
- package/dist/shared/concurrency/pools.js +9 -0
- package/dist/shared/download/archive.d.ts +2 -0
- package/dist/shared/download/archive.js +11 -1
- package/dist/shared/download/bounded-fetch.d.ts +13 -0
- package/dist/shared/download/bounded-fetch.js +40 -0
- package/dist/shared/download/downloader.d.ts +5 -0
- package/dist/shared/download/downloader.js +50 -38
- package/dist/shared/download/index.d.ts +2 -1
- package/dist/shared/download/index.js +2 -1
- package/dist/shared/io/disk.d.ts +9 -0
- package/dist/shared/io/disk.js +19 -0
- package/dist/shared/io/index.d.ts +1 -0
- package/dist/shared/io/index.js +1 -0
- package/dist/shared/readiness.d.ts +9 -0
- package/dist/shared/readiness.js +11 -0
- package/dist/shared/signer.d.ts +24 -0
- package/dist/shared/signer.js +15 -0
- package/dist/shared/vpn/failure.d.ts +10 -0
- package/dist/shared/vpn/failure.js +28 -0
- package/dist/sync/watcher.js +2 -0
- package/dist/web/index.html +1 -1
- package/dist/web/{main-GVZWWP4I.js → main-CCILLX2M.js} +75 -74
- package/native/csharp/HcsHost/AssemblyInfo.cs +3 -3
- package/native/csharp/HostTools/AssemblyInfo.cs +3 -3
- package/native/csharp/HostTools/Program.cs +14 -1
- package/native/csharp/HostTools/UserPath.cs +17 -0
- package/native/csharp/StorageHelper/AssemblyInfo.cs +3 -3
- package/native/scripts/edit-user-path.ps1 +6 -2
- package/package.json +1 -1
- package/sandbox/addons/browser-use-mcp/requirements.in +1 -0
- package/sandbox/addons/browser-use-mcp/requirements.txt +2350 -0
- package/sandbox/addons/chrome-devtools-mcp/package-lock.json +38 -0
- package/sandbox/addons/chrome-devtools-mcp/package.json +7 -0
- package/sandbox/addons/comet-mcp/package-lock.json +1277 -0
- package/sandbox/addons/comet-mcp/package.json +7 -0
- package/sandbox/addons/perplexity-mcp/package-lock.json +1655 -0
- package/sandbox/addons/perplexity-mcp/package.json +7 -0
- package/sandbox/scripts/add-firewall-port.ps1 +18 -4
- package/sandbox/scripts/get-signature.ps1 +13 -0
- package/sandbox/scripts/set-machine-environment.ps1 +30 -15
- package/sandbox/templates/fivem/README.txt +6 -2
- package/sandbox/templates/fivem/cs/Client/Client.csproj +15 -0
- package/sandbox/templates/fivem/cs/Client/ClientMain.cs +20 -0
- package/sandbox/templates/fivem/cs/Server/Server.csproj +14 -0
- package/sandbox/templates/fivem/cs/Server/ServerMain.cs +20 -0
- package/sandbox/templates/fivem/cs/fxmanifest.lua +11 -0
- package/sandbox/templates/fivem/js/client.js +12 -0
- package/sandbox/templates/fivem/js/fxmanifest.lua +9 -0
- package/sandbox/templates/fivem/js/server.js +6 -0
- package/sandbox/templates/fivem/lua/client.lua +8 -0
- package/sandbox/templates/fivem/lua/fxmanifest.lua +10 -0
- package/sandbox/templates/fivem/lua/server.lua +6 -0
- package/sandbox/templates/fivem/server.cfg +37 -0
- package/sandbox/templates/fivem/ts/build.js +17 -0
- package/sandbox/templates/fivem/ts/fxmanifest.lua +9 -0
- package/sandbox/templates/fivem/ts/package.json +16 -0
- package/sandbox/templates/fivem/ts/src/client/client.ts +12 -0
- package/sandbox/templates/fivem/ts/src/client/tsconfig.json +13 -0
- package/sandbox/templates/fivem/ts/src/server/server.ts +6 -0
- package/sandbox/templates/fivem/ts/src/server/tsconfig.json +13 -0
- package/schemas/config.schema.json +120 -27
- package/schemas/sandbox-config.schema.json +45 -14
- package/sandbox/scripts/get-signer.ps1 +0 -8
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
// Agent commands
|
|
1
|
+
// Agent commands: which agents get a forwarding command, what the files contain, and that "off" changes nothing.
|
|
2
2
|
// Everything happens in the test's temp folder with a made-up PATH; your real PATH is never read or written.
|
|
3
3
|
import fs from 'node:fs';
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import { DEFAULTS } from '../core/config/index.js';
|
|
6
6
|
import { agentCommands, commandsDir, realAgent } from '../host/agent-commands/index.js';
|
|
7
7
|
import { forwardingCmd, forwardingSh } from '../host/agent-commands/index.js';
|
|
8
|
-
import { reconcileAgentCommands } from '../host/agent-commands/index.js';
|
|
8
|
+
import { forwardTarget, reconcileAgentCommands } from '../host/agent-commands/index.js';
|
|
9
|
+
import { agentCommandsSection } from '../app/features/agent-commands/agent-commands.def.js';
|
|
10
|
+
import { applyAgentCommandsChange } from '../app/features/settings/settings.run.js';
|
|
11
|
+
import { fakeIO } from '../app/kernel/index.js';
|
|
12
|
+
import { runDefinition } from '../app/registry.js';
|
|
9
13
|
export const agentCommandsSuite = {
|
|
10
14
|
name: 'agent-commands',
|
|
11
|
-
title: 'agent commands
|
|
15
|
+
title: 'agent commands: claude, codex ... forwarded into a hidden sandbox',
|
|
12
16
|
run: async (t) => {
|
|
13
17
|
const storage = t.at('agent-cmd-storage');
|
|
14
18
|
const npmDir = t.at('agent-cmd-npm');
|
|
@@ -33,19 +37,53 @@ export const agentCommandsSuite = {
|
|
|
33
37
|
t.check(!agentCommands(on, storage, unsafeDir).some((a) => a.command === 'aider'), 'an agent in a folder whose path has % or ^ (which cmd.exe would expand) is left alone');
|
|
34
38
|
t.section('the forwarding files');
|
|
35
39
|
const claude = { harness: 'claude', command: 'claude', real: path.join(localBin, 'claude.exe') };
|
|
36
|
-
const
|
|
40
|
+
const direct = { node: 'C:\\node\\node.exe', entry: 'C:\\tool\\dist\\bin\\sandbox.js' };
|
|
41
|
+
const cmd = forwardingCmd(claude, direct);
|
|
37
42
|
t.check(cmd.includes('"C:\\node\\node.exe" "C:\\tool\\dist\\bin\\sandbox.js" launch --harness claude --headless --terminal -- %*') &&
|
|
38
43
|
cmd.includes('if "%SANDBOX_AGENT_DIRECT%"=="1" goto direct') &&
|
|
39
44
|
cmd.includes('call "' + claude.real + '" %*'), 'the .cmd starts the agent in a hidden sandbox attached to this terminal, unless SANDBOX_AGENT_DIRECT=1 (real agent)');
|
|
40
|
-
|
|
45
|
+
t.check(cmd.includes('if not exist "C:\\node\\node.exe" goto direct') &&
|
|
46
|
+
cmd.includes('if not exist "C:\\tool\\dist\\bin\\sandbox.js" goto direct') &&
|
|
47
|
+
cmd.indexOf('if not exist') < cmd.indexOf('launch --harness'), 'the .cmd runs the real agent when the tool was uninstalled or moved, instead of failing');
|
|
48
|
+
const managed = forwardTarget('C:\\tool\\versions\\1.0\\package', 'C:\\tool', 'C:\\node\\node.exe');
|
|
49
|
+
const viaLauncher = forwardingCmd(claude, managed);
|
|
50
|
+
t.check(managed.launcher === 'C:\\tool\\bin\\sandbox.cmd' &&
|
|
51
|
+
forwardTarget('C:\\src\\repo', null, 'C:\\node\\node.exe').launcher === undefined &&
|
|
52
|
+
viaLauncher.includes('call "C:\\tool\\bin\\sandbox.cmd" launch --harness claude --headless --terminal -- %*') &&
|
|
53
|
+
!viaLauncher.includes('versions') &&
|
|
54
|
+
forwardingSh(claude, managed).includes("[ -f '/c/tool/bin/sandbox' ] || exec "), 'under a managed install the files call its launcher (it survives updates), else node and the entry file');
|
|
55
|
+
const sh = forwardingSh({ ...claude, real: "C:\\Users\\me\\it's\\claude.exe" }, {
|
|
56
|
+
node: 'C:\\node\\node.exe',
|
|
57
|
+
entry: 'C:\\tool\\sandbox.js',
|
|
58
|
+
});
|
|
41
59
|
t.check(sh.startsWith('#!/bin/sh') &&
|
|
42
60
|
sh.includes("exec '/c/node/node.exe' '/c/tool/sandbox.js' launch --harness claude --headless --terminal -- \"$@\"") &&
|
|
43
61
|
sh.includes("'/c/Users/me/it'\\''s/claude.exe'"), 'Git Bash gets a shell script with POSIX paths, quoted safely');
|
|
44
62
|
t.section('off changes nothing');
|
|
45
63
|
// Off with nothing set up: nothing to do, no PATH edit (which would be refused during the self-test anyway).
|
|
46
64
|
const fresh = t.at('agent-cmd-fresh');
|
|
47
|
-
const
|
|
65
|
+
const target = { node: 'C:\\node\\node.exe', entry: 'C:\\tool\\sandbox.js' };
|
|
66
|
+
const off = reconcileAgentCommands(DEFAULTS, fresh, target);
|
|
48
67
|
t.equal({ on: off.on, changed: off.changed, wrote: fs.existsSync(commandsDir(fresh)) }, { on: false, changed: false, wrote: false }, 'off (the default) writes nothing and leaves your PATH alone');
|
|
49
|
-
await t.throws(() => reconcileAgentCommands(on, t.at('agent-cmd-on'),
|
|
68
|
+
await t.throws(() => reconcileAgentCommands(on, t.at('agent-cmd-on'), target), /self-test|PATH/i, 'turning it on edits your PATH, which the self-test refuses (it never changes this PC)');
|
|
69
|
+
t.section('every surface');
|
|
70
|
+
await t.throws(() => runDefinition('agentCommands.on', {}, {}, fakeIO().io), /self-test|PATH|inside the sandbox/i, 'agentCommands.on refuses in the self-test (it would change this PC)');
|
|
71
|
+
const reconciled = [];
|
|
72
|
+
const fakeService = { reconcile: (c) => reconciled.push(c) };
|
|
73
|
+
const ctx = { loaded: { configPath: undefined } };
|
|
74
|
+
applyAgentCommandsChange(ctx, 'user', 'agentCommands.enabled', fakeService);
|
|
75
|
+
applyAgentCommandsChange(ctx, 'user', 'defaultHarness', fakeService);
|
|
76
|
+
applyAgentCommandsChange(ctx, 'project', 'agentCommands.enabled', fakeService);
|
|
77
|
+
t.equal(reconciled.length, 1, 'changing agentCommands.* in your settings (any surface) brings this PC in line');
|
|
78
|
+
const section = agentCommandsSection({
|
|
79
|
+
enabled: false,
|
|
80
|
+
dir: 'C:\\x',
|
|
81
|
+
found: [{ command: 'claude', harness: 'claude', real: 'C:\\r\\claude.exe' }],
|
|
82
|
+
});
|
|
83
|
+
const toggle = section.items?.[0].primary;
|
|
84
|
+
t.check(section.items?.map((i) => i.id).join() === 'agentCommands,agentCommand:claude' &&
|
|
85
|
+
toggle?.kind === 'operation' &&
|
|
86
|
+
toggle.op === 'agentCommands.on' &&
|
|
87
|
+
!JSON.stringify(section).includes('sandbox agent-commands'), 'the Agents page offers the switch as an action and lists each agent found, naming no command');
|
|
50
88
|
},
|
|
51
89
|
};
|
|
@@ -5,8 +5,8 @@ import path from 'node:path';
|
|
|
5
5
|
import { DEFAULTS, mergeConfig, validateConfig } from '../core/config/index.js';
|
|
6
6
|
import { isWin } from '../core/util/index.js';
|
|
7
7
|
import { SYSTEM } from '../shared/system.js';
|
|
8
|
-
import { agentCommand, agentShims, bootResetPaths,
|
|
9
|
-
import { appendMissing, expandVars, isPinnedNodeDir, parseRegPath, pathKey, planPath, rebuildPath, splitPath, } from '../guest/setup/path-plan.js';
|
|
8
|
+
import { agentCommand, agentShims, bootResetPaths, isCopyableDatabaseFile, isDatabaseFile, localStateEntries, shimText, } from '../guest/agents/agent-files.js';
|
|
9
|
+
import { appendMissing, expandVars, installedToolPaths, isGitUsrBin, isMsvcToolsDir, isPinnedNodeDir, msvcBeforeGitUsr, parseRegPath, pathKey, planPath, rebuildPath, splitPath, } from '../guest/setup/path-plan.js';
|
|
10
10
|
import { withReloadEnvironment } from '../host/tools/index.js';
|
|
11
11
|
import { HarnessSchema } from '../core/schema/index.js';
|
|
12
12
|
export const agentPathsSuite = {
|
|
@@ -59,17 +59,6 @@ export const agentPathsSuite = {
|
|
|
59
59
|
], "codex's DPAPI-sealed sandbox users and setup marker are removed at boot (CryptUnprotectData otherwise)");
|
|
60
60
|
t.check(HarnessSchema.safeParse({ ...DEFAULTS.harnesses.codex, bootReset: ['..\\login'] }).success === false &&
|
|
61
61
|
HarnessSchema.safeParse({ ...DEFAULTS.harnesses.codex, bootReset: ['C:\\Windows'] }).success === false, 'bootReset takes only plain paths below the agent state folder');
|
|
62
|
-
t.section('codex without its own command sandbox');
|
|
63
|
-
const userToml = '[tui]\nscreen_reader_detection_done = true\n\n[windows]\nsandbox = "elevated"\n';
|
|
64
|
-
const off = codexConfigWithoutSandbox(userToml) ?? '';
|
|
65
|
-
t.check(off.split('\n').find((l) => !l.startsWith('#')) === 'sandbox_mode = "danger-full-access"' &&
|
|
66
|
-
off.endsWith(userToml), 'sandbox_mode goes above the first table, the rest of the file is kept');
|
|
67
|
-
t.check(codexConfigWithoutSandbox('') === off.slice(0, off.indexOf('\n\n') + 1), 'a missing config.toml gets just the setting');
|
|
68
|
-
t.equal([
|
|
69
|
-
codexConfigWithoutSandbox(off),
|
|
70
|
-
codexConfigWithoutSandbox('model = "o3"\nsandbox_mode = "workspace-write"\n[windows]\n'),
|
|
71
|
-
], [null, null], 'a sandbox_mode already set (by the sandbox or by the user) is left alone');
|
|
72
|
-
t.check(codexConfigWithoutSandbox('[profiles.x]\nsandbox_mode = "read-only"\n') !== null, 'a sandbox_mode inside a table does not count as the top-level one');
|
|
73
62
|
t.section('PATH planner');
|
|
74
63
|
const present = new Set(['c:\\a', 'c:\\b', 'c:\\c\\d', 'c:\\nvm\\v24.1.0']);
|
|
75
64
|
const exists = (f) => present.has(pathKey(f));
|
|
@@ -89,6 +78,44 @@ export const agentPathsSuite = {
|
|
|
89
78
|
}), 'C:\\only;C:\\a\\;C:\\Windows;C:\\b;C:\\u', 'a new shell: process-only entries first, then the registry, no duplicates, no runner node');
|
|
90
79
|
t.equal(parseRegPath('\r\nHKEY_LOCAL_MACHINE\\X\r\n Path REG_EXPAND_SZ C:\\a;%SystemRoot%\r\n\r\n'), 'C:\\a;%SystemRoot%', 'reg query output is parsed');
|
|
91
80
|
t.equal(parseRegPath('ERROR: nothing'), '', 'no Path value is an empty PATH');
|
|
81
|
+
t.section('MSVC link before Git coreutils link');
|
|
82
|
+
const gitUsr = 'C:\\AgentData\\tools\\git\\usr\\bin';
|
|
83
|
+
const msvcBin = 'C:\\AgentData\\tools\\msvc\\VC\\Tools\\MSVC\\14.44.35207\\bin\\Hostx64\\x64';
|
|
84
|
+
t.check(isGitUsrBin(gitUsr) && isGitUsrBin('C:\\Program Files\\Git\\usr\\bin\\') && !isGitUsrBin('C:\\x\\usr\\bin'), "only Git's usr\\bin is recognised");
|
|
85
|
+
t.check(isMsvcToolsDir(msvcBin) && !isMsvcToolsDir('C:\\a\\bin'), "MSVC's compiler folder is recognised");
|
|
86
|
+
t.equal(msvcBeforeGitUsr(['C:\\a', gitUsr, 'C:\\b', msvcBin, 'C:\\c']), ['C:\\a', msvcBin, gitUsr, 'C:\\b', 'C:\\c'], 'MSVC found after Git usr\\bin moves just before it');
|
|
87
|
+
t.equal(msvcBeforeGitUsr([msvcBin, 'C:\\a', gitUsr]), [msvcBin, 'C:\\a', gitUsr], 'already in order: unchanged');
|
|
88
|
+
t.equal(msvcBeforeGitUsr(['C:\\a', gitUsr]), ['C:\\a', gitUsr], 'no MSVC: unchanged');
|
|
89
|
+
t.equal(planPath({ entries: [gitUsr, msvcBin], exists: () => true }), [msvcBin, gitUsr], 'the machine PATH plan puts MSVC first');
|
|
90
|
+
t.equal(appendMissing(gitUsr, msvcBin).split(';'), [msvcBin, gitUsr], 'a process that gains the MSVC folder later still finds its link first');
|
|
91
|
+
t.section('installed python and rust on every project');
|
|
92
|
+
const tree = new Set([
|
|
93
|
+
'python\\python-3.9.1\\python.exe',
|
|
94
|
+
'python\\python-3.15.2\\python.exe',
|
|
95
|
+
'python\\python-3.15.2',
|
|
96
|
+
'python\\python2-2.7.18\\python.exe',
|
|
97
|
+
'python\\python-3.20.0',
|
|
98
|
+
'shims\\py.cmd',
|
|
99
|
+
'rust\\cargo\\bin\\rustup.exe',
|
|
100
|
+
].map((p) => 'c:\\t\\' + p.toLowerCase()));
|
|
101
|
+
const names = {
|
|
102
|
+
'c:\\t\\python': ['python-3.9.1', 'python-3.15.2', 'python2-2.7.18', 'python-3.20.0'],
|
|
103
|
+
};
|
|
104
|
+
const toolsFs = {
|
|
105
|
+
exists: (f) => tree.has(f.toLowerCase()),
|
|
106
|
+
list: (d) => names[d.toLowerCase()] ?? [],
|
|
107
|
+
};
|
|
108
|
+
const both = installedToolPaths('C:\\T', toolsFs);
|
|
109
|
+
t.equal(both.append, [
|
|
110
|
+
'C:\\T\\python\\python-3.15.2',
|
|
111
|
+
'C:\\T\\python\\python-3.15.2\\Scripts',
|
|
112
|
+
'C:\\T\\shims',
|
|
113
|
+
'C:\\T\\rust\\cargo\\bin',
|
|
114
|
+
], 'the newest complete Python (not Python 2, not an unfinished folder) and rust go on PATH');
|
|
115
|
+
t.equal(both.vars, { RUSTUP_HOME: 'C:\\T\\rust\\rustup', CARGO_HOME: 'C:\\T\\rust\\cargo' }, "rust's own tools find their homes");
|
|
116
|
+
t.check(both.summary.length === 2, 'the guide can say what is there');
|
|
117
|
+
t.equal(installedToolPaths('C:\\T', toolsFs, new Set(['python', 'rust'])).append, [], 'a toolchain whose step runs brings its own entries');
|
|
118
|
+
t.equal(installedToolPaths('C:\\Empty', { exists: () => false, list: () => [] }).append, [], 'nothing installed: nothing added');
|
|
92
119
|
t.section('Windows Terminal reloads the environment');
|
|
93
120
|
t.equal(withReloadEnvironment({ compatibility: { reloadEnvironmentVariables: true } }), null, 'already set: unchanged');
|
|
94
121
|
t.equal(withReloadEnvironment({ theme: 'dark', compatibility: { other: 1 } })?.compatibility, { other: 1, reloadEnvironmentVariables: true }, 'set without touching the rest of compatibility');
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// Codex settings (launch flags, config.toml), the Claude environment editor and the one Anthropic key pattern.
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import { DEFAULTS } from '../core/config/index.js';
|
|
4
|
+
import { CodexSchema } from '../core/schema/index.js';
|
|
5
|
+
import { agentEnv, agentsEnvSet } from '../app/features/agents/index.js';
|
|
6
|
+
import { agentsOptions } from '../cli/menu/pages/agents-page.js';
|
|
7
|
+
import { fakeIO } from '../app/kernel/index.js';
|
|
8
|
+
import { runDefinition } from '../app/registry.js';
|
|
9
|
+
import { agentArguments, agentShims, codexArguments, codexConfigOwned, shimText } from '../guest/agents/agent-files.js';
|
|
10
|
+
import { ANTHROPIC_KEY_PATTERN, anthropicKeyProblem } from '../shared/accounts/index.js';
|
|
11
|
+
import { CLAUDE_ENV, ENV_GROUPS } from '../app/features/agents/claude-env.def.js';
|
|
12
|
+
const CODEX = DEFAULTS.codex;
|
|
13
|
+
export const agentSettingsSuite = {
|
|
14
|
+
name: 'agent-settings',
|
|
15
|
+
title: 'Codex settings, Claude environment editor, Anthropic key pattern',
|
|
16
|
+
run: async (t) => {
|
|
17
|
+
t.section('codex launch flags');
|
|
18
|
+
t.equal(codexArguments(CODEX), ['--dangerously-bypass-approvals-and-sandbox'], 'full access + never = the bypass flag');
|
|
19
|
+
t.equal(codexArguments({ ...CODEX, sandboxMode: 'workspace-write', approvalPolicy: 'on-request' }), ['--sandbox', 'workspace-write', '--ask-for-approval', 'on-request'], 'another mode gets explicit flags');
|
|
20
|
+
t.equal(codexArguments({ ...CODEX, sandboxMode: 'danger-full-access', approvalPolicy: 'on-failure' }), ['--sandbox', 'danger-full-access', '--ask-for-approval', 'on-failure'], 'the bypass flag is only for full access with no questions');
|
|
21
|
+
t.equal(codexArguments({ ...CODEX, model: 'gpt-5', reasoningEffort: 'high' }).slice(1), ['-c', 'model="gpt-5"', '-c', 'model_reasoning_effort="high"'], 'model and reasoning effort follow as -c overrides');
|
|
22
|
+
t.check(CodexSchema.safeParse({ ...CODEX, model: 'x"; evil' }).success === false, 'a model name cannot carry quotes');
|
|
23
|
+
const codex = DEFAULTS.harnesses.codex;
|
|
24
|
+
t.equal(agentArguments('codex', codex, CODEX), [...codex.arguments, '--dangerously-bypass-approvals-and-sandbox'], "codex's launch arguments carry the flags");
|
|
25
|
+
t.equal(agentArguments('claude', DEFAULTS.harnesses.claude, CODEX), [...DEFAULTS.harnesses.claude.arguments], 'other agents do not');
|
|
26
|
+
const shim = agentShims('C:\\AgentData\\tools', DEFAULTS.harnesses, { codex: codexArguments(CODEX) }).find((s) => s.name === 'codex');
|
|
27
|
+
const text = shim ? shimText(shim, { node: 'node.exe', script: 'agent.js' }) : '';
|
|
28
|
+
t.includes(text, '"%SBX_REAL%" --dangerously-bypass-approvals-and-sandbox %*', 'the codex.cmd shim adds the flags');
|
|
29
|
+
t.excludes(shimText(agentShims('C:\\AgentData\\tools', DEFAULTS.harnesses).find((s) => s.name === 'codex'), { node: 'node.exe', script: 'agent.js' }), 'dangerously', 'a shim without flags passes only %*');
|
|
30
|
+
t.section('codex config.toml');
|
|
31
|
+
const old = '# Set by the sandbox: x\nsandbox_mode = "danger-full-access"\n\n[tui]\nscreen_reader_detection_done = true\n\n[windows]\nsandbox = "elevated"\n';
|
|
32
|
+
const owned = codexConfigOwned(old, CODEX);
|
|
33
|
+
t.check(!owned.includes('sandbox_mode') && !owned.includes('Set by the sandbox') && !owned.includes('sandbox = '), 'the old sandbox_mode lines and [windows] sandbox are removed', owned);
|
|
34
|
+
t.check(owned.includes('mcp_oauth_credentials_store = "file"') &&
|
|
35
|
+
owned.includes('[tui]\nscreen_reader_detection_done = true\n') &&
|
|
36
|
+
owned.includes('[windows]'), 'MCP logins go to a file; every other line stays', owned);
|
|
37
|
+
t.equal(codexConfigOwned(owned, CODEX), owned, 'running it again changes nothing');
|
|
38
|
+
t.includes(codexConfigOwned(old, { ...CODEX, windowsSandbox: 'unelevated' }), '[windows]\nsandbox = "unelevated"', 'a Windows sandbox mode is written when asked for');
|
|
39
|
+
t.includes(codexConfigOwned('mcp_oauth_credentials_store = "keyring"\n', CODEX), 'mcp_oauth_credentials_store = "keyring"', "a user's own mcp_oauth_credentials_store is kept");
|
|
40
|
+
t.equal(codexConfigOwned('', { ...CODEX, mcpLoginsInFile: false }), '', 'an empty file stays empty when nothing is owned');
|
|
41
|
+
t.section('Anthropic key pattern');
|
|
42
|
+
const body = 'a'.repeat(60);
|
|
43
|
+
t.check(ANTHROPIC_KEY_PATTERN.test('sk-ant-usr01-' + body) && ANTHROPIC_KEY_PATTERN.test('sk-ant-api03-' + body), 'sk-ant-api03- and sk-ant-usr01- keys are accepted');
|
|
44
|
+
t.check(!ANTHROPIC_KEY_PATTERN.test('sk-ant-usr1-x') && anthropicKeyProblem('sk-ant-usr1-x') !== null, 'a short or malformed key is refused');
|
|
45
|
+
t.check(anthropicKeyProblem('sk-ant-usr01-' + body) === null, 'no problem for a user-workspace key');
|
|
46
|
+
t.section('Claude environment catalogue');
|
|
47
|
+
const names = CLAUDE_ENV.map((s) => s.name);
|
|
48
|
+
t.check(new Set(names).size === names.length, 'names are unique');
|
|
49
|
+
t.check(names.every((n) => /^[A-Z][A-Z0-9_]+$/.test(n)) && CLAUDE_ENV.every((s) => ENV_GROUPS.includes(s.group)), 'names and groups are valid');
|
|
50
|
+
t.check(names.includes('CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS'), 'the subagent limit is there');
|
|
51
|
+
t.section('Claude environment operations');
|
|
52
|
+
const configPath = t.at('agent-env', 'config.json');
|
|
53
|
+
t.write(configPath, '{}\n');
|
|
54
|
+
const ctx = {
|
|
55
|
+
packageRoot: t.dir('agent-env', 'package'),
|
|
56
|
+
options: {},
|
|
57
|
+
loaded: { config: structuredClone(DEFAULTS), configPath, base: t.temp },
|
|
58
|
+
storageRoot: t.dir('agent-env', 'storage'),
|
|
59
|
+
dataPath: t.dir('agent-env', 'storage', 'data', 'o'),
|
|
60
|
+
};
|
|
61
|
+
const io = fakeIO([]).io;
|
|
62
|
+
const set = (name, value) => runDefinition(agentsEnvSet.id, ctx, { agent: 'claude', name, value }, io);
|
|
63
|
+
const read = async () => (await runDefinition(agentEnv.id, ctx, { agent: 'claude' }, io));
|
|
64
|
+
await set('CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS', '40');
|
|
65
|
+
let row = (await read()).rows.find((r) => r.name === 'CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS');
|
|
66
|
+
t.check(row?.set === true && row.value === '40', 'a number is saved and read back');
|
|
67
|
+
t.includes(fs.readFileSync(configPath, 'utf8'), '"CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS": "40"', 'it is in the settings file');
|
|
68
|
+
await t.throws(() => set('CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS', 'many'), 'whole number', 'a word is refused for a number');
|
|
69
|
+
await t.throws(() => set('CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS', '0'), 'Use a number', 'zero is refused');
|
|
70
|
+
await set('CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS', null);
|
|
71
|
+
row = (await read()).rows.find((r) => r.name === 'CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS');
|
|
72
|
+
t.check(row?.set === false, 'an empty value removes it');
|
|
73
|
+
await t.throws(() => set('ANTHROPIC_API_KEY', 'sk-ant-usr1-x'), 'API key', 'the environment editor refuses a bad key');
|
|
74
|
+
const key = 'sk-ant-usr01-' + 'k'.repeat(60);
|
|
75
|
+
await set('ANTHROPIC_API_KEY', key);
|
|
76
|
+
const shown = JSON.stringify(await read());
|
|
77
|
+
t.check(!shown.includes(key.slice(13)), 'a secret value is never returned');
|
|
78
|
+
t.check((await read()).rows.find((r) => r.name === 'ANTHROPIC_API_KEY')?.set === true, 'but it says it is set');
|
|
79
|
+
const env = await read();
|
|
80
|
+
const menu = agentsOptions({
|
|
81
|
+
folder: 'C:/code',
|
|
82
|
+
defaultAgent: 'claude',
|
|
83
|
+
agents: [{ name: 'claude', ready: true }],
|
|
84
|
+
last: undefined,
|
|
85
|
+
attach: false,
|
|
86
|
+
window: 'config',
|
|
87
|
+
hostAgents: [],
|
|
88
|
+
claudeEnv: env,
|
|
89
|
+
});
|
|
90
|
+
t.check(menu.categories?.some((c) => c.id === 'env') === true &&
|
|
91
|
+
menu.items.some((i) => i.label === 'Subagents at once' || i.label === 'API key'), 'the menu has a Claude environment tab with the variables');
|
|
92
|
+
await t.throws(() => set('bad name', '1'), '', 'a bad variable name is refused');
|
|
93
|
+
},
|
|
94
|
+
};
|