@deathbeam/pi-delegate

中文文档
0.0.40发布于 2026/11/02MITES Module零依赖近 30 天下载 3734

Minimal extension for delegating tasks to subagents.

原始使用文档
文档目录4 节
  1. Installation
  2. Configuration
  3. Isolation
  4. Development

@deathbeam/pi-delegate

Run subagents with delegate, delegate_list, delegate_steer, delegate_cancel, delegate_apply, and delegate_discard. Use /delegate command to inspect jobs in a full-screen TUI.

Installation

# Choose one:
pi install npm:@deathbeam/pi-delegate            # this package
pi install git:github.com/deathbeam/pi-packages  # all my packages

Configuration

Optional delegate settings live in ~/.pi/agent/settings.json or .pi/settings.json:

{
    "delegate": {
        "agentDirs": ["./.pi/agents"],
        "models": {
            "cheap": "anthropic/claude-haiku-5-5:low",
            "balanced": "anthropic/claude-sonnet-5-5:high",
            "strong": "anthropic/claude-opus-5-5:high"
        }
    }
}

Agents are Markdown files with frontmatter, the body becomes the child's system prompt:

---
name: scout
description: Explore the codebase
tools: read, grep
model: cheap
isolated: false
---

Explore the codebase and report relevant paths.
  • name is required and must be unique
  • descripion is required
  • tools is optional, a comma-separated list of tool names. Defaults to the session tools.
  • model is optional, a tier name or provider/model[:thinking]. Defaults to the session model.
  • isolated is optional, defaults to false. See Isolation.

Isolation

isolated: true (on a delegate call or in agent frontmatter) runs the delegate in its own git clone at .pi/worktrees/<id>, starting from your current working tree including uncommitted changes.

delegate_apply merges the result into your working tree as uncommitted changes. delegate_discard discards the clone and its changes.

Any later delegate can share that clone with clone: <job id>, for review, tests, or follow-up work.

Development

From this package directory:

npm install
npm test
pi install .

版本与发布记录

@deathbeam/pi-delegate 共发布 40 个版本,首次发布于 2026/09/25;过去 12 个月发布了 40 个版本。

版本发布日期距今
0.0.40latest2026/11/029 天前
0.0.392026/10/3013 天前
0.0.382026/10/2914 天前
0.0.372026/10/2715 天前
0.0.362026/10/2616 天前
0.0.352026/10/2616 天前

关于 @deathbeam/pi-delegate 的常见问题

@deathbeam/pi-delegate 是什么?

Minimal extension for delegating tasks to subagents.

如何安装 @deathbeam/pi-delegate?

在项目目录运行 npm install @deathbeam/pi-delegate,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@earendil-works/pi-tui(*)、@earendil-works/pi-coding-agent(*)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@deathbeam/pi-delegate 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/deathbeam__pi-delegate 是否存在。

@deathbeam/pi-delegate 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@deathbeam/pi-delegate 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.19.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@deathbeam/pi-delegate 可以商用吗?

@deathbeam/pi-delegate 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@deathbeam/pi-delegate 的下载量有多少?

根据 npm 官方下载统计,@deathbeam/pi-delegate 在 2026/10/12 – 2026/11/10 这 30 天内被下载 3,734 次,日均约 124 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@deathbeam/pi-delegate 还在维护吗?

最新版本 0.0.40 发布于 2026/11/02(9 天前);至今共发布 40 个版本,其中过去 12 个月发布了 40 个;首次发布于 2026/09/25。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。