Read App Intents Documentation

Nucleic-Session: 56C5F781-4444-466B-91CE-A7734A8E117F
Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
2026-07-06 14:44:18 -07:00
co-authored by Nucleic
parent 4764f483ff
commit 8218d6042e
@@ -0,0 +1,24 @@
import AppIntents
/// Friendly, spoken-safe failures for Nucleic's App Intents. The phone is a thin client with no
/// local authority (docs/APP_INTENTS_OPPORTUNITIES §3.1): an intent that can't reach the paired
/// Mac must fail *clean* with a dialog, never silently or with a raw error.
enum IntentError: Error, CustomLocalizedStringResourceConvertible {
/// No live channel to any paired Mac (and none came up within the wait window).
case macUnreachable
/// Not paired with a Mac yet — nothing to act on.
case notPaired
/// The action needs `control` scope, which this device hasn't been granted.
case controlScopeRequired
var localizedStringResource: LocalizedStringResource {
switch self {
case .macUnreachable:
"Your Mac isn't reachable right now. Try again when it's online."
case .notPaired:
"Pair this iPhone with your Mac in Nucleic first."
case .controlScopeRequired:
"This device can view and approve, but isn't allowed to control sessions."
}
}
}