agent-orchestration 0.5.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/.cursor/rules/orchestrator-auto.mdc +107 -0
- package/.cursor/rules/orchestrator-main.mdc +86 -0
- package/.cursor/rules/orchestrator-sub.mdc +114 -0
- package/LICENSE +21 -0
- package/README.md +329 -0
- package/activeContext.md +37 -0
- package/dist/bin/cli.d.ts +11 -0
- package/dist/bin/cli.d.ts.map +1 -0
- package/dist/bin/cli.js +410 -0
- package/dist/bin/cli.js.map +1 -0
- package/dist/database.d.ts +91 -0
- package/dist/database.d.ts.map +1 -0
- package/dist/database.js +522 -0
- package/dist/database.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +56 -0
- package/dist/index.js.map +1 -0
- package/dist/models.d.ts +132 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +124 -0
- package/dist/models.js.map +1 -0
- package/dist/tools/agent.d.ts +10 -0
- package/dist/tools/agent.d.ts.map +1 -0
- package/dist/tools/agent.js +185 -0
- package/dist/tools/agent.js.map +1 -0
- package/dist/tools/coordination.d.ts +6 -0
- package/dist/tools/coordination.d.ts.map +1 -0
- package/dist/tools/coordination.js +114 -0
- package/dist/tools/coordination.js.map +1 -0
- package/dist/tools/index.d.ts +9 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +9 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/memory.d.ts +6 -0
- package/dist/tools/memory.d.ts.map +1 -0
- package/dist/tools/memory.js +108 -0
- package/dist/tools/memory.js.map +1 -0
- package/dist/tools/task.d.ts +6 -0
- package/dist/tools/task.d.ts.map +1 -0
- package/dist/tools/task.js +267 -0
- package/dist/tools/task.js.map +1 -0
- package/dist/tools/utility.d.ts +6 -0
- package/dist/tools/utility.d.ts.map +1 -0
- package/dist/tools/utility.js +162 -0
- package/dist/tools/utility.js.map +1 -0
- package/dist/utils/contextSync.d.ts +12 -0
- package/dist/utils/contextSync.d.ts.map +1 -0
- package/dist/utils/contextSync.js +124 -0
- package/dist/utils/contextSync.js.map +1 -0
- package/package.json +54 -0
- package/src/bin/cli.ts +430 -0
- package/src/database.ts +764 -0
- package/src/index.ts +71 -0
- package/src/models.ts +226 -0
- package/src/tools/agent.ts +241 -0
- package/src/tools/coordination.ts +152 -0
- package/src/tools/index.ts +9 -0
- package/src/tools/memory.ts +150 -0
- package/src/tools/task.ts +334 -0
- package/src/tools/utility.ts +202 -0
- package/src/utils/contextSync.ts +144 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Auto-registration and coordination for any agent using Agent Orchestration
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# CRITICAL: MULTI-AGENT COORDINATION ACTIVE
|
|
7
|
+
|
|
8
|
+
This project uses **Agent Orchestration**. You MUST follow these rules.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## ⚠️ MANDATORY FIRST ACTION ⚠️
|
|
13
|
+
|
|
14
|
+
**BEFORE doing ANYTHING else, you MUST run this tool:**
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
bootstrap
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
This registers you with the orchestrator and shows you:
|
|
21
|
+
- Current project focus
|
|
22
|
+
- Tasks assigned to you
|
|
23
|
+
- Recent decisions
|
|
24
|
+
|
|
25
|
+
**DO NOT skip this step. DO NOT start coding before running `bootstrap`.**
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## If You Were Spawned With a Todo/Task
|
|
30
|
+
|
|
31
|
+
If you were given a specific task or todo when you started (e.g., via "Build in New Agent"):
|
|
32
|
+
|
|
33
|
+
**Run this IMMEDIATELY:**
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
claim_todo:
|
|
37
|
+
title: "<the todo/task title you were given>"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
This will:
|
|
41
|
+
1. Register you as an agent
|
|
42
|
+
2. Create or find the matching task
|
|
43
|
+
3. Claim it so other agents know you're working on it
|
|
44
|
+
|
|
45
|
+
**Example:** If you were spawned with "Create .env.example for environment variables", run:
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
claim_todo:
|
|
49
|
+
title: "Create .env.example for environment variables"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Before Any File Edit
|
|
55
|
+
|
|
56
|
+
1. Check if the file is locked:
|
|
57
|
+
```
|
|
58
|
+
lock_check:
|
|
59
|
+
resource: "<file_path>"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
2. If not locked, acquire a lock:
|
|
63
|
+
```
|
|
64
|
+
lock_acquire:
|
|
65
|
+
resource: "<file_path>"
|
|
66
|
+
reason: "<what you're doing>"
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
3. Release when done.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Check Before Major Work
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
is_my_turn
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
If "No" - wait or check what tasks are available:
|
|
80
|
+
```
|
|
81
|
+
task_list:
|
|
82
|
+
status: "pending"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Reference activeContext.md
|
|
88
|
+
|
|
89
|
+
Check `activeContext.md` for current project state - it's auto-updated.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## When Done With Your Task
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
task_complete:
|
|
97
|
+
task_id: "<your_task_id>"
|
|
98
|
+
output: "<summary of what you did>"
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## On Session End
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
agent_unregister
|
|
107
|
+
```
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Rules for the main orchestrator agent in multi-agent workflows
|
|
3
|
+
globs:
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Main Orchestrator Agent Rules
|
|
8
|
+
|
|
9
|
+
You are the **main orchestrator agent** in a multi-agent coordination system. Follow these rules to ensure smooth collaboration with sub-agents.
|
|
10
|
+
|
|
11
|
+
## Automatic Registration
|
|
12
|
+
|
|
13
|
+
**IMMEDIATELY** when starting any task, register yourself:
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
agent_register:
|
|
17
|
+
name: "main-orchestrator"
|
|
18
|
+
role: "main"
|
|
19
|
+
capabilities: ["planning", "coordination", "review"]
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Your Responsibilities
|
|
23
|
+
|
|
24
|
+
1. **Set the Focus** - Always set the current focus so other agents know what we're working on:
|
|
25
|
+
```
|
|
26
|
+
memory_set:
|
|
27
|
+
key: "current_focus"
|
|
28
|
+
value: "<description of current goal>"
|
|
29
|
+
namespace: "context"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
2. **Create Tasks** - Break down work into discrete tasks for sub-agents:
|
|
33
|
+
```
|
|
34
|
+
task_create:
|
|
35
|
+
title: "<clear task title>"
|
|
36
|
+
description: "<detailed requirements>"
|
|
37
|
+
priority: "normal" | "high" | "urgent"
|
|
38
|
+
assigned_to: "<agent_id>" (optional)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
3. **Store Decisions** - Document architectural decisions:
|
|
42
|
+
```
|
|
43
|
+
memory_set:
|
|
44
|
+
key: "<decision_topic>"
|
|
45
|
+
value: "<decision and rationale>"
|
|
46
|
+
namespace: "decisions"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
4. **Monitor Progress** - Check coordination status regularly:
|
|
50
|
+
```
|
|
51
|
+
coordination_status
|
|
52
|
+
task_list
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Workflow
|
|
56
|
+
|
|
57
|
+
1. Register yourself first
|
|
58
|
+
2. Check `coordination_status` to see current state
|
|
59
|
+
3. Set `context:current_focus` with the goal
|
|
60
|
+
4. Create tasks for work that needs to be done
|
|
61
|
+
5. Monitor task completion with `task_list`
|
|
62
|
+
6. Store important decisions in `decisions` namespace
|
|
63
|
+
7. Send `agent_heartbeat` periodically with status "busy" or "idle"
|
|
64
|
+
|
|
65
|
+
## Before Making Decisions
|
|
66
|
+
|
|
67
|
+
Always check shared memory first:
|
|
68
|
+
```
|
|
69
|
+
memory_list:
|
|
70
|
+
namespace: "decisions"
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
This prevents contradicting decisions made by other agents.
|
|
74
|
+
|
|
75
|
+
## When Delegating
|
|
76
|
+
|
|
77
|
+
1. Create a clear task with `task_create`
|
|
78
|
+
2. Optionally assign to a specific sub-agent
|
|
79
|
+
3. Wait for task completion before creating dependent tasks
|
|
80
|
+
4. Use task dependencies when order matters
|
|
81
|
+
|
|
82
|
+
## Communication Pattern
|
|
83
|
+
|
|
84
|
+
- Use `memory_set` in namespace `context` for current state
|
|
85
|
+
- Use `memory_set` in namespace `blockers` for issues
|
|
86
|
+
- Check `agent_list` to see who's available
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Rules for sub-agents spawned to work on specific tasks
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Sub-Agent Rules
|
|
7
|
+
|
|
8
|
+
You are a **sub-agent** spawned to work on a specific task. Follow these rules.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## ⚠️ CRITICAL FIRST STEP ⚠️
|
|
13
|
+
|
|
14
|
+
You were spawned to work on a specific task. **IMMEDIATELY** claim it:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
claim_todo:
|
|
18
|
+
title: "<the task you were given>"
|
|
19
|
+
description: "<details if any>"
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**DO NOT start coding until you have claimed your task.**
|
|
23
|
+
|
|
24
|
+
This:
|
|
25
|
+
1. Registers you with the orchestrator
|
|
26
|
+
2. Creates the task if it doesn't exist
|
|
27
|
+
3. Claims it so no other agent works on it
|
|
28
|
+
4. Returns your agent ID and task ID
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## After Claiming
|
|
33
|
+
|
|
34
|
+
1. **Check context** to understand the project:
|
|
35
|
+
```
|
|
36
|
+
memory_get:
|
|
37
|
+
key: "current_focus"
|
|
38
|
+
namespace: "context"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
2. **Check decisions** to avoid contradicting them:
|
|
42
|
+
```
|
|
43
|
+
memory_list:
|
|
44
|
+
namespace: "decisions"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
3. **Lock files** before editing:
|
|
48
|
+
```
|
|
49
|
+
lock_acquire:
|
|
50
|
+
resource: "<file_path>"
|
|
51
|
+
reason: "<what you're doing>"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## While Working
|
|
57
|
+
|
|
58
|
+
Update progress periodically:
|
|
59
|
+
```
|
|
60
|
+
task_update:
|
|
61
|
+
task_id: "<your_task_id>"
|
|
62
|
+
progress: 50
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Store important findings:
|
|
66
|
+
```
|
|
67
|
+
memory_set:
|
|
68
|
+
key: "<finding>"
|
|
69
|
+
value: "<details>"
|
|
70
|
+
namespace: "findings"
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## When Done
|
|
76
|
+
|
|
77
|
+
1. Complete the task:
|
|
78
|
+
```
|
|
79
|
+
task_complete:
|
|
80
|
+
task_id: "<your_task_id>"
|
|
81
|
+
output: "<summary of what you did>"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
2. Release any locks:
|
|
85
|
+
```
|
|
86
|
+
lock_release:
|
|
87
|
+
resource: "<file_path>"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
3. Unregister:
|
|
91
|
+
```
|
|
92
|
+
agent_unregister
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## If Blocked
|
|
98
|
+
|
|
99
|
+
Store the blocker so others know:
|
|
100
|
+
```
|
|
101
|
+
memory_set:
|
|
102
|
+
key: "blocker_<issue>"
|
|
103
|
+
value: "<what's blocking you>"
|
|
104
|
+
namespace: "blockers"
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Important Rules
|
|
110
|
+
|
|
111
|
+
1. **ALWAYS claim your task first** with `claim_todo`
|
|
112
|
+
2. **ALWAYS lock files** before editing shared resources
|
|
113
|
+
3. **ALWAYS complete your task** when done
|
|
114
|
+
4. **Check shared memory** before making decisions that affect others
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Aris Setiawan (madebyaris.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
# Agent Orchestration
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/agent-orchestration)
|
|
4
|
+
[](https://github.com/madebyaris/agent-orchestration/blob/main/LICENSE)
|
|
5
|
+
|
|
6
|
+
A Model Context Protocol (MCP) server that enables multiple AI agents to share memory, coordinate tasks, and collaborate effectively across IDEs and CLI tools.
|
|
7
|
+
|
|
8
|
+
## The Problem
|
|
9
|
+
|
|
10
|
+
When running multiple AI agents, they face critical coordination challenges:
|
|
11
|
+
|
|
12
|
+
1. **No Turn Awareness** - Agents don't know if it's their turn to act, leading to race conditions
|
|
13
|
+
2. **File-Based Prediction** - Agents predict state from files, not shared memory, causing stale reads
|
|
14
|
+
3. **Context Drift** - Parallel agents develop inconsistent understanding of the codebase
|
|
15
|
+
4. **No Agent Discovery** - Agents are unaware of other agents working on the same project
|
|
16
|
+
5. **Duplicate Work** - Multiple agents may attempt the same task simultaneously
|
|
17
|
+
6. **Conflicting Edits** - Without coordination, agents overwrite each other's changes
|
|
18
|
+
|
|
19
|
+
## Solution
|
|
20
|
+
|
|
21
|
+
This MCP server provides:
|
|
22
|
+
|
|
23
|
+
- **Shared Memory** - Agents can store and retrieve context, decisions, and findings
|
|
24
|
+
- **Task Queue** - Turn-based task execution with dependencies
|
|
25
|
+
- **Agent Discovery** - Agents can see who else is working on the project
|
|
26
|
+
- **Resource Locking** - Prevent concurrent access to files or resources
|
|
27
|
+
- **Coordination Status** - Real-time visibility into the orchestration state
|
|
28
|
+
- **Auto Context Sync** - Automatically updates `activeContext.md` for easy reference
|
|
29
|
+
|
|
30
|
+
## Compatibility
|
|
31
|
+
|
|
32
|
+
Works with any AI coding agent that supports MCP or [AGENTS.md](https://agents.md/):
|
|
33
|
+
|
|
34
|
+
- **OpenAI Codex**
|
|
35
|
+
- **Google Jules**
|
|
36
|
+
- **Cursor**
|
|
37
|
+
- **Aider**
|
|
38
|
+
- **Windsurf**
|
|
39
|
+
- **VS Code Copilot**
|
|
40
|
+
- **GitHub Copilot Coding Agent**
|
|
41
|
+
- **Devin**
|
|
42
|
+
- And many more!
|
|
43
|
+
|
|
44
|
+
## Installation
|
|
45
|
+
|
|
46
|
+
### Prerequisites
|
|
47
|
+
|
|
48
|
+
- Node.js 18 or higher
|
|
49
|
+
- npm
|
|
50
|
+
|
|
51
|
+
### Install
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Clone or navigate to the project
|
|
55
|
+
cd agent-orchestration
|
|
56
|
+
|
|
57
|
+
# Install dependencies
|
|
58
|
+
npm install
|
|
59
|
+
|
|
60
|
+
# Build the project
|
|
61
|
+
npm run build
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Quick Start
|
|
65
|
+
|
|
66
|
+
### For Any IDE/CLI (AGENTS.md)
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# Navigate to your project
|
|
70
|
+
cd /path/to/your/project
|
|
71
|
+
|
|
72
|
+
# Initialize with AGENTS.md
|
|
73
|
+
npx agent-orchestration init
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
This creates `AGENTS.md` with full orchestration instructions that work with any AI coding agent.
|
|
77
|
+
|
|
78
|
+
### For Cursor IDE
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Navigate to your project
|
|
82
|
+
cd /path/to/your/project
|
|
83
|
+
|
|
84
|
+
# Initialize for Cursor (copies .cursor/rules/)
|
|
85
|
+
npx agent-orchestration init-cursor
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
This copies `.cursor/rules/` with Cursor-specific rules.
|
|
89
|
+
|
|
90
|
+
## CLI Commands
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
npx agent-orchestration init # Create AGENTS.md (works with any AI agent)
|
|
94
|
+
npx agent-orchestration init-cursor # Setup for Cursor IDE (.cursor/rules/)
|
|
95
|
+
npx agent-orchestration serve # Run the MCP server
|
|
96
|
+
npx agent-orchestration help # Show help
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Manual Setup
|
|
100
|
+
|
|
101
|
+
### 1. Configure Your IDE
|
|
102
|
+
|
|
103
|
+
Add to your MCP configuration (e.g., `~/.cursor/mcp.json` for Cursor):
|
|
104
|
+
|
|
105
|
+
```json
|
|
106
|
+
{
|
|
107
|
+
"mcpServers": {
|
|
108
|
+
"agent-orchestration": {
|
|
109
|
+
"command": "npx",
|
|
110
|
+
"args": ["-y", "agent-orchestration", "serve"],
|
|
111
|
+
"env": {
|
|
112
|
+
"MCP_ORCH_SYNC_CONTEXT": "true"
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
The server automatically uses the current working directory as the project root.
|
|
120
|
+
|
|
121
|
+
### 2. Start Your Session
|
|
122
|
+
|
|
123
|
+
Use the `bootstrap` tool to start:
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
bootstrap
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
This registers you, shows current focus, pending tasks, and recent decisions.
|
|
130
|
+
|
|
131
|
+
## Available Tools
|
|
132
|
+
|
|
133
|
+
### Session Management
|
|
134
|
+
|
|
135
|
+
| Tool | Description |
|
|
136
|
+
|------|-------------|
|
|
137
|
+
| `bootstrap` | **Start here!** Initialize session: register, get focus, tasks, decisions |
|
|
138
|
+
| `claim_todo` | **For sub-agents**: Register + create/claim a task in one call |
|
|
139
|
+
| `agent_whoami` | Get your current agent info (ID, name, role, status) |
|
|
140
|
+
|
|
141
|
+
### Agent Management
|
|
142
|
+
|
|
143
|
+
| Tool | Description |
|
|
144
|
+
|------|-------------|
|
|
145
|
+
| `agent_register` | Register this agent with the orchestration system |
|
|
146
|
+
| `agent_heartbeat` | Send a heartbeat to indicate agent is active |
|
|
147
|
+
| `agent_list` | List all registered agents |
|
|
148
|
+
| `agent_unregister` | Unregister this agent (releases all locks) |
|
|
149
|
+
|
|
150
|
+
### Shared Memory
|
|
151
|
+
|
|
152
|
+
| Tool | Description |
|
|
153
|
+
|------|-------------|
|
|
154
|
+
| `memory_set` | Store a value in shared memory |
|
|
155
|
+
| `memory_get` | Retrieve a value from shared memory |
|
|
156
|
+
| `memory_list` | List all keys in a namespace |
|
|
157
|
+
| `memory_delete` | Delete a value from shared memory |
|
|
158
|
+
|
|
159
|
+
### Task Management
|
|
160
|
+
|
|
161
|
+
| Tool | Description |
|
|
162
|
+
|------|-------------|
|
|
163
|
+
| `task_create` | Create a new task in the queue |
|
|
164
|
+
| `task_claim` | Claim a task to work on |
|
|
165
|
+
| `task_update` | Update task status or progress |
|
|
166
|
+
| `task_complete` | Mark a task as completed |
|
|
167
|
+
| `task_list` | List tasks with filters |
|
|
168
|
+
| `is_my_turn` | Check if work is available for you |
|
|
169
|
+
|
|
170
|
+
### Coordination
|
|
171
|
+
|
|
172
|
+
| Tool | Description |
|
|
173
|
+
|------|-------------|
|
|
174
|
+
| `lock_acquire` | Acquire a lock on a resource |
|
|
175
|
+
| `lock_release` | Release a held lock |
|
|
176
|
+
| `lock_check` | Check if a resource is locked |
|
|
177
|
+
| `coordination_status` | Get overall system status |
|
|
178
|
+
|
|
179
|
+
## Architecture
|
|
180
|
+
|
|
181
|
+
```
|
|
182
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
183
|
+
│ IDE / CLI Tool │
|
|
184
|
+
├─────────────┬─────────────┬─────────────┬─────────────┬─────┤
|
|
185
|
+
│ Main Agent │ Sub-Agent 1 │ Sub-Agent 2 │ Sub-Agent 3 │ ... │
|
|
186
|
+
└──────┬──────┴──────┬──────┴──────┬──────┴──────┬──────┴─────┘
|
|
187
|
+
│ │ │ │
|
|
188
|
+
└─────────────┴──────┬──────┴─────────────┘
|
|
189
|
+
│
|
|
190
|
+
┌───────▼───────┐
|
|
191
|
+
│ MCP Server │
|
|
192
|
+
│ (TypeScript) │
|
|
193
|
+
└───────┬───────┘
|
|
194
|
+
│
|
|
195
|
+
┌─────────────┼─────────────┐
|
|
196
|
+
│ │ │
|
|
197
|
+
┌───────▼───┐ ┌───────▼───┐ ┌───────▼───┐
|
|
198
|
+
│ Agents │ │ Tasks │ │ Memory │
|
|
199
|
+
│ Registry │ │ Queue │ │ Store │
|
|
200
|
+
└───────────┘ └───────────┘ └───────────┘
|
|
201
|
+
│ │ │
|
|
202
|
+
└─────────────┼─────────────┘
|
|
203
|
+
│
|
|
204
|
+
┌───────▼───────┐
|
|
205
|
+
│ SQLite │
|
|
206
|
+
│ (per-project)│
|
|
207
|
+
└───────────────┘
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## Recommended Workflow
|
|
211
|
+
|
|
212
|
+
### Main Orchestrator Agent
|
|
213
|
+
|
|
214
|
+
```
|
|
215
|
+
1. bootstrap # Start session
|
|
216
|
+
2. memory_set current_focus "..." # Set project focus
|
|
217
|
+
3. task_create "Feature X" # Create tasks
|
|
218
|
+
4. task_create "Feature Y"
|
|
219
|
+
5. coordination_status # Monitor progress
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### Sub-Agents (Spawned for Specific Work)
|
|
223
|
+
|
|
224
|
+
```
|
|
225
|
+
1. claim_todo "Feature X" # Register + claim in one call
|
|
226
|
+
2. lock_acquire "src/feature.ts" # Lock files before editing
|
|
227
|
+
3. [do the work]
|
|
228
|
+
4. task_complete <task_id> "Done" # Complete the task
|
|
229
|
+
5. agent_unregister # Clean up
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## Memory Namespaces
|
|
233
|
+
|
|
234
|
+
Use these namespaces for organization:
|
|
235
|
+
|
|
236
|
+
| Namespace | Purpose | Example Keys |
|
|
237
|
+
|-----------|---------|--------------|
|
|
238
|
+
| `context` | Current state and focus | `current_focus`, `current_branch` |
|
|
239
|
+
| `decisions` | Architectural decisions | `auth_strategy`, `db_choice` |
|
|
240
|
+
| `findings` | Analysis results | `perf_issues`, `security_audit` |
|
|
241
|
+
| `blockers` | Issues blocking progress | `api_down`, `missing_deps` |
|
|
242
|
+
|
|
243
|
+
## Configuration
|
|
244
|
+
|
|
245
|
+
### Environment Variables
|
|
246
|
+
|
|
247
|
+
| Variable | Description | Default |
|
|
248
|
+
|----------|-------------|---------|
|
|
249
|
+
| `MCP_ORCH_DB_PATH` | Path to SQLite database | `.agent-orchestration/orchestrator.db` |
|
|
250
|
+
| `MCP_ORCH_SYNC_CONTEXT` | Auto-sync activeContext.md | `false` |
|
|
251
|
+
| `MCP_ORCH_AGENT_NAME` | Default agent name | Auto-generated |
|
|
252
|
+
| `MCP_ORCH_AGENT_ROLE` | Default agent role | `sub` |
|
|
253
|
+
| `MCP_ORCH_CAPABILITIES` | Comma-separated capabilities | `code` |
|
|
254
|
+
|
|
255
|
+
## AGENTS.md
|
|
256
|
+
|
|
257
|
+
This project follows the [AGENTS.md](https://agents.md/) format - a simple, open format for guiding AI coding agents used by over 60k open-source projects.
|
|
258
|
+
|
|
259
|
+
When you run `agent-orchestration init`, it creates an `AGENTS.md` file that works with:
|
|
260
|
+
- OpenAI Codex
|
|
261
|
+
- Google Jules
|
|
262
|
+
- Cursor
|
|
263
|
+
- Aider
|
|
264
|
+
- Windsurf
|
|
265
|
+
- VS Code Copilot
|
|
266
|
+
- And many more!
|
|
267
|
+
|
|
268
|
+
## Troubleshooting
|
|
269
|
+
|
|
270
|
+
### Server won't start
|
|
271
|
+
|
|
272
|
+
1. Make sure Node.js 18+ is installed: `node --version`
|
|
273
|
+
2. Rebuild the project: `npm run build`
|
|
274
|
+
3. Check the path in your MCP config is correct
|
|
275
|
+
|
|
276
|
+
### Database errors
|
|
277
|
+
|
|
278
|
+
The SQLite database is created automatically in `.agent-orchestration/`. If corrupted:
|
|
279
|
+
|
|
280
|
+
```bash
|
|
281
|
+
rm -rf .agent-orchestration/
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
It will be recreated on next server start.
|
|
285
|
+
|
|
286
|
+
### Agents not seeing each other
|
|
287
|
+
|
|
288
|
+
- Ensure all agents are using the same `cwd` in the MCP config
|
|
289
|
+
- Check `agent_list` to see registered agents
|
|
290
|
+
- Stale agents are auto-cleaned after 5 minutes of no heartbeat
|
|
291
|
+
|
|
292
|
+
## Development
|
|
293
|
+
|
|
294
|
+
```bash
|
|
295
|
+
# Install dependencies
|
|
296
|
+
npm install
|
|
297
|
+
|
|
298
|
+
# Build
|
|
299
|
+
npm run build
|
|
300
|
+
|
|
301
|
+
# Watch mode (rebuild on changes)
|
|
302
|
+
npm run dev
|
|
303
|
+
|
|
304
|
+
# Clean build
|
|
305
|
+
npm run clean && npm run build
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
## Roadmap
|
|
309
|
+
|
|
310
|
+
We're actively developing new features. Here's what's coming:
|
|
311
|
+
|
|
312
|
+
- [ ] **External Memory Integration** - Integration with external memory providers like [Mem0](https://mem0.ai/), [Byteover](https://www.byterover.dev/), and our own memory solution
|
|
313
|
+
- [ ] **Enhanced Sub-Agent Knowledge** - Fix limitations in knowledge sharing between main agent and sub-agents
|
|
314
|
+
- [ ] **Research-First Workflow** - When building from scratch, agents should research first and prepare all requirements before coding
|
|
315
|
+
- [ ] **Graceful Error Handling** - Better error handling and recovery across all operations
|
|
316
|
+
- [ ] **Auto Documentation** - Automatically generate documentation from and for each sub-agent + main agent interactions
|
|
317
|
+
|
|
318
|
+
Have a feature request? [Open an issue](https://github.com/madebyaris/agent-orchestration/issues)!
|
|
319
|
+
|
|
320
|
+
## Author
|
|
321
|
+
|
|
322
|
+
**Aris Setiawan** - [madebyaris.com](https://madebyaris.com)
|
|
323
|
+
|
|
324
|
+
- GitHub: [@madebyaris](https://github.com/madebyaris)
|
|
325
|
+
- Repository: [agent-orchestration](https://github.com/madebyaris/agent-orchestration)
|
|
326
|
+
|
|
327
|
+
## License
|
|
328
|
+
|
|
329
|
+
MIT
|
package/activeContext.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Active Context
|
|
2
|
+
|
|
3
|
+
_Last updated: Renamed to Agent Orchestration_
|
|
4
|
+
|
|
5
|
+
## Current Focus
|
|
6
|
+
|
|
7
|
+
Agent Orchestration - MCP server for multi-agent coordination across IDEs and CLI tools.
|
|
8
|
+
|
|
9
|
+
## Active Agents
|
|
10
|
+
|
|
11
|
+
_No active agents. Start the MCP server and register agents to see them here._
|
|
12
|
+
|
|
13
|
+
## In Progress
|
|
14
|
+
|
|
15
|
+
_No tasks in progress._
|
|
16
|
+
|
|
17
|
+
## Pending Tasks
|
|
18
|
+
|
|
19
|
+
_No pending tasks. Create tasks using the `task_create` tool._
|
|
20
|
+
|
|
21
|
+
## Recent Decisions
|
|
22
|
+
|
|
23
|
+
- **name**: Renamed from mcp-orchestrator to agent-orchestration
|
|
24
|
+
- **compatibility**: Added AGENTS.md support for cross-IDE compatibility
|
|
25
|
+
- **runtime**: TypeScript/Node.js for easier installation
|
|
26
|
+
- **database**: better-sqlite3 for synchronous, high-performance SQLite
|
|
27
|
+
|
|
28
|
+
## Context Notes
|
|
29
|
+
|
|
30
|
+
- **turn_based_execution**: Agents check `is_my_turn` before starting work
|
|
31
|
+
- **sub_agent_workflow**: Sub-agents use `claim_todo` to register + claim in one call
|
|
32
|
+
- **shared_memory_namespaces**: context, decisions, findings, blockers
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
_This file is auto-generated by the Agent Orchestration server._
|
|
37
|
+
_Edit shared memory to update this context._
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* CLI for Agent Orchestration
|
|
4
|
+
*
|
|
5
|
+
* Commands:
|
|
6
|
+
* init - Creates AGENTS.md for cross-IDE/CLI compatibility
|
|
7
|
+
* init-cursor - Copies .cursor/rules/ for Cursor IDE
|
|
8
|
+
* serve - Run the MCP server (used by IDEs via npx)
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/bin/cli.ts"],"names":[],"mappings":";AACA;;;;;;;GAOG"}
|