(&self, options: DelegateTaskOptions)
| 3663 | /// Delegate a bounded task to a child agent through the built-in `task` tool. |
| 3664 | #[napi(ts_args_type = "options: DelegateTaskOptions")] |
| 3665 | pub async fn task(&self, options: DelegateTaskOptions) -> napi::Result<ToolResult> { |
| 3666 | let args = delegate_task_options_to_args(options); |
| 3667 | |
| 3668 | let session = self.inner.clone(); |
| 3669 | let result = get_runtime() |
| 3670 | .spawn(async move { session.tool("task", args).await }) |
| 3671 | .await |
| 3672 | .map_err(|e| napi::Error::from_reason(format!("Task join error: {e}")))? |
| 3673 | .map_err(|e| napi::Error::from_reason(format!("Task delegation failed: {e}")))?; |
| 3674 | Ok(tool_result_from_core(result)) |
| 3675 | } |
| 3676 | |
| 3677 | /// Delegate a bounded task to a child agent through the built-in `task` tool. |
| 3678 | #[napi(ts_args_type = "options: DelegateTaskOptions")] |
no test coverage detected