taskFromResult method
If a tools/call (or other) result is a CreateTaskResult — the
extension's resultType: "task" or the 2025-11-25 core's nested
task — returns the Task; otherwise null.
Implementation
Task? taskFromResult(Map<String, dynamic> result) =>
McpResultType.of(result) == McpResultType.task || result['task'] is Map
? taskOf(result)
: null;