/**
 * olam memory stats — operator-facing formatter over `/bridge/stats`.
 *
 *   $ olam memory stats
 *     # human-readable counters + derived cache_error_rate
 *
 *   $ olam memory stats --json
 *     # raw /bridge/stats response (for jq / monitoring scripts)
 *
 * Config (env vars):
 *   AGENTMEMORY_BRIDGE_URL    bridge base URL
 *                             (default: https://olam-agent-memory.ernestcodes.workers.dev)
 *   AGENTMEMORY_BRIDGE_SECRET bearer token
 *
 * Derived metric: cache_error_rate =
 *     (cache_busted_hash + cache_busted_version) / max(writes_observed, 1)
 *
 *   Interpretation: high rates (>5%) mean operators have been forced to
 *   reclassify a lot of recent writes — usually a sign that the prompt
 *   template / classifier_version is churning. The denominator is
 *   classifier_writes_observed (NOT bridge writes_observed).
 *
 * Plan reference:
 *   docs/plans/agentmemory-classifier-and-regret/phase-b-tasks.md (B5/B6)
 */
import type { Command } from 'commander';
export interface StatsOptions {
    bridgeUrl?: string;
    bearer?: string;
    json?: boolean;
}
/**
 * The seven counters this command formats. Mirrors the classifier_*
 * subset of {@link BridgeStatsSnapshot} but renamed to drop the
 * `classifier_` prefix — operators see "writes_observed" not
 * "classifier_writes_observed" when scanning output.
 */
export interface StatsCounters {
    writes_observed: number;
    writes_deduped_hash: number;
    writes_deduped_semantic: number;
    recalls_observed: number;
    cache_busted_hash: number;
    cache_busted_version: number;
}
export interface StatsResult {
    ok: boolean;
    counters?: StatsCounters;
    /** Decimal fraction, 0–1+. Multiply by 100 for display percentage. */
    cacheErrorRate?: number;
    /** Raw /bridge/stats envelope (preserved for --json mode). */
    raw?: unknown;
    error?: string;
}
/**
 * Pure helper — separated so it's unit-testable without HTTP.
 * Guards divide-by-zero (returns 0 when writes_observed === 0, even
 * if busts are nonzero — Infinity / NaN would be operator-hostile).
 */
export declare function computeCacheErrorRate(counters: Pick<StatsCounters, 'writes_observed' | 'cache_busted_hash' | 'cache_busted_version'>): number;
/**
 * Run the stats call. Pure-ish: takes opts + fetch (so tests can stub) +
 * returns a structured result. Mirrors `runReclassify` for symmetry.
 */
export declare function runStats(opts: StatsOptions, fetchImpl?: typeof fetch): Promise<StatsResult>;
/** Run + render. Returns the process exit code. */
export declare function runStatsCli(opts: StatsOptions): Promise<number>;
export declare function registerMemoryStats(cmd: Command): void;
//# sourceMappingURL=stats.d.ts.map