yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::cli::agent::ToolDispatcher Class Reference

#include <tool_dispatcher.h>

Collaboration diagram for yaze::cli::agent::ToolDispatcher:

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< ToolInfoGetAvailableTools () const
 Get list of all available tools.
 
std::optional< ToolInfoGetToolInfo (const std::string &tool_name) const
 Get detailed information about a specific tool.
 
std::vector< ToolInfoSearchTools (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 ToolPreferencespreferences () 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

Romrom_context_ = nullptr
 
project::YazeProjectproject_context_ = nullptr
 
core::AsarWrapperasar_wrapper_ = nullptr
 
const std::map< std::string, core::AsarSymbol > * assembly_symbol_table_
 
std::map< std::string, core::AsarSymbolasar_symbols_cache_
 
ToolPreferences preferences_
 

Detailed Description

Definition at line 25 of file tool_dispatcher.h.

Constructor & Destructor Documentation

◆ ToolDispatcher()

yaze::cli::agent::ToolDispatcher::ToolDispatcher ( )
default

Member Function Documentation

◆ GetAvailableTools()

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().

Here is the call graph for this function:

◆ GetToolInfo()

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().

Here is the call graph for this function:

◆ SearchTools()

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().

Here is the call graph for this function:

◆ DispatchBatch()

ToolDispatcher::BatchResult yaze::cli::agent::ToolDispatcher::DispatchBatch ( const BatchToolCall & batch)

◆ Dispatch()

◆ SetRomContext()

void yaze::cli::agent::ToolDispatcher::SetRomContext ( Rom * rom)
inline

◆ SetProjectContext()

void yaze::cli::agent::ToolDispatcher::SetProjectContext ( project::YazeProject * project)
inline

Definition at line 118 of file tool_dispatcher.h.

References project_context_.

◆ SetAsarWrapper()

void yaze::cli::agent::ToolDispatcher::SetAsarWrapper ( core::AsarWrapper * asar_wrapper)
inline

Definition at line 121 of file tool_dispatcher.h.

References asar_wrapper_.

◆ SetAssemblySymbolTable()

void yaze::cli::agent::ToolDispatcher::SetAssemblySymbolTable ( const std::map< std::string, core::AsarSymbol > * table)
inline

◆ SetToolPreferences()

◆ preferences()

const ToolPreferences & yaze::cli::agent::ToolDispatcher::preferences ( ) const
inline

Definition at line 134 of file tool_dispatcher.h.

References preferences_.

◆ IsToolEnabled()

◆ ValidateCall()

◆ DispatchMetaTool()

absl::StatusOr< std::string > yaze::cli::agent::ToolDispatcher::DispatchMetaTool ( const ToolCall & call) const
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().

Here is the call graph for this function:

Member Data Documentation

◆ rom_context_

Rom* yaze::cli::agent::ToolDispatcher::rom_context_ = nullptr
private

Definition at line 143 of file tool_dispatcher.h.

Referenced by Dispatch(), and SetRomContext().

◆ project_context_

project::YazeProject* yaze::cli::agent::ToolDispatcher::project_context_ = nullptr
private

Definition at line 144 of file tool_dispatcher.h.

Referenced by Dispatch(), and SetProjectContext().

◆ asar_wrapper_

core::AsarWrapper* yaze::cli::agent::ToolDispatcher::asar_wrapper_ = nullptr
private

Definition at line 145 of file tool_dispatcher.h.

Referenced by Dispatch(), and SetAsarWrapper().

◆ assembly_symbol_table_

const std::map<std::string, core::AsarSymbol>* yaze::cli::agent::ToolDispatcher::assembly_symbol_table_
private
Initial value:
=
nullptr

Definition at line 146 of file tool_dispatcher.h.

Referenced by Dispatch(), and SetAssemblySymbolTable().

◆ asar_symbols_cache_

std::map<std::string, core::AsarSymbol> yaze::cli::agent::ToolDispatcher::asar_symbols_cache_
private

Definition at line 150 of file tool_dispatcher.h.

Referenced by Dispatch().

◆ preferences_

ToolPreferences yaze::cli::agent::ToolDispatcher::preferences_
private

Definition at line 151 of file tool_dispatcher.h.

Referenced by IsToolEnabled(), preferences(), SetToolPreferences(), and ValidateCall().


The documentation for this class was generated from the following files: