Preface

When building agent applications, a specific problem often arises: models can reason and call tools, but there is no place to record “what happened today.” After a conversation ends, the records are scattered in the chat, making review and retrieval very passive. The philosophy of DSH (DeepSeek Harness) is “everything is a plugin,” and such capabilities are suitable for being implemented as plugins. The dsh-diary introduced below is such a plugin: it provides a set of diary tools for the model, accompanied by a browser-based view and management interface.

What is it

dsh-diary is a DeepSeek Harness plugin maintained by hyperMoss, with the npm package name dsh-diary, current version 0.1.1, and an MIT license. It does three things:

  1. Registers 10 model-callable tools on ctx.tools, covering CRUD operations for diary entries, full-text search, and template management;
  2. Comes with a custom template system to generate entries in a fixed format;
  3. Provides a browser-based interface, including a “Diary” settings section and a standalone diary dashboard.
    Entries themselves are ordinary markdown files stored in a local directory, without introducing additional storage services.

Core Features

Ten Model-Callable Tools

Tools are registered on ctx.tools, and models can call them directly:

Tool Purpose
diary_create Create entry (filename YYYY-MM-DD[-slug].md), supports optional title, tags, body, and named templates
diary_list List entries and metadata, filterable by year/month, tags, or title/filename substring
diary_read Read the frontmatter and full body of a single entry
diary_update Replace or append body, modify title and tags
diary_delete Delete a single entry file
diary_search Perform full-text search on entry bodies, returning line numbers and snippets
diary_template_list List available templates
diary_template_read Read the full content of a template
diary_template_set Create or overwrite a template
diary_template_delete Delete a template

The first six are entry-focused, and the latter four are the template tools group. Templates are markdown files under <diary-directory>/templates/. diary_create accepts a template name and replaces placeholders in the body:

{{date}} {{title}} {{tags}} {{slug}} {{year}} {{month}} {{day}} {{datetime}} {{time}}

If diary_create is passed both template and content, the rendered template body comes first, followed by content appended after an empty line.

Browser-Based Interface

The plugin comes with browser-side code lib/client.js, served via /plugins/dsh-diary/client.js, containing two interfaces:

  • “Diary” settings section: displays the diary/template directory, listing, creating, editing, and deleting templates;
  • Diary Dashboard: a standalone panel opened via its own floating button (button icon is 📓), entries grouped by month, providing a “New Diary” button and per-entry deletion.

The backend for both interfaces is the diary TypeRPC Remote namespace under /api/diary/*:

getDirectory  listTemplates  getTemplate  setTemplate  deleteTemplate
listEntries   getEntry       createEntry  deleteEntry

Installation and Enablement

The installation is for the dsh-diary package published on npm (https://www.npmjs.com/package/dsh-diary), not the GitHub source. The official installation command:

dsh plugin --profile web add dsh-diary

This step installs the plugin into the web profile. Afterward, the web server needs to be restarted for the new tool layer and settings section to take effect.

Storage and Configuration

Entry File Format

Entries are markdown files with optional YAML frontmatter, stored by default in $DSH_HOME/diaries (falling back to ~/.dsh/diaries). An entry generally looks like this:

---
title: My day
date: 2026-08-14
tags:
  - work
  - life
---

Today I …

By default, there is one entry per date; passing slug to diary_create allows multiple entries on the same day, changing the filename to YYYY-MM-DD-<slug>.md.

Override Diary Directory

To place the diary in a different directory, you can override it using config.directory in the profile’s cordis.patch.yml:

- insert:
    - id: dsh-diary
      name: 'dsh-diary'
      config:
        directory: '/Users/me/Diary'

The only configuration item appearing in the documentation is directory.

Development and Debugging

If you want to modify the code yourself, the workflow is as follows:

pnpm install      # Link @deepseek-ai/* host and client packages for typecheck
pnpm run build    # esbuild bundles lib/index.js (host-side), lib/client.js (browser-side), and declaration files
pnpm run typecheck
node smoke.mjs    # Smoke test for the ten tools

Regarding dependencies, runtime dependencies are js-yaml ^4.1.0 and zod ^4.4.3; peer dependencies such as @deepseek-ai/cordis ^4.0.1 and @deepseek-ai/dsh-tools are optional.

Suitable Scenarios and Notes

Suitable scenarios:

  • You want the agent to have a continuous work log or personal diary that it can write to and search on its own;
  • You want to browse and organize entries directly in the browser rather than navigating the file system;
  • You want to store records in a directory you control, such as a Diary directory in a sync drive.

A few notes:

  1. The plugin runs with the permissions of the current dsh process; it can read and write to the diary directory, thus possessing the corresponding file system permissions. It is recommended to check the source code and license before installing (this project is MIT);
  2. After installation, you must restart the web server, otherwise the new tools and settings section will not appear;
  3. The default directory is $DSH_HOME/diaries (falling back to ~/.dsh/diaries); use the directory configuration above if adjustments are needed.

Summary

Following the steps above, the agent now has a diary stored in local markdown files: on the model side, it uses the ten tools to read, write, and search; on the human side, it is managed via the settings section and the diary dashboard. The code and documentation are on GitHub: https://github.com/hyperMoss/dsh-diary; the directory page is on the community site skillhub.cn: https://www.skillhub.cn/plugins/hyperMoss/dsh-diary. This directory is an independent community site and has no official affiliation with DeepSeek / Hypersphere.