ViteHub is still experimental. Expect bugs and breaking changes.

Message Parts

Render the complete AI SDK UIMessage part union with application escape hatches.

AgentMessageParts dispatches the parts already present in an AI SDK UIMessage. Text uses AgentMarkdown; reasoning and tools use Nuxt UI; files and sources use accessible links.

Preview

Supported parts

PartDefault rendering
textStreaming-aware Comark Markdown.
reasoningUChatReasoning.
tool-*, dynamic-toolUChatTool with input, output, error, and loading state.
fileNamed download or image preview.
source-url, source-documentSource link or document label.
step-startNo visual output unless slotted.
data-*, custom, reasoning-filefallback slot.

Customize typed data

<AgentMessageParts :parts="message.parts">
  <template #fallback="{ part }">
    <WeatherCard
      v-if="part.type === 'data-weather'"
      :weather="part.data"
    />
  </template>
</AgentMessageParts>

Use #part to intercept every part before the default dispatcher. Use the narrower #text, #reasoning, #tool, #file, #source, and #step slots when only one rendering needs to change.