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

Function parse_planning_mode

sdk/node/src/lib.rs:2611–2621  ·  view source on GitHub ↗
(mode: &str)

Source from the content-addressed store, hash-verified

2609}
2610
2611fn parse_planning_mode(mode: &str) -> napi::Result<RustPlanningMode> {
2612 match mode.trim().to_ascii_lowercase().as_str() {
2613 "auto" => Ok(RustPlanningMode::Auto),
2614 "enabled" | "enable" | "on" | "force" | "forced" | "true" => Ok(RustPlanningMode::Enabled),
2615 "disabled" | "disable" | "off" | "false" => Ok(RustPlanningMode::Disabled),
2616 _ => Err(napi::Error::from_reason(format!(
2617 "Invalid planningMode '{}'. Must be: auto, enabled, or disabled",
2618 mode
2619 ))),
2620 }
2621}
2622
2623fn parse_permission_decision(value: Option<String>) -> napi::Result<RustPermissionDecision> {
2624 match value

Callers 1

apply_planning_modeFunction · 0.70

Calls 1

as_strMethod · 0.45

Tested by

no test coverage detected