home-hosted 0.10.3 → 0.12.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 (317) hide show
  1. package/README.md +273 -628
  2. package/dist/chunks/archive-DpCwA8Nf.js +339 -0
  3. package/dist/chunks/archive-DpCwA8Nf.js.map +1 -0
  4. package/dist/chunks/atomic-CEfCUfkQ.js +25 -0
  5. package/dist/chunks/atomic-CEfCUfkQ.js.map +1 -0
  6. package/dist/chunks/backup-CPrJVPJI.js +797 -0
  7. package/dist/chunks/backup-CPrJVPJI.js.map +1 -0
  8. package/dist/chunks/backups-Bd2SF2qd.js +4346 -0
  9. package/dist/chunks/backups-Bd2SF2qd.js.map +1 -0
  10. package/dist/chunks/config-text-DifCHhnz.js +50 -0
  11. package/dist/chunks/config-text-DifCHhnz.js.map +1 -0
  12. package/dist/chunks/contracts-ku5ypHXJ.js +2256 -0
  13. package/dist/chunks/contracts-ku5ypHXJ.js.map +1 -0
  14. package/dist/chunks/daemon-TwXk5vb8.js +215 -0
  15. package/dist/chunks/daemon-TwXk5vb8.js.map +1 -0
  16. package/dist/chunks/daemon-log-BVj8cDEo.js +241 -0
  17. package/dist/chunks/daemon-log-BVj8cDEo.js.map +1 -0
  18. package/dist/chunks/docker-CGv4Uv7w.js +436 -0
  19. package/dist/chunks/docker-CGv4Uv7w.js.map +1 -0
  20. package/dist/chunks/down-BlX5X3bm.js +378 -0
  21. package/dist/chunks/down-BlX5X3bm.js.map +1 -0
  22. package/dist/chunks/init-DdmqHVra.js +263 -0
  23. package/dist/chunks/init-DdmqHVra.js.map +1 -0
  24. package/dist/chunks/last-stop-BZ08Z89-.js +52 -0
  25. package/dist/chunks/last-stop-BZ08Z89-.js.map +1 -0
  26. package/dist/chunks/layout-D74TGUnr.js +24 -0
  27. package/dist/chunks/layout-D74TGUnr.js.map +1 -0
  28. package/dist/chunks/log-buffer-HnP0jKhZ.js +350 -0
  29. package/dist/chunks/log-buffer-HnP0jKhZ.js.map +1 -0
  30. package/dist/chunks/logger-B5U4GD3j.js +13 -0
  31. package/dist/chunks/logger-B5U4GD3j.js.map +1 -0
  32. package/dist/chunks/logs-gI_69Q1P.js +265 -0
  33. package/dist/chunks/logs-gI_69Q1P.js.map +1 -0
  34. package/dist/chunks/migrate-BTlsibvF.js +155 -0
  35. package/dist/chunks/migrate-BTlsibvF.js.map +1 -0
  36. package/dist/chunks/nanny-20aBXL1o.js +1069 -0
  37. package/dist/chunks/nanny-20aBXL1o.js.map +1 -0
  38. package/dist/chunks/nanny-CjnnrIpm.js +132 -0
  39. package/dist/chunks/nanny-CjnnrIpm.js.map +1 -0
  40. package/dist/chunks/nanny-DUaAfCV-.js +39 -0
  41. package/dist/chunks/nanny-DUaAfCV-.js.map +1 -0
  42. package/dist/chunks/nanny-sweep-Ca9kPAVi.js +104 -0
  43. package/dist/chunks/nanny-sweep-Ca9kPAVi.js.map +1 -0
  44. package/dist/chunks/nearest-6KgQEDUe.js +41 -0
  45. package/dist/chunks/nearest-6KgQEDUe.js.map +1 -0
  46. package/dist/chunks/parse-B9owE47G.js +383 -0
  47. package/dist/chunks/parse-B9owE47G.js.map +1 -0
  48. package/dist/chunks/paths-BT94q6-w.js +172 -0
  49. package/dist/chunks/paths-BT94q6-w.js.map +1 -0
  50. package/dist/chunks/port-B8WBTRMk.js +333 -0
  51. package/dist/chunks/port-B8WBTRMk.js.map +1 -0
  52. package/dist/chunks/restart-UZgeDukG.js +126 -0
  53. package/dist/chunks/restart-UZgeDukG.js.map +1 -0
  54. package/dist/chunks/rolldown-runtime-D7D4PA-g.js +13 -0
  55. package/dist/chunks/schema-o7Lgk0V1.js +102 -0
  56. package/dist/chunks/schema-o7Lgk0V1.js.map +1 -0
  57. package/dist/chunks/secrets-D7PdYh71.js +544 -0
  58. package/dist/chunks/secrets-D7PdYh71.js.map +1 -0
  59. package/dist/chunks/server-BuIeSsRu.js +169 -0
  60. package/dist/chunks/server-BuIeSsRu.js.map +1 -0
  61. package/dist/chunks/server-ids-DRuNLVCV.js +32 -0
  62. package/dist/chunks/server-ids-DRuNLVCV.js.map +1 -0
  63. package/dist/chunks/set-password-DegMumPh.js +43 -0
  64. package/dist/chunks/set-password-DegMumPh.js.map +1 -0
  65. package/dist/chunks/set-token-21d1FTDC.js +78 -0
  66. package/dist/chunks/set-token-21d1FTDC.js.map +1 -0
  67. package/dist/chunks/settings-BVSBnIwJ.js +332 -0
  68. package/dist/chunks/settings-BVSBnIwJ.js.map +1 -0
  69. package/dist/chunks/setup-temp-XiuAtiW2.js +150 -0
  70. package/dist/chunks/setup-temp-XiuAtiW2.js.map +1 -0
  71. package/dist/chunks/shape-DnTKzjQ2.js +24 -0
  72. package/dist/chunks/shape-DnTKzjQ2.js.map +1 -0
  73. package/dist/chunks/src-BL97vLVb.js +11153 -0
  74. package/dist/chunks/src-BL97vLVb.js.map +1 -0
  75. package/dist/chunks/status-EuWdRq8Q.js +119 -0
  76. package/dist/chunks/status-EuWdRq8Q.js.map +1 -0
  77. package/dist/chunks/ui-DbPuwddJ.js +323 -0
  78. package/dist/chunks/ui-DbPuwddJ.js.map +1 -0
  79. package/dist/chunks/ui-dir-CsU3uLNV.js +39 -0
  80. package/dist/chunks/ui-dir-CsU3uLNV.js.map +1 -0
  81. package/dist/chunks/ui-release-DKzVvlLd.js +312 -0
  82. package/dist/chunks/ui-release-DKzVvlLd.js.map +1 -0
  83. package/dist/chunks/ui-revert-BhqOAhmM.js +27 -0
  84. package/dist/chunks/ui-revert-BhqOAhmM.js.map +1 -0
  85. package/dist/chunks/ui-switch-CMoslPO2.js +150 -0
  86. package/dist/chunks/ui-switch-CMoslPO2.js.map +1 -0
  87. package/dist/chunks/ui-update-TTBBoDik.js +272 -0
  88. package/dist/chunks/ui-update-TTBBoDik.js.map +1 -0
  89. package/dist/chunks/up-C4H13hBw.js +196 -0
  90. package/dist/chunks/up-C4H13hBw.js.map +1 -0
  91. package/dist/chunks/usage-CSBgLRN5.js +85 -0
  92. package/dist/chunks/usage-CSBgLRN5.js.map +1 -0
  93. package/dist/chunks/workspaces-CAln2sQ7.js +221 -0
  94. package/dist/chunks/workspaces-CAln2sQ7.js.map +1 -0
  95. package/dist/chunks/wsl-temperature-BiCI4iK6.js +322 -0
  96. package/dist/chunks/wsl-temperature-BiCI4iK6.js.map +1 -0
  97. package/dist/cli.js +229 -24861
  98. package/dist/cli.js.map +1 -1
  99. package/dist/client.js +120 -0
  100. package/dist/client.js.map +1 -0
  101. package/dist/types/api/acme.d.ts +24 -0
  102. package/dist/types/api/auth/$.routes.d.ts +103 -0
  103. package/dist/types/api/backups.d.ts +179 -0
  104. package/dist/types/api/control.d.ts +469 -0
  105. package/dist/types/api/ddns.d.ts +432 -0
  106. package/dist/types/api/events.d.ts +21 -0
  107. package/dist/types/api/health.d.ts +27 -0
  108. package/dist/types/api/logs.d.ts +95 -0
  109. package/dist/types/api/metrics.d.ts +19 -0
  110. package/dist/types/api/notifications.d.ts +141 -0
  111. package/dist/types/api/proxy.d.ts +1128 -0
  112. package/dist/types/api/servers/$.routes.d.ts +1318 -0
  113. package/dist/types/api/settings.d.ts +642 -0
  114. package/dist/types/api/state.d.ts +492 -0
  115. package/dist/types/api/static.d.ts +11 -0
  116. package/dist/types/api/tls.d.ts +112 -0
  117. package/dist/types/api/workspaces/$.routes.d.ts +797 -0
  118. package/dist/types/api/wsl-temperature.d.ts +113 -0
  119. package/dist/types/app.d.ts +6080 -0
  120. package/dist/types/cli/args.d.ts +75 -0
  121. package/dist/types/cli/backup-offline.d.ts +23 -0
  122. package/dist/types/cli/backup.d.ts +79 -0
  123. package/dist/types/cli/down.d.ts +75 -0
  124. package/dist/types/cli/init.d.ts +60 -0
  125. package/dist/types/cli/io.d.ts +65 -0
  126. package/dist/types/cli/logs.d.ts +64 -0
  127. package/dist/types/cli/migrate.d.ts +33 -0
  128. package/dist/types/cli/nanny.d.ts +19 -0
  129. package/dist/types/cli/nearest.d.ts +10 -0
  130. package/dist/types/cli/restart.d.ts +42 -0
  131. package/dist/types/cli/server.d.ts +68 -0
  132. package/dist/types/cli/set-password.d.ts +14 -0
  133. package/dist/types/cli/set-token.d.ts +21 -0
  134. package/dist/types/cli/setup-temp.d.ts +65 -0
  135. package/dist/types/cli/status.d.ts +14 -0
  136. package/dist/types/cli/ui-revert.d.ts +3 -0
  137. package/dist/types/cli/ui-switch.d.ts +27 -0
  138. package/dist/types/cli/ui-update.d.ts +72 -0
  139. package/dist/types/cli/up.d.ts +90 -0
  140. package/dist/types/cli/usage.d.ts +23 -0
  141. package/dist/types/cli.d.ts +12 -0
  142. package/dist/types/client.d.ts +6284 -0
  143. package/dist/types/config/layout.d.ts +11 -0
  144. package/dist/types/config/migrations.d.ts +69 -0
  145. package/dist/types/config/parse.d.ts +54 -0
  146. package/dist/types/config/patch.d.ts +20 -0
  147. package/dist/types/config/schema.d.ts +318 -0
  148. package/dist/types/config/secret-parts.d.ts +48 -0
  149. package/dist/types/config/secrets.d.ts +206 -0
  150. package/dist/types/config/seed.d.ts +30 -0
  151. package/dist/types/config/server-ids.d.ts +14 -0
  152. package/dist/types/config/settings.d.ts +74 -0
  153. package/dist/types/config/store.d.ts +132 -0
  154. package/dist/types/config/workspaces.d.ts +96 -0
  155. package/dist/types/helpers/action-result.d.ts +46 -0
  156. package/dist/types/helpers/atomic.d.ts +9 -0
  157. package/dist/types/helpers/backoff.d.ts +7 -0
  158. package/dist/types/helpers/bind.d.ts +16 -0
  159. package/dist/types/helpers/config-text.d.ts +23 -0
  160. package/dist/types/helpers/cookies.d.ts +19 -0
  161. package/dist/types/helpers/copy-tree.d.ts +15 -0
  162. package/dist/types/helpers/daemon-log.d.ts +45 -0
  163. package/dist/types/helpers/daemon.d.ts +122 -0
  164. package/dist/types/helpers/deferred.d.ts +7 -0
  165. package/dist/types/helpers/env-file.d.ts +20 -0
  166. package/dist/types/helpers/error.d.ts +18 -0
  167. package/dist/types/helpers/factory.d.ts +6 -0
  168. package/dist/types/helpers/last-stop.d.ts +20 -0
  169. package/dist/types/helpers/logger.d.ts +7 -0
  170. package/dist/types/helpers/open.d.ts +2 -0
  171. package/dist/types/helpers/openapi.d.ts +46 -0
  172. package/dist/types/helpers/paths.d.ts +94 -0
  173. package/dist/types/helpers/restore-lock.d.ts +32 -0
  174. package/dist/types/helpers/runtime.d.ts +18 -0
  175. package/dist/types/helpers/secret-compare.d.ts +13 -0
  176. package/dist/types/helpers/shell.d.ts +19 -0
  177. package/dist/types/helpers/sse.d.ts +23 -0
  178. package/dist/types/helpers/template.d.ts +8 -0
  179. package/dist/types/helpers/ui-dir.d.ts +11 -0
  180. package/dist/types/helpers/validate.d.ts +7 -0
  181. package/dist/types/helpers/validator.d.ts +12 -0
  182. package/dist/types/helpers/version.d.ts +10 -0
  183. package/dist/types/helpers/workspace.d.ts +25 -0
  184. package/dist/types/index.d.ts +17 -0
  185. package/dist/types/middleware/auth.d.ts +37 -0
  186. package/dist/types/middleware/host.d.ts +29 -0
  187. package/dist/types/middleware/loopback.d.ts +18 -0
  188. package/dist/types/openapi-reference.d.ts +22 -0
  189. package/dist/types/openapi.d.ts +34 -0
  190. package/dist/types/providers/archive.d.ts +54 -0
  191. package/dist/types/providers/backup-hook.d.ts +34 -0
  192. package/dist/types/providers/ddns/cloudflare.d.ts +2 -0
  193. package/dist/types/providers/ddns/desec.d.ts +2 -0
  194. package/dist/types/providers/ddns/digitalocean.d.ts +2 -0
  195. package/dist/types/providers/ddns/duckdns.d.ts +2 -0
  196. package/dist/types/providers/ddns/dyndns2.d.ts +15 -0
  197. package/dist/types/providers/ddns/dynu.d.ts +2 -0
  198. package/dist/types/providers/ddns/freedns.d.ts +2 -0
  199. package/dist/types/providers/ddns/gandi.d.ts +2 -0
  200. package/dist/types/providers/ddns/godaddy.d.ts +2 -0
  201. package/dist/types/providers/ddns/henet.d.ts +3 -0
  202. package/dist/types/providers/ddns/index.d.ts +12 -0
  203. package/dist/types/providers/ddns/ip.d.ts +27 -0
  204. package/dist/types/providers/ddns/namecheap-api.d.ts +13 -0
  205. package/dist/types/providers/ddns/namecheap.d.ts +6 -0
  206. package/dist/types/providers/ddns/noip.d.ts +2 -0
  207. package/dist/types/providers/ddns/porkbun.d.ts +2 -0
  208. package/dist/types/providers/ddns/spaceship.d.ts +7 -0
  209. package/dist/types/providers/ddns/types.d.ts +98 -0
  210. package/dist/types/providers/ddns/zone.d.ts +11 -0
  211. package/dist/types/providers/docker.d.ts +117 -0
  212. package/dist/types/providers/entry-state.d.ts +15 -0
  213. package/dist/types/providers/health-check.d.ts +27 -0
  214. package/dist/types/providers/host.d.ts +147 -0
  215. package/dist/types/providers/identity.d.ts +54 -0
  216. package/dist/types/providers/log-tail.d.ts +29 -0
  217. package/dist/types/providers/nanny-sweep.d.ts +51 -0
  218. package/dist/types/providers/nanny.d.ts +94 -0
  219. package/dist/types/providers/port.d.ts +142 -0
  220. package/dist/types/providers/proc.d.ts +116 -0
  221. package/dist/types/providers/process.d.ts +61 -0
  222. package/dist/types/providers/proxy/caddy.d.ts +2 -0
  223. package/dist/types/providers/proxy/index.d.ts +7 -0
  224. package/dist/types/providers/proxy/types.d.ts +54 -0
  225. package/dist/types/providers/server-vars.d.ts +4 -0
  226. package/dist/types/providers/telegram.d.ts +32 -0
  227. package/dist/types/providers/ui-release.d.ts +113 -0
  228. package/dist/types/providers/webhook.d.ts +64 -0
  229. package/dist/types/providers/wsl-temperature.d.ts +69 -0
  230. package/dist/types/services/acme-challenge.d.ts +44 -0
  231. package/dist/types/services/auth.d.ts +145 -0
  232. package/dist/types/services/backups.d.ts +352 -0
  233. package/dist/types/services/config-watch.d.ts +40 -0
  234. package/dist/types/services/control-server.d.ts +58 -0
  235. package/dist/types/services/ddns.d.ts +67 -0
  236. package/dist/types/services/dependencies.d.ts +21 -0
  237. package/dist/types/services/events.d.ts +17 -0
  238. package/dist/types/services/exposure.d.ts +33 -0
  239. package/dist/types/services/history.d.ts +36 -0
  240. package/dist/types/services/host-monitor.d.ts +32 -0
  241. package/dist/types/services/init.d.ts +71 -0
  242. package/dist/types/services/log-buffer.d.ts +28 -0
  243. package/dist/types/services/log-files.d.ts +87 -0
  244. package/dist/types/services/log-relay.d.ts +36 -0
  245. package/dist/types/services/nanny.d.ts +14 -0
  246. package/dist/types/services/notifications.d.ts +124 -0
  247. package/dist/types/services/panel.d.ts +194 -0
  248. package/dist/types/services/proxy-config.d.ts +83 -0
  249. package/dist/types/services/proxy.d.ts +454 -0
  250. package/dist/types/services/state.d.ts +41 -0
  251. package/dist/types/services/supervisor/compose.d.ts +17 -0
  252. package/dist/types/services/supervisor/entry.d.ts +139 -0
  253. package/dist/types/services/supervisor/health.d.ts +55 -0
  254. package/dist/types/services/supervisor/pending-load.d.ts +6 -0
  255. package/dist/types/services/supervisor/persistent.d.ts +55 -0
  256. package/dist/types/services/supervisor/port-preflight.d.ts +45 -0
  257. package/dist/types/services/supervisor/records.d.ts +38 -0
  258. package/dist/types/services/supervisor/spawn.d.ts +15 -0
  259. package/dist/types/services/supervisor/view.d.ts +4 -0
  260. package/dist/types/services/supervisor.d.ts +113 -0
  261. package/dist/types/services/tls.d.ts +48 -0
  262. package/dist/types/services/ui-update.d.ts +44 -0
  263. package/dist/types/services/ui.d.ts +50 -0
  264. package/dist/types/shared/api-client.d.ts +137 -0
  265. package/dist/types/shared/backup-scope.d.ts +109 -0
  266. package/dist/types/shared/clone.d.ts +14 -0
  267. package/dist/types/shared/contracts.d.ts +4233 -0
  268. package/dist/types/shared/cpu-scale.d.ts +25 -0
  269. package/dist/types/shared/ddns-form.d.ts +62 -0
  270. package/dist/types/shared/endpoint.d.ts +8 -0
  271. package/dist/types/shared/error-message.d.ts +8 -0
  272. package/dist/types/shared/fields.d.ts +21 -0
  273. package/dist/types/shared/generated.d.ts +26 -0
  274. package/dist/types/shared/host-readings.d.ts +185 -0
  275. package/dist/types/shared/patch-diff.d.ts +94 -0
  276. package/dist/types/shared/probe-latency.d.ts +25 -0
  277. package/dist/types/shared/proxy-form.d.ts +182 -0
  278. package/dist/types/shared/server-attention.d.ts +37 -0
  279. package/dist/types/shared/server-key.d.ts +13 -0
  280. package/dist/types/shared/server-readings.d.ts +55 -0
  281. package/dist/types/shared/server-url.d.ts +43 -0
  282. package/dist/types/shared/shape.d.ts +17 -0
  283. package/dist/types/shared/ui-format.d.ts +89 -0
  284. package/docs/API.md +180 -0
  285. package/docs/BACKUPS.md +97 -0
  286. package/docs/CLI.md +122 -0
  287. package/docs/DDNS.md +12 -3
  288. package/docs/NOTIFICATIONS.md +3 -1
  289. package/docs/RESTORE_DEMO.md +6 -4
  290. package/docs/REVERSE_PROXY.md +2 -2
  291. package/docs/SECURITY.md +82 -0
  292. package/docs/SERVERS.md +47 -15
  293. package/docs/UI_CREATION.md +82 -286
  294. package/package.json +18 -9
  295. package/uis/stock/dist/assets/de-DyGrM1KK.js +1 -0
  296. package/uis/stock/dist/assets/es-BebHdc0E.js +1 -0
  297. package/uis/stock/dist/assets/fr-DsDTrxhI.js +1 -0
  298. package/uis/stock/dist/assets/index-6LANO2Ua.css +2 -0
  299. package/uis/stock/dist/assets/index-D06cUZbM.js +56 -0
  300. package/uis/stock/dist/assets/ja-D3RARJjW.js +1 -0
  301. package/uis/stock/dist/assets/ko-CKI3dFoD.js +1 -0
  302. package/uis/stock/dist/assets/ru-DEU5ujXt.js +1 -0
  303. package/uis/stock/dist/assets/vi-ULKPnasj.js +1 -0
  304. package/uis/stock/dist/assets/zh-CN-tCvnOxWy.js +1 -0
  305. package/uis/stock/dist/index.html +2 -2
  306. package/uis/stock/dist/ui.json +3 -3
  307. package/AGENTS.md +0 -403
  308. package/uis/stock/dist/assets/de-CiSKBON6.js +0 -1
  309. package/uis/stock/dist/assets/es-BgNQbboq.js +0 -1
  310. package/uis/stock/dist/assets/fr-WzBF8AXI.js +0 -1
  311. package/uis/stock/dist/assets/index-CXDl25BP.js +0 -53
  312. package/uis/stock/dist/assets/index-Cok5msAO.css +0 -2
  313. package/uis/stock/dist/assets/ja-DMQqF4ip.js +0 -1
  314. package/uis/stock/dist/assets/ko-DgfSg9v_.js +0 -1
  315. package/uis/stock/dist/assets/ru-DjIByX61.js +0 -1
  316. package/uis/stock/dist/assets/vi-DOB8nYFC.js +0 -1
  317. package/uis/stock/dist/assets/zh-CN-DZ3WlUgy.js +0 -1
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Refuses a state directory this release cannot use, before any command resolves a
3
+ * path into it.
4
+ *
5
+ * Through 0.7.x this relocated a pre-workspace `$HHOSTED_HOME` automatically. 0.8.0
6
+ * dropped the mover, so an instance that never crossed `.hh` is stopped instead of
7
+ * being read as an empty one — its `servers.config.json` would otherwise sit unread
8
+ * beside a panel supervising nothing, with no error anywhere. The migration itself is
9
+ * unchanged and still shipped: the 0.7 line performs it on its first run.
10
+ */
11
+ export declare function ensureLayout(): void;
@@ -0,0 +1,69 @@
1
+ export declare const CONFIG_SCHEMA = 2;
2
+ /**
3
+ * The schema of a file that carries no `meta` stamp at all.
4
+ *
5
+ * A literal, **not** `CONFIG_SCHEMA`: an unstamped file predates the stamp, so it is the *oldest* shape,
6
+ * and reading it as the current one would skip every migration the moment `CONFIG_SCHEMA` is bumped —
7
+ * the file would then be stamped as the new schema without ever being lifted to it.
8
+ *
9
+ * **Schema 1 is the oldest stamped shape**, but an unstamped file is not necessarily that one: the
10
+ * seeds this release writes carry no `meta` at all, and they are written in the *current* shape. So
11
+ * an unstamped file cannot be told apart from a pre-stamp one, and both are read as the shape that
12
+ * predates the stamp — schema 1. That is what makes the distinction safe in the direction that
13
+ * matters: a released file is lifted, and a seed is written in a shape schema 1 can describe,
14
+ * because every field added since is optional with a default.
15
+ *
16
+ * (This was `1` with the note "a hypothetical `to: 2` step" — and then 2 arrived, which is how the
17
+ * seeds started refusing to load. They now carry a stamp of their own; see `config/seed.ts`.)
18
+ */
19
+ export declare const UNSTAMPED_SCHEMA = 1;
20
+ /** A settings or servers file, as read: whatever keys it carries. */
21
+ export type RawConfig = Record<string, unknown>;
22
+ export interface ConfigMigration {
23
+ /** The schema this step produces; steps run in ascending order. */
24
+ to: number;
25
+ /** One line, printed by `migrate` before anything is written. */
26
+ describe: string;
27
+ apply: (config: RawConfig) => RawConfig;
28
+ }
29
+ /**
30
+ * Every published migration, oldest first. Keep this list small and permanent:
31
+ * a config may arrive from any earlier release, so a step is never removed.
32
+ */
33
+ export declare const configMigrations: ConfigMigration[];
34
+ export interface MigrationPlan {
35
+ from: number;
36
+ to: number;
37
+ steps: ConfigMigration[];
38
+ /** The file was written by a release newer than this one. */
39
+ tooNew: boolean;
40
+ /**
41
+ * The schema the steps actually reach, which is `to` only when the chain is unbroken.
42
+ *
43
+ * A **gap** in `configMigrations` — a step lifting 1→2 published without one lifting 2→3 — leaves the
44
+ * file part-way while `migrate` stamps it as the current schema anyway: it writes
45
+ * `schema: CONFIG_SCHEMA` unconditionally. The file then claims a shape it does not have, which is the
46
+ * same silent corruption the unstamped default caused. This makes the gap detectable.
47
+ */
48
+ reached: number;
49
+ }
50
+ export interface MigrationOptions {
51
+ /** Defaults to every migration this release ships. */
52
+ migrations?: ConfigMigration[];
53
+ /** The schema to reach; defaults to what this release understands. */
54
+ to?: number;
55
+ }
56
+ /** What would have to run to bring `from` up to `to`. */
57
+ export declare function planConfigMigrations(from: number, options?: MigrationOptions): MigrationPlan;
58
+ /**
59
+ * Applies the plan in order; the caller owns writing the result.
60
+ *
61
+ * The result carries `meta.schema` set to the schema the steps reached, so it is readable by this
62
+ * release's own parser — which refuses a file whose stamp still says an older schema. Without that,
63
+ * `migrate` validated its own output as "needs 1 migration" and refused every config it exists to
64
+ * lift.
65
+ */
66
+ export declare function applyConfigMigrations(config: RawConfig, from: number, options?: MigrationOptions): {
67
+ config: RawConfig;
68
+ applied: ConfigMigration[];
69
+ };
@@ -0,0 +1,54 @@
1
+ import type { MigrationOptions } from './migrations.js';
2
+ import type { ResolvedGlobalConfig, ResolvedWorkspaceSettings } from './schema.js';
3
+ import type { ServerConfig } from '../shared/contracts.js';
4
+ export interface ConfigParse<T> {
5
+ /** Null when something made the file unusable; `errors` says why. */
6
+ config: T | null;
7
+ /** Blocking problems: what the panel must not start on. */
8
+ errors: string[];
9
+ /** Keys a newer release wrote that this one does not know, by path. */
10
+ unknownKeys: string[];
11
+ /** Real but non-blocking problems: supervision still runs, the file is still used. */
12
+ warnings: string[];
13
+ /** The shape the file declares; an unstamped file reads as the current one. */
14
+ schemaVersion: number;
15
+ /** What wrote it, when the file says. */
16
+ writtenBy: string | null;
17
+ }
18
+ type Validator = (input: unknown) => unknown;
19
+ /**
20
+ * Validates one object against one schema, tolerating keys the schema does not
21
+ * know: a config written by a newer release has to keep working here, and losing
22
+ * the *whole group* to schema defaults would silently reset the listener port,
23
+ * the bind and the auth policy over a single unrecognized key.
24
+ *
25
+ * Only unrecognized keys are dropped, and each one is reported. Anything else is
26
+ * a real problem, returned for the caller to refuse on.
27
+ */
28
+ export declare function parseTolerant(value: unknown, schema: Validator, prefix: string, unknownKeys: string[]): {
29
+ value: unknown;
30
+ error: string | null;
31
+ };
32
+ /** `$HHOSTED_HOME/.hh/settings.json`. */
33
+ export declare function parseGlobalSettings(raw: unknown, options?: MigrationOptions): ConfigParse<ResolvedGlobalConfig>;
34
+ /** `$HHOSTED_HOME/.hh/<id>/settings.json`. */
35
+ export declare function parseWorkspaceSettings(raw: unknown, options?: MigrationOptions): ConfigParse<ResolvedWorkspaceSettings>;
36
+ export interface ServersParse {
37
+ servers: ServerConfig[];
38
+ errors: string[];
39
+ unknownKeys: string[];
40
+ warnings: string[];
41
+ schemaVersion: number;
42
+ writtenBy: string | null;
43
+ }
44
+ /**
45
+ * `$HHOSTED_HOME/.hh/<id>/servers.config.json`: just the entries, each resolved
46
+ * against the workspace's defaults.
47
+ */
48
+ export declare function parseServersFile(raw: unknown, defaults: Record<string, unknown>, options?: MigrationOptions): ServersParse;
49
+ /** Adds the stamp every write carries, so the next release can tell what wrote the file. */
50
+ export declare function stampConfig<T extends {
51
+ $schema?: string;
52
+ meta?: unknown;
53
+ }>(draft: T): T;
54
+ export {};
@@ -0,0 +1,20 @@
1
+ /** Nested groups a patch merges into instead of replacing. */
2
+ export declare const SERVER_MERGE_KEYS: Set<string>;
3
+ export declare const CONTROL_MERGE_KEYS: Set<string>;
4
+ /** The general block merges key by key; `destinations` is a list a patch replaces. */
5
+ export declare const NOTIFICATION_MERGE_KEYS: Set<string>;
6
+ /** The DDNS lists are replaced; only its two IP-family groups merge. */
7
+ export declare const DDNS_MERGE_KEYS: Set<string>;
8
+ /** The proxy's one nested group; `routes` and `certificates` are lists a patch replaces. */
9
+ export declare const PROXY_MERGE_KEYS: Set<string>;
10
+ /** Backups' scheduled half merges, so a patch sending only `intervalMs` keeps the retention. */
11
+ export declare const BACKUP_MERGE_KEYS: Set<string>;
12
+ export declare const EMPTY_MERGE_KEYS: Set<string>;
13
+ export declare function applyPatch(target: Record<string, unknown>, patch: Record<string, unknown>, mergeKeys: Set<string>): void;
14
+ /**
15
+ * Merges one nested group recursively — `health.http` is a group of its own, and
16
+ * replacing it wholesale would silently reset the siblings a partial patch never
17
+ * mentioned. An explicit `null` removes a key, which is how a schema-optional
18
+ * field is cleared.
19
+ */
20
+ export declare function mergeGroup(target: Record<string, unknown>, patch: Record<string, unknown>): Record<string, unknown>;
@@ -0,0 +1,318 @@
1
+ import type { ServerConfig } from '../shared/contracts.js';
2
+ import { backupsSchema, controlSchema, ddnsConfigSchema, defaultsSchema, hostSchema, logsSchema, notificationsSchema, proxyConfigSchema, serverSchema } from '../shared/contracts.js';
3
+ export { backupsSchema, controlSchema, ddnsConfigSchema, defaultsSchema, hostSchema, logsSchema, notificationsSchema, proxyConfigSchema, serverSchema };
4
+ /**
5
+ * Which release wrote the file, and the config shape it wrote. Optional so a
6
+ * config from before the stamp still reads, and so an archive made by an older
7
+ * release still restores.
8
+ */
9
+ export declare const metaSchema: import("arktype/internal/variants/object.ts").ObjectType<{
10
+ writtenBy: import("arktype/internal/attributes.ts").Default<string, "">;
11
+ schema: import("arktype/internal/attributes.ts").Default<number, 1>;
12
+ }, {}>;
13
+ /**
14
+ * `$HHOSTED_HOME/.hh/settings.json`: the settings that belong to the panel
15
+ * itself — its listener, authentication, TLS policy, host vitals, backups and
16
+ * the reverse proxy. Nothing here is per workspace.
17
+ */
18
+ export declare const globalSettingsSchema: import("arktype/internal/variants/object.ts").ObjectType<{
19
+ control: import("arktype/internal/attributes.ts").Default<{
20
+ label: import("arktype/internal/attributes.ts").Default<string, "home-hosted">;
21
+ port: import("arktype/internal/attributes.ts").Default<number, 3999>;
22
+ host: import("arktype/internal/attributes.ts").Default<"local" | "lan" | `${number}.${number}.${number}.${number}`, "local">;
23
+ openBrowser: import("arktype/internal/attributes.ts").Default<boolean, false>;
24
+ allowedHosts: import("arktype/internal/attributes.ts").Default<string[], never[]>;
25
+ auth: import("arktype/internal/attributes.ts").Default<{
26
+ enabled: import("arktype/internal/attributes.ts").Default<boolean, true>;
27
+ sessionTtlMs: import("arktype/internal/attributes.ts").Default<number, 604800000>;
28
+ cookieSecure: import("arktype/internal/attributes.ts").Default<"never" | "auto" | "always", "auto">;
29
+ trustProxy: import("arktype/internal/attributes.ts").Default<boolean | "loopback", "loopback">;
30
+ maxLoginAttempts: import("arktype/internal/attributes.ts").Default<number, 5>;
31
+ lockoutMs: import("arktype/internal/attributes.ts").Default<number, 60000>;
32
+ }, {}>;
33
+ tls: import("arktype/internal/attributes.ts").Default<{
34
+ enabled: import("arktype/internal/attributes.ts").Default<boolean, false>;
35
+ }, {}>;
36
+ }, {}>;
37
+ host: import("arktype/internal/attributes.ts").Default<{
38
+ enabled: import("arktype/internal/attributes.ts").Default<boolean, true>;
39
+ intervalMs: import("arktype/internal/attributes.ts").Default<number, 15000>;
40
+ diskPaths: import("arktype/internal/attributes.ts").Default<string[], string[]>;
41
+ diskUsedPercent: import("arktype/internal/attributes.ts").Default<number, 90>;
42
+ memoryUsedPercent: import("arktype/internal/attributes.ts").Default<number, 90>;
43
+ swapUsedPercent: import("arktype/internal/attributes.ts").Default<number, 50>;
44
+ loadPerCpu: import("arktype/internal/attributes.ts").Default<number, 2>;
45
+ tempCelsius: import("arktype/internal/attributes.ts").Default<number, 85>;
46
+ tempCommand: import("arktype/internal/attributes.ts").Default<string, "">;
47
+ tempCommandTimeoutMs: import("arktype/internal/attributes.ts").Default<number, 5000>;
48
+ }, {}>;
49
+ backups: import("arktype/internal/attributes.ts").Default<{
50
+ enabled: import("arktype/internal/attributes.ts").Default<boolean, true>;
51
+ dir: import("arktype/internal/attributes.ts").Default<string, ".backups">;
52
+ keep: import("arktype/internal/attributes.ts").Default<number, 5>;
53
+ includePaths: import("arktype/internal/attributes.ts").Default<string[], never[]>;
54
+ schedule: import("arktype/internal/attributes.ts").Default<{
55
+ intervalMs: import("arktype/internal/attributes.ts").Default<number, 0>;
56
+ keep: import("arktype/internal/attributes.ts").Default<number, 7>;
57
+ scope?: {
58
+ mode: "only" | "except";
59
+ ids: string[];
60
+ } | undefined;
61
+ }, {}>;
62
+ }, {}>;
63
+ proxy: import("arktype/internal/attributes.ts").Default<{
64
+ enabled: import("arktype/internal/attributes.ts").Default<boolean, false>;
65
+ engine: import("arktype/internal/attributes.ts").Default<"caddy", "caddy">;
66
+ httpPort: import("arktype/internal/attributes.ts").Default<number, 80>;
67
+ httpsPort: import("arktype/internal/attributes.ts").Default<number, 443>;
68
+ email: import("arktype/internal/attributes.ts").Default<string, "">;
69
+ staging: import("arktype/internal/attributes.ts").Default<boolean, false>;
70
+ dns01: import("arktype/internal/attributes.ts").Default<{
71
+ enabled: import("arktype/internal/attributes.ts").Default<boolean, false>;
72
+ resolvers: import("arktype/internal/attributes.ts").Default<string[], never[]>;
73
+ }, {}>;
74
+ certificates: import("arktype/internal/attributes.ts").Default<{
75
+ id: string;
76
+ label: import("arktype/internal/attributes.ts").Default<string, "">;
77
+ }[], never[]>;
78
+ routes: import("arktype/internal/attributes.ts").Default<{
79
+ id: string;
80
+ host: string;
81
+ enabled: import("arktype/internal/attributes.ts").Default<boolean, true>;
82
+ target: import("arktype/internal/attributes.ts").Default<"server" | "panel" | "external", "server">;
83
+ workspace: import("arktype/internal/attributes.ts").Default<string, "">;
84
+ server: import("arktype/internal/attributes.ts").Default<string, "">;
85
+ url: import("arktype/internal/attributes.ts").Default<string, "">;
86
+ path: import("arktype/internal/attributes.ts").Default<string, "">;
87
+ tls: import("arktype/internal/attributes.ts").Default<"auto" | "off" | "manual", "auto">;
88
+ dnsAccount: import("arktype/internal/attributes.ts").Default<string, "">;
89
+ }[], never[]>;
90
+ }, {}>;
91
+ $schema?: string | undefined;
92
+ meta?: {
93
+ writtenBy: import("arktype/internal/attributes.ts").Default<string, "">;
94
+ schema: import("arktype/internal/attributes.ts").Default<number, 1>;
95
+ } | undefined;
96
+ }, {}>;
97
+ /** `$HHOSTED_HOME/.hh/<id>/settings.json`: what one workspace owns on its own. */
98
+ export declare const workspaceSettingsSchema: import("arktype/internal/variants/object.ts").ObjectType<{
99
+ defaults: import("arktype/internal/attributes.ts").Default<{
100
+ enabled: import("arktype/internal/attributes.ts").Default<boolean, true>;
101
+ autostart: import("arktype/internal/attributes.ts").Default<boolean, false>;
102
+ bind: import("arktype/internal/attributes.ts").Default<"local" | "lan" | `${number}.${number}.${number}.${number}`, "local">;
103
+ onPortConflict: import("arktype/internal/attributes.ts").Default<"warn" | "block" | "follow" | "reclaim" | "kill", "block">;
104
+ restart: import("arktype/internal/attributes.ts").Default<{
105
+ enabled: import("arktype/internal/attributes.ts").Default<boolean, true>;
106
+ maxRetries: import("arktype/internal/attributes.ts").Default<number, 3>;
107
+ baseDelayMs: import("arktype/internal/attributes.ts").Default<number, 1000>;
108
+ factor: import("arktype/internal/attributes.ts").Default<number, 2>;
109
+ maxDelayMs: import("arktype/internal/attributes.ts").Default<number, 30000>;
110
+ resetAfterMs: import("arktype/internal/attributes.ts").Default<number, 60000>;
111
+ }, {}>;
112
+ health: import("arktype/internal/attributes.ts").Default<{
113
+ enabled: import("arktype/internal/attributes.ts").Default<boolean, true>;
114
+ mode: import("arktype/internal/attributes.ts").Default<"http" | "port", "port">;
115
+ http: import("arktype/internal/attributes.ts").Default<{
116
+ scheme: import("arktype/internal/attributes.ts").Default<"http" | "https", "http">;
117
+ allowInvalidCert: import("arktype/internal/attributes.ts").Default<boolean, false>;
118
+ path: import("arktype/internal/attributes.ts").Default<string, "/">;
119
+ method: import("arktype/internal/attributes.ts").Default<"GET" | "HEAD", "GET">;
120
+ expectStatusBelow: import("arktype/internal/attributes.ts").Default<number, 400>;
121
+ expectBody: import("arktype/internal/attributes.ts").Default<string, "">;
122
+ expectStatus?: number | null | undefined;
123
+ }, {}>;
124
+ intervalMs: import("arktype/internal/attributes.ts").Default<number, 5000>;
125
+ timeoutMs: import("arktype/internal/attributes.ts").Default<number, 1500>;
126
+ unhealthyThreshold: import("arktype/internal/attributes.ts").Default<number, 3>;
127
+ forceRestartAfterMs: import("arktype/internal/attributes.ts").Default<number, 0>;
128
+ startTimeoutMs: import("arktype/internal/attributes.ts").Default<number, 20000>;
129
+ }, {}>;
130
+ stop: import("arktype/internal/attributes.ts").Default<{
131
+ signal: import("arktype/internal/attributes.ts").Default<"SIGTERM" | "SIGINT" | "SIGKILL", "SIGTERM">;
132
+ killGroup: import("arktype/internal/attributes.ts").Default<boolean, true>;
133
+ graceMs: import("arktype/internal/attributes.ts").Default<number, 5000>;
134
+ killPortHolders: import("arktype/internal/attributes.ts").Default<boolean, false>;
135
+ }, {}>;
136
+ logBufferLines: import("arktype/internal/attributes.ts").Default<number, number>;
137
+ }, {}>;
138
+ logs: import("arktype/internal/attributes.ts").Default<{
139
+ persist: import("arktype/internal/attributes.ts").Default<boolean, true>;
140
+ maxBytes: import("arktype/internal/attributes.ts").Default<number, 2000000>;
141
+ keep: import("arktype/internal/attributes.ts").Default<number, 3>;
142
+ }, {}>;
143
+ notifications: import("arktype/internal/attributes.ts").Default<{
144
+ defaults: import("arktype/internal/attributes.ts").Default<{
145
+ onCrash: import("arktype/internal/attributes.ts").Default<boolean, true>;
146
+ onUnhealthy: import("arktype/internal/attributes.ts").Default<boolean, true>;
147
+ onForcedRestart: import("arktype/internal/attributes.ts").Default<boolean, true>;
148
+ onRecovered: import("arktype/internal/attributes.ts").Default<boolean, false>;
149
+ onHost: import("arktype/internal/attributes.ts").Default<boolean, true>;
150
+ onDdns: import("arktype/internal/attributes.ts").Default<boolean, true>;
151
+ cooldownMs: import("arktype/internal/attributes.ts").Default<number, 120000>;
152
+ }, {}>;
153
+ destinations: import("arktype/internal/attributes.ts").Default<({
154
+ onCrash: import("arktype/internal/attributes.ts").Default<boolean, true>;
155
+ onUnhealthy: import("arktype/internal/attributes.ts").Default<boolean, true>;
156
+ onForcedRestart: import("arktype/internal/attributes.ts").Default<boolean, true>;
157
+ onRecovered: import("arktype/internal/attributes.ts").Default<boolean, false>;
158
+ onHost: import("arktype/internal/attributes.ts").Default<boolean, true>;
159
+ onDdns: import("arktype/internal/attributes.ts").Default<boolean, true>;
160
+ cooldownMs: import("arktype/internal/attributes.ts").Default<number, 120000>;
161
+ kind: "telegram";
162
+ id: string;
163
+ enabled: import("arktype/internal/attributes.ts").Default<boolean, false>;
164
+ chatId: import("arktype/internal/attributes.ts").Default<string, "">;
165
+ useOwnSettings: import("arktype/internal/attributes.ts").Default<boolean, true>;
166
+ } | {
167
+ onCrash: import("arktype/internal/attributes.ts").Default<boolean, true>;
168
+ onUnhealthy: import("arktype/internal/attributes.ts").Default<boolean, true>;
169
+ onForcedRestart: import("arktype/internal/attributes.ts").Default<boolean, true>;
170
+ onRecovered: import("arktype/internal/attributes.ts").Default<boolean, false>;
171
+ onHost: import("arktype/internal/attributes.ts").Default<boolean, true>;
172
+ onDdns: import("arktype/internal/attributes.ts").Default<boolean, true>;
173
+ cooldownMs: import("arktype/internal/attributes.ts").Default<number, 120000>;
174
+ kind: "webhook";
175
+ id: string;
176
+ url: import("arktype/internal/attributes.ts").Default<string, "">;
177
+ enabled: import("arktype/internal/attributes.ts").Default<boolean, true>;
178
+ method: import("arktype/internal/attributes.ts").Default<"POST" | "PUT", "POST">;
179
+ format: import("arktype/internal/attributes.ts").Default<"json" | "text", "json">;
180
+ headers: import("arktype/internal/attributes.ts").Default<string, "">;
181
+ useOwnSettings: import("arktype/internal/attributes.ts").Default<boolean, true>;
182
+ })[], never[]>;
183
+ }, {}>;
184
+ ddns: import("arktype/internal/attributes.ts").Default<{
185
+ enabled: import("arktype/internal/attributes.ts").Default<boolean, false>;
186
+ intervalMs: import("arktype/internal/attributes.ts").Default<number, 300000>;
187
+ ipv4: import("arktype/internal/attributes.ts").Default<{
188
+ enabled: import("arktype/internal/attributes.ts").Default<boolean, true>;
189
+ url: import("arktype/internal/attributes.ts").Default<string, "">;
190
+ }, {}>;
191
+ ipv6: import("arktype/internal/attributes.ts").Default<{
192
+ enabled: import("arktype/internal/attributes.ts").Default<boolean, false>;
193
+ url: import("arktype/internal/attributes.ts").Default<string, "">;
194
+ }, {}>;
195
+ ttl: import("arktype/internal/attributes.ts").Default<number, 1>;
196
+ accounts: import("arktype/internal/attributes.ts").Default<{
197
+ id: string;
198
+ provider: string;
199
+ label: import("arktype/internal/attributes.ts").Default<string, "">;
200
+ }[], never[]>;
201
+ domains: import("arktype/internal/attributes.ts").Default<{
202
+ host: `${string}${string}.${string}${string}${string}`;
203
+ account: string;
204
+ types: import("arktype/internal/attributes.ts").Default<("A" | "AAAA")[], "A"[]>;
205
+ proxied: import("arktype/internal/attributes.ts").Default<boolean, false>;
206
+ enabled: import("arktype/internal/attributes.ts").Default<boolean, true>;
207
+ zone?: string | undefined;
208
+ ttl?: number | undefined;
209
+ }[], never[]>;
210
+ }, {}>;
211
+ $schema?: string | undefined;
212
+ meta?: {
213
+ writtenBy: import("arktype/internal/attributes.ts").Default<string, "">;
214
+ schema: import("arktype/internal/attributes.ts").Default<number, 1>;
215
+ } | undefined;
216
+ }, {}>;
217
+ /** `$HHOSTED_HOME/.hh/<id>/servers.config.json`: the entries this workspace supervises. */
218
+ export declare const serversFileSchema: import("arktype/internal/variants/object.ts").ObjectType<{
219
+ servers: import("arktype/internal/attributes.ts").Default<{
220
+ id: string;
221
+ enabled: import("arktype/internal/attributes.ts").Default<boolean, true>;
222
+ autostart: import("arktype/internal/attributes.ts").Default<boolean, false>;
223
+ persistent: import("arktype/internal/attributes.ts").Default<boolean, false>;
224
+ command: string;
225
+ args: import("arktype/internal/attributes.ts").Default<string[], never[]>;
226
+ cwd: import("arktype/internal/attributes.ts").Default<string, ".">;
227
+ env: import("arktype/internal/attributes.ts").Default<Record<string, string>, {}>;
228
+ dataEnvs: import("arktype/internal/attributes.ts").Default<Record<string, string>, {}>;
229
+ bind: import("arktype/internal/attributes.ts").Default<"local" | "lan" | `${number}.${number}.${number}.${number}`, "local">;
230
+ onPortConflict: import("arktype/internal/attributes.ts").Default<"warn" | "block" | "follow" | "reclaim" | "kill", "block">;
231
+ restart: import("arktype/internal/attributes.ts").Default<{
232
+ enabled: import("arktype/internal/attributes.ts").Default<boolean, true>;
233
+ maxRetries: import("arktype/internal/attributes.ts").Default<number, 3>;
234
+ baseDelayMs: import("arktype/internal/attributes.ts").Default<number, 1000>;
235
+ factor: import("arktype/internal/attributes.ts").Default<number, 2>;
236
+ maxDelayMs: import("arktype/internal/attributes.ts").Default<number, 30000>;
237
+ resetAfterMs: import("arktype/internal/attributes.ts").Default<number, 60000>;
238
+ }, {}>;
239
+ health: import("arktype/internal/attributes.ts").Default<{
240
+ enabled: import("arktype/internal/attributes.ts").Default<boolean, true>;
241
+ mode: import("arktype/internal/attributes.ts").Default<"http" | "port", "port">;
242
+ http: import("arktype/internal/attributes.ts").Default<{
243
+ scheme: import("arktype/internal/attributes.ts").Default<"http" | "https", "http">;
244
+ allowInvalidCert: import("arktype/internal/attributes.ts").Default<boolean, false>;
245
+ path: import("arktype/internal/attributes.ts").Default<string, "/">;
246
+ method: import("arktype/internal/attributes.ts").Default<"GET" | "HEAD", "GET">;
247
+ expectStatusBelow: import("arktype/internal/attributes.ts").Default<number, 400>;
248
+ expectBody: import("arktype/internal/attributes.ts").Default<string, "">;
249
+ expectStatus?: number | null | undefined;
250
+ }, {}>;
251
+ intervalMs: import("arktype/internal/attributes.ts").Default<number, 5000>;
252
+ timeoutMs: import("arktype/internal/attributes.ts").Default<number, 1500>;
253
+ unhealthyThreshold: import("arktype/internal/attributes.ts").Default<number, 3>;
254
+ forceRestartAfterMs: import("arktype/internal/attributes.ts").Default<number, 0>;
255
+ startTimeoutMs: import("arktype/internal/attributes.ts").Default<number, 20000>;
256
+ }, {}>;
257
+ stop: import("arktype/internal/attributes.ts").Default<{
258
+ signal: import("arktype/internal/attributes.ts").Default<"SIGTERM" | "SIGINT" | "SIGKILL", "SIGTERM">;
259
+ killGroup: import("arktype/internal/attributes.ts").Default<boolean, true>;
260
+ graceMs: import("arktype/internal/attributes.ts").Default<number, 5000>;
261
+ killPortHolders: import("arktype/internal/attributes.ts").Default<boolean, false>;
262
+ }, {}>;
263
+ logBufferLines: import("arktype/internal/attributes.ts").Default<number, number>;
264
+ dependsOn: import("arktype/internal/attributes.ts").Default<string[], never[]>;
265
+ envFile: import("arktype/internal/attributes.ts").Default<string, "">;
266
+ resources: import("arktype/internal/attributes.ts").Default<{
267
+ maxRssBytes: import("arktype/internal/attributes.ts").Default<number, 0>;
268
+ }, {}>;
269
+ backupPaths: import("arktype/internal/attributes.ts").Default<string[], never[]>;
270
+ backupIgnoreGenerated: import("arktype/internal/attributes.ts").Default<boolean, true>;
271
+ label?: string | null | undefined;
272
+ bootstrap?: {
273
+ command: string;
274
+ args: import("arktype/internal/attributes.ts").Default<string[], never[]>;
275
+ env: import("arktype/internal/attributes.ts").Default<Record<string, string>, {}>;
276
+ timeoutMs: import("arktype/internal/attributes.ts").Default<number, 120000>;
277
+ runOnce: import("arktype/internal/attributes.ts").Default<boolean, true>;
278
+ } | null | undefined;
279
+ dump?: {
280
+ command: string;
281
+ args: import("arktype/internal/attributes.ts").Default<string[], never[]>;
282
+ env: import("arktype/internal/attributes.ts").Default<Record<string, string>, {}>;
283
+ timeoutMs: import("arktype/internal/attributes.ts").Default<number, 600000>;
284
+ waitMs: import("arktype/internal/attributes.ts").Default<number, 2000>;
285
+ } | null | undefined;
286
+ load?: {
287
+ command: string;
288
+ args: import("arktype/internal/attributes.ts").Default<string[], never[]>;
289
+ env: import("arktype/internal/attributes.ts").Default<Record<string, string>, {}>;
290
+ timeoutMs: import("arktype/internal/attributes.ts").Default<number, 600000>;
291
+ waitMs: import("arktype/internal/attributes.ts").Default<number, 2000>;
292
+ } | null | undefined;
293
+ port?: number | null | undefined;
294
+ }[], never[]>;
295
+ $schema?: string | undefined;
296
+ meta?: {
297
+ writtenBy: import("arktype/internal/attributes.ts").Default<string, "">;
298
+ schema: import("arktype/internal/attributes.ts").Default<number, 1>;
299
+ } | undefined;
300
+ }, {}>;
301
+ export type ResolvedGlobalConfig = typeof globalSettingsSchema.infer;
302
+ export type ResolvedWorkspaceSettings = typeof workspaceSettingsSchema.infer;
303
+ export type ResolvedServersFile = typeof serversFileSchema.infer;
304
+ /** Same shape as the settings output, with each server `port` normalized to `null` when unset. */
305
+ export type ResolvedWorkspaceConfig = ResolvedWorkspaceSettings & {
306
+ servers: ServerConfig[];
307
+ };
308
+ /** Every key `globalSettingsSchema` knows, for reporting blocks a newer release added. */
309
+ export declare const GLOBAL_SETTINGS_KEYS: readonly ["$schema", "meta", "control", "host", "backups", "proxy"];
310
+ export declare const WORKSPACE_SETTINGS_KEYS: readonly ["$schema", "meta", "defaults", "logs", "notifications", "ddns"];
311
+ export declare const SERVERS_FILE_KEYS: readonly ["$schema", "meta", "servers"];
312
+ /**
313
+ * Resolves one entry against the workspace's server defaults. A group (`restart`,
314
+ * `health`, `health.http`, `stop`) merges key by key, so an entry that decides one
315
+ * member does not silently fall back to the *schema* default for the others — which
316
+ * is the whole point of the workspace having defaults at all.
317
+ */
318
+ export declare function mergeDefaults(defaults: Record<string, unknown>, entry: Record<string, unknown>): Record<string, unknown>;
@@ -0,0 +1,48 @@
1
+ export type SecretScope = 'global' | 'workspace';
2
+ export interface SecretPart {
3
+ /** The leaf id: `password`, `apiToken`, `telegram` (bot tokens by destination), `ddns`, or a future top-level key. */
4
+ key: string;
5
+ /** The top-level file keys this part carries. `ddns` carries `['ddns', 'ddnsKdf']`. */
6
+ fields: string[];
7
+ scope: SecretScope;
8
+ }
9
+ /** Every secret this release knows about, set or not — the view lists the slots so a person sees one. */
10
+ export declare const KNOWN_SECRET_KEYS: Record<SecretScope, string[]>;
11
+ /**
12
+ * The parts of one scope, in a stable order: the known parts first in the fixed order
13
+ * password, apiToken (global) / telegram, ddns (workspace) — then any other top-level
14
+ * key present in `present`, sorted, as its own part with `fields: [key]`.
15
+ *
16
+ * An unknown key is taken as belonging to the scope being asked about, because the file
17
+ * it was read from is the only evidence of where it lives: this release does not know the
18
+ * key, so classifying it by name would drop a future *global* secret on the floor.
19
+ */
20
+ export declare function secretParts(scope: SecretScope, present: string[]): SecretPart[];
21
+ /** The top-level keys of a raw secrets document that hold a non-null value. */
22
+ export declare function presentSecretKeys(source: Record<string, unknown>): string[];
23
+ /**
24
+ * A JSON string carrying only `fields`, taken from `source`. Returns null when `source`
25
+ * carries none of them. Always includes a field whose value is `null` ONLY if it is
26
+ * present as a key and non-null; a null/absent field is omitted.
27
+ */
28
+ export declare function pickSecrets(source: Record<string, unknown>, fields: string[]): string | null;
29
+ /**
30
+ * The same removal, applied to a whole secrets **document** rather than one field's value.
31
+ *
32
+ * `pickSecrets` already drops the field, but a backup that selects every secret copies the file
33
+ * whole and so bypassed it. This is that whole-file path: the document keeps every other key —
34
+ * including `null` slots and keys this release does not know — and differs only in that
35
+ * `password.initial` is gone. Returns `null` when the text is not a JSON object, so the caller can
36
+ * fall back to its ordinary copy.
37
+ */
38
+ export declare function withoutInitialPassword(text: string): string | null;
39
+ /** Parses a secrets document, tolerating anything: not-an-object, or broken JSON returns {}. */
40
+ export declare function parseSecrets(text: string): Record<string, unknown>;
41
+ /**
42
+ * Merges `piece` into `current`, changing ONLY the fields in `fields` — every other key
43
+ * of `current` is preserved (this is what stops restoring the Telegram token from wiping
44
+ * the DDNS credentials). A field that is absent from `piece` is also DELETED from the
45
+ * result, so restoring an older archive that predates a secret clears it rather than
46
+ * leaving a stale value. Returns a new object; does not mutate its arguments.
47
+ */
48
+ export declare function mergeSecrets(current: Record<string, unknown>, piece: Record<string, unknown>, fields: string[]): Record<string, unknown>;