DeepSeek Harness Plugin Hub

Publish and manage complete Harness Profiles. Discover Plugins for your next setup.

Explore

PluginsPresetsDocsNews

Community

Publish a pluginContactReport an issue

Resources

Plugin Hub on GitHubDeepSeek HarnessSystem statusPrivacy notice
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

Independent and unofficial. Not affiliated with, authorized by, or endorsed by DeepSeek.

Time Travel — DSH Plugin for DeepSeek Harness
DeepSeek Harness Plugin Hub
ProfilesPluginsCategoriesNewsDocsSign inManage Profiles
ProfilesPluginsCategoriesNewsDocsSign in
← Plugins
T

dsh-time-travel

Time Travel

DeepSeek Harness (DSH) plugin: reversible time travel and auditing. Establishes a “pre-state snapshot → execute → compensate” chain for tool side effects, provides rewindTo(turnId) to restore the workspace in reverse turn order, and includes a built-in audit rules engine.

The plugin will be installed here. Keep web if you are unsure.

npx -y @deepseek-ai/dsh plugin --profile web add github:helibeiqi/dsh-time-travel#c8fa7d31119562a81c353afad03b0e09e385586c
READMECompatibilityVersions

Compatibility and provenance

Time Travel is published as dsh-time-travel and currently resolves to version 0.1.0. The Hub verifies its manifest and preserves the exact installation source for reproducible installs.

DSH compatibility
*
Runtime surfaces
any
Release source
github
Registry updated
8/20/2026

Versions

0.1.0stable
8/20/2026

Related plugins

Loading related plugins…

Latest
0.1.0
DSH
*
HMR
Process restart
Tree shaking
Safe tree shaking not declared
Unpacked size
Unavailable
Files
Unavailable
Surface
any
License
MIT
Source
github
GitHub
★ 1
Weekly downloads
0
Last push
8/28/2026
View source ↗
README badge

Click the badge to copy Markdown for your README.

Do you maintain this Plugin?Claim benefit · Priority security scan

Verify the GitHub repository declared in package.json to manage this listing. After you claim it, Hub will prioritize a security scan of the current version and publish the result when it passes.

Claim this Plugin →
Report an issue

Related plugins

More verified plugins in developer-tools.

Web App@deepseek-ai/dsh-web-appThe dsh browser-surface bundle: the web patch layer over dsh-base plus the runtime glue plugin (frontend dist serving, web-surface prompt, bash runtime variables, URL line)Sdk Minimal@deepseek-ai/dsh-sdk-minimalThe standalone minimal SDK profile bundle: JSON-RPC, one DeepSeek adapter, persistent shell, and JSONL sessionsSdk App@deepseek-ai/dsh-sdk-appThe dsh SDK profile bundle: stdio JSON-RPC serving and process lifecycle over dsh-baseSubagent Codex@deepseek-ai/dsh-subagent-codexOne-shot Codex subagent provider over the official app-server protocol

README

dsh-time-travel

给 DeepSeek Harness (DSH) 的 Cordis 插件:可逆时间旅行与审计 —— 为工具副作用建立「前状态快照 → 执行 → 补偿操作」链路,提供 rewindTo(turnId) 按轮次倒序恢复工作区,并内置审计规则引擎把危险操作落盘 audit-log.jsonl。

兼容 DSH 0.1.0-rc.6(cordis 4.x / schemastery 3.x)。请勿裸装 @latest,以本仓库版本为准。

功能定位

一句话:把"模型用工具改坏了工作区"这件事变得可逆且可审计。

  • 监听 tools/pre-execute / tools/result 工具管线事件,对 fs.write / fs.delete / bash / http.request 四类工具建立快照与补偿;
  • ctx.timeTravel.rewindTo(turnId):按轮次倒序执行补偿,恢复工作区到指定轮次之前;
  • 审计规则引擎:命中危险 shell、敏感路径写、不可补偿写操作后,追加一行 JSON 到 audit-log.jsonl;
  • 全部副作用经 ctx.on() 注册,插件卸载时自动撤销,不污染 dsh 工具管线(快照/审计失败都会被包含,绝不影响工具执行)。

安装

# 在插件工程根目录执行(本目录绝对路径)
dsh plugin --profile web add /absolute/path/to/dsh-time-travel

