Lisk809/dsh-dream-incubator
让 DeepSeek Harness 拥有潜意识:后台异步做梦,把日常对话与工具日志酿成梦境报告,呈现在沉浸式 WebUI 中
项目介绍Project Overview
dsh-dream-incubator 是 DSH 插件,监听会话事件流,在后台把对话素材经情绪扫描与六种轮换风格合成为中文梦境报告,通过 /dreams 网页与 /dream、/dreams 命令查看。适合想在工作间隙获得会话回顾与创意记录时使用;梦境仅基于滑动窗口事件,且受冷却、每日上限约束,隐私模式下不发送用户原文。
dsh-dream-incubator is a DSH plugin that watches the session event stream and, in the background, distills conversation material into stylized Chinese dream reports using emotion scans and six rotating narrative styles. Dreams appear at /dreams and via /dream and /dreams commands. Use it for reflective or creative session recaps while working. Each dream uses only a trailing event window, respects cooldown and daily caps, and privacy mode omits user text from prompts.
请帮我了解并安装插件:【dsh-dream-incubator】【https://github.com/Lisk809/dsh-dream-incubator】
把上面这条消息直接发给当前会话里的 DSH,让它帮你了解并安装。安装命令不一定准确,发给 DSH 更稳。Send this message to DSH in your current session. CLI install commands may not be accurate across systems — DSH will figure it out for you.
或使用命令行安装(适合开发者)Or use CLI install (for developers)
命令行安装CLI Install
dsh plugin --profile web add dsh-dream-incubator
把 Lisk809/dsh-dream-incubator 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-dream-incubator
English | 中文
A dream incubator for DeepSeek Harness. The plugin watches your session's event stream through the Cordis firehose, and in the background — while you keep working — it dreams: it distills the day's conversation material into stylized Chinese dream reports, one per session per cooldown period, and surfaces them in an immersive web page at /dreams.
The design follows four cognitive-psychology mechanisms:
- Activation–Synthesis — each dream begins with an emotion scan of the material window (PAD model: valence / arousal / dominance), then synthesizes a narrative in one of six styles: 黑色悬疑 (noir), 赛博朋克 (cyberpunk), 超现实 (surreal), 奇幻 (fantasy), 寓言 (fable), 恐怖 (horror). The style matrix rotates every
styleRotationDaysso favorites drift. - Threat Simulation — failed turns, tool errors, and aborted requests are weighted into the material and the mood hints. Stressful days dream differently from quiet ones.
- Memory Reorganization — the engine recombines a trailing window of real session events through per-style noise seeds, so each dream is a fresh reinterpretation of what actually happened, never a replay.
- Incubation Effect — a cooldown and a daily cap keep the engine from dreaming too eagerly; the gap is the incubation.
Install
dsh plugin --profile web add dsh-dream-incubator
The patch bundle registers one row (dream-incubator). Headless profiles get the engine and the commands; web profiles additionally mount the UI.
Configuration
All keys are optional; the defaults below are supplied by the harness patch (this package ships no hardcoded defaults — a missing key fails loud at load time).
| Key | Default | Meaning |
|---|---|---|
cooldownMs |
3600000 |
Minimum quiet interval between two dreams for one session |
minMaterialEvents |
4 |
Minimum material events since the last dream before the engine may dream |
maxDailyDreams |
8 |
Hard daily ceiling per session (resets at midnight) |
styleRotationDays |
4 |
Rotate the style library (built-ins + styles entries) every N days |
noiseIntensity |
medium |
Activation–Synthesis noise strength: low | medium | high |
maxOutputTokens |
500 |
Output-token cap for both the scan and the dream model calls |
timeoutMs |
120000 |
End-to-end deadline for one dream cycle |
privacyMode |
false |
When true, the scan prompt receives message counts and tool names but no user text |
provider / model |
null |
Optional explicit model route (must appear together). When absent, the engine reuses the session's latest logged request/header route |
styles |
[] |
Custom dream styles appended after the built-in six, participating in the same rotation. Each entry: id (unique, not colliding with built-ins), nameZh / nameEn, trigger (fatigue | joy | anxiety | boredom | confusion | conflict), imagery (non-empty string array), optional palette (CSS palette key; defaults to the style id) |
storePath |
~/.dsh/dream-incubator/dreams.json |
JSON dream ledger location |
serveUi |
true |
Serve the immersive page at /dreams (web profiles only) |
Invalid values (unknown keys, non-integer limits, provider without model, duplicate style ids, …) throw at load time — the harness surfaces the exact message.
Custom styles example:
styles:
- id: cosmic
nameZh: 星际漂流
nameEn: Cosmic Drift
trigger: boredom
imagery: [深空尘埃, 失重的茶, 土星环上的雪]
# palette: nebula # optional; defaults to the style id
Commands
| Command | What it does |
|---|---|
/dream |
Force a dream right now, bypassing the cooldown and material gates |
/dreams |
List the 8 most recent dreams with their style, mood, and material span; mark each as collected (收录) or forgotten (遗忘) |
/dreamsettings |
Show the live engine settings: model route, noise, gates, privacy, UI |
Web UI
With serveUi: true, open http://<host>:<port>/dreams. The page is a late-night gallery: violet-blue nebula light and drifting clouds behind everything, a large PAD glyph (valence × arousal × dominance) and drifting noise motes on the hero, then a collage of floating fragment cards — each an irregular quadrilateral/pentagon (the shape is derived from the dream's id, stable across visits), gently bobbing, tilting in 3D with the mouse, with light and shadow hugging the fragment outline and one low-saturation per-style accent. Click a card to dissolve into the full dream detail; filter by style / emotion / time, and the stats line tells you what you dream about most. Click the footer moon 7 times to open the read-only stardial console. New dreams arrive live over SSE.
Routes:
| Route | Purpose |
|---|---|
GET /dreams |
The page |
GET /dreams/assets/* |
Static assets (fonts, CSS, JS) |
GET /dreams/api/dreams |
The ledger as JSON (newest first) |
POST /dreams/api/dreams |
Mutate a record (collect / forget) |
GET /dreams/api/settings |
Live engine settings (read-only; stardial data source) |
GET /dreams/api/stream |
Server-sent events; pushes every new dream |
Architecture
src/
index.ts plugin entry: config validation, cadence gates, commands
engine/
material.ts observation layer: session events → material lines + stats
styles.ts the six-style matrix, rotation, mood hints, scan coercion
noise.ts seeded LCG + per-style noise drawing (activation–synthesis)
prompts.ts scan and dream prompt assembly (privacy-aware)
dreamer.ts the dream cycle: route → window → scan → dream → record
store.ts versioned JSON ledger (atomic writes, cap 300 records)
webui/server.ts /dreams page, JSON API, settings route, SSE push
invariant.ts DSH invariant companion (no-op; reserved)
static/
index.html page skeleton: gallery, detail overlay, stardial, ambience
dreams.css design system: violet-blue nebula, fragment cards, per-style accents
dreams.js fragment collage, mouse tilt, filters + stats, detail, stardial, SSE client
The engine never touches session data outside its window: each dream cites the exact materialSeqs it was built from, and privacyMode keeps user text out of the model prompt entirely.
Development
pnpm install
pnpm build # tsdown → lib/ (index + invariant + webui assets)
pnpm test # vitest — 86 unit + integration + route tests
Publishing
dsh-dream-incubator targets the dsh-plugin npm tag:
npm publish --tag dsh-plugin
The published tarball ships lib/ (engine, invariant companion, and the lib/webui/ static assets resolved relative to the bundle), plus the cordis.patch.yml consumed by dsh plugin add.
nexu-io/open-design
freestylefly/awesome-gpt-image-2
anywhere-labs/dsh-desktop
walkinglabs/learn-harness-engineering
awesome-dsh-plugin/awesome-dsh-plugin
MemTensor/MemOS