yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::AgentChat Class Reference

Unified Agent Chat Component. More...

#include <agent_chat.h>

Classes

struct  AutomationTelemetry
 
struct  ContentBlock
 

Public Member Functions

 AgentChat ()
 
 ~AgentChat ()=default
 
void Initialize (ToastManager *toast_manager, ProposalDrawer *proposal_drawer)
 
void SetRomContext (Rom *rom)
 
void SetContext (AgentUIContext *context)
 
void Draw (float available_height=0.0f)
 
void SendMessage (const std::string &message)
 
void ClearHistory ()
 
void ScrollToBottom ()
 
absl::Status LoadHistory (const std::string &filepath)
 
absl::Status SaveHistory (const std::string &filepath)
 
cli::agent::ConversationalAgentServiceGetAgentService ()
 
bool auto_scroll () const
 
void set_auto_scroll (bool v)
 
bool show_timestamps () const
 
void set_show_timestamps (bool v)
 
bool show_reasoning () const
 
void set_show_reasoning (bool v)
 
bool * active ()
 
void set_active (bool active)
 
void UpdateHarnessTelemetry (const AutomationTelemetry &telemetry)
 
void SetLastPlanSummary (const std::string &summary)
 
const std::vector< AutomationTelemetry > & GetTelemetryHistory () const
 
const std::string & GetLastPlanSummary () const
 

Private Member Functions

void RenderToolbar ()
 
void RenderHistory ()
 
void RenderInputBox ()
 
void RenderMessage (const cli::agent::ChatMessage &msg, int index)
 
void RenderThinkingIndicator ()
 
void RenderProposalQuickActions (const cli::agent::ChatMessage &msg, int index)
 
void RenderCodeBlock (const std::string &code, const std::string &language, int msg_index)
 
void RenderTableData (const cli::agent::ChatMessage::TableData &table)
 
void RenderToolTimeline (const cli::agent::ChatMessage &msg)
 
std::vector< ContentBlockParseMessageContent (const std::string &content)
 
void HandleAgentResponse (const absl::StatusOr< cli::agent::ChatMessage > &response)
 

Private Attributes

AgentUIContextcontext_ = nullptr
 
ToastManagertoast_manager_ = nullptr
 
ProposalDrawerproposal_drawer_ = nullptr
 
Romrom_ = nullptr
 
cli::agent::ConversationalAgentService agent_service_
 
bool active_ = false
 
bool waiting_for_response_ = false
 
float thinking_animation_ = 0.0f
 
char input_buffer_ [4096] = {}
 
bool scroll_to_bottom_ = false
 
bool history_loaded_ = false
 
bool auto_scroll_ = true
 
bool show_timestamps_ = true
 
bool show_reasoning_ = false
 
float message_spacing_ = 12.0f
 
std::vector< AutomationTelemetrytelemetry_history_
 
std::string last_plan_summary_
 

Detailed Description

Unified Agent Chat Component.

Handles:

  • Chat History Display
  • User Input
  • Tool/Proposal rendering within chat
  • Interaction with AgentService

Definition at line 31 of file agent_chat.h.

Constructor & Destructor Documentation

◆ AgentChat()

yaze::editor::AgentChat::AgentChat ( )

Definition at line 25 of file agent_chat.cc.

◆ ~AgentChat()

yaze::editor::AgentChat::~AgentChat ( )
default

Member Function Documentation

◆ Initialize()

void yaze::editor::AgentChat::Initialize ( ToastManager * toast_manager,
ProposalDrawer * proposal_drawer )

Definition at line 29 of file agent_chat.cc.

References proposal_drawer_, and toast_manager_.

◆ SetRomContext()

void yaze::editor::AgentChat::SetRomContext ( Rom * rom)

Definition at line 34 of file agent_chat.cc.

References rom_.

◆ SetContext()

void yaze::editor::AgentChat::SetContext ( AgentUIContext * context)

Definition at line 38 of file agent_chat.cc.

References context_.

◆ Draw()

void yaze::editor::AgentChat::Draw ( float available_height = 0.0f)

◆ SendMessage()

void yaze::editor::AgentChat::SendMessage ( const std::string & message)

◆ ClearHistory()

void yaze::editor::AgentChat::ClearHistory ( )

◆ ScrollToBottom()

void yaze::editor::AgentChat::ScrollToBottom ( )

◆ LoadHistory()

absl::Status yaze::editor::AgentChat::LoadHistory ( const std::string & filepath)

Definition at line 451 of file agent_chat.cc.

Referenced by RenderToolbar().

◆ SaveHistory()

absl::Status yaze::editor::AgentChat::SaveHistory ( const std::string & filepath)

◆ GetAgentService()

cli::agent::ConversationalAgentService * yaze::editor::AgentChat::GetAgentService ( )

