/** * config-preconfigure.ts, after provisioning, point the voice.local.* config * keys at the managed install so local voice works immediately. * * Ownership is tracked via the install stamp: the exact values a previous * install wrote are passed back in as `priorInstallWrites`. Provenance rules: * - current value empty AND no prior install write -> unset: installer sets it * - current value equals the prior install write -> installer-owned: update * to the new managed value (a manifest layout/voice change must apply) * - current value empty BUT a prior write existed -> the user deliberately * CLEARED an installer-written value: respect the disable, skip * - a path pointing at some OTHER install -> SUPERSEDED (see below) * - anything else -> user-set: skip * Every decision is reported in the receipt (set / superseded / skipped). * * A MANAGED INSTALL SUPERSEDES A MANUAL ONE. * * "Never overwrite a user value" was the wrong rule for a PATH. Running the * managed installer is itself the user's act, and its whole promise is that * voice works afterwards. On the owner's machine the installer downloaded and * verified a complete managed runtime, then skipped every config key because * they still pointed at a hand-built install under ~/.local/opt, so setup * reported "provisioned" while the product went on using an install the new one * had just replaced. Nothing said so. * * So a path key that names a location OUTSIDE the managed root is repointed at * the managed runtime, and the receipt names the exact path that was replaced. * Superseding loudly beats a green message over a stale install. Non-path keys * (the engine enums) follow the path they belong to, so an engine and its * binary can never be left describing two different installs. */ export interface VoiceKeyPreconfig { readonly key: string; readonly value: string; } export interface VoiceKeySkip { readonly key: string; readonly reason: string; } /** A key repointed from a different install at the managed one. */ export interface VoiceKeySupersede { readonly key: string; /** What the key pointed at before, named so the change is auditable. */ readonly previousValue: string; readonly value: string; } export interface VoicePreconfigReceipt { readonly set: readonly VoiceKeyPreconfig[]; readonly skipped: readonly VoiceKeySkip[]; /** Keys taken over from an install this one replaces. */ readonly superseded: readonly VoiceKeySupersede[]; /** The full ownership map after this pass (persist into the install stamp). */ readonly installWrites: Record; } export interface VoicePreconfigDeps { readonly getConfig: (key: string) => string; readonly setConfig: (key: string, value: string) => void; readonly ttsEngine: string; readonly ttsBinary: string; readonly ttsModelPath: string; /** STT values, present only when STT provisioned (same ownership rules). */ readonly sttEngine?: string | undefined; readonly sttBinary?: string | undefined; readonly sttModelPath?: string | undefined; /** The values a previous install wrote (from the install stamp). */ readonly priorInstallWrites?: Record | undefined; /** * The managed voice root. A path key already inside it is this installer's * own; one outside it belongs to another install and is superseded. * * Omitted, NOTHING is superseded: without a root there is no way to tell this * install's paths from a user's, and treating every configured path as * foreign would repoint all of them. A caller that wants the supersede rule * has to say where its install lives. */ readonly managedRoot?: string | undefined; } /** * Set the three voice.local.tts* keys to the managed install, honoring the * ownership rules above. Returns a receipt of what was set vs preserved plus * the updated ownership map for the install stamp. */ export declare function preconfigureLocalVoiceKeys(deps: VoicePreconfigDeps): VoicePreconfigReceipt; /** Plain-language lines naming each install this run replaced, for the reply. */ export declare function describeSupersededVoiceKeys(receipt: VoicePreconfigReceipt): readonly string[]; //# sourceMappingURL=config-preconfigure.d.ts.map