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
package/dist/core/util/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { isWin, sleep, captureOutput } from './process.js';
|
|
2
|
-
export { UserError, fail, errMsg } from './errors.js';
|
|
2
|
+
export { UserError, fail, failWith, errMsg } from './errors.js';
|
|
3
3
|
export { parseJsonc, readJsonc } from './jsonc.js';
|
|
4
4
|
export { ensureDir, dirExists, fileExists, fileExistsAsync, readJson, readSmallFile, tryReadJson, writeJson, realPath, } from './fs.js';
|
|
5
5
|
export { xmlEscape, safeText, plainText } from './text.js';
|
|
@@ -10,6 +10,8 @@ export interface GuestAdapter<K extends ServiceKind> {
|
|
|
10
10
|
apply(p: Payload<K>): Promise<Applied> | Applied;
|
|
11
11
|
/** Bounded, BOM-aware read of what the tool holds now; null when it holds none. */
|
|
12
12
|
current?(): Payload<K> | null;
|
|
13
|
+
/** Asks the tool before each look, for tools that only answer asynchronously (Comet over its DevTools port). */
|
|
14
|
+
refresh?(): Promise<void>;
|
|
13
15
|
/** How often current() is asked (default 60000 ms). */
|
|
14
16
|
readonly checkMs?: number;
|
|
15
17
|
/** When the sandbox stops: let go of what must not stay taken (a Unity seat). */
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { appstoreAdapter } from './kinds/appstore.js';
|
|
2
2
|
import { cfxAdapter } from './kinds/cfx.js';
|
|
3
|
+
import { cometAdapter } from './kinds/comet.js';
|
|
3
4
|
import { epicAdapter } from './kinds/epic.js';
|
|
4
5
|
import { expoAdapter } from './kinds/expo.js';
|
|
5
6
|
import { keystoreAdapter } from './kinds/keystore.js';
|
|
7
|
+
import { perplexityAdapter } from './kinds/perplexity.js';
|
|
6
8
|
import { playAdapter } from './kinds/play.js';
|
|
7
9
|
import { steamAdapter } from './kinds/steam.js';
|
|
8
10
|
import { unityAdapter } from './kinds/unity.js';
|
|
@@ -15,4 +17,6 @@ export const ADAPTERS = {
|
|
|
15
17
|
play: playAdapter,
|
|
16
18
|
expo: expoAdapter,
|
|
17
19
|
appstore: appstoreAdapter,
|
|
20
|
+
perplexity: perplexityAdapter,
|
|
21
|
+
comet: cometAdapter,
|
|
18
22
|
};
|
|
@@ -5,23 +5,27 @@ import { type GuestAdapter } from './adapter.js';
|
|
|
5
5
|
export declare const DeliveredSchema: z.ZodObject<{
|
|
6
6
|
fingerprints: z.ZodRecord<z.ZodEnum<{
|
|
7
7
|
unity: "unity";
|
|
8
|
-
steam: "steam";
|
|
9
|
-
epic: "epic";
|
|
10
|
-
cfx: "cfx";
|
|
11
8
|
keystore: "keystore";
|
|
12
9
|
play: "play";
|
|
13
10
|
expo: "expo";
|
|
14
11
|
appstore: "appstore";
|
|
15
|
-
}> & z.core.$partial, z.ZodString>;
|
|
16
|
-
leased: z.ZodArray<z.ZodEnum<{
|
|
17
|
-
unity: "unity";
|
|
18
12
|
steam: "steam";
|
|
19
13
|
epic: "epic";
|
|
20
14
|
cfx: "cfx";
|
|
15
|
+
perplexity: "perplexity";
|
|
16
|
+
comet: "comet";
|
|
17
|
+
}> & z.core.$partial, z.ZodString>;
|
|
18
|
+
leased: z.ZodArray<z.ZodEnum<{
|
|
19
|
+
unity: "unity";
|
|
21
20
|
keystore: "keystore";
|
|
22
21
|
play: "play";
|
|
23
22
|
expo: "expo";
|
|
24
23
|
appstore: "appstore";
|
|
24
|
+
steam: "steam";
|
|
25
|
+
epic: "epic";
|
|
26
|
+
cfx: "cfx";
|
|
27
|
+
perplexity: "perplexity";
|
|
28
|
+
comet: "comet";
|
|
25
29
|
}>>;
|
|
26
30
|
}, z.core.$strip>;
|
|
27
31
|
export type Delivered = z.output<typeof DeliveredSchema>;
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
+
import type { Payload } from '../../../shared/accounts/index.js';
|
|
1
2
|
import { type GuestAdapter } from '../adapter.js';
|
|
3
|
+
/** The cfg FXServer reads with +exec (forward slashes: FXServer's exec takes them). */
|
|
4
|
+
export declare function cfxSecretsFile(dir?: string): string;
|
|
5
|
+
/** The cfg's text. The payload's patterns allow no quotes or line breaks, so the values cannot escape their line. */
|
|
6
|
+
export declare function cfxSecretsText(p: Payload<'cfx'>): string;
|
|
7
|
+
/** Writes the cfg into `dir` (only there); returns its path. */
|
|
8
|
+
export declare function writeCfxSecrets(p: Payload<'cfx'>, dir?: string): string;
|
|
2
9
|
export declare const cfxAdapter: GuestAdapter<'cfx'>;
|
|
@@ -1,7 +1,37 @@
|
|
|
1
|
-
|
|
1
|
+
// Cfx.re: the server licence key (and the optional Steam Web API key) go into one cfg on the sandbox's own disk
|
|
2
|
+
// (secretDir: %LOCALAPPDATA%\AgentSandbox\accounts\cfx, wiped with the sandbox) that `sbx-fivem serve` hands FXServer
|
|
3
|
+
// with +exec before the project's server.cfg. Never into the project, the data disk or the tools folder; not in the
|
|
4
|
+
// agent's environment either. It never comes back (the key does not change in the sandbox).
|
|
5
|
+
import fs from 'node:fs';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import { secretDir } from '../adapter.js';
|
|
8
|
+
/** The cfg FXServer reads with +exec (forward slashes: FXServer's exec takes them). */
|
|
9
|
+
export function cfxSecretsFile(dir = secretDir('cfx')) {
|
|
10
|
+
return path.join(dir, 'server-secrets.cfg');
|
|
11
|
+
}
|
|
12
|
+
/** The cfg's text. The payload's patterns allow no quotes or line breaks, so the values cannot escape their line. */
|
|
13
|
+
export function cfxSecretsText(p) {
|
|
14
|
+
return [
|
|
15
|
+
'# Written by the sandbox at boot from your saved Cfx.re key (sandbox account login cfx). It lives on the',
|
|
16
|
+
"# sandbox's own disk and goes when it closes: never copy these lines into a project or a server.cfg.",
|
|
17
|
+
'sv_licenseKey "' + p.licenseKey + '"',
|
|
18
|
+
...(p.steamWebApiKey ? ['set steam_webApiKey "' + p.steamWebApiKey + '"'] : []),
|
|
19
|
+
'',
|
|
20
|
+
].join('\r\n');
|
|
21
|
+
}
|
|
22
|
+
/** Writes the cfg into `dir` (only there); returns its path. */
|
|
23
|
+
export function writeCfxSecrets(p, dir = secretDir('cfx')) {
|
|
24
|
+
const file = cfxSecretsFile(dir);
|
|
25
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
26
|
+
fs.writeFileSync(file, cfxSecretsText(p), { encoding: 'utf8', mode: 0o600 });
|
|
27
|
+
return file;
|
|
28
|
+
}
|
|
2
29
|
export const cfxAdapter = {
|
|
3
30
|
kind: 'cfx',
|
|
4
|
-
apply(
|
|
5
|
-
|
|
31
|
+
apply(p) {
|
|
32
|
+
writeCfxSecrets(p);
|
|
33
|
+
return {
|
|
34
|
+
summary: 'Cfx.re: the server key is ready for sbx-fivem serve' + (p.steamWebApiKey ? ' (with a Steam Web API key)' : ''),
|
|
35
|
+
};
|
|
6
36
|
},
|
|
7
37
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type CometPayload } from '../../../shared/accounts/index.js';
|
|
2
|
+
import { type GuestAdapter } from '../adapter.js';
|
|
3
|
+
/** Where the sign-in waits for Comet. */
|
|
4
|
+
export declare function cometPendingFile(root?: string): string;
|
|
5
|
+
/** The sign-in waiting for Comet, or null (none, or not the expected shape). */
|
|
6
|
+
export declare function takePendingComet(root?: string): CometPayload | null;
|
|
7
|
+
export declare const cometAdapter: GuestAdapter<'comet'>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Comet: the saved perplexity.ai sign-in cookies wait in secretDir('comet') (the sandbox's own disk) until the apps
|
|
2
|
+
// step has Comet ready, which writes them into its profile over DevTools and deletes the file. While the sandbox runs,
|
|
3
|
+
// the watch asks the running Comet for its perplexity.ai cookies, so a sign-in made here (or renewed) is kept for the
|
|
4
|
+
// next sandbox. When Comet is not running, the last sign-in seen stands.
|
|
5
|
+
import fs from 'node:fs';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import { cometSummary, PAYLOADS } from '../../../shared/accounts/index.js';
|
|
8
|
+
import { readBoundedFile } from '../../../shared/io/bounded.js';
|
|
9
|
+
import { readCometSignIn } from '../../browser/comet.js';
|
|
10
|
+
import { secretDir } from '../adapter.js';
|
|
11
|
+
/** Where the sign-in waits for Comet. */
|
|
12
|
+
export function cometPendingFile(root = secretDir('comet')) {
|
|
13
|
+
return path.join(root, 'restore.json');
|
|
14
|
+
}
|
|
15
|
+
/** The sign-in waiting for Comet, or null (none, or not the expected shape). */
|
|
16
|
+
export function takePendingComet(root) {
|
|
17
|
+
const file = cometPendingFile(root);
|
|
18
|
+
const bytes = readBoundedFile(file, 512 * 1024);
|
|
19
|
+
fs.rmSync(file, { force: true });
|
|
20
|
+
if (!bytes)
|
|
21
|
+
return null;
|
|
22
|
+
try {
|
|
23
|
+
const parsed = PAYLOADS.comet.safeParse(JSON.parse(bytes.toString('utf8')));
|
|
24
|
+
return parsed.success ? parsed.data : null;
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return null; // Not JSON: nothing to restore.
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/** The last sign-in seen in this process (the daemon's watch). */
|
|
31
|
+
let held = null;
|
|
32
|
+
export const cometAdapter = {
|
|
33
|
+
kind: 'comet',
|
|
34
|
+
apply(p) {
|
|
35
|
+
const file = cometPendingFile();
|
|
36
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
37
|
+
fs.writeFileSync(file, JSON.stringify(p), { encoding: 'utf8', mode: 0o600 });
|
|
38
|
+
held = p;
|
|
39
|
+
return { summary: 'Comet: your saved sign-in (' + cometSummary(p) + ') goes into its profile once it is ready' };
|
|
40
|
+
},
|
|
41
|
+
async refresh() {
|
|
42
|
+
const now = await readCometSignIn();
|
|
43
|
+
if (now)
|
|
44
|
+
held = now;
|
|
45
|
+
},
|
|
46
|
+
current() {
|
|
47
|
+
return held;
|
|
48
|
+
},
|
|
49
|
+
checkMs: 120_000,
|
|
50
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Perplexity: the API key becomes PERPLEXITY_API_KEY in the agent's environment, in memory only. Nothing is written
|
|
2
|
+
// to a file: the MCP servers read the variable (Claude Code passes its environment on; Codex is told its name).
|
|
3
|
+
import { PERPLEXITY_ENV, perplexitySummary } from '../../../shared/accounts/index.js';
|
|
4
|
+
export const perplexityAdapter = {
|
|
5
|
+
kind: 'perplexity',
|
|
6
|
+
apply(p) {
|
|
7
|
+
return {
|
|
8
|
+
env: { [PERPLEXITY_ENV]: p.apiKey },
|
|
9
|
+
summary: 'Perplexity API key (' + perplexitySummary(p) + ') in ' + PERPLEXITY_ENV + ' for the agent',
|
|
10
|
+
};
|
|
11
|
+
},
|
|
12
|
+
};
|
|
@@ -21,6 +21,8 @@ export declare class AccountWatch {
|
|
|
21
21
|
/** The kinds being watched. */
|
|
22
22
|
watched(): readonly ServiceKind[];
|
|
23
23
|
start(): void;
|
|
24
|
+
/** Lets an adapter that answers asynchronously ask its tool first, then looks; never throws. */
|
|
25
|
+
private look;
|
|
24
26
|
/** One look at one kind; true when a handoff was written. */
|
|
25
27
|
check(kind: ServiceKind): boolean;
|
|
26
28
|
/** Looks at every kind now; with `final` (the sandbox stops) each adapter also lets go of what it holds. */
|
|
@@ -33,11 +33,21 @@ export class AccountWatch {
|
|
|
33
33
|
}
|
|
34
34
|
start() {
|
|
35
35
|
for (const kind of this.kinds) {
|
|
36
|
-
const timer = setInterval(() => this.
|
|
36
|
+
const timer = setInterval(() => void this.look(kind), this.adapter(kind).checkMs ?? DEFAULT_CHECK_MS);
|
|
37
37
|
timer.unref();
|
|
38
38
|
this.timers.push(timer);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
+
/** Lets an adapter that answers asynchronously ask its tool first, then looks; never throws. */
|
|
42
|
+
async look(kind) {
|
|
43
|
+
try {
|
|
44
|
+
await this.adapter(kind).refresh?.();
|
|
45
|
+
}
|
|
46
|
+
catch (e) {
|
|
47
|
+
this.o.warn?.(SERVICE_SPECS[kind].label + ' sign-in: could not read it: ' + errMsg(e));
|
|
48
|
+
}
|
|
49
|
+
return this.check(kind);
|
|
50
|
+
}
|
|
41
51
|
/** One look at one kind; true when a handoff was written. */
|
|
42
52
|
check(kind) {
|
|
43
53
|
try {
|
|
@@ -61,7 +71,7 @@ export class AccountWatch {
|
|
|
61
71
|
/** Looks at every kind now; with `final` (the sandbox stops) each adapter also lets go of what it holds. */
|
|
62
72
|
async flush(final = false) {
|
|
63
73
|
for (const kind of this.kinds)
|
|
64
|
-
this.
|
|
74
|
+
await this.look(kind);
|
|
65
75
|
if (!final)
|
|
66
76
|
return;
|
|
67
77
|
for (const timer of this.timers)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Harness } from '../../core/types.js';
|
|
1
|
+
import type { Config, Harness } from '../../core/types.js';
|
|
2
2
|
/** Where an agent lives in persistent storage: its folder, and the program (an .exe, or an npm .cmd) in it. */
|
|
3
3
|
export interface AgentPaths {
|
|
4
4
|
readonly dir: string;
|
|
@@ -13,12 +13,14 @@ export interface AgentShim {
|
|
|
13
13
|
readonly name: string;
|
|
14
14
|
readonly command: string;
|
|
15
15
|
readonly target: string;
|
|
16
|
+
/** Flags the shim puts before the arguments of the caller (codex: the sandbox's own settings). */
|
|
17
|
+
readonly arguments?: readonly string[];
|
|
16
18
|
}
|
|
17
19
|
/** One shim per configured agent that can be installed here (a name that is not a plain command word is skipped). */
|
|
18
|
-
export declare function agentShims(toolsDir: string, agents: Readonly<Record<string, Harness>>): AgentShim[];
|
|
20
|
+
export declare function agentShims(toolsDir: string, agents: Readonly<Record<string, Harness>>, flags?: Readonly<Record<string, readonly string[]>>): AgentShim[];
|
|
19
21
|
/**
|
|
20
22
|
* The text of `<command>.cmd`: runs the installed agent, or installs it first (`install` = node + installer script).
|
|
21
|
-
* The agent's own arguments pass through %* untouched.
|
|
23
|
+
* The agent's own arguments pass through %* untouched, after the shim's flags if it has any.
|
|
22
24
|
*/
|
|
23
25
|
export declare function shimText(shim: AgentShim, install: {
|
|
24
26
|
node: string;
|
|
@@ -48,13 +50,31 @@ export declare function bootResetPaths(agents: Readonly<Record<string, Harness>>
|
|
|
48
50
|
agent: string;
|
|
49
51
|
path: string;
|
|
50
52
|
}[];
|
|
53
|
+
type CodexSettings = Config['codex'];
|
|
51
54
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
+
* The flags every Codex start gets. Flags beat config.toml and a resumed thread's saved permissions, which is why the
|
|
56
|
+
* sandbox does not rely on the file. Full access with no questions is the one flag that skips Codex's Windows sandbox
|
|
57
|
+
* setup for certain. Pure.
|
|
58
|
+
*/
|
|
59
|
+
export declare function codexArguments(c: CodexSettings): string[];
|
|
60
|
+
/** The arguments an agent always starts with: its own, and for codex the sandbox's settings. */
|
|
61
|
+
export declare function agentArguments(name: string, harness: Harness, codex: CodexSettings | undefined): string[];
|
|
62
|
+
/** The largest config.toml the sandbox edits. */
|
|
63
|
+
export declare const MAX_CODEX_CONFIG_BYTES: number;
|
|
64
|
+
/**
|
|
65
|
+
* Codex's config.toml as the sandbox wants it, every other line byte for byte: the lines an older version wrote above
|
|
66
|
+
* the first table (sandbox_mode, approval_policy, under the marker comment) are gone, `[windows] sandbox` follows
|
|
67
|
+
* windowsSandbox ("off" removes the line, so Codex does not set up its own sandbox users), and
|
|
68
|
+
* mcp_oauth_credentials_store = "file" is added when it is not set. Running it again changes nothing. Pure.
|
|
69
|
+
*/
|
|
70
|
+
export declare function codexConfigOwned(toml: string, c: CodexSettings): string;
|
|
71
|
+
/**
|
|
72
|
+
* Codex's config.toml with its own command sandbox off, or null when that changes nothing. Kept for callers that
|
|
73
|
+
* predate the codex settings; use codexConfigOwned.
|
|
55
74
|
*/
|
|
56
75
|
export declare function codexConfigWithoutSandbox(toml: string): string | null;
|
|
57
76
|
/** A SQLite database file or one of its -wal / -shm siblings. */
|
|
58
77
|
export declare const isDatabaseFile: (name: string) => boolean;
|
|
59
78
|
/** Files that make a consistent copy: the databases and their -wal (the -shm is rebuilt by SQLite). */
|
|
60
79
|
export declare const isCopyableDatabaseFile: (name: string) => boolean;
|
|
80
|
+
export {};
|
|
@@ -15,19 +15,19 @@ export function agentCommand(name, harness) {
|
|
|
15
15
|
return harness.npmBin ?? harness.uvBin ?? (harness.hostExecutable ?? name).replace(/\.exe$/i, '');
|
|
16
16
|
}
|
|
17
17
|
/** One shim per configured agent that can be installed here (a name that is not a plain command word is skipped). */
|
|
18
|
-
export function agentShims(toolsDir, agents) {
|
|
18
|
+
export function agentShims(toolsDir, agents, flags = {}) {
|
|
19
19
|
return Object.entries(agents).flatMap(([name, harness]) => {
|
|
20
20
|
const p = agentPaths(toolsDir, name, harness);
|
|
21
21
|
const target = p.exe ?? p.cmd;
|
|
22
22
|
const command = agentCommand(name, harness);
|
|
23
23
|
return target && /^[A-Za-z0-9_-]+$/.test(command) && /^[A-Za-z0-9_-]+$/.test(name)
|
|
24
|
-
? [{ name, command, target }]
|
|
24
|
+
? [{ name, command, target, ...(flags[name]?.length ? { arguments: flags[name] } : {}) }]
|
|
25
25
|
: [];
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* The text of `<command>.cmd`: runs the installed agent, or installs it first (`install` = node + installer script).
|
|
30
|
-
* The agent's own arguments pass through %* untouched.
|
|
30
|
+
* The agent's own arguments pass through %* untouched, after the shim's flags if it has any.
|
|
31
31
|
*/
|
|
32
32
|
export function shimText(shim, install) {
|
|
33
33
|
return [
|
|
@@ -39,7 +39,7 @@ export function shimText(shim, install) {
|
|
|
39
39
|
'"' + install.node + '" "' + install.script + '" install ' + shim.name,
|
|
40
40
|
'if errorlevel 1 exit /b 1',
|
|
41
41
|
':run',
|
|
42
|
-
'endlocal & "%SBX_REAL%" %*',
|
|
42
|
+
'endlocal & "%SBX_REAL%" ' + (shim.arguments?.length ? shim.arguments.join(' ') + ' ' : '') + '%*',
|
|
43
43
|
'',
|
|
44
44
|
].join('\r\n');
|
|
45
45
|
}
|
|
@@ -61,19 +61,89 @@ export function localStateEntries(agents, stateDir, localRoot) {
|
|
|
61
61
|
export function bootResetPaths(agents, stateDir) {
|
|
62
62
|
return Object.entries(agents).flatMap(([agent, harness]) => (harness.bootReset ?? []).map((rel) => ({ agent, path: path.join(stateDir, agent, rel) })));
|
|
63
63
|
}
|
|
64
|
+
/** The marker the sandbox puts above the lines it writes into config.toml. */
|
|
65
|
+
const CODEX_MARKER = '# Set by the sandbox';
|
|
64
66
|
/**
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
67
|
+
* The flags every Codex start gets. Flags beat config.toml and a resumed thread's saved permissions, which is why the
|
|
68
|
+
* sandbox does not rely on the file. Full access with no questions is the one flag that skips Codex's Windows sandbox
|
|
69
|
+
* setup for certain. Pure.
|
|
70
|
+
*/
|
|
71
|
+
export function codexArguments(c) {
|
|
72
|
+
const out = c.sandboxMode === 'danger-full-access' && c.approvalPolicy === 'never'
|
|
73
|
+
? ['--dangerously-bypass-approvals-and-sandbox']
|
|
74
|
+
: ['--sandbox', c.sandboxMode, '--ask-for-approval', c.approvalPolicy];
|
|
75
|
+
if (c.model)
|
|
76
|
+
out.push('-c', 'model="' + c.model + '"');
|
|
77
|
+
if (c.reasoningEffort !== 'default')
|
|
78
|
+
out.push('-c', 'model_reasoning_effort="' + c.reasoningEffort + '"');
|
|
79
|
+
return out;
|
|
80
|
+
}
|
|
81
|
+
/** The arguments an agent always starts with: its own, and for codex the sandbox's settings. */
|
|
82
|
+
export function agentArguments(name, harness, codex) {
|
|
83
|
+
return name === 'codex' && codex ? [...harness.arguments, ...codexArguments(codex)] : [...harness.arguments];
|
|
84
|
+
}
|
|
85
|
+
/** The largest config.toml the sandbox edits. */
|
|
86
|
+
export const MAX_CODEX_CONFIG_BYTES = 1024 * 1024;
|
|
87
|
+
/**
|
|
88
|
+
* Codex's config.toml as the sandbox wants it, every other line byte for byte: the lines an older version wrote above
|
|
89
|
+
* the first table (sandbox_mode, approval_policy, under the marker comment) are gone, `[windows] sandbox` follows
|
|
90
|
+
* windowsSandbox ("off" removes the line, so Codex does not set up its own sandbox users), and
|
|
91
|
+
* mcp_oauth_credentials_store = "file" is added when it is not set. Running it again changes nothing. Pure.
|
|
92
|
+
*/
|
|
93
|
+
export function codexConfigOwned(toml, c) {
|
|
94
|
+
const eol = toml.includes('\r\n') ? '\r\n' : '\n';
|
|
95
|
+
const firstTable = toml.search(/^[ \t]*\[/m);
|
|
96
|
+
let top = firstTable < 0 ? toml : toml.slice(0, firstTable);
|
|
97
|
+
const tables = firstTable < 0 ? '' : toml.slice(firstTable);
|
|
98
|
+
top = top.replace(MARKED_LINES, '');
|
|
99
|
+
if (c.mcpLoginsInFile && !/^[ \t]*mcp_oauth_credentials_store[ \t]*=/m.test(top)) {
|
|
100
|
+
if (top && !top.endsWith('\n'))
|
|
101
|
+
top += eol;
|
|
102
|
+
top += 'mcp_oauth_credentials_store = "file"' + eol + (tables ? eol : '');
|
|
103
|
+
}
|
|
104
|
+
return top + codexWindowsSandbox(tables, c.windowsSandbox, eol);
|
|
105
|
+
}
|
|
106
|
+
/** The lines an older version wrote above the first table: its marker comment, then sandbox_mode / approval_policy. */
|
|
107
|
+
const MARKED_LINES = new RegExp('^' + CODEX_MARKER + '[^\r\n]*\r?\n(?:(?:sandbox_mode|approval_policy)[ \t]*=[^\r\n]*\r?\n)*(?:[ \t]*\r?\n)?', 'm');
|
|
108
|
+
/** The tables of config.toml (from the first one on) with `[windows] sandbox` set to the mode, or removed for "off". */
|
|
109
|
+
function codexWindowsSandbox(tables, mode, eol) {
|
|
110
|
+
const setting = 'sandbox = "' + mode + '"';
|
|
111
|
+
const header = /^[ \t]*\[windows\][ \t]*(#[^\r\n]*)?(\r?\n|$)/m.exec(tables);
|
|
112
|
+
if (!header) {
|
|
113
|
+
if (mode === 'off')
|
|
114
|
+
return tables;
|
|
115
|
+
const gap = tables && !tables.endsWith('\n') ? eol : '';
|
|
116
|
+
return tables + gap + (tables ? eol : '') + '[windows]' + eol + setting + eol;
|
|
117
|
+
}
|
|
118
|
+
const bodyStart = header.index + header[0].length;
|
|
119
|
+
const next = tables.slice(bodyStart).search(/^[ \t]*\[/m);
|
|
120
|
+
const bodyEnd = next < 0 ? tables.length : bodyStart + next;
|
|
121
|
+
const body = tables.slice(bodyStart, bodyEnd);
|
|
122
|
+
const line = /^[ \t]*sandbox[ \t]*=[^\r\n]*(\r?\n|$)/m.exec(body);
|
|
123
|
+
let updated;
|
|
124
|
+
if (!line)
|
|
125
|
+
updated = mode === 'off' ? body : setting + eol + body;
|
|
126
|
+
else if (mode === 'off')
|
|
127
|
+
updated = body.slice(0, line.index) + body.slice(line.index + line[0].length);
|
|
128
|
+
else
|
|
129
|
+
updated = body.slice(0, line.index) + setting + line[1] + body.slice(line.index + line[0].length);
|
|
130
|
+
const head = tables.slice(0, bodyStart);
|
|
131
|
+
return (head.endsWith('\n') || !updated ? head : head + eol) + updated + tables.slice(bodyEnd);
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Codex's config.toml with its own command sandbox off, or null when that changes nothing. Kept for callers that
|
|
135
|
+
* predate the codex settings; use codexConfigOwned.
|
|
68
136
|
*/
|
|
69
137
|
export function codexConfigWithoutSandbox(toml) {
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
138
|
+
const out = codexConfigOwned(toml, {
|
|
139
|
+
sandboxMode: 'danger-full-access',
|
|
140
|
+
approvalPolicy: 'never',
|
|
141
|
+
model: '',
|
|
142
|
+
reasoningEffort: 'default',
|
|
143
|
+
windowsSandbox: 'off',
|
|
144
|
+
mcpLoginsInFile: true,
|
|
145
|
+
});
|
|
146
|
+
return out === toml ? null : out;
|
|
77
147
|
}
|
|
78
148
|
/** A SQLite database file or one of its -wal / -shm siblings. */
|
|
79
149
|
export const isDatabaseFile = (name) => /\.(sqlite3?|db)(-wal|-shm)?$/i.test(name);
|
|
@@ -6,7 +6,7 @@ import { SYSTEM } from '../../shared/system.js';
|
|
|
6
6
|
import { setupUv, uvVars } from '../toolchains/runtimes.js';
|
|
7
7
|
import { emptyEnv } from '../toolchains/tool-env.js';
|
|
8
8
|
import { dryRun, hostToolsDir, isWin, toolsDir } from '../runtime/paths.js';
|
|
9
|
-
import { execAsync } from '../runtime/
|
|
9
|
+
import { execHeavy as execAsync } from '../runtime/pools.js';
|
|
10
10
|
import { exists, mkdirp } from '../runtime/fs.js';
|
|
11
11
|
import { log, warn } from '../runtime/log.js';
|
|
12
12
|
import { session } from '../runtime/session.js';
|
|
@@ -5,8 +5,11 @@ export declare function agentLocalStates(): LocalState[];
|
|
|
5
5
|
export declare function localStateVars(): Record<string, string>;
|
|
6
6
|
/** Boot: what an agent sealed to the last sandbox (bootReset) is deleted, so it sets it up again. Links are left. */
|
|
7
7
|
export declare function resetMachineBound(): void;
|
|
8
|
-
/**
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Boot: Codex's config.toml follows the codex settings (codexConfigOwned): no Windows sandbox setup of its own, its MCP
|
|
10
|
+
* logins in a file. The sandbox mode itself travels as launch flags (codexArguments), which beat this file.
|
|
11
|
+
*/
|
|
12
|
+
export declare function codexBootConfig(): void;
|
|
10
13
|
/** Boot: the saved databases of every configured agent are copied to the sandbox's disk, where the agent runs them. */
|
|
11
14
|
export declare function restoreLocalState(): void;
|
|
12
15
|
/**
|
|
@@ -10,7 +10,7 @@ import { execOutput } from '../runtime/process.js';
|
|
|
10
10
|
import { log, warn } from '../runtime/log.js';
|
|
11
11
|
import { session, stateDir } from '../runtime/session.js';
|
|
12
12
|
import { errMsg } from '../../core/util/errors.js';
|
|
13
|
-
import { bootResetPaths,
|
|
13
|
+
import { bootResetPaths, codexConfigOwned, MAX_CODEX_CONFIG_BYTES, isCopyableDatabaseFile, isDatabaseFile, localStateEntries, } from './agent-files.js';
|
|
14
14
|
const SQLITE_HEADER = 'SQLite format 3\0';
|
|
15
15
|
/** The sandbox-disk folder that holds the working copies. */
|
|
16
16
|
const localRoot = () => path.join(localDir, 'agent-state');
|
|
@@ -102,17 +102,31 @@ export function resetMachineBound() {
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
/**
|
|
106
|
-
|
|
107
|
-
|
|
105
|
+
/**
|
|
106
|
+
* Boot: Codex's config.toml follows the codex settings (codexConfigOwned): no Windows sandbox setup of its own, its MCP
|
|
107
|
+
* logins in a file. The sandbox mode itself travels as launch flags (codexArguments), which beat this file.
|
|
108
|
+
*/
|
|
109
|
+
export function codexBootConfig() {
|
|
110
|
+
if (dryRun || !session.agents?.codex || !session.codex)
|
|
108
111
|
return;
|
|
109
112
|
const file = path.join(stateDir, 'codex', 'config.toml');
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
try {
|
|
114
|
+
const size = exists(file) ? fs.statSync(file).size : 0;
|
|
115
|
+
if (size > MAX_CODEX_CONFIG_BYTES) {
|
|
116
|
+
warn('codex: config.toml is over 1 MB; left as it is.');
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
const before = size ? fs.readFileSync(file, 'utf8') : '';
|
|
120
|
+
const after = codexConfigOwned(before, session.codex);
|
|
121
|
+
if (after === before)
|
|
122
|
+
return;
|
|
123
|
+
mkdirp(path.dirname(file));
|
|
124
|
+
fs.writeFileSync(file, after, 'utf8');
|
|
125
|
+
log('codex: config.toml updated (Windows sandbox "' + session.codex.windowsSandbox + '").');
|
|
126
|
+
}
|
|
127
|
+
catch (e) {
|
|
128
|
+
warn('codex: could not update config.toml (' + errMsg(e) + ').');
|
|
129
|
+
}
|
|
116
130
|
}
|
|
117
131
|
/** Boot: the saved databases of every configured agent are copied to the sandbox's disk, where the agent runs them. */
|
|
118
132
|
export function restoreLocalState() {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { Harness } from '../../core/types.js';
|
|
2
|
+
/** The boot's linkProfileDirs without blocking the event loop. */
|
|
3
|
+
export declare function linkProfileDirsAsync(agents: Readonly<Record<string, readonly string[] | undefined>>): Promise<void>;
|
|
2
4
|
/** Makes the profile folders of these agents junctions into state\<agent>\profile; one failure never stops the boot. */
|
|
3
5
|
export declare function linkProfileDirs(agents: Readonly<Record<string, readonly string[] | undefined>>): void;
|
|
4
6
|
/** The same for one agent, when it is installed (the daemon starts agents the boot did not know). */
|
|
@@ -1,16 +1,30 @@
|
|
|
1
1
|
import { profileLinkPairs } from '../../shared/paths/index.js';
|
|
2
2
|
import { dryRun, isWin, testMode } from '../runtime/paths.js';
|
|
3
|
-
import { runScriptWithJson } from '../runtime/process.js';
|
|
3
|
+
import { runScriptWithJson, runScriptWithJsonAsync } from '../runtime/process.js';
|
|
4
4
|
import { stateDir } from '../runtime/session.js';
|
|
5
5
|
import { log, warn } from '../runtime/log.js';
|
|
6
6
|
import { errMsg } from '../../core/util/errors.js';
|
|
7
7
|
/** The sandbox's own user profile folder (not a setting: the guest's account). */
|
|
8
8
|
const profileRoot = () => process.env.USERPROFILE ?? '';
|
|
9
|
+
const linkPairs = (agents) => !isWin || dryRun || testMode || !profileRoot()
|
|
10
|
+
? []
|
|
11
|
+
: Object.entries(agents).flatMap(([agent, dirs]) => dirs?.length ? profileLinkPairs(agent, dirs, profileRoot(), stateDir) : []);
|
|
12
|
+
/** The boot's linkProfileDirs without blocking the event loop. */
|
|
13
|
+
export async function linkProfileDirsAsync(agents) {
|
|
14
|
+
const pairs = linkPairs(agents);
|
|
15
|
+
if (!pairs.length)
|
|
16
|
+
return;
|
|
17
|
+
try {
|
|
18
|
+
await runScriptWithJsonAsync('link-profile-dirs.ps1', 'PairsFile', pairs);
|
|
19
|
+
log('Agent logins kept: ' + pairs.length + ' profile folder(s) linked into persistent storage.');
|
|
20
|
+
}
|
|
21
|
+
catch (e) {
|
|
22
|
+
warn('Could not link the agent profile folders (their logins will not be kept): ' + errMsg(e));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
9
25
|
/** Makes the profile folders of these agents junctions into state\<agent>\profile; one failure never stops the boot. */
|
|
10
26
|
export function linkProfileDirs(agents) {
|
|
11
|
-
|
|
12
|
-
return;
|
|
13
|
-
const pairs = Object.entries(agents).flatMap(([agent, dirs]) => dirs?.length ? profileLinkPairs(agent, dirs, profileRoot(), stateDir) : []);
|
|
27
|
+
const pairs = linkPairs(agents);
|
|
14
28
|
if (!pairs.length)
|
|
15
29
|
return;
|
|
16
30
|
try {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { SYSTEM } from '../../shared/system.js';
|
|
4
|
+
import { errMsg } from '../../core/util/errors.js';
|
|
5
|
+
import { takePendingComet } from '../accounts/kinds/comet.js';
|
|
6
|
+
import { restoreCometSignIn } from '../browser/comet.js';
|
|
7
|
+
import { log, warn } from '../runtime/log.js';
|
|
4
8
|
import { execAsync } from '../runtime/process.js';
|
|
5
9
|
import { exists, mkdirp } from '../runtime/fs.js';
|
|
6
10
|
import { arch, tool } from '../toolchains/tool-env.js';
|
|
@@ -24,6 +28,19 @@ const SYSINTERNALS_TOOLS = [
|
|
|
24
28
|
'Du',
|
|
25
29
|
'ZoomIt',
|
|
26
30
|
];
|
|
31
|
+
/** Your saved Comet sign-in (handed over at boot) goes into Comet's profile now that Comet is there. */
|
|
32
|
+
async function restoreComet(exe) {
|
|
33
|
+
const pending = takePendingComet();
|
|
34
|
+
if (!pending)
|
|
35
|
+
return;
|
|
36
|
+
try {
|
|
37
|
+
const written = await restoreCometSignIn(exe, pending);
|
|
38
|
+
log('Comet: your saved sign-in is in its profile (' + written + ' cookies).');
|
|
39
|
+
}
|
|
40
|
+
catch (e) {
|
|
41
|
+
warn('Comet: your saved sign-in could not be put into its profile (' + errMsg(e) + '); sign in again in Comet.');
|
|
42
|
+
}
|
|
43
|
+
}
|
|
27
44
|
/** Settings an app needs on every boot (the sandbox's registry is new each time), and files next to its program. */
|
|
28
45
|
export async function afterInstall(entry, exe) {
|
|
29
46
|
const dir = path.dirname(exe);
|
|
@@ -39,6 +56,8 @@ export async function afterInstall(entry, exe) {
|
|
|
39
56
|
fs.writeFileSync(path.join(dir, '._sc_'), '');
|
|
40
57
|
if (entry.id === 'sublime')
|
|
41
58
|
mkdirp(path.join(dir, 'Data'));
|
|
59
|
+
if (entry.id === 'comet')
|
|
60
|
+
await restoreComet(exe);
|
|
42
61
|
if (entry.id === 'sysinternals') {
|
|
43
62
|
for (const name of SYSINTERNALS_TOOLS) {
|
|
44
63
|
await execAsync(SYSTEM.reg(), ['add', 'HKCU\\Software\\Sysinternals\\' + name, '/v', 'EulaAccepted', '/t', 'REG_DWORD', '/d', '1', '/f'], { stdio: 'ignore' }).catch(() => undefined);
|
|
@@ -4,6 +4,8 @@ import { type ToolEnv } from '../toolchains/tool-env.js';
|
|
|
4
4
|
export interface AppsOptions {
|
|
5
5
|
gitAccess: GitAccess;
|
|
6
6
|
refresh: boolean;
|
|
7
|
+
/** Every app chosen (apps.install): one app's start-up can depend on another (Comet's port for comet-mcp). */
|
|
8
|
+
chosen?: readonly string[];
|
|
7
9
|
}
|
|
8
10
|
export declare class AppInstaller {
|
|
9
11
|
private readonly env;
|
|
@@ -12,11 +14,20 @@ export declare class AppInstaller {
|
|
|
12
14
|
private readonly gui;
|
|
13
15
|
private readonly installed;
|
|
14
16
|
constructor(env: ToolEnv, options: AppsOptions, parallel?: number);
|
|
17
|
+
/**
|
|
18
|
+
* Downloads the plain downloads (not pinned, not npm, not remote) of the apps that are not installed yet, into
|
|
19
|
+
* `<app folder>.download`, which `download()` uses instead of downloading again. A failure is left for the install.
|
|
20
|
+
*/
|
|
21
|
+
prefetch(entries: readonly AppEntry[]): Promise<void>;
|
|
15
22
|
/** Installs the entries (7-Zip first: the NSIS apps need it to unpack), then their shortcuts. */
|
|
16
23
|
installAll(entries: readonly AppEntry[]): Promise<void>;
|
|
17
24
|
private installOne;
|
|
25
|
+
/** The command line an app's shortcut starts it with (Comet: its own profile, DevTools on 127.0.0.1). */
|
|
26
|
+
private launchArgs;
|
|
18
27
|
/** Downloads and unpacks one entry into its folder (replaced in one step: never half there). */
|
|
19
28
|
private download;
|
|
20
29
|
}
|
|
21
30
|
/** Installs apps.install and apps.custom (skipped ones are listed in the summary). */
|
|
22
31
|
export declare function setupApps(env: ToolEnv, apps: Config['apps'], o: AppsOptions): Promise<void>;
|
|
32
|
+
/** Downloads the apps ahead of their install (the Apps step waits for Mesa, uv and the runtime first). */
|
|
33
|
+
export declare function prefetchApps(apps: Config['apps'], o: AppsOptions): Promise<void>;
|