MCPcopy Create free account
hub / github.com/AI45Lab/Code / from_str

Method from_str

core/src/subagent.rs:243–253  ·  view source on GitHub ↗
(value: &str)

Source from the content-addressed store, hash-verified

241 type Err = anyhow::Error;
242
243 fn from_str(value: &str) -> anyhow::Result<Self> {
244 match value.trim().to_ascii_lowercase().as_str() {
245 "read_only" | "readonly" | "read-only" | "explore" | "scanner" => Ok(Self::ReadOnly),
246 "planner" | "plan" => Ok(Self::Planner),
247 "implementer" | "implementation" | "general" | "executor" => Ok(Self::Implementer),
248 "verifier" | "verification" | "verify" | "tester" => Ok(Self::Verifier),
249 "reviewer" | "review" | "code-review" | "code_reviewer" => Ok(Self::Reviewer),
250 "custom" => Ok(Self::Custom),
251 other => Err(anyhow::anyhow!("unknown worker agent kind '{}'", other)),
252 }
253 }
254}
255
256/// Backward-friendly alias for callers that name this pattern cattle mode.

Callers

nothing calls this directly

Calls 1

as_strMethod · 0.45

Tested by

no test coverage detected