#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 | SetAssemblySymbolTable (const std::map< std::string, core::AsarSymbol > *table) |
| void | SetToolPreferences (const ToolPreferences &prefs) |
| const ToolPreferences & | preferences () const |
Private Member Functions | |
| bool | IsToolEnabled (const ToolDefinition &def) const |
| absl::Status | ValidateCall (const ToolDefinition &def, const ToolCall &call) const |
| absl::StatusOr< std::string > | DispatchMetaTool (const ToolCall &call) const |
Private Attributes | |
| Rom * | rom_context_ = nullptr |
| project::YazeProject * | project_context_ = nullptr |
| core::AsarWrapper * | asar_wrapper_ = nullptr |
| const std::map< std::string, core::AsarSymbol > * | assembly_symbol_table_ |
| std::map< std::string, core::AsarSymbol > | asar_symbols_cache_ |
| ToolPreferences | preferences_ |
Definition at line 25 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 302 of file tool_dispatcher.cc.
References yaze::cli::agent::ToolRegistry::Get(), yaze::cli::agent::ToolRegistry::GetAllTools(), IsToolEnabled(), and yaze::cli::agent::kMutating.
Referenced by DispatchMetaTool(), and 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 318 of file tool_dispatcher.cc.
References yaze::cli::agent::ToolRegistry::Get(), yaze::cli::agent::ToolRegistry::GetToolDefinition(), yaze::cli::agent::kMutating, and yaze::cli::agent::ToolDispatcher::ToolInfo::name.
Referenced by DispatchMetaTool().

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

| 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 357 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 216 of file tool_dispatcher.cc.
References yaze::cli::ToolCall::args, asar_symbols_cache_, asar_wrapper_, assembly_symbol_table_, yaze::cli::agent::ToolDefinition::category, yaze::cli::agent::ToolRegistry::CreateHandler(), DispatchMetaTool(), yaze::cli::agent::ToolRegistry::Get(), yaze::core::AsarWrapper::GetSymbolTable(), yaze::cli::agent::ToolRegistry::GetToolDefinition(), IsToolEnabled(), project_context_, yaze::cli::agent::ToolDefinition::requires_project, yaze::cli::agent::ToolDefinition::requires_rom, rom_context_, yaze::cli::ToolCall::tool_name, and ValidateCall().
Referenced by DispatchBatch(), yaze::cli::agent::ConversationalAgentService::HandleExternalResponse(), and yaze::cli::agent::ConversationalAgentService::SendMessage().
|
inline |
Definition at line 117 of file tool_dispatcher.h.
References rom_context_.
Referenced by yaze::cli::agent::ConversationalAgentService::SetRomContext().
|
inline |
Definition at line 118 of file tool_dispatcher.h.
References project_context_.
|
inline |
Definition at line 121 of file tool_dispatcher.h.
References asar_wrapper_.
|
inline |
Definition at line 126 of file tool_dispatcher.h.
References assembly_symbol_table_.
Referenced by yaze::cli::agent::ConversationalAgentService::SetAssemblySymbolTable().
|
inline |
Definition at line 131 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 134 of file tool_dispatcher.h.
References preferences_.
|
private |
Definition at line 77 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 115 of file tool_dispatcher.cc.
References yaze::cli::agent::ToolDefinition::access, yaze::cli::agent::ToolDispatcher::ToolPreferences::allow_mutating_tools, yaze::cli::ToolCall::args, yaze::cli::agent::kMutating, preferences_, yaze::cli::agent::ToolDefinition::required_args, and yaze::cli::ToolCall::tool_name.
Referenced by Dispatch().
|
private |
Definition at line 140 of file tool_dispatcher.cc.
References yaze::cli::ToolCall::args, GetAvailableTools(), GetToolInfo(), SearchTools(), and yaze::cli::ToolCall::tool_name.
Referenced by Dispatch().

|
private |
Definition at line 143 of file tool_dispatcher.h.
Referenced by Dispatch(), and SetRomContext().
|
private |
Definition at line 144 of file tool_dispatcher.h.
Referenced by Dispatch(), and SetProjectContext().
|
private |
Definition at line 145 of file tool_dispatcher.h.
Referenced by Dispatch(), and SetAsarWrapper().
|
private |
Definition at line 146 of file tool_dispatcher.h.
Referenced by Dispatch(), and SetAssemblySymbolTable().
|
private |
Definition at line 150 of file tool_dispatcher.h.
Referenced by Dispatch().
|
private |
Definition at line 151 of file tool_dispatcher.h.
Referenced by IsToolEnabled(), preferences(), SetToolPreferences(), and ValidateCall().