Overview¶
The core philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” The dsh-diary plugin by zhm20001 is designed for scenarios that require long-term journaling and AI-assisted summarization. It provides a paper-note-style web page, and its core logic is to first save the user’s raw input to local disk, then call an LLM to generate annotations. This design ensures that even if AI summarization fails, the user’s original content is not lost.
Core Features¶
- Raw content persistence separated from AI annotation: The raw entry is persisted immediately after submission; AI annotations (keywords, summary, emoji, and annotation text) are generated in the background, and failure does not affect saving.
- 30-hour date handling: The plugin reads system time. Content written before
nightCutoff(default 6 o’clock) is classified as the previous day, and timestamps are displayed as 25:xx to 29:xx, preventing late-night retroactive entries from splitting the same day’s record into two files. - Template-based file creation and appending: It supports creating entries from templates. Multiple submissions on the same day append entries and regenerate the day’s summary (the old annotation block is removed and rewritten).
- Direct LLM invocation: It calls
ctx.llmto produce today’s keywords, a one-sentence summary, the day’s emoji, and annotations. - Long-term memory (user profile): Each time a diary entry is saved, the system maintains a user profile in parallel, stored in
.diary-meta/profile.mdunder the diary directory. The profile is updated by referencing summaries from the past week. - Heatmap and drafts: It generates a time-based heatmap (one frame per half year) and automatically saves drafts to browser localStorage.
Installation and Enablement¶
Installation steps are as follows:
git clone https://github.com/zhm20001/dsh-diary.git
cd dsh-diary
pnpm install
dsh plugin --profile web add <本目录路径>
After installation, restart dsh web and visit /diary in the browser.
Typical Usage¶
- First-time use: Opening the page displays a settings card. You need to enter the diary directory (e.g.,
~/Documents/diary). After saving, the configuration is written toconfig.jsonand takes effect immediately. - Daily writing: Enter content on the page and submit. The raw entry is persisted immediately. If summary generation fails, click “Retry Summary Only” to generate it later; the raw content will not be lost.
- Draft saving: Unsubmitted content is automatically saved to browser localStorage, keyed by date.
Configuration and Advanced Options¶
- Configuration precedence: Three levels from highest to lowest precedence: cordis patch / profile config > plugin root
config.json> built-in defaults. - Custom prompt: Next to the “AI Annotation Model” selector on the page, open the prompt card to edit the system prompt (
summaryPrompt). Changes take effect immediately after saving. - Long-term memory logic: Before generating the summary, the full profile text and summaries from the past week are injected as context. After the annotation is persisted, the system generates a new profile based on the old profile and the full content of the day. Profile update failures only show a notice and do not affect saving.
- Heatmap rules: One frame per half year. Written days display the day’s emoji, unwritten days display a light background, and future days display gray. In a very few years (e.g., when July 1 falls on a Sunday), the December 31 cell in the second half may not be displayed.
Privacy and Data Management¶
- Privacy protection: Diary content is stored only on local disk. The only outbound data is the summary request (full content of the current day + user profile + summaries from the past week). Heatmap data, meta files, and drafts do not leave the local machine.
- Data backup: Data is self-contained within the diary directory. Backups must include the
.diary-meta/folder; otherwise, emojis will silently fall back to green blocks, and the profile cannot be read. - Semantic details: Resubmitting on the same day appends entries and rewrites the summary. Do not manually edit the “## AI Annotation” section. The file format is
<diaryDir>/YYYY-MM-DD.md.
Conclusion¶
This plugin provides DSH users with a practical journaling solution. By combining LLM capabilities, it achieves a balance between local storage and intelligent assistance. When using it, ensure backups include the meta directory and that the summary model configuration meets the plugin’s requirements.