|
1 | | -import type { Mode } from '../keyword/keyword.types'; |
| 1 | +// Mode is defined in keyword.types but importing it directly creates a circular dependency |
| 2 | +// (agent.types → keyword.types → execution-plan.types ← agent.types via re-export). |
| 3 | +// Local alias breaks the cycle while preserving type safety. |
| 4 | +type Mode = 'PLAN' | 'ACT' | 'EVAL' | 'AUTO'; |
| 5 | + |
| 6 | +import type { |
| 7 | + DispatchedAgent, |
| 8 | + TaskmaestroDispatch, |
| 9 | + TeamsDispatch, |
| 10 | + VisibilityConfig, |
| 11 | + ExecutionPlan, |
| 12 | +} from './execution-plan.types'; |
2 | 13 |
|
3 | 14 | /** |
4 | 15 | * Agent Stack - a pre-configured team of agents for common workflows |
@@ -69,156 +80,23 @@ export interface ParallelAgentSet { |
69 | 80 | failedAgents?: FailedAgent[]; |
70 | 81 | } |
71 | 82 |
|
72 | | -/** |
73 | | - * Dispatch parameters for a single agent, ready to use with Claude Code Task tool |
74 | | - */ |
75 | | -export interface DispatchParams { |
76 | | - subagent_type: 'general-purpose'; |
77 | | - prompt: string; |
78 | | - description: string; |
79 | | - run_in_background?: true; |
80 | | -} |
81 | | - |
82 | | -/** |
83 | | - * A dispatched agent with metadata and Task-tool-ready parameters |
84 | | - */ |
85 | | -export interface DispatchedAgent { |
86 | | - name: string; |
87 | | - displayName: string; |
88 | | - description: string; |
89 | | - dispatchParams: DispatchParams; |
90 | | -} |
91 | | - |
92 | | -/** |
93 | | - * Inner Teams coordination metadata embedded in a TaskMaestro pane assignment. |
94 | | - * Present only when the composable `taskmaestro+teams` strategy is active |
95 | | - * and the Teams capability gate is enabled. |
96 | | - */ |
97 | | -export interface InnerTeamsSpec { |
98 | | - type: 'teams'; |
99 | | - teamSpec: { |
100 | | - team_name: string; |
101 | | - description: string; |
102 | | - }; |
103 | | - teammates: Array<{ |
104 | | - name: string; |
105 | | - subagent_type: 'general-purpose'; |
106 | | - }>; |
107 | | -} |
108 | | - |
109 | | -/** |
110 | | - * A single TaskMaestro pane assignment with agent name and prompt. |
111 | | - * When the composable `taskmaestro+teams` strategy is active, |
112 | | - * `innerCoordination` carries the metadata a pane worker needs |
113 | | - * to bootstrap its inner Teams workflow. |
114 | | - */ |
115 | | -export interface TaskmaestroAssignment { |
116 | | - name: string; |
117 | | - displayName: string; |
118 | | - prompt: string; |
119 | | - /** Inner coordination metadata for composable taskmaestro+teams execution */ |
120 | | - innerCoordination?: InnerTeamsSpec; |
121 | | -} |
122 | | - |
123 | | -/** |
124 | | - * TaskMaestro dispatch configuration for parallel tmux pane execution |
125 | | - */ |
126 | | -export interface TaskmaestroDispatch { |
127 | | - sessionName: string; |
128 | | - paneCount: number; |
129 | | - assignments: TaskmaestroAssignment[]; |
130 | | -} |
131 | | - |
132 | | -/** |
133 | | - * A single teammate in a Teams dispatch configuration |
134 | | - */ |
135 | | -export interface TeamsTeammate { |
136 | | - name: string; |
137 | | - subagent_type: 'general-purpose'; |
138 | | - team_name: string; |
139 | | - prompt: string; |
140 | | -} |
141 | | - |
142 | | -/** |
143 | | - * Teams dispatch configuration for Claude Code native team coordination |
144 | | - */ |
145 | | -export interface TeamsDispatch { |
146 | | - team_name: string; |
147 | | - description: string; |
148 | | - teammates: TeamsTeammate[]; |
149 | | -} |
150 | | - |
151 | | -/** |
152 | | - * SendMessage-based progress reporting instructions for specialist visibility |
153 | | - */ |
154 | | -export interface VisibilityMessages { |
155 | | - onStart: string; |
156 | | - onFinding: string; |
157 | | - onComplete: string; |
158 | | -} |
159 | | - |
160 | | -/** |
161 | | - * Configuration for real-time specialist execution visibility via Teams messaging |
162 | | - */ |
163 | | -export interface VisibilityConfig { |
164 | | - reportTo: string; |
165 | | - format: string; |
166 | | - includeProgress: boolean; |
167 | | - messages?: VisibilityMessages; |
168 | | -} |
169 | | - |
170 | | -/** |
171 | | - * Execution layer: subagent strategy |
172 | | - */ |
173 | | -export interface SubagentLayer { |
174 | | - type: 'subagent'; |
175 | | - agents: DispatchedAgent[]; |
176 | | -} |
177 | | - |
178 | | -/** |
179 | | - * Execution layer: TaskMaestro tmux-based transport |
180 | | - */ |
181 | | -export interface TaskmaestroLayer { |
182 | | - type: 'taskmaestro'; |
183 | | - config: TaskmaestroDispatch; |
184 | | -} |
185 | | - |
186 | | -/** |
187 | | - * Execution layer: Claude Code native Teams coordination |
188 | | - */ |
189 | | -export interface TeamsLayer { |
190 | | - type: 'teams'; |
191 | | - config: TeamsDispatch; |
192 | | - visibility?: VisibilityConfig; |
193 | | -} |
194 | | - |
195 | | -/** |
196 | | - * Discriminated union of all execution layer types. |
197 | | - * Each layer represents a single execution strategy. |
198 | | - */ |
199 | | -export type ExecutionLayer = SubagentLayer | TaskmaestroLayer | TeamsLayer; |
200 | | - |
201 | | -/** |
202 | | - * Composable execution plan with outer transport and optional inner coordination. |
203 | | - * |
204 | | - * Simple plan: outerExecution only (e.g. subagent, taskmaestro, or teams) |
205 | | - * Nested plan: outerExecution + innerCoordination (e.g. taskmaestro + teams) |
206 | | - * |
207 | | - * @example |
208 | | - * // Simple subagent plan |
209 | | - * { outerExecution: { type: 'subagent', agents: [...] } } |
210 | | - * |
211 | | - * @example |
212 | | - * // Nested: TaskMaestro as transport, Teams as coordination |
213 | | - * { |
214 | | - * outerExecution: { type: 'taskmaestro', config: {...} }, |
215 | | - * innerCoordination: { type: 'teams', config: {...} } |
216 | | - * } |
217 | | - */ |
218 | | -export interface ExecutionPlan { |
219 | | - outerExecution: ExecutionLayer; |
220 | | - innerCoordination?: ExecutionLayer; |
221 | | -} |
| 83 | +// Re-export execution plan types from dedicated file (avoids circular dep with keyword.types) |
| 84 | +export type { |
| 85 | + DispatchParams, |
| 86 | + DispatchedAgent, |
| 87 | + InnerTeamsSpec, |
| 88 | + TaskmaestroAssignment, |
| 89 | + TaskmaestroDispatch, |
| 90 | + TeamsTeammate, |
| 91 | + TeamsDispatch, |
| 92 | + VisibilityMessages, |
| 93 | + VisibilityConfig, |
| 94 | + SubagentLayer, |
| 95 | + TaskmaestroLayer, |
| 96 | + TeamsLayer, |
| 97 | + ExecutionLayer, |
| 98 | + ExecutionPlan, |
| 99 | +} from './execution-plan.types'; |
222 | 100 |
|
223 | 101 | /** |
224 | 102 | * Result of dispatching agents for execution |
|
0 commit comments