Repository navigation
Transcript AssistantProse
The assistant's message text, drawn by a MarkdownRenderer. The default renderer is LeanMarkdownRenderer (in markdown.dart); its inline text is drawn by MarkdownText. This sheet covers AssistantProse, MarkdownText, MarkdownRenderer and LeanMarkdownRenderer.
import 'package:agent_kit/agent_kit.dart';
Default renderer: a prose message with paragraphs, a bullet list, inline code, bold text and a fenced block. The gallery takes this as the second AssistantProse in the Components scene; the first is the copy inside the transcript list.
AssistantProse
| Parameter | Type | Notes |
|---|---|---|
message |
AssistantMessage |
Required, positional. Its markdown is rendered; its streaming flag is passed to the renderer. |
renderer |
MarkdownRenderer |
Default LeanMarkdownRenderer(). A host can pass its own renderer for tables, images or syntax colours. |
onLinkTap |
ValueChanged<String>? |
Called with the target of a tapped [label](target) link. Without it, links are drawn but do not respond to taps. |
MarkdownText (inline runs of one block)
| Parameter | Type | Notes |
|---|---|---|
text |
String |
Required, positional. Inline markdown: code, **bold**, *italic*, [link](target), and backslash escapes. |
style |
TextStyle |
Required. The base style of the paragraph. |
onLinkTap |
ValueChanged<String>? |
As above. |
LeanMarkdownRenderer: supports paragraphs, headings, bullet and numbered lists (nested by two-space indent, levels 0 to 3), block quotes, fenced code, horizontal rules, and the inline forms above. Headings of level 1 and 2 use typeScale.h3; deeper headings use bold body text. The streaming argument is accepted but not used; an unclosed fence runs to the end of the text (parseMarkdownBlocks).
-
MarkdownText:accentInk(link text and underline),codeBackgroundandcodeInk(inline code),radii.sm(inline code corners). - Blocks in
LeanMarkdownRenderer:typeScale.bodyandink(paragraphs),typeScale.h3(headings 1 and 2),thread(quote rule),muted(quote text),faint(list markers),seam(horizontal rule). Code blocks useCodeBlock.
Does not read the size class. Text wraps to the width the transcript list gives it. Lists are indented by 6 + level × 18 px.
None in the code. Links are tappable text spans (TapGestureRecognizer) with no Semantics label and no keyboard handling.
- Gallery scene: Components. Specimen "Assistant prose (default markdown renderer)" in
TranscriptSpecimens(apps/gallery/lib/components/transcript.dart). - Golden:
apps/gallery/test/component_shots_test.dartwritesassistant_prose, which takes the secondAssistantProsein the scene (light and dark). - Other tests, in
packages/agent_kit/test/transcript/transcript_test.dart:- "splits blocks" (line 25), "an open fence runs to the end" (37), "numbered lists, headings and quotes" (42), and "inline runs" (49), which test the parser;
- "the default renderer draws prose and a code block" (58);
- "a link calls back" (73).
- Transcript goldens in
packages/agent_kit/test/goldens/transcript_turn_*.pngandtranscript_states_*.png.
Generated from docs/components/transcript/AssistantProse.md. Edit the file there; changes made on the wiki are overwritten.
Guides
- Package layout and pinning
- agent_kit_core
- Backend mapping
- agent_kit and the gallery
- Icon and README assets
Component sheets
theme
status
transcript
- ActivityGroupView
- AssistantProse
- ChildQuestionRow
- CodeBlock
- DiffView
- ExecOutput
- FileEditRow
- PlanChecklist
- ReturnLine
- SystemLineView
- TranscriptList
- UserBubble
composer
chrome
context
history
outline
workspace
compositions
providers