Agent Orchestrator
生产级 Agent 编排器,实现Agent生命周期管理、任务调度、资源限制、服务发现及多节点集群管理功能。
MIT-0 · Free to use, modify, and redistribute. No attribution required.
⭐ 0 · 9 · 0 current installs · 0 all-time installs
MIT-0
Security Scan
OpenClaw
Suspicious
medium confidencePurpose & Capability
The skill name/description (Agent Orchestrator) matches the included code and SKILL.md examples: lifecycle management, scheduling, health checks, load balancing, resource management and cluster features are implemented across files. Required env vars / binaries / config paths are not requested and none appear in the code, which is proportionate to the stated purpose.
Instruction Scope
The SKILL.md instructions are limited and appropriate (npm install, example usage, npm test). However, there are internal code inconsistencies that will cause runtime failures if you follow the instructions as-is: scheduler.js imports { v4: uuidv4 } from './utils' but utils.js exports uuidv4 (not a v4 property), so uuid generation will be undefined and scheduler.submit will throw at runtime. Also part of orchestrator.js shown is truncated and references private helpers like _broadcastEvent; the provided snippet references several internal functions/events whose implementations should be verified (no network endpoints are obvious in the visible code, but cluster features may introduce networking in omitted sections).
Install Mechanism
There is no install spec in the registry metadata; SKILL.md suggests running npm install and package.json is included. package.json has no third-party dependencies listed and scripts are basic (start/test). No external download URLs, tarballs, or untrusted installers are used — low install risk. Still run npm install in a sandbox before production use.
Credentials
The skill declares no required environment variables or credentials and the code does not read process.env or other system credential/config paths in the visible files. Requested privileges are proportional to the stated functionality.
Persistence & Privilege
The skill does not request 'always: true' or elevated persistence. It does not modify other skills or system settings in the visible code. Cluster mode exists as an option but enabling it appears to be an explicit runtime configuration, not automatic persistence.
What to consider before installing
This package appears to implement the orchestrator described, but treat it as untrusted code until you verify and fix issues. Recommended steps before installing or running in production:
- Run npm test and node src/index.js inside a sandbox or VM to observe runtime errors. The scheduler currently imports uuid incorrectly (scheduler.js expects a v4 export but utils.js provides uuidv4), which will cause failures — fix the import or export (e.g., change scheduler to const { uuidv4 } = require('./utils') or export v4 from utils).
- Search the remaining (truncated) parts of orchestrator.js for networking (HTTP/RPC) or code that opens sockets or calls external endpoints; cluster features often add network behavior and should be audited.
- Check for any uses of child_process, fs reads of system config, or process.env access in the omitted parts; these would raise additional concerns.
- If you plan to enable cluster mode, review the leader election and event broadcast implementations to confirm they don't leak data or open unexpected ports.
- Run the code with limited privileges, in an isolated environment, and inspect logs/events before trusting it in production.
- If you are not comfortable auditing or fixing the code, ask the author for a corrected release (fixing the uuid import/export and any missing implementations) or prefer an established orchestrator project with active maintainers.Like a lobster shell, security has layers — review code before you run it.
Current versionv0.1.0
Download ziplatest
License
MIT-0
Free to use, modify, and redistribute. No attribution required.
SKILL.md
Agent Orchestrator
生产级 Agent 编排器,类似 Kubernetes 的 Agent 调度系统。
功能特性
1. Agent 生命周期管理
- Agent 注册/注销
- 健康检查 (Heartbeat)
- 自动故障恢复
- 优雅启停
2. 任务调度器
- 任务队列管理
- 负载均衡策略 (Round Robin / Least Connections / 自定义)
- 优先级调度 (low/normal/high/critical)
- 任务超时/重试
3. 资源管理
- CPU/内存限制
- 并发控制
- 资源配额
- 资源监控
4. 服务发现
- Agent 能力注册
- 动态发现
- 负载感知路由
5. 集群管理
- 多节点支持
- Leader 选举
- 状态同步
- 配置管理
安装
npm install
使用方法
基础用法
const { AgentOrchestrator } = require('./src');
// 创建编排器实例
const orchestrator = new AgentOrchestrator({
cluster: { enabled: true, nodeId: 'node-1' },
scheduler: { strategy: 'round-robin' },
resources: { maxAgents: 100, maxTasksPerAgent: 10 }
});
// 注册 Agent
orchestrator.registerAgent({
id: 'agent-1',
capabilities: ['text-generation', 'code-execution'],
resources: { maxConcurrent: 5 }
});
// 提交任务
const task = await orchestrator.submitTask({
type: 'code-generation',
priority: 'high',
payload: { prompt: 'Generate a function...' }
});
// 获取集群状态
const status = orchestrator.getClusterStatus();
console.log(status);
调度策略
// Round Robin
const orchestrator = new AgentOrchestrator({
scheduler: { strategy: 'round-robin' }
});
// Least Connections
const orchestrator = new AgentOrchestrator({
scheduler: { strategy: 'least-connections' }
});
// Weighted Round Robin
const orchestrator = new AgentOrchestrator({
scheduler: { strategy: 'weighted-round-robin', weights: { 'agent-1': 2, 'agent-2': 1 } }
});
健康检查
// 配置健康检查
const orchestrator = new AgentOrchestrator({
healthCheck: {
enabled: true,
interval: 30000, // 30 seconds
timeout: 5000, // 5 seconds
retries: 3
}
});
// 手动检查 Agent 健康
const isHealthy = await orchestrator.healthChecker.check('agent-1');
资源管理
// 配置资源限制
const orchestrator = new AgentOrchestrator({
resources: {
maxAgents: 100,
maxTasksPerAgent: 10,
maxMemoryPerAgent: '512MB',
maxCpuPerAgent: '1.0'
}
});
// 获取资源使用
const usage = orchestrator.resourceManager.getUsage();
API 参考
AgentOrchestrator
Constructor
new AgentOrchestrator(options)
Options:
cluster: 集群配置scheduler: 调度器配置resources: 资源限制healthCheck: 健康检查配置
Methods
registerAgent(agent): 注册 AgentunregisterAgent(agentId): 注销 AgentsubmitTask(task): 提交任务cancelTask(taskId): 取消任务getClusterStatus(): 获取集群状态getAgentStatus(agentId): 获取 Agent 状态
测试
npm test
配置选项
{
cluster: {
enabled: true,
nodeId: 'node-1',
leaderElection: true
},
scheduler: {
strategy: 'round-robin', // or 'least-connections', 'weighted-round-robin'
priorityLevels: ['low', 'normal', 'high', 'critical']
},
resources: {
maxAgents: 100,
maxTasksPerAgent: 10,
maxMemoryPerAgent: '512MB',
maxCpuPerAgent: '1.0'
},
healthCheck: {
enabled: true,
interval: 30000,
timeout: 5000,
retries: 3
}
}
License
MIT
Files
11 totalSelect a file
Select a file to preview.
Comments
Loading comments…
