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

Function apply_planning_mode

sdk/node/src/lib.rs:2595–2609  ·  view source on GitHub ↗
(
    opts: RustSessionOptions,
    planning_mode: Option<&str>,
    planning: Option<bool>,
)

Source from the content-addressed store, hash-verified

2593}
2594
2595fn apply_planning_mode(
2596 opts: RustSessionOptions,
2597 planning_mode: Option<&str>,
2598 planning: Option<bool>,
2599) -> napi::Result<RustSessionOptions> {
2600 if let Some(mode) = planning_mode {
2601 return Ok(opts.with_planning_mode(parse_planning_mode(mode)?));
2602 }
2603
2604 if let Some(enabled) = planning {
2605 Ok(opts.with_planning(enabled))
2606 } else {
2607 Ok(opts)
2608 }
2609}
2610
2611fn parse_planning_mode(mode: &str) -> napi::Result<RustPlanningMode> {
2612 match mode.trim().to_ascii_lowercase().as_str() {

Calls 3

with_planning_modeMethod · 0.80
with_planningMethod · 0.80
parse_planning_modeFunction · 0.70