@stacksjs/ts-cloud 0.12.9 → 0.12.11

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 (200) hide show
  1. package/dist/aws/index.js +1 -1
  2. package/dist/aws/sms-voice.d.ts +35 -0
  3. package/dist/bin/{chunk-tfbs8k8v.js → chunk-0x8szp53.js} +1 -1
  4. package/dist/bin/chunk-1hggd7yz.js +1 -0
  5. package/dist/bin/{chunk-rtecnmts.js → chunk-2pevjm25.js} +2 -2
  6. package/dist/bin/{chunk-0zwknfwp.js → chunk-2tsg6e8j.js} +1 -1
  7. package/dist/{chunk-c8cadhgc.js → bin/chunk-3f27aa5r.js} +2 -2
  8. package/dist/bin/{chunk-dz1ec589.js → chunk-3g80gjw6.js} +2 -2
  9. package/dist/bin/chunk-40j9hgzc.js +1 -0
  10. package/dist/bin/{chunk-82mj52xr.js → chunk-48eb4z0c.js} +1 -1
  11. package/dist/bin/chunk-4gqfdr7t.js +1 -0
  12. package/dist/{chunk-pb47hr0h.js → bin/chunk-5gx38418.js} +1 -1
  13. package/dist/bin/chunk-5jv4cpky.js +1 -0
  14. package/dist/bin/chunk-5kxm5mx7.js +1 -0
  15. package/dist/bin/{chunk-my3ewh3a.js → chunk-5rhvcgzt.js} +2 -2
  16. package/dist/bin/{chunk-mcr0r4at.js → chunk-8223r1xn.js} +2 -2
  17. package/dist/bin/{chunk-4q6tad44.js → chunk-84703zpq.js} +91 -91
  18. package/dist/bin/{chunk-3aph4c1w.js → chunk-9edyzdm0.js} +1 -1
  19. package/dist/bin/{chunk-xhwqpgwq.js → chunk-9xbsmz1f.js} +1 -1
  20. package/dist/bin/{chunk-mfrf9q4b.js → chunk-a8t3c4qe.js} +1 -1
  21. package/dist/bin/chunk-aghy01we.js +1 -0
  22. package/dist/{chunk-w2ddj42w.js → bin/chunk-akwfvn5k.js} +1 -1
  23. package/dist/bin/chunk-asvz121j.js +1 -0
  24. package/dist/bin/{chunk-6tfwm33r.js → chunk-b0xtsv8k.js} +3 -3
  25. package/dist/bin/chunk-bcpdj01b.js +1 -0
  26. package/dist/bin/{chunk-btsyjhk7.js → chunk-bj4ft4qc.js} +2 -2
  27. package/dist/bin/chunk-da49my09.js +1 -0
  28. package/dist/bin/{chunk-hq9x489e.js → chunk-dep2n31v.js} +1 -1
  29. package/dist/bin/{chunk-b4wt9jcg.js → chunk-ewxf62t8.js} +2 -2
  30. package/dist/bin/{chunk-e2bybahr.js → chunk-f42gqn6c.js} +1 -1
  31. package/dist/bin/{chunk-s4yzes15.js → chunk-fc6r1ack.js} +1 -1
  32. package/dist/bin/{chunk-vj2dp0nh.js → chunk-ftcjjf76.js} +6 -6
  33. package/dist/bin/chunk-g76sry03.js +1 -0
  34. package/dist/bin/{chunk-e5ab5twy.js → chunk-hv3w2qy1.js} +2 -2
  35. package/dist/bin/{chunk-9a88fp00.js → chunk-hwdfky19.js} +2 -2
  36. package/dist/bin/chunk-j02d6qmn.js +1 -0
  37. package/dist/bin/{chunk-8ewncfce.js → chunk-j2cb8we4.js} +1 -1
  38. package/dist/bin/chunk-kmz8vb77.js +1 -0
  39. package/dist/bin/{chunk-0thy7q96.js → chunk-kyr5rasx.js} +74 -75
  40. package/dist/bin/{chunk-ja1vjdn1.js → chunk-mhrtx0p1.js} +1 -1
  41. package/dist/bin/{chunk-w32xv8n4.js → chunk-nc9pp87y.js} +2 -2
  42. package/dist/bin/{chunk-xk08030d.js → chunk-ncrnbcsa.js} +2 -2
  43. package/dist/bin/chunk-py1hyeb2.js +1 -0
  44. package/dist/bin/{chunk-q5cmfpzt.js → chunk-qa06sft7.js} +1 -1
  45. package/dist/bin/{chunk-azymqbcy.js → chunk-qr0xck72.js} +1 -1
  46. package/dist/bin/chunk-r85ahkwq.js +1 -0
  47. package/dist/bin/{chunk-ehc63fvs.js → chunk-re15e6p4.js} +1 -1
  48. package/dist/bin/chunk-t6y3pkm8.js +1 -0
  49. package/dist/bin/{chunk-c0bdafbx.js → chunk-tfmx17he.js} +1 -1
  50. package/dist/bin/chunk-vfcchrby.js +1 -0
  51. package/dist/bin/chunk-vmdh41kp.js +1 -0
  52. package/dist/bin/{chunk-cd0ps58j.js → chunk-vrc7eemq.js} +1 -1
  53. package/dist/bin/{chunk-d7ke90zt.js → chunk-vsd7670h.js} +1 -1
  54. package/dist/bin/{chunk-kg61p5hw.js → chunk-vwqn3yx6.js} +2 -2
  55. package/dist/bin/{chunk-71t1gmsq.js → chunk-vxbnjz78.js} +1 -1
  56. package/dist/bin/chunk-w8s8vgdj.js +1 -0
  57. package/dist/bin/chunk-yq9vetf8.js +698 -0
  58. package/dist/bin/{chunk-zpe64t4r.js → chunk-zrgd65r8.js} +1 -1
  59. package/dist/bin/cli.js +143 -143
  60. package/dist/bin/dashboard-server.js +1 -1
  61. package/dist/{chunk-fgfm7cfm.js → chunk-0a4tqwm9.js} +89 -90
  62. package/dist/{chunk-982rye5b.js → chunk-2ybcnrte.js} +1 -1
  63. package/dist/chunk-4884der5.js +1 -0
  64. package/dist/{bin/chunk-9kf0np8j.js → chunk-4wdxsnn2.js} +1 -1
  65. package/dist/{bin/chunk-xkfrqqcs.js → chunk-5hhyyhjt.js} +1 -1
  66. package/dist/chunk-5zkacdw1.js +1 -0
  67. package/dist/{chunk-557qj7q9.js → chunk-6cxb8d6y.js} +2 -2
  68. package/dist/chunk-6f68caq0.js +1 -0
  69. package/dist/{chunk-2qm3rw8b.js → chunk-7z50g5xz.js} +2 -2
  70. package/dist/chunk-8fh4m5ge.js +1 -0
  71. package/dist/chunk-97pb7wb1.js +1 -0
  72. package/dist/{chunk-a368cs92.js → chunk-ac87ds1k.js} +1 -1
  73. package/dist/{chunk-qrte4gy2.js → chunk-dndxwssj.js} +1 -1
  74. package/dist/{bin/chunk-a7w13qfm.js → chunk-ess6vxfj.js} +2 -2
  75. package/dist/chunk-fvpkxznh.js +558 -0
  76. package/dist/{chunk-rg7d67xk.js → chunk-j06r5rwv.js} +1 -1
  77. package/dist/{chunk-70v77sqv.js → chunk-j1g67djb.js} +2 -2
  78. package/dist/{chunk-fbwpm0zm.js → chunk-k8x8mrkr.js} +1 -1
  79. package/dist/{chunk-82gezmen.js → chunk-mnmz8t7q.js} +1 -1
  80. package/dist/{chunk-7j100g7w.js → chunk-n1fyryha.js} +1 -1
  81. package/dist/{chunk-c1hr34a5.js → chunk-n1hg0jxs.js} +2 -2
  82. package/dist/{chunk-bcffjsnj.js → chunk-n5xmh0ma.js} +1 -1
  83. package/dist/chunk-q22qfwsc.js +22 -0
  84. package/dist/{chunk-5hkq5081.js → chunk-q9a1z53k.js} +2 -2
  85. package/dist/{chunk-fsssdd5k.js → chunk-r8t25tbm.js} +91 -91
  86. package/dist/{chunk-2k0mt6j5.js → chunk-whyttetx.js} +1 -1
  87. package/dist/{chunk-a5213256.js → chunk-yf8stygs.js} +6 -6
  88. package/dist/{chunk-jphewtbx.js → chunk-ze5x2bpm.js} +1 -1
  89. package/dist/{chunk-jxrs1219.js → chunk-zh0apedk.js} +2 -2
  90. package/dist/{chunk-0hw5wjjg.js → chunk-zjyz926j.js} +1 -1
  91. package/dist/deploy/index.js +1 -1
  92. package/dist/dns/index.js +1 -1
  93. package/dist/drivers/hetzner/cloud-init.d.ts +14 -1
  94. package/dist/drivers/hetzner/driver.d.ts +2 -15
  95. package/dist/drivers/hetzner/state.d.ts +17 -2
  96. package/dist/drivers/index.d.ts +17 -1
  97. package/dist/drivers/index.js +1 -1
  98. package/dist/drivers/local-box/driver.d.ts +1 -1
  99. package/dist/drivers/shared/compute-provision.d.ts +7 -0
  100. package/dist/drivers/shared/driver-state.d.ts +68 -0
  101. package/dist/drivers/shared/remote-exec.d.ts +10 -1
  102. package/dist/drivers/shared/remote-failure.d.ts +41 -0
  103. package/dist/drivers/shared/ssh-transport.d.ts +121 -0
  104. package/dist/drivers/ssh/bootstrap.d.ts +61 -0
  105. package/dist/drivers/ssh/config.d.ts +86 -0
  106. package/dist/drivers/ssh/config.test.d.ts +1 -0
  107. package/dist/drivers/ssh/driver.d.ts +107 -0
  108. package/dist/drivers/ssh/factory-wiring.test.d.ts +1 -0
  109. package/dist/drivers/ssh/first-boot.d.ts +38 -0
  110. package/dist/drivers/ssh/preflight.d.ts +76 -0
  111. package/dist/index.d.ts +3 -2
  112. package/dist/index.js +7 -7
  113. package/dist/operations/index.js +1 -1
  114. package/dist/operations/inventory.d.ts +46 -1
  115. package/dist/protection/index.js +1 -1
  116. package/dist/push/index.js +1 -1
  117. package/dist/spend/index.js +1 -1
  118. package/dist/ui/404.html +1 -1
  119. package/dist/ui/accept-invitation.html +1 -1
  120. package/dist/ui/access-denied.html +2 -2
  121. package/dist/ui/account/automation.html +6 -6
  122. package/dist/ui/account/security.html +2 -2
  123. package/dist/ui/applications/compose.html +6 -6
  124. package/dist/ui/applications/new.html +2 -2
  125. package/dist/ui/data/backups.html +6 -6
  126. package/dist/ui/data/services.html +6 -6
  127. package/dist/ui/data/volumes.html +6 -6
  128. package/dist/ui/index.html +6 -6
  129. package/dist/ui/infrastructure/topology.html +6 -6
  130. package/dist/ui/integrations.html +2 -2
  131. package/dist/ui/operations/alerts.html +6 -6
  132. package/dist/ui/operations/configuration.html +6 -6
  133. package/dist/ui/operations/jobs.html +6 -6
  134. package/dist/ui/operations/maintenance.html +5 -5
  135. package/dist/ui/operations/observability.html +6 -6
  136. package/dist/ui/operations/previews.html +6 -6
  137. package/dist/ui/operations/queue.html +6 -6
  138. package/dist/ui/operations/regions.html +5 -5
  139. package/dist/ui/operations/releases.html +5 -5
  140. package/dist/ui/operations/spend.html +6 -6
  141. package/dist/ui/operations/workloads.html +6 -6
  142. package/dist/ui/security.html +1 -1
  143. package/dist/ui/server/actions.html +6 -6
  144. package/dist/ui/server/activity.html +1 -1
  145. package/dist/ui/server/capacity.html +6 -6
  146. package/dist/ui/server/database.html +6 -6
  147. package/dist/ui/server/deployments.html +5 -5
  148. package/dist/ui/server/diagnostics.html +2 -2
  149. package/dist/ui/server/firewall.html +5 -5
  150. package/dist/ui/server/fleet.html +6 -6
  151. package/dist/ui/server/logs.html +6 -6
  152. package/dist/ui/server/metrics.html +5 -5
  153. package/dist/ui/server/security.html +2 -2
  154. package/dist/ui/server/services.html +2 -2
  155. package/dist/ui/server/sites.html +6 -6
  156. package/dist/ui/server/ssh-keys.html +6 -6
  157. package/dist/ui/server/team.html +6 -6
  158. package/dist/ui/server/terminal.html +2 -2
  159. package/dist/ui/serverless/alarms.html +6 -6
  160. package/dist/ui/serverless/assets.html +2 -2
  161. package/dist/ui/serverless/cost.html +2 -2
  162. package/dist/ui/serverless/data.html +6 -6
  163. package/dist/ui/serverless/deployments.html +2 -2
  164. package/dist/ui/serverless/firewall.html +2 -2
  165. package/dist/ui/serverless/functions.html +6 -6
  166. package/dist/ui/serverless/logs.html +6 -6
  167. package/dist/ui/serverless/metrics.html +2 -2
  168. package/dist/ui/serverless/queues.html +6 -6
  169. package/dist/ui/serverless/secrets.html +6 -6
  170. package/dist/ui/serverless/traces.html +6 -6
  171. package/dist/ui/serverless.html +6 -6
  172. package/dist/ui-src/src/charts.ts +1 -1
  173. package/dist/ui-src/src/topology.ts +1 -1
  174. package/package.json +3 -3
  175. package/dist/bin/chunk-04dkwaqp.js +0 -1
  176. package/dist/bin/chunk-5nkqza92.js +0 -1
  177. package/dist/bin/chunk-64vczwwt.js +0 -1
  178. package/dist/bin/chunk-7g2ahkse.js +0 -1
  179. package/dist/bin/chunk-aw8bhggq.js +0 -594
  180. package/dist/bin/chunk-cxt74wsj.js +0 -1
  181. package/dist/bin/chunk-djg4zyqk.js +0 -1
  182. package/dist/bin/chunk-dkaz333b.js +0 -1
  183. package/dist/bin/chunk-edvvx3hg.js +0 -1
  184. package/dist/bin/chunk-f06c5np9.js +0 -1
  185. package/dist/bin/chunk-gq8794k6.js +0 -1
  186. package/dist/bin/chunk-k3120rx6.js +0 -1
  187. package/dist/bin/chunk-nw3d4k52.js +0 -1
  188. package/dist/bin/chunk-p70bc9yr.js +0 -1
  189. package/dist/bin/chunk-sg1g92cf.js +0 -1
  190. package/dist/bin/chunk-tvz9c388.js +0 -1
  191. package/dist/bin/chunk-y1h63vpm.js +0 -1
  192. package/dist/bin/chunk-zdt2rjk6.js +0 -1
  193. package/dist/bin/chunk-zh2d4704.js +0 -1
  194. package/dist/chunk-1bj94sc2.js +0 -1
  195. package/dist/chunk-3swnmwfc.js +0 -454
  196. package/dist/chunk-5pbtmy2k.js +0 -1
  197. package/dist/chunk-7sc8t7v1.js +0 -1
  198. package/dist/chunk-gny5s4kp.js +0 -1
  199. package/dist/chunk-qpjcd415.js +0 -22
  200. package/dist/chunk-xkw7h4pw.js +0 -1
