import type { PublicPricingSnapshot } from "../skill-bench/telemetry.js"; import { type HistorySpendEstimates } from "./cost-estimate.js"; /** Preset windows plus free-form `Nd` for N in 1..365, or `all`. */ export type HistoryWindow = string; export type HistoryProjectScope = "current" | "all"; export declare const HISTORY_WINDOW_MAX_DAYS = 365; export declare const HISTORY_WINDOW_PRESETS: readonly ["7d", "30d", "90d", "all"]; export interface AnalyzeHistoryOptions { window: HistoryWindow; project: HistoryProjectScope; cwd: string; sessionStateDir?: string; now?: Date; /** When set, attach public-rate USD estimates for matched models. */ publicPricing?: PublicPricingSnapshot | null; } export interface HistoryWarning { code: string; count: number; message: string; } export interface HistorySkillRow { skill: string; invocations: number; sessions: number; lastInvokedAt: string; } export interface UsageTotals { inputTokens?: number; cachedInputTokens?: number; cacheWriteTokens?: number; outputTokens?: number; totalTokens?: number; totalNanoAiu?: number; premiumRequests?: number; durationMs?: number; } export type MetricSessions = Partial>; export interface UsageBucket { sessions: number; sessionsWithTelemetry: number; totals: UsageTotals; metricSessions: MetricSessions; } export interface SingleSkillAssociation extends UsageBucket { skill: string; } export interface HistoryAnalysis { schemaVersion: 1; generatedAt: string; filters: { window: HistoryWindow; project: HistoryProjectScope; cwd: string; since: string | null; }; coverage: { sessionsDiscovered: number; sessionsRead: number; sessionsMatched: number; sessionsWithInvocations: number; filesUnreadable: number; malformedLines: number; invocationsCounted: number; shutdownTelemetrySessions: number; }; skills: HistorySkillRow[]; sessionUsage: UsageBucket & { attribution: "session-level-only"; singleSkillAssociations: SingleSkillAssociation[]; sharedSkillSessions: UsageBucket; estimates?: HistorySpendEstimates; }; warnings: HistoryWarning[]; } export declare function windowDays(window: HistoryWindow): number | null; export declare function parseHistoryWindow(value: string): HistoryWindow; export declare function analyzeHistory(options: AnalyzeHistoryOptions): HistoryAnalysis;