/**
 * Session State Tracker
 *
 * Manages session-level state for tracking plugin installations
 * and other session data that needs to persist during a Claude Code session.
 *
 * The state is persisted to `.specweave/state/session-state.json` and is used
 * to detect when plugins were installed during the current session (requiring restart).
 *
 * @module core/session/session-state
 */
import type { PluginInstallTrigger } from './plugin-install-detector.js';
/**
 * Details about a plugin installation event
 */
export interface PluginInstallationEvent {
    /** ISO-8601 timestamp of the installation */
    timestamp: string;
    /** List of plugins installed in this event */
    plugins: string[];
    /** What triggered the installation */
    trigger: PluginInstallTrigger;
    /** Project path where installation occurred */
    projectPath?: string;
}
/**
 * Complete session state structure
 */
export interface SessionState {
    /** Schema version for future migrations */
    version: number;
    /** Unique identifier for this session */
    sessionId: string;
    /** ISO-8601 timestamp when session started */
    startTime: string;
    /** All plugins installed during this session */
    pluginsInstalledDuringSession: string[];
    /** Most recent installation event */
    lastInstallationEvent?: PluginInstallationEvent;
    /** Project path for this session */
    projectPath?: string;
    /** Original user intent (captured from initial prompt) */
    originalIntent?: string;
}
/**
 * Options for recording plugin installation
 */
export interface RecordOptions {
    /** What triggered the installation */
    trigger?: PluginInstallTrigger;
    /** Project path where plugins were installed */
    projectPath?: string;
}
/**
 * Initialize a new session state
 *
 * Creates a fresh session state with a unique ID and persists it to disk.
 *
 * @param projectRoot - Root directory of the project
 * @returns The newly created session state
 *
 * @example
 * ```typescript
 * const state = initSessionState('/path/to/project');
 * console.log('Session started:', state.sessionId);
 * ```
 */
export declare function initSessionState(projectRoot: string): SessionState;
/**
 * Record plugin installation in session state
 *
 * Adds the installed plugins to the session state and updates the
 * last installation event. Plugins are deduplicated.
 *
 * @param projectRoot - Root directory of the project
 * @param plugins - List of plugin names that were installed
 * @param options - Additional installation context
 * @returns Updated session state
 *
 * @example
 * ```typescript
 * const state = recordPluginInstallation('/path/to/project', ['sw', 'frontend'], {
 *   trigger: 'specweave-init',
 *   projectPath: '/new/project'
 * });
 * ```
 */
export declare function recordPluginInstallation(projectRoot: string, plugins: string[], options?: RecordOptions): SessionState;
/**
 * Load session state from file
 *
 * Reads and parses the session state from disk. Returns null if the file
 * doesn't exist or contains invalid data.
 *
 * @param projectRoot - Root directory of the project
 * @returns Session state or null if not found/invalid
 *
 * @example
 * ```typescript
 * const state = loadSessionState('/path/to/project');
 * if (state && state.pluginsInstalledDuringSession.length > 0) {
 *   console.log('Plugins installed this session:', state.pluginsInstalledDuringSession);
 * }
 * ```
 */
export declare function loadSessionState(projectRoot: string): SessionState | null;
/**
 * Clear session state
 *
 * Removes the session state file from disk. Safe to call even if
 * the file doesn't exist.
 *
 * @param projectRoot - Root directory of the project
 *
 * @example
 * ```typescript
 * clearSessionState('/path/to/project');
 * ```
 */
export declare function clearSessionState(projectRoot: string): void;
/**
 * Check if plugins were installed during current session
 *
 * Convenience function to quickly check if the session restart warning
 * should be shown.
 *
 * @param projectRoot - Root directory of the project
 * @returns True if plugins were installed this session
 */
export declare function hasPluginsInstalledThisSession(projectRoot: string): boolean;
//# sourceMappingURL=session-state.d.ts.map