DSH Plugins Marketplace

DSH Plugins

Plugins

/

dsh-rtk

d

dsh-rtk

Manifest valid

Native DSH bundle that rewrites pwsh commands through RTK while preserving DSH execution policy.

hasBundlePatch

dsh-rtk — RTK (Rust Token Killer) 原生 DSH 插件

把本机 RTK(Rust Token Killer)以 DSH 原生插件 方式接入 DeepSeek Harness:模型通过 pwsh 工具执行的命令会被自动改写为 RTK 过滤版本(git status → rtk git status),压缩后的输出再返回给模型, 与 Claude Code / Codex 的 PreToolUse 钩子等价,模型无需显式写 rtk 命令。

原理

  • 拦截点:DSH 官方 tools/execute around-dispatch waterfall。该瀑布允许监听器 不调用 next() 而自行执行并返回结果(tools/pre-execute 刻意禁止改写参数, 因此这里是受支持的钩子位)。
  • 判定:rtk rewrite <command> 退出码 0/3 且输出非空 → 有 RTK 等价命令; 1(passthrough)或 2(deny)→ 原样执行,交还 DSH 自身的权限流程。
  • 执行:插件只调用 rtk rewrite 获取改写文本;随后将改写后的命令作为嵌套的 原生 pwsh 分发交回 DSH。cwd、sandbox、审批、超时、取消与终端卡片渲染均由 pwsh 工具自身负责。
  • 安全边界:run_in_background 调用、带 sandbox_permissions 的调用、命中 excludeCommands 前缀的命令一律原样放行;RTK 二进制缺失/崩溃时回退原始命令。

上游项目署名

dsh-rtk 是独立的 DSH 集成层,不包含、复制或再分发 RTK 的源码或二进制;它仅调用 用户本机已安装的 rtk CLI。RTK(Rust Token Killer)上游项目由 rtk-ai/rtk 提供,并采用 Apache-2.0 许可证。

安装

插件未发布到 npm。开发时可使用本地 link: 依赖;公开 GitHub 安装会从源码 执行本包的 prepare 构建脚本,因此只应安装可信、固定 commit 的版本。

# 1. 在插件目录构建
cd D:\AI\DeepSeek\plugins-split\dsh-rtk
pnpm install && pnpm build

# 2. 挂载到目标 profile(以 devtools-test 为例)
#    在 <profile>/package.json 的 dependencies 添加:
#      "dsh-rtk": "link:D:/AI/DeepSeek/plugins-split/dsh-rtk"
#    在 <profile>/package.json 的 dsh.profile.bundles 添加 "dsh-rtk"
#    在 <profile>/cordis.patch.yml 添加:
#      - id: rtk
#        name: dsh-rtk
#        config:
#          enabled: true
#          announceToAgent: true

挂载后重启 dsh web:模型后续的 pwsh 命令自动被 RTK 压缩。

从 GitHub 安装

# 使用发布后的不可变 commit;首次安装会提示 pnpm 允许执行 prepare。
dsh plugin --profile demo add github:dd2673/dsh-rtk#<commit-sha>

# 在 $DSH_HOME/profiles/demo/pnpm-workspace.yaml 中复制 pnpm 报错里打印的精确键,再重试 add。
allowBuilds:
  "dsh-rtk@https://codeload.github.com/dd2673/dsh-rtk/tar.gz/<commit-sha>": true

随后用 dsh --profile demo --dump-config 确认存在 dsh-rtk bundle 层,再启动或 重启该 profile。allowBuilds 允许安装时在本机执行本包源码,务必固定 commit 并先审查源码。

配置

键类型默认说明
enabledbooleantrue插件总开关
announceToAgentbooleantrue是否向 Agent 宣告插件
rtkBinstringrtkRTK 二进制路径(可用绝对路径)
askMode'rewrite' | 'passthrough'rewritertk rewrite 退出码 3(ask)时的处理
excludeCommandsstring[][]前缀匹配、永不重写的命令
interceptedToolsstring[]['pwsh']被拦截改写的工具名
defaultTimeoutMsnumber120000模型未指定 timeoutMs 时的超时

开发

pnpm install --filter dsh-rtk...
pnpm --filter dsh-rtk test
pnpm --filter dsh-rtk build

已知限制

  • 带 sandbox_permissions 的调用、后台调用及排除前缀的命令保持原样,不会改写。
  • tools/execute 钩子作用于顶层工具调用;插件自身发起的嵌套 pwsh 分发不会再次 改写,因此不会递归。run_code 等其他嵌套子调度不重写。
  • 会话日志记录原始工具参数(hook 语义与 Claude Code 一致,输出为压缩版)。
  • RTK 只覆盖其内置命令族;不支持的命令原样执行。

Comments

Loading…

Similar plugins

DSH-Rtk-rewrite

Replaces the web profile's pwsh shell executor with a subclass that rewrites every command through `rtk rewrite` before execution for token savings, running the original command unchanged on any rewri

Development & InfrastructureManifest valid

★ 0

MIT

JavaScript

dsh plugin --profile web add dsh-pwsh-rtk-rewrite

by robbin810130

Community DSH plugin that applies explicit RTK command-output filtering to bash tools at boot.

Development & InfrastructureManifest valid

★ 1

MIT

JavaScript

Oct 4, 2026

dsh plugin --profile web add @robbin810130/dsh-rtk

by DeepTrial

DeepSeek Harness bash executor plugin that routes eligible commands through rtk (Rust Token Killer) to compress tool output and save tokens.

Tools & CapabilitiesManifest valid

★ 13

↓ 164/wk

MIT

TypeScript

Aug 25, 2026

dsh plugin --profile agent add @deeptrial/dsh-bash-rtk

by CARVIN94

该仓库暂未提供项目说明。

Development & InfrastructureTools & CapabilitiesManifest valid

★ 3

↓ 103/wk

MIT

TypeScript

Oct 3, 2026

dsh plugin --profile web add dsh-router-ext-rtk

by anweat

Restart DSH: configurable restart method (Node native / legacy PowerShell), post-restart continue prompt, optional watchdog auto-relaunch.

Development & InfrastructureManifest valid

★ 8

↓ 434/wk

MIT

JavaScript

Sep 9, 2026

dsh plugin --profile web add dsh-restart

by better-er

Blocks edit/write writes that contain characters matching configurable regex rules, executed before the tool runs, with configurable messages and same-turn pwsh propagation; default rule matches full-

Development & InfrastructureManifest valid

★ 4

↓ 369/wk

MIT

TypeScript

Oct 2, 2026

dsh plugin --profile web add dsh-write-rule-guard