feat(keyboard): improve typing, voice flow, and polish reliability

Reduce extension memory pressure and delivery races while adding richer candidates, tactile feedback, and safer two-level creative polishing.
This commit is contained in:
Rocky
2026-08-05 21:39:31 +08:00
parent 38e5ad570d
commit 31f5937a7f
177 changed files with 8343 additions and 3904 deletions
+2 -8
View File
@@ -4,8 +4,8 @@
// Bag of inputs the LLM polish service needs. Caller assembles it
// before calling `IntelligentPolishingService.polish(_:context:)`.
// Splitting it out keeps the polish service's signature stable as
// we add more signals (app context, intensity, personal dictionary,
// preceding text, etc.) over time.
// we add more signals (app context, personal dictionary, preceding text,
// etc.) over time.
import Foundation
@@ -42,10 +42,6 @@ public struct PolishContext: Sendable {
/// LLM is told to pick a neutral tone on its own.
public let appContext: AppContext
/// User-configured intensity. Drives how aggressively the LLM
/// is allowed to rewrite.
public let intensity: PolishIntensity
/// Optional preceding text (e.g. a few hundred characters of
/// what the user already typed before the recording). The LLM
/// uses it to resolve "this / / " references and to
@@ -70,7 +66,6 @@ public struct PolishContext: Sendable {
public init(
appContext: AppContext = .unknown,
intensity: PolishIntensity = .default,
precedingText: String? = nil,
followingText: String? = nil,
fieldHints: FieldHints? = nil,
@@ -79,7 +74,6 @@ public struct PolishContext: Sendable {
maxFollowingChars: Int = 200
) {
self.appContext = appContext
self.intensity = intensity
self.precedingText = precedingText
self.followingText = followingText
self.fieldHints = fieldHints