@leing2021/super-pi 0.20.0 → 0.22.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/README.md +40 -19
- package/extensions/ce-core/index.ts +7 -136
- package/extensions/subagent/agent-management.ts +595 -0
- package/extensions/subagent/agent-manager-chain-detail.ts +162 -0
- package/extensions/subagent/agent-manager-detail.ts +231 -0
- package/extensions/subagent/agent-manager-edit.ts +390 -0
- package/extensions/subagent/agent-manager-list.ts +278 -0
- package/extensions/subagent/agent-manager-parallel.ts +304 -0
- package/extensions/subagent/agent-manager.ts +705 -0
- package/extensions/subagent/agent-scope.ts +8 -0
- package/extensions/subagent/agent-selection.ts +25 -0
- package/extensions/subagent/agent-serializer.ts +123 -0
- package/extensions/subagent/agent-templates.ts +62 -0
- package/extensions/subagent/agents/context-builder.md +37 -0
- package/extensions/subagent/agents/delegate.md +9 -0
- package/extensions/subagent/agents/oracle.md +73 -0
- package/extensions/subagent/agents/planner.md +52 -0
- package/extensions/subagent/agents/researcher.md +50 -0
- package/extensions/subagent/agents/reviewer.md +38 -0
- package/extensions/subagent/agents/scout.md +48 -0
- package/extensions/subagent/agents/worker.md +52 -0
- package/extensions/subagent/agents.ts +761 -0
- package/extensions/subagent/artifacts.ts +100 -0
- package/extensions/subagent/async-execution.ts +520 -0
- package/extensions/subagent/async-job-tracker.ts +216 -0
- package/extensions/subagent/async-status.ts +241 -0
- package/extensions/subagent/chain-clarify.ts +1364 -0
- package/extensions/subagent/chain-execution.ts +853 -0
- package/extensions/subagent/chain-serializer.ts +126 -0
- package/extensions/subagent/completion-dedupe.ts +65 -0
- package/extensions/subagent/doctor.ts +200 -0
- package/extensions/subagent/execution.ts +738 -0
- package/extensions/subagent/file-coalescer.ts +42 -0
- package/extensions/subagent/fork-context.ts +63 -0
- package/extensions/subagent/formatters.ts +122 -0
- package/extensions/subagent/frontmatter.ts +31 -0
- package/extensions/subagent/index.ts +585 -0
- package/extensions/subagent/intercom-bridge.ts +240 -0
- package/extensions/subagent/jsonl-writer.ts +83 -0
- package/extensions/subagent/model-fallback.ts +108 -0
- package/extensions/subagent/notify.ts +110 -0
- package/extensions/subagent/parallel-utils.ts +108 -0
- package/extensions/subagent/pi-args.ts +138 -0
- package/extensions/subagent/pi-spawn.ts +100 -0
- package/extensions/subagent/post-exit-stdio-guard.ts +87 -0
- package/extensions/subagent/prompt-template-bridge.ts +399 -0
- package/extensions/subagent/prompts/gather-context-and-clarify.md +13 -0
- package/extensions/subagent/prompts/parallel-cleanup.md +42 -0
- package/extensions/subagent/prompts/parallel-research.md +50 -0
- package/extensions/subagent/prompts/parallel-review.md +40 -0
- package/extensions/subagent/render-helpers.ts +82 -0
- package/extensions/subagent/render.ts +836 -0
- package/extensions/subagent/result-intercom.ts +237 -0
- package/extensions/subagent/result-watcher.ts +171 -0
- package/extensions/subagent/run-history.ts +57 -0
- package/extensions/subagent/run-status.ts +136 -0
- package/extensions/subagent/schemas.ts +164 -0
- package/extensions/subagent/session-tokens.ts +50 -0
- package/extensions/subagent/settings.ts +367 -0
- package/extensions/subagent/single-output.ts +97 -0
- package/extensions/subagent/skills.ts +626 -0
- package/extensions/subagent/slash-bridge.ts +176 -0
- package/extensions/subagent/slash-commands.ts +303 -0
- package/extensions/subagent/slash-live-state.ts +294 -0
- package/extensions/subagent/subagent-control.ts +150 -0
- package/extensions/subagent/subagent-executor.ts +1899 -0
- package/extensions/subagent/subagent-prompt-runtime.ts +75 -0
- package/extensions/subagent/subagent-runner.ts +1470 -0
- package/extensions/subagent/subagents-status.ts +472 -0
- package/extensions/subagent/text-editor.ts +272 -0
- package/extensions/subagent/top-level-async.ts +15 -0
- package/extensions/subagent/types.ts +623 -0
- package/extensions/subagent/utils.ts +456 -0
- package/extensions/subagent/worktree.ts +579 -0
- package/extensions/super-pi-extension/agents/ce-worker.md +1 -1
- package/extensions/super-pi-extension/index.ts +2 -55
- package/package.json +12 -5
- package/skills/03-work/SKILL.md +3 -3
- package/skills/pi-subagents/SKILL.md +566 -0
package/README.md
CHANGED
|
@@ -91,7 +91,7 @@ Breaks requirements into implementation units, each following strict **RED → G
|
|
|
91
91
|
|
|
92
92
|
### 03-work: Build Right
|
|
93
93
|
|
|
94
|
-
**Parallel execution**: `task_splitter` uses a Union-Find algorithm to analyze file dependencies, feeds conflict-free units to `
|
|
94
|
+
**Parallel execution**: `task_splitter` uses a Union-Find algorithm to analyze file dependencies, feeds conflict-free units to `subagent` (parallel mode, via pi-subagents) for concurrent execution.
|
|
95
95
|
|
|
96
96
|
**Checkpoint resume**: After each unit, a checkpoint is saved. Interrupted? Next startup auto-loads, skips completed work, continues from the breakpoint. Failed? `fail` records the error → `retry` suggests a recovery strategy (timeout? extend timeout. Permission issue? check permissions first. Code error? fix then retry).
|
|
97
97
|
|
|
@@ -113,24 +113,19 @@ Next time `02-plan` or `04-review` runs, a grep-first search strategy automatica
|
|
|
113
113
|
|
|
114
114
|
---
|
|
115
115
|
|
|
116
|
-
##
|
|
116
|
+
## Built-in Subagent Capabilities
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
Super Pi includes pi-subagents (by Nico Bailon) as a built-in extension — no separate install needed. The following capabilities are available out of the box:
|
|
119
119
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
| Feature | Command | Description |
|
|
127
|
-
|---------|---------|-------------|
|
|
128
|
-
| **CE Agents** | `/run ce-worker "execute plan"` | Pre-configured agents aligned with stages |
|
|
129
|
-
| **CE Chains** | `/run-chain ce-standard -- implement feature` | Scout → Planner → Worker → Reviewer |
|
|
130
|
-
| **Parallel Review** | `/run-chain ce-parallel-review --` | 3-way review: correctness + tests + complexity |
|
|
120
|
+
| Feature | How to Access | Description |
|
|
121
|
+
|---------|--------------|-------------|
|
|
122
|
+
| **Agent Manager TUI** | `/agents` or `Ctrl+Shift+A` | Visual agent browser, configure and launch agents/chains/parallel tasks |
|
|
123
|
+
| **CE Agents** | Via subagent tool | Pre-configured agents aligned with CE stages (ce-scout, ce-planner, etc.) |
|
|
124
|
+
| **CE Chains** | Via subagent tool | Scout → Planner → Worker → Reviewer |
|
|
125
|
+
| **Parallel Review** | Via subagent tool | 3-way review: correctness + tests + complexity |
|
|
131
126
|
| **Stage Model Sync** | Automatic | `modelStrategy` + `thinkingStrategy` synced to agent configs |
|
|
132
|
-
|
|
133
|
-
|
|
127
|
+
| **Subagent Status** | `/subagents-status` | Show active and recent async subagent runs |
|
|
128
|
+
| **Diagnostics** | `/subagents-doctor` | Show subagent diagnostics |
|
|
134
129
|
|
|
135
130
|
### How Model/Thinking Sync Works
|
|
136
131
|
|
|
@@ -155,13 +150,21 @@ This ensures your stage-specific models and thinking levels are used when CE Age
|
|
|
155
150
|
|
|
156
151
|
## Technical Architecture
|
|
157
152
|
|
|
153
|
+
### Extensions
|
|
154
|
+
|
|
155
|
+
| Extension | Description |
|
|
156
|
+
|-----------|------------|
|
|
157
|
+
| `ce-core` | 15 CE tools (task_splitter, session_checkpoint, brainstorm_dialog, etc.) + hooks + filters |
|
|
158
|
+
| `super-pi-extension` | CE Agents/Chains + model strategy sync |
|
|
159
|
+
| `subagent` | Full subagent runtime (serial, parallel, chain, async, TUI, agent CRUD) — based on [pi-subagents](https://github.com/nicobailon/pi-subagents) |
|
|
160
|
+
|
|
158
161
|
### 10 Skills (workflow nodes)
|
|
159
162
|
|
|
160
163
|
| Skill | One-liner | Core Tool |
|
|
161
164
|
|-------|-----------|-----------|
|
|
162
165
|
| `01-brainstorm` | Deep requirements mining in three modes | `brainstorm_dialog` |
|
|
163
166
|
| `02-plan` | Break into units, TDD gates, incremental updates | `plan_diff` |
|
|
164
|
-
| `03-work` | Parallel execution, checkpoint resume, error recovery | `session_checkpoint`, `task_splitter`, `
|
|
167
|
+
| `03-work` | Parallel execution, checkpoint resume, error recovery | `session_checkpoint`, `task_splitter`, `subagent` (pi-subagents) |
|
|
165
168
|
| `04-review` | Persona-routed review + live browser testing | `review_router` |
|
|
166
169
|
| `05-learn` | Pattern extraction → knowledge card compounding | `pattern_extractor` |
|
|
167
170
|
| `06-next` | Not sure what to do next? Ask this | `workflow_state`, `session_history` |
|
|
@@ -177,7 +180,7 @@ This ensures your stage-specific models and thinking levels are used when CE Age
|
|
|
177
180
|
| `task_splitter` | Union-Find algorithm analyzes file dependencies, auto-groups parallel-safe units |
|
|
178
181
|
| `session_checkpoint` | JSON-persisted checkpoints with save/load/fail/retry operations |
|
|
179
182
|
| `plan_diff` | Incremental plans: compare detects diffs, patch applies changes |
|
|
180
|
-
| `
|
|
183
|
+
| `subagent` | Parallel & serial subagent execution (built-in, based on pi-subagents) |
|
|
181
184
|
| `review_router` | Auto-assign reviewer personas from diff metadata |
|
|
182
185
|
| `pattern_extractor` | Extract and categorize patterns from artifacts |
|
|
183
186
|
| `brainstorm_dialog` | Multi-round dialog state machine (start → refine × N → summarize) |
|
|
@@ -397,6 +400,7 @@ The goal isn't making AI write code faster — it's making AI think before writi
|
|
|
397
400
|
|
|
398
401
|
The following projects directly inspired this work:
|
|
399
402
|
|
|
403
|
+
- **[pi-subagents](https://github.com/nicobailon/pi-subagents)** (by Nico Bailon) → Full subagent runtime integrated as built-in extension (serial, parallel, chain, async, TUI, agent CRUD)
|
|
400
404
|
- **[everything-claude-code](https://github.com/affaan-m/everything-claude-code)** (162K★) → Parallel subagent orchestration, checkpoint resume, continuous learning
|
|
401
405
|
- **[superpowers](https://github.com/obra/superpowers)** (161K★) → Strict TDD gates, design checklists, review discipline
|
|
402
406
|
- **[gstack](https://github.com/garrytan/gstack)** (78K★) → YC-style forcing questions, CEO Review frameworks, browser QA
|
|
@@ -421,6 +425,23 @@ Not a fork. Not a wrapper. Methodologies extracted and rebuilt with Pi's native
|
|
|
421
425
|
|
|
422
426
|
## Changelog
|
|
423
427
|
|
|
428
|
+
### 0.22.0 — Source-integrated pi-subagents
|
|
429
|
+
- Integrated pi-subagents v0.20.1 source code into `extensions/subagent/` — single package install (`pi install npm:@leing2021/super-pi`).
|
|
430
|
+
- Moved `typebox` from peerDependencies to dependencies.
|
|
431
|
+
- Removed `pi-subagents` peer dependency — no longer needed.
|
|
432
|
+
- Simplified `super-pi-extension/index.ts`: removed faulty installation detection and auto-install logic.
|
|
433
|
+
- Pruned slash commands: removed `/run`, `/chain`, `/run-chain`, `/parallel`; kept `/agents` (TUI), `/subagents-status`, `/subagents-doctor`, and `Ctrl+Shift+A` shortcut.
|
|
434
|
+
- Added 8 new tests covering subagent extension structure, agent counts, and integration integrity.
|
|
435
|
+
- 169 tests passing.
|
|
436
|
+
|
|
437
|
+
### 0.21.0 — Delegate subagent tools to pi-subagents
|
|
438
|
+
- Removed `subagent` and `parallel_subagent` tool registrations from `ce-core` extension.
|
|
439
|
+
- Subagent capabilities (serial, parallel, chain, async, TUI, agent CRUD) now provided by the `pi-subagents` package.
|
|
440
|
+
- Removed `AsyncMutex`, `subagent-depth-guard` exports — no longer needed in this package.
|
|
441
|
+
- Added `pi-subagents` as a peer dependency in `package.json`.
|
|
442
|
+
- Updated `03-work` skill, `ce-worker` agent, and all README references from `parallel_subagent` to `subagent` (pi-subagents).
|
|
443
|
+
- Renamed internal `path` variable to `filePath` in read-output-filter to avoid shadowing.
|
|
444
|
+
|
|
424
445
|
### 0.20.0 — Extension API migration + v0.19.7 rework
|
|
425
446
|
- Migrated `super-pi-extension` from legacy `export default { load() }` object format to Pi-native factory function `(pi: ExtensionAPI) => void`.
|
|
426
447
|
- Replaced hardcoded `ExtensionContext` import with `ExtensionAPI`-only — context now provided via event handler.
|
|
@@ -530,7 +551,7 @@ Not a fork. Not a wrapper. Methodologies extracted and rebuilt with Pi's native
|
|
|
530
551
|
- New session_checkpoint tool
|
|
531
552
|
|
|
532
553
|
### 0.5.0 — Parallel execution
|
|
533
|
-
- New parallel_subagent tool
|
|
554
|
+
- New parallel_subagent tool (now delegated to pi-subagents)
|
|
534
555
|
|
|
535
556
|
### 0.4.0 — Smart review
|
|
536
557
|
- New review_router tool
|
|
@@ -4,11 +4,9 @@ import type { ExtensionAPI } from "@mariozechner/pi-coding-agent"
|
|
|
4
4
|
import { Type } from "typebox"
|
|
5
5
|
import { createArtifactHelperTool, type ArtifactType } from "./tools/artifact-helper"
|
|
6
6
|
import { createAskUserQuestionTool } from "./tools/ask-user-question"
|
|
7
|
-
import { createSubagentTool } from "./tools/subagent"
|
|
8
7
|
import { createWorkflowStateTool } from "./tools/workflow-state"
|
|
9
8
|
import { createWorktreeManagerTool } from "./tools/worktree-manager"
|
|
10
9
|
import { createReviewRouterTool } from "./tools/review-router"
|
|
11
|
-
import { createParallelSubagentTool } from "./tools/parallel-subagent"
|
|
12
10
|
import { createSessionCheckpointTool } from "./tools/session-checkpoint"
|
|
13
11
|
import { createTaskSplitterTool } from "./tools/task-splitter"
|
|
14
12
|
import { createBrainstormDialogTool } from "./tools/brainstorm-dialog"
|
|
@@ -18,10 +16,11 @@ import { createPatternExtractorTool } from "./tools/pattern-extractor"
|
|
|
18
16
|
import { filterBashOutput } from "./tools/bash-output-filter"
|
|
19
17
|
import { filterReadOutput } from "./tools/read-output-filter"
|
|
20
18
|
import { COMPACTION_FOCUS_INSTRUCTIONS } from "./tools/compaction-optimizer"
|
|
21
|
-
import { AsyncMutex } from "./tools/async-mutex"
|
|
22
|
-
import type { SubagentExecOptions, SubagentRunner } from "./tools/subagent"
|
|
23
19
|
|
|
24
|
-
|
|
20
|
+
// NOTE: subagent and parallel_subagent tool registration removed.
|
|
21
|
+
// Subagent capabilities are provided by the pi-subagents package.
|
|
22
|
+
// super-pi focuses on CE-specific tools only.
|
|
23
|
+
|
|
25
24
|
const PIPELINE_STAGE_KEYS = new Set([
|
|
26
25
|
"01-brainstorm",
|
|
27
26
|
"02-plan",
|
|
@@ -82,47 +81,6 @@ function parseModelRef(
|
|
|
82
81
|
}
|
|
83
82
|
}
|
|
84
83
|
|
|
85
|
-
/**
|
|
86
|
-
* Create a subagent runner that handles env injection with mutex protection
|
|
87
|
-
* for concurrency safety when multiple parallel subagents share the process.
|
|
88
|
-
*/
|
|
89
|
-
function createSubagentRunner(
|
|
90
|
-
pi: ExtensionAPI,
|
|
91
|
-
signal?: AbortSignal,
|
|
92
|
-
): SubagentRunner {
|
|
93
|
-
return async (prompt: string, options?: SubagentExecOptions) => {
|
|
94
|
-
const args = ["--no-session", ...(options?.extraFlags ?? []), "-p", prompt]
|
|
95
|
-
const release = await _subagentEnvMutex.acquire()
|
|
96
|
-
const savedEnv: Record<string, string | undefined> = {}
|
|
97
|
-
const extraEnv = options?.extraEnv ?? {}
|
|
98
|
-
for (const [key, value] of Object.entries(extraEnv)) {
|
|
99
|
-
savedEnv[key] = process.env[key]
|
|
100
|
-
process.env[key] = value
|
|
101
|
-
}
|
|
102
|
-
try {
|
|
103
|
-
const execResult = await pi.exec("pi", args, {
|
|
104
|
-
signal,
|
|
105
|
-
timeout: 10 * 60 * 1000,
|
|
106
|
-
})
|
|
107
|
-
|
|
108
|
-
if (execResult.code !== 0) {
|
|
109
|
-
throw new Error(execResult.stderr || execResult.stdout || `Subagent failed for prompt: ${prompt}`)
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
return (execResult.stdout || "").trim()
|
|
113
|
-
} finally {
|
|
114
|
-
for (const [key, oldValue] of Object.entries(savedEnv)) {
|
|
115
|
-
if (oldValue === undefined) {
|
|
116
|
-
delete process.env[key]
|
|
117
|
-
} else {
|
|
118
|
-
process.env[key] = oldValue
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
release()
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
84
|
const artifactHelperParams = Type.Object({
|
|
127
85
|
repoRoot: Type.String({ description: "Repository root where workflow artifacts should be created" }),
|
|
128
86
|
artifactType: Type.Union([
|
|
@@ -145,18 +103,6 @@ const askUserQuestionParams = Type.Object({
|
|
|
145
103
|
allowCustom: Type.Optional(Type.Boolean({ description: "Allow a custom answer when options are present" })),
|
|
146
104
|
})
|
|
147
105
|
|
|
148
|
-
const subagentTaskSchema = Type.Object({
|
|
149
|
-
agent: Type.String({ description: "Skill name to invoke via /skill:<name>" }),
|
|
150
|
-
task: Type.String({ description: "Task text passed to the subagent" }),
|
|
151
|
-
})
|
|
152
|
-
|
|
153
|
-
const subagentParams = Type.Object({
|
|
154
|
-
agent: Type.Optional(Type.String({ description: "Single subagent skill name" })),
|
|
155
|
-
task: Type.Optional(Type.String({ description: "Single subagent task" })),
|
|
156
|
-
chain: Type.Optional(Type.Array(subagentTaskSchema, { description: "Serial subagent chain with optional {previous} placeholder" })),
|
|
157
|
-
inheritSkills: Type.Optional(Type.Boolean({ description: "Whether the subagent should inherit skills. Default: true" })),
|
|
158
|
-
})
|
|
159
|
-
|
|
160
106
|
const workflowStateParams = Type.Object({
|
|
161
107
|
repoRoot: Type.String({ description: "Repository root to scan for workflow artifacts" }),
|
|
162
108
|
})
|
|
@@ -179,19 +125,6 @@ const reviewRouterParams = Type.Object({
|
|
|
179
125
|
deletions: Type.Number({ description: "Number of lines removed" }),
|
|
180
126
|
})
|
|
181
127
|
|
|
182
|
-
const parallelSubagentTaskSchema = Type.Object({
|
|
183
|
-
agent: Type.String({ description: "Skill name to invoke via /skill:<name>" }),
|
|
184
|
-
task: Type.String({ description: "Task text passed to the subagent" }),
|
|
185
|
-
})
|
|
186
|
-
|
|
187
|
-
const parallelSubagentParams = Type.Object({
|
|
188
|
-
tasks: Type.Union([
|
|
189
|
-
Type.Array(parallelSubagentTaskSchema),
|
|
190
|
-
Type.String({ description: "JSON stringified array of tasks" }),
|
|
191
|
-
], { description: "Array of independent tasks to run concurrently (can be a JSON string)" }),
|
|
192
|
-
inheritSkills: Type.Optional(Type.Boolean({ description: "Whether subagents should inherit skills. Default: false" })),
|
|
193
|
-
})
|
|
194
|
-
|
|
195
128
|
const sessionCheckpointParams = Type.Object({
|
|
196
129
|
operation: Type.Union([
|
|
197
130
|
Type.Literal("save"),
|
|
@@ -342,11 +275,9 @@ export default function ceCoreExtension(pi: ExtensionAPI) {
|
|
|
342
275
|
|
|
343
276
|
const artifactHelper = createArtifactHelperTool()
|
|
344
277
|
const askUserQuestion = createAskUserQuestionTool()
|
|
345
|
-
const subagent = createSubagentTool()
|
|
346
278
|
const workflowState = createWorkflowStateTool()
|
|
347
279
|
const worktreeManager = createWorktreeManagerTool()
|
|
348
280
|
const reviewRouter = createReviewRouterTool()
|
|
349
|
-
const parallelSubagent = createParallelSubagentTool()
|
|
350
281
|
const sessionCheckpoint = createSessionCheckpointTool()
|
|
351
282
|
const taskSplitter = createTaskSplitterTool()
|
|
352
283
|
const brainstormDialog = createBrainstormDialogTool()
|
|
@@ -419,29 +350,6 @@ export default function ceCoreExtension(pi: ExtensionAPI) {
|
|
|
419
350
|
},
|
|
420
351
|
})
|
|
421
352
|
|
|
422
|
-
pi.registerTool({
|
|
423
|
-
name: subagent.name,
|
|
424
|
-
label: "Subagent",
|
|
425
|
-
description: "Run a single skill-based subagent or a serial chain in an isolated Pi process.",
|
|
426
|
-
parameters: subagentParams,
|
|
427
|
-
async execute(_toolCallId, params, signal, _onUpdate, ctx) {
|
|
428
|
-
const result = await subagent.execute(
|
|
429
|
-
{
|
|
430
|
-
agent: params.agent,
|
|
431
|
-
task: params.task,
|
|
432
|
-
chain: params.chain,
|
|
433
|
-
inheritSkills: params.inheritSkills,
|
|
434
|
-
},
|
|
435
|
-
createSubagentRunner(pi, signal),
|
|
436
|
-
)
|
|
437
|
-
|
|
438
|
-
return {
|
|
439
|
-
content: [{ type: "text", text: result.outputs[result.outputs.length - 1] ?? "" }],
|
|
440
|
-
details: result,
|
|
441
|
-
}
|
|
442
|
-
},
|
|
443
|
-
})
|
|
444
|
-
|
|
445
353
|
pi.registerTool({
|
|
446
354
|
name: workflowState.name,
|
|
447
355
|
label: "Workflow State",
|
|
@@ -513,39 +421,6 @@ export default function ceCoreExtension(pi: ExtensionAPI) {
|
|
|
513
421
|
},
|
|
514
422
|
})
|
|
515
423
|
|
|
516
|
-
pi.registerTool({
|
|
517
|
-
name: parallelSubagent.name,
|
|
518
|
-
label: "Parallel Subagent",
|
|
519
|
-
description: "Run multiple skill-based subagent tasks concurrently. IMPORTANT: Provide 'tasks' as a clean JSON array object. If the environment forces a string, provide a valid JSON array string.",
|
|
520
|
-
parameters: parallelSubagentParams,
|
|
521
|
-
async execute(_toolCallId, params, signal) {
|
|
522
|
-
let tasks: any[]
|
|
523
|
-
if (typeof params.tasks === "string") {
|
|
524
|
-
try {
|
|
525
|
-
const cleaned = params.tasks.replace(/^```json\s*|```$/g, "").trim()
|
|
526
|
-
tasks = JSON.parse(cleaned)
|
|
527
|
-
} catch (e) {
|
|
528
|
-
throw new Error(`Failed to parse tasks string as JSON: ${e instanceof Error ? e.message : String(e)}`)
|
|
529
|
-
}
|
|
530
|
-
} else {
|
|
531
|
-
tasks = params.tasks
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
const result = await parallelSubagent.execute(
|
|
535
|
-
{
|
|
536
|
-
tasks,
|
|
537
|
-
inheritSkills: params.inheritSkills,
|
|
538
|
-
},
|
|
539
|
-
createSubagentRunner(pi, signal),
|
|
540
|
-
)
|
|
541
|
-
|
|
542
|
-
return {
|
|
543
|
-
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
544
|
-
details: result,
|
|
545
|
-
}
|
|
546
|
-
},
|
|
547
|
-
})
|
|
548
|
-
|
|
549
424
|
pi.registerTool({
|
|
550
425
|
name: sessionCheckpoint.name,
|
|
551
426
|
label: "Session Checkpoint",
|
|
@@ -712,8 +587,8 @@ export default function ceCoreExtension(pi: ExtensionAPI) {
|
|
|
712
587
|
if (event.toolName !== "read") return undefined
|
|
713
588
|
|
|
714
589
|
// Extract path from input
|
|
715
|
-
const
|
|
716
|
-
if (!
|
|
590
|
+
const filePath = (event.input as any)?.path ?? ""
|
|
591
|
+
if (!filePath) return undefined
|
|
717
592
|
|
|
718
593
|
// Extract text content from tool result
|
|
719
594
|
const textBlocks = (event.content as Array<any>)?.filter((b: any) => b.type === "text") ?? []
|
|
@@ -723,7 +598,7 @@ export default function ceCoreExtension(pi: ExtensionAPI) {
|
|
|
723
598
|
const isImage = (event.content as Array<any>)?.some((b: any) => b.type === "image") ?? false
|
|
724
599
|
|
|
725
600
|
const result = filterReadOutput({
|
|
726
|
-
path,
|
|
601
|
+
path: filePath,
|
|
727
602
|
output,
|
|
728
603
|
isError: event.isError ?? false,
|
|
729
604
|
isImage,
|
|
@@ -756,13 +631,9 @@ export default function ceCoreExtension(pi: ExtensionAPI) {
|
|
|
756
631
|
|
|
757
632
|
export { createArtifactHelperTool } from "./tools/artifact-helper"
|
|
758
633
|
export { createAskUserQuestionTool } from "./tools/ask-user-question"
|
|
759
|
-
export { createSubagentTool } from "./tools/subagent"
|
|
760
|
-
export { checkSubagentDepth, getChildDepthEnv, DEFAULT_MAX_SUBAGENT_DEPTH } from "./tools/subagent-depth-guard"
|
|
761
|
-
export { AsyncMutex } from "./tools/async-mutex"
|
|
762
634
|
export { createWorkflowStateTool } from "./tools/workflow-state"
|
|
763
635
|
export { createWorktreeManagerTool } from "./tools/worktree-manager"
|
|
764
636
|
export { createReviewRouterTool } from "./tools/review-router"
|
|
765
|
-
export { createParallelSubagentTool } from "./tools/parallel-subagent"
|
|
766
637
|
export { createSessionCheckpointTool } from "./tools/session-checkpoint"
|
|
767
638
|
export { createTaskSplitterTool } from "./tools/task-splitter"
|
|
768
639
|
export { createBrainstormDialogTool } from "./tools/brainstorm-dialog"
|