dsh-fish-buddy 0.8.2 → 0.8.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/lib/host.js +22 -2
- package/package.json +48 -48
package/lib/host.js
CHANGED
|
@@ -679,8 +679,10 @@ export function apply(ctx, inlineConfig) {
|
|
|
679
679
|
// ⚠ 0.3.4:这张图要是已经直接发过去(或已经贴过),就别再出现第二次
|
|
680
680
|
if (已发帧.has(String(x.帧.文件 || ''))) return null
|
|
681
681
|
const 大小 = x.帧.大小 >= 1024 ? Math.round(x.帧.大小 / 1024) + 'KB' : (x.帧.大小 || 0) + 'B'
|
|
682
|
+
// ⭐ 0.8.4:光给路径它不会自己去看 —— 实测「只说路径」时模型一路没打开过那张图,
|
|
683
|
+
// 等于白截。所以这里明说一句「用 read_image 看一眼」。
|
|
682
684
|
return '· ' + 多久前(x.时) + '|〔这一句是画面〕截了一张图(' + (x.帧.尺寸 || '?')
|
|
683
|
-
+ ',' + 大小 + ')——
|
|
685
|
+
+ ',' + 大小 + ')—— 想看到这张画面,用 read_image 打开看一眼:' + x.帧.文件
|
|
684
686
|
}
|
|
685
687
|
return '· ' + 多久前(x.时) + '|' + x.文
|
|
686
688
|
}).filter(Boolean)
|
|
@@ -831,11 +833,17 @@ export function apply(ctx, inlineConfig) {
|
|
|
831
833
|
* ⚠ 只在 **截图送法 = 攒着** 时生效:每张都说那一档,截图本来就会叫醒她,
|
|
832
834
|
* 再叠加搭话等于一轮变两轮、白花钱。
|
|
833
835
|
*/
|
|
836
|
+
// ⭐ 2026-11-04:最近一次往会话里塞图的时间 —— 给「游戏里自己搭话」让路(声明放前面,免得 TDZ)
|
|
837
|
+
let 上次塞图 = 0
|
|
834
838
|
const 游戏搭话 = () => {
|
|
835
839
|
try {
|
|
836
840
|
if (!游戏模式.开) return false
|
|
837
841
|
const 配置 = 读配置()
|
|
838
|
-
|
|
842
|
+
// ⚠⚠ 2026-11-04 修:这里原来判的是 配置.截图送法 —— 可全项目根本没有这个字段
|
|
843
|
+
// (「每张 / 攒着」是**挂件的设置**,插件这边只有每帧带的 存档/立即 标志)。
|
|
844
|
+
// 于是这一行永远为真 → 游戏搭话 永远 return false,攒着的图只能等她先开口。
|
|
845
|
+
// 现在改成「最近刚塞过图就让路」:每张都说那一档每隔几十秒就有图出去,
|
|
846
|
+
// 自然被挡掉;攒着那一档不塞图,所以能正常搭话。
|
|
839
847
|
// ⭐ 1.7.1:优先用**挂件报上来的**那个数,拿不到才用自己配置里的默认值
|
|
840
848
|
const 间隔 = 节奏('游戏搭话秒', Math.max(0, Number(配置.游戏搭话秒) || 0))
|
|
841
849
|
if (间隔 <= 0) return false
|
|
@@ -843,6 +851,8 @@ export function apply(ctx, inlineConfig) {
|
|
|
843
851
|
if (!键) return false
|
|
844
852
|
// 刚进游戏模式先安静一会儿,别一进去就开口
|
|
845
853
|
if (现在() - (游戏模式.时 || 0) < Math.min(间隔, 60) * 1000) return false
|
|
854
|
+
// 「每张都说」那档每隔几十秒刚发过图 → 让路,别一轮变两轮
|
|
855
|
+
if (上次塞图 && 现在() - 上次塞图 < 90000) return false
|
|
846
856
|
if (!要搭话({
|
|
847
857
|
间隔秒: 间隔,
|
|
848
858
|
最多秒: 0,
|
|
@@ -920,7 +930,13 @@ export function apply(ctx, inlineConfig) {
|
|
|
920
930
|
const 可能搭话 = () => {
|
|
921
931
|
try {
|
|
922
932
|
// ⭐ 0.7.7:在打游戏就别走「一起看片子」那条搭话 —— 两套提示词会打架
|
|
933
|
+
// ⚠⚠ 2026-11-04 修(用户反馈:游戏模式「攒着」永远不主动搭话):
|
|
934
|
+
// 这里以前是 **直接 return**,可游戏模式的主动搭话(游戏搭话)只有离看那条路
|
|
935
|
+
// 才会调 —— 于是「在打游戏」一旦命中,游戏搭话() 就永远走不到,
|
|
936
|
+
// 攒着的截图只能等她先开口才被带过去,跟"主动搭话"根本不是一回事。
|
|
937
|
+
// 现在改成:在打游戏 → 走游戏搭话;不在打游戏也没陪看 → 还是走游戏搭话(它自己会判条件)。
|
|
923
938
|
if (游戏模式.开 && 现在() - (游戏模式.时 || 0) < 6 * 3600 * 1000) {
|
|
939
|
+
try { 游戏搭话() } catch (error) {}
|
|
924
940
|
return
|
|
925
941
|
}
|
|
926
942
|
if (!陪看开着) {
|
|
@@ -1036,6 +1052,7 @@ export function apply(ctx, inlineConfig) {
|
|
|
1036
1052
|
// ⭐ 0.6.1:挂件会告诉我们「现在在不在游戏模式」—— 游戏模式也要能主动搭话
|
|
1037
1053
|
const 游戏模式 = { 开: false, 时: 0 }
|
|
1038
1054
|
const 攒图 = new Map()
|
|
1055
|
+
// ⭐ 2026-11-04:最近一次往会话里塞图的时间 —— 用来给「游戏里自己搭话」让路
|
|
1039
1056
|
// ⭐ 0.7.2:**不限制张数**(以前的「最多 3 张、新的挤掉最旧的」是错的 ——
|
|
1040
1057
|
// 挤掉的图等于白截了)。攒着就一直留着,等她说话 / 她自己看一眼时**全部**带过去。
|
|
1041
1058
|
// ⚠ 只有个上限 60 张防跑飞(一小时 30 秒一张也就 120 张,实际轮不到)。
|
|
@@ -1614,6 +1631,7 @@ export function apply(ctx, inlineConfig) {
|
|
|
1614
1631
|
source: { kind: 源 === '热键' ? 'user' : 'fishbuddy' },
|
|
1615
1632
|
})
|
|
1616
1633
|
状态.送出条数 += 1
|
|
1634
|
+
上次塞图 = 现在() // ⭐ 2026-11-04:给「游戏里自己搭话」让路用
|
|
1617
1635
|
return '发过去了'
|
|
1618
1636
|
} catch (error) {
|
|
1619
1637
|
return '发失败了:' + 说(error)
|
|
@@ -1679,6 +1697,8 @@ export function apply(ctx, inlineConfig) {
|
|
|
1679
1697
|
source: { kind: 来源类别 },
|
|
1680
1698
|
})
|
|
1681
1699
|
状态.送出条数 += 1
|
|
1700
|
+
上次塞图 = 现在() // 带图说话也算刚塞过
|
|
1701
|
+
|
|
1682
1702
|
return '发过去了'
|
|
1683
1703
|
} catch (error) {
|
|
1684
1704
|
return '发失败了:' + 说(error)
|
package/package.json
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "dsh-fish-buddy",
|
|
3
|
-
"version": "0.8.
|
|
4
|
-
"description": "鱼搭子 · DSH 这半边:桌面小挂件说的话送进你绑定的会话,她的回话再递回挂件。挂件是独立程序,这里只负责接线。",
|
|
5
|
-
"license": "SEE LICENSE IN LICENSE",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"keywords": [
|
|
8
|
-
"deepseek-harness",
|
|
9
|
-
"dsh-plugin",
|
|
10
|
-
"companion",
|
|
11
|
-
"voice",
|
|
12
|
-
"call"
|
|
13
|
-
],
|
|
14
|
-
"main": "lib/host.js",
|
|
15
|
-
"exports": {
|
|
16
|
-
".": "./lib/host.js",
|
|
17
|
-
"./client": "./lib/client.js",
|
|
18
|
-
"./package.json": "./package.json",
|
|
19
|
-
"./locale/*.json": "./locale/*.json",
|
|
20
|
-
"./icon": "./icon.png"
|
|
21
|
-
},
|
|
22
|
-
"icon": "./icon.png",
|
|
23
|
-
"files": [
|
|
24
|
-
"lib",
|
|
25
|
-
"locale",
|
|
26
|
-
"icon.png",
|
|
27
|
-
"cordis.patch.yml",
|
|
28
|
-
"README.md"
|
|
29
|
-
],
|
|
30
|
-
"dsh": {
|
|
31
|
-
"bundle": {
|
|
32
|
-
"patch": "./cordis.patch.yml"
|
|
33
|
-
},
|
|
34
|
-
"client": {
|
|
35
|
-
"platform": "web",
|
|
36
|
-
"inject": [
|
|
37
|
-
"slots"
|
|
38
|
-
],
|
|
39
|
-
"external": [
|
|
40
|
-
"react"
|
|
41
|
-
]
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
"engines": {
|
|
45
|
-
"node": ">=22",
|
|
46
|
-
"dsh": ">=0.2.1-rc.2"
|
|
47
|
-
}
|
|
48
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-fish-buddy",
|
|
3
|
+
"version": "0.8.4",
|
|
4
|
+
"description": "鱼搭子 · DSH 这半边:桌面小挂件说的话送进你绑定的会话,她的回话再递回挂件。挂件是独立程序,这里只负责接线。",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"deepseek-harness",
|
|
9
|
+
"dsh-plugin",
|
|
10
|
+
"companion",
|
|
11
|
+
"voice",
|
|
12
|
+
"call"
|
|
13
|
+
],
|
|
14
|
+
"main": "lib/host.js",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": "./lib/host.js",
|
|
17
|
+
"./client": "./lib/client.js",
|
|
18
|
+
"./package.json": "./package.json",
|
|
19
|
+
"./locale/*.json": "./locale/*.json",
|
|
20
|
+
"./icon": "./icon.png"
|
|
21
|
+
},
|
|
22
|
+
"icon": "./icon.png",
|
|
23
|
+
"files": [
|
|
24
|
+
"lib",
|
|
25
|
+
"locale",
|
|
26
|
+
"icon.png",
|
|
27
|
+
"cordis.patch.yml",
|
|
28
|
+
"README.md"
|
|
29
|
+
],
|
|
30
|
+
"dsh": {
|
|
31
|
+
"bundle": {
|
|
32
|
+
"patch": "./cordis.patch.yml"
|
|
33
|
+
},
|
|
34
|
+
"client": {
|
|
35
|
+
"platform": "web",
|
|
36
|
+
"inject": [
|
|
37
|
+
"slots"
|
|
38
|
+
],
|
|
39
|
+
"external": [
|
|
40
|
+
"react"
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=22",
|
|
46
|
+
"dsh": ">=0.2.1-rc.2"
|
|
47
|
+
}
|
|
48
|
+
}
|