DeepSeek Harness Plugin Hub

发布与管理完整 Harness Profiles,发现适合你的插件。

探索

插件目录环境预设文档中心动态

社区

发布插件联系我们报告问题

相关链接

Plugin Hub GitHubDeepSeek Harness 官方项目系统状态隐私说明
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

独立、非官方社区项目,与 DeepSeek 官方无隶属、授权或背书关系。

DeepSeek Harness Plugin Hub
ProfilesPlugins分类动态文档登录管理 Profiles
ProfilesPlugins分类动态文档登录
← Plugins

@jiesou/dsh-stream-rules

Stream Rules

在需要时注入规则,避免浪费上下文。opencode-stream-rules 的 DSH 移植版。

插件会安装到这里;不确定时保持 web。

npx -y @deepseek-ai/dsh plugin --profile web add @jiesou/dsh-stream-rules@0.1.12
README兼容性版本
-6336866371853030306_121

兼容性与来源证明

Stream Rules 以 @jiesou/dsh-stream-rules 发布,当前版本为 0.1.12。Plugin Hub 会校验它的 manifest,并保存精确安装来源,便于复现安装结果。

DSH 兼容范围
*
运行环境
any
发布来源
npm
Registry 更新时间
2026/11/4

版本

0.1.12stable
2026/10/3
0.1.11stable
2026/10/3
0.1.10stable
2026/9/30
查看其余 4 个版本收起版本
0.1.9stable
2026/9/27
0.1.8stable
2026/9/10
0.1.7stable
2026/8/16
0.1.6stable
2026/8/14

相关插件

正在加载相关插件…

最新版
0.1.12
DSH
*
HMR
重启进程
Tree shaking
未声明可安全裁剪
解包体积
18.4 kB
文件数
8
Surface
any
许可证
MIT
发布源
npm
GitHub
★ 4
周下载
51
最近提交
2026/10/3
查看源码 ↗项目主页 ↗
README Badge

点击下方 Badge 复制 Markdown,粘贴到 README 即可。

这是你的 Plugin?认领权益 · 优先安全扫描

验证 package.json 声明的 GitHub 仓库,即可管理这个公开页面。认领后,Hub 会优先安排当前版本的安全扫描,并在通过后公开展示结果。

认领这个 Plugin →
报告问题

相关插件

继续浏览 developer-tools 分类下经过校验的插件。

Web App@deepseek-ai/dsh-web-appdsh 浏览器界面捆绑包:位于 dsh-base 之上的 Web 补丁层,加上运行时粘合插件(提供前端 dist、Web 界面提示符、bash 运行时变量和 URL 行)Sdk Minimal@deepseek-ai/dsh-sdk-minimal独立的最小 SDK 配置包:JSON-RPC、一个 DeepSeek 适配器、持久化 Shell 和 JSONL 会话Sdk App@deepseek-ai/dsh-sdk-appdsh SDK 配置包:基于 dsh-base 提供 stdio JSON-RPC 服务和进程生命周期管理Experimental Inspector@deepseek-ai/dsh-experimental-inspector用于 Host 调试和 Client Runtime 检查的实验性跨 realm CDP hub

README

dsh-stream-rules

简体中文

Inject rules when needed, without wasting context.

-6336866371853030306_121

You can write custom streaming rules for the agent.

These rules are injected only as a steering notice after a pattern match, then agent retry from the same point. This allows you to control the boundaries of agent behavior, without wasting context.

Port of my jiesou/opencode-stream-rules to DSH. Similar to oh-my-pi's "Time-traveling stream rules", but with a very simple and compact code implementation.

How it works

A rule fires when its match returns true, against:

  • the tool call — tool name + flattened arguments (numbers included, e.g. timeoutMs), before dispatch.
  • the settled result — after dispatch, the tool's content, status markers ([timed out after 600000ms], [exit code: 1], …) and error text join the match string, so rules describing outcomes (a crash, a full disk, a timeout) can match there too. Matching after dispatch can only steer, never deny.

