@dollhousemcp/mcp-server
Version:
DollhouseMCP - A Model Context Protocol (MCP) server that enables dynamic AI persona management from markdown files, allowing Claude and other compatible AI assistants to activate and switch between different behavioral personas.
29 lines • 1.53 kB
TypeScript
/**
* Follower-to-leader promotion manager (#1850).
*
* Handles the lifecycle of promoting a follower process to leader when the
* current leader becomes unreachable. Extracted from UnifiedConsole.ts to
* reduce complexity and allow per-instance state tracking.
*
* Each PromotionManager instance tracks its own attempt counter, so multiple
* followers in the same process (unlikely but possible) don't interfere
* with each other's promotion budgets.
*/
import { type ElectionResult } from './LeaderElection.js';
import type { LeaderForwardingLogSink, SessionHeartbeat } from './LeaderForwardingSink.js';
import type { UnifiedConsoleOptions } from './UnifiedConsole.js';
export declare class PromotionManager {
private readonly options;
private readonly consolePort;
private readonly startAsLeader;
private readonly startAsFollower;
private inProgress;
private attempts;
constructor(options: UnifiedConsoleOptions, consolePort: number, startAsLeader: (options: UnifiedConsoleOptions, election: ElectionResult, consolePort: number) => Promise<unknown>, startAsFollower: (options: UnifiedConsoleOptions, election: ElectionResult, consolePort: number) => Promise<unknown>);
/**
* Attempt promotion. Safe to call from the ForwardingSink onLeaderDeath
* callback — guards against concurrent and excessive attempts.
*/
promote(forwardingSink: LeaderForwardingLogSink, sessionHeartbeat: SessionHeartbeat): Promise<void>;
}
//# sourceMappingURL=PromotionManager.d.ts.map