windows-development-sandbox 1.0.5 → 1.4.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 (453) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +25 -8
  3. package/config.example.json +55 -5
  4. package/dist/api.js +2 -1
  5. package/dist/cli/args.d.ts +23 -0
  6. package/dist/cli/args.js +38 -4
  7. package/dist/cli/colors.d.ts +24 -0
  8. package/dist/cli/colors.js +42 -0
  9. package/dist/cli/commands/accounts.js +2 -2
  10. package/dist/cli/commands/agent-commands.d.ts +6 -0
  11. package/dist/cli/commands/agent-commands.js +61 -0
  12. package/dist/cli/commands/context.d.ts +2 -0
  13. package/dist/cli/commands/context.js +5 -1
  14. package/dist/cli/commands/data/clean.d.ts +15 -0
  15. package/dist/cli/commands/data/clean.js +106 -0
  16. package/dist/cli/commands/data/collect.d.ts +11 -0
  17. package/dist/cli/commands/data/collect.js +54 -0
  18. package/dist/cli/commands/data/index.d.ts +4 -0
  19. package/dist/cli/commands/data/index.js +45 -0
  20. package/dist/cli/commands/data/remove.d.ts +2 -0
  21. package/dist/cli/commands/data/remove.js +30 -0
  22. package/dist/cli/commands/index.d.ts +6 -4
  23. package/dist/cli/commands/index.js +6 -4
  24. package/dist/cli/commands/launch.d.ts +26 -2
  25. package/dist/cli/commands/launch.js +256 -42
  26. package/dist/cli/commands/maintenance.d.ts +2 -0
  27. package/dist/cli/commands/maintenance.js +67 -5
  28. package/dist/cli/commands/project.d.ts +29 -0
  29. package/dist/cli/commands/project.js +63 -0
  30. package/dist/cli/commands/projects.d.ts +14 -0
  31. package/dist/cli/commands/projects.js +146 -0
  32. package/dist/cli/commands/repair/checks.d.ts +2 -0
  33. package/dist/cli/commands/{repair.js → repair/checks.js} +19 -181
  34. package/dist/cli/commands/{repair.d.ts → repair/finders.d.ts} +0 -29
  35. package/dist/cli/commands/repair/finders.js +108 -0
  36. package/dist/cli/commands/repair/index.d.ts +12 -0
  37. package/dist/cli/commands/repair/index.js +61 -0
  38. package/dist/cli/commands/repair/types.d.ts +26 -0
  39. package/dist/cli/commands/repair/types.js +3 -0
  40. package/dist/cli/commands/restart.d.ts +6 -0
  41. package/dist/cli/commands/restart.js +85 -0
  42. package/dist/cli/commands/sessions.d.ts +2 -1
  43. package/dist/cli/commands/sessions.js +189 -45
  44. package/dist/cli/commands/setup/checks.d.ts +13 -0
  45. package/dist/cli/commands/setup/checks.js +71 -0
  46. package/dist/cli/commands/{setup.d.ts → setup/facts.d.ts} +1 -15
  47. package/dist/cli/commands/setup/facts.js +60 -0
  48. package/dist/cli/commands/setup/index.d.ts +2 -0
  49. package/dist/cli/commands/setup/index.js +43 -0
  50. package/dist/cli/commands/user-config.d.ts +8 -0
  51. package/dist/cli/commands/user-config.js +41 -0
  52. package/dist/cli/history.d.ts +11 -0
  53. package/dist/cli/history.js +21 -0
  54. package/dist/cli/index.d.ts +7 -1
  55. package/dist/cli/index.js +42 -15
  56. package/dist/cli/manifest.d.ts +8 -0
  57. package/dist/cli/manifest.js +40 -15
  58. package/dist/cli/menu/apps.d.ts +21 -0
  59. package/dist/cli/menu/apps.js +122 -0
  60. package/dist/cli/menu/command-form.d.ts +28 -0
  61. package/dist/cli/menu/command-form.js +219 -0
  62. package/dist/cli/menu/index.d.ts +26 -0
  63. package/dist/cli/menu/index.js +180 -0
  64. package/dist/cli/menu/settings/categories.d.ts +9 -0
  65. package/dist/cli/menu/settings/categories.js +28 -0
  66. package/dist/cli/menu/settings/config-file.d.ts +40 -0
  67. package/dist/cli/menu/settings/config-file.js +71 -0
  68. package/dist/cli/menu/settings/editors.d.ts +30 -0
  69. package/dist/cli/menu/settings/editors.js +305 -0
  70. package/dist/cli/menu/settings/index.d.ts +32 -0
  71. package/dist/cli/menu/settings/index.js +136 -0
  72. package/dist/cli/menu/settings/schema-node.d.ts +62 -0
  73. package/dist/cli/menu/settings/schema-node.js +104 -0
  74. package/dist/cli/menu/several.d.ts +20 -0
  75. package/dist/cli/menu/several.js +102 -0
  76. package/dist/cli/progress.d.ts +9 -0
  77. package/dist/cli/progress.js +49 -0
  78. package/dist/cli/tui/app.d.ts +39 -0
  79. package/dist/cli/tui/app.js +52 -0
  80. package/dist/cli/tui/dialogs.d.ts +57 -0
  81. package/dist/cli/tui/dialogs.js +162 -0
  82. package/dist/cli/tui/frame.d.ts +18 -0
  83. package/dist/cli/tui/frame.js +27 -0
  84. package/dist/cli/tui/index.d.ts +7 -0
  85. package/dist/cli/tui/index.js +8 -0
  86. package/dist/cli/tui/list-screen.d.ts +101 -0
  87. package/dist/cli/tui/list-screen.js +299 -0
  88. package/dist/cli/tui/terminal.d.ts +37 -0
  89. package/dist/cli/tui/terminal.js +89 -0
  90. package/dist/cli/tui/text.d.ts +20 -0
  91. package/dist/cli/tui/text.js +105 -0
  92. package/dist/cli/tui/theme.d.ts +45 -0
  93. package/dist/cli/tui/theme.js +30 -0
  94. package/dist/cli/validate.d.ts +17 -0
  95. package/dist/cli/validate.js +89 -0
  96. package/dist/core/config.js +12 -6
  97. package/dist/core/disk.d.ts +16 -0
  98. package/dist/core/disk.js +55 -0
  99. package/dist/core/local-config.d.ts +23 -0
  100. package/dist/core/local-config.js +79 -7
  101. package/dist/core/project-policy.d.ts +15 -0
  102. package/dist/core/project-policy.js +35 -0
  103. package/dist/core/prompt.d.ts +4 -0
  104. package/dist/core/prompt.js +15 -0
  105. package/dist/core/safe-paths.d.ts +4 -0
  106. package/dist/core/safe-paths.js +37 -0
  107. package/dist/core/schema/apps.d.ts +40 -0
  108. package/dist/core/schema/apps.js +27 -0
  109. package/dist/core/schema/common.d.ts +17 -0
  110. package/dist/core/schema/common.js +15 -0
  111. package/dist/core/schema/config.d.ts +659 -0
  112. package/dist/core/schema/config.js +75 -0
  113. package/dist/core/schema/databases.d.ts +33 -0
  114. package/dist/core/schema/databases.js +35 -0
  115. package/dist/core/schema/harness.d.ts +12 -0
  116. package/dist/core/schema/harness.js +17 -0
  117. package/dist/core/schema/json-schema.d.ts +5 -0
  118. package/dist/core/schema/json-schema.js +25 -0
  119. package/dist/core/schema/profile.d.ts +32 -0
  120. package/dist/core/schema/profile.js +31 -0
  121. package/dist/core/schema/projects.d.ts +9 -0
  122. package/dist/core/schema/projects.js +11 -0
  123. package/dist/core/schema/sandbox.d.ts +78 -0
  124. package/dist/core/schema/sandbox.js +64 -0
  125. package/dist/core/schema/toolchains.d.ts +96 -0
  126. package/dist/core/schema/toolchains.js +88 -0
  127. package/dist/core/schema.d.ts +6 -604
  128. package/dist/core/schema.js +8 -264
  129. package/dist/core/types.d.ts +35 -1
  130. package/dist/core/util.d.ts +9 -0
  131. package/dist/core/util.js +14 -3
  132. package/dist/core/workspace.d.ts +0 -5
  133. package/dist/core/workspace.js +33 -50
  134. package/dist/guest/apps/index.d.ts +10 -0
  135. package/dist/guest/apps/index.js +206 -0
  136. package/dist/guest/apps/resolvers.d.ts +8 -0
  137. package/dist/guest/apps/resolvers.js +90 -0
  138. package/dist/guest/audit-parse.d.ts +7 -0
  139. package/dist/guest/audit-parse.js +24 -0
  140. package/dist/guest/audit.d.ts +4 -0
  141. package/dist/guest/audit.js +47 -0
  142. package/dist/guest/boot-env.d.ts +4 -0
  143. package/dist/guest/boot-env.js +25 -0
  144. package/dist/guest/cmdline.d.ts +12 -0
  145. package/dist/guest/cmdline.js +23 -0
  146. package/dist/guest/daemon/exec.d.ts +5 -0
  147. package/dist/guest/daemon/exec.js +32 -0
  148. package/dist/guest/daemon/project.d.ts +14 -0
  149. package/dist/guest/daemon/project.js +132 -0
  150. package/dist/guest/daemon/relays.d.ts +1 -0
  151. package/dist/guest/daemon/relays.js +18 -0
  152. package/dist/guest/daemon/session.d.ts +13 -0
  153. package/dist/guest/daemon/session.js +139 -0
  154. package/dist/guest/daemon/shutdown.d.ts +1 -0
  155. package/dist/guest/daemon/shutdown.js +21 -0
  156. package/dist/guest/daemon/state.d.ts +17 -0
  157. package/dist/guest/daemon/state.js +31 -0
  158. package/dist/guest/daemon.js +12 -141
  159. package/dist/guest/db.js +18 -3
  160. package/dist/guest/env.d.ts +3 -0
  161. package/dist/guest/env.js +7 -3
  162. package/dist/guest/guide.d.ts +6 -2
  163. package/dist/guest/guide.js +5 -4
  164. package/dist/guest/helpers.d.ts +3 -0
  165. package/dist/guest/helpers.js +26 -0
  166. package/dist/guest/main.js +31 -8
  167. package/dist/guest/netproxy.d.ts +1 -0
  168. package/dist/guest/netproxy.js +100 -0
  169. package/dist/guest/ports.d.ts +6 -0
  170. package/dist/guest/ports.js +22 -0
  171. package/dist/guest/project-context.d.ts +7 -0
  172. package/dist/guest/project-context.js +10 -0
  173. package/dist/guest/project-env.d.ts +20 -0
  174. package/dist/guest/project-env.js +20 -0
  175. package/dist/guest/project-status.d.ts +5 -0
  176. package/dist/guest/project-status.js +17 -0
  177. package/dist/guest/ptyhost.d.ts +0 -18
  178. package/dist/guest/ptyhost.js +17 -65
  179. package/dist/guest/setup/agents.d.ts +5 -2
  180. package/dist/guest/setup/agents.js +22 -8
  181. package/dist/guest/setup/claude.d.ts +0 -4
  182. package/dist/guest/setup/claude.js +59 -5
  183. package/dist/guest/setup/environment.d.ts +13 -3
  184. package/dist/guest/setup/environment.js +14 -10
  185. package/dist/guest/setup/hooks.d.ts +9 -1
  186. package/dist/guest/setup/hooks.js +28 -14
  187. package/dist/guest/setup/network.d.ts +9 -0
  188. package/dist/guest/setup/network.js +97 -4
  189. package/dist/guest/setup/user.js +4 -0
  190. package/dist/guest/toolchains/catalogue.d.ts +4 -0
  191. package/dist/guest/toolchains/catalogue.js +2 -2
  192. package/dist/guest/toolchains/cli.js +25 -17
  193. package/dist/guest/toolchains/common.d.ts +18 -1
  194. package/dist/guest/toolchains/common.js +34 -11
  195. package/dist/guest/toolchains/databases/dynamodb.d.ts +8 -0
  196. package/dist/guest/toolchains/databases/dynamodb.js +52 -0
  197. package/dist/guest/toolchains/{databases.d.ts → databases/index.d.ts} +2 -3
  198. package/dist/guest/toolchains/databases/index.js +62 -0
  199. package/dist/guest/toolchains/databases/mongodb.d.ts +3 -0
  200. package/dist/guest/toolchains/databases/mongodb.js +31 -0
  201. package/dist/guest/toolchains/databases/mysql.d.ts +3 -0
  202. package/dist/guest/toolchains/databases/mysql.js +38 -0
  203. package/dist/guest/toolchains/databases/postgres.d.ts +5 -0
  204. package/dist/guest/toolchains/databases/postgres.js +38 -0
  205. package/dist/guest/toolchains/databases/redis.d.ts +3 -0
  206. package/dist/guest/toolchains/databases/redis.js +16 -0
  207. package/dist/guest/toolchains/databases/server.d.ts +14 -0
  208. package/dist/guest/toolchains/databases/server.js +52 -0
  209. package/dist/guest/toolchains/git.js +25 -16
  210. package/dist/guest/toolchains/go.js +1 -1
  211. package/dist/guest/toolchains/index.d.ts +13 -9
  212. package/dist/guest/toolchains/index.js +40 -82
  213. package/dist/guest/toolchains/java.js +5 -5
  214. package/dist/guest/toolchains/leftovers.d.ts +2 -0
  215. package/dist/guest/toolchains/leftovers.js +26 -0
  216. package/dist/guest/toolchains/managers.js +12 -10
  217. package/dist/guest/toolchains/{binstall.js → native/binstall.js} +6 -9
  218. package/dist/guest/toolchains/native/cpp.d.ts +4 -0
  219. package/dist/guest/toolchains/native/cpp.js +38 -0
  220. package/dist/guest/toolchains/native/dotnet.d.ts +4 -0
  221. package/dist/guest/toolchains/native/dotnet.js +103 -0
  222. package/dist/guest/toolchains/native/mesa.d.ts +7 -0
  223. package/dist/guest/toolchains/native/mesa.js +56 -0
  224. package/dist/guest/toolchains/native/msvc/environment.d.ts +16 -0
  225. package/dist/guest/toolchains/native/msvc/environment.js +57 -0
  226. package/dist/guest/toolchains/native/msvc/index.d.ts +6 -0
  227. package/dist/guest/toolchains/native/msvc/index.js +48 -0
  228. package/dist/guest/toolchains/native/msvc/packages.d.ts +6 -0
  229. package/dist/guest/toolchains/native/msvc/packages.js +156 -0
  230. package/dist/guest/toolchains/native/msvc/tree.d.ts +15 -0
  231. package/dist/guest/toolchains/native/msvc/tree.js +21 -0
  232. package/dist/guest/toolchains/native/rust.d.ts +3 -0
  233. package/dist/guest/toolchains/native/rust.js +45 -0
  234. package/dist/guest/toolchains/node.js +26 -6
  235. package/dist/guest/toolchains/plan.d.ts +24 -0
  236. package/dist/guest/toolchains/plan.js +140 -0
  237. package/dist/guest/toolchains/pwsh.js +1 -1
  238. package/dist/guest/toolchains/python.js +43 -12
  239. package/dist/guest/toolchains/runtimes.d.ts +2 -0
  240. package/dist/guest/toolchains/runtimes.js +6 -8
  241. package/dist/guest/toolchains/scripting/php.d.ts +3 -0
  242. package/dist/guest/toolchains/scripting/php.js +71 -0
  243. package/dist/guest/toolchains/scripting/ruby.d.ts +3 -0
  244. package/dist/guest/toolchains/scripting/ruby.js +47 -0
  245. package/dist/guest/toolchains/scripting/vcruntime.d.ts +7 -0
  246. package/dist/guest/toolchains/scripting/vcruntime.js +45 -0
  247. package/dist/guest/toolchains/vscode-profile.d.ts +30 -0
  248. package/dist/guest/toolchains/vscode-profile.js +69 -0
  249. package/dist/guest/toolchains/vscode.d.ts +17 -0
  250. package/dist/guest/toolchains/vscode.js +87 -1
  251. package/dist/guest/view.js +21 -1
  252. package/dist/host/accounts.js +14 -5
  253. package/dist/host/agent-commands.d.ts +25 -0
  254. package/dist/host/agent-commands.js +145 -0
  255. package/dist/host/attach.d.ts +17 -0
  256. package/dist/host/attach.js +70 -0
  257. package/dist/host/audit/collect.d.ts +34 -0
  258. package/dist/host/audit/collect.js +126 -0
  259. package/dist/host/audit/log.d.ts +46 -0
  260. package/dist/host/audit/log.js +143 -0
  261. package/dist/host/channel.d.ts +23 -22
  262. package/dist/host/channel.js +66 -84
  263. package/dist/host/claude-profile.js +7 -3
  264. package/dist/host/cleanup.js +2 -11
  265. package/dist/host/database-plan.d.ts +12 -0
  266. package/dist/host/database-plan.js +52 -0
  267. package/dist/host/generate.d.ts +10 -12
  268. package/dist/host/generate.js +58 -135
  269. package/dist/host/join.d.ts +28 -0
  270. package/dist/host/join.js +76 -0
  271. package/dist/host/launch/mappings.d.ts +3 -0
  272. package/dist/host/launch/mappings.js +54 -0
  273. package/dist/host/launch/projects.d.ts +15 -0
  274. package/dist/host/launch/projects.js +56 -0
  275. package/dist/host/launch/stage.d.ts +11 -0
  276. package/dist/host/launch/stage.js +66 -0
  277. package/dist/host/launch/wsb.d.ts +10 -0
  278. package/dist/host/launch/wsb.js +34 -0
  279. package/dist/host/motw.d.ts +17 -0
  280. package/dist/host/motw.js +74 -0
  281. package/dist/host/pc-scan.d.ts +6 -0
  282. package/dist/host/pc-scan.js +37 -0
  283. package/dist/host/platform.d.ts +2 -0
  284. package/dist/host/platform.js +16 -1
  285. package/dist/host/port-forward.d.ts +8 -0
  286. package/dist/host/port-forward.js +37 -0
  287. package/dist/host/project-scan.d.ts +1 -17
  288. package/dist/host/project-scan.js +2 -86
  289. package/dist/host/projects.d.ts +100 -0
  290. package/dist/host/projects.js +147 -0
  291. package/dist/host/repo-guard.d.ts +25 -5
  292. package/dist/host/repo-guard.js +242 -23
  293. package/dist/host/stops.d.ts +67 -0
  294. package/dist/host/stops.js +126 -0
  295. package/dist/host/terminal.d.ts +8 -0
  296. package/dist/host/terminal.js +48 -1
  297. package/dist/host/test-guard.d.ts +6 -0
  298. package/dist/host/test-guard.js +15 -0
  299. package/dist/host/window.js +7 -3
  300. package/dist/host/workspace-view/index.d.ts +20 -0
  301. package/dist/host/workspace-view/index.js +53 -0
  302. package/dist/host/workspace-view/rules.d.ts +26 -0
  303. package/dist/host/workspace-view/rules.js +93 -0
  304. package/dist/host/workspace-view/view.d.ts +50 -0
  305. package/dist/host/workspace-view/view.js +281 -0
  306. package/dist/host/wsb.d.ts +37 -0
  307. package/dist/host/wsb.js +101 -0
  308. package/dist/runtime/daemon.js +11791 -2821
  309. package/dist/runtime/db.js +6585 -466
  310. package/dist/runtime/main.js +10238 -1724
  311. package/dist/runtime/netproxy.js +25936 -0
  312. package/dist/runtime/view.js +6183 -59
  313. package/dist/selftest/accounts.test.d.ts +2 -0
  314. package/dist/selftest/accounts.test.js +44 -0
  315. package/dist/selftest/agent-commands.test.d.ts +2 -0
  316. package/dist/selftest/agent-commands.test.js +47 -0
  317. package/dist/selftest/audit.test.d.ts +2 -0
  318. package/dist/selftest/audit.test.js +57 -0
  319. package/dist/selftest/channel.test.d.ts +2 -0
  320. package/dist/selftest/channel.test.js +44 -0
  321. package/dist/selftest/cli.test.d.ts +2 -2
  322. package/dist/selftest/cli.test.js +145 -27
  323. package/dist/selftest/cmdline.test.d.ts +2 -0
  324. package/dist/selftest/cmdline.test.js +45 -0
  325. package/dist/selftest/config.test.d.ts +2 -3
  326. package/dist/selftest/config.test.js +36 -72
  327. package/dist/selftest/data.test.d.ts +2 -2
  328. package/dist/selftest/data.test.js +77 -70
  329. package/dist/selftest/detect.test.d.ts +2 -2
  330. package/dist/selftest/detect.test.js +54 -38
  331. package/dist/selftest/fixtures.d.ts +89 -4
  332. package/dist/selftest/fixtures.js +43 -24
  333. package/dist/selftest/generate.test.d.ts +2 -0
  334. package/dist/selftest/generate.test.js +68 -0
  335. package/dist/selftest/git-access.test.d.ts +2 -0
  336. package/dist/selftest/git-access.test.js +26 -0
  337. package/dist/selftest/guest-boot.test.d.ts +2 -0
  338. package/dist/selftest/guest-boot.test.js +76 -0
  339. package/dist/selftest/harness.d.ts +44 -7
  340. package/dist/selftest/harness.js +62 -21
  341. package/dist/selftest/host-sim.test.d.ts +2 -0
  342. package/dist/selftest/host-sim.test.js +93 -0
  343. package/dist/selftest/hostile-input.test.d.ts +2 -0
  344. package/dist/selftest/hostile-input.test.js +54 -0
  345. package/dist/selftest/index.d.ts +8 -1
  346. package/dist/selftest/index.js +137 -35
  347. package/dist/selftest/links.test.d.ts +2 -0
  348. package/dist/selftest/links.test.js +50 -0
  349. package/dist/selftest/live-daemon.test.d.ts +2 -0
  350. package/dist/selftest/live-daemon.test.js +91 -0
  351. package/dist/selftest/live-git.test.d.ts +2 -0
  352. package/dist/selftest/live-git.test.js +60 -0
  353. package/dist/selftest/live-network.test.d.ts +2 -0
  354. package/dist/selftest/live-network.test.js +63 -0
  355. package/dist/selftest/live-projects.test.d.ts +2 -0
  356. package/dist/selftest/live-projects.test.js +127 -0
  357. package/dist/selftest/live.d.ts +65 -0
  358. package/dist/selftest/live.js +109 -0
  359. package/dist/selftest/local-config.test.d.ts +2 -0
  360. package/dist/selftest/local-config.test.js +120 -0
  361. package/dist/selftest/mirror.test.d.ts +2 -3
  362. package/dist/selftest/mirror.test.js +92 -65
  363. package/dist/selftest/network.test.d.ts +2 -0
  364. package/dist/selftest/network.test.js +40 -0
  365. package/dist/selftest/personalization.test.d.ts +2 -0
  366. package/dist/selftest/personalization.test.js +53 -0
  367. package/dist/selftest/projects.test.d.ts +2 -0
  368. package/dist/selftest/projects.test.js +254 -0
  369. package/dist/selftest/repair.test.d.ts +2 -0
  370. package/dist/selftest/repair.test.js +42 -0
  371. package/dist/selftest/repo-guard.test.d.ts +2 -0
  372. package/dist/selftest/repo-guard.test.js +121 -0
  373. package/dist/selftest/secrets.test.d.ts +2 -0
  374. package/dist/selftest/secrets.test.js +71 -0
  375. package/dist/selftest/setup.test.d.ts +2 -2
  376. package/dist/selftest/setup.test.js +45 -22
  377. package/dist/selftest/suite.d.ts +13 -0
  378. package/dist/selftest/suite.js +1 -0
  379. package/dist/selftest/sync.test.d.ts +2 -3
  380. package/dist/selftest/sync.test.js +130 -78
  381. package/dist/selftest/test-guard.test.d.ts +2 -0
  382. package/dist/selftest/test-guard.test.js +49 -0
  383. package/dist/selftest/toolchains.test.d.ts +2 -0
  384. package/dist/selftest/toolchains.test.js +133 -0
  385. package/dist/selftest/workspace-view.test.d.ts +2 -0
  386. package/dist/selftest/workspace-view.test.js +89 -0
  387. package/dist/selftest/workspace.test.d.ts +2 -0
  388. package/dist/selftest/workspace.test.js +53 -0
  389. package/dist/shared/apps.d.ts +49 -0
  390. package/dist/shared/apps.js +114 -0
  391. package/dist/shared/download.d.ts +3 -1
  392. package/dist/shared/download.js +19 -4
  393. package/dist/shared/netpolicy.d.ts +27 -0
  394. package/dist/shared/netpolicy.js +51 -0
  395. package/dist/shared/paths.d.ts +5 -0
  396. package/dist/shared/paths.js +6 -0
  397. package/dist/shared/projects.d.ts +53 -0
  398. package/dist/shared/projects.js +67 -0
  399. package/dist/shared/pty-client.d.ts +9 -4
  400. package/dist/shared/pty-client.js +139 -17
  401. package/dist/shared/rundir.d.ts +12 -1
  402. package/dist/shared/rundir.js +14 -4
  403. package/dist/shared/safe-remove.js +11 -0
  404. package/dist/shared/schema.d.ts +453 -0
  405. package/dist/shared/schema.js +43 -2
  406. package/dist/shared/system.d.ts +1 -0
  407. package/dist/shared/system.js +1 -0
  408. package/dist/shared/test-guard.d.ts +4 -0
  409. package/dist/shared/test-guard.js +37 -0
  410. package/dist/sync/claude-mem.js +6 -3
  411. package/dist/sync/history.d.ts +29 -12
  412. package/dist/sync/history.js +72 -25
  413. package/dist/sync/watcher.d.ts +8 -0
  414. package/dist/sync/watcher.js +99 -8
  415. package/package.json +7 -6
  416. package/sandbox/bootstrap.ps1 +258 -258
  417. package/sandbox/cargoshim.cs +56 -0
  418. package/sandbox/cpucap.cs +33 -0
  419. package/sandbox/cpucap.ps1 +20 -0
  420. package/sandbox/logon.cmd +24 -16
  421. package/sandbox/memlog.ps1 +34 -0
  422. package/sandbox/openssl.cs +42 -0
  423. package/sandbox/pagefile.cs +31 -0
  424. package/sandbox/pagefile.ps1 +21 -0
  425. package/sandbox/ptyhost.cs +120 -11
  426. package/sandbox/trust.cmd +35 -35
  427. package/schemas/config.schema.json +403 -3
  428. package/schemas/sandbox-config.schema.json +143 -13
  429. package/dist/cli/commands/data.d.ts +0 -46
  430. package/dist/cli/commands/data.js +0 -249
  431. package/dist/cli/commands/setup.js +0 -152
  432. package/dist/cli/menu.d.ts +0 -22
  433. package/dist/cli/menu.js +0 -187
  434. package/dist/cli/settings.d.ts +0 -11
  435. package/dist/cli/settings.js +0 -156
  436. package/dist/guest/toolchains/databases.js +0 -226
  437. package/dist/guest/toolchains/msvc.d.ts +0 -10
  438. package/dist/guest/toolchains/msvc.js +0 -216
  439. package/dist/guest/toolchains/native.d.ts +0 -12
  440. package/dist/guest/toolchains/native.js +0 -220
  441. package/dist/guest/toolchains/scripting.d.ts +0 -10
  442. package/dist/guest/toolchains/scripting.js +0 -137
  443. package/dist/selftest/guest.test.d.ts +0 -3
  444. package/dist/selftest/guest.test.js +0 -61
  445. package/dist/selftest/helpers.test.d.ts +0 -2
  446. package/dist/selftest/helpers.test.js +0 -125
  447. package/dist/selftest/host.test.d.ts +0 -2
  448. package/dist/selftest/host.test.js +0 -71
  449. package/dist/selftest/live.test.d.ts +0 -7
  450. package/dist/selftest/live.test.js +0 -127
  451. package/dist/selftest/security.test.d.ts +0 -3
  452. package/dist/selftest/security.test.js +0 -143
  453. /package/dist/guest/toolchains/{binstall.d.ts → native/binstall.d.ts} +0 -0
