create-wpt-iot 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +71 -0
  2. package/dist/artifact.d.ts +13 -0
  3. package/dist/artifact.d.ts.map +1 -0
  4. package/dist/artifact.js +37 -0
  5. package/dist/artifact.js.map +1 -0
  6. package/dist/bin.d.ts +3 -0
  7. package/dist/bin.d.ts.map +1 -0
  8. package/dist/bin.js +5 -0
  9. package/dist/bin.js.map +1 -0
  10. package/dist/cli.d.ts +33 -0
  11. package/dist/cli.d.ts.map +1 -0
  12. package/dist/cli.js +175 -0
  13. package/dist/cli.js.map +1 -0
  14. package/dist/config-file.d.ts +12 -0
  15. package/dist/config-file.d.ts.map +1 -0
  16. package/dist/config-file.js +35 -0
  17. package/dist/config-file.js.map +1 -0
  18. package/dist/i18n.d.ts +7 -0
  19. package/dist/i18n.d.ts.map +1 -0
  20. package/dist/i18n.js +10 -0
  21. package/dist/i18n.js.map +1 -0
  22. package/dist/installer-manifest.d.ts +3 -0
  23. package/dist/installer-manifest.d.ts.map +1 -0
  24. package/dist/installer-manifest.js +7 -0
  25. package/dist/installer-manifest.js.map +1 -0
  26. package/dist/local.d.ts +6 -0
  27. package/dist/local.d.ts.map +1 -0
  28. package/dist/local.js +42 -0
  29. package/dist/local.js.map +1 -0
  30. package/dist/messages/en.d.ts +48 -0
  31. package/dist/messages/en.d.ts.map +1 -0
  32. package/dist/messages/en.js +48 -0
  33. package/dist/messages/en.js.map +1 -0
  34. package/dist/messages/it.d.ts +3 -0
  35. package/dist/messages/it.d.ts.map +1 -0
  36. package/dist/messages/it.js +48 -0
  37. package/dist/messages/it.js.map +1 -0
  38. package/dist/preflight.d.ts +5 -0
  39. package/dist/preflight.d.ts.map +1 -0
  40. package/dist/preflight.js +25 -0
  41. package/dist/preflight.js.map +1 -0
  42. package/dist/process.d.ts +39 -0
  43. package/dist/process.d.ts.map +1 -0
  44. package/dist/process.js +115 -0
  45. package/dist/process.js.map +1 -0
  46. package/dist/prompts.d.ts +36 -0
  47. package/dist/prompts.d.ts.map +1 -0
  48. package/dist/prompts.js +65 -0
  49. package/dist/prompts.js.map +1 -0
  50. package/dist/remote.d.ts +8 -0
  51. package/dist/remote.d.ts.map +1 -0
  52. package/dist/remote.js +211 -0
  53. package/dist/remote.js.map +1 -0
  54. package/dist/types.d.ts +24 -0
  55. package/dist/types.d.ts.map +1 -0
  56. package/dist/types.js +2 -0
  57. package/dist/types.js.map +1 -0
  58. package/dist/validation.d.ts +12 -0
  59. package/dist/validation.d.ts.map +1 -0
  60. package/dist/validation.js +69 -0
  61. package/dist/validation.js.map +1 -0
  62. package/package.json +44 -0
