/** * Exploration State Manager - State persistence and recovery * * Handles loading and saving exploration state to disk for recovery and tracking */ import type { Exploration, ExplorationConfig, ExplorationState, ExplorationSummary, WorktreeExploration } from '../types/exploration.types.js'; /** * Get error message from unknown error */ export declare class ExplorationStateManager { private explorationsDir; constructor(explorationsDir?: string); /** * Create a new exploration */ createExploration(task: string, config: ExplorationConfig): Promise; /** * Load an exploration by ID */ loadExploration(explorationId: string): Promise; /** * Save exploration to disk */ saveExploration(exploration: Exploration): Promise; /** * Load exploration state (includes runtime information) */ loadState(explorationId: string): Promise; /** * Save exploration state */ saveState(state: ExplorationState): Promise; /** * Update exploration status */ updateStatus(explorationId: string, status: Exploration['status'], additionalUpdates?: Partial): Promise; /** * Update worktree status */ updateWorktree(explorationId: string, worktreeIndex: number, updates: Partial): Promise; /** * List all explorations */ listExplorations(): Promise; /** * Delete an exploration */ deleteExploration(explorationId: string): Promise; /** * Check if exploration exists */ explorationExists(explorationId: string): Promise; /** * Get active explorations */ getActiveExplorations(): Promise; /** * Find exploration linked to a session */ findBySessionId(sessionId: string): Promise; /** * Get explorations root directory */ getExplorationsDir(): string; /** * Get exploration directory path. Every other path-building method here * (`getMetadataPath`/`getStatePath`/`getSharedVolumePath`/ * `getWorktreeDataPath`) funnels through this one, so validating the raw * CLI-supplied `explorationId` here (rather than at each of the 5 call * sites individually) closes the whole class at once — a traversal ID * (`../../../../etc`) previously walked straight out of * `explorationsDir`, and via `deleteExploration`'s `fs.rm(..., * {recursive:true, force:true})`, became an arbitrary directory-deletion * primitive. */ getExplorationDir(explorationId: string): string; /** * Get shared volume path */ getSharedVolumePath(explorationId: string): string; /** * Get insights for an exploration */ getInsightsForExploration(explorationId: string): Promise>; /** * Get decisions for an exploration */ getDecisionsForExploration(explorationId: string): Promise>; /** * Get worktree data path */ getWorktreeDataPath(explorationId: string, worktreeIndex: number): string; /** * Initialize worktree data directory */ initializeWorktreeData(explorationId: string, worktreeIndex: number): Promise; /** * Get metadata file path */ private getMetadataPath; /** * Get state file path */ private getStatePath; /** * Convert exploration to summary */ private toSummary; } //# sourceMappingURL=exploration-state.d.ts.map