class

Enkaidu::Console::Renderer

Inherits Enkaidu::Console::StyleApplicator < Enkaidu::SessionRenderer < Reference < Object

This class is responsible for rendering console outputs.

Constants

LLM_MAX_TOOL_CALL_ARGS_LENGTH = 90
MAX_IMAGE_URL_LENGTH = 72
MCP_MAX_TOOL_CALL_ARGS_LENGTH = 72
MCP_MAX_TOOL_RESULT_LENGTH = 72
MDR_STYLESHEET = Termify::Markdown::Stylesheet.new({:h1 => mdr_heading_style(prefix: "#"), :h2 => mdr_heading_style(prefix: "##"), :h3 => mdr_heading_style(prefix: "###"), :h4 => mdr_heading_style(prefix: "####"), :h5 => mdr_heading_style(prefix: "----"), :h6 => mdr_heading_style(underline: true), "code_block" => { highlight_theme: "catppuccin-macchiato", }, :code_inline => {fg: "cyan"}, :html_tag => {dim: true}, :block_html => {dim: true}, :table => {fg: "white"}, :block_quote => { line_prefix: "▌ ", newline_before: true, newline_after: true, }}, merge: Termify::Markdown::Stylesheet.default)

Markdown rendering stylesheet for use with Termify

REASONING_FINISH = "╰╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶"
REASONING_START = "╭╶╶╶╶╶╶╶╶╶╶< thinking >╶╶╶╶╶╶╶╶╶╶╶"

Instance methods

error_with(message, help = nil, markdown = false)

ERROR alerting message

Source
info_with(message, help = nil, markdown = false)

INFO alerting message

Source
llm_error(err, message : String | Nil = nil)
Source
llm_image_url(url)
Source
llm_text(text, reasoning : Bool, starting : Bool = false, ending : Bool = false)
Source
llm_text_block(text, reasoning : Bool)
Source
llm_tool_call(name, args)
Source
markdown_to_term(text)

Render Markdown to string using Termify

Source
mcp_calling_tool(uri, name, args)
Source
mcp_calling_tool_result(uri, name, result)
Source
mcp_error(ex)
Source
mcp_initialized(uri)
Source
mcp_prompt_ask_input(prompt : MCPPrompt) : Hash(String, String)
Source
mcp_prompt_ready(prompt)
Source
mcp_prompts_found(count)
Source
mcp_tool_ready(function)
Source
mcp_tools_found(count)
Source
quiet=(quiet : Bool)
Source
quiet?
Source
respond_with(message, help = nil, markdown = false)

Response to user command

Source
session_popped(depth)
Source
session_pushed(depth, keep_tools, keep_prompts, keep_history)
Source
session_reset
Source
session_stack_changed(name)
Source
session_stack_new(name)
Source
streaming=(streaming : Bool)
Source
streaming?
Source
time_elapsed(duration : Time::Span, label : String | Nil = nil)
Source
user_confirm_security_question?(description, subject : String | Array(String)) : Bool

Prompt the user with a confirmation request for security confirmation by presenting the description followed by the subject of the question. The renderer should further emphasize the subject when presenting the question. @return True to confirm, false otherwise.

Source
user_prompt_ask_input(prompt : TemplatePrompt, params : Hash | Nil = nil) : Hash(String, String)

Present prompt and ask for inputs if arguments are defined and no values are present in params.

Source
user_query_image_url(url)

Prompt query image

Source
user_query_text(query, via_query_queue = false)

Prompt query text

Source
warning_with(message, help = nil, markdown = false)

WARN alerting message

Source