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-goal-restart

v0.1.0

Published

Automatically re-arm active goals when the dsh service (re)starts, so the goal-round driver resumes rounds without human intervention.

Readme

dsh-goal-restart

当 dsh 服务(重新)启动时,自动重新武装(re-arm)持久化的同会话目标, 让 goal-round driver 无需人工干预即可自动续跑目标轮次。

为什么需要它? 当智能体正在做长期任务——比如开发它自己的插件——而它 所在的服务被重启(崩溃、launchd 自动拉起、主动重启)时,此前进行中的目标 会一直停在原处,直到有人执行 /goal resume。这个插件省掉了这一步。

问题背景

dsh 目标的持久化状态(objective、phase、revision、roundsStarted)保存在 会话日志中,可以跨重启存活。但它的激活状态("armed")刻意做成进程本地: 它从不持久化,而且每次 agent/session-start 边界都会解除武装(disarm)。 因此,当 dsh 服务重启后,进行中的目标会被回放为 active,但会一直停住, 直到有人显式恢复(resume)。

这个插件做什么

agent/session-startpayload.source === 'resume'(会话刚从持久化 存储重新加载)时,只要目标处于持久化的 active 状态且还有轮次预算,就调用 ctx.goals.resume(agent, ref)。随后内置的 goal-round-driver(由 dsh-base 挂载)会像普通的人类恢复那样预留并投递下一轮——只是这次不需要 任何人去点按钮。

策略(保守,一目了然)

| 场景 | 动作 | | ------------------------------------------------ | ----------------------------- | | 服务重启后会话重新加载,目标 active,预算充足 | 重新武装(ctx.goals.resume) | | 新会话启动(source: 'startup') | 跳过(无目标) | | Fork 出来的会话(继承父目标) | 跳过(进程内派生) | | 子代理会话(origin: subagent) | 跳过(进程内派生) | | 目标为 paused / blocked / complete | 跳过(以持久化阶段为准) | | 目标为 active 但已经 armed | 跳过(幂等) | | 目标已达 roundsStarted >= maxGoalRounds | 跳过(无预算——先调大上限再恢复)|

安装

dsh plugin --profile <profile> add dsh-goal-restart

然后重启 dsh 服务以加载新的 bundle。

禁用

在 profile 的 cordis.patch.yml 中加入:

- id: goal-restart
  disabled: true

说明

  • 重新武装会向会话日志写入一条持久的 resume 变更(revision +1)——这是领域 文档中规定的重新激活边界,与人工执行 /goal resume 写入的内容一致。
  • 轮次驱动的持久化与取消安全已由 round driver 处理;本插件只决定要不要继续, 不决定如何运行。
  • 会话在某个活体智能体加载它时才会恢复。在 Web GUI 中,这发生在重启后重新打开 会话时;重新武装就在那一刻发生,早于 driver 的第一个空闲检查点。
  • 该策略由 13 个纯内存单元测试(npm test)和一个 smoke 脚本(npm run smoke) 验证,都不需要网络和真实进程。

许可证

MIT