Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🌐 chore: translate non-English comments to English in packages/types (#10158)

LobeHub Bote70a703a7e0c
diff --git a/packages/types/src/aiProvider.ts b/packages/types/src/aiProvider.ts
index df70237bee5..19bf003ce72 100644
--- a/packages/types/src/aiProvider.ts
+++ b/packages/types/src/aiProvider.ts
@@ -247,7 +247,7 @@ export const UpdateAiProviderConfigSchema = z.object({
z.string(),
z.union([
z.string().optional(),
- z.record(z.string(), z.string()).optional(), // 支持嵌套对象,如 customHeaders
+ z.record(z.string(), z.string()).optional(), // Support nested objects, e.g. customHeaders
]),
)
.optional(),
diff --git a/packages/types/src/document/index.ts b/packages/types/src/document/index.ts
index 42f8782b254..cd9ce4fc4cd 100644
--- a/packages/types/src/document/index.ts
+++ b/packages/types/src/document/index.ts
@@ -1,172 +1,172 @@
/**
- * 在 LobeChat 中的文档对象
+ * Document object in LobeChat
*/
export interface LobeDocument {
/**
- * 文件内容
+ * File content
*/
content: string | null;
/**
- * 文件创建时间戳。
+ * File creation timestamp
*/
createdAt: Date;
/**
- * 文件类型或扩展名
+ * File type or extension
*/
fileType: string;
/**
- * 原始文件名。
+ * Original filename
*/
filename: string;
id: string;
/**
- * 文件级别的元数据。
- * 例如从文件属性中提取的标题、作者,或整个文件加载失败时的错误。
+ * File-level metadata
+ * For example, title and author extracted from file properties, or errors when the entire file fails to load
*/
metadata: {
/**
- * 允许添加其他文件级别的元数据。
+ * Allow adding other file-level metadata
*/
[key: string]: any;
/**
- * 文档作者 (如果可用)。
+ * Document author (if available)
*/
author?: string;
/**
- * 如果整个文件加载失败,记录错误信息。
+ * Error information if the entire file fails to load
*/
error?: string;
};
/**
- * 包含文档中所有逻辑页面/块的数组。
- * 顺序通常对应文件中的自然顺序。
+ * Array containing all logical pages/blocks in the document
+ * Order typically corresponds to the natural order in the file
*/
pages?: LobeDocumentPage[];
/**
- * 原始文件的完整路径。
+ * Full path of the original file
*/
source: string;
/**
- * 文档标题 (如果可用)。
+ * Document title (if available)
*/
title?: string;
/**
- * 整个文档的总字符数 (所有 Page 的 charCount 之和)。
- * 需要在所有 Page 加载和计算后得出。
+ * Total character count of the entire document (sum of charCount of all Pages)
+ * Obtained after all Pages are loaded and calculated
*/
totalCharCount: number;
/**
- * 整个文档的总行数 (所有 Page 的 lineCount 之和)。
- * 需要在所有 Page 加载和计算后得出。
+ * Total line count of the entire document (sum of lineCount of all Pages)
+ * Obtained after all Pages are loaded and calculated
*/
totalLineCount: number;
/**
- * 文件最后修改时间戳。
+ * File last modified timestamp
*/
updatedAt: Date;
}
/**
- * 代表文件中的一个逻辑单元/页面/块。
+ * Represents a logical unit/page/block in a file
*/
export interface LobeDocumentPage {
/**
- * 此页/块内容的字符数。
+ * Character count of this page/block content
*/
charCount: number;
/**
- * 此页/块内容的行数。
+ * Line count of this page/block content
*/
lineCount: number;
/**
- * 与此页/块相关的元数据。
+ * Metadata related to this page/block
*/
metadata: {
/**
- * 允许添加其他特定于页/块的元数据。
+ * Allow adding other page/block-specific metadata
*/
[key: string]: any;
/**
- * 如果原始文件单元被进一步分割成块,这是当前块的索引。
+ * If the original file unit is further split into chunks, this is the index of the current chunk
*/
chunkIndex?: number;
/**
- * 处理此页/块时发生的错误。
+ * Errors that occurred while processing this page/block
*/
error?: string;
/**
- * 此页/块在原始文件中的结束行号。
+ * Ending line number of this page/block in the original file
*/
lineNumberEnd?: number;
/**
- * 此页/块在原始文件中的起始行号。
+ * Starting line number of this page/block in the original file
*/
lineNumberStart?: number;
/**
- * 页码 (适用于 PDF, DOCX)。
+ * Page number (applicable to PDF, DOCX)
*/
pageNumber?: number;
/**
- * 与此页/块相关的章节标题。
+ * Section title related to this page/block
*/
sectionTitle?: string;
/**
- * 工作表名称 (适用于 XLSX)。
+ * Worksheet name (applicable to XLSX)
*/
sheetName?: string;
/**
- * 幻灯片编号 (适用于 PPTX)。
+ * Slide number (applicable to PPTX)
*/
slideNumber?: number;
/**
- * 如果原始文件单元被进一步分割成块,这是该单元的总块数。
+ * If the original file unit is further split into chunks, this is the total number of chunks for that unit
*/
totalChunks?: number;
};
/**
- * 此页/块的核心文本内容。
+ * Core text content of this page/block
*/
pageContent: string;
}
/**
- * 文档来源类型
+ * Document source type
*/
export enum DocumentSourceType {
/**
- * 来自 API 的内容
+ * Content from API
*/
API = 'api',
/**
- * 本地或上传的文件
+ * Local or uploaded files
*/
FILE = 'file',
/**
- * 网页内容
+ * Web content
*/
WEB = 'web',
}
diff --git a/packages/types/src/exportConfig.ts b/packages/types/src/exportConfig.ts
index 3d8d51052a7..e9b3ec2c4a1 100644
--- a/packages/types/src/exportConfig.ts
+++ b/packages/types/src/exportConfig.ts
@@ -6,14 +6,14 @@ import { UserSettings } from './user/settings';
// ---------- TODO: this file need to be deleted in V2 ---------- //
/**
- * 导出方式
+ * Export type
* @enum ['agents', 'sessions', 'singleSession', 'settings', 'all']
* @enumNames ['agents', 'sessions', 'singleSession', 'settings', 'all']
*/
export type ExportType = 'agents' | 'sessions' | 'singleSession' | 'settings' | 'all';
/**
- * 配置模型映射
+ * Config model map
*/
export interface ConfigModelMap {
agents: {
@@ -38,10 +38,10 @@ export interface ConfigModelMap {
};
}
-// ============= 配置数据结构 ============= //
+// ============= Config Data Structures ============= //
/**
- * 配置状态:会话
+ * Config state: Sessions
*/
export interface ConfigStateSessions {
messages: UIChatMessage[];
@@ -51,7 +51,7 @@ export interface ConfigStateSessions {
}
/**
- * 配置状态:单个会话
+ * Config state: Single session
*/
export interface ConfigStateSingleSession {
messages: UIChatMessage[];
@@ -60,7 +60,7 @@ export interface ConfigStateSingleSession {
}
/**
- * 配置状态:角色
+ * Config state: Agents
*/
export interface ConfigStateAgents {
sessionGroups: SessionGroupItem[];
@@ -68,21 +68,21 @@ export interface ConfigStateAgents {
}
/**
- * 配置状态:设置
+ * Config state: Settings
*/
export interface ConfigStateSettings {
settings: UserSettings;
}
/**
- * 配置状态:全部
+ * Config state: All
*/
export interface ConfigStateAll extends ConfigStateSessions, ConfigStateSettings {}
-// ============= 配置文件类型 ============= //
+// ============= Config File Types ============= //
/**
- * 配置文件:设置
+ * Config file: Settings
*/
export interface ConfigFileSettings {
exportType: 'settings';
@@ -91,7 +91,7 @@ export interface ConfigFileSettings {
}
/**
- * 配置文件:会话
+ * Config file: Sessions
*/
export interface ConfigFileSessions {
exportType: 'sessions';
@@ -100,7 +100,7 @@ export interface ConfigFileSessions {
}
/**
- * 配置文件:单个会话
+ * Config file: Single session
*/
export interface ConfigFileSingleSession {
exportType: 'sessions';
@@ -109,7 +109,7 @@ export interface ConfigFileSingleSession {
}
/**
- * 配置文件:角色
+ * Config file: Agents
*/
export interface ConfigFileAgents {
exportType: 'agents';
@@ -118,7 +118,7 @@ export interface ConfigFileAgents {
}
/**
- * 配置文件:全部
+ * Config file: All
*/
export interface ConfigFileAll {
exportType: 'all';
@@ -127,6 +127,6 @@ export interface ConfigFileAll {
}
/**
- * 配置文件
+ * Config file
*/
export type ConfigFile = ConfigFileSettings | ConfigFileSessions | ConfigFileAll | ConfigFileAgents;
diff --git a/packages/types/src/generation/index.ts b/packages/types/src/generation/index.ts
index 9504871c55a..a351e0fe88f 100644
--- a/packages/types/src/generation/index.ts
+++ b/packages/types/src/generation/index.ts
@@ -14,23 +14,23 @@ export interface BaseGenerationAsset {
export interface ImageGenerationAsset extends BaseGenerationAsset {
/**
- * 图片/视频的高度
+ * Height of the image/video
*/
height?: number;
/**
- * api provider 家的 cdn url,一般很快就会失效
+ * CDN URL from the API provider, typically expires quickly
*/
originalUrl?: string;
/**
- * 缩略图,图片那就是尺寸裁剪过的,视频那就是封面的缩略图
+ * Thumbnail URL - for images it's a resized version, for videos it's a thumbnail of the cover
*/
thumbnailUrl?: string;
/**
- * 存到自己 oss 的 url, 只存了 key, 完整的 url 需要使用 FileService.getFullFileUrl 获取
+ * URL stored in own OSS, only the key is stored. The full URL needs to be obtained using FileService.getFullFileUrl
*/
url?: string;
/**
- * 图片/视频的宽度
+ * Width of the image/video
*/
width?: number;
}
diff --git a/packages/types/src/openai/chat.ts b/packages/types/src/openai/chat.ts
index 93727c6aed1..4fed3a94458 100644
--- a/packages/types/src/openai/chat.ts
+++ b/packages/types/src/openai/chat.ts
@@ -38,8 +38,8 @@ export type UserMessageContentPart = UserMessageContentPartText | UserMessageCon
export interface OpenAIChatMessage {
/**
- * @title 内容
- * @description 消息内容
+ * @title Content
+ * @description Message content
*/
content: string | UserMessageContentPart[];
@@ -49,8 +49,8 @@ export interface OpenAIChatMessage {
function_call?: OpenAIFunctionCall;
name?: string;
/**
- * 角色
- * @description 消息发送者的角色
+ * Role
+ * @description Role of the message sender
*/
role: LLMRoleType;
tool_call_id?: string;
@@ -62,36 +62,36 @@ export interface OpenAIChatMessage {
*/
export interface ChatStreamPayload {
/**
- * 是否开启搜索
+ * Whether search is enabled
*/
enabledSearch?: boolean;
/**
- * @title 控制生成文本中的惩罚系数,用于减少重复性
+ * @title Penalty coefficient in generated text to reduce repetitiveness
* @default 0
*/
frequency_penalty?: number;
/**
- * @title 生成文本的最大长度
+ * @title Maximum length of generated text
*/
max_tokens?: number;
/**
- * @title 聊天信息列表
+ * @title List of chat messages
*/
messages: OpenAIChatMessage[];
/**
- * @title 模型名称
+ * @title Model name
*/
model: string;
/**
- * @title 返回的文本数量
+ * @title Number of texts to return
*/
n?: number;
/**
- * 开启的插件列表
+ * List of enabled plugins
*/
plugins?: string[];
/**
- * @title 控制生成文本中的惩罚系数,用于减少主题的变化
+ * @title Penalty coefficient in generated text to reduce topic changes
* @default 0
*/
presence_penalty?: number;
@@ -102,19 +102,19 @@ export interface ChatStreamPayload {
responseMode?: 'stream' | 'json';
response_format?: ChatResponseFormat;
/**
- * @title 是否开启流式请求
+ * @title Whether to enable streaming requests
* @default true
*/
stream?: boolean;
/**
- * @title 生成文本的随机度量,用于控制文本的创造性和多样性
+ * @title Randomness measure for generated text, used to control creativity and diversity
* @default 1
*/
temperature: number;
tool_choice?: string;
tools?: ChatCompletionTool[];
/**
- * @title 控制生成文本中最高概率的单个令牌
+ * @title Controls the single token with highest probability in generated text
* @default 1
*/
top_p?: number;
diff --git a/packages/types/src/plugins/mcp.ts b/packages/types/src/plugins/mcp.ts
index 6b7d4d1e261..81e137e0836 100644
--- a/packages/types/src/plugins/mcp.ts
+++ b/packages/types/src/plugins/mcp.ts
@@ -21,7 +21,7 @@ export enum MCPInstallStep {
/* eslint-enable */
export interface CheckMcpInstallParams {
/**
- * 安装详情
+ * Installation details
*/
installationDetails: {
packageName?: string;
@@ -29,11 +29,11 @@ export interface CheckMcpInstallParams {
setupSteps?: string[];
};
/**
- * 安装方法
+ * Installation method
*/
installationMethod: string;
/**
- * 系统依赖项
+ * System dependencies
*/
systemDependencies?: SystemDependency[];
}
@@ -41,12 +41,12 @@ export interface CheckMcpInstallParams {
export interface CheckMcpInstallResult {
allDependenciesMet?: boolean;
/**
- * 所有部署选项的检查结果
+ * Check results for all deployment options
*/
allOptions?: Array<{
allDependenciesMet?: boolean;
/**
- * 连接信息,用于后续连接使用
+ * Connection information for subsequent connection use
*/
connection?: {
args?: string[];
@@ -66,11 +66,11 @@ export interface CheckMcpInstallResult {
}>;
}>;
/**
- * 配置模式,提到顶层方便访问
+ * Configuration schema, elevated to top level for easy access
*/
configSchema?: any;
/**
- * 连接信息,用于后续连接使用
+ * Connection information for subsequent connection use
*/
connection?: {
args?: string[];
@@ -79,28 +79,28 @@ export interface CheckMcpInstallResult {
url?: string;
};
/**
- * 如果检测失败,提供错误信息
+ * Error information if detection fails
*/
error?: string;
/**
- * 是否为推荐选项
+ * Whether this is the recommended option
*/
isRecommended?: boolean;
/**
- * 是否需要配置(如 API key 等)
+ * Whether configuration is needed (e.g. API key, etc.)
*/
needsConfig?: boolean;
/**
- * 插件安装检测结果
+ * Plugin installation detection result
*/
packageInstalled?: boolean;
platform: string;
/**
- * 检测结果是否成功
+ * Whether the detection result is successful
*/
success: boolean;
/**
- * 系统依赖检测结果
+ * System dependency detection results
*/
systemDependencies?: Array<{
error?: string;
@@ -119,12 +119,12 @@ export interface MCPErrorInfoMetadata {
errorLog?: string;
/**
- * 原始错误信息
+ * Original error message
*/
originalError?: string;
/**
- * MCP 连接参数
+ * MCP connection parameters
*/
params?: {
args?: string[];
@@ -132,7 +132,7 @@ export interface MCPErrorInfoMetadata {
type?: string;
};
/**
- * 进程相关信息
+ * Process-related information
*/
process?: {
exitCode?: number;
@@ -140,31 +140,31 @@ export interface MCPErrorInfoMetadata {
};
/**
- * 错误发生的步骤
+ * Step where the error occurred
*/
step?: string;
/**
- * 时间戳
+ * Timestamp
*/
timestamp?: number;
}
/**
- * 结构化的错误信息
+ * Structured error information
*/
export interface MCPErrorInfo {
/**
- * 核心错误信息(用户友好的简短描述)
+ * Core error message (user-friendly brief description)
*/
message: string;
/**
- * 结构化的错误元数据
+ * Structured error metadata
*/
metadata?: MCPErrorInfoMetadata;
/**
- * 错误类型
+ * Error type
*/
type: MCPErrorType;
}
@@ -174,7 +174,7 @@ export interface MCPInstallProgress {
configSchema?: any;
// connection info from checkInstallation
connection?: any;
- // 结构化的错误信息,当安装失败时显示
+ // Structured error information, displayed when installation fails
errorInfo?: MCPErrorInfo;
manifest?: any;
// LobeChatPluginManifest
@@ -182,12 +182,12 @@ export interface MCPInstallProgress {
// 0-100
progress: number;
step: MCPInstallStep;
- // 系统依赖检测结果,当需要安装依赖时显示
+ // System dependency detection results, displayed when dependencies need to be installed
systemDependencies?: Array<{
error?: string;
installInstructions?: {
- current?: string; // 当前系统的安装指令
- manual?: string; // 手动安装指令
+ current?: string; // Installation command for the current system
+ manual?: string; // Manual installation command
};
installed: boolean;
meetRequirement: boolean;
@@ -206,16 +206,16 @@ export interface McpConnection {
token?: string;
type: 'none' | 'bearer' | 'oauth2';
};
- // STDIO 连接参数
+ // STDIO connection parameters
command?: string;
env?: Record<string, string>;
headers?: Record<string, string>;
type: 'http' | 'stdio';
- // HTTP 连接参数
+ // HTTP connection parameters
url?: string;
}
-// 测试连接参数类型
+// Test connection parameter type
export interface McpConnectionParams {
connection: McpConnection;
identifier: string;
diff --git a/packages/types/src/plugins/protocol.ts b/packages/types/src/plugins/protocol.ts
index 7ebd006c036..38401726a38 100644
--- a/packages/types/src/plugins/protocol.ts
+++ b/packages/types/src/plugins/protocol.ts
@@ -1,21 +1,21 @@
/**
- * 协议来源类型
+ * Protocol source type
*/
export enum ProtocolSource {
- /** 社区贡献 */
+ /** Community contribution */
COMMUNITY = 'community',
- /** 开发者自定义 */
+ /** Developer custom */
DEVELOPER = 'developer',
- /** GitHub 官方 */
+ /** GitHub official */
GITHUB_OFFICIAL = 'github_official',
- /** 官方LobeHub市场 */
+ /** Official LobeHub marketplace */
OFFICIAL = 'official',
- /** 第三方市场 */
+ /** Third-party marketplace */
THIRD_PARTY = 'third_party',
}
/**
- * MCP Schema - stdio 配置类型
+ * MCP Schema - stdio configuration type
*/
export interface McpStdioConfig {
args?: string[];
@@ -25,7 +25,7 @@ export interface McpStdioConfig {
}
/**
- * MCP Schema - http 配置类型
+ * MCP Schema - http configuration type
*/
export interface McpHttpConfig {
headers?: Record<string, string>;
@@ -34,74 +34,74 @@ export interface McpHttpConfig {
}
/**
- * MCP Schema 配置类型
+ * MCP Schema configuration type
*/
export type McpConfig = McpStdioConfig | McpHttpConfig;
/**
- * MCP Schema 对象
- * 符合 RFC 0001 定义
+ * MCP Schema object
+ * Conforms to RFC 0001 definition
*/
export interface McpSchema {
- /** 插件作者 */
+ /** Plugin author */
author: string;
- /** 插件配置 */
+ /** Plugin configuration */
config: McpConfig;
- /** 插件描述 */
+ /** Plugin description */
description: string;
- /** 插件主页 */
+ /** Plugin homepage */
homepage?: string;
- /** 插件图标 */
+ /** Plugin icon */
icon?: string;
- /** 插件唯一标识符,必须与URL中的id参数匹配 */
+ /** Plugin unique identifier, must match the id parameter in the URL */
identifier: string;
- /** 插件名称 */
+ /** Plugin name */
name: string;
- /** 插件版本 (semver) */
+ /** Plugin version (semver) */
version: string;
}
/**
- * RFC 0001 协议参数
+ * RFC 0001 protocol parameters
* lobehub://plugin/install?id=xxx&schema=xxx&marketId=xxx&meta_*=xxx
*/
export interface McpInstallProtocolParamsRFC {
- /** 可选的 UI 显示元数据,以 meta_ 为前缀 */
+ /** Optional UI display metadata, prefixed with meta_ */
[key: `meta_${string}`]: string | undefined;
- /** 插件的唯一标识符 */
+ /** Unique identifier of the plugin */
id: string;
- /** 提供该插件的 Marketplace 的唯一标识符 */
+ /** Unique identifier of the Marketplace providing this plugin */
marketId?: string;
- /** Base64URL 编码的 MCP Schema 对象 */
+ /** Base64URL encoded MCP Schema object */
schema: string;
- /** 插件类型,对于 MCP 固定为 'mcp' */
+ /** Plugin type, fixed as 'mcp' for MCP */
type: 'mcp';
}
/**
- * 协议URL解析结果
+ * Protocol URL parsing result
*/
export interface ProtocolUrlParsed {
- /** 操作类型 (如: 'install') */
+ /** Action type (e.g.: 'install') */
action: 'install' | 'configure' | 'update';
- /** 解析后的参数 */
+ /** Parsed parameters */
params: {
id: string;
marketId?: string;
type: string;
};
- /** MCP Schema 对象 */
+ /** MCP Schema object */
schema: McpSchema;
- /** 协议来源 */
+ /** Protocol source */
source: ProtocolSource;
- /** 插件类型 (如: 'mcp') */
+ /** Plugin type (e.g.: 'mcp') */
type: 'mcp' | 'plugin';
- /** URL类型 (如: 'plugin') */
+ /** URL type (e.g.: 'plugin') */
urlType: string;
}
/**
- * 安装确认弹窗信息
+ * Installation confirmation dialog information
*/
export interface InstallConfirmationInfo {
dependencies?: string[];
@@ -125,42 +125,42 @@ export interface InstallConfirmationInfo {
url?: string;
};
type: ProtocolSource;
- verified: boolean; // 是否为验证来源
+ verified: boolean; // Whether it's a verified source
};
}
/**
- * 协议处理器接口
+ * Protocol handler interface
*/
export interface ProtocolHandler {
/**
- * 处理协议URL
+ * Handle protocol URL
*/
handle(
parsed: ProtocolUrlParsed,
): Promise<{ error?: string; success: boolean; targetWindow?: string }>;
/**
- * 支持的操作
+ * Supported actions
*/
readonly supportedActions: string[];
/**
- * 协议类型
+ * Protocol type
*/
readonly type: string;
}
/**
- * 协议路由配置
+ * Protocol routing configuration
*/
export interface ProtocolRouteConfig {
- /** 操作类型 */
+ /** Action type */
action: string;
- /** 目标路径(相对于窗口base路径) */
+ /** Target path (relative to window base path) */
targetPath?: string;
- /** 目标窗口 */
+ /** Target window */
targetWindow: 'chat' | 'settings';
- /** 协议类型 */
+ /** Protocol type */
type: string;
}
diff --git a/packages/types/src/search.ts b/packages/types/src/search.ts
index c8482ff9d08..5cfd945087a 100644
--- a/packages/types/src/search.ts
+++ b/packages/types/src/search.ts
@@ -4,16 +4,16 @@ export type SearchMode = 'off' | 'auto' | 'on';
export enum ModelSearchImplement {
/**
- * 模型内置了搜索功能
- * 类似 Jina 、PPLX 等模型的搜索模式,让调用方无感知
+ * Model has built-in search functionality
+ * Similar to search modes of models like Jina, PPLX, transparent to the caller
*/
Internal = 'internal',
/**
- * 使用参数开关的方式,例如 Qwen、Google、OpenRouter,搜索结果在
+ * Uses parameter toggle approach, e.g. Qwen, Google, OpenRouter, search results in
*/
Params = 'params',
/**
- * 使用工具调用的方式
+ * Uses tool calling approach
*/
Tool = 'tool',
}
diff --git a/packages/types/src/tool/plugin.ts b/packages/types/src/tool/plugin.ts
index 840b7e210c7..dff086cb7d6 100644
--- a/packages/types/src/tool/plugin.ts
+++ b/packages/types/src/tool/plugin.ts
@@ -19,7 +19,7 @@ export interface CustomPluginParams {
/* eslint-disable sort-keys-fix/sort-keys-fix , typescript-sort-keys/interface */
/**
- * TODO: 临时方案,后续需要做一次大重构
+ * TODO: Temporary solution, needs major refactoring in the future
*/
mcp?: {
args?: string[];
@@ -27,13 +27,13 @@ export interface CustomPluginParams {
command?: string;
type: 'http' | 'stdio';
url?: string;
- // 新增认证配置支持
+ // Added authentication configuration support
auth?: {
type: 'none' | 'bearer' | 'oauth2';
token?: string; // Bearer Token
accessToken?: string; // OAuth2 Access Token
};
- // 新增 headers 配置支持
+ // Added headers configuration support
headers?: Record<string, string>;
};
avatar?: string;