Minga.RenderModel.UI.AgentChat.MarkdownBlock (Minga v0.1.0)

Copy Markdown View Source

Semantic markdown block for agent chat messages.

The BEAM owns markdown structure. Frontends render these blocks directly and must not infer code cards from styled-run flags or decorative text.

Summary

Types

Markdown block kind encoded on the gui_agent_chat wire.

A line of styled runs.

A styled text run: {text, fg_rgb, bg_rgb, flags} or with a trailing url.

t()

Types

kind()

@type kind() ::
  :paragraph
  | :heading
  | :list_item
  | :blockquote
  | :rule
  | :spacer
  | :code_block

Markdown block kind encoded on the gui_agent_chat wire.

styled_line()

@type styled_line() :: [styled_run()]

A line of styled runs.

styled_run()

A styled text run: {text, fg_rgb, bg_rgb, flags} or with a trailing url.

t()

@type t() :: %Minga.RenderModel.UI.AgentChat.MarkdownBlock{
  capability_flags: non_neg_integer(),
  flags: non_neg_integer(),
  height: non_neg_integer(),
  id: non_neg_integer(),
  indent: non_neg_integer(),
  kind: kind(),
  label: String.t(),
  language: String.t(),
  level: non_neg_integer(),
  lines: [styled_line()],
  ordered: boolean(),
  ordinal: non_neg_integer(),
  target_path: String.t()
}

Functions

blockquote(id, lines)

@spec blockquote(non_neg_integer(), [styled_line()]) :: t()

code_block(id, language, label, target_path, complete?, lines)

@spec code_block(
  non_neg_integer(),
  String.t(),
  String.t(),
  String.t() | nil,
  boolean(),
  [styled_line()]
) ::
  t()

complete?(markdown_block)

@spec complete?(t()) :: boolean()

heading(id, level, lines)

@spec heading(non_neg_integer(), non_neg_integer(), [styled_line()]) :: t()

list_item(id, indent, ordered?, ordinal, lines)

@spec list_item(non_neg_integer(), non_neg_integer(), boolean(), non_neg_integer(), [
  styled_line()
]) ::
  t()

map_lines(block, mapper)

@spec map_lines(t(), (styled_line() -> styled_line())) :: t()

map_lines(block, mapper, max_lines)

@spec map_lines(t(), (styled_line() -> styled_line()), pos_integer()) :: t()

paragraph(id, lines)

@spec paragraph(non_neg_integer(), [styled_line()]) :: t()

rule(id)

@spec rule(non_neg_integer()) :: t()

spacer(id, height)

@spec spacer(non_neg_integer(), non_neg_integer()) :: t()