@@ -0,0 +1,48 @@
1
+ export const en = {
2
+ cliDescription: 'Install or update one WPT IoT edge device',
3
+ helpUsage: 'Usage: create-wpt-iot [--mode local|remote] [--help] [--version]',
4
+ helpMode: ' --mode local|remote Skip only the installation mode question',
5
+ helpHelp: ' --help Show this help',
6
+ helpVersion: ' --version Show the package version',
7
+ usageError: 'Invalid arguments. Use --help to see the supported options.',
8
+ modeQuestion: 'Where do you want to install WPT IoT?',
9
+ modeLocal: 'This Linux device',
10
+ modeRemote: 'A remote Linux device over SSH',
11
+ remoteHost: 'Target hostname or IP address',
12
+ remotePort: 'SSH port',
13
+ remoteUsername: 'SSH username',
14
+ installDir: 'Installation directory',
15
+ deviceSerial: 'Device serial used by wpt-<serial>.local',
16
+ adminPassword: 'Initial admin password',
17
+ adminPasswordConfirm: 'Confirm the admin password',
18
+ autoUpdate: 'Enable automatic backend/frontend updates every 5 minutes?',
19
+ confirmInstall: 'Apply this installation?',
20
+ existingInstall: 'Existing installation detected; credentials and data will be preserved.',
21
+ remoteTargetSummary: 'Target: {user}@{host}:{port}',
22
+ localTargetSummary: 'Target: this Linux device',
23
+ phasePreflight: 'Preflight checks',
24
+ phaseDownload: 'Download verified installer',
25
+ phaseTransfer: 'Transfer secure configuration',
26
+ phaseInstall: 'Install WPT IoT',
27
+ phaseCleanup: 'Remove temporary files',
28
+ installComplete: 'WPT IoT is healthy at https://wpt.local',
29
+ cancelled: 'Installation cancelled before making changes.',
30
+ unsupportedLocalPlatform: 'Local mode requires Linux with apt and systemd. Use remote mode from Windows.',
31
+ invalidHost: 'Enter a valid hostname or IP address.',
32
+ invalidPort: 'Enter a port between 1 and 65535.',
33
+ invalidUsername: 'Enter a valid Linux username.',
34
+ invalidInstallDir: 'Enter an absolute Linux path other than /.',
35
+ invalidSerial: 'Use 1-32 lowercase letters, digits, or hyphens.',
36
+ weakPassword: 'Use at least 12 characters.',
37
+ passwordMismatch: 'The passwords do not match.',
38
+ missingCommand: 'Required command not found: {command}',
39
+ preflightFailed: 'Preflight failed: {reason}',
40
+ checksumFailed: 'Installer integrity verification failed.',
41
+ insufficientDiskSpace: 'At least 12 GiB of free target disk space is required.',
42
+ cleanupWarning: 'Warning: a temporary file could not be removed.',
43
+ cleanupFailed: 'Temporary-file cleanup failed.',
44
+ invalidRemotePreflightOutput: 'The remote preflight returned an invalid response.',
45
+ unsupportedRemoteClientPlatform: 'Remote mode requires Windows or Linux.',
46
+ installFailed: 'Installation failed during {phase}. It is safe to run the wizard again.',
47
+ };
48
+ //# sourceMappingURL=en.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"en.js","sourceRoot":"","sources":["../../src/messages/en.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,EAAE,GAAG;IAChB,cAAc,EAAE,2CAA2C;IAC3D,SAAS,EAAE,kEAAkE;IAC7E,QAAQ,EAAE,iEAAiE;IAC3E,QAAQ,EAAE,uCAAuC;IACjD,WAAW,EAAE,iDAAiD;IAC9D,UAAU,EAAE,6DAA6D;IACzE,YAAY,EAAE,uCAAuC;IACrD,SAAS,EAAE,mBAAmB;IAC9B,UAAU,EAAE,gCAAgC;IAC5C,UAAU,EAAE,+BAA+B;IAC3C,UAAU,EAAE,UAAU;IACtB,cAAc,EAAE,cAAc;IAC9B,UAAU,EAAE,wBAAwB;IACpC,YAAY,EAAE,0CAA0C;IACxD,aAAa,EAAE,wBAAwB;IACvC,oBAAoB,EAAE,4BAA4B;IAClD,UAAU,EAAE,4DAA4D;IACxE,cAAc,EAAE,0BAA0B;IAC1C,eAAe,EAAE,yEAAyE;IAC1F,mBAAmB,EAAE,8BAA8B;IACnD,kBAAkB,EAAE,2BAA2B;IAC/C,cAAc,EAAE,kBAAkB;IAClC,aAAa,EAAE,6BAA6B;IAC5C,aAAa,EAAE,+BAA+B;IAC9C,YAAY,EAAE,iBAAiB;IAC/B,YAAY,EAAE,wBAAwB;IACtC,eAAe,EAAE,yCAAyC;IAC1D,SAAS,EAAE,+CAA+C;IAC1D,wBAAwB,EAAE,+EAA+E;IACzG,WAAW,EAAE,uCAAuC;IACpD,WAAW,EAAE,mCAAmC;IAChD,eAAe,EAAE,+BAA+B;IAChD,iBAAiB,EAAE,4CAA4C;IAC/D,aAAa,EAAE,iDAAiD;IAChE,YAAY,EAAE,6BAA6B;IAC3C,gBAAgB,EAAE,6BAA6B;IAC/C,cAAc,EAAE,uCAAuC;IACvD,eAAe,EAAE,4BAA4B;IAC7C,cAAc,EAAE,0CAA0C;IAC1D,qBAAqB,EAAE,wDAAwD;IAC/E,cAAc,EAAE,iDAAiD;IACjE,aAAa,EAAE,gCAAgC;IAC/C,4BAA4B,EAAE,oDAAoD;IAClF,+BAA+B,EAAE,wCAAwC;IACzE,aAAa,EAAE,yEAAyE;CAChF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { en } from './en.js';
2
+ export declare const it: Record<keyof typeof en, string>;
3
+ //# sourceMappingURL=it.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"it.d.ts","sourceRoot":"","sources":["../../src/messages/it.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAElC,eAAO,MAAM,EAAE,EAAE,MAAM,CAAC,MAAM,OAAO,EAAE,EAAE,MAAM,CA8C9C,CAAC"}
@@ -0,0 +1,48 @@
1
+ export const it = {
2
+ cliDescription: 'Installa o aggiorna un dispositivo edge WPT IoT',
3
+ helpUsage: 'Uso: create-wpt-iot [--mode local|remote] [--help] [--version]',
4
+ helpMode: ' --mode local|remote Salta soltanto la domanda sulla modalità',
5
+ helpHelp: ' --help Mostra questo aiuto',
6
+ helpVersion: ' --version Mostra la versione del pacchetto',
7
+ usageError: 'Argomenti non validi. Usa --help per vedere le opzioni supportate.',
8
+ modeQuestion: 'Dove vuoi installare WPT IoT?',
9
+ modeLocal: 'Su questo dispositivo Linux',
10
+ modeRemote: 'Su un dispositivo Linux remoto tramite SSH',
11
+ remoteHost: 'Nome host o indirizzo IP del dispositivo',
12
+ remotePort: 'Porta SSH',
13
+ remoteUsername: 'Nome utente SSH',
14
+ installDir: 'Directory di installazione',
15
+ deviceSerial: 'Seriale usato per wpt-<serial>.local',
16
+ adminPassword: 'Password iniziale amministratore',
17
+ adminPasswordConfirm: 'Conferma la password amministratore',
18
+ autoUpdate: 'Abilitare gli aggiornamenti automatici di backend e frontend ogni 5 minuti?',
19
+ confirmInstall: 'Procedere con questa installazione?',
20
+ existingInstall: 'Installazione esistente rilevata; credenziali e dati verranno conservati.',
21
+ remoteTargetSummary: 'Destinazione: {user}@{host}:{port}',
22
+ localTargetSummary: 'Destinazione: questo dispositivo Linux',
23
+ phasePreflight: 'Controlli preliminari',
24
+ phaseDownload: 'Download installer verificato',
25
+ phaseTransfer: 'Trasferimento configurazione protetta',
26
+ phaseInstall: 'Installazione WPT IoT',
27
+ phaseCleanup: 'Rimozione file temporanei',
28
+ installComplete: 'WPT IoT è operativo su https://wpt.local',
29
+ cancelled: 'Installazione annullata prima di apportare modifiche.',
30
+ unsupportedLocalPlatform: 'La modalità locale richiede Linux con apt e systemd. Da Windows usa la modalità remota.',
31
+ invalidHost: 'Inserisci un nome host o un indirizzo IP valido.',
32
+ invalidPort: 'Inserisci una porta compresa tra 1 e 65535.',
33
+ invalidUsername: 'Inserisci un nome utente Linux valido.',
34
+ invalidInstallDir: 'Inserisci un percorso Linux assoluto diverso da /.',
35
+ invalidSerial: 'Usa da 1 a 32 lettere minuscole, numeri o trattini.',
36
+ weakPassword: 'Usa almeno 12 caratteri.',
37
+ passwordMismatch: 'Le password non coincidono.',
38
+ missingCommand: 'Comando richiesto non trovato: {command}',
39
+ preflightFailed: 'Controlli preliminari non riusciti: {reason}',
40
+ checksumFailed: 'Verifica di integrità dell’installer non riuscita.',
41
+ insufficientDiskSpace: 'Sono richiesti almeno 12 GiB liberi sul disco del dispositivo.',
42
+ cleanupWarning: 'Avviso: non è stato possibile rimuovere un file temporaneo.',
43
+ cleanupFailed: 'Rimozione dei file temporanei non riuscita.',
44
+ invalidRemotePreflightOutput: 'Il controllo remoto ha restituito una risposta non valida.',
45
+ unsupportedRemoteClientPlatform: 'La modalità remota richiede Windows o Linux.',
46
+ installFailed: 'Installazione non riuscita durante: {phase}. È possibile eseguire nuovamente il wizard in sicurezza.',
47
+ };
48
+ //# sourceMappingURL=it.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"it.js","sourceRoot":"","sources":["../../src/messages/it.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,EAAE,GAAoC;IACjD,cAAc,EAAE,iDAAiD;IACjE,SAAS,EAAE,gEAAgE;IAC3E,QAAQ,EAAE,iEAAiE;IAC3E,QAAQ,EAAE,4CAA4C;IACtD,WAAW,EAAE,yDAAyD;IACtE,UAAU,EAAE,oEAAoE;IAChF,YAAY,EAAE,+BAA+B;IAC7C,SAAS,EAAE,6BAA6B;IACxC,UAAU,EAAE,4CAA4C;IACxD,UAAU,EAAE,0CAA0C;IACtD,UAAU,EAAE,WAAW;IACvB,cAAc,EAAE,iBAAiB;IACjC,UAAU,EAAE,4BAA4B;IACxC,YAAY,EAAE,sCAAsC;IACpD,aAAa,EAAE,kCAAkC;IACjD,oBAAoB,EAAE,qCAAqC;IAC3D,UAAU,EAAE,6EAA6E;IACzF,cAAc,EAAE,qCAAqC;IACrD,eAAe,EAAE,2EAA2E;IAC5F,mBAAmB,EAAE,oCAAoC;IACzD,kBAAkB,EAAE,wCAAwC;IAC5D,cAAc,EAAE,uBAAuB;IACvC,aAAa,EAAE,+BAA+B;IAC9C,aAAa,EAAE,uCAAuC;IACtD,YAAY,EAAE,uBAAuB;IACrC,YAAY,EAAE,2BAA2B;IACzC,eAAe,EAAE,0CAA0C;IAC3D,SAAS,EAAE,uDAAuD;IAClE,wBAAwB,EAAE,yFAAyF;IACnH,WAAW,EAAE,kDAAkD;IAC/D,WAAW,EAAE,6CAA6C;IAC1D,eAAe,EAAE,wCAAwC;IACzD,iBAAiB,EAAE,oDAAoD;IACvE,aAAa,EAAE,qDAAqD;IACpE,YAAY,EAAE,0BAA0B;IACxC,gBAAgB,EAAE,6BAA6B;IAC/C,cAAc,EAAE,0CAA0C;IAC1D,eAAe,EAAE,8CAA8C;IAC/D,cAAc,EAAE,oDAAoD;IACpE,qBAAqB,EAAE,gEAAgE;IACvF,cAAc,EAAE,6DAA6D;IAC7E,aAAa,EAAE,6CAA6C;IAC5D,4BAA4B,EAAE,4DAA4D;IAC1F,+BAA+B,EAAE,8CAA8C;IAC/E,aAAa,EAAE,sGAAsG;CACtH,CAAC"}
@@ -0,0 +1,5 @@
1
+ export type SupportedArchitecture = 'arm64' | 'amd64';
2
+ export declare const MINIMUM_DISK_KB: number;
3
+ export declare function normalizeArchitecture(raw: string): SupportedArchitecture;
4
+ export declare function assertSufficientDiskSpace(raw: string): number;
5
+ //# sourceMappingURL=preflight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preflight.d.ts","sourceRoot":"","sources":["../src/preflight.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,OAAO,CAAC;AACtD,eAAO,MAAM,eAAe,QAAmB,CAAC;AAEhD,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,qBAAqB,CAYxE;AAED,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAQ7D"}
@@ -0,0 +1,25 @@
1
+ export const MINIMUM_DISK_KB = 12 * 1024 * 1024;
2
+ export function normalizeArchitecture(raw) {
3
+ const architecture = raw.trim().toLowerCase();
4
+ switch (architecture) {
5
+ case 'aarch64':
6
+ case 'arm64':
7
+ return 'arm64';
8
+ case 'x86_64':
9
+ case 'amd64':
10
+ return 'amd64';
11
+ default:
12
+ throw new Error(`unsupportedArchitecture:${architecture}`);
13
+ }
14
+ }
15
+ export function assertSufficientDiskSpace(raw) {
16
+ const value = raw.trim();
17
+ if (!/^\d+$/.test(value))
18
+ throw new Error('invalidDiskAvailability');
19
+ const availableDiskKb = Number(value);
20
+ if (!Number.isSafeInteger(availableDiskKb) || availableDiskKb < MINIMUM_DISK_KB) {
21
+ throw new Error(`insufficientDiskSpace:${value}`);
22
+ }
23
+ return availableDiskKb;
24
+ }
25
+ //# sourceMappingURL=preflight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preflight.js","sourceRoot":"","sources":["../src/preflight.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAEhD,MAAM,UAAU,qBAAqB,CAAC,GAAW;IAC/C,MAAM,YAAY,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC9C,QAAQ,YAAY,EAAE,CAAC;QACrB,KAAK,SAAS,CAAC;QACf,KAAK,OAAO;YACV,OAAO,OAAO,CAAC;QACjB,KAAK,QAAQ,CAAC;QACd,KAAK,OAAO;YACV,OAAO,OAAO,CAAC;QACjB;YACE,MAAM,IAAI,KAAK,CAAC,2BAA2B,YAAY,EAAE,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,GAAW;IACnD,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IACzB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACrE,MAAM,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IACtC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,eAAe,CAAC,IAAI,eAAe,GAAG,eAAe,EAAE,CAAC;QAChF,MAAM,IAAI,KAAK,CAAC,yBAAyB,KAAK,EAAE,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,eAAe,CAAC;AACzB,CAAC"}
@@ -0,0 +1,39 @@
1
+ export type RedactionValue = string | undefined;
2
+ export type OutputSink = (chunk: string) => void;
3
+ export interface ProcessRunnerOutput {
4
+ stdout?: OutputSink;
5
+ stderr?: OutputSink;
6
+ }
7
+ export interface ProcessRunOptions {
8
+ cwd?: string;
9
+ env?: Readonly<Record<string, string | undefined>>;
10
+ redactions?: readonly RedactionValue[];
11
+ terminal?: boolean;
12
+ }
13
+ export interface ProcessResult {
14
+ stdout: string;
15
+ stderr: string;
16
+ exitCode: number;
17
+ }
18
+ export interface CommandRunner {
19
+ run(command: string, args?: readonly string[], options?: ProcessRunOptions): Promise<ProcessResult>;
20
+ }
21
+ export interface InputCommandRunner extends CommandRunner {
22
+ runWithInput(command: string, args: readonly string[], input: string, options?: ProcessRunOptions): Promise<ProcessResult>;
23
+ }
24
+ export declare function redactText(text: string, values?: readonly RedactionValue[]): string;
25
+ export declare class ProcessExecutionError extends Error {
26
+ readonly exitCode: number;
27
+ readonly stdout: string;
28
+ readonly stderr: string;
29
+ constructor(command: string, exitCode: number, stdout: string, stderr: string);
30
+ }
31
+ export declare class ProcessRunner implements InputCommandRunner {
32
+ private readonly stdout;
33
+ private readonly stderr;
34
+ constructor(output?: ProcessRunnerOutput);
35
+ run(command: string, args?: readonly string[], options?: ProcessRunOptions): Promise<ProcessResult>;
36
+ runWithInput(command: string, args: readonly string[], input: string, options?: ProcessRunOptions): Promise<ProcessResult>;
37
+ private execute;
38
+ }
39
+ //# sourceMappingURL=process.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../src/process.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,SAAS,CAAC;AAChD,MAAM,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;AAEjD,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IACnD,UAAU,CAAC,EAAE,SAAS,cAAc,EAAE,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CACrG;AAED,MAAM,WAAW,kBAAmB,SAAQ,aAAa;IACvD,YAAY,CACV,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,aAAa,CAAC,CAAC;CAC3B;AAOD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,SAAS,cAAc,EAAO,GAAG,MAAM,CAKvF;AAuDD,qBAAa,qBAAsB,SAAQ,KAAK;aAG5B,QAAQ,EAAE,MAAM;aAChB,MAAM,EAAE,MAAM;aACd,MAAM,EAAE,MAAM;gBAH9B,OAAO,EAAE,MAAM,EACC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM;CAKjC;AAED,qBAAa,aAAc,YAAW,kBAAkB;IACtD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAa;IACpC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAa;gBAExB,MAAM,GAAE,mBAAwB;IAKtC,GAAG,CACP,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,SAAS,MAAM,EAAO,EAC5B,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,aAAa,CAAC;IAInB,YAAY,CAChB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,aAAa,CAAC;YAIX,OAAO;CAgDtB"}
@@ -0,0 +1,115 @@
1
+ import { StringDecoder } from 'node:string_decoder';
2
+ import { execa } from 'execa';
3
+ const REDACTED = '[REDACTED]';
4
+ function normalizeRedactions(values = []) {
5
+ return [...new Set(values.filter((value) => Boolean(value)))]
6
+ .sort((left, right) => right.length - left.length);
7
+ }
8
+ export function redactText(text, values = []) {
9
+ return normalizeRedactions(values).reduce((redacted, value) => redacted.split(value).join(REDACTED), text);
10
+ }
11
+ class StreamingRedactor {
12
+ sink;
13
+ decoder = new StringDecoder('utf8');
14
+ secrets;
15
+ pending = '';
16
+ constructor(sink, values) {
17
+ this.sink = sink;
18
+ this.secrets = normalizeRedactions(values);
19
+ }
20
+ write(chunk) {
21
+ if (this.secrets.length === 0) {
22
+ this.sink(typeof chunk === 'string' ? chunk : this.decoder.write(chunk));
23
+ return;
24
+ }
25
+ this.pending += typeof chunk === 'string' ? chunk : this.decoder.write(chunk);
26
+ this.drain(false);
27
+ }
28
+ end() {
29
+ this.pending += this.decoder.end();
30
+ this.drain(true);
31
+ }
32
+ drain(final) {
33
+ let output = '';
34
+ while (this.pending.length > 0) {
35
+ const couldBecomeLongerSecret = this.secrets.some((secret) => secret.length > this.pending.length && secret.startsWith(this.pending));
36
+ if (!final && couldBecomeLongerSecret)
37
+ break;
38
+ const matchedSecret = this.secrets.find((secret) => this.pending.startsWith(secret));
39
+ if (matchedSecret) {
40
+ output += REDACTED;
41
+ this.pending = this.pending.slice(matchedSecret.length);
42
+ continue;
43
+ }
44
+ const couldBecomeSecret = this.secrets.some((secret) => secret.startsWith(this.pending));
45
+ if (!final && couldBecomeSecret)
46
+ break;
47
+ output += this.pending[0];
48
+ this.pending = this.pending.slice(1);
49
+ }
50
+ if (output)
51
+ this.sink(output);
52
+ }
53
+ }
54
+ export class ProcessExecutionError extends Error {
55
+ exitCode;
56
+ stdout;
57
+ stderr;
58
+ constructor(command, exitCode, stdout, stderr) {
59
+ super(`${command} exited with code ${exitCode}`);
60
+ this.exitCode = exitCode;
61
+ this.stdout = stdout;
62
+ this.stderr = stderr;
63
+ this.name = 'ProcessExecutionError';
64
+ }
65
+ }
66
+ export class ProcessRunner {
67
+ stdout;
68
+ stderr;
69
+ constructor(output = {}) {
70
+ this.stdout = output.stdout ?? ((chunk) => process.stdout.write(chunk));
71
+ this.stderr = output.stderr ?? ((chunk) => process.stderr.write(chunk));
72
+ }
73
+ async run(command, args = [], options = {}) {
74
+ return this.execute(command, args, undefined, options);
75
+ }
76
+ async runWithInput(command, args, input, options = {}) {
77
+ return this.execute(command, args, input, options);
78
+ }
79
+ async execute(command, args, input, options) {
80
+ if (input !== undefined && options.terminal) {
81
+ throw new Error('interactiveInputConflict');
82
+ }
83
+ const redactions = options.redactions ?? [];
84
+ const stdout = new StreamingRedactor(this.stdout, redactions);
85
+ const stderr = new StreamingRedactor(this.stderr, redactions);
86
+ const subprocess = execa(command, [...args], {
87
+ cwd: options.cwd,
88
+ env: options.env,
89
+ reject: false,
90
+ encoding: 'utf8',
91
+ ...(options.terminal ? { stdin: 'inherit', stderr: 'inherit' } : {}),
92
+ ...(input === undefined ? {} : { input }),
93
+ });
94
+ subprocess.stdout?.on('data', (chunk) => stdout.write(chunk));
95
+ subprocess.stderr?.on('data', (chunk) => stderr.write(chunk));
96
+ try {
97
+ const result = await subprocess;
98
+ const capturedStderr = typeof result.stderr === 'string' ? result.stderr : '';
99
+ const processResult = {
100
+ stdout: redactText(result.stdout, redactions),
101
+ stderr: redactText(capturedStderr, redactions),
102
+ exitCode: result.exitCode ?? 1,
103
+ };
104
+ if (processResult.exitCode !== 0) {
105
+ throw new ProcessExecutionError(command, processResult.exitCode, processResult.stdout, processResult.stderr);
106
+ }
107
+ return processResult;
108
+ }
109
+ finally {
110
+ stdout.end();
111
+ stderr.end();
112
+ }
113
+ }
114
+ }
115
+ //# sourceMappingURL=process.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process.js","sourceRoot":"","sources":["../src/process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAE9B,MAAM,QAAQ,GAAG,YAAY,CAAC;AAoC9B,SAAS,mBAAmB,CAAC,SAAoC,EAAE;IACjE,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAmB,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAC3E,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,SAAoC,EAAE;IAC7E,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAC,MAAM,CACvC,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC,QAAQ,CAA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a,CAAC,QAAQ,EACtB,aAAa,CAAC,MAAM,EACpB,aAAa,CAAC,MAAM,CACrB,CAAC;YACJ,CAAC;YAED,OAAO,aAAa,CAAC;QACvB,CAAC;gBAAS,CAAC;YACT,MAAM,CAAC,GAAG,EAAE,CAAC;YACb,MAAM,CAAC,GAAG,EAAE,CAAC;QACf,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,36 @@
1
+ import type { Translator } from './i18n.js';
2
+ import type { InstallMode, InstallSettings, PreflightResult, RemoteTarget } from './types.js';
3
+ export interface SelectOptions {
4
+ message: string;
5
+ choices: readonly {
6
+ name: string;
7
+ value: string;
8
+ }[];
9
+ }
10
+ export interface InputOptions {
11
+ message: string;
12
+ default?: string;
13
+ }
14
+ export interface PasswordOptions {
15
+ message: string;
16
+ mask: string;
17
+ }
18
+ export interface ConfirmOptions {
19
+ message: string;
20
+ default: boolean;
21
+ }
22
+ export interface PromptPort {
23
+ select(options: SelectOptions): Promise<string>;
24
+ input(options: InputOptions): Promise<string>;
25
+ password(options: PasswordOptions): Promise<string>;
26
+ confirm(options: ConfirmOptions): Promise<boolean>;
27
+ }
28
+ export declare const inquirerPrompt: PromptPort;
29
+ export interface TargetSelection {
30
+ mode: InstallMode;
31
+ installDir: string;
32
+ remote?: RemoteTarget;
33
+ }
34
+ export declare function collectTarget(prompt: PromptPort, t: Translator, requestedMode?: InstallMode): Promise<TargetSelection>;
35
+ export declare function collectSettings(prompt: PromptPort, t: Translator, preflight: PreflightResult, installDir: string): Promise<InstallSettings | null>;
36
+ //# sourceMappingURL=prompts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EACf,eAAe,EACf,YAAY,EACb,MAAM,YAAY,CAAC;AAWpB,MAAM,WAAW,aAAa;IA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{ confirm, input, password, select } from '@inquirer/prompts';
2
+ import { confirmAdminPassword, validateAdminPassword, validateDeviceSerial, validateHost, validateInstallDir, validatePort, validateUsername, } from './validation.js';
3
+ export const inquirerPrompt = {
4
+ select: (options) => select({ message: options.message, choices: [...options.choices] }),
5
+ input: (options) => input(options),
6
+ password: (options) => password(options),
7
+ confirm: (options) => confirm(options),
8
+ };
9
+ export async function collectTarget(prompt, t, requestedMode) {
10
+ const mode = requestedMode ?? await prompt.select({
11
+ message: t('modeQuestion'),
12
+ choices: [
13
+ { name: t('modeLocal'), value: 'local' },
14
+ { name: t('modeRemote'), value: 'remote' },
15
+ ],
16
+ });
17
+ let remote;
18
+ if (mode === 'remote') {
19
+ remote = {
20
+ host: validateHost(await prompt.input({ message: t('remoteHost') })),
21
+ port: validatePort(await prompt.input({ message: t('remotePort'), default: '22' })),
22
+ username: validateUsername(await prompt.input({ message: t('remoteUsername'), default: 'pi' })),
23
+ };
24
+ }
25
+ const installDir = validateInstallDir(await prompt.input({
26
+ message: t('installDir'),
27
+ default: '/opt/wpt-iot',
28
+ }));
29
+ return remote ? { mode, installDir, remote } : { mode, installDir };
30
+ }
31
+ export async function collectSettings(prompt, t, preflight, installDir) {
32
+ const deviceSerial = validateDeviceSerial(await prompt.input({
33
+ message: t('deviceSerial'),
34
+ default: preflight.detectedSerial,
35
+ }));
36
+ let adminPassword;
37
+ if (!preflight.existingInstall) {
38
+ const passwordValue = validateAdminPassword(await prompt.password({
39
+ message: t('adminPassword'),
40
+ mask: '*',
41
+ }));
42
+ const confirmation = await prompt.password({
43
+ message: t('adminPasswordConfirm'),
44
+ mask: '*',
45
+ });
46
+ adminPassword = confirmAdminPassword(passwordValue, confirmation);
47
+ }
48
+ const enableAutoUpdate = await prompt.confirm({
49
+ message: t('autoUpdate'),
50
+ default: true,
51
+ });
52
+ const confirmed = await prompt.confirm({
53
+ message: t('confirmInstall'),
54
+ default: true,
55
+ });
56
+ if (!confirmed)
57
+ return null;
58
+ return {
59
+ installDir,
60
+ deviceSerial,
61
+ enableAutoUpdate,
62
+ ...(adminPassword === undefined ? {} : { adminPassword }),
63
+ };
64
+ }
65
+ //# sourceMappingURL=prompts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AASrE,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AA6BzB,MAAM,CAAC,MAAM,cAAc,GAAe;IACxC,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;IACxF,KAAK,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC;IAClC,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;IACxC,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;CACvC,CAAC;AAQF,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,MAAkB,EAClB,CAAa,EACb,aAA2B;IAE3B,MAAM,IAAI,GAAG,aAAa,IAAI,MAAM,MAAM,CAAC,MAAM,CAAC;QAChD,OAAO,EAAE,CAAC,CAAC,cAAc,CAAC;QAC1B,OAAO,EAAE;YACP,EAAE,IAAI,EAAE,CAAC,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE;YACxC,EAAE,IAAI,EAAE,CAAC,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE;SAC3C;KACF,CAAgB,CAA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AC;YAChE,OAAO,EAAE,CAAC,CAAC,eAAe,CAAC;YAC3B,IAAI,EAAE,GAAG;SACV,CAAC,CAAC,CAAC;QACJ,MAAM,YAAY,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC;YACzC,OAAO,EAAE,CAAC,CAAC,sBAAsB,CAAC;YAClC,IAAI,EAAE,GAAG;SACV,CAAC,CAAC;QACH,aAAa,GAAG,oBAAoB,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;IACpE,CAAC;IAED,MAAM,gBAAgB,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QAC5C,OAAO,EAAE,CAAC,CAAC,YAAY,CAAC;QACxB,OAAO,EAAE,IAAI;KACd,CAAC,CAAC;IACH,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QACrC,OAAO,EAAE,CAAC,CAAC,gBAAgB,CAAC;QAC5B,OAAO,EAAE,IAAI;KACd,CAAC,CAAC;IAEH,IAAI,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAE5B,OAAO;QACL,UAAU;QACV,YAAY;QACZ,gBAAgB;QAChB,GAAG,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC;KAC1D,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { TemporaryFile } from './config-file.js';
2
+ import type { InputCommandRunner } from './process.js';
3
+ import type { InstallSettings, PreflightResult, RemoteTarget } from './types.js';
4
+ export type WarningSink = (message: string) => void;
5
+ export declare function sshDestination(target: RemoteTarget): string;
6
+ export declare function preflightRemote(runner: InputCommandRunner, target: RemoteTarget, installDir: string, platform?: NodeJS.Platform): Promise<PreflightResult>;
7
+ export declare function installRemote(runner: InputCommandRunner, target: RemoteTarget, artifact: TemporaryFile, config: TemporaryFile, settings: InstallSettings, remoteId?: string, warn?: WarningSink, tempRoot?: string): Promise<void>;
8
+ //# sourceMappingURL=remote.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../src/remote.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAwEjF,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;AA+CpD,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAI3D;AAqCD,wBAAsB,eAAe,CACnC,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,MAAM,EAClB,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAC3C,OAAO,CAAC,eAAe,CAAC,CA2B1B;AAED,wBAAsB,aAAa,CACjC,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,eAAe,EACzB,QAAQ,GAAE,MAAqB,EAC/B,IAAI,GAAE,WAA+D,EACrE,QAAQ,SAAW,GAClB,OAAO,CAAC,IAAI,CAAC,CAgEf"}