agentLoadModeFromLabel function

AgentLoadMode? agentLoadModeFromLabel(
  1. String? label
)

Parses a default|pi|omp label (config agent.mode, FA_AGENT_MODE). Returns null for null/empty (no intent); an unknown label is the caller's error to report (ConfigException at boot).

Implementation

AgentLoadMode? agentLoadModeFromLabel(String? label) {
  if (label == null || label.isEmpty) return null;
  for (final mode in AgentLoadMode.values) {
    if (mode.label == label) return mode;
  }
  return null;
}