dsh-cc-haha-dream
Manifest validBackground memory consolidation (auto dream) for DeepSeek Harness: periodically reviews recent sessions and existing memories to dedupe, refresh stale entries, remove contradictions and rebuild the ME
dsh-dream
DSH 自动做梦插件:后台定期回顾近期会话与已有记忆,整合去重、更新过时、删除矛盾、修剪重建索引。
复刻 CC-HAHA 的 autoDream(后台记忆整合)行为,
与已安装的 dsh-memory 并存——dsh-memory 负责"随手记"(extractMemories),dsh-dream 负责"睡前整理"。
[!IMPORTANT] 本项目不是 CC-HAHA 官方组件,也不隶属于 CC-HAHA 或 DeepSeek。自动做梦的 门控链与整合流程参考 CC-HAHA(见 THIRD_PARTY_NOTICES.md), 插件代码使用 DSH 原生能力(会话查询、子代理、命令、工具、设置)独立实现。
[!IMPORTANT] 独立插件,不修改 dsh-memory;与它共享同一个
~/.dsh/memory/目录,文件格式与MEMORY.md索引完全兼容。
功能
- 自动定时:默认 24 小时 + 积累 5 个会话后,后台静默执行一次记忆整合(五重门控,不阻塞对话)。
从未做过梦(没有
.dream-lock)时不会冷启动即触发:启动后的首次检查只把锁盖成"当前时刻", 从此刻开始计minHours,之后的判断仍走原有门控。 - 手动触发:
/dream命令,或 agent 调用memory_dream工具,立即整合一次(任何时候都可手动触发,不受上面的冷启动守卫影响)。 - 整合内容(对齐 CC-HAHA autoDream 4 阶段,执行用 fork 子代理):
- 插件 fork 一个子代理(模型路由见下;可用
provider/model/maxTokens覆盖) - 子代理按 4 阶段提示词(定向 → 收集近期信号 → 整合 → 修剪索引)输出动作 JSON
- 插件在 host 侧安全落盘:合并重复(
merge/update)、修正过时/删除矛盾(delete)、 从近期会话提炼新记忆(create)、重建MEMORY.md索引(按## <项目>→### <类型>分节, 与 dsh-memory 的输出逐字节一致)
- 插件 fork 一个子代理(模型路由见下;可用
- 安全:所有写操作限制在记忆目录内;动作整批预检通过后才开始写入;删除/覆盖前自动存
.history/历史版本, 索引在原子覆盖前也会快照到.history/_index/(保留最近 20 份);LLM 输出严格 JSON 校验;.dream-lock防并发。
安装
dsh plugin --profile web add C:\Users\huangxinyang\.dsh\plugins\dsh-dream
# 或从源码目录:
dsh plugin --profile web add D:\claude\...\dsh-dream
安装后重启 DSH:
dsh web
配置
有两种方式,效果一致(设置面板写入的是用户层,覆盖 patch 默认值;applies: restart,重启后生效):
- 设置面板(推荐):打开 DSH 设置 → 插件 → 插件配置 选项卡 → 自动做梦 卡片,直接编辑并保存。
卡片字段含说明与"已覆盖/恢复默认"标记;保存后写入
~/.dsh/settings.yaml的dsh-dream:段。 - patch 文件:编辑
cordis.patch.yml的默认配置。
| 选项 | 默认 | 说明 |
|---|---|---|
enabled | true | 后台自动做梦总开关 |
minHours | 24 | 距上次整合最小间隔(小时) |
minSessions | 5 | 距上次整合后最少新会话数 |
triggerMode | hybrid | hybrid=时间或内容量先到先触发 / gates=仅固定间隔 / volume=仅按内容量 |
minVolumeChars | 30000 | 内容量触发阈值(近期待整合会话文本估算字符数) |
scanIntervalMinutes | 10 | 后台门控检查间隔(分钟) |
scopes | auto | auto=近期活跃项目+通用 / all=全部 / current=当前项目+通用 |
maxDigestChars | 60000 | 近期会话摘要上限(字符) |
maxMemoryChars | 80000 | 记忆正文参考上限(字符) |
maxTokens | 8192 | 子代理整合输出上限;0=不传,由宿主/模型决定 |
agentTimeoutMs | 900000 | 做梦子代理总超时(毫秒) |
agentTools | [](= read/grep/glob) | 做梦子代理可用的只读工具;宿主不支持时自动退回零工具 |
provider / model | huoshang / deepseek-v4-flash-ga-260731 | 由 cordis.patch.yml 固定走火山(用户偏好,勿继承官方 deepseek-official);在设置面板清空则回退为"继承会话模型" |
manualOnly | false | true=只允许手动/工具触发 |
storageDir | ~/.dsh/memory | 记忆存储目录(与 dsh-memory 共享) |
设置卡片属于插件浏览器端(client bundle)。新增或更新设置卡片后需重启 DSH, 让宿主重新扫描插件的
dsh.client声明(pkgMeta缓存只在进程启动时刷新)。
使用
- 手动整合一次:发送
/dream(可选all/current指定作用域范围)。 - agent 主动触发:调用
memory_dream工具。
整合结果会作为一条系统消息出现在当前会话;日志以 [dsh-dream] 前缀输出。
与 CC-HAHA 的关系
参考 CC-HAHA src/services/autoDream/ 的门控链与整合流程(autoDream.ts / consolidationPrompt.ts /
consolidationLock.ts),使用 DSH 原生能力(ctx.sessionQuery 读会话、ctx.subagents 派生子代理
(spawn → 不可用时回退 fork)做整合推理、ctx.commands / ctx.tools 入口)独立实现;
ctx.llm 仅用于枚举已注册 provider 以校验模型路由。
License
MIT
Compatibility
Versions
| Latest version | Published | Size |
|---|---|---|
| 0.1.0 | — | — |
| 0.1.1 | — | — |
| 0.1.2 | — | — |
| 0.2.0 | — | — |
| 0.2.1 | — | — |
Comments
Loading…
Similar plugins
by yihefeikong-rgb
Persistent memory for DeepSeek Harness: memory read/write/retrieve tools, per-turn auto-recording, project-scoped recall injection and a management UI, with non-destructive Claude Code memory import.
★ 1
↓ 462/wk
MIT
TypeScript
Sep 13, 2026
dsh plugin --profile web add dsh-memoryby wojiao42
文件型长期记忆:每个会话注入你自己的 Markdown 记忆文件,提供读写工具,并能查出 DSH_HOME 漂移;不读对话、不联网 · File-backed memory for DeepSeek Harness, with verifiable constraints
★ 0
MIT
JavaScript
Oct 7, 2026
dsh plugin --profile web add dsh-memory-fileby hr98w
融合 Claude Code 的 Auto Memory 与 Codex 的 Session 记忆整理,为 DeepSeek Harness 提供简单、透明、上下文友好的长期记忆。Claude Code-inspired Auto Memory meets Codex-inspired Session consolidation, bringing simple, transparent, and
★ 31
↓ 129/wk
MIT
TypeScript
Sep 10, 2026
dsh plugin --profile web add @hr98w/dsh-memoryMemory consolidation tuning for dsh-mneme (autoDream enabled, schema-max output budget, deepseek-chat route) plus the llm-deepseek reasoning-effort fix, an MCP bridge to the auditable seed-society age
★ 1
MIT
JavaScript
dsh plugin --profile web add dsh-seed-societyCross-app project memory for DeepSeek Harness with role-separated writeback, a visual knowledge workspace, confirmed corrections, session controls, local Writer and organizer settings, and an account-
★ 0
dsh plugin --profile web add dsh-tmcra-memoryby JunNanLYS
让 DeepSeek Harness 拥有跨会话长期记忆:AI 自动记住你是谁、你的项目和偏好,新会话直接带上背景,生活与工作记忆自动分开互不干扰,零配置无感运行 | Long-term memory for DeepSeek Harness: the AI remembers who you are, your projects and preferences across sessions,
★ 21
↓ 285/wk
MIT
TypeScript
Sep 7, 2026
dsh plugin --profile web add dsh-layered-memory