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::ConversationalAgentService * | GetAgentService () |
| 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< ContentBlock > | ParseMessageContent (const std::string &content) |
| void | HandleAgentResponse (const absl::StatusOr< cli::agent::ChatMessage > &response) |
Private Attributes | |
| AgentUIContext * | context_ = nullptr |
| ToastManager * | toast_manager_ = nullptr |
| ProposalDrawer * | proposal_drawer_ = nullptr |
| Rom * | rom_ = 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< AutomationTelemetry > | telemetry_history_ |
| std::string | last_plan_summary_ |
Unified Agent Chat Component.
Handles:
Definition at line 31 of file agent_chat.h.
| yaze::editor::AgentChat::AgentChat | ( | ) |
Definition at line 25 of file agent_chat.cc.
|
default |
| 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_.
| void yaze::editor::AgentChat::SetRomContext | ( | Rom * | rom | ) |
Definition at line 34 of file agent_chat.cc.
References rom_.
| void yaze::editor::AgentChat::SetContext | ( | AgentUIContext * | context | ) |
Definition at line 38 of file agent_chat.cc.
References context_.
| void yaze::editor::AgentChat::Draw | ( | float | available_height = 0.0f | ) |
Definition at line 81 of file agent_chat.cc.
References auto_scroll_, context_, RenderHistory(), RenderInputBox(), RenderToolbar(), and scroll_to_bottom_.
Referenced by yaze::editor::AgentChatPanel::Draw(), and yaze::editor::RightPanelManager::DrawAgentChatPanel().

| void yaze::editor::AgentChat::SendMessage | ( | const std::string & | message | ) |
Definition at line 57 of file agent_chat.cc.
References agent_service_, HandleAgentResponse(), ScrollToBottom(), yaze::cli::agent::ConversationalAgentService::SendMessage(), thinking_animation_, and waiting_for_response_.
Referenced by RenderInputBox().

| void yaze::editor::AgentChat::ClearHistory | ( | ) |
Definition at line 50 of file agent_chat.cc.
References agent_service_, yaze::editor::kInfo, yaze::cli::agent::ConversationalAgentService::ResetConversation(), yaze::editor::ToastManager::Show(), and toast_manager_.
Referenced by yaze::editor::RightPanelManager::DrawAgentChatPanel(), and RenderToolbar().

| void yaze::editor::AgentChat::ScrollToBottom | ( | ) |
Definition at line 46 of file agent_chat.cc.
References scroll_to_bottom_.
Referenced by yaze::editor::RightPanelManager::DrawAgentChatPanel(), HandleAgentResponse(), and SendMessage().
| absl::Status yaze::editor::AgentChat::LoadHistory | ( | const std::string & | filepath | ) |
Definition at line 451 of file agent_chat.cc.
Referenced by RenderToolbar().
| absl::Status yaze::editor::AgentChat::SaveHistory | ( | const std::string & | filepath | ) |
Definition at line 478 of file agent_chat.cc.
References agent_service_, yaze::cli::agent::ConversationalAgentService::GetHistory(), and yaze::cli::agent::ChatMessage::kUser.
Referenced by yaze::editor::RightPanelManager::DrawAgentChatPanel(), and RenderToolbar().

| cli::agent::ConversationalAgentService * yaze::editor::AgentChat::GetAgentService | ( | ) |
Definition at line 42 of file agent_chat.cc.
References agent_service_.
|
inline |
Definition at line 58 of file agent_chat.h.
References auto_scroll_.
Referenced by yaze::editor::RightPanelManager::DrawAgentChatPanel().
|
inline |
Definition at line 59 of file agent_chat.h.
References auto_scroll_.
Referenced by yaze::editor::RightPanelManager::DrawAgentChatPanel().
|
inline |
Definition at line 60 of file agent_chat.h.
References show_timestamps_.
Referenced by yaze::editor::RightPanelManager::DrawAgentChatPanel().
|
inline |
Definition at line 61 of file agent_chat.h.
References show_timestamps_.
Referenced by yaze::editor::RightPanelManager::DrawAgentChatPanel().
|
inline |
Definition at line 62 of file agent_chat.h.
References show_reasoning_.
Referenced by yaze::editor::RightPanelManager::DrawAgentChatPanel().
|
inline |
Definition at line 63 of file agent_chat.h.
References show_reasoning_.
Referenced by yaze::editor::RightPanelManager::DrawAgentChatPanel().
|
inline |
Definition at line 66 of file agent_chat.h.
References active_.
Referenced by yaze::editor::RightPanelManager::DrawAgentChatPanel(), and set_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().

