requireDelegate function
Fails with the capability query's reason when delegate is unavailable,
so every task's create refuses a delegate the same way on every
platform.
Implementation
void requireDelegate(TaskCapabilities capabilities, Delegate delegate) {
if (capabilities.supportedDelegates.contains(delegate)) return;
throw RuntimeUnavailableException(
'The ${delegate.name.toUpperCase()} delegate is unavailable here.',
fix:
capabilities.unavailableReasons[delegate] ??
'Choose a delegate the capability query reports as supported.',
);
}