dsh-chat-comprehension 0.3.0 → 0.3.2
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/README.md +19 -1
- package/client.js +11 -0
- package/lib/index.js +33 -0
- package/package.json +1 -1
- package/vendor/dsh-bili-scroll/index.js +15 -0
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
给 DeepSeek Harness 一个「一个入口」的陪伴层:**局部人格 + QQ 联动 + 专属记忆 + B站 值班**。
|
|
5
5
|
左侧栏只有一个图标「陪伴」;设置弹层里不再出现三个插件各自那一页。
|
|
6
6
|
|
|
7
|
-
> 当前是 **0.3.
|
|
7
|
+
> 当前是 **0.3.2**(待验收):五个引擎的宿主核心全部内置在本包 `vendor/`;**只装这一个包**就有效果,不会再装/依赖别的引擎插件。B站 venv 会在挂载后自动配置。读图直接用主模型的 `read_image`,不再内置 describe_image。QQ 网关仍单独安装(本包只自动打 companion 补丁)。
|
|
8
8
|
> 发布到 npm 后,安装只需要一条:`dsh plugin --profile web add dsh-chat-comprehension`。
|
|
9
9
|
|
|
10
10
|
## 页面里有什么
|
|
@@ -76,6 +76,24 @@ dsh plugin --profile web add dsh-chat-comprehension
|
|
|
76
76
|
- 浏览器半:`client.js`(主侧栏图标 + 页面;不依赖构建工具)。
|
|
77
77
|
- 三个引擎的设置页已从各自 client 里摘掉;功能都在这里。
|
|
78
78
|
|
|
79
|
+
## 微信 / QQ 里直接发的表情包为什么看不到
|
|
80
|
+
|
|
81
|
+
**看不到,这是平台格式限制,不是插件缺工具,也不是主模型不支持图片。**
|
|
82
|
+
|
|
83
|
+
- 微信、QQ 聊天里的“表情包/贴纸”是各自**专有的表情格式**(不是标准 PNG / JPEG / GIF / WebP 文件)。
|
|
84
|
+
客户端发出去的是一个专有编码 / 资源 ID,服务端不会把原始图片字节交给机器人;
|
|
85
|
+
DSH 的 `read_image` 拿不到可解码的图片,主模型自然也无图可看。
|
|
86
|
+
- 没有任何本地/插件方法能从这种专有格式里“还原”出图片字节;也没有办法让模型直接读它。
|
|
87
|
+
|
|
88
|
+
**能看的**:
|
|
89
|
+
|
|
90
|
+
- 普通图片、截图、照片(标准 PNG / JPEG / GIF / WebP)→ 直接 `read_image` 让主模型看。
|
|
91
|
+
- B站 / QQ 的 **dsh-meme 表情包库**(标准图片格式)→ `send_meme` / 表情包页可以发、可以看。
|
|
92
|
+
- 想让主模型“看见”微信/QQ 表情包里的内容 → 只能让发送方改发**标准图片**(截图、另存为 PNG),
|
|
93
|
+
或把表情包先保存成本地标准图片文件再发。
|
|
94
|
+
|
|
95
|
+
**换句话说**:不是“读图能力”不够,是那张图根本没有以图片的形式到达 DSH。
|
|
96
|
+
|
|
79
97
|
## 许可
|
|
80
98
|
|
|
81
99
|
`dsh-chat-comprehension` 以 **MIT** 发布;上游项目的版权与许可见 [NOTICE.md](./NOTICE.md)。
|
package/client.js
CHANGED
|
@@ -688,6 +688,16 @@ window.__ModuleLoader__.load({
|
|
|
688
688
|
await checkDoctor()
|
|
689
689
|
}), [runBusy, checkDoctor, say])
|
|
690
690
|
|
|
691
|
+
const setupBili = useCallback(() => runBusy('bili-setup', async () => {
|
|
692
|
+
try {
|
|
693
|
+
const r = await post(CC + '/bili/setup', {})
|
|
694
|
+
if (r && r.ok) say(r.busy ? 'B站 环境正在装(后台),看 B站 页日志' : 'B站 环境开始配置(后台)', 'ok')
|
|
695
|
+
else say('配置失败:' + String((r && (r.error || r.hint)) || '看 B站 日志').slice(-400), 'err')
|
|
696
|
+
} catch (error) { say('配置失败:' + errText(error), 'err') }
|
|
697
|
+
await checkDoctor()
|
|
698
|
+
await load()
|
|
699
|
+
}), [runBusy, checkDoctor, load, say])
|
|
700
|
+
|
|
691
701
|
const repairEngines = useCallback(() => runBusy('engines-repair', async () => {
|
|
692
702
|
try {
|
|
693
703
|
const r = await post(CC + '/engines/repair', {})
|
|
@@ -1666,6 +1676,7 @@ window.__ModuleLoader__.load({
|
|
|
1666
1676
|
(doctor.checks || []).some((c) => c.id === 'yt-dlp' && !c.ok) ? h(Btn, { icon: 'save', disabled: busy.ytdlp, onClick: installYtdlp }, busy.ytdlp ? '安装 yt-dlp 中…' : '安装 yt-dlp') : null,
|
|
1667
1677
|
h(Btn, { icon: 'link', disabled: busy['doctor-patch'] || busy['doctor-check'], onClick: patchQqbot }, busy['doctor-patch'] ? '打补丁中…' : '打 QQ 网关补丁'),
|
|
1668
1678
|
h(Btn, { icon: 'refresh', disabled: busy['engines-repair'] || busy['doctor-check'], onClick: repairEngines }, busy['engines-repair'] ? '重新挂载中…' : '一键修复内置引擎'),
|
|
1679
|
+
h(Btn, { icon: 'save', disabled: busy['bili-setup'] || busy['doctor-check'], onClick: setupBili }, busy['bili-setup'] ? '配置 B站 环境中…' : '配置 B站 环境'),
|
|
1669
1680
|
h('span', { className: 'dc-note' }, '装进上面那个 Python;打补丁只改 QQ 网关,重启后生效。'))),
|
|
1670
1681
|
h(Card, { title: '引擎 / 插件', sub: '引擎已内置;QQ 网关单独装;原生依赖看「环境」' },
|
|
1671
1682
|
h('div', { className: 'dc-list' },
|
package/lib/index.js
CHANGED
|
@@ -991,6 +991,12 @@ export async function apply(ctx) {
|
|
|
991
991
|
engineMounts = await repairVendoredEngines(ctx)
|
|
992
992
|
return sendJson(res, 200, { ok: engineMounts.every((e) => e.installed || e.mounted), engines: engineMounts })
|
|
993
993
|
}
|
|
994
|
+
if (req.method === 'POST' && path === '/bili/setup') {
|
|
995
|
+
const biliSetup = ctx.get('biliVenvSetup')
|
|
996
|
+
if (!biliSetup || typeof biliSetup.runInstall !== 'function') throw badRequest('B站 内置引擎没有提供安装入口(可能用的是外部已装版本)')
|
|
997
|
+
const r = biliSetup.runInstall()
|
|
998
|
+
return sendJson(res, 200, { ok: true, ready: typeof biliSetup.venvReady === 'function' ? biliSetup.venvReady() : false, ...r })
|
|
999
|
+
}
|
|
994
1000
|
if (req.method === 'POST' && path === '/doctor/install') {
|
|
995
1001
|
const body = await readBody(req)
|
|
996
1002
|
const what = String(body.what || '')
|
|
@@ -1189,6 +1195,17 @@ export async function apply(ctx) {
|
|
|
1189
1195
|
ctx.logger?.warn?.('内置引擎挂载失败:' + String((error && error.message) || error))
|
|
1190
1196
|
}
|
|
1191
1197
|
|
|
1198
|
+
// 新电脑上 B站 venv 不会自己出现:挂载后自动检测一次,缺就后台开始配(uv 建 venv + 装依赖)。
|
|
1199
|
+
try {
|
|
1200
|
+
const biliSetup = ctx.get('biliVenvSetup')
|
|
1201
|
+
if (biliSetup && typeof biliSetup.venvReady === 'function' && !biliSetup.venvReady()) {
|
|
1202
|
+
const r = typeof biliSetup.runInstall === 'function' ? biliSetup.runInstall() : null
|
|
1203
|
+
console.log('[companion] B站 venv 未就绪,已自动开始配置:' + String((r && r.hint) || '后台安装中'))
|
|
1204
|
+
}
|
|
1205
|
+
} catch (error) {
|
|
1206
|
+
ctx.logger?.warn?.('B站 venv 自动配置失败:' + String((error && error.message) || error))
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1192
1209
|
ctx.logger?.info?.('dsh-chat-comprehension:聚合入口已挂载(含 TTS / 斗图通道状态 / 内置引擎)')
|
|
1193
1210
|
}
|
|
1194
1211
|
|
|
@@ -1215,3 +1232,19 @@ export async function apply(ctx) {
|
|
|
1215
1232
|
// actual loaded detection 1793412798
|
|
1216
1233
|
|
|
1217
1234
|
// meme status fix 1793414547
|
|
1235
|
+
|
|
1236
|
+
// vision reload 1793465019
|
|
1237
|
+
|
|
1238
|
+
// vision settings fix 1793465045
|
|
1239
|
+
|
|
1240
|
+
// vision export fix 1793465063
|
|
1241
|
+
|
|
1242
|
+
// main model vision 1793465688
|
|
1243
|
+
|
|
1244
|
+
// vision params fix 1793465711
|
|
1245
|
+
|
|
1246
|
+
// vision required fix 1793465738
|
|
1247
|
+
|
|
1248
|
+
// vision output schema 1793465763
|
|
1249
|
+
|
|
1250
|
+
// remove describe_image 1793466188
|
package/package.json
CHANGED
|
@@ -2677,6 +2677,21 @@ function reportMeta() {
|
|
|
2677
2677
|
return { ok: true, started: true, log: installLogFile, hint: '正在后台装依赖 —— 进度就显示在下面(走国内镜像,通常几十秒到一两分钟)' }
|
|
2678
2678
|
}
|
|
2679
2679
|
|
|
2680
|
+
// ── 给聚合层(dsh-chat-comprehension)用的 venv 安装入口 ──
|
|
2681
|
+
// 新电脑上 B站 venv 不会自己出现;聚合层挂载本引擎后会调用这里自动建。
|
|
2682
|
+
if (typeof ctx.provide === 'function') {
|
|
2683
|
+
try {
|
|
2684
|
+
ctx.provide('biliVenvSetup', {
|
|
2685
|
+
venvReady: () => venvReadyNow(),
|
|
2686
|
+
installing: () => installing,
|
|
2687
|
+
log: installLogFile,
|
|
2688
|
+
runInstall,
|
|
2689
|
+
})
|
|
2690
|
+
} catch (e) {
|
|
2691
|
+
log('biliVenvSetup 服务注册失败:' + String((e && e.message) || e))
|
|
2692
|
+
}
|
|
2693
|
+
}
|
|
2694
|
+
|
|
2680
2695
|
/** 「测一下」:真跑一次查询再下结论(判据落在载荷上,不看自报) */
|
|
2681
2696
|
const checkUp = async () => {
|
|
2682
2697
|
const out = { ok: false, steps: [] }
|