@rol1n/subagent 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +7 -7
- package/extensions/subagent/README.md +0 -35
- package/extensions/subagent/skills/subagent/SKILL.md +0 -70
- /package/{extensions/subagent/bridge.ts → bridge.ts} +0 -0
- /package/{extensions/subagent/index.ts → index.ts} +0 -0
- /package/{extensions/subagent/mux.ts → mux.ts} +0 -0
- /package/{extensions/subagent/session.ts → session.ts} +0 -0
- /package/{extensions/subagent/ui.ts → ui.ts} +0 -0
package/README.md
CHANGED
|
@@ -32,4 +32,4 @@ Without a usable multiplexer, the worker backend falls back to a background proc
|
|
|
32
32
|
|
|
33
33
|
## Other delegation packages
|
|
34
34
|
|
|
35
|
-
Use [multi-harness](https://github.com/RolinShmily/pi-kit/tree/main/
|
|
35
|
+
Use [multi-harness](https://github.com/RolinShmily/pi-kit/tree/main/multi-harness) for Codex, Claude, or OpenCode peers. That package shares multiplexer helpers (`mux.ts`) while exposing a separate tool.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rol1n/subagent",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "subagent extension from pi-kit",
|
|
6
6
|
"keywords": [
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "git+https://github.com/RolinShmily/pi-kit.git",
|
|
12
|
-
"directory": "
|
|
12
|
+
"directory": "subagent"
|
|
13
13
|
},
|
|
14
14
|
"homepage": "https://github.com/RolinShmily/pi-kit#readme",
|
|
15
15
|
"bugs": {
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"publishConfig": {
|
|
22
22
|
"access": "public"
|
|
23
23
|
},
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
|
|
24
|
+
"exports": {
|
|
25
|
+
".": "./index.ts",
|
|
26
|
+
"./mux": "./mux.ts"
|
|
27
|
+
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@earendil-works/pi-ai": "*",
|
|
30
30
|
"@earendil-works/pi-agent-core": "*",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"pi": {
|
|
36
36
|
"extensions": [
|
|
37
|
-
"./
|
|
37
|
+
"./index.ts"
|
|
38
38
|
],
|
|
39
39
|
"skills": [],
|
|
40
40
|
"prompts": [],
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# subagent
|
|
2
|
-
|
|
3
|
-
Delegate tasks to independent, full-powered Pi workers. The `subagent` tool returns after launch; completion or questions are delivered back to the parent session asynchronously.
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```sh
|
|
8
|
-
pi install npm:@rol1n/subagent
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
Also included in `@rol1n/pi-kit`. The parent and workers require the `pi` executable on PATH and their normal Pi authentication.
|
|
12
|
-
|
|
13
|
-
## Use
|
|
14
|
-
|
|
15
|
-
```json
|
|
16
|
-
{"action":"spawn","name":"reviewer","cwd":"/existing/project","task":"Review the changed files and report findings."}
|
|
17
|
-
{"action":"send","target":"reviewer","task":"Also inspect the error handling."}
|
|
18
|
-
{"action":"stop","target":"reviewer"}
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
`model` optionally selects a worker model. `/subagent` shows active workers. Each worker inherits its own normal Pi capabilities; this is a delegation runtime, not a restricted execution environment.
|
|
22
|
-
|
|
23
|
-
## Backends
|
|
24
|
-
|
|
25
|
-
| Variable | Behavior |
|
|
26
|
-
|---|---|
|
|
27
|
-
| `PI_SUBAGENT_BACKEND=process` | Run silent background processes |
|
|
28
|
-
| `PI_SUBAGENT_MUX=tmux` | Prefer tmux when running inside an available tmux session |
|
|
29
|
-
| `PI_SUBAGENT_MUX=zellij` | Prefer Zellij when running inside an available Zellij session |
|
|
30
|
-
|
|
31
|
-
Without a usable multiplexer, the worker backend falls back to a background process. Native Windows supports PowerShell launch commands and Zellij panes; tmux is for POSIX environments. Session transcripts and task artifacts are stored under `~/.pi/agent/`.
|
|
32
|
-
|
|
33
|
-
## Other delegation packages
|
|
34
|
-
|
|
35
|
-
Use [multi-harness](https://github.com/RolinShmily/pi-kit/tree/main/extensions/multi-harness) for Codex, Claude, or OpenCode peers. That package shares multiplexer helpers but provides a separate tool and does not automatically enable this extension's entrypoint. The bundled subagent skill file is reference material and is not registered by the package manifest.
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: subagent
|
|
3
|
-
description: Dispatch, message, and collaborate with parallel, full-powered Pi subagent workers running in split terminal panes or silent background processes.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Subagent
|
|
7
|
-
|
|
8
|
-
Use the native `subagent` tool to delegate tasks to independent, full-powered Pi instances ("workers"). Workers run in dedicated split terminal panes (inside tmux or Zellij) or run silently as background processes (in standard terminals, VSCode, CI/CD, or headless environments). Every worker inherits all standard tools, skills, and extensions, and operates completely asynchronously.
|
|
9
|
-
|
|
10
|
-
## Spawning Workers
|
|
11
|
-
|
|
12
|
-
Call the `subagent` tool directly. The tool returns **immediately** with an acknowledgement. You do **not** need to wait or poll:
|
|
13
|
-
|
|
14
|
-
```json
|
|
15
|
-
subagent({
|
|
16
|
-
"task": "Investigate the authentication middleware in src/auth.ts and propose fixes.",
|
|
17
|
-
"name": "auth-audit"
|
|
18
|
-
})
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
- `task`: Clear, comprehensive instructions for the worker.
|
|
22
|
-
- `name`: Short, descriptive identifier (e.g. `frontend`, `db-migration`, `tester`).
|
|
23
|
-
- `model`: (Optional) Model override (e.g. a faster model for simple exploration).
|
|
24
|
-
- `cwd`: (Optional) Working directory for the worker.
|
|
25
|
-
|
|
26
|
-
### Parallel Workers
|
|
27
|
-
|
|
28
|
-
You can dispatch **multiple workers in parallel in a single turn**:
|
|
29
|
-
|
|
30
|
-
```json
|
|
31
|
-
[
|
|
32
|
-
{ "name": "subagent", "arguments": { "task": "Audit frontend router in src/routes/", "name": "frontend" } },
|
|
33
|
-
{ "name": "subagent", "arguments": { "task": "Audit database models in src/db/", "name": "backend" } }
|
|
34
|
-
]
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
All workers run concurrently in separate split panes. As each worker finishes, the system automatically injects its final result into your conversation as a **steer message**, waking you up to review the findings.
|
|
38
|
-
|
|
39
|
-
## Non-Blocking Principle
|
|
40
|
-
|
|
41
|
-
- **DO NOT** write bash scripts, `sleep` commands, `tail` logs, or polling loops to check on a worker.
|
|
42
|
-
- **DO NOT** fabricate or assume worker results before receiving the steer message.
|
|
43
|
-
- After calling `subagent`, either end your turn immediately or work on other independent tasks. The harness will wake you with the result as soon as it is ready.
|
|
44
|
-
|
|
45
|
-
## Answering Worker Questions
|
|
46
|
-
|
|
47
|
-
Workers have an `ask_question` tool. When a worker encounters ambiguity or needs a decision:
|
|
48
|
-
1. The worker pauses its work and marks itself as `waiting: ask`.
|
|
49
|
-
2. You receive a steer notification: `[Subagent "<name>" question] ...`.
|
|
50
|
-
3. Answer the worker by targeting its name:
|
|
51
|
-
|
|
52
|
-
```json
|
|
53
|
-
subagent({
|
|
54
|
-
"target": "auth-audit",
|
|
55
|
-
"task": "Use the JWT verification method rather than session cookies."
|
|
56
|
-
})
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
The worker absorbs your guidance, resumes execution, and reports back when done.
|
|
60
|
-
|
|
61
|
-
## Stopping a Worker
|
|
62
|
-
|
|
63
|
-
If a worker is no longer needed or is off-track, terminate it:
|
|
64
|
-
|
|
65
|
-
```json
|
|
66
|
-
subagent({
|
|
67
|
-
"target": "auth-audit",
|
|
68
|
-
"action": "stop"
|
|
69
|
-
})
|
|
70
|
-
```
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|