windows-development-sandbox 1.9.0 → 1.11.3

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 (398) hide show
  1. package/README.md +64 -17
  2. package/config.example.json +7 -2
  3. package/dist/app/features/accounts/accounts.def.d.ts +122 -0
  4. package/dist/app/features/accounts/accounts.def.js +243 -0
  5. package/dist/app/features/accounts/accounts.run.d.ts +51 -0
  6. package/dist/app/features/accounts/accounts.run.js +125 -0
  7. package/dist/app/features/accounts/index.d.ts +2 -0
  8. package/dist/app/features/accounts/index.js +3 -0
  9. package/dist/app/features/agents/agent-entry.d.ts +17 -0
  10. package/dist/app/features/agents/agent-entry.js +50 -0
  11. package/dist/app/features/agents/agents.def.d.ts +65 -0
  12. package/dist/app/features/agents/agents.def.js +142 -0
  13. package/dist/app/features/agents/agents.run.d.ts +31 -0
  14. package/dist/app/features/agents/agents.run.js +189 -0
  15. package/dist/app/features/agents/index.d.ts +3 -0
  16. package/dist/app/features/agents/index.js +4 -0
  17. package/dist/app/features/apps/apps-rows.d.ts +31 -0
  18. package/dist/app/features/apps/apps-rows.js +73 -0
  19. package/dist/app/features/apps/apps.def.d.ts +181 -0
  20. package/dist/app/features/apps/apps.def.js +264 -0
  21. package/dist/app/features/apps/apps.run.d.ts +58 -0
  22. package/dist/app/features/apps/apps.run.js +76 -0
  23. package/dist/app/features/apps/index.d.ts +3 -0
  24. package/dist/app/features/apps/index.js +4 -0
  25. package/dist/app/features/data/data.def.d.ts +154 -0
  26. package/dist/app/features/data/data.def.js +201 -0
  27. package/dist/app/features/data/data.run.d.ts +46 -0
  28. package/dist/app/features/data/data.run.js +141 -0
  29. package/dist/app/features/data/index.d.ts +2 -0
  30. package/dist/app/features/data/index.js +3 -0
  31. package/dist/app/features/defs.d.ts +952 -4
  32. package/dist/app/features/defs.js +147 -10
  33. package/dist/app/features/engine/engine.def.d.ts +228 -0
  34. package/dist/app/features/engine/engine.def.js +194 -0
  35. package/dist/app/features/engine/engine.run.d.ts +72 -0
  36. package/dist/app/features/engine/engine.run.js +77 -0
  37. package/dist/app/features/engine/index.d.ts +2 -0
  38. package/dist/app/features/engine/index.js +4 -0
  39. package/dist/app/features/files/files.def.d.ts +51 -0
  40. package/dist/app/features/files/files.def.js +38 -0
  41. package/dist/app/features/files/files.run.d.ts +20 -0
  42. package/dist/app/features/files/files.run.js +59 -0
  43. package/dist/app/features/files/index.d.ts +2 -0
  44. package/dist/app/features/files/index.js +3 -0
  45. package/dist/app/features/github/github.def.d.ts +80 -0
  46. package/dist/app/features/github/github.def.js +142 -0
  47. package/dist/app/features/github/github.run.d.ts +36 -0
  48. package/dist/app/features/github/github.run.js +59 -0
  49. package/dist/app/features/github/index.d.ts +2 -0
  50. package/dist/app/features/github/index.js +3 -0
  51. package/dist/app/features/health/health.def.d.ts +275 -0
  52. package/dist/app/features/health/health.def.js +281 -0
  53. package/dist/app/features/health/health.run.d.ts +125 -0
  54. package/dist/app/features/health/health.run.js +204 -0
  55. package/dist/app/features/health/index.d.ts +2 -0
  56. package/dist/app/features/health/index.js +3 -0
  57. package/dist/app/features/logs/index.d.ts +2 -0
  58. package/dist/app/features/logs/index.js +3 -0
  59. package/dist/app/features/logs/logs.def.d.ts +78 -0
  60. package/dist/app/features/logs/logs.def.js +115 -0
  61. package/dist/app/features/logs/logs.run.d.ts +20 -0
  62. package/dist/app/features/logs/logs.run.js +42 -0
  63. package/dist/app/features/projects/index.d.ts +2 -0
  64. package/dist/app/features/projects/index.js +3 -0
  65. package/dist/app/features/projects/projects.def.d.ts +101 -0
  66. package/dist/app/features/projects/projects.def.js +208 -0
  67. package/dist/app/features/projects/projects.run.d.ts +56 -0
  68. package/dist/app/features/projects/projects.run.js +155 -0
  69. package/dist/app/features/sandbox/sandbox.def.js +11 -5
  70. package/dist/app/features/sessions/sessions.def.js +3 -0
  71. package/dist/app/features/settings/categories.def.js +3 -2
  72. package/dist/{cli/menu/settings/share.d.ts → app/features/settings/settings-share.d.ts} +1 -1
  73. package/dist/{cli/menu/settings/share.js → app/features/settings/settings-share.js} +3 -2
  74. package/dist/app/features/settings/settings.def.d.ts +22 -5
  75. package/dist/app/features/settings/settings.def.js +81 -6
  76. package/dist/app/features/settings/settings.run.d.ts +17 -0
  77. package/dist/app/features/settings/settings.run.js +89 -4
  78. package/dist/app/features/storage/index.d.ts +2 -0
  79. package/dist/app/features/storage/index.js +3 -0
  80. package/dist/app/features/storage/storage.def.d.ts +133 -0
  81. package/dist/app/features/storage/storage.def.js +225 -0
  82. package/dist/app/features/storage/storage.run.d.ts +62 -0
  83. package/dist/app/features/storage/storage.run.js +370 -0
  84. package/dist/app/features/updates/index.d.ts +3 -0
  85. package/dist/app/features/updates/index.js +4 -0
  86. package/dist/app/features/updates/update-lines.d.ts +13 -0
  87. package/dist/app/features/updates/update-lines.js +61 -0
  88. package/dist/app/features/updates/updates.def.d.ts +89 -0
  89. package/dist/app/features/updates/updates.def.js +225 -0
  90. package/dist/app/features/updates/updates.run.d.ts +48 -0
  91. package/dist/app/features/updates/updates.run.js +154 -0
  92. package/dist/app/features/vpn/index.d.ts +2 -0
  93. package/dist/app/features/vpn/index.js +3 -0
  94. package/dist/app/features/vpn/vpn.def.d.ts +112 -0
  95. package/dist/app/features/vpn/vpn.def.js +174 -0
  96. package/dist/app/features/vpn/vpn.run.d.ts +37 -0
  97. package/dist/app/features/vpn/vpn.run.js +54 -0
  98. package/dist/app/features/web/index.d.ts +2 -0
  99. package/dist/app/features/web/index.js +3 -0
  100. package/dist/app/features/web/web.def.d.ts +33 -0
  101. package/dist/app/features/web/web.def.js +90 -0
  102. package/dist/app/features/web/web.run.d.ts +24 -0
  103. package/dist/app/features/web/web.run.js +93 -0
  104. package/dist/app/kernel/define.d.ts +10 -1
  105. package/dist/app/kernel/io.d.ts +34 -0
  106. package/dist/app/kernel/io.js +9 -0
  107. package/dist/app/kernel/rpc.d.ts +17 -0
  108. package/dist/app/kernel/text.d.ts +2 -0
  109. package/dist/app/kernel/text.js +7 -0
  110. package/dist/app/kernel/view.d.ts +24 -1
  111. package/dist/app/kernel/view.js +1 -1
  112. package/dist/app/registry.js +74 -1
  113. package/dist/cli/args.js +1 -1
  114. package/dist/cli/commands/context.d.ts +7 -0
  115. package/dist/cli/commands/context.js +29 -2
  116. package/dist/cli/commands/engine.js +5 -58
  117. package/dist/cli/commands/github.d.ts +2 -0
  118. package/dist/cli/commands/github.js +11 -0
  119. package/dist/cli/commands/index.d.ts +3 -5
  120. package/dist/cli/commands/index.js +3 -5
  121. package/dist/cli/commands/launch/launch.js +23 -4
  122. package/dist/cli/commands/launch/running.js +4 -1
  123. package/dist/cli/commands/maintenance/config.js +1 -6
  124. package/dist/cli/commands/maintenance/index.d.ts +0 -1
  125. package/dist/cli/commands/maintenance/index.js +1 -2
  126. package/dist/cli/commands/maintenance/logs.js +27 -32
  127. package/dist/cli/commands/maintenance/migrate.d.ts +0 -8
  128. package/dist/cli/commands/maintenance/migrate.js +2 -44
  129. package/dist/cli/commands/maintenance/update.d.ts +0 -19
  130. package/dist/cli/commands/maintenance/update.js +1 -99
  131. package/dist/cli/commands/projects/index.d.ts +0 -1
  132. package/dist/cli/commands/projects/index.js +0 -1
  133. package/dist/cli/commands/registry.d.ts +1 -1
  134. package/dist/cli/commands/registry.js +29 -11
  135. package/dist/cli/commands/repair/checks/data.js +1 -1
  136. package/dist/cli/commands/repair/checks/hcs.js +28 -1
  137. package/dist/cli/commands/repair/checks/sandbox.js +1 -1
  138. package/dist/cli/commands/repair/health-run.d.ts +30 -0
  139. package/dist/cli/commands/repair/health-run.js +32 -0
  140. package/dist/cli/commands/repair/printer.d.ts +2 -2
  141. package/dist/cli/commands/repair/printer.js +2 -11
  142. package/dist/cli/commands/repair/run.d.ts +1 -21
  143. package/dist/cli/commands/repair/run.js +13 -70
  144. package/dist/cli/commands/storage/index.d.ts +0 -1
  145. package/dist/cli/commands/storage/index.js +0 -1
  146. package/dist/cli/commands/storage/offer.js +6 -2
  147. package/dist/cli/commands/vpn.d.ts +1 -3
  148. package/dist/cli/commands/vpn.js +8 -88
  149. package/dist/cli/commands/web.d.ts +7 -1
  150. package/dist/cli/commands/web.js +45 -71
  151. package/dist/cli/index.js +3 -2
  152. package/dist/cli/manifest.d.ts +16 -153
  153. package/dist/cli/manifest.js +20 -50
  154. package/dist/cli/menu/command-form.js +1 -2
  155. package/dist/cli/menu/io-menu.d.ts +2 -2
  156. package/dist/cli/menu/io-menu.js +6 -4
  157. package/dist/cli/menu/menu.js +1 -1
  158. package/dist/cli/menu/pages/accounts-page.d.ts +5 -17
  159. package/dist/cli/menu/pages/accounts-page.js +28 -170
  160. package/dist/cli/menu/pages/agents-page.d.ts +17 -18
  161. package/dist/cli/menu/pages/agents-page.js +67 -124
  162. package/dist/cli/menu/pages/apps-page.d.ts +15 -8
  163. package/dist/cli/menu/pages/apps-page.js +121 -29
  164. package/dist/cli/menu/pages/list-page.js +10 -1
  165. package/dist/cli/menu/pages/maintenance-page.d.ts +51 -52
  166. package/dist/cli/menu/pages/maintenance-page.js +246 -427
  167. package/dist/cli/menu/pages/sandbox-page.d.ts +3 -5
  168. package/dist/cli/menu/pages/sandbox-page.js +34 -112
  169. package/dist/cli/menu/pages/settings-page.d.ts +21 -3
  170. package/dist/cli/menu/pages/settings-page.js +89 -17
  171. package/dist/cli/menu/render-view.js +2 -1
  172. package/dist/cli/menu/settings/index.d.ts +0 -1
  173. package/dist/cli/menu/settings/index.js +3 -3
  174. package/dist/cli/menu/views.js +28 -0
  175. package/dist/cli/operations/handler.js +7 -3
  176. package/dist/cli/operations/input.d.ts +1 -1
  177. package/dist/cli/operations/input.js +29 -5
  178. package/dist/cli/operations/io-cli.js +9 -1
  179. package/dist/cli/operations/spec.js +8 -2
  180. package/dist/cli/output/render-view.js +2 -0
  181. package/dist/cli/{commands/data/collect.js → services/data-collect.js} +2 -2
  182. package/dist/cli/{commands/data/remove.js → services/data-remove.js} +2 -2
  183. package/dist/cli/services/data-service.d.ts +1 -1
  184. package/dist/cli/services/data-service.js +2 -2
  185. package/dist/cli/services/databases-service.d.ts +5 -0
  186. package/dist/cli/services/databases-service.js +15 -0
  187. package/dist/cli/services/health-service.d.ts +8 -4
  188. package/dist/cli/services/health-service.js +10 -8
  189. package/dist/cli/services/index.d.ts +4 -1
  190. package/dist/cli/services/index.js +4 -1
  191. package/dist/cli/services/logs-service.d.ts +7 -0
  192. package/dist/cli/services/logs-service.js +13 -0
  193. package/dist/cli/services/storage-service.d.ts +19 -0
  194. package/dist/cli/services/storage-service.js +71 -0
  195. package/dist/cli/services/vpn-service.d.ts +6 -4
  196. package/dist/cli/services/vpn-service.js +5 -11
  197. package/dist/cli/services/web-service.d.ts +4 -3
  198. package/dist/cli/services/web-service.js +12 -32
  199. package/dist/core/config/defaults.js +3 -2
  200. package/dist/core/schema/config.d.ts +6 -0
  201. package/dist/core/schema/config.js +2 -0
  202. package/dist/core/schema/github.d.ts +4 -0
  203. package/dist/core/schema/github.js +7 -0
  204. package/dist/core/schema/index.d.ts +1 -0
  205. package/dist/core/schema/index.js +1 -0
  206. package/dist/core/schema/profile.d.ts +1 -0
  207. package/dist/core/schema/profile.js +3 -0
  208. package/dist/core/schema/sandbox.js +3 -3
  209. package/dist/core/schema/toolchains.js +2 -2
  210. package/dist/core/schema/vpn.js +1 -1
  211. package/dist/core/schema/web.d.ts +1 -0
  212. package/dist/core/schema/web.js +4 -1
  213. package/dist/core/types.d.ts +6 -3
  214. package/dist/guest/boot/boot.js +11 -1
  215. package/dist/guest/daemon/daemon.js +1 -1
  216. package/dist/guest/daemon/sessions.d.ts +3 -2
  217. package/dist/guest/daemon/sessions.js +38 -7
  218. package/dist/guest/governor/core.d.ts +44 -0
  219. package/dist/guest/governor/core.js +124 -0
  220. package/dist/guest/governor/decide.d.ts +53 -15
  221. package/dist/guest/governor/decide.js +155 -72
  222. package/dist/guest/governor/governor.d.ts +2 -35
  223. package/dist/guest/governor/governor.js +35 -99
  224. package/dist/guest/governor/index.d.ts +1 -0
  225. package/dist/guest/governor/index.js +1 -0
  226. package/dist/guest/network/firewall.d.ts +3 -0
  227. package/dist/guest/network/firewall.js +65 -23
  228. package/dist/guest/runtime/process.js +53 -5
  229. package/dist/guest/sessions/viewer.js +5 -1
  230. package/dist/guest/setup/claude-mem.js +12 -4
  231. package/dist/guest/setup/github-token.d.ts +7 -0
  232. package/dist/guest/setup/github-token.js +65 -0
  233. package/dist/guest/toolchains/languages/node.js +40 -4
  234. package/dist/guest/toolchains/native/rust-extras.js +2 -2
  235. package/dist/guest/toolchains/tools/cli.d.ts +8 -0
  236. package/dist/guest/toolchains/tools/cli.js +16 -2
  237. package/dist/guest/vpn/openvpn.d.ts +5 -0
  238. package/dist/guest/vpn/openvpn.js +14 -1
  239. package/dist/guest/vpn/vpn.js +55 -16
  240. package/dist/guest/vpn/wireguard.js +2 -0
  241. package/dist/host/channel/attach.d.ts +1 -0
  242. package/dist/host/channel/attach.js +1 -0
  243. package/dist/host/channel/channel.d.ts +1 -1
  244. package/dist/host/channel/channel.js +2 -2
  245. package/dist/host/engines/hcs/check.d.ts +1 -0
  246. package/dist/host/engines/hcs/check.js +1 -1
  247. package/dist/host/engines/hcs/engine.d.ts +1 -1
  248. package/dist/host/engines/hcs/engine.js +6 -4
  249. package/dist/host/engines/hcs/helper.d.ts +11 -0
  250. package/dist/host/engines/hcs/helper.js +31 -2
  251. package/dist/host/engines/hcs/leftovers.d.ts +42 -0
  252. package/dist/host/engines/hcs/leftovers.js +101 -0
  253. package/dist/host/engines/index.d.ts +1 -0
  254. package/dist/host/engines/index.js +1 -0
  255. package/dist/host/github/deliver.d.ts +13 -0
  256. package/dist/host/github/deliver.js +51 -0
  257. package/dist/host/github/index.d.ts +2 -0
  258. package/dist/host/github/index.js +3 -0
  259. package/dist/host/github/token.d.ts +21 -0
  260. package/dist/host/github/token.js +74 -0
  261. package/dist/host/launch/generate.js +11 -5
  262. package/dist/host/launch/index.d.ts +1 -1
  263. package/dist/host/launch/index.js +1 -1
  264. package/dist/host/launch/session-file.js +1 -2
  265. package/dist/host/launch/wsb-file.d.ts +11 -7
  266. package/dist/host/launch/wsb-file.js +30 -12
  267. package/dist/host/life/host-memory.d.ts +1 -0
  268. package/dist/host/life/host-memory.js +4 -1
  269. package/dist/host/life/watchdog.d.ts +11 -0
  270. package/dist/host/life/watchdog.js +36 -4
  271. package/dist/host/sandbox/tasklist.d.ts +6 -0
  272. package/dist/host/sandbox/tasklist.js +37 -0
  273. package/dist/host/secrets/launch-secrets.d.ts +2 -1
  274. package/dist/host/secrets/launch-secrets.js +4 -2
  275. package/dist/host/vpn/status.js +13 -3
  276. package/dist/host/web/backend.d.ts +1 -3
  277. package/dist/host/web/index.d.ts +2 -1
  278. package/dist/host/web/index.js +2 -1
  279. package/dist/host/web/live.d.ts +23 -0
  280. package/dist/host/web/live.js +107 -0
  281. package/dist/host/web/rpc.d.ts +6 -1
  282. package/dist/host/web/rpc.js +23 -31
  283. package/dist/host/web/runner.d.ts +4 -0
  284. package/dist/host/web/runner.js +12 -1
  285. package/dist/host/web/server.d.ts +30 -2
  286. package/dist/host/web/server.js +87 -29
  287. package/dist/host/web/state.d.ts +1 -0
  288. package/dist/host/web/state.js +2 -0
  289. package/dist/runtime/agent.js +44 -16
  290. package/dist/runtime/daemon.js +1154 -857
  291. package/dist/runtime/db.js +44 -16
  292. package/dist/runtime/main.js +532 -115
  293. package/dist/runtime/netproxy.js +34 -9
  294. package/dist/runtime/view.js +499 -149
  295. package/dist/selftest/app.test.js +620 -12
  296. package/dist/selftest/channel.test.js +18 -1
  297. package/dist/selftest/cli.test.js +1 -1
  298. package/dist/selftest/config.test.js +1 -1
  299. package/dist/selftest/contained.test.js +1 -1
  300. package/dist/selftest/data.test.js +1 -2
  301. package/dist/selftest/engine.test.js +3 -1
  302. package/dist/selftest/github.test.d.ts +2 -0
  303. package/dist/selftest/github.test.js +243 -0
  304. package/dist/selftest/guest-boot.test.js +47 -1
  305. package/dist/selftest/hcs.test.js +105 -8
  306. package/dist/selftest/health.test.js +71 -0
  307. package/dist/selftest/heavy-load.test.js +152 -66
  308. package/dist/selftest/index.js +4 -0
  309. package/dist/selftest/layout.test.js +8 -0
  310. package/dist/selftest/live-terminal.test.js +74 -0
  311. package/dist/selftest/menu-screens.js +171 -56
  312. package/dist/selftest/menu.test.js +54 -37
  313. package/dist/selftest/migrate.test.js +14 -12
  314. package/dist/selftest/network.test.js +20 -1
  315. package/dist/selftest/powershell-variables.test.d.ts +2 -0
  316. package/dist/selftest/powershell-variables.test.js +61 -0
  317. package/dist/selftest/support/engine-golden.js +1 -0
  318. package/dist/selftest/support/fixtures.d.ts +5 -0
  319. package/dist/selftest/support/web-preview.d.ts +1 -0
  320. package/dist/selftest/support/web-preview.js +856 -0
  321. package/dist/selftest/update-service.test.js +15 -8
  322. package/dist/selftest/vpn.test.js +86 -2
  323. package/dist/selftest/web.test.js +58 -11
  324. package/dist/shared/channel/run-dir.d.ts +2 -0
  325. package/dist/shared/channel/run-dir.js +3 -0
  326. package/dist/shared/channel/schema.d.ts +7 -0
  327. package/dist/shared/channel/schema.js +9 -1
  328. package/dist/shared/channel/secrets.d.ts +1 -0
  329. package/dist/shared/channel/secrets.js +3 -0
  330. package/dist/shared/github/index.d.ts +1 -0
  331. package/dist/shared/github/index.js +2 -0
  332. package/dist/shared/github/token.d.ts +29 -0
  333. package/dist/shared/github/token.js +89 -0
  334. package/dist/shared/io/copy-tree.d.ts +7 -0
  335. package/dist/shared/io/copy-tree.js +45 -0
  336. package/dist/shared/io/index.d.ts +2 -0
  337. package/dist/shared/io/index.js +2 -0
  338. package/dist/shared/io/robocopy-result.d.ts +6 -0
  339. package/dist/shared/io/robocopy-result.js +23 -0
  340. package/dist/shared/memory/policy.d.ts +38 -12
  341. package/dist/shared/memory/policy.js +58 -19
  342. package/dist/shared/network/firewall-rules.d.ts +8 -0
  343. package/dist/shared/network/firewall-rules.js +28 -0
  344. package/dist/shared/pty/ctrl-c.d.ts +18 -0
  345. package/dist/shared/pty/ctrl-c.js +36 -0
  346. package/dist/shared/pty/index.d.ts +1 -0
  347. package/dist/shared/pty/index.js +1 -0
  348. package/dist/shared/pty/terminal.d.ts +2 -0
  349. package/dist/shared/pty/terminal.js +21 -2
  350. package/dist/shared/vpn/kill-switch.d.ts +13 -2
  351. package/dist/shared/vpn/kill-switch.js +88 -8
  352. package/dist/shared/web/protocol.d.ts +0 -4
  353. package/dist/sync/watcher.js +1 -1
  354. package/dist/web/index.html +2 -2
  355. package/dist/web/{main-T5DMCHYV.css → main-6JF3ASB5.css} +1 -1
  356. package/dist/web/main-Z645W45E.js +219 -0
  357. package/native/csharp/HcsHost/AssemblyInfo.cs +3 -3
  358. package/native/csharp/HostTools/AssemblyInfo.cs +3 -3
  359. package/native/csharp/HostTools/MemoryStatus.cs +128 -107
  360. package/native/scripts/memory-status.ps1 +10 -2
  361. package/package.json +10 -3
  362. package/sandbox/csharp/MemGov.cs +668 -398
  363. package/sandbox/csharp/PtyHost.cs +104 -15
  364. package/sandbox/csharp/SandboxTools/CpuCap.cs +50 -1
  365. package/sandbox/csharp/SandboxTools/Program.cs +1 -1
  366. package/sandbox/scripts/new-shortcuts.ps1 +3 -1
  367. package/sandbox/scripts/repair-wmi-services.ps1 +26 -0
  368. package/schemas/config.schema.json +25 -7
  369. package/schemas/sandbox-config.schema.json +7 -3
  370. package/dist/cli/commands/accounts.d.ts +0 -2
  371. package/dist/cli/commands/accounts.js +0 -96
  372. package/dist/cli/commands/data/clean.d.ts +0 -3
  373. package/dist/cli/commands/data/clean.js +0 -60
  374. package/dist/cli/commands/data/index.d.ts +0 -4
  375. package/dist/cli/commands/data/index.js +0 -62
  376. package/dist/cli/commands/maintenance/clean.d.ts +0 -2
  377. package/dist/cli/commands/maintenance/clean.js +0 -24
  378. package/dist/cli/commands/maintenance/config-share.d.ts +0 -12
  379. package/dist/cli/commands/maintenance/config-share.js +0 -80
  380. package/dist/cli/commands/projects/projects.d.ts +0 -2
  381. package/dist/cli/commands/projects/projects.js +0 -162
  382. package/dist/cli/commands/storage/contained.d.ts +0 -3
  383. package/dist/cli/commands/storage/contained.js +0 -179
  384. package/dist/cli/commands/storage/storage.d.ts +0 -8
  385. package/dist/cli/commands/storage/storage.js +0 -179
  386. package/dist/cli/menu/add-agent.d.ts +0 -47
  387. package/dist/cli/menu/add-agent.js +0 -168
  388. package/dist/cli/menu/apps.d.ts +0 -69
  389. package/dist/cli/menu/apps.js +0 -214
  390. package/dist/cli/menu/data-folder.d.ts +0 -18
  391. package/dist/cli/menu/data-folder.js +0 -99
  392. package/dist/cli/menu/share-settings.d.ts +0 -21
  393. package/dist/cli/menu/share-settings.js +0 -112
  394. package/dist/cli/menu/vpn-login.d.ts +0 -16
  395. package/dist/cli/menu/vpn-login.js +0 -74
  396. package/dist/web/main-NRRS5O6Z.js +0 -157
  397. /package/dist/cli/{commands/data/collect.d.ts → services/data-collect.d.ts} +0 -0
  398. /package/dist/cli/{commands/data/remove.d.ts → services/data-remove.d.ts} +0 -0
