@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @pi-ohm/subagents
2
2
 
3
- Install only subagent delegation support for Pi.
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.2",
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": "^0.52.0",
22
- "@pi-ohm/config": "^0.6.2"
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: "Multi-repo codebase understanding subagent (GitHub/Bitbucket architecture analysis).",
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
- "Understand architecture across multiple repositories",
19
- "Build implementation maps before migration/refactor",
20
- "Trace ownership boundaries across services",
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
- "Get second-opinion architecture critique",
32
- "Review risky design decisions before implementation",
33
- "Debug ambiguous failures with hypothesis ranking",
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: "Concept/behavior-based search subagent for multi-step codebase discovery.",
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
- "Find all call sites for a behavior, not just symbol references",
44
- "Map data flow across modules",
45
- "Locate implicit coupling and duplicated logic",
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
- id: "task",
52
- name: "Task",
53
- summary: "Independent execution subagent for parallelizable tasks with isolated tool context.",
54
- whenToUse: [
55
- "Parallelize work across unrelated app areas",
56
- "Delegate focused implementation tasks",
57
- "Run isolated experiments without polluting main context",
58
- ],
59
- scaffoldPrompt:
60
- "Execute this focused implementation task independently. Return a concise summary of changes, validation, and follow-up risks.",
61
- },
62
- {
63
- id: "painter",
64
- name: "Painter",
65
- summary: "Image generation/editing subagent used only on explicit request.",
66
- whenToUse: [
67
- "Generate concept/mock images",
68
- "Edit existing images based on prompt instructions",
69
- "Produce visual assets when user explicitly asks for image output",
70
- ],
71
- scaffoldPrompt:
72
- "Generate or edit an image per user request. Confirm intent first, then return prompt + provider/model metadata with result notes.",
73
- requiresPackage: "@pi-ohm/painter",
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
- return `- ${agent.name} (${agent.id}): ${agent.summary} [${availability}]`;
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",