windows-development-sandbox 1.12.0 → 1.13.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.
Files changed (160) hide show
  1. package/README.md +1 -0
  2. package/config.example.json +11 -1
  3. package/dist/app/features/access/access.def.d.ts +190 -0
  4. package/dist/app/features/access/access.def.js +273 -0
  5. package/dist/app/features/access/access.run.d.ts +79 -0
  6. package/dist/app/features/access/access.run.js +129 -0
  7. package/dist/app/features/access/index.d.ts +2 -0
  8. package/dist/app/features/access/index.js +3 -0
  9. package/dist/app/features/agents/agent-entry.js +5 -0
  10. package/dist/app/features/agents/agents.def.js +1 -0
  11. package/dist/app/features/apps/apps.def.js +1 -0
  12. package/dist/app/features/audit/audit.def.d.ts +11 -2
  13. package/dist/app/features/audit/audit.def.js +7 -4
  14. package/dist/app/features/audit/audit.run.d.ts +3 -0
  15. package/dist/app/features/defs.d.ts +155 -3
  16. package/dist/app/features/defs.js +12 -1
  17. package/dist/app/features/files/files.def.js +1 -0
  18. package/dist/app/features/health/health.def.js +1 -0
  19. package/dist/app/features/sandbox/sandbox.def.js +3 -0
  20. package/dist/app/features/sessions/sessions.def.d.ts +36 -0
  21. package/dist/app/features/sessions/sessions.def.js +77 -9
  22. package/dist/app/features/sessions/sessions.run.d.ts +25 -2
  23. package/dist/app/features/sessions/sessions.run.js +71 -3
  24. package/dist/app/features/settings/settings.def.d.ts +8 -0
  25. package/dist/app/features/settings/settings.def.js +17 -0
  26. package/dist/app/features/web/web.def.d.ts +9 -0
  27. package/dist/app/features/web/web.def.js +26 -1
  28. package/dist/app/features/web/web.run.d.ts +3 -0
  29. package/dist/app/features/web/web.run.js +11 -3
  30. package/dist/app/kernel/access.d.ts +33 -0
  31. package/dist/app/kernel/access.js +44 -0
  32. package/dist/app/kernel/define.d.ts +14 -1
  33. package/dist/app/kernel/index.d.ts +1 -0
  34. package/dist/app/kernel/index.js +1 -0
  35. package/dist/app/kernel/rpc.d.ts +5 -2
  36. package/dist/app/registry.d.ts +4 -1
  37. package/dist/app/registry.js +24 -4
  38. package/dist/cli/commands/registry.js +2 -0
  39. package/dist/cli/commands/remote.d.ts +2 -0
  40. package/dist/cli/commands/remote.js +49 -0
  41. package/dist/cli/commands/sessions/reopen.js +3 -0
  42. package/dist/cli/commands/web.js +66 -0
  43. package/dist/cli/manifest.d.ts +63 -4
  44. package/dist/cli/manifest.js +33 -4
  45. package/dist/cli/menu/io-menu.d.ts +5 -3
  46. package/dist/cli/menu/io-menu.js +12 -5
  47. package/dist/cli/menu/remote-menu.d.ts +19 -0
  48. package/dist/cli/menu/remote-menu.js +108 -0
  49. package/dist/cli/menu/views.js +2 -0
  50. package/dist/cli/operations/handler.js +15 -1
  51. package/dist/cli/services/remote-client.d.ts +16 -0
  52. package/dist/cli/services/remote-client.js +141 -0
  53. package/dist/cli/services/sessions-service.d.ts +5 -0
  54. package/dist/cli/services/sessions-service.js +17 -1
  55. package/dist/core/config/defaults.js +11 -1
  56. package/dist/core/local-config/file.js +16 -2
  57. package/dist/core/local-config/overrides.js +7 -0
  58. package/dist/core/run/versions.js +9 -8
  59. package/dist/core/schema/config.d.ts +22 -3
  60. package/dist/core/schema/config.js +39 -2
  61. package/dist/core/schema/web.d.ts +51 -0
  62. package/dist/core/schema/web.js +46 -1
  63. package/dist/core/util/fs.d.ts +5 -0
  64. package/dist/core/util/fs.js +23 -0
  65. package/dist/core/util/index.d.ts +1 -1
  66. package/dist/core/util/index.js +1 -1
  67. package/dist/guest/daemon/daemon.js +2 -0
  68. package/dist/guest/daemon/idle-shutdown.js +2 -1
  69. package/dist/guest/daemon/sessions.d.ts +16 -2
  70. package/dist/guest/daemon/sessions.js +126 -20
  71. package/dist/guest/git/decision.js +7 -0
  72. package/dist/guest/sessions/cmdline.d.ts +14 -0
  73. package/dist/guest/sessions/cmdline.js +10 -0
  74. package/dist/guest/toolchains/setup.js +3 -0
  75. package/dist/host/audit/log.d.ts +3 -2
  76. package/dist/host/audit/log.js +3 -3
  77. package/dist/host/channel/channel.d.ts +5 -1
  78. package/dist/host/channel/channel.js +12 -0
  79. package/dist/host/guard/agent-files.js +7 -1
  80. package/dist/host/guard/commands.js +13 -1
  81. package/dist/host/guard/git-config.js +27 -7
  82. package/dist/host/guard/git-dirs.js +78 -3
  83. package/dist/host/guard/mark-of-the-web.js +3 -1
  84. package/dist/host/guard/nested-repos.js +7 -2
  85. package/dist/host/guard/store.js +1 -0
  86. package/dist/host/guard/types.d.ts +2 -0
  87. package/dist/host/launch/mappings.js +11 -1
  88. package/dist/host/launch/project-scan.js +2 -21
  89. package/dist/host/launch/stage.js +4 -0
  90. package/dist/host/life/session-ledger.js +2 -1
  91. package/dist/host/remote/access-store.d.ts +156 -0
  92. package/dist/host/remote/access-store.js +308 -0
  93. package/dist/host/remote/cert.d.ts +20 -0
  94. package/dist/host/remote/cert.js +103 -0
  95. package/dist/host/remote/door-client.d.ts +13 -0
  96. package/dist/host/remote/door-client.js +54 -0
  97. package/dist/host/remote/firewall.d.ts +44 -0
  98. package/dist/host/remote/firewall.js +118 -0
  99. package/dist/host/remote/gate.d.ts +125 -0
  100. package/dist/host/remote/gate.js +391 -0
  101. package/dist/host/remote/index.d.ts +8 -0
  102. package/dist/host/remote/index.js +10 -0
  103. package/dist/host/remote/lan.d.ts +24 -0
  104. package/dist/host/remote/lan.js +88 -0
  105. package/dist/host/remote/tls-store.d.ts +22 -0
  106. package/dist/host/remote/tls-store.js +63 -0
  107. package/dist/host/remote/windows-helper.d.ts +67 -0
  108. package/dist/host/remote/windows-helper.js +129 -0
  109. package/dist/host/web/bridge.d.ts +5 -1
  110. package/dist/host/web/bridge.js +6 -2
  111. package/dist/host/web/browser.js +1 -1
  112. package/dist/host/web/control.d.ts +4 -1
  113. package/dist/host/web/control.js +28 -4
  114. package/dist/host/web/rpc.d.ts +16 -2
  115. package/dist/host/web/rpc.js +37 -4
  116. package/dist/host/web/runner.d.ts +4 -0
  117. package/dist/host/web/runner.js +12 -0
  118. package/dist/host/web/server.d.ts +18 -2
  119. package/dist/host/web/server.js +97 -24
  120. package/dist/host/web/state.d.ts +5 -0
  121. package/dist/host/web/state.js +8 -0
  122. package/dist/runtime/agent.js +74 -3
  123. package/dist/runtime/daemon.js +205 -24
  124. package/dist/runtime/db.js +74 -3
  125. package/dist/runtime/gitguard.js +6 -0
  126. package/dist/runtime/main.js +77 -3
  127. package/dist/runtime/netproxy.js +74 -3
  128. package/dist/runtime/view.js +76 -3
  129. package/dist/selftest/app.test.js +41 -6
  130. package/dist/selftest/channel.test.js +16 -0
  131. package/dist/selftest/cmdline.test.js +16 -0
  132. package/dist/selftest/git-access.test.js +8 -0
  133. package/dist/selftest/hostile-input.test.js +12 -1
  134. package/dist/selftest/index.js +2 -0
  135. package/dist/selftest/live-daemon.test.js +25 -0
  136. package/dist/selftest/local-config.test.js +30 -0
  137. package/dist/selftest/remote.test.d.ts +2 -0
  138. package/dist/selftest/remote.test.js +536 -0
  139. package/dist/selftest/repo-guard.test.js +56 -2
  140. package/dist/selftest/resume.test.js +2 -1
  141. package/dist/selftest/sharing.test.js +9 -2
  142. package/dist/selftest/support/fixtures.d.ts +13 -0
  143. package/dist/selftest/support/web-preview.js +63 -0
  144. package/dist/selftest/web.test.js +2 -0
  145. package/dist/shared/channel/schema.d.ts +23 -0
  146. package/dist/shared/channel/schema.js +8 -0
  147. package/dist/shared/pty/protocol.d.ts +2 -0
  148. package/dist/shared/pty/protocol.js +2 -0
  149. package/dist/web/index.html +1 -1
  150. package/dist/web/main-Z2WYAE2Z.js +221 -0
  151. package/native/csharp/HostTools/Program.cs +17 -1
  152. package/native/csharp/HostTools/WebHelper.cs +499 -0
  153. package/native/scripts/get-network-profile.ps1 +19 -0
  154. package/native/scripts/set-folder-access.ps1 +11 -0
  155. package/native/scripts/set-web-firewall.ps1 +103 -0
  156. package/package.json +1 -1
  157. package/sandbox/csharp/PtyHost.cs +20 -0
  158. package/schemas/config.schema.json +65 -0
  159. package/schemas/sandbox-config.schema.json +0 -18
  160. package/dist/web/main-UD4QCXZR.js +0 -219
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windows-development-sandbox",
3
- "version": "1.12.0",
3
+ "version": "1.13.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",
@@ -11,6 +11,7 @@
11
11
  // 3 RESIZE [cols:2][rows:2]
