Rename the on-disk directory tokens to Tokens, matching its PascalCase siblings (Projects, HookPacks). FileTokenStore now names files <service> or <service>.<account>; the .token suffix and luma.llm. / re.frida.Luma prefixes are gone. Existing entries become orphaned and users will be prompted to enter API keys and re-auth GitHub on next run.
22 lines
717 B
Swift
22 lines
717 B
Swift
import Foundation
|
|
|
|
public struct LLMCredentialStore: Sendable {
|
|
public let backing: TokenStore
|
|
|
|
public init(backing: TokenStore) {
|
|
self.backing = backing
|
|
}
|
|
|
|
public func apiKey(providerID: String, account: String = "default") async throws -> String? {
|
|
try await backing.get(service: providerID, account: account)
|
|
}
|
|
|
|
public func setAPIKey(_ key: String, providerID: String, account: String = "default") async throws {
|
|
try await backing.set(service: providerID, account: account, token: key)
|
|
}
|
|
|
|
public func deleteAPIKey(providerID: String, account: String = "default") async throws {
|
|
try await backing.delete(service: providerID, account: account)
|
|
}
|
|
}
|