dsh-mobile-plugin 0.5.133 → 0.5.134
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/config/agent-presets/standard/skills/dsh-mobile-kb/references/cloudflare.md +1 -1
- package/config/agent-presets/standard/skills/dsh-mobile-kb/references/frp.md +1 -1
- package/config/agent-presets/standard/skills/dsh-mobile-kb/references/selfhost-common.md +1 -1
- package/lib/ai-diagnosis.js +24 -2
- package/package.json +16 -17
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
## 上手机前验收
|
|
35
35
|
|
|
36
|
-
按 `references/selfhost-common.md` 四条过一遍:体检口 `curl https://xxx.trycloudflare.com/api/mobile/v1/health` 回带 service 和版本的 JSON
|
|
36
|
+
按 `references/selfhost-common.md` 四条过一遍:体检口 `curl https://xxx.trycloudflare.com/api/mobile/v1/health` 回带 service 和版本的 JSON;不带任何凭据访问 `/status` 回 404 `{"ok":false}`、带无效凭据才回 401(见共用篇,别只看 health 就说鉴权没问题);手机断 Wi-Fi 走流量实测 SSE 流式(聊天能否一段段出来)和 WebSocket(内置浏览器能否打开);传个稍大文件看有没有被 100MB 上限截断。WSS/SSE 是能穿的,流式卡住先查应用层心跳和总控,而不是先怀疑地址。
|
|
37
37
|
|
|
38
38
|
## 已知限制
|
|
39
39
|
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
|
|
50
50
|
## 上手机前验收
|
|
51
51
|
|
|
52
|
-
按 `references/selfhost-common.md` 四条过一遍:体检口 `curl https://域名/api/mobile/v1/health` 回带 service 和版本的 JSON
|
|
52
|
+
按 `references/selfhost-common.md` 四条过一遍:体检口 `curl https://域名/api/mobile/v1/health` 回带 service 和版本的 JSON;不带任何凭据访问 `/status` 回 404 `{"ok":false}`、带无效凭据才回 401(见共用篇);手机流量下实测 SSE 流式和大文件上传。frp 的 tcp 一般不缓冲,反而比 web 隧道稳;卡住就查服务器到主机这段。
|
|
53
53
|
|
|
54
54
|
## 几个坑
|
|
55
55
|
|
|
@@ -33,7 +33,7 @@ DSH 部署在 NAS 或家庭服务器上、前面已有 Nginx/Caddy 时,可以
|
|
|
33
33
|
## 上手机前的验收(每种方案都过一遍)
|
|
34
34
|
|
|
35
35
|
1. **地址通不通**:电脑上 `curl https://域名/api/mobile/v1/health`(或 `http://IP:端口/...`),应回带 `service` 和版本的 JSON。这是体检口,不带 token 也能回。
|
|
36
|
-
2.
|
|
36
|
+
2. **鉴权有没有生效**:不带任何凭据访问别的路径(如 `.../api/mobile/v1/status`),应回 404 `{"ok":false}`——入口刻意不告诉外人这里跑的是什么;带一枚无效凭据才回 401 说明原因。回的若是数据,说明暴露面不对,先别用。体检口 `/api/mobile/v1/health` 本身免 token,单看它不能判断鉴权。
|
|
37
37
|
3. **流式能不能穿**:SSE 长连接和 WebSocket 用配对好的手机实测——聊天能否一段段出来、内置浏览器能否打开。被缓冲就回去调反代或换隧道类型。
|
|
38
38
|
4. **大文件上传**:传个稍大的文件走一遍,确认没被截断。
|
|
39
39
|
|
package/lib/ai-diagnosis.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// 2026-11-24:本机面板全局悬浮 AI 问诊按钮的取选项与建会话发首句,只走 localOnly 控制面。
|
|
2
|
+
// 2026-11-28:首句带上包内 dsh-mobile-kb 正文;桌面预设没登记这份技能,模型调不到。
|
|
2
3
|
'use strict';
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -9,12 +10,17 @@
|
|
|
9
10
|
* 收敛成小对象,任一路 RPC 失败或回执形状异常都回 { ok:false, error },不把异常抛给路由层。
|
|
10
11
|
*/
|
|
11
12
|
|
|
13
|
+
import fs from 'node:fs';
|
|
14
|
+
import path from 'node:path';
|
|
12
15
|
import { createRequire } from 'node:module';
|
|
16
|
+
import { fileURLToPath } from 'node:url';
|
|
13
17
|
|
|
14
18
|
const require = createRequire(import.meta.url);
|
|
15
19
|
const { unwrap } = require('./mobile/envelope.js');
|
|
16
20
|
const { callSessions } = require('./mobile/rpc.js');
|
|
17
21
|
|
|
22
|
+
const KB_DIR = path.join(path.dirname(path.dirname(fileURLToPath(import.meta.url))), 'config', 'agent-presets', 'standard', 'skills', 'dsh-mobile-kb');
|
|
23
|
+
|
|
18
24
|
const MAX_WORKSPACES = 100;
|
|
19
25
|
const MAX_MODEL_GROUPS = 16;
|
|
20
26
|
const MAX_MODELS_PER_GROUP = 40;
|
|
@@ -151,6 +157,21 @@ async function archiveQuietly(ctx, sessionId) {
|
|
|
151
157
|
} catch { /* 原始失败才是要报给面板的那一个 */ }
|
|
152
158
|
}
|
|
153
159
|
|
|
160
|
+
/**
|
|
161
|
+
* 桌面 standard 预设没登记 dsh-mobile-kb,模型在问诊会话里调它会得到 unknown。
|
|
162
|
+
* 把包里同一份正文随首句带进去,references 仍读同一个目录,不留第二份副本;
|
|
163
|
+
* 文件读不到时退回原首句,不让问诊整体失败。
|
|
164
|
+
*/
|
|
165
|
+
function withKnowledgeBase(prompt, kbDir = KB_DIR) {
|
|
166
|
+
let body;
|
|
167
|
+
try {
|
|
168
|
+
body = fs.readFileSync(path.join(kbDir, 'SKILL.md'), 'utf8');
|
|
169
|
+
} catch {
|
|
170
|
+
return prompt;
|
|
171
|
+
}
|
|
172
|
+
return `${prompt}\n\n下面是 dsh-mobile-kb 技能的正文(这条会话里技能工具调不到它,直接照这份做)。正文里 references/xxx 指 ${path.join(kbDir, 'references')}/xxx,需要时用读文件工具打开;按里面的分类和顺序排查,不要再说这项技能没装。\n\n${body}`;
|
|
173
|
+
}
|
|
174
|
+
|
|
154
175
|
/** POST 建会话 + 带模型发送第一句;成功回 sessionId,失败回错误且不抛。 */
|
|
155
176
|
async function launchAiDiagnosis(ctx, body) {
|
|
156
177
|
try {
|
|
@@ -174,7 +195,8 @@ async function launchAiDiagnosis(ctx, body) {
|
|
|
174
195
|
|
|
175
196
|
const payload = {
|
|
176
197
|
sessionId,
|
|
177
|
-
|
|
198
|
+
// 知识库是包内自带的内容,不是面板入参;20k 的入口上限只管上面校验过的 prompt。
|
|
199
|
+
content: [{ type: 'text', text: withKnowledgeBase(prompt) }],
|
|
178
200
|
// 宿主 session.prompt 支持本次发送直接带模型,省掉「先建再 select」两步。
|
|
179
201
|
...(provider && model ? { modelSelection: { provider, model } } : {}),
|
|
180
202
|
};
|
|
@@ -195,4 +217,4 @@ async function launchAiDiagnosis(ctx, body) {
|
|
|
195
217
|
}
|
|
196
218
|
}
|
|
197
219
|
|
|
198
|
-
export { buildAiDiagnosisOptions, launchAiDiagnosis };
|
|
220
|
+
export { buildAiDiagnosisOptions, launchAiDiagnosis, withKnowledgeBase };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mobile-plugin",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.134",
|
|
4
4
|
"description": "Mobile API (/api/mobile/v1) and relay client for the DSH mobile app — desktop profile build (dsh 0.2.x, peers resolved by the host)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"icon": "./icon.png",
|
|
@@ -91,11 +91,11 @@
|
|
|
91
91
|
"dsh-mobile-tailcat-win32-arm64": "1.1.7"
|
|
92
92
|
},
|
|
93
93
|
"peerDependencies": {
|
|
94
|
-
"@deepseek-ai/cordis": ">=4.0.1",
|
|
94
|
+
"@deepseek-ai/cordis": ">=4.0.1 || >=4.0.1-rc.1 <4.0.2-0 || >=4.0.5-alpha.1 <4.0.6-0 || >=4.0.6-alpha.1 <4.0.7-0 || >=4.2.0-alpha.1 <4.2.1-0",
|
|
95
95
|
"@deepseek-ai/dsh-client-locale": "^0.1.1-rc.2 || ^0.2.0-rc.1 || ^0.2.1-rc.2 || ^0.2.2-rc.1 || ^0.2.3-alpha.1",
|
|
96
96
|
"@deepseek-ai/dsh-settings": "^0.1.1-rc.2 || ^0.2.0-rc.1 || ^0.2.1-rc.2 || ^0.2.2-rc.1 || ^0.2.3-alpha.1",
|
|
97
97
|
"@deepseek-ai/dsh-tools": "^0.1.1-rc.2 || ^0.2.0-rc.1 || ^0.2.1-rc.2 || ^0.2.2-rc.1 || ^0.2.3-alpha.1",
|
|
98
|
-
"@deepseek-ai/schemastery": "
|
|
98
|
+
"@deepseek-ai/schemastery": ">=3.18.1 || >=3.18.1-rc.1 <3.18.2-0 || >=3.18.5-alpha.1 <3.18.6-0 || >=3.18.6-alpha.1 <3.18.7-0 || >=3.20.0-alpha.1 <3.20.1-0"
|
|
99
99
|
},
|
|
100
100
|
"dsh": {
|
|
101
101
|
"bundle": {
|
|
@@ -117,23 +117,22 @@
|
|
|
117
117
|
"yaml": "2.9.1"
|
|
118
118
|
},
|
|
119
119
|
"dshMobileReleaseNotes": {
|
|
120
|
-
"version": "0.5.
|
|
120
|
+
"version": "0.5.134",
|
|
121
121
|
"kinds": [
|
|
122
|
-
"fix"
|
|
123
|
-
"feature"
|
|
122
|
+
"fix"
|
|
124
123
|
],
|
|
125
124
|
"notes": {
|
|
126
|
-
"zh-Hans": "-
|
|
127
|
-
"zh-Hant": "-
|
|
128
|
-
"en": "-
|
|
129
|
-
"ja": "-
|
|
130
|
-
"ko": "-
|
|
131
|
-
"de": "-
|
|
132
|
-
"es": "-
|
|
133
|
-
"fr": "-
|
|
134
|
-
"pt": "-
|
|
135
|
-
"ru": "-
|
|
136
|
-
"tr": "-
|
|
125
|
+
"zh-Hans": "- 使用 DSH 预发布版时,插件安装和更新不再因依赖范围过窄而报冲突。",
|
|
126
|
+
"zh-Hant": "- 使用 DSH 預發布版時,外掛安裝與更新不再因相依範圍過窄而回報衝突。",
|
|
127
|
+
"en": "- Installing or updating the plugin on prerelease builds of DSH no longer fails on a dependency range conflict.",
|
|
128
|
+
"ja": "- DSH のプレリリース版でも、依存範囲が狭すぎることでプラグインのインストールや更新が失敗しなくなりました。",
|
|
129
|
+
"ko": "- DSH 사전 릴리스 버전에서 의존성 범위가 좁아 플러그인 설치·업데이트가 실패하던 문제를 해결했습니다.",
|
|
130
|
+
"de": "- Unter Vorabversionen von DSH lassen sich Installation und Update des Plugins nicht mehr durch einen zu engen Abhängigkeitsbereich blockieren.",
|
|
131
|
+
"es": "- En las versiones preliminares de DSH, instalar o actualizar el plugin ya no falla por un rango de dependencias demasiado estrecho.",
|
|
132
|
+
"fr": "- Sur les versions préliminaires de DSH, l'installation et la mise à jour du plugin ne sont plus bloquées par une plage de dépendances trop restrictive.",
|
|
133
|
+
"pt": "- Em versões de pré-lançamento do DSH, instalar ou atualizar o plugin não falha mais por um intervalo de dependências restrito demais.",
|
|
134
|
+
"ru": "- В предварительных сборках DSH установка и обновление плагина больше не завершаются ошибкой из-за слишком узкого диапазона зависимостей.",
|
|
135
|
+
"tr": "- DSH'nin yayın öncesi sürümlerinde, çok dar bir bağımlılık aralığı nedeniyle eklentinin kurulumu ve güncellenmesi artık başarısız olmuyor."
|
|
137
136
|
}
|
|
138
137
|
}
|
|
139
138
|
}
|