#pragma once
#include "../agent.hpp"
#include "../message.hpp"
#include "../tool.hpp"
namespace agent_smith::internal
{
/// Run every call concurrently and collect tool messages in input order.
/// Timed-out calls retain their tool instance until execution completes.
/// If supplied, final_message receives the first successful structured _done
/// result in call order. It must outlive the returned task.
mw::Task<mw::E<std::vector<ToolMessage>>> dispatchTools(
Runtime& runtime, ToolRegistry& registry, std::vector<ToolCall> calls,
AgentConfig config = {}, std::optional<std::string>* final_message = nullptr);
} // namespace agent_smith::internal