hackagent.interfaces.tui.widgets.actions
Agent Actions Viewer Component
A reusable Textual widget for displaying agent tool calls, function executions, and web interactions in a structured, visual format.
AgentActionsViewer Objects
class AgentActionsViewer(Container)
A container widget for displaying agent actions (tool calls, HTTP requests, etc.) in a visual, inspector-like format.
This component provides:
- Visual representation of tool/function calls
- HTTP request/response display
- Agent reasoning steps (for ADK agents)
- JSON payload inspector
- Collapsible action details
__init__
def __init__(title: str = "Agent Actions Inspector",
show_controls: bool = True,
**kwargs)
Initialize the actions viewer.
Arguments:
title- Title to display in the headershow_controls- Whether to show control buttons**kwargs- Additional keyword arguments for Container
compose
def compose() -> ComposeResult
Compose the actions viewer layout.
on_mount
def on_mount() -> None
Called when the widget is mounted.
on_button_pressed
def on_button_pressed(event: Button.Pressed) -> None
Handle button press events.
get_actions_text
def get_actions_text() -> str
Return the plain text currently shown in the actions log.
copy_actions
def copy_actions() -> bool
Copy all currently shown agent actions to the clipboard.
add_info_message
def add_info_message(message: str) -> None
Add an informational message to the viewer.
add_http_request
def add_http_request(method: str,
url: str,
headers: Optional[Dict[str, Any]] = None,
payload: Optional[Dict[str, Any]] = None,
step_number: Optional[int] = None) -> None
Add an HTTP request action to the viewer.
Arguments:
method- HTTP method (GET, POST, etc.)url- Request URLheaders- Request headerspayload- Request payloadstep_number- Optional step number
add_tool_call
def add_tool_call(tool_name: str,
arguments: Optional[Dict[str, Any]] = None,
result: Optional[str] = None,
step_number: Optional[int] = None) -> None
Add a tool/function call action to the viewer.
Arguments:
tool_name- Name of the tool/functionarguments- Tool argumentsresult- Tool execution resultstep_number- Optional step number
add_adk_event
def add_adk_event(event_type: str,
event_data: Dict[str, Any],
step_number: Optional[int] = None) -> None
Add an ADK agent event to the viewer.
Arguments:
event_type- Type of event (tool_call, tool_result, llm_response, etc.)event_data- Event data dictionarystep_number- Optional step number
add_step_separator
def add_step_separator(step_name: str, step_number: int = 0) -> None
Add a visual separator for pipeline steps.
Arguments:
step_name- Name of the stepstep_number- Step number (0 for no number)
clear_actions
def clear_actions() -> None
Clear all actions from the viewer.
update_action_count
def update_action_count(count: int) -> None
Update the action count display.
Arguments:
count- Number of actions
subscribe_to_bus
def subscribe_to_bus(bus: Any, app: Any) -> None
Subscribe this viewer to a :class:TUIEventBus.
Events arrive on the emitting (worker) thread, so each handler
marshals back onto the Textual UI thread via app.call_from_thread.