windows-development-sandbox 1.20.0 → 1.23.1
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/config.example.json +8 -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 +29 -1
- package/dist/app/features/accounts/accounts.def.js +10 -4
- package/dist/app/features/accounts/accounts.run.d.ts +1 -0
- package/dist/app/features/accounts/accounts.run.js +7 -2
- package/dist/app/features/accounts/services.def.d.ts +4 -1
- package/dist/app/features/accounts/services.def.js +15 -14
- package/dist/app/features/accounts/services.run.d.ts +1 -0
- package/dist/app/features/accounts/services.run.js +41 -15
- package/dist/app/features/defs.d.ts +39 -2
- 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 +2 -0
- package/dist/app/features/settings/settings-rows.js +1 -1
- package/dist/app/features/settings/settings.def.js +1 -1
- package/dist/app/features/settings/settings.run.js +3 -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 +1 -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 +5 -0
- package/dist/app/kernel/view.d.ts +11 -1
- package/dist/bin/agent-sandbox.js +2 -2
- package/dist/bin/{chunk-DK4NTBUF.js → chunk-7YPEDAJD.js} +172 -48
- package/dist/bin/{chunk-2IMT7ZCT.js → chunk-QFSJX2KW.js} +1 -1
- package/dist/bin/{chunk-Z2P5OGKL.js → chunk-USTRSHIE.js} +2436 -1693
- 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/manifest.d.ts +2 -2
- package/dist/cli/manifest.js +2 -1
- 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/pages/accounts-page.js +1 -1
- package/dist/cli/menu/pages/agents-page.js +8 -2
- package/dist/cli/menu/pages/maintenance-page.d.ts +6 -0
- package/dist/cli/menu/pages/maintenance-page.js +9 -2
- 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 +12 -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/report.js +2 -0
- package/dist/cli/tui/app.d.ts +5 -0
- package/dist/cli/tui/app.js +2 -0
- package/dist/core/config/defaults.js +3 -1
- package/dist/core/schema/accounts.d.ts +6 -0
- package/dist/core/schema/accounts.js +13 -11
- package/dist/core/schema/config.d.ts +20 -8
- package/dist/core/schema/config.js +4 -4
- package/dist/core/schema/github.js +1 -1
- 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/vpn.js +1 -1
- package/dist/core/schema/web.js +3 -3
- package/dist/core/types.d.ts +6 -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 +6 -2
- 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-installer.js +1 -1
- 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 +316 -145
- 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/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/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/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 +16 -6
- package/dist/guest/toolchains/native/vcruntime.d.ts +2 -0
- package/dist/guest/toolchains/native/vcruntime.js +10 -2
- package/dist/guest/toolchains/native/visual-studio.d.ts +3 -0
- package/dist/guest/toolchains/native/visual-studio.js +44 -26
- package/dist/guest/toolchains/native/vs-request.d.ts +2 -0
- package/dist/guest/toolchains/native/vs-request.js +2 -0
- package/dist/guest/toolchains/plan.js +19 -8
- 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/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/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 +7 -1
- package/dist/host/accounts/leases.js +13 -2
- package/dist/host/accounts/source.d.ts +7 -1
- package/dist/host/accounts/source.js +27 -0
- package/dist/host/accounts/sources.js +4 -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 +4 -0
- package/dist/host/launch/toolchains.d.ts +2 -1
- package/dist/host/launch/toolchains.js +5 -3
- package/dist/host/profile/claude-login.d.ts +2 -2
- package/dist/host/profile/claude-login.js +4 -3
- package/dist/host/vpn/nordvpn.d.ts +2 -4
- package/dist/host/vpn/nordvpn.js +2 -24
- package/dist/runtime/agent.js +405 -90
- package/dist/runtime/daemon.js +3010 -1383
- package/dist/runtime/db.js +333 -90
- package/dist/runtime/main.js +4720 -1954
- package/dist/runtime/netproxy.js +286 -69
- package/dist/runtime/tool.js +2852 -1780
- package/dist/runtime/view.js +286 -69
- package/dist/selftest/accounts.test.js +1 -1
- package/dist/selftest/agent-paths.test.js +39 -1
- package/dist/selftest/agent-settings.test.js +6 -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 +5 -2
- 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/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 +8 -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/persisted-installs.test.js +6 -3
- package/dist/selftest/service-accounts.test.js +3 -2
- package/dist/selftest/support/engine-golden.js +27 -0
- package/dist/selftest/support/fixtures.d.ts +6 -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/shared/accounts/anthropic.d.ts +1 -1
- package/dist/shared/accounts/anthropic.js +9 -8
- package/dist/shared/accounts/index.d.ts +2 -0
- package/dist/shared/accounts/index.js +2 -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 +21 -3
- package/dist/shared/channel/schema.js +7 -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/readiness.d.ts +2 -2
- package/dist/shared/readiness.js +2 -2
- package/dist/web/index.html +1 -1
- package/dist/web/{main-OUUQYNK4.js → main-CCILLX2M.js} +67 -67
- package/native/csharp/HcsHost/AssemblyInfo.cs +3 -3
- package/native/csharp/HostTools/AssemblyInfo.cs +3 -3
- package/native/csharp/StorageHelper/AssemblyInfo.cs +3 -3
- 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/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 +56 -27
- package/schemas/sandbox-config.schema.json +37 -14
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
#Requires -Version 5.1
|
|
2
2
|
# Opens an inbound TCP/UDP port in the sandbox's own firewall (sbx-fivem serve: 30120 and txAdmin's 40120), so the PC
|
|
3
|
-
# can reach a server running in the sandbox.
|
|
4
|
-
#
|
|
3
|
+
# can reach a server running in the sandbox. Only from the sandbox's own subnet (the PC's Hyper-V network), never from
|
|
4
|
+
# anywhere else. Running it again replaces the rule. Uses netsh: the NetSecurity cmdlets fail in Windows Sandbox
|
|
5
|
+
# ("Invalid class"), like guest/network/firewall.ts.
|
|
6
|
+
# Exit code: 0 = done, 1 = the rule could not be added.
|
|
5
7
|
param(
|
|
6
8
|
[Parameter(Mandatory = $true)][ValidateRange(1, 65535)][int]$Port,
|
|
7
9
|
[ValidateSet('TCP', 'UDP', 'Both')][string]$Protocol = 'Both',
|
|
@@ -9,5 +11,17 @@ param(
|
|
|
9
11
|
)
|
|
10
12
|
$ErrorActionPreference = 'Stop'
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
$netsh = Join-Path $env:SystemRoot 'System32\netsh.exe'
|
|
15
|
+
$protocols = if ($Protocol -eq 'Both') { @('TCP', 'UDP') } else { @($Protocol) }
|
|
16
|
+
foreach ($p in $protocols) {
|
|
17
|
+
$rule = 'AgentSandbox ' + $Name + ' (' + $p + ' ' + $Port + ')'
|
|
18
|
+
& $netsh advfirewall firewall delete rule ('name=' + $rule) | Out-Null
|
|
19
|
+
$out = & $netsh advfirewall firewall add rule ('name=' + $rule) dir=in action=allow enable=yes profile=any `
|
|
20
|
+
('protocol=' + $p) ('localport=' + $Port) remoteip=LocalSubnet
|
|
21
|
+
if ($LASTEXITCODE -ne 0) {
|
|
22
|
+
Write-Error ('Could not open ' + $p + ' ' + $Port + ': ' + ($out -join ' ')) -ErrorAction Continue
|
|
23
|
+
exit 1
|
|
24
|
+
}
|
|
25
|
+
Write-Output ('Opened ' + $p + ' ' + $Port + ' for ' + $Name + ' (from the PC only)')
|
|
26
|
+
}
|
|
27
|
+
exit 0
|
|
@@ -34,24 +34,39 @@ foreach ($folder in @($settings.create)) {
|
|
|
34
34
|
if ($folder) { New-Item -ItemType Directory -Force -Path $folder | Out-Null }
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
# The boot, its background re-persist and the daemon can all run this script: the read-modify-write of the machine
|
|
38
|
+
# Environment key happens under one named mutex (an abandoned mutex, from a killed script, is ours to take).
|
|
39
|
+
$mutex = New-Object System.Threading.Mutex($false, 'Global\AgentSandboxMachineEnv')
|
|
40
|
+
$owned = $false
|
|
41
|
+
try {
|
|
42
|
+
try {
|
|
43
|
+
$owned = $mutex.WaitOne(60000)
|
|
44
|
+
} catch [System.Threading.AbandonedMutexException] {
|
|
45
|
+
$owned = $true
|
|
46
|
+
}
|
|
47
|
+
if (-not $owned) { throw 'Another script has held the machine environment lock for over 60 seconds' }
|
|
48
|
+
foreach ($variable in $settings.vars.PSObject.Properties) {
|
|
49
|
+
if ($additive -and [Environment]::GetEnvironmentVariable($variable.Name, 'Machine')) { continue }
|
|
50
|
+
[Environment]::SetEnvironmentVariable($variable.Name, [string]$variable.Value, 'Machine')
|
|
51
|
+
}
|
|
41
52
|
|
|
42
|
-
if ($null -ne $settings.path) {
|
|
43
|
-
|
|
44
|
-
}
|
|
53
|
+
if ($null -ne $settings.path) {
|
|
54
|
+
[Environment]::SetEnvironmentVariable('Path', (Join-Folders ([string]$settings.path -split ';')), 'Machine')
|
|
55
|
+
}
|
|
45
56
|
|
|
46
|
-
if ($settings.add) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
57
|
+
if ($settings.add) {
|
|
58
|
+
$current = [Environment]::GetEnvironmentVariable('Path', 'Machine') -split ';'
|
|
59
|
+
$known = @{}
|
|
60
|
+
foreach ($folder in $current) { $known[(Get-Key $folder)] = $true }
|
|
61
|
+
$missing = @($settings.add | Where-Object { -not $known.ContainsKey((Get-Key $_)) })
|
|
62
|
+
if ($missing.Count) {
|
|
63
|
+
$combined = if ($additive) { $current + $missing } else { $missing + $current }
|
|
64
|
+
[Environment]::SetEnvironmentVariable('Path', (Join-Folders $combined), 'Machine')
|
|
65
|
+
}
|
|
54
66
|
}
|
|
67
|
+
} finally {
|
|
68
|
+
if ($owned) { $mutex.ReleaseMutex() }
|
|
69
|
+
$mutex.Dispose()
|
|
55
70
|
}
|
|
56
71
|
|
|
57
72
|
try {
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
Templates for
|
|
2
|
-
|
|
1
|
+
Templates for sbx-fivem (docs/fivem.md):
|
|
2
|
+
- server.cfg: what `sbx-fivem init` writes into a new server folder. It holds no key: sbx-fivem serve reads the
|
|
3
|
+
Cfx.re key from a cfg on the sandbox's own disk (+exec) before this one.
|
|
4
|
+
- lua, js, ts, cs: one folder per language for `sbx-fivem new <resource> --lua | --js | --ts | --cs`.
|
|
5
|
+
Placeholders: {{name}} (the resource), {{namespace}} (its name as a C# namespace), {{game}} (gta5 or rdr3) and
|
|
6
|
+
{{gameLines}} (the manifest's game lines).
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
|
2
|
+
<!-- FiveM loads client C# from *.net.dll built for .NET Framework 4.5.2 (Mono in the game). -->
|
|
3
|
+
<PropertyGroup>
|
|
4
|
+
<TargetFramework>net452</TargetFramework>
|
|
5
|
+
<AssemblyName>{{name}}.Client</AssemblyName>
|
|
6
|
+
<RootNamespace>{{namespace}}.Client</RootNamespace>
|
|
7
|
+
<TargetName>$(AssemblyName).net</TargetName>
|
|
8
|
+
<DebugType>embedded</DebugType>
|
|
9
|
+
<LangVersion>latest</LangVersion>
|
|
10
|
+
</PropertyGroup>
|
|
11
|
+
<ItemGroup>
|
|
12
|
+
<PackageReference Include="CitizenFX.Core.Client" Version="1.0.*" ExcludeAssets="runtime" />
|
|
13
|
+
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
|
|
14
|
+
</ItemGroup>
|
|
15
|
+
</Project>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using CitizenFX.Core;
|
|
4
|
+
using static CitizenFX.Core.Native.API;
|
|
5
|
+
|
|
6
|
+
namespace {{namespace}}.Client
|
|
7
|
+
{
|
|
8
|
+
/// <summary>{{name}}, client side: the /{{name}} command asks the server to say hello.</summary>
|
|
9
|
+
public class ClientMain : BaseScript
|
|
10
|
+
{
|
|
11
|
+
public ClientMain()
|
|
12
|
+
{
|
|
13
|
+
RegisterCommand("{{name}}", new Action<int, List<object>, string>((source, args, raw) =>
|
|
14
|
+
{
|
|
15
|
+
TriggerServerEvent("{{name}}:hello");
|
|
16
|
+
}), false);
|
|
17
|
+
EventHandlers["{{name}}:reply"] += new Action<string>(message => Debug.WriteLine(message));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
|
2
|
+
<!-- FXServer loads server C# from *.net.dll built for .NET Standard 2.0. -->
|
|
3
|
+
<PropertyGroup>
|
|
4
|
+
<TargetFramework>netstandard2.0</TargetFramework>
|
|
5
|
+
<AssemblyName>{{name}}.Server</AssemblyName>
|
|
6
|
+
<RootNamespace>{{namespace}}.Server</RootNamespace>
|
|
7
|
+
<TargetName>$(AssemblyName).net</TargetName>
|
|
8
|
+
<DebugType>embedded</DebugType>
|
|
9
|
+
<LangVersion>latest</LangVersion>
|
|
10
|
+
</PropertyGroup>
|
|
11
|
+
<ItemGroup>
|
|
12
|
+
<PackageReference Include="CitizenFX.Core.Server" Version="1.0.*" ExcludeAssets="runtime" />
|
|
13
|
+
</ItemGroup>
|
|
14
|
+
</Project>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using CitizenFX.Core;
|
|
3
|
+
|
|
4
|
+
namespace {{namespace}}.Server
|
|
5
|
+
{
|
|
6
|
+
/// <summary>{{name}}, server side: answers the client's hello.</summary>
|
|
7
|
+
public class ServerMain : BaseScript
|
|
8
|
+
{
|
|
9
|
+
public ServerMain()
|
|
10
|
+
{
|
|
11
|
+
EventHandlers["{{name}}:hello"] += new Action<Player>(OnHello);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
private void OnHello([FromSource] Player player)
|
|
15
|
+
{
|
|
16
|
+
Debug.WriteLine(player.Name + " said hello");
|
|
17
|
+
player.TriggerEvent("{{name}}:reply", "Hello from the server");
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
fx_version 'cerulean'
|
|
2
|
+
{{gameLines}}
|
|
3
|
+
|
|
4
|
+
name '{{name}}'
|
|
5
|
+
description 'Made with sbx-fivem new (C#: dotnet publish -c Release in Client and Server)'
|
|
6
|
+
version '0.1.0'
|
|
7
|
+
|
|
8
|
+
file 'Client/bin/Release/**/publish/*.dll'
|
|
9
|
+
|
|
10
|
+
client_script 'Client/bin/Release/**/publish/*.net.dll'
|
|
11
|
+
server_script 'Server/bin/Release/**/publish/*.net.dll'
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# A FiveM / RedM development server, made by `sbx-fivem init`. Start it with `sbx-fivem serve`.
|
|
2
|
+
#
|
|
3
|
+
# No keys in this file: sbx-fivem serve runs FXServer with `+exec <a cfg on the sandbox's own disk>` first, which
|
|
4
|
+
# sets sv_licenseKey (and steam_webApiKey) from your saved Cfx.re key (sandbox account login cfx). Keep it that way:
|
|
5
|
+
# this file is part of your project.
|
|
6
|
+
|
|
7
|
+
endpoint_add_tcp "0.0.0.0:30120"
|
|
8
|
+
endpoint_add_udp "0.0.0.0:30120"
|
|
9
|
+
|
|
10
|
+
sv_hostname "{{name}} (development)"
|
|
11
|
+
sets sv_projectName "{{name}}"
|
|
12
|
+
sets sv_projectDesc "A development server in a Windows Sandbox"
|
|
13
|
+
sv_maxclients 8
|
|
14
|
+
sv_scriptHookAllowed 0
|
|
15
|
+
|
|
16
|
+
# Keep it off the public server list (you connect by address).
|
|
17
|
+
sv_master1 ""
|
|
18
|
+
|
|
19
|
+
# The standard resources (chat, spawnmanager, sessionmanager ...) come from cfx-server-data:
|
|
20
|
+
# git clone https://github.com/citizenfx/cfx-server-data
|
|
21
|
+
# then copy its resources folder to resources\[cfx-default] and remove the # below.
|
|
22
|
+
# ensure mapmanager
|
|
23
|
+
# ensure chat
|
|
24
|
+
# ensure spawnmanager
|
|
25
|
+
# ensure sessionmanager
|
|
26
|
+
# ensure basic-gamemode
|
|
27
|
+
# ensure hardcap
|
|
28
|
+
|
|
29
|
+
# oxmysql: sbx-fivem serve sets mysql_connection_string to the sandbox's MariaDB (databases.mysql) when it runs;
|
|
30
|
+
# a set mysql_connection_string line here wins over it.
|
|
31
|
+
# ensure oxmysql
|
|
32
|
+
|
|
33
|
+
# Admins: add your identifier (the console shows it when you join) to use admin commands.
|
|
34
|
+
# add_principal identifier.fivem:1234567 group.admin
|
|
35
|
+
add_ace group.admin command allow
|
|
36
|
+
|
|
37
|
+
# Your resources: sbx-fivem new <name> adds its ensure line below.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Bundles src/client and src/server into dist/client.js and dist/server.js, the files fxmanifest.lua loads.
|
|
2
|
+
// `node build.js --watch` rebuilds on every change (then `restart {{name}}` in the server console).
|
|
3
|
+
const esbuild = require('esbuild');
|
|
4
|
+
|
|
5
|
+
const watch = process.argv.includes('--watch');
|
|
6
|
+
const builds = [
|
|
7
|
+
{ entryPoints: ['src/client/client.ts'], outfile: 'dist/client.js', platform: 'browser', target: 'es2020' },
|
|
8
|
+
{ entryPoints: ['src/server/server.ts'], outfile: 'dist/server.js', platform: 'node', target: 'node16' },
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
(async () => {
|
|
12
|
+
for (const b of builds) {
|
|
13
|
+
const options = { ...b, bundle: true, format: 'iife', logLevel: 'info' };
|
|
14
|
+
if (watch) await (await esbuild.context(options)).watch();
|
|
15
|
+
else await esbuild.build(options);
|
|
16
|
+
}
|
|
17
|
+
})().catch(() => process.exit(1));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{name}}",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "node build.js",
|
|
7
|
+
"watch": "node build.js --watch",
|
|
8
|
+
"check": "tsc -p src/client --noEmit && tsc -p src/server --noEmit"
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@citizenfx/client": "2.0.38182-1",
|
|
12
|
+
"@citizenfx/server": "2.0.38182-1",
|
|
13
|
+
"esbuild": "^0.28.0",
|
|
14
|
+
"typescript": "~5.9.0"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "Bundler",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"noEmit": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"lib": ["ES2020"],
|
|
10
|
+
"types": ["@citizenfx/client"]
|
|
11
|
+
},
|
|
12
|
+
"include": ["./**/*.ts"]
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "Bundler",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"noEmit": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"lib": ["ES2020"],
|
|
10
|
+
"types": ["@citizenfx/server"]
|
|
11
|
+
},
|
|
12
|
+
"include": ["./**/*.ts"]
|
|
13
|
+
}
|