/** * Debug Context Export * * Export application state and debug context for troubleshooting. * * @since v1.41.4 */ /** * Environment information */ export interface EnvironmentInfo { platform: string; osVersion: string; nodeVersion: string; bunVersion: string; terminalSize: { width: number; height: number; }; cwd: string; env: { debug: boolean; tier?: string; }; } /** * Application state snapshot */ export interface StateSnapshot { activeTab: string; pluginCount: number; serverCount: number; updateCount: number; uiState: string; authenticated: boolean; tier: string; sessionActive: boolean; } /** * Configuration summary (sensitive data redacted) */ export interface ConfigSummary { sources: string[]; theme: string; backupEnabled: boolean; autoUpdateCheck: boolean; cacheEnabled: boolean; hasCustomConfig: boolean; hasCustomRegistry: boolean; hasCustomSources: boolean; } /** * Recent action log entry */ export interface ActionLogEntry { type: string; timestamp: string; success: boolean; duration?: number; details?: string; } /** * Error log entry */ export interface ErrorLogEntry { message: string; stack?: string; timestamp: string; context?: string; } /** * Recording summary */ export interface RecordingSummary { id: string; name: string; eventCount: number; duration: number; createdAt: string; } /** * Complete debug context */ export interface DebugContext { version: string; timestamp: string; exportId: string; environment: EnvironmentInfo; state: StateSnapshot; config: ConfigSummary; recentActions: ActionLogEntry[]; errors: ErrorLogEntry[]; recordings: RecordingSummary[]; notes?: string; } /** * Context collector options */ export interface ContextCollectorOptions { /** Include recent actions (last N) */ includeActions?: number; /** Include errors (last N) */ includeErrors?: number; /** Include recording summaries */ includeRecordings?: boolean; /** Add custom notes */ notes?: string; /** Redact all paths */ redactPaths?: boolean; } type StateProviderFn = () => StateSnapshot; /** * Set the state provider function * This should be called by the main App to inject real state */ export declare function setStateProvider(provider: StateProviderFn): void; /** * Clear the state provider */ export declare function clearStateProvider(): void; /** * Get state snapshot using provider if available, otherwise return mock */ export declare function getStateSnapshot(): StateSnapshot; /** * Log an action */ export declare function logAction(type: string, success: boolean, duration?: number, details?: string): void; /** * Log an error */ export declare function logError(message: string, stack?: string, context?: string): void; /** * Clear action log */ export declare function clearActionLog(): void; /** * Clear error log */ export declare function clearErrorLog(): void; /** * Get action log */ export declare function getActionLog(): ActionLogEntry[]; /** * Get error log */ export declare function getErrorLog(): ErrorLogEntry[]; /** * Redact sensitive paths from a string */ export declare function redactPaths(str?: string): string | undefined; /** * Get environment information */ export declare function getEnvironmentInfo(): EnvironmentInfo; /** * Get mock state snapshot (for dev mode) */ export declare function getMockStateSnapshot(): StateSnapshot; /** * Get mock config summary */ export declare function getMockConfigSummary(): ConfigSummary; /** * Collect debug context */ export declare function collectDebugContext(options?: ContextCollectorOptions): Promise; /** * Format debug context for display */ export declare function formatDebugContext(context: DebugContext): string; /** * Export debug context to file */ export declare function exportDebugContextToFile(outputPath: string, options?: ContextCollectorOptions): Promise<{ context: DebugContext; path: string; }>; /** * Get default export path */ export declare function getDefaultExportPath(): string; /** * Ensure debug context directory exists */ export declare function ensureDebugContextDir(): Promise; export {}; //# sourceMappingURL=context-export.d.ts.map