home-hosted 0.13.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (485) hide show
  1. package/README.md +117 -322
  2. package/bin/home-hosted.mjs +41 -0
  3. package/dist/chunks/account-DiLrSyww.js +359 -0
  4. package/dist/chunks/account-DiLrSyww.js.map +1 -0
  5. package/dist/chunks/add-DEIYVkNK.js +183 -0
  6. package/dist/chunks/add-DEIYVkNK.js.map +1 -0
  7. package/dist/chunks/{archive-DP-XQR8X.js → archive-DFi3qK1c.js} +25 -73
  8. package/dist/chunks/archive-DFi3qK1c.js.map +1 -0
  9. package/dist/chunks/{atomic-C1PfJpE7.js → atomic-SZUwDtGD.js} +3 -6
  10. package/dist/chunks/atomic-SZUwDtGD.js.map +1 -0
  11. package/dist/chunks/{backup-CZcVca2a.js → backup-DnyxIzw0.js} +110 -190
  12. package/dist/chunks/backup-DnyxIzw0.js.map +1 -0
  13. package/dist/chunks/backups-BrrN6cwW.js +2203 -0
  14. package/dist/chunks/backups-BrrN6cwW.js.map +1 -0
  15. package/dist/chunks/bind-DIxrnUst.js +43 -0
  16. package/dist/chunks/bind-DIxrnUst.js.map +1 -0
  17. package/dist/chunks/config-text-DxMOQQnk.js +34 -0
  18. package/dist/chunks/config-text-DxMOQQnk.js.map +1 -0
  19. package/dist/chunks/{contracts-CMBD1TF9.js → contracts-CxZ7u1L3.js} +1239 -1454
  20. package/dist/chunks/contracts-CxZ7u1L3.js.map +1 -0
  21. package/dist/chunks/daemon-BAAYUYQC.js +211 -0
  22. package/dist/chunks/daemon-BAAYUYQC.js.map +1 -0
  23. package/dist/chunks/daemon-log-Ccu-69vB.js +179 -0
  24. package/dist/chunks/daemon-log-Ccu-69vB.js.map +1 -0
  25. package/dist/chunks/deploy-CggSOEkq.js +144 -0
  26. package/dist/chunks/deploy-CggSOEkq.js.map +1 -0
  27. package/dist/chunks/{docker-Cy9Lyvda.js → docker--Un0uLfF.js} +32 -68
  28. package/dist/chunks/docker--Un0uLfF.js.map +1 -0
  29. package/dist/chunks/{down-pKbGCW9d.js → down-CpIN7LEQ.js} +34 -94
  30. package/dist/chunks/down-CpIN7LEQ.js.map +1 -0
  31. package/dist/chunks/exposure-CDJNvOCK.js +229 -0
  32. package/dist/chunks/exposure-CDJNvOCK.js.map +1 -0
  33. package/dist/chunks/import-Bd4VZH0f.js +205 -0
  34. package/dist/chunks/import-Bd4VZH0f.js.map +1 -0
  35. package/dist/chunks/import-plan--fDS_l5r.js +147 -0
  36. package/dist/chunks/import-plan--fDS_l5r.js.map +1 -0
  37. package/dist/chunks/import-write-BTfbeV26.js +42 -0
  38. package/dist/chunks/import-write-BTfbeV26.js.map +1 -0
  39. package/dist/chunks/{init-BZ7hK9Vf.js → init-Bv3oH65x.js} +14 -50
  40. package/dist/chunks/init-Bv3oH65x.js.map +1 -0
  41. package/dist/chunks/job-CYOdN6Ub.js +341 -0
  42. package/dist/chunks/job-CYOdN6Ub.js.map +1 -0
  43. package/dist/chunks/jobs-BX4ahcfh.js +489 -0
  44. package/dist/chunks/jobs-BX4ahcfh.js.map +1 -0
  45. package/dist/chunks/last-stop-DD3lHwo_.js +42 -0
  46. package/dist/chunks/last-stop-DD3lHwo_.js.map +1 -0
  47. package/dist/chunks/layout-D0ysDNav.js +18 -0
  48. package/dist/chunks/layout-D0ysDNav.js.map +1 -0
  49. package/dist/chunks/lazy-kfcBNeqj.js +48 -0
  50. package/dist/chunks/lazy-kfcBNeqj.js.map +1 -0
  51. package/dist/chunks/log-buffer-B7jmn7ts.js +110 -0
  52. package/dist/chunks/log-buffer-B7jmn7ts.js.map +1 -0
  53. package/dist/chunks/log-files-CZL2UhuE.js +488 -0
  54. package/dist/chunks/log-files-CZL2UhuE.js.map +1 -0
  55. package/dist/chunks/{logger-B5U4GD3j.js → logger-BnrKTBHQ.js} +2 -6
  56. package/dist/chunks/logger-BnrKTBHQ.js.map +1 -0
  57. package/dist/chunks/{logs---TI_bxM.js → logs-DxKI6OW2.js} +23 -73
  58. package/dist/chunks/logs-DxKI6OW2.js.map +1 -0
  59. package/dist/chunks/ls-BseUHy_m.js +128 -0
  60. package/dist/chunks/ls-BseUHy_m.js.map +1 -0
  61. package/dist/chunks/migrate-D4w_dXDm.js +268 -0
  62. package/dist/chunks/migrate-D4w_dXDm.js.map +1 -0
  63. package/dist/chunks/{nanny-B-Eu0sFW.js → nanny-BWh7nuvv.js} +21 -14
  64. package/dist/chunks/nanny-BWh7nuvv.js.map +1 -0
  65. package/dist/chunks/{nanny-ChMtq1Zl.js → nanny-BjF2-1pv.js} +3 -3
  66. package/dist/chunks/{nanny-ChMtq1Zl.js.map → nanny-BjF2-1pv.js.map} +1 -1
  67. package/dist/chunks/nanny-DGTXVq5d.js +806 -0
  68. package/dist/chunks/nanny-DGTXVq5d.js.map +1 -0
  69. package/dist/chunks/{nanny-sweep-DErnlPY1.js → nanny-sweep-hjmZ_p7S.js} +14 -24
  70. package/dist/chunks/nanny-sweep-hjmZ_p7S.js.map +1 -0
  71. package/dist/chunks/{nearest-6KgQEDUe.js → nearest-DOx4jySJ.js} +2 -10
  72. package/dist/chunks/nearest-DOx4jySJ.js.map +1 -0
  73. package/dist/chunks/{parse-DhmG26fI.js → parse-DVMPLUDe.js} +47 -72
  74. package/dist/chunks/parse-DVMPLUDe.js.map +1 -0
  75. package/dist/chunks/password-policy-Clq6PGE-.js +9 -0
  76. package/dist/chunks/password-policy-Clq6PGE-.js.map +1 -0
  77. package/dist/chunks/{paths-CGlGDrOU.js → paths-C34-TJLh.js} +32 -56
  78. package/dist/chunks/paths-C34-TJLh.js.map +1 -0
  79. package/dist/chunks/{port-B8WBTRMk.js → port-CnsrxKNR.js} +27 -71
  80. package/dist/chunks/port-CnsrxKNR.js.map +1 -0
  81. package/dist/chunks/process-CboOFPU_.js +192 -0
  82. package/dist/chunks/process-CboOFPU_.js.map +1 -0
  83. package/dist/chunks/{restart-Des4DrAN.js → restart-C0J8dZ2L.js} +11 -29
  84. package/dist/chunks/restart-C0J8dZ2L.js.map +1 -0
  85. package/dist/chunks/run-deploy-DoNDvwT4.js +91 -0
  86. package/dist/chunks/run-deploy-DoNDvwT4.js.map +1 -0
  87. package/dist/chunks/{schema-B240VXcV.js → schema-CZ6f-PHD.js} +7 -20
  88. package/dist/chunks/schema-CZ6f-PHD.js.map +1 -0
  89. package/dist/chunks/secret-MY397r90.js +219 -0
  90. package/dist/chunks/secret-MY397r90.js.map +1 -0
  91. package/dist/chunks/secrets-CG5N4lwY.js +1061 -0
  92. package/dist/chunks/secrets-CG5N4lwY.js.map +1 -0
  93. package/dist/chunks/server-Dm_dXfTW.js +255 -0
  94. package/dist/chunks/server-Dm_dXfTW.js.map +1 -0
  95. package/dist/chunks/server-attention-UQwYXqKe.js +10 -0
  96. package/dist/chunks/server-attention-UQwYXqKe.js.map +1 -0
  97. package/dist/chunks/server-create-D7nvhgBd.js +96 -0
  98. package/dist/chunks/server-create-D7nvhgBd.js.map +1 -0
  99. package/dist/chunks/server-ids-BEQD2rFz.js +23 -0
  100. package/dist/chunks/server-ids-BEQD2rFz.js.map +1 -0
  101. package/dist/chunks/server-vars-DMYmHutL.js +27 -0
  102. package/dist/chunks/server-vars-DMYmHutL.js.map +1 -0
  103. package/dist/chunks/service-C8l-ewNA.js +585 -0
  104. package/dist/chunks/service-C8l-ewNA.js.map +1 -0
  105. package/dist/chunks/{settings-xu-XTfWg.js → settings-CtYDs5PX.js} +62 -78
  106. package/dist/chunks/settings-CtYDs5PX.js.map +1 -0
  107. package/dist/chunks/{setup-temp-CAN4_bA-.js → setup-temp-TAtDmMMU.js} +43 -37
  108. package/dist/chunks/setup-temp-TAtDmMMU.js.map +1 -0
  109. package/dist/chunks/shape-CDGeYl_J.js +9 -0
  110. package/dist/chunks/shape-CDGeYl_J.js.map +1 -0
  111. package/dist/chunks/{src-BtWMFmzZ.js → src-BnzkVy_M.js} +12548 -10576
  112. package/dist/chunks/src-BnzkVy_M.js.map +1 -0
  113. package/dist/chunks/{status-DT1EsA-B.js → status-efbbfYZQ.js} +53 -26
  114. package/dist/chunks/status-efbbfYZQ.js.map +1 -0
  115. package/dist/chunks/store-Bs_Lljjm.js +2082 -0
  116. package/dist/chunks/store-Bs_Lljjm.js.map +1 -0
  117. package/dist/chunks/template-xan58bJh.js +28 -0
  118. package/dist/chunks/template-xan58bJh.js.map +1 -0
  119. package/dist/chunks/token-DDeWfZA4.js +142 -0
  120. package/dist/chunks/token-DDeWfZA4.js.map +1 -0
  121. package/dist/chunks/{ui-D562aqw5.js → ui-BcIAtyxE.js} +68 -79
  122. package/dist/chunks/ui-BcIAtyxE.js.map +1 -0
  123. package/dist/chunks/{ui-dir-CsU3uLNV.js → ui-dir-ClCzVRc3.js} +3 -7
  124. package/dist/chunks/ui-dir-ClCzVRc3.js.map +1 -0
  125. package/dist/chunks/ui-format-CDvvqOoi.js +53 -0
  126. package/dist/chunks/ui-format-CDvvqOoi.js.map +1 -0
  127. package/dist/chunks/{ui-release-DKzVvlLd.js → ui-release-XbJ85pYI.js} +36 -38
  128. package/dist/chunks/ui-release-XbJ85pYI.js.map +1 -0
  129. package/dist/chunks/{ui-revert-EkBBwRTt.js → ui-revert-Dgawq7ze.js} +4 -4
  130. package/dist/chunks/ui-revert-Dgawq7ze.js.map +1 -0
  131. package/dist/chunks/{ui-switch-BnZTdMDd.js → ui-switch-CfQMbZ0g.js} +31 -38
  132. package/dist/chunks/ui-switch-CfQMbZ0g.js.map +1 -0
  133. package/dist/chunks/{ui-update-_xryLYxw.js → ui-update-B3PPivUm.js} +30 -48
  134. package/dist/chunks/ui-update-B3PPivUm.js.map +1 -0
  135. package/dist/chunks/ui-update-CAiH2tFb.js +109 -0
  136. package/dist/chunks/ui-update-CAiH2tFb.js.map +1 -0
  137. package/dist/chunks/{up-Pdz-l6IH.js → up-BQSnYxYd.js} +47 -53
  138. package/dist/chunks/up-BQSnYxYd.js.map +1 -0
  139. package/dist/chunks/{usage-DFrCVXpT.js → usage-KG8TeOio.js} +7 -20
  140. package/dist/chunks/usage-KG8TeOio.js.map +1 -0
  141. package/dist/chunks/{workspaces-DYcfvKV_.js → workspaces-D9akpzU8.js} +80 -68
  142. package/dist/chunks/workspaces-D9akpzU8.js.map +1 -0
  143. package/dist/chunks/{wsl-temperature-BiCI4iK6.js → wsl-temperature-D-_d4Yk1.js} +47 -42
  144. package/dist/chunks/wsl-temperature-D-_d4Yk1.js.map +1 -0
  145. package/dist/cli.js +306 -238
  146. package/dist/cli.js.map +1 -1
  147. package/dist/client.js +76 -29
  148. package/dist/client.js.map +1 -1
  149. package/dist/types/api/acme.d.ts +3 -7
  150. package/dist/types/api/auth/$.routes.d.ts +107 -16
  151. package/dist/types/api/backups.d.ts +5 -5
  152. package/dist/types/api/control.d.ts +747 -38
  153. package/dist/types/api/ddns.d.ts +13 -18
  154. package/dist/types/api/events.d.ts +9 -3
  155. package/dist/types/api/health.d.ts +2 -4
  156. package/dist/types/api/jobs.d.ts +438 -0
  157. package/dist/types/api/logs.d.ts +20 -0
  158. package/dist/types/api/metrics.d.ts +2 -5
  159. package/dist/types/api/notifications.d.ts +3 -6
  160. package/dist/types/api/proxy.d.ts +63 -23
  161. package/dist/types/api/server-ops.d.ts +17 -0
  162. package/dist/types/api/servers/$.routes.d.ts +418 -186
  163. package/dist/types/api/session-required.d.ts +16 -0
  164. package/dist/types/api/settings.d.ts +7 -7
  165. package/dist/types/api/state.d.ts +100 -10
  166. package/dist/types/api/static.d.ts +2 -2
  167. package/dist/types/api/tls.d.ts +2 -5
  168. package/dist/types/api/workspaces/$.routes.d.ts +186 -12
  169. package/dist/types/api/wsl-temperature.d.ts +4 -10
  170. package/dist/types/app.d.ts +4511 -2778
  171. package/dist/types/cli/account.d.ts +23 -0
  172. package/dist/types/cli/add.d.ts +96 -0
  173. package/dist/types/cli/args.d.ts +24 -35
  174. package/dist/types/cli/backup-offline.d.ts +2 -8
  175. package/dist/types/cli/backup.d.ts +12 -21
  176. package/dist/types/cli/down.d.ts +15 -41
  177. package/dist/types/cli/import-plan.d.ts +55 -0
  178. package/dist/types/cli/import-write.d.ts +5 -0
  179. package/dist/types/cli/import.d.ts +86 -0
  180. package/dist/types/cli/io.d.ts +26 -35
  181. package/dist/types/cli/job.d.ts +99 -0
  182. package/dist/types/cli/logs.d.ts +1 -10
  183. package/dist/types/cli/ls.d.ts +57 -0
  184. package/dist/types/cli/migrate.d.ts +31 -8
  185. package/dist/types/cli/nearest.d.ts +1 -9
  186. package/dist/types/cli/run-deploy.d.ts +36 -0
  187. package/dist/types/cli/secret.d.ts +90 -0
  188. package/dist/types/cli/server.d.ts +6 -15
  189. package/dist/types/cli/service.d.ts +135 -0
  190. package/dist/types/cli/setup-temp.d.ts +17 -13
  191. package/dist/types/cli/status.d.ts +7 -1
  192. package/dist/types/cli/token.d.ts +6 -0
  193. package/dist/types/cli/ui-switch.d.ts +3 -14
  194. package/dist/types/cli/ui-update.d.ts +3 -16
  195. package/dist/types/cli/up.d.ts +9 -22
  196. package/dist/types/cli/usage.d.ts +2 -6
  197. package/dist/types/cli.d.ts +1 -10
  198. package/dist/types/client.d.ts +4099 -1142
  199. package/dist/types/config/accounts.d.ts +16 -0
  200. package/dist/types/config/jobs.d.ts +68 -0
  201. package/dist/types/config/layout.d.ts +2 -8
  202. package/dist/types/config/migrations.d.ts +9 -41
  203. package/dist/types/config/parse.d.ts +8 -13
  204. package/dist/types/config/patch.d.ts +1 -6
  205. package/dist/types/config/schema.d.ts +16 -18
  206. package/dist/types/config/secret-parts.d.ts +6 -27
  207. package/dist/types/config/secrets.d.ts +167 -88
  208. package/dist/types/config/seed.d.ts +1 -6
  209. package/dist/types/config/server-ids.d.ts +2 -11
  210. package/dist/types/config/settings.d.ts +13 -49
  211. package/dist/types/config/store.d.ts +17 -54
  212. package/dist/types/config/workspaces.d.ts +24 -56
  213. package/dist/types/helpers/action-result.d.ts +18 -32
  214. package/dist/types/helpers/atomic.d.ts +1 -4
  215. package/dist/types/helpers/backoff.d.ts +0 -1
  216. package/dist/types/helpers/bind.d.ts +3 -11
  217. package/dist/types/helpers/config-text.d.ts +4 -19
  218. package/dist/types/helpers/cookies.d.ts +2 -7
  219. package/dist/types/helpers/copy-tree.d.ts +4 -12
  220. package/dist/types/helpers/daemon-log.d.ts +8 -33
  221. package/dist/types/helpers/daemon.d.ts +20 -70
  222. package/dist/types/helpers/deferred.d.ts +2 -4
  223. package/dist/types/helpers/env-file.d.ts +2 -7
  224. package/dist/types/helpers/error.d.ts +3 -14
  225. package/dist/types/helpers/event-stream.d.ts +18 -10
  226. package/dist/types/helpers/factory.d.ts +2 -3
  227. package/dist/types/helpers/last-stop.d.ts +5 -12
  228. package/dist/types/helpers/logger.d.ts +1 -5
  229. package/dist/types/helpers/open.d.ts +0 -1
  230. package/dist/types/helpers/openapi.d.ts +19 -5
  231. package/dist/types/helpers/paths.d.ts +18 -53
  232. package/dist/types/helpers/restore-lock.d.ts +2 -17
  233. package/dist/types/helpers/runtime.d.ts +3 -13
  234. package/dist/types/helpers/secret-compare.d.ts +2 -10
  235. package/dist/types/helpers/server-create.d.ts +15 -0
  236. package/dist/types/helpers/shell.d.ts +2 -16
  237. package/dist/types/helpers/sse.d.ts +8 -6
  238. package/dist/types/helpers/ui-dir.d.ts +1 -5
  239. package/dist/types/helpers/utf8-chunks.d.ts +2 -8
  240. package/dist/types/helpers/validate.d.ts +2 -4
  241. package/dist/types/helpers/validator.d.ts +8 -4
  242. package/dist/types/helpers/version.d.ts +1 -6
  243. package/dist/types/helpers/workspace.d.ts +24 -16
  244. package/dist/types/index.d.ts +2 -3
  245. package/dist/types/middleware/auth.d.ts +8 -27
  246. package/dist/types/middleware/body-limit.d.ts +10 -0
  247. package/dist/types/middleware/host.d.ts +4 -23
  248. package/dist/types/middleware/loopback.d.ts +1 -8
  249. package/dist/types/middleware/token-scope.d.ts +34 -0
  250. package/dist/types/node-compat.d.ts +43 -0
  251. package/dist/types/openapi-reference.d.ts +4 -19
  252. package/dist/types/openapi.d.ts +5 -8
  253. package/dist/types/providers/archive.d.ts +8 -25
  254. package/dist/types/providers/backup-hook.d.ts +4 -19
  255. package/dist/types/providers/ddns/dyndns2.d.ts +0 -3
  256. package/dist/types/providers/ddns/index.d.ts +2 -3
  257. package/dist/types/providers/ddns/ip.d.ts +2 -12
  258. package/dist/types/providers/ddns/namecheap-api.d.ts +3 -2
  259. package/dist/types/providers/ddns/types.d.ts +6 -32
  260. package/dist/types/providers/ddns/zone.d.ts +1 -4
  261. package/dist/types/providers/docker.d.ts +18 -45
  262. package/dist/types/providers/entry-state.d.ts +4 -9
  263. package/dist/types/providers/health-check.d.ts +1 -5
  264. package/dist/types/providers/host.d.ts +33 -108
  265. package/dist/types/providers/identity.d.ts +9 -34
  266. package/dist/types/providers/log-tail.d.ts +14 -24
  267. package/dist/types/providers/nanny-sweep.d.ts +8 -25
  268. package/dist/types/providers/nanny.d.ts +16 -58
  269. package/dist/types/providers/port.d.ts +28 -83
  270. package/dist/types/providers/proc.d.ts +22 -80
  271. package/dist/types/providers/process.d.ts +12 -36
  272. package/dist/types/providers/proxy/admin.d.ts +11 -0
  273. package/dist/types/providers/proxy/types.d.ts +4 -16
  274. package/dist/types/providers/telegram.d.ts +1 -17
  275. package/dist/types/providers/ui-release.d.ts +15 -25
  276. package/dist/types/providers/webhook.d.ts +8 -29
  277. package/dist/types/providers/wsl-temperature.d.ts +13 -22
  278. package/dist/types/services/acme-challenge.d.ts +2 -16
  279. package/dist/types/services/auth.d.ts +65 -80
  280. package/dist/types/services/backups/archive-safety.d.ts +30 -0
  281. package/dist/types/services/backups/paths.d.ts +31 -0
  282. package/dist/types/services/backups.d.ts +61 -271
  283. package/dist/types/services/config-watch.d.ts +3 -15
  284. package/dist/types/services/control-server.d.ts +6 -10
  285. package/dist/types/services/ddns.d.ts +12 -13
  286. package/dist/types/services/dependencies.d.ts +3 -14
  287. package/dist/types/services/deploy.d.ts +34 -0
  288. package/dist/types/services/events.d.ts +15 -9
  289. package/dist/types/services/exposure.d.ts +13 -63
  290. package/dist/types/services/history.d.ts +5 -14
  291. package/dist/types/services/host-monitor.d.ts +6 -11
  292. package/dist/types/services/init.d.ts +5 -35
  293. package/dist/types/services/job-ledger.d.ts +27 -0
  294. package/dist/types/services/jobs.d.ts +113 -0
  295. package/dist/types/services/log-buffer.d.ts +7 -8
  296. package/dist/types/services/log-files.d.ts +12 -42
  297. package/dist/types/services/log-relay.d.ts +3 -13
  298. package/dist/types/services/nanny.d.ts +3 -10
  299. package/dist/types/services/notifications.d.ts +31 -61
  300. package/dist/types/services/panel.d.ts +32 -78
  301. package/dist/types/services/proxy-certificates/certificates.d.ts +31 -69
  302. package/dist/types/services/proxy-config.d.ts +15 -36
  303. package/dist/types/services/proxy-dns01.d.ts +14 -0
  304. package/dist/types/services/proxy.d.ts +73 -254
  305. package/dist/types/services/scheduler.d.ts +46 -0
  306. package/dist/types/services/state.d.ts +17 -8
  307. package/dist/types/services/supervisor/compose.d.ts +2 -6
  308. package/dist/types/services/supervisor/entry.d.ts +29 -32
  309. package/dist/types/services/supervisor/health.d.ts +8 -31
  310. package/dist/types/services/supervisor/job-run.d.ts +36 -0
  311. package/dist/types/services/supervisor/output.d.ts +13 -77
  312. package/dist/types/services/supervisor/persistent.d.ts +5 -11
  313. package/dist/types/services/supervisor/port-preflight.d.ts +4 -10
  314. package/dist/types/services/supervisor/records.d.ts +27 -60
  315. package/dist/types/services/supervisor/restart-required.d.ts +13 -0
  316. package/dist/types/services/supervisor/spawn.d.ts +3 -5
  317. package/dist/types/services/supervisor/view.d.ts +3 -1
  318. package/dist/types/services/supervisor.d.ts +31 -43
  319. package/dist/types/services/tls.d.ts +6 -17
  320. package/dist/types/services/ui-update.d.ts +19 -17
  321. package/dist/types/services/ui.d.ts +10 -19
  322. package/dist/types/shared/action-outcome.d.ts +2 -7
  323. package/dist/types/shared/api-client.d.ts +133 -177
  324. package/dist/types/shared/api-scopes.d.ts +17 -0
  325. package/dist/types/shared/backup-scope.d.ts +16 -90
  326. package/dist/types/shared/clone.d.ts +2 -11
  327. package/dist/types/shared/contracts/accounts.d.ts +99 -0
  328. package/dist/types/shared/contracts/backups.d.ts +219 -0
  329. package/dist/types/shared/contracts/ddns.d.ts +208 -0
  330. package/dist/types/shared/contracts/frames.d.ts +1395 -0
  331. package/dist/types/shared/contracts/index.d.ts +3 -0
  332. package/dist/types/shared/contracts/logs.d.ts +107 -0
  333. package/dist/types/shared/contracts/proxy.d.ts +303 -0
  334. package/dist/types/shared/contracts.d.ts +852 -1982
  335. package/dist/types/shared/cpu-scale.d.ts +3 -19
  336. package/dist/types/shared/crash-cause.d.ts +8 -0
  337. package/dist/types/shared/cron.d.ts +70 -0
  338. package/dist/types/shared/ddns-form.d.ts +9 -43
  339. package/dist/types/shared/endpoint.d.ts +1 -7
  340. package/dist/types/shared/error-codes.d.ts +438 -0
  341. package/dist/types/shared/error-message.d.ts +1 -7
  342. package/dist/types/shared/fields.d.ts +7 -17
  343. package/dist/types/shared/form-repair.d.ts +1 -5
  344. package/dist/types/shared/generated.d.ts +3 -19
  345. package/dist/types/shared/host-readings.d.ts +25 -128
  346. package/dist/types/shared/lazy.d.ts +1 -1
  347. package/dist/types/shared/live-frames.d.ts +2 -8
  348. package/dist/types/shared/live-series.d.ts +2 -8
  349. package/dist/types/shared/live-store.d.ts +4 -8
  350. package/dist/types/shared/log-download.d.ts +6 -0
  351. package/dist/types/shared/meta.d.ts +6 -0
  352. package/dist/types/shared/password-policy.d.ts +10 -0
  353. package/dist/types/shared/patch-diff.d.ts +13 -72
  354. package/dist/types/shared/port-reading.d.ts +18 -0
  355. package/dist/types/shared/probe-latency.d.ts +3 -21
  356. package/dist/types/shared/proxy-form.d.ts +33 -74
  357. package/dist/types/shared/proxy-validate.d.ts +11 -0
  358. package/dist/types/shared/query-params.d.ts +8 -0
  359. package/dist/types/shared/server-attention.d.ts +2 -27
  360. package/dist/types/shared/server-form.d.ts +15 -54
  361. package/dist/types/shared/server-key.d.ts +1 -12
  362. package/dist/types/shared/server-readings.d.ts +7 -32
  363. package/dist/types/shared/server-url.d.ts +9 -31
  364. package/dist/types/shared/shape.d.ts +1 -16
  365. package/dist/types/shared/stream-access.d.ts +2 -8
  366. package/dist/types/shared/ui-format.d.ts +25 -65
  367. package/docs/API.md +315 -107
  368. package/docs/BACKUPS.md +61 -56
  369. package/docs/CLI.md +255 -49
  370. package/docs/DDNS.md +35 -49
  371. package/docs/JOBS.md +129 -0
  372. package/docs/NOTIFICATIONS.md +58 -90
  373. package/docs/REVERSE_PROXY.md +116 -188
  374. package/docs/SECURITY.md +126 -44
  375. package/docs/SERVERS.md +282 -409
  376. package/docs/UI_CREATION.md +90 -47
  377. package/docs/demo/blank-host-restore.sh +31 -7
  378. package/package.json +15 -6
  379. package/scripts/prepare.mjs +47 -0
  380. package/uis/stock/dist/assets/CopyButton-8mliL0xi.js +1 -0
  381. package/uis/stock/dist/assets/GlobalSettingsView-BINXY77E.js +1 -0
  382. package/uis/stock/dist/assets/LogViewer-kiSnTwdY.js +1 -0
  383. package/uis/stock/dist/assets/LogsView-DDXf_ONs.js +1 -0
  384. package/uis/stock/dist/assets/Modal-lrUuViF2.js +39 -0
  385. package/uis/stock/dist/assets/ProxyView-uXMaJdSQ.js +1 -0
  386. package/uis/stock/dist/assets/ServerDetailView-CW0Vb_c0.js +4 -0
  387. package/uis/stock/dist/assets/SettingsShell-B135xWjJ.js +1 -0
  388. package/uis/stock/dist/assets/SettingsView-BLtWxVkl.js +2 -0
  389. package/uis/stock/dist/assets/de-BIoTrHBQ.js +1 -0
  390. package/uis/stock/dist/assets/es-x4-ih8lH.js +1 -0
  391. package/uis/stock/dist/assets/fr-DatqBBkO.js +1 -0
  392. package/uis/stock/dist/assets/index-CnojaKcA.css +2 -0
  393. package/uis/stock/dist/assets/index-D-CiZReu.js +16 -0
  394. package/uis/stock/dist/assets/ja-CW1703Gw.js +1 -0
  395. package/uis/stock/dist/assets/ko-wFbT4XtK.js +1 -0
  396. package/uis/stock/dist/assets/ru-C1p5C4VN.js +1 -0
  397. package/uis/stock/dist/assets/useUnsavedGuard-BcsXsfCC.js +9 -0
  398. package/uis/stock/dist/assets/vi-CDqr0uie.js +1 -0
  399. package/uis/stock/dist/assets/zh-CN-BJ7iit-X.js +1 -0
  400. package/uis/stock/dist/index.html +4 -3
  401. package/uis/stock/dist/ui.json +3 -3
  402. package/dist/chunks/archive-DP-XQR8X.js.map +0 -1
  403. package/dist/chunks/atomic-C1PfJpE7.js.map +0 -1
  404. package/dist/chunks/backup-CZcVca2a.js.map +0 -1
  405. package/dist/chunks/backups-CFRaWe_m.js +0 -4691
  406. package/dist/chunks/backups-CFRaWe_m.js.map +0 -1
  407. package/dist/chunks/config-text-DifCHhnz.js +0 -50
  408. package/dist/chunks/config-text-DifCHhnz.js.map +0 -1
  409. package/dist/chunks/contracts-CMBD1TF9.js.map +0 -1
  410. package/dist/chunks/daemon-log-BVj8cDEo.js +0 -241
  411. package/dist/chunks/daemon-log-BVj8cDEo.js.map +0 -1
  412. package/dist/chunks/daemon-qKVECISl.js +0 -247
  413. package/dist/chunks/daemon-qKVECISl.js.map +0 -1
  414. package/dist/chunks/docker-Cy9Lyvda.js.map +0 -1
  415. package/dist/chunks/down-pKbGCW9d.js.map +0 -1
  416. package/dist/chunks/init-BZ7hK9Vf.js.map +0 -1
  417. package/dist/chunks/last-stop-C-BXz_XI.js +0 -53
  418. package/dist/chunks/last-stop-C-BXz_XI.js.map +0 -1
  419. package/dist/chunks/layout-DwTtmund.js +0 -24
  420. package/dist/chunks/layout-DwTtmund.js.map +0 -1
  421. package/dist/chunks/lazy-Ce5zEAq1.js +0 -66
  422. package/dist/chunks/lazy-Ce5zEAq1.js.map +0 -1
  423. package/dist/chunks/log-buffer-Dy9HHDMD.js +0 -414
  424. package/dist/chunks/log-buffer-Dy9HHDMD.js.map +0 -1
  425. package/dist/chunks/logger-B5U4GD3j.js.map +0 -1
  426. package/dist/chunks/logs---TI_bxM.js.map +0 -1
  427. package/dist/chunks/migrate-Cfoq-Vgh.js +0 -155
  428. package/dist/chunks/migrate-Cfoq-Vgh.js.map +0 -1
  429. package/dist/chunks/nanny-B-Eu0sFW.js.map +0 -1
  430. package/dist/chunks/nanny-BtWfy0QH.js +0 -1167
  431. package/dist/chunks/nanny-BtWfy0QH.js.map +0 -1
  432. package/dist/chunks/nanny-sweep-DErnlPY1.js.map +0 -1
  433. package/dist/chunks/nearest-6KgQEDUe.js.map +0 -1
  434. package/dist/chunks/parse-DhmG26fI.js.map +0 -1
  435. package/dist/chunks/paths-CGlGDrOU.js.map +0 -1
  436. package/dist/chunks/port-B8WBTRMk.js.map +0 -1
  437. package/dist/chunks/restart-Des4DrAN.js.map +0 -1
  438. package/dist/chunks/schema-B240VXcV.js.map +0 -1
  439. package/dist/chunks/secrets-BieELnZh.js +0 -562
  440. package/dist/chunks/secrets-BieELnZh.js.map +0 -1
  441. package/dist/chunks/server-Bge2r2qQ.js +0 -169
  442. package/dist/chunks/server-Bge2r2qQ.js.map +0 -1
  443. package/dist/chunks/server-ids-DRuNLVCV.js +0 -32
  444. package/dist/chunks/server-ids-DRuNLVCV.js.map +0 -1
  445. package/dist/chunks/set-password-D5vZqqSX.js +0 -43
  446. package/dist/chunks/set-password-D5vZqqSX.js.map +0 -1
  447. package/dist/chunks/set-token-obPiEJYk.js +0 -78
  448. package/dist/chunks/set-token-obPiEJYk.js.map +0 -1
  449. package/dist/chunks/settings-xu-XTfWg.js.map +0 -1
  450. package/dist/chunks/setup-temp-CAN4_bA-.js.map +0 -1
  451. package/dist/chunks/shape-DnTKzjQ2.js +0 -24
  452. package/dist/chunks/shape-DnTKzjQ2.js.map +0 -1
  453. package/dist/chunks/src-BtWMFmzZ.js.map +0 -1
  454. package/dist/chunks/status-DT1EsA-B.js.map +0 -1
  455. package/dist/chunks/ui-D562aqw5.js.map +0 -1
  456. package/dist/chunks/ui-dir-CsU3uLNV.js.map +0 -1
  457. package/dist/chunks/ui-release-DKzVvlLd.js.map +0 -1
  458. package/dist/chunks/ui-revert-EkBBwRTt.js.map +0 -1
  459. package/dist/chunks/ui-switch-BnZTdMDd.js.map +0 -1
  460. package/dist/chunks/ui-update-_xryLYxw.js.map +0 -1
  461. package/dist/chunks/up-Pdz-l6IH.js.map +0 -1
  462. package/dist/chunks/usage-DFrCVXpT.js.map +0 -1
  463. package/dist/chunks/workspaces-DYcfvKV_.js.map +0 -1
  464. package/dist/chunks/wsl-temperature-BiCI4iK6.js.map +0 -1
  465. package/dist/types/cli/set-password.d.ts +0 -14
  466. package/dist/types/cli/set-token.d.ts +0 -21
  467. package/uis/stock/dist/assets/CopyButton-BUBKRJyY.js +0 -1
  468. package/uis/stock/dist/assets/GlobalSettingsView-yYMcRWvt.js +0 -1
  469. package/uis/stock/dist/assets/LogViewer-DIliXy62.js +0 -1
  470. package/uis/stock/dist/assets/LogsView-B7Z-7RNg.js +0 -1
  471. package/uis/stock/dist/assets/Modal-DmKa5Qpp.js +0 -39
  472. package/uis/stock/dist/assets/ProxyView-DvZiNkwb.js +0 -1
  473. package/uis/stock/dist/assets/ServerDetailView-6idGT_EX.js +0 -2
  474. package/uis/stock/dist/assets/SettingsShell-CeGtleYI.js +0 -1
  475. package/uis/stock/dist/assets/SettingsView-BrhJIrmk.js +0 -2
  476. package/uis/stock/dist/assets/de-BRITeb0H.js +0 -1
  477. package/uis/stock/dist/assets/es-B2zIEssV.js +0 -1
  478. package/uis/stock/dist/assets/fr-s0ZOBEqh.js +0 -1
  479. package/uis/stock/dist/assets/index-C1MehbKy.css +0 -2
  480. package/uis/stock/dist/assets/index-CnBN54wF.js +0 -15
  481. package/uis/stock/dist/assets/ja-CU7MR85V.js +0 -1
  482. package/uis/stock/dist/assets/ko-tL5Me6d-.js +0 -1
  483. package/uis/stock/dist/assets/ru-92yrvkNJ.js +0 -1
  484. package/uis/stock/dist/assets/vi-CzvY16k2.js +0 -1
  485. package/uis/stock/dist/assets/zh-CN-DDwFW_uW.js +0 -1
