chore: import Local-Cursor v1.1.8 source snapshot
Includes the current working directory changes. Historical commits and release binaries are excluded to limit Gitea storage. Source base: d7515973fbfd6dd2001fa156c483455b8081c7cb
This commit is contained in:
44
docs/architecture.md
Normal file
44
docs/architecture.md
Normal file
@@ -0,0 +1,44 @@
|
||||
# 项目结构说明
|
||||
|
||||
## 目录布局
|
||||
|
||||
```
|
||||
Local-Curosr/
|
||||
├── cmd/ # 独立可执行工具入口
|
||||
│ └── ext-tool/ # proto 提取工具,从 Cursor 扩展源码生成 .proto 定义
|
||||
├── internal/ # 内部业务包(不对外暴露)
|
||||
│ ├── app/ # Wails 应用启动与生命周期
|
||||
│ ├── appdata/ # 用户数据目录管理
|
||||
│ ├── backend/ # 后端服务核心
|
||||
│ │ ├── agent/ # Agent 引擎(模型适配、prompt 引擎、协议)
|
||||
│ │ ├── forwarder/ # 请求转发与 AI 处理
|
||||
│ │ ├── server/ # HTTP 路由、中间件、配置
|
||||
│ │ └── host.go # 后端宿主,管理 HTTP/HTTPS 监听器
|
||||
│ ├── bridge/ # Wails 前端桥接层
|
||||
│ ├── buildinfo/ # 构建版本信息
|
||||
│ ├── certs/ # CA 证书管理
|
||||
│ ├── client/ # 客户端服务(MITM 代理、CLI wrapper 生成)
|
||||
│ ├── cursor/ # Cursor 宿主交互(代理设置、证书安装)
|
||||
│ ├── historymetrics/ # 历史用量指标
|
||||
│ ├── logger/ # 日志
|
||||
│ ├── mitm/ # MITM 代理服务
|
||||
│ ├── modelchannel/ # 模型通道解析
|
||||
│ ├── netproxy/ # 出站网络代理
|
||||
│ ├── prompt/ # 静态 prompt 资产与加载
|
||||
│ └── runtime/ # 运行时注入(auth token、账号信息)
|
||||
├── proto/ # Protobuf 定义与扩展提取工具
|
||||
├── scripts/ # 构建/发布辅助脚本
|
||||
├── build/ # 平台构建配置与资源
|
||||
├── cursor-tab-server/ # 独立子模块:Tab 补全服务
|
||||
├── main.go # 主入口
|
||||
├── go.mod # Go 模块定义
|
||||
├── Taskfile.yml # 构建/发布任务
|
||||
└── build/config.yml # Wails 构建配置
|
||||
```
|
||||
|
||||
## 数据流
|
||||
|
||||
```
|
||||
Cursor IDE → MITM(38081) → backend(39091) → 路由 → forwarder → agent/model → 上游模型
|
||||
CLI agent → tls-bypass → HTTPS(39092) → 同一 backend mux → 同上
|
||||
```
|
||||
41
docs/build-environment.md
Normal file
41
docs/build-environment.md
Normal file
@@ -0,0 +1,41 @@
|
||||
# Windows 构建环境
|
||||
|
||||
以下路径于 2026-11-03 在当前机器核实。项目发布不依赖额外安装 NSIS;使用下方已缓存的可执行文件。
|
||||
|
||||
| 工具 | 实际路径 |
|
||||
|---|---|
|
||||
| Git | `D:\WorkProgarm\DevTools\Git\cmd\git.exe` |
|
||||
| Go | `D:\WorkProgarm\DevTools\go\bin\go.exe` |
|
||||
| Wails v3 | `D:\WorkProgarm\DevCache\go-path\bin\wails3.exe` |
|
||||
| Task | `C:\Users\FuDie915\AppData\Local\Microsoft\WinGet\Links\task.exe` |
|
||||
| Node.js | `C:\Users\FuDie915\AppData\Local\fnm_multishells\14812_1793715538718\node.exe` |
|
||||
| Yarn | `C:\Users\FuDie915\AppData\Local\fnm_multishells\14812_1793715538718\yarn.ps1` |
|
||||
| protoc | `C:\Users\FuDie915\AppData\Local\Microsoft\WinGet\Packages\Google.Protobuf_Microsoft.Winget.Source_8wekyb3d8bbwe\bin\protoc.exe` |
|
||||
| protoc-gen-go | `D:\WorkProgarm\DevCache\go-path\bin\protoc-gen-go.exe` |
|
||||
| protoc-gen-connect-go | `D:\WorkProgarm\DevCache\go-path\bin\protoc-gen-connect-go.exe` |
|
||||
| NSIS | `C:\Users\FuDie915\AppData\Local\electron-builder\Cache\nsis\nsis-3.0.4.1\Bin\makensis.exe` |
|
||||
| PowerShell / Compress-Archive | `C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe` |
|
||||
|
||||
Node.js 和 Yarn 路径由 fnm 按会话生成,重新打开终端后应以 `Get-Command node, yarn` 的实际输出为准。NSIS 已验证可执行,版本为 v3.04。
|
||||
|
||||
## 构建前设置
|
||||
|
||||
NSIS 当前未加入全局 `PATH`,在当前 PowerShell 会话中加入后即可使用标准发布任务:
|
||||
|
||||
```powershell
|
||||
$env:Path = "C:\Users\FuDie915\AppData\Local\electron-builder\Cache\nsis\nsis-3.0.4.1\Bin;$env:Path"
|
||||
task release:prepare
|
||||
```
|
||||
|
||||
## 标准 Windows 输出
|
||||
|
||||
以 v1.1.8 为例,产物写入 `bin/release/v1.1.8/`:
|
||||
|
||||
```text
|
||||
Local-Cursor.exe
|
||||
Local-Cursor-amd64-installer.exe
|
||||
local-cursor-v1.1.8-installer.zip
|
||||
local-cursor-v1.1.8-windows-x64-portable.zip
|
||||
```
|
||||
|
||||
其中 portable ZIP 内的程序名为 `windows-64.exe`,installer ZIP 内的安装包名为 `Local-Cursor-amd64-installer.exe`。
|
||||
Reference in New Issue
Block a user