Skip to content

Commit 20fa582

Browse files
authored
Merge pull request #367 from ThinkInAIXYZ/dev
Release 0.2.0
2 parents a63973f + b701b60 commit 20fa582

File tree

193 files changed

+10195
-2880
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+10195
-2880
lines changed

.cursor/rules/build-deploy.mdc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
description:
3+
globs:
4+
alwaysApply: false
5+
---
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
description:
3+
globs:
4+
alwaysApply: false
5+
---
6+
# 开发环境设置指南
7+
8+
## 环境要求
9+
- Node.js 16+
10+
- npm 7+
11+
- Git
12+
13+
## 开发工具
14+
- VS Code(推荐)
15+
- Vue DevTools
16+
- Electron DevTools
17+
18+
## 开发环境设置步骤
19+
20+
1. 安装依赖:
21+
```bash
22+
npm install
23+
```
24+
25+
2. 开发模式启动:
26+
```bash
27+
npm run dev
28+
```
29+
30+
3. 构建应用:
31+
```bash
32+
npm run build
33+
```
34+
35+
## 开发规范
36+
37+
1. 代码风格
38+
- 使用 ESLint 进行代码检查
39+
- 使用 Prettier 进行代码格式化
40+
- 遵循 [.eslintrc.cjs](mdc:.eslintrc.cjs) 中的规则
41+
- 遵循 [.prettierrc.yaml](mdc:.prettierrc.yaml) 中的格式化规则
42+
43+
2. Git 提交规范
44+
- 遵循 [CONTRIBUTING.md](mdc:CONTRIBUTING.md) 中的提交规范
45+
- 使用语义化提交信息
46+
47+
3. 测试规范
48+
- 编写单元测试
49+
- 运行测试:`npm run test`
50+
51+
4. 文档规范
52+
- 更新相关文档
53+
- 保持 README 文件的最新状态

.cursor/rules/error-logging.mdc

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
description:
3+
globs:
4+
alwaysApply: false
5+
---
6+
# 错误处理和日志指南
7+
8+
## 错误处理规范
9+
10+
1. 错误类型
11+
- 用户错误:用户输入或操作导致的错误
12+
- 系统错误:程序运行时的错误
13+
- 网络错误:API 调用或网络请求错误
14+
- 业务错误:业务逻辑相关的错误
15+
16+
2. 错误处理原则
17+
- 始终使用 try-catch 处理可能的错误
18+
- 提供有意义的错误信息
19+
- 记录详细的错误日志
20+
- 优雅降级处理
21+
22+
3. 错误处理示例:
23+
```typescript
24+
try {
25+
await someOperation()
26+
} catch (error) {
27+
if (error instanceof UserError) {
28+
// 处理用户错误
29+
showUserFriendlyMessage(error.message)
30+
} else if (error instanceof NetworkError) {
31+
// 处理网络错误
32+
handleNetworkError(error)
33+
} else {
34+
// 处理未知错误
35+
logError(error)
36+
showGenericErrorMessage()
37+
}
38+
}
39+
```
40+
41+
## 日志规范
42+
43+
1. 日志级别
44+
- ERROR:错误信息
45+
- WARN:警告信息
46+
- INFO:一般信息
47+
- DEBUG:调试信息
48+
49+
2. 日志内容
50+
- 时间戳
51+
- 日志级别
52+
- 错误代码
53+
- 错误描述
54+
- 堆栈跟踪(如果适用)
55+
- 相关上下文信息
56+
57+
3. 日志记录示例:
58+
```typescript
59+
import { logger } from '@/utils/logger'
60+
61+
// 错误日志
62+
logger.error('Failed to save data', {
63+
error: error,
64+
context: { userId, operation }
65+
})
66+
67+
// 信息日志
68+
logger.info('User action completed', {
69+
action: 'save',
70+
userId,
71+
timestamp: new Date()
72+
})
73+
```
74+
75+
## 最佳实践
76+
77+
1. 错误处理
78+
- 不要吞掉错误
79+
- 提供用户友好的错误信息
80+
- 实现错误重试机制
81+
- 使用错误边界捕获渲染错误
82+
83+
2. 日志记录
84+
- 避免记录敏感信息
85+
- 使用结构化日志
86+
- 实现日志轮转
87+
- 设置适当的日志级别
88+
89+
3. 监控和告警
90+
- 设置错误监控
91+
- 配置关键错误告警
92+
- 定期检查错误日志
93+
- 分析错误模式

