@elyracode/subagents 0.9.58 → 1.0.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 +21 -0
- package/README.md +25 -17
- package/extensions/agents.ts +19 -10
- package/extensions/index.ts +423 -183
- package/package.json +10 -3
- package/skills/elyra-subagents/SKILL.md +4 -2
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [1.0.1] - 2026-11-22
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Peer dependency on `@elyracode/coding-agent` is now `>=1.0.0`, the first version with the APIs this package uses
|
|
8
|
+
|
|
9
|
+
## [1.0.0] - 2026-11-22
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- `subagent`, `parallel_subagents`, and `orchestrate_workflow` now run real child agents: each subagent is a separate Elyra process (the same executable as the parent session) with its own context, the agent's role as appended system prompt, and the parent's model, thinking level, and project trust. Previously the tools only returned instructions for the parent agent to follow. Tool results contain the children's final reports and report their usage as `details.modelUsage`, so session cost includes them
|
|
14
|
+
- Agent tool allowlists are enforced through `--tools`. Read-only agents (scout, reviewer, planner, oracle, researcher) get `read,grep,find,ls` (researcher also `read_url_content`) and no longer have `bash`; worker and delegate keep the built-in editing tools. A `tools` override can only narrow a read-only agent's list
|
|
15
|
+
- `subagent` accepts optional `tools` and `model` overrides; `parallel_subagents` tasks accept `context`
|
|
16
|
+
- `parallel_subagents` runs at most 4 children at a time
|
|
17
|
+
- `orchestrate_workflow` runs steps in order and passes every earlier step's output to the next step; `deep-review` runs its three reviewers in parallel before the synthesis step, and the workflow stops at the first failed step
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- Fixed subagents being able to start further subagents without limit: agent-spawning tools are removed from children's allowlists, and child spawns beyond nesting depth 2 are refused
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @elyracode/subagents
|
|
2
2
|
|
|
3
|
-
Subagent delegation for Elyra -- scout, review, plan, implement, and get second opinions with focused child agents.
|
|
3
|
+
Subagent delegation for Elyra -- scout, review, plan, implement, and get second opinions with focused child agents. Every subagent is a separate Elyra process with its own context window and an enforced tool allowlist.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -10,15 +10,17 @@ elyra install npm:@elyracode/subagents
|
|
|
10
10
|
|
|
11
11
|
## Agents
|
|
12
12
|
|
|
13
|
-
| Agent | Use when you want... |
|
|
14
|
-
|
|
15
|
-
| `scout` | Fast codebase recon: files, structure, data flow, risks |
|
|
16
|
-
| `reviewer` | Code review: correctness, tests, edge cases, security, simplicity |
|
|
17
|
-
| `planner` | Implementation plan: concrete steps with file paths |
|
|
18
|
-
| `worker` | Implementation: edits files, validates, follows the plan |
|
|
19
|
-
| `oracle` | Second opinion: challenges assumptions, catches drift |
|
|
20
|
-
| `researcher` | External research: docs, specs, recent changes |
|
|
21
|
-
| `delegate` | General-purpose child agent for ad-hoc tasks |
|
|
13
|
+
| Agent | Use when you want... | Tools |
|
|
14
|
+
|-------|---------------------|-------|
|
|
15
|
+
| `scout` | Fast codebase recon: files, structure, data flow, risks | read, grep, find, ls |
|
|
16
|
+
| `reviewer` | Code review: correctness, tests, edge cases, security, simplicity | read, grep, find, ls |
|
|
17
|
+
| `planner` | Implementation plan: concrete steps with file paths | read, grep, find, ls |
|
|
18
|
+
| `worker` | Implementation: edits files, validates, follows the plan | read, write, edit, bash, grep, find, ls |
|
|
19
|
+
| `oracle` | Second opinion: challenges assumptions, catches drift | read, grep, find, ls |
|
|
20
|
+
| `researcher` | External research: docs, specs, recent changes | read, grep, find, ls, read_url_content |
|
|
21
|
+
| `delegate` | General-purpose child agent for ad-hoc tasks | read, write, edit, bash, grep, find, ls |
|
|
22
|
+
|
|
23
|
+
Read-only agents have no shell. Give them diffs or command output through the task or `context`.
|
|
22
24
|
|
|
23
25
|
## Usage
|
|
24
26
|
|
|
@@ -49,7 +51,7 @@ Have worker implement this plan, then run reviewer to check it.
|
|
|
49
51
|
|----------|---------|-------|
|
|
50
52
|
| **Build Feature** | `/build-feature` | scout -> planner -> oracle -> worker -> reviewer -> worker (fix) |
|
|
51
53
|
| **UI Review** | `/ui-review` | worker (build) -> reviewer (screenshot + visual QA) -> worker (fix) -> reviewer (verify) |
|
|
52
|
-
| **Deep Review** | `/deep-review` | reviewer (correctness)
|
|
54
|
+
| **Deep Review** | `/deep-review` | reviewer (correctness) + reviewer (tests) + reviewer (security) in parallel -> oracle (synthesis) |
|
|
53
55
|
| **Git Review** | `/git-review` | review git diff for correctness, security, tests, code debt, design consistency |
|
|
54
56
|
|
|
55
57
|
## Git Integration
|
|
@@ -73,10 +75,16 @@ scout -> planner -> worker -> reviewer -> worker (fixes)
|
|
|
73
75
|
|
|
74
76
|
## How it works
|
|
75
77
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
Each subagent is a child Elyra process started by the `subagent`, `parallel_subagents`, or `orchestrate_workflow` tool:
|
|
79
|
+
|
|
80
|
+
1. The child runs the same Elyra executable as your session (not an `elyra` found on PATH) in JSON print mode, without a saved session, in the session's working directory.
|
|
81
|
+
2. It gets the agent's role as an appended system prompt, the task and context as its prompt, and your current model and thinking level (`subagent` accepts a `model` override).
|
|
82
|
+
3. Its tools are restricted with `--tools`, so read-only agents cannot edit files or run commands. Tools of other installed extensions are only available when listed.
|
|
83
|
+
4. It inherits your project trust decision, so project extensions and MCP config load as in your session.
|
|
84
|
+
5. Its final message comes back as the tool result, together with turns, tool calls, duration, and cost. The cost is added to your session cost.
|
|
85
|
+
|
|
86
|
+
`parallel_subagents` runs at most 4 children at a time. Children share the working tree, so do not run several editing agents (worker, delegate) on overlapping files at once. `orchestrate_workflow` runs steps in order, passes every earlier step's output to the next step, and stops at the first failed step.
|
|
87
|
+
|
|
88
|
+
Each child has a 10 minute timeout, and aborting the parent tool call kills the child's process tree. A child does not see your conversation: put everything it needs in the task or context.
|
|
81
89
|
|
|
82
|
-
|
|
90
|
+
Children cannot start further subagents: agent-spawning tools are removed from their allowlist, and Elyra refuses child spawns beyond nesting depth 2.
|
package/extensions/agents.ts
CHANGED
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Builtin agent definitions for elyra-subagents.
|
|
3
|
+
*
|
|
4
|
+
* `tools` is passed to the child Elyra process as its `--tools` allowlist, so it is enforced:
|
|
5
|
+
* a tool that is not listed does not exist for the child. Read-only agents get no bash, edit,
|
|
6
|
+
* or write. Names of tools that are not installed are ignored by the child.
|
|
3
7
|
*/
|
|
4
8
|
|
|
5
9
|
export interface AgentDefinition {
|
|
6
10
|
name: string;
|
|
7
11
|
description: string;
|
|
8
12
|
systemPrompt: string;
|
|
9
|
-
tools
|
|
13
|
+
tools: string[];
|
|
10
14
|
readOnly?: boolean;
|
|
11
15
|
}
|
|
12
16
|
|
|
17
|
+
const READ_ONLY_TOOLS = ["read", "grep", "find", "ls"];
|
|
18
|
+
const WRITE_TOOLS = ["read", "write", "edit", "bash", "grep", "find", "ls"];
|
|
19
|
+
|
|
13
20
|
export const BUILTIN_AGENTS: Record<string, AgentDefinition> = {
|
|
14
21
|
scout: {
|
|
15
22
|
name: "scout",
|
|
@@ -26,8 +33,9 @@ Rules:
|
|
|
26
33
|
- Read files, don't edit them
|
|
27
34
|
- Be fast and focused -- don't analyze everything, focus on what's relevant
|
|
28
35
|
- Report findings in a structured format with file paths
|
|
29
|
-
- Flag anything unusual or risky
|
|
30
|
-
|
|
36
|
+
- Flag anything unusual or risky
|
|
37
|
+
- You have no shell: use read, grep, find, and ls`,
|
|
38
|
+
tools: READ_ONLY_TOOLS,
|
|
31
39
|
readOnly: true,
|
|
32
40
|
},
|
|
33
41
|
|
|
@@ -48,8 +56,9 @@ Rules:
|
|
|
48
56
|
- Be specific: reference file paths and line numbers
|
|
49
57
|
- Categorize issues as: critical, warning, suggestion
|
|
50
58
|
- Suggest fixes, not just problems
|
|
51
|
-
- Keep it concise -- no praise, just findings
|
|
52
|
-
|
|
59
|
+
- Keep it concise -- no praise, just findings
|
|
60
|
+
- You have no shell: review what you can read; diffs and command output arrive in the task context`,
|
|
61
|
+
tools: READ_ONLY_TOOLS,
|
|
53
62
|
readOnly: true,
|
|
54
63
|
},
|
|
55
64
|
|
|
@@ -71,7 +80,7 @@ Rules:
|
|
|
71
80
|
- Consider edge cases and error handling
|
|
72
81
|
- Do NOT edit files -- planning only
|
|
73
82
|
- Flag risks and decisions that need human input`,
|
|
74
|
-
tools:
|
|
83
|
+
tools: READ_ONLY_TOOLS,
|
|
75
84
|
readOnly: true,
|
|
76
85
|
},
|
|
77
86
|
|
|
@@ -87,7 +96,7 @@ Rules:
|
|
|
87
96
|
- If something is unclear, report it instead of guessing
|
|
88
97
|
- Keep changes minimal and focused on the task
|
|
89
98
|
- Commit nothing -- leave that to the parent session`,
|
|
90
|
-
tools:
|
|
99
|
+
tools: WRITE_TOOLS,
|
|
91
100
|
},
|
|
92
101
|
|
|
93
102
|
oracle: {
|
|
@@ -107,7 +116,7 @@ Rules:
|
|
|
107
116
|
- Be constructive but direct -- no sugarcoating
|
|
108
117
|
- Prioritize: what's the most dangerous assumption?
|
|
109
118
|
- End with a clear recommendation`,
|
|
110
|
-
tools:
|
|
119
|
+
tools: READ_ONLY_TOOLS,
|
|
111
120
|
readOnly: true,
|
|
112
121
|
},
|
|
113
122
|
|
|
@@ -128,7 +137,7 @@ Rules:
|
|
|
128
137
|
- If using read_url_content, fetch the actual docs
|
|
129
138
|
- Be concise: bullet points, not essays
|
|
130
139
|
- Cite your sources`,
|
|
131
|
-
tools: [
|
|
140
|
+
tools: [...READ_ONLY_TOOLS, "read_url_content"],
|
|
132
141
|
readOnly: true,
|
|
133
142
|
},
|
|
134
143
|
|
|
@@ -142,6 +151,6 @@ Rules:
|
|
|
142
151
|
- Report results clearly and concisely
|
|
143
152
|
- If the task is unclear, state what you understood and what's ambiguous
|
|
144
153
|
- Do not take on additional work beyond the task`,
|
|
145
|
-
tools:
|
|
154
|
+
tools: WRITE_TOOLS,
|
|
146
155
|
},
|
|
147
156
|
};
|
package/extensions/index.ts
CHANGED
|
@@ -1,137 +1,434 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
AgentToolResult,
|
|
3
|
+
AgentToolUpdateCallback,
|
|
4
|
+
ChildAgentInvocation,
|
|
5
|
+
ChildAgentResult,
|
|
6
|
+
ExtensionAPI,
|
|
7
|
+
ExtensionContext,
|
|
8
|
+
} from "@elyracode/coding-agent";
|
|
9
|
+
import { runChildAgent, sumChildAgentUsage } from "@elyracode/coding-agent";
|
|
2
10
|
import { Type } from "typebox";
|
|
3
11
|
import { type AgentDefinition, BUILTIN_AGENTS } from "./agents.js";
|
|
4
12
|
|
|
13
|
+
type ModelUsage = NonNullable<ChildAgentResult["usage"]>;
|
|
14
|
+
|
|
15
|
+
/** Default number of child agents running at once in parallel_subagents and parallel workflow steps. */
|
|
16
|
+
const DEFAULT_CONCURRENCY = 4;
|
|
17
|
+
/** Cap on each workflow step's output passed on to later steps. */
|
|
18
|
+
const STEP_OUTPUT_CHARS = 20_000;
|
|
19
|
+
|
|
20
|
+
export interface SubagentsOptions {
|
|
21
|
+
/** Executable used for child agents. Defaults to the running Elyra (tests inject a fake). */
|
|
22
|
+
invocation?: ChildAgentInvocation;
|
|
23
|
+
/** Maximum child agents running at once. Default 4. */
|
|
24
|
+
concurrency?: number;
|
|
25
|
+
/** Per-child timeout in milliseconds. Default: the runner's default (10 minutes). */
|
|
26
|
+
timeoutMs?: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Summary of one child run, reported in tool details. */
|
|
30
|
+
interface SubagentRunSummary {
|
|
31
|
+
agent: string;
|
|
32
|
+
status: ChildAgentResult["status"];
|
|
33
|
+
tools: string[];
|
|
34
|
+
turns: number;
|
|
35
|
+
toolCalls: number;
|
|
36
|
+
durationMs: number;
|
|
37
|
+
error?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
5
40
|
/** Details reported by the subagent tool. */
|
|
6
|
-
interface SubagentDetails {
|
|
7
|
-
agent?: string;
|
|
41
|
+
interface SubagentDetails extends Partial<SubagentRunSummary> {
|
|
8
42
|
readOnly?: boolean;
|
|
43
|
+
modelUsage?: ModelUsage;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Details reported by parallel_subagents. */
|
|
47
|
+
interface ParallelDetails {
|
|
48
|
+
agentCount: number;
|
|
49
|
+
runs: SubagentRunSummary[];
|
|
50
|
+
modelUsage?: ModelUsage;
|
|
9
51
|
}
|
|
10
52
|
|
|
11
53
|
/** Details reported by orchestrate_workflow. */
|
|
12
54
|
interface OrchestrateDetails {
|
|
13
55
|
workflow?: string;
|
|
14
56
|
steps?: number;
|
|
57
|
+
runs?: SubagentRunSummary[];
|
|
58
|
+
failedStep?: number;
|
|
59
|
+
modelUsage?: ModelUsage;
|
|
15
60
|
}
|
|
16
61
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
62
|
+
interface AgentRequest {
|
|
63
|
+
agent: AgentDefinition;
|
|
64
|
+
task: string;
|
|
65
|
+
context?: string;
|
|
66
|
+
/** Requested allowlist. Read-only agents can only narrow their default list. */
|
|
67
|
+
tools?: string[];
|
|
68
|
+
/** Tools added on top of the allowlist (workflow steps that need e.g. screenshot tools). */
|
|
69
|
+
extraTools?: string[];
|
|
70
|
+
model?: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** The child's tool allowlist: read-only agents never gain tools beyond their definition. */
|
|
74
|
+
export function resolveAgentTools(agent: AgentDefinition, requested?: string[], extra: string[] = []): string[] {
|
|
75
|
+
let base = agent.tools;
|
|
76
|
+
if (requested && requested.length > 0) {
|
|
77
|
+
const narrowed = agent.readOnly ? requested.filter((name) => agent.tools.includes(name)) : requested;
|
|
78
|
+
if (narrowed.length > 0) base = narrowed;
|
|
79
|
+
}
|
|
80
|
+
return [...new Set([...base, ...extra])];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function buildChildPrompt(task: string, context?: string): string {
|
|
84
|
+
const parts = ["## Task", task];
|
|
85
|
+
if (context) parts.push("", "## Context", context);
|
|
86
|
+
parts.push(
|
|
87
|
+
"",
|
|
88
|
+
"You are running as a child agent with your own context. Your final message is returned to the parent agent: " +
|
|
89
|
+
"make it a complete, self-contained report of your findings or results.",
|
|
90
|
+
);
|
|
91
|
+
return parts.join("\n");
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function buildRoleSystemPrompt(agent: AgentDefinition): string {
|
|
95
|
+
const parts = [`# Subagent role: ${agent.name}`, "", agent.systemPrompt];
|
|
96
|
+
if (agent.readOnly) {
|
|
97
|
+
parts.push("", "You are read-only: you have no tools that edit files or run commands.");
|
|
98
|
+
}
|
|
99
|
+
return parts.join("\n");
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function formatStats(result: ChildAgentResult): string {
|
|
103
|
+
const cost = result.usage ? `, $${result.usage.cost.total.toFixed(3)}` : "";
|
|
104
|
+
return `${result.turns} turns, ${result.toolCalls} tool calls, ${(result.durationMs / 1000).toFixed(1)}s${cost}`;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function formatRun(heading: string, result: ChildAgentResult): string {
|
|
108
|
+
if (result.status === "ok") {
|
|
109
|
+
return `## ${heading}\n\n${result.text}\n\n_${formatStats(result)}_`;
|
|
110
|
+
}
|
|
111
|
+
const partial = result.text ? `\n\nPartial output:\n\n${result.text}` : "";
|
|
112
|
+
return `## ${heading} (${result.status})\n\n${result.error ?? "Child agent failed"}${partial}`;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function summarize(agent: string, tools: string[], result: ChildAgentResult): SubagentRunSummary {
|
|
116
|
+
return {
|
|
117
|
+
agent,
|
|
118
|
+
status: result.status,
|
|
119
|
+
tools,
|
|
120
|
+
turns: result.turns,
|
|
121
|
+
toolCalls: result.toolCalls,
|
|
122
|
+
durationMs: result.durationMs,
|
|
123
|
+
error: result.error,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** Run `fn` over `items` with at most `limit` calls in flight; results keep input order. */
|
|
128
|
+
export async function mapWithConcurrency<T, R>(
|
|
129
|
+
items: readonly T[],
|
|
130
|
+
limit: number,
|
|
131
|
+
fn: (item: T, index: number) => Promise<R>,
|
|
132
|
+
): Promise<R[]> {
|
|
133
|
+
const results = new Array<R>(items.length);
|
|
134
|
+
let next = 0;
|
|
135
|
+
const worker = async () => {
|
|
136
|
+
while (next < items.length) {
|
|
137
|
+
const index = next++;
|
|
138
|
+
results[index] = await fn(items[index]!, index);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
await Promise.all(Array.from({ length: Math.max(1, Math.min(limit, items.length)) }, worker));
|
|
142
|
+
return results;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function unknownAgentMessage(name: string): string {
|
|
146
|
+
return `Unknown agent: ${name}. Available: ${Object.keys(BUILTIN_AGENTS).join(", ")}`;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export function createSubagentsExtension(options: SubagentsOptions = {}): (elyra: ExtensionAPI) => void {
|
|
150
|
+
const concurrency = Math.max(1, options.concurrency ?? DEFAULT_CONCURRENCY);
|
|
151
|
+
|
|
152
|
+
return (elyra: ExtensionAPI): void => {
|
|
153
|
+
/** Start one child agent for `request` in the session's working directory. */
|
|
154
|
+
const runAgent = (
|
|
155
|
+
request: AgentRequest,
|
|
156
|
+
ctx: ExtensionContext,
|
|
157
|
+
signal: AbortSignal | undefined,
|
|
158
|
+
onProgress?: (line: string) => void,
|
|
159
|
+
maxOutputChars?: number,
|
|
160
|
+
): Promise<{ result: ChildAgentResult; tools: string[] }> => {
|
|
161
|
+
const tools = resolveAgentTools(request.agent, request.tools, request.extraTools);
|
|
162
|
+
const parentModel = ctx.model ? `${ctx.model.provider}/${ctx.model.id}` : undefined;
|
|
163
|
+
return runChildAgent({
|
|
164
|
+
prompt: buildChildPrompt(request.task, request.context),
|
|
165
|
+
appendSystemPrompt: buildRoleSystemPrompt(request.agent),
|
|
166
|
+
cwd: ctx.cwd,
|
|
167
|
+
env: ctx.getChildAgentEnv(),
|
|
168
|
+
tools,
|
|
169
|
+
model: request.model ?? parentModel,
|
|
170
|
+
thinking: elyra.getThinkingLevel(),
|
|
171
|
+
signal,
|
|
172
|
+
timeoutMs: options.timeoutMs,
|
|
173
|
+
maxOutputChars,
|
|
174
|
+
invocation: options.invocation,
|
|
175
|
+
onProgress: (progress) => {
|
|
176
|
+
const last = progress.lastTool ? `, last: ${progress.lastTool}` : "";
|
|
177
|
+
onProgress?.(`${request.agent.name}: ${progress.toolCalls} tool calls${last}`);
|
|
178
|
+
},
|
|
179
|
+
}).then((result) => ({ result, tools }));
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
// -- Tool: subagent --
|
|
183
|
+
elyra.registerTool({
|
|
184
|
+
name: "subagent",
|
|
185
|
+
label: "Delegate to Subagent",
|
|
186
|
+
description:
|
|
187
|
+
"Run a focused task in a separate child Elyra agent with its own context window and return its final report. " +
|
|
188
|
+
"Available agents: scout (codebase recon), reviewer (code review), planner (implementation planning), " +
|
|
189
|
+
"worker (implementation, edits files), oracle (second opinion), researcher (docs/web research), delegate (general). " +
|
|
190
|
+
"Each agent's tool allowlist is enforced: scout, reviewer, planner, oracle, and researcher are read-only " +
|
|
191
|
+
"(read, grep, find, ls; no shell), worker and delegate can edit files and run bash in the current working tree. " +
|
|
192
|
+
"The child does not see this conversation: put everything it needs (diffs, file paths, prior findings) in task or context.",
|
|
193
|
+
parameters: Type.Object({
|
|
194
|
+
agent: Type.String({
|
|
195
|
+
description: "Agent name: scout, reviewer, planner, worker, oracle, researcher, delegate",
|
|
196
|
+
}),
|
|
197
|
+
task: Type.String({
|
|
198
|
+
description: "The specific task to delegate (be clear and detailed)",
|
|
199
|
+
}),
|
|
200
|
+
context: Type.Optional(
|
|
201
|
+
Type.String({
|
|
202
|
+
description: "Additional context for the subagent (e.g., diffs, file contents, previous analysis)",
|
|
203
|
+
}),
|
|
204
|
+
),
|
|
205
|
+
tools: Type.Optional(
|
|
206
|
+
Type.Array(Type.String(), {
|
|
207
|
+
description:
|
|
208
|
+
"Override the agent's tool allowlist. Read-only agents can only narrow their default list.",
|
|
209
|
+
}),
|
|
210
|
+
),
|
|
211
|
+
model: Type.Optional(
|
|
212
|
+
Type.String({ description: "Model for the child (provider/id). Defaults to the current model." }),
|
|
213
|
+
),
|
|
32
214
|
}),
|
|
33
|
-
|
|
34
|
-
|
|
215
|
+
execute: async (_toolCallId, params, signal, onUpdate, ctx): Promise<AgentToolResult<SubagentDetails>> => {
|
|
216
|
+
const agentDef = BUILTIN_AGENTS[params.agent];
|
|
217
|
+
if (!agentDef) {
|
|
218
|
+
return { content: [{ type: "text", text: unknownAgentMessage(params.agent) }], details: {} };
|
|
219
|
+
}
|
|
220
|
+
const { result, tools } = await runAgent(
|
|
221
|
+
{
|
|
222
|
+
agent: agentDef,
|
|
223
|
+
task: params.task,
|
|
224
|
+
context: params.context,
|
|
225
|
+
tools: params.tools,
|
|
226
|
+
model: params.model,
|
|
227
|
+
},
|
|
228
|
+
ctx,
|
|
229
|
+
signal,
|
|
230
|
+
(line) => onUpdate?.({ content: [{ type: "text", text: line }], details: { agent: agentDef.name } }),
|
|
231
|
+
);
|
|
232
|
+
return {
|
|
233
|
+
content: [{ type: "text", text: formatRun(`${agentDef.name} report`, result) }],
|
|
234
|
+
details: {
|
|
235
|
+
...summarize(agentDef.name, tools, result),
|
|
236
|
+
readOnly: agentDef.readOnly ?? false,
|
|
237
|
+
modelUsage: result.usage,
|
|
238
|
+
},
|
|
239
|
+
};
|
|
240
|
+
},
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
// -- Tool: parallel_subagents --
|
|
244
|
+
elyra.registerTool({
|
|
245
|
+
name: "parallel_subagents",
|
|
246
|
+
label: "Run Parallel Subagents",
|
|
247
|
+
description:
|
|
248
|
+
`Run several subagents as separate child Elyra agents concurrently (at most ${concurrency} at a time) and return all their reports. ` +
|
|
249
|
+
"Useful for parallel review (correctness + tests + security), parallel research (docs + code), " +
|
|
250
|
+
"or any task that benefits from independent focused perspectives. Agents and tool allowlists are the same as for `subagent`. " +
|
|
251
|
+
"Children share the working tree: do not run several file-editing agents (worker, delegate) on overlapping files.",
|
|
252
|
+
parameters: Type.Object({
|
|
253
|
+
tasks: Type.Array(
|
|
254
|
+
Type.Object({
|
|
255
|
+
agent: Type.String({ description: "Agent name" }),
|
|
256
|
+
task: Type.String({ description: "Task for this agent" }),
|
|
257
|
+
context: Type.Optional(Type.String({ description: "Additional context for this agent" })),
|
|
258
|
+
}),
|
|
259
|
+
{ description: "Array of agent+task pairs to run in parallel" },
|
|
260
|
+
),
|
|
35
261
|
}),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const
|
|
262
|
+
execute: async (_toolCallId, params, signal, onUpdate, ctx): Promise<AgentToolResult<ParallelDetails>> => {
|
|
263
|
+
const status = params.tasks.map((t, i) => `${i + 1}. ${t.agent}: queued`);
|
|
264
|
+
const emit = () =>
|
|
265
|
+
onUpdate?.({
|
|
266
|
+
content: [{ type: "text", text: status.join("\n") }],
|
|
267
|
+
details: { agentCount: params.tasks.length, runs: [] },
|
|
268
|
+
});
|
|
269
|
+
emit();
|
|
270
|
+
|
|
271
|
+
const outcomes = await mapWithConcurrency(params.tasks, concurrency, async (taskDef, index) => {
|
|
272
|
+
const agentDef = BUILTIN_AGENTS[taskDef.agent];
|
|
273
|
+
if (!agentDef) {
|
|
274
|
+
status[index] = `${index + 1}. ${taskDef.agent}: unknown agent`;
|
|
275
|
+
emit();
|
|
276
|
+
return undefined;
|
|
277
|
+
}
|
|
278
|
+
status[index] = `${index + 1}. ${agentDef.name}: running`;
|
|
279
|
+
emit();
|
|
280
|
+
const outcome = await runAgent(
|
|
281
|
+
{ agent: agentDef, task: taskDef.task, context: taskDef.context },
|
|
282
|
+
ctx,
|
|
283
|
+
signal,
|
|
284
|
+
(line) => {
|
|
285
|
+
status[index] = `${index + 1}. ${line}`;
|
|
286
|
+
emit();
|
|
287
|
+
},
|
|
288
|
+
);
|
|
289
|
+
status[index] = `${index + 1}. ${agentDef.name}: ${outcome.result.status}`;
|
|
290
|
+
emit();
|
|
291
|
+
return outcome;
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
const sections: string[] = [`# Parallel subagents (${params.tasks.length})`];
|
|
295
|
+
const runs: SubagentRunSummary[] = [];
|
|
296
|
+
const results: ChildAgentResult[] = [];
|
|
297
|
+
params.tasks.forEach((taskDef, index) => {
|
|
298
|
+
const outcome = outcomes[index];
|
|
299
|
+
if (!outcome) {
|
|
300
|
+
sections.push(`## Agent ${index + 1}: ${taskDef.agent}\n\n${unknownAgentMessage(taskDef.agent)}`);
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
sections.push(formatRun(`Agent ${index + 1}: ${taskDef.agent}`, outcome.result));
|
|
304
|
+
runs.push(summarize(taskDef.agent, outcome.tools, outcome.result));
|
|
305
|
+
results.push(outcome.result);
|
|
306
|
+
});
|
|
307
|
+
|
|
46
308
|
return {
|
|
47
|
-
content: [{ type: "text", text:
|
|
48
|
-
details: {},
|
|
309
|
+
content: [{ type: "text", text: sections.join("\n\n") }],
|
|
310
|
+
details: { agentCount: params.tasks.length, runs, modelUsage: sumChildAgentUsage(results) },
|
|
49
311
|
};
|
|
50
|
-
}
|
|
312
|
+
},
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
const runWorkflow = async (
|
|
316
|
+
workflow: Workflow,
|
|
317
|
+
task: string,
|
|
318
|
+
ctx: ExtensionContext,
|
|
319
|
+
signal: AbortSignal | undefined,
|
|
320
|
+
onUpdate: AgentToolUpdateCallback<OrchestrateDetails> | undefined,
|
|
321
|
+
): Promise<AgentToolResult<OrchestrateDetails>> => {
|
|
322
|
+
const stepCount = workflow.steps.length;
|
|
323
|
+
const previousOutputs: string[] = [];
|
|
324
|
+
const transcript: string[] = [];
|
|
325
|
+
const runs: SubagentRunSummary[] = [];
|
|
326
|
+
const results: ChildAgentResult[] = [];
|
|
327
|
+
let failedStep: number | undefined;
|
|
328
|
+
|
|
329
|
+
for (let i = 0; i < stepCount && failedStep === undefined; i++) {
|
|
330
|
+
const step = workflow.steps[i]!;
|
|
331
|
+
const group = Array.isArray(step) ? step : [step];
|
|
332
|
+
const stepLabel = `Step ${i + 1}/${stepCount}: ${group.map((s) => s.agent).join(" + ")}`;
|
|
333
|
+
const progress = (line?: string) =>
|
|
334
|
+
onUpdate?.({
|
|
335
|
+
content: [{ type: "text", text: line ? `${stepLabel}\n${line}` : stepLabel }],
|
|
336
|
+
details: { workflow: workflow.name, steps: stepCount, runs: [...runs] },
|
|
337
|
+
});
|
|
338
|
+
progress();
|
|
339
|
+
|
|
340
|
+
const contextParts = [
|
|
341
|
+
`You are step ${i + 1} of ${stepCount} in the "${workflow.name}" workflow for: ${task}`,
|
|
342
|
+
];
|
|
343
|
+
if (previousOutputs.length > 0) {
|
|
344
|
+
contextParts.push(`Output from earlier steps:\n\n${previousOutputs.join("\n\n---\n\n")}`);
|
|
345
|
+
}
|
|
346
|
+
const context = contextParts.join("\n\n");
|
|
347
|
+
const outcomes = await mapWithConcurrency(group, concurrency, (s) =>
|
|
348
|
+
runAgent(
|
|
349
|
+
{
|
|
350
|
+
agent: BUILTIN_AGENTS[s.agent]!,
|
|
351
|
+
task: s.task.split("{task}").join(task),
|
|
352
|
+
context,
|
|
353
|
+
extraTools: s.extraTools,
|
|
354
|
+
},
|
|
355
|
+
ctx,
|
|
356
|
+
signal,
|
|
357
|
+
progress,
|
|
358
|
+
STEP_OUTPUT_CHARS,
|
|
359
|
+
),
|
|
360
|
+
);
|
|
51
361
|
|
|
52
|
-
|
|
362
|
+
outcomes.forEach(({ result, tools }, j) => {
|
|
363
|
+
const agent = group[j]!.agent;
|
|
364
|
+
transcript.push(formatRun(`Step ${i + 1}: ${agent}`, result));
|
|
365
|
+
runs.push(summarize(agent, tools, result));
|
|
366
|
+
results.push(result);
|
|
367
|
+
if (result.status === "ok") previousOutputs.push(`### Step ${i + 1}: ${agent}\n\n${result.text}`);
|
|
368
|
+
else failedStep = i + 1;
|
|
369
|
+
});
|
|
370
|
+
}
|
|
53
371
|
|
|
372
|
+
const summary =
|
|
373
|
+
failedStep === undefined
|
|
374
|
+
? `All ${stepCount} steps completed.`
|
|
375
|
+
: `Stopped at step ${failedStep} of ${stepCount}; later steps did not run.`;
|
|
54
376
|
return {
|
|
55
377
|
content: [
|
|
56
378
|
{
|
|
57
379
|
type: "text",
|
|
58
|
-
text:
|
|
59
|
-
`## Subagent: ${agentDef.name}\n\n` +
|
|
60
|
-
`**Role**: ${agentDef.description}\n\n` +
|
|
61
|
-
`**Task**: ${params.task}\n\n` +
|
|
62
|
-
`**Instructions**: Execute this task following the subagent's role and rules:\n\n` +
|
|
63
|
-
`${subagentPrompt}\n\n` +
|
|
64
|
-
`**Allowed tools**: ${agentDef.tools?.join(", ") ?? "all"}\n` +
|
|
65
|
-
`**Read-only**: ${agentDef.readOnly ? "Yes -- do not edit files" : "No -- can edit files"}\n\n` +
|
|
66
|
-
`When done, provide a clear summary of findings/results under a "## ${agentDef.name} Report" heading.`,
|
|
380
|
+
text: `# Workflow: ${workflow.name}\n\nTask: ${task}\n\n${transcript.join("\n\n")}\n\n## Workflow result\n\n${summary}`,
|
|
67
381
|
},
|
|
68
382
|
],
|
|
69
383
|
details: {
|
|
70
|
-
|
|
71
|
-
|
|
384
|
+
workflow: workflow.name,
|
|
385
|
+
steps: stepCount,
|
|
386
|
+
runs,
|
|
387
|
+
failedStep,
|
|
388
|
+
modelUsage: sumChildAgentUsage(results),
|
|
72
389
|
},
|
|
73
390
|
};
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
// -- Tool: orchestrate_workflow --
|
|
394
|
+
elyra.registerTool({
|
|
395
|
+
name: "orchestrate_workflow",
|
|
396
|
+
label: "Orchestrate Multi-Agent Workflow",
|
|
397
|
+
description:
|
|
398
|
+
"Run a predefined multi-agent workflow. Every step is a separate child Elyra agent (same agents and " +
|
|
399
|
+
"tool allowlists as `subagent`); steps run in order and each step receives the outputs of all earlier steps. " +
|
|
400
|
+
"Available workflows: " +
|
|
401
|
+
"'build-feature' (scout -> planner -> oracle -> worker -> reviewer -> worker fix; worker steps edit the working tree), " +
|
|
402
|
+
"'ui-review' (worker builds UI, reviewer checks visual quality + accessibility, worker fixes, reviewer verifies), " +
|
|
403
|
+
"'deep-review' (correctness, tests, and security reviewers in parallel, then oracle synthesis; read-only). " +
|
|
404
|
+
"The workflow stops at the first failed step. Returns every step's report.",
|
|
405
|
+
parameters: Type.Object({
|
|
406
|
+
workflow: Type.Union(
|
|
407
|
+
[Type.Literal("build-feature"), Type.Literal("ui-review"), Type.Literal("deep-review")],
|
|
408
|
+
{
|
|
409
|
+
description: "The workflow to run",
|
|
410
|
+
},
|
|
411
|
+
),
|
|
412
|
+
task: Type.String({
|
|
413
|
+
description: "Description of the feature or task, with all context the agents need",
|
|
91
414
|
}),
|
|
92
|
-
|
|
93
|
-
)
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
for (const [index, taskDef] of params.tasks.entries()) {
|
|
99
|
-
const agentDef = BUILTIN_AGENTS[taskDef.agent];
|
|
100
|
-
if (!agentDef) {
|
|
101
|
-
results.push(`## Agent ${index + 1}: ${taskDef.agent} (unknown)`);
|
|
102
|
-
results.push(`Error: Unknown agent. Available: ${Object.keys(BUILTIN_AGENTS).join(", ")}`);
|
|
103
|
-
results.push("");
|
|
104
|
-
continue;
|
|
415
|
+
}),
|
|
416
|
+
execute: async (_toolCallId, params, signal, onUpdate, ctx): Promise<AgentToolResult<OrchestrateDetails>> => {
|
|
417
|
+
const workflow = WORKFLOWS[params.workflow];
|
|
418
|
+
if (!workflow) {
|
|
419
|
+
return { content: [{ type: "text", text: `Unknown workflow: ${params.workflow}` }], details: {} };
|
|
105
420
|
}
|
|
421
|
+
return runWorkflow(workflow, params.task, ctx, signal, onUpdate);
|
|
422
|
+
},
|
|
423
|
+
});
|
|
106
424
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
results.push(`**Role**: ${agentDef.description}`);
|
|
111
|
-
results.push(`**Task**: ${taskDef.task}`);
|
|
112
|
-
results.push(`**Allowed tools**: ${agentDef.tools?.join(", ") ?? "all"}`);
|
|
113
|
-
results.push(`**Read-only**: ${agentDef.readOnly ? "Yes" : "No"}`);
|
|
114
|
-
results.push("");
|
|
115
|
-
results.push("**Instructions**:");
|
|
116
|
-
results.push(subagentPrompt);
|
|
117
|
-
results.push("");
|
|
118
|
-
results.push(`Provide results under a "### ${agentDef.name} Report (${index + 1})" heading.`);
|
|
119
|
-
results.push("");
|
|
120
|
-
results.push("---");
|
|
121
|
-
results.push("");
|
|
122
|
-
}
|
|
425
|
+
registerCommands(elyra);
|
|
426
|
+
};
|
|
427
|
+
}
|
|
123
428
|
|
|
124
|
-
|
|
125
|
-
"Execute each agent's task. For read-only agents, do not edit files. Synthesize all findings at the end under a ## Summary heading.",
|
|
126
|
-
);
|
|
127
|
-
|
|
128
|
-
return {
|
|
129
|
-
content: [{ type: "text", text: results.join("\n") }],
|
|
130
|
-
details: { agentCount: params.tasks.length },
|
|
131
|
-
};
|
|
132
|
-
},
|
|
133
|
-
});
|
|
429
|
+
export default createSubagentsExtension();
|
|
134
430
|
|
|
431
|
+
function registerCommands(elyra: ExtensionAPI): void {
|
|
135
432
|
// -- Command: /run --
|
|
136
433
|
elyra.registerCommand("run", {
|
|
137
434
|
description: "Run a subagent: /run <agent> <task>",
|
|
@@ -186,64 +483,6 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
186
483
|
},
|
|
187
484
|
});
|
|
188
485
|
|
|
189
|
-
// -- Tool: orchestrate_workflow --
|
|
190
|
-
elyra.registerTool({
|
|
191
|
-
name: "orchestrate_workflow",
|
|
192
|
-
label: "Orchestrate Multi-Agent Workflow",
|
|
193
|
-
description:
|
|
194
|
-
"Run a predefined multi-agent workflow. Available workflows: " +
|
|
195
|
-
"'build-feature' (scout -> planner -> worker -> reviewer -> fix), " +
|
|
196
|
-
"'ui-review' (worker builds UI, reviewer screenshots and checks visual quality + accessibility), " +
|
|
197
|
-
"'deep-review' (parallel reviewers for correctness, tests, security, then synthesis). " +
|
|
198
|
-
"Use this for complex tasks that benefit from structured multi-agent orchestration.",
|
|
199
|
-
parameters: Type.Object({
|
|
200
|
-
workflow: Type.Union([Type.Literal("build-feature"), Type.Literal("ui-review"), Type.Literal("deep-review")], {
|
|
201
|
-
description: "The workflow to run",
|
|
202
|
-
}),
|
|
203
|
-
task: Type.String({ description: "Description of the feature or task" }),
|
|
204
|
-
}),
|
|
205
|
-
execute: async (_toolCallId, params): Promise<AgentToolResult<OrchestrateDetails>> => {
|
|
206
|
-
const workflow = WORKFLOWS[params.workflow];
|
|
207
|
-
if (!workflow) {
|
|
208
|
-
return {
|
|
209
|
-
content: [{ type: "text", text: `Unknown workflow: ${params.workflow}` }],
|
|
210
|
-
details: {},
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
const instructions = workflow.steps
|
|
215
|
-
.map((step, i) => {
|
|
216
|
-
const agent = BUILTIN_AGENTS[step.agent];
|
|
217
|
-
const agentDesc = agent ? `(${agent.description})` : "";
|
|
218
|
-
const readOnly = agent?.readOnly ? " [READ-ONLY]" : "";
|
|
219
|
-
const stepTask = step.task
|
|
220
|
-
.replace("{task}", params.task)
|
|
221
|
-
.replace("{previous}", "the previous step's output");
|
|
222
|
-
return `### Step ${i + 1}: ${step.agent}${readOnly} ${agentDesc}\n${stepTask}`;
|
|
223
|
-
})
|
|
224
|
-
.join("\n\n");
|
|
225
|
-
|
|
226
|
-
return {
|
|
227
|
-
content: [
|
|
228
|
-
{
|
|
229
|
-
type: "text",
|
|
230
|
-
text:
|
|
231
|
-
`# Workflow: ${workflow.name}\n\n` +
|
|
232
|
-
`${workflow.description}\n\n` +
|
|
233
|
-
`Task: ${params.task}\n\n` +
|
|
234
|
-
`## Execution Plan\n\n${instructions}\n\n` +
|
|
235
|
-
`## Rules\n` +
|
|
236
|
-
`- Execute each step in order\n` +
|
|
237
|
-
`- Read-only steps must NOT edit files\n` +
|
|
238
|
-
`- Pass results from each step to the next\n` +
|
|
239
|
-
`- After the final step, provide a summary of everything done`,
|
|
240
|
-
},
|
|
241
|
-
],
|
|
242
|
-
details: { workflow: params.workflow, steps: workflow.steps.length },
|
|
243
|
-
};
|
|
244
|
-
},
|
|
245
|
-
});
|
|
246
|
-
|
|
247
486
|
// -- Command: /build-feature --
|
|
248
487
|
elyra.registerCommand("build-feature", {
|
|
249
488
|
description: "Orchestrated feature development: scout -> planner -> worker -> reviewer -> fix",
|
|
@@ -336,29 +575,26 @@ exit 0
|
|
|
336
575
|
});
|
|
337
576
|
}
|
|
338
577
|
|
|
339
|
-
function formatSubagentPrompt(agent: AgentDefinition, task: string, context?: string): string {
|
|
340
|
-
const parts: string[] = [agent.systemPrompt, "", "## Task", task];
|
|
341
|
-
|
|
342
|
-
if (context) {
|
|
343
|
-
parts.push("", "## Additional Context", context);
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
return parts.join("\n");
|
|
347
|
-
}
|
|
348
|
-
|
|
349
578
|
// -- Workflow Definitions --
|
|
350
579
|
|
|
351
580
|
interface WorkflowStep {
|
|
352
581
|
agent: string;
|
|
582
|
+
/** Task text; `{task}` is replaced with the workflow task. */
|
|
353
583
|
task: string;
|
|
584
|
+
/** Tools added to the agent's allowlist for this step. */
|
|
585
|
+
extraTools?: string[];
|
|
354
586
|
}
|
|
355
587
|
|
|
356
588
|
interface Workflow {
|
|
357
589
|
name: string;
|
|
358
590
|
description: string;
|
|
359
|
-
steps
|
|
591
|
+
/** Steps run in order; an array is a group of steps that run in parallel. */
|
|
592
|
+
steps: Array<WorkflowStep | WorkflowStep[]>;
|
|
360
593
|
}
|
|
361
594
|
|
|
595
|
+
/** Non-editing UI inspection tools from @elyracode/design-tools, used by ui-review reviewers when installed. */
|
|
596
|
+
const UI_REVIEW_TOOLS = ["design_preview", "screenshot_url", "design_system_check"];
|
|
597
|
+
|
|
362
598
|
const WORKFLOWS: Record<string, Workflow> = {
|
|
363
599
|
"build-feature": {
|
|
364
600
|
name: "Build Feature",
|
|
@@ -402,6 +638,7 @@ const WORKFLOWS: Record<string, Workflow> = {
|
|
|
402
638
|
{
|
|
403
639
|
agent: "reviewer",
|
|
404
640
|
task: "Review the UI code for {task}. If design_preview or screenshot_url tools are available, use them to visually inspect the result. Check: visual alignment, spacing consistency, color contrast (WCAG), responsive layout (test mobile viewport), hover/focus states, dark mode support. If design_system_check is available, run it on the modified files. Report visual issues with specific Tailwind class fixes.",
|
|
641
|
+
extraTools: UI_REVIEW_TOOLS,
|
|
405
642
|
},
|
|
406
643
|
{
|
|
407
644
|
agent: "worker",
|
|
@@ -410,25 +647,28 @@ const WORKFLOWS: Record<string, Workflow> = {
|
|
|
410
647
|
{
|
|
411
648
|
agent: "reviewer",
|
|
412
649
|
task: "Final visual check of {task}. Verify all issues are resolved. Use screenshot_url if available to confirm.",
|
|
650
|
+
extraTools: UI_REVIEW_TOOLS,
|
|
413
651
|
},
|
|
414
652
|
],
|
|
415
653
|
},
|
|
416
654
|
"deep-review": {
|
|
417
655
|
name: "Deep Parallel Review",
|
|
418
|
-
description: "Run three focused review passes in
|
|
656
|
+
description: "Run three focused review passes in parallel, then synthesize findings.",
|
|
419
657
|
steps: [
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
658
|
+
[
|
|
659
|
+
{
|
|
660
|
+
agent: "reviewer",
|
|
661
|
+
task: "CORRECTNESS REVIEW of {task}: Focus exclusively on logical correctness, data handling, error handling, and edge cases. Ignore style and tests.",
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
agent: "reviewer",
|
|
665
|
+
task: "TEST REVIEW of {task}: Focus exclusively on test coverage, missing test cases, test quality, and edge case testing. Ignore implementation style.",
|
|
666
|
+
},
|
|
667
|
+
{
|
|
668
|
+
agent: "reviewer",
|
|
669
|
+
task: "SECURITY REVIEW of {task}: Focus exclusively on security: SQL injection, XSS, CSRF, auth bypasses, data leaks, insecure defaults, input validation. Ignore style and tests.",
|
|
670
|
+
},
|
|
671
|
+
],
|
|
432
672
|
{
|
|
433
673
|
agent: "oracle",
|
|
434
674
|
task: "Synthesize all three review reports for {task}. Prioritize findings by impact. Create a single actionable fix list ordered by severity. Recommend which fixes to apply now vs later.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elyracode/subagents",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Elyra extension for subagent delegation -- scout, reviewer, planner, worker, oracle, and parallel execution",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -26,13 +26,20 @@
|
|
|
26
26
|
"./skills"
|
|
27
27
|
]
|
|
28
28
|
},
|
|
29
|
+
"files": [
|
|
30
|
+
"extensions",
|
|
31
|
+
"skills",
|
|
32
|
+
"README.md",
|
|
33
|
+
"CHANGELOG.md"
|
|
34
|
+
],
|
|
29
35
|
"peerDependencies": {
|
|
30
|
-
"@elyracode/coding-agent": "
|
|
36
|
+
"@elyracode/coding-agent": ">=1.0.0",
|
|
31
37
|
"typebox": "*"
|
|
32
38
|
},
|
|
33
39
|
"scripts": {
|
|
34
40
|
"clean": "echo 'nothing to clean'",
|
|
35
41
|
"build": "echo 'nothing to build'",
|
|
36
|
-
"check": "echo 'nothing to check'"
|
|
42
|
+
"check": "echo 'nothing to check'",
|
|
43
|
+
"test": "vitest --run"
|
|
37
44
|
}
|
|
38
45
|
}
|
|
@@ -52,6 +52,8 @@ clarify -> planner -> worker -> reviewer -> worker (fixes)
|
|
|
52
52
|
|
|
53
53
|
## Rules
|
|
54
54
|
- Subagents are focused and narrow -- one task per agent
|
|
55
|
-
- Each subagent
|
|
55
|
+
- Each subagent is a separate child agent with its own context: it does not see this conversation, so pass diffs, file paths, and earlier findings in `task` or `context`
|
|
56
|
+
- Read-only agents (scout, reviewer, planner, oracle, researcher) cannot run shell commands or edit files; worker and delegate edit the working tree directly
|
|
57
|
+
- Do not run several editing agents in parallel on overlapping files
|
|
56
58
|
- Results are brought back to the parent for synthesis
|
|
57
|
-
- Subagents do not spawn their own subagents
|
|
59
|
+
- Subagents do not spawn their own subagents
|