@@ -0,0 +1,106 @@
1
+ // `sandbox data clean`: turns the targets you name into folders inside the data folder, and removes them.
2
+ import fs from 'node:fs';
3
+ import path from 'node:path';
4
+ import _ from 'lodash';
5
+ import { humanBytes, sizeOf } from '../../../core/disk.js';
6
+ import { askTyped, askYesNo } from '../../../core/prompt.js';
7
+ import { assertNoLinks, fail, isInsideOrEqual, isLink } from '../../../core/util.js';
8
+ import { isSandboxRunning } from '../../../host/platform.js';
9
+ import { table } from '../context.js';
10
+ import { removeTree } from './remove.js';
11
+ const DATA_AREAS = ['tools', 'databases', 'state', 'logs'];
12
+ const SEGMENT = /^[A-Za-z0-9][A-Za-z0-9._ +@-]*$/;
13
+ const LOGIN_WARNING = 'removes the agent logins, settings and history inside the sandbox (save a Claude login first with: sandbox account save <name>)';
14
+ const ALL_WARNING = 'removes EVERYTHING the sandbox keeps: toolchains, databases, agent logins and history, logs and launch folders';
15
+ /**
16
+ * Turns `sandbox data clean` arguments into folders. Pure (no disk access); throws a UserError for anything that is
17
+ * not a plain relative target inside the data folder: absolute paths, drive letters, `..`, wildcards, unknown areas.
18
+ */
19
+ export const resolveCleanTargets = (inputs, dataPath, storageRoot) => {
20
+ const usage = 'Targets: all | tools | tools/<name> | tools/agents/<name> | databases | databases/<name> | state | state/<agent> | logs | launches | views. See them with: sandbox data';
21
+ if (!inputs.length)
22
+ fail('Say what to remove.', usage);
23
+ const resolved = inputs.map((raw) => {
24
+ const input = raw.trim();
25
+ if (!input)
26
+ fail('Empty target.', usage);
27
+ if (path.win32.isAbsolute(input) || path.posix.isAbsolute(input) || /^[A-Za-z]:/.test(input) || input.includes(':'))
28
+ fail('Refusing "' + raw + '": targets are relative to the data folder, not paths on this PC.', usage);
29
+ const parts = input.replace(/\\/g, '/').split('/').filter(Boolean);
30
+ const bad = parts.find((p) => !SEGMENT.test(p) || /^\.+$/.test(p) || /[. ]$/.test(p));
31
+ if (bad !== undefined)
32
+ fail('Refusing "' + raw + '": "' + bad + '" is not a plain folder name (no .., wildcards or special characters).', usage);
33
+ const [head, ...rest] = parts;
34
+ const area = head.toLowerCase();
35
+ if (parts.length > 3)
36
+ fail('Refusing "' + raw + '": too deep.', usage);
37
+ const target = [area, ...rest].join('/');
38
+ if (area === 'all' && !rest.length)
39
+ return { target: 'all', path: dataPath, root: path.join(storageRoot, 'data'), warning: ALL_WARNING };
40
+ if (area === 'launches')
41
+ return { target, path: path.join(storageRoot, 'launches', ...rest), root: storageRoot };
42
+ if (area === 'views') {
43
+ if (rest.length)
44
+ fail('Remove all views ("views"), not single ones.', usage);
45
+ return { target, path: path.join(storageRoot, 'views'), root: storageRoot, warning: 'Views are the copies of your projects without their git-ignored files (workspaceFilter). Your projects are not touched; what the sandbox built or installed in them (node_modules, build output) goes, and the next start copies the projects again.' };
46
+ }
47
+ if (area === 'accounts' || area === 'sync')
48
+ fail('"' + area + '" is kept on this PC on purpose and is not removed here.', area === 'accounts' ? 'Remove a saved login with: sandbox account remove <name>' : usage);
49
+ if (!DATA_AREAS.includes(area))
50
+ fail('Unknown target "' + raw + '".', usage);
51
+ if (area === 'logs' && rest.length)
52
+ fail('Remove all logs ("logs"), not single files.', usage);
53
+ if (rest.length > (area === 'tools' && rest[0]?.toLowerCase() === 'agents' ? 2 : 1))
54
+ fail('Refusing "' + raw + '": too deep.', usage);
55
+ return { target, path: path.join(dataPath, area, ...rest), root: dataPath, ...(area === 'state' ? { warning: LOGIN_WARNING } : {}) };
56
+ });
57
+ // "all" covers everything; otherwise drop targets inside another target (tools + tools/go = tools).
58
+ const all = resolved.find((t) => t.target === 'all');
59
+ if (all)
60
+ return [all, { target: 'launches', path: path.join(storageRoot, 'launches'), root: storageRoot }];
61
+ const unique = _.uniqBy(resolved, (t) => t.path.toLowerCase());
62
+ return unique.filter((t) => !unique.some((o) => o !== t && isInsideOrEqual(o.path, t.path)));
63
+ };
64
+ export const dataClean = async (ctx) => {
65
+ const targets = resolveCleanTargets(ctx.options.positionals.slice(1), ctx.dataPath, ctx.storageRoot);
66
+ if (isSandboxRunning())
67
+ fail('A Windows Sandbox is running, and it uses these folders.', 'Close it first (sandbox stop), then run this again.');
68
+ // Every folder from the root down to the target's parent must be real; a link in place of the target is removed itself.
69
+ for (const t of targets)
70
+ assertNoLinks(t.root, path.dirname(t.path));
71
+ const present = targets.filter((t) => fs.existsSync(t.path) || isLink(t.path));
72
+ if (!present.length) {
73
+ console.log('Nothing to remove: ' + targets.map((t) => t.target).join(', ') + ' do(es) not exist.');
74
+ return 0;
75
+ }
76
+ const sized = present.map((t) => ({ ...t, bytes: sizeOf(t.path) }));
77
+ const total = _.sumBy(sized, 'bytes');
78
+ table(sized.map((t) => [' ' + t.target, humanBytes(t.bytes), t.path]));
79
+ for (const t of sized)
80
+ if (t.warning)
81
+ console.log('Warning: ' + t.target + ' ' + t.warning + '.');
82
+ const yes = Boolean(ctx.options.yes);
83
+ if (!yes) {
84
+ const ok = sized.some((t) => t.target === 'all')
85
+ ? await askTyped('This cannot be undone; the next sandbox starts from scratch and reinstalls everything.', 'all')
86
+ : await askYesNo('Delete ' + sized.map((t) => t.target).join(', ') + ' (' + humanBytes(total) + ')? This cannot be undone.');
87
+ if (!ok) {
88
+ console.log('Nothing removed.' + (process.stdin.isTTY ? '' : ' Pass --yes to confirm without a prompt.'));
89
+ return 1;
90
+ }
91
+ }
92
+ const failed = [];
93
+ for (const t of sized) {
94
+ try {
95
+ removeTree(t.path, t.root);
96
+ }
97
+ catch (e) {
98
+ failed.push(t.target + ' (' + (e instanceof Error ? e.message : String(e)) + ')');
99
+ }
100
+ }
101
+ const freed = total - _.sumBy(sized, (t) => sizeOf(t.path));
102
+ console.log('Freed ' + humanBytes(freed) + '. ' + (sized.some((t) => t.root === ctx.dataPath || t.target === 'all') ? 'The next sandbox reinstalls what it needs.' : ''));
103
+ if (failed.length)
104
+ fail('Could not remove everything: ' + failed.join('; '), 'Close programs using those folders and run the same command again.');
105
+ return 0;
106
+ };
@@ -0,0 +1,11 @@
1
+ export type DataArea = 'tools' | 'databases' | 'state' | 'logs' | 'data' | 'host';
2
+ export interface DataEntry {
3
+ area: DataArea;
4
+ name: string;
5
+ path: string;
6
+ bytes: number;
7
+ }
8
+ /** Every row of `sandbox data`: the sandbox's data folder by area, then what this PC keeps for it. */
9
+ export declare const collectDataEntries: (dataPath: string, storageRoot: string) => DataEntry[];
10
+ /** The `sandbox data clean` target for a listed row, or null when that row is not removable (kept on this PC on purpose). */
11
+ export declare const cleanTargetOf: (entry: DataEntry) => string | null;
@@ -0,0 +1,54 @@
1
+ // What `sandbox data` lists: the data folder by area, then what this PC keeps for the sandbox.
2
+ import fs from 'node:fs';
3
+ import path from 'node:path';
4
+ import _ from 'lodash';
5
+ import { sizeOf } from '../../../core/disk.js';
6
+ import { dirExists, isLink } from '../../../core/util.js';
7
+ const AREA_ORDER = ['tools', 'databases', 'state', 'logs', 'data', 'host'];
8
+ /** Folders of the data folder that get one row per child; anything else at the top level is listed as itself. */
9
+ const PER_CHILD = ['tools', 'databases', 'state'];
10
+ /** Real (non-link) children of a real folder; a link in place of the folder yields nothing. */
11
+ const entriesOf = (dir) => (dirExists(dir) && !isLink(dir) ? fs.readdirSync(dir, { withFileTypes: true }).filter((d) => !d.isSymbolicLink()) : []);
12
+ const toolRows = (toolsDir) => {
13
+ const entries = entriesOf(toolsDir);
14
+ const folders = entries.filter((d) => d.isDirectory());
15
+ const files = entries.filter((d) => !d.isDirectory());
16
+ const row = (name, p) => ({ area: 'tools', name, path: p, bytes: sizeOf(p) });
17
+ return [
18
+ ...folders.flatMap((d) => (d.name.toLowerCase() === 'agents'
19
+ ? entriesOf(path.join(toolsDir, d.name)).map((a) => row('agents/' + a.name, path.join(toolsDir, d.name, a.name)))
20
+ : [row(d.name, path.join(toolsDir, d.name))])),
21
+ ...(files.length ? [{ area: 'tools', name: '(files in tools)', path: toolsDir, bytes: _.sumBy(files, (f) => sizeOf(path.join(toolsDir, f.name))) }] : []),
22
+ ];
23
+ };
24
+ /** Every row of `sandbox data`: the sandbox's data folder by area, then what this PC keeps for it. */
25
+ export const collectDataEntries = (dataPath, storageRoot) => {
26
+ const inData = entriesOf(dataPath);
27
+ const rows = inData.flatMap((d) => {
28
+ const p = path.join(dataPath, d.name);
29
+ const area = d.name.toLowerCase();
30
+ if (area === 'tools')
31
+ return toolRows(p);
32
+ if (PER_CHILD.includes(area))
33
+ return entriesOf(p).map((c) => ({ area, name: area + '/' + c.name, path: path.join(p, c.name), bytes: sizeOf(path.join(p, c.name)) }));
34
+ return [{ area: area === 'logs' ? 'logs' : 'data', name: d.name, path: p, bytes: sizeOf(p) }];
35
+ });
36
+ const otherData = entriesOf(path.join(storageRoot, 'data')).filter((d) => d.isDirectory() && path.join(storageRoot, 'data', d.name).toLowerCase() !== path.resolve(dataPath).toLowerCase());
37
+ const host = [
38
+ ...['launches', 'views', 'accounts', 'sync', 'logs', 'run', 'host'].map((name) => ({ area: 'host', name, path: path.join(storageRoot, name), bytes: sizeOf(path.join(storageRoot, name)) })),
39
+ ...otherData.map((d) => ({ area: 'host', name: 'other data folder: ' + d.name, path: path.join(storageRoot, 'data', d.name), bytes: sizeOf(path.join(storageRoot, 'data', d.name)) })),
40
+ ].filter((r) => fs.existsSync(r.path));
41
+ return _.sortBy([...rows, ...host], (r) => AREA_ORDER.indexOf(r.area), (r) => -r.bytes, (r) => r.name.toLowerCase());
42
+ };
43
+ /** The `sandbox data clean` target for a listed row, or null when that row is not removable (kept on this PC on purpose). */
44
+ export const cleanTargetOf = (entry) => {
45
+ if (entry.area === 'tools')
46
+ return entry.name.startsWith('(') ? null : 'tools/' + entry.name;
47
+ if (entry.area === 'databases' || entry.area === 'state')
48
+ return entry.name;
49
+ if (entry.area === 'logs')
50
+ return 'logs';
51
+ if (entry.area === 'host' && (entry.name === 'launches' || entry.name === 'views'))
52
+ return entry.name;
53
+ return null;
54
+ };
@@ -0,0 +1,4 @@
1
+ import { type Context } from '../context.js';
2
+ export declare const dataInfo: (ctx: Context) => Promise<number>;
3
+ /** `sandbox data [info|clean] [targets...]`. */
4
+ export declare const data: (ctx: Context) => number | Promise<number>;
@@ -0,0 +1,45 @@
1
+ // `sandbox data`: what persists between sandboxes (toolchains, databases, agent state, logs, host storage) and
2
+ // removing chosen parts of it. Everything under the data folder is sandbox-writable: sizes and deletes never follow
3
+ // links, and targets resolve strictly inside the data folder.
4
+ import _ from 'lodash';
5
+ import { diskUsage, humanBytes } from '../../../core/disk.js';
6
+ import { fail } from '../../../core/util.js';
7
+ import { printJson, table } from '../context.js';
8
+ import { working } from '../../progress.js';
9
+ import { dataClean } from './clean.js';
10
+ import { collectDataEntries } from './collect.js';
11
+ const AREA_LABEL = { tools: 'Toolchains', databases: 'Databases', state: 'Agent state', logs: 'Logs', data: 'Other', host: 'On this PC' };
12
+ export const dataInfo = async (ctx) => {
13
+ const entries = await working('Measuring the saved data (big folders take a moment)', () => collectDataEntries(ctx.dataPath, ctx.storageRoot), !ctx.options.json);
14
+ const total = _.sumBy(entries, 'bytes');
15
+ const disks = diskUsage(ctx.storageRoot);
16
+ if (printJson(ctx, { dataPath: ctx.dataPath, storageRoot: ctx.storageRoot, totalBytes: total, entries, disks }))
17
+ return 0;
18
+ console.log('Disks\n');
19
+ table([['DRIVE', 'USED', 'FREE', 'SIZE', ''], ...disks.map((d) => [d.drive, humanBytes(d.usedBytes) + ' (' + Math.round((d.usedBytes / d.totalBytes) * 100) + '%)', humanBytes(d.freeBytes), humanBytes(d.totalBytes), d.holdsStorage ? '<- sandbox storage (' + humanBytes(total) + ' of it)' : ''])]);
20
+ console.log('');
21
+ console.log('Persistent data for the sandbox: ' + ctx.dataPath + ' (C:\\AgentData inside)\n');
22
+ if (!entries.length) {
23
+ console.log('Nothing stored yet. Toolchains, databases and agent logins appear here after the first start.');
24
+ return 0;
25
+ }
26
+ const rows = _.flatMap(_.groupBy(entries, 'area'), (group, area) => [
27
+ [AREA_LABEL[area], humanBytes(_.sumBy(group, 'bytes')), ''],
28
+ ...group.map((e) => [' ' + e.name, humanBytes(e.bytes), e.path]),
29
+ ]);
30
+ table([...rows, ['', '', ''], ['Total', humanBytes(total), '']]);
31
+ console.log('\nFree space with: sandbox data clean <target...> (e.g. tools/go, databases/postgres-18, logs, launches)');
32
+ return 0;
33
+ };
34
+ /** `sandbox data [info|clean] [targets...]`. */
35
+ export const data = (ctx) => {
36
+ const [action = 'info'] = ctx.options.positionals;
37
+ switch (action) {
38
+ case 'info':
39
+ case 'show':
40
+ case 'list': return dataInfo(ctx);
41
+ case 'clean':
42
+ case 'remove': return dataClean(ctx);
43
+ default: return fail('Unknown data action "' + action + '".', 'Use: sandbox data (what is stored) or sandbox data clean <target...>');
44
+ }
45
+ };
@@ -0,0 +1,2 @@
1
+ /** Deletes p (strictly inside root): links inside are removed first and never followed; see shared/safe-remove.ts. */
2
+ export declare const removeTree: (p: string, root: string) => void;
@@ -0,0 +1,30 @@
1
+ // Deleting inside the data folder. The sandbox can write there, so links are removed themselves and never followed.
2
+ import fs from 'node:fs';
3
+ import path from 'node:path';
4
+ import { dirExists, isLink, removeLink } from '../../../core/util.js';
5
+ import { removeRefusal, safeRemove } from '../../../shared/safe-remove.js';
6
+ /** Deletes p (strictly inside root): links inside are removed first and never followed; see shared/safe-remove.ts. */
7
+ export const removeTree = (p, root) => {
8
+ const unlinkInside = (dir) => {
9
+ for (const d of fs.readdirSync(dir, { withFileTypes: true })) {
10
+ const child = path.join(dir, d.name);
11
+ if (d.isSymbolicLink() || isLink(child))
12
+ removeLink(child);
13
+ else if (d.isDirectory())
14
+ unlinkInside(child);
15
+ }
16
+ };
17
+ if (isLink(p)) {
18
+ removeLink(p);
19
+ return;
20
+ }
21
+ if (!fs.existsSync(p))
22
+ return;
23
+ // Refused before anything is touched (safeRemove below checks again).
24
+ const refusal = removeRefusal(p, root);
25
+ if (refusal)
26
+ throw new Error('Refusing to delete ' + p + ': ' + refusal);
27
+ if (dirExists(p))
28
+ unlinkInside(p);
29
+ safeRemove(p, root);
30
+ };
@@ -1,8 +1,10 @@
1
1
  export { createContext, type Context } from './context.js';