@@ -0,0 +1,86 @@
1
+ /**
2
+ * The single place ssh-provider settings are resolved.
3
+ *
4
+ * Same shape and the same precedence as `../hetzner/config`, for the same
5
+ * reason: every value can come from several sources, and resolving them
6
+ * ad-hoc at each call site is how the driver, a CLI command and the dashboard
7
+ * end up disagreeing about which host a deploy goes to.
8
+ *
9
+ * 1. an explicit argument (a driver option or CLI flag: the caller means it)
10
+ * 2. `cloud.config.ts` -> `ssh.*` (checked into the repo, reviewable)
11
+ * 3. environment (`TS_CLOUD_SSH_*`) for per-machine overrides
12
+ * 4. the documented default in {@link SSH_DEFAULTS}
13
+ *
14
+ * Config beats environment deliberately: a value written in `cloud.config.ts`
15
+ * is the reviewed intent for the project, and a stray shell export must not
16
+ * silently redirect a deploy to another machine.
17
+ */
18
+ import type { CloudConfig, SshConfig, SshHostConfig } from '@ts-cloud/core';
19
+ export type SshProfile = NonNullable<SshConfig['profile']>;
20
+ export type SshHostKeyPolicyName = NonNullable<SshConfig['hostKey']>;
21
+ export type SshLanConfig = NonNullable<SshConfig['lan']>;
22
+ /** The documented defaults. These are the only place an ssh default lives. */
23
+ export declare const SSH_DEFAULTS: {
24
+ readonly user: 'root';
25
+ readonly port: 22;
26
+ readonly privateKeyPath: '~/.ssh/id_ed25519';
27
+ readonly hostKey: 'pin';
28
+ readonly profile: 'generic';
29
+ readonly publicIp: 'auto';
30
+ };
31
+ /**
32
+ * The hosts to deploy to: explicit, else `ssh.hosts`, else the single host
33
+ * named by `TS_CLOUD_SSH_HOST`. Throws when none is configured, because a
34
+ * driver without a host has nothing it can honestly do.
35
+ */
36
+ export declare function resolveSshHosts(config?: CloudConfig, explicit?: SshHostConfig[]): SshHostConfig[];
37
+ /** SSH user for deploy commands. Per host: the value lives on the `ssh.hosts[]` entry. */
38
+ export declare function resolveSshUser(host?: SshHostConfig, explicit?: string): string;
39
+ /** SSH port. A non-numeric or out-of-range value is a configuration error, not port 22. */
40
+ export declare function resolveSshPort(host?: SshHostConfig, explicit?: number): number;
41
+ /** Absolute path to the SSH private key used for deploy commands. */
42
+ export declare function resolveSshPrivateKeyPath(host?: SshHostConfig, explicit?: string): string;
43
+ /** How the host key is trusted; see `SshConfig.hostKey`. */
44
+ export declare function resolveSshHostKeyPolicy(config?: CloudConfig, explicit?: string): SshHostKeyPolicyName;
45
+ /**
46
+ * Whether remote scripts run through `sudo -n`. Explicit, else `ssh.sudo`,
47
+ * else on for any user that is not root: a deploy user that cannot become
48
+ * root cannot install the stack.
49
+ */
50
+ export declare function resolveSshSudo(config?: CloudConfig, user?: string, explicit?: boolean): boolean;
51
+ /** Host profile; see `SshConfig.profile`. */
52
+ export declare function resolveSshProfile(config?: CloudConfig, explicit?: string): SshProfile;
53
+ /** The public IP DNS should point at: `'auto'` or a literal address. */
54
+ export declare function resolveSshPublicIp(config?: CloudConfig, explicit?: string): string;
55
+ /** LAN access settings; empty when unset. */
56
+ export declare function resolveSshLan(config?: CloudConfig, explicit?: SshLanConfig): SshLanConfig;
57
+ /** One host with every per-host value resolved. */
58
+ export interface ResolvedSshHost {
59
+ host: string;
60
+ user: string;
61
+ port: number;
62
+ privateKeyPath: string;
63
+ role: 'app';
64
+ }
65
+ /** Every resolved ssh setting, for a driver or a diagnostic to read at once. */
66
+ export interface ResolvedSshSettings {
67
+ hosts: ResolvedSshHost[];
68
+ hostKey: SshHostKeyPolicyName;
69
+ sudo: boolean;
70
+ profile: SshProfile;
71
+ publicIp: string;
72
+ lan: SshLanConfig;
73
+ }
74
+ export interface SshOverrides {
75
+ hosts?: SshHostConfig[];
76
+ user?: string;
77
+ port?: number;
78
+ privateKeyPath?: string;
79
+ hostKey?: string;
80
+ sudo?: boolean;
81
+ profile?: string;
82
+ publicIp?: string;
83
+ lan?: SshLanConfig;
84
+ }
85
+ /** Resolve the full ssh settings for `config`, applying `overrides` first. */
86
+ export declare function resolveSshSettings(config?: CloudConfig, overrides?: SshOverrides): ResolvedSshSettings;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,107 @@
1
+ /**
2
+ * The ssh compute driver: deploy to a Linux host you already own.
3
+ *
4
+ * Where the cloud drivers CREATE a box and then deploy to it, this one ADOPTS
5
+ * one. `provisionComputeInfrastructure` therefore means: trust the host key,
6
+ * wait for sshd, run the preflight and refuse a host that cannot work, wait
7
+ * out a cloud-init first boot if one is still going, run the bootstrap (which
8
+ * is idempotent, so a deploy can call this every time), and record what was
9
+ * done. `destroyCompute` forgets the host and touches nothing on it.
10
+ *
11
+ * Everything after adoption is the Hetzner driver's SSH deploy path verbatim
12
+ * (the content-addressed artifact cache, the nonce-scoped staging upload, the
13
+ * per-target deploy with redacted failures), on an injectable transport.
14
+ */
15
+ import type { CloudConfig, CloudDriver, ComputeStackOutputs, ComputeTarget, FindComputeTargetsOptions, ProvisionComputeOptions, RemoteDeployResult, RunRemoteDeployOptions, SshHostConfig, UploadReleaseOptions, UploadReleaseResult } from '@ts-cloud/core';
16
+ import type { ValidationFinding } from '../../fleet';
17
+ import type { SshTransport } from '../shared/ssh-transport';
18
+ import type { ResolvedSshSettings, SshLanConfig } from './config';
19
+ import type { SshPreflightFacts } from './preflight';
20
+ /** Where releases are staged and cached on the host; the same paths as every other SSH-style driver. */
21
+ export declare const SSH_DEPLOY_STORAGE_PATH = "/var/ts-cloud/staging";
22
+ /** Set to `1` to skip the bootstrap when local state says the current version already ran. */
23
+ export declare const SSH_SKIP_BOOTSTRAP_ENV = "TS_CLOUD_SSH_SKIP_BOOTSTRAP";
24
+ export interface SshDriverOptions {
25
+ hosts?: SshHostConfig[];
26
+ user?: string;
27
+ port?: number;
28
+ privateKeyPath?: string;
29
+ hostKey?: string;
30
+ sudo?: boolean;
31
+ profile?: string;
32
+ publicIp?: string;
33
+ lan?: SshLanConfig;
34
+ /** Injected transport (tests, or a caller with its own SSH stack). */
35
+ transport?: SshTransport;
36
+ /** Tunables for the SSH-readiness / cloud-init wait loops; tiny in tests. */
37
+ bootWait?: {
38
+ /** @default 5000 */
39
+ sshIntervalMs?: number;
40
+ /** @default 300000 */
41
+ sshTimeoutMs?: number;
42
+ /** @default 5000 */
43
+ cloudInitIntervalMs?: number;
44
+ /** @default 600000 */
45
+ cloudInitTimeoutMs?: number;
46
+ };
47
+ /** Project root: where state and the pinned host keys live. @default process.cwd() */
48
+ cwd?: string;
49
+ }
50
+ /**
51
+ * The config problems the ssh provider refuses, and the keys it merely ignores.
52
+ *
53
+ * Throws for anything that would make the deploy mean something other than
54
+ * what the config says; returns a warning per sizing key that has no effect
55
+ * here, so an operator who copied a Hetzner config learns which lines are
56
+ * inert instead of wondering why the box did not grow.
57
+ */
58
+ export declare function assertSshComputeConfig(config: CloudConfig, settings: Pick<ResolvedSshSettings, 'hosts' | 'profile'>): string[];
59
+ export declare class SshDriver implements CloudDriver {
60
+ readonly name: 'ssh';
61
+ readonly usesCloudFormation = false;
62
+ private readonly settings;
63
+ private readonly cwd;
64
+ private readonly bootWait;
65
+ private transportInstance?;
66
+ constructor(options?: SshDriverOptions);
67
+ /** The one host this driver deploys to. */
68
+ private get host();
69
+ private get transport();
70
+ /** Run a script on the host as root (through sudo when the user is not root). */
71
+ private exec;
72
+ findComputeTargets(options: FindComputeTargetsOptions): Promise<ComputeTarget[]>;
73
+ getComputeOutputs(): Promise<ComputeStackOutputs>;
74
+ uploadRelease(options: UploadReleaseOptions): Promise<UploadReleaseResult>;
75
+ runRemoteDeploy(options: RunRemoteDeployOptions): Promise<RemoteDeployResult>;
76
+ /** The configured host name or address, for a caller that wants to print it. */
77
+ targetHost(): string;
78
+ /** Learn (and, when pinning, record) the host key. The adopt does this first; the preflight command too. */
79
+ ensureHostKey(host?: string): Promise<{
80
+ fingerprint: string;
81
+ pinnedNow: boolean;
82
+ }>;
83
+ /**
84
+ * Probe the host as the deploy user and judge the result. Public so the
85
+ * `ssh:preflight` command and the adopt share one definition of "ready".
86
+ */
87
+ preflight(host?: string): Promise<{
88
+ facts: SshPreflightFacts;
89
+ findings: ValidationFinding[];
90
+ }>;
91
+ /**
92
+ * Adopt the host: pin, wait, check, bootstrap, record. Idempotent, and
93
+ * cheap after the first run because the bootstrap guards itself.
94
+ */
95
+ provisionComputeInfrastructure(options: ProvisionComputeOptions): Promise<ComputeStackOutputs>;
96
+ /**
97
+ * Forget the host. Nothing on it is removed: it was never ts-cloud's to
98
+ * remove, and a teardown that wiped an operator's Pi would be a much worse
99
+ * surprise than one that left a gateway running.
100
+ */
101
+ destroyCompute(options: ProvisionComputeOptions): Promise<{
102
+ destroyed: string[];
103
+ }>;
104
+ private sleep;
105
+ private waitForSshReady;
106
+ private waitForCloudInit;
107
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,38 @@
1
+ export type FirstBootOs = 'raspberry-pi-os' | 'ubuntu';
2
+ export interface FirstBootWifi {
3
+ ssid: string;
4
+ passphrase: string;
5
+ /** ISO 3166-1 alpha-2 regulatory domain, e.g. `DE`. Required: without it the radio stays off. */
6
+ country: string;
7
+ }
8
+ export interface FirstBootIdentity {
9
+ /** The hostname; also the mDNS name (`<hostname>.local`) the instructions point at. */
10
+ hostname: string;
11
+ /** The deploy user cloud-init creates, with passwordless sudo and the key below. */
12
+ user: string;
13
+ /** One public key line (`ssh-ed25519 AAAA... comment`). */
14
+ publicKey: string;
15
+ /** IANA timezone, e.g. `Europe/Berlin`. */
16
+ timezone?: string;
17
+ /** System locale, e.g. `en_US.UTF-8`. */
18
+ locale?: string;
19
+ wifi?: FirstBootWifi;
20
+ }
21
+ export interface FirstBootBundle {
22
+ /** File name (as it must appear on the boot partition) to content. */
23
+ files: Record<string, string>;
24
+ /** What to do with the files, for the terminal. */
25
+ instructions: string;
26
+ }
27
+ export interface FirstBootOptions {
28
+ os: FirstBootOs;
29
+ }
30
+ /** Where the bootstrap is written on the host; the same place the adopt flow's marker lives beside. */
31
+ export declare const FIRST_BOOT_SCRIPT_PATH = "/var/lib/ts-cloud/bootstrap.sh";
32
+ /** The boot partition label each OS uses, so the instructions can name the volume. */
33
+ export declare const BOOT_PARTITION_LABEL: Record<FirstBootOs, string>;
34
+ /**
35
+ * Build the three cloud-init files for `identity`, embedding `bootstrapScript`
36
+ * (from `buildSshBootstrapScript`) so it runs at the end of the first boot.
37
+ */
38
+ export declare function buildCloudInitFirstBoot(identity: FirstBootIdentity, bootstrapScript: string, options: FirstBootOptions): FirstBootBundle;
@@ -0,0 +1,76 @@
1
+ /**
2
+ * What ts-cloud checks about a bring-your-own host before touching it.
3
+ *
4
+ * The cloud drivers never need this: they chose the image, the size and the
5
+ * region, so they know what they are logging into. An adopted host is
6
+ * whatever the operator installed, and the bootstrap's failure modes on the
7
+ * wrong machine are slow and misleading (an apt run that never finishes on
8
+ * an unsynced clock, a 404 from an x86_64-only download on an ARM board).
9
+ * One probe, run as the deploy user, answers every question the bootstrap
10
+ * would otherwise discover the hard way.
11
+ */
12
+ import type { ValidationFinding } from '../../fleet';
13
+ import type { SshProfile } from './config';
14
+ /** The facts the preflight script reports, as JSON on its last line. */
15
+ export interface SshPreflightFacts {
16
+ /** `PRETTY_NAME` from /etc/os-release. */
17
+ os: string;
18
+ /** `ID` from /etc/os-release, e.g. `debian`, `ubuntu`, `raspbian`. */
19
+ osId: string;
20
+ /** `ID_LIKE` from /etc/os-release, e.g. `debian` on Ubuntu. */
21
+ osIdLike: string;
22
+ /** `VERSION_ID` from /etc/os-release, e.g. `13`, `24.04`. */
23
+ osVersionId: string;
24
+ /** `uname -m`: `aarch64`, `x86_64`, `armv7l`, ... */
25
+ arch: string;
26
+ cpuCores: number;
27
+ memoryBytes: number;
28
+ diskBytes: number;
29
+ diskFreeBytes: number;
30
+ dnsOk: boolean;
31
+ /** Whether the `cloud-init` binary exists on the host. */
32
+ cloudInitPresent: boolean;
33
+ /** First line of `cloud-init status`, empty when absent. */
34
+ cloudInitStatus: string;
35
+ /** `timedatectl` reports the clock as NTP-synchronised. */
36
+ timeSynced: boolean;
37
+ /** An HTTPS request to github.com succeeded (downloads will work). */
38
+ httpsOk: boolean;
39
+ /** `sudo -n true` succeeded for the deploy user. */
40
+ sudoOk: boolean;
41
+ /** `getconf LONG_BIT`: 64 on every supported host. */
42
+ kernelBits: number;
43
+ /** `/proc/device-tree/model`, e.g. `Raspberry Pi 5 Model B Rev 1.0`; empty elsewhere. */
44
+ piModel: string;
45
+ /** First address from `hostname -I`. */
46
+ lanIp: string;
47
+ tools: {
48
+ curl: boolean;
49
+ tar: boolean;
50
+ };
51
+ privilege: 'sudo' | 'user';
52
+ }
53
+ /**
54
+ * The probe. Runs as the deploy user WITHOUT sudo, on purpose: `sudoOk` is a
55
+ * question, and a script that already needed sudo to run could not ask it.
56
+ * Every command tolerates absence (a `false`, a `0`, an empty string) so the
57
+ * JSON is always complete and the findings, not a shell error, say what is
58
+ * missing. The last line of stdout is the JSON document.
59
+ */
60
+ export declare const SSH_PREFLIGHT_SCRIPT: string;
61
+ /** Parse the probe's stdout: the last non-empty line is the JSON document. */
62
+ export declare function parsePreflightFacts(output: string): SshPreflightFacts;
63
+ export interface PreflightContext {
64
+ /** The deploy user; root needs no sudo. */
65
+ user: string;
66
+ profile: SshProfile;
67
+ }
68
+ /**
69
+ * Turn facts into findings. An `error` finding stops the adopt; a `warning`
70
+ * is printed and the adopt continues; `info` is context worth showing.
71
+ */
72
+ export declare function evaluatePreflight(facts: SshPreflightFacts, context: PreflightContext): ValidationFinding[];
73
+ /** True when any finding is an error. */
74
+ export declare function preflightFailed(findings: readonly ValidationFinding[]): boolean;
75
+ /** A plain-text table of findings, one per line, for a terminal or an error message. */
76
+ export declare function formatPreflightFindings(findings: readonly ValidationFinding[]): string;
package/dist/index.d.ts CHANGED
@@ -27,7 +27,7 @@ export * from './generators';
27
27
  export { validateTemplate, validateTemplateSize, validateResourceLimits } from './validation';
28
28
  export type { ValidationError as TemplateValidationError, ValidationResult as TemplateValidationResult, } from './validation';
29
29
  export { AWSClient, CloudFormationClient, CloudFormationClient as AWSCloudFormationClient, CloudFrontClient, CloudFrontClient as AWSCloudFrontClient, EC2Client, S3Client, Route53Client, Route53DomainsClient, ACMClient, ACMDnsValidator, ECRClient, ECSClient, STSClient, SSMClient, SecretsManagerClient, SESClient, EmailClient, SNSClient, SQSClient, LambdaClient, CloudWatchLogsClient, ConnectClient, ELBv2Client, RDSClient, DynamoDBClient, OpenSearchClient, TranscribeClient, BedrockClient, BedrockRuntimeClient, ComprehendClient, RekognitionClient, TextractClient, PollyClient, TranslateClient, PersonalizeClient, KendraClient, EventBridgeClient, ElastiCacheClient, SchedulerClient, IAMClient, ApplicationAutoScalingClient, SmsClient, VoiceClient, SupportClient, EFSClient, setupSmsInfrastructure, getSmsInfrastructureStatus, createSmsInfrastructure, SmsVoiceClient, } from './aws';
30
- export type { SmsSetupConfig, SmsSetupResult, OriginationPhoneNumber, DescribePhoneNumbersParams, DescribePhoneNumbersResult, } from './aws';
30
+ export type { SmsSetupConfig, SmsSetupResult, OriginationPhoneNumber, DescribePhoneNumbersParams, DescribePhoneNumbersResult, SandboxPhone, AddSandboxPhoneResult, VerifySandboxPhoneResult, } from './aws';
31
31
  export type { AWSRequestOptions, AWSClientConfig, AWSError, AWSCredentials as AWSClientCredentials, StackParameter, StackTag, CreateStackOptions, UpdateStackOptions, DescribeStacksOptions, StackEvent, Stack, InvalidationOptions, Distribution, S3SyncOptions, S3CopyOptions, S3ListOptions, S3Object, CertificateDetail, Certificate as ELBv2Certificate, RekognitionS3Object, RekognitionBoundingBox, TextractS3Object, TextractBoundingBox, CountryCode, ContactType, ContactDetail, KendraCreateDataSourceCommandInput, KendraCreateDataSourceCommandOutput, KendraListDataSourcesCommandInput, KendraListDataSourcesCommandOutput, InvokeModelCommandInput, InvokeModelCommandOutput, InvokeModelWithResponseStreamCommandInput, InvokeModelWithResponseStreamCommandOutput, CreateModelCustomizationJobCommandInput, CreateModelCustomizationJobCommandOutput, GetModelCustomizationJobCommandInput, GetModelCustomizationJobCommandOutput, ListFoundationModelsCommandInput, ListFoundationModelsCommandOutput, AttributeValue as DynamoDBAttributeValue, KeySchemaElement, AttributeDefinition as DynamoDBAttributeDefinition, } from './aws';
32
32
  export { createObjectStorageClient, providerEndpoint, resolveObjectStorage } from './object-storage';
33
33
  export type { ObjectStorageConfig, ObjectStorageCredentials, ObjectStorageProvider, ResolvedObjectStorage, } from './object-storage';
@@ -39,8 +39,9 @@ export { collectServerDnsDomains, hostAcceptsIpv6, IPV6_EXCLUDED_HOST_LABELS, no
39
39
  export type { AddressRecordReport } from './deploy/server-dns';
40
40
  export * from './cdn';
41
41
  export type { EnsureDashboardLogger, ResolvedDashboardAuth, StaticSiteConfig, DeployResult, UploadOptions, ExternalDnsStaticSiteConfig, ExternalDnsDeployResult, DeploySiteConfig, DeploySiteResult, StaticSiteDnsProvider, SiteDeployKind, DeploymentValidationResult, BuildImageOptions, BuiltImage, CodeSource, DeployServerlessOptions, ResolvedContext, } from './deploy';
42
- export { createCloudDriver, CloudDriverFactory, cloudDrivers, AwsDriver, HetznerDriver, HetznerClient, resolveHetznerApiToken, normalizeSshPublicKey, ensureFirewall, ensureServer, ensureSshKey, serverPublicIpv4, sshExec, sshExecOrThrow, scpUpload, waitForSsh, waitForCloudInit, buildSshArgs, generateUbuntuAppCloudInit, wrapCloudInitUserData, buildHostCleanupScript, buildSiteDeployScript, buildStaticSiteDeployScript, resolveExecStart, deployAllComputeSites, deploySiteRelease, reloadRpxGateway, renewRpxCertificates, gatewayHostnames, hasAutoWwwVariant, } from './drivers';
42
+ export { createCloudDriver, CloudDriverFactory, cloudDrivers, AwsDriver, HetznerDriver, SshDriver, SystemSshTransport, resolveSshSettings, buildSshBootstrapScript, SSH_BOOTSTRAP_VERSION, evaluatePreflight, formatPreflightFindings, parsePreflightFacts, preflightFailed, SSH_PREFLIGHT_SCRIPT, buildCloudInitFirstBoot, driverStatePath, readDriverState, writeDriverState, HetznerClient, resolveHetznerApiToken, normalizeSshPublicKey, ensureFirewall, ensureServer, ensureSshKey, serverPublicIpv4, sshExec, sshExecOrThrow, scpUpload, waitForSsh, waitForCloudInit, buildSshArgs, generateUbuntuAppCloudInit, wrapCloudInitUserData, buildHostCleanupScript, buildSiteDeployScript, buildStaticSiteDeployScript, resolveExecStart, deployAllComputeSites, deploySiteRelease, reloadRpxGateway, renewRpxCertificates, gatewayHostnames, hasAutoWwwVariant, } from './drivers';
43
43
  export type { CreateCloudDriverOptions } from './drivers/factory';
44
+ export type { DriverState, FirstBootBundle, FirstBootIdentity, FirstBootOs, ResolvedSshSettings, SshDriverOptions, SshDriverState, SshPreflightFacts, SshTransport, SshTransportOptions, } from './drivers';
44
45
  export { dashboardActions, resolveDashboardAction, sanitizeCloudConfig, startLocalDashboardServer, } from './deploy/local-dashboard-server';
45
46
  export type { DashboardAction, LocalDashboardServer, LocalDashboardServerOptions, } from './deploy/local-dashboard-server';
46
47
  export { createDnsProvider, detectDnsProvider, DnsProviderFactory, dnsProviders, PorkbunProvider, GoDaddyProvider, Route53Provider, CloudflareProvider, policyTag, qualifyName, reconcileDeclaredRecords, resolveDeclaredRecords, UnifiedDnsValidator, createPorkbunValidator, createGoDaddyValidator, createRoute53Validator, } from './dns';