windows-development-sandbox 1.10.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 (378) hide show
  1. package/README.md +64 -17
  2. package/config.example.json +5 -1
  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 +21 -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 -89
  149. package/dist/cli/commands/web.d.ts +2 -1
  150. package/dist/cli/commands/web.js +14 -78
  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 +2 -1
  200. package/dist/core/schema/config.d.ts +5 -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/types.d.ts +6 -3
  211. package/dist/guest/boot/boot.js +8 -0
  212. package/dist/guest/daemon/daemon.js +1 -1
  213. package/dist/guest/daemon/sessions.d.ts +3 -2
  214. package/dist/guest/daemon/sessions.js +38 -7
  215. package/dist/guest/governor/core.d.ts +44 -0
  216. package/dist/guest/governor/core.js +124 -0
  217. package/dist/guest/governor/decide.d.ts +46 -18
  218. package/dist/guest/governor/decide.js +136 -82
  219. package/dist/guest/governor/governor.d.ts +2 -38
  220. package/dist/guest/governor/governor.js +33 -113
  221. package/dist/guest/governor/index.d.ts +1 -0
  222. package/dist/guest/governor/index.js +1 -0
  223. package/dist/guest/network/firewall.d.ts +2 -0
  224. package/dist/guest/network/firewall.js +3 -3
  225. package/dist/guest/sessions/viewer.js +5 -1
  226. package/dist/guest/setup/github-token.d.ts +7 -0
  227. package/dist/guest/setup/github-token.js +65 -0
  228. package/dist/guest/toolchains/languages/node.js +11 -1
  229. package/dist/guest/toolchains/native/rust-extras.js +2 -2
  230. package/dist/guest/toolchains/tools/cli.d.ts +8 -0
  231. package/dist/guest/toolchains/tools/cli.js +16 -2
  232. package/dist/guest/vpn/openvpn.d.ts +5 -0
  233. package/dist/guest/vpn/openvpn.js +14 -1
  234. package/dist/guest/vpn/vpn.js +55 -16
  235. package/dist/guest/vpn/wireguard.js +2 -0
  236. package/dist/host/channel/attach.d.ts +1 -0
  237. package/dist/host/channel/attach.js +1 -0
  238. package/dist/host/channel/channel.d.ts +1 -1
  239. package/dist/host/channel/channel.js +2 -2
  240. package/dist/host/engines/hcs/check.d.ts +1 -0
  241. package/dist/host/engines/hcs/check.js +1 -1
  242. package/dist/host/engines/hcs/engine.d.ts +1 -1
  243. package/dist/host/engines/hcs/engine.js +6 -4
  244. package/dist/host/engines/hcs/helper.d.ts +11 -0
  245. package/dist/host/engines/hcs/helper.js +31 -2
  246. package/dist/host/engines/hcs/leftovers.d.ts +42 -0
  247. package/dist/host/engines/hcs/leftovers.js +101 -0
  248. package/dist/host/engines/index.d.ts +1 -0
  249. package/dist/host/engines/index.js +1 -0
  250. package/dist/host/github/deliver.d.ts +13 -0
  251. package/dist/host/github/deliver.js +51 -0
  252. package/dist/host/github/index.d.ts +2 -0
  253. package/dist/host/github/index.js +3 -0
  254. package/dist/host/github/token.d.ts +21 -0
  255. package/dist/host/github/token.js +74 -0
  256. package/dist/host/launch/generate.js +11 -5
  257. package/dist/host/launch/index.d.ts +1 -1
  258. package/dist/host/launch/index.js +1 -1
  259. package/dist/host/launch/session-file.js +1 -2
  260. package/dist/host/launch/wsb-file.d.ts +11 -7
  261. package/dist/host/launch/wsb-file.js +30 -12
  262. package/dist/host/life/watchdog.d.ts +9 -0
  263. package/dist/host/life/watchdog.js +17 -1
  264. package/dist/host/sandbox/tasklist.d.ts +6 -0
  265. package/dist/host/sandbox/tasklist.js +37 -0
  266. package/dist/host/secrets/launch-secrets.d.ts +2 -1
  267. package/dist/host/secrets/launch-secrets.js +4 -2
  268. package/dist/host/vpn/status.js +13 -3
  269. package/dist/host/web/backend.d.ts +1 -3
  270. package/dist/host/web/index.d.ts +2 -1
  271. package/dist/host/web/index.js +2 -1
  272. package/dist/host/web/live.d.ts +23 -0
  273. package/dist/host/web/live.js +107 -0
  274. package/dist/host/web/rpc.d.ts +6 -1
  275. package/dist/host/web/rpc.js +23 -31
  276. package/dist/host/web/runner.d.ts +4 -0
  277. package/dist/host/web/runner.js +12 -1
  278. package/dist/host/web/server.d.ts +30 -2
  279. package/dist/host/web/server.js +87 -29
  280. package/dist/host/web/state.d.ts +1 -0
  281. package/dist/host/web/state.js +2 -0
  282. package/dist/runtime/agent.js +30 -6
  283. package/dist/runtime/daemon.js +323 -176
  284. package/dist/runtime/db.js +30 -6
  285. package/dist/runtime/main.js +375 -76
  286. package/dist/runtime/netproxy.js +30 -6
  287. package/dist/runtime/view.js +495 -146
  288. package/dist/selftest/app.test.js +620 -12
  289. package/dist/selftest/channel.test.js +18 -1
  290. package/dist/selftest/cli.test.js +1 -1
  291. package/dist/selftest/config.test.js +1 -1
  292. package/dist/selftest/contained.test.js +1 -1
  293. package/dist/selftest/data.test.js +1 -2
  294. package/dist/selftest/engine.test.js +3 -1
  295. package/dist/selftest/github.test.d.ts +2 -0
  296. package/dist/selftest/github.test.js +243 -0
  297. package/dist/selftest/hcs.test.js +105 -8
  298. package/dist/selftest/health.test.js +71 -0
  299. package/dist/selftest/heavy-load.test.js +132 -72
  300. package/dist/selftest/index.js +4 -0
  301. package/dist/selftest/layout.test.js +8 -0
  302. package/dist/selftest/live-terminal.test.js +74 -0
  303. package/dist/selftest/menu-screens.js +171 -56
  304. package/dist/selftest/menu.test.js +54 -37
  305. package/dist/selftest/migrate.test.js +14 -12
  306. package/dist/selftest/powershell-variables.test.d.ts +2 -0
  307. package/dist/selftest/powershell-variables.test.js +61 -0
  308. package/dist/selftest/support/engine-golden.js +1 -0
  309. package/dist/selftest/support/fixtures.d.ts +4 -0
  310. package/dist/selftest/support/web-preview.d.ts +1 -0
  311. package/dist/selftest/support/web-preview.js +856 -0
  312. package/dist/selftest/update-service.test.js +15 -8
  313. package/dist/selftest/vpn.test.js +86 -2
  314. package/dist/selftest/web.test.js +58 -11
  315. package/dist/shared/channel/run-dir.d.ts +2 -0
  316. package/dist/shared/channel/run-dir.js +3 -0
  317. package/dist/shared/channel/schema.d.ts +7 -0
  318. package/dist/shared/channel/schema.js +9 -1
  319. package/dist/shared/channel/secrets.d.ts +1 -0
  320. package/dist/shared/channel/secrets.js +3 -0
  321. package/dist/shared/github/index.d.ts +1 -0
  322. package/dist/shared/github/index.js +2 -0
  323. package/dist/shared/github/token.d.ts +29 -0
  324. package/dist/shared/github/token.js +89 -0
  325. package/dist/shared/memory/policy.d.ts +33 -12
  326. package/dist/shared/memory/policy.js +50 -19
  327. package/dist/shared/pty/ctrl-c.d.ts +18 -0
  328. package/dist/shared/pty/ctrl-c.js +36 -0
  329. package/dist/shared/pty/index.d.ts +1 -0
  330. package/dist/shared/pty/index.js +1 -0
  331. package/dist/shared/pty/terminal.d.ts +2 -0
  332. package/dist/shared/pty/terminal.js +21 -2
  333. package/dist/shared/vpn/kill-switch.d.ts +13 -2
  334. package/dist/shared/vpn/kill-switch.js +88 -8
  335. package/dist/shared/web/protocol.d.ts +0 -4
  336. package/dist/sync/watcher.js +1 -1
  337. package/dist/web/index.html +2 -2
  338. package/dist/web/{main-T5DMCHYV.css → main-6JF3ASB5.css} +1 -1
  339. package/dist/web/main-Z645W45E.js +219 -0
  340. package/native/csharp/HcsHost/AssemblyInfo.cs +3 -3
  341. package/native/csharp/HostTools/AssemblyInfo.cs +3 -3
  342. package/package.json +10 -3
  343. package/sandbox/csharp/MemGov.cs +240 -38
  344. package/sandbox/csharp/PtyHost.cs +104 -15
  345. package/sandbox/csharp/SandboxTools/CpuCap.cs +50 -1
  346. package/sandbox/csharp/SandboxTools/Program.cs +1 -1
  347. package/sandbox/scripts/repair-wmi-services.ps1 +26 -0
  348. package/schemas/config.schema.json +19 -5
  349. package/schemas/sandbox-config.schema.json +7 -3
  350. package/dist/cli/commands/accounts.d.ts +0 -2
  351. package/dist/cli/commands/accounts.js +0 -96
  352. package/dist/cli/commands/data/clean.d.ts +0 -3
  353. package/dist/cli/commands/data/clean.js +0 -60
  354. package/dist/cli/commands/data/index.d.ts +0 -4
  355. package/dist/cli/commands/data/index.js +0 -62
  356. package/dist/cli/commands/maintenance/clean.d.ts +0 -2
  357. package/dist/cli/commands/maintenance/clean.js +0 -24
  358. package/dist/cli/commands/maintenance/config-share.d.ts +0 -12
  359. package/dist/cli/commands/maintenance/config-share.js +0 -80
  360. package/dist/cli/commands/projects/projects.d.ts +0 -2
  361. package/dist/cli/commands/projects/projects.js +0 -162
  362. package/dist/cli/commands/storage/contained.d.ts +0 -3
  363. package/dist/cli/commands/storage/contained.js +0 -179
  364. package/dist/cli/commands/storage/storage.d.ts +0 -8
  365. package/dist/cli/commands/storage/storage.js +0 -179
  366. package/dist/cli/menu/add-agent.d.ts +0 -47
  367. package/dist/cli/menu/add-agent.js +0 -168
  368. package/dist/cli/menu/apps.d.ts +0 -69
  369. package/dist/cli/menu/apps.js +0 -214
  370. package/dist/cli/menu/data-folder.d.ts +0 -18
  371. package/dist/cli/menu/data-folder.js +0 -99
  372. package/dist/cli/menu/share-settings.d.ts +0 -21
  373. package/dist/cli/menu/share-settings.js +0 -112
  374. package/dist/cli/menu/vpn-login.d.ts +0 -16
  375. package/dist/cli/menu/vpn-login.js +0 -74
  376. package/dist/web/main-NRRS5O6Z.js +0 -157
  377. /package/dist/cli/{commands/data/collect.d.ts → services/data-collect.d.ts} +0 -0
  378. /package/dist/cli/{commands/data/remove.d.ts → services/data-remove.d.ts} +0 -0