2
2
  export { launch } from './launch.js';
3
- export { setup } from './setup.js';
4
- export { data } from './data.js';
5
- export { repair, repairCommand } from './repair.js';
3
+ export { setup } from './setup/index.js';
4
+ export { data } from './data/index.js';
5
+ export { repairCommand } from './repair/index.js';
6
6
  export { attach, db, exec, hide, restart, sessions, show, status, stop } from './sessions.js';
7
7
  export { account } from './accounts.js';
8
- export { claudeHost, clean, config, doctor, logs, sync, watcher } from './maintenance.js';
8
+ export { projects } from './projects.js';
9
+ export { audit, claudeHost, clean, config, doctor, logs, sync, watcher } from './maintenance.js';
10
+ export { agentCommandsCommand, syncAgentCommands } from './agent-commands.js';
@@ -1,8 +1,10 @@
1
1
  export { createContext } from './context.js';
2
2
  export { launch } from './launch.js';
3
- export { setup } from './setup.js';
4
- export { data } from './data.js';
5
- export { repair, repairCommand } from './repair.js';
3
+ export { setup } from './setup/index.js';
4
+ export { data } from './data/index.js';
5
+ export { repairCommand } from './repair/index.js';
6
6
  export { attach, db, exec, hide, restart, sessions, show, status, stop } from './sessions.js';