# 或手动打包安装(绕过 pnpm forwarder 时的等价路径)
npm pack && cd ~/.dsh/profiles/web && npm install /absolute/path/to/dsh-time-travel-0.1.0.tgz --no-save --no-audit --no-fund

安装后重启 dsh web(端口 3080)生效。插件挂载后:

  • ctx.timeTravel 可用(rewindTo / rewindAll / records / clear);
  • 当前目录生成 audit-log.jsonl(可用 audit.logPath 配置)。

配置

插件导出 schemastery Config,可在 dsh 的插件配置面板 / profile 中覆盖:

配置项类型默认值说明
turnGapMsnumber5000同一会话内两次工具调用超过该间隔(ms)则开启新轮次;0 = 每次调用独立成轮
audit.enabledbooleantrue是否启用审计规则引擎
audit.logPathstringaudit-log.jsonl审计日志输出路径(JSON Lines,相对 cwd)
audit.rulesdict<boolean>全部 true按规则 id 开关:dangerous-shell / sensitive-path-write / non-compensable-write / delete-whole-dir
watchToolsdict<kind>见下表工具名 → 补偿器类别映射
maxRecordsnumber10000内存保留的最大工具记录数(超出丢弃最旧;审计日志不受影响)
dryRunbooleanfalsetrue 时 rewind 只出报告、不实际执行补偿

watchTools 默认映射(按 DSH 0.1.0-rc.6 实际工具名 + 通用桥接名):

工具名补偿器类别可自动补偿
write / editfs-write✅ 恢复原内容 / 删除新建
deletefs-delete✅ 写回原内容
bashbash❌ 仅审计 + manual 提示
pwshbash❌ 仅审计(Windows 上 dsh 的 bash 工具实际注册名为 pwsh,PowerShell)
http.requesthttp❌ 仅审计

最小使用示例

import { Context } from '@deepseek-ai/cordis'
import { apply } from 'dsh-time-travel'

// 插件被 dsh 加载后,apply 已执行;以下仅为编程调用示例
const ctx: Context = /* dsh 注入的根 Context */

// 模型调用 write 覆盖了 a.txt 之后:
const report = await ctx.timeTravel.rewindTo('T3') // 撤销 T3 及之后所有工具副作用
// report: { requestedTurnId: 'T3', rewound: 2, skipped: 1, failed: 0, details: [...] }

// 查看当前记录(可按会话过滤)
const records = ctx.timeTravel.records('session-abc123')

// 全部回退
await ctx.timeTravel.rewindAll()

审计日志示例(audit-log.jsonl):

{"at":"2026-08-20T08:00:00.000Z","turnId":"T1","sessionId":"s1","callId":"c1","toolName":"bash","kind":"bash","isError":false,"hits":[{"ruleId":"dangerous-shell","severity":"critical","message":"bash 命令命中高危模式(rm -rf / mkfs / dd 写盘 / shutdown / curl|sh 等)"}],"command":"rm -rf /tmp/doomed"}

与 dsh-replay / dsh-turn-rewind 的差异

dsh-time-traveldsh-replaydsh-turn-rewind
关注对象工作区文件系统副作用的可逆补偿会话事件日志的重放(时序复现)会话状态按轮次的回退(消息层)
回滚手段工具调用级前状态快照 + 补偿操作(restore/delete)按日志重新派发事件截断 / 重建轮次内的消息
审计✅ 内置规则引擎(危险 shell / 敏感路径 / 不可补偿写)通常依赖日志本身视实现而定
对外 APIctx.timeTravel Service(rewindTo / records)重放驱动轮次回退 API
不可补偿操作显式标记 manual 并审计,交由人工处理重放无法改变历史副作用消息回退不触碰文件系统

一句话:dsh-replay / dsh-turn-rewind 处理的是"对话/会话怎么回到过去",本插件处理的是"工作区文件怎么回到过去",两者互补;对不可自动补偿的副作用(bash / http),本插件选择审计留痕 + 人工回滚而非冒险猜测。

开发

pnpm install
pnpm run check   # tsc --noEmit,严格模式零错误
pnpm run build   # tsc → lib/
pnpm test        # node --test(含 rewindTo 恢复文件的端到端事件测试)

License

MIT