npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-session-rerun

v0.1.1-rc.8

Published

DeepSeek Harness Host Remote for replaying one completed session step

Readme

dsh-session-rerun

English | 中文

dsh-session-rerun 是 Step 重演的 Host 插件。它从持久化来源 Session 读取一个已完成 Step,并创建一个独立 Session,从该 Step 之前继续执行。来源 Session 保持不变。这个包只使用公开的插件服务,不新增 Session 事件,也不修改 agent loop。

插件

这个零配置 Cordis 插件提供 Typert Remote 服务 sessionRerun/create

- id: session-rerun
  name: 'dsh-session-rerun'

Remote 请求包含 sourceSessionId,以及从一开始计数且为正数的 turnstep 坐标。插件通过 ctx.sessionPersistence 检查来源,校验配对的 step/startstep/end 事件,并在创建 Session 之前拒绝未完成或不存在的目标。

对于顶层来源,新 Session 会获得所选 step/start 之前的来源日志副本。插件将该前缀中的选定 Turn 以 interrupted 结束,再通过 ctx.agents.create() 启动一个普通的新 Turn。因此,它的 Turn 和 Step 编号按普通 Session 规则继续,不保留来源坐标。parentSession 仅记录重演来源,不设置 subagent 来源;如果来源直属某个 workspace,新 Session 也会附加到该 workspace。

对于直属 Subagent 子 Session 中选中的 Step,返回的 Session 改为原主 Agent 的新顶层续接,并加入原主 Session 所在的 workspace。插件通过子 Session 的持久化标签和创建时间区间定位历史委派,只在新主 Session 中重建这一次委派调用,再从所选子 Step 之前启动一个新的子 Session。子任务运行期间,新主 Session 会先打开并显示等待状态;子任务结束后,新输出会作为重建调用的工具结果写入,随后主 Agent 继续执行。旧主 Agent 和旧 Subagent 的结果只用于定位重演边界,不会作为新结果复制过去。

一条私有的空内容 plugin 消息用于唤醒新 Turn。在 agent/pre-step 阶段,如果所选 Step 中存在已记录的用户角色消息,插件会用它们替换该消息。没有已记录输入的工具续接 Step 会保留这条空消息,使普通 Agent API 能够接收并记录模型请求,同时不增加提示文本。

新 Session 会用当前 preset 注册表重新解析来源 Session 的 preset 名称,并挂载当前 preset 内容。所选 Step 之前最新的 request header 提供模型路由;如果前缀没有 request header,则使用当前默认选择。修改后的插件或 skill 重新加载后,重演会使用当前提示词、工具、skill 文件和 setup 行为,不复制旧进程状态。

模型体验

Step 重演

模型看到的内容

对于顶层重演,模型会看到所选 Step 之前的持久化来源历史、该 Step 中存在的 user/message 输入,以及重新组装的 agent 当前系统提示词和工具。对于没有已记录输入的 Step,模型请求会额外包含一条来源为 plugin:session-rerun 的空用户角色消息。对于 Subagent 重演,新子 Agent 会在当前主 Agent 组合下看到自己的持久化前缀和所选输入。子任务结束后,新主 Agent 会看到自己的前缀、历史委派 Step 的原始主 Agent 输入、唯一一次重建的委派调用,以及新子 Agent 的结果。

Token 影响

继承的历史和所选输入使用普通请求路径。当前提示词与工具 schema 的变化可能改变未缓存的输入 token 数量。零输入续接还会携带 provider 对一条空用户角色消息的表示。

KV Cache 影响

提供方、模型和渲染后的前缀未变化时,可以复用来源前缀。提示词或工具 schema 变化时,缓存可能从第一个变化片段开始失效。

已知限制与延期工作

  • 重演不会撤销来源 Session 已产生的文件写入、命令、网络请求或其他外部副作用。
  • 零输入工具续接原本在来源 Turn 内运行。由于公开 Agent API 没有无需输入的唤醒操作,插件会在新 Turn 中用一条已记录的空用户角色消息作为边界;它虽然不增加提示文本,但可能影响 provider 校验或缓存标识。
  • 历史 Subagent 重演要求能唯一定位一个直属父调用。缺少受支持描述符的子 Session、存在歧义的旧调用和嵌套 Subagent 子 Session 都会被明确拒绝,不会猜测父流程。
  • 持久化事件可以重建模型输入,但不会复制来源插件持有的任意进程内存。