/** * Session context manager */ import type { OptimizationMetrics, QualityMetrics, Session, SessionCommand, SessionContext } from '../types/session.types.js'; export declare class SessionContextManager { private session; constructor(session: Session); /** * Add a command to session history */ addCommand(command: string, args: string[], flags: Record, outputs: Record, success: boolean, durationMs: number, error?: string, tokensUsed?: number, optimizationMetrics?: OptimizationMetrics, qualityMetrics?: QualityMetrics): void; /** * Set the currently running command */ setCurrentCommand(command: string): void; /** * Clear the currently running command */ clearCurrentCommand(): void; /** * Update session context */ updateContext(key: string, value: unknown): void; /** * Get context value */ getContext(key: string): unknown; /** * Get all context */ getAllContext(): SessionContext; /** * Merge context */ mergeContext(context: SessionContext): void; /** * Clear specific context key */ clearContext(key: string): void; /** * Clear all context */ clearAllContext(): void; /** * Get last command */ getLastCommand(): null | SessionCommand; /** * Get command history */ getCommandHistory(): SessionCommand[]; /** * Get commands by name */ getCommandsByName(commandName: string): SessionCommand[]; /** * Get successful commands */ getSuccessfulCommands(): SessionCommand[]; /** * Get failed commands */ getFailedCommands(): SessionCommand[]; /** * Get session statistics */ getStatistics(): { average_duration_ms: number; failed_commands: number; successful_commands: number; total_commands: number; total_duration_ms: number; }; /** * Update session status */ setStatus(status: 'active' | 'completed' | 'failed' | 'paused'): void; /** * Get session status */ getStatus(): 'active' | 'completed' | 'failed' | 'paused'; /** * Get session */ getSession(): Session; /** * Check if context has key */ hasContext(key: string): boolean; /** * Get context keys */ getContextKeys(): string[]; /** * Validate context has required keys */ validateContext(requiredKeys: string[]): void; /** * Get filtered context containing only specified keys * Useful for reducing token usage by only passing context that's actually referenced */ private static buildNestedFromPath; private static deepMerge; getFilteredContext(keys: string[]): SessionContext; /** * Extract $CONTEXT_* variable references from a value (string, object, or array) * Returns a set of context keys that are referenced */ static extractContextReferences(value: unknown): Set; } //# sourceMappingURL=context.d.ts.map