@@ -41,15 +41,18 @@ export interface CliHint {
41
41
  readonly json?: boolean;
42
42
  /** Shapes what --json prints (kept as the command printed it before the core); default: the output. */
43
43
  shapeJson?(output: unknown): unknown;
44
+ /** The command's exit code for this output (default 0). */
45
+ exitCode?(output: unknown): number;
44
46
  readonly examples?: readonly string[];
45
47
  }
46
48
  /** A CliHint as written in a definition: field names checked against the input, the output typed. */
47
- export interface TypedCliHint<I, O> extends Omit<CliHint, 'positional' | 'flags' | 'shapeJson'> {
49
+ export interface TypedCliHint<I, O> extends Omit<CliHint, 'positional' | 'flags' | 'shapeJson' | 'exitCode'> {
48
50
  readonly positional?: readonly (keyof I & string)[];
49
51
  readonly flags?: {
50
52
  readonly [K in keyof I]?: CliFlag;
51
53
  };
52
54
  shapeJson?(output: O): unknown;
55
+ exitCode?(output: O): number;
53
56
  }
54
57
  interface Definition<Id extends string, I extends z.ZodType, O extends z.ZodType> {
55
58
  readonly id: Id;
@@ -63,6 +66,8 @@ interface Definition<Id extends string, I extends z.ZodType, O extends z.ZodType
63
66
  readonly cli?: CliHint;
64
67
  /** The output in one text: what an operation did, or a value a query read (CLI output, menu notice, web note). */
65
68
  text?(output: z.output<O>): string;
69
+ /** The next step to suggest after the text, CLI only (a dimmed "Next:" line); menu and web ignore it. */
70
+ next?(output: z.output<O>): string | undefined;
66
71
  }
67
72
  /** What a definition is written as: its CLI hint typed against its own schemas. */
68
73
  type Written<D extends Definition<string, z.ZodType, z.ZodType>> = Omit<D, 'kind' | 'cli'> & {
@@ -106,8 +111,12 @@ export interface ViewDef<Q extends QueryMap = QueryMap, P = Record<string, never
106
111
  readonly queries: Q;
107
112
  /** Every operation the page may offer (the parity check reads this). */
108
113
  readonly operations: readonly OperationDef[];
114
+ /** Queries its inputs read while you fill them in (the web's folder picker reads files.browse). */
115
+ readonly pickers?: readonly QueryDef[];
109
116
  /** A parameter switched with tabs above the page (Settings: all projects or this project), first choice default. */
110
117
  readonly tabs?: ViewTabs<P>;
118
+ /** Parameters taken from the address as they are (the log shown), besides the tabs' one. */
119
+ readonly params?: readonly (keyof P & string)[];
111
120
  /** The input of each query for these view parameters (default: each query's defaults). */
112
121
  inputs?(params: P): ViewInputs<Q>;
113
122
  /** Pure: query results in, a Page out. */
@@ -14,6 +14,7 @@ export declare const ConfirmQuestionSchema: z.ZodObject<{
14
14
  danger: z.ZodOptional<z.ZodBoolean>;
15
15
  typed: z.ZodOptional<z.ZodString>;
16
16
  implied: z.ZodOptional<z.ZodBoolean>;
17
+ skipWithYes: z.ZodOptional<z.ZodBoolean>;
17
18
  noTerminal: z.ZodOptional<z.ZodObject<{
18
19
  message: z.ZodString;
19
20
  fix: z.ZodString;
@@ -29,6 +30,10 @@ export declare const ChooseQuestionSchema: z.ZodObject<{
29
30
  description: z.ZodOptional<z.ZodString>;
30
31
  }, z.core.$strict>>;
31
32
  initial: z.ZodOptional<z.ZodString>;
33
+ noTerminal: z.ZodOptional<z.ZodObject<{
34
+ message: z.ZodString;
35
+ fix: z.ZodString;
36
+ }, z.core.$strict>>;
32
37
  }, z.core.$strict>;
33
38
  export declare const TextQuestionSchema: z.ZodObject<{
34
39
  kind: z.ZodLiteral<"text">;
@@ -37,6 +42,10 @@ export declare const TextQuestionSchema: z.ZodObject<{
37
42
  initial: z.ZodOptional<z.ZodString>;
38
43
  allowEmpty: z.ZodOptional<z.ZodBoolean>;
39
44
  problem: z.ZodOptional<z.ZodString>;
45
+ noTerminal: z.ZodOptional<z.ZodObject<{
46
+ message: z.ZodString;
47
+ fix: z.ZodString;
48
+ }, z.core.$strict>>;
40
49
  }, z.core.$strict>;
41
50
  export declare const SecretQuestionSchema: z.ZodObject<{
42
51
  kind: z.ZodLiteral<"secret">;
@@ -55,6 +64,10 @@ export declare const PathQuestionSchema: z.ZodObject<{
55
64
  initial: z.ZodOptional<z.ZodString>;
56
65
  literals: z.ZodOptional<z.ZodArray<z.ZodString>>;
57
66
  problem: z.ZodOptional<z.ZodString>;
67
+ noTerminal: z.ZodOptional<z.ZodObject<{
68
+ message: z.ZodString;
69
+ fix: z.ZodString;
70
+ }, z.core.$strict>>;
58
71
  }, z.core.$strict>;
59
72
  export declare const ChecklistQuestionSchema: z.ZodObject<{
60
73
  kind: z.ZodLiteral<"checklist">;
@@ -66,6 +79,10 @@ export declare const ChecklistQuestionSchema: z.ZodObject<{
66
79
  description: z.ZodOptional<z.ZodString>;
67
80
  }, z.core.$strict>>;
68
81
  checked: z.ZodOptional<z.ZodArray<z.ZodString>>;
82
+ noTerminal: z.ZodOptional<z.ZodObject<{
83
+ message: z.ZodString;
84
+ fix: z.ZodString;
85
+ }, z.core.$strict>>;
69
86
  }, z.core.$strict>;
70
87
  export declare const QuestionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
71
88
  kind: z.ZodLiteral<"confirm">;
@@ -75,6 +92,7 @@ export declare const QuestionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
75
92
  danger: z.ZodOptional<z.ZodBoolean>;
76
93
  typed: z.ZodOptional<z.ZodString>;
77
94
  implied: z.ZodOptional<z.ZodBoolean>;
95
+ skipWithYes: z.ZodOptional<z.ZodBoolean>;
78
96
  noTerminal: z.ZodOptional<z.ZodObject<{
79
97
  message: z.ZodString;
80
98
  fix: z.ZodString;
@@ -89,6 +107,10 @@ export declare const QuestionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
89
107
  description: z.ZodOptional<z.ZodString>;
90
108
  }, z.core.$strict>>;
91
109
  initial: z.ZodOptional<z.ZodString>;
110
+ noTerminal: z.ZodOptional<z.ZodObject<{
111
+ message: z.ZodString;
112
+ fix: z.ZodString;
113
+ }, z.core.$strict>>;
92
114
  }, z.core.$strict>, z.ZodObject<{
93
115
  kind: z.ZodLiteral<"text">;
94
116
  title: z.ZodString;
@@ -96,6 +118,10 @@ export declare const QuestionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
96
118
  initial: z.ZodOptional<z.ZodString>;
97
119
  allowEmpty: z.ZodOptional<z.ZodBoolean>;
98
120
  problem: z.ZodOptional<z.ZodString>;
121
+ noTerminal: z.ZodOptional<z.ZodObject<{
122
+ message: z.ZodString;
123
+ fix: z.ZodString;
124
+ }, z.core.$strict>>;
99
125
  }, z.core.$strict>, z.ZodObject<{
100
126
  kind: z.ZodLiteral<"secret">;
101
127
  title: z.ZodString;
@@ -112,6 +138,10 @@ export declare const QuestionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
112
138
  initial: z.ZodOptional<z.ZodString>;
113
139
  literals: z.ZodOptional<z.ZodArray<z.ZodString>>;
114
140
  problem: z.ZodOptional<z.ZodString>;
141
+ noTerminal: z.ZodOptional<z.ZodObject<{
142
+ message: z.ZodString;
143
+ fix: z.ZodString;
144
+ }, z.core.$strict>>;
115
145
  }, z.core.$strict>, z.ZodObject<{
116
146
  kind: z.ZodLiteral<"checklist">;
117
147
  title: z.ZodString;
@@ -122,6 +152,10 @@ export declare const QuestionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
122
152
  description: z.ZodOptional<z.ZodString>;
123
153
  }, z.core.$strict>>;
124
154
  checked: z.ZodOptional<z.ZodArray<z.ZodString>>;
155
+ noTerminal: z.ZodOptional<z.ZodObject<{
156
+ message: z.ZodString;
157
+ fix: z.ZodString;
158
+ }, z.core.$strict>>;
125
159
  }, z.core.$strict>], "kind">;
126
160
  export type Question = z.output<typeof QuestionSchema>;
127
161
  export type ConfirmQuestion = z.output<typeof ConfirmQuestionSchema>;
@@ -5,6 +5,8 @@
5
5
  import { z } from 'zod';
6
6
  const Lines = z.array(z.string()).optional();
7
7
  const ChoiceSchema = z.strictObject({ value: z.string(), label: z.string(), description: z.string().optional() });
8
+ /** What the CLI says and fixes when a question needs a terminal and there is none. */
9
+ const NoTerminalSchema = z.strictObject({ message: z.string(), fix: z.string() });
8
10
  export const ConfirmQuestionSchema = z.strictObject({
9
11
  kind: z.literal('confirm'),
10
12
  title: z.string(),
@@ -19,6 +21,8 @@ export const ConfirmQuestionSchema = z.strictObject({
19
21
  * asks on a terminal, takes --yes, and fails without a terminal (with `noTerminal`, or "Add --yes").
20
22
  */
21
23
  implied: z.boolean().optional(),
24
+ /** On the command line --yes answers no without asking: an extra step a script did not ask for (delete the image). */
25
+ skipWithYes: z.boolean().optional(),
22
26
  noTerminal: z.strictObject({ message: z.string(), fix: z.string() }).optional(),
23
27
  });
24
28
  export const ChooseQuestionSchema = z.strictObject({
@@ -27,6 +31,8 @@ export const ChooseQuestionSchema = z.strictObject({
27
31
  lines: Lines,
28
32
  choices: z.array(ChoiceSchema).min(1),
29
33
  initial: z.string().optional(),
34
+ /** Without a terminal the CLI fails with this message and fix instead of its own (see confirm). */
35
+ noTerminal: NoTerminalSchema.optional(),
30
36
  });
31
37
  export const TextQuestionSchema = z.strictObject({
32
38
  kind: z.literal('text'),
@@ -36,6 +42,7 @@ export const TextQuestionSchema = z.strictObject({
36
42
  allowEmpty: z.boolean().optional(),
37
43
  /** What was wrong with the last answer (asked again). */
38
44
  problem: z.string().optional(),
45
+ noTerminal: NoTerminalSchema.optional(),
39
46
  });
40
47
  export const SecretQuestionSchema = z.strictObject({
41
48
  kind: z.literal('secret'),
@@ -52,6 +59,7 @@ export const PathQuestionSchema = z.strictObject({
52
59
  /** Words allowed instead of a path ("auto"). */
53
60
  literals: z.array(z.string()).optional(),
54
61
  problem: z.string().optional(),
62
+ noTerminal: NoTerminalSchema.optional(),
55
63
  });
56
64
  export const ChecklistQuestionSchema = z.strictObject({
57
65
  kind: z.literal('checklist'),
@@ -59,6 +67,7 @@ export const ChecklistQuestionSchema = z.strictObject({
59
67
  lines: Lines,
60
68
  choices: z.array(ChoiceSchema),
61
69
  checked: z.array(z.string()).optional(),
70
+ noTerminal: NoTerminalSchema.optional(),
62
71
  });
63
72
  export const QuestionSchema = z.discriminatedUnion('kind', [
64
73
  ConfirmQuestionSchema,
@@ -72,6 +72,7 @@ export declare const ServerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
72
72
  danger: z.ZodOptional<z.ZodBoolean>;
73
73
  typed: z.ZodOptional<z.ZodString>;
74
74
  implied: z.ZodOptional<z.ZodBoolean>;
75
+ skipWithYes: z.ZodOptional<z.ZodBoolean>;
75
76
  noTerminal: z.ZodOptional<z.ZodObject<{
76
77
  message: z.ZodString;
77
78
  fix: z.ZodString;
@@ -86,6 +87,10 @@ export declare const ServerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
86
87
  description: z.ZodOptional<z.ZodString>;
87
88
  }, z.core.$strict>>;
88
89
  initial: z.ZodOptional<z.ZodString>;
90
+ noTerminal: z.ZodOptional<z.ZodObject<{
91
+ message: z.ZodString;
92
+ fix: z.ZodString;
93
+ }, z.core.$strict>>;
89
94
  }, z.core.$strict>, z.ZodObject<{
90
95
  kind: z.ZodLiteral<"text">;
91
96
  title: z.ZodString;
@@ -93,6 +98,10 @@ export declare const ServerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
93
98
  initial: z.ZodOptional<z.ZodString>;
94
99
  allowEmpty: z.ZodOptional<z.ZodBoolean>;
95
100
  problem: z.ZodOptional<z.ZodString>;
101
+ noTerminal: z.ZodOptional<z.ZodObject<{
102
+ message: z.ZodString;
103
+ fix: z.ZodString;
104
+ }, z.core.$strict>>;
96
105
  }, z.core.$strict>, z.ZodObject<{
97
106
  kind: z.ZodLiteral<"secret">;
98
107
  title: z.ZodString;
@@ -109,6 +118,10 @@ export declare const ServerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
109
118
  initial: z.ZodOptional<z.ZodString>;
110
119
  literals: z.ZodOptional<z.ZodArray<z.ZodString>>;
111
120
  problem: z.ZodOptional<z.ZodString>;
121
+ noTerminal: z.ZodOptional<z.ZodObject<{
122
+ message: z.ZodString;
123
+ fix: z.ZodString;
124
+ }, z.core.$strict>>;
112
125
  }, z.core.$strict>, z.ZodObject<{
113
126
  kind: z.ZodLiteral<"checklist">;
114
127
  title: z.ZodString;
@@ -119,6 +132,10 @@ export declare const ServerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
119
132
  description: z.ZodOptional<z.ZodString>;
120
133
  }, z.core.$strict>>;
121
134
  checked: z.ZodOptional<z.ZodArray<z.ZodString>>;
135
+ noTerminal: z.ZodOptional<z.ZodObject<{
136
+ message: z.ZodString;
137
+ fix: z.ZodString;
138
+ }, z.core.$strict>>;
122
139
  }, z.core.$strict>], "kind">;
123
140
  }, z.core.$strict>, z.ZodObject<{
124
141
  t: z.ZodLiteral<"result">;
@@ -2,5 +2,7 @@
2
2
  export declare function ago(then: number | string | Date, now?: number): string;
3
3
  /** "1 session", "2 sessions". */
4
4
  export declare function plural(n: number, noun: string, many?: string): string;
5
+ /** 1536 -> "1.5 KB" (the same words as core/disk.ts humanBytes, which the CLI prints). */
6
+ export declare function bytesText(bytes: number): string;
5
7
  /** "memoryMb" -> "Memory MB", "vGpu" -> "V GPU": a readable label from a setting's key. */
6
8
  export declare function humanize(key: string): string;
@@ -38,6 +38,13 @@ const UPPER = new Set([
38
38
  ]);
39
39
  /** "harness" is the code's word for an agent; screens say agent. */
40
40
  const PLAIN = { harness: 'agent', harnesses: 'agents' };
41
+ /** 1536 -> "1.5 KB" (the same words as core/disk.ts humanBytes, which the CLI prints). */
42
+ export function bytesText(bytes) {
43
+ const units = ['B', 'KB', 'MB', 'GB', 'TB'];
44
+ const i = bytes <= 0 ? 0 : Math.min(units.length - 1, Math.floor(Math.log(bytes) / Math.log(1024)));
45
+ const value = bytes / 1024 ** i;
46
+ return (i === 0 ? String(bytes) : value.toFixed(value < 10 ? 1 : 0)) + ' ' + units[i];
47
+ }
41
48
  /** "memoryMb" -> "Memory MB", "vGpu" -> "V GPU": a readable label from a setting's key. */
42
49
  export function humanize(key) {
43
50
  const words = key
@@ -15,7 +15,7 @@ export type Target =
15
15
  readonly kind: 'terminal';
16
16
  readonly session: string;
17
17
  }
18
- /** Start an agent: the menu runs `launch`, the web opens its new-session dialog. */
18
+ /** Start an agent: the menu runs `launch`, the web runs agents.start and opens the session's terminal. */
19
19
  | {
20
20
  readonly kind: 'start-agent';
21
21
  readonly agent: string;
@@ -29,6 +29,7 @@ export type Target =
29
29
  | {
30
30
  readonly kind: 'view';
31
31
  readonly view: string;
32
+ readonly params?: Readonly<Record<string, string>>;
32
33
  };
33
34
  interface ActionBase {
34
35
  /** The words on a button or a row ("Stop the sandbox…"). */
@@ -52,6 +53,8 @@ export interface OperationAction extends ActionBase {
52
53
  readonly fields?: readonly Field[];
53
54
  /** What `fields` start as (the current value of a setting), by field name. */
54
55
  readonly initial?: Readonly<Record<string, unknown>>;
56
+ /** Its one field can be changed in place (the web shows the control in the row; the menu opens its editor). */
57
+ readonly inline?: boolean;
55
58
  }
56
59
  export interface LinkAction extends ActionBase {
57
60
  readonly kind: 'link';
@@ -66,6 +69,11 @@ export interface Fact {
66
69
  readonly tone?: Tone;
67
70
  readonly description?: string;
68
71
  readonly details?: readonly string[];
72
+ /** How full something is (memory used of total): a bar on the web, the value text elsewhere. */
73
+ readonly meter?: {
74
+ readonly value: number;
75
+ readonly max: number;
76
+ };
69
77
  }
70
78
  /** A column of a section shown as a table (CLI table, web table); items fill it through `cells`. */
71
79
  export interface Column {
@@ -78,9 +86,13 @@ export interface Item {
78
86
  readonly label: string;
79
87
  /** The right-hand text (a state, a value). */
80
88
  readonly hint?: string;
89
+ /** Its name in files and commands (a setting's key), shown small in monospace on the web. */
90
+ readonly code?: string;
81
91
  readonly tone?: Tone;
82
92
  readonly badges?: readonly Badge[];
83
93
  readonly description?: string;
94
+ /** Words about the menu's keys ("x deletes it."): the menu shows them after the description; the web does not. */
95
+ readonly keys?: string;
84
96
  /** Extra lines (the menu's details pane, the CLI's indented lines, the web's card body). */
85
97
  readonly details?: readonly string[];
86
98
  /** A heading inside the section ("This folder's project"). */
@@ -94,6 +106,8 @@ export interface Item {
94
106
  readonly actions?: readonly Action[];
95
107
  /** Why it cannot be used now. */
96
108
  readonly disabled?: string;
109
+ /** What picture fits it: an agent's name (claude), or project, folder, database, session. Only the web shows it. */
110
+ readonly icon?: string;
97
111
  /** More words a search finds it by. */
98
112
  readonly keywords?: string;
99
113
  }
@@ -115,8 +129,12 @@ export interface Section {
115
129
  readonly columns?: readonly Column[];
116
130
  /** Where `columns` is used: everywhere (default), or only on the command line (the web lists the items in full). */
117
131
  readonly columnsOn?: 'all' | 'cli';
132
+ /** The items are things to pick from (sessions, agents): the web shows them as cards rather than rows. */
133
+ readonly cards?: boolean;
118
134
  readonly actions?: readonly Action[];
119
135
  readonly notes?: readonly Note[];
136
+ /** Preformatted lines (a log): monospace, shown as they are. */
137
+ readonly text?: readonly string[];
120
138
  }
121
139
  /** What a page shows when it has nothing: the text and the next step (the CLI prints `cliText`, naming a command). */
122
140
  export interface Empty {
@@ -134,6 +152,11 @@ export interface Page {
134
152
  readonly actions?: readonly Action[];
135
153
  /** Shown instead of the sections when they have no facts and no items. */
136
154
  readonly empty?: Empty;
155
+ /**
156
+ * The sections are categories of one long list (settings): the web shows one at a time beside a list of them, with
157
+ * a search over all; the menu and the CLI show them as they always do.
158
+ */
159
+ readonly categories?: boolean;
137
160
  }
138
161
  /** An action that runs `def` with `input` (typed from its input schema; `fields` may ask for the rest). */
139
162
  export declare function action<I extends z.ZodType, O extends z.ZodType>(def: OperationDef<I, O>, input: Partial<z.input<I>>, extra?: Partial<Omit<OperationAction, 'kind' | 'op' | 'input'>>): OperationAction;
@@ -15,7 +15,7 @@ export function link(target, label, extra = {}) {
15
15
  }
16
16
  /** Does the page show anything besides its empty state? */
17
17
  export function pageHasContent(page) {
18
- return page.sections.some((s) => (s.facts?.length ?? 0) > 0 || (s.items?.length ?? 0) > 0);
18
+ return page.sections.some((s) => (s.facts?.length ?? 0) > 0 || (s.items?.length ?? 0) > 0 || (s.text?.length ?? 0) > 0);
19
19
  }
20
20
  /** Every action a page offers, wherever it sits (for parity checks and key bars). */
21
21
  export function pageActions(page) {
@@ -1,7 +1,21 @@
1
1
  import { invoke, NO_QUESTIONS, onSurface, } from './kernel/index.js';
2
+ import { addAgentRun, listAgentsRun, makeDefaultAgentRun, removeAgentRun, startAgentRun, } from './features/agents/index.js';
3
+ import { defaultAccountRun, listAccountsRun, removeAccountRun, renameAccountRun, saveAccountRun, useAccountRun, } from './features/accounts/index.js';
4
+ import { listAppsRun, requestAppRun, setCustomAppsRun, toggleAppRun } from './features/apps/index.js';
5
+ import { browseFolderRun } from './features/files/index.js';
6
+ import { cleanDataRun, pruneStorageRun, showDataRun } from './features/data/index.js';
7
+ import { changeDataFolderRun, containedOffRun, containedOnRun, containedStatusRun, moveStorageRun, showStorageRun, useStorageRun, } from './features/storage/index.js';
8
+ import { addProjectRun, allProjectsRun, chooseProjectsRun, excludeProjectRun, includeProjectRun, listProjectsRun, projectRootsRun, removeProjectRun, } from './features/projects/index.js';
9
+ import { checkHealthRun, enableSandboxRun, lastHealthRun, repairHealthRun } from './features/health/index.js';
2
10
  import { hideWindowRun, sandboxStatusRun, showWindowRun, stopSandboxRun } from './features/sandbox/index.js';
11
+ import { listLogsRun, tailLogRun } from './features/logs/index.js';
3
12
  import { listSessionsRun, restartSessionsRun } from './features/sessions/index.js';
4
- import { getSettingRun, listSettingsRun, resetSettingRun, setSettingRun } from './features/settings/index.js';
13
+ import { exportConfigRun, getSettingRun, importConfigRun, listSettingsRun, resetSettingRun, setSettingRun, } from './features/settings/index.js';
14
+ import { migrateSettingsRun, runUpdateRun, updatesStatusRun } from './features/updates/index.js';
15
+ import { checkEngineRun, cleanEngineRun, engineLeftoversRun, engineStatusRun } from './features/engine/index.js';
16
+ import { openWebRun, startWebRun, stopWebRun, webStatusRun } from './features/web/index.js';
17
+ import { vpnLoginRun, vpnLogoutRun, vpnStatusRun } from './features/vpn/index.js';
18
+ import { githubLoginRun, githubLogoutRun, githubStatusRun } from './features/github/index.js';
5
19
  export const IMPLEMENTATIONS = [
6
20
  sandboxStatusRun,
7
21
  showWindowRun,
@@ -9,10 +23,69 @@ export const IMPLEMENTATIONS = [
9
23
  stopSandboxRun,
10
24
  listSessionsRun,
11
25
  restartSessionsRun,
26
+ startAgentRun,
27
+ addAgentRun,
28
+ makeDefaultAgentRun,
29
+ removeAgentRun,
30
+ listAgentsRun,
12
31
  listSettingsRun,
13
32
  getSettingRun,
14
33
  setSettingRun,
15
34
  resetSettingRun,
35
+ exportConfigRun,
36
+ importConfigRun,
37
+ browseFolderRun,
38
+ listAccountsRun,
39
+ saveAccountRun,
40
+ useAccountRun,
41
+ defaultAccountRun,
42
+ renameAccountRun,
43
+ removeAccountRun,
44
+ listAppsRun,
45
+ toggleAppRun,
46
+ setCustomAppsRun,
47
+ requestAppRun,
48
+ listProjectsRun,
49
+ chooseProjectsRun,
50
+ addProjectRun,
51
+ removeProjectRun,
52
+ includeProjectRun,
53
+ excludeProjectRun,
54
+ allProjectsRun,
55
+ projectRootsRun,
56
+ lastHealthRun,
57
+ checkHealthRun,
58
+ repairHealthRun,
59
+ enableSandboxRun,
60
+ showDataRun,
61
+ cleanDataRun,
62
+ pruneStorageRun,
63
+ showStorageRun,
64
+ moveStorageRun,
65
+ useStorageRun,
66
+ changeDataFolderRun,
67
+ containedStatusRun,
68
+ containedOnRun,
69
+ containedOffRun,
70
+ listLogsRun,
71
+ tailLogRun,
72
+ runUpdateRun,
73
+ migrateSettingsRun,
74
+ updatesStatusRun,
75
+ engineStatusRun,
76
+ checkEngineRun,
77
+ engineLeftoversRun,
78
+ cleanEngineRun,
79
+ startWebRun,
80
+ openWebRun,
81
+ stopWebRun,
82
+ vpnStatusRun,
83
+ vpnLoginRun,
84
+ vpnLogoutRun,
85
+ githubStatusRun,
86
+ githubLoginRun,
87
+ githubLogoutRun,
88
+ webStatusRun,
16
89
  ];
17
90
  export function implementationOf(id) {
18
91
  return IMPLEMENTATIONS.find((i) => i.def.id === id);
package/dist/cli/args.js CHANGED
@@ -47,7 +47,7 @@ const HELP_ORDER = [
47
47
  ['Data', ['data', 'storage', 'clean', 'sync']],
48
48
  ['Web', ['web']],
49
49
  ['Health', ['setup', 'doctor', 'repair', 'logs', 'audit', 'update', 'migrate', 'config']],
50
- ['Advanced', ['generate', 'agent-commands', 'vpn']],
50
+ ['Advanced', ['generate', 'agent-commands', 'vpn', 'github']],
51
51
  ];
52
52
  /** The commands in the order --help lists them. */
53
53
  function helpOrdered() {
@@ -15,6 +15,13 @@ export interface Context {
15
15
  borrowed?: Borrowed;
16
16
  }
17
17
  export declare function createContext(packageRoot: string, entry: string, options: CliOptions): Context;
18
+ /**
19
+ * The built-in defaults as a context, for a command that must run even when the settings file is broken (the
20
+ * settings problem is then the command's own to report).
21
+ */
22
+ export declare function defaultsContext(packageRoot: string, entry: string, options: CliOptions): Context;
23
+ /** The context of a command that must not stop on a broken settings file: the defaults when createContext refuses. */
24
+ export declare function contextOrDefaults(packageRoot: string, entry: string, options: CliOptions): Context;
18
25
  /** Reads the config again and takes the storage folder from it (after a migration or a move changed it). */
19
26
  export declare function refreshStorage(ctx: Context): void;
20
27
  /** For commands that control the sandbox from your PC: inside the sandbox they make no sense. */
@@ -1,8 +1,8 @@
1
1
  // What every command receives, plus the small helpers they share.
2
2
  import fs from 'node:fs';
3
3
  import path from 'node:path';
4
- import { loadConfig, userDir } from '../../core/config/index.js';
5
- import { expandPath, fail, isInsideOrEqual } from '../../core/util/index.js';
4
+ import { DEFAULTS, loadConfig, userDir } from '../../core/config/index.js';
5
+ import { expandPath, fail, isInsideOrEqual, UserError } from '../../core/util/index.js';
6
6
  import { GUEST_DATA_DIR, insideSandbox, isSandboxRunning } from '../../host/sandbox/index.js';
7
7
  /** Keeps ~/.agent-sandbox/*.schema.json in step with the installed version (local schema paths editors trust). */
8
8
  function refreshSchemas(packageRoot) {
@@ -36,6 +36,33 @@ export function createContext(packageRoot, entry, options) {
36
36
  dataPath: insideSandbox() ? GUEST_DATA_DIR : path.join(storageRoot, 'data', loaded.config.storage.dataName),
37
37
  };
38
38
  }
39
+ /**
40
+ * The built-in defaults as a context, for a command that must run even when the settings file is broken (the
41
+ * settings problem is then the command's own to report).
42
+ */
43
+ export function defaultsContext(packageRoot, entry, options) {
44
+ const loaded = { config: structuredClone(DEFAULTS), configPath: null, base: userDir() };
45
+ const storageRoot = expandPath(loaded.config.storage.root, loaded.base);
46
+ return {
47
+ packageRoot,
48
+ entry,
49
+ options,
50
+ loaded,
51
+ storageRoot,
52
+ dataPath: path.join(storageRoot, 'data', loaded.config.storage.dataName),
53
+ };
54
+ }
55
+ /** The context of a command that must not stop on a broken settings file: the defaults when createContext refuses. */
56
+ export function contextOrDefaults(packageRoot, entry, options) {
57
+ try {
58
+ return createContext(packageRoot, entry, options);
59
+ }
60
+ catch (e) {
61
+ if (!(e instanceof UserError))
62
+ throw e;
63
+ return defaultsContext(packageRoot, entry, options);
64
+ }
65
+ }
39
66
  /** Reads the config again and takes the storage folder from it (after a migration or a move changed it). */
40
67
  export function refreshStorage(ctx) {
41
68
  ctx.loaded = loadConfig(ctx.options.config);
@@ -1,60 +1,7 @@
1
- // `sandbox engine`: the engine in use and, for each engine, what it can do and whether this PC can run it.
2
- import { fail } from '../../core/util/index.js';
3
- import { engineReports } from '../../host/engines/index.js';
4
- import { c, printJson, table } from '../output/index.js';
5
- const CAPABILITY_NAMES = {
6
- desktop: 'desktop window',
7
- gpu: 'GPU',
8
- clipboard: 'clipboard',
9
- audio: 'audio',
10
- video: 'camera',
11
- printers: 'printers',
12
- liveFolderAdd: 'add folders while running',
13
- attachedDisks: 'attached disks',
14
- multipleInstances: 'several at once',
15
- hvsocket: 'Hyper-V sockets',
16
- };
17
- /** sandbox engine check <engine>: the reasons and the exact commands, in plain words. Nothing is run or changed. */
18
- async function checkEngine(ctx, name) {
19
- const report = (await engineReports(ctx.loaded.config)).find((r) => r.id === name);
20
- if (!report)
21
- return fail('Unknown engine: ' + name, 'Use windows-sandbox or hcs.');
22
- if (printJson(ctx, report))
23
- return report.check.available ? 0 : 1;
24
- if (report.check.available) {
25
- console.log(c.green(name + ' can be used on this PC.'));
26
- if (name === 'hcs')
27
- console.log('HCS is in alpha: starting it is not enabled yet (docs/design/engines.md).');
28
- return 0;
29
- }
30
- console.log(c.yellow(name + ' cannot be used on this PC yet:'));
31
- report.check.reasons.forEach((reason, i) => {
32
- console.log('\n ' + (i + 1) + '. ' + reason);
33
- console.log(' To fix: ' + (report.check.fixes[i] ?? 'see docs/design/engines.md'));
34
- });
35
- console.log('\nNothing was changed. These commands change Windows, so they are yours to run (or not).');
36
- return 1;
37
- }
1
+ // `sandbox engine`: the engine in use and what each engine can do. The bare command is `sandbox engine show`; `check`
2
+ // is the other action. Both are definitions of the shared core (src/app/features/engine).
3
+ import { engineStatus } from '../../app/features/engine/index.js';
4
+ import { definitionHandler } from '../operations/index.js';
38
5
  export async function engine(ctx) {
39
- const [action = 'show', name = 'hcs'] = ctx.options.positionals;
40
- if (action === 'check')
41
- return checkEngine(ctx, name);
42
- const reports = await engineReports(ctx.loaded.config);
43
- const using = reports.find((r) => r.inUse);
44
- if (printJson(ctx, { engine: using?.id, engines: reports }))
45
- return 0;
46
- console.log('Engine in use: ' + (using?.id ?? ctx.loaded.config.sandbox.engine) + ' (setting: sandbox.engine)');
47
- for (const report of reports) {
48
- console.log('\n' + report.id + (report.inUse ? ' (in use)' : ''));
49
- console.log(' ' + (report.check.available ? c.green('can be used on this PC') : c.yellow('cannot be used yet')));
50
- for (const reason of report.check.reasons)
51
- console.log(' ' + reason);
52
- for (const fix of report.check.fixes)
53
- console.log(' Fix: ' + fix);
54
- table(Object.entries(CAPABILITY_NAMES).map(([key, name]) => [
55
- ' ' + name,
56
- report.capabilities[key] ? 'yes' : 'no',
57
- ]));
58
- }
59
- return 0;
6
+ return (await definitionHandler(engineStatus)(ctx)) ?? 0;
60
7
  }
@@ -0,0 +1,2 @@
1
+ import { type Context } from './context.js';
2
+ export declare function github(ctx: Context): number | Promise<number | void>;
@@ -0,0 +1,11 @@
1
+ // `sandbox github [status|login|logout]`: the actions are the GitHub feature's operations (src/app/features/github);
2
+ // with no action the command shows the status page.
3
+ import { fail } from '../../core/util/index.js';
4
+ import { githubStatus } from '../../app/features/github/index.js';
5
+ import { definitionHandler } from '../operations/index.js';
6
+ export function github(ctx) {
7
+ const action = ctx.options.positionals[0];
8
+ if (action === undefined)
9
+ return definitionHandler(githubStatus)(ctx);
10
+ return fail('Unknown GitHub action "' + action + '".', 'Use: sandbox github status | login | logout');
11
+ }
@@ -1,13 +1,11 @@
1
1
  export { createContext, type Context } from './context.js';
2
2
  export { launch } from './launch/index.js';
3
3
  export { setup } from './setup/index.js';
4
- export { data } from './data/index.js';
5
- export { storage, storageBeforeCommand } from './storage/index.js';
4
+ export { storageBeforeCommand } from './storage/index.js';
6
5
  export { repairCommand } from './repair/index.js';
6
+ export { contextOrDefaults } from './context.js';
7
7
  export { attach, db, exec } from './sessions/index.js';
8
- export { account } from './accounts.js';
9
8
  export { resume } from './resume.js';
10
- export { projects } from './projects/index.js';
11
- export { audit, claudeHost, clean, config, doctor, hostCommand, logs, migrate, migrateBeforeCommand, runMigrate, runUpdate, sync, update, updatesBeforeCommand, watcher, } from './maintenance/index.js';
9
+ export { audit, claudeHost, config, doctor, hostCommand, logs, migrateBeforeCommand, sync, updatesBeforeCommand, watcher, } from './maintenance/index.js';
12
10
  export { agentCommandsCommand, syncAgentCommands } from './agent-commands.js';
13
11
  export { HANDLERS, type Handler } from './registry.js';
@@ -1,13 +1,11 @@
1
1
  export { createContext } from './context.js';
2
2
  export { launch } from './launch/index.js';
3
3
  export { setup } from './setup/index.js';
4
- export { data } from './data/index.js';
5
- export { storage, storageBeforeCommand } from './storage/index.js';
4
+ export { storageBeforeCommand } from './storage/index.js';
6
5
  export { repairCommand } from './repair/index.js';
6
+ export { contextOrDefaults } from './context.js';
7
7
  export { attach, db, exec } from './sessions/index.js';
8
- export { account } from './accounts.js';
9
8
  export { resume } from './resume.js';
10
- export { projects } from './projects/index.js';
11
- export { audit, claudeHost, clean, config, doctor, hostCommand, logs, migrate, migrateBeforeCommand, runMigrate, runUpdate, sync, update, updatesBeforeCommand, watcher, } from './maintenance/index.js';
9
+ export { audit, claudeHost, config, doctor, hostCommand, logs, migrateBeforeCommand, sync, updatesBeforeCommand, watcher, } from './maintenance/index.js';
12
10
  export { agentCommandsCommand, syncAgentCommands } from './agent-commands.js';
13
11
  export { HANDLERS } from './registry.js';