How mearihaka/dsh-longing works
dsh-longing is a platform-independent DSH plugin that maintains a changing character state and renders it as model-facing context. The main flow is incoming chat activity, state updates and decay, then channel-specific prompt injection; the panel and diary provide additional ways to inspect or manage the experience. The README documents several capabilities whose internal wiring is not visible in the excerpts, so those relationships are cited to the README rather than presented as inspected call paths.
Main entry points: index.js Plugin Orchestrator · prompt.js Prompt Rendering · curve.js State Dynamics · events.js Event Effects
Components 22
Plugin Runtime
- Plugin Orchestrator
src/index.js - Configuration Schema
src/config.js
State Engine
- Persistent State
src/index.js - State Dynamics
src/curve.js - Event Effects
src/events.js - Event Detection
src/auto-event.js - Activity Tracking
src/anchor.js
Character Experience
- Scene and Mood
src/mood.js - Progressive Unlocks
src/unlock.js - Reply Behavior
src/behavior.js - Prompt Rendering
src/prompt.js - Mood Diary
src/diary.js - Diary Reflection
src/reflect.js - Event Recall
src/recall.js - Proactive Gates
src/proactive.js - Curiosity Search
src/curio.js
User Interfaces
- Web Panel
panel/index.html
External Integrations
- Channel Plugin
- Web Search
- ComfyUI
Other components
- Chat User
- DSH Host
Connections 26
- DSH Host → Plugin Orchestrator: loads plugin
README.md - Chat User → Channel Plugin: sends messages
README.md - Channel Plugin → Plugin Orchestrator: reports activity
README.md - Plugin Orchestrator → Configuration Schema: uses settings
src/index.js - Plugin Orchestrator → Persistent State: reads and writes
src/index.js - Plugin Orchestrator → State Dynamics: updates state
src/index.js - Plugin Orchestrator → Event Detection: detects events
src/index.js - Plugin Orchestrator → Event Effects: applies events
src/index.js - Plugin Orchestrator → Activity Tracking: tracks activity
src/index.js - Plugin Orchestrator → Mood Diary: maintains diary
src/index.js - Plugin Orchestrator → Diary Reflection: requests reflection
src/index.js - Plugin Orchestrator → Curiosity Search: searches topics
src/index.js - Plugin Orchestrator → Prompt Rendering: builds injections
src/index.js - Plugin Orchestrator → Channel Plugin: provides context
README.md - State Dynamics → Prompt Rendering: supplies calculations
src/prompt.js - Event Effects → State Dynamics: changes shared state
src/events.js - Prompt Rendering → Scene and Mood: renders scene
src/prompt.js - Prompt Rendering → Progressive Unlocks: renders boundaries
src/prompt.js - Prompt Rendering → Reply Behavior: adds reply guidance
src/prompt.js - Prompt Rendering → Event Recall: includes remembered events
- Plugin Orchestrator → Proactive Gates: checks initiative
src/index.js - Plugin Orchestrator → Web Panel: serves panel
README.md - Web Panel → Plugin Orchestrator: requests status
README.md - Curiosity Search → Web Search: queries topics
src/curio.js - Plugin Orchestrator → ComfyUI: probes optional backend
src/index.js - Mood Diary → Persistent State: persists entries
src/index.js