Definition at line 42 of file agent_chat.cc.

References agent_service_.

◆ auto_scroll()

bool yaze::editor::AgentChat::auto_scroll ( ) const
inline

Definition at line 58 of file agent_chat.h.

References auto_scroll_.

Referenced by yaze::editor::RightPanelManager::DrawAgentChatPanel().

◆ set_auto_scroll()

void yaze::editor::AgentChat::set_auto_scroll ( bool v)
inline

Definition at line 59 of file agent_chat.h.

References auto_scroll_.

Referenced by yaze::editor::RightPanelManager::DrawAgentChatPanel().

◆ show_timestamps()

bool yaze::editor::AgentChat::show_timestamps ( ) const
inline

Definition at line 60 of file agent_chat.h.

References show_timestamps_.

Referenced by yaze::editor::RightPanelManager::DrawAgentChatPanel().

◆ set_show_timestamps()

void yaze::editor::AgentChat::set_show_timestamps ( bool v)
inline

Definition at line 61 of file agent_chat.h.

References show_timestamps_.

Referenced by yaze::editor::RightPanelManager::DrawAgentChatPanel().

◆ show_reasoning()

bool yaze::editor::AgentChat::show_reasoning ( ) const
inline

Definition at line 62 of file agent_chat.h.

References show_reasoning_.

Referenced by yaze::editor::RightPanelManager::DrawAgentChatPanel().

◆ set_show_reasoning()

void yaze::editor::AgentChat::set_show_reasoning ( bool v)
inline

Definition at line 63 of file agent_chat.h.

References show_reasoning_.

Referenced by yaze::editor::RightPanelManager::DrawAgentChatPanel().

◆ active()

bool * yaze::editor::AgentChat::active ( )
inline

Definition at line 66 of file agent_chat.h.

References active_.

Referenced by yaze::editor::RightPanelManager::DrawAgentChatPanel(), and set_active().

◆ set_active()

void yaze::editor::AgentChat::set_active ( bool active)
inline

Definition at line 67 of file agent_chat.h.

References active(), and active_.

Referenced by yaze::editor::AgentChatPanel::Draw(), and yaze::editor::RightPanelManager::DrawAgentChatPanel().

Here is the call graph for this function:

◆ UpdateHarnessTelemetry()

void yaze::editor::AgentChat::UpdateHarnessTelemetry ( const AutomationTelemetry & telemetry)

Definition at line 323 of file agent_chat.cc.

References telemetry_history_.

◆ SetLastPlanSummary()

void yaze::editor::AgentChat::SetLastPlanSummary ( const std::string & summary)

Definition at line 331 of file agent_chat.cc.

References last_plan_summary_.

◆ GetTelemetryHistory()

const std::vector< AutomationTelemetry > & yaze::editor::AgentChat::GetTelemetryHistory ( ) const
inline

Definition at line 80 of file agent_chat.h.

References telemetry_history_.

◆ GetLastPlanSummary()

const std::string & yaze::editor::AgentChat::GetLastPlanSummary ( ) const
inline

Definition at line 81 of file agent_chat.h.

References last_plan_summary_.

◆ RenderToolbar()

void yaze::editor::AgentChat::RenderToolbar ( )
private

◆ RenderHistory()

void yaze::editor::AgentChat::RenderHistory ( )
private

Definition at line 158 of file agent_chat.cc.

References agent_service_, yaze::cli::agent::ConversationalAgentService::GetHistory(), message_spacing_, RenderMessage(), RenderThinkingIndicator(), and waiting_for_response_.

Referenced by Draw().

Here is the call graph for this function:

◆ RenderInputBox()

void yaze::editor::AgentChat::RenderInputBox ( )
private

Definition at line 263 of file agent_chat.cc.

References input_buffer_, and SendMessage().

Referenced by Draw().

Here is the call graph for this function:

◆ RenderMessage()

◆ RenderThinkingIndicator()

void yaze::editor::AgentChat::RenderThinkingIndicator ( )
private

Definition at line 247 of file agent_chat.cc.

References ICON_MD_PENDING, and thinking_animation_.

Referenced by RenderHistory().

◆ RenderProposalQuickActions()

void yaze::editor::AgentChat::RenderProposalQuickActions ( const cli::agent::ChatMessage & msg,
int index )
private

Definition at line 291 of file agent_chat.cc.

References yaze::cli::agent::ChatMessage::message, proposal_drawer_, and yaze::editor::ProposalDrawer::Show().

Referenced by RenderMessage().

Here is the call graph for this function:

◆ RenderCodeBlock()

void yaze::editor::AgentChat::RenderCodeBlock ( const std::string & code,
const std::string & language,
int msg_index )
private

Definition at line 305 of file agent_chat.cc.

