# A reply, as it arrives

**SWIFTUI · STREAMING MARKDOWN**

Keep a stable rendering session and observe it directly in your view. Append each incoming chunk; the session prepares the changing tail while completed regions retain their identity.

```swift
import SwiftUI
import SiriusMarkdown

@MainActor
final class Reply {
  let session =
    MarkdownRenderSession(
      configuration:
        .compactChat
    )

  func receive(
    _ chunk: String
  ) {
    session.append(chunk)
  }
}
```

## One prepared surface

- **Markdown semantics** come from `swift-markdown`.
- **Preparation** resolves text, math and code before view evaluation.
- **Layout** reuses prepared measurements as the available width changes.

The host owns the conversation. The package owns the rendered Markdown.
