Skip to content

Update mermaid-to-image extension #18975

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

chihkang
Copy link
Contributor

@chihkang chihkang commented May 6, 2025

Description

Screencast

CleanShot 2025-05-06 at 15 41 51@2x

clipboard
image

Checklist

- Enhance AI tool for generating Mermaid diagrams: added detailed instructions, example prompts, and improved clipboard image copying functionality.
- Fix return message for clipboard copy confirmation in generateMermaidImageTool
- Add AI tool for generating Mermaid diagrams and copying images to clipboard
- Initial commit
@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: mermaid-to-image Issues related to the mermaid-to-image extension labels May 6, 2025
@raycastbot
Copy link
Collaborator

Thank you for the update! 🎉

You can expect an initial review within five business days.

@raycastbot raycastbot added the OP is author The OP of the PR is the author of the extension label May 6, 2025
@chihkang chihkang marked this pull request as ready for review May 6, 2025 08:03
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR adds AI capabilities to the Mermaid to Image extension, enabling users to generate diagrams through natural language prompts and automatically copy the resulting images to the clipboard.

  • Added generateMermaidImageTool in /extensions/mermaid-to-image/src/tools/generate-mermaid-diagram-with-ai.ts with proper error handling and cleanup
  • Implemented comprehensive AI evals in package.json covering various diagram types and error scenarios
  • Added detailed AI instructions and examples in package.json to guide accurate diagram generation
  • Added new changelog entry following correct format with {PR_MERGE_DATE} template
  • Properly configured tool with no-view command for background AI execution

The implementation follows Raycast's guidelines for AI tools and includes proper error handling using showFailureToast. The changes are well-documented and include appropriate test cases.

3 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

…ges for diagram generation and clipboard copying process
@NormCopeland
Copy link

Thanks @chihkang!

@andreaselia
Copy link
Contributor

Hey @chihkang 👋

Great to see more AI tools being added for extensions!

Are you able to run the evals locally? Could you send me the output if they're passing for you too please?

… generation: unify mock responses and streamline expected results.
@chihkang
Copy link
Contributor Author

chihkang commented May 9, 2025

Hey @andreaselia 👋

I fixed the evals issue.

CleanShot 2025-05-09 at 09 46 27@2x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AI Extension extension fix / improvement Label for PRs with extension's fix improvements extension: mermaid-to-image Issues related to the mermaid-to-image extension OP is author The OP of the PR is the author of the extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants