macos-ai-menubar-usage/AIMenubarUsage/Providers/UsageProvider.swift
Felipe M. 00c4e33171
Initial commit: AI Menubar Usage — macOS menu bar app for Cursor and Claude.
Includes provider integrations, settings, NSStatusItem UI, tests, Makefile, and README with screenshot.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-27 20:41:40 +02:00

16 lines
525 B
Swift

import Foundation
enum AuthCredentials: Sendable {
case cursorSession(cookieValue: String)
case cursorAdminAPI(apiKey: String)
case claudeCLI
case claudeOAuth(accessToken: String)
case claudeAdminAPI(apiKey: String)
}
protocol UsageProvider: Sendable {
var id: ProviderID { get }
var displayName: String { get }
func fetchUsage(credentials: AuthCredentials, cache: UsageCache) async throws -> ProviderUsageSnapshot
func resolveCredentials(authMode: AuthMode) throws -> AuthCredentials
}