(
options: AutoDelegationOptions,
)
| 2273 | } |
| 2274 | |
| 2275 | fn 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. |
| 2295 | fn js_session_options_to_rust(options: Option<SessionOptions>) -> napi::Result<RustSessionOptions> { |
no outgoing calls
no test coverage detected