windows-development-sandbox 1.27.3 → 1.29.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 +5 -4
- package/dist/app/features/sandbox/sandbox.run.js +1 -1
- package/dist/bin/{chunk-FA5VWLP4.js → chunk-O4EL32TM.js} +1 -1
- package/dist/bin/{chunk-RU7XRN62.js → chunk-QYRRWGFY.js} +1637 -1354
- package/dist/bin/sandbox.js +10772 -3
- package/dist/cli/commands/launch/launch.js +1 -1
- package/dist/cli/commands/launch/running.js +2 -2
- package/dist/cli/index.js +1 -1
- package/dist/cli/menu/pages/agents-page.js +1 -1
- package/dist/cli/services/sandbox-service.js +1 -1
- package/dist/core/schema/sandbox.js +2 -2
- package/dist/guest/apps/app-installer.js +1 -1
- package/dist/guest/apps/store-check.d.ts +2 -0
- package/dist/guest/apps/store-check.js +3 -1
- package/dist/guest/boot/guide-lines.d.ts +2 -0
- package/dist/guest/boot/guide-lines.js +7 -0
- package/dist/guest/boot/guide.js +2 -1
- package/dist/guest/daemon/heartbeat.js +1 -0
- package/dist/guest/governor/core.d.ts +53 -1
- package/dist/guest/governor/core.js +95 -1
- package/dist/guest/governor/decide.d.ts +4 -0
- package/dist/guest/governor/decide.js +2 -0
- package/dist/guest/governor/governor.js +23 -9
- package/dist/guest/toolchains/runtimes.js +7 -6
- package/dist/host/accounts/deliver.js +16 -2
- package/dist/host/apps/store-package.d.ts +2 -0
- package/dist/host/apps/store-package.js +16 -15
- package/dist/host/channel/attach.js +1 -1
- package/dist/host/channel/channel.js +3 -3
- package/dist/host/guard/commands.js +1 -0
- package/dist/host/health/path-copies.d.ts +1 -1
- package/dist/host/health/path-copies.js +2 -2
- package/dist/host/install/index.d.ts +1 -1
- package/dist/host/install/index.js +1 -1
- package/dist/host/install/shims.d.ts +8 -1
- package/dist/host/install/shims.js +39 -1
- package/dist/host/launch/generate.js +4 -0
- package/dist/host/launch/index.d.ts +1 -0
- package/dist/host/launch/index.js +1 -0
- package/dist/host/launch/pc-logs.d.ts +6 -0
- package/dist/host/launch/pc-logs.js +129 -0
- package/dist/host/life/crash-report.d.ts +4 -0
- package/dist/host/life/crash-report.js +30 -1
- package/dist/host/life/last-end.js +1 -0
- package/dist/host/sandbox/platform.js +1 -1
- package/dist/host/sandbox/window.js +1 -1
- package/dist/host/tools/windows-terminal.d.ts +4 -1
- package/dist/host/tools/windows-terminal.js +25 -9
- package/dist/runtime/agent.js +6 -2
- package/dist/runtime/daemon.js +111 -16
- package/dist/runtime/db.js +6 -2
- package/dist/runtime/main.js +199 -35
- package/dist/runtime/netproxy.js +6 -2
- package/dist/runtime/tool.js +6 -2
- package/dist/runtime/view.js +126 -28
- package/dist/selftest/agent-paths.test.js +3 -1
- package/dist/selftest/channel.test.js +33 -0
- package/dist/selftest/cli.test.js +5 -5
- package/dist/selftest/config.test.js +1 -1
- package/dist/selftest/credentials.test.js +1 -1
- package/dist/selftest/engine.test.js +1 -1
- package/dist/selftest/generate.test.js +66 -1
- package/dist/selftest/hcs.test.js +1 -1
- package/dist/selftest/health.test.js +21 -10
- package/dist/selftest/heavy-load.test.js +112 -4
- package/dist/selftest/host-sim.test.js +13 -14
- package/dist/selftest/install.test.js +6 -2
- package/dist/selftest/live-terminal.test.js +103 -0
- package/dist/selftest/personalization.test.js +2 -1
- package/dist/selftest/store-app.test.js +62 -4
- package/dist/selftest/support/engine-golden.js +2 -0
- package/dist/selftest/support/web-preview.js +2 -2
- package/dist/shared/accounts/kinds.d.ts +5 -0
- package/dist/shared/accounts/kinds.js +8 -0
- package/dist/shared/apps/index.d.ts +1 -1
- package/dist/shared/apps/index.js +1 -1
- package/dist/shared/apps/selection.d.ts +1 -0
- package/dist/shared/apps/selection.js +4 -3
- package/dist/shared/apps/store-package.d.ts +13 -0
- package/dist/shared/apps/store-package.js +24 -0
- package/dist/shared/channel/schema.d.ts +2 -0
- package/dist/shared/channel/schema.js +4 -0
- package/dist/shared/memory/policy.d.ts +12 -0
- package/dist/shared/memory/policy.js +4 -0
- package/dist/shared/pty/clipboard-watch.d.ts +4 -0
- package/dist/shared/pty/clipboard-watch.js +40 -0
- package/dist/shared/pty/ctrl-c.d.ts +13 -7
- package/dist/shared/pty/ctrl-c.js +35 -19
- package/dist/shared/pty/index.d.ts +1 -0
- package/dist/shared/pty/index.js +1 -0
- package/dist/shared/pty/terminal.d.ts +1 -1
- package/dist/shared/pty/terminal.js +16 -13
- package/dist/shared/web/ctrl-c.d.ts +26 -0
- package/dist/shared/web/ctrl-c.js +64 -0
- package/dist/shared/web/index.d.ts +1 -0
- package/dist/shared/web/index.js +1 -0
- package/dist/web/index.html +1 -1
- package/dist/web/{main-NKM7ECSB.js → main-7NY4X6YU.js} +67 -67
- package/native/csharp/HcsHost/AssemblyInfo.cs +3 -3
- package/native/csharp/HostTools/AssemblyInfo.cs +3 -3
- package/native/csharp/HostTools/Window.cs +1 -1
- package/native/csharp/StorageHelper/AssemblyInfo.cs +3 -3
- package/native/scripts/get-store-package.ps1 +24 -13
- package/package.json +4 -14
- package/sandbox/csharp/ClipboardWatch.cs +59 -0
- package/sandbox/csharp/MemGov.cs +752 -7
- package/sandbox/scripts/install-store-package.ps1 +11 -4
- package/sandbox/scripts/watch-clipboard.ps1 +8 -0
- package/schemas/config.schema.json +2 -2
- package/schemas/sandbox-config.schema.json +1 -1
- package/dist/bin/agent-sandbox.d.ts +0 -2
- package/dist/bin/agent-sandbox.js +0 -9
- package/dist/bin/chunk-4M5SZZ5P.js +0 -10778
- package/dist/bin/claude-host.d.ts +0 -2
- package/dist/bin/claude-host.js +0 -11
- package/dist/bin/claude-sbx.d.ts +0 -2
- package/dist/bin/claude-sbx.js +0 -9
- package/dist/bin/codex-sbx.d.ts +0 -2
- package/dist/bin/codex-sbx.js +0 -9
- package/dist/bin/gemini-sbx.d.ts +0 -2
- package/dist/bin/gemini-sbx.js +0 -9
- package/dist/bin/sbx-hide.d.ts +0 -2
- package/dist/bin/sbx-hide.js +0 -9
- package/dist/bin/sbx-show.d.ts +0 -2
- package/dist/bin/sbx-show.js +0 -9
|
@@ -8,9 +8,9 @@ using System.Runtime.InteropServices;
|
|
|
8
8
|
[assembly: AssemblyCompany("windows-development-sandbox (open source)")]
|
|
9
9
|
[assembly: AssemblyProduct("Windows Development Sandbox")]
|
|
10
10
|
[assembly: AssemblyCopyright("MIT License, windows-development-sandbox contributors")]
|
|
11
|
-
[assembly: AssemblyVersion("1.
|
|
12
|
-
[assembly: AssemblyFileVersion("1.
|
|
13
|
-
[assembly: AssemblyInformationalVersion("1.
|
|
11
|
+
[assembly: AssemblyVersion("1.29.0.0")]
|
|
12
|
+
[assembly: AssemblyFileVersion("1.29.0.0")]
|
|
13
|
+
[assembly: AssemblyInformationalVersion("1.29.0")]
|
|
14
14
|
[assembly: ComVisible(false)]
|
|
15
15
|
// computecore.dll and computestorage.dll are not KnownDLLs: load them from System32 only, never from the exe's folder.
|
|
16
16
|
[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
|
|
@@ -8,7 +8,7 @@ using System.Runtime.InteropServices;
|
|
|
8
8
|
[assembly: AssemblyCompany("windows-development-sandbox (open source)")]
|
|
9
9
|
[assembly: AssemblyProduct("Windows Development Sandbox")]
|
|
10
10
|
[assembly: AssemblyCopyright("MIT License, windows-development-sandbox contributors")]
|
|
11
|
-
[assembly: AssemblyVersion("1.
|
|
12
|
-
[assembly: AssemblyFileVersion("1.
|
|
13
|
-
[assembly: AssemblyInformationalVersion("1.
|
|
11
|
+
[assembly: AssemblyVersion("1.29.0.0")]
|
|
12
|
+
[assembly: AssemblyFileVersion("1.29.0.0")]
|
|
13
|
+
[assembly: AssemblyInformationalVersion("1.29.0")]
|
|
14
14
|
[assembly: ComVisible(false)]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// The Windows Sandbox client window: hidden for a headless sandbox (the VM keeps running), shown again by
|
|
1
|
+
// The Windows Sandbox client window: hidden for a headless sandbox (the VM keeps running), shown again by sandbox show.
|
|
2
2
|
// HostTools hide-window / show-window, or Add-Type from scripts\*-window.ps1 when HostTools cannot be built. C# 5.
|
|
3
3
|
using System;
|
|
4
4
|
using System.Collections.Generic;
|
|
@@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
|
|
|
9
9
|
[assembly: AssemblyCompany("windows-development-sandbox (open source)")]
|
|
10
10
|
[assembly: AssemblyProduct("Windows Development Sandbox")]
|
|
11
11
|
[assembly: AssemblyCopyright("MIT License, windows-development-sandbox contributors")]
|
|
12
|
-
[assembly: AssemblyVersion("1.
|
|
13
|
-
[assembly: AssemblyFileVersion("1.
|
|
14
|
-
[assembly: AssemblyInformationalVersion("1.
|
|
12
|
+
[assembly: AssemblyVersion("1.29.0.0")]
|
|
13
|
+
[assembly: AssemblyFileVersion("1.29.0.0")]
|
|
14
|
+
[assembly: AssemblyInformationalVersion("1.29.0")]
|
|
15
15
|
[assembly: ComVisible(false)]
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#Requires -Version 5.1
|
|
2
2
|
# Fetches a Microsoft Store app's package files (the .msix and the frameworks it needs) into -OutDir with this PC's own
|
|
3
3
|
# Store tooling: winget download --source msstore, which uses your own Windows / Microsoft Store access (the script
|
|
4
|
-
# never holds or asks for an account token). Prints one line of JSON: { ok, message, files: [file names in OutDir]
|
|
4
|
+
# never holds or asks for an account token). Prints one line of JSON: { ok, message, files: [file names in OutDir],
|
|
5
|
+
# dependencies: [the names among them that are frameworks] }.
|
|
5
6
|
# host/apps/store-package.ts hashes and checks the files; the sandbox installs them with Add-AppxPackage.
|
|
6
7
|
param(
|
|
7
8
|
[Parameter(Mandatory = $true)][string]$ProductId,
|
|
@@ -10,13 +11,13 @@ param(
|
|
|
10
11
|
)
|
|
11
12
|
$ErrorActionPreference = 'Stop'
|
|
12
13
|
|
|
13
|
-
function Finish([bool]$ok, [string]$message, $files) {
|
|
14
|
-
@{ ok = $ok; message = $message; files = @($files) } | ConvertTo-Json -Compress
|
|
14
|
+
function Finish([bool]$ok, [string]$message, $files, $dependencies) {
|
|
15
|
+
@{ ok = $ok; message = $message; files = @($files); dependencies = @($dependencies) } | ConvertTo-Json -Compress
|
|
15
16
|
exit 0
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
if ($ProductId -notmatch '^[A-Z0-9]{12}$') { Finish $false 'That is not a Microsoft Store product id.' @() }
|
|
19
|
-
if ($PackageName -notmatch '^[A-Za-z0-9.]{1,100}$') { Finish $false 'That is not a package name.' @() }
|
|
19
|
+
if ($ProductId -notmatch '^[A-Z0-9]{12}$') { Finish $false 'That is not a Microsoft Store product id.' @() @() }
|
|
20
|
+
if ($PackageName -notmatch '^[A-Za-z0-9.]{1,100}$') { Finish $false 'That is not a package name.' @() @() }
|
|
20
21
|
|
|
21
22
|
$winget = $null
|
|
22
23
|
$command = Get-Command -Name winget.exe -CommandType Application -ErrorAction SilentlyContinue | Select-Object -First 1
|
|
@@ -26,11 +27,13 @@ if (-not $winget) {
|
|
|
26
27
|
if (Test-Path -LiteralPath $alias) { $winget = $alias }
|
|
27
28
|
}
|
|
28
29
|
if (-not $winget) {
|
|
29
|
-
Finish $false 'winget is not on this PC. Install "App Installer" from the Microsoft Store, then launch again.' @()
|
|
30
|
+
Finish $false 'winget is not on this PC. Install "App Installer" from the Microsoft Store, then launch again.' @() @()
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
New-Item -ItemType Directory -Force -Path $OutDir | Out-Null
|
|
33
|
-
|
|
34
|
+
# x64 only: the sandbox is 64-bit Windows. winget puts the app in -OutDir and its frameworks (VCLibs, WindowsAppRuntime,
|
|
35
|
+
# .NET runtime ...) in -OutDir\Dependencies; they are all needed, and installed first by the sandbox.
|
|
36
|
+
$output = & $winget download --id $ProductId --source msstore --architecture x64 --download-directory $OutDir `
|
|
34
37
|
--accept-package-agreements --accept-source-agreements --disable-interactivity 2>&1 | Out-String
|
|
35
38
|
$code = $LASTEXITCODE
|
|
36
39
|
|
|
@@ -44,15 +47,23 @@ if ($code -ne 0 -or $found.Count -eq 0) {
|
|
|
44
47
|
if ($installed) {
|
|
45
48
|
$extra = ' The app is installed on this PC (' + $installed.Version + '), but Windows does not let its signed package be exported from there.'
|
|
46
49
|
}
|
|
47
|
-
Finish $false ('winget could not download the package (exit ' + $code + ').' + $extra + ' ' + $tail) @()
|
|
50
|
+
Finish $false ('winget could not download the package (exit ' + $code + ').' + $extra + ' ' + $tail) @() @()
|
|
48
51
|
}
|
|
49
52
|
|
|
50
|
-
#
|
|
53
|
+
# Everything goes up to -OutDir (host code reads the files by name). A name with characters the sandbox's file check
|
|
54
|
+
# refuses (spaces, brackets) is changed to plain ones; the file itself is not touched.
|
|
55
|
+
$root = (Resolve-Path -LiteralPath $OutDir).Path
|
|
51
56
|
$names = @()
|
|
57
|
+
$dependencies = @()
|
|
52
58
|
foreach ($file in $found) {
|
|
53
|
-
|
|
54
|
-
|
|
59
|
+
$isDependency = (Split-Path -Parent $file.FullName) -ne $root
|
|
60
|
+
$name = $file.Name -replace '[^A-Za-z0-9._~+-]', '_'
|
|
61
|
+
$target = Join-Path $root $name
|
|
62
|
+
if ($file.FullName -ne $target) {
|
|
63
|
+
if ($names -contains $name) { $name = ([guid]::NewGuid().ToString('N').Substring(0, 6)) + '_' + $name; $target = Join-Path $root $name }
|
|
64
|
+
Move-Item -LiteralPath $file.FullName -Destination $target -Force
|
|
55
65
|
}
|
|
56
|
-
$names += $
|
|
66
|
+
$names += $name
|
|
67
|
+
if ($isDependency) { $dependencies += $name }
|
|
57
68
|
}
|
|
58
|
-
Finish $true 'ok' $names
|
|
69
|
+
Finish $true 'ok' $names $dependencies
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "windows-development-sandbox",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.29.0",
|
|
4
4
|
"description": "A disposable Windows Sandbox for development, with or without an AI agent (Claude Code, Codex, Gemini, opencode, ...): the folder you run it from is the workspace, toolchains and databases for your project install themselves, and nothing else on your PC is reachable.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -12,17 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"bin": {
|
|
14
14
|
"sandbox": "dist/bin/sandbox.js",
|
|
15
|
-
"windows-development-sandbox": "dist/bin/sandbox.js"
|
|
16
|
-
"agent-sandbox": "dist/bin/agent-sandbox.js",
|
|
17
|
-
"claude-sbx": "dist/bin/claude-sbx.js",
|
|
18
|
-
"claude-sandbox": "dist/bin/claude-sbx.js",
|
|
19
|
-
"codex-sbx": "dist/bin/codex-sbx.js",
|
|
20
|
-
"codex-sandbox": "dist/bin/codex-sbx.js",
|
|
21
|
-
"gemini-sbx": "dist/bin/gemini-sbx.js",
|
|
22
|
-
"gemini-sandbox": "dist/bin/gemini-sbx.js",
|
|
23
|
-
"claude-host": "dist/bin/claude-host.js",
|
|
24
|
-
"sbx-show": "dist/bin/sbx-show.js",
|
|
25
|
-
"sbx-hide": "dist/bin/sbx-hide.js"
|
|
15
|
+
"windows-development-sandbox": "dist/bin/sandbox.js"
|
|
26
16
|
},
|
|
27
17
|
"exports": {
|
|
28
18
|
".": {
|
|
@@ -45,14 +35,14 @@
|
|
|
45
35
|
"build": "tsc -p tsconfig.json && tsc -p web/tsconfig.json --noEmit && node scripts/bundle.mjs && node scripts/bundle-web.mjs && node scripts/schemas.mjs",
|
|
46
36
|
"clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
47
37
|
"rebuild": "npm run clean && npm run build",
|
|
48
|
-
"test": "npm run build && node dist/bin/
|
|
38
|
+
"test": "npm run build && node dist/bin/sandbox.js self-test",
|
|
49
39
|
"prepack": "npm run rebuild",
|
|
50
40
|
"release:patch": "npm version patch && git push --follow-tags",
|
|
51
41
|
"release:minor": "npm version minor && git push --follow-tags",
|
|
52
42
|
"release:major": "npm version major && git push --follow-tags",
|
|
53
43
|
"install:global": "node scripts/install-global.mjs",
|
|
54
44
|
"publish:npm": "node scripts/publish-npm.mjs",
|
|
55
|
-
"doctor": "node dist/bin/
|
|
45
|
+
"doctor": "node dist/bin/sandbox.js doctor",
|
|
56
46
|
"lint": "eslint src scripts web",
|
|
57
47
|
"format": "prettier --write src scripts web",
|
|
58
48
|
"format:check": "prettier --check src scripts web",
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Reports each change of the clipboard on stdout until a parent process ends. Loaded by scripts\watch-clipboard.ps1 (Add-Type). C# 5.
|
|
2
|
+
using System;
|
|
3
|
+
using System.Runtime.InteropServices;
|
|
4
|
+
using System.Threading;
|
|
5
|
+
|
|
6
|
+
public static class SbxClipboardWatch
|
|
7
|
+
{
|
|
8
|
+
private const uint Synchronize = 0x00100000;
|
|
9
|
+
private const uint WaitObject0 = 0;
|
|
10
|
+
private const int PollMs = 150;
|
|
11
|
+
|
|
12
|
+
private static class NativeMethods
|
|
13
|
+
{
|
|
14
|
+
[DllImport("kernel32.dll", SetLastError = true)]
|
|
15
|
+
public static extern IntPtr OpenProcess(uint access, bool inherit, uint pid);
|
|
16
|
+
|
|
17
|
+
[DllImport("kernel32.dll", SetLastError = true)]
|
|
18
|
+
public static extern uint WaitForSingleObject(IntPtr handle, uint milliseconds);
|
|
19
|
+
|
|
20
|
+
[DllImport("kernel32.dll", SetLastError = true)]
|
|
21
|
+
public static extern bool CloseHandle(IntPtr handle);
|
|
22
|
+
|
|
23
|
+
[DllImport("user32.dll", SetLastError = true)]
|
|
24
|
+
public static extern uint GetClipboardSequenceNumber();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/// <summary>
|
|
28
|
+
/// Writes the line "changed" for every clipboard change, until process parentPid ends. 0 = the parent ended,
|
|
29
|
+
/// 2 = the parent could not be opened.
|
|
30
|
+
/// </summary>
|
|
31
|
+
public static int Run(uint parentPid)
|
|
32
|
+
{
|
|
33
|
+
IntPtr parent = NativeMethods.OpenProcess(Synchronize, false, parentPid);
|
|
34
|
+
if (parent == IntPtr.Zero)
|
|
35
|
+
{
|
|
36
|
+
return 2;
|
|
37
|
+
}
|
|
38
|
+
try
|
|
39
|
+
{
|
|
40
|
+
uint last = NativeMethods.GetClipboardSequenceNumber();
|
|
41
|
+
while (NativeMethods.WaitForSingleObject(parent, 0) != WaitObject0)
|
|
42
|
+
{
|
|
43
|
+
uint now = NativeMethods.GetClipboardSequenceNumber();
|
|
44
|
+
if (now != last)
|
|
45
|
+
{
|
|
46
|
+
last = now;
|
|
47
|
+
Console.Out.WriteLine("changed");
|
|
48
|
+
Console.Out.Flush();
|
|
49
|
+
}
|
|
50
|
+
Thread.Sleep(PollMs);
|
|
51
|
+
}
|
|
52
|
+
return 0;
|
|
53
|
+
}
|
|
54
|
+
finally
|
|
55
|
+
{
|
|
56
|
+
NativeMethods.CloseHandle(parent);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|