Introduction

When writing DSH (DeepSeek Harness) plugins, most extensions revolve around “serious business”: hooking into tools, managing sessions, and routing models. The conversations and tool logs accumulated in a session usually just lie in log files and are rarely reused.

dsh-dream-incubator takes a different path. It listens to the session event stream and “dreams” asynchronously in the background while you continue working, distilling the day’s session material into a stylized Chinese dream report presented in an immersive web page. Positionally, it’s more like adding a layer of “subconscious” to the harness, but the engineering implementation is complete: four cognitive psychology mechanisms, six rotatable dream styles, a set of web routes, and clear privacy boundaries. Below is an introduction in the order of installation, mechanisms, and configuration.

What is this

dsh-dream-incubator is maintained by Lisk809, licensed under MIT, current version 0.1.0. One-sentence positioning: Give DeepSeek Harness a subconscious—dream asynchronously in the background, brew daily conversations and tool logs into dream reports, and present them in an immersive WebUI.

Specifically, the plugin listens to the session event stream via the Cordis firehose, dreams asynchronously in the background, producing a dream report for each session during each cooldown period, and presents them centrally on the /dreams immersive web page.

Installation and Enablement

dsh plugin --profile web add dsh-dream-incubator

This command registers a line dream-incubator via a patch package. The difference in profiles is that the headless profile gets the engine and commands; the web profile additionally mounts the UI. When serveUi is true (default, effective only for web profile), open http://<host>:<port>/dreams to browse the dream page.

Working Mechanism

First, let’s talk about where the material comes from. The plugin listens to the session event stream via the Cordis firehose and organizes session events into material windows. When dreaming, the engine follows a cycle of “Route -> Fetch Window -> Emotion Scan -> Generate -> Record,” and the entire process is asynchronous, not blocking the work at hand.

The design follows four cognitive psychology mechanisms:

  1. Activation-Synthesis: Each dream starts with an emotion scan of the material window (PAD model: valence / arousal / dominance), then synthesizes the narrative according to one of six styles.
  2. Threat Simulation: Failed turns, tool errors, and aborted requests are weighted into the material and emotional prompts—dreams differ on stressful days versus quiet days.
  3. Memory Reorganization: The engine uses style-specific noise seeds to rearrange the real session event windows; each dream is a reinterpretation of real events, never a replay in the original form.
  4. Incubation Effect: Cooldown periods and daily limits prevent the engine from over-dreaming; the interval itself is incubation.

Dream Styles and Customization

Built-in six styles: Black Suspense, Cyberpunk, Surreal, Fantasy, Fable, Horror. The style library rotates every styleRotationDays days.

Supports custom styles, appended after the built-in six, participating in the same rotation. Each entry needs id (unique, not conflicting with built-ins), nameZh / nameEn, trigger (one of fatigue / joy / anxiety / boredom / confusion / conflict), imagery (non-empty string array), and palette is optional (defaults to style id):

styles:
  - id: cosmic
    nameZh: 星际漂流
    nameEn: Cosmic Drift
    trigger: boredom
    imagery: [深空尘埃, 失重的茶, 土星环上的雪]
    # palette: nebula   # 可选;默认取 style id

Commands

The plugin provides three session commands:

  • /dream: Force a dream immediately, bypassing cooldown and material thresholds.
  • /dreams: List the last 8 dreams, including style, emotion, material span, and allow marking each as collected or forgotten.
  • /dreamsettings: View real-time engine settings: model routing, noise, thresholds, privacy, UI.

Immersive WebUI

When serveUi is true, open http://<host>:<port>/dreams. The page is a late-night gallery: purple-blue nebula light effects and floating clouds serve as the background; the hero screen features a large PAD graphic (valence × arousal × dominance) and floating noise; below is a suspended collage made of fragment cards—each card is an irregular quadrilateral or pentagon, the shape derived from the dream’s ID and stable across visits—tilting in 3D with the mouse, each style has a low-saturation accent color. Clicking a card enters dream details; filtering by style, emotion, and time is possible, and statistics rows will tell you what you dream most often. The moon in the footer, clicked 7 times, opens a read-only stardial console. New dreams are pushed in real-time via SSE.

