@pi-ohm/subagents 0.6.2 → 0.6.3
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 +44 -2
- package/package.json +4 -3
- package/src/catalog.ts +55 -36
- package/src/extension.ts +3 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @pi-ohm/subagents
|
|
2
2
|
|
|
3
|
-
Install only subagent
|
|
3
|
+
Install only subagent support for Pi (task-routed + primary-tool profiles).
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
pi install npm:@pi-ohm/subagents
|
|
@@ -8,12 +8,54 @@ pi install npm:@pi-ohm/subagents
|
|
|
8
8
|
|
|
9
9
|
Scaffolded subagents:
|
|
10
10
|
|
|
11
|
-
- `librarian` — multi-repo code understanding
|
|
11
|
+
- `librarian` — multi-repo code understanding (default: primary-tool profile)
|
|
12
12
|
- `oracle` — reasoning-heavy advisor/reviewer
|
|
13
13
|
- `finder` — intelligent behavior-based search
|
|
14
14
|
- `task` — isolated parallel execution worker
|
|
15
15
|
- `painter` — explicit-request image generation/editing helper
|
|
16
16
|
|
|
17
|
+
Profiles can be marked with `primary: true` in config/catalog to indicate direct
|
|
18
|
+
invocation as a top-level tool entrypoint instead of task-tool-only invocation.
|
|
19
|
+
|
|
20
|
+
The orchestration tool name is **`task`**. Async orchestration lifecycle
|
|
21
|
+
operations (`start/status/wait/send/cancel`) are exposed through this tool.
|
|
22
|
+
|
|
23
|
+
## Live TUI feedback
|
|
24
|
+
|
|
25
|
+
`@pi-ohm/subagents` uses `@mariozechner/pi-tui` for task runtime visuals.
|
|
26
|
+
|
|
27
|
+
Baseline running-task display includes:
|
|
28
|
+
|
|
29
|
+
- spinner
|
|
30
|
+
- task description (from original `task` start payload)
|
|
31
|
+
- in-flight tool call count
|
|
32
|
+
- elapsed time (`mm:ss`)
|
|
33
|
+
|
|
34
|
+
Example running block:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
⠋ [finder] Auth flow scan
|
|
38
|
+
Tools 3/3 · Elapsed 00:18
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Terminal examples:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
✓ [finder] Auth flow scan
|
|
45
|
+
Tools 5/5 · Elapsed 00:42
|
|
46
|
+
|
|
47
|
+
✕ [finder] Auth flow scan
|
|
48
|
+
Tools 2/3 · Elapsed 00:11
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Error handling
|
|
52
|
+
|
|
53
|
+
`@pi-ohm/subagents` uses `better-result` for recoverable errors:
|
|
54
|
+
|
|
55
|
+
- runtime and orchestration paths should return `Result<T, E>`
|
|
56
|
+
- typed error categories should use `TaggedError`
|
|
57
|
+
- avoid broad try/catch error propagation for recoverable failures
|
|
58
|
+
|
|
17
59
|
Commands:
|
|
18
60
|
|
|
19
61
|
- `/ohm-subagents`
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-ohm/subagents",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
|
+
"homepage": "https://github.com/pi-ohm/pi-ohm/tree/dev/packages/subagents#readme",
|
|
4
5
|
"repository": {
|
|
5
6
|
"type": "git",
|
|
6
7
|
"url": "git+https://github.com/pi-ohm/pi-ohm.git",
|
|
@@ -18,8 +19,8 @@
|
|
|
18
19
|
"provenance": true
|
|
19
20
|
},
|
|
20
21
|
"dependencies": {
|
|
21
|
-
"@mariozechner/pi-coding-agent": "
|
|
22
|
-
"@pi-ohm/config": "^0.6.
|
|
22
|
+
"@mariozechner/pi-coding-agent": "catalog:pi",
|
|
23
|
+
"@pi-ohm/config": "^0.6.3"
|
|
23
24
|
},
|
|
24
25
|
"peerDependencies": {
|
|
25
26
|
"@mariozechner/pi-coding-agent": "*"
|
package/src/catalog.ts
CHANGED
|
@@ -4,20 +4,33 @@ export interface OhmSubagentDefinition {
|
|
|
4
4
|
id: OhmSubagentId;
|
|
5
5
|
name: string;
|
|
6
6
|
summary: string;
|
|
7
|
+
/**
|
|
8
|
+
* When true, this profile should be exposed as a directly invokable primary tool
|
|
9
|
+
* instead of requiring delegated Task-style invocation.
|
|
10
|
+
*/
|
|
11
|
+
primary?: boolean;
|
|
7
12
|
whenToUse: string[];
|
|
8
13
|
scaffoldPrompt: string;
|
|
9
14
|
requiresPackage?: string;
|
|
10
15
|
}
|
|
11
16
|
|
|
17
|
+
// should probably refactor these prompts... please don't sue me, Amp
|
|
18
|
+
// imitation is the sincerest form of flattery
|
|
12
19
|
export const OHM_SUBAGENT_CATALOG: readonly OhmSubagentDefinition[] = [
|
|
13
20
|
{
|
|
14
21
|
id: "librarian",
|
|
15
22
|
name: "Librarian",
|
|
16
|
-
summary:
|
|
23
|
+
summary:
|
|
24
|
+
"A specialized codebase understanding agent that helps you answer questions about large, complex codebases. Works by reading from temporary local github checkouts. Works as your personal, multi-repository codebase expert, providing thorough analysis and comprehensive explanations across repositories",
|
|
25
|
+
primary: true,
|
|
17
26
|
whenToUse: [
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
27
|
+
"Understanding complex multi-repository codebases and how they work",
|
|
28
|
+
"Exploring relationships between different repositories",
|
|
29
|
+
"Analyzing architectural patterns across large open-source projects",
|
|
30
|
+
"Finding specific implementations across multiple codebases",
|
|
31
|
+
"Understanding code evolution and commit history",
|
|
32
|
+
"Getting comprehensive explanations of how major features work",
|
|
33
|
+
"Exploring how systems are designed end-to-end across repositories",
|
|
21
34
|
],
|
|
22
35
|
scaffoldPrompt:
|
|
23
36
|
"Analyze this codebase (and linked repos if provided). Build an architecture map: boundaries, key modules, integration points, and risky coupling.",
|
|
@@ -28,9 +41,11 @@ export const OHM_SUBAGENT_CATALOG: readonly OhmSubagentDefinition[] = [
|
|
|
28
41
|
summary:
|
|
29
42
|
"Reasoning-heavy advisor for code review, architecture feedback, complex debugging, and planning.",
|
|
30
43
|
whenToUse: [
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
44
|
+
"Code reviews and architecture feedback",
|
|
45
|
+
"Finding difficult bugs in codepaths that flow across many files",
|
|
46
|
+
"Planning complex implementations or refactors",
|
|
47
|
+
"Answering complex technical questions that require deep technical reasoning",
|
|
48
|
+
"Providing an alternative point of view when you are struggling to solve a problem",
|
|
34
49
|
],
|
|
35
50
|
scaffoldPrompt:
|
|
36
51
|
"Act as a critical reviewer. Challenge assumptions, rank risks, and provide a concrete implementation plan with trade-offs.",
|
|
@@ -38,40 +53,44 @@ export const OHM_SUBAGENT_CATALOG: readonly OhmSubagentDefinition[] = [
|
|
|
38
53
|
{
|
|
39
54
|
id: "finder",
|
|
40
55
|
name: "Finder",
|
|
41
|
-
summary:
|
|
56
|
+
summary:
|
|
57
|
+
"Intelligently search your codebase: Use it for complex, multi-step search tasks where you need to find code based on functionality or concepts rather than exact matches. Anytime you want to chain multiple grep calls you should use this tool.",
|
|
42
58
|
whenToUse: [
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
59
|
+
"You must locate code by behavior or concept",
|
|
60
|
+
"You need to run multiple greps in sequence",
|
|
61
|
+
"You must correlate or look for connection between several areas of the codebase",
|
|
62
|
+
`You must filter broad terms ("config", "logger", "cache") by context.`,
|
|
63
|
+
`You need answers to questions such as "Where do we validate JWT authentication headers?" or "Which module handles file-watcher retry logic"`,
|
|
46
64
|
],
|
|
47
65
|
scaffoldPrompt:
|
|
48
66
|
"Search this codebase for all implementations and call paths related to the requested behavior. Return files, rationale, and confidence.",
|
|
49
67
|
},
|
|
50
|
-
{
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
// {
|
|
69
|
+
// id: "task",
|
|
70
|
+
// name: "Task",
|
|
71
|
+
// summary:
|
|
72
|
+
// "Independent execution subagent for parallelizable tasks with isolated tool context.",
|
|
73
|
+
// whenToUse: [
|
|
74
|
+
// "Parallelize work across unrelated app areas",
|
|
75
|
+
// "Delegate focused implementation tasks",
|
|
76
|
+
// "Run isolated experiments without polluting main context",
|
|
77
|
+
// ],
|
|
78
|
+
// scaffoldPrompt:
|
|
79
|
+
// "Execute this focused implementation task independently. Return a concise summary of changes, validation, and follow-up risks.",
|
|
80
|
+
// },
|
|
81
|
+
// {
|
|
82
|
+
// id: "painter",
|
|
83
|
+
// name: "Painter",
|
|
84
|
+
// summary: "Image generation/editing subagent used only on explicit request.",
|
|
85
|
+
// whenToUse: [
|
|
86
|
+
// "Generate concept/mock images",
|
|
87
|
+
// "Edit existing images based on prompt instructions",
|
|
88
|
+
// "Produce visual assets when user explicitly asks for image output",
|
|
89
|
+
// ],
|
|
90
|
+
// scaffoldPrompt:
|
|
91
|
+
// "Generate or edit an image per user request. Confirm intent first, then return prompt + provider/model metadata with result notes.",
|
|
92
|
+
// requiresPackage: "@pi-ohm/painter",
|
|
93
|
+
// },
|
|
75
94
|
] as const;
|
|
76
95
|
|
|
77
96
|
export function getSubagentById(id: string): OhmSubagentDefinition | undefined {
|
package/src/extension.ts
CHANGED
|
@@ -52,7 +52,8 @@ export default function registerSubagentsExtension(pi: ExtensionAPI): void {
|
|
|
52
52
|
const needsPainterPackage = agent.id === "painter";
|
|
53
53
|
const available = !needsPainterPackage || config.features.painterImagegen;
|
|
54
54
|
const availability = available ? "available" : "requires painter feature/package";
|
|
55
|
-
|
|
55
|
+
const invocation = agent.primary ? "primary-tool" : "delegated";
|
|
56
|
+
return `- ${agent.name} (${agent.id}): ${agent.summary} [${availability} · ${invocation}]`;
|
|
56
57
|
});
|
|
57
58
|
|
|
58
59
|
const text = [
|
|
@@ -106,6 +107,7 @@ export default function registerSubagentsExtension(pi: ExtensionAPI): void {
|
|
|
106
107
|
`Subagent: ${match.name}`,
|
|
107
108
|
`id: ${match.id}`,
|
|
108
109
|
`available: ${isAvailable ? "yes" : "no"}`,
|
|
110
|
+
`invocation: ${match.primary ? "primary-tool" : "delegated"}`,
|
|
109
111
|
match.requiresPackage
|
|
110
112
|
? `requiresPackage: ${match.requiresPackage}`
|
|
111
113
|
: "requiresPackage: none",
|