12
12
  // 4 RESTART restart the program with <restartCommandLine> (e.g. after switching accounts)
13
13
  // 5 PING "still here": viewers send it every few seconds, so a closed terminal stops counting
14
+ // 6 CLOSE end the program (and everything it started) and with it the session
14
15
  // host -> client 16 OUTPUT VT output
15
16
  // 17 EXIT [exitCode:4]
16
17
  // 18 ERROR utf8 message
@@ -65,6 +66,7 @@ sealed class SessionHost
65
66
  private readonly string restartCommand;
66
67
  private string command;
67
68
  private volatile bool restartRequested;
69
+ private volatile bool closeRequested;
68
70
 
69
71
  public SessionHost(ClientHub hub, Log log, string command, string restartCommand)
70
72
  {
@@ -99,11 +101,24 @@ sealed class SessionHost
99
101
 
100
102
  public void Restart()
101
103
  {
104
+ if (closeRequested)
105
+ {
106
+ return;
107
+ }
102
108
  restartRequested = true;
103
109
  hub.ResetReplay();
104
110
  hub.Notify(Frame.Restarting);
105
111
  hub.KillProgram();
106
112
  }
113
+
114
+ /// <summary>Ends the program for good (CLOSE): the session exits the way it does when the program exits.</summary>
115
+ public void Close()
116
+ {
117
+ closeRequested = true;
118
+ restartRequested = false;
119
+ log.Write("closing the session on request");
120
+ hub.KillProgram();
121
+ }
107
122
  }
