native macOS codings agent orchestrator prowl.onev.cat
Something went wrong. Try again.
Swift
12345678910111213141516171819202122232425/// Selection state for a profile field that offers suggestions without/// discarding a user-provided literal value.nonisolated enum AgentProfileSuggestionSelection: Hashable, Sendable { case runtimeDefault case suggestion(String) case custom(String)
init(value: String?, suggestions: [String]) { guard let value else { self = .runtimeDefault return } self = suggestions.contains(value) ? .suggestion(value) : .custom(value) }
var value: String? { switch self { case .runtimeDefault: return nil case .suggestion(let value), .custom(let value): return value } }}