On a match:

  • default — injects a SYSTEM NOTICE steering message into the agent (pre-dispatch via agent.inject(), post-dispatch as additionalContexts on the tool result — DSH's non-waking "queue model-facing context for the next pre-step"). The agent retries from the same point, now knowing the rule.
  • reject: true — denies the FIRST tool call ({ kind: 'deny' }); later attempts are allowed. Steering without over-restricting, e.g. letting pip install through when it's already in a container.

Each rule fires at most once per session (per agent), mirroring the original's notified dedup.

Install

From npm (prebuilt, recommended):

dsh plugin --profile <name> add @jiesou/dsh-stream-rules

Or from GitHub (runs prepare to build on install):

dsh plugin --profile <name> add github:jiesou/dsh-stream-rules

Or add the row to your profile's cordis.patch.yml:

- id: stream-rules
  name: '@jiesou/dsh-stream-rules'

After installing

You need to write the rules in your own .js file. This plugin won't work by default until you edit the rules.

  1. Locate the plugin's path:
$DSH_HOME/profiles/<name>/node_modules/@jiesou/dsh-stream-rules

where $DSH_HOME defaults to ~/.dsh.

  1. Write rules:
mv rules/rules.js.example rules/rules.local.js
  • Files starting with _ are skipped.
  • To point at a different rules directory: config.rules:
- id: stream-rules
  name: '@jiesou/dsh-stream-rules'
  config:
    rules: /path/to/your/rules
  • A rule with reject: true will only be rejected on the first toolcall; subsequent attempts by the agent will be allowed. This provides steering while avoiding overly restricting the model (e.g., allowing pip install if it's already in a container).

Writing rules

// rules/rules.local.js
export default [
  {
    match: (v) =>
      v.includes('pip') &&
      v.includes('install') &&
      !v.includes('uv pip') &&
      !v.includes('uvx'),
    reject: true,
    prompt: 'Use `uvx` or `uv venv` + `uv pip` instead of `pip install` directly',
  },
  {
    match: (v) => v.includes('curl') && v.includes('api.github.com'),
    prompt: 'Prefer using `gh` cli over `curl https://api.github.com/...`. gh offers more requests limits.',
  },
  {
    match: (v) => v.includes('pdf'),
    prompt: 'Use the `markitdown` skill to read PDF files.',
  },
  // add your rules here
]
fieldrequireddescription
match✅(v: string) => boolean; every tool call is flattened to a string and matched — plus, after dispatch, the settled result's content, markers and error text
prompt✅The prompt for steering
rejectIf true, prevent the tool call first, instead of just steering

Compatibility

Declared in package.json under dsh.compatibility: DSH >=0.1.7-alpha.1 <0.2, Node.js ^22.19.0 || >=24.0.0, profiles web / headless.

>=0.1.7-alpha.1 is a hard floor, not a preference: that release retires the { kind: 'plugin', plugin: … } message source (session format v4), so the steering notice declares its own MessageSourceMap entry.

Per-release evidence (each release installed into a disposable profile with dsh plugin add <tarball>): the profile composes and cold-starts, the tool-call hook is exercised directly against that release's tools/pre-execute waterfall and agent.inject() (steering notice delivered, reject: true denies the first call and allows the retry), then the plugin is uninstalled and the profile boots again. The rows below are the evidence collected for the >=0.1.0-rc.6 declaration; the range declared above is not re-verified release by release yet.

DSH versioninstallstarthookuninstall
0.1.5-alpha.1passedpassedpassedpassed
0.1.5-alpha.2passedpassedpassedpassed
0.1.5-rc.1passedpassedpassedpassed

Implementation notes

  • A single src/index.ts (~80 lines).
  • Uses DSH's tools/pre-execute waterfall (deny), tools/post-execute (failure-text matching + additionalContexts) and agent.inject() (steering), the documented native extension points. No core changes, no monkey-patching.