108
123
 
109
124
  /// <summary>Accepts TCP clients and turns their frames into actions.</summary>
@@ -201,6 +216,10 @@ sealed class Listener
201
216
  {
202
217
  host.Restart();
203
218
  }
219
+ else if (type == Frame.Close)
220
+ {
221
+ host.Close();
222
+ }
204
223
  }
205
224
  }
206
225
  catch (IOException)
@@ -1251,6 +1270,7 @@ static class Frame
1251
1270
  public const byte Resize = 3;
1252
1271
  public const byte Restart = 4;
1253
1272
  public const byte Ping = 5;
1273
+ public const byte Close = 6;
1254
1274
  public const byte Output = 16;
1255
1275
  public const byte Exit = 17;
1256
1276
  public const byte Error = 18;
@@ -1265,6 +1265,71 @@
1265
1265
  "openOnLaunch": {
1266
1266
  "type": "boolean",
1267
1267
  "description": "(Beta) With the web UI on: open it in your browser, already signed in, every time a sandbox starts."
1268
+ },
1269
+ "remote": {
1270
+ "type": "object",
1271
+ "properties": {
1272
+ "windowsSignIn": {
1273
+ "type": "boolean",
1274
+ "description": "(Beta) Other Windows users of this PC named in web.remote.users sign in to your web UI (and sandbox remote) with their own Windows account: no password, no link."
1275
+ },
1276
+ "users": {
1277
+ "maxItems": 32,
1278
+ "type": "array",
1279
+ "items": {
1280
+ "type": "object",
1281
+ "properties": {
1282
+ "name": {
1283
+ "type": "string",
1284
+ "minLength": 1,
1285
+ "maxLength": 120,
1286
+ "pattern": "^(?:[A-Za-z0-9][A-Za-z0-9._ -]{0,62}\\\\)?[^\\\\/\"[\\]:;|=,+*?<>@]{1,64}$",
1287
+ "description": "The Windows user (name, or DOMAIN\\name)"
1288
+ },
1289
+ "role": {
1290
+ "type": "string",
1291
+ "enum": [
1292
+ "view",
1293
+ "control"
1294
+ ],
1295
+ "description": "view: sees everything, terminals read-only. control: everything but remote access, logins and tokens."
1296
+ }
1297
+ },
1298
+ "additionalProperties": false
1299
+ },
1300
+ "description": "Who else may sign in with Windows, and their role (view or control)."
1301
+ },
1302
+ "rememberDays": {
1303
+ "type": "integer",
1304
+ "minimum": 1,
1305
+ "maximum": 90,
1306
+ "description": "How many days a paired device or a Windows sign-in stays signed in (from when it signed in, not renewed)."
1307
+ },
1308
+ "lan": {
1309
+ "type": "object",
1310
+ "properties": {
1311
+ "enabled": {
1312
+ "type": "boolean",
1313
+ "description": "(Beta) Devices on your network (a phone): an HTTPS address on this PC for devices you pair with a one-time code (sandbox web pair). Needs a firewall rule (sandbox web lan on asks Windows once). Off: every paired device is signed out."
1314
+ },
1315
+ "port": {
1316
+ "type": "integer",
1317
+ "minimum": 1024,
1318
+ "maximum": 65535,
1319
+ "description": "HTTPS port for paired devices on your network."
1320
+ },
1321
+ "address": {
1322
+ "type": "string",
1323
+ "maxLength": 15,
1324
+ "pattern": "^$|^\\d{1,3}(\\.\\d{1,3}){3}$",
1325
+ "description": "This PC's private address to listen on. Empty: the one of its network adapter (never a public one)."
1326
+ }
1327
+ },
1328
+ "additionalProperties": false
1329
+ }
1330
+ },
1331
+ "additionalProperties": false,
1332
+ "description": "(Beta) Access for other Windows users of this PC and for paired devices."
1268
1333
  }
