repo_description: A cross-platform desktop All-in-One assistant tool for Claude Code, Codex, OpenCode, openclaw & Gemini CLI.
repo_topics: ai-tools claude-code codex desktop-app mcp minimax omo open-source openclaw openclaw-ui opencode provider-management rust skills skills-management tauri typescript wsl-support
code: // 使用统计相关类型定义
  
  export interface TokenUsage {
    inputTokens: number;
    outputTokens: number;
    cacheReadTokens: number;
    cacheCreationTokens: number;
  }
  
  export interface RequestLog {
    requestId: string;
    providerId: string;
    providerName?: string;
    appType: string;
    model: string;
    requestModel?: string;
    costMultiplier: string;
    inputTokens: number;
    outputTokens: number;
    cacheReadTokens: number;
    cacheCreationTokens: number;
    inputCostUsd: string;
    outputCostUsd: string;
    cacheReadCostUsd: string;
    cacheCreationCostUsd: string;
    totalCostUsd: string;
    isStreaming: boolean;
    latencyMs: number;
    firstTokenMs?: number;
    durationMs?: number;
    statusCode: number;
    errorMessage?: string;
    createdAt: number;
    dataSource?: string;
  }
  
  export interface SessionSyncResult {
    imported: number;
    skipped: number;
    filesScanned: number;
    errors: string[];
  }
  
  export interface DataSourceSummary {
    dataSource: string;
    requestCount: number;
    totalCostUsd: string;
  }
  
  export interface PaginatedLogs {
    data: RequestLog[];
    total: number;
    page: number;
    pageSize: number;
  }
  
  export interface ModelPricing {
    modelId: string;
    displayName: string;
    inputCostPerMillion: string;
    outputCostPerMillion: string;
    cacheReadCostPerMillion: string;
    cacheCreationCostPerMillion: string;
  }
  
  export interface UsageSummary {
    totalRequests: number;
    totalCost: string;
    totalInputTokens: number;
    totalOutputTokens: number;
    totalCacheCreationTokens: number;
    totalCacheReadTokens: number;
    successRate: number;
  }
  
  export interface DailyStats {
    date: string;
    requestCount: number;
    totalCost: string;
    totalTokens: number;
    totalInputTokens: number;
    totalOutputTokens: number;
    totalCacheCreationTokens: number;
    totalCacheReadTokens: number;
  }
  
  export interface ProviderStats {
    providerId: string;
    providerName: string;
    requestCount: number;
    totalTokens: number;
    totalCost: string;
    successRate: number;
    avgLatencyMs: number;
  }
  
  export interface ModelStats {
    model: string;
    requestCount: number;
    totalTokens: number;
    totalCost: string;
    avgCostPerRequest: string;
  }
  
  export interface LogFilters {
    appType?: string;
    providerName?: string;
    model?: string;
    statusCode?: number;
    startDate?: number;
    endDate?: number;
  }
  
  export interface ProviderLimitStatus {
    providerId: string;
    dailyUsage: string;
    dailyLimit?: string;
    dailyExceeded: boolean;
    monthlyUsage: string;
    monthlyLimit?: string;
    monthlyExceeded: boolean;
  }
  
  export type UsageRangePreset = "today" | "1d" | "7d" | "14d" | "30d" | "custom";
  
  export interface UsageRangeSelection {
    preset: UsageRangePreset;
    customStartDate?: number;
    customEndDate?: number;
  }
  
  export type AppTypeFilter = "all" | "claude" | "codex" | "gemini";
  
  export interface StatsFilters {
    timeRange: UsageRangePreset;
    providerId?: string;
    appType?: string;
  }
  