@@ -0,0 +1,23 @@
1
+ import type { ControlConfig, ProxyConfig } from '../shared/contracts.js';
2
+ /**
3
+ * `account` — the panel's credentials, without the API. One account is one credential: `id` + `secret`
4
+ * signs in, and the same pair works as `Authorization: Bearer <id>:<secret>`.
5
+ */
6
+ /**
7
+ * What a new secret's length means for this panel: a refusal when the config exposes it beyond
8
+ * loopback (its next start would refuse), a warning below 8 characters, a note below 12.
9
+ */
10
+ export declare function passwordLengthVerdict(password: string, settings: {
11
+ control: ControlConfig;
12
+ proxy: ProxyConfig;
13
+ }): Promise<{
14
+ refusal: string | null;
15
+ warning: string | null;
16
+ }>;
17
+ export declare const ACCOUNT_SUBCOMMANDS: readonly ["create", "ls", "edit", "secret", "revoke", "reset", "disable-auth", "enable-auth"];
18
+ export declare const accountCommand: import("citty").CommandDef<{
19
+ readonly command: {
20
+ readonly type: "positional";
21
+ readonly required: false;
22
+ };
23
+ }>;
@@ -0,0 +1,96 @@
1
+ /**
2
+ * `add <id> [--port N] [--cwd DIR] [--workspace W] [--persistent] [--autostart] [--secret-env NAME]… -- <command> [args…]`
3
+ *
4
+ * Through the running panel when it is up, otherwise into `servers.config.json` with the same
5
+ * validation. The entry is not started.
6
+ */
7
+ export declare const addArgs: {
8
+ readonly id: {
9
+ readonly type: "positional";
10
+ readonly required: false;
11
+ readonly description: "the new server id (a-z, 0-9, - and _)";
12
+ };
13
+ readonly port: {
14
+ readonly type: "string";
15
+ readonly description: "the port it listens on";
16
+ };
17
+ readonly cwd: {
18
+ readonly type: "string";
19
+ readonly description: "its working directory";
20
+ };
21
+ readonly workspace: {
22
+ readonly type: "string";
23
+ readonly alias: "w";
24
+ readonly description: "the workspace to add it to (default: the default workspace)";
25
+ };
26
+ readonly persistent: {
27
+ readonly type: "boolean";
28
+ readonly description: "keep it running when the panel stops";
29
+ };
30
+ readonly autostart: {
31
+ readonly type: "boolean";
32
+ readonly description: "start it whenever the panel starts";
33
+ };
34
+ readonly secretEnv: {
35
+ readonly type: "string";
36
+ readonly description: "declare a secret environment variable (repeatable, or comma-separated)";
37
+ };
38
+ };
39
+ export interface AddInput {
40
+ id?: string;
41
+ port?: string;
42
+ cwd?: string;
43
+ persistent?: boolean;
44
+ autostart?: boolean;
45
+ /** Every `--secret-env` value, each possibly a comma list. */
46
+ secretEnv?: string[];
47
+ command: string[];
48
+ }
49
+ /** The create body for these flags, or the sentence that refuses them; the caller checks the schema. */
50
+ export declare function buildServerEntry(input: AddInput): {
51
+ entry: Record<string, unknown>;
52
+ warnings: string[];
53
+ } | {
54
+ error: string;
55
+ };
56
+ /** Every value given to `--secret-env`, in either spelling, from the words before `--`. */
57
+ export declare function secretEnvFlags(declaration: readonly string[]): string[];
58
+ export declare function commandAfterDashes(rawArgs: readonly string[]): string[];
59
+ /**
60
+ * The words before the first `--`. citty's positional filler reads the whole argv, so without this
61
+ * `add -- node server.js` would bind `id = "node"`.
62
+ */
63
+ export declare function declarationAfterDashes(rawArgs: readonly string[]): string[];
64
+ export declare function runAdd(input: AddInput, workspace?: string): Promise<void>;
65
+ export declare const addCommand: import("citty").CommandDef<{
66
+ readonly id: {
67
+ readonly type: "positional";
68
+ readonly required: false;
69
+ readonly description: "the new server id (a-z, 0-9, - and _)";
70
+ };
71
+ readonly port: {
72
+ readonly type: "string";
73
+ readonly description: "the port it listens on";
74
+ };
75
+ readonly cwd: {
76
+ readonly type: "string";
77
+ readonly description: "its working directory";
78
+ };
79
+ readonly workspace: {
80
+ readonly type: "string";
81
+ readonly alias: "w";
82
+ readonly description: "the workspace to add it to (default: the default workspace)";
83
+ };
84
+ readonly persistent: {
85
+ readonly type: "boolean";
86
+ readonly description: "keep it running when the panel stops";
87
+ };
88
+ readonly autostart: {
89
+ readonly type: "boolean";
90
+ readonly description: "start it whenever the panel starts";
91
+ };
92
+ readonly secretEnv: {
93
+ readonly type: "string";
94
+ readonly description: "declare a secret environment variable (repeatable, or comma-separated)";
95
+ };
96
+ }>;
@@ -1,11 +1,8 @@
1
1
  import type { ArgsDef } from 'citty';
