#include <tool_dispatcher.h>

Classes | |
| struct | BatchResult |
| Result of a batch tool call. More... | |
| struct | BatchToolCall |
| Batch tool call request. More... | |
| struct | ToolInfo |
| Tool information for discoverability. More... | |
| struct | ToolPreferences |
Public Member Functions | |
| std::vector< ToolInfo > | GetAvailableTools () const |
| Get list of all available tools. | |
| std::optional< ToolInfo > | GetToolInfo (const std::string &tool_name) const |
| Get detailed information about a specific tool. | |
| std::vector< ToolInfo > | SearchTools (const std::string &query) const |
| Search tools by keyword. | |
| BatchResult | DispatchBatch (const BatchToolCall &batch) |
| Execute multiple tool calls in a batch. | |
| ToolDispatcher ()=default | |
| absl::StatusOr< std::string > | Dispatch (const ::yaze::cli::ToolCall &tool_call) |
| void | SetRomContext (Rom *rom) |
| void | SetProjectContext (project::YazeProject *project) |
| void | SetAsarWrapper (core::AsarWrapper *asar_wrapper) |
| void | SetToolPreferences (const ToolPreferences &prefs) |
| const ToolPreferences & | preferences () const |
Private Member Functions | |
| bool | IsToolEnabled (const ToolDefinition &def) const |
Private Attributes | |
| Rom * | rom_context_ = nullptr |
| project::YazeProject * | project_context_ = nullptr |
| core::AsarWrapper * | asar_wrapper_ = nullptr |
| ToolPreferences | preferences_ |
Definition at line 24 of file tool_dispatcher.h.
|
default |
| std::vector< ToolDispatcher::ToolInfo > yaze::cli::agent::ToolDispatcher::GetAvailableTools | ( | ) | const |
Get list of all available tools.
Definition at line 133 of file tool_dispatcher.cc.
References yaze::cli::agent::ToolRegistry::Get(), yaze::cli::agent::ToolRegistry::GetAllTools(), and IsToolEnabled().
Referenced by SearchTools().

| std::optional< ToolDispatcher::ToolInfo > yaze::cli::agent::ToolDispatcher::GetToolInfo | ( | const std::string & | tool_name | ) | const |
Get detailed information about a specific tool.
Definition at line 145 of file tool_dispatcher.cc.
References yaze::cli::agent::ToolRegistry::Get(), yaze::cli::agent::ToolRegistry::GetToolDefinition(), and yaze::cli::agent::ToolDispatcher::ToolInfo::name.

| std::vector< ToolDispatcher::ToolInfo > yaze::cli::agent::ToolDispatcher::SearchTools | ( | const std::string & | query | ) | const |
Search tools by keyword.
Definition at line 154 of file tool_dispatcher.cc.
References GetAvailableTools().

| ToolDispatcher::BatchResult yaze::cli::agent::ToolDispatcher::DispatchBatch | ( | const BatchToolCall & | batch | ) |
Execute multiple tool calls in a batch.
When parallel=false, calls are executed sequentially. When parallel=true, calls are executed concurrently (if no dependencies).
Definition at line 175 of file tool_dispatcher.cc.
References yaze::cli::agent::ToolDispatcher::BatchToolCall::calls, Dispatch(), yaze::cli::agent::ToolDispatcher::BatchResult::failed_count, yaze::cli::agent::ToolDispatcher::BatchToolCall::parallel, yaze::cli::agent::ToolDispatcher::BatchResult::results, yaze::cli::agent::ToolDispatcher::BatchResult::statuses, yaze::cli::agent::ToolDispatcher::BatchResult::successful_count, and yaze::cli::agent::ToolDispatcher::BatchResult::total_execution_time_ms.

| absl::StatusOr< std::string > yaze::cli::agent::ToolDispatcher::Dispatch | ( | const ::yaze::cli::ToolCall & | tool_call | ) |
Definition at line 70 of file tool_dispatcher.cc.
References yaze::cli::ToolCall::args, asar_wrapper_, yaze::cli::agent::ToolRegistry::CreateHandler(), yaze::cli::agent::ToolRegistry::Get(), yaze::cli::agent::ToolRegistry::GetToolDefinition(), IsToolEnabled(), project_context_, yaze::cli::agent::ToolDefinition::requires_project, yaze::cli::agent::ToolDefinition::requires_rom, rom_context_, and yaze::cli::ToolCall::tool_name.
Referenced by DispatchBatch(), yaze::cli::agent::ConversationalAgentService::HandleExternalResponse(), and yaze::cli::agent::ConversationalAgentService::SendMessage().

|
inline |
Definition at line 112 of file tool_dispatcher.h.
References rom_context_.
Referenced by yaze::cli::agent::ConversationalAgentService::SetRomContext().
|
inline |
Definition at line 113 of file tool_dispatcher.h.
References project_context_.
|
inline |
Definition at line 114 of file tool_dispatcher.h.
References asar_wrapper_.
|
inline |
Definition at line 116 of file tool_dispatcher.h.
References preferences_.
Referenced by yaze::cli::agent::ConversationalAgentService::ConversationalAgentService(), yaze::cli::agent::ConversationalAgentService::ConversationalAgentService(), and yaze::cli::agent::ConversationalAgentService::SetToolPreferences().
|
inline |
Definition at line 119 of file tool_dispatcher.h.
References preferences_.
|
private |
Definition at line 48 of file tool_dispatcher.cc.
References yaze::cli::agent::ToolDispatcher::ToolPreferences::build, yaze::cli::agent::ToolDefinition::category, yaze::cli::agent::ToolDispatcher::ToolPreferences::code_gen, yaze::cli::agent::ToolDispatcher::ToolPreferences::dungeon, yaze::cli::agent::ToolDispatcher::ToolPreferences::emulator, yaze::cli::agent::ToolDispatcher::ToolPreferences::filesystem, yaze::cli::agent::ToolDispatcher::ToolPreferences::gui, yaze::cli::agent::ToolDispatcher::ToolPreferences::memory_inspector, yaze::cli::agent::ToolDispatcher::ToolPreferences::messages, yaze::cli::agent::ToolDispatcher::ToolPreferences::meta_tools, yaze::cli::agent::ToolDispatcher::ToolPreferences::music, yaze::cli::agent::ToolDispatcher::ToolPreferences::overworld, preferences_, yaze::cli::agent::ToolDispatcher::ToolPreferences::project, yaze::cli::agent::ToolDispatcher::ToolPreferences::resources, yaze::cli::agent::ToolDispatcher::ToolPreferences::sprite, yaze::cli::agent::ToolDispatcher::ToolPreferences::test_helpers, and yaze::cli::agent::ToolDispatcher::ToolPreferences::visual_analysis.
Referenced by Dispatch(), and GetAvailableTools().
|
private |
Definition at line 125 of file tool_dispatcher.h.
Referenced by Dispatch(), and SetRomContext().
|
private |
Definition at line 126 of file tool_dispatcher.h.
Referenced by Dispatch(), and SetProjectContext().
|
private |
Definition at line 127 of file tool_dispatcher.h.
Referenced by Dispatch(), and SetAsarWrapper().
|
private |
Definition at line 128 of file tool_dispatcher.h.
Referenced by IsToolEnabled(), preferences(), and SetToolPreferences().