feat(polish): add configurable style packs
Add shared prompt composition, custom style management, iCloud sync, and native iOS/macOS selection interfaces so users can keep a consistent writing voice across devices.
This commit is contained in:
@@ -66,6 +66,11 @@ public struct AppGroupStore: @unchecked Sendable {
|
||||
public var handednessPreference: HandednessPreference { configuration.handednessPreference }
|
||||
public var cursorDragNavigationEnabled: Bool { configuration.cursorDragNavigationEnabled }
|
||||
public var polishIntensity: PolishIntensity { configuration.polishIntensity }
|
||||
public var polishStyleCatalog: PolishStyleCatalog { configuration.polishStyleCatalog }
|
||||
public var activePolishStyleId: String { configuration.activePolishStyleId }
|
||||
public var activePolishStyle: PolishStylePack {
|
||||
PolishStylePackCatalog.resolve(id: activePolishStyleId, userCatalog: polishStyleCatalog)
|
||||
}
|
||||
public var llmThinkingEnabled: Bool { configuration.llmThinkingEnabled }
|
||||
public var isTranslationEffective: Bool { configuration.isTranslationEffective }
|
||||
public var isLocalEngine: Bool { configuration.isLocalEngine }
|
||||
@@ -121,6 +126,33 @@ public struct AppGroupStore: @unchecked Sendable {
|
||||
mutateConfiguration { $0.polishIntensity = intensity }
|
||||
}
|
||||
|
||||
// MARK: - Polish styles
|
||||
|
||||
public func setPolishStyleCatalog(_ catalog: PolishStyleCatalog) {
|
||||
mutateConfiguration { $0.polishStyleCatalog = catalog }
|
||||
AppGroupConfigDarwin.postConfigChanged()
|
||||
}
|
||||
|
||||
public func setActivePolishStyleId(_ id: String) {
|
||||
mutateConfiguration { config in
|
||||
config.activePolishStyleId = PolishStylePackCatalog.isValidActiveID(
|
||||
id,
|
||||
userCatalog: config.polishStyleCatalog
|
||||
) ? id : PolishStylePackCatalog.defaultID
|
||||
}
|
||||
AppGroupConfigDarwin.postConfigChanged()
|
||||
}
|
||||
|
||||
public func deletePolishStylePack(id: String, at date: Date = Date()) {
|
||||
mutateConfiguration { config in
|
||||
config.polishStyleCatalog.recordDeletion(of: id, at: date)
|
||||
if config.activePolishStyleId == id {
|
||||
config.activePolishStyleId = PolishStylePackCatalog.defaultID
|
||||
}
|
||||
}
|
||||
AppGroupConfigDarwin.postConfigChanged()
|
||||
}
|
||||
|
||||
public func setLLMThinkingEnabled(_ enabled: Bool) {
|
||||
mutateConfiguration { $0.llmThinkingEnabled = enabled }
|
||||
AppGroupConfigDarwin.postConfigChanged()
|
||||
|
||||
Reference in New Issue
Block a user