create-aura-appliance 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 (63) hide show
  1. package/README.md +42 -0
  2. package/dist/bin.d.ts +3 -0
  3. package/dist/bin.d.ts.map +1 -0
  4. package/dist/bin.js +5 -0
  5. package/dist/bin.js.map +1 -0
  6. package/dist/cli.d.ts +30 -0
  7. package/dist/cli.d.ts.map +1 -0
  8. package/dist/cli.js +200 -0
  9. package/dist/cli.js.map +1 -0
  10. package/dist/config-file.d.ts +12 -0
  11. package/dist/config-file.d.ts.map +1 -0
  12. package/dist/config-file.js +50 -0
  13. package/dist/config-file.js.map +1 -0
  14. package/dist/i18n.d.ts +7 -0
  15. package/dist/i18n.d.ts.map +1 -0
  16. package/dist/i18n.js +10 -0
  17. package/dist/i18n.js.map +1 -0
  18. package/dist/local.d.ts +7 -0
  19. package/dist/local.d.ts.map +1 -0
  20. package/dist/local.js +110 -0
  21. package/dist/local.js.map +1 -0
  22. package/dist/messages/en.d.ts +61 -0
  23. package/dist/messages/en.d.ts.map +1 -0
  24. package/dist/messages/en.js +61 -0
  25. package/dist/messages/en.js.map +1 -0
  26. package/dist/messages/it.d.ts +3 -0
  27. package/dist/messages/it.d.ts.map +1 -0
  28. package/dist/messages/it.js +61 -0
  29. package/dist/messages/it.js.map +1 -0
  30. package/dist/modelroute.d.ts +20 -0
  31. package/dist/modelroute.d.ts.map +1 -0
  32. package/dist/modelroute.js +67 -0
  33. package/dist/modelroute.js.map +1 -0
  34. package/dist/preflight-floors.d.ts +4 -0
  35. package/dist/preflight-floors.d.ts.map +1 -0
  36. package/dist/preflight-floors.js +9 -0
  37. package/dist/preflight-floors.js.map +1 -0
  38. package/dist/preflight.d.ts +8 -0
  39. package/dist/preflight.d.ts.map +1 -0
  40. package/dist/preflight.js +53 -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 +37 -0
  47. package/dist/prompts.d.ts.map +1 -0
  48. package/dist/prompts.js +123 -0
  49. package/dist/prompts.js.map +1 -0
  50. package/dist/remote.d.ts +10 -0
  51. package/dist/remote.d.ts.map +1 -0
  52. package/dist/remote.js +268 -0
  53. package/dist/remote.js.map +1 -0
  54. package/dist/types.d.ts +23 -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 +88 -0
  61. package/dist/validation.js.map +1 -0
  62. package/install-appliance.run +908 -1
  63. package/package.json +45 -0
