import type { AppShell } from "../app-interface/shell.js";
import type { ClarkState, ClarkEvent } from "../state-machine/clark-fsm.js";
import type { PerfettoProfiler } from "./perfetto-profiler.js";
/**
 * Clark-specific profiler that tracks performance across LLM operations,
 * tool calls, and debug cycles
 */
export declare class ClarkProfiler {
    private profiler;
    private sessionId;
    private appShell?;
    private runTimestamp?;
    constructor(sessionId: string);
    /**
     * Initialize the profiler with required services
     */
    initialize(appShell: AppShell, runTimestamp?: string): void;
    startSession(): void;
    /**
     * End the LLM session and write profiling data
     */
    endSession(): Promise<void>;
    /**
     * Track FSM state transitions
     */
    onStateTransition(fromState: ClarkState, toState: ClarkState, _event: ClarkEvent): void;
    /**
     * Time a tool execution
     */
    timeToolCall<T>(toolName: string, fn: () => Promise<T>): Promise<T>;
    /**
     * Time an LLM generation with waiting_on_llm and stream_text spans
     */
    timeLLMGeneration<T>(fn: () => Promise<T>, messageContext?: {
        messages?: any[];
        model?: string;
    }): Promise<T>;
    /**
     * Start LLM waiting profiling span
     */
    startLLMWaiting(messageContext?: {
        messages?: any[];
        model?: string;
    }): void;
    /**
     * Start streaming profiling span (call after first token received)
     */
    startLLMStreaming(responseContext?: {
        firstChunk?: string;
    }): void;
    endFrame(trackKey?: string): void;
    /**
     * Time debug operations (typecheck, lint)
     */
    timeDebugOperation<T>(operation: string, fn: () => Promise<T>): Promise<T>;
    /**
     * Time file system operations
     */
    timeFileOperation<T>(operation: string, fn: () => Promise<T>): Promise<T>;
    /**
     * Time post-processing operations
     */
    timePostProcessing<T>(operation: string, fn: () => Promise<T>): Promise<T>;
    getProfiler(): PerfettoProfiler;
    /**
     * Create a scoped profiler for a specific operation
     */
    createScope(scopeName: string): ScopedProfiler;
}
/**
 * A scoped profiler that automatically manages start/end for a specific operation
 */
export declare class ScopedProfiler {
    private profiler;
    private scopeName;
    private trackKey;
    private isActive;
    constructor(profiler: PerfettoProfiler, scopeName: string);
    start(): void;
    end(): void;
    /**
     * Time a function within this scope
     */
    time<T>(operation: string, fn: () => Promise<T>): Promise<T>;
}
//# sourceMappingURL=clark-profiler.d.ts.map