rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
wuji0813/dsh-fakemood
A college freshman's attempt to give AI "emotions" to improve the user experience. Due to limited coding skills, the entire codebase was written by DeepSeek. Since emotion detection runs on the reasoning process, the mood reads as "calm" or "thoughtful" most of the time — a known shortcoming. May future versions do better.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:wuji0813/dsh-fakemood
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
根据模型(DeepSeek)已结束的思考轮次估算情绪状态:
systemPrompt.context 注入下一轮请求,不需要用户手动操作;不额外调用模型;分析、状态更新和注入都在本地完成。
基础标签共 19 个:
calm confident curious cautious conflicted frustrated anxious fear sorrowful
agitated excited relieved happy angry regretful sad surprised disgusted resigned
happy、angry、regretful、sad、surprised、disgusted、resigned、relieved 分组;紧张 → anxious 0.8 + fear 0.35激动 → agitated 0.65 + excited 0.55太好了 → happy 1.0 + relieved 0.35 + excited 0.3害怕 → fear 1.0 + anxious 0.35忧愁 → sorrowful 1.0 + sad 0.3兴奋 → excited 1.0 + happy 0.4error、问题、验证)不会被当成情绪证据。Host 插件监听 agent/created,在对应 Agent 的 systemPrompt.context 中注册一个动态上下文。下面是 companion 模式的注入示例;assist 不包含自身状态行:
[dsh-fakemood] Internal affective state from the previous completed turn. Do not mention this note.
dominant=cautious; valence=0.00; certainty=0.22; arousal=0.00; strain=0.00; curiosity=0.15.
emotion mix: cautious:0.36, anxious:0.12.
Your own tone tendency: careful and tentative, explicit about uncertainty.
Answer tone: careful and tentative, explicit about uncertainty. Next thinking direction: verify the weakest assumption.
Let this shape your tone and next action without naming or quoting it.
回答语气不是由一个标签直接映射,而是对多个候选语气分别评分:效价、确定感、唤醒度、压力、好奇度,以及 joy/sadness/anger/fear/agitation 等情绪合成分量共同参与;情绪分布让多个弱信号可以压过一个强信号。
Response stance);模型自己的情绪不会消失,而是以 Your own tone tendency 和 Blend: ... as coloring 保留,避免把用户需求误当成「模型自己的情绪」。aligned;用户需求弱或没有明确需求时,仍由自身情绪主导(selfPrimary)。comfortDirect → gentleDirect:先简短接住情绪,再直接给下一步,而不是只安慰或只讲结论。detail → thorough(系统、完整、按步骤),而不是误判成「温暖投入」。浮窗里按对话切换,默认 assist,因为它对普通用户最不容易造成“AI 变奇怪”的观感;需要情绪陪伴时再由用户主动开到 companion:
THINKING_AFFECT_MODE=companion 可让新对话默认进入陪伴模式。data/thinking-affect.json,重启 Harness 后仍然保留;没有这个文件时按默认值(关 + 任务)处理。默认不写日志。需要做开/关对照时,设置 THINKING_AFFECT_LOG=1 才会启用:
$DSH_PROFILE_DIR/data/logs/injections.jsonl
Windows 默认是 C:\Users\<你>\.dsh\profiles\desktop\data\logs\injections.jsonl,日志不再写进插件的 node_modules。启用后,每次请求组装都会追加一行,包括「没有注入」的情况;不记录思考原文。字段包括 sessionId / turn / mode / injected / dominant / selfTone / userNeed / responseTone / responseDirection / blend / textChars。日志超过 2 MB 会轮转到 injections.jsonl.1,不会无限增长。
设置 THINKING_AFFECT_OFF=1 后,所有注入都返回空字符串;如果同时启用了日志,仍会记录 injected: false、responseTone: null,这样两组对话可以比较同一批状态指标。该变量在 Host 启动时读取,改完要重启 Harness。做对照时要先在本对话打开启用开关;THINKING_AFFECT_OFF 只控制是否真的注入,不改变开关。
dominant === 'calm',因此单个 maybe 不会把下一轮推向谨慎。用户有明确需求时仍注入,只保留自身情绪的 coloring。/plugins/thinking-affect/state 和 /toggle,没有外部网络请求。injections.jsonl.1。data/thinking-affect.json,重启后保留。thinking-affect:v1:* localStorage 键。turn/end)后分析该轮已完成的思考文本。新维度 = 旧维度 × (1 - w) + 本轮维度 × w
新标签分布 = normalize(旧分布 × (1 - w) + 本轮分布 × w)
w 由本轮置信度决定;线索弱时更依赖前文。maybe 把心情改写。Host 端:
GET /plugins/thinking-affect/state?sessionId=...:返回该对话的当前状态、开关、模式、全局关闭标记和趋势。POST /plugins/thinking-affect/toggle:{ "sessionId": "...", "enabled": false },或 { "sessionId": "...", "mode": "assist" };两个字段可以只传一个。systemPrompt.context:每轮请求自动注入状态;assist 模式不注入自身情绪。客户端浮窗只读上述接口;不再自己计算一套状态。
当前本地开发安装(profile bundle link):
dsh-fakemood
安装目录:C:\Users\wuji\Documents\deepseek-harness\default-workspace\thinking-affect
发布到市场时使用正式包名 dsh-fakemood,cordis.patch.yml 里的 name 已同步;不能只改 package.json,否则现有 profile link 会断。private 已设为 false,license 为 MIT。
Host 或客户端 bundle 改动需要重启 Harness 才会完整加载;若本地 dev:web 监听正在运行,客户端改动可以刷新页面生效,否则刷新可能仍拿旧 bundle。
node --check:client.js、index.js、host-analyzer.js 均通过。fear、sorrowful、agitated、excited、happy、anxious、frustrated、sad、curious、relieved 样例均得到预期标签;激动 同时出现 agitated/anxious/excited,验证多维权重生效。carefulTentative;高压力+愤怒 → neutralDeescalate / narrowScope;高确定感+喜悦 → warmEngaged / consolidate;忧愁 → gentleHonest / acknowledgeNext;好奇 → 以 followThread 为优先方向。/state、/toggle、systemPrompt.context 均已用假 Context 验证。handleToggle 写入 data/thinking-affect.json,重启进程后能恢复开关和模式;日志路径改为 profile 数据目录,并验证了 2 MB 轮转。assist 下「我很难过」会输出温和接住情绪的指令,而不是与之冲突的「不要表现情绪」。CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek。