Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 69dac2fc6e | |||
| b30f55705f | |||
| fbe9ec0e48 | |||
| e5b4b60c3d |
@@ -1,97 +0,0 @@
|
||||
---
|
||||
description:
|
||||
globs: src/services/**/*,src/database/**/*,src/server/**/*
|
||||
alwaysApply: false
|
||||
---
|
||||
# LobeChat 后端技术架构指南
|
||||
|
||||
本指南旨在阐述 LobeChat 项目的后端分层架构,重点介绍各核心目录的职责以及它们之间的协作方式。
|
||||
|
||||
## 目录结构映射
|
||||
|
||||
```
|
||||
src/
|
||||
├── server/
|
||||
│ ├── routers/ # tRPC API 路由定义
|
||||
│ └── services/ # 业务逻辑服务层
|
||||
│ └── */impls/ # 平台特定实现
|
||||
├── database/
|
||||
│ ├── models/ # 数据模型 (单表 CRUD)
|
||||
│ ├── repositories/ # 仓库层 (复杂查询/聚合)
|
||||
│ └── schemas/ # Drizzle ORM 表定义
|
||||
└── services/ # 客户端服务 (调用 tRPC 或直接访问 Model)
|
||||
```
|
||||
|
||||
## 核心架构分层
|
||||
|
||||
LobeChat 的后端设计注重模块化、可测试性和灵活性,以适应不同的运行环境(如浏览器端 PGLite、服务端远程 PostgreSQL 以及 Electron 桌面应用)。
|
||||
|
||||
其主要分层如下:
|
||||
|
||||
1. **客户端服务层 (`src/services`)**:
|
||||
* 位于 src/services/。
|
||||
* 这是客户端业务逻辑的核心层,负责封装各种业务操作和数据处理逻辑。
|
||||
* **环境适配**: 根据不同的运行环境,服务层会选择合适的数据访问方式:
|
||||
* **本地数据库模式**: 直接调用 `Model` 层进行数据操作,适用于浏览器 PGLite 和本地 Electron 应用。
|
||||
* **远程数据库模式**: 通过 `tRPC` 客户端调用服务端 API,适用于需要云同步的场景。
|
||||
* **类型转换**: 对于简单的数据类型转换,直接在此层进行类型断言,如 `this.pluginModel.query() as Promise<LobeTool[]>`
|
||||
* 每个服务模块通常包含 `client.ts`(本地模式)、`server.ts`(远程模式)和 `type.ts`(接口定义)文件,在实现时应该确保本地模式和远程模式业务逻辑实现一致,只是数据库不同。
|
||||
|
||||
2. **API 接口层 (`TRPC`)**:
|
||||
* 位于 src/server/routers/
|
||||
* 使用 `tRPC` 构建类型安全的 API。Router 根据运行时环境(如 Edge Functions, Node.js Lambda)进行组织。
|
||||
* 负责接收客户端请求,并将其路由到相应的 `Service` 层进行处理。
|
||||
* 新建 lambda 端点时可以参考 src/server/routers/lambda/_template.ts
|
||||
|
||||
3. **服务端服务层 (`server/services`)**:
|
||||
* 位于 src/server/services/。
|
||||
* 核心职责是封装独立的、可复用的业务逻辑单元。这些服务应易于测试。
|
||||
* **平台差异抽象**: 一个关键特性是通过其内部的 `impls` 子目录(例如 src/server/services/file/impls 包含 s3.ts 和 local.ts)来抹平不同运行环境带来的差异(例如云端使用 S3 存储,桌面版使用本地文件系统)。这使得上层(如 `tRPC` routers)无需关心底层具体实现。
|
||||
* 目标是使 `tRPC` router 层的逻辑尽可能纯粹,专注于请求处理和业务流程编排。
|
||||
* 服务会调用 `Repository` 层或直接调用 `Model` 层进行数据持久化和检索,也可能调用其他服务。
|
||||
|
||||
4. **仓库层 (`Repositories`)**:
|
||||
* 位于 src/database/repositories/。
|
||||
* 主要处理**复杂的跨表查询和数据聚合**逻辑,特别是当需要从**多个 `Model`** 获取数据并进行组合时。
|
||||
* 与 `Model` 层不同,`Repository` 层专注于复杂的业务查询场景,而不涉及简单的领域模型转换。
|
||||
* 当业务逻辑涉及多表关联、复杂的数据统计或需要事务处理时,会使用 `Repository` 层。
|
||||
* 如果数据操作简单(仅涉及单个 `Model`),则通常直接在 `src/services` 层调用 `Model` 并进行简单的类型断言。
|
||||
|
||||
5. **模型层 (`Models`)**:
|
||||
* 位于 src/database/models/ (例如 src/database/models/plugin.ts 和 src/database/models/document.ts)。
|
||||
* 提供对数据库中各个表(由 src/database/schemas/ 中的 Drizzle ORM schema 定义)的基本 CRUD (创建、读取、更新、删除) 操作和简单的查询能力。
|
||||
* `Model` 类专注于单个数据表的直接操作,**不涉及复杂的领域模型转换**,这些转换通常在上层的 `src/services` 中通过类型断言完成。
|
||||
* model(例如 Topic) 层接口经常需要从对应的 schema 层导入 NewTopic 和 TopicItem
|
||||
* 创建新的 model 时可以参考 src/database/models/_template.ts
|
||||
|
||||
6. **数据库 (`Database`)**:
|
||||
* **客户端模式 (浏览器/PWA)**: 使用 PGLite (基于 WASM 的 PostgreSQL),数据存储在用户浏览器本地。
|
||||
* **服务端模式 (云部署)**: 使用远程 PostgreSQL 数据库。
|
||||
* **Electron 桌面应用**:
|
||||
* Electron 客户端会启动一个本地 Node.js 服务。
|
||||
* 本地服务通过 `tRPC` 与 Electron 的渲染进程通信。
|
||||
* 数据库选择依赖于是否开启**云同步**功能:
|
||||
* **云同步开启**: 连接到远程 PostgreSQL 数据库。
|
||||
* **云同步关闭**: 使用 PGLite (通过 Node.js 的 WASM 实现) 在本地存储数据。
|
||||
|
||||
## 数据流向说明
|
||||
|
||||
### 浏览器/PWA 模式
|
||||
```
|
||||
UI (React) → Zustand State → Model Layer → PGLite (本地数据库)
|
||||
```
|
||||
|
||||
### 服务端模式
|
||||
```
|
||||
UI (React) → Zustand State → tRPC Client → tRPC Routers → Services → Repositories/Models → Remote PostgreSQL
|
||||
```
|
||||
|
||||
### Electron 桌面应用模式
|
||||
```
|
||||
UI (Electron Renderer) → Zustand State → tRPC Client → 本地 Node.js 服务 → tRPC Routers → Services → Repositories/Models → PGLite/Remote PostgreSQL (取决于云同步设置)
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
---
|
||||
description:
|
||||
globs:
|
||||
alwaysApply: false
|
||||
---
|
||||
## Formatting Response
|
||||
|
||||
This is about how you should format your responses.
|
||||
|
||||
### Render Markdown Table
|
||||
|
||||
- Be aware that the cursor chat you are in can't render markdown table correctly.
|
||||
- IMPORTANT: Tables need to be rendered in plain text and not markdown
|
||||
|
||||
When rendering tables, do not use markdown table syntax or plain text alone. Instead, place the entire table inside a code/text block (using triple backticks). This ensures the table formatting is preserved and readable in the chat interface.
|
||||
|
||||
Example:
|
||||
|
||||
```plaintext
|
||||
+----+---------+-----------+
|
||||
| ID | Name | Role |
|
||||
+----+---------+-----------+
|
||||
| 1 | Alice | Admin |
|
||||
| 2 | Bob | User |
|
||||
| 3 | Charlie | Moderator |
|
||||
+----+---------+-----------+
|
||||
```
|
||||
@@ -1,8 +0,0 @@
|
||||
---
|
||||
description:
|
||||
globs: src/database/models/**/*
|
||||
alwaysApply: false
|
||||
---
|
||||
1. first read [lobe-chat-backend-architecture.mdc](mdc:.cursor/rules/lobe-chat-backend-architecture.mdc)
|
||||
2. refer to the [_template.ts](mdc:src/database/models/_template.ts) to create new model
|
||||
3. if an operation involves multiple models or complex queries, consider defining it in the `repositories` layer under `src/database/repositories/`
|
||||
@@ -1,154 +0,0 @@
|
||||
---
|
||||
description:
|
||||
globs:
|
||||
alwaysApply: false
|
||||
---
|
||||
**桌面端新功能实现指南**
|
||||
|
||||
## 桌面端应用架构概述
|
||||
|
||||
LobeChat 桌面端基于 Electron 框架构建,采用主进程-渲染进程架构:
|
||||
|
||||
1. **主进程 (Main Process)**:
|
||||
- 位置:`apps/desktop/src/main`
|
||||
- 职责:控制应用生命周期、系统API交互、窗口管理、后台服务
|
||||
|
||||
2. **渲染进程 (Renderer Process)**:
|
||||
- 复用 Web 端代码,位于 `src` 目录
|
||||
- 通过 IPC 与主进程通信
|
||||
|
||||
3. **预加载脚本 (Preload)**:
|
||||
- 位置:`apps/desktop/src/preload`
|
||||
- 职责:安全地暴露主进程功能给渲染进程
|
||||
|
||||
## 添加新桌面端功能流程
|
||||
|
||||
### 1. 确定功能需求与设计
|
||||
|
||||
首先确定新功能的需求和设计,包括:
|
||||
- 功能描述和用例
|
||||
- 是否需要系统级API(如文件系统、网络等)
|
||||
- UI/UX设计(如必要)
|
||||
- 与现有功能的交互方式
|
||||
|
||||
### 2. 在主进程中实现核心功能
|
||||
|
||||
1. **创建控制器 (Controller)**
|
||||
- 位置:`apps/desktop/src/main/controllers/`
|
||||
- 示例:创建 `NewFeatureCtr.ts`
|
||||
- 规范:按 `_template.ts` 模板格式实现
|
||||
- 注册:在 `apps/desktop/src/main/controllers/index.ts` 导出
|
||||
|
||||
2. **定义 IPC 事件处理器**
|
||||
- 使用 `@ipcClientEvent('eventName')` 装饰器注册事件处理函数
|
||||
- 处理函数应接收前端传递的参数并返回结果
|
||||
- 处理可能的错误情况
|
||||
|
||||
3. **实现业务逻辑**
|
||||
- 可能需要调用 Electron API 或 Node.js 原生模块
|
||||
- 对于复杂功能,可以创建专门的服务类 (`services/`)
|
||||
|
||||
### 3. 定义 IPC 通信类型
|
||||
|
||||
1. **在共享类型定义中添加新类型**
|
||||
- 位置:`packages/electron-client-ipc/src/types.ts`
|
||||
- 添加参数类型接口(如 `NewFeatureParams`)
|
||||
- 添加返回结果类型接口(如 `NewFeatureResult`)
|
||||
|
||||
### 4. 在渲染进程实现前端功能
|
||||
|
||||
1. **创建服务层**
|
||||
- 位置:`src/services/electron/`
|
||||
- 添加服务方法调用 IPC
|
||||
- 使用 `dispatch` 或 `invoke` 函数
|
||||
|
||||
```typescript
|
||||
// src/services/electron/newFeatureService.ts
|
||||
import { dispatch } from '@lobechat/electron-client-ipc';
|
||||
import { NewFeatureParams } from 'types';
|
||||
|
||||
export const newFeatureService = async (params: NewFeatureParams) => {
|
||||
return dispatch('newFeatureEventName', params);
|
||||
};
|
||||
```
|
||||
|
||||
2. **实现 Store Action**
|
||||
- 位置:`src/store/`
|
||||
- 添加状态更新逻辑和错误处理
|
||||
|
||||
3. **添加 UI 组件**
|
||||
- 根据需要在适当位置添加UI组件
|
||||
- 通过 Store 或 Service 层调用功能
|
||||
|
||||
### 5. 如果是新增内置工具,遵循工具实现流程
|
||||
|
||||
参考 [desktop-local-tools-implement.mdc](mdc:desktop-local-tools-implement.mdc) 了解更多关于添加内置工具的详细步骤。
|
||||
|
||||
### 6. 添加测试
|
||||
|
||||
1. **单元测试**
|
||||
- 位置:`apps/desktop/src/main/controllers/__tests__/`
|
||||
- 测试主进程组件功能
|
||||
|
||||
2. **集成测试**
|
||||
- 测试 IPC 通信和功能完整流程
|
||||
|
||||
## 最佳实践
|
||||
|
||||
1. **安全性考虑**
|
||||
- 谨慎处理用户数据和文件系统访问
|
||||
- 适当验证和清理输入数据
|
||||
- 限制暴露给渲染进程的API范围
|
||||
|
||||
2. **性能优化**
|
||||
- 对于耗时操作,考虑使用异步方法
|
||||
- 大型数据传输考虑分批处理
|
||||
|
||||
3. **用户体验**
|
||||
- 为长时间操作添加进度指示
|
||||
- 提供适当的错误反馈
|
||||
- 考虑操作的可撤销性
|
||||
|
||||
4. **代码组织**
|
||||
- 遵循项目现有的命名和代码风格约定
|
||||
- 为新功能添加适当的文档和注释
|
||||
- 功能模块化,避免过度耦合
|
||||
|
||||
## 示例:实现系统通知功能
|
||||
|
||||
```typescript
|
||||
// apps/desktop/src/main/controllers/NotificationCtr.ts
|
||||
import { BrowserWindow, Notification } from 'electron';
|
||||
import { ipcClientEvent } from 'electron-client-ipc';
|
||||
|
||||
interface ShowNotificationParams {
|
||||
title: string;
|
||||
body: string;
|
||||
}
|
||||
|
||||
export class NotificationCtr {
|
||||
@ipcClientEvent('showNotification')
|
||||
async handleShowNotification({ title, body }: ShowNotificationParams) {
|
||||
try {
|
||||
if (!Notification.isSupported()) {
|
||||
return { success: false, error: 'Notifications not supported' };
|
||||
}
|
||||
|
||||
const notification = new Notification({
|
||||
title,
|
||||
body,
|
||||
});
|
||||
|
||||
notification.show();
|
||||
|
||||
return { success: true };
|
||||
} catch (error) {
|
||||
console.error('Failed to show notification:', error);
|
||||
return {
|
||||
success: false,
|
||||
error: error instanceof Error ? error.message : 'Unknown error'
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -1,80 +0,0 @@
|
||||
---
|
||||
description:
|
||||
globs:
|
||||
alwaysApply: false
|
||||
---
|
||||
**新增桌面端工具流程:**
|
||||
|
||||
1. **定义工具接口 (Manifest):**
|
||||
* **文件:** `src/tools/[tool_category]/index.ts` (例如: `src/tools/local-files/index.ts`)
|
||||
* **操作:**
|
||||
* 在 `ApiName` 对象(例如 `LocalFilesApiName`)中添加一个新的、唯一的 API 名称。
|
||||
* 在 `Manifest` 对象(例如 `LocalFilesManifest`)的 `api` 数组中,新增一个对象来定义新工具的接口。
|
||||
* **关键字段:**
|
||||
* `name`: 使用上一步定义的 API 名称。
|
||||
* `description`: 清晰描述工具的功能,供 Agent 理解和向用户展示。
|
||||
* `parameters`: 使用 JSON Schema 定义工具所需的输入参数。
|
||||
* `type`: 通常是 'object'。
|
||||
* `properties`: 定义每个参数的名称、`description`、`type` (string, number, boolean, array, etc.),使用英文。
|
||||
* `required`: 一个字符串数组,列出必须提供的参数名称。
|
||||
|
||||
2. **定义相关类型:**
|
||||
* **文件 1:** `packages/electron-client-ipc/src/types.ts` (或类似的共享 IPC 类型文件)
|
||||
* **操作:** 定义传递给 IPC 事件的参数类型接口 (例如: `RenameLocalFileParams`, `MoveLocalFileParams`)。确保与 Manifest 中定义的 `parameters` 一致。
|
||||
* **文件 2:** `src/tools/[tool_category]/type.ts` (例如: `src/tools/local-files/type.ts`)
|
||||
* **操作:** 定义此工具执行后,存储在前端 Zustand Store 中的状态类型接口 (例如: `LocalRenameFileState`, `LocalMoveFileState`)。这通常包含操作结果(成功/失败)、错误信息以及相关数据(如旧路径、新路径等)。
|
||||
|
||||
3. **实现前端状态管理 (Store Action):**
|
||||
* **文件:** `src/store/chat/slices/builtinTool/actions/[tool_category].ts` (例如: `src/store/chat/slices/builtinTool/actions/localFile.ts`)
|
||||
* **操作:**
|
||||
* 导入在步骤 2 中定义的 IPC 参数类型和状态类型。
|
||||
* 在 Action 接口 (例如: `LocalFileAction`) 中添加新 Action 的方法签名,使用对应的 IPC 参数类型。
|
||||
* 在 `createSlice` (例如: `localFileSlice`) 中实现该 Action 方法:
|
||||
* 接收 `id` (消息 ID) 和 `params` (符合 IPC 参数类型)。
|
||||
* 设置加载状态 (`toggleLocalFileLoading(id, true)`)。
|
||||
* 调用对应的 `Service` 层方法 (见步骤 4),传递 `params`。
|
||||
* 使用 `try...catch` 处理 `Service` 调用可能发生的错误。
|
||||
* **成功时:**
|
||||
* 调用 `updatePluginState(id, {...})` 更新插件状态,使用步骤 2 中定义的状态类型。
|
||||
* 调用 `internal_updateMessageContent(id, JSON.stringify({...}))` 更新消息内容,通常包含成功确认信息。
|
||||
* **失败时:**
|
||||
* 记录错误 (`console.error`)。
|
||||
* 调用 `updatePluginState(id, {...})` 更新插件状态,包含错误信息。
|
||||
* 调用 `internal_updateMessagePluginError(id, {...})` 设置消息的错误状态。
|
||||
* 调用 `internal_updateMessageContent(id, JSON.stringify({...}))` 更新消息内容,包含错误信息。
|
||||
* 在 `finally` 块中取消加载状态 (`toggleLocalFileLoading(id, false)`)。
|
||||
* 返回操作是否成功 (`boolean`)。
|
||||
|
||||
4. **实现 Service 层 (调用 IPC):**
|
||||
* **文件:** `src/services/electron/[tool_category]Service.ts` (例如: `src/services/electron/localFileService.ts`)
|
||||
* **操作:**
|
||||
* 导入在步骤 2 中定义的 IPC 参数类型。
|
||||
* 添加一个新的 `async` 方法,方法名通常与 Action 名称对应 (例如: `renameLocalFile`)。
|
||||
* 方法接收 `params` (符合 IPC 参数类型)。
|
||||
* 使用从 `@lobechat/electron-client-ipc` 导入的 `dispatch` (或 `invoke`) 函数,调用与 Manifest 中 `name` 字段匹配的 IPC 事件名称,并将 `params` 传递过去。
|
||||
* 定义方法的返回类型,通常是 `Promise<{ success: boolean; error?: string }>`,与后端 Controller 返回的结构一致。
|
||||
|
||||
5. **实现后端逻辑 (Controller / IPC Handler):**
|
||||
* **文件:** `apps/desktop/src/main/controllers/[ToolName]Ctr.ts` (例如: `apps/desktop/src/main/controllers/LocalFileCtr.ts`)
|
||||
* **操作:**
|
||||
* 导入 Node.js 相关模块 (`fs`, `path` 等) 和 IPC 相关依赖 (`ipcClientEvent`, 参数类型等)。
|
||||
* 添加一个新的 `async` 方法,方法名通常以 `handle` 开头 (例如: `handleRenameFile`)。
|
||||
* 使用 `@ipcClientEvent('yourApiName')` 装饰器将此方法注册为对应 IPC 事件的处理器,确保 `'yourApiName'` 与 Manifest 中的 `name` 和 Service 层调用的事件名称一致。
|
||||
* 方法的参数应解构自 Service 层传递过来的对象,类型与步骤 2 中定义的 IPC 参数类型匹配。
|
||||
* 实现核心业务逻辑:
|
||||
* 进行必要的输入验证。
|
||||
* 执行文件系统操作或其他后端任务 (例如: `fs.promises.rename`)。
|
||||
* 使用 `try...catch` 捕获执行过程中的错误。
|
||||
* 处理特定错误码 (`error.code`) 以提供更友好的错误消息。
|
||||
* 返回一个包含 `success` (boolean) 和可选 `error` (string) 字段的对象。
|
||||
|
||||
6. **更新 Agent 文档 (System Role):**
|
||||
* **文件:** `src/tools/[tool_category]/systemRole.ts` (例如: `src/tools/local-files/systemRole.ts`)
|
||||
* **操作:**
|
||||
* 在 `<core_capabilities>` 部分添加新工具的简要描述。
|
||||
* 如果需要,更新 `<workflow>`。
|
||||
* 在 `<tool_usage_guidelines>` 部分为新工具添加详细的使用说明,解释其参数、用途和预期行为。
|
||||
* 如有必要,更新 `<security_considerations>`。
|
||||
* 如有必要(例如工具返回了新的数据结构或路径),更新 `<response_format>` 中的示例。
|
||||
|
||||
通过遵循这些步骤,可以系统地将新的桌面端工具集成到 LobeChat 的插件系统中。
|
||||
@@ -1,197 +0,0 @@
|
||||
---
|
||||
description:
|
||||
globs:
|
||||
alwaysApply: false
|
||||
---
|
||||
**桌面端菜单配置指南**
|
||||
|
||||
## 菜单系统概述
|
||||
|
||||
LobeChat 桌面应用有三种主要的菜单类型:
|
||||
|
||||
1. **应用菜单 (App Menu)**:显示在应用窗口顶部(macOS)或窗口标题栏(Windows/Linux)
|
||||
2. **上下文菜单 (Context Menu)**:右键点击时显示的菜单
|
||||
3. **托盘菜单 (Tray Menu)**:点击系统托盘图标显示的菜单
|
||||
|
||||
## 菜单相关文件结构
|
||||
|
||||
```
|
||||
apps/desktop/src/main/
|
||||
├── menus/ # 菜单定义
|
||||
│ ├── appMenu.ts # 应用菜单配置
|
||||
│ ├── contextMenu.ts # 上下文菜单配置
|
||||
│ └── factory.ts # 菜单工厂函数
|
||||
├── controllers/
|
||||
│ ├── MenuCtr.ts # 菜单控制器
|
||||
│ └── TrayMenuCtr.ts # 托盘菜单控制器
|
||||
```
|
||||
|
||||
## 菜单配置流程
|
||||
|
||||
### 1. 应用菜单配置
|
||||
|
||||
应用菜单在 `apps/desktop/src/main/menus/appMenu.ts` 中定义:
|
||||
|
||||
1. **导入依赖**
|
||||
```typescript
|
||||
import { app, BrowserWindow, Menu, MenuItem, MenuItemConstructorOptions } from 'electron';
|
||||
import { is } from 'electron-util';
|
||||
```
|
||||
|
||||
2. **定义菜单项**
|
||||
- 使用 `MenuItemConstructorOptions` 类型定义菜单结构
|
||||
- 每个菜单项可以包含:label, accelerator (快捷键), role, submenu, click 等属性
|
||||
|
||||
3. **创建菜单工厂函数**
|
||||
```typescript
|
||||
export const createAppMenu = (win: BrowserWindow) => {
|
||||
const template = [
|
||||
// 定义菜单项...
|
||||
];
|
||||
|
||||
return Menu.buildFromTemplate(template);
|
||||
};
|
||||
```
|
||||
|
||||
4. **注册菜单**
|
||||
- 在 `MenuCtr.ts` 控制器中使用 `Menu.setApplicationMenu(menu)` 设置应用菜单
|
||||
|
||||
### 2. 上下文菜单配置
|
||||
|
||||
上下文菜单通常在特定元素上右键点击时显示:
|
||||
|
||||
1. **在主进程中定义菜单模板**
|
||||
```typescript
|
||||
// apps/desktop/src/main/menus/contextMenu.ts
|
||||
export const createContextMenu = () => {
|
||||
const template = [
|
||||
// 定义菜单项...
|
||||
];
|
||||
|
||||
return Menu.buildFromTemplate(template);
|
||||
};
|
||||
```
|
||||
|
||||
2. **在适当的事件处理器中显示菜单**
|
||||
```typescript
|
||||
const menu = createContextMenu();
|
||||
menu.popup();
|
||||
```
|
||||
|
||||
### 3. 托盘菜单配置
|
||||
|
||||
托盘菜单在 `TrayMenuCtr.ts` 中配置:
|
||||
|
||||
1. **创建托盘图标**
|
||||
```typescript
|
||||
this.tray = new Tray(trayIconPath);
|
||||
```
|
||||
|
||||
2. **定义托盘菜单**
|
||||
```typescript
|
||||
const contextMenu = Menu.buildFromTemplate([
|
||||
{ label: '显示主窗口', click: this.showMainWindow },
|
||||
{ type: 'separator' },
|
||||
{ label: '退出', click: () => app.quit() },
|
||||
]);
|
||||
```
|
||||
|
||||
3. **设置托盘菜单**
|
||||
```typescript
|
||||
this.tray.setContextMenu(contextMenu);
|
||||
```
|
||||
|
||||
## 多语言支持
|
||||
|
||||
为菜单添加多语言支持:
|
||||
|
||||
1. **导入本地化工具**
|
||||
```typescript
|
||||
import { i18n } from '../locales';
|
||||
```
|
||||
|
||||
2. **使用翻译函数**
|
||||
```typescript
|
||||
const template = [
|
||||
{
|
||||
label: i18n.t('menu.file'),
|
||||
submenu: [
|
||||
{ label: i18n.t('menu.new'), click: createNew },
|
||||
// ...
|
||||
]
|
||||
},
|
||||
// ...
|
||||
];
|
||||
```
|
||||
|
||||
3. **在语言切换时更新菜单**
|
||||
在 `MenuCtr.ts` 中监听语言变化事件并重新创建菜单
|
||||
|
||||
## 添加新菜单项流程
|
||||
|
||||
1. **确定菜单位置**
|
||||
- 决定添加到哪个菜单(应用菜单、上下文菜单或托盘菜单)
|
||||
- 确定在菜单中的位置(主菜单项或子菜单项)
|
||||
|
||||
2. **定义菜单项**
|
||||
```typescript
|
||||
const newMenuItem: MenuItemConstructorOptions = {
|
||||
label: '新功能',
|
||||
accelerator: 'CmdOrCtrl+N',
|
||||
click: (_, window) => {
|
||||
// 处理点击事件
|
||||
if (window) window.webContents.send('trigger-new-feature');
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
3. **添加到菜单模板**
|
||||
将新菜单项添加到相应的菜单模板中
|
||||
|
||||
4. **对于与渲染进程交互的功能**
|
||||
- 使用 `window.webContents.send()` 发送 IPC 消息到渲染进程
|
||||
- 在渲染进程中监听该消息并处理
|
||||
|
||||
## 菜单项启用/禁用控制
|
||||
|
||||
动态控制菜单项状态:
|
||||
|
||||
1. **保存对菜单项的引用**
|
||||
```typescript
|
||||
this.menuItems = {};
|
||||
const menu = Menu.buildFromTemplate(template);
|
||||
this.menuItems.newFeature = menu.getMenuItemById('new-feature');
|
||||
```
|
||||
|
||||
2. **根据条件更新状态**
|
||||
```typescript
|
||||
updateMenuState(state) {
|
||||
if (this.menuItems.newFeature) {
|
||||
this.menuItems.newFeature.enabled = state.canUseNewFeature;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 最佳实践
|
||||
|
||||
1. **使用标准角色**
|
||||
- 尽可能使用 Electron 预定义的角色(如 `role: 'copy'`)以获得本地化和一致的行为
|
||||
|
||||
2. **平台特定菜单**
|
||||
- 使用 `process.platform` 检查为不同平台提供不同菜单
|
||||
```typescript
|
||||
if (process.platform === 'darwin') {
|
||||
template.unshift({ role: 'appMenu' });
|
||||
}
|
||||
```
|
||||
|
||||
3. **快捷键冲突**
|
||||
- 避免与系统快捷键冲突
|
||||
- 使用 `CmdOrCtrl` 代替 `Ctrl` 以支持 macOS 和 Windows/Linux
|
||||
|
||||
4. **保持菜单简洁**
|
||||
- 避免过多嵌套的子菜单
|
||||
- 将相关功能分组在一起
|
||||
|
||||
5. **添加分隔符**
|
||||
- 使用 `{ type: 'separator' }` 在逻辑上分隔不同组的菜单项
|
||||
@@ -1,296 +0,0 @@
|
||||
---
|
||||
description:
|
||||
globs:
|
||||
alwaysApply: false
|
||||
---
|
||||
**桌面端窗口管理指南**
|
||||
|
||||
## 窗口管理概述
|
||||
|
||||
LobeChat 桌面应用使用 Electron 的 `BrowserWindow` 管理应用窗口。主要的窗口管理功能包括:
|
||||
|
||||
1. **窗口创建和配置**
|
||||
2. **窗口状态管理**(大小、位置、最大化等)
|
||||
3. **多窗口协调**
|
||||
4. **窗口事件处理**
|
||||
|
||||
## 相关文件结构
|
||||
|
||||
```
|
||||
apps/desktop/src/main/
|
||||
├── appBrowsers.ts # 窗口管理的核心文件
|
||||
├── controllers/
|
||||
│ └── BrowserWindowsCtr.ts # 窗口控制器
|
||||
└── modules/
|
||||
└── browserWindowManager.ts # 窗口管理模块
|
||||
```
|
||||
|
||||
## 窗口管理流程
|
||||
|
||||
### 1. 窗口创建
|
||||
|
||||
在 `appBrowsers.ts` 或 `BrowserWindowsCtr.ts` 中定义窗口创建逻辑:
|
||||
|
||||
```typescript
|
||||
export const createMainWindow = () => {
|
||||
const mainWindow = new BrowserWindow({
|
||||
width: 1200,
|
||||
height: 800,
|
||||
minWidth: 600,
|
||||
minHeight: 400,
|
||||
webPreferences: {
|
||||
preload: path.join(__dirname, '../preload/index.js'),
|
||||
contextIsolation: true,
|
||||
nodeIntegration: false,
|
||||
},
|
||||
// 其他窗口配置项...
|
||||
});
|
||||
|
||||
// 加载应用内容
|
||||
if (isDev) {
|
||||
mainWindow.loadURL('http://localhost:3000');
|
||||
mainWindow.webContents.openDevTools();
|
||||
} else {
|
||||
mainWindow.loadFile(path.join(__dirname, '../../renderer/index.html'));
|
||||
}
|
||||
|
||||
return mainWindow;
|
||||
};
|
||||
```
|
||||
|
||||
### 2. 窗口状态管理
|
||||
|
||||
实现窗口状态持久化保存和恢复:
|
||||
|
||||
1. **保存窗口状态**
|
||||
```typescript
|
||||
const saveWindowState = (window: BrowserWindow) => {
|
||||
if (!window.isMinimized() && !window.isMaximized()) {
|
||||
const position = window.getPosition();
|
||||
const size = window.getSize();
|
||||
|
||||
settings.set('windowState', {
|
||||
x: position[0],
|
||||
y: position[1],
|
||||
width: size[0],
|
||||
height: size[1],
|
||||
});
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
2. **恢复窗口状态**
|
||||
```typescript
|
||||
const restoreWindowState = (window: BrowserWindow) => {
|
||||
const savedState = settings.get('windowState');
|
||||
|
||||
if (savedState) {
|
||||
window.setBounds({
|
||||
x: savedState.x,
|
||||
y: savedState.y,
|
||||
width: savedState.width,
|
||||
height: savedState.height,
|
||||
});
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
3. **监听窗口事件**
|
||||
```typescript
|
||||
window.on('close', () => saveWindowState(window));
|
||||
window.on('moved', () => saveWindowState(window));
|
||||
window.on('resized', () => saveWindowState(window));
|
||||
```
|
||||
|
||||
### 3. 实现多窗口管理
|
||||
|
||||
对于需要多窗口支持的功能:
|
||||
|
||||
1. **跟踪窗口**
|
||||
```typescript
|
||||
export class WindowManager {
|
||||
private windows: Map<string, BrowserWindow> = new Map();
|
||||
|
||||
createWindow(id: string, options: BrowserWindowConstructorOptions) {
|
||||
const window = new BrowserWindow(options);
|
||||
this.windows.set(id, window);
|
||||
|
||||
window.on('closed', () => {
|
||||
this.windows.delete(id);
|
||||
});
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
getWindow(id: string) {
|
||||
return this.windows.get(id);
|
||||
}
|
||||
|
||||
getAllWindows() {
|
||||
return Array.from(this.windows.values());
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
2. **窗口间通信**
|
||||
```typescript
|
||||
// 从一个窗口向另一个窗口发送消息
|
||||
sendMessageToWindow(targetWindowId, channel, data) {
|
||||
const targetWindow = this.getWindow(targetWindowId);
|
||||
if (targetWindow) {
|
||||
targetWindow.webContents.send(channel, data);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 4. 窗口与渲染进程通信
|
||||
|
||||
通过 IPC 实现窗口操作:
|
||||
|
||||
1. **在主进程中注册 IPC 处理器**
|
||||
```typescript
|
||||
// BrowserWindowsCtr.ts
|
||||
@ipcClientEvent('minimizeWindow')
|
||||
handleMinimizeWindow() {
|
||||
const focusedWindow = BrowserWindow.getFocusedWindow();
|
||||
if (focusedWindow) {
|
||||
focusedWindow.minimize();
|
||||
}
|
||||
return { success: true };
|
||||
}
|
||||
|
||||
@ipcClientEvent('maximizeWindow')
|
||||
handleMaximizeWindow() {
|
||||
const focusedWindow = BrowserWindow.getFocusedWindow();
|
||||
if (focusedWindow) {
|
||||
if (focusedWindow.isMaximized()) {
|
||||
focusedWindow.restore();
|
||||
} else {
|
||||
focusedWindow.maximize();
|
||||
}
|
||||
}
|
||||
return { success: true };
|
||||
}
|
||||
|
||||
@ipcClientEvent('closeWindow')
|
||||
handleCloseWindow() {
|
||||
const focusedWindow = BrowserWindow.getFocusedWindow();
|
||||
if (focusedWindow) {
|
||||
focusedWindow.close();
|
||||
}
|
||||
return { success: true };
|
||||
}
|
||||
```
|
||||
|
||||
2. **在渲染进程中调用**
|
||||
```typescript
|
||||
// src/services/electron/windowService.ts
|
||||
import { dispatch } from '@lobechat/electron-client-ipc';
|
||||
|
||||
export const windowService = {
|
||||
minimize: () => dispatch('minimizeWindow'),
|
||||
maximize: () => dispatch('maximizeWindow'),
|
||||
close: () => dispatch('closeWindow'),
|
||||
};
|
||||
```
|
||||
|
||||
### 5. 自定义窗口控制 (无边框窗口)
|
||||
|
||||
对于自定义窗口标题栏:
|
||||
|
||||
1. **创建无边框窗口**
|
||||
```typescript
|
||||
const window = new BrowserWindow({
|
||||
frame: false,
|
||||
titleBarStyle: 'hidden',
|
||||
// 其他选项...
|
||||
});
|
||||
```
|
||||
|
||||
2. **在渲染进程中实现拖拽区域**
|
||||
```css
|
||||
/* CSS */
|
||||
.titlebar {
|
||||
-webkit-app-region: drag;
|
||||
}
|
||||
|
||||
.titlebar-button {
|
||||
-webkit-app-region: no-drag;
|
||||
}
|
||||
```
|
||||
|
||||
## 最佳实践
|
||||
|
||||
1. **性能考虑**
|
||||
- 避免创建过多窗口
|
||||
- 使用 `show: false` 创建窗口,在内容加载完成后再显示,避免白屏
|
||||
|
||||
2. **安全性**
|
||||
- 始终设置适当的 `webPreferences` 确保安全
|
||||
```typescript
|
||||
webPreferences: {
|
||||
preload: path.join(__dirname, '../preload/index.js'),
|
||||
contextIsolation: true,
|
||||
nodeIntegration: false,
|
||||
sandbox: true,
|
||||
}
|
||||
```
|
||||
|
||||
3. **跨平台兼容性**
|
||||
- 考虑不同操作系统的窗口行为差异
|
||||
- 使用 `process.platform` 为不同平台提供特定实现
|
||||
|
||||
4. **崩溃恢复**
|
||||
- 监听 `webContents.on('crashed')` 事件处理崩溃
|
||||
- 提供崩溃恢复选项
|
||||
|
||||
5. **内存管理**
|
||||
- 确保窗口关闭时清理所有相关资源
|
||||
- 使用 `window.on('closed')` 而不是 `window.on('close')` 进行最终清理
|
||||
|
||||
## 示例:创建设置窗口
|
||||
|
||||
```typescript
|
||||
// apps/desktop/src/main/controllers/BrowserWindowsCtr.ts
|
||||
|
||||
@ipcClientEvent('openSettings')
|
||||
handleOpenSettings() {
|
||||
// 检查设置窗口是否已经存在
|
||||
if (this.settingsWindow && !this.settingsWindow.isDestroyed()) {
|
||||
// 如果窗口已存在,将其置于前台
|
||||
this.settingsWindow.focus();
|
||||
return { success: true };
|
||||
}
|
||||
|
||||
// 创建新窗口
|
||||
this.settingsWindow = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
title: 'Settings',
|
||||
parent: this.mainWindow, // 设置父窗口,使其成为模态窗口
|
||||
modal: true,
|
||||
webPreferences: {
|
||||
preload: path.join(__dirname, '../preload/index.js'),
|
||||
contextIsolation: true,
|
||||
nodeIntegration: false,
|
||||
},
|
||||
});
|
||||
|
||||
// 加载设置页面
|
||||
if (isDev) {
|
||||
this.settingsWindow.loadURL('http://localhost:3000/settings');
|
||||
} else {
|
||||
this.settingsWindow.loadFile(
|
||||
path.join(__dirname, '../../renderer/index.html'),
|
||||
{ hash: 'settings' }
|
||||
);
|
||||
}
|
||||
|
||||
// 监听窗口关闭事件
|
||||
this.settingsWindow.on('closed', () => {
|
||||
this.settingsWindow = null;
|
||||
});
|
||||
|
||||
return { success: true };
|
||||
}
|
||||
```
|
||||
@@ -1,202 +0,0 @@
|
||||
---
|
||||
description:
|
||||
globs: src/database/schemas/*
|
||||
alwaysApply: false
|
||||
---
|
||||
# Drizzle ORM Schema Style Guide for lobe-chat
|
||||
|
||||
This document outlines the conventions and best practices for defining PostgreSQL Drizzle ORM schemas within the lobe-chat project.
|
||||
|
||||
## Configuration
|
||||
|
||||
- Drizzle configuration is managed in [drizzle.config.ts](mdc:drizzle.config.ts)
|
||||
- Schema files are located in the src/database/schemas/ directory
|
||||
- Migration files are output to `src/database/migrations/`
|
||||
- The project uses `postgresql` dialect with `strict: true`
|
||||
|
||||
## Helper Functions
|
||||
|
||||
Commonly used column definitions, especially for timestamps, are centralized in [src/database/schemas/_helpers.ts](mdc:src/database/schemas/_helpers.ts):
|
||||
- `timestamptz(name: string)`: Creates a timestamp column with timezone
|
||||
- `createdAt()`, `updatedAt()`, `accessedAt()`: Helper functions for standard timestamp columns
|
||||
- `timestamps`: An object `{ createdAt, updatedAt, accessedAt }` for easy inclusion in table definitions
|
||||
|
||||
## Naming Conventions
|
||||
|
||||
- **Table Names**: Use plural snake_case (e.g., `users`, `agents`, `session_groups`)
|
||||
- **Column Names**: Use snake_case (e.g., `user_id`, `created_at`, `background_color`)
|
||||
|
||||
## Column Definitions
|
||||
|
||||
### Primary Keys (PKs)
|
||||
- Typically `text('id')` (or `varchar('id')` for some OIDC tables)
|
||||
- Often use `.$defaultFn(() => idGenerator('table_name'))` for automatic ID generation with meaningful prefixes
|
||||
- **ID Prefix Purpose**: Makes it easy for users and developers to distinguish different entity types at a glance
|
||||
- For internal/system tables that users don't need to see, can use `uuid` or auto-increment keys
|
||||
- Composite PKs are defined using `primaryKey({ columns: [t.colA, t.colB] })`
|
||||
|
||||
### Foreign Keys (FKs)
|
||||
- Defined using `.references(() => otherTable.id, { onDelete: 'cascade' | 'set null' | 'no action' })`
|
||||
- FK columns are usually named `related_table_singular_name_id` (e.g., `user_id` references `users.id`)
|
||||
- Most tables include a `user_id` column referencing `users.id` with `onDelete: 'cascade'`
|
||||
|
||||
### Timestamps
|
||||
- Consistently use the `...timestamps` spread from [_helpers.ts](mdc:src/database/schemas/_helpers.ts) for `created_at`, `updated_at`, and `accessed_at` columns
|
||||
|
||||
### Default Values
|
||||
- `.$defaultFn(() => expression)` for dynamic defaults (e.g., `idGenerator()`, `randomSlug()`)
|
||||
- `.default(staticValue)` for static defaults (e.g., `boolean('enabled').default(true)`)
|
||||
|
||||
### Indexes
|
||||
- Defined in the table's second argument: `pgTable('name', {...columns}, (t) => ({ indexName: indexType().on(...) }))`
|
||||
- Use `uniqueIndex()` for unique constraints and `index()` for non-unique indexes
|
||||
- Naming pattern: `table_name_column(s)_idx` or `table_name_column(s)_unique`
|
||||
- Many tables feature a `clientId: text('client_id')` column, often part of a composite unique index with `user_id`
|
||||
|
||||
### Data Types
|
||||
- Common types: `text`, `varchar`, `jsonb`, `boolean`, `integer`, `uuid`, `pgTable`
|
||||
- For `jsonb` fields, specify the TypeScript type using `.$type<MyType>()` for better type safety
|
||||
|
||||
## Zod Schemas & Type Inference
|
||||
|
||||
- Utilize `drizzle-zod` to generate Zod schemas for validation:
|
||||
- `createInsertSchema(tableName)`
|
||||
- `createSelectSchema(tableName)` (less common)
|
||||
- Export inferred types: `export type NewEntity = typeof tableName.$inferInsert;` and `export type EntityItem = typeof tableName.$inferSelect;`
|
||||
|
||||
## Relations
|
||||
|
||||
- Table relationships are defined centrally in [src/database/schemas/relations.ts](mdc:src/database/schemas/relations.ts) using the `relations()` utility from `drizzle-orm`
|
||||
|
||||
## Code Style & Structure
|
||||
|
||||
- **File Organization**: Each main database entity typically has its own schema file (e.g., [user.ts](mdc:src/database/schemas/user.ts), [agent.ts](mdc:src/database/schemas/agent.ts))
|
||||
- All schemas are re-exported from [src/database/schemas/index.ts](mdc:src/database/schemas/index.ts)
|
||||
- **ESLint**: Files often start with `/* eslint-disable sort-keys-fix/sort-keys-fix */`
|
||||
- **Comments**: Use JSDoc-style comments to explain the purpose of tables and complex columns, fields that are self-explanatory do not require jsdoc explanations, such as id, user_id, etc.
|
||||
|
||||
## Example Pattern
|
||||
|
||||
```typescript
|
||||
// From src/database/schemas/agent.ts
|
||||
export const agents = pgTable(
|
||||
'agents',
|
||||
{
|
||||
id: text('id')
|
||||
.primaryKey()
|
||||
.$defaultFn(() => idGenerator('agents'))
|
||||
.notNull(),
|
||||
slug: varchar('slug', { length: 100 })
|
||||
.$defaultFn(() => randomSlug(4))
|
||||
.unique(),
|
||||
userId: text('user_id')
|
||||
.references(() => users.id, { onDelete: 'cascade' })
|
||||
.notNull(),
|
||||
clientId: text('client_id'),
|
||||
chatConfig: jsonb('chat_config').$type<LobeAgentChatConfig>(),
|
||||
...timestamps,
|
||||
},
|
||||
// return array instead of object, the object style is deprecated
|
||||
(t) => [
|
||||
uniqueIndex('client_id_user_id_unique').on(t.clientId, t.userId),
|
||||
],
|
||||
);
|
||||
|
||||
export const insertAgentSchema = createInsertSchema(agents);
|
||||
export type NewAgent = typeof agents.$inferInsert;
|
||||
export type AgentItem = typeof agents.$inferSelect;
|
||||
```
|
||||
|
||||
## Common Patterns
|
||||
|
||||
### 1. userId + clientId Pattern (Legacy)
|
||||
Some existing tables include both fields for different purposes:
|
||||
|
||||
```typescript
|
||||
// Example from agents table (legacy pattern)
|
||||
userId: text('user_id')
|
||||
.references(() => users.id, { onDelete: 'cascade' })
|
||||
.notNull(),
|
||||
clientId: text('client_id'),
|
||||
|
||||
// Usually with a composite unique index
|
||||
clientIdUnique: uniqueIndex('agents_client_id_user_id_unique').on(t.clientId, t.userId),
|
||||
```
|
||||
|
||||
- **`userId`**: Server-side user association, ensures data belongs to specific user
|
||||
- **`clientId`**: Unique key for import/export operations, supports data migration between instances
|
||||
- **Current Status**: New tables should NOT include `clientId` unless specifically needed for import/export functionality
|
||||
- **Note**: This pattern is being phased out for new features to simplify the schema
|
||||
|
||||
### 2. Junction Tables (Many-to-Many Relationships)
|
||||
Use composite primary keys for relationship tables:
|
||||
|
||||
```typescript
|
||||
// Example: agents_knowledge_bases (from agent.ts)
|
||||
export const agentsKnowledgeBases = pgTable(
|
||||
'agents_knowledge_bases',
|
||||
{
|
||||
agentId: text('agent_id').references(() => agents.id, { onDelete: 'cascade' }).notNull(),
|
||||
knowledgeBaseId: text('knowledge_base_id').references(() => knowledgeBases.id, { onDelete: 'cascade' }).notNull(),
|
||||
userId: text('user_id').references(() => users.id, { onDelete: 'cascade' }).notNull(),
|
||||
enabled: boolean('enabled').default(true),
|
||||
...timestamps,
|
||||
},
|
||||
(t) => [
|
||||
primaryKey({ columns: [t.agentId, t.knowledgeBaseId] }),
|
||||
],
|
||||
);
|
||||
```
|
||||
|
||||
**Pattern**: `{entity1}Id` + `{entity2}Id` as composite PK, plus `userId` for ownership
|
||||
|
||||
### 3. OIDC Tables Special Patterns
|
||||
OIDC tables use `varchar` IDs instead of `text` with custom generators:
|
||||
|
||||
```typescript
|
||||
// Example from oidc.ts
|
||||
export const oidcAuthorizationCodes = pgTable('oidc_authorization_codes', {
|
||||
id: varchar('id', { length: 255 }).primaryKey(), // varchar not text
|
||||
data: jsonb('data').notNull(),
|
||||
expiresAt: timestamptz('expires_at').notNull(),
|
||||
// ... other fields
|
||||
});
|
||||
```
|
||||
|
||||
**Reason**: OIDC standards expect specific ID formats and lengths
|
||||
|
||||
### 4. File Processing with Async Tasks
|
||||
File-related tables reference async task IDs for background processing:
|
||||
|
||||
```typescript
|
||||
// Example from files table
|
||||
export const files = pgTable('files', {
|
||||
// ... other fields
|
||||
chunkTaskId: uuid('chunk_task_id').references(() => asyncTasks.id, { onDelete: 'set null' }),
|
||||
embeddingTaskId: uuid('embedding_task_id').references(() => asyncTasks.id, { onDelete: 'set null' }),
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
**Purpose**:
|
||||
- Track file chunking progress (breaking files into smaller pieces)
|
||||
- Track embedding generation progress (converting text to vectors)
|
||||
- Allow querying task status and handling failures
|
||||
|
||||
### 5. Slug Pattern (Legacy)
|
||||
Some entities include auto-generated slugs - this is legacy code:
|
||||
|
||||
```typescript
|
||||
slug: varchar('slug', { length: 100 })
|
||||
.$defaultFn(() => randomSlug(4))
|
||||
.unique(),
|
||||
|
||||
// Often with composite unique constraint
|
||||
slugUserIdUnique: uniqueIndex('slug_user_id_unique').on(t.slug, t.userId),
|
||||
```
|
||||
|
||||
**Current usage**: Only used to identify default agents/sessions (legacy pattern)
|
||||
**Future refactor**: Will likely be replaced with `isDefault: boolean()` field
|
||||
**Note**: Avoid using slugs for new features - prefer explicit boolean flags for status tracking
|
||||
|
||||
By following these guidelines, maintain consistency, type safety, and maintainability across database schema definitions.
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
description:
|
||||
globs: src/locales/**/*
|
||||
alwaysApply: false
|
||||
---
|
||||
read [i18n.mdc](mdc:.cursor/rules/i18n/i18n.mdc)
|
||||
@@ -1,183 +0,0 @@
|
||||
---
|
||||
description: i18n workflow and troubleshooting
|
||||
globs:
|
||||
alwaysApply: false
|
||||
---
|
||||
# LobeChat Internationalization (i18n) Guide
|
||||
|
||||
## Architecture Overview
|
||||
|
||||
LobeChat uses **react-i18next** for internationalization with a well-structured namespace approach:
|
||||
|
||||
- **Default language**: Chinese (zh-CN) - serves as the source language
|
||||
- **Supported locales**: 18 languages including English, Japanese, Korean, Arabic, etc.
|
||||
- **Framework**: react-i18next with Next.js app router
|
||||
- **Translation automation**: [@lobehub/i18n-cli](mdc:package.json) for automated translations, config file: .i18nrc.js
|
||||
|
||||
## Directory Structure
|
||||
|
||||
```
|
||||
src/locales/
|
||||
├── default/ # Source language files (zh-CN)
|
||||
│ ├── index.ts # Namespace exports
|
||||
│ ├── common.ts # Common translations
|
||||
│ ├── chat.ts # Chat-related translations
|
||||
│ ├── setting.ts # Settings translations
|
||||
│ └── ... # Other namespace files
|
||||
└── resources.ts # Type definitions and locale config
|
||||
|
||||
locales/ # Translated files
|
||||
├── en-US/ # English translations
|
||||
│ ├── common.json # Common translations
|
||||
│ ├── chat.json # Chat translations
|
||||
│ ├── setting.json # Settings translations
|
||||
│ └── ... # Other namespace JSON files
|
||||
├── ja-JP/ # Japanese translations
|
||||
│ ├── common.json
|
||||
│ ├── chat.json
|
||||
│ └── ...
|
||||
└── ... # Other language folders
|
||||
```
|
||||
|
||||
## Workflow for Adding New Translations
|
||||
|
||||
### 1. Add New Translation Keys
|
||||
|
||||
**Step 1**: Add translation key to the appropriate namespace file in [src/locales/default/](mdc:src/locales/default)
|
||||
|
||||
```typescript
|
||||
// Example: src/locales/default/common.ts
|
||||
export default {
|
||||
// ... existing keys
|
||||
newFeature: {
|
||||
title: "新功能标题",
|
||||
description: "功能描述文案",
|
||||
button: "操作按钮",
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
**Step 2**: If creating a new namespace, export it in [src/locales/default/index.ts](mdc:src/locales/default/index.ts)
|
||||
|
||||
```typescript
|
||||
import newNamespace from "./newNamespace";
|
||||
|
||||
const resources = {
|
||||
// ... existing namespaces
|
||||
newNamespace,
|
||||
} as const;
|
||||
```
|
||||
|
||||
### 2. Translation Process
|
||||
|
||||
**Development Mode** (Recommended):
|
||||
|
||||
- Manually add Chinese translations to corresponding JSON files in `locales/zh-CN/namespace.json`, this avoids running slow automation during development
|
||||
- Don't auto add translations for other language like English etc, most of developer is Chinese,
|
||||
|
||||
**Production Mode**:
|
||||
|
||||
```bash
|
||||
# Generate translations for all languages
|
||||
npm run i18n
|
||||
```
|
||||
|
||||
## Usage in Components
|
||||
|
||||
### Basic Usage with Hooks
|
||||
|
||||
```tsx
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
const MyComponent = () => {
|
||||
const { t } = useTranslation("common"); // namespace
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h1>{t("newFeature.title")}</h1>
|
||||
<p>{t("newFeature.description")}</p>
|
||||
<button>{t("newFeature.button")}</button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
```
|
||||
|
||||
### With Parameters
|
||||
|
||||
```tsx
|
||||
const { t } = useTranslation("common");
|
||||
|
||||
// Translation key with interpolation
|
||||
<p>{t("welcome.message", { name: "John" })}</p>;
|
||||
|
||||
// Corresponding locale file:
|
||||
// welcome: { message: '欢迎 {{name}} 使用!' }
|
||||
```
|
||||
|
||||
### Multiple Namespaces
|
||||
|
||||
```tsx
|
||||
const { t } = useTranslation(['common', 'chat']);
|
||||
|
||||
// Access different namespaces
|
||||
<button>{t('common:save')}</button>
|
||||
<span>{t('chat:typing')}</span>
|
||||
```
|
||||
|
||||
## Type Safety
|
||||
|
||||
The project uses TypeScript for type-safe translations with auto-generated types from [src/locales/resources.ts](mdc:src/locales/resources.ts):
|
||||
|
||||
```typescript
|
||||
import type { DefaultResources, NS, Locales } from "@/locales/resources";
|
||||
|
||||
// Available types:
|
||||
// - NS: Available namespace keys ('common' | 'chat' | 'setting' | ...)
|
||||
// - Locales: Supported locale codes ('en-US' | 'zh-CN' | 'ja-JP' | ...)
|
||||
|
||||
// Type-safe namespace usage
|
||||
const namespace: NS = "common"; // ✅ Valid
|
||||
const locale: Locales = "en-US"; // ✅ Valid
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
### 1. Namespace Organization
|
||||
|
||||
- **common**: Shared UI elements (buttons, labels, actions)
|
||||
- **chat**: Chat-specific features
|
||||
- **setting**: Configuration and settings
|
||||
- **error**: Error messages and handling
|
||||
- **[feature]**: Feature-specific or page specific namespaces
|
||||
|
||||
### 2. Key Naming Conventions
|
||||
|
||||
```typescript
|
||||
// ✅ Good: Hierarchical structure
|
||||
export default {
|
||||
modal: {
|
||||
confirm: {
|
||||
title: "确认操作",
|
||||
message: "确定要执行此操作吗?",
|
||||
actions: {
|
||||
confirm: "确认",
|
||||
cancel: "取消",
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
// ❌ Avoid: Flat structure
|
||||
export default {
|
||||
modalConfirmTitle: "确认操作",
|
||||
modalConfirmMessage: "确定要执行此操作吗?",
|
||||
};
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Missing Translation Keys
|
||||
|
||||
- Check if the key exists in src/locales/default/namespace.ts
|
||||
- Ensure proper namespace import in component
|
||||
- Ensure new namespaces are exported in [src/locales/default/index.ts](mdc:src/locales/default/index.ts)
|
||||
@@ -1,72 +0,0 @@
|
||||
---
|
||||
description: @lobehub/ui components list
|
||||
globs:
|
||||
alwaysApply: false
|
||||
---
|
||||
## @lobehub/ui Components
|
||||
|
||||
- General
|
||||
ActionIcon
|
||||
ActionIconGroup
|
||||
Block
|
||||
Button
|
||||
Icon
|
||||
- Data Display
|
||||
Avatar
|
||||
Collapse
|
||||
FileTypeIcon
|
||||
FluentEmoji
|
||||
GuideCard
|
||||
Highlighter
|
||||
Hotkey
|
||||
Image
|
||||
List
|
||||
Markdown
|
||||
MaterialFileTypeIcon
|
||||
Mermaid
|
||||
Segmented
|
||||
Snippet
|
||||
SortableList
|
||||
Tag
|
||||
Tooltip
|
||||
Video
|
||||
- Data Entry
|
||||
AutoComplete
|
||||
CodeEditor
|
||||
ColorSwatches
|
||||
CopyButton
|
||||
DatePicker
|
||||
EditableText
|
||||
EmojiPicker
|
||||
Form
|
||||
FormModal
|
||||
HotkeyInput
|
||||
ImageSelect
|
||||
Input
|
||||
SearchBar
|
||||
Select
|
||||
SliderWithInput
|
||||
ThemeSwitch
|
||||
- Feedback
|
||||
Alert
|
||||
Drawer
|
||||
Modal
|
||||
- Layout
|
||||
DraggablePanel
|
||||
Footer
|
||||
Grid
|
||||
Header
|
||||
Layout
|
||||
MaskShadow
|
||||
ScrollShadow
|
||||
- Navigation
|
||||
Burger
|
||||
Dropdown
|
||||
Menu
|
||||
SideNav
|
||||
Tabs
|
||||
Toc
|
||||
- Theme
|
||||
ConfigProvider
|
||||
FontLoader
|
||||
ThemeProvider
|
||||
@@ -1,126 +0,0 @@
|
||||
---
|
||||
description: react flex layout package `react-layout-kit` usage
|
||||
globs:
|
||||
alwaysApply: false
|
||||
---
|
||||
# React Layout Kit 使用指南
|
||||
|
||||
`react-layout-kit` 是一个功能丰富的 React flex 布局组件库,在 lobe-chat 项目中被广泛使用。以下是重点组件的使用方法:
|
||||
|
||||
## Flexbox 组件
|
||||
|
||||
Flexbox 是最常用的布局组件,用于创建弹性布局,类似于 CSS 的 `display: flex`。
|
||||
|
||||
### 基本用法
|
||||
|
||||
```jsx
|
||||
import { Flexbox } from 'react-layout-kit';
|
||||
|
||||
// 默认垂直布局
|
||||
<Flexbox>
|
||||
<div>子元素1</div>
|
||||
<div>子元素2</div>
|
||||
</Flexbox>
|
||||
|
||||
// 水平布局
|
||||
<Flexbox horizontal>
|
||||
<div>左侧元素</div>
|
||||
<div>右侧元素</div>
|
||||
</Flexbox>
|
||||
```
|
||||
|
||||
### 常用属性
|
||||
|
||||
- `horizontal`: 布尔值,设置为水平方向布局
|
||||
- `flex`: 数值或字符串,控制 flex 属性
|
||||
- `gap`: 数值,设置子元素之间的间距
|
||||
- `align`: 对齐方式,如 'center', 'flex-start' 等
|
||||
- `justify`: 主轴对齐方式,如 'space-between', 'center' 等
|
||||
- `padding`: 内边距值
|
||||
- `paddingInline`: 水平内边距值
|
||||
- `paddingBlock`: 垂直内边距值
|
||||
- `width/height`: 设置宽高,通常用 `'100%'` 或具体像素值
|
||||
- `style`: 自定义样式对象
|
||||
|
||||
### 实际应用示例
|
||||
|
||||
```jsx
|
||||
// 经典三栏布局
|
||||
<Flexbox horizontal height={'100%'} width={'100%'}>
|
||||
{/* 左侧边栏 */}
|
||||
<Flexbox
|
||||
width={260}
|
||||
style={{
|
||||
borderRight: `1px solid ${theme.colorBorderSecondary}`,
|
||||
height: '100%',
|
||||
overflowY: 'auto',
|
||||
}}
|
||||
>
|
||||
<SidebarContent />
|
||||
</Flexbox>
|
||||
|
||||
{/* 中间内容区 */}
|
||||
<Flexbox
|
||||
flex={1}
|
||||
style={{
|
||||
height: '100%',
|
||||
}}
|
||||
>
|
||||
{/* 主要内容 */}
|
||||
<Flexbox flex={1} padding={24} style={{ overflowY: 'auto' }}>
|
||||
<MainContent />
|
||||
</Flexbox>
|
||||
|
||||
{/* 底部区域 */}
|
||||
<Flexbox
|
||||
style={{
|
||||
borderTop: `1px solid ${theme.colorBorderSecondary}`,
|
||||
padding: '16px 24px',
|
||||
}}
|
||||
>
|
||||
<Footer />
|
||||
</Flexbox>
|
||||
</Flexbox>
|
||||
</Flexbox>
|
||||
```
|
||||
|
||||
## Center 组件
|
||||
|
||||
Center 是对 Flexbox 的封装,使子元素水平和垂直居中。
|
||||
|
||||
### 基本用法
|
||||
|
||||
```jsx
|
||||
import { Center } from 'react-layout-kit';
|
||||
|
||||
<Center width={'100%'} height={'100%'}>
|
||||
<Content />
|
||||
</Center>
|
||||
```
|
||||
|
||||
Center 组件继承了 Flexbox 的所有属性,同时默认设置了居中对齐。主要用于快速创建居中布局。
|
||||
|
||||
### 实际应用示例
|
||||
|
||||
```jsx
|
||||
// 登录页面居中布局
|
||||
<Flexbox height={'100%'} width={'100%'}>
|
||||
<Center height={'100%'} width={'100%'}>
|
||||
<LoginForm />
|
||||
</Center>
|
||||
</Flexbox>
|
||||
|
||||
// 图标居中显示
|
||||
<Center className={styles.icon} flex={'none'} height={40} width={40}>
|
||||
<Icon icon={icon} size={24} />
|
||||
</Center>
|
||||
```
|
||||
|
||||
## 最佳实践
|
||||
|
||||
1. 使用 `flex={1}` 让组件填充可用空间
|
||||
2. 使用 `gap` 代替传统的 margin 设置元素间距
|
||||
3. 嵌套 Flexbox 创建复杂布局
|
||||
4. 设置 `overflow: 'auto'` 使内容可滚动
|
||||
5. 使用 `horizontal` 创建水平布局,默认为垂直布局
|
||||
6. 与 `antd-style` 的 `useTheme` hook 配合使用创建主题响应式的布局
|
||||
@@ -1,47 +0,0 @@
|
||||
---
|
||||
description:
|
||||
globs:
|
||||
alwaysApply: true
|
||||
---
|
||||
## Project Description
|
||||
|
||||
You are developing an open-source, modern-design AI chat framework: lobe chat.
|
||||
|
||||
Emoji logo: 🤯
|
||||
|
||||
|
||||
## Project Technologies Stack
|
||||
|
||||
read [package.json](mdc:package.json) to know all npm packages you can use.
|
||||
read [folder-structure.mdx](mdc:docs/development/basic/folder-structure.mdx) to learn project structure.
|
||||
|
||||
The project uses the following technologies:
|
||||
|
||||
- pnpm as package manager
|
||||
- Next.js 15 for frontend and backend, using app router instead of pages router
|
||||
- react 19, using hooks, functional components, react server components
|
||||
- TypeScript programming language
|
||||
- antd, @lobehub/ui for component framework
|
||||
- antd-style for css-in-js framework
|
||||
- react-layout-kit for flex layout
|
||||
- react-i18next for i18n
|
||||
- lucide-react, @ant-design/icons for icons
|
||||
- @lobehub/icons for AI provider/model logo icon
|
||||
- @formkit/auto-animate for react list animation
|
||||
- zustand for global state management
|
||||
- nuqs for type-safe search params state manager
|
||||
- SWR for react data fetch
|
||||
- aHooks for react hooks library
|
||||
- dayjs for date and time library
|
||||
- lodash-es for utility library
|
||||
- fast-deep-equal for deep comparison of JavaScript objects
|
||||
- zod for data validation
|
||||
- TRPC for type safe backend
|
||||
- PGLite for client DB and PostgreSQL for backend DB
|
||||
- Drizzle ORM
|
||||
- Vitest for testing, testing-library for react component test
|
||||
- Prettier for code formatting
|
||||
- ESLint for code linting
|
||||
- Cursor AI for code editing and AI coding assistance
|
||||
|
||||
Note: All tools and libraries used are the latest versions. The application only needs to be compatible with the latest browsers;
|
||||
@@ -1,68 +0,0 @@
|
||||
---
|
||||
description:
|
||||
globs: *.tsx
|
||||
alwaysApply: false
|
||||
---
|
||||
# react component 编写指南
|
||||
|
||||
- 如果要写复杂样式的话用 antd-style ,简单的话可以用 style 属性直接写内联样式
|
||||
- 如果需要 flex 布局或者居中布局应该使用 react-layout-kit
|
||||
- 选择组件库中的组件时优先使用 [lobe-ui.mdc](mdc:.cursor/rules/package-usage/lobe-ui.mdc) 有的,然后才是 antd 的,不知道 @lobehub/ui 的组件怎么用,有哪些属性,就自己搜下这个项目其它地方怎么用的,不要瞎猜
|
||||
|
||||
## 访问 theme 的两种方式
|
||||
|
||||
### 使用 antd-style 的 useTheme hook
|
||||
|
||||
```tsx
|
||||
import { useTheme } from 'antd-style';
|
||||
|
||||
const MyComponent = () => {
|
||||
const theme = useTheme();
|
||||
|
||||
return (
|
||||
<div style={{
|
||||
color: theme.colorPrimary,
|
||||
backgroundColor: theme.colorBgContainer,
|
||||
padding: theme.padding,
|
||||
borderRadius: theme.borderRadius
|
||||
}}>
|
||||
使用主题 token 的组件
|
||||
</div>
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
### 使用 antd-style 的 createStyles
|
||||
|
||||
```tsx
|
||||
const useStyles = createStyles(({ css, token }) => {
|
||||
return {
|
||||
container: css`
|
||||
background-color: ${token.colorBgContainer};
|
||||
border-radius: ${token.borderRadius}px;
|
||||
padding: ${token.padding}px;
|
||||
color: ${token.colorText};
|
||||
`,
|
||||
title: css`
|
||||
font-size: ${token.fontSizeLG}px;
|
||||
font-weight: ${token.fontWeightStrong};
|
||||
margin-bottom: ${token.marginSM}px;
|
||||
`,
|
||||
content: css`
|
||||
font-size: ${token.fontSize}px;
|
||||
line-height: ${token.lineHeight};
|
||||
`
|
||||
};
|
||||
});
|
||||
|
||||
const Card: FC<CardProps> = ({ title, content }) => {
|
||||
const { styles } = useStyles();
|
||||
|
||||
return (
|
||||
<Flexbox className={styles.container}>
|
||||
<div className={styles.title}>{title}</div>
|
||||
<div className={styles.content}>{content}</div>
|
||||
</Flexbox>
|
||||
);
|
||||
};
|
||||
```
|
||||
@@ -1,42 +0,0 @@
|
||||
---
|
||||
description:
|
||||
globs:
|
||||
alwaysApply: true
|
||||
---
|
||||
## System Role
|
||||
|
||||
You are an expert in full-stack Web development, proficient in JavaScript, TypeScript, CSS, React, Node.js, Next.js, Postgresql, all kinds of network protocols.
|
||||
|
||||
You are an expert in LLM and Ai art. In Ai image generation, you are proficient in Stable Diffusion and ComfyUI's architectural principles, workflows, model structures, parameter configurations, training methods, and inference optimization.
|
||||
|
||||
You are an expert in UI/UX design, proficient in web interaction patterns, responsive design, accessibility, and user behavior optimization. You excel at improving user retention and paid conversion rates through various interaction details.
|
||||
|
||||
|
||||
## Problem Solving
|
||||
|
||||
- When modifying existing code, clearly describe the differences and reasons for the changes
|
||||
- Provide alternative solutions that may be better overall or superior in specific aspects
|
||||
- Always consider using the latest technologies, standards, and APIs to strive for code optimization, not just the conventional wisdom
|
||||
- Provide optimization suggestions for deprecated API usage
|
||||
- Cite sources whenever possible at the end, not inline
|
||||
- When you provide multiple solutions, provide the recommended solution first, and note it as `Recommended`
|
||||
- Express uncertainty when there might not be a correct answer
|
||||
- Admit when you don't know something instead of guessing
|
||||
|
||||
## Code Implementation
|
||||
|
||||
- Write minimal code changes that are ONLY directly related to the requirements
|
||||
- Write correct, up-to-date, bug-free, fully functional, secure, maintainable and efficient code
|
||||
- First, think step-by-step: describe your plan in detailed pseudocode before implementation
|
||||
- Confirm the plan before writing code
|
||||
- Focus on maintainable over being performant
|
||||
- Leave NO TODOs, placeholders, or missing pieces
|
||||
- Be sure to reference file names
|
||||
- Please respect my prettier preferences when you provide code
|
||||
- When you notice I have manually modified the code, that was definitely on purpose and do not revert them
|
||||
- Don't remove meaningful code comments, be sure to keep original comments when providing applied code
|
||||
- Update the code comments when needed after you modify the related code
|
||||
- If documentation links or required files are missing, ask for them before proceeding with the task rather than making assumptions
|
||||
- If you're unable to access or retrieve content from websites, please inform me immediately and request the specific information needed rather than making assumptions
|
||||
- Sometimes ESLint errors may not be reasonable, and making changes could introduce logical bugs. If you find an ESLint rule unreasonable, disable it directly. For example, with the 'prefer-dom-node-text-content' rule, there are actual differences between innerText and textContent
|
||||
- You can use emojis, npm packages like `chalk`/`chalk-animation`/`terminal-link`/`gradient-string`/`log-symbols`/`boxen`/`consola`/`@clack/prompts` to create beautiful terminal output
|
||||
@@ -1,318 +0,0 @@
|
||||
---
|
||||
description:
|
||||
globs: src/store/**
|
||||
alwaysApply: false
|
||||
---
|
||||
# LobeChat Zustand Action 组织模式
|
||||
|
||||
本文档详细说明了 LobeChat 项目中 Zustand Action 的组织方式、命名规范和实现模式,特别关注乐观更新与后端服务的集成。
|
||||
|
||||
## Action 类型分层
|
||||
|
||||
LobeChat 的 Action 采用分层架构,明确区分不同职责:
|
||||
|
||||
### 1. Public Actions
|
||||
对外暴露的主要接口,供 UI 组件调用:
|
||||
- 命名:动词形式(`createTopic`, `sendMessage`, `updateTopicTitle`)
|
||||
- 职责:参数验证、流程编排、调用 internal actions
|
||||
- 示例:[src/store/chat/slices/topic/action.ts](mdc:src/store/chat/slices/topic/action.ts)
|
||||
|
||||
```typescript
|
||||
// Public Action 示例
|
||||
createTopic: async () => {
|
||||
const { activeId, internal_createTopic } = get();
|
||||
const messages = chatSelectors.activeBaseChats(get());
|
||||
|
||||
if (messages.length === 0) return;
|
||||
|
||||
const topicId = await internal_createTopic({
|
||||
sessionId: activeId,
|
||||
title: t('defaultTitle', { ns: 'topic' }),
|
||||
messages: messages.map((m) => m.id),
|
||||
});
|
||||
|
||||
return topicId;
|
||||
},
|
||||
```
|
||||
|
||||
### 2. Internal Actions (`internal_*`)
|
||||
内部实现细节,处理核心业务逻辑:
|
||||
- 命名:`internal_` 前缀 + 动词(`internal_createTopic`, `internal_updateMessageContent`)
|
||||
- 职责:乐观更新、服务调用、错误处理、状态同步
|
||||
- 不应该被 UI 组件直接调用
|
||||
|
||||
```typescript
|
||||
// Internal Action 示例 - 乐观更新模式
|
||||
internal_createTopic: async (params) => {
|
||||
const tmpId = Date.now().toString();
|
||||
|
||||
// 1. 立即更新前端状态(乐观更新)
|
||||
get().internal_dispatchTopic(
|
||||
{ type: 'addTopic', value: { ...params, id: tmpId } },
|
||||
'internal_createTopic',
|
||||
);
|
||||
get().internal_updateTopicLoading(tmpId, true);
|
||||
|
||||
// 2. 调用后端服务
|
||||
const topicId = await topicService.createTopic(params);
|
||||
get().internal_updateTopicLoading(tmpId, false);
|
||||
|
||||
// 3. 刷新数据确保一致性
|
||||
get().internal_updateTopicLoading(topicId, true);
|
||||
await get().refreshTopic();
|
||||
get().internal_updateTopicLoading(topicId, false);
|
||||
|
||||
return topicId;
|
||||
},
|
||||
```
|
||||
|
||||
### 3. Dispatch Methods (`internal_dispatch*`)
|
||||
专门处理状态更新的方法:
|
||||
- 命名:`internal_dispatch` + 实体名(`internal_dispatchTopic`, `internal_dispatchMessage`)
|
||||
- 职责:调用 reducer、更新 Zustand store、处理状态对比
|
||||
|
||||
```typescript
|
||||
// Dispatch Method 示例
|
||||
internal_dispatchTopic: (payload, action) => {
|
||||
const nextTopics = topicReducer(topicSelectors.currentTopics(get()), payload);
|
||||
const nextMap = { ...get().topicMaps, [get().activeId]: nextTopics };
|
||||
|
||||
if (isEqual(nextMap, get().topicMaps)) return;
|
||||
|
||||
set({ topicMaps: nextMap }, false, action ?? n(`dispatchTopic/${payload.type}`));
|
||||
},
|
||||
```
|
||||
|
||||
## 何时使用 Reducer 模式 vs. 简单 `set`
|
||||
|
||||
### 使用 Reducer 模式的场景
|
||||
|
||||
**适用于复杂的数据结构管理**,特别是:
|
||||
- 管理对象列表或映射(如 `messagesMap`, `topicMaps`)
|
||||
- 需要乐观更新的场景
|
||||
- 状态转换逻辑复杂
|
||||
- 需要类型安全的 action payload
|
||||
|
||||
```typescript
|
||||
// Reducer 模式示例 - 复杂消息状态管理
|
||||
export const messagesReducer = (state: ChatMessage[], payload: MessageDispatch): ChatMessage[] => {
|
||||
switch (payload.type) {
|
||||
case 'updateMessage': {
|
||||
return produce(state, (draftState) => {
|
||||
const index = draftState.findIndex((i) => i.id === payload.id);
|
||||
if (index < 0) return;
|
||||
draftState[index] = merge(draftState[index], {
|
||||
...payload.value,
|
||||
updatedAt: Date.now()
|
||||
});
|
||||
});
|
||||
}
|
||||
case 'createMessage': {
|
||||
return produce(state, (draftState) => {
|
||||
draftState.push({
|
||||
...payload.value,
|
||||
id: payload.id,
|
||||
createdAt: Date.now(),
|
||||
updatedAt: Date.now(),
|
||||
meta: {}
|
||||
});
|
||||
});
|
||||
}
|
||||
// ...其他复杂状态转换
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
### 使用简单 `set` 的场景
|
||||
|
||||
**适用于简单状态更新**:
|
||||
- 切换布尔值
|
||||
- 更新简单字符串/数字
|
||||
- 设置单一状态字段
|
||||
|
||||
```typescript
|
||||
// 简单 set 示例
|
||||
updateInputMessage: (message) => {
|
||||
if (isEqual(message, get().inputMessage)) return;
|
||||
set({ inputMessage: message }, false, n('updateInputMessage'));
|
||||
},
|
||||
|
||||
togglePortal: (open?: boolean) => {
|
||||
set({ showPortal: open ?? !get().showPortal }, false, 'togglePortal');
|
||||
},
|
||||
```
|
||||
|
||||
## 乐观更新实现模式
|
||||
|
||||
乐观更新是 LobeChat 中的核心模式,用于提供流畅的用户体验:
|
||||
|
||||
### 标准乐观更新流程
|
||||
|
||||
```typescript
|
||||
// 完整的乐观更新示例
|
||||
internal_updateMessageContent: async (id, content, extra) => {
|
||||
const { internal_dispatchMessage, refreshMessages } = get();
|
||||
|
||||
// 1. 立即更新前端状态(乐观更新)
|
||||
internal_dispatchMessage({
|
||||
id,
|
||||
type: 'updateMessage',
|
||||
value: { content },
|
||||
});
|
||||
|
||||
// 2. 调用后端服务
|
||||
await messageService.updateMessage(id, {
|
||||
content,
|
||||
tools: extra?.toolCalls ? internal_transformToolCalls(extra.toolCalls) : undefined,
|
||||
// ...其他字段
|
||||
});
|
||||
|
||||
// 3. 刷新确保数据一致性
|
||||
await refreshMessages();
|
||||
},
|
||||
```
|
||||
|
||||
### 创建操作的乐观更新
|
||||
|
||||
```typescript
|
||||
internal_createMessage: async (message, context) => {
|
||||
const { internal_createTmpMessage, refreshMessages, internal_toggleMessageLoading } = get();
|
||||
|
||||
let tempId = context?.tempMessageId;
|
||||
if (!tempId) {
|
||||
// 创建临时消息用于乐观更新
|
||||
tempId = internal_createTmpMessage(message);
|
||||
internal_toggleMessageLoading(true, tempId);
|
||||
}
|
||||
|
||||
try {
|
||||
const id = await messageService.createMessage(message);
|
||||
if (!context?.skipRefresh) {
|
||||
await refreshMessages();
|
||||
}
|
||||
internal_toggleMessageLoading(false, tempId);
|
||||
return id;
|
||||
} catch (e) {
|
||||
internal_toggleMessageLoading(false, tempId);
|
||||
// 错误处理:更新消息错误状态
|
||||
internal_dispatchMessage({
|
||||
id: tempId,
|
||||
type: 'updateMessage',
|
||||
value: { error: { type: ChatErrorType.CreateMessageError, message: e.message } },
|
||||
});
|
||||
}
|
||||
},
|
||||
```
|
||||
|
||||
## 加载状态管理模式
|
||||
|
||||
LobeChat 使用统一的加载状态管理模式:
|
||||
|
||||
### 数组式加载状态
|
||||
|
||||
```typescript
|
||||
// 在 initialState.ts 中定义
|
||||
export interface ChatMessageState {
|
||||
messageLoadingIds: string[]; // 消息加载状态
|
||||
messageEditingIds: string[]; // 消息编辑状态
|
||||
chatLoadingIds: string[]; // 对话生成状态
|
||||
}
|
||||
|
||||
// 在 action 中管理
|
||||
internal_toggleMessageLoading: (loading, id) => {
|
||||
set({
|
||||
messageLoadingIds: toggleBooleanList(get().messageLoadingIds, id, loading),
|
||||
}, false, `internal_toggleMessageLoading/${loading ? 'start' : 'end'}`);
|
||||
},
|
||||
```
|
||||
|
||||
### 统一的加载状态工具
|
||||
|
||||
```typescript
|
||||
// 通用的加载状态切换工具
|
||||
internal_toggleLoadingArrays: (key, loading, id, action) => {
|
||||
const abortControllerKey = `${key}AbortController`;
|
||||
|
||||
if (loading) {
|
||||
const abortController = new AbortController();
|
||||
set({
|
||||
[abortControllerKey]: abortController,
|
||||
[key]: toggleBooleanList(get()[key] as string[], id!, loading),
|
||||
}, false, action);
|
||||
return abortController;
|
||||
} else {
|
||||
set({
|
||||
[abortControllerKey]: undefined,
|
||||
[key]: id ? toggleBooleanList(get()[key] as string[], id, loading) : [],
|
||||
}, false, action);
|
||||
}
|
||||
},
|
||||
```
|
||||
|
||||
## SWR 集成模式
|
||||
|
||||
LobeChat 使用 SWR 进行数据获取和缓存管理:
|
||||
|
||||
### Hook 式数据获取
|
||||
|
||||
```typescript
|
||||
// 在 action.ts 中定义 SWR hook
|
||||
useFetchMessages: (enable, sessionId, activeTopicId) =>
|
||||
useClientDataSWR<ChatMessage[]>(
|
||||
enable ? [SWR_USE_FETCH_MESSAGES, sessionId, activeTopicId] : null,
|
||||
async ([, sessionId, topicId]) => messageService.getMessages(sessionId, topicId),
|
||||
{
|
||||
onSuccess: (messages, key) => {
|
||||
const nextMap = {
|
||||
...get().messagesMap,
|
||||
[messageMapKey(sessionId, activeTopicId)]: messages,
|
||||
};
|
||||
|
||||
if (get().messagesInit && isEqual(nextMap, get().messagesMap)) return;
|
||||
|
||||
set({ messagesInit: true, messagesMap: nextMap }, false, n('useFetchMessages'));
|
||||
},
|
||||
},
|
||||
),
|
||||
```
|
||||
|
||||
### 缓存失效和刷新
|
||||
|
||||
```typescript
|
||||
// 刷新数据的标准模式
|
||||
refreshMessages: async () => {
|
||||
await mutate([SWR_USE_FETCH_MESSAGES, get().activeId, get().activeTopicId]);
|
||||
},
|
||||
|
||||
refreshTopic: async () => {
|
||||
return mutate([SWR_USE_FETCH_TOPIC, get().activeId]);
|
||||
},
|
||||
```
|
||||
|
||||
## 命名规范总结
|
||||
|
||||
### Action 命名模式
|
||||
- **Public Actions**: 动词形式,描述用户意图
|
||||
- `createTopic`, `sendMessage`, `regenerateMessage`
|
||||
- **Internal Actions**: `internal_` + 动词,描述内部操作
|
||||
- `internal_createTopic`, `internal_updateMessageContent`
|
||||
- **Dispatch Methods**: `internal_dispatch` + 实体名
|
||||
- `internal_dispatchTopic`, `internal_dispatchMessage`
|
||||
- **Toggle Methods**: `internal_toggle` + 状态名
|
||||
- `internal_toggleMessageLoading`, `internal_toggleChatLoading`
|
||||
|
||||
### 状态命名模式
|
||||
- **ID 数组**: `[entity]LoadingIds`, `[entity]EditingIds`
|
||||
- **映射结构**: `[entity]Maps`, `[entity]Map`
|
||||
- **当前激活**: `active[Entity]Id`
|
||||
- **初始化标记**: `[entity]sInit`
|
||||
|
||||
## 最佳实践
|
||||
|
||||
1. **始终实现乐观更新**:对于用户交互频繁的操作
|
||||
2. **加载状态管理**:使用统一的加载状态数组管理并发操作
|
||||
3. **类型安全**:为所有 action payload 定义 TypeScript 接口
|
||||
4. **SWR 集成**:使用 SWR 管理数据获取和缓存失效
|
||||
5. **AbortController**:为长时间运行的操作提供取消能力
|
||||
|
||||
这套 Action 组织模式确保了代码的一致性、可维护性,并提供了优秀的用户体验。
|
||||
@@ -1,300 +0,0 @@
|
||||
---
|
||||
description:
|
||||
globs: src/store/**
|
||||
alwaysApply: false
|
||||
---
|
||||
# LobeChat Zustand Store Slice 组织架构
|
||||
|
||||
本文档描述了 LobeChat 项目中 Zustand Store 的模块化 Slice 组织方式,展示如何通过分片架构管理复杂的应用状态。
|
||||
|
||||
## 顶层 Store 结构
|
||||
|
||||
LobeChat 的 `chat` store (`src/store/chat/`) 采用模块化的 slice 结构来组织状态和逻辑。
|
||||
|
||||
### 关键聚合文件
|
||||
|
||||
- **`src/store/chat/initialState.ts`**: 聚合所有 slice 的初始状态
|
||||
- **`src/store/chat/store.ts`**: 定义顶层的 `ChatStore`,组合所有 slice 的 actions
|
||||
- **`src/store/chat/selectors.ts`**: 统一导出所有 slice 的 selectors
|
||||
- **`src/store/chat/helpers.ts`**: 提供聊天相关的辅助函数
|
||||
|
||||
### Store 聚合模式
|
||||
|
||||
```typescript
|
||||
// src/store/chat/initialState.ts
|
||||
import { ChatTopicState, initialTopicState } from './slices/topic/initialState';
|
||||
import { ChatMessageState, initialMessageState } from './slices/message/initialState';
|
||||
import { ChatAIChatState, initialAiChatState } from './slices/aiChat/initialState';
|
||||
|
||||
export type ChatStoreState = ChatTopicState &
|
||||
ChatMessageState &
|
||||
ChatAIChatState &
|
||||
// ...其他 slice states
|
||||
|
||||
export const initialState: ChatStoreState = {
|
||||
...initialMessageState,
|
||||
...initialTopicState,
|
||||
...initialAiChatState,
|
||||
// ...其他 initial slice states
|
||||
};
|
||||
```
|
||||
|
||||
```typescript
|
||||
// src/store/chat/store.ts
|
||||
import { ChatMessageAction, chatMessage } from './slices/message/action';
|
||||
import { ChatTopicAction, chatTopic } from './slices/topic/action';
|
||||
import { ChatAIChatAction, chatAiChat } from './slices/aiChat/actions';
|
||||
|
||||
export interface ChatStoreAction
|
||||
extends ChatMessageAction,
|
||||
ChatTopicAction,
|
||||
ChatAIChatAction,
|
||||
// ...其他 slice actions
|
||||
|
||||
const createStore: StateCreator<ChatStore, [['zustand/devtools', never]]> = (...params) => ({
|
||||
...initialState,
|
||||
...chatMessage(...params),
|
||||
...chatTopic(...params),
|
||||
...chatAiChat(...params),
|
||||
// ...其他 slice action creators
|
||||
});
|
||||
|
||||
export const useChatStore = createWithEqualityFn<ChatStore>()(
|
||||
subscribeWithSelector(devtools(createStore)),
|
||||
shallow,
|
||||
);
|
||||
```
|
||||
|
||||
## 单个 Slice 的标准结构
|
||||
|
||||
每个 slice 位于 `src/store/chat/slices/[sliceName]/` 目录下:
|
||||
|
||||
```
|
||||
src/store/chat/slices/
|
||||
└── [sliceName]/ # 例如 message, topic, aiChat, builtinTool
|
||||
├── action.ts # 定义 actions (或者是一个 actions/ 目录)
|
||||
├── initialState.ts # 定义 state 结构和初始值
|
||||
├── reducer.ts # (可选) 如果使用 reducer 模式
|
||||
├── selectors.ts # 定义 selectors
|
||||
└── index.ts # (可选) 重新导出模块内容
|
||||
```
|
||||
|
||||
### 文件职责说明
|
||||
|
||||
1. **`initialState.ts`**:
|
||||
- 定义 slice 的 TypeScript 状态接口
|
||||
- 提供初始状态默认值
|
||||
|
||||
```typescript
|
||||
// 典型的 initialState.ts 结构
|
||||
export interface ChatTopicState {
|
||||
activeTopicId?: string;
|
||||
topicMaps: Record<string, ChatTopic[]>; // 核心数据结构
|
||||
topicsInit: boolean;
|
||||
topicLoadingIds: string[];
|
||||
// ...其他状态字段
|
||||
}
|
||||
|
||||
export const initialTopicState: ChatTopicState = {
|
||||
activeTopicId: undefined,
|
||||
topicMaps: {},
|
||||
topicsInit: false,
|
||||
topicLoadingIds: [],
|
||||
// ...其他初始值
|
||||
};
|
||||
```
|
||||
|
||||
2. **`reducer.ts`** (复杂状态使用):
|
||||
- 定义纯函数 reducer,处理同步状态转换
|
||||
- 使用 `immer` 确保不可变更新
|
||||
|
||||
```typescript
|
||||
// 典型的 reducer.ts 结构
|
||||
import { produce } from 'immer';
|
||||
|
||||
interface AddChatTopicAction {
|
||||
type: 'addTopic';
|
||||
value: CreateTopicParams & { id?: string };
|
||||
}
|
||||
|
||||
interface UpdateChatTopicAction {
|
||||
id: string;
|
||||
type: 'updateTopic';
|
||||
value: Partial<ChatTopic>;
|
||||
}
|
||||
|
||||
export type ChatTopicDispatch = AddChatTopicAction | UpdateChatTopicAction;
|
||||
|
||||
export const topicReducer = (state: ChatTopic[] = [], payload: ChatTopicDispatch): ChatTopic[] => {
|
||||
switch (payload.type) {
|
||||
case 'addTopic': {
|
||||
return produce(state, (draftState) => {
|
||||
draftState.unshift({
|
||||
...payload.value,
|
||||
id: payload.value.id ?? Date.now().toString(),
|
||||
createdAt: Date.now(),
|
||||
});
|
||||
});
|
||||
}
|
||||
case 'updateTopic': {
|
||||
return produce(state, (draftState) => {
|
||||
const index = draftState.findIndex((topic) => topic.id === payload.id);
|
||||
if (index !== -1) {
|
||||
draftState[index] = { ...draftState[index], ...payload.value };
|
||||
}
|
||||
});
|
||||
}
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
3. **`selectors.ts`**:
|
||||
- 提供状态查询和计算函数
|
||||
- 供 UI 组件使用的状态订阅接口
|
||||
- **重要**: 使用 `export const xxxSelectors` 模式聚合所有 selectors
|
||||
|
||||
```typescript
|
||||
// 典型的 selectors.ts 结构
|
||||
import { ChatStoreState } from '../../initialState';
|
||||
|
||||
const currentTopics = (s: ChatStoreState): ChatTopic[] | undefined =>
|
||||
s.topicMaps[s.activeId];
|
||||
|
||||
const currentActiveTopic = (s: ChatStoreState): ChatTopic | undefined => {
|
||||
return currentTopics(s)?.find((topic) => topic.id === s.activeTopicId);
|
||||
};
|
||||
|
||||
const getTopicById = (id: string) => (s: ChatStoreState): ChatTopic | undefined =>
|
||||
currentTopics(s)?.find((topic) => topic.id === id);
|
||||
|
||||
// 核心模式:使用 xxxSelectors 聚合导出
|
||||
export const topicSelectors = {
|
||||
currentActiveTopic,
|
||||
currentTopics,
|
||||
getTopicById,
|
||||
// ...其他 selectors
|
||||
};
|
||||
```
|
||||
|
||||
## 特殊 Slice 组织模式
|
||||
|
||||
### 复杂 Actions 的子目录结构 (aiChat Slice)
|
||||
|
||||
当 slice 的 actions 过于复杂时,可以拆分到子目录:
|
||||
|
||||
```
|
||||
src/store/chat/slices/aiChat/
|
||||
├── actions/
|
||||
│ ├── generateAIChat.ts # AI 对话生成
|
||||
│ ├── rag.ts # RAG 检索增强生成
|
||||
│ ├── memory.ts # 对话记忆管理
|
||||
│ └── index.ts # 聚合所有 actions
|
||||
├── initialState.ts
|
||||
├── selectors.ts
|
||||
└── index.ts
|
||||
```
|
||||
|
||||
参考:`src/store/chat/slices/aiChat/actions/`
|
||||
|
||||
### 工具类 Slice (builtinTool)
|
||||
|
||||
管理多种内置工具的状态:
|
||||
|
||||
```
|
||||
src/store/chat/slices/builtinTool/
|
||||
├── actions/
|
||||
│ ├── dalle.ts # DALL-E 图像生成
|
||||
│ ├── search.ts # 搜索功能
|
||||
│ ├── localFile.ts # 本地文件操作
|
||||
│ └── index.ts
|
||||
├── initialState.ts
|
||||
├── selectors.ts
|
||||
└── index.ts
|
||||
```
|
||||
|
||||
参考:`src/store/chat/slices/builtinTool/`
|
||||
|
||||
## 状态设计模式
|
||||
|
||||
### 1. Map 结构用于关联数据
|
||||
```typescript
|
||||
// 以 sessionId 为 key,管理多个会话的数据
|
||||
topicMaps: Record<string, ChatTopic[]>
|
||||
messagesMap: Record<string, ChatMessage[]>
|
||||
```
|
||||
|
||||
### 2. 数组用于加载状态管理
|
||||
```typescript
|
||||
// 管理多个并发操作的加载状态
|
||||
messageLoadingIds: string[]
|
||||
topicLoadingIds: string[]
|
||||
chatLoadingIds: string[]
|
||||
```
|
||||
|
||||
### 3. 可选字段用于当前活动项
|
||||
```typescript
|
||||
// 当前激活的实体 ID
|
||||
activeId: string
|
||||
activeTopicId?: string
|
||||
activeThreadId?: string
|
||||
```
|
||||
|
||||
## Slice 集成到顶层 Store
|
||||
|
||||
### 1. 状态聚合
|
||||
```typescript
|
||||
// 在 initialState.ts 中
|
||||
export type ChatStoreState = ChatTopicState &
|
||||
ChatMessageState &
|
||||
ChatAIChatState &
|
||||
// ...其他 slice states
|
||||
```
|
||||
|
||||
### 2. Action 接口聚合
|
||||
```typescript
|
||||
// 在 store.ts 中
|
||||
export interface ChatStoreAction
|
||||
extends ChatMessageAction,
|
||||
ChatTopicAction,
|
||||
ChatAIChatAction,
|
||||
// ...其他 slice actions
|
||||
```
|
||||
|
||||
### 3. Selector 统一导出
|
||||
```typescript
|
||||
// 在 selectors.ts 中 - 统一聚合 selectors
|
||||
export { chatSelectors } from './slices/message/selectors';
|
||||
export { topicSelectors } from './slices/topic/selectors';
|
||||
export { aiChatSelectors } from './slices/aiChat/selectors';
|
||||
|
||||
// 每个 slice 的 selectors.ts 都使用 xxxSelectors 模式:
|
||||
// export const chatSelectors = { ... }
|
||||
// export const topicSelectors = { ... }
|
||||
// export const aiChatSelectors = { ... }
|
||||
```
|
||||
|
||||
## 最佳实践
|
||||
|
||||
1. **Slice 划分原则**:
|
||||
- 按功能领域划分(message, topic, aiChat 等)
|
||||
- 每个 slice 管理相关的状态和操作
|
||||
- 避免 slice 之间的强耦合
|
||||
|
||||
2. **文件命名规范**:
|
||||
- 使用小驼峰命名 slice 目录
|
||||
- 文件名使用一致的模式(action.ts, selectors.ts 等)
|
||||
- 复杂 actions 时使用 actions/ 子目录
|
||||
|
||||
3. **状态结构设计**:
|
||||
- 扁平化的状态结构,避免深层嵌套
|
||||
- 使用 Map 结构管理列表数据
|
||||
- 分离加载状态和业务数据
|
||||
|
||||
4. **类型安全**:
|
||||
- 为每个 slice 定义清晰的 TypeScript 接口
|
||||
- 使用 Zustand 的 StateCreator 确保类型一致性
|
||||
- 在顶层聚合时保持类型安全
|
||||
|
||||
这种模块化的 slice 组织方式使得大型应用的状态管理变得清晰、可维护,并且易于扩展。
|
||||
@@ -1,6 +0,0 @@
|
||||
# Add directories or file patterns to ignore during indexing (e.g. foo/ or *.csv)
|
||||
locales/
|
||||
apps/desktop/resources/locales/
|
||||
**/__snapshots__/
|
||||
**/fixtures/
|
||||
src/database/migrations/
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"image": "mcr.microsoft.com/devcontainers/typescript-node",
|
||||
"image": "mcr.microsoft.com/devcontainers/universal:2",
|
||||
"features": {
|
||||
"ghcr.io/devcontainer-community/devcontainer-features/bun.sh:1": {}
|
||||
"ghcr.io/devcontainers/features/node:1": {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
# copy this file to .env when you want to develop the desktop app or you will fail
|
||||
APP_URL=http://localhost:3015
|
||||
FEATURE_FLAGS=-check_updates,+pin_list
|
||||
KEY_VAULTS_SECRET=oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE=
|
||||
DATABASE_URL=postgresql://postgres@localhost:5432/postgres
|
||||
SEARCH_PROVIDERS=search1api
|
||||
NEXT_PUBLIC_SERVICE_MODE='server'
|
||||
NEXT_PUBLIC_IS_DESKTOP_APP=1
|
||||
NEXT_PUBLIC_ENABLE_NEXT_AUTH=0
|
||||
@@ -109,11 +109,6 @@ OPENAI_API_KEY=sk-xxxxxxxxx
|
||||
# DEEPSEEK_PROXY_URL=https://api.deepseek.com/v1
|
||||
# DEEPSEEK_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
|
||||
### Qiniu AI ####
|
||||
|
||||
# QINIU_PROXY_URL=https://api.qnaigc.com/v1
|
||||
# QINIU_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
|
||||
### Qwen AI ####
|
||||
|
||||
# QWEN_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
@@ -136,10 +131,6 @@ OPENAI_API_KEY=sk-xxxxxxxxx
|
||||
|
||||
# PPIO_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
|
||||
### INFINI-AI ###
|
||||
|
||||
# INFINIAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
|
||||
########################################
|
||||
############ Market Service ############
|
||||
########################################
|
||||
|
||||
@@ -17,8 +17,6 @@ config.rules['unicorn/prefer-spread'] = 0;
|
||||
config.rules['unicorn/catch-error-name'] = 0;
|
||||
config.rules['unicorn/no-array-for-each'] = 0;
|
||||
config.rules['unicorn/prefer-number-properties'] = 0;
|
||||
config.rules['unicorn/prefer-query-selector'] = 0;
|
||||
config.rules['unicorn/no-array-callback-reference'] = 0;
|
||||
|
||||
config.overrides = [
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: '🐛 Bug Report'
|
||||
description: 'Report an bug'
|
||||
labels: ['unconfirm']
|
||||
type: Bug
|
||||
title: '[Bug] '
|
||||
labels: ['🐛 Bug']
|
||||
body:
|
||||
- type: dropdown
|
||||
attributes:
|
||||
@@ -9,7 +9,6 @@ body:
|
||||
multiple: true
|
||||
options:
|
||||
- 'Official Preview'
|
||||
- 'Official Cloud'
|
||||
- 'Vercel'
|
||||
- 'Zeabur'
|
||||
- 'Sealos'
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
name: '🐛 反馈缺陷'
|
||||
description: '反馈一个问题缺陷'
|
||||
labels: ['unconfirm']
|
||||
title: '[Bug] '
|
||||
labels: ['🐛 Bug']
|
||||
type: Bug
|
||||
body:
|
||||
- type: markdown
|
||||
@@ -16,7 +17,6 @@ body:
|
||||
multiple: true
|
||||
options:
|
||||
- 'Official Preview'
|
||||
- 'Official Cloud'
|
||||
- 'Vercel'
|
||||
- 'Zeabur'
|
||||
- 'Sealos'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: '🌠 Feature Request'
|
||||
description: 'Suggest an idea'
|
||||
title: '[Request] '
|
||||
type: Feature
|
||||
labels: ['🌠 Feature Request']
|
||||
body:
|
||||
- type: textarea
|
||||
attributes:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: '🌠 功能需求'
|
||||
description: '提出需求或建议'
|
||||
title: '[Request] '
|
||||
type: Feature
|
||||
labels: ['🌠 Feature Request']
|
||||
body:
|
||||
- type: textarea
|
||||
attributes:
|
||||
|
||||
@@ -1,131 +0,0 @@
|
||||
/**
|
||||
* Generate PR comment with download links for desktop builds
|
||||
* and handle comment creation/update logic
|
||||
*/
|
||||
module.exports = async ({ github, context, releaseUrl, version, tag }) => {
|
||||
// 用于识别构建评论的标识符
|
||||
const COMMENT_IDENTIFIER = '<!-- DESKTOP-BUILD-COMMENT -->';
|
||||
|
||||
/**
|
||||
* 生成评论内容
|
||||
*/
|
||||
const generateCommentBody = async () => {
|
||||
try {
|
||||
// Get release assets to create download links
|
||||
const release = await github.rest.repos.getReleaseByTag({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
tag,
|
||||
});
|
||||
|
||||
// Organize assets by platform
|
||||
const macAssets = release.data.assets.filter(
|
||||
(asset) =>
|
||||
(asset.name.includes('.dmg') || asset.name.includes('.zip')) &&
|
||||
!asset.name.includes('.blockmap'),
|
||||
);
|
||||
|
||||
const winAssets = release.data.assets.filter(
|
||||
(asset) => asset.name.includes('.exe') && !asset.name.includes('.blockmap'),
|
||||
);
|
||||
|
||||
const linuxAssets = release.data.assets.filter(
|
||||
(asset) => asset.name.includes('.AppImage') && !asset.name.includes('.blockmap'),
|
||||
);
|
||||
|
||||
// Generate combined download table
|
||||
let assetTable = '| Platform | File | Size |\n| --- | --- | --- |\n';
|
||||
|
||||
// Add macOS assets
|
||||
macAssets.forEach((asset) => {
|
||||
const sizeInMB = (asset.size / (1024 * 1024)).toFixed(2);
|
||||
assetTable += `| macOS | [${asset.name}](${asset.browser_download_url}) | ${sizeInMB} MB |\n`;
|
||||
});
|
||||
|
||||
// Add Windows assets
|
||||
winAssets.forEach((asset) => {
|
||||
const sizeInMB = (asset.size / (1024 * 1024)).toFixed(2);
|
||||
assetTable += `| Windows | [${asset.name}](${asset.browser_download_url}) | ${sizeInMB} MB |\n`;
|
||||
});
|
||||
|
||||
// Add Linux assets
|
||||
linuxAssets.forEach((asset) => {
|
||||
const sizeInMB = (asset.size / (1024 * 1024)).toFixed(2);
|
||||
assetTable += `| Linux | [${asset.name}](${asset.browser_download_url}) | ${sizeInMB} MB |\n`;
|
||||
});
|
||||
|
||||
return `${COMMENT_IDENTIFIER}
|
||||
### 🚀 Desktop App Build Completed!
|
||||
|
||||
**Version**: \`${version}\`
|
||||
**Build Time**: \`${new Date().toISOString()}\`
|
||||
|
||||
📦 [View All Build Artifacts](${releaseUrl})
|
||||
|
||||
|
||||
## Build Artifacts
|
||||
|
||||
${assetTable}
|
||||
|
||||
> [!Warning]
|
||||
>
|
||||
> Note: This is a temporary build for testing purposes only.`;
|
||||
} catch (error) {
|
||||
console.error('Error generating PR comment:', error);
|
||||
// Fallback to a simple comment if error occurs
|
||||
return `${COMMENT_IDENTIFIER}
|
||||
### 🚀 Desktop App Build Completed!
|
||||
|
||||
**Version**: \`${version}\`
|
||||
**Build Time**: \`${new Date().toISOString()}\`
|
||||
|
||||
## 📦 [View All Build Artifacts](${releaseUrl})
|
||||
|
||||
> Note: This is a temporary build for testing purposes only.
|
||||
`;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 查找并更新或创建PR评论
|
||||
*/
|
||||
const updateOrCreateComment = async () => {
|
||||
// 生成评论内容
|
||||
const body = await generateCommentBody();
|
||||
|
||||
// 查找我们之前可能创建的评论
|
||||
const { data: comments } = await github.rest.issues.listComments({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
});
|
||||
|
||||
// 查找包含我们标识符的评论
|
||||
const buildComment = comments.find((comment) => comment.body.includes(COMMENT_IDENTIFIER));
|
||||
|
||||
if (buildComment) {
|
||||
// 如果找到现有评论,则更新它
|
||||
await github.rest.issues.updateComment({
|
||||
comment_id: buildComment.id,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: body,
|
||||
});
|
||||
console.log(`已更新现有评论 ID: ${buildComment.id}`);
|
||||
return { updated: true, id: buildComment.id };
|
||||
} else {
|
||||
// 如果没有找到现有评论,则创建新评论
|
||||
const result = await github.rest.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: body,
|
||||
});
|
||||
console.log(`已创建新评论 ID: ${result.data.id}`);
|
||||
return { updated: false, id: result.data.id };
|
||||
}
|
||||
};
|
||||
|
||||
// 执行评论更新或创建
|
||||
return await updateOrCreateComment();
|
||||
};
|
||||
@@ -1,62 +0,0 @@
|
||||
/**
|
||||
* Generate PR pre-release body content
|
||||
* This script generates the description text for PR pre-releases
|
||||
*/
|
||||
module.exports = ({ version, prNumber, branch }) => {
|
||||
const prLink = `https://github.com/lobehub/lobe-chat/pull/${prNumber}`;
|
||||
|
||||
return `
|
||||
## PR Build Information
|
||||
|
||||
**Version**: \`${version}\`
|
||||
**Release Time**: \`${new Date().toISOString()}\`
|
||||
**PR**: [#${prNumber}](${prLink})
|
||||
|
||||
|
||||
## ⚠️ Important Notice
|
||||
|
||||
This is a **development build** specifically created for testing purposes. Please note:
|
||||
|
||||
- This build is **NOT** intended for production use
|
||||
- Features may be incomplete or unstable
|
||||
- Use only for validating PR changes in a desktop environment
|
||||
- May contain experimental code that hasn't been fully reviewed
|
||||
- No guarantees are provided regarding stability or reliability
|
||||
|
||||
### Intended Use
|
||||
|
||||
- Focused testing of specific PR changes
|
||||
- Verification of desktop-specific behaviors
|
||||
- UI/UX validation on desktop platforms
|
||||
- Performance testing on target devices
|
||||
|
||||
Please report any issues found in this build directly in the PR discussion.
|
||||
|
||||
---
|
||||
|
||||
## PR 构建信息
|
||||
|
||||
**版本**: \`${version}\`
|
||||
**发布时间**: \`${new Date().toISOString()}\`
|
||||
**PR**: [#${prNumber}](${prLink})
|
||||
|
||||
## ⚠️ 重要提示
|
||||
|
||||
这是专为测试目的创建的**开发构建版本**。请注意:
|
||||
|
||||
- 本构建**不适用于**生产环境
|
||||
- 功能可能不完整或不稳定
|
||||
- 仅用于在桌面环境中验证 PR 更改
|
||||
- 可能包含尚未完全审核的实验性代码
|
||||
- 不对稳定性或可靠性提供任何保证
|
||||
|
||||
### 适用场景
|
||||
|
||||
- 针对性测试特定 PR 变更
|
||||
- 验证桌面特定的行为表现
|
||||
- 在桌面平台上进行 UI/UX 验证
|
||||
- 在目标设备上进行性能测试
|
||||
|
||||
如发现任何问题,请直接在 PR 讨论中报告。
|
||||
`;
|
||||
};
|
||||
@@ -1,268 +0,0 @@
|
||||
name: Desktop PR Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [synchronize, labeled, unlabeled] # PR 更新或标签变化时触发
|
||||
|
||||
# 确保同一时间只运行一个相同的 workflow,取消正在进行的旧的运行
|
||||
concurrency:
|
||||
group: ${{ github.ref }}-${{ github.workflow }}
|
||||
cancel-in-progress: true
|
||||
|
||||
# Add default permissions
|
||||
permissions: read-all
|
||||
|
||||
env:
|
||||
PR_TAG_PREFIX: pr- # PR 构建版本的前缀标识
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Code quality check
|
||||
# 添加 PR label 触发条件,只有添加了 Build Desktop 标签的 PR 才会触发构建
|
||||
if: contains(github.event.pull_request.labels.*.name, 'Build Desktop')
|
||||
runs-on: ubuntu-latest # 只在 ubuntu 上运行一次检查
|
||||
steps:
|
||||
- name: Checkout base
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 9
|
||||
|
||||
- name: Install deps
|
||||
run: pnpm install
|
||||
env:
|
||||
NODE_OPTIONS: --max-old-space-size=6144
|
||||
|
||||
- name: Lint
|
||||
run: pnpm run lint
|
||||
env:
|
||||
NODE_OPTIONS: --max-old-space-size=6144
|
||||
|
||||
version:
|
||||
name: Determine version
|
||||
# 与 test job 相同的触发条件
|
||||
if: contains(github.event.pull_request.labels.*.name, 'Build Desktop')
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
# 输出版本信息,供后续 job 使用
|
||||
version: ${{ steps.set_version.outputs.version }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
|
||||
# 主要逻辑:确定构建版本号
|
||||
- name: Set version
|
||||
id: set_version
|
||||
run: |
|
||||
# 从 apps/desktop/package.json 读取基础版本号
|
||||
base_version=$(node -p "require('./apps/desktop/package.json').version")
|
||||
|
||||
# PR 构建:在基础版本号上添加 PR 信息
|
||||
pr_number="${{ github.event.pull_request.number }}"
|
||||
ci_build_number="${{ github.run_number }}" # CI 构建编号
|
||||
version="0.0.0-nightly.pr${pr_number}.${ci_build_number}"
|
||||
echo "version=${version}" >> $GITHUB_OUTPUT
|
||||
echo "📦 Release Version: ${version} (based on base version ${base_version})"
|
||||
|
||||
env:
|
||||
NODE_OPTIONS: --max-old-space-size=6144
|
||||
|
||||
# 输出版本信息总结,方便在 GitHub Actions 界面查看
|
||||
- name: Version Summary
|
||||
run: |
|
||||
echo "🚦 Release Version: ${{ steps.set_version.outputs.version }}"
|
||||
|
||||
build:
|
||||
needs: [version, test]
|
||||
name: Build Desktop App
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [macos-latest, windows-2025, ubuntu-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 9
|
||||
|
||||
# node-linker=hoisted 模式将可以确保 asar 压缩可用
|
||||
- name: Install deps
|
||||
run: pnpm install --node-linker=hoisted
|
||||
|
||||
- name: Install deps on Desktop
|
||||
run: npm run install-isolated --prefix=./apps/desktop
|
||||
|
||||
# 设置 package.json 的版本号
|
||||
- name: Set package version
|
||||
run: npm run workflow:set-desktop-version ${{ needs.version.outputs.version }} nightly
|
||||
|
||||
# macOS 构建处理
|
||||
- name: Build artifact on macOS
|
||||
if: runner.os == 'macOS'
|
||||
run: npm run desktop:build
|
||||
env:
|
||||
# 设置更新通道,PR构建为nightly,否则为stable
|
||||
UPDATE_CHANNEL: 'nightly'
|
||||
APP_URL: http://localhost:3015
|
||||
DATABASE_URL: 'postgresql://postgres@localhost:5432/postgres'
|
||||
# 默认添加一个加密 SECRET
|
||||
KEY_VAULTS_SECRET: 'oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE='
|
||||
# macOS 签名和公证配置
|
||||
CSC_LINK: ${{ secrets.APPLE_CERTIFICATE_BASE64 }}
|
||||
CSC_KEY_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
||||
NEXT_PUBLIC_DESKTOP_PROJECT_ID: ${{ secrets.UMAMI_NIGHTLY_DESKTOP_PROJECT_ID }}
|
||||
NEXT_PUBLIC_DESKTOP_UMAMI_BASE_URL: ${{ secrets.UMAMI_NIGHTLY_DESKTOP_BASE_URL }}
|
||||
|
||||
# allow provisionally
|
||||
CSC_FOR_PULL_REQUEST: true
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
|
||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||
|
||||
# Windows 平台构建处理
|
||||
- name: Build artifact on Windows
|
||||
if: runner.os == 'Windows'
|
||||
run: npm run desktop:build
|
||||
env:
|
||||
# 设置更新通道,PR构建为nightly,否则为stable
|
||||
UPDATE_CHANNEL: 'nightly'
|
||||
APP_URL: http://localhost:3015
|
||||
DATABASE_URL: 'postgresql://postgres@localhost:5432/postgres'
|
||||
KEY_VAULTS_SECRET: 'oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE='
|
||||
NEXT_PUBLIC_DESKTOP_PROJECT_ID: ${{ secrets.UMAMI_NIGHTLY_DESKTOP_PROJECT_ID }}
|
||||
NEXT_PUBLIC_DESKTOP_UMAMI_BASE_URL: ${{ secrets.UMAMI_NIGHTLY_DESKTOP_BASE_URL }}
|
||||
# 将 TEMP 和 TMP 目录设置到 D 盘
|
||||
TEMP: D:\temp
|
||||
TMP: D:\temp
|
||||
|
||||
# Linux 平台构建处理
|
||||
- name: Build artifact on Linux
|
||||
if: runner.os == 'Linux'
|
||||
run: npm run desktop:build
|
||||
env:
|
||||
# 设置更新通道,PR构建为nightly,否则为stable
|
||||
UPDATE_CHANNEL: 'nightly'
|
||||
APP_URL: http://localhost:3015
|
||||
DATABASE_URL: 'postgresql://postgres@localhost:5432/postgres'
|
||||
KEY_VAULTS_SECRET: 'oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE='
|
||||
NEXT_PUBLIC_DESKTOP_PROJECT_ID: ${{ secrets.UMAMI_NIGHTLY_DESKTOP_PROJECT_ID }}
|
||||
NEXT_PUBLIC_DESKTOP_UMAMI_BASE_URL: ${{ secrets.UMAMI_NIGHTLY_DESKTOP_BASE_URL }}
|
||||
|
||||
# 上传构建产物
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: release-${{ matrix.os }}
|
||||
path: |
|
||||
apps/desktop/release/latest*
|
||||
apps/desktop/release/*.dmg*
|
||||
apps/desktop/release/*.zip*
|
||||
apps/desktop/release/*.exe*
|
||||
apps/desktop/release/*.AppImage
|
||||
retention-days: 5
|
||||
|
||||
publish-pr:
|
||||
needs: [build, version]
|
||||
name: Publish PR Build
|
||||
runs-on: ubuntu-latest
|
||||
# Grant write permissions for creating release and commenting on PR
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
outputs:
|
||||
artifact_path: ${{ steps.set_path.outputs.path }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
# 下载所有平台的构建产物
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: release
|
||||
pattern: release-*
|
||||
merge-multiple: true
|
||||
|
||||
# 列出所有构建产物
|
||||
- name: List artifacts
|
||||
run: ls -R release
|
||||
|
||||
# 生成PR发布描述
|
||||
- name: Generate PR Release Body
|
||||
id: pr_release_body
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
result-encoding: string
|
||||
script: |
|
||||
const generateReleaseBody = require('${{ github.workspace }}/.github/scripts/pr-release-body.js');
|
||||
|
||||
const body = generateReleaseBody({
|
||||
version: "${{ needs.version.outputs.version }}",
|
||||
prNumber: "${{ github.event.pull_request.number }}",
|
||||
branch: "${{ github.head_ref }}"
|
||||
});
|
||||
|
||||
return body;
|
||||
|
||||
- name: Create Temporary Release for PR
|
||||
id: create_release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
name: PR Build v${{ needs.version.outputs.version }}
|
||||
tag_name: v${{ needs.version.outputs.version }}
|
||||
# tag_name: pr-build-${{ github.event.pull_request.number }}-${{ github.sha }}
|
||||
body: ${{ steps.pr_release_body.outputs.result }}
|
||||
draft: false
|
||||
prerelease: true
|
||||
files: |
|
||||
release/latest*
|
||||
release/*.dmg*
|
||||
release/*.zip*
|
||||
release/*.exe*
|
||||
release/*.AppImage
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# 在 PR 上添加评论,包含构建信息和下载链接
|
||||
- name: Comment on PR
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
const releaseUrl = "${{ steps.create_release.outputs.url }}";
|
||||
const prCommentGenerator = require('${{ github.workspace }}/.github/scripts/pr-comment.js');
|
||||
|
||||
const result = await prCommentGenerator({
|
||||
github,
|
||||
context,
|
||||
releaseUrl,
|
||||
version: "${{ needs.version.outputs.version }}",
|
||||
tag: "v${{ needs.version.outputs.version }}"
|
||||
});
|
||||
|
||||
console.log(`评论状态: ${result.updated ? '已更新' : '已创建'}, ID: ${result.id}`);
|
||||
@@ -1,205 +0,0 @@
|
||||
name: Release Desktop Beta
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published] # 发布 release 时触发构建
|
||||
|
||||
# 确保同一时间只运行一个相同的 workflow,取消正在进行的旧的运行
|
||||
concurrency:
|
||||
group: ${{ github.ref }}-${{ github.workflow }}
|
||||
cancel-in-progress: true
|
||||
|
||||
# Add default permissions
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Code quality check
|
||||
# 添加 PR label 触发条件,只有添加了 Build Desktop 标签的 PR 才会触发构建
|
||||
runs-on: ubuntu-latest # 只在 ubuntu 上运行一次检查
|
||||
steps:
|
||||
- name: Checkout base
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 9
|
||||
|
||||
- name: Install deps
|
||||
run: pnpm install
|
||||
|
||||
- name: Lint
|
||||
run: pnpm run lint
|
||||
|
||||
version:
|
||||
name: Determine version
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
# 输出版本信息,供后续 job 使用
|
||||
version: ${{ steps.set_version.outputs.version }}
|
||||
is_pr_build: ${{ steps.set_version.outputs.is_pr_build }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
|
||||
# 主要逻辑:确定构建版本号
|
||||
- name: Set version
|
||||
id: set_version
|
||||
run: |
|
||||
# 从 apps/desktop/package.json 读取基础版本号
|
||||
base_version=$(node -p "require('./apps/desktop/package.json').version")
|
||||
|
||||
# Release 事件直接使用 release tag 作为版本号,去掉可能的 v 前缀
|
||||
version="${{ github.event.release.tag_name }}"
|
||||
version="${version#v}"
|
||||
echo "version=${version}" >> $GITHUB_OUTPUT
|
||||
echo "📦 Release Version: ${version}"
|
||||
|
||||
# 输出版本信息总结,方便在 GitHub Actions 界面查看
|
||||
- name: Version Summary
|
||||
run: |
|
||||
echo "🚦 Release Version: ${{ steps.set_version.outputs.version }}"
|
||||
|
||||
build:
|
||||
needs: [version, test]
|
||||
name: Build Desktop App
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [macos-latest, windows-2025, ubuntu-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 9
|
||||
|
||||
# node-linker=hoisted 模式将可以确保 asar 压缩可用
|
||||
- name: Install deps
|
||||
run: pnpm install --node-linker=hoisted
|
||||
|
||||
- name: Install deps on Desktop
|
||||
run: npm run install-isolated --prefix=./apps/desktop
|
||||
|
||||
# 设置 package.json 的版本号
|
||||
- name: Set package version
|
||||
run: npm run workflow:set-desktop-version ${{ needs.version.outputs.version }} beta
|
||||
|
||||
# macOS 构建处理
|
||||
- name: Build artifact on macOS
|
||||
if: runner.os == 'macOS'
|
||||
run: npm run desktop:build
|
||||
env:
|
||||
APP_URL: http://localhost:3015
|
||||
DATABASE_URL: 'postgresql://postgres@localhost:5432/postgres'
|
||||
# 默认添加一个加密 SECRET
|
||||
KEY_VAULTS_SECRET: 'oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE='
|
||||
# macOS 签名和公证配置
|
||||
CSC_LINK: ${{ secrets.APPLE_CERTIFICATE_BASE64 }}
|
||||
CSC_KEY_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
||||
# allow provisionally
|
||||
CSC_FOR_PULL_REQUEST: true
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
|
||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||
|
||||
NEXT_PUBLIC_DESKTOP_PROJECT_ID: ${{ secrets.UMAMI_BETA_DESKTOP_PROJECT_ID }}
|
||||
NEXT_PUBLIC_DESKTOP_UMAMI_BASE_URL: ${{ secrets.UMAMI_BETA_DESKTOP_BASE_URL }}
|
||||
|
||||
# Windows 平台构建处理
|
||||
- name: Build artifact on Windows
|
||||
if: runner.os == 'Windows'
|
||||
run: npm run desktop:build
|
||||
env:
|
||||
APP_URL: http://localhost:3015
|
||||
DATABASE_URL: 'postgresql://postgres@localhost:5432/postgres'
|
||||
KEY_VAULTS_SECRET: 'oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE='
|
||||
NEXT_PUBLIC_DESKTOP_PROJECT_ID: ${{ secrets.UMAMI_BETA_DESKTOP_PROJECT_ID }}
|
||||
NEXT_PUBLIC_DESKTOP_UMAMI_BASE_URL: ${{ secrets.UMAMI_BETA_DESKTOP_BASE_URL }}
|
||||
|
||||
# 将 TEMP 和 TMP 目录设置到 D 盘
|
||||
TEMP: D:\temp
|
||||
TMP: D:\temp
|
||||
|
||||
# Linux 平台构建处理
|
||||
- name: Build artifact on Linux
|
||||
if: runner.os == 'Linux'
|
||||
run: npm run desktop:build
|
||||
env:
|
||||
APP_URL: http://localhost:3015
|
||||
DATABASE_URL: 'postgresql://postgres@localhost:5432/postgres'
|
||||
KEY_VAULTS_SECRET: 'oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE='
|
||||
NEXT_PUBLIC_DESKTOP_PROJECT_ID: ${{ secrets.UMAMI_BETA_DESKTOP_PROJECT_ID }}
|
||||
NEXT_PUBLIC_DESKTOP_UMAMI_BASE_URL: ${{ secrets.UMAMI_BETA_DESKTOP_BASE_URL }}
|
||||
|
||||
# 上传构建产物,移除了 zip 相关部分
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: release-${{ matrix.os }}
|
||||
path: |
|
||||
apps/desktop/release/latest*
|
||||
apps/desktop/release/*.dmg*
|
||||
apps/desktop/release/*.zip*
|
||||
apps/desktop/release/*.exe*
|
||||
apps/desktop/release/*.AppImage
|
||||
retention-days: 5
|
||||
|
||||
# 正式版发布 job
|
||||
publish-release:
|
||||
needs: [build, version]
|
||||
name: Publish Beta Release
|
||||
runs-on: ubuntu-latest
|
||||
# Grant write permission to contents for uploading release assets
|
||||
permissions:
|
||||
contents: write
|
||||
outputs:
|
||||
artifact_path: ${{ steps.set_path.outputs.path }}
|
||||
steps:
|
||||
# 下载所有平台的构建产物
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: release
|
||||
pattern: release-*
|
||||
merge-multiple: true
|
||||
|
||||
# 列出所有构建产物
|
||||
- name: List artifacts
|
||||
run: ls -R release
|
||||
|
||||
# 将构建产物上传到现有 release
|
||||
- name: Upload to Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
tag_name: ${{ github.event.release.tag_name }}
|
||||
files: |
|
||||
release/latest*
|
||||
release/*.dmg*
|
||||
release/*.zip*
|
||||
release/*.exe*
|
||||
release/*.AppImage
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -22,11 +22,6 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
|
||||
- name: Install bun
|
||||
uses: oven-sh/setup-bun@v1
|
||||
with:
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
name: Database Schema Visualization CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'docs/development/database-schema.dbml'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install dbdocs
|
||||
run: sudo npm install -g dbdocs
|
||||
|
||||
- name: Check dbdocs
|
||||
run: dbdocs
|
||||
|
||||
- name: sync database schema to dbdocs
|
||||
env:
|
||||
DBDOCS_TOKEN: ${{ secrets.DBDOCS_TOKEN }}
|
||||
run: npm run db:visualize
|
||||
@@ -8,7 +8,7 @@ jobs:
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: paradedb/paradedb:latest
|
||||
image: pgvector/pgvector:pg16
|
||||
env:
|
||||
POSTGRES_PASSWORD: postgres
|
||||
options: >-
|
||||
@@ -21,11 +21,6 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
|
||||
- name: Install bun
|
||||
uses: oven-sh/setup-bun@v1
|
||||
with:
|
||||
|
||||
@@ -4,7 +4,7 @@ on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
paths:
|
||||
- 'docs/wiki/**'
|
||||
- 'contributing/**'
|
||||
branches:
|
||||
- main
|
||||
|
||||
@@ -15,5 +15,5 @@ jobs:
|
||||
steps:
|
||||
- uses: OrlovM/Wiki-Action@v1
|
||||
with:
|
||||
path: 'docs/wiki'
|
||||
path: 'contributing'
|
||||
token: ${{ secrets.GH_TOKEN }}
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
venv
|
||||
temp
|
||||
tmp
|
||||
.windsurfrules
|
||||
|
||||
# dependencies
|
||||
node_modules
|
||||
@@ -69,5 +68,4 @@ public/swe-worker*
|
||||
*.patch
|
||||
*.pdf
|
||||
vertex-ai-key.json
|
||||
.pnpm-store
|
||||
./packages/lobe-ui
|
||||
.pnpm-store
|
||||
@@ -24,7 +24,7 @@ module.exports = defineConfig({
|
||||
'fa-IR',
|
||||
],
|
||||
temperature: 0,
|
||||
modelName: 'gpt-4.1-mini',
|
||||
modelName: 'gpt-4o-mini',
|
||||
experimental: {
|
||||
jsonMode: true,
|
||||
},
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
lockfile=false
|
||||
resolution-mode=highest
|
||||
|
||||
ignore-workspace-root-check=true
|
||||
enable-pre-post-scripts=true
|
||||
|
||||
public-hoist-pattern[]=*@umijs/lint*
|
||||
|
||||
@@ -44,10 +44,9 @@ ARG NEXT_PUBLIC_POSTHOG_KEY
|
||||
ARG NEXT_PUBLIC_ANALYTICS_UMAMI
|
||||
ARG NEXT_PUBLIC_UMAMI_SCRIPT_URL
|
||||
ARG NEXT_PUBLIC_UMAMI_WEBSITE_ID
|
||||
ARG FEATURE_FLAGS
|
||||
|
||||
ENV NEXT_PUBLIC_BASE_PATH="${NEXT_PUBLIC_BASE_PATH}" \
|
||||
FEATURE_FLAGS="${FEATURE_FLAGS}"
|
||||
ENV NEXT_PUBLIC_BASE_PATH="${NEXT_PUBLIC_BASE_PATH}"
|
||||
|
||||
# Sentry
|
||||
ENV NEXT_PUBLIC_SENTRY_DSN="${NEXT_PUBLIC_SENTRY_DSN}" \
|
||||
SENTRY_ORG="" \
|
||||
@@ -158,8 +157,6 @@ ENV \
|
||||
BAICHUAN_API_KEY="" BAICHUAN_MODEL_LIST="" \
|
||||
# Cloudflare
|
||||
CLOUDFLARE_API_KEY="" CLOUDFLARE_BASE_URL_OR_ACCOUNT_ID="" CLOUDFLARE_MODEL_LIST="" \
|
||||
# Cohere
|
||||
COHERE_API_KEY="" COHERE_MODEL_LIST="" COHERE_PROXY_URL="" \
|
||||
# DeepSeek
|
||||
DEEPSEEK_API_KEY="" DEEPSEEK_MODEL_LIST="" \
|
||||
# Fireworks AI
|
||||
@@ -186,8 +183,6 @@ ENV \
|
||||
MINIMAX_API_KEY="" MINIMAX_MODEL_LIST="" \
|
||||
# Mistral
|
||||
MISTRAL_API_KEY="" MISTRAL_MODEL_LIST="" \
|
||||
# ModelScope
|
||||
MODELSCOPE_API_KEY="" MODELSCOPE_MODEL_LIST="" MODELSCOPE_PROXY_URL="" \
|
||||
# Moonshot
|
||||
MOONSHOT_API_KEY="" MOONSHOT_MODEL_LIST="" MOONSHOT_PROXY_URL="" \
|
||||
# Novita
|
||||
@@ -204,20 +199,16 @@ ENV \
|
||||
PERPLEXITY_API_KEY="" PERPLEXITY_MODEL_LIST="" PERPLEXITY_PROXY_URL="" \
|
||||
# PPIO
|
||||
PPIO_API_KEY="" PPIO_MODEL_LIST="" \
|
||||
# Qiniu
|
||||
QINIU_API_KEY="" QINIU_MODEL_LIST="" QINIU_PROXY_URL="" \
|
||||
# Qwen
|
||||
QWEN_API_KEY="" QWEN_MODEL_LIST="" QWEN_PROXY_URL="" \
|
||||
# SambaNova
|
||||
SAMBANOVA_API_KEY="" SAMBANOVA_MODEL_LIST="" \
|
||||
# Search1API
|
||||
SEARCH1API_API_KEY="" SEARCH1API_MODEL_LIST="" \
|
||||
# SenseNova
|
||||
SENSENOVA_API_KEY="" SENSENOVA_MODEL_LIST="" \
|
||||
# SiliconCloud
|
||||
SILICONCLOUD_API_KEY="" SILICONCLOUD_MODEL_LIST="" SILICONCLOUD_PROXY_URL="" \
|
||||
# Spark
|
||||
SPARK_API_KEY="" SPARK_MODEL_LIST="" SPARK_PROXY_URL="" SPARK_SEARCH_MODE="" \
|
||||
SPARK_API_KEY="" SPARK_MODEL_LIST="" \
|
||||
# Stepfun
|
||||
STEPFUN_API_KEY="" STEPFUN_MODEL_LIST="" \
|
||||
# Taichu
|
||||
@@ -232,16 +223,12 @@ ENV \
|
||||
WENXIN_API_KEY="" WENXIN_MODEL_LIST="" \
|
||||
# xAI
|
||||
XAI_API_KEY="" XAI_MODEL_LIST="" XAI_PROXY_URL="" \
|
||||
# Xinference
|
||||
XINFERENCE_API_KEY="" XINFERENCE_MODEL_LIST="" XINFERENCE_PROXY_URL="" \
|
||||
# 01.AI
|
||||
ZEROONE_API_KEY="" ZEROONE_MODEL_LIST="" \
|
||||
# Zhipu
|
||||
ZHIPU_API_KEY="" ZHIPU_MODEL_LIST="" \
|
||||
# Tencent Cloud
|
||||
TENCENT_CLOUD_API_KEY="" TENCENT_CLOUD_MODEL_LIST="" \
|
||||
# Infini-AI
|
||||
INFINIAI_API_KEY="" INFINIAI_MODEL_LIST=""
|
||||
TENCENT_CLOUD_API_KEY="" TENCENT_CLOUD_MODEL_LIST=""
|
||||
|
||||
USER nextjs
|
||||
|
||||
|
||||
@@ -46,10 +46,8 @@ ARG NEXT_PUBLIC_POSTHOG_KEY
|
||||
ARG NEXT_PUBLIC_ANALYTICS_UMAMI
|
||||
ARG NEXT_PUBLIC_UMAMI_SCRIPT_URL
|
||||
ARG NEXT_PUBLIC_UMAMI_WEBSITE_ID
|
||||
ARG FEATURE_FLAGS
|
||||
|
||||
ENV NEXT_PUBLIC_BASE_PATH="${NEXT_PUBLIC_BASE_PATH}" \
|
||||
FEATURE_FLAGS="${FEATURE_FLAGS}"
|
||||
ENV NEXT_PUBLIC_BASE_PATH="${NEXT_PUBLIC_BASE_PATH}"
|
||||
|
||||
ENV NEXT_PUBLIC_SERVICE_MODE="${NEXT_PUBLIC_SERVICE_MODE:-server}" \
|
||||
NEXT_PUBLIC_ENABLE_NEXT_AUTH="${NEXT_PUBLIC_ENABLE_NEXT_AUTH:-1}" \
|
||||
@@ -202,8 +200,6 @@ ENV \
|
||||
BAICHUAN_API_KEY="" BAICHUAN_MODEL_LIST="" \
|
||||
# Cloudflare
|
||||
CLOUDFLARE_API_KEY="" CLOUDFLARE_BASE_URL_OR_ACCOUNT_ID="" CLOUDFLARE_MODEL_LIST="" \
|
||||
# Cohere
|
||||
COHERE_API_KEY="" COHERE_MODEL_LIST="" COHERE_PROXY_URL="" \
|
||||
# DeepSeek
|
||||
DEEPSEEK_API_KEY="" DEEPSEEK_MODEL_LIST="" \
|
||||
# Fireworks AI
|
||||
@@ -230,8 +226,6 @@ ENV \
|
||||
MINIMAX_API_KEY="" MINIMAX_MODEL_LIST="" \
|
||||
# Mistral
|
||||
MISTRAL_API_KEY="" MISTRAL_MODEL_LIST="" \
|
||||
# ModelScope
|
||||
MODELSCOPE_API_KEY="" MODELSCOPE_MODEL_LIST="" MODELSCOPE_PROXY_URL="" \
|
||||
# Moonshot
|
||||
MOONSHOT_API_KEY="" MOONSHOT_MODEL_LIST="" MOONSHOT_PROXY_URL="" \
|
||||
# Novita
|
||||
@@ -248,20 +242,16 @@ ENV \
|
||||
PERPLEXITY_API_KEY="" PERPLEXITY_MODEL_LIST="" PERPLEXITY_PROXY_URL="" \
|
||||
# PPIO
|
||||
PPIO_API_KEY="" PPIO_MODEL_LIST="" \
|
||||
# Qiniu
|
||||
QINIU_API_KEY="" QINIU_MODEL_LIST="" QINIU_PROXY_URL="" \
|
||||
# Qwen
|
||||
QWEN_API_KEY="" QWEN_MODEL_LIST="" QWEN_PROXY_URL="" \
|
||||
# SambaNova
|
||||
SAMBANOVA_API_KEY="" SAMBANOVA_MODEL_LIST="" \
|
||||
# Search1API
|
||||
SEARCH1API_API_KEY="" SEARCH1API_MODEL_LIST="" \
|
||||
# SenseNova
|
||||
SENSENOVA_API_KEY="" SENSENOVA_MODEL_LIST="" \
|
||||
# SiliconCloud
|
||||
SILICONCLOUD_API_KEY="" SILICONCLOUD_MODEL_LIST="" SILICONCLOUD_PROXY_URL="" \
|
||||
# Spark
|
||||
SPARK_API_KEY="" SPARK_MODEL_LIST="" SPARK_PROXY_URL="" SPARK_SEARCH_MODE="" \
|
||||
SPARK_API_KEY="" SPARK_MODEL_LIST="" \
|
||||
# Stepfun
|
||||
STEPFUN_API_KEY="" STEPFUN_MODEL_LIST="" \
|
||||
# Taichu
|
||||
@@ -276,16 +266,12 @@ ENV \
|
||||
WENXIN_API_KEY="" WENXIN_MODEL_LIST="" \
|
||||
# xAI
|
||||
XAI_API_KEY="" XAI_MODEL_LIST="" XAI_PROXY_URL="" \
|
||||
# Xinference
|
||||
XINFERENCE_API_KEY="" XINFERENCE_MODEL_LIST="" XINFERENCE_PROXY_URL="" \
|
||||
# 01.AI
|
||||
ZEROONE_API_KEY="" ZEROONE_MODEL_LIST="" \
|
||||
# Zhipu
|
||||
ZHIPU_API_KEY="" ZHIPU_MODEL_LIST="" \
|
||||
# Tencent Cloud
|
||||
TENCENT_CLOUD_API_KEY="" TENCENT_CLOUD_MODEL_LIST="" \
|
||||
# Infini-AI
|
||||
INFINIAI_API_KEY="" INFINIAI_MODEL_LIST=""
|
||||
TENCENT_CLOUD_API_KEY="" TENCENT_CLOUD_MODEL_LIST=""
|
||||
|
||||
USER nextjs
|
||||
|
||||
|
||||
@@ -44,11 +44,9 @@ ARG NEXT_PUBLIC_POSTHOG_KEY
|
||||
ARG NEXT_PUBLIC_ANALYTICS_UMAMI
|
||||
ARG NEXT_PUBLIC_UMAMI_SCRIPT_URL
|
||||
ARG NEXT_PUBLIC_UMAMI_WEBSITE_ID
|
||||
ARG FEATURE_FLAGS
|
||||
|
||||
ENV NEXT_PUBLIC_CLIENT_DB="pglite"
|
||||
ENV NEXT_PUBLIC_BASE_PATH="${NEXT_PUBLIC_BASE_PATH}" \
|
||||
FEATURE_FLAGS="${FEATURE_FLAGS}"
|
||||
ENV NEXT_PUBLIC_BASE_PATH="${NEXT_PUBLIC_BASE_PATH}"
|
||||
|
||||
# Sentry
|
||||
ENV NEXT_PUBLIC_SENTRY_DSN="${NEXT_PUBLIC_SENTRY_DSN}" \
|
||||
@@ -160,8 +158,6 @@ ENV \
|
||||
BAICHUAN_API_KEY="" BAICHUAN_MODEL_LIST="" \
|
||||
# Cloudflare
|
||||
CLOUDFLARE_API_KEY="" CLOUDFLARE_BASE_URL_OR_ACCOUNT_ID="" CLOUDFLARE_MODEL_LIST="" \
|
||||
# Cohere
|
||||
COHERE_API_KEY="" COHERE_MODEL_LIST="" COHERE_PROXY_URL="" \
|
||||
# DeepSeek
|
||||
DEEPSEEK_API_KEY="" DEEPSEEK_MODEL_LIST="" \
|
||||
# Fireworks AI
|
||||
@@ -188,8 +184,6 @@ ENV \
|
||||
MINIMAX_API_KEY="" MINIMAX_MODEL_LIST="" \
|
||||
# Mistral
|
||||
MISTRAL_API_KEY="" MISTRAL_MODEL_LIST="" \
|
||||
# ModelScope
|
||||
MODELSCOPE_API_KEY="" MODELSCOPE_MODEL_LIST="" MODELSCOPE_PROXY_URL="" \
|
||||
# Moonshot
|
||||
MOONSHOT_API_KEY="" MOONSHOT_MODEL_LIST="" MOONSHOT_PROXY_URL="" \
|
||||
# Novita
|
||||
@@ -204,8 +198,6 @@ ENV \
|
||||
OPENROUTER_API_KEY="" OPENROUTER_MODEL_LIST="" \
|
||||
# Perplexity
|
||||
PERPLEXITY_API_KEY="" PERPLEXITY_MODEL_LIST="" PERPLEXITY_PROXY_URL="" \
|
||||
# Qiniu
|
||||
QINIU_API_KEY="" QINIU_MODEL_LIST="" QINIU_PROXY_URL="" \
|
||||
# Qwen
|
||||
QWEN_API_KEY="" QWEN_MODEL_LIST="" QWEN_PROXY_URL="" \
|
||||
# SambaNova
|
||||
@@ -215,7 +207,7 @@ ENV \
|
||||
# SiliconCloud
|
||||
SILICONCLOUD_API_KEY="" SILICONCLOUD_MODEL_LIST="" SILICONCLOUD_PROXY_URL="" \
|
||||
# Spark
|
||||
SPARK_API_KEY="" SPARK_MODEL_LIST="" SPARK_PROXY_URL="" SPARK_SEARCH_MODE="" \
|
||||
SPARK_API_KEY="" SPARK_MODEL_LIST="" \
|
||||
# Stepfun
|
||||
STEPFUN_API_KEY="" STEPFUN_MODEL_LIST="" \
|
||||
# Taichu
|
||||
@@ -230,16 +222,12 @@ ENV \
|
||||
WENXIN_API_KEY="" WENXIN_MODEL_LIST="" \
|
||||
# xAI
|
||||
XAI_API_KEY="" XAI_MODEL_LIST="" XAI_PROXY_URL="" \
|
||||
# Xinference
|
||||
XINFERENCE_API_KEY="" XINFERENCE_MODEL_LIST="" XINFERENCE_PROXY_URL="" \
|
||||
# 01.AI
|
||||
ZEROONE_API_KEY="" ZEROONE_MODEL_LIST="" \
|
||||
# Zhipu
|
||||
ZHIPU_API_KEY="" ZHIPU_MODEL_LIST="" \
|
||||
# Tencent Cloud
|
||||
TENCENT_CLOUD_API_KEY="" TENCENT_CLOUD_MODEL_LIST="" \
|
||||
# Infini-AI
|
||||
INFINIAI_API_KEY="" INFINIAI_MODEL_LIST=""
|
||||
TENCENT_CLOUD_API_KEY="" TENCENT_CLOUD_MODEL_LIST=""
|
||||
|
||||
USER nextjs
|
||||
|
||||
|
||||
@@ -191,14 +191,13 @@ We have implemented support for the following model service providers:
|
||||
- **[Bedrock](https://lobechat.com/discover/provider/bedrock)**: Bedrock is a service provided by Amazon AWS, focusing on delivering advanced AI language and visual models for enterprises. Its model family includes Anthropic's Claude series, Meta's Llama 3.1 series, and more, offering a range of options from lightweight to high-performance, supporting tasks such as text generation, conversation, and image processing for businesses of varying scales and needs.
|
||||
- **[Google](https://lobechat.com/discover/provider/google)**: Google's Gemini series represents its most advanced, versatile AI models, developed by Google DeepMind, designed for multimodal capabilities, supporting seamless understanding and processing of text, code, images, audio, and video. Suitable for various environments from data centers to mobile devices, it significantly enhances the efficiency and applicability of AI models.
|
||||
- **[DeepSeek](https://lobechat.com/discover/provider/deepseek)**: DeepSeek is a company focused on AI technology research and application, with its latest model DeepSeek-V2.5 integrating general dialogue and code processing capabilities, achieving significant improvements in human preference alignment, writing tasks, and instruction following.
|
||||
- **[PPIO](https://lobechat.com/discover/provider/ppio)**: PPIO supports stable and cost-efficient open-source LLM APIs, such as DeepSeek, Llama, Qwen etc.
|
||||
- **[HuggingFace](https://lobechat.com/discover/provider/huggingface)**: The HuggingFace Inference API provides a fast and free way for you to explore thousands of models for various tasks. Whether you are prototyping for a new application or experimenting with the capabilities of machine learning, this API gives you instant access to high-performance models across multiple domains.
|
||||
- **[OpenRouter](https://lobechat.com/discover/provider/openrouter)**: OpenRouter is a service platform providing access to various cutting-edge large model interfaces, supporting OpenAI, Anthropic, LLaMA, and more, suitable for diverse development and application needs. Users can flexibly choose the optimal model and pricing based on their requirements, enhancing the AI experience.
|
||||
- **[Cloudflare Workers AI](https://lobechat.com/discover/provider/cloudflare)**: Run serverless GPU-powered machine learning models on Cloudflare's global network.
|
||||
|
||||
<details><summary><kbd>See more providers (+32)</kbd></summary>
|
||||
|
||||
- **[GitHub](https://lobechat.com/discover/provider/github)**: With GitHub Models, developers can become AI engineers and leverage the industry's leading AI models.
|
||||
|
||||
<details><summary><kbd>See more providers (+27)</kbd></summary>
|
||||
|
||||
- **[Novita](https://lobechat.com/discover/provider/novita)**: Novita AI is a platform providing a variety of large language models and AI image generation API services, flexible, reliable, and cost-effective. It supports the latest open-source models like Llama3 and Mistral, offering a comprehensive, user-friendly, and auto-scaling API solution for generative AI application development, suitable for the rapid growth of AI startups.
|
||||
- **[PPIO](https://lobechat.com/discover/provider/ppio)**: PPIO supports stable and cost-efficient open-source LLM APIs, such as DeepSeek, Llama, Qwen etc.
|
||||
- **[Together AI](https://lobechat.com/discover/provider/togetherai)**: Together AI is dedicated to achieving leading performance through innovative AI models, offering extensive customization capabilities, including rapid scaling support and intuitive deployment processes to meet various enterprise needs.
|
||||
@@ -206,11 +205,10 @@ We have implemented support for the following model service providers:
|
||||
- **[Groq](https://lobechat.com/discover/provider/groq)**: Groq's LPU inference engine has excelled in the latest independent large language model (LLM) benchmarks, redefining the standards for AI solutions with its remarkable speed and efficiency. Groq represents instant inference speed, demonstrating strong performance in cloud-based deployments.
|
||||
- **[Perplexity](https://lobechat.com/discover/provider/perplexity)**: Perplexity is a leading provider of conversational generation models, offering various advanced Llama 3.1 models that support both online and offline applications, particularly suited for complex natural language processing tasks.
|
||||
- **[Mistral](https://lobechat.com/discover/provider/mistral)**: Mistral provides advanced general, specialized, and research models widely used in complex reasoning, multilingual tasks, and code generation. Through functional calling interfaces, users can integrate custom functionalities for specific applications.
|
||||
- **[ModelScope](https://lobechat.com/discover/provider/modelscope)**:
|
||||
- **[Ai21Labs](https://lobechat.com/discover/provider/ai21)**: AI21 Labs builds foundational models and AI systems for enterprises, accelerating the application of generative AI in production.
|
||||
- **[Upstage](https://lobechat.com/discover/provider/upstage)**: Upstage focuses on developing AI models for various business needs, including Solar LLM and document AI, aiming to achieve artificial general intelligence (AGI) for work. It allows for the creation of simple conversational agents through Chat API and supports functional calling, translation, embedding, and domain-specific applications.
|
||||
- **[xAI (Grok)](https://lobechat.com/discover/provider/xai)**: xAI is a company dedicated to building artificial intelligence to accelerate human scientific discovery. Our mission is to advance our collective understanding of the universe.
|
||||
- **[Aliyun Bailian](https://lobechat.com/discover/provider/qwen)**: Tongyi Qianwen is a large-scale language model independently developed by Alibaba Cloud, featuring strong natural language understanding and generation capabilities. It can answer various questions, create written content, express opinions, and write code, playing a role in multiple fields.
|
||||
- **[xAI](https://lobechat.com/discover/provider/xai)**: xAI is a company dedicated to building artificial intelligence to accelerate human scientific discovery. Our mission is to advance our collective understanding of the universe.
|
||||
- **[Qwen](https://lobechat.com/discover/provider/qwen)**: Tongyi Qianwen is a large-scale language model independently developed by Alibaba Cloud, featuring strong natural language understanding and generation capabilities. It can answer various questions, create written content, express opinions, and write code, playing a role in multiple fields.
|
||||
- **[Wenxin](https://lobechat.com/discover/provider/wenxin)**: An enterprise-level one-stop platform for large model and AI-native application development and services, providing the most comprehensive and user-friendly toolchain for the entire process of generative artificial intelligence model development and application development.
|
||||
- **[Hunyuan](https://lobechat.com/discover/provider/hunyuan)**: A large language model developed by Tencent, equipped with powerful Chinese creative capabilities, logical reasoning abilities in complex contexts, and reliable task execution skills.
|
||||
- **[ZhiPu](https://lobechat.com/discover/provider/zhipu)**: Zhipu AI offers an open platform for multimodal and language models, supporting a wide range of AI application scenarios, including text processing, image understanding, and programming assistance.
|
||||
@@ -227,13 +225,10 @@ We have implemented support for the following model service providers:
|
||||
- **[Gitee AI](https://lobechat.com/discover/provider/giteeai)**: Gitee AI's Serverless API provides AI developers with an out of the box large model inference API service.
|
||||
- **[Taichu](https://lobechat.com/discover/provider/taichu)**: The Institute of Automation, Chinese Academy of Sciences, and Wuhan Artificial Intelligence Research Institute have launched a new generation of multimodal large models, supporting comprehensive question-answering tasks such as multi-turn Q\&A, text creation, image generation, 3D understanding, and signal analysis, with stronger cognitive, understanding, and creative abilities, providing a new interactive experience.
|
||||
- **[360 AI](https://lobechat.com/discover/provider/ai360)**: 360 AI is an AI model and service platform launched by 360 Company, offering various advanced natural language processing models, including 360GPT2 Pro, 360GPT Pro, 360GPT Turbo, and 360GPT Turbo Responsibility 8K. These models combine large-scale parameters and multimodal capabilities, widely applied in text generation, semantic understanding, dialogue systems, and code generation. With flexible pricing strategies, 360 AI meets diverse user needs, supports developer integration, and promotes the innovation and development of intelligent applications.
|
||||
- **[Search1API](https://lobechat.com/discover/provider/search1api)**: Search1API provides access to the DeepSeek series of models that can connect to the internet as needed, including standard and fast versions, supporting a variety of model sizes.
|
||||
- **[InfiniAI](https://lobechat.com/discover/provider/infiniai)**: Provides high-performance, easy-to-use, and secure large model services for application developers, covering the entire process from large model development to service deployment.
|
||||
- **[Qiniu](https://lobechat.com/discover/provider/qiniu)**: Qiniu, as a long-established cloud service provider, delivers cost-effective and reliable AI inference services for both real-time and batch processing, with a simple and user-friendly experience.
|
||||
|
||||
</details>
|
||||
|
||||
> 📊 Total providers: [<kbd>**42**</kbd>](https://lobechat.com/discover/providers)
|
||||
> 📊 Total providers: [<kbd>**37**</kbd>](https://lobechat.com/discover/providers)
|
||||
|
||||
<!-- PROVIDER LIST -->
|
||||
|
||||
@@ -330,12 +325,12 @@ In addition, these plugins are not limited to news aggregation, but can also ext
|
||||
|
||||
| Recent Submits | Description |
|
||||
| ---------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
|
||||
| [PortfolioMeta](https://lobechat.com/discover/plugin/StockData)<br/><sup>By **portfoliometa** on **2025-05-27**</sup> | Analyze stocks and get comprehensive real-time investment data and analytics.<br/>`stock` |
|
||||
| [Web](https://lobechat.com/discover/plugin/web)<br/><sup>By **Proghit** on **2025-01-24**</sup> | Smart web search that reads and analyzes pages to deliver comprehensive answers from Google results.<br/>`web` `search` |
|
||||
| [MintbaseSearch](https://lobechat.com/discover/plugin/mintbasesearch)<br/><sup>By **mintbase** on **2024-12-31**</sup> | Find any NFT data on the NEAR Protocol.<br/>`crypto` `nft` |
|
||||
| [Bing_websearch](https://lobechat.com/discover/plugin/Bingsearch-identifier)<br/><sup>By **FineHow** on **2024-12-22**</sup> | Search for information from the internet base BingApi<br/>`bingsearch` |
|
||||
| [Google CSE](https://lobechat.com/discover/plugin/google-cse)<br/><sup>By **vsnthdev** on **2024-12-02**</sup> | Searches Google through their official CSE API.<br/>`web` `search` |
|
||||
| [PortfolioMeta](https://lobechat.com/discover/plugin/StockData)<br/><sup>By **portfoliometa** on **2024-12-22**</sup> | Analyze stocks and get comprehensive real-time investment data and analytics.<br/>`stock` |
|
||||
|
||||
> 📊 Total plugins: [<kbd>**43**</kbd>](https://lobechat.com/discover/plugins)
|
||||
> 📊 Total plugins: [<kbd>**47**</kbd>](https://lobechat.com/discover/plugins)
|
||||
|
||||
<!-- PLUGIN LIST -->
|
||||
|
||||
@@ -369,12 +364,12 @@ Our marketplace is not just a showcase platform but also a collaborative space.
|
||||
|
||||
| Recent Submits | Description |
|
||||
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [学术论文综述专家](https://lobechat.com/discover/assistant/academic-paper-overview)<br/><sup>By **[arvinxx](https://github.com/arvinxx)** on **2025-03-11**</sup> | 擅长高质量文献检索与分析的学术研究助手<br/>`学术研究` `文献检索` `数据分析` `信息提取` `咨询` |
|
||||
| [Cron Expression Assistant](https://lobechat.com/discover/assistant/crontab-generate)<br/><sup>By **[edgesider](https://github.com/edgesider)** on **2025-02-17**</sup> | Crontab Expression Generator<br/>`crontab` `time-expression` `trigger-time` `generator` `technical-assistance` |
|
||||
| [Xiao Zhi French Translation Assistant](https://lobechat.com/discover/assistant/xiao-zhi-french-translation-asst-v-1)<br/><sup>By **[WeR-Best](https://github.com/WeR-Best)** on **2025-02-10**</sup> | A friendly, professional, and empathetic AI assistant for French translation<br/>`ai-assistant` `french-translation` `cross-cultural-communication` `creativity` |
|
||||
| [Investment Assistant](https://lobechat.com/discover/assistant/graham-investmentassi)<br/><sup>By **[farsightlin](https://github.com/farsightlin)** on **2025-02-06**</sup> | Helps users calculate the data needed for valuation<br/>`investment` `valuation` `financial-analysis` `calculator` |
|
||||
| [Language Charm Learning Mentor](https://lobechat.com/discover/assistant/bad-language-helper)<br/><sup>By **[Guducat](https://github.com/Guducat)** on **2025-02-06**</sup> | Specializes in teaching the charm of language and witty responses<br/>`language-learning` `dialogue-examples` |
|
||||
| [Astrology Researcher](https://lobechat.com/discover/assistant/fate-researcher)<br/><sup>By **[Jack980506](https://github.com/Jack980506)** on **2025-02-06**</sup> | Expert in BaZi astrology<br/>`astrology` `ba-zi` `traditional-culture` |
|
||||
|
||||
> 📊 Total agents: [<kbd>**488**</kbd> ](https://lobechat.com/discover/assistants)
|
||||
> 📊 Total agents: [<kbd>**487**</kbd> ](https://lobechat.com/discover/assistants)
|
||||
|
||||
<!-- AGENT LIST -->
|
||||
|
||||
@@ -764,7 +759,7 @@ Every bit counts and your one-time donation sparkles in our galaxy of support! Y
|
||||
|
||||
</details>
|
||||
|
||||
Copyright © 2025 [LobeHub][profile-link]. <br />
|
||||
Copyright © 2024 [LobeHub][profile-link]. <br />
|
||||
This project is [Apache 2.0](./LICENSE) licensed.
|
||||
|
||||
<!-- LINK GROUP -->
|
||||
|
||||
@@ -191,14 +191,13 @@ LobeChat 支持文件上传与知识库功能,你可以上传文件、图片
|
||||
- **[Bedrock](https://lobechat.com/discover/provider/bedrock)**: Bedrock 是亚马逊 AWS 提供的一项服务,专注于为企业提供先进的 AI 语言模型和视觉模型。其模型家族包括 Anthropic 的 Claude 系列、Meta 的 Llama 3.1 系列等,涵盖从轻量级到高性能的多种选择,支持文本生成、对话、图像处理等多种任务,适用于不同规模和需求的企业应用。
|
||||
- **[Google](https://lobechat.com/discover/provider/google)**: Google 的 Gemini 系列是其最先进、通用的 AI 模型,由 Google DeepMind 打造,专为多模态设计,支持文本、代码、图像、音频和视频的无缝理解与处理。适用于从数据中心到移动设备的多种环境,极大提升了 AI 模型的效率与应用广泛性。
|
||||
- **[DeepSeek](https://lobechat.com/discover/provider/deepseek)**: DeepSeek 是一家专注于人工智能技术研究和应用的公司,其最新模型 DeepSeek-V3 多项评测成绩超越 Qwen2.5-72B 和 Llama-3.1-405B 等开源模型,性能对齐领军闭源模型 GPT-4o 与 Claude-3.5-Sonnet。
|
||||
- **[PPIO](https://lobechat.com/discover/provider/ppio)**: PPIO 派欧云提供稳定、高性价比的开源模型 API 服务,支持 DeepSeek 全系列、Llama、Qwen 等行业领先大模型。
|
||||
- **[HuggingFace](https://lobechat.com/discover/provider/huggingface)**: HuggingFace Inference API 提供了一种快速且免费的方式,让您可以探索成千上万种模型,适用于各种任务。无论您是在为新应用程序进行原型设计,还是在尝试机器学习的功能,这个 API 都能让您即时访问多个领域的高性能模型。
|
||||
- **[OpenRouter](https://lobechat.com/discover/provider/openrouter)**: OpenRouter 是一个提供多种前沿大模型接口的服务平台,支持 OpenAI、Anthropic、LLaMA 及更多,适合多样化的开发和应用需求。用户可根据自身需求灵活选择最优的模型和价格,助力 AI 体验的提升。
|
||||
- **[Cloudflare Workers AI](https://lobechat.com/discover/provider/cloudflare)**: 在 Cloudflare 的全球网络上运行由无服务器 GPU 驱动的机器学习模型。
|
||||
|
||||
<details><summary><kbd>See more providers (+32)</kbd></summary>
|
||||
|
||||
- **[GitHub](https://lobechat.com/discover/provider/github)**: 通过 GitHub 模型,开发人员可以成为 AI 工程师,并使用行业领先的 AI 模型进行构建。
|
||||
|
||||
<details><summary><kbd>See more providers (+27)</kbd></summary>
|
||||
|
||||
- **[Novita](https://lobechat.com/discover/provider/novita)**: Novita AI 是一个提供多种大语言模型与 AI 图像生成的 API 服务的平台,灵活、可靠且具有成本效益。它支持 Llama3、Mistral 等最新的开源模型,并为生成式 AI 应用开发提供了全面、用户友好且自动扩展的 API 解决方案,适合 AI 初创公司的快速发展。
|
||||
- **[PPIO](https://lobechat.com/discover/provider/ppio)**: PPIO 派欧云提供稳定、高性价比的开源模型 API 服务,支持 DeepSeek 全系列、Llama、Qwen 等行业领先大模型。
|
||||
- **[Together AI](https://lobechat.com/discover/provider/togetherai)**: Together AI 致力于通过创新的 AI 模型实现领先的性能,提供广泛的自定义能力,包括快速扩展支持和直观的部署流程,满足企业的各种需求。
|
||||
@@ -206,11 +205,10 @@ LobeChat 支持文件上传与知识库功能,你可以上传文件、图片
|
||||
- **[Groq](https://lobechat.com/discover/provider/groq)**: Groq 的 LPU 推理引擎在最新的独立大语言模型(LLM)基准测试中表现卓越,以其惊人的速度和效率重新定义了 AI 解决方案的标准。Groq 是一种即时推理速度的代表,在基于云的部署中展现了良好的性能。
|
||||
- **[Perplexity](https://lobechat.com/discover/provider/perplexity)**: Perplexity 是一家领先的对话生成模型提供商,提供多种先进的 Llama 3.1 模型,支持在线和离线应用,特别适用于复杂的自然语言处理任务。
|
||||
- **[Mistral](https://lobechat.com/discover/provider/mistral)**: Mistral 提供先进的通用、专业和研究型模型,广泛应用于复杂推理、多语言任务、代码生成等领域,通过功能调用接口,用户可以集成自定义功能,实现特定应用。
|
||||
- **[ModelScope](https://lobechat.com/discover/provider/modelscope)**:
|
||||
- **[Ai21Labs](https://lobechat.com/discover/provider/ai21)**: AI21 Labs 为企业构建基础模型和人工智能系统,加速生成性人工智能在生产中的应用。
|
||||
- **[Upstage](https://lobechat.com/discover/provider/upstage)**: Upstage 专注于为各种商业需求开发 AI 模型,包括 Solar LLM 和文档 AI,旨在实现工作的人造通用智能(AGI)。通过 Chat API 创建简单的对话代理,并支持功能调用、翻译、嵌入以及特定领域应用。
|
||||
- **[xAI (Grok)](https://lobechat.com/discover/provider/xai)**: xAI 是一家致力于构建人工智能以加速人类科学发现的公司。我们的使命是推动我们对宇宙的共同理解。
|
||||
- **[Aliyun Bailian](https://lobechat.com/discover/provider/qwen)**: 通义千问是阿里云自主研发的超大规模语言模型,具有强大的自然语言理解和生成能力。它可以回答各种问题、创作文字内容、表达观点看法、撰写代码等,在多个领域发挥作用。
|
||||
- **[xAI](https://lobechat.com/discover/provider/xai)**: xAI 是一家致力于构建人工智能以加速人类科学发现的公司。我们的使命是推动我们对宇宙的共同理解。
|
||||
- **[Qwen](https://lobechat.com/discover/provider/qwen)**: 通义千问是阿里云自主研发的超大规模语言模型,具有强大的自然语言理解和生成能力。它可以回答各种问题、创作文字内容、表达观点看法、撰写代码等,在多个领域发挥作用。
|
||||
- **[Wenxin](https://lobechat.com/discover/provider/wenxin)**: 企业级一站式大模型与 AI 原生应用开发及服务平台,提供最全面易用的生成式人工智能模型开发、应用开发全流程工具链
|
||||
- **[Hunyuan](https://lobechat.com/discover/provider/hunyuan)**: 由腾讯研发的大语言模型,具备强大的中文创作能力,复杂语境下的逻辑推理能力,以及可靠的任务执行能力
|
||||
- **[ZhiPu](https://lobechat.com/discover/provider/zhipu)**: 智谱 AI 提供多模态与语言模型的开放平台,支持广泛的 AI 应用场景,包括文本处理、图像理解与编程辅助等。
|
||||
@@ -227,13 +225,10 @@ LobeChat 支持文件上传与知识库功能,你可以上传文件、图片
|
||||
- **[Gitee AI](https://lobechat.com/discover/provider/giteeai)**: Gitee AI 的 Serverless API 为 AI 开发者提供开箱即用的大模型推理 API 服务。
|
||||
- **[Taichu](https://lobechat.com/discover/provider/taichu)**: 中科院自动化研究所和武汉人工智能研究院推出新一代多模态大模型,支持多轮问答、文本创作、图像生成、3D 理解、信号分析等全面问答任务,拥有更强的认知、理解、创作能力,带来全新互动体验。
|
||||
- **[360 AI](https://lobechat.com/discover/provider/ai360)**: 360 AI 是 360 公司推出的 AI 模型和服务平台,提供多种先进的自然语言处理模型,包括 360GPT2 Pro、360GPT Pro、360GPT Turbo 和 360GPT Turbo Responsibility 8K。这些模型结合了大规模参数和多模态能力,广泛应用于文本生成、语义理解、对话系统与代码生成等领域。通过灵活的定价策略,360 AI 满足多样化用户需求,支持开发者集成,推动智能化应用的革新和发展。
|
||||
- **[Search1API](https://lobechat.com/discover/provider/search1api)**: Search1API 提供可根据需要自行联网的 DeepSeek 系列模型的访问,包括标准版和快速版本,支持多种参数规模的模型选择。
|
||||
- **[InfiniAI](https://lobechat.com/discover/provider/infiniai)**: 为应用开发者提供高性能、易上手、安全可靠的大模型服务,覆盖从大模型开发到大模型服务化部署的全流程。
|
||||
- **[Qiniu](https://lobechat.com/discover/provider/qiniu)**: 七牛作为老牌云服务厂商,提供高性价比稳定的实时、批量 AI 推理服务,简单易用。
|
||||
|
||||
</details>
|
||||
|
||||
> 📊 Total providers: [<kbd>**42**</kbd>](https://lobechat.com/discover/providers)
|
||||
> 📊 Total providers: [<kbd>**37**</kbd>](https://lobechat.com/discover/providers)
|
||||
|
||||
<!-- PROVIDER LIST -->
|
||||
|
||||
@@ -323,12 +318,12 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
|
||||
|
||||
| 最近新增 | 描述 |
|
||||
| -------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
|
||||
| [PortfolioMeta](https://lobechat.com/discover/plugin/StockData)<br/><sup>By **portfoliometa** on **2025-05-27**</sup> | 分析股票并获取全面的实时投资数据和分析。<br/>`股票` |
|
||||
| [网页](https://lobechat.com/discover/plugin/web)<br/><sup>By **Proghit** on **2025-01-24**</sup> | 智能网页搜索,读取和分析页面,以提供来自 Google 结果的全面答案。<br/>`网页` `搜索` |
|
||||
| [MintbaseSearch](https://lobechat.com/discover/plugin/mintbasesearch)<br/><sup>By **mintbase** on **2024-12-31**</sup> | 在 NEAR 协议上查找任何 NFT 数据。<br/>`加密货币` `nft` |
|
||||
| [必应网页搜索](https://lobechat.com/discover/plugin/Bingsearch-identifier)<br/><sup>By **FineHow** on **2024-12-22**</sup> | 通过 BingApi 搜索互联网上的信息<br/>`bingsearch` |
|
||||
| [谷歌自定义搜索引擎](https://lobechat.com/discover/plugin/google-cse)<br/><sup>By **vsnthdev** on **2024-12-02**</sup> | 通过他们的官方自定义搜索引擎 API 搜索谷歌。<br/>`网络` `搜索` |
|
||||
| [PortfolioMeta](https://lobechat.com/discover/plugin/StockData)<br/><sup>By **portfoliometa** on **2024-12-22**</sup> | 分析股票并获取全面的实时投资数据和分析。<br/>`股票` |
|
||||
|
||||
> 📊 Total plugins: [<kbd>**43**</kbd>](https://lobechat.com/discover/plugins)
|
||||
> 📊 Total plugins: [<kbd>**47**</kbd>](https://lobechat.com/discover/plugins)
|
||||
|
||||
<!-- PLUGIN LIST -->
|
||||
|
||||
@@ -356,14 +351,14 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
|
||||
|
||||
<!-- AGENT LIST -->
|
||||
|
||||
| 最近新增 | 描述 |
|
||||
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
|
||||
| [学术论文综述专家](https://lobechat.com/discover/assistant/academic-paper-overview)<br/><sup>By **[arvinxx](https://github.com/arvinxx)** on **2025-03-11**</sup> | 擅长高质量文献检索与分析的学术研究助手<br/>`学术研究` `文献检索` `数据分析` `信息提取` `咨询` |
|
||||
| [Cron 表达式助手](https://lobechat.com/discover/assistant/crontab-generate)<br/><sup>By **[edgesider](https://github.com/edgesider)** on **2025-02-17**</sup> | Crontab 表达式生成<br/>`crontab` `时间表达` `触发时间` `生成器` `技术辅助` |
|
||||
| [小智法语翻译助手](https://lobechat.com/discover/assistant/xiao-zhi-french-translation-asst-v-1)<br/><sup>By **[WeR-Best](https://github.com/WeR-Best)** on **2025-02-10**</sup> | 友好、专业、富有同理心的法语翻译 AI 助手<br/>`ai助手` `法语翻译` `跨文化交流` `创造力` |
|
||||
| [投资小助手](https://lobechat.com/discover/assistant/graham-investmentassi)<br/><sup>By **[farsightlin](https://github.com/farsightlin)** on **2025-02-06**</sup> | 帮助用户计算估值所需的一些数据<br/>`投资` `估值` `财务分析` `计算器` |
|
||||
| 最近新增 | 描述 |
|
||||
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
||||
| [Cron 表达式助手](https://lobechat.com/discover/assistant/crontab-generate)<br/><sup>By **[edgesider](https://github.com/edgesider)** on **2025-02-17**</sup> | Crontab 表达式生成<br/>`crontab` `时间表达` `触发时间` `生成器` `技术辅助` |
|
||||
| [小智法语翻译助手](https://lobechat.com/discover/assistant/xiao-zhi-french-translation-asst-v-1)<br/><sup>By **[WeR-Best](https://github.com/WeR-Best)** on **2025-02-10**</sup> | 友好、专业、富有同理心的法语翻译 AI 助手<br/>`ai助手` `法语翻译` `跨文化交流` `创造力` |
|
||||
| [语言魅力学习导师](https://lobechat.com/discover/assistant/bad-language-helper)<br/><sup>By **[Guducat](https://github.com/Guducat)** on **2025-02-06**</sup> | 擅长教学语言的魅力与花样回复<br/>`语言学习` `对话示例` |
|
||||
| [命理研究员](https://lobechat.com/discover/assistant/fate-researcher)<br/><sup>By **[Jack980506](https://github.com/Jack980506)** on **2025-02-06**</sup> | 精通八字命<br/>`命理学` `八字` `传统文化` |
|
||||
|
||||
> 📊 Total agents: [<kbd>**488**</kbd> ](https://lobechat.com/discover/assistants)
|
||||
> 📊 Total agents: [<kbd>**487**</kbd> ](https://lobechat.com/discover/assistants)
|
||||
|
||||
<!-- AGENT LIST -->
|
||||
|
||||
@@ -786,7 +781,7 @@ $ pnpm run dev
|
||||
|
||||
</details>
|
||||
|
||||
Copyright © 2025 [LobeHub][profile-link]. <br />
|
||||
Copyright © 2023 [LobeHub][profile-link]. <br />
|
||||
This project is [Apache 2.0](./LICENSE) licensed.
|
||||
|
||||
<!-- LINK GROUP -->
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
node_modules
|
||||
dist
|
||||
out
|
||||
.DS_Store
|
||||
.eslintcache
|
||||
*.log*
|
||||
standalone
|
||||
release
|
||||
@@ -1,31 +0,0 @@
|
||||
const { defineConfig } = require('@lobehub/i18n-cli');
|
||||
|
||||
module.exports = defineConfig({
|
||||
entry: 'resources/locales/zh-CN',
|
||||
entryLocale: 'zh-CN',
|
||||
output: 'resources/locales',
|
||||
outputLocales: [
|
||||
'ar',
|
||||
'bg-BG',
|
||||
'zh-TW',
|
||||
'en-US',
|
||||
'ru-RU',
|
||||
'ja-JP',
|
||||
'ko-KR',
|
||||
'fr-FR',
|
||||
'tr-TR',
|
||||
'es-ES',
|
||||
'pt-BR',
|
||||
'de-DE',
|
||||
'it-IT',
|
||||
'nl-NL',
|
||||
'pl-PL',
|
||||
'vi-VN',
|
||||
'fa-IR',
|
||||
],
|
||||
temperature: 0,
|
||||
modelName: 'gpt-4o-mini',
|
||||
experimental: {
|
||||
jsonMode: true,
|
||||
},
|
||||
});
|
||||
@@ -1,4 +0,0 @@
|
||||
lockfile=false
|
||||
shamefully-hoist=true
|
||||
electron_mirror=https://npmmirror.com/mirrors/electron/
|
||||
electron_builder_binaries_mirror=https://npmmirror.com/mirrors/electron-builder-binaries/
|
||||
@@ -1,495 +0,0 @@
|
||||
## 核心框架组件目录架构
|
||||
|
||||
### 主进程核心组件
|
||||
|
||||
```
|
||||
apps/desktop/src/main/
|
||||
├── core/ // 核心功能
|
||||
│ ├── App.ts // 应用核心类,整合所有管理器
|
||||
│ ├── Browser.ts // 浏览器窗口类
|
||||
│ ├── BrowserManager.ts // 浏览器窗口管理
|
||||
│ ├── I18nManager.ts // 国际化管理
|
||||
│ ├── IoCContainer.ts // 依赖注入容器
|
||||
│ ├── MenuManager.ts // 菜单管理核心类,负责选择和协调平台实现
|
||||
│ ├── ShortcutManager.ts // 快捷键管理
|
||||
│ ├── StoreManager.ts // 存储管理
|
||||
│ └── UpdaterManager.ts // 更新管理
|
||||
├── controllers/ // 控制器层,处理渲染进程调用
|
||||
│ ├── AuthCtr.ts // 认证控制器
|
||||
│ ├── BrowserWindowsCtr.ts // 浏览器窗口控制器
|
||||
│ ├── DevtoolsCtr.ts // 开发工具控制器
|
||||
│ ├── LocalFileCtr.ts // 本地文件控制器
|
||||
│ ├── MenuCtr.ts // 菜单控制器
|
||||
│ ├── RemoteServerConfigCtr.ts // 远程服务器配置控制器
|
||||
│ ├── RemoteServerSyncCtr.ts // 远程服务器同步控制器
|
||||
│ ├── ShortcutCtr.ts // 快捷键控制器
|
||||
│ ├── SystemCtr.ts // 系统控制器
|
||||
│ ├── UpdaterCtr.ts // 更新控制器
|
||||
│ ├── UploadFileCtr.ts // 文件上传控制器
|
||||
│ └── index.ts // 控制器导出
|
||||
├── services/ // 服务层
|
||||
│ ├── fileSearchSrv.ts // 文件搜索服务
|
||||
│ ├── fileSrv.ts // 文件服务
|
||||
│ └── index.ts // 服务导出
|
||||
├── modules/ // 功能模块
|
||||
│ ├── fileSearch/ // 文件搜索模块
|
||||
│ └── updater/ // 更新模块
|
||||
├── menus/ // 菜单实现目录
|
||||
│ ├── index.ts // 导出平台实现和接口
|
||||
│ ├── types.ts // 定义菜单平台接口 IMenuPlatform
|
||||
│ └── impl/ // 平台特定实现目录
|
||||
│ ├── BaseMenuPlatform.ts // 基础平台类,注入App
|
||||
│ ├── DarwinMenu.ts // macOS 充血模型实现
|
||||
│ ├── WindowsMenu.ts // Windows 充血模型实现
|
||||
│ └── LinuxMenu.ts // Linux 充血模型实现
|
||||
├── shortcuts/ // 快捷键实现
|
||||
│ ├── config.ts // 快捷键配置
|
||||
│ └── index.ts // 快捷键导出
|
||||
├── utils/ // 工具函数
|
||||
│ ├── file-system.ts // 文件系统工具
|
||||
│ ├── logger.ts // 日志工具
|
||||
│ └── next-electron-rsc.ts // Next.js Electron RSC 工具
|
||||
├── types/ // 类型定义
|
||||
│ ├── fileSearch.ts // 文件搜索类型
|
||||
│ └── store.ts // 存储类型
|
||||
├── const/ // 常量定义
|
||||
│ ├── dir.ts // 目录常量
|
||||
│ ├── env.ts // 环境常量
|
||||
│ └── store.ts // 存储常量
|
||||
├── locales/ // 国际化资源
|
||||
│ ├── index.ts // 导出 i18n 相关功能
|
||||
│ ├── resources.ts // 资源加载逻辑
|
||||
│ └── default/ // 默认中文翻译源文件
|
||||
│ ├── index.ts // 导出所有翻译
|
||||
│ ├── menu.ts // 菜单翻译
|
||||
│ ├── dialog.ts // 对话框翻译
|
||||
│ └── common.ts // 通用翻译
|
||||
└── index.ts // 主进程入口文件
|
||||
```
|
||||
|
||||
### 预加载脚本
|
||||
|
||||
```
|
||||
apps/desktop/src/preload/
|
||||
├── index.ts // 预加载脚本入口
|
||||
└── apis/ // 预加载 API
|
||||
└── ... // 各种 API 实现
|
||||
```
|
||||
|
||||
### 共享代码
|
||||
|
||||
```
|
||||
apps/desktop/src/common/
|
||||
├── constants/ // 共享常量
|
||||
├── types/ // 共享类型
|
||||
└── utils/ // 共享工具函数
|
||||
```
|
||||
|
||||
## 功能模块实现
|
||||
|
||||
### 菜单实现框架
|
||||
|
||||
```
|
||||
apps/desktop/src/main/
|
||||
├── core/
|
||||
│ ├── App.ts // 应用核心类
|
||||
│ ├── BrowserManager.ts // 浏览器窗口管理
|
||||
│ └── MenuManager.ts // 菜单管理核心类,负责选择和协调平台实现
|
||||
├── menus/ // 菜单实现目录
|
||||
│ ├── index.ts // 导出平台实现和接口
|
||||
│ ├── types.ts // 定义菜单平台接口 IMenuPlatform
|
||||
│ └── impl/ // 平台特定实现目录
|
||||
│ ├── BaseMenuPlatform.ts // 基础平台类,注入App
|
||||
│ ├── DarwinMenu.ts // macOS 充血模型实现
|
||||
│ ├── WindowsMenu.ts // Windows 充血模型实现
|
||||
│ └── LinuxMenu.ts // Linux 充血模型实现
|
||||
├── controllers/
|
||||
│ └── MenuCtr.ts // 菜单控制器,处理渲染进程调用
|
||||
```
|
||||
|
||||
### 国际化 (i18n) 实现
|
||||
|
||||
```
|
||||
apps/desktop/src/main/
|
||||
├── core/
|
||||
│ ├── I18nManager.ts // i18n 管理器
|
||||
│ └── App.ts // 应用主类,集成 i18n
|
||||
├── locales/
|
||||
│ ├── index.ts // 导出 i18n 相关功能
|
||||
│ ├── resources.ts // 资源加载逻辑
|
||||
│ └── default/ // 默认中文翻译源文件
|
||||
│ ├── index.ts // 导出所有翻译
|
||||
│ ├── menu.ts // 菜单翻译
|
||||
│ ├── dialog.ts // 对话框翻译
|
||||
│ └── common.ts // 通用翻译
|
||||
```
|
||||
|
||||
主进程 i18n 国际化管理使用方式:
|
||||
|
||||
1. 直接导入 i18nManager 实例:
|
||||
|
||||
```typescript
|
||||
import i18nManager from '@/locales';
|
||||
```
|
||||
|
||||
2. 使用翻译函数:
|
||||
|
||||
```typescript
|
||||
import { t } from '@/locales';
|
||||
|
||||
const translated = t('key');
|
||||
```
|
||||
|
||||
3. 添加新翻译:
|
||||
在 locales/default/ 目录下添加翻译源文件
|
||||
|
||||
## 核心模块详细说明
|
||||
|
||||
### 认证模块 (Auth)
|
||||
|
||||
认证模块负责处理用户身份验证和授权流程,主要包括:
|
||||
|
||||
1. **AuthCtr 控制器**:实现 OAuth 授权流程
|
||||
- 请求授权:打开浏览器进行 OAuth 认证
|
||||
- 处理回调:接收授权码并交换访问令牌
|
||||
- 令牌刷新:自动刷新过期的访问令牌
|
||||
- 事件广播:向渲染进程通知授权状态变化
|
||||
|
||||
```typescript
|
||||
// 认证流程示例
|
||||
@ipcClientEvent('requestAuthorization')
|
||||
async requestAuthorization(config: DataSyncConfig) {
|
||||
// 生成状态参数防止 CSRF 攻击
|
||||
this.authRequestState = crypto.randomBytes(16).toString('hex');
|
||||
|
||||
// 构建授权 URL
|
||||
const authUrl = new URL('/oidc/auth', remoteUrl);
|
||||
authUrl.search = querystring.stringify({
|
||||
client_id: 'lobe-chat',
|
||||
response_type: 'code',
|
||||
redirect_uri: `${protocolPrefix}://auth/callback`,
|
||||
scope: 'openid profile',
|
||||
state: this.authRequestState,
|
||||
});
|
||||
|
||||
// 在默认浏览器中打开授权 URL
|
||||
await shell.openExternal(authUrl.toString());
|
||||
}
|
||||
```
|
||||
|
||||
2. **桌面端特定认证**:
|
||||
- 在桌面应用中使用固定的用户 ID
|
||||
- 支持与 Clerk 和 NextAuth 等认证系统集成
|
||||
|
||||
### 存储模块 (Store)
|
||||
|
||||
存储模块使用 electron-store 实现持久化数据存储:
|
||||
|
||||
1. **StoreManager 类**:
|
||||
- 提供统一的存储接口
|
||||
- 支持类型安全的存取操作
|
||||
- 管理应用配置和用户数据
|
||||
|
||||
```typescript
|
||||
// 存储管理器使用示例
|
||||
export class StoreManager {
|
||||
private store: Store<ElectronMainStore>;
|
||||
|
||||
// 获取配置项
|
||||
get<K extends StoreKey>(key: K, defaultValue?: ElectronMainStore[K]): ElectronMainStore[K] {
|
||||
return this.store.get(key, defaultValue as any);
|
||||
}
|
||||
|
||||
// 设置配置项
|
||||
set<K extends StoreKey>(key: K, value: ElectronMainStore[K]): void {
|
||||
this.store.set(key, value);
|
||||
}
|
||||
|
||||
// 删除配置项
|
||||
delete(key: StoreKey): void {
|
||||
this.store.delete(key);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
2. **存储用途**:
|
||||
- 窗口状态保存
|
||||
- 用户偏好设置
|
||||
- 认证令牌存储
|
||||
- 快捷键配置
|
||||
- 国际化语言设置
|
||||
|
||||
### 快捷键模块 (Shortcuts)
|
||||
|
||||
快捷键模块管理全局键盘快捷键:
|
||||
|
||||
1. **ShortcutManager 类**:
|
||||
- 注册和管理全局快捷键
|
||||
- 支持自定义快捷键配置
|
||||
- 提供快捷键状态查询
|
||||
|
||||
```typescript
|
||||
// 快捷键管理器示例
|
||||
export class ShortcutManager {
|
||||
private shortcuts: Map<string, () => void> = new Map();
|
||||
private shortcutsConfig: Record<string, string> = {};
|
||||
|
||||
// 注册快捷键
|
||||
registerShortcut(accelerator: string, callback: () => void): boolean {
|
||||
const success = globalShortcut.register(accelerator, callback);
|
||||
if (success) {
|
||||
this.shortcuts.set(accelerator, callback);
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
// 更新快捷键配置
|
||||
updateShortcutConfig(id: string, accelerator: string): boolean {
|
||||
this.shortcutsConfig[id] = accelerator;
|
||||
this.saveShortcutsConfig();
|
||||
this.registerConfiguredShortcuts();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
2. **快捷键装饰器**:
|
||||
- 使用 `@shortcut` 装饰器简化快捷键注册
|
||||
- 通过 IoC 容器管理快捷键映射
|
||||
|
||||
### 控制框架 (Control Framework)
|
||||
|
||||
控制框架实现了主进程和渲染进程之间的通信:
|
||||
|
||||
1. **ControllerModule 基类**:
|
||||
- 所有控制器的基础类
|
||||
- 提供生命周期钩子 (beforeAppReady, afterAppReady)
|
||||
- 注入 App 实例
|
||||
|
||||
```typescript
|
||||
// 控制器基类和装饰器
|
||||
export class ControllerModule implements IControllerModule {
|
||||
constructor(public app: App) {
|
||||
this.app = app;
|
||||
}
|
||||
}
|
||||
|
||||
// IPC 客户端事件装饰器
|
||||
export const ipcClientEvent = (method: keyof ClientDispatchEvents) =>
|
||||
ipcDecorator(method, 'client');
|
||||
|
||||
// IPC 服务器事件装饰器
|
||||
export const ipcServerEvent = (method: keyof ServerDispatchEvents) =>
|
||||
ipcDecorator(method, 'server');
|
||||
```
|
||||
|
||||
2. **IoC 容器**:
|
||||
- 依赖注入容器管理控制器实例
|
||||
- 注册和解析 IPC 事件处理程序
|
||||
- 管理快捷键和控制器方法的映射
|
||||
|
||||
### 服务逻辑 (Service Logic)
|
||||
|
||||
服务层提供业务逻辑实现:
|
||||
|
||||
1. **ServiceModule 基类**:
|
||||
- 所有服务的基础类
|
||||
- 注入 App 实例
|
||||
- 提供业务逻辑封装
|
||||
|
||||
```typescript
|
||||
// 服务模块基类
|
||||
export class ServiceModule {
|
||||
constructor(public app: App) {
|
||||
this.app = app;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
2. **服务实现**:
|
||||
- fileSearchSrv:文件搜索服务
|
||||
- fileSrv:文件操作服务
|
||||
|
||||
### 数据存储 (Electron Settings)
|
||||
|
||||
Electron Settings 基于 electron-store 实现,提供类型安全的数据存储:
|
||||
|
||||
1. **存储配置**:
|
||||
- 使用 JSON 文件存储配置
|
||||
- 支持默认值设置
|
||||
- 自动创建存储目录
|
||||
|
||||
```typescript
|
||||
// 存储初始化
|
||||
this.store = new Store<ElectronMainStore>({
|
||||
defaults: STORE_DEFAULTS,
|
||||
name: STORE_NAME,
|
||||
});
|
||||
|
||||
// 确保存储目录存在
|
||||
const storagePath = this.store.get('storagePath');
|
||||
makeSureDirExist(storagePath);
|
||||
```
|
||||
|
||||
2. **存储操作**:
|
||||
- 类型安全的 get/set 方法
|
||||
- 支持删除和清除操作
|
||||
- 提供存储编辑器功能
|
||||
|
||||
### 主进程和渲染进程通信 (Main-Renderer Communication)
|
||||
|
||||
主进程和渲染进程通信基于 Electron IPC 机制:
|
||||
|
||||
1. **IPC 事件处理**:
|
||||
- 使用装饰器注册 IPC 事件处理程序
|
||||
- 支持客户端事件和服务器事件
|
||||
- 自动映射控制器方法到 IPC 事件
|
||||
|
||||
```typescript
|
||||
// IPC 事件初始化
|
||||
private initializeIPCEvents() {
|
||||
// 注册客户端事件处理程序
|
||||
this.ipcClientEventMap.forEach((eventInfo, key) => {
|
||||
ipcMain.handle(key, async (e, ...data) => {
|
||||
return await eventInfo.controller[eventInfo.methodName](...data);
|
||||
});
|
||||
});
|
||||
|
||||
// 注册服务器事件处理程序
|
||||
const ipcServerEvents = {} as ElectronIPCEventHandler;
|
||||
this.ipcServerEventMap.forEach((eventInfo, key) => {
|
||||
ipcServerEvents[key] = async (payload) => {
|
||||
return await eventInfo.controller[eventInfo.methodName](payload);
|
||||
};
|
||||
});
|
||||
|
||||
// 创建 IPC 服务器
|
||||
this.ipcServer = new ElectronIPCServer(name, ipcServerEvents);
|
||||
}
|
||||
```
|
||||
|
||||
2. **事件广播**:
|
||||
- 主进程向渲染进程广播事件
|
||||
- 支持向所有窗口或特定窗口发送消息
|
||||
|
||||
### 日志系统 (Logging)
|
||||
|
||||
日志系统提供统一的日志记录接口:
|
||||
|
||||
1. **日志工具**:
|
||||
- 基于 debug 和 electron-log 实现
|
||||
- 支持不同日志级别 (debug, info, warn, error, verbose)
|
||||
- 根据环境自动调整日志行为
|
||||
|
||||
```typescript
|
||||
// 创建日志记录器
|
||||
export const createLogger = (namespace: string) => {
|
||||
const debugLogger = debug(namespace);
|
||||
|
||||
return {
|
||||
debug: (message, ...args) => {
|
||||
debugLogger(message, ...args);
|
||||
},
|
||||
error: (message, ...args) => {
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
electronLog.error(message, ...args);
|
||||
}
|
||||
debugLogger(`ERROR: ${message}`, ...args);
|
||||
},
|
||||
// 其他日志级别...
|
||||
};
|
||||
};
|
||||
```
|
||||
|
||||
2. **日志配置**:
|
||||
- 开发环境显示详细日志
|
||||
- 生产环境记录到文件
|
||||
- 支持命名空间隔离日志
|
||||
|
||||
### 自动更新 (Auto Updates)
|
||||
|
||||
自动更新模块基于 electron-updater 实现:
|
||||
|
||||
1. **UpdaterManager 类**:
|
||||
- 检查更新
|
||||
- 下载更新
|
||||
- 安装更新
|
||||
- 支持立即安装或下次启动安装
|
||||
|
||||
```typescript
|
||||
// 更新管理器示例
|
||||
export class UpdaterManager {
|
||||
// 检查更新
|
||||
public checkForUpdates = async ({ manual = false }: { manual?: boolean } = {}) => {
|
||||
if (this.checking || this.downloading) return;
|
||||
|
||||
this.checking = true;
|
||||
this.isManualCheck = manual;
|
||||
|
||||
try {
|
||||
await autoUpdater.checkForUpdates();
|
||||
} catch (error) {
|
||||
logger.error('Error checking for updates:', error.message);
|
||||
} finally {
|
||||
this.checking = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 下载更新
|
||||
public downloadUpdate = async (manual: boolean = false) => {
|
||||
if (this.downloading || !this.updateAvailable) return;
|
||||
|
||||
this.downloading = true;
|
||||
|
||||
try {
|
||||
await autoUpdater.downloadUpdate();
|
||||
} catch (error) {
|
||||
this.downloading = false;
|
||||
logger.error('Error downloading update:', error);
|
||||
}
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
2. **更新配置**:
|
||||
- 支持多渠道发布 (stable, beta, nightly)
|
||||
- 自动检查更新
|
||||
- 更新事件通知
|
||||
|
||||
## 桌面端架构图
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────────┐
|
||||
│ Electron Application │
|
||||
├─────────────────────────────────────────────────────────────────┤
|
||||
│ │
|
||||
│ ┌─────────────────┐ ┌──────────────────────────┐ │
|
||||
│ │ Main Process │ │ Renderer Process │ │
|
||||
│ │ │ │ │ │
|
||||
│ │ ┌─────────────┐│ │ ┌────────────────────┐ │ │
|
||||
│ │ │ Core ││ │ │ │ │ │
|
||||
│ │ │ Managers ││ │ │ │ │ │
|
||||
│ │ └─────────────┘│ │ │ Next.js App │ │ │
|
||||
│ │ │ │ │ │ │ │ │
|
||||
│ │ ┌─────▼─────┐ │ │ │ │ │ │
|
||||
│ │ │Controllers│ │◄──────────┼──┤ │ │ │
|
||||
│ │ └─────┬─────┘ │ IPC │ └────────────────────┘ │ │
|
||||
│ │ │ │Communication │ │
|
||||
│ │ ┌─────▼─────┐ │ │ │ │
|
||||
│ │ │ Services │ │ │ │ │
|
||||
│ │ └─────┬─────┘ │ │ │ │
|
||||
│ │ │ │ │ │ │
|
||||
│ │ ┌─────▼─────┐ │ │ │ │
|
||||
│ │ │ Modules │ │ │ │ │
|
||||
│ │ └───────────┘ │ │ │ │
|
||||
│ │ │ │ │ │
|
||||
│ └─────────────────┘ └──────────────────────────┘ │
|
||||
│ │
|
||||
│ ┌───────────────────┐ │
|
||||
│ │ Preload Script │ │
|
||||
│ │ (Bridge between │ │
|
||||
│ │ Main & Renderer) │ │
|
||||
│ └───────────────────┘ │
|
||||
│ │
|
||||
└─────────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
@@ -1,60 +0,0 @@
|
||||
# LobeHub Desktop Application
|
||||
|
||||
LobeHub Desktop 是 [LobeChat](https://github.com/lobehub/lobe-chat) 的跨平台桌面应用程序,使用 Electron 构建,提供了更加原生的桌面体验和功能。
|
||||
|
||||
## 功能特点
|
||||
|
||||
- **跨平台支持**:支持 macOS (Intel/Apple Silicon)、Windows 和 Linux 系统
|
||||
- **自动更新**:内置更新机制,确保您始终使用最新版本
|
||||
- **多语言支持**:完整的国际化支持,包括中文、英文等多种语言
|
||||
- **原生集成**:与操作系统深度集成,提供原生菜单、快捷键和通知
|
||||
- **安全可靠**:macOS 版本经过公证,确保安全性
|
||||
- **多渠道发布**:提供稳定版、测试版和每日构建版本
|
||||
|
||||
## 开发环境设置
|
||||
|
||||
### 前提条件
|
||||
|
||||
- Node.js 22+
|
||||
- pnpm 10+
|
||||
|
||||
### 安装依赖
|
||||
|
||||
```bash
|
||||
pnpm install-isolated
|
||||
```
|
||||
|
||||
### 开发模式运行
|
||||
|
||||
```bash
|
||||
pnpm electron:dev
|
||||
```
|
||||
|
||||
### 构建应用
|
||||
|
||||
构建所有平台:
|
||||
|
||||
```bash
|
||||
pnpm build
|
||||
```
|
||||
|
||||
构建特定平台:
|
||||
|
||||
```bash
|
||||
# macOS
|
||||
pnpm build:mac
|
||||
|
||||
# Windows
|
||||
pnpm build:win
|
||||
|
||||
# Linux
|
||||
pnpm build:linux
|
||||
```
|
||||
|
||||
## 发布渠道
|
||||
|
||||
应用提供三个发布渠道:
|
||||
|
||||
- **稳定版**:经过充分测试的正式版本
|
||||
- **测试版 (Beta)**:预发布版本,包含即将发布的新功能
|
||||
- **每日构建版 (Nightly)**:包含最新开发进展的构建版本
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.cs.allow-jit</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
Before Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 756 KiB |
|
Before Width: | Height: | Size: 161 KiB |
|
Before Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 210 KiB |
|
Before Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 221 KiB |
|
Before Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 51 KiB |
@@ -1,6 +0,0 @@
|
||||
provider: github
|
||||
owner: lobehub
|
||||
repo: lobe-chat
|
||||
updaterCacheDirName: electron-app-updater
|
||||
allowPrerelease: true
|
||||
channel: nightly
|
||||
@@ -1,101 +0,0 @@
|
||||
const dotenv = require('dotenv');
|
||||
|
||||
dotenv.config();
|
||||
|
||||
const packageJSON = require('./package.json');
|
||||
|
||||
const channel = process.env.UPDATE_CHANNEL;
|
||||
|
||||
console.log(`🚄 Build Version ${packageJSON.version}, Channel: ${channel}`);
|
||||
|
||||
const isNightly = channel === 'nightly';
|
||||
const isBeta = packageJSON.name.includes('beta');
|
||||
|
||||
/**
|
||||
* @type {import('electron-builder').Configuration}
|
||||
* @see https://www.electron.build/configuration
|
||||
*/
|
||||
const config = {
|
||||
appId: isNightly
|
||||
? 'com.lobehub.lobehub-desktop-nightly'
|
||||
: isBeta
|
||||
? 'com.lobehub.lobehub-desktop-beta'
|
||||
: 'com.lobehub.lobehub-desktop',
|
||||
appImage: {
|
||||
artifactName: '${productName}-${version}.${ext}',
|
||||
},
|
||||
asar: true,
|
||||
detectUpdateChannel: true,
|
||||
directories: {
|
||||
buildResources: 'build',
|
||||
output: 'release',
|
||||
},
|
||||
dmg: {
|
||||
artifactName: '${productName}-${version}-${arch}.${ext}',
|
||||
},
|
||||
electronDownload: {
|
||||
mirror: 'https://npmmirror.com/mirrors/electron/',
|
||||
},
|
||||
files: [
|
||||
'dist',
|
||||
'resources',
|
||||
'!resources/locales',
|
||||
'!dist/next/docs',
|
||||
'!dist/next/packages',
|
||||
'!dist/next/.next/server/app/sitemap',
|
||||
'!dist/next/.next/static/media',
|
||||
],
|
||||
generateUpdatesFilesForAllChannels: true,
|
||||
linux: {
|
||||
category: 'Utility',
|
||||
maintainer: 'electronjs.org',
|
||||
target: ['AppImage', 'snap', 'deb'],
|
||||
},
|
||||
mac: {
|
||||
compression: 'maximum',
|
||||
entitlementsInherit: 'build/entitlements.mac.plist',
|
||||
extendInfo: {
|
||||
NSCameraUsageDescription: "Application requests access to the device's camera.",
|
||||
NSDocumentsFolderUsageDescription:
|
||||
"Application requests access to the user's Documents folder.",
|
||||
NSDownloadsFolderUsageDescription:
|
||||
"Application requests access to the user's Downloads folder.",
|
||||
NSMicrophoneUsageDescription: "Application requests access to the device's microphone.",
|
||||
},
|
||||
gatekeeperAssess: false,
|
||||
hardenedRuntime: true,
|
||||
notarize: true,
|
||||
target:
|
||||
// 降低构建时间,nightly 只打 arm64
|
||||
isNightly
|
||||
? [{ arch: ['arm64'], target: 'dmg' }]
|
||||
: [
|
||||
{ arch: ['x64', 'arm64'], target: 'dmg' },
|
||||
{ arch: ['x64', 'arm64'], target: 'zip' },
|
||||
],
|
||||
},
|
||||
npmRebuild: true,
|
||||
nsis: {
|
||||
allowToChangeInstallationDirectory: true,
|
||||
artifactName: '${productName}-${version}-setup.${ext}',
|
||||
createDesktopShortcut: 'always',
|
||||
installerHeader: './build/nsis-header.bmp',
|
||||
installerSidebar: './build/nsis-sidebar.bmp',
|
||||
oneClick: false,
|
||||
shortcutName: '${productName}',
|
||||
uninstallDisplayName: '${productName}',
|
||||
uninstallerSidebar: './build/nsis-sidebar.bmp',
|
||||
},
|
||||
publish: [
|
||||
{
|
||||
owner: 'lobehub',
|
||||
provider: 'github',
|
||||
repo: 'lobe-chat',
|
||||
},
|
||||
],
|
||||
win: {
|
||||
executableName: 'LobeHub',
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = config;
|
||||
@@ -1,43 +0,0 @@
|
||||
import dotenv from 'dotenv';
|
||||
import { defineConfig, externalizeDepsPlugin } from 'electron-vite';
|
||||
import { resolve } from 'node:path';
|
||||
|
||||
dotenv.config();
|
||||
|
||||
const isDev = process.env.NODE_ENV === 'development';
|
||||
const updateChannel = process.env.UPDATE_CHANNEL;
|
||||
console.log(`[electron-vite.config.ts] Detected UPDATE_CHANNEL: ${updateChannel}`); // 添加日志确认
|
||||
|
||||
export default defineConfig({
|
||||
main: {
|
||||
build: {
|
||||
outDir: 'dist/main',
|
||||
sourcemap: isDev,
|
||||
},
|
||||
// 这里是关键:在构建时进行文本替换
|
||||
define: {
|
||||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
|
||||
'process.env.OFFICIAL_CLOUD_SERVER': JSON.stringify(process.env.OFFICIAL_CLOUD_SERVER),
|
||||
'process.env.UPDATE_CHANNEL': JSON.stringify(process.env.UPDATE_CHANNEL),
|
||||
},
|
||||
plugins: [externalizeDepsPlugin({})],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': resolve(__dirname, 'src/main'),
|
||||
'~common': resolve(__dirname, 'src/common'),
|
||||
},
|
||||
},
|
||||
},
|
||||
preload: {
|
||||
build: {
|
||||
outDir: 'dist/preload',
|
||||
sourcemap: isDev,
|
||||
},
|
||||
plugins: [externalizeDepsPlugin({})],
|
||||
resolve: {
|
||||
alias: {
|
||||
'~common': resolve(__dirname, 'src/common'),
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -1,73 +0,0 @@
|
||||
{
|
||||
"name": "lobehub-desktop-dev",
|
||||
"version": "0.0.10",
|
||||
"description": "LobeHub Desktop Application",
|
||||
"homepage": "https://lobehub.com",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/lobehub/lobe-chat.git"
|
||||
},
|
||||
"author": "LobeHub",
|
||||
"main": "./dist/main/index.js",
|
||||
"scripts": {
|
||||
"build": "npm run typecheck && electron-vite build",
|
||||
"build-local": "npm run build && electron-builder --dir --config electron-builder.js --c.mac.notarize=false -c.mac.identity=null --c.asar=false",
|
||||
"build:linux": "npm run build && electron-builder --linux --config electron-builder.js --publish never",
|
||||
"build:mac": "npm run build && electron-builder --mac --config electron-builder.js --publish never",
|
||||
"build:win": "npm run build && electron-builder --win --config electron-builder.js --publish never",
|
||||
"electron:dev": "electron-vite dev",
|
||||
"electron:run-unpack": "electron .",
|
||||
"format": "prettier --write ",
|
||||
"i18n": "bun run scripts/i18nWorkflow/index.ts && lobe-i18n",
|
||||
"postinstall": "electron-builder install-app-deps",
|
||||
"install-isolated": "pnpm install",
|
||||
"lint": "eslint --cache ",
|
||||
"pg-server": "bun run scripts/pglite-server.ts",
|
||||
"start": "electron-vite preview",
|
||||
"typecheck": "tsc --noEmit -p tsconfig.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"electron-updater": "^6.6.2",
|
||||
"get-port-please": "^3.1.2",
|
||||
"pdfjs-dist": "4.10.38"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@electron-toolkit/eslint-config-prettier": "^3.0.0",
|
||||
"@electron-toolkit/eslint-config-ts": "^3.0.0",
|
||||
"@electron-toolkit/preload": "^3.0.1",
|
||||
"@electron-toolkit/tsconfig": "^1.0.1",
|
||||
"@electron-toolkit/utils": "^4.0.0",
|
||||
"@lobechat/electron-client-ipc": "workspace:*",
|
||||
"@lobechat/electron-server-ipc": "workspace:*",
|
||||
"@lobechat/file-loaders": "workspace:*",
|
||||
"@lobehub/i18n-cli": "^1.20.3",
|
||||
"@types/lodash": "^4.17.0",
|
||||
"@types/resolve": "^1.20.6",
|
||||
"@types/semver": "^7.7.0",
|
||||
"@types/set-cookie-parser": "^2.4.10",
|
||||
"consola": "^3.1.0",
|
||||
"cookie": "^1.0.2",
|
||||
"electron": "^36.2.0",
|
||||
"electron-builder": "^26.0.12",
|
||||
"electron-is": "^3.0.0",
|
||||
"electron-log": "^5.3.3",
|
||||
"electron-store": "^8.2.0",
|
||||
"electron-vite": "^3.0.0",
|
||||
"execa": "^9.5.2",
|
||||
"fix-path": "^4.0.0",
|
||||
"just-diff": "^6.0.2",
|
||||
"lodash": "^4.17.21",
|
||||
"pglite-server": "^0.1.4",
|
||||
"resolve": "^1.22.8",
|
||||
"semver": "^7.5.4",
|
||||
"set-cookie-parser": "^2.7.1",
|
||||
"tsx": "^4.19.3",
|
||||
"typescript": "^5.7.3",
|
||||
"vite": "^6.2.5"
|
||||
},
|
||||
"pnpm": {
|
||||
"onlyBuiltDependencies": [
|
||||
"electron"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
packages:
|
||||
- '../../packages/electron-server-ipc'
|
||||
- '../../packages/electron-client-ipc'
|
||||
- '../../packages/file-loaders'
|
||||
- '.'
|
||||
@@ -1,135 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>LobeHub - 连接错误</title>
|
||||
<style>
|
||||
body {
|
||||
-webkit-app-region: drag;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-family:
|
||||
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
|
||||
color: #1f1f1f;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* 添加暗色模式支持 */
|
||||
@media (prefers-color-scheme: dark) {
|
||||
body {
|
||||
color: #f5f5f5;
|
||||
}
|
||||
.error-message {
|
||||
color: #f5f5f5;
|
||||
}
|
||||
.retry-button {
|
||||
background-color: #2a2a2a;
|
||||
color: #f5f5f5;
|
||||
border: 1px solid #3a3a3a;
|
||||
}
|
||||
.retry-button:hover {
|
||||
background-color: #3a3a3a;
|
||||
}
|
||||
}
|
||||
|
||||
.container {
|
||||
text-align: center;
|
||||
padding: 2rem;
|
||||
max-width: 500px;
|
||||
}
|
||||
|
||||
.lobe-brand {
|
||||
width: 120px;
|
||||
height: auto;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.lobe-brand path {
|
||||
fill: currentcolor;
|
||||
}
|
||||
|
||||
.error-icon {
|
||||
font-size: 3rem;
|
||||
margin-bottom: 1rem;
|
||||
color: #ff4d4f;
|
||||
}
|
||||
|
||||
.error-title {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 600;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.error-message {
|
||||
margin-bottom: 2rem;
|
||||
line-height: 1.5;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.retry-button {
|
||||
-webkit-app-region: no-drag;
|
||||
padding: 0.75rem 1.5rem;
|
||||
background-color: #f5f5f5;
|
||||
color: #1f1f1f;
|
||||
border: 1px solid #e0e0e0;
|
||||
border-radius: 6px;
|
||||
font-size: 1rem;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.retry-button:hover {
|
||||
background-color: #e9e9e9;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="error-icon">⚠️</div>
|
||||
<h1 class="error-title">Connection Error</h1>
|
||||
<p class="error-message">
|
||||
Unable to connect to the application, please check your network connection or confirm if the
|
||||
development server is running.
|
||||
</p>
|
||||
|
||||
<button id="retry-button" class="retry-button">Retry</button>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// 当按钮被点击时,通知主进程重试连接
|
||||
const retryButton = document.getElementById('retry-button');
|
||||
const errorMessage = document.querySelector('.error-message');
|
||||
|
||||
if (retryButton) {
|
||||
retryButton.addEventListener('click', () => {
|
||||
// 更新UI状态
|
||||
retryButton.disabled = true;
|
||||
retryButton.textContent = 'Retrying...';
|
||||
errorMessage.textContent = 'Attempting to reconnect to the next server, please wait...';
|
||||
|
||||
// 调用主进程的重试逻辑
|
||||
if (window.electron && window.electron.ipcRenderer) {
|
||||
window.electron.ipcRenderer.invoke('retry-connection')
|
||||
.then((result) => {
|
||||
if (result && result.success) {
|
||||
// 连接成功,无需额外操作,页面会自动导航
|
||||
} else {
|
||||
// 连接失败,重置按钮状态
|
||||
setTimeout(() => {
|
||||
retryButton.disabled = false;
|
||||
retryButton.textContent = 'Retry';
|
||||
errorMessage.textContent = 'Unable to connect to the application, please check your network connection or confirm if the development server is running.';
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,32 +0,0 @@
|
||||
{
|
||||
"actions": {
|
||||
"add": "إضافة",
|
||||
"back": "عودة",
|
||||
"cancel": "إلغاء",
|
||||
"close": "إغلاق",
|
||||
"confirm": "تأكيد",
|
||||
"delete": "حذف",
|
||||
"edit": "تعديل",
|
||||
"more": "المزيد",
|
||||
"next": "التالي",
|
||||
"ok": "حسناً",
|
||||
"previous": "السابق",
|
||||
"refresh": "تحديث",
|
||||
"remove": "إزالة",
|
||||
"retry": "إعادة المحاولة",
|
||||
"save": "حفظ",
|
||||
"search": "بحث",
|
||||
"submit": "إرسال"
|
||||
},
|
||||
"app": {
|
||||
"description": "منصة تعاون مساعدك الذكي",
|
||||
"name": "LobeHub"
|
||||
},
|
||||
"status": {
|
||||
"error": "خطأ",
|
||||
"info": "معلومات",
|
||||
"loading": "جارٍ التحميل",
|
||||
"success": "نجاح",
|
||||
"warning": "تحذير"
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"about": {
|
||||
"button": "تأكيد",
|
||||
"detail": "تطبيق دردشة يعتمد على نموذج لغة كبير",
|
||||
"message": "{{appName}} {{appVersion}}",
|
||||
"title": "حول"
|
||||
},
|
||||
"confirm": {
|
||||
"cancel": "إلغاء",
|
||||
"no": "لا",
|
||||
"title": "تأكيد",
|
||||
"yes": "نعم"
|
||||
},
|
||||
"error": {
|
||||
"button": "تأكيد",
|
||||
"detail": "حدث خطأ أثناء العملية، يرجى المحاولة لاحقًا",
|
||||
"message": "حدث خطأ",
|
||||
"title": "خطأ"
|
||||
},
|
||||
"update": {
|
||||
"downloadAndInstall": "تنزيل وتثبيت",
|
||||
"downloadComplete": "اكتمل التنزيل",
|
||||
"downloadCompleteMessage": "تم تنزيل حزمة التحديث، هل ترغب في التثبيت الآن؟",
|
||||
"installLater": "تثبيت لاحقًا",
|
||||
"installNow": "تثبيت الآن",
|
||||
"later": "تذكير لاحقًا",
|
||||
"newVersion": "تم اكتشاف إصدار جديد",
|
||||
"newVersionAvailable": "تم اكتشاف إصدار جديد: {{version}}",
|
||||
"skipThisVersion": "تخطي هذا الإصدار"
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
{
|
||||
"common": {
|
||||
"checkUpdates": "التحقق من التحديثات..."
|
||||
},
|
||||
"dev": {
|
||||
"devPanel": "لوحة المطور",
|
||||
"devTools": "أدوات المطور",
|
||||
"forceReload": "إعادة تحميل قسري",
|
||||
"openStore": "فتح ملف التخزين",
|
||||
"refreshMenu": "تحديث القائمة",
|
||||
"reload": "إعادة تحميل",
|
||||
"title": "تطوير"
|
||||
},
|
||||
"edit": {
|
||||
"copy": "نسخ",
|
||||
"cut": "قص",
|
||||
"paste": "لصق",
|
||||
"redo": "إعادة",
|
||||
"selectAll": "تحديد الكل",
|
||||
"speech": "صوت",
|
||||
"startSpeaking": "بدء القراءة",
|
||||
"stopSpeaking": "إيقاف القراءة",
|
||||
"title": "تحرير",
|
||||
"undo": "تراجع"
|
||||
},
|
||||
"file": {
|
||||
"preferences": "التفضيلات",
|
||||
"quit": "خروج",
|
||||
"title": "ملف"
|
||||
},
|
||||
"help": {
|
||||
"about": "حول",
|
||||
"githubRepo": "مستودع GitHub",
|
||||
"reportIssue": "الإبلاغ عن مشكلة",
|
||||
"title": "مساعدة",
|
||||
"visitWebsite": "زيارة الموقع الرسمي"
|
||||
},
|
||||
"macOS": {
|
||||
"about": "حول {{appName}}",
|
||||
"devTools": "أدوات مطور LobeHub",
|
||||
"hide": "إخفاء {{appName}}",
|
||||
"hideOthers": "إخفاء الآخرين",
|
||||
"preferences": "إعدادات مفضلة...",
|
||||
"services": "خدمات",
|
||||
"unhide": "إظهار الكل"
|
||||
},
|
||||
"tray": {
|
||||
"open": "فتح {{appName}}",
|
||||
"quit": "خروج",
|
||||
"show": "عرض {{appName}}"
|
||||
},
|
||||
"view": {
|
||||
"forceReload": "إعادة تحميل قسري",
|
||||
"reload": "إعادة تحميل",
|
||||
"resetZoom": "إعادة تعيين التكبير",
|
||||
"title": "عرض",
|
||||
"toggleFullscreen": "تبديل وضع ملء الشاشة",
|
||||
"zoomIn": "تكبير",
|
||||
"zoomOut": "تصغير"
|
||||
},
|
||||
"window": {
|
||||
"bringAllToFront": "إحضار جميع النوافذ إلى الأمام",
|
||||
"close": "إغلاق",
|
||||
"front": "إحضار جميع النوافذ إلى الأمام",
|
||||
"minimize": "تصغير",
|
||||
"title": "نافذة",
|
||||
"toggleFullscreen": "تبديل وضع ملء الشاشة",
|
||||
"zoom": "تكبير"
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
{
|
||||
"actions": {
|
||||
"add": "Добави",
|
||||
"back": "Назад",
|
||||
"cancel": "Отмени",
|
||||
"close": "Затвори",
|
||||
"confirm": "Потвърди",
|
||||
"delete": "Изтрий",
|
||||
"edit": "Редактирай",
|
||||
"more": "Повече",
|
||||
"next": "Следващ",
|
||||
"ok": "Добре",
|
||||
"previous": "Предишен",
|
||||
"refresh": "Освежи",
|
||||
"remove": "Премахни",
|
||||
"retry": "Опитай отново",
|
||||
"save": "Запази",
|
||||
"search": "Търси",
|
||||
"submit": "Изпрати"
|
||||
},
|
||||
"app": {
|
||||
"description": "Твоята платформа за сътрудничество с AI асистент",
|
||||
"name": "LobeHub"
|
||||
},
|
||||
"status": {
|
||||
"error": "Грешка",
|
||||
"info": "Информация",
|
||||
"loading": "Зареждане",
|
||||
"success": "Успех",
|
||||
"warning": "Предупреждение"
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"about": {
|
||||
"button": "Потвърди",
|
||||
"detail": "Приложение за чат, базирано на голям езиков модел",
|
||||
"message": "{{appName}} {{appVersion}}",
|
||||
"title": "За нас"
|
||||
},
|
||||
"confirm": {
|
||||
"cancel": "Отказ",
|
||||
"no": "Не",
|
||||
"title": "Потвърждение",
|
||||
"yes": "Да"
|
||||
},
|
||||
"error": {
|
||||
"button": "Потвърди",
|
||||
"detail": "Възникна грешка по време на операцията, моля опитайте отново по-късно",
|
||||
"message": "Възникна грешка",
|
||||
"title": "Грешка"
|
||||
},
|
||||
"update": {
|
||||
"downloadAndInstall": "Изтегли и инсталирай",
|
||||
"downloadComplete": "Изтеглянето е завършено",
|
||||
"downloadCompleteMessage": "Актуализационният пакет е изтеглен, желаете ли да го инсталирате веднага?",
|
||||
"installLater": "Инсталирай по-късно",
|
||||
"installNow": "Инсталирай сега",
|
||||
"later": "Напомни по-късно",
|
||||
"newVersion": "Открита нова версия",
|
||||
"newVersionAvailable": "Открита нова версия: {{version}}",
|
||||
"skipThisVersion": "Пропусни тази версия"
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
{
|
||||
"common": {
|
||||
"checkUpdates": "Проверка за актуализации..."
|
||||
},
|
||||
"dev": {
|
||||
"devPanel": "Панел на разработчика",
|
||||
"devTools": "Инструменти за разработчици",
|
||||
"forceReload": "Принудително презареждане",
|
||||
"openStore": "Отворете файла за съхранение",
|
||||
"refreshMenu": "Освежаване на менюто",
|
||||
"reload": "Презареждане",
|
||||
"title": "Разработка"
|
||||
},
|
||||
"edit": {
|
||||
"copy": "Копиране",
|
||||
"cut": "Изрязване",
|
||||
"paste": "Поставяне",
|
||||
"redo": "Повторно",
|
||||
"selectAll": "Избери всичко",
|
||||
"speech": "Глас",
|
||||
"startSpeaking": "Започни четене",
|
||||
"stopSpeaking": "Спри четенето",
|
||||
"title": "Редактиране",
|
||||
"undo": "Отмяна"
|
||||
},
|
||||
"file": {
|
||||
"preferences": "Предпочитания",
|
||||
"quit": "Изход",
|
||||
"title": "Файл"
|
||||
},
|
||||
"help": {
|
||||
"about": "За",
|
||||
"githubRepo": "GitHub хранилище",
|
||||
"reportIssue": "Докладвай проблем",
|
||||
"title": "Помощ",
|
||||
"visitWebsite": "Посети уебсайта"
|
||||
},
|
||||
"macOS": {
|
||||
"about": "За {{appName}}",
|
||||
"devTools": "Инструменти за разработчици на LobeHub",
|
||||
"hide": "Скрий {{appName}}",
|
||||
"hideOthers": "Скрий другите",
|
||||
"preferences": "Настройки...",
|
||||
"services": "Услуги",
|
||||
"unhide": "Покажи всичко"
|
||||
},
|
||||
"tray": {
|
||||
"open": "Отвори {{appName}}",
|
||||
"quit": "Изход",
|
||||
"show": "Покажи {{appName}}"
|
||||
},
|
||||
"view": {
|
||||
"forceReload": "Принудително презареждане",
|
||||
"reload": "Презареждане",
|
||||
"resetZoom": "Нулиране на мащаба",
|
||||
"title": "Изглед",
|
||||
"toggleFullscreen": "Превключи на цял екран",
|
||||
"zoomIn": "Увеличи",
|
||||
"zoomOut": "Намали"
|
||||
},
|
||||
"window": {
|
||||
"bringAllToFront": "Премести всички прозорци напред",
|
||||
"close": "Затвори",
|
||||
"front": "Премести всички прозорци напред",
|
||||
"minimize": "Минимизирай",
|
||||
"title": "Прозорец",
|
||||
"toggleFullscreen": "Превключи на цял екран",
|
||||
"zoom": "Мащаб"
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
{
|
||||
"actions": {
|
||||
"add": "Hinzufügen",
|
||||
"back": "Zurück",
|
||||
"cancel": "Abbrechen",
|
||||
"close": "Schließen",
|
||||
"confirm": "Bestätigen",
|
||||
"delete": "Löschen",
|
||||
"edit": "Bearbeiten",
|
||||
"more": "Mehr",
|
||||
"next": "Weiter",
|
||||
"ok": "OK",
|
||||
"previous": "Zurück",
|
||||
"refresh": "Aktualisieren",
|
||||
"remove": "Entfernen",
|
||||
"retry": "Erneut versuchen",
|
||||
"save": "Speichern",
|
||||
"search": "Suchen",
|
||||
"submit": "Einreichen"
|
||||
},
|
||||
"app": {
|
||||
"description": "Ihre KI-Assistenten-Kollaborationsplattform",
|
||||
"name": "LobeHub"
|
||||
},
|
||||
"status": {
|
||||
"error": "Fehler",
|
||||
"info": "Information",
|
||||
"loading": "Lädt",
|
||||
"success": "Erfolg",
|
||||
"warning": "Warnung"
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"about": {
|
||||
"button": "Bestätigen",
|
||||
"detail": "Eine Chat-Anwendung, die auf einem großen Sprachmodell basiert",
|
||||
"message": "{{appName}} {{appVersion}}",
|
||||
"title": "Über"
|
||||
},
|
||||
"confirm": {
|
||||
"cancel": "Abbrechen",
|
||||
"no": "Nein",
|
||||
"title": "Bestätigung",
|
||||
"yes": "Ja"
|
||||
},
|
||||
"error": {
|
||||
"button": "Bestätigen",
|
||||
"detail": "Während der Operation ist ein Fehler aufgetreten, bitte versuchen Sie es später erneut",
|
||||
"message": "Ein Fehler ist aufgetreten",
|
||||
"title": "Fehler"
|
||||
},
|
||||
"update": {
|
||||
"downloadAndInstall": "Herunterladen und installieren",
|
||||
"downloadComplete": "Download abgeschlossen",
|
||||
"downloadCompleteMessage": "Das Update-Paket wurde heruntergeladen, möchten Sie es jetzt installieren?",
|
||||
"installLater": "Später installieren",
|
||||
"installNow": "Jetzt installieren",
|
||||
"later": "Später erinnern",
|
||||
"newVersion": "Neue Version gefunden",
|
||||
"newVersionAvailable": "Neue Version verfügbar: {{version}}",
|
||||
"skipThisVersion": "Diese Version überspringen"
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
{
|
||||
"common": {
|
||||
"checkUpdates": "Überprüfen Sie auf Updates..."
|
||||
},
|
||||
"dev": {
|
||||
"devPanel": "Entwicklerpanel",
|
||||
"devTools": "Entwicklerwerkzeuge",
|
||||
"forceReload": "Erzwinge Neuladen",
|
||||
"openStore": "Speicherdatei öffnen",
|
||||
"refreshMenu": "Menü aktualisieren",
|
||||
"reload": "Neuladen",
|
||||
"title": "Entwicklung"
|
||||
},
|
||||
"edit": {
|
||||
"copy": "Kopieren",
|
||||
"cut": "Ausschneiden",
|
||||
"paste": "Einfügen",
|
||||
"redo": "Wiederherstellen",
|
||||
"selectAll": "Alles auswählen",
|
||||
"speech": "Sprache",
|
||||
"startSpeaking": "Beginne zu sprechen",
|
||||
"stopSpeaking": "Stoppe das Sprechen",
|
||||
"title": "Bearbeiten",
|
||||
"undo": "Rückgängig"
|
||||
},
|
||||
"file": {
|
||||
"preferences": "Einstellungen",
|
||||
"quit": "Beenden",
|
||||
"title": "Datei"
|
||||
},
|
||||
"help": {
|
||||
"about": "Über",
|
||||
"githubRepo": "GitHub-Repository",
|
||||
"reportIssue": "Problem melden",
|
||||
"title": "Hilfe",
|
||||
"visitWebsite": "Besuche die Website"
|
||||
},
|
||||
"macOS": {
|
||||
"about": "Über {{appName}}",
|
||||
"devTools": "LobeHub Entwicklerwerkzeuge",
|
||||
"hide": "{{appName}} ausblenden",
|
||||
"hideOthers": "Andere ausblenden",
|
||||
"preferences": "Einstellungen...",
|
||||
"services": "Dienste",
|
||||
"unhide": "Alle anzeigen"
|
||||
},
|
||||
"tray": {
|
||||
"open": "{{appName}} öffnen",
|
||||
"quit": "Beenden",
|
||||
"show": "{{appName}} anzeigen"
|
||||
},
|
||||
"view": {
|
||||
"forceReload": "Erzwinge Neuladen",
|
||||
"reload": "Neuladen",
|
||||
"resetZoom": "Zoom zurücksetzen",
|
||||
"title": "Ansicht",
|
||||
"toggleFullscreen": "Vollbild umschalten",
|
||||
"zoomIn": "Vergrößern",
|
||||
"zoomOut": "Verkleinern"
|
||||
},
|
||||
"window": {
|
||||
"bringAllToFront": "Alle Fenster in den Vordergrund bringen",
|
||||
"close": "Schließen",
|
||||
"front": "Alle Fenster in den Vordergrund bringen",
|
||||
"minimize": "Minimieren",
|
||||
"title": "Fenster",
|
||||
"toggleFullscreen": "Vollbild umschalten",
|
||||
"zoom": "Zoom"
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
{
|
||||
"actions": {
|
||||
"add": "Add",
|
||||
"back": "Back",
|
||||
"cancel": "Cancel",
|
||||
"close": "Close",
|
||||
"confirm": "Confirm",
|
||||
"delete": "Delete",
|
||||
"edit": "Edit",
|
||||
"more": "More",
|
||||
"next": "Next",
|
||||
"ok": "OK",
|
||||
"previous": "Previous",
|
||||
"refresh": "Refresh",
|
||||
"remove": "Remove",
|
||||
"retry": "Retry",
|
||||
"save": "Save",
|
||||
"search": "Search",
|
||||
"submit": "Submit"
|
||||
},
|
||||
"app": {
|
||||
"description": "Your AI Assistant Collaboration Platform",
|
||||
"name": "LobeHub"
|
||||
},
|
||||
"status": {
|
||||
"error": "Error",
|
||||
"info": "Information",
|
||||
"loading": "Loading",
|
||||
"success": "Success",
|
||||
"warning": "Warning"
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"about": {
|
||||
"button": "OK",
|
||||
"detail": "A chat application based on a large language model",
|
||||
"message": "{{appName}} {{appVersion}}",
|
||||
"title": "About"
|
||||
},
|
||||
"confirm": {
|
||||
"cancel": "Cancel",
|
||||
"no": "No",
|
||||
"title": "Confirm",
|
||||
"yes": "Yes"
|
||||
},
|
||||
"error": {
|
||||
"button": "OK",
|
||||
"detail": "An error occurred during the operation, please try again later",
|
||||
"message": "An error occurred",
|
||||
"title": "Error"
|
||||
},
|
||||
"update": {
|
||||
"downloadAndInstall": "Download and Install",
|
||||
"downloadComplete": "Download Complete",
|
||||
"downloadCompleteMessage": "The update package has been downloaded, would you like to install it now?",
|
||||
"installLater": "Install Later",
|
||||
"installNow": "Install Now",
|
||||
"later": "Remind Me Later",
|
||||
"newVersion": "New Version Found",
|
||||
"newVersionAvailable": "New version available: {{version}}",
|
||||
"skipThisVersion": "Skip This Version"
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
{
|
||||
"common": {
|
||||
"checkUpdates": "Checking for updates..."
|
||||
},
|
||||
"dev": {
|
||||
"devPanel": "Developer Panel",
|
||||
"devTools": "Developer Tools",
|
||||
"forceReload": "Force Reload",
|
||||
"openStore": "Open Storage File",
|
||||
"refreshMenu": "Refresh menu",
|
||||
"reload": "Reload",
|
||||
"title": "Development"
|
||||
},
|
||||
"edit": {
|
||||
"copy": "Copy",
|
||||
"cut": "Cut",
|
||||
"paste": "Paste",
|
||||
"redo": "Redo",
|
||||
"selectAll": "Select All",
|
||||
"speech": "Speech",
|
||||
"startSpeaking": "Start Speaking",
|
||||
"stopSpeaking": "Stop Speaking",
|
||||
"title": "Edit",
|
||||
"undo": "Undo"
|
||||
},
|
||||
"file": {
|
||||
"preferences": "Preferences",
|
||||
"quit": "Quit",
|
||||
"title": "File"
|
||||
},
|
||||
"help": {
|
||||
"about": "About",
|
||||
"githubRepo": "GitHub Repository",
|
||||
"reportIssue": "Report Issue",
|
||||
"title": "Help",
|
||||
"visitWebsite": "Visit Website"
|
||||
},
|
||||
"macOS": {
|
||||
"about": "About {{appName}}",
|
||||
"devTools": "LobeHub Developer Tools",
|
||||
"hide": "Hide {{appName}}",
|
||||
"hideOthers": "Hide Others",
|
||||
"preferences": "Preferences...",
|
||||
"services": "Services",
|
||||
"unhide": "Show All"
|
||||
},
|
||||
"tray": {
|
||||
"open": "Open {{appName}}",
|
||||
"quit": "Quit",
|
||||
"show": "Show {{appName}}"
|
||||
},
|
||||
"view": {
|
||||
"forceReload": "Force Reload",
|
||||
"reload": "Reload",
|
||||
"resetZoom": "Reset Zoom",
|
||||
"title": "View",
|
||||
"toggleFullscreen": "Toggle Fullscreen",
|
||||
"zoomIn": "Zoom In",
|
||||
"zoomOut": "Zoom Out"
|
||||
},
|
||||
"window": {
|
||||
"bringAllToFront": "Bring All Windows to Front",
|
||||
"close": "Close",
|
||||
"front": "Bring All Windows to Front",
|
||||
"minimize": "Minimize",
|
||||
"title": "Window",
|
||||
"toggleFullscreen": "Toggle Fullscreen",
|
||||
"zoom": "Zoom"
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
{
|
||||
"actions": {
|
||||
"add": "Agregar",
|
||||
"back": "Volver",
|
||||
"cancel": "Cancelar",
|
||||
"close": "Cerrar",
|
||||
"confirm": "Confirmar",
|
||||
"delete": "Eliminar",
|
||||
"edit": "Editar",
|
||||
"more": "Más",
|
||||
"next": "Siguiente",
|
||||
"ok": "Aceptar",
|
||||
"previous": "Anterior",
|
||||
"refresh": "Actualizar",
|
||||
"remove": "Eliminar",
|
||||
"retry": "Reintentar",
|
||||
"save": "Guardar",
|
||||
"search": "Buscar",
|
||||
"submit": "Enviar"
|
||||
},
|
||||
"app": {
|
||||
"description": "Tu plataforma de colaboración con el asistente de IA",
|
||||
"name": "LobeHub"
|
||||
},
|
||||
"status": {
|
||||
"error": "Error",
|
||||
"info": "Información",
|
||||
"loading": "Cargando",
|
||||
"success": "Éxito",
|
||||
"warning": "Advertencia"
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"about": {
|
||||
"button": "Aceptar",
|
||||
"detail": "Una aplicación de chat basada en un modelo de lenguaje grande",
|
||||
"message": "{{appName}} {{appVersion}}",
|
||||
"title": "Acerca de"
|
||||
},
|
||||
"confirm": {
|
||||
"cancel": "Cancelar",
|
||||
"no": "No",
|
||||
"title": "Confirmar",
|
||||
"yes": "Sí"
|
||||
},
|
||||
"error": {
|
||||
"button": "Aceptar",
|
||||
"detail": "Se produjo un error durante la operación, por favor intente de nuevo más tarde",
|
||||
"message": "Se produjo un error",
|
||||
"title": "Error"
|
||||
},
|
||||
"update": {
|
||||
"downloadAndInstall": "Descargar e instalar",
|
||||
"downloadComplete": "Descarga completada",
|
||||
"downloadCompleteMessage": "El paquete de actualización se ha descargado, ¿desea instalarlo ahora?",
|
||||
"installLater": "Instalar más tarde",
|
||||
"installNow": "Instalar ahora",
|
||||
"later": "Recordar más tarde",
|
||||
"newVersion": "Nueva versión disponible",
|
||||
"newVersionAvailable": "Nueva versión encontrada: {{version}}",
|
||||
"skipThisVersion": "Saltar esta versión"
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
{
|
||||
"common": {
|
||||
"checkUpdates": "Comprobando actualizaciones..."
|
||||
},
|
||||
"dev": {
|
||||
"devPanel": "Panel de desarrollador",
|
||||
"devTools": "Herramientas de desarrollador",
|
||||
"forceReload": "Recargar forzosamente",
|
||||
"openStore": "Abrir archivo de almacenamiento",
|
||||
"refreshMenu": "Actualizar menú",
|
||||
"reload": "Recargar",
|
||||
"title": "Desarrollo"
|
||||
},
|
||||
"edit": {
|
||||
"copy": "Copiar",
|
||||
"cut": "Cortar",
|
||||
"paste": "Pegar",
|
||||
"redo": "Rehacer",
|
||||
"selectAll": "Seleccionar todo",
|
||||
"speech": "Voz",
|
||||
"startSpeaking": "Comenzar a leer en voz alta",
|
||||
"stopSpeaking": "Detener lectura en voz alta",
|
||||
"title": "Editar",
|
||||
"undo": "Deshacer"
|
||||
},
|
||||
"file": {
|
||||
"preferences": "Preferencias",
|
||||
"quit": "Salir",
|
||||
"title": "Archivo"
|
||||
},
|
||||
"help": {
|
||||
"about": "Acerca de",
|
||||
"githubRepo": "Repositorio de GitHub",
|
||||
"reportIssue": "Reportar un problema",
|
||||
"title": "Ayuda",
|
||||
"visitWebsite": "Visitar el sitio web"
|
||||
},
|
||||
"macOS": {
|
||||
"about": "Acerca de {{appName}}",
|
||||
"devTools": "Herramientas de desarrollador de LobeHub",
|
||||
"hide": "Ocultar {{appName}}",
|
||||
"hideOthers": "Ocultar otros",
|
||||
"preferences": "Configuración...",
|
||||
"services": "Servicios",
|
||||
"unhide": "Mostrar todo"
|
||||
},
|
||||
"tray": {
|
||||
"open": "Abrir {{appName}}",
|
||||
"quit": "Salir",
|
||||
"show": "Mostrar {{appName}}"
|
||||
},
|
||||
"view": {
|
||||
"forceReload": "Recargar forzosamente",
|
||||
"reload": "Recargar",
|
||||
"resetZoom": "Restablecer zoom",
|
||||
"title": "Vista",
|
||||
"toggleFullscreen": "Alternar pantalla completa",
|
||||
"zoomIn": "Acercar",
|
||||
"zoomOut": "Alejar"
|
||||
},
|
||||
"window": {
|
||||
"bringAllToFront": "Traer todas las ventanas al frente",
|
||||
"close": "Cerrar",
|
||||
"front": "Traer todas las ventanas al frente",
|
||||
"minimize": "Minimizar",
|
||||
"title": "Ventana",
|
||||
"toggleFullscreen": "Alternar pantalla completa",
|
||||
"zoom": "Zoom"
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
{
|
||||
"actions": {
|
||||
"add": "افزودن",
|
||||
"back": "بازگشت",
|
||||
"cancel": "لغو",
|
||||
"close": "بستن",
|
||||
"confirm": "تأیید",
|
||||
"delete": "حذف",
|
||||
"edit": "ویرایش",
|
||||
"more": "بیشتر",
|
||||
"next": "مرحله بعد",
|
||||
"ok": "تأیید",
|
||||
"previous": "مرحله قبل",
|
||||
"refresh": "بهروزرسانی",
|
||||
"remove": "حذف",
|
||||
"retry": "تلاش مجدد",
|
||||
"save": "ذخیره",
|
||||
"search": "جستجو",
|
||||
"submit": "ارسال"
|
||||
},
|
||||
"app": {
|
||||
"description": "پلتفرم همکاری دستیار هوش مصنوعی شما",
|
||||
"name": "LobeHub"
|
||||
},
|
||||
"status": {
|
||||
"error": "خطا",
|
||||
"info": "اطلاعات",
|
||||
"loading": "در حال بارگذاری",
|
||||
"success": "موفق",
|
||||
"warning": "هشدار"
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"about": {
|
||||
"button": "تأیید",
|
||||
"detail": "یک برنامه چت مبتنی بر مدلهای زبانی بزرگ",
|
||||
"message": "{{appName}} {{appVersion}}",
|
||||
"title": "درباره"
|
||||
},
|
||||
"confirm": {
|
||||
"cancel": "لغو",
|
||||
"no": "خیر",
|
||||
"title": "تأیید",
|
||||
"yes": "بله"
|
||||
},
|
||||
"error": {
|
||||
"button": "تأیید",
|
||||
"detail": "در حین انجام عملیات خطایی رخ داده است، لطفاً بعداً دوباره تلاش کنید",
|
||||
"message": "خطا رخ داده است",
|
||||
"title": "خطا"
|
||||
},
|
||||
"update": {
|
||||
"downloadAndInstall": "دانلود و نصب",
|
||||
"downloadComplete": "دانلود کامل شد",
|
||||
"downloadCompleteMessage": "بسته بهروزرسانی دانلود شده است، آیا میخواهید بلافاصله نصب کنید؟",
|
||||
"installLater": "نصب بعداً",
|
||||
"installNow": "نصب اکنون",
|
||||
"later": "یادآوری بعداً",
|
||||
"newVersion": "نسخه جدیدی پیدا شد",
|
||||
"newVersionAvailable": "نسخه جدید پیدا شد: {{version}}",
|
||||
"skipThisVersion": "این نسخه را نادیده بگیرید"
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
{
|
||||
"common": {
|
||||
"checkUpdates": "بررسی بهروزرسانی..."
|
||||
},
|
||||
"dev": {
|
||||
"devPanel": "پنل توسعهدهنده",
|
||||
"devTools": "ابزارهای توسعهدهنده",
|
||||
"forceReload": "بارگذاری اجباری",
|
||||
"openStore": "باز کردن فایلهای ذخیره شده",
|
||||
"refreshMenu": "بهروزرسانی منو",
|
||||
"reload": "بارگذاری مجدد",
|
||||
"title": "توسعه"
|
||||
},
|
||||
"edit": {
|
||||
"copy": "کپی",
|
||||
"cut": "برش",
|
||||
"paste": "چسباندن",
|
||||
"redo": "انجام مجدد",
|
||||
"selectAll": "انتخاب همه",
|
||||
"speech": "گفتار",
|
||||
"startSpeaking": "شروع به خواندن",
|
||||
"stopSpeaking": "متوقف کردن خواندن",
|
||||
"title": "ویرایش",
|
||||
"undo": "بازگشت"
|
||||
},
|
||||
"file": {
|
||||
"preferences": "تنظیمات",
|
||||
"quit": "خروج",
|
||||
"title": "فایل"
|
||||
},
|
||||
"help": {
|
||||
"about": "درباره",
|
||||
"githubRepo": "مخزن GitHub",
|
||||
"reportIssue": "گزارش مشکل",
|
||||
"title": "کمک",
|
||||
"visitWebsite": "بازدید از وبسایت"
|
||||
},
|
||||
"macOS": {
|
||||
"about": "درباره {{appName}}",
|
||||
"devTools": "ابزارهای توسعهدهنده LobeHub",
|
||||
"hide": "پنهان کردن {{appName}}",
|
||||
"hideOthers": "پنهان کردن دیگران",
|
||||
"preferences": "تنظیمات...",
|
||||
"services": "خدمات",
|
||||
"unhide": "نمایش همه"
|
||||
},
|
||||
"tray": {
|
||||
"open": "باز کردن {{appName}}",
|
||||
"quit": "خروج",
|
||||
"show": "نمایش {{appName}}"
|
||||
},
|
||||
"view": {
|
||||
"forceReload": "بارگذاری اجباری",
|
||||
"reload": "بارگذاری مجدد",
|
||||
"resetZoom": "تنظیم زوم به حالت اولیه",
|
||||
"title": "نمایش",
|
||||
"toggleFullscreen": "تغییر به حالت تمام صفحه",
|
||||
"zoomIn": "بزرگنمایی",
|
||||
"zoomOut": "کوچکنمایی"
|
||||
},
|
||||
"window": {
|
||||
"bringAllToFront": "همه پنجرهها را به جلو بیاورید",
|
||||
"close": "بستن",
|
||||
"front": "همه پنجرهها را به جلو بیاورید",
|
||||
"minimize": "کوچک کردن",
|
||||
"title": "پنجره",
|
||||
"toggleFullscreen": "تغییر به حالت تمام صفحه",
|
||||
"zoom": "زوم"
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
{
|
||||
"actions": {
|
||||
"add": "Ajouter",
|
||||
"back": "Retour",
|
||||
"cancel": "Annuler",
|
||||
"close": "Fermer",
|
||||
"confirm": "Confirmer",
|
||||
"delete": "Supprimer",
|
||||
"edit": "Éditer",
|
||||
"more": "Plus",
|
||||
"next": "Suivant",
|
||||
"ok": "D'accord",
|
||||
"previous": "Précédent",
|
||||
"refresh": "Rafraîchir",
|
||||
"remove": "Retirer",
|
||||
"retry": "Réessayer",
|
||||
"save": "Enregistrer",
|
||||
"search": "Rechercher",
|
||||
"submit": "Soumettre"
|
||||
},
|
||||
"app": {
|
||||
"description": "Votre plateforme de collaboration avec l'assistant IA",
|
||||
"name": "LobeHub"
|
||||
},
|
||||
"status": {
|
||||
"error": "Erreur",
|
||||
"info": "Information",
|
||||
"loading": "Chargement",
|
||||
"success": "Succès",
|
||||
"warning": "Avertissement"
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"about": {
|
||||
"button": "D'accord",
|
||||
"detail": "Une application de chat basée sur un grand modèle de langage",
|
||||
"message": "{{appName}} {{appVersion}}",
|
||||
"title": "À propos"
|
||||
},
|
||||
"confirm": {
|
||||
"cancel": "Annuler",
|
||||
"no": "Non",
|
||||
"title": "Confirmer",
|
||||
"yes": "Oui"
|
||||
},
|
||||
"error": {
|
||||
"button": "D'accord",
|
||||
"detail": "Une erreur s'est produite lors de l'opération, veuillez réessayer plus tard",
|
||||
"message": "Une erreur s'est produite",
|
||||
"title": "Erreur"
|
||||
},
|
||||
"update": {
|
||||
"downloadAndInstall": "Télécharger et installer",
|
||||
"downloadComplete": "Téléchargement terminé",
|
||||
"downloadCompleteMessage": "Le paquet de mise à jour a été téléchargé, souhaitez-vous l'installer maintenant ?",
|
||||
"installLater": "Installer plus tard",
|
||||
"installNow": "Installer maintenant",
|
||||
"later": "Rappeler plus tard",
|
||||
"newVersion": "Nouvelle version détectée",
|
||||
"newVersionAvailable": "Nouvelle version disponible : {{version}}",
|
||||
"skipThisVersion": "Ignorer cette version"
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
{
|
||||
"common": {
|
||||
"checkUpdates": "Vérifier les mises à jour..."
|
||||
},
|
||||
"dev": {
|
||||
"devPanel": "Panneau de développement",
|
||||
"devTools": "Outils de développement",
|
||||
"forceReload": "Recharger de force",
|
||||
"openStore": "Ouvrir le fichier de stockage",
|
||||
"refreshMenu": "Rafraîchir le menu",
|
||||
"reload": "Recharger",
|
||||
"title": "Développement"
|
||||
},
|
||||
"edit": {
|
||||
"copy": "Copier",
|
||||
"cut": "Couper",
|
||||
"paste": "Coller",
|
||||
"redo": "Rétablir",
|
||||
"selectAll": "Tout sélectionner",
|
||||
"speech": "Voix",
|
||||
"startSpeaking": "Commencer à lire",
|
||||
"stopSpeaking": "Arrêter de lire",
|
||||
"title": "Édition",
|
||||
"undo": "Annuler"
|
||||
},
|
||||
"file": {
|
||||
"preferences": "Préférences",
|
||||
"quit": "Quitter",
|
||||
"title": "Fichier"
|
||||
},
|
||||
"help": {
|
||||
"about": "À propos",
|
||||
"githubRepo": "Dépôt GitHub",
|
||||
"reportIssue": "Signaler un problème",
|
||||
"title": "Aide",
|
||||
"visitWebsite": "Visiter le site officiel"
|
||||
},
|
||||
"macOS": {
|
||||
"about": "À propos de {{appName}}",
|
||||
"devTools": "Outils de développement LobeHub",
|
||||
"hide": "Masquer {{appName}}",
|
||||
"hideOthers": "Masquer les autres",
|
||||
"preferences": "Préférences...",
|
||||
"services": "Services",
|
||||
"unhide": "Tout afficher"
|
||||
},
|
||||
"tray": {
|
||||
"open": "Ouvrir {{appName}}",
|
||||
"quit": "Quitter",
|
||||
"show": "Afficher {{appName}}"
|
||||
},
|
||||
"view": {
|
||||
"forceReload": "Recharger de force",
|
||||
"reload": "Recharger",
|
||||
"resetZoom": "Réinitialiser le zoom",
|
||||
"title": "Affichage",
|
||||
"toggleFullscreen": "Basculer en plein écran",
|
||||
"zoomIn": "Zoomer",
|
||||
"zoomOut": "Dézoomer"
|
||||
},
|
||||
"window": {
|
||||
"bringAllToFront": "Mettre toutes les fenêtres au premier plan",
|
||||
"close": "Fermer",
|
||||
"front": "Mettre toutes les fenêtres au premier plan",
|
||||
"minimize": "Réduire",
|
||||
"title": "Fenêtre",
|
||||
"toggleFullscreen": "Basculer en plein écran",
|
||||
"zoom": "Zoom"
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
{
|
||||
"actions": {
|
||||
"add": "Aggiungi",
|
||||
"back": "Indietro",
|
||||
"cancel": "Annulla",
|
||||
"close": "Chiudi",
|
||||
"confirm": "Conferma",
|
||||
"delete": "Elimina",
|
||||
"edit": "Modifica",
|
||||
"more": "Di più",
|
||||
"next": "Avanti",
|
||||
"ok": "OK",
|
||||
"previous": "Indietro",
|
||||
"refresh": "Aggiorna",
|
||||
"remove": "Rimuovi",
|
||||
"retry": "Riprova",
|
||||
"save": "Salva",
|
||||
"search": "Cerca",
|
||||
"submit": "Invia"
|
||||
},
|
||||
"app": {
|
||||
"description": "La tua piattaforma di collaborazione con assistente AI",
|
||||
"name": "LobeHub"
|
||||
},
|
||||
"status": {
|
||||
"error": "Errore",
|
||||
"info": "Informazioni",
|
||||
"loading": "Caricamento in corso",
|
||||
"success": "Successo",
|
||||
"warning": "Avviso"
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"about": {
|
||||
"button": "Conferma",
|
||||
"detail": "Un'app di chat basata su un grande modello linguistico",
|
||||
"message": "{{appName}} {{appVersion}}",
|
||||
"title": "Informazioni"
|
||||
},
|
||||
"confirm": {
|
||||
"cancel": "Annulla",
|
||||
"no": "No",
|
||||
"title": "Conferma",
|
||||
"yes": "Sì"
|
||||
},
|
||||
"error": {
|
||||
"button": "Conferma",
|
||||
"detail": "Si è verificato un errore durante l'operazione, riprovare più tardi",
|
||||
"message": "Si è verificato un errore",
|
||||
"title": "Errore"
|
||||
},
|
||||
"update": {
|
||||
"downloadAndInstall": "Scarica e installa",
|
||||
"downloadComplete": "Download completato",
|
||||
"downloadCompleteMessage": "Il pacchetto di aggiornamento è stato scaricato, vuoi installarlo subito?",
|
||||
"installLater": "Installa più tardi",
|
||||
"installNow": "Installa ora",
|
||||
"later": "Promemoria più tardi",
|
||||
"newVersion": "Nuova versione disponibile",
|
||||
"newVersionAvailable": "Nuova versione trovata: {{version}}",
|
||||
"skipThisVersion": "Salta questa versione"
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
{
|
||||
"common": {
|
||||
"checkUpdates": "Controlla aggiornamenti..."
|
||||
},
|
||||
"dev": {
|
||||
"devPanel": "Pannello sviluppatore",
|
||||
"devTools": "Strumenti per sviluppatori",
|
||||
"forceReload": "Ricarica forzata",
|
||||
"openStore": "Apri il file di archiviazione",
|
||||
"refreshMenu": "Aggiorna menu",
|
||||
"reload": "Ricarica",
|
||||
"title": "Sviluppo"
|
||||
},
|
||||
"edit": {
|
||||
"copy": "Copia",
|
||||
"cut": "Taglia",
|
||||
"paste": "Incolla",
|
||||
"redo": "Ripeti",
|
||||
"selectAll": "Seleziona tutto",
|
||||
"speech": "Voce",
|
||||
"startSpeaking": "Inizia a leggere",
|
||||
"stopSpeaking": "Ferma la lettura",
|
||||
"title": "Modifica",
|
||||
"undo": "Annulla"
|
||||
},
|
||||
"file": {
|
||||
"preferences": "Preferenze",
|
||||
"quit": "Esci",
|
||||
"title": "File"
|
||||
},
|
||||
"help": {
|
||||
"about": "Informazioni",
|
||||
"githubRepo": "Repository GitHub",
|
||||
"reportIssue": "Segnala un problema",
|
||||
"title": "Aiuto",
|
||||
"visitWebsite": "Visita il sito ufficiale"
|
||||
},
|
||||
"macOS": {
|
||||
"about": "Informazioni su {{appName}}",
|
||||
"devTools": "Strumenti per sviluppatori LobeHub",
|
||||
"hide": "Nascondi {{appName}}",
|
||||
"hideOthers": "Nascondi altri",
|
||||
"preferences": "Impostazioni...",
|
||||
"services": "Servizi",
|
||||
"unhide": "Mostra tutto"
|
||||
},
|
||||
"tray": {
|
||||
"open": "Apri {{appName}}",
|
||||
"quit": "Esci",
|
||||
"show": "Mostra {{appName}}"
|
||||
},
|
||||
"view": {
|
||||
"forceReload": "Ricarica forzata",
|
||||
"reload": "Ricarica",
|
||||
"resetZoom": "Reimposta zoom",
|
||||
"title": "Visualizza",
|
||||
"toggleFullscreen": "Attiva/disattiva schermo intero",
|
||||
"zoomIn": "Ingrandisci",
|
||||
"zoomOut": "Riduci"
|
||||
},
|
||||
"window": {
|
||||
"bringAllToFront": "Porta tutte le finestre in primo piano",
|
||||
"close": "Chiudi",
|
||||
"front": "Porta tutte le finestre in primo piano",
|
||||
"minimize": "Minimizza",
|
||||
"title": "Finestra",
|
||||
"toggleFullscreen": "Attiva/disattiva schermo intero",
|
||||
"zoom": "Zoom"
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
{
|
||||
"actions": {
|
||||
"add": "追加",
|
||||
"back": "戻る",
|
||||
"cancel": "キャンセル",
|
||||
"close": "閉じる",
|
||||
"confirm": "確認",
|
||||
"delete": "削除",
|
||||
"edit": "編集",
|
||||
"more": "もっと見る",
|
||||
"next": "次へ",
|
||||
"ok": "OK",
|
||||
"previous": "前へ",
|
||||
"refresh": "更新",
|
||||
"remove": "削除",
|
||||
"retry": "再試行",
|
||||
"save": "保存",
|
||||
"search": "検索",
|
||||
"submit": "送信"
|
||||
},
|
||||
"app": {
|
||||
"description": "あなたのAIアシスタント協力プラットフォーム",
|
||||
"name": "LobeHub"
|
||||
},
|
||||
"status": {
|
||||
"error": "エラー",
|
||||
"info": "情報",
|
||||
"loading": "読み込み中",
|
||||
"success": "成功",
|
||||
"warning": "警告"
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"about": {
|
||||
"button": "確定",
|
||||
"detail": "大規模言語モデルに基づくチャットアプリ",
|
||||
"message": "{{appName}} {{appVersion}}",
|
||||
"title": "について"
|
||||
},
|
||||
"confirm": {
|
||||
"cancel": "キャンセル",
|
||||
"no": "いいえ",
|
||||
"title": "確認",
|
||||
"yes": "はい"
|
||||
},
|
||||
"error": {
|
||||
"button": "確定",
|
||||
"detail": "操作中にエラーが発生しました。後で再試行してください。",
|
||||
"message": "エラーが発生しました",
|
||||
"title": "エラー"
|
||||
},
|
||||
"update": {
|
||||
"downloadAndInstall": "ダウンロードしてインストール",
|
||||
"downloadComplete": "ダウンロード完了",
|
||||
"downloadCompleteMessage": "更新パッケージのダウンロードが完了しました。今すぐインストールしますか?",
|
||||
"installLater": "後でインストール",
|
||||
"installNow": "今すぐインストール",
|
||||
"later": "後でリマインド",
|
||||
"newVersion": "新しいバージョンが見つかりました",
|
||||
"newVersionAvailable": "新しいバージョンが見つかりました: {{version}}",
|
||||
"skipThisVersion": "このバージョンをスキップ"
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
{
|
||||
"common": {
|
||||
"checkUpdates": "更新を確認しています..."
|
||||
},
|
||||
"dev": {
|
||||
"devPanel": "開発者パネル",
|
||||
"devTools": "開発者ツール",
|
||||
"forceReload": "強制再読み込み",
|
||||
"openStore": "ストレージファイルを開く",
|
||||
"refreshMenu": "メニューを更新",
|
||||
"reload": "再読み込み",
|
||||
"title": "開発"
|
||||
},
|
||||
"edit": {
|
||||
"copy": "コピー",
|
||||
"cut": "切り取り",
|
||||
"paste": "貼り付け",
|
||||
"redo": "やり直し",
|
||||
"selectAll": "すべて選択",
|
||||
"speech": "音声",
|
||||
"startSpeaking": "読み上げ開始",
|
||||
"stopSpeaking": "読み上げ停止",
|
||||
"title": "編集",
|
||||
"undo": "元に戻す"
|
||||
},
|
||||
"file": {
|
||||
"preferences": "設定",
|
||||
"quit": "終了",
|
||||
"title": "ファイル"
|
||||
},
|
||||
"help": {
|
||||
"about": "について",
|
||||
"githubRepo": "GitHub リポジトリ",
|
||||
"reportIssue": "問題を報告",
|
||||
"title": "ヘルプ",
|
||||
"visitWebsite": "公式ウェブサイトを訪問"
|
||||
},
|
||||
"macOS": {
|
||||
"about": "{{appName}} について",
|
||||
"devTools": "LobeHub 開発者ツール",
|
||||
"hide": "{{appName}} を隠す",
|
||||
"hideOthers": "他を隠す",
|
||||
"preferences": "環境設定...",
|
||||
"services": "サービス",
|
||||
"unhide": "すべて表示"
|
||||
},
|
||||
"tray": {
|
||||
"open": "{{appName}} を開く",
|
||||
"quit": "終了",
|
||||
"show": "{{appName}} を表示"
|
||||
},
|
||||
"view": {
|
||||
"forceReload": "強制再読み込み",
|
||||
"reload": "再読み込み",
|
||||
"resetZoom": "ズームをリセット",
|
||||
"title": "ビュー",
|
||||
"toggleFullscreen": "フルスクリーン切替",
|
||||
"zoomIn": "ズームイン",
|
||||
"zoomOut": "ズームアウト"
|
||||
},
|
||||
"window": {
|
||||
"bringAllToFront": "すべてのウィンドウを前面に",
|
||||
"close": "閉じる",
|
||||
"front": "すべてのウィンドウを前面に",
|
||||
"minimize": "最小化",
|
||||
"title": "ウィンドウ",
|
||||
"toggleFullscreen": "フルスクリーン切替",
|
||||
"zoom": "ズーム"
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
{
|
||||
"actions": {
|
||||
"add": "추가",
|
||||
"back": "뒤로",
|
||||
"cancel": "취소",
|
||||
"close": "닫기",
|
||||
"confirm": "확인",
|
||||
"delete": "삭제",
|
||||
"edit": "편집",
|
||||
"more": "더보기",
|
||||
"next": "다음",
|
||||
"ok": "확인",
|
||||
"previous": "이전",
|
||||
"refresh": "새로 고침",
|
||||
"remove": "제거",
|
||||
"retry": "다시 시도",
|
||||
"save": "저장",
|
||||
"search": "검색",
|
||||
"submit": "제출"
|
||||
},
|
||||
"app": {
|
||||
"description": "당신의 AI 비서 협업 플랫폼",
|
||||
"name": "LobeHub"
|
||||
},
|
||||
"status": {
|
||||
"error": "오류",
|
||||
"info": "정보",
|
||||
"loading": "로딩 중",
|
||||
"success": "성공",
|
||||
"warning": "경고"
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"about": {
|
||||
"button": "확인",
|
||||
"detail": "대형 언어 모델 기반의 채팅 애플리케이션",
|
||||
"message": "{{appName}} {{appVersion}}",
|
||||
"title": "정보"
|
||||
},
|
||||
"confirm": {
|
||||
"cancel": "취소",
|
||||
"no": "아니요",
|
||||
"title": "확인",
|
||||
"yes": "예"
|
||||
},
|
||||
"error": {
|
||||
"button": "확인",
|
||||
"detail": "작업 중 오류가 발생했습니다. 나중에 다시 시도해 주세요.",
|
||||
"message": "오류 발생",
|
||||
"title": "오류"
|
||||
},
|
||||
"update": {
|
||||
"downloadAndInstall": "다운로드 및 설치",
|
||||
"downloadComplete": "다운로드 완료",
|
||||
"downloadCompleteMessage": "업데이트 패키지가 다운로드 완료되었습니다. 지금 설치하시겠습니까?",
|
||||
"installLater": "나중에 설치",
|
||||
"installNow": "지금 설치",
|
||||
"later": "나중에 알림",
|
||||
"newVersion": "새 버전 발견",
|
||||
"newVersionAvailable": "새 버전 발견: {{version}}",
|
||||
"skipThisVersion": "이 버전 건너뛰기"
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
{
|
||||
"common": {
|
||||
"checkUpdates": "업데이트 확인 중..."
|
||||
},
|
||||
"dev": {
|
||||
"devPanel": "개발자 패널",
|
||||
"devTools": "개발자 도구",
|
||||
"forceReload": "강제 새로 고침",
|
||||
"openStore": "저장 파일 열기",
|
||||
"refreshMenu": "메뉴 새로 고침",
|
||||
"reload": "새로 고침",
|
||||
"title": "개발"
|
||||
},
|
||||
"edit": {
|
||||
"copy": "복사",
|
||||
"cut": "잘라내기",
|
||||
"paste": "붙여넣기",
|
||||
"redo": "다시 실행",
|
||||
"selectAll": "모두 선택",
|
||||
"speech": "음성",
|
||||
"startSpeaking": "읽기 시작",
|
||||
"stopSpeaking": "읽기 중지",
|
||||
"title": "편집",
|
||||
"undo": "실행 취소"
|
||||
},
|
||||
"file": {
|
||||
"preferences": "환경 설정",
|
||||
"quit": "종료",
|
||||
"title": "파일"
|
||||
},
|
||||
"help": {
|
||||
"about": "정보",
|
||||
"githubRepo": "GitHub 저장소",
|
||||
"reportIssue": "문제 보고",
|
||||
"title": "도움말",
|
||||
"visitWebsite": "웹사이트 방문"
|
||||
},
|
||||
"macOS": {
|
||||
"about": "{{appName}} 정보",
|
||||
"devTools": "LobeHub 개발자 도구",
|
||||
"hide": "{{appName}} 숨기기",
|
||||
"hideOthers": "다른 것 숨기기",
|
||||
"preferences": "환경 설정...",
|
||||
"services": "서비스",
|
||||
"unhide": "모두 표시"
|
||||
},
|
||||
"tray": {
|
||||
"open": "{{appName}} 열기",
|
||||
"quit": "종료",
|
||||
"show": "{{appName}} 표시"
|
||||
},
|
||||
"view": {
|
||||
"forceReload": "강제 새로 고침",
|
||||
"reload": "새로 고침",
|
||||
"resetZoom": "줌 초기화",
|
||||
"title": "보기",
|
||||
"toggleFullscreen": "전체 화면 전환",
|
||||
"zoomIn": "확대",
|
||||
"zoomOut": "축소"
|
||||
},
|
||||
"window": {
|
||||
"bringAllToFront": "모든 창 앞으로 가져오기",
|
||||
"close": "닫기",
|
||||
"front": "모든 창 앞으로 가져오기",
|
||||
"minimize": "최소화",
|
||||
"title": "창",
|
||||
"toggleFullscreen": "전체 화면 전환",
|
||||
"zoom": "줌"
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
{
|
||||
"actions": {
|
||||
"add": "Toevoegen",
|
||||
"back": "Terug",
|
||||
"cancel": "Annuleren",
|
||||
"close": "Sluiten",
|
||||
"confirm": "Bevestigen",
|
||||
"delete": "Verwijderen",
|
||||
"edit": "Bewerken",
|
||||
"more": "Meer",
|
||||
"next": "Volgende stap",
|
||||
"ok": "OK",
|
||||
"previous": "Vorige stap",
|
||||
"refresh": "Vernieuwen",
|
||||
"remove": "Verwijderen",
|
||||
"retry": "Opnieuw proberen",
|
||||
"save": "Opslaan",
|
||||
"search": "Zoeken",
|
||||
"submit": "Indienen"
|
||||
},
|
||||
"app": {
|
||||
"description": "Jouw AI-assistent samenwerkingsplatform",
|
||||
"name": "LobeHub"
|
||||
},
|
||||
"status": {
|
||||
"error": "Fout",
|
||||
"info": "Informatie",
|
||||
"loading": "Laden",
|
||||
"success": "Succes",
|
||||
"warning": "Waarschuwing"
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"about": {
|
||||
"button": "Bevestigen",
|
||||
"detail": "Een chatapplicatie gebaseerd op een groot taalmodel",
|
||||
"message": "{{appName}} {{appVersion}}",
|
||||
"title": "Over"
|
||||
},
|
||||
"confirm": {
|
||||
"cancel": "Annuleren",
|
||||
"no": "Nee",
|
||||
"title": "Bevestigen",
|
||||
"yes": "Ja"
|
||||
},
|
||||
"error": {
|
||||
"button": "Bevestigen",
|
||||
"detail": "Er is een fout opgetreden tijdens de operatie, probeer het later opnieuw",
|
||||
"message": "Er is een fout opgetreden",
|
||||
"title": "Fout"
|
||||
},
|
||||
"update": {
|
||||
"downloadAndInstall": "Downloaden en installeren",
|
||||
"downloadComplete": "Download voltooid",
|
||||
"downloadCompleteMessage": "Het updatepakket is gedownload, wilt u het nu installeren?",
|
||||
"installLater": "Later installeren",
|
||||
"installNow": "Nu installeren",
|
||||
"later": "Later herinneren",
|
||||
"newVersion": "Nieuwe versie gevonden",
|
||||
"newVersionAvailable": "Nieuwe versie beschikbaar: {{version}}",
|
||||
"skipThisVersion": "Deze versie overslaan"
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
{
|
||||
"common": {
|
||||
"checkUpdates": "Updates controleren..."
|
||||
},
|
||||
"dev": {
|
||||
"devPanel": "Ontwikkelaarspaneel",
|
||||
"devTools": "Ontwikkelaarstools",
|
||||
"forceReload": "Forceer herladen",
|
||||
"openStore": "Open opslagbestand",
|
||||
"refreshMenu": "Menu verversen",
|
||||
"reload": "Herladen",
|
||||
"title": "Ontwikkeling"
|
||||
},
|
||||
"edit": {
|
||||
"copy": "Kopiëren",
|
||||
"cut": "Knippen",
|
||||
"paste": "Plakken",
|
||||
"redo": "Opnieuw doen",
|
||||
"selectAll": "Alles selecteren",
|
||||
"speech": "Spraak",
|
||||
"startSpeaking": "Begin met voorlezen",
|
||||
"stopSpeaking": "Stop met voorlezen",
|
||||
"title": "Bewerken",
|
||||
"undo": "Ongedaan maken"
|
||||
},
|
||||
"file": {
|
||||
"preferences": "Voorkeuren",
|
||||
"quit": "Afsluiten",
|
||||
"title": "Bestand"
|
||||
},
|
||||
"help": {
|
||||
"about": "Over",
|
||||
"githubRepo": "GitHub-repo",
|
||||
"reportIssue": "Probleem melden",
|
||||
"title": "Hulp",
|
||||
"visitWebsite": "Bezoek de website"
|
||||
},
|
||||
"macOS": {
|
||||
"about": "Over {{appName}}",
|
||||
"devTools": "LobeHub Ontwikkelaarstools",
|
||||
"hide": "Verberg {{appName}}",
|
||||
"hideOthers": "Verberg anderen",
|
||||
"preferences": "Voorkeuren...",
|
||||
"services": "Diensten",
|
||||
"unhide": "Toon alles"
|
||||
},
|
||||
"tray": {
|
||||
"open": "Open {{appName}}",
|
||||
"quit": "Afsluiten",
|
||||
"show": "Toon {{appName}}"
|
||||
},
|
||||
"view": {
|
||||
"forceReload": "Forceer herladen",
|
||||
"reload": "Herladen",
|
||||
"resetZoom": "Zoom resetten",
|
||||
"title": "Weergave",
|
||||
"toggleFullscreen": "Schakel volledig scherm in/uit",
|
||||
"zoomIn": "Inzoomen",
|
||||
"zoomOut": "Uitzoomen"
|
||||
},
|
||||
"window": {
|
||||
"bringAllToFront": "Breng alle vensters naar voren",
|
||||
"close": "Sluiten",
|
||||
"front": "Breng alle vensters naar voren",
|
||||
"minimize": "Minimaliseren",
|
||||
"title": "Venster",
|
||||
"toggleFullscreen": "Schakel volledig scherm in/uit",
|
||||
"zoom": "Inzoomen"
|
||||
}
|
||||
}
|
||||