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-batch-pipeline

v0.1.0

Published

Batch task pipeline for DeepSeek Harness: a cross-session batch ledger with progress pointer, budget guard, and product assertions — model-facing tools plus a per-step progress injection.

Readme

dsh-batch-pipeline

DeepSeek Harness(DSH)的批量任务流水线插件:一批活(50 篇范文、60 个年份的 PDF、100 条文案),交给 agent 逐项干,它帮你记进度、断了接着跑、超预算喊停、干完验货。

English

解决什么问题

你经常让 agent 干"一大批同类活"。这些活的共同点是:一个会话跑不完——50 篇范文写到第 30 篇,会话断了/重启了,进度全丢,从头再来。

dsh-batch-pipeline 就是给这种活一条"轨道":

  • 把清单交给它,它记着写到第几篇了
  • 会话断了重启,它告诉你从哪接着跑
  • 预算花超了,它喊停,不让你闷头烧钱
  • 每篇写完它验货(文件存在吗、非空吗),不合格记下来

为什么不自己数文件(先说这个)

你可能想问:插件不能自己扫目录数文件吗,为什么要 agent 主动报告?

因为"写完了"不等于"文件在"。agent 可能写了一半、可能存错路径、可能写进内存没落盘——插件扫目录只能看到"有没有",看不到"干完没有"。所以设计成 agent 每完成一项主动喊一声"我干完第 N 项了,产物在这",插件记一笔。喊得对(序号对得上)就推进,喊得不对就拒绝并告诉它"你现在该干第几项"。

功能

  • 批量清单:一次创建,列出所有要干的活(≤200 项)。每项就是一句话,agent 自己理解。
  • 进度追踪:每项完成主动报告,进度持久化,重启不丢。
  • 断点续跑:会话断了,新会话一句"继续",从上次进度接着干。
  • 预算熔断:预估每项成本,累计超预算自动暂停,防止烧穿。
  • 产物验货:每项报告时检查产物存在 + 非空,不达标记 failed,不静默放行。
  • 阶段自动流转:干完最后一项自动进入"收尾阶段",做完汇编(打包/合并/索引)归档。

工具

| 工具 | 用途 | |---|---| | batch_create | 建任务:名字 + 清单 + 预算(可选) + 验货规则(可选) | | batch_status | 查进度:干到第几项、花了多少、预计总额、最近失败 | | batch_report | 报告一项完成:第几项 + 成功/失败 + 产物路径 | | batch_pause | 暂停 | | batch_resume | 继续(重启后用 takeover=true 接管) | | batch_finish | 收尾归档:返回成功/失败统计 |

安装

⚠️ 尚未发布到 npm。用 file: 协议从本地路径安装。

# 1. 给 profile 加依赖
cd ~/.dsh/profiles/<名字>
pnpm add dsh-batch-pipeline@file:/path/to/dsh-batch-pipeline
# 2. 在 agent preset 里加一行(~/.dsh/.agent-presets/<preset>/agent.cordis.yml)
- id: batch
  name: 'dsh-batch-pipeline'
# 3. 重启 DSH

不用 preset?挂到 profile 的 host 平面(~/.dsh/profiles/<名字>/cordis.patch.yml):

- insert:
    - id: batch
      name: 'dsh-batch-pipeline'

前置条件:profile 里已挂存储三件套(dsh-storagedsh-storage-jsondsh-storage-domain——web profile 自带)。

用法示例

写 50 篇范文:

batch_create name=普通话范文 items=[话题1, 话题2, ..., 话题50] minBytes=500
# 每写完一篇:
batch_report itemIndex=当前序号 ok=true product=范文/话题N.md
# 全部写完自动进入收尾:
batch_finish

下载 60 年真题:

batch_create name=IMO真题 items=[1959, 1960, ..., 2026]
# 每年下载完:
batch_report itemIndex=当前序号 ok=true product=IMO/2024/IMO_2024_chs.pdf
batch_finish

配置

| 配置项 | 默认 | 说明 | |---|---|---| | budgetUsd | 5 | 预算上限(美元,估算) | | injectEnabled | true | 每轮注入批量进度(当前项/预算) |

预算怎么算(数字说明)

  • 估算公式:每项成本 ≈ (清单项字数 + 注入摘要字数) ÷ 4 × 输入单价 + 产物字节数 ÷ 4 × 输出单价
  • 4 字符 ≈ 1 token(中英混合近似);单价按 DSH flash 档(input $0.14/M、output $0.28/M)
  • 估算有 ±50% 误差,是量级参考不是精确账;真正超了预算会硬性暂停
  • 你当前的批量任务(50 篇范文)实际成本约 $0.03–0.06,预算闸是防"意外跑飞",不是日常开销跟踪

边界(v0.1)

  • 单任务同时进行:创建新 batch 前需先 finish/pause 当前任务
  • 清单 ≤200 项:更大的清单(v0.2)走 JSON 文件引用
  • 单会话推进:两个会话同时 report 会乱序,新会话续跑要 takeover=true
  • 无 UI:进度靠工具查询 + 每轮注入,界面面板(v0.2)

开发

npm install && npm run build && npm test   # 构建 + 32 个单元测试
npm run smoke                              # 真机 headless 验证(含跨会话断点续跑)

许可证

MIT