@arhen/pi-core-subagent 1.3.0 → 1.3.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/package.json +1 -1
- package/src/index.ts +10 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arhen/pi-core-subagent",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
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
|
@@ -1252,12 +1252,7 @@ const TaskItem = Type.Object({
|
|
|
1252
1252
|
cwd: Type.Optional(Type.String({ description: "Working directory for this task. Default: current project." })),
|
|
1253
1253
|
tools: Type.Optional(Type.Array(Type.String(), { description: "Explicit tool allowlist (overrides the toolset)" })),
|
|
1254
1254
|
maxRuntimeMs: Type.Optional(Type.Number({ description: "Per-task timeout (ms)" })),
|
|
1255
|
-
needs: Type.Optional(
|
|
1256
|
-
Type.Array(Type.String(), {
|
|
1257
|
-
description:
|
|
1258
|
-
"Task ids this task depends on (requires those tasks to declare id). It starts only after they finish, and their outputs are prepended to its prompt. Tasks with no unmet needs run together as a wave.",
|
|
1259
|
-
}),
|
|
1260
|
-
),
|
|
1255
|
+
needs: Type.Optional(Type.Array(Type.String(), { description: "Ids of tasks this one waits for; their outputs are prepended to this prompt." })),
|
|
1261
1256
|
});
|
|
1262
1257
|
|
|
1263
1258
|
type SubagentParamsShape = {
|
|
@@ -1380,18 +1375,18 @@ export default function (pi: ExtensionAPI) {
|
|
|
1380
1375
|
pi.registerTool<typeof SubagentParams, RunDetails>({
|
|
1381
1376
|
name: "subagent",
|
|
1382
1377
|
label: "Subagent",
|
|
1383
|
-
|
|
1378
|
+
// ponytail: this string is billed on every request. One example — the graph one —
|
|
1379
|
+
// covers ids, needs, write and Verify; the simpler shapes are subsets of it.
|
|
1380
|
+
description:
|
|
1381
|
+
"Run isolated subagents (own context, own session). You invent each agent: name, optional system prompt, toolset (read-only default, write:true to edit). Use `agent`+`task` for one, `tasks` for many. `needs` declares dependency edges: a task waits for its needs and receives their outputs prepended to its prompt. background:true returns immediately; allowIntercom:true lets children talk to you and each other.\n\nsubagent({ tasks: [{ id: \"api\", agent: \"api-mapper\", task: \"Map API routes\" }, { id: \"db\", agent: \"db-mapper\", task: \"Map DB schema\" }, { id: \"doc\", agent: \"writer\", needs: [\"api\", \"db\"], write: true, task: \"Write ARCHITECTURE.md. Verify: test -s ARCHITECTURE.md\" }] })",
|
|
1384
1382
|
promptSnippet: "Define and delegate work to specialized subagents.",
|
|
1385
1383
|
promptGuidelines: [
|
|
1386
1384
|
"Use subagent when independent review, testing, research, or parallel analysis improves quality.",
|
|
1387
|
-
"
|
|
1388
|
-
"
|
|
1389
|
-
"
|
|
1390
|
-
"
|
|
1391
|
-
"
|
|
1392
|
-
"Prefer read-only subagents unless the task explicitly needs edits.",
|
|
1393
|
-
"Use background:true for long-running work; you'll be notified on completion.",
|
|
1394
|
-
"Use allowIntercom:true only when a child may need to ask you something; keep children autonomous otherwise.",
|
|
1385
|
+
"Put every sub-task in ONE call: subagent({ tasks: [...] }). Never make multiple parallel subagent calls — one call, one run, N tasks.",
|
|
1386
|
+
"Order comes from `needs`, not from separate calls: give tasks an `id`, list the ids each depends on. Tasks with no unmet needs run in parallel; dependents receive their upstream outputs automatically — do not restate them.",
|
|
1387
|
+
"End each task with a runnable check, e.g. 'Verify: npx tsc --noEmit && bun test'. A subagent's claim of success is not evidence.",
|
|
1388
|
+
"Define each agent yourself: invented name, focused system prompt, and read-only (default) or write:true. Prefer read-only.",
|
|
1389
|
+
"Use background:true for long work; allowIntercom:true only when a child may need to ask you something.",
|
|
1395
1390
|
],
|
|
1396
1391
|
parameters: SubagentParams,
|
|
1397
1392
|
executionMode: "parallel", // sibling subagent calls run concurrently, not serialized
|