Pi skips sub-agents and plan mode.
This harness builds them.
Pi 刻意不做子代理和计划模式。
这个 harness 把它们全部补上。

Kimi Code-style agent orchestration for the Pi coding agent —
swarm, goal, plan, permission, ask, task, cron, todo, hooks, skills, and a boxed-editor TUI, in one coherent package.
为 Pi coding agent 打造的 Kimi Code 风格编排套件 —
Swarm、Goal、Plan、Permission、Ask、Task、Cron、Todo、Hooks、Skills 与闭合框编辑器,一个包全部集成。

$pi install npm:pi-muselinn-harness
swarm · live
$scroll to continue滚动继续▍

⬒ Swarm — real parallelism⬒ Swarm — 真正的并行

Concurrent subagents with a live braille-grid TUI. Real max_concurrency worker pool, progressive launch, 30-min timeouts, two-step /cancel, /resume, and a three-pane task browser (ctrl+shift+t).

盲文网格实时展示并行子代理。真实 max_concurrency worker 池、渐进投放、30 分钟超时、两步 /cancel、/resume,以及三栏任务浏览器(ctrl+shift+t)。

◎ Goal — finish what you start◎ Goal — 有始有终

/goal lifecycle with budgets (turns / tokens / wall-clock), a 3-turn blocked circuit breaker, a completion-criterion gate, FIFO queue, and session persistence.

/goal 目标生命周期:预算(轮次/token/墙钟)、连续 3 轮阻断熔断、完成判据门禁、FIFO 队列、会话级持久化。

✎ Plan — read-only first✎ Plan — 先谋后动

The LLM explores and writes a plan; execution waits for your approval. Kimi Code permission model — bash follows normal permission mode (auto/yolo/manual), only Write/Edit (outside plan file), TaskStop, Cron are blocked. Plan file accepts exact path, local:// basename, and resolved absolute path. plan badge on the editor border while active.

LLM 先探索代码库、写计划,审批后才执行。Kimi Code 权限模型——bash 走正常 permission mode(auto/yolo/manual),只拦截 Write/Edit(非 plan 文件)、TaskStop、Cron。Plan 文件支持精确路径、local:// 文件名、解析绝对路径三种匹配。激活时编辑器上边框显示 plan 徽标。

⛨ Permission — safety before speed⛨ Permission — 安全先于效率

An 18-level policy chain across auto / yolo / manual. Destructive commands always ask; .env / id_rsa never pass — even in auto mode. Plus background tasks and cron. The startup mode is declarative: an optional "defaultMode" in permissions.json (~/.pi/agent/ global or .pi/ project) sets it for fresh sessions.

18 级策略链,贯穿 auto / yolo / manual。破坏性命令每次必问,.env / id_rsa 永不放行——auto 模式也不例外。另有后台任务与 cron 定时。启动模式可声明式配置:在 permissions.json(全局 ~/.pi/agent/ 或项目 .pi/)中写入可选的 "defaultMode",新会话即从该模式开始。

⚡ Hooks — every lifecycle event⚡ Hooks — 全生命周期事件

Kimi Code-aligned [[hooks]] engine: 16 events, blockable PreToolUse / Stop / UserPromptSubmit, exit-code semantics, fail-open. Skills scanned across seven scopes, collision-free.

对齐 Kimi Code 的 [[hooks]] 引擎:16 个事件、可阻断的 PreToolUse / Stop / UserPromptSubmit、退出码语义、fail-open。Skills 七级作用域扫描,零冲突。

▭ TUI — the boxed editor▭ TUI — 闭合框编辑器

Kimi-style closed box (╭─╮ │ ╰─╯) with spinner and working state in the top border, three styles, hot-switch with /tui, and a render timing probe.

Kimi 式闭合框(╭─╮ │ ╰─╯),上边框嵌入 spinner 与工作状态,三种样式,/tui 热切换,内置渲染耗时探针。

❚❚ Pause — freeze, inspect, steer❚❚ Pause — 冻结、检视、转向

/pause freezes the main agent and every subagent at their next safe boundary — in-flight calls finish, nothing is aborted — behind a full-screen, theme-colored overlay with a live timer. Every subagent's conversation is recorded to wire.jsonl (view it with c in the task browser), and /steer <taskId> <msg> redirects a running subagent mid-flight.

/pause 在主代理与所有子代理的下一个安全边界冻结一切——进行中的调用跑完,什么都不中止——全屏主题色遮罩 + 实时计时。每个子代理的对话都落盘为 wire.jsonl(任务浏览器按 c 查看); /steer <taskId> <msg> 可在运行中转向子代理。

Quick start快速开始

Install安装

One command, zero companion extensions. Restart pi and you’re done.一条命令,无需任何伴随扩展。重启 pi 即可。

pi install npm:pi-muselinn-harness

Or from source: pi install git:github.com/MuseLinn/pi-muselinn-harness或源码安装:pi install git:github.com/MuseLinn/pi-muselinn-harness

Try it体验

Everything is a slash command or a model-callable tool — no config files to learn first.一切都是 slash 命令或模型可调用工具——无需先学习任何配置文件。

/swarm on                                # parallel sub-agents
/goal Refactor the auth module           # budget-tracked goal
/todo init "Phase 1: scanner"            # phased task plan
/plan                                    # read-only plan mode
/pause                                   # freeze; esc/enter/space/ctrl+c resumes
/tui style plain|boxed|compact           # switch editor chrome

Docs文档

Full feature walkthroughs, command/tool references, architecture, and tests live in the README (EN / 中).完整功能说明、命令/工具参考、架构与测试详见 README(EN / 中)。