1269
1334
  },
1270
1335
  "additionalProperties": false
@@ -107,24 +107,6 @@
107
107
  ],
108
108
  "description": "Sandbox RAM in MB (>= 2048), or \"auto\": free RAM minus reserveHostMb, capped at maxMemoryMb. Never more than this PC can keep in RAM for it (its RAM minus the larger of reserveHostMb and 25 %, 2 GB more with vGPU): a bigger value is lowered."
109
109
  },
110
- "maxMemoryMb": {
111
- "type": "integer",
112
- "exclusiveMinimum": 0,
113
- "maximum": 9007199254740991,
114
- "description": "Upper limit for memoryMb \"auto\"."
115
- },
116
- "maxMemoryPercent": {
117
- "type": "integer",
118
- "minimum": 10,
119
- "maximum": 100,
120
- "description": "memoryMb \"auto\" never takes more than this share of this PC's total RAM (percent)."
121
- },
122
- "reserveHostMb": {
123
- "type": "integer",
124
- "minimum": 0,
125
- "maximum": 9007199254740991,
126
- "description": "Memory always left for this PC when memoryMb is \"auto\": the sandbox gets at most (free RAM, and RAM plus paging file still unused) minus this."
127
- },
128
110
  "vGpu": {
129
111
  "type": "boolean",
130
112
  "description": "Virtual GPU. Off by default: Microsoft notes it widens the sandbox attack surface. The sandbox then uses this PC's graphics card, and with some graphics drivers heavy use can freeze the whole PC: turn it on only when a program in the sandbox needs the GPU (the mesa toolchain gives software OpenGL without it)."