|
| 1 | +Using the existing building blocks of sessions, worktrees, tmux, etc, we want to add the following feature: |
| 2 | + |
| 3 | +# Orchestration |
| 4 | + |
| 5 | +An orchestrator is distinct from a regular instance in that it can schedule and manage other instances. |
| 6 | + |
| 7 | +At a high level, an orchestrator does the following: |
| 8 | +1. Receives a prompt from the user as input |
| 9 | +2. Devises a plan to implement the prompt and surfaces it to the user for approval/revision |
| 10 | +3. Breaks down the plan into distinct tasks |
| 11 | +4. Creates worker instances to implement the tasks |
| 12 | +5. Gets notifications from the worker instances when they need help or complete tasks |
| 13 | +6. When each of the instances are done, the orchestrator merges the changes of each instance |
| 14 | +7. Present the diff as a single diff, which the user can then push, checkout, etc as currently possible |
| 15 | + |
| 16 | +### Implementation Details |
| 17 | + |
| 18 | +We should be able to capture the output of the orchestrator's plan and surface it in the text input overlay. |
| 19 | + |
| 20 | +Once the user accepts the plan, the orchestrator should create and manage worker instances to implement the plan. We need to be able to retrieve the commands of the orchestrator and translate them into discrete commands to create/manage worker instances. |
| 21 | + |
| 22 | +Here's a prompt for the orchestrator once it's plan has been accepted: |
| 23 | + |
| 24 | +<prompt> |
| 25 | +You are a project orchestrator. Your goal is to implement: %s |
| 26 | + |
| 27 | +Break this goal down into manageable tasks that can be assigned to worker instances. I'll help you develop a plan, then you can create and manage worker instances to implement specific tasks. |
| 28 | + |
| 29 | +You have these additional capabilities: |
| 30 | +1. You can create worker instances to implement specific tasks. |
| 31 | +2. You will be notified when a worker instance needs help or completes a task. |
| 32 | + |
| 33 | +To create a worker instance, respond with: |
| 34 | + |
| 35 | +<cs command> |
| 36 | + |
| 37 | +</cs command> |
| 38 | + |
| 39 | +</prompt> |
| 40 | + |
| 41 | +### UI |
| 42 | + |
| 43 | +The UI should be similar to the current UI, the user should be able to use 'o' to create an orchestrator instance, this should open the prompt overlay to send to the orchestrator. |
| 44 | + |
| 45 | +For any worker instance (spawned by an orchestrator), it should be shown in the list of instances but indented to show that it is a child of the orchestrator. |
0 commit comments