home-hosted 0.11.0 → 0.13.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.
- package/README.md +319 -628
- package/dist/chunks/archive-DP-XQR8X.js +352 -0
- package/dist/chunks/archive-DP-XQR8X.js.map +1 -0
- package/dist/chunks/atomic-C1PfJpE7.js +26 -0
- package/dist/chunks/atomic-C1PfJpE7.js.map +1 -0
- package/dist/chunks/backup-CZcVca2a.js +822 -0
- package/dist/chunks/backup-CZcVca2a.js.map +1 -0
- package/dist/chunks/backups-CFRaWe_m.js +4691 -0
- package/dist/chunks/backups-CFRaWe_m.js.map +1 -0
- package/dist/chunks/config-text-DifCHhnz.js +50 -0
- package/dist/chunks/config-text-DifCHhnz.js.map +1 -0
- package/dist/chunks/contracts-CMBD1TF9.js +2230 -0
- package/dist/chunks/contracts-CMBD1TF9.js.map +1 -0
- package/dist/chunks/daemon-log-BVj8cDEo.js +241 -0
- package/dist/chunks/daemon-log-BVj8cDEo.js.map +1 -0
- package/dist/chunks/daemon-qKVECISl.js +247 -0
- package/dist/chunks/daemon-qKVECISl.js.map +1 -0
- package/dist/chunks/docker-Cy9Lyvda.js +437 -0
- package/dist/chunks/docker-Cy9Lyvda.js.map +1 -0
- package/dist/chunks/down-pKbGCW9d.js +383 -0
- package/dist/chunks/down-pKbGCW9d.js.map +1 -0
- package/dist/chunks/init-BZ7hK9Vf.js +276 -0
- package/dist/chunks/init-BZ7hK9Vf.js.map +1 -0
- package/dist/chunks/last-stop-C-BXz_XI.js +53 -0
- package/dist/chunks/last-stop-C-BXz_XI.js.map +1 -0
- package/dist/chunks/layout-DwTtmund.js +24 -0
- package/dist/chunks/layout-DwTtmund.js.map +1 -0
- package/dist/chunks/lazy-Ce5zEAq1.js +66 -0
- package/dist/chunks/lazy-Ce5zEAq1.js.map +1 -0
- package/dist/chunks/log-buffer-Dy9HHDMD.js +414 -0
- package/dist/chunks/log-buffer-Dy9HHDMD.js.map +1 -0
- package/dist/chunks/logger-B5U4GD3j.js +13 -0
- package/dist/chunks/logger-B5U4GD3j.js.map +1 -0
- package/dist/chunks/logs---TI_bxM.js +267 -0
- package/dist/chunks/logs---TI_bxM.js.map +1 -0
- package/dist/chunks/migrate-Cfoq-Vgh.js +155 -0
- package/dist/chunks/migrate-Cfoq-Vgh.js.map +1 -0
- package/dist/chunks/nanny-B-Eu0sFW.js +132 -0
- package/dist/chunks/nanny-B-Eu0sFW.js.map +1 -0
- package/dist/chunks/nanny-BtWfy0QH.js +1167 -0
- package/dist/chunks/nanny-BtWfy0QH.js.map +1 -0
- package/dist/chunks/nanny-ChMtq1Zl.js +39 -0
- package/dist/chunks/nanny-ChMtq1Zl.js.map +1 -0
- package/dist/chunks/nanny-sweep-DErnlPY1.js +105 -0
- package/dist/chunks/nanny-sweep-DErnlPY1.js.map +1 -0
- package/dist/chunks/nearest-6KgQEDUe.js +41 -0
- package/dist/chunks/nearest-6KgQEDUe.js.map +1 -0
- package/dist/chunks/parse-DhmG26fI.js +383 -0
- package/dist/chunks/parse-DhmG26fI.js.map +1 -0
- package/dist/chunks/paths-CGlGDrOU.js +206 -0
- package/dist/chunks/paths-CGlGDrOU.js.map +1 -0
- package/dist/chunks/port-B8WBTRMk.js +333 -0
- package/dist/chunks/port-B8WBTRMk.js.map +1 -0
- package/dist/chunks/restart-Des4DrAN.js +92 -0
- package/dist/chunks/restart-Des4DrAN.js.map +1 -0
- package/dist/chunks/rolldown-runtime-D7D4PA-g.js +13 -0
- package/dist/chunks/schema-B240VXcV.js +103 -0
- package/dist/chunks/schema-B240VXcV.js.map +1 -0
- package/dist/chunks/secrets-BieELnZh.js +562 -0
- package/dist/chunks/secrets-BieELnZh.js.map +1 -0
- package/dist/chunks/server-Bge2r2qQ.js +169 -0
- package/dist/chunks/server-Bge2r2qQ.js.map +1 -0
- package/dist/chunks/server-ids-DRuNLVCV.js +32 -0
- package/dist/chunks/server-ids-DRuNLVCV.js.map +1 -0
- package/dist/chunks/set-password-D5vZqqSX.js +43 -0
- package/dist/chunks/set-password-D5vZqqSX.js.map +1 -0
- package/dist/chunks/set-token-obPiEJYk.js +78 -0
- package/dist/chunks/set-token-obPiEJYk.js.map +1 -0
- package/dist/chunks/settings-xu-XTfWg.js +423 -0
- package/dist/chunks/settings-xu-XTfWg.js.map +1 -0
- package/dist/chunks/setup-temp-CAN4_bA-.js +150 -0
- package/dist/chunks/setup-temp-CAN4_bA-.js.map +1 -0
- package/dist/chunks/shape-DnTKzjQ2.js +24 -0
- package/dist/chunks/shape-DnTKzjQ2.js.map +1 -0
- package/dist/chunks/src-BtWMFmzZ.js +12338 -0
- package/dist/chunks/src-BtWMFmzZ.js.map +1 -0
- package/dist/chunks/status-DT1EsA-B.js +123 -0
- package/dist/chunks/status-DT1EsA-B.js.map +1 -0
- package/dist/chunks/ui-D562aqw5.js +325 -0
- package/dist/chunks/ui-D562aqw5.js.map +1 -0
- package/dist/chunks/ui-dir-CsU3uLNV.js +39 -0
- package/dist/chunks/ui-dir-CsU3uLNV.js.map +1 -0
- package/dist/chunks/ui-release-DKzVvlLd.js +312 -0
- package/dist/chunks/ui-release-DKzVvlLd.js.map +1 -0
- package/dist/chunks/ui-revert-EkBBwRTt.js +27 -0
- package/dist/chunks/ui-revert-EkBBwRTt.js.map +1 -0
- package/dist/chunks/ui-switch-BnZTdMDd.js +150 -0
- package/dist/chunks/ui-switch-BnZTdMDd.js.map +1 -0
- package/dist/chunks/ui-update-_xryLYxw.js +272 -0
- package/dist/chunks/ui-update-_xryLYxw.js.map +1 -0
- package/dist/chunks/up-Pdz-l6IH.js +210 -0
- package/dist/chunks/up-Pdz-l6IH.js.map +1 -0
- package/dist/chunks/usage-DFrCVXpT.js +111 -0
- package/dist/chunks/usage-DFrCVXpT.js.map +1 -0
- package/dist/chunks/workspaces-DYcfvKV_.js +229 -0
- package/dist/chunks/workspaces-DYcfvKV_.js.map +1 -0
- package/dist/chunks/wsl-temperature-BiCI4iK6.js +322 -0
- package/dist/chunks/wsl-temperature-BiCI4iK6.js.map +1 -0
- package/dist/cli.js +441 -25418
- package/dist/cli.js.map +1 -1
- package/dist/client.js +144 -0
- package/dist/client.js.map +1 -0
- package/dist/types/api/acme.d.ts +24 -0
- package/dist/types/api/auth/$.routes.d.ts +103 -0
- package/dist/types/api/backups.d.ts +184 -0
- package/dist/types/api/control.d.ts +470 -0
- package/dist/types/api/ddns.d.ts +432 -0
- package/dist/types/api/events.d.ts +22 -0
- package/dist/types/api/health.d.ts +28 -0
- package/dist/types/api/logs.d.ts +95 -0
- package/dist/types/api/metrics.d.ts +21 -0
- package/dist/types/api/notifications.d.ts +141 -0
- package/dist/types/api/proxy.d.ts +1128 -0
- package/dist/types/api/servers/$.routes.d.ts +1318 -0
- package/dist/types/api/settings.d.ts +642 -0
- package/dist/types/api/state.d.ts +498 -0
- package/dist/types/api/static.d.ts +11 -0
- package/dist/types/api/tls.d.ts +112 -0
- package/dist/types/api/workspaces/$.routes.d.ts +797 -0
- package/dist/types/api/wsl-temperature.d.ts +113 -0
- package/dist/types/app.d.ts +6095 -0
- package/dist/types/cli/args.d.ts +75 -0
- package/dist/types/cli/backup-offline.d.ts +23 -0
- package/dist/types/cli/backup.d.ts +86 -0
- package/dist/types/cli/down.d.ts +80 -0
- package/dist/types/cli/init.d.ts +60 -0
- package/dist/types/cli/io.d.ts +65 -0
- package/dist/types/cli/logs.d.ts +76 -0
- package/dist/types/cli/migrate.d.ts +33 -0
- package/dist/types/cli/nanny.d.ts +19 -0
- package/dist/types/cli/nearest.d.ts +10 -0
- package/dist/types/cli/restart.d.ts +41 -0
- package/dist/types/cli/server.d.ts +68 -0
- package/dist/types/cli/set-password.d.ts +14 -0
- package/dist/types/cli/set-token.d.ts +21 -0
- package/dist/types/cli/setup-temp.d.ts +65 -0
- package/dist/types/cli/status.d.ts +14 -0
- package/dist/types/cli/ui-revert.d.ts +3 -0
- package/dist/types/cli/ui-switch.d.ts +27 -0
- package/dist/types/cli/ui-update.d.ts +72 -0
- package/dist/types/cli/up.d.ts +96 -0
- package/dist/types/cli/usage.d.ts +23 -0
- package/dist/types/cli.d.ts +12 -0
- package/dist/types/client.d.ts +11891 -0
- package/dist/types/config/layout.d.ts +11 -0
- package/dist/types/config/migrations.d.ts +69 -0
- package/dist/types/config/parse.d.ts +54 -0
- package/dist/types/config/patch.d.ts +20 -0
- package/dist/types/config/schema.d.ts +318 -0
- package/dist/types/config/secret-parts.d.ts +48 -0
- package/dist/types/config/secrets.d.ts +208 -0
- package/dist/types/config/seed.d.ts +30 -0
- package/dist/types/config/server-ids.d.ts +14 -0
- package/dist/types/config/settings.d.ts +120 -0
- package/dist/types/config/store.d.ts +145 -0
- package/dist/types/config/workspaces.d.ts +99 -0
- package/dist/types/helpers/action-result.d.ts +46 -0
- package/dist/types/helpers/atomic.d.ts +9 -0
- package/dist/types/helpers/backoff.d.ts +7 -0
- package/dist/types/helpers/bind.d.ts +16 -0
- package/dist/types/helpers/config-text.d.ts +23 -0
- package/dist/types/helpers/cookies.d.ts +19 -0
- package/dist/types/helpers/copy-tree.d.ts +20 -0
- package/dist/types/helpers/daemon-log.d.ts +45 -0
- package/dist/types/helpers/daemon.d.ts +135 -0
- package/dist/types/helpers/deferred.d.ts +7 -0
- package/dist/types/helpers/env-file.d.ts +20 -0
- package/dist/types/helpers/error.d.ts +26 -0
- package/dist/types/helpers/event-stream.d.ts +21 -0
- package/dist/types/helpers/factory.d.ts +6 -0
- package/dist/types/helpers/last-stop.d.ts +20 -0
- package/dist/types/helpers/logger.d.ts +7 -0
- package/dist/types/helpers/open.d.ts +2 -0
- package/dist/types/helpers/openapi.d.ts +34 -0
- package/dist/types/helpers/paths.d.ts +112 -0
- package/dist/types/helpers/restore-lock.d.ts +32 -0
- package/dist/types/helpers/runtime.d.ts +18 -0
- package/dist/types/helpers/secret-compare.d.ts +13 -0
- package/dist/types/helpers/shell.d.ts +19 -0
- package/dist/types/helpers/sse.d.ts +23 -0
- package/dist/types/helpers/template.d.ts +8 -0
- package/dist/types/helpers/ui-dir.d.ts +11 -0
- package/dist/types/helpers/utf8-chunks.d.ts +15 -0
- package/dist/types/helpers/validate.d.ts +7 -0
- package/dist/types/helpers/validator.d.ts +12 -0
- package/dist/types/helpers/version.d.ts +10 -0
- package/dist/types/helpers/workspace.d.ts +25 -0
- package/dist/types/index.d.ts +17 -0
- package/dist/types/middleware/auth.d.ts +53 -0
- package/dist/types/middleware/host.d.ts +29 -0
- package/dist/types/middleware/loopback.d.ts +18 -0
- package/dist/types/openapi-reference.d.ts +22 -0
- package/dist/types/openapi.d.ts +34 -0
- package/dist/types/providers/archive.d.ts +54 -0
- package/dist/types/providers/backup-hook.d.ts +34 -0
- package/dist/types/providers/ddns/cloudflare.d.ts +2 -0
- package/dist/types/providers/ddns/desec.d.ts +2 -0
- package/dist/types/providers/ddns/digitalocean.d.ts +2 -0
- package/dist/types/providers/ddns/duckdns.d.ts +2 -0
- package/dist/types/providers/ddns/dyndns2.d.ts +15 -0
- package/dist/types/providers/ddns/dynu.d.ts +2 -0
- package/dist/types/providers/ddns/freedns.d.ts +2 -0
- package/dist/types/providers/ddns/gandi.d.ts +2 -0
- package/dist/types/providers/ddns/godaddy.d.ts +2 -0
- package/dist/types/providers/ddns/henet.d.ts +3 -0
- package/dist/types/providers/ddns/index.d.ts +12 -0
- package/dist/types/providers/ddns/ip.d.ts +27 -0
- package/dist/types/providers/ddns/namecheap-api.d.ts +13 -0
- package/dist/types/providers/ddns/namecheap.d.ts +6 -0
- package/dist/types/providers/ddns/noip.d.ts +2 -0
- package/dist/types/providers/ddns/porkbun.d.ts +2 -0
- package/dist/types/providers/ddns/spaceship.d.ts +7 -0
- package/dist/types/providers/ddns/types.d.ts +98 -0
- package/dist/types/providers/ddns/zone.d.ts +11 -0
- package/dist/types/providers/docker.d.ts +117 -0
- package/dist/types/providers/entry-state.d.ts +15 -0
- package/dist/types/providers/health-check.d.ts +27 -0
- package/dist/types/providers/host.d.ts +147 -0
- package/dist/types/providers/identity.d.ts +54 -0
- package/dist/types/providers/log-tail.d.ts +56 -0
- package/dist/types/providers/nanny-sweep.d.ts +54 -0
- package/dist/types/providers/nanny.d.ts +104 -0
- package/dist/types/providers/port.d.ts +142 -0
- package/dist/types/providers/proc.d.ts +125 -0
- package/dist/types/providers/process.d.ts +78 -0
- package/dist/types/providers/proxy/caddy.d.ts +2 -0
- package/dist/types/providers/proxy/index.d.ts +7 -0
- package/dist/types/providers/proxy/types.d.ts +54 -0
- package/dist/types/providers/server-vars.d.ts +4 -0
- package/dist/types/providers/telegram.d.ts +74 -0
- package/dist/types/providers/ui-release.d.ts +113 -0
- package/dist/types/providers/webhook.d.ts +64 -0
- package/dist/types/providers/wsl-temperature.d.ts +65 -0
- package/dist/types/services/acme-challenge.d.ts +44 -0
- package/dist/types/services/auth.d.ts +177 -0
- package/dist/types/services/backups.d.ts +476 -0
- package/dist/types/services/config-watch.d.ts +40 -0
- package/dist/types/services/control-server.d.ts +58 -0
- package/dist/types/services/ddns.d.ts +72 -0
- package/dist/types/services/dependencies.d.ts +21 -0
- package/dist/types/services/events.d.ts +17 -0
- package/dist/types/services/exposure.d.ts +86 -0
- package/dist/types/services/history.d.ts +37 -0
- package/dist/types/services/host-monitor.d.ts +33 -0
- package/dist/types/services/init.d.ts +71 -0
- package/dist/types/services/log-buffer.d.ts +39 -0
- package/dist/types/services/log-files.d.ts +77 -0
- package/dist/types/services/log-relay.d.ts +35 -0
- package/dist/types/services/nanny.d.ts +14 -0
- package/dist/types/services/notifications.d.ts +124 -0
- package/dist/types/services/panel.d.ts +213 -0
- package/dist/types/services/proxy-certificates/certificates.d.ts +116 -0
- package/dist/types/services/proxy-config.d.ts +83 -0
- package/dist/types/services/proxy.d.ts +431 -0
- package/dist/types/services/state.d.ts +38 -0
- package/dist/types/services/supervisor/compose.d.ts +17 -0
- package/dist/types/services/supervisor/entry.d.ts +149 -0
- package/dist/types/services/supervisor/health.d.ts +56 -0
- package/dist/types/services/supervisor/output.d.ts +126 -0
- package/dist/types/services/supervisor/pending-load.d.ts +6 -0
- package/dist/types/services/supervisor/persistent.d.ts +58 -0
- package/dist/types/services/supervisor/port-preflight.d.ts +45 -0
- package/dist/types/services/supervisor/records.d.ts +118 -0
- package/dist/types/services/supervisor/spawn.d.ts +15 -0
- package/dist/types/services/supervisor/view.d.ts +4 -0
- package/dist/types/services/supervisor.d.ts +145 -0
- package/dist/types/services/tls.d.ts +48 -0
- package/dist/types/services/ui-update.d.ts +44 -0
- package/dist/types/services/ui.d.ts +50 -0
- package/dist/types/shared/action-outcome.d.ts +25 -0
- package/dist/types/shared/api-client.d.ts +351 -0
- package/dist/types/shared/backup-scope.d.ts +167 -0
- package/dist/types/shared/clone.d.ts +14 -0
- package/dist/types/shared/contracts.d.ts +4175 -0
- package/dist/types/shared/cpu-scale.d.ts +25 -0
- package/dist/types/shared/ddns-form.d.ts +75 -0
- package/dist/types/shared/endpoint.d.ts +8 -0
- package/dist/types/shared/error-message.d.ts +8 -0
- package/dist/types/shared/fields.d.ts +21 -0
- package/dist/types/shared/form-repair.d.ts +6 -0
- package/dist/types/shared/generated.d.ts +26 -0
- package/dist/types/shared/host-readings.d.ts +185 -0
- package/dist/types/shared/lazy.d.ts +4 -0
- package/dist/types/shared/live-frames.d.ts +22 -0
- package/dist/types/shared/live-series.d.ts +21 -0
- package/dist/types/shared/live-store.d.ts +72 -0
- package/dist/types/shared/patch-diff.d.ts +105 -0
- package/dist/types/shared/probe-latency.d.ts +25 -0
- package/dist/types/shared/proxy-form.d.ts +184 -0
- package/dist/types/shared/server-attention.d.ts +37 -0
- package/dist/types/shared/server-form.d.ts +121 -0
- package/dist/types/shared/server-key.d.ts +13 -0
- package/dist/types/shared/server-readings.d.ts +55 -0
- package/dist/types/shared/server-url.d.ts +43 -0
- package/dist/types/shared/shape.d.ts +17 -0
- package/dist/types/shared/stream-access.d.ts +20 -0
- package/dist/types/shared/ui-format.d.ts +89 -0
- package/docs/API.md +209 -0
- package/docs/BACKUPS.md +117 -0
- package/docs/CLI.md +95 -0
- package/docs/DDNS.md +11 -1
- package/docs/NOTIFICATIONS.md +7 -1
- package/docs/REVERSE_PROXY.md +9 -3
- package/docs/SECURITY.md +93 -0
- package/docs/SERVERS.md +141 -34
- package/docs/UI_CREATION.md +91 -291
- package/docs/demo/blank-host-restore.sh +4 -3
- package/package.json +22 -14
- package/uis/stock/dist/assets/CopyButton-BUBKRJyY.js +1 -0
- package/uis/stock/dist/assets/GlobalSettingsView-yYMcRWvt.js +1 -0
- package/uis/stock/dist/assets/LogViewer-DIliXy62.js +1 -0
- package/uis/stock/dist/assets/LogsView-B7Z-7RNg.js +1 -0
- package/uis/stock/dist/assets/Modal-DmKa5Qpp.js +39 -0
- package/uis/stock/dist/assets/ProxyView-DvZiNkwb.js +1 -0
- package/uis/stock/dist/assets/ServerDetailView-6idGT_EX.js +2 -0
- package/uis/stock/dist/assets/SettingsShell-CeGtleYI.js +1 -0
- package/uis/stock/dist/assets/SettingsView-BrhJIrmk.js +2 -0
- package/uis/stock/dist/assets/de-BRITeb0H.js +1 -0
- package/uis/stock/dist/assets/es-B2zIEssV.js +1 -0
- package/uis/stock/dist/assets/fr-s0ZOBEqh.js +1 -0
- package/uis/stock/dist/assets/index-C1MehbKy.css +2 -0
- package/uis/stock/dist/assets/index-CnBN54wF.js +15 -0
- package/uis/stock/dist/assets/ja-CU7MR85V.js +1 -0
- package/uis/stock/dist/assets/ko-tL5Me6d-.js +1 -0
- package/uis/stock/dist/assets/ru-92yrvkNJ.js +1 -0
- package/uis/stock/dist/assets/vi-CzvY16k2.js +1 -0
- package/uis/stock/dist/assets/zh-CN-DDwFW_uW.js +1 -0
- package/uis/stock/dist/index.html +3 -2
- package/uis/stock/dist/ui.json +3 -3
- package/docs/RESTORE_DEMO.md +0 -306
- package/uis/stock/dist/assets/de-0YLueNal.js +0 -1
- package/uis/stock/dist/assets/es-FCHhRmn2.js +0 -1
- package/uis/stock/dist/assets/fr-C69Z8o0z.js +0 -1
- package/uis/stock/dist/assets/index-Cok5msAO.css +0 -2
- package/uis/stock/dist/assets/index-KdyqrVv8.js +0 -53
- package/uis/stock/dist/assets/ja-Chz9YOqR.js +0 -1
- package/uis/stock/dist/assets/ko-CtXZ2x1l.js +0 -1
- package/uis/stock/dist/assets/ru-D_jE64xN.js +0 -1
- package/uis/stock/dist/assets/vi-sxSffss7.js +0 -1
- package/uis/stock/dist/assets/zh-CN-ChTpf29X.js +0 -1
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { ArgsDef } from 'citty';
|
|
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.
|
|
9
|
+
*/
|
|
10
|
+
export interface DirFlags {
|
|
11
|
+
project?: string;
|
|
12
|
+
home?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface DirFlagResult extends DirFlags {
|
|
15
|
+
rest: string[];
|
|
16
|
+
error?: string;
|
|
17
|
+
}
|
|
18
|
+
/** `--home`/`--project` are handled for every command, so they are peeled off first. */
|
|
19
|
+
export declare function extractDirFlags(argv: string[]): DirFlagResult;
|
|
20
|
+
/** Set before any state module is imported, so it decides where state lives. */
|
|
21
|
+
export declare function applyDirFlags(flags: DirFlags): void;
|
|
22
|
+
export type Invocation = {
|
|
23
|
+
kind: 'help';
|
|
24
|
+
command?: string;
|
|
25
|
+
} | {
|
|
26
|
+
kind: 'version';
|
|
27
|
+
} | {
|
|
28
|
+
kind: 'command';
|
|
29
|
+
argv: string[];
|
|
30
|
+
} | {
|
|
31
|
+
kind: 'unknown';
|
|
32
|
+
command: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
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.
|
|
44
|
+
*/
|
|
45
|
+
export declare function resolveInvocation(argv: string[], commands: readonly string[]): Invocation;
|
|
46
|
+
/**
|
|
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.
|
|
60
|
+
*/
|
|
61
|
+
export declare function rejectUnknownFlags(argv: string[], argsDef: ArgsDef | undefined): string | null;
|
|
62
|
+
export interface UpFlags {
|
|
63
|
+
port?: number;
|
|
64
|
+
host?: string;
|
|
65
|
+
autostart: boolean;
|
|
66
|
+
open: boolean;
|
|
67
|
+
foreground: boolean;
|
|
68
|
+
printConfig: boolean;
|
|
69
|
+
}
|
|
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
|
+
*/
|
|
75
|
+
export declare function buildDaemonArgv(flags: UpFlags): string[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { BackupService } from '../services/backups.js';
|
|
2
|
+
export interface OfflineBackup {
|
|
3
|
+
service: BackupService;
|
|
4
|
+
/** The workspaces this host declares, for a refusal that lists real ids. */
|
|
5
|
+
workspaceIds: string[];
|
|
6
|
+
/** Entries whose process is alive right now, read from the state files they rewrite. */
|
|
7
|
+
runningNow: () => Array<{
|
|
8
|
+
workspaceId: string;
|
|
9
|
+
serverId: string;
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
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.
|
|
19
|
+
*/
|
|
20
|
+
export declare function createOfflineBackup(options?: {
|
|
21
|
+
hhDir?: string;
|
|
22
|
+
settingsPath?: string;
|
|
23
|
+
}): OfflineBackup;
|
|
@@ -0,0 +1,86 @@
|
|
|
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
|
+
*/
|
|
9
|
+
type Scope = {
|
|
10
|
+
kind: 'all';
|
|
11
|
+
} | {
|
|
12
|
+
kind: 'include';
|
|
13
|
+
ids: string[];
|
|
14
|
+
};
|
|
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
|
+
export declare function runBackupList(json: boolean): Promise<void>;
|
|
23
|
+
export declare function runBackupCreate(options: {
|
|
24
|
+
password?: string;
|
|
25
|
+
scope: Scope;
|
|
26
|
+
exclude?: string[];
|
|
27
|
+
confirm: boolean;
|
|
28
|
+
json: boolean;
|
|
29
|
+
}): Promise<void>;
|
|
30
|
+
export declare function runBackupRestore(options: {
|
|
31
|
+
name?: string;
|
|
32
|
+
from?: string;
|
|
33
|
+
password?: string;
|
|
34
|
+
scope: Scope;
|
|
35
|
+
exclude?: string[];
|
|
36
|
+
confirm: boolean;
|
|
37
|
+
json: boolean;
|
|
38
|
+
}): Promise<void>;
|
|
39
|
+
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
|
+
*/
|
|
45
|
+
export declare function unhonouredBackupFlag(action: BackupAction, given: Partial<Record<BackupFlag, unknown>>): string | null;
|
|
46
|
+
export declare const backupCommand: import("citty").CommandDef<{
|
|
47
|
+
readonly action: {
|
|
48
|
+
readonly type: "positional";
|
|
49
|
+
readonly description: "list (default) | create | restore";
|
|
50
|
+
readonly required: false;
|
|
51
|
+
};
|
|
52
|
+
readonly target: {
|
|
53
|
+
readonly type: "positional";
|
|
54
|
+
readonly description: "the archive name, for restore";
|
|
55
|
+
readonly required: false;
|
|
56
|
+
};
|
|
57
|
+
readonly from: {
|
|
58
|
+
readonly type: "string";
|
|
59
|
+
readonly description: "restore from this archive file anywhere on the machine, instead of a name in the backups directory";
|
|
60
|
+
};
|
|
61
|
+
readonly password: {
|
|
62
|
+
readonly type: "string";
|
|
63
|
+
readonly description: "encrypt the archive, or unlock it on restore";
|
|
64
|
+
};
|
|
65
|
+
readonly include: {
|
|
66
|
+
readonly type: "string";
|
|
67
|
+
readonly description: "comma-separated item ids to act on";
|
|
68
|
+
};
|
|
69
|
+
readonly exclude: {
|
|
70
|
+
readonly type: "string";
|
|
71
|
+
readonly description: "comma-separated item ids to leave out, applied after --include";
|
|
72
|
+
};
|
|
73
|
+
readonly all: {
|
|
74
|
+
readonly type: "boolean";
|
|
75
|
+
readonly description: "act on everything, rather than naming ids";
|
|
76
|
+
};
|
|
77
|
+
readonly confirm: {
|
|
78
|
+
readonly type: "boolean";
|
|
79
|
+
readonly description: "apply without asking (a restore writes over live data)";
|
|
80
|
+
};
|
|
81
|
+
readonly json: {
|
|
82
|
+
readonly type: "boolean";
|
|
83
|
+
readonly description: "print the plan or the result as JSON";
|
|
84
|
+
};
|
|
85
|
+
}>;
|
|
86
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { PersistentHandle } from '../providers/nanny-sweep.js';
|
|
2
|
+
import type { ServerConfig } from '../shared/contracts.js';
|
|
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.
|
|
10
|
+
*/
|
|
11
|
+
export interface DownOptions {
|
|
12
|
+
/** Also stop every persistent entry, in every workspace. */
|
|
13
|
+
withPersistent?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** Which persistent entries this stop ended, as `(workspace, id)` — what `restart` starts back. */
|
|
16
|
+
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
|
+
*/
|
|
21
|
+
ok: boolean;
|
|
22
|
+
stoppedPersistent: Array<{
|
|
23
|
+
workspaceId: string;
|
|
24
|
+
serverId: string;
|
|
25
|
+
}>;
|
|
26
|
+
}
|
|
27
|
+
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
|
+
*/
|
|
34
|
+
export declare function livePersistents(): Promise<PersistentHandle[]>;
|
|
35
|
+
/** `workspace/id`, because a server id is only unique inside its workspace. */
|
|
36
|
+
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
|
+
*/
|
|
42
|
+
export declare function exitCodeForStops(results: ReadonlyArray<Readonly<{
|
|
43
|
+
stopped: boolean;
|
|
44
|
+
}>>): 0 | 1;
|
|
45
|
+
/**
|
|
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.
|
|
54
|
+
*/
|
|
55
|
+
export declare function serversReader(): Promise<(workspaceId: string) => {
|
|
56
|
+
servers: ServerConfig[];
|
|
57
|
+
complete: boolean;
|
|
58
|
+
}>;
|
|
59
|
+
/**
|
|
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.
|
|
68
|
+
*/
|
|
69
|
+
export declare function shutdownBudgetMs(servers: ReadonlyArray<Pick<ServerConfig, 'command' | 'args' | 'persistent' | 'stop'>>, withPersistent: boolean): number;
|
|
70
|
+
/**
|
|
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.
|
|
73
|
+
*/
|
|
74
|
+
export declare function forceStopCommand(pid: number, platform?: NodeJS.Platform): [string, string[]] | null;
|
|
75
|
+
export declare const downCommand: import("citty").CommandDef<{
|
|
76
|
+
readonly withPersistent: {
|
|
77
|
+
readonly type: "boolean";
|
|
78
|
+
readonly description: "also stop every persistent entry, in every workspace";
|
|
79
|
+
};
|
|
80
|
+
}>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `init` scaffolds a project that keeps its whole setup — state, data and the
|
|
3
|
+
* server definitions — inside its own directory. Interactive by nature, but
|
|
4
|
+
* `--yes` takes every default so an agent or a CI job can run it unattended.
|
|
5
|
+
*/
|
|
6
|
+
export declare const initArgs: {
|
|
7
|
+
readonly dir: {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly description: "where to scaffold (default: ./my-servers)";
|
|
10
|
+
};
|
|
11
|
+
readonly name: {
|
|
12
|
+
readonly type: "string";
|
|
13
|
+
readonly description: "package name (default: the directory name)";
|
|
14
|
+
};
|
|
15
|
+
readonly pm: {
|
|
16
|
+
readonly type: "string";
|
|
17
|
+
readonly description: "pnpm | npm | yarn | bun (default: the first one installed)";
|
|
18
|
+
};
|
|
19
|
+
readonly install: {
|
|
20
|
+
readonly type: "boolean";
|
|
21
|
+
readonly default: true;
|
|
22
|
+
readonly negativeDescription: "write the files, install nothing";
|
|
23
|
+
};
|
|
24
|
+
readonly yes: {
|
|
25
|
+
readonly type: "boolean";
|
|
26
|
+
readonly alias: "y";
|
|
27
|
+
readonly description: "take every default, ask nothing";
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export declare function runInit(options: {
|
|
31
|
+
dir?: string;
|
|
32
|
+
name?: string;
|
|
33
|
+
pm?: string;
|
|
34
|
+
noInstall: boolean;
|
|
35
|
+
yes: boolean;
|
|
36
|
+
}): Promise<void>;
|
|
37
|
+
export declare const initCommand: import("citty").CommandDef<{
|
|
38
|
+
readonly dir: {
|
|
39
|
+
readonly type: "string";
|
|
40
|
+
readonly description: "where to scaffold (default: ./my-servers)";
|
|
41
|
+
};
|
|
42
|
+
readonly name: {
|
|
43
|
+
readonly type: "string";
|
|
44
|
+
readonly description: "package name (default: the directory name)";
|
|
45
|
+
};
|
|
46
|
+
readonly pm: {
|
|
47
|
+
readonly type: "string";
|
|
48
|
+
readonly description: "pnpm | npm | yarn | bun (default: the first one installed)";
|
|
49
|
+
};
|
|
50
|
+
readonly install: {
|
|
51
|
+
readonly type: "boolean";
|
|
52
|
+
readonly default: true;
|
|
53
|
+
readonly negativeDescription: "write the files, install nothing";
|
|
54
|
+
};
|
|
55
|
+
readonly yes: {
|
|
56
|
+
readonly type: "boolean";
|
|
57
|
+
readonly alias: "y";
|
|
58
|
+
readonly description: "take every default, ask nothing";
|
|
59
|
+
};
|
|
60
|
+
}>;
|
|
@@ -0,0 +1,65 @@
|
|
|
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.
|
|
8
|
+
*/
|
|
9
|
+
export declare const isTty: () => boolean;
|
|
10
|
+
export declare const paint: (code: string, text: string) => string;
|
|
11
|
+
export declare const dim: (text: string) => string;
|
|
12
|
+
export declare const bold: (text: string) => string;
|
|
13
|
+
export declare const cyan: (text: string) => string;
|
|
14
|
+
export declare const green: (text: string) => string;
|
|
15
|
+
/** A section title in the help output. */
|
|
16
|
+
export declare const heading: (text: string) => string;
|
|
17
|
+
/** The seam `ui-switch` takes, so the command stays testable without a terminal. */
|
|
18
|
+
export declare const style: {
|
|
19
|
+
bold: (text: string) => string;
|
|
20
|
+
dim: (text: string) => string;
|
|
21
|
+
green: (text: string) => string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
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.
|
|
40
|
+
*/
|
|
41
|
+
export declare function invocation(): string;
|
|
42
|
+
export declare function isClosedReaderError(error: unknown): boolean;
|
|
43
|
+
export declare function treatClosedReaderAsDone(): void;
|
|
44
|
+
/** One shape for every failure: a red `error <message>` on stderr and exit 1. */
|
|
45
|
+
export declare function fail(message: string): never;
|
|
46
|
+
/**
|
|
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.
|
|
55
|
+
*/
|
|
56
|
+
export declare function refusal(message: string): void;
|
|
57
|
+
export declare function delay(ms: number): Promise<void>;
|
|
58
|
+
/** A plain y/N question, for decisions that are not secrets. */
|
|
59
|
+
export declare function prompt(question: string): Promise<string>;
|
|
60
|
+
/** Reads a line with echo suppressed, so the password never lands in scrollback. */
|
|
61
|
+
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
|
+
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. */
|
|
65
|
+
export declare function firstRunPassword(): Promise<string | null>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/** `logs` answers "what has the panel been saying" — the file `up` redirects it into. */
|
|
2
|
+
export declare const logsArgs: {
|
|
3
|
+
readonly id: {
|
|
4
|
+
readonly type: "positional";
|
|
5
|
+
readonly required: false;
|
|
6
|
+
readonly description: "show one server's own log instead of the panel console";
|
|
7
|
+
};
|
|
8
|
+
readonly lines: {
|
|
9
|
+
readonly type: "string";
|
|
10
|
+
readonly description: "how many lines to show: a count of at least 1 (default 50), or `all`";
|
|
11
|
+
};
|
|
12
|
+
readonly follow: {
|
|
13
|
+
readonly type: "boolean";
|
|
14
|
+
readonly description: "keep printing as the panel writes (like tail -f)";
|
|
15
|
+
};
|
|
16
|
+
readonly json: {
|
|
17
|
+
readonly type: "boolean";
|
|
18
|
+
readonly description: "print machine-readable JSON";
|
|
19
|
+
};
|
|
20
|
+
readonly workspace: {
|
|
21
|
+
readonly type: "string";
|
|
22
|
+
readonly alias: "w";
|
|
23
|
+
readonly description: "the workspace the server is in (default: the panel's default workspace)";
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* `--lines`: a whole decimal count of at least 1, or `all` — `0` inside means "the whole log", the
|
|
28
|
+
* sentinel `readLog`/`followLog` take. Anything else is refused with the reason, never read as a
|
|
29
|
+
* default: `--lines abc` and `--lines 0x10` silently printed 50 lines, and `--lines 0` (or a negative)
|
|
30
|
+
* printed the whole log, so a typo or a bounded request answered something nobody asked for and the
|
|
31
|
+
* output looked complete.
|
|
32
|
+
*/
|
|
33
|
+
export declare function parseLines(raw: string | undefined): {
|
|
34
|
+
lines: number;
|
|
35
|
+
} | {
|
|
36
|
+
error: string;
|
|
37
|
+
};
|
|
38
|
+
export interface LogTarget {
|
|
39
|
+
/** The file the lines come from, for the header and for `--json`'s `path`. */
|
|
40
|
+
file: string;
|
|
41
|
+
/** The workspace the file is in, when the target is one server's log. */
|
|
42
|
+
workspaceId?: string;
|
|
43
|
+
/** The id asked for, when the target is one server's log. */
|
|
44
|
+
serverId?: string;
|
|
45
|
+
}
|
|
46
|
+
export declare function runLogs(input: {
|
|
47
|
+
id?: string;
|
|
48
|
+
lines?: string;
|
|
49
|
+
follow?: boolean;
|
|
50
|
+
json?: boolean;
|
|
51
|
+
workspace?: string;
|
|
52
|
+
}): Promise<void>;
|
|
53
|
+
export declare const logsCommand: import("citty").CommandDef<{
|
|
54
|
+
readonly id: {
|
|
55
|
+
readonly type: "positional";
|
|
56
|
+
readonly required: false;
|
|
57
|
+
readonly description: "show one server's own log instead of the panel console";
|
|
58
|
+
};
|
|
59
|
+
readonly lines: {
|
|
60
|
+
readonly type: "string";
|
|
61
|
+
readonly description: "how many lines to show: a count of at least 1 (default 50), or `all`";
|
|
62
|
+
};
|
|
63
|
+
readonly follow: {
|
|
64
|
+
readonly type: "boolean";
|
|
65
|
+
readonly description: "keep printing as the panel writes (like tail -f)";
|
|
66
|
+
};
|
|
67
|
+
readonly json: {
|
|
68
|
+
readonly type: "boolean";
|
|
69
|
+
readonly description: "print machine-readable JSON";
|
|
70
|
+
};
|
|
71
|
+
readonly workspace: {
|
|
72
|
+
readonly type: "string";
|
|
73
|
+
readonly alias: "w";
|
|
74
|
+
readonly description: "the workspace the server is in (default: the panel's default workspace)";
|
|
75
|
+
};
|
|
76
|
+
}>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `migrate` lifts a state directory to the config schema this release understands:
|
|
3
|
+
* it stamps the global settings, each workspace's settings and each workspace's
|
|
4
|
+
* servers config, and applies any pending schema migration to them.
|
|
5
|
+
*
|
|
6
|
+
* Deliberately loud: it prints every step first, backs a file up before writing
|
|
7
|
+
* it, refuses to write one it cannot read, and never runs on its own — a detached
|
|
8
|
+
* daemon cannot prompt, so consent comes from `--yes`, from
|
|
9
|
+
* `HHOSTED_MIGRATE=allow`, or from a person at a terminal.
|
|
10
|
+
*/
|
|
11
|
+
export declare const migrateArgs: {
|
|
12
|
+
readonly dryRun: {
|
|
13
|
+
readonly type: "boolean";
|
|
14
|
+
readonly description: "print what would change, write nothing";
|
|
15
|
+
};
|
|
16
|
+
readonly yes: {
|
|
17
|
+
readonly type: "boolean";
|
|
18
|
+
readonly alias: "y";
|
|
19
|
+
readonly description: "apply without asking (or set HHOSTED_MIGRATE=allow)";
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export declare function runMigrate(dryRun: boolean, yes: boolean): Promise<void>;
|
|
23
|
+
export declare const migrateCommand: import("citty").CommandDef<{
|
|
24
|
+
readonly dryRun: {
|
|
25
|
+
readonly type: "boolean";
|
|
26
|
+
readonly description: "print what would change, write nothing";
|
|
27
|
+
};
|
|
28
|
+
readonly yes: {
|
|
29
|
+
readonly type: "boolean";
|
|
30
|
+
readonly alias: "y";
|
|
31
|
+
readonly description: "apply without asking (or set HHOSTED_MIGRATE=allow)";
|
|
32
|
+
};
|
|
33
|
+
}>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The hidden command that runs one persistent entry. The panel spawns it from the
|
|
3
|
+
* argv in `helpers/runtime.ts`; nothing a person types reaches it, so it stays out of
|
|
4
|
+
* the curated help and keeps citty's own for `--help`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const nannyCommand: import("citty").CommandDef<{
|
|
7
|
+
readonly id: {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly required: true;
|
|
10
|
+
};
|
|
11
|
+
readonly spec: {
|
|
12
|
+
readonly type: "string";
|
|
13
|
+
readonly required: true;
|
|
14
|
+
};
|
|
15
|
+
readonly state: {
|
|
16
|
+
readonly type: "string";
|
|
17
|
+
readonly required: true;
|
|
18
|
+
};
|
|
19
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The nearest word to a typo, or null when nothing is close.
|
|
3
|
+
*
|
|
4
|
+
* Two callers need it — a mistyped command and a mistyped option — so it takes its candidate list as
|
|
5
|
+
* a parameter rather than reaching for one. One implementation, so both suggest by the same rule.
|
|
6
|
+
*
|
|
7
|
+
* Levenshtein distance, capped: only a genuinely near miss is worth naming, because suggesting an
|
|
8
|
+
* unrelated word is worse than suggesting none.
|
|
9
|
+
*/
|
|
10
|
+
export declare function nearestWord(input: string, candidates: readonly string[]): string | null;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export declare function restartCommand(entry: string): import("citty").CommandDef<{
|
|
2
|
+
readonly withPersistent: {
|
|
3
|
+
readonly type: "boolean";
|
|
4
|
+
readonly description: "stop the persistent entries too, instead of leaving them running";
|
|
5
|
+
};
|
|
6
|
+
readonly id: {
|
|
7
|
+
readonly type: "positional";
|
|
8
|
+
readonly required: false;
|
|
9
|
+
readonly description: "restart just this server instead of the panel";
|
|
10
|
+
};
|
|
11
|
+
readonly workspace: {
|
|
12
|
+
readonly type: "string";
|
|
13
|
+
readonly alias: "w";
|
|
14
|
+
readonly description: "the workspace to act in (default: the panel's default workspace)";
|
|
15
|
+
};
|
|
16
|
+
readonly port: {
|
|
17
|
+
readonly type: "string";
|
|
18
|
+
readonly alias: "p";
|
|
19
|
+
readonly description: "control panel port (default: 3999)";
|
|
20
|
+
};
|
|
21
|
+
readonly host: {
|
|
22
|
+
readonly type: "string";
|
|
23
|
+
readonly description: "local | lan | an ipv4 address (default: local)";
|
|
24
|
+
};
|
|
25
|
+
readonly autostart: {
|
|
26
|
+
readonly type: "boolean";
|
|
27
|
+
readonly negativeDescription: "do not start the entries marked autostart";
|
|
28
|
+
};
|
|
29
|
+
readonly open: {
|
|
30
|
+
readonly type: "boolean";
|
|
31
|
+
readonly description: "open the panel in a browser once it is up";
|
|
32
|
+
};
|
|
33
|
+
readonly foreground: {
|
|
34
|
+
readonly type: "boolean";
|
|
35
|
+
readonly description: "run in this process instead of detaching (systemd/docker)";
|
|
36
|
+
};
|
|
37
|
+
readonly printConfig: {
|
|
38
|
+
readonly type: "boolean";
|
|
39
|
+
readonly description: "print the effective config and exit";
|
|
40
|
+
};
|
|
41
|
+
}>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `start`/`stop`/`restart` for one supervised server.
|
|
3
|
+
*
|
|
4
|
+
* The supervisor lives inside the daemon, so a single server cannot be started or
|
|
5
|
+
* stopped without it: these drive the running panel over its local control channel
|
|
6
|
+
* (the same token `down` uses), which needs no session and no API token.
|
|
7
|
+
*
|
|
8
|
+
* `restart` shares the name with the panel's own restart, which is why the id is optional:
|
|
9
|
+
* bare `restart` stays "down, then up", and `restart <id>` is one entry — the same thing the
|
|
10
|
+
* UI's per-server Restart button does, which the shell could not.
|
|
11
|
+
*/
|
|
12
|
+
export type ServerAction = 'start' | 'stop' | 'restart';
|
|
13
|
+
export declare function runServerAction(action: ServerAction, id: string, workspace?: string): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* `free-port` — ask whatever holds this entry's port to stop, then say what actually happened.
|
|
16
|
+
*
|
|
17
|
+
* The panel refuses what it supervises rather than signalling it, so a success is not simply
|
|
18
|
+
* "ok": the report distinguishes the pids that left, the ones that ignored SIGTERM and had to be
|
|
19
|
+
* killed, and any this panel owns that were deliberately left alone.
|
|
20
|
+
*/
|
|
21
|
+
export declare function runFreePort(id: string, workspace?: string, options?: {
|
|
22
|
+
tolerateFree?: boolean;
|
|
23
|
+
}): Promise<void>;
|
|
24
|
+
/** `free-port <id>` — the panel's Free port button, from a shell. */
|
|
25
|
+
export declare const freePortCommand: import("citty").CommandDef<{
|
|
26
|
+
readonly id: {
|
|
27
|
+
readonly type: "positional";
|
|
28
|
+
readonly required: false;
|
|
29
|
+
readonly description: "the server whose port should be freed";
|
|
30
|
+
};
|
|
31
|
+
readonly workspace: {
|
|
32
|
+
readonly type: "string";
|
|
33
|
+
readonly alias: "w";
|
|
34
|
+
readonly description: "the workspace to act in (default: the panel's default workspace)";
|
|
35
|
+
};
|
|
36
|
+
}>;
|
|
37
|
+
export declare const startCommand: import("citty").CommandDef<{
|
|
38
|
+
readonly 'free-port'?: {
|
|
39
|
+
readonly type: "boolean";
|
|
40
|
+
readonly description: "free the port first, then start (what the panel's Free port button does)";
|
|
41
|
+
} | undefined;
|
|
42
|
+
readonly id: {
|
|
43
|
+
readonly type: "positional";
|
|
44
|
+
readonly required: false;
|
|
45
|
+
readonly description: "the server id from the workspace's servers.config.json";
|
|
46
|
+
};
|
|
47
|
+
readonly workspace: {
|
|
48
|
+
readonly type: "string";
|
|
49
|
+
readonly alias: "w";
|
|
50
|
+
readonly description: "the workspace to act in (default: the panel's default workspace)";
|
|
51
|
+
};
|
|
52
|
+
}>;
|
|
53
|
+
export declare const stopCommand: import("citty").CommandDef<{
|
|
54
|
+
readonly 'free-port'?: {
|
|
55
|
+
readonly type: "boolean";
|
|
56
|
+
readonly description: "free the port first, then start (what the panel's Free port button does)";
|
|
57
|
+
} | undefined;
|
|
58
|
+
readonly id: {
|
|
59
|
+
readonly type: "positional";
|
|
60
|
+
readonly required: false;
|
|
61
|
+
readonly description: "the server id from the workspace's servers.config.json";
|
|
62
|
+
};
|
|
63
|
+
readonly workspace: {
|
|
64
|
+
readonly type: "string";
|
|
65
|
+
readonly alias: "w";
|
|
66
|
+
readonly description: "the workspace to act in (default: the panel's default workspace)";
|
|
67
|
+
};
|
|
68
|
+
}>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** `set-password` sets the panel password without the API. */
|
|
2
|
+
export declare const setPasswordArgs: {
|
|
3
|
+
readonly clear: {
|
|
4
|
+
readonly type: "boolean";
|
|
5
|
+
readonly description: "remove the password: nobody can sign in until a new one is set";
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export declare function runSetPassword(clear: boolean): Promise<void>;
|
|
9
|
+
export declare const setPasswordCommand: import("citty").CommandDef<{
|
|
10
|
+
readonly clear: {
|
|
11
|
+
readonly type: "boolean";
|
|
12
|
+
readonly description: "remove the password: nobody can sign in until a new one is set";
|
|
13
|
+
};
|
|
14
|
+
}>;
|