@elizaos/plugin-agent-orchestrator 2.0.0-alpha.1
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/LICENSE +21 -0
- package/README.md +248 -0
- package/package.json +83 -0
- package/python/README.md +95 -0
- package/python/dist/elizaos_plugin_agent_orchestrator-2.0.0-py3-none-any.whl +0 -0
- package/python/dist/elizaos_plugin_agent_orchestrator-2.0.0.tar.gz +0 -0
- package/python/elizaos_plugin_agent_orchestrator/__init__.py +84 -0
- package/python/elizaos_plugin_agent_orchestrator/__pycache__/__init__.cpython-313.pyc +0 -0
- package/python/elizaos_plugin_agent_orchestrator/__pycache__/config.cpython-313.pyc +0 -0
- package/python/elizaos_plugin_agent_orchestrator/__pycache__/service.cpython-313.pyc +0 -0
- package/python/elizaos_plugin_agent_orchestrator/__pycache__/types.cpython-313.pyc +0 -0
- package/python/elizaos_plugin_agent_orchestrator/actions/__init__.py +23 -0
- package/python/elizaos_plugin_agent_orchestrator/actions/__pycache__/__init__.cpython-313.pyc +0 -0
- package/python/elizaos_plugin_agent_orchestrator/actions/__pycache__/task_management.cpython-313.pyc +0 -0
- package/python/elizaos_plugin_agent_orchestrator/actions/task_management.py +404 -0
- package/python/elizaos_plugin_agent_orchestrator/config.py +28 -0
- package/python/elizaos_plugin_agent_orchestrator/providers/__init__.py +7 -0
- package/python/elizaos_plugin_agent_orchestrator/providers/__pycache__/__init__.cpython-313.pyc +0 -0
- package/python/elizaos_plugin_agent_orchestrator/providers/__pycache__/task_context.cpython-313.pyc +0 -0
- package/python/elizaos_plugin_agent_orchestrator/providers/task_context.py +58 -0
- package/python/elizaos_plugin_agent_orchestrator/py.typed +0 -0
- package/python/elizaos_plugin_agent_orchestrator/service.py +649 -0
- package/python/elizaos_plugin_agent_orchestrator/types.py +309 -0
- package/python/elizaos_plugin_agent_orchestrator.egg-info/PKG-INFO +119 -0
- package/python/elizaos_plugin_agent_orchestrator.egg-info/SOURCES.txt +17 -0
- package/python/elizaos_plugin_agent_orchestrator.egg-info/dependency_links.txt +1 -0
- package/python/elizaos_plugin_agent_orchestrator.egg-info/requires.txt +5 -0
- package/python/elizaos_plugin_agent_orchestrator.egg-info/top_level.txt +1 -0
- package/python/elizaos_plugin_discord/generated/specs/__init__.py +1 -0
- package/python/elizaos_plugin_discord/generated/specs/specs.py +77 -0
- package/python/pyproject.toml +56 -0
- package/python/tests/__init__.py +1 -0
- package/python/tests/__pycache__/__init__.cpython-313.pyc +0 -0
- package/python/tests/__pycache__/conftest.cpython-313-pytest-9.0.2.pyc +0 -0
- package/python/tests/__pycache__/test_service.cpython-313-pytest-9.0.2.pyc +0 -0
- package/python/tests/conftest.py +130 -0
- package/python/tests/test_service.py +140 -0
- package/rust/Cargo.toml +33 -0
- package/rust/README.md +112 -0
- package/rust/src/actions/mod.rs +173 -0
- package/rust/src/config.rs +111 -0
- package/rust/src/error.rs +30 -0
- package/rust/src/generated/specs/mod.rs +3 -0
- package/rust/src/generated/specs/specs.rs +27 -0
- package/rust/src/lib.rs +48 -0
- package/rust/src/providers/mod.rs +5 -0
- package/rust/src/providers/task_context.rs +50 -0
- package/rust/src/service.rs +771 -0
- package/rust/src/types.rs +275 -0
- package/typescript/dist/index.d.ts +9 -0
- package/typescript/dist/index.d.ts.map +1 -0
- package/typescript/dist/index.js +817 -0
- package/typescript/dist/index.js.map +18 -0
- package/typescript/dist/src/actions/task-management.d.ts +9 -0
- package/typescript/dist/src/actions/task-management.d.ts.map +1 -0
- package/typescript/dist/src/config.d.ts +4 -0
- package/typescript/dist/src/config.d.ts.map +1 -0
- package/typescript/dist/src/providers/task-context.d.ts +3 -0
- package/typescript/dist/src/providers/task-context.d.ts.map +1 -0
- package/typescript/dist/src/services/agent-orchestrator-service.d.ts +59 -0
- package/typescript/dist/src/services/agent-orchestrator-service.d.ts.map +1 -0
- package/typescript/dist/src/types.d.ts +113 -0
- package/typescript/dist/src/types.d.ts.map +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Shaw Walters and elizaOS Contributors
|
|
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,248 @@
|
|
|
1
|
+
# Agent Orchestrator Plugin
|
|
2
|
+
|
|
3
|
+
Multi-language orchestration plugin for ElizaOS that manages task lifecycles and delegates execution to registered agent providers.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This plugin provides:
|
|
8
|
+
|
|
9
|
+
- **Task lifecycle management** — create, pause, resume, cancel tasks
|
|
10
|
+
- **Provider-based execution model** — register custom agent providers that execute tasks
|
|
11
|
+
- **Event system** — subscribe to task state changes
|
|
12
|
+
- **Cross-platform parity** — TypeScript, Python, and Rust implementations with identical APIs
|
|
13
|
+
|
|
14
|
+
The orchestrator does **not** perform file I/O directly. File operations, shell commands, and other implementation work are delegated to sub-agent workers configured via providers.
|
|
15
|
+
|
|
16
|
+
## Implementations
|
|
17
|
+
|
|
18
|
+
| Language | Path | Status |
|
|
19
|
+
|------------|---------------------|--------|
|
|
20
|
+
| TypeScript | `typescript/` | ✅ |
|
|
21
|
+
| Python | `python/` | ✅ |
|
|
22
|
+
| Rust | `rust/` | ✅ |
|
|
23
|
+
|
|
24
|
+
All implementations share the same:
|
|
25
|
+
- Type definitions (TaskStatus, TaskStep, TaskResult, OrchestratedTask, etc.)
|
|
26
|
+
- Service API (create, pause, resume, cancel, search, etc.)
|
|
27
|
+
- Actions (CREATE_TASK, LIST_TASKS, SWITCH_TASK, SEARCH_TASKS, PAUSE_TASK, RESUME_TASK, CANCEL_TASK)
|
|
28
|
+
- Provider interface (AgentProvider with executeTask)
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
### TypeScript / Node.js
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install @elizaos/plugin-agent-orchestrator
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Python
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pip install elizaos-plugin-agent-orchestrator
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Rust
|
|
45
|
+
|
|
46
|
+
```toml
|
|
47
|
+
[dependencies]
|
|
48
|
+
elizaos-plugin-agent-orchestrator = "2.0"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Quick Start
|
|
52
|
+
|
|
53
|
+
### TypeScript
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
import {
|
|
57
|
+
agentOrchestratorPlugin,
|
|
58
|
+
configureAgentOrchestratorPlugin,
|
|
59
|
+
} from "@elizaos/plugin-agent-orchestrator";
|
|
60
|
+
|
|
61
|
+
// Define your agent provider
|
|
62
|
+
const myProvider = {
|
|
63
|
+
id: "my-agent",
|
|
64
|
+
label: "My Agent",
|
|
65
|
+
executeTask: async (task, ctx) => {
|
|
66
|
+
await ctx.appendOutput("Hello from my-agent");
|
|
67
|
+
await ctx.updateProgress(100);
|
|
68
|
+
return { success: true, summary: "done", filesCreated: [], filesModified: [] };
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// Configure before runtime.initialize()
|
|
73
|
+
configureAgentOrchestratorPlugin({
|
|
74
|
+
providers: [myProvider],
|
|
75
|
+
defaultProviderId: "my-agent",
|
|
76
|
+
getWorkingDirectory: () => process.cwd(),
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
// Register plugin
|
|
80
|
+
runtime.plugins.push(agentOrchestratorPlugin);
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Python
|
|
84
|
+
|
|
85
|
+
```python
|
|
86
|
+
from elizaos_plugin_agent_orchestrator import (
|
|
87
|
+
configure_agent_orchestrator_plugin,
|
|
88
|
+
AgentOrchestratorPluginOptions,
|
|
89
|
+
TaskResult,
|
|
90
|
+
plugin,
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
class MyProvider:
|
|
94
|
+
id = "my-agent"
|
|
95
|
+
label = "My Agent"
|
|
96
|
+
description = None
|
|
97
|
+
|
|
98
|
+
async def execute_task(self, task, ctx):
|
|
99
|
+
await ctx.append_output("Hello from my-agent")
|
|
100
|
+
await ctx.update_progress(100)
|
|
101
|
+
return TaskResult(success=True, summary="done")
|
|
102
|
+
|
|
103
|
+
configure_agent_orchestrator_plugin(
|
|
104
|
+
AgentOrchestratorPluginOptions(
|
|
105
|
+
providers=[MyProvider()],
|
|
106
|
+
default_provider_id="my-agent",
|
|
107
|
+
get_working_directory=lambda: os.getcwd(),
|
|
108
|
+
)
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
runtime.register_plugin(plugin)
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Rust
|
|
115
|
+
|
|
116
|
+
```rust
|
|
117
|
+
use elizaos_plugin_agent_orchestrator::{
|
|
118
|
+
configure_agent_orchestrator_plugin,
|
|
119
|
+
AgentOrchestratorPluginOptions,
|
|
120
|
+
AgentProvider,
|
|
121
|
+
TaskResult,
|
|
122
|
+
};
|
|
123
|
+
use std::sync::Arc;
|
|
124
|
+
|
|
125
|
+
struct MyProvider;
|
|
126
|
+
|
|
127
|
+
#[async_trait::async_trait]
|
|
128
|
+
impl AgentProvider for MyProvider {
|
|
129
|
+
fn id(&self) -> &str { "my-agent" }
|
|
130
|
+
fn label(&self) -> &str { "My Agent" }
|
|
131
|
+
|
|
132
|
+
async fn execute_task(&self, task: &OrchestratedTask, ctx: &ProviderTaskExecutionContext) -> TaskResult {
|
|
133
|
+
(ctx.append_output)("Hello from my-agent".to_string());
|
|
134
|
+
(ctx.update_progress)(100);
|
|
135
|
+
TaskResult::success("done")
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
configure_agent_orchestrator_plugin(
|
|
140
|
+
AgentOrchestratorPluginOptions::new(
|
|
141
|
+
vec![Arc::new(MyProvider)],
|
|
142
|
+
"my-agent",
|
|
143
|
+
|| std::env::current_dir().unwrap().to_string_lossy().to_string(),
|
|
144
|
+
)
|
|
145
|
+
);
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Actions
|
|
149
|
+
|
|
150
|
+
| Action | Description |
|
|
151
|
+
|--------|-------------|
|
|
152
|
+
| `CREATE_TASK` | Create a new orchestrated task |
|
|
153
|
+
| `LIST_TASKS` | List all tasks |
|
|
154
|
+
| `SWITCH_TASK` | Switch current task context |
|
|
155
|
+
| `SEARCH_TASKS` | Search tasks by query |
|
|
156
|
+
| `PAUSE_TASK` | Pause a running task |
|
|
157
|
+
| `RESUME_TASK` | Resume a paused task |
|
|
158
|
+
| `CANCEL_TASK` | Cancel a task |
|
|
159
|
+
|
|
160
|
+
## Task Lifecycle
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
pending → running → completed
|
|
164
|
+
↘ failed
|
|
165
|
+
↓
|
|
166
|
+
paused → running (resume)
|
|
167
|
+
↓
|
|
168
|
+
cancelled
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Provider Interface
|
|
172
|
+
|
|
173
|
+
Providers implement task execution logic. The orchestrator calls `executeTask` when a task starts.
|
|
174
|
+
|
|
175
|
+
```typescript
|
|
176
|
+
interface AgentProvider {
|
|
177
|
+
id: string; // Unique identifier
|
|
178
|
+
label: string; // Human-readable name
|
|
179
|
+
description?: string; // Optional description
|
|
180
|
+
|
|
181
|
+
executeTask(
|
|
182
|
+
task: OrchestratedTask,
|
|
183
|
+
ctx: ProviderTaskExecutionContext,
|
|
184
|
+
): Promise<TaskResult>;
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Execution Context
|
|
189
|
+
|
|
190
|
+
The context provides callbacks for reporting progress:
|
|
191
|
+
|
|
192
|
+
- `appendOutput(line)` — Add output to task history
|
|
193
|
+
- `updateProgress(percent)` — Update progress (0-100)
|
|
194
|
+
- `updateStep(stepId, status, output?)` — Update a plan step
|
|
195
|
+
- `isCancelled()` — Check if task was cancelled
|
|
196
|
+
- `isPaused()` — Check if task is paused
|
|
197
|
+
|
|
198
|
+
### Suggested Provider IDs
|
|
199
|
+
|
|
200
|
+
| ID | Description |
|
|
201
|
+
|----|-------------|
|
|
202
|
+
| `eliza` | Default Eliza worker with plugin-code |
|
|
203
|
+
| `claude-code` | Claude Code / Claude Agent SDK |
|
|
204
|
+
| `codex` | OpenAI Codex |
|
|
205
|
+
| `sweagent` | SWE-agent methodology |
|
|
206
|
+
| `opencode` | OpenCode CLI |
|
|
207
|
+
| `custom:*` | Your custom providers |
|
|
208
|
+
|
|
209
|
+
## Examples
|
|
210
|
+
|
|
211
|
+
See `typescript/examples/` for:
|
|
212
|
+
|
|
213
|
+
- **agent-team.ts** — Simple multi-agent team (planner, executor, reviewer)
|
|
214
|
+
- **star-trek-bridge.ts** — Star Trek bridge crew simulation
|
|
215
|
+
|
|
216
|
+
## Configuration
|
|
217
|
+
|
|
218
|
+
Environment variable: `ELIZA_CODE_ACTIVE_SUB_AGENT`
|
|
219
|
+
|
|
220
|
+
Set this to override the default provider for new tasks.
|
|
221
|
+
|
|
222
|
+
## Building
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
# Build all languages
|
|
226
|
+
bun run build
|
|
227
|
+
|
|
228
|
+
# Build individual
|
|
229
|
+
bun run build:ts
|
|
230
|
+
bun run build:rust
|
|
231
|
+
bun run build:python
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
## Testing
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
# Test all languages
|
|
238
|
+
bun run test
|
|
239
|
+
|
|
240
|
+
# Test individual
|
|
241
|
+
bun run test:ts
|
|
242
|
+
bun run test:rust
|
|
243
|
+
bun run test:python
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
## License
|
|
247
|
+
|
|
248
|
+
MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@elizaos/plugin-agent-orchestrator",
|
|
3
|
+
"version": "2.0.0-alpha.1",
|
|
4
|
+
"description": "Agent orchestration plugin for ElizaOS (task lifecycle + agent providers) with multi-agent demos",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "typescript/dist/index.js",
|
|
7
|
+
"types": "typescript/dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
"./package.json": "./package.json",
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./typescript/dist/index.d.ts",
|
|
12
|
+
"import": "./typescript/dist/index.js",
|
|
13
|
+
"default": "./typescript/dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"typescript/dist",
|
|
18
|
+
"python",
|
|
19
|
+
"rust/src",
|
|
20
|
+
"rust/Cargo.toml",
|
|
21
|
+
"README.md"
|
|
22
|
+
],
|
|
23
|
+
"keywords": [
|
|
24
|
+
"eliza",
|
|
25
|
+
"plugin",
|
|
26
|
+
"orchestrator",
|
|
27
|
+
"agents",
|
|
28
|
+
"tasks",
|
|
29
|
+
"multi-agent"
|
|
30
|
+
],
|
|
31
|
+
"author": "elizaOS",
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "https://github.com/elizaos/eliza.git"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "bun run build:ts && bun run build:rust && bun run build:python",
|
|
39
|
+
"build:ts": "cd typescript && bun run build.ts",
|
|
40
|
+
"build:rust": "test -d rust && cd rust && cargo build --release || echo 'Rust build skipped - no rust directory'",
|
|
41
|
+
"build:python": "test -d python && cd python && (python3 -m build 2>/dev/null || pyproject-build) || echo 'Python build skipped - no python directory'",
|
|
42
|
+
"dev": "cd typescript && bun --hot build.ts",
|
|
43
|
+
"clean": "rm -rf typescript/dist python/dist rust/target .turbo node_modules",
|
|
44
|
+
"test": "bun run test:ts && bun run test:rust && bun run test:python",
|
|
45
|
+
"test:ts": "cd typescript && vitest run || echo 'TypeScript tests skipped - no tests found'",
|
|
46
|
+
"test:rust": "test -d rust && cd rust && cargo test -- --test-threads=1 || echo 'Rust tests skipped'",
|
|
47
|
+
"test:python": "test -d python && cd python && python3 -m pytest -p no:anchorpy --asyncio-mode=auto || echo 'Python tests skipped'",
|
|
48
|
+
"typecheck": "tsc --noEmit -p typescript/tsconfig.json",
|
|
49
|
+
"lint": "bunx @biomejs/biome check --write ./typescript",
|
|
50
|
+
"lint:check": "bunx @biomejs/biome check ./typescript",
|
|
51
|
+
"lint:rust": "test -d rust && cd rust && cargo clippy --all-targets --fix --allow-dirty --allow-staged -- -D warnings && cargo fmt || echo 'Rust lint skipped'",
|
|
52
|
+
"lint:python": "test -d python && cd python && ruff check --fix . && ruff format . || echo 'Python lint skipped'"
|
|
53
|
+
},
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"uuid": "^13.0.0"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@biomejs/biome": "^2.3.11",
|
|
59
|
+
"@types/bun": "^1.3.5",
|
|
60
|
+
"@types/node": "^25.0.6",
|
|
61
|
+
"typescript": "^5.9.3",
|
|
62
|
+
"vitest": "^4.0.17"
|
|
63
|
+
},
|
|
64
|
+
"peerDependencies": {
|
|
65
|
+
"@elizaos/core": "2.0.0-alpha.1"
|
|
66
|
+
},
|
|
67
|
+
"publishConfig": {
|
|
68
|
+
"access": "public"
|
|
69
|
+
},
|
|
70
|
+
"agentConfig": {
|
|
71
|
+
"pluginType": "elizaos:plugin:1.0.0",
|
|
72
|
+
"pluginParameters": {
|
|
73
|
+
"ELIZA_CODE_ACTIVE_SUB_AGENT": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"description": "Default agent provider ID for new tasks",
|
|
76
|
+
"required": false,
|
|
77
|
+
"default": "eliza",
|
|
78
|
+
"sensitive": false
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"gitHead": "05d4ca11d769db8c7f54a722ee24b2ce2b951543"
|
|
83
|
+
}
|
package/python/README.md
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Agent Orchestrator Plugin (Python)
|
|
2
|
+
|
|
3
|
+
Python implementation of the Agent Orchestrator plugin for ElizaOS.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This plugin orchestrates tasks across registered agent providers without performing
|
|
8
|
+
file I/O directly - that responsibility belongs to sub-agent workers.
|
|
9
|
+
|
|
10
|
+
## Features
|
|
11
|
+
|
|
12
|
+
- Task lifecycle management (create, pause, resume, cancel)
|
|
13
|
+
- Provider-based execution model
|
|
14
|
+
- Event system for task state changes
|
|
15
|
+
- Cross-platform parity with TypeScript and Rust implementations
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pip install elizaos-plugin-agent-orchestrator
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
from elizaos_plugin_agent_orchestrator import (
|
|
27
|
+
configure_agent_orchestrator_plugin,
|
|
28
|
+
AgentOrchestratorPluginOptions,
|
|
29
|
+
plugin,
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
# Define your agent provider
|
|
33
|
+
class MyProvider:
|
|
34
|
+
id = "my-agent"
|
|
35
|
+
label = "My Agent"
|
|
36
|
+
description = "Custom agent provider"
|
|
37
|
+
|
|
38
|
+
async def execute_task(self, task, ctx):
|
|
39
|
+
await ctx.append_output("Hello from my-agent")
|
|
40
|
+
await ctx.update_progress(100)
|
|
41
|
+
return TaskResult(
|
|
42
|
+
success=True,
|
|
43
|
+
summary="done",
|
|
44
|
+
files_created=[],
|
|
45
|
+
files_modified=[],
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
# Configure the plugin before runtime initialization
|
|
49
|
+
configure_agent_orchestrator_plugin(
|
|
50
|
+
AgentOrchestratorPluginOptions(
|
|
51
|
+
providers=[MyProvider()],
|
|
52
|
+
default_provider_id="my-agent",
|
|
53
|
+
get_working_directory=lambda: os.getcwd(),
|
|
54
|
+
)
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
# Register the plugin with your runtime
|
|
58
|
+
runtime.register_plugin(plugin)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Actions
|
|
62
|
+
|
|
63
|
+
- `CREATE_TASK` - Create a new orchestrated task
|
|
64
|
+
- `LIST_TASKS` - List all tasks
|
|
65
|
+
- `SWITCH_TASK` - Switch current task context
|
|
66
|
+
- `SEARCH_TASKS` - Search tasks by query
|
|
67
|
+
- `PAUSE_TASK` - Pause a running task
|
|
68
|
+
- `RESUME_TASK` - Resume a paused task
|
|
69
|
+
- `CANCEL_TASK` - Cancel a task
|
|
70
|
+
|
|
71
|
+
## Provider Interface
|
|
72
|
+
|
|
73
|
+
Providers must implement the `AgentProvider` protocol:
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
class AgentProvider(Protocol):
|
|
77
|
+
@property
|
|
78
|
+
def id(self) -> str: ...
|
|
79
|
+
|
|
80
|
+
@property
|
|
81
|
+
def label(self) -> str: ...
|
|
82
|
+
|
|
83
|
+
@property
|
|
84
|
+
def description(self) -> Optional[str]: ...
|
|
85
|
+
|
|
86
|
+
async def execute_task(
|
|
87
|
+
self,
|
|
88
|
+
task: OrchestratedTask,
|
|
89
|
+
ctx: ProviderTaskExecutionContext,
|
|
90
|
+
) -> TaskResult: ...
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## License
|
|
94
|
+
|
|
95
|
+
MIT
|
|
Binary file
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Agent Orchestrator Plugin for ElizaOS.
|
|
3
|
+
|
|
4
|
+
Orchestrates tasks across registered agent providers without performing
|
|
5
|
+
file I/O directly - that responsibility belongs to sub-agent workers.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from .actions import (
|
|
9
|
+
cancel_task_action,
|
|
10
|
+
create_task_action,
|
|
11
|
+
list_tasks_action,
|
|
12
|
+
pause_task_action,
|
|
13
|
+
resume_task_action,
|
|
14
|
+
search_tasks_action,
|
|
15
|
+
switch_task_action,
|
|
16
|
+
)
|
|
17
|
+
from .config import configure_agent_orchestrator_plugin, get_configured_options, reset_configuration
|
|
18
|
+
from .providers import task_context_provider
|
|
19
|
+
from .service import AgentOrchestratorService
|
|
20
|
+
from .types import (
|
|
21
|
+
AgentOrchestratorPluginOptions,
|
|
22
|
+
AgentProvider,
|
|
23
|
+
AgentProviderId,
|
|
24
|
+
JsonValue,
|
|
25
|
+
OrchestratedTask,
|
|
26
|
+
OrchestratedTaskMetadata,
|
|
27
|
+
ProviderTaskExecutionContext,
|
|
28
|
+
TaskEvent,
|
|
29
|
+
TaskEventType,
|
|
30
|
+
TaskResult,
|
|
31
|
+
TaskStatus,
|
|
32
|
+
TaskStep,
|
|
33
|
+
TaskUserStatus,
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
__all__ = [
|
|
37
|
+
# Types
|
|
38
|
+
"JsonValue",
|
|
39
|
+
"TaskStatus",
|
|
40
|
+
"TaskUserStatus",
|
|
41
|
+
"TaskStep",
|
|
42
|
+
"TaskResult",
|
|
43
|
+
"AgentProviderId",
|
|
44
|
+
"OrchestratedTaskMetadata",
|
|
45
|
+
"OrchestratedTask",
|
|
46
|
+
"ProviderTaskExecutionContext",
|
|
47
|
+
"AgentProvider",
|
|
48
|
+
"AgentOrchestratorPluginOptions",
|
|
49
|
+
"TaskEventType",
|
|
50
|
+
"TaskEvent",
|
|
51
|
+
# Service
|
|
52
|
+
"AgentOrchestratorService",
|
|
53
|
+
# Config
|
|
54
|
+
"configure_agent_orchestrator_plugin",
|
|
55
|
+
"get_configured_options",
|
|
56
|
+
"reset_configuration",
|
|
57
|
+
# Actions
|
|
58
|
+
"create_task_action",
|
|
59
|
+
"list_tasks_action",
|
|
60
|
+
"switch_task_action",
|
|
61
|
+
"search_tasks_action",
|
|
62
|
+
"pause_task_action",
|
|
63
|
+
"resume_task_action",
|
|
64
|
+
"cancel_task_action",
|
|
65
|
+
# Providers
|
|
66
|
+
"task_context_provider",
|
|
67
|
+
]
|
|
68
|
+
|
|
69
|
+
# Plugin definition for elizaos
|
|
70
|
+
plugin = {
|
|
71
|
+
"name": "agent-orchestrator",
|
|
72
|
+
"description": "Orchestrates tasks across registered agent providers",
|
|
73
|
+
"services": [AgentOrchestratorService],
|
|
74
|
+
"actions": [
|
|
75
|
+
create_task_action,
|
|
76
|
+
list_tasks_action,
|
|
77
|
+
switch_task_action,
|
|
78
|
+
search_tasks_action,
|
|
79
|
+
pause_task_action,
|
|
80
|
+
resume_task_action,
|
|
81
|
+
cancel_task_action,
|
|
82
|
+
],
|
|
83
|
+
"providers": [task_context_provider],
|
|
84
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Actions for the Agent Orchestrator plugin.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from .task_management import (
|
|
6
|
+
cancel_task_action,
|
|
7
|
+
create_task_action,
|
|
8
|
+
list_tasks_action,
|
|
9
|
+
pause_task_action,
|
|
10
|
+
resume_task_action,
|
|
11
|
+
search_tasks_action,
|
|
12
|
+
switch_task_action,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
__all__ = [
|
|
16
|
+
"create_task_action",
|
|
17
|
+
"list_tasks_action",
|
|
18
|
+
"switch_task_action",
|
|
19
|
+
"search_tasks_action",
|
|
20
|
+
"pause_task_action",
|
|
21
|
+
"resume_task_action",
|
|
22
|
+
"cancel_task_action",
|
|
23
|
+
]
|
|
Binary file
|