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

Provides the AI agent with structured information about the project. More...

#include <project_graph_tool.h>

Inheritance diagram for yaze::cli::agent::tools::ProjectGraphTool:
Collaboration diagram for yaze::cli::agent::tools::ProjectGraphTool:

Public Member Functions

 ProjectGraphTool ()=default
 
 ~ProjectGraphTool () override=default
 
std::string GetName () const override
 Get the command name.
 
std::string GetUsage () const override
 Get the command usage string.
 
bool RequiresRom () const override
 Check if the command requires a loaded ROM.
 
void SetProjectContext (project::YazeProject *project) override
 Set the YazeProject context. Default implementation does nothing, override if tool needs project info.
 
void SetAsarWrapper (core::AsarWrapper *asar_wrapper) override
 Set the AsarWrapper context. Default implementation does nothing, override if tool needs Asar access.
 
- Public Member Functions inherited from yaze::cli::resources::CommandHandler
virtual ~CommandHandler ()=default
 
absl::Status Run (const std::vector< std::string > &args, Rom *rom_context, std::string *captured_output=nullptr)
 Execute the command.
 
virtual Descriptor Describe () const
 Provide metadata for TUI/help summaries.
 
virtual bool RequiresLabels () const
 Check if the command requires ROM labels.
 
virtual void SetRomContext (Rom *rom)
 Set the ROM context for tools that need ROM access. Default implementation stores the ROM pointer for subclass use.
 

Protected Member Functions

absl::Status ValidateArgs (const resources::ArgumentParser &parser) override
 Validate command arguments.
 
absl::Status Execute (Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
 Execute the command business logic.
 
- Protected Member Functions inherited from yaze::cli::resources::CommandHandler
virtual std::string GetDefaultFormat () const
 Get the default output format ("json" or "text")
 
virtual std::string GetOutputTitle () const
 Get the output title for formatting.
 

Private Member Functions

absl::Status GetProjectInfo (resources::OutputFormatter &formatter) const
 
absl::Status GetFileStructure (const std::string &path, resources::OutputFormatter &formatter) const
 
absl::Status GetSymbolTable (resources::OutputFormatter &formatter) const
 

Additional Inherited Members

- Protected Attributes inherited from yaze::cli::resources::CommandHandler
Romrom_ = nullptr
 
project::YazeProjectproject_ = nullptr
 
core::AsarWrapperasar_wrapper_ = nullptr
 

Detailed Description

Provides the AI agent with structured information about the project.

This tool allows the agent to query:

  • Basic project information (name, paths)
  • File structure of the code folder
  • Loaded symbol table from Asar

Definition at line 27 of file project_graph_tool.h.

Constructor & Destructor Documentation

◆ ProjectGraphTool()

yaze::cli::agent::tools::ProjectGraphTool::ProjectGraphTool ( )
default

◆ ~ProjectGraphTool()

yaze::cli::agent::tools::ProjectGraphTool::~ProjectGraphTool ( )
overridedefault

Member Function Documentation

◆ GetName()

std::string yaze::cli::agent::tools::ProjectGraphTool::GetName ( ) const
inlineoverridevirtual

Get the command name.

Override this to provide a unique identifier for the command. This is used for command registration and lookup.

Implements yaze::cli::resources::CommandHandler.

Definition at line 32 of file project_graph_tool.h.

◆ GetUsage()

std::string yaze::cli::agent::tools::ProjectGraphTool::GetUsage ( ) const
inlineoverridevirtual

Get the command usage string.

Implements yaze::cli::resources::CommandHandler.

Definition at line 33 of file project_graph_tool.h.

◆ RequiresRom()

bool yaze::cli::agent::tools::ProjectGraphTool::RequiresRom ( ) const
inlineoverridevirtual

Check if the command requires a loaded ROM.

Override to return false if ROM is not needed (e.g., filesystem tools).

Reimplemented from yaze::cli::resources::CommandHandler.

Definition at line 36 of file project_graph_tool.h.

◆ SetProjectContext()

void yaze::cli::agent::tools::ProjectGraphTool::SetProjectContext ( project::YazeProject * project)
inlineoverridevirtual

Set the YazeProject context. Default implementation does nothing, override if tool needs project info.

Reimplemented from yaze::cli::resources::CommandHandler.

Definition at line 39 of file project_graph_tool.h.

References yaze::cli::resources::CommandHandler::project_.

◆ SetAsarWrapper()

void yaze::cli::agent::tools::ProjectGraphTool::SetAsarWrapper ( core::AsarWrapper * asar_wrapper)
inlineoverridevirtual

Set the AsarWrapper context. Default implementation does nothing, override if tool needs Asar access.

Reimplemented from yaze::cli::resources::CommandHandler.

Definition at line 40 of file project_graph_tool.h.

References yaze::cli::resources::CommandHandler::asar_wrapper_.

◆ ValidateArgs()

absl::Status yaze::cli::agent::tools::ProjectGraphTool::ValidateArgs ( const resources::ArgumentParser & parser)
overrideprotectedvirtual

Validate command arguments.

Override this to check required arguments and perform custom validation. Called before Execute().

Implements yaze::cli::resources::CommandHandler.

Definition at line 17 of file project_graph_tool.cc.

References yaze::cli::resources::ArgumentParser::RequireArgs().

Here is the call graph for this function:

◆ Execute()

absl::Status yaze::cli::agent::tools::ProjectGraphTool::Execute ( Rom * rom,
const resources::ArgumentParser & parser,
resources::OutputFormatter & formatter )
overrideprotectedvirtual

Execute the command business logic.

Override this to implement command-specific functionality. The ROM is guaranteed to be loaded and labels initialized.

Implements yaze::cli::resources::CommandHandler.

Definition at line 21 of file project_graph_tool.cc.

References yaze::cli::resources::CommandHandler::asar_wrapper_, yaze::project::YazeProject::code_folder, GetFileStructure(), GetProjectInfo(), yaze::cli::resources::ArgumentParser::GetString(), GetSymbolTable(), and yaze::cli::resources::CommandHandler::project_.

Here is the call graph for this function:

◆ GetProjectInfo()

◆ GetFileStructure()

◆ GetSymbolTable()


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