Skip to content

feat(agent-gui): render Mermaid diagrams#1083

Draft
chovy-ai wants to merge 1 commit into
mainfrom
agent/agent-gui-mermaid-rendering
Draft

feat(agent-gui): render Mermaid diagrams#1083
chovy-ai wants to merge 1 commit into
mainfrom
agent/agent-gui-mermaid-rendering

Conversation

@chovy-ai

@chovy-ai chovy-ai commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • render explicit fenced mermaid blocks in AgentGUI transcript Markdown
  • lazy-load Mermaid and wait until streaming completes before diagram layout
  • use strict rendering settings with bounded text/edge limits and source fallback
  • preserve the existing fenced-code copy affordance for non-Mermaid blocks
  • document the supported syntax and rendering boundary

Why

AgentGUI previously displayed Mermaid flowchart source as an ordinary code block, so architecture and delivery flows were difficult to read in conversation transcripts.

User impact

Agent responses can now include diagrams using a fenced mermaid block. Invalid or incomplete diagrams remain readable as source instead of leaving an empty transcript row.

Validation

  • pnpm check:full
  • pnpm --filter @tutti-os/agent-gui test (129 files, 2244 tests)
  • pnpm --filter @tutti-os/agent-gui typecheck
  • pnpm --filter @tutti-os/agent-gui build
  • pnpm --filter @tutti-os/desktop build
  • pnpm lint:ts
  • pnpm check:i18n
  • pnpm check:agent-activity-runtime-boundaries

Summary by cubic

Render Mermaid diagrams in AgentGUI transcripts to make architecture and flow visuals readable. Fenced mermaid code blocks now render after streaming completes, with strict settings and a safe source fallback.

  • New Features

    • Render fenced mermaid blocks as diagrams in transcript Markdown.
    • Lazy-load mermaid and defer layout until streaming ends.
    • Strict mode (securityLevel: "strict", HTML labels off, bounded text/edge limits) with source shown on errors.
    • Keep existing copy affordance for non-mermaid code blocks; add i18n for rendering status and failure.
  • Dependencies

    • Added mermaid@11.16.0.

Written for commit 9324c18. Summary will update on new commits.

Review in cubic

Signed-off-by: chovy <chovy@chovydeMac-mini.local>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant