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

Function js_auto_delegation_to_rust

sdk/node/src/lib.rs:2275–2292  ·  view source on GitHub ↗
(
    options: AutoDelegationOptions,
)

Source from the content-addressed store, hash-verified

2273}
2274
2275fn js_auto_delegation_to_rust(
2276 options: AutoDelegationOptions,
2277) -> a3s_code_core::AutoDelegationConfig {
2278 let mut config = a3s_code_core::AutoDelegationConfig::default();
2279 if let Some(enabled) = options.enabled {
2280 config.enabled = enabled;
2281 }
2282 if let Some(auto_parallel) = options.auto_parallel {
2283 config.auto_parallel = auto_parallel;
2284 }
2285 if let Some(min_confidence) = options.min_confidence {
2286 config.min_confidence = (min_confidence as f32).clamp(0.0, 1.0);
2287 }
2288 if let Some(max_tasks) = options.max_tasks {
2289 config.max_tasks = (max_tasks as usize).max(1);
2290 }
2291 config
2292}
2293
2294/// Build RustSessionOptions from JS SessionOptions.
2295fn js_session_options_to_rust(options: Option<SessionOptions>) -> napi::Result<RustSessionOptions> {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected