@lobehub/chat 1.124.2 → 1.124.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/scripts/pr-comment.js +2 -11
- package/.github/workflows/desktop-pr-build.yml +12 -86
- package/.github/workflows/release-desktop-beta.yml +20 -91
- package/CHANGELOG.md +50 -0
- package/apps/desktop/electron-builder.js +4 -8
- package/changelog/v1.json +18 -0
- package/package.json +1 -1
- package/packages/const/package.json +3 -1
- package/packages/const/src/analytics.ts +1 -1
- package/packages/const/src/desktop.ts +3 -2
- package/packages/const/src/discover.ts +3 -2
- package/packages/const/src/guide.ts +2 -2
- package/packages/const/src/index.ts +1 -0
- package/packages/const/src/settings/common.ts +1 -1
- package/packages/const/src/settings/genUserLLMConfig.test.ts +1 -2
- package/packages/const/src/settings/genUserLLMConfig.ts +1 -2
- package/packages/const/src/settings/index.ts +1 -3
- package/packages/const/src/settings/knowledge.ts +1 -1
- package/packages/const/src/settings/llm.ts +2 -4
- package/packages/const/src/settings/systemAgent.ts +1 -5
- package/packages/const/src/settings/tts.ts +1 -1
- package/packages/const/src/url.ts +2 -2
- package/packages/model-bank/src/aiModels/qwen.ts +4 -0
- package/packages/model-runtime/src/higress/index.ts +2 -3
- package/packages/types/src/discover/index.ts +0 -8
- package/packages/types/src/index.ts +2 -0
- package/packages/types/src/tool/index.ts +1 -0
- package/packages/types/src/tool/tool.ts +1 -1
- package/packages/types/src/user/settings/index.ts +1 -2
- package/packages/utils/vitest.config.mts +0 -1
- package/src/app/(backend)/webapi/models/[provider]/pull/route.ts +0 -2
- package/src/app/(backend)/webapi/models/[provider]/route.ts +0 -2
- package/src/app/(backend)/webapi/text-to-image/[provider]/route.ts +0 -2
- package/src/app/(backend)/webapi/trace/route.ts +0 -2
- package/src/app/[variants]/(main)/chat/(workspace)/@conversation/features/ChatInput/V1Mobile/ActionBar.tsx +30 -0
- package/src/app/[variants]/(main)/chat/(workspace)/@conversation/features/ChatInput/V1Mobile/Files/index.tsx +32 -0
- package/src/app/[variants]/(main)/chat/(workspace)/@conversation/features/ChatInput/V1Mobile/InputArea/Container.tsx +41 -0
- package/src/app/[variants]/(main)/chat/(workspace)/@conversation/features/ChatInput/V1Mobile/InputArea/index.tsx +156 -0
- package/src/app/[variants]/(main)/chat/(workspace)/@conversation/features/ChatInput/V1Mobile/Send.tsx +33 -0
- package/src/app/[variants]/(main)/chat/(workspace)/@conversation/features/ChatInput/V1Mobile/index.tsx +89 -0
- package/src/app/[variants]/(main)/chat/(workspace)/@conversation/features/ChatInput/V1Mobile/useSend.ts +102 -0
- package/src/app/[variants]/(main)/chat/(workspace)/@conversation/features/ChatInput/index.tsx +1 -1
- package/src/app/[variants]/(main)/settings/_layout/Mobile/Header.tsx +4 -0
- package/src/features/ChatInput/ActionBar/SaveTopic/index.tsx +4 -1
- package/packages/const/src/settings/sync.ts +0 -5
- package/scripts/electronWorkflow/mergeMacReleaseFiles.ts +0 -207
@@ -1,207 +0,0 @@
|
|
1
|
-
/* eslint-disable unicorn/no-process-exit, unicorn/prefer-top-level-await */
|
2
|
-
import fs from 'fs-extra';
|
3
|
-
import path from 'node:path';
|
4
|
-
import { parse, stringify } from 'yaml';
|
5
|
-
|
6
|
-
interface LatestMacYml {
|
7
|
-
files: Array<{
|
8
|
-
sha512: string;
|
9
|
-
size: number;
|
10
|
-
url: string;
|
11
|
-
}>;
|
12
|
-
path: string;
|
13
|
-
releaseDate: string;
|
14
|
-
sha512: string;
|
15
|
-
version: string;
|
16
|
-
}
|
17
|
-
|
18
|
-
// 配置
|
19
|
-
const RELEASE_TAG = process.env.RELEASE_TAG || process.argv[2];
|
20
|
-
const FILE_NAME = 'latest-mac.yml';
|
21
|
-
const RELEASE_DIR = path.resolve('release');
|
22
|
-
|
23
|
-
// 验证环境变量和输入
|
24
|
-
if (!RELEASE_TAG) {
|
25
|
-
console.error('❌ RELEASE_TAG environment variable or argument is required');
|
26
|
-
process.exit(1);
|
27
|
-
}
|
28
|
-
|
29
|
-
// 验证 release tag 格式
|
30
|
-
if (!/^v?\d+\.\d+\.\d+/.test(RELEASE_TAG)) {
|
31
|
-
console.error(`❌ Invalid RELEASE_TAG format: ${RELEASE_TAG}. Expected format: v1.2.3`);
|
32
|
-
process.exit(1);
|
33
|
-
}
|
34
|
-
|
35
|
-
/**
|
36
|
-
* 检测 latest-mac.yml 文件的平台类型
|
37
|
-
*/
|
38
|
-
function detectPlatform(yamlContent: LatestMacYml): 'intel' | 'arm' | 'both' | 'none' {
|
39
|
-
const hasIntel = yamlContent.files.some((file) => file.url.includes('-x64.dmg'));
|
40
|
-
const hasArm = yamlContent.files.some((file) => file.url.includes('-arm64.dmg'));
|
41
|
-
|
42
|
-
if (hasIntel && hasArm) return 'both';
|
43
|
-
if (hasIntel && !hasArm) return 'intel';
|
44
|
-
if (!hasIntel && hasArm) return 'arm';
|
45
|
-
return 'none';
|
46
|
-
}
|
47
|
-
|
48
|
-
/**
|
49
|
-
* 合并两个 latest-mac.yml 文件
|
50
|
-
* @param intelContent Intel 平台的 YAML 内容
|
51
|
-
* @param armContent ARM 平台的 YAML 内容
|
52
|
-
*/
|
53
|
-
function mergeYamlFiles(intelContent: LatestMacYml, armContent: LatestMacYml): string {
|
54
|
-
// 以 Intel 为基础(保持兼容性)
|
55
|
-
const merged: LatestMacYml = {
|
56
|
-
...intelContent,
|
57
|
-
files: [...intelContent.files, ...armContent.files],
|
58
|
-
};
|
59
|
-
|
60
|
-
// 使用 yaml 库生成,保持 sha512 在同一行
|
61
|
-
return stringify(merged, {
|
62
|
-
lineWidth: 0, // 不换行
|
63
|
-
});
|
64
|
-
}
|
65
|
-
|
66
|
-
// GitHub API functions removed since we're working with local files only
|
67
|
-
|
68
|
-
/**
|
69
|
-
* 读取本地文件
|
70
|
-
*/
|
71
|
-
function readLocalFile(filePath: string): string | null {
|
72
|
-
try {
|
73
|
-
if (fs.existsSync(filePath)) {
|
74
|
-
const content = fs.readFileSync(filePath, 'utf8');
|
75
|
-
console.log(`✅ Read local file: ${filePath} (${content.length} chars)`);
|
76
|
-
return content;
|
77
|
-
}
|
78
|
-
console.log(`⚠️ Local file not found: ${filePath}`);
|
79
|
-
return null;
|
80
|
-
} catch (error) {
|
81
|
-
console.error(`❌ Error reading local file ${filePath}:`, error);
|
82
|
-
return null;
|
83
|
-
}
|
84
|
-
}
|
85
|
-
|
86
|
-
/**
|
87
|
-
* 写入本地文件
|
88
|
-
*/
|
89
|
-
function writeLocalFile(filePath: string, content: string): void {
|
90
|
-
try {
|
91
|
-
fs.writeFileSync(filePath, content, 'utf8');
|
92
|
-
console.log(`✅ Written local file: ${filePath} (${content.length} chars)`);
|
93
|
-
} catch (error) {
|
94
|
-
console.error(`❌ Error writing local file ${filePath}:`, error);
|
95
|
-
throw error;
|
96
|
-
}
|
97
|
-
}
|
98
|
-
|
99
|
-
/**
|
100
|
-
* 主函数
|
101
|
-
*/
|
102
|
-
async function main(): Promise<void> {
|
103
|
-
try {
|
104
|
-
console.log(`🚀 Starting macOS Release file merge for ${RELEASE_TAG}`);
|
105
|
-
console.log(`📁 Working directory: ${RELEASE_DIR}`);
|
106
|
-
|
107
|
-
// 1. 检查 release 目录下的所有文件
|
108
|
-
const releaseFiles = fs.readdirSync(RELEASE_DIR);
|
109
|
-
console.log(`📂 Files in release directory: ${releaseFiles.join(', ')}`);
|
110
|
-
|
111
|
-
// 2. 查找所有 latest-mac*.yml 文件
|
112
|
-
const macYmlFiles = releaseFiles.filter(
|
113
|
-
(f) => f.startsWith('latest-mac') && f.endsWith('.yml'),
|
114
|
-
);
|
115
|
-
console.log(`🔍 Found macOS YAML files: ${macYmlFiles.join(', ')}`);
|
116
|
-
|
117
|
-
if (macYmlFiles.length === 0) {
|
118
|
-
console.log('⚠️ No macOS YAML files found, skipping merge');
|
119
|
-
return;
|
120
|
-
}
|
121
|
-
|
122
|
-
// 3. 处理找到的文件,识别平台
|
123
|
-
const macFiles: Array<{
|
124
|
-
content: string;
|
125
|
-
filename: string;
|
126
|
-
platform: 'intel' | 'arm';
|
127
|
-
yaml: LatestMacYml;
|
128
|
-
}> = [];
|
129
|
-
|
130
|
-
for (const fileName of macYmlFiles) {
|
131
|
-
const filePath = path.join(RELEASE_DIR, fileName);
|
132
|
-
const content = readLocalFile(filePath);
|
133
|
-
|
134
|
-
if (!content) continue;
|
135
|
-
|
136
|
-
try {
|
137
|
-
const yamlContent = parse(content) as LatestMacYml;
|
138
|
-
const platform = detectPlatform(yamlContent);
|
139
|
-
|
140
|
-
if (platform === 'intel' || platform === 'arm') {
|
141
|
-
macFiles.push({ content, filename: fileName, platform, yaml: yamlContent });
|
142
|
-
console.log(`🔍 Detected ${platform} platform in ${fileName}`);
|
143
|
-
} else if (platform === 'both') {
|
144
|
-
console.log(`✅ Found already merged file: ${fileName}`);
|
145
|
-
// 如果已经是合并后的文件,直接复制为最终文件
|
146
|
-
writeLocalFile(path.join(RELEASE_DIR, FILE_NAME), content);
|
147
|
-
return;
|
148
|
-
} else {
|
149
|
-
console.log(`⚠️ Unknown platform type: ${platform} in ${fileName}`);
|
150
|
-
}
|
151
|
-
} catch (error) {
|
152
|
-
console.warn(`⚠️ Failed to parse ${fileName}:`, error);
|
153
|
-
}
|
154
|
-
}
|
155
|
-
|
156
|
-
// 4. 检查是否有两个不同平台的文件
|
157
|
-
const intelFiles = macFiles.filter((f) => f.platform === 'intel');
|
158
|
-
const armFiles = macFiles.filter((f) => f.platform === 'arm');
|
159
|
-
|
160
|
-
if (intelFiles.length === 0 && armFiles.length === 0) {
|
161
|
-
console.log('⚠️ No valid platform files found');
|
162
|
-
return;
|
163
|
-
}
|
164
|
-
|
165
|
-
if (intelFiles.length === 0) {
|
166
|
-
console.log('⚠️ No Intel files found, using ARM only');
|
167
|
-
writeLocalFile(path.join(RELEASE_DIR, FILE_NAME), armFiles[0].content);
|
168
|
-
return;
|
169
|
-
}
|
170
|
-
|
171
|
-
if (armFiles.length === 0) {
|
172
|
-
console.log('⚠️ No ARM files found, using Intel only');
|
173
|
-
writeLocalFile(path.join(RELEASE_DIR, FILE_NAME), intelFiles[0].content);
|
174
|
-
return;
|
175
|
-
}
|
176
|
-
|
177
|
-
// 5. 合并 Intel 和 ARM 文件
|
178
|
-
const intelFile = intelFiles[0];
|
179
|
-
const armFile = armFiles[0];
|
180
|
-
|
181
|
-
console.log(`🔄 Merging ${intelFile.filename} (Intel) and ${armFile.filename} (ARM)...`);
|
182
|
-
const mergedContent = mergeYamlFiles(intelFile.yaml, armFile.yaml);
|
183
|
-
|
184
|
-
// 6. 保存合并后的文件
|
185
|
-
const mergedFilePath = path.join(RELEASE_DIR, FILE_NAME);
|
186
|
-
writeLocalFile(mergedFilePath, mergedContent);
|
187
|
-
|
188
|
-
// 7. 验证合并结果
|
189
|
-
const mergedYaml = parse(mergedContent) as LatestMacYml;
|
190
|
-
const finalPlatform = detectPlatform(mergedYaml);
|
191
|
-
|
192
|
-
if (finalPlatform === 'both') {
|
193
|
-
console.log('✅ Successfully merged both Intel and ARM platforms');
|
194
|
-
console.log(`📊 Final file contains ${mergedYaml.files.length} files`);
|
195
|
-
} else {
|
196
|
-
console.warn(`⚠️ Merge result unexpected: ${finalPlatform}`);
|
197
|
-
}
|
198
|
-
|
199
|
-
console.log('🎉 Merge complete!');
|
200
|
-
} catch (error) {
|
201
|
-
console.error('❌ Error during merge:', error);
|
202
|
-
process.exit(1);
|
203
|
-
}
|
204
|
-
}
|
205
|
-
|
206
|
-
// 运行主函数
|
207
|
-
void main();
|