DimitriLIAN/dsh-habits

DeepSeek Harness 的习惯编辑器——在Web设置中编辑用户全局的AGENTS.md,该文件会被注入到每个会话中

项目介绍Project Overview

dsh-habits 是一个 DSH 插件,在 Web 设置 → 常规中添加“我的习惯”编辑器,将文本保存至用户全局指令文档 $DSH_HOME/AGENTS.md,由内置加载器自动注入每个会话。适用于持久化个人偏好。注意:更改仅对新会话生效,运行中会话需下次触摸或恢复时刷新。

dsh-habits is a DSH plugin that adds a "My Habits" editor under Web settings → General. Saved text goes to the user-global instruction file $DSH_HOME/AGENTS.md, which the built-in dsh-agent-instructions loader injects into every session. Use it to persist personal preferences. Caveat: changes apply to new sessions; running sessions refresh on next file touch or resume.

或使用命令行安装(适合开发者)Or use CLI install (for developers)

命令行安装CLI Install

dsh plugin --profile web add github:DimitriLIAN/dsh-habits

DimitriLIAN/dsh-habits 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-habits

English | 中文

A DeepSeek Harness (DSH) plugin that adds a My Habits editor to the Web settings → General section. The text you save goes to the user-global instruction document $DSH_HOME/AGENTS.md, which the built-in dsh-agent-instructions loader already injects into every session — so your preferences and habits reach the model automatically.

No DSH core is modified: the host half registers a small REST surface on ctx.webServer (/api2/habits/describe + /api2/habits/update), and the browser half registers a settings.general.item row that calls it. This is the same standalone-bundle pattern as dsh-web-plugin-manager.

Install

dsh plugin add --profile web github:<owner>/dsh-habits

Then restart the web profile (dsh --profile web) so the bundle layer loads. Open Settings → General → My habits, write your note, and save. New sessions pick it up immediately; a running session refreshes on its next file touch or resume.

How it works

Layer Mechanism
Host half ctx.inject(['webServer'])ctx.webServer.register() for describe/update
Read readFileSync($DSH_HOME/AGENTS.md); absence is a blank document, never an error
Write atomic rename under a 65 536-byte budget, with a SHA-1 expectedRevision conflict refusal
Browser half settings.general.item slot (id habits), fetch the REST surface
Injection the built-in dsh-agent-instructions loader injects ~/.dsh/AGENTS.md as the workspace-instruction baseline

Build

pnpm install
pnpm run build

build = host tsc + client tsc (declarations) + tsdown (the __ModuleLoader__.load client bundle).

Known limitations

  • Applies to new sessionsdsh-agent-instructions refreshes on the next successful read/write/edit touch, on resume, or when a shadowed baseline re-enters; a mid-conversation save does not rewrite an already-running session immediately.
  • One editor owns the document — concurrent edits are arbitrated by the expectedRevision conflict refusal, not merged.
上一个 Prev dsh-codex-oauth 下一个 Next dsh-test-workbench