import type { Command } from 'commander';
import { type ToolIndexCoverage } from '../lib/session/tool-index.js';
export interface ToolBackfillMachineResult {
    machine: string;
    indexedFiles: number;
    indexedCalls: number;
    coverage: ToolIndexCoverage;
}
export interface ToolBackfillEnvelope {
    schemaVersion: 1;
    kind: 'tools-backfill';
    generatedAt: string;
    complete: boolean;
    machines: ToolBackfillMachineResult[];
}
interface ToolBackfillOptions {
    agent?: string;
    project?: string;
    since?: string;
    until?: string;
    unmanaged?: boolean;
    teams?: boolean;
    json?: boolean;
    local?: boolean;
    fleet?: boolean;
    host?: string[] | string;
    device?: string[] | string;
}
export declare function backfillToolsLocal(options: ToolBackfillOptions, oneBatch?: boolean): Promise<ToolBackfillMachineResult>;
export declare function runToolsBackfill(options: ToolBackfillOptions): Promise<ToolBackfillEnvelope>;
interface ResourceBackfillOptions {
    agent?: string;
    project?: string;
    since?: string;
    until?: string;
    teams?: boolean;
    json?: boolean;
}
export interface ResourceBackfillEnvelope {
    schemaVersion: 1;
    kind: 'resources-backfill';
    generatedAt: string;
    machine: string;
    /** Sessions considered (matched the filter, had a real transcript). */
    scanned: number;
    /** Sessions (re)parsed and written this run. */
    updated: number;
    /** Sessions already current at this extractor version, skipped. */
    skipped: number;
    /** Sessions whose transcript could not be stat'd or parsed. */
    failed: number;
    /** Total session_resource_usage rows written across updated sessions. */
    resourceRows: number;
}
/**
 * Populate session_resource_usage for historical sessions on THIS machine.
 * Local-only by design: the resource signal is derived from each machine's own
 * transcripts, and the index is machine-local, so there is no cross-machine
 * merge to do — run it on each box (or over `agents ssh`). Ensures the session
 * index is complete first (discoverSessions), then re-derives usage gated by the
 * resource_scan_ledger so reruns skip completed transcripts.
 */
export declare function runResourceBackfill(options: ResourceBackfillOptions): Promise<ResourceBackfillEnvelope>;
export declare function registerSessionsBackfillCommand(sessionsCmd: Command): void;
export {};
