Feat/extension - #1534
Conversation
📋 Review SummaryThis PR introduces a significant extension system that enables modular functionality, custom skills, subagents, and settings. It also migrates command formats from TOML to Markdown and adds support for third-party extensions from Gemini and Claude marketplaces. The changes are extensive and touch many parts of the codebase, requiring careful consideration of security, performance, and maintainability implications. 🔍 General Feedback
🎯 Specific Feedback🔴 Critical
🟡 High
🟢 Medium
🔵 Low
✅ Highlights
|
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
tanzhenxin
left a comment
There was a problem hiding this comment.
Fantastic work—can’t wait to try this out! 🚀
Feat/extension
TLDR
This pull request refactors the extension module, using a runtime ExtensionManager instance to manage extensions/plugins within the application. It adds supported operators under the
/extensionslash command, enabling hot-reloading of extensions at runtime. Details:This pull request also adds extensible features, including:
To standardize the format, this pull request also modifies the default format for custom commands, changing it from a .toml file to a .md file. Detail:
extensions newcommand has been modified.Finally, this pull request also adds support for compatibility with plugins/extensions from Gemini Extensions and the Claude marketplace. Detials:
Dive Deeper
Architecture Refactoring
This PR introduces a significant architectural change by moving extension management from
clipackage tocorepackage. The newExtensionManagerclass (packages/core/src/extension/extensionManager.ts) serves as a centralized runtime manager with the following responsibilities:Key Components
ExtensionManagercore/src/extension/extensionManager.tsExtensionStoragecore/src/extension/storage.tsextensionsCommand.tscli/src/ui/commands/gemini-converter.tscore/src/extension/claude-converter.tscore/src/extension/markdown-command-parser.tscli/src/services/command-migration-tool.tscli/src/services/Extension Configuration Schema
Extensions can now include:
{ "name": "extension-name", "version": "1.0.0", "mcpServers": {}, "contextFileName": ["QWEN.md"], "excludeTools": [], "commands": "commands", "skills": "skills", "agents": "agents", "settings": [ { "name": "API Key", "description": "Your API key", "envVar": "MY_API_KEY", "sensitive": true } ] }Marketplace Compatibility
The PR implements converters for:
gemini-extension.jsontoqwen-extension.jsonand migrates TOML commands to Markdownmarketplace-url:plugin-name), downloads from GitHub releases, and converts agent/skill configurationsCommand Format Migration
The migration from TOML to Markdown improves readability:
TOML (deprecated):
Markdown (new):
Reviewer Test Plan
Commands Format
Add
hello.mdto.qwen/commandsto test if the command works.Add
hello.tomlto both theuserandprojectlevels. Start the application to test if it automatically detects and prompts for migration.Select automatic migration. After migration, the command format is correct and it works normally; the application should no longer prompt for migration upon restarting, and a
.toml.backupbackup file should exist in the corresponding folder.new commands extension get a .md file
extensions commands
Test
npx extensions list- should display all installed extensions with their status (✓/✗)Test
npx extensions install <source>:npx extensions install /path/to/local-extensionnpx extensions install https://github.com/user/extension.gitnpx extensions install https://github.com/user/extension.git --ref v1.0.0npx extensions install https://github.com/user/extension.git --auto-updateTest
npx extensions uninstall <name>- should remove extension and its enablement configTest
npx extensions enable <name> --scope user|workspaceTest
npx extensions disable <name> --scope user|workspaceTest
npx extensions update <name>andnpx extensions update --allTest
npx extensions link /path/to/dev-extension- for development useTest
npx extensions settings list <name>- for setting listTest
npx extensions settings set [--scope] <name> <setting>- for setting configTest
npx extensions settings new <path> [template]- for create extension with template or default config jsonextension slash commands
Test
/extensionsor/extensions list- should show extension list in UITest
/extensions install <source>:Test
/extensions uninstall <name>:Test
/extensions enable <name> --scope user|workspace:Test
/extensions disable <name> --scope user|workspace:Test
/extensions update --all:install Gemini/Claude extensions
Install a Gemini extension directly from git:
gemini-extension.jsonand convert toqwen-extension.jsonInstall a Claude plugin from marketplace:
Verify converted extensions:
extensible features
Custom Skills:
skills/directory containing skill .md files/skillcommand listCustom Subagents:
agents/directory containing agent .yaml filesCustom Settings:
settingsarray in config.qwen/extensions/<id>/.envCustom Commands:
commands/directoryextension-name:command-nameformatHot-Reload:
SDK Mode Testing
The use of extensions in the SDK requires further discussion:
Should the SDK's functionality be affected by the environment? Currently, the configurations in commands, MCP servers, and settings.json affect the SDK's performance, while agents and skills do not use environment file parsing.
Is it necessary to quickly import extension interfaces into the SDK, i.e., configure commands, MCP, skills, agents, etc., all at once?
ACP Integration Testing
Testing Matrix
Linked issues / bugs
Fixes #1420