/**
 * Disposable performance warehouse — SQLite under ~/.agents/.cache/perf/.
 *
 * Opened only by `agents insights perf` / `hooks profile` (read path). Writers use
 * {@link recordSample} in `./spool.ts` (NDJSON, no SQLite).
 */
import Database from '../sqlite.js';
import type { AggregateOptions, PerfAggregateRow } from './types.js';
export type { AggregateOptions, PerfAggregateRow, PerfPhaseStat, PerfSample } from './types.js';
export { recordSample, shortSessionId, resolveSpoolPath } from './spool.js';
export { percentile } from '../percentile.js';
export declare const PERF_SCHEMA_VERSION = 1;
export declare const DEFAULT_RETENTION_DAYS = 30;
/** Test seam — redirect the warehouse path (like AGENTS_EVENTS_PATH). */
export declare function _resetPerfDbForTest(overridePath?: string | null): void;
/** Drain the NDJSON spool into samples. Idempotent; truncates on success. */
export declare function drainSpool(db?: Database.Database): number;
/**
 * Aggregate samples by (kind, label) with p50/p95/p99. Drains the spool first.
 *
 * `opts.project` scopes the query to samples whose recorded `cwd` resolves to
 * that project key (see project-key.ts) — resolution runs per unique cwd
 * (memoized) rather than per row, since `resolveProjectKey` does a filesystem
 * walk and a warehouse query can carry many rows sharing the same cwd.
 */
export declare function aggregateSamples(opts?: AggregateOptions): PerfAggregateRow[];
export declare function perfDbPath(): string;
export declare function perfSpoolPath(): string;
export declare function ensurePerfDir(): string;
