/** * Navidrome MCP Server - Settings store (read / write) * Copyright (C) 2025 * SPDX-License-Identifier: AGPL-3.0-or-later */ import { z } from 'zod'; import { type JsonObject } from './settings-file-checks.js'; /** * Every field is optional so a partial or hand-edited file still parses. ConfigSchema decides * later whether the mapped config is usable. */ export declare const SettingsFileSchema: z.ZodObject<{ navidrome: z.ZodOptional; username: z.ZodOptional; password: z.ZodOptional; }, z.core.$strip>>; transport: z.ZodOptional>; host: z.ZodOptional>; port: z.ZodOptional; expose: z.ZodOptional; authToken: z.ZodOptional>; allowedHosts: z.ZodOptional>>; allowedOrigins: z.ZodOptional>>; }, z.core.$strip>>; library: z.ZodOptional>; filterCacheEnabled: z.ZodOptional; }, z.core.$strip>>; features: z.ZodOptional>; radio: z.ZodOptional; lyrics: z.ZodOptional; musicBrainzUserAgent: z.ZodOptional>; radioBrowserUserAgent: z.ZodOptional>; radioBrowserBase: z.ZodOptional>; lyricsProvider: z.ZodOptional>; lrclibUserAgent: z.ZodOptional>; lrclibBase: z.ZodOptional>; }, z.core.$strip>>; playback: z.ZodOptional>; transcodeFormat: z.ZodOptional>; transcodeBitrate: z.ZodOptional>; audioDevice: z.ZodOptional>; }, z.core.$strip>>>; }, z.core.$strip>>; webui: z.ZodOptional; port: z.ZodOptional; host: z.ZodOptional>; expose: z.ZodOptional; allowedHosts: z.ZodOptional>>; publicUrl: z.ZodOptional>; autoOpenBrowser: z.ZodOptional; persistAfterMcpExit: z.ZodOptional; theme: z.ZodOptional>; visualizer: z.ZodOptional; tls: z.ZodOptional>; keyPath: z.ZodOptional>; }, z.core.$strip>>>; auth: z.ZodOptional>; adminPasswordHash: z.ZodOptional>; adminAccess: z.ZodOptional>; askPasswordOnThisComputer: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>>; jukebox: z.ZodOptional; shareLink: z.ZodOptional; }, z.core.$strip>>; advanced: z.ZodOptional; tokenExpiry: z.ZodOptional; }, z.core.$strip>>; }, z.core.$loose>; export type SettingsFile = z.infer; /** Every failure returns null instead of throwing, so a bad file never crashes startup. */ export declare function readSettings(): SettingsFile | null; /** * The schema strips nested keys this build does not know, so a save merges onto this unstripped * object instead, which also writes each coerced value back in its proper type. It is null whenever * readSettings returns null. */ export declare function readRawSettings(): Record | null; /** * Lets the settings page say why it shows default and environment values in place of some or all of * the file's. `salvaged` is true when the page shows the values readSalvagedSettings kept. */ export declare function readStoreProblem(): { text: string; unreadable: boolean; salvaged: boolean; } | null; /** Lets the settings page name each hand-edit slip the store read past. */ export declare function readStoreNotices(): string[]; /** The settings page form seeds from these values. Null unless a present JSON file failed the schema. */ export declare function readSalvagedSettings(): SettingsFile | null; /** * A save over a file the schema rejects merges onto this unstripped object, so it keeps the file's * valid values and each key this build does not know. Null unless a present JSON file failed the schema. */ export declare function readSalvagedRawSettings(): JsonObject | null; /** * The env fallback opens the web remote by default, so startup also learns whether the file names * an auth mode other than none, even when the schema rejects the file. A file that cannot be read * or parsed cannot prove it names no auth mode, so it counts as one that does. */ export declare function readSettingsForStartup(): { settings: SettingsFile | null; requestsWebuiAuth: boolean; problem: string | null; notices: string[]; }; /** A person who reads the file sees only keys with values. The runtime reads an absent key as it read the empty one. */ export declare function writeSettings(settings: SettingsFile): void; /** * A secrets file must never exist with default perms or partial content, so a 0600 temp file is * synced and renamed into place. Windows ignores the mode and relies on per-user %APPDATA%. */ export declare function writePrivateFileAtomic(path: string, content: string): void; /** * Every store writer sets only some keys, so a save keeps each stored key it does not set, even one * the schema would strip. A posted null, '' or [] replaces the stored value. Only undefined keeps it. */ export declare function mergeOntoStored(stored: JsonObject, posted: JsonObject): JsonObject; //# sourceMappingURL=store.d.ts.map