@d3ara1n/pi-subagent 0.6.1 → 0.7.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/package.json +1 -1
- package/src/config.ts +38 -47
- package/src/index.ts +990 -810
- package/src/roles.ts +11 -16
- package/src/spawn.ts +438 -402
- package/src/utils.test.ts +243 -227
- package/src/utils.ts +196 -185
package/src/roles.ts
CHANGED
|
@@ -12,11 +12,9 @@ export const BUILTIN_ROLES: Record<string, SubagentRole> = {
|
|
|
12
12
|
explorer: {
|
|
13
13
|
role: "fast",
|
|
14
14
|
fallbackRole: "default",
|
|
15
|
-
description:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"Map the routing structure",
|
|
19
|
-
],
|
|
15
|
+
description:
|
|
16
|
+
"READ-ONLY codebase exploration — locate files, grep symbols, trace imports, explain structures. Tools: read, find, grep, glob. NO bash, NO edits, NO web access.",
|
|
17
|
+
examples: ["Find where auth middleware is implemented", "Map the routing structure"],
|
|
20
18
|
decisionTrigger: "Task finds or maps code without touch?",
|
|
21
19
|
tools: ["read", "find", "grep", "glob"],
|
|
22
20
|
systemPrompt: [
|
|
@@ -33,7 +31,8 @@ export const BUILTIN_ROLES: Record<string, SubagentRole> = {
|
|
|
33
31
|
reviewer: {
|
|
34
32
|
role: "heavy",
|
|
35
33
|
fallbackRole: "default",
|
|
36
|
-
description:
|
|
34
|
+
description:
|
|
35
|
+
"READ-ONLY code review & analysis — audit code, assess architecture, review diffs. Tools: read, bash, grep, glob. Has bash (git diff/log, test runs). NO edits, NO web access.",
|
|
37
36
|
examples: [
|
|
38
37
|
"Review the error handling in src/api/ for security issues",
|
|
39
38
|
"Audit this PR diff for performance regressions",
|
|
@@ -53,11 +52,9 @@ export const BUILTIN_ROLES: Record<string, SubagentRole> = {
|
|
|
53
52
|
},
|
|
54
53
|
worker: {
|
|
55
54
|
role: "default",
|
|
56
|
-
description:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"Add input validation to POST /login",
|
|
60
|
-
],
|
|
55
|
+
description:
|
|
56
|
+
"the ONLY role that can MODIFY files — edit, write, refactor, fix, implement. Tools: read, bash, edit, write, grep, glob, delegate. Can delegate to explorer/researcher.",
|
|
57
|
+
examples: ["Rename all snake_case fields to camelCase", "Add input validation to POST /login"],
|
|
61
58
|
decisionTrigger: "Task modifies files?",
|
|
62
59
|
tools: ["read", "bash", "edit", "write", "grep", "glob", "delegate"],
|
|
63
60
|
subagentRoles: ["explorer", "researcher"],
|
|
@@ -80,11 +77,9 @@ export const BUILTIN_ROLES: Record<string, SubagentRole> = {
|
|
|
80
77
|
researcher: {
|
|
81
78
|
role: "fast",
|
|
82
79
|
fallbackRole: "default",
|
|
83
|
-
description:
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
"Check GitHub issue #1234 for context",
|
|
87
|
-
],
|
|
80
|
+
description:
|
|
81
|
+
"the ONLY role with WEB ACCESS — search docs, fetch pages, analyze GitHub repos. Tools: web_search, fetch_content, read, bash, delegate. Can clone repos & delegate to explorer.",
|
|
82
|
+
examples: ["Find the React 19 migration guide", "Check GitHub issue #1234 for context"],
|
|
88
83
|
decisionTrigger: "Task searches web or GitHub?",
|
|
89
84
|
tools: ["web_search", "fetch_content", "read", "bash", "delegate"],
|
|
90
85
|
subagentRoles: ["explorer"],
|