@arhen/pi-core-subagent 1.2.2 → 1.3.0
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 +18 -1
- package/package.json +1 -1
- package/src/index.ts +6 -2
package/README.md
CHANGED
|
@@ -133,7 +133,7 @@ Background + intercom:
|
|
|
133
133
|
| Tool | Purpose |
|
|
134
134
|
|---|---|
|
|
135
135
|
| `subagent` | single / `tasks` (parallel or graph via `needs`) / `chain` (`{previous}`); `background:true` fire-and-forget; `allowIntercom:true` enables child talk tools; `notifyPerTask: true` wakes you as each task completes (default off) |
|
|
136
|
-
| `subagent_status` | live per-task snapshot (non-blocking) |
|
|
136
|
+
| `subagent_status` | live per-task snapshot (non-blocking), including each child's session file path |
|
|
137
137
|
| `subagent_result` | full output of a run or one task |
|
|
138
138
|
| `await_subagent` | block until a run finishes (optional `timeoutMs`) |
|
|
139
139
|
| `reply_subagent` | answer a child's `ask_parent` question |
|
|
@@ -161,6 +161,23 @@ Read-only pane over the session's subagents:
|
|
|
161
161
|
- `x` then `y` — abort ONE subagent (only mutation; `n`/any other key cancels)
|
|
162
162
|
- `esc` — close
|
|
163
163
|
|
|
164
|
+
## Watching a child from outside
|
|
165
|
+
|
|
166
|
+
`subagent_status` returns each running child's session file (JSONL). Children are `AgentSession`s in this process — they have no TTY — but their transcript is a real file, so any external viewer can follow one:
|
|
167
|
+
|
|
168
|
+
```sh
|
|
169
|
+
tail -f /path/from/subagent_status.jsonl
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
In a terminal multiplexer, that is a pane per agent — e.g. with [Herdr](https://herdr.dev):
|
|
173
|
+
|
|
174
|
+
```sh
|
|
175
|
+
herdr pane split --current --direction right
|
|
176
|
+
herdr pane run w1:p2 "tail -f /path/from/subagent_status.jsonl"
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
The extension has no multiplexer integration and does not want one: it exposes the path, your agent already knows how to drive its own terminal. For an in-pi view of the same stream, use [`/subagents peek`](#peek--subagents-peek-or-ctrlshifta).
|
|
180
|
+
|
|
164
181
|
## Context budget
|
|
165
182
|
|
|
166
183
|
- Parent tools: 6 schemas with short descriptions. **No catalog, no context hook** — nothing injected per request.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arhen/pi-core-subagent",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "pi extension: fast in-process subagents with a dependency-graph scheduler (needs edges gate tasks and carry upstream output into dependent prompts), plus background runs, intercom and agent-to-agent mailbox. Leader defines agents inline.",
|
|
6
6
|
"license": "MIT",
|
package/src/index.ts
CHANGED
|
@@ -1473,14 +1473,18 @@ export default function (pi: ExtensionAPI) {
|
|
|
1473
1473
|
pi.registerTool<typeof RunIdParam, { run?: RunSnapshot }>({
|
|
1474
1474
|
name: "subagent_status",
|
|
1475
1475
|
label: "Subagent Status",
|
|
1476
|
-
description: "Live status of a subagent run (non-blocking): per-task state.",
|
|
1476
|
+
description: "Live status of a subagent run (non-blocking): per-task state, plus each child's session file path (JSONL) so you can tail it from outside — e.g. in a terminal multiplexer pane.",
|
|
1477
1477
|
promptSnippet: "Check progress of a subagent run.",
|
|
1478
1478
|
parameters: RunIdParam,
|
|
1479
1479
|
async execute(_id, params) {
|
|
1480
1480
|
const { runId } = params as { runId: string };
|
|
1481
1481
|
const run = manager.getRun(runId);
|
|
1482
1482
|
if (!run) return { content: [{ type: "text", text: `Unknown runId: ${runId}` }], isError: true, details: {} };
|
|
1483
|
-
|
|
1483
|
+
// Session file paths are the one primitive an outside tool needs: `tail -f` it in a
|
|
1484
|
+
// multiplexer pane, a log viewer, anything. Cheaper than owning a pane integration.
|
|
1485
|
+
const files = run.tasks.filter((t) => t.sessionFile).map((t) => `${t.id} (${t.agent}): ${t.sessionFile}`);
|
|
1486
|
+
const text = [compactLines(run).join("\n"), ...(files.length > 0 ? ["", "Live session files (tail -f to watch):", ...files] : [])].join("\n");
|
|
1487
|
+
return { content: [{ type: "text", text }], details: { run: cloneRun(run) } };
|
|
1484
1488
|
},
|
|
1485
1489
|
});
|
|
1486
1490
|
|