.cursor/rules/i18n.mdc

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,66 @@ i18n:
88
framework: 'vue-i18n'
99
location: 'src/renderer/src/i18n'
1010
requirement: 'all user-facing strings must use i18n keys'
11-
locales: ['zh-CN','en-US','ko-KR','ru-RU','zh-HK','fr-FR']
11+
locales: ['zh-CN','en-US','ko-KR','ru-RU','zh-HK','fr-FR']
12+
13+
# 国际化开发指南
14+
15+
## 多语言支持
16+
17+
本项目支持多语言,包括:
18+
- 中文(简体)
19+
- 英文
20+
- 日文
21+
- 韩文
22+
- 俄文
23+
- 繁体中文
24+
- 法文
25+
26+
## 技术实现
27+
28+
- 框架:vue-i18n
29+
- 位置:src/renderer/src/i18n
30+
- 要求:所有面向用户的字符串必须使用 i18n 键
31+
32+
## 文件结构
33+
34+
- 语言文件位于 `src/renderer/src/locales/` 目录
35+
- 每种语言都有独立的 JSON 文件
36+
- 共享的翻译键值放在 `common.json` 中
37+
38+
## 使用规范
39+
40+
1. 翻译键命名规范:
41+
- 使用点号分隔的层级结构
42+
- 使用小写字母
43+
- 使用有意义的描述性名称
44+
- 例如:`common.button.submit`
45+
46+
2. 添加新翻译:
47+
- 在 `common.json` 中添加共享翻译
48+
- 在语言特定文件中添加特定翻译
49+
- 保持所有语言文件的键值一致
50+
51+
3. 在代码中使用:
52+
```typescript
53+
import { useI18n } from 'vue-i18n'
54+
55+
const { t } = useI18n()
56+
// 使用翻译
57+
const message = t('common.button.submit')
58+
```
59+
60+
4. 动态切换语言:
61+
```typescript
62+
const { locale } = useI18n()
63+
// 切换语言
64+
locale.value = 'zh-CN'
65+
```
66+
67+
## 最佳实践
68+
69+
1. 避免硬编码文本
70+
2. 使用有意义的键名
71+
3. 保持翻译文件的结构一致
72+
4. 定期检查未使用的翻译键
73+
5. 确保所有用户可见的文本都使用翻译系统

.cursor/rules/performance.mdc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
description:
3+
globs:
4+
alwaysApply: false
5+
---
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
description:
3+
globs:
4+
alwaysApply: false
5+
---
6+
# 项目结构指南
7+
8+
本项目是一个基于 Electron + Vue 3 的桌面应用程序。主要目录结构如下:
9+
10+
- `src/`: 源代码目录
11+
- `main/`: Electron 主进程代码
12+
- `renderer/`: 渲染进程代码(Vue 3 应用)
13+
- `shared/`: 主进程和渲染进程共享的类型定义和工具
14+
15+
- `resources/`: 应用程序资源文件
16+
- `build/`: 构建相关配置
17+
- `scripts/`: 构建和开发脚本
18+
- `docs/`: 项目文档
19+
- `tests/`: 测试文件
20+
21+
主要配置文件:
22+
- [electron.vite.config.ts](mdc:electron.vite.config.ts): Vite 构建配置
23+
- [electron-builder.yml](mdc:electron-builder.yml): Electron Builder 配置
24+
- [tsconfig.json](mdc:tsconfig.json): TypeScript 配置
25+
- [tailwind.config.js](mdc:tailwind.config.js): Tailwind CSS 配置
26+
27+
开发规范:
28+
1. 所有新功能应该在 `src` 目录下开发
29+
2. 共享类型定义放在 `shared` 目录
30+
3. 主进程代码放在 `src/main`
31+
4. 渲染进程代码放在 `src/renderer`
32+
5. 测试文件放在 `tests` 目录

.cursor/rules/vue-shadcn.mdc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
2-
description: Render
3-
globs: src/renderer/src/**
2+
description:
3+
globs: src/renderer/*,src/renderer/**/*,srr/renderer/src/**/*
4+
alwaysApply: false
45
---
56

67
You are an expert in TypeScript, Node.js, NuxtJS, Vue 3, Shadcn Vue, Radix Vue, VueUse, and Tailwind.

README.jp.md

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<a href="https://github.com/ThinkInAIXYZ/deepchat/pulls"><img src="https://img.shields.io/github/issues-pr/ThinkInAIXYZ/deepchat" alt="Pull Requests Badge"/></a>
1313
<a href="https://github.com/ThinkInAIXYZ/deepchat/issues"><img src="https://img.shields.io/github/issues/ThinkInAIXYZ/deepchat" alt="Issues Badge"/></a>
1414
<a href="https://github.com/ThinkInAIXYZ/deepchat/blob/main/LICENSE"><img src="https://img.shields.io/github/license/ThinkInAIXYZ/deepchat" alt="License Badge"/></a>
15+
<a href="https://deepwiki.com/ThinkInAIXYZ/deepchat"><img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki"></a>
1516
</p>
1617

1718
<div align="center">
@@ -20,16 +21,30 @@
2021

2122
## 📑 目次
2223

