/**
 * `agents insights perf` — latency rollups over the disposable perf SQLite
 * warehouse (former top-level `agents perf`, moved under insights in PHNX-3391).
 *
 * Subcommands:
 *   agents insights perf              multi-section summary (commands + hooks + runs)
 *   agents insights perf hooks        per-hook p50/p99 + cache hit rates
 *   agents insights perf commands     slowest CLI command paths (from command.end)
 *   agents insights perf run          agent.run / perf.timing labels
 *   agents insights perf friction     sessions stuck repeatedly hitting the same guard
 *
 * Soft-joins sessions.db via shared string keys (session_id, agent, machine) —
 * no foreign keys. Warehouse lives at ~/.agents/.cache/perf/perf.db (safe to wipe).
 */
import type { Command } from 'commander';
import { type PerfAggregateRow } from '../lib/perf/db.js';
import { type HookProfileRow } from '../lib/hooks/profile.js';
interface PerfGlobalOpts {
    days?: string;
    warnMs?: string;
    json?: boolean;
    limit?: string;
    project?: string;
}
/** Map warehouse rows shaped like hook.fire into the existing HookProfileRow UI. */
export declare function asHookRows(rows: PerfAggregateRow[]): HookProfileRow[];
/**
 * `err:12% block:40% to:4%` when any rate is present, else ''.
 * Exit 2 (intentional deny) is `block:`, not `err:` — so a deny-by-design
 * guard no longer reads as a crashing hook in the table.
 */
export declare function formatRateColumn(r: {
    errorRate?: number;
    blockRate?: number;
    timeoutRate?: number;
}): string;
export declare function renderHookTable(rows: HookProfileRow[], warnMs: number): void;
/**
 * Prefer SQLite samples; fall back to the legacy daily JSONL so existing
 * instrumentation still surfaces until shims are resynced. `project` only
 * narrows the SQLite path — the legacy JSONL log has no cwd, so a fallback
 * hit ignores it (a caller filtering by project has no legacy rows to miss).
 */
export declare function loadHookProfile(days: number, project?: string): HookProfileRow[];
/**
 * Sessions stuck repeatedly hitting the SAME guard block (git-guard,
 * rm-guard, git-require-clean-tree, …) instead of adapting after the first
 * denial. Reads the `friction` event sink (emitFriction in events.ts) that
 * guard hooks self-report into via `agents _internal friction` before they
 * exit 2 — see lib/friction-heuristics.ts for the grouping.
 */
export declare function frictionAction(opts: PerfGlobalOpts): void;
/**
 * Attach the `perf` latency-rollup command under a parent (the top-level
 * `insights` group). Performance is an insight, not a top-level noun — `agents
 * perf` was retired in favour of `agents insights perf` (PHNX-3391). It is a
 * sibling of `agents insights cost` / `output`, registered in
 * `registerInsightsCommand` beside them (top-level insights only, not
 * `sessions insights`).
 */
export declare function registerPerfSubcommand(parent: Command): void;
export {};
