windows-development-sandbox 1.7.0 → 1.10.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 (432) hide show
  1. package/config.example.json +12 -1
  2. package/dist/app/context.d.ts +8 -0
  3. package/dist/app/context.js +12 -0
  4. package/dist/app/features/defs.d.ts +322 -0
  5. package/dist/app/features/defs.js +28 -0
  6. package/dist/app/features/sandbox/index.d.ts +2 -0
  7. package/dist/app/features/sandbox/index.js +3 -0
  8. package/dist/app/features/sandbox/sandbox.def.d.ts +193 -0
  9. package/dist/app/features/sandbox/sandbox.def.js +245 -0
  10. package/dist/app/features/sandbox/sandbox.run.d.ts +72 -0
  11. package/dist/app/features/sandbox/sandbox.run.js +98 -0
  12. package/dist/app/features/sessions/index.d.ts +2 -0
  13. package/dist/app/features/sessions/index.js +3 -0
  14. package/dist/app/features/sessions/sessions.def.d.ts +141 -0
  15. package/dist/app/features/sessions/sessions.def.js +176 -0
  16. package/dist/app/features/sessions/sessions.run.d.ts +39 -0
  17. package/dist/app/features/sessions/sessions.run.js +58 -0
  18. package/dist/{cli/menu/settings/categories.d.ts → app/features/settings/categories.def.d.ts} +2 -0
  19. package/dist/{cli/menu/settings/categories.js → app/features/settings/categories.def.js} +24 -5
  20. package/dist/app/features/settings/index.d.ts +5 -0
  21. package/dist/app/features/settings/index.js +6 -0
  22. package/dist/{cli/menu/settings/config-file.d.ts → app/features/settings/settings-file.d.ts} +1 -1
  23. package/dist/{cli/menu/settings/config-file.js → app/features/settings/settings-file.js} +1 -1
  24. package/dist/app/features/settings/settings-rows.d.ts +35 -0
  25. package/dist/app/features/settings/settings-rows.js +94 -0
  26. package/dist/app/features/settings/settings.def.d.ts +157 -0
  27. package/dist/app/features/settings/settings.def.js +179 -0
  28. package/dist/app/features/settings/settings.run.d.ts +67 -0
  29. package/dist/app/features/settings/settings.run.js +84 -0
  30. package/dist/app/kernel/define.d.ts +143 -0
  31. package/dist/app/kernel/define.js +42 -0
  32. package/dist/app/kernel/errors.d.ts +34 -0
  33. package/dist/app/kernel/errors.js +45 -0
  34. package/dist/app/kernel/fields.d.ts +70 -0
  35. package/dist/app/kernel/fields.js +243 -0
  36. package/dist/app/kernel/index.d.ts +8 -0
  37. package/dist/app/kernel/index.js +10 -0
  38. package/dist/app/kernel/io.d.ts +193 -0
  39. package/dist/app/kernel/io.js +126 -0
  40. package/dist/app/kernel/rpc.d.ts +156 -0
  41. package/dist/app/kernel/rpc.js +47 -0
  42. package/dist/app/kernel/text.d.ts +6 -0
  43. package/dist/app/kernel/text.js +57 -0
  44. package/dist/app/kernel/view.d.ts +146 -0
  45. package/dist/app/kernel/view.js +28 -0
  46. package/dist/app/registry.d.ts +10 -0
  47. package/dist/app/registry.js +50 -0
  48. package/dist/cli/args.d.ts +5 -0
  49. package/dist/cli/args.js +6 -0
  50. package/dist/cli/commands/engine.d.ts +2 -0
  51. package/dist/cli/commands/engine.js +60 -0
  52. package/dist/cli/commands/index.d.ts +1 -1
  53. package/dist/cli/commands/index.js +1 -1
  54. package/dist/cli/commands/launch/launch.js +49 -7
  55. package/dist/cli/commands/launch/prepare.js +3 -3
  56. package/dist/cli/commands/launch/running.js +2 -1
  57. package/dist/cli/commands/launch/summary.d.ts +2 -0
  58. package/dist/cli/commands/maintenance/config-share.d.ts +12 -0
  59. package/dist/cli/commands/maintenance/config-share.js +80 -0
  60. package/dist/cli/commands/maintenance/config.js +8 -82
  61. package/dist/cli/commands/maintenance/logs.js +14 -0
  62. package/dist/cli/commands/registry.js +3 -7
  63. package/dist/cli/commands/repair/checks/contained.d.ts +2 -0
  64. package/dist/cli/commands/repair/checks/contained.js +139 -0
  65. package/dist/cli/commands/repair/checks/hcs.d.ts +7 -0
  66. package/dist/cli/commands/repair/checks/hcs.js +28 -0
  67. package/dist/cli/commands/repair/checks/index.js +4 -0
  68. package/dist/cli/commands/repair/checks/pc.js +32 -1
  69. package/dist/cli/commands/repair/checks/sandbox.js +16 -1
  70. package/dist/cli/commands/repair/checks/vpn.js +34 -9
  71. package/dist/cli/commands/repair/env.js +2 -1
  72. package/dist/cli/commands/sessions/index.d.ts +0 -4
  73. package/dist/cli/commands/sessions/index.js +3 -7
  74. package/dist/cli/commands/shared-use.d.ts +5 -2
  75. package/dist/cli/commands/shared-use.js +11 -8
  76. package/dist/cli/commands/storage/contained.d.ts +3 -0
  77. package/dist/cli/commands/storage/contained.js +179 -0
  78. package/dist/cli/commands/storage/offer.js +7 -1
  79. package/dist/cli/commands/storage/storage.js +10 -2
  80. package/dist/cli/commands/user-config.js +1 -1
  81. package/dist/cli/commands/vpn.js +20 -3
  82. package/dist/cli/commands/web.d.ts +5 -0
  83. package/dist/cli/commands/web.js +40 -0
  84. package/dist/cli/index.js +2 -1
  85. package/dist/cli/manifest.d.ts +72 -104
  86. package/dist/cli/manifest.js +64 -39
  87. package/dist/cli/menu/add-agent.d.ts +1 -1
  88. package/dist/cli/menu/add-agent.js +1 -1
  89. package/dist/cli/menu/apps.d.ts +7 -1
  90. package/dist/cli/menu/apps.js +36 -0
  91. package/dist/cli/menu/command-fields.d.ts +1 -1
  92. package/dist/cli/menu/command-form.js +2 -2
  93. package/dist/cli/menu/io-menu.d.ts +29 -0
  94. package/dist/cli/menu/io-menu.js +126 -0
  95. package/dist/cli/menu/live.d.ts +27 -0
  96. package/dist/cli/menu/live.js +69 -0
  97. package/dist/cli/menu/memory.d.ts +19 -0
  98. package/dist/cli/menu/memory.js +53 -0
  99. package/dist/cli/menu/menu.d.ts +10 -1
  100. package/dist/cli/menu/menu.js +27 -9
  101. package/dist/cli/menu/pages/agents-page.d.ts +3 -1
  102. package/dist/cli/menu/pages/agents-page.js +12 -5
  103. package/dist/cli/menu/pages/apps-page.d.ts +3 -1
  104. package/dist/cli/menu/pages/apps-page.js +19 -2
  105. package/dist/cli/menu/pages/list-page.d.ts +27 -0
  106. package/dist/cli/menu/pages/list-page.js +109 -7
  107. package/dist/cli/menu/pages/maintenance-page.d.ts +0 -5
  108. package/dist/cli/menu/pages/maintenance-page.js +17 -19
  109. package/dist/cli/menu/pages/sandbox-page.d.ts +4 -6
  110. package/dist/cli/menu/pages/sandbox-page.js +26 -118
  111. package/dist/cli/menu/pages/scopes.d.ts +1 -1
  112. package/dist/cli/menu/pages/sessions-page.d.ts +5 -11
  113. package/dist/cli/menu/pages/sessions-page.js +19 -88
  114. package/dist/cli/menu/pages/settings-page.d.ts +2 -10
  115. package/dist/cli/menu/pages/settings-page.js +64 -94
  116. package/dist/cli/menu/render-view.d.ts +28 -0
  117. package/dist/cli/menu/render-view.js +112 -0
  118. package/dist/cli/menu/settings/{path-kind.d.ts → ask-path.d.ts} +1 -7
  119. package/dist/cli/menu/settings/ask-path.js +14 -0
  120. package/dist/cli/menu/settings/collections/collection-editor.d.ts +1 -1
  121. package/dist/cli/menu/settings/collections/string-list-editor.d.ts +1 -2
  122. package/dist/cli/menu/settings/collections/string-list-editor.js +1 -1
  123. package/dist/cli/menu/settings/draft.d.ts +1 -1
  124. package/dist/cli/menu/settings/format.d.ts +1 -3
  125. package/dist/cli/menu/settings/format.js +6 -36
  126. package/dist/cli/menu/settings/index.d.ts +1 -3
  127. package/dist/cli/menu/settings/index.js +3 -3
  128. package/dist/cli/menu/settings/object-editor.d.ts +1 -1
  129. package/dist/cli/menu/settings/share.d.ts +36 -0
  130. package/dist/cli/menu/settings/share.js +131 -0
  131. package/dist/cli/menu/settings/value-editor.d.ts +5 -1
  132. package/dist/cli/menu/settings/value-editor.js +57 -54
  133. package/dist/cli/menu/several.js +1 -1
  134. package/dist/cli/menu/share-settings.d.ts +21 -0
  135. package/dist/cli/menu/share-settings.js +112 -0
  136. package/dist/cli/menu/shell.d.ts +21 -5
  137. package/dist/cli/menu/shell.js +31 -6
  138. package/dist/cli/menu/views.d.ts +7 -0
  139. package/dist/cli/menu/views.js +11 -0
  140. package/dist/cli/menu/vpn-login.js +8 -0
  141. package/dist/cli/operations/handler.d.ts +6 -0
  142. package/dist/cli/operations/handler.js +61 -0
  143. package/dist/cli/operations/index.d.ts +4 -0
  144. package/dist/cli/operations/index.js +5 -0
  145. package/dist/cli/operations/input.d.ts +6 -0
  146. package/dist/cli/operations/input.js +37 -0
  147. package/dist/cli/operations/io-cli.d.ts +7 -0
  148. package/dist/cli/operations/io-cli.js +62 -0
  149. package/dist/cli/operations/spec.d.ts +18 -0
  150. package/dist/cli/operations/spec.js +108 -0
  151. package/dist/cli/output/colors.d.ts +2 -2
  152. package/dist/cli/output/colors.js +2 -11
  153. package/dist/cli/output/index.d.ts +1 -0
  154. package/dist/cli/output/index.js +1 -0
  155. package/dist/cli/output/print.d.ts +3 -1
  156. package/dist/cli/output/print.js +7 -3
  157. package/dist/cli/output/progress.d.ts +15 -0
  158. package/dist/cli/output/progress.js +44 -0
  159. package/dist/cli/output/render-view.d.ts +4 -0
  160. package/dist/cli/output/render-view.js +63 -0
  161. package/dist/cli/services/agent-commands-service.d.ts +2 -0
  162. package/dist/cli/services/agent-commands-service.js +11 -2
  163. package/dist/cli/services/logs-service.js +4 -3
  164. package/dist/cli/tui/app.d.ts +6 -1
  165. package/dist/cli/tui/app.js +26 -4
  166. package/dist/cli/tui/list/list-screen.d.ts +14 -0
  167. package/dist/cli/tui/list/list-screen.js +64 -36
  168. package/dist/cli/tui/list/list-types.d.ts +2 -0
  169. package/dist/cli/tui/terminal.d.ts +7 -0
  170. package/dist/cli/tui/terminal.js +30 -10
  171. package/dist/core/config/defaults.js +9 -1
  172. package/dist/core/schema/config.d.ts +14 -0
  173. package/dist/core/schema/config.js +16 -1
  174. package/dist/core/schema/harness.d.ts +1 -0
  175. package/dist/core/schema/harness.js +5 -0
  176. package/dist/core/schema/sandbox.d.ts +6 -0
  177. package/dist/core/schema/sandbox.js +20 -3
  178. package/dist/core/schema/vpn.d.ts +2 -1
  179. package/dist/core/schema/vpn.js +4 -4
  180. package/dist/core/schema/web.d.ts +1 -0
  181. package/dist/core/schema/web.js +4 -1
  182. package/dist/core/types.d.ts +23 -5
  183. package/dist/core/util/fs.d.ts +2 -0
  184. package/dist/core/util/fs.js +9 -0
  185. package/dist/core/util/index.d.ts +1 -1
  186. package/dist/core/util/index.js +1 -1
  187. package/dist/guest/agents/agent-files.d.ts +5 -0
  188. package/dist/guest/agents/agent-files.js +4 -0
  189. package/dist/guest/agents/local-state.d.ts +2 -0
  190. package/dist/guest/agents/local-state.js +21 -1
  191. package/dist/guest/boot/boot.js +5 -2
  192. package/dist/guest/daemon/daemon.js +4 -0
  193. package/dist/guest/daemon/sessions.d.ts +5 -0
  194. package/dist/guest/daemon/sessions.js +17 -3
  195. package/dist/guest/entries/daemon.js +3 -0
  196. package/dist/guest/governor/decide.d.ts +71 -0
  197. package/dist/guest/governor/decide.js +211 -0
  198. package/dist/guest/governor/governor.d.ts +45 -0
  199. package/dist/guest/governor/governor.js +230 -0
  200. package/dist/guest/governor/index.d.ts +2 -0
  201. package/dist/guest/governor/index.js +2 -0
  202. package/dist/guest/network/firewall.d.ts +1 -0
  203. package/dist/guest/network/firewall.js +65 -23
  204. package/dist/guest/runtime/csc.d.ts +1 -0
  205. package/dist/guest/runtime/csc.js +1 -0
  206. package/dist/guest/runtime/process.js +53 -5
  207. package/dist/guest/sessions/viewer.js +3 -1
  208. package/dist/guest/setup/claude-mem.js +12 -4
  209. package/dist/guest/toolchains/languages/node.js +29 -3
  210. package/dist/guest/toolchains/native/rust-extras.js +4 -2
  211. package/dist/guest/vpn/vpn.js +69 -21
  212. package/dist/guest/vpn/wireguard.d.ts +32 -0
  213. package/dist/guest/vpn/wireguard.js +132 -0
  214. package/dist/host/agent-commands/commands.d.ts +4 -0
  215. package/dist/host/agent-commands/commands.js +31 -7
  216. package/dist/host/audit/log.d.ts +1 -1
  217. package/dist/host/channel/attach.d.ts +3 -1
  218. package/dist/host/channel/attach.js +5 -2
  219. package/dist/host/channel/channel.d.ts +2 -0
  220. package/dist/host/channel/channel.js +4 -0
  221. package/dist/host/engines/engine.d.ts +12 -0
  222. package/dist/host/engines/engine.js +1 -0
  223. package/dist/host/engines/hcs/check.d.ts +25 -0
  224. package/dist/host/engines/hcs/check.js +95 -0
  225. package/dist/host/engines/hcs/documents.d.ts +44 -0
  226. package/dist/host/engines/hcs/documents.js +155 -0
  227. package/dist/host/engines/hcs/engine.d.ts +39 -0
  228. package/dist/host/engines/hcs/engine.js +171 -0
  229. package/dist/host/engines/hcs/helper.d.ts +43 -0
  230. package/dist/host/engines/hcs/helper.js +173 -0
  231. package/dist/host/engines/hcs/images.d.ts +37 -0
  232. package/dist/host/engines/hcs/images.js +152 -0
  233. package/dist/host/engines/index.d.ts +7 -0
  234. package/dist/host/engines/index.js +5 -0
  235. package/dist/host/engines/registry.d.ts +16 -0
  236. package/dist/host/engines/registry.js +30 -0
  237. package/dist/host/engines/types.d.ts +58 -0
  238. package/dist/host/engines/types.js +1 -0
  239. package/dist/host/engines/windows-sandbox/engine.d.ts +16 -0
  240. package/dist/host/engines/windows-sandbox/engine.js +63 -0
  241. package/dist/host/engines/windows-sandbox/wsb-text.d.ts +2 -0
  242. package/dist/host/engines/windows-sandbox/wsb-text.js +29 -0
  243. package/dist/host/launch/generate.d.ts +5 -1
  244. package/dist/host/launch/generate.js +50 -8
  245. package/dist/host/launch/index.d.ts +3 -1
  246. package/dist/host/launch/index.js +3 -1
  247. package/dist/host/launch/launch-plan.d.ts +13 -0
  248. package/dist/host/launch/launch-plan.js +26 -0
  249. package/dist/host/launch/mappings.js +2 -1
  250. package/dist/host/launch/risk-notes.d.ts +10 -0
  251. package/dist/host/launch/risk-notes.js +18 -0
  252. package/dist/host/launch/session-file.d.ts +2 -0
  253. package/dist/host/launch/session-file.js +7 -1
  254. package/dist/host/launch/wsb-file.d.ts +28 -4
  255. package/dist/host/launch/wsb-file.js +61 -42
  256. package/dist/host/life/crash-report.d.ts +27 -1
  257. package/dist/host/life/crash-report.js +173 -7
  258. package/dist/host/life/host-memory.d.ts +41 -0
  259. package/dist/host/life/host-memory.js +140 -0
  260. package/dist/host/life/index.d.ts +2 -0
  261. package/dist/host/life/index.js +2 -0
  262. package/dist/host/life/stop-events.d.ts +2 -0
  263. package/dist/host/life/stop-events.js +20 -3
  264. package/dist/host/life/stop-warning.js +1 -1
  265. package/dist/host/life/watchdog.d.ts +56 -0
  266. package/dist/host/life/watchdog.js +124 -0
  267. package/dist/host/native.d.ts +3 -2
  268. package/dist/host/native.js +22 -3
  269. package/dist/host/profile/claude-login.js +3 -2
  270. package/dist/host/sandbox/contained-deps.d.ts +2 -0
  271. package/dist/host/sandbox/contained-deps.js +17 -0
  272. package/dist/host/sandbox/index.d.ts +2 -0
  273. package/dist/host/sandbox/index.js +2 -0
  274. package/dist/host/sandbox/platform.d.ts +2 -0
  275. package/dist/host/sandbox/platform.js +7 -7
  276. package/dist/host/sandbox/tasklist.d.ts +13 -0
  277. package/dist/host/sandbox/tasklist.js +47 -0
  278. package/dist/host/secrets/launch-secrets.js +2 -1
  279. package/dist/host/sharing/current.js +2 -6
  280. package/dist/host/storage/contained/check.d.ts +9 -0
  281. package/dist/host/storage/contained/check.js +37 -0
  282. package/dist/host/storage/contained/contained-storage.d.ts +66 -0
  283. package/dist/host/storage/contained/contained-storage.js +168 -0
  284. package/dist/host/storage/contained/disk-port.d.ts +43 -0
  285. package/dist/host/storage/contained/disk-port.js +122 -0
  286. package/dist/host/storage/contained/index.d.ts +9 -0
  287. package/dist/host/storage/contained/index.js +8 -0
  288. package/dist/host/storage/contained/layout.d.ts +28 -0
  289. package/dist/host/storage/contained/layout.js +45 -0
  290. package/dist/host/storage/contained/resolve.d.ts +4 -0
  291. package/dist/host/storage/contained/resolve.js +30 -0
  292. package/dist/host/storage/contained/setting.d.ts +1 -0
  293. package/dist/host/storage/contained/setting.js +5 -0
  294. package/dist/host/storage/contained/state.d.ts +89 -0
  295. package/dist/host/storage/contained/state.js +166 -0
  296. package/dist/host/storage/contained/transfer.d.ts +24 -0
  297. package/dist/host/storage/contained/transfer.js +121 -0
  298. package/dist/host/storage/index.d.ts +2 -0
  299. package/dist/host/storage/index.js +2 -0
  300. package/dist/host/storage/providers/contained.d.ts +15 -0
  301. package/dist/host/storage/providers/contained.js +39 -0
  302. package/dist/host/storage/providers/folder.d.ts +12 -0
  303. package/dist/host/storage/providers/folder.js +20 -0
  304. package/dist/host/storage/providers/index.d.ts +4 -0
  305. package/dist/host/storage/providers/index.js +3 -0
  306. package/dist/host/storage/providers/registry.d.ts +9 -0
  307. package/dist/host/storage/providers/registry.js +14 -0
  308. package/dist/host/storage/providers/types.d.ts +33 -0
  309. package/dist/host/storage/providers/types.js +1 -0
  310. package/dist/host/tools/conpty.js +3 -2
  311. package/dist/host/tools/windows-terminal.js +8 -7
  312. package/dist/host/vpn/index.d.ts +1 -1
  313. package/dist/host/vpn/index.js +1 -1
  314. package/dist/host/vpn/prepare.d.ts +2 -0
  315. package/dist/host/vpn/prepare.js +63 -2
  316. package/dist/host/web/browser.d.ts +2 -0
  317. package/dist/host/web/browser.js +14 -1
  318. package/dist/host/web/index.d.ts +3 -2
  319. package/dist/host/web/index.js +3 -2
  320. package/dist/host/web/rpc.d.ts +24 -0
  321. package/dist/host/web/rpc.js +149 -0
  322. package/dist/host/web/runner.d.ts +2 -0
  323. package/dist/host/web/runner.js +1 -2
  324. package/dist/host/web/server.d.ts +7 -0
  325. package/dist/host/web/server.js +23 -3
  326. package/dist/runtime/agent.js +83 -18
  327. package/dist/runtime/daemon.js +1805 -1221
  328. package/dist/runtime/db.js +83 -18
  329. package/dist/runtime/main.js +779 -219
  330. package/dist/runtime/netproxy.js +73 -11
  331. package/dist/runtime/view.js +91 -16
  332. package/dist/selftest/agent-paths.test.js +11 -1
  333. package/dist/selftest/app.test.d.ts +2 -0
  334. package/dist/selftest/app.test.js +324 -0
  335. package/dist/selftest/channel.test.js +13 -0
  336. package/dist/selftest/cli.test.js +2 -1
  337. package/dist/selftest/config.test.js +59 -0
  338. package/dist/selftest/contained.test.d.ts +2 -0
  339. package/dist/selftest/contained.test.js +544 -0
  340. package/dist/selftest/credentials.test.js +1 -1
  341. package/dist/selftest/engine.test.d.ts +2 -0
  342. package/dist/selftest/engine.test.js +127 -0
  343. package/dist/selftest/guest-boot.test.js +47 -1
  344. package/dist/selftest/hcs.test.d.ts +2 -0
  345. package/dist/selftest/hcs.test.js +482 -0
  346. package/dist/selftest/heavy-load.test.d.ts +2 -0
  347. package/dist/selftest/heavy-load.test.js +355 -0
  348. package/dist/selftest/index.js +12 -0
  349. package/dist/selftest/layout.test.js +12 -0
  350. package/dist/selftest/menu-perf.test.d.ts +2 -0
  351. package/dist/selftest/menu-perf.test.js +248 -0
  352. package/dist/selftest/menu-screens.js +4 -2
  353. package/dist/selftest/menu.test.js +36 -8
  354. package/dist/selftest/network.test.js +20 -1
  355. package/dist/selftest/support/engine-cases.d.ts +8 -0
  356. package/dist/selftest/support/engine-cases.js +65 -0
  357. package/dist/selftest/support/engine-golden.d.ts +3 -0
  358. package/dist/selftest/support/engine-golden.js +66 -0
  359. package/dist/selftest/support/fixtures.d.ts +8 -1
  360. package/dist/selftest/support/hcs-probes.d.ts +17 -0
  361. package/dist/selftest/support/hcs-probes.js +41 -0
  362. package/dist/selftest/vpn.test.js +136 -3
  363. package/dist/selftest/web.test.js +101 -3
  364. package/dist/shared/channel/run-dir.d.ts +4 -1
  365. package/dist/shared/channel/run-dir.js +7 -1
  366. package/dist/shared/channel/schema.d.ts +35 -1
  367. package/dist/shared/channel/schema.js +27 -0
  368. package/dist/shared/channel/secrets.d.ts +1 -0
  369. package/dist/shared/channel/secrets.js +6 -0
  370. package/dist/shared/io/copy-tree.d.ts +7 -0
  371. package/dist/shared/io/copy-tree.js +45 -0
  372. package/dist/shared/io/index.d.ts +2 -0
  373. package/dist/shared/io/index.js +2 -0
  374. package/dist/shared/io/robocopy-result.d.ts +6 -0
  375. package/dist/shared/io/robocopy-result.js +23 -0
  376. package/dist/shared/memory/index.d.ts +1 -0
  377. package/dist/shared/memory/index.js +1 -0
  378. package/dist/shared/memory/policy.d.ts +38 -0
  379. package/dist/shared/memory/policy.js +63 -0
  380. package/dist/shared/network/firewall-rules.d.ts +8 -0
  381. package/dist/shared/network/firewall-rules.js +28 -0
  382. package/dist/shared/pty/output-filter.d.ts +14 -1
  383. package/dist/shared/pty/output-filter.js +22 -4
  384. package/dist/shared/pty/terminal.d.ts +4 -1
  385. package/dist/shared/pty/terminal.js +4 -2
  386. package/dist/shared/system.d.ts +1 -0
  387. package/dist/shared/system.js +1 -0
  388. package/dist/shared/vpn/download.d.ts +16 -0
  389. package/dist/shared/vpn/download.js +16 -0
  390. package/dist/shared/vpn/wireguard.d.ts +51 -0
  391. package/dist/shared/vpn/wireguard.js +227 -0
  392. package/dist/sync/sync-cycle.js +5 -5
  393. package/dist/sync/watcher.d.ts +13 -0
  394. package/dist/sync/watcher.js +92 -3
  395. package/dist/web/index.html +4 -3
  396. package/dist/web/main-NRRS5O6Z.js +157 -0
  397. package/dist/web/main-T5DMCHYV.css +1 -0
  398. package/native/csharp/HcsHost/AssemblyInfo.cs +14 -0
  399. package/native/csharp/HcsHost/Guard.cs +100 -0
  400. package/native/csharp/HcsHost/Hcs.cs +256 -0
  401. package/native/csharp/HcsHost/Json.cs +78 -0
  402. package/native/csharp/HcsHost/Program.cs +185 -0
  403. package/native/csharp/HcsHost/VirtualDisk.cs +95 -0
  404. package/native/csharp/HostTools/AssemblyInfo.cs +14 -0
  405. package/native/csharp/HostTools/MemoryStatus.cs +128 -0
  406. package/native/csharp/HostTools/Program.cs +58 -17
  407. package/native/scripts/check-contained.ps1 +28 -0
  408. package/native/scripts/contained-common.ps1 +241 -0
  409. package/native/scripts/dismount-contained.ps1 +66 -0
  410. package/native/scripts/memory-status.ps1 +42 -0
  411. package/native/scripts/mount-contained.ps1 +139 -0
  412. package/native/scripts/run-elevated.ps1 +17 -4
  413. package/native/scripts/stop-events.ps1 +23 -8
  414. package/package.json +9 -2
  415. package/sandbox/csharp/MemGov.cs +466 -0
  416. package/sandbox/csharp/PtyHost.cs +111 -5
  417. package/sandbox/scripts/new-shortcuts.ps1 +3 -1
  418. package/schemas/config.schema.json +66 -8
  419. package/schemas/sandbox-config.schema.json +3 -3
  420. package/dist/cli/commands/sessions/control.d.ts +0 -4
  421. package/dist/cli/commands/sessions/control.js +0 -66
  422. package/dist/cli/commands/sessions/list.d.ts +0 -2
  423. package/dist/cli/commands/sessions/list.js +0 -48
  424. package/dist/cli/commands/sessions/status.d.ts +0 -4
  425. package/dist/cli/commands/sessions/status.js +0 -114
  426. package/dist/cli/commands/sessions/window.d.ts +0 -3
  427. package/dist/cli/commands/sessions/window.js +0 -18
  428. package/dist/cli/menu/settings/path-kind.js +0 -44
  429. package/dist/web/main-CXESL347.js +0 -45
  430. package/dist/web/main-VLR7DVQ4.css +0 -1
  431. /package/dist/{cli/menu/settings → app/kernel}/schema-node.d.ts +0 -0
  432. /package/dist/{cli/menu/settings → app/kernel}/schema-node.js +0 -0