23-
- [プロジェクト紹介](#-プロジェクト紹介)
24-
- [なぜDeepChatを選ぶのか](#-なぜdeepchatを選ぶのか)
25-
- [機能のショーケース](#-機能のショーケース)
26-
- [主な機能](#-主な機能)
27-
- [サポートされているモデルプロバイダー](#-サポートされているモデルプロバイダー)
28-
- [ユースケース](#-ユースケース)
29-
- [クイックスタート](#-クイックスタート)
30-
- [開発ガイド](#-開発ガイド)
31-
- [コミュニティと貢献](#-コミュニティと貢献)
32-
- [ライセンス](#-ライセンス)
24+
- [📑 目次](#-目次)
25+
- [🚀 プロジェクト紹介](#-プロジェクト紹介)
26+
- [💡 なぜDeepChatを選ぶのか](#-なぜdeepchatを選ぶのか)
27+
- [📸 機能のショーケース](#-機能のショーケース)
28+
- [推論能力](#推論能力)
29+
- [検索拡張](#検索拡張)
30+
- [LaTeXサポート](#latexサポート)
31+
- [アーティファクトサポート](#アーティファクトサポート)
32+
- [🔥 主な機能](#-主な機能)
33+
- [🤖 サポートされているモデルプロバイダー](#-サポートされているモデルプロバイダー)
34+
- [OpenAI/Gemini/Anthropic API形式の任意のモデルプロバイダーと互換性あり](#openaigeminianthropic-api形式の任意のモデルプロバイダーと互換性あり)
35+
- [🔍 ユースケース](#-ユースケース)
36+
- [📦 クイックスタート](#-クイックスタート)
37+
- [ダウンロードとインストール](#ダウンロードとインストール)
38+
- [モデルの設定](#モデルの設定)
39+
- [会話を開始](#会話を開始)
40+
- [💻 開発ガイド](#-開発ガイド)
41+
- [依存関係のインストール](#依存関係のインストール)
42+
- [開発を開始](#開発を開始)
43+
- [ビルド](#ビルド)
44+
- [👥 コミュニティと貢献](#-コミュニティと貢献)
45+
- [⭐ スター履歴](#-スター履歴)
46+
- [👨‍💻 貢献者](#-貢献者)
47+
- [📃 ライセンス](#-ライセンス)
3348

3449
## 🚀 プロジェクト紹介
3550

README.md

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<a href="https://github.com/ThinkInAIXYZ/deepchat/pulls"><img src="https://img.shields.io/github/issues-pr/ThinkInAIXYZ/deepchat" alt="Pull Requests Badge"/></a>
1313
<a href="https://github.com/ThinkInAIXYZ/deepchat/issues"><img src="https://img.shields.io/github/issues/ThinkInAIXYZ/deepchat" alt="Issues Badge"/></a>
1414
<a href="https://github.com/ThinkInAIXYZ/deepchat/blob/main/LICENSE"><img src="https://img.shields.io/github/license/ThinkInAIXYZ/deepchat" alt="License Badge"/></a>
15+
<a href="https://deepwiki.com/ThinkInAIXYZ/deepchat"><img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki"></a>
1516
</p>
1617

1718
<div align="center">
@@ -20,16 +21,30 @@
2021

2122
## 📑 Table of Contents
2223

23-
- [Project Introduction](#-project-introduction)
24-
- [Why Choose DeepChat](#-why-choose-deepchat)
25-
- [Feature Showcase](#-feature-showcase)
26-
- [Main Features](#-main-features)
27-
- [Supported Model Providers](#-supported-model-providers)
28-
- [Use Cases](#-use-cases)
29-
- [Quick Start](#-quick-start)
30-
- [Development Guide](#-development-guide)
31-
- [Community & Contribution](#-community--contribution)
32-
- [License](#-license)
24+
- [📑 Table of Contents](#-table-of-contents)
25+
- [🚀 Project Introduction](#-project-introduction)
26+
- [💡 Why Choose DeepChat](#-why-choose-deepchat)
27+
- [📸 Feature Showcase](#-feature-showcase)
28+
- [Reasoning Capabilities](#reasoning-capabilities)
29+
- [Search Enhancement](#search-enhancement)
30+
- [LaTeX Support](#latex-support)
31+
- [Artifacts Support](#artifacts-support)
32+
- [🔥 Main Features](#-main-features)
33+
- [🤖 Supported Model Providers](#-supported-model-providers)
34+
- [Compatible with any model provider in OpenAI/Gemini/Anthropic API format](#compatible-with-any-model-provider-in-openaigeminianthropic-api-format)
35+
- [🔍 Use Cases](#-use-cases)
36+
- [📦 Quick Start](#-quick-start)
37+
- [Download and Install](#download-and-install)
38+
- [Configure Models](#configure-models)
39+
- [Start Conversations](#start-conversations)
40+
- [💻 Development Guide](#-development-guide)
41+
- [Install Dependencies](#install-dependencies)
42+
- [Start Development](#start-development)
43+
- [Build](#build)
44+
- [👥 Community \& Contribution](#-community--contribution)
45+
- [⭐ Star History](#-star-history)
46+
- [👨‍💻 Contributors](#-contributors)
47+
- [📃 License](#-license)
3348

3449
## 🚀 Project Introduction
3550

0 commit comments

Comments
 (0)