References ICON_MD_CONTENT_COPY, yaze::editor::kSuccess, yaze::editor::ToastManager::Show(), and toast_manager_.

Referenced by RenderMessage().

Here is the call graph for this function:

◆ RenderTableData()

void yaze::editor::AgentChat::RenderTableData ( const cli::agent::ChatMessage::TableData & table)
private

◆ RenderToolTimeline()

void yaze::editor::AgentChat::RenderToolTimeline ( const cli::agent::ChatMessage & msg)
private

Definition at line 406 of file agent_chat.cc.

References ICON_MD_BUILD_CIRCLE, and yaze::cli::agent::ChatMessage::model_metadata.

Referenced by RenderMessage().

◆ ParseMessageContent()

std::vector< AgentChat::ContentBlock > yaze::editor::AgentChat::ParseMessageContent ( const std::string & content)
private

◆ HandleAgentResponse()

void yaze::editor::AgentChat::HandleAgentResponse ( const absl::StatusOr< cli::agent::ChatMessage > & response)
private

Definition at line 69 of file agent_chat.cc.

References yaze::editor::kError, LOG_ERROR, ScrollToBottom(), yaze::editor::ToastManager::Show(), toast_manager_, and waiting_for_response_.

Referenced by SendMessage().

Here is the call graph for this function:

Member Data Documentation

◆ context_

AgentUIContext* yaze::editor::AgentChat::context_ = nullptr
private

Definition at line 106 of file agent_chat.h.

Referenced by Draw(), and SetContext().

◆ toast_manager_

ToastManager* yaze::editor::AgentChat::toast_manager_ = nullptr
private

◆ proposal_drawer_

ProposalDrawer* yaze::editor::AgentChat::proposal_drawer_ = nullptr
private

Definition at line 108 of file agent_chat.h.

Referenced by Initialize(), and RenderProposalQuickActions().

◆ rom_

Rom* yaze::editor::AgentChat::rom_ = nullptr
private

Definition at line 109 of file agent_chat.h.

Referenced by SetRomContext().

◆ agent_service_

cli::agent::ConversationalAgentService yaze::editor::AgentChat::agent_service_
private

Definition at line 112 of file agent_chat.h.

Referenced by ClearHistory(), GetAgentService(), RenderHistory(), SaveHistory(), and SendMessage().

◆ active_

bool yaze::editor::AgentChat::active_ = false
private

Definition at line 113 of file agent_chat.h.

Referenced by active(), and set_active().

◆ waiting_for_response_

bool yaze::editor::AgentChat::waiting_for_response_ = false
private

Definition at line 114 of file agent_chat.h.

Referenced by HandleAgentResponse(), RenderHistory(), and SendMessage().

◆ thinking_animation_

float yaze::editor::AgentChat::thinking_animation_ = 0.0f
private

Definition at line 115 of file agent_chat.h.

Referenced by RenderThinkingIndicator(), and SendMessage().

◆ input_buffer_

char yaze::editor::AgentChat::input_buffer_[4096] = {}
private

Definition at line 116 of file agent_chat.h.

Referenced by RenderInputBox().

◆ scroll_to_bottom_

bool yaze::editor::AgentChat::scroll_to_bottom_ = false
private

Definition at line 117 of file agent_chat.h.

Referenced by Draw(), and ScrollToBottom().

◆ history_loaded_

bool yaze::editor::AgentChat::history_loaded_ = false
private

Definition at line 118 of file agent_chat.h.

◆ auto_scroll_

bool yaze::editor::AgentChat::auto_scroll_ = true
private

Definition at line 121 of file agent_chat.h.

Referenced by auto_scroll(), Draw(), RenderToolbar(), and set_auto_scroll().

◆ show_timestamps_

bool yaze::editor::AgentChat::show_timestamps_ = true
private

Definition at line 122 of file agent_chat.h.

Referenced by RenderMessage(), RenderToolbar(), set_show_timestamps(), and show_timestamps().

◆ show_reasoning_

bool yaze::editor::AgentChat::show_reasoning_ = false
private

Definition at line 123 of file agent_chat.h.

Referenced by RenderToolbar(), set_show_reasoning(), and show_reasoning().

◆ message_spacing_

float yaze::editor::AgentChat::message_spacing_ = 12.0f
private

Definition at line 124 of file agent_chat.h.

Referenced by RenderHistory().

◆ telemetry_history_

std::vector<AutomationTelemetry> yaze::editor::AgentChat::telemetry_history_
private

Definition at line 127 of file agent_chat.h.

Referenced by GetTelemetryHistory(), and UpdateHarnessTelemetry().

◆ last_plan_summary_

std::string yaze::editor::AgentChat::last_plan_summary_
private

Definition at line 128 of file agent_chat.h.

Referenced by GetLastPlanSummary(), and SetLastPlanSummary().


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