{
    "name": "keil-assistant-new",
    "displayName": "Keil Assistant Community Fork",
    "description": "A community-maintained fork of the original Keil Assistant for VS Code",
    "version": "2.5.2",
    "publisher": "candycium",
    "author": {
        "name": "Rui Wang"
    },
    "keywords": [
        "keil",
        "mdk",
        "c51",
        "8051",
        "stm32",
        "arm"
    ],
    "homepage": "https://github.com/ruiwarn/keil-assistant",
    "engines": {
        "vscode": "^1.85.0"
    },
    "categories": [
        "Programming Languages",
        "Snippets",
        "Other"
    ],
    "activationEvents": [
        "onView:project",
        "onCommand:explorer.open",
        "workspaceContains:**/*.uvproj",
        "workspaceContains:**/*.uvprojx",
        "onLanguageModelTool:build_keil_project",
        "onLanguageModelTool:get_keil_project_info"
    ],
    "icon": "res/icons/icon.png",
    "main": "./dist/extension.js",
    "repository": {
        "type": "git",
        "url": "https://github.com/ruiwarn/keil-assistant"
    },
    "bugs": {
        "url": "https://github.com/ruiwarn/keil-assistant/issues"
    },
    "contributes": {
        "configuration": [
            {
                "title": "Keil Assistant Community Fork",
                "properties": {
                    "KeilAssistant.C51.Uv4Path": {
                        "type": "string",
                        "scope": "machine",
                        "markdownDescription": "C51 UV4.exe 的绝对路径。例如：`C:\\Keil_v5\\UV4\\UV4.exe`\n\n请确保设置正确的路径，否则插件将无法正常工作。",
                        "default": ""
                    },
                    "KeilAssistant.MDK.Uv4Path": {
                        "type": "string",
                        "scope": "machine",
                        "markdownDescription": "MDK UV4.exe 的绝对路径。例如：`C:\\Keil_v5\\UV4\\UV4.exe`\n\n请确保设置正确的路径，否则插件将无法正常工作。",
                        "default": ""
                    },
                    "KeilAssistant.Project.ExcludeList": {
                        "type": "array",
                        "scope": "resource",
                        "markdownDescription": "uVision project file name exclude list",
                        "default": [
                            "template.uvproj",
                            "template.uvprojx"
                        ]
                    },
                    "KeilAssistant.Project.FileLocationList": {
                        "type": "array",
                        "scope": "resource",
                        "markdownDescription": "uVision project file locations",
                        "default": []
                    },
                    "KeilAssistant.ProjectExplorer.RememberExpandedState": {
                        "type": "boolean",
                        "scope": "window",
                        "markdownDescription": "Remember expanded Keil project tree nodes between refreshes and reloads.",
                        "default": false
                    },
                    "KeilAssistant.ProjectExplorer.SortOrder": {
                        "type": "string",
                        "scope": "window",
                        "markdownDescription": "Sort order for root Keil projects in the explorer.",
                        "enum": [
                            "legacy",
                            "name",
                            "path"
                        ],
                        "default": "legacy"
                    },
                    "KeilAssistant.ProjectExplorer.AutoRevealCurrentFile": {
                        "type": "boolean",
                        "scope": "window",
                        "markdownDescription": "Automatically reveal the current file in the Keil project tree when possible.",
                        "default": false
                    }
                }
            }
        ],
        "commands": [
            {
                "command": "explorer.open",
                "title": "Open keil uVision project",
                "icon": {
                    "light": "./res/icons/ClassAdded_16x.svg",
                    "dark": "./res/icons/ClassAdded_16x.svg"
                }
            },
            {
                "command": "project.switch",
                "title": "Switch Target",
                "icon": {
                    "light": "./res/icons/SwitchSourceOrTarget_16x.svg",
                    "dark": "./res/icons/SwitchSourceOrTarget_16x.svg"
                }
            },
            {
                "command": "project.active",
                "title": "Active Project"
            },
            {
                "command": "project.close",
                "title": "Close Project",
                "icon": {
                    "light": "./res/icons/StatusOffline_16x.svg",
                    "dark": "./res/icons/StatusOffline_16x.svg"
                }
            },
            {
                "command": "project.build",
                "title": "Build",
                "icon": {
                    "light": "./res/icons/BuildSelection_16x.svg",
                    "dark": "./res/icons/BuildSelection_16x.svg"
                }
            },
            {
                "command": "project.rebuild",
                "title": "Rebuild",
                "icon": {
                    "light": "./res/icons/BuildSolution_16x.svg",
                    "dark": "./res/icons/BuildSolution_16x.svg"
                }
            },
            {
                "command": "project.download",
                "title": "Download To Device",
                "icon": {
                    "light": "./res/icons/TransferDownload_16x.svg",
                    "dark": "./res/icons/TransferDownload_16x.svg"
                }
            },
            {
                "command": "item.copyValue",
                "title": "Copy Item Value",
                "icon": {
                    "light": "./res/icons/CopyToClipboard_16x.svg",
                    "dark": "./res/icons/CopyToClipboard_16x.svg"
                }
            },
            {
                "command": "project.refresh",
                "title": "Refresh Keil Project",
                "icon": {
                    "light": "./res/icons/refresh-light.svg",
                    "dark": "./res/icons/refresh-dark.svg"
                }
            },
            {
                "command": "project.clearCacheAndRefresh",
                "title": "Clear Project Cache And Refresh"
            },
            {
                "command": "project.revealCurrentFile",
                "title": "Reveal Current File In Keil Project",
                "icon": {
                    "light": "./res/icons/ActiveApplication_16x.svg",
                    "dark": "./res/icons/ActiveApplication_16x.svg"
                }
            }
        ],
        "menus": {
            "view/title": [
                {
                    "command": "explorer.open",
                    "group": "navigation",
                    "when": "view == project"
                },
                {
                    "command": "project.refresh",
                    "group": "navigation@1",
                    "when": "view == project"
                },
                {
                    "command": "project.revealCurrentFile",
                    "group": "navigation@2",
                    "when": "view == project"
                }
            ],
            "view/item/context": [
                {
                    "command": "project.close",
                    "when": "viewItem == Project"
                },
                {
                    "command": "project.active",
                    "when": "viewItem == Project"
                },
                {
                    "command": "project.refresh",
                    "group": "navigation",
                    "when": "viewItem == Project"
                },
                {
                    "command": "project.clearCacheAndRefresh",
                    "group": "navigation",
                    "when": "viewItem == Project"
                },
                {
                    "command": "project.revealCurrentFile",
                    "group": "navigation",
                    "when": "viewItem == Project"
                },
                {
                    "command": "project.switch",
                    "group": "inline",
                    "when": "viewItem == Project"
                },
                {
                    "command": "project.build",
                    "group": "inline",
                    "when": "viewItem == Target"
                },
                {
                    "command": "project.rebuild",
                    "group": "inline",
                    "when": "viewItem == Target"
                },
                {
                    "command": "project.download",
                    "group": "inline",
                    "when": "viewItem == Target"
                },
                {
                    "command": "item.copyValue",
                    "group": "inline",
                    "when": "viewItem == Source"
                }
            ]
        },
        "keybindings": [
            {
                "command": "project.build",
                "key": "f7"
            },
            {
                "command": "project.rebuild",
                "key": "ctrl+alt+f7"
            },
            {
                "command": "project.download",
                "key": "ctrl+alt+d"
            }
        ],
        "languageModelTools": [
            {
                "name": "build_keil_project",
                "displayName": "Build Keil Project",
                "modelDescription": "Build or rebuild a Keil project target. Returns compilation results including errors and warnings with file paths, line numbers, and error codes. Use this tool when: 1) User asks to compile/build/rebuild a Keil project or embedded firmware, 2) User mentions 'build the project' or 'compile the code', 3) User wants to check for compilation errors, 4) User asks to verify if the code compiles successfully.",
                "userDescription": "Build or rebuild a Keil uVision project target",
                "icon": "$(tools)",
                "tags": ["build", "compile", "keil", "embedded", "firmware"],
                "toolReferenceName": "buildKeilProject",
                "canBeReferencedInPrompt": true,
                "inputSchema": {
                    "type": "object",
                    "properties": {
                        "target": {
                            "type": "string",
                            "description": "The name of the specific target configuration to build (e.g., 'Debug', 'Release'). If omitted, the currently active target will be built."
                        },
                        "rebuild": {
                            "type": "boolean",
                            "description": "Set to true to perform a clean rebuild (recompile all files), or false for incremental build (compile only changed files). Default: false.",
                            "default": false
                        }
                    }
                }
            },
            {
                "name": "get_keil_project_info",
                "displayName": "Get Keil Project Info",
                "modelDescription": "Get detailed information about the current Keil project including project name, type (C51/C251/ARM), active target, all available targets, and source file list. Use this tool when: 1) User asks 'what is the current project', 'show project info', or 'list project files', 2) User wants to know available build targets, 3) User asks about project configuration or structure, 4) You need to understand the project context before building or making changes, 5) User asks about the project type (C51/ARM/C251).",
                "userDescription": "Get information about the current Keil uVision project",
                "icon": "$(info)",
                "tags": ["info", "project", "keil", "structure", "configuration"],
                "toolReferenceName": "getKeilProjectInfo",
                "canBeReferencedInPrompt": true,
                "inputSchema": {
                    "type": "object",
                    "properties": {},
                    "description": "No parameters required. Returns information about the currently active Keil project in the workspace."
                }
            }
        ],
        "snippets": [
            {
                "language": "a51",
                "path": "./syntaxes/a51.snippets.json"
            }
        ],
        "languages": [
            {
                "id": "a51",
                "aliases": [
                    "A51",
                    "8051 Assembly"
                ],
                "extensions": [
                    ".a51",
                    ".A51"
                ],
                "filenamePatterns": [
                    "**/*.a51",
                    "**/*.A51"
                ],
                "configuration": "./syntaxes/a51.language-configuration.json"
            }
        ],
        "grammars": [
            {
                "language": "a51",
                "scopeName": "source.asm.a51",
                "path": "./syntaxes/a51.tmLanguage.json"
            }
        ],
        "views": {
            "explorer": [
                {
                    "id": "project",
                    "name": "Keil uVision Project"
                }
            ]
        },
        "taskDefinitions": [
            {
                "type": "keil-task"
            }
        ],
        "problemMatchers": [
            {
                "name": "c51",
                "fileLocation": "autoDetect",
                "pattern": [
                    {
                        "regexp": "^([^\\(]+)\\(([\\d]+)\\):\\s+(error|warning):\\s+(#\\d+):\\s+(.+)$",
                        "file": 1,
                        "location": 2,
                        "severity": 3,
                        "code": 4,
                        "message": 5
                    }
                ]
            },
            {
                "name": "armcc",
                "fileLocation": "autoDetect",
                "pattern": [
                    {
                        "regexp": "^([^\\(]+)\\(([\\d]+)\\):\\s+(error|warning):\\s+#([\\d\\w-]+):\\s+(.+)$",
                        "file": 1,
                        "location": 2,
                        "severity": 3,
                        "code": 4,
                        "message": 5
                    }
                ]
            },
            {
                "name": "gcc",
                "fileLocation": "autoDetect",
                "pattern": [
                    {
                        "regexp": "^(.+):(\\d+):(\\d+):\\s+(\\w+):\\s+(.*)$",
                        "file": 1,
                        "line": 2,
                        "column": 3,
                        "severity": 4,
                        "message": 5
                    }
                ]
            }
        ]
    },
    "scripts": {
        "vscode:prepublish": "npm run compile && webpack --mode production",
        "compile": "npx tsc -p ./",
        "watch": "npx tsc -watch -p ./",
        "webpack": "npx webpack --mode development",
        "webpack:watch": "npx webpack --mode development --watch",
        "lint": "npx eslint src --ext .ts",
        "pretest": "npm run lint && npm run compile",
        "test": "node ./scripts/run-mocha.js"
    },
    "devDependencies": {
        "@types/glob": "^7.1.1",
        "@types/mocha": "^10.0.1",
        "@types/node": "^18.19.86",
        "@types/vscode": "^1.85.0",
        "@types/xml2js": "^0.4.14",
        "@typescript-eslint/eslint-plugin": "^5.54.0",
        "@typescript-eslint/parser": "^5.54.0",
        "eslint": "^8.35.0",
        "glob": "^7.1.5",
        "mocha": "^10.2.0",
        "ts-loader": "^9.4.2",
        "typescript": "^4.9.5",
        "vscode-test": "^1.6.1",
        "webpack": "^5.75.0",
        "webpack-cli": "^5.0.1"
    },
    "dependencies": {
        "xml2js": "^0.6.2"
    }
}
