Import Coucou 0.1.9 (Louis-CFM/coucou@83708fe), Mac app only

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maksarsanjeev
2026-10-06 19:34:32 +03:00
commit 53b4f60da1
158 changed files with 29442 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
import Foundation
/// Returns the URL only if it is a plain web link (http/https with a host). Model output
/// and API data can carry file://, smb:// or custom app schemes that would launch local apps
/// or deep links; those never reach NSWorkspace.open.
func safeWebURL(_ string: String?) -> URL? {
guard let string,
let url = URL(string: string.trimmingCharacters(in: .whitespacesAndNewlines)),
let scheme = url.scheme?.lowercased(), scheme == "https" || scheme == "http",
let host = url.host, !host.isEmpty else { return nil }
return url
}