paratix 0.10.0 → 0.12.2
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 +7 -1
- package/dist/chunk-YOSHYUST.js +19058 -0
- package/dist/chunk-YOSHYUST.js.map +1 -0
- package/dist/cli.js +5091 -224
- package/dist/cli.js.map +1 -1
- package/dist/{user-CJDqZC8n.d.ts → index-udpAybq3.d.ts} +637 -36
- package/dist/index.d.ts +51 -7
- package/dist/index.js +965 -73
- package/dist/index.js.map +1 -1
- package/dist/modules/index.d.ts +1 -119
- package/dist/modules/index.js +1 -2
- package/llm-guide.md +176 -35
- package/package.json +10 -8
- package/dist/chunk-47PTUZZR.js +0 -495
- package/dist/chunk-47PTUZZR.js.map +0 -1
- package/dist/chunk-M7GETOJ5.js +0 -6237
- package/dist/chunk-M7GETOJ5.js.map +0 -1
- package/dist/chunk-NRDLYHJL.js +0 -1866
- package/dist/chunk-NRDLYHJL.js.map +0 -1
- package/dist/cli.d.ts +0 -62
- package/dist/types-Cl2Muw1x.d.ts +0 -254
package/dist/types-Cl2Muw1x.d.ts
DELETED
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A scalar env value, or a lazy function that returns one.
|
|
3
|
-
* Functions may be async, allowing secrets to be fetched on demand.
|
|
4
|
-
*/
|
|
5
|
-
type EnvironmentValue = (() => boolean | number | string) | (() => Promise<boolean | number | string>) | boolean | number | string;
|
|
6
|
-
/** A key-value map of environment values available to modules and templates. */
|
|
7
|
-
type Environment = Record<string, EnvironmentValue>;
|
|
8
|
-
/** Environment values that can be emitted through the typed meta system. */
|
|
9
|
-
type MetaEnvironmentValue = EnvironmentValue;
|
|
10
|
-
/** Generic meta entry that propagates a value into the downstream environment. */
|
|
11
|
-
type EnvironmentMetaEntry = {
|
|
12
|
-
kind: "env";
|
|
13
|
-
name: string;
|
|
14
|
-
resolve: () => Promise<boolean | number | string>;
|
|
15
|
-
valueType: "boolean" | "number" | "string";
|
|
16
|
-
};
|
|
17
|
-
/** Runner control-plane meta entry emitted when sshd changed its listen port. */
|
|
18
|
-
type SshdPortMetaEntry = {
|
|
19
|
-
kind: "sshd.port";
|
|
20
|
-
port: number;
|
|
21
|
-
};
|
|
22
|
-
/** Runner control-plane meta entry emitted when the target host changed. */
|
|
23
|
-
type SystemHostMetaEntry = {
|
|
24
|
-
host: string;
|
|
25
|
-
kind: "system.host";
|
|
26
|
-
};
|
|
27
|
-
/** Runner control-plane meta entry emitted when a reboot should trigger reconnect logic. */
|
|
28
|
-
type SystemRebootMetaEntry = {
|
|
29
|
-
kind: "system.reboot";
|
|
30
|
-
};
|
|
31
|
-
/** Any meta entry that modules may emit. */
|
|
32
|
-
type ModuleMetaEntry = EnvironmentMetaEntry | SshdPortMetaEntry | SystemHostMetaEntry | SystemRebootMetaEntry;
|
|
33
|
-
/** Check result indicating the module's desired state is not yet present. */
|
|
34
|
-
declare const NEEDS_APPLY: "needs-apply";
|
|
35
|
-
/** Execution status emitted by a module apply step. */
|
|
36
|
-
type ModuleStatus = "changed" | "failed" | "ok" | "skipped";
|
|
37
|
-
/** The outcome of a module's apply step. */
|
|
38
|
-
type ModuleResult = {
|
|
39
|
-
/**
|
|
40
|
-
* Optional internal dry-run detail shown instead of the generic `(dry-run)`
|
|
41
|
-
* suffix when a module performed custom dry-run verification.
|
|
42
|
-
* @internal
|
|
43
|
-
*/
|
|
44
|
-
_dryRunDetail?: string;
|
|
45
|
-
/**
|
|
46
|
-
* Optional internal control-plane marker that tells the current scope to
|
|
47
|
-
* execute all pending signals immediately at this point in the run.
|
|
48
|
-
* @internal
|
|
49
|
-
*/
|
|
50
|
-
_flushSignals?: true;
|
|
51
|
-
/**
|
|
52
|
-
* Optional internal control-plane marker that tells the runner to stop the
|
|
53
|
-
* current run successfully after this module completed.
|
|
54
|
-
* @internal
|
|
55
|
-
*/
|
|
56
|
-
_stopRun?: true;
|
|
57
|
-
/** Optional short detail appended to the printed module status line. */
|
|
58
|
-
detail?: string;
|
|
59
|
-
/** Optional error details consumed by the runner for centralized CLI output. */
|
|
60
|
-
error?: Error;
|
|
61
|
-
/** Optional typed meta entries for env propagation and runner control-plane updates. */
|
|
62
|
-
meta?: ModuleMetaEntry[];
|
|
63
|
-
/** Execution status of the module. */
|
|
64
|
-
status: ModuleStatus;
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* Internal orchestration step shape shared between runner and recipe execution.
|
|
68
|
-
* Contains the merged downstream environment after a single apply step.
|
|
69
|
-
* @internal
|
|
70
|
-
*/
|
|
71
|
-
type OrchestrationStep = {
|
|
72
|
-
/** @internal */
|
|
73
|
-
_flushSignals?: true;
|
|
74
|
-
/** @internal */
|
|
75
|
-
_stopRun?: true;
|
|
76
|
-
env: Environment;
|
|
77
|
-
meta?: ModuleMetaEntry[];
|
|
78
|
-
status: ModuleStatus;
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* A single idempotent unit of work that can be checked and applied.
|
|
82
|
-
* Modules form the building blocks of a server recipe.
|
|
83
|
-
*/
|
|
84
|
-
type Module = {
|
|
85
|
-
/**
|
|
86
|
-
* Optional internal dry-run apply hook for modules that need custom dry-run
|
|
87
|
-
* execution semantics beyond the generic blocker/meta-producer markers.
|
|
88
|
-
* @internal
|
|
89
|
-
*/
|
|
90
|
-
_applyDryRun?: (ssh: null | SshConnection, environment: Environment) => Promise<ModuleResult>;
|
|
91
|
-
/**
|
|
92
|
-
* Internal marker for modules that must still execute their apply step in dry-run mode
|
|
93
|
-
* because they act as run blockers rather than mutating state.
|
|
94
|
-
* @internal
|
|
95
|
-
*/
|
|
96
|
-
_dryRunBlocker?: true;
|
|
97
|
-
/**
|
|
98
|
-
* Internal marker for non-mutating modules whose apply step emits meta that must
|
|
99
|
-
* still be materialized during dry-run so downstream modules see the same environment.
|
|
100
|
-
* @internal
|
|
101
|
-
*/
|
|
102
|
-
_dryRunMetaProducer?: true;
|
|
103
|
-
/**
|
|
104
|
-
* Enforce the desired state.
|
|
105
|
-
* @returns A {@link ModuleResult} describing what happened.
|
|
106
|
-
*/
|
|
107
|
-
apply: (ssh: null | SshConnection, environment: Environment) => Promise<ModuleResult>;
|
|
108
|
-
/**
|
|
109
|
-
* Determine whether the module needs to run.
|
|
110
|
-
* @returns `"ok"` if the desired state is already present, `"needs-apply"` otherwise.
|
|
111
|
-
*/
|
|
112
|
-
check: (ssh: null | SshConnection, environment: Environment) => Promise<"needs-apply" | "ok">;
|
|
113
|
-
/**
|
|
114
|
-
* When true the module runs locally instead of over SSH.
|
|
115
|
-
* The `ssh` parameter will be `null` in check/apply.
|
|
116
|
-
*/
|
|
117
|
-
local?: boolean;
|
|
118
|
-
/** Human-readable name shown in the run output. */
|
|
119
|
-
name: string;
|
|
120
|
-
};
|
|
121
|
-
/** Raw output from a remote or local command execution. */
|
|
122
|
-
type ExecResult = {
|
|
123
|
-
/** Exit code of the process. */
|
|
124
|
-
code: number;
|
|
125
|
-
/** Captured standard error. */
|
|
126
|
-
stderr: string;
|
|
127
|
-
/** Captured standard output. */
|
|
128
|
-
stdout: string;
|
|
129
|
-
};
|
|
130
|
-
/** Options that control how a command is executed. */
|
|
131
|
-
type ExecOptions = {
|
|
132
|
-
/** Additional environment variables to inject into the process. */
|
|
133
|
-
env?: Record<string, string>;
|
|
134
|
-
/** Return a result even when the exit code is non-zero instead of throwing. */
|
|
135
|
-
ignoreExitCode?: boolean;
|
|
136
|
-
/** Strings to mask in error messages (e.g. tokens, passwords). */
|
|
137
|
-
secrets?: string[];
|
|
138
|
-
/** Suppress stdout/stderr from the console while running. */
|
|
139
|
-
silent?: boolean;
|
|
140
|
-
/** Abort the command after this many milliseconds. */
|
|
141
|
-
timeout?: number;
|
|
142
|
-
};
|
|
143
|
-
/**
|
|
144
|
-
* Abstraction over an active SSH session.
|
|
145
|
-
* All methods that accept a `command` string run it on the remote host.
|
|
146
|
-
*/
|
|
147
|
-
type SshConnection = {
|
|
148
|
-
/** Register an additional port that was opened on the remote host. */
|
|
149
|
-
addPort: (port: number) => void;
|
|
150
|
-
/** Close the SSH connection and free resources. */
|
|
151
|
-
disconnect: () => void;
|
|
152
|
-
/** Download a remote file to the local filesystem. */
|
|
153
|
-
downloadFile: (remotePath: string, localPath: string) => Promise<void>;
|
|
154
|
-
/** Run a command and return the full result including exit code and output. */
|
|
155
|
-
exec: (command: string, options?: ExecOptions) => Promise<ExecResult>;
|
|
156
|
-
/** Return `true` if the remote path exists. */
|
|
157
|
-
exists: (remotePath: string) => Promise<boolean>;
|
|
158
|
-
/**
|
|
159
|
-
* Return the low-level connection parameters for this session.
|
|
160
|
-
* `privateKeyPath` and `agentSocket` reflect the authentication method that
|
|
161
|
-
* was actually used for the current session. `privateKeyPath` is returned as
|
|
162
|
-
* an expanded filesystem path.
|
|
163
|
-
*/
|
|
164
|
-
getConnectionInfo: () => {
|
|
165
|
-
agentSocket?: string;
|
|
166
|
-
authMethod?: "agent" | "password" | "privateKey";
|
|
167
|
-
host: string;
|
|
168
|
-
port: number;
|
|
169
|
-
privateKeyPath?: string;
|
|
170
|
-
user: string;
|
|
171
|
-
verifiedHostPublicKey?: string;
|
|
172
|
-
};
|
|
173
|
-
/** Run a command and return stdout split into lines. */
|
|
174
|
-
lines: (command: string) => Promise<string[]>;
|
|
175
|
-
/** Run a command and return trimmed stdout. */
|
|
176
|
-
output: (command: string) => Promise<string>;
|
|
177
|
-
/** Probe whether passwordless sudo works; prompt interactively if not and cache the password. */
|
|
178
|
-
probeSudo: () => Promise<void>;
|
|
179
|
-
/** Read the full contents of a remote file as a string. */
|
|
180
|
-
readFile: (remotePath: string) => Promise<string>;
|
|
181
|
-
/** Remove a previously registered port from the reconnect candidate list. */
|
|
182
|
-
removePort: (port: number) => void;
|
|
183
|
-
/** Return the SHA-256 hex digest of a remote file, or `null` if not found. */
|
|
184
|
-
sha256: (remotePath: string) => Promise<null | string>;
|
|
185
|
-
/** Run a command and return `true` if the exit code is zero. */
|
|
186
|
-
test: (command: string) => Promise<boolean>;
|
|
187
|
-
/** Update the target host address (e.g. after a reboot with new IP). */
|
|
188
|
-
updateHost: (host: string) => void;
|
|
189
|
-
/** Upload a local file to the remote host via SFTP. */
|
|
190
|
-
uploadFile: (localPath: string, remotePath: string, options?: {
|
|
191
|
-
mode?: string;
|
|
192
|
-
}) => Promise<void>;
|
|
193
|
-
/** Write a string to a remote file, creating or overwriting it. */
|
|
194
|
-
writeFile: (remotePath: string, content: string, options: {
|
|
195
|
-
mode: string;
|
|
196
|
-
}) => Promise<void>;
|
|
197
|
-
};
|
|
198
|
-
/** SSH connection parameters for a server. */
|
|
199
|
-
type SshConfig = {
|
|
200
|
-
/** Forward the local SSH agent to the remote host. */
|
|
201
|
-
agentForward?: boolean;
|
|
202
|
-
/** Expected SHA256 host fingerprint used as a pinned trust anchor. */
|
|
203
|
-
expectedHostFingerprint?: string;
|
|
204
|
-
/** Expected OpenSSH public key (`"<algorithm> <base64>"`) used as a pinned trust anchor. */
|
|
205
|
-
expectedHostPublicKey?: string;
|
|
206
|
-
/** Maximum number of reconnection attempts before giving up. */
|
|
207
|
-
maxReconnectAttempts?: number;
|
|
208
|
-
/** Fall back to password authentication if key auth fails. */
|
|
209
|
-
passwordFallback?: boolean;
|
|
210
|
-
/** Ordered list of candidate ports -- the runner tries each until one connects. */
|
|
211
|
-
ports: number[];
|
|
212
|
-
/**
|
|
213
|
-
* Absolute path to the private key file used for authentication.
|
|
214
|
-
* When omitted, the SSH agent referenced by `SSH_AUTH_SOCK` is used instead.
|
|
215
|
-
* Exactly one of `privateKey` or a running SSH agent must be available.
|
|
216
|
-
*/
|
|
217
|
-
privateKey?: string;
|
|
218
|
-
/** Maximum time in milliseconds to spend attempting reconnection before giving up. */
|
|
219
|
-
reconnectTimeout?: number;
|
|
220
|
-
/**
|
|
221
|
-
* Host key verification strategy.
|
|
222
|
-
* - `"accept-new"` — explicit TOFU opt-in: accept unknown keys and append them to `~/.ssh/known_hosts`.
|
|
223
|
-
* - `"yes"` — reject unknown keys; only connect when the key is already in `known_hosts`.
|
|
224
|
-
* - `"no"` — skip host key verification entirely.
|
|
225
|
-
*
|
|
226
|
-
* When omitted, Paratix now defaults to `"yes"`. To connect to a new host
|
|
227
|
-
* safely without TOFU, set `expectedHostFingerprint` or `expectedHostPublicKey`.
|
|
228
|
-
*/
|
|
229
|
-
strictHostKeyChecking?: "accept-new" | "no" | "yes";
|
|
230
|
-
/** Password used for `sudo` escalation on the remote host. */
|
|
231
|
-
sudoPassword?: string;
|
|
232
|
-
/** Username to authenticate as. */
|
|
233
|
-
user: string;
|
|
234
|
-
};
|
|
235
|
-
/** Top-level definition of a server and the modules to run on it. */
|
|
236
|
-
type ServerDefinition = {
|
|
237
|
-
/** Server-level env values merged with global env before running modules. */
|
|
238
|
-
env?: Environment;
|
|
239
|
-
/** Hostname or IP address. */
|
|
240
|
-
host: string;
|
|
241
|
-
/** Display name for the server. */
|
|
242
|
-
name: string;
|
|
243
|
-
/** Ordered list of modules (or recipes) to apply. */
|
|
244
|
-
run: Module[];
|
|
245
|
-
/**
|
|
246
|
-
* Modules triggered as signals after the run completes with status `"changed"`.
|
|
247
|
-
* Typically used for service reloads or notifications.
|
|
248
|
-
*/
|
|
249
|
-
signals?: Module[];
|
|
250
|
-
/** SSH connection parameters. */
|
|
251
|
-
ssh: SshConfig;
|
|
252
|
-
};
|
|
253
|
-
|
|
254
|
-
export { type Environment as E, type Module as M, NEEDS_APPLY as N, type OrchestrationStep as O, type ServerDefinition as S, type ModuleMetaEntry as a, type MetaEnvironmentValue as b, type EnvironmentMetaEntry as c, type SshdPortMetaEntry as d, type SystemHostMetaEntry as e, type SystemRebootMetaEntry as f, type ModuleResult as g, type ExecResult as h, type ModuleStatus as i, type SshConnection as j, type EnvironmentValue as k, type ExecOptions as l, type SshConfig as m };
|