mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-18 03:11:45 +00:00
* style: apply SwiftFormat 0.62.1 rules Refs #103202 * ci: enforce deterministic Swift lint Refs #103202 * refactor: keep gateway connect lint-clean Refs #103202 * style: keep iOS typography checks warning-free * ci: route MLX Swift changes through pre-push * fix: preserve native i18n extraction after Swift cleanup * refactor: keep rebased Swift surfaces lint-clean * style: format latest Swift additions * chore: refresh native i18n inventory * style: keep generated Swift formatter-clean * fix: preserve node route invalidation callbacks * fix: keep native translation IDs stable * fix: retain native translation identifiers * fix: preserve translations across Swift source moves
32 lines
977 B
Swift
32 lines
977 B
Swift
import Foundation
|
|
|
|
public enum ShareToAgentSettings {
|
|
private static var suiteName: String {
|
|
OpenClawAppGroup.identifier
|
|
}
|
|
|
|
private static let defaultInstructionKey = "share.defaultInstruction"
|
|
|
|
private static var defaults: UserDefaults {
|
|
UserDefaults(suiteName: suiteName) ?? .standard
|
|
}
|
|
|
|
public static func loadDefaultInstruction() -> String {
|
|
let raw = self.defaults.string(forKey: self.defaultInstructionKey)?
|
|
.trimmingCharacters(in: .whitespacesAndNewlines)
|
|
if let raw, !raw.isEmpty {
|
|
return raw
|
|
}
|
|
return ""
|
|
}
|
|
|
|
public static func saveDefaultInstruction(_ value: String?) {
|
|
let trimmed = value?.trimmingCharacters(in: .whitespacesAndNewlines) ?? ""
|
|
if trimmed.isEmpty {
|
|
self.defaults.removeObject(forKey: self.defaultInstructionKey)
|
|
return
|
|
}
|
|
self.defaults.set(trimmed, forKey: self.defaultInstructionKey)
|
|
}
|
|
}
|