chore: rename package to pi-subagents
This commit is contained in:
14
README.md
14
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
|
## Install
|
||||||
|
|
||||||
Use it as a local package root today:
|
Use it as a local package root today:
|
||||||
|
|
||||||
```bash
|
```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.
|
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`
|
- Extension: `./index.ts`
|
||||||
- Prompts: `./prompts/*.md`
|
- 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
|
## Requirements
|
||||||
|
|
||||||
- `tmux` must be available on `PATH`
|
- default process runner: no tmux requirement
|
||||||
|
- optional tmux runner: `tmux` must be available on `PATH`
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "pi-tmux-subagent",
|
"name": "pi-subagents",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"keywords": ["pi-package"],
|
"keywords": ["pi-package"],
|
||||||
|
|||||||
@@ -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:
|
Use the `subagent` tool in chain mode:
|
||||||
|
|
||||||
|
|||||||
@@ -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:
|
Use the `subagent` tool to handle this request in three stages:
|
||||||
|
|
||||||
|
|||||||
@@ -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:
|
Use the `subagent` tool in chain mode:
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import { fileURLToPath } from "node:url";
|
|||||||
const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
||||||
const pkg = JSON.parse(readFileSync(resolve(packageRoot, "package.json"), "utf8"));
|
const pkg = JSON.parse(readFileSync(resolve(packageRoot, "package.json"), "utf8"));
|
||||||
|
|
||||||
test("package.json exposes pi-tmux-subagent as a standalone pi package", () => {
|
test("package.json exposes pi-subagents as a standalone pi package", () => {
|
||||||
assert.equal(pkg.name, "pi-tmux-subagent");
|
assert.equal(pkg.name, "pi-subagents");
|
||||||
assert.equal(pkg.type, "module");
|
assert.equal(pkg.type, "module");
|
||||||
assert.ok(Array.isArray(pkg.keywords));
|
assert.ok(Array.isArray(pkg.keywords));
|
||||||
assert.ok(pkg.keywords.includes("pi-package"));
|
assert.ok(pkg.keywords.includes("pi-package"));
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ export function createSubagentTool(deps: {
|
|||||||
return {
|
return {
|
||||||
name: "subagent",
|
name: "subagent",
|
||||||
label: "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,
|
parameters: deps.parameters ?? SubagentParamsSchema,
|
||||||
async execute(_toolCallId: string, params: any, _signal: AbortSignal | undefined, onUpdate: any, ctx: any) {
|
async execute(_toolCallId: string, params: any, _signal: AbortSignal | undefined, onUpdate: any, ctx: any) {
|
||||||
const hasSingle = Boolean(params.agent && params.task);
|
const hasSingle = Boolean(params.agent && params.task);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ function shortenCommand(command) {
|
|||||||
|
|
||||||
export function renderHeader(meta) {
|
export function renderHeader(meta) {
|
||||||
return [
|
return [
|
||||||
"=== tmux subagent ===",
|
"=== subagent ===",
|
||||||
`Agent: ${meta.agent}`,
|
`Agent: ${meta.agent}`,
|
||||||
`Task: ${meta.task}`,
|
`Task: ${meta.task}`,
|
||||||
`CWD: ${meta.cwd}`,
|
`CWD: ${meta.cwd}`,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import test from "node:test";
|
|||||||
import assert from "node:assert/strict";
|
import assert from "node:assert/strict";
|
||||||
import { renderHeader, renderEventLine } from "./render.mjs";
|
import { renderHeader, renderEventLine } from "./render.mjs";
|
||||||
|
|
||||||
test("renderHeader prints the key wrapper metadata", () => {
|
test("renderHeader prints generic subagent metadata", () => {
|
||||||
const header = renderHeader({
|
const header = renderHeader({
|
||||||
agent: "scout",
|
agent: "scout",
|
||||||
task: "Inspect authentication code",
|
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",
|
sessionPath: "/repo/.pi/subagents/runs/run-1/child-session.jsonl",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
assert.match(header, /^=== subagent ===/m);
|
||||||
assert.match(header, /Agent: scout/);
|
assert.match(header, /Agent: scout/);
|
||||||
assert.match(header, /Task: Inspect authentication code/);
|
assert.match(header, /Task: Inspect authentication code/);
|
||||||
assert.match(header, /Session: \/repo\/\.pi\/subagents\/runs\/run-1\/child-session\.jsonl/);
|
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({
|
const line = renderEventLine({
|
||||||
type: "tool_call",
|
type: "tool_call",
|
||||||
toolName: "bash",
|
toolName: "bash",
|
||||||
|
|||||||
Reference in New Issue
Block a user