DSH Plugins Marketplace

DSH Plugins

Plugins

/

dsh-plugin-sleep

H

dsh-plugin-sleep

Manifest valid9

向模型暴露 sleep 工具,按指定毫秒暂停执行后返回,支持取消/clamp | Exposes a sleep tool that pauses for specified ms then returns, with cancellation/clamping

hasBundlePatch

dsh-plugin-sleep card

dsh-sleep

npm version

DSH 插件:向模型暴露一个 sleep 工具,让模型按指定毫秒数暂停执行后再返回。适合等待时间相关条件成立(服务重启、debounce 窗口、retry backoff)且没有事件型工具可用的场景。

安装

# 从 npm 安装(推荐):
dsh plugin --profile web add @huanlin/dsh-plugin-sleep

# 从本地 checkout 开发安装:
dsh plugin --profile web add link:D:\Projects\deepseek-harness\dsh-sleep

预构建策略:lib/ 入库,无 prepare 脚本,npm 安装开箱即用,无需 allowBuilds

配置

在 DSH GUI 设置页或 cordis.patch.yml 中配置:

| 字段 | 类型 | 默认值 | 说明 | |------|------|--------|------| | maxDurationMs | number | 60000 | 单次 sleep 上限毫秒数。超过会被 clamp 到此值,并在返回中标 clamped: true。 | | defaultDurationMs | number | 0 | 当模型省略 duration_ms 时的回退值。 |

工具

sleep

暂停 N 毫秒后返回。

参数:

| 参数 | 类型 | 必填 | 说明 | |------|------|------|------| | duration_ms | integer | 是 | 暂停毫秒数,必须 ≥ 0。超过 maxDurationMs 会被 clamp。 | | reason | string | 否 | 人类可读的暂停理由,会原样回显。 |

返回(规范 JSON):

{
  "requested_ms": 1000,   // 调用方原始请求值
  "actual_ms": 1002,      // 实际等待毫秒数
  "cancelled": false,     // 是否被 abort 信号中断
  "clamped": false,       // 是否因超过 maxDurationMs 被钳制
  "reason": "..."         // 可选回显
}

取消语义:如果 sleep 中途 exec.signal 被 abort,工具不抛错,而是立即返回 cancelled: true(取消属于业务非理想态,不属基础设施失败,参见 plugin-development-guide.md §3 C5)。

开发

pnpm install          # 安装开发依赖(schemastery、typescript、vitest)
pnpm run typecheck    # tsc --noEmit 类型检查
pnpm test             # vitest run 单元测试
pnpm run build        # tsc + tsdown → lib/

检查

合规自检(参见 plugin-development-guide.md §10):

  • [x] 零源码 patch:未修改 DSH checkout 任何文件
  • [x] B1: package.json 声明 dsh.bundle.patch
  • [x] B2: 插件自带 cordis.patch.yml(insert 行 id/name/config 齐全)
  • [x] B3: patch 行 name 用包名(Loader 从 profile node_modules 解析)
  • [x] F1: fileslib/ + cordis.patch.yml
  • [x] F2: peerDependencies 含 cordis + @deepseek-ai/dsh-tools(不用 devDependencies 冒充)
  • [x] F3: typecheck/test/build script 齐全
  • [x] A4: Config 用 Schemastery schema
  • [x] A6: 不导出 default
  • [x] C4: 工具返回规范 JSON 值 + render 投影分离
  • [x] C6: 尊重 exec.signal 取消在途工作
  • [x] G: Unit 测试(tests/tools.spec.ts,35+ 用例)

目录结构

dsh-sleep/
├── src/
│   ├── index.ts        # 入口:name、inject、Config(Schemastery)、apply
│   ├── tools.ts        # sleep 工具定义 + 可取消等待逻辑 + render 投影
│   └── types.d.ts      # @deepseek-ai/dsh-tools + cordis 的环境类型声明
├── tests/
│   └── tools.spec.ts   # 单元测试(覆盖正常/取消/clamp/边界)
├── cordis.patch.yml    # bundle 层:插入 dsh-sleep 插件行
├── package.json        # dsh.bundle.patch 声明 + peerDeps
├── tsconfig.json       # NodeNext、ES2022、strict
├── tsdown.config.ts    # 单 entry(host-only,无 client bundle)
└── vitest.config.ts    # vitest forks pool

Compatibility

DSH 0.1.5-rc.2: failedDSH 0.1.6-alpha.1: errorDSH 0.1.5-rc.1: errorDSH 0.1.5-alpha.2: errorDSH 0.1.5-alpha.1: errorDSH 0.1.3-alpha.2: errorDSH 0.1.2-rc.1: errorDSH 0.1.2-alpha.5: errorDSH 0.1.2-alpha.4: errorDSH 0.1.2-alpha.3: errorDSH 0.1.2-alpha.2: error

Versions

Latest versionPublishedSize
0.1.0
0.1.1
0.1.2
0.1.3
0.1.4
0.1.5

Similar plugins

dsh-llm-error-retry

LLM request retry plugin for DeepSeek Harness: when a model request fails with a configured HTTP status code, machine code, or provider field=value match, it sleeps for the per-rule delay and re-issue

Models & ProvidersManifest valid

0

dsh plugin --profile web add dsh-llm-error-retry

by Kazusa1085

DSH插件:提供“模型能力”设置页面,用于声明模型输入模态、上下文窗口、输出上限及图像配额,无需手动编辑 `settings.yaml` 文件。

Manifest valid

0

MIT

JavaScript

Sep 9, 2026

dsh plugin --profile web add dsh-awesome-model-setting

by edusrez

Wakes the main agent after any DSH restart so interrupted work resumes automatically — adds a restart tool and an optional canary that validates the boot and warns instead of breaking.

Development & InfrastructureManifest valid

6

MIT

JavaScript

Sep 11, 2026

dsh plugin --profile web add dsh-smart-restart

by DosterBool

Tell DeepSeek:快捷键打断当前生成,载入纠偏提示(steer 注入);继续时思考链回填以可折叠上下文行呈现

Manifest valid

0

JavaScript

Aug 22, 2026

dsh plugin --profile web add dsh-shutup

by HuanLinOTO

模型回合结束后用 LLM 生成 3 条批判性跟进建议,点击即发送 | After a model turn, an LLM generates 3 critical follow-up suggestions shown as click-to-send chips

Tools & CapabilitiesManifest valid

10

NOASSERTION

TypeScript

Sep 3, 2026

dsh plugin --profile web add @huanlin/dsh-plugin-auto-blame

by inmny

为 DeepSeek Harness 增加一个直接续跑按钮。当会话异常结束时,可以从现有上下文继续执行,不会引入其他提示词。

Manifest valid

3

MIT

JavaScript

Sep 11, 2026

dsh plugin --profile web add dsh-plugin-continue