tryParse static method
Decodes a token written in ai.yaml or :ai mode <x>, returning null
for anything unrecognised so the caller can report a usage error.
Implementation
static AgentMode? tryParse(String? value) => switch (value?.trim()) {
'standard' => AgentMode.standard,
'plan' => AgentMode.plan,
'auto' => AgentMode.auto,
_ => null,
};