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

@zhushanwen/pi-subagent-workflow

v7.3.3

Published

Unified subagent execution and multi-agent workflow orchestration for Pi — spawned-process agent runtime with sync/background modes, stateful workflow management with persistence, state machine, and execution tracing.

Readme

@zhushanwen/pi-subagent-workflow

Pi 的 subagent + workflow 合并包:任务委派 + 多 agent 编排(chain / parallel / scatter-gather / map-reduce),单包统一执行链 + 分层配额(ADR-030)。

内置 Agents

| Agent | 角色 | 是否执行 | |-------|------|---------| | context-builder | 模糊需求 → 可执行规格(meta-prompt) | 只写 what | | planner | 已明确需求 → 有序实施步骤 | 只写 how | | explorer | 代码库结构摸底(只读) | 不改文件 | | researcher | 外部资料 / 竞品 / 文档调研 | 不改文件 | | worker | 编码 / 修复 / 文件操作 | 可改文件 | | reviewer | 代码质量审查、找 bug | 只读 | | oracle | 需求对齐核验 | 只读 | | orchestrator | 纯协调器:拆解 + 委派,不直接执行 | 只协调 | | general-purpose | 兜底,无角色假设 | 按需 |

Orchestrator 协调器模式

主 agent 禁用 bash / read / write / edit 等执行工具,只保留协调类工具,被迫作为纯协调器:拆解任务 → 委派 subagent → 汇总结果。orchestrator agent 自身也可递归委派子 orchestrator,实现分层任务拆解(深度受 Depth: N/10 护栏保护)。

可用工具仅 4 个:todogoal_controlworkflowsubagent

启动命令

# 方式一:CLI 工具白名单(临时验证最快)
pi --tools todo,goal_control,workflow,subagent

# 方式二:白名单 + 注入 orchestrator 的 system prompt(推荐,主进程也具备协调器视角)
pi --tools todo,goal_control,workflow,subagent \
   --append-system-prompt "$(cat ~/.pi/agent/npm/node_modules/@zhushanwen/pi-subagent-workflow/agents/orchestrator.md)"

依赖:需先安装本包及相关扩展

pi install npm:@zhushanwen/pi-subagent-workflow
pi install npm:@zhushanwen/pi-todo
pi install npm:@zhushanwen/pi-goal

--tools 白名单按 tool 注册名匹配。注意 goal 扩展注册的 tool 名是 goal_control(非 goal)。

递归深度

系统内置 n = 10 深度护栏(fork 链 + 嵌套取 max),超过抛 ForkDepthExceededError。实测建议控制在 3-4 层以内——更深层会因上下文逐层压缩导致信息失真。

安装

pi install npm:@zhushanwen/pi-subagent-workflow

License

MIT