Files
OSGKeyboard/OSGKeyboardShared/Core/Configuration/ConfigurationStore.swift
T
Rocky cc8dd1070a feat: macOS architecture, cloud ASR/LLM providers, and 6-step iOS onboarding
- Add macOS menu-bar dictation app with local ASR models (SenseVoice/Qwen3),
  global Option hotkey, and bottom overlay
- Add cloud ASR/LLM providers (Anthropic, Volcengine, Bailian, and more) with
  provider logos, model listing, and connection checks
- Add shared 7-day usage stats UI (UsageStatsCluster / SevenDayUsageChart)
- Add iOS onboarding step 6 for polish LLM setup; hide custom-language-model
  diagnostic toggle behind DEBUG
- Unify iOS onboarding tagline with the macOS brand line ("开口即文字。")
- Rewrite README (Chinese-first, product-oriented) and refresh GitHub Pages
2026-07-11 19:10:20 +08:00

41 lines
1.5 KiB
Swift

// ConfigurationStore.swift
// OSGKeyboard · Shared
//
// Cross-platform read facade for the dictation pipeline (ASR → polish).
// iOS implements this via `AppGroupStore` (App Group UserDefaults + Keychain).
// macOS will gain a separate implementation (standard UserDefaults + Keychain)
// without pulling in keyboard-extension-only APIs.
import Foundation
/// Read-only configuration surface consumed by ASR, cloud ASR, and polish services.
///
/// Keep this protocol narrow: only what the shared pipeline needs today.
/// Platform-specific settings UI and iCloud sync stay on concrete stores.
public protocol ConfigurationStore: Sendable {
/// Polish / LLM provider id.
var providerId: String { get }
var baseURL: String { get }
var apiKey: String { get }
var model: String { get }
/// Cloud ASR provider id — independent from polish when `engineMode == "cloud"`.
var asrProviderId: String { get }
var asrBaseURL: String { get }
var asrApiKey: String { get }
var asrModel: String { get }
var engineMode: String { get }
var polishIntensity: PolishIntensity { get }
var llmThinkingEnabled: Bool { get }
var personalDictionary: PersonalDictionary { get }
/// Foreground-app context for polish prompts (keyboard extension publishes this).
var detectedAppContext: (context: AppContext, observedAt: Date)? { get }
/// Provider-specific ASR caches (e.g. Alibaba Fun-ASR vocabulary IDs).
var cloudASRPersistence: UserDefaults { get }
func makeClient() -> LLMClient
}