yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
simple_chat_command.cc
Go to the documentation of this file.
3
4namespace yaze {
5namespace cli {
6namespace handlers {
7
9 Rom* rom, const resources::ArgumentParser& parser,
10 resources::OutputFormatter& formatter) {
11
13 session.SetRomContext(rom);
14
15 // Configure session from parser
16 agent::AgentConfig config;
17 if (parser.HasFlag("verbose")) {
18 config.verbose = true;
19 }
20 if (auto format = parser.GetString("format")) {
21 // Simplified format handling
22 }
23 session.SetConfig(config);
24
25 if (auto file = parser.GetString("file")) {
26 return session.RunBatch(*file);
27 } else if (auto prompt = parser.GetString("prompt")) {
28 std::string response;
29 return session.SendAndWaitForResponse(*prompt, &response);
30 } else {
31 return session.RunInteractive();
32 }
33}
34
35} // namespace handlers
36} // namespace cli
37} // namespace yaze
The Rom class is used to load, save, and modify Rom data.
Definition rom.h:71
Simple text-based chat session for AI agent interaction.
void SetConfig(const AgentConfig &config)
absl::Status RunBatch(const std::string &input_file)
absl::Status SendAndWaitForResponse(const std::string &message, std::string *response_out=nullptr)
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
Utility for parsing common CLI argument patterns.
std::optional< std::string > GetString(const std::string &name) const
Parse a named argument (e.g., –format=json or –format json)
bool HasFlag(const std::string &name) const
Check if a flag is present.
Utility for consistent output formatting across commands.
Main namespace for the application.