@melihmucuk/pi-crew 1.0.7 → 1.0.9

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.
Files changed (45) hide show
  1. package/agents/code-reviewer.md +18 -6
  2. package/agents/planner.md +9 -1
  3. package/agents/quality-reviewer.md +20 -13
  4. package/agents/scout.md +33 -26
  5. package/dist/agent-discovery.d.ts +0 -5
  6. package/dist/agent-discovery.js +1 -1
  7. package/dist/bootstrap-session.d.ts +13 -4
  8. package/dist/bootstrap-session.js +25 -16
  9. package/dist/index.js +37 -7
  10. package/dist/integration/register-command.d.ts +2 -2
  11. package/dist/integration/register-command.js +5 -5
  12. package/dist/integration/register-renderers.js +3 -0
  13. package/dist/integration/register-tools.d.ts +2 -2
  14. package/dist/integration/register-tools.js +2 -2
  15. package/dist/integration/tool-presentation.d.ts +2 -3
  16. package/dist/integration/tool-presentation.js +7 -8
  17. package/dist/integration/tools/crew-abort.d.ts +1 -1
  18. package/dist/integration/tools/crew-abort.js +3 -3
  19. package/dist/integration/tools/crew-done.d.ts +1 -1
  20. package/dist/integration/tools/crew-done.js +2 -2
  21. package/dist/integration/tools/crew-list.d.ts +1 -1
  22. package/dist/integration/tools/crew-list.js +3 -3
  23. package/dist/integration/tools/crew-respond.d.ts +1 -1
  24. package/dist/integration/tools/crew-respond.js +6 -7
  25. package/dist/integration/tools/crew-spawn.d.ts +1 -1
  26. package/dist/integration/tools/crew-spawn.js +17 -14
  27. package/dist/integration/tools/tool-deps.d.ts +3 -2
  28. package/dist/integration.d.ts +2 -2
  29. package/dist/integration.js +3 -3
  30. package/dist/runtime/crew-runtime.d.ts +61 -0
  31. package/dist/{crew-manager.js → runtime/crew-runtime.js} +84 -58
  32. package/dist/runtime/delivery-coordinator.d.ts +16 -7
  33. package/dist/runtime/delivery-coordinator.js +46 -20
  34. package/dist/runtime/subagent-registry.d.ts +1 -0
  35. package/dist/runtime/subagent-registry.js +3 -0
  36. package/dist/runtime/subagent-state.d.ts +2 -0
  37. package/dist/status-widget.d.ts +2 -2
  38. package/dist/status-widget.js +3 -3
  39. package/dist/subagent-messages.d.ts +5 -2
  40. package/dist/subagent-messages.js +5 -4
  41. package/docs/architecture.md +106 -843
  42. package/package.json +1 -1
  43. package/prompts/pi-crew-plan.md +82 -123
  44. package/prompts/pi-crew-review.md +64 -115
  45. package/dist/crew-manager.d.ts +0 -44
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@melihmucuk/pi-crew",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "type": "module",
5
5
  "description": "Non-blocking subagent orchestration for pi coding agent",
