/** * Navidrome MCP Server - Jukebox Remote setup mode Save handler * Copyright (C) 2025 * SPDX-License-Identifier: AGPL-3.0-or-later */ import type { resolveConfigState } from '../config.js'; import { type SaveTakeover } from '../config-app/save-message.js'; type ConfigState = Awaited>; export type ConfiguredState = Extract; /** This process owns the port, stood down for another player at `url`, or stood down because its spawning MCP exited. */ export type PortAcquisition = { mode: 'owner'; owner: Owner; } | { mode: 'attached'; url: string; } | { mode: 'mcp-exited'; }; /** The player's own address and the launch key its start made. */ type StartedOwner = { url: string; auth: { launchKey: string; }; }; interface SetupSaveDeps { resolveState: () => Promise; /** Builds the runtime and binds the player port, or finds another player on it. */ acquire: (state: ConfiguredState) => Promise>; /** Runs once the player owns the port or another player does, so setup mode's own shutdown triggers stop. */ leaveSetup: () => void; /** Runs the rest of the start after the Save reply, so it reports its own failure. */ runOwner: (owner: Owner) => void; } /** * The settings server runs it after each Save, one Save at a time, so a shortcut launch with no * settings starts the player without a relaunch. A rejection keeps setup mode with its reason. */ export declare function createSetupSaveHandler(deps: SetupSaveDeps): () => Promise; export {}; //# sourceMappingURL=setup-mode.d.ts.map