@narumitw/pi-subagents 0.17.0 → 0.17.2
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 +37 -1
- package/package.json +1 -1
- package/src/params.ts +2 -1
- package/src/stateful.ts +5 -1
- package/src/subagents.ts +1 -1
package/README.md
CHANGED
|
@@ -335,7 +335,43 @@ You are an API review subagent. Do not edit files. Check compatibility,
|
|
|
335
335
|
test coverage, and migration risks. Report PASS/FAIL/PARTIAL with evidence.
|
|
336
336
|
```
|
|
337
337
|
|
|
338
|
-
|
|
338
|
+
`agentScope` is a top-level tool argument supplied per invocation. It is not a setting in
|
|
339
|
+
`~/.pi/agent/pi-subagents.json` and does not belong in agent frontmatter. The scope selects which
|
|
340
|
+
custom agent directories are loaded; built-in agents remain available in every scope:
|
|
341
|
+
|
|
342
|
+
| `agentScope` | Custom agents loaded |
|
|
343
|
+
| --- | --- |
|
|
344
|
+
| `"user"` (default) | User agents only. |
|
|
345
|
+
| `"project"` | Project-local agents only. |
|
|
346
|
+
| `"both"` | User and project-local agents. Project definitions override same-named user definitions. |
|
|
347
|
+
|
|
348
|
+
For example, invoke a project-local agent with the blocking `subagent` tool:
|
|
349
|
+
|
|
350
|
+
```json
|
|
351
|
+
{
|
|
352
|
+
"agent": "api-reviewer",
|
|
353
|
+
"task": "Review this project's API changes",
|
|
354
|
+
"agentScope": "project"
|
|
355
|
+
}
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
Or select the scope when creating a stateful agent with `subagent_spawn`:
|
|
359
|
+
|
|
360
|
+
```json
|
|
361
|
+
{
|
|
362
|
+
"agent": "api-reviewer",
|
|
363
|
+
"task": "Review this project's API changes",
|
|
364
|
+
"agentScope": "project"
|
|
365
|
+
}
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
A stateful agent retains the scope selected by `subagent_spawn` for its follow-ups. Every new
|
|
369
|
+
blocking `subagent` invocation or `subagent_spawn` call that needs project agents must supply
|
|
370
|
+
`agentScope: "project"` or `"both"` again.
|
|
371
|
+
|
|
372
|
+
Project-local agents require a trusted Pi project. Interactive sessions also ask for confirmation
|
|
373
|
+
before using them by default. Passing `confirmProjectAgents: false` as another top-level tool
|
|
374
|
+
argument skips that confirmation dialog, but it does not bypass the project trust requirement.
|
|
339
375
|
|
|
340
376
|
## ⏱️ Runtime limits and thinking levels
|
|
341
377
|
|
package/package.json
CHANGED
package/src/params.ts
CHANGED
|
@@ -37,7 +37,8 @@ const AggregatorItem = Type.Object({
|
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
const AgentScopeSchema = StringEnum(["user", "project", "both"] as const, {
|
|
40
|
-
description:
|
|
40
|
+
description:
|
|
41
|
+
'Per-invocation custom agent scope. Default: "user". Use "project" for project-local agents or "both" for user and project agents; this is a tool argument, not a pi-subagents.json setting.',
|
|
41
42
|
default: "user",
|
|
42
43
|
});
|
|
43
44
|
|
package/src/stateful.ts
CHANGED
|
@@ -31,7 +31,11 @@ const ContextModeSchema = Type.Union([
|
|
|
31
31
|
StringEnum(["none", "all", "summary"] as const),
|
|
32
32
|
Type.Number({ minimum: 1, description: "Include the most recent N user turns." }),
|
|
33
33
|
]);
|
|
34
|
-
const ScopeSchema = StringEnum(["user", "project", "both"] as const
|
|
34
|
+
const ScopeSchema = StringEnum(["user", "project", "both"] as const, {
|
|
35
|
+
description:
|
|
36
|
+
'Per-invocation custom agent scope for this spawn. Default: "user". Use "project" for project-local agents or "both" for user and project agents; the selected scope is retained for follow-ups.',
|
|
37
|
+
default: "user",
|
|
38
|
+
});
|
|
35
39
|
const MAX_TOOL_MESSAGE_BYTES = 2 * 1024;
|
|
36
40
|
const MAX_COMPLETION_ERROR_BYTES = 512;
|
|
37
41
|
|
package/src/subagents.ts
CHANGED
|
@@ -30,7 +30,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
30
30
|
"Modes: single (agent + task), parallel (tasks array), chain (sequential with {previous} placeholder).",
|
|
31
31
|
"Parallel mode may include an aggregator fan-in step that receives all task outputs.",
|
|
32
32
|
'Default agent scope is "user" (from ~/.pi/agent/agents).',
|
|
33
|
-
'To enable project-local agents in .pi/agents,
|
|
33
|
+
'To enable project-local agents in .pi/agents, pass agentScope: "both" (or "project") as a top-level argument for that call.',
|
|
34
34
|
].join(" "),
|
|
35
35
|
promptSnippet:
|
|
36
36
|
"Decide whether to spawn 0, 1, or multiple subagents for independent research, review, verification, or multi-step work in isolated Pi processes.",
|