From d0cab98f012e11aea23837aef209a188798e79c9 Mon Sep 17 00:00:00 2001 From: pi Date: Fri, 10 Apr 2026 23:53:39 +0100 Subject: [PATCH] chore: rename package to pi-subagents --- README.md | 14 ++++++++++---- package.json | 2 +- prompts/implement-and-review.md | 2 +- prompts/implement.md | 2 +- prompts/scout-and-plan.md | 2 +- src/package-manifest.test.ts | 4 ++-- src/tool.ts | 2 +- src/wrapper/render.mjs | 2 +- src/wrapper/render.test.ts | 5 +++-- 9 files changed, 21 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 455a3cf..9715fde 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ -# pi-tmux-subagent +# pi-subagents -`pi-tmux-subagent` is a Pi extension package that runs subagent tasks in tmux panes and ships the prompts and wrapper code needed to execute those runs. +`pi-subagents` is a Pi extension package that runs subagent tasks in separate child sessions and ships the prompts and wrapper code needed to execute those runs. ## Install Use it as a local package root today: ```bash -pi install /absolute/path/to/tmux-subagent +pi install /absolute/path/to/subagents ``` After this folder is moved into its own repository, the same package can be installed from git. @@ -17,9 +17,15 @@ After this folder is moved into its own repository, the same package can be inst - Extension: `./index.ts` - Prompts: `./prompts/*.md` +## Runner modes + +- default: background child process runner +- optional tmux runner: set `{"runner":"tmux"}` in `.pi/subagents.json` or `~/.pi/agent/subagents.json` + ## Requirements -- `tmux` must be available on `PATH` +- default process runner: no tmux requirement +- optional tmux runner: `tmux` must be available on `PATH` ## Development diff --git a/package.json b/package.json index fd804ef..6282b51 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "pi-tmux-subagent", + "name": "pi-subagents", "version": "0.1.0", "type": "module", "keywords": ["pi-package"], diff --git a/prompts/implement-and-review.md b/prompts/implement-and-review.md index 63724a0..e9d7854 100644 --- a/prompts/implement-and-review.md +++ b/prompts/implement-and-review.md @@ -1,5 +1,5 @@ --- -description: Implement, review, then revise using tmux-backed subagents +description: Implement, review, then revise using subagents --- Use the `subagent` tool in chain mode: diff --git a/prompts/implement.md b/prompts/implement.md index 37b8e9a..04b5238 100644 --- a/prompts/implement.md +++ b/prompts/implement.md @@ -1,5 +1,5 @@ --- -description: Scout, plan, and implement using tmux-backed subagents +description: Scout, plan, and implement using subagents --- Use the `subagent` tool to handle this request in three stages: diff --git a/prompts/scout-and-plan.md b/prompts/scout-and-plan.md index cd8b0db..7e14e39 100644 --- a/prompts/scout-and-plan.md +++ b/prompts/scout-and-plan.md @@ -1,5 +1,5 @@ --- -description: Scout the codebase, then produce a plan using tmux-backed subagents +description: Scout the codebase, then produce a plan using subagents --- Use the `subagent` tool in chain mode: diff --git a/src/package-manifest.test.ts b/src/package-manifest.test.ts index 509fdce..d5f6238 100644 --- a/src/package-manifest.test.ts +++ b/src/package-manifest.test.ts @@ -7,8 +7,8 @@ import { fileURLToPath } from "node:url"; const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), ".."); const pkg = JSON.parse(readFileSync(resolve(packageRoot, "package.json"), "utf8")); -test("package.json exposes pi-tmux-subagent as a standalone pi package", () => { - assert.equal(pkg.name, "pi-tmux-subagent"); +test("package.json exposes pi-subagents as a standalone pi package", () => { + assert.equal(pkg.name, "pi-subagents"); assert.equal(pkg.type, "module"); assert.ok(Array.isArray(pkg.keywords)); assert.ok(pkg.keywords.includes("pi-package")); diff --git a/src/tool.ts b/src/tool.ts index be1a840..750b01b 100644 --- a/src/tool.ts +++ b/src/tool.ts @@ -77,7 +77,7 @@ export function createSubagentTool(deps: { return { name: "subagent", label: "Subagent", - description: "Delegate tasks to specialized agents running in tmux panes.", + description: "Delegate tasks to specialized agents running in separate child sessions.", parameters: deps.parameters ?? SubagentParamsSchema, async execute(_toolCallId: string, params: any, _signal: AbortSignal | undefined, onUpdate: any, ctx: any) { const hasSingle = Boolean(params.agent && params.task); diff --git a/src/wrapper/render.mjs b/src/wrapper/render.mjs index b2656e9..d4eb9c8 100644 --- a/src/wrapper/render.mjs +++ b/src/wrapper/render.mjs @@ -4,7 +4,7 @@ function shortenCommand(command) { export function renderHeader(meta) { return [ - "=== tmux subagent ===", + "=== subagent ===", `Agent: ${meta.agent}`, `Task: ${meta.task}`, `CWD: ${meta.cwd}`, diff --git a/src/wrapper/render.test.ts b/src/wrapper/render.test.ts index e3b22d0..99a71e4 100644 --- a/src/wrapper/render.test.ts +++ b/src/wrapper/render.test.ts @@ -2,7 +2,7 @@ import test from "node:test"; import assert from "node:assert/strict"; import { renderHeader, renderEventLine } from "./render.mjs"; -test("renderHeader prints the key wrapper metadata", () => { +test("renderHeader prints generic subagent metadata", () => { const header = renderHeader({ agent: "scout", task: "Inspect authentication code", @@ -12,12 +12,13 @@ test("renderHeader prints the key wrapper metadata", () => { sessionPath: "/repo/.pi/subagents/runs/run-1/child-session.jsonl", }); + assert.match(header, /^=== subagent ===/m); assert.match(header, /Agent: scout/); assert.match(header, /Task: Inspect authentication code/); assert.match(header, /Session: \/repo\/\.pi\/subagents\/runs\/run-1\/child-session\.jsonl/); }); -test("renderEventLine makes tool calls readable for a tmux pane", () => { +test("renderEventLine makes tool calls readable for subagent transcript output", () => { const line = renderEventLine({ type: "tool_call", toolName: "bash",