Enhance chat command functionality with ROM context integration and improve TUI initialization

This commit is contained in:
scawful
2025-10-03 15:11:18 -04:00
parent 3715ae98eb
commit 720d55fc43
6 changed files with 69 additions and 46 deletions

View File

@@ -14,7 +14,16 @@ namespace tui {
using namespace ftxui;
ChatTUI::ChatTUI() = default;
ChatTUI::ChatTUI(Rom* rom_context) : rom_context_(rom_context) {
if (rom_context_ != nullptr) {
agent_service_.SetRomContext(rom_context_);
}
}
void ChatTUI::SetRomContext(Rom* rom_context) {
rom_context_ = rom_context;
agent_service_.SetRomContext(rom_context_);
}
void ChatTUI::Run() {
auto input = Input(&input_message_, "Enter your message...");

View File

@@ -6,13 +6,17 @@
#include "cli/service/agent/conversational_agent_service.h"
namespace yaze {
class Rom;
namespace cli {
namespace tui {
class ChatTUI {
public:
ChatTUI();
explicit ChatTUI(Rom* rom_context = nullptr);
void Run();
void SetRomContext(Rom* rom_context);
private:
void Render();
@@ -21,6 +25,7 @@ class ChatTUI {
ftxui::ScreenInteractive screen_ = ftxui::ScreenInteractive::Fullscreen();
std::string input_message_;
agent::ConversationalAgentService agent_service_;
Rom* rom_context_ = nullptr;
};
} // namespace tui