-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Feat/add mermaid chart rendering #5377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/add mermaid chart rendering #5377
Conversation
Signed-off-by: Arya Pratap Singh <[email protected]>
Signed-off-by: Arya Pratap Singh <[email protected]>
|
Hi @DOsinga , @alexhancock , @aharvard This PR intends to add mermaid chart rendering via Autviz and MCP UI to goose. Flagging you all to review. Thank you! |
|
reminder to review, 1 test is failing as the github repo creds for api keys are not set. rest LGTM to me in recheck |
|
can this be completed today? @maintainers |
|
Hi @ARYPROGRAMMER ! Thank you for waiting, the dev team will get to this as soon as they can! |
alexhancock
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM if it also does to @michaelneale
|
Test failures in https://github.com/block/goose/actions/runs/18807497526/job/53674602193?pr=5377 are likely unrelated |
|
nice I like @ARYPROGRAMMER ! @alexhancock I just realised those failures are probably as forks don't have access to those secrets... need to think what systemic solution is for that (I think for forks we can skip that part of the job, keep it for branches) |
|
i'm merging! |
|
Nice! Thanks for this one, will be fun to use |
* main: Feat/add mermaid chart rendering (#5377) Set up Datadog metrics for prompt injection detection (#5385) fix: restore --resume functionality for most recent session (#5401) Gemini again (#5390) docs(prompt-library): add github-issue-labeler intermediate prompt (#5374) docs: add Linux and Windows paths to uninstall section (#5371) fix: --session-id shouldn't work without --resume, but --name should (#5360) Auto-compact Threshold UI improvements (#5354) Filter preserved user messages to be text only. (#5391) include sessionId in tool request (#5394) feat: add PR Impact Analyzer prompt (#5375) docs: add blog post on configuring goose for team environments (#5380) migrating back with new chatrecall non underscore name (#5223)
* main: (30 commits) feat: add goose powered ai culinary innovation studio prompt to library (#5423) removing golang/temporal building testing tetrate with sonnet (#5428) Add Recipes Test Script (#5420) Don't die on strange chars (#5415) fix: allow subagent to run in parent --no-session mode (#5384) docs: analyze tool (#5418) fix: gracefully close goosed listening port (#5321) move history txt to state dir (#5410) Dont exit silently when storing api key fails (#5260) Make reply use the API (#5389) Fix/icon ii (#5413) Enable runtime access to provider name (#5399) fix: ensure trailing newline in files created by `text_editor` tool (#5336) docs: September 2025 Community All-Stars (#5411) make supports_cache_control async to avoid block in place (#5362) Send all the logs we output (#5363) Recipe variables (#5365) Feat/add mermaid chart rendering (#5377) Set up Datadog metrics for prompt injection detection (#5385) ...
* 'main' of github.com:block/goose: (132 commits) Fix/icon ii (#5413) Enable runtime access to provider name (#5399) fix: ensure trailing newline in files created by `text_editor` tool (#5336) docs: September 2025 Community All-Stars (#5411) make supports_cache_control async to avoid block in place (#5362) Send all the logs we output (#5363) Recipe variables (#5365) Feat/add mermaid chart rendering (#5377) Set up Datadog metrics for prompt injection detection (#5385) fix: restore --resume functionality for most recent session (#5401) Gemini again (#5390) docs(prompt-library): add github-issue-labeler intermediate prompt (#5374) docs: add Linux and Windows paths to uninstall section (#5371) fix: --session-id shouldn't work without --resume, but --name should (#5360) Auto-compact Threshold UI improvements (#5354) Filter preserved user messages to be text only. (#5391) include sessionId in tool request (#5394) feat: add PR Impact Analyzer prompt (#5375) docs: add blog post on configuring goose for team environments (#5380) migrating back with new chatrecall non underscore name (#5223) ...
Signed-off-by: Arya Pratap Singh <[email protected]> Signed-off-by: Blair Allan <[email protected]>
Summary
Implements Mermaid chart rendering in Goose's chat UI as requested in issue #4222. This adds support for rendering interactive Mermaid diagrams (flowcharts, sequence diagrams, Gantt charts, etc.) directly inline in conversations, eliminating the need to copy-paste to external tools.
Type of Change
Testing
cargo test -p goose-mcp test_render_mermaid)cargo build --package goose-mcp)Related Issues
Relates to #4222
Discussion: #4222
Screenshots/Demos (for UX changes)
Before: Users had to copy-paste Mermaid code to external tools to visualize diagrams
After: Interactive Mermaid diagrams render directly inline in Goose's chat interface
Example diagram that will render:
graph TD; A-->B; A-->C; B-->D; C-->D;Changes
Core Implementation
render_mermaidtool to AutoVisualiser MCP server with proper MCP-UI integrationRenderMermaidParamsstruct for accepting Mermaid syntax as inputmermaid_template.htmlwith Mermaid.js integration and responsive stylingmermaid.min.js(v10.9.0) to assets directory for client-side renderingDocumentation & Testing
test_render_mermaidunit test to verify tool functionality and MCP-UI resource generationTechnical Details
The implementation follows the existing AutoVisualiser pattern:
mermaid_codefield/tmp/mermaid.htmlfor development inspectionFiles Changed
crates/goose-mcp/src/autovisualiser/mod.rs- Added tool implementation and testscrates/goose-mcp/src/autovisualiser/templates/mermaid_template.html- New HTML templatecrates/goose-mcp/src/autovisualiser/templates/assets/mermaid.min.js- Mermaid.js librarydocumentation/docs/mcp/autovisualiser-mcp.md- Updated documentationEmail: [email protected]