dsh-stream-rules
Time-traveling stream rules for DeepSeek Harness — project rules stay dormant until a regex matches the live token stream, then the request is aborted, the rule injected as a system reminder, and the request retried from the same point. Zero per-turn cont
安装
dsh plugin --profile web add github:hy-sde/dsh-stream-rules
需要可复现安装时,可在仓库后追加 #commit 固定提交。
Time-traveling stream rules for DeepSeek Harness — project rules stay dormant until a regex matches the live token stream, then the request is aborted, the rule injected as a system reminder, and the request retried from the same point. Zero per-turn cont
该插件未提供要点说明,请参考仓库 README。
- 安装并启动 DeepSeek Harness:
npx @deepseek-ai/dsh web - 在终端执行上面的安装命令(CLI 会解析插件并核验来源)
- 用 dsh plugins list 确认已安装,必要时重启 Harness 生效
插件以当前 dsh 进程的权限运行,安装时可能执行代码。请先通读仓库源码与许可证,确认无破坏性命令与越权访问;本站只做索引,不对第三方插件安全性作担保。
| 代码仓库 | github.com/hy-sde/dsh-stream-rules |
| 许可证 | 未标注(见仓库) |
| 主要语言 | main |
| 下载量 | 1 |
| GitHub 星标 | 0 |
| 最近推送 | 2026-08-22 |
| 收录日期 | 2026-09-19 |
| 分类 | 工具与能力 |
事实信息来自公开插件目录快照(2026-10-01),介绍文案由本站再加工。
以下为插件仓库 README 全文(原始内容,由公开目录抓取整理)。
# dsh-stream-rules — time-traveling stream rules for DeepSeek Harness
One standalone package, installable as a plugin for the DeepSeek Harness and
the CLI/web profiles:
| package | role | installed by users? |
|---|---|---|
| `@hy-sde-org/dsh-stream-rules` | behavioral guard plugin: project rules stay dormant until a regex matches the live token stream, then the turn is aborted, the rule injected as a system reminder, and the request retried from the same point | yes |
This is a parity port of oh-my-pi's Time-Traveling Stream Rules
(`TtsrManager` + stream guards) onto the harness behavioral-guard contract
(`session/event` stream observation, `agent.cancel({ kind: 'hook' })` +
`agent.followup(...)` for abort-and-retry, `tools/post-execute`
`additionalContexts` for non-interrupting tool rules). It works on stock
DeepSeek Harness releases with **zero upstream changes**.
**Why this exists.** The cost of a rule is paid only at the moment it is
violated — the rule never enters the request until the stream matches it, so
enforcement has zero per-turn context tax and survives compaction (there is
nothing to remember). Rules are plain Markdown files with a YAML frontmatter
block, kept per project under `/.dsh/rules/**/*.md`, re-scanned on every
turn start.
## Install
```bash
pnpm install --global @deepseek-ai/dsh
```
### Direct from npm (published)
The package is published on the npm registry under the `hy-sde-org`
organization (`@hy-sde-org/dsh-stream-rules`, version `0.1.1-rc.2`). Install
it straight from npm:
```bash
dsh plugin --profile web add @hy-sde-org/dsh-stream-rules
```
Installing the bundle alone never breaks boot and claims no name on the host
plane — the guard only does work when a mounted agent carries its row. Grant
per-agent rows through the provided [agent preset](#giving-agents-stream-rules).
### From the git checkout (pre-publish / development)
```bash
git clone git@github.com:hy-sde/dsh-stream-rules.git
cd dsh-stream-rules
pnpm install
pnpm -r build
dsh plugin --profile web link ../dsh-stream-rules/packages/stream-rules
```
### Verify
```bash
pnpm -r check && pnpm -r test && pnpm -r build
bash scripts/release-public.sh --check # clean tree + checks + tests + pack
```
### Uninstall
```bash
dsh plugin --profile web remove @hy-sde-org/dsh-stream-rules
```
## Giving agents stream rules
Mount one row in an agent preset you already use (or copy
[`examples/agent-preset/`](packages/stream-rules/examples/agent-preset/) to
`~/.dsh/.agent-presets//` and select it). The preset adds the
`stream-rules` row beside persona + agent-instructions:
```yaml
- id: stream-rules
name: '@hy-sde-org/dsh-stream-rules'
config:
contextMode: keep
interruptMode: always
repeatMode: once
```
Then drop rule files into each project: `/.dsh/rules/no-console.md`
```markdown
---
description: Never leave console logging behind
scope: [text, thinking, tool:edit, tool:write]
condition:
- console\.(log|debug)\(
interruptMode: always
---
Never leave `console.log` / `console.debug` output in committed code; use the
project's logging facility or remove the call.
```
Rules reload on the next turn start (mtime-gated), so editing a rule takes
effect without a restart.
## Security
Rules are local files you author and install; the guard runs them as regular
expressions against the model's own output inside your own agent process. See
[`SECURITY.md`](SECURITY.md) for the security posture and reporting.
## References
- Notebook: the port plan and omp upstream pointers — `port_omp.md` item 3
- Internal (for maintainers): the fork prototype at
`packages/guard/stream-rules/` in
`github.com/deepseek-ai/deepseek-harness` is the reference implementation
this standalone package mirrors.
数据来源:公开的 DeepSeek Harness 插件目录与各插件 GitHub 仓库。本站为独立第三方目录,与 DeepSeek、幻方(High-Flyer)及插件作者均无隶属或背书关系。