tryParse static method

AgentMode? tryParse(
  1. String? value
)

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,
};