Web routes are as follows:

Route Purpose
GET /dreams The main page
GET /dreams/assets/* Static assets (fonts, CSS, JS)
GET /dreams/api/dreams Ledger JSON (newest first)
POST /dreams/api/dreams Change log (collect / forget)
GET /dreams/api/settings Real-time engine settings (read-only, data source for stardial)
GET /dreams/api/stream SSE, pushing every new dream

Configuration

All configuration keys are optional; default values are provided by the harness patch—this package contains no hardcoded defaults, and missing keys fail loudly on load; illegal values (unknown keys, non-integer limits, missing model in provider, duplicate style ids, etc.) also throw errors on load and display specific information.

Key Default Meaning
cooldownMs 3600000 Minimum quiet interval between two dreams in the same session
minMaterialEvents 4 Minimum number of material events required for the engine to dream after the last dream
maxDailyDreams 8 Hard daily cap per session (resets at midnight)
styleRotationDays 4 How often the style library (built-in + styles) rotates
noiseIntensity medium Activation-Synthesis noise intensity: low / medium / high
maxOutputTokens 500 Output token cap for two model calls: scan and dream
timeoutMs 120000 End-to-end deadline for a single dream cycle
privacyMode false When true, scan prompt receives only message count and tool name, not user text
provider / model null Optional explicit model routing, must appear together; defaults to reuse the request/header routing recorded in the most recent session log
styles [] Custom styles, appended after the built-in six
storePath ~/.dsh/dream-incubator/dreams.json Location of the JSON dream ledger
serveUi true Serve the page at /dreams, effective only for web profile

Privacy and Data Boundaries

Privacy boundaries are an explicitly written part of the design. When privacyMode is true, the scan prompt contains only message counts and tool names, not user text. Each dream references its exact materialSeqs (the sequence numbers of the material events used to build it), and the engine does not touch session data outside the window.

Dreams are stored as a versioned JSON ledger, written atomically, with a cap of 300 entries, the path configured by storePath.

Development and Publishing

To see the implementation or perform secondary development:

pnpm install
pnpm build    # tsdown → lib/
pnpm test     # vitest, 86 unit + integration + routing tests

The target npm tag for publishing is dsh-plugin:

npm publish --tag dsh-plugin

The published artifact includes lib/ (engine, invariant companion, lib/webui/ static assets) and cordis.patch.yml for use with dsh plugin add. Regarding dependencies, it directly depends on dsh-invariants, dsh-timeout, schemastery; peer dependencies include cordis and dsh-agent, dsh-llm, dsh-session, etc., from the @deepseek-ai series of packages.

Applicable Scenarios and Notes

Suitable for two types of people. The first is developers who have used DSH for a long time and want a way to review sessions without occupying attention—dream reports are essentially stylized summaries of the day’s conversations and errors, and emotion scanning can even hint that “things didn’t go smoothly today.” The second is developers who want to study how DSH plugins are organized; this package covers a complete structure including engine, commands, WebUI, SSE, invariant companions, etc., and the tests are also quite comprehensive.

Two notes. First, the plugin runs with the permissions of the current dsh process; before installing, check the source code and license (this project is MIT). Second, DSH’s philosophy is “everything is a plugin”; the community directory is an independent site with no official affiliation to DeepSeek or Hanhxin, and installation and usage follow the plugin’s own documentation.

Conclusion

To summarize: dsh-dream-incubator uses the Cordis firehose to listen to the session event stream and asynchronously distills daily conversations and tool logs into stylized Chinese dream reports in the background; four cognitive psychology mechanisms control the rhythm and content of dreaming, /dreams provides immersive browsing, and privacy and data boundaries are clearly defined. Install it, and your harness will “rethink” your day for you while you continue working.

  • GitHub: https://github.com/Lisk809/dsh-dream-incubator
  • Community Directory Page: https://www.skillhub.cn/plugins/Lisk809/dsh-dream-incubator