@@ -0,0 +1,204 @@
1
+ // The health feature's work: the checks (through the repair engine), the repair log, the saved results
2
+ // (<storage>\health\last.json), and turning Windows Sandbox on. The CLI's doctor and repair call healthWith too; the
3
+ // menu and the web run the operations. Talks only through io.
4
+ import fs from 'node:fs';
5
+ import path from 'node:path';
6
+ import { packageVersion } from '../../../core/package-info.js';
7
+ import { assertNoLinks, dirExists, errMsg, fail, safeText } from '../../../core/util/index.js';
8
+ import { assertTestWritable } from '../../../host/test-guard.js';
9
+ import { JsonFile } from '../../../shared/io/index.js';
10
+ import { requireOnPc } from '../../../cli/commands/context.js';
11
+ import { buildEnv } from '../../../cli/commands/repair/env.js';
12
+ import { runHealth } from '../../../cli/commands/repair/health-run.js';
13
+ import { logText, writeRepairLog } from '../../../cli/commands/repair/log.js';
14
+ import { ALL_CHECKS } from '../../../cli/commands/repair/checks/index.js';
15
+ import { ENABLE_COMMAND } from '../../../cli/commands/setup/facts.js';
16
+ import { HealthService } from '../../../cli/services/index.js';
17
+ import { implement } from '../../context.js';
18
+ import { cancelled } from '../../kernel/index.js';
19
+ import { checkHealth, CheckRowSchema, enableSandbox, HealthLastSchema, lastHealth, repairHealth, resultLines, } from './health.def.js';
20
+ /** Where the saved results are: <storage>\health\last.json. */
21
+ function lastFile(storageRoot) {
22
+ return path.join(storageRoot, 'health', 'last.json');
23
+ }
24
+ function readLast(storageRoot) {
25
+ return new JsonFile(HealthLastSchema, lastFile(storageRoot)).read();
26
+ }
27
+ /**
28
+ * Saves the results. A folder that cannot be written must not fail the check or repair (the result is on screen and in
29
+ * the log), so a failure is not raised.
30
+ */
31
+ function saveLast(storageRoot, last) {
32
+ if (!dirExists(storageRoot))
33
+ return;
34
+ try {
35
+ const dir = path.join(storageRoot, 'health');
36
+ assertNoLinks(storageRoot, dir);
37
+ assertTestWritable(lastFile(storageRoot));
38
+ fs.mkdirSync(dir, { recursive: true });
39
+ new JsonFile(HealthLastSchema, lastFile(storageRoot)).write(last);
40
+ }
41
+ catch {
42
+ // Saving is a convenience: the page then shows the last one saved, or nothing.
43
+ }
44
+ }
45
+ /** A result as saved: the text cleaned (it can quote what the sandbox wrote), the timing left out. */
46
+ function savedRow(r) {
47
+ const clean = (t) => (t === undefined ? undefined : safeText(t));
48
+ return CheckRowSchema.parse({
49
+ id: r.id,
50
+ group: r.group,
51
+ name: safeText(r.name),
52
+ status: r.status,
53
+ detail: safeText(r.detail),
54
+ means: clean(r.means),
55
+ fix: clean(r.fix),
56
+ plan: clean(r.plan),
57
+ lines: r.lines?.map((l) => safeText(l)),
58
+ fixable: r.fixable,
59
+ timedOut: r.timedOut,
60
+ applied: r.applied && {
61
+ done: safeText(r.applied.done),
62
+ before: safeText(r.applied.before),
63
+ after: safeText(r.applied.after),
64
+ },
65
+ error: clean(r.error),
66
+ });
67
+ }
68
+ /** What `sandbox setup` found, as the page keeps it (null when it could not be read). */
69
+ function setupOf(ctx) {
70
+ const health = new HealthService(ctx);
71
+ try {
72
+ health.assertWindows();
73
+ const report = health.setupReport();
74
+ return {
75
+ checks: report.checks.map((c) => ({ name: safeText(c.name), status: c.status, detail: safeText(c.detail) })),
76
+ canEnable: report.canEnable,
77
+ error: null,
78
+ };
79
+ }
80
+ catch (e) {
81
+ return { checks: [], canEnable: false, error: safeText(errMsg(e)) };
82
+ }
83
+ }
84
+ function quote(n, what) {
85
+ return n + ' ' + what + (n === 1 ? '' : 's');
86
+ }
87
+ /** Where a run's results go on the surfaces that have no terminal: the shared core's io. */
88
+ export function ioEvents(io) {
89
+ let group = null;
90
+ const heading = (g) => {
91
+ if (g === group)
92
+ return;
93
+ group = g;
94
+ io.log(g, 'accent');
95
+ };
96
+ return {
97
+ hooks: () => ({
98
+ lookStart: (check) => io.progress('Checking ' + (check.checking ?? check.name.toLowerCase())),
99
+ lookEnd: (r) => {
100
+ heading(r.group);
101
+ for (const l of resultLines(r))
102
+ io.log(l.text, l.tone);
103
+ },
104
+ fixStart: (r) => io.progress('Fixing: ' + (r.plan ?? r.name)),
105
+ fixEnd: (r) => {
106
+ heading(r.group);
107
+ if (r.status === 'fixed') {
108
+ io.log(' [fixed] ' + r.name + ': ' + (r.applied?.done ?? r.detail));
109
+ return;
110
+ }
111
+ io.log(' [x] ' + r.name + ': the fix did not work' + (r.error ? ' (' + r.error + ')' : ''), 'danger');
112
+ if (r.fix)
113
+ io.log(' Fix: ' + r.fix);
114
+ },
115
+ }),
116
+ plan: (fixable) => {
117
+ io.log('Repair will change:', 'accent');
118
+ fixable.forEach((r, i) => {
119
+ io.log(' ' + (i + 1) + '. ' + r.name + ': ' + (r.plan ?? r.detail));
120
+ for (const line of (r.lines ?? []).slice(0, 6))
121
+ io.log(' ' + line);
122
+ });
123
+ io.log('Nothing is deleted except leftovers; your settings, logins and projects are never removed.');
124
+ },
125
+ line: (text) => io.log(text),
126
+ };
127
+ }
128
+ /**
129
+ * The one run of doctor and repair, for every surface: look, ask (when allowed), fix, write the repair log, and save
130
+ * the results. The CLI prints what this returns; the menu and the web show the saved results.
131
+ */
132
+ export async function healthWith(ctx, request, surface) {
133
+ if (request.mode === 'repair')
134
+ requireOnPc('repair');
135
+ const env = buildEnv(ctx, request.configError ?? null);
136
+ const question = request.mode === 'doctor'
137
+ ? (n) => quote(n, 'problem') + ' can be fixed. Fix ' + (n === 1 ? 'it' : 'them') + ' now?'
138
+ : (n) => 'Fix ' + (n === 1 ? 'this problem' : 'these ' + n + ' problems') + '?';
139
+ const report = await runHealth(env, surface.events, { yes: request.yes, ask: surface.mayAsk, question }, ALL_CHECKS, surface.confirmFix);
140
+ const details = request.configError ? [] : new HealthService(ctx).doctor(request.harness);
141
+ let log = null;
142
+ if (request.mode === 'repair') {
143
+ const when = new Date();
144
+ log = writeRepairLog(ctx.storageRoot, logText({
145
+ when,
146
+ version: packageVersion(),
147
+ command: 'sandbox repair' + (request.yes ? ' --yes' : ''),
148
+ found: report.found,
149
+ final: report.final,
150
+ summary: report.summary,
151
+ }), when);
152
+ }
153
+ saveLast(ctx.storageRoot, {
154
+ at: new Date().toISOString(),
155
+ mode: request.mode === 'repair' ? 'repair' : 'check',
156
+ checks: report.final.map(savedRow),
157
+ summary: report.summary,
158
+ details: details.map(([name, detail]) => [safeText(name), safeText(detail)]),
159
+ setup: request.setup ?? null,
160
+ log: log === null ? null : safeText(log),
161
+ });
162
+ return { report, details, log };
163
+ }
164
+ /** Updates the saved results' setup part (after turning the feature on); nothing is saved before the first check. */
165
+ function refreshSetup(ctx) {
166
+ const last = readLast(ctx.storageRoot);
167
+ if (last)
168
+ saveLast(ctx.storageRoot, { ...last, setup: setupOf(ctx) });
169
+ }
170
+ export const checkHealthRun = implement(checkHealth, async (ctx, input, io) => {
171
+ io.progress('Checking this PC');
172
+ const { report } = await healthWith(ctx, { mode: 'doctor', yes: false, harness: input.harness, setup: setupOf(ctx) }, { events: ioEvents(io), mayAsk: false, confirmFix: () => Promise.resolve(false) });
173
+ return { summary: report.summary, changed: report.changed, log: null };
174
+ });
175
+ export const repairHealthRun = implement(repairHealth, async (ctx, _input, io) => {
176
+ // A "no" is not cancelled(): the run logs "Nothing was changed." and still writes the log, as the command did.
177
+ const previous = readLast(ctx.storageRoot);
178
+ const { report, log } = await healthWith(ctx, { mode: 'repair', yes: false, setup: previous?.setup ?? null }, {
179
+ events: ioEvents(io),
180
+ mayAsk: true,
181
+ confirmFix: (question) => io.confirm({ title: question, yes: 'Fix', danger: true }),
182
+ });
183
+ return { summary: report.summary, changed: report.changed, log };
184
+ });
185
+ export const enableSandboxRun = implement(enableSandbox, async (ctx, _input, io) => {
186
+ requireOnPc('setup');
187
+ const health = new HealthService(ctx);
188
+ health.assertWindows();
189
+ const yes = await io.confirm({
190
+ title: 'Turn on Windows Sandbox?',
191
+ lines: ['Windows asks for admin permission, then you restart Windows to finish.'],
192
+ yes: 'Turn on',
193
+ danger: true,
194
+ });
195
+ if (!yes)
196
+ cancelled();
197
+ io.progress('Turning on Windows Sandbox');
198
+ if (!health.enableFeature('ignore'))
199
+ fail('Windows Sandbox could not be turned on (or the admin prompt was declined).', 'In an admin PowerShell run: ' + ENABLE_COMMAND + ', then restart Windows.');
200
+ refreshSetup(ctx);
201
+ return { message: 'Done. Restart Windows to finish.' };
202
+ });
203
+ /** The saved results for the menu and the web (the page reads them; nothing is checked). */
204
+ export const lastHealthRun = implement(lastHealth, (ctx) => ({ last: readLast(ctx.storageRoot) }));
@@ -0,0 +1,2 @@
1
+ export * from './health.def.js';
2
+ export * from './health.run.js';
@@ -0,0 +1,3 @@
1
+ // The health feature: the checks of this PC and the sandbox, the saved results, and turning Windows Sandbox on.
2
+ export * from './health.def.js';
3
+ export * from './health.run.js';
@@ -0,0 +1,2 @@
1
+ export * from './logs.def.js';
2
+ export * from './logs.run.js';
@@ -0,0 +1,3 @@
1
+ // The logs feature: the sandbox's own logs (the files, the end of one as it grows, the last crash report).
2
+ export * from './logs.def.js';
3
+ export * from './logs.run.js';
@@ -0,0 +1,78 @@
1
+ import { z } from 'zod';
2
+ import { type Page } from '../../kernel/index.js';
3
+ /** The name that shows the newest crash report instead of a log (never a log file name: those start with guest-,
4
+ * daemon- or bootstrap-). */
5
+ export declare const CRASH = "@crash";
6
+ export declare const LogFileSchema: z.ZodObject<{
7
+ name: z.ZodString;
8
+ path: z.ZodString;
9
+ bytes: z.ZodNumber;
10
+ modified: z.ZodNumber;
11
+ }, z.core.$strip>;
12
+ export type LogFileRow = z.output<typeof LogFileSchema>;
13
+ export declare const LogFilesSchema: z.ZodObject<{
14
+ folder: z.ZodString;
15
+ files: z.ZodArray<z.ZodObject<{
16
+ name: z.ZodString;
17
+ path: z.ZodString;
18
+ bytes: z.ZodNumber;
19
+ modified: z.ZodNumber;
20
+ }, z.core.$strip>>;
21
+ crash: z.ZodBoolean;
22
+ }, z.core.$strip>;
23
+ export type LogFiles = z.output<typeof LogFilesSchema>;
24
+ export declare const LogTailSchema: z.ZodObject<{
25
+ name: z.ZodString;
26
+ file: z.ZodString;
27
+ text: z.ZodString;
28
+ next: z.ZodNumber;
29
+ }, z.core.$strip>;
30
+ export type LogTail = z.output<typeof LogTailSchema>;
31
+ export declare const listLogs: import("../../kernel/define.js").QueryDef<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
32
+ folder: z.ZodString;
33
+ files: z.ZodArray<z.ZodObject<{
34
+ name: z.ZodString;
35
+ path: z.ZodString;
36
+ bytes: z.ZodNumber;
37
+ modified: z.ZodNumber;
38
+ }, z.core.$strip>>;
39
+ crash: z.ZodBoolean;
40
+ }, z.core.$strip>, "logs.list">;
41
+ export declare const tailLog: import("../../kernel/define.js").QueryDef<z.ZodObject<{
42
+ name: z.ZodOptional<z.ZodString>;
43
+ from: z.ZodDefault<z.ZodNumber>;
44
+ lines: z.ZodDefault<z.ZodNumber>;
45
+ }, z.core.$strip>, z.ZodObject<{
46
+ name: z.ZodString;
47
+ file: z.ZodString;
48
+ text: z.ZodString;
49
+ next: z.ZodNumber;
50
+ }, z.core.$strip>, "logs.tail">;
51
+ /** What the view's address can set: the log shown. */
52
+ export interface LogsParams {
53
+ readonly name?: string;
54
+ }
55
+ /** The page: one row per log (the one shown marked), the crash report last, and the end of the shown log. Pure. */
56
+ export declare function logsPage(files: LogFiles, tail?: LogTail): Page;
57
+ export declare const logsView: import("../../kernel/define.js").ViewDef<{
58
+ files: import("../../kernel/define.js").QueryDef<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
59
+ folder: z.ZodString;
60
+ files: z.ZodArray<z.ZodObject<{
61
+ name: z.ZodString;
62
+ path: z.ZodString;
63
+ bytes: z.ZodNumber;
64
+ modified: z.ZodNumber;
65
+ }, z.core.$strip>>;
66
+ crash: z.ZodBoolean;
67
+ }, z.core.$strip>, "logs.list">;
68
+ tail: import("../../kernel/define.js").QueryDef<z.ZodObject<{
69
+ name: z.ZodOptional<z.ZodString>;
70
+ from: z.ZodDefault<z.ZodNumber>;
71
+ lines: z.ZodDefault<z.ZodNumber>;
72
+ }, z.core.$strip>, z.ZodObject<{
73
+ name: z.ZodString;
74
+ file: z.ZodString;
75
+ text: z.ZodString;
76
+ next: z.ZodNumber;
77
+ }, z.core.$strip>, "logs.tail">;
78
+ }, LogsParams, "logs">;
@@ -0,0 +1,115 @@
1
+ // The sandbox's own logs: the files (newest first), the end of one (live, so it follows), and the last crash report.
2
+ // Pure: schemas, labels and the view; logs.run.ts reads them through LogsService. `sandbox logs` stays a hand-written
3
+ // command (--follow prints until Ctrl+C), so both queries are CLI-exempt and that command reads them with readQuery.
4
+ import { z } from 'zod';
5
+ import { ago, bytesText, defineQuery, defineView, link, } from '../../kernel/index.js';
6
+ /** The name that shows the newest crash report instead of a log (never a log file name: those start with guest-,
7
+ * daemon- or bootstrap-). */
8
+ export const CRASH = '@crash';
9
+ /** Most lines the page shows of one log (a query gives at most `lines`; a crash report can be longer). */
10
+ const MAX_SHOWN = 1000;
11
+ const CLI_EXEMPT = 'sandbox logs is hand-written: --follow prints new lines until Ctrl+C; it reads this same query (readQuery)';
12
+ export const LogFileSchema = z.object({
13
+ name: z.string().describe('The log file'),
14
+ path: z.string().describe('Where it is on this PC'),
15
+ bytes: z.number().describe('Its size in bytes'),
16
+ modified: z.number().describe('When it was last written (ms)'),
17
+ });
18
+ export const LogFilesSchema = z.object({
19
+ folder: z.string().describe('The folder the logs are in'),
20
+ files: z.array(LogFileSchema).describe('The log files, newest first'),
21
+ crash: z.boolean().describe('A crash report exists'),
22
+ });
23
+ export const LogTailSchema = z.object({
24
+ name: z.string().describe('The log shown, or @crash for the last crash report (empty: there are no logs)'),
25
+ file: z.string().describe('Its full path (empty: there are no logs)'),
26
+ text: z.string().describe('The text read, made safe for a terminal'),
27
+ next: z.number().describe('Where to read on from next time (bytes)'),
28
+ });
29
+ export const listLogs = defineQuery({
30
+ id: 'logs.list',
31
+ title: 'Logs',
32
+ summary: "list the sandbox's own logs",
33
+ input: z.object({}),
34
+ output: LogFilesSchema,
35
+ surfaces: { except: { cli: CLI_EXEMPT } },
36
+ });
37
+ export const tailLog = defineQuery({
38
+ id: 'logs.tail',
39
+ title: 'Log',
40
+ summary: 'the end of one log, followed as it grows',
41
+ input: z.object({
42
+ name: z
43
+ .string()
44
+ .max(200)
45
+ .optional()
46
+ .describe('The log to show (default: the newest), or @crash for the last crash report'),
47
+ from: z.number().int().min(0).default(0).describe('Read on from this byte (0: the end of the log)'),
48
+ lines: z.number().int().min(1).max(1000).default(120).describe('How many lines of the end to show'),
49
+ }),
50
+ output: LogTailSchema,
51
+ live: { everyMs: 1000 },
52
+ surfaces: { except: { cli: CLI_EXEMPT } },
53
+ });
54
+ /** The badge of the log the page shows (a log is not "this folder": marked would say that). */
55
+ const SHOWING = { text: 'showing', tone: 'accent' };
56
+ /** The lines of a text as a page shows them (the last MAX_SHOWN, no trailing empty line). */
57
+ function shownLines(text) {
58
+ const lines = text.split('\n');
59
+ if (lines.length && lines[lines.length - 1] === '')
60
+ lines.pop();
61
+ return lines.slice(-MAX_SHOWN);
62
+ }
63
+ /** The page: one row per log (the one shown marked), the crash report last, and the end of the shown log. Pure. */
64
+ export function logsPage(files, tail) {
65
+ const shown = tail?.file ? tail : undefined;
66
+ const items = files.files.map((f) => ({
67
+ id: 'log:' + f.name,
68
+ label: f.name,
69
+ hint: bytesText(f.bytes) + ' ' + ago(f.modified),
70
+ keys: 'Enter shows the end of this log in the terminal.',
71
+ primary: link({ kind: 'view', view: 'logs', params: { name: f.name } }, 'Show', { verb: 'show' }),
72
+ ...(shown?.name === f.name ? { badges: [SHOWING] } : {}),
73
+ }));
74
+ if (files.crash)
75
+ items.push({
76
+ id: 'log:' + CRASH,
77
+ label: 'Last crash report',
78
+ description: 'What Windows logged, this PC and the sandbox memory when the sandbox last ended in a crash.',
79
+ primary: link({ kind: 'view', view: 'logs', params: { name: CRASH } }, 'Show', { verb: 'show' }),
80
+ ...(shown?.name === CRASH ? { badges: [SHOWING] } : {}),
81
+ });
82
+ const tailSection = shown
83
+ ? [
84
+ {
85
+ id: 'tail',
86
+ title: shown.name === CRASH ? 'Last crash report' : shown.name,
87
+ summary: shown.file,
88
+ text: shownLines(shown.text),
89
+ },
90
+ ]
91
+ : [];
92
+ return {
93
+ title: 'Logs',
94
+ sections: [{ id: 'files', items }, ...tailSection],
95
+ actions: [
96
+ // The web hides command links (it follows live instead); this one stays because `logs` is a hand-written command.
97
+ link({ kind: 'command', argv: ['logs', '--follow'] }, 'Follow the newest log', {
98
+ key: 'f',
99
+ verb: 'follow in the terminal',
100
+ importance: 2,
101
+ }),
102
+ ],
103
+ empty: { title: 'No logs yet', text: 'Logs appear after the first start.', cliText: 'No sandbox logs yet.' },
104
+ };
105
+ }
106
+ export const logsView = defineView({
107
+ id: 'logs',
108
+ title: 'Logs',
109
+ summary: "The sandbox's own logs: pick one to see its end as it grows.",
110
+ queries: { files: listLogs, tail: tailLog },
111
+ operations: [],
112
+ params: ['name'],
113
+ inputs: (p) => ({ tail: p.name ? { name: p.name } : {} }),
114
+ build: ({ files, tail }) => logsPage(files, tail),
115
+ });
@@ -0,0 +1,20 @@
1
+ export declare const listLogsRun: import("../../kernel/define.js").Implementation<import("../../kernel/define.js").QueryDef<import("zod").ZodObject<{}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
2
+ folder: import("zod").ZodString;
3
+ files: import("zod").ZodArray<import("zod").ZodObject<{
4
+ name: import("zod").ZodString;
5
+ path: import("zod").ZodString;
6
+ bytes: import("zod").ZodNumber;
7
+ modified: import("zod").ZodNumber;
8
+ }, import("zod/v4/core").$strip>>;
9
+ crash: import("zod").ZodBoolean;
10
+ }, import("zod/v4/core").$strip>, "logs.list">, import("../../../cli/commands/context.js").Context>;
11
+ export declare const tailLogRun: import("../../kernel/define.js").Implementation<import("../../kernel/define.js").QueryDef<import("zod").ZodObject<{
12
+ name: import("zod").ZodOptional<import("zod").ZodString>;
13
+ from: import("zod").ZodDefault<import("zod").ZodNumber>;
14
+ lines: import("zod").ZodDefault<import("zod").ZodNumber>;
15
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
16
+ name: import("zod").ZodString;
17
+ file: import("zod").ZodString;
18
+ text: import("zod").ZodString;
19
+ next: import("zod").ZodNumber;
20
+ }, import("zod/v4/core").$strip>, "logs.tail">, import("../../../cli/commands/context.js").Context>;
@@ -0,0 +1,42 @@
1
+ // The logs feature's work: the sandbox's log files and the end of one, through LogsService. The text is made safe for a
2
+ // terminal there (the sandbox wrote it); a name from outside is only ever an exact name from the folder listing.
3
+ import { fail, safeText } from '../../../core/util/index.js';
4
+ import { newestCrashReport } from '../../../host/life/index.js';
5
+ import { LogsService } from '../../../cli/services/index.js';
6
+ import { implement } from '../../context.js';
7
+ import { CRASH, listLogs, tailLog } from './logs.def.js';
8
+ /** The last `n` lines of a text, joined back the way they were (a trailing newline stays). */
9
+ function lastLines(text, n) {
10
+ return text.split('\n').slice(-n).join('\n');
11
+ }
12
+ export const listLogsRun = implement(listLogs, (ctx) => {
13
+ const service = new LogsService(ctx);
14
+ return {
15
+ folder: service.folder(),
16
+ files: service.files().map((f) => ({ name: f.name, path: f.path, bytes: f.bytes, modified: f.modified })),
17
+ crash: newestCrashReport(ctx.storageRoot) !== null,
18
+ };
19
+ });
20
+ export const tailLogRun = implement(tailLog, (ctx, input) => {
21
+ if (input.name === CRASH) {
22
+ const report = newestCrashReport(ctx.storageRoot);
23
+ if (!report)
24
+ return fail('No crash report yet: no sandbox has ended in a crash since this was installed.');
25
+ return { name: CRASH, file: report.file, text: safeText(report.text), next: 0 };
26
+ }
27
+ const service = new LogsService(ctx);
28
+ // No name and no logs yet: an empty answer (the page says so; the command line fails with the words it always had).
29
+ const name = input.name ?? service.files()[0]?.name;
30
+ if (!name)
31
+ return { name: '', file: '', text: '', next: 0 };
32
+ const file = service.byName(name);
33
+ const chunk = service.read(file, input.from);
34
+ if (!chunk)
35
+ return { name, file, text: '', next: input.from };
36
+ return {
37
+ name,
38
+ file,
39
+ text: input.from === 0 ? lastLines(chunk.text, input.lines) : chunk.text,
40
+ next: chunk.next,
41
+ };
42
+ });
@@ -0,0 +1,2 @@
1
+ export * from './projects.def.js';
2
+ export * from './projects.run.js';
@@ -0,0 +1,3 @@
1
+ // The projects feature: which projects a sandbox can open without a restart, roots and the all-projects setting.
2
+ export * from './projects.def.js';
3
+ export * from './projects.run.js';
@@ -0,0 +1,101 @@
1
+ import { z } from 'zod';
2
+ import { type Page } from '../../kernel/index.js';
3
+ export declare const ProjectRowSchema: z.ZodObject<{
4
+ folder: z.ZodString;
5
+ here: z.ZodBoolean;
6
+ known: z.ZodBoolean;
7
+ root: z.ZodNullable<z.ZodString>;
8
+ excluded: z.ZodBoolean;
9
+ mappedAtStart: z.ZodBoolean;
10
+ running: z.ZodNullable<z.ZodString>;
11
+ }, z.core.$strip>;
12
+ export type ProjectRow = z.output<typeof ProjectRowSchema>;
13
+ export declare const ProjectsListSchema: z.ZodObject<{
14
+ all: z.ZodBoolean;
15
+ roots: z.ZodArray<z.ZodString>;
16
+ exclude: z.ZodArray<z.ZodString>;
17
+ projects: z.ZodArray<z.ZodObject<{
18
+ folder: z.ZodString;
19
+ here: z.ZodBoolean;
20
+ known: z.ZodBoolean;
21
+ root: z.ZodNullable<z.ZodString>;
22
+ excluded: z.ZodBoolean;
23
+ mappedAtStart: z.ZodBoolean;
24
+ running: z.ZodNullable<z.ZodString>;
25
+ }, z.core.$strip>>;
26
+ }, z.core.$strip>;
27
+ export type ProjectsList = z.output<typeof ProjectsListSchema>;
28
+ export declare const listProjects: import("../../kernel/define.js").QueryDef<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
29
+ all: z.ZodBoolean;
30
+ roots: z.ZodArray<z.ZodString>;
31
+ exclude: z.ZodArray<z.ZodString>;
32
+ projects: z.ZodArray<z.ZodObject<{
33
+ folder: z.ZodString;
34
+ here: z.ZodBoolean;
35
+ known: z.ZodBoolean;
36
+ root: z.ZodNullable<z.ZodString>;
37
+ excluded: z.ZodBoolean;
38
+ mappedAtStart: z.ZodBoolean;
39
+ running: z.ZodNullable<z.ZodString>;
40
+ }, z.core.$strip>>;
41
+ }, z.core.$strip>, "projects.list">;
42
+ export declare const chooseProjects: import("../../kernel/define.js").OperationDef<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
43
+ message: z.ZodString;
44
+ }, z.core.$strip>, "projects.choose">;
45
+ export declare const addProject: import("../../kernel/define.js").OperationDef<z.ZodObject<{
46
+ projectFolder: z.ZodOptional<z.ZodString>;
47
+ }, z.core.$strip>, z.ZodObject<{
48
+ message: z.ZodString;
49
+ next: z.ZodOptional<z.ZodString>;
50
+ }, z.core.$strip>, "projects.add">;
51
+ export declare const removeProject: import("../../kernel/define.js").OperationDef<z.ZodObject<{
52
+ projectFolder: z.ZodOptional<z.ZodString>;
53
+ }, z.core.$strip>, z.ZodObject<{
54
+ message: z.ZodString;
55
+ }, z.core.$strip>, "projects.remove">;
56
+ export declare const includeProject: import("../../kernel/define.js").OperationDef<z.ZodObject<{
57
+ projectFolder: z.ZodOptional<z.ZodString>;
58
+ }, z.core.$strip>, z.ZodObject<{
59
+ message: z.ZodString;
60
+ }, z.core.$strip>, "projects.include">;
61
+ export declare const excludeProject: import("../../kernel/define.js").OperationDef<z.ZodObject<{
62
+ projectFolder: z.ZodOptional<z.ZodString>;
63
+ }, z.core.$strip>, z.ZodObject<{
64
+ message: z.ZodString;
65
+ }, z.core.$strip>, "projects.exclude">;
66
+ export declare const allProjects: import("../../kernel/define.js").OperationDef<z.ZodObject<{
67
+ state: z.ZodOptional<z.ZodEnum<{
68
+ off: "off";
69
+ on: "on";
70
+ }>>;
71
+ }, z.core.$strip>, z.ZodObject<{
72
+ message: z.ZodString;
73
+ }, z.core.$strip>, "projects.all">;
74
+ export declare const projectRoots: import("../../kernel/define.js").OperationDef<z.ZodObject<{
75
+ change: z.ZodDefault<z.ZodEnum<{
76
+ list: "list";
77
+ add: "add";
78
+ remove: "remove";
79
+ }>>;
80
+ rootFolder: z.ZodOptional<z.ZodString>;
81
+ }, z.core.$strip>, z.ZodObject<{
82
+ message: z.ZodString;
83
+ }, z.core.$strip>, "projects.roots">;
84
+ /** The projects page: the settings, the project roots, and the projects (the same rows as the menu's Projects). */
85
+ export declare function projectsPage(o: ProjectsList): Page;
86
+ export declare const projectsView: import("../../kernel/define.js").ViewDef<{
87
+ projects: import("../../kernel/define.js").QueryDef<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
88
+ all: z.ZodBoolean;
89
+ roots: z.ZodArray<z.ZodString>;
90
+ exclude: z.ZodArray<z.ZodString>;
91
+ projects: z.ZodArray<z.ZodObject<{
92
+ folder: z.ZodString;
93
+ here: z.ZodBoolean;
94
+ known: z.ZodBoolean;
95
+ root: z.ZodNullable<z.ZodString>;
96
+ excluded: z.ZodBoolean;
97
+ mappedAtStart: z.ZodBoolean;
98
+ running: z.ZodNullable<z.ZodString>;
99
+ }, z.core.$strip>>;
100
+ }, z.core.$strip>, "projects.list">;
101
+ }, Record<string, never>, "projects">;