DSH HUB
HomePlugin StorePlugin PacksCommunityRankingsResourcesPublish Guide
Plugin source
Back to catalog

hzh5021 /

hzh5021/dsh-qq-voice

Verified

Mounts a per-channel speaking-rules file into the QQ preset's system prompt only, so that channel answers in one or two lines while every other channel stays untouched.

★ 0 Stars0 Forks0 IssuesN/A Community rating0 Confirmed installs
View on GitHubProject homepage
READMESource: main@d6a9ba22

dsh-qq-voice

把一份渠道口径文件只挂进某个渠道会话的系统提示里,让那条线答得短,别的会话一个字不动。

它做什么

同一份通用人设管的是「这个 agent 是什么样」,管不了「这条管道只放得下多少字」。即时通讯那条线通常要一两行说清,而别的会话(桌面端、文档式的活儿)需要正常篇幅。两套口径打起来,输的永远是长度那条——因为长度是硬约束,人设是软约定。

这个插件把一份单独的渠道口径(一份 Markdown 文件)挂成系统提示里的一个段,而且只挂在指定的那个 preset 上:home 指的目录里有这份文件就挂,读不到就整段不挂,绝不把会话建不起来。

走系统提示、不往消息历史里注入:后者会进消息历史、每轮都占上下文,而这本来是长期口径。文本是每次组装提示时重新解析的(带 mtime 缓存)——改完那份 md,下一轮就生效,不用重装插件。

装

dsh plugin add hzh5021/dsh-qq-voice

手工四步:

  1. 把包放进 ~/.dsh/plugins/dsh-qq-voice/。
  2. profile 的 package.json 里 dependencies 加一条(本机口径:"dsh-qq-voice": "file:../../plugins/dsh-qq-voice"),并在 profile 的 node_modules/ 下留一个同名联接。
  3. 同一份 package.json 的 dsh.profile.bundles 里加上 "dsh-qq-voice"。
  4. 重启 DSH。

注意这个包的用意是只活在目标渠道那个 preset 里,不是挂在 profile 顶层花名册上:

  • 真正的挂载点是 profile 里那个 preset-<渠道> 的插件行(放在 preset 里,它才只影响那一段会话)。
  • 包里的 cordis.patch.yml 留着,是因为 package.json 声明了 dsh.bundle.patch;万一有人把它当普通 bundle 装进来,插进去也只是一段提示词,不碰任何运行时状态。

配置

键 默认 说明
home "" 口径文件所在目录;空 = 不挂这一段(等于关闭)
file "QQ线口径.md" 相对 home 的文件名
after "DEPLOYMENT_PERSONA_SUFFIX" 插在这一节后面——位置比内容要紧
fallbackOrder 10201 拿不到 after 那节的顺序值时用的 order
- id: qq-voice
  name: dsh-qq-voice
  config:
    home: /path/to/your/home
    file: QQ线口径.md

怎么工作

  • 只声明一个服务:inject = ["systemPrompt"]。Cordis 的规矩是没报名的服务连读都不让读,而除了往提示词里放一段字,这个插件什么都不干。
  • 位置:问注册表要 after 那一节的顺序值(ctx.systemPrompt.getSectionOrder(opts.after)),取 +1 插在它后面——先读完「我是谁」,紧接着就是这条渠道的规矩。拿不到(宿主没这节的贡献方、或者没有这个方法)就退到 fallbackOrder;不能因为要不到位置就不挂。
  • 段:名字是 qq-voice:channel,interpolate: false(内容是中文,不该被当成模板变量解析)。挂载时在正文前加一句固定的中文前言,声明「本段只约束当前渠道」。
  • 读取带 mtime 缓存:提示段每次组装都求值,做不到「启动读一遍就完」;每轮都读盘也没必要。mtime 没变就用缓存,变了就重读。文件不在或者读不动时返回空串——段还在,内容是空的,启动时打一行日志说明走得是默认措辞。
  • 失败不出声也不害人:位置取不到、段挂不上,都只打日志,绝不让 agent 建不起来。

边界

  • 只对挂了这份提示段的会话生效;隔离靠 preset,不是全局开关。
  • 依赖宿主暴露 ctx.systemPrompt.section();没有就整段挂不上(只记日志,不报错)。
  • getSectionOrder 是可选的:没有它就用 fallbackOrder,段照挂。
  • 文件读不到时不报错、也不拦住会话——那条线退回默认措辞。
  • 不做摘要、不做截断、不做语言检查:文件多大就挂多大,建议保持短。
  • 只用 Node 内置模块(node:fs、node:path)。

冒烟测试

node test/smoke.mjs

不碰 profile、不碰 DSH 进程:造一个只有 systemPrompt 的假 ctx,跑 apply() 看挂出来的段对不对——正常路径(文件在、位置取得到)、位置取不到时的兜底、文件改过之后跟不跟着变、文件不在时的行为。

English

What it does — Mounts a per-channel speaking-rules Markdown file as one named section of the system prompt, and only for the preset it is installed into — so a chat channel answers in one or two lines while every other conversation keeps its normal length. The file is re-read when it changes (mtime cache), so editing the Markdown takes effect on the next turn without reinstalling. Nothing is mounted when the file is missing.

Install — dsh plugin add hzh5021/dsh-qq-voice, or drop the package into ~/.dsh/plugins/dsh-qq-voice/ and register it — preferably inside the target preset's plugin row rather than the profile-wide roster — then restart DSH.

Config — home ("", empty = disabled), file (QQ线口径.md), after (DEPLOYMENT_PERSONA_SUFFIX), fallbackOrder (10201).

Requirements — DSH exposing systemPrompt; Node 18+; no external dependencies.

License — MIT.

MIT 许可。

—/ 5

No ratings yet

Verified DSH bundle

Commit d6a9ba2262be

Community comments

No comments yet. Be the first to write one.

DSH HUB

A community index for DSH plugins. Not an official GitHub or DeepSeek AI product.

CommunityResourcesAPIAbout