7
7
  export { account } from './accounts.js';
8
- export { claudeHost, clean, config, doctor, logs, sync, watcher } from './maintenance.js';
8
+ export { projects } from './projects.js';
9
+ export { audit, claudeHost, clean, config, doctor, logs, sync, watcher } from './maintenance.js';
10
+ export { agentCommandsCommand, syncAgentCommands } from './agent-commands.js';
@@ -1,5 +1,29 @@
1
- import { attachTerminal } from '../../host/channel.js';
1
+ import { attachTerminal } from '../../host/attach.js';
2
+ import type { SandboxStatus } from '../../core/types.js';
2
3
  import { type Context } from './context.js';
4
+ import { type Joined } from './project.js';
3
5
  /** Attaches this terminal; with attach.autoHide the sandbox window hides meanwhile (best effort, never fails the attach). */
4
6
  export declare const attachHere: (ctx: Context, session: Parameters<typeof attachTerminal>[0]) => Promise<number>;
5
- export declare const launch: (ctx: Context, generateOnly?: boolean) => Promise<number>;
7
+ /** The sandbox writes sandbox.json a few seconds into its boot; a second launch right after the first waits for it. */
8
+ export declare const runningSandboxStatus: (dataPath: string) => Promise<SandboxStatus>;
9
+ /** Waits for the boot with its current step on a spinner (plain lines without a terminal). */
10
+ export declare const waitForBoot: (dataPath: string, launchId: string | null) => Promise<SandboxStatus>;
11
+ /** The running sandbox, once it is ready. */
12
+ export declare const readySandbox: (dataPath: string) => Promise<SandboxStatus>;
13
+ /**
14
+ * Starts (or picks back up) a session in the folder `joined` describes. attach: show it in this terminal.
15
+ * Exported for restart.ts, which reopens the sessions a restart ended.
16
+ */
17
+ export declare const openSession: (ctx: Context, ready: SandboxStatus, joined: Joined, o: {
18
+ attach: boolean;
19
+ harness?: string;
20
+ args?: string[];
21
+ reuse?: boolean;
22
+ }) => Promise<number>;
23
+ /** A restart that adds a project: map these too, start no session at boot (restart.ts opens them), wait until ready. */
24
+ export interface LaunchExtras {
25
+ extraProjects?: string[];
26
+ autoSession?: boolean;
27
+ waitUntilReady?: boolean;
28
+ }
29
+ export declare const launch: (ctx: Context, generateOnly?: boolean, extras?: LaunchExtras) => Promise<number>;