/** * Navidrome MCP Server - Configuration Management * Copyright (C) 2025 * SPDX-License-Identifier: AGPL-3.0-or-later */ import { type Config } from './config/schema.js'; import { type SettingsFile } from './config/store.js'; export type { Config } from './config/schema.js'; /** Shared by startup and the settings Save and Test routes, so each reports the same issue list. */ export declare function validateMappedSettings(settings: SettingsFile, mpvPath: string | null): { ok: true; config: Config; } | { ok: false; messages: string[]; }; /** * A caller that already read the store passes that snapshot, so its guard and this parse see the * same file. */ export declare function loadConfig(settings?: SettingsFile): Promise; /** Tells the web player whether env-only values, such as WEBUI_ADMIN_PASSWORD, apply. */ export type ConfigSource = 'store' | 'env'; export interface StartupFailure { reason: string; /** Navidrome could not be reached, so the configuration was never judged. */ unreachable: boolean; /** Picks the remedy, since env vars cannot fix a store and a settings save replaces env. */ source: ConfigSource; } /** * Lets the entry point branch into setup mode without turning `Config` into a union, * so every `Config` field stays non-optional. An absent failure means a first run. */ type ConfigState = { configured: true; config: Config; source: ConfigSource; } | { configured: false; failure?: StartupFailure; }; export declare function resolveConfigState(): Promise; /** * Reads the store on each call, so a running process sees what the web player or the settings app * saved after it started. */ export declare function readSavedWebuiSettings(): Config['webui'] | null; /** A spawned or re-run web player binds the saved endpoint, not this process's startup one. */ export declare function readSavedWebuiEndpoint(): Pick | null; /** * Reads the store on each call, so a running process sees a device another process saved. Undefined * means no usable store, and the caller keeps its startup config. */ export declare function readSavedAudioDevice(): Config['playbackAudioDevice'] | undefined; export declare function saveAudioDevice(device: Config['playbackAudioDevice']): boolean; /** An undefined field keeps its stored value. */ export declare function saveJukeboxSettings(patch: { [K in keyof Config['jukebox']]?: Config['jukebox'][K] | undefined; }): boolean; //# sourceMappingURL=config.d.ts.map