MCPcopy Index your code
hub / github.com/AI45Lab/Code / tasks

Method tasks

sdk/node/src/lib.rs:3685–3697  ·  view source on GitHub ↗
(&self, tasks: Vec<DelegateTaskOptions>)

Source from the content-addressed store, hash-verified

3683 /// Execute several delegated child-agent tasks concurrently through `parallel_task`.
3684 #[napi(ts_args_type = "tasks: DelegateTaskOptions[]")]
3685 pub async fn tasks(&self, tasks: Vec<DelegateTaskOptions>) -> napi::Result<ToolResult> {
3686 let args = parallel_task_options_to_args(tasks);
3687
3688 let session = self.inner.clone();
3689 let result = get_runtime()
3690 .spawn(async move { session.tool("parallel_task", args).await })
3691 .await
3692 .map_err(|e| napi::Error::from_reason(format!("Task join error: {e}")))?
3693 .map_err(|e| {
3694 napi::Error::from_reason(format!("Parallel task delegation failed: {e}"))
3695 })?;
3696 Ok(tool_result_from_core(result))
3697 }
3698
3699 /// Execute several delegated child-agent tasks concurrently through `parallel_task`.
3700 #[napi(

Callers 2

parallel_taskMethod · 0.45

Calls 6

tool_result_from_coreFunction · 0.85
get_runtimeFunction · 0.70
cloneMethod · 0.45
spawnMethod · 0.45
toolMethod · 0.45

Tested by

no test coverage detected