@@ -25408,6 +25408,9 @@ var HarnessSchema = external_exports.strictObject({
25408
25408
  localState: external_exports.record(external_exports.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/), SubfolderSchema).optional().describe(
25409
25409
  "Environment variable -> folder below the agent's own state folder (state\\<agent>) for SQLite databases. SQLite cannot run in a mapped folder, so the agent runs from a copy on the sandbox's disk (the variable points to it) that is copied from and back to that folder."
25410
25410
  ),
25411
+ bootReset: external_exports.array(SubfolderSchema).max(32).optional().describe(
25412
+ "Files and folders below the agent's own state folder (state\\<agent>) that only work on the machine that wrote them (keys sealed with Windows DPAPI, local accounts it created). Every sandbox is a new machine, so they are deleted at each boot and the agent sets them up again."
25413
+ ),
25411
25414
  resumeArguments: StringsSchema.optional().describe(
25412
25415
  "Arguments used when the agent is restarted in place (e.g. after an account switch) so it resumes the conversation."
25413
25416
  ),
@@ -25485,6 +25488,9 @@ var MappingSchema = external_exports.strictObject({
25485
25488
  optional: external_exports.boolean().optional().describe("true = skip it quietly when the host folder does not exist.")
25486
25489
  });
25487
25490
  var SandboxSchema = external_exports.strictObject({
25491
+ engine: external_exports.enum(["windows-sandbox", "hcs"]).describe(
25492
+ '(alpha) What runs the sandbox. "windows-sandbox" = Windows Sandbox (the default: desktop, Windows Terminal, GPU, clipboard, audio, printers). "hcs" = a headless Hyper-V isolated Server Core container for agents (no desktop, GPU or clipboard); it needs Windows features and an image on this PC (sandbox engine check hcs lists what is missing), and starting it is not enabled yet in this alpha. sandbox engine shows what each engine can do. Yours only: a project file (.sandbox-config.json) cannot set it.'
25493
+ ),
25488
25494
  memoryMb: external_exports.union([external_exports.literal("auto"), external_exports.number().int().min(2048)]).describe('Sandbox RAM in MB (>= 2048), or "auto": free RAM minus reserveHostMb, capped at maxMemoryMb.'),
25489
25495
  maxMemoryMb: external_exports.number().int().positive().describe('Upper limit for memoryMb "auto".'),
25490
25496
  maxMemoryPercent: external_exports.number().int().min(10).max(100).describe(`memoryMb "auto" never takes more than this share of this PC's total RAM (percent).`),
@@ -25494,10 +25500,22 @@ var SandboxSchema = external_exports.strictObject({
25494
25500
  pageFileMb: external_exports.number().int().min(0).max(262144).describe(
25495
25501
  `Size of the sandbox's paging file in MB, created at full size when it starts so it never grows while builds run (8 GB of its disk always stays free). Windows Sandbox starts with about 1 GB: parallel builds then fail with "The paging file is too small", and Windows grows the file under load. 0 = leave Windows' own.`
25496
25502
  ),
25497
- reserveHostMb: external_exports.number().int().nonnegative().describe('RAM always left for this PC when memoryMb is "auto".'),
25498
- vGpu: external_exports.boolean().describe("Virtual GPU. Off by default: Microsoft notes it widens the sandbox attack surface."),
25503
+ reserveHostMb: external_exports.number().int().nonnegative().describe(
25504
+ '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.'
25505
+ ),
25506
+ agentMemoryHeadroomMb: external_exports.union([external_exports.literal("auto"), external_exports.literal("none"), external_exports.number().int().min(0)]).describe(
25507
+ 'Memory kept out of the agents reach inside the sandbox, in MB: everything the agents start (their builds, tests, tools) together may use at most the sandbox memory minus this; a runaway parallel build then gets out-of-memory errors in its own session instead of freezing or crashing the whole sandbox. "auto" = the larger of 2048 MB and 10 % of the sandbox memory; "none" = no limit. Yours only: a project file cannot change it.'
25508
+ ),
25509
+ pressureResponse: external_exports.boolean().describe(
25510
+ "When the sandbox (or this PC) runs low on memory, slow the heaviest build programs down (lower priority) and, if that is not enough, pause the biggest compiler for a few seconds at a time, so heavy parallel builds slow down instead of closing the sandbox. Never touches the agents themselves. Yours only: a project file cannot change it."
25511
+ ),
25512
+ vGpu: external_exports.boolean().describe(
25513
+ "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)."
25514
+ ),
25499
25515
  networking: external_exports.boolean().describe("Internet access. false is the only hard network isolation Windows Sandbox offers."),
25500
- clipboard: external_exports.boolean().describe("Shared clipboard between this PC and the sandbox."),
25516
+ clipboard: external_exports.boolean().describe(
25517
+ "Shared clipboard between this PC and the sandbox. Also lets an agent's copy (in sandbox attach) reach this PC's clipboard."
25518
+ ),
25501
25519
  audioInput: external_exports.boolean().describe("Microphone access."),
25502
25520
  videoInput: external_exports.boolean().describe("Camera access."),
25503
25521
  printerRedirection: external_exports.boolean().describe("Printers from this PC."),
@@ -26573,24 +26591,25 @@ var ResumeSchema = external_exports.strictObject({
26573
26591
  // src/core/schema/web.ts
26574
26592
  var WebSchema = external_exports.strictObject({
26575
26593
  enabled: external_exports.boolean().describe(
26576
- "(Beta) Allow the web UI: your sandbox sessions in a browser on this PC. Off by default, and nothing starts it by itself yet: sandbox web start works either way and runs it until sandbox web stop (or a restart of the PC)."
26594
+ "(Beta) The web UI: your sandbox sessions in a browser on this PC (http://127.0.0.1:<port>, this PC only). On: every sandbox start also starts it in the background (it keeps running until sandbox web stop or a restart of the PC). Off: only sandbox web start runs it. Open it signed in with sandbox web open."
26577
26595
  ),
26578
- port: external_exports.number().int().min(1024).max(65535).describe("Port of the web UI on 127.0.0.1 (this PC only). Pick another when it is taken.")
26596
+ port: external_exports.number().int().min(1024).max(65535).describe("Port of the web UI on 127.0.0.1 (this PC only). Pick another when it is taken."),
26597
+ openOnLaunch: external_exports.boolean().describe("(Beta) With the web UI on: open it in your browser, already signed in, every time a sandbox starts.")
26579
26598
  });
26580
26599
 
26581
26600
  // src/core/schema/vpn.ts
26582
- var VPN_PROVIDERS = ["nordvpn", "openvpn-file"];
26601
+ var VPN_PROVIDERS = ["nordvpn", "openvpn-file", "wireguard-file"];
26583
26602
  var VpnSchema = external_exports.strictObject({
26584
26603
  enabled: external_exports.boolean().describe(
26585
- "Send the sandbox's traffic through a VPN. Only the sandbox: your PC's own connection is untouched. Needs a saved login first (sandbox vpn login). The agent in the sandbox can read that login and can turn the tunnel off (it is the administrator there)."
26604
+ "(Alpha: not yet tried on a real PC) Send the sandbox's traffic through a VPN. Only the sandbox: your PC's own connection is untouched. Needs a saved login first (sandbox vpn login). The agent in the sandbox can read that login and can turn the tunnel off (it is the administrator there)."
26586
26605
  ),
26587
26606
  provider: external_exports.enum(VPN_PROVIDERS).describe(
26588
- "nordvpn: a recommended NordVPN server is picked at every launch. openvpn-file: your own .ovpn file (configFile)."
26607
+ "nordvpn: a recommended NordVPN server is picked at every launch. openvpn-file: your own .ovpn file (configFile). wireguard-file: your own WireGuard .conf (configFile), e.g. from your company."
26589
26608
  ),
26590
26609
  protocol: external_exports.enum(["udp", "tcp"]).describe("udp is faster; tcp gets through networks that block udp."),
26591
26610
  country: external_exports.string().regex(/^([A-Za-z][A-Za-z .'-]{0,39})?$/, "a country name or code like uk or Germany").describe("nordvpn: the country of the server, e.g. uk, us or Germany. Empty = the best server anywhere."),
26592
26611
  configFile: external_exports.string().describe(
26593
- "openvpn-file: the .ovpn file on this PC (its certificates inside it). Files that run programs (script-security, up, down, plugin ...) are refused. A project's file can never set this."
26612
+ "openvpn-file / wireguard-file: the .ovpn or .conf file on this PC (an .ovpn has its certificates inside it). Files that run programs (script-security, up, down, plugin, PostUp ...) are refused. A WireGuard file holds your private key: it is read when a sandbox starts and handed over in a one-shot file. A project's file can never set this."
26594
26613
  ),
26595
26614
  killSwitch: external_exports.boolean().describe(
26596
26615
  "Block all traffic that does not go through the tunnel: when the tunnel cannot start, the sandbox stays offline instead of using your normal connection. A project can only turn this on, never off."
@@ -26617,6 +26636,10 @@ var ConfigSchema = external_exports.strictObject({
26617
26636
  markSandboxFiles: external_exports.boolean().describe(
26618
26637
  `Programs and scripts (.exe, .ps1, .bat, .cmd, .msi, .lnk ...) that appear or change in your project while a sandbox runs get Windows' "downloaded from the internet" mark, so SmartScreen and PowerShell ask before they run on this PC.`
26619
26638
  ),
26639
+ contained: external_exports.enum(["off", "vhdx"]).describe(
26640
+ '(beta) Keep the sandbox tools, state and logs inside one disk image file (vhdx) instead of loose folders, so scanning programs on this PC see one file. Not yet tried on a real PC. Turn it on with sandbox storage contained on (it moves your files and asks first); Windows asks for permission to mount the image when a sandbox starts. "off" = loose folders, as always. Yours only: a project file (.sandbox-config.json) cannot set it.'
26641
+ ),
26642
+ containedMaxGb: external_exports.number().int().min(8).max(4096).describe("(beta) Largest size, in GB, the disk image of storage.contained may grow to."),
26620
26643
  warnDataGb: external_exports.number().min(0).describe(
26621
26644
  "Say at launch when the persisted data (tools, databases, logins) is bigger than this many GB; 0 = never. sandbox data shows what takes the space."
26622
26645
  )
@@ -26660,7 +26683,13 @@ var LocalOverridesSchema = external_exports.strictObject({
26660
26683
  "Scripts (.ps1 / .mjs / .cmd, relative to this file) run inside the sandbox before the agent."
26661
26684
  ),
26662
26685
  // This PC's resources are yours to share: CPU and paging file (this PC's disk) are not a project's to set.
26663
- sandbox: SandboxSchema.omit({ cpuLimit: true, pageFileMb: true }).partial(),
26686
+ sandbox: SandboxSchema.omit({
26687
+ cpuLimit: true,
26688
+ pageFileMb: true,
26689
+ engine: true,
26690
+ agentMemoryHeadroomMb: true,
26691
+ pressureResponse: true
26692
+ }).partial(),
26664
26693
  // A project may block more (the LAN, hosts); it never opens hosts, ports, DNS or a proxy.
26665
26694
  network: NetworkSchema.pick({ blockPrivateRanges: true, blockHosts: true }).partial(),
26666
26695
  // A project may turn the kill switch on, never off, and never choose a VPN, a server, a file or a login.
@@ -26769,8 +26798,34 @@ var GuestRequestSchema = external_exports.discriminatedUnion("kind", [
26769
26798
  cwd: Text().optional(),
26770
26799
  createdAt: TimeSchema
26771
26800
  }),
26772
- external_exports.strictObject({ kind: external_exports.literal("ping"), id: IdSchema, createdAt: TimeSchema })
26801
+ external_exports.strictObject({ kind: external_exports.literal("ping"), id: IdSchema, createdAt: TimeSchema }),
26802
+ /**
26803
+ * The PC's own memory or CPU is running low (the host watchdog): the sandbox slows its heaviest builds down for
26804
+ * `seconds` (it never stops them) so Windows does not have to close it. Repeated while the PC stays low.
26805
+ */
26806
+ external_exports.strictObject({
26807
+ kind: external_exports.literal("pressure"),
26808
+ id: IdSchema,
26809
+ reason: Text(300),
26810
+ seconds: external_exports.number().int().min(10).max(300),
26811
+ createdAt: TimeSchema
26812
+ })
26773
26813
  ]);
26814
+ var PressureStatusSchema = external_exports.object({
26815
+ level: external_exports.enum(["ok", "throttled", "suspending"]),
26816
+ profile: external_exports.enum(["normal", "gentle"]),
26817
+ /** Share of the sandbox's RAM still free and of its commit limit in use (percent). */
26818
+ ramFreePercent: external_exports.number().int().min(0).max(100),
26819
+ commitPercent: external_exports.number().int().min(0).max(100),
26820
+ /** Programs running at lower priority because of it. */
26821
+ lowered: external_exports.number().int().min(0).max(1024),
26822
+ /** Programs paused right now (name, process id, seconds left). */
26823
+ paused: external_exports.array(external_exports.object({ name: Text(64), pid: external_exports.number().int(), seconds: external_exports.number().int().min(0).max(60) })).max(8),
26824
+ /** The PC itself asked for slowing down (its memory or CPU is low). */
26825
+ pcLow: external_exports.boolean(),
26826
+ lastAction: Text(300),
26827
+ updatedAt: TimeSchema
26828
+ });
26774
26829
  var GuestResponseSchema = external_exports.object({
26775
26830
  id: IdSchema,
26776
26831
  ok: external_exports.boolean(),
@@ -26950,6 +27005,8 @@ var RunDir = class {
26950
27005
  root;
26951
27006
  sandboxFile;
26952
27007
  vpnFile;
27008
+ /** What the memory governor in the sandbox is doing (pressure.json). */
27009
+ pressureFile;
26953
27010
  requestsDir;
26954
27011
  responsesDir;
26955
27012
  sessionsDir;
@@ -26962,6 +27019,7 @@ var RunDir = class {
26962
27019
  this.root = path3.join(dataDir2, "run");
26963
27020
  this.sandboxFile = path3.join(this.root, "sandbox.json");
26964
27021
  this.vpnFile = path3.join(this.root, "vpn.json");
27022
+ this.pressureFile = path3.join(this.root, "pressure.json");
26965
27023
  this.requestsDir = path3.join(this.root, "requests");
26966
27024
  this.responsesDir = path3.join(this.root, "responses");
26967
27025
  this.sessionsDir = path3.join(this.root, "sessions");
@@ -26990,6 +27048,9 @@ var RunDir = class {
26990
27048
  readVpnStatus() {
26991
27049
  return readValid(VpnStatusSchema, this.vpnFile);
26992
27050
  }
27051
+ readPressure() {
27052
+ return readValid(PressureStatusSchema, this.pressureFile);
27053
+ }
26993
27054
  readSession(id) {
26994
27055
  return readValid(SessionStatusSchema, this.sessionFile(id));
26995
27056
  }
@@ -27075,6 +27136,7 @@ var SYSTEM = {
27075
27136
  shutdown: () => system32("shutdown.exe"),
27076
27137
  dism: () => system32("Dism.exe"),
27077
27138
  msiexec: () => system32("msiexec.exe"),
27139
+ sc: () => system32("sc.exe"),
27078
27140
  /** The .NET Framework C# compiler that ships with Windows (C# 5). */
27079
27141
  csc: () => path5.join(systemRoot(), "Microsoft.NET", "Framework64", "v4.0.30319", "csc.exe")
27080
27142
  };
@@ -5622,7 +5622,14 @@ var KEPT_OSC = (body) => {
5622
5622
  return n <= 2 || n === 8 || n === 133 || n === 9 && body.startsWith(number4[1] + ";4;");
5623
5623
  };
5624
5624
  var MAX_KEPT_STRING = 4096;
5625
+ var MAX_CLIPBOARD_STRING = 1024 * 1024;
5626
+ var CLIPBOARD_WRITE = /^0{0,2}52;[cpqs0-7]{0,8};[A-Za-z0-9+/=]*$/;
5625
5627
  var OutputFilter = class {
5628
+ constructor(options = {}) {
5629
+ this.options = options;
5630
+ this.maxString = options.clipboardWrites ? MAX_CLIPBOARD_STRING : MAX_KEPT_STRING;
5631
+ }
5632
+ options;
5626
5633
  /**
5627
5634
  * text: normal output; esc: after ESC; c2: after a 0xC2 lead byte; string: inside an OSC/DCS/...; stringEsc /
5628
5635
  * stringC2: a possible terminator inside one.
@@ -5630,8 +5637,14 @@ var OutputFilter = class {
5630
5637
  state = "text";
5631
5638
  /** The string being read: an OSC worth keeping is collected until its terminator; null = being dropped. */
5632
5639
  body = null;
5640
+ maxString;
5641
+ /** An OSC that may pass: a short title, link, progress or mark, or (when allowed) a clipboard write. */
5642
+ kept(body) {
5643
+ if (this.options.clipboardWrites && CLIPBOARD_WRITE.test(body)) return true;
5644
+ return body.length <= MAX_KEPT_STRING && KEPT_OSC(body);
5645
+ }
5633
5646
  push(chunk) {
5634
- const out = Buffer.allocUnsafe(chunk.length + MAX_KEPT_STRING + 8);
5647
+ const out = Buffer.allocUnsafe(chunk.length + (this.body?.length ?? 0) + 8);
5635
5648
  let n = 0;
5636
5649
  const put = (...bytes) => {
5637
5650
  for (const b of bytes) out[n++] = b;
@@ -5651,7 +5664,7 @@ var OutputFilter = class {
5651
5664
  };
5652
5665
  const endString = (terminator) => {
5653
5666
  const body = this.body && Buffer.from(this.body).toString("latin1");
5654
- if (body !== null && KEPT_OSC(body)) {
5667
+ if (body !== null && this.kept(body)) {
5655
5668
  put(27, 93);
5656
5669
  out.write(body, n, "latin1");
5657
5670
  n += body.length;
@@ -5661,7 +5674,7 @@ var OutputFilter = class {
5661
5674
  this.state = "text";
5662
5675
  };
5663
5676
  const collect = (b) => {
5664
- if (this.body && this.body.push(b) > MAX_KEPT_STRING) this.body = null;
5677
+ if (this.body && this.body.push(b) > this.maxString) this.body = null;
5665
5678
  };
5666
5679
  for (const b of chunk) {
5667
5680
  switch (this.state) {
@@ -5751,6 +5764,7 @@ var SYSTEM = {
5751
5764
  shutdown: () => system32("shutdown.exe"),
5752
5765
  dism: () => system32("Dism.exe"),
5753
5766
  msiexec: () => system32("msiexec.exe"),
5767
+ sc: () => system32("sc.exe"),
5754
5768
  /** The .NET Framework C# compiler that ships with Windows (C# 5). */
5755
5769
  csc: () => path.join(systemRoot(), "Microsoft.NET", "Framework64", "v4.0.30319", "csc.exe")
5756
5770
  };
@@ -5861,7 +5875,7 @@ function runTerminalClient(socket, token, options = {}) {
5861
5875
  return new Promise((resolve) => {
5862
5876
  let done = false;
5863
5877
  const reader = new FrameReader();
5864
- const filter = new OutputFilter();
5878
+ const filter = new OutputFilter({ clipboardWrites: options.clipboardWrites });
5865
5879
  let sent = size();
5866
5880
  let resizeTimer;
5867
5881
  let vtInput;
@@ -25745,6 +25759,9 @@ var HarnessSchema = external_exports.strictObject({
25745
25759
  localState: external_exports.record(external_exports.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/), SubfolderSchema).optional().describe(
25746
25760
  "Environment variable -> folder below the agent's own state folder (state\\<agent>) for SQLite databases. SQLite cannot run in a mapped folder, so the agent runs from a copy on the sandbox's disk (the variable points to it) that is copied from and back to that folder."
25747
25761
  ),
25762
+ bootReset: external_exports.array(SubfolderSchema).max(32).optional().describe(
25763
+ "Files and folders below the agent's own state folder (state\\<agent>) that only work on the machine that wrote them (keys sealed with Windows DPAPI, local accounts it created). Every sandbox is a new machine, so they are deleted at each boot and the agent sets them up again."
25764
+ ),
25748
25765
  resumeArguments: StringsSchema.optional().describe(
25749
25766
  "Arguments used when the agent is restarted in place (e.g. after an account switch) so it resumes the conversation."
25750
25767
  ),
@@ -25822,6 +25839,9 @@ var MappingSchema = external_exports.strictObject({
25822
25839
  optional: external_exports.boolean().optional().describe("true = skip it quietly when the host folder does not exist.")
25823
25840
  });
25824
25841
  var SandboxSchema = external_exports.strictObject({
25842
+ engine: external_exports.enum(["windows-sandbox", "hcs"]).describe(
25843
+ '(alpha) What runs the sandbox. "windows-sandbox" = Windows Sandbox (the default: desktop, Windows Terminal, GPU, clipboard, audio, printers). "hcs" = a headless Hyper-V isolated Server Core container for agents (no desktop, GPU or clipboard); it needs Windows features and an image on this PC (sandbox engine check hcs lists what is missing), and starting it is not enabled yet in this alpha. sandbox engine shows what each engine can do. Yours only: a project file (.sandbox-config.json) cannot set it.'
25844
+ ),
25825
25845
  memoryMb: external_exports.union([external_exports.literal("auto"), external_exports.number().int().min(2048)]).describe('Sandbox RAM in MB (>= 2048), or "auto": free RAM minus reserveHostMb, capped at maxMemoryMb.'),
25826
25846
  maxMemoryMb: external_exports.number().int().positive().describe('Upper limit for memoryMb "auto".'),
25827
25847
  maxMemoryPercent: external_exports.number().int().min(10).max(100).describe(`memoryMb "auto" never takes more than this share of this PC's total RAM (percent).`),
@@ -25831,10 +25851,22 @@ var SandboxSchema = external_exports.strictObject({
25831
25851
  pageFileMb: external_exports.number().int().min(0).max(262144).describe(
25832
25852
  `Size of the sandbox's paging file in MB, created at full size when it starts so it never grows while builds run (8 GB of its disk always stays free). Windows Sandbox starts with about 1 GB: parallel builds then fail with "The paging file is too small", and Windows grows the file under load. 0 = leave Windows' own.`
25833
25853
  ),
25834
- reserveHostMb: external_exports.number().int().nonnegative().describe('RAM always left for this PC when memoryMb is "auto".'),
25835
- vGpu: external_exports.boolean().describe("Virtual GPU. Off by default: Microsoft notes it widens the sandbox attack surface."),
25854
+ reserveHostMb: external_exports.number().int().nonnegative().describe(
25855
+ '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.'
25856
+ ),
25857
+ agentMemoryHeadroomMb: external_exports.union([external_exports.literal("auto"), external_exports.literal("none"), external_exports.number().int().min(0)]).describe(
25858
+ 'Memory kept out of the agents reach inside the sandbox, in MB: everything the agents start (their builds, tests, tools) together may use at most the sandbox memory minus this; a runaway parallel build then gets out-of-memory errors in its own session instead of freezing or crashing the whole sandbox. "auto" = the larger of 2048 MB and 10 % of the sandbox memory; "none" = no limit. Yours only: a project file cannot change it.'
25859
+ ),
25860
+ pressureResponse: external_exports.boolean().describe(
25861
+ "When the sandbox (or this PC) runs low on memory, slow the heaviest build programs down (lower priority) and, if that is not enough, pause the biggest compiler for a few seconds at a time, so heavy parallel builds slow down instead of closing the sandbox. Never touches the agents themselves. Yours only: a project file cannot change it."
25862
+ ),
25863
+ vGpu: external_exports.boolean().describe(
25864
+ "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)."
25865
+ ),
25836
25866
  networking: external_exports.boolean().describe("Internet access. false is the only hard network isolation Windows Sandbox offers."),
25837
- clipboard: external_exports.boolean().describe("Shared clipboard between this PC and the sandbox."),
25867
+ clipboard: external_exports.boolean().describe(
25868
+ "Shared clipboard between this PC and the sandbox. Also lets an agent's copy (in sandbox attach) reach this PC's clipboard."
25869
+ ),
25838
25870
  audioInput: external_exports.boolean().describe("Microphone access."),
25839
25871
  videoInput: external_exports.boolean().describe("Camera access."),
25840
25872
  printerRedirection: external_exports.boolean().describe("Printers from this PC."),
@@ -26910,24 +26942,25 @@ var ResumeSchema = external_exports.strictObject({
26910
26942
  // src/core/schema/web.ts
26911
26943
  var WebSchema = external_exports.strictObject({
26912
26944
  enabled: external_exports.boolean().describe(
26913
- "(Beta) Allow the web UI: your sandbox sessions in a browser on this PC. Off by default, and nothing starts it by itself yet: sandbox web start works either way and runs it until sandbox web stop (or a restart of the PC)."
26945
+ "(Beta) The web UI: your sandbox sessions in a browser on this PC (http://127.0.0.1:<port>, this PC only). On: every sandbox start also starts it in the background (it keeps running until sandbox web stop or a restart of the PC). Off: only sandbox web start runs it. Open it signed in with sandbox web open."
26914
26946
  ),
26915
- port: external_exports.number().int().min(1024).max(65535).describe("Port of the web UI on 127.0.0.1 (this PC only). Pick another when it is taken.")
26947
+ port: external_exports.number().int().min(1024).max(65535).describe("Port of the web UI on 127.0.0.1 (this PC only). Pick another when it is taken."),
26948
+ openOnLaunch: external_exports.boolean().describe("(Beta) With the web UI on: open it in your browser, already signed in, every time a sandbox starts.")
26916
26949
  });
26917
26950
 
26918
26951
  // src/core/schema/vpn.ts
26919
- var VPN_PROVIDERS = ["nordvpn", "openvpn-file"];
26952
+ var VPN_PROVIDERS = ["nordvpn", "openvpn-file", "wireguard-file"];
26920
26953
  var VpnSchema = external_exports.strictObject({
26921
26954
  enabled: external_exports.boolean().describe(
26922
- "Send the sandbox's traffic through a VPN. Only the sandbox: your PC's own connection is untouched. Needs a saved login first (sandbox vpn login). The agent in the sandbox can read that login and can turn the tunnel off (it is the administrator there)."
26955
+ "(Alpha: not yet tried on a real PC) Send the sandbox's traffic through a VPN. Only the sandbox: your PC's own connection is untouched. Needs a saved login first (sandbox vpn login). The agent in the sandbox can read that login and can turn the tunnel off (it is the administrator there)."
26923
26956
  ),
26924
26957
  provider: external_exports.enum(VPN_PROVIDERS).describe(
26925
- "nordvpn: a recommended NordVPN server is picked at every launch. openvpn-file: your own .ovpn file (configFile)."
26958
+ "nordvpn: a recommended NordVPN server is picked at every launch. openvpn-file: your own .ovpn file (configFile). wireguard-file: your own WireGuard .conf (configFile), e.g. from your company."
26926
26959
  ),
26927
26960
  protocol: external_exports.enum(["udp", "tcp"]).describe("udp is faster; tcp gets through networks that block udp."),
26928
26961
  country: external_exports.string().regex(/^([A-Za-z][A-Za-z .'-]{0,39})?$/, "a country name or code like uk or Germany").describe("nordvpn: the country of the server, e.g. uk, us or Germany. Empty = the best server anywhere."),
26929
26962
  configFile: external_exports.string().describe(
26930
- "openvpn-file: the .ovpn file on this PC (its certificates inside it). Files that run programs (script-security, up, down, plugin ...) are refused. A project's file can never set this."
26963
+ "openvpn-file / wireguard-file: the .ovpn or .conf file on this PC (an .ovpn has its certificates inside it). Files that run programs (script-security, up, down, plugin, PostUp ...) are refused. A WireGuard file holds your private key: it is read when a sandbox starts and handed over in a one-shot file. A project's file can never set this."
26931
26964
  ),
26932
26965
  killSwitch: external_exports.boolean().describe(
26933
26966
  "Block all traffic that does not go through the tunnel: when the tunnel cannot start, the sandbox stays offline instead of using your normal connection. A project can only turn this on, never off."
@@ -26954,6 +26987,10 @@ var ConfigSchema = external_exports.strictObject({
26954
26987
  markSandboxFiles: external_exports.boolean().describe(
26955
26988
  `Programs and scripts (.exe, .ps1, .bat, .cmd, .msi, .lnk ...) that appear or change in your project while a sandbox runs get Windows' "downloaded from the internet" mark, so SmartScreen and PowerShell ask before they run on this PC.`
26956
26989
  ),
26990
+ contained: external_exports.enum(["off", "vhdx"]).describe(
26991
+ '(beta) Keep the sandbox tools, state and logs inside one disk image file (vhdx) instead of loose folders, so scanning programs on this PC see one file. Not yet tried on a real PC. Turn it on with sandbox storage contained on (it moves your files and asks first); Windows asks for permission to mount the image when a sandbox starts. "off" = loose folders, as always. Yours only: a project file (.sandbox-config.json) cannot set it.'
26992
+ ),
26993
+ containedMaxGb: external_exports.number().int().min(8).max(4096).describe("(beta) Largest size, in GB, the disk image of storage.contained may grow to."),
26957
26994
  warnDataGb: external_exports.number().min(0).describe(
26958
26995
  "Say at launch when the persisted data (tools, databases, logins) is bigger than this many GB; 0 = never. sandbox data shows what takes the space."
26959
26996
  )
@@ -26997,7 +27034,13 @@ var LocalOverridesSchema = external_exports.strictObject({
26997
27034
  "Scripts (.ps1 / .mjs / .cmd, relative to this file) run inside the sandbox before the agent."
26998
27035
  ),
26999
27036
  // This PC's resources are yours to share: CPU and paging file (this PC's disk) are not a project's to set.
27000
- sandbox: SandboxSchema.omit({ cpuLimit: true, pageFileMb: true }).partial(),
27037
+ sandbox: SandboxSchema.omit({
27038
+ cpuLimit: true,
27039
+ pageFileMb: true,
27040
+ engine: true,
27041
+ agentMemoryHeadroomMb: true,
27042
+ pressureResponse: true
27043
+ }).partial(),
27001
27044
  // A project may block more (the LAN, hosts); it never opens hosts, ports, DNS or a proxy.
27002
27045
  network: NetworkSchema.pick({ blockPrivateRanges: true, blockHosts: true }).partial(),
27003
27046
  // A project may turn the kill switch on, never off, and never choose a VPN, a server, a file or a login.
@@ -27106,8 +27149,34 @@ var GuestRequestSchema = external_exports.discriminatedUnion("kind", [
27106
27149
  cwd: Text().optional(),
27107
27150
  createdAt: TimeSchema
27108
27151
  }),
27109
- external_exports.strictObject({ kind: external_exports.literal("ping"), id: IdSchema, createdAt: TimeSchema })
27152
+ external_exports.strictObject({ kind: external_exports.literal("ping"), id: IdSchema, createdAt: TimeSchema }),
27153
+ /**
27154
+ * The PC's own memory or CPU is running low (the host watchdog): the sandbox slows its heaviest builds down for
27155
+ * `seconds` (it never stops them) so Windows does not have to close it. Repeated while the PC stays low.
27156
+ */
27157
+ external_exports.strictObject({
27158
+ kind: external_exports.literal("pressure"),
27159
+ id: IdSchema,
27160
+ reason: Text(300),
27161
+ seconds: external_exports.number().int().min(10).max(300),
27162
+ createdAt: TimeSchema
27163
+ })
27110
27164
  ]);
27165
+ var PressureStatusSchema = external_exports.object({
27166
+ level: external_exports.enum(["ok", "throttled", "suspending"]),
27167
+ profile: external_exports.enum(["normal", "gentle"]),
27168
+ /** Share of the sandbox's RAM still free and of its commit limit in use (percent). */
27169
+ ramFreePercent: external_exports.number().int().min(0).max(100),
27170
+ commitPercent: external_exports.number().int().min(0).max(100),
27171
+ /** Programs running at lower priority because of it. */
27172
+ lowered: external_exports.number().int().min(0).max(1024),
27173
+ /** Programs paused right now (name, process id, seconds left). */
27174
+ paused: external_exports.array(external_exports.object({ name: Text(64), pid: external_exports.number().int(), seconds: external_exports.number().int().min(0).max(60) })).max(8),
27175
+ /** The PC itself asked for slowing down (its memory or CPU is low). */
27176
+ pcLow: external_exports.boolean(),
27177
+ lastAction: Text(300),
27178
+ updatedAt: TimeSchema
27179
+ });
27111
27180
  var GuestResponseSchema = external_exports.object({
27112
27181
  id: IdSchema,
27113
27182
  ok: external_exports.boolean(),
@@ -27189,6 +27258,8 @@ var RunDir = class {
27189
27258
  root;
27190
27259
  sandboxFile;
27191
27260
  vpnFile;
27261
+ /** What the memory governor in the sandbox is doing (pressure.json). */
27262
+ pressureFile;
27192
27263
  requestsDir;
27193
27264
  responsesDir;
27194
27265
  sessionsDir;
@@ -27201,6 +27272,7 @@ var RunDir = class {
27201
27272
  this.root = path3.join(dataDir2, "run");
27202
27273
  this.sandboxFile = path3.join(this.root, "sandbox.json");
27203
27274
  this.vpnFile = path3.join(this.root, "vpn.json");
27275
+ this.pressureFile = path3.join(this.root, "pressure.json");
27204
27276
  this.requestsDir = path3.join(this.root, "requests");
27205
27277
  this.responsesDir = path3.join(this.root, "responses");
27206
27278
  this.sessionsDir = path3.join(this.root, "sessions");
@@ -27229,6 +27301,9 @@ var RunDir = class {
27229
27301
  readVpnStatus() {
27230
27302
  return readValid(VpnStatusSchema, this.vpnFile);
27231
27303
  }
27304
+ readPressure() {
27305
+ return readValid(PressureStatusSchema, this.pressureFile);
27306
+ }
27232
27307
  readSession(id) {
27233
27308
  return readValid(SessionStatusSchema, this.sessionFile(id));
27234
27309
  }
@@ -27287,7 +27362,7 @@ async function viewSession(id) {
27287
27362
  return 1;
27288
27363
  }
27289
27364
  const socket = await connect({ ...session.attach, addresses: ["127.0.0.1"] });
27290
- const result = await runTerminalClient(socket, session.attach.token);
27365
+ const result = await runTerminalClient(socket, session.attach.token, { clipboardWrites: true });
27291
27366
  if (result.reason === "exit") console.log(session.harness + " exited with code " + result.exitCode + ".");
27292
27367
  else if (result.reason === "error") console.log("Session error: " + result.message);
27293
27368
  return result.reason === "exit" ? result.exitCode : 1;
@@ -5,7 +5,7 @@ import path from 'node:path';
5
5
  import { DEFAULTS, mergeConfig, validateConfig } from '../core/config/index.js';
6
6
  import { isWin } from '../core/util/index.js';
7
7
  import { SYSTEM } from '../shared/system.js';
8
- import { agentCommand, agentShims, isCopyableDatabaseFile, isDatabaseFile, localStateEntries, shimText, } from '../guest/agents/agent-files.js';
8
+ import { agentCommand, agentShims, bootResetPaths, isCopyableDatabaseFile, isDatabaseFile, localStateEntries, shimText, } from '../guest/agents/agent-files.js';
9
9
  import { appendMissing, expandVars, isPinnedNodeDir, parseRegPath, pathKey, planPath, rebuildPath, splitPath, } from '../guest/setup/path-plan.js';
10
10
  import { withReloadEnvironment } from '../host/tools/index.js';
11
11
  import { HarnessSchema } from '../core/schema/index.js';
@@ -48,6 +48,16 @@ export const agentPathsSuite = {
48
48
  t.check(HarnessSchema.safeParse({ ...DEFAULTS.harnesses.codex, localState: { X: '..\\up' } }).success === false, 'a local state folder cannot leave the agent state folder');
49
49
  t.equal(['state_5.sqlite', 'x.sqlite-wal', 'x.sqlite-shm', 'a.db', 'auth.json'].map(isDatabaseFile), [true, true, true, true, false], 'database files are told apart');
50
50
  t.equal(['state_5.sqlite', 'x.sqlite-wal', 'x.sqlite-shm'].map(isCopyableDatabaseFile), [true, true, false], 'the -shm file is not copied (SQLite rebuilds it)');
51
+ t.section('agent files sealed to the last sandbox');
52
+ t.equal(bootResetPaths(DEFAULTS.harnesses, 'C:\\AgentData\\state')
53
+ .filter((p) => p.agent === 'codex')
54
+ .map((p) => p.path), [
55
+ 'C:\\AgentData\\state\\codex\\.sandbox-secrets',
56
+ 'C:\\AgentData\\state\\codex\\.sandbox\\setup_marker.json',
57
+ 'C:\\AgentData\\state\\codex\\.sandbox\\deny_read_acl_state.json',
58
+ ], "codex's DPAPI-sealed sandbox users and setup marker are removed at boot (CryptUnprotectData otherwise)");
59
+ t.check(HarnessSchema.safeParse({ ...DEFAULTS.harnesses.codex, bootReset: ['..\\login'] }).success === false &&
60
+ HarnessSchema.safeParse({ ...DEFAULTS.harnesses.codex, bootReset: ['C:\\Windows'] }).success === false, 'bootReset takes only plain paths below the agent state folder');
51
61
  t.section('PATH planner');
52
62
  const present = new Set(['c:\\a', 'c:\\b', 'c:\\c\\d', 'c:\\nvm\\v24.1.0']);
53
63
  const exists = (f) => present.has(pathKey(f));
@@ -0,0 +1,2 @@
1
+ import type { Suite } from './support/suite.js';
2
+ export declare const appSuite: Suite;