| void yaze::editor::AgentChat::UpdateHarnessTelemetry | ( | const AutomationTelemetry & | telemetry | ) |
Definition at line 323 of file agent_chat.cc.
References telemetry_history_.
| void yaze::editor::AgentChat::SetLastPlanSummary | ( | const std::string & | summary | ) |
Definition at line 331 of file agent_chat.cc.
References last_plan_summary_.
|
inline |
Definition at line 80 of file agent_chat.h.
References telemetry_history_.
|
inline |
Definition at line 81 of file agent_chat.h.
References last_plan_summary_.
|
private |
Definition at line 115 of file agent_chat.cc.
References auto_scroll_, ClearHistory(), ICON_MD_DELETE_FOREVER, ICON_MD_FOLDER_OPEN, ICON_MD_SAVE, yaze::editor::kError, yaze::editor::kSuccess, LoadHistory(), SaveHistory(), yaze::editor::ToastManager::Show(), show_reasoning_, show_timestamps_, and toast_manager_.
Referenced by Draw().

|
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().

|
private |
Definition at line 263 of file agent_chat.cc.
References input_buffer_, and SendMessage().
Referenced by Draw().

|
private |
Definition at line 177 of file agent_chat.cc.
References ICON_MD_PERSON, ICON_MD_SMART_TOY, yaze::cli::agent::ChatMessage::json_pretty, yaze::editor::AgentChat::ContentBlock::kCode, yaze::cli::agent::ChatMessage::kUser, yaze::cli::agent::ChatMessage::message, ParseMessageContent(), RenderCodeBlock(), RenderProposalQuickActions(), RenderTableData(), RenderToolTimeline(), yaze::cli::agent::ChatMessage::sender, show_timestamps_, yaze::cli::agent::ChatMessage::table_data, and yaze::cli::agent::ChatMessage::timestamp.
Referenced by RenderHistory().
|
private |
Definition at line 247 of file agent_chat.cc.
References ICON_MD_PENDING, and thinking_animation_.
Referenced by RenderHistory().
|
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().

|
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().

|
private |
Definition at line 378 of file agent_chat.cc.
References yaze::cli::agent::ChatMessage::TableData::headers, and yaze::cli::agent::ChatMessage::TableData::rows.
Referenced by RenderMessage().
|
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().
|
private |
Definition at line 335 of file agent_chat.cc.
References yaze::editor::AgentChat::ContentBlock::kCode, and yaze::editor::AgentChat::ContentBlock::kText.
Referenced by RenderMessage().
|
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().

|
private |
Definition at line 106 of file agent_chat.h.
Referenced by Draw(), and SetContext().
|
private |
Definition at line 107 of file agent_chat.h.
Referenced by ClearHistory(), HandleAgentResponse(), Initialize(), RenderCodeBlock(), and RenderToolbar().
|
private |
Definition at line 108 of file agent_chat.h.
Referenced by Initialize(), and RenderProposalQuickActions().
|
private |
Definition at line 109 of file agent_chat.h.
Referenced by SetRomContext().
|
private |
Definition at line 112 of file agent_chat.h.
Referenced by ClearHistory(), GetAgentService(), RenderHistory(), SaveHistory(), and SendMessage().
|
private |
Definition at line 113 of file agent_chat.h.
Referenced by active(), and set_active().
|
private |
Definition at line 114 of file agent_chat.h.
Referenced by HandleAgentResponse(), RenderHistory(), and SendMessage().
|
private |
Definition at line 115 of file agent_chat.h.
Referenced by RenderThinkingIndicator(), and SendMessage().
|
private |
Definition at line 116 of file agent_chat.h.
Referenced by RenderInputBox().
|
private |
Definition at line 117 of file agent_chat.h.
Referenced by Draw(), and ScrollToBottom().
|
private |
Definition at line 118 of file agent_chat.h.
|
private |
Definition at line 121 of file agent_chat.h.
Referenced by auto_scroll(), Draw(), RenderToolbar(), and set_auto_scroll().
|
private |
Definition at line 122 of file agent_chat.h.
Referenced by RenderMessage(), RenderToolbar(), set_show_timestamps(), and show_timestamps().
|
private |
Definition at line 123 of file agent_chat.h.
Referenced by RenderToolbar(), set_show_reasoning(), and show_reasoning().
|
private |
Definition at line 124 of file agent_chat.h.
Referenced by RenderHistory().
|
private |
Definition at line 127 of file agent_chat.h.
Referenced by GetTelemetryHistory(), and UpdateHarnessTelemetry().
|
private |
Definition at line 128 of file agent_chat.h.
Referenced by GetLastPlanSummary(), and SetLastPlanSummary().