feat(macos): add macOS menu-bar app and harden cross-device iCloud sync
Introduce a standalone macOS menu-bar app (OSGKeyboardMac) that reuses the platform-agnostic OSGKeyboardShared core: record -> cloud/local ASR -> polish -> insert. Local mode uses Qwen3-ASR via mlx-swift-asr (macOS 15+, Apple Silicon); iOS targets stay zero-SPM. Harden iCloud sync for multi-device correctness: - Per-field settings merge (appSettings.v2) so concurrent edits no longer clobber each other's unrelated fields. - Per-device usage statistics (G-Counter) that sum instead of max(). - Tombstoned dictionary/history merge so deletes propagate and entries can't resurrect. - API keys replicate via iCloud Keychain, never iCloud KVS JSON; pulling a legacy blob without key fields no longer wipes local Keychain entries. - Add a low-risk "Sync Now" action in Settings. Fix Flow keyboard mic state: stay orange until the host publishes a real ready contract, share a single MicVoiceAvailability gate, and self-heal stale cross-process heartbeat jitter instead of getting stuck. Extract shared storage (SpeechHistoryStore/UsageStatisticsStore, ConfigurationStore) into OSGKeyboardShared and add tests for the new sync/merge logic.
This commit is contained in:
@@ -48,7 +48,7 @@ public actor PolishingService {
|
||||
case translate(targetLocaleId: String)
|
||||
}
|
||||
|
||||
private let store: AppGroupStore
|
||||
private let store: any ConfigurationStore
|
||||
private let timeout: TimeInterval
|
||||
/// Optional injected client (mostly for testing). When nil we build
|
||||
/// one from `store.makeClient()` per call.
|
||||
@@ -60,7 +60,7 @@ public actor PolishingService {
|
||||
/// own slack on top of the length-scaled budget in `polishRemote`, so
|
||||
/// no `+1` is baked in here.
|
||||
public init(
|
||||
store: AppGroupStore = AppGroupStore(),
|
||||
store: any ConfigurationStore = AppGroupStore(),
|
||||
client: LLMClient? = nil,
|
||||
timeout: TimeInterval? = nil
|
||||
) {
|
||||
@@ -346,7 +346,7 @@ public actor PolishingService {
|
||||
}
|
||||
|
||||
internal static func resolvedProviderId(
|
||||
store: AppGroupStore,
|
||||
store: any ConfigurationStore,
|
||||
providerIdOverride: String?
|
||||
) -> String {
|
||||
if let providerIdOverride {
|
||||
@@ -360,7 +360,7 @@ public actor PolishingService {
|
||||
}
|
||||
|
||||
internal static func resolveLLMEndpoint(
|
||||
store: AppGroupStore,
|
||||
store: any ConfigurationStore,
|
||||
preset: LLMProvider,
|
||||
providerIdOverride: String?
|
||||
) -> (baseURL: String, model: String) {
|
||||
|
||||
Reference in New Issue
Block a user