New in 0.9.220.9.22 新功能

Type-layer hardening — full-package typecheck类型层加固 — 全包类型检查

The package now ships tsconfig.json + npm run typecheck (strict, es2024) wired into CI, clearing 158 type errors against pi 0.83 — and the new checker surfaced real runtime bugs: resources_discover injected subagent skills through an unimported function (the ReferenceError was swallowed by catch, so skills were silently missing), and todo cleanup was bound to a session_end event that pi 0.83 never emits (now session_shutdown). Dead usage fields are gone from every command definition, vision-model detection uses pi’s real Model type, and notify(..., "success") is typed via module augmentation.本包现在自带 tsconfig.json + npm run typecheck(strict, es2024)并接入 CI,清除了针对 pi 0.83 的 158 条类型错误——新检查器还暴露了真实运行时缺陷:resources_discover 通过未导入的函数注入子代理技能(ReferenceError 被 catch 静默吞掉,技能一直缺失)、todo 清理绑定到 pi 0.83 从不触发的 session_end 事件(现已改为 session_shutdown)。所有命令定义中的死字段 usage 已删除,视觉模型检测改用 pi 的真实 Model 类型,notify(..., "success") 通过模块增强补齐类型。

Previously — 0.9.21历史版本 0.9.21

RPC approvals & window-aware truncationRPC 审批与窗口感知截断

Approval dialogs now work in RPC hosts (obsidian-pi & other embedding clients): the same Allow once / Always allow / Deny / Deny with reason choices render over the extension UI protocol (select / input / confirm) instead of silently denying every edit (issue #4). The tool-result spill threshold now scales with the model’s context window (max(40k, window × 4 chars/token), capped at 800k chars ≈ 200k tokens), with PI_TRUNCATION_THRESHOLD as an explicit override — 1M-context models keep far more output in-context (issue #2).审批弹窗在 RPC 宿主(obsidian-pi 等嵌入客户端)中可用:允许一次 / 本会话始终允许 / 拒绝 / 拒绝并附原因,通过扩展 UI 协议(select / input / confirm)呈现,不再静默拒绝每次编辑(issue #4)。工具结果落盘阈值随模型上下文窗口缩放(max(40k, 窗口 × 4 字符/token),上限 800k 字符 ≈ 200k token),可用 PI_TRUNCATION_THRESHOLD 显式覆盖——1M 上下文模型可保留远多输出(issue #2)。

Previously — 0.9.20历史版本 0.9.20

Package hotfix — pause/ shipped打包修复 — pause/ 随包发布

The published tarball was missing the pause/ adapter directory and the extension failed to load (Cannot find module './pause/commands'); it is now part of the package (issue #3).发布的 tarball 缺少 pause/ 适配目录导致扩展加载失败(Cannot find module './pause/commands');现已纳入发布包(issue #3)。

Previously — 0.9.19历史版本 0.9.19

Freeze & steer — /pause · transcript · /steer冻结与转向 — /pause · transcript · /steer

/pause parks the main agent and every swarm subagent at their next safe boundary (tool-call gate): in-flight calls finish, nothing is aborted, release continues exactly where each loop parked — behind a full-screen overlay with a theme-colored pause glyph and a live hold timer (esc/enter/space/ctrl+c). Every subagent’s conversation is recorded to <sessionDir>/agents/<id>/wire.jsonl (no tool arguments), viewable with c in the task browser. /steer <taskId> <message> injects a message into a running subagent (swarm session or background task); the loop delivers it after the current tool call. Releasing leaves a status line in the session transcript./pause 把主代理与所有 swarm 子代理停在下一次安全边界(工具门卫):进行中的调用跑完、什么都不中止、释放后从挂起点继续——全屏遮罩,主题色暂停符号 + 实时计时(esc/enter/space/ctrl+c)。每个子代理的对话落盘 <sessionDir>/agents/<id>/wire.jsonl(不落工具参数),任务浏览器按 c 查看。/steer <taskId> <message> 向运行中的子代理注入消息(swarm 会话或后台任务),循环在当前工具调用后投递。释放时在会话流中留下状态行。

Previously — 0.9.18历史版本 0.9.18

0.9.18 — Persistent startup permission mode0.9.18 — 可持久化的启动权限模式

Set "defaultMode": "auto" | "yolo" | "manual" in permissions.json (global ~/.pi/agent/ or project .pi/, global wins on conflict) and every fresh session starts there — no more interactive /mode on each new session. Sessions with a recorded /mode history still restore the last used mode; defaultMode is the starting point for fresh sessions. Thanks @jason-in-hub for the contribution!在 permissions.json(全局 ~/.pi/agent/ 或项目 .pi/,冲突时全局优先)写入 "defaultMode": "auto" | "yolo" | "manual",每个新会话都从该模式开始——不再需要每次手动 /mode。记录过 /mode 历史的会话仍恢复上次使用的模式;defaultMode 是新会话的起始点。感谢 @jason-in-hub 的贡献!

All earlier release notes live on the更早的版本记录全部位于 changelog page更新日志页 — generated from CHANGELOG.md, so it always matches the latest release.— 由 CHANGELOG.md 自动生成,与最新发布始终保持一致。

Commands命令

/swarm on|off        /pause         /steer <taskId> <msg>   /cancel      /resume       /tasks (ctrl+shift+t)
/goal <objective>    /goal pause|resume|cancel|replace|budget|queue
/todo                /plan [on|off|clear] /mode        /tui style plain|boxed|compact

All commands support Tab completion for subcommands and arguments.所有命令均支持 Tab 子命令/参数补全。

Links链接