2
2
  /**
3
- * The argument work that happens *before* citty: `--home`/`--project` have to
4
- * change the environment before any `#src` module resolves a path, and the
5
- * curated surface (`help`, `version`, `unknown command`) has to stay byte-for-
6
- * byte what it always was. Both live here so they can be tested without a
7
- * terminal, a daemon or a spawned process; this module imports node builtins
8
- * only and never reads the state directories itself.
3
+ * The argument work before citty: `--home`/`--project` must change the environment before any `#src`
4
+ * module resolves a path, and the curated surface (`help`, `version`, `unknown command`) is decided.
5
+ * Node builtins only.
9
6
  */
10
7
  export interface DirFlags {
11
8
  project?: string;
@@ -15,9 +12,7 @@ export interface DirFlagResult extends DirFlags {
15
12
  rest: string[];
16
13
  error?: string;
17
14
  }
18
- /** `--home`/`--project` are handled for every command, so they are peeled off first. */
19
15
  export declare function extractDirFlags(argv: string[]): DirFlagResult;
20
- /** Set before any state module is imported, so it decides where state lives. */
21
16
  export declare function applyDirFlags(flags: DirFlags): void;
22
17
  export type Invocation = {
23
18
  kind: 'help';
@@ -32,33 +27,30 @@ export type Invocation = {
32
27
  command: string;
33
28
  };
34
29
  /**
35
- * What the stripped argv means, before citty sees it.
36
- *
37
- * `help`/`version` are commands here, not flags, and a help or version flag on a
38
- * command is answered the same way instead of being parsed as one of that
39
- * command's options. A help flag after a command keeps that command's name, so
40
- * the curated text can stay scoped to it; the bare `help` (or a top-level flag)
41
- * is the whole reference. A first token that starts with `-` is the one-shot
42
- * form (`home-hosted -p 4000`), so `up` is prepended. Anything else has to name
43
- * a command, which keeps the old `unknown command:` text exact.
30
+ * What the stripped argv means, before citty sees it. `help`/`version` are commands; a help flag after
31
+ * a command keeps it scoped; a first token starting with `-` is the `up` shorthand (`-p 4000`).
44
32
  */
45
33
  export declare function resolveInvocation(argv: string[], commands: readonly string[]): Invocation;
46
34
  /**
47
- * citty parses permissively (`strict: false`), so a mistyped flag would quietly do
48
- * nothing — `--autostart` where `--no-autostart` was meant would start the panel
49
- * with the wrong policy. This keeps the refusal the command line always had, from
50
- * citty's own definitions rather than a second list.
51
- *
52
- * `undefined` means the command parses its own argv — `ui-switch` calls `node:util`'s
53
- * `parseArgs` with its own options, which is strict already — so it is left alone. An
54
- * **empty** definition is different: it declares that this command takes nothing, so
55
- * every flag and every bare word is refused here. Reading `{}` as "parses its own argv"
56
- * is what let `ui-revert`, which has no parser at all, accept and discard anything:
57
- * `ui-revert --dry-run` deleted the installed UI and exited 0.
58
- *
59
- * Returns the message to print, or null.
35
+ * citty parses permissively, so a mistyped flag would quietly do nothing. Returns the message to
36
+ * print, or null. `undefined` means the command parses its own argv (`ui-switch`); an empty `{}`
37
+ * means it takes nothing, so everything is refused. A group's flags come from `flagTarget`.
60
38
  */
61
39
  export declare function rejectUnknownFlags(argv: string[], argsDef: ArgsDef | undefined): string | null;
40
+ type SubCommandsShape = Record<string, CommandShape | (() => CommandShape | Promise<CommandShape>)>;
41
+ export interface CommandShape {
42
+ args?: ArgsDef | (() => ArgsDef | Promise<ArgsDef>) | Promise<ArgsDef>;
43
+ subCommands?: SubCommandsShape | (() => SubCommandsShape | Promise<SubCommandsShape>) | Promise<SubCommandsShape>;
44
+ }
45
+ /**
46
+ * The definition whose `args` govern this argv: the subcommand's, for a group (`job ls --json`),
47
+ * else the command's own. `CommandShape` rather than `CommandDef` because citty's generic args make
48
+ * two commands' definitions mutually unassignable.
49
+ */
50
+ export declare function flagTarget(argv: string[], command: CommandShape | undefined): Promise<{
51
+ args: ArgsDef | undefined;
52
+ argsFor: string[];
53
+ }>;
62
54
  export interface UpFlags {
63
55
  port?: number;
64
56
  host?: string;
@@ -67,9 +59,6 @@ export interface UpFlags {
67
59
  foreground: boolean;
68
60
  printConfig: boolean;
69
61
  }
70
- /**
71
- * The daemon gets the same instructions, but never `--foreground` (that is what
72
- * makes it the daemon) and never `--print-config` (that one is answered in the
73
- * calling process).
74
- */
62
+ /** The daemon's argv: never `--foreground` (that makes it the daemon) or `--print-config`. */
75
63
  export declare function buildDaemonArgv(flags: UpFlags): string[];
64
+ export {};
@@ -1,21 +1,15 @@
1
1
  import type { BackupService } from '../services/backups.js';
2
2
  export interface OfflineBackup {
3
3
  service: BackupService;
4
- /** The workspaces this host declares, for a refusal that lists real ids. */
5
4
  workspaceIds: string[];
6
- /** Entries whose process is alive right now, read from the state files they rewrite. */
7
5
  runningNow: () => Array<{
8
6
  workspaceId: string;
9
7
  serverId: string;
10
8
  }>;
11
9
  }
12
10
  /**
13
- * Build the service against this host's files.
14
- *
15
- * `ensureWorkspace` and `onRestored` are the two panel hooks, and both are deliberately absent: with
16
- * no daemon there is nothing to reload, and a restore that brings a workspace this host lacks leaves
17
- * it on disk for the next `up` to pick up. The registry is written by the service itself, which is
18
- * what makes that work.
11
+ * `onRestored` is absent (nothing to reload); `ensureWorkspace` writes the registry
12
+ * itself, so the next `up` picks up a restored workspace.
19
13
  */
20
14
  export declare function createOfflineBackup(options?: {
21
15
  hhDir?: string;
@@ -1,25 +1,16 @@
1
- /**
2
- * What a `create`/`restore` should act on: `'all'`, or an explicit list of ids.
3
- *
4
- * There is no "neither flag" case. Reading it as "everything" made the destructive path the default —
5
- * `backup create --confirm` would archive the whole machine, and a restore would write the whole
6
- * archive, without anyone naming what they meant. A scope is now required, so silence is refused
7
- * rather than guessed.
8
- */
1
+ /** What a `create`/`restore` acts on. There is no "neither flag" case: silence is refused, not read as "all". */
9
2
  type Scope = {
10
3
  kind: 'all';
11
4
  } | {
12
5
  kind: 'include';
13
6
  ids: string[];
14
7
  };
15
- /**
16
- * Run against the panel when one is up, and against the files when it is not.
17
- *
18
- * Both run the same `BackupService`, so the archive cannot differ; only the authority on what is
19
- * running changes. A stopped panel is exactly when someone wants to back up or restore — the services
20
- * are down because they stopped them on purpose.
21
- */
22
8
  export declare function runBackupList(json: boolean): Promise<void>;
9
+ /** One line per running entry whose declared data a restore replaces, grouped by entry. */
10
+ export declare function replacedUnderRunningLines(list: ReadonlyArray<{
11
+ workspaceId: string;
12
+ serverId: string;
13
+ }>, applied: boolean): string[];
23
14
  export declare function runBackupCreate(options: {
24
15
  password?: string;
25
16
  scope: Scope;
@@ -37,11 +28,7 @@ export declare function runBackupRestore(options: {
37
28
  json: boolean;
38
29
  }): Promise<void>;
39
30
  type BackupAction = 'list' | 'create' | 'restore';
40
- type BackupFlag = 'target' | 'from' | 'password' | 'include' | 'exclude' | 'all' | 'confirm' | 'json';
41
- /**
42
- * A flag the action cannot honour is refused, not ignored: `backup list --all --include x` listed
43
- * every archive, and `backup create foo --all` dropped `foo` without a word.
44
- */
31
+ type BackupFlag = 'target' | 'from' | 'password' | 'encrypt' | 'include' | 'exclude' | 'all' | 'confirm' | 'json';
45
32
  export declare function unhonouredBackupFlag(action: BackupAction, given: Partial<Record<BackupFlag, unknown>>): string | null;
46
33
  export declare const backupCommand: import("citty").CommandDef<{
47
34
  readonly action: {
@@ -60,7 +47,11 @@ export declare const backupCommand: import("citty").CommandDef<{
60
47
  };
61
48
  readonly password: {
62
49
  readonly type: "string";
63
- readonly description: "encrypt the archive, or unlock it on restore";
50
+ readonly description: "deprecated: visible in shell history and `ps` — use HHOSTED_BACKUP_PASSWORD or --encrypt";
51
+ };
52
+ readonly encrypt: {
53
+ readonly type: "boolean";
54
+ readonly description: "create: encrypt the archive with a password asked for without echo";
64
55
  };
65
56
  readonly include: {
66
57
  readonly type: "string";
@@ -1,23 +1,16 @@
1
1
  import type { PersistentHandle } from '../providers/nanny-sweep.js';
2
- import type { ServerConfig } from '../shared/contracts.js';
2
+ import type { ServerConfig, StopConfig } from '../shared/contracts.js';
3
3
  /**
4
- * `down` stops the panel and everything it supervises.
5
- *
6
- * A `persistent: true` entry is the one thing it deliberately leaves running, which is what
7
- * `--with-persistent` changes: the same stop, extended to those entries. While the panel is
8
- * up they are stopped through it, so the stop is recorded like a click in the UI; once it is
9
- * gone their nannies are signalled directly, because the state files are then the only record.
4
+ * `down` stops the panel and everything it supervises, except `persistent: true` entries unless
5
+ * `--with-persistent`. While the panel is up those are stopped through it, so the stop is recorded;
6
+ * once it is gone their nannies are signalled directly.
10
7
  */
11
8
  export interface DownOptions {
12
- /** Also stop every persistent entry, in every workspace. */
13
9
  withPersistent?: boolean;
14
10
  }
15
11
  /** Which persistent entries this stop ended, as `(workspace, id)` — what `restart` starts back. */
16
12
  export interface DownResult {
17
- /**
18
- * False when a panel of this home may still be running: it could not be stopped, or it answers
19
- * without a `run.json` to stop it by. `restart` must not go on to `up` over it.
20
- */
13
+ /** False when a panel of this home may still be running; `restart` must not go on to `up` over it. */
21
14
  ok: boolean;
22
15
  stoppedPersistent: Array<{
23
16
  workspaceId: string;
@@ -25,51 +18,32 @@ export interface DownResult {
25
18
  }>;
26
19
  }
27
20
  export declare function runDown(options?: DownOptions): Promise<DownResult>;
28
- /**
29
- * The persistent entries this host has running, as their state files describe them.
30
- *
31
- * Every workspace keeps its own `.state`, and only the panel normally sees all of them, so
32
- * `down` reads them itself — after a crash there is nobody left to ask.
33
- */
21
+ /** The persistent entries this host has running, from every workspace's state files. */
34
22
  export declare function livePersistents(): Promise<PersistentHandle[]>;
35
23
  /** `workspace/id`, because a server id is only unique inside its workspace. */
36
24
  export declare function persistentLabel(handle: Readonly<PersistentHandle>): string;
37
- /**
38
- * The exit code these stops earn: any survivor is a failure, because the command was asked to
39
- * stop them and the host is still running one. Separated from the printing so the rule is
40
- * pinned where it can be read, not inferred from a process's status.
41
- */
25
+ /** Any survivor is a failure: the command was asked to stop it. */
42
26
  export declare function exitCodeForStops(results: ReadonlyArray<Readonly<{
43
27
  stopped: boolean;
44
28
  }>>): 0 | 1;
45
29
  /**
46
- * One workspace's entries, parsed read-only: a config this CLI cannot read reports itself.
47
- *
48
- * The workspace's `defaults` block is resolved exactly as the panel resolves it, because a `stop`
49
- * grace that lives there is part of what the budget must cover. Passing `{}` read only each entry's
50
- * own `stop`: a workspace declaring `defaults.stop.graceMs: 120000` with an entry that spells none
51
- * measured a 20 s budget against the 132 s the panel actually needed, and `down` then SIGKILLed it
52
- * mid-grace — the same defect the widening above exists to avoid, reached through a valid config
53
- * rather than a broken one.
30
+ * Each entry's own `stop` policy: the nanny forwards that grace to its child, so a shorter one here
31
+ * would SIGKILL a shutdown still within it.
54
32
  */
33
+ export declare function stopPolicyLookup(): Promise<(handle: PersistentHandle) => StopConfig>;
34
+ /** One workspace's entries, with its `defaults` resolved as the panel does — a grace there counts too. */
55
35
  export declare function serversReader(): Promise<(workspaceId: string) => {
56
36
  servers: ServerConfig[];
57
37
  complete: boolean;
58
38
  }>;
59
39
  /**
60
- * How long the panel may take to stop what it supervises before `down` forces it.
61
- *
62
- * This is the slowest entry's stop, because the path `down` takes — `/_hh/shutdown` → `PanelService
63
- * .dispose` — stops every workspace's entries through `Promise.all`. (`stopAll`, behind the panel's
64
- * own stop-all route, is sequential; a caller budgeting for *that* would need the sum, not the max.)
65
- *
66
- * The slowest entry is its grace, the SIGKILL wait after it, a second round for a persistent child
67
- * signalled alone, and a compose stack's `docker stop` — plus a margin.
40
+ * The slowest entry's stop (dispose stops workspaces through `Promise.all`): its grace, the SIGKILL
41
+ * wait, a second round for a persistent child, and a compose stack's `docker stop` — plus a margin.
68
42
  */
69
43
  export declare function shutdownBudgetMs(servers: ReadonlyArray<Pick<ServerConfig, 'command' | 'args' | 'persistent' | 'stop'>>, withPersistent: boolean): number;
70
44
  /**
71
- * Only the panel's own pid, as SIGKILL is on POSIX: `taskkill /T` follows parent pids, which a
72
- * detached spawn keeps on Windows, so it also killed every persistent entry's nanny.
45
+ * Only the panel's own pid: `taskkill /T` follows parent pids, which a detached spawn keeps on
46
+ * Windows, so it would also kill every persistent entry's nanny.
73
47
  */
74
48
  export declare function forceStopCommand(pid: number, platform?: NodeJS.Platform): [string, string[]] | null;
75
49
  export declare const downCommand: import("citty").CommandDef<{
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Another manager's declaration as this panel's entries — a pure mapping, no I/O. What cannot be
3
+ * carried (a slug collision, `watch`, `cron_restart`) is reported, never dropped in silence.
4
+ */
5
+ /** One pm2 `apps[]` element, as far as this importer reads it. */
6
+ export interface Pm2App {
7
+ name?: unknown;
8
+ script?: unknown;
9
+ interpreter?: unknown;
10
+ args?: unknown;
11
+ cwd?: unknown;
12
+ env?: unknown;
13
+ autorestart?: unknown;
14
+ max_restarts?: unknown;
15
+ max_memory_restart?: unknown;
16
+ watch?: unknown;
17
+ cron_restart?: unknown;
18
+ instances?: unknown;
19
+ exec_mode?: unknown;
20
+ }
21
+ export interface ImportPlan {
22
+ entries: Array<Record<string, unknown>>;
23
+ warnings: string[];
24
+ errors: string[];
25
+ }
26
+ /**
27
+ * pm2's `--env <name>`: each app's `env_<name>` laid over its `env`. `null` when no app declares that
28
+ * block — reading none of it would import the wrong environment without a word.
29
+ */
30
+ export declare function withEnvBlock(apps: readonly Pm2App[], name: string): Pm2App[] | null;
31
+ /** An id from a pm2 name: lowercase, anything outside `[a-z0-9_-]` collapsed to a dash. Can collide. */
32
+ export declare function slugifyId(name: string): string;
33
+ /**
34
+ * pm2's `args` string split on whitespace — deliberately not a shell parse. Quotes are reported, not
35
+ * interpreted, so a wrong guess never silently changes a program's arguments.
36
+ */
37
+ export declare function splitArgs(raw: string): {
38
+ args: string[];
39
+ quoted: boolean;
40
+ };
41
+ export declare function parseMemoryLimit(raw: unknown): number | null;
42
+ /**
43
+ * pm2 apps to entries:
44
+ * - `interpreter` (default `node`) becomes `command`, and `script` its first argument;
45
+ * - `autorestart: false` → `restart.enabled: false`; `max_restarts` → `maxRetries`;
46
+ * - `max_memory_restart` → `resources.maxRssBytes`;
47
+ * - `watch`, `cron_restart`, `instances`/cluster mode have no equivalent and are reported.
48
+ */
49
+ export declare function planPm2Apps(apps: readonly Pm2App[]): ImportPlan;
50
+ /**
51
+ * A compose file as one entry: the panel already supervises a stack from its `docker compose` argv.
52
+ * `--id` defaults to the directory name, compose's own default project name.
53
+ */
54
+ export declare function composeEntry(file: string, id: string, cwd?: string): Record<string, unknown>;
55
+ export declare function looksLikeCompose(parsed: unknown): boolean;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * One entry through `add`'s own path, so an existing id fails that entry (`409 SERVER_EXISTS`) and the
3
+ * import keeps going. The caller validates against the schema first.
4
+ */
5
+ export declare function addServerEntryOffline(entry: Record<string, unknown>, workspace?: string): Promise<void>;
@@ -0,0 +1,86 @@
1
+ /**
2
+ * `import pm2 <file> | import compose <file>` — carry an existing setup into a workspace. Plan first;
3
+ * write only with `--confirm` (no TTY and no `--confirm` exits 1). Writes go through `add`'s path.
4
+ */
5
+ export declare const importArgs: {
6
+ readonly kind: {
7
+ readonly type: "positional";
8
+ readonly required: false;
9
+ readonly description: "pm2, or compose";
10
+ };
11
+ readonly file: {
12
+ readonly type: "positional";
13
+ readonly required: false;
14
+ readonly description: "the ecosystem file, or the compose file";
15
+ };
16
+ readonly workspace: {
17
+ readonly type: "string";
18
+ readonly alias: "w";
19
+ readonly description: "the workspace to write into (default: the default workspace)";
20
+ };
21
+ readonly confirm: {
22
+ readonly type: "boolean";
23
+ readonly description: "write the plan (without it, nothing is written)";
24
+ };
25
+ readonly 'dry-run': {
26
+ readonly type: "boolean";
27
+ readonly description: "print the plan and write nothing, even with --confirm";
28
+ };
29
+ readonly 'allow-js': {
30
+ readonly type: "boolean";
31
+ readonly description: "evaluate a .js ecosystem file — it is code, and it runs in this process";
32
+ };
33
+ readonly env: {
34
+ readonly type: "string";
35
+ readonly description: "which pm2 env block to read: production, staging, …";
36
+ };
37
+ readonly id: {
38
+ readonly type: "string";
39
+ readonly description: "compose only: the server id (default: the directory name)";
40
+ };
41
+ readonly json: {
42
+ readonly type: "boolean";
43
+ readonly description: "print the plan as one document on stdout";
44
+ };
45
+ };
46
+ export declare const importCommand: import("citty").CommandDef<{
47
+ readonly kind: {
48
+ readonly type: "positional";
49
+ readonly required: false;
50
+ readonly description: "pm2, or compose";
51
+ };
52
+ readonly file: {
53
+ readonly type: "positional";
54
+ readonly required: false;
55
+ readonly description: "the ecosystem file, or the compose file";
56
+ };
57
+ readonly workspace: {
58
+ readonly type: "string";
59
+ readonly alias: "w";
60
+ readonly description: "the workspace to write into (default: the default workspace)";
61
+ };
62
+ readonly confirm: {
63
+ readonly type: "boolean";
64
+ readonly description: "write the plan (without it, nothing is written)";
65
+ };
66
+ readonly 'dry-run': {
67
+ readonly type: "boolean";
68
+ readonly description: "print the plan and write nothing, even with --confirm";
69
+ };
70
+ readonly 'allow-js': {
71
+ readonly type: "boolean";
72
+ readonly description: "evaluate a .js ecosystem file — it is code, and it runs in this process";
73
+ };
74
+ readonly env: {
75
+ readonly type: "string";
76
+ readonly description: "which pm2 env block to read: production, staging, …";
77
+ };
78
+ readonly id: {
79
+ readonly type: "string";
80
+ readonly description: "compose only: the server id (default: the directory name)";
81
+ };
82
+ readonly json: {
83
+ readonly type: "boolean";
84
+ readonly description: "print the plan as one document on stdout";
85
+ };
86
+ }>;
@@ -1,10 +1,6 @@
1
1
  /**
2
- * The bits every command shares: the colours, the failure shape, and the one
3
- * place readline is set up. Imported by `src/cli.ts` and by the command modules
4
- * it loads lazily, so it may not read the state directories. Its only imports are
5
- * node builtins and `helpers/shell.ts`, which reads neither the filesystem nor
6
- * `helpers/paths.ts` — the two ways a `#src` import here would pull the state
7
- * graph in before citty is even asked anything.
2
+ * The bits every command shares: colours, the failure shape, readline. Imported before citty runs, so
3
+ * it may not read the state directories or `helpers/paths.ts`.
8
4
  */
9
5
  export declare const isTty: () => boolean;
10
6
  export declare const paint: (code: string, text: string) => string;
@@ -12,7 +8,6 @@ export declare const dim: (text: string) => string;
12
8
  export declare const bold: (text: string) => string;
13
9
  export declare const cyan: (text: string) => string;
14
10
  export declare const green: (text: string) => string;
15
- /** A section title in the help output. */
16
11
  export declare const heading: (text: string) => string;
17
12
  /** The seam `ui-switch` takes, so the command stays testable without a terminal. */
18
13
  export declare const style: {
@@ -21,45 +16,41 @@ export declare const style: {
21
16
  green: (text: string) => string;
22
17
  };
23
18
  /**
24
- * How this process was invoked, so a hint names a command the person can actually run.
25
- *
26
- * `npx home-hosted` leaves no `home-hosted` on `PATH`, so a hard-coded "run `home-hosted down`"
27
- * fails with `command not found`. A package-manager cache path means npx/dlx; `cli.ts` means a
28
- * source checkout. A string to print, not a parser. `HHOSTED_INVOCATION` overrides it.
29
- *
30
- * **The state directory travels with it.** A command that was told `--home` (or inherited
31
- * `HHOSTED_HOME`) prints hints about *that* home, and a hint without the flag reaches the default
32
- * one instead: measured, `pnpm run cli backup list` — the documented way to try anything in this
33
- * repo — printed "`pnpm exec tsx src/cli.ts backup create --all` takes one", and running that
34
- * verbatim created `~/.home-hosted` beside the `.dev-state/` it was asked about. The same shape hits
35
- * every project `init` scaffolds, because its scripts all pass `--home ./state`. So the flag is part
36
- * of the invocation whenever a state directory was chosen, quoted for the shell that will run it.
37
- *
38
- * `HHOSTED_INVOCATION` overrides the *program*, never the state: a wrapper that sets it still wants
39
- * its hints pointed at the home it is driving.
19
+ * How this process was invoked, so a hint names a command the person can run (`npx` leaves no
20
+ * `home-hosted` on PATH). Carries `--home` whenever one was chosen, so a pasted hint reaches the same
21
+ * state. `HHOSTED_INVOCATION` overrides the program, never the state.
40
22
  */
41
23
  export declare function invocation(): string;
42
24
  export declare function isClosedReaderError(error: unknown): boolean;
43
25
  export declare function treatClosedReaderAsDone(): void;
44
- /** One shape for every failure: a red `error <message>` on stderr and exit 1. */
45
26
  export declare function fail(message: string): never;
46
27
  /**
47
- * The same red `error <message>` line on stderr, for a refusal that still has something to do
48
- * afterwards — `logs --json` has already written its document, and `down` has a persistent sweep to
49
- * report. `fail()` cannot serve those because it exits.
50
- *
51
- * **Every refusal goes to stderr**, whether or not the command has more to say: a `--json` caller
52
- * parses stdout, so a refusal written there makes stdout not-a-document — a script sees prose where
53
- * it expected JSON. `logs` printed its unreadable-file refusal on stdout while the exit code said 1,
54
- * and `down` printed "could not stop pid N" there too. Both go through here now.
28
+ * The same red `error <message>` on stderr, for a refusal that still has work to do after it. Every
29
+ * refusal goes to stderr: a `--json` caller parses stdout.
55
30
  */
56
31
  export declare function refusal(message: string): void;
32
+ /**
33
+ * A `--json` answer: one pretty-printed document on stdout. Every command prints through this, so a
34
+ * script sees one shape everywhere.
35
+ */
36
+ export declare function printJson(document: unknown): void;
57
37
  export declare function delay(ms: number): Promise<void>;
58
- /** A plain y/N question, for decisions that are not secrets. */
59
38
  export declare function prompt(question: string): Promise<string>;
60
39
  /** Reads a line with echo suppressed, so the password never lands in scrollback. */
61
40
  export declare function promptHidden(question: string): Promise<string>;
62
- /** Asks a yes/no question with a default, so an empty answer is a real answer. */
63
41
  export declare function confirm(question: string, fallback: boolean): Promise<boolean>;
64
- /** The first-run password while it is still the one in use, read from this machine's secrets file. */
42
+ /**
43
+ * `recorded` while the first-run password is in use and its text is in the secrets file; `unrecorded`
44
+ * when it is in use but the text is gone (a restore may carry only the hash); `null` otherwise.
45
+ */
46
+ export type FirstRunPassword = {
47
+ kind: 'recorded';
48
+ account: string;
49
+ password: string;
50
+ } | {
51
+ kind: 'unrecorded';
52
+ account: string;
53
+ };
54
+ export declare function firstRunPasswordState(file?: string): Promise<FirstRunPassword | null>;
55
+ export declare function unrecordedFirstRunHint(): string;
65
56
  export declare function firstRunPassword(): Promise<string | null>;