Introduction¶
The DSH plugin mechanism emphasizes “everything is a plugin.” Many plugin entries can be found in the DSH community directory. The community directory is an independent site with no official affiliation to DeepSeek or Huanfang, and should not be interpreted as an official app store.
For agent developers, a common requirement is not just to have the model complete a single task turn, but to add a controllable layer of additional state alongside the work reply. dsh-serendipity addresses this issue: it listens for user-initiated conversation turns, triggers a random “serendipity” event based on probability upon completion, and persists the protagonist’s attributes, experience, and level. It does not alter the main task reply flow but instead provides a configurable, queryable, and resettable plot state alongside the task reply.
What is this¶
PocketSWPU/dsh-serendipity is a DeepSeek Harness (DSH) plugin, with the npm package name @pocket30/dsh-serendipity.
It is positioned as a “Work Serendipity” plugin: there is a chance to trigger a random serendipity event after each conversation ends, continuously leveling up your protagonist’s attributes, and includes a visual configuration page in the DSH settings.
The maintainer is PocketSWPU. The current installation command uses version 1.0.0.
Core Features¶
The main capabilities of this plugin can be understood through the following categories:
- Listens to
turn/endevents and only counts user-initiated conversation turns, avoiding repeated triggers of plot turns injected by the plugin itself. - Supports customizing trigger probability and the minimum number of user conversation turns between two serendipity events.
- Built-in with 7 major themes and 700+ events; themes are in single-select mode.
- Events are categorized into four levels—Daily, Adventure, Epic, and Legendary—and unlock progressively as the character’s level increases.
- Supports hitting attribute branch lines based on current six-dimensional attributes and drawing branches with attribute weighting.
- Attribute changes are automatically clipped within the
0~100range, and character level is automatically increased after experience points accumulate. - Defaults to
followupmode, continuing the serendipity as a story from the protagonist’s perspective, separated from the work reply. - Registers a “Serendipity Settings” page in the DSH settings, supporting real-time configuration of character profiles, general parameters, and theme cards.
- Persists character data across sessions; prioritizes using
storage domain, and falls back to in-memory storage with an alert if unsupported. - Provides
serendipity_statusandserendipity_resettools for the model to query or reset character profiles.
Installation and Enabling¶
Requirements¶
Verified data indicates:
- DSH CLI
0.1.0-rc.6, or a compatible version (specifically subject to “Known Limitations” in the data). - Recommended profile is
web, because thewebcombination comes with built-instorage domainand settings page container. - If the profile is not
web, you need to replacewebin the installation command with the corresponding profile name.
Installation¶
First confirm the current profile and DSH CLI version, then execute the installation command:
npx @deepseek-ai/dsh plugin --profile web add @pocket30/dsh-serendipity@1.0.0
After installation, you need to restart the DSH web. Following the usage steps provided, first kill the process listening on 3080, then re-execute:
dsh web
Then perform a hard refresh in your browser.
After opening the DSH settings page, the “Serendipity Settings” page should appear in the navigation.
Verification¶
- Complete a few turns of conversation and wait for the first serendipity to trigger.
- Check the level, attributes, and recent serendipity in the “Character Profile”.
- Perform visual editing via DSH Settings -> “Serendipity Settings”; changes take effect immediately.
- If you need to override configuration at the orchestration layer, override the
serendipityconfiguration in the profile’scordis.patch.yml.
Typical Usage¶
Adjusting Parameters in DSH Settings¶
Open the DSH settings page and enter “Serendipity Settings”.
This page provides at least three types of configuration perspectives:
- Character Profile: View level, attributes, and recent serendipity.
- General Parameters: Adjust trigger probability, minimum interval turns, etc.
- Theme Cards: Select themes; theme genres are in single-select mode.
Changes take effect immediately. The data also notes that the DSH official settings RPC only exposes whitelisted namespaces to the browser, and third-party namespaces are not sent down; this plugin’s settings page uses the plugin’s own route:
/serendipity/api
Overriding Configuration in Orchestration Layer¶
If you need to override plugin configuration at the profile level, you can override the serendipity configuration in the profile’s cordis.patch.yml.
The data also points out that extraThemes / extraEvents are orchestration-level configurations and should be maintained in the config section of cordis.patch.yml. Since part of the data is truncated, do not speculate on configuration fields not fully displayed based on names.
Model Tools¶
The plugin provides the following tools available to the model:
serendipity_status
serendipity_reset(confirm: true, name?)
Usage:
serendipity_status: View character profile.serendipity_reset: Reset character profile;confirm: truemust be explicitly passed when calling, andnameis optional.
Use Cases and Notes¶
This plugin is suitable for the following scenarios:
- Want to add a lightweight additional plot outside the DSH conversation flow.
- Hope the additional plot does not participate in the main task, but is separated from the work reply.
- Hope to adjust trigger parameters, themes, and character profiles in real-time via the DSH settings page.
- Want character state to persist across sessions, especially when using the
webcombination that supportsstorage domain.
Notes before use:
- The plugin runs with the permissions of the current DSH process; check the source code and license before installing.
- Current data does not specify the license type; verified facts only indicate that
package.json filescontainLICENSE, which cannot be used to determine the specific license. - If the current combination does not support
storage, the plugin will fall back to in-memory storage and issue an alert. - The DSH community directory is an independent site with no official affiliation to DeepSeek or Huanfang, and should not be interpreted as an official app store.
Get and Reference¶
- Directory Page:
https://www.skillhub.cn/plugins/PocketSWPU/dsh-serendipity - GitHub:
https://github.com/PocketSWPU/dsh-serendipity
The value of this plugin is specific: it turns the “random serendipity after conversation ends” into a configurable, persistable, and adjustable state system within the DSH settings page, rather than just outputting a one-time text block.