feat: add plugin mode - #382
Merged
Merged
Conversation
… PluginManagementPage - Updated the UI components in CursorModelCards and PluginManagementPage to use TruncatedButton for better text handling and display. - Adjusted styles in CursorSettings and PluginManagementPage to ensure proper button layout and responsiveness. - Added new ActionMenu component for handling additional actions in PluginManagementPage. - Enhanced localization files to include new strings for the ActionMenu and TruncatedButton components.
- Replaced the native progress element with a custom-styled progress bar for improved visual feedback during downloads. - Added new styles for progress bar and fill animations to enhance user experience. - Updated the component to use ARIA roles for better accessibility.
leookun
marked this pull request as ready for review
August 30, 2026 13:00
…rvices - Added detailed error messages for plugin data read/write failures, including file paths for better debugging. - Updated logging levels for upstream request rejections in account services to debug for less critical issues. - Enhanced error handling in the plugin worker to provide clearer context when starting the plugin worker fails. - Introduced new functions for merging extra parameters and applying body allowlists in provider services, improving request validation.
- Implemented a new button to copy the user code in the OAuthMethodCard, enhancing user experience. - Added styles for the copy button to match the UI design. - Updated localization files to include new strings for the copy action in both English and Chinese.
- Replaced asynchronous file operations with a synchronous approach to ensure file handles are properly closed before replacement. - Introduced a new `write_once` function for atomic file writing, including directory creation, temporary file writing, and target file replacement. - Enhanced error handling to retry on transient errors specific to Windows, improving robustness during file operations. - Updated the `clear` method in `PluginRegistry` to ensure OAuth sessions are only removed after successful persistence of resources.
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.
Summary
将订阅类 Provider 能力(PR #360 的目标)重构为通用插件系统:插件实现核心定义的能力接口,核心负责状态持久化与 UI 绘制。
插件契约(TypeScript SDK,
server/src/plugin/sdk/)invoke()接收完整LlmRequest(指令/消息/工具/思考配置/会话缓存键),自行完成协议适配与 SSE 解析,边流式emit()标准化ModelEvent(与核心provider/event.rs一一对应,含工具参数增量与加密推理回放),返回completed或类型化错误(resource-error携带资源补丁)models.list()枚举上游模型,核心持久化目录;每个模型独立进入 Cursor(plugin:<plugin>/<provider>/<model>),支持 Context/Effort/Fast 变体begin/poll,核心驱动轮询/超时/退避)、批量导入(兼容 cliproxyapi 格式)/导出、present()投影、额度刷新;插件零持久状态,数据全部由核心以 0600 原子 JSON 持有LocalizedText全链路 i18n;协议帮助库cursor-byok:protocol/openai-responses(与 Rust 内置 Provider 行为对齐,replay kind 互通)核心(Rust)
ProviderType::Plugin)、规范化管道、流空闲超时看门狗;资源选择内聚在插件 Provider 内,为负载均衡预留network.stream、精确 HTTPS 主机白名单、取消传播;Windows 下CREATE_NO_WINDOW与原子替换重试version预装进plugins/installed/(版本一致零写盘,变化时整目录同步),minAppVersion门控由桌面壳注入应用版本0007:去除llm_calls.model_hash外键,插件稳定模型 ID 直接参与调用统计与筛选内置 Codex 插件(
server/plugins/build-in/codex-auth)ChatGPT 设备码登录、凭证导入导出、周/5 小时额度、官方模型同步、fast→
service_tier: priority、prompt_cache_key+session-id/thread-id缓存亲和(与 codex-rs 契约一致)。桌面端
插件配置页(卡片:图标/开发者/版本/状态,添加账号/账号管理/更多菜单)、OAuth 与资源管理面板、模型页可折叠分组列表、截断按钮 Tooltip、自绘斑马纹进度条、菜单重组(模型配置/设置)、中英文案。
Test plan
cargo test -p cursor-server --lib(39 通过,含 wire/state/manifest/builtin/migration 用例)cargo clippy -- -D warnings、cargo fmt --checknpm run check