From 9f89b9ab1fdd36668f9ec20f11bf99df1863f0db Mon Sep 17 00:00:00 2001 From: Prashant-7718 Date: Tue, 22 Jul 2025 16:32:09 +0530 Subject: [PATCH 1/2] bug-fix --- .vscode/launch.json | 60 ++++----- .vscode/settings.json | 15 +-- .vscode/tasks.json | 50 ++++--- CHANGELOG.md | 10 -- README.md | 25 +--- package.json | 186 +++------------------------ pnpm-lock.yaml | 60 ++++----- src/commercial/ai/chatParticipant.ts | 10 +- src/extension.ts | 18 +-- webview/package.json | 2 +- 10 files changed, 129 insertions(+), 307 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 670d6e6..a04664d 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,34 +1,30 @@ -// A launch configuration that compiles the extension and then opens it inside a new window -// Use IntelliSense to learn about possible attributes. -// Hover to view descriptions of existing attributes. -// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 { - "version": "0.2.0", - "configurations": [ - { - "name": "Run Extension", - "type": "extensionHost", - "request": "launch", - "args": [ - "--extensionDevelopmentPath=${workspaceFolder}" - ], - "outFiles": [ - "${workspaceFolder}/out/**/*.js" - ], - "preLaunchTask": "${defaultBuildTask}" - }, - { - "name": "Extension Tests", - "type": "extensionHost", - "request": "launch", - "args": [ - "--extensionDevelopmentPath=${workspaceFolder}", - "--extensionTestsPath=${workspaceFolder}/out/test/suite/index" - ], - "outFiles": [ - "${workspaceFolder}/out/test/**/*.js" - ], - "preLaunchTask": "${defaultBuildTask}" - } - ] + "version": "0.2.0", + "configurations": [ + { + "name": "Run Extension", + "type": "extensionHost", + "request": "launch", + "args": [ + "--extensionDevelopmentPath=${workspaceFolder}" + ], + "outFiles": [ + "${workspaceFolder}/out/**/*.js" + ], + "preLaunchTask": "npm: compile" + }, + { + "name": "Extension Tests", + "type": "extensionHost", + "request": "launch", + "args": [ + "--extensionDevelopmentPath=${workspaceFolder}", + "--extensionTestsPath=${workspaceFolder}/out/test/suite/index" + ], + "outFiles": [ + "${workspaceFolder}/out/test/**/*.js" + ], + "preLaunchTask": "npm: pretest" + } + ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index ec20fef..1f913b6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,12 +1,5 @@ -// Place your settings in this file to overwrite default and user settings. { - "files.exclude": { - "out": false // set this to true to hide the "out" folder with the compiled JS files - }, - "search.exclude": { - "out": true // set this to false to include "out" folder in search results - }, - // Turn off tsc task auto detection since we have the necessary tasks as npm scripts - "typescript.tsc.autoDetect": "off", - "cSpell.words": ["mermaidchart"] -} \ No newline at end of file + "npm.packageManager": "pnpm", + "typescript.preferences.useAliasesForRenames": false, + "typescript.preferences.includePackageJsonAutoImports": "auto" +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 3b17e53..8633a6c 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,20 +1,32 @@ -// See https://go.microsoft.com/fwlink/?LinkId=733558 -// for the documentation about the tasks.json format { - "version": "2.0.0", - "tasks": [ - { - "type": "npm", - "script": "watch", - "problemMatcher": "$tsc-watch", - "isBackground": true, - "presentation": { - "reveal": "never" - }, - "group": { - "kind": "build", - "isDefault": true - } - } - ] -} + "version": "2.0.0", + "tasks": [ + { + "type": "npm", + "script": "compile", + "group": "build", + "presentation": { + "reveal": "silent" + }, + "problemMatcher": "$tsc" + }, + { + "type": "npm", + "script": "watch", + "problemMatcher": "$tsc-watch", + "isBackground": true, + "presentation": { + "reveal": "never" + }, + "group": { + "kind": "build", + "isDefault": true + } + }, + { + "type": "npm", + "script": "pretest", + "group": "test" + } + ] +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 76067ae..e8f05c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,16 +33,6 @@ New General Features - Dependency Update - Upgraded to latest Mermaid version `v11.4.1` - Added OAuth support for the MermaidChart. -- Added AI-powered diagramming capabilities -- Introduced AI chat participant with `@mermaid-chart` command -- Added smart diagram regeneration based on source file changes -- Added three specialized AI tools for improved Mermaid diagramming: - - **Syntax Documentation Tool**: Provides instant access to detailed diagram syntax guides - - **Diagram Validation Tool**: Ensures correct syntax before rendering diagrams - - **Diagram Preview Tool**: Streamlined visualization of Mermaid diagrams -- Enhanced **VS Code Agent Mode** with dedicated **Mermaid tools** for improved accuracy -- Improved AI chat participant capabilities with documentation-powered responses -- Better integration with GitHub Copilot Chat for more reliable diagram generation - Added support to render Mermaid diagrams directly in the VS Code Markdown preview, replacing the raw Mermaid code blocks - Added support for redux-color & redux-dark-color theme diff --git a/README.md b/README.md index b0690f5..60caac0 100644 --- a/README.md +++ b/README.md @@ -32,18 +32,6 @@ Currently supported diagrams and charts: - Packet - Radar -### Generate AI-powered diagrams directly from your code! -Transform your ideas and source code into clear, insightful diagrams with our new AI integration in VS Code.
-Just mention **@mermaid-chart** in any GitHub Copilot Chat and describe the diagram you want to create — even link specific source code files!
- Whether it's a class diagram, sequence diagram, entity relationship diagram, or more — the AI assistant will analyze the code, generate the appropriate Mermaid syntax, and instantly show a live preview.
-Let your code speak for itself — effortlessly. - -![Image illustrating accessible diagrams in explorer panel](https://docs.mermaidchart.com/img/plugins/ai-generate-diagram.gif) - -With Smart Diagram Regeneration, when your source code or requirements change, the extension can detect these changes and offer to update related diagrams with a single click. - -![Image illustrating accessible diagrams in explorer panel](https://docs.mermaidchart.com/img/plugins/vscode-plugin-update-diagram.gif) - ### Real-Time local Edit & Preview Now you get a side-by-side real time preview of the mermaid diagram while editing the diagram locally. This helps the user to see the true power of a mermaid's text-based diagram, where each change in text is reflected immediately on the diagram. @@ -150,6 +138,10 @@ This extension contributes the following settings: - `mermaid.vscode.light_theme`: Defines the theme used for Mermaid diagrams when VS Code is in light mode. ## Release Notes + +### 2.1.2 -2025-07-22 +- Bug fixes + ### 2.1.1 -2025-05-26 - Enhanced Sidebar Layout to Improve User Guidance @@ -182,15 +174,6 @@ New General Features - Dependency Update - Upgraded to latest Mermaid version `v11.4.1` - Added OAuth support for the MermaidChart. -- Added AI-powered diagramming capabilities -- Introduced AI chat participant with `@mermaid-chart` command -- Added smart diagram regeneration based on source file changes -- Added three specialized AI tools for improved Mermaid diagramming: - - **Syntax Documentation Tool**: Provides instant access to detailed diagram syntax guides - - **Diagram Validation Tool**: Ensures correct syntax before rendering diagrams - - **Diagram Preview Tool**: Streamlined visualization of Mermaid diagrams -- Enhanced **VS Code Agent Mode** with dedicated **Mermaid tools** for improved accuracy -- Improved AI chat participant capabilities with documentation-powered responses - Better integration with GitHub Copilot Chat for more reliable diagram generation - Added support to render Mermaid diagrams directly in the VS Code Markdown preview, replacing the raw Mermaid code blocks - Added support for redux-color & redux-dark-color theme diff --git a/package.json b/package.json index 6104515..bae5201 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "displayName": "Mermaid Preview", "description": "Mermaid diagram previewer for Visual Studio Code, now maintained by the creators of Mermaid.js", "license": "MIT", - "version": "2.1.1", + "version": "2.1.2", "publisher": "vstirbu", "bugs": { "url": "https://github.com/vstirbu/vscode-mermaid-preview/issues" @@ -611,7 +611,7 @@ "redux-dark-color", "dark" ], - "default": "redux-dark", + "default": "redux-dark-color", "description": "Default mermaid theme used for dark theme" }, "mermaid.vscode.light_theme": { @@ -627,7 +627,7 @@ "redux-color", "mc" ], - "default": "redux", + "default": "redux-color", "description": "Default mermaid theme used for light theme" }, "preview.mermaidChart.aiVendor": { @@ -770,220 +770,68 @@ { "command": "preview.mermaidChart.diagramHelp", "title": "Diagram help", - "category": "Mermaid Preview", - "when": "mermaidPreview:isActive" + "category": "Mermaid Preview" }, { "command": "preview.mermaidChart.insertUuidIntoEditor", "title": "Link Diagram", - "category": "Mermaid Preview", - "when": "mermaidPreview:isActive" + "category": "Mermaid Preview" }, { "command": "preview.mermaidChart.downloadDiagram", "title": "Download", - "category": "Mermaid Preview", - "when": "mermaidPreview:isActive" + "category": "Mermaid Preview" }, { "command": "preview.mermaidChart.syncDiagramWithMermaid", "title": "Sync Diagram", - "category": "Mermaid Preview", - "when": "mermaidPreview:isActive" + "category": "Mermaid Preview" }, { "command": "preview.mermaidChart.preview", "title": "Preview Diagram", - "category": "Mermaid Preview", - "when": "mermaidPreview:isActive" + "category": "Mermaid Preview" }, { "command": "preview.mermaidChart.logout", "title": "Logout", - "category": "Mermaid Preview", - "when": "mermaidPreview:isActive" + "category": "Mermaid Preview" }, { "command": "preview.mermaidChart.login", "title": "Login", - "category": "Mermaid Preview", - "when": "mermaidPreview:isActive" + "category": "Mermaid Preview" }, { "command": "preview.mermaidChart.createMermaidFile", "title": "Create Diagram", - "category": "Mermaid Preview", - "when": "mermaidPreview:isActive" + "category": "Mermaid Preview" }, { "command": "preview.mermaidChart.focus", "title": "Focus on View", "icon": "images/mermaid-icon.svg", - "category": "Mermaid Preview", - "when": "mermaidPreview:isActive" + "category": "Mermaid Preview" }, { "command": "preview.mermaidChart.refresh", "title": "Refresh", - "category": "Mermaid Preview", - "when": "mermaidPreview:isActive" + "category": "Mermaid Preview" }, { "command": "preview.mermaidChart.connectDiagramToMermaidChart", "title": "Connect Diagram", - "category": "Mermaid Preview", - "when": "mermaidPreview:isActive" + "category": "Mermaid Preview" }, { "command": "preview.mermaidChart.showCompletions", "title": "Trigger Mermaid Completions", - "category": "Mermaid Preview", - "when": "mermaidPreview:isActive" + "category": "Mermaid Preview" }, { "command": "preview.mermaidChart.openCopilotChat", "title": "Open AI Chat", - "category": "Mermaid Preview", - "when": "mermaidPreview:isActive" - } - ], - "chatParticipants": [ - { - "id": "mermaid-chart", - "fullName": "Mermaid Chart AI Chat", - "name": "mermaid-chart", - "description": "Official VS Code Extension for AI Chat", - "isSticky": true, - "when": "mermaidPreview:isActive" - } - ], - "languageModelTools": [ - { - "name": "get-syntax-docs-mermaid", - "tags": [ - "mermaid", - "documentation", - "get_syntax_docs", - "mermaid-docs", - "validation", - "syntax", - "errors", - "essential", - "mandatory" - ], - "toolReferenceName": "get_syntax_docs", - "displayName": "Get Syntax Documentation", - "modelDescription": "ALWAYS use this tool Before creating, editing, or working with any Mermaid diagram. Get the syntax documentation for a specific diagram type.\n\nAvailable diagram types:\n- `architecture.md`: Cloud/CI/CD Architecture Diagram\n- `block.md`: Block Diagram\n- `c4.md`: C4 Diagram\n- `classDiagram.md`: Class Diagram\n- `entityRelationshipDiagram.md`: Entity Relationship Diagram\n- `flowchart.md`: Flowchart\n- `gantt.md`: Gantt Chart\n- `gitgraph.md`: Git Graph Diagram\n- `kanban.md`: Kanban Diagram\n- `mindmap.md`: Mindmap\n- `packet.md`: Packet Diagram\n- `pie.md`: Pie Chart\n- `quadrantChart.md`: Quadrant Chart\n- `requirementDiagram.md`: Requirement Diagram\n- `sankey.md`: Sankey Diagram\n- `sequenceDiagram.md`: Sequence Diagram\n- `stateDiagram.md`: State Diagram\n- `timeline.md`: Timeline\n- `userJourney.md`: User Journey Diagram\n- `xyChart.md`: XY Chart", - "icon": "$(files)", - "canBeReferencedInPrompt": true, - "inputSchema": { - "type": "object", - "properties": { - "file": { - "type": "string", - "enum": [ - "architecture.md", - "block.md", - "c4.md", - "classDiagram.md", - "entityRelationshipDiagram.md", - "flowchart.md", - "gantt.md", - "gitgraph.md", - "kanban.md", - "mindmap.md", - "packet.md", - "pie.md", - "quadrantChart.md", - "requirementDiagram.md", - "sankey.md", - "sequenceDiagram.md", - "stateDiagram.md", - "timeline.md", - "userJourney.md", - "xyChart.md" - ], - "description": "The filename of the diagram type.\n\nAvailable diagram types:\n- `architecture.md`: Cloud/CI/CD Architecture Diagram\n- `block.md`: Block Diagram\n- `c4.md`: C4 Diagram\n- `classDiagram.md`: Class Diagram\n- `entityRelationshipDiagram.md`: Entity Relationship Diagram\n- `flowchart.md`: Flowchart\n- `gantt.md`: Gantt Chart\n- `gitgraph.md`: Git Graph Diagram\n- `kanban.md`: Kanban Diagram\n- `mindmap.md`: Mindmap\n- `packet.md`: Packet Diagram\n- `pie.md`: Pie Chart\n- `quadrantChart.md`: Quadrant Chart\n- `requirementDiagram.md`: Requirement Diagram\n- `sankey.md`: Sankey Diagram\n- `sequenceDiagram.md`: Sequence Diagram\n- `stateDiagram.md`: State Diagram\n- `timeline.md`: Timeline\n- `userJourney.md`: User Journey Diagram\n- `xyChart.md`: XY Chart" - } - }, - "required": [ - "file" - ] - } - }, - { - "name": "mermaid-diagram-validator", - "tags": [ - "editing", - "diagram", - "mermaid", - "before-preview", - "before-visualization", - "validation", - "syntax", - "errors", - "essential", - "mandatory", - "pre-check", - "check", - "verify", - "test", - "debug" - ], - "displayName": "Mermaid Diagram Validator", - "toolReferenceName": "mermaid-diagram-validator", - "canBeReferencedInPrompt": true, - "modelDescription": "Validate a Mermaid diagram. ALWAYS use this tool after when creating, editing, or working with any Mermaid diagram and before preview. The Mermaid Diagram Validator is an ESSENTIAL tool for ensuring the accuracy and correctness of Mermaid diagrams. It MUST be used IMMEDIATELY AFTER CREATING, EDITING, or WORKING WITH any Mermaid diagram or BEFORE PREVIEWING it. This tool is CRUCIAL for checking, verifying, testing, and debugging any Mermaid diagram code for syntax errors or formatting issues. It ensures that diagrams are correctly formatted and free of errors before they are rendered or visualized. This includes diagrams created from any source file, such as TypeScript, Java, or any other programming language. By using this tool, you can prevent errors and ensure that your diagrams are accurate and reliable. ALWAYS validate your diagrams to maintain high-quality visualizations and avoid potential issues during rendering.", - "icon": "$(check)", - "inputSchema": { - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "The complete Mermaid diagram code to validate, including any YAML frontmatter blocks if present. This code should be thoroughly checked for any syntax errors or formatting issues to ensure it is ready for rendering." - } - }, - "required": [ - "code" - ] - } - }, - { - "name": "mermaid-diagram-preview", - "tags": [ - "editing", - "diagram", - "mermaid", - "preview", - "visualization", - "essential", - "mandatory", - "show", - "view" - ], - "displayName": "Mermaid Diagram Preview", - "toolReferenceName": "mermaid-diagram-preview", - "canBeReferencedInPrompt": true, - "modelDescription": "Preview a Mermaid diagram. ALWAYS use this tool after validation when creating, editing, or working with any Mermaid diagram. The code paramter of this MUST CONTAIN ONLY the Mermaid code block without any surrounding or other content. IMPORTANT USAGE PATTERN: For EXISTING Mermaid diagram files, ALWAYS pass the documentUri parameter (NOT the code). Only use the code parameter for NEW diagrams that don't exist in files yet or when you've extracted ONLY the Mermaid code block from markdown. This tool renders and visualizes diagrams including flowcharts, sequence diagrams, class diagrams, ER diagrams, and other chart types. The diagram code should include any YAML frontmatter blocks (like id, title, config) if present.", - "icon": "$(eye)", - "inputSchema": { - "type": "object", - "properties": { - "documentUri": { - "type": "string", - "description": "PREFERRED: The URI of an existing document to preview. For existing files, ALWAYS use this parameter instead of extracting code from the file." - }, - "code": { - "type": "string", - "description": "The complete Mermaid diagram code to preview. This MUST BE ONLY the Mermaid code block syntax without any surrounding content. ONLY use this parameter for NEW diagrams" - }, - "showSource": { - "type": "boolean", - "description": "Whether to also open the source code in an editor", - "default": true - } - } - } + "category": "Mermaid Preview" } ] }, @@ -1037,7 +885,7 @@ "@vscode/prompt-tsx": "^0.3.0-alpha.12", "axios": "^1.7.9", "markdown-it": "^14.1.0", - "@mermaid-chart/mermaid": "11.6.0-b.12", + "@mermaid-chart/mermaid": "11.9.0-b.1", "@mermaid-js/examples": "0.0.1-beta.1", "uuid": "^9.0.0", "yaml": "^2.7.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9e7ae3a..080fc8d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -34,10 +34,10 @@ importers: version: 1.0.0 '@mermaid-chart/layout-elk': specifier: 0.1.7-b.2 - version: 0.1.7-b.2(@mermaid-chart/mermaid@11.6.0-b.12) + version: 0.1.7-b.2(@mermaid-chart/mermaid@11.9.0-b.1) '@mermaid-chart/mermaid': - specifier: 11.6.0-b.12 - version: 11.6.0-b.12 + specifier: 11.9.0-b.1 + version: 11.9.0-b.1 '@mermaid-chart/vscode-utils': specifier: 1.0.7 version: 1.0.7(vscode@1.1.37) @@ -122,7 +122,7 @@ importers: version: 10.8.2 ts-loader: specifier: ^9.5.2 - version: 9.5.2(typescript@4.9.5)(webpack@5.99.7) + version: 9.5.2(typescript@4.9.5)(webpack@5.99.7(esbuild@0.18.20)(webpack-cli@6.0.1)) typescript: specifier: ^4.9.5 version: 4.9.5 @@ -158,10 +158,10 @@ importers: version: 1.0.0 '@mermaid-chart/layout-elk': specifier: 0.1.7-b.2 - version: 0.1.7-b.2(@mermaid-chart/mermaid@11.6.0-b.12) + version: 0.1.7-b.2(@mermaid-chart/mermaid@11.9.0-b.1) '@mermaid-chart/mermaid': - specifier: 11.6.0-b.12 - version: 11.6.0-b.12 + specifier: 11.9.0-b.1 + version: 11.9.0-b.1 '@panzoom/panzoom': specifier: ^4.5.1 version: 4.6.0 @@ -648,8 +648,8 @@ packages: peerDependencies: '@mermaid-chart/mermaid': ^11.0.0 - '@mermaid-chart/mermaid@11.6.0-b.12': - resolution: {integrity: sha512-ASTD2nDK3yvHJcKyfTCWzHsnja8eK8L1rEdtPh8xvs8Rkej+Qjfi+jFxqKPW50iPHrE2XlzHtRyjl42YOBUNtg==, tarball: https://npm.pkg.github.com/download/@mermaid-chart/mermaid/11.6.0-b.12/4b6f5ccc0fa82ea92ddeee86e57c444bb8046c3b} + '@mermaid-chart/mermaid@11.9.0-b.1': + resolution: {integrity: sha512-sW8lyVE9MNh+p6MyfunZ12v+DNbyPQUE+f18P4gccIw7DBnH3Zq6XRKAmxIDspidyDfVb8myeYKPVs6Pk7VzaQ==, tarball: https://npm.pkg.github.com/download/@mermaid-chart/mermaid/11.9.0-b.1/41725150a1eaf9acb0e7d33310d4ec7750a2466b} '@mermaid-chart/vscode-utils@1.0.7': resolution: {integrity: sha512-GzZpAIs7oQ7iNlsYf/U0mFf8hSvKXPFl4Q9UxPFAS0b2ei7qkBSGx3T6DRsNrn/iLADufngrK79xJ4pVOMdQFA==, tarball: https://npm.pkg.github.com/download/@mermaid-chart/vscode-utils/1.0.7/dd00f1a3be02c4381beaa921b2ea440248c952de} @@ -660,8 +660,8 @@ packages: '@mermaid-js/examples@0.0.1-beta.1': resolution: {integrity: sha512-dJ8yhCOf9Xh7T6VJzAATtxfhjT+8ywxFWYVuEE8ffu3P5v6iuoP+T27LLJN5aAIgmsLo/wFshlRqZFz3s8OolA==} - '@mermaid-js/parser@0.4.0': - resolution: {integrity: sha512-wla8XOWvQAwuqy+gxiZqY+c7FokraOTHRWMsbB4AgRx9Sy7zKslNyejy7E+a77qHfey5GXw/ik3IXv/NHMJgaA==} + '@mermaid-js/parser@0.6.2': + resolution: {integrity: sha512-+PO02uGF6L6Cs0Bw8RpGhikVvMWEysfAyl27qTlroUB8jSWr1lL0Sf6zi78ZxlSnmgSY2AMMKVgghnN9jTtwkQ==} '@mermaidchart/sdk@0.2.1': resolution: {integrity: sha512-TnYemSeT01qAwHyqx11hbzouEMpP3AfRJe3LcR2YwqpMP1hUz2rfyfsUCXvGAf5ZQJbESjIZ2nEas3gwn6OviQ==} @@ -2528,9 +2528,9 @@ packages: resolution: {integrity: sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==} hasBin: true - marked@15.0.11: - resolution: {integrity: sha512-1BEXAU2euRCG3xwgLVT1y0xbJEld1XOrmRJpUwRCcy7rxhSCwMrmEu9LXoPhHSCJG41V7YcQ2mjKRr5BA3ITIA==} - engines: {node: '>= 18'} + marked@16.1.1: + resolution: {integrity: sha512-ij/2lXfCRT71L6u0M29tJPhP0bM5shLL3u5BePhFwPELj2blMJ6GDtD7PfJhRLhJ/c2UwrK17ySVcDzy2YHjHQ==} + engines: {node: '>= 20'} hasBin: true math-intrinsics@1.1.0: @@ -3840,17 +3840,17 @@ snapshots: dependencies: '@iconify/types': 2.0.0 - '@mermaid-chart/layout-elk@0.1.7-b.2(@mermaid-chart/mermaid@11.6.0-b.12)': + '@mermaid-chart/layout-elk@0.1.7-b.2(@mermaid-chart/mermaid@11.9.0-b.1)': dependencies: - '@mermaid-chart/mermaid': 11.6.0-b.12 + '@mermaid-chart/mermaid': 11.9.0-b.1 d3: 7.9.0 elkjs: 0.9.3 - '@mermaid-chart/mermaid@11.6.0-b.12': + '@mermaid-chart/mermaid@11.9.0-b.1': dependencies: '@braintree/sanitize-url': 7.1.1 '@iconify/utils': 2.3.0 - '@mermaid-js/parser': 0.4.0 + '@mermaid-js/parser': 0.6.2 '@types/d3': 7.4.3 cytoscape: 3.31.2 cytoscape-cose-bilkent: 4.1.0(cytoscape@3.31.2) @@ -3863,7 +3863,7 @@ snapshots: katex: 0.16.22 khroma: 2.1.0 lodash-es: 4.17.21 - marked: 15.0.11 + marked: 16.1.1 roughjs: 4.6.6 stylis: 4.3.6 ts-dedent: 2.2.0 @@ -3884,7 +3884,7 @@ snapshots: '@mermaid-js/examples@0.0.1-beta.1': {} - '@mermaid-js/parser@0.4.0': + '@mermaid-js/parser@0.6.2': dependencies: langium: 3.3.1 @@ -4482,17 +4482,17 @@ snapshots: '@webassemblyjs/ast': 1.14.1 '@xtuc/long': 4.2.2 - '@webpack-cli/configtest@3.0.1(webpack-cli@6.0.1)(webpack@5.99.7)': + '@webpack-cli/configtest@3.0.1(webpack-cli@6.0.1(webpack@5.99.7))(webpack@5.99.7(esbuild@0.18.20)(webpack-cli@6.0.1))': dependencies: webpack: 5.99.7(esbuild@0.18.20)(webpack-cli@6.0.1) webpack-cli: 6.0.1(webpack@5.99.7) - '@webpack-cli/info@3.0.1(webpack-cli@6.0.1)(webpack@5.99.7)': + '@webpack-cli/info@3.0.1(webpack-cli@6.0.1(webpack@5.99.7))(webpack@5.99.7(esbuild@0.18.20)(webpack-cli@6.0.1))': dependencies: webpack: 5.99.7(esbuild@0.18.20)(webpack-cli@6.0.1) webpack-cli: 6.0.1(webpack@5.99.7) - '@webpack-cli/serve@3.0.1(webpack-cli@6.0.1)(webpack@5.99.7)': + '@webpack-cli/serve@3.0.1(webpack-cli@6.0.1(webpack@5.99.7))(webpack@5.99.7(esbuild@0.18.20)(webpack-cli@6.0.1))': dependencies: webpack: 5.99.7(esbuild@0.18.20)(webpack-cli@6.0.1) webpack-cli: 6.0.1(webpack@5.99.7) @@ -5906,7 +5906,7 @@ snapshots: punycode.js: 2.3.1 uc.micro: 2.1.0 - marked@15.0.11: {} + marked@16.1.1: {} math-intrinsics@1.1.0: {} @@ -6616,7 +6616,7 @@ snapshots: fast-fifo: 1.3.2 streamx: 2.22.0 - terser-webpack-plugin@5.3.14(esbuild@0.18.20)(webpack@5.99.7): + terser-webpack-plugin@5.3.14(esbuild@0.18.20)(webpack@5.99.7(esbuild@0.18.20)(webpack-cli@6.0.1)): dependencies: '@jridgewell/trace-mapping': 0.3.25 jest-worker: 27.5.1 @@ -6657,7 +6657,7 @@ snapshots: ts-dedent@2.2.0: {} - ts-loader@9.5.2(typescript@4.9.5)(webpack@5.99.7): + ts-loader@9.5.2(typescript@4.9.5)(webpack@5.99.7(esbuild@0.18.20)(webpack-cli@6.0.1)): dependencies: chalk: 4.1.2 enhanced-resolve: 5.18.1 @@ -6798,9 +6798,9 @@ snapshots: webpack-cli@6.0.1(webpack@5.99.7): dependencies: '@discoveryjs/json-ext': 0.6.3 - '@webpack-cli/configtest': 3.0.1(webpack-cli@6.0.1)(webpack@5.99.7) - '@webpack-cli/info': 3.0.1(webpack-cli@6.0.1)(webpack@5.99.7) - '@webpack-cli/serve': 3.0.1(webpack-cli@6.0.1)(webpack@5.99.7) + '@webpack-cli/configtest': 3.0.1(webpack-cli@6.0.1(webpack@5.99.7))(webpack@5.99.7(esbuild@0.18.20)(webpack-cli@6.0.1)) + '@webpack-cli/info': 3.0.1(webpack-cli@6.0.1(webpack@5.99.7))(webpack@5.99.7(esbuild@0.18.20)(webpack-cli@6.0.1)) + '@webpack-cli/serve': 3.0.1(webpack-cli@6.0.1(webpack@5.99.7))(webpack@5.99.7(esbuild@0.18.20)(webpack-cli@6.0.1)) colorette: 2.0.20 commander: 12.1.0 cross-spawn: 7.0.6 @@ -6843,7 +6843,7 @@ snapshots: neo-async: 2.6.2 schema-utils: 4.3.2 tapable: 2.2.1 - terser-webpack-plugin: 5.3.14(esbuild@0.18.20)(webpack@5.99.7) + terser-webpack-plugin: 5.3.14(esbuild@0.18.20)(webpack@5.99.7(esbuild@0.18.20)(webpack-cli@6.0.1)) watchpack: 2.4.2 webpack-sources: 3.2.3 optionalDependencies: diff --git a/src/commercial/ai/chatParticipant.ts b/src/commercial/ai/chatParticipant.ts index 1e63949..02a90cc 100644 --- a/src/commercial/ai/chatParticipant.ts +++ b/src/commercial/ai/chatParticipant.ts @@ -1,8 +1,8 @@ import { aiHandler } from "@mermaid-chart/vscode-utils"; import * as vscode from "vscode"; -export function initializeAIChatParticipant(context: vscode.ExtensionContext): vscode.ChatParticipant { - const tutor = vscode.chat.createChatParticipant("mermaid-chart", aiHandler); - tutor.iconPath = vscode.Uri.joinPath(context.extensionUri, "images", "mermaid-icon.svg"); - return tutor; -} \ No newline at end of file +// export function initializeAIChatParticipant(context: vscode.ExtensionContext): vscode.ChatParticipant { +// const tutor = vscode.chat.createChatParticipant("mermaid-chart", aiHandler); +// tutor.iconPath = vscode.Uri.joinPath(context.extensionUri, "images", "mermaid-icon.svg"); +// return tutor; +// } \ No newline at end of file diff --git a/src/extension.ts b/src/extension.ts index cbac11d..61c70bc 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -34,7 +34,7 @@ import { MermaidWebviewProvider } from "./panels/loginPanel"; import analytics from "./analytics"; import { RemoteSyncHandler } from "./remoteSyncHandler"; import { registerRegenerateCommand } from './commercial/sync/regenerateCommand'; -import { initializeAIChatParticipant } from "./commercial/ai/chatParticipant"; +// import { initializeAIChatParticipant } from "./commercial/ai/chatParticipant"; import { setPreviewBridge, registerTools, setValidationBridge,initializePlugin } from '@mermaid-chart/vscode-utils'; import { PreviewBridgeImpl } from "./commercial/ai/tools/previewTool"; import { ValidationBridgeImpl } from "./commercial/ai/tools/validationTool"; @@ -53,7 +53,7 @@ export async function activate(context: vscode.ExtensionContext) { initializePlugin(pluginID); if (!(await checkForOfficialExtension(context))) { - return; + // return; } // Listen for extension changes (install/uninstall) while VS Code is running context.subscriptions.push( @@ -65,16 +65,16 @@ export async function activate(context: vscode.ExtensionContext) { analytics.trackActivation(); - // Register AI tools first to ensure they're available - console.log("[MermaidExtension] Registering AI tools..."); - registerTools(context); + // // Register AI tools first to ensure they're available + // console.log("[MermaidExtension] Registering AI tools..."); + // registerTools(context); - // Initialize the bridge for commercial tools - setPreviewBridge(new PreviewBridgeImpl()); - setValidationBridge(new ValidationBridgeImpl()); + // // Initialize the bridge for commercial tools + // setPreviewBridge(new PreviewBridgeImpl()); + // setValidationBridge(new ValidationBridgeImpl()); // Initialize AI chat participant after tools are registered - initializeAIChatParticipant(context); + // initializeAIChatParticipant(context); const mermaidWebviewProvider = new MermaidWebviewProvider(context); diff --git a/webview/package.json b/webview/package.json index 24380ab..a0d34c2 100644 --- a/webview/package.json +++ b/webview/package.json @@ -23,7 +23,7 @@ "@mermaid-chart/icons-azure": "^1.0.0", "@mermaid-chart/icons-gcp": "^1.0.0", "@mermaid-chart/layout-elk": "0.1.7-b.2", - "@mermaid-chart/mermaid": "11.6.0-b.12", + "@mermaid-chart/mermaid": "11.9.0-b.1", "@panzoom/panzoom": "^4.5.1", "js-base64": "^3.7.5", "vscode": "^1.1.37" From c46471697cdde2abfbddf142df7ca4ef1966ef0f Mon Sep 17 00:00:00 2001 From: Prashant-7718 Date: Tue, 22 Jul 2025 19:54:33 +0530 Subject: [PATCH 2/2] bug fix --- package.json | 6 +++++- src/services/filenameService.ts | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index bae5201..3c005ea 100644 --- a/package.json +++ b/package.json @@ -674,8 +674,12 @@ "type": "number", "default": 1000, "description": "Maximum number of edges allowed in a diagram's source" + }, + "mermaid.vscode.ai_Export_Name": { + "type": "boolean", + "default": "false", + "description": "Automatic name suggestion for exported diagrams" } - } }, "viewsContainers": { diff --git a/src/services/filenameService.ts b/src/services/filenameService.ts index 11e1c3c..0978c79 100644 --- a/src/services/filenameService.ts +++ b/src/services/filenameService.ts @@ -76,7 +76,9 @@ export function getDefaultSaveUri(document: vscode.TextDocument, extension: stri // Get either AI-suggested name or default name let baseName = ''; - if (diagramCode) { + const aiExportEnabled = vscode.workspace.getConfiguration('mermaid.vscode').get('ai_Export_Name'); + // check for diagramCode and AI export setting - if true suggest name to a file using the AI + if (diagramCode && aiExportEnabled) { try { const aiSuggestedName = await generateDiagramFilenameWithAI(diagramCode); console.log('AI suggested name:', aiSuggestedName); // Debug log