export interface UsageEntry {
    ts: number;
    tool: string;
    repo: string;
    args_summary: Record<string, unknown>;
    elapsed_ms: number;
    /** Estimated tokens of the RAW handler result (pre-shortening). */
    result_tokens: number;
    result_chunks: number;
    session_id: string;
    /** Estimated tokens actually sent after the progressive-shortening
     * cascade + response hints. Present only when it differs from
     * result_tokens — so cascade effectiveness is measurable. */
    result_tokens_sent?: number;
    /** True when the handler threw — the logged result is the error message. */
    error?: boolean;
}
export declare function getUsagePath(): string;
/**
 * Build a lightweight args summary for a given tool call.
 * Extracts only the small, useful fields — never full source or query results.
 */
export declare function buildArgsSummary(tool: string, args: Record<string, unknown>): Record<string, unknown>;
export declare function extractResultChunks(data: unknown): number;
export declare function getCumulativeSavings(): number;
export declare function addSavings(tokens: number): void;
/**
 * Log a usage entry to ~/.codesift/usage.jsonl.
 * Non-blocking: errors are silently caught and logged to stderr.
 */
export declare function trackUsage(entry: UsageEntry): Promise<void>;
/**
 * High-level helper: track a completed tool call.
 * Called at the end of each tool handler after the result is computed.
 */
export declare function trackToolCall(tool: string, args: Record<string, unknown>, resultText: string, resultData: unknown, elapsedMs: number, extra?: {
    /** Char length of the response actually sent (post-cascade, with hints). */
    sentChars?: number;
    /** The handler threw — resultText is the error message. */
    error?: boolean;
}): void;
/**
 * Get the current session ID (for testing or display).
 */
export declare function getSessionId(): string;
//# sourceMappingURL=usage-tracker.d.ts.map