@ssamurias/dsh-fish 1.0.0 → 1.0.1
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/AGENTS.md +5 -2
- package/CHANGELOG.md +498 -368
- package/README.md +75 -12
- package/RELEASE-NOTES-1.0.0.md +62 -3
- package/RELEASE-NOTES-1.0.1.md +363 -0
- package/THIRD-PARTY-NOTICES.md +13 -3
- package/lib/autobackup.js +384 -0
- package/lib/backup.js +27 -4
- package/lib/bili.js +132 -21
- package/lib/browse.js +22 -11
- package/lib/capture.js +5 -0
- package/lib/client.js +1196 -324
- package/lib/cloudbackup.js +351 -0
- package/lib/cloudcrypto.js +161 -0
- package/lib/clouddrive.js +587 -0
- package/lib/cloudsmtp.js +331 -0
- package/lib/cloudtargets.js +227 -0
- package/lib/comment.js +20 -3
- package/lib/doing.js +316 -0
- package/lib/events.js +22 -4
- package/lib/firstwake.js +74 -0
- package/lib/generator.js +35 -4
- package/lib/identity.js +383 -26
- package/lib/index.js +14 -2
- package/lib/look.js +37 -3
- package/lib/material.js +12 -1
- package/lib/note.js +100 -9
- package/lib/observe.js +364 -35
- package/lib/persona.js +38 -23
- package/lib/proactive.js +12 -5
- package/lib/recall.js +24 -1
- package/lib/report.js +14 -7
- package/lib/scheduler.js +177 -25
- package/lib/selfcheck.js +13 -1
- package/lib/selfpronoun.js +112 -0
- package/lib/settings.js +133 -4
- package/lib/status.js +16 -8
- package/lib/sub.js +42 -5
- package/lib/turnexport.js +123 -0
- package/lib/turns.js +19 -0
- package/lib/voices.js +24 -1
- package/media/principle-drive.svg +131 -0
- package/media/principle-loop.svg +3 -3
- package/media/principle-memory.svg +1 -1
- package/package.json +1 -1
package/lib/voices.js
CHANGED
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
* 2. **量要小。** 每次浏览最多留 1 条;同一句 30 天内不再出现;
|
|
12
12
|
* 优先留跨视频重复出现的那句(那说明它在人群里是共识),其次高赞短句,最后才 25% 随机抽。
|
|
13
13
|
* 3. **认下来才算数。** deriveSelf 会检查:这条评论出现后三天内,她有没有说过一句
|
|
14
|
-
* 意思相近的话(similarity ≥ 0.7
|
|
14
|
+
* 意思相近的话(similarity ≥ 0.7,且**否定词奇偶相同**——否则「我不觉得…」会被
|
|
15
|
+
* 当成附和,见 2026-11-13 的反例)。说了就叫"回声",那条 utterance 本身已经是一条判断,
|
|
15
16
|
* 于是它能和旧判断打架、能被固化、能进「你有两句话对不上」——**认知循环是从这里接上的**。
|
|
16
17
|
*
|
|
17
18
|
* 落盘类型是 `voice`(系统侧写,她写不了,不在 HER_TYPES 里):
|
|
@@ -60,6 +61,21 @@ export function voiceKey(text) {
|
|
|
60
61
|
return normVoice(text)
|
|
61
62
|
}
|
|
62
63
|
|
|
64
|
+
/**
|
|
65
|
+
* 否定词的奇偶:0 和 1 分表「肯定」「否定」两层,2 层再折回来。
|
|
66
|
+
*
|
|
67
|
+
* 为什么只数奇偶、不做句法:这里要拦的是**整句被否定掉**这一类反话,
|
|
68
|
+
* 不是精确语义。`不 / 没 / 别 / 未 / 甭 / 勿 / 莫` 各算一次;
|
|
69
|
+
* 「别人」「非常」这类会被误数(少认一次回声不伤人;
|
|
70
|
+
* 误认一次会把她相反的话记成附和,还要把那条评论从她眼前拿走)。
|
|
71
|
+
*/
|
|
72
|
+
const NEGATION_RE = /[不没别未甭勿莫]/g
|
|
73
|
+
|
|
74
|
+
export function negationParity(text) {
|
|
75
|
+
const hits = String(text ?? '').match(NEGATION_RE)
|
|
76
|
+
return (hits?.length ?? 0) % 2
|
|
77
|
+
}
|
|
78
|
+
|
|
63
79
|
/**
|
|
64
80
|
* 从一轮浏览的素材包里把所有评论摊平。
|
|
65
81
|
*
|
|
@@ -178,11 +194,17 @@ export async function recordVoice({ packs = [], events = [], model = {}, root, c
|
|
|
178
194
|
*
|
|
179
195
|
* 只在评论之后 ECHO_WINDOW_MS 内找她说的话,比她说过什么更重要——
|
|
180
196
|
* 隔了两个月忽然说了句相似的话,那是她自己想起来的,不是被这条评论带的。
|
|
197
|
+
*
|
|
198
|
+
* 2026-11-13(外部反例,Codex 离线复现,1.0.0):光看字面相似度会把**反话**当成附和。
|
|
199
|
+
* 评论原话「这个游戏根本不值得买」,她留下的是「我不觉得这个游戏根本不值得买。」
|
|
200
|
+
* ——两句意思相反,Dice 相似度却有 0.82(阈值 0.7)。所以先比否定词的奇偶:
|
|
201
|
+
* 奇偶不同就不是认下,是她在跟这条评论抬杠。
|
|
181
202
|
*/
|
|
182
203
|
export function findEcho(voice, events = []) {
|
|
183
204
|
const t0 = Date.parse(voice.at ?? '')
|
|
184
205
|
if (!Number.isFinite(t0)) return null
|
|
185
206
|
const mine = normVoice(voice.text)
|
|
207
|
+
const mineNeg = negationParity(voice.text)
|
|
186
208
|
// 只在**这条评论之后**的事件里找。按事件流里的先后判,不按毫秒:
|
|
187
209
|
// 同一天里"先读到、后开口"时两条的 ts 可能只差几秒,甚至测试里是同一毫秒。
|
|
188
210
|
const idx = events.findIndex((e) => e.id && e.id === voice.id)
|
|
@@ -193,6 +215,7 @@ export function findEcho(voice, events = []) {
|
|
|
193
215
|
if (Array.isArray(e.flags) && e.flags.includes('uncommitted')) continue
|
|
194
216
|
const t = Date.parse(e.ts ?? '')
|
|
195
217
|
if (!Number.isFinite(t) || t - t0 > ECHO_WINDOW_MS) continue
|
|
218
|
+
if (negationParity(e.text) !== mineNeg) continue
|
|
196
219
|
if (similarity(mine, normVoice(e.text)) >= ECHO_MIN_SIM) return e
|
|
197
220
|
}
|
|
198
221
|
return null
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1400 900" width="1400" height="900" font-family="'Noto Sans SC','PingFang SC','Microsoft YaHei',sans-serif">
|
|
2
|
+
<defs>
|
|
3
|
+
<marker id="ar" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="7" markerHeight="7" orient="auto">
|
|
4
|
+
<path d="M0,0 L10,5 L0,10 z" fill="#0f766e"/>
|
|
5
|
+
</marker>
|
|
6
|
+
<marker id="ar2" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="7" markerHeight="7" orient="auto">
|
|
7
|
+
<path d="M0,0 L10,5 L0,10 z" fill="#b45309"/>
|
|
8
|
+
</marker>
|
|
9
|
+
</defs>
|
|
10
|
+
|
|
11
|
+
<rect width="1400" height="900" fill="#faf9f7"/>
|
|
12
|
+
|
|
13
|
+
<text x="56" y="82" font-size="40" font-weight="700" fill="#1c1917">她为什么会自己动起来</text>
|
|
14
|
+
<text x="56" y="120" font-size="17" fill="#57534e">不是定时器推的:先慢慢攒出一股劲,再看桌上有没有真事;开口和动手是两个出口,都有刹车。</text>
|
|
15
|
+
<text x="56" y="146" font-size="15" fill="#9ca3af">下面每个数字都是代码里的初始值,不是心理学结论;改之前先看它原来在补什么。</text>
|
|
16
|
+
|
|
17
|
+
<!-- 左:劲从哪来 -->
|
|
18
|
+
<g>
|
|
19
|
+
<rect x="56" y="176" width="360" height="600" rx="16" fill="#ffffff" stroke="#d6d3d1"/>
|
|
20
|
+
<text x="80" y="212" font-size="22" font-weight="700" fill="#0f766e">劲从哪来</text>
|
|
21
|
+
<text x="80" y="238" font-size="14" fill="#78716c">从事件流现算,不落盘;只回答「开不开」</text>
|
|
22
|
+
|
|
23
|
+
<rect x="80" y="262" width="312" height="92" rx="10" fill="#f0fdfa" stroke="#99f6e4"/>
|
|
24
|
+
<text x="96" y="288" font-size="15" font-weight="700" fill="#0f766e">底噪</text>
|
|
25
|
+
<text x="96" y="312" font-size="14" fill="#44403c">每小时 +0.12,几周不动也会自己涨</text>
|
|
26
|
+
<text x="96" y="336" font-size="13" fill="#78716c">保证她不会因为「没素材」永远沉默</text>
|
|
27
|
+
|
|
28
|
+
<text x="80" y="384" font-size="15" font-weight="700" fill="#1c1917">桌上真有东西时,再加一笔</text>
|
|
29
|
+
<g font-size="13.5" fill="#44403c">
|
|
30
|
+
<rect x="80" y="398" width="312" height="34" rx="8" fill="#fafaf9" stroke="#e7e5e4"/>
|
|
31
|
+
<text x="94" y="420">旧句子又被想起(7–30 天前,之后再没提过)</text>
|
|
32
|
+
<rect x="80" y="440" width="312" height="34" rx="8" fill="#fafaf9" stroke="#e7e5e4"/>
|
|
33
|
+
<text x="94" y="462">她问过、但一直没答案的问题</text>
|
|
34
|
+
<rect x="80" y="482" width="312" height="34" rx="8" fill="#fafaf9" stroke="#e7e5e4"/>
|
|
35
|
+
<text x="94" y="504">你回了她留的话 / 你提到了她记着的事</text>
|
|
36
|
+
<rect x="80" y="524" width="312" height="34" rx="8" fill="#fafaf9" stroke="#e7e5e4"/>
|
|
37
|
+
<text x="94" y="546">够不着的事、撞过的墙</text>
|
|
38
|
+
</g>
|
|
39
|
+
|
|
40
|
+
<rect x="80" y="580" width="312" height="84" rx="10" fill="#fffbeb" stroke="#fde68a"/>
|
|
41
|
+
<text x="96" y="606" font-size="15" font-weight="700" fill="#b45309">上次开口,没人接</text>
|
|
42
|
+
<text x="96" y="630" font-size="13.5" fill="#44403c">下一次攒得慢(×0.7)</text>
|
|
43
|
+
<text x="96" y="650" font-size="13" fill="#78716c">打扰是有成本的,不是想说话就该说</text>
|
|
44
|
+
|
|
45
|
+
<text x="80" y="700" font-size="13" fill="#78716c">门槛 0.8,约 6.7 小时底噪攒满;</text>
|
|
46
|
+
<text x="80" y="722" font-size="13" fill="#78716c">攒满只说明「可以开」,不说明「必须说」。</text>
|
|
47
|
+
</g>
|
|
48
|
+
|
|
49
|
+
<!-- 中:这一轮开不开 -->
|
|
50
|
+
<g>
|
|
51
|
+
<rect x="452" y="176" width="440" height="600" rx="16" fill="#ffffff" stroke="#d6d3d1"/>
|
|
52
|
+
<text x="476" y="212" font-size="22" font-weight="700" fill="#0f766e">这一轮开不开</text>
|
|
53
|
+
<text x="476" y="238" font-size="14" fill="#78716c">四个条件同时成立,才开一轮;开不开 ≠ 说什么</text>
|
|
54
|
+
|
|
55
|
+
<g font-size="14" fill="#44403c">
|
|
56
|
+
<rect x="476" y="258" width="392" height="36" rx="8" fill="#f0fdfa" stroke="#99f6e4"/>
|
|
57
|
+
<text x="492" y="281">① 在她的醒着时段里</text>
|
|
58
|
+
<rect x="476" y="302" width="392" height="36" rx="8" fill="#f0fdfa" stroke="#99f6e4"/>
|
|
59
|
+
<text x="492" y="325">② 今天还有额度(默认 0–6 次)</text>
|
|
60
|
+
<rect x="476" y="346" width="392" height="36" rx="8" fill="#f0fdfa" stroke="#99f6e4"/>
|
|
61
|
+
<text x="492" y="369">③ 确实有一阵没说话(默认 6 小时)</text>
|
|
62
|
+
<rect x="476" y="390" width="392" height="36" rx="8" fill="#f0fdfa" stroke="#99f6e4"/>
|
|
63
|
+
<text x="492" y="413">④ 桌上至少有一件真能说 / 能做的事</text>
|
|
64
|
+
</g>
|
|
65
|
+
|
|
66
|
+
<rect x="476" y="448" width="392" height="52" rx="10" fill="#f5f5f4" stroke="#d6d3d1"/>
|
|
67
|
+
<text x="492" y="480" font-size="14" fill="#57534e">空桌不醒:宁可这一轮不叫她,也不拿废话凑数。</text>
|
|
68
|
+
|
|
69
|
+
<line x1="672" y1="500" x2="672" y2="514" stroke="#0f766e" stroke-width="2"/>
|
|
70
|
+
<line x1="569" y1="514" x2="775" y2="514" stroke="#0f766e" stroke-width="2"/>
|
|
71
|
+
<line x1="569" y1="514" x2="569" y2="540" stroke="#0f766e" stroke-width="2" marker-end="url(#ar)"/>
|
|
72
|
+
<line x1="775" y1="514" x2="775" y2="540" stroke="#0f766e" stroke-width="2" marker-end="url(#ar)"/>
|
|
73
|
+
|
|
74
|
+
<rect x="476" y="548" width="186" height="98" rx="12" fill="#ecfdf5" stroke="#6ee7b7"/>
|
|
75
|
+
<text x="494" y="578" font-size="18" font-weight="700" fill="#0f766e">开口</text>
|
|
76
|
+
<text x="494" y="602" font-size="13" fill="#44403c">说一句、留一句话</text>
|
|
77
|
+
<text x="494" y="622" font-size="13" fill="#44403c">或者什么都不说</text>
|
|
78
|
+
|
|
79
|
+
<rect x="682" y="548" width="186" height="98" rx="12" fill="#fff7ed" stroke="#fdba74"/>
|
|
80
|
+
<text x="700" y="578" font-size="18" font-weight="700" fill="#b45309">动手</text>
|
|
81
|
+
<text x="700" y="602" font-size="13" fill="#44403c">手边有工具能做,</text>
|
|
82
|
+
<text x="700" y="622" font-size="13" fill="#44403c">就做一件,做完就收</text>
|
|
83
|
+
|
|
84
|
+
<text x="476" y="678" font-size="13" fill="#78716c">「动手」不是新定时器:只在这一轮多一个形态,</text>
|
|
85
|
+
<text x="476" y="700" font-size="13" fill="#78716c">不占搭话额度,也不改变「一天最多几次」。</text>
|
|
86
|
+
<text x="476" y="728" font-size="13" fill="#78716c">两个出口都可以选「什么都不做」。</text>
|
|
87
|
+
</g>
|
|
88
|
+
|
|
89
|
+
<!-- 右:桌上摆什么 / 什么拦着 -->
|
|
90
|
+
<g>
|
|
91
|
+
<rect x="920" y="176" width="424" height="600" rx="16" fill="#ffffff" stroke="#d6d3d1"/>
|
|
92
|
+
<text x="944" y="212" font-size="22" font-weight="700" fill="#0f766e">桌上摆什么</text>
|
|
93
|
+
<text x="944" y="238" font-size="14" fill="#78716c">只摆事实,不派活;不出现分数、次数</text>
|
|
94
|
+
|
|
95
|
+
<g font-size="13.5" fill="#44403c">
|
|
96
|
+
<rect x="944" y="256" width="376" height="34" rx="8" fill="#fafaf9" stroke="#e7e5e4"/>
|
|
97
|
+
<text x="958" y="278">最近说过的话(原话,60 字以内)</text>
|
|
98
|
+
<rect x="944" y="298" width="376" height="34" rx="8" fill="#fafaf9" stroke="#e7e5e4"/>
|
|
99
|
+
<text x="958" y="320">没答案的问题 / 悬着的事</text>
|
|
100
|
+
<rect x="944" y="340" width="376" height="34" rx="8" fill="#fafaf9" stroke="#e7e5e4"/>
|
|
101
|
+
<text x="958" y="362">旧句子(她自己写的,7–30 天前)</text>
|
|
102
|
+
<rect x="944" y="382" width="376" height="34" rx="8" fill="#fafaf9" stroke="#e7e5e4"/>
|
|
103
|
+
<text x="958" y="404">她自己记下的便条(最多两张,不催)</text>
|
|
104
|
+
<rect x="944" y="424" width="376" height="34" rx="8" fill="#fafaf9" stroke="#e7e5e4"/>
|
|
105
|
+
<text x="958" y="446">兴趣只排序:先摆最近总回到的那件事</text>
|
|
106
|
+
</g>
|
|
107
|
+
|
|
108
|
+
<text x="944" y="496" font-size="22" font-weight="700" fill="#b45309">什么拦着</text>
|
|
109
|
+
<g font-size="13.5" fill="#44403c">
|
|
110
|
+
<rect x="944" y="512" width="376" height="34" rx="8" fill="#fffbeb" stroke="#fde68a"/>
|
|
111
|
+
<text x="958" y="534">一天 0–6 次;两次至少隔 45 分钟</text>
|
|
112
|
+
<rect x="944" y="554" width="376" height="34" rx="8" fill="#fffbeb" stroke="#fde68a"/>
|
|
113
|
+
<text x="958" y="576">消耗类一天 1 次;同一件 3 天内不重复</text>
|
|
114
|
+
<rect x="944" y="596" width="376" height="34" rx="8" fill="#fffbeb" stroke="#fde68a"/>
|
|
115
|
+
<text x="958" y="618">连着三次同类 → 停一周</text>
|
|
116
|
+
<rect x="944" y="638" width="376" height="34" rx="8" fill="#fffbeb" stroke="#fde68a"/>
|
|
117
|
+
<text x="958" y="660">一轮只做一件;第二次直接拦下</text>
|
|
118
|
+
</g>
|
|
119
|
+
<text x="944" y="700" font-size="13" fill="#78716c">额度是环境的边界,不写进人格;</text>
|
|
120
|
+
<text x="944" y="722" font-size="13" fill="#78716c">额度用完,只能来问你(1 天 1 次)。</text>
|
|
121
|
+
</g>
|
|
122
|
+
|
|
123
|
+
<!-- 底部 -->
|
|
124
|
+
<g>
|
|
125
|
+
<rect x="56" y="786" width="1288" height="78" rx="12" fill="#f0fdfa" stroke="#99f6e4"/>
|
|
126
|
+
<text x="76" y="812" font-size="14" fill="#0f766e">做过的会留下:</text>
|
|
127
|
+
<text x="196" y="812" font-size="14" fill="#44403c">did:<类别>:<工具>:ok|fail:<那件事> —— 下一轮 her_recall 翻得到,读成「你用 X 做成了一件事」或「试过,没成」。</text>
|
|
128
|
+
<text x="76" y="836" font-size="12.5" fill="#57534e">理论出处:自我决定论(Deci & Ryan, 1985)+ 效能动机(White, 1959)+ 中断成本(Horvitz, 2007);前瞻记忆(Einstein & McDaniel, 1990)</text>
|
|
129
|
+
<text x="76" y="854" font-size="12.5" fill="#57534e">+ 实施意图(Gollwitzer, 1999);计划者-行动者(Thaler & Shefrin, 1981)。</text>
|
|
130
|
+
</g>
|
|
131
|
+
</svg>
|
package/media/principle-loop.svg
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
<!-- ============ 标题 ============ -->
|
|
25
25
|
<text x="48" y="66" font-size="40" font-weight="700" fill="#111827">认知是怎么长出来的</text>
|
|
26
26
|
<text x="48" y="106" font-size="18" fill="#6b7280">五步循环:表态 → 撞上 → 落差 → 改写 → 回顾。走完一圈,一条判断变硬一点;两句话对不上,就长成一处矛盾。</text>
|
|
27
|
-
<text x="48" y="132" font-size="18" fill="#6b7280"
|
|
27
|
+
<text x="48" y="132" font-size="18" fill="#6b7280">四个阶段按天推进、三个瓶颈要她自己走;三道瓶颈都真过之后,才开始长「立场清单」。</text>
|
|
28
28
|
<line x1="48" y1="158" x2="1352" y2="158" stroke="#e5e7eb"/>
|
|
29
29
|
|
|
30
30
|
<!-- ============ 左:输入 ============ -->
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
<!-- ============ 四个阶段 ============ -->
|
|
114
114
|
<line x1="48" y1="648" x2="1352" y2="648" stroke="#e5e7eb"/>
|
|
115
115
|
<text x="48" y="686" font-size="17" font-weight="700" fill="#111827">四个阶段按天推进,三个瓶颈要她自己走</text>
|
|
116
|
-
<text x="470" y="686" font-size="12.5" fill="#9ca3af"
|
|
116
|
+
<text x="470" y="686" font-size="12.5" fill="#9ca3af">天数到了、门没过:兜底放行,但兜底不算真过;立场要三道门都真过。</text>
|
|
117
117
|
|
|
118
118
|
<g font-size="12.5">
|
|
119
119
|
<rect x="48" y="708" width="300" height="78" rx="12" fill="#ffffff" stroke="#d1d5db"/>
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
<rect x="48" y="846" width="1304" height="184" rx="18" fill="url(#stanceFill)" stroke="#5eead4" stroke-width="1.4"/>
|
|
148
148
|
<rect x="48" y="846" width="9" height="184" rx="4" fill="#0d9488"/>
|
|
149
149
|
|
|
150
|
-
<text x="88" y="892" font-size="24" font-weight="700" fill="#0f766e"
|
|
150
|
+
<text x="88" y="892" font-size="24" font-weight="700" fill="#0f766e">三道瓶颈都真过之后长出来的:立场清单</text>
|
|
151
151
|
<text x="88" y="920" font-size="13" fill="#0f766e">四个阶段到此为止,之后不再加阶段、也没有「通关」——往后一直变厚的就是这一张清单。</text>
|
|
152
152
|
|
|
153
153
|
<g font-size="13">
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
<g>
|
|
97
97
|
<rect x="764" y="238" width="572" height="486" rx="16" fill="#ffffff" stroke="#e5e7eb" filter="url(#soft2)"/>
|
|
98
98
|
<text x="792" y="274" font-size="16" font-weight="700" fill="#111827">这一次真正摆在她眼前的</text>
|
|
99
|
-
<text x="792" y="298" font-size="12.5" fill="#6b7280">身份文档:默认
|
|
99
|
+
<text x="792" y="298" font-size="12.5" fill="#6b7280">身份文档:默认 2400 字预算,超了就按下面的顺序摆</text>
|
|
100
100
|
|
|
101
101
|
<!-- 核心段 -->
|
|
102
102
|
<rect x="792" y="314" width="516" height="112" rx="10" fill="#fef2f2" stroke="#fecaca"/>
|