DSH Plugins Marketplace

DSH Plugins

Plugins

/

dsh-keyword-context

Q

dsh-keyword-context

Manifest valid

DeepSeek Harness (DSH) plugin - inject context when user input or model output hits configured keywords, with toggleable/configurable rules and model-editable memory.

UI (client)

dsh-keyword-context

当用户输入或模型输出命中配置的关键词时,向模型注入上下文。可开关、可配置,并可选择允许模型读写记忆。

功能

  • 命中注入:监听用户输入(agent/inbox/inserted)与模型输出(session/event 的 assistant/message),命中任一触发词即激活对应规则,把配置的上下文注入到后续模型上下文。
  • 可开关:设置页「启用上下文注入」总开关,关闭后立即停止注入并清空命中状态。
  • 可配置:触发规则(关键词 ↔ 注入文本)、记忆条目(key/value)均可在设置页增删改,持久化到 config.json。
  • 模型可读写记忆:开启「允许模型读写」后,注册 memory_get / memory_set 两个工具,并在注入上下文中附上工具用法说明。

安装

dsh plugin --profile web add dsh-keyword-context

然后确认 ~/.dsh/profiles/web/cordis.patch.yml 里挂载了 host 半区:

- insert:
    - id: keyword-context
      name: dsh-keyword-context

重启 dsh web,浏览器 Ctrl+F5 强刷。

结构

dsh-keyword-context/
├── package.json        # dsh.client.platform: "web" + exports ./client
├── config.json         # 持久化配置(enabled / allowModelWrite / triggers / memories)
└── lib/
    ├── index.js        # 宿主半区:注入上下文 + 检测 + memory_get/memory_set 工具 + HTTP 接口
    └── client.js       # 浏览器半区:设置页「上下文注入」

配置(config.json)

{
  "enabled": true,
  "allowModelWrite": false,
  "triggers": [
    { "id": "t1", "keywords": ["记忆", "memory"], "context": "用户提到了「记忆」相关话题,请结合上方【记忆】中的内容作答。" }
  ],
  "memories": [
    { "key": "用户偏好", "value": "使用简体中文回答" }
  ]
}

原理

  • host 半区通过 ctx.systemPrompt.context() 注册动态上下文(每次组装时求值),命中触发规则后返回注入文本,否则返回空串(不贡献内容)。
  • 记忆条目始终注入(开关开启时);模型读写开关打开后,注入文本追加工具用法说明,并动态注册 memory_get / memory_set 工具。
  • 配置读写走 webServer 的 /keyword-context/* JSON 接口,客户端设置页用 fetch 读写。

Comments

Loading…

Similar plugins

context-before-user

by n0pe-sled

dsh plugin: keep injected runtime context and skill context as user-role turns before the human request

Sessions & MessagesManifest valid

★ 0

JavaScript

Sep 29, 2026

dsh plugin --profile web add dsh-context-before-user

by SouleyMoni1

DSH plugin: per-model reasoning levels for custom API models, with family presets and an official-settings-page editor.

Manifest valid

★ 0

MIT

TypeScript

Sep 28, 2026

dsh plugin --profile web add dsh-experience-plugin

by fufu1437

DeepSeek Harness (DSH) plugin: declare shell commands in Settings, and every one becomes a tool the model can call directly.

Development & InfrastructureManifest valid

★ 0

MIT

JavaScript

Oct 17, 2026

dsh plugin --profile web add @fufu1437/dsh-model-commands

by chocobo77

DeepSeek Harness plugin: multi-tier memory management, semantic retrieval, structured memory, and model-context awareness for infinite context.

Manifest valid

★ 4

MIT

TypeScript

Oct 22, 2026

dsh plugin --profile web add dsh-infinite-context

by weibaohui

DeepSeek Harness plugin: cron-driven scheduled items with a full-page management UI. Each item carries a title, a prompt, and a croner expression; executions spawn a fresh agent session in a bound wor

Manifest valid

★ 0

JavaScript

Aug 19, 2026

dsh plugin --profile web add dsh-plugin-scheduled-items

by john-walks-slow

Advanced model-context injection and request-only rewriting for DeepSeek Harness with Keysmith compatibility

Tools & CapabilitiesManifest valid

★ 24

↓ 948/wk

MIT

JavaScript

Oct 28, 2026

dsh plugin --profile web add dsh-inject