/** * Persistent State Coordinator * * Extends StateCoordinator to automatically persist all state changes * to disk using StateStore. Supports state restoration on initialization. */ import { StateCoordinator } from './state-coordinator.js'; import { StateStore } from '../persistence/state-store.js'; /** * PersistentStateCoordinator extends StateCoordinator with automatic * state persistence. All state changes are automatically saved to disk * via the StateStore, and state is restored on initialization. * * @example * ```typescript * const stateStore = new StateStore({ stateDir: '.hari-seldon' }); * const coordinator = new PersistentStateCoordinator(stateStore, '/path/to/repo'); * * await coordinator.initialize(); * * // All state changes are automatically persisted * coordinator.createTask('task-1', 'coder'); * coordinator.startTask('task-1'); * * // Clean shutdown ensures all pending writes complete * await coordinator.shutdown(); * ``` */ export declare class PersistentStateCoordinator extends StateCoordinator { private readonly stateStore; private readonly repoPath; private initialized; constructor(stateStore: StateStore, repoPath: string); /** * Initialize the coordinator - load persisted state and restore it. */ initialize(): Promise; /** * Check if the coordinator has been initialized. */ isInitialized(): boolean; /** * Setup event listeners to persist state changes. * Called in constructor before initialize. */ private setupPersistenceHooks; /** * Restore in-memory state from persisted state. * Handles stale/orphaned entries gracefully. */ private restoreFromPersistedState; /** * Persist a newly created task. */ private persistTaskCreated; /** * Persist a task status update. */ private persistTaskUpdated; /** * Persist a worktree link. */ private persistWorktreeLink; /** * Persist a worktree unlink. */ private persistWorktreeUnlink; /** * Persist a conflict detection. */ private persistConflictDetected; /** * Persist a conflict resolution. */ private persistConflictResolved; /** * Convert TaskState to PersistedTaskState. */ private toPersistedTask; /** * Shutdown the coordinator and ensure all state is persisted. */ shutdown(): Promise; /** * Force an immediate save of all pending state changes. */ saveNow(): Promise; } //# sourceMappingURL=persistent-state-coordinator.d.ts.map