YohtHill/dsh-plugin-greeter ↗★ 0
dsh-plugin-greeter
A DeepSeek Harness (dsh) plugin that greets the user at the start of every session with varied wording, learns their name on first use, and greets them personally afterward.
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:YohtHill/dsh-plugin-greeter说明文档
阅读完整 README ↗dsh-plugin-greeter
一个 DeepSeek Harness(dsh)插件:每次会话开始时向你问候,并记住你的名字,让每次问候都更贴心。
中文 | English
功能特性
- 👋 每次会话都问候 — 每次都用全新措辞、跟随你使用的语言(模型即兴生成,不会重复)。
- 🧑 第一次先问你名字 — 首个会话会询问你的名字,并通过
remember_name工具持久化保存。 - 💾 跨会话记住你 — 名字存储在 dsh home(
~/.dsh/greeter-name.json),之后的会话都会按名字问候你。
安装
从 npm 安装(发布后)
dsh plugin --profile web add dsh-plugin-greeter
该包声明了 dsh.bundle.patch,因此 dsh plugin add 会自动将其识别为 bundle 补丁层并加入 profile 的补丁栈——无需手动配置。
从源码安装(GitHub 克隆)
仓库自带编译产物 lib/,克隆后可直接使用,无需本地构建:
git clone https://github.com/YohtHill/dsh-plugin-greeter.git
cd dsh-plugin-greeter
dsh plugin --profile web add .
dsh 的核心包仍是 pre-1.0(
rc)。如果你要自己构建源码,请用npm install --legacy-peer-deps(npm 默认的 peer 解析会拒绝rc版本区间),然后npm run build再添加。
开发调试(本地,无需发布)
在 DeepSeek Harness 仓库中,把它作为 overlay 挂到任意 profile:
pnpm dsh web --patch /path/to/dsh-plugin-greeter/cordis.patch.yml
或者迭代开发时直接把 patch 指向本地源码:
- insert:
- id: greeter
name: '/absolute/path/to/dsh-plugin-greeter/src/index.ts'
在 Windows 上,
name必须使用file:///URL(盘符路径不是合法的 ESM 模块说明符)。
构建
npm install --legacy-peer-deps # dsh 核心包是 pre-1.0 (rc),npm 需要这个参数
npm run build # 生成 lib/(JS + 类型声明)
npm publish(或 npm pack)会通过 prepack 自动重新构建。
工作原理
- 通过
defineTool注册remember_name工具;用户一说出名字,模型就调用它,插件把名字写入存储文件。 - 监听
agent/pre-step瀑布,在每次新会话的第一个模型步骤注入问候指令(上下文注入)。每次会话会随机抽取一个语气提示(俏皮、真诚、简洁等),因此即使输入完全相同,问候语也会不同。 - 每次会话都会重新读取存储文件,因此直接编辑或删除它即可立即生效。