MCPcopy Index your code
hub / github.com/Cometix-Org/cometix-tab-copilot-exp

github.com/Cometix-Org/cometix-tab-copilot-exp @v0.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.0.1 ↗ · + Follow
1,952 symbols 3,322 edges 46 files 191 documented · 10%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Cometix Tab

VS Code TypeScript

Disclaimer

Cometix Tab 是一个 VS Code 扩展,将 Cursor 编辑器的智能代码补全功能带入 VS Code。通过调用 Cursor 的后端 API,为您提供强大的 AI 辅助编程体验。

YOU ARE NOT ALLOWED TO USE THIS PLUGIN FOR COMMERCIAL PURPOSES, AND YOU ARE NOT ALLOWED TO DISTRIBUTE THIS PLUGIN WITHOUT PERMISSION (including but not limited to plugin, code, document, etc.). 禁止使用本插件用于商业目的,禁止未经授权的传播(包括但不限于插件、代码、文档等)。

The purpose of this project is to explore and learn from Cursor Tab, and to reverse-engineer the interface and code of Cursor. Please respect Anysphere and hope Cursor can provide an official vscode plugin someday. 本项目仅为对Cursor Tab的探索与学习,出于针对Cursor的接口与代码的逆向,请其他使用者和研究者保持对Anysphere的尊重。希望Cursor有朝一日能提供官方的vscode插件。

This is an experimental version, built with mostly vibe coding, highly unreliable, please report any bugs and use at your own risk!

The purpose of current experimental project is to investigate how to implement more Cursor-like completion features and mechanics in vscode.

This plugin may modify part of vscode files (if you agree with these modification), thus use with caution!

这是一个实验版本,主要使用vibe coding编写,不太可靠,此外有比较多的日志输出,请尽可能报告相关的bug并自担责任!

本实验项目目的在于探索更接近Cursor Tab的功能和机制的vscode插件。

本插件可能修改部分vscode本体文件(如果你同意相关修改),请小心使用。

功能特性

智能内联建议 (Inline Suggestions)

  • 实时代码补全:基于上下文的智能代码建议
  • 多行编辑支持 (Multidiff):一次建议可包含多处编辑
  • 流式响应:实时显示建议,无需等待完整响应
  • 智能防抖:避免频繁请求,优化性能

光标预测 (Cursor Prediction)

  • 下一编辑位置预测:智能预测您接下来要编辑的位置
  • 同文件预测:在当前文件内预测下一个编辑点
  • 跨文件预测:预测可能需要编辑的其他文件
  • 融合模型支持:预测信息与补全建议一同返回

文件同步 (FileSync)

  • 增量同步:仅同步变更部分,减少传输量
  • 自动版本管理:追踪文件版本,确保一致性
  • 智能回退:版本漂移过大时自动全量同步

Proposed API 自动配置

  • 启动检测:自动检测 VS Code Proposed API 是否已启用
  • 权限提升:支持管理员权限修改 product.json
  • 一键配置:无需手动编辑配置文件

安装

前置要求

  • VS Code 1.103.1 或更高版本
  • Node.js 18+ (开发时需要)
  • 有效的 Cursor 账户和认证令牌

从源码安装

# 克隆仓库
git clone https://github.com/your-repo/cometix-tab.git
cd cometix-tab

# 安装依赖
pnpm install

# 编译
pnpm run compile

# 在 VS Code 中按 F5 启动调试

从 VSIX 安装

# 打包
pnpm run package

# 在 VS Code 中安装
code --install-extension cometix-tab-0.0.1.vsix

配置

在 VS Code 设置中配置 Cometix Tab:

必需配置

配置项 说明
cometixTab.authToken Cursor 认证令牌(必需)

功能开关

配置项 默认值 说明
cometixTab.enableInlineSuggestions true 启用内联代码建议
cometixTab.enableCursorPrediction true 启用光标位置预测
cometixTab.enableAdditionalFilesContext true 在请求中包含最近查看的文件上下文
cometixTab.cppTriggerInComments true 在注释中触发建议
cometixTab.excludedLanguages [] 禁用建议的语言列表

端点配置

配置项 默认值 说明
cometixTab.endpointMode "auto" 端点模式:official/auto/custom
cometixTab.officialRegion "default" 官方端点区域:default/us/eu/asia
cometixTab.customEndpoint "" 自定义端点 URL
cometixTab.clientKey "" 客户端密钥(留空自动生成)

调试配置

配置项 默认值 说明
cometixTab.debug.enabled true 启用调试日志
cometixTab.debug.logStream true 记录流式响应
cometixTab.debug.logRpc true 记录 RPC 请求/响应
cometixTab.debug.verbosePayloads false 记录完整载荷

使用方法

获取代码建议

  1. 在编辑器中正常输入代码
  2. 等待灰色虚拟文本出现(代码建议)
  3. Tab 接受建议

使用光标预测

  1. 接受代码建议后,注意编辑器中的预测装饰
  2. 光标预测会显示在下一个可能的编辑位置
  3. 接受后会自动跳转到预测位置并触发新的建议

命令

命令 说明
Cursor Tab: Accept Inline Suggestion 接受当前内联建议
Cursor Tab: Apply Next Edit 应用队列中的下一个编辑
Cursor Tab: Go To Cursor Prediction 跳转到预测的光标位置
Cometix Tab: Enable Proposed API 启用 VS Code Proposed API

技术文档

详细的技术文档位于 docs/ 目录:

Proposed API 配置

Cometix Tab 使用 VS Code 的 Proposed API (inlineCompletionsAdditions) 来提供完整功能。

自动配置

首次启动时,扩展会自动检测并提示您启用 Proposed API:

  1. 弹出提示框询问是否启用
  2. 选择「启用(需要管理员权限)」
  3. 在系统对话框中确认权限请求
  4. 重启 VS Code 生效

手动配置

如果您选择了「不再提示」,可以通过命令重新触发:

  1. Ctrl+Shift+P 打开命令面板
  2. 搜索并执行 Cometix Tab: Enable Proposed API

开发

项目结构

src/
├── api/          # API 客户端
├── commands/     # VS Code 命令
├── container/    # 依赖注入容器
├── context/      # 上下文和请求构建
├── controllers/  # 控制器
├── providers/    # VS Code Provider
├── rpc/          # Protobuf 定义
├── services/     # 核心服务
├── utils/        # 工具函数
└── extension.ts  # 扩展入口

常用脚本

# 编译
pnpm run compile

# 监视模式
pnpm run watch

# 类型检查
pnpm run check-types

# 代码检查
pnpm run lint

# 运行测试
pnpm run test

# 打包
pnpm run package

依赖

  • @bufbuild/protobuf - Protobuf 序列化
  • @connectrpc/connect - Connect RPC 客户端
  • @connectrpc/connect-node - Node.js 传输层
  • @vscode/sudo-prompt - 权限提升支持

许可证

AGPL-3.0, 适用于从本项目初始commit开始的所有代码,即使当时尚未将LICENSE文件添加

致谢

本项目是自Cometix Tab项目基础上进行的实验性探索,感觉Cursor, Codex, Windsurf在vibe coding上基于的帮助。感谢Anysphere的Cursor中Cursor Tab相关的实现。

~~本项目基于对 Haleclipse 的开发~~(逃),感谢 Cometix Space 的大家支持

Extension points exported contracts — how you extend this code

IRpcClient (Interface)
(no doc) [3 implementers]
src/context/contracts.ts
DocumentSuggestions (Interface)
* Cached suggestions for a document
src/services/lspSuggestionsTracker.ts
StatusPickerItem (Interface)
* Quick pick item with action
src/ui/statusBarPicker.ts
InlineCompletionItem (Interface)
(no doc)
src/vscode.proposed.inlineCompletionsAdditions.d.ts
TruncationResult (Interface)
(no doc)
src/utils/contentProcessor.ts
ApiClientConfig (Interface)
(no doc)
src/api/apiClient.ts
ILogger (Interface)
(no doc) [2 implementers]
src/context/contracts.ts
CppEventBase (Interface)
* Base event interface
src/services/telemetryService.ts

Core symbols most depended-on inside this repo

fromBinary
called by 196
src/rpc/cursor-tab_pb.ts
fromJson
called by 190
src/rpc/cursor-tab_pb.ts
fromJsonString
called by 189
src/rpc/cursor-tab_pb.ts
equals
called by 189
src/rpc/cursor-tab_pb.ts
info
called by 186
src/context/contracts.ts
resolve
called by 39
src/container/serviceContainer.ts
error
called by 17
src/context/contracts.ts
clear
called by 16
src/context/contracts.ts

Shape

Method 1,359
Class 432
Interface 68
Function 58
Enum 35

Languages

TypeScript100%

Modules by API surface

src/rpc/cursor-tab_pb.ts1,350 symbols
src/services/cursorStateMachine.ts61 symbols
src/context/contracts.ts58 symbols
src/api/apiClient.ts41 symbols
src/services/telemetryService.ts33 symbols
src/services/fileSyncCoordinator.ts24 symbols
src/services/cppHeuristics.ts24 symbols
src/services/endpointManager.ts23 symbols
src/services/rpcClient.ts22 symbols
src/ui/statusBarPicker.ts20 symbols
src/ui/statusBar.ts20 symbols
src/services/debugLogger.ts19 symbols

For agents

$ claude mcp add cometix-tab-copilot-exp \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page