feat(build-system): enhance CMake configuration and introduce new utility files
- Refactored CMakeLists.txt to streamline project configuration and improve readability. - Introduced new utility functions in `utils.cmake` for setting compiler flags and managing dependencies. - Added `dependencies.cmake` to centralize third-party dependency management, enhancing modularity. - Updated CI workflows to include new build options and improved logging for better feedback during configuration. - Implemented precompiled headers in various libraries to speed up compilation times. Benefits: - Improved maintainability and clarity of the build system. - Enhanced build performance through precompiled headers. - Streamlined dependency management for easier integration of third-party libraries.
This commit is contained in:
320
src/cli/handlers/README.md
Normal file
320
src/cli/handlers/README.md
Normal file
@@ -0,0 +1,320 @@
|
||||
# YAZE Modern Command Handler Architecture
|
||||
|
||||
This directory contains the modern command handler system that provides a consistent interface for both CLI and AI agent interactions with ROM data.
|
||||
|
||||
## Architecture Overview
|
||||
|
||||
The command handler system follows a clean, layered architecture:
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────┐
|
||||
│ CLI / Agent Interface │
|
||||
│ (cli.cc, agent.cc, simple-chat, etc) │
|
||||
└─────────────────────────────────────────┘
|
||||
↓
|
||||
┌─────────────────────────────────────────┐
|
||||
│ Command Handler Base Class │
|
||||
│ (resources/command_handler.h) │
|
||||
│ - Argument parsing │
|
||||
│ - ROM context management │
|
||||
│ - Output formatting │
|
||||
│ - Error handling │
|
||||
└─────────────────────────────────────────┘
|
||||
↓
|
||||
┌─────────────────────────────────────────┐
|
||||
│ Concrete Command Handlers │
|
||||
│ (handlers/*/*) │
|
||||
│ - SpriteListCommandHandler │
|
||||
│ - DungeonDescribeRoomCommandHandler │
|
||||
│ - OverworldFindTileCommandHandler │
|
||||
│ - PaletteGetColorsCommandHandler │
|
||||
│ - etc... │
|
||||
└─────────────────────────────────────────┘
|
||||
↓
|
||||
┌─────────────────────────────────────────┐
|
||||
│ Core YAZE Libraries │
|
||||
│ - zelda3/ (overworld, dungeon, sprite) │
|
||||
│ - gfx/ (graphics, palette) │
|
||||
│ - app/editor/ (ROM operations) │
|
||||
└─────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
## Namespace Structure
|
||||
|
||||
All command handlers are organized under a simplified namespace:
|
||||
|
||||
```cpp
|
||||
namespace yaze {
|
||||
namespace cli {
|
||||
namespace handlers {
|
||||
// All command handler classes live here
|
||||
class SpriteListCommandHandler : public resources::CommandHandler { ... };
|
||||
class DungeonDescribeRoomCommandHandler : public resources::CommandHandler { ... };
|
||||
// etc.
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Directory Organization
|
||||
|
||||
```
|
||||
handlers/
|
||||
├── README.md (this file)
|
||||
├── commands.h // Legacy command function declarations
|
||||
├── command_wrappers.cc // Wrapper functions for backward compatibility
|
||||
├── command_handlers.h // Forward declarations and factory functions
|
||||
├── command_handlers.cc // Factory implementations
|
||||
│
|
||||
├── graphics/ // Graphics-related commands
|
||||
│ ├── sprite_commands.h/.cc // Sprite listing and properties
|
||||
│ ├── palette_commands.h/.cc // Palette manipulation
|
||||
│ ├── hex_commands.h/.cc // Raw hex data access
|
||||
│ └── gfx.cc // Legacy graphics commands
|
||||
│
|
||||
├── game/ // Game data inspection
|
||||
│ ├── dungeon_commands.h/.cc // Dungeon room inspection
|
||||
│ ├── overworld_commands.h/.cc // Overworld map inspection
|
||||
│ ├── music_commands.h/.cc // Music track information
|
||||
│ ├── dialogue_commands.h/.cc // Dialogue/message search
|
||||
│ └── message_commands.h/.cc // Message data access
|
||||
│
|
||||
├── tools/ // Development tools
|
||||
│ ├── resource_commands.h/.cc // Resource label inspection
|
||||
│ ├── gui_commands.h/.cc // GUI automation
|
||||
│ └── emulator_commands.h/.cc // Emulator/debugger control
|
||||
│
|
||||
└── agent/ // AI agent specific
|
||||
├── general_commands.cc // Agent command routing
|
||||
├── test_commands.cc // Test harness
|
||||
└── todo_commands.h/.cc // Task management
|
||||
```
|
||||
|
||||
## Creating a New Command Handler
|
||||
|
||||
### 1. Define the Handler Class
|
||||
|
||||
Create a header file (e.g., `new_feature_commands.h`):
|
||||
|
||||
```cpp
|
||||
#ifndef YAZE_SRC_CLI_HANDLERS_NEW_FEATURE_COMMANDS_H_
|
||||
#define YAZE_SRC_CLI_HANDLERS_NEW_FEATURE_COMMANDS_H_
|
||||
|
||||
#include "cli/service/resources/command_handler.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace cli {
|
||||
namespace handlers {
|
||||
|
||||
class NewFeatureCommandHandler : public resources::CommandHandler {
|
||||
public:
|
||||
std::string GetName() const { return "new-feature"; }
|
||||
|
||||
std::string GetDescription() const {
|
||||
return "Brief description of what this command does";
|
||||
}
|
||||
|
||||
std::string GetUsage() const {
|
||||
return "new-feature --arg1 <value> [--optional-arg2 <value>]";
|
||||
}
|
||||
|
||||
absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
|
||||
// Validate required arguments
|
||||
return parser.RequireArgs({"arg1"});
|
||||
}
|
||||
|
||||
absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
|
||||
resources::OutputFormatter& formatter) override;
|
||||
};
|
||||
|
||||
} // namespace handlers
|
||||
} // namespace cli
|
||||
} // namespace yaze
|
||||
|
||||
#endif // YAZE_SRC_CLI_HANDLERS_NEW_FEATURE_COMMANDS_H_
|
||||
```
|
||||
|
||||
### 2. Implement the Handler
|
||||
|
||||
Create the implementation file (e.g., `new_feature_commands.cc`):
|
||||
|
||||
```cpp
|
||||
#include "cli/handlers/new_feature_commands.h"
|
||||
|
||||
#include "absl/strings/str_format.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace cli {
|
||||
namespace handlers {
|
||||
|
||||
absl::Status NewFeatureCommandHandler::Execute(
|
||||
Rom* rom, const resources::ArgumentParser& parser,
|
||||
resources::OutputFormatter& formatter) {
|
||||
|
||||
// Parse arguments
|
||||
auto arg1 = parser.GetString("arg1").value();
|
||||
auto arg2 = parser.GetString("optional-arg2").value_or("default");
|
||||
|
||||
// Begin output
|
||||
formatter.BeginObject("New Feature Result");
|
||||
formatter.AddField("input_arg", arg1);
|
||||
|
||||
// Do work with ROM
|
||||
// ... use rom->read(), zelda3 classes, etc.
|
||||
|
||||
// Add results to formatter
|
||||
formatter.AddField("result", "success");
|
||||
formatter.BeginArray("items");
|
||||
// ... add items
|
||||
formatter.EndArray();
|
||||
formatter.EndObject();
|
||||
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
} // namespace handlers
|
||||
} // namespace cli
|
||||
} // namespace yaze
|
||||
```
|
||||
|
||||
### 3. Register in Factory
|
||||
|
||||
Add to `command_handlers.cc`:
|
||||
|
||||
```cpp
|
||||
#include "cli/handlers/new_feature_commands.h"
|
||||
|
||||
std::vector<std::unique_ptr<resources::CommandHandler>> CreateCliCommandHandlers() {
|
||||
// ... existing handlers ...
|
||||
handlers.push_back(std::make_unique<NewFeatureCommandHandler>());
|
||||
return handlers;
|
||||
}
|
||||
```
|
||||
|
||||
### 4. Add Forward Declaration
|
||||
|
||||
Add to `command_handlers.h`:
|
||||
|
||||
```cpp
|
||||
// Forward declarations for command handler classes
|
||||
class NewFeatureCommandHandler;
|
||||
```
|
||||
|
||||
## Command Handler Base Class
|
||||
|
||||
The `resources::CommandHandler` base class provides:
|
||||
|
||||
### Lifecycle Methods
|
||||
|
||||
- `Run(args, rom_context)` - Main entry point that orchestrates the full command execution
|
||||
- `ValidateArgs(parser)` - Override to validate command arguments
|
||||
- `Execute(rom, parser, formatter)` - Override to implement command logic
|
||||
|
||||
### Helper Methods
|
||||
|
||||
- `GetUsage()` - Return usage string for help
|
||||
- `GetName()` - Return command name
|
||||
- `GetDescription()` - Return brief description
|
||||
- `RequiresLabels()` - Return true if command needs ROM labels loaded
|
||||
- `GetDefaultFormat()` - Return "json" or "text" for default output
|
||||
- `GetOutputTitle()` - Return title for output object
|
||||
|
||||
## Argument Parsing
|
||||
|
||||
The `ArgumentParser` class handles common CLI patterns:
|
||||
|
||||
```cpp
|
||||
// Get string argument
|
||||
auto value = parser.GetString("arg_name").value_or("default");
|
||||
|
||||
// Get integer (supports hex with 0x prefix)
|
||||
auto count = parser.GetInt("count").value_or(10);
|
||||
|
||||
// Get hex value
|
||||
auto address = parser.GetHex("address").value();
|
||||
|
||||
// Check for flag
|
||||
if (parser.HasFlag("verbose")) { ... }
|
||||
|
||||
// Get positional arguments
|
||||
auto positional = parser.GetPositional();
|
||||
|
||||
// Require specific arguments
|
||||
RETURN_IF_ERROR(parser.RequireArgs({"required1", "required2"}));
|
||||
```
|
||||
|
||||
## Output Formatting
|
||||
|
||||
The `OutputFormatter` class provides consistent JSON/text output:
|
||||
|
||||
```cpp
|
||||
// Begin object
|
||||
formatter.BeginObject("Title");
|
||||
|
||||
// Add fields
|
||||
formatter.AddField("string_field", "value");
|
||||
formatter.AddField("int_field", 42);
|
||||
formatter.AddField("bool_field", true);
|
||||
formatter.AddHexField("address", 0x1234, 4); // Width in digits
|
||||
|
||||
// Arrays
|
||||
formatter.BeginArray("items");
|
||||
for (const auto& item : items) {
|
||||
formatter.AddArrayItem(absl::StrFormat("Item %d", i));
|
||||
}
|
||||
formatter.EndArray();
|
||||
|
||||
// Nested objects
|
||||
formatter.BeginObject("nested");
|
||||
formatter.AddField("nested_field", "value");
|
||||
formatter.EndObject();
|
||||
|
||||
// End object
|
||||
formatter.EndObject();
|
||||
```
|
||||
|
||||
## Integration with Public API
|
||||
|
||||
Command handlers are designed to work alongside the public C API defined in `incl/yaze.h` and `incl/zelda.h`.
|
||||
|
||||
- Handlers use internal C++ classes from `app/zelda3/`
|
||||
- Output structures align with C API data types where possible
|
||||
- Future: C API bridge will expose commands to external applications
|
||||
|
||||
## Best Practices
|
||||
|
||||
1. **Keep handlers focused** - One command per handler class
|
||||
2. **Use existing zelda3 classes** - Don't duplicate ROM parsing logic
|
||||
3. **Validate inputs early** - Use `ValidateArgs()` to catch errors
|
||||
4. **Provide good error messages** - Return descriptive `absl::Status` errors
|
||||
5. **Support both JSON and text** - Format output using `OutputFormatter`
|
||||
6. **Document parameters** - Include full usage string in `GetUsage()`
|
||||
7. **Test with agents** - Commands should be AI-friendly
|
||||
8. **Mark unused rom parameter** - Use `Rom* /*rom*/` if not needed
|
||||
|
||||
## Testing
|
||||
|
||||
Test commands using the CLI:
|
||||
|
||||
```bash
|
||||
# Direct command execution
|
||||
./build/bin/z3ed agent sprite-list --limit 10 --format json --rom zelda3.sfc
|
||||
|
||||
# Via simple-chat interface
|
||||
./build/bin/z3ed agent simple-chat --rom zelda3.sfc
|
||||
> sprite-list --limit 5
|
||||
|
||||
# In agent test suite
|
||||
./build/bin/z3ed agent test-conversation --rom zelda3.sfc
|
||||
```
|
||||
|
||||
## Future Enhancements
|
||||
|
||||
- [ ] C API bridge for external language bindings
|
||||
- [ ] Command auto-discovery and registration
|
||||
- [ ] Per-command help system
|
||||
- [ ] Command aliases and shortcuts
|
||||
- [ ] Batch command execution
|
||||
- [ ] Command pipelines (output of one → input of another)
|
||||
- [ ] Interactive command REPL improvements
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#include "cli/handlers/commands.h"
|
||||
#include "cli/handlers/agent/todo_commands.h"
|
||||
#include "cli/cli.h"
|
||||
|
||||
@@ -8,19 +7,70 @@
|
||||
#include "absl/flags/declare.h"
|
||||
#include "absl/flags/flag.h"
|
||||
#include "absl/status/status.h"
|
||||
#include "cli/handlers/agent/common.h"
|
||||
#include "cli/handlers/agent/todo_commands.h"
|
||||
#include "cli/handlers/agent/simple_chat_command.h"
|
||||
#include "cli/handlers/tools/resource_commands.h"
|
||||
#include "cli/handlers/game/dungeon_commands.h"
|
||||
#include "cli/handlers/game/overworld_commands.h"
|
||||
#include "cli/handlers/tools/gui_commands.h"
|
||||
#include "cli/handlers/tools/emulator_commands.h"
|
||||
|
||||
ABSL_DECLARE_FLAG(bool, quiet);
|
||||
|
||||
namespace yaze {
|
||||
namespace cli {
|
||||
|
||||
// Forward declarations from general_commands.cc
|
||||
namespace agent {
|
||||
absl::Status HandlePlanCommand(const std::vector<std::string>& args);
|
||||
absl::Status HandleTestCommand(const std::vector<std::string>& args);
|
||||
absl::Status HandleTestConversationCommand(const std::vector<std::string>& args);
|
||||
absl::Status HandleGuiCommand(const std::vector<std::string>& args);
|
||||
absl::Status HandleLearnCommand(const std::vector<std::string>& args);
|
||||
absl::Status HandleListCommand();
|
||||
absl::Status HandleDescribeCommand(const std::vector<std::string>& args);
|
||||
|
||||
// Wrapper functions to call CommandHandlers
|
||||
absl::Status HandleResourceListCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
handlers::ResourceListCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleResourceSearchCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
handlers::ResourceSearchCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleDungeonListSpritesCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
handlers::DungeonListSpritesCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleDungeonDescribeRoomCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
handlers::DungeonDescribeRoomCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleOverworldFindTileCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
handlers::OverworldFindTileCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleOverworldDescribeMapCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
handlers::OverworldDescribeMapCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleOverworldListWarpsCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
handlers::OverworldListWarpsCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
} // namespace agent
|
||||
|
||||
namespace {
|
||||
|
||||
// Forward declarations for functions implemented in other files
|
||||
// Function declarations moved to commands.h
|
||||
|
||||
// Use handlers from command_wrappers.cc
|
||||
using namespace yaze::cli::handlers;
|
||||
|
||||
constexpr absl::string_view kUsage =
|
||||
"Usage: agent <subcommand> [options]\n"
|
||||
"\n"
|
||||
@@ -98,13 +148,11 @@ absl::Status HandleAgentCommand(const std::vector<std::string>& arg_vec) {
|
||||
const std::string& subcommand = arg_vec[0];
|
||||
std::vector<std::string> subcommand_args(arg_vec.begin() + 1, arg_vec.end());
|
||||
|
||||
// TODO: Implement proper ROM context handling
|
||||
// For now, return unimplemented for commands that require ROM context
|
||||
if (subcommand == "run") {
|
||||
return absl::UnimplementedError("Agent run command requires ROM context - not yet implemented");
|
||||
}
|
||||
if (subcommand == "plan") {
|
||||
return HandlePlanCommand(subcommand_args);
|
||||
return agent::HandlePlanCommand(subcommand_args);
|
||||
}
|
||||
if (subcommand == "diff") {
|
||||
return absl::UnimplementedError("Agent diff command requires ROM context - not yet implemented");
|
||||
@@ -113,19 +161,19 @@ absl::Status HandleAgentCommand(const std::vector<std::string>& arg_vec) {
|
||||
return absl::UnimplementedError("Agent accept command requires ROM context - not yet implemented");
|
||||
}
|
||||
if (subcommand == "test") {
|
||||
return HandleTestCommand(subcommand_args);
|
||||
return agent::HandleTestCommand(subcommand_args);
|
||||
}
|
||||
if (subcommand == "test-conversation") {
|
||||
return HandleTestConversationCommand(subcommand_args);
|
||||
return agent::HandleTestConversationCommand(subcommand_args);
|
||||
}
|
||||
if (subcommand == "gui") {
|
||||
return HandleGuiCommand(subcommand_args);
|
||||
return agent::HandleGuiCommand(subcommand_args);
|
||||
}
|
||||
if (subcommand == "learn") {
|
||||
return HandleLearnCommand(subcommand_args);
|
||||
return agent::HandleLearnCommand(subcommand_args);
|
||||
}
|
||||
if (subcommand == "list") {
|
||||
return HandleListCommand();
|
||||
return agent::HandleListCommand();
|
||||
}
|
||||
if (subcommand == "commit") {
|
||||
return absl::UnimplementedError("Agent commit command requires ROM context - not yet implemented");
|
||||
@@ -134,60 +182,57 @@ absl::Status HandleAgentCommand(const std::vector<std::string>& arg_vec) {
|
||||
return absl::UnimplementedError("Agent revert command requires ROM context - not yet implemented");
|
||||
}
|
||||
if (subcommand == "describe") {
|
||||
return HandleDescribeCommand(subcommand_args);
|
||||
return agent::HandleDescribeCommand(subcommand_args);
|
||||
}
|
||||
if (subcommand == "resource-list") {
|
||||
return HandleResourceListCommand(subcommand_args, nullptr);
|
||||
return agent::HandleResourceListCommand(subcommand_args, nullptr);
|
||||
}
|
||||
if (subcommand == "resource-search") {
|
||||
return HandleResourceSearchCommand(subcommand_args, nullptr);
|
||||
return agent::HandleResourceSearchCommand(subcommand_args, nullptr);
|
||||
}
|
||||
if (subcommand == "dungeon-list-sprites") {
|
||||
return HandleDungeonListSpritesCommand(subcommand_args, nullptr);
|
||||
return agent::HandleDungeonListSpritesCommand(subcommand_args, nullptr);
|
||||
}
|
||||
if (subcommand == "dungeon-describe-room") {
|
||||
return HandleDungeonDescribeRoomCommand(subcommand_args, nullptr);
|
||||
return agent::HandleDungeonDescribeRoomCommand(subcommand_args, nullptr);
|
||||
}
|
||||
if (subcommand == "overworld-find-tile") {
|
||||
return HandleOverworldFindTileCommand(subcommand_args, nullptr);
|
||||
return agent::HandleOverworldFindTileCommand(subcommand_args, nullptr);
|
||||
}
|
||||
if (subcommand == "overworld-describe-map") {
|
||||
return HandleOverworldDescribeMapCommand(subcommand_args, nullptr);
|
||||
return agent::HandleOverworldDescribeMapCommand(subcommand_args, nullptr);
|
||||
}
|
||||
if (subcommand == "overworld-list-warps") {
|
||||
return HandleOverworldListWarpsCommand(subcommand_args, nullptr);
|
||||
}
|
||||
if (subcommand == "chat") {
|
||||
return absl::UnimplementedError("Agent chat command requires ROM context - not yet implemented");
|
||||
}
|
||||
if (subcommand == "simple-chat") {
|
||||
return absl::UnimplementedError("Agent simple-chat command requires ROM context - not yet implemented");
|
||||
}
|
||||
if (subcommand == "todo") {
|
||||
return handlers::HandleTodoCommand(subcommand_args);
|
||||
return agent::HandleOverworldListWarpsCommand(subcommand_args, nullptr);
|
||||
}
|
||||
// if (subcommand == "chat") {
|
||||
// return absl::UnimplementedError("Agent chat command requires ROM context - not yet implemented");
|
||||
// }
|
||||
// if (subcommand == "todo") {
|
||||
// return handlers::HandleTodoCommand(subcommand_args);
|
||||
// }
|
||||
|
||||
// Hex manipulation commands
|
||||
if (subcommand == "hex-read") {
|
||||
return HandleHexRead(subcommand_args, nullptr);
|
||||
}
|
||||
if (subcommand == "hex-write") {
|
||||
return HandleHexWrite(subcommand_args, nullptr);
|
||||
}
|
||||
if (subcommand == "hex-search") {
|
||||
return HandleHexSearch(subcommand_args, nullptr);
|
||||
}
|
||||
// // Hex manipulation commands
|
||||
// if (subcommand == "hex-read") {
|
||||
// return HandleHexRead(subcommand_args, nullptr);
|
||||
// }
|
||||
// if (subcommand == "hex-write") {
|
||||
// return HandleHexWrite(subcommand_args, nullptr);
|
||||
// }
|
||||
// if (subcommand == "hex-search") {
|
||||
// return HandleHexSearch(subcommand_args, nullptr);
|
||||
// }
|
||||
|
||||
// Palette manipulation commands
|
||||
if (subcommand == "palette-get-colors") {
|
||||
return HandlePaletteGetColors(subcommand_args, nullptr);
|
||||
}
|
||||
if (subcommand == "palette-set-color") {
|
||||
return HandlePaletteSetColor(subcommand_args, nullptr);
|
||||
}
|
||||
if (subcommand == "palette-analyze") {
|
||||
return HandlePaletteAnalyze(subcommand_args, nullptr);
|
||||
}
|
||||
// // Palette manipulation commands
|
||||
// if (subcommand == "palette-get-colors") {
|
||||
// return HandlePaletteGetColors(subcommand_args, nullptr);
|
||||
// }
|
||||
// if (subcommand == "palette-set-color") {
|
||||
// return HandlePaletteSetColor(subcommand_args, nullptr);
|
||||
// }
|
||||
// if (subcommand == "palette-analyze") {
|
||||
// return HandlePaletteAnalyze(subcommand_args, nullptr);
|
||||
// }
|
||||
|
||||
return absl::InvalidArgumentError(std::string(kUsage));
|
||||
}
|
||||
|
||||
37
src/cli/handlers/agent/simple_chat_command.cc
Normal file
37
src/cli/handlers/agent/simple_chat_command.cc
Normal file
@@ -0,0 +1,37 @@
|
||||
#include "cli/handlers/agent/simple_chat_command.h"
|
||||
#include "cli/service/agent/simple_chat_session.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace cli {
|
||||
namespace handlers {
|
||||
|
||||
absl::Status SimpleChatCommandHandler::Execute(
|
||||
Rom* rom, const resources::ArgumentParser& parser,
|
||||
resources::OutputFormatter& formatter) {
|
||||
|
||||
agent::SimpleChatSession session;
|
||||
session.SetRomContext(rom);
|
||||
|
||||
// Configure session from parser
|
||||
agent::AgentConfig config;
|
||||
if (parser.HasFlag("verbose")) {
|
||||
config.verbose = true;
|
||||
}
|
||||
if (auto format = parser.GetString("format")) {
|
||||
// Simplified format handling
|
||||
}
|
||||
session.SetConfig(config);
|
||||
|
||||
if (auto file = parser.GetString("file")) {
|
||||
return session.RunBatch(*file);
|
||||
} else if (auto prompt = parser.GetString("prompt")) {
|
||||
std::string response;
|
||||
return session.SendAndWaitForResponse(*prompt, &response);
|
||||
} else {
|
||||
return session.RunInteractive();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace handlers
|
||||
} // namespace cli
|
||||
} // namespace yaze
|
||||
31
src/cli/handlers/agent/simple_chat_command.h
Normal file
31
src/cli/handlers/agent/simple_chat_command.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef YAZE_CLI_HANDLERS_AGENT_SIMPLE_CHAT_COMMAND_H_
|
||||
#define YAZE_CLI_HANDLERS_AGENT_SIMPLE_CHAT_COMMAND_H_
|
||||
|
||||
#include "cli/service/resources/command_handler.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace cli {
|
||||
namespace handlers {
|
||||
|
||||
class SimpleChatCommandHandler : public resources::CommandHandler {
|
||||
public:
|
||||
std::string GetName() const { return "simple-chat"; }
|
||||
std::string GetDescription() const { return "Simple text-based chat with the AI agent."; }
|
||||
std::string GetUsage() const override {
|
||||
return "simple-chat [--prompt <message>] [--file <path>] [--format <format>]";
|
||||
}
|
||||
|
||||
protected:
|
||||
absl::Status ValidateArgs(const resources::ArgumentParser& parser) override {
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
|
||||
resources::OutputFormatter& formatter) override;
|
||||
};
|
||||
|
||||
} // namespace handlers
|
||||
} // namespace cli
|
||||
} // namespace yaze
|
||||
|
||||
#endif // YAZE_CLI_HANDLERS_AGENT_SIMPLE_CHAT_COMMAND_H_
|
||||
@@ -60,9 +60,14 @@ std::vector<std::unique_ptr<resources::CommandHandler>> CreateCliCommandHandlers
|
||||
return handlers;
|
||||
}
|
||||
|
||||
#include "cli/handlers/agent/simple_chat_command.h"
|
||||
|
||||
std::vector<std::unique_ptr<resources::CommandHandler>> CreateAgentCommandHandlers() {
|
||||
std::vector<std::unique_ptr<resources::CommandHandler>> handlers;
|
||||
|
||||
// Add simple-chat command handler
|
||||
handlers.push_back(std::make_unique<SimpleChatCommandHandler>());
|
||||
|
||||
// Resource inspection tools
|
||||
handlers.push_back(std::make_unique<ResourceListCommandHandler>());
|
||||
handlers.push_back(std::make_unique<ResourceSearchCommandHandler>());
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
#include "cli/service/resources/command_handler.h"
|
||||
|
||||
#include "cli/handlers/agent/simple_chat_command.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace cli {
|
||||
namespace handlers {
|
||||
|
||||
@@ -1,328 +0,0 @@
|
||||
#include "cli/handlers/commands.h"
|
||||
|
||||
#include "cli/handlers/tools/resource_commands.h"
|
||||
#include "cli/handlers/game/dungeon_commands.h"
|
||||
#include "cli/handlers/game/overworld_commands.h"
|
||||
#include "cli/handlers/game/message_commands.h"
|
||||
#include "cli/handlers/game/dialogue_commands.h"
|
||||
#include "cli/handlers/game/music_commands.h"
|
||||
#include "cli/handlers/graphics/hex_commands.h"
|
||||
#include "cli/handlers/graphics/palette_commands.h"
|
||||
// #include "cli/handlers/graphics/sprite_commands.h" // Implementations not available
|
||||
#include "cli/handlers/tools/gui_commands.h"
|
||||
#include "cli/handlers/tools/emulator_commands.h"
|
||||
// #include "cli/handlers/rom/rom_commands.h" // Not used in stubs
|
||||
// #include "cli/handlers/rom/project_commands.h" // Not used in stubs
|
||||
|
||||
namespace yaze {
|
||||
namespace cli {
|
||||
namespace handlers {
|
||||
|
||||
// Resource commands
|
||||
absl::Status HandleResourceListCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
ResourceListCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleResourceSearchCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
ResourceSearchCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
// Dungeon commands
|
||||
absl::Status HandleDungeonListSpritesCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
DungeonListSpritesCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleDungeonDescribeRoomCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
DungeonDescribeRoomCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleDungeonExportRoomCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
DungeonExportRoomCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleDungeonListObjectsCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
DungeonListObjectsCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleDungeonGetRoomTilesCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
DungeonGetRoomTilesCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleDungeonSetRoomPropertyCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
DungeonSetRoomPropertyCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
// Overworld commands
|
||||
absl::Status HandleOverworldFindTileCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
OverworldFindTileCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleOverworldDescribeMapCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
OverworldDescribeMapCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleOverworldListWarpsCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
OverworldListWarpsCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleOverworldListSpritesCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
OverworldListSpritesCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleOverworldGetEntranceCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
OverworldGetEntranceCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleOverworldTileStatsCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
OverworldTileStatsCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
// Message commands
|
||||
absl::Status HandleMessageListCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
MessageListCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleMessageReadCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
MessageReadCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleMessageSearchCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
MessageSearchCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
// Dialogue commands
|
||||
absl::Status HandleDialogueListCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
DialogueListCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleDialogueReadCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
DialogueReadCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleDialogueSearchCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
DialogueSearchCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
// Music commands
|
||||
absl::Status HandleMusicListCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
MusicListCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleMusicInfoCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
MusicInfoCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleMusicTracksCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
MusicTracksCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
// Sprite commands (stubs - implementations not available)
|
||||
absl::Status HandleSpriteListCommand(const std::vector<std::string>& /*args*/, Rom* /*rom*/) {
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
absl::Status HandleSpritePropertiesCommand(const std::vector<std::string>& /*args*/, Rom* /*rom*/) {
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
absl::Status HandleSpritePaletteCommand(const std::vector<std::string>& /*args*/, Rom* /*rom*/) {
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
// GUI commands
|
||||
absl::Status HandleGuiPlaceTileCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
GuiPlaceTileCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleGuiClickCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
GuiClickCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleGuiDiscoverToolCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
GuiDiscoverToolCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleGuiScreenshotCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
GuiScreenshotCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
// Emulator commands
|
||||
absl::Status HandleEmulatorStepCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
EmulatorStepCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleEmulatorRunCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
EmulatorRunCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleEmulatorPauseCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
EmulatorPauseCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleEmulatorResetCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
EmulatorResetCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleEmulatorGetStateCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
EmulatorGetStateCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleEmulatorSetBreakpointCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
EmulatorSetBreakpointCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleEmulatorClearBreakpointCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
EmulatorClearBreakpointCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleEmulatorListBreakpointsCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
EmulatorListBreakpointsCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleEmulatorReadMemoryCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
EmulatorReadMemoryCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleEmulatorWriteMemoryCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
EmulatorWriteMemoryCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleEmulatorGetRegistersCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
EmulatorGetRegistersCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleEmulatorGetMetricsCommand(const std::vector<std::string>& args, Rom* rom) {
|
||||
EmulatorGetMetricsCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
// Hex commands
|
||||
absl::Status HandleHexRead(const std::vector<std::string>& args, Rom* rom) {
|
||||
HexReadCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleHexWrite(const std::vector<std::string>& args, Rom* rom) {
|
||||
HexWriteCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandleHexSearch(const std::vector<std::string>& args, Rom* rom) {
|
||||
HexSearchCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
// Palette commands
|
||||
absl::Status HandlePaletteGetColors(const std::vector<std::string>& args, Rom* rom) {
|
||||
PaletteGetColorsCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandlePaletteSetColor(const std::vector<std::string>& args, Rom* rom) {
|
||||
PaletteSetColorCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
absl::Status HandlePaletteAnalyze(const std::vector<std::string>& args, Rom* rom) {
|
||||
PaletteAnalyzeCommandHandler handler;
|
||||
return handler.Run(args, rom);
|
||||
}
|
||||
|
||||
// Agent-specific commands (stubs for now)
|
||||
absl::Status HandleRunCommand(const std::vector<std::string>& /*args*/, Rom& /*rom*/) {
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
absl::Status HandlePlanCommand(const std::vector<std::string>& /*args*/) {
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
absl::Status HandleDiffCommand(Rom& /*rom*/, const std::vector<std::string>& /*args*/) {
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
absl::Status HandleAcceptCommand(const std::vector<std::string>& /*args*/, Rom& /*rom*/) {
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
absl::Status HandleTestCommand(const std::vector<std::string>& /*args*/) {
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
absl::Status HandleGuiCommand(const std::vector<std::string>& /*args*/) {
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
absl::Status HandleLearnCommand(const std::vector<std::string>& /*args*/) {
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
absl::Status HandleListCommand() {
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
absl::Status HandleCommitCommand(Rom& /*rom*/) {
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
absl::Status HandleRevertCommand(Rom& /*rom*/) {
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
absl::Status HandleDescribeCommand(const std::vector<std::string>& /*arg_vec*/) {
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
absl::Status HandleChatCommand(Rom& /*rom*/) {
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
absl::Status HandleSimpleChatCommand(const std::vector<std::string>&, Rom* /*rom*/, bool /*quiet*/) {
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
absl::Status HandleTestConversationCommand(const std::vector<std::string>& /*arg_vec*/) {
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
} // namespace handlers
|
||||
} // namespace cli
|
||||
} // namespace yaze
|
||||
@@ -1,194 +0,0 @@
|
||||
#ifndef YAZE_CLI_HANDLERS_COMMANDS_H_
|
||||
#define YAZE_CLI_HANDLERS_COMMANDS_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/status/status.h"
|
||||
|
||||
namespace yaze {
|
||||
class Rom;
|
||||
|
||||
namespace cli {
|
||||
namespace handlers {
|
||||
|
||||
absl::Status HandleRunCommand(const std::vector<std::string>& args,
|
||||
Rom& rom);
|
||||
absl::Status HandlePlanCommand(const std::vector<std::string>& args);
|
||||
absl::Status HandleDiffCommand(Rom& rom,
|
||||
const std::vector<std::string>& args);
|
||||
absl::Status HandleAcceptCommand(const std::vector<std::string>& args, Rom& rom);
|
||||
absl::Status HandleTestCommand(const std::vector<std::string>& args);
|
||||
absl::Status HandleGuiCommand(const std::vector<std::string>& args);
|
||||
absl::Status HandleLearnCommand(const std::vector<std::string>& args = {});
|
||||
absl::Status HandleListCommand();
|
||||
absl::Status HandleCommitCommand(Rom& rom);
|
||||
absl::Status HandleRevertCommand(Rom& rom);
|
||||
absl::Status HandleDescribeCommand(const std::vector<std::string>& arg_vec);
|
||||
absl::Status HandleResourceListCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleResourceSearchCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleDungeonListSpritesCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleDungeonDescribeRoomCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleOverworldFindTileCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleOverworldDescribeMapCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleOverworldListWarpsCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleOverworldListSpritesCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleOverworldGetEntranceCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleOverworldTileStatsCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleMessageListCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleMessageReadCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleMessageSearchCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
|
||||
// GUI Automation Tools
|
||||
absl::Status HandleGuiPlaceTileCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleGuiClickCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleGuiDiscoverToolCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleGuiScreenshotCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
|
||||
// Dialogue Inspection Tools
|
||||
absl::Status HandleDialogueListCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleDialogueReadCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleDialogueSearchCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
|
||||
// Music Data Tools
|
||||
absl::Status HandleMusicListCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleMusicInfoCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleMusicTracksCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
|
||||
// Sprite Property Tools
|
||||
absl::Status HandleSpriteListCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleSpritePropertiesCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleSpritePaletteCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleChatCommand(Rom& rom);
|
||||
absl::Status HandleSimpleChatCommand(const std::vector<std::string>&, Rom* rom, bool quiet);
|
||||
absl::Status HandleTestConversationCommand(
|
||||
const std::vector<std::string>& arg_vec);
|
||||
|
||||
// Agent command handler
|
||||
absl::Status HandleAgentCommand(const std::vector<std::string>& arg_vec);
|
||||
|
||||
// Hex manipulation commands
|
||||
absl::Status HandleHexRead(const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleHexWrite(const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleHexSearch(const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
|
||||
// Palette manipulation commands
|
||||
absl::Status HandlePaletteGetColors(const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandlePaletteSetColor(const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandlePaletteAnalyze(const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
|
||||
// Dungeon editing commands
|
||||
absl::Status HandleDungeonExportRoomCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleDungeonListObjectsCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleDungeonGetRoomTilesCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleDungeonSetRoomPropertyCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
|
||||
// Emulator & Debugger commands
|
||||
absl::Status HandleEmulatorStepCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleEmulatorRunCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleEmulatorPauseCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleEmulatorResetCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleEmulatorGetStateCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleEmulatorSetBreakpointCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleEmulatorClearBreakpointCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleEmulatorListBreakpointsCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleEmulatorReadMemoryCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleEmulatorWriteMemoryCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleEmulatorGetRegistersCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
absl::Status HandleEmulatorGetMetricsCommand(
|
||||
const std::vector<std::string>& arg_vec,
|
||||
Rom* rom_context = nullptr);
|
||||
|
||||
} // namespace handlers
|
||||
} // namespace cli
|
||||
} // namespace yaze
|
||||
|
||||
#endif // YAZE_CLI_HANDLERS_COMMANDS_H_
|
||||
Reference in New Issue
Block a user