@fitchmultz/pi-subagents

中文文档
0.52.40发布于 2026/11/15MITTypeScriptES Module零依赖构建来源已验证近 30 天下载 1万

Pi extension for subagent orchestration and local session coordination

原始使用文档
文档目录5 节
  1. Talk to agents
  2. Bundled skills
  3. Watch agents without prompting them
  4. What stays explicit
  5. Migration and documentation

pi-subagents

One Pi extension for delegation and local agent communication. Three tools, one agent type, no profile bodies.

pi install npm:@fitchmultz/pi-subagents

A main session supplies the child's complete assignment:

delegate({
  prompt:
    "Inspect the authentication changes. Return concrete defects with file and line evidence. Do not edit files.",
  name: "auth-review",
  thinking: "low",
});

Delegation is always asynchronous: tools return a receipt and the completion arrives later as a notification. Do other work or end the turn; do not poll. context: "fresh" is the default; context: "fork" preserves the native conversation, including prior tool results. There is no hidden role prompt, report-writing suffix, profile selection, or model fallback catalog. Optional thinking sets the child's effort without changing the parent. Omit it to inherit parent effort. Pi clamps the request to the child's model capabilities. Guidance and saved continuations keep the child's saved effort.

agent_runs({ action: "list" });
agent_runs({ action: "inspect", id: "<run-id>" });
agent_runs({
  action: "continue",
  id: "<run-id>",
  prompt: "Now inspect the refresh-token path. Do not edit.",
});
agent_runs({ action: "stop", id: "<run-id>" });

Talk to agents

intercom({ action: "list" });
intercom({ action: "send", to: "auth-review", message: "Focus on token rotation." });
intercom({ action: "last", to: "auth-review" });

send steers by default. last reads the peer's last completed assistant response without waking it; large responses are paged, not silently truncated. Discovery works across project directories and Pi agent directories under the same OS user.

A main and its children form one group:

  • Every pair within that group can discover and communicate with each other.
  • Main sessions can discover, message, and read other mains.
  • Children cannot discover or address another group's agents—even by exact ID.
  • Only mains can delegate. There is one child level, not recursive spawning.

These are coordination rules, not an OS sandbox against same-user code. A peer list contains connected, eligible sessions, not every Pi process on the machine.

Non-model Node.js companions can import @fitchmultz/pi-subagents/intercom-client for discovery, exact guarded sends, pinned last-response pages and original-message receipts. The supported client API connects only to an existing broker; it loads no Pi SDK, model, TUI or conversation journal.

Bundled skills

The package ships two skills that match tool availability. pi-subagents covers delegate and agent_runs, which only main sessions receive. pi-intercom covers intercom, which every session has, including children and mains that never delegate. Load either with /skill:pi-subagents or /skill:pi-intercom.

Watch agents without prompting them

In interactive Pi, an above-editor widget names individual children with circle indicators. The widget lists active work (and unreadable runs) only and disappears once a full scan finds none. The /agents picker hides completed runs; failed, stopped, interrupted, and unavailable runs remain visible there. Click a named row in fullscreen mode to watch it; /agents remains the keyboard path. Long result/message cards are collapsed and use Pi's native expansion (Ctrl+O by default). Ctrl+O also expands model/cwd details. Use /agents <run-id> to watch any saved run, including a completed child's native published text, tool calls and results. This is read-only: it neither spends a model turn nor dispatches, steers or stops work. Unpublished provider token deltas are not a journal stream. Agents still own delegation and communication; human observation is not a second workflow UI.

What stays explicit

Completions steer an active parent at the next tool boundary. An idle completion backlog is published in order and starts one parent turn, not one turn per result.

Launch acceptance is not completion. Broker acceptance is not recipient journal persistence or a reply. A stop request is not proof of process exit. Saved run inspection reports these states separately, and does not invent a successful result when a process disappears.

Children use native Pi sessions and the selected host's SDK, resources, tools, project instructions, and model configuration. Optional cwd and model overrides belong to a launch; ordinary continuation reuses its saved conversation and launch configuration. No user agent Markdown files are edited or consulted as profiles. On a fitchmultz/pi fork with the toolExposure setting, subagents.toolExposure keeps tools that children rarely need out of their requests.

Migration and documentation

This rebuild deliberately removes the profile editor, workflow/chain/fanout DSL, Claude Code backend, custom agent overlays, supervisor-question revival protocol, and remote launch/control/catalog APIs. Grok bots retain messaging but lose remote spawn/resume/session/transcript/group/broadcast access; those retired commands are not bridge-outage symptoms. Update saved bot prompts/routines to correlated send before cutover.

Existing installations must finish in-flight work and reload every participating Pi session onto the same approved version before resuming remote traffic. Old and new brokers do not forward across namespaces. Keep the prior package and saved state for rollback; qualify the helper and Box client/worker as an immutable pair, with the companion's offline receipt-reconciliation gate. This repository change does not deploy or restart anything.

Upgrades leave the retired SQLite history index in place. The packaged opt-in offline archive command preserves its complete recovery set after owner-enforced quiescence and observable safety checks. It never runs during startup/install, deletes data, or reclaims disk space.

Supports official Pi and the maintained fitchmultz/pi fork at 1.5.2 or later; the two hosts are qualified separately, including native Android/Termux. Node.js is required; see development prerequisites. Source installs on Android also need an Android-native tsgo on PATH; the prebuilt npm package does not need a compiler. See native Android/Termux. MIT licensed.

版本与发布记录

@fitchmultz/pi-subagents 共发布 56 个版本,首次发布于 2026/10/06;过去 12 个月发布了 56 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.52.40latest2026/11/15今天
0.52.392026/11/132 天前
0.52.382026/11/122 天前
0.52.372026/11/122 天前
0.52.362026/11/113 天前
0.52.352026/11/113 天前

关于 @fitchmultz/pi-subagents 的常见问题

@fitchmultz/pi-subagents 是什么?

Pi extension for subagent orchestration and local session coordination

如何安装 @fitchmultz/pi-subagents?

在项目目录运行 npm install @fitchmultz/pi-subagents,或使用 pnpm add / yarn add / bun add。

@fitchmultz/pi-subagents 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@fitchmultz/pi-subagents 支持 ESM 还是 CommonJS?

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

@fitchmultz/pi-subagents 需要什么版本的 Node.js?

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

@fitchmultz/pi-subagents 可以商用吗?

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

@fitchmultz/pi-subagents 的下载量有多少?

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

@fitchmultz/pi-subagents 还在维护吗?

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