Agent Swarm
Manages multi-agent swarms with coordination, task sharding, self-organization, emergent behavior, and real-time monitoring for intelligent collective action.
MIT-0 · Free to use, modify, and redistribute. No attribution required.
⭐ 0 · 18 · 0 current installs · 0 all-time installs
MIT-0
Security Scan
OpenClaw
Benign
high confidencePurpose & Capability
Name/description describe a multi-agent swarm coordinator; the code implements a SwarmCoordinator with task sharding, agent registration, execution, and monitoring. There are no unrelated binaries, credentials, or services requested.
Instruction Scope
SKILL.md only documents the library API, usage examples, npm install/test commands, and feature descriptions. It does not instruct the agent to read system files, access environment secrets, or call external endpoints.
Install Mechanism
No install spec in the registry; package.json has no external dependencies and SKILL.md suggests running npm install and npm test. No downloads from arbitrary URLs or archive extraction are present.
Credentials
The skill declares no required environment variables or credentials and the source files do not read process.env or access system config paths.
Persistence & Privilege
Skill has default privileges (not always:true). It does not modify other skills or agent-wide configuration and requires no persistent system presence.
Assessment
This package appears internally consistent and runs entirely in-process (no network/credential access). Before installing, you may want to: (1) run the tests locally (npm test) in an isolated environment; (2) review the small source files yourself to confirm behavior; and (3) note that the registry entry lists an unknown source/homepage—if you need provenance, try to find an upstream repository or author before using it in production.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 Swarm - 群体智能核心
Agent 群体智能核心系统,实现真正的群体智能能力,包括群体协调、任务分片、自组织和涌现行为。
功能特性
1. 群体协调 (SwarmCoordinator)
- 群体生命周期管理
- 成员发现与注册
- 通信协议
- 共识机制
2. 任务分片 (TaskSharder)
- 任务分解
- 负载均衡
- 依赖管理
- 结果合并
3. 自组织 (SelfOrganizer)
- 角色分配
- 动态重组
- 故障转移
- 自适应调整
4. 涌现行为 (EmergentBehavior)
- 集体决策
- 模式识别
- 群体学习
- 智能涌现
5. Swarm 监控 (SwarmMonitor)
- 群体状态监控
- 性能指标
- 异常检测
- 可视化
安装
npm install
使用示例
const { SwarmCoordinator, TaskSharder, SelfOrganizer, SwarmMonitor } = require('./src');
// 创建群体协调器
const swarm = new SwarmCoordinator({
maxAgents: 100,
consensusThreshold: 0.7,
communicationProtocol: 'broadcast'
});
// 创建群体
const swarmId = swarm.createSwarm({
name: 'code-generation-swarm',
specialization: 'code'
});
// 添加 Agent
swarm.addAgent(swarmId, {
id: 'agent-1',
capabilities: ['javascript', 'python'],
capacity: 5
});
// 执行任务
const result = await swarm.executeTask(swarmId, {
type: 'generate-code',
input: 'Create a web server',
shardStrategy: 'parallel'
});
API 文档
SwarmCoordinator
Constructor Options
maxAgents(number): 最大 Agent 数量consensusThreshold(number): 共识阈值 (0-1)communicationProtocol(string): 通信协议 ('broadcast' | 'gossip' | 'direct')
Methods
createSwarm(config)- 创建新群体destroySwarm(swarmId)- 销毁群体addAgent(swarmId, agent)- 添加 AgentremoveAgent(swarmId, agentId)- 移除 AgentexecuteTask(swarmId, task)- 执行任务reachConsensus(swarmId, proposal)- 达成共识
TaskSharder
Methods
shard(taskConfig)- 分解任务assign(shards, agents)- 分配分片merge(results)- 合并结果getDependencies(shardId)- 获取依赖
SelfOrganizer
Methods
assignRoles(agents, config)- 分配角色adapt(swarm, config)- 自适应调整reorganize(swarmId)- 重新组织handleFailure(swarmId, agentId)- 处理故障
EmergentBehavior
Methods
collectiveDecision(swarm, options)- 集体决策recognizePattern(data)- 模式识别learnFromExperience(experience)- 群体学习detectEmergence(swarm)- 检测涌现
SwarmMonitor
Methods
getMetrics(swarmId)- 获取指标detectAnomalies(swarmId)- 异常检测getVisualization(swarmId)- 获取可视化数据exportReport(swarmId)- 导出报告
测试
npm test
License
MIT
Files
5 totalSelect a file
Select a file to preview.
Comments
Loading comments…