@@ -0,0 +1,61 @@
1
+ export const en = {
2
+ cliDescription: 'Install or update the Aura appliance, locally or over SSH',
3
+ helpUsage: 'Usage: create-aura [--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 Aura?',
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
+ confirmInstall: 'Apply this installation?',
16
+ existingInstall: 'Existing installation detected; configuration and data will be preserved.',
17
+ remoteTargetSummary: 'Target: {user}@{host}:{port}',
18
+ localTargetSummary: 'Target: this Linux device',
19
+ phasePreflight: 'Preflight checks',
20
+ phaseTransfer: 'Transfer secure configuration',
21
+ phaseInstall: 'Install Aura',
22
+ phaseCleanup: 'Remove temporary files',
23
+ installComplete: 'Aura is starting.',
24
+ cancelled: 'Installation cancelled before making changes.',
25
+ unsupportedLocalPlatform: 'Local mode requires Linux or macOS with Docker. Use remote mode otherwise.',
26
+ installerArtifactMissing: 'The bundled installer artifact is missing from this package.',
27
+ invalidHost: 'Enter a valid hostname or IP address.',
28
+ invalidPort: 'Enter a port between 1 and 65535.',
29
+ invalidUsername: 'Enter a valid Linux username.',
30
+ invalidInstallDir: 'Enter an absolute Linux path other than /.',
31
+ invalidBaseUrl: 'Enter a valid http or https URL.',
32
+ invalidModelId: 'Enter a valid model identifier.',
33
+ missingCommand: 'Required command not found: {command}',
34
+ preflightFailed: 'Preflight failed: {reason}',
35
+ insufficientDiskSpace: 'Not enough free disk space on the installation target.',
36
+ unsupportedArchitecture: 'This CPU architecture is not supported by Aura.',
37
+ invalidDiskAvailability: 'Could not determine the available disk space on the installation target.',
38
+ invalidCpuCount: 'Could not determine the number of CPU cores on the installation target.',
39
+ insufficientCpuCores: 'Not enough CPU cores on the installation target.',
40
+ invalidMemoryAvailability: 'Could not determine the available memory on the installation target.',
41
+ insufficientMemory: 'Not enough memory on the installation target.',
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
+ applianceQuestion: 'Install as a self-starting appliance (systemd service that starts Aura on boot)?',
48
+ gvisorQuestion: 'Enable gVisor sandboxing for stronger container isolation (Linux with a Debian/Ubuntu package manager only)?',
49
+ modelRouteQuestion: 'Which model route should Aura use?',
50
+ modelRouteOpenrouter: 'OpenRouter (cloud API)',
51
+ modelRouteOllama: 'Ollama (local or remote server)',
52
+ openrouterBaseUrl: 'OpenRouter API base URL',
53
+ openrouterApiKey: 'OpenRouter API key',
54
+ openrouterModel: 'OpenRouter model id (e.g. vendor/model-name)',
55
+ ollamaBaseUrl: 'Ollama base URL',
56
+ ollamaModelSelect: 'Choose an installed Ollama model',
57
+ ollamaModelManualEntry: 'Enter the Ollama model id to use',
58
+ ollamaModelUnreachable: 'Could not reach that Ollama endpoint from here. Enter the model id you want to use',
59
+ gpuQuestion: 'Does the target machine have an NVIDIA GPU you want to use for embeddings?',
60
+ };
61
+ //# 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,2DAA2D;IAC3E,SAAS,EAAE,+DAA+D;IAC1E,QAAQ,EAAE,iEAAiE;IAC3E,QAAQ,EAAE,uCAAuC;IACjD,WAAW,EAAE,iDAAiD;IAC9D,UAAU,EAAE,6DAA6D;IACzE,YAAY,EAAE,oCAAoC;IAClD,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,cAAc,EAAE,0BAA0B;IAC1C,eAAe,EAAE,2EAA2E;IAC5F,mBAAmB,EAAE,8BAA8B;IACnD,kBAAkB,EAAE,2BAA2B;IAC/C,cAAc,EAAE,kBAAkB;IAClC,aAAa,EAAE,+BAA+B;IAC9C,YAAY,EAAE,cAAc;IAC5B,YAAY,EAAE,wBAAwB;IACtC,eAAe,EAAE,mBAAmB;IACpC,SAAS,EAAE,+CAA+C;IAC1D,wBAAwB,EAAE,4EAA4E;IACtG,wBAAwB,EAAE,8DAA8D;IACxF,WAAW,EAAE,uCAAuC;IACpD,WAAW,EAAE,mCAAmC;IAChD,eAAe,EAAE,+BAA+B;IAChD,iBAAiB,EAAE,4CAA4C;IAC/D,cAAc,EAAE,kCAAkC;IAClD,cAAc,EAAE,iCAAiC;IACjD,cAAc,EAAE,uCAAuC;IACvD,eAAe,EAAE,4BAA4B;IAC7C,qBAAqB,EAAE,wDAAwD;IAC/E,uBAAuB,EAAE,iDAAiD;IAC1E,uBAAuB,EAAE,0EAA0E;IACnG,eAAe,EAAE,yEAAyE;IAC1F,oBAAoB,EAAE,kDAAkD;IACxE,yBAAyB,EAAE,sEAAsE;IACjG,kBAAkB,EAAE,+CAA+C;IACnE,cAAc,EAAE,iDAAiD;IACjE,aAAa,EAAE,gCAAgC;IAC/C,4BAA4B,EAAE,oDAAoD;IAClF,+BAA+B,EAAE,wCAAwC;IACzE,aAAa,EAAE,yEAAyE;IACxF,iBAAiB,EAAE,kFAAkF;IACrG,cAAc,EAAE,8GAA8G;IAC9H,kBAAkB,EAAE,oCAAoC;IACxD,oBAAoB,EAAE,wBAAwB;IAC9C,gBAAgB,EAAE,iCAAiC;IACnD,iBAAiB,EAAE,yBAAyB;IAC5C,gBAAgB,EAAE,oBAAoB;IACtC,eAAe,EAAE,8CAA8C;IAC/D,aAAa,EAAE,iBAAiB;IAChC,iBAAiB,EAAE,kCAAkC;IACrD,sBAAsB,EAAE,kCAAkC;IAC1D,sBAAsB,EAAE,oFAAoF;IAC5G,WAAW,EAAE,4EAA4E;CACjF,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,CA2D9C,CAAC"}
@@ -0,0 +1,61 @@
1
+ export const it = {
2
+ cliDescription: 'Installa o aggiorna l’appliance Aura, in locale o via SSH',
3
+ helpUsage: 'Uso: create-aura [--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 Aura?',
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
+ confirmInstall: 'Procedere con questa installazione?',
16
+ existingInstall: 'Installazione esistente rilevata; configurazione e dati verranno conservati.',
17
+ remoteTargetSummary: 'Destinazione: {user}@{host}:{port}',
18
+ localTargetSummary: 'Destinazione: questo dispositivo Linux',
19
+ phasePreflight: 'Controlli preliminari',
20
+ phaseTransfer: 'Trasferimento configurazione protetta',
21
+ phaseInstall: 'Installazione Aura',
22
+ phaseCleanup: 'Rimozione file temporanei',
23
+ installComplete: 'Aura si sta avviando.',
24
+ cancelled: 'Installazione annullata prima di apportare modifiche.',
25
+ unsupportedLocalPlatform: 'La modalità locale richiede Linux o macOS con Docker. Altrimenti usa la modalità remota.',
26
+ installerArtifactMissing: 'Il pacchetto di installazione integrato manca da questo pacchetto npm.',
27
+ invalidHost: 'Inserisci un nome host o un indirizzo IP valido.',
28
+ invalidPort: 'Inserisci una porta compresa tra 1 e 65535.',
29
+ invalidUsername: 'Inserisci un nome utente Linux valido.',
30
+ invalidInstallDir: 'Inserisci un percorso Linux assoluto diverso da /.',
31
+ invalidBaseUrl: 'Inserisci un URL http o https valido.',
32
+ invalidModelId: 'Inserisci un identificativo di modello valido.',
33
+ missingCommand: 'Comando richiesto non trovato: {command}',
34
+ preflightFailed: 'Controlli preliminari non riusciti: {reason}',
35
+ insufficientDiskSpace: 'Spazio libero su disco insufficiente sulla destinazione di installazione.',
36
+ unsupportedArchitecture: 'Questa architettura del processore non è supportata da Aura.',
37
+ invalidDiskAvailability: 'Impossibile determinare lo spazio su disco disponibile sulla destinazione di installazione.',
38
+ invalidCpuCount: 'Impossibile determinare il numero di core CPU sulla destinazione di installazione.',
39
+ insufficientCpuCores: 'Numero di core CPU insufficiente sulla destinazione di installazione.',
40
+ invalidMemoryAvailability: 'Impossibile determinare la memoria disponibile sulla destinazione di installazione.',
41
+ insufficientMemory: 'Memoria insufficiente sulla destinazione di installazione.',
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
+ applianceQuestion: 'Installare come appliance auto-avviante (servizio systemd che avvia Aura all’accensione)?',
48
+ gvisorQuestion: 'Abilitare la sandbox gVisor per un isolamento più forte dei container (solo Linux con gestore pacchetti Debian/Ubuntu)?',
49
+ modelRouteQuestion: 'Quale motore per il modello deve usare Aura?',
50
+ modelRouteOpenrouter: 'OpenRouter (API cloud)',
51
+ modelRouteOllama: 'Ollama (server locale o remoto)',
52
+ openrouterBaseUrl: 'URL base dell’API OpenRouter',
53
+ openrouterApiKey: 'Chiave API OpenRouter',
54
+ openrouterModel: 'Identificativo del modello OpenRouter (es. fornitore/nome-modello)',
55
+ ollamaBaseUrl: 'URL base di Ollama',
56
+ ollamaModelSelect: 'Scegli un modello Ollama installato',
57
+ ollamaModelManualEntry: 'Inserisci l’identificativo del modello Ollama da usare',
58
+ ollamaModelUnreachable: 'Non è stato possibile raggiungere quell’endpoint Ollama da qui. Inserisci l’identificativo del modello che vuoi usare',
59
+ gpuQuestion: 'La macchina di destinazione dispone di una GPU NVIDIA da usare per gli embedding?',
60
+ };
61
+ //# 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,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aAAa,EAAE,sGAAsG;IACrH,iBAAiB,EAAE,2FAA2F;IAC9G,cAAc,EAAE,yHAAyH;IACzI,kBAAkB,EAAE,8CAA8C;IAClE,oBAAoB,EAAE,wBAAwB;IAC9C,gBAAgB,EAAE,iCAAiC;IACnD,iBAAiB,EAAE,8BAA8B;IACjD,gBAAgB,EAAE,uBAAuB;IACzC,eAAe,EAAE,oEAAoE;IACrF,aAAa,EAAE,oBAAoB;IACnC,iBAAiB,EAAE,qCAAqC;IACxD,sBAAsB,EAAE,wDAAwD;IAChF,sBAAsB,EAAE,uHAAuH;IAC/I,WAAW,EAAE,mFAAmF;CACjG,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { CommandRunner } from './process.js';
2
+ export declare const CUDA_EMBED_IMAGE = "ghcr.io/ggml-org/llama.cpp:server-cuda";
3
+ export declare const CPU_EMBED_IMAGE = "ghcr.io/ggml-org/llama.cpp:server";
4
+ export interface GpuProbeResult {
5
+ cuda: boolean;
6
+ embedImage: string;
7
+ embedNgl: string;
8
+ }
9
+ export interface EmbedTarget {
10
+ embedImage: string;
11
+ embedNgl: string;
12
+ }
13
+ export declare function embedTargetFor(cuda: boolean): EmbedTarget;
14
+ export interface OllamaProbeResult {
15
+ reachable: boolean;
16
+ models: string[];
17
+ }
18
+ export declare function probeGpu(runner: CommandRunner): Promise<GpuProbeResult>;
19
+ export declare function probeOllama(runner: CommandRunner, url: string): Promise<OllamaProbeResult>;
20
+ //# sourceMappingURL=modelroute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modelroute.d.ts","sourceRoot":"","sources":["../src/modelroute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAMlD,eAAO,MAAM,gBAAgB,2CAA2C,CAAC;AACzE,eAAO,MAAM,eAAe,sCAAsC,CAAC;AAEnE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAMD,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,WAAW,CAIzD;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAYD,wBAAsB,QAAQ,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,CAO7E;AAsBD,wBAAsB,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAehG"}
@@ -0,0 +1,67 @@
1
+ // compose.yaml:752 / :781 default AURA_EMBED_IMAGE and AURA_EMBED_NGL to this pair when a
2
+ // GPU is present; .github/workflows/ci.yml:754-755 pins the CPU pair used when it is not.
3
+ // embedNgl is a string, not a number: it reaches .env as text and serializeInstallConfig
4
+ // (config-file.ts) base64s it as text.
5
+ export const CUDA_EMBED_IMAGE = 'ghcr.io/ggml-org/llama.cpp:server-cuda';
6
+ export const CPU_EMBED_IMAGE = 'ghcr.io/ggml-org/llama.cpp:server';
7
+ // F4 (review round 1): probeGpu below and prompts.ts's collectGpuChoice (the R1 yes/no
8
+ // fallback asked when no runner can probe the actual install target) each independently
9
+ // encoded "cuda -> CUDA image + '99', otherwise CPU image + '0'". A single exported mapping
10
+ // is the only way changing one can no longer silently leave the other disagreeing.
11
+ export function embedTargetFor(cuda) {
12
+ return cuda
13
+ ? { embedImage: CUDA_EMBED_IMAGE, embedNgl: '99' }
14
+ : { embedImage: CPU_EMBED_IMAGE, embedNgl: '0' };
15
+ }
16
+ // compose.yaml:801-817 reserves `driver: nvidia` unconditionally for every install, so
17
+ // whether the NVIDIA *container* toolkit is present decides whether `docker compose up`
18
+ // succeeds at all -- this wizard's image choice cannot influence that either way. Choosing
19
+ // between the two llama.cpp images only decides whether a working GPU gets *used*;
20
+ // compose.yaml:807-809 documents what happens when it is not: the CUDA image starts anyway
21
+ // and silently falls back to CPU ("no usable GPU found" is a warning, not an error). So
22
+ // guessing wrong here costs speed, not a failed install, and one host nvidia-smi call is the
23
+ // right size for that stake. CommandRunner.run rejects rather than returning a non-zero
24
+ // exitCode (process.ts's ProcessRunner.execute), so an absent binary reaches this function as
25
+ // a rejected promise, never as a result to branch on.
26
+ export async function probeGpu(runner) {
27
+ try {
28
+ await runner.run('nvidia-smi');
29
+ return { cuda: true, ...embedTargetFor(true) };
30
+ }
31
+ catch {
32
+ return { cuda: false, ...embedTargetFor(false) };
33
+ }
34
+ }
35
+ // The operator types the OpenAI-compatible base URL (it becomes AURA_LLM_BASE_URL), but
36
+ // Ollama's model list lives at /api/tags on the root, not under /v1.
37
+ function tagsUrlFor(baseUrl) {
38
+ return `${baseUrl.replace(/\/v1\/?$/, '')}/api/tags`;
39
+ }
40
+ // Aura runs the probed endpoint from inside a container, and an Ollama on the host is not
41
+ // at 127.0.0.1 as seen from there (project memory: "Hyper-V port forwarding lies -- probe
42
+ // via docker network, not 127.0.0.1"). create-aura itself runs BEFORE install.sh though, so
43
+ // the aura_default compose network does not exist yet and --network aura_default would fail
44
+ // on every fresh host. This mirrors the working host-reachability probe at
45
+ // scripts/ingest_media_e2e.sh:27-28 instead: default bridge network plus --add-host
46
+ // host.docker.internal:host-gateway, which is load-bearing on Linux where that name does not
47
+ // resolve without it. alpine is the probe image because scripts/install.sh:393 already runs
48
+ // `docker run --rm --volumes-from ... alpine`, so this installer already requires a host able
49
+ // to pull it -- a second image would only add a failure mode.
50
+ export async function probeOllama(runner, url) {
51
+ const tagsUrl = tagsUrlFor(url);
52
+ try {
53
+ const result = await runner.run('docker', [
54
+ 'run', '--rm', '--add-host', 'host.docker.internal:host-gateway', 'alpine',
55
+ 'wget', '-qO-', '--timeout=5', tagsUrl,
56
+ ]);
57
+ const parsed = JSON.parse(result.stdout);
58
+ const models = (parsed.models ?? [])
59
+ .map((model) => model.name)
60
+ .filter((name) => typeof name === 'string');
61
+ return { reachable: true, models };
62
+ }
63
+ catch {
64
+ return { reachable: false, models: [] };
65
+ }
66
+ }
67
+ //# sourceMappingURL=modelroute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modelroute.js","sourceRoot":"","sources":["../src/modelroute.ts"],"names":[],"mappings":"AAEA,0FAA0F;AAC1F,0FAA0F;AAC1F,yFAAyF;AACzF,uCAAuC;AACvC,MAAM,CAAC,MAAM,gBAAgB,GAAG,wCAAwC,CAAC;AACzE,MAAM,CAAC,MAAM,eAAe,GAAG,mCAAmC,CAAC;AAanE,uFAAuF;AACvF,wFAAwF;AACxF,4FAA4F;AAC5F,mFAAmF;AACnF,MAAM,UAAU,cAAc,CAAC,IAAa;IAC1C,OAAO,IAAI;QACT,CAAC,CAAC,EAAE,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,IAAI,EAAE;QAClD,CAAC,CAAC,EAAE,UAAU,EAAE,eAAe,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;AACrD,CAAC;AAOD,uFAAuF;AACvF,wFAAwF;AACxF,2FAA2F;AAC3F,mFAAmF;AACnF,2FAA2F;AAC3F,wFAAwF;AACxF,6FAA6F;AAC7F,wFAAwF;AACxF,8FAA8F;AAC9F,sDAAsD;AACtD,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,MAAqB;IAClD,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAC/B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;IACjD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;IACnD,CAAC;AACH,CAAC;AAMD,wFAAwF;AACxF,qEAAq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ourceMappingURL=preflight-floors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preflight-floors.d.ts","sourceRoot":"","sources":["../src/preflight-floors.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAC1C,eAAO,MAAM,eAAe,WAAW,CAAC"}
@@ -0,0 +1,9 @@
1
+ // GENERATED FILE -- do not edit by hand.
2
+ // Mirrored from scripts/install.sh by scripts/sync-preflight-floors.mjs, which is the only
3
+ // place allowed to write it. install.sh owns these floors because it must stay
4
+ // self-contained; see that script for why each number is what it is. Change them there,
5
+ // then run `npm run sync:floors`. `npm run build` refuses to build a stale mirror.
6
+ export const MINIMUM_CPU_CORES = 4;
7
+ export const MINIMUM_MEMORY_KB = 14680064; // 14 GiB
8
+ export const MINIMUM_DISK_KB = 20971520; // 20 GiB
9
+ //# sourceMappingURL=preflight-floors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preflight-floors.js","sourceRoot":"","sources":["../src/preflight-floors.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,2FAA2F;AAC3F,+EAA+E;AAC/E,wFAAwF;AACxF,mFAAmF;AACnF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AACnC,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAC,CAAC,SAAS;AACpD,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAC,CAAC,SAAS"}
@@ -0,0 +1,8 @@
1
+ import { MINIMUM_CPU_CORES, MINIMUM_DISK_KB, MINIMUM_MEMORY_KB } from './preflight-floors.js';
2
+ export { MINIMUM_CPU_CORES, MINIMUM_DISK_KB, MINIMUM_MEMORY_KB };
3
+ export type SupportedArchitecture = 'arm64' | 'amd64';
4
+ export declare function normalizeArchitecture(raw: string): SupportedArchitecture;
5
+ export declare function assertSufficientDiskSpace(raw: string): number;
6
+ export declare function assertSufficientCpuCores(raw: string): number;
7
+ export declare function assertSufficientMemory(raw: string): number;
8
+ //# sourceMappingURL=preflight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preflight.d.ts","sourceRoot":"","sources":["../src/preflight.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAS/B,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB,EAAE,CAAC;AAEjE,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,OAAO,CAAC;AAEtD,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,qBAAqB,CAYxE;AAED,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAQ7D;AAED,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAQ5D;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAQ1D"}
@@ -0,0 +1,53 @@
1
+ import { MINIMUM_CPU_CORES, MINIMUM_DISK_KB, MINIMUM_MEMORY_KB, } from './preflight-floors.js';
2
+ // The floors are deliberately NOT written here. scripts/install.sh owns them -- it has to,
3
+ // since preflight_hw runs before any download and `curl | bash` ships that one file -- and
4
+ // preflight-floors.ts is generated from it. This wizard has to refuse exactly what the
5
+ // installer it drives refuses: greenlighting a transfer install.sh then aborts is the whole
6
+ // failure mode these checks exist to prevent, and a hand-kept second copy of the numbers
7
+ // drifted the first time a floor moved. install.sh's warn_mem/warn_disk are still not
8
+ // mirrored, on purpose: blocking where the installer merely warns is worse than silence.
9
+ export { MINIMUM_CPU_CORES, MINIMUM_DISK_KB, MINIMUM_MEMORY_KB };
10
+ export function normalizeArchitecture(raw) {
11
+ const architecture = raw.trim().toLowerCase();
12
+ switch (architecture) {
13
+ case 'aarch64':
14
+ case 'arm64':
15
+ return 'arm64';
16
+ case 'x86_64':
17
+ case 'amd64':
18
+ return 'amd64';
19
+ default:
20
+ throw new Error(`unsupportedArchitecture:${architecture}`);
21
+ }
22
+ }
23
+ export function assertSufficientDiskSpace(raw) {
24
+ const value = raw.trim();
25
+ if (!/^\d+$/.test(value))
26
+ throw new Error('invalidDiskAvailability');
27
+ const availableDiskKb = Number(value);
28
+ if (!Number.isSafeInteger(availableDiskKb) || availableDiskKb < MINIMUM_DISK_KB) {
29
+ throw new Error(`insufficientDiskSpace:${value}`);
30
+ }
31
+ return availableDiskKb;
32
+ }
33
+ export function assertSufficientCpuCores(raw) {
34
+ const value = raw.trim();
35
+ if (!/^\d+$/.test(value))
36
+ throw new Error('invalidCpuCount');
37
+ const availableCpuCores = Number(value);
38
+ if (!Number.isSafeInteger(availableCpuCores) || availableCpuCores < MINIMUM_CPU_CORES) {
39
+ throw new Error(`insufficientCpuCores:${value}`);
40
+ }
41
+ return availableCpuCores;
42
+ }
43
+ export function assertSufficientMemory(raw) {
44
+ const value = raw.trim();
45
+ if (!/^\d+$/.test(value))
46
+ throw new Error('invalidMemoryAvailability');
47
+ const availableMemoryKb = Number(value);
48
+ if (!Number.isSafeInteger(availableMemoryKb) || availableMemoryKb < MINIMUM_MEMORY_KB) {
49
+ throw new Error(`insufficientMemory:${value}`);
50
+ }
51
+ return availableMemoryKb;
52
+ }
53
+ //# sourceMappingURL=preflight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preflight.js","sourceRoot":"","sources":["../src/preflight.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAE/B,2FAA2F;AAC3F,2FAA2F;AAC3F,uFAAuF;AACvF,4FAA4F;AAC5F,yFAAyF;AACzF,sFAAsF;AACtF,yFAAyF;AACzF,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB,EAAE,CAAC;AAIjE,MAAM,UAAU,qBAAqB,CAAC,GAAW;IAC/C,MAAM,YAAY,GAAG,GAAG,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B,CAAC,GAAW;IAChD,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IACzB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IACvE,MAAM,iBAAiB,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IACxC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,iBAAiB,CAAC,IAAI,iBAAiB,GAAG,iBAAiB,EAAE,CAAC;QACtF,MAAM,IAAI,KAAK,CAAC,sBAAsB,KAAK,EAAE,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,iBAAiB,CAAC;AAC3B,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,mBAAm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aAAa,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;gBACjC,MAAM,IAAI,qBAAqB,CAC7B,OAAO,EACP,aAAa,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,37 @@
1
+ import type { Translator } from './i18n.js';
2
+ import type { CommandRunner } from './process.js';
3
+ import type { InstallMode, InstallSettings, RemoteTarget } from './types.js';
4
+ export interface SelectOptions {
5
+ message: string;
6
+ choices: readonly {
7
+ name: string;
8
+ value: string;
9
+ }[];
10
+ }
11
+ export interface InputOptions {
12
+ message: string;
13
+ default?: string;
14
+ }
15
+ export interface PasswordOptions {
16
+ message: string;
17
+ mask: string;
18
+ }
19
+ export interface ConfirmOptions {
20
+ message: string;
21
+ default: boolean;
22
+ }
23
+ export interface PromptPort {
24
+ select(options: SelectOptions): Promise<string>;
25
+ input(options: InputOptions): Promise<string>;
26
+ password(options: PasswordOptions): Promise<string>;
27
+ confirm(options: ConfirmOptions): Promise<boolean>;
28
+ }
29
+ export declare const inquirerPrompt: PromptPort;
30
+ export interface TargetSelection {
31
+ mode: InstallMode;
32
+ installDir: string;
33
+ remote?: RemoteTarget;
34
+ }
35
+ export declare function collectTarget(prompt: PromptPort, t: Translator, requestedMode?: InstallMode): Promise<TargetSelection>;
36
+ export declare function collectSettings(prompt: PromptPort, t: Translator, installDir: string, probeRunner: CommandRunner | undefined): Promise<InstallSettings | null>;
37
+ //# 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,CA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