export type UsageKind = 'secret' | 'agent' | 'skill' | 'plugin' | 'browser' | 'computer';
export declare const USAGE_KINDS: readonly UsageKind[];
export interface RecordUsageParams {
    kind: UsageKind;
    name: string;
    event: string;
    agent?: string;
    sessionId?: string;
    machine?: string;
    actor?: string;
    source?: string;
    status?: 'success' | 'error' | string;
    meta?: Record<string, unknown>;
    ts?: string;
}
export interface UsageEventRow {
    ts: string;
    kind: UsageKind;
    name: string;
    event: string;
    agent: string | null;
    sessionId: string | null;
    machine: string | null;
    actor: string | null;
    source: string | null;
    status: string | null;
    metaJson: string | null;
}
export declare function recordUsage(p: RecordUsageParams): void;
export declare function usageDbPath(): string;
export declare function analyticsDir(): string;
export declare function listUsageKindsWithData(sinceIso: string): UsageKind[];
export declare function countUsage(opts: {
    kind?: UsageKind;
    sinceIso: string;
    name?: string;
    event?: string;
}): number;
export declare function queryUsage(opts: {
    kind?: UsageKind;
    name?: string;
    event?: string;
    sinceIso: string;
    limit?: number;
}): UsageEventRow[];
export interface NameCountRow {
    name: string;
    n: number;
    last: string | null;
}
export declare function topNamesByKind(kind: UsageKind, sinceIso: string, limit?: number): NameCountRow[];
export interface KindCountRow {
    kind: string;
    n: number;
}
export declare function kindMix(sinceIso: string): KindCountRow[];
export declare function getSecretBundleRollup(bundle: string): Array<{
    event: string;
    n: number;
    last: string | null;
    first: string | null;
}>;
export declare function getSecretBundleAgents(bundle: string): Array<{
    agent: string;
    n: number;
}>;
export declare function getAllSecretBundleRollups(): Array<{
    name: string;
    event: string;
    n: number;
    last: string | null;
    first: string | null;
}>;
export declare function getSecretHistory(bundle: string | undefined, limit?: number): Array<{
    ts: string;
    bundle: string;
    event: string;
    agent: string | null;
    host: string | null;
    source: string | null;
    status: string | null;
    keyCount: number | null;
}>;
export declare function closeUsageDb(): void;
