Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Verify
on:
push:
pull_request:
jobs:
regression:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: npm
- name: Install desktop system libraries
run: sudo apt-get update && sudo apt-get install -y libegl1 libopengl0
- run: python -m pip install -r requirements-dev.txt
- run: npm ci --ignore-scripts
- run: PYTHONPATH=engine python -m coverage run -m unittest discover -s tests -v
- run: |
python -m coverage combine
mkdir -p test-results
python -m coverage xml -o test-results/coverage.xml
- run: QT_QPA_PLATFORM=offscreen python tests/qt_smoke.py
- run: npm test
- run: python -m ruff check engine sidecar tests
- run: python -m compileall -q engine sidecar
- run: |
for source in renderer/js/*.js electron/*.js tests/*.js tests/*.cjs; do node --check "$source"; done
bash -n start.sh stop.sh
- run: node node_modules/electron/install.js
- run: xvfb-run -a python tests/electron_smoke.py
- uses: actions/upload-artifact@v4
if: always()
with:
name: desktop-smoke
path: test-results/
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
node_modules/
.venv/
__pycache__/
*.py[cod]
.ruff_cache/
data/*
!data/projects/
!data/projects/.gitkeep
dscode_data/
.DS_Store
test-results/
.coverage
coverage.xml
.coverage.*
96 changes: 3 additions & 93 deletions DS code 2.0.1-0712-NEXT demo/README.md
Original file line number Diff line number Diff line change
@@ -1,98 +1,8 @@
# DS Code v2.0.1-0712-NEXT

> AI 编程助手 · Electron + Python Sidecar · DeepSeek V4 API

## 快速启动 / Quick Start
此目录仅保留旧启动路径的兼容入口。完整源码、依赖和说明都在仓库根目录:

```bash
cd "DS code 2.0.1-0712-NEXT demo"
cd ..
./start.sh
```

首次启动会自动下载 Electron,之后秒开。

## 目录结构 / File Structure

```
├── start.sh # 一键启动脚本
├── stop.sh # 停止脚本
├── sidecar/ # Python Sidecar (纯 stdlib HTTP/SSE)
│ ├── sidecar.py # 主程序 (端口 8765)
│ ├── sidecar_engine.py # 引擎封装 (备用)
│ └── sidecar_api.py # FastAPI 版本 (备用)
├── renderer/ # 前端界面
│ ├── index.html # 主页面
│ ├── js/
│ │ ├── app.js # 主逻辑 (向导/聊天/设置)
│ │ ├── i18n.js # 中英文国际化
│ │ └── utils.js # Markdown 渲染 / 工具函数
│ └── css/
│ ├── theme.css # 设计令牌 + 深色模式
│ └── app.css # 布局 + 组件样式
├── engine/src/ # AI 引擎
│ ├── core/ # ChatEngine / DeepSeek API / Config / Hooks
│ ├── tools/ # 91 内置工具
│ ├── sandbox/ # 项目隔离 / 历史记录
│ ├── prompts/ # 系统提示词
│ └── agents/ # 子代理
├── electron/ # Electron 窗口
├── data/ # 配置和数据
├── assets/ # 图标/图片
└── node_modules/ # 依赖 (npm install 后)
```

## 功能 / Features

### 对话 / Chat
- DeepSeek V4 Pro / Flash 流式对话
- Thinking 模式:实时推理链输出
- 对话历史自动保存与恢复

### 引导页 / Onboarding Wizard
- 选择服务提供商:DeepSeek 官方 / 自定义供应商
- 自定义供应商支持:Base URL + 模型配置 (最多 2 个)
- 1M Context 开关 per model

### 工具调用 / Tool Calls
- 91 个内置工具 (文件操作 / 命令执行 / Git / 搜索 / MCP / …)
- 原生 DeepSeek V4 function calling (`tools` 参数)
- 文本提取 fallback 兼容旧格式

### UI
- `/` 斜杠命令菜单
- 中英文双语 (实时切换)
- 深色/浅色主题
- 项目侧边栏 (创建/切换/删除)
- 待办事项、文件管理面板

### API 端点 / API Endpoints
| 端点 | 说明 |
|---|---|
| `GET /api/health` | 健康检查 |
| `GET /api/config` | 读取配置 |
| `PUT /api/config` | 更新配置 |
| `GET /api/projects` | 列出项目 |
| `POST /api/projects` | 创建项目 |
| `DELETE /api/projects/{name}` | 删除项目 |
| `GET /api/chat/stream` | SSE 流式对话 |
| `POST /api/chat/stop` | 停止对话 |
| `GET /api/balance` | 查询余额 (http.client) |
| `GET /api/models` | 列出模型 |

## 配置 / Configuration

首次启动会弹出引导页。配置加密存储在 `~/dscode_data/config.enc` (Fernet)。

## 技术栈 / Tech Stack

| 层 | 技术 |
|---|---|
| 前端 | HTML/CSS/JS (vanilla, zero framework) |
| 后端 | Python 3.9+ asyncio stdlib (zero pip install) |
| 引擎 | OpenAI SDK + http.client |
| 流式 | Server-Sent Events (SSE) |
| 配置 | Fernet 加密存储 |

## License

Apache-2.0
旧路径 `./start.sh` 会转发到根目录,不再维护重复的前端副本。
17 changes: 0 additions & 17 deletions DS code 2.0.1-0712-NEXT demo/package.json

This file was deleted.

Loading
Loading