/** * [WHO]: profileCheckpoint(), getCheckpoints(), getProfileReport(), exportProfile() * [FROM]: Depends on node:fs, node:process, node:performance * [TO]: Consumed by main.ts, cli.ts, core/platform/config/settings-manager.ts, core/runtime/sdk.ts * [HERE]: utils/startup-profiler.ts - startup timing instrumentation with reporting */ /** Startup timing checkpoint */ interface Checkpoint { name: string; time: number; delta?: number; } /** Phase statistics for summary */ interface PhaseStats { name: string; selfMs: number; totalMs: number; percentage: number; } /** Profile report for export and analysis */ export interface ProfileReport { version: string; timestamp: string; platform: string; nodeVersion: string; totalMs: number; checkpoints: Array<{ name: string; time: number; timeFromStart: number; deltaFromLast: number | null; deltaFromParent: number | null; }>; summary: { phases: PhaseStats[]; largestPhases: Array<{ name: string; ms: number; percentage: number; }>; }; } /** * Record a startup checkpoint. * Outputs timing info if CATUI_PROFILE_STARTUP=1 * * @example profileCheckpoint("config_loaded") * @example profileCheckpoint("settings_manager_ready", "after_config") */ export declare function profileCheckpoint(name: string, afterCheckpoint?: string): void; /** * Get all recorded checkpoints. * Useful for testing or programmatic access. */ export declare function getCheckpoints(): Checkpoint[]; /** * Clear all checkpoints. * Useful for testing. */ export declare function clearCheckpoints(): void; /** * Generate a structured profile report. * Useful for comparison and CI regression testing. */ export declare function getProfileReport(): ProfileReport; /** * Export profile to a JSON file. * Useful for CI baseline comparison. */ export declare function exportProfile(filePath: string): Promise; /** * Compare two profile reports. * Returns differences for regression detection. */ export declare function compareProfiles(baseline: ProfileReport, current: ProfileReport): { totalDiff: number; totalDiffPercent: number; phaseDiffs: Array<{ name: string; baselineMs: number; currentMs: number; diffMs: number; diffPercent: number; regression: boolean; }>; }; export {};