feat: enable plugins feature and add Antigravity support - #9882
Merged
Merged
Conversation
- Updated appSpecs to enable plugins feature. - Modified localization files to include Antigravity in the plugins help text for multiple languages. - Enhanced plugin management API to support Antigravity plugins, including installation, enabling, and updating. - Added tests for managing Antigravity plugins, ensuring proper handling of catalog IDs and installation processes. - Introduced marketplace fixtures for Antigravity plugins to facilitate testing.
Owner
|
感谢 @funkpopo!Antigravity 的插件管理做得很完整:只调 |
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human Note / 本人说明
为 Antigravity CLI 增加插件管理功能支持
Summary / 概述
为 CC Switch 的「插件」页面新增 Antigravity CLI(
agy)的插件管理支持,延续现有插件页直接调用各应用官方 CLI 的设计方案,不手改~/.gemini/config/config.json。主要改动
src-tauri/src/services/plugin_manager/agy.rs,基于agy 1.5.14实测实现 Antigravity 插件管理:agy plugin list --json,从安装目录的plugin.json(兼容.antigravity-plugin/.gemini-plugin/.claude-plugin及 JSONC 注释与尾随逗号)补读displayName、description、category;自动过滤本地/导入来源标签(antigravity/claude/gemini),兼容旧版数字目录名并通过catalog_id与目录对齐,识别/builtin/plugins/内置只开关插件。agy无--available列表与自定义市场管理命令,通过 CC Switch 全局代理并发拉取 Antigravity 官方(antigravity-plugins-official)与合作伙伴(antigravity-plugins-partners)的marketplace.json,将目录条目的id映射为<name>@<marketplace>、installed_id设为安装目录名<name>。<name>@<marketplace>调agy plugin install;启停与卸载按目录名调agy plugin enable|disable|uninstall(避免传name@marketplace导致disable失败或uninstall空转);市场来源插件的更新复用agy plugin install <name>@<marketplace>(保留config.json中原有停用状态与其他字段,并通过前后版本比对判断是否有变更),本地/导入插件直接视为已是最新。name@marketplace)与已安装操作参数(目录名或旧版带负号数字目录,拒绝 CLI 选项与不合法字符)。src-tauri/src/services/plugin_manager/mod.rs接入PluginApp::Agy与工作目录配置(~/.gemini/antigravity-cli,CLI 未安装时不创建空目录)。agy 1.5.14脱敏实测输出样例fixtures/agy-1.5.14/,并在cli_fixtures.rs、agy.rs、mod.rs中补充单元测试。src/config/appSpecs.ts开启agy.plugins: true,并在src/lib/api/plugins.ts配置PLUGIN_APP_FEATURES.agy(隐藏自定义市场页,支持刷新目录、更新插件与会话级生效提示)。zh/zh-TW/en/de/ja/ko/tr/ru)中的pluginsPage.help说明(其中德/日/韩/俄/土文案为校对后的机翻)。tests/components/PluginsPage.test.tsx补充 Antigravity 插件交互测试(发现页过滤、安装后目录名映射、未配置 MCP 变量插件启用失败回滚与错误提示、更新传参)。验证情况
agy 1.5.14验证安装、启停、更新(含停用状态与配置保留)、未配置 MCP 变量插件启用报错及卸载流程。pnpm typecheck、pnpm format:check、pnpm knip、pnpm test:unit(329 文件 / 4356 用例)、cargo fmt --check、cargo clippy --lib --tests -- -D warnings、cargo test --lib plugin_manager(70 用例)。Screenshots / 截图
Checklist / 检查清单
pnpm typecheckpasses / 通过 TypeScript 类型检查pnpm format:checkpasses / 通过代码格式检查pnpm test:unitpasses / 通过前端单元测试pnpm build:rendererpasses / 通过前端构建cargo clippy --all-targets -- -D warningsand fullcargo testpass / 通过全量 Clippy 与 Rust 测试