Files
26e6896c5f fix(voice): dismissible overlay, silent no-speech handling, reasoning strip + provider registry with mainstream presets (#996)
* fix(server): keep vendor chat fields off foreign endpoints and strip reasoning from responses

* fix(engine): strip inline reasoning from polished text and assistant responses

* fix(server): never block the voice control loop with modal dialogs

* feat(server): provider registry for AI assistant with mainstream provider presets

* feat(ui-html): settings pages for the provider registry, model fetch everywhere and new ASR providers

* test(server): vendor detection, reasoning strip, provider store and expanded provider defaults

* fix(server): keep the voice overlay dismissible at all times

* fix(server,ui-html,installer): 服务商注册表与语音收尾的评审修正

- 加载配置时先读 ai_providers.json 再校验当前服务商,用户添加的服务商不再被重置为 deepseek
- Token 不再明文写进 ai_providers.json,统一存为 config.toml 的 token_<id>(DPAPI 加密、升级时按凭证保留);旧文件里的明文 token 读取时清掉
- 配置重载同时检查 ai_providers.json 的修改时间,只改注册表也能同步到 Server
- 删除当前服务商时按切换服务商的流程更新 token、地址和模型
- 内置服务商列表收敛到 ProviderStore::BuiltinProviderIds 一处,新增的六个预置服务商同样以 config.toml 为准;去掉未使用的 MakeProviderId,前端生成 id 时避开内置 id
- 出厂模板和开发配置补上六个新预置服务商的 token_/endpoint_/model_ 键
- 录音回调失败时走完整的取消收尾,恢复系统静音并关闭豆包连接;删除不可达的第二段 Esc 处理
- 语音转写地址查询模型时正确推出 /models
- 设置页补上语音识别和润色的 Custom 选项、新预置服务商的显示名,修正添加服务商的地址提示

---------

Co-authored-by: alayahbridge319-boop <246594988+alayahbridge319-boop@users.noreply.github.com>
Co-authored-by: fanlusky <1730976608@qq.com>
2026-10-16 21:46:41 +08:00

1375 lines
27 KiB
JSON

{
"version": 1,
"client": {
"configRequest": {
"surfaces": [
"settings"
]
},
"skinCatalogRequest": {
"surfaces": [
"settings"
]
},
"openSkinDirectory": {
"surfaces": [
"settings"
]
},
"openHelpcodeDirectory": {
"surfaces": [
"settings"
]
},
"openShuangpinDirectory": {
"surfaces": [
"settings"
]
},
"collocationModelDownload": {
"surfaces": [
"settings"
],
"data": {
"type": "object",
"properties": {
"modelId": {
"type": "string"
}
},
"required": [
"modelId"
],
"additionalProperties": false
}
},
"collocationModelDelete": {
"surfaces": [
"settings"
],
"data": {
"type": "object",
"properties": {
"modelId": {
"type": "string"
}
},
"required": [
"modelId"
],
"additionalProperties": false
}
},
"collocationModelImport": {
"surfaces": [
"settings"
],
"data": {
"type": "object",
"properties": {
"modelId": {
"type": "string"
}
},
"required": [
"modelId"
],
"additionalProperties": false
}
},
"collocationModelStatusRequest": {
"surfaces": [
"settings"
]
},
"neuralModelDownload": {
"surfaces": [
"settings"
]
},
"neuralModelImport": {
"surfaces": [
"settings"
]
},
"neuralModelDelete": {
"surfaces": [
"settings"
]
},
"neuralModelStatusRequest": {
"surfaces": [
"settings"
]
},
"openHandwritingPanel": {
"surfaces": [
"settings"
]
},
"restartServer": {
"surfaces": [
"settings"
]
},
"copyText": {
"surfaces": [
"settings"
],
"data": {
"type": "string"
}
},
"openExternalUrl": {
"surfaces": [
"settings"
],
"data": {
"type": "string"
}
},
"dragStart": {
"surfaces": [
"settings",
"toolbar"
]
},
"focus": {
"surfaces": [
"settings"
]
},
"resizeStart": {
"surfaces": [
"settings"
],
"data": {
"type": "string",
"enum": [
"left",
"right",
"top",
"bottom",
"left-top",
"right-top",
"left-bottom",
"right-bottom",
"client"
]
}
},
"resizeHitTest": {
"surfaces": [
"settings"
],
"data": {
"type": "string",
"enum": [
"left",
"right",
"top",
"bottom",
"left-top",
"right-top",
"left-bottom",
"right-bottom",
"client"
]
}
},
"windowControl": {
"surfaces": [
"settings"
],
"data": {
"type": "string",
"enum": [
"minimize",
"maximize",
"restore",
"close"
]
}
},
"maximizeButtonRect": {
"surfaces": [
"settings"
],
"data": {
"type": "object",
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"width": {
"type": "number",
"minimum": 0
},
"height": {
"type": "number",
"minimum": 0
},
"dpr": {
"type": "number",
"minimum": 0.01
}
},
"required": [
"x",
"y",
"width",
"height",
"dpr"
],
"additionalProperties": false
}
},
"configUpdate": {
"surfaces": [
"settings"
],
"data": {
"type": "object",
"properties": {
"path": {
"type": "string"
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
}
]
}
},
"required": [
"path",
"value"
],
"additionalProperties": false
}
},
"apiCredentialTest": {
"surfaces": [
"settings"
],
"data": {
"type": "object",
"properties": {
"requestId": {
"type": "string"
},
"service": {
"type": "string",
"enum": [
"translation.tencent",
"translation.niutrans",
"translation.custom",
"translation.ai",
"voice.asr",
"voice.polish",
"ai.assistant"
]
},
"config": {
"type": "object",
"properties": {},
"required": [],
"additionalProperties": true
}
},
"required": [
"requestId",
"service",
"config"
],
"additionalProperties": false
}
},
"apiModelList": {
"surfaces": [
"settings"
],
"data": {
"type": "object",
"properties": {
"requestId": {
"type": "string"
},
"service": {
"type": "string",
"enum": [
"ai.assistant",
"voice.asr",
"voice.polish"
]
},
"config": {
"type": "object",
"properties": {},
"required": [],
"additionalProperties": true
}
},
"required": [
"requestId",
"service",
"config"
],
"additionalProperties": false
}
},
"aiProviderSync": {
"surfaces": [
"settings"
],
"data": {
"type": "object",
"properties": {
"requestId": {
"type": "string"
},
"entries": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"endpoint": {
"type": "string"
},
"token": {
"type": "string"
},
"model": {
"type": "string"
}
},
"required": [
"id",
"name",
"endpoint",
"token",
"model"
],
"additionalProperties": false
}
}
},
"required": [
"requestId",
"entries"
],
"additionalProperties": false
}
},
"dictionaryRequest": {
"surfaces": [
"settings"
],
"data": {
"type": "object",
"properties": {
"requestId": {
"type": "string"
},
"dictionary": {
"type": "string",
"enum": [
"quanpin",
"wubi",
"english",
"quick"
]
},
"action": {
"type": "string",
"enum": [
"query",
"create",
"update",
"delete",
"import",
"importHans",
"export"
]
},
"word": {
"type": "string"
},
"code": {
"type": "string"
},
"content": {
"type": "string"
},
"weight": {
"type": "integer"
},
"oldWord": {
"type": "string"
},
"oldCode": {
"type": "string"
},
"display": {
"type": "string"
},
"oldDisplay": {
"type": "string"
},
"offset": {
"type": "integer",
"minimum": 0,
"maximum": 2147483647
},
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 200
}
},
"required": [
"requestId",
"dictionary",
"action"
],
"additionalProperties": false
}
},
"statsRequest": {
"surfaces": [
"settings"
],
"data": {
"type": "object",
"properties": {
"requestId": {
"type": "string"
},
"action": {
"type": "string",
"enum": [
"overview",
"clearAll",
"openDirectory"
]
}
},
"required": [
"requestId",
"action"
],
"additionalProperties": false
}
},
"defaultImeRequest": {
"surfaces": [
"settings"
],
"data": {
"type": "object",
"properties": {
"requestId": {
"type": "string"
},
"action": {
"type": "string",
"enum": [
"status",
"setDefault",
"openSystemSettings"
]
}
},
"required": [
"requestId",
"action"
],
"additionalProperties": false
}
},
"gameCompatRequest": {
"surfaces": [
"settings"
],
"data": {
"type": "object",
"properties": {
"requestId": {
"type": "string"
},
"action": {
"type": "string",
"enum": [
"status",
"apply"
]
},
"enabled": {
"type": "boolean"
},
"name": {
"type": "string"
}
},
"required": [
"requestId",
"action"
],
"additionalProperties": false
}
},
"openKeyboardPanel": {
"surfaces": [
"settings",
"toolbar"
]
},
"candidate": {
"surfaces": [
"candidate"
],
"data": {
"type": "integer",
"minimum": 1,
"maximum": 10
}
},
"delete": {
"surfaces": [
"candidate"
],
"data": {
"type": "integer",
"minimum": 1,
"maximum": 10
}
},
"pin": {
"surfaces": [
"candidate"
],
"data": {
"type": "integer",
"minimum": 1,
"maximum": 10
}
},
"clearPosition": {
"surfaces": [
"candidate"
],
"data": {
"type": "integer",
"minimum": 1,
"maximum": 10
}
},
"candidateWheel": {
"surfaces": [
"candidate"
],
"data": {
"type": "integer",
"minimum": -32768,
"maximum": 32767
}
},
"candidatePage": {
"surfaces": [
"candidate"
],
"data": {
"type": "string",
"enum": [
"previous",
"next"
]
}
},
"fixPosition": {
"surfaces": [
"candidate"
],
"data": {
"type": "object",
"properties": {
"index": {
"type": "integer",
"minimum": 1,
"maximum": 10
},
"position": {
"type": "integer",
"minimum": 1,
"maximum": 5
}
},
"required": [
"index",
"position"
],
"additionalProperties": false
}
},
"contextMenuResize": {
"surfaces": [
"candidate"
],
"data": {
"type": "object",
"properties": {
"width": {
"type": "integer",
"minimum": 0,
"maximum": 65535
},
"height": {
"type": "integer",
"minimum": 0,
"maximum": 65535
},
"topExpansion": {
"type": "integer",
"minimum": 0,
"maximum": 65535
},
"leftExpansion": {
"type": "integer",
"minimum": 0,
"maximum": 65535
}
},
"required": [
"width",
"height"
],
"additionalProperties": false
}
},
"contextMenuClosed": {
"surfaces": [
"candidate"
]
},
"candidatePointerArmed": {
"surfaces": [
"candidate"
]
},
"candidatePointerMotion": {
"surfaces": [
"candidate"
]
},
"candidateFrameProbe": {
"surfaces": [
"candidate"
],
"data": {
"type": "object",
"properties": {
"revision": {
"type": "integer"
},
"stage": {
"type": "integer"
},
"performanceMs": {
"type": "number",
"minimum": 0
}
},
"required": [
"revision",
"stage",
"performanceMs"
],
"additionalProperties": false
}
},
"candidatePointerProbe": {
"surfaces": [
"candidate"
],
"data": {
"type": "object",
"properties": {
"probe": {
"type": "integer"
},
"screenX": {
"type": "integer"
},
"screenY": {
"type": "integer"
},
"clientX": {
"type": "integer"
},
"clientY": {
"type": "integer"
},
"movementX": {
"type": "integer"
},
"movementY": {
"type": "integer"
},
"armed": {
"type": "boolean"
}
},
"required": [
"probe",
"screenX",
"screenY",
"clientX",
"clientY",
"movementX",
"movementY",
"armed"
],
"additionalProperties": false
}
},
"contentTruncated": {
"surfaces": [
"candidate",
"toolbar",
"menu"
],
"data": {
"type": "object",
"properties": {
"surface": {
"type": "string",
"enum": [
"candidate",
"toolbar",
"menu",
"ftb",
"candwnd",
"cand"
]
},
"width": {
"type": "number",
"minimum": 0
},
"height": {
"type": "number",
"minimum": 0
}
},
"required": [
"surface",
"width",
"height"
],
"additionalProperties": true
}
},
"floatingToggle": {
"surfaces": [
"menu"
],
"data": {
"type": "boolean"
}
},
"settings": {
"surfaces": [
"menu"
]
},
"about": {
"surfaces": [
"menu"
]
},
"emojiSymbols": {
"surfaces": [
"menu"
]
},
"keyboardPanel": {
"surfaces": [
"menu"
]
},
"handwritingPanel": {
"surfaces": [
"menu"
]
},
"voiceInput": {
"surfaces": [
"menu"
]
},
"changeInputScheme": {
"surfaces": [
"menu"
],
"data": {
"type": "string",
"enum": [
"quanpin",
"shuangpin",
"wubi"
]
}
},
"inputSchemeSubmenu": {
"surfaces": [
"menu"
],
"data": {
"type": "object",
"properties": {
"open": {
"type": "boolean"
},
"width": {
"type": "number",
"minimum": 0
}
},
"required": [
"open",
"width"
],
"additionalProperties": false
}
},
"ready": {
"surfaces": [
"toolbar"
]
},
"exitEnglishInputMode": {
"surfaces": [
"toolbar"
]
},
"changeCharacterSet": {
"surfaces": [
"toolbar"
]
},
"openSettings": {
"surfaces": [
"toolbar"
]
},
"openEmojiPanel": {
"surfaces": [
"toolbar"
]
},
"changeIMEMode": {
"surfaces": [
"toolbar"
],
"data": {
"type": "string",
"enum": [
"cn",
"en"
]
}
},
"changeCharMode": {
"surfaces": [
"toolbar"
],
"data": {
"type": "string",
"enum": [
"fullwidth",
"halfwidth"
]
}
},
"changePuncMode": {
"surfaces": [
"toolbar"
],
"data": {
"type": "string",
"enum": [
"puncEn",
"puncCn"
]
}
}
},
"server": {
"configSnapshot": {
"data": {
"type": "object",
"properties": {},
"required": [],
"additionalProperties": true
}
},
"windowState": {
"data": {
"type": "object",
"properties": {
"isMaximized": {
"type": "boolean"
}
},
"required": [
"isMaximized"
],
"additionalProperties": false
}
},
"maxButtonEvent": {
"data": {
"type": "object",
"properties": {
"event": {
"type": "string",
"enum": [
"enter",
"leave",
"down",
"up",
"click"
]
}
},
"required": [
"event"
],
"additionalProperties": false
}
},
"apiCredentialTestResult": {
"properties": {
"requestId": {
"type": "string"
},
"ok": {
"type": "boolean"
},
"message": {
"type": "string"
}
},
"required": [
"requestId",
"ok",
"message"
],
"additionalProperties": false
},
"defaultImeResponse": {
"properties": {
"requestId": {
"type": "string"
},
"action": {
"type": "string"
},
"ok": {
"type": "boolean"
},
"message": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
"isDefault": {
"type": "boolean"
}
},
"required": [
"requestId",
"action",
"ok",
"message"
],
"additionalProperties": false
},
"gameCompatResponse": {
"properties": {
"requestId": {
"type": "string"
},
"action": {
"type": "string"
},
"ok": {
"type": "boolean"
},
"message": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
"name": {
"type": "string"
},
"registeredName": {
"type": "string"
},
"defaultName": {
"type": "string"
}
},
"required": [
"requestId",
"action",
"ok",
"message"
],
"additionalProperties": false
},
"apiModelListResult": {
"properties": {
"requestId": {
"type": "string"
},
"ok": {
"type": "boolean"
},
"message": {
"type": "string"
},
"models": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"requestId",
"ok",
"message"
],
"additionalProperties": false
},
"aiProviderSyncResult": {
"properties": {
"requestId": {
"type": "string"
},
"ok": {
"type": "boolean"
},
"message": {
"type": "string"
}
},
"required": [
"requestId",
"ok",
"message"
],
"additionalProperties": false
},
"dictionaryResponse": {
"properties": {
"requestId": {
"type": "string"
},
"action": {
"type": "string"
},
"dictionary": {
"type": "string"
},
"ok": {
"type": "boolean"
},
"message": {
"type": "string"
},
"rows": {
"type": "array",
"items": {
"type": "object",
"properties": {
"word": {
"type": "string"
},
"code": {
"type": "string"
},
"display": {
"type": "string"
},
"weight": {
"type": "integer"
}
},
"required": [
"word"
],
"additionalProperties": false
}
},
"content": {
"type": "string"
},
"filename": {
"type": "string"
},
"offset": {
"type": "integer",
"minimum": 0
},
"hasMore": {
"type": "boolean"
}
},
"required": [
"requestId",
"ok",
"message",
"rows"
],
"additionalProperties": true
},
"statsResponse": {
"properties": {
"requestId": {
"type": "string"
},
"action": {
"type": "string"
},
"ok": {
"type": "boolean"
},
"message": {
"type": "string"
},
"overview": {
"type": "object",
"properties": {
"hasData": {
"type": "boolean"
},
"firstDayKey": {
"type": "integer"
},
"lastDayKey": {
"type": "integer"
},
"days": {
"type": "integer"
},
"totalChars": {
"type": "integer"
},
"totalActiveMs": {
"type": "integer"
},
"todayDayKey": {
"type": "integer"
},
"todayChars": {
"type": "integer"
},
"todayActiveMs": {
"type": "integer"
},
"averagePerDay": {
"type": "number"
},
"currentStreak": {
"type": "integer"
},
"longestStreak": {
"type": "integer"
},
"bestDayKey": {
"type": "integer"
},
"bestDayChars": {
"type": "integer"
},
"todaySpeed": {
"type": "number"
},
"averageSpeed": {
"type": "number"
},
"fastestSpeed": {
"type": "number"
},
"fastestDayKey": {
"type": "integer"
},
"todayFirstWordRatio": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
]
},
"totalFirstWordRatio": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
]
},
"todayFirstWordTotal": {
"type": "integer"
},
"categories": {
"type": "object",
"properties": {
"cjk": {
"type": "integer"
},
"latin": {
"type": "integer"
},
"digit": {
"type": "integer"
},
"punct": {
"type": "integer"
},
"other": {
"type": "integer"
}
},
"required": [
"cjk",
"latin",
"digit",
"punct",
"other"
],
"additionalProperties": false
},
"todayHourly": {
"type": "array",
"items": {
"type": "integer"
}
},
"daily": {
"type": "array",
"items": {
"type": "object",
"properties": {
"dayKey": {
"type": "integer"
},
"cjk": {
"type": "integer"
},
"latin": {
"type": "integer"
},
"digit": {
"type": "integer"
},
"punct": {
"type": "integer"
},
"other": {
"type": "integer"
},
"activeMs": {
"type": "integer"
},
"firstWordHits": {
"type": "integer"
},
"firstWordTotal": {
"type": "integer"
}
},
"required": [
"dayKey",
"cjk",
"latin",
"digit",
"punct",
"other",
"activeMs",
"firstWordHits",
"firstWordTotal"
],
"additionalProperties": false
}
}
},
"required": [
"hasData",
"firstDayKey",
"lastDayKey",
"days",
"totalChars",
"totalActiveMs",
"todayDayKey",
"todayChars",
"todayActiveMs",
"averagePerDay",
"currentStreak",
"longestStreak",
"bestDayKey",
"bestDayChars",
"todaySpeed",
"averageSpeed",
"fastestSpeed",
"fastestDayKey",
"todayFirstWordRatio",
"totalFirstWordRatio",
"todayFirstWordTotal",
"categories",
"todayHourly",
"daily"
],
"additionalProperties": false
},
"removedDays": {
"type": "integer"
}
},
"required": [
"requestId",
"action",
"ok",
"message"
],
"additionalProperties": true
}
}
}