feat(tts): add api endpoints and optimization for apple silicon

Introduce a comprehensive TTS/ASR module that:
- Adds /v1/tts-asr/config, /status, /warmup, /tts, /asr endpoints with detailed JSON responses
- Implements Apple‑Silicon detection, device selection (MPS/CUDA/CPU), and memory limiting logic
- Supports selectable model size, quantization, and offline mode via environment variables
- Adds robust audio validation and multi‑path resampling fallback
- Provides new README sections for API usage, device detection, and performance benchmarking
- Includes a full testing suite: unit tests, integration tests, macOS simulation and performance reports
- Updates backend dependencies and CI scripts
- Adds new front‑end views and components for Univer editor integration

All changes are backward compatible; new features are exposed through environment variables and new API routes.
This commit is contained in:
2026-04-06 11:14:09 +08:00
parent c70cb2a9f0
commit 7985fe9641
27 changed files with 9304 additions and 260 deletions
+28 -7
View File
@@ -81,6 +81,31 @@ export function useFileSystem() {
const stored = localStorage.getItem(STORAGE_KEY)
if (stored) {
tree.value = JSON.parse(stored)
} else {
// 创建示例文件和文件夹
const welcomeId = generateId()
const folderId = generateId()
tree.value = [
{
id: folderId,
name: '示例文件夹',
type: 'folder',
children: [],
parentId: null,
createdAt: Date.now(),
updatedAt: Date.now()
},
{
id: welcomeId,
name: '欢迎使用.md',
type: 'file',
content: '# 欢迎使用文件系统\n\n这是一个类似 GitHub 风格的文件浏览器。\n\n## 功能\n\n- ✅ 文件夹展开/折叠\n- ✅ 文件选中高亮\n- ✅ 拖拽移动\n- ✅ 右键菜单\n- ✅ 重命名\n- ✅ 新建/删除\n\n点击左侧的文件或文件夹来查看内容。\n',
parentId: null,
createdAt: Date.now(),
updatedAt: Date.now()
}
]
save()
}
} catch {
tree.value = []
@@ -174,13 +199,9 @@ export function useFileSystem() {
error.value = null
}
function select(id) {
selectedId.value = id
const node = findNode(tree.value, id)
if (node && node.type === 'folder') {
toggleFolder(id)
}
}
function select(id) {
selectedId.value = id
}
function toggleFolder(id) {
const node = findNode(tree.value, id)