> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mira-app.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Streaming & Markdown

> How MIRA renders streaming responses — real-time tokens, rich Markdown, code syntax highlighting, and tables.

## Real-time streaming

MIRA renders responses as they arrive — token by token for NAE, iteration by iteration for RLM. You see the answer being constructed rather than waiting for it to complete.

**NAE streaming:** Each token from the LLM API arrives via the `nae:chunk` IPC event and is appended to the message bubble in real time. Rendering is throttled to \~60 fps using a `requestAnimationFrame` flush loop — fast model responses don't block the UI.

**RLM streaming:** Each reasoning iteration (code written, code executed, output observed) arrives as an `rlm:iteration` event. The REPL Console shows the full iteration stream. The final answer arrives as an `rlm:final` event and is rendered as a complete Markdown block.

## Markdown rendering

All assistant responses are rendered as Markdown with these elements supported:

| Element             | Example                                       |
| ------------------- | --------------------------------------------- |
| **Headings**        | `## Section Title`                            |
| **Bold / italic**   | `**bold**`, `*italic*`                        |
| **Inline code**     | `` `variable` ``                              |
| **Code blocks**     | Fenced with ` ``` ` and optional language tag |
| **Tables**          | GFM pipe tables                               |
| **Ordered lists**   | `1. item`                                     |
| **Unordered lists** | `- item`                                      |
| **Blockquotes**     | `> quote`                                     |
| **Links**           | `[text](url)`                                 |
| **Horizontal rule** | `---`                                         |

## Code blocks with syntax highlighting

Code blocks are syntax-highlighted based on the language tag:

````
```python
def calculate_roi(gain, cost):
    return (gain - cost) / cost * 100
```
````

Supported languages include Python, TypeScript, JavaScript, JSON, SQL, Bash, YAML, and dozens more. Unrecognised language tags render as plain monospaced text.

Each code block has a **Copy** button in the top-right corner.

## Copy message

Every message bubble has a **Copy** button (clipboard icon) that copies the raw Markdown source to the clipboard — not the rendered HTML. This preserves formatting when pasting into other tools.

## Timestamps

Messages show a relative timestamp (e.g. "just now", "2 min ago") that updates in real time. Hover over a timestamp to see the absolute time.

## Token usage

When a response completes, NAE reports input and output token counts in small text below the message. This helps you track context usage across a long session.

## User message editing

User messages are displayed as plain text. They cannot be edited after sending — create a new message to refine your query.
