@johnnywu/pi-subagents 2.1.1 → 2.2.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/CHANGELOG.md +14 -0
- package/README.md +38 -32
- package/extensions/agent-loader.ts +4 -2
- package/extensions/index.ts +20 -27
- package/extensions/subagent-executor.ts +41 -10
- package/extensions/subagent-prompt.ts +10 -30
- package/extensions/subagent-tool.ts +4 -1
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [2.2.1](https://github.com/jwu/pi-subagents/compare/v2.2.0...v2.2.1) (2026-08-24)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* support bundled pi CLI invocation ([0651956](https://github.com/jwu/pi-subagents/commit/065195604d1d3b54ea2810f10d20049c4023daf9))
|
|
7
|
+
|
|
8
|
+
# [2.2.0](https://github.com/jwu/pi-subagents/compare/v2.1.1...v2.2.0) (2026-08-06)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* inject runtime tools automatically ([eac6f01](https://github.com/jwu/pi-subagents/commit/eac6f01b4f27e463cba7623fede2602498de421d))
|
|
14
|
+
|
|
1
15
|
## [2.1.1](https://github.com/jwu/pi-subagents/compare/v2.1.0...v2.1.1) (2026-07-21)
|
|
2
16
|
|
|
3
17
|
|
package/README.md
CHANGED
|
@@ -51,14 +51,18 @@ Run the code-reviewer agent on the last three commits
|
|
|
51
51
|
By default, sub-agents do not inherit parent conversation history. For tasks that need the current conversation, request a forked session:
|
|
52
52
|
|
|
53
53
|
```ts
|
|
54
|
-
subagent({
|
|
54
|
+
subagent({
|
|
55
|
+
agent: 'code-reviewer',
|
|
56
|
+
task: 'Review the approach we just discussed',
|
|
57
|
+
session: 'fork',
|
|
58
|
+
});
|
|
55
59
|
```
|
|
56
60
|
|
|
57
61
|
`session` is optional and accepts:
|
|
58
62
|
|
|
59
|
-
| Value
|
|
60
|
-
|
|
61
|
-
| `none` | Default. Start a new sub-agent session in the subagents session directory.
|
|
63
|
+
| Value | Behavior |
|
|
64
|
+
| ------ | ---------------------------------------------------------------------------------------------------- |
|
|
65
|
+
| `none` | Default. Start a new sub-agent session in the subagents session directory. |
|
|
62
66
|
| `fork` | Fork the current parent session at its active leaf and run the sub-agent with that branched session. |
|
|
63
67
|
|
|
64
68
|
If `fork` is requested but unavailable, pi-subagents falls back to `none` and shows a warning in the tool details/rendering. Fallback happens when the parent session is not persisted, has no current leaf, the forked session file is not materialized, or the call uses a `cwd` different from the parent session cwd.
|
|
@@ -84,22 +88,24 @@ The prompt file passed to the child process contains only the agent prompt plus
|
|
|
84
88
|
|
|
85
89
|
### What goes into the sub-agent system prompt
|
|
86
90
|
|
|
87
|
-
| Component
|
|
88
|
-
|
|
89
|
-
| pi default system prompt
|
|
90
|
-
| Project context files (AGENTS.md/CLAUDE.md, etc.) | ✅ included
|
|
91
|
-
| Agent body (.md file body)
|
|
92
|
-
| Skills XML block
|
|
93
|
-
| Available tools / Guidelines block
|
|
94
|
-
| Available subagents
|
|
91
|
+
| Component | `append` | `replace` | `replace-all` |
|
|
92
|
+
| ------------------------------------------------- | ------------------------------------------- | --------------------------------------------- | --------------------------------------------- |
|
|
93
|
+
| pi default system prompt | ✅ kept | ❌ replaced | ❌ replaced |
|
|
94
|
+
| Project context files (AGENTS.md/CLAUDE.md, etc.) | ✅ included | ✅ included | ❌ skipped |
|
|
95
|
+
| Agent body (.md file body) | ✅ appended | ✅ becomes the prompt | ✅ becomes the prompt |
|
|
96
|
+
| Skills XML block | ✅ appended | ✅ appended | ✅ appended |
|
|
97
|
+
| Available tools / Guidelines block | from default prompt | automatically injected after agent body | automatically injected after agent body |
|
|
98
|
+
| Available subagents | supplied by active `subagent` tool metadata | supplied by active `subagent` tool metadata | supplied by active `subagent` tool metadata |
|
|
95
99
|
|
|
96
|
-
`append` keeps pi's
|
|
100
|
+
`append` keeps pi's default prompt and its built-in tools/guidelines block. The agent body and its skills block are appended before pi project context.
|
|
97
101
|
`replace` swaps out pi's default prompt for the agent body while keeping pi context files.
|
|
98
|
-
`replace-all` is the fully isolated mode: it swaps out pi's default prompt and skips pi context files
|
|
102
|
+
`replace-all` is the fully isolated mode: it swaps out pi's default prompt and skips pi context files.
|
|
103
|
+
|
|
104
|
+
For `replace` and `replace-all`, pi-subagents automatically injects Pi's runtime `Available tools` and `Guidelines` blocks after the agent body and before its skills block. Agent definitions do not need a placeholder.
|
|
99
105
|
|
|
100
106
|
Breaking change: the old `replace` behavior is now `replace-all`. Existing agents that need to keep skipping AGENTS.md/CLAUDE.md should change `systemPrompt: replace` to `systemPrompt: replace-all`.
|
|
101
107
|
|
|
102
|
-
|
|
108
|
+
Available subagents are supplied through the active `subagent` tool's `promptGuidelines`, after `PI_SUBAGENT_ALLOWED` and recursion depth filtering are applied.
|
|
103
109
|
|
|
104
110
|
### Debug a sub-agent prompt
|
|
105
111
|
|
|
@@ -112,24 +118,24 @@ debug: true
|
|
|
112
118
|
---
|
|
113
119
|
```
|
|
114
120
|
|
|
115
|
-
The child process writes `debug-system-prompt.md` in the project cwd. The file contains the prompt visible during `before_agent_start`, including `systemPrompt` append/replace/replace-all behavior, tools/guidelines, skills, project context files in append and replace modes, and
|
|
121
|
+
The child process writes `debug-system-prompt.md` in the project cwd. The file contains the prompt visible during `before_agent_start`, including `systemPrompt` append/replace/replace-all behavior, tools/guidelines, skills, project context files in append and replace modes, and active tool prompt metadata.
|
|
116
122
|
|
|
117
123
|
## Agent configuration
|
|
118
124
|
|
|
119
125
|
Agents are Markdown files with YAML frontmatter.
|
|
120
126
|
|
|
121
|
-
| Field
|
|
122
|
-
|
|
123
|
-
| `name`
|
|
124
|
-
| `description`
|
|
125
|
-
| `tools`
|
|
126
|
-
| `model`
|
|
127
|
-
| `thinking`
|
|
128
|
-
| `systemPrompt`
|
|
129
|
-
| `skills`
|
|
130
|
-
| `allowedAgents` | no
|
|
131
|
-
| `maxDepth`
|
|
132
|
-
| `debug`
|
|
127
|
+
| Field | Required | Default | Description |
|
|
128
|
+
| --------------- | -------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
129
|
+
| `name` | **yes** | — | Unique agent identifier |
|
|
130
|
+
| `description` | no | — | Human-readable summary |
|
|
131
|
+
| `tools` | no | _none_ | Comma-separated tool whitelist (`read, write, bash, grep`, etc.) |
|
|
132
|
+
| `model` | no | parent's model | Provider/model-id (`anthropic/claude-sonnet-4-6`) |
|
|
133
|
+
| `thinking` | no | `off` | Reasoning level: `off`, `minimal`, `low`, `medium`, `high`, `xhigh` |
|
|
134
|
+
| `systemPrompt` | no | `append` | How the body is applied: `append` (append to pi default system prompt and project context), `replace` (replace pi default prompt while keeping project context), or `replace-all` (replace pi default prompt and skip project context). In `replace` modes, the runtime tools/guidelines block is injected automatically. |
|
|
135
|
+
| `skills` | no | _none_ | Comma-separated skill names or simple wildcard patterns (`*`, `obsidian-*`) to load (resolved from project `.agents/skills/`, `.pi/skills/`, global `~/.pi/agent/skills/`, or npm packages) |
|
|
136
|
+
| `allowedAgents` | no | _all_ | Comma-separated list of sub-agents this agent may spawn |
|
|
137
|
+
| `maxDepth` | no | `10` | Maximum recursion depth (`0` = no sub-agents, `1` = one level, etc.) |
|
|
138
|
+
| `debug` | no | `false` | When `true`, export the effective runtime system prompt to `debug-system-prompt.md` |
|
|
133
139
|
|
|
134
140
|
The Markdown body after the frontmatter is the agent's system prompt.
|
|
135
141
|
|
|
@@ -159,10 +165,10 @@ them to specialist agents. Combine their results and report a summary.
|
|
|
159
165
|
|
|
160
166
|
Agents are discovered from two locations (project overrides global):
|
|
161
167
|
|
|
162
|
-
| Scope
|
|
163
|
-
|
|
164
|
-
| Global
|
|
165
|
-
| Project | `.pi/agents/*.md`
|
|
168
|
+
| Scope | Path |
|
|
169
|
+
| ------- | ------------------------- |
|
|
170
|
+
| Global | `~/.pi/agent/agents/*.md` |
|
|
171
|
+
| Project | `.pi/agents/*.md` |
|
|
166
172
|
|
|
167
173
|
Only `.md` files are scanned. Files are parsed at extension load time; parse errors produce warnings but don't block other agents.
|
|
168
174
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as fs from 'node:fs/promises';
|
|
2
2
|
import * as os from 'node:os';
|
|
3
3
|
import * as path from 'node:path';
|
|
4
|
+
import { LEGACY_RUNTIME_TOOLS_MARKER } from './subagent-prompt.ts';
|
|
4
5
|
|
|
5
6
|
export type ThinkingLevel = 'off' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
|
|
6
7
|
export type SystemPromptMode = 'replace' | 'replace-all' | 'append';
|
|
@@ -126,13 +127,14 @@ function parseAgentFile(content: string, filePath: string, source: AgentSource):
|
|
|
126
127
|
debug = data.debug === 'true';
|
|
127
128
|
}
|
|
128
129
|
|
|
130
|
+
const tools = splitCsv(data.tools);
|
|
129
131
|
const allowedAgents = splitCsv(data.allowedAgents);
|
|
130
132
|
const skills = splitCsv(data.skills);
|
|
131
133
|
|
|
132
134
|
return {
|
|
133
135
|
name: data.name,
|
|
134
136
|
description: data.description,
|
|
135
|
-
tools
|
|
137
|
+
tools,
|
|
136
138
|
skills: skills.length > 0 ? skills : undefined,
|
|
137
139
|
model: data.model || undefined,
|
|
138
140
|
thinking,
|
|
@@ -140,7 +142,7 @@ function parseAgentFile(content: string, filePath: string, source: AgentSource):
|
|
|
140
142
|
allowedAgents: allowedAgents.length > 0 ? allowedAgents : undefined,
|
|
141
143
|
maxDepth,
|
|
142
144
|
debug,
|
|
143
|
-
prompt: body,
|
|
145
|
+
prompt: body.replaceAll(LEGACY_RUNTIME_TOOLS_MARKER, ''),
|
|
144
146
|
source,
|
|
145
147
|
filePath,
|
|
146
148
|
};
|
package/extensions/index.ts
CHANGED
|
@@ -2,11 +2,8 @@ import type { ExtensionAPI } from '@earendil-works/pi-coding-agent';
|
|
|
2
2
|
import * as fs from 'node:fs';
|
|
3
3
|
import * as path from 'node:path';
|
|
4
4
|
import { loadAgentDefinitions } from './agent-loader.ts';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
appendAvailableSubagentsBlock,
|
|
8
|
-
appendAvailableToolsAndGuidelinesBlock,
|
|
9
|
-
} from './subagent-prompt.ts';
|
|
5
|
+
import { isSubagentReplaceSystemPrompt } from './env-utils.ts';
|
|
6
|
+
import { injectRuntimeToolsBlock } from './subagent-prompt.ts';
|
|
10
7
|
import { registerSubagentTool } from './subagent-tool.ts';
|
|
11
8
|
|
|
12
9
|
export default async function (pi: ExtensionAPI) {
|
|
@@ -16,31 +13,27 @@ export default async function (pi: ExtensionAPI) {
|
|
|
16
13
|
console.warn(`[pi-subagents] skipped ${warning.filePath}: ${warning.message}`);
|
|
17
14
|
}
|
|
18
15
|
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
: result.agents;
|
|
23
|
-
const agentNames = agents.map((agent) => agent.name);
|
|
16
|
+
const registerScopedSubagentTool = (allowedAgents?: readonly string[]) => {
|
|
17
|
+
registerSubagentTool(pi, { agents: result.agents, allowedAgents });
|
|
18
|
+
};
|
|
24
19
|
|
|
25
20
|
if (isSubagentReplaceSystemPrompt(process.env)) {
|
|
26
|
-
pi.on('before_agent_start', (event) => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
event.systemPrompt,
|
|
30
|
-
event.systemPromptOptions,
|
|
31
|
-
),
|
|
32
|
-
};
|
|
33
|
-
});
|
|
21
|
+
pi.on('before_agent_start', (event) => ({
|
|
22
|
+
systemPrompt: injectRuntimeToolsBlock(event.systemPrompt, event.systemPromptOptions),
|
|
23
|
+
}));
|
|
34
24
|
}
|
|
35
25
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
26
|
+
pi.events.on('pi-subagents:configure', (configuration: unknown) => {
|
|
27
|
+
const allowedAgents =
|
|
28
|
+
configuration &&
|
|
29
|
+
typeof configuration === 'object' &&
|
|
30
|
+
Array.isArray((configuration as { allowedAgents?: unknown }).allowedAgents)
|
|
31
|
+
? (configuration as { allowedAgents: unknown[] }).allowedAgents.filter(
|
|
32
|
+
(name): name is string => typeof name === 'string',
|
|
33
|
+
)
|
|
34
|
+
: undefined;
|
|
35
|
+
registerScopedSubagentTool(allowedAgents);
|
|
36
|
+
});
|
|
44
37
|
|
|
45
38
|
if (process.env.PI_SUBAGENT_DEBUG === 'true') {
|
|
46
39
|
pi.on('before_agent_start', (_event, ctx) => {
|
|
@@ -50,5 +43,5 @@ export default async function (pi: ExtensionAPI) {
|
|
|
50
43
|
});
|
|
51
44
|
}
|
|
52
45
|
|
|
53
|
-
|
|
46
|
+
registerScopedSubagentTool();
|
|
54
47
|
}
|
|
@@ -6,9 +6,10 @@ import {
|
|
|
6
6
|
import { spawn } from 'node:child_process';
|
|
7
7
|
import * as fs from 'node:fs/promises';
|
|
8
8
|
import * as os from 'node:os';
|
|
9
|
+
import { existsSync } from 'node:fs';
|
|
9
10
|
import * as path from 'node:path';
|
|
10
|
-
import { fileURLToPath } from 'node:url';
|
|
11
11
|
import type { AgentConfig } from './agent-loader.ts';
|
|
12
|
+
import { AUTO_RUNTIME_TOOLS_MARKER } from './subagent-prompt.ts';
|
|
12
13
|
import { resolveSkills } from './skill-resolver.ts';
|
|
13
14
|
|
|
14
15
|
export interface AgentUsage {
|
|
@@ -58,7 +59,13 @@ export interface AgentResult extends AgentProgress {
|
|
|
58
59
|
|
|
59
60
|
export interface PiResolution {
|
|
60
61
|
command: string;
|
|
61
|
-
entryPoint: string;
|
|
62
|
+
entryPoint: string | null;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface PiRuntime {
|
|
66
|
+
currentScript?: string;
|
|
67
|
+
execPath: string;
|
|
68
|
+
fileExists(filePath: string): boolean;
|
|
62
69
|
}
|
|
63
70
|
|
|
64
71
|
export interface ProcessInvocation {
|
|
@@ -170,14 +177,25 @@ export function subagentSessionDir(
|
|
|
170
177
|
return path.join(agentDir, 'sessions', safeProject, 'subagents');
|
|
171
178
|
}
|
|
172
179
|
|
|
173
|
-
export function resolvePiEntryPoint(
|
|
174
|
-
|
|
175
|
-
|
|
180
|
+
export function resolvePiEntryPoint(
|
|
181
|
+
runtime: PiRuntime = {
|
|
182
|
+
currentScript: process.argv[1],
|
|
183
|
+
execPath: process.execPath,
|
|
184
|
+
fileExists: existsSync,
|
|
185
|
+
},
|
|
186
|
+
): PiResolution {
|
|
187
|
+
const currentScript = runtime.currentScript;
|
|
188
|
+
const isBunVirtualScript = currentScript?.startsWith('/$bunfs/root/');
|
|
176
189
|
|
|
177
|
-
|
|
178
|
-
command:
|
|
179
|
-
|
|
180
|
-
|
|
190
|
+
if (currentScript && !isBunVirtualScript && runtime.fileExists(currentScript)) {
|
|
191
|
+
return { command: runtime.execPath, entryPoint: currentScript };
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
const execName = path.basename(runtime.execPath).toLowerCase();
|
|
195
|
+
const isGenericRuntime = /^(node|bun)(\.exe)?$/.test(execName);
|
|
196
|
+
if (!isGenericRuntime) return { command: runtime.execPath, entryPoint: null };
|
|
197
|
+
|
|
198
|
+
return { command: 'pi', entryPoint: null };
|
|
181
199
|
}
|
|
182
200
|
|
|
183
201
|
export const defaultRunner: ProcessRunner = (invocation, handlers, signal) =>
|
|
@@ -380,6 +398,12 @@ export async function buildSubagentSystemPrompt(
|
|
|
380
398
|
options: BuildSubagentSystemPromptOptions,
|
|
381
399
|
): Promise<BuildSubagentSystemPromptResult> {
|
|
382
400
|
let prompt = options.agent.prompt;
|
|
401
|
+
if (
|
|
402
|
+
options.agent.systemPromptMode === 'replace' ||
|
|
403
|
+
options.agent.systemPromptMode === 'replace-all'
|
|
404
|
+
) {
|
|
405
|
+
prompt = `${prompt}\n\n${AUTO_RUNTIME_TOOLS_MARKER}`;
|
|
406
|
+
}
|
|
383
407
|
|
|
384
408
|
const missingSkills: string[] = [];
|
|
385
409
|
const skippedSkillPackages: string[] = [];
|
|
@@ -476,7 +500,14 @@ export async function runSubagent(options: RunSubagentOptions): Promise<AgentRes
|
|
|
476
500
|
modelsPath: options.agentDir ? path.join(options.agentDir, 'models.json') : undefined,
|
|
477
501
|
});
|
|
478
502
|
const modelRegistry = new ModelRegistry(runtime);
|
|
479
|
-
const args = [
|
|
503
|
+
const args = [
|
|
504
|
+
...(pi.entryPoint ? [pi.entryPoint] : []),
|
|
505
|
+
'--mode',
|
|
506
|
+
'json',
|
|
507
|
+
'-p',
|
|
508
|
+
'--no-skills',
|
|
509
|
+
'--no-prompt-templates',
|
|
510
|
+
];
|
|
480
511
|
|
|
481
512
|
if (options.agent.systemPromptMode === 'replace-all') args.push('--no-context-files');
|
|
482
513
|
if (options.agent.model) args.push('--model', options.agent.model);
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export const AUTO_RUNTIME_TOOLS_MARKER = '<pi-subagents-runtime-tools />';
|
|
2
|
+
export const LEGACY_RUNTIME_TOOLS_MARKER = '<pi-runtime-tools />';
|
|
3
|
+
|
|
1
4
|
export interface ToolGuidelinePromptOptions {
|
|
2
5
|
selectedTools?: string[];
|
|
3
6
|
toolSnippets?: Record<string, string>;
|
|
@@ -50,38 +53,15 @@ export function formatAvailableToolsAndGuidelinesBlock(
|
|
|
50
53
|
].join('\n');
|
|
51
54
|
}
|
|
52
55
|
|
|
53
|
-
function
|
|
54
|
-
const marker = '\nCurrent date:';
|
|
55
|
-
const index = systemPrompt.lastIndexOf(marker);
|
|
56
|
-
if (index === -1) return `${systemPrompt.trimEnd()}\n\n${block}`;
|
|
57
|
-
|
|
58
|
-
const before = systemPrompt.slice(0, index).trimEnd();
|
|
59
|
-
const after = systemPrompt.slice(index);
|
|
60
|
-
return `${before}\n\n${block}${after}`;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export function appendAvailableToolsAndGuidelinesBlock(
|
|
56
|
+
export function injectRuntimeToolsBlock(
|
|
64
57
|
systemPrompt: string,
|
|
65
58
|
options: ToolGuidelinePromptOptions,
|
|
66
59
|
): string {
|
|
67
|
-
const block = formatAvailableToolsAndGuidelinesBlock(options);
|
|
68
|
-
if (
|
|
69
|
-
return systemPrompt
|
|
60
|
+
const block = formatAvailableToolsAndGuidelinesBlock(options) ?? '';
|
|
61
|
+
if (systemPrompt.includes(AUTO_RUNTIME_TOOLS_MARKER)) {
|
|
62
|
+
return systemPrompt
|
|
63
|
+
.replace(AUTO_RUNTIME_TOOLS_MARKER, block)
|
|
64
|
+
.replaceAll(LEGACY_RUNTIME_TOOLS_MARKER, '');
|
|
70
65
|
}
|
|
71
|
-
|
|
72
|
-
return appendBeforeTrailingRuntimeMetadata(systemPrompt, block);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export function formatAvailableSubagentsBlock(agentNames: string[]): string | undefined {
|
|
76
|
-
const names = [...new Set(agentNames.map((name) => name.trim()).filter(Boolean))].sort();
|
|
77
|
-
if (names.length === 0) return undefined;
|
|
78
|
-
|
|
79
|
-
return ['Available subagents:', ...names.map((name) => `- ${name}`)].join('\n');
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export function appendAvailableSubagentsBlock(systemPrompt: string, agentNames: string[]): string {
|
|
83
|
-
const block = formatAvailableSubagentsBlock(agentNames);
|
|
84
|
-
if (!block || systemPrompt.includes(block)) return systemPrompt;
|
|
85
|
-
|
|
86
|
-
return `${systemPrompt.trimEnd()}\n\n${block}`;
|
|
66
|
+
return systemPrompt.replace(LEGACY_RUNTIME_TOOLS_MARKER, block);
|
|
87
67
|
}
|
|
@@ -59,6 +59,8 @@ export interface RegisterSubagentToolOptions {
|
|
|
59
59
|
agents: AgentConfig[];
|
|
60
60
|
run?: typeof runSubagent;
|
|
61
61
|
env?: RecursionEnv;
|
|
62
|
+
/** Explicit allowlist for the current session. An empty list disables delegation. */
|
|
63
|
+
allowedAgents?: readonly string[];
|
|
62
64
|
agentDir?: string;
|
|
63
65
|
}
|
|
64
66
|
|
|
@@ -300,7 +302,8 @@ export function registerSubagentTool(
|
|
|
300
302
|
const env: RecursionEnv = options.env ?? process.env;
|
|
301
303
|
if (isPastMaxDepth(env)) return;
|
|
302
304
|
|
|
303
|
-
const allowed =
|
|
305
|
+
const allowed =
|
|
306
|
+
options.allowedAgents === undefined ? allowedAgentNames(env) : new Set(options.allowedAgents);
|
|
304
307
|
const agents = allowed
|
|
305
308
|
? options.agents.filter((candidate) => allowed.has(candidate.name))
|
|
306
309
|
: options.agents;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@johnnywu/pi-subagents",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "Sub-agents extension for pi coding agent.",
|
|
5
5
|
"homepage": "https://github.com/jwu/pi-subagents#readme",
|
|
6
6
|
"repository": {
|
|
@@ -82,13 +82,14 @@
|
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
84
84
|
"@earendil-works/pi-ai": "*",
|
|
85
|
-
"@earendil-works/pi-coding-agent": ">=0.
|
|
85
|
+
"@earendil-works/pi-coding-agent": ">=0.83.0",
|
|
86
86
|
"@earendil-works/pi-tui": "*",
|
|
87
87
|
"typebox": "*"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
90
|
"@commitlint/cli": "^20.5.3",
|
|
91
91
|
"@commitlint/config-conventional": "^20.5.3",
|
|
92
|
+
"@earendil-works/pi-coding-agent": "0.84.3",
|
|
92
93
|
"@semantic-release/changelog": "^6.0.3",
|
|
93
94
|
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
94
95
|
"@semantic-release/git": "^10.0.1",
|