export interface CdpCallFrame {
    functionName?: string;
    url?: string;
    lineNumber?: number;
}
export interface CdpProfileNode {
    callFrame?: CdpCallFrame;
    hitCount?: number;
}
export interface CdpProfile {
    nodes?: CdpProfileNode[];
}
export interface InspectorTarget {
    webSocketDebuggerUrl?: string;
    title?: string;
}
export interface HotFrame {
    label: string;
    selfPct: number;
    samples: number;
}
export interface ProfileNodeOutput {
    write(text: string): void;
    error(text: string): void;
}
/** Injectable boundary so the command is unit-testable without a real process. */
export interface ProfileNodeDeps {
    /** Send SIGUSR1 to a pid (opens node's inspector). Throws if the pid is gone. */
    signalUsr1(pid: number): void;
    /** GET `http://127.0.0.1:<port>/json/list` → the first inspector target, or null. */
    fetchInspectorTarget(port: number): Promise<InspectorTarget | null>;
    /** Connect to the CDP websocket + capture a CPU profile over `durationMs`. */
    captureCpuProfile(wsUrl: string, durationMs: number): Promise<CdpProfile>;
    /** Resolve the hottest `node` pid for the no-arg form (or null). */
    hottestNodePid(): Promise<number | null>;
    /** Sleep (injected so tests don't actually wait). */
    sleep(ms: number): Promise<void>;
}
export interface DevProfileNodeOptions {
    pid?: string;
    durationSec?: number;
    top?: number;
    output?: ProfileNodeOutput;
    deps?: ProfileNodeDeps;
}
/**
 * Pure: aggregate a CDP CPU profile's self-time (per-node `hitCount`) by JS call
 * frame, returning the top-N frames as `function  src/file.js:line` + self %.
 * The biggest non-idle entry IS the hot loop. Idle/native frames (`(idle)`,
 * `(program)`, GC) are kept — seeing "48% idle, 30% readFileUtf8" is the signal.
 */
export declare function aggregateHotFrames(profile: CdpProfile, topN?: number): HotFrame[];
/** Probe the inspector ports for the target opened by SIGUSR1. First hit wins. */
export declare function findInspectorTarget(deps: ProfileNodeDeps): Promise<InspectorTarget | null>;
/**
 * Orchestrate: resolve pid → SIGUSR1 → find inspector → CDP CPU profile →
 * aggregate → print. Returns an exit code (0 ok, 1 operational failure).
 */
export declare function runDevProfileNode(opts: DevProfileNodeOptions): Promise<number>;
/** Production deps: real SIGUSR1, http inspector probe, ws CDP profile, ps. */
export declare function productionDeps(): ProfileNodeDeps;
//# sourceMappingURL=devProfileNode.d.ts.map