6
6
  "files": [
@@ -11,171 +11,130 @@ description: Run parallel subagents to investigate a codebase and produce an imp
11
11
  ## Role
12
12
 
13
13
  This is an orchestration prompt.
14
- Your job is to understand the task, delegate discovery to scout subagents, collect their findings, delegate planning to a planner subagent, and relay the planner's output to the user.
14
+ Understand the task, gather minimal orientation context, delegate discovery to scout subagents, collect their findings, delegate planning to a planner subagent, and relay the planner's result to the user.
15
15
 
16
- Do not perform deep code investigation yourself.
16
+ Do not perform deep investigation yourself.
17
17
  Do not write the plan yourself.
18
- Do not modify any files.
18
+ Do not modify files.
19
19
 
20
- ## Operating Boundaries
21
-
22
- - Do not read full source files before spawning scouts.
23
- - Do not perform broad codebase searches yourself.
24
- - Gather only enough context to understand what the task is and how to split the discovery work across scouts.
25
- - Detailed file reading, pattern analysis, and dependency tracing belong to the scouts.
26
- - Plan creation belongs to the planner.
27
-
28
- ## Required Workflow
29
-
30
- ### 1) Understand the task
20
+ ## Task Resolution
31
21
 
32
22
  Determine the task from:
33
23
 
34
- - the additional instructions provided above, if any
35
- - the current conversation context if no additional instructions were provided
24
+ - additional instructions, if provided
25
+ - otherwise the current conversation context
36
26
 
37
- If the task is still unclear after both sources, ask the user to clarify before proceeding.
27
+ If the task is still unclear, ask the user to clarify before proceeding.
38
28
 
39
- Identify all external references the user provided: file paths, image paths, URLs, documents, screenshots, or any other attachments. These must be passed to the relevant subagents (scouts and/or planner) as explicit file paths with instructions to read/inspect them. Do not assume subagents will have access to context from this conversation; anything they need must be included in their task description.
29
+ Identify any user-provided references that subagents may need, including file paths, images, documents, screenshots, or URLs. Include them explicitly in subagent tasks. Do not assume subagents can access this conversation context unless you pass it along.
40
30
 
41
- ### 2) Gather minimal orientation context
31
+ ## Orientation Context
42
32
 
43
- Collect only what you need to write focused, actionable scout tasks. Start with:
33
+ Gather only enough context to assign focused scout tasks.
44
34
 
45
- - project root structure (`ls` top-level)
46
- - key config files (package.json, go.mod, Cargo.toml, etc.) to identify language, framework, dependencies
47
- - README or AGENTS.md if present, for project conventions
35
+ Start with:
48
36
 
49
- If this is enough to identify which areas of the codebase the task touches, stop and proceed to spawning scouts.
37
+ - top-level project structure
38
+ - key config files to identify language, framework, and dependencies
39
+ - README or AGENTS.md if present
50
40
 
51
- If not, you may do lightweight exploration to locate the right areas:
41
+ If needed, do lightweight exploration to find the relevant areas:
52
42
 
53
- - browse directory trees (`ls`, `find`) to understand module/package layout
54
- - read a few lines of entry points or index files to understand how the project is organized
55
- - run targeted searches (`grep`, `rg`) for task-related terms to find which directories or files are relevant
43
+ - browse directories
44
+ - read a few lines of entry points or index files
45
+ - run targeted searches for task-related terms
56
46
 
57
- The goal is to know **where** to send scouts, not to understand **how** the code works. Stop as soon as you can write scout tasks that point to specific areas. Do not trace call chains, analyze implementations, or read full files.
47
+ Stop once you can assign specific scout scopes.
48
+ Do not trace call chains, analyze implementations, or read full files.
58
49
 
59
- ### 3) Spawn scouts
50
+ ## Scout Execution
60
51
 
61
52
  Call `crew_list` first and verify `scout` is available.
62
53
 
63
- Spawn one or more scout subagents in parallel (maximum 4). Each scout must receive:
64
-
65
- - the project root path
66
- - the specific area or question to investigate
67
- - enough framing so the scout knows what to look for
68
-
69
- Strategic scout allocation:
70
-
71
- - If the task touches a single area, one scout may suffice.
72
- - If the task spans multiple areas (e.g., API + database + frontend), spawn a separate scout per area.
73
- - If the task requires understanding an existing pattern before proposing changes, dedicate a scout to "find existing patterns/conventions for X".
74
- - Do not spawn more than 4 scouts. Each scout should have a distinct, non-overlapping investigation focus.
75
-
76
- Each scout task must include:
77
-
78
- - the user's original task (so the scout understands **why** it is investigating)
79
- - project root path
80
- - the orientation context you already gathered (language, framework, key dependencies, project structure, conventions) so the scout does not repeat this work
81
- - clear investigation scope (which directories, files, or concepts to explore)
82
- - what specific information to return (types, interfaces, data flow, dependencies, etc.)
83
- - any external references from the user (file paths, image paths, documents) that are relevant to this scout's scope, with instructions to inspect them
84
- - explicit instruction that it is read-only
54
+ Spawn up to 4 scouts in parallel. Each scout must have a distinct, non-overlapping focus.
85
55
 
86
- The task description is critical. A scout that knows it is investigating "webhook retry refactoring" will focus on retry logic, error handling, and interfaces. A scout that only knows "look at src/payments/" will produce a generic summary that may miss what the planner actually needs.
56
+ Each scout task should include:
87
57
 
88
- ### 4) Wait for all scouts
58
+ - the user's task
59
+ - project root
60
+ - minimal orientation context already gathered
61
+ - explicit investigation scope
62
+ - the specific information to return
63
+ - any relevant user-provided references
64
+ - explicit read-only instruction
89
65
 
90
- Do not proceed until every spawned scout has returned.
91
- Do not synthesize partial results.
92
- Do not predict or fabricate scout findings.
93
- Wait for all `crew-result` messages.
66
+ If the task touches one area, one scout may be enough.
67
+ If it spans multiple areas, split scouts by area or question.
94
68
 
95
- Scout results also arrive as steering messages visible in the conversation. Once all scouts have returned, briefly tell the user that discovery is complete and you are preparing context for the planner. Do not repeat or summarize the scout findings to the user.
69
+ ## Scout Waiting and Recovery
96
70
 
97
- **Handling scout failures:**
71
+ Wait for all spawned scouts to return.
72
+ Do not synthesize partial findings.
73
+ Do not fabricate scout results.
74
+ Do not poll repeatedly while waiting; results arrive asynchronously.
98
75
 
99
- - If a scout returns an error or times out, retry it once with the same task.
100
- - If a scout returns but says it could not find relevant information, reassess the task you gave it. Reformulate a more targeted task and spawn a replacement scout. Do not retry with the identical task.
101
- - If a retried scout still fails or returns empty, proceed with the findings from the other scouts. Note the gap when passing context to the planner so it can account for incomplete information.
76
+ If a scout fails or times out, retry once.
77
+ If a scout returns without useful findings, reformulate the task and spawn a replacement scout.
78
+ If a retried or replacement scout still fails, proceed with the findings you have and note the gap for the planner.
102
79
 
103
- ### 5) Spawn planner
80
+ ## Planner Execution
104
81
 
105
82
  Call `crew_list` first and verify `planner` is available.
106
83
 
107
- Before spawning the planner, process the scout findings:
108
-
109
- - Remove duplicate information that multiple scouts reported.
110
- - Drop generic observations that are not relevant to the task.
111
- - Keep all specific findings: file paths, function signatures, type definitions, data flows, constraints, and patterns.
112
- - Organize by area, not by scout. If two scouts reported on overlapping areas, merge their findings under one heading.
113
- - If scouts reported conflicting information, include both and flag the contradiction.
114
-
115
- Then spawn the planner subagent with:
116
-
117
- - the user's original task description (verbatim)
118
- - any additional user instructions or constraints
119
- - all external references from the user (file paths, image paths, screenshots, documents, URLs) with instructions to inspect them directly
120
- - the processed scout findings, organized by area
121
- - project root path
122
- - language, framework, key dependencies
123
- - relevant conventions or constraints discovered by scouts
124
- - any gaps in discovery (scouts that failed or returned empty) so the planner knows what was not investigated
125
- - explicit instruction that comprehensive context has been pre-gathered by scouts, and the planner should rely on the provided findings first; it should only perform its own discovery if the provided context is insufficient for a specific aspect
126
-
127
- The planner is an interactive subagent. It will respond with one of:
128
-
129
- - **Blocking Questions**: questions that need user input before a plan can be made
130
- - **Implementation Plan**: the complete plan
131
- - **No plan needed**: the task is trivial enough that a plan adds no value
132
-
133
- ### 6) Relay planner output
134
-
135
- When the planner responds:
84
+ Before spawning the planner:
136
85
 
137
- Subagent results arrive as steering messages and are already visible in the conversation context. Do not repeat or rewrite the planner's output. Instead, respond with a short actionable prompt to the user.
86
+ - remove duplicate scout findings
87
+ - drop irrelevant generic observations
88
+ - organize findings by area
89
+ - preserve specific facts, constraints, paths, interfaces, and conflicts
138
90
 
139
- **If Blocking Questions:**
91
+ Spawn the planner with:
140
92
 
141
- - Tell the user that the planner has questions that need answering before it can produce a plan.
142
- - Ask the user to answer them.
143
- - When the user answers, relay the answers to the planner using `crew_respond`.
144
- - Wait for the planner's next response and repeat this step.
93
+ - the user's task
94
+ - additional instructions or constraints
95
+ - relevant user-provided references
96
+ - processed scout findings
97
+ - project root
98
+ - language, framework, dependencies
99
+ - relevant conventions
100
+ - any discovery gaps
145
101
 
146
- **If Implementation Plan:**
102
+ The planner is interactive. It may return:
147
103
 
148
- - Tell the user the plan is ready and ask if they approve or want changes.
149
- - If the user requests changes, relay the feedback to the planner using `crew_respond`.
150
- - Wait for the planner's updated plan and repeat this step.
104
+ - Blocking Questions
105
+ - Implementation Plan
106
+ - No plan needed
151
107
 
152
- **If No plan needed:**
108
+ ## Relay
153
109
 
154
- - Close the planner session with `crew_done`.
155
- - Briefly explain why no plan is needed.
156
- - Using the scout findings, suggest that the task can be implemented directly and summarize the relevant context the scouts gathered that would help with implementation.
110
+ Do not rewrite subagent output that is already visible as a steering message.
157
111
 
158
- **If the user approves the plan:**
112
+ If the planner returns blocking questions:
113
+ - ask the user to answer them
114
+ - relay the user's response with `crew_respond`
115
+ - wait for the next planner response
159
116
 
160
- - Call `crew_done` to close the planner session.
161
- - Confirm that the plan is finalized.
117
+ If the planner returns an implementation plan:
118
+ - tell the user the plan is ready and ask for approval or feedback
119
+ - relay any feedback with `crew_respond`
120
+ - wait for the updated planner response
162
121
 
163
- ## Relay Rules
122
+ If the planner returns no plan needed:
123
+ - close the planner with `crew_done`
124
+ - briefly tell the user no plan is needed and that the task can be implemented directly
164
125
 
165
- - Do not rewrite or duplicate the planner's output. It is already visible to the user as a steering message in the conversation. Respond with one or two sentences: state whether the planner returned a plan, blocking questions, or a no-plan-needed verdict, then ask the user for the next action (approve, answer, or provide feedback).
166
- - Never answer the planner's blocking questions on behalf of the user.
167
- - Never modify the plan based on your own judgment. All feedback goes through the user.
168
- - When relaying user feedback to the planner via `crew_respond`, include the user's words verbatim plus any necessary context from the conversation.
126
+ If the user approves the plan:
127
+ - close the planner with `crew_done`
128
+ - confirm that the plan is finalized
169
129
 
170
130
  ## Language
171
131
 
172
- All output to the user must be in the same language as the user's prompt.
173
- When spawning scouts and the planner, instruct them to respond in the same language as the user's prompt.
132
+ Respond to the user in the same language as the user's request.
174
133
 
175
- ## IMPORTANT
134
+ ## Rules
176
135
 
177
- - DO NOT perform deep codebase investigation yourself. Delegate to scouts.
178
- - DO NOT write or modify the plan yourself. Delegate to the planner.
179
- - NEVER PREDICT or FABRICATE results for subagents that have not yet reported back to you.
180
- - Do NOT rewrite or duplicate subagent output that is already visible as a steering message.
181
- - ALWAYS wait for explicit user approval before finalizing the plan.
136
+ - Do not investigate deeply yourself; delegate to scouts.
137
+ - Do not write, modify, or finalize the plan yourself; use the planner.
138
+ - Never answer planner questions on behalf of the user.
139
+ - Never fabricate subagent results.
140
+ - Always wait for explicit user approval before finalizing the plan.
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Run parallel code and quality reviews to ensure high standards and catch issues early.
2
+ description: Run parallel code and quality reviews by gathering minimal context and orchestrating reviewer subagents.
3
3
  ---
4
4
 
5
5
  # Parallel Review
@@ -11,29 +11,22 @@ description: Run parallel code and quality reviews to ensure high standards and
11
11
  ## Role
12
12
 
13
13
  This is an orchestration prompt.
14
- Your job is to determine review scope with minimal context gathering, prepare a short review brief, spawn the reviewer subagents, wait for both results, and merge them into one final report.
14
+ Determine review scope with minimal context gathering, prepare a short neutral brief, spawn the reviewer subagents, wait for their results, and merge them into one final report.
15
15
 
16
- Do not do the reviewers' job.
16
+ Do not perform the review yourself.
17
17
 
18
- ## Operating Boundaries
18
+ ## Scope Rules
19
19
 
20
- - Do not read full files before spawning subagents.
21
- - Do not dump raw diffs into the prompt.
22
- - Do not inspect every changed file manually.
23
- - Collect only enough git context to determine scope and produce a short summary.
24
- - Detailed diff reading, file reading, and issue analysis belong to the subagents.
25
- - Use targeted extra reads only when file names and diff stats are insufficient.
20
+ - If the user specifies a scope (commit, branch, files, PR, or focus area), that scope overrides the default scope.
21
+ - Otherwise, default scope includes:
22
+ - recent commits
23
+ - staged changes
24
+ - unstaged changes
25
+ - untracked files
26
26
 
27
- ## Required Workflow
27
+ ## Context Gathering
28
28
 
29
- ### 1) Determine scope
30
-
31
- Default scope, unless the user specifies otherwise:
32
-
33
- - recent commits
34
- - staged changes
35
- - unstaged changes
36
- - untracked files
29
+ Collect only enough context to define scope and prepare a short brief.
37
30
 
38
31
  Collect:
39
32
 
@@ -45,130 +38,86 @@ Collect:
45
38
  - `git diff --stat`
46
39
  - untracked file list
47
40
 
48
- Do not collect full diffs by default.
49
- Use `git diff --cached` or `git diff` only if diff stats and file names are insufficient.
50
-
51
- Recent commit range:
41
+ For recent commits:
52
42
 
53
43
  - use `HEAD~3..HEAD` if at least 3 commits exist
54
44
  - otherwise use the widest reachable history range
55
45
 
56
- For that range, collect:
46
+ Collect for that range:
57
47
 
58
48
  - `git diff --stat <range>`
59
49
  - `git diff --name-only <range>`
60
50
 
61
- Use `git diff <range>` only if needed for a short summary.
51
+ Rules:
62
52
 
63
- If the user gives a commit, branch, file, or extra focus area, include it as additional context.
53
+ - Do not read full files before spawning subagents.
54
+ - Do not dump raw diffs into the prompt.
55
+ - Do not inspect every changed file manually.
56
+ - Use full diffs or targeted reads only when file names and diff stats are insufficient to produce a short neutral summary.
57
+ - Keep the brief short and descriptive, not analytical.
64
58
 
65
- ### 2) Prepare subagent context
59
+ ## Subagent Preparation
66
60
 
67
- Prepare a short brief with:
61
+ Call `crew_list` first and verify that both are available:
68
62
 
69
- - review scope
70
- - commit range
71
- - staged/unstaged/untracked state
63
+ - `code-reviewer`
64
+ - `quality-reviewer`
65
+
66
+ Prepare one short brief for both reviewers including:
67
+
68
+ - repo root
69
+ - resolved review scope
70
+ - commit range if any
71
+ - staged / unstaged / untracked status
72
72
  - changed files
73
- - one-line summary per file or file group
73
+ - short summary per file or file group
74
74
  - additional user instructions
75
75
 
76
- Summary rules:
76
+ ## Execution
77
77
 
78
- - infer first from file paths, status codes, and diff stats
79
- - read only specific files or hunks if needed
80
- - keep it short
81
- - do not perform review analysis here
78
+ Spawn `code-reviewer` and `quality-reviewer` in parallel.
82
79
 
83
- ### 3) Spawn reviewers
80
+ If one reviewer is unavailable or fails to start, report that clearly and continue with the reviewer that is available.
84
81
 
85
- Call `crew_list` first and verify:
82
+ Do not produce a final report until all successfully spawned reviewers have returned a result.
83
+ Do not poll or repeatedly check active subagents while waiting; results will be delivered asynchronously.
86
84
 
87
- - `code-reviewer`
88
- - `quality-reviewer`
85
+ ## Merge
89
86
 
90
- Spawn both in parallel.
91
- Each task must include:
87
+ Write the final response in the same language as the user's request.
92
88
 
93
- - repo root
94
- - review scope
95
- - commit range
96
- - staged/unstaged/untracked info
97
- - changed files
98
- - short change summary
99
- - user instructions
100
- - explicit instruction to inspect diffs and files itself
101
- - explicit instruction to follow its own output format strictly
89
+ Structure:
102
90
 
103
- ### 4) Wait
91
+ ### Consensus Findings
104
92
 
105
- Do not produce a final response until both subagents return.
106
- Do not synthesize partial results.
107
- Wait for two separate `crew-result` messages.
93
+ Merge only findings that are clearly the same issue reported by both reviewers.
108
94
 
109
- ### 5) Merge reports
95
+ ### Code Review Findings
110
96
 
111
- Final output must be in the same language as the user's prompt.
112
- Use the structure below directly. Do not read any subagent definition files just to reconstruct the format.
97
+ Include findings reported only by `code-reviewer`.
113
98
 
114
- Order:
99
+ ### Quality Review Findings
115
100
 
116
- #### A. Consensus Findings
101
+ Include findings reported only by `quality-reviewer`.
117
102
 
118
- **[SEVERITY] Category: Brief title**
119
- File: `path/to/file.ts:123` or `path/to/file.ts` (section)
120
- Issue: Clear merged explanation
121
- Context/Impact: Runtime or maintenance impact
122
- Suggestion: Clear fix direction
123
- Reported by: `code-reviewer`, `quality-reviewer`
103
+ ### Final Summary
104
+
105
+ Include:
106
+
107
+ - review scope
108
+ - which reviewers ran
109
+ - consensus findings count
110
+ - code review findings count
111
+ - quality review findings count
112
+ - overall assessment
124
113
 
125
114
  Rules:
126
115
 
127
- - do not repeat the same issue
128
- - merge equivalent findings
129
- - if needed, use the stronger justified severity
130
-
131
- #### B. Code Review Findings
132
-
133
- **[SEVERITY] Category: Brief title**
134
- File: `path/to/file.ts:123`
135
- Issue: ...
136
- Context: ...
137
- Suggestion: ...
138
- Reported by: `code-reviewer`
139
-
140
- #### C. Quality Review Findings
141
-
142
- **[SEVERITY] Category: Brief title**
143
- File: `path/to/file.ts` (functionName or section, line range if identifiable)
144
- Issue: ...
145
- Impact: ...
146
- Suggestion: ...
147
- Reported by: `quality-reviewer`
148
-
149
- #### D. Final Summary
150
-
151
- **Combined Review Summary**
152
- Files reviewed: [count or list]
153
- Consensus findings: [count]
154
- Code review findings: [count by severity]
155
- Quality review findings: [count by severity]
156
- Strong signals: [titles found by both reviewers or `none`]
157
- Overall assessment: [short clear assessment]
158
-
159
- ## Synthesis Rules
160
-
161
- - do not repeat overlapping issues
162
- - merge close variants into one item
163
- - do not invent resolution for reviewer conflicts
164
- - if both say `No issues found.`, say so explicitly
165
- - if only one reviewer reports an issue, do not present it as consensus
166
- - sort by severity
167
- - no unnecessary introduction
168
- - review only, no code changes
169
-
170
- ## IMPORTANT
171
-
172
- - DO NOT perform any code review or quality review analysis yourself.
173
- - SPAWN the subagents with the review context and WAIT for their results.
174
- - NEVER PREDICT or FABRICATE results for subagents that have not yet reported back to you.
116
+ - Do not repeat overlapping findings.
117
+ - Do not invent reviewer output, evidence, or counts.
118
+ - Do not present a single-reviewer finding as consensus.
119
+ - If both reviewers report no issues, say so explicitly.
120
+ - If one reviewer failed or was unavailable, say so explicitly.
121
+ - Review only. Do not make code changes.
122
+ - Do not analyze code, infer issues, or produce findings yourself. Only orchestrate reviewers and merge their reported results.
123
+ - Never fabricate subagent results. Wait for all successfully spawned reviewers to return.
@@ -1,44 +0,0 @@
1
- import type { ExtensionAPI, ExtensionContext } from "@mariozechner/pi-coding-agent";
2
- import type { AgentConfig } from "./agent-discovery.js";
3
- import { type AbortableAgentSummary, type ActiveAgentSummary } from "./runtime/subagent-state.js";
4
- export type { AbortableAgentSummary, ActiveAgentSummary, } from "./runtime/subagent-state.js";
5
- export interface AbortOwnedResult {
6
- abortedIds: string[];
7
- missingIds: string[];
8
- foreignIds: string[];
9
- }
10
- interface AbortOptions {
11
- reason: string;
12
- }
13
- export declare class CrewManager {
14
- private extensionResolvedPath;
15
- private registry;
16
- private delivery;
17
- private overflowAbortControllers;
18
- onWidgetUpdate: (() => void) | undefined;
19
- constructor(extensionResolvedPath: string);
20
- activateSession(sessionId: string, isIdle: () => boolean, pi: ExtensionAPI): void;
21
- spawn(agentConfig: AgentConfig, task: string, cwd: string, ownerSessionId: string, ctx: ExtensionContext, pi: ExtensionAPI): string;
22
- private attachSessionListeners;
23
- private attachSpawnedSession;
24
- /**
25
- * Single owner for post-prompt and terminal state transitions.
26
- * Publishes the outcome, updates state, and disposes finished subagents.
27
- */
28
- private settleAgent;
29
- private disposeAgent;
30
- private runPromptCycle;
31
- private spawnSession;
32
- respond(id: string, message: string, pi: ExtensionAPI, callerSessionId: string): {
33
- error?: string;
34
- };
35
- done(id: string, callerSessionId: string): {
36
- error?: string;
37
- };
38
- abort(id: string, pi: ExtensionAPI, opts: AbortOptions): boolean;
39
- abortOwned(ids: string[], callerSessionId: string, pi: ExtensionAPI, opts: AbortOptions): AbortOwnedResult;
40
- abortAllOwned(callerSessionId: string, pi: ExtensionAPI, opts: AbortOptions): string[];
41
- abortForOwner(ownerSessionId: string, pi: ExtensionAPI): void;
42
- getAbortableAgents(): AbortableAgentSummary[];
43
- getActiveSummariesForOwner(ownerSessionId: string): ActiveAgentSummary[];
44
- }