Skip to content

API Reference parrot.cli.tui.adapter

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.cli.tui.adapter

View source

TUI adapters: renderer, command context and log handler (spec §3 Module 12).

Alias ConversationTurn

Re-exported from parrot.cli.commands.ConversationTurn.

Class DrawerLogHandler

Route log records into the LogDrawer without touching other handlers' levels (AC14).

Parameter Type Default Description
app 'App[Any]'
drawer LogDrawer

Method DrawerLogHandler.emit

emit(record: logging.LogRecord) -> None

Parameter Type Default Description
record logging.LogRecord

Alias LogDrawer

Re-exported from parrot.cli.tui.widgets.LogDrawer.

Alias REPLConfig

Re-exported from parrot.cli.repl.REPLConfig.

Alias SlashCommandDispatcher

Re-exported from parrot.cli.commands.SlashCommandDispatcher.

Class TUICommandContext

CommandContext implementation for the workspace app.

Parameter Type Default Description
app 'App[Any]'
bot Any
config REPLConfig
runner TurnRunner
dispatcher SlashCommandDispatcher
renderer TUIRenderer

Attributes:

Attribute Type Description
history List[ConversationTurn] Display/export history is owned by the runner (spec §3 M5).

Method TUICommandContext.suspend

Release the terminal to a foreign prompt (HITL, device code), then redraw.

suspend() -> Iterator[None]

Returns: Iterator[None]

Class TUIRenderer

RendererProtocol implementation that appends renderables to the transcript.

Parameter Type Default Description
transcript TranscriptView

Method TUIRenderer.print

Rich-markup strings become Text; other renderables pass through.

print(*args: Any, **kwargs: Any) -> None

Parameter Type Default Description
*args Any ()
**kwargs Any {}

Method TUIRenderer.render

Mirror ResponseRenderer.render (renderer.py:89-122): output, tool panels, usage.

render(response: Any) -> None

Parameter Type Default Description
response Any

Method TUIRenderer.render_error

render_error(error: Exception) -> None

Parameter Type Default Description
error Exception

Method TUIRenderer.render_table

render_table(headers: List[str], rows: List[List[str]], title: Optional[str] = None) -> None

Parameter Type Default Description
headers List[str]
rows List[List[str]]
title Optional[str] None

Method TUIRenderer.render_info

render_info(lines: List[tuple[str, str]]) -> None

Parameter Type Default Description
lines List[tuple[str, str]]

Method TUIRenderer.render_history

Resumed transcript header + one user/assistant pair per turn (spec §3 M6 render_history shape).

render_history(turns: List[ConversationTurn], *, session_id: str) -> None

Parameter Type Default Description
turns List[ConversationTurn]
session_id str

Alias TranscriptView

Re-exported from parrot.cli.tui.widgets.TranscriptView.

Alias TurnRunner

Re-exported from parrot.cli.session.TurnRunner.

Attribute logger

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally