@henryqw/pi-subagent 1.0.0 → 1.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 +3 -1
- package/extensions/subagent.ts +6 -4
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -36,11 +36,13 @@ Fields:
|
|
|
36
36
|
| --- | --- | --- |
|
|
37
37
|
| `name` | yes | Role selected by Main |
|
|
38
38
|
| `description` | yes | Tells Main when to use role |
|
|
39
|
-
| `tools` |
|
|
39
|
+
| `tools` | no | Omit for Pi effective `defaultTools`; a non-empty list is an exact built-in and extension tool allowlist; use `[]` for none |
|
|
40
40
|
| `extensions` | no | Absolute/user-home paths or package sources passed to Pi `--extension` |
|
|
41
41
|
| `skills` | no | Effective Pi Skill names loaded for role |
|
|
42
42
|
| Markdown body | yes | Role system instructions |
|
|
43
43
|
|
|
44
|
+
Omitted `tools` uses Pi's effective `defaultTools` for built-ins. Tools registered by Role extensions stay active without listing their names. A non-empty `tools` list strictly allowlists both built-in and extension tools; `tools: []` sends `--no-tools`.
|
|
45
|
+
|
|
44
46
|
String lists may also use comma-separated text, matching Pi's example role files. Repository-relative extension paths are rejected: child working directory is delegated project, so relative paths could load untrusted project code. Use absolute paths, `~/...`, or explicit package sources such as `npm:...`.
|
|
45
47
|
|
|
46
48
|
Skill entries use Pi Skill names, normally Skill directory names, not filesystem paths. At delegation time, package resolves names from Main's effective Pi Skill registry and passes matching files to child. Missing or unavailable Skills produce warning and are skipped; they do not block delegation. This preserves Main's trust and Skill collision decisions.
|
package/extensions/subagent.ts
CHANGED
|
@@ -26,7 +26,7 @@ type Config = { models: Partial<Record<ModelClass, ConfiguredModel>> };
|
|
|
26
26
|
type Role = {
|
|
27
27
|
name: string;
|
|
28
28
|
description: string;
|
|
29
|
-
tools
|
|
29
|
+
tools?: string[];
|
|
30
30
|
extensions: string[];
|
|
31
31
|
skills: string[];
|
|
32
32
|
systemPrompt: string;
|
|
@@ -161,7 +161,7 @@ export function loadRoles(agentDir = getAgentDir()): Role[] {
|
|
|
161
161
|
return {
|
|
162
162
|
name: cleanText(frontmatter.name, "name", file),
|
|
163
163
|
description: cleanText(frontmatter.description, "description", file),
|
|
164
|
-
tools: stringList(frontmatter.tools, "tools", file, true),
|
|
164
|
+
tools: frontmatter.tools === undefined ? undefined : stringList(frontmatter.tools, "tools", file, true),
|
|
165
165
|
extensions: extensionList(frontmatter.extensions, file),
|
|
166
166
|
skills: stringList(frontmatter.skills, "skills", file),
|
|
167
167
|
systemPrompt: cleanText(parsed.body, "system prompt", file),
|
|
@@ -691,8 +691,10 @@ export default function subagentExtension(pi: ExtensionAPI): void {
|
|
|
691
691
|
const args = ["--mode", "json", "-p", "--no-session", "--no-extensions", "--no-skills"];
|
|
692
692
|
for (const extension of role.extensions) args.push("--extension", extension);
|
|
693
693
|
for (const skill of resolvedSkills.paths) args.push("--skill", skill);
|
|
694
|
-
if (role.tools
|
|
695
|
-
|
|
694
|
+
if (role.tools !== undefined) {
|
|
695
|
+
if (role.tools.length) args.push("--tools", role.tools.join(","));
|
|
696
|
+
else args.push("--no-tools");
|
|
697
|
+
}
|
|
696
698
|
args.push("--model", modelReferenceValue);
|
|
697
699
|
if (thinkingLevel) args.push("--thinking", thinkingLevel);
|
|
698
700
|
args.push(ctx.isProjectTrusted() ? "--approve" : "--no-approve");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@henryqw/pi-subagent",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Delegate one task to an isolated Pi role with explicit extensions and skills.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"pack:check": "npm pack --dry-run"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@earendil-works/pi-ai": "^0.84.
|
|
28
|
-
"@earendil-works/pi-coding-agent": "^0.84.
|
|
29
|
-
"@earendil-works/pi-tui": "^0.84.
|
|
30
|
-
"typebox": "^1.3.
|
|
27
|
+
"@earendil-works/pi-ai": "^0.84.2",
|
|
28
|
+
"@earendil-works/pi-coding-agent": "^0.84.2",
|
|
29
|
+
"@earendil-works/pi-tui": "^0.84.2",
|
|
30
|
+
"typebox": "^1.3.13"
|
|
31
31
|
},
|
|
32
32
|
"repository": {
